@uniqbit/mate-core 0.18.5 → 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/companion-instructions.mjs +9 -0
- package/claude-plugin/hooks/hooks.json +21 -2
- 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 +52 -15
- package/src/brand/art.generated.ts +69 -0
- package/src/brand/index.ts +12 -0
- package/src/brand/palette.ts +19 -0
- package/src/brand/svg.generated.ts +8 -0
- package/src/brand/terminal.ts +88 -0
- package/src/brand/types.ts +33 -0
- package/src/cli/commands/artifact/apply-context.ts +275 -0
- package/src/cli/commands/artifact/artifact.ts +12 -0
- package/src/cli/commands/artifact/delivery/archive.ts +125 -0
- package/src/cli/commands/artifact/delivery/branch-flags.ts +55 -0
- package/src/cli/commands/artifact/delivery/environment.ts +127 -0
- package/src/cli/commands/artifact/delivery/link.ts +174 -0
- package/src/cli/commands/artifact/delivery/output.ts +89 -0
- package/src/cli/commands/artifact/finish/command.ts +83 -8
- package/src/cli/commands/artifact/finish/engine.ts +91 -14
- package/src/cli/commands/artifact/finish/finisher.ts +10 -0
- package/src/cli/commands/artifact/finish/git.ts +132 -19
- package/src/cli/commands/artifact/finish/openspec.ts +182 -138
- package/src/cli/commands/artifact/finish/secret-scan.ts +43 -0
- package/src/cli/commands/artifact/finish/worktree-cleanup.ts +92 -0
- package/src/cli/commands/artifact/pending/command.ts +31 -3
- package/src/cli/commands/artifact/pending/discovery.ts +21 -57
- package/src/cli/commands/cap/graphify.ts +52 -3
- package/src/cli/commands/cap/index-cmd.ts +71 -15
- package/src/cli/commands/cap/openspec.ts +13 -25
- 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 +68 -46
- 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 +143 -48
- package/src/cli/commands/doctor.ts +195 -7
- 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/plugin/install.ts +9 -4
- package/src/cli/commands/plugin/plugin.ts +3 -2
- package/src/cli/commands/report/adapter.ts +11 -2
- package/src/cli/commands/report/contract.ts +21 -0
- package/src/cli/commands/report/highlight.ts +34 -4
- package/src/cli/commands/report/index.ts +20 -1
- package/src/cli/commands/report/markdown.ts +110 -0
- package/src/cli/commands/report/palette.ts +118 -0
- package/src/cli/commands/report/renderer.ts +456 -153
- package/src/cli/commands/report/types.ts +16 -0
- package/src/cli/commands/session/context.ts +102 -0
- package/src/cli/commands/setup.ts +50 -24
- package/src/cli/commands/studio/factory-credential.ts +49 -0
- package/src/cli/commands/studio/index.ts +29 -2
- package/src/cli/commands/studio/openspec-cli.ts +10 -58
- package/src/cli/commands/studio/payload.ts +249 -15
- package/src/cli/commands/studio/routes.ts +41 -6
- package/src/cli/commands/studio/selection.ts +161 -17
- package/src/cli/commands/studio/server.ts +404 -324
- 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/commands/wrap.ts +5 -13
- 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 +22 -1
- package/src/cli/parse-flags.ts +32 -6
- package/src/cli/repo-list-table.tsx +2 -0
- package/src/cli/setup-selector.tsx +86 -151
- package/src/cli/usage.ts +14 -0
- package/src/create-mate.ts +5 -4
- package/src/hooks/companion-instructions.ts +190 -0
- package/src/hooks/hook-io.ts +63 -0
- package/src/hooks/session-banner.ts +21 -29
- package/src/hooks/session-guidance.ts +9 -17
- package/src/hooks/session-prepare.ts +115 -28
- package/src/hooks/tokensave-route.ts +26 -0
- package/src/hooks/validate-artifact-path.ts +82 -24
- package/src/index.ts +4 -0
- package/src/lib/apply-context/fingerprint.ts +174 -0
- package/src/lib/apply-context/protocol.ts +193 -0
- package/src/lib/change-layout.ts +154 -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 +16 -12
- package/src/lib/context-mode-package.ts +24 -11
- package/src/lib/delivery/archive-change.ts +166 -0
- package/src/lib/delivery/branches.ts +132 -0
- package/src/lib/delivery/environment.ts +35 -0
- package/src/lib/delivery/forge.ts +279 -0
- package/src/lib/delivery/merge-git.ts +261 -0
- package/src/lib/delivery/overlap.ts +209 -0
- package/src/lib/delivery/record-delivery.ts +283 -0
- package/src/lib/delivery/record.ts +403 -0
- package/src/lib/delivery/refresh.ts +268 -0
- package/src/lib/delivery/repository-access.ts +141 -0
- package/src/lib/delivery/resolve-branch.ts +162 -0
- package/src/lib/delivery/stages.ts +111 -0
- package/src/lib/delivery/token.ts +24 -0
- 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/frontmatter.ts +18 -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/opencode-plugin-package.ts +5 -5
- package/src/lib/openspec-cli.ts +116 -0
- package/src/lib/openspec-scopes.ts +86 -0
- package/src/lib/orchestrator/adapters/base.ts +55 -22
- package/src/lib/orchestrator/adapters/claude-args.ts +50 -0
- package/src/lib/orchestrator/adapters/claude.ts +54 -41
- package/src/lib/orchestrator/adapters/opencode.ts +2 -0
- package/src/lib/orchestrator/config-store.ts +3 -2
- package/src/lib/orchestrator/editor.ts +31 -25
- package/src/lib/orchestrator/openspec-store.ts +14 -54
- package/src/lib/orchestrator/projection-claude-commands.ts +36 -0
- package/src/lib/orchestrator/projection-claude-links.ts +159 -0
- package/src/lib/orchestrator/projection-claude-skills.ts +19 -137
- package/src/lib/orchestrator/projection-entries.ts +100 -34
- 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-runtime-documents.ts +15 -6
- package/src/lib/orchestrator/projection-types.ts +36 -1
- package/src/lib/orchestrator/refresh-working-claude-links.ts +87 -0
- package/src/lib/orchestrator/session-context-link.ts +67 -0
- package/src/lib/orchestrator/session-prepare.ts +45 -5
- package/src/lib/orchestrator/setup-compatibilities.ts +56 -70
- package/src/lib/orchestrator/types.ts +7 -2
- package/src/lib/orchestrator/working-repo-projection.ts +50 -7
- package/src/lib/orchestrator/workspace-document.ts +105 -0
- package/src/lib/orchestrator/wrap-pass.ts +22 -1
- package/src/lib/package-paths.ts +37 -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 +109 -7
- package/src/opencode/companion-policy.ts +37 -18
- package/src/opencode/enter-worktree.ts +72 -0
- package/src/opencode/projected-guidance.ts +4 -1
- package/src/opencode/session-prepare.ts +2 -1
- package/src/opencode/tui.tsx +13 -6
- package/src/plugins.ts +1 -0
- package/src/runtime/artifact-refusal.ts +63 -0
- package/src/runtime/claude-delivery-plan.ts +107 -8
- package/src/runtime/commit-attribution-guard.ts +181 -0
- package/src/runtime/companion-git.ts +52 -10
- package/src/runtime/companion-guidance.ts +20 -8
- package/src/runtime/companion-instructions.ts +340 -0
- package/src/runtime/companion-lock.ts +30 -7
- package/src/runtime/env.ts +48 -3
- package/src/runtime/error-message.ts +4 -0
- package/src/runtime/git-layout.ts +219 -0
- package/src/runtime/index.ts +29 -0
- package/src/runtime/managed-block.ts +117 -0
- package/src/runtime/markdown-scan.ts +266 -0
- package/src/runtime/physical-path.ts +111 -0
- package/src/runtime/policy.ts +50 -2
- package/src/runtime/projected-flag.ts +7 -0
- package/src/runtime/projected-guidance.ts +1 -0
- package/src/runtime/runtime-directory.ts +5 -0
- package/src/runtime/runtime-document-manifest.ts +62 -11
- package/src/runtime/secret-guard.ts +162 -0
- package/src/runtime/secret-patterns.ts +397 -0
- package/src/runtime/secret-scan.ts +90 -0
- package/src/runtime/session-context.ts +98 -0
- package/src/runtime/session-kind.ts +13 -0
- package/src/runtime/shell-heredoc.ts +81 -0
- package/src/runtime/tokensave-route.ts +152 -0
- package/src/runtime/wrap-state.ts +44 -2
- package/src/runtime/write-atomic.ts +64 -0
- package/src/studio.ts +124 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +14 -10
- package/src/templates/capabilities/openspec-cap/mate-minimal/templates/spec.md +3 -5
- package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +18 -102
- package/src/templates/capabilities/openspec-cap/mate-v1/templates/spec.md +3 -5
- package/src/templates/capabilities/openspec-cap/openspec-conventions.yaml +20 -14
- package/src/templates/mate-skills/THIRD-PARTY-NOTICES.md +40 -0
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +134 -0
- 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 +200 -0
- package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +86 -0
- package/src/templates/mate-skills/{claude/mate-openspec-backfill → agents/mate-backfill-spec}/SKILL.md +11 -4
- package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +110 -0
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +66 -0
- package/src/templates/mate-skills/agents/mate-explore-change/references/openspec-explore.md +350 -0
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +11 -4
- 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 +12 -5
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +108 -0
- 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 +169 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md +103 -0
- package/src/templates/mate-skills/agents/{mate-artifact-publish → mate-publish-artifact}/SKILL.md +111 -24
- package/src/templates/mate-skills/{claude/mate-artifact-publish → agents/mate-publish-artifact}/references/openspec.md +8 -5
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +95 -16
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +87 -68
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +134 -0
- 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 +200 -0
- package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +86 -0
- package/src/templates/mate-skills/{agents/mate-openspec-backfill → claude/mate-backfill-spec}/SKILL.md +11 -4
- package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +110 -0
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +66 -0
- package/src/templates/mate-skills/claude/mate-explore-change/references/openspec-explore.md +350 -0
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +11 -4
- 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 +12 -5
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +108 -0
- 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 +169 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-update-change.md +103 -0
- package/src/templates/mate-skills/claude/{mate-artifact-publish → mate-publish-artifact}/SKILL.md +111 -24
- package/src/templates/mate-skills/{agents/mate-artifact-publish → claude/mate-publish-artifact}/references/openspec.md +8 -5
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +95 -16
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +87 -68
- package/src/templates/mate-skills/openspec-references.ts +142 -0
- package/src/templates/root/TEMPLATE_AGENTS.md +2 -2
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +3938 -391
- package/src/tools/setup/capabilities/companion-mentions.ts +27 -0
- package/src/tools/setup/capabilities/context-mode.ts +56 -7
- package/src/tools/setup/capabilities/graphify-gate.ts +31 -0
- package/src/tools/setup/capabilities/graphify-secrets.ts +243 -0
- package/src/tools/setup/capabilities/graphify.ts +46 -7
- package/src/tools/setup/capabilities/openspec.ts +163 -272
- 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 +113 -71
- package/src/tools/setup/context-services.ts +9 -17
- package/src/tools/setup/dynamic-plugins/install.ts +24 -28
- package/src/tools/setup/engine.ts +100 -23
- package/src/tools/setup/install-contract.ts +8 -0
- package/src/tools/setup/managed-output.ts +51 -0
- package/src/tools/setup/mate-skill-copies.ts +51 -0
- package/src/tools/setup/mate.ts +86 -11
- package/src/tools/setup/package-managers/uv.ts +73 -11
- package/src/tools/setup/plugin.ts +40 -0
- package/src/tools/setup/plugins/guidance.ts +7 -4
- package/src/tools/setup/providers/agent-file-sections.ts +4 -2
- package/src/tools/setup/providers/claude-attribution.ts +65 -0
- package/src/tools/setup/providers/claude-plugin-folders.ts +625 -0
- package/src/tools/setup/providers/claude-plugin-hooks.ts +51 -19
- package/src/tools/setup/providers/claude-worktree-plugins.ts +122 -0
- package/src/tools/setup/providers/claude.ts +290 -8
- package/src/tools/setup/providers/opencode.ts +180 -1
- package/src/tools/setup/utils.ts +18 -4
- 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 +183 -26
- 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/wrappers/bin/graphify +52 -4
- package/wrappers/bin/openspec +33 -9
- package/wrappers/lib/graphify-gate.mjs +8 -0
- package/src/cli/commands/studio/views/client.ts +0 -654
- 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 -107
- package/src/cli/commands/studio/views/dashboard/index.tsx +0 -19
- package/src/cli/commands/studio/views/document.tsx +0 -842
- package/src/cli/commands/studio/views/error.tsx +0 -20
- package/src/cli/commands/studio/views/reports/index.tsx +0 -49
- package/src/cli/commands/studio/views/selection-fields.tsx +0 -14
- package/src/cli/commands/studio/views/skills/index.tsx +0 -87
- package/src/cli/commands/studio/views/specs/index.tsx +0 -157
- package/src/cli/commands/studio/views/styles.ts +0 -519
- package/src/cli/commands/studio/views/terminal.tsx +0 -484
- package/src/cli/commands/studio/views/vault/state.ts +0 -43
- package/src/cli/commands/studio/views/warnings.tsx +0 -21
- package/src/cli/commands/studio/views/workflow/index.tsx +0 -21
- package/src/cli/commands/studio/views/workflow/steps.ts +0 -337
- package/src/cli/commands/studio/views/workflow/transcript.tsx +0 -190
- package/src/lib/components/theme.ts +0 -2
- package/src/tools/setup/git-utils.ts +0 -30
- package/src/tools/setup/runtime-documents.ts +0 -291
package/src/tools/setup.ts
CHANGED
|
@@ -18,16 +18,33 @@ import {
|
|
|
18
18
|
type CapabilityConfig,
|
|
19
19
|
type FrameworkConfig,
|
|
20
20
|
} from "../lib/orchestrator/types";
|
|
21
|
+
import { getClaudePluginRoot } from "../lib/package-paths";
|
|
22
|
+
import type { RenderedRuntimeDocuments } from "../runtime/runtime-document-manifest";
|
|
21
23
|
import {
|
|
22
24
|
collectManagedGitignoreEntries,
|
|
23
25
|
writeManagedGitignoreBlock,
|
|
24
26
|
} from "./setup/plugins/gitignore";
|
|
25
|
-
import
|
|
27
|
+
import { untrackSkillCopies } from "./setup/mate-skill-copies";
|
|
28
|
+
import { createManagedOutputCollector } from "./setup/managed-output";
|
|
29
|
+
import type {
|
|
30
|
+
ManagedOutputReport,
|
|
31
|
+
PluginRegistration,
|
|
32
|
+
SetupContext,
|
|
33
|
+
SetupScope,
|
|
34
|
+
} from "./setup/plugin";
|
|
35
|
+
import {
|
|
36
|
+
inspectClaudePluginFolders,
|
|
37
|
+
type ClaudePluginContributionFailure,
|
|
38
|
+
type ClaudePluginDirectoryReport,
|
|
39
|
+
type ClaudePluginFolders,
|
|
40
|
+
} from "./setup/providers/claude-plugin-folders";
|
|
26
41
|
import { getActiveDistribution } from "../distribution";
|
|
27
42
|
import { createUvPlugin } from "./setup/package-managers/uv";
|
|
28
43
|
import type { PackageManagerSetupDeps } from "./setup/package-managers/uv";
|
|
29
44
|
import { applyRequiredSelectionsToConfig } from "./setup/policy";
|
|
30
45
|
import { invalidateInstallState } from "../lib/install";
|
|
46
|
+
import type { StartupProgressController } from "../lib/components/startup-progress";
|
|
47
|
+
import { emitWarning } from "../lib/live-progress";
|
|
31
48
|
import {
|
|
32
49
|
describeUnknownAudience,
|
|
33
50
|
installPluginDeclarations,
|
|
@@ -38,10 +55,12 @@ import { hydrateDynamicPlugins } from "./setup/dynamic-plugins/hydrate";
|
|
|
38
55
|
import { installDeclaredPlugins } from "./setup/dynamic-plugins/install";
|
|
39
56
|
import {
|
|
40
57
|
buildSetupInstallationPlan,
|
|
58
|
+
collectRuntimeContributionInputs,
|
|
41
59
|
executeSetupInstallationPlan,
|
|
60
|
+
publishRuntimeClaudePluginMarketplaces,
|
|
42
61
|
renderRuntimeDocuments,
|
|
43
|
-
type RenderedRuntimeDocuments,
|
|
44
62
|
type SetupInstallationOutcome,
|
|
63
|
+
type SetupInstallationPlan,
|
|
45
64
|
} from "./setup/engine";
|
|
46
65
|
|
|
47
66
|
export interface SetupInput {
|
|
@@ -51,10 +70,30 @@ export interface SetupInput {
|
|
|
51
70
|
git?: "auto" | "default";
|
|
52
71
|
}
|
|
53
72
|
|
|
73
|
+
/** Reports setup's phases; `mate companion setup` passes its progress screen. */
|
|
74
|
+
export type SetupProgress = Pick<StartupProgressController, "step">;
|
|
75
|
+
|
|
76
|
+
const silentProgress: SetupProgress = {
|
|
77
|
+
async step(_id, _label, fn) {
|
|
78
|
+
return fn();
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
54
82
|
export interface SetupDependencies {
|
|
55
83
|
cwd?: string;
|
|
56
84
|
configStore?: ConfigStore;
|
|
57
85
|
globalConfigStore?: GlobalConfigStore;
|
|
86
|
+
progress?: SetupProgress;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface CompanionSyncOptions {
|
|
90
|
+
/** Regenerates OpenSpec CLI output; set only by `mate companion update`. */
|
|
91
|
+
regenerateOpenSpec?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface CompanionSyncOutcome extends SetupInstallationOutcome {
|
|
95
|
+
/** The managed output this pass wrote or removed. */
|
|
96
|
+
managedOutput: ManagedOutputReport;
|
|
58
97
|
}
|
|
59
98
|
|
|
60
99
|
export async function applySetupCompatibilities(
|
|
@@ -64,11 +103,23 @@ export async function applySetupCompatibilities(
|
|
|
64
103
|
plugins: PluginRegistration[] = getActiveDistribution().registry.getEntries(),
|
|
65
104
|
repoPath?: string,
|
|
66
105
|
scope: SetupScope = config.type === "hub" ? "hub" : "companion",
|
|
67
|
-
|
|
106
|
+
options: CompanionSyncOptions = {},
|
|
107
|
+
): Promise<CompanionSyncOutcome> {
|
|
68
108
|
const plan = buildSetupInstallationPlan(config, plugins);
|
|
69
109
|
const activeProviders = plan.activeProviders;
|
|
70
|
-
const
|
|
71
|
-
|
|
110
|
+
const managedOutput = createManagedOutputCollector(companionPath);
|
|
111
|
+
const ctx: SetupContext = {
|
|
112
|
+
companionPath,
|
|
113
|
+
config,
|
|
114
|
+
mode,
|
|
115
|
+
activeProviders,
|
|
116
|
+
repoPath,
|
|
117
|
+
scope,
|
|
118
|
+
...(options.regenerateOpenSpec ? { regenerateOpenSpec: true } : {}),
|
|
119
|
+
managedOutput: managedOutput.recorder,
|
|
120
|
+
};
|
|
121
|
+
const outcome = await executeSetupInstallationPlan(ctx, plugins, plan);
|
|
122
|
+
return { ...outcome, managedOutput: managedOutput.report() };
|
|
72
123
|
}
|
|
73
124
|
|
|
74
125
|
/**
|
|
@@ -82,40 +133,133 @@ export async function renderWorkingRuntimeDocuments(
|
|
|
82
133
|
repoPath: string,
|
|
83
134
|
plugins: PluginRegistration[] = getActiveDistribution().registry.getAll(),
|
|
84
135
|
): Promise<RenderedRuntimeDocuments> {
|
|
136
|
+
const { plan, ctx } = planSyncPass(companionPath, config, plugins, {
|
|
137
|
+
repoPath,
|
|
138
|
+
target: "working",
|
|
139
|
+
});
|
|
140
|
+
return renderRuntimeDocuments(ctx, plugins, plan);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Publishes the enabled Claude plugin folders for a Working Repository's wrap
|
|
145
|
+
* pass, before it renders; see {@link publishRuntimeClaudePluginMarketplaces}.
|
|
146
|
+
*/
|
|
147
|
+
export async function publishWorkingClaudePluginMarketplaces(
|
|
148
|
+
companionPath: string,
|
|
149
|
+
config: FrameworkConfig,
|
|
150
|
+
repoPath: string,
|
|
151
|
+
plugins: PluginRegistration[] = getActiveDistribution().registry.getAll(),
|
|
152
|
+
): Promise<ClaudePluginFolders> {
|
|
153
|
+
const { plan, ctx } = planSyncPass(companionPath, config, plugins, {
|
|
154
|
+
repoPath,
|
|
155
|
+
target: "working",
|
|
156
|
+
});
|
|
157
|
+
return publishRuntimeClaudePluginMarketplaces(ctx, plugins, plan);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** A sync pass's plan and context, for a caller that runs no plugin phase. */
|
|
161
|
+
function planSyncPass(
|
|
162
|
+
companionPath: string,
|
|
163
|
+
config: FrameworkConfig,
|
|
164
|
+
plugins: PluginRegistration[],
|
|
165
|
+
extra: Pick<SetupContext, "repoPath" | "target"> = {},
|
|
166
|
+
): { plan: SetupInstallationPlan; ctx: SetupContext } {
|
|
85
167
|
const plan = buildSetupInstallationPlan(config, plugins);
|
|
86
168
|
const ctx: SetupContext = {
|
|
87
169
|
companionPath,
|
|
88
170
|
config,
|
|
89
171
|
mode: "sync",
|
|
90
172
|
activeProviders: plan.activeProviders,
|
|
91
|
-
|
|
92
|
-
target: "working",
|
|
173
|
+
...extra,
|
|
93
174
|
};
|
|
94
|
-
return
|
|
175
|
+
return { plan, ctx };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** What an operator sees of the enabled Capabilities' Claude plugin folders. */
|
|
179
|
+
export interface ClaudePluginDirectoryInspection {
|
|
180
|
+
plugins: ClaudePluginDirectoryReport[];
|
|
181
|
+
/** Capabilities whose contributions rejected; the other Capabilities are still listed. */
|
|
182
|
+
failures: ClaudePluginContributionFailure[];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Enabled Capabilities' declared Claude plugin folders and whether `mate claude`
|
|
187
|
+
* passes each, checked against the running install's bundled plugin. Read-only:
|
|
188
|
+
* runs no plugin phase and reconciles nothing.
|
|
189
|
+
*/
|
|
190
|
+
export async function inspectClaudePluginDirectories(
|
|
191
|
+
companionPath: string,
|
|
192
|
+
config: FrameworkConfig,
|
|
193
|
+
plugins: PluginRegistration[] = getActiveDistribution().registry.getEntries(),
|
|
194
|
+
): Promise<ClaudePluginDirectoryInspection> {
|
|
195
|
+
const { plan, ctx } = planSyncPass(companionPath, config, plugins);
|
|
196
|
+
const failures: ClaudePluginContributionFailure[] = [];
|
|
197
|
+
const inputs = await collectRuntimeContributionInputs(ctx, plugins, plan, (capability, error) =>
|
|
198
|
+
failures.push({
|
|
199
|
+
capability,
|
|
200
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
201
|
+
}),
|
|
202
|
+
);
|
|
203
|
+
return {
|
|
204
|
+
plugins: [
|
|
205
|
+
...(
|
|
206
|
+
await inspectClaudePluginFolders(inputs.get("claude") ?? [], {
|
|
207
|
+
bundledPluginRoot: getClaudePluginRoot(),
|
|
208
|
+
})
|
|
209
|
+
).report,
|
|
210
|
+
],
|
|
211
|
+
failures,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function managedGitignoreEntries(companionPath: string, config: FrameworkConfig): string[] {
|
|
216
|
+
const ctx: SetupContext = { companionPath, config, mode: "sync", activeProviders: [] };
|
|
217
|
+
return collectManagedGitignoreEntries(ctx, getActiveDistribution().registry.getAll());
|
|
95
218
|
}
|
|
96
219
|
|
|
97
220
|
export async function updateProjectGitignore(
|
|
98
221
|
companionPath: string,
|
|
99
222
|
config: FrameworkConfig,
|
|
100
223
|
): Promise<void> {
|
|
101
|
-
const
|
|
102
|
-
const plugins = getActiveDistribution().registry.getAll();
|
|
103
|
-
const entries = collectManagedGitignoreEntries(ctx, plugins);
|
|
224
|
+
const entries = managedGitignoreEntries(companionPath, config);
|
|
104
225
|
await writeManagedGitignoreBlock(path.join(companionPath, ".gitignore"), FRAMEWORK_NAME, entries);
|
|
105
226
|
}
|
|
106
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Stops tracking the Mate skill copies the managed `.gitignore` block lists; the
|
|
230
|
+
* files stay on disk. Only setup and `mate companion update` call it, never a
|
|
231
|
+
* launch or prepare. Returns the paths removed from the index.
|
|
232
|
+
*/
|
|
233
|
+
export async function untrackManagedSkillCopies(
|
|
234
|
+
companionPath: string,
|
|
235
|
+
config: FrameworkConfig,
|
|
236
|
+
): Promise<string[]> {
|
|
237
|
+
return untrackSkillCopies(companionPath, managedGitignoreEntries(companionPath, config));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface CompanionSyncResult {
|
|
241
|
+
/** For a launch to pass and report; every other caller ignores them. */
|
|
242
|
+
claudePluginFolders: ClaudePluginFolders;
|
|
243
|
+
/** For `mate companion update` to sort changed paths; a launch ignores it. */
|
|
244
|
+
managedOutput: ManagedOutputReport;
|
|
245
|
+
}
|
|
246
|
+
|
|
107
247
|
export async function syncCompanionFiles(
|
|
108
248
|
companionPath: string,
|
|
109
249
|
config: FrameworkConfig,
|
|
110
250
|
repoPath?: string,
|
|
111
|
-
|
|
112
|
-
|
|
251
|
+
options: CompanionSyncOptions = {},
|
|
252
|
+
): Promise<CompanionSyncResult> {
|
|
253
|
+
const outcome = await applySetupCompatibilities(
|
|
113
254
|
companionPath,
|
|
114
255
|
config,
|
|
115
256
|
"sync",
|
|
116
257
|
getActiveDistribution().registry.getAll(),
|
|
117
258
|
repoPath,
|
|
259
|
+
undefined,
|
|
260
|
+
options,
|
|
118
261
|
);
|
|
262
|
+
return { claudePluginFolders: outcome.claudePluginFolders, managedOutput: outcome.managedOutput };
|
|
119
263
|
}
|
|
120
264
|
|
|
121
265
|
export const setupToolDeps = {
|
|
@@ -167,27 +311,40 @@ export async function executeSetup(
|
|
|
167
311
|
await configStore.save(config);
|
|
168
312
|
|
|
169
313
|
const companionPath = path.resolve(cwd);
|
|
314
|
+
const progress = deps.progress ?? silentProgress;
|
|
170
315
|
// Declared plugin packages install and hydrate before the setup plan runs,
|
|
171
316
|
// so a fresh clone reaches a fully applied state from one setup run
|
|
172
317
|
// (install → load → plan).
|
|
173
318
|
const declarations = installPluginDeclarations(config);
|
|
174
319
|
if (declarations.length) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
320
|
+
await progress.step("plugins", "Installing plugins", async () => {
|
|
321
|
+
for (const result of await installDeclaredPlugins(companionPath, declarations)) {
|
|
322
|
+
if (result.status === "failed") {
|
|
323
|
+
emitWarning(
|
|
324
|
+
`${FRAMEWORK_NAME}: plugin "${result.package}" failed to install: ${result.error ?? "unknown error"}`,
|
|
325
|
+
);
|
|
326
|
+
}
|
|
180
327
|
}
|
|
181
|
-
|
|
182
|
-
|
|
328
|
+
await hydrateDynamicPlugins({ companionPath });
|
|
329
|
+
});
|
|
183
330
|
}
|
|
184
|
-
await
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
331
|
+
await progress.step("capabilities", "Applying capabilities", () =>
|
|
332
|
+
applySetupCompatibilities(companionPath, config, "setup"),
|
|
333
|
+
);
|
|
334
|
+
await progress.step("register", "Registering companion", async () => {
|
|
335
|
+
const untracked = await untrackManagedSkillCopies(companionPath, config);
|
|
336
|
+
if (untracked.length > 0) {
|
|
337
|
+
emitWarning(
|
|
338
|
+
`${FRAMEWORK_NAME}: ${untracked.length} Mate skill copies are staged as deletions; the files stay on disk. Commit them with .gitignore.`,
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
await invalidateInstallState({
|
|
342
|
+
kind: config.type === "hub" ? "hub" : "companion",
|
|
343
|
+
companionPath,
|
|
344
|
+
});
|
|
189
345
|
|
|
190
|
-
|
|
346
|
+
await globalConfigStore.register(companionPath);
|
|
347
|
+
});
|
|
191
348
|
|
|
192
349
|
// Setup no longer fans out to linked repos: capabilities that touch a working repo
|
|
193
350
|
// (companion files on launch, the tokensave/graphify graph via `mate cap index`)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./queries-CN3JwMBX.js";import{Et as t,o as n}from"./studio-queries-rvbJupCy.js";var r=t();function i({companionPath:e,reason:t}){return(0,r.jsxs)(`section`,{className:`panel error`,children:[(0,r.jsx)(`h3`,{children:`Could not read this companion`}),(0,r.jsx)(`p`,{className:`mono`,children:e}),(0,r.jsx)(`p`,{children:t})]})}function a({view:t,search:a,children:o}){let{data:s}=e(n(t,a));return s.error?(0,r.jsx)(i,{companionPath:s.error.companionPath,reason:s.error.reason}):(0,r.jsx)(r.Fragment,{children:o(s)})}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{D as t,E as n,Et as r,I as i,T as a,qt as o,z as s}from"./studio-queries-rvbJupCy.js";var c=[`mate-clarify-intent`,`mate-interview-me`,`mate-grill-me`],l={"mate-clarify-intent":`Default. Reads what the request already states and routes to an interview, grilling, or skip, then runs that one mode.`,"mate-interview-me":`Explicit mode: guided, one-question-at-a-time clarification when intent, constraints, or scope still need confirmation.`,"mate-grill-me":`Explicit mode: round-based stress test of a mostly known direction to surface hidden assumptions and risks.`},u={"clarify-intent":{what:`Settles who the change is for, why it is needed, how success is measured, and what binds it, before any artifact exists.`,why:`Intent gaps are cheapest to close before exploration turns them into documents.`},explore:{what:`Resolves repository evidence, unknowns, and options, with scope taken from the companion context map, and suggests slicing a large feature.`,why:`It separates uncertainty from the proposal's committed scope.`},propose:{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.`,why:`One prompt writes every artifact; each one is then reviewed on its own.`},apply:{what:`Records the delivery branch, avoiding protected branches, then implements the reviewed tasks.`,why:`The recorded branch is what archive and publication later wait on.`},"inspect-outcome":{what:`Shows what the applied change did as a rendered diagram and diff in a Mate report.`,why:`Seeing the result tells the reviewer whether cleanup is warranted.`},"refine-code":{what:`Looks for smaller, clearer code once tests pass, preserving behavior.`,why:`Cleanup lands before archive, so shipped code and recorded specs agree.`},archive:{what:`Applies the delta specs to the local canonical specs and records the delivery; allowed before the branch merges.`,why:`A feature's later changes build on canonical specs that already include this one.`},publish:{what:`Commits, tags, and pushes archived changes whose delivery branches are merged, chosen by the developer.`,why:`Published canonical specs then describe the default branch; unmerged archives wait.`}};function d(e,t,n){return{what:(t?.schemaName===n?t.artifacts.find(t=>t.id===e)?.description:void 0)??`A person reviews the ${e} artifact.`,why:`Reviews stay with people: Mate never marks them approved.`}}function f(e,t){if(e.kind===`human`)return null;if(e.id===`clarify-intent`)return`/${e.skill} about ${s}`;let n=e.id===`propose`&&t!==`mate-v1`?` (use schema: ${t})`:``;return`/${e.skill}${n} for ${i}`}function p(e){return e&&e.replace(` ${i}`,``).replace(` ${s}`,``)}function m(e){return c.filter(e).map(e=>({name:e,description:l[e],prompt:`/${e} about ${s}`,copyPrompt:`/${e} about`}))}var h=new Set([`explore`,`propose`,`apply`,`archive`]);function g(e){if(e.kind===`human`)return[`human-review`];let t=e.optional?[`optional`,`skill`]:[`skill`];return h.has(e.id)&&t.push(`openspec`),t}var _={"mate-v1":{tagline:`full planning`,description:`Full planning path: proposal, specs, design, and tasks.`},"mate-minimal":{tagline:`minimal planning`,description:`Short path: specs and tasks only, for one-Area, low-risk changes with clear intent.`}};function v(e){return t(e)?_[e]:{tagline:`custom schema`,description:`Planning path of the ${e} schema.`}}var y={plan:`Plan`,review:`Review`,build:`Build`,ship:`Ship`};function b(e,t){return e.kind===`human`?`review`:e.id===`apply`||t===`build`&&e.optional?`build`:t===void 0||t===`plan`?`plan`:`ship`}function x(e){return e.kind===`human`?`human`:e.optional?`optional`:null}function S(e){let t=[];for(let n of e){let e=x(n),r=t.at(-1);e&&r?.group===e?r.steps.push(n):t.push({group:e,steps:[n]})}return t.map(e=>e.group===`human`||e.group===`optional`&&e.steps.length>1?{kind:`group`,group:e.group,steps:e.steps}:{kind:`stage`,step:e.steps[0]})}function C(e,t,r){let i=r.skills?new Set(r.skills):null,a=e=>!i||i.has(e),o=n(t),s=[];for(let t of o.stages){let n=t.kind===`human`?d(t.artifact,r.topology,e):u[t.id],i=f(t,e),o=s.at(-1),c={...t,what:n.what,why:n.why,badges:g(t),prompt:i,copyPrompt:p(i),phase:b(t,o?.phase)};t.id===`clarify-intent`&&(c.alternatives=m(a)),t.kind===`skill`&&!a(t.skill)&&(c.missingSkill=t.skill),t.id===`apply`&&(c.sessionBreakBefore=!0),s.push(c)}return{schema:e,label:e,...v(e),steps:s,map:S(s),reviewsKnown:o.reviewsKnown}}function w(e,n){return n?.schemaName===e?n.artifacts.map(e=>e.id):t(e)?a[e]:void 0}function T(e={}){let n=e.topology?.schemaName;return{paths:(n&&!t(n)?[n]:Object.keys(a)).map(t=>C(t,w(t,e.topology),e))}}var E=e=>({id:e.id,kind:`stage`,step:e});function ee(e){let t=e.map.map(e=>e.kind===`stage`?{nodes:[E(e.step)],optional:e.step.optional,phase:e.step.phase}:e.group===`human`?{nodes:[{id:`reviews`,kind:`review-group`,steps:e.steps}],optional:!1,phase:e.steps[0].phase}:{nodes:e.steps.map(E),optional:!0,phase:e.steps[0].phase});return t.unshift({nodes:[{id:`start`,kind:`start`}],optional:!1,phase:t[0]?.phase??`plan`}),t}function te(e){return e.kind===`stage`?!!e.step.sessionBreakBefore:e.kind===`review-group`&&!!e.steps[0].sessionBreakBefore}function D(e){let t=[],n=(e,n,r)=>{for(let i of e)for(let e of n)t.push({from:i.id,to:e.id,kind:r,newSession:te(e)})};return e.forEach((t,r)=>{let i=e[r+1];i&&n(t.nodes,i.nodes,`flow`);let a=e[r-1];t.optional&&a&&i&&n(a.nodes,i.nodes,`bypass`)}),t}function O(e){let t=[];return e.forEach((e,n)=>{let r=t.at(-1);r?.phase===e.phase?r.to=n+1:t.push({phase:e.phase,label:y[e.phase],from:n,to:n+1})}),t}function k(e){let t=e.findIndex(e=>e.nodes.some(e=>e.id===`archive`));return t===-1?null:{from:0,to:t+1}}function A(e){let t=ee(e),n=Math.max(1,...t.map(e=>e.nodes.length)),r=t.flatMap((e,t)=>e.nodes.map((r,i)=>e.nodes.length===1?{...r,column:t,row:0,rowSpan:n}:{...r,column:t,row:i,rowSpan:1}));return{columns:t.length,rows:n,nodes:r,edges:D(t),bands:O(t),cycle:k(t)}}var j=e=>e.rows*2+1;function M(e){return{along:e.column+.5,across:e.row*2+e.rowSpan}}var N=e=>Math.round(e*1e4)/1e4,P=(e,t)=>`${N(e/t*100)}%`,F=({along:e,across:t})=>`${N(t)} ${N(e)}`;function I(e,t){let n=t=>{let n=e.nodes.find(e=>e.id===t);if(!n)throw Error(`Unknown graph node: ${t}`);return M(n)};return[n(t.from),n(t.to)]}function L(e,t){let[n,r]=I(e,t);if(t.kind===`bypass`){let t=j(e);return`M ${F(n)} C ${F({along:n.along,across:t})}, ${F({along:r.along,across:t})}, ${F(r)}`}let i=(n.along+r.along)/2;return`M ${F(n)} C ${F({along:i,across:n.across})}, ${F({along:i,across:r.across})}, ${F(r)}`}function R(e,t){let[n,r]=I(e,t),i=(n.along+r.along)/2;return t.kind===`bypass`?{along:i,across:(n.across+r.across)/8+j(e)*3/4}:{along:i,across:(n.across+r.across)/2}}function z(e,t){return{x:P(t.across,j(e)),y:P(t.along,e.columns)}}function B(e,t){return{top:P(t.from,e.columns),height:P(t.to-t.from,e.columns)}}var V=e(o(),1),H=r();function ne({payload:e}){let t=T({skills:e.skills&&e.skills.length>0?e.skills:void 0,topology:e.topology}),[n,r]=(0,V.useState)(t.paths[0]?.schema);return(0,H.jsx)(`section`,{className:`workflow-delivery-path`,"aria-label":`Delivery Path`,children:t.paths.length>1?(0,H.jsxs)(`div`,{className:`workflow-schema`,"data-workflow-schema-root":!0,children:[(0,H.jsxs)(`label`,{className:`view-choice`,children:[(0,H.jsx)(`span`,{children:`OpenSpec schema`}),(0,H.jsx)(`select`,{"data-workflow-schema-select":!0,value:n,onChange:e=>r(e.target.value),children:t.paths.map(e=>(0,H.jsxs)(`option`,{value:e.schema,children:[e.label,` – `,e.tagline]},e.schema))})]}),(0,H.jsx)(`div`,{className:`workflow-schema-panels`,children:t.paths.map(e=>(0,H.jsx)(`section`,{"data-workflow-schema-panel":e.schema,"data-active":e.schema===n?`true`:`false`,children:(0,H.jsx)(U,{path:e})},e.schema))})]}):(0,H.jsxs)(`div`,{className:`workflow-schema`,children:[(0,H.jsxs)(`p`,{className:`view-choice`,children:[(0,H.jsx)(`span`,{children:`OpenSpec schema`}),(0,H.jsxs)(`code`,{children:[t.paths[0].label,` – `,t.paths[0].tagline]})]}),(0,H.jsx)(U,{path:t.paths[0]})]})})}function U({path:e}){return(0,H.jsxs)(`div`,{className:`workflow-path`,children:[(0,H.jsxs)(`div`,{className:`workflow-path-graph`,children:[(0,H.jsx)(J,{path:e}),(0,H.jsx)(Y,{})]}),(0,H.jsxs)(`aside`,{className:`workflow-detail`,"aria-label":`${e.label} stage details`,children:[(0,H.jsxs)(`div`,{className:`workflow-detail-overview`,id:G(e),children:[(0,H.jsx)(`p`,{className:`workflow-description`,children:e.description}),e.reviewsKnown?null:(0,H.jsx)(`p`,{className:`workflow-description`,children:`The schema's artifacts could not be read, so its review stages are unknown.`}),(0,H.jsx)(`p`,{className:`workflow-description`,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.`}),(0,H.jsx)(`p`,{className:`workflow-detail-hint`,children:`Select a node in the graph to see what that stage does and the prompt that runs it.`})]}),e.steps.map(t=>(0,H.jsx)(re,{path:e,step:t},t.id))]})]})}var W=(e,t)=>`workflow-${e.schema}-${t.id}`,G=e=>`workflow-${e.schema}-overview`;function K(e,t){if(!t)return()=>void 0;let n=q(e,t.current);return e=>e.column<n?`done`:e.id===t.current?`current`:`next`}function q(e,t){let n=e.nodes.find(e=>e.id===t);return n?n.column:t===`complete`?e.columns:-1}function J({path:e,progress:t,label:n=`Delivery Path map`}){let r=A(e),i=K(r,t);return(0,H.jsxs)(`nav`,{className:`workflow-graph`,"aria-label":n,"data-progress-activity":t?.activity,style:{"--graph-columns":String(r.columns),"--graph-rows":String(r.rows)},children:[(0,H.jsxs)(`div`,{className:`workflow-graph-bands`,"aria-hidden":`true`,children:[r.bands.map(e=>(0,H.jsx)(`div`,{className:`workflow-graph-band`,"data-band":e.phase,style:B(r,e),children:e.label},e.phase)),r.cycle?(0,H.jsx)(`div`,{className:`workflow-graph-cycle`,style:B(r,r.cycle),children:(0,H.jsx)(`span`,{children:`repeats for each change`})}):null,(0,H.jsx)(`div`,{className:`workflow-graph-workset`,children:(0,H.jsx)(`span`,{children:`workset`})})]}),(0,H.jsx)(Z,{graph:r,stateOf:i}),(0,H.jsx)(`ol`,{className:`workflow-graph-nodes`,children:r.nodes.map(n=>n.kind===`start`?null:(0,H.jsx)(`li`,{className:`workflow-graph-node`,"data-node-kind":n.kind,"data-progress":i(n),"aria-current":i(n)===`current`?`step`:void 0,style:{"--graph-row":String(n.column+1),"--graph-lane":String(n.row+1),"--graph-span":String(n.rowSpan)},children:n.kind===`stage`?(0,H.jsx)(Q,{path:e,step:n.step,box:!0,plain:!!t,children:(0,H.jsx)(X,{progress:t,state:i(n)})}):(0,H.jsxs)(`div`,{className:`workflow-graph-box workflow-graph-group`,"data-map-group":`human`,children:[(0,H.jsx)(`span`,{className:`workflow-graph-group-label`,children:`Human review`}),(0,H.jsx)(`ol`,{children:n.steps.map(n=>(0,H.jsx)(`li`,{children:(0,H.jsx)(Q,{path:e,step:n,plain:!!t})},n.id))}),(0,H.jsx)(X,{progress:t,state:i(n)})]})},n.id))})]})}function Y(){return(0,H.jsxs)(`ul`,{className:`workflow-graph-legend`,"aria-hidden":`true`,children:[(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`i`,{className:`workflow-legend-optional`}),`optional`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`i`,{className:`workflow-graph-openspec`}),`OpenSpec`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`i`,{className:`workflow-legend-session`}),`new session`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`i`,{className:`workflow-legend-skip`}),`can be skipped`]})]})}function X({progress:e,state:t}){return t===`done`?(0,H.jsx)(`span`,{className:`visually-hidden`,children:`, done`}):t!==`current`||!e?.note?null:(0,H.jsx)(`span`,{className:`workflow-graph-note`,children:e.note})}function Z({graph:e,stateOf:t}){let n=n=>{let r=e.nodes.find(e=>e.id===n.to),i=r?t(r):void 0;return n.kind===`flow`&&(i===`done`||i===`current`)};return(0,H.jsxs)(`svg`,{className:`workflow-graph-layer`,"aria-hidden":`true`,focusable:`false`,children:[(0,H.jsx)(`svg`,{viewBox:`0 0 ${j(e)} ${e.columns}`,preserveAspectRatio:`none`,overflow:`visible`,children:e.edges.map(t=>(0,H.jsx)(`path`,{className:`workflow-graph-edge`,d:L(e,t),"data-edge-kind":t.kind,"data-edge-from":t.from,"data-edge-to":t.to,"data-new-session":t.newSession?`true`:void 0,"data-travelled":n(t)?`true`:void 0},`${t.kind}-${t.from}-${t.to}`))}),e.nodes.map(t=>{if(t.kind!==`start`)return null;let{x:n,y:r}=z(e,M(t));return(0,H.jsx)(`circle`,{className:`workflow-graph-start`,cx:n,cy:r,r:`3.5`},t.id)}),e.edges.map(t=>{if(!t.newSession)return null;let{x:n,y:r}=z(e,R(e,t));return(0,H.jsx)(`circle`,{className:`workflow-graph-session`,"data-session-mark":t.to,cx:n,cy:r,r:`3.5`},`${t.from}-${t.to}`)})]})}function Q({path:e,step:t,box:n,plain:r,children:i}){return(0,H.jsxs)(r?`span`:`a`,{className:n?`workflow-graph-link workflow-graph-box`:`workflow-graph-link`,href:r?void 0:`#${W(e,t)}`,"data-map-stage":t.id,"data-stage-kind":t.kind,"data-optional":t.optional?`true`:void 0,"aria-label":t.kind===`human`?t.label:void 0,children:[t.badges.includes(`openspec`)?(0,H.jsx)(`span`,{className:`workflow-graph-openspec`,"aria-hidden":`true`}):null,t.kind===`human`?t.artifact:t.label,i]})}function re({path:e,step:t}){return(0,H.jsxs)(`article`,{className:`workflow-card`,id:W(e,t),"data-stage":t.id,"data-stage-kind":t.kind,"data-optional":t.optional?`true`:void 0,children:[(0,H.jsxs)(`header`,{className:`workflow-card-header`,children:[(0,H.jsxs)(`div`,{className:`workflow-card-heading`,children:[(0,H.jsx)(`h3`,{children:t.label}),(0,H.jsx)(se,{badges:oe(t)})]}),(0,H.jsxs)(`p`,{className:`workflow-card-meta`,children:[(0,H.jsx)(`span`,{children:y[t.phase]}),t.skill?(0,H.jsx)(`code`,{children:t.skill}):null,t.sessionBreakBefore?(0,H.jsx)(`span`,{className:`workflow-card-session`,children:`New session / clean chat`}):null]})]}),(0,H.jsx)(ie,{step:t}),t.missingSkill?(0,H.jsxs)(`p`,{className:`workflow-missing-skill`,role:`note`,children:[`Skill not reported for this companion: `,(0,H.jsx)(`code`,{children:t.missingSkill}),`. Run`,` `,(0,H.jsx)(`code`,{children:`mate companion update`}),`; this stage is not complete.`]}):null,(0,H.jsxs)(`dl`,{className:`workflow-card-explanation`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`What`}),(0,H.jsx)(`dd`,{children:t.what})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Why`}),(0,H.jsx)(`dd`,{children:t.why})]})]}),(0,H.jsx)(`footer`,{className:`workflow-card-footer`,children:(0,H.jsx)(`a`,{href:`#${G(e)}`,children:`Path overview`})})]})}function ie({step:e}){return e.kind===`human`?(0,H.jsxs)(`p`,{className:`workflow-card-human`,children:[`Review `,e.artifact,` yourself — no skill, no prompt`]}):e.alternatives?.length?(0,H.jsx)(ae,{step:e}):e.prompt?(0,H.jsxs)(`div`,{className:`workflow-command`,children:[(0,H.jsx)(`span`,{className:`workflow-command-label`,children:`Run`}),(0,H.jsx)(`code`,{children:e.prompt}),(0,H.jsx)($,{text:e.copyPrompt??e.prompt,label:`${e.label} prompt`})]}):null}function ae({step:e}){return e.alternatives?.length?(0,H.jsx)(`div`,{className:`workflow-option-list`,children:e.alternatives.map(e=>(0,H.jsxs)(`div`,{className:`workflow-option`,children:[(0,H.jsxs)(`div`,{className:`workflow-command`,children:[(0,H.jsx)(`span`,{className:`workflow-command-label`,children:`Option`}),(0,H.jsx)(`code`,{children:e.prompt}),(0,H.jsx)($,{text:e.copyPrompt,label:`${e.name} prompt`})]}),(0,H.jsx)(`small`,{children:e.description})]},e.name))}):null}function $({text:e,label:t}){return(0,H.jsx)(`button`,{type:`button`,className:`runway-step-copy`,"data-copy":e,"data-copy-label":t,children:`Copy`})}var oe=e=>e.badges.filter(e=>e!==`skill`);function se({badges:e}){return(0,H.jsx)(`span`,{className:`workflow-badges`,children:e.map(e=>(0,H.jsx)(`em`,{className:`runway-step-badge runway-step-badge-${e}`,children:e===`human-review`?`Human review`:e},e))})}export{J as n,T as r,ne as t};
|