@covibes/zeroshot 5.4.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 (136) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +8 -465
  3. package/cli/index.js +101 -5231
  4. package/package.json +16 -130
  5. package/CHANGELOG.md +0 -537
  6. package/cli/commands/providers.js +0 -149
  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 -275
  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 -581
  14. package/cluster-templates/base-templates/single-worker.json +0 -63
  15. package/cluster-templates/base-templates/worker-validator.json +0 -208
  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 -220
  21. package/lib/git-remote-utils.js +0 -165
  22. package/lib/id-detector.js +0 -56
  23. package/lib/provider-defaults.js +0 -62
  24. package/lib/provider-detection.js +0 -59
  25. package/lib/provider-names.js +0 -57
  26. package/lib/settings/claude-auth.js +0 -78
  27. package/lib/settings.js +0 -503
  28. package/lib/stream-json-parser.js +0 -10
  29. package/scripts/fix-node-pty-permissions.js +0 -75
  30. package/scripts/record-demo.sh +0 -279
  31. package/scripts/setup-merge-queue.sh +0 -170
  32. package/scripts/test-install.sh +0 -40
  33. package/scripts/validate-templates.js +0 -100
  34. package/src/agent/agent-config.js +0 -246
  35. package/src/agent/agent-context-builder.js +0 -444
  36. package/src/agent/agent-hook-executor.js +0 -599
  37. package/src/agent/agent-lifecycle.js +0 -743
  38. package/src/agent/agent-stuck-detector.js +0 -256
  39. package/src/agent/agent-task-executor.js +0 -1690
  40. package/src/agent/agent-trigger-evaluator.js +0 -67
  41. package/src/agent/output-extraction.js +0 -217
  42. package/src/agent/output-reformatter.js +0 -175
  43. package/src/agent/schema-utils.js +0 -146
  44. package/src/agent-wrapper.js +0 -579
  45. package/src/agents/git-pusher-template.js +0 -285
  46. package/src/attach/attach-client.js +0 -438
  47. package/src/attach/attach-server.js +0 -543
  48. package/src/attach/index.js +0 -35
  49. package/src/attach/protocol.js +0 -220
  50. package/src/attach/ring-buffer.js +0 -121
  51. package/src/attach/socket-discovery.js +0 -267
  52. package/src/claude-task-runner.js +0 -574
  53. package/src/config-router.js +0 -80
  54. package/src/config-validator.js +0 -1925
  55. package/src/copy-worker.js +0 -43
  56. package/src/input-helpers.js +0 -65
  57. package/src/isolation-manager.js +0 -1471
  58. package/src/issue-providers/README.md +0 -305
  59. package/src/issue-providers/azure-devops-provider.js +0 -273
  60. package/src/issue-providers/base-provider.js +0 -232
  61. package/src/issue-providers/github-provider.js +0 -179
  62. package/src/issue-providers/gitlab-provider.js +0 -241
  63. package/src/issue-providers/index.js +0 -196
  64. package/src/issue-providers/jira-provider.js +0 -239
  65. package/src/ledger.js +0 -631
  66. package/src/lib/safe-exec.js +0 -88
  67. package/src/logic-engine.js +0 -223
  68. package/src/message-bus-bridge.js +0 -139
  69. package/src/message-bus.js +0 -249
  70. package/src/name-generator.js +0 -232
  71. package/src/orchestrator.js +0 -2815
  72. package/src/preflight.js +0 -639
  73. package/src/process-metrics.js +0 -608
  74. package/src/providers/anthropic/cli-builder.js +0 -73
  75. package/src/providers/anthropic/index.js +0 -204
  76. package/src/providers/anthropic/models.js +0 -23
  77. package/src/providers/anthropic/output-parser.js +0 -177
  78. package/src/providers/base-provider.js +0 -251
  79. package/src/providers/capabilities.js +0 -60
  80. package/src/providers/google/cli-builder.js +0 -55
  81. package/src/providers/google/index.js +0 -116
  82. package/src/providers/google/models.js +0 -24
  83. package/src/providers/google/output-parser.js +0 -101
  84. package/src/providers/index.js +0 -91
  85. package/src/providers/openai/cli-builder.js +0 -133
  86. package/src/providers/openai/index.js +0 -136
  87. package/src/providers/openai/models.js +0 -21
  88. package/src/providers/openai/output-parser.js +0 -143
  89. package/src/providers/opencode/cli-builder.js +0 -42
  90. package/src/providers/opencode/index.js +0 -103
  91. package/src/providers/opencode/models.js +0 -55
  92. package/src/providers/opencode/output-parser.js +0 -122
  93. package/src/schemas/sub-cluster.js +0 -185
  94. package/src/status-footer.js +0 -1026
  95. package/src/sub-cluster-wrapper.js +0 -601
  96. package/src/task-runner.js +0 -30
  97. package/src/template-resolver.js +0 -372
  98. package/src/tui/CHANGES.txt +0 -133
  99. package/src/tui/LAYOUT.md +0 -261
  100. package/src/tui/README.txt +0 -192
  101. package/src/tui/TWO-LEVEL-NAVIGATION.md +0 -186
  102. package/src/tui/data-poller.js +0 -349
  103. package/src/tui/demo.js +0 -208
  104. package/src/tui/formatters.js +0 -129
  105. package/src/tui/index.js +0 -193
  106. package/src/tui/keybindings.js +0 -324
  107. package/src/tui/layout.js +0 -334
  108. package/src/tui/renderer.js +0 -184
  109. package/task-lib/attachable-watcher.js +0 -309
  110. package/task-lib/claude-recovery.js +0 -156
  111. package/task-lib/commands/clean.js +0 -50
  112. package/task-lib/commands/episodes.js +0 -105
  113. package/task-lib/commands/get-log-path.js +0 -23
  114. package/task-lib/commands/kill.js +0 -32
  115. package/task-lib/commands/list.js +0 -105
  116. package/task-lib/commands/logs.js +0 -453
  117. package/task-lib/commands/resume.js +0 -42
  118. package/task-lib/commands/run.js +0 -57
  119. package/task-lib/commands/schedule.js +0 -105
  120. package/task-lib/commands/scheduler-cmd.js +0 -96
  121. package/task-lib/commands/schedules.js +0 -148
  122. package/task-lib/commands/status.js +0 -44
  123. package/task-lib/commands/unschedule.js +0 -16
  124. package/task-lib/completion.js +0 -9
  125. package/task-lib/config.js +0 -8
  126. package/task-lib/name-generator.js +0 -230
  127. package/task-lib/package.json +0 -3
  128. package/task-lib/runner.js +0 -201
  129. package/task-lib/scheduler.js +0 -252
  130. package/task-lib/store.js +0 -529
  131. package/task-lib/tui/formatters.js +0 -215
  132. package/task-lib/tui/index.js +0 -197
  133. package/task-lib/tui/layout.js +0 -111
  134. package/task-lib/tui/renderer.js +0 -129
  135. package/task-lib/tui.js +0 -425
  136. package/task-lib/watcher.js +0 -226
@@ -1,196 +0,0 @@
1
- /**
2
- * Issue Provider Registry
3
- *
4
- * Manages issue provider registration and auto-detection
5
- */
6
-
7
- const GitHubProvider = require('./github-provider');
8
- const GitLabProvider = require('./gitlab-provider');
9
- const JiraProvider = require('./jira-provider');
10
- const AzureDevOpsProvider = require('./azure-devops-provider');
11
- const { detectGitContext } = require('../../lib/git-remote-utils');
12
-
13
- /** @type {Map<string, typeof IssueProvider>} */
14
- const providers = new Map();
15
-
16
- /**
17
- * Register a provider class
18
- * @param {typeof IssueProvider} ProviderClass
19
- */
20
- function registerProvider(ProviderClass) {
21
- if (!ProviderClass.id) {
22
- throw new Error(`Provider ${ProviderClass.name} must define static id property`);
23
- }
24
- providers.set(ProviderClass.id, ProviderClass);
25
- }
26
-
27
- /**
28
- * Detect which provider matches the input
29
- * Automatically detects provider from git remote when in a git repository
30
- *
31
- * @param {string} input - User input (URL, issue key, number)
32
- * @param {Object} settings - User settings
33
- * @param {string|null} forceProvider - Force specific provider (from CLI flag)
34
- * @param {Object|null|undefined} [gitContextOverride] - Override git context (for testing)
35
- * - undefined: auto-detect from git remote (default)
36
- * - null: explicitly no git context
37
- * - object: use provided git context
38
- * @returns {typeof IssueProvider|null}
39
- */
40
- function detectProvider(input, settings, forceProvider = null, gitContextOverride = undefined) {
41
- // Force flag takes precedence
42
- if (forceProvider) {
43
- return providers.get(forceProvider) || null;
44
- }
45
-
46
- // Use provided gitContext or auto-detect
47
- const gitContext = gitContextOverride === undefined ? detectGitContext() : gitContextOverride;
48
-
49
- // Auto-detect by checking each provider's detectIdentifier
50
- for (const ProviderClass of providers.values()) {
51
- if (ProviderClass.detectIdentifier(input, settings, gitContext)) {
52
- return ProviderClass;
53
- }
54
- }
55
-
56
- return null;
57
- }
58
-
59
- /**
60
- * Get provider class by ID
61
- * @param {string} providerId - Provider identifier
62
- * @returns {typeof IssueProvider|null}
63
- */
64
- function getProvider(providerId) {
65
- return providers.get(providerId) || null;
66
- }
67
-
68
- /**
69
- * List all registered provider IDs
70
- * @returns {string[]}
71
- */
72
- function listProviders() {
73
- return Array.from(providers.keys());
74
- }
75
-
76
- /**
77
- * List providers that support PR/MR creation
78
- * @returns {string[]}
79
- */
80
- function listPRProviders() {
81
- return Array.from(providers.values())
82
- .filter((p) => p.supportsPR())
83
- .map((p) => p.id);
84
- }
85
-
86
- /**
87
- * Determine which git platform to create PR/MR on.
88
- * ALWAYS uses git remote context, NEVER the issue provider.
89
- *
90
- * This is the unified replacement for platform-detector.js
91
- *
92
- * @param {string} [cwd=process.cwd()] - Working directory
93
- * @returns {string} Platform ID ('github', 'gitlab', 'azure-devops')
94
- * @throws {Error} If platform cannot be determined or doesn't support PRs
95
- *
96
- * @example
97
- * // In a GitHub repo
98
- * getPlatformForPR() // → 'github'
99
- *
100
- * @example
101
- * // In a GitLab repo with Jira issue
102
- * getPlatformForPR() // → 'gitlab' (creates GitLab MR, not related to Jira)
103
- */
104
- function getPlatformForPR(cwd = process.cwd()) {
105
- const gitContext = detectGitContext(cwd);
106
-
107
- if (!gitContext?.provider) {
108
- throw new Error(
109
- 'Cannot determine git platform for --pr mode. ' +
110
- 'Ensure you are in a git repository with a remote URL from GitHub, GitLab, or Azure DevOps.'
111
- );
112
- }
113
-
114
- const platform = gitContext.provider;
115
- const ProviderClass = providers.get(platform);
116
-
117
- if (!ProviderClass || !ProviderClass.supportsPR()) {
118
- const supported = listPRProviders().join(', ');
119
- throw new Error(
120
- `Platform '${platform}' does not support --pr mode. Supported platforms: ${supported}`
121
- );
122
- }
123
-
124
- return platform;
125
- }
126
-
127
- /**
128
- * Get PR tool info for a platform
129
- * @param {string} platform - Platform ID
130
- * @returns {{ name: string, checkCmd: string, installHint: string, displayName: string }|null}
131
- */
132
- function getPRToolForPlatform(platform) {
133
- const ProviderClass = providers.get(platform);
134
- return ProviderClass?.getPRTool() || null;
135
- }
136
-
137
- /**
138
- * Get aggregated settings schema from all issue providers
139
- * @returns {Object.<string, Object>} Combined settings schema
140
- */
141
- function getIssueProviderSettingsSchema() {
142
- const schema = {};
143
- for (const ProviderClass of providers.values()) {
144
- Object.assign(schema, ProviderClass.getSettingsSchema());
145
- }
146
- return schema;
147
- }
148
-
149
- /**
150
- * Get default values for all issue provider settings
151
- * @returns {Object.<string, any>} Default values keyed by setting name
152
- */
153
- function getIssueProviderSettingsDefaults() {
154
- const defaults = {};
155
- const schema = getIssueProviderSettingsSchema();
156
- for (const [key, config] of Object.entries(schema)) {
157
- defaults[key] = config.default;
158
- }
159
- return defaults;
160
- }
161
-
162
- /**
163
- * Validate an issue provider setting
164
- * Delegates to the appropriate provider's validateSetting method
165
- * @param {string} key - Setting key
166
- * @param {any} value - Setting value
167
- * @returns {string|null|undefined} Error message if invalid, null if valid, undefined if not an issue provider setting
168
- */
169
- function validateIssueProviderSetting(key, value) {
170
- for (const ProviderClass of providers.values()) {
171
- const result = ProviderClass.validateSetting(key, value);
172
- if (result !== undefined) {
173
- return result;
174
- }
175
- }
176
- return undefined; // Not an issue provider setting
177
- }
178
-
179
- // Auto-register providers on module load
180
- registerProvider(GitHubProvider);
181
- registerProvider(GitLabProvider);
182
- registerProvider(JiraProvider);
183
- registerProvider(AzureDevOpsProvider);
184
-
185
- module.exports = {
186
- registerProvider,
187
- detectProvider,
188
- getProvider,
189
- listProviders,
190
- listPRProviders,
191
- getPlatformForPR,
192
- getPRToolForPlatform,
193
- getIssueProviderSettingsSchema,
194
- getIssueProviderSettingsDefaults,
195
- validateIssueProviderSetting,
196
- };
@@ -1,239 +0,0 @@
1
- /**
2
- * Jira Provider - Fetch issues from Jira via jira CLI (go-jira)
3
- * Supports both Jira Cloud (*.atlassian.net) and self-hosted (Server/Data Center)
4
- */
5
-
6
- const IssueProvider = require('./base-provider');
7
- const { execSync } = require('../lib/safe-exec');
8
-
9
- class JiraProvider extends IssueProvider {
10
- static id = 'jira';
11
- static displayName = 'Jira';
12
-
13
- /**
14
- * Detect Jira issue keys and URLs
15
- * Matches:
16
- * - Jira Cloud URLs (*.atlassian.net)
17
- * - Self-hosted Jira URLs (via jiraInstance setting)
18
- * - Jira issue keys (KEY-123 format)
19
- * - Bare numbers when defaultIssueSource=jira (requires jiraProject setting)
20
- *
21
- * Note: Jira doesn't use git context since it's not a git hosting platform.
22
- * Git context will never match 'jira', so this provider only activates via
23
- * explicit Jira URLs, Jira issue keys, or settings.
24
- *
25
- * @param {string} input - Issue identifier (URL, key, or number)
26
- * @param {Object} settings - User settings
27
- * @param {Object|null} gitContext - Git context (unused for Jira, but kept for API consistency)
28
- * @returns {boolean} True if this provider should handle the input
29
- */
30
- static detectIdentifier(input, settings, gitContext = null) {
31
- // Jira Cloud URLs
32
- if (/atlassian\.net\/browse\/[A-Z][A-Z0-9]+-\d+/.test(input)) {
33
- return true;
34
- }
35
-
36
- // Self-hosted Jira URLs
37
- if (
38
- settings.jiraInstance &&
39
- input.includes(settings.jiraInstance) &&
40
- /\/browse\/[A-Z][A-Z0-9]+-\d+/.test(input)
41
- ) {
42
- return true;
43
- }
44
-
45
- // Jira issue key pattern (KEY-123)
46
- if (/^[A-Z][A-Z0-9]+-\d+$/.test(input)) {
47
- return true;
48
- }
49
-
50
- // Bare numbers - use shared priority cascade logic
51
- // Jira requires jiraProject setting to convert bare numbers to issue keys
52
- // Note: gitContext check will never match 'jira' since Jira isn't a git host
53
- return IssueProvider.detectBareNumber(input, settings, gitContext, 'jira', {
54
- requiredSettings: ['jiraProject'],
55
- });
56
- }
57
-
58
- static getRequiredTool() {
59
- return {
60
- name: 'jira',
61
- checkCmd: 'jira version',
62
- installHint: 'Install jira-cli: brew install go-jira (or https://github.com/go-jira/jira)',
63
- };
64
- }
65
-
66
- /**
67
- * Check jira CLI authentication
68
- * go-jira uses config files (~/.jira.d/) rather than explicit auth commands
69
- */
70
- static checkAuth() {
71
- try {
72
- // go-jira uses 'jira session' to verify authentication
73
- // If not configured, it fails with endpoint/login errors
74
- execSync('jira session', { encoding: 'utf8', stdio: 'pipe', timeout: 5000 });
75
- return { authenticated: true, error: null, recovery: [] };
76
- } catch (err) {
77
- const stderr = err.stderr || err.message || '';
78
-
79
- // go-jira has various error patterns for auth issues
80
- if (
81
- stderr.includes('endpoint') ||
82
- stderr.includes('login') ||
83
- stderr.includes('authentication') ||
84
- stderr.includes('401')
85
- ) {
86
- return {
87
- authenticated: false,
88
- error: 'Jira CLI not configured',
89
- recovery: [
90
- 'Create ~/.jira.d/config.yml with your Jira endpoint',
91
- 'See: https://github.com/go-jira/jira#configuration',
92
- 'Example config:\n endpoint: https://yourcompany.atlassian.net\n login: your-email@company.com',
93
- 'Then verify: jira session',
94
- ],
95
- };
96
- }
97
-
98
- // If command just doesn't exist or times out, it's likely not configured
99
- if (stderr.includes('command not found') || stderr.includes('ETIMEDOUT')) {
100
- return {
101
- authenticated: false,
102
- error: 'Jira CLI not configured',
103
- recovery: [
104
- 'Configure ~/.jira.d/config.yml',
105
- 'See: https://github.com/go-jira/jira#configuration',
106
- ],
107
- };
108
- }
109
-
110
- // Default: assume not authenticated
111
- return {
112
- authenticated: false,
113
- error: stderr.trim() || 'Jira CLI not configured or authentication failed',
114
- recovery: [
115
- 'Create ~/.jira.d/config.yml with your Jira endpoint',
116
- 'See: https://github.com/go-jira/jira#configuration',
117
- ],
118
- };
119
- }
120
- }
121
-
122
- /**
123
- * Jira-specific settings schema
124
- */
125
- static getSettingsSchema() {
126
- return {
127
- jiraInstance: {
128
- type: 'string',
129
- nullable: true,
130
- default: null,
131
- description: "Self-hosted Jira URL (e.g., 'jira.company.com')",
132
- },
133
- jiraProject: {
134
- type: 'string',
135
- nullable: true,
136
- default: null,
137
- description: "Default Jira project key for bare numbers (e.g., 'PROJ')",
138
- pattern: /^[A-Z][A-Z0-9]*$/,
139
- patternMsg: 'jiraProject must be a valid Jira project key (e.g., PROJ, ABC)',
140
- },
141
- };
142
- }
143
-
144
- fetchIssue(identifier, settings) {
145
- try {
146
- const issueKey = this._extractIssueKey(identifier, settings);
147
-
148
- // Fetch issue using jira CLI
149
- const cmd = `jira issue view ${issueKey} --template json`;
150
- const output = execSync(cmd, { encoding: 'utf8' });
151
- const issue = JSON.parse(output);
152
-
153
- return this._parseIssue(issue);
154
- } catch (error) {
155
- throw new Error(`Failed to fetch Jira issue: ${error.message}`);
156
- }
157
- }
158
-
159
- /**
160
- * Extract Jira issue key from URL or return as-is
161
- * @private
162
- */
163
- _extractIssueKey(identifier, settings) {
164
- // URL format: https://company.atlassian.net/browse/KEY-123
165
- const urlMatch = identifier.match(/\/browse\/([A-Z][A-Z0-9]+-\d+)/);
166
- if (urlMatch) {
167
- return urlMatch[1];
168
- }
169
-
170
- // Bare number: construct from jiraProject setting
171
- if (/^\d+$/.test(identifier) && settings.jiraProject) {
172
- return `${settings.jiraProject}-${identifier}`;
173
- }
174
-
175
- // Assume it's already a key
176
- return identifier;
177
- }
178
-
179
- /**
180
- * Parse Jira issue into standardized InputData format
181
- * @private
182
- */
183
- _parseIssue(issue) {
184
- const fields = issue.fields || {};
185
- const key = issue.key;
186
- const summary = fields.summary || '';
187
- const description = fields.description || '';
188
- const labels = fields.labels || [];
189
- const comments = fields.comment?.comments || [];
190
-
191
- let context = `# Jira Issue ${key}\n\n`;
192
- context += `## Title\n${summary}\n\n`;
193
-
194
- if (description) {
195
- context += `## Description\n${description}\n\n`;
196
- }
197
-
198
- if (labels.length > 0) {
199
- context += `## Labels\n`;
200
- context += labels.map((l) => `- ${l}`).join('\n');
201
- context += '\n\n';
202
- }
203
-
204
- if (comments.length > 0) {
205
- context += `## Comments\n\n`;
206
- for (const comment of comments) {
207
- const author = comment.author?.displayName || comment.author?.name || 'unknown';
208
- context += `### ${author} (${comment.created})\n`;
209
- context += `${comment.body}\n\n`;
210
- }
211
- }
212
-
213
- // Map Jira labels to GitHub format
214
- const mappedLabels = labels.map((name) => ({ name }));
215
-
216
- // Map Jira comments to GitHub format
217
- const mappedComments = comments.map((comment) => ({
218
- author: { login: comment.author?.displayName || comment.author?.name || 'unknown' },
219
- createdAt: comment.created,
220
- body: comment.body,
221
- }));
222
-
223
- // Extract issue number from key (KEY-123 → 123)
224
- const numberMatch = key.match(/-(\d+)$/);
225
- const number = numberMatch ? parseInt(numberMatch[1], 10) : null;
226
-
227
- return {
228
- number,
229
- title: summary,
230
- body: description,
231
- labels: mappedLabels,
232
- comments: mappedComments,
233
- url: fields.self || null,
234
- context,
235
- };
236
- }
237
- }
238
-
239
- module.exports = JiraProvider;