@uniqbit/mate-core 1.0.0-canary.2 → 1.0.0-canary.5

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 (189) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/claude-plugin/hooks/hooks.json +21 -1
  3. package/claude-plugin/hooks/session-attention.mjs +10 -0
  4. package/claude-plugin/hooks/session-end.mjs +9 -0
  5. package/claude-plugin/hooks/session-guidance.mjs +1 -1
  6. package/opencode-plugin/src/server.ts +13 -2
  7. package/opencode-plugin/src/tui.tsx +1 -1
  8. package/opencode-plugin/tui.tsx +2 -1
  9. package/package.json +1 -1
  10. package/src/cli/commands/artifact/delivery/archive.ts +2 -2
  11. package/src/cli/commands/artifact/delivery/link.ts +22 -5
  12. package/src/cli/commands/artifact/delivery/output.ts +9 -1
  13. package/src/cli/commands/artifact/finish/openspec.ts +1 -3
  14. package/src/cli/commands/companion/companion.ts +1 -1
  15. package/src/cli/commands/companion/link.ts +36 -4
  16. package/src/cli/commands/companion/open.ts +40 -12
  17. package/src/cli/commands/doctor.ts +122 -0
  18. package/src/cli/commands/session/prepare.ts +32 -4
  19. package/src/cli/commands/session/registry.ts +90 -0
  20. package/src/cli/commands/studio/companion-removal.ts +79 -0
  21. package/src/cli/commands/studio/mate-inventory.ts +1 -1
  22. package/src/cli/commands/studio/payload.ts +12 -1
  23. package/src/cli/commands/studio/server.ts +39 -16
  24. package/src/cli/commands/studio/services.ts +20 -0
  25. package/src/cli/commands/studio/skill-files.ts +133 -0
  26. package/src/cli/commands/studio/vault.ts +218 -44
  27. package/src/cli/commands/studio/views/model.ts +0 -5
  28. package/src/cli/commands/studio/views/vault/markdown-tree.ts +255 -4
  29. package/src/cli/commands/unwrap.ts +8 -0
  30. package/src/cli/commands/update.ts +26 -8
  31. package/src/cli/commands/vscode/setup.ts +155 -0
  32. package/src/cli/commands/vscode/vsix.ts +73 -0
  33. package/src/cli/commands/working/cleanup.ts +34 -10
  34. package/src/cli/commands/working/worktree.ts +58 -8
  35. package/src/cli/commands/wrap.ts +33 -7
  36. package/src/cli/main.ts +9 -2
  37. package/src/cli/usage.ts +6 -1
  38. package/src/hooks/companion-instructions.ts +19 -11
  39. package/src/hooks/hook-io.ts +15 -0
  40. package/src/hooks/session-banner.ts +5 -3
  41. package/src/hooks/session-end.ts +10 -0
  42. package/src/hooks/session-guidance.ts +10 -6
  43. package/src/hooks/session-prepare.ts +47 -31
  44. package/src/hooks/session-register.ts +199 -0
  45. package/src/hooks/tokensave-route.ts +7 -3
  46. package/src/hooks/validate-artifact-path.ts +9 -2
  47. package/src/lib/delivery/archive-change.ts +0 -1
  48. package/src/lib/delivery/branches.ts +15 -0
  49. package/src/lib/delivery/record-delivery.ts +94 -39
  50. package/src/lib/delivery/record.ts +30 -28
  51. package/src/lib/delivery/refresh.ts +37 -17
  52. package/src/lib/delivery/resolve-branch.ts +258 -37
  53. package/src/lib/factory/outcomes/index.ts +11 -1
  54. package/src/lib/factory/runtime.ts +10 -1
  55. package/src/lib/opencode-server.ts +238 -0
  56. package/src/lib/orchestrator/adapters/claude.ts +147 -2
  57. package/src/lib/orchestrator/adapters/opencode.ts +53 -2
  58. package/src/lib/orchestrator/checkout-adoption.ts +125 -0
  59. package/src/lib/orchestrator/companion-registry-store.ts +6 -2
  60. package/src/lib/orchestrator/editor.ts +2 -2
  61. package/src/lib/orchestrator/framework-context.ts +26 -14
  62. package/src/lib/orchestrator/global-config-store.ts +11 -0
  63. package/src/lib/orchestrator/launcher.ts +15 -2
  64. package/src/lib/orchestrator/projection-claude-links.ts +52 -5
  65. package/src/lib/orchestrator/projection-claude-skills.ts +28 -2
  66. package/src/lib/orchestrator/projection-companion-link.ts +12 -1
  67. package/src/lib/orchestrator/registry-checkouts.ts +177 -0
  68. package/src/lib/orchestrator/repository-link.ts +216 -57
  69. package/src/lib/orchestrator/serving-claude-wrap.ts +43 -0
  70. package/src/lib/orchestrator/session-context-link.ts +11 -5
  71. package/src/lib/orchestrator/session-prepare.ts +36 -6
  72. package/src/lib/orchestrator/types.ts +5 -0
  73. package/src/lib/orchestrator/workspace-inventory.ts +5 -1
  74. package/src/lib/public-npm.ts +17 -0
  75. package/src/lib/session-attribution.ts +52 -0
  76. package/src/lib/session-state.ts +285 -0
  77. package/src/lib/session-stop.ts +64 -0
  78. package/src/lib/workset/record.ts +20 -0
  79. package/src/lib/workset/worktree.ts +85 -17
  80. package/src/opencode/background-server.ts +145 -0
  81. package/src/opencode/companion-hooks.ts +3 -1
  82. package/src/opencode/companion-policy.ts +2 -2
  83. package/src/opencode/projected-guidance.ts +2 -1
  84. package/src/opencode/session-register.ts +176 -0
  85. package/src/opencode/tui.tsx +19 -29
  86. package/src/runtime/claude-delivery-plan.ts +14 -3
  87. package/src/runtime/current-branch.ts +10 -0
  88. package/src/runtime/env.ts +13 -7
  89. package/src/runtime/git-layout.ts +164 -17
  90. package/src/runtime/launch-env-guard.ts +65 -0
  91. package/src/runtime/opencode-server-record.ts +136 -0
  92. package/src/runtime/projection.ts +40 -6
  93. package/src/runtime/repo-local.ts +6 -1
  94. package/src/runtime/serving-claude-wrap.ts +28 -0
  95. package/src/runtime/session-context.ts +4 -3
  96. package/src/runtime/session-registry.ts +434 -0
  97. package/src/runtime/tokensave-route.ts +10 -5
  98. package/src/runtime/wrap-state.ts +31 -0
  99. package/src/studio.ts +2 -0
  100. package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +49 -21
  101. package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +0 -5
  102. package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +2 -8
  103. package/src/templates/mate-skills/agents/mate-propose-change/references/mate-revise.md +1 -3
  104. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +2 -4
  105. package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +49 -21
  106. package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +0 -5
  107. package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +2 -8
  108. package/src/templates/mate-skills/claude/mate-propose-change/references/mate-revise.md +1 -3
  109. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +2 -4
  110. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +404 -30
  111. package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -3
  112. package/src/tools/setup/providers/claude-plugin-hooks.ts +26 -0
  113. package/src/tools/setup/providers/claude.ts +21 -1
  114. package/studio-dist/client/assets/app-CdPiFv59.css +2 -0
  115. package/studio-dist/client/assets/button-BIIHE0EQ.js +3 -0
  116. package/studio-dist/client/assets/companion-view-DM6YyXaR.js +1 -0
  117. package/studio-dist/client/assets/delivery-path-DELxj0Av.js +1 -0
  118. package/studio-dist/client/assets/factory-BZy0E8ty.js +4 -0
  119. package/studio-dist/client/assets/index-B3wkMzjA.js +40 -0
  120. package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +1 -0
  121. package/studio-dist/client/assets/panel-CbajlC3p.js +1 -0
  122. package/studio-dist/client/assets/{prepaint-CD5OpmTM.js → prepaint-CwSrpdFA.js} +7 -4
  123. package/studio-dist/client/assets/react-CN2GSx7x.js +1 -0
  124. package/studio-dist/client/assets/reports-DllhYQ5_.js +1 -0
  125. package/studio-dist/client/assets/routes-COm-G3mK.js +1 -0
  126. package/studio-dist/client/assets/skills-DmWAy-jZ.js +1 -0
  127. package/studio-dist/client/assets/specs-BG3Wi3ln.js +1 -0
  128. package/studio-dist/client/assets/steps-DFsH3Neu.js +1 -0
  129. package/studio-dist/client/assets/vault-B2q1nBY5.js +1 -0
  130. package/studio-dist/client/assets/warnings-BSXIyuSQ.js +1 -0
  131. package/studio-dist/client/assets/workflow-DlsQD6Hc.js +1 -0
  132. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-BQKuMdJW.js → __23tanstack-start-server-fn-resolver-M2GBs8s3.js} +179 -9
  133. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +35 -25
  134. package/studio-dist/server/assets/button-CIJqAhni.js +11929 -0
  135. package/studio-dist/server/assets/{companion-view-aBady57v.js → companion-view-DISASvdJ.js} +13 -7
  136. package/studio-dist/server/assets/companions-BYbHWKOZ.js +15 -0
  137. package/studio-dist/server/assets/delivery-path-C29fBynY.js +654 -0
  138. package/studio-dist/server/assets/{factory-DT3UzHlh.js → factory-DGPmNGbo.js} +1 -0
  139. package/studio-dist/server/assets/{factory-D6xnjedJ.js → factory-DUTa0eDs.js} +317 -530
  140. package/studio-dist/server/assets/markdown-view-Bn7xPdks.js +86 -0
  141. package/studio-dist/server/assets/panel-3Jmn4awF.js +169 -0
  142. package/studio-dist/server/assets/{prepaint-BMke0fo1.js → prepaint-DJfTQ_VH.js} +6 -2
  143. package/studio-dist/server/assets/{react-COs0LHn-.js → react-Ce6dj15C.js} +4 -9
  144. package/studio-dist/server/assets/reports-C06RXVE2.js +18 -0
  145. package/studio-dist/server/assets/reports-D6YMqhnO.js +142 -0
  146. package/studio-dist/server/assets/router-C8MGqlAY.js +13713 -0
  147. package/studio-dist/server/assets/routes-BcFgvqf7.js +622 -0
  148. package/studio-dist/server/assets/{shell-CboT2f66.js → shell-DS3wUexh.js} +1 -0
  149. package/studio-dist/server/assets/skills-BEnOxiDl.js +266 -0
  150. package/studio-dist/server/assets/skills-CtrBAtX3.js +28 -0
  151. package/studio-dist/server/assets/specs-C8rv34-5.js +211 -0
  152. package/studio-dist/server/assets/{start-BW5ovN0k.js → start-h3ICWwd2.js} +4 -1
  153. package/studio-dist/server/assets/steps-Dq_CwY_s.js +181 -0
  154. package/studio-dist/server/assets/{vault-BGulVoNh.js → vault-BmWnryh3.js} +16 -1
  155. package/studio-dist/server/assets/vault-Fvxt2Tzl.js +1032 -0
  156. package/studio-dist/server/assets/{views-Bd7cRr27.js → views-BgYa-za2.js} +1 -3
  157. package/studio-dist/server/assets/warnings-DzR6fyZh.js +23 -0
  158. package/studio-dist/server/assets/workflow-liRYecHk.js +73 -0
  159. package/studio-dist/server/server.js +3 -157
  160. package/studio-dist/client/assets/companion-view-Csva26Ir.js +0 -1
  161. package/studio-dist/client/assets/delivery-path-DJMpRmiY.js +0 -1
  162. package/studio-dist/client/assets/factory-B7l9ZQyx.js +0 -4
  163. package/studio-dist/client/assets/index-n6uo_92S.js +0 -40
  164. package/studio-dist/client/assets/queries-CN3JwMBX.js +0 -1
  165. package/studio-dist/client/assets/react-CabXf2Ds.js +0 -1
  166. package/studio-dist/client/assets/report-time-Dc-KOqQu.js +0 -1
  167. package/studio-dist/client/assets/reports-C01RsnMA.js +0 -1
  168. package/studio-dist/client/assets/routes-4pbC-2Hj.js +0 -1
  169. package/studio-dist/client/assets/skills-CihQganl.js +0 -1
  170. package/studio-dist/client/assets/spec-areas-C2L48N4C.js +0 -1
  171. package/studio-dist/client/assets/specs-D24_35_K.js +0 -1
  172. package/studio-dist/client/assets/studio-DKxfi691.css +0 -1
  173. package/studio-dist/client/assets/studio-queries-rvbJupCy.js +0 -3
  174. package/studio-dist/client/assets/vault-Bd4CQiTK.js +0 -1
  175. package/studio-dist/client/assets/warnings-V_Ys51wJ.js +0 -1
  176. package/studio-dist/client/assets/workflow-BJejeVwQ.js +0 -1
  177. package/studio-dist/server/assets/delivery-path-BkKNjgkf.js +0 -778
  178. package/studio-dist/server/assets/queries-Ag2iL8q2.js +0 -107
  179. package/studio-dist/server/assets/report-time-DAfzln-N.js +0 -8
  180. package/studio-dist/server/assets/reports-BnUNJVtx.js +0 -126
  181. package/studio-dist/server/assets/router-BH--drIx.js +0 -4298
  182. package/studio-dist/server/assets/routes-khSDK1bV.js +0 -361
  183. package/studio-dist/server/assets/skills-MWYnWoKs.js +0 -106
  184. package/studio-dist/server/assets/spec-areas-DcnO6vW-.js +0 -16
  185. package/studio-dist/server/assets/specs-DE3w8hZP.js +0 -155
  186. package/studio-dist/server/assets/studio-queries-CLnP9kGu.js +0 -3365
  187. package/studio-dist/server/assets/vault-CuyyhLyB.js +0 -832
  188. package/studio-dist/server/assets/warnings-BH05rOuG.js +0 -15
  189. package/studio-dist/server/assets/workflow-BSuIKWqH.js +0 -42
@@ -1,778 +0,0 @@
1
- import { i as __toESM } from "./rolldown-runtime-DYf_mQCB.js";
2
- import { a as SCHEMA_ARTIFACTS, c as CHANGE_PLACEHOLDER, d as IDEA_PLACEHOLDER, o as deliveryPath, s as isMateSchema } from "./studio-BeltxxKt.js";
3
- import { A as require_react, l as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-BQKuMdJW.js";
4
- // src/views/workflow/steps.ts
5
- var CLARIFY_MODES = [
6
- "mate-clarify-intent",
7
- "mate-interview-me",
8
- "mate-grill-me"
9
- ];
10
- var CLARIFY_DESCRIPTIONS = {
11
- "mate-clarify-intent": "Default. Reads what the request already states and routes to an interview, grilling, or skip, then runs that one mode.",
12
- "mate-interview-me": "Explicit mode: guided, one-question-at-a-time clarification when intent, constraints, or scope still need confirmation.",
13
- "mate-grill-me": "Explicit mode: round-based stress test of a mostly known direction to surface hidden assumptions and risks."
14
- };
15
- var STAGE_TEXT = {
16
- "clarify-intent": {
17
- what: "Settles who the change is for, why it is needed, how success is measured, and what binds it, before any artifact exists.",
18
- why: "Intent gaps are cheapest to close before exploration turns them into documents."
19
- },
20
- explore: {
21
- what: "Resolves repository evidence, unknowns, and options, with scope taken from the companion context map, and suggests slicing a large feature.",
22
- why: "It separates uncertainty from the proposal's committed scope."
23
- },
24
- propose: {
25
- what: "Chooses the schema from the minimal eligibility test, checks slicing when explore agreed none, and writes the change's planning artifacts in one prompt.",
26
- why: "One prompt writes every artifact; each one is then reviewed on its own."
27
- },
28
- apply: {
29
- what: "Records the delivery branch, avoiding protected branches, then implements the reviewed tasks.",
30
- why: "The recorded branch is what archive and publication later wait on."
31
- },
32
- "inspect-outcome": {
33
- what: "Shows what the applied change did as a rendered diagram and diff in a Mate report.",
34
- why: "Seeing the result tells the reviewer whether cleanup is warranted."
35
- },
36
- "refine-code": {
37
- what: "Looks for smaller, clearer code once tests pass, preserving behavior.",
38
- why: "Cleanup lands before archive, so shipped code and recorded specs agree."
39
- },
40
- archive: {
41
- what: "Applies the delta specs to the local canonical specs and records the delivery; allowed before the branch merges.",
42
- why: "A feature's later changes build on canonical specs that already include this one."
43
- },
44
- publish: {
45
- what: "Commits, tags, and pushes archived changes whose delivery branches are merged, chosen by the developer.",
46
- why: "Published canonical specs then describe the default branch; unmerged archives wait."
47
- }
48
- };
49
- function reviewText(artifact, topology, schema) {
50
- return {
51
- what: (topology?.schemaName === schema ? topology.artifacts.find((entry) => entry.id === artifact)?.description : void 0) ?? `A person reviews the ${artifact} artifact.`,
52
- why: "Reviews stay with people: Mate never marks them approved."
53
- };
54
- }
55
- function promptFor(stage, schema) {
56
- if (stage.kind === "human") return null;
57
- if (stage.id === "clarify-intent") return `/${stage.skill} about ${IDEA_PLACEHOLDER}`;
58
- const schemaNote = stage.id === "propose" && schema !== "mate-v1" ? ` (use schema: ${schema})` : "";
59
- return `/${stage.skill}${schemaNote} for ${CHANGE_PLACEHOLDER}`;
60
- }
61
- /** The prompt without its placeholders, ready to be completed after pasting. */
62
- function copyPromptFor(prompt) {
63
- if (!prompt) return prompt;
64
- return prompt.replace(` ${CHANGE_PLACEHOLDER}`, "").replace(` ${IDEA_PLACEHOLDER}`, "");
65
- }
66
- function clarifyAlternatives(available) {
67
- return CLARIFY_MODES.filter(available).map((name) => ({
68
- name,
69
- description: CLARIFY_DESCRIPTIONS[name],
70
- prompt: `/${name} about ${IDEA_PLACEHOLDER}`,
71
- copyPrompt: `/${name} about`
72
- }));
73
- }
74
- /** Stages whose skills run an OpenSpec workflow. */
75
- var OPENSPEC_STAGES = /* @__PURE__ */ new Set([
76
- "explore",
77
- "propose",
78
- "apply",
79
- "archive"
80
- ]);
81
- function badgesFor(stage) {
82
- if (stage.kind === "human") return ["human-review"];
83
- const badges = stage.optional ? ["optional", "skill"] : ["skill"];
84
- if (OPENSPEC_STAGES.has(stage.id)) badges.push("openspec");
85
- return badges;
86
- }
87
- var SHIPPED_PATH_TEXT = {
88
- "mate-v1": {
89
- tagline: "full planning",
90
- description: "Full planning path: proposal, specs, design, and tasks."
91
- },
92
- "mate-minimal": {
93
- tagline: "minimal planning",
94
- description: "Short path: specs and tasks only, for one-Area, low-risk changes with clear intent."
95
- }
96
- };
97
- function pathText(schema) {
98
- if (isMateSchema(schema)) return SHIPPED_PATH_TEXT[schema];
99
- return {
100
- tagline: "custom schema",
101
- description: `Planning path of the ${schema} schema.`
102
- };
103
- }
104
- var PHASE_LABELS = {
105
- plan: "Plan",
106
- review: "Review",
107
- build: "Build",
108
- ship: "Ship"
109
- };
110
- /** Plan precedes reviews, Review holds them, Build is apply plus its optional peers, Ship follows. */
111
- function phaseOf(stage, previous) {
112
- if (stage.kind === "human") return "review";
113
- if (stage.id === "apply") return "build";
114
- if (previous === "build" && stage.optional) return "build";
115
- return previous === void 0 || previous === "plan" ? "plan" : "ship";
116
- }
117
- function groupOf(step) {
118
- if (step.kind === "human") return "human";
119
- return step.optional ? "optional" : null;
120
- }
121
- /** Review runs are always one group; optional runs group only when they hold peers. */
122
- function mapOf(steps) {
123
- const runs = [];
124
- for (const step of steps) {
125
- const group = groupOf(step);
126
- const run = runs.at(-1);
127
- if (group && run?.group === group) run.steps.push(step);
128
- else runs.push({
129
- group,
130
- steps: [step]
131
- });
132
- }
133
- return runs.map((run) => run.group === "human" || run.group === "optional" && run.steps.length > 1 ? {
134
- kind: "group",
135
- group: run.group,
136
- steps: run.steps
137
- } : {
138
- kind: "stage",
139
- step: run.steps[0]
140
- });
141
- }
142
- function buildPath(schema, artifacts, options) {
143
- const reported = options.skills ? new Set(options.skills) : null;
144
- const available = (skill) => !reported || reported.has(skill);
145
- const contract = deliveryPath(artifacts);
146
- const steps = [];
147
- for (const stage of contract.stages) {
148
- const text = stage.kind === "human" ? reviewText(stage.artifact, options.topology, schema) : STAGE_TEXT[stage.id];
149
- const prompt = promptFor(stage, schema);
150
- const previous = steps.at(-1);
151
- const step = {
152
- ...stage,
153
- what: text.what,
154
- why: text.why,
155
- badges: badgesFor(stage),
156
- prompt,
157
- copyPrompt: copyPromptFor(prompt),
158
- phase: phaseOf(stage, previous?.phase)
159
- };
160
- if (stage.id === "clarify-intent") step.alternatives = clarifyAlternatives(available);
161
- if (stage.kind === "skill" && !available(stage.skill)) step.missingSkill = stage.skill;
162
- if (stage.id === "apply") step.sessionBreakBefore = true;
163
- steps.push(step);
164
- }
165
- return {
166
- schema,
167
- label: schema,
168
- ...pathText(schema),
169
- steps,
170
- map: mapOf(steps),
171
- reviewsKnown: contract.reviewsKnown
172
- };
173
- }
174
- function schemaArtifacts(schema, topology) {
175
- if (topology?.schemaName === schema) return topology.artifacts.map((artifact) => artifact.id);
176
- return isMateSchema(schema) ? SCHEMA_ARTIFACTS[schema] : void 0;
177
- }
178
- /** The Delivery Path Studio shows: a path per schema Mate ships, or the served schema's alone. */
179
- function workflowPlan(options = {}) {
180
- const served = options.topology?.schemaName;
181
- return { paths: (served && !isMateSchema(served) ? [served] : Object.keys(SCHEMA_ARTIFACTS)).map((schema) => buildPath(schema, schemaArtifacts(schema, options.topology), options)) };
182
- }
183
- // src/views/workflow/graph.ts
184
- var stageNode = (step) => ({
185
- id: step.id,
186
- kind: "stage",
187
- step
188
- });
189
- function columnsOf(path) {
190
- const columns = path.map.map((entry) => {
191
- if (entry.kind === "stage") return {
192
- nodes: [stageNode(entry.step)],
193
- optional: entry.step.optional,
194
- phase: entry.step.phase
195
- };
196
- if (entry.group === "human") return {
197
- nodes: [{
198
- id: "reviews",
199
- kind: "review-group",
200
- steps: entry.steps
201
- }],
202
- optional: false,
203
- phase: entry.steps[0].phase
204
- };
205
- return {
206
- nodes: entry.steps.map(stageNode),
207
- optional: true,
208
- phase: entry.steps[0].phase
209
- };
210
- });
211
- columns.unshift({
212
- nodes: [{
213
- id: "start",
214
- kind: "start"
215
- }],
216
- optional: false,
217
- phase: columns[0]?.phase ?? "plan"
218
- });
219
- return columns;
220
- }
221
- function entersNewSession(node) {
222
- if (node.kind === "stage") return Boolean(node.step.sessionBreakBefore);
223
- if (node.kind === "review-group") return Boolean(node.steps[0].sessionBreakBefore);
224
- return false;
225
- }
226
- function edgesOf(columns) {
227
- const edges = [];
228
- const link = (from, to, kind) => {
229
- for (const a of from) for (const b of to) edges.push({
230
- from: a.id,
231
- to: b.id,
232
- kind,
233
- newSession: entersNewSession(b)
234
- });
235
- };
236
- columns.forEach((column, index) => {
237
- const next = columns[index + 1];
238
- if (next) link(column.nodes, next.nodes, "flow");
239
- const before = columns[index - 1];
240
- if (column.optional && before && next) link(before.nodes, next.nodes, "bypass");
241
- });
242
- return edges;
243
- }
244
- function bandsOf(columns) {
245
- const bands = [];
246
- columns.forEach((column, index) => {
247
- const band = bands.at(-1);
248
- if (band?.phase === column.phase) {
249
- band.to = index + 1;
250
- return;
251
- }
252
- bands.push({
253
- phase: column.phase,
254
- label: PHASE_LABELS[column.phase],
255
- from: index,
256
- to: index + 1
257
- });
258
- });
259
- return bands;
260
- }
261
- /** Changes archive before they publish, so everything up to Archive change repeats per change. */
262
- function cycleOf(columns) {
263
- const archive = columns.findIndex((column) => column.nodes.some((node) => node.id === "archive"));
264
- return archive === -1 ? null : {
265
- from: 0,
266
- to: archive + 1
267
- };
268
- }
269
- /** The path's node graph. Single nodes span every row; peers take a row each. */
270
- function workflowGraph(path) {
271
- const columns = columnsOf(path);
272
- const rows = Math.max(1, ...columns.map((column) => column.nodes.length));
273
- const nodes = columns.flatMap((column, index) => column.nodes.map((node, row) => column.nodes.length === 1 ? {
274
- ...node,
275
- column: index,
276
- row: 0,
277
- rowSpan: rows
278
- } : {
279
- ...node,
280
- column: index,
281
- row,
282
- rowSpan: 1
283
- }));
284
- return {
285
- columns: columns.length,
286
- rows,
287
- nodes,
288
- edges: edgesOf(columns),
289
- bands: bandsOf(columns),
290
- cycle: cycleOf(columns)
291
- };
292
- }
293
- var graphAcross = (graph) => graph.rows * 2 + 1;
294
- function nodeCenter(node) {
295
- return {
296
- along: node.column + .5,
297
- across: node.row * 2 + node.rowSpan
298
- };
299
- }
300
- var round = (value) => Math.round(value * 1e4) / 1e4;
301
- var percent = (part, whole) => `${round(part / whole * 100)}%`;
302
- /** An SVG `x y` pair: across is horizontal, along runs down. */
303
- var pair = ({ along, across }) => `${round(across)} ${round(along)}`;
304
- function endpoints(graph, edge) {
305
- const at = (id) => {
306
- const node = graph.nodes.find((candidate) => candidate.id === id);
307
- if (!node) throw new Error(`Unknown graph node: ${id}`);
308
- return nodeCenter(node);
309
- };
310
- return [at(edge.from), at(edge.to)];
311
- }
312
- /** Center to center: nodes are opaque and drawn over the edges, so a line meets each border. */
313
- function edgePath(graph, edge) {
314
- const [a, b] = endpoints(graph, edge);
315
- if (edge.kind === "bypass") {
316
- const lane = graphAcross(graph);
317
- return `M ${pair(a)} C ${pair({
318
- along: a.along,
319
- across: lane
320
- })}, ${pair({
321
- along: b.along,
322
- across: lane
323
- })}, ${pair(b)}`;
324
- }
325
- const middle = (a.along + b.along) / 2;
326
- return `M ${pair(a)} C ${pair({
327
- along: middle,
328
- across: a.across
329
- })}, ${pair({
330
- along: middle,
331
- across: b.across
332
- })}, ${pair(b)}`;
333
- }
334
- /** Midpoint of an edge's curve, where a new-session mark sits. */
335
- function edgeMidpoint(graph, edge) {
336
- const [a, b] = endpoints(graph, edge);
337
- const along = (a.along + b.along) / 2;
338
- if (edge.kind === "bypass") return {
339
- along,
340
- across: (a.across + b.across) / 8 + graphAcross(graph) * 3 / 4
341
- };
342
- return {
343
- along,
344
- across: (a.across + b.across) / 2
345
- };
346
- }
347
- /** A point as percentages of the drawing, for undistorted marks. */
348
- function percentOf(graph, point) {
349
- return {
350
- x: percent(point.across, graphAcross(graph)),
351
- y: percent(point.along, graph.columns)
352
- };
353
- }
354
- /** A column range's vertical extent as percentages of the drawing: a band or the cycle. */
355
- function bandSpan(graph, band) {
356
- return {
357
- top: percent(band.from, graph.columns),
358
- height: percent(band.to - band.from, graph.columns)
359
- };
360
- }
361
- // src/views/workflow/delivery-path.tsx
362
- var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
363
- var import_jsx_runtime = require_jsx_runtime();
364
- function DeliveryPathView({ payload }) {
365
- const plan = workflowPlan({
366
- skills: payload.skills && payload.skills.length > 0 ? payload.skills : void 0,
367
- topology: payload.topology
368
- });
369
- const [schema, setSchema] = (0, import_react.useState)(plan.paths[0]?.schema);
370
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {
371
- className: "workflow-delivery-path",
372
- "aria-label": "Delivery Path",
373
- children: plan.paths.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
374
- className: "workflow-schema",
375
- "data-workflow-schema-root": true,
376
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
377
- className: "view-choice",
378
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "OpenSpec schema" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("select", {
379
- "data-workflow-schema-select": true,
380
- value: schema,
381
- onChange: (event) => setSchema(event.target.value),
382
- children: plan.paths.map((path) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", {
383
- value: path.schema,
384
- children: [
385
- path.label,
386
- " – ",
387
- path.tagline
388
- ]
389
- }, path.schema))
390
- })]
391
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
392
- className: "workflow-schema-panels",
393
- children: plan.paths.map((path) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {
394
- "data-workflow-schema-panel": path.schema,
395
- "data-active": path.schema === schema ? "true" : "false",
396
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PathBody, { path })
397
- }, path.schema))
398
- })]
399
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
400
- className: "workflow-schema",
401
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
402
- className: "view-choice",
403
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "OpenSpec schema" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("code", { children: [
404
- plan.paths[0].label,
405
- " – ",
406
- plan.paths[0].tagline
407
- ] })]
408
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PathBody, { path: plan.paths[0] })]
409
- })
410
- });
411
- }
412
- /**
413
- * The graph is the path; the side panel shows one stage at a time. A node link targets its
414
- * card, and CSS shows only the targeted card, so selection needs no script. With nothing
415
- * selected the panel shows the path overview.
416
- */
417
- function PathBody({ path }) {
418
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
419
- className: "workflow-path",
420
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
421
- className: "workflow-path-graph",
422
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(WorkflowGraphView, { path }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GraphLegend, {})]
423
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", {
424
- className: "workflow-detail",
425
- "aria-label": `${path.label} stage details`,
426
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
427
- className: "workflow-detail-overview",
428
- id: overviewId(path),
429
- children: [
430
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
431
- className: "workflow-description",
432
- children: path.description
433
- }),
434
- !path.reviewsKnown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
435
- className: "workflow-description",
436
- children: "The schema's artifacts could not be read, so its review stages are unknown."
437
- }) : null,
438
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
439
- className: "workflow-description",
440
- children: "A workset is one or more changes published together: after Archive change, start again at the top for the next change, and publish once they are archived."
441
- }),
442
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
443
- className: "workflow-detail-hint",
444
- children: "Select a node in the graph to see what that stage does and the prompt that runs it."
445
- })
446
- ]
447
- }), path.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StageCard, {
448
- path,
449
- step
450
- }, step.id))]
451
- })]
452
- });
453
- }
454
- var cardId = (path, step) => `workflow-${path.schema}-${step.id}`;
455
- var overviewId = (path) => `workflow-${path.schema}-overview`;
456
- /** Each node's progress, by column: everything left of the current node is done. */
457
- function progressOf(graph, progress) {
458
- if (!progress) return () => void 0;
459
- const at = currentColumn(graph, progress.current);
460
- return (node) => {
461
- if (node.column < at) return "done";
462
- return node.id === progress.current ? "current" : "next";
463
- };
464
- }
465
- /** The current node's column; past the last column when `complete`. */
466
- function currentColumn(graph, current) {
467
- const found = graph.nodes.find((node) => node.id === current);
468
- if (found) return found.column;
469
- if (current === "complete") return graph.columns;
470
- return -1;
471
- }
472
- /**
473
- * Node links are the only announced part: their document order is the stage order. Bands,
474
- * edges, and marks are decorative and hidden from assistive technology. With `progress` the
475
- * map shows one item's position, and nodes are plain labels rather than stage-card links.
476
- */
477
- function WorkflowGraphView({ path, progress, label = "Delivery Path map" }) {
478
- const graph = workflowGraph(path);
479
- const stateOf = progressOf(graph, progress);
480
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
481
- className: "workflow-graph",
482
- "aria-label": label,
483
- "data-progress-activity": progress?.activity,
484
- style: {
485
- "--graph-columns": String(graph.columns),
486
- "--graph-rows": String(graph.rows)
487
- },
488
- children: [
489
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
490
- className: "workflow-graph-bands",
491
- "aria-hidden": "true",
492
- children: [
493
- graph.bands.map((band) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
494
- className: "workflow-graph-band",
495
- "data-band": band.phase,
496
- style: bandSpan(graph, band),
497
- children: band.label
498
- }, band.phase)),
499
- graph.cycle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
500
- className: "workflow-graph-cycle",
501
- style: bandSpan(graph, graph.cycle),
502
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "repeats for each change" })
503
- }) : null,
504
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
505
- className: "workflow-graph-workset",
506
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "workset" })
507
- })
508
- ]
509
- }),
510
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GraphLayer, {
511
- graph,
512
- stateOf
513
- }),
514
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
515
- className: "workflow-graph-nodes",
516
- children: graph.nodes.map((node) => node.kind === "start" ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", {
517
- className: "workflow-graph-node",
518
- "data-node-kind": node.kind,
519
- "data-progress": stateOf(node),
520
- "aria-current": stateOf(node) === "current" ? "step" : void 0,
521
- style: {
522
- "--graph-row": String(node.column + 1),
523
- "--graph-lane": String(node.row + 1),
524
- "--graph-span": String(node.rowSpan)
525
- },
526
- children: node.kind === "stage" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NodeLink, {
527
- path,
528
- step: node.step,
529
- box: true,
530
- plain: Boolean(progress),
531
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressNote, {
532
- progress,
533
- state: stateOf(node)
534
- })
535
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
536
- className: "workflow-graph-box workflow-graph-group",
537
- "data-map-group": "human",
538
- children: [
539
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
540
- className: "workflow-graph-group-label",
541
- children: "Human review"
542
- }),
543
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { children: node.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NodeLink, {
544
- path,
545
- step,
546
- plain: Boolean(progress)
547
- }) }, step.id)) }),
548
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressNote, {
549
- progress,
550
- state: stateOf(node)
551
- })
552
- ]
553
- })
554
- }, node.id))
555
- })
556
- ]
557
- });
558
- }
559
- /** Explains the graph's visual marks; the panel states the same facts per stage. */
560
- function GraphLegend() {
561
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", {
562
- className: "workflow-graph-legend",
563
- "aria-hidden": "true",
564
- children: [
565
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "workflow-legend-optional" }), "optional"] }),
566
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "workflow-graph-openspec" }), "OpenSpec"] }),
567
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "workflow-legend-session" }), "new session"] }),
568
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "workflow-legend-skip" }), "can be skipped"] })
569
- ]
570
- });
571
- }
572
- /** The current node's note, plus the done mark for assistive technology. */
573
- function ProgressNote({ progress, state }) {
574
- if (state === "done") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
575
- className: "visually-hidden",
576
- children: ", done"
577
- });
578
- if (state !== "current" || !progress?.note) return null;
579
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
580
- className: "workflow-graph-note",
581
- children: progress.note
582
- });
583
- }
584
- function GraphLayer({ graph, stateOf }) {
585
- /** A flow edge into a done or current node is the way the item came. */
586
- const travelled = (edge) => {
587
- const to = graph.nodes.find((node) => node.id === edge.to);
588
- const state = to ? stateOf(to) : void 0;
589
- return edge.kind === "flow" && (state === "done" || state === "current");
590
- };
591
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
592
- className: "workflow-graph-layer",
593
- "aria-hidden": "true",
594
- focusable: "false",
595
- children: [
596
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
597
- viewBox: `0 0 ${graphAcross(graph)} ${graph.columns}`,
598
- preserveAspectRatio: "none",
599
- overflow: "visible",
600
- children: graph.edges.map((edge) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
601
- className: "workflow-graph-edge",
602
- d: edgePath(graph, edge),
603
- "data-edge-kind": edge.kind,
604
- "data-edge-from": edge.from,
605
- "data-edge-to": edge.to,
606
- "data-new-session": edge.newSession ? "true" : void 0,
607
- "data-travelled": travelled(edge) ? "true" : void 0
608
- }, `${edge.kind}-${edge.from}-${edge.to}`))
609
- }),
610
- graph.nodes.map((node) => {
611
- if (node.kind !== "start") return null;
612
- const { x, y } = percentOf(graph, nodeCenter(node));
613
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
614
- className: "workflow-graph-start",
615
- cx: x,
616
- cy: y,
617
- r: "3.5"
618
- }, node.id);
619
- }),
620
- graph.edges.map((edge) => {
621
- if (!edge.newSession) return null;
622
- const { x, y } = percentOf(graph, edgeMidpoint(graph, edge));
623
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
624
- className: "workflow-graph-session",
625
- "data-session-mark": edge.to,
626
- cx: x,
627
- cy: y,
628
- r: "3.5"
629
- }, `${edge.from}-${edge.to}`);
630
- })
631
- ]
632
- });
633
- }
634
- /**
635
- * `box` marks a standalone node; links inside the review group share its box. `plain` renders
636
- * a label without a link, for a map with no stage cards beside it.
637
- */
638
- function NodeLink({ path, step, box, plain, children }) {
639
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(plain ? "span" : "a", {
640
- className: box ? "workflow-graph-link workflow-graph-box" : "workflow-graph-link",
641
- href: plain ? void 0 : `#${cardId(path, step)}`,
642
- "data-map-stage": step.id,
643
- "data-stage-kind": step.kind,
644
- "data-optional": step.optional ? "true" : void 0,
645
- "aria-label": step.kind === "human" ? step.label : void 0,
646
- children: [
647
- step.badges.includes("openspec") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
648
- className: "workflow-graph-openspec",
649
- "aria-hidden": "true"
650
- }) : null,
651
- step.kind === "human" ? step.artifact : step.label,
652
- children
653
- ]
654
- });
655
- }
656
- function StageCard({ path, step }) {
657
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
658
- className: "workflow-card",
659
- id: cardId(path, step),
660
- "data-stage": step.id,
661
- "data-stage-kind": step.kind,
662
- "data-optional": step.optional ? "true" : void 0,
663
- children: [
664
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
665
- className: "workflow-card-header",
666
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
667
- className: "workflow-card-heading",
668
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: step.label }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WorkflowBadges, { badges: shownBadges(step) })]
669
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
670
- className: "workflow-card-meta",
671
- children: [
672
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: PHASE_LABELS[step.phase] }),
673
- step.skill ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: step.skill }) : null,
674
- step.sessionBreakBefore ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
675
- className: "workflow-card-session",
676
- children: "New session / clean chat"
677
- }) : null
678
- ]
679
- })]
680
- }),
681
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StageRun, { step }),
682
- step.missingSkill ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
683
- className: "workflow-missing-skill",
684
- role: "note",
685
- children: [
686
- "Skill not reported for this companion: ",
687
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: step.missingSkill }),
688
- ". Run",
689
- " ",
690
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: "mate companion update" }),
691
- "; this stage is not complete."
692
- ]
693
- }) : null,
694
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
695
- className: "workflow-card-explanation",
696
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "What" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: step.what })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: "Why" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: step.why })] })]
697
- }),
698
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("footer", {
699
- className: "workflow-card-footer",
700
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
701
- href: `#${overviewId(path)}`,
702
- children: "Path overview"
703
- })
704
- })
705
- ]
706
- });
707
- }
708
- /** How a stage runs: a person's review, a choice of prompts, or its one prompt. */
709
- function StageRun({ step }) {
710
- if (step.kind === "human") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
711
- className: "workflow-card-human",
712
- children: [
713
- "Review ",
714
- step.artifact,
715
- " yourself — no skill, no prompt"
716
- ]
717
- });
718
- if (step.alternatives?.length) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WorkflowOptions, { step });
719
- if (!step.prompt) return null;
720
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
721
- className: "workflow-command",
722
- children: [
723
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
724
- className: "workflow-command-label",
725
- children: "Run"
726
- }),
727
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: step.prompt }),
728
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WorkflowCopy, {
729
- text: step.copyPrompt ?? step.prompt,
730
- label: `${step.label} prompt`
731
- })
732
- ]
733
- });
734
- }
735
- function WorkflowOptions({ step }) {
736
- if (!step.alternatives?.length) return null;
737
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
738
- className: "workflow-option-list",
739
- children: step.alternatives.map((alternative) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
740
- className: "workflow-option",
741
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
742
- className: "workflow-command",
743
- children: [
744
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
745
- className: "workflow-command-label",
746
- children: "Option"
747
- }),
748
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: alternative.prompt }),
749
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WorkflowCopy, {
750
- text: alternative.copyPrompt,
751
- label: `${alternative.name} prompt`
752
- })
753
- ]
754
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: alternative.description })]
755
- }, alternative.name))
756
- });
757
- }
758
- function WorkflowCopy({ text, label }) {
759
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
760
- type: "button",
761
- className: "runway-step-copy",
762
- "data-copy": text,
763
- "data-copy-label": label,
764
- children: "Copy"
765
- });
766
- }
767
- /** The skill name already says a stage is a skill stage, so that badge is not shown. */
768
- var shownBadges = (step) => step.badges.filter((badge) => badge !== "skill");
769
- function WorkflowBadges({ badges }) {
770
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
771
- className: "workflow-badges",
772
- children: badges.map((badge) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("em", {
773
- className: `runway-step-badge runway-step-badge-${badge}`,
774
- children: badge === "human-review" ? "Human review" : badge
775
- }, badge))
776
- });
777
- }
778
- export { WorkflowGraphView as n, workflowPlan as r, DeliveryPathView as t };