chainlesschain 0.51.0 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/package.json +1 -1
  2. package/src/assets/web-panel/.build-hash +1 -1
  3. package/src/assets/web-panel/assets/{AppLayout-Rvi759IS.js → AppLayout-6SPt_8Y_.js} +1 -1
  4. package/src/assets/web-panel/assets/{Dashboard-DBhFxXYQ.js → Dashboard-Br7kCwKJ.js} +2 -2
  5. package/src/assets/web-panel/assets/Dashboard-CKeMmCoT.css +1 -0
  6. package/src/assets/web-panel/assets/{index-uL0cZ8N_.js → index-tN-8TosE.js} +2 -2
  7. package/src/assets/web-panel/index.html +2 -2
  8. package/src/commands/a2a.js +380 -0
  9. package/src/commands/agent-network.js +785 -0
  10. package/src/commands/automation.js +654 -0
  11. package/src/commands/bi.js +348 -0
  12. package/src/commands/crosschain.js +218 -0
  13. package/src/commands/dao.js +565 -0
  14. package/src/commands/did-v2.js +620 -0
  15. package/src/commands/dlp.js +341 -0
  16. package/src/commands/economy.js +578 -0
  17. package/src/commands/evolution.js +391 -0
  18. package/src/commands/evomap.js +394 -0
  19. package/src/commands/federation.js +283 -0
  20. package/src/commands/hmemory.js +442 -0
  21. package/src/commands/inference.js +318 -0
  22. package/src/commands/lowcode.js +356 -0
  23. package/src/commands/marketplace.js +256 -0
  24. package/src/commands/perf.js +433 -0
  25. package/src/commands/pipeline.js +449 -0
  26. package/src/commands/plugin-ecosystem.js +517 -0
  27. package/src/commands/privacy.js +321 -0
  28. package/src/commands/reputation.js +261 -0
  29. package/src/commands/sandbox.js +401 -0
  30. package/src/commands/siem.js +246 -0
  31. package/src/commands/sla.js +259 -0
  32. package/src/commands/social.js +311 -0
  33. package/src/commands/sso.js +798 -0
  34. package/src/commands/stress.js +230 -0
  35. package/src/commands/terraform.js +245 -0
  36. package/src/commands/workflow.js +320 -0
  37. package/src/commands/zkp.js +562 -1
  38. package/src/index.js +21 -0
  39. package/src/lib/a2a-protocol.js +451 -0
  40. package/src/lib/agent-economy.js +479 -0
  41. package/src/lib/agent-network.js +1121 -0
  42. package/src/lib/app-builder.js +239 -0
  43. package/src/lib/automation-engine.js +948 -0
  44. package/src/lib/bi-engine.js +338 -0
  45. package/src/lib/cross-chain.js +345 -0
  46. package/src/lib/dao-governance.js +569 -0
  47. package/src/lib/did-v2-manager.js +1127 -0
  48. package/src/lib/dlp-engine.js +389 -0
  49. package/src/lib/evolution-system.js +453 -0
  50. package/src/lib/evomap-federation.js +177 -0
  51. package/src/lib/evomap-governance.js +276 -0
  52. package/src/lib/federation-hardening.js +259 -0
  53. package/src/lib/hierarchical-memory.js +481 -0
  54. package/src/lib/inference-network.js +330 -0
  55. package/src/lib/perf-tuning.js +734 -0
  56. package/src/lib/pipeline-orchestrator.js +928 -0
  57. package/src/lib/plugin-ecosystem.js +1109 -0
  58. package/src/lib/privacy-computing.js +427 -0
  59. package/src/lib/reputation-optimizer.js +299 -0
  60. package/src/lib/sandbox-v2.js +306 -0
  61. package/src/lib/siem-exporter.js +333 -0
  62. package/src/lib/skill-marketplace.js +325 -0
  63. package/src/lib/sla-manager.js +275 -0
  64. package/src/lib/social-graph-analytics.js +707 -0
  65. package/src/lib/sso-manager.js +841 -0
  66. package/src/lib/stress-tester.js +330 -0
  67. package/src/lib/terraform-manager.js +363 -0
  68. package/src/lib/workflow-engine.js +454 -1
  69. package/src/lib/zkp-engine.js +523 -20
  70. package/src/assets/web-panel/assets/Dashboard-BS-tzGNj.css +0 -1
@@ -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
  }