cool-workflow 0.1.80 → 0.1.82

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 (122) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/README.md +42 -2
  4. package/apps/architecture-review/app.json +1 -1
  5. package/apps/architecture-review-fast/app.json +1 -1
  6. package/apps/end-to-end-golden-path/app.json +1 -1
  7. package/apps/pr-review-fix-ci/app.json +1 -1
  8. package/apps/release-cut/app.json +1 -1
  9. package/apps/research-synthesis/app.json +1 -1
  10. package/dist/agent-config.js +21 -7
  11. package/dist/candidate-scoring.js +62 -48
  12. package/dist/capability-core.js +152 -96
  13. package/dist/capability-registry.js +160 -174
  14. package/dist/cli.js +90 -100
  15. package/dist/collaboration.js +5 -6
  16. package/dist/commit.js +232 -209
  17. package/dist/compare.js +18 -0
  18. package/dist/coordinator/classify.js +45 -0
  19. package/dist/coordinator/paths.js +42 -0
  20. package/dist/coordinator/util.js +126 -0
  21. package/dist/coordinator.js +127 -300
  22. package/dist/dispatch.js +46 -3
  23. package/dist/drive.js +7 -7
  24. package/dist/error-feedback.js +8 -4
  25. package/dist/evidence-reasoning.js +5 -2
  26. package/dist/execution-backend/agent.js +294 -0
  27. package/dist/execution-backend/probes.js +96 -0
  28. package/dist/execution-backend/util.js +47 -0
  29. package/dist/execution-backend.js +77 -450
  30. package/dist/gates.js +48 -0
  31. package/dist/mcp-server.js +34 -173
  32. package/dist/multi-agent/graph.js +84 -0
  33. package/dist/multi-agent/helpers.js +141 -0
  34. package/dist/multi-agent/ids.js +20 -0
  35. package/dist/multi-agent/paths.js +22 -0
  36. package/dist/multi-agent-eval/format.js +194 -0
  37. package/dist/multi-agent-eval/normalize.js +51 -0
  38. package/dist/multi-agent-eval.js +63 -242
  39. package/dist/multi-agent-host.js +53 -40
  40. package/dist/multi-agent-operator-ux.js +2 -1
  41. package/dist/multi-agent-trust.js +5 -5
  42. package/dist/multi-agent.js +125 -314
  43. package/dist/node-projection.js +59 -0
  44. package/dist/node-snapshot.js +11 -21
  45. package/dist/observability/format.js +61 -0
  46. package/dist/observability/intake.js +98 -0
  47. package/dist/observability.js +14 -160
  48. package/dist/operator-ux/format.js +364 -0
  49. package/dist/operator-ux.js +22 -363
  50. package/dist/orchestrator/lifecycle-operations.js +22 -1
  51. package/dist/orchestrator/report.js +8 -0
  52. package/dist/orchestrator.js +41 -10
  53. package/dist/reclamation.js +32 -55
  54. package/dist/run-export.js +138 -14
  55. package/dist/run-registry/derive.js +172 -0
  56. package/dist/run-registry/format.js +124 -0
  57. package/dist/run-registry/gc.js +251 -0
  58. package/dist/run-registry/policy.js +16 -0
  59. package/dist/run-registry/queue.js +116 -0
  60. package/dist/run-registry.js +78 -593
  61. package/dist/run-state-schema.js +1 -0
  62. package/dist/sandbox-profile.js +43 -2
  63. package/dist/scheduler.js +34 -4
  64. package/dist/state-explosion/format.js +159 -0
  65. package/dist/state-explosion/helpers.js +82 -0
  66. package/dist/state-explosion.js +65 -283
  67. package/dist/state-node.js +19 -4
  68. package/dist/telemetry-attestation.js +55 -0
  69. package/dist/telemetry-demo.js +15 -3
  70. package/dist/telemetry-ledger.js +60 -15
  71. package/dist/topology.js +50 -12
  72. package/dist/triggers.js +33 -14
  73. package/dist/trust-audit.js +215 -71
  74. package/dist/validation.js +328 -0
  75. package/dist/version.js +1 -1
  76. package/dist/worker-isolation/helpers.js +51 -0
  77. package/dist/worker-isolation/paths.js +46 -0
  78. package/dist/worker-isolation.js +182 -173
  79. package/docs/agent-delegation-drive.7.md +14 -0
  80. package/docs/cli-mcp-parity.7.md +5 -0
  81. package/docs/contract-migration-tooling.7.md +3 -0
  82. package/docs/control-plane-scheduling.7.md +3 -0
  83. package/docs/dogfood/resume-drive-real-agent-2026-06-14.md +40 -0
  84. package/docs/durable-state-and-locking.7.md +5 -0
  85. package/docs/evidence-adoption-reasoning-chain.7.md +3 -0
  86. package/docs/execution-backends.7.md +3 -0
  87. package/docs/index.md +1 -0
  88. package/docs/launch/launch-kit.md +46 -23
  89. package/docs/launch/pre-launch-checklist.md +14 -14
  90. package/docs/multi-agent-cli-mcp-surface.7.md +5 -0
  91. package/docs/multi-agent-eval-replay-harness.7.md +3 -0
  92. package/docs/multi-agent-operator-ux.7.md +3 -0
  93. package/docs/multi-agent-trust-policy-audit.7.md +27 -0
  94. package/docs/node-snapshot-diff-replay.7.md +3 -0
  95. package/docs/observability-cost-accounting.7.md +3 -0
  96. package/docs/project-index.md +23 -6
  97. package/docs/real-execution-backends.7.md +3 -0
  98. package/docs/release-and-migration.7.md +5 -0
  99. package/docs/release-tooling.7.md +35 -2
  100. package/docs/run-registry-control-plane.7.md +55 -8
  101. package/docs/run-retention-reclamation.7.md +5 -0
  102. package/docs/state-explosion-management.7.md +3 -0
  103. package/docs/team-collaboration.7.md +3 -0
  104. package/docs/trust-model.md +267 -0
  105. package/docs/vendor-manifest-loadability.7.md +43 -0
  106. package/docs/web-desktop-workbench.7.md +3 -0
  107. package/manifest/plugin.manifest.json +1 -1
  108. package/manifest/source-context-profiles.json +1 -1
  109. package/package.json +4 -2
  110. package/scripts/agents/builtin-templates.json +7 -0
  111. package/scripts/bump-version.js +5 -11
  112. package/scripts/canonical-apps-list.js +64 -0
  113. package/scripts/canonical-apps.js +19 -4
  114. package/scripts/children/batch-delegate-child.js +58 -0
  115. package/scripts/children/http-delegate-child.js +39 -0
  116. package/scripts/dogfood-release.js +1 -1
  117. package/scripts/golden-path.js +4 -4
  118. package/scripts/parity-check.js +5 -0
  119. package/scripts/release-check.js +5 -1
  120. package/scripts/release-flow.js +181 -5
  121. package/scripts/version-sync-check.js +5 -8
  122. package/dist/capability-dispatcher.js +0 -86
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hostRun = hostRun;
4
4
  exports.hostStatus = hostStatus;
5
5
  exports.hostStep = hostStep;
6
- exports.hostAutoStep = hostAutoStep;
7
6
  exports.hostBlackboard = hostBlackboard;
8
7
  exports.hostScore = hostScore;
9
8
  exports.hostSelect = hostSelect;
@@ -179,24 +178,6 @@ function hostStep(run, options = {}) {
179
178
  requiredHostAction: "No safe deterministic step is available. Use multi-agent status for the next explicit command."
180
179
  });
181
180
  }
182
- /** Auto-step: loop hostStep until blocked, complete, or max iterations reached
183
- * (v0.1.74). Each iteration performs one deterministic step. Returns the final
184
- * response and the number of steps taken. */
185
- function hostAutoStep(run, options = {}) {
186
- const maxSteps = Number(options.maxSteps || options["max-steps"] || 20);
187
- const steps = [];
188
- let response = envelope(run, "step", { performed: "none" });
189
- for (let i = 0; i < maxSteps; i++) {
190
- response = hostStep(run, options);
191
- const performed = response.data?.performed;
192
- steps.push({ step: i + 1, performed: String(performed || "none") });
193
- if (performed === "none" || performed === undefined)
194
- break;
195
- if (response.data?.requiredHostAction)
196
- break;
197
- }
198
- return { finalResponse: response, stepsTaken: steps.length, steps };
199
- }
200
181
  function hostBlackboard(run, action, options = {}) {
201
182
  const topology = optionalSingleActiveTopology(run);
202
183
  const blackboardId = resolveHostBlackboardId(run, topology, options);
@@ -403,22 +384,54 @@ function hostSelect(run, options = {}) {
403
384
  }
404
385
  return envelope(run, "select", { performed: "selected-candidate", data: selection });
405
386
  }
387
+ function memoize(compute) {
388
+ let cached;
389
+ return (run) => (cached ??= { value: compute(run) }).value;
390
+ }
391
+ function createHostSummaryCache(run) {
392
+ const topologies = memoize(topology_1.summarizeTopologies);
393
+ const multiAgent = memoize(multi_agent_1.summarizeMultiAgent);
394
+ const blackboard = memoize(coordinator_1.summarizeBlackboard);
395
+ const workers = memoize(operator_ux_1.summarizeOperatorWorkers);
396
+ const candidates = memoize(operator_ux_1.summarizeOperatorCandidates);
397
+ const feedback = memoize(operator_ux_1.summarizeOperatorFeedback);
398
+ const commits = memoize(operator_ux_1.summarizeOperatorCommits);
399
+ const trust = memoize(trust_audit_1.summarizeTrustAudit);
400
+ const operator = memoize(operator_ux_1.summarizeOperatorRun);
401
+ const multiAgentOperator = memoize(multi_agent_operator_ux_1.summarizeMultiAgentOperator);
402
+ const active = memoize(activeTopologies);
403
+ return {
404
+ run,
405
+ topologies: () => topologies(run),
406
+ multiAgent: () => multiAgent(run),
407
+ blackboard: () => blackboard(run),
408
+ workers: () => workers(run),
409
+ candidates: () => candidates(run),
410
+ feedback: () => feedback(run),
411
+ commits: () => commits(run),
412
+ trust: () => trust(run),
413
+ operator: () => operator(run),
414
+ multiAgentOperator: () => multiAgentOperator(run),
415
+ active: () => active(run)
416
+ };
417
+ }
406
418
  function envelope(run, command, options = {}) {
407
- const topologies = (0, topology_1.summarizeTopologies)(run);
408
- const multiAgent = (0, multi_agent_1.summarizeMultiAgent)(run);
409
- const blackboard = (0, coordinator_1.summarizeBlackboard)(run);
410
- const workers = (0, operator_ux_1.summarizeOperatorWorkers)(run);
411
- const candidates = (0, operator_ux_1.summarizeOperatorCandidates)(run);
412
- const feedback = (0, operator_ux_1.summarizeOperatorFeedback)(run);
413
- const commits = (0, operator_ux_1.summarizeOperatorCommits)(run);
414
- const trust = (0, trust_audit_1.summarizeTrustAudit)(run);
415
- const operator = (0, operator_ux_1.summarizeOperatorRun)(run);
416
- const multiAgentOperator = (0, multi_agent_operator_ux_1.summarizeMultiAgentOperator)(run);
417
- const active = activeTopologies(run);
419
+ const cache = createHostSummaryCache(run);
420
+ const topologies = cache.topologies();
421
+ const multiAgent = cache.multiAgent();
422
+ const blackboard = cache.blackboard();
423
+ const workers = cache.workers();
424
+ const candidates = cache.candidates();
425
+ const feedback = cache.feedback();
426
+ const commits = cache.commits();
427
+ const trust = cache.trust();
428
+ const operator = cache.operator();
429
+ const multiAgentOperator = cache.multiAgentOperator();
430
+ const active = cache.active();
418
431
  const blockedReasons = unique([...operator.blockedReasons, ...(options.extraBlockedReasons || [])]);
419
- const state = blockedReasons.length ? "blocked" : classifyHostState(run);
432
+ const state = blockedReasons.length ? "blocked" : classifyHostState(run, cache);
420
433
  const ids = activeIds(run, active);
421
- const nextActions = hostNextActions(run, state, active, options.requiredHostAction);
434
+ const nextActions = hostNextActions(run, state, active, options.requiredHostAction, cache);
422
435
  return {
423
436
  schemaVersion: 1,
424
437
  surface: "multi-agent-host",
@@ -446,12 +459,12 @@ function envelope(run, command, options = {}) {
446
459
  data: options.data
447
460
  };
448
461
  }
449
- function classifyHostState(run) {
450
- const active = activeTopologies(run);
451
- const feedback = (0, operator_ux_1.summarizeOperatorFeedback)(run);
452
- const workers = (0, operator_ux_1.summarizeOperatorWorkers)(run);
453
- const candidates = (0, operator_ux_1.summarizeOperatorCandidates)(run);
454
- const commits = (0, operator_ux_1.summarizeOperatorCommits)(run);
462
+ function classifyHostState(run, cache = createHostSummaryCache(run)) {
463
+ const active = cache.active();
464
+ const feedback = cache.feedback();
465
+ const workers = cache.workers();
466
+ const candidates = cache.candidates();
467
+ const commits = cache.commits();
455
468
  if (!active.length && !(run.multiAgent?.runs || []).length)
456
469
  return "needs-run";
457
470
  if (feedback.open.some((entry) => !entry.retryable))
@@ -494,7 +507,7 @@ function activeIds(run, active) {
494
507
  auditEventIds: unique(active.flatMap((entry) => entry.links.auditEventIds))
495
508
  };
496
509
  }
497
- function hostNextActions(run, state, active, requiredHostAction) {
510
+ function hostNextActions(run, state, active, requiredHostAction, cache = createHostSummaryCache(run)) {
498
511
  if (requiredHostAction)
499
512
  return [{ command: "host-action", reason: requiredHostAction, priority: "high" }];
500
513
  const runId = run.id;
@@ -512,7 +525,7 @@ function hostNextActions(run, state, active, requiredHostAction) {
512
525
  case "ready-for-selection":
513
526
  return [{ command: `node scripts/cw.js multi-agent select ${runId} --candidate <candidate-id> --reason "<rationale>"`, reason: "Select a scored candidate after verifier gates pass.", priority: "high" }];
514
527
  case "ready-for-commit": {
515
- const ready = (0, operator_ux_1.summarizeOperatorCandidates)(run).readyForCommit[0];
528
+ const ready = cache.candidates().readyForCommit[0];
516
529
  return [{ command: `node scripts/cw.js commit ${runId} --selection ${ready.selectionId} --reason "<verified rationale>"`, reason: "Create a verifier-gated CW state commit.", priority: "high" }];
517
530
  }
518
531
  case "complete":
@@ -15,6 +15,7 @@ const coordinator_1 = require("./coordinator");
15
15
  const multi_agent_1 = require("./multi-agent");
16
16
  const topology_1 = require("./topology");
17
17
  const trust_audit_1 = require("./trust-audit");
18
+ const validation_1 = require("./validation");
18
19
  function summarizeMultiAgentOperator(run) {
19
20
  const topologies = (0, topology_1.summarizeTopologies)(run);
20
21
  const multiAgent = (0, multi_agent_1.summarizeMultiAgent)(run);
@@ -447,7 +448,7 @@ function readScores(run, candidateId) {
447
448
  .readdirSync(dir)
448
449
  .filter((file) => file.endsWith(".json"))
449
450
  .sort()
450
- .map((file) => JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(dir, file), "utf8")));
451
+ .map((file) => (0, validation_1.validateCandidateScore)(JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(dir, file), "utf8"))));
451
452
  }
452
453
  function scorePath(run, candidateId, scoreId) {
453
454
  const file = node_path_1.default.join(run.paths.candidatesDir || node_path_1.default.join(run.paths.runDir, "candidates"), safeFileName(candidateId), "scores", `${safeFileName(scoreId)}.json`);
@@ -1,7 +1,4 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.policyForRole = policyForRole;
7
4
  exports.policyForGroup = policyForGroup;
@@ -16,7 +13,7 @@ exports.summarizeMultiAgentTrust = summarizeMultiAgentTrust;
16
13
  exports.hasAcceptedJudgeRationale = hasAcceptedJudgeRationale;
17
14
  exports.sourceForActor = sourceForActor;
18
15
  exports.hashText = hashText;
19
- const node_crypto_1 = __importDefault(require("node:crypto"));
16
+ const execution_backend_1 = require("./execution-backend");
20
17
  const trust_audit_1 = require("./trust-audit");
21
18
  function policyForRole(role) {
22
19
  const topologyRole = String(role.metadata?.topologyRoleId || role.title || "").toLowerCase();
@@ -294,8 +291,11 @@ function sourceForActor(actor) {
294
291
  return "runtime-derived";
295
292
  return "cw-validated";
296
293
  }
294
+ // Delegates to the shared execution-backend sha256 (F10 dedup). Byte-identical:
295
+ // both emit `sha256:<hex>` and Node's Hash.update(string) defaults to utf8, the
296
+ // same encoding the shared helper passes explicitly.
297
297
  function hashText(value) {
298
- return `sha256:${node_crypto_1.default.createHash("sha256").update(value).digest("hex")}`;
298
+ return (0, execution_backend_1.sha256)(value);
299
299
  }
300
300
  function resolvePolicy(run, input) {
301
301
  const membership = input.membershipId ? run.multiAgent?.memberships.find((entry) => entry.id === input.membershipId) : undefined;