plugin-agent-orchestrator 1.0.21 → 1.0.23

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 (180) hide show
  1. package/client-v2.d.ts +2 -0
  2. package/client-v2.js +1 -0
  3. package/dist/client/index.js +1 -1
  4. package/dist/client-v2/214.723affb37c13bf7a.js +10 -0
  5. package/dist/client-v2/264.0533912e6c5ea2d7.js +10 -0
  6. package/dist/client-v2/41.1805b2edfaa4afe2.js +10 -0
  7. package/dist/client-v2/418.5ae055abf141820e.js +10 -0
  8. package/dist/client-v2/619.d99d3c9e61c99064.js +10 -0
  9. package/dist/client-v2/70.a15d7fcec7c41768.js +10 -0
  10. package/dist/client-v2/892.72db4161511c8a16.js +10 -0
  11. package/dist/client-v2/926.87f660b670d85bcc.js +10 -0
  12. package/dist/client-v2/index.js +10 -0
  13. package/dist/externalVersion.js +7 -6
  14. package/dist/locale/en-US.json +7 -0
  15. package/dist/locale/vi-VN.json +7 -0
  16. package/dist/locale/zh-CN.json +27 -0
  17. package/dist/server/migrations/20260615000000-normalize-ai-employee-tool-bindings.js +63 -0
  18. package/dist/server/plugin.js +41 -1
  19. package/dist/server/services/AgentHarness.js +52 -27
  20. package/dist/server/services/AgentLoopController.js +8 -2
  21. package/dist/server/services/AgentLoopService.js +1 -1
  22. package/dist/server/services/AgentRegistryService.js +53 -42
  23. package/dist/server/services/CircuitBreaker.js +7 -2
  24. package/dist/server/services/CodeValidator.js +48 -14
  25. package/dist/server/services/SandboxRunner.js +18 -14
  26. package/dist/server/skill-hub/plugin.js +44 -17
  27. package/dist/server/tools/delegate-task.js +7 -2
  28. package/dist/server/tools/skill-execute.js +33 -2
  29. package/dist/server/utils/ai-manager.js +51 -0
  30. package/dist/server/utils/ctx-utils.js +11 -0
  31. package/dist/server/utils/skill-settings.js +122 -0
  32. package/package.json +49 -45
  33. package/src/client/AIEmployeesContext.tsx +51 -14
  34. package/src/client/AgentRunsTab.tsx +767 -764
  35. package/src/client/HarnessProfilesTab.tsx +254 -247
  36. package/src/client/RulesTab.tsx +780 -716
  37. package/src/client/TracingTab.tsx +1 -0
  38. package/src/client/plugin.tsx +34 -27
  39. package/src/client/skill-hub/components/GitSkillImport.tsx +10 -3
  40. package/src/client/skill-hub/components/SkillMetrics.tsx +157 -124
  41. package/src/client/skill-hub/index.tsx +58 -51
  42. package/src/client/skill-hub/tools/InteractionSchemasProvider.tsx +132 -99
  43. package/src/client/skill-hub/tools/registerSkillLoopCards.ts +71 -58
  44. package/src/client/tools/registerOrchestratorCards.ts +17 -7
  45. package/src/client-v2/components/AIEmployeeSelect.tsx +47 -0
  46. package/src/client-v2/components/AIEmployeesContext.tsx +110 -0
  47. package/src/client-v2/components/AgentRunsTab.tsx +767 -0
  48. package/src/client-v2/components/HarnessProfilesTab.tsx +254 -0
  49. package/src/client-v2/components/RulesTab.tsx +782 -0
  50. package/src/client-v2/components/TracingTab.tsx +432 -0
  51. package/src/client-v2/hooks/useApiRequest.ts +114 -0
  52. package/src/client-v2/pages/AgentRunsPage.tsx +13 -0
  53. package/src/client-v2/pages/ExecutionHistoryPage.tsx +10 -0
  54. package/src/client-v2/pages/HarnessProfilesPage.tsx +10 -0
  55. package/src/client-v2/pages/LoopSettingsPage.tsx +10 -0
  56. package/src/client-v2/pages/RulesPage.tsx +13 -0
  57. package/src/client-v2/pages/SkillDefinitionsPage.tsx +10 -0
  58. package/src/client-v2/pages/SkillMetricsPage.tsx +10 -0
  59. package/src/client-v2/pages/TracingPage.tsx +13 -0
  60. package/src/client-v2/plugin.tsx +70 -0
  61. package/src/client-v2/skill-hub/components/ExecutionHistory.tsx +196 -0
  62. package/src/client-v2/skill-hub/components/FileLinkList.tsx +37 -0
  63. package/src/client-v2/skill-hub/components/GitSkillImport.tsx +539 -0
  64. package/src/client-v2/skill-hub/components/LoopSettings.tsx +331 -0
  65. package/src/client-v2/skill-hub/components/SkillEditor.tsx +453 -0
  66. package/src/client-v2/skill-hub/components/SkillManager.tsx +174 -0
  67. package/src/client-v2/skill-hub/components/SkillMetrics.tsx +157 -0
  68. package/src/client-v2/skill-hub/components/SkillTestPanel.tsx +135 -0
  69. package/src/client-v2/skill-hub/locale.ts +13 -0
  70. package/src/client-v2/skill-hub/tools/loopTemplates.ts +52 -0
  71. package/src/client-v2/skill-hub/utils/jsonFields.ts +41 -0
  72. package/src/client-v2/utils/jsonFields.ts +41 -0
  73. package/src/locale/en-US.json +7 -0
  74. package/src/locale/vi-VN.json +7 -0
  75. package/src/locale/zh-CN.json +27 -0
  76. package/src/server/__tests__/agent-registry-service.test.ts +147 -0
  77. package/src/server/__tests__/code-validator.test.ts +63 -0
  78. package/src/server/__tests__/skill-execute.test.ts +33 -0
  79. package/src/server/__tests__/skill-settings.test.ts +63 -0
  80. package/src/server/migrations/20260615000000-normalize-ai-employee-tool-bindings.ts +39 -0
  81. package/src/server/plugin.ts +68 -12
  82. package/src/server/services/AgentHarness.ts +49 -22
  83. package/src/server/services/AgentLoopController.ts +17 -6
  84. package/src/server/services/AgentLoopService.ts +1 -1
  85. package/src/server/services/AgentPlannerService.ts +10 -0
  86. package/src/server/services/AgentRegistryService.ts +89 -47
  87. package/src/server/services/CircuitBreaker.ts +10 -0
  88. package/src/server/services/CodeValidator.ts +237 -159
  89. package/src/server/services/SandboxRunner.ts +203 -189
  90. package/src/server/skill-hub/plugin.ts +933 -898
  91. package/src/server/tools/delegate-task.ts +12 -9
  92. package/src/server/tools/skill-execute.ts +194 -160
  93. package/src/server/utils/ai-manager.ts +24 -0
  94. package/src/server/utils/ctx-utils.ts +14 -0
  95. package/src/server/utils/skill-settings.ts +116 -0
  96. package/dist/client/AIEmployeeSelect.d.ts +0 -11
  97. package/dist/client/AIEmployeesContext.d.ts +0 -30
  98. package/dist/client/AgentRunsTab.d.ts +0 -2
  99. package/dist/client/HarnessProfilesTab.d.ts +0 -2
  100. package/dist/client/OrchestratorSettings.d.ts +0 -3
  101. package/dist/client/RulesTab.d.ts +0 -2
  102. package/dist/client/TracingTab.d.ts +0 -2
  103. package/dist/client/hooks/useRunEventStream.d.ts +0 -22
  104. package/dist/client/index.d.ts +0 -2
  105. package/dist/client/plugin.d.ts +0 -6
  106. package/dist/client/skill-hub/components/ExecutionHistory.d.ts +0 -2
  107. package/dist/client/skill-hub/components/ExecutionProgress.d.ts +0 -20
  108. package/dist/client/skill-hub/components/GitSkillImport.d.ts +0 -7
  109. package/dist/client/skill-hub/components/LoopSettings.d.ts +0 -2
  110. package/dist/client/skill-hub/components/SkillEditor.d.ts +0 -7
  111. package/dist/client/skill-hub/components/SkillManager.d.ts +0 -2
  112. package/dist/client/skill-hub/components/SkillMetrics.d.ts +0 -2
  113. package/dist/client/skill-hub/components/SkillTestPanel.d.ts +0 -7
  114. package/dist/client/skill-hub/index.d.ts +0 -11
  115. package/dist/client/skill-hub/locale.d.ts +0 -3
  116. package/dist/client/skill-hub/tools/InteractionSchemasProvider.d.ts +0 -6
  117. package/dist/client/skill-hub/tools/SkillHubCard.d.ts +0 -3
  118. package/dist/client/skill-hub/tools/loopTemplates.d.ts +0 -22
  119. package/dist/client/skill-hub/tools/registerSkillLoopCards.d.ts +0 -1
  120. package/dist/client/skill-hub/utils/jsonFields.d.ts +0 -3
  121. package/dist/client/tools/PlanApprovalCard.d.ts +0 -3
  122. package/dist/client/tools/registerOrchestratorCards.d.ts +0 -1
  123. package/dist/index.d.ts +0 -2
  124. package/dist/server/collections/agent-execution-spans.d.ts +0 -9
  125. package/dist/server/collections/agent-harness-profiles.d.ts +0 -2
  126. package/dist/server/collections/agent-loop-events.d.ts +0 -2
  127. package/dist/server/collections/agent-loop-runs.d.ts +0 -2
  128. package/dist/server/collections/agent-loop-steps.d.ts +0 -2
  129. package/dist/server/collections/orchestrator-config.d.ts +0 -2
  130. package/dist/server/collections/orchestrator-logs.d.ts +0 -8
  131. package/dist/server/collections/skill-definitions.d.ts +0 -3
  132. package/dist/server/collections/skill-executions.d.ts +0 -3
  133. package/dist/server/collections/skill-loop-configs.d.ts +0 -3
  134. package/dist/server/collections/skill-worker-configs.d.ts +0 -3
  135. package/dist/server/migrations/20260423000000-add-progress-fields.d.ts +0 -4
  136. package/dist/server/migrations/20260425000000-add-interaction-schema.d.ts +0 -4
  137. package/dist/server/migrations/20260427000000-add-tracing-detail-fields.d.ts +0 -7
  138. package/dist/server/migrations/20260427000000-change-packages-to-text.d.ts +0 -4
  139. package/dist/server/migrations/20260427000001-change-other-json-to-text.d.ts +0 -4
  140. package/dist/server/migrations/20260429000000-add-llm-fields.d.ts +0 -7
  141. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.d.ts +0 -16
  142. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.d.ts +0 -7
  143. package/dist/server/migrations/20260524000000-add-agent-loop-fields-to-skill-executions.d.ts +0 -7
  144. package/dist/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.d.ts +0 -12
  145. package/dist/server/migrations/20260601000000-add-token-fields.d.ts +0 -7
  146. package/dist/server/plugin.d.ts +0 -16
  147. package/dist/server/resources/agent-loop.d.ts +0 -3
  148. package/dist/server/resources/tracing.d.ts +0 -7
  149. package/dist/server/services/AgentHarness.d.ts +0 -44
  150. package/dist/server/services/AgentLoopController.d.ts +0 -218
  151. package/dist/server/services/AgentLoopRepository.d.ts +0 -20
  152. package/dist/server/services/AgentLoopService.d.ts +0 -159
  153. package/dist/server/services/AgentPlanValidator.d.ts +0 -4
  154. package/dist/server/services/AgentPlannerService.d.ts +0 -8
  155. package/dist/server/services/AgentRegistryService.d.ts +0 -21
  156. package/dist/server/services/CircuitBreaker.d.ts +0 -40
  157. package/dist/server/services/CodeValidator.d.ts +0 -32
  158. package/dist/server/services/ContextAggregator.d.ts +0 -45
  159. package/dist/server/services/ExecutionSpanService.d.ts +0 -46
  160. package/dist/server/services/FileManager.d.ts +0 -28
  161. package/dist/server/services/RunEventBus.d.ts +0 -9
  162. package/dist/server/services/SandboxRunner.d.ts +0 -41
  163. package/dist/server/services/SkillManager.d.ts +0 -6
  164. package/dist/server/services/SkillRepositoryService.d.ts +0 -22
  165. package/dist/server/services/TokenTracker.d.ts +0 -62
  166. package/dist/server/services/WorkerEnvManager.d.ts +0 -26
  167. package/dist/server/skill-hub/actions/git-import.d.ts +0 -21
  168. package/dist/server/skill-hub/mcp/McpController.d.ts +0 -15
  169. package/dist/server/skill-hub/plugin.d.ts +0 -61
  170. package/dist/server/skill-hub/tasks/SkillExecutionTask.d.ts +0 -16
  171. package/dist/server/skill-hub/utils/json-fields.d.ts +0 -7
  172. package/dist/server/tools/agent-loop.d.ts +0 -235
  173. package/dist/server/tools/delegate-task.d.ts +0 -19
  174. package/dist/server/tools/external-rag-search.d.ts +0 -42
  175. package/dist/server/tools/orchestrator-plan.d.ts +0 -205
  176. package/dist/server/tools/skill-execute.d.ts +0 -36
  177. package/dist/server/types.d.ts +0 -47
  178. package/dist/server/utils/ctx-utils.d.ts +0 -30
  179. package/dist/server/utils/logging.d.ts +0 -6
  180. /package/{dist/server/index.d.ts → src/client-v2/index.tsx} +0 -0
@@ -1,22 +0,0 @@
1
- export interface RunEvent {
2
- id: string | number;
3
- runId: string | number;
4
- type: string;
5
- title: string;
6
- content?: string;
7
- status?: string;
8
- createdAt?: string;
9
- payload?: any;
10
- }
11
- export interface UseRunEventStreamResult {
12
- events: RunEvent[];
13
- isConnected: boolean;
14
- error: string | null;
15
- }
16
- /**
17
- * React hook that opens an SSE connection to receive real-time agent loop events.
18
- *
19
- * On reconnect (EventSource auto-reconnects), missed events should be fetched
20
- * from the REST endpoint by the caller if needed.
21
- */
22
- export declare function useRunEventStream(runId: string | number | undefined): UseRunEventStreamResult;
@@ -1,2 +0,0 @@
1
- export { default } from './plugin';
2
- export { useRunEventStream } from './hooks/useRunEventStream';
@@ -1,6 +0,0 @@
1
- import { Plugin } from '@nocobase/client';
2
- export declare class PluginAgentOrchestratorClient extends Plugin {
3
- load(): Promise<void>;
4
- private registerSkillUiCards;
5
- }
6
- export default PluginAgentOrchestratorClient;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const ExecutionHistory: React.FC;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- interface ExecutionProgressProps {
3
- execId: string;
4
- skillName: string;
5
- percent: number;
6
- log: string;
7
- }
8
- /**
9
- * Progress component rendered inside chat UI when receiving
10
- * SSE custom event: {action: "skillProgress", body: {...}}
11
- *
12
- * Usage in chat message renderer:
13
- * ```
14
- * if (event.action === 'skillProgress') {
15
- * return <ExecutionProgress {...event.body} />;
16
- * }
17
- * ```
18
- */
19
- export declare const ExecutionProgress: React.FC<ExecutionProgressProps>;
20
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface GitSkillImportProps {
3
- open: boolean;
4
- onClose: (synced?: boolean) => void;
5
- }
6
- export declare const GitSkillImport: React.FC<GitSkillImportProps>;
7
- export {};
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const LoopSettings: React.FC;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface SkillEditorProps {
3
- skill: any | null;
4
- onClose: (saved?: boolean) => void;
5
- }
6
- export declare const SkillEditor: React.FC<SkillEditorProps>;
7
- export {};
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const SkillManager: React.FC;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const SkillMetrics: React.FC;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface SkillTestPanelProps {
3
- skill: any;
4
- onClose: () => void;
5
- }
6
- export declare const SkillTestPanel: React.FC<SkillTestPanelProps>;
7
- export {};
@@ -1,11 +0,0 @@
1
- import { Plugin } from '@nocobase/client';
2
- import { SkillManager } from './components/SkillManager';
3
- import { ExecutionHistory } from './components/ExecutionHistory';
4
- import { SkillMetrics } from './components/SkillMetrics';
5
- import { LoopSettings } from './components/LoopSettings';
6
- export declare class PluginSkillHubClient extends Plugin {
7
- load(): Promise<void>;
8
- private registerSkillUiCards;
9
- }
10
- export { SkillManager, ExecutionHistory, SkillMetrics, LoopSettings };
11
- export default PluginSkillHubClient;
@@ -1,3 +0,0 @@
1
- export declare const namespace = "plugin-agent-orchestrator";
2
- export declare function useT(): (str: string, options?: any) => string;
3
- export declare function tStr(key: string): string;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { InteractionSchema } from './loopTemplates';
3
- export declare const useInteractionSchemas: () => Map<string, InteractionSchema>;
4
- export declare const InteractionSchemasProvider: React.FC<{
5
- children?: React.ReactNode;
6
- }>;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { ToolsUIProperties } from '@nocobase/client';
3
- export declare const SkillHubCard: React.FC<ToolsUIProperties>;
@@ -1,22 +0,0 @@
1
- export type InteractionSchema = {
2
- type: 'form' | 'select' | 'confirm';
3
- prompt: string;
4
- options?: {
5
- label: string;
6
- value: string | number;
7
- }[];
8
- fields?: Record<string, {
9
- type?: string;
10
- title?: string;
11
- required?: boolean;
12
- enum?: any[];
13
- }>;
14
- };
15
- export type LoopTemplate = {
16
- key: string;
17
- title: string;
18
- description: string;
19
- schema: InteractionSchema;
20
- };
21
- export declare const LOOP_TEMPLATES: LoopTemplate[];
22
- export declare function getLoopTemplate(key?: string): LoopTemplate;
@@ -1 +0,0 @@
1
- export declare function registerSkillLoopCards(app: any): Promise<void>;
@@ -1,3 +0,0 @@
1
- export declare function parseJsonText<T = any>(value: any, fallback: T): T;
2
- export declare function formatJsonText(value: any, fallback?: any): string;
3
- export declare function stringifyJsonText(value: any, fallback?: any): string;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { ToolsUIProperties } from '@nocobase/client';
3
- export declare const PlanApprovalCard: React.FC<ToolsUIProperties>;
@@ -1 +0,0 @@
1
- export declare function registerOrchestratorCards(app: any): Promise<void>;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './server';
2
- export { default } from './server';
@@ -1,9 +0,0 @@
1
- /**
2
- * Unified execution graph for agent orchestration.
3
- *
4
- * A root run can contain sub-agent spans and child tool/skill spans. Skill Hub
5
- * keeps its own sandbox execution records; this collection stores the flow
6
- * relationship and links to those records when applicable.
7
- */
8
- declare const _default: import("@nocobase/database").CollectionOptions;
9
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("@nocobase/database").CollectionOptions;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("@nocobase/database").CollectionOptions;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("@nocobase/database").CollectionOptions;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("@nocobase/database").CollectionOptions;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("@nocobase/database").CollectionOptions;
2
- export default _default;
@@ -1,8 +0,0 @@
1
- /**
2
- * Stores delegation execution logs for Swarm Tracing (Phase 5).
3
- *
4
- * Since createReactAgent doesn't create aiConversation records,
5
- * we log delegation events to a dedicated table for observability.
6
- */
7
- declare const _default: import("@nocobase/database").CollectionOptions;
8
- export default _default;
@@ -1,3 +0,0 @@
1
- import { CollectionOptions } from '@nocobase/database';
2
- declare const _default: CollectionOptions;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import { CollectionOptions } from '@nocobase/database';
2
- declare const _default: CollectionOptions;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import { CollectionOptions } from '@nocobase/database';
2
- declare const _default: CollectionOptions;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import { CollectionOptions } from '@nocobase/database';
2
- declare const _default: CollectionOptions;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddProgressFieldsMigration extends Migration {
3
- up(): Promise<void>;
4
- }
@@ -1,4 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddInteractionSchemaMigration extends Migration {
3
- up(): Promise<void>;
4
- }
@@ -1,7 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddTracingDetailFieldsMigration extends Migration {
3
- on: string;
4
- appVersion: string;
5
- up(): Promise<void>;
6
- down(): Promise<void>;
7
- }
@@ -1,4 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class ChangePackagesToTextMigration extends Migration {
3
- up(): Promise<void>;
4
- }
@@ -1,4 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class ChangeOtherJsonToTextMigration extends Migration {
3
- up(): Promise<void>;
4
- }
@@ -1,7 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddLlmFieldsToOrchestratorConfig extends Migration {
3
- on: string;
4
- appVersion: string;
5
- up(): Promise<void>;
6
- down(): Promise<void>;
7
- }
@@ -1,16 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- /**
3
- * Fix: inputArgs column in skillExecutions was json type but should be text.
4
- *
5
- * Root cause: The column was created as `json` from an older schema version,
6
- * but the collection defines it as `text`. The `stringifyJsonText()` utility
7
- * wraps values in markdown code fences (```json\n...\n```) which PostgreSQL
8
- * rejects as invalid JSON syntax, causing SequelizeDatabaseError on every
9
- * skill execution attempt.
10
- */
11
- export default class FixInputArgsJsonToText extends Migration {
12
- on: string;
13
- appVersion: string;
14
- up(): Promise<void>;
15
- down(): Promise<void>;
16
- }
@@ -1,7 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddOrchestratorTraceFieldsToSkillExecutions extends Migration {
3
- on: string;
4
- appVersion: string;
5
- up(): Promise<void>;
6
- down(): Promise<void>;
7
- }
@@ -1,7 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddAgentLoopFieldsToSkillExecutions extends Migration {
3
- on: string;
4
- appVersion: string;
5
- up(): Promise<void>;
6
- down(): Promise<void>;
7
- }
@@ -1,12 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddPlanApprovalAndHarnessProfiles extends Migration {
3
- on: string;
4
- appVersion: string;
5
- up(): Promise<void>;
6
- addRunColumns(queryInterface: any, tableName: string): Promise<void>;
7
- addStepColumns(queryInterface: any, tableName: string): Promise<void>;
8
- addConfigColumns(queryInterface: any, tableName: string): Promise<void>;
9
- ensureHarnessProfiles(queryInterface: any, tableName: string): Promise<void>;
10
- seedDefaultProfiles(): Promise<void>;
11
- down(): Promise<void>;
12
- }
@@ -1,7 +0,0 @@
1
- import { Migration } from '@nocobase/server';
2
- export default class AddTokenFieldsMigration extends Migration {
3
- on: string;
4
- appVersion: string;
5
- up(): Promise<void>;
6
- down(): Promise<void>;
7
- }
@@ -1,16 +0,0 @@
1
- import { Plugin } from '@nocobase/server';
2
- import SkillHubSubFeature from './skill-hub/plugin';
3
- import { AgentLoopService } from './services/AgentLoopService';
4
- export declare class PluginAgentOrchestratorServer extends Plugin {
5
- skillHub: SkillHubSubFeature;
6
- agentLoopService: AgentLoopService;
7
- afterAdd(): Promise<void>;
8
- beforeLoad(): Promise<void>;
9
- load(): Promise<void>;
10
- install(): Promise<void>;
11
- afterEnable(): Promise<void>;
12
- afterDisable(): Promise<void>;
13
- remove(): Promise<void>;
14
- beforeStop(): Promise<void>;
15
- }
16
- export default PluginAgentOrchestratorServer;
@@ -1,3 +0,0 @@
1
- import { Plugin } from '@nocobase/server';
2
- import { AgentLoopService } from '../services/AgentLoopService';
3
- export declare function registerAgentLoopResource(plugin: Plugin, service: AgentLoopService): void;
@@ -1,7 +0,0 @@
1
- import { Plugin } from '@nocobase/server';
2
- /**
3
- * Custom resource for the Swarm Tracing admin UI (Phase 5).
4
- * Queries the dedicated orchestratorLogs collection instead of
5
- * filtering aiConversations by JSONB (P2 fix: DB-engine agnostic).
6
- */
7
- export declare function registerTracingResource(plugin: Plugin): void;
@@ -1,44 +0,0 @@
1
- import { AgentRegistryService } from './AgentRegistryService';
2
- export declare class AgentHarness {
3
- private readonly plugin;
4
- private readonly registryService;
5
- private readonly spanService;
6
- private readonly tokenTracker;
7
- private readonly contextAggregator;
8
- constructor(plugin: any, registryService: AgentRegistryService);
9
- get db(): any;
10
- get app(): any;
11
- executeStep(run: any, step: any, options?: {
12
- userId?: string | number;
13
- ctx?: any;
14
- }): Promise<any>;
15
- private invokeSubAgentStep;
16
- private invokeNamedTool;
17
- runSubAgent(ctx: any, options: {
18
- leaderUsername: string;
19
- subAgentUsername: string;
20
- subAgentEmployee: any;
21
- task: string;
22
- context?: string;
23
- currentDepth?: number;
24
- currentPath?: string[];
25
- maxDepth: number;
26
- timeout: number;
27
- toolCallId: string;
28
- toolName: string;
29
- llmService?: string;
30
- model?: string;
31
- recursionLimit?: number;
32
- rootRunId?: string;
33
- parentSpanId?: string;
34
- agentLoopRunId?: string;
35
- agentLoopStepId?: string;
36
- }): Promise<{
37
- status: "success";
38
- content: string;
39
- } | {
40
- status: "error";
41
- content: any;
42
- }>;
43
- private logDelegation;
44
- }
@@ -1,218 +0,0 @@
1
- import { AgentRegistryService } from './AgentRegistryService';
2
- import { AgentPlannerService } from './AgentPlannerService';
3
- import { AgentPlanValidator } from './AgentPlanValidator';
4
- import { AgentLoopRepository } from './AgentLoopRepository';
5
- import { AgentHarness } from './AgentHarness';
6
- import { AgentLoopPolicy, AgentLoopPlanStepInput, AgentLoopRunStatus } from './AgentLoopService';
7
- import { TokenTracker } from './TokenTracker';
8
- export declare class AgentLoopController {
9
- private readonly registryService;
10
- private readonly plannerService;
11
- private readonly validator;
12
- private readonly repository;
13
- private readonly harness;
14
- private readonly tokenTracker;
15
- constructor(registryService: AgentRegistryService, plannerService: AgentPlannerService, validator: AgentPlanValidator, repository: AgentLoopRepository, harness: AgentHarness, tokenTracker?: TokenTracker | null);
16
- createRun(options: {
17
- goal: string;
18
- leaderUsername?: string;
19
- sessionId?: string;
20
- messageId?: string;
21
- userId?: string | number;
22
- policy?: Partial<AgentLoopPolicy>;
23
- metadata?: any;
24
- plan?: AgentLoopPlanStepInput[];
25
- }): Promise<{
26
- run: any;
27
- steps: any;
28
- nextSteps: any[];
29
- }>;
30
- planGoal(options: {
31
- goal: string;
32
- leaderUsername?: string;
33
- sessionId?: string;
34
- messageId?: string;
35
- userId?: string | number;
36
- policy?: Partial<AgentLoopPolicy>;
37
- metadata?: any;
38
- plan?: AgentLoopPlanStepInput[];
39
- planSource?: string;
40
- plannerModel?: string;
41
- harnessTag?: string;
42
- targetAgent?: string;
43
- runId?: string | number;
44
- }): Promise<{
45
- events: any;
46
- spans: any;
47
- skillExecutions: any;
48
- run: any;
49
- steps: any;
50
- nextSteps: any[];
51
- }>;
52
- revisePlanGoal(runId: string | number, plan: AgentLoopPlanStepInput[], options?: {
53
- goal?: string;
54
- userId?: string | number;
55
- metadata?: any;
56
- planSource?: string;
57
- plannerModel?: string;
58
- harnessTag?: string;
59
- harnessProfileId?: string | number;
60
- harnessSettings?: any;
61
- }): Promise<{
62
- events: any;
63
- spans: any;
64
- skillExecutions: any;
65
- run: any;
66
- steps: any;
67
- nextSteps: any[];
68
- }>;
69
- approvePlanAndExecute(runId: string | number, options?: {
70
- userId?: string | number;
71
- ctx?: any;
72
- reason?: string;
73
- }): Promise<{
74
- run: any;
75
- steps: any;
76
- nextSteps: any[];
77
- }>;
78
- rejectPlan(runId: string | number, options?: {
79
- userId?: string | number;
80
- reason?: string;
81
- }): Promise<{
82
- run: any;
83
- steps: any;
84
- nextSteps: any[];
85
- }>;
86
- requestPlanChanges(runId: string | number, options?: {
87
- userId?: string | number;
88
- feedback?: string;
89
- }): Promise<{
90
- events: any;
91
- spans: any;
92
- skillExecutions: any;
93
- run: any;
94
- steps: any;
95
- nextSteps: any[];
96
- }>;
97
- replacePlan(runId: string | number, plan: AgentLoopPlanStepInput[], options?: {
98
- userId?: string | number;
99
- mode?: 'append' | 'replace_pending';
100
- reason?: string;
101
- markRunning?: boolean;
102
- }): Promise<any[]>;
103
- replan(runId: string | number, plan: AgentLoopPlanStepInput[], options?: {
104
- reason?: string;
105
- mode?: 'append' | 'replace_pending';
106
- userId?: string | number;
107
- }): Promise<any[]>;
108
- startStep(stepId: string | number, options?: {
109
- userId?: string | number;
110
- agentExecutionSpanId?: string | number;
111
- }): Promise<{
112
- run: any;
113
- steps: any;
114
- nextSteps: any[];
115
- }>;
116
- completeStep(stepId: string | number, output: any, options?: {
117
- userId?: string | number;
118
- skillExecutionId?: string | number;
119
- agentExecutionSpanId?: string | number;
120
- metadata?: any;
121
- }): Promise<{
122
- run: any;
123
- steps: any;
124
- nextSteps: any[];
125
- }>;
126
- failStep(stepId: string | number, error: string, options?: {
127
- userId?: string | number;
128
- metadata?: any;
129
- }): Promise<{
130
- run: any;
131
- steps: any;
132
- nextSteps: any[];
133
- }>;
134
- skipStep(stepId: string | number, reason?: string, options?: {
135
- userId?: string | number;
136
- }): Promise<{
137
- run: any;
138
- steps: any;
139
- nextSteps: any[];
140
- }>;
141
- requestApproval(stepId: string | number, approval: any, options?: {
142
- userId?: string | number;
143
- reason?: string;
144
- }): Promise<{
145
- run: any;
146
- steps: any;
147
- nextSteps: any[];
148
- }>;
149
- resumeRun(runId: string | number, options: {
150
- stepId?: string | number;
151
- approved: boolean;
152
- editedInput?: any;
153
- userId?: string | number;
154
- ctx?: any;
155
- }): Promise<{
156
- run: any;
157
- steps: any;
158
- nextSteps: any[];
159
- }>;
160
- retryStep(stepId: string | number, options?: {
161
- userId?: string | number;
162
- }): Promise<{
163
- run: any;
164
- steps: any;
165
- nextSteps: any[];
166
- }>;
167
- finishRun(runId: string | number, finalAnswer: string, options?: {
168
- status?: Extract<AgentLoopRunStatus, 'succeeded' | 'failed'>;
169
- summary?: string;
170
- evidence?: any;
171
- userId?: string | number;
172
- }): Promise<{
173
- run: any;
174
- steps: any;
175
- nextSteps: any[];
176
- }>;
177
- stepFeedback(stepId: string | number, feedback: {
178
- rating: 'positive' | 'negative';
179
- comment?: string;
180
- category?: string;
181
- }, options?: {
182
- userId?: string | number;
183
- }): Promise<{
184
- run: any;
185
- steps: any;
186
- nextSteps: any[];
187
- }>;
188
- cancelRun(runId: string | number, options?: {
189
- userId?: string | number;
190
- reason?: string;
191
- }): Promise<{
192
- run: any;
193
- steps: any;
194
- nextSteps: any[];
195
- }>;
196
- executeApprovedPlan(runId: string | number, options?: {
197
- userId?: string | number;
198
- ctx?: any;
199
- }): Promise<{
200
- run: any;
201
- steps: any;
202
- nextSteps: any[];
203
- }>;
204
- getRunSnapshot(runId: string | number): Promise<{
205
- run: any;
206
- steps: any;
207
- nextSteps: any[];
208
- }>;
209
- getRunDetail(runId: string | number): Promise<{
210
- events: any;
211
- spans: any;
212
- skillExecutions: any;
213
- run: any;
214
- steps: any;
215
- nextSteps: any[];
216
- }>;
217
- pickNextSteps(steps: any[], runPolicy?: any): any[];
218
- }
@@ -1,20 +0,0 @@
1
- export declare class AgentLoopRepository {
2
- private readonly plugin;
3
- constructor(plugin: any);
4
- get db(): any;
5
- getRun(runId: string | number): Promise<any>;
6
- requireRun(runId: string | number): Promise<any>;
7
- createRun(values: any): Promise<any>;
8
- updateRun(runId: string | number, values: any): Promise<void>;
9
- getStep(stepId: string | number): Promise<any>;
10
- requireStep(stepId: string | number): Promise<any>;
11
- createStep(values: any): Promise<any>;
12
- updateStep(stepId: string | number, values: any): Promise<void>;
13
- getSteps(runId: string | number): Promise<any>;
14
- createEvent(values: any): Promise<any>;
15
- getEvents(runId: string | number): Promise<any>;
16
- getLinkedSpans(runId: string | number, rootRunId?: string): Promise<any>;
17
- getLinkedSkillExecutions(runId: string | number, steps: any[]): Promise<any>;
18
- lockRun(runId: string | number, lockName: string, durationMs: number): Promise<boolean>;
19
- unlockRun(runId: string | number): Promise<void>;
20
- }