plugin-agent-orchestrator 1.0.28 → 1.0.33

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 (108) hide show
  1. package/README.md +114 -112
  2. package/dist/client/index.js +1 -1
  3. package/dist/client-v2/{214.723affb37c13bf7a.js → 214.79650a549273f163.js} +1 -1
  4. package/dist/client-v2/264.718a107e43fc163c.js +10 -0
  5. package/dist/client-v2/373.f5d5292e53c4e832.js +10 -0
  6. package/dist/client-v2/{41.1805b2edfaa4afe2.js → 41.ba6e080cc0488143.js} +1 -1
  7. package/dist/client-v2/418.29e713f79131eece.js +10 -0
  8. package/dist/client-v2/619.bd3c5698b40705c3.js +10 -0
  9. package/dist/client-v2/677.a991ce0250ff5c77.js +10 -0
  10. package/dist/client-v2/{70.a15d7fcec7c41768.js → 70.bda9518881c05360.js} +1 -1
  11. package/dist/client-v2/925.f5370de8f6632d65.js +10 -0
  12. package/dist/client-v2/index.js +1 -1
  13. package/dist/externalVersion.js +7 -10
  14. package/dist/locale/en-US.json +94 -25
  15. package/dist/locale/vi-VN.json +94 -25
  16. package/dist/locale/zh-CN.json +94 -25
  17. package/dist/server/collections/agent-execution-spans.js +37 -0
  18. package/dist/server/collections/agent-harness-profiles.js +2 -2
  19. package/dist/server/collections/agent-memory-contexts.js +125 -0
  20. package/dist/server/collections/orchestrator-logs.js +2 -2
  21. package/dist/server/migrations/20260425000000-add-interaction-schema.js +3 -1
  22. package/dist/server/migrations/20260427000000-change-packages-to-text.js +3 -1
  23. package/dist/server/migrations/20260427000001-change-other-json-to-text.js +6 -2
  24. package/dist/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.js +21 -19
  25. package/dist/server/migrations/20260621000000-native-policy-profile-defaults.js +193 -0
  26. package/dist/server/plugin.js +128 -74
  27. package/dist/server/resources/agent-monitor.js +454 -0
  28. package/dist/server/services/AgentHarness.js +24 -499
  29. package/dist/server/services/AgentMemoryContextService.js +216 -0
  30. package/dist/server/services/ExecutionSpanService.js +2 -2
  31. package/dist/server/services/NativeSubAgentObserver.js +413 -0
  32. package/dist/server/skill-hub/plugin.js +81 -5
  33. package/dist/server/skill-hub/tasks/SkillExecutionTask.js +9 -3
  34. package/dist/server/tools/delegate-task.js +11 -589
  35. package/dist/server/utils/skill-settings.js +18 -1
  36. package/package.json +47 -49
  37. package/src/client/AIEmployeesContext.tsx +5 -18
  38. package/src/client/AgentRunsTab.tsx +2 -771
  39. package/src/client/HarnessProfilesTab.tsx +2 -257
  40. package/src/client/OrchestratorSettings.tsx +97 -106
  41. package/src/client/RulesTab.tsx +2 -788
  42. package/src/client/plugin.tsx +0 -2
  43. package/src/client/skill-hub/components/ExecutionHistory.tsx +200 -202
  44. package/src/client/skill-hub/components/ExecutionProgress.tsx +51 -55
  45. package/src/client/skill-hub/components/LoopSettings.tsx +331 -331
  46. package/src/client/skill-hub/components/SkillEditor.tsx +43 -39
  47. package/src/client/skill-hub/components/SkillManager.tsx +194 -181
  48. package/src/client/skill-hub/components/SkillTestPanel.tsx +141 -145
  49. package/src/client/skill-hub/locale.ts +16 -16
  50. package/src/client/skill-hub/tools/SkillHubCard.tsx +104 -109
  51. package/src/client/skill-hub/tools/loopTemplates.ts +52 -52
  52. package/src/client/skill-hub/utils/jsonFields.ts +7 -3
  53. package/src/client-v2/components/AIEmployeesContext.tsx +3 -16
  54. package/src/client-v2/components/AgentRunsTab.tsx +494 -767
  55. package/src/client-v2/components/HarnessProfilesTab.tsx +34 -31
  56. package/src/client-v2/components/RulesTab.tsx +2 -782
  57. package/src/client-v2/components/TracingTab.tsx +432 -432
  58. package/src/client-v2/hooks/useApiRequest.ts +121 -114
  59. package/src/client-v2/pages/RulesPage.tsx +2 -2
  60. package/src/client-v2/plugin.tsx +3 -3
  61. package/src/locale/en-US.json +94 -25
  62. package/src/locale/vi-VN.json +94 -25
  63. package/src/locale/zh-CN.json +94 -25
  64. package/src/server/__tests__/native-sub-agent-observer.test.ts +246 -0
  65. package/src/server/__tests__/skill-settings.test.ts +6 -6
  66. package/src/server/__tests__/smoke.test.ts +1 -0
  67. package/src/server/collections/agent-execution-spans.ts +37 -0
  68. package/src/server/collections/agent-harness-profiles.ts +59 -59
  69. package/src/server/collections/agent-loop-events.ts +71 -71
  70. package/src/server/collections/agent-loop-steps.ts +144 -144
  71. package/src/server/collections/agent-memory-contexts.ts +95 -0
  72. package/src/server/collections/orchestrator-logs.ts +4 -4
  73. package/src/server/collections/skill-definitions.ts +111 -111
  74. package/src/server/collections/skill-executions.ts +106 -106
  75. package/src/server/collections/skill-loop-configs.ts +65 -65
  76. package/src/server/migrations/20260423000000-add-progress-fields.ts +14 -14
  77. package/src/server/migrations/20260425000000-add-interaction-schema.ts +3 -1
  78. package/src/server/migrations/20260427000000-change-packages-to-text.ts +4 -2
  79. package/src/server/migrations/20260427000001-change-other-json-to-text.ts +9 -5
  80. package/src/server/migrations/20260524000000-add-agent-loop-fields-to-skill-executions.ts +30 -30
  81. package/src/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.ts +145 -142
  82. package/src/server/migrations/20260615000000-normalize-ai-employee-tool-bindings.ts +2 -2
  83. package/src/server/migrations/20260621000000-native-policy-profile-defaults.ts +193 -0
  84. package/src/server/plugin.ts +151 -94
  85. package/src/server/resources/agent-monitor.ts +482 -0
  86. package/src/server/services/AgentHarness.ts +38 -623
  87. package/src/server/services/AgentMemoryContextService.ts +256 -0
  88. package/src/server/services/AgentPlanValidator.ts +73 -73
  89. package/src/server/services/ExecutionSpanService.ts +110 -106
  90. package/src/server/services/FileManager.ts +144 -144
  91. package/src/server/services/NativeSubAgentObserver.ts +507 -0
  92. package/src/server/services/SkillManager.ts +583 -583
  93. package/src/server/services/SkillRepositoryService.ts +5 -7
  94. package/src/server/services/TokenTracker.ts +3 -3
  95. package/src/server/services/WorkerEnvManager.ts +1 -2
  96. package/src/server/skill-hub/actions/git-import.ts +5 -7
  97. package/src/server/skill-hub/plugin.ts +1016 -933
  98. package/src/server/skill-hub/tasks/SkillExecutionTask.ts +20 -10
  99. package/src/server/skill-hub/utils/json-fields.ts +1 -1
  100. package/src/server/tools/delegate-task.ts +13 -847
  101. package/src/server/utils/skill-settings.ts +24 -6
  102. package/dist/client-v2/264.0533912e6c5ea2d7.js +0 -10
  103. package/dist/client-v2/418.5ae055abf141820e.js +0 -10
  104. package/dist/client-v2/619.d99d3c9e61c99064.js +0 -10
  105. package/dist/client-v2/892.72db4161511c8a16.js +0 -10
  106. package/dist/client-v2/926.87f660b670d85bcc.js +0 -10
  107. package/src/client/tools/PlanApprovalCard.tsx +0 -176
  108. package/src/client/tools/registerOrchestratorCards.ts +0 -17
package/README.md CHANGED
@@ -1,112 +1,114 @@
1
- # plugin-agent-orchestrator
2
-
3
- ## Overview
4
- Hierarchical Multi-Agent orchestration for NocoBase AI Employees. Enables Leader agents to delegate tasks to Sub-Agent employees without modifying core plugin-ai.
5
-
6
- ## Features
7
- - **Hierarchical Delegation**: Allows AI Leader agents to break down complex tasks and assign them to specialized sub-agents.
8
- - **Seamless Integration**: Plugs directly into the existing AI Employee framework.
9
- - **Execution Tracking**: Monitor sub-agent task execution and responses within the main chat interface.
10
- - **External RAG Search**: Exposes `external_rag_search` so leaders and sub-agents can retrieve context from NocoBase knowledge bases, including external RAG services.
11
-
12
- ## Usage
13
- 1. Enable the plugin in the NocoBase Plugin Manager.
14
- 2. Navigate to the AI Employee configuration page.
15
- 3. Configure a primary "Leader" agent.
16
- 4. Add available "Sub-Agents" as tools or skills to the Leader agent.
17
- 5. Interact with the Leader agent; it will automatically delegate tasks when necessary.
18
-
19
- ## External RAG / Embedding service
20
-
21
- Recommended approach: keep source ownership in NocoBase and move chunking, embedding, vector storage, and retrieval to an external lightweight RAG service. This plugin should not own vector infrastructure directly. It delegates search to `plugin-knowledge-base`, which already supports knowledge bases of type `EXTERNAL_RAG`.
22
-
23
- ### Architecture
24
-
25
- 1. NocoBase stores the source metadata:
26
- - uploaded file attachment id, filename, storage id, URL, owner/role access, or
27
- - datasource/collection/record id for database-backed knowledge.
28
- 2. The external RAG service owns:
29
- - document fetching or receiving source payloads,
30
- - parsing/chunking,
31
- - embedding,
32
- - vector index,
33
- - retrieval.
34
- 3. NocoBase creates a knowledge base with `type = EXTERNAL_RAG` and `options` such as:
35
- - `ragProvider: "external-http"`
36
- - `ragApiUrl: "https://rag.example.com/search"`
37
- - `ragApiKey`
38
- - `ragNamespace`
39
- - `ragTopK`
40
- - `ragScoreThreshold`
41
- 4. Agents use the `external_rag_search` tool. The tool calls `plugin-knowledge-base.searchKnowledgeBases()`, so access control and mixed local/external search remain centralized.
42
-
43
- ### External search contract
44
-
45
- The built-in `external-http` strategy expects:
46
-
47
- ```http
48
- POST /search
49
- Authorization: Bearer <ragApiKey>
50
- Content-Type: application/json
51
- ```
52
-
53
- ```json
54
- {
55
- "query": "search text",
56
- "topK": 5,
57
- "scoreThreshold": 0.3,
58
- "namespace": "optional-kb-namespace",
59
- "filter": {}
60
- }
61
- ```
62
-
63
- Response:
64
-
65
- ```json
66
- {
67
- "results": [
68
- {
69
- "id": "chunk-or-source-id",
70
- "content": "matched text",
71
- "score": 0.82,
72
- "metadata": {
73
- "fileId": "123",
74
- "filename": "contract.pdf",
75
- "collection": "orders",
76
- "recordId": "456",
77
- "sourceUrl": "/api/attachments/123:download"
78
- }
79
- }
80
- ]
81
- }
82
- ```
83
-
84
- The important rule is that every result should return enough metadata for NocoBase to resolve the original source: `fileId`/`filename` for files, or `collection`/`recordId` for datasource records.
85
-
86
- ### Lightweight open-source service target
87
-
88
- For a small but useful deployment, use a standalone service with:
89
-
90
- - Qdrant or LanceDB for vector search.
91
- - FastAPI or Express for `/ingest`, `/delete`, and `/search`.
92
- - A small embedding model such as `BAAI/bge-small-en-v1.5`, `intfloat/multilingual-e5-small`, or another model matching the deployment language.
93
- - A namespace per NocoBase knowledge base.
94
-
95
- Minimum API surface:
96
-
97
- - `POST /ingest`: receive `{ namespace, source, content | fileUrl | storageRef, metadata }`.
98
- - `POST /delete`: receive `{ namespace, sourceId }`.
99
- - `POST /search`: implement the contract above.
100
-
101
- For NocoBase datasource knowledge, send each record as a source document with metadata `{ collection, recordId, fields, updatedAt }`; the RAG service chunks and embeds the selected text fields, then returns `collection` and `recordId` in search results.
102
-
103
- ### E5/OpenAI-compatible embedding
104
-
105
- If the external RAG service uses an E5 family model behind an OpenAI-compatible `/v1/embeddings` API, configure the NocoBase knowledge base with `ragProvider: "e5-http"`. `plugin-knowledge-base` will read the selected embedding LLM service and forward its `baseURL`, `apiKey`, and model to the RAG service.
106
-
107
- - embed user queries as `query: <question>`;
108
- - embed document chunks as `passage: <chunk>`;
109
- - use the same model for ingest and search;
110
- - recreate the vector collection when changing models or vector dimensions.
111
-
112
- The RAG service still owns chunking, embedding calls, vector storage, and metadata mapping. NocoBase owns the LLM service configuration and search authorization path.
1
+ # plugin-agent-orchestrator
2
+
3
+ ## Overview
4
+ Hierarchical Multi-Agent orchestration for NocoBase AI Employees. Enables Leader agents to delegate tasks to Sub-Agent employees, with detailed execution tracing and context/memory management.
5
+
6
+ ## Features
7
+ - **Hierarchical Delegation**: Allows AI Leader agents to break down complex tasks and assign them to specialized sub-agents via native dispatching.
8
+ - **Seamless Integration**: Plugs directly into the existing AI Employee framework, capturing execution spans.
9
+ - **Execution Tracking**: Monitor sub-agent task execution and nested tool calls in detail within the main chat interface.
10
+ - **External RAG Search**: Exposes `external_rag_search` so leaders and sub-agents can retrieve context from NocoBase knowledge bases, including external RAG services.
11
+
12
+ ## Usage
13
+ 1. Enable the plugin in the NocoBase Plugin Manager.
14
+ 2. Navigate to the AI Employee configuration page.
15
+ 3. Configure a primary "Leader" agent and specialized "Sub-Agent" employees.
16
+ 4. Add the built-in **AI employee task dispatching** (`dispatch-sub-agent-task`) tool to the Leader agent.
17
+ 5. Ensure the user role has access to both the Leader and Sub-Agent employees (configured via employee roles mapping).
18
+ 6. Interact with the Leader agent; it will automatically delegate tasks to the sub-agents when necessary.
19
+
20
+
21
+ ## External RAG / Embedding service
22
+
23
+ Recommended approach: keep source ownership in NocoBase and move chunking, embedding, vector storage, and retrieval to an external lightweight RAG service. This plugin should not own vector infrastructure directly. It delegates search to `plugin-knowledge-base`, which already supports knowledge bases of type `EXTERNAL_RAG`.
24
+
25
+ ### Architecture
26
+
27
+ 1. NocoBase stores the source metadata:
28
+ - uploaded file attachment id, filename, storage id, URL, owner/role access, or
29
+ - datasource/collection/record id for database-backed knowledge.
30
+ 2. The external RAG service owns:
31
+ - document fetching or receiving source payloads,
32
+ - parsing/chunking,
33
+ - embedding,
34
+ - vector index,
35
+ - retrieval.
36
+ 3. NocoBase creates a knowledge base with `type = EXTERNAL_RAG` and `options` such as:
37
+ - `ragProvider: "external-http"`
38
+ - `ragApiUrl: "https://rag.example.com/search"`
39
+ - `ragApiKey`
40
+ - `ragNamespace`
41
+ - `ragTopK`
42
+ - `ragScoreThreshold`
43
+ 4. Agents use the `external_rag_search` tool. The tool calls `plugin-knowledge-base.searchKnowledgeBases()`, so access control and mixed local/external search remain centralized.
44
+
45
+ ### External search contract
46
+
47
+ The built-in `external-http` strategy expects:
48
+
49
+ ```http
50
+ POST /search
51
+ Authorization: Bearer <ragApiKey>
52
+ Content-Type: application/json
53
+ ```
54
+
55
+ ```json
56
+ {
57
+ "query": "search text",
58
+ "topK": 5,
59
+ "scoreThreshold": 0.3,
60
+ "namespace": "optional-kb-namespace",
61
+ "filter": {}
62
+ }
63
+ ```
64
+
65
+ Response:
66
+
67
+ ```json
68
+ {
69
+ "results": [
70
+ {
71
+ "id": "chunk-or-source-id",
72
+ "content": "matched text",
73
+ "score": 0.82,
74
+ "metadata": {
75
+ "fileId": "123",
76
+ "filename": "contract.pdf",
77
+ "collection": "orders",
78
+ "recordId": "456",
79
+ "sourceUrl": "/api/attachments/123:download"
80
+ }
81
+ }
82
+ ]
83
+ }
84
+ ```
85
+
86
+ The important rule is that every result should return enough metadata for NocoBase to resolve the original source: `fileId`/`filename` for files, or `collection`/`recordId` for datasource records.
87
+
88
+ ### Lightweight open-source service target
89
+
90
+ For a small but useful deployment, use a standalone service with:
91
+
92
+ - Qdrant or LanceDB for vector search.
93
+ - FastAPI or Express for `/ingest`, `/delete`, and `/search`.
94
+ - A small embedding model such as `BAAI/bge-small-en-v1.5`, `intfloat/multilingual-e5-small`, or another model matching the deployment language.
95
+ - A namespace per NocoBase knowledge base.
96
+
97
+ Minimum API surface:
98
+
99
+ - `POST /ingest`: receive `{ namespace, source, content | fileUrl | storageRef, metadata }`.
100
+ - `POST /delete`: receive `{ namespace, sourceId }`.
101
+ - `POST /search`: implement the contract above.
102
+
103
+ For NocoBase datasource knowledge, send each record as a source document with metadata `{ collection, recordId, fields, updatedAt }`; the RAG service chunks and embeds the selected text fields, then returns `collection` and `recordId` in search results.
104
+
105
+ ### E5/OpenAI-compatible embedding
106
+
107
+ If the external RAG service uses an E5 family model behind an OpenAI-compatible `/v1/embeddings` API, configure the NocoBase knowledge base with `ragProvider: "e5-http"`. `plugin-knowledge-base` will read the selected embedding LLM service and forward its `baseURL`, `apiKey`, and model to the RAG service.
108
+
109
+ - embed user queries as `query: <question>`;
110
+ - embed document chunks as `passage: <chunk>`;
111
+ - use the same model for ingest and search;
112
+ - recreate the vector collection when changing models or vector dimensions.
113
+
114
+ The RAG service still owns chunking, embedding calls, vector storage, and metadata mapping. NocoBase owns the LLM service configuration and search authorization path.