zigrix 0.1.1 → 0.2.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/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 +10 -10
- package/dist/dashboard/.next/app-path-routes-manifest.json +2 -2
- package/dist/dashboard/.next/build-manifest.json +2 -2
- 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 +2 -2
- package/dist/dashboard/.next/server/functions-config-manifest.json +2 -2
- package/dist/dashboard/.next/server/pages/404.html +1 -1
- package/dist/dashboard/.next/server/pages/500.html +1 -1
- package/dist/doctor.d.ts +3 -0
- package/dist/doctor.js +233 -60
- package/dist/index.js +262 -32
- package/dist/migrate/import-orchestration.d.ts +31 -0
- package/dist/migrate/import-orchestration.js +638 -0
- package/dist/onboard.js +130 -35
- 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/state/tasks.d.ts +37 -2
- package/dist/state/tasks.js +242 -10
- package/dist/state/verify.js +89 -11
- package/package.json +1 -1
- /package/dist/dashboard/.next/static/{iKGx5hWe1zbwJZWchF9kg → EZjkAnODdTglaMXuBw76E}/_buildManifest.js +0 -0
- /package/dist/dashboard/.next/static/{iKGx5hWe1zbwJZWchF9kg → EZjkAnODdTglaMXuBw76E}/_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';
|
|
@@ -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')
|
|
@@ -608,7 +762,13 @@ task
|
|
|
608
762
|
.option('--work-package <workPackage>')
|
|
609
763
|
.option('--json')
|
|
610
764
|
.action((options) => {
|
|
611
|
-
const payload = recordTaskProgress(loadRuntime().paths, {
|
|
765
|
+
const payload = recordTaskProgress(loadRuntime().paths, {
|
|
766
|
+
taskId: options.taskId,
|
|
767
|
+
actor: options.actor,
|
|
768
|
+
message: options.message,
|
|
769
|
+
unitId: options.unitId,
|
|
770
|
+
workPackage: options.workPackage,
|
|
771
|
+
});
|
|
612
772
|
if (!payload)
|
|
613
773
|
throw new Error(`task not found: ${options.taskId}`);
|
|
614
774
|
printValue(payload, true);
|
|
@@ -620,9 +780,16 @@ task
|
|
|
620
780
|
.option('--reason <reason>', 'block reason', 'stale_timeout')
|
|
621
781
|
.option('--json')
|
|
622
782
|
.action((options) => {
|
|
623
|
-
const
|
|
783
|
+
const loaded = loadRuntime();
|
|
624
784
|
const hours = Number(options.hours);
|
|
625
|
-
const
|
|
785
|
+
const agentsStateDir = resolveAgentsStateDir(loaded.config);
|
|
786
|
+
const preview = findStaleTasks(loaded.paths, hours, {
|
|
787
|
+
agentsStateDir,
|
|
788
|
+
fallbackReason: options.reason,
|
|
789
|
+
});
|
|
790
|
+
const payload = options.apply
|
|
791
|
+
? applyStalePolicy(loaded.paths, hours, options.reason, { agentsStateDir })
|
|
792
|
+
: { ok: true, hours, requestedReason: options.reason, count: preview.length, tasks: preview };
|
|
626
793
|
printValue(payload, true);
|
|
627
794
|
});
|
|
628
795
|
for (const [name, status] of Object.entries(STATUS_MAP)) {
|
|
@@ -668,7 +835,16 @@ worker
|
|
|
668
835
|
.option('--project-dir <path>', 'working directory for this worker')
|
|
669
836
|
.option('--json')
|
|
670
837
|
.action((options) => {
|
|
671
|
-
const payload = prepareWorker(loadRuntime().paths, {
|
|
838
|
+
const payload = prepareWorker(loadRuntime().paths, {
|
|
839
|
+
taskId: options.taskId,
|
|
840
|
+
agentId: options.agentId,
|
|
841
|
+
description: options.description,
|
|
842
|
+
constraints: options.constraints,
|
|
843
|
+
unitId: options.unitId,
|
|
844
|
+
workPackage: options.workPackage,
|
|
845
|
+
dod: options.dod,
|
|
846
|
+
projectDir: options.projectDir,
|
|
847
|
+
});
|
|
672
848
|
if (!payload)
|
|
673
849
|
throw new Error(`task not found: ${options.taskId}`);
|
|
674
850
|
printValue(payload, true);
|
|
@@ -685,7 +861,16 @@ worker
|
|
|
685
861
|
.option('--reason <reason>')
|
|
686
862
|
.option('--json')
|
|
687
863
|
.action((options) => {
|
|
688
|
-
const payload = registerWorker(loadRuntime().paths, {
|
|
864
|
+
const payload = registerWorker(loadRuntime().paths, {
|
|
865
|
+
taskId: options.taskId,
|
|
866
|
+
agentId: options.agentId,
|
|
867
|
+
sessionKey: options.sessionKey,
|
|
868
|
+
runId: options.runId,
|
|
869
|
+
sessionId: options.sessionId,
|
|
870
|
+
unitId: options.unitId,
|
|
871
|
+
workPackage: options.workPackage,
|
|
872
|
+
reason: options.reason,
|
|
873
|
+
});
|
|
689
874
|
if (!payload)
|
|
690
875
|
throw new Error(`task not found: ${options.taskId}`);
|
|
691
876
|
printValue(payload, true);
|
|
@@ -702,7 +887,16 @@ worker
|
|
|
702
887
|
.option('--work-package <workPackage>')
|
|
703
888
|
.option('--json')
|
|
704
889
|
.action((options) => {
|
|
705
|
-
const payload = completeWorker(loadRuntime().paths, {
|
|
890
|
+
const payload = completeWorker(loadRuntime().paths, {
|
|
891
|
+
taskId: options.taskId,
|
|
892
|
+
agentId: options.agentId,
|
|
893
|
+
sessionKey: options.sessionKey,
|
|
894
|
+
runId: options.runId,
|
|
895
|
+
sessionId: options.sessionId,
|
|
896
|
+
result: options.result,
|
|
897
|
+
unitId: options.unitId,
|
|
898
|
+
workPackage: options.workPackage,
|
|
899
|
+
});
|
|
706
900
|
if (!payload)
|
|
707
901
|
throw new Error(`task not found: ${options.taskId}`);
|
|
708
902
|
printValue(payload, true);
|
|
@@ -720,10 +914,28 @@ evidence
|
|
|
720
914
|
.option('--summary <summary>')
|
|
721
915
|
.option('--tool-result <toolResult>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
722
916
|
.option('--notes <notes>')
|
|
917
|
+
.option('--dod-item <dodItem>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
918
|
+
.option('--test-case <testCase>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
919
|
+
.option('--verification-map <mapping>', 'repeatable dod=test mapping', (value, prev = []) => [...prev, value], [])
|
|
723
920
|
.option('--limit <limit>', 'transcript line limit', '40')
|
|
724
921
|
.option('--json')
|
|
725
922
|
.action((options) => {
|
|
726
|
-
const payload = collectEvidence(loadRuntime().paths, {
|
|
923
|
+
const payload = collectEvidence(loadRuntime().paths, {
|
|
924
|
+
taskId: options.taskId,
|
|
925
|
+
agentId: options.agentId,
|
|
926
|
+
runId: options.runId,
|
|
927
|
+
unitId: options.unitId,
|
|
928
|
+
sessionKey: options.sessionKey,
|
|
929
|
+
sessionId: options.sessionId,
|
|
930
|
+
transcript: options.transcript,
|
|
931
|
+
summary: options.summary,
|
|
932
|
+
toolResults: options.toolResult,
|
|
933
|
+
notes: options.notes,
|
|
934
|
+
dodItems: options.dodItem,
|
|
935
|
+
testCases: options.testCase,
|
|
936
|
+
verificationMappings: (options.verificationMap ?? []).map((item) => parseVerificationMap(item)),
|
|
937
|
+
limit: Number(options.limit),
|
|
938
|
+
});
|
|
727
939
|
if (!payload)
|
|
728
940
|
throw new Error(`task not found: ${options.taskId}`);
|
|
729
941
|
printValue(payload, true);
|
|
@@ -735,7 +947,11 @@ evidence
|
|
|
735
947
|
.option('--require-qa')
|
|
736
948
|
.option('--json')
|
|
737
949
|
.action((options) => {
|
|
738
|
-
const payload = mergeEvidence(loadRuntime().paths, {
|
|
950
|
+
const payload = mergeEvidence(loadRuntime().paths, {
|
|
951
|
+
taskId: options.taskId,
|
|
952
|
+
requiredAgents: options.requiredAgent,
|
|
953
|
+
requireQa: Boolean(options.requireQa),
|
|
954
|
+
});
|
|
739
955
|
if (!payload)
|
|
740
956
|
throw new Error(`task not found: ${options.taskId}`);
|
|
741
957
|
printValue(payload, true);
|
|
@@ -747,7 +963,10 @@ report
|
|
|
747
963
|
.option('--record-events')
|
|
748
964
|
.option('--json')
|
|
749
965
|
.action((options) => {
|
|
750
|
-
const payload = renderReport(loadRuntime().paths, {
|
|
966
|
+
const payload = renderReport(loadRuntime().paths, {
|
|
967
|
+
taskId: options.taskId,
|
|
968
|
+
recordEvents: Boolean(options.recordEvents),
|
|
969
|
+
});
|
|
751
970
|
if (!payload)
|
|
752
971
|
throw new Error(`task not found: ${options.taskId}`);
|
|
753
972
|
printValue(payload, true);
|
|
@@ -760,12 +979,23 @@ pipeline
|
|
|
760
979
|
.option('--scale <scale>', 'simple|normal|risky|large', 'normal')
|
|
761
980
|
.option('--required-agent <agent>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
762
981
|
.option('--evidence-summary <agentEqSummary>', 'repeatable', (value, prev = []) => [...prev, value], [])
|
|
982
|
+
.option('--verification-map <agentEqDodEqTest>', 'repeatable agentId=dod=test', (value, prev = []) => [...prev, value], [])
|
|
763
983
|
.option('--require-qa')
|
|
764
984
|
.option('--auto-report')
|
|
765
985
|
.option('--record-feedback')
|
|
766
986
|
.option('--json')
|
|
767
987
|
.action((options) => {
|
|
768
|
-
const payload = runPipeline(loadRuntime().paths, {
|
|
988
|
+
const payload = runPipeline(loadRuntime().paths, {
|
|
989
|
+
title: options.title,
|
|
990
|
+
description: options.description,
|
|
991
|
+
scale: options.scale,
|
|
992
|
+
requiredAgents: options.requiredAgent,
|
|
993
|
+
evidenceSummaries: options.evidenceSummary,
|
|
994
|
+
verificationMappings: options.verificationMap,
|
|
995
|
+
requireQa: Boolean(options.requireQa),
|
|
996
|
+
autoReport: Boolean(options.autoReport),
|
|
997
|
+
recordFeedback: Boolean(options.recordFeedback),
|
|
998
|
+
});
|
|
769
999
|
printValue(payload, true);
|
|
770
1000
|
});
|
|
771
1001
|
// ─── 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 {};
|