@covibes/zeroshot 5.3.0 → 5.4.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 (119) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +8 -385
  3. package/cli/index.js +108 -4615
  4. package/package.json +16 -125
  5. package/CHANGELOG.md +0 -537
  6. package/cli/commands/providers.js +0 -150
  7. package/cli/lib/first-run.js +0 -211
  8. package/cli/lib/update-checker.js +0 -281
  9. package/cli/message-formatter-utils.js +0 -75
  10. package/cli/message-formatters-normal.js +0 -253
  11. package/cli/message-formatters-watch.js +0 -181
  12. package/cluster-templates/base-templates/debug-workflow.json +0 -375
  13. package/cluster-templates/base-templates/full-workflow.json +0 -697
  14. package/cluster-templates/base-templates/single-worker.json +0 -63
  15. package/cluster-templates/base-templates/worker-validator.json +0 -152
  16. package/cluster-templates/conductor-bootstrap.json +0 -124
  17. package/docker/zeroshot-cluster/Dockerfile +0 -152
  18. package/docker/zeroshot-cluster/pre-baked-deps.json +0 -28
  19. package/lib/completion.js +0 -174
  20. package/lib/docker-config.js +0 -212
  21. package/lib/id-detector.js +0 -53
  22. package/lib/provider-detection.js +0 -59
  23. package/lib/provider-names.js +0 -56
  24. package/lib/settings.js +0 -405
  25. package/lib/stream-json-parser.js +0 -10
  26. package/scripts/fix-node-pty-permissions.js +0 -75
  27. package/scripts/record-demo.sh +0 -279
  28. package/scripts/test-install.sh +0 -40
  29. package/scripts/validate-templates.js +0 -100
  30. package/src/agent/agent-config.js +0 -193
  31. package/src/agent/agent-context-builder.js +0 -335
  32. package/src/agent/agent-hook-executor.js +0 -402
  33. package/src/agent/agent-lifecycle.js +0 -683
  34. package/src/agent/agent-stuck-detector.js +0 -256
  35. package/src/agent/agent-task-executor.js +0 -1431
  36. package/src/agent/agent-trigger-evaluator.js +0 -67
  37. package/src/agent/output-extraction.js +0 -200
  38. package/src/agent/output-reformatter.js +0 -175
  39. package/src/agent/schema-utils.js +0 -111
  40. package/src/agent-wrapper.js +0 -570
  41. package/src/agents/git-pusher-agent.json +0 -20
  42. package/src/attach/attach-client.js +0 -438
  43. package/src/attach/attach-server.js +0 -543
  44. package/src/attach/index.js +0 -35
  45. package/src/attach/protocol.js +0 -220
  46. package/src/attach/ring-buffer.js +0 -121
  47. package/src/attach/socket-discovery.js +0 -267
  48. package/src/claude-task-runner.js +0 -523
  49. package/src/config-router.js +0 -80
  50. package/src/config-validator.js +0 -1660
  51. package/src/copy-worker.js +0 -43
  52. package/src/github.js +0 -139
  53. package/src/isolation-manager.js +0 -1381
  54. package/src/ledger.js +0 -614
  55. package/src/logic-engine.js +0 -223
  56. package/src/message-bus-bridge.js +0 -139
  57. package/src/message-bus.js +0 -249
  58. package/src/name-generator.js +0 -232
  59. package/src/orchestrator.js +0 -2519
  60. package/src/preflight.js +0 -485
  61. package/src/process-metrics.js +0 -566
  62. package/src/providers/anthropic/cli-builder.js +0 -45
  63. package/src/providers/anthropic/index.js +0 -134
  64. package/src/providers/anthropic/models.js +0 -23
  65. package/src/providers/anthropic/output-parser.js +0 -159
  66. package/src/providers/base-provider.js +0 -181
  67. package/src/providers/capabilities.js +0 -51
  68. package/src/providers/google/cli-builder.js +0 -55
  69. package/src/providers/google/index.js +0 -116
  70. package/src/providers/google/models.js +0 -24
  71. package/src/providers/google/output-parser.js +0 -92
  72. package/src/providers/index.js +0 -75
  73. package/src/providers/openai/cli-builder.js +0 -122
  74. package/src/providers/openai/index.js +0 -135
  75. package/src/providers/openai/models.js +0 -21
  76. package/src/providers/openai/output-parser.js +0 -129
  77. package/src/schemas/sub-cluster.js +0 -156
  78. package/src/status-footer.js +0 -980
  79. package/src/sub-cluster-wrapper.js +0 -560
  80. package/src/task-runner.js +0 -30
  81. package/src/template-resolver.js +0 -369
  82. package/src/tui/CHANGES.txt +0 -133
  83. package/src/tui/LAYOUT.md +0 -261
  84. package/src/tui/README.txt +0 -192
  85. package/src/tui/TWO-LEVEL-NAVIGATION.md +0 -186
  86. package/src/tui/data-poller.js +0 -325
  87. package/src/tui/demo.js +0 -208
  88. package/src/tui/formatters.js +0 -128
  89. package/src/tui/index.js +0 -193
  90. package/src/tui/keybindings.js +0 -383
  91. package/src/tui/layout.js +0 -334
  92. package/src/tui/renderer.js +0 -194
  93. package/task-lib/attachable-watcher.js +0 -272
  94. package/task-lib/claude-recovery.js +0 -119
  95. package/task-lib/commands/clean.js +0 -50
  96. package/task-lib/commands/get-log-path.js +0 -23
  97. package/task-lib/commands/kill.js +0 -32
  98. package/task-lib/commands/list.js +0 -105
  99. package/task-lib/commands/logs.js +0 -411
  100. package/task-lib/commands/resume.js +0 -42
  101. package/task-lib/commands/run.js +0 -57
  102. package/task-lib/commands/schedule.js +0 -105
  103. package/task-lib/commands/scheduler-cmd.js +0 -96
  104. package/task-lib/commands/schedules.js +0 -98
  105. package/task-lib/commands/status.js +0 -44
  106. package/task-lib/commands/unschedule.js +0 -16
  107. package/task-lib/completion.js +0 -9
  108. package/task-lib/config.js +0 -10
  109. package/task-lib/name-generator.js +0 -230
  110. package/task-lib/package.json +0 -3
  111. package/task-lib/runner.js +0 -144
  112. package/task-lib/scheduler.js +0 -252
  113. package/task-lib/store.js +0 -230
  114. package/task-lib/tui/formatters.js +0 -166
  115. package/task-lib/tui/index.js +0 -197
  116. package/task-lib/tui/layout.js +0 -111
  117. package/task-lib/tui/renderer.js +0 -119
  118. package/task-lib/tui.js +0 -384
  119. package/task-lib/watcher.js +0 -188
@@ -1,560 +0,0 @@
1
- /**
2
- * SubClusterWrapper - Manages nested cluster lifecycle
3
- *
4
- * Implements same interface as AgentWrapper but spawns a child Orchestrator
5
- * instead of a Claude task. Enables recursive cluster composition.
6
- *
7
- * Lifecycle:
8
- * - On trigger match: spawns nested Orchestrator with child cluster config
9
- * - Passes parent context to child via ISSUE_OPENED equivalent
10
- * - Listens for child CLUSTER_COMPLETE → executes onComplete hook
11
- * - Listens for child CLUSTER_FAILED → executes onError hook
12
- * - Supports maxIterations at subcluster level (restart child on failure)
13
- */
14
-
15
- const LogicEngine = require('./logic-engine');
16
- const MessageBusBridge = require('./message-bus-bridge');
17
- const { DEFAULT_MAX_ITERATIONS } = require('./agent/agent-config');
18
-
19
- class SubClusterWrapper {
20
- constructor(config, messageBus, parentCluster, options = {}) {
21
- this.id = config.id;
22
- this.role = config.role || 'orchestrator';
23
- this.config = config;
24
- this.messageBus = messageBus; // Parent message bus
25
- this.parentCluster = parentCluster;
26
- this.logicEngine = new LogicEngine(messageBus, parentCluster);
27
-
28
- this.state = 'idle';
29
- this.iteration = 0;
30
- this.maxIterations = config.maxIterations || DEFAULT_MAX_ITERATIONS;
31
- this.running = false;
32
- this.unsubscribe = null;
33
-
34
- // Child cluster state
35
- this.childCluster = null; // { id, orchestrator, messageBus, bridge }
36
- this.childClusterId = null;
37
-
38
- this.quiet = options.quiet || false;
39
- this.modelOverride = options.modelOverride || null;
40
- }
41
-
42
- /**
43
- * Log message (respects quiet mode)
44
- * @private
45
- */
46
- _log(...args) {
47
- if (!this.quiet) {
48
- console.log(...args);
49
- }
50
- }
51
-
52
- /**
53
- * Publish lifecycle event to parent message bus
54
- * @private
55
- */
56
- _publishLifecycle(event, details = {}) {
57
- this.messageBus.publish({
58
- cluster_id: this.parentCluster.id,
59
- topic: 'AGENT_LIFECYCLE',
60
- sender: this.id,
61
- receiver: 'system',
62
- content: {
63
- text: `${this.id}: ${event}`,
64
- data: {
65
- event,
66
- agent: this.id,
67
- role: this.role,
68
- state: this.state,
69
- type: 'subcluster',
70
- ...details,
71
- },
72
- },
73
- });
74
- }
75
-
76
- /**
77
- * Start the sub-cluster wrapper (begin listening for triggers)
78
- */
79
- start() {
80
- if (this.running) {
81
- throw new Error(`SubCluster ${this.id} is already running`);
82
- }
83
-
84
- this.running = true;
85
- this.state = 'idle';
86
-
87
- // Subscribe to parent cluster messages
88
- this.unsubscribe = this.messageBus.subscribe((message) => {
89
- if (message.cluster_id === this.parentCluster.id) {
90
- this._handleMessage(message).catch((error) => {
91
- console.error(`\n${'='.repeat(80)}`);
92
- console.error(`🔴 FATAL: SubCluster ${this.id} message handler crashed`);
93
- console.error(`${'='.repeat(80)}`);
94
- console.error(`Topic: ${message.topic}`);
95
- console.error(`Error: ${error.message}`);
96
- console.error(`Stack: ${error.stack}`);
97
- console.error(`${'='.repeat(80)}\n`);
98
- throw error;
99
- });
100
- }
101
- });
102
-
103
- this._log(`SubCluster ${this.id} started (role: ${this.role})`);
104
- this._publishLifecycle('STARTED', {
105
- triggers: this.config.triggers?.map((t) => t.topic) || [],
106
- });
107
- }
108
-
109
- /**
110
- * Stop the sub-cluster wrapper
111
- */
112
- async stop() {
113
- if (!this.running) {
114
- return;
115
- }
116
-
117
- this.running = false;
118
- this.state = 'stopped';
119
-
120
- if (this.unsubscribe) {
121
- this.unsubscribe();
122
- this.unsubscribe = null;
123
- }
124
-
125
- // Stop child cluster if running
126
- if (this.childCluster) {
127
- await this._stopChildCluster();
128
- }
129
-
130
- this._log(`SubCluster ${this.id} stopped`);
131
- }
132
-
133
- /**
134
- * Handle incoming message from parent cluster
135
- * @private
136
- */
137
- async _handleMessage(message) {
138
- // Check if any trigger matches
139
- const matchingTrigger = this._findMatchingTrigger(message);
140
- if (!matchingTrigger) {
141
- return;
142
- }
143
-
144
- // Check state
145
- if (!this.running) {
146
- console.warn(`[${this.id}] ⚠️ DROPPING message (not running): ${message.topic}`);
147
- return;
148
- }
149
- if (this.state !== 'idle') {
150
- console.warn(
151
- `[${this.id}] ⚠️ DROPPING message (busy, state=${this.state}): ${message.topic}`
152
- );
153
- return;
154
- }
155
-
156
- // Evaluate trigger logic
157
- this.state = 'evaluating_logic';
158
- const shouldExecute = this._evaluateTrigger(matchingTrigger, message);
159
-
160
- if (!shouldExecute) {
161
- this.state = 'idle';
162
- return;
163
- }
164
-
165
- // Execute trigger action (spawn child cluster)
166
- await this._handleTrigger(message);
167
- }
168
-
169
- /**
170
- * Find trigger matching the message topic
171
- * @private
172
- */
173
- _findMatchingTrigger(message) {
174
- if (!this.config.triggers) {
175
- return null;
176
- }
177
-
178
- return this.config.triggers.find((trigger) => {
179
- if (trigger.topic === '*' || trigger.topic === message.topic) {
180
- return true;
181
- }
182
- if (trigger.topic.endsWith('*')) {
183
- const prefix = trigger.topic.slice(0, -1);
184
- return message.topic.startsWith(prefix);
185
- }
186
- return false;
187
- });
188
- }
189
-
190
- /**
191
- * Evaluate trigger logic
192
- * @private
193
- */
194
- _evaluateTrigger(trigger, message) {
195
- if (!trigger.logic || !trigger.logic.script) {
196
- return true;
197
- }
198
-
199
- const agent = {
200
- id: this.id,
201
- role: this.role,
202
- iteration: this.iteration,
203
- cluster_id: this.parentCluster.id,
204
- };
205
-
206
- return this.logicEngine.evaluate(trigger.logic.script, agent, message);
207
- }
208
-
209
- /**
210
- * Handle trigger: spawn child cluster
211
- * @private
212
- */
213
- async _handleTrigger(triggeringMessage) {
214
- // Check max iterations
215
- if (this.iteration >= this.maxIterations) {
216
- this._log(`[SubCluster ${this.id}] Hit max iterations (${this.maxIterations}), failing`);
217
- this._publishLifecycle('MAX_ITERATIONS_REACHED', {
218
- iteration: this.iteration,
219
- maxIterations: this.maxIterations,
220
- });
221
-
222
- this.messageBus.publish({
223
- cluster_id: this.parentCluster.id,
224
- topic: 'CLUSTER_FAILED',
225
- sender: this.id,
226
- receiver: 'system',
227
- content: {
228
- text: `SubCluster ${this.id} hit max iterations limit (${this.maxIterations})`,
229
- data: {
230
- reason: 'max_iterations',
231
- iteration: this.iteration,
232
- maxIterations: this.maxIterations,
233
- },
234
- },
235
- });
236
-
237
- this.state = 'failed';
238
- return;
239
- }
240
-
241
- this.iteration++;
242
- this.state = 'spawning_child';
243
-
244
- this._publishLifecycle('SPAWNING_CHILD', {
245
- iteration: this.iteration,
246
- triggeredBy: triggeringMessage.topic,
247
- });
248
-
249
- try {
250
- // Build child cluster context from parent messages
251
- const context = this._buildChildContext(triggeringMessage);
252
-
253
- // Spawn child cluster
254
- await this._spawnChildCluster(context);
255
-
256
- this._publishLifecycle('CHILD_SPAWNED', {
257
- childClusterId: this.childClusterId,
258
- iteration: this.iteration,
259
- });
260
-
261
- this.state = 'monitoring_child';
262
- } catch (error) {
263
- console.error(`\n${'='.repeat(80)}`);
264
- console.error(`🔴 CHILD CLUSTER SPAWN FAILED - ${this.id}`);
265
- console.error(`${'='.repeat(80)}`);
266
- console.error(`Error: ${error.message}`);
267
- console.error(`Stack: ${error.stack}`);
268
- console.error(`${'='.repeat(80)}\n`);
269
-
270
- this.state = 'error';
271
-
272
- // Execute onError hook
273
- await this._executeHook('onError', { error, triggeringMessage });
274
-
275
- // Return to idle if we haven't hit max iterations
276
- if (this.iteration < this.maxIterations) {
277
- this.state = 'idle';
278
- }
279
- }
280
- }
281
-
282
- /**
283
- * Build context for child cluster from parent messages
284
- * @private
285
- */
286
- _buildChildContext(triggeringMessage) {
287
- const parentTopics = this.config.contextStrategy?.parentTopics || [];
288
-
289
- let context = `# Child Cluster Context\n\n`;
290
- context += `Parent Cluster: ${this.parentCluster.id}\n`;
291
- context += `SubCluster ID: ${this.id}\n`;
292
- context += `Iteration: ${this.iteration}\n\n`;
293
-
294
- // Add messages from specified parent topics
295
- if (parentTopics.length > 0) {
296
- context += `## Parent Cluster Messages\n\n`;
297
-
298
- for (const topic of parentTopics) {
299
- const messages = this.messageBus.query({
300
- cluster_id: this.parentCluster.id,
301
- topic,
302
- limit: 10,
303
- });
304
-
305
- if (messages.length > 0) {
306
- context += `### Topic: ${topic}\n\n`;
307
- for (const msg of messages) {
308
- context += `[${new Date(msg.timestamp).toISOString()}] ${msg.sender}:\n`;
309
- if (msg.content?.text) {
310
- context += `${msg.content.text}\n`;
311
- }
312
- if (msg.content?.data) {
313
- context += `Data: ${JSON.stringify(msg.content.data, null, 2)}\n`;
314
- }
315
- context += '\n';
316
- }
317
- }
318
- }
319
- }
320
-
321
- // Add triggering message
322
- context += `\n## Triggering Message\n\n`;
323
- context += `Topic: ${triggeringMessage.topic}\n`;
324
- context += `Sender: ${triggeringMessage.sender}\n`;
325
- if (triggeringMessage.content?.text) {
326
- context += `\n${triggeringMessage.content.text}\n`;
327
- }
328
-
329
- return context;
330
- }
331
-
332
- /**
333
- * Spawn child cluster with nested Orchestrator
334
- * @private
335
- */
336
- async _spawnChildCluster(context) {
337
- const Orchestrator = require('./orchestrator');
338
- const path = require('path');
339
-
340
- // Generate child cluster ID (namespaced under parent)
341
- const childId = `${this.parentCluster.id}.${this.id}`;
342
- this.childClusterId = childId;
343
-
344
- // Create child orchestrator with separate database
345
- const childOrchestrator = await Orchestrator.create({
346
- quiet: this.quiet,
347
- skipLoad: true,
348
- storageDir: path.join(this.parentCluster.ledger.dbPath, '..', 'subclusters', childId),
349
- });
350
-
351
- const childConfig = JSON.parse(JSON.stringify(this.config.config));
352
- const parentConfig = this.parentCluster?.config || {};
353
-
354
- if (parentConfig.forceProvider) {
355
- childConfig.forceProvider = parentConfig.forceProvider;
356
- childConfig.defaultProvider = parentConfig.forceProvider;
357
- if (parentConfig.forceLevel) {
358
- childConfig.forceLevel = parentConfig.forceLevel;
359
- childConfig.defaultLevel = parentConfig.forceLevel;
360
- }
361
- } else if (parentConfig.defaultProvider && !childConfig.defaultProvider) {
362
- childConfig.defaultProvider = parentConfig.defaultProvider;
363
- }
364
-
365
- // Start child cluster with text input (context from parent)
366
- const childCluster = await childOrchestrator.start(
367
- childConfig, // Child cluster config
368
- { text: context },
369
- { testMode: false, modelOverride: this.modelOverride || undefined }
370
- );
371
-
372
- // Create message bridge
373
- const bridge = new MessageBusBridge(this.messageBus, childCluster.messageBus, {
374
- parentClusterId: this.parentCluster.id,
375
- childClusterId: childId,
376
- parentTopics: this.config.contextStrategy?.parentTopics || [],
377
- });
378
-
379
- // Store child cluster state
380
- this.childCluster = {
381
- id: childId,
382
- orchestrator: childOrchestrator,
383
- messageBus: childCluster.messageBus,
384
- bridge,
385
- };
386
-
387
- // Listen for child cluster completion
388
- childCluster.messageBus.subscribe((message) => {
389
- if (message.topic === 'CLUSTER_COMPLETE' && message.cluster_id === childId) {
390
- this._onChildComplete(message).catch((err) => {
391
- console.error(`Failed to handle child completion: ${err.message}`);
392
- });
393
- }
394
- });
395
-
396
- // Listen for child cluster failure
397
- childCluster.messageBus.subscribe((message) => {
398
- if (message.topic === 'CLUSTER_FAILED' && message.cluster_id === childId) {
399
- this._onChildFailed(message).catch((err) => {
400
- console.error(`Failed to handle child failure: ${err.message}`);
401
- });
402
- }
403
- });
404
- }
405
-
406
- /**
407
- * Handle child cluster completion
408
- * @private
409
- */
410
- async _onChildComplete(message) {
411
- this._log(`[SubCluster ${this.id}] Child cluster completed`);
412
-
413
- this._publishLifecycle('CHILD_COMPLETE', {
414
- childClusterId: this.childClusterId,
415
- iteration: this.iteration,
416
- });
417
-
418
- // Execute onComplete hook
419
- await this._executeHook('onComplete', {
420
- result: message,
421
- triggeringMessage: null,
422
- });
423
-
424
- // Clean up child cluster
425
- await this._stopChildCluster();
426
-
427
- this.state = 'idle';
428
- }
429
-
430
- /**
431
- * Handle child cluster failure
432
- * @private
433
- */
434
- async _onChildFailed(message) {
435
- this._log(`[SubCluster ${this.id}] Child cluster failed`);
436
-
437
- this._publishLifecycle('CHILD_FAILED', {
438
- childClusterId: this.childClusterId,
439
- iteration: this.iteration,
440
- error: message.content?.data?.reason,
441
- });
442
-
443
- // Execute onError hook
444
- const error = new Error(message.content?.data?.reason || 'Child cluster failed');
445
- await this._executeHook('onError', { error, triggeringMessage: null });
446
-
447
- // Clean up child cluster
448
- await this._stopChildCluster();
449
-
450
- // Retry if within max iterations
451
- if (this.iteration < this.maxIterations) {
452
- this.state = 'idle';
453
- } else {
454
- this.state = 'failed';
455
- }
456
- }
457
-
458
- /**
459
- * Stop child cluster
460
- * @private
461
- */
462
- async _stopChildCluster() {
463
- if (!this.childCluster) {
464
- return;
465
- }
466
-
467
- // Close message bridge
468
- if (this.childCluster.bridge) {
469
- this.childCluster.bridge.close();
470
- }
471
-
472
- // Stop child orchestrator
473
- try {
474
- await this.childCluster.orchestrator.stop(this.childCluster.id);
475
- } catch (err) {
476
- console.warn(`Warning: Failed to stop child cluster ${this.childCluster.id}: ${err.message}`);
477
- }
478
-
479
- this.childCluster = null;
480
- this.childClusterId = null;
481
- }
482
-
483
- /**
484
- * Execute a hook
485
- * @private
486
- */
487
- _executeHook(hookName, context) {
488
- const hook = this.config.hooks?.[hookName];
489
- if (!hook) {
490
- return;
491
- }
492
-
493
- if (hook.action === 'publish_message') {
494
- const message = this._substituteTemplate(hook.config, context);
495
- this.messageBus.publish({
496
- cluster_id: this.parentCluster.id,
497
- sender: this.id,
498
- ...message,
499
- });
500
- } else {
501
- throw new Error(`Unknown hook action: ${hook.action}`);
502
- }
503
- }
504
-
505
- /**
506
- * Substitute template variables in hook config
507
- * @private
508
- */
509
- _substituteTemplate(config, context) {
510
- if (!config) {
511
- throw new Error('_substituteTemplate: config is required');
512
- }
513
-
514
- const json = JSON.stringify(config);
515
-
516
- let substituted = json
517
- .replace(/\{\{cluster\.id\}\}/g, this.parentCluster.id)
518
- .replace(/\{\{subcluster\.id\}\}/g, this.id)
519
- .replace(/\{\{child\.id\}\}/g, this.childClusterId || '')
520
- .replace(/\{\{iteration\}\}/g, String(this.iteration))
521
- .replace(/\{\{error\.message\}\}/g, context.error?.message || '');
522
-
523
- // Parse and validate
524
- let result;
525
- try {
526
- result = JSON.parse(substituted);
527
- } catch (e) {
528
- console.error('JSON parse failed. Substituted string:');
529
- console.error(substituted);
530
- throw new Error(`Template substitution produced invalid JSON: ${e.message}`);
531
- }
532
-
533
- return result;
534
- }
535
-
536
- /**
537
- * Resume sub-cluster task (not implemented for subclusters)
538
- */
539
- resume(_resumeContext) {
540
- throw new Error('Resume not implemented for subclusters');
541
- }
542
-
543
- /**
544
- * Get current sub-cluster state
545
- */
546
- getState() {
547
- return {
548
- id: this.id,
549
- role: this.role,
550
- state: this.state,
551
- iteration: this.iteration,
552
- maxIterations: this.maxIterations,
553
- type: 'subcluster',
554
- childClusterId: this.childClusterId,
555
- childRunning: this.childCluster !== null,
556
- };
557
- }
558
- }
559
-
560
- module.exports = SubClusterWrapper;
@@ -1,30 +0,0 @@
1
- /**
2
- * TaskRunner - Strategy Pattern interface for executing provider tasks
3
- *
4
- * Implementations must provide a `run()` method that executes a task
5
- * with the given context and options. Different runners can implement various
6
- * execution strategies (CLI, mock responses, etc).
7
- */
8
- class TaskRunner {
9
- /**
10
- * Execute a provider task with the given context and options
11
- *
12
- * @param {string} _context - Full prompt/context for the provider to process
13
- * @param {Object} _options - Execution options
14
- * @param {string} _options.agentId - Identifier for this agent/task
15
- * @param {string} _options.model - Model to use (provider-specific model id)
16
- * @param {string} [_options.provider] - Provider to use (claude|codex|gemini)
17
- * @param {object} [_options.modelSpec] - Resolved model spec (level/model/reasoningEffort)
18
- * @param {string} [_options.outputFormat] - Output format ('text', 'json', 'stream-json')
19
- * @param {Object} [_options.jsonSchema] - JSON schema for structured output validation
20
- * @param {string} [_options.cwd] - Working directory for task execution
21
- * @param {boolean} [_options.isolation] - Whether to run in isolated container
22
- *
23
- * @returns {Promise<{success: boolean, output: string, error: string|null, taskId?: string}>} Result object with success status, output, error message, and optional taskId
24
- */
25
- run(_context, _options) {
26
- throw new Error('TaskRunner.run() not implemented');
27
- }
28
- }
29
-
30
- module.exports = TaskRunner;