cool-workflow 0.1.97 → 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.
Files changed (309) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/README.md +11 -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/cli/dispatch.js +236 -0
  11. package/dist/cli/entry.js +120 -0
  12. package/dist/cli/io.js +21 -4
  13. package/dist/cli/parseargv.js +157 -0
  14. package/dist/cli.js +6 -33
  15. package/dist/core/capability-table.js +3534 -0
  16. package/dist/core/format/help.js +314 -0
  17. package/dist/{state-explosion/format.js → core/format/state-explosion-text.js} +10 -1
  18. package/dist/core/hash.js +137 -0
  19. package/dist/core/multi-agent/candidate-scoring.js +219 -0
  20. package/dist/core/multi-agent/collaboration.js +481 -0
  21. package/dist/core/multi-agent/coordinator.js +515 -0
  22. package/dist/core/multi-agent/eval-replay.js +306 -0
  23. package/dist/core/multi-agent/runtime.js +929 -0
  24. package/dist/core/multi-agent/topology.js +298 -0
  25. package/dist/core/multi-agent/trust-policy.js +197 -0
  26. package/dist/core/pipeline/commit-gate.js +320 -0
  27. package/dist/{pipeline-contract.js → core/pipeline/contract.js} +24 -37
  28. package/dist/core/pipeline/dispatch.js +103 -0
  29. package/dist/core/pipeline/drive-decide.js +227 -0
  30. package/dist/core/pipeline/error-feedback.js +161 -0
  31. package/dist/core/pipeline/loop-expansion.js +124 -0
  32. package/dist/{result-normalize.js → core/pipeline/result-normalize.js} +14 -37
  33. package/dist/core/pipeline/runner.js +230 -0
  34. package/dist/{contract-migration.js → core/state/contract-migration.js} +68 -92
  35. package/dist/{state-migrations.js → core/state/migrations.js} +103 -96
  36. package/dist/core/state/node-projection.js +95 -0
  37. package/dist/core/state/node-snapshot.js +230 -0
  38. package/dist/core/state/run-paths.js +93 -0
  39. package/dist/{schema-validate.js → core/state/schema-validate.js} +35 -28
  40. package/dist/core/state/schema.js +50 -0
  41. package/dist/core/state/state-explosion/digest.js +243 -0
  42. package/dist/core/state/state-explosion/graph.js +527 -0
  43. package/dist/{state-explosion → core/state/state-explosion}/helpers.js +34 -3
  44. package/dist/core/state/state-explosion/report.js +187 -0
  45. package/dist/{state-explosion → core/state/state-explosion}/size.js +25 -7
  46. package/dist/{state-node.js → core/state/state-node.js} +90 -113
  47. package/dist/core/state/types.js +19 -0
  48. package/dist/{validation.js → core/state/validation.js} +64 -131
  49. package/dist/core/trust/evidence-grounding.js +134 -0
  50. package/dist/core/trust/ledger.js +199 -0
  51. package/dist/{telemetry-attestation.js → core/trust/telemetry-attestation.js} +94 -68
  52. package/dist/core/trust/telemetry-ledger.js +127 -0
  53. package/dist/core/types.js +20 -0
  54. package/dist/core/version.js +16 -0
  55. package/dist/{workflow-app-framework.js → core/workflow-apps/app-schema.js} +337 -426
  56. package/dist/mcp/dispatch.js +104 -0
  57. package/dist/mcp/server.js +144 -0
  58. package/dist/mcp-server.js +6 -84
  59. package/dist/{agent-config.js → shell/agent-config.js} +118 -71
  60. package/dist/shell/app-run-cli.js +88 -0
  61. package/dist/shell/audit-cli.js +259 -0
  62. package/dist/shell/audit-provenance.js +83 -0
  63. package/dist/shell/candidate-scoring-io.js +459 -0
  64. package/dist/shell/collaboration-io.js +264 -0
  65. package/dist/shell/commit-summary.js +104 -0
  66. package/dist/shell/commit.js +290 -0
  67. package/dist/shell/coordinator-io.js +476 -0
  68. package/dist/shell/demo-cli.js +19 -0
  69. package/dist/shell/dispatch.js +162 -0
  70. package/dist/{doctor.js → shell/doctor.js} +123 -56
  71. package/dist/shell/drive.js +873 -0
  72. package/dist/shell/error-feedback-io.js +305 -0
  73. package/dist/shell/eval-io.js +473 -0
  74. package/dist/{multi-agent-eval/format.js → shell/eval-text.js} +78 -49
  75. package/dist/{evidence-reasoning.js → shell/evidence-reasoning.js} +124 -255
  76. package/dist/shell/exec-backend-cli.js +88 -0
  77. package/dist/shell/execution-backend/agent.js +475 -0
  78. package/dist/shell/execution-backend/ci.js +15 -0
  79. package/dist/shell/execution-backend/container.js +69 -0
  80. package/dist/shell/execution-backend/envelopes.js +55 -0
  81. package/dist/shell/execution-backend/local.js +113 -0
  82. package/dist/shell/execution-backend/probes.js +175 -0
  83. package/dist/shell/execution-backend/registry.js +402 -0
  84. package/dist/shell/execution-backend/remote.js +128 -0
  85. package/dist/shell/execution-backend/types.js +11 -0
  86. package/dist/shell/feedback-cli.js +81 -0
  87. package/dist/shell/feedback-operations.js +48 -0
  88. package/dist/shell/fs-atomic.js +276 -0
  89. package/dist/shell/harness.js +98 -0
  90. package/dist/shell/ledger-cli.js +212 -0
  91. package/dist/shell/ledger-io.js +169 -0
  92. package/dist/shell/man-cli.js +89 -0
  93. package/dist/shell/metrics-cli.js +98 -0
  94. package/dist/shell/multi-agent-cli.js +1002 -0
  95. package/dist/shell/multi-agent-host.js +563 -0
  96. package/dist/shell/multi-agent-io.js +387 -0
  97. package/dist/{multi-agent-operator-ux.js → shell/multi-agent-operator-ux.js} +234 -191
  98. package/dist/shell/node-store.js +124 -0
  99. package/dist/{observability/format.js → shell/observability-format.js} +7 -1
  100. package/dist/{observability/intake.js → shell/observability-intake.js} +79 -56
  101. package/dist/{observability.js → shell/observability.js} +159 -332
  102. package/dist/{onramp.js → shell/onramp.js} +11 -0
  103. package/dist/{operator-ux/format.js → shell/operator-ux-text.js} +250 -239
  104. package/dist/shell/operator-ux.js +431 -0
  105. package/dist/shell/orchestrator.js +231 -0
  106. package/dist/shell/pipeline-cli.js +667 -0
  107. package/dist/shell/pipeline.js +217 -0
  108. package/dist/shell/reclamation-io.js +1366 -0
  109. package/dist/shell/registry-cli.js +329 -0
  110. package/dist/{remote-source.js → shell/remote-source.js} +12 -5
  111. package/dist/shell/report-cli.js +101 -0
  112. package/dist/shell/report-view-cli.js +117 -0
  113. package/dist/{orchestrator → shell}/report.js +289 -282
  114. package/dist/shell/reporter.js +62 -0
  115. package/dist/shell/run-export-cli.js +106 -0
  116. package/dist/shell/run-export.js +680 -0
  117. package/dist/shell/run-registry-io.js +1014 -0
  118. package/dist/shell/run-store.js +164 -0
  119. package/dist/{sandbox-profile.js → shell/sandbox-profile.js} +134 -95
  120. package/dist/{scheduler.js → shell/scheduler-io.js} +248 -48
  121. package/dist/shell/scheduling-io.js +311 -0
  122. package/dist/shell/state-cli.js +181 -0
  123. package/dist/shell/state-explosion-cli.js +197 -0
  124. package/dist/shell/telemetry-cli.js +85 -0
  125. package/dist/{telemetry-demo.js → shell/telemetry-demo.js} +149 -119
  126. package/dist/shell/telemetry-ledger-io.js +132 -0
  127. package/dist/{term.js → shell/term.js} +36 -46
  128. package/dist/shell/topology-io.js +361 -0
  129. package/dist/shell/trust-audit.js +471 -0
  130. package/dist/{multi-agent-trust.js → shell/trust-policy-io.js} +67 -205
  131. package/dist/shell/verifier.js +48 -0
  132. package/dist/shell/workbench-host.js +250 -0
  133. package/dist/shell/workbench-text.js +18 -0
  134. package/dist/shell/workbench.js +175 -0
  135. package/dist/shell/worker-cli.js +124 -0
  136. package/dist/shell/worker-isolation.js +852 -0
  137. package/dist/shell/workflow-app-loader.js +650 -0
  138. package/docs/agent-delegation-drive.7.md +4 -0
  139. package/docs/cli-mcp-parity.7.md +284 -211
  140. package/docs/contract-migration-tooling.7.md +4 -0
  141. package/docs/control-plane-scheduling.7.md +4 -0
  142. package/docs/cross-agent-ledger.7.md +217 -0
  143. package/docs/designs/handoff-ledger.md +145 -0
  144. package/docs/durable-state-and-locking.7.md +4 -0
  145. package/docs/evidence-adoption-reasoning-chain.7.md +4 -0
  146. package/docs/execution-backends.7.md +4 -0
  147. package/docs/handoff-setup.md +120 -0
  148. package/docs/multi-agent-cli-mcp-surface.7.md +4 -0
  149. package/docs/multi-agent-eval-replay-harness.7.md +4 -0
  150. package/docs/multi-agent-operator-ux.7.md +4 -0
  151. package/docs/node-snapshot-diff-replay.7.md +4 -0
  152. package/docs/observability-cost-accounting.7.md +4 -0
  153. package/docs/project-index.md +143 -71
  154. package/docs/real-execution-backends.7.md +4 -0
  155. package/docs/release-and-migration.7.md +4 -0
  156. package/docs/release-tooling.7.md +4 -0
  157. package/docs/run-registry-control-plane.7.md +4 -0
  158. package/docs/run-retention-reclamation.7.md +25 -0
  159. package/docs/state-explosion-management.7.md +4 -0
  160. package/docs/team-collaboration.7.md +4 -0
  161. package/docs/web-desktop-workbench.7.md +4 -0
  162. package/manifest/plugin.manifest.json +1 -1
  163. package/manifest/source-context-profiles.json +9 -13
  164. package/package.json +1 -1
  165. package/scripts/agents/codex-agent.js +34 -4
  166. package/scripts/agents/cw-attest-wrap.js +2 -2
  167. package/scripts/bump-version.js +4 -3
  168. package/scripts/canonical-apps.js +4 -4
  169. package/scripts/children/batch-delegate-child.js +30 -10
  170. package/scripts/dogfood-architecture-review.js +2 -3
  171. package/scripts/dogfood-release.js +3 -3
  172. package/scripts/gen-parity-doc.js +15 -2
  173. package/scripts/golden-path.js +4 -4
  174. package/scripts/onramp-check.js +1 -1
  175. package/scripts/parity-check.js +38 -21
  176. package/scripts/release-flow.js +9 -3
  177. package/scripts/sync-project-index.js +51 -27
  178. package/scripts/validate-run-state-schema.js +2 -2
  179. package/scripts/version-sync-check.js +30 -30
  180. package/dist/candidate-scoring.js +0 -729
  181. package/dist/capability-core.js +0 -1186
  182. package/dist/capability-registry.js +0 -879
  183. package/dist/cli/command-surface.js +0 -490
  184. package/dist/cli/format.js +0 -56
  185. package/dist/cli/handlers/audit.js +0 -82
  186. package/dist/cli/handlers/blackboard.js +0 -81
  187. package/dist/cli/handlers/candidate.js +0 -40
  188. package/dist/cli/handlers/clones.js +0 -34
  189. package/dist/cli/handlers/collaboration.js +0 -61
  190. package/dist/cli/handlers/eval.js +0 -40
  191. package/dist/cli/handlers/maintenance.js +0 -107
  192. package/dist/cli/handlers/multi-agent.js +0 -165
  193. package/dist/cli/handlers/node.js +0 -41
  194. package/dist/cli/handlers/operational.js +0 -155
  195. package/dist/cli/handlers/operator.js +0 -146
  196. package/dist/cli/handlers/registry.js +0 -68
  197. package/dist/cli/handlers/run.js +0 -153
  198. package/dist/cli/handlers/scheduling.js +0 -132
  199. package/dist/cli/handlers/workbench.js +0 -41
  200. package/dist/cli/handlers/worker.js +0 -45
  201. package/dist/cli/run-summary.js +0 -45
  202. package/dist/clones.js +0 -162
  203. package/dist/collaboration.js +0 -726
  204. package/dist/commit.js +0 -592
  205. package/dist/compare.js +0 -18
  206. package/dist/coordinator/classify.js +0 -45
  207. package/dist/coordinator/paths.js +0 -42
  208. package/dist/coordinator/util.js +0 -126
  209. package/dist/coordinator.js +0 -990
  210. package/dist/daemon.js +0 -44
  211. package/dist/dispatch.js +0 -250
  212. package/dist/drive.js +0 -827
  213. package/dist/error-feedback.js +0 -419
  214. package/dist/evidence-grounding.js +0 -184
  215. package/dist/execution-backend/agent.js +0 -294
  216. package/dist/execution-backend/probes.js +0 -112
  217. package/dist/execution-backend/util.js +0 -47
  218. package/dist/execution-backend.js +0 -961
  219. package/dist/gates.js +0 -48
  220. package/dist/harness.js +0 -61
  221. package/dist/loop-expansion.js +0 -60
  222. package/dist/mcp/tool-call.js +0 -434
  223. package/dist/mcp/tool-definitions.js +0 -1040
  224. package/dist/mcp-surface.js +0 -30
  225. package/dist/multi-agent/graph.js +0 -84
  226. package/dist/multi-agent/helpers.js +0 -141
  227. package/dist/multi-agent/ids.js +0 -20
  228. package/dist/multi-agent/paths.js +0 -22
  229. package/dist/multi-agent-eval/normalize.js +0 -51
  230. package/dist/multi-agent-eval.js +0 -678
  231. package/dist/multi-agent-host.js +0 -777
  232. package/dist/multi-agent.js +0 -984
  233. package/dist/node-projection.js +0 -59
  234. package/dist/node-snapshot.js +0 -260
  235. package/dist/operator-ux.js +0 -631
  236. package/dist/orchestrator/app-operations.js +0 -211
  237. package/dist/orchestrator/audit-operations.js +0 -182
  238. package/dist/orchestrator/candidate-operations.js +0 -117
  239. package/dist/orchestrator/cli-options.js +0 -294
  240. package/dist/orchestrator/collaboration-operations.js +0 -86
  241. package/dist/orchestrator/feedback-operations.js +0 -81
  242. package/dist/orchestrator/host-operations.js +0 -78
  243. package/dist/orchestrator/lifecycle-operations.js +0 -626
  244. package/dist/orchestrator/migration-operations.js +0 -44
  245. package/dist/orchestrator/multi-agent-operations.js +0 -362
  246. package/dist/orchestrator/topology-operations.js +0 -84
  247. package/dist/orchestrator.js +0 -917
  248. package/dist/pipeline-runner.js +0 -285
  249. package/dist/reclamation/hash.js +0 -72
  250. package/dist/reclamation.js +0 -812
  251. package/dist/reporter.js +0 -67
  252. package/dist/run-export.js +0 -784
  253. package/dist/run-registry/derive.js +0 -175
  254. package/dist/run-registry/format.js +0 -124
  255. package/dist/run-registry/gc.js +0 -251
  256. package/dist/run-registry/policy.js +0 -16
  257. package/dist/run-registry/queue.js +0 -115
  258. package/dist/run-registry.js +0 -850
  259. package/dist/run-state-schema.js +0 -68
  260. package/dist/scheduling.js +0 -184
  261. package/dist/state-explosion.js +0 -1014
  262. package/dist/state.js +0 -367
  263. package/dist/telemetry-ledger.js +0 -196
  264. package/dist/topology.js +0 -565
  265. package/dist/triggers.js +0 -184
  266. package/dist/trust-audit.js +0 -644
  267. package/dist/types/blackboard.js +0 -2
  268. package/dist/types/candidate.js +0 -2
  269. package/dist/types/collaboration.js +0 -2
  270. package/dist/types/core.js +0 -2
  271. package/dist/types/drive.js +0 -10
  272. package/dist/types/error-feedback.js +0 -2
  273. package/dist/types/evidence-reasoning.js +0 -2
  274. package/dist/types/execution-backend.js +0 -2
  275. package/dist/types/multi-agent.js +0 -2
  276. package/dist/types/observability.js +0 -2
  277. package/dist/types/pipeline.js +0 -2
  278. package/dist/types/reclamation.js +0 -8
  279. package/dist/types/report-bundle.js +0 -6
  280. package/dist/types/result.js +0 -2
  281. package/dist/types/run-registry.js +0 -2
  282. package/dist/types/run.js +0 -2
  283. package/dist/types/sandbox.js +0 -2
  284. package/dist/types/schedule.js +0 -2
  285. package/dist/types/state-node.js +0 -2
  286. package/dist/types/topology.js +0 -2
  287. package/dist/types/trust.js +0 -2
  288. package/dist/types/workbench.js +0 -2
  289. package/dist/types/worker.js +0 -2
  290. package/dist/types/workflow-app.js +0 -2
  291. package/dist/types.js +0 -44
  292. package/dist/util/fingerprint.js +0 -19
  293. package/dist/util/fingerprint.test.js +0 -27
  294. package/dist/verifier.js +0 -78
  295. package/dist/version.js +0 -8
  296. package/dist/workbench-host.js +0 -182
  297. package/dist/workbench.js +0 -192
  298. package/dist/worker-accept/acceptance.js +0 -114
  299. package/dist/worker-accept/blackboard-fanout.js +0 -80
  300. package/dist/worker-accept/blackboard-linkage.js +0 -19
  301. package/dist/worker-accept/context.js +0 -2
  302. package/dist/worker-accept/telemetry-ledger.js +0 -126
  303. package/dist/worker-accept/validation.js +0 -77
  304. package/dist/worker-accept/verifier-completion.js +0 -73
  305. package/dist/worker-isolation/helpers.js +0 -51
  306. package/dist/worker-isolation/paths.js +0 -46
  307. package/dist/worker-isolation.js +0 -656
  308. package/dist/workflow-api.js +0 -131
  309. /package/dist/{types → core/types}/boundary.js +0 -0
@@ -1,294 +0,0 @@
1
- "use strict";
2
- // CLI option parsing & coercion utilities — extracted from orchestrator.ts.
3
- //
4
- // Pure functions that turn the raw parsed-argv option bag into typed values
5
- // (strings, numbers, arrays, actors, blackboard scopes, sandbox choices, …).
6
- // No run state, no I/O. The orchestrator imports the subset it uses.
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.COLLABORATION_TARGET_KINDS = void 0;
9
- exports.isMissing = isMissing;
10
- exports.numberOption = numberOption;
11
- exports.stringOption = stringOption;
12
- exports.requiredStringOption = requiredStringOption;
13
- exports.collaborationTarget = collaborationTarget;
14
- exports.collaborationTargetMaybe = collaborationTargetMaybe;
15
- exports.actorInputFrom = actorInputFrom;
16
- exports.firstDefined = firstDefined;
17
- exports.graphViewOption = graphViewOption;
18
- exports.graphViewsOption = graphViewsOption;
19
- exports.metadataOption = metadataOption;
20
- exports.withoutHostRunKeys = withoutHostRunKeys;
21
- exports.optionsRecord = optionsRecord;
22
- exports.parseBlackboardAuthor = parseBlackboardAuthor;
23
- exports.parseBlackboardScope = parseBlackboardScope;
24
- exports.parseBlackboardLinks = parseBlackboardLinks;
25
- exports.parseSandboxChoices = parseSandboxChoices;
26
- exports.parseCriteria = parseCriteria;
27
- exports.parseEvidence = parseEvidence;
28
- exports.mergeEvidence = mergeEvidence;
29
- exports.arrayOption = arrayOption;
30
- exports.valuesOption = valuesOption;
31
- exports.inferAuditDecisionKind = inferAuditDecisionKind;
32
- exports.isSandboxProfileError = isSandboxProfileError;
33
- exports.validationIssuesFromError = validationIssuesFromError;
34
- const sandbox_profile_1 = require("../sandbox-profile");
35
- const state_explosion_1 = require("../state-explosion");
36
- const workflow_app_framework_1 = require("../workflow-app-framework");
37
- function isMissing(value) {
38
- return value === undefined || value === null || value === "";
39
- }
40
- function numberOption(value) {
41
- if (value === undefined || value === null || value === true)
42
- return undefined;
43
- const parsed = Number(value);
44
- return Number.isFinite(parsed) ? parsed : undefined;
45
- }
46
- function stringOption(value) {
47
- if (value === undefined || value === null || value === true)
48
- return undefined;
49
- return String(value);
50
- }
51
- function requiredStringOption(value, label) {
52
- const parsed = stringOption(value);
53
- if (!parsed)
54
- throw new Error(`Missing ${label}`);
55
- return parsed;
56
- }
57
- exports.COLLABORATION_TARGET_KINDS = ["run", "task", "candidate", "selection", "commit", "node"];
58
- function collaborationTarget(kind, id) {
59
- const normalizedKind = stringOption(kind);
60
- const normalizedId = stringOption(id);
61
- if (!normalizedKind || !exports.COLLABORATION_TARGET_KINDS.includes(normalizedKind)) {
62
- throw new Error(`Target kind must be one of ${exports.COLLABORATION_TARGET_KINDS.join("|")}`);
63
- }
64
- if (!normalizedId)
65
- throw new Error("Missing target id");
66
- return { kind: normalizedKind, id: normalizedId };
67
- }
68
- function collaborationTargetMaybe(kind, id) {
69
- if (!kind && !id)
70
- return undefined;
71
- return collaborationTarget(String(kind || ""), String(id || ""));
72
- }
73
- function actorInputFrom(options) {
74
- return {
75
- actor: stringOption(firstDefined(options, "actor", "by")),
76
- actorKind: stringOption(firstDefined(options, "actorKind", "actor-kind", "kind")),
77
- role: stringOption(firstDefined(options, "role", "roleId", "role-id")),
78
- displayName: stringOption(firstDefined(options, "displayName", "display-name", "name")),
79
- attested: Boolean(options.attested),
80
- attestation: stringOption(options.attestation)
81
- };
82
- }
83
- /** First option value present under any of the given keys (camelCase or dashed). */
84
- function firstDefined(options, ...keys) {
85
- for (const key of keys) {
86
- if (options[key] !== undefined)
87
- return options[key];
88
- }
89
- return undefined;
90
- }
91
- function graphViewOption(value) {
92
- const parsed = stringOption(value);
93
- if (!parsed)
94
- return "compact";
95
- if (!state_explosion_1.GRAPH_VIEWS.includes(parsed)) {
96
- throw new Error(`Unknown graph view: ${parsed}. Valid views: ${state_explosion_1.GRAPH_VIEWS.join(", ")}`);
97
- }
98
- return parsed;
99
- }
100
- function graphViewsOption(options) {
101
- const raw = arrayOption(options.view || options.views).map(String);
102
- if (!raw.length)
103
- return undefined;
104
- for (const view of raw) {
105
- if (!state_explosion_1.GRAPH_VIEWS.includes(view)) {
106
- throw new Error(`Unknown graph view: ${view}. Valid views: ${state_explosion_1.GRAPH_VIEWS.join(", ")}`);
107
- }
108
- }
109
- return raw;
110
- }
111
- function metadataOption(options) {
112
- const raw = options.metadata;
113
- if (raw && typeof raw === "object" && !Array.isArray(raw))
114
- return raw;
115
- if (typeof raw === "string") {
116
- try {
117
- return JSON.parse(raw);
118
- }
119
- catch {
120
- throw new Error(`Invalid JSON in --metadata: ${String(raw).slice(0, 80)}`);
121
- }
122
- }
123
- return undefined;
124
- }
125
- function withoutHostRunKeys(args) {
126
- const copy = { ...args };
127
- for (const key of [
128
- "app",
129
- "appId",
130
- "workflow",
131
- "workflowId",
132
- "inputs",
133
- "topology",
134
- "topologyId",
135
- "topologyRun",
136
- "topologyRunId",
137
- "multiAgentRun",
138
- "multiAgentRunId",
139
- "blackboard",
140
- "blackboardId",
141
- "mapperCount",
142
- "mappers",
143
- "mapper",
144
- "judgeCount",
145
- "judges",
146
- "judge",
147
- "debateRounds",
148
- "rounds",
149
- "collectInitialFanin",
150
- "collect-initial-fanin"
151
- ]) {
152
- delete copy[key];
153
- }
154
- return { ...copy, ...(optionsRecord(args.inputs) || {}) };
155
- }
156
- function optionsRecord(value) {
157
- if (value && typeof value === "object" && !Array.isArray(value))
158
- return value;
159
- return undefined;
160
- }
161
- function parseBlackboardAuthor(options) {
162
- const structured = options.author;
163
- if (structured && typeof structured === "object" && !Array.isArray(structured))
164
- return structured;
165
- const id = stringOption(options.authorId || options.author || options.worker || options.workerId || options.role || options.roleId || options.group || options.groupId);
166
- const kind = stringOption(options.authorKind || options.sourceKind || options.source);
167
- const displayName = stringOption(options.authorName || options.displayName);
168
- if (!id && !kind && !displayName)
169
- return undefined;
170
- return { kind: kind, id, displayName };
171
- }
172
- function parseBlackboardScope(options) {
173
- const structured = options.scope;
174
- if (structured && typeof structured === "object" && !Array.isArray(structured))
175
- return structured;
176
- const kind = stringOption(options.scopeKind);
177
- const id = stringOption(options.scopeId);
178
- if (!kind && !id)
179
- return undefined;
180
- return { kind: kind, id };
181
- }
182
- function parseBlackboardLinks(runId, options) {
183
- const structured = options.provenance || options.links;
184
- if (structured && typeof structured === "object" && !Array.isArray(structured))
185
- return structured;
186
- const links = {
187
- workflowRunId: runId,
188
- multiAgentRunId: stringOption(options.multiAgentRun || options.multiAgentRunId || options["multi-agent-run"]),
189
- agentGroupId: stringOption(options.group || options.groupId || options["multi-agent-group"]),
190
- agentRoleId: stringOption(options.role || options.roleId || options["multi-agent-role"]),
191
- agentMembershipId: stringOption(options.membership || options.membershipId || options["multi-agent-membership"]),
192
- agentFanoutId: stringOption(options.fanout || options.fanoutId || options["multi-agent-fanout"]),
193
- agentFaninId: stringOption(options.fanin || options.faninId || options["multi-agent-fanin"]),
194
- taskId: stringOption(options.task || options.taskId),
195
- workerId: stringOption(options.worker || options.workerId),
196
- candidateId: stringOption(options.candidate || options.candidateId),
197
- verifierNodeId: stringOption(options.verifier || options.verifierNode || options.verifierNodeId),
198
- commitId: stringOption(options.commit || options.commitId),
199
- auditEventIds: arrayOption(options.audit || options.auditEvent || options.auditEventId || options["audit-event"]).map(String),
200
- evidenceRefs: arrayOption(options.evidence || options.evidenceRef || options["evidence-ref"]).map(String)
201
- };
202
- const entries = Object.entries(links).filter(([, value]) => value !== undefined && (!Array.isArray(value) || value.length));
203
- return entries.length > 1 ? Object.fromEntries(entries) : undefined;
204
- }
205
- function parseSandboxChoices(options) {
206
- const choices = {};
207
- const structured = options.sandboxChoices || options.sandboxProfileChoices;
208
- if (structured && typeof structured === "object" && !Array.isArray(structured)) {
209
- for (const [key, value] of Object.entries(structured))
210
- choices[key] = String(value);
211
- }
212
- for (const entry of arrayOption(options.sandboxChoice || options["sandbox-choice"])) {
213
- const [key, ...rest] = String(entry).split("=");
214
- if (key && rest.length)
215
- choices[key] = rest.join("=");
216
- }
217
- const sandbox = stringOption(options.sandbox || options.sandboxProfile || options.sandboxProfileId);
218
- if (sandbox && !Object.keys(choices).length)
219
- choices.default = sandbox;
220
- return Object.keys(choices).length ? choices : undefined;
221
- }
222
- function parseCriteria(options) {
223
- const criteria = {};
224
- const structured = options.criteria;
225
- if (structured && typeof structured === "object" && !Array.isArray(structured)) {
226
- for (const [key, value] of Object.entries(structured)) {
227
- const parsed = Number(value);
228
- if (key && Number.isFinite(parsed))
229
- criteria[key] = parsed;
230
- }
231
- }
232
- const rawCriteria = options.criterion || (typeof structured === "object" && !Array.isArray(structured) ? undefined : structured) || options.score;
233
- for (const entry of arrayOption(rawCriteria)) {
234
- const [key, value] = String(entry).split("=");
235
- if (!key || value === undefined)
236
- continue;
237
- criteria[key] = Number(value);
238
- }
239
- if (!Object.keys(criteria).length && options.total !== undefined) {
240
- criteria.total = Number(options.total);
241
- }
242
- if (!Object.keys(criteria).length)
243
- throw new Error("Missing score criteria. Use --criterion name=value");
244
- return criteria;
245
- }
246
- function parseEvidence(value) {
247
- return arrayOption(value).map((entry, index) => ({
248
- id: `score:${index + 1}`,
249
- source: "candidate-score",
250
- locator: String(entry),
251
- summary: String(entry)
252
- }));
253
- }
254
- function mergeEvidence(left, right) {
255
- const merged = [...left];
256
- for (const item of right) {
257
- const index = merged.findIndex((entry) => entry.id === item.id);
258
- if (index >= 0)
259
- merged[index] = item;
260
- else
261
- merged.push(item);
262
- }
263
- return merged;
264
- }
265
- function arrayOption(value) {
266
- if (value === undefined || value === null || value === true)
267
- return [];
268
- return Array.isArray(value) ? value : [value];
269
- }
270
- function valuesOption(value) {
271
- return arrayOption(value).map((entry) => String(entry).split("=")[0]).filter(Boolean);
272
- }
273
- function inferAuditDecisionKind(options) {
274
- if (options.command)
275
- return "sandbox.command";
276
- if (options.network || options.networkTarget)
277
- return "sandbox.network";
278
- if (options.env || options.envVar)
279
- return "sandbox.env";
280
- return "sandbox.path";
281
- }
282
- function isSandboxProfileError(error) {
283
- return error instanceof sandbox_profile_1.SandboxProfileError || Boolean(error && typeof error === "object" && "code" in error && String(error.code).startsWith("sandbox-"));
284
- }
285
- function validationIssuesFromError(error) {
286
- if (error instanceof workflow_app_framework_1.WorkflowAppValidationError)
287
- return error.issues;
288
- return [
289
- {
290
- code: "workflow-app-invalid",
291
- message: error instanceof Error ? error.message : String(error)
292
- }
293
- ];
294
- }
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.collaborationApprove = collaborationApprove;
4
- exports.collaborationComment = collaborationComment;
5
- exports.collaborationCommentList = collaborationCommentList;
6
- exports.collaborationHandoff = collaborationHandoff;
7
- exports.reviewStatus = reviewStatus;
8
- exports.reviewPolicy = reviewPolicy;
9
- exports.formatReviewStatus = formatReviewStatus;
10
- exports.formatCommentList = formatCommentList;
11
- const state_1 = require("../state");
12
- const report_1 = require("./report");
13
- const cli_options_1 = require("./cli-options");
14
- const collaboration_1 = require("../collaboration");
15
- function collaborationApprove(run, targetKind, targetId, options = {}, decision = "approve") {
16
- const record = (0, collaboration_1.recordApproval)(run, {
17
- target: (0, cli_options_1.collaborationTarget)(targetKind, targetId),
18
- decision,
19
- ...(0, cli_options_1.actorInputFrom)(options),
20
- rationale: (0, cli_options_1.stringOption)(options.rationale) || (0, cli_options_1.stringOption)(options.reason) || (0, cli_options_1.stringOption)(options.message),
21
- supersedes: (0, cli_options_1.stringOption)(options.supersedes)
22
- }, { persist: false });
23
- (0, report_1.writeReport)(run);
24
- (0, state_1.saveCheckpoint)(run);
25
- return record;
26
- }
27
- function collaborationComment(run, targetKind, targetId, options = {}) {
28
- const record = (0, collaboration_1.recordComment)(run, {
29
- target: (0, cli_options_1.collaborationTarget)(targetKind, targetId),
30
- body: (0, cli_options_1.stringOption)(options.body) || (0, cli_options_1.stringOption)(options.message) || (0, cli_options_1.stringOption)(options.text) || "",
31
- threadId: (0, cli_options_1.stringOption)(options.thread) || (0, cli_options_1.stringOption)(options.threadId),
32
- parentId: (0, cli_options_1.stringOption)(options.parent) || (0, cli_options_1.stringOption)(options.parentId),
33
- ...(0, cli_options_1.actorInputFrom)(options)
34
- }, { persist: false });
35
- (0, report_1.writeReport)(run);
36
- (0, state_1.saveCheckpoint)(run);
37
- return record;
38
- }
39
- function collaborationCommentList(run, options = {}) {
40
- const target = (0, cli_options_1.collaborationTargetMaybe)((0, cli_options_1.stringOption)(options.targetKind) || (0, cli_options_1.stringOption)(options.kind), (0, cli_options_1.stringOption)(options.target) || (0, cli_options_1.stringOption)(options.targetId));
41
- const comments = (0, collaboration_1.listComments)(run, target);
42
- return { schemaVersion: 1, surface: "collaboration", runId: run.id, target, count: comments.length, comments };
43
- }
44
- function collaborationHandoff(run, targetKind, targetId, options = {}) {
45
- const record = (0, collaboration_1.recordHandoff)(run, {
46
- target: (0, cli_options_1.collaborationTarget)(targetKind, targetId),
47
- toActor: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "to", "toActor")),
48
- toActorKind: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "toKind", "to-kind", "toActorKind")),
49
- toRole: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "toRole", "to-role")),
50
- toDisplayName: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "toName", "to-name", "toDisplayName")),
51
- toAttested: Boolean((0, cli_options_1.firstDefined)(options, "toAttested", "to-attested")),
52
- fromActor: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "from", "fromActor")),
53
- fromActorKind: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "fromKind", "from-kind", "fromActorKind")),
54
- fromRole: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "fromRole", "from-role")),
55
- reason: (0, cli_options_1.stringOption)(options.reason) || (0, cli_options_1.stringOption)(options.message) || "handoff",
56
- ...(0, cli_options_1.actorInputFrom)(options)
57
- }, { persist: false });
58
- (0, report_1.writeReport)(run);
59
- (0, state_1.saveCheckpoint)(run);
60
- return record;
61
- }
62
- function reviewStatus(run, options = {}) {
63
- const now = typeof options.now === "string" && options.now ? options.now : new Date().toISOString();
64
- const target = (0, cli_options_1.collaborationTargetMaybe)((0, cli_options_1.stringOption)(options.targetKind) || (0, cli_options_1.stringOption)(options.kind), (0, cli_options_1.stringOption)(options.target) || (0, cli_options_1.stringOption)(options.targetId));
65
- return (0, collaboration_1.buildReviewStatusReport)(run, { now, target });
66
- }
67
- function reviewPolicy(run, options = {}) {
68
- const allowSelf = (0, cli_options_1.firstDefined)(options, "allowSelfApproval", "allow-self-approval");
69
- const requireAttested = (0, cli_options_1.firstDefined)(options, "requireAttestedActor", "require-attested-actor");
70
- const policy = (0, collaboration_1.setReviewPolicy)(run, {
71
- requiredApprovals: (0, cli_options_1.numberOption)((0, cli_options_1.firstDefined)(options, "requiredApprovals", "required-approvals", "required", "approvals")),
72
- authorizedRoles: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "authorizedRoles", "authorized-roles", "roles")),
73
- allowSelfApproval: allowSelf === undefined ? undefined : Boolean(allowSelf),
74
- requireAttestedActor: requireAttested === undefined ? undefined : Boolean(requireAttested),
75
- appliesTo: (0, cli_options_1.stringOption)((0, cli_options_1.firstDefined)(options, "appliesTo", "applies-to", "targets"))
76
- }, { persist: false });
77
- (0, report_1.writeReport)(run);
78
- (0, state_1.saveCheckpoint)(run);
79
- return { schemaVersion: 1, surface: "collaboration", runId: run.id, policy };
80
- }
81
- function formatReviewStatus(report) {
82
- return (0, collaboration_1.formatReviewStatus)(report);
83
- }
84
- function formatCommentList(comments) {
85
- return (0, collaboration_1.formatCommentList)(comments);
86
- }
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.collectFeedback = collectFeedback;
37
- exports.listFeedback = listFeedback;
38
- exports.showFeedback = showFeedback;
39
- exports.createFeedbackTask = createFeedbackTask;
40
- exports.resolveFeedback = resolveFeedback;
41
- const state_1 = require("../state");
42
- const report_1 = require("./report");
43
- const fb = __importStar(require("../error-feedback"));
44
- function collectFeedback(run) {
45
- const collected = fb.collectRunErrors(run);
46
- (0, report_1.writeReport)(run);
47
- (0, state_1.saveCheckpoint)(run);
48
- return collected;
49
- }
50
- function listFeedback(run, options = {}) {
51
- return fb.listFeedback(run, {
52
- status: options.status ? String(options.status) : undefined,
53
- severity: options.severity ? String(options.severity) : undefined,
54
- classification: options.classification ? String(options.classification) : undefined
55
- });
56
- }
57
- function showFeedback(run, feedbackId) {
58
- const feedback = fb.getFeedback(run, feedbackId);
59
- if (!feedback)
60
- throw new Error(`Unknown feedback id for run ${run.id}: ${feedbackId}`);
61
- return feedback;
62
- }
63
- function createFeedbackTask(run, feedbackId, options = {}) {
64
- const feedback = fb.createCorrectionTask(run, feedbackId, {
65
- verifierCommand: options.verify ? String(options.verify) : undefined,
66
- guidance: options.guidance ? String(options.guidance) : undefined
67
- });
68
- (0, report_1.writeReport)(run);
69
- (0, state_1.saveCheckpoint)(run);
70
- return feedback;
71
- }
72
- function resolveFeedback(run, feedbackId, options = {}) {
73
- const feedback = fb.resolveFeedback(run, feedbackId, {
74
- status: options.status === "rejected" ? "rejected" : "resolved",
75
- nodeId: options.node ? String(options.node) : undefined,
76
- message: options.message ? String(options.message) : undefined
77
- });
78
- (0, report_1.writeReport)(run);
79
- (0, state_1.saveCheckpoint)(run);
80
- return feedback;
81
- }
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.hostMultiAgentRun = hostMultiAgentRun;
37
- exports.hostMultiAgentStatus = hostMultiAgentStatus;
38
- exports.hostMultiAgentStep = hostMultiAgentStep;
39
- exports.hostMultiAgentBlackboard = hostMultiAgentBlackboard;
40
- exports.hostMultiAgentScore = hostMultiAgentScore;
41
- exports.hostMultiAgentSelect = hostMultiAgentSelect;
42
- const state_1 = require("../state");
43
- const report_1 = require("./report");
44
- const host = __importStar(require("../multi-agent-host"));
45
- function hostMultiAgentRun(run, options = {}) {
46
- const response = host.hostRun(run, options);
47
- (0, report_1.writeReport)(run);
48
- (0, state_1.saveCheckpoint)(run);
49
- return response;
50
- }
51
- function hostMultiAgentStatus(run) {
52
- (0, report_1.writeReport)(run);
53
- return host.hostStatus(run);
54
- }
55
- function hostMultiAgentStep(run, options = {}) {
56
- const response = host.hostStep(run, options);
57
- (0, report_1.writeReport)(run);
58
- (0, state_1.saveCheckpoint)(run);
59
- return response;
60
- }
61
- function hostMultiAgentBlackboard(run, action, options = {}) {
62
- const response = host.hostBlackboard(run, action, options);
63
- (0, report_1.writeReport)(run);
64
- (0, state_1.saveCheckpoint)(run);
65
- return response;
66
- }
67
- function hostMultiAgentScore(run, options = {}) {
68
- const response = host.hostScore(run, options);
69
- (0, report_1.writeReport)(run);
70
- (0, state_1.saveCheckpoint)(run);
71
- return response;
72
- }
73
- function hostMultiAgentSelect(run, options = {}) {
74
- const response = host.hostSelect(run, options);
75
- (0, report_1.writeReport)(run);
76
- (0, state_1.saveCheckpoint)(run);
77
- return response;
78
- }