@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.
- package/README.md +94 -14
- package/cli/commands/providers.js +8 -9
- package/cli/index.js +3032 -2409
- package/cli/message-formatters-normal.js +28 -6
- package/cluster-templates/base-templates/debug-workflow.json +1 -1
- package/cluster-templates/base-templates/full-workflow.json +72 -188
- package/cluster-templates/base-templates/worker-validator.json +59 -3
- package/cluster-templates/conductor-bootstrap.json +4 -4
- package/lib/docker-config.js +8 -0
- package/lib/git-remote-utils.js +165 -0
- package/lib/id-detector.js +10 -7
- package/lib/provider-defaults.js +62 -0
- package/lib/provider-names.js +2 -1
- package/lib/settings/claude-auth.js +78 -0
- package/lib/settings.js +161 -63
- package/package.json +7 -2
- package/scripts/setup-merge-queue.sh +170 -0
- package/src/agent/agent-config.js +135 -82
- package/src/agent/agent-context-builder.js +297 -188
- package/src/agent/agent-hook-executor.js +310 -113
- package/src/agent/agent-lifecycle.js +385 -325
- package/src/agent/agent-stuck-detector.js +7 -7
- package/src/agent/agent-task-executor.js +824 -565
- package/src/agent/output-extraction.js +41 -24
- package/src/agent/output-reformatter.js +1 -1
- package/src/agent/schema-utils.js +108 -73
- package/src/agent-wrapper.js +10 -1
- package/src/agents/git-pusher-template.js +285 -0
- package/src/claude-task-runner.js +85 -34
- package/src/config-validator.js +922 -657
- package/src/input-helpers.js +65 -0
- package/src/isolation-manager.js +289 -199
- package/src/issue-providers/README.md +305 -0
- package/src/issue-providers/azure-devops-provider.js +273 -0
- package/src/issue-providers/base-provider.js +232 -0
- package/src/issue-providers/github-provider.js +179 -0
- package/src/issue-providers/gitlab-provider.js +241 -0
- package/src/issue-providers/index.js +196 -0
- package/src/issue-providers/jira-provider.js +239 -0
- package/src/ledger.js +22 -5
- package/src/lib/safe-exec.js +88 -0
- package/src/orchestrator.js +1107 -811
- package/src/preflight.js +313 -159
- package/src/process-metrics.js +98 -56
- package/src/providers/anthropic/cli-builder.js +53 -25
- package/src/providers/anthropic/index.js +72 -2
- package/src/providers/anthropic/output-parser.js +32 -14
- package/src/providers/base-provider.js +70 -0
- package/src/providers/capabilities.js +9 -0
- package/src/providers/google/output-parser.js +47 -38
- package/src/providers/index.js +19 -3
- package/src/providers/openai/cli-builder.js +14 -3
- package/src/providers/openai/index.js +1 -0
- package/src/providers/openai/output-parser.js +44 -30
- package/src/providers/opencode/cli-builder.js +42 -0
- package/src/providers/opencode/index.js +103 -0
- package/src/providers/opencode/models.js +55 -0
- package/src/providers/opencode/output-parser.js +122 -0
- package/src/schemas/sub-cluster.js +68 -39
- package/src/status-footer.js +94 -48
- package/src/sub-cluster-wrapper.js +76 -35
- package/src/template-resolver.js +12 -9
- package/src/tui/data-poller.js +123 -99
- package/src/tui/formatters.js +4 -3
- package/src/tui/keybindings.js +259 -318
- package/src/tui/renderer.js +11 -21
- package/task-lib/attachable-watcher.js +118 -81
- package/task-lib/claude-recovery.js +61 -24
- package/task-lib/commands/episodes.js +105 -0
- package/task-lib/commands/list.js +2 -2
- package/task-lib/commands/logs.js +231 -189
- package/task-lib/commands/schedules.js +111 -61
- package/task-lib/config.js +0 -2
- package/task-lib/runner.js +84 -27
- package/task-lib/scheduler.js +1 -1
- package/task-lib/store.js +467 -168
- package/task-lib/tui/formatters.js +94 -45
- package/task-lib/tui/renderer.js +13 -3
- package/task-lib/tui.js +73 -32
- package/task-lib/watcher.js +128 -90
- package/src/agents/git-pusher-agent.json +0 -20
- package/src/github.js +0 -139
package/task-lib/config.js
CHANGED
|
@@ -2,9 +2,7 @@ import { homedir } from 'os';
|
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
|
|
4
4
|
export const TASKS_DIR = join(homedir(), '.claude-zeroshot');
|
|
5
|
-
export const TASKS_FILE = join(TASKS_DIR, 'tasks.json');
|
|
6
5
|
export const LOGS_DIR = join(TASKS_DIR, 'logs');
|
|
7
|
-
export const SCHEDULES_FILE = join(TASKS_DIR, 'schedules.json');
|
|
8
6
|
export const SCHEDULER_PID_FILE = join(TASKS_DIR, 'scheduler.pid');
|
|
9
7
|
export const SCHEDULER_LOG = join(TASKS_DIR, 'scheduler.log');
|
|
10
8
|
export const DEFAULT_MODEL = 'sonnet';
|
package/task-lib/runner.js
CHANGED
|
@@ -20,45 +20,98 @@ export async function spawnTask(prompt, options = {}) {
|
|
|
20
20
|
const cwd = options.cwd || process.cwd();
|
|
21
21
|
|
|
22
22
|
const settings = loadSettings();
|
|
23
|
+
const { providerName, provider, providerSettings, levelOverrides } = resolveProviderContext(
|
|
24
|
+
options,
|
|
25
|
+
settings
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const outputFormat = resolveOutputFormat(options);
|
|
29
|
+
const jsonSchema = resolveJsonSchema(options, outputFormat);
|
|
30
|
+
const modelSpec = resolveModelSpec(options, provider, providerSettings, levelOverrides);
|
|
31
|
+
|
|
32
|
+
const cliFeatures = await provider.getCliFeatures();
|
|
33
|
+
const commandSpec = provider.buildCommand(prompt, {
|
|
34
|
+
modelSpec,
|
|
35
|
+
outputFormat,
|
|
36
|
+
jsonSchema,
|
|
37
|
+
cwd,
|
|
38
|
+
autoApprove: true,
|
|
39
|
+
cliFeatures,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const finalArgs = resolveFinalArgs(commandSpec, providerName, options);
|
|
43
|
+
const task = buildTaskRecord({
|
|
44
|
+
id,
|
|
45
|
+
prompt,
|
|
46
|
+
cwd,
|
|
47
|
+
options,
|
|
48
|
+
logFile,
|
|
49
|
+
providerName,
|
|
50
|
+
modelSpec,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
addTask(task);
|
|
54
|
+
|
|
55
|
+
const watcherConfig = buildWatcherConfig(
|
|
56
|
+
outputFormat,
|
|
57
|
+
jsonSchema,
|
|
58
|
+
options,
|
|
59
|
+
providerName,
|
|
60
|
+
commandSpec
|
|
61
|
+
);
|
|
62
|
+
const watcherScript = resolveWatcherScript(options);
|
|
63
|
+
spawnWatcher({
|
|
64
|
+
watcherScript,
|
|
65
|
+
id,
|
|
66
|
+
cwd,
|
|
67
|
+
logFile,
|
|
68
|
+
finalArgs,
|
|
69
|
+
watcherConfig,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
return task;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function resolveProviderContext(options, settings) {
|
|
23
76
|
const providerName = normalizeProviderName(
|
|
24
77
|
options.provider || settings.defaultProvider || 'claude'
|
|
25
78
|
);
|
|
26
79
|
const provider = getProvider(providerName);
|
|
27
80
|
const providerSettings = settings.providerSettings?.[providerName] || {};
|
|
28
81
|
const levelOverrides = providerSettings.levelOverrides || {};
|
|
82
|
+
return { providerName, provider, providerSettings, levelOverrides };
|
|
83
|
+
}
|
|
29
84
|
|
|
30
|
-
|
|
85
|
+
function resolveOutputFormat(options) {
|
|
86
|
+
return options.outputFormat || 'stream-json';
|
|
87
|
+
}
|
|
31
88
|
|
|
89
|
+
function resolveJsonSchema(options, outputFormat) {
|
|
32
90
|
let jsonSchema = options.jsonSchema || null;
|
|
33
91
|
if (jsonSchema && outputFormat !== 'json') {
|
|
34
92
|
console.warn('Warning: --json-schema requires --output-format json, ignoring schema');
|
|
35
93
|
jsonSchema = null;
|
|
36
94
|
}
|
|
95
|
+
return jsonSchema;
|
|
96
|
+
}
|
|
37
97
|
|
|
38
|
-
|
|
98
|
+
function resolveModelSpec(options, provider, providerSettings, levelOverrides) {
|
|
39
99
|
if (options.model) {
|
|
40
|
-
|
|
100
|
+
return {
|
|
41
101
|
model: options.model,
|
|
42
102
|
reasoningEffort: options.reasoningEffort,
|
|
43
103
|
};
|
|
44
|
-
} else {
|
|
45
|
-
const level = options.modelLevel || providerSettings.defaultLevel || provider.getDefaultLevel();
|
|
46
|
-
modelSpec = provider.resolveModelSpec(level, levelOverrides);
|
|
47
|
-
if (options.reasoningEffort) {
|
|
48
|
-
modelSpec = { ...modelSpec, reasoningEffort: options.reasoningEffort };
|
|
49
|
-
}
|
|
50
104
|
}
|
|
51
105
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
cliFeatures,
|
|
60
|
-
});
|
|
106
|
+
const level = options.modelLevel || providerSettings.defaultLevel || provider.getDefaultLevel();
|
|
107
|
+
let modelSpec = provider.resolveModelSpec(level, levelOverrides);
|
|
108
|
+
if (options.reasoningEffort) {
|
|
109
|
+
modelSpec = { ...modelSpec, reasoningEffort: options.reasoningEffort };
|
|
110
|
+
}
|
|
111
|
+
return modelSpec;
|
|
112
|
+
}
|
|
61
113
|
|
|
114
|
+
function resolveFinalArgs(commandSpec, providerName, options) {
|
|
62
115
|
const finalArgs = [...commandSpec.args];
|
|
63
116
|
if (providerName === 'claude') {
|
|
64
117
|
const promptIndex = finalArgs.length - 1;
|
|
@@ -70,8 +123,11 @@ export async function spawnTask(prompt, options = {}) {
|
|
|
70
123
|
} else if (options.resume || options.continue) {
|
|
71
124
|
console.warn('Warning: resume/continue is only supported for Claude CLI; ignoring.');
|
|
72
125
|
}
|
|
126
|
+
return finalArgs;
|
|
127
|
+
}
|
|
73
128
|
|
|
74
|
-
|
|
129
|
+
function buildTaskRecord({ id, prompt, cwd, options, logFile, providerName, modelSpec }) {
|
|
130
|
+
return {
|
|
75
131
|
id,
|
|
76
132
|
prompt: prompt.slice(0, 200) + (prompt.length > 200 ? '...' : ''),
|
|
77
133
|
fullPrompt: prompt,
|
|
@@ -92,10 +148,10 @@ export async function spawnTask(prompt, options = {}) {
|
|
|
92
148
|
socketPath: null,
|
|
93
149
|
attachable: false,
|
|
94
150
|
};
|
|
151
|
+
}
|
|
95
152
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const watcherConfig = {
|
|
153
|
+
function buildWatcherConfig(outputFormat, jsonSchema, options, providerName, commandSpec) {
|
|
154
|
+
return {
|
|
99
155
|
outputFormat,
|
|
100
156
|
jsonSchema,
|
|
101
157
|
silentJsonOutput: options.silentJsonOutput || false,
|
|
@@ -103,12 +159,14 @@ export async function spawnTask(prompt, options = {}) {
|
|
|
103
159
|
command: commandSpec.binary,
|
|
104
160
|
env: commandSpec.env || {},
|
|
105
161
|
};
|
|
162
|
+
}
|
|
106
163
|
|
|
164
|
+
function resolveWatcherScript(options) {
|
|
107
165
|
const useAttachable = options.attachable !== false && !options.jsonSchema;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
: join(__dirname, 'watcher.js');
|
|
166
|
+
return useAttachable ? join(__dirname, 'attachable-watcher.js') : join(__dirname, 'watcher.js');
|
|
167
|
+
}
|
|
111
168
|
|
|
169
|
+
function spawnWatcher({ watcherScript, id, cwd, logFile, finalArgs, watcherConfig }) {
|
|
112
170
|
const watcher = fork(
|
|
113
171
|
watcherScript,
|
|
114
172
|
[id, cwd, logFile, JSON.stringify(finalArgs), JSON.stringify(watcherConfig)],
|
|
@@ -119,8 +177,7 @@ export async function spawnTask(prompt, options = {}) {
|
|
|
119
177
|
);
|
|
120
178
|
|
|
121
179
|
watcher.unref();
|
|
122
|
-
|
|
123
|
-
return task;
|
|
180
|
+
watcher.disconnect(); // Close IPC channel so parent can exit
|
|
124
181
|
}
|
|
125
182
|
|
|
126
183
|
export function isProcessRunning(pid) {
|
package/task-lib/scheduler.js
CHANGED
|
@@ -17,7 +17,7 @@ const CHECK_INTERVAL = 60000; // 60 seconds
|
|
|
17
17
|
* Supports: 30s, 5m, 2h, 1d, 1w
|
|
18
18
|
*/
|
|
19
19
|
export function parseInterval(str) {
|
|
20
|
-
const match = str.match(/^(\d+)(
|
|
20
|
+
const match = str.match(/^(\d+)([smhdw])$/i);
|
|
21
21
|
if (!match) return null;
|
|
22
22
|
|
|
23
23
|
const value = parseInt(match[1], 10);
|