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.
Files changed (185) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/.github/workflows/version-bump.yml +4 -3
  3. package/CLAUDE.md +164 -32
  4. package/README.md +194 -78
  5. package/build/config/timeouts.d.ts +0 -4
  6. package/build/config/timeouts.d.ts.map +1 -1
  7. package/build/config/timeouts.js +0 -5
  8. package/build/config/timeouts.js.map +1 -1
  9. package/build/index.js +356 -75
  10. package/build/index.js.map +1 -1
  11. package/build/services/account-manager.d.ts +88 -0
  12. package/build/services/account-manager.d.ts.map +1 -0
  13. package/build/services/account-manager.js +239 -0
  14. package/build/services/account-manager.js.map +1 -0
  15. package/build/services/output-file.d.ts +24 -0
  16. package/build/services/output-file.d.ts.map +1 -0
  17. package/build/services/output-file.js +90 -0
  18. package/build/services/output-file.js.map +1 -0
  19. package/build/services/question-registry.d.ts +75 -0
  20. package/build/services/question-registry.d.ts.map +1 -0
  21. package/build/services/question-registry.js +249 -0
  22. package/build/services/question-registry.js.map +1 -0
  23. package/build/services/retry-queue.d.ts +22 -11
  24. package/build/services/retry-queue.d.ts.map +1 -1
  25. package/build/services/retry-queue.js +106 -16
  26. package/build/services/retry-queue.js.map +1 -1
  27. package/build/services/sdk-client-manager.d.ts +120 -0
  28. package/build/services/sdk-client-manager.d.ts.map +1 -0
  29. package/build/services/sdk-client-manager.js +372 -0
  30. package/build/services/sdk-client-manager.js.map +1 -0
  31. package/build/services/sdk-session-adapter.d.ts +198 -0
  32. package/build/services/sdk-session-adapter.d.ts.map +1 -0
  33. package/build/services/sdk-session-adapter.js +912 -0
  34. package/build/services/sdk-session-adapter.js.map +1 -0
  35. package/build/services/sdk-spawner.d.ts +42 -0
  36. package/build/services/sdk-spawner.d.ts.map +1 -0
  37. package/build/services/sdk-spawner.js +416 -0
  38. package/build/services/sdk-spawner.js.map +1 -0
  39. package/build/services/session-hooks.d.ts +30 -0
  40. package/build/services/session-hooks.d.ts.map +1 -0
  41. package/build/services/session-hooks.js +137 -0
  42. package/build/services/session-hooks.js.map +1 -0
  43. package/build/services/task-manager.d.ts +12 -8
  44. package/build/services/task-manager.d.ts.map +1 -1
  45. package/build/services/task-manager.js +90 -98
  46. package/build/services/task-manager.js.map +1 -1
  47. package/build/services/task-persistence.d.ts.map +1 -1
  48. package/build/services/task-persistence.js +2 -1
  49. package/build/services/task-persistence.js.map +1 -1
  50. package/build/services/task-status-mapper.d.ts +2 -0
  51. package/build/services/task-status-mapper.d.ts.map +1 -1
  52. package/build/services/task-status-mapper.js +128 -15
  53. package/build/services/task-status-mapper.js.map +1 -1
  54. package/build/templates/index.d.ts +2 -0
  55. package/build/templates/index.d.ts.map +1 -1
  56. package/build/templates/index.js +2 -0
  57. package/build/templates/index.js.map +1 -1
  58. package/build/templates/super-arabic.mdx +9 -0
  59. package/build/templates/super-coder.mdx +519 -0
  60. package/build/templates/super-planner.mdx +558 -0
  61. package/build/templates/super-questioner.mdx +14 -0
  62. package/build/templates/super-researcher.mdx +394 -0
  63. package/build/templates/super-tester.mdx +688 -0
  64. package/build/tools/{stream-output.d.ts → answer-question.d.ts} +10 -8
  65. package/build/tools/answer-question.d.ts.map +1 -0
  66. package/build/tools/answer-question.js +114 -0
  67. package/build/tools/answer-question.js.map +1 -0
  68. package/build/tools/cancel-task.d.ts +26 -0
  69. package/build/tools/cancel-task.d.ts.map +1 -1
  70. package/build/tools/cancel-task.js +119 -18
  71. package/build/tools/cancel-task.js.map +1 -1
  72. package/build/tools/send-message.d.ts +46 -0
  73. package/build/tools/send-message.d.ts.map +1 -0
  74. package/build/tools/send-message.js +145 -0
  75. package/build/tools/send-message.js.map +1 -0
  76. package/build/tools/spawn-task.d.ts +1 -1
  77. package/build/tools/spawn-task.d.ts.map +1 -1
  78. package/build/tools/spawn-task.js +35 -9
  79. package/build/tools/spawn-task.js.map +1 -1
  80. package/build/types.d.ts +181 -6
  81. package/build/types.d.ts.map +1 -1
  82. package/build/utils/format.d.ts +0 -10
  83. package/build/utils/format.d.ts.map +1 -1
  84. package/build/utils/format.js +0 -47
  85. package/build/utils/format.js.map +1 -1
  86. package/build/utils/sanitize.d.ts +0 -33
  87. package/build/utils/sanitize.d.ts.map +1 -1
  88. package/build/utils/sanitize.js +0 -13
  89. package/build/utils/sanitize.js.map +1 -1
  90. package/docs/ARCHITECTURE.md +582 -0
  91. package/package.json +3 -4
  92. package/src/config/timeouts.ts +0 -5
  93. package/src/copilot-sdk.d.ts +98 -0
  94. package/src/index.ts +395 -77
  95. package/src/services/account-manager.ts +302 -0
  96. package/src/services/output-file.ts +97 -0
  97. package/src/services/question-registry.ts +336 -0
  98. package/src/services/retry-queue.ts +121 -16
  99. package/src/services/sdk-client-manager.ts +453 -0
  100. package/src/services/sdk-session-adapter.ts +1197 -0
  101. package/src/services/sdk-spawner.ts +494 -0
  102. package/src/services/session-hooks.ts +171 -0
  103. package/src/services/task-manager.ts +102 -93
  104. package/src/services/task-persistence.ts +2 -1
  105. package/src/services/task-status-mapper.ts +150 -14
  106. package/src/templates/index.ts +2 -0
  107. package/src/templates/super-arabic.mdx +9 -0
  108. package/src/templates/super-questioner.mdx +14 -0
  109. package/src/tools/answer-question.ts +140 -0
  110. package/src/tools/cancel-task.ts +151 -28
  111. package/src/tools/send-message.ts +178 -0
  112. package/src/tools/spawn-task.ts +33 -16
  113. package/src/types.ts +197 -6
  114. package/src/utils/format.ts +0 -45
  115. package/src/utils/sanitize.ts +0 -15
  116. package/tests/mcp-test-comprehensive.ts +490 -0
  117. package/tests/mcp-test-multitoken.ts +378 -0
  118. package/tests/mcp-test.ts +177 -0
  119. package/build/services/copilot-switch.d.ts +0 -36
  120. package/build/services/copilot-switch.d.ts.map +0 -1
  121. package/build/services/copilot-switch.js +0 -226
  122. package/build/services/copilot-switch.js.map +0 -1
  123. package/build/services/process-spawner.d.ts +0 -9
  124. package/build/services/process-spawner.d.ts.map +0 -1
  125. package/build/services/process-spawner.js +0 -503
  126. package/build/services/process-spawner.js.map +0 -1
  127. package/build/templates/architect.mdx +0 -162
  128. package/build/templates/bug-researcher.mdx +0 -430
  129. package/build/templates/codebase-researcher.mdx +0 -270
  130. package/build/templates/executor.mdx +0 -584
  131. package/build/templates/planner.mdx +0 -147
  132. package/build/templates/researcher.mdx +0 -855
  133. package/build/templates/turkish.mdx +0 -12
  134. package/build/tools/batch-spawn.d.ts +0 -70
  135. package/build/tools/batch-spawn.d.ts.map +0 -1
  136. package/build/tools/batch-spawn.js +0 -155
  137. package/build/tools/batch-spawn.js.map +0 -1
  138. package/build/tools/clear-tasks.d.ts +0 -21
  139. package/build/tools/clear-tasks.d.ts.map +0 -1
  140. package/build/tools/clear-tasks.js +0 -43
  141. package/build/tools/clear-tasks.js.map +0 -1
  142. package/build/tools/force-start.d.ts +0 -21
  143. package/build/tools/force-start.d.ts.map +0 -1
  144. package/build/tools/force-start.js +0 -38
  145. package/build/tools/force-start.js.map +0 -1
  146. package/build/tools/get-status.d.ts +0 -31
  147. package/build/tools/get-status.d.ts.map +0 -1
  148. package/build/tools/get-status.js +0 -394
  149. package/build/tools/get-status.js.map +0 -1
  150. package/build/tools/list-tasks.d.ts +0 -26
  151. package/build/tools/list-tasks.d.ts.map +0 -1
  152. package/build/tools/list-tasks.js +0 -74
  153. package/build/tools/list-tasks.js.map +0 -1
  154. package/build/tools/recover-task.d.ts +0 -29
  155. package/build/tools/recover-task.d.ts.map +0 -1
  156. package/build/tools/recover-task.js +0 -80
  157. package/build/tools/recover-task.js.map +0 -1
  158. package/build/tools/resume-task.d.ts +0 -30
  159. package/build/tools/resume-task.d.ts.map +0 -1
  160. package/build/tools/resume-task.js +0 -48
  161. package/build/tools/resume-task.js.map +0 -1
  162. package/build/tools/retry-task.d.ts +0 -21
  163. package/build/tools/retry-task.d.ts.map +0 -1
  164. package/build/tools/retry-task.js +0 -52
  165. package/build/tools/retry-task.js.map +0 -1
  166. package/build/tools/simulate-rate-limit.d.ts +0 -25
  167. package/build/tools/simulate-rate-limit.d.ts.map +0 -1
  168. package/build/tools/simulate-rate-limit.js +0 -69
  169. package/build/tools/simulate-rate-limit.js.map +0 -1
  170. package/build/tools/stream-output.d.ts.map +0 -1
  171. package/build/tools/stream-output.js +0 -96
  172. package/build/tools/stream-output.js.map +0 -1
  173. package/docs/timeout-durability.md +0 -28
  174. package/src/services/copilot-switch.ts +0 -269
  175. package/src/services/process-spawner.ts +0 -575
  176. package/src/tools/batch-spawn.ts +0 -188
  177. package/src/tools/clear-tasks.ts +0 -52
  178. package/src/tools/force-start.ts +0 -48
  179. package/src/tools/get-status.ts +0 -492
  180. package/src/tools/list-tasks.ts +0 -83
  181. package/src/tools/recover-task.ts +0 -102
  182. package/src/tools/resume-task.ts +0 -58
  183. package/src/tools/retry-task.ts +0 -72
  184. package/src/tools/simulate-rate-limit.ts +0 -84
  185. package/src/tools/stream-output.ts +0 -101
@@ -29,4 +29,4 @@ jobs:
29
29
  run: npm run build
30
30
 
31
31
  - name: Publish
32
- run: npm publish --provenance --access public
32
+ run: npm publish --access public
@@ -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
- MSG="${{ github.event.head_commit.message }}"
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 "$MSG" | grep -qiE '^feat'; then
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 (Model Context Protocol) server that spawns GitHub Copilot CLI agents as background tasks. It wraps the Copilot CLI (`/opt/homebrew/bin/copilot` by default) with task management, dependency chains, and automatic rate-limit retry.
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
- ### Core Components
77
+ ### Key Architectural Patterns
20
78
 
21
- **Entry Point** (`src/index.ts`): Sets up MCP server, registers all tools, and wires up task manager callbacks for retry and dependency execution.
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
- **Task Manager** (`src/services/task-manager.ts`): Central state machine managing all tasks. Handles:
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
- **Process Spawner** (`src/services/process-spawner.ts`): Executes Copilot CLI via `execa`. Builds command args, captures stdout/stderr, detects rate limits, and handles timeouts.
104
+ When a rate limit (429) or server error (5xx) occurs:
30
105
 
31
- **Persistence** (`src/services/task-persistence.ts`): Tasks persist to `~/.super-agents/{md5(cwd)}.json`. Uses atomic writes (write temprename).
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
- **Retry Queue** (`src/services/retry-queue.ts`): Detects rate-limit errors via regex patterns, calculates exponential backoff (5m 10m → 20m → 40m → 1h → 2h), and extracts wait times from error messages.
110
+ Tokens configured via env vars. Failed tokens enter 60s cooldown before reuse.
34
111
 
35
- ### Tool Handlers
112
+ ### SDK Question/Answer Flow
36
113
 
37
- Each tool in `src/tools/` exports:
38
- - A tool definition object (`{name, description, inputSchema}`)
39
- - A handler function that validates input via Zod schemas from `src/utils/sanitize.ts`
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
- ### Templates
120
+ Questions time out after 30 minutes.
42
121
 
43
- Task templates in `src/templates/*.mdx` wrap user prompts with specialized instructions. The `applyTemplate()` function replaces `{{user_prompt}}` placeholder or appends if not found.
122
+ ### SDK Interface Notes
44
123
 
45
- ### Key Types
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
- - `TaskStatus` enum: `pending`, `waiting`, `running`, `completed`, `failed`, `cancelled`, `rate_limited`, `timed_out`
48
- - `TaskState`: Full task object with output buffer, retry info, dependencies, labels
49
- - `SpawnOptions`: Input for creating tasks
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
- ### Task IDs
137
+ ## Key Types
52
138
 
53
- Human-readable IDs like `brave-tiger-42` generated via `unique-names-generator`. Normalized to lowercase for lookups.
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
- | `COPILOT_PATH` | `/opt/homebrew/bin/copilot` | Path to Copilot CLI executable |
60
- | `ENABLE_OPUS` | `false` | Allow opus model (cost control) |
61
- | `ENABLE_STREAMING` | `false` | Enable experimental `stream_output` tool |
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 tool definition and handler
66
- 2. Import and add to `tools` array in `src/index.ts`
67
- 3. Add case to switch statement in `CallToolRequestSchema` handler
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 Agents MCP Server
1
+ # Super Subagents
2
2
 
3
- MCP server that spawns GitHub Copilot CLI agents as background tasks with human-readable IDs, dependency chains, and automatic rate-limit retry.
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
- ## Quick Start
5
+ ## Why
6
6
 
7
- Install via install-mcp:
8
- ```bash
9
- npx install-mcp super-subagents --client claude-desktop
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
- Manual build:
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
- npm install && npm run build
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": "node",
22
- "args": ["/path/to/copilot-agents/build/index.js"]
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 | Description |
62
+ | Tool | What it does |
31
63
  |------|-------------|
32
- | `spawn_task` | Create a task. Returns `task_id` for tracking. |
33
- | `batch_spawn` | Create multiple tasks with dependency chains (max 20). |
34
- | `get_status` | Check task status. Supports batch checking with array. |
35
- | `list_tasks` | List all tasks. Filter by `status` or `label`. |
36
- | `resume_task` | Resume interrupted session by `session_id`. |
37
- | `retry_task` | Immediately retry a rate-limited task. |
38
- | `cancel_task` | Kill a running/pending task (SIGTERM). |
39
- | `recover_task` | Recover a timed_out task (resume if session is available). |
40
- | `force_start` | Start a waiting task, bypassing dependencies. |
41
- | `clear_tasks` | Delete all tasks for workspace. Requires `confirm: true`. |
42
- | `stream_output` | *(experimental)* Get incremental output with offset. Requires `ENABLE_STREAMING=true`. |
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
- ## Task Statuses
80
+ ## Agent Templates
45
81
 
46
- `pending` `waiting` `running` `completed` | `failed` | `cancelled` | `rate_limited` | `timed_out`
82
+ Templates wrap your prompt with specialized system instructions. The agent sees the template + your prompt, not your conversation.
47
83
 
48
- ## Features
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": "Deploy", "depends_on": ["build-task-id", "test-task-id"] }
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
- ### Labels
57
- ```json
58
- { "prompt": "Build API", "labels": ["backend", "urgent"] }
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
- ### Batch Spawn
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
- "tasks": [
66
- { "id": "build", "prompt": "Build project" },
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
- ### Task Templates
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
- | Template | Use Case |
77
- |----------|----------|
78
- | `super-coder` | Implementation, bug fixes, refactoring |
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
- ### Models
84
- `claude-sonnet-4.5` (default), `claude-haiku-4.5`. Opus blocked by default (set `ENABLE_OPUS=true` to allow).
146
+ // Or free-form text
147
+ { "task_id": "brave-tiger-42", "answer": "CUSTOM: Use TypeScript instead" }
148
+ ```
85
149
 
86
- ### Timeout
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
- ### Rate Limit Auto-Retry
92
- Rate-limited tasks auto-retry with exponential backoff (5m → 10m → 20m → 40m → 1h → 2h). Max 6 retries.
152
+ ## Session Continuation
93
153
 
94
- ### Persistence
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
- // First call
101
- { "task_id": "brave-tiger-42", "offset": 0 }
102
- // Response: { "lines": [...], "next_offset": 50, "has_more": true }
157
+ // Default: "continue"
158
+ { "task_id": "brave-tiger-42" }
103
159
 
104
- // Subsequent calls
105
- { "task_id": "brave-tiger-42", "offset": 50 }
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
- ### Polling Backoff
110
- Response includes `retry_after_seconds` (30s → 60s → 120s → 180s) to prevent excessive polling.
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
- ## Environment
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
- | `COPILOT_PATH` | `/opt/homebrew/bin/copilot` | Copilot CLI path |
117
- | `ENABLE_OPUS` | `false` | Allow opus model (cost control) |
118
- | `ENABLE_STREAMING` | `false` | Enable experimental `stream_output` tool |
119
- | `MCP_TASK_TIMEOUT_MS` | `1800000` | Default task timeout (ms) |
120
- | `MCP_TASK_TIMEOUT_MIN_MS` | `1000` | Minimum allowed task timeout (ms) |
121
- | `MCP_TASK_TIMEOUT_MAX_MS` | `3600000` | Maximum allowed task timeout (ms) |
122
- | `MCP_TASK_STALL_WARN_MS` | `300000` | No-output stall warning threshold (ms) |
123
- | `MCP_COPILOT_SWITCH_TIMEOUT_MS` | `120000` | Timeout for copilot-switch command (ms) |
124
- | `MCP_COPILOT_SWITCH_LOCK_STALE_MS` | `150000` | Stale lock threshold for copilot-switch (ms) |
125
- | `MCP_COPILOT_SWITCH_LOCK_TIMEOUT_MS` | `150000` | Wait timeout for copilot-switch lock (ms) |
126
- | `MCP_COPILOT_SWITCH_LOCK_POLL_MS` | `500` | Lock poll interval for copilot-switch (ms) |
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;AAGnF,eAAO,MAAM,iCAAiC,QAAuD,CAAC;AACtG,eAAO,MAAM,4BAA4B,QAA0D,CAAC;AACpG,eAAO,MAAM,8BAA8B,QAA4D,CAAC;AACxG,eAAO,MAAM,2BAA2B,QAAqD,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"}
@@ -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;AAEnF,yBAAyB;AACzB,MAAM,CAAC,MAAM,iCAAiC,GAAG,UAAU,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;AACtG,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;AACpG,MAAM,CAAC,MAAM,8BAA8B,GAAG,UAAU,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;AACxG,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC,iCAAiC,EAAE,GAAG,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"}