plugin-agent-orchestrator 1.0.21 → 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.
- package/dist/server/plugin.js +9 -0
- package/package.json +1 -1
- package/src/server/plugin.ts +15 -0
- package/dist/client/AIEmployeeSelect.d.ts +0 -11
- package/dist/client/AIEmployeesContext.d.ts +0 -30
- package/dist/client/AgentRunsTab.d.ts +0 -2
- package/dist/client/HarnessProfilesTab.d.ts +0 -2
- package/dist/client/OrchestratorSettings.d.ts +0 -3
- package/dist/client/RulesTab.d.ts +0 -2
- package/dist/client/TracingTab.d.ts +0 -2
- package/dist/client/hooks/useRunEventStream.d.ts +0 -22
- package/dist/client/index.d.ts +0 -2
- package/dist/client/plugin.d.ts +0 -6
- package/dist/client/skill-hub/components/ExecutionHistory.d.ts +0 -2
- package/dist/client/skill-hub/components/ExecutionProgress.d.ts +0 -20
- package/dist/client/skill-hub/components/GitSkillImport.d.ts +0 -7
- package/dist/client/skill-hub/components/LoopSettings.d.ts +0 -2
- package/dist/client/skill-hub/components/SkillEditor.d.ts +0 -7
- package/dist/client/skill-hub/components/SkillManager.d.ts +0 -2
- package/dist/client/skill-hub/components/SkillMetrics.d.ts +0 -2
- package/dist/client/skill-hub/components/SkillTestPanel.d.ts +0 -7
- package/dist/client/skill-hub/index.d.ts +0 -11
- package/dist/client/skill-hub/locale.d.ts +0 -3
- package/dist/client/skill-hub/tools/InteractionSchemasProvider.d.ts +0 -6
- package/dist/client/skill-hub/tools/SkillHubCard.d.ts +0 -3
- package/dist/client/skill-hub/tools/loopTemplates.d.ts +0 -22
- package/dist/client/skill-hub/tools/registerSkillLoopCards.d.ts +0 -1
- package/dist/client/skill-hub/utils/jsonFields.d.ts +0 -3
- package/dist/client/tools/PlanApprovalCard.d.ts +0 -3
- package/dist/client/tools/registerOrchestratorCards.d.ts +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/server/collections/agent-execution-spans.d.ts +0 -9
- package/dist/server/collections/agent-harness-profiles.d.ts +0 -2
- package/dist/server/collections/agent-loop-events.d.ts +0 -2
- package/dist/server/collections/agent-loop-runs.d.ts +0 -2
- package/dist/server/collections/agent-loop-steps.d.ts +0 -2
- package/dist/server/collections/orchestrator-config.d.ts +0 -2
- package/dist/server/collections/orchestrator-logs.d.ts +0 -8
- package/dist/server/collections/skill-definitions.d.ts +0 -3
- package/dist/server/collections/skill-executions.d.ts +0 -3
- package/dist/server/collections/skill-loop-configs.d.ts +0 -3
- package/dist/server/collections/skill-worker-configs.d.ts +0 -3
- package/dist/server/index.d.ts +0 -1
- package/dist/server/migrations/20260423000000-add-progress-fields.d.ts +0 -4
- package/dist/server/migrations/20260425000000-add-interaction-schema.d.ts +0 -4
- package/dist/server/migrations/20260427000000-add-tracing-detail-fields.d.ts +0 -7
- package/dist/server/migrations/20260427000000-change-packages-to-text.d.ts +0 -4
- package/dist/server/migrations/20260427000001-change-other-json-to-text.d.ts +0 -4
- package/dist/server/migrations/20260429000000-add-llm-fields.d.ts +0 -7
- package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.d.ts +0 -16
- package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.d.ts +0 -7
- package/dist/server/migrations/20260524000000-add-agent-loop-fields-to-skill-executions.d.ts +0 -7
- package/dist/server/migrations/20260524001000-add-plan-approval-and-harness-profiles.d.ts +0 -12
- package/dist/server/migrations/20260601000000-add-token-fields.d.ts +0 -7
- package/dist/server/plugin.d.ts +0 -16
- package/dist/server/resources/agent-loop.d.ts +0 -3
- package/dist/server/resources/tracing.d.ts +0 -7
- package/dist/server/services/AgentHarness.d.ts +0 -44
- package/dist/server/services/AgentLoopController.d.ts +0 -218
- package/dist/server/services/AgentLoopRepository.d.ts +0 -20
- package/dist/server/services/AgentLoopService.d.ts +0 -159
- package/dist/server/services/AgentPlanValidator.d.ts +0 -4
- package/dist/server/services/AgentPlannerService.d.ts +0 -8
- package/dist/server/services/AgentRegistryService.d.ts +0 -21
- package/dist/server/services/CircuitBreaker.d.ts +0 -40
- package/dist/server/services/CodeValidator.d.ts +0 -32
- package/dist/server/services/ContextAggregator.d.ts +0 -45
- package/dist/server/services/ExecutionSpanService.d.ts +0 -46
- package/dist/server/services/FileManager.d.ts +0 -28
- package/dist/server/services/RunEventBus.d.ts +0 -9
- package/dist/server/services/SandboxRunner.d.ts +0 -41
- package/dist/server/services/SkillManager.d.ts +0 -6
- package/dist/server/services/SkillRepositoryService.d.ts +0 -22
- package/dist/server/services/TokenTracker.d.ts +0 -62
- package/dist/server/services/WorkerEnvManager.d.ts +0 -26
- package/dist/server/skill-hub/actions/git-import.d.ts +0 -21
- package/dist/server/skill-hub/mcp/McpController.d.ts +0 -15
- package/dist/server/skill-hub/plugin.d.ts +0 -61
- package/dist/server/skill-hub/tasks/SkillExecutionTask.d.ts +0 -16
- package/dist/server/skill-hub/utils/json-fields.d.ts +0 -7
- package/dist/server/tools/agent-loop.d.ts +0 -235
- package/dist/server/tools/delegate-task.d.ts +0 -19
- package/dist/server/tools/external-rag-search.d.ts +0 -42
- package/dist/server/tools/orchestrator-plan.d.ts +0 -205
- package/dist/server/tools/skill-execute.d.ts +0 -36
- package/dist/server/types.d.ts +0 -47
- package/dist/server/utils/ctx-utils.d.ts +0 -30
- package/dist/server/utils/logging.d.ts +0 -6
package/dist/server/plugin.js
CHANGED
|
@@ -86,6 +86,15 @@ class PluginAgentOrchestratorServer extends import_server.Plugin {
|
|
|
86
86
|
"skillWorkerConfigs:*"
|
|
87
87
|
]
|
|
88
88
|
});
|
|
89
|
+
this.app.acl.allow("skillDefinitions", "list", "loggedIn");
|
|
90
|
+
this.app.acl.allow("skillDefinitions", "get", "loggedIn");
|
|
91
|
+
this.app.acl.allow("skillLoopConfigs", "list", "loggedIn");
|
|
92
|
+
this.app.acl.allow("skillLoopConfigs", "get", "loggedIn");
|
|
93
|
+
this.app.acl.allow("skillExecutions", "list", "loggedIn");
|
|
94
|
+
this.app.acl.allow("skillExecutions", "get", "loggedIn");
|
|
95
|
+
this.app.acl.allow("skillHub", "test", "loggedIn");
|
|
96
|
+
this.app.acl.allow("skillHub", "download", "loggedIn");
|
|
97
|
+
this.app.acl.allow("skillHub", "listTemplates", "loggedIn");
|
|
89
98
|
const toolsManager = this.app.aiManager.toolsManager;
|
|
90
99
|
toolsManager.registerTools((0, import_orchestrator_plan.createOrchestratorPlanTools)(this, this.agentLoopService));
|
|
91
100
|
toolsManager.registerTools((0, import_external_rag_search.createExternalRagSearchTool)(this));
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "代理协调器",
|
|
5
5
|
"displayName.vi-VN": "Điều phối Agent",
|
|
6
6
|
"description": "Hierarchical Multi-Agent orchestration for NocoBase AI Employees. Enables Leader agents to delegate tasks to Sub-Agent employees without modifying core plugin-ai.",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.22",
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"main": "dist/server/index.js",
|
|
10
10
|
"keywords": [
|
package/src/server/plugin.ts
CHANGED
|
@@ -53,6 +53,21 @@ export class PluginAgentOrchestratorServer extends Plugin {
|
|
|
53
53
|
],
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
+
// Allow any logged-in user to read available skills and loop configs.
|
|
57
|
+
// This mirrors the plugin-ai pattern (acl.allow with 'loggedIn')
|
|
58
|
+
// so that non-admin users with AI roles can use skills without
|
|
59
|
+
// requiring manual snippet assignment per role.
|
|
60
|
+
// Create/update/destroy remain restricted to admin roles via the snippet above.
|
|
61
|
+
(this as any).app.acl.allow('skillDefinitions', 'list', 'loggedIn');
|
|
62
|
+
(this as any).app.acl.allow('skillDefinitions', 'get', 'loggedIn');
|
|
63
|
+
(this as any).app.acl.allow('skillLoopConfigs', 'list', 'loggedIn');
|
|
64
|
+
(this as any).app.acl.allow('skillLoopConfigs', 'get', 'loggedIn');
|
|
65
|
+
(this as any).app.acl.allow('skillExecutions', 'list', 'loggedIn');
|
|
66
|
+
(this as any).app.acl.allow('skillExecutions', 'get', 'loggedIn');
|
|
67
|
+
(this as any).app.acl.allow('skillHub', 'test', 'loggedIn');
|
|
68
|
+
(this as any).app.acl.allow('skillHub', 'download', 'loggedIn');
|
|
69
|
+
(this as any).app.acl.allow('skillHub', 'listTemplates', 'loggedIn');
|
|
70
|
+
|
|
56
71
|
// --- Register Dynamic Tools ---
|
|
57
72
|
// Each configured sub-agent becomes a callable tool for its leader.
|
|
58
73
|
// Uses createReactAgent (LangGraph public API) instead of private AIEmployee class.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Reusable Select component for AI Employees.
|
|
4
|
-
* P3 FIX: Uses shared AIEmployeesContext instead of making its own API call.
|
|
5
|
-
*/
|
|
6
|
-
export declare const AIEmployeeSelect: React.FC<{
|
|
7
|
-
value?: string;
|
|
8
|
-
onChange?: (value: string) => void;
|
|
9
|
-
exclude?: string;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
}>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface AIEmployeeInfo {
|
|
3
|
-
username: string;
|
|
4
|
-
nickname: string;
|
|
5
|
-
about?: string;
|
|
6
|
-
skills: string[];
|
|
7
|
-
}
|
|
8
|
-
interface AIEmployeesContextType {
|
|
9
|
-
employees: AIEmployeeInfo[];
|
|
10
|
-
employeeMap: Map<string, string>;
|
|
11
|
-
skillsMap: Map<string, Set<string>>;
|
|
12
|
-
loading: boolean;
|
|
13
|
-
refresh: () => void;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* P3 FIX: Shared context provider that fetches aiEmployees once
|
|
17
|
-
* and shares the data across RulesTab, TracingTab, and AIEmployeeSelect.
|
|
18
|
-
*
|
|
19
|
-
* Also exposes each employee's configured skills so RulesTab can warn when
|
|
20
|
-
* a delegation rule exists but the leader hasn't added the corresponding
|
|
21
|
-
* delegate_<leader>_to_<sub> tool to its skillSettings.
|
|
22
|
-
*/
|
|
23
|
-
export declare const AIEmployeesProvider: React.FC<{
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
}>;
|
|
26
|
-
/**
|
|
27
|
-
* Hook to access shared AI employees data.
|
|
28
|
-
*/
|
|
29
|
-
export declare const useAIEmployees: () => AIEmployeesContextType;
|
|
30
|
-
export {};
|
|
@@ -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;
|
package/dist/client/index.d.ts
DELETED
package/dist/client/plugin.d.ts
DELETED
|
@@ -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,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,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 +0,0 @@
|
|
|
1
|
-
export declare function registerOrchestratorCards(app: any): Promise<void>;
|
package/dist/index.d.ts
DELETED
|
@@ -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,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;
|
package/dist/server/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './plugin';
|
|
@@ -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,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
|
-
}
|
package/dist/server/plugin.d.ts
DELETED
|
@@ -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,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
|
-
}
|