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
@@ -17,6 +17,26 @@ import {
17
17
  getTaskStatus,
18
18
  negotiateCapability,
19
19
  listPeers,
20
+ // V2 (Phase 81)
21
+ TASK_STATUS_V2,
22
+ CARD_STATUS_V2,
23
+ SUBSCRIPTION_TYPE,
24
+ NEGOTIATION_RESULT,
25
+ validateAgentCard,
26
+ setCardStatus,
27
+ getCardStatusV2,
28
+ sendTaskV2,
29
+ startWorking,
30
+ requestInput,
31
+ provideInput,
32
+ completeTaskV2,
33
+ failTaskV2,
34
+ cancelTask,
35
+ checkTaskTimeout,
36
+ getTaskV2,
37
+ listTasksV2,
38
+ negotiateCapabilityV2,
39
+ getA2AStatsV2,
20
40
  } from "../lib/a2a-protocol.js";
21
41
 
22
42
  export function registerA2aCommand(program) {
@@ -371,4 +391,364 @@ export function registerA2aCommand(program) {
371
391
  process.exit(1);
372
392
  }
373
393
  });
394
+
395
+ // ═══════════════════════════════════════════════════════════════
396
+ // Phase 81 — A2A Protocol V2
397
+ // ═══════════════════════════════════════════════════════════════
398
+
399
+ // Enum listings (no DB required)
400
+ a2a
401
+ .command("task-statuses")
402
+ .description("List V2 task statuses (Phase 81)")
403
+ .option("--json", "Output as JSON")
404
+ .action((options) => {
405
+ const statuses = Object.values(TASK_STATUS_V2);
406
+ if (options.json) console.log(JSON.stringify(statuses, null, 2));
407
+ else statuses.forEach((s) => logger.log(` ${s}`));
408
+ });
409
+
410
+ a2a
411
+ .command("card-statuses")
412
+ .description("List V2 card statuses (Phase 81)")
413
+ .option("--json", "Output as JSON")
414
+ .action((options) => {
415
+ const statuses = Object.values(CARD_STATUS_V2);
416
+ if (options.json) console.log(JSON.stringify(statuses, null, 2));
417
+ else statuses.forEach((s) => logger.log(` ${s}`));
418
+ });
419
+
420
+ a2a
421
+ .command("subscription-types")
422
+ .description("List V2 subscription types (Phase 81)")
423
+ .option("--json", "Output as JSON")
424
+ .action((options) => {
425
+ const types = Object.values(SUBSCRIPTION_TYPE);
426
+ if (options.json) console.log(JSON.stringify(types, null, 2));
427
+ else types.forEach((t) => logger.log(` ${t}`));
428
+ });
429
+
430
+ a2a
431
+ .command("negotiation-results")
432
+ .description("List V2 negotiation outcomes (Phase 81)")
433
+ .option("--json", "Output as JSON")
434
+ .action((options) => {
435
+ const outcomes = Object.values(NEGOTIATION_RESULT);
436
+ if (options.json) console.log(JSON.stringify(outcomes, null, 2));
437
+ else outcomes.forEach((o) => logger.log(` ${o}`));
438
+ });
439
+
440
+ // validate-card — pure, no DB
441
+ a2a
442
+ .command("validate-card")
443
+ .description("Validate an agent card against the A2A schema")
444
+ .argument("<name>", "Agent name")
445
+ .option("--description <desc>", "Description", "")
446
+ .option("--url <url>", "URL", "")
447
+ .option("--capabilities <csv>", "Capabilities CSV", "")
448
+ .option("--skills <csv>", "Skills CSV", "")
449
+ .option("--card-version <semver>", "Card version (major.minor.patch)")
450
+ .option("--auth-type <t>", "Auth type (none|bearer|basic|oauth2)")
451
+ .option("--json", "Output as JSON")
452
+ .action((name, options) => {
453
+ const card = {
454
+ name,
455
+ description: options.description,
456
+ url: options.url,
457
+ capabilities: options.capabilities
458
+ ? options.capabilities.split(",").map((s) => s.trim())
459
+ : [],
460
+ skills: options.skills
461
+ ? options.skills.split(",").map((s) => s.trim())
462
+ : [],
463
+ };
464
+ if (options.cardVersion) card.version = options.cardVersion;
465
+ if (options.authType) card.auth_type = options.authType;
466
+ const result = validateAgentCard(card);
467
+ if (options.json) {
468
+ console.log(JSON.stringify(result, null, 2));
469
+ } else if (result.valid) {
470
+ logger.success("Card is valid");
471
+ } else {
472
+ logger.warn("Card is invalid");
473
+ result.errors.forEach((e) => logger.log(` - ${e}`));
474
+ process.exit(1);
475
+ }
476
+ });
477
+
478
+ // set-card-status <cardId> <status>
479
+ a2a
480
+ .command("set-card-status")
481
+ .description("Transition a card between active/inactive/expired")
482
+ .argument("<cardId>", "Card ID")
483
+ .argument("<status>", "active|inactive|expired")
484
+ .option("--json", "Output as JSON")
485
+ .action(async (cardId, status, options) => {
486
+ try {
487
+ const ctx = await bootstrap({ verbose: program.opts().verbose });
488
+ const db = ctx.db?.getDatabase?.() || null;
489
+ const result = setCardStatus(db, cardId, status);
490
+ if (options.json) console.log(JSON.stringify(result, null, 2));
491
+ else logger.success(`Card ${cardId} → ${status}`);
492
+ await shutdown();
493
+ } catch (err) {
494
+ logger.error(`Failed: ${err.message}`);
495
+ process.exit(1);
496
+ }
497
+ });
498
+
499
+ // card-status <cardId>
500
+ a2a
501
+ .command("card-status")
502
+ .description("Show a card's V2 status")
503
+ .argument("<cardId>", "Card ID")
504
+ .option("--json", "Output as JSON")
505
+ .action((cardId, options) => {
506
+ const status = getCardStatusV2(cardId);
507
+ if (options.json) console.log(JSON.stringify({ cardId, status }));
508
+ else logger.log(`${cardId}: ${status}`);
509
+ });
510
+
511
+ // send-task-v2 <agentId> <input> [--timeout-ms N]
512
+ a2a
513
+ .command("send-task-v2")
514
+ .description("Submit a V2 task (in-memory, with optional timeout)")
515
+ .argument("<agentId>", "Agent ID")
516
+ .argument("<input>", "Task input")
517
+ .option("--timeout-ms <ms>", "Timeout in ms", parseInt)
518
+ .option("--json", "Output as JSON")
519
+ .action((agentId, input, options) => {
520
+ const res = sendTaskV2(null, {
521
+ agentId,
522
+ input,
523
+ timeoutMs: options.timeoutMs,
524
+ });
525
+ if (options.json) console.log(JSON.stringify(res, null, 2));
526
+ else logger.success(`Task ${res.taskId} submitted`);
527
+ });
528
+
529
+ a2a
530
+ .command("start-working")
531
+ .description("Transition a V2 task to working")
532
+ .argument("<taskId>", "Task ID")
533
+ .option("--json", "Output as JSON")
534
+ .action((taskId, options) => {
535
+ try {
536
+ const res = startWorking(null, taskId);
537
+ if (options.json) console.log(JSON.stringify(res, null, 2));
538
+ else logger.success(`Task ${taskId} → working`);
539
+ } catch (err) {
540
+ logger.error(err.message);
541
+ process.exit(1);
542
+ }
543
+ });
544
+
545
+ a2a
546
+ .command("request-input")
547
+ .description("Request user input while a V2 task is working")
548
+ .argument("<taskId>", "Task ID")
549
+ .argument("<prompt>", "Prompt to surface")
550
+ .option("--json", "Output as JSON")
551
+ .action((taskId, prompt, options) => {
552
+ try {
553
+ const res = requestInput(null, taskId, prompt);
554
+ if (options.json) console.log(JSON.stringify(res, null, 2));
555
+ else logger.success(`Task ${taskId} → input-required`);
556
+ } catch (err) {
557
+ logger.error(err.message);
558
+ process.exit(1);
559
+ }
560
+ });
561
+
562
+ a2a
563
+ .command("provide-input")
564
+ .description("Provide input for an input-required V2 task")
565
+ .argument("<taskId>", "Task ID")
566
+ .argument("<input>", "User-provided input")
567
+ .option("--json", "Output as JSON")
568
+ .action((taskId, input, options) => {
569
+ try {
570
+ const res = provideInput(null, taskId, input);
571
+ if (options.json) console.log(JSON.stringify(res, null, 2));
572
+ else logger.success(`Task ${taskId} → working`);
573
+ } catch (err) {
574
+ logger.error(err.message);
575
+ process.exit(1);
576
+ }
577
+ });
578
+
579
+ a2a
580
+ .command("complete-task-v2")
581
+ .description("Complete a V2 task (from working only)")
582
+ .argument("<taskId>", "Task ID")
583
+ .argument("[output]", "Task output", "")
584
+ .option("--json", "Output as JSON")
585
+ .action((taskId, output, options) => {
586
+ try {
587
+ const res = completeTaskV2(null, taskId, output);
588
+ if (options.json) console.log(JSON.stringify(res, null, 2));
589
+ else logger.success(`Task ${taskId} → completed`);
590
+ } catch (err) {
591
+ logger.error(err.message);
592
+ process.exit(1);
593
+ }
594
+ });
595
+
596
+ a2a
597
+ .command("fail-task-v2")
598
+ .description("Fail a V2 task with an error message")
599
+ .argument("<taskId>", "Task ID")
600
+ .argument("[error]", "Error message", "Unknown error")
601
+ .option("--json", "Output as JSON")
602
+ .action((taskId, error, options) => {
603
+ try {
604
+ const res = failTaskV2(null, taskId, error);
605
+ if (options.json) console.log(JSON.stringify(res, null, 2));
606
+ else logger.warn(`Task ${taskId} → failed`);
607
+ } catch (err) {
608
+ logger.error(err.message);
609
+ process.exit(1);
610
+ }
611
+ });
612
+
613
+ a2a
614
+ .command("cancel-task")
615
+ .description("Cancel a non-terminal V2 task")
616
+ .argument("<taskId>", "Task ID")
617
+ .argument("[reason]", "Cancel reason", "user_requested")
618
+ .option("--json", "Output as JSON")
619
+ .action((taskId, reason, options) => {
620
+ try {
621
+ const res = cancelTask(null, taskId, reason);
622
+ if (options.json) console.log(JSON.stringify(res, null, 2));
623
+ else logger.log(`Task ${taskId} → canceled`);
624
+ } catch (err) {
625
+ logger.error(err.message);
626
+ process.exit(1);
627
+ }
628
+ });
629
+
630
+ a2a
631
+ .command("check-timeout")
632
+ .description("Check V2 task timeout (auto-fails if past deadline)")
633
+ .argument("<taskId>", "Task ID")
634
+ .option("--json", "Output as JSON")
635
+ .action((taskId, options) => {
636
+ try {
637
+ const res = checkTaskTimeout(null, taskId);
638
+ if (options.json) console.log(JSON.stringify(res, null, 2));
639
+ else if (res.timedOut) logger.warn(`Task ${taskId} timed out`);
640
+ else logger.log(`Task ${taskId} status: ${res.status}`);
641
+ } catch (err) {
642
+ logger.error(err.message);
643
+ process.exit(1);
644
+ }
645
+ });
646
+
647
+ a2a
648
+ .command("task-v2")
649
+ .description("Show a V2 task snapshot")
650
+ .argument("<taskId>", "Task ID")
651
+ .option("--json", "Output as JSON")
652
+ .action((taskId, options) => {
653
+ try {
654
+ const task = getTaskV2(taskId);
655
+ if (options.json) console.log(JSON.stringify(task, null, 2));
656
+ else {
657
+ logger.log(`Task: ${task.taskId}`);
658
+ logger.log(` Agent: ${task.agentId}`);
659
+ logger.log(` Status: ${task.status}`);
660
+ logger.log(` History: ${task.history.length} entries`);
661
+ if (task.deadline)
662
+ logger.log(` Deadline: ${new Date(task.deadline).toISOString()}`);
663
+ if (task.inputPrompt) logger.log(` Prompt: ${task.inputPrompt}`);
664
+ if (task.cancelReason) logger.log(` Cancel: ${task.cancelReason}`);
665
+ }
666
+ } catch (err) {
667
+ logger.error(err.message);
668
+ process.exit(1);
669
+ }
670
+ });
671
+
672
+ a2a
673
+ .command("tasks-v2")
674
+ .description("List V2 tasks")
675
+ .option("--agent-id <id>", "Filter by agent ID")
676
+ .option("--status <s>", "Filter by status")
677
+ .option("--json", "Output as JSON")
678
+ .action((options) => {
679
+ const filter = {};
680
+ if (options.agentId) filter.agentId = options.agentId;
681
+ if (options.status) filter.status = options.status;
682
+ const tasks = listTasksV2(filter);
683
+ if (options.json) console.log(JSON.stringify(tasks, null, 2));
684
+ else {
685
+ if (!tasks.length) {
686
+ logger.log("No V2 tasks");
687
+ return;
688
+ }
689
+ tasks.forEach((t) => {
690
+ logger.log(
691
+ ` ${t.taskId} [${t.status}] agent=${t.agentId} history=${t.history.length}`,
692
+ );
693
+ });
694
+ }
695
+ });
696
+
697
+ a2a
698
+ .command("negotiate-v2")
699
+ .description("Phase 81 capability negotiation against an agent card")
700
+ .argument("<cardJson>", "Agent card as JSON string")
701
+ .option("--required <csv>", "Required capabilities CSV", "")
702
+ .option("--preferred <csv>", "Preferred capabilities CSV", "")
703
+ .option("--client-version <semver>", "Client version")
704
+ .option("--json", "Output as JSON")
705
+ .action((cardJson, options) => {
706
+ let card;
707
+ try {
708
+ card = JSON.parse(cardJson);
709
+ } catch (_err) {
710
+ logger.error("cardJson must be valid JSON");
711
+ process.exit(1);
712
+ }
713
+ const result = negotiateCapabilityV2(card, {
714
+ required: options.required
715
+ ? options.required.split(",").map((s) => s.trim())
716
+ : [],
717
+ preferred: options.preferred
718
+ ? options.preferred.split(",").map((s) => s.trim())
719
+ : [],
720
+ version: options.clientVersion,
721
+ });
722
+ if (options.json) console.log(JSON.stringify(result, null, 2));
723
+ else {
724
+ logger.log(`Result: ${result.result}`);
725
+ if (result.missingRequired.length)
726
+ logger.log(
727
+ ` Missing required: ${result.missingRequired.join(", ")}`,
728
+ );
729
+ if (result.missingPreferred.length)
730
+ logger.log(
731
+ ` Missing preferred: ${result.missingPreferred.join(", ")}`,
732
+ );
733
+ logger.log(` Version OK: ${result.versionOk}`);
734
+ }
735
+ });
736
+
737
+ a2a
738
+ .command("stats-v2")
739
+ .description("Aggregate V2 stats (tasks + cards + subscriptions)")
740
+ .option("--json", "Output as JSON")
741
+ .action((options) => {
742
+ const s = getA2AStatsV2();
743
+ if (options.json) console.log(JSON.stringify(s, null, 2));
744
+ else {
745
+ logger.log("A2A V2 Stats:");
746
+ logger.log(` Tasks total: ${s.tasks.total}`);
747
+ logger.log(` Tasks by status: ${JSON.stringify(s.tasks.byStatus)}`);
748
+ logger.log(` With deadline: ${s.tasks.withDeadline}`);
749
+ logger.log(` Cards tracked: ${s.cards.tracked}`);
750
+ logger.log(` Subs (legacy): ${s.subscriptions.legacy}`);
751
+ logger.log(` Subs (typed): ${s.subscriptions.typed}`);
752
+ }
753
+ });
374
754
  }