chainlesschain 0.49.0 → 0.66.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/package.json +1 -1
- package/src/assets/web-panel/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AppLayout-Rvi759IS.js → AppLayout-6SPt_8Y_.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-DBhFxXYQ.js → Dashboard-Br7kCwKJ.js} +2 -2
- package/src/assets/web-panel/assets/Dashboard-CKeMmCoT.css +1 -0
- package/src/assets/web-panel/assets/{index-uL0cZ8N_.js → index-tN-8TosE.js} +2 -2
- package/src/assets/web-panel/index.html +2 -2
- package/src/commands/agent-network.js +785 -0
- package/src/commands/automation.js +654 -0
- package/src/commands/dao.js +565 -0
- package/src/commands/did-v2.js +620 -0
- package/src/commands/economy.js +578 -0
- package/src/commands/evolution.js +391 -0
- package/src/commands/hmemory.js +442 -0
- package/src/commands/ipfs.js +392 -0
- package/src/commands/multimodal.js +404 -0
- package/src/commands/perf.js +433 -0
- package/src/commands/pipeline.js +449 -0
- package/src/commands/plugin-ecosystem.js +517 -0
- package/src/commands/sandbox.js +401 -0
- package/src/commands/social.js +311 -0
- package/src/commands/sso.js +798 -0
- package/src/commands/workflow.js +320 -0
- package/src/commands/zkp.js +227 -1
- package/src/index.js +27 -0
- package/src/lib/agent-economy.js +479 -0
- package/src/lib/agent-network.js +1121 -0
- package/src/lib/automation-engine.js +948 -0
- package/src/lib/dao-governance.js +569 -0
- package/src/lib/did-v2-manager.js +1127 -0
- package/src/lib/evolution-system.js +453 -0
- package/src/lib/hierarchical-memory.js +481 -0
- package/src/lib/ipfs-storage.js +575 -0
- package/src/lib/multimodal.js +39 -12
- package/src/lib/perf-tuning.js +734 -0
- package/src/lib/pipeline-orchestrator.js +928 -0
- package/src/lib/plugin-ecosystem.js +1109 -0
- package/src/lib/sandbox-v2.js +306 -0
- package/src/lib/social-graph-analytics.js +707 -0
- package/src/lib/sso-manager.js +841 -0
- package/src/lib/workflow-engine.js +454 -1
- package/src/lib/zkp-engine.js +249 -20
- package/src/assets/web-panel/assets/Dashboard-BS-tzGNj.css +0 -1
package/src/commands/workflow.js
CHANGED
|
@@ -16,7 +16,20 @@ import {
|
|
|
16
16
|
rollbackExecution,
|
|
17
17
|
getTemplates,
|
|
18
18
|
deleteWorkflow,
|
|
19
|
+
TEMPLATE_TYPE,
|
|
20
|
+
WORKFLOW_STATUS,
|
|
21
|
+
NODE_STATUS,
|
|
22
|
+
listTemplates,
|
|
23
|
+
createCheckpoint,
|
|
24
|
+
listCheckpoints,
|
|
25
|
+
rollbackToCheckpoint,
|
|
26
|
+
setBreakpoint,
|
|
27
|
+
listBreakpoints,
|
|
28
|
+
removeBreakpoint,
|
|
29
|
+
exportWorkflow,
|
|
30
|
+
importWorkflow,
|
|
19
31
|
} from "../lib/workflow-engine.js";
|
|
32
|
+
import fs from "fs";
|
|
20
33
|
|
|
21
34
|
export function registerWorkflowCommand(program) {
|
|
22
35
|
const workflow = program
|
|
@@ -356,4 +369,311 @@ export function registerWorkflowCommand(program) {
|
|
|
356
369
|
process.exit(1);
|
|
357
370
|
}
|
|
358
371
|
});
|
|
372
|
+
|
|
373
|
+
// workflow canonical-templates (Phase 82)
|
|
374
|
+
workflow
|
|
375
|
+
.command("canonical-templates")
|
|
376
|
+
.description(
|
|
377
|
+
"List 5 canonical Phase 82 templates (ci_cd/data_pipeline/...)",
|
|
378
|
+
)
|
|
379
|
+
.option("--json", "Output as JSON")
|
|
380
|
+
.action(async (options) => {
|
|
381
|
+
try {
|
|
382
|
+
const templates = listTemplates();
|
|
383
|
+
if (options.json) {
|
|
384
|
+
console.log(JSON.stringify(templates, null, 2));
|
|
385
|
+
} else {
|
|
386
|
+
logger.log(
|
|
387
|
+
chalk.bold(`Canonical Phase 82 Templates (${templates.length}):\n`),
|
|
388
|
+
);
|
|
389
|
+
for (const tpl of templates) {
|
|
390
|
+
logger.log(` ${chalk.cyan(tpl.id)} — ${tpl.name}`);
|
|
391
|
+
logger.log(` ${chalk.gray(tpl.description)}`);
|
|
392
|
+
logger.log(
|
|
393
|
+
` Stages: ${tpl.stages.map((s) => s.name).join(" → ")}`,
|
|
394
|
+
);
|
|
395
|
+
logger.log("");
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
} catch (err) {
|
|
399
|
+
logger.error(`Failed: ${err.message}`);
|
|
400
|
+
process.exit(1);
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
// workflow statuses (Phase 82) — enum reference
|
|
405
|
+
workflow
|
|
406
|
+
.command("statuses")
|
|
407
|
+
.description("Show workflow and node status enum values (Phase 82)")
|
|
408
|
+
.option("--json", "Output as JSON")
|
|
409
|
+
.action(async (options) => {
|
|
410
|
+
const payload = {
|
|
411
|
+
workflow: WORKFLOW_STATUS,
|
|
412
|
+
node: NODE_STATUS,
|
|
413
|
+
template: TEMPLATE_TYPE,
|
|
414
|
+
};
|
|
415
|
+
if (options.json) {
|
|
416
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
417
|
+
} else {
|
|
418
|
+
logger.log(chalk.bold("Workflow statuses:"));
|
|
419
|
+
for (const v of Object.values(WORKFLOW_STATUS)) {
|
|
420
|
+
logger.log(` ${chalk.cyan(v)}`);
|
|
421
|
+
}
|
|
422
|
+
logger.log(chalk.bold("\nNode statuses:"));
|
|
423
|
+
for (const v of Object.values(NODE_STATUS)) {
|
|
424
|
+
logger.log(` ${chalk.cyan(v)}`);
|
|
425
|
+
}
|
|
426
|
+
logger.log(chalk.bold("\nTemplate types:"));
|
|
427
|
+
for (const v of Object.values(TEMPLATE_TYPE)) {
|
|
428
|
+
logger.log(` ${chalk.cyan(v)}`);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
// workflow checkpoint <exec-id>
|
|
434
|
+
workflow
|
|
435
|
+
.command("checkpoint <exec-id>")
|
|
436
|
+
.description("Create a checkpoint snapshot of an execution")
|
|
437
|
+
.option("--json", "Output as JSON")
|
|
438
|
+
.action(async (execId, options) => {
|
|
439
|
+
try {
|
|
440
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
441
|
+
if (!ctx.db) {
|
|
442
|
+
logger.error("Database not available");
|
|
443
|
+
process.exit(1);
|
|
444
|
+
}
|
|
445
|
+
const db = ctx.db.getDatabase();
|
|
446
|
+
const cp = createCheckpoint(db, execId);
|
|
447
|
+
if (options.json) {
|
|
448
|
+
console.log(JSON.stringify(cp, null, 2));
|
|
449
|
+
} else {
|
|
450
|
+
logger.log(chalk.green(`Checkpoint created: ${cp.id}`));
|
|
451
|
+
logger.log(` Execution: ${cp.executionId}`);
|
|
452
|
+
logger.log(` Workflow: ${cp.workflowId}`);
|
|
453
|
+
logger.log(` Captured: ${cp.snapshot.capturedAt}`);
|
|
454
|
+
}
|
|
455
|
+
await shutdown();
|
|
456
|
+
} catch (err) {
|
|
457
|
+
logger.error(`Failed: ${err.message}`);
|
|
458
|
+
process.exit(1);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
// workflow checkpoints <exec-id>
|
|
463
|
+
workflow
|
|
464
|
+
.command("checkpoints <exec-id>")
|
|
465
|
+
.description("List checkpoints for an execution")
|
|
466
|
+
.option("--json", "Output as JSON")
|
|
467
|
+
.action(async (execId, options) => {
|
|
468
|
+
try {
|
|
469
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
470
|
+
if (!ctx.db) {
|
|
471
|
+
logger.error("Database not available");
|
|
472
|
+
process.exit(1);
|
|
473
|
+
}
|
|
474
|
+
const db = ctx.db.getDatabase();
|
|
475
|
+
const list = listCheckpoints(db, execId);
|
|
476
|
+
if (options.json) {
|
|
477
|
+
console.log(JSON.stringify(list, null, 2));
|
|
478
|
+
} else if (list.length === 0) {
|
|
479
|
+
logger.info("No checkpoints for this execution.");
|
|
480
|
+
} else {
|
|
481
|
+
logger.log(chalk.bold(`Checkpoints (${list.length}):\n`));
|
|
482
|
+
for (const cp of list) {
|
|
483
|
+
logger.log(
|
|
484
|
+
` ${chalk.cyan(cp.id)} — ${cp.createdAt} (stage: ${cp.snapshot.currentStage || "?"})`,
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
await shutdown();
|
|
489
|
+
} catch (err) {
|
|
490
|
+
logger.error(`Failed: ${err.message}`);
|
|
491
|
+
process.exit(1);
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
// workflow rollback-to <exec-id> <checkpoint-id>
|
|
496
|
+
workflow
|
|
497
|
+
.command("rollback-to <exec-id> <checkpoint-id>")
|
|
498
|
+
.description("Rollback an execution to a specific checkpoint")
|
|
499
|
+
.action(async (execId, cpId) => {
|
|
500
|
+
try {
|
|
501
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
502
|
+
if (!ctx.db) {
|
|
503
|
+
logger.error("Database not available");
|
|
504
|
+
process.exit(1);
|
|
505
|
+
}
|
|
506
|
+
const db = ctx.db.getDatabase();
|
|
507
|
+
const result = rollbackToCheckpoint(db, execId, cpId);
|
|
508
|
+
logger.log(
|
|
509
|
+
chalk.yellow(
|
|
510
|
+
`Rolled back execution ${result.id} to checkpoint ${result.checkpointId}`,
|
|
511
|
+
),
|
|
512
|
+
);
|
|
513
|
+
logger.log(` Status: ${chalk.cyan(result.status)}`);
|
|
514
|
+
if (result.restoredStage) {
|
|
515
|
+
logger.log(` Restored stage: ${result.restoredStage}`);
|
|
516
|
+
}
|
|
517
|
+
await shutdown();
|
|
518
|
+
} catch (err) {
|
|
519
|
+
logger.error(`Failed: ${err.message}`);
|
|
520
|
+
process.exit(1);
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
// workflow breakpoint-set <wf-id> <node-id> [condition]
|
|
525
|
+
workflow
|
|
526
|
+
.command("breakpoint-set <wf-id> <node-id>")
|
|
527
|
+
.description("Set a breakpoint on a workflow node (optionally conditional)")
|
|
528
|
+
.option(
|
|
529
|
+
"-c, --condition <expr>",
|
|
530
|
+
"Conditional expression, e.g. 'input.priority > 5'",
|
|
531
|
+
)
|
|
532
|
+
.option("--json", "Output as JSON")
|
|
533
|
+
.action(async (wfId, nodeId, options) => {
|
|
534
|
+
try {
|
|
535
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
536
|
+
if (!ctx.db) {
|
|
537
|
+
logger.error("Database not available");
|
|
538
|
+
process.exit(1);
|
|
539
|
+
}
|
|
540
|
+
const db = ctx.db.getDatabase();
|
|
541
|
+
const bp = setBreakpoint(db, wfId, nodeId, options.condition || null);
|
|
542
|
+
if (options.json) {
|
|
543
|
+
console.log(JSON.stringify(bp, null, 2));
|
|
544
|
+
} else {
|
|
545
|
+
logger.log(chalk.green(`Breakpoint set: ${bp.id}`));
|
|
546
|
+
logger.log(` Node: ${chalk.cyan(bp.nodeId)}`);
|
|
547
|
+
if (bp.condition) logger.log(` Condition: ${bp.condition}`);
|
|
548
|
+
else logger.log(` Condition: ${chalk.gray("(unconditional)")}`);
|
|
549
|
+
}
|
|
550
|
+
await shutdown();
|
|
551
|
+
} catch (err) {
|
|
552
|
+
logger.error(`Failed: ${err.message}`);
|
|
553
|
+
process.exit(1);
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
// workflow breakpoints <wf-id>
|
|
558
|
+
workflow
|
|
559
|
+
.command("breakpoints <wf-id>")
|
|
560
|
+
.description("List breakpoints on a workflow")
|
|
561
|
+
.option("--json", "Output as JSON")
|
|
562
|
+
.action(async (wfId, options) => {
|
|
563
|
+
try {
|
|
564
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
565
|
+
if (!ctx.db) {
|
|
566
|
+
logger.error("Database not available");
|
|
567
|
+
process.exit(1);
|
|
568
|
+
}
|
|
569
|
+
const db = ctx.db.getDatabase();
|
|
570
|
+
const list = listBreakpoints(db, wfId);
|
|
571
|
+
if (options.json) {
|
|
572
|
+
console.log(JSON.stringify(list, null, 2));
|
|
573
|
+
} else if (list.length === 0) {
|
|
574
|
+
logger.info("No breakpoints for this workflow.");
|
|
575
|
+
} else {
|
|
576
|
+
logger.log(chalk.bold(`Breakpoints (${list.length}):\n`));
|
|
577
|
+
for (const bp of list) {
|
|
578
|
+
logger.log(
|
|
579
|
+
` ${chalk.cyan(bp.id)} @ node=${bp.nodeId} ${bp.enabled ? chalk.green("enabled") : chalk.gray("disabled")}`,
|
|
580
|
+
);
|
|
581
|
+
if (bp.condition) logger.log(` when: ${bp.condition}`);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
await shutdown();
|
|
585
|
+
} catch (err) {
|
|
586
|
+
logger.error(`Failed: ${err.message}`);
|
|
587
|
+
process.exit(1);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
// workflow breakpoint-remove <bp-id>
|
|
592
|
+
workflow
|
|
593
|
+
.command("breakpoint-remove <bp-id>")
|
|
594
|
+
.description("Remove a breakpoint")
|
|
595
|
+
.action(async (bpId) => {
|
|
596
|
+
try {
|
|
597
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
598
|
+
if (!ctx.db) {
|
|
599
|
+
logger.error("Database not available");
|
|
600
|
+
process.exit(1);
|
|
601
|
+
}
|
|
602
|
+
const db = ctx.db.getDatabase();
|
|
603
|
+
const result = removeBreakpoint(db, bpId);
|
|
604
|
+
if (result.removed) {
|
|
605
|
+
logger.log(chalk.green(`Breakpoint removed: ${bpId}`));
|
|
606
|
+
} else {
|
|
607
|
+
logger.warn(`Breakpoint not found: ${bpId}`);
|
|
608
|
+
}
|
|
609
|
+
await shutdown();
|
|
610
|
+
} catch (err) {
|
|
611
|
+
logger.error(`Failed: ${err.message}`);
|
|
612
|
+
process.exit(1);
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
// workflow export <wf-id>
|
|
617
|
+
workflow
|
|
618
|
+
.command("export <wf-id>")
|
|
619
|
+
.description("Export a workflow as a JSON definition")
|
|
620
|
+
.option("-o, --output <file>", "Write to file instead of stdout")
|
|
621
|
+
.action(async (wfId, options) => {
|
|
622
|
+
try {
|
|
623
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
624
|
+
if (!ctx.db) {
|
|
625
|
+
logger.error("Database not available");
|
|
626
|
+
process.exit(1);
|
|
627
|
+
}
|
|
628
|
+
const db = ctx.db.getDatabase();
|
|
629
|
+
const def = exportWorkflow(db, wfId);
|
|
630
|
+
const json = JSON.stringify(def, null, 2);
|
|
631
|
+
if (options.output) {
|
|
632
|
+
fs.writeFileSync(options.output, json, "utf-8");
|
|
633
|
+
logger.log(chalk.green(`Exported to ${options.output}`));
|
|
634
|
+
} else {
|
|
635
|
+
console.log(json);
|
|
636
|
+
}
|
|
637
|
+
await shutdown();
|
|
638
|
+
} catch (err) {
|
|
639
|
+
logger.error(`Failed: ${err.message}`);
|
|
640
|
+
process.exit(1);
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
// workflow import <file>
|
|
645
|
+
workflow
|
|
646
|
+
.command("import <file>")
|
|
647
|
+
.description("Import a workflow from a JSON definition file")
|
|
648
|
+
.option("--json", "Output as JSON")
|
|
649
|
+
.action(async (file, options) => {
|
|
650
|
+
try {
|
|
651
|
+
const raw = fs.readFileSync(file, "utf-8");
|
|
652
|
+
let def;
|
|
653
|
+
try {
|
|
654
|
+
def = JSON.parse(raw);
|
|
655
|
+
} catch (_err) {
|
|
656
|
+
logger.error(`Invalid JSON in ${file}`);
|
|
657
|
+
process.exit(1);
|
|
658
|
+
}
|
|
659
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
660
|
+
if (!ctx.db) {
|
|
661
|
+
logger.error("Database not available");
|
|
662
|
+
process.exit(1);
|
|
663
|
+
}
|
|
664
|
+
const db = ctx.db.getDatabase();
|
|
665
|
+
const result = importWorkflow(db, def);
|
|
666
|
+
if (options.json) {
|
|
667
|
+
console.log(JSON.stringify(result, null, 2));
|
|
668
|
+
} else {
|
|
669
|
+
logger.log(chalk.green(`Workflow imported: ${result.id}`));
|
|
670
|
+
logger.log(` Name: ${chalk.cyan(def.name)}`);
|
|
671
|
+
logger.log(` Stages: ${result.stages.length}`);
|
|
672
|
+
}
|
|
673
|
+
await shutdown();
|
|
674
|
+
} catch (err) {
|
|
675
|
+
logger.error(`Failed: ${err.message}`);
|
|
676
|
+
process.exit(1);
|
|
677
|
+
}
|
|
678
|
+
});
|
|
359
679
|
}
|
package/src/commands/zkp.js
CHANGED
|
@@ -15,6 +15,13 @@ import {
|
|
|
15
15
|
getZKPStats,
|
|
16
16
|
listCircuits,
|
|
17
17
|
listProofs,
|
|
18
|
+
PROOF_SCHEME,
|
|
19
|
+
CIRCUIT_STATUS,
|
|
20
|
+
SUPPORTED_SCHEMES,
|
|
21
|
+
setCircuitStatus,
|
|
22
|
+
registerCredential,
|
|
23
|
+
selectiveDisclose,
|
|
24
|
+
listCredentials,
|
|
18
25
|
} from "../lib/zkp-engine.js";
|
|
19
26
|
|
|
20
27
|
export function registerZkpCommand(program) {
|
|
@@ -61,6 +68,7 @@ export function registerZkpCommand(program) {
|
|
|
61
68
|
.description("Generate a zero-knowledge proof")
|
|
62
69
|
.option("--private <json>", "Private inputs as JSON")
|
|
63
70
|
.option("--public <json>", "Public inputs as JSON")
|
|
71
|
+
.option("--scheme <scheme>", "Proof scheme (groth16|plonk|bulletproofs)")
|
|
64
72
|
.option("--json", "Output as JSON")
|
|
65
73
|
.action(async (circuitId, options) => {
|
|
66
74
|
try {
|
|
@@ -76,7 +84,14 @@ export function registerZkpCommand(program) {
|
|
|
76
84
|
? JSON.parse(options.private)
|
|
77
85
|
: {};
|
|
78
86
|
const publicInputs = options.public ? JSON.parse(options.public) : [];
|
|
79
|
-
const
|
|
87
|
+
const proveOpts = options.scheme ? { scheme: options.scheme } : {};
|
|
88
|
+
const proof = generateProof(
|
|
89
|
+
db,
|
|
90
|
+
circuitId,
|
|
91
|
+
privateInputs,
|
|
92
|
+
publicInputs,
|
|
93
|
+
proveOpts,
|
|
94
|
+
);
|
|
80
95
|
|
|
81
96
|
if (options.json) {
|
|
82
97
|
console.log(JSON.stringify(proof, null, 2));
|
|
@@ -188,6 +203,27 @@ export function registerZkpCommand(program) {
|
|
|
188
203
|
logger.log(
|
|
189
204
|
` ${chalk.bold("Verified:")} ${stats.verifiedProofs}`,
|
|
190
205
|
);
|
|
206
|
+
if (stats.credentials !== undefined) {
|
|
207
|
+
logger.log(
|
|
208
|
+
` ${chalk.bold("Credentials:")} ${stats.credentials}`,
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
if (stats.proofsByScheme) {
|
|
212
|
+
logger.log(` ${chalk.bold("By scheme:")}`);
|
|
213
|
+
for (const [scheme, count] of Object.entries(
|
|
214
|
+
stats.proofsByScheme,
|
|
215
|
+
)) {
|
|
216
|
+
logger.log(` ${scheme}: ${count}`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (stats.circuitsByStatus) {
|
|
220
|
+
logger.log(` ${chalk.bold("Circuit status:")}`);
|
|
221
|
+
for (const [status, count] of Object.entries(
|
|
222
|
+
stats.circuitsByStatus,
|
|
223
|
+
)) {
|
|
224
|
+
logger.log(` ${status}: ${count}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
191
227
|
}
|
|
192
228
|
|
|
193
229
|
await shutdown();
|
|
@@ -268,6 +304,196 @@ export function registerZkpCommand(program) {
|
|
|
268
304
|
}
|
|
269
305
|
}
|
|
270
306
|
|
|
307
|
+
await shutdown();
|
|
308
|
+
} catch (err) {
|
|
309
|
+
logger.error(`Failed: ${err.message}`);
|
|
310
|
+
process.exit(1);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// zkp schemes
|
|
315
|
+
zkp
|
|
316
|
+
.command("schemes")
|
|
317
|
+
.description("List supported proof schemes and circuit statuses")
|
|
318
|
+
.option("--json", "Output as JSON")
|
|
319
|
+
.action((options) => {
|
|
320
|
+
try {
|
|
321
|
+
const payload = {
|
|
322
|
+
schemes: Array.from(SUPPORTED_SCHEMES),
|
|
323
|
+
proofSchemes: { ...PROOF_SCHEME },
|
|
324
|
+
circuitStatuses: { ...CIRCUIT_STATUS },
|
|
325
|
+
};
|
|
326
|
+
if (options.json) {
|
|
327
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
328
|
+
} else {
|
|
329
|
+
logger.log(chalk.bold("Proof schemes:"));
|
|
330
|
+
for (const [key, val] of Object.entries(PROOF_SCHEME)) {
|
|
331
|
+
logger.log(` ${chalk.cyan(key)} → ${val}`);
|
|
332
|
+
}
|
|
333
|
+
logger.log(chalk.bold("Circuit statuses:"));
|
|
334
|
+
for (const [key, val] of Object.entries(CIRCUIT_STATUS)) {
|
|
335
|
+
logger.log(` ${chalk.cyan(key)} → ${val}`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
} catch (err) {
|
|
339
|
+
logger.error(`Failed: ${err.message}`);
|
|
340
|
+
process.exit(1);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
// zkp set-status
|
|
345
|
+
zkp
|
|
346
|
+
.command("set-status <circuit-id> <status>")
|
|
347
|
+
.description("Update circuit status (draft|compiled|verified|failed)")
|
|
348
|
+
.action(async (circuitId, status) => {
|
|
349
|
+
try {
|
|
350
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
351
|
+
if (!ctx.db) {
|
|
352
|
+
logger.error("Database not available");
|
|
353
|
+
process.exit(1);
|
|
354
|
+
}
|
|
355
|
+
const db = ctx.db.getDatabase();
|
|
356
|
+
ensureZKPTables(db);
|
|
357
|
+
|
|
358
|
+
const result = setCircuitStatus(db, circuitId, status);
|
|
359
|
+
logger.success(
|
|
360
|
+
`Circuit ${chalk.cyan(circuitId.slice(0, 8))} → ${chalk.bold(result.status)}`,
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
await shutdown();
|
|
364
|
+
} catch (err) {
|
|
365
|
+
logger.error(`Failed: ${err.message}`);
|
|
366
|
+
process.exit(1);
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
// zkp register-credential
|
|
371
|
+
zkp
|
|
372
|
+
.command("register-credential")
|
|
373
|
+
.description("Register a credential with selective-disclosure merkle root")
|
|
374
|
+
.option("--did <did>", "Subject DID")
|
|
375
|
+
.option("--claims <json>", "Credential claims as JSON")
|
|
376
|
+
.option("--json", "Output as JSON")
|
|
377
|
+
.action(async (options) => {
|
|
378
|
+
try {
|
|
379
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
380
|
+
if (!ctx.db) {
|
|
381
|
+
logger.error("Database not available");
|
|
382
|
+
process.exit(1);
|
|
383
|
+
}
|
|
384
|
+
const db = ctx.db.getDatabase();
|
|
385
|
+
ensureZKPTables(db);
|
|
386
|
+
|
|
387
|
+
const claims = options.claims ? JSON.parse(options.claims) : {};
|
|
388
|
+
const cred = registerCredential(db, {
|
|
389
|
+
did: options.did,
|
|
390
|
+
claims,
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
if (options.json) {
|
|
394
|
+
console.log(JSON.stringify(cred, null, 2));
|
|
395
|
+
} else {
|
|
396
|
+
logger.success("Credential registered");
|
|
397
|
+
logger.log(` ${chalk.bold("ID:")} ${chalk.cyan(cred.id)}`);
|
|
398
|
+
logger.log(` ${chalk.bold("DID:")} ${cred.did || "-"}`);
|
|
399
|
+
logger.log(
|
|
400
|
+
` ${chalk.bold("MerkleRoot:")} ${cred.merkleRoot.slice(0, 16)}...`,
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
await shutdown();
|
|
405
|
+
} catch (err) {
|
|
406
|
+
logger.error(`Failed: ${err.message}`);
|
|
407
|
+
process.exit(1);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// zkp disclose
|
|
412
|
+
zkp
|
|
413
|
+
.command("disclose <credential-id> <fields>")
|
|
414
|
+
.description(
|
|
415
|
+
"Selectively disclose credential fields (comma-separated field list)",
|
|
416
|
+
)
|
|
417
|
+
.option("--to <did>", "Recipient DID")
|
|
418
|
+
.option("--json", "Output as JSON")
|
|
419
|
+
.action(async (credentialId, fields, options) => {
|
|
420
|
+
try {
|
|
421
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
422
|
+
if (!ctx.db) {
|
|
423
|
+
logger.error("Database not available");
|
|
424
|
+
process.exit(1);
|
|
425
|
+
}
|
|
426
|
+
const db = ctx.db.getDatabase();
|
|
427
|
+
ensureZKPTables(db);
|
|
428
|
+
|
|
429
|
+
const disclosed = fields
|
|
430
|
+
.split(",")
|
|
431
|
+
.map((s) => s.trim())
|
|
432
|
+
.filter(Boolean);
|
|
433
|
+
const result = selectiveDisclose(
|
|
434
|
+
db,
|
|
435
|
+
credentialId,
|
|
436
|
+
disclosed,
|
|
437
|
+
options.to,
|
|
438
|
+
);
|
|
439
|
+
|
|
440
|
+
if (options.json) {
|
|
441
|
+
console.log(JSON.stringify(result, null, 2));
|
|
442
|
+
} else {
|
|
443
|
+
logger.success("Selective disclosure created");
|
|
444
|
+
logger.log(
|
|
445
|
+
` ${chalk.bold("ID:")} ${chalk.cyan(result.id)}`,
|
|
446
|
+
);
|
|
447
|
+
logger.log(` ${chalk.bold("Credential:")} ${result.credentialId}`);
|
|
448
|
+
logger.log(
|
|
449
|
+
` ${chalk.bold("Disclosed:")} ${JSON.stringify(result.disclosed)}`,
|
|
450
|
+
);
|
|
451
|
+
logger.log(
|
|
452
|
+
` ${chalk.bold("Hidden:")} ${result.hiddenCount} field(s)`,
|
|
453
|
+
);
|
|
454
|
+
logger.log(
|
|
455
|
+
` ${chalk.bold("MerkleRoot:")} ${result.merkleRoot.slice(0, 16)}...`,
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
await shutdown();
|
|
460
|
+
} catch (err) {
|
|
461
|
+
logger.error(`Failed: ${err.message}`);
|
|
462
|
+
process.exit(1);
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// zkp credentials
|
|
467
|
+
zkp
|
|
468
|
+
.command("credentials")
|
|
469
|
+
.description("List registered credentials")
|
|
470
|
+
.option("--did <did>", "Filter by subject DID")
|
|
471
|
+
.option("--json", "Output as JSON")
|
|
472
|
+
.action(async (options) => {
|
|
473
|
+
try {
|
|
474
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
475
|
+
if (!ctx.db) {
|
|
476
|
+
logger.error("Database not available");
|
|
477
|
+
process.exit(1);
|
|
478
|
+
}
|
|
479
|
+
const db = ctx.db.getDatabase();
|
|
480
|
+
ensureZKPTables(db);
|
|
481
|
+
|
|
482
|
+
const creds = listCredentials(db, { did: options.did });
|
|
483
|
+
if (options.json) {
|
|
484
|
+
console.log(JSON.stringify(creds, null, 2));
|
|
485
|
+
} else {
|
|
486
|
+
if (creds.length === 0) {
|
|
487
|
+
logger.log("No credentials registered");
|
|
488
|
+
} else {
|
|
489
|
+
for (const c of creds) {
|
|
490
|
+
logger.log(
|
|
491
|
+
` ${chalk.cyan(c.id.slice(0, 8))} ${c.did || "(no-did)"} — root ${c.merkleRoot.slice(0, 12)}...`,
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
271
497
|
await shutdown();
|
|
272
498
|
} catch (err) {
|
|
273
499
|
logger.error(`Failed: ${err.message}`);
|
package/src/index.js
CHANGED
|
@@ -157,6 +157,24 @@ import { registerNlProgCommand } from "./commands/nlprog.js";
|
|
|
157
157
|
import { registerQuantizationCommand } from "./commands/quantization.js";
|
|
158
158
|
// Phase 63: Universal Runtime
|
|
159
159
|
import { registerRuntimeCommand } from "./commands/runtime.js";
|
|
160
|
+
// Phase 17: IPFS decentralized storage
|
|
161
|
+
import { registerIpfsCommand } from "./commands/ipfs.js";
|
|
162
|
+
// Phase 27: Multimodal Collaboration
|
|
163
|
+
import { registerMultimodalCommand } from "./commands/multimodal.js";
|
|
164
|
+
// Phase 22: Performance auto-tuning
|
|
165
|
+
import { registerPerfCommand } from "./commands/perf.js";
|
|
166
|
+
// Phase 24: Decentralized Agent Network
|
|
167
|
+
import { registerAgentNetworkCommand } from "./commands/agent-network.js";
|
|
168
|
+
// Phase 55: DID v2.0 — W3C DID + Verifiable Presentations + social recovery
|
|
169
|
+
import { registerDIDv2Command } from "./commands/did-v2.js";
|
|
170
|
+
// Phase 26: Development Pipeline Orchestration (7-stage AI pipeline + gates)
|
|
171
|
+
import { registerPipelineCommand } from "./commands/pipeline.js";
|
|
172
|
+
// Phase 64: Plugin Ecosystem 2.0 (registry + deps + install + AI review + publish + revenue)
|
|
173
|
+
import { registerPluginEcosystemCommand } from "./commands/plugin-ecosystem.js";
|
|
174
|
+
// Phase 96: Workflow Automation Engine (12 SaaS connectors + 5 triggers + DAG execution)
|
|
175
|
+
import { registerAutomationCommand } from "./commands/automation.js";
|
|
176
|
+
// Phase 14: SSO Enterprise Authentication (SAML / OAuth2 / OIDC + session lifecycle + DID bridge)
|
|
177
|
+
import { registerSsoCommand } from "./commands/sso.js";
|
|
160
178
|
|
|
161
179
|
export function createProgram() {
|
|
162
180
|
const program = new Command();
|
|
@@ -336,6 +354,15 @@ export function createProgram() {
|
|
|
336
354
|
registerNlProgCommand(program);
|
|
337
355
|
registerQuantizationCommand(program);
|
|
338
356
|
registerRuntimeCommand(program);
|
|
357
|
+
registerIpfsCommand(program);
|
|
358
|
+
registerMultimodalCommand(program);
|
|
359
|
+
registerPerfCommand(program);
|
|
360
|
+
registerAgentNetworkCommand(program);
|
|
361
|
+
registerDIDv2Command(program);
|
|
362
|
+
registerPipelineCommand(program);
|
|
363
|
+
registerPluginEcosystemCommand(program);
|
|
364
|
+
registerAutomationCommand(program);
|
|
365
|
+
registerSsoCommand(program);
|
|
339
366
|
|
|
340
367
|
return program;
|
|
341
368
|
}
|