mcp-copilot-worker 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +209 -0
- package/bin/mcp-copilot-worker.mjs +3 -0
- package/dist/src/app.d.ts +71 -0
- package/dist/src/app.js +306 -0
- package/dist/src/app.js.map +1 -0
- package/dist/src/cli/doctor.d.ts +2 -0
- package/dist/src/cli/doctor.js +99 -0
- package/dist/src/cli/doctor.js.map +1 -0
- package/dist/src/config/defaults.d.ts +3 -0
- package/dist/src/config/defaults.js +4 -0
- package/dist/src/config/defaults.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +98 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/system-status.d.ts +19 -0
- package/dist/src/mcp/system-status.js +20 -0
- package/dist/src/mcp/system-status.js.map +1 -0
- package/dist/src/mcp/task-markdown.d.ts +3 -0
- package/dist/src/mcp/task-markdown.js +70 -0
- package/dist/src/mcp/task-markdown.js.map +1 -0
- package/dist/src/mcp/tool-banners.d.ts +4 -0
- package/dist/src/mcp/tool-banners.js +26 -0
- package/dist/src/mcp/tool-banners.js.map +1 -0
- package/dist/src/mcp/tool-definitions.d.ts +111 -0
- package/dist/src/mcp/tool-definitions.js +134 -0
- package/dist/src/mcp/tool-definitions.js.map +1 -0
- package/dist/src/services/copilot-runtime.d.ts +35 -0
- package/dist/src/services/copilot-runtime.js +237 -0
- package/dist/src/services/copilot-runtime.js.map +1 -0
- package/dist/src/services/fleet-mode.d.ts +15 -0
- package/dist/src/services/fleet-mode.js +26 -0
- package/dist/src/services/fleet-mode.js.map +1 -0
- package/dist/src/services/model-catalog.d.ts +16 -0
- package/dist/src/services/model-catalog.js +95 -0
- package/dist/src/services/model-catalog.js.map +1 -0
- package/dist/src/services/output-log.d.ts +7 -0
- package/dist/src/services/output-log.js +59 -0
- package/dist/src/services/output-log.js.map +1 -0
- package/dist/src/services/profile-manager.d.ts +34 -0
- package/dist/src/services/profile-manager.js +113 -0
- package/dist/src/services/profile-manager.js.map +1 -0
- package/dist/src/services/question-registry.d.ts +29 -0
- package/dist/src/services/question-registry.js +115 -0
- package/dist/src/services/question-registry.js.map +1 -0
- package/dist/src/services/spawn-validation.d.ts +9 -0
- package/dist/src/services/spawn-validation.js +53 -0
- package/dist/src/services/spawn-validation.js.map +1 -0
- package/dist/src/services/task-manager.d.ts +34 -0
- package/dist/src/services/task-manager.js +107 -0
- package/dist/src/services/task-manager.js.map +1 -0
- package/dist/src/services/task-persistence.d.ts +20 -0
- package/dist/src/services/task-persistence.js +67 -0
- package/dist/src/services/task-persistence.js.map +1 -0
- package/dist/src/services/task-store.d.ts +12 -0
- package/dist/src/services/task-store.js +167 -0
- package/dist/src/services/task-store.js.map +1 -0
- package/dist/src/services/workspace-isolation.d.ts +13 -0
- package/dist/src/services/workspace-isolation.js +74 -0
- package/dist/src/services/workspace-isolation.js.map +1 -0
- package/dist/src/templates/agent-prompt.d.ts +6 -0
- package/dist/src/templates/agent-prompt.js +58 -0
- package/dist/src/templates/agent-prompt.js.map +1 -0
- package/dist/src/types/task.d.ts +79 -0
- package/dist/src/types/task.js +22 -0
- package/dist/src/types/task.js.map +1 -0
- package/package.json +63 -0
- package/src/app.ts +344 -0
- package/src/cli/doctor.ts +112 -0
- package/src/config/defaults.ts +3 -0
- package/src/index.ts +128 -0
- package/src/mcp/system-status.ts +41 -0
- package/src/mcp/task-markdown.ts +81 -0
- package/src/mcp/tool-banners.ts +32 -0
- package/src/mcp/tool-definitions.ts +163 -0
- package/src/services/copilot-runtime.ts +305 -0
- package/src/services/fleet-mode.ts +39 -0
- package/src/services/model-catalog.ts +136 -0
- package/src/services/output-log.ts +68 -0
- package/src/services/profile-manager.ts +165 -0
- package/src/services/question-registry.ts +169 -0
- package/src/services/spawn-validation.ts +75 -0
- package/src/services/task-manager.ts +144 -0
- package/src/services/task-persistence.ts +100 -0
- package/src/services/task-store.ts +207 -0
- package/src/services/workspace-isolation.ts +100 -0
- package/src/templates/agent-prompt.ts +71 -0
- package/src/types/task.ts +95 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export type AgentType = 'coder' | 'planner' | 'researcher' | 'tester' | 'general';
|
|
2
|
+
|
|
3
|
+
export interface ContextFile {
|
|
4
|
+
path: string;
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface PendingQuestion {
|
|
9
|
+
question: string;
|
|
10
|
+
choices?: string[] | undefined;
|
|
11
|
+
allowFreeform: boolean;
|
|
12
|
+
askedAt: string;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum TaskStatus {
|
|
17
|
+
PENDING = 'pending',
|
|
18
|
+
WAITING = 'waiting',
|
|
19
|
+
RUNNING = 'running',
|
|
20
|
+
WAITING_ANSWER = 'waiting_answer',
|
|
21
|
+
COMPLETED = 'completed',
|
|
22
|
+
FAILED = 'failed',
|
|
23
|
+
CANCELLED = 'cancelled',
|
|
24
|
+
RATE_LIMITED = 'rate_limited',
|
|
25
|
+
TIMED_OUT = 'timed_out',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const TERMINAL_STATUSES = new Set<TaskStatus>([
|
|
29
|
+
TaskStatus.COMPLETED,
|
|
30
|
+
TaskStatus.FAILED,
|
|
31
|
+
TaskStatus.CANCELLED,
|
|
32
|
+
TaskStatus.TIMED_OUT,
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
export function isTerminalStatus(status: TaskStatus): boolean {
|
|
36
|
+
return TERMINAL_STATUSES.has(status);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface TaskRecord {
|
|
40
|
+
id: string;
|
|
41
|
+
status: TaskStatus;
|
|
42
|
+
prompt: string;
|
|
43
|
+
cwd: string;
|
|
44
|
+
model: string;
|
|
45
|
+
agentType: AgentType;
|
|
46
|
+
output: string[];
|
|
47
|
+
startTime: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
labels: string[];
|
|
51
|
+
contextFiles: ContextFile[];
|
|
52
|
+
dependsOn?: string[] | undefined;
|
|
53
|
+
error?: string | undefined;
|
|
54
|
+
endTime?: string | undefined;
|
|
55
|
+
outputFilePath?: string | undefined;
|
|
56
|
+
timeoutMs?: number | undefined;
|
|
57
|
+
sessionId?: string | undefined;
|
|
58
|
+
parentTaskId?: string | undefined;
|
|
59
|
+
pendingQuestion?: PendingQuestion | undefined;
|
|
60
|
+
profileId?: string | undefined;
|
|
61
|
+
profileConfigDir?: string | undefined;
|
|
62
|
+
isolationMode?: 'shared' | 'isolated' | undefined;
|
|
63
|
+
baseCwd?: string | undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface CreateTaskInput {
|
|
67
|
+
prompt: string;
|
|
68
|
+
cwd: string;
|
|
69
|
+
model: string;
|
|
70
|
+
agentType: AgentType;
|
|
71
|
+
labels?: string[] | undefined;
|
|
72
|
+
contextFiles?: ContextFile[] | undefined;
|
|
73
|
+
dependsOn?: string[] | undefined;
|
|
74
|
+
timeoutMs?: number | undefined;
|
|
75
|
+
sessionId?: string | undefined;
|
|
76
|
+
parentTaskId?: string | undefined;
|
|
77
|
+
profileId?: string | undefined;
|
|
78
|
+
profileConfigDir?: string | undefined;
|
|
79
|
+
isolationMode?: 'shared' | 'isolated' | undefined;
|
|
80
|
+
baseCwd?: string | undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface PersistedWorkspaceState {
|
|
84
|
+
version: 1;
|
|
85
|
+
tasks: TaskRecord[];
|
|
86
|
+
profiles: PersistedProfileState[];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface PersistedProfileState {
|
|
90
|
+
id: string;
|
|
91
|
+
configDir: string;
|
|
92
|
+
cooldownUntil?: number | undefined;
|
|
93
|
+
failureCount: number;
|
|
94
|
+
lastFailureReason?: string | undefined;
|
|
95
|
+
}
|