zigrix 0.1.1 → 0.2.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.
- package/README.md +10 -2
- package/dist/config/defaults.d.ts +8 -0
- package/dist/config/defaults.js +8 -1
- package/dist/config/schema.d.ts +112 -0
- package/dist/config/schema.js +186 -12
- package/dist/dashboard/.next/BUILD_ID +1 -1
- package/dist/dashboard/.next/app-build-manifest.json +28 -28
- package/dist/dashboard/.next/app-path-routes-manifest.json +3 -3
- package/dist/dashboard/.next/build-manifest.json +5 -5
- package/dist/dashboard/.next/prerender-manifest.json +6 -6
- package/dist/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/_not-found.html +1 -1
- package/dist/dashboard/.next/server/app/_not-found.rsc +1 -1
- package/dist/dashboard/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/overview/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/stream/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/conversation/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/login.html +1 -1
- package/dist/dashboard/.next/server/app/login.rsc +1 -1
- package/dist/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/dist/dashboard/.next/server/app/setup.html +1 -1
- package/dist/dashboard/.next/server/app/setup.rsc +1 -1
- package/dist/dashboard/.next/server/app-paths-manifest.json +3 -3
- package/dist/dashboard/.next/server/chunks/331.js +1 -1
- package/dist/dashboard/.next/server/functions-config-manifest.json +3 -3
- package/dist/dashboard/.next/server/middleware-build-manifest.js +1 -1
- package/dist/dashboard/.next/server/middleware.js +1 -1
- package/dist/dashboard/.next/server/pages/404.html +1 -1
- package/dist/dashboard/.next/server/pages/500.html +1 -1
- package/dist/dashboard/.next/server/pages/_error.js +1 -1
- package/dist/dashboard/.next/static/chunks/{255-ebd51be49873d76c.js → 255-4f212684648fcab9.js} +1 -1
- package/dist/dashboard/.next/static/chunks/main-cec07dc17fdd452c.js +1 -0
- package/dist/dashboard/package.json +2 -2
- package/dist/doctor.d.ts +3 -0
- package/dist/doctor.js +233 -60
- package/dist/index.js +286 -33
- package/dist/migrate/import-orchestration.d.ts +31 -0
- package/dist/migrate/import-orchestration.js +638 -0
- package/dist/onboard.d.ts +1 -1
- package/dist/onboard.js +132 -37
- package/dist/orchestration/dispatch.js +16 -71
- package/dist/orchestration/evidence.d.ts +7 -0
- package/dist/orchestration/evidence.js +79 -4
- package/dist/orchestration/pipeline.d.ts +1 -0
- package/dist/orchestration/pipeline.js +26 -1
- package/dist/orchestration/prompt-compose.d.ts +35 -0
- package/dist/orchestration/prompt-compose.js +172 -0
- package/dist/orchestration/worker.d.ts +4 -1
- package/dist/orchestration/worker.js +132 -52
- package/dist/state/tasks.d.ts +43 -2
- package/dist/state/tasks.js +281 -10
- package/dist/state/verify.js +89 -11
- package/package.json +3 -3
- package/rules/defaults/orchestrator-agent.md +4 -2
- package/rules/defaults/worker-common.md +3 -0
- package/skills/oz/SKILL.md +117 -0
- package/skills/oz/references/examples.md +44 -0
- package/skills/oz/references/routing-rubric.md +71 -0
- package/skills/zigrix-main-agent-guide/SKILL.md +37 -7
- package/dist/dashboard/.next/static/chunks/main-da2d845a416cfa3f.js +0 -1
- /package/dist/dashboard/.next/static/{iKGx5hWe1zbwJZWchF9kg → dOjvoQUj-mqwJ8kKG4peU}/_buildManifest.js +0 -0
- /package/dist/dashboard/.next/static/{iKGx5hWe1zbwJZWchF9kg → dOjvoQUj-mqwJ8kKG4peU}/_ssgManifest.js +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
3
4
|
import { Command } from 'commander';
|
|
4
5
|
import { addAgent, excludeAgent, includeAgent, listAgents, removeAgent, setAgentEnabled, setAgentRole, } from './agents/registry.js';
|
|
5
6
|
import { runConfigure } from './configure.js';
|
|
6
|
-
import { diffValues, getValueAtPath, parseConfigInput, resetValueAtPath, setValueAtPath } from './config/mutate.js';
|
|
7
|
+
import { diffValues, getValueAtPath, parseConfigInput, resetValueAtPath, setValueAtPath, } from './config/mutate.js';
|
|
7
8
|
import { defaultConfig, resolveAbsolutePath } from './config/defaults.js';
|
|
8
9
|
import { getConfigValue, loadConfig, writeConfigFile, writeDefaultConfig } from './config/load.js';
|
|
9
10
|
import { zigrixConfigJsonSchema } from './config/schema.js';
|
|
10
|
-
import { gatherDoctor, renderDoctorText } from './doctor.js';
|
|
11
|
+
import { gatherDoctor, gatherDoctorFailure, renderDoctorText } from './doctor.js';
|
|
12
|
+
import { importOrchestrationState } from './migrate/import-orchestration.js';
|
|
11
13
|
import { runOnboard } from './onboard.js';
|
|
12
14
|
import { dispatchTask, resolveConfiguredProjectDir } from './orchestration/dispatch.js';
|
|
13
15
|
import { collectEvidence, mergeEvidence } from './orchestration/evidence.js';
|
|
@@ -19,7 +21,7 @@ import { listRules, renderTemplate, validateRules } from './rules/templates.js';
|
|
|
19
21
|
import { runWorkflow, summarizeRun } from './runner/run.js';
|
|
20
22
|
import { loadRunRecord } from './runner/store.js';
|
|
21
23
|
import { ensureBaseState, resolvePaths } from './state/paths.js';
|
|
22
|
-
import { applyStalePolicy, createTask, findStaleTasks, listTaskEvents, listTasks, loadTask, rebuildIndex, recordTaskProgress, resolveTaskPaths, updateTaskStatus, } from './state/tasks.js';
|
|
24
|
+
import { applyStalePolicy, bindOrchestratorSession, createTask, findStaleTasks, listTaskEvents, listTasks, loadTask, rebuildIndex, recordTaskProgress, resolveTaskPaths, updateTaskStatus, } from './state/tasks.js';
|
|
23
25
|
import { verifyState } from './state/verify.js';
|
|
24
26
|
import { runDashboard, DASHBOARD_DEFAULT_PORT } from './dashboard.js';
|
|
25
27
|
const STATUS_MAP = {
|
|
@@ -55,6 +57,27 @@ function loadRuntime() {
|
|
|
55
57
|
const loaded = loadConfig();
|
|
56
58
|
return { ...loaded, paths: resolvePaths(loaded.config) };
|
|
57
59
|
}
|
|
60
|
+
function resolveAgentsStateDir(config) {
|
|
61
|
+
const configuredHome = typeof config.openclaw.home === 'string' ? config.openclaw.home.trim() : '';
|
|
62
|
+
const openclawHome = configuredHome || process.env.OPENCLAW_HOME || '';
|
|
63
|
+
if (!openclawHome)
|
|
64
|
+
return null;
|
|
65
|
+
return path.join(openclawHome, 'agents');
|
|
66
|
+
}
|
|
67
|
+
function parseVerificationMap(raw) {
|
|
68
|
+
const [dod, test] = raw.split(/=(.*)/s, 2);
|
|
69
|
+
const left = dod?.trim() ?? '';
|
|
70
|
+
const right = test?.trim() ?? '';
|
|
71
|
+
if (!left || !right) {
|
|
72
|
+
throw new Error(`invalid verification map format: ${raw} (expected dod=test)`);
|
|
73
|
+
}
|
|
74
|
+
return { dod: left, test: right };
|
|
75
|
+
}
|
|
76
|
+
function runImportOrchestrationCommand(fromDir, yes) {
|
|
77
|
+
requireYes(yes, 'import legacy orchestration state');
|
|
78
|
+
const loaded = loadRuntime();
|
|
79
|
+
return importOrchestrationState(loaded.paths, { fromDir });
|
|
80
|
+
}
|
|
58
81
|
function listRuntimePathValues(loaded) {
|
|
59
82
|
return {
|
|
60
83
|
configPath: loaded.configPath,
|
|
@@ -112,14 +135,21 @@ program
|
|
|
112
135
|
.version(pkgVersion);
|
|
113
136
|
const config = program.command('config').description('Inspect Zigrix config');
|
|
114
137
|
const pathCmd = program.command('path').description('Resolve runtime paths from Zigrix config');
|
|
115
|
-
const agent = program
|
|
138
|
+
const agent = program
|
|
139
|
+
.command('agent')
|
|
140
|
+
.description('Manage Zigrix agent registry and orchestration membership');
|
|
116
141
|
const rule = program.command('rule').description('Inspect and validate rule assets');
|
|
117
142
|
const template = program.command('template').description('Inspect and modify prompt templates');
|
|
118
|
-
const reset = program
|
|
143
|
+
const reset = program
|
|
144
|
+
.command('reset')
|
|
145
|
+
.description('Restore default config sections or clean runtime state');
|
|
119
146
|
const state = program.command('state').description('Inspect and verify runtime state');
|
|
147
|
+
const migrate = program.command('migrate').description('Import legacy runtime state into Zigrix');
|
|
120
148
|
const task = program.command('task').description('Task operations');
|
|
121
149
|
const worker = program.command('worker').description('Worker lifecycle operations');
|
|
122
|
-
const evidence = program
|
|
150
|
+
const evidence = program
|
|
151
|
+
.command('evidence')
|
|
152
|
+
.description('Evidence collection and merge operations');
|
|
123
153
|
const report = program.command('report').description('User-facing reporting helpers');
|
|
124
154
|
const pipeline = program.command('pipeline').description('High-level orchestration helpers');
|
|
125
155
|
// ─── onboard ────────────────────────────────────────────────────────────────
|
|
@@ -184,8 +214,14 @@ program
|
|
|
184
214
|
.description('Inspect environment, config, and runtime readiness')
|
|
185
215
|
.option('--json')
|
|
186
216
|
.action((options) => {
|
|
187
|
-
|
|
188
|
-
|
|
217
|
+
let payload;
|
|
218
|
+
try {
|
|
219
|
+
const loaded = loadRuntime();
|
|
220
|
+
payload = gatherDoctor(loaded, loaded.paths);
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
payload = gatherDoctorFailure(error);
|
|
224
|
+
}
|
|
189
225
|
if (options.json) {
|
|
190
226
|
printValue(payload, true);
|
|
191
227
|
return;
|
|
@@ -307,8 +343,22 @@ agent
|
|
|
307
343
|
.option('--json')
|
|
308
344
|
.action((options) => {
|
|
309
345
|
const loaded = loadConfig();
|
|
310
|
-
const result = addAgent(loaded.config, {
|
|
311
|
-
|
|
346
|
+
const result = addAgent(loaded.config, {
|
|
347
|
+
id: options.id,
|
|
348
|
+
role: options.role,
|
|
349
|
+
runtime: options.runtime,
|
|
350
|
+
label: options.label,
|
|
351
|
+
enabled: !options.disabled,
|
|
352
|
+
include: Boolean(options.include),
|
|
353
|
+
});
|
|
354
|
+
persistAndPrintMutation({
|
|
355
|
+
configPath: loaded.configPath,
|
|
356
|
+
baseDir: loaded.baseDir,
|
|
357
|
+
nextConfig: result.config,
|
|
358
|
+
json: options.json,
|
|
359
|
+
action: 'agent.add',
|
|
360
|
+
agentId: result.agentId,
|
|
361
|
+
});
|
|
312
362
|
});
|
|
313
363
|
agent
|
|
314
364
|
.command('remove <agentId>')
|
|
@@ -316,7 +366,14 @@ agent
|
|
|
316
366
|
.action((agentId, options) => {
|
|
317
367
|
const loaded = loadConfig();
|
|
318
368
|
const result = removeAgent(loaded.config, agentId);
|
|
319
|
-
persistAndPrintMutation({
|
|
369
|
+
persistAndPrintMutation({
|
|
370
|
+
configPath: loaded.configPath,
|
|
371
|
+
baseDir: loaded.baseDir,
|
|
372
|
+
nextConfig: result.config,
|
|
373
|
+
json: options.json,
|
|
374
|
+
action: 'agent.remove',
|
|
375
|
+
agentId: result.agentId,
|
|
376
|
+
});
|
|
320
377
|
});
|
|
321
378
|
agent
|
|
322
379
|
.command('include <agentId>')
|
|
@@ -324,7 +381,14 @@ agent
|
|
|
324
381
|
.action((agentId, options) => {
|
|
325
382
|
const loaded = loadConfig();
|
|
326
383
|
const result = includeAgent(loaded.config, agentId);
|
|
327
|
-
persistAndPrintMutation({
|
|
384
|
+
persistAndPrintMutation({
|
|
385
|
+
configPath: loaded.configPath,
|
|
386
|
+
baseDir: loaded.baseDir,
|
|
387
|
+
nextConfig: result.config,
|
|
388
|
+
json: options.json,
|
|
389
|
+
action: 'agent.include',
|
|
390
|
+
agentId: result.agentId,
|
|
391
|
+
});
|
|
328
392
|
});
|
|
329
393
|
agent
|
|
330
394
|
.command('exclude <agentId>')
|
|
@@ -332,7 +396,14 @@ agent
|
|
|
332
396
|
.action((agentId, options) => {
|
|
333
397
|
const loaded = loadConfig();
|
|
334
398
|
const result = excludeAgent(loaded.config, agentId);
|
|
335
|
-
persistAndPrintMutation({
|
|
399
|
+
persistAndPrintMutation({
|
|
400
|
+
configPath: loaded.configPath,
|
|
401
|
+
baseDir: loaded.baseDir,
|
|
402
|
+
nextConfig: result.config,
|
|
403
|
+
json: options.json,
|
|
404
|
+
action: 'agent.exclude',
|
|
405
|
+
agentId: result.agentId,
|
|
406
|
+
});
|
|
336
407
|
});
|
|
337
408
|
agent
|
|
338
409
|
.command('enable <agentId>')
|
|
@@ -340,7 +411,14 @@ agent
|
|
|
340
411
|
.action((agentId, options) => {
|
|
341
412
|
const loaded = loadConfig();
|
|
342
413
|
const result = setAgentEnabled(loaded.config, agentId, true);
|
|
343
|
-
persistAndPrintMutation({
|
|
414
|
+
persistAndPrintMutation({
|
|
415
|
+
configPath: loaded.configPath,
|
|
416
|
+
baseDir: loaded.baseDir,
|
|
417
|
+
nextConfig: result.config,
|
|
418
|
+
json: options.json,
|
|
419
|
+
action: 'agent.enable',
|
|
420
|
+
agentId: result.agentId,
|
|
421
|
+
});
|
|
344
422
|
});
|
|
345
423
|
agent
|
|
346
424
|
.command('disable <agentId>')
|
|
@@ -348,7 +426,14 @@ agent
|
|
|
348
426
|
.action((agentId, options) => {
|
|
349
427
|
const loaded = loadConfig();
|
|
350
428
|
const result = setAgentEnabled(loaded.config, agentId, false);
|
|
351
|
-
persistAndPrintMutation({
|
|
429
|
+
persistAndPrintMutation({
|
|
430
|
+
configPath: loaded.configPath,
|
|
431
|
+
baseDir: loaded.baseDir,
|
|
432
|
+
nextConfig: result.config,
|
|
433
|
+
json: options.json,
|
|
434
|
+
action: 'agent.disable',
|
|
435
|
+
agentId: result.agentId,
|
|
436
|
+
});
|
|
352
437
|
});
|
|
353
438
|
agent
|
|
354
439
|
.command('set-role <agentId>')
|
|
@@ -357,7 +442,14 @@ agent
|
|
|
357
442
|
.action((agentId, options) => {
|
|
358
443
|
const loaded = loadConfig();
|
|
359
444
|
const result = setAgentRole(loaded.config, agentId, options.role);
|
|
360
|
-
persistAndPrintMutation({
|
|
445
|
+
persistAndPrintMutation({
|
|
446
|
+
configPath: loaded.configPath,
|
|
447
|
+
baseDir: loaded.baseDir,
|
|
448
|
+
nextConfig: result.config,
|
|
449
|
+
json: options.json,
|
|
450
|
+
action: 'agent.set-role',
|
|
451
|
+
agentId: result.agentId,
|
|
452
|
+
});
|
|
361
453
|
});
|
|
362
454
|
// ─── rule ───────────────────────────────────────────────────────────────────
|
|
363
455
|
rule
|
|
@@ -393,7 +485,14 @@ rule
|
|
|
393
485
|
throw new Error('rule path must start with rules.');
|
|
394
486
|
const loaded = loadConfig();
|
|
395
487
|
const nextConfig = setValueAtPath(loaded.config, dottedPath, parseConfigInput(options.value));
|
|
396
|
-
persistConfigMutation({
|
|
488
|
+
persistConfigMutation({
|
|
489
|
+
configPath: loaded.configPath,
|
|
490
|
+
baseDir: loaded.baseDir,
|
|
491
|
+
nextConfig,
|
|
492
|
+
json: options.json,
|
|
493
|
+
action: 'rule.set',
|
|
494
|
+
path: dottedPath,
|
|
495
|
+
});
|
|
397
496
|
});
|
|
398
497
|
rule
|
|
399
498
|
.command('diff <path>')
|
|
@@ -415,7 +514,14 @@ rule
|
|
|
415
514
|
requireYes(options.yes, 'reset rule config');
|
|
416
515
|
const loaded = loadConfig();
|
|
417
516
|
const nextConfig = resetValueAtPath(loaded.config, options.path);
|
|
418
|
-
persistConfigMutation({
|
|
517
|
+
persistConfigMutation({
|
|
518
|
+
configPath: loaded.configPath,
|
|
519
|
+
baseDir: loaded.baseDir,
|
|
520
|
+
nextConfig,
|
|
521
|
+
json: options.json,
|
|
522
|
+
action: 'rule.reset',
|
|
523
|
+
path: options.path,
|
|
524
|
+
});
|
|
419
525
|
});
|
|
420
526
|
// ─── template ───────────────────────────────────────────────────────────────
|
|
421
527
|
template
|
|
@@ -452,7 +558,14 @@ template
|
|
|
452
558
|
...(options.placeholders ? { placeholders: parseConfigInput(options.placeholders) } : {}),
|
|
453
559
|
};
|
|
454
560
|
const nextConfig = setValueAtPath(loaded.config, `templates.${name}`, nextTemplate);
|
|
455
|
-
persistConfigMutation({
|
|
561
|
+
persistConfigMutation({
|
|
562
|
+
configPath: loaded.configPath,
|
|
563
|
+
baseDir: loaded.baseDir,
|
|
564
|
+
nextConfig,
|
|
565
|
+
json: options.json,
|
|
566
|
+
action: 'template.set',
|
|
567
|
+
path: `templates.${name}`,
|
|
568
|
+
});
|
|
456
569
|
});
|
|
457
570
|
template
|
|
458
571
|
.command('diff <name>')
|
|
@@ -469,7 +582,14 @@ template
|
|
|
469
582
|
requireYes(options.yes, 'reset template config');
|
|
470
583
|
const loaded = loadConfig();
|
|
471
584
|
const nextConfig = resetValueAtPath(loaded.config, `templates.${name}`);
|
|
472
|
-
persistConfigMutation({
|
|
585
|
+
persistConfigMutation({
|
|
586
|
+
configPath: loaded.configPath,
|
|
587
|
+
baseDir: loaded.baseDir,
|
|
588
|
+
nextConfig,
|
|
589
|
+
json: options.json,
|
|
590
|
+
action: 'template.reset',
|
|
591
|
+
path: `templates.${name}`,
|
|
592
|
+
});
|
|
473
593
|
});
|
|
474
594
|
template
|
|
475
595
|
.command('render <name>')
|
|
@@ -480,7 +600,11 @@ template
|
|
|
480
600
|
const item = getValueAtPath(loaded.config, `templates.${name}`);
|
|
481
601
|
if (!item?.body)
|
|
482
602
|
throw new Error(`template not found: ${name}`);
|
|
483
|
-
printValue({
|
|
603
|
+
printValue({
|
|
604
|
+
ok: true,
|
|
605
|
+
name,
|
|
606
|
+
rendered: renderTemplate(name, item.body, JSON.parse(options.context)),
|
|
607
|
+
}, true);
|
|
484
608
|
});
|
|
485
609
|
// ─── reset ──────────────────────────────────────────────────────────────────
|
|
486
610
|
reset
|
|
@@ -492,7 +616,14 @@ reset
|
|
|
492
616
|
requireYes(options.yes, 'reset config');
|
|
493
617
|
const loaded = loadConfig();
|
|
494
618
|
const nextConfig = resetValueAtPath(loaded.config, options.path);
|
|
495
|
-
persistConfigMutation({
|
|
619
|
+
persistConfigMutation({
|
|
620
|
+
configPath: loaded.configPath,
|
|
621
|
+
baseDir: loaded.baseDir,
|
|
622
|
+
nextConfig,
|
|
623
|
+
json: options.json,
|
|
624
|
+
action: 'reset.config',
|
|
625
|
+
path: options.path,
|
|
626
|
+
});
|
|
496
627
|
});
|
|
497
628
|
reset
|
|
498
629
|
.command('state')
|
|
@@ -502,7 +633,12 @@ reset
|
|
|
502
633
|
requireYes(options.yes, 'reset runtime state');
|
|
503
634
|
const loaded = loadRuntime();
|
|
504
635
|
// Remove task data but preserve config and rules
|
|
505
|
-
for (const dir of [
|
|
636
|
+
for (const dir of [
|
|
637
|
+
loaded.paths.tasksDir,
|
|
638
|
+
loaded.paths.evidenceDir,
|
|
639
|
+
loaded.paths.promptsDir,
|
|
640
|
+
loaded.paths.runsDir,
|
|
641
|
+
]) {
|
|
506
642
|
fs.rmSync(dir, { recursive: true, force: true });
|
|
507
643
|
}
|
|
508
644
|
fs.rmSync(loaded.paths.eventsFile, { force: true });
|
|
@@ -519,6 +655,24 @@ state
|
|
|
519
655
|
const loaded = loadRuntime();
|
|
520
656
|
printValue(verifyState(loaded.paths), true);
|
|
521
657
|
});
|
|
658
|
+
state
|
|
659
|
+
.command('import')
|
|
660
|
+
.description('Import legacy orchestration runtime state from a backup directory')
|
|
661
|
+
.requiredOption('--from <legacyDir>')
|
|
662
|
+
.option('--yes')
|
|
663
|
+
.option('--json')
|
|
664
|
+
.action((options) => {
|
|
665
|
+
printValue(runImportOrchestrationCommand(options.from, options.yes), true);
|
|
666
|
+
});
|
|
667
|
+
migrate
|
|
668
|
+
.command('import-orchestration')
|
|
669
|
+
.description('Import legacy orchestration runtime state from a backup directory')
|
|
670
|
+
.requiredOption('--from <legacyDir>')
|
|
671
|
+
.option('--yes')
|
|
672
|
+
.option('--json')
|
|
673
|
+
.action((options) => {
|
|
674
|
+
printValue(runImportOrchestrationCommand(options.from, options.yes), true);
|
|
675
|
+
});
|
|
522
676
|
program
|
|
523
677
|
.command('index-rebuild')
|
|
524
678
|
.option('--json')
|
|
@@ -595,6 +749,24 @@ task
|
|
|
595
749
|
...resolveTaskPaths(loaded.paths, taskId),
|
|
596
750
|
}, true);
|
|
597
751
|
});
|
|
752
|
+
task
|
|
753
|
+
.command('bind-orchestrator')
|
|
754
|
+
.requiredOption('--task-id <taskId>')
|
|
755
|
+
.requiredOption('--agent-id <agentId>')
|
|
756
|
+
.requiredOption('--session-key <sessionKey>')
|
|
757
|
+
.option('--session-id <sessionId>')
|
|
758
|
+
.option('--json')
|
|
759
|
+
.action((options) => {
|
|
760
|
+
const payload = bindOrchestratorSession(loadRuntime().paths, {
|
|
761
|
+
taskId: options.taskId,
|
|
762
|
+
agentId: options.agentId,
|
|
763
|
+
sessionKey: options.sessionKey,
|
|
764
|
+
sessionId: options.sessionId,
|
|
765
|
+
});
|
|
766
|
+
if (!payload)
|
|
767
|
+
throw new Error(`task not found: ${options.taskId}`);
|
|
768
|
+
printValue(payload, true);
|
|
769
|
+
});
|
|
598
770
|
task
|
|
599
771
|
.command('events [taskId]')
|
|
600
772
|
.option('--json')
|
|
@@ -608,7 +780,13 @@ task
|
|
|
608
780
|
.option('--work-package <workPackage>')
|
|
609
781
|
.option('--json')
|
|
610
782
|
.action((options) => {
|
|
611
|
-
const payload = recordTaskProgress(loadRuntime().paths, {
|
|
783
|
+
const payload = recordTaskProgress(loadRuntime().paths, {
|
|
784
|
+
taskId: options.taskId,
|
|
785
|
+
actor: options.actor,
|
|
786
|
+
message: options.message,
|
|
787
|
+
unitId: options.unitId,
|
|
788
|
+
workPackage: options.workPackage,
|
|
789
|
+
});
|
|
612
790
|
if (!payload)
|
|
613
791
|
throw new Error(`task not found: ${options.taskId}`);
|
|
614
792
|
printValue(payload, true);
|
|
@@ -620,9 +798,16 @@ task
|
|
|
620
798
|
.option('--reason <reason>', 'block reason', 'stale_timeout')
|
|
621
799
|
.option('--json')
|
|
622
800
|
.action((options) => {
|
|
623
|
-
const
|
|
801
|
+
const loaded = loadRuntime();
|
|
624
802
|
const hours = Number(options.hours);
|
|
625
|
-
const
|
|
803
|
+
const agentsStateDir = resolveAgentsStateDir(loaded.config);
|
|
804
|
+
const preview = findStaleTasks(loaded.paths, hours, {
|
|
805
|
+
agentsStateDir,
|
|
806
|
+
fallbackReason: options.reason,
|
|
807
|
+
});
|
|
808
|
+
const payload = options.apply
|
|
809
|
+
? applyStalePolicy(loaded.paths, hours, options.reason, { agentsStateDir })
|
|
810
|
+
: { ok: true, hours, requestedReason: options.reason, count: preview.length, tasks: preview };
|
|
626
811
|
printValue(payload, true);
|
|
627
812
|
});
|
|
628
813
|
for (const [name, status] of Object.entries(STATUS_MAP)) {
|
|
@@ -668,7 +853,17 @@ worker
|
|
|
668
853
|
.option('--project-dir <path>', 'working directory for this worker')
|
|
669
854
|
.option('--json')
|
|
670
855
|
.action((options) => {
|
|
671
|
-
const
|
|
856
|
+
const runtime = loadRuntime();
|
|
857
|
+
const payload = prepareWorker(runtime.paths, runtime.config, {
|
|
858
|
+
taskId: options.taskId,
|
|
859
|
+
agentId: options.agentId,
|
|
860
|
+
description: options.description,
|
|
861
|
+
constraints: options.constraints,
|
|
862
|
+
unitId: options.unitId,
|
|
863
|
+
workPackage: options.workPackage,
|
|
864
|
+
dod: options.dod,
|
|
865
|
+
projectDir: options.projectDir,
|
|
866
|
+
});
|
|
672
867
|
if (!payload)
|
|
673
868
|
throw new Error(`task not found: ${options.taskId}`);
|
|
674
869
|
printValue(payload, true);
|
|
@@ -678,6 +873,8 @@ worker
|
|
|
678
873
|
.requiredOption('--task-id <taskId>')
|
|
679
874
|
.requiredOption('--agent-id <agentId>')
|
|
680
875
|
.requiredOption('--session-key <sessionKey>')
|
|
876
|
+
.requiredOption('--label <label>')
|
|
877
|
+
.option('--project-dir <path>', 'worker project directory from prepare response')
|
|
681
878
|
.option('--run-id <runId>')
|
|
682
879
|
.option('--session-id <sessionId>')
|
|
683
880
|
.option('--unit-id <unitId>')
|
|
@@ -685,7 +882,18 @@ worker
|
|
|
685
882
|
.option('--reason <reason>')
|
|
686
883
|
.option('--json')
|
|
687
884
|
.action((options) => {
|
|
688
|
-
const payload = registerWorker(loadRuntime().paths, {
|
|
885
|
+
const payload = registerWorker(loadRuntime().paths, {
|
|
886
|
+
taskId: options.taskId,
|
|
887
|
+
agentId: options.agentId,
|
|
888
|
+
sessionKey: options.sessionKey,
|
|
889
|
+
runId: options.runId,
|
|
890
|
+
sessionId: options.sessionId,
|
|
891
|
+
unitId: options.unitId,
|
|
892
|
+
workPackage: options.workPackage,
|
|
893
|
+
reason: options.reason,
|
|
894
|
+
label: options.label,
|
|
895
|
+
projectDir: options.projectDir,
|
|
896
|
+
});
|
|
689
897
|
if (!payload)
|
|
690
898
|
throw new Error(`task not found: ${options.taskId}`);
|
|
691
899
|
printValue(payload, true);
|
|
@@ -702,7 +910,16 @@ worker
|
|
|
702
910
|
.option('--work-package <workPackage>')
|
|
703
911
|
.option('--json')
|
|
704
912
|
.action((options) => {
|
|
705
|
-
const payload = completeWorker(loadRuntime().paths, {
|
|
913
|
+
const payload = completeWorker(loadRuntime().paths, {
|
|
914
|
+
taskId: options.taskId,
|
|
915
|
+
agentId: options.agentId,
|
|
916
|
+
sessionKey: options.sessionKey,
|
|
917
|
+
runId: options.runId,
|
|
918
|
+
sessionId: options.sessionId,
|
|
919
|
+
result: options.result,
|
|
920
|
+
unitId: options.unitId,
|
|
921
|
+
workPackage: options.workPackage,
|
|
922
|
+
});
|
|
706
923
|
if (!payload)
|
|
707
924
|
throw new Error(`task not found: ${options.taskId}`);
|
|
708
925
|
printValue(payload, true);
|
|
@@ -720,10 +937,28 @@ evidence
|
|
|
720
937
|
.option('--summary <summary>')
|
|
721
938
|
.option('--tool-result <toolResult>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
722
939
|
.option('--notes <notes>')
|
|
940
|
+
.option('--dod-item <dodItem>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
941
|
+
.option('--test-case <testCase>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
942
|
+
.option('--verification-map <mapping>', 'repeatable dod=test mapping', (value, prev = []) => [...prev, value], [])
|
|
723
943
|
.option('--limit <limit>', 'transcript line limit', '40')
|
|
724
944
|
.option('--json')
|
|
725
945
|
.action((options) => {
|
|
726
|
-
const payload = collectEvidence(loadRuntime().paths, {
|
|
946
|
+
const payload = collectEvidence(loadRuntime().paths, {
|
|
947
|
+
taskId: options.taskId,
|
|
948
|
+
agentId: options.agentId,
|
|
949
|
+
runId: options.runId,
|
|
950
|
+
unitId: options.unitId,
|
|
951
|
+
sessionKey: options.sessionKey,
|
|
952
|
+
sessionId: options.sessionId,
|
|
953
|
+
transcript: options.transcript,
|
|
954
|
+
summary: options.summary,
|
|
955
|
+
toolResults: options.toolResult,
|
|
956
|
+
notes: options.notes,
|
|
957
|
+
dodItems: options.dodItem,
|
|
958
|
+
testCases: options.testCase,
|
|
959
|
+
verificationMappings: (options.verificationMap ?? []).map((item) => parseVerificationMap(item)),
|
|
960
|
+
limit: Number(options.limit),
|
|
961
|
+
});
|
|
727
962
|
if (!payload)
|
|
728
963
|
throw new Error(`task not found: ${options.taskId}`);
|
|
729
964
|
printValue(payload, true);
|
|
@@ -735,7 +970,11 @@ evidence
|
|
|
735
970
|
.option('--require-qa')
|
|
736
971
|
.option('--json')
|
|
737
972
|
.action((options) => {
|
|
738
|
-
const payload = mergeEvidence(loadRuntime().paths, {
|
|
973
|
+
const payload = mergeEvidence(loadRuntime().paths, {
|
|
974
|
+
taskId: options.taskId,
|
|
975
|
+
requiredAgents: options.requiredAgent,
|
|
976
|
+
requireQa: Boolean(options.requireQa),
|
|
977
|
+
});
|
|
739
978
|
if (!payload)
|
|
740
979
|
throw new Error(`task not found: ${options.taskId}`);
|
|
741
980
|
printValue(payload, true);
|
|
@@ -747,7 +986,10 @@ report
|
|
|
747
986
|
.option('--record-events')
|
|
748
987
|
.option('--json')
|
|
749
988
|
.action((options) => {
|
|
750
|
-
const payload = renderReport(loadRuntime().paths, {
|
|
989
|
+
const payload = renderReport(loadRuntime().paths, {
|
|
990
|
+
taskId: options.taskId,
|
|
991
|
+
recordEvents: Boolean(options.recordEvents),
|
|
992
|
+
});
|
|
751
993
|
if (!payload)
|
|
752
994
|
throw new Error(`task not found: ${options.taskId}`);
|
|
753
995
|
printValue(payload, true);
|
|
@@ -760,12 +1002,23 @@ pipeline
|
|
|
760
1002
|
.option('--scale <scale>', 'simple|normal|risky|large', 'normal')
|
|
761
1003
|
.option('--required-agent <agent>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
762
1004
|
.option('--evidence-summary <agentEqSummary>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
1005
|
+
.option('--verification-map <agentEqDodEqTest>', 'repeatable agentId=dod=test', (value, prev = []) => [...prev, value], [])
|
|
763
1006
|
.option('--require-qa')
|
|
764
1007
|
.option('--auto-report')
|
|
765
1008
|
.option('--record-feedback')
|
|
766
1009
|
.option('--json')
|
|
767
1010
|
.action((options) => {
|
|
768
|
-
const payload = runPipeline(loadRuntime().paths, {
|
|
1011
|
+
const payload = runPipeline(loadRuntime().paths, {
|
|
1012
|
+
title: options.title,
|
|
1013
|
+
description: options.description,
|
|
1014
|
+
scale: options.scale,
|
|
1015
|
+
requiredAgents: options.requiredAgent,
|
|
1016
|
+
evidenceSummaries: options.evidenceSummary,
|
|
1017
|
+
verificationMappings: options.verificationMap,
|
|
1018
|
+
requireQa: Boolean(options.requireQa),
|
|
1019
|
+
autoReport: Boolean(options.autoReport),
|
|
1020
|
+
recordFeedback: Boolean(options.recordFeedback),
|
|
1021
|
+
});
|
|
769
1022
|
printValue(payload, true);
|
|
770
1023
|
});
|
|
771
1024
|
// ─── run / inspect ──────────────────────────────────────────────────────────
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ZigrixPaths } from '../state/paths.js';
|
|
2
|
+
type ImportReport = {
|
|
3
|
+
ok: boolean;
|
|
4
|
+
action: 'migrate.import-orchestration';
|
|
5
|
+
fromDir: string;
|
|
6
|
+
destinationBaseDir: string;
|
|
7
|
+
importedTaskIds: string[];
|
|
8
|
+
synthesizedMetaTasks: string[];
|
|
9
|
+
skippedTaskIds: string[];
|
|
10
|
+
counts: {
|
|
11
|
+
source: Record<string, number>;
|
|
12
|
+
imported: Record<string, number>;
|
|
13
|
+
};
|
|
14
|
+
parity: {
|
|
15
|
+
tasks: boolean;
|
|
16
|
+
evidenceDirs: boolean;
|
|
17
|
+
evidenceFiles: boolean;
|
|
18
|
+
mergedFiles: boolean;
|
|
19
|
+
prompts: boolean;
|
|
20
|
+
events: boolean;
|
|
21
|
+
statusBuckets: boolean;
|
|
22
|
+
activeTasks: boolean;
|
|
23
|
+
};
|
|
24
|
+
stateCheck: Record<string, unknown>;
|
|
25
|
+
warnings: string[];
|
|
26
|
+
reportPath: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function importOrchestrationState(paths: ZigrixPaths, params: {
|
|
29
|
+
fromDir: string;
|
|
30
|
+
}): ImportReport;
|
|
31
|
+
export {};
|