@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,129 +0,0 @@
1
- function safeJsonParse(value, fallback) {
2
- try {
3
- return JSON.parse(value);
4
- } catch {
5
- return fallback;
6
- }
7
- }
8
-
9
- function parseItem(item) {
10
- const events = [];
11
-
12
- // Handle assistant messages (Claude-style: type=message, role=assistant)
13
- if (item.type === 'message' && item.role === 'assistant') {
14
- const content = Array.isArray(item.content)
15
- ? item.content
16
- : [{ type: 'text', text: item.content }];
17
- const text = content
18
- .filter((c) => c.type === 'text')
19
- .map((c) => c.text)
20
- .join('');
21
- const thinking = content
22
- .filter((c) => c.type === 'thinking' || c.type === 'reasoning')
23
- .map((c) => c.text)
24
- .join('');
25
- if (text) events.push({ type: 'text', text });
26
- if (thinking) events.push({ type: 'thinking', text: thinking });
27
- }
28
-
29
- // Handle agent messages (Codex-style: type=agent_message, text=string)
30
- if (item.type === 'agent_message' && item.text) {
31
- events.push({ type: 'text', text: item.text });
32
- }
33
-
34
- if (item.type === 'function_call') {
35
- const toolId = item.call_id || item.id || item.tool_call_id || item.tool_id;
36
- const args =
37
- typeof item.arguments === 'string' ? safeJsonParse(item.arguments, {}) : item.arguments || {};
38
- events.push({
39
- type: 'tool_call',
40
- toolName: item.name,
41
- toolId,
42
- input: args,
43
- });
44
- }
45
-
46
- if (item.type === 'function_call_output') {
47
- const toolId = item.call_id || item.id || item.tool_call_id || item.tool_id;
48
- const content = item.output ?? item.result ?? item.content ?? '';
49
- events.push({
50
- type: 'tool_result',
51
- toolId,
52
- content,
53
- isError: !!item.error,
54
- });
55
- }
56
-
57
- if (events.length === 1) return events[0];
58
- if (events.length > 1) return events;
59
- return null;
60
- }
61
-
62
- function parseEvent(line, options = {}) {
63
- let event;
64
- try {
65
- event = JSON.parse(line);
66
- } catch {
67
- return null;
68
- }
69
-
70
- switch (event.type) {
71
- case 'thread.started':
72
- case 'turn.started':
73
- return null;
74
-
75
- case 'item.created':
76
- case 'item.completed':
77
- return parseItem(event.item);
78
-
79
- case 'turn.completed': {
80
- const usage = event.usage || event.response?.usage || {};
81
- return {
82
- type: 'result',
83
- success: true,
84
- inputTokens: usage.input_tokens || 0,
85
- outputTokens: usage.output_tokens || 0,
86
- };
87
- }
88
-
89
- case 'turn.failed':
90
- return {
91
- type: 'result',
92
- success: false,
93
- error: event.error?.message || event.error || 'Turn failed',
94
- };
95
-
96
- default:
97
- // Only log warnings for actual unknown string types, not malformed events
98
- // (undefined/object types are just noise from non-standard CLI output)
99
- if (options.onUnknown && typeof event.type === 'string') {
100
- options.onUnknown(event.type, event);
101
- }
102
- return null;
103
- }
104
- }
105
-
106
- function parseChunk(chunk, options = {}) {
107
- const events = [];
108
- const lines = chunk.split('\n');
109
-
110
- for (const line of lines) {
111
- if (!line.trim()) continue;
112
- const event = parseEvent(line, options);
113
- if (!event) continue;
114
- if (Array.isArray(event)) {
115
- events.push(...event);
116
- } else {
117
- events.push(event);
118
- }
119
- }
120
-
121
- return events;
122
- }
123
-
124
- module.exports = {
125
- parseEvent,
126
- parseChunk,
127
- parseItem,
128
- safeJsonParse,
129
- };
@@ -1,156 +0,0 @@
1
- /**
2
- * Sub-Cluster Schema
3
- *
4
- * Defines the structure for nested clusters where an agent can be replaced
5
- * with an entire cluster configuration, enabling recursive composition.
6
- *
7
- * Example:
8
- * {
9
- * "id": "implementation-cluster",
10
- * "type": "subcluster",
11
- * "config": {
12
- * "agents": [
13
- * { "id": "worker", "role": "implementation", ... },
14
- * { "id": "validator", "role": "validator", ... }
15
- * ]
16
- * },
17
- * "triggers": [{ "topic": "PLAN_READY" }],
18
- * "hooks": {
19
- * "onComplete": {
20
- * "action": "publish_message",
21
- * "config": { "topic": "IMPLEMENTATION_COMPLETE" }
22
- * }
23
- * }
24
- * }
25
- */
26
-
27
- /**
28
- * Validate sub-cluster agent configuration
29
- * @param {Object} agentConfig - Agent config with type: 'subcluster'
30
- * @param {Number} depth - Current nesting depth (for recursion limit)
31
- * @returns {{ valid: boolean, errors: string[], warnings: string[] }}
32
- */
33
- function validateSubCluster(agentConfig, depth = 0) {
34
- const errors = [];
35
- const warnings = [];
36
-
37
- // Max nesting depth to prevent infinite recursion
38
- const MAX_DEPTH = 5;
39
-
40
- if (depth > MAX_DEPTH) {
41
- errors.push(`Sub-cluster '${agentConfig.id}' exceeds max nesting depth (${MAX_DEPTH})`);
42
- return { valid: false, errors, warnings };
43
- }
44
-
45
- // Validate required fields
46
- if (agentConfig.type !== 'subcluster') {
47
- errors.push(`Agent '${agentConfig.id}' must have type: 'subcluster'`);
48
- }
49
-
50
- if (!agentConfig.config) {
51
- errors.push(`Sub-cluster '${agentConfig.id}' missing config field`);
52
- return { valid: false, errors, warnings };
53
- }
54
-
55
- if (!agentConfig.config.agents || !Array.isArray(agentConfig.config.agents)) {
56
- errors.push(`Sub-cluster '${agentConfig.id}' config.agents must be an array`);
57
- return { valid: false, errors, warnings };
58
- }
59
-
60
- if (agentConfig.config.agents.length === 0) {
61
- errors.push(`Sub-cluster '${agentConfig.id}' config.agents cannot be empty`);
62
- return { valid: false, errors, warnings };
63
- }
64
-
65
- // Recursively validate nested cluster config
66
- const configValidator = require('../config-validator');
67
- const childValidation = configValidator.validateConfig(agentConfig.config, depth + 1);
68
-
69
- if (!childValidation.valid) {
70
- errors.push(...childValidation.errors.map((e) => `Sub-cluster '${agentConfig.id}': ${e}`));
71
- }
72
-
73
- warnings.push(...childValidation.warnings.map((w) => `Sub-cluster '${agentConfig.id}': ${w}`));
74
-
75
- // Validate triggers (sub-cluster must have triggers to activate)
76
- if (!agentConfig.triggers || agentConfig.triggers.length === 0) {
77
- errors.push(`Sub-cluster '${agentConfig.id}' must have triggers to activate`);
78
- }
79
-
80
- // Validate hooks structure
81
- if (agentConfig.hooks) {
82
- if (agentConfig.hooks.onComplete) {
83
- const hook = agentConfig.hooks.onComplete;
84
- if (!hook.action) {
85
- errors.push(`Sub-cluster '${agentConfig.id}' onComplete hook missing action`);
86
- }
87
- if (hook.action === 'publish_message' && !hook.config?.topic) {
88
- errors.push(`Sub-cluster '${agentConfig.id}' onComplete hook missing config.topic`);
89
- }
90
- }
91
- }
92
-
93
- // Check for context bridging configuration
94
- if (agentConfig.contextStrategy?.parentTopics) {
95
- if (!Array.isArray(agentConfig.contextStrategy.parentTopics)) {
96
- errors.push(`Sub-cluster '${agentConfig.id}' contextStrategy.parentTopics must be an array`);
97
- } else {
98
- // Validate each parent topic is a string
99
- for (const topic of agentConfig.contextStrategy.parentTopics) {
100
- if (typeof topic !== 'string') {
101
- errors.push(
102
- `Sub-cluster '${agentConfig.id}' parentTopics must contain strings, got ${typeof topic}`
103
- );
104
- }
105
- }
106
- }
107
- }
108
-
109
- return {
110
- valid: errors.length === 0,
111
- errors,
112
- warnings,
113
- };
114
- }
115
-
116
- /**
117
- * Get default sub-cluster template
118
- * @returns {Object} Default sub-cluster configuration
119
- */
120
- function getDefaultSubCluster() {
121
- return {
122
- id: 'example-subcluster',
123
- type: 'subcluster',
124
- role: 'orchestrator',
125
- config: {
126
- agents: [
127
- {
128
- id: 'worker',
129
- role: 'implementation',
130
- triggers: [{ topic: 'PARENT_TRIGGER' }],
131
- hooks: {
132
- onComplete: {
133
- action: 'publish_message',
134
- config: { topic: 'WORK_COMPLETE' },
135
- },
136
- },
137
- },
138
- ],
139
- },
140
- triggers: [{ topic: 'START_WORK' }],
141
- hooks: {
142
- onComplete: {
143
- action: 'publish_message',
144
- config: { topic: 'SUBCLUSTER_COMPLETE' },
145
- },
146
- },
147
- contextStrategy: {
148
- parentTopics: ['ISSUE_OPENED', 'PLAN_READY'],
149
- },
150
- };
151
- }
152
-
153
- module.exports = {
154
- validateSubCluster,
155
- getDefaultSubCluster,
156
- };