plugin-agent-orchestrator 1.0.20 → 1.0.22

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 (158) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/externalVersion.js +6 -6
  3. package/dist/server/collections/agent-execution-spans.js +24 -0
  4. package/dist/server/collections/agent-loop-runs.js +36 -0
  5. package/dist/server/collections/orchestrator-config.js +14 -0
  6. package/dist/server/migrations/20260601000000-add-token-fields.js +101 -0
  7. package/dist/server/plugin.js +56 -0
  8. package/dist/server/resources/agent-loop.js +33 -25
  9. package/dist/server/resources/tracing.js +5 -8
  10. package/dist/server/services/AgentHarness.js +56 -90
  11. package/dist/server/services/AgentLoopController.js +164 -125
  12. package/dist/server/services/AgentLoopRepository.js +16 -34
  13. package/dist/server/services/AgentLoopService.js +7 -1
  14. package/dist/server/services/AgentPlannerService.js +5 -25
  15. package/dist/server/services/AgentRegistryService.js +34 -24
  16. package/dist/server/services/CircuitBreaker.js +120 -0
  17. package/dist/server/services/ContextAggregator.js +201 -0
  18. package/dist/server/services/ExecutionSpanService.js +2 -5
  19. package/dist/server/services/RunEventBus.js +73 -0
  20. package/dist/server/services/TokenTracker.js +173 -0
  21. package/dist/server/tools/agent-loop.js +30 -63
  22. package/dist/server/tools/delegate-task.js +14 -72
  23. package/dist/server/tools/orchestrator-plan.js +10 -47
  24. package/dist/server/types.js +24 -0
  25. package/dist/server/utils/ctx-utils.js +152 -0
  26. package/dist/server/utils/logging.js +86 -0
  27. package/package.json +44 -44
  28. package/src/client/AgentRunsTab.tsx +764 -764
  29. package/src/client/HarnessProfilesTab.tsx +247 -247
  30. package/src/client/OrchestratorSettings.tsx +106 -106
  31. package/src/client/RulesTab.tsx +716 -716
  32. package/src/client/hooks/useRunEventStream.ts +76 -0
  33. package/src/client/index.tsx +2 -1
  34. package/src/client/plugin.tsx +27 -27
  35. package/src/client/skill-hub/components/LoopSettings.tsx +331 -331
  36. package/src/client/skill-hub/index.tsx +51 -51
  37. package/src/client/skill-hub/tools/InteractionSchemasProvider.tsx +99 -99
  38. package/src/client/skill-hub/tools/SkillHubCard.tsx +109 -109
  39. package/src/client/skill-hub/tools/loopTemplates.ts +52 -52
  40. package/src/client/skill-hub/tools/registerSkillLoopCards.ts +58 -58
  41. package/src/client/tools/PlanApprovalCard.tsx +175 -175
  42. package/src/client/tools/registerOrchestratorCards.ts +7 -7
  43. package/src/server/__tests__/agent-loop-controller.test.ts +375 -0
  44. package/src/server/__tests__/circuit-breaker.test.ts +169 -0
  45. package/src/server/__tests__/context-aggregator.test.ts +222 -0
  46. package/src/server/__tests__/parallel-execution.test.ts +318 -0
  47. package/src/server/__tests__/smoke.test.ts +120 -0
  48. package/src/server/collections/agent-execution-spans.ts +24 -0
  49. package/src/server/collections/agent-harness-profiles.ts +59 -59
  50. package/src/server/collections/agent-loop-events.ts +71 -71
  51. package/src/server/collections/agent-loop-runs.ts +38 -1
  52. package/src/server/collections/agent-loop-steps.ts +144 -144
  53. package/src/server/collections/orchestrator-config.ts +14 -0
  54. package/src/server/collections/skill-executions.ts +106 -106
  55. package/src/server/collections/skill-loop-configs.ts +65 -65
  56. package/src/server/migrations/20260524000000-add-agent-loop-fields-to-skill-executions.ts +30 -30
  57. package/src/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.ts +142 -142
  58. package/src/server/migrations/20260601000000-add-token-fields.ts +89 -0
  59. package/src/server/plugin.ts +68 -0
  60. package/src/server/resources/agent-loop.ts +21 -12
  61. package/src/server/resources/tracing.ts +3 -7
  62. package/src/server/services/AgentHarness.ts +78 -116
  63. package/src/server/services/AgentLoopController.ts +197 -122
  64. package/src/server/services/AgentLoopRepository.ts +9 -25
  65. package/src/server/services/AgentLoopService.ts +13 -1
  66. package/src/server/services/AgentPlanValidator.ts +73 -73
  67. package/src/server/services/AgentPlannerService.ts +2 -25
  68. package/src/server/services/AgentRegistryService.ts +40 -31
  69. package/src/server/services/CircuitBreaker.ts +116 -0
  70. package/src/server/services/ContextAggregator.ts +239 -0
  71. package/src/server/services/ExecutionSpanService.ts +2 -4
  72. package/src/server/services/RunEventBus.ts +45 -0
  73. package/src/server/services/TokenTracker.ts +209 -0
  74. package/src/server/skill-hub/plugin.ts +898 -898
  75. package/src/server/skill-hub/tasks/SkillExecutionTask.ts +460 -460
  76. package/src/server/tools/agent-loop.ts +18 -57
  77. package/src/server/tools/delegate-task.ts +11 -93
  78. package/src/server/tools/orchestrator-plan.ts +26 -50
  79. package/src/server/tools/skill-execute.ts +160 -160
  80. package/src/server/types.ts +55 -0
  81. package/src/server/utils/ctx-utils.ts +118 -0
  82. package/src/server/utils/logging.ts +63 -0
  83. package/dist/client/AIEmployeeSelect.d.ts +0 -11
  84. package/dist/client/AIEmployeesContext.d.ts +0 -30
  85. package/dist/client/AgentRunsTab.d.ts +0 -2
  86. package/dist/client/HarnessProfilesTab.d.ts +0 -2
  87. package/dist/client/OrchestratorSettings.d.ts +0 -3
  88. package/dist/client/RulesTab.d.ts +0 -2
  89. package/dist/client/TracingTab.d.ts +0 -2
  90. package/dist/client/index.d.ts +0 -1
  91. package/dist/client/plugin.d.ts +0 -6
  92. package/dist/client/skill-hub/components/ExecutionHistory.d.ts +0 -2
  93. package/dist/client/skill-hub/components/ExecutionProgress.d.ts +0 -20
  94. package/dist/client/skill-hub/components/GitSkillImport.d.ts +0 -7
  95. package/dist/client/skill-hub/components/LoopSettings.d.ts +0 -2
  96. package/dist/client/skill-hub/components/SkillEditor.d.ts +0 -7
  97. package/dist/client/skill-hub/components/SkillManager.d.ts +0 -2
  98. package/dist/client/skill-hub/components/SkillMetrics.d.ts +0 -2
  99. package/dist/client/skill-hub/components/SkillTestPanel.d.ts +0 -7
  100. package/dist/client/skill-hub/index.d.ts +0 -11
  101. package/dist/client/skill-hub/locale.d.ts +0 -3
  102. package/dist/client/skill-hub/tools/InteractionSchemasProvider.d.ts +0 -6
  103. package/dist/client/skill-hub/tools/SkillHubCard.d.ts +0 -3
  104. package/dist/client/skill-hub/tools/loopTemplates.d.ts +0 -22
  105. package/dist/client/skill-hub/tools/registerSkillLoopCards.d.ts +0 -1
  106. package/dist/client/skill-hub/utils/jsonFields.d.ts +0 -3
  107. package/dist/client/tools/PlanApprovalCard.d.ts +0 -3
  108. package/dist/client/tools/registerOrchestratorCards.d.ts +0 -1
  109. package/dist/index.d.ts +0 -2
  110. package/dist/server/collections/agent-execution-spans.d.ts +0 -9
  111. package/dist/server/collections/agent-harness-profiles.d.ts +0 -2
  112. package/dist/server/collections/agent-loop-events.d.ts +0 -2
  113. package/dist/server/collections/agent-loop-runs.d.ts +0 -2
  114. package/dist/server/collections/agent-loop-steps.d.ts +0 -2
  115. package/dist/server/collections/orchestrator-config.d.ts +0 -2
  116. package/dist/server/collections/orchestrator-logs.d.ts +0 -8
  117. package/dist/server/collections/skill-definitions.d.ts +0 -3
  118. package/dist/server/collections/skill-executions.d.ts +0 -3
  119. package/dist/server/collections/skill-loop-configs.d.ts +0 -3
  120. package/dist/server/collections/skill-worker-configs.d.ts +0 -3
  121. package/dist/server/index.d.ts +0 -1
  122. package/dist/server/migrations/20260423000000-add-progress-fields.d.ts +0 -4
  123. package/dist/server/migrations/20260425000000-add-interaction-schema.d.ts +0 -4
  124. package/dist/server/migrations/20260427000000-add-tracing-detail-fields.d.ts +0 -7
  125. package/dist/server/migrations/20260427000000-change-packages-to-text.d.ts +0 -4
  126. package/dist/server/migrations/20260427000001-change-other-json-to-text.d.ts +0 -4
  127. package/dist/server/migrations/20260429000000-add-llm-fields.d.ts +0 -7
  128. package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.d.ts +0 -16
  129. package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.d.ts +0 -7
  130. package/dist/server/migrations/20260524000000-add-agent-loop-fields-to-skill-executions.d.ts +0 -7
  131. package/dist/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.d.ts +0 -12
  132. package/dist/server/plugin.d.ts +0 -16
  133. package/dist/server/resources/agent-loop.d.ts +0 -3
  134. package/dist/server/resources/tracing.d.ts +0 -7
  135. package/dist/server/services/AgentHarness.d.ts +0 -42
  136. package/dist/server/services/AgentLoopController.d.ts +0 -205
  137. package/dist/server/services/AgentLoopRepository.d.ts +0 -20
  138. package/dist/server/services/AgentLoopService.d.ts +0 -149
  139. package/dist/server/services/AgentPlanValidator.d.ts +0 -4
  140. package/dist/server/services/AgentPlannerService.d.ts +0 -8
  141. package/dist/server/services/AgentRegistryService.d.ts +0 -13
  142. package/dist/server/services/CodeValidator.d.ts +0 -32
  143. package/dist/server/services/ExecutionSpanService.d.ts +0 -46
  144. package/dist/server/services/FileManager.d.ts +0 -28
  145. package/dist/server/services/SandboxRunner.d.ts +0 -41
  146. package/dist/server/services/SkillManager.d.ts +0 -6
  147. package/dist/server/services/SkillRepositoryService.d.ts +0 -22
  148. package/dist/server/services/WorkerEnvManager.d.ts +0 -26
  149. package/dist/server/skill-hub/actions/git-import.d.ts +0 -21
  150. package/dist/server/skill-hub/mcp/McpController.d.ts +0 -15
  151. package/dist/server/skill-hub/plugin.d.ts +0 -61
  152. package/dist/server/skill-hub/tasks/SkillExecutionTask.d.ts +0 -16
  153. package/dist/server/skill-hub/utils/json-fields.d.ts +0 -7
  154. package/dist/server/tools/agent-loop.d.ts +0 -235
  155. package/dist/server/tools/delegate-task.d.ts +0 -19
  156. package/dist/server/tools/external-rag-search.d.ts +0 -42
  157. package/dist/server/tools/orchestrator-plan.d.ts +0 -205
  158. package/dist/server/tools/skill-execute.d.ts +0 -36
@@ -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 +0,0 @@
1
- export { default } from './plugin';
@@ -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,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,42 +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
- constructor(plugin: any, registryService: AgentRegistryService);
7
- get db(): any;
8
- get app(): any;
9
- executeStep(run: any, step: any, options?: {
10
- userId?: string | number;
11
- ctx?: any;
12
- }): Promise<any>;
13
- private invokeSubAgentStep;
14
- private invokeNamedTool;
15
- runSubAgent(ctx: any, options: {
16
- leaderUsername: string;
17
- subAgentUsername: string;
18
- subAgentEmployee: any;
19
- task: string;
20
- context?: string;
21
- currentDepth?: number;
22
- currentPath?: string[];
23
- maxDepth: number;
24
- timeout: number;
25
- toolCallId: string;
26
- toolName: string;
27
- llmService?: string;
28
- model?: string;
29
- recursionLimit?: number;
30
- rootRunId?: string;
31
- parentSpanId?: string;
32
- agentLoopRunId?: string;
33
- agentLoopStepId?: string;
34
- }): Promise<{
35
- status: "success";
36
- content: string;
37
- } | {
38
- status: "error";
39
- content: any;
40
- }>;
41
- private logDelegation;
42
- }
@@ -1,205 +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
- export declare class AgentLoopController {
8
- private readonly registryService;
9
- private readonly plannerService;
10
- private readonly validator;
11
- private readonly repository;
12
- private readonly harness;
13
- constructor(registryService: AgentRegistryService, plannerService: AgentPlannerService, validator: AgentPlanValidator, repository: AgentLoopRepository, harness: AgentHarness);
14
- createRun(options: {
15
- goal: string;
16
- leaderUsername?: string;
17
- sessionId?: string;
18
- messageId?: string;
19
- userId?: string | number;
20
- policy?: Partial<AgentLoopPolicy>;
21
- metadata?: any;
22
- plan?: AgentLoopPlanStepInput[];
23
- }): Promise<{
24
- run: any;
25
- steps: any;
26
- nextStep: any;
27
- }>;
28
- planGoal(options: {
29
- goal: string;
30
- leaderUsername?: string;
31
- sessionId?: string;
32
- messageId?: string;
33
- userId?: string | number;
34
- policy?: Partial<AgentLoopPolicy>;
35
- metadata?: any;
36
- plan?: AgentLoopPlanStepInput[];
37
- planSource?: string;
38
- plannerModel?: string;
39
- harnessTag?: string;
40
- targetAgent?: string;
41
- runId?: string | number;
42
- }): Promise<{
43
- events: any;
44
- spans: any;
45
- skillExecutions: any;
46
- run: any;
47
- steps: any;
48
- nextStep: any;
49
- }>;
50
- revisePlanGoal(runId: string | number, plan: AgentLoopPlanStepInput[], options?: {
51
- goal?: string;
52
- userId?: string | number;
53
- metadata?: any;
54
- planSource?: string;
55
- plannerModel?: string;
56
- harnessTag?: string;
57
- harnessProfileId?: string | number;
58
- harnessSettings?: any;
59
- }): Promise<{
60
- events: any;
61
- spans: any;
62
- skillExecutions: any;
63
- run: any;
64
- steps: any;
65
- nextStep: any;
66
- }>;
67
- approvePlanAndExecute(runId: string | number, options?: {
68
- userId?: string | number;
69
- ctx?: any;
70
- reason?: string;
71
- }): Promise<{
72
- run: any;
73
- steps: any;
74
- nextStep: any;
75
- }>;
76
- rejectPlan(runId: string | number, options?: {
77
- userId?: string | number;
78
- reason?: string;
79
- }): Promise<{
80
- run: any;
81
- steps: any;
82
- nextStep: any;
83
- }>;
84
- requestPlanChanges(runId: string | number, options?: {
85
- userId?: string | number;
86
- feedback?: string;
87
- }): Promise<{
88
- events: any;
89
- spans: any;
90
- skillExecutions: any;
91
- run: any;
92
- steps: any;
93
- nextStep: any;
94
- }>;
95
- replacePlan(runId: string | number, plan: AgentLoopPlanStepInput[], options?: {
96
- userId?: string | number;
97
- mode?: 'append' | 'replace_pending';
98
- reason?: string;
99
- markRunning?: boolean;
100
- }): Promise<any[]>;
101
- replan(runId: string | number, plan: AgentLoopPlanStepInput[], options?: {
102
- reason?: string;
103
- mode?: 'append' | 'replace_pending';
104
- userId?: string | number;
105
- }): Promise<any[]>;
106
- startStep(stepId: string | number, options?: {
107
- userId?: string | number;
108
- agentExecutionSpanId?: string | number;
109
- }): Promise<{
110
- run: any;
111
- steps: any;
112
- nextStep: any;
113
- }>;
114
- completeStep(stepId: string | number, output: any, options?: {
115
- userId?: string | number;
116
- skillExecutionId?: string | number;
117
- agentExecutionSpanId?: string | number;
118
- metadata?: any;
119
- }): Promise<{
120
- run: any;
121
- steps: any;
122
- nextStep: any;
123
- }>;
124
- failStep(stepId: string | number, error: string, options?: {
125
- userId?: string | number;
126
- metadata?: any;
127
- }): Promise<{
128
- run: any;
129
- steps: any;
130
- nextStep: any;
131
- }>;
132
- skipStep(stepId: string | number, reason?: string, options?: {
133
- userId?: string | number;
134
- }): Promise<{
135
- run: any;
136
- steps: any;
137
- nextStep: any;
138
- }>;
139
- requestApproval(stepId: string | number, approval: any, options?: {
140
- userId?: string | number;
141
- reason?: string;
142
- }): Promise<{
143
- run: any;
144
- steps: any;
145
- nextStep: any;
146
- }>;
147
- resumeRun(runId: string | number, options: {
148
- stepId?: string | number;
149
- approved: boolean;
150
- editedInput?: any;
151
- userId?: string | number;
152
- ctx?: any;
153
- }): Promise<{
154
- run: any;
155
- steps: any;
156
- nextStep: any;
157
- }>;
158
- retryStep(stepId: string | number, options?: {
159
- userId?: string | number;
160
- }): Promise<{
161
- run: any;
162
- steps: any;
163
- nextStep: any;
164
- }>;
165
- finishRun(runId: string | number, finalAnswer: string, options?: {
166
- status?: Extract<AgentLoopRunStatus, 'succeeded' | 'failed'>;
167
- summary?: string;
168
- evidence?: any;
169
- userId?: string | number;
170
- }): Promise<{
171
- run: any;
172
- steps: any;
173
- nextStep: any;
174
- }>;
175
- cancelRun(runId: string | number, options?: {
176
- userId?: string | number;
177
- reason?: string;
178
- }): Promise<{
179
- run: any;
180
- steps: any;
181
- nextStep: any;
182
- }>;
183
- executeApprovedPlan(runId: string | number, options?: {
184
- userId?: string | number;
185
- ctx?: any;
186
- }): Promise<{
187
- run: any;
188
- steps: any;
189
- nextStep: any;
190
- }>;
191
- getRunSnapshot(runId: string | number): Promise<{
192
- run: any;
193
- steps: any;
194
- nextStep: any;
195
- }>;
196
- getRunDetail(runId: string | number): Promise<{
197
- events: any;
198
- spans: any;
199
- skillExecutions: any;
200
- run: any;
201
- steps: any;
202
- nextStep: any;
203
- }>;
204
- pickNextStep(steps: any[], runPolicy?: any): any;
205
- }
@@ -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
- }