@covibes/zeroshot 5.3.0 → 5.4.0

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 (82) hide show
  1. package/README.md +94 -14
  2. package/cli/commands/providers.js +8 -9
  3. package/cli/index.js +3032 -2409
  4. package/cli/message-formatters-normal.js +28 -6
  5. package/cluster-templates/base-templates/debug-workflow.json +1 -1
  6. package/cluster-templates/base-templates/full-workflow.json +72 -188
  7. package/cluster-templates/base-templates/worker-validator.json +59 -3
  8. package/cluster-templates/conductor-bootstrap.json +4 -4
  9. package/lib/docker-config.js +8 -0
  10. package/lib/git-remote-utils.js +165 -0
  11. package/lib/id-detector.js +10 -7
  12. package/lib/provider-defaults.js +62 -0
  13. package/lib/provider-names.js +2 -1
  14. package/lib/settings/claude-auth.js +78 -0
  15. package/lib/settings.js +161 -63
  16. package/package.json +7 -2
  17. package/scripts/setup-merge-queue.sh +170 -0
  18. package/src/agent/agent-config.js +135 -82
  19. package/src/agent/agent-context-builder.js +297 -188
  20. package/src/agent/agent-hook-executor.js +310 -113
  21. package/src/agent/agent-lifecycle.js +385 -325
  22. package/src/agent/agent-stuck-detector.js +7 -7
  23. package/src/agent/agent-task-executor.js +824 -565
  24. package/src/agent/output-extraction.js +41 -24
  25. package/src/agent/output-reformatter.js +1 -1
  26. package/src/agent/schema-utils.js +108 -73
  27. package/src/agent-wrapper.js +10 -1
  28. package/src/agents/git-pusher-template.js +285 -0
  29. package/src/claude-task-runner.js +85 -34
  30. package/src/config-validator.js +922 -657
  31. package/src/input-helpers.js +65 -0
  32. package/src/isolation-manager.js +289 -199
  33. package/src/issue-providers/README.md +305 -0
  34. package/src/issue-providers/azure-devops-provider.js +273 -0
  35. package/src/issue-providers/base-provider.js +232 -0
  36. package/src/issue-providers/github-provider.js +179 -0
  37. package/src/issue-providers/gitlab-provider.js +241 -0
  38. package/src/issue-providers/index.js +196 -0
  39. package/src/issue-providers/jira-provider.js +239 -0
  40. package/src/ledger.js +22 -5
  41. package/src/lib/safe-exec.js +88 -0
  42. package/src/orchestrator.js +1107 -811
  43. package/src/preflight.js +313 -159
  44. package/src/process-metrics.js +98 -56
  45. package/src/providers/anthropic/cli-builder.js +53 -25
  46. package/src/providers/anthropic/index.js +72 -2
  47. package/src/providers/anthropic/output-parser.js +32 -14
  48. package/src/providers/base-provider.js +70 -0
  49. package/src/providers/capabilities.js +9 -0
  50. package/src/providers/google/output-parser.js +47 -38
  51. package/src/providers/index.js +19 -3
  52. package/src/providers/openai/cli-builder.js +14 -3
  53. package/src/providers/openai/index.js +1 -0
  54. package/src/providers/openai/output-parser.js +44 -30
  55. package/src/providers/opencode/cli-builder.js +42 -0
  56. package/src/providers/opencode/index.js +103 -0
  57. package/src/providers/opencode/models.js +55 -0
  58. package/src/providers/opencode/output-parser.js +122 -0
  59. package/src/schemas/sub-cluster.js +68 -39
  60. package/src/status-footer.js +94 -48
  61. package/src/sub-cluster-wrapper.js +76 -35
  62. package/src/template-resolver.js +12 -9
  63. package/src/tui/data-poller.js +123 -99
  64. package/src/tui/formatters.js +4 -3
  65. package/src/tui/keybindings.js +259 -318
  66. package/src/tui/renderer.js +11 -21
  67. package/task-lib/attachable-watcher.js +118 -81
  68. package/task-lib/claude-recovery.js +61 -24
  69. package/task-lib/commands/episodes.js +105 -0
  70. package/task-lib/commands/list.js +2 -2
  71. package/task-lib/commands/logs.js +231 -189
  72. package/task-lib/commands/schedules.js +111 -61
  73. package/task-lib/config.js +0 -2
  74. package/task-lib/runner.js +84 -27
  75. package/task-lib/scheduler.js +1 -1
  76. package/task-lib/store.js +467 -168
  77. package/task-lib/tui/formatters.js +94 -45
  78. package/task-lib/tui/renderer.js +13 -3
  79. package/task-lib/tui.js +73 -32
  80. package/task-lib/watcher.js +128 -90
  81. package/src/agents/git-pusher-agent.json +0 -20
  82. package/src/github.js +0 -139
package/src/github.js DELETED
@@ -1,139 +0,0 @@
1
- /**
2
- * GitHub - Fetch and parse GitHub issues
3
- *
4
- * Provides:
5
- * - Issue fetching via gh CLI
6
- * - Parsing of issue data into context
7
- * - Fallback to plain text input
8
- */
9
-
10
- const { execSync } = require('child_process');
11
- const fs = require('fs');
12
- const path = require('path');
13
-
14
- class GitHub {
15
- /**
16
- * Fetch GitHub issue by URL or number
17
- * @param {String} issueRef - Issue URL or number
18
- * @returns {Object} Parsed issue data
19
- */
20
- static fetchIssue(issueRef) {
21
- try {
22
- // Extract issue number from URL if needed
23
- const issueNumber = this._extractIssueNumber(issueRef);
24
-
25
- // Fetch issue using gh CLI
26
- const cmd = `gh issue view ${issueNumber} --json number,title,body,labels,assignees,comments,url`;
27
- const output = execSync(cmd, { encoding: 'utf8' });
28
- const issue = JSON.parse(output);
29
-
30
- return this._parseIssue(issue);
31
- } catch (error) {
32
- throw new Error(`Failed to fetch GitHub issue: ${error.message}`);
33
- }
34
- }
35
-
36
- /**
37
- * Extract issue number from URL or return as-is
38
- * @private
39
- */
40
- static _extractIssueNumber(issueRef) {
41
- // If it's a URL, extract the number
42
- const urlMatch = issueRef.match(/\/issues\/(\d+)/);
43
- if (urlMatch) {
44
- return urlMatch[1];
45
- }
46
-
47
- // Otherwise assume it's already a number
48
- return issueRef;
49
- }
50
-
51
- /**
52
- * Parse issue into structured context
53
- * @private
54
- */
55
- static _parseIssue(issue) {
56
- let context = `# GitHub Issue #${issue.number}\n\n`;
57
- context += `## Title\n${issue.title}\n\n`;
58
-
59
- if (issue.body) {
60
- context += `## Description\n${issue.body}\n\n`;
61
- }
62
-
63
- if (issue.labels && issue.labels.length > 0) {
64
- context += `## Labels\n`;
65
- context += issue.labels.map((l) => `- ${l.name}`).join('\n');
66
- context += '\n\n';
67
- }
68
-
69
- if (issue.comments && issue.comments.length > 0) {
70
- context += `## Comments\n\n`;
71
- for (const comment of issue.comments) {
72
- context += `### ${comment.author.login} (${new Date(comment.createdAt).toISOString()})\n`;
73
- context += `${comment.body}\n\n`;
74
- }
75
- }
76
-
77
- return {
78
- number: issue.number,
79
- title: issue.title,
80
- body: issue.body,
81
- labels: issue.labels || [],
82
- comments: issue.comments || [],
83
- url: issue.url || null,
84
- context,
85
- };
86
- }
87
-
88
- /**
89
- * Create a plain text input wrapper
90
- * @param {String} text - Plain text input
91
- * @returns {Object} Structured context
92
- */
93
- static createTextInput(text) {
94
- return {
95
- number: null,
96
- title: 'Manual Input',
97
- body: text,
98
- labels: [],
99
- comments: [],
100
- context: `# Manual Input\n\n${text}\n`,
101
- };
102
- }
103
-
104
- /**
105
- * Create input from markdown file
106
- * @param {String} filePath - Path to markdown file (.md or .markdown)
107
- * @returns {Object} Structured context matching _parseIssue format
108
- */
109
- static createFileInput(filePath) {
110
- // Resolve relative paths
111
- const resolvedPath = path.resolve(filePath);
112
-
113
- // Validate file exists
114
- if (!fs.existsSync(resolvedPath)) {
115
- throw new Error(`File not found: ${filePath}`);
116
- }
117
-
118
- // Read file content
119
- const fileContent = fs.readFileSync(resolvedPath, 'utf8');
120
-
121
- // Extract title from first header or use filename
122
- const headerMatch = fileContent.match(/^#\s+(.+)$/m);
123
- const extractedTitle = headerMatch ? headerMatch[1].trim() : null;
124
- const fallbackTitle = path.basename(filePath, path.extname(filePath));
125
- const title = extractedTitle || fallbackTitle;
126
-
127
- return {
128
- number: null,
129
- title,
130
- body: fileContent,
131
- labels: [],
132
- comments: [],
133
- url: null,
134
- context: `# ${title}\n\n${fileContent}\n`,
135
- };
136
- }
137
- }
138
-
139
- module.exports = GitHub;