plugin-agent-orchestrator 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +16 -291
  2. package/dist/client/AIEmployeesContext.d.ts +7 -0
  3. package/dist/client/OrchestratorSettings.d.ts +2 -1
  4. package/dist/client/index.js +1 -1
  5. package/dist/client/plugin.d.ts +1 -0
  6. package/dist/client/skill-hub/components/ExecutionHistory.d.ts +2 -0
  7. package/dist/client/skill-hub/components/ExecutionProgress.d.ts +20 -0
  8. package/dist/client/skill-hub/components/GitSkillImport.d.ts +7 -0
  9. package/dist/client/skill-hub/components/SkillEditor.d.ts +7 -0
  10. package/dist/client/skill-hub/components/SkillManager.d.ts +2 -0
  11. package/dist/client/skill-hub/components/SkillMetrics.d.ts +2 -0
  12. package/dist/client/skill-hub/components/SkillTestPanel.d.ts +7 -0
  13. package/dist/client/skill-hub/index.d.ts +10 -0
  14. package/dist/client/skill-hub/locale.d.ts +3 -0
  15. package/dist/client/skill-hub/tools/InteractionSchemasProvider.d.ts +19 -0
  16. package/dist/client/skill-hub/tools/SkillHubCard.d.ts +3 -0
  17. package/dist/client/skill-hub/utils/jsonFields.d.ts +3 -0
  18. package/dist/externalVersion.js +6 -6
  19. package/dist/node_modules/adm-zip/LICENSE +21 -0
  20. package/dist/node_modules/adm-zip/adm-zip.js +1 -0
  21. package/dist/node_modules/adm-zip/headers/entryHeader.js +377 -0
  22. package/dist/node_modules/adm-zip/headers/index.js +2 -0
  23. package/dist/node_modules/adm-zip/headers/mainHeader.js +130 -0
  24. package/dist/node_modules/adm-zip/methods/deflater.js +33 -0
  25. package/dist/node_modules/adm-zip/methods/index.js +3 -0
  26. package/dist/node_modules/adm-zip/methods/inflater.js +34 -0
  27. package/dist/node_modules/adm-zip/methods/zipcrypto.js +175 -0
  28. package/dist/node_modules/adm-zip/package.json +1 -0
  29. package/dist/node_modules/adm-zip/util/constants.js +142 -0
  30. package/dist/node_modules/adm-zip/util/decoder.js +5 -0
  31. package/dist/node_modules/adm-zip/util/errors.js +63 -0
  32. package/dist/node_modules/adm-zip/util/fattr.js +76 -0
  33. package/dist/node_modules/adm-zip/util/index.js +5 -0
  34. package/dist/node_modules/adm-zip/util/utils.js +339 -0
  35. package/dist/node_modules/adm-zip/zipEntry.js +405 -0
  36. package/dist/node_modules/adm-zip/zipFile.js +446 -0
  37. package/dist/node_modules/simple-git/dist/cjs/index.js +7399 -0
  38. package/dist/node_modules/simple-git/dist/esm/index.js +4745 -0
  39. package/dist/node_modules/simple-git/dist/esm/package.json +3 -0
  40. package/dist/node_modules/simple-git/dist/src/lib/api.d.ts +13 -0
  41. package/dist/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +9 -0
  42. package/dist/node_modules/simple-git/dist/src/lib/errors/git-construct-error.d.ts +15 -0
  43. package/dist/node_modules/simple-git/dist/src/lib/errors/git-error.d.ts +30 -0
  44. package/dist/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +7 -0
  45. package/dist/node_modules/simple-git/dist/src/lib/errors/git-response-error.d.ts +32 -0
  46. package/dist/node_modules/simple-git/dist/src/lib/errors/task-configuration-error.d.ts +12 -0
  47. package/dist/node_modules/simple-git/dist/src/lib/git-factory.d.ts +15 -0
  48. package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +21 -0
  49. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch-delete.d.ts +5 -0
  50. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +2 -0
  51. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-commit.d.ts +2 -0
  52. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +3 -0
  53. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-fetch.d.ts +2 -0
  54. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-list-log-summary.d.ts +6 -0
  55. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-merge.d.ts +11 -0
  56. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-move.d.ts +2 -0
  57. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-pull.d.ts +6 -0
  58. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-push.d.ts +4 -0
  59. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-remote-messages.d.ts +5 -0
  60. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-remote-objects.d.ts +3 -0
  61. package/dist/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -0
  62. package/dist/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +3 -0
  63. package/dist/node_modules/simple-git/dist/src/lib/plugins/command-config-prefixing-plugin.d.ts +2 -0
  64. package/dist/node_modules/simple-git/dist/src/lib/plugins/completion-detection.plugin.d.ts +3 -0
  65. package/dist/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +3 -0
  66. package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +7 -0
  67. package/dist/node_modules/simple-git/dist/src/lib/plugins/index.d.ts +11 -0
  68. package/dist/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +11 -0
  69. package/dist/node_modules/simple-git/dist/src/lib/plugins/progress-monitor-plugin.d.ts +3 -0
  70. package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +48 -0
  71. package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +3 -0
  72. package/dist/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -0
  73. package/dist/node_modules/simple-git/dist/src/lib/plugins/timout-plugin.d.ts +3 -0
  74. package/dist/node_modules/simple-git/dist/src/lib/responses/BranchDeleteSummary.d.ts +12 -0
  75. package/dist/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +14 -0
  76. package/dist/node_modules/simple-git/dist/src/lib/responses/CheckIgnore.d.ts +4 -0
  77. package/dist/node_modules/simple-git/dist/src/lib/responses/CleanSummary.d.ts +9 -0
  78. package/dist/node_modules/simple-git/dist/src/lib/responses/ConfigList.d.ts +13 -0
  79. package/dist/node_modules/simple-git/dist/src/lib/responses/DiffSummary.d.ts +10 -0
  80. package/dist/node_modules/simple-git/dist/src/lib/responses/FileStatusSummary.d.ts +9 -0
  81. package/dist/node_modules/simple-git/dist/src/lib/responses/GetRemoteSummary.d.ts +11 -0
  82. package/dist/node_modules/simple-git/dist/src/lib/responses/InitSummary.d.ts +9 -0
  83. package/dist/node_modules/simple-git/dist/src/lib/responses/MergeSummary.d.ts +16 -0
  84. package/dist/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +25 -0
  85. package/dist/node_modules/simple-git/dist/src/lib/responses/StatusSummary.d.ts +19 -0
  86. package/dist/node_modules/simple-git/dist/src/lib/responses/TagList.d.ts +7 -0
  87. package/dist/node_modules/simple-git/dist/src/lib/runners/git-executor-chain.d.ts +25 -0
  88. package/dist/node_modules/simple-git/dist/src/lib/runners/git-executor.d.ts +14 -0
  89. package/dist/node_modules/simple-git/dist/src/lib/runners/promise-wrapped.d.ts +2 -0
  90. package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +11 -0
  91. package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +23 -0
  92. package/dist/node_modules/simple-git/dist/src/lib/simple-git-api.d.ts +20 -0
  93. package/dist/node_modules/simple-git/dist/src/lib/task-callback.d.ts +2 -0
  94. package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +3 -0
  95. package/dist/node_modules/simple-git/dist/src/lib/tasks/branch.d.ts +7 -0
  96. package/dist/node_modules/simple-git/dist/src/lib/tasks/change-working-directory.d.ts +2 -0
  97. package/dist/node_modules/simple-git/dist/src/lib/tasks/check-ignore.d.ts +2 -0
  98. package/dist/node_modules/simple-git/dist/src/lib/tasks/check-is-repo.d.ts +9 -0
  99. package/dist/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -0
  100. package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +25 -0
  101. package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +9 -0
  102. package/dist/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +4 -0
  103. package/dist/node_modules/simple-git/dist/src/lib/tasks/config.d.ts +8 -0
  104. package/dist/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +12 -0
  105. package/dist/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +12 -0
  106. package/dist/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +5 -0
  107. package/dist/node_modules/simple-git/dist/src/lib/tasks/fetch.d.ts +4 -0
  108. package/dist/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -0
  109. package/dist/node_modules/simple-git/dist/src/lib/tasks/grep.d.ts +12 -0
  110. package/dist/node_modules/simple-git/dist/src/lib/tasks/hash-object.d.ts +5 -0
  111. package/dist/node_modules/simple-git/dist/src/lib/tasks/init.d.ts +3 -0
  112. package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +32 -0
  113. package/dist/node_modules/simple-git/dist/src/lib/tasks/merge.d.ts +4 -0
  114. package/dist/node_modules/simple-git/dist/src/lib/tasks/move.d.ts +3 -0
  115. package/dist/node_modules/simple-git/dist/src/lib/tasks/pull.d.ts +3 -0
  116. package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +9 -0
  117. package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +8 -0
  118. package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +11 -0
  119. package/dist/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -0
  120. package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +4 -0
  121. package/dist/node_modules/simple-git/dist/src/lib/tasks/status.d.ts +3 -0
  122. package/dist/node_modules/simple-git/dist/src/lib/tasks/sub-module.d.ts +5 -0
  123. package/dist/node_modules/simple-git/dist/src/lib/tasks/tag.d.ts +18 -0
  124. package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +14 -0
  125. package/dist/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +9 -0
  126. package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +21 -0
  127. package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +136 -0
  128. package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +19 -0
  129. package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +14 -0
  130. package/dist/node_modules/simple-git/dist/src/lib/utils/exit-codes.d.ts +10 -0
  131. package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +7 -0
  132. package/dist/node_modules/simple-git/dist/src/lib/utils/index.d.ts +8 -0
  133. package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +15 -0
  134. package/dist/node_modules/simple-git/dist/src/lib/utils/simple-git-options.d.ts +2 -0
  135. package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +13 -0
  136. package/dist/node_modules/simple-git/dist/src/lib/utils/task-parser.d.ts +5 -0
  137. package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +47 -0
  138. package/dist/node_modules/simple-git/dist/typings/errors.d.ts +5 -0
  139. package/dist/node_modules/simple-git/dist/typings/index.d.ts +14 -0
  140. package/dist/node_modules/simple-git/dist/typings/response.d.ts +556 -0
  141. package/dist/node_modules/simple-git/dist/typings/simple-git.d.ts +1033 -0
  142. package/dist/node_modules/simple-git/dist/typings/types.d.ts +22 -0
  143. package/dist/node_modules/simple-git/node_modules/debug/package.json +64 -0
  144. package/dist/node_modules/simple-git/node_modules/debug/src/browser.js +272 -0
  145. package/dist/node_modules/simple-git/node_modules/debug/src/common.js +292 -0
  146. package/dist/node_modules/simple-git/node_modules/debug/src/index.js +10 -0
  147. package/dist/node_modules/simple-git/node_modules/debug/src/node.js +263 -0
  148. package/dist/node_modules/simple-git/package.json +1 -0
  149. package/dist/node_modules/simple-git/promise.js +17 -0
  150. package/dist/server/collections/agent-execution-spans.d.ts +9 -0
  151. package/dist/server/collections/agent-execution-spans.js +152 -0
  152. package/dist/server/collections/orchestrator-config.d.ts +1 -1
  153. package/dist/server/collections/orchestrator-config.js +6 -0
  154. package/dist/server/collections/orchestrator-logs.d.ts +1 -1
  155. package/dist/server/collections/skill-definitions.d.ts +2 -0
  156. package/dist/server/collections/skill-definitions.js +158 -0
  157. package/dist/server/collections/skill-executions.d.ts +2 -0
  158. package/dist/server/collections/skill-executions.js +123 -0
  159. package/dist/server/collections/skill-worker-configs.d.ts +2 -0
  160. package/dist/server/collections/skill-worker-configs.js +115 -0
  161. package/dist/server/migrations/20260423000000-add-progress-fields.d.ts +4 -0
  162. package/dist/server/migrations/20260423000000-add-progress-fields.js +69 -0
  163. package/dist/server/migrations/20260425000000-add-interaction-schema.d.ts +4 -0
  164. package/dist/server/migrations/20260425000000-add-interaction-schema.js +61 -0
  165. package/dist/server/migrations/20260427000000-change-packages-to-text.d.ts +4 -0
  166. package/dist/server/migrations/20260427000000-change-packages-to-text.js +70 -0
  167. package/dist/server/migrations/20260427000001-change-other-json-to-text.d.ts +4 -0
  168. package/dist/server/migrations/20260427000001-change-other-json-to-text.js +80 -0
  169. package/dist/server/migrations/20260429000000-add-llm-fields.js +8 -0
  170. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.d.ts +16 -0
  171. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.js +51 -0
  172. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.d.ts +7 -0
  173. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.js +57 -0
  174. package/dist/server/plugin.d.ts +3 -0
  175. package/dist/server/plugin.js +37 -1
  176. package/dist/server/resources/tracing.js +154 -11
  177. package/dist/server/services/CodeValidator.d.ts +32 -0
  178. package/dist/server/services/CodeValidator.js +206 -0
  179. package/dist/server/services/ExecutionSpanService.d.ts +44 -0
  180. package/dist/server/services/ExecutionSpanService.js +104 -0
  181. package/dist/server/services/FileManager.d.ts +28 -0
  182. package/dist/server/services/FileManager.js +151 -0
  183. package/dist/server/services/SandboxRunner.d.ts +41 -0
  184. package/dist/server/services/SandboxRunner.js +167 -0
  185. package/dist/server/services/SkillManager.d.ts +6 -0
  186. package/dist/server/services/SkillManager.js +640 -0
  187. package/dist/server/services/SkillRepositoryService.d.ts +22 -0
  188. package/dist/server/services/SkillRepositoryService.js +157 -0
  189. package/dist/server/services/WorkerEnvManager.d.ts +26 -0
  190. package/dist/server/services/WorkerEnvManager.js +120 -0
  191. package/dist/server/skill-hub/actions/git-import.d.ts +21 -0
  192. package/dist/server/skill-hub/actions/git-import.js +413 -0
  193. package/dist/server/skill-hub/mcp/McpController.d.ts +15 -0
  194. package/dist/server/skill-hub/mcp/McpController.js +111 -0
  195. package/dist/server/skill-hub/plugin.d.ts +58 -0
  196. package/dist/server/skill-hub/plugin.js +694 -0
  197. package/dist/server/skill-hub/sandbox-config.json +6 -0
  198. package/dist/server/skill-hub/tasks/SkillExecutionTask.d.ts +16 -0
  199. package/dist/server/skill-hub/tasks/SkillExecutionTask.js +389 -0
  200. package/dist/server/skill-hub/utils/json-fields.d.ts +7 -0
  201. package/dist/server/skill-hub/utils/json-fields.js +88 -0
  202. package/dist/server/tools/delegate-task.d.ts +4 -0
  203. package/dist/server/tools/delegate-task.js +606 -104
  204. package/dist/server/tools/skill-execute.d.ts +36 -0
  205. package/dist/server/tools/skill-execute.js +167 -0
  206. package/package.json +3 -1
  207. package/src/client/AIEmployeeSelect.tsx +1 -3
  208. package/src/client/AIEmployeesContext.tsx +28 -13
  209. package/src/client/OrchestratorSettings.tsx +43 -5
  210. package/src/client/RulesTab.tsx +253 -32
  211. package/src/client/TracingTab.tsx +277 -213
  212. package/src/client/index.tsx +1 -1
  213. package/src/client/plugin.tsx +54 -15
  214. package/src/client/skill-hub/components/ExecutionHistory.tsx +201 -0
  215. package/src/client/skill-hub/components/ExecutionProgress.tsx +55 -0
  216. package/src/client/skill-hub/components/GitSkillImport.tsx +555 -0
  217. package/src/client/skill-hub/components/SkillEditor.tsx +456 -0
  218. package/src/client/skill-hub/components/SkillManager.tsx +181 -0
  219. package/src/client/skill-hub/components/SkillMetrics.tsx +124 -0
  220. package/src/client/skill-hub/components/SkillTestPanel.tsx +144 -0
  221. package/src/client/skill-hub/index.tsx +75 -0
  222. package/src/client/skill-hub/locale.ts +16 -0
  223. package/src/client/skill-hub/tools/InteractionSchemasProvider.tsx +59 -0
  224. package/src/client/skill-hub/tools/SkillHubCard.tsx +78 -0
  225. package/src/client/skill-hub/utils/jsonFields.ts +37 -0
  226. package/src/server/collections/agent-execution-spans.ts +129 -0
  227. package/src/server/collections/orchestrator-config.ts +7 -0
  228. package/src/server/collections/skill-definitions.ts +128 -0
  229. package/src/server/collections/skill-executions.ts +94 -0
  230. package/src/server/collections/skill-worker-configs.ts +86 -0
  231. package/src/server/migrations/20260423000000-add-progress-fields.ts +50 -0
  232. package/src/server/migrations/20260425000000-add-interaction-schema.ts +35 -0
  233. package/src/server/migrations/20260427000000-add-tracing-detail-fields.ts +5 -5
  234. package/src/server/migrations/20260427000000-change-packages-to-text.ts +47 -0
  235. package/src/server/migrations/20260427000001-change-other-json-to-text.ts +57 -0
  236. package/src/server/migrations/20260429000000-add-llm-fields.ts +11 -2
  237. package/src/server/migrations/20260429000000-fix-inputargs-json-to-text.ts +38 -0
  238. package/src/server/migrations/20260503000000-add-orchestrator-trace-fields.ts +32 -0
  239. package/src/server/plugin.ts +94 -46
  240. package/src/server/resources/tracing.ts +182 -15
  241. package/src/server/services/CodeValidator.ts +159 -0
  242. package/src/server/services/ExecutionSpanService.ts +106 -0
  243. package/src/server/services/FileManager.ts +144 -0
  244. package/src/server/services/SandboxRunner.ts +205 -0
  245. package/src/server/services/SkillManager.ts +623 -0
  246. package/src/server/services/SkillRepositoryService.ts +142 -0
  247. package/src/server/services/WorkerEnvManager.ts +113 -0
  248. package/src/server/skill-hub/actions/git-import.ts +486 -0
  249. package/src/server/skill-hub/mcp/McpController.ts +86 -0
  250. package/src/server/skill-hub/plugin.ts +771 -0
  251. package/src/server/skill-hub/sandbox-config.json +6 -0
  252. package/src/server/skill-hub/tasks/SkillExecutionTask.ts +443 -0
  253. package/src/server/skill-hub/utils/json-fields.ts +57 -0
  254. package/src/server/tools/delegate-task.ts +803 -127
  255. package/src/server/tools/skill-execute.ts +157 -0
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useMemo, useState } from 'react';
2
2
  import {
3
3
  Table,
4
4
  Card,
@@ -13,54 +13,73 @@ import {
13
13
  Timeline,
14
14
  Collapse,
15
15
  Spin,
16
+ Select,
17
+ DatePicker,
18
+ Form,
16
19
  } from 'antd';
17
- import {
18
- EyeOutlined,
19
- CheckCircleOutlined,
20
- CloseCircleOutlined,
21
- } from '@ant-design/icons';
20
+ import { EyeOutlined, CheckCircleOutlined, CloseCircleOutlined, ReloadOutlined } from '@ant-design/icons';
22
21
  import { useAPIClient, useRequest } from '@nocobase/client';
23
22
  import { useAIEmployees } from './AIEmployeesContext';
24
23
 
25
24
  const { Text, Paragraph } = Typography;
25
+ const { RangePicker } = DatePicker;
26
+
27
+ type FilterState = {
28
+ leader?: string;
29
+ subAgent?: string;
30
+ status?: string;
31
+ range?: [any, any] | null;
32
+ };
26
33
 
27
34
  export const TracingTab: React.FC = () => {
28
35
  const api = useAPIClient();
29
36
  const [selectedLog, setSelectedLog] = useState<any>(null);
30
37
  const [detailLoading, setDetailLoading] = useState(false);
31
38
 
32
- const { data, loading, refresh } = useRequest({
33
- url: 'orchestratorTracing:list',
34
- params: {
39
+ const [page, setPage] = useState(1);
40
+ const [pageSize, setPageSize] = useState(20);
41
+ const [filters, setFilters] = useState<FilterState>({});
42
+
43
+ const { employees, employeeMap } = useAIEmployees();
44
+
45
+ const requestParams = useMemo(() => {
46
+ const filter: any = {};
47
+ if (filters.leader) filter.leaderUsername = filters.leader;
48
+ if (filters.subAgent) filter.subAgentUsername = filters.subAgent;
49
+ if (filters.status) filter.status = filters.status;
50
+ if (filters.range && (filters.range[0] || filters.range[1])) {
51
+ filter.createdAt = {};
52
+ if (filters.range[0]) filter.createdAt.$gte = filters.range[0].toDate().toISOString();
53
+ if (filters.range[1]) filter.createdAt.$lte = filters.range[1].toDate().toISOString();
54
+ }
55
+ return {
35
56
  sort: ['-createdAt'],
36
- pageSize: 50,
57
+ page,
58
+ pageSize,
59
+ filter,
60
+ };
61
+ }, [page, pageSize, filters]);
62
+
63
+ const { data, loading, refresh } = useRequest(
64
+ {
65
+ url: 'orchestratorTracing:list',
66
+ params: requestParams,
67
+ },
68
+ {
69
+ refreshDeps: [requestParams],
37
70
  },
38
- });
71
+ );
39
72
 
40
- const { employeeMap } = useAIEmployees();
41
- const logs = React.useMemo(() => {
42
- let rows = (data as any)?.data;
43
- // Handle double-wrapped NocoBase response data
44
- if (rows && !Array.isArray(rows) && Array.isArray(rows.data)) {
45
- rows = rows.data;
46
- }
47
- return Array.isArray(rows) ? rows : Array.isArray(data) ? data : [];
73
+ // Server returns { data: rows, meta: { count } }; useRequest unwraps to that shape.
74
+ const logs = useMemo(() => {
75
+ const rows = (data as any)?.data;
76
+ return Array.isArray(rows) ? rows : [];
48
77
  }, [data]);
49
78
 
50
- const groupedLogs = React.useMemo(() => {
51
- const groups = new Map<string, any[]>();
52
- for (const log of logs) {
53
- const key = log.leaderUsername || 'unknown';
54
- if (!groups.has(key)) {
55
- groups.set(key, []);
56
- }
57
- groups.get(key)!.push(log);
58
- }
59
- return Array.from(groups.entries()).map(([leaderUsername, items]) => ({
60
- leaderUsername,
61
- items,
62
- }));
63
- }, [logs]);
79
+ const total = useMemo(() => {
80
+ const count = (data as any)?.meta?.count;
81
+ return typeof count === 'number' ? count : 0;
82
+ }, [data]);
64
83
 
65
84
  const formatDuration = (ms: number) => {
66
85
  if (!ms) return '-';
@@ -73,7 +92,7 @@ export const TracingTab: React.FC = () => {
73
92
  try {
74
93
  const res = await api.request({
75
94
  url: 'orchestratorTracing:get',
76
- params: { filterByTk: record.id },
95
+ params: { filterByTk: record.id, source: record.hasUnifiedTrace ? 'span' : 'log' },
77
96
  });
78
97
  setSelectedLog((res as any)?.data?.data || (res as any)?.data || record);
79
98
  } finally {
@@ -81,29 +100,48 @@ export const TracingTab: React.FC = () => {
81
100
  }
82
101
  };
83
102
 
103
+ const updateFilter = (patch: Partial<FilterState>) => {
104
+ setFilters((prev) => ({ ...prev, ...patch }));
105
+ setPage(1);
106
+ };
107
+
108
+ const resetFilters = () => {
109
+ setFilters({});
110
+ setPage(1);
111
+ };
112
+
113
+ const employeeOptions = useMemo(
114
+ () =>
115
+ employees.map((e) => ({
116
+ label: e.nickname || e.username,
117
+ value: e.username,
118
+ })),
119
+ [employees],
120
+ );
121
+
122
+ const hasFilters = Boolean(
123
+ filters.leader || filters.subAgent || filters.status || (filters.range && (filters.range[0] || filters.range[1])),
124
+ );
125
+
84
126
  const columns = [
85
127
  {
86
128
  title: 'Time',
87
129
  dataIndex: 'createdAt',
88
130
  key: 'createdAt',
89
131
  width: 170,
90
- render: (v: string) => v ? new Date(v).toLocaleString() : '-',
132
+ render: (v: string) => (v ? new Date(v).toLocaleString() : '-'),
91
133
  },
92
134
  {
93
135
  title: 'Leader',
94
136
  dataIndex: 'leaderUsername',
95
137
  key: 'leaderUsername',
96
- render: (username: string) => (
97
- <Tag color="blue">{employeeMap.get(username) || username}</Tag>
98
- ),
138
+ render: (username: string) => <Tag color="blue">{employeeMap.get(username) || username}</Tag>,
99
139
  },
100
140
  {
101
141
  title: 'Sub-Agent',
102
142
  dataIndex: 'subAgentUsername',
103
143
  key: 'subAgentUsername',
104
- render: (username: string) => (
105
- <Tag color="green">{employeeMap.get(username) || username}</Tag>
106
- ),
144
+ render: (username: string) => <Tag color="green">{employeeMap.get(username) || username}</Tag>,
107
145
  },
108
146
  {
109
147
  title: 'Task',
@@ -148,12 +186,7 @@ export const TracingTab: React.FC = () => {
148
186
  key: 'actions',
149
187
  width: 80,
150
188
  render: (_: any, record: any) => (
151
- <Button
152
- type="link"
153
- size="small"
154
- icon={<EyeOutlined />}
155
- onClick={() => handleOpenLog(record)}
156
- >
189
+ <Button type="link" size="small" icon={<EyeOutlined />} onClick={() => handleOpenLog(record)}>
157
190
  Detail
158
191
  </Button>
159
192
  ),
@@ -166,199 +199,230 @@ export const TracingTab: React.FC = () => {
166
199
  type="info"
167
200
  showIcon
168
201
  style={{ marginBottom: 16 }}
169
- message="Swarm Tracing"
202
+ message="Execution Tracing"
170
203
  description={
171
204
  <Text type="secondary">
172
- View delegation execution logs. Each row represents one sub-agent invocation
173
- triggered by a Leader's tool call.
205
+ View orchestration execution logs. Each row represents one sub-agent invocation, with child tool and Skill
206
+ Hub executions shown in the detail flow.
174
207
  </Text>
175
208
  }
176
209
  />
177
210
 
178
211
  <Card bordered={false}>
179
- <div style={{ marginBottom: 16, display: 'flex', justifyContent: 'flex-end' }}>
180
- <Button onClick={refresh}>Refresh</Button>
181
- </div>
182
- {groupedLogs.length ? (
183
- <Collapse
184
- bordered={false}
185
- defaultActiveKey={groupedLogs.map((group) => group.leaderUsername)}
186
- items={groupedLogs.map((group) => ({
187
- key: group.leaderUsername,
188
- label: (
189
- <Space>
190
- <Tag color="blue">{employeeMap.get(group.leaderUsername) || group.leaderUsername}</Tag>
191
- <Text type="secondary">{group.items.length} execution{group.items.length > 1 ? 's' : ''}</Text>
192
- </Space>
193
- ),
194
- children: (
195
- <Table
196
- rowKey="id"
197
- loading={loading}
198
- dataSource={group.items}
199
- columns={columns}
200
- pagination={{ hideOnSinglePage: true, pageSize: 20 }}
201
- size="middle"
202
- />
203
- ),
204
- }))}
205
- />
206
- ) : (
207
- <Table
208
- rowKey="id"
209
- loading={loading}
210
- dataSource={[]}
211
- columns={columns}
212
- pagination={false}
213
- size="middle"
214
- locale={{ emptyText: <Empty description="No delegation executions yet" /> }}
215
- />
216
- )}
212
+ <Form layout="inline" style={{ marginBottom: 16, rowGap: 8, flexWrap: 'wrap' }}>
213
+ <Form.Item label="Leader">
214
+ <Select
215
+ allowClear
216
+ placeholder="Any leader"
217
+ style={{ minWidth: 180 }}
218
+ options={employeeOptions}
219
+ value={filters.leader}
220
+ onChange={(v) => updateFilter({ leader: v })}
221
+ showSearch
222
+ optionFilterProp="label"
223
+ />
224
+ </Form.Item>
225
+ <Form.Item label="Sub-Agent">
226
+ <Select
227
+ allowClear
228
+ placeholder="Any sub-agent"
229
+ style={{ minWidth: 180 }}
230
+ options={employeeOptions}
231
+ value={filters.subAgent}
232
+ onChange={(v) => updateFilter({ subAgent: v })}
233
+ showSearch
234
+ optionFilterProp="label"
235
+ />
236
+ </Form.Item>
237
+ <Form.Item label="Status">
238
+ <Select
239
+ allowClear
240
+ placeholder="Any status"
241
+ style={{ minWidth: 140 }}
242
+ options={[
243
+ { label: 'Success', value: 'success' },
244
+ { label: 'Error', value: 'error' },
245
+ { label: 'Running', value: 'running' },
246
+ ]}
247
+ value={filters.status}
248
+ onChange={(v) => updateFilter({ status: v })}
249
+ />
250
+ </Form.Item>
251
+ <Form.Item label="Time">
252
+ <RangePicker showTime value={filters.range as any} onChange={(v) => updateFilter({ range: v as any })} />
253
+ </Form.Item>
254
+ <Form.Item>
255
+ <Space>
256
+ <Button onClick={resetFilters} disabled={!hasFilters}>
257
+ Reset
258
+ </Button>
259
+ <Button icon={<ReloadOutlined />} onClick={refresh}>
260
+ Refresh
261
+ </Button>
262
+ </Space>
263
+ </Form.Item>
264
+ </Form>
265
+
266
+ <Table
267
+ rowKey="id"
268
+ loading={loading}
269
+ dataSource={logs}
270
+ columns={columns}
271
+ size="middle"
272
+ pagination={{
273
+ current: page,
274
+ pageSize,
275
+ total,
276
+ showSizeChanger: true,
277
+ pageSizeOptions: [10, 20, 50, 100],
278
+ showTotal: (count) => `${count} execution${count === 1 ? '' : 's'}`,
279
+ onChange: (nextPage, nextSize) => {
280
+ setPage(nextPage);
281
+ if (nextSize && nextSize !== pageSize) setPageSize(nextSize);
282
+ },
283
+ }}
284
+ locale={{
285
+ emptyText: (
286
+ <Empty
287
+ description={hasFilters ? 'No executions match the current filters' : 'No delegation executions yet'}
288
+ />
289
+ ),
290
+ }}
291
+ />
217
292
  </Card>
218
293
 
219
- <Drawer
220
- title="Delegation Detail"
221
- width={760}
222
- onClose={() => setSelectedLog(null)}
223
- open={!!selectedLog}
224
- >
294
+ <Drawer title="Execution Detail" width={820} onClose={() => setSelectedLog(null)} open={!!selectedLog}>
225
295
  {selectedLog && (
226
296
  <Spin spinning={detailLoading}>
227
- <>
228
- <Descriptions column={1} bordered size="small" style={{ marginBottom: 16 }}>
229
- <Descriptions.Item label="Status">
230
- <Tag
231
- icon={selectedLog.status === 'success' ? <CheckCircleOutlined /> : <CloseCircleOutlined />}
232
- color={selectedLog.status === 'success' ? 'success' : 'error'}
233
- >
234
- {selectedLog.status}
235
- </Tag>
236
- </Descriptions.Item>
237
- <Descriptions.Item label="Leader">
238
- <Tag color="blue">
239
- {employeeMap.get(selectedLog.leaderUsername) || selectedLog.leaderUsername}
240
- </Tag>
241
- </Descriptions.Item>
242
- <Descriptions.Item label="Sub-Agent">
243
- <Tag color="green">
244
- {employeeMap.get(selectedLog.subAgentUsername) || selectedLog.subAgentUsername}
245
- </Tag>
246
- </Descriptions.Item>
247
- <Descriptions.Item label="Tool">
248
- <Text code>{selectedLog.toolName}</Text>
249
- </Descriptions.Item>
250
- <Descriptions.Item label="Depth">
251
- {selectedLog.depth ?? 0}
252
- </Descriptions.Item>
253
- <Descriptions.Item label="Duration">
254
- {formatDuration(selectedLog.durationMs)}
255
- </Descriptions.Item>
256
- <Descriptions.Item label="Time">
257
- {selectedLog.createdAt ? new Date(selectedLog.createdAt).toLocaleString() : '-'}
258
- </Descriptions.Item>
259
- </Descriptions>
260
-
261
- <Card title="Task" size="small" style={{ marginBottom: 16 }}>
262
- <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
263
- {selectedLog.task || 'No task description'}
264
- </Paragraph>
265
- </Card>
297
+ <>
298
+ <Descriptions column={1} bordered size="small" style={{ marginBottom: 16 }}>
299
+ <Descriptions.Item label="Status">
300
+ <Tag
301
+ icon={selectedLog.status === 'success' ? <CheckCircleOutlined /> : <CloseCircleOutlined />}
302
+ color={selectedLog.status === 'success' ? 'success' : 'error'}
303
+ >
304
+ {selectedLog.status}
305
+ </Tag>
306
+ </Descriptions.Item>
307
+ <Descriptions.Item label="Leader">
308
+ <Tag color="blue">{employeeMap.get(selectedLog.leaderUsername) || selectedLog.leaderUsername}</Tag>
309
+ </Descriptions.Item>
310
+ <Descriptions.Item label="Sub-Agent">
311
+ <Tag color="green">
312
+ {employeeMap.get(selectedLog.subAgentUsername) || selectedLog.subAgentUsername}
313
+ </Tag>
314
+ </Descriptions.Item>
315
+ <Descriptions.Item label="Tool">
316
+ <Text code>{selectedLog.toolName}</Text>
317
+ </Descriptions.Item>
318
+ <Descriptions.Item label="Depth">{selectedLog.depth ?? 0}</Descriptions.Item>
319
+ <Descriptions.Item label="Duration">{formatDuration(selectedLog.durationMs)}</Descriptions.Item>
320
+ <Descriptions.Item label="Time">
321
+ {selectedLog.createdAt ? new Date(selectedLog.createdAt).toLocaleString() : '-'}
322
+ </Descriptions.Item>
323
+ </Descriptions>
266
324
 
267
- {selectedLog.context && (
268
- <Card title="Context" size="small" style={{ marginBottom: 16 }}>
325
+ <Card title="Task" size="small" style={{ marginBottom: 16 }}>
269
326
  <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
270
- {selectedLog.context}
327
+ {selectedLog.task || 'No task description'}
271
328
  </Paragraph>
272
329
  </Card>
273
- )}
274
330
 
275
- <Card title="Sub-Agent Flow" size="small" style={{ marginBottom: 16 }}>
276
- {Array.isArray(selectedLog.trace) && selectedLog.trace.length ? (
277
- <Timeline
278
- items={selectedLog.trace.map((item: any, index: number) => ({
279
- key: index,
280
- color: item.status === 'error' ? 'red' : item.type === 'tool_call' ? 'blue' : 'green',
281
- children: (
282
- <div>
283
- <Space direction="vertical" size={2} style={{ width: '100%' }}>
284
- <Text strong>{item.title || item.type}</Text>
285
- <Text type="secondary">{item.at ? new Date(item.at).toLocaleString() : ''}</Text>
286
- {item.toolName && <Text code>{item.toolName}</Text>}
287
- {item.content && (
288
- <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
289
- {item.content}
290
- </Paragraph>
291
- )}
292
- {item.args && (
293
- <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 12 }}>
294
- {JSON.stringify(item.args, null, 2)}
295
- </Paragraph>
296
- )}
297
- </Space>
298
- </div>
299
- ),
300
- }))}
301
- />
302
- ) : (
303
- <Empty description="No flow trace captured" />
331
+ {selectedLog.context && (
332
+ <Card title="Context" size="small" style={{ marginBottom: 16 }}>
333
+ <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
334
+ {selectedLog.context}
335
+ </Paragraph>
336
+ </Card>
304
337
  )}
305
- </Card>
306
338
 
307
- {Array.isArray(selectedLog.messages) && selectedLog.messages.length > 0 && (
308
- <Collapse
309
- style={{ marginBottom: 16 }}
310
- items={[
311
- {
312
- key: 'messages',
313
- label: `Raw messages (${selectedLog.messages.length})`,
314
- children: (
315
- <Space direction="vertical" style={{ width: '100%' }}>
316
- {selectedLog.messages.map((message: any) => (
317
- <Card key={message.index} size="small" title={`${message.index + 1}. ${message.type}`}>
318
- <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 12 }}>
319
- {message.content || JSON.stringify(message.toolCalls || message, null, 2)}
320
- </Paragraph>
321
- {message.toolCalls?.length > 0 && (
322
- <Paragraph style={{ whiteSpace: 'pre-wrap', margin: '8px 0 0', fontSize: 12 }}>
323
- {JSON.stringify(message.toolCalls, null, 2)}
339
+ <Card title="Execution Flow" size="small" style={{ marginBottom: 16 }}>
340
+ {Array.isArray(selectedLog.trace) && selectedLog.trace.length ? (
341
+ <Timeline
342
+ items={selectedLog.trace.map((item: any, index: number) => ({
343
+ key: index,
344
+ color: item.status === 'error' ? 'red' : item.type === 'tool_call' ? 'blue' : 'green',
345
+ children: (
346
+ <div>
347
+ <Space direction="vertical" size={2} style={{ width: '100%' }}>
348
+ <Text strong>{item.title || item.type}</Text>
349
+ <Text type="secondary">{item.at ? new Date(item.at).toLocaleString() : ''}</Text>
350
+ {item.toolName && <Text code>{item.toolName}</Text>}
351
+ {item.skillExecutionId && (
352
+ <Text type="secondary">Skill execution #{item.skillExecutionId}</Text>
353
+ )}
354
+ {item.content && (
355
+ <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
356
+ {item.content}
324
357
  </Paragraph>
325
358
  )}
326
- </Card>
327
- ))}
328
- </Space>
329
- ),
330
- },
331
- ]}
332
- />
333
- )}
359
+ {item.args && (
360
+ <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 12 }}>
361
+ {JSON.stringify(item.args, null, 2)}
362
+ </Paragraph>
363
+ )}
364
+ </Space>
365
+ </div>
366
+ ),
367
+ }))}
368
+ />
369
+ ) : (
370
+ <Empty description="No execution flow captured" />
371
+ )}
372
+ </Card>
334
373
 
335
- <Card
336
- title="Result"
337
- size="small"
338
- style={{
339
- marginBottom: 16,
340
- borderColor: selectedLog.status === 'success' ? '#b7eb8f' : '#ffa39e',
341
- }}
342
- >
343
- <Paragraph
344
- style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}
345
- ellipsis={{ rows: 20, expandable: true }}
346
- >
347
- {selectedLog.result || selectedLog.error || 'No result'}
348
- </Paragraph>
349
- </Card>
374
+ {Array.isArray(selectedLog.messages) && selectedLog.messages.length > 0 && (
375
+ <Collapse
376
+ style={{ marginBottom: 16 }}
377
+ items={[
378
+ {
379
+ key: 'messages',
380
+ label: `Raw messages (${selectedLog.messages.length})`,
381
+ children: (
382
+ <Space direction="vertical" style={{ width: '100%' }}>
383
+ {selectedLog.messages.map((message: any) => (
384
+ <Card key={message.index} size="small" title={`${message.index + 1}. ${message.type}`}>
385
+ <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 12 }}>
386
+ {message.content || JSON.stringify(message.toolCalls || message, null, 2)}
387
+ </Paragraph>
388
+ {message.toolCalls?.length > 0 && (
389
+ <Paragraph style={{ whiteSpace: 'pre-wrap', margin: '8px 0 0', fontSize: 12 }}>
390
+ {JSON.stringify(message.toolCalls, null, 2)}
391
+ </Paragraph>
392
+ )}
393
+ </Card>
394
+ ))}
395
+ </Space>
396
+ ),
397
+ },
398
+ ]}
399
+ />
400
+ )}
350
401
 
351
- {selectedLog.error && (
352
- <Card title="Error" size="small" style={{ borderColor: '#ffa39e' }}>
402
+ <Card
403
+ title="Result"
404
+ size="small"
405
+ style={{
406
+ marginBottom: 16,
407
+ borderColor: selectedLog.status === 'success' ? '#b7eb8f' : '#ffa39e',
408
+ }}
409
+ >
353
410
  <Paragraph
354
- type="danger"
355
411
  style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}
412
+ ellipsis={{ rows: 20, expandable: true }}
356
413
  >
357
- {selectedLog.error}
414
+ {selectedLog.result || selectedLog.error || 'No result'}
358
415
  </Paragraph>
359
416
  </Card>
360
- )}
361
- </>
417
+
418
+ {selectedLog.error && (
419
+ <Card title="Error" size="small" style={{ borderColor: '#ffa39e' }}>
420
+ <Paragraph type="danger" style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
421
+ {selectedLog.error}
422
+ </Paragraph>
423
+ </Card>
424
+ )}
425
+ </>
362
426
  </Spin>
363
427
  )}
364
428
  </Drawer>
@@ -1 +1 @@
1
- export { default } from './plugin';
1
+ export { default } from './plugin';
@@ -1,15 +1,54 @@
1
- import { Plugin } from '@nocobase/client';
2
- import { OrchestratorSettings } from './OrchestratorSettings';
3
-
4
- export class PluginAgentOrchestratorClient extends Plugin {
5
- async load() {
6
- // Register under the "AI" settings group for consistency with other AI plugins
7
- this.app.pluginSettingsManager.add('ai.orchestrator', {
8
- title: 'Agent Orchestrator',
9
- icon: 'ApartmentOutlined',
10
- Component: OrchestratorSettings,
11
- });
12
- }
13
- }
14
-
15
- export default PluginAgentOrchestratorClient;
1
+ import { Plugin } from '@nocobase/client';
2
+ import { OrchestratorSettings } from './OrchestratorSettings';
3
+
4
+ import { InteractionSchemasProvider } from './skill-hub/tools/InteractionSchemasProvider';
5
+ import { SkillHubCard } from './skill-hub/tools/SkillHubCard';
6
+ import { parseJsonText } from './skill-hub/utils/jsonFields';
7
+
8
+ const sanitize = (name: string) =>
9
+ name
10
+ .toLowerCase()
11
+ .replace(/[^a-z0-9_]/g, '_')
12
+ .replace(/_+/g, '_')
13
+ .replace(/^_|_$/g, '');
14
+
15
+ export class PluginAgentOrchestratorClient extends Plugin {
16
+ async load() {
17
+ (this as any).app.use(InteractionSchemasProvider);
18
+
19
+ // Register under the "AI" settings group for consistency with other AI plugins
20
+ (this as any).app.pluginSettingsManager.add('ai.orchestrator', {
21
+ title: 'Agent Orchestrator',
22
+ icon: 'ApartmentOutlined',
23
+ Component: OrchestratorSettings,
24
+ });
25
+
26
+ await this.registerSkillUiCards();
27
+ }
28
+
29
+ private async registerSkillUiCards() {
30
+ const toolsManager = (this as any).app.aiManager?.toolsManager;
31
+ if (!toolsManager) return;
32
+
33
+ try {
34
+ const { data } = await (this as any).app.apiClient.request({
35
+ url: 'skillDefinitions:list',
36
+ params: {
37
+ filter: { enabled: true },
38
+ fields: ['name', 'autoCall', 'interactionSchema'],
39
+ pageSize: 200,
40
+ },
41
+ });
42
+ const list = (data as any)?.data ?? [];
43
+ for (const s of list) {
44
+ if (s.autoCall) continue;
45
+ if (!parseJsonText(s.interactionSchema, null)) continue;
46
+ toolsManager.registerTools(`skill_hub_${sanitize(s.name)}`, { ui: { card: SkillHubCard } });
47
+ }
48
+ } catch {
49
+ // user without ACL or backend unavailable — skip silently
50
+ }
51
+ }
52
+ }
53
+
54
+ export default PluginAgentOrchestratorClient;