@uniqbit/mate-core 1.0.0-canary.0 → 1.0.0-canary.2
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.
- package/claude-capability-plugins/companion-mentions/.claude-plugin/marketplace.json +14 -0
- package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +8 -0
- package/claude-capability-plugins/companion-mentions/hooks/companion.ts +457 -0
- package/claude-capability-plugins/companion-mentions/hooks/hooks.json +1 -0
- package/claude-capability-plugins/companion-mentions/hooks/register.ts +403 -0
- package/claude-plugin/hooks/hooks.json +10 -1
- package/claude-plugin/hooks/tokensave-route.mjs +52 -0
- package/opencode-plugin/src/server.ts +4 -0
- package/opencode-plugin/src/tui.tsx +2 -0
- package/opencode-plugin/tui.tsx +2 -0
- package/package.json +45 -16
- package/src/brand/terminal.ts +5 -0
- package/src/cli/commands/artifact/apply-context.ts +275 -0
- package/src/cli/commands/artifact/artifact.ts +4 -0
- package/src/cli/commands/artifact/delivery/archive.ts +13 -5
- package/src/cli/commands/artifact/delivery/environment.ts +36 -13
- package/src/cli/commands/artifact/delivery/link.ts +35 -15
- package/src/cli/commands/artifact/delivery/output.ts +31 -0
- package/src/cli/commands/artifact/finish/command.ts +50 -5
- package/src/cli/commands/artifact/finish/engine.ts +44 -11
- package/src/cli/commands/artifact/finish/git.ts +132 -19
- package/src/cli/commands/artifact/finish/openspec.ts +6 -1
- package/src/cli/commands/artifact/finish/worktree-cleanup.ts +92 -0
- package/src/cli/commands/cap/index-cmd.ts +64 -15
- package/src/cli/commands/cap/tokensave.ts +7 -5
- package/src/cli/commands/companion/link.ts +14 -1
- package/src/cli/commands/companion/open.ts +16 -11
- package/src/cli/commands/companion/sync.ts +10 -0
- package/src/cli/commands/companion/tui.ts +17 -7
- package/src/cli/commands/companion/update.ts +74 -12
- package/src/cli/commands/doctor.ts +20 -5
- package/src/cli/commands/factory/factory.ts +301 -0
- package/src/cli/commands/install.ts +133 -9
- package/src/cli/commands/launch/shared.ts +16 -11
- package/src/cli/commands/report/index.ts +20 -1
- package/src/cli/commands/session/context.ts +102 -0
- package/src/cli/commands/setup.ts +44 -10
- package/src/cli/commands/studio/factory-credential.ts +49 -0
- package/src/cli/commands/studio/index.ts +29 -2
- package/src/cli/commands/studio/payload.ts +249 -15
- package/src/cli/commands/studio/routes.ts +41 -8
- package/src/cli/commands/studio/selection.ts +142 -16
- package/src/cli/commands/studio/server.ts +403 -364
- package/src/cli/commands/studio/services.ts +60 -0
- package/src/cli/commands/studio/studio-app.ts +67 -0
- package/src/cli/commands/studio/terminal-assets.ts +21 -33
- package/src/cli/commands/studio/terminal.ts +85 -15
- package/src/cli/commands/studio/views/model.ts +18 -0
- package/src/cli/commands/studio/views/vault/markdown-tree.ts +267 -0
- package/src/cli/commands/studio/views/vault/view.ts +185 -0
- package/src/cli/commands/studio/workset-session.ts +131 -0
- package/src/cli/commands/unwrap.ts +8 -0
- package/src/cli/commands/update.ts +27 -1
- package/src/cli/commands/working/cleanup.ts +10 -1
- package/src/cli/commands/working/link.ts +76 -0
- package/src/cli/commands/working/working.ts +10 -0
- package/src/cli/commands/working/worktree.ts +356 -0
- package/src/cli/companion-link-wizard.tsx +2 -0
- package/src/cli/companion-selector.tsx +2 -0
- package/src/cli/confirm.ts +2 -0
- package/src/cli/install-plan.tsx +127 -160
- package/src/cli/launch-selector.tsx +2 -0
- package/src/cli/main.ts +18 -0
- package/src/cli/parse-flags.ts +9 -1
- package/src/cli/repo-list-table.tsx +2 -0
- package/src/cli/setup-selector.tsx +79 -20
- package/src/cli/usage.ts +11 -1
- package/src/create-mate.ts +5 -4
- package/src/hooks/tokensave-route.ts +26 -0
- package/src/lib/apply-context/fingerprint.ts +174 -0
- package/src/lib/apply-context/protocol.ts +193 -0
- package/src/lib/components/confirm-prompt.tsx +21 -9
- package/src/lib/components/select-menu.tsx +10 -3
- package/src/lib/components/spinner.tsx +4 -2
- package/src/lib/components/startup-progress.tsx +227 -41
- package/src/lib/components/text-input-display.tsx +2 -0
- package/src/lib/components/wizard-footer.tsx +2 -0
- package/src/lib/components/wizard-header.tsx +13 -11
- package/src/lib/delivery/archive-change.ts +14 -2
- package/src/lib/delivery/branches.ts +29 -5
- package/src/lib/delivery/environment.ts +7 -1
- package/src/lib/delivery/forge.ts +2 -2
- package/src/lib/delivery/merge-git.ts +261 -0
- package/src/lib/delivery/overlap.ts +11 -4
- package/src/lib/delivery/record-delivery.ts +97 -10
- package/src/lib/delivery/record.ts +67 -7
- package/src/lib/delivery/refresh.ts +104 -10
- package/src/lib/delivery/repository-access.ts +46 -2
- package/src/lib/delivery/resolve-branch.ts +162 -0
- package/src/lib/delivery/token.ts +7 -41
- package/src/lib/factory/attach-client.ts +113 -0
- package/src/lib/factory/attach.ts +178 -0
- package/src/lib/factory/broker.ts +190 -0
- package/src/lib/factory/bun-commands.ts +39 -0
- package/src/lib/factory/client.ts +92 -0
- package/src/lib/factory/command.ts +61 -0
- package/src/lib/factory/credential-store.ts +153 -0
- package/src/lib/factory/frames.ts +77 -0
- package/src/lib/factory/ids.ts +58 -0
- package/src/lib/factory/keyed-serial.ts +27 -0
- package/src/lib/factory/outcomes/actions.ts +114 -0
- package/src/lib/factory/outcomes/index.ts +381 -0
- package/src/lib/factory/outcomes/lifecycle.ts +205 -0
- package/src/lib/factory/outcomes/runs.ts +81 -0
- package/src/lib/factory/outcomes/sessions.ts +38 -0
- package/src/lib/factory/prepare.ts +49 -0
- package/src/lib/factory/pty.ts +103 -0
- package/src/lib/factory/runner/companion-context.ts +178 -0
- package/src/lib/factory/runner/control.ts +92 -0
- package/src/lib/factory/runner/harness-agent.ts +250 -0
- package/src/lib/factory/runner/live.ts +159 -0
- package/src/lib/factory/runner/questions.ts +22 -0
- package/src/lib/factory/runner/rank.ts +26 -0
- package/src/lib/factory/runner/run-policy.ts +12 -0
- package/src/lib/factory/runner/run.ts +199 -0
- package/src/lib/factory/runner/scheduler.ts +416 -0
- package/src/lib/factory/runner/state.ts +233 -0
- package/src/lib/factory/runner/workflow.ts +542 -0
- package/src/lib/factory/runtime.ts +972 -0
- package/src/lib/factory/sandbox.ts +292 -0
- package/src/lib/factory/worktree-branch.ts +17 -0
- package/src/lib/install.ts +66 -14
- package/src/lib/live-progress.ts +36 -0
- package/src/lib/member-choices.ts +67 -0
- package/src/lib/orchestrator/adapters/base.ts +55 -22
- package/src/lib/orchestrator/adapters/claude.ts +6 -1
- package/src/lib/orchestrator/config-store.ts +3 -2
- package/src/lib/orchestrator/editor.ts +29 -23
- package/src/lib/orchestrator/projection-entries.ts +56 -21
- package/src/lib/orchestrator/projection-opencode-copies.ts +32 -15
- package/src/lib/orchestrator/projection-openspec-store.ts +54 -9
- package/src/lib/orchestrator/projection-types.ts +33 -1
- package/src/lib/orchestrator/session-context-link.ts +67 -0
- package/src/lib/orchestrator/setup-compatibilities.ts +55 -12
- package/src/lib/orchestrator/types.ts +5 -0
- package/src/lib/orchestrator/working-repo-projection.ts +50 -7
- package/src/lib/orchestrator/workspace-document.ts +105 -0
- package/src/lib/package-paths.ts +29 -0
- package/src/lib/runtime-directory-refresh.ts +17 -1
- package/src/lib/workset/record.ts +513 -0
- package/src/lib/workset/repositories.ts +55 -0
- package/src/lib/workset/stage.ts +148 -0
- package/src/lib/workset/stages.ts +113 -0
- package/src/lib/workset/worktree-index.ts +116 -0
- package/src/lib/workset/worktree.ts +830 -0
- package/src/opencode/companion-hooks.ts +45 -2
- package/src/opencode/enter-worktree.ts +72 -0
- package/src/opencode/tui.tsx +9 -4
- package/src/plugins.ts +1 -0
- package/src/runtime/claude-delivery-plan.ts +22 -5
- package/src/runtime/companion-git.ts +52 -10
- package/src/runtime/companion-guidance.ts +7 -7
- package/src/runtime/companion-lock.ts +30 -7
- package/src/runtime/env.ts +48 -3
- package/src/runtime/git-layout.ts +219 -0
- package/src/runtime/index.ts +24 -0
- package/src/runtime/physical-path.ts +111 -0
- package/src/runtime/policy.ts +36 -2
- package/src/runtime/runtime-directory.ts +5 -0
- package/src/runtime/secret-guard.ts +19 -5
- package/src/runtime/secret-patterns.ts +267 -34
- package/src/runtime/session-context.ts +98 -0
- package/src/runtime/tokensave-route.ts +152 -0
- package/src/runtime/wrap-state.ts +24 -16
- package/src/studio.ts +124 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +10 -8
- package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +16 -98
- package/src/templates/capabilities/openspec-cap/openspec-conventions.yaml +10 -2
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +76 -18
- package/src/templates/mate-skills/agents/mate-apply-change/references/mate-compact-apply.md +47 -0
- package/src/templates/mate-skills/agents/mate-apply-change/references/openspec-apply-change.md +2 -0
- package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +32 -5
- package/src/templates/mate-skills/agents/mate-backfill-spec/SKILL.md +8 -1
- package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +16 -1
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +22 -6
- package/src/templates/mate-skills/agents/mate-explore-change/references/openspec-explore.md +2 -0
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +8 -1
- package/src/templates/mate-skills/agents/mate-grill-with-docs/SKILL.md +2 -2
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +7 -0
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +55 -50
- package/src/templates/mate-skills/agents/mate-propose-change/references/mate-revise.md +47 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-propose.md +2 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md +2 -0
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +29 -10
- package/src/templates/mate-skills/agents/mate-publish-artifact/references/openspec.md +4 -2
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +21 -0
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +13 -0
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +76 -18
- package/src/templates/mate-skills/claude/mate-apply-change/references/mate-compact-apply.md +47 -0
- package/src/templates/mate-skills/claude/mate-apply-change/references/openspec-apply-change.md +2 -0
- package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +32 -5
- package/src/templates/mate-skills/claude/mate-backfill-spec/SKILL.md +8 -1
- package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +16 -1
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +22 -6
- package/src/templates/mate-skills/claude/mate-explore-change/references/openspec-explore.md +2 -0
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +8 -1
- package/src/templates/mate-skills/claude/mate-grill-with-docs/SKILL.md +2 -2
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +7 -0
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +55 -50
- package/src/templates/mate-skills/claude/mate-propose-change/references/mate-revise.md +47 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-propose.md +2 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-update-change.md +2 -0
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +29 -10
- package/src/templates/mate-skills/claude/mate-publish-artifact/references/openspec.md +4 -2
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +21 -0
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +13 -0
- package/src/templates/mate-skills/openspec-references.ts +2 -0
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +364 -224
- package/src/tools/setup/capabilities/companion-mentions.ts +27 -0
- package/src/tools/setup/capabilities/context-mode.ts +34 -5
- package/src/tools/setup/capabilities/graphify-secrets.ts +2 -14
- package/src/tools/setup/capabilities/graphify.ts +34 -7
- package/src/tools/setup/capabilities/openspec.ts +12 -2
- package/src/tools/setup/capabilities/react-doctor.ts +8 -1
- package/src/tools/setup/capabilities/rtk.ts +4 -0
- package/src/tools/setup/capabilities/tokensave.ts +77 -68
- package/src/tools/setup/engine.ts +3 -2
- package/src/tools/setup/install-contract.ts +8 -0
- package/src/tools/setup/mate-skill-copies.ts +51 -0
- package/src/tools/setup/package-managers/uv.ts +73 -11
- package/src/tools/setup/plugin.ts +5 -0
- package/src/tools/setup/providers/claude-plugin-hooks.ts +12 -0
- package/src/tools/setup/providers/claude-worktree-plugins.ts +122 -0
- package/src/tools/setup/providers/claude.ts +11 -5
- package/src/tools/setup/utils.ts +4 -0
- package/src/tools/setup/working-repo-cleanup.ts +29 -1
- package/src/tools/setup/working-repo-local-state.ts +252 -75
- package/src/tools/setup.ts +57 -16
- package/studio-dist/client/assets/companion-view-Csva26Ir.js +1 -0
- package/studio-dist/client/assets/delivery-path-DJMpRmiY.js +1 -0
- package/studio-dist/client/assets/dist-Dm7MtyHc.js +5 -0
- package/studio-dist/client/assets/factory-B7l9ZQyx.js +4 -0
- package/studio-dist/client/assets/index-n6uo_92S.js +40 -0
- package/studio-dist/client/assets/preload-helper-BLdHbfdN.js +1 -0
- package/studio-dist/client/assets/prepaint-CD5OpmTM.js +24 -0
- package/studio-dist/client/assets/queries-CN3JwMBX.js +1 -0
- package/studio-dist/client/assets/react-CabXf2Ds.js +1 -0
- package/studio-dist/client/assets/report-time-Dc-KOqQu.js +1 -0
- package/studio-dist/client/assets/reports-C01RsnMA.js +1 -0
- package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/studio-dist/client/assets/routes-4pbC-2Hj.js +1 -0
- package/studio-dist/client/assets/skills-CihQganl.js +1 -0
- package/studio-dist/client/assets/spec-areas-C2L48N4C.js +1 -0
- package/studio-dist/client/assets/specs-D24_35_K.js +1 -0
- package/studio-dist/client/assets/studio-DKxfi691.css +1 -0
- package/studio-dist/client/assets/studio-queries-rvbJupCy.js +3 -0
- package/studio-dist/client/assets/terminal-eU5fzQzv.css +1 -0
- package/studio-dist/client/assets/vault-Bd4CQiTK.js +1 -0
- package/studio-dist/client/assets/warnings-V_Ys51wJ.js +1 -0
- package/studio-dist/client/assets/wasm-inline-C2en61B5.js +1 -0
- package/studio-dist/client/assets/workflow-BJejeVwQ.js +1 -0
- package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-BQKuMdJW.js +3881 -0
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +85 -0
- package/studio-dist/server/assets/actions-Bvgj9eb8.js +54 -0
- package/studio-dist/server/assets/actions-D8erOphH.js +44 -0
- package/studio-dist/server/assets/companion-view-aBady57v.js +33 -0
- package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +459 -0
- package/studio-dist/server/assets/createServerRpc-tK2lE9R2.js +11 -0
- package/studio-dist/server/assets/delivery-path-BkKNjgkf.js +778 -0
- package/studio-dist/server/assets/dist-DpJWKyCm.js +5582 -0
- package/studio-dist/server/assets/empty-plugin-adapters-Cipd4ZH4.js +4 -0
- package/studio-dist/server/assets/factory-D6xnjedJ.js +2385 -0
- package/studio-dist/server/assets/factory-DT3UzHlh.js +68 -0
- package/studio-dist/server/assets/model-PyPALjii.js +18 -0
- package/studio-dist/server/assets/prepaint-BMke0fo1.js +41 -0
- package/studio-dist/server/assets/queries-Ag2iL8q2.js +107 -0
- package/studio-dist/server/assets/react-COs0LHn-.js +51 -0
- package/studio-dist/server/assets/report-time-DAfzln-N.js +8 -0
- package/studio-dist/server/assets/reports-BnUNJVtx.js +126 -0
- package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +34 -0
- package/studio-dist/server/assets/router-BH--drIx.js +4298 -0
- package/studio-dist/server/assets/routes-khSDK1bV.js +361 -0
- package/studio-dist/server/assets/search-JAKurDNh.js +36 -0
- package/studio-dist/server/assets/shell-CboT2f66.js +51 -0
- package/studio-dist/server/assets/skills-MWYnWoKs.js +106 -0
- package/studio-dist/server/assets/spec-areas-DcnO6vW-.js +16 -0
- package/studio-dist/server/assets/specs-DE3w8hZP.js +155 -0
- package/studio-dist/server/assets/start-BW5ovN0k.js +33 -0
- package/studio-dist/server/assets/studio-BeltxxKt.js +216 -0
- package/studio-dist/server/assets/studio-queries-CLnP9kGu.js +3365 -0
- package/studio-dist/server/assets/utils-C9CX1kcy.js +221 -0
- package/studio-dist/server/assets/vault-BGulVoNh.js +70 -0
- package/studio-dist/server/assets/vault-CuyyhLyB.js +832 -0
- package/studio-dist/server/assets/views-Bd7cRr27.js +82 -0
- package/studio-dist/server/assets/warnings-BH05rOuG.js +15 -0
- package/studio-dist/server/assets/wasm-inline-CNeBKGwC.js +3 -0
- package/studio-dist/server/assets/workflow-BSuIKWqH.js +42 -0
- package/studio-dist/server/server.js +16220 -0
- package/src/cli/commands/studio/client-asset.ts +0 -16
- package/src/cli/commands/studio/views/client.ts +0 -44
- package/src/cli/commands/studio/views/companion-picker.tsx +0 -95
- package/src/cli/commands/studio/views/companion-selector.tsx +0 -94
- package/src/cli/commands/studio/views/dashboard/changes.tsx +0 -102
- package/src/cli/commands/studio/views/dashboard/index.tsx +0 -19
- package/src/cli/commands/studio/views/document.tsx +0 -910
- package/src/cli/commands/studio/views/error.tsx +0 -20
- package/src/cli/commands/studio/views/markdown.tsx +0 -250
- package/src/cli/commands/studio/views/palette.ts +0 -134
- package/src/cli/commands/studio/views/reports/index.tsx +0 -44
- package/src/cli/commands/studio/views/selection-fields.tsx +0 -14
- package/src/cli/commands/studio/views/skills/index.tsx +0 -68
- package/src/cli/commands/studio/views/specs/index.tsx +0 -149
- package/src/cli/commands/studio/views/studio-client/actions.ts +0 -51
- package/src/cli/commands/studio/views/studio-client/companion.ts +0 -13
- package/src/cli/commands/studio/views/studio-client/index.ts +0 -32
- package/src/cli/commands/studio/views/studio-client/keys.ts +0 -3
- package/src/cli/commands/studio/views/studio-client/main.ts +0 -3
- package/src/cli/commands/studio/views/studio-client/page.ts +0 -146
- package/src/cli/commands/studio/views/studio-client/panels.ts +0 -57
- package/src/cli/commands/studio/views/studio-client/reports.ts +0 -122
- package/src/cli/commands/studio/views/studio-client/theme.ts +0 -63
- package/src/cli/commands/studio/views/studio-client/vault-editor.ts +0 -166
- package/src/cli/commands/studio/views/studio-client/vault-pane.ts +0 -202
- package/src/cli/commands/studio/views/studio-client/vault-tree.ts +0 -258
- package/src/cli/commands/studio/views/studio-client.generated.ts +0 -2
- package/src/cli/commands/studio/views/styles.ts +0 -530
- package/src/cli/commands/studio/views/terminal.tsx +0 -484
- package/src/cli/commands/studio/views/vault/state.ts +0 -41
- package/src/cli/commands/studio/views/warnings.tsx +0 -21
- package/src/cli/commands/studio/views/workflow/delivery-path.tsx +0 -370
- package/src/cli/commands/studio/views/workflow/graph.ts +0 -220
- package/src/cli/commands/studio/views/workflow/index.tsx +0 -20
- package/src/cli/commands/studio/views/workflow/steps.ts +0 -278
- package/src/lib/components/theme.ts +0 -2
- package/src/tools/setup/git-utils.ts +0 -30
|
@@ -0,0 +1,778 @@
|
|
|
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 };
|