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.
Files changed (87) hide show
  1. package/README.md +209 -0
  2. package/bin/mcp-copilot-worker.mjs +3 -0
  3. package/dist/src/app.d.ts +71 -0
  4. package/dist/src/app.js +306 -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 +111 -0
  25. package/dist/src/mcp/tool-definitions.js +134 -0
  26. package/dist/src/mcp/tool-definitions.js.map +1 -0
  27. package/dist/src/services/copilot-runtime.d.ts +35 -0
  28. package/dist/src/services/copilot-runtime.js +237 -0
  29. package/dist/src/services/copilot-runtime.js.map +1 -0
  30. package/dist/src/services/fleet-mode.d.ts +15 -0
  31. package/dist/src/services/fleet-mode.js +26 -0
  32. package/dist/src/services/fleet-mode.js.map +1 -0
  33. package/dist/src/services/model-catalog.d.ts +16 -0
  34. package/dist/src/services/model-catalog.js +95 -0
  35. package/dist/src/services/model-catalog.js.map +1 -0
  36. package/dist/src/services/output-log.d.ts +7 -0
  37. package/dist/src/services/output-log.js +59 -0
  38. package/dist/src/services/output-log.js.map +1 -0
  39. package/dist/src/services/profile-manager.d.ts +34 -0
  40. package/dist/src/services/profile-manager.js +113 -0
  41. package/dist/src/services/profile-manager.js.map +1 -0
  42. package/dist/src/services/question-registry.d.ts +29 -0
  43. package/dist/src/services/question-registry.js +115 -0
  44. package/dist/src/services/question-registry.js.map +1 -0
  45. package/dist/src/services/spawn-validation.d.ts +9 -0
  46. package/dist/src/services/spawn-validation.js +53 -0
  47. package/dist/src/services/spawn-validation.js.map +1 -0
  48. package/dist/src/services/task-manager.d.ts +34 -0
  49. package/dist/src/services/task-manager.js +107 -0
  50. package/dist/src/services/task-manager.js.map +1 -0
  51. package/dist/src/services/task-persistence.d.ts +20 -0
  52. package/dist/src/services/task-persistence.js +67 -0
  53. package/dist/src/services/task-persistence.js.map +1 -0
  54. package/dist/src/services/task-store.d.ts +12 -0
  55. package/dist/src/services/task-store.js +167 -0
  56. package/dist/src/services/task-store.js.map +1 -0
  57. package/dist/src/services/workspace-isolation.d.ts +13 -0
  58. package/dist/src/services/workspace-isolation.js +74 -0
  59. package/dist/src/services/workspace-isolation.js.map +1 -0
  60. package/dist/src/templates/agent-prompt.d.ts +6 -0
  61. package/dist/src/templates/agent-prompt.js +58 -0
  62. package/dist/src/templates/agent-prompt.js.map +1 -0
  63. package/dist/src/types/task.d.ts +79 -0
  64. package/dist/src/types/task.js +22 -0
  65. package/dist/src/types/task.js.map +1 -0
  66. package/package.json +63 -0
  67. package/src/app.ts +344 -0
  68. package/src/cli/doctor.ts +112 -0
  69. package/src/config/defaults.ts +3 -0
  70. package/src/index.ts +128 -0
  71. package/src/mcp/system-status.ts +41 -0
  72. package/src/mcp/task-markdown.ts +81 -0
  73. package/src/mcp/tool-banners.ts +32 -0
  74. package/src/mcp/tool-definitions.ts +163 -0
  75. package/src/services/copilot-runtime.ts +305 -0
  76. package/src/services/fleet-mode.ts +39 -0
  77. package/src/services/model-catalog.ts +136 -0
  78. package/src/services/output-log.ts +68 -0
  79. package/src/services/profile-manager.ts +165 -0
  80. package/src/services/question-registry.ts +169 -0
  81. package/src/services/spawn-validation.ts +75 -0
  82. package/src/services/task-manager.ts +144 -0
  83. package/src/services/task-persistence.ts +100 -0
  84. package/src/services/task-store.ts +207 -0
  85. package/src/services/workspace-isolation.ts +100 -0
  86. package/src/templates/agent-prompt.ts +71 -0
  87. 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
+ }