mcp-copilot-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +207 -0
  2. package/bin/mcp-copilot-cli.mjs +3 -0
  3. package/dist/src/app.d.ts +71 -0
  4. package/dist/src/app.js +303 -0
  5. package/dist/src/app.js.map +1 -0
  6. package/dist/src/cli/doctor.d.ts +2 -0
  7. package/dist/src/cli/doctor.js +99 -0
  8. package/dist/src/cli/doctor.js.map +1 -0
  9. package/dist/src/config/defaults.d.ts +3 -0
  10. package/dist/src/config/defaults.js +4 -0
  11. package/dist/src/config/defaults.js.map +1 -0
  12. package/dist/src/index.d.ts +2 -0
  13. package/dist/src/index.js +98 -0
  14. package/dist/src/index.js.map +1 -0
  15. package/dist/src/mcp/system-status.d.ts +19 -0
  16. package/dist/src/mcp/system-status.js +20 -0
  17. package/dist/src/mcp/system-status.js.map +1 -0
  18. package/dist/src/mcp/task-markdown.d.ts +3 -0
  19. package/dist/src/mcp/task-markdown.js +70 -0
  20. package/dist/src/mcp/task-markdown.js.map +1 -0
  21. package/dist/src/mcp/tool-banners.d.ts +4 -0
  22. package/dist/src/mcp/tool-banners.js +26 -0
  23. package/dist/src/mcp/tool-banners.js.map +1 -0
  24. package/dist/src/mcp/tool-definitions.d.ts +109 -0
  25. package/dist/src/mcp/tool-definitions.js +125 -0
  26. package/dist/src/mcp/tool-definitions.js.map +1 -0
  27. package/dist/src/services/copilot-runtime.d.ts +28 -0
  28. package/dist/src/services/copilot-runtime.js +194 -0
  29. package/dist/src/services/copilot-runtime.js.map +1 -0
  30. package/dist/src/services/output-log.d.ts +7 -0
  31. package/dist/src/services/output-log.js +59 -0
  32. package/dist/src/services/output-log.js.map +1 -0
  33. package/dist/src/services/profile-manager.d.ts +34 -0
  34. package/dist/src/services/profile-manager.js +113 -0
  35. package/dist/src/services/profile-manager.js.map +1 -0
  36. package/dist/src/services/question-registry.d.ts +29 -0
  37. package/dist/src/services/question-registry.js +115 -0
  38. package/dist/src/services/question-registry.js.map +1 -0
  39. package/dist/src/services/spawn-validation.d.ts +9 -0
  40. package/dist/src/services/spawn-validation.js +53 -0
  41. package/dist/src/services/spawn-validation.js.map +1 -0
  42. package/dist/src/services/task-manager.d.ts +34 -0
  43. package/dist/src/services/task-manager.js +107 -0
  44. package/dist/src/services/task-manager.js.map +1 -0
  45. package/dist/src/services/task-persistence.d.ts +20 -0
  46. package/dist/src/services/task-persistence.js +67 -0
  47. package/dist/src/services/task-persistence.js.map +1 -0
  48. package/dist/src/services/task-store.d.ts +12 -0
  49. package/dist/src/services/task-store.js +167 -0
  50. package/dist/src/services/task-store.js.map +1 -0
  51. package/dist/src/services/workspace-isolation.d.ts +13 -0
  52. package/dist/src/services/workspace-isolation.js +74 -0
  53. package/dist/src/services/workspace-isolation.js.map +1 -0
  54. package/dist/src/templates/agent-prompt.d.ts +6 -0
  55. package/dist/src/templates/agent-prompt.js +58 -0
  56. package/dist/src/templates/agent-prompt.js.map +1 -0
  57. package/dist/src/types/task.d.ts +79 -0
  58. package/dist/src/types/task.js +22 -0
  59. package/dist/src/types/task.js.map +1 -0
  60. package/package.json +63 -0
  61. package/src/app.ts +341 -0
  62. package/src/cli/doctor.ts +112 -0
  63. package/src/config/defaults.ts +3 -0
  64. package/src/index.ts +128 -0
  65. package/src/mcp/system-status.ts +41 -0
  66. package/src/mcp/task-markdown.ts +81 -0
  67. package/src/mcp/tool-banners.ts +32 -0
  68. package/src/mcp/tool-definitions.ts +151 -0
  69. package/src/services/copilot-runtime.ts +247 -0
  70. package/src/services/output-log.ts +68 -0
  71. package/src/services/profile-manager.ts +165 -0
  72. package/src/services/question-registry.ts +169 -0
  73. package/src/services/spawn-validation.ts +75 -0
  74. package/src/services/task-manager.ts +144 -0
  75. package/src/services/task-persistence.ts +100 -0
  76. package/src/services/task-store.ts +207 -0
  77. package/src/services/workspace-isolation.ts +100 -0
  78. package/src/templates/agent-prompt.ts +71 -0
  79. package/src/types/task.ts +95 -0
package/README.md ADDED
@@ -0,0 +1,207 @@
1
+ # mcp-copilot-cli
2
+
3
+ Copilot-only MCP task orchestrator built on `@modelcontextprotocol/sdk` and `@github/copilot-sdk`.
4
+
5
+ It exposes a small MCP surface for launching resumable Copilot-backed background tasks, monitoring them through resources and MCP task primitives, and answering any follow-up questions the running Copilot session asks.
6
+
7
+ ## What It Does
8
+
9
+ - Uses your local GitHub Copilot OAuth session from `~/.copilot` by default.
10
+ - Launches background tasks through a single `spawn-agent` tool.
11
+ - Supports resumable follow-ups with `message-agent`.
12
+ - Supports interactive answers with `answer-agent`.
13
+ - Supports cancellation and full task clearing with `cancel-agent`.
14
+ - Persists task state under `~/.super-agents/<workspace-md5>.json`.
15
+ - Writes live task output to `.super-agents/<task-id>.output` inside the target workspace.
16
+ - Supports `shared` or `isolated` execution workspaces.
17
+ - Exposes both human-readable resources and MCP task handlers.
18
+
19
+ ## Public MCP Surface
20
+
21
+ ### Tools
22
+
23
+ - `spawn-agent`
24
+ Launches a new Copilot-backed task.
25
+ - `message-agent`
26
+ Resumes an existing Copilot session by creating a continuation task with a new `task_id`.
27
+ - `cancel-agent`
28
+ Cancels one task, many tasks, or clears all tracked tasks.
29
+ - `answer-agent`
30
+ Submits an answer to a pending question and resumes the waiting task.
31
+
32
+ ### Resources
33
+
34
+ - `system:///status`
35
+ - `task:///all`
36
+ - `task:///{id}`
37
+ - `task:///{id}/session`
38
+
39
+ ### Task Requests
40
+
41
+ - `tasks/list`
42
+ - `tasks/get`
43
+ - `tasks/result`
44
+ - `tasks/cancel`
45
+
46
+ ## Spawn Behavior
47
+
48
+ `spawn-agent` accepts:
49
+
50
+ - `prompt`
51
+ - `agent_type`: `coder | planner | researcher | tester | general`
52
+ - `context_files`
53
+ - `model`
54
+ - `cwd`
55
+ - `timeout`
56
+ - `depends_on`
57
+ - `labels`
58
+ - `isolation_mode`: `shared | isolated`
59
+
60
+ `message-agent` accepts:
61
+
62
+ - `task_id`
63
+ - `message`
64
+ - `timeout`
65
+ - `cwd`
66
+
67
+ `cancel-agent` accepts:
68
+
69
+ - `task_id`
70
+ A single task id, an array of task ids, or `"all"`.
71
+ - `clear`
72
+ - `confirm`
73
+
74
+ `answer-agent` accepts:
75
+
76
+ - `task_id`
77
+ - `answer`
78
+ - `answers`
79
+
80
+ When `task_id` is `"all"` for `cancel-agent`, both `clear=true` and `confirm=true` are required. For `answer-agent`, either `answer` or `answers` must be provided; the current runtime resolves the first string answer it receives.
81
+
82
+ Validation is role-aware:
83
+
84
+ - `coder` prompts must be at least 1000 characters and include at least one context file.
85
+ - `planner` and `tester` prompts must be at least 300 characters.
86
+ - `researcher` and `general` prompts must be at least 200 characters.
87
+ - `context_files` are capped at 20 files, 200 KB each, 500 KB total.
88
+
89
+ ## Task Lifecycle
90
+
91
+ Tracked tasks move through these statuses:
92
+
93
+ - `pending`
94
+ - `waiting`
95
+ - `running`
96
+ - `waiting_answer`
97
+ - `completed`
98
+ - `failed`
99
+ - `cancelled`
100
+ - `rate_limited`
101
+ - `timed_out`
102
+
103
+ ## Runtime Model
104
+
105
+ - Copilot profiles come from `COPILOT_CONFIG_DIRS` or default to `~/.copilot`.
106
+ - The runtime rotates profiles on rate-limit failures with cooldown tracking.
107
+ - Running tasks stream assistant output and tool lifecycle events into the task log.
108
+ - Questions from Copilot move tasks into `waiting_answer` until `answer-agent` resumes them.
109
+ - Dependent tasks stay in `waiting` until all prerequisite tasks complete.
110
+ - `isolated` mode prefers git worktrees and falls back to a copied workspace.
111
+
112
+ ## Entry Points
113
+
114
+ Preferred local repo entrypoints:
115
+
116
+ - `bin/mcp-copilot-cli.mjs`
117
+ - `node --import tsx src/index.ts`
118
+
119
+ Package scripts:
120
+
121
+ - `npm run serve`
122
+ - `npm run doctor`
123
+ - `npm run smoke`
124
+ - `npm run test:unit`
125
+ - `npm run build`
126
+
127
+ ## Important Packaging Note
128
+
129
+ Do not rely on launching `dist/src/index.js` directly with plain `node` for production-style validation. The upstream `@github/copilot-sdk` dependency currently hits an ESM resolution issue around `vscode-jsonrpc/node` in that mode.
130
+
131
+ The stable verified launch paths in this repository are:
132
+
133
+ - `bin/mcp-copilot-cli.mjs`
134
+ - `node --import tsx src/index.ts`
135
+ - `npm run serve`
136
+
137
+ ## Requirements
138
+
139
+ - Node.js 22+
140
+ - GitHub Copilot CLI installed
141
+ - A valid local Copilot OAuth login
142
+ - Optional: `mcpc 0.1.11` for MCP CLI testing
143
+
144
+ ## Quick Start
145
+
146
+ ```bash
147
+ npm install
148
+ npm run build
149
+ npm run doctor -- --json
150
+ npm run serve
151
+ ```
152
+
153
+ For `mcpc`, use the local wrapper entrypoint:
154
+
155
+ ```json
156
+ {
157
+ "mcpServers": {
158
+ "mcp-copilot-cli": {
159
+ "command": "/absolute/path/to/bin/mcp-copilot-cli.mjs",
160
+ "env": {
161
+ "COPILOT_CLI_PATH": "/opt/homebrew/bin/copilot"
162
+ }
163
+ }
164
+ }
165
+ }
166
+ ```
167
+
168
+ Then:
169
+
170
+ ```bash
171
+ mcpc --config /path/to/config.json mcp-copilot-cli connect @mcp-copilot-cli
172
+ mcpc @mcp-copilot-cli tools-list
173
+ mcpc @mcp-copilot-cli resources-read task:///all
174
+ ```
175
+
176
+ For the published package, use `npx` as the stdio command:
177
+
178
+ ```json
179
+ {
180
+ "mcpServers": {
181
+ "mcp-copilot-cli": {
182
+ "command": "npx",
183
+ "args": ["-y", "mcp-copilot-cli"],
184
+ "env": {
185
+ "COPILOT_CLI_PATH": "/opt/homebrew/bin/copilot"
186
+ }
187
+ }
188
+ }
189
+ }
190
+ ```
191
+
192
+ ## Verification
193
+
194
+ Verified locally in this repository with:
195
+
196
+ - `npm run build`
197
+ - `npm run test:unit`
198
+ - `npm run smoke`
199
+ - `node --import tsx src/cli/doctor.ts --json`
200
+ - `mcpc` live-session E2E tests through `bin/mcp-copilot-cli.mjs`
201
+
202
+ The checked E2E path includes:
203
+
204
+ - spawning a task that outputs `1` through `9`
205
+ - spawning a task that writes `lorem.txt`
206
+ - confirming task completion through MCP resources
207
+ - confirming the session payload and on-disk file contents
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env -S node --import tsx
2
+
3
+ import '../src/index.ts';
@@ -0,0 +1,71 @@
1
+ import { OutputLogService } from './services/output-log.js';
2
+ import { ProfileManager } from './services/profile-manager.js';
3
+ import { QuestionRegistry } from './services/question-registry.js';
4
+ import { TaskManager } from './services/task-manager.js';
5
+ import { CopilotRuntime } from './services/copilot-runtime.js';
6
+ import { type AnswerAgentInput, type CancelAgentInput, type MessageAgentInput, type SpawnAgentInput } from './mcp/tool-definitions.js';
7
+ import { TaskStatus } from './types/task.js';
8
+ export declare class CopilotMcpApp {
9
+ readonly outputLog: OutputLogService;
10
+ readonly profileManager: ProfileManager;
11
+ readonly taskManager: TaskManager;
12
+ readonly questionRegistry: QuestionRegistry;
13
+ readonly runtime: CopilotRuntime;
14
+ initialize(cwd: string): Promise<void>;
15
+ listTools(): import("./mcp/tool-definitions.js").ToolDefinition[];
16
+ spawnAgent(input: SpawnAgentInput): Promise<string>;
17
+ messageAgent(input: MessageAgentInput): Promise<string>;
18
+ cancelAgent(input: CancelAgentInput): Promise<string>;
19
+ answerAgent(input: AnswerAgentInput): Promise<string>;
20
+ listResources(): {
21
+ uri: string;
22
+ name: string;
23
+ description: string;
24
+ mimeType: string;
25
+ }[];
26
+ readResource(uri: string): Promise<{
27
+ mimeType: string;
28
+ text: string;
29
+ }>;
30
+ shutdown(): Promise<void>;
31
+ listTaskSummaries(): {
32
+ taskId: string;
33
+ status: "completed" | "failed" | "cancelled" | "working" | "input_required";
34
+ statusMessage: string | undefined;
35
+ createdAt: string;
36
+ lastUpdatedAt: string;
37
+ ttl: number | null;
38
+ pollInterval: number;
39
+ }[];
40
+ getTaskSummary(taskId: string): {
41
+ taskId: string;
42
+ status: "completed" | "failed" | "cancelled" | "working" | "input_required";
43
+ statusMessage: string | undefined;
44
+ createdAt: string;
45
+ lastUpdatedAt: string;
46
+ ttl: number | null;
47
+ pollInterval: number;
48
+ };
49
+ getTaskPayload(taskId: string): {
50
+ taskId: string;
51
+ status: TaskStatus;
52
+ output: string[];
53
+ error: string | undefined;
54
+ outputFilePath: string | undefined;
55
+ pendingQuestion: import("./types/task.js").PendingQuestion | undefined;
56
+ };
57
+ cancelTaskById(taskId: string): Promise<{
58
+ taskId: string;
59
+ status: "completed" | "failed" | "cancelled" | "working" | "input_required";
60
+ statusMessage: string | undefined;
61
+ createdAt: string;
62
+ lastUpdatedAt: string;
63
+ ttl: number | null;
64
+ pollInterval: number;
65
+ }>;
66
+ private startTask;
67
+ private getTaskOrThrow;
68
+ private toMcpTask;
69
+ private toMcpTaskStatus;
70
+ private buildTaskStatusMessage;
71
+ }
@@ -0,0 +1,303 @@
1
+ import { OutputLogService } from './services/output-log.js';
2
+ import { ProfileManager } from './services/profile-manager.js';
3
+ import { QuestionRegistry } from './services/question-registry.js';
4
+ import { TaskManager } from './services/task-manager.js';
5
+ import { CopilotRuntime } from './services/copilot-runtime.js';
6
+ import { prepareTaskWorkspace } from './services/workspace-isolation.js';
7
+ import { DEFAULT_ISOLATION_MODE, DEFAULT_MODEL, DEFAULT_TIMEOUT_MS } from './config/defaults.js';
8
+ import { buildAnswerBanner, buildMessageBanner } from './mcp/tool-banners.js';
9
+ import { createToolDefinitions } from './mcp/tool-definitions.js';
10
+ import { renderTaskListMarkdown, renderTaskMarkdown } from './mcp/task-markdown.js';
11
+ import { buildSystemStatus } from './mcp/system-status.js';
12
+ import { TaskStatus } from './types/task.js';
13
+ import { validateSpawnAgentInput } from './services/spawn-validation.js';
14
+ export class CopilotMcpApp {
15
+ outputLog = new OutputLogService();
16
+ profileManager = ProfileManager.fromEnvironment();
17
+ taskManager = new TaskManager({
18
+ outputLog: this.outputLog,
19
+ getProfiles: () => this.profileManager.toPersistedState(),
20
+ });
21
+ questionRegistry = new QuestionRegistry(this.taskManager);
22
+ runtime = new CopilotRuntime({
23
+ taskManager: this.taskManager,
24
+ profileManager: this.profileManager,
25
+ questionRegistry: this.questionRegistry,
26
+ });
27
+ async initialize(cwd) {
28
+ const restored = await this.taskManager.load(cwd);
29
+ this.profileManager.hydrate(restored.profiles);
30
+ }
31
+ listTools() {
32
+ return createToolDefinitions({
33
+ messageBanner: buildMessageBanner(this.taskManager),
34
+ answerBanner: buildAnswerBanner(this.questionRegistry),
35
+ });
36
+ }
37
+ async spawnAgent(input) {
38
+ const baseCwd = input.cwd ?? process.cwd();
39
+ const validated = await validateSpawnAgentInput({ input, baseCwd });
40
+ const isolationMode = input.isolation_mode ?? DEFAULT_ISOLATION_MODE;
41
+ const workspace = await prepareTaskWorkspace({
42
+ baseCwd,
43
+ taskId: `${Date.now().toString(36)}-workspace`,
44
+ isolationMode,
45
+ });
46
+ const task = await this.taskManager.createTask({
47
+ prompt: input.prompt,
48
+ cwd: workspace.cwd,
49
+ baseCwd,
50
+ model: input.model ?? DEFAULT_MODEL,
51
+ agentType: input.agent_type,
52
+ labels: input.labels,
53
+ contextFiles: validated.contextFiles,
54
+ dependsOn: input.depends_on,
55
+ timeoutMs: input.timeout ?? DEFAULT_TIMEOUT_MS,
56
+ isolationMode,
57
+ });
58
+ if (task.status === TaskStatus.WAITING) {
59
+ return [
60
+ '✅ **Task queued (waiting for dependencies)**',
61
+ `task_id: \`${task.id}\``,
62
+ task.outputFilePath ? `output_file: \`${task.outputFilePath}\`` : null,
63
+ '',
64
+ '**Monitor:** Read `task:///all` — shows all tasks with status and pending questions in one table.',
65
+ ].filter(Boolean).join('\n');
66
+ }
67
+ void this.startTask(task.id).catch(() => { });
68
+ return [
69
+ '✅ **Task launched**',
70
+ `task_id: \`${task.id}\``,
71
+ task.outputFilePath ? `read logs: \`cat -n ${task.outputFilePath}\`` : null,
72
+ task.outputFilePath ? 'Use `cat -n` to read with line numbers, then on subsequent reads use `tail -n +<N>` to skip already-read lines.' : null,
73
+ '',
74
+ '**What to do next:**',
75
+ '- If you still have more agents to launch, launch them now — all agents run in parallel.',
76
+ '- Once all agents are launched, run `sleep 30` and then check status.',
77
+ `- To check status, read the MCP resource \`task:///${task.id}\` — it will show current progress, output, and whether the agent needs input.`,
78
+ task.outputFilePath ? `- For a quick progress check without reading the full resource, run \`wc -l ${task.outputFilePath}\` — a growing line count means the agent is still working.` : null,
79
+ ].filter(Boolean).join('\n');
80
+ }
81
+ async messageAgent(input) {
82
+ const original = this.taskManager.getTask(input.task_id);
83
+ if (!original) {
84
+ throw new Error(`Task not found: ${input.task_id}`);
85
+ }
86
+ if (!original.sessionId) {
87
+ throw new Error(`Task ${input.task_id} has no resumable session`);
88
+ }
89
+ const task = await this.taskManager.createTask({
90
+ prompt: input.message ?? 'continue',
91
+ cwd: input.cwd ?? original.cwd,
92
+ baseCwd: input.cwd ?? original.baseCwd ?? original.cwd,
93
+ model: original.model,
94
+ agentType: original.agentType,
95
+ labels: [...original.labels, `continued-from:${original.id}`],
96
+ contextFiles: original.contextFiles,
97
+ timeoutMs: input.timeout ?? original.timeoutMs ?? DEFAULT_TIMEOUT_MS,
98
+ sessionId: original.sessionId,
99
+ parentTaskId: original.id,
100
+ profileId: original.profileId,
101
+ profileConfigDir: original.profileConfigDir,
102
+ isolationMode: original.isolationMode,
103
+ });
104
+ void this.startTask(task.id).catch(() => { });
105
+ return [
106
+ '✅ **Message sent**',
107
+ `task_id: \`${task.id}\``,
108
+ '',
109
+ task.outputFilePath ? `read logs: \`cat -n ${task.outputFilePath}\`` : null,
110
+ task.outputFilePath ? 'Use `cat -n` to read with line numbers, then on subsequent reads use `tail -n +<N>` to skip already-read lines.' : null,
111
+ ].filter(Boolean).join('\n');
112
+ }
113
+ async cancelAgent(input) {
114
+ if (input.task_id === 'all') {
115
+ if (!input.clear || !input.confirm) {
116
+ throw new Error('Use clear=true and confirm=true with task_id="all"');
117
+ }
118
+ const count = await this.taskManager.clearAllTasks();
119
+ return `✅ Cleared **${count}** tasks from workspace.`;
120
+ }
121
+ const taskIds = Array.isArray(input.task_id) ? input.task_id : [input.task_id];
122
+ const results = await Promise.all(taskIds.map((taskId) => this.taskManager.cancelTask(taskId)));
123
+ return `✅ Cancelled ${results.filter(Boolean).length}/${taskIds.length} task(s).`;
124
+ }
125
+ async answerAgent(input) {
126
+ const rawAnswer = input.answer ?? Object.values(input.answers ?? {})[0];
127
+ if (!rawAnswer) {
128
+ throw new Error('Provide answer or answers');
129
+ }
130
+ const result = this.questionRegistry.submitAnswer(input.task_id, rawAnswer);
131
+ if (!result.success) {
132
+ throw new Error(result.error);
133
+ }
134
+ return [
135
+ '✅ **Answer submitted**',
136
+ `task_id: \`${input.task_id}\``,
137
+ `**Answer:** ${result.resolvedAnswer}`,
138
+ ].join('\n');
139
+ }
140
+ listResources() {
141
+ return [
142
+ {
143
+ uri: 'system:///status',
144
+ name: 'System Status',
145
+ description: 'Current task and profile counts',
146
+ mimeType: 'application/json',
147
+ },
148
+ {
149
+ uri: 'task:///all',
150
+ name: 'All Tasks',
151
+ description: `${this.taskManager.getAllTasks().length} tracked tasks`,
152
+ mimeType: 'text/markdown',
153
+ },
154
+ ...this.taskManager.getAllTasks().flatMap((task) => ([
155
+ {
156
+ uri: `task:///${task.id}`,
157
+ name: task.id,
158
+ description: task.status,
159
+ mimeType: 'text/markdown',
160
+ },
161
+ {
162
+ uri: `task:///${task.id}/session`,
163
+ name: `${task.id} session`,
164
+ description: `Execution log for ${task.id}`,
165
+ mimeType: 'application/json',
166
+ },
167
+ ])),
168
+ ];
169
+ }
170
+ async readResource(uri) {
171
+ if (uri === 'system:///status') {
172
+ return {
173
+ mimeType: 'application/json',
174
+ text: JSON.stringify(buildSystemStatus({
175
+ tasks: this.taskManager.getAllTasks(),
176
+ profiles: this.profileManager.getProfiles(),
177
+ }), null, 2),
178
+ };
179
+ }
180
+ if (uri === 'task:///all') {
181
+ return {
182
+ mimeType: 'text/markdown',
183
+ text: renderTaskListMarkdown(this.taskManager.getAllTasks()),
184
+ };
185
+ }
186
+ if (uri.startsWith('task:///') && uri.endsWith('/session')) {
187
+ const taskId = uri.slice('task:///'.length, -'/session'.length);
188
+ const task = this.getTaskOrThrow(taskId);
189
+ return {
190
+ mimeType: 'application/json',
191
+ text: JSON.stringify({
192
+ taskId: task.id,
193
+ status: task.status,
194
+ output: task.output,
195
+ }),
196
+ };
197
+ }
198
+ if (uri.startsWith('task:///')) {
199
+ const taskId = uri.slice('task:///'.length);
200
+ const task = this.getTaskOrThrow(taskId);
201
+ return {
202
+ mimeType: 'text/markdown',
203
+ text: renderTaskMarkdown(task),
204
+ };
205
+ }
206
+ throw new Error(`Unknown resource URI: ${uri}`);
207
+ }
208
+ async shutdown() {
209
+ await this.runtime.shutdown();
210
+ }
211
+ listTaskSummaries() {
212
+ return this.taskManager.getAllTasks().map((task) => this.toMcpTask(task));
213
+ }
214
+ getTaskSummary(taskId) {
215
+ return this.toMcpTask(this.getTaskOrThrow(taskId));
216
+ }
217
+ getTaskPayload(taskId) {
218
+ const task = this.getTaskOrThrow(taskId);
219
+ return {
220
+ taskId: task.id,
221
+ status: task.status,
222
+ output: task.output,
223
+ error: task.error,
224
+ outputFilePath: task.outputFilePath,
225
+ pendingQuestion: task.pendingQuestion,
226
+ };
227
+ }
228
+ async cancelTaskById(taskId) {
229
+ const cancelled = await this.taskManager.cancelTask(taskId);
230
+ if (!cancelled && !this.taskManager.getTask(taskId)) {
231
+ throw new Error(`Task not found: ${taskId}`);
232
+ }
233
+ return this.getTaskSummary(taskId);
234
+ }
235
+ async startTask(taskId) {
236
+ const task = this.taskManager.getTask(taskId);
237
+ if (!task) {
238
+ return;
239
+ }
240
+ try {
241
+ await this.runtime.runTask(task);
242
+ const ready = await this.taskManager.releaseReadyTasks();
243
+ await Promise.all(ready.map((released) => this.startTask(released.id)));
244
+ }
245
+ catch (error) {
246
+ await this.taskManager.updateTask(taskId, {
247
+ status: TaskStatus.FAILED,
248
+ error: error instanceof Error ? error.message : String(error),
249
+ endTime: new Date().toISOString(),
250
+ }).catch(() => { });
251
+ }
252
+ }
253
+ getTaskOrThrow(taskId) {
254
+ const task = this.taskManager.getTask(taskId);
255
+ if (!task) {
256
+ throw new Error(`Task not found: ${taskId}`);
257
+ }
258
+ return task;
259
+ }
260
+ toMcpTask(task) {
261
+ return {
262
+ taskId: task.id,
263
+ status: this.toMcpTaskStatus(task.status),
264
+ statusMessage: this.buildTaskStatusMessage(task),
265
+ createdAt: task.createdAt,
266
+ lastUpdatedAt: task.updatedAt,
267
+ ttl: task.timeoutMs ?? null,
268
+ pollInterval: 2_000,
269
+ };
270
+ }
271
+ toMcpTaskStatus(status) {
272
+ switch (status) {
273
+ case TaskStatus.WAITING_ANSWER:
274
+ return 'input_required';
275
+ case TaskStatus.COMPLETED:
276
+ return 'completed';
277
+ case TaskStatus.CANCELLED:
278
+ return 'cancelled';
279
+ case TaskStatus.FAILED:
280
+ case TaskStatus.TIMED_OUT:
281
+ case TaskStatus.RATE_LIMITED:
282
+ return 'failed';
283
+ default:
284
+ return 'working';
285
+ }
286
+ }
287
+ buildTaskStatusMessage(task) {
288
+ if (task.pendingQuestion?.question) {
289
+ return task.pendingQuestion.question;
290
+ }
291
+ if (task.status === TaskStatus.WAITING && (task.dependsOn?.length ?? 0) > 0) {
292
+ return `Waiting for dependencies: ${(task.dependsOn ?? []).join(', ')}`;
293
+ }
294
+ if (task.error) {
295
+ return task.error;
296
+ }
297
+ if (task.status === TaskStatus.COMPLETED) {
298
+ return 'Task completed';
299
+ }
300
+ return undefined;
301
+ }
302
+ }
303
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B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