plugin-agent-orchestrator 1.0.6 → 1.0.14

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 (257) 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.js +16 -0
  153. package/dist/server/collections/orchestrator-logs.js +19 -2
  154. package/dist/server/collections/skill-definitions.d.ts +3 -0
  155. package/dist/server/collections/skill-definitions.js +158 -0
  156. package/dist/server/collections/skill-executions.d.ts +3 -0
  157. package/dist/server/collections/skill-executions.js +123 -0
  158. package/dist/server/collections/skill-worker-configs.d.ts +3 -0
  159. package/dist/server/collections/skill-worker-configs.js +115 -0
  160. package/dist/server/migrations/20260423000000-add-progress-fields.d.ts +4 -0
  161. package/dist/server/migrations/20260423000000-add-progress-fields.js +69 -0
  162. package/dist/server/migrations/20260425000000-add-interaction-schema.d.ts +4 -0
  163. package/dist/server/migrations/20260425000000-add-interaction-schema.js +61 -0
  164. package/dist/server/migrations/20260427000000-add-tracing-detail-fields.d.ts +7 -0
  165. package/dist/server/migrations/20260427000000-add-tracing-detail-fields.js +62 -0
  166. package/dist/server/migrations/20260427000000-change-packages-to-text.d.ts +4 -0
  167. package/dist/server/migrations/20260427000000-change-packages-to-text.js +70 -0
  168. package/dist/server/migrations/20260427000001-change-other-json-to-text.d.ts +4 -0
  169. package/dist/server/migrations/20260427000001-change-other-json-to-text.js +80 -0
  170. package/dist/server/migrations/20260429000000-add-llm-fields.d.ts +7 -0
  171. package/dist/server/migrations/20260429000000-add-llm-fields.js +68 -0
  172. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.d.ts +16 -0
  173. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.js +51 -0
  174. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.d.ts +7 -0
  175. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.js +57 -0
  176. package/dist/server/plugin.d.ts +3 -0
  177. package/dist/server/plugin.js +37 -1
  178. package/dist/server/resources/tracing.js +160 -12
  179. package/dist/server/services/CodeValidator.d.ts +32 -0
  180. package/dist/server/services/CodeValidator.js +205 -0
  181. package/dist/server/services/ExecutionSpanService.d.ts +44 -0
  182. package/dist/server/services/ExecutionSpanService.js +104 -0
  183. package/dist/server/services/FileManager.d.ts +28 -0
  184. package/dist/server/services/FileManager.js +151 -0
  185. package/dist/server/services/SandboxRunner.d.ts +41 -0
  186. package/dist/server/services/SandboxRunner.js +167 -0
  187. package/dist/server/services/SkillManager.d.ts +6 -0
  188. package/dist/server/services/SkillManager.js +640 -0
  189. package/dist/server/services/SkillRepositoryService.d.ts +22 -0
  190. package/dist/server/services/SkillRepositoryService.js +157 -0
  191. package/dist/server/services/WorkerEnvManager.d.ts +26 -0
  192. package/dist/server/services/WorkerEnvManager.js +120 -0
  193. package/dist/server/skill-hub/actions/git-import.d.ts +21 -0
  194. package/dist/server/skill-hub/actions/git-import.js +413 -0
  195. package/dist/server/skill-hub/mcp/McpController.d.ts +15 -0
  196. package/dist/server/skill-hub/mcp/McpController.js +111 -0
  197. package/dist/server/skill-hub/plugin.d.ts +58 -0
  198. package/dist/server/skill-hub/plugin.js +694 -0
  199. package/dist/server/skill-hub/sandbox-config.json +6 -0
  200. package/dist/server/skill-hub/tasks/SkillExecutionTask.d.ts +14 -0
  201. package/dist/server/skill-hub/tasks/SkillExecutionTask.js +267 -0
  202. package/dist/server/skill-hub/utils/json-fields.d.ts +7 -0
  203. package/dist/server/skill-hub/utils/json-fields.js +88 -0
  204. package/dist/server/tools/delegate-task.d.ts +4 -0
  205. package/dist/server/tools/delegate-task.js +832 -119
  206. package/dist/server/tools/skill-execute.d.ts +36 -0
  207. package/dist/server/tools/skill-execute.js +167 -0
  208. package/package.json +3 -1
  209. package/src/client/AIEmployeeSelect.tsx +1 -3
  210. package/src/client/AIEmployeesContext.tsx +28 -13
  211. package/src/client/OrchestratorSettings.tsx +43 -5
  212. package/src/client/RulesTab.tsx +368 -21
  213. package/src/client/TracingTab.tsx +316 -102
  214. package/src/client/plugin.tsx +39 -0
  215. package/src/client/skill-hub/components/ExecutionHistory.tsx +201 -0
  216. package/src/client/skill-hub/components/ExecutionProgress.tsx +55 -0
  217. package/src/client/skill-hub/components/GitSkillImport.tsx +555 -0
  218. package/src/client/skill-hub/components/SkillEditor.tsx +456 -0
  219. package/src/client/skill-hub/components/SkillManager.tsx +181 -0
  220. package/src/client/skill-hub/components/SkillMetrics.tsx +124 -0
  221. package/src/client/skill-hub/components/SkillTestPanel.tsx +144 -0
  222. package/src/client/skill-hub/index.tsx +75 -0
  223. package/src/client/skill-hub/locale.ts +16 -0
  224. package/src/client/skill-hub/tools/InteractionSchemasProvider.tsx +59 -0
  225. package/src/client/skill-hub/tools/SkillHubCard.tsx +78 -0
  226. package/src/client/skill-hub/utils/jsonFields.ts +37 -0
  227. package/src/server/collections/agent-execution-spans.ts +129 -0
  228. package/src/server/collections/orchestrator-config.ts +17 -0
  229. package/src/server/collections/orchestrator-logs.ts +19 -2
  230. package/src/server/collections/skill-definitions.ts +128 -0
  231. package/src/server/collections/skill-executions.ts +94 -0
  232. package/src/server/collections/skill-worker-configs.ts +86 -0
  233. package/src/server/migrations/20260423000000-add-progress-fields.ts +50 -0
  234. package/src/server/migrations/20260425000000-add-interaction-schema.ts +35 -0
  235. package/src/server/migrations/20260427000000-add-tracing-detail-fields.ts +41 -0
  236. package/src/server/migrations/20260427000000-change-packages-to-text.ts +47 -0
  237. package/src/server/migrations/20260427000001-change-other-json-to-text.ts +57 -0
  238. package/src/server/migrations/20260429000000-add-llm-fields.ts +46 -0
  239. package/src/server/migrations/20260429000000-fix-inputargs-json-to-text.ts +38 -0
  240. package/src/server/migrations/20260503000000-add-orchestrator-trace-fields.ts +32 -0
  241. package/src/server/plugin.ts +51 -3
  242. package/src/server/resources/tracing.ts +187 -16
  243. package/src/server/services/CodeValidator.ts +159 -0
  244. package/src/server/services/ExecutionSpanService.ts +106 -0
  245. package/src/server/services/FileManager.ts +144 -0
  246. package/src/server/services/SandboxRunner.ts +205 -0
  247. package/src/server/services/SkillManager.ts +623 -0
  248. package/src/server/services/SkillRepositoryService.ts +142 -0
  249. package/src/server/services/WorkerEnvManager.ts +113 -0
  250. package/src/server/skill-hub/actions/git-import.ts +486 -0
  251. package/src/server/skill-hub/mcp/McpController.ts +86 -0
  252. package/src/server/skill-hub/plugin.ts +771 -0
  253. package/src/server/skill-hub/sandbox-config.json +6 -0
  254. package/src/server/skill-hub/tasks/SkillExecutionTask.ts +297 -0
  255. package/src/server/skill-hub/utils/json-fields.ts +57 -0
  256. package/src/server/tools/delegate-task.ts +1085 -147
  257. 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,
@@ -9,29 +9,119 @@ import {
9
9
  Alert,
10
10
  Button,
11
11
  Empty,
12
+ Space,
13
+ Timeline,
14
+ Collapse,
15
+ Spin,
16
+ Select,
17
+ DatePicker,
18
+ Form,
12
19
  } from 'antd';
13
- import {
14
- EyeOutlined,
15
- CheckCircleOutlined,
16
- CloseCircleOutlined,
17
- } from '@ant-design/icons';
18
- import { useRequest } from '@nocobase/client';
20
+ import { EyeOutlined, CheckCircleOutlined, CloseCircleOutlined, ReloadOutlined } from '@ant-design/icons';
21
+ import { useAPIClient, useRequest } from '@nocobase/client';
19
22
  import { useAIEmployees } from './AIEmployeesContext';
20
23
 
21
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
+ };
22
33
 
23
34
  export const TracingTab: React.FC = () => {
35
+ const api = useAPIClient();
24
36
  const [selectedLog, setSelectedLog] = useState<any>(null);
37
+ const [detailLoading, setDetailLoading] = useState(false);
38
+
39
+ const [page, setPage] = useState(1);
40
+ const [pageSize, setPageSize] = useState(20);
41
+ const [filters, setFilters] = useState<FilterState>({});
42
+
43
+ const { employees, employeeMap } = useAIEmployees();
25
44
 
26
- const { data, loading, refresh } = useRequest({
27
- url: 'orchestratorTracing:list',
28
- params: {
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 {
29
56
  sort: ['-createdAt'],
30
- 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],
31
70
  },
32
- });
71
+ );
72
+
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 : [];
77
+ }, [data]);
78
+
79
+ const total = useMemo(() => {
80
+ const count = (data as any)?.meta?.count;
81
+ return typeof count === 'number' ? count : 0;
82
+ }, [data]);
83
+
84
+ const formatDuration = (ms: number) => {
85
+ if (!ms) return '-';
86
+ return ms >= 1000 ? `${(ms / 1000).toFixed(1)}s` : `${ms}ms`;
87
+ };
88
+
89
+ const handleOpenLog = async (record: any) => {
90
+ setSelectedLog(record);
91
+ setDetailLoading(true);
92
+ try {
93
+ const res = await api.request({
94
+ url: 'orchestratorTracing:get',
95
+ params: { filterByTk: record.id, source: record.hasUnifiedTrace ? 'span' : 'log' },
96
+ });
97
+ setSelectedLog((res as any)?.data?.data || (res as any)?.data || record);
98
+ } finally {
99
+ setDetailLoading(false);
100
+ }
101
+ };
33
102
 
34
- const { employeeMap } = useAIEmployees();
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
+ );
35
125
 
36
126
  const columns = [
37
127
  {
@@ -39,15 +129,19 @@ export const TracingTab: React.FC = () => {
39
129
  dataIndex: 'createdAt',
40
130
  key: 'createdAt',
41
131
  width: 170,
42
- render: (v: string) => v ? new Date(v).toLocaleString() : '-',
132
+ render: (v: string) => (v ? new Date(v).toLocaleString() : '-'),
133
+ },
134
+ {
135
+ title: 'Leader',
136
+ dataIndex: 'leaderUsername',
137
+ key: 'leaderUsername',
138
+ render: (username: string) => <Tag color="blue">{employeeMap.get(username) || username}</Tag>,
43
139
  },
44
140
  {
45
141
  title: 'Sub-Agent',
46
142
  dataIndex: 'subAgentUsername',
47
143
  key: 'subAgentUsername',
48
- render: (username: string) => (
49
- <Tag color="green">{employeeMap.get(username) || username}</Tag>
50
- ),
144
+ render: (username: string) => <Tag color="green">{employeeMap.get(username) || username}</Tag>,
51
145
  },
52
146
  {
53
147
  title: 'Task',
@@ -78,10 +172,7 @@ export const TracingTab: React.FC = () => {
78
172
  dataIndex: 'durationMs',
79
173
  key: 'durationMs',
80
174
  width: 90,
81
- render: (ms: number) => {
82
- if (!ms) return '-';
83
- return ms >= 1000 ? `${(ms / 1000).toFixed(1)}s` : `${ms}ms`;
84
- },
175
+ render: formatDuration,
85
176
  },
86
177
  {
87
178
  title: 'Depth',
@@ -95,12 +186,7 @@ export const TracingTab: React.FC = () => {
95
186
  key: 'actions',
96
187
  width: 80,
97
188
  render: (_: any, record: any) => (
98
- <Button
99
- type="link"
100
- size="small"
101
- icon={<EyeOutlined />}
102
- onClick={() => setSelectedLog(record)}
103
- >
189
+ <Button type="link" size="small" icon={<EyeOutlined />} onClick={() => handleOpenLog(record)}>
104
190
  Detail
105
191
  </Button>
106
192
  ),
@@ -113,103 +199,231 @@ export const TracingTab: React.FC = () => {
113
199
  type="info"
114
200
  showIcon
115
201
  style={{ marginBottom: 16 }}
116
- message="Swarm Tracing"
202
+ message="Execution Tracing"
117
203
  description={
118
204
  <Text type="secondary">
119
- View delegation execution logs. Each row represents one sub-agent invocation
120
- 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.
121
207
  </Text>
122
208
  }
123
209
  />
124
210
 
125
211
  <Card bordered={false}>
126
- <div style={{ marginBottom: 16, display: 'flex', justifyContent: 'flex-end' }}>
127
- <Button onClick={refresh}>Refresh</Button>
128
- </div>
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
+
129
266
  <Table
130
267
  rowKey="id"
131
268
  loading={loading}
132
- dataSource={Array.isArray((data as any)?.data) ? (data as any).data : (Array.isArray(data) ? data : [])}
269
+ dataSource={logs}
133
270
  columns={columns}
134
- pagination={{ hideOnSinglePage: true, pageSize: 20 }}
135
271
  size="middle"
136
- locale={{ emptyText: <Empty description="No delegation executions yet" /> }}
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
+ }}
137
291
  />
138
292
  </Card>
139
293
 
140
- <Drawer
141
- title="Delegation Detail"
142
- width={640}
143
- onClose={() => setSelectedLog(null)}
144
- open={!!selectedLog}
145
- >
294
+ <Drawer title="Execution Detail" width={820} onClose={() => setSelectedLog(null)} open={!!selectedLog}>
146
295
  {selectedLog && (
147
- <>
148
- <Descriptions column={1} bordered size="small" style={{ marginBottom: 16 }}>
149
- <Descriptions.Item label="Status">
150
- <Tag
151
- icon={selectedLog.status === 'success' ? <CheckCircleOutlined /> : <CloseCircleOutlined />}
152
- color={selectedLog.status === 'success' ? 'success' : 'error'}
153
- >
154
- {selectedLog.status}
155
- </Tag>
156
- </Descriptions.Item>
157
- <Descriptions.Item label="Sub-Agent">
158
- <Tag color="green">
159
- {employeeMap.get(selectedLog.subAgentUsername) || selectedLog.subAgentUsername}
160
- </Tag>
161
- </Descriptions.Item>
162
- <Descriptions.Item label="Tool">
163
- <Text code>{selectedLog.toolName}</Text>
164
- </Descriptions.Item>
165
- <Descriptions.Item label="Depth">
166
- {selectedLog.depth ?? 0}
167
- </Descriptions.Item>
168
- <Descriptions.Item label="Duration">
169
- {selectedLog.durationMs
170
- ? selectedLog.durationMs >= 1000
171
- ? `${(selectedLog.durationMs / 1000).toFixed(1)}s`
172
- : `${selectedLog.durationMs}ms`
173
- : '-'}
174
- </Descriptions.Item>
175
- <Descriptions.Item label="Time">
176
- {selectedLog.createdAt ? new Date(selectedLog.createdAt).toLocaleString() : '-'}
177
- </Descriptions.Item>
178
- </Descriptions>
179
-
180
- <Card title="Task" size="small" style={{ marginBottom: 16 }}>
181
- <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
182
- {selectedLog.task || 'No task description'}
183
- </Paragraph>
184
- </Card>
185
-
186
- <Card
187
- title="Result"
188
- size="small"
189
- style={{
190
- marginBottom: 16,
191
- borderColor: selectedLog.status === 'success' ? '#b7eb8f' : '#ffa39e',
192
- }}
193
- >
194
- <Paragraph
195
- style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}
196
- ellipsis={{ rows: 20, expandable: true }}
197
- >
198
- {selectedLog.result || selectedLog.error || 'No result'}
199
- </Paragraph>
200
- </Card>
296
+ <Spin spinning={detailLoading}>
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>
201
324
 
202
- {selectedLog.error && (
203
- <Card title="Error" size="small" style={{ borderColor: '#ffa39e' }}>
325
+ <Card title="Task" size="small" style={{ marginBottom: 16 }}>
326
+ <Paragraph style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}>
327
+ {selectedLog.task || 'No task description'}
328
+ </Paragraph>
329
+ </Card>
330
+
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>
337
+ )}
338
+
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}
357
+ </Paragraph>
358
+ )}
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>
373
+
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
+ )}
401
+
402
+ <Card
403
+ title="Result"
404
+ size="small"
405
+ style={{
406
+ marginBottom: 16,
407
+ borderColor: selectedLog.status === 'success' ? '#b7eb8f' : '#ffa39e',
408
+ }}
409
+ >
204
410
  <Paragraph
205
- type="danger"
206
411
  style={{ whiteSpace: 'pre-wrap', margin: 0, fontSize: 13 }}
412
+ ellipsis={{ rows: 20, expandable: true }}
207
413
  >
208
- {selectedLog.error}
414
+ {selectedLog.result || selectedLog.error || 'No result'}
209
415
  </Paragraph>
210
416
  </Card>
211
- )}
212
- </>
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
+ </>
426
+ </Spin>
213
427
  )}
214
428
  </Drawer>
215
429
  </div>
@@ -1,14 +1,53 @@
1
1
  import { Plugin } from '@nocobase/client';
2
2
  import { OrchestratorSettings } from './OrchestratorSettings';
3
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
+
4
15
  export class PluginAgentOrchestratorClient extends Plugin {
5
16
  async load() {
17
+ this.app.use(InteractionSchemasProvider);
18
+
6
19
  // Register under the "AI" settings group for consistency with other AI plugins
7
20
  this.app.pluginSettingsManager.add('ai.orchestrator', {
8
21
  title: 'Agent Orchestrator',
9
22
  icon: 'ApartmentOutlined',
10
23
  Component: OrchestratorSettings,
11
24
  });
25
+
26
+ await this.registerSkillUiCards();
27
+ }
28
+
29
+ private async registerSkillUiCards() {
30
+ const toolsManager = this.app.aiManager?.toolsManager;
31
+ if (!toolsManager) return;
32
+
33
+ try {
34
+ const { data } = await this.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
+ }
12
51
  }
13
52
  }
14
53