super-subagents 1.1.2 → 1.3.4
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/.github/workflows/publish.yml +1 -1
- package/.github/workflows/version-bump.yml +4 -3
- package/CLAUDE.md +164 -32
- package/README.md +194 -78
- package/build/config/timeouts.d.ts +0 -4
- package/build/config/timeouts.d.ts.map +1 -1
- package/build/config/timeouts.js +0 -5
- package/build/config/timeouts.js.map +1 -1
- package/build/index.js +356 -75
- package/build/index.js.map +1 -1
- package/build/services/account-manager.d.ts +88 -0
- package/build/services/account-manager.d.ts.map +1 -0
- package/build/services/account-manager.js +239 -0
- package/build/services/account-manager.js.map +1 -0
- package/build/services/output-file.d.ts +24 -0
- package/build/services/output-file.d.ts.map +1 -0
- package/build/services/output-file.js +90 -0
- package/build/services/output-file.js.map +1 -0
- package/build/services/question-registry.d.ts +75 -0
- package/build/services/question-registry.d.ts.map +1 -0
- package/build/services/question-registry.js +249 -0
- package/build/services/question-registry.js.map +1 -0
- package/build/services/retry-queue.d.ts +22 -11
- package/build/services/retry-queue.d.ts.map +1 -1
- package/build/services/retry-queue.js +106 -16
- package/build/services/retry-queue.js.map +1 -1
- package/build/services/sdk-client-manager.d.ts +120 -0
- package/build/services/sdk-client-manager.d.ts.map +1 -0
- package/build/services/sdk-client-manager.js +372 -0
- package/build/services/sdk-client-manager.js.map +1 -0
- package/build/services/sdk-session-adapter.d.ts +198 -0
- package/build/services/sdk-session-adapter.d.ts.map +1 -0
- package/build/services/sdk-session-adapter.js +912 -0
- package/build/services/sdk-session-adapter.js.map +1 -0
- package/build/services/sdk-spawner.d.ts +42 -0
- package/build/services/sdk-spawner.d.ts.map +1 -0
- package/build/services/sdk-spawner.js +416 -0
- package/build/services/sdk-spawner.js.map +1 -0
- package/build/services/session-hooks.d.ts +30 -0
- package/build/services/session-hooks.d.ts.map +1 -0
- package/build/services/session-hooks.js +137 -0
- package/build/services/session-hooks.js.map +1 -0
- package/build/services/task-manager.d.ts +12 -8
- package/build/services/task-manager.d.ts.map +1 -1
- package/build/services/task-manager.js +90 -98
- package/build/services/task-manager.js.map +1 -1
- package/build/services/task-persistence.d.ts.map +1 -1
- package/build/services/task-persistence.js +2 -1
- package/build/services/task-persistence.js.map +1 -1
- package/build/services/task-status-mapper.d.ts +2 -0
- package/build/services/task-status-mapper.d.ts.map +1 -1
- package/build/services/task-status-mapper.js +128 -15
- package/build/services/task-status-mapper.js.map +1 -1
- package/build/templates/index.d.ts +2 -0
- package/build/templates/index.d.ts.map +1 -1
- package/build/templates/index.js +2 -0
- package/build/templates/index.js.map +1 -1
- package/build/templates/super-arabic.mdx +9 -0
- package/build/templates/super-coder.mdx +519 -0
- package/build/templates/super-planner.mdx +558 -0
- package/build/templates/super-questioner.mdx +14 -0
- package/build/templates/super-researcher.mdx +394 -0
- package/build/templates/super-tester.mdx +688 -0
- package/build/tools/{stream-output.d.ts → answer-question.d.ts} +10 -8
- package/build/tools/answer-question.d.ts.map +1 -0
- package/build/tools/answer-question.js +114 -0
- package/build/tools/answer-question.js.map +1 -0
- package/build/tools/cancel-task.d.ts +26 -0
- package/build/tools/cancel-task.d.ts.map +1 -1
- package/build/tools/cancel-task.js +119 -18
- package/build/tools/cancel-task.js.map +1 -1
- package/build/tools/send-message.d.ts +46 -0
- package/build/tools/send-message.d.ts.map +1 -0
- package/build/tools/send-message.js +145 -0
- package/build/tools/send-message.js.map +1 -0
- package/build/tools/spawn-task.d.ts +1 -1
- package/build/tools/spawn-task.d.ts.map +1 -1
- package/build/tools/spawn-task.js +35 -9
- package/build/tools/spawn-task.js.map +1 -1
- package/build/types.d.ts +181 -6
- package/build/types.d.ts.map +1 -1
- package/build/utils/format.d.ts +0 -10
- package/build/utils/format.d.ts.map +1 -1
- package/build/utils/format.js +0 -47
- package/build/utils/format.js.map +1 -1
- package/build/utils/sanitize.d.ts +0 -33
- package/build/utils/sanitize.d.ts.map +1 -1
- package/build/utils/sanitize.js +0 -13
- package/build/utils/sanitize.js.map +1 -1
- package/docs/ARCHITECTURE.md +582 -0
- package/package.json +3 -4
- package/src/config/timeouts.ts +0 -5
- package/src/copilot-sdk.d.ts +98 -0
- package/src/index.ts +395 -77
- package/src/services/account-manager.ts +302 -0
- package/src/services/output-file.ts +97 -0
- package/src/services/question-registry.ts +336 -0
- package/src/services/retry-queue.ts +121 -16
- package/src/services/sdk-client-manager.ts +453 -0
- package/src/services/sdk-session-adapter.ts +1197 -0
- package/src/services/sdk-spawner.ts +494 -0
- package/src/services/session-hooks.ts +171 -0
- package/src/services/task-manager.ts +102 -93
- package/src/services/task-persistence.ts +2 -1
- package/src/services/task-status-mapper.ts +150 -14
- package/src/templates/index.ts +2 -0
- package/src/templates/super-arabic.mdx +9 -0
- package/src/templates/super-questioner.mdx +14 -0
- package/src/tools/answer-question.ts +140 -0
- package/src/tools/cancel-task.ts +151 -28
- package/src/tools/send-message.ts +178 -0
- package/src/tools/spawn-task.ts +33 -16
- package/src/types.ts +197 -6
- package/src/utils/format.ts +0 -45
- package/src/utils/sanitize.ts +0 -15
- package/tests/mcp-test-comprehensive.ts +490 -0
- package/tests/mcp-test-multitoken.ts +378 -0
- package/tests/mcp-test.ts +177 -0
- package/build/services/copilot-switch.d.ts +0 -36
- package/build/services/copilot-switch.d.ts.map +0 -1
- package/build/services/copilot-switch.js +0 -226
- package/build/services/copilot-switch.js.map +0 -1
- package/build/services/process-spawner.d.ts +0 -9
- package/build/services/process-spawner.d.ts.map +0 -1
- package/build/services/process-spawner.js +0 -503
- package/build/services/process-spawner.js.map +0 -1
- package/build/templates/architect.mdx +0 -162
- package/build/templates/bug-researcher.mdx +0 -430
- package/build/templates/codebase-researcher.mdx +0 -270
- package/build/templates/executor.mdx +0 -584
- package/build/templates/planner.mdx +0 -147
- package/build/templates/researcher.mdx +0 -855
- package/build/templates/turkish.mdx +0 -12
- package/build/tools/batch-spawn.d.ts +0 -70
- package/build/tools/batch-spawn.d.ts.map +0 -1
- package/build/tools/batch-spawn.js +0 -155
- package/build/tools/batch-spawn.js.map +0 -1
- package/build/tools/clear-tasks.d.ts +0 -21
- package/build/tools/clear-tasks.d.ts.map +0 -1
- package/build/tools/clear-tasks.js +0 -43
- package/build/tools/clear-tasks.js.map +0 -1
- package/build/tools/force-start.d.ts +0 -21
- package/build/tools/force-start.d.ts.map +0 -1
- package/build/tools/force-start.js +0 -38
- package/build/tools/force-start.js.map +0 -1
- package/build/tools/get-status.d.ts +0 -31
- package/build/tools/get-status.d.ts.map +0 -1
- package/build/tools/get-status.js +0 -394
- package/build/tools/get-status.js.map +0 -1
- package/build/tools/list-tasks.d.ts +0 -26
- package/build/tools/list-tasks.d.ts.map +0 -1
- package/build/tools/list-tasks.js +0 -74
- package/build/tools/list-tasks.js.map +0 -1
- package/build/tools/recover-task.d.ts +0 -29
- package/build/tools/recover-task.d.ts.map +0 -1
- package/build/tools/recover-task.js +0 -80
- package/build/tools/recover-task.js.map +0 -1
- package/build/tools/resume-task.d.ts +0 -30
- package/build/tools/resume-task.d.ts.map +0 -1
- package/build/tools/resume-task.js +0 -48
- package/build/tools/resume-task.js.map +0 -1
- package/build/tools/retry-task.d.ts +0 -21
- package/build/tools/retry-task.d.ts.map +0 -1
- package/build/tools/retry-task.js +0 -52
- package/build/tools/retry-task.js.map +0 -1
- package/build/tools/simulate-rate-limit.d.ts +0 -25
- package/build/tools/simulate-rate-limit.d.ts.map +0 -1
- package/build/tools/simulate-rate-limit.js +0 -69
- package/build/tools/simulate-rate-limit.js.map +0 -1
- package/build/tools/stream-output.d.ts.map +0 -1
- package/build/tools/stream-output.js +0 -96
- package/build/tools/stream-output.js.map +0 -1
- package/docs/timeout-durability.md +0 -28
- package/src/services/copilot-switch.ts +0 -269
- package/src/services/process-spawner.ts +0 -575
- package/src/tools/batch-spawn.ts +0 -188
- package/src/tools/clear-tasks.ts +0 -52
- package/src/tools/force-start.ts +0 -48
- package/src/tools/get-status.ts +0 -492
- package/src/tools/list-tasks.ts +0 -83
- package/src/tools/recover-task.ts +0 -102
- package/src/tools/resume-task.ts +0 -58
- package/src/tools/retry-task.ts +0 -72
- package/src/tools/simulate-rate-limit.ts +0 -84
- package/src/tools/stream-output.ts +0 -101
|
@@ -27,11 +27,12 @@ jobs:
|
|
|
27
27
|
|
|
28
28
|
- name: Determine bump type
|
|
29
29
|
id: bump
|
|
30
|
+
env:
|
|
31
|
+
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
|
30
32
|
run: |
|
|
31
|
-
|
|
32
|
-
if echo "$MSG" | grep -qiE '^breaking|^major'; then
|
|
33
|
+
if echo "$COMMIT_MSG" | head -1 | grep -qiE '^breaking|^major'; then
|
|
33
34
|
echo "type=major" >> "$GITHUB_OUTPUT"
|
|
34
|
-
elif echo "$
|
|
35
|
+
elif echo "$COMMIT_MSG" | head -1 | grep -qiE '^feat'; then
|
|
35
36
|
echo "type=minor" >> "$GITHUB_OUTPUT"
|
|
36
37
|
else
|
|
37
38
|
echo "type=patch" >> "$GITHUB_OUTPUT"
|
package/CLAUDE.md
CHANGED
|
@@ -5,63 +5,195 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
5
5
|
## Build & Development Commands
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install # Install dependencies
|
|
9
|
-
npm run build # Compile TypeScript to build/
|
|
8
|
+
npm install # Install dependencies (copilot-sdk is a local file dep at ./copilot-sdk/nodejs)
|
|
9
|
+
npm run build # Compile TypeScript to build/ (also need to copy *.mdx: cp src/templates/*.mdx build/templates/)
|
|
10
10
|
npm run dev # Watch mode with tsx (auto-reload)
|
|
11
|
-
npm start # Run compiled server
|
|
11
|
+
npm start # Run compiled server (requires build first)
|
|
12
12
|
npm run clean # Remove build directory
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
**Build note:** `tsc` only compiles `.ts` files. After `npm run build`, you must also run `cp src/templates/*.mdx build/templates/` to copy template files. The `@github/copilot-sdk` is a local dependency (`file:./copilot-sdk/nodejs`). If `copilot-sdk/nodejs/dist/` is missing, build it first: `cd copilot-sdk/nodejs && npm install && npm run build`.
|
|
16
|
+
|
|
17
|
+
**Known type errors:** There are pre-existing `TS2345` errors in `sdk-spawner.ts` (lines 42/51, `task.cwd` is `string | undefined` vs `string`) and some type-only import mismatches against the SDK. These are safe at runtime since type imports are erased. Use `npx tsc --noEmitOnError false` if needed to emit JS despite type errors.
|
|
18
|
+
|
|
15
19
|
## Architecture Overview
|
|
16
20
|
|
|
17
|
-
This is an MCP
|
|
21
|
+
This is an MCP server that manages GitHub Copilot agents as autonomous SDK sessions. It provides task orchestration, multi-account PAT rotation for rate limit recovery, dependency chains, and session lifecycle management over the MCP protocol.
|
|
22
|
+
|
|
23
|
+
The server exposes 4 MCP tools, MCP resources for task state, and MCP task lifecycle endpoints. Clients (Claude Code, VS Code, etc.) interact exclusively through the MCP protocol over stdio.
|
|
24
|
+
|
|
25
|
+
### Directory Structure
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
src/
|
|
29
|
+
├── index.ts # MCP server setup, tool/resource/task handlers, lifecycle wiring (649 lines)
|
|
30
|
+
├── types.ts # All shared types: TaskState, TaskStatus, SpawnOptions, SessionMetrics, etc. (284 lines)
|
|
31
|
+
├── models.ts # Model registry (sonnet/opus/haiku), ENABLE_OPUS gating (24 lines)
|
|
32
|
+
├── config/
|
|
33
|
+
│ └── timeouts.ts # Timeout constants with env var overrides (17 lines)
|
|
34
|
+
├── services/
|
|
35
|
+
│ ├── sdk-spawner.ts # Top-level task spawning, error classification, rate limit handling (494 lines)
|
|
36
|
+
│ ├── sdk-client-manager.ts # CopilotClient pool per workspace+token, session create/resume/destroy (408 lines)
|
|
37
|
+
│ ├── sdk-session-adapter.ts # Binds SDK sessions to tasks, handles events, rotation, metrics (1,104 lines)
|
|
38
|
+
│ ├── session-hooks.ts # SDK SessionHooks for lifecycle (start/end/error/tool) logging (171 lines)
|
|
39
|
+
│ ├── task-manager.ts # Central state machine: lifecycle, dependencies, persistence, cleanup (830 lines)
|
|
40
|
+
│ ├── task-persistence.ts # Atomic JSON persistence to ~/.super-agents/{hash}.json (176 lines)
|
|
41
|
+
│ ├── task-status-mapper.ts # Maps 8-state internal model → MCP 4-state model + status messages (288 lines)
|
|
42
|
+
│ ├── account-manager.ts # Multi-account PAT rotation (round-robin, cooldown, failover) (302 lines)
|
|
43
|
+
│ ├── question-registry.ts # SDK ask_user → MCP bridge: stores pending questions, resolves answers (336 lines)
|
|
44
|
+
│ ├── retry-queue.ts # Exponential backoff for rate-limited tasks (5m → 2h) (232 lines)
|
|
45
|
+
│ ├── progress-registry.ts # Throttled MCP progress notifications per task (123 lines)
|
|
46
|
+
│ ├── subscription-registry.ts # MCP resource subscription tracking (task:/// URIs) (33 lines)
|
|
47
|
+
│ ├── client-context.ts # Stores client workspace roots from MCP initialization (49 lines)
|
|
48
|
+
│ └── output-file.ts # Live output files at {cwd}/.super-agents/{taskId}.output (97 lines)
|
|
49
|
+
├── tools/
|
|
50
|
+
│ ├── spawn-task.ts # spawn_task: create new agent tasks with template+model selection (159 lines)
|
|
51
|
+
│ ├── cancel-task.ts # cancel_task: cancel one or all tasks (supports "all" keyword) (181 lines)
|
|
52
|
+
│ ├── send-message.ts # send_message: send follow-up messages to existing sessions (178 lines)
|
|
53
|
+
│ └── answer-question.ts # answer_question: respond to SDK ask_user questions (140 lines)
|
|
54
|
+
├── templates/
|
|
55
|
+
│ ├── index.ts # Template registry and {{user_prompt}} substitution (37 lines)
|
|
56
|
+
│ ├── super-coder.mdx # Coding: "think 10 times, write once" — search→think→plan→implement→verify (518 lines)
|
|
57
|
+
│ ├── super-planner.mdx # Planning: evidence-based design with codebase exploration mandate (557 lines)
|
|
58
|
+
│ ├── super-researcher.mdx # Research: multi-angle investigation with source authority ranking (393 lines)
|
|
59
|
+
│ ├── super-tester.mdx # Testing: "test like a user, not a developer" — E2E > integration > unit (687 lines)
|
|
60
|
+
│ ├── super-questioner.mdx # Forces ask_user before proceeding (13 lines)
|
|
61
|
+
│ └── super-arabic.mdx # Arabic-language agent (8 lines)
|
|
62
|
+
└── utils/
|
|
63
|
+
├── sanitize.ts # Zod schemas for tool input validation (20 lines)
|
|
64
|
+
├── format.ts # MCP response formatting: mcpText, formatError, formatTable (38 lines)
|
|
65
|
+
└── task-id-generator.ts # Human-readable IDs: brave-tiger-42 (25 lines)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Request Flow (spawn_task)
|
|
69
|
+
|
|
70
|
+
1. `spawn-task.ts:85` validates input via Zod, applies template from `templates/index.ts:25`
|
|
71
|
+
2. `sdk-spawner.ts:67` creates `TaskState` via `taskManager.createTask()`, then calls `runSDKSession()` via `setImmediate`
|
|
72
|
+
3. `sdk-client-manager.ts` gets/creates a `CopilotClient` for the workspace+token, creates a `CopilotSession` with hooks
|
|
73
|
+
4. `sdk-session-adapter.ts` binds the session to the task, subscribing to all SDK `SessionEvent`s
|
|
74
|
+
5. `session.sendAndWait({ prompt }, timeout)` runs the prompt; adapter handles events (output, errors, tool calls, usage, subagents)
|
|
75
|
+
6. On completion/error, `task-manager.ts` transitions state via `updateTask()` and triggers side effects
|
|
18
76
|
|
|
19
|
-
###
|
|
77
|
+
### Key Architectural Patterns
|
|
20
78
|
|
|
21
|
-
**
|
|
79
|
+
**Singleton services:** Most services export a singleton instance (`taskManager`, `sdkClientManager`, `sdkSessionAdapter`, `accountManager`, `questionRegistry`, `progressRegistry`, `subscriptionRegistry`, `clientContext`). Import them directly; don't instantiate.
|
|
80
|
+
|
|
81
|
+
**Session binding:** `sdk-session-adapter.ts` maintains a `SessionBinding` per task that subscribes to SDK `SessionEvent`s. On rotation, it unbinds the old session and rebinds a new one. The binding tracks rotation attempts, timeout state, and whether rotation is in progress.
|
|
82
|
+
|
|
83
|
+
**TERMINAL_STATUSES:** Exported from `task-manager.ts` as a `Set` containing `COMPLETED`, `FAILED`, `CANCELLED`, `TIMED_OUT`. `RATE_LIMITED` is intentionally NOT terminal — the retry system can still update these tasks. Always import from `task-manager.ts`; don't define locally.
|
|
84
|
+
|
|
85
|
+
**State transitions via updateTask():** Always use `taskManager.updateTask()` to change task state — never mutate `task.status` directly. `updateTask()` triggers: output file finalization, persistence scheduling, dependency resolution (`processWaitingTasks`), status change callbacks.
|
|
86
|
+
|
|
87
|
+
**Tool metrics tracking:** Handled exclusively by `sdk-session-adapter.ts` using `toolCallId`-based matching. `session-hooks.ts` only logs tool events; it does NOT track metrics (avoids duplicate writes to `task.sessionMetrics.toolMetrics`).
|
|
88
|
+
|
|
89
|
+
**Terminal state guards:** Both `sdk-session-adapter.ts` and `sdk-spawner.ts` check `isTerminalStatus()` before updating task state. This prevents race conditions where the adapter handles an error event and the spawner's `sendAndWait` also throws.
|
|
90
|
+
|
|
91
|
+
### Task Lifecycle
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
PENDING → RUNNING → COMPLETED
|
|
95
|
+
→ FAILED
|
|
96
|
+
→ CANCELLED (via cancel_task)
|
|
97
|
+
→ TIMED_OUT (hard timeout or stall)
|
|
98
|
+
→ RATE_LIMITED → (retry) → PENDING → ...
|
|
99
|
+
PENDING → WAITING (has unmet dependencies) → PENDING → RUNNING → ...
|
|
100
|
+
```
|
|
22
101
|
|
|
23
|
-
|
|
24
|
-
- Task lifecycle (pending → waiting → running → completed/failed/cancelled/rate_limited/timed_out)
|
|
25
|
-
- Dependency resolution via `areDependenciesSatisfied()` and `processWaitingTasks()`
|
|
26
|
-
- Persistence scheduling with debouncing
|
|
27
|
-
- Auto-cleanup of expired tasks (1 hour TTL)
|
|
102
|
+
### Multi-Account Rotation
|
|
28
103
|
|
|
29
|
-
|
|
104
|
+
When a rate limit (429) or server error (5xx) occurs:
|
|
30
105
|
|
|
31
|
-
**
|
|
106
|
+
1. **Mid-session (adapter):** `sdk-session-adapter.ts` detects error event → calls `attemptRotationAndResume()` → rotates token via `accountManager` → health-checks new account → resumes session with `session.sendAndWait({ prompt: 'continue' })`
|
|
107
|
+
2. **Post-session (spawner):** `sdk-spawner.ts:278` catches `sendAndWait` exception → extracts status code → tries `rotateOnError()` → retries with new session
|
|
108
|
+
3. **All exhausted:** Falls back to exponential backoff via `retry-queue.ts` (5m → 10m → 20m → 40m → 1h → 2h, max 6 retries)
|
|
32
109
|
|
|
33
|
-
|
|
110
|
+
Tokens configured via env vars. Failed tokens enter 60s cooldown before reuse.
|
|
34
111
|
|
|
35
|
-
###
|
|
112
|
+
### SDK Question/Answer Flow
|
|
36
113
|
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
114
|
+
When the Copilot agent calls `ask_user`:
|
|
115
|
+
1. `sdk-client-manager.ts` `onUserInputRequest` handler fires
|
|
116
|
+
2. `question-registry.ts` stores the question, updates `task.pendingQuestion`, returns a Promise
|
|
117
|
+
3. MCP client sees pending question via resource `task:///{id}` or MCP notification
|
|
118
|
+
4. Client calls `answer_question` tool → registry resolves Promise → SDK resumes
|
|
40
119
|
|
|
41
|
-
|
|
120
|
+
Questions time out after 30 minutes.
|
|
42
121
|
|
|
43
|
-
|
|
122
|
+
### SDK Interface Notes
|
|
44
123
|
|
|
45
|
-
|
|
124
|
+
The `@github/copilot-sdk` (local at `./copilot-sdk/nodejs`) exports:
|
|
125
|
+
- **Values (runtime):** `CopilotClient`, `CopilotSession`, `defineTool`
|
|
126
|
+
- **Types (erased):** `SessionHooks`, `SessionConfig`, `SessionEvent`, `MessageOptions`, `UserInputRequest`, `UserInputResponse`, and all hook input/output types
|
|
46
127
|
|
|
47
|
-
|
|
48
|
-
- `
|
|
49
|
-
- `
|
|
128
|
+
Key SDK method signatures:
|
|
129
|
+
- `session.sendAndWait(options: MessageOptions, timeout?: number)` — `MessageOptions` requires `{ prompt: string }`, NOT a plain string
|
|
130
|
+
- `session.abort()` — Cancels session
|
|
131
|
+
- `session.destroy()` — Tears down session completely
|
|
132
|
+
- `SessionHooks` uses single handler functions (`onSessionStart`, `onSessionEnd`, `onErrorOccurred`, `onPreToolUse`, `onPostToolUse`), NOT arrays
|
|
133
|
+
- `PreToolUseHookOutput` uses `permissionDecision: 'allow' | 'deny'`, NOT `decision`
|
|
134
|
+
- `PostToolUseHookInput.toolResult.resultType` is `'success' | 'failure'` (camelCase, lowercase)
|
|
135
|
+
- `UsageMetricsTracker` is NOT exported by the SDK — do not try to import it as a value
|
|
50
136
|
|
|
51
|
-
|
|
137
|
+
## Key Types
|
|
52
138
|
|
|
53
|
-
|
|
139
|
+
- `TaskStatus` enum (8 states): `pending`, `waiting`, `running`, `completed`, `failed`, `cancelled`, `rate_limited`, `timed_out`
|
|
140
|
+
- `TaskState`: Full task state including `session`, `sessionMetrics`, `failureContext`, `pendingQuestion`, `outputFilePath`
|
|
141
|
+
- `SpawnOptions`: Input for `spawnCopilotTask()` — prompt, model, cwd, timeout, dependsOn, labels, etc.
|
|
142
|
+
- `SessionMetrics`: Aggregated metrics per session — quotas, tool metrics, subagents, turn count, token usage
|
|
143
|
+
- `FailureContext`: Structured error from SDK — errorType, statusCode, errorContext, recoverable flag
|
|
144
|
+
- `PendingQuestion`: Question from ask_user — question text, choices, allowFreeform, sessionId
|
|
145
|
+
- `ToolContext`: MCP request context with `progressToken` and `sendNotification`
|
|
54
146
|
|
|
55
147
|
## Environment Variables
|
|
56
148
|
|
|
57
149
|
| Variable | Default | Purpose |
|
|
58
150
|
|----------|---------|---------|
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
151
|
+
| `GITHUB_PAT_TOKENS` | — | Comma-separated PAT tokens for multi-account rotation |
|
|
152
|
+
| `GITHUB_PAT_TOKEN_1`..`_N` | — | Numbered PAT tokens (alternative to comma-separated) |
|
|
153
|
+
| `GH_PAT_TOKEN` | — | Fallback PAT token(s), comma-separated |
|
|
154
|
+
| `GITHUB_TOKEN` / `GH_TOKEN` | — | Single token fallback |
|
|
155
|
+
| `ENABLE_OPUS` | `false` | Allow claude-opus-4.5 model (cost control) |
|
|
156
|
+
| `MCP_TASK_TIMEOUT_MS` | `1800000` (30m) | Default task timeout |
|
|
157
|
+
| `MCP_TASK_TIMEOUT_MIN_MS` | `1000` | Minimum allowed timeout |
|
|
158
|
+
| `MCP_TASK_TIMEOUT_MAX_MS` | `3600000` (1h) | Maximum allowed timeout |
|
|
159
|
+
| `MCP_TASK_STALL_WARN_MS` | `300000` (5m) | Stall warning threshold |
|
|
160
|
+
|
|
161
|
+
## MCP Resources
|
|
162
|
+
|
|
163
|
+
Tasks are exposed as MCP resources with URI scheme `task:///`:
|
|
164
|
+
- `system:///status` — Account stats, task counts, SDK info
|
|
165
|
+
- `task:///all` — List all tasks with status, progress, pending questions
|
|
166
|
+
- `task:///{taskId}` — Full task details, output, metrics
|
|
167
|
+
- `task:///{taskId}/session` — Execution log with tool calls
|
|
168
|
+
|
|
169
|
+
Clients can subscribe to resource URIs for real-time change notifications (debounced to max 1/sec per task).
|
|
62
170
|
|
|
63
171
|
## Adding New Tools
|
|
64
172
|
|
|
65
|
-
1. Create `src/tools/new-tool.ts` with
|
|
66
|
-
|
|
67
|
-
|
|
173
|
+
1. Create `src/tools/new-tool.ts` with:
|
|
174
|
+
- A Zod schema for input validation
|
|
175
|
+
- A tool definition object (`{ name, description, inputSchema }`)
|
|
176
|
+
- A handler function `handleNewTool(args, context)`
|
|
177
|
+
2. Import and add to `tools` array and switch statement in `src/index.ts:166`
|
|
178
|
+
|
|
179
|
+
## Adding New Templates
|
|
180
|
+
|
|
181
|
+
1. Create `src/templates/super-newtype.mdx` with `{{user_prompt}}` placeholder
|
|
182
|
+
2. Add entry to `TASK_TYPES` in `src/templates/index.ts:7`
|
|
183
|
+
3. Rebuild (`npm run build && cp src/templates/*.mdx build/templates/`)
|
|
184
|
+
|
|
185
|
+
## Common Pitfalls
|
|
186
|
+
|
|
187
|
+
- **Never mutate task state directly.** Always go through `taskManager.updateTask()`. Direct mutation skips persistence, output finalization, and dependency processing.
|
|
188
|
+
- **TERMINAL_STATUSES is a Set, not an array.** Use `.has()`, not `.includes()`. Import it from `task-manager.ts`.
|
|
189
|
+
- **RATE_LIMITED is not terminal.** The retry system needs to update these tasks. Don't treat it as a final state.
|
|
190
|
+
- **Session cleanup on state transitions.** When a task leaves RUNNING (to RATE_LIMITED, FAILED, etc.), set `session: undefined` in the update. `updateTask()` handles this for terminal statuses and RATE_LIMITED.
|
|
191
|
+
- **Check terminal state before updating.** Both `sdk-session-adapter.ts` and `sdk-spawner.ts` must check `isTerminalStatus()` before writing — otherwise one overwrites the other's state transition.
|
|
192
|
+
- **Rotation attempts must be incremented.** Both reactive (error-triggered) and proactive (low-quota) rotation paths must increment `binding.rotationAttempts` to respect `maxRotationAttempts`.
|
|
193
|
+
- **Health check sessions must be cleaned up.** `sdk-session-adapter.ts` creates temporary sessions for health checks — destroy via `sdkClientManager.destroySession()`.
|
|
194
|
+
- **`handleEvent` in sdk-session-adapter is async.** Event listener callbacks must handle the returned promise with `.catch()`.
|
|
195
|
+
- **Tool metrics tracked by sdk-session-adapter only.** Uses `toolCallId`-based matching for accuracy. Don't add metrics tracking to `session-hooks.ts`.
|
|
196
|
+
- **`sendAndWait` takes `MessageOptions`, not a string.** Use `session.sendAndWait({ prompt: 'text' })`, never `session.sendAndWait('text')`.
|
|
197
|
+
- **`SessionHooks` uses single handlers.** Use `onPreToolUse: async (input) => { ... }`, not `preToolUse: [async (input) => { ... }]`.
|
|
198
|
+
- **Copy MDX files after build.** `tsc` doesn't copy `.mdx` files. Run `cp src/templates/*.mdx build/templates/` after each build.
|
|
199
|
+
- **Resumed sessions must be tracked.** When calling `sdkClientManager.resumeSession()`, the session is added to `entry.sessions` Map so it can be found for abort/destroy.
|
package/README.md
CHANGED
|
@@ -1,129 +1,245 @@
|
|
|
1
|
-
# Super
|
|
1
|
+
# Super Subagents
|
|
2
2
|
|
|
3
|
-
MCP
|
|
3
|
+
Run multiple AI agents in parallel from a single MCP client. Spawn autonomous GitHub Copilot sessions as background tasks — each one gets its own workspace, tools, and execution context. Your main session stays unblocked while agents code, plan, research, and test simultaneously.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Why
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
AI coding assistants work one task at a time. You ask it to refactor a module, and you wait. Then you ask it to write tests, and you wait again. Then you ask it to update the docs.
|
|
8
|
+
|
|
9
|
+
Super Subagents changes this. From your MCP client (Claude Code, VS Code, etc.), you spawn tasks that run as independent Copilot SDK sessions in the background:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
You (main session): "Spawn three tasks: refactor auth, write API tests, update the migration guide"
|
|
13
|
+
|
|
14
|
+
→ brave-tiger-42: Refactoring auth module... [running]
|
|
15
|
+
→ calm-falcon-17: Writing API integration tests... [running]
|
|
16
|
+
→ swift-panda-88: Updating migration guide... [running]
|
|
17
|
+
|
|
18
|
+
You: Continue working on other things — or spawn more tasks.
|
|
10
19
|
```
|
|
11
20
|
|
|
12
|
-
|
|
21
|
+
Each agent runs with full tool access (file read/write, terminal, search) in its own isolated session. When it finishes, you get notified. If it hits a rate limit, it rotates to another GitHub account automatically.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
**Option 1: Auto-install**
|
|
13
26
|
```bash
|
|
14
|
-
|
|
27
|
+
npx @automcp/cli install super-subagents --client claude-desktop
|
|
15
28
|
```
|
|
16
29
|
|
|
30
|
+
**Option 2: Manual config**
|
|
31
|
+
|
|
32
|
+
Add to your MCP client config (e.g., `~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
33
|
+
|
|
17
34
|
```json
|
|
18
35
|
{
|
|
19
36
|
"mcpServers": {
|
|
20
37
|
"super-agents": {
|
|
21
|
-
"command": "
|
|
22
|
-
"args": ["
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "super-subagents"],
|
|
40
|
+
"env": {
|
|
41
|
+
"GITHUB_PAT_TOKENS": "ghp_token1,ghp_token2"
|
|
42
|
+
}
|
|
23
43
|
}
|
|
24
44
|
}
|
|
25
45
|
}
|
|
26
46
|
```
|
|
27
47
|
|
|
48
|
+
No build step required — `npx` runs the package directly.
|
|
49
|
+
|
|
50
|
+
## How It Works
|
|
51
|
+
|
|
52
|
+
Super Subagents is an MCP server. Your MCP client connects to it over stdio and gets 4 tools and a set of resources for monitoring.
|
|
53
|
+
|
|
54
|
+
**Spawning a task** creates an autonomous Copilot SDK session that runs in the background. The session has full access to the filesystem, terminal, and all tools the Copilot agent normally has. Your prompt is the agent's only context — it can't see your conversation history.
|
|
55
|
+
|
|
56
|
+
**Monitoring** happens via MCP resources (not polling). Subscribe to `task:///{id}` for real-time updates, or read `task:///all` to see everything at once. Each task also writes a live output file you can `tail -f`.
|
|
57
|
+
|
|
58
|
+
**Rate limits** are handled automatically. With multiple PAT tokens configured, the server rotates to the next account when one gets rate-limited. If all accounts are exhausted, tasks enter exponential backoff and retry automatically.
|
|
59
|
+
|
|
28
60
|
## Tools
|
|
29
61
|
|
|
30
|
-
| Tool |
|
|
62
|
+
| Tool | What it does |
|
|
31
63
|
|------|-------------|
|
|
32
|
-
| `spawn_task` | Create a task. Returns `task_id
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
|
42
|
-
|
|
64
|
+
| `spawn_task` | Create a new autonomous agent task. Returns a `task_id`. |
|
|
65
|
+
| `send_message` | Send a follow-up message to a completed/failed task's session. |
|
|
66
|
+
| `cancel_task` | Cancel one task, multiple tasks, or all tasks. |
|
|
67
|
+
| `answer_question` | Respond when an agent asks a question via `ask_user`. |
|
|
68
|
+
|
|
69
|
+
## Resources
|
|
70
|
+
|
|
71
|
+
All status and monitoring is done through MCP resources:
|
|
72
|
+
|
|
73
|
+
| Resource URI | Content |
|
|
74
|
+
|-------------|---------|
|
|
75
|
+
| `system:///status` | Account stats, task counts, SDK health |
|
|
76
|
+
| `task:///all` | All tasks with status, progress, pending questions |
|
|
77
|
+
| `task:///{id}` | Full task details: output, metrics, config |
|
|
78
|
+
| `task:///{id}/session` | Execution log: turns, tool calls, durations |
|
|
43
79
|
|
|
44
|
-
##
|
|
80
|
+
## Agent Templates
|
|
45
81
|
|
|
46
|
-
|
|
82
|
+
Templates wrap your prompt with specialized system instructions. The agent sees the template + your prompt, not your conversation.
|
|
47
83
|
|
|
48
|
-
|
|
84
|
+
| Template | Personality | Best for |
|
|
85
|
+
|----------|------------|----------|
|
|
86
|
+
| `super-coder` | "Think 10 times, write once." Searches the codebase before touching anything. Verifies after every change. | Implementation, bug fixes, refactoring |
|
|
87
|
+
| `super-planner` | "Plan with evidence, not assumptions." Explores the codebase first, then designs atomic tasks with dependency graphs. | Architecture, design docs, task breakdown |
|
|
88
|
+
| `super-researcher` | "Find truth, not confirmation." Multi-angle investigation with source authority ranking. | Codebase exploration, technical questions |
|
|
89
|
+
| `super-tester` | "Test like a user, not a developer." E2E first, then integration, then unit. Collects evidence. | QA, test writing, verification |
|
|
90
|
+
| `super-questioner` | Always asks a clarifying question before starting work. | Tasks with ambiguous requirements |
|
|
91
|
+
| `super-arabic` | Responds entirely in Arabic. | Arabic-language tasks |
|
|
49
92
|
|
|
50
|
-
### Dependencies
|
|
51
93
|
```json
|
|
52
|
-
{ "prompt": "
|
|
94
|
+
{ "prompt": "Fix the null check in auth.ts line 45", "task_type": "super-coder" }
|
|
53
95
|
```
|
|
54
|
-
Task waits until all dependencies complete. Use `force_start` to bypass.
|
|
55
96
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
97
|
+
Without a `task_type`, the agent gets your raw prompt with no system instructions.
|
|
98
|
+
|
|
99
|
+
## Models
|
|
100
|
+
|
|
101
|
+
| Model | When to use |
|
|
102
|
+
|-------|------------|
|
|
103
|
+
| `claude-sonnet-4.5` | Default. Best balance of speed and capability. |
|
|
104
|
+
| `claude-haiku-4.5` | Simple tasks, quick iterations. |
|
|
105
|
+
| `claude-opus-4.5` | Complex reasoning, large refactors. Requires `ENABLE_OPUS=true`. |
|
|
106
|
+
|
|
107
|
+
## Multi-Account Rotation
|
|
108
|
+
|
|
109
|
+
Configure multiple GitHub PAT tokens. When one account hits a rate limit (429) or server error (5xx), the server rotates to the next automatically — mid-session, without losing progress.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Comma-separated (recommended)
|
|
113
|
+
GITHUB_PAT_TOKENS=ghp_token1,ghp_token2,ghp_token3
|
|
114
|
+
|
|
115
|
+
# Or numbered
|
|
116
|
+
GITHUB_PAT_TOKEN_1=ghp_token1
|
|
117
|
+
GITHUB_PAT_TOKEN_2=ghp_token2
|
|
118
|
+
|
|
119
|
+
# Or single token
|
|
120
|
+
GITHUB_TOKEN=ghp_token
|
|
59
121
|
```
|
|
60
|
-
Filter with `list_tasks({ "label": "backend" })`.
|
|
61
122
|
|
|
62
|
-
|
|
123
|
+
Failed tokens enter a 60-second cooldown before reuse. If all tokens are exhausted, tasks enter exponential backoff (5m, 10m, 20m, 40m, 1h, 2h — max 6 retries).
|
|
124
|
+
|
|
125
|
+
## Task Dependencies
|
|
126
|
+
|
|
127
|
+
Tasks can wait for other tasks:
|
|
128
|
+
|
|
63
129
|
```json
|
|
64
130
|
{
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
{ "id": "test", "prompt": "Run tests", "depends_on": ["build"] },
|
|
68
|
-
{ "id": "deploy", "prompt": "Deploy", "depends_on": ["test"] }
|
|
69
|
-
]
|
|
131
|
+
"prompt": "Deploy the service",
|
|
132
|
+
"depends_on": ["build-task-id", "test-task-id"]
|
|
70
133
|
}
|
|
71
134
|
```
|
|
72
|
-
Local `id` fields map to real `task_id` in response.
|
|
73
135
|
|
|
74
|
-
|
|
136
|
+
The task stays in `waiting` status until all dependencies complete, then auto-starts. Circular dependencies are detected and rejected.
|
|
137
|
+
|
|
138
|
+
## Question Handling
|
|
139
|
+
|
|
140
|
+
When a Copilot agent calls `ask_user`, the task pauses and surfaces the question through MCP notifications and resources.
|
|
75
141
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
| `super-planner` | Architecture, design decisions |
|
|
80
|
-
| `super-researcher` | Codebase exploration, investigation |
|
|
81
|
-
| `super-tester` | Writing tests, QA verification |
|
|
142
|
+
```json
|
|
143
|
+
// Answer by choice number (1-indexed)
|
|
144
|
+
{ "task_id": "brave-tiger-42", "answer": "2" }
|
|
82
145
|
|
|
83
|
-
|
|
84
|
-
|
|
146
|
+
// Or free-form text
|
|
147
|
+
{ "task_id": "brave-tiger-42", "answer": "CUSTOM: Use TypeScript instead" }
|
|
148
|
+
```
|
|
85
149
|
|
|
86
|
-
|
|
87
|
-
Default: 30 min (1800000ms). Max: 1 hour. Tasks exceeding timeout get `timed_out` status.
|
|
88
|
-
Configurable via `MCP_TASK_TIMEOUT_MS`, `MCP_TASK_TIMEOUT_MIN_MS`, and `MCP_TASK_TIMEOUT_MAX_MS`. Prefer the default unless you have a clear reason to override.
|
|
89
|
-
Stall warnings are based on `MCP_TASK_STALL_WARN_MS`. Timed out tasks may include a reason and can be recovered via `recover_task` or `resume_task` when a session is available.
|
|
150
|
+
Pending questions appear in `task:///all` and on the individual task resource. Questions time out after 30 minutes.
|
|
90
151
|
|
|
91
|
-
|
|
92
|
-
Rate-limited tasks auto-retry with exponential backoff (5m → 10m → 20m → 40m → 1h → 2h). Max 6 retries.
|
|
152
|
+
## Session Continuation
|
|
93
153
|
|
|
94
|
-
|
|
95
|
-
Tasks persist to `~/.super-agents/{md5(cwd)}.json`. Survives server restarts.
|
|
154
|
+
Send follow-up messages to completed or failed tasks:
|
|
96
155
|
|
|
97
|
-
### Output Streaming (Experimental)
|
|
98
|
-
Requires `ENABLE_STREAMING=true`. Disabled by default.
|
|
99
156
|
```json
|
|
100
|
-
//
|
|
101
|
-
{ "task_id": "brave-tiger-42"
|
|
102
|
-
// Response: { "lines": [...], "next_offset": 50, "has_more": true }
|
|
157
|
+
// Default: "continue"
|
|
158
|
+
{ "task_id": "brave-tiger-42" }
|
|
103
159
|
|
|
104
|
-
//
|
|
105
|
-
{ "task_id": "brave-tiger-42", "
|
|
160
|
+
// With a specific message
|
|
161
|
+
{ "task_id": "brave-tiger-42", "message": "Now add unit tests for the changes you made" }
|
|
106
162
|
```
|
|
107
|
-
Use `next_offset` from response to get new lines without re-fetching.
|
|
108
163
|
|
|
109
|
-
|
|
110
|
-
|
|
164
|
+
This creates a new task that resumes the same Copilot session, so the agent retains full context of what it did.
|
|
165
|
+
|
|
166
|
+
## Live Output Files
|
|
167
|
+
|
|
168
|
+
Every task writes a live output file at `{cwd}/.super-agents/{task-id}.output`:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
tail -f .super-agents/brave-tiger-42.output # Follow live
|
|
172
|
+
tail -20 .super-agents/brave-tiger-42.output # Last 20 lines
|
|
173
|
+
cat .super-agents/brave-tiger-42.output # Full output
|
|
174
|
+
```
|
|
111
175
|
|
|
112
|
-
|
|
176
|
+
Output files include a header (task ID, start time, working directory), all tool calls with durations, reasoning traces, usage metrics, and a footer (completion time, final status).
|
|
177
|
+
|
|
178
|
+
## Task Lifecycle
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
pending → running → completed
|
|
182
|
+
→ failed
|
|
183
|
+
→ cancelled
|
|
184
|
+
→ timed_out
|
|
185
|
+
→ rate_limited → (auto-retry) → pending → running → ...
|
|
186
|
+
|
|
187
|
+
pending → waiting (dependencies) → pending → running → ...
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Eight internal states map to four MCP states (`working`, `completed`, `failed`, `cancelled`) for clients that use MCP task primitives.
|
|
191
|
+
|
|
192
|
+
## Persistence
|
|
193
|
+
|
|
194
|
+
Tasks persist to `~/.super-agents/{md5(cwd)}.json`. Survives server restarts. Rate-limited tasks auto-retry on reconnect. Output files persist in `{cwd}/.super-agents/` for post-hoc review.
|
|
195
|
+
|
|
196
|
+
## Environment Variables
|
|
113
197
|
|
|
114
198
|
| Variable | Default | Description |
|
|
115
199
|
|----------|---------|-------------|
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
200
|
+
| `GITHUB_PAT_TOKENS` | — | Comma-separated PAT tokens for multi-account rotation |
|
|
201
|
+
| `GITHUB_PAT_TOKEN_1`..`_N` | — | Numbered PAT tokens |
|
|
202
|
+
| `GH_PAT_TOKEN` | — | Fallback PAT token(s), comma-separated |
|
|
203
|
+
| `GITHUB_TOKEN` / `GH_TOKEN` | — | Single token fallback |
|
|
204
|
+
| `ENABLE_OPUS` | `false` | Allow claude-opus-4.5 model |
|
|
205
|
+
| `MCP_TASK_TIMEOUT_MS` | `1800000` | Default task timeout (30 min) |
|
|
206
|
+
| `MCP_TASK_TIMEOUT_MAX_MS` | `3600000` | Maximum allowed timeout (1 hour) |
|
|
207
|
+
| `MCP_TASK_STALL_WARN_MS` | `300000` | No-output warning threshold (5 min) |
|
|
208
|
+
|
|
209
|
+
## Example: Parallel Feature Development
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
1. spawn_task({
|
|
213
|
+
prompt: "Implement the /api/users endpoint. Read the OpenAPI spec at /docs/api.yaml for the schema...",
|
|
214
|
+
task_type: "super-coder",
|
|
215
|
+
labels: ["backend", "users-feature"]
|
|
216
|
+
})
|
|
217
|
+
→ Task: brave-tiger-42
|
|
218
|
+
|
|
219
|
+
2. spawn_task({
|
|
220
|
+
prompt: "Write E2E tests for the /api/users endpoint using the test patterns in /tests/...",
|
|
221
|
+
task_type: "super-tester",
|
|
222
|
+
depends_on: ["brave-tiger-42"],
|
|
223
|
+
labels: ["testing", "users-feature"]
|
|
224
|
+
})
|
|
225
|
+
→ Task: calm-falcon-17 (waiting for brave-tiger-42)
|
|
226
|
+
|
|
227
|
+
3. spawn_task({
|
|
228
|
+
prompt: "Research best practices for user data pagination. Compare cursor vs offset...",
|
|
229
|
+
task_type: "super-researcher",
|
|
230
|
+
labels: ["research", "users-feature"]
|
|
231
|
+
})
|
|
232
|
+
→ Task: swift-panda-88 (starts immediately, runs in parallel with brave-tiger-42)
|
|
233
|
+
|
|
234
|
+
4. Continue your own work. MCP notifications arrive as tasks complete.
|
|
235
|
+
|
|
236
|
+
5. brave-tiger-42 completes → calm-falcon-17 auto-starts (dependencies satisfied)
|
|
237
|
+
|
|
238
|
+
6. Review results:
|
|
239
|
+
- Read resource: task:///all
|
|
240
|
+
- tail -20 .super-agents/brave-tiger-42.output
|
|
241
|
+
- send_message({ task_id: "brave-tiger-42", message: "Add input validation" })
|
|
242
|
+
```
|
|
127
243
|
|
|
128
244
|
## License
|
|
129
245
|
|
|
@@ -5,8 +5,4 @@ export declare const TASK_TIMEOUT_MIN_MS: number;
|
|
|
5
5
|
export declare const TASK_TIMEOUT_MAX_MS: number;
|
|
6
6
|
export declare const TASK_TIMEOUT_DEFAULT_MS: number;
|
|
7
7
|
export declare const TASK_STALL_WARN_MS: number;
|
|
8
|
-
export declare const COPILOT_SWITCH_COMMAND_TIMEOUT_MS: number;
|
|
9
|
-
export declare const COPILOT_SWITCH_LOCK_STALE_MS: number;
|
|
10
|
-
export declare const COPILOT_SWITCH_LOCK_TIMEOUT_MS: number;
|
|
11
|
-
export declare const COPILOT_SWITCH_LOCK_POLL_MS: number;
|
|
12
8
|
//# sourceMappingURL=timeouts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../src/config/timeouts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,mBAAmB,QAA+C,CAAC;AAChF,eAAO,MAAM,mBAAmB,QAAmD,CAAC;AACpF,eAAO,MAAM,uBAAuB,QAA+C,CAAC;AACpF,eAAO,MAAM,kBAAkB,QAAmD,CAAC
|
|
1
|
+
{"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../src/config/timeouts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,mBAAmB,QAA+C,CAAC;AAChF,eAAO,MAAM,mBAAmB,QAAmD,CAAC;AACpF,eAAO,MAAM,uBAAuB,QAA+C,CAAC;AACpF,eAAO,MAAM,kBAAkB,QAAmD,CAAC"}
|
package/build/config/timeouts.js
CHANGED
|
@@ -13,9 +13,4 @@ export const TASK_TIMEOUT_MIN_MS = readIntEnv('MCP_TASK_TIMEOUT_MIN_MS', 1_000);
|
|
|
13
13
|
export const TASK_TIMEOUT_MAX_MS = readIntEnv('MCP_TASK_TIMEOUT_MAX_MS', 3_600_000);
|
|
14
14
|
export const TASK_TIMEOUT_DEFAULT_MS = readIntEnv('MCP_TASK_TIMEOUT_MS', 1_800_000);
|
|
15
15
|
export const TASK_STALL_WARN_MS = readIntEnv('MCP_TASK_STALL_WARN_MS', 5 * 60_000);
|
|
16
|
-
// Copilot switch timings
|
|
17
|
-
export const COPILOT_SWITCH_COMMAND_TIMEOUT_MS = readIntEnv('MCP_COPILOT_SWITCH_TIMEOUT_MS', 120_000);
|
|
18
|
-
export const COPILOT_SWITCH_LOCK_STALE_MS = readIntEnv('MCP_COPILOT_SWITCH_LOCK_STALE_MS', 150_000);
|
|
19
|
-
export const COPILOT_SWITCH_LOCK_TIMEOUT_MS = readIntEnv('MCP_COPILOT_SWITCH_LOCK_TIMEOUT_MS', 150_000);
|
|
20
|
-
export const COPILOT_SWITCH_LOCK_POLL_MS = readIntEnv('MCP_COPILOT_SWITCH_LOCK_POLL_MS', 500);
|
|
21
16
|
//# sourceMappingURL=timeouts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeouts.js","sourceRoot":"","sources":["../../src/config/timeouts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS,UAAU,CAAC,IAAY,EAAE,QAAgB;IAChD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG;QAAE,OAAO,QAAQ,CAAC;IAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5E,CAAC;AAED,gCAAgC;AAChC,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC,wBAAwB,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"timeouts.js","sourceRoot":"","sources":["../../src/config/timeouts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS,UAAU,CAAC,IAAY,EAAE,QAAgB;IAChD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG;QAAE,OAAO,QAAQ,CAAC;IAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5E,CAAC;AAED,gCAAgC;AAChC,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC,wBAAwB,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC"}
|