cmdr-agent 2.1.2 → 2.3.0
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/bin/cmdr.js +4 -0
- package/dist/bin/cmdr.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/cli/args.d.ts +4 -0
- package/dist/src/cli/args.d.ts.map +1 -1
- package/dist/src/cli/args.js +15 -0
- package/dist/src/cli/args.js.map +1 -1
- package/dist/src/cli/commands.js +21 -1
- package/dist/src/cli/commands.js.map +1 -1
- package/dist/src/cli/ink/App.d.ts +2 -0
- package/dist/src/cli/ink/App.d.ts.map +1 -1
- package/dist/src/cli/ink/App.js +71 -7
- package/dist/src/cli/ink/App.js.map +1 -1
- package/dist/src/cli/repl.d.ts +4 -0
- package/dist/src/cli/repl.d.ts.map +1 -1
- package/dist/src/cli/repl.js +83 -20
- package/dist/src/cli/repl.js.map +1 -1
- package/dist/src/config/mcp-registry.d.ts +45 -0
- package/dist/src/config/mcp-registry.d.ts.map +1 -0
- package/dist/src/config/mcp-registry.js +156 -0
- package/dist/src/config/mcp-registry.js.map +1 -0
- package/dist/src/config/schema.d.ts +8 -8
- package/dist/src/core/agent-runner.d.ts +5 -0
- package/dist/src/core/agent-runner.d.ts.map +1 -1
- package/dist/src/core/agent-runner.js +34 -2
- package/dist/src/core/agent-runner.js.map +1 -1
- package/dist/src/core/agent.d.ts +2 -1
- package/dist/src/core/agent.d.ts.map +1 -1
- package/dist/src/core/agent.js +5 -1
- package/dist/src/core/agent.js.map +1 -1
- package/dist/src/core/content-replacement.d.ts +44 -0
- package/dist/src/core/content-replacement.d.ts.map +1 -0
- package/dist/src/core/content-replacement.js +67 -0
- package/dist/src/core/content-replacement.js.map +1 -0
- package/dist/src/core/event-bus.d.ts +129 -0
- package/dist/src/core/event-bus.d.ts.map +1 -0
- package/dist/src/core/event-bus.js +103 -0
- package/dist/src/core/event-bus.js.map +1 -0
- package/dist/src/core/hooks.d.ts +61 -0
- package/dist/src/core/hooks.d.ts.map +1 -0
- package/dist/src/core/hooks.js +140 -0
- package/dist/src/core/hooks.js.map +1 -0
- package/dist/src/core/orchestrator.d.ts +17 -1
- package/dist/src/core/orchestrator.d.ts.map +1 -1
- package/dist/src/core/orchestrator.js +95 -1
- package/dist/src/core/orchestrator.js.map +1 -1
- package/dist/src/core/permissions.d.ts +74 -3
- package/dist/src/core/permissions.d.ts.map +1 -1
- package/dist/src/core/permissions.js +230 -11
- package/dist/src/core/permissions.js.map +1 -1
- package/dist/src/core/presets.d.ts.map +1 -1
- package/dist/src/core/presets.js +1 -0
- package/dist/src/core/presets.js.map +1 -1
- package/dist/src/core/types.d.ts +22 -1
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/llm/anthropic.d.ts +27 -0
- package/dist/src/llm/anthropic.d.ts.map +1 -0
- package/dist/src/llm/anthropic.js +269 -0
- package/dist/src/llm/anthropic.js.map +1 -0
- package/dist/src/llm/ollama.d.ts.map +1 -1
- package/dist/src/llm/ollama.js +16 -4
- package/dist/src/llm/ollama.js.map +1 -1
- package/dist/src/llm/openai.d.ts +25 -0
- package/dist/src/llm/openai.d.ts.map +1 -0
- package/dist/src/llm/openai.js +299 -0
- package/dist/src/llm/openai.js.map +1 -0
- package/dist/src/llm/provider-factory.d.ts +35 -0
- package/dist/src/llm/provider-factory.d.ts.map +1 -0
- package/dist/src/llm/provider-factory.js +73 -0
- package/dist/src/llm/provider-factory.js.map +1 -0
- package/dist/src/memory/consolidation.d.ts +37 -0
- package/dist/src/memory/consolidation.d.ts.map +1 -0
- package/dist/src/memory/consolidation.js +148 -0
- package/dist/src/memory/consolidation.js.map +1 -0
- package/dist/src/memory/memory-manager.d.ts +39 -0
- package/dist/src/memory/memory-manager.d.ts.map +1 -0
- package/dist/src/memory/memory-manager.js +96 -0
- package/dist/src/memory/memory-manager.js.map +1 -0
- package/dist/src/plugins/mcp-client.d.ts +14 -5
- package/dist/src/plugins/mcp-client.d.ts.map +1 -1
- package/dist/src/plugins/mcp-client.js +197 -43
- package/dist/src/plugins/mcp-client.js.map +1 -1
- package/dist/src/scheduling/task-scheduler.d.ts +51 -0
- package/dist/src/scheduling/task-scheduler.d.ts.map +1 -0
- package/dist/src/scheduling/task-scheduler.js +127 -0
- package/dist/src/scheduling/task-scheduler.js.map +1 -0
- package/dist/src/session/prompt-builder.d.ts +6 -0
- package/dist/src/session/prompt-builder.d.ts.map +1 -1
- package/dist/src/session/prompt-builder.js +21 -2
- package/dist/src/session/prompt-builder.js.map +1 -1
- package/dist/src/session/prompt-cache.d.ts +33 -0
- package/dist/src/session/prompt-cache.d.ts.map +1 -0
- package/dist/src/session/prompt-cache.js +54 -0
- package/dist/src/session/prompt-cache.js.map +1 -0
- package/dist/src/tools/built-in/cron-tools.d.ts +19 -0
- package/dist/src/tools/built-in/cron-tools.d.ts.map +1 -0
- package/dist/src/tools/built-in/cron-tools.js +86 -0
- package/dist/src/tools/built-in/cron-tools.js.map +1 -0
- package/dist/src/tools/built-in/diagnostics.d.ts +12 -0
- package/dist/src/tools/built-in/diagnostics.d.ts.map +1 -0
- package/dist/src/tools/built-in/diagnostics.js +119 -0
- package/dist/src/tools/built-in/diagnostics.js.map +1 -0
- package/dist/src/tools/built-in/git-worktree.d.ts +13 -0
- package/dist/src/tools/built-in/git-worktree.d.ts.map +1 -0
- package/dist/src/tools/built-in/git-worktree.js +75 -0
- package/dist/src/tools/built-in/git-worktree.js.map +1 -0
- package/dist/src/tools/built-in/index.d.ts +11 -1
- package/dist/src/tools/built-in/index.d.ts.map +1 -1
- package/dist/src/tools/built-in/index.js +19 -2
- package/dist/src/tools/built-in/index.js.map +1 -1
- package/dist/src/tools/built-in/mcp-resource-tools.d.ts +16 -0
- package/dist/src/tools/built-in/mcp-resource-tools.d.ts.map +1 -0
- package/dist/src/tools/built-in/mcp-resource-tools.js +73 -0
- package/dist/src/tools/built-in/mcp-resource-tools.js.map +1 -0
- package/dist/src/tools/built-in/memory.d.ts +15 -0
- package/dist/src/tools/built-in/memory.d.ts.map +1 -0
- package/dist/src/tools/built-in/memory.js +58 -0
- package/dist/src/tools/built-in/memory.js.map +1 -0
- package/dist/src/tools/built-in/notebook.d.ts +22 -0
- package/dist/src/tools/built-in/notebook.d.ts.map +1 -0
- package/dist/src/tools/built-in/notebook.js +207 -0
- package/dist/src/tools/built-in/notebook.js.map +1 -0
- package/dist/src/tools/built-in/plan-tools.d.ts +13 -0
- package/dist/src/tools/built-in/plan-tools.d.ts.map +1 -0
- package/dist/src/tools/built-in/plan-tools.js +42 -0
- package/dist/src/tools/built-in/plan-tools.js.map +1 -0
- package/dist/src/tools/built-in/task-tools.d.ts +22 -0
- package/dist/src/tools/built-in/task-tools.d.ts.map +1 -0
- package/dist/src/tools/built-in/task-tools.js +113 -0
- package/dist/src/tools/built-in/task-tools.js.map +1 -0
- package/dist/src/tools/built-in/todo-tool.d.ts +21 -0
- package/dist/src/tools/built-in/todo-tool.d.ts.map +1 -0
- package/dist/src/tools/built-in/todo-tool.js +52 -0
- package/dist/src/tools/built-in/todo-tool.js.map +1 -0
- package/dist/src/tools/built-in/web-search.d.ts +9 -0
- package/dist/src/tools/built-in/web-search.d.ts.map +1 -0
- package/dist/src/tools/built-in/web-search.js +89 -0
- package/dist/src/tools/built-in/web-search.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks — shell-based pre/post hooks for tool and command lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* Hooks are defined in .cmdr.toml under [hooks]:
|
|
5
|
+
* [hooks]
|
|
6
|
+
* "pre:tool:bash" = "echo 'About to run bash tool'"
|
|
7
|
+
* "post:tool:file_write" = "./scripts/lint-changed.sh"
|
|
8
|
+
* "pre:command:commit" = "npm test"
|
|
9
|
+
* "session:end" = "./scripts/cleanup.sh"
|
|
10
|
+
*
|
|
11
|
+
* Hook types:
|
|
12
|
+
* pre:tool:<name> — runs before a tool executes (can block on non-zero exit)
|
|
13
|
+
* post:tool:<name> — runs after a tool completes
|
|
14
|
+
* pre:command:<name> — runs before a slash command
|
|
15
|
+
* post:command:<name> — runs after a slash command
|
|
16
|
+
* session:start — runs when session begins
|
|
17
|
+
* session:end — runs when session ends
|
|
18
|
+
*
|
|
19
|
+
* Hooks receive context via environment variables:
|
|
20
|
+
* CMDR_HOOK_TYPE, CMDR_TOOL_NAME, CMDR_TOOL_INPUT (JSON), CMDR_CWD
|
|
21
|
+
*/
|
|
22
|
+
export interface HookConfig {
|
|
23
|
+
[pattern: string]: string;
|
|
24
|
+
}
|
|
25
|
+
export interface HookResult {
|
|
26
|
+
success: boolean;
|
|
27
|
+
output?: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare class HookManager {
|
|
31
|
+
private hooks;
|
|
32
|
+
private cwd;
|
|
33
|
+
constructor(hookConfig?: HookConfig, cwd?: string);
|
|
34
|
+
/** Register hooks from config. */
|
|
35
|
+
loadConfig(config: HookConfig): void;
|
|
36
|
+
/** Find matching hooks for a given event pattern. */
|
|
37
|
+
private findHooks;
|
|
38
|
+
/** Execute a hook command. Returns result with success/failure info. */
|
|
39
|
+
private executeHook;
|
|
40
|
+
/**
|
|
41
|
+
* Run pre-tool hooks. Returns false if a hook blocks execution (non-zero exit).
|
|
42
|
+
*/
|
|
43
|
+
runPreTool(toolName: string, input: Record<string, unknown>): Promise<{
|
|
44
|
+
allowed: boolean;
|
|
45
|
+
output?: string;
|
|
46
|
+
}>;
|
|
47
|
+
/** Run post-tool hooks (informational — cannot block). */
|
|
48
|
+
runPostTool(toolName: string, input: Record<string, unknown>, success: boolean): Promise<void>;
|
|
49
|
+
/** Run session lifecycle hooks. */
|
|
50
|
+
runSessionHook(type: 'session:start' | 'session:end'): Promise<void>;
|
|
51
|
+
/** Wire hooks into the EventBus for automatic firing. */
|
|
52
|
+
wireEventBus(): void;
|
|
53
|
+
/** Get the number of registered hooks. */
|
|
54
|
+
get count(): number;
|
|
55
|
+
/** List all registered hook patterns. */
|
|
56
|
+
list(): Array<{
|
|
57
|
+
pattern: string;
|
|
58
|
+
command: string;
|
|
59
|
+
}>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,MAAM,WAAW,UAAU;IACzB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAID,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,GAAG,CAAQ;gBAEP,UAAU,GAAE,UAAe,EAAE,GAAG,GAAE,MAAsB;IAOpE,kCAAkC;IAClC,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAMpC,qDAAqD;IACrD,OAAO,CAAC,SAAS;IAUjB,wEAAwE;IACxE,OAAO,CAAC,WAAW;IAmBnB;;OAEG;IACG,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAqBjD,0DAA0D;IACpD,WAAW,CACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,IAAI,CAAC;IAiBhB,mCAAmC;IAC7B,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAc1E,yDAAyD;IACzD,YAAY,IAAI,IAAI;IAepB,0CAA0C;IAC1C,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,yCAAyC;IACzC,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAGpD"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks — shell-based pre/post hooks for tool and command lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* Hooks are defined in .cmdr.toml under [hooks]:
|
|
5
|
+
* [hooks]
|
|
6
|
+
* "pre:tool:bash" = "echo 'About to run bash tool'"
|
|
7
|
+
* "post:tool:file_write" = "./scripts/lint-changed.sh"
|
|
8
|
+
* "pre:command:commit" = "npm test"
|
|
9
|
+
* "session:end" = "./scripts/cleanup.sh"
|
|
10
|
+
*
|
|
11
|
+
* Hook types:
|
|
12
|
+
* pre:tool:<name> — runs before a tool executes (can block on non-zero exit)
|
|
13
|
+
* post:tool:<name> — runs after a tool completes
|
|
14
|
+
* pre:command:<name> — runs before a slash command
|
|
15
|
+
* post:command:<name> — runs after a slash command
|
|
16
|
+
* session:start — runs when session begins
|
|
17
|
+
* session:end — runs when session ends
|
|
18
|
+
*
|
|
19
|
+
* Hooks receive context via environment variables:
|
|
20
|
+
* CMDR_HOOK_TYPE, CMDR_TOOL_NAME, CMDR_TOOL_INPUT (JSON), CMDR_CWD
|
|
21
|
+
*/
|
|
22
|
+
import { execSync } from 'node:child_process';
|
|
23
|
+
import { globalEventBus } from './event-bus.js';
|
|
24
|
+
const HOOK_TIMEOUT_MS = 30_000;
|
|
25
|
+
export class HookManager {
|
|
26
|
+
hooks = new Map();
|
|
27
|
+
cwd;
|
|
28
|
+
constructor(hookConfig = {}, cwd = process.cwd()) {
|
|
29
|
+
this.cwd = cwd;
|
|
30
|
+
for (const [pattern, command] of Object.entries(hookConfig)) {
|
|
31
|
+
this.hooks.set(pattern, command);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** Register hooks from config. */
|
|
35
|
+
loadConfig(config) {
|
|
36
|
+
for (const [pattern, command] of Object.entries(config)) {
|
|
37
|
+
this.hooks.set(pattern, command);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Find matching hooks for a given event pattern. */
|
|
41
|
+
findHooks(pattern) {
|
|
42
|
+
const matches = [];
|
|
43
|
+
for (const [hookPattern, command] of this.hooks) {
|
|
44
|
+
if (hookPattern === pattern) {
|
|
45
|
+
matches.push({ pattern: hookPattern, command });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return matches;
|
|
49
|
+
}
|
|
50
|
+
/** Execute a hook command. Returns result with success/failure info. */
|
|
51
|
+
executeHook(command, env) {
|
|
52
|
+
try {
|
|
53
|
+
const output = execSync(command, {
|
|
54
|
+
cwd: this.cwd,
|
|
55
|
+
timeout: HOOK_TIMEOUT_MS,
|
|
56
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
57
|
+
env: { ...process.env, ...env },
|
|
58
|
+
}).toString().trim();
|
|
59
|
+
return { success: true, output };
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
63
|
+
return { success: false, error: message };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Run pre-tool hooks. Returns false if a hook blocks execution (non-zero exit).
|
|
68
|
+
*/
|
|
69
|
+
async runPreTool(toolName, input) {
|
|
70
|
+
const hooks = this.findHooks(`pre:tool:${toolName}`);
|
|
71
|
+
if (hooks.length === 0)
|
|
72
|
+
return { allowed: true };
|
|
73
|
+
const env = {
|
|
74
|
+
CMDR_HOOK_TYPE: 'pre:tool',
|
|
75
|
+
CMDR_TOOL_NAME: toolName,
|
|
76
|
+
CMDR_TOOL_INPUT: JSON.stringify(input),
|
|
77
|
+
CMDR_CWD: this.cwd,
|
|
78
|
+
};
|
|
79
|
+
for (const hook of hooks) {
|
|
80
|
+
const result = this.executeHook(hook.command, env);
|
|
81
|
+
if (!result.success) {
|
|
82
|
+
return { allowed: false, output: result.error };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return { allowed: true };
|
|
86
|
+
}
|
|
87
|
+
/** Run post-tool hooks (informational — cannot block). */
|
|
88
|
+
async runPostTool(toolName, input, success) {
|
|
89
|
+
const hooks = this.findHooks(`post:tool:${toolName}`);
|
|
90
|
+
if (hooks.length === 0)
|
|
91
|
+
return;
|
|
92
|
+
const env = {
|
|
93
|
+
CMDR_HOOK_TYPE: 'post:tool',
|
|
94
|
+
CMDR_TOOL_NAME: toolName,
|
|
95
|
+
CMDR_TOOL_INPUT: JSON.stringify(input),
|
|
96
|
+
CMDR_TOOL_SUCCESS: String(success),
|
|
97
|
+
CMDR_CWD: this.cwd,
|
|
98
|
+
};
|
|
99
|
+
for (const hook of hooks) {
|
|
100
|
+
this.executeHook(hook.command, env);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** Run session lifecycle hooks. */
|
|
104
|
+
async runSessionHook(type) {
|
|
105
|
+
const hooks = this.findHooks(type);
|
|
106
|
+
if (hooks.length === 0)
|
|
107
|
+
return;
|
|
108
|
+
const env = {
|
|
109
|
+
CMDR_HOOK_TYPE: type,
|
|
110
|
+
CMDR_CWD: this.cwd,
|
|
111
|
+
};
|
|
112
|
+
for (const hook of hooks) {
|
|
113
|
+
this.executeHook(hook.command, env);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Wire hooks into the EventBus for automatic firing. */
|
|
117
|
+
wireEventBus() {
|
|
118
|
+
globalEventBus.on('tool:before', async (data) => {
|
|
119
|
+
await this.runPreTool(data.name, data.input);
|
|
120
|
+
});
|
|
121
|
+
globalEventBus.on('tool:after', async (data) => {
|
|
122
|
+
await this.runPostTool(data.name, {}, !data.result.isError);
|
|
123
|
+
});
|
|
124
|
+
globalEventBus.on('session:start', async () => {
|
|
125
|
+
await this.runSessionHook('session:start');
|
|
126
|
+
});
|
|
127
|
+
globalEventBus.on('session:end', async () => {
|
|
128
|
+
await this.runSessionHook('session:end');
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/** Get the number of registered hooks. */
|
|
132
|
+
get count() {
|
|
133
|
+
return this.hooks.size;
|
|
134
|
+
}
|
|
135
|
+
/** List all registered hook patterns. */
|
|
136
|
+
list() {
|
|
137
|
+
return Array.from(this.hooks.entries()).map(([pattern, command]) => ({ pattern, command }));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAY/C,MAAM,eAAe,GAAG,MAAM,CAAA;AAE9B,MAAM,OAAO,WAAW;IACd,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAA;IACjC,GAAG,CAAQ;IAEnB,YAAY,aAAyB,EAAE,EAAE,MAAc,OAAO,CAAC,GAAG,EAAE;QAClE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,KAAK,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAClC,CAAC;IACH,CAAC;IAED,kCAAkC;IAClC,UAAU,CAAC,MAAkB;QAC3B,KAAK,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE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AK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;IAC7F,CAAC;CACF"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Orchestrator — top-level coordinator for multi-agent workflows.
|
|
3
3
|
*
|
|
4
|
-
* Provides runAgent(), runTeam(), and
|
|
4
|
+
* Provides runAgent(), runTeam(), runTasks(), and coordinate() entry points.
|
|
5
|
+
* The coordinate() method adds a planning phase where an LLM decomposes a
|
|
6
|
+
* complex goal into tasks with dependencies before executing them.
|
|
5
7
|
*/
|
|
6
8
|
import type { AgentConfig, AgentRunResult, TeamConfig, TeamRunResult, Task, LLMAdapter, OrchestratorConfig, TokenUsage } from './types.js';
|
|
7
9
|
import type { ToolRegistry } from '../tools/registry.js';
|
|
8
10
|
import type { PermissionManager } from './permissions.js';
|
|
9
11
|
import { Team } from './team.js';
|
|
10
12
|
import { TaskQueue } from '../communication/task-queue.js';
|
|
13
|
+
export interface CoordinateResult {
|
|
14
|
+
success: boolean;
|
|
15
|
+
taskResults: Map<string, AgentRunResult>;
|
|
16
|
+
totalTokenUsage: TokenUsage;
|
|
17
|
+
plannedTasks: number;
|
|
18
|
+
completedTasks: number;
|
|
19
|
+
}
|
|
11
20
|
export declare class Orchestrator {
|
|
12
21
|
private readonly adapter;
|
|
13
22
|
private readonly toolRegistry;
|
|
@@ -30,6 +39,13 @@ export declare class Orchestrator {
|
|
|
30
39
|
}>;
|
|
31
40
|
/** Get the active team (if any). */
|
|
32
41
|
getActiveTeam(): Team | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Coordinator mode: LLM-driven task decomposition + parallel execution.
|
|
44
|
+
* Uses the adapter to plan tasks, then executes them via runTasks().
|
|
45
|
+
*/
|
|
46
|
+
coordinate(goal: string, agentConfigs: readonly AgentConfig[], options?: {
|
|
47
|
+
maxTokenBudget?: number;
|
|
48
|
+
}): Promise<CoordinateResult>;
|
|
33
49
|
/** Get status of the active team. */
|
|
34
50
|
getStatus(): {
|
|
35
51
|
agents: Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/core/orchestrator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/core/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EACtD,IAAI,EAAE,UAAU,EAAE,kBAAkB,EAAqB,UAAU,EAEpE,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAsB1D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IACxC,eAAe,EAAE,UAAU,CAAA;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAmB;IACtD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,UAAU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
+
* Provides runAgent(), runTeam(), runTasks(), and coordinate() entry points.
|
|
5
|
+
* The coordinate() method adds a planning phase where an LLM decomposes a
|
|
6
|
+
* complex goal into tasks with dependencies before executing them.
|
|
5
7
|
*/
|
|
6
8
|
import { Agent } from './agent.js';
|
|
7
9
|
import { Team } from './team.js';
|
|
8
10
|
import { TaskQueue } from '../communication/task-queue.js';
|
|
9
11
|
import { Semaphore } from '../scheduling/semaphore.js';
|
|
10
12
|
const ZERO_USAGE = { input_tokens: 0, output_tokens: 0 };
|
|
13
|
+
const COORDINATOR_SYSTEM_PROMPT = `You are a task decomposition coordinator. Given a complex goal and a list of available agents, break the goal into concrete tasks.
|
|
14
|
+
|
|
15
|
+
Output a JSON array of tasks. Each task has:
|
|
16
|
+
- "id": unique short string (e.g. "t1", "t2")
|
|
17
|
+
- "title": brief task description (1 line)
|
|
18
|
+
- "description": detailed instructions for the agent
|
|
19
|
+
- "assignee": name of the agent best suited for this task
|
|
20
|
+
- "dependsOn": array of task IDs that must complete first (or empty array)
|
|
21
|
+
|
|
22
|
+
Rules:
|
|
23
|
+
- Minimize dependencies — parallelize when possible
|
|
24
|
+
- Each task should be self-contained enough for one agent to handle
|
|
25
|
+
- Assign tasks to agents based on their roles/specializations
|
|
26
|
+
- Keep the total number of tasks reasonable (2-8)
|
|
27
|
+
|
|
28
|
+
Output ONLY the JSON array, no other text.`;
|
|
11
29
|
export class Orchestrator {
|
|
12
30
|
adapter;
|
|
13
31
|
toolRegistry;
|
|
@@ -96,6 +114,82 @@ export class Orchestrator {
|
|
|
96
114
|
getActiveTeam() {
|
|
97
115
|
return this.activeTeam;
|
|
98
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Coordinator mode: LLM-driven task decomposition + parallel execution.
|
|
119
|
+
* Uses the adapter to plan tasks, then executes them via runTasks().
|
|
120
|
+
*/
|
|
121
|
+
async coordinate(goal, agentConfigs, options) {
|
|
122
|
+
this.emit({ type: 'message', data: 'Coordinator: planning tasks...' });
|
|
123
|
+
// Step 1: Plan — ask LLM to decompose the goal into tasks
|
|
124
|
+
const agentList = agentConfigs.map(a => `- ${a.name}: ${a.systemPrompt?.slice(0, 100) ?? 'general assistant'}`).join('\n');
|
|
125
|
+
const planMessages = [{
|
|
126
|
+
role: 'user',
|
|
127
|
+
content: [{
|
|
128
|
+
type: 'text',
|
|
129
|
+
text: `Available agents:\n${agentList}\n\nGoal: ${goal}`,
|
|
130
|
+
}],
|
|
131
|
+
}];
|
|
132
|
+
const planOptions = {
|
|
133
|
+
model: this.config.defaultModel ?? agentConfigs[0]?.model ?? 'qwen3',
|
|
134
|
+
systemPrompt: COORDINATOR_SYSTEM_PROMPT,
|
|
135
|
+
maxTokens: 1024,
|
|
136
|
+
temperature: 0.3,
|
|
137
|
+
};
|
|
138
|
+
let tasks;
|
|
139
|
+
let planUsage = ZERO_USAGE;
|
|
140
|
+
try {
|
|
141
|
+
const response = await this.adapter.chat(planMessages, planOptions);
|
|
142
|
+
planUsage = response.usage;
|
|
143
|
+
const text = response.content
|
|
144
|
+
.filter((b) => b.type === 'text')
|
|
145
|
+
.map(b => b.text)
|
|
146
|
+
.join('');
|
|
147
|
+
// Parse JSON from response (handle markdown code blocks)
|
|
148
|
+
const jsonMatch = text.match(/\[[\s\S]*\]/);
|
|
149
|
+
if (!jsonMatch)
|
|
150
|
+
throw new Error('No JSON array in planner response');
|
|
151
|
+
const parsed = JSON.parse(jsonMatch[0]);
|
|
152
|
+
tasks = parsed.map(t => ({
|
|
153
|
+
id: t.id,
|
|
154
|
+
title: t.title,
|
|
155
|
+
description: t.description,
|
|
156
|
+
status: 'pending',
|
|
157
|
+
assignee: t.assignee,
|
|
158
|
+
dependsOn: t.dependsOn,
|
|
159
|
+
createdAt: new Date(),
|
|
160
|
+
updatedAt: new Date(),
|
|
161
|
+
}));
|
|
162
|
+
this.emit({ type: 'message', data: `Coordinator: planned ${tasks.length} tasks` });
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
// Fallback: single task assigned to first agent
|
|
166
|
+
tasks = [{
|
|
167
|
+
id: 't1',
|
|
168
|
+
title: goal.slice(0, 80),
|
|
169
|
+
description: goal,
|
|
170
|
+
status: 'pending',
|
|
171
|
+
assignee: agentConfigs[0]?.name,
|
|
172
|
+
createdAt: new Date(),
|
|
173
|
+
updatedAt: new Date(),
|
|
174
|
+
}];
|
|
175
|
+
this.emit({ type: 'message', data: 'Coordinator: plan failed, using single-task fallback' });
|
|
176
|
+
}
|
|
177
|
+
// Step 2: Execute
|
|
178
|
+
const { results: taskResults, totalUsage: execUsage } = await this.runTasks(tasks, agentConfigs);
|
|
179
|
+
const totalUsage = addUsage(planUsage, execUsage);
|
|
180
|
+
const completed = Array.from(taskResults.values()).filter(r => r.success).length;
|
|
181
|
+
// Check token budget
|
|
182
|
+
if (options?.maxTokenBudget && (totalUsage.input_tokens + totalUsage.output_tokens) > options.maxTokenBudget) {
|
|
183
|
+
this.emit({ type: 'message', data: 'Coordinator: token budget exceeded' });
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
success: completed === tasks.length,
|
|
187
|
+
taskResults,
|
|
188
|
+
totalTokenUsage: totalUsage,
|
|
189
|
+
plannedTasks: tasks.length,
|
|
190
|
+
completedTasks: completed,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
99
193
|
/** Get status of the active team. */
|
|
100
194
|
getStatus() {
|
|
101
195
|
if (!this.activeTeam)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/core/orchestrator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/core/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;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-3,8 +3,33 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Classifies tools by risk level and gates execution on user approval
|
|
5
5
|
* depending on the current permission mode.
|
|
6
|
+
*
|
|
7
|
+
* Supports fine-grained rules:
|
|
8
|
+
* - Glob patterns for file paths (e.g. "src/**" allows all file writes under src/)
|
|
9
|
+
* - Prefix matching for bash commands (e.g. "npm test" allows "npm test --watch")
|
|
6
10
|
*/
|
|
7
11
|
import type { PermissionMode, ToolRiskLevel, ApprovalCallback } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Pattern rule: "Tool(specifier)" format.
|
|
14
|
+
* Examples:
|
|
15
|
+
* allow: ["bash(npm run *)", "file_read(src/**)"]
|
|
16
|
+
* deny: ["bash(curl *)", "file_read(.env)"]
|
|
17
|
+
* ask: ["bash(git push *)"]
|
|
18
|
+
*
|
|
19
|
+
* Priority: deny > ask > allow (most restrictive wins).
|
|
20
|
+
*/
|
|
21
|
+
export interface PermissionRule {
|
|
22
|
+
/** 'allow' auto-approves, 'deny' auto-blocks, 'ask' always prompts. */
|
|
23
|
+
action: 'allow' | 'deny' | 'ask';
|
|
24
|
+
/** Tool name to match. */
|
|
25
|
+
tool: string;
|
|
26
|
+
/** Optional glob pattern for the tool's primary argument. */
|
|
27
|
+
pattern?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse a permission rule string like "bash(npm run *)" into structured form.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parsePermissionRule(rule: string, action: 'allow' | 'deny' | 'ask'): PermissionRule;
|
|
8
33
|
export declare function classifyTool(toolName: string): ToolRiskLevel;
|
|
9
34
|
export declare class PermissionManager {
|
|
10
35
|
private mode;
|
|
@@ -12,22 +37,68 @@ export declare class PermissionManager {
|
|
|
12
37
|
private sessionAllowed;
|
|
13
38
|
/** Tools persisted in ~/.cmdr/settings.json. */
|
|
14
39
|
private persistedAllowed;
|
|
40
|
+
/** Path-based rules for file tools. */
|
|
41
|
+
private pathRules;
|
|
42
|
+
/** Command-prefix rules for bash tool. */
|
|
43
|
+
private bashRules;
|
|
44
|
+
/** Pattern-based permission rules (Tool(pattern) syntax). */
|
|
45
|
+
private permissionRules;
|
|
46
|
+
/** Project root for resolving relative paths in rules. */
|
|
47
|
+
private projectRoot;
|
|
15
48
|
constructor(mode?: PermissionMode);
|
|
49
|
+
setProjectRoot(root: string): void;
|
|
16
50
|
/** Load persisted settings from ~/.cmdr/settings.json. */
|
|
17
51
|
loadSettings(): Promise<void>;
|
|
18
52
|
/** Save current persisted allow-list to disk. */
|
|
19
53
|
private saveSettings;
|
|
20
54
|
getMode(): PermissionMode;
|
|
21
55
|
setMode(mode: PermissionMode): void;
|
|
56
|
+
/** Add a path rule (e.g. allow writes to "src/**"). */
|
|
57
|
+
addPathRule(pattern: string, allow?: boolean): void;
|
|
58
|
+
/** Add a bash command rule (e.g. allow "npm test"). */
|
|
59
|
+
addBashRule(prefix: string, allow?: boolean): void;
|
|
60
|
+
/** Add a pattern permission rule (e.g. "bash(npm run *)" with action "allow"). */
|
|
61
|
+
addPermissionRule(ruleString: string, action: 'allow' | 'deny' | 'ask'): void;
|
|
62
|
+
/** Load permission rules from config format: { allow: [...], deny: [...], ask: [...] } */
|
|
63
|
+
loadPermissionRules(config: {
|
|
64
|
+
allow?: string[];
|
|
65
|
+
deny?: string[];
|
|
66
|
+
ask?: string[];
|
|
67
|
+
}): void;
|
|
68
|
+
/**
|
|
69
|
+
* Check if a specific file path is allowed by path rules.
|
|
70
|
+
* Returns true (allowed), false (denied), or undefined (no matching rule).
|
|
71
|
+
*/
|
|
72
|
+
private checkPathRules;
|
|
73
|
+
/**
|
|
74
|
+
* Check if a bash command matches any bash rules.
|
|
75
|
+
* Returns true (allowed), false (denied), or undefined (no matching rule).
|
|
76
|
+
*/
|
|
77
|
+
private checkBashRules;
|
|
78
|
+
/**
|
|
79
|
+
* Check fine-grained rules for a specific tool invocation.
|
|
80
|
+
* Returns true if auto-approved by rules, false otherwise.
|
|
81
|
+
*/
|
|
82
|
+
private checkFineGrainedRules;
|
|
83
|
+
/**
|
|
84
|
+
* Check pattern-based permission rules.
|
|
85
|
+
* Priority: deny > ask > allow (most restrictive wins).
|
|
86
|
+
* Returns 'allow', 'deny', 'ask', or undefined if no matching rule.
|
|
87
|
+
*/
|
|
88
|
+
private checkPermissionRules;
|
|
89
|
+
/**
|
|
90
|
+
* Extract the primary argument from tool input for pattern matching.
|
|
91
|
+
* Each tool type uses a different "primary" argument.
|
|
92
|
+
*/
|
|
93
|
+
private getPrimaryArg;
|
|
22
94
|
/**
|
|
23
95
|
* Decide whether a tool call should proceed.
|
|
24
|
-
*
|
|
25
|
-
* Returns true if auto-approved, false if the user must be prompted.
|
|
26
96
|
*/
|
|
27
|
-
needsApproval(toolName: string): boolean;
|
|
97
|
+
needsApproval(toolName: string, input?: Record<string, unknown>): boolean;
|
|
28
98
|
/**
|
|
29
99
|
* Gate a tool call. If approval is needed, calls the approvalCallback.
|
|
30
100
|
* Returns the decision (allow/deny). Handles 'allow-always' by recording it.
|
|
101
|
+
* Pattern deny rules auto-block without prompting.
|
|
31
102
|
*/
|
|
32
103
|
gate(toolName: string, input: Record<string, unknown>, approvalCallback: ApprovalCallback): Promise<'allow' | 'deny'>;
|
|
33
104
|
/** Reset session-allowed set (e.g. on /clear). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/core/permissions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/core/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAoB,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAiCnG;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;IAChC,0BAA0B;IAC1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