@uniqbit/mate-core 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
- package/claude-capability-plugins/companion-mentions/hooks/register.ts +1 -1
- package/claude-plugin/hooks/hooks.json +10 -1
- package/claude-plugin/hooks/rtk-worktree-git.mjs +58 -0
- package/opencode-plugin/src/server.ts +9 -2
- package/package.json +2 -1
- package/src/cli/commands/artifact/delivery/environment.ts +28 -8
- package/src/cli/commands/artifact/delivery/link.ts +28 -9
- package/src/cli/commands/artifact/delivery/output.ts +7 -0
- package/src/cli/commands/companion/update.ts +2 -19
- package/src/cli/commands/factory/factory.ts +11 -1
- package/src/cli/commands/install.ts +47 -36
- package/src/cli/commands/launch/claude.ts +2 -0
- package/src/cli/commands/launch/shared.ts +33 -6
- package/src/cli/commands/plugin/install.ts +27 -11
- package/src/cli/commands/report/index.ts +180 -184
- package/src/cli/commands/report/markdown.ts +67 -72
- package/src/cli/commands/shared/companion-selection.ts +3 -1
- package/src/cli/commands/studio/access.ts +6 -14
- package/src/cli/commands/studio/areas.ts +112 -33
- package/src/cli/commands/studio/companion-add.ts +87 -0
- package/src/cli/commands/studio/companion-removal.ts +15 -8
- package/src/cli/commands/studio/factory-credential.ts +1 -15
- package/src/cli/commands/studio/factory-git-tokens.ts +40 -0
- package/src/cli/commands/studio/factory-relay.ts +18 -0
- package/src/cli/commands/studio/graph-model.ts +61 -0
- package/src/cli/commands/studio/graph.ts +336 -0
- package/src/cli/commands/studio/index.ts +4 -4
- package/src/cli/commands/studio/payload.ts +42 -15
- package/src/cli/commands/studio/repository-add.ts +116 -0
- package/src/cli/commands/studio/routes.ts +6 -0
- package/src/cli/commands/studio/selection.ts +12 -3
- package/src/cli/commands/studio/server.ts +127 -5
- package/src/cli/commands/studio/services.ts +40 -0
- package/src/cli/commands/studio/terminal.ts +45 -3
- package/src/cli/commands/studio/views/vault/markdown-tree.ts +84 -3
- package/src/cli/commands/studio/workset-session.ts +47 -14
- package/src/cli/commands/unwrap.ts +3 -0
- package/src/cli/commands/update.ts +2 -0
- package/src/cli/commands/vscode/release-vsix.json +4 -0
- package/src/cli/commands/vscode/setup.ts +71 -13
- package/src/cli/commands/vscode/vsix.ts +48 -7
- package/src/cli/commands/working/cleanup.ts +40 -8
- package/src/cli/commands/working/worktree.ts +176 -35
- package/src/cli/main.ts +17 -2
- package/src/cli/usage.ts +1 -1
- package/src/hooks/rtk-worktree-git.ts +48 -0
- package/src/hooks/validate-artifact-path.ts +38 -7
- package/src/lib/delivery/branch-template.ts +122 -0
- package/src/lib/delivery/branches.ts +21 -16
- package/src/lib/delivery/checkout.ts +102 -0
- package/src/lib/delivery/environment.ts +2 -0
- package/src/lib/delivery/merge-git.ts +13 -1
- package/src/lib/delivery/record-delivery.ts +83 -29
- package/src/lib/delivery/record.ts +15 -3
- package/src/lib/delivery/resolve-branch.ts +157 -110
- package/src/lib/factory/attach-client.ts +11 -1
- package/src/lib/factory/broker.ts +37 -40
- package/src/lib/factory/client.ts +22 -1
- package/src/lib/factory/clone-url.ts +39 -0
- package/src/lib/factory/command.ts +21 -5
- package/src/lib/factory/git-auth.ts +61 -0
- package/src/lib/factory/git-credential-store.ts +181 -0
- package/src/lib/factory/ids.ts +12 -2
- package/src/lib/factory/outcomes/actions.ts +20 -4
- package/src/lib/factory/outcomes/index.ts +77 -11
- package/src/lib/factory/outcomes/lifecycle.ts +9 -2
- package/src/lib/factory/outcomes/sessions.ts +23 -1
- package/src/lib/factory/prepare.ts +9 -3
- package/src/lib/factory/runner/scheduler.ts +96 -14
- package/src/lib/factory/runner/workflow.ts +5 -1
- package/src/lib/factory/runtime.ts +143 -43
- package/src/lib/orchestrator/companion-hub.ts +6 -1
- package/src/lib/orchestrator/engine-floor.ts +48 -0
- package/src/lib/orchestrator/launcher.ts +34 -1
- package/src/lib/orchestrator/projection-claude-commands.ts +2 -2
- package/src/lib/orchestrator/projection-claude-entry.ts +42 -21
- package/src/lib/orchestrator/projection-claude-links.ts +32 -8
- package/src/lib/orchestrator/projection-claude-skills.ts +2 -2
- package/src/lib/orchestrator/projection-entries.ts +22 -18
- package/src/lib/orchestrator/projection-opencode-copies.ts +65 -21
- package/src/lib/orchestrator/projection-runtime-documents.ts +66 -43
- package/src/lib/orchestrator/projection-types.ts +28 -1
- package/src/lib/orchestrator/refresh-working-claude-links.ts +3 -1
- package/src/lib/orchestrator/session-prepare.ts +6 -1
- package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
- package/src/lib/orchestrator/types.ts +4 -0
- package/src/lib/orchestrator/umbrella-checkouts.ts +102 -0
- package/src/lib/orchestrator/working-repo-projection.ts +24 -4
- package/src/lib/orchestrator/wrap-pass.ts +1 -0
- package/src/lib/public-npm.ts +95 -50
- package/src/lib/session-state.ts +72 -2
- package/src/lib/update-checker.ts +7 -1
- package/src/lib/usage/aggregate.ts +202 -0
- package/src/lib/usage/cache.ts +87 -0
- package/src/lib/usage/claude-pricing.ts +71 -0
- package/src/lib/usage/claude.ts +189 -0
- package/src/lib/usage/collect.ts +56 -0
- package/src/lib/usage/opencode.ts +188 -0
- package/src/lib/usage/records.ts +80 -0
- package/src/lib/usage/rtk-database.ts +72 -0
- package/src/lib/usage/savings.ts +209 -0
- package/src/lib/usage/scope.ts +182 -0
- package/src/lib/usage/source.ts +102 -0
- package/src/lib/usage/types.ts +143 -0
- package/src/lib/usage/window.ts +37 -0
- package/src/lib/workset/factory-local.ts +157 -0
- package/src/lib/workset/record.ts +25 -11
- package/src/lib/workset/repositories.ts +118 -25
- package/src/lib/workset/worktree-include.ts +161 -0
- package/src/lib/workset/worktree-index.ts +6 -2
- package/src/lib/workset/worktree.ts +591 -101
- package/src/opencode/companion-hooks.ts +46 -8
- package/src/opencode/companion-policy.ts +18 -5
- package/src/opencode/enter-worktree.ts +254 -6
- package/src/opencode/session-register.ts +2 -2
- package/src/runtime/claude-bg-isolation.ts +138 -0
- package/src/runtime/companion-git.ts +10 -2
- package/src/runtime/companion-guidance.ts +17 -4
- package/src/runtime/current-branch.ts +16 -2
- package/src/runtime/entered-worktree.ts +24 -0
- package/src/runtime/git-tracked.ts +60 -0
- package/src/runtime/repo-destination.ts +72 -0
- package/src/runtime/repo-local.ts +25 -3
- package/src/runtime/rtk-git-guard.ts +66 -0
- package/src/runtime/runtime-document-manifest.ts +229 -19
- package/src/runtime/runtime-document-manifest.typecheck.ts +10 -0
- package/src/runtime/secret-guard.ts +9 -2
- package/src/runtime/secret-policy-weakening.ts +122 -0
- package/src/runtime/serving-claude-wrap.ts +15 -2
- package/src/runtime/umbrella-folder.ts +56 -0
- package/src/runtime/wrap-state.ts +5 -13
- package/src/studio.ts +37 -0
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +61 -6
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +8 -4
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +9 -5
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +5 -4
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +10 -4
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +5 -1
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +61 -6
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +8 -4
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +9 -5
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +5 -4
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +10 -4
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +5 -1
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +305 -42
- package/src/tools/setup/capabilities/rtk.ts +93 -1
- package/src/tools/setup/dynamic-plugins/audiences.ts +65 -21
- package/src/tools/setup/dynamic-plugins/frozen.ts +32 -13
- package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -4
- package/src/tools/setup/dynamic-plugins/install.ts +24 -22
- package/src/tools/setup/dynamic-plugins/loader.ts +11 -7
- package/src/tools/setup/dynamic-plugins/paths.ts +30 -10
- package/src/tools/setup/dynamic-plugins/verify.ts +10 -7
- package/src/tools/setup/dynamic-plugins/workspaces.ts +153 -0
- package/src/tools/setup/mate.ts +3 -3
- package/src/tools/setup/plugins/gitignore.ts +15 -9
- package/src/tools/setup/providers/claude-plugin-hooks.ts +12 -0
- package/src/tools/setup/providers/claude.ts +25 -3
- package/src/tools/setup/utils.ts +4 -2
- package/src/tools/setup/working-repo-cleanup.ts +2 -2
- package/src/tools/setup.ts +25 -14
- package/studio-dist/client/assets/app-D9cw6szy.css +2 -0
- package/studio-dist/client/assets/artifacts-WD2ZXYrx.js +1 -0
- package/studio-dist/client/assets/button-Br0O1sXw.js +1 -0
- package/studio-dist/client/assets/combobox-DA7RAUUZ.js +1 -0
- package/studio-dist/client/assets/companion-view-CrabvxS8.js +1 -0
- package/studio-dist/client/assets/factory-DGS0E16C.js +6 -0
- package/studio-dist/client/assets/fields-6aXBpFhJ.js +1 -0
- package/studio-dist/client/assets/getting-started-Clde4w6P.js +1 -0
- package/studio-dist/client/assets/getting-started-D6kgWwWZ.js +1 -0
- package/studio-dist/client/assets/getting-started._topic-BiunccbT.js +1 -0
- package/studio-dist/client/assets/getting-started.index-DpiNoGw8.js +1 -0
- package/studio-dist/client/assets/graph-B_TCBVbu.js +2 -0
- package/studio-dist/client/assets/graph-canvas-Ba37Y5AE.js +3242 -0
- package/studio-dist/client/assets/guides-Du_RtJxP.js +1 -0
- package/studio-dist/client/assets/index-Df8L1LQa.js +40 -0
- package/studio-dist/client/assets/jsx-runtime-MZURdZre.js +1 -0
- package/studio-dist/client/assets/markdown-view-BOX6x0rL.js +1 -0
- package/studio-dist/client/assets/panel-dbmCx7Mx.js +1 -0
- package/studio-dist/client/assets/queries-RvHeXY12.js +1 -0
- package/studio-dist/client/assets/react-3QStrcDO.js +27 -0
- package/studio-dist/client/assets/report-url-XRL0x1SY.js +1 -0
- package/studio-dist/client/assets/reports-r3IK7Doz.js +1 -0
- package/studio-dist/client/assets/routes-C0A5LTFc.js +1 -0
- package/studio-dist/client/assets/select-CnaMd617.js +1 -0
- package/studio-dist/client/assets/skills-CzjzHpBT.js +1 -0
- package/studio-dist/client/assets/specs-B0ldF_6J.js +1 -0
- package/studio-dist/client/assets/specs-view-BnCLA0gW.js +1 -0
- package/studio-dist/client/assets/spinner-Dcm3fqK1.js +1 -0
- package/studio-dist/client/assets/steps-C0p2N1Pb.js +1 -0
- package/studio-dist/client/assets/store-Dw34catY.js +1 -0
- package/studio-dist/client/assets/studio-Cpz_HRHp.js +100 -0
- package/studio-dist/client/assets/studio-queries-ibmpFo6R.js +2 -0
- package/studio-dist/client/assets/usage-C2QJ_0IZ.js +55 -0
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-Bj-FWb8z.js +1 -0
- package/studio-dist/client/assets/useMutation-aAr2uiay.js +1 -0
- package/studio-dist/client/assets/useSelector-AYcH7lB0.js +2 -0
- package/studio-dist/client/assets/vault-BGcxkSIY.js +1 -0
- package/studio-dist/client/assets/warnings-R1cE1rLf.js +1 -0
- package/studio-dist/client/assets/workflow-C2qTrMDH.js +1 -0
- package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-Bn896ZYj.js +122 -0
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +102 -35
- package/studio-dist/server/assets/{actions-Bvgj9eb8.js → actions-DYSv-9VV.js} +10 -4
- package/studio-dist/server/assets/artifacts-DnF9L3dZ.js +216 -0
- package/studio-dist/server/assets/{button-CIJqAhni.js → button-CgOIVdmD.js} +13 -1702
- package/studio-dist/server/assets/combobox-DV_s9W0s.js +483 -0
- package/studio-dist/server/assets/{companion-view-DISASvdJ.js → companion-view-BKVXD3TO.js} +3 -3
- package/studio-dist/server/assets/companions-C7fctnU9.js +31 -0
- package/studio-dist/server/assets/{createServerRpc-tK2lE9R2.js → createServerRpc-bFKFpGFG.js} +1 -1
- package/studio-dist/server/assets/{factory-DUTa0eDs.js → factory-C7Ybg0xG.js} +1256 -353
- package/studio-dist/server/assets/{factory-DGPmNGbo.js → factory-Df5uAHjb.js} +53 -6
- package/studio-dist/server/assets/fields-BbieQTD0.js +1190 -0
- package/studio-dist/server/assets/getting-started-B136TP57.js +4 -0
- package/studio-dist/server/assets/getting-started-CRxMWorQ.js +67 -0
- package/studio-dist/server/assets/getting-started._topic-DJKQAzYl.js +13 -0
- package/studio-dist/server/assets/getting-started.index-D84gec1t.js +13 -0
- package/studio-dist/server/assets/graph-CSje3029.js +801 -0
- package/studio-dist/server/assets/graph-DDZzXM1L.js +16 -0
- package/studio-dist/server/assets/graph-canvas-22bWB5-2.js +21066 -0
- package/studio-dist/server/assets/graph-wire-BdSUx0G5.js +58 -0
- package/studio-dist/server/assets/guides-D9dk1Frq.js +13 -0
- package/studio-dist/server/assets/guides-IE-19POz.js +5 -0
- package/studio-dist/server/assets/guides.server-vcYRY5wx.js +66 -0
- package/studio-dist/server/assets/jsx-runtime-Bt0s0YKS.js +451 -0
- package/studio-dist/server/assets/{markdown-view-Bn7xPdks.js → markdown-view-BR8dJ7aR.js} +28 -9
- package/studio-dist/server/assets/{panel-3Jmn4awF.js → panel-BR_t9iMM.js} +4 -4
- package/studio-dist/server/assets/queries-DWoTin-q.js +32 -0
- package/studio-dist/server/assets/react-CdqSUhaL.js +89 -0
- package/studio-dist/server/assets/redirect-BaZ_QyqF.js +39 -0
- package/studio-dist/server/assets/report-url-BUXPcE_8.js +9 -0
- package/studio-dist/server/assets/{reports-D6YMqhnO.js → reports-CQ9qQ1-n.js} +9 -10
- package/studio-dist/server/assets/{reports-C06RXVE2.js → reports-dYDEoBeq.js} +3 -3
- package/studio-dist/server/assets/{router-C8MGqlAY.js → router-DkRHNTpE.js} +787 -2862
- package/studio-dist/server/assets/{routes-BcFgvqf7.js → routes-B6GfOew4.js} +22 -171
- package/studio-dist/server/assets/{search-JAKurDNh.js → search-BJnWLfkG.js} +21 -2
- package/studio-dist/server/assets/select-Af7Wibii.js +1609 -0
- package/studio-dist/server/assets/{shell-DS3wUexh.js → shell-Hq-hXgnT.js} +6 -5
- package/studio-dist/server/assets/{skills-BEnOxiDl.js → skills-B7nEuVbx.js} +9 -8
- package/studio-dist/server/assets/{skills-CtrBAtX3.js → skills-B_YYL7q8.js} +3 -3
- package/studio-dist/server/assets/specs-BpLUFntA.js +51 -0
- package/studio-dist/server/assets/specs-view-0peMVd22.js +426 -0
- package/studio-dist/server/assets/spinner-CdwJW4VB.js +20 -0
- package/studio-dist/server/assets/{steps-Dq_CwY_s.js → steps-D56DApvK.js} +1 -1
- package/studio-dist/server/assets/store-Cs17okNG.js +280 -0
- package/studio-dist/server/assets/studio-CAcKp3bM.js +10340 -0
- package/studio-dist/server/assets/studio-queries-BtRGzDdh.js +1451 -0
- package/studio-dist/server/assets/usage-COdjd1gD.js +25570 -0
- package/studio-dist/server/assets/usage-f6pqE1tm.js +24 -0
- package/studio-dist/server/assets/useAnchoredPopupScrollLock-DlBKHRw7.js +756 -0
- package/studio-dist/server/assets/useMutation-DzTZGenE.js +690 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-M2GBs8s3.js → useSelector-DUmCUXAs.js} +4 -668
- package/studio-dist/server/assets/{vault-Fvxt2Tzl.js → vault-BDuIUq0F.js} +8 -5
- package/studio-dist/server/assets/{vault-BmWnryh3.js → vault-BVLp6zu3.js} +3 -3
- package/studio-dist/server/assets/{views-BgYa-za2.js → views-flRUr21z.js} +4 -4
- package/studio-dist/server/assets/{warnings-DzR6fyZh.js → warnings-CDy9pdgL.js} +3 -2
- package/studio-dist/server/assets/{delivery-path-C29fBynY.js → workflow-D9GKI2EV.js} +132 -106
- package/studio-dist/server/server.js +582 -8
- package/src/cli/commands/report/collector.ts +0 -288
- package/studio-dist/client/assets/app-CdPiFv59.css +0 -2
- package/studio-dist/client/assets/button-BIIHE0EQ.js +0 -3
- package/studio-dist/client/assets/companion-view-DM6YyXaR.js +0 -1
- package/studio-dist/client/assets/delivery-path-DELxj0Av.js +0 -1
- package/studio-dist/client/assets/factory-BZy0E8ty.js +0 -4
- package/studio-dist/client/assets/index-B3wkMzjA.js +0 -40
- package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +0 -1
- package/studio-dist/client/assets/panel-CbajlC3p.js +0 -1
- package/studio-dist/client/assets/prepaint-CwSrpdFA.js +0 -27
- package/studio-dist/client/assets/react-CN2GSx7x.js +0 -1
- package/studio-dist/client/assets/reports-DllhYQ5_.js +0 -1
- package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
- package/studio-dist/client/assets/routes-COm-G3mK.js +0 -1
- package/studio-dist/client/assets/skills-DmWAy-jZ.js +0 -1
- package/studio-dist/client/assets/specs-BG3Wi3ln.js +0 -1
- package/studio-dist/client/assets/steps-DFsH3Neu.js +0 -1
- package/studio-dist/client/assets/vault-B2q1nBY5.js +0 -1
- package/studio-dist/client/assets/warnings-BSXIyuSQ.js +0 -1
- package/studio-dist/client/assets/workflow-DlsQD6Hc.js +0 -1
- package/studio-dist/server/assets/companions-BYbHWKOZ.js +0 -15
- package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +0 -459
- package/studio-dist/server/assets/prepaint-DJfTQ_VH.js +0 -45
- package/studio-dist/server/assets/react-Ce6dj15C.js +0 -46
- package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +0 -34
- package/studio-dist/server/assets/specs-C8rv34-5.js +0 -211
- package/studio-dist/server/assets/studio-BeltxxKt.js +0 -216
- package/studio-dist/server/assets/workflow-liRYecHk.js +0 -73
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{Na as t,da as n,ia as r}from"./button-BIIHE0EQ.js";var i=e(t(),1),a=n(),o=new Set(`h1.h2.h3.h4.h5.h6.p.pre.code.span.blockquote.hr.ol.ul.li.div.dl.dt.dd.table.thead.tbody.tr.th.td.strong.em.del.br`.split(`.`));function s(e,t){let n=e.c?.map(c),{a:s}=e;return e.t===`a`?s?.note?(0,a.jsx)(r,{to:`/vault`,search:e=>({...e,path:s.note,dir:void 0,mode:void 0}),"data-vault-entry":s.note,children:n},t):s?.href&&/^https?:\/\//i.test(s.href)?(0,a.jsx)(`a`,{href:s.href,target:`_blank`,rel:`noopener noreferrer`,children:n},t):(0,a.jsx)(`span`,{children:n},t):e.t===`input`?(0,a.jsx)(`input`,{type:`checkbox`,checked:!!s?.checked,disabled:!0,readOnly:!0,"aria-label":`Task`},t):o.has(e.t)?(0,i.createElement)(e.t,{key:t,className:s?.className,start:s?.start,style:s?.align?{textAlign:s.align}:void 0},n&&n.length>0?n:void 0):(0,a.jsx)(`span`,{children:n},t)}function c(e,t){return typeof e==`string`?e:s(e,t)}function l({nodes:e}){return(0,a.jsx)(`div`,{className:`markdown-body`,children:e.map(c)})}export{l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{Ar as t,Na as n,da as r,r as i,t as a}from"./button-BIIHE0EQ.js";import{A as o,D as s,M as c,N as l,O as u,P as d,j as f,k as p}from"./index-B3wkMzjA.js";var m=e(n(),1),h=r();function g(e){return(0,h.jsx)(o,{"data-slot":`sheet`,...e})}var _=l;function v({className:e,wide:n=!1,...r}){return(0,h.jsxs)(f,{children:[(0,h.jsx)(d,{"data-slot":`sheet-overlay`,className:`fixed inset-0 z-30 bg-[color-mix(in_srgb,var(--bg)_45%,transparent)] transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`}),(0,h.jsx)(c,{"data-slot":`sheet-content`,"data-wide":n?``:void 0,className:t(`fixed top-2 right-2 bottom-2 z-30 flex w-[min(560px,calc(100vw-16px))] flex-col overflow-hidden rounded-panel border border-rule bg-surface text-text shadow-float outline-none transition-[transform,width] duration-250 ease-[cubic-bezier(.16,1,.3,1)] data-ending-style:translate-x-[calc(100%+16px)] data-starting-style:translate-x-[calc(100%+16px)] data-wide:w-[min(760px,calc(100vw-16px))]`,e),...r})]})}function y({className:e,...n}){return(0,h.jsx)(p,{"data-slot":`sheet-title`,className:t(`m-0 text-lg font-semibold break-words`,e),...n})}function b({items:e,current:t,onSelect:n,pass:r,wide:o,title:c,children:l}){let d=(0,m.useRef)(null),f=t!==null,p=t===null?-1:e.indexOf(t),b=p>0?e[p-1]:void 0,x=p>=0&&p<e.length-1?e[p+1]:void 0;(0,m.useEffect)(()=>{let e=e=>{let t=e.target;t?.closest&&!t.closest(`[data-slot=sheet-content]`)&&(d.current=t)};return document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[]);let S=(0,m.useEffectEvent)(e=>{if(e.metaKey||e.ctrlKey||e.altKey||s(e.target))return;let t=e.key===`ArrowRight`?x:e.key===`ArrowLeft`?b:void 0;t!==void 0&&(e.preventDefault(),n(t))});return(0,m.useEffect)(()=>{if(!f)return;let e=e=>S(e);return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[f]),(0,h.jsx)(g,{open:f,onOpenChange:e=>{e||n(null)},children:(0,h.jsxs)(v,{wide:o,"aria-label":c,finalFocus:()=>!d.current?.isConnected||d.current,initialFocus:()=>document.getElementById(`side-panel-close`),children:[(0,h.jsx)(y,{className:`sr-only`,children:c}),(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-rule py-2.5 pr-3 pl-5`,children:[(0,h.jsxs)(`span`,{className:`mr-auto font-mono text-xs text-muted`,"aria-live":`polite`,children:[p>=0?`${p+1} of ${e.length}`:null,r?` · ${r}`:null]}),(0,h.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Previous`,disabled:b===void 0,onClick:()=>b!==void 0&&n(b),children:(0,h.jsx)(i,{name:`left`})}),(0,h.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Next`,disabled:x===void 0,onClick:()=>x!==void 0&&n(x),children:(0,h.jsx)(i,{name:`right`})}),(0,h.jsx)(_,{id:`side-panel-close`,render:(0,h.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Close`}),children:(0,h.jsx)(i,{name:`close`})})]}),(0,h.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto`,children:l}),(0,h.jsxs)(`div`,{className:`flex gap-3.5 border-t border-rule px-5 py-2.5 text-2xs text-muted max-sm:hidden`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(u,{children:`←`}),(0,h.jsx)(u,{children:`→`}),` previous, next`]}),(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(u,{children:`esc`}),` close`]})]})]})})}function x({kicker:e,title:t,mono:n=!1,children:r}){return(0,h.jsxs)(`div`,{className:`grid gap-1.5 border-b border-rule px-5 pt-4 pb-3.5`,children:[e?(0,h.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:e}):null,(0,h.jsx)(`h2`,{className:n?`m-0 font-mono text-md font-semibold break-words`:`m-0 text-lg font-semibold`,children:t}),r]})}function S({title:e,aside:t,children:n}){return(0,h.jsxs)(`section`,{className:`grid gap-2.5 border-b border-rule-soft px-5 py-4`,"aria-label":e,children:[(0,h.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-sm font-semibold`,children:[e,t?(0,h.jsx)(`span`,{className:`ml-auto font-mono text-2xs font-normal text-muted`,children:t}):null]}),n]})}export{_ as a,g as i,S as n,v as o,b as r,y as s,x as t};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{bi as e,yi as t}from"./button-BIIHE0EQ.js";var n=`mate-studio-theme`,r=`mate-studio-companion`,i=`mate-studio-vault-tree`,a=`mate-studio-rail`,o=`(function () {
|
|
2
|
-
try {
|
|
3
|
-
var chosen = localStorage.getItem(${JSON.stringify(n)});
|
|
4
|
-
if (chosen === "dark" || chosen === "light") {
|
|
5
|
-
document.documentElement.setAttribute("data-theme", chosen);
|
|
6
|
-
}
|
|
7
|
-
if (localStorage.getItem(${JSON.stringify(i)}) === "hidden") {
|
|
8
|
-
document.documentElement.setAttribute("data-vault-tree", "hidden");
|
|
9
|
-
}
|
|
10
|
-
if (localStorage.getItem(${JSON.stringify(a)}) === "min") {
|
|
11
|
-
document.documentElement.setAttribute("data-rail", "min");
|
|
12
|
-
}
|
|
13
|
-
} catch (error) {
|
|
14
|
-
/* a blocked web store only costs the preference, never the page */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
var params = new URLSearchParams(location.search);
|
|
19
|
-
var last = localStorage.getItem(${JSON.stringify(r)});
|
|
20
|
-
if (!params.has(${JSON.stringify(e)}) && ${String(t)}.test(last || "")) {
|
|
21
|
-
params.set(${JSON.stringify(e)}, last);
|
|
22
|
-
location.replace(location.pathname + "?" + params.toString());
|
|
23
|
-
}
|
|
24
|
-
} catch (error) {
|
|
25
|
-
/* a blocked web store only costs the restore, never the page */
|
|
26
|
-
}
|
|
27
|
-
})();`;export{i as a,n as i,a as n,o as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{Na as t}from"./button-BIIHE0EQ.js";var n=e(t(),1),r=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},i=(e=>e?r(e):r),a=e=>e;function o(e,t=a){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return n.useDebugValue(r),r}var s=e=>{let t=i(e),n=e=>o(t,e);return Object.assign(n,t),n},c=(e=>e?s(e):s);export{c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{Ar as t,Hr as n,Na as r,da as i,ki as a,la as o,nt as s,oa as c,r as l,rt as u,sa as d,st as f,tt as p,ui as m}from"./button-BIIHE0EQ.js";import{r as h,t as g}from"./panel-CbajlC3p.js";import{F as _,L as v,a as y}from"./index-B3wkMzjA.js";function b(e){let t=o();return d(t.stores.location,c(e,t))}var x=e(r(),1),S=e=>String(e).padStart(2,`0`);function C(e){let t=new Date(e);return`${t.getFullYear()}-${S(t.getMonth()+1)}-${S(t.getDate())} ${S(t.getHours())}:${S(t.getMinutes())}`}var w=i(),T=/(?:^|[#&])report=([0-9a-f]{32})/;function E(e,t){let n=t===`system`?``:`?scheme=${t}`;return`${m}${e}${n}`}function D(e){try{let t=`${location.pathname}${location.search}${e?`#report=${e}`:``}`;history.replaceState(history.state,``,t)}catch{}}function O({report:e,src:t}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(g,{title:e.title,kicker:(0,w.jsx)(`span`,{children:C(e.createdAt)}),children:(0,w.jsxs)(`a`,{id:`reports-open`,className:`inline-flex items-center gap-1.5 text-sm`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,w.jsx)(l,{name:`external`,className:`size-3.5`}),` Open in new tab`]})}),(0,w.jsx)(`iframe`,{id:`reports-frame`,className:`min-h-0 w-full flex-1 border-0 bg-page`,title:`Hosted report`,sandbox:`allow-scripts allow-modals`,referrerPolicy:`no-referrer`,src:t},t)]})}function k({companion:e}){let r=a(n(e)),i=_(e=>e.theme),o=v(e=>e.clearReports),c=T.exec(b({select:e=>`#${e.hash}`}))?.[1],[l,d]=(0,x.useState)(void 0);(0,x.useEffect)(o,[o]);let m=r.data??[],g=l===void 0?c??null:l,y=m.find(e=>e.id===g)??null,S=e=>{d(e),D(e)},k=y?E(y.id,i):null;return(0,w.jsxs)(`section`,{className:t(u,`grid content-start gap-3 pb-10`),"data-reports-view":!0,"aria-label":`Hosted reports`,children:[m.length===0?(0,w.jsx)(p,{children:(0,w.jsx)(`span`,{id:`reports-empty`,children:`No hosted reports yet.`})}):(0,w.jsx)(s,{title:`Reports`,count:m.length,hint:`Newest first`,children:(0,w.jsx)(`ul`,{id:`reports-list`,className:`m-0 list-none p-0`,"aria-label":`Reports`,children:m.map(e=>(0,w.jsx)(`li`,{children:(0,w.jsxs)(`button`,{type:`button`,className:t(f,`grid grid-cols-[minmax(0,1fr)_auto]`),"data-report-id":e.id,"aria-current":e.id===y?.id?`true`:void 0,onClick:()=>S(e.id),children:[(0,w.jsx)(`span`,{className:`truncate text-sm`,"data-report-title":!0,children:e.title}),(0,w.jsx)(`span`,{className:`font-mono text-xs text-muted`,"data-report-time":!0,children:C(e.createdAt)})]})},e.id))})}),(0,w.jsx)(h,{items:m.map(e=>e.id),current:y?.id??null,onSelect:S,wide:!0,title:y?`Report ${y.title}`:`Report`,children:y&&k?(0,w.jsx)(O,{report:y,src:k}):null})]})}var A=function(){let{companion:e}=y.useSearch();return e?(0,w.jsx)(k,{companion:e}):null};export{A as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));export{c as n,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{t}from"./companion-view-DM6YyXaR.js";import{$ as n,Ar as r,Gr as i,Na as a,Q as o,aa as s,at as c,ct as l,da as u,et as d,ia as f,ki as p,nt as m,ot as h,qr as g,r as _,rt as v,st as y,t as b,tt as x}from"./button-BIIHE0EQ.js";import{n as S,r as C,t as w}from"./panel-CbajlC3p.js";import{t as T}from"./warnings-BSXIyuSQ.js";import{t as E}from"./markdown-view-pQ2Qp_i5.js";import{C as D,E as O,S as k,T as A,s as j,w as M}from"./index-B3wkMzjA.js";var N=e(a(),1);function P(e){let t=new Set,n=[];for(let r of e)for(let e of r.specs)t.has(e)||(t.add(e),n.push({capability:e,change:r.name,archivedOn:r.archivedOn}));return n}var F=u(),ee=20,te=12,I=`openspec/changes/archive`,L=e=>`openspec/specs/${e}/spec.md`,R=r(y,`grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 py-2`);function z({payload:e}){let[t,n]=(0,N.useState)(null),i=e.shipped.slice(0,ee),a=i.find(e=>e.anchor===t)??null;return(0,F.jsxs)(`div`,{className:`analyst-overview`,children:[(0,F.jsx)(T,{warnings:e.warnings}),(0,F.jsx)(`div`,{className:r(v,`@container pb-10`),children:(0,F.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)] items-start gap-3 @max-[760px]:grid-cols-1`,children:[(0,F.jsx)(H,{all:e.shipped.length,shown:i,current:t,onOpen:n}),(0,F.jsx)(W,{shipped:e.shipped})]})}),(0,F.jsx)(C,{items:i.map(e=>e.anchor),current:a?.anchor??null,onSelect:n,title:a?`Shipped change ${a.name}`:`Shipped change`,children:a?(0,F.jsx)(U,{change:a}):null})]})}function B(e){let t=[];for(let n of e){let e=t.at(-1);e?.[0]===n.archivedOn?e[1].push(n):t.push([n.archivedOn,[n]])}return t}function V(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(`en`,{weekday:`long`,timeZone:`UTC`})}function H({all:e,shown:t,current:n,onOpen:i}){return(0,F.jsx)(m,{title:`Recently shipped`,count:e,hint:e>t.length?`newest ${t.length}`:void 0,children:t.length===0?(0,F.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No shipped changes yet.`}):(0,F.jsx)(`ol`,{className:`analyst-days m-0 list-none p-0`,children:B(t).map(([e,t])=>(0,F.jsxs)(`li`,{className:`border-t border-rule first:border-t-0`,children:[(0,F.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 bg-[color-mix(in_srgb,var(--surface)_45%,transparent)] px-4 pt-2.5 pb-1.5 text-xs font-semibold text-muted`,children:[(0,F.jsx)(`time`,{dateTime:e,className:`font-mono text-text`,children:e}),V(e),(0,F.jsx)(d,{value:t.length})]}),(0,F.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,className:r(y,`grid gap-0.5 py-2`),"aria-current":n===e.anchor?`true`:void 0,onClick:()=>i(e.anchor),children:[(0,F.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.name}),(0,F.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.specs.length===0?`no spec changes`:e.specs.join(`, `)})]})},e.anchor))})]},e))})})}function U({change:e}){let t=`${I}/${e.anchor}`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(w,{mono:!0,title:e.name,kicker:(0,F.jsxs)(`span`,{children:[`Shipped `,e.archivedOn]})}),(0,F.jsx)(S,{title:`Proposal`,children:e.hasProposal?(0,F.jsxs)(f,{className:`inline-flex items-center gap-2 text-sm`,to:`/vault`,search:e=>({...e,path:`${t}/proposal.md`}),children:[(0,F.jsx)(_,{name:`doc`}),` Read the proposal`]}):(0,F.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`This change has no proposal.`,` `,(0,F.jsx)(f,{to:`/vault`,search:e=>({...e,dir:t}),children:`Open its folder`})]})}),(0,F.jsx)(S,{title:`Specs it changed`,aside:String(e.specs.length),children:e.specs.length===0?(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No spec changed.`}):(0,F.jsx)(`ul`,{className:`m-0 grid list-none gap-1 p-0`,children:e.specs.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsx)(f,{className:`font-mono text-sm`,to:`/vault`,search:t=>({...t,path:L(e)}),children:e})},e))})})]})}function W({shipped:e}){let t=P(e).slice(0,te);return(0,F.jsx)(m,{title:`Recently changed specs`,hint:(0,F.jsx)(f,{to:`/specs`,search:e=>e,children:`All specs`}),children:t.length===0?(0,F.jsx)(`p`,{className:`empty m-0 px-4 py-3 text-sm text-muted`,children:`No specs changed by shipped changes yet.`}):(0,F.jsx)(`ol`,{className:`analyst-list m-0 list-none p-0`,children:t.map((e,n)=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(f,{className:R,to:`/vault`,search:t=>({...t,path:L(e.capability)}),children:[(0,F.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,F.jsx)(`span`,{className:`analyst-row-title truncate font-mono text-sm`,children:e.capability}),(0,F.jsxs)(`span`,{className:`truncate text-xs text-muted`,children:[`by `,e.change]})]}),(0,F.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e.archivedOn===t[n-1]?.archivedOn?null:e.archivedOn})]})},e.capability))})})}var G=`openspec/changes`,K=e=>`${G}/${e.name}`,q=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft disabled:cursor-default disabled:hover:bg-transparent`;function J({done:e}){return(0,F.jsx)(`span`,{className:r(`grid size-3.5 flex-none place-items-center rounded-[4px] border`,e?`border-accent bg-accent text-on-accent`:`border-rule bg-page`),"aria-hidden":`true`,children:e?(0,F.jsx)(_,{name:`check`,className:`size-2.5 [stroke-width:2.4]`}):null})}function Y({companion:e,dir:t,onRead:n}){let r=p(i(e,`${t}/specs`));if(r.isPending)return(0,F.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:`Listing specs…`});let a=(r.data?.entries??[]).filter(e=>e.kind===`directory`);return r.isError||a.length===0?(0,F.jsx)(`p`,{className:`m-0 pl-8 text-xs text-muted`,children:(0,F.jsx)(f,{to:`/vault`,search:e=>({...e,dir:`${t}/specs`}),children:`Open the specs folder`})}):(0,F.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0 pl-6`,children:a.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,className:q,"data-artifact-file":`${e.path}/spec.md`,onClick:()=>n(`${e.path}/spec.md`),children:[(0,F.jsx)(_,{name:`doc`,className:`flex-none text-muted`}),(0,F.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.name})]})},e.path))})}function X({change:e,companion:t,onRead:n}){if(e.artifacts.length===0)return(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No artifacts yet.`});let r=K(e);return(0,F.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:e.artifacts.map(e=>{let i=e.status===`done`,a=i&&t!==void 0,o=e.id===`specs`;return(0,F.jsxs)(`li`,{children:[(0,F.jsxs)(`button`,{type:`button`,className:q,disabled:!a||o,"data-artifact":e.id,onClick:()=>n(`${r}/${e.id}.md`),children:[(0,F.jsx)(J,{done:i}),(0,F.jsx)(`span`,{className:i?`text-text`:`text-muted`,children:e.id}),(0,F.jsx)(`span`,{className:`ml-auto text-xs text-muted`,children:i?o?`per capability`:`read`:`not yet`}),a&&!o?(0,F.jsx)(_,{name:`right`,className:`text-muted`}):null]}),a&&o?(0,F.jsx)(Y,{companion:t,dir:r,onRead:n}):null]},e.id)})})}function Z({companion:e,path:t,change:n,onBack:r}){let i=p(g(e,{path:t})),a=i.data?.open?.markdown,o=t.slice(K(n).length+1);return(0,F.jsxs)(`section`,{className:`grid content-start gap-3 px-5 py-4`,"aria-label":`Artifact ${o}`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(b,{size:`sm`,variant:`ghost`,className:`-ml-2`,onClick:r,children:[(0,F.jsx)(_,{name:`left`}),` Artifacts`]}),(0,F.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted`,children:o}),(0,F.jsxs)(f,{className:`ml-auto inline-flex flex-none items-center gap-1.5 text-xs`,to:`/vault`,search:e=>({...e,path:t}),children:[(0,F.jsx)(_,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]}),a?(0,F.jsx)(`div`,{className:`prose-panel`,children:(0,F.jsx)(E,{nodes:a})}):(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:i.isPending?`Loading…`:`The file could not be read.`})]})}var ne={"needs-you":`Review or fix before the build goes on`,building:`An agent is working through the tasks`,ready:`Every task is done`};function Q(e){if(e.valid===!1)return{marker:`issue`,word:`Invalid`};let t=M(e);return t===`needs-you`?(e.totalTasks??0)===0?{marker:`warn`,word:`No tasks`}:{marker:`review`,word:`Review`}:t===`building`?{marker:`build`,word:`Building`}:{marker:`done`,word:`Ready`}}var $=[`Propose change`,`Human review`,`Apply change`,`Archive change`];function re({stage:e}){let t=$.indexOf(e);return(0,F.jsx)(`ol`,{className:`m-0 grid list-none grid-cols-4 gap-1 p-0`,"aria-label":`Delivery Path`,children:$.map((e,n)=>(0,F.jsx)(`li`,{"aria-current":n===t?`step`:void 0,className:r(`grid gap-1.5 text-2xs text-muted before:h-1 before:rounded-full before:bg-rule before:content-['']`,n<t&&`before:bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]`,n===t&&`font-semibold text-text before:bg-accent`,n===t&&e===`Human review`&&`before:bg-why`),children:e},e))})}function ie({change:e,companion:t,reading:r,onRead:i}){let a=A(e),{marker:s,word:c}=Q(e),u=(0,F.jsx)(S,{title:`Artifacts`,aside:e.schemaName,children:(0,F.jsx)(X,{change:e,companion:t,onRead:i})}),d=M(e)===`needs-you`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(w,{mono:!0,title:e.name,kicker:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(l,{marker:s,children:c}),(0,F.jsx)(o,{at:e.lastModified,className:`ml-auto`})]}),children:(0,F.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:a.situation})}),r&&t?(0,F.jsx)(Z,{companion:t,path:r,change:e,onBack:()=>i(null)}):(0,F.jsxs)(F.Fragment,{children:[d?u:null,(0,F.jsx)(S,{title:`Delivery Path`,aside:a.stage,children:(0,F.jsx)(re,{stage:a.stage})}),(0,F.jsxs)(S,{title:`Next step`,children:[(0,F.jsxs)(`p`,{className:`m-0 text-sm`,children:[a.next,`.`]}),(0,F.jsx)(n,{text:a.prompt})]}),(0,F.jsx)(S,{title:`Tasks`,aside:`${e.completedTasks??0}/${e.totalTasks??0}`,children:(0,F.jsx)(h,{done:e.completedTasks??0,total:e.totalTasks??0})}),d?null:u]})]})}function ae({change:e,current:t,onOpen:n}){let{marker:i,word:a}=Q(e),s=A(e);return(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,className:r(y,`grid grid-cols-[minmax(0,1fr)_120px_150px_72px] @max-[640px]:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":t?`true`:void 0,"data-change":e.name,onClick:n,children:[(0,F.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,F.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.name}),(0,F.jsx)(`span`,{className:r(`truncate text-xs`,e.valid===!1?`text-bad`:`text-muted`),children:s.situation})]}),(0,F.jsx)(l,{marker:i,children:a}),(0,F.jsx)(`span`,{className:`@max-[640px]:hidden`,children:(0,F.jsx)(h,{done:e.completedTasks??0,total:e.totalTasks??0})}),(0,F.jsx)(o,{at:e.lastModified,className:`text-right @max-[640px]:hidden`})]})})}function oe({changes:e,selected:t,companion:n}){let i=s(),[a,o]=(0,N.useState)(`all`),[l,u]=(0,N.useState)(!1),[f,p]=(0,N.useState)(null),h=O(e),g=k.filter(e=>a===`all`||a===e),_=g.flatMap(e=>h[e]),y=l?h[`needs-you`]:_,S=e.find(e=>e.name===t)??null,w=f&&f.change===S?.name?f.path:null,T=e=>{e===null&&u(!1),i({to:`.`,search:t=>({...t,change:e??void 0}),replace:!0})};return e.length===0?(0,F.jsx)(`section`,{className:r(v,`pb-10`),"aria-label":`Changes`,children:(0,F.jsx)(x,{children:`No change is in flight in this companion.`})}):(0,F.jsxs)(`section`,{className:r(v,`@container grid content-start gap-3 pb-10`),"aria-label":`Changes`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(c,{label:`Show changes`,value:a,onChange:o,options:[{value:`all`,label:`All`,count:e.length},...k.map(e=>({value:e,label:D[e],count:h[e].length,tone:e===`needs-you`?`warn`:void 0}))]}),h[`needs-you`].length>0?(0,F.jsxs)(b,{variant:`primary`,size:`sm`,className:`ml-auto`,onClick:()=>{u(!0),T(h[`needs-you`][0].name)},children:[`Start review pass`,(0,F.jsx)(d,{value:h[`needs-you`].length})]}):null]}),g.map(e=>h[e].length===0?null:(0,F.jsx)(m,{title:D[e],count:h[e].length,hint:ne[e],tone:e===`needs-you`?`warn`:void 0,children:(0,F.jsx)(`ul`,{className:`m-0 list-none p-0`,children:h[e].map(e=>(0,F.jsx)(ae,{change:e,current:e.name===t,onOpen:()=>{u(!1),T(e.name)}},e.name))})},e)),(0,F.jsx)(C,{items:y.map(e=>e.name),current:S?.name??null,onSelect:T,pass:l?`Needs you`:void 0,wide:w!==null,title:S?`Change ${S.name}`:`Change`,children:S?(0,F.jsx)(ie,{change:S,companion:n,reading:w,onRead:e=>p(e?{change:S.name,path:e}:null)}):null})]})}function se({payload:e,selected:t,companion:n}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(T,{warnings:e.warnings}),(0,F.jsx)(oe,{changes:e.changes,selected:t,companion:n})]})}function ce(){let e=j.useSearch();return(0,F.jsx)(t,{view:`dashboard`,search:e,children:t=>t.studioMode===`analysis`?(0,F.jsx)(z,{payload:{shipped:t.shipped??[],warnings:t.warnings}}):(0,F.jsx)(se,{payload:{changes:t.changes??[],warnings:t.warnings},selected:e.change,companion:e.companion})})}export{ce as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{t}from"./companion-view-DM6YyXaR.js";import{$ as n,Ar as r,Na as i,Ui as a,Wr as o,at as s,da as c,ki as l,nt as u,r as d,rt as f,st as p,tt as m}from"./button-BIIHE0EQ.js";import{n as h,r as g,t as _}from"./panel-CbajlC3p.js";import{n as v}from"./steps-DFsH3Neu.js";import{t as y}from"./markdown-view-pQ2Qp_i5.js";import{i as b}from"./index-B3wkMzjA.js";var x=e(i(),1),S=c(),C=`flex w-full min-w-0 items-center gap-2.5 rounded-control border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-surface-soft aria-[current=true]:bg-accent-soft`;function w(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KB`}function T({companion:e,agent:t,name:n}){let[i,s]=(0,x.useState)(void 0),c=l({...o(e,t,n,i),placeholderData:a});if(!c.data)return(0,S.jsx)(h,{title:`Files`,children:c.isError?(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,role:`alert`,children:c.error instanceof Error?c.error.message:`The skill could not be read.`}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Listing files…`})});let{files:u,truncated:f,open:p}=c.data;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(h,{title:`Files`,aside:f?`first ${u.length}`:u.length,children:(0,S.jsx)(`ul`,{className:`m-0 -mx-2 grid list-none gap-0.5 p-0`,children:u.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:C,"aria-current":p?.path===e.path?`true`:void 0,"data-skill-file":e.path,onClick:()=>s(e.path),children:[(0,S.jsx)(d,{name:`doc`,className:`flex-none text-muted`}),(0,S.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.path}),(0,S.jsx)(`span`,{className:`ml-auto flex-none font-mono text-2xs text-muted`,children:w(e.size)})]})},e.path))})}),p?(0,S.jsxs)(`section`,{className:r(`grid gap-2.5 px-5 py-4`,c.isPlaceholderData&&`opacity-60`),"aria-label":`File ${p.path}`,children:[(0,S.jsx)(`code`,{className:`truncate font-mono text-xs text-muted`,children:p.path}),p.nodes?(0,S.jsx)(`div`,{className:`prose-panel`,children:(0,S.jsx)(y,{nodes:p.nodes})}):(0,S.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:p.note})]}):null]})}var E=[{id:`claude`,label:`Claude`,dir:`.claude/skills`,invoke:e=>`/${e}`},{id:`opencode`,label:`OpenCode`,dir:`.opencode/skills`,invoke:e=>`@${e}`},{id:`agents`,label:`Agents`,dir:`.agents/skills`,invoke:e=>`$${e}`}],D=new Set([`mate-grilling`,`mate-domain-modeling`]);function O(){let e=new Map;for(let t of v({}).paths[0]?.steps??[]){t.skill&&!e.has(t.skill)&&e.set(t.skill,t.label);for(let n of t.alternatives??[])e.has(n.name)||e.set(n.name,t.label)}return e}function k(e,t){let n=[...t.keys()],r=e.filter(e=>t.has(e)).toSorted((e,t)=>n.indexOf(e)-n.indexOf(t)),i=e.filter(e=>D.has(e)),a=e.filter(e=>e.startsWith(`mate-`)&&!t.has(e)&&!D.has(e)),o=e.filter(e=>!e.startsWith(`mate-`)&&!t.has(e));return[{title:`Delivery Path`,hint:`In the order a change meets them`,names:r},{title:`Other Mate skills`,hint:`Run when you need them`,names:a},{title:`Used by other skills`,hint:`Loaded for you, not started on their own`,names:i},{title:`Other skills`,hint:`Installed besides Mate`,names:o}].filter(e=>e.names.length>0)}function A({skills:e,companion:t}){let i=e??{claude:[],opencode:[],agents:[]},[a,o]=(0,x.useState)(`claude`),[c,l]=(0,x.useState)(null),d=O(),v=E.find(e=>e.id===a);return(0,S.jsxs)(`section`,{className:r(f,`grid content-start gap-3 pb-10`),"aria-label":`Agent skills`,"data-skills-root":!0,children:[(0,S.jsx)(s,{label:`Agent`,value:a,onChange:e=>{o(e),l(null)},options:E.map(e=>({value:e.id,label:e.label,count:i[e.id].length}))}),E.map(e=>{let t=e.id===a,n=i[e.id];return(0,S.jsx)(`div`,{id:`skills-panel-${e.id}`,className:t?`grid gap-3`:`hidden`,"aria-hidden":!t,"data-skill-panel":e.id,"data-active":t,children:n.length===0?(0,S.jsxs)(m,{children:[e.label,` has no skills in this companion.`]}):k(n,d).map(e=>(0,S.jsx)(u,{title:e.title,count:e.names.length,hint:e.hint,children:(0,S.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.names.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:r(p,`grid grid-cols-[minmax(0,1fr)_auto] py-1.5`),"aria-current":t&&c===e?`true`:void 0,"data-skill":e,onClick:()=>l(e),children:[(0,S.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e}),d.has(e)?(0,S.jsx)(`span`,{className:`text-xs text-muted`,children:d.get(e)}):null]})},e))})},e.title))},e.id)}),(0,S.jsx)(g,{items:k(i[a],d).flatMap(e=>e.names),current:c,onSelect:l,wide:t!==void 0,title:c?`Skill ${c}`:`Skill`,children:c?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_,{mono:!0,title:c,kicker:d.has(c)?(0,S.jsxs)(`span`,{children:[`Delivery Path · `,d.get(c)]}):(0,S.jsx)(`span`,{children:v.label})}),(0,S.jsx)(h,{title:`Start`,children:D.has(c)?(0,S.jsx)(`p`,{className:`m-0 text-sm`,children:`Used by other skills: they load it when they need it, so it has no start command.`}):(0,S.jsx)(n,{text:v.invoke(c),label:`start command`})}),(0,S.jsx)(h,{title:`Installed for`,children:(0,S.jsx)(`ul`,{className:`m-0 grid list-none gap-1.5 p-0`,children:E.filter(e=>i[e.id].includes(c)).map(e=>(0,S.jsxs)(`li`,{className:`flex items-center gap-3 text-sm`,children:[(0,S.jsx)(`span`,{className:`w-20 text-muted`,children:e.label}),(0,S.jsxs)(`code`,{className:`truncate font-mono text-xs`,children:[e.dir,`/`,c,`/`]})]},e.id))})}),t?(0,S.jsx)(T,{companion:t,agent:a,name:c},`${a}/${c}`):null]}):null})]})}var j=function(){let e=b.useSearch();return(0,S.jsx)(t,{view:`skills`,search:e,children:t=>(0,S.jsx)(A,{skills:t.skillInventory,companion:e.companion})})};export{j as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{Ar as t,Na as n,ct as r,da as i,ia as a,ki as o,nt as s,qr as c,r as l,rt as u,st as d,tt as f}from"./button-BIIHE0EQ.js";import{t as p}from"./companion-view-DM6YyXaR.js";import{n as m,r as h,t as g}from"./panel-CbajlC3p.js";import{t as _}from"./markdown-view-pQ2Qp_i5.js";import{t as v}from"./warnings-BSXIyuSQ.js";import{r as y}from"./index-B3wkMzjA.js";var b=/^[a-z0-9][a-z0-9-]{0,63}$/,x=[{id:`show-me`,skill:`mate-show-me`,label:`Show me`,subject:`spec`,prompts:{claude:e=>`/mate-show-me ${e}`,opencode:e=>`Use the mate-show-me skill on spec ${e}.`}}];function S(e){return x.find(t=>t.id===e)??null}function C(e){return(e.actions??[]).flatMap(({id:e,runAgents:t,copyAgents:n})=>{let r=S(e);return r?[{action:r,runAgents:t,copyAgents:n}]:[]})}var w=e(n(),1),T=`unassigned`;function E(e){let t=new Map;for(let n of e){let e=n.areas.length>0?n.areas:[T];for(let r of e){let e=t.get(r);e?e.push(n):t.set(r,[n])}}return[...t.entries()].toSorted((e,t)=>e[0].localeCompare(t[0]))}var D=i(),O=[],k=e=>`openspec/specs/${e}/spec.md`;function A(e){return e.valid===!1?(0,D.jsx)(r,{marker:`issue`,children:`${e.issueCount??0} issues`}):e.valid===!0?(0,D.jsx)(r,{marker:`done`,children:`valid`}):(0,D.jsx)(r,{marker:`idle`,children:`unvalidated`})}var j=`.`,M=e=>e===j?`Repository root`:e;function N(e){return e===void 0?`requirements unknown`:`${e} ${e===1?`requirement`:`requirements`}`}function P({payload:e,actions:t=O,companion:n}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(v,{warnings:e.warnings}),(0,D.jsx)(L,{specs:e.specs,actions:t,companion:n})]})}var F=`inline-flex h-7 items-center gap-1.5 rounded-[6px] border border-rule bg-surface px-2.5 text-xs text-text hover:border-accent hover:bg-accent-soft`;function I({capability:e,actions:n}){return!b.test(e)||n.length===0?null:(0,D.jsx)(`span`,{className:`spec-actions flex flex-wrap items-center gap-1.5`,children:n.map(({action:n,runAgents:r,copyAgents:i})=>(0,D.jsxs)(w.Fragment,{children:[r.length>0?(0,D.jsxs)(`button`,{type:`button`,className:t(F,`spec-action`),"data-studio-action":n.id,"data-studio-subject":e,"data-studio-agents":r.join(` `),children:[(0,D.jsx)(l,{name:`play`,className:`size-3.5`}),n.label]}):null,(0,D.jsxs)(`button`,{type:`button`,className:t(F,`spec-copy`),"aria-label":`Copy prompt`,"data-studio-copy-prompt":n.id,"data-prompt-claude":i.includes(`claude`)?n.prompts.claude(e):void 0,"data-prompt-opencode":i.includes(`opencode`)?n.prompts.opencode(e):void 0,children:[(0,D.jsx)(l,{name:`copy`,className:`size-3.5`}),`Copy prompt`]})]},n.id))})}function L({specs:e,actions:n,companion:r}){let i=E(e),[a,o]=(0,w.useState)(null),c=[...new Set(i.flatMap(([,e])=>e.map(e=>e.capability)))],l=e.find(e=>e.capability===a)??null;return(0,D.jsxs)(`section`,{className:t(u,`grid content-start gap-3 pb-10`),"aria-label":`Specs by Area`,children:[i.length===0?(0,D.jsx)(f,{children:`No specs in this companion.`}):i.map(([e,n])=>(0,D.jsx)(s,{title:e===j?M(e):(0,D.jsx)(`span`,{className:`font-mono`,children:e}),label:`Area ${e}`,count:n.length,children:(0,D.jsx)(`ul`,{className:`m-0 list-none p-0`,children:n.map(e=>(0,D.jsx)(`li`,{children:(0,D.jsxs)(`button`,{type:`button`,className:t(d,`grid grid-cols-[minmax(0,1fr)_auto_120px] py-1.5 max-sm:grid-cols-[minmax(0,1fr)_auto]`),"aria-current":a===e.capability?`true`:void 0,"data-spec":e.capability,onClick:()=>o(e.capability),children:[(0,D.jsx)(`span`,{className:`truncate font-mono text-sm`,children:e.capability}),e.valid===!0?(0,D.jsx)(`span`,{}):A(e),(0,D.jsx)(`span`,{className:`text-right text-xs text-muted tabular-nums max-sm:hidden`,children:N(e.requirementCount)})]})},e.capability))})},e)),(0,D.jsx)(h,{items:c,current:l?.capability??null,onSelect:o,wide:!0,title:l?`Spec ${l.capability}`:`Spec`,children:l?(0,D.jsx)(R,{spec:l,actions:n,companion:r}):null})]})}function R({spec:e,actions:t,companion:n}){let r=k(e.capability),i=o({...c(n??``,{path:r}),enabled:!!n}),s=i.data?.open?.markdown;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(g,{mono:!0,title:e.capability,kicker:(0,D.jsxs)(D.Fragment,{children:[A(e),(0,D.jsx)(`span`,{className:`ml-auto`,children:e.areas.map(M).join(`, `)})]}),children:(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(I,{capability:e.capability,actions:t}),(0,D.jsxs)(a,{className:`inline-flex items-center gap-1.5 text-sm`,to:`/vault`,search:e=>({...e,path:r}),children:[(0,D.jsx)(l,{name:`external`,className:`size-3.5`}),` Open in Vault`]})]})}),(0,D.jsx)(m,{title:`Spec`,aside:e.requirementCount===void 0?void 0:N(e.requirementCount),children:s?(0,D.jsx)(`div`,{className:`prose-panel`,children:(0,D.jsx)(_,{nodes:s})}):(0,D.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:i.isError?`The spec file could not be read.`:i.isPending&&n?`Loading…`:`The spec file could not be read.`})})]})}var z=function(){let e=y.useSearch();return(0,D.jsx)(p,{view:`specs`,search:e,children:t=>(0,D.jsx)(P,{payload:{specs:t.specs??[],warnings:t.warnings},actions:C(t),companion:e.companion})})};export{z as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ci as e,li as t,si as n,vi as r,xi as i}from"./button-BIIHE0EQ.js";var a=[`mate-clarify-intent`,`mate-interview-me`,`mate-grill-me`],o={"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.`},s={"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 c(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 l(e,t){if(e.kind===`human`)return null;if(e.id===`clarify-intent`)return`/${e.skill} about ${i}`;let n=e.id===`propose`&&t!==`mate-v1`?` (use schema: ${t})`:``;return`/${e.skill}${n} for ${r}`}function u(e){return e&&e.replace(` ${r}`,``).replace(` ${i}`,``)}function d(e){return a.filter(e).map(e=>({name:e,description:o[e],prompt:`/${e} about ${i}`,copyPrompt:`/${e} about`}))}var f=new Set([`explore`,`propose`,`apply`,`archive`]);function p(e){if(e.kind===`human`)return[`human-review`];let t=e.optional?[`optional`,`skill`]:[`skill`];return f.has(e.id)&&t.push(`openspec`),t}var m={"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 h(e){return t(e)?m[e]:{tagline:`custom schema`,description:`Planning path of the ${e} schema.`}}var g={plan:`Plan`,review:`Review`,build:`Build`,ship:`Ship`};function _(e,t){return e.kind===`human`?`review`:e.id===`apply`||t===`build`&&e.optional?`build`:t===void 0||t===`plan`?`plan`:`ship`}function v(e){return e.kind===`human`?`human`:e.optional?`optional`:null}function y(e){let t=[];for(let n of e){let e=v(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 b(t,n,r){let i=r.skills?new Set(r.skills):null,a=e=>!i||i.has(e),o=e(n),f=[];for(let e of o.stages){let n=e.kind===`human`?c(e.artifact,r.topology,t):s[e.id],i=l(e,t),o=f.at(-1),m={...e,what:n.what,why:n.why,badges:p(e),prompt:i,copyPrompt:u(i),phase:_(e,o?.phase)};e.id===`clarify-intent`&&(m.alternatives=d(a)),e.kind===`skill`&&!a(e.skill)&&(m.missingSkill=e.skill),e.id===`apply`&&(m.sessionBreakBefore=!0),f.push(m)}return{schema:t,label:t,...h(t),steps:f,map:y(f),reviewsKnown:o.reviewsKnown}}function x(e,r){return r?.schemaName===e?r.artifacts.map(e=>e.id):t(e)?n[e]:void 0}function S(e={}){let r=e.topology?.schemaName;return{paths:(r&&!t(r)?[r]:Object.keys(n)).map(t=>b(t,x(t,e.topology),e))}}export{S as n,g as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{B as t,I as n,R as r,b as i,n as a,x as o,z as s}from"./index-B3wkMzjA.js";import{$i as c,Ar as l,Gr as u,Jr as d,Kr as f,Lr as p,Na as m,Rr as h,Ur as g,Xr as _,Yr as v,aa as y,da as b,ia as x,ki as S,la as C,n as w,nt as T,qr as E,r as D,st as O,t as k}from"./button-BIIHE0EQ.js";import{t as A}from"./markdown-view-pQ2Qp_i5.js";var j=e(m(),1);function M(e,t){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if(`shouldBlockFn`in e)return e;if(typeof e==`function`){let n=!!(t??!0);return{shouldBlockFn:async()=>n?await e():!1,enableBeforeUnload:n,withResolver:!1}}let n=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function ee(e,t){let{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:a=!1}=M(e,t),o=C(),{history:s}=o,[c,l]=j.useState({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return j.useEffect(()=>i?void 0:s.block({blockerFn:async e=>{function t(e){let t=o.parseLocation(e),[,n,r]=o.getMatchedRoutes(t.pathname);return r===void 0?{routeId:`__notFound__`,fullPath:t.pathname,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}:{routeId:r.id,fullPath:r.fullPath,pathname:t.pathname,params:n,search:o.options.parseSearch(e.search)}}let r=t(e.currentLocation),i=t(e.nextLocation);if(r.routeId===`__notFound__`&&i.routeId!==`__notFound__`)return!1;let s=await n({action:e.action,current:r,next:i});if(!a)return s;if(!s)return!1;let c=await new Promise(t=>{l({status:`blocked`,current:r,next:i,action:e.action,proceed:()=>t(!1),reset:()=>t(!0)})});return l({status:`idle`,current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),c},enableBeforeUnload:r}),[n,r,i,a,s,o]),c}var N=b(),te=(e,t)=>`/api/vault/events?${new URLSearchParams({companion:e,path:t})}`;function P(e,t,n){let r=(0,j.useRef)(n);(0,j.useEffect)(()=>{r.current=n}),(0,j.useEffect)(()=>{if(typeof EventSource>`u`)return;let n=new EventSource(te(e,t));return n.onmessage=e=>{try{r.current(JSON.parse(e.data))}catch{}},()=>n.close()},[e,t])}function F({crumbs:e,children:t}){return(0,N.jsxs)(`div`,{className:`vault-bar sticky top-0 z-2 flex min-h-[52px] items-center gap-2 border-b border-rule-soft bg-[color-mix(in_srgb,var(--bg)_88%,transparent)] px-6 py-2 backdrop-blur-md max-sm:px-3`,children:[(0,N.jsx)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1`,children:e}),t]})}var I=`vault-prose prose mx-auto w-full max-w-[68ch] px-10 pt-10 pb-28 max-sm:px-4`,L=w({variant:`default`,size:`sm`});function R({path:e}){return(0,N.jsxs)(`button`,{type:`button`,className:w({variant:`ghost`,size:`sm`}),"data-copy":e,"data-copy-label":`path`,"aria-label":`Copy path`,children:[(0,N.jsx)(D,{name:`copy`,className:`size-3.5`}),(0,N.jsx)(`span`,{className:`@max-[1000px]:hidden`,children:`Copy path`})]})}function z({companion:e,data:t,writable:n,search:r,crumbs:i}){let a=t.open;return a?n&&r.mode===`edit`?(0,N.jsx)(ne,{companion:e,data:t,crumbs:i},`${a.path}:edit`):(0,N.jsx)(V,{companion:e,data:t,writable:n,crumbs:i},`${a.path}:read`):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(F,{crumbs:i}),(0,N.jsxs)(`div`,{className:I,children:[(0,N.jsx)(`h1`,{className:`text-xl`,children:t.refusal?`File refused`:`Open a markdown file`}),(0,N.jsx)(`p`,{className:t.refusal?`vault-warning text-warn`:`empty text-muted`,children:t.refusal??`Choose a file from the tree to begin.`})]})]})}var B=e=>e.split(`/`).at(-1)??e;function V({companion:e,data:t,writable:n,crumbs:r}){let i=t.open,a=c(),[o,s]=(0,j.useState)(``);return P(e,i.path,t=>{t.kind===`removed`?s(`this file no longer exists on disk`):p(a,e)}),(0,N.jsxs)(`div`,{"data-vault-root":!0,"data-vault-mode":`read`,"data-vault-path":i.path,children:[(0,N.jsxs)(F,{crumbs:r,children:[(0,N.jsx)(R,{path:i.path}),n?(0,N.jsxs)(x,{className:L,id:`vault-mode-edit`,to:`/vault`,search:e=>({...e,mode:`edit`}),"data-vault-mode-link":!0,children:[(0,N.jsx)(D,{name:`pencil`,className:`size-3.5`}),`Edit`]}):(0,N.jsx)(`span`,{className:`text-xs text-muted`,title:`Start Studio with --writable to edit.`,children:`Read only`})]}),(0,N.jsxs)(`article`,{className:I,"aria-label":B(i.path),children:[(0,N.jsx)(A,{nodes:i.markdown}),(0,N.jsx)(`p`,{id:`vault-status`,className:`text-sm text-warn`,"aria-live":`polite`,children:o})]})]})}function H({companion:e,open:t,text:n}){let[r,i]=(0,j.useState)(n);(0,j.useEffect)(()=>{let e=setTimeout(()=>i(n),250);return()=>clearTimeout(e)},[n]);let a=o(`(min-width: 64rem)`),s=r===t.content,c=S({queryKey:[`vault-preview`,e,t.path,r],queryFn:()=>v({data:{companion:e,path:t.path,content:r}}),placeholderData:e=>e,enabled:a&&!s,gcTime:0}),l=s?t.markdown:c.data;return(0,N.jsxs)(`div`,{className:`vault-preview min-h-0 overflow-auto max-lg:hidden`,"aria-label":`Preview`,role:`region`,"data-vault-preview":!0,children:[(0,N.jsx)(`p`,{className:`m-0 px-7 pt-3 text-xs font-semibold text-muted`,children:`Preview`}),(0,N.jsx)(`div`,{className:`prose px-7 pt-2 pb-16 text-sm`,children:l?(0,N.jsx)(A,{nodes:l}):null})]})}function ne({companion:e,data:t,crumbs:r}){let i=t.open,a=c(),o=y(),[u,d]=(0,j.useState)(i.content),[f,m]=(0,j.useState)(i.content),[h,g]=(0,j.useState)(i.token),[v,b]=(0,j.useState)(``),[S,C]=(0,j.useState)(null),w=u!==f,T=(0,j.useRef)(w);(0,j.useEffect)(()=>{T.current=w},[w]);let E=n(e=>e.setDirty);(0,j.useEffect)(()=>E(w),[w,E]),(0,j.useEffect)(()=>()=>E(!1),[E]),ee({shouldBlockFn:()=>T.current&&!window.confirm(`Discard unsaved changes?`),enableBeforeUnload:()=>T.current}),P(e,i.path,e=>{if(e.kind===`removed`){b(`this file no longer exists on disk`);return}let t={content:e.content??``,token:e.token??``};e.kind===`overwritten`?(C(t),b(`a version was overwritten; its content is available below`)):w?(C(t),b(`the file changed on disk; unsaved content is still in the editor`)):(d(t.content),m(t.content),g(t.token),b(`updated from disk`))});let O=s({mutationFn:()=>_({data:{companion:e,path:i.path,content:u,token:h}}),onSuccess:t=>{t.kind===`conflict`?(C({content:t.content,token:t.token}),b(t.reason||`save refused`)):(g(t.token),m(u),T.current=!1,E(!1),b(`saved`),p(a,e),o({to:`/vault`,search:e=>({...e,mode:void 0}),resetScroll:!1}))},onError:e=>b(e.message||`save failed`)});return(0,N.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,"data-vault-root":!0,"data-vault-mode":`edit`,"data-vault-path":i.path,children:[(0,N.jsxs)(F,{crumbs:r,children:[w?(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-warn`,children:[(0,N.jsx)(`span`,{className:`size-[7px] rounded-full bg-current`,"aria-hidden":`true`}),`Unsaved`]}):null,(0,N.jsxs)(x,{className:L,id:`vault-mode-read`,to:`/vault`,search:e=>({...e,mode:void 0}),"data-vault-mode-link":!0,children:[(0,N.jsx)(D,{name:`eye`,className:`size-3.5`}),`Read`]}),(0,N.jsx)(k,{variant:`primary`,size:`sm`,id:`vault-save`,onClick:()=>O.mutate(),disabled:O.isPending,children:`Save`})]}),(0,N.jsxs)(`div`,{className:v||S?`grid gap-2 border-b border-rule-soft px-6 py-2.5 text-sm`:`sr-only`,children:[(0,N.jsx)(`p`,{id:`vault-status`,className:`m-0 text-warn`,"aria-live":`polite`,children:v}),S?(0,N.jsxs)(`div`,{id:`vault-incoming`,className:`grid gap-2`,children:[(0,N.jsx)(`strong`,{id:`vault-incoming-title`,className:`text-sm`,children:`Incoming version`}),(0,N.jsx)(`pre`,{id:`vault-incoming-content`,className:`m-0 max-h-40 overflow-auto rounded-control border border-rule bg-surface p-3 font-mono text-xs whitespace-pre-wrap`,children:S.content}),(0,N.jsx)(k,{size:`sm`,id:`vault-recover`,className:`justify-self-start`,onClick:()=>{d(S.content),m(S.content),S.token&&g(S.token),C(null),b(`incoming version loaded into the editor`)},children:`Put incoming content back`})]}):null]}),(0,N.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-2 max-lg:grid-cols-1`,children:[(0,N.jsx)(`textarea`,{id:`vault-editor`,"data-vault-editor":!0,"data-vault-path":i.path,"aria-label":`Markdown source of ${B(i.path)}`,spellCheck:!1,value:u,onChange:e=>d(e.target.value),className:l(`min-h-[60vh] resize-none border-0 border-r border-rule-soft bg-transparent px-6 pt-4 pb-10 font-mono text-[0.86rem] leading-[1.75] text-text outline-none focus-visible:outline-none max-lg:border-r-0`)}),(0,N.jsx)(H,{companion:e,open:i,text:u})]})]})}var U=e=>e.split(`/`).filter(Boolean),W=`flex w-full min-w-0 items-center gap-2 rounded-[6px] border-0 bg-transparent px-2.5 py-1.5 text-left text-sm text-text no-underline hover:bg-surface aria-[current=page]:bg-accent-soft aria-[current=page]:font-semibold`;function G({entry:e,current:t,label:n}){return(0,N.jsxs)(x,{to:`/vault`,search:t=>({...t,path:e.path,dir:void 0,mode:void 0}),className:l(W,`vault-file`),"data-vault-entry":e.path,"aria-current":t?`page`:void 0,children:[(0,N.jsx)(D,{name:`doc`,className:l(`size-3.5`,t?`text-accent`:`text-muted`)}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n??e.name})]})}function K({dir:e,className:t,children:n}){return(0,N.jsx)(x,{to:`/vault`,search:t=>({...t,path:void 0,dir:e??void 0,mode:void 0}),className:t,children:n})}function q({entry:e,companion:t,search:n}){return e.kind===`file`?(0,N.jsx)(G,{entry:e,current:n.path===e.path}):(0,N.jsx)(re,{entry:e,companion:t,search:n})}function re({entry:e,companion:t,search:n}){let[r,i]=(0,j.useState)(e.children!==void 0),a=S({...u(t,e.path),enabled:r&&e.children===void 0}),o=e.children??a.data?.entries;return(0,N.jsxs)(`details`,{className:`vault-directory group/dir`,open:r,"data-vault-dir":e.path,onToggle:e=>i(e.currentTarget.open),children:[(0,N.jsxs)(`summary`,{className:l(W,`cursor-pointer list-none font-semibold [&::-webkit-details-marker]:hidden`),"aria-current":n.dir===e.path?`page`:void 0,children:[(0,N.jsx)(D,{name:`right`,className:`size-3 text-muted transition-transform group-open/dir:rotate-90`}),(0,N.jsx)(D,{name:`folder`,className:`size-3.5 text-muted`}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]}),(0,N.jsxs)(`div`,{className:`vault-children grid gap-px pl-3.5`,children:[r&&o?o.map(e=>(0,N.jsx)(q,{entry:e,companion:t,search:n},e.path)):null,a.error?(0,N.jsx)(`p`,{className:`vault-warning m-0 px-2.5 py-1 text-xs text-warn`,children:a.error.message}):null]})]})}var J=`m-0 px-2.5 py-1.5 text-sm text-muted`,Y=`vault-warning m-0 px-2.5 py-1.5 text-xs text-warn`;function ie({data:e,companion:t,search:n}){return e.failure?(0,N.jsx)(`div`,{"data-vault-slot":`tree`,children:(0,N.jsxs)(`p`,{className:Y,children:[`The files could not be listed: `,e.failure]})}):e.tree===null?(0,N.jsx)(`div`,{"data-vault-slot":`tree`,"aria-busy":`true`,children:(0,N.jsx)(`p`,{className:l(J,`empty`),children:`Listing files…`})}):(0,N.jsxs)(`div`,{"data-vault-slot":`tree`,"data-vault-generation":e.generation??void 0,children:[(0,N.jsx)(ae,{data:e}),e.tree.length===0?(0,N.jsx)(`p`,{className:l(J,`empty`),children:`This companion has no markdown files.`}):(0,N.jsx)(`nav`,{className:`vault-tree grid gap-px`,"aria-label":`Markdown files`,children:e.tree.map(e=>(0,N.jsx)(q,{entry:e,companion:t,search:n},e.path))})]})}function ae({data:e}){return e.warning?(0,N.jsxs)(`p`,{className:Y,children:[e.warning,`. The tree may be out of date.`]}):e.watching?null:(0,N.jsx)(`p`,{className:Y,children:`The tree may be out of date.`})}function oe({companion:e,query:t,search:n}){let[r,i]=(0,j.useState)(t);(0,j.useEffect)(()=>{let e=setTimeout(()=>i(t),150);return()=>clearTimeout(e)},[t]);let a=S({...f(e,r),enabled:r.trim().length>0});if(!a.data)return null;let{shown:o,total:s}=a.data,c=s-o.length;return(0,N.jsxs)(`div`,{"data-vault-filter-results":!0,children:[o.length===0?(0,N.jsx)(`p`,{className:l(J,`empty`),children:`No files match.`}):(0,N.jsx)(`nav`,{className:`vault-tree vault-results grid gap-px`,"aria-label":`Matching files`,children:o.map(e=>(0,N.jsx)(G,{entry:e,current:n.path===e.path,label:e.path},e.path))}),c>0?(0,N.jsxs)(`p`,{className:J,"data-vault-more":!0,children:[c,` more match`,c===1?``:`es`,`; refine the filter.`]}):null]})}var X=`vault-crumb rounded-[6px] px-1.5 py-0.5 text-sm text-muted no-underline hover:bg-surface hover:text-text`;function se({rootName:e,search:t}){let n=U(t.path??t.dir??``);return(0,N.jsx)(`nav`,{className:`vault-breadcrumb min-w-0`,"aria-label":`Breadcrumb`,"data-vault-crumb":!0,children:(0,N.jsxs)(`ol`,{className:`m-0 flex min-w-0 list-none items-center gap-0.5 overflow-hidden p-0 text-sm text-muted`,children:[(0,N.jsx)(`li`,{className:`flex-none`,children:n.length===0?(0,N.jsx)(`span`,{"aria-current":`page`,className:`px-1.5 font-semibold text-text`,children:e}):(0,N.jsx)(K,{dir:null,className:X,children:e})}),n.map((e,t)=>{let r=n.slice(0,t+1).join(`/`),i=t===n.length-1;return(0,N.jsxs)(`li`,{className:l(`flex items-center gap-0.5`,i?`min-w-0`:`flex-none max-md:hidden`),children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i?(0,N.jsx)(`span`,{"aria-current":`page`,className:`truncate px-1.5 font-semibold text-text`,children:e}):(0,N.jsx)(K,{dir:r,className:X,children:e})]},r)})]})})}function ce(e,t){let n=e;for(let e of U(t)){let t=n?.find(t=>t.kind===`directory`&&t.name===e);if(!t)return null;n=t.children}return n??null}function le({data:e,rootName:t}){let n=e.failure?(0,N.jsxs)(`p`,{className:Y,children:[`The files could not be listed: `,e.failure]}):e.tree===null?(0,N.jsx)(`p`,{className:l(J,`empty`),children:`Listing files…`}):null,r=e.dir?U(e.dir):[],i=r.at(-1)??t;if(n)return(0,N.jsx)(`div`,{"data-vault-slot":`listing`,className:`vault-listing mx-auto w-full max-w-[820px] px-10 py-8`,"aria-busy":e.tree===null,children:n});let a=(e.dir?ce(e.tree,e.dir):null)??e.tree;return(0,N.jsxs)(`div`,{"data-vault-slot":`listing`,className:`vault-listing mx-auto grid w-full max-w-[820px] gap-4 px-10 py-8 max-sm:px-4`,children:[(0,N.jsx)(`h1`,{className:`m-0 text-xl font-semibold`,children:i}),e.dirMissing?(0,N.jsx)(`p`,{className:Y,children:`That folder is not in the tree; showing the root.`}):null,a.length===0&&r.length===0?(0,N.jsx)(`p`,{className:l(J,`empty`),children:`This companion has no markdown files.`}):(0,N.jsx)(T,{title:`In this folder`,count:a.length,children:(0,N.jsxs)(`ul`,{className:`vault-rows m-0 list-none p-0`,"aria-label":`Folder contents`,children:[r.length>0?(0,N.jsx)(`li`,{children:(0,N.jsxs)(K,{dir:r.length>1?r.slice(0,-1).join(`/`):null,className:l(O,`vault-row py-1.5`),children:[(0,N.jsx)(D,{name:`left`,className:`text-muted`}),(0,N.jsx)(`span`,{children:`..`})]})}):null,a.map(e=>(0,N.jsx)(`li`,{children:e.kind===`directory`?(0,N.jsxs)(K,{dir:e.path,className:l(O,`vault-row py-1.5 font-semibold`),children:[(0,N.jsx)(D,{name:`folder`,className:`text-muted`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.name})]}):(0,N.jsxs)(x,{to:`/vault`,search:t=>({...t,path:e.path,dir:void 0,mode:void 0}),className:l(O,`vault-row py-1.5`),children:[(0,N.jsx)(D,{name:`doc`,className:`text-muted`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.path))]})})]})}function Z(e){return typeof e==`string`?e:(e.c??[]).map(Z).join(``)}function ue(e){return(e??[]).filter(e=>typeof e!=`string`&&e.t===`h2`).map((e,t)=>({index:t,text:Z(e)}))}var Q=e=>[...e?.querySelectorAll(`article .markdown-body h2`)??[]];function de(e,t,n){let[r,i]=(0,j.useState)(null);return(0,j.useEffect)(()=>{if(!t)return;let n=e.current,r=Q(n);if(r.length===0||typeof IntersectionObserver>`u`)return;let a=new IntersectionObserver(e=>{let t=e.find(e=>e.isIntersecting);t&&i(r.indexOf(t.target))},{root:n,rootMargin:`-60px 0px -70% 0px`});for(let e of r)a.observe(e);return()=>a.disconnect()},[e,t]),{current:r!==null&&r<n?r:0,go:t=>{Q(e.current)[t]?.scrollIntoView({behavior:`smooth`,block:`start`}),i(t)}}}function fe({headings:e,current:t,go:n}){return(0,N.jsxs)(`nav`,{className:`vault-outline min-h-0 overflow-auto border-l border-rule-soft px-5 pt-[72px] pb-6 @max-[1080px]:hidden`,"aria-label":`Outline`,children:[(0,N.jsx)(`h2`,{className:`m-0 mb-2 text-xs font-semibold text-muted`,children:`On this page`}),(0,N.jsx)(`ol`,{className:`m-0 grid list-none gap-0.5 p-0`,children:e.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsx)(`button`,{type:`button`,className:l(`block w-full truncate rounded-r-[8px] border-0 bg-transparent px-2.5 py-1 text-left text-sm text-text hover:bg-surface`,t===e.index&&`font-semibold text-accent shadow-[inset_2px_0_0_var(--accent)]`),"aria-current":t===e.index?`location`:void 0,onClick:()=>n(e.index),children:e.text})},e.index))})]})}var pe=[],$=(e,t)=>[e?`272px`:null,`minmax(0,1fr)`,t?`232px`:null].filter(Boolean).join(` `);function me({data:e,companion:t,search:n,stale:i,refresh:a,filter:o,setFilter:s,hidden:c}){return(0,N.jsxs)(`aside`,{hidden:c,className:`vault-tree-panel flex min-h-0 flex-col border-r border-rule @max-[720px]:max-h-[40vh] @max-[720px]:border-r-0 @max-[720px]:border-b`,id:`vault-tree-panel`,"aria-label":`Files`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between pt-3 pr-2.5 pb-2 pl-5`,children:[(0,N.jsx)(`strong`,{className:`text-sm`,children:`Files`}),(0,N.jsx)(r,{label:`Refresh tree`,side:`bottom`,children:(0,N.jsx)(k,{size:`icon-sm`,variant:`ghost`,"aria-label":a.isPending?`Refreshing…`:`Refresh tree`,onClick:()=>a.mutate(),disabled:a.isPending,children:(0,N.jsx)(D,{name:`refresh`,className:a.isPending?`animate-spin`:void 0})})})]}),(0,N.jsx)(`p`,{id:`vault-stale`,className:Y+` mx-2.5`,role:`status`,hidden:!i,children:`Files changed — refresh tree.`}),a.error?(0,N.jsx)(`p`,{className:Y+` mx-2.5`,role:`status`,children:a.error.message}):null,(0,N.jsxs)(`label`,{className:`mx-3.5 mb-2 flex h-[34px] items-center gap-2 rounded-control border border-rule bg-surface pr-2 pl-2.5 text-muted focus-within:border-accent`,children:[(0,N.jsx)(D,{name:`search`,className:`size-3.5`}),(0,N.jsx)(`input`,{type:`search`,id:`vault-filter`,className:`vault-filter min-w-0 flex-1 border-0 bg-transparent text-sm text-text outline-none placeholder:text-muted`,placeholder:`Go to file`,"aria-label":`Go to file`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Escape`&&s(``)}})]}),(0,N.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-2.5 pb-6`,children:o.trim()?(0,N.jsx)(oe,{companion:t,query:o,search:n}):(0,N.jsx)(ie,{data:e,companion:t,search:n})})]})}function he({companion:e,rootName:t,writable:a,search:o}){let l=c(),u=S(E(e,o)),f=S({...E(e,o,!0),enabled:!(!u.data||u.data.tree!==null||u.data.failure)}).data??u.data,[p,m]=(0,j.useState)(``),g=n(e=>e.latestGeneration),_=n(e=>e.treeHidden),v=n(e=>e.toggleTree),y=n(e=>e.hydrate);(0,j.useEffect)(y,[y]);let b=s({mutationFn:()=>d({data:{companion:e,path:o.path,dir:o.dir,refresh:!0,wait:!0}}),onSuccess:t=>void h(l,e,o,t)}),x=(0,j.useRef)(null),C=!!f?.open&&o.mode!==`edit`,w=C?ue(f?.open?.markdown):pe,T=de(x,C?f?.open?.markdown:void 0,w.length);if(!f)return(0,N.jsx)(i,{});let O=g!==null&&f.generation!==null&&g>f.generation,A=w.length>0,M=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(r,{label:_?`Show files`:`Hide files`,side:`bottom`,children:(0,N.jsx)(k,{size:`icon-sm`,variant:`ghost`,id:`vault-tree-toggle`,"aria-controls":`vault-tree-panel`,"aria-expanded":!_,"aria-label":_?`Show files`:`Hide files`,onClick:v,children:(0,N.jsx)(D,{name:`sidebar`})})}),(0,N.jsx)(se,{rootName:t,search:o})]});return(0,N.jsx)(`div`,{className:`@container flex min-h-0 flex-1 flex-col`,children:(0,N.jsxs)(`section`,{className:`vault-layout grid min-h-0 flex-1 border-t border-rule @max-[720px]:grid-cols-1!`,style:{"--vault-wide":$(!0,A),"--vault-wide-bare":$(!1,A),"--vault-narrow":$(!0,!1),"--vault-narrow-bare":$(!1,!1)},"data-vault-layout":!0,children:[(0,N.jsx)(me,{data:f,companion:e,search:o,stale:O,refresh:b,filter:p,setFilter:m,hidden:_}),(0,N.jsx)(`div`,{ref:x,className:`vault-main min-h-0 min-w-0 overflow-auto scroll-smooth`,"data-vault-main":!0,"data-vault-pane":!0,children:o.path||f.open||f.refusal?(0,N.jsx)(z,{companion:e,data:f,writable:a,search:o,crumbs:M}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(F,{crumbs:M}),(0,N.jsx)(le,{data:f,rootName:t})]})}),A?(0,N.jsx)(fe,{headings:w,...T}):null]})})}function ge(){let e=a.useSearch(),{data:n}=t(g({companion:e.companion,studioMode:e.studioMode}));if(!e.companion||!n.selected)return null;let r=n.selected.path.split(/[\\/]/).findLast(Boolean)??`companion`;return(0,N.jsx)(he,{companion:e.companion,rootName:r,writable:n.writable,search:{path:e.path,dir:e.dir,mode:e.mode}})}export{ge as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ar as e,da as t,rt as n}from"./button-BIIHE0EQ.js";var r=t();function i({warnings:t}){return t.length===0?null:(0,r.jsx)(`section`,{className:e(n,`pb-4`),"aria-label":`Warnings`,children:(0,r.jsxs)(`div`,{className:`warnings grid gap-1.5 rounded-card border border-[color-mix(in_srgb,var(--warn)_35%,var(--border))] bg-warn-soft px-4 py-3 text-sm`,children:[(0,r.jsx)(`h2`,{className:`m-0 text-sm font-semibold text-warn`,children:`Some data could not be read`}),(0,r.jsx)(`ul`,{className:`m-0 grid list-none gap-1 p-0`,children:t.map(e=>(0,r.jsx)(`li`,{children:e},e))})]})})}export{i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{da as e,ki as t,zr as n}from"./button-BIIHE0EQ.js";import{T as r,t as i,y as a}from"./index-B3wkMzjA.js";import{t as o}from"./companion-view-DM6YyXaR.js";import{t as s}from"./warnings-BSXIyuSQ.js";import{t as c}from"./delivery-path-DELxj0Av.js";var l=e(),u=[{node:`propose`,label:`Propose change`},{node:`reviews`,label:`Human review`},{node:`apply`,label:`Apply change`},{node:`archive`,label:`Archive change`}];function d(e){let t=u.map(t=>({...t,changes:e.flatMap(e=>r(e).stage===t.label?[e.name]:[])})),n={};for(let e of t)e.changes.length>0&&(n[e.node]=e.changes.length);return{counts:n,byStage:t}}var f=[];function p({payload:e,changes:t=f}){let{counts:n,byStage:r}=d(t);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{warnings:e.warnings}),(0,l.jsx)(`div`,{className:`workflow-view`,children:(0,l.jsx)(c,{payload:e,counts:n,changesByStage:r})})]})}var m=function(){let e=i.useSearch(),r=a(),s=t({...n(`dashboard`,e),enabled:r});return(0,l.jsx)(o,{view:`workflow`,search:e,children:e=>(0,l.jsx)(p,{payload:{skills:e.skills??[],topology:e.topology??null,warnings:e.warnings},changes:s.data?.changes??[]})})};export{m as component};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { t as createServerRpc } from "./createServerRpc-tK2lE9R2.js";
|
|
2
|
-
import { t as createServerFn } from "./createServerFn-F5sAOF8V.js";
|
|
3
|
-
import { l as COMPANION_DIGEST_PATTERN } from "./studio-BeltxxKt.js";
|
|
4
|
-
// src/server/companions.ts?tss-serverfn-split
|
|
5
|
-
/** Deletes a registered companion's folder and unregisters it; core refuses unless writable. */
|
|
6
|
-
var deleteCompanion_createServerFn_handler = createServerRpc({
|
|
7
|
-
id: "9d1ee2ce056a1b26a05141623f6d836fa1c4c283e555132764a528a212e3c50a",
|
|
8
|
-
name: "deleteCompanion",
|
|
9
|
-
filename: "src/server/companions.ts"
|
|
10
|
-
}, (opts) => deleteCompanion.__executeServer(opts));
|
|
11
|
-
var deleteCompanion = createServerFn({ method: "POST" }).validator((input) => {
|
|
12
|
-
if (typeof input?.companion !== "string" || !COMPANION_DIGEST_PATTERN.test(input.companion)) throw new Error("no registered companion was named");
|
|
13
|
-
return { companion: input.companion };
|
|
14
|
-
}).handler(deleteCompanion_createServerFn_handler, ({ data, context }) => context.studio.deleteCompanion(data.companion));
|
|
15
|
-
export { deleteCompanion_createServerFn_handler };
|