demo-agents.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import { AgentProfile, AgentStatus } from "@/types/agent";
  2. export const demoAgents: AgentProfile[] = [
  3. {
  4. id: "main-orchestrator",
  5. name: "main",
  6. role: "主调度 Agent",
  7. avatarKind: "male-dispatcher",
  8. status: "working",
  9. statusLabel: "工作中",
  10. host: "macbook-ops.local",
  11. owner: "OpenClaw Core",
  12. currentTask: "拆分今日任务并下发给 news-intel、ops-updater、research-assistant",
  13. taskId: "orch-20260327-0841",
  14. taskStage: "dispatching",
  15. queueDepth: 3,
  16. todayCompleted: 18,
  17. uptime: "12天 4小时",
  18. lastHeartbeat: "2秒前",
  19. updatedAt: "刚刚",
  20. lastOutput: "已完成一轮任务编排,正在等待下游 agent 回传结果。",
  21. tags: ["调度", "编排", "主控"]
  22. },
  23. {
  24. id: "news-intel",
  25. name: "news-intel",
  26. role: "情报汇总 Agent",
  27. avatarKind: "female-analyst",
  28. status: "working",
  29. statusLabel: "工作中",
  30. host: "macbook-ops.local",
  31. owner: "OpenClaw Intel",
  32. currentTask: "整理今天的资讯摘要与来源,并准备发送给 main",
  33. taskId: "intel-20260327-0915",
  34. taskStage: "summarizing",
  35. queueDepth: 2,
  36. todayCompleted: 9,
  37. uptime: "18天 9小时",
  38. lastHeartbeat: "5秒前",
  39. updatedAt: "1分钟前",
  40. lastOutput: "最近一次摘要已经生成,等待主调度确认是否继续扩展来源。",
  41. tags: ["情报", "摘要", "采集"]
  42. },
  43. {
  44. id: "ops-updater",
  45. name: "ops-updater",
  46. role: "运维巡检 Agent",
  47. avatarKind: "male-ops",
  48. status: "working",
  49. statusLabel: "工作中",
  50. host: "macbook-ops.local",
  51. owner: "OpenClaw Infra",
  52. currentTask: "执行 openclaw-daily-security-check 与服务可用性巡检",
  53. taskId: "ops-20260327-0932",
  54. taskStage: "checking",
  55. queueDepth: 1,
  56. todayCompleted: 14,
  57. uptime: "22天 1小时",
  58. lastHeartbeat: "8秒前",
  59. updatedAt: "2分钟前",
  60. lastOutput: "巡检中记录到 1 条待人工确认告警,尚未升级为阻断事件。",
  61. tags: ["安全", "巡检", "更新"]
  62. },
  63. {
  64. id: "research-assistant",
  65. name: "research-assistant",
  66. role: "研究支持 Agent",
  67. avatarKind: "female-researcher",
  68. status: "idle",
  69. statusLabel: "待命",
  70. host: "macbook-ops.local",
  71. owner: "OpenClaw Research",
  72. currentTask: "等待新的研究主题进入任务队列",
  73. taskId: "idle",
  74. taskStage: "ready",
  75. queueDepth: 0,
  76. todayCompleted: 6,
  77. uptime: "5天 7小时",
  78. lastHeartbeat: "18秒前",
  79. updatedAt: "6分钟前",
  80. lastOutput: "上一条输出是资料整理清单,已同步到共享上下文。",
  81. tags: ["研究", "整理", "支持"]
  82. },
  83. {
  84. id: "observer-panel",
  85. name: "observer-panel",
  86. role: "状态观察 Agent",
  87. avatarKind: "female-observer",
  88. status: "warning",
  89. statusLabel: "待确认",
  90. host: "macbook-ops.local",
  91. owner: "OpenClaw Observe",
  92. currentTask: "等待人工确认一条心跳异常告警",
  93. taskId: "obs-20260327-0745",
  94. taskStage: "waiting_ack",
  95. queueDepth: 1,
  96. todayCompleted: 11,
  97. uptime: "9天 2小时",
  98. lastHeartbeat: "41秒前",
  99. updatedAt: "9分钟前",
  100. lastOutput: "检测到一个子任务心跳偏长,建议检查是否需要重试。",
  101. lastError: "heartbeat_delay_warning",
  102. tags: ["监控", "观察", "告警"]
  103. },
  104. {
  105. id: "session-maintainer",
  106. name: "session-maintainer",
  107. role: "会话维护 Agent",
  108. avatarKind: "male-maintainer",
  109. status: "offline",
  110. statusLabel: "离线",
  111. host: "macbook-ops.local",
  112. owner: "OpenClaw Session",
  113. currentTask: "当前未接入状态总线",
  114. taskId: "offline",
  115. taskStage: "disconnected",
  116. queueDepth: 0,
  117. todayCompleted: 0,
  118. uptime: "0天 0小时",
  119. lastHeartbeat: "14小时前",
  120. updatedAt: "昨天",
  121. lastOutput: "最后一次上报发生在昨晚 22:17,之后未再回传会话状态。",
  122. lastError: "agent_offline",
  123. tags: ["会话", "心跳", "维护"]
  124. }
  125. ];
  126. export const agentStatusFilters: Array<{ key: "all" | AgentStatus; label: string }> = [
  127. { key: "all", label: "全部" },
  128. { key: "working", label: "工作中" },
  129. { key: "idle", label: "待命" },
  130. { key: "warning", label: "待确认" },
  131. { key: "offline", label: "离线" }
  132. ];
  133. export function getAgentById(agentId: string) {
  134. return demoAgents.find((agent) => agent.id === agentId);
  135. }