sub-agents-mcp 0.10.1 → 0.12.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/README.md +59 -14
- package/dist/agents/AgentManager.d.ts +3 -1
- package/dist/agents/AgentManager.d.ts.map +1 -1
- package/dist/agents/AgentManager.js +56 -22
- package/dist/agents/AgentManager.js.map +1 -1
- package/dist/config/ServerConfig.d.ts +9 -1
- package/dist/config/ServerConfig.d.ts.map +1 -1
- package/dist/config/ServerConfig.js +23 -5
- package/dist/config/ServerConfig.js.map +1 -1
- package/dist/execution/AgentExecutor.d.ts +22 -2
- package/dist/execution/AgentExecutor.d.ts.map +1 -1
- package/dist/execution/AgentExecutor.js +321 -82
- package/dist/execution/AgentExecutor.js.map +1 -1
- package/dist/execution/StreamProcessor.d.ts +7 -3
- package/dist/execution/StreamProcessor.d.ts.map +1 -1
- package/dist/execution/StreamProcessor.js +96 -13
- package/dist/execution/StreamProcessor.js.map +1 -1
- package/dist/server/McpServer.d.ts +5 -3
- package/dist/server/McpServer.d.ts.map +1 -1
- package/dist/server/McpServer.js +3 -0
- package/dist/server/McpServer.js.map +1 -1
- package/dist/tools/RunAgentTool.d.ts.map +1 -1
- package/dist/tools/RunAgentTool.js +9 -2
- package/dist/tools/RunAgentTool.js.map +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Bring Claude Code–style sub-agents to any MCP-compatible tool.
|
|
7
7
|
|
|
8
|
-
This MCP server lets you define task-specific AI agents (like "test-writer" or "code-reviewer") in markdown files, and execute them via Cursor CLI, Claude Code, Codex, Gemini CLI, GLM,
|
|
8
|
+
This MCP server lets you define task-specific AI agents (like "test-writer" or "code-reviewer") in markdown files, and execute them via Cursor CLI, Claude Code, Codex, Gemini CLI, GLM, Kimi, Grok Build, or OpenCode backends.
|
|
9
9
|
|
|
10
10
|
## Why?
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ Claude Code offers powerful sub-agent workflows—but they're limited to its own
|
|
|
14
14
|
**Concrete benefits:**
|
|
15
15
|
- Define reusable agents once, use them across multiple tools
|
|
16
16
|
- Share agent definitions within teams regardless of IDE choice
|
|
17
|
-
- Leverage Cursor CLI, Claude Code, Codex, Gemini CLI, GLM,
|
|
17
|
+
- Leverage Cursor CLI, Claude Code, Codex, Gemini CLI, GLM, Kimi, Grok Build, or OpenCode capabilities from any MCP client
|
|
18
18
|
|
|
19
19
|
→ [Read the full story](https://dev.to/shinpr/bringing-claude-codes-sub-agents-to-any-mcp-compatible-tool-1hb9)
|
|
20
20
|
|
|
@@ -25,10 +25,11 @@ Claude Code offers powerful sub-agent workflows—but they're limited to its own
|
|
|
25
25
|
| | sub-agents-mcp | sub-agents-skills |
|
|
26
26
|
|---|---|---|
|
|
27
27
|
| **Setup** | MCP configuration required | Copy skill files to your environment |
|
|
28
|
-
| **
|
|
29
|
-
| **
|
|
28
|
+
| **Configuration** | One backend/model policy per MCP server | Backend/model/permission per agent frontmatter |
|
|
29
|
+
| **Agent discovery** | Fixed `AGENTS_DIR` | Project-local `.agents` or `SUB_AGENTS_DIR` |
|
|
30
|
+
| **Strengths** | Sessions, MCP resources, structured responses, centralized policy | Lightweight setup and mixed backends in one project |
|
|
30
31
|
|
|
31
|
-
Choose **sub-agents-mcp**
|
|
32
|
+
Choose **sub-agents-mcp** when you want a centrally configured execution service. Choose **sub-agents-skills** when each agent should select its own backend and model in a Skill-compatible environment.
|
|
32
33
|
|
|
33
34
|
## Table of Contents
|
|
34
35
|
|
|
@@ -52,7 +53,9 @@ Choose **sub-agents-mcp** for production use with reliability features. Choose *
|
|
|
52
53
|
- `codex` CLI (from Codex)
|
|
53
54
|
- `gemini` CLI (from Gemini CLI — requires `GEMINI_API_KEY`)
|
|
54
55
|
- `glm` backend (uses the Claude Code `claude` CLI with a Z.ai token)
|
|
56
|
+
- `kimi` backend (uses the Claude Code `claude` CLI with a Kimi API key)
|
|
55
57
|
- `grok` CLI (from Grok Build)
|
|
58
|
+
- `opencode` CLI (from OpenCode)
|
|
56
59
|
- An MCP-compatible tool (Cursor IDE, Claude Desktop, Windsurf, etc.)
|
|
57
60
|
|
|
58
61
|
## Quick Start
|
|
@@ -127,12 +130,27 @@ curl -fsSL https://claude.ai/install.sh | bash
|
|
|
127
130
|
|
|
128
131
|
Set `AGENT_TYPE` to `glm` and add `CLI_API_KEY` to the MCP server environment in your MCP client configuration. Because MCP servers are long-running processes, restart or reconnect the MCP server after changing `CLI_API_KEY`.
|
|
129
132
|
|
|
133
|
+
**For Kimi users:**
|
|
134
|
+
```bash
|
|
135
|
+
# Install Claude Code; Kimi uses the claude binary against Kimi's coding endpoint
|
|
136
|
+
curl -fsSL https://claude.ai/install.sh | bash
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Set `AGENT_TYPE` to `kimi` and add your Kimi API key as `CLI_API_KEY` in the MCP server environment. The key is passed to the child process through the environment, never through CLI arguments. Restart or reconnect the MCP server after changing it.
|
|
140
|
+
|
|
130
141
|
**For Grok Build users:**
|
|
131
142
|
```bash
|
|
132
143
|
# Install Grok Build
|
|
133
144
|
curl -fsSL https://x.ai/cli/install.sh | bash
|
|
134
145
|
```
|
|
135
146
|
|
|
147
|
+
**For OpenCode users:**
|
|
148
|
+
```bash
|
|
149
|
+
brew install anomalyco/tap/opencode
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Configure providers and credentials in OpenCode normally. Each MCP invocation uses isolated data and state directories to avoid concurrent session database locks while continuing to use your normal configuration and credentials.
|
|
153
|
+
|
|
136
154
|
### 3. Configure MCP
|
|
137
155
|
|
|
138
156
|
Add this to your MCP configuration file:
|
|
@@ -148,7 +166,7 @@ Add this to your MCP configuration file:
|
|
|
148
166
|
"args": ["-y", "sub-agents-mcp"],
|
|
149
167
|
"env": {
|
|
150
168
|
"AGENTS_DIR": "/absolute/path/to/your/agents-folder",
|
|
151
|
-
"AGENT_TYPE": "cursor" // or "claude", "codex", "gemini", "glm",
|
|
169
|
+
"AGENT_TYPE": "cursor" // or "claude", "codex", "gemini", "glm", "kimi", "grok", or "opencode"
|
|
152
170
|
}
|
|
153
171
|
}
|
|
154
172
|
}
|
|
@@ -184,6 +202,9 @@ Sub-agents may fail to execute shell commands with permission errors. This happe
|
|
|
184
202
|
|
|
185
203
|
# For Grok Build users
|
|
186
204
|
grok
|
|
205
|
+
|
|
206
|
+
# For OpenCode users
|
|
207
|
+
opencode
|
|
187
208
|
```
|
|
188
209
|
|
|
189
210
|
2. When prompted to allow commands (e.g., "Add Shell(cd), Shell(make) to allowlist?"), approve them
|
|
@@ -320,21 +341,39 @@ Which execution engine to use:
|
|
|
320
341
|
- `"gemini"` - uses `gemini` CLI
|
|
321
342
|
- `"codex"` - uses `codex` CLI (OpenAI Codex)
|
|
322
343
|
- `"glm"` - uses the Claude Code `claude` CLI against GLM's Z.ai endpoint
|
|
344
|
+
- `"kimi"` - uses the Claude Code `claude` CLI against Kimi's coding endpoint
|
|
323
345
|
- `"grok"` - uses `grok` CLI (Grok Build)
|
|
346
|
+
- `"opencode"` - uses `opencode` CLI and its configured provider
|
|
324
347
|
|
|
325
348
|
### Optional Settings
|
|
326
349
|
|
|
327
350
|
**`AGENT_PERMISSION`**
|
|
328
351
|
Approval/sandbox level the sub-agent runs with. Default: `"safe-edit"`.
|
|
329
352
|
|
|
330
|
-
- `"read-only"` — investigation/review only, no edits or shell writes (codex `-s read-only` / claude+glm `--permission-mode plan` / gemini `--approval-mode plan` / cursor `--mode plan` / grok `--sandbox read-only`)
|
|
331
|
-
- `"safe-edit"` — auto-approve edits and suppress prompts (codex `-s workspace-write` + `approval_policy=never` / claude+glm `--permission-mode acceptEdits` / gemini `--approval-mode auto_edit` / cursor `--trust` / grok `--sandbox workspace`)
|
|
353
|
+
- `"read-only"` — investigation/review only, no edits or shell writes (codex `-s read-only` / claude+glm+kimi `--permission-mode plan` / gemini `--approval-mode plan` / cursor `--mode plan` / grok `--sandbox read-only` / OpenCode deny rules)
|
|
354
|
+
- `"safe-edit"` — auto-approve edits and suppress prompts (codex `-s workspace-write` + `approval_policy=never` / claude+glm+kimi `--permission-mode acceptEdits` / gemini `--approval-mode auto_edit` / cursor `--trust` / grok `--sandbox workspace` / OpenCode permission rules)
|
|
332
355
|
- `"yolo"` — bypass all approvals and sandboxing. Use with care.
|
|
333
356
|
|
|
334
|
-
Sub-agents have no stdin, so any approval prompt would deadlock the run. The default `safe-edit` removes prompts; the depth of sandboxing depends on the CLI — codex and grok enforce a workspace-level sandbox (codex `workspace-write`, grok `--sandbox workspace`), while claude / glm / gemini / cursor only auto-approve and do not jail edits to the workspace.
|
|
357
|
+
Sub-agents have no stdin, so any approval prompt would deadlock the run. The default `safe-edit` removes prompts; the depth of sandboxing depends on the CLI — codex and grok enforce a workspace-level sandbox (codex `workspace-write`, grok `--sandbox workspace`), while claude / glm / kimi / gemini / cursor only auto-approve and do not jail edits to the workspace. OpenCode's permission configuration is also not an OS-level sandbox and cannot confine every side effect of programs launched through bash. Grok fixes `--permission-mode bypassPermissions` and uses the kernel-enforced `--sandbox` profile to confine writes per `AGENT_PERMISSION`. If you need strict containment, use a sandbox-backed backend.
|
|
358
|
+
|
|
359
|
+
OpenCode custom and MCP tools follow your OpenCode permissions even in `read-only`; explicitly deny any added tool that can cause side effects.
|
|
360
|
+
|
|
361
|
+
**`AGENT_MODEL`**
|
|
362
|
+
Optional model override applied to every execution by this MCP server. The value is passed to the selected backend as `--model`. When omitted, the backend uses its configured default.
|
|
363
|
+
|
|
364
|
+
```json
|
|
365
|
+
"AGENT_MODEL": "gpt-5.6-luna"
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
OpenCode model names normally use `provider/model` syntax.
|
|
369
|
+
|
|
370
|
+
**`AGENT_EFFORT`**
|
|
371
|
+
Optional backend/model-specific reasoning level or model variant. It is passed to Codex as `model_reasoning_effort`, Claude/GLM/Kimi as `--effort`, Grok as `--reasoning-effort`, and OpenCode as `--variant`. Cursor and Gemini do not support this setting; the MCP server rejects that configuration at startup.
|
|
372
|
+
|
|
373
|
+
Accepted values depend on the selected backend and model. The MCP server forwards the value unchanged.
|
|
335
374
|
|
|
336
375
|
**`CLI_API_KEY`**
|
|
337
|
-
|
|
376
|
+
Provider API key for `AGENT_TYPE=glm` or `kimi`. For GLM it is forwarded to the Claude Code binary as `ANTHROPIC_AUTH_TOKEN`; for Kimi it is forwarded as `ANTHROPIC_API_KEY`. It is never passed as a CLI argument. If you add or change it in your MCP client configuration, restart or reconnect the MCP server so the running process receives the new environment.
|
|
338
377
|
|
|
339
378
|
**`EXECUTION_TIMEOUT_MS`**
|
|
340
379
|
How long agents can run before timing out (default: 5 minutes, max: 10 minutes)
|
|
@@ -346,7 +385,7 @@ Each CLI normally reads settings from project-level directories (`.claude/`, `.c
|
|
|
346
385
|
|
|
347
386
|
Applied to: `claude`, `cursor`, `codex`.
|
|
348
387
|
|
|
349
|
-
Note: Gemini CLI
|
|
388
|
+
Note: Gemini CLI, Grok Build, and OpenCode do not use this option, so it has no effect when `AGENT_TYPE` is `gemini`, `grok`, or `opencode`. OpenCode continues its normal XDG/project configuration discovery. The `glm` and `kimi` backends also ignore this setting to avoid mixing Claude settings and credentials into redirected subprocesses.
|
|
350
389
|
|
|
351
390
|
Example with custom settings:
|
|
352
391
|
```json
|
|
@@ -460,9 +499,15 @@ Make sure the CLI is properly installed and accessible.
|
|
|
460
499
|
**If using GLM (Z.ai):**
|
|
461
500
|
Make sure the Claude Code `claude` CLI is installed, then set `CLI_API_KEY` to your Z.ai token in the MCP server environment. Restart or reconnect the MCP server after changing MCP environment variables.
|
|
462
501
|
|
|
502
|
+
**If using Kimi:**
|
|
503
|
+
Make sure the Claude Code `claude` CLI is installed, then set `CLI_API_KEY` to your Kimi API key in the MCP server environment. Restart or reconnect the MCP server after changing MCP environment variables.
|
|
504
|
+
|
|
463
505
|
**If using Grok Build:**
|
|
464
506
|
Make sure the `grok` CLI is installed and accessible.
|
|
465
507
|
|
|
508
|
+
**If using OpenCode:**
|
|
509
|
+
Make sure the `opencode` CLI is installed and that its provider credentials are configured. The MCP server gives every invocation an isolated OpenCode data/state directory to prevent concurrent SQLite session locks.
|
|
510
|
+
|
|
466
511
|
### Agent not found
|
|
467
512
|
|
|
468
513
|
Check that:
|
|
@@ -472,7 +517,7 @@ Check that:
|
|
|
472
517
|
|
|
473
518
|
### Other execution errors
|
|
474
519
|
|
|
475
|
-
1. Verify `AGENT_TYPE` is set correctly (`cursor`, `claude`, `gemini`, `codex`, `glm`,
|
|
520
|
+
1. Verify `AGENT_TYPE` is set correctly (`cursor`, `claude`, `gemini`, `codex`, `glm`, `kimi`, `grok`, or `opencode`)
|
|
476
521
|
2. Ensure your chosen CLI tool is installed and accessible
|
|
477
522
|
3. Double-check that all environment variables are set in the MCP config
|
|
478
523
|
|
|
@@ -524,14 +569,14 @@ The startup overhead is an intentional trade-off: the system favors clarity and
|
|
|
524
569
|
|
|
525
570
|
## How It Works
|
|
526
571
|
|
|
527
|
-
This MCP server acts as a bridge between your AI tool and a supported execution engine (Cursor CLI, Claude Code, Gemini CLI, Codex, GLM via Z.ai,
|
|
572
|
+
This MCP server acts as a bridge between your AI tool and a supported execution engine (Cursor CLI, Claude Code, Gemini CLI, Codex, GLM via Z.ai, Kimi, Grok Build, or OpenCode).
|
|
528
573
|
|
|
529
574
|
**The flow:**
|
|
530
575
|
|
|
531
576
|
1. You configure the MCP server in your client (Cursor, Claude Desktop, etc.)
|
|
532
577
|
2. The client automatically launches `sub-agents-mcp` as a background process when it starts
|
|
533
578
|
3. When your main AI assistant needs a sub-agent, it makes an MCP tool call
|
|
534
|
-
4. The MCP server reads the agent definition (markdown file) and invokes the
|
|
579
|
+
4. The MCP server reads the agent definition (markdown file) and invokes the globally configured CLI (`cursor-agent`, `claude`, `gemini`, `codex`, `glm`/`kimi` via the `claude` binary, `grok`, or `opencode`)
|
|
535
580
|
5. The execution engine runs the agent and streams results back through the MCP server
|
|
536
581
|
6. Your main assistant receives the results and continues working
|
|
537
582
|
|
|
@@ -42,10 +42,12 @@ export declare class AgentManager {
|
|
|
42
42
|
/**
|
|
43
43
|
* Loads and parses a single agent definition from a file.
|
|
44
44
|
*
|
|
45
|
-
* @param
|
|
45
|
+
* @param resolvedFilePath - Validated real path used for reading the definition
|
|
46
|
+
* @param agentName - Agent name derived from the discovered directory entry
|
|
46
47
|
* @returns Promise resolving to the parsed agent definition or undefined
|
|
47
48
|
*/
|
|
48
49
|
private loadAgentFromFile;
|
|
50
|
+
private isWithinDirectory;
|
|
49
51
|
/**
|
|
50
52
|
* Extracts description from agent file content.
|
|
51
53
|
* Looks for first heading or first line as description.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentManager.d.ts","sourceRoot":"","sources":["../../src/agents/AgentManager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAGlE;;;;;;GAMG;AACH,qBAAa,YAAY;IAGX,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,MAAM,CAAQ;gBAEF,MAAM,EAAE,YAAY;IAIxC;;;;;;OAMG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAqClE;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAK9C;;;;;OAKG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC;;;;;OAKG;YACW,uBAAuB;
|
|
1
|
+
{"version":3,"file":"AgentManager.d.ts","sourceRoot":"","sources":["../../src/agents/AgentManager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAGlE;;;;;;GAMG;AACH,qBAAa,YAAY;IAGX,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,MAAM,CAAQ;gBAEF,MAAM,EAAE,YAAY;IAIxC;;;;;;OAMG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAqClE;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAK9C;;;;;OAKG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC;;;;;OAKG;YACW,uBAAuB;IAuFrC;;;;;;OAMG;YACW,iBAAiB;IAuC/B,OAAO,CAAC,iBAAiB;IAQzB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;CAiB3B"}
|
|
@@ -78,10 +78,23 @@ export class AgentManager {
|
|
|
78
78
|
*/
|
|
79
79
|
async loadAgentsFromDirectory() {
|
|
80
80
|
try {
|
|
81
|
-
const agentsDir = path.resolve(this.config.agentsDir);
|
|
81
|
+
const agentsDir = await fs.promises.realpath(path.resolve(this.config.agentsDir));
|
|
82
82
|
this.logger.info('Starting agent discovery', { directory: agentsDir });
|
|
83
83
|
const files = await fs.promises.readdir(agentsDir);
|
|
84
|
-
const agentFiles = files
|
|
84
|
+
const agentFiles = files
|
|
85
|
+
.filter((file) => file.endsWith('.md') || file.endsWith('.txt'))
|
|
86
|
+
.sort((left, right) => {
|
|
87
|
+
const leftName = left.replace(/\.(md|txt)$/, '');
|
|
88
|
+
const rightName = right.replace(/\.(md|txt)$/, '');
|
|
89
|
+
const nameOrder = leftName.localeCompare(rightName);
|
|
90
|
+
if (nameOrder !== 0)
|
|
91
|
+
return nameOrder;
|
|
92
|
+
if (left.endsWith('.md') && right.endsWith('.txt'))
|
|
93
|
+
return -1;
|
|
94
|
+
if (left.endsWith('.txt') && right.endsWith('.md'))
|
|
95
|
+
return 1;
|
|
96
|
+
return left.localeCompare(right);
|
|
97
|
+
});
|
|
85
98
|
this.logger.info('Agent definition files discovered', {
|
|
86
99
|
totalFiles: files.length,
|
|
87
100
|
agentFiles: agentFiles.length,
|
|
@@ -90,19 +103,34 @@ export class AgentManager {
|
|
|
90
103
|
const agents = new Map();
|
|
91
104
|
for (const file of agentFiles) {
|
|
92
105
|
const filePath = path.join(agentsDir, file);
|
|
106
|
+
const agentName = file.replace(/\.(md|txt)$/, '');
|
|
107
|
+
if (agents.has(agentName)) {
|
|
108
|
+
this.logger.warn('Duplicate agent definition ignored', {
|
|
109
|
+
name: agentName,
|
|
110
|
+
filePath,
|
|
111
|
+
selectedFilePath: agents.get(agentName)?.filePath,
|
|
112
|
+
});
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
let resolvedFilePath;
|
|
93
116
|
try {
|
|
94
|
-
|
|
95
|
-
if (agent) {
|
|
96
|
-
agents.set(agent.name, agent);
|
|
97
|
-
this.logger.debug('Agent definition loaded successfully', {
|
|
98
|
-
name: agent.name,
|
|
99
|
-
filePath: agent.filePath,
|
|
100
|
-
description: agent.description,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
117
|
+
resolvedFilePath = await fs.promises.realpath(filePath);
|
|
103
118
|
}
|
|
104
119
|
catch (error) {
|
|
105
|
-
this.logger.error('Failed to
|
|
120
|
+
this.logger.error('Failed to resolve agent definition file', error instanceof Error ? error : undefined, { filePath });
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (!this.isWithinDirectory(agentsDir, resolvedFilePath)) {
|
|
124
|
+
throw new Error(`Agent definition resolves outside the configured agents directory: ${file}`);
|
|
125
|
+
}
|
|
126
|
+
const agent = await this.loadAgentFromFile(resolvedFilePath, agentName);
|
|
127
|
+
if (agent) {
|
|
128
|
+
agents.set(agentName, agent);
|
|
129
|
+
this.logger.debug('Agent definition loaded successfully', {
|
|
130
|
+
name: agent.name,
|
|
131
|
+
filePath: agent.filePath,
|
|
132
|
+
description: agent.description,
|
|
133
|
+
});
|
|
106
134
|
}
|
|
107
135
|
}
|
|
108
136
|
this.logger.info('Agent discovery completed', {
|
|
@@ -113,30 +141,31 @@ export class AgentManager {
|
|
|
113
141
|
}
|
|
114
142
|
catch (error) {
|
|
115
143
|
this.logger.error('Failed to scan agents directory', error instanceof Error ? error : undefined, { directory: this.config.agentsDir });
|
|
144
|
+
if (error instanceof Error && error.message.startsWith('Agent definition resolves outside')) {
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
116
147
|
throw new Error(`Failed to load agents from directory: ${this.config.agentsDir}`);
|
|
117
148
|
}
|
|
118
149
|
}
|
|
119
150
|
/**
|
|
120
151
|
* Loads and parses a single agent definition from a file.
|
|
121
152
|
*
|
|
122
|
-
* @param
|
|
153
|
+
* @param resolvedFilePath - Validated real path used for reading the definition
|
|
154
|
+
* @param agentName - Agent name derived from the discovered directory entry
|
|
123
155
|
* @returns Promise resolving to the parsed agent definition or undefined
|
|
124
156
|
*/
|
|
125
|
-
async loadAgentFromFile(
|
|
157
|
+
async loadAgentFromFile(resolvedFilePath, agentName) {
|
|
126
158
|
try {
|
|
127
|
-
this.logger.debug('Loading agent definition from file', { filePath });
|
|
128
|
-
const content = await fs.promises.readFile(
|
|
129
|
-
const stats = await fs.promises.stat(
|
|
130
|
-
// Extract agent name from filename (without extension)
|
|
131
|
-
const fileName = path.basename(filePath);
|
|
132
|
-
const agentName = fileName.replace(/\.(md|txt)$/, '');
|
|
159
|
+
this.logger.debug('Loading agent definition from file', { filePath: resolvedFilePath });
|
|
160
|
+
const content = await fs.promises.readFile(resolvedFilePath, 'utf-8');
|
|
161
|
+
const stats = await fs.promises.stat(resolvedFilePath);
|
|
133
162
|
// Parse description from content (first line or first heading)
|
|
134
163
|
const description = this.extractDescription(content);
|
|
135
164
|
const agentDefinition = {
|
|
136
165
|
name: agentName,
|
|
137
166
|
description,
|
|
138
167
|
content,
|
|
139
|
-
filePath,
|
|
168
|
+
filePath: resolvedFilePath,
|
|
140
169
|
lastModified: stats.mtime,
|
|
141
170
|
};
|
|
142
171
|
this.logger.debug('Agent definition parsed successfully', {
|
|
@@ -148,10 +177,15 @@ export class AgentManager {
|
|
|
148
177
|
return agentDefinition;
|
|
149
178
|
}
|
|
150
179
|
catch (error) {
|
|
151
|
-
this.logger.error('Error reading agent definition file', error instanceof Error ? error : undefined, { filePath });
|
|
180
|
+
this.logger.error('Error reading agent definition file', error instanceof Error ? error : undefined, { filePath: resolvedFilePath });
|
|
152
181
|
return undefined;
|
|
153
182
|
}
|
|
154
183
|
}
|
|
184
|
+
isWithinDirectory(root, candidate) {
|
|
185
|
+
const relative = path.relative(root, candidate);
|
|
186
|
+
return (relative === '' ||
|
|
187
|
+
(relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative)));
|
|
188
|
+
}
|
|
155
189
|
/**
|
|
156
190
|
* Extracts description from agent file content.
|
|
157
191
|
* Looks for first heading or first line as description.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentManager.js","sourceRoot":"","sources":["../../src/agents/AgentManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAG5B,OAAO,EAAe,MAAM,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEvE;;;;;;GAMG;AACH,MAAM,OAAO,YAAY;IAGH;IAFZ,MAAM,CAAQ;IAEtB,YAAoB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;QACtC,IAAI,CAAC,MAAM,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAChD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,gCAAgC;QAChC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;QAC/D,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,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AC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAE/D,kCAAkC;QAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;YAC1C,CAAC;QACH,CAAC;QAED,oCAAoC;QACpC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACxB,CAAC;QAED,OAAO,kBAAkB,CAAA;IAC3B,CAAC;CACF"}
|
|
@@ -10,8 +10,10 @@ import { type LogLevel } from '../utils/Logger.js';
|
|
|
10
10
|
* - SERVER_NAME: Name identifier for the MCP server (default: 'sub-agents-mcp-server')
|
|
11
11
|
* - SERVER_VERSION: Version of the MCP server (default: '1.0.0')
|
|
12
12
|
* - AGENTS_DIR: Directory containing agent definition files (REQUIRED - must be absolute path)
|
|
13
|
-
* - AGENT_TYPE: Type of agent to use (
|
|
13
|
+
* - AGENT_TYPE: Type of agent to use (default: 'cursor')
|
|
14
14
|
* - AGENT_PERMISSION: Approval/sandbox level for sub-agents ('read-only' | 'safe-edit' | 'yolo') (default: 'safe-edit')
|
|
15
|
+
* - AGENT_MODEL: Optional model override for every agent execution
|
|
16
|
+
* - AGENT_EFFORT: Optional backend-specific reasoning effort/model variant
|
|
15
17
|
* - LOG_LEVEL: Log level for server operations (default: 'info')
|
|
16
18
|
* - SESSION_ENABLED: Enable session management functionality (default: false)
|
|
17
19
|
* - SESSION_DIR: Directory for storing session files (default: '.mcp-sessions')
|
|
@@ -29,6 +31,10 @@ export declare class ServerConfig {
|
|
|
29
31
|
readonly agentType: AgentType;
|
|
30
32
|
/** Approval/sandbox level for sub-agent execution */
|
|
31
33
|
readonly agentPermission: AgentPermission;
|
|
34
|
+
/** Optional model override applied to every execution */
|
|
35
|
+
readonly agentModel: string | undefined;
|
|
36
|
+
/** Optional backend-specific reasoning effort or model variant */
|
|
37
|
+
readonly agentEffort: string | undefined;
|
|
32
38
|
/** Log level for server operations */
|
|
33
39
|
readonly logLevel: LogLevel;
|
|
34
40
|
/** Maximum execution timeout in milliseconds for agent execution */
|
|
@@ -45,6 +51,8 @@ export declare class ServerConfig {
|
|
|
45
51
|
readonly cursorApiKey: string | undefined;
|
|
46
52
|
/** API key for GLM/Z.ai authentication (from CLI_API_KEY env var) */
|
|
47
53
|
readonly glmApiKey: string | undefined;
|
|
54
|
+
/** API key for Kimi authentication (from CLI_API_KEY env var) */
|
|
55
|
+
readonly kimiApiKey: string | undefined;
|
|
48
56
|
/**
|
|
49
57
|
* Creates a new ServerConfig instance by loading values from environment variables
|
|
50
58
|
* or using default values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerConfig.d.ts","sourceRoot":"","sources":["../../src/config/ServerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ServerConfig.d.ts","sourceRoot":"","sources":["../../src/config/ServerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,SAAS,EAKf,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,YAAY;IACvB,uDAAuD;IACvD,SAAgB,UAAU,EAAE,MAAM,CAAA;IAElC,6CAA6C;IAC7C,SAAgB,aAAa,EAAE,MAAM,CAAA;IAErC,gEAAgE;IAChE,SAAgB,SAAS,EAAE,MAAM,CAAA;IAEjC,yCAAyC;IACzC,SAAgB,SAAS,EAAE,SAAS,CAAA;IAEpC,qDAAqD;IACrD,SAAgB,eAAe,EAAE,eAAe,CAAA;IAEhD,yDAAyD;IACzD,SAAgB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAE9C,kEAAkE;IAClE,SAAgB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAE/C,sCAAsC;IACtC,SAAgB,QAAQ,EAAE,QAAQ,CAAA;IAElC,oEAAoE;IACpE,SAAgB,kBAAkB,EAAE,MAAM,CAAA;IAE1C,8CAA8C;IAC9C,SAAgB,cAAc,EAAE,OAAO,CAAA;IAEvC,0CAA0C;IAC1C,SAAgB,UAAU,EAAE,MAAM,CAAA;IAElC,4DAA4D;IAC5D,SAAgB,oBAAoB,EAAE,MAAM,CAAA;IAE5C,8DAA8D;IAC9D,SAAgB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;IAEtD,2FAA2F;IAC3F,SAAgB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAEhD,qEAAqE;IACrE,SAAgB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAE7C,iEAAiE;IACjE,SAAgB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAE9C;;;;OAIG;;CA4GJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AGENT_PERMISSIONS, AGENT_TYPES, DEFAULT_AGENT_PERMISSION, isAgentPermission, isAgentType, } from '../execution/AgentExecutor.js';
|
|
1
|
+
import { AGENT_EFFORT_SUPPORTED_TYPES, AGENT_PERMISSIONS, AGENT_TYPES, DEFAULT_AGENT_PERMISSION, isAgentPermission, isAgentType, supportsAgentEffort, } from '../execution/AgentExecutor.js';
|
|
2
2
|
import { isLogLevel, LOG_LEVELS } from '../utils/Logger.js';
|
|
3
3
|
/**
|
|
4
4
|
* Server configuration management class.
|
|
@@ -10,8 +10,10 @@ import { isLogLevel, LOG_LEVELS } from '../utils/Logger.js';
|
|
|
10
10
|
* - SERVER_NAME: Name identifier for the MCP server (default: 'sub-agents-mcp-server')
|
|
11
11
|
* - SERVER_VERSION: Version of the MCP server (default: '1.0.0')
|
|
12
12
|
* - AGENTS_DIR: Directory containing agent definition files (REQUIRED - must be absolute path)
|
|
13
|
-
* - AGENT_TYPE: Type of agent to use (
|
|
13
|
+
* - AGENT_TYPE: Type of agent to use (default: 'cursor')
|
|
14
14
|
* - AGENT_PERMISSION: Approval/sandbox level for sub-agents ('read-only' | 'safe-edit' | 'yolo') (default: 'safe-edit')
|
|
15
|
+
* - AGENT_MODEL: Optional model override for every agent execution
|
|
16
|
+
* - AGENT_EFFORT: Optional backend-specific reasoning effort/model variant
|
|
15
17
|
* - LOG_LEVEL: Log level for server operations (default: 'info')
|
|
16
18
|
* - SESSION_ENABLED: Enable session management functionality (default: false)
|
|
17
19
|
* - SESSION_DIR: Directory for storing session files (default: '.mcp-sessions')
|
|
@@ -29,6 +31,10 @@ export class ServerConfig {
|
|
|
29
31
|
agentType;
|
|
30
32
|
/** Approval/sandbox level for sub-agent execution */
|
|
31
33
|
agentPermission;
|
|
34
|
+
/** Optional model override applied to every execution */
|
|
35
|
+
agentModel;
|
|
36
|
+
/** Optional backend-specific reasoning effort or model variant */
|
|
37
|
+
agentEffort;
|
|
32
38
|
/** Log level for server operations */
|
|
33
39
|
logLevel;
|
|
34
40
|
/** Maximum execution timeout in milliseconds for agent execution */
|
|
@@ -45,6 +51,8 @@ export class ServerConfig {
|
|
|
45
51
|
cursorApiKey;
|
|
46
52
|
/** API key for GLM/Z.ai authentication (from CLI_API_KEY env var) */
|
|
47
53
|
glmApiKey;
|
|
54
|
+
/** API key for Kimi authentication (from CLI_API_KEY env var) */
|
|
55
|
+
kimiApiKey;
|
|
48
56
|
/**
|
|
49
57
|
* Creates a new ServerConfig instance by loading values from environment variables
|
|
50
58
|
* or using default values.
|
|
@@ -88,6 +96,14 @@ export class ServerConfig {
|
|
|
88
96
|
else {
|
|
89
97
|
throw new Error(`Invalid AGENT_PERMISSION: "${agentPermissionEnv}". Must be one of: ${AGENT_PERMISSIONS.join(', ')}.`);
|
|
90
98
|
}
|
|
99
|
+
const agentModelEnv = process.env['AGENT_MODEL']?.trim();
|
|
100
|
+
this.agentModel = agentModelEnv || undefined;
|
|
101
|
+
const agentEffortEnv = process.env['AGENT_EFFORT']?.trim();
|
|
102
|
+
this.agentEffort = agentEffortEnv || undefined;
|
|
103
|
+
if (this.agentEffort && !supportsAgentEffort(this.agentType)) {
|
|
104
|
+
throw new Error(`AGENT_EFFORT is not supported for AGENT_TYPE="${this.agentType}". ` +
|
|
105
|
+
`Supported types: ${AGENT_EFFORT_SUPPORTED_TYPES.join(', ')}.`);
|
|
106
|
+
}
|
|
91
107
|
const logLevelEnv = process.env['LOG_LEVEL']?.trim();
|
|
92
108
|
if (!logLevelEnv) {
|
|
93
109
|
this.logLevel = 'info';
|
|
@@ -125,13 +141,15 @@ export class ServerConfig {
|
|
|
125
141
|
// - Claude: passed as --settings argument
|
|
126
142
|
// - Cursor: set as CURSOR_CONFIG_DIR environment variable
|
|
127
143
|
// - Codex: set as CODEX_HOME environment variable
|
|
128
|
-
// - Gemini/Grok: not supported (upstream limitation)
|
|
144
|
+
// - Gemini/Grok/OpenCode: not supported (upstream limitation or normal config discovery)
|
|
129
145
|
this.agentsSettingsPath = process.env['AGENTS_SETTINGS_PATH'] || undefined;
|
|
130
146
|
// Cursor API key: prefer CURSOR_API_KEY, fall back to CLI_API_KEY for backward compatibility
|
|
131
147
|
const cursorApiKeyEnv = process.env['CURSOR_API_KEY'] || process.env['CLI_API_KEY'];
|
|
132
148
|
this.cursorApiKey = cursorApiKeyEnv?.trim() ? cursorApiKeyEnv : undefined;
|
|
133
|
-
const
|
|
134
|
-
|
|
149
|
+
const cliApiKeyEnv = process.env['CLI_API_KEY'];
|
|
150
|
+
const cliApiKey = cliApiKeyEnv?.trim() ? cliApiKeyEnv : undefined;
|
|
151
|
+
this.glmApiKey = cliApiKey;
|
|
152
|
+
this.kimiApiKey = cliApiKey;
|
|
135
153
|
}
|
|
136
154
|
}
|
|
137
155
|
//# sourceMappingURL=ServerConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerConfig.js","sourceRoot":"","sources":["../../src/config/ServerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EAGX,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,
|
|
1
|
+
{"version":3,"file":"ServerConfig.js","sourceRoot":"","sources":["../../src/config/ServerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,WAAW,EAGX,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACX,mBAAmB,GACpB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAA;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,YAAY;IACvB,uDAAuD;IACvC,UAAU,CAAQ;IAElC,6CAA6C;IAC7B,aAAa,CAAQ;IAErC,gEAAgE;IAChD,SAAS,CAAQ;IAEjC,yCAAyC;IACzB,SAAS,CAAW;IAEpC,qDAAqD;IACrC,eAAe,CAAiB;IAEhD,yDAAyD;IACzC,UAAU,CAAoB;IAE9C,kEAAkE;IAClD,WAAW,CAAoB;IAE/C,sCAAsC;IACtB,QAAQ,CAAU;IAElC,oEAAoE;IACpD,kBAAkB,CAAQ;IAE1C,8CAA8C;IAC9B,cAAc,CAAS;IAEvC,0CAA0C;IAC1B,UAAU,CAAQ;IAElC,4DAA4D;IAC5C,oBAAoB,CAAQ;IAE5C,8DAA8D;IAC9C,kBAAkB,CAAoB;IAEtD,2FAA2F;IAC3E,YAAY,CAAoB;IAEhD,qEAAqE;IACrD,SAAS,CAAoB;IAE7C,iEAAiE;IACjD,UAAU,CAAoB;IAE9C;;;;OAIG;IACH;QACE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,gBAAgB,CAAA;QAChE,IAAI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C,GAAG,CAAC,aAAa,CAAC,CAAA;QAC/C,MAAM,SAAS,GAAG,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAA;QACjE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;IAC7B,CAAC;CACF"}
|
|
@@ -45,9 +45,11 @@ export interface ExecutionConfig {
|
|
|
45
45
|
* Default: 5 minutes (300000ms)
|
|
46
46
|
*/
|
|
47
47
|
executionTimeout: number;
|
|
48
|
+
/** Maximum combined stdout/stderr bytes retained in memory. */
|
|
49
|
+
maxOutputBytes: number;
|
|
48
50
|
/**
|
|
49
51
|
* Type of agent to use for execution.
|
|
50
|
-
* 'cursor', 'claude', 'gemini', 'codex', 'glm',
|
|
52
|
+
* 'cursor', 'claude', 'gemini', 'codex', 'glm', 'kimi', 'grok', or 'opencode'
|
|
51
53
|
*/
|
|
52
54
|
agentType: AgentType;
|
|
53
55
|
/**
|
|
@@ -78,15 +80,26 @@ export interface ExecutionConfig {
|
|
|
78
80
|
* Passed to the claude binary via ANTHROPIC_AUTH_TOKEN environment variable.
|
|
79
81
|
*/
|
|
80
82
|
glmApiKey?: string;
|
|
83
|
+
/**
|
|
84
|
+
* API key for Kimi authentication.
|
|
85
|
+
* Passed to the claude binary via ANTHROPIC_API_KEY environment variable.
|
|
86
|
+
*/
|
|
87
|
+
kimiApiKey?: string;
|
|
88
|
+
/** Optional model override applied to every execution by this MCP server. */
|
|
89
|
+
model?: string;
|
|
90
|
+
/** Optional backend-specific reasoning effort or model variant. */
|
|
91
|
+
effort?: string;
|
|
81
92
|
}
|
|
82
93
|
export declare const DEFAULT_EXECUTION_TIMEOUT = 300000;
|
|
83
94
|
/**
|
|
84
95
|
* Supported agent runtimes. Single source of truth for both runtime validation
|
|
85
96
|
* (ServerConfig) and static typing.
|
|
86
97
|
*/
|
|
87
|
-
export declare const AGENT_TYPES: readonly ["cursor", "claude", "gemini", "codex", "glm", "grok"];
|
|
98
|
+
export declare const AGENT_TYPES: readonly ["cursor", "claude", "gemini", "codex", "glm", "kimi", "grok", "opencode"];
|
|
88
99
|
export type AgentType = (typeof AGENT_TYPES)[number];
|
|
89
100
|
export declare function isAgentType(value: unknown): value is AgentType;
|
|
101
|
+
export declare const AGENT_EFFORT_SUPPORTED_TYPES: readonly ["codex", "claude", "glm", "kimi", "grok", "opencode"];
|
|
102
|
+
export declare function supportsAgentEffort(agentType: AgentType): agentType is (typeof AGENT_EFFORT_SUPPORTED_TYPES)[number];
|
|
90
103
|
/**
|
|
91
104
|
* Supported permission levels. Single source of truth for both runtime
|
|
92
105
|
* validation (ServerConfig) and static typing.
|
|
@@ -162,14 +175,20 @@ export declare class AgentExecutor {
|
|
|
162
175
|
*/
|
|
163
176
|
private buildSettingsPathEnv;
|
|
164
177
|
private permissionFlags;
|
|
178
|
+
private invocationFlags;
|
|
165
179
|
private formatSystemUserPrompt;
|
|
166
180
|
private buildCodexArgs;
|
|
167
181
|
private buildClaudeArgs;
|
|
168
182
|
private buildGlmArgs;
|
|
183
|
+
private buildKimiArgs;
|
|
184
|
+
private buildRedirectedClaudeArgs;
|
|
169
185
|
private buildGeminiArgs;
|
|
170
186
|
private buildCursorArgs;
|
|
171
187
|
private buildGrokArgs;
|
|
188
|
+
private buildOpenCodeArgs;
|
|
172
189
|
private buildSpawnEnv;
|
|
190
|
+
private prepareSpawnEnvironment;
|
|
191
|
+
private errorCode;
|
|
173
192
|
/**
|
|
174
193
|
* Executes an agent using child_process.spawn for proper TTY handling.
|
|
175
194
|
*
|
|
@@ -178,6 +197,7 @@ export declare class AgentExecutor {
|
|
|
178
197
|
* @returns Promise resolving to execution result
|
|
179
198
|
*/
|
|
180
199
|
private executeWithSpawn;
|
|
200
|
+
private signalNumber;
|
|
181
201
|
/**
|
|
182
202
|
* Generates a unique request ID for tracking execution requests.
|
|
183
203
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentExecutor.d.ts","sourceRoot":"","sources":["../../src/execution/AgentExecutor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentExecutor.d.ts","sourceRoot":"","sources":["../../src/execution/AgentExecutor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,MAAM,EAAiB,MAAM,oBAAoB,CAAA;AAG1D;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAA;IAExB,+DAA+D;IAC/D,cAAc,EAAE,MAAM,CAAA;IAEtB;;;OAGG;IACH,SAAS,EAAE,SAAS,CAAA;IAEpB;;;;;;;OAOG;IACH,UAAU,EAAE,eAAe,CAAA;IAE3B;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,yBAAyB,SAAS,CAAA;AAsB/C;;;GAGG;AACH,eAAO,MAAM,WAAW,qFASd,CAAA;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