@uniqbit/mate-core 1.0.0-canary.7 → 1.0.0-canary.9
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/package.json +6 -3
- package/src/cli/commands/artifact/delivery/submit.ts +6 -4
- package/src/cli/commands/artifact/finish/command.ts +28 -11
- package/src/cli/commands/artifact/pending/command.ts +71 -7
- package/src/cli/commands/cap/tokensave.ts +2 -2
- package/src/cli/commands/companion/update.ts +2 -3
- package/src/cli/commands/doctor.ts +33 -4
- package/src/cli/commands/install.ts +8 -4
- package/src/cli/commands/plugin/install.ts +82 -35
- package/src/cli/commands/studio/service-host.ts +3 -0
- package/src/cli/commands/triage.ts +32 -11
- package/src/cli/commands/vscode/release-vsix.json +2 -2
- package/src/cli/install-plan.tsx +3 -0
- package/src/cli/main.ts +51 -7
- package/src/cli/usage.ts +3 -3
- package/src/create-mate.ts +4 -1
- package/src/factory-host.ts +6 -0
- package/src/index.ts +1 -0
- package/src/lib/delivery/merge-git.ts +31 -7
- package/src/lib/delivery/overlap.ts +14 -1
- package/src/lib/delivery/repository-access.ts +11 -6
- package/src/lib/delivery/staging/apply-chain.ts +25 -7
- package/src/lib/delivery/staging/linked-merges.ts +175 -0
- package/src/lib/delivery/staging/naming.ts +3 -0
- package/src/lib/delivery/staging/openspec-type.ts +38 -7
- package/src/lib/delivery/staging/pending.ts +153 -11
- package/src/lib/delivery/staging/preflight.ts +239 -0
- package/src/lib/delivery/staging/project.ts +243 -104
- package/src/lib/delivery/staging/replay.ts +5 -3
- package/src/lib/delivery/staging/settle-linked.ts +5 -119
- package/src/lib/delivery/staging/submit.ts +139 -18
- package/src/lib/delivery/submit-change.ts +163 -37
- package/src/lib/friction/mark.ts +49 -11
- package/src/lib/friction/view/read.ts +10 -1
- package/src/lib/mcp-manager/resolve.ts +70 -0
- package/src/lib/mcp-manager/store.ts +109 -0
- package/src/lib/mcp-manager/types.ts +58 -0
- package/src/lib/mcp-manager/validate.ts +246 -0
- package/src/lib/openspec-cli.ts +10 -5
- package/src/lib/orchestrator/config-store.ts +30 -7
- package/src/lib/orchestrator/engine-floor.ts +16 -4
- package/src/lib/orchestrator/engine-guard.ts +7 -1
- package/src/lib/orchestrator/types.ts +4 -0
- package/src/lib/skills-cli.ts +38 -0
- package/src/lib/tool-manifest.ts +73 -0
- package/src/lib/triage/context.ts +138 -12
- package/src/lib/triage/prepare.ts +19 -4
- package/src/plugin-api.ts +1 -0
- package/src/runtime/command-arg.ts +15 -0
- package/src/runtime/companion-guidance.ts +1 -1
- package/src/runtime/friction-log.ts +41 -17
- package/src/runtime/friction-recorder.ts +15 -2
- package/src/runtime/git-tracked.ts +13 -2
- package/src/runtime/workflow/turn.ts +14 -12
- package/src/studio.ts +23 -1
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +5 -1
- package/src/templates/capabilities/react-doctor/mate-react-doctor/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +42 -4
- package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +27 -2
- package/src/templates/mate-skills/agents/mate-backfill-spec/SKILL.md +23 -1
- package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +26 -1
- package/src/templates/mate-skills/agents/mate-domain-modeling/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +28 -3
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-grill-with-docs/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-grilling/SKILL.md +25 -0
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +28 -3
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +28 -6
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +27 -2
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +24 -2
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +42 -4
- package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +27 -2
- package/src/templates/mate-skills/claude/mate-backfill-spec/SKILL.md +23 -1
- package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +26 -1
- package/src/templates/mate-skills/claude/mate-domain-modeling/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +28 -3
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-grill-with-docs/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-grilling/SKILL.md +25 -0
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +28 -3
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +28 -6
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +27 -2
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +24 -2
- package/src/templates/triage/PLAYBOOK.md +9 -1
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +108 -108
- package/src/tools/setup/capabilities/graphify.ts +23 -1
- package/src/tools/setup/capabilities/mcp-manager.ts +74 -0
- package/src/tools/setup/capabilities/rtk.ts +27 -86
- package/src/tools/setup/capabilities/tokensave.ts +76 -54
- package/src/tools/setup/context-services.ts +35 -6
- package/src/tools/setup/dynamic-plugins/audiences.ts +31 -16
- package/src/tools/setup/dynamic-plugins/hydrate.ts +32 -14
- package/src/tools/setup/dynamic-plugins/install.ts +2 -0
- package/src/tools/setup/dynamic-plugins/installed.ts +73 -0
- package/src/tools/setup/dynamic-plugins/loader.ts +12 -10
- package/src/tools/setup/dynamic-plugins/local.ts +492 -0
- package/src/tools/setup/dynamic-plugins/paths.ts +34 -6
- package/src/tools/setup/dynamic-plugins/verify.ts +34 -14
- package/src/tools/setup/dynamic-plugins/workspaces.ts +17 -8
- package/src/tools/setup/engine.ts +55 -3
- package/src/tools/setup/mate.ts +26 -1
- package/src/tools/setup/plugin.ts +14 -0
- package/src/tools/setup/plugins/gitignore.ts +45 -12
- package/src/tools/setup/providers/claude-format.ts +39 -2
- package/src/tools/setup/providers/claude.ts +10 -0
- package/src/tools/setup/providers/opencode-format.ts +13 -3
- package/src/tools/setup/service.ts +8 -0
- package/src/tools/setup/utils.ts +10 -1
- package/studio-dist/client/assets/app-ggXJ_QVh.css +2 -0
- package/studio-dist/client/assets/button-C9SQW3kI.js +1 -0
- package/studio-dist/client/assets/cn-DC80MJV0.js +1 -0
- package/studio-dist/client/assets/combobox-D7mKYCBb.js +1 -0
- package/studio-dist/client/assets/{companion-view-DINdPF-b.js → companion-view-C1F0_jbt.js} +1 -1
- package/studio-dist/client/assets/fields-CEep8IFT.js +1 -0
- package/studio-dist/client/assets/friction-D9dBU7WN.js +1 -0
- package/studio-dist/client/assets/getting-started-BDyGvHhc.js +1 -0
- package/studio-dist/client/assets/{getting-started-djaQeWlu.js → getting-started-BN4aTpsz.js} +1 -1
- package/studio-dist/client/assets/getting-started._topic-B9ajbF4o.js +1 -0
- package/studio-dist/client/assets/getting-started.index-CYiBPtb7.js +1 -0
- package/studio-dist/client/assets/graph-ah7ZXfTa.js +2 -0
- package/studio-dist/client/assets/{graph-canvas-DIcAqwtK.js → graph-canvas-Be5qgdDt.js} +1 -1
- package/studio-dist/client/assets/guides-CsL0660B.js +1 -0
- package/studio-dist/client/assets/index-zmRH87D4.js +40 -0
- package/studio-dist/client/assets/{markdown-view-jMiaBTSO.js → markdown-view-dku7MGPn.js} +1 -1
- package/studio-dist/client/assets/panel-COgk0vP5.js +1 -0
- package/studio-dist/client/assets/plugins._service._view-Cn3WBHab.js +1 -0
- package/studio-dist/client/assets/{prepaint-CKsXyJOR.js → prepaint-BkoDSw5X.js} +1 -1
- package/studio-dist/client/assets/{queries-Dfp5deWj.js → queries-CMvC2OkU.js} +1 -1
- package/studio-dist/client/assets/reports-C_AqLBYH.js +1 -0
- package/studio-dist/client/assets/routes-BokQmHtC.js +1 -0
- package/studio-dist/client/assets/{search-CXosfvYh.js → search-DxidNK2M.js} +1 -1
- package/studio-dist/client/assets/select-CYFCbHUd.js +1 -0
- package/studio-dist/client/assets/skills-R3vttWHM.js +1 -0
- package/studio-dist/client/assets/{specs-Dl8HfGlU.js → specs-Bqd1ajyD.js} +1 -1
- package/studio-dist/client/assets/specs-view-znqFPx9p.js +1 -0
- package/studio-dist/client/assets/{steps-CKUno4lh.js → steps-tVDWn7j6.js} +1 -1
- package/studio-dist/client/assets/{store-DyXbi6o9.js → store-BYnEU33C.js} +1 -1
- package/studio-dist/client/assets/studio-ndtFcS2Y.js +100 -0
- package/studio-dist/client/assets/{studio-queries-BflKt9va.js → studio-queries-CkUSByy7.js} +1 -1
- package/studio-dist/client/assets/{usage-Blcl8kA_.js → usage-Kuhr8dSl.js} +13 -13
- package/studio-dist/client/assets/{useAnchoredPopupScrollLock-BBXJpX5L.js → useAnchoredPopupScrollLock-dc_kP4Go.js} +1 -1
- package/studio-dist/client/assets/useMutation-CqtM9COw.js +1 -0
- package/studio-dist/client/assets/vault-CSP8kwRg.js +1 -0
- package/studio-dist/client/assets/warnings-Cnw99ugO.js +1 -0
- package/studio-dist/client/assets/workflow-BPJAmmZi.js +1 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-JoHQ5ihx.js → __23tanstack-start-server-fn-resolver-CS3QRY4Q.js} +18 -18
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +58 -58
- package/studio-dist/server/assets/{button-B7e1fRyW.js → button-Ct_WeYLc.js} +3 -3480
- package/studio-dist/server/assets/cn-DWFJaP_9.js +5528 -0
- package/studio-dist/server/assets/{combobox--S_OmUfh.js → combobox-17vO5Uz8.js} +6 -5
- package/studio-dist/server/assets/{companion-view-D-vGM55e.js → companion-view-JkxnGLlp.js} +2 -2
- package/studio-dist/server/assets/{companions-Dr6IpNAb.js → companions-YNLsbnch.js} +1 -1
- package/studio-dist/server/assets/{fields-B4qM2ZwC.js → fields-VytPpqBq.js} +2 -1
- package/studio-dist/server/assets/{friction-sLxaWY-H.js → friction-B6osqFSm.js} +56 -16
- package/studio-dist/server/assets/{friction-CWOTjpCV.js → friction-BW86PCPM.js} +2 -2
- package/studio-dist/server/assets/{getting-started-Cq5Pcnsr.js → getting-started-CFHSeX5h.js} +2 -2
- package/studio-dist/server/assets/{getting-started._topic-CmWdl3u3.js → getting-started._topic-BK2eU6AS.js} +2 -2
- package/studio-dist/server/assets/{getting-started.index-AB8xpTFY.js → getting-started.index-DZLuXnNO.js} +2 -2
- package/studio-dist/server/assets/{graph-C_Hn-Wf_.js → graph-BJVZBevL.js} +8 -7
- package/studio-dist/server/assets/{graph-B11ITte0.js → graph-DGZHV-Ek.js} +1 -1
- package/studio-dist/server/assets/{graph-canvas-BthrSmPS.js → graph-canvas-lrNT6jbl.js} +2 -2
- package/studio-dist/server/assets/{guides-B8HdeK_C.js → guides-CEwLOZb9.js} +1 -1
- package/studio-dist/server/assets/{guides-BVQ4pt5B.js → guides-_G8Vucsk.js} +1 -1
- package/studio-dist/server/assets/{guides.server-DqFQAStf.js → guides.server-ZWFKX2XJ.js} +1 -1
- package/studio-dist/server/assets/{markdown-view-rwiiVcPC.js → markdown-view-Bmjghg_Z.js} +1 -1
- package/studio-dist/server/assets/{panel-CUxRIpYL.js → panel-DvRjyil3.js} +4 -3
- package/studio-dist/server/assets/{plugins._service._view-BSvGnlhU.js → plugins._service._view-B32LzraG.js} +8 -5
- package/studio-dist/server/assets/{prepaint-B28ClcPN.js → prepaint-BEHwKl51.js} +1 -1
- package/studio-dist/server/assets/{queries-S_Pl90IG.js → queries-D6Vq0AuZ.js} +1 -1
- package/studio-dist/server/assets/{reports-B9k98oE6.js → reports-DDaH5k0H.js} +1 -1
- package/studio-dist/server/assets/{reports-CJpAItPk.js → reports-Dn92pLap.js} +7 -6
- package/studio-dist/server/assets/{router-DF0etoNa.js → router-Bjf4S9tO.js} +57 -32
- package/studio-dist/server/assets/{routes-6ylCLkyg.js → routes-B4sNiE0X.js} +8 -7
- package/studio-dist/server/assets/{search-b-yQesv3.js → search-DKeJRvg8.js} +1 -1
- package/studio-dist/server/assets/{select-CjuKScan.js → select-CVHYL7oR.js} +5 -4
- package/studio-dist/server/assets/{shell-DLkP7wG9.js → shell-BxbYYaAk.js} +4 -3
- package/studio-dist/server/assets/{skills-zeU80A9S.js → skills-B4-0qpqN.js} +8 -7
- package/studio-dist/server/assets/{skills-DGg0mWDM.js → skills-Bj8eOgzR.js} +1 -1
- package/studio-dist/server/assets/{specs-DDBNT_v1.js → specs-rfMug6qW.js} +4 -4
- package/studio-dist/server/assets/{specs-view-exvmWdg0.js → specs-view-qi1SE1Sl.js} +10 -9
- package/studio-dist/server/assets/{steps-D1tYAyWZ.js → steps-rger6HJc.js} +1 -1
- package/studio-dist/server/assets/{store-kS7zk0Hr.js → store-Dg9T7oWs.js} +1 -1
- package/studio-dist/server/assets/{studio-qRvQjRpz.js → studio-D79JzDLc.js} +1347 -0
- package/studio-dist/server/assets/{studio-queries-qOXOYoPt.js → studio-queries-CeFfmIuM.js} +3 -3
- package/studio-dist/server/assets/{usage-C2um7YiV.js → usage-BJgYWRCX.js} +10 -10
- package/studio-dist/server/assets/{usage-Cwle9-xY.js → usage-Dw_UQFX-.js} +1 -1
- package/studio-dist/server/assets/{useAnchoredPopupScrollLock-kQBB3y_b.js → useAnchoredPopupScrollLock-ciS_sEq3.js} +2 -2
- package/studio-dist/server/assets/{useMutation-C-WO6hCM.js → useMutation-DnWK0PhO.js} +2 -2
- package/studio-dist/server/assets/{vault-CEBBRLMb.js → vault-BzarssiL.js} +1 -1
- package/studio-dist/server/assets/{vault-B8vgVIH9.js → vault-CvlrLd2H.js} +6 -6
- package/studio-dist/server/assets/{views-UgO0Qz_g.js → views-CAxwKHMK.js} +2 -2
- package/studio-dist/server/assets/{warnings-BxK4VfV5.js → warnings-BpVCugHm.js} +2 -1
- package/studio-dist/server/assets/{workflow-BrTK632u.js → workflow-BdrzcCt8.js} +9 -8
- package/studio-dist/server/server.js +2 -2
- package/tool-manifest.yaml +85 -0
- package/studio-dist/client/assets/app-aIwDxf48.css +0 -2
- package/studio-dist/client/assets/button-CX0sWAJl.js +0 -1
- package/studio-dist/client/assets/combobox-BmA8RjOc.js +0 -1
- package/studio-dist/client/assets/fields-BobQ7zRF.js +0 -1
- package/studio-dist/client/assets/friction-YdYd3zaz.js +0 -1
- package/studio-dist/client/assets/getting-started-CY7NEtTw.js +0 -1
- package/studio-dist/client/assets/getting-started._topic-DVB8e5R9.js +0 -1
- package/studio-dist/client/assets/getting-started.index-DQvLHEr1.js +0 -1
- package/studio-dist/client/assets/graph-DbNnR884.js +0 -2
- package/studio-dist/client/assets/guides-D6T6W_jV.js +0 -1
- package/studio-dist/client/assets/index-CysBCSxM.js +0 -40
- package/studio-dist/client/assets/panel-Csr49lBo.js +0 -1
- package/studio-dist/client/assets/plugins._service._view-CEA_CcPe.js +0 -1
- package/studio-dist/client/assets/reports-CLdgxxkg.js +0 -1
- package/studio-dist/client/assets/routes-DGilWbDE.js +0 -1
- package/studio-dist/client/assets/select-DdebbX7K.js +0 -1
- package/studio-dist/client/assets/skills-C3zNkU8g.js +0 -1
- package/studio-dist/client/assets/specs-view-B_n0Pekv.js +0 -1
- package/studio-dist/client/assets/studio-0ueISxwP.js +0 -100
- package/studio-dist/client/assets/useBaseQuery-C2cjmeH2.js +0 -1
- package/studio-dist/client/assets/useMutation-DI6LbvVa.js +0 -1
- package/studio-dist/client/assets/vault-Cb9DmM1i.js +0 -1
- package/studio-dist/client/assets/warnings-B-rvoW8q.js +0 -1
- package/studio-dist/client/assets/workflow-DN5T19jd.js +0 -1
- package/studio-dist/server/assets/useBaseQuery--iH3rd-T.js +0 -2051
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{A as r,Cn as i,En as a,Et as o,Fr as s,G as c,Kn as l,Nr as u,Ot as d,Qn as f,Qt as p,Sn as m,Tn as h,Tt as ee,W as te,Xt as ne,Y as re,Yt as g,Zt as ie,an as ae,bn as _,c as v,er as y,i as b,in as oe,ir as se,j as ce,jn as x,kn as S,kr as C,or as w,sr as T,tn as le,vr as E,wt as ue,xn as D,yn as O,yr as de,zn as fe}from"./button-CX0sWAJl.js";import{i as pe,s as me,y as he}from"./fields-BobQ7zRF.js";var k=e(t(),1);function ge(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=f}=t,u=e.context.dataRef,d=k.useRef(void 0),p=te(),m=re(),h=k.useMemo(()=>{function t(t,n,r,i){let a=y(l,n,r);t&&i===`touch`&&c>0?m.start(c,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=u.current.openEvent,o=e.select(`domReferenceElement`)!==n;return t&&o||!t||!i?!0:a&&(typeof s==`function`?s():s)?!r(a.type):!1}return{onPointerDown(e){d.current=g(e.pointerType,!0)&&ie(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let s=d.current,c=i.nativeEvent,l=e.select(`open`);if(i.button!==0||r===`click`||g(s,!0)&&o)return;let u=n(l,i.currentTarget,e=>e===`click`||e===`mousedown`),f=a(c),m=ae(f);if(m||s===`virtual`){t(u,c,m?f:i.currentTarget,s);return}let h=i.currentTarget;p.request(()=>{t(u,c,h,s)})},onClick(i){if(r===`mousedown-only`)return;let a=d.current;r===`mousedown`&&a?d.current=void 0:g(a,!0)&&o||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,a)},onKeyDown(){d.current=void 0}}},[u,r,o,l,e,s,i,p,m,c]);return k.useMemo(()=>n?{reference:h}:C,[n,h])}function _e(e){let{open:t=!1,onOpenChange:n,elements:i={}}=e,a=s(),o=r()!=null,c=u(()=>new b({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new v,floatingId:a,syncOnly:!1,nested:o})).current;return w(()=>{let e={open:t,floatingId:a};i.reference!==void 0&&(e.referenceElement=i.reference,e.domReferenceElement=E(i.reference)?i.reference:null),i.floating!==void 0&&(e.floatingElement=i.floating),c.update(e)},[t,a,i.reference,i.floating,c]),c.context.onOpenChange=n,c.context.nested=o,c}function ve(e){return S&&e.movementX===0&&e.movementY===0}function A(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function j(e,t){return A(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function ye(e,t,n){return A(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function be(e,t,n){return A(t,n?e===_:e===D,e===O)}function xe(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:A(t,n?e===D:e===_,e===m)}function M(e,t){let{listRef:n,activeIndex:s,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:m=null,allowEscape:re=!1,loopFocus:g=!1,nested:_=!1,rtl:v=!1,virtual:b=!1,focusItemOnOpen:x=`auto`,focusItemOnHover:S=!0,openOnArrowKeyDown:C=!0,disabledIndices:E=void 0,orientation:D=`vertical`,triggerOrientation:O=D,parentOrientation:pe,id:me,resetOnPointerLeave:ge=!0,externalTree:_e,nestedReturnFocusRef:A,grid:M}=t,Se=M!=null,N=e.useState(`open`),P=e.useState(`floatingElement`),F=e.useState(`domReferenceElement`),Ce=e.context.dataRef,I=le(P),L=oe(F),R=c(I),z=r(),B=ce(_e),V=k.useRef(x),H=k.useRef(m??-1),U=k.useRef(null),W=k.useRef(!0),G=T(e=>{u(H.current===-1?null:H.current,e)}),K=k.useRef(!!P),we=k.useRef(N),q=k.useRef(!1),J=k.useRef(!1),Y=k.useRef(null),Te=c(E),X=c(N),Z=c(m),Ee=c(ge),De=te(),Oe=te(),ke=T(()=>{De.cancel();function e(e){b||(Y.current=he(e,{sync:q.current,preventScroll:!0}))}let t=n.current[H.current],r=J.current;t&&e(t),(q.current?e=>e():e=>De.request(e))(()=>{let i=n.current[H.current]||t;i&&(t||e(i),Ne&&(r||!W.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});w(()=>{Ce.current.orientation=D},[Ce,D]),w(()=>{N||(U.current=null),N&&x===`auto`||(V.current=x)},[N,x]),w(()=>{f&&(N&&P?(H.current=m??-1,V.current&&m!=null&&(J.current=!0,G())):K.current&&(H.current=-1,G()))},[f,N,P,m,G]),w(()=>{if(f){if(!N)q.current=!1;else if(P){if(s==null){if(q.current=!1,Z.current!=null)return;if(K.current&&(H.current=-1,ke()),(!we.current||!K.current)&&V.current&&(U.current!=null||V.current===!0&&U.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>Oe.request(e):queueMicrotask)(t),e+=1):(H.current=U.current==null||ye(U.current,O,v)||_?ee(n):ue(n),U.current=null,G())};t()}}else d(n.current,s)||(H.current=s,ke(),J.current=!1)}}},[f,N,P,s,Z,_,n,O,v,G,ke,Oe]),w(()=>{if(!f||P||!B||b||!K.current)return;let e=B.nodesRef.current,t=e.find(e=>e.id===z)?.context?.elements.floating,n=i(se(F??t??null)),r=e.some(e=>e.context&&h(e.context.elements.floating,n));t&&!r&&W.current&&t.focus({preventScroll:!0})},[f,P,F,B,z,b]),w(()=>{we.current=N,K.current=!!P});let Ae=s!=null,je=T(e=>{if(!X.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(H.current!==t||s!==t)&&(H.current=t,G(e))}),Q=T(()=>pe??B?.nodesRef.current.find(e=>e.id===z)?.context?.dataRef?.current.orientation),Me=T(()=>ee(n,Te.current)),$=T(t=>{if(W.current=!1,q.current=!0,t.which===229||!X.current&&t.currentTarget===R.current)return;if(_&&xe(t.key,D,v,Se)){j(t.key,Q())||p(t),e.setOpen(!1,y(l,t.nativeEvent));let n=A?.current??F;de(n)&&n.focus();return}s!=null&&s!==H.current&&!d(n.current,s)&&(H.current=s);let r=H.current,a=ee(n,E),c=ue(n,E);if(L||(t.key===`Home`&&(p(t),H.current=a,G(t)),t.key===`End`&&(p(t),H.current=c,G(t))),M!=null){let e=M(t,H.current,n,D,g,v,E,a,c);if(e!=null&&e!==H.current&&(H.current=e,G(t)),D===`both`)return}if(j(t.key,D)){p(t);let e=i(t.currentTarget.ownerDocument);if(N&&!b&&h(t.currentTarget,e)&&!n.current.some(t=>t!=null&&h(t,e))){H.current=ye(t.key,D,v)?a:c,G(t),s===H.current&&ke();return}let{index:l,wrapped:u}=o(n.current,r,{decrement:!ye(t.key,D,v),loopFocus:g,allowEscape:re,disabledIndices:E,minIndex:a,maxIndex:c});u&&(q.current=!1),H.current=l,G(t)}}),Ne=k.useMemo(()=>({onFocus(e){q.current=!0,je(e)},onClick({currentTarget:e}){b||e.focus({preventScroll:!0})},onMouseMove(e){ve(e)||(q.current=!0,J.current=!1,S&&je(e))},onPointerLeave(e){if(!X.current||!W.current||e.pointerType===`touch`)return;q.current=!0;let t=e.relatedTarget;if(S&&!n.current.includes(t)&&Ee.current&&(Y.current?.(),Y.current=null,H.current=-1,G(e),!b)){let e=R.current,t=i(se(e));e&&h(e,t)&&e.focus({preventScroll:!0})}}}),[je,X,R,S,n,G,Ee,b]),Pe=k.useMemo(()=>b&&N&&Ae&&{"aria-activedescendant":`${me}-${s}`},[b,N,Ae,me,s]),Fe=k.useMemo(()=>({...L?{}:Pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&N&&!b){let n=a(t.nativeEvent);if(n&&!h(R.current,n))return;p(t);let r=y(fe,t.nativeEvent);e.setOpen(!1,r);let i=A?.current??F;!r.isCanceled&&de(i)&&i.focus()}else $(t)},onPointerMove(e){ve(e)||(W.current=!0)}}),[Pe,$,R,L,e,N,b,F,A]),Ie=k.useMemo(()=>{function t(t){e.setOpen(!0,y(l,t.nativeEvent,t.currentTarget))}function n(e){x===`auto`&&ne(e.nativeEvent)&&(V.current=!b)}function r(e){V.current=x,x===`auto`&&ie(e.nativeEvent)&&(V.current=!0)}return{onKeyDown(n){let r=e.select(`open`);W.current=!1;let i=n.key.startsWith(`Arrow`),a=be(n.key,Q(),v),o=j(n.key,r?D:O),s=(_?a:o)||n.key===`Enter`||n.key.trim()===``;if(b&&r&&(!_||ae(n.currentTarget)))return $(n);if(r||C||!i){if(s){let e=j(n.key,Q());U.current=_&&e?null:n.key}_?a&&(p(n),r?(H.current=Me(),G(n),b&&R.current?.focus()):t(n)):o&&(Z.current!=null&&(H.current=Z.current),p(n),!r&&C?t(n):$(n),r&&G(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!b&&(H.current=-1,G(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[$,x,Me,_,G,e,C,D,O,Q,v,Z,b,R]),Le=k.useMemo(()=>({...Pe,...Ie}),[Pe,Ie]);return k.useMemo(()=>f?{reference:Le,floating:Fe,item:Ne,trigger:Ie}:{},[f,Le,Fe,Ie,Ne])}function Se(e){let t=k.useRef(!0);t.current&&(t.current=!1,e())}function N(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var P=(e,t)=>Object.is(e,t);function F(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Ce(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!N(e,t,(e,t)=>F(e,t,n)):e!==t}function I(e,t,n){return e?e.some(e=>e!==void 0&&F(t,e,n)):!1}function L(e,t,n){return e?e.findIndex(e=>e!==void 0&&F(e,t,n)):-1}function R(e,t){if(t!==P)return n=>I(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function z(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(R(t,n)):L(e,t,n);return i===-1?null:i}function B(e,t,n,r,i,a){return I(r,t,i)?a!=null&&e>a&&I(r,n[a],i)?a:e:e===a?z(n,r,i,!0):a}function V(e,t,n){return e.filter(e=>!F(t,e,n))}function H(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var U=n();function W(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function G(e){return W(e?.[0])}function K(e){return G(e)?e.flatMap(e=>e.items):e}function we(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(G(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function q(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return H(e)}function J(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?H(e.value):H(e)}function Y(e,t,n){function r(){return q(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=K(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Te(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,U.jsx)(k.Fragment,{children:Y(r,t,n)},i)),e),[])}function X(e){let t=k.useRef(``),n=k.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:k.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Z(e,t){let{onClick:n,onPointerDown:r}=X(T((n,r)=>{(typeof e==`function`?e():e)||t(r||(x?`touch`:``))}));return k.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Ee(e){let[t,n]=k.useState(null),r=Z(e,n);return me(e,t=>{t&&!e&&n(null)}),k.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var De=20;function Oe(e,t,n,r){let[i,a]=k.useState(!1);w(()=>{if(!e||!t||n==null){a(!1);return}let r=se(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-De)},[e,t,n]),pe(e&&(!t||i),r)}export{ge as S,B as _,we as a,M as b,Y as c,F as d,P as f,V as g,Ce as h,K as i,q as l,z as m,Ee as n,G as o,L as p,Z as r,Te as s,Oe as t,J as u,I as v,_e as x,Se as y};
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{A as r,Cn as i,En as a,Et as o,Fr as s,G as c,Kn as l,Nr as u,Ot as d,Qn as f,Qt as p,Sn as m,Tn as h,Tt as ee,W as te,Xt as ne,Y as re,Yt as g,Zt as ie,an as ae,bn as _,c as v,er as y,i as b,in as oe,ir as se,j as ce,jn as x,kn as S,kr as C,or as w,sr as T,tn as le,vr as E,wt as ue,xn as D,yn as O,yr as de,zn as fe}from"./button-C9SQW3kI.js";import{i as pe,s as me,y as he}from"./fields-CEep8IFT.js";var k=e(t(),1);function ge(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=f}=t,u=e.context.dataRef,d=k.useRef(void 0),p=te(),m=re(),h=k.useMemo(()=>{function t(t,n,r,i){let a=y(l,n,r);t&&i===`touch`&&c>0?m.start(c,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=u.current.openEvent,o=e.select(`domReferenceElement`)!==n;return t&&o||!t||!i?!0:a&&(typeof s==`function`?s():s)?!r(a.type):!1}return{onPointerDown(e){d.current=g(e.pointerType,!0)&&ie(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let s=d.current,c=i.nativeEvent,l=e.select(`open`);if(i.button!==0||r===`click`||g(s,!0)&&o)return;let u=n(l,i.currentTarget,e=>e===`click`||e===`mousedown`),f=a(c),m=ae(f);if(m||s===`virtual`){t(u,c,m?f:i.currentTarget,s);return}let h=i.currentTarget;p.request(()=>{t(u,c,h,s)})},onClick(i){if(r===`mousedown-only`)return;let a=d.current;r===`mousedown`&&a?d.current=void 0:g(a,!0)&&o||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,a)},onKeyDown(){d.current=void 0}}},[u,r,o,l,e,s,i,p,m,c]);return k.useMemo(()=>n?{reference:h}:C,[n,h])}function _e(e){let{open:t=!1,onOpenChange:n,elements:i={}}=e,a=s(),o=r()!=null,c=u(()=>new b({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new v,floatingId:a,syncOnly:!1,nested:o})).current;return w(()=>{let e={open:t,floatingId:a};i.reference!==void 0&&(e.referenceElement=i.reference,e.domReferenceElement=E(i.reference)?i.reference:null),i.floating!==void 0&&(e.floatingElement=i.floating),c.update(e)},[t,a,i.reference,i.floating,c]),c.context.onOpenChange=n,c.context.nested=o,c}function ve(e){return S&&e.movementX===0&&e.movementY===0}function A(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function j(e,t){return A(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function ye(e,t,n){return A(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function be(e,t,n){return A(t,n?e===_:e===D,e===O)}function xe(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:A(t,n?e===D:e===_,e===m)}function M(e,t){let{listRef:n,activeIndex:s,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:m=null,allowEscape:re=!1,loopFocus:g=!1,nested:_=!1,rtl:v=!1,virtual:b=!1,focusItemOnOpen:x=`auto`,focusItemOnHover:S=!0,openOnArrowKeyDown:C=!0,disabledIndices:E=void 0,orientation:D=`vertical`,triggerOrientation:O=D,parentOrientation:pe,id:me,resetOnPointerLeave:ge=!0,externalTree:_e,nestedReturnFocusRef:A,grid:M}=t,Se=M!=null,N=e.useState(`open`),P=e.useState(`floatingElement`),F=e.useState(`domReferenceElement`),Ce=e.context.dataRef,I=le(P),L=oe(F),R=c(I),z=r(),B=ce(_e),V=k.useRef(x),H=k.useRef(m??-1),U=k.useRef(null),W=k.useRef(!0),G=T(e=>{u(H.current===-1?null:H.current,e)}),K=k.useRef(!!P),we=k.useRef(N),q=k.useRef(!1),J=k.useRef(!1),Y=k.useRef(null),Te=c(E),X=c(N),Z=c(m),Ee=c(ge),De=te(),Oe=te(),ke=T(()=>{De.cancel();function e(e){b||(Y.current=he(e,{sync:q.current,preventScroll:!0}))}let t=n.current[H.current],r=J.current;t&&e(t),(q.current?e=>e():e=>De.request(e))(()=>{let i=n.current[H.current]||t;i&&(t||e(i),Ne&&(r||!W.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});w(()=>{Ce.current.orientation=D},[Ce,D]),w(()=>{N||(U.current=null),N&&x===`auto`||(V.current=x)},[N,x]),w(()=>{f&&(N&&P?(H.current=m??-1,V.current&&m!=null&&(J.current=!0,G())):K.current&&(H.current=-1,G()))},[f,N,P,m,G]),w(()=>{if(f){if(!N)q.current=!1;else if(P){if(s==null){if(q.current=!1,Z.current!=null)return;if(K.current&&(H.current=-1,ke()),(!we.current||!K.current)&&V.current&&(U.current!=null||V.current===!0&&U.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>Oe.request(e):queueMicrotask)(t),e+=1):(H.current=U.current==null||ye(U.current,O,v)||_?ee(n):ue(n),U.current=null,G())};t()}}else d(n.current,s)||(H.current=s,ke(),J.current=!1)}}},[f,N,P,s,Z,_,n,O,v,G,ke,Oe]),w(()=>{if(!f||P||!B||b||!K.current)return;let e=B.nodesRef.current,t=e.find(e=>e.id===z)?.context?.elements.floating,n=i(se(F??t??null)),r=e.some(e=>e.context&&h(e.context.elements.floating,n));t&&!r&&W.current&&t.focus({preventScroll:!0})},[f,P,F,B,z,b]),w(()=>{we.current=N,K.current=!!P});let Ae=s!=null,je=T(e=>{if(!X.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(H.current!==t||s!==t)&&(H.current=t,G(e))}),Q=T(()=>pe??B?.nodesRef.current.find(e=>e.id===z)?.context?.dataRef?.current.orientation),Me=T(()=>ee(n,Te.current)),$=T(t=>{if(W.current=!1,q.current=!0,t.which===229||!X.current&&t.currentTarget===R.current)return;if(_&&xe(t.key,D,v,Se)){j(t.key,Q())||p(t),e.setOpen(!1,y(l,t.nativeEvent));let n=A?.current??F;de(n)&&n.focus();return}s!=null&&s!==H.current&&!d(n.current,s)&&(H.current=s);let r=H.current,a=ee(n,E),c=ue(n,E);if(L||(t.key===`Home`&&(p(t),H.current=a,G(t)),t.key===`End`&&(p(t),H.current=c,G(t))),M!=null){let e=M(t,H.current,n,D,g,v,E,a,c);if(e!=null&&e!==H.current&&(H.current=e,G(t)),D===`both`)return}if(j(t.key,D)){p(t);let e=i(t.currentTarget.ownerDocument);if(N&&!b&&h(t.currentTarget,e)&&!n.current.some(t=>t!=null&&h(t,e))){H.current=ye(t.key,D,v)?a:c,G(t),s===H.current&&ke();return}let{index:l,wrapped:u}=o(n.current,r,{decrement:!ye(t.key,D,v),loopFocus:g,allowEscape:re,disabledIndices:E,minIndex:a,maxIndex:c});u&&(q.current=!1),H.current=l,G(t)}}),Ne=k.useMemo(()=>({onFocus(e){q.current=!0,je(e)},onClick({currentTarget:e}){b||e.focus({preventScroll:!0})},onMouseMove(e){ve(e)||(q.current=!0,J.current=!1,S&&je(e))},onPointerLeave(e){if(!X.current||!W.current||e.pointerType===`touch`)return;q.current=!0;let t=e.relatedTarget;if(S&&!n.current.includes(t)&&Ee.current&&(Y.current?.(),Y.current=null,H.current=-1,G(e),!b)){let e=R.current,t=i(se(e));e&&h(e,t)&&e.focus({preventScroll:!0})}}}),[je,X,R,S,n,G,Ee,b]),Pe=k.useMemo(()=>b&&N&&Ae&&{"aria-activedescendant":`${me}-${s}`},[b,N,Ae,me,s]),Fe=k.useMemo(()=>({...L?{}:Pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&N&&!b){let n=a(t.nativeEvent);if(n&&!h(R.current,n))return;p(t);let r=y(fe,t.nativeEvent);e.setOpen(!1,r);let i=A?.current??F;!r.isCanceled&&de(i)&&i.focus()}else $(t)},onPointerMove(e){ve(e)||(W.current=!0)}}),[Pe,$,R,L,e,N,b,F,A]),Ie=k.useMemo(()=>{function t(t){e.setOpen(!0,y(l,t.nativeEvent,t.currentTarget))}function n(e){x===`auto`&&ne(e.nativeEvent)&&(V.current=!b)}function r(e){V.current=x,x===`auto`&&ie(e.nativeEvent)&&(V.current=!0)}return{onKeyDown(n){let r=e.select(`open`);W.current=!1;let i=n.key.startsWith(`Arrow`),a=be(n.key,Q(),v),o=j(n.key,r?D:O),s=(_?a:o)||n.key===`Enter`||n.key.trim()===``;if(b&&r&&(!_||ae(n.currentTarget)))return $(n);if(r||C||!i){if(s){let e=j(n.key,Q());U.current=_&&e?null:n.key}_?a&&(p(n),r?(H.current=Me(),G(n),b&&R.current?.focus()):t(n)):o&&(Z.current!=null&&(H.current=Z.current),p(n),!r&&C?t(n):$(n),r&&G(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!b&&(H.current=-1,G(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[$,x,Me,_,G,e,C,D,O,Q,v,Z,b,R]),Le=k.useMemo(()=>({...Pe,...Ie}),[Pe,Ie]);return k.useMemo(()=>f?{reference:Le,floating:Fe,item:Ne,trigger:Ie}:{},[f,Le,Fe,Ie,Ne])}function Se(e){let t=k.useRef(!0);t.current&&(t.current=!1,e())}function N(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var P=(e,t)=>Object.is(e,t);function F(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Ce(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!N(e,t,(e,t)=>F(e,t,n)):e!==t}function I(e,t,n){return e?e.some(e=>e!==void 0&&F(t,e,n)):!1}function L(e,t,n){return e?e.findIndex(e=>e!==void 0&&F(e,t,n)):-1}function R(e,t){if(t!==P)return n=>I(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function z(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(R(t,n)):L(e,t,n);return i===-1?null:i}function B(e,t,n,r,i,a){return I(r,t,i)?a!=null&&e>a&&I(r,n[a],i)?a:e:e===a?z(n,r,i,!0):a}function V(e,t,n){return e.filter(e=>!F(t,e,n))}function H(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var U=n();function W(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function G(e){return W(e?.[0])}function K(e){return G(e)?e.flatMap(e=>e.items):e}function we(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(G(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function q(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return H(e)}function J(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?H(e.value):H(e)}function Y(e,t,n){function r(){return q(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=K(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Te(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,U.jsx)(k.Fragment,{children:Y(r,t,n)},i)),e),[])}function X(e){let t=k.useRef(``),n=k.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:k.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Z(e,t){let{onClick:n,onPointerDown:r}=X(T((n,r)=>{(typeof e==`function`?e():e)||t(r||(x?`touch`:``))}));return k.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Ee(e){let[t,n]=k.useState(null),r=Z(e,n);return me(e,t=>{t&&!e&&n(null)}),k.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var De=20;function Oe(e,t,n,r){let[i,a]=k.useState(!1);w(()=>{if(!e||!t||n==null){a(!1);return}let r=se(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-De)},[e,t,n]),pe(e&&(!t||i),r)}export{ge as S,B as _,we as a,M as b,Y as c,F as d,P as f,V as g,Ce as h,K as i,q as l,z as m,Ee as n,G as o,L as p,Z as r,Te as s,Oe as t,J as u,I as v,_e as x,Se as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,f as t,m as n,s as r,u as i}from"./cn-DC80MJV0.js";import{a,n as o}from"./jsx-runtime-MZURdZre.js";import{F as s,H as c,J as l,q as u}from"./studio-queries-CkUSByy7.js";var d=class extends r{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||f(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(t){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#r=e({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),a=this.state.status===`pending`,o=!i.canStart();try{if(a)n();else{this.#i({type:`pending`,variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#i({type:`pending`,context:e,variables:t,isPaused:o})}this.state.isPaused&&i.canStart()&&n();let e=await i.start();return await this.#n.config.onSuccess?.(e,t,this.state.context,this,r),await this.options.onSuccess?.(e,t,this.state.context,r),await this.#n.config.onSettled?.(e,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(e,null,t,this.state.context,r),this.#i({type:`success`,data:e}),e}catch(e){try{await this.#n.config.onError?.(e,t,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(e,t,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:e}),e}finally{this.#r===i&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),i.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function f(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var p=class extends t{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),u(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&s(t.mutationKey)!==s(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??f();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){i.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},m=a(o(),1);function h(e,t){let r=n(t),[a]=m.useState(()=>new p(r,e));m.useEffect(()=>{a.setOptions(e)},[a,e]);let o=m.useSyncExternalStore(m.useCallback(e=>a.subscribe(i.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),s=m.useCallback((...e)=>{a.mutate(e[0],e[1]).catch(c)},[a]);if(o.error&&l(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}export{d as n,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,a as t,it as n,lt as r,p as i,tt as a}from"./index-zmRH87D4.js";import{_ as o,at as s,f as c,g as l,h as u,i as d,it as f,m as p,p as m,r as h,u as g}from"./studio-queries-CkUSByy7.js";import{t as _}from"./useMutation-CqtM9COw.js";import{Lr as v,ct as y,n as b,r as x,rt as S,t as C}from"./button-C9SQW3kI.js";import{m as w,t as T}from"./cn-DC80MJV0.js";import{a as E,n as D,t as O}from"./jsx-runtime-MZURdZre.js";import{a as k}from"./useSelector-AYcH7lB0.js";import{t as A}from"./markdown-view-dku7MGPn.js";var j=E(D(),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 N(e,t){let{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:a=!1}=M(e,t),o=k(),{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 P=O(),ee=(e,t)=>`/api/vault/events?${new URLSearchParams({companion:e,path:t})}`;function F(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(ee(e,t));return n.addEventListener(`message`,e=>{try{r.current(JSON.parse(e.data))}catch{}}),()=>n.close()},[e,t])}function I({crumbs:e,children:t}){return(0,P.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,P.jsx)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1`,children:e}),t]})}var L=`vault-prose prose mx-auto w-full max-w-[68ch] px-10 pt-10 pb-28 max-sm:px-4`,R=b({variant:`default`,size:`sm`});function z({path:e}){return(0,P.jsxs)(`button`,{type:`button`,className:b({variant:`ghost`,size:`sm`}),"data-copy":e,"data-copy-label":`path`,"aria-label":`Copy path`,children:[(0,P.jsx)(x,{name:`copy`,className:`size-3.5`}),(0,P.jsx)(`span`,{className:`@max-[1000px]:hidden`,children:`Copy path`})]})}function B({companion:e,data:t,writable:n,search:r,crumbs:i}){let a=t.open;return a?n&&r.mode===`edit`?(0,P.jsx)(ne,{companion:e,data:t,crumbs:i},`${a.path}:edit`):(0,P.jsx)(H,{companion:e,data:t,writable:n,crumbs:i},`${a.path}:read`):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(I,{crumbs:i}),(0,P.jsxs)(`div`,{className:L,children:[(0,P.jsx)(`h1`,{className:`text-xl`,children:t.refusal?`File refused`:`Open a markdown file`}),(0,P.jsx)(`p`,{className:t.refusal?`vault-warning text-warn`:`empty text-muted`,children:t.refusal??`Choose a file from the tree to begin.`})]})]})}var V=e=>e.split(`/`).at(-1)??e;function H({companion:e,data:t,writable:n,crumbs:r}){let i=t.open,a=w(),[o,s]=(0,j.useState)(``);return F(e,i.path,t=>{t.kind===`removed`?s(`this file no longer exists on disk`):h(a,e)}),(0,P.jsxs)(`div`,{"data-vault-root":!0,"data-vault-mode":`read`,"data-vault-path":i.path,children:[(0,P.jsxs)(I,{crumbs:r,children:[(0,P.jsx)(z,{path:i.path}),n?(0,P.jsxs)(f,{className:R,id:`vault-mode-edit`,to:`/vault`,search:e=>({...e,mode:`edit`}),"data-vault-mode-link":!0,children:[(0,P.jsx)(x,{name:`pencil`,className:`size-3.5`}),`Edit`]}):(0,P.jsx)(`span`,{className:`text-xs text-muted`,title:`Start Studio with --writable to edit.`,children:`Read only`})]}),(0,P.jsxs)(`article`,{className:L,"aria-label":V(i.path),children:[(0,P.jsx)(A,{nodes:i.markdown}),(0,P.jsx)(`p`,{id:`vault-status`,className:`text-sm text-warn`,"aria-live":`polite`,children:o})]})]})}function te({companion:t,open:n,text:r}){let[i,a]=(0,j.useState)(r);(0,j.useEffect)(()=>{let e=setTimeout(()=>a(r),250);return()=>clearTimeout(e)},[r]);let o=e(`(min-width: 64rem)`),s=i===n.content,c=v({queryKey:[`vault-preview`,t,n.path,i],queryFn:()=>l({data:{companion:t,path:n.path,content:i}}),placeholderData:e=>e,enabled:o&&!s,gcTime:0}),u=s?n.markdown:c.data;return(0,P.jsxs)(`div`,{className:`vault-preview min-h-0 overflow-auto max-lg:hidden`,"aria-label":`Preview`,role:`region`,"data-vault-preview":!0,children:[(0,P.jsx)(`p`,{className:`m-0 px-7 pt-3 text-xs font-semibold text-muted`,children:`Preview`}),(0,P.jsx)(`div`,{className:`prose px-7 pt-2 pb-16 text-sm`,children:u?(0,P.jsx)(A,{nodes:u}):null})]})}function ne({companion:e,data:t,crumbs:n}){let r=t.open,i=w(),c=s(),[l,u]=(0,j.useState)(r.content),[d,p]=(0,j.useState)(r.content),[m,g]=(0,j.useState)(r.token),[v,y]=(0,j.useState)(``),[b,S]=(0,j.useState)(null),E=l!==d,D=(0,j.useRef)(E);(0,j.useEffect)(()=>{D.current=E},[E]);let O=a(e=>e.setDirty);(0,j.useEffect)(()=>O(E),[E,O]),(0,j.useEffect)(()=>()=>O(!1),[O]),N({shouldBlockFn:()=>D.current&&!window.confirm(`Discard unsaved changes?`),enableBeforeUnload:()=>D.current}),F(e,r.path,e=>{if(e.kind===`removed`){y(`this file no longer exists on disk`);return}let t={content:e.content??``,token:e.token??``};e.kind===`overwritten`?(S(t),y(`a version was overwritten; its content is available below`)):E?(S(t),y(`the file changed on disk; unsaved content is still in the editor`)):(u(t.content),p(t.content),g(t.token),y(`updated from disk`))});let k=_({mutationFn:()=>o({data:{companion:e,path:r.path,content:l,token:m}}),onSuccess:t=>{t.kind===`conflict`?(S({content:t.content,token:t.token}),y(t.reason||`save refused`)):(g(t.token),p(l),D.current=!1,O(!1),y(`saved`),h(i,e),c({to:`/vault`,search:e=>({...e,mode:void 0}),resetScroll:!1}))},onError:e=>y(e.message||`save failed`)});return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,"data-vault-root":!0,"data-vault-mode":`edit`,"data-vault-path":r.path,children:[(0,P.jsxs)(I,{crumbs:n,children:[E?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-warn`,children:[(0,P.jsx)(`span`,{className:`size-[7px] rounded-full bg-current`,"aria-hidden":`true`}),`Unsaved`]}):null,(0,P.jsxs)(f,{className:R,id:`vault-mode-read`,to:`/vault`,search:e=>({...e,mode:void 0}),"data-vault-mode-link":!0,children:[(0,P.jsx)(x,{name:`eye`,className:`size-3.5`}),`Read`]}),(0,P.jsx)(C,{variant:`primary`,size:`sm`,id:`vault-save`,onClick:()=>k.mutate(),disabled:k.isPending,children:`Save`})]}),(0,P.jsxs)(`div`,{className:v||b?`grid gap-2 border-b border-rule-soft px-6 py-2.5 text-sm`:`sr-only`,children:[(0,P.jsx)(`p`,{id:`vault-status`,className:`m-0 text-warn`,"aria-live":`polite`,children:v}),b?(0,P.jsxs)(`div`,{id:`vault-incoming`,className:`grid gap-2`,children:[(0,P.jsx)(`strong`,{id:`vault-incoming-title`,className:`text-sm`,children:`Incoming version`}),(0,P.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:b.content}),(0,P.jsx)(C,{size:`sm`,id:`vault-recover`,className:`justify-self-start`,onClick:()=>{u(b.content),p(b.content),b.token&&g(b.token),S(null),y(`incoming version loaded into the editor`)},children:`Put incoming content back`})]}):null]}),(0,P.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-2 max-lg:grid-cols-1`,children:[(0,P.jsx)(`textarea`,{id:`vault-editor`,"data-vault-editor":!0,"data-vault-path":r.path,"aria-label":`Markdown source of ${V(r.path)}`,spellCheck:!1,value:l,onChange:e=>u(e.target.value),className:T(`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,P.jsx)(te,{companion:e,open:r,text:l})]})]})}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,P.jsxs)(f,{to:`/vault`,search:t=>({...t,path:e.path,dir:void 0,mode:void 0}),className:T(W,`vault-file`),"data-vault-entry":e.path,"aria-current":t?`page`:void 0,children:[(0,P.jsx)(x,{name:`doc`,className:T(`size-3.5`,t?`text-accent`:`text-muted`)}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n??e.name})]})}function K({dir:e,className:t,children:n}){return(0,P.jsx)(f,{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,P.jsx)(G,{entry:e,current:n.path===e.path}):(0,P.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=v({...c(t,e.path),enabled:r&&e.children===void 0}),o=e.children??a.data?.entries;return(0,P.jsxs)(`details`,{className:`vault-directory group/dir`,open:r,"data-vault-dir":e.path,onToggle:e=>i(e.currentTarget.open),children:[(0,P.jsxs)(`summary`,{className:T(W,`cursor-pointer list-none font-semibold [&::-webkit-details-marker]:hidden`),"aria-current":n.dir===e.path?`page`:void 0,children:[(0,P.jsx)(x,{name:`right`,className:`size-3 text-muted transition-transform group-open/dir:rotate-90`}),(0,P.jsx)(x,{name:`folder`,className:`size-3.5 text-muted`}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]}),(0,P.jsxs)(`div`,{className:`vault-children grid gap-px pl-3.5`,children:[r&&o?o.map(e=>(0,P.jsx)(q,{entry:e,companion:t,search:n},e.path)):null,a.error?(0,P.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,P.jsx)(`div`,{"data-vault-slot":`tree`,children:(0,P.jsxs)(`p`,{className:Y,children:[`The files could not be listed: `,e.failure]})}):e.tree===null?(0,P.jsx)(`div`,{"data-vault-slot":`tree`,"aria-busy":`true`,children:(0,P.jsx)(`p`,{className:T(J,`empty`),children:`Listing files…`})}):(0,P.jsxs)(`div`,{"data-vault-slot":`tree`,"data-vault-generation":e.generation??void 0,children:[(0,P.jsx)(ae,{data:e}),e.tree.length===0?(0,P.jsx)(`p`,{className:T(J,`empty`),children:`This companion has no markdown files.`}):(0,P.jsx)(`nav`,{className:`vault-tree grid gap-px`,"aria-label":`Markdown files`,children:e.tree.map(e=>(0,P.jsx)(q,{entry:e,companion:t,search:n},e.path))})]})}function ae({data:e}){return e.warning?(0,P.jsxs)(`p`,{className:Y,children:[e.warning,`. The tree may be out of date.`]}):e.watching?null:(0,P.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=v({...m(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,P.jsxs)(`div`,{"data-vault-filter-results":!0,children:[o.length===0?(0,P.jsx)(`p`,{className:T(J,`empty`),children:`No files match.`}):(0,P.jsx)(`nav`,{className:`vault-tree vault-results grid gap-px`,"aria-label":`Matching files`,children:o.map(e=>(0,P.jsx)(G,{entry:e,current:n.path===e.path,label:e.path},e.path))}),c>0?(0,P.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,P.jsx)(`nav`,{className:`vault-breadcrumb min-w-0`,"aria-label":`Breadcrumb`,"data-vault-crumb":!0,children:(0,P.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,P.jsx)(`li`,{className:`flex-none`,children:n.length===0?(0,P.jsx)(`span`,{"aria-current":`page`,className:`px-1.5 font-semibold text-text`,children:e}):(0,P.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,P.jsxs)(`li`,{className:T(`flex items-center gap-0.5`,i?`min-w-0`:`flex-none max-md:hidden`),children:[(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),i?(0,P.jsx)(`span`,{"aria-current":`page`,className:`truncate px-1.5 font-semibold text-text`,children:e}):(0,P.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,P.jsxs)(`p`,{className:Y,children:[`The files could not be listed: `,e.failure]}):e.tree===null?(0,P.jsx)(`p`,{className:T(J,`empty`),children:`Listing files…`}):null,r=e.dir?U(e.dir):[],i=r.at(-1)??t;if(n)return(0,P.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,P.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,P.jsx)(`h1`,{className:`m-0 text-xl font-semibold`,children:i}),e.dirMissing?(0,P.jsx)(`p`,{className:Y,children:`That folder is not in the tree; showing the root.`}):null,a.length===0&&r.length===0?(0,P.jsx)(`p`,{className:T(J,`empty`),children:`This companion has no markdown files.`}):(0,P.jsx)(S,{title:`In this folder`,count:a.length,children:(0,P.jsxs)(`ul`,{className:`vault-rows m-0 list-none p-0`,"aria-label":`Folder contents`,children:[r.length>0?(0,P.jsx)(`li`,{children:(0,P.jsxs)(K,{dir:r.length>1?r.slice(0,-1).join(`/`):null,className:T(y,`vault-row py-1.5`),children:[(0,P.jsx)(x,{name:`left`,className:`text-muted`}),(0,P.jsx)(`span`,{children:`..`})]})}):null,a.map(e=>(0,P.jsx)(`li`,{children:e.kind===`directory`?(0,P.jsxs)(K,{dir:e.path,className:T(y,`vault-row py-1.5 font-semibold`),children:[(0,P.jsx)(x,{name:`folder`,className:`text-muted`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.name})]}):(0,P.jsxs)(f,{to:`/vault`,search:t=>({...t,path:e.path,dir:void 0,mode:void 0}),className:T(y,`vault-row py-1.5`),children:[(0,P.jsx)(x,{name:`doc`,className:`text-muted`}),(0,P.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,P.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,P.jsx)(`h2`,{className:`m-0 mb-2 text-xs font-semibold text-muted`,children:`On this page`}),(0,P.jsx)(`ol`,{className:`m-0 grid list-none gap-0.5 p-0`,children:e.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:T(`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:r,stale:i,refresh:a,filter:o,setFilter:s,hidden:c}){return(0,P.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,P.jsxs)(`div`,{className:`flex items-center justify-between pt-3 pr-2.5 pb-2 pl-5`,children:[(0,P.jsx)(`strong`,{className:`text-sm`,children:`Files`}),(0,P.jsx)(n,{label:`Refresh tree`,side:`bottom`,children:(0,P.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":a.isPending?`Refreshing…`:`Refresh tree`,onClick:()=>a.mutate(),disabled:a.isPending,children:(0,P.jsx)(x,{name:`refresh`,className:a.isPending?`animate-spin`:void 0})})})]}),(0,P.jsx)(`p`,{id:`vault-stale`,className:Y+` mx-2.5`,role:`status`,hidden:!i,children:`Files changed — refresh tree.`}),a.error?(0,P.jsx)(`p`,{className:Y+` mx-2.5`,role:`status`,children:a.error.message}):null,(0,P.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,P.jsx)(x,{name:`search`,className:`size-3.5`}),(0,P.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,P.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-2.5 pb-6`,children:o.trim()?(0,P.jsx)(oe,{companion:t,query:o,search:r}):(0,P.jsx)(ie,{data:e,companion:t,search:r})})]})}function he({companion:e,rootName:t,writable:r,search:o}){let s=w(),c=v(p(e,o)),l=v({...p(e,o,!0),enabled:!(!c.data||c.data.tree!==null||c.data.failure)}).data??c.data,[f,m]=(0,j.useState)(``),h=a(e=>e.latestGeneration),g=a(e=>e.treeHidden),y=a(e=>e.toggleTree),b=a(e=>e.hydrate);(0,j.useEffect)(b,[b]);let S=_({mutationFn:()=>u({data:{companion:e,path:o.path,dir:o.dir,refresh:!0,wait:!0}}),onSuccess:t=>void d(s,e,o,t)}),T=(0,j.useRef)(null),E=!!l?.open&&o.mode!==`edit`,D=E?ue(l?.open?.markdown):pe,O=de(T,E?l?.open?.markdown:void 0,D.length);if(!l)return(0,P.jsx)(i,{});let k=h!==null&&l.generation!==null&&h>l.generation,A=D.length>0,M=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{label:g?`Show files`:`Hide files`,side:`bottom`,children:(0,P.jsx)(C,{size:`icon-sm`,variant:`ghost`,id:`vault-tree-toggle`,"aria-controls":`vault-tree-panel`,"aria-expanded":!g,"aria-label":g?`Show files`:`Hide files`,onClick:y,children:(0,P.jsx)(x,{name:`sidebar`})})}),(0,P.jsx)(se,{rootName:t,search:o})]});return(0,P.jsx)(`div`,{className:`@container flex min-h-0 flex-1 flex-col`,children:(0,P.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,P.jsx)(me,{data:l,companion:e,search:o,stale:k,refresh:S,filter:f,setFilter:m,hidden:g}),(0,P.jsx)(`div`,{ref:T,className:`vault-main min-h-0 min-w-0 overflow-auto scroll-smooth`,"data-vault-main":!0,"data-vault-pane":!0,children:o.path||l.open||l.refusal?(0,P.jsx)(B,{companion:e,data:l,writable:r,search:o,crumbs:M}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(I,{crumbs:M}),(0,P.jsx)(le,{data:l,rootName:t})]})}),A?(0,P.jsx)(fe,{headings:D,...O}):null]})})}function ge(){let e=t.useSearch(),{data:n}=r(g({companion:e.companion,studioMode:e.studioMode}));if(!e.companion||!n.selected)return null;let i=n.selected.path.split(/[\\/]/).findLast(Boolean)??`companion`;return(0,P.jsx)(he,{companion:e.companion,rootName:i,writable:n.writable,search:{path:e.path,dir:e.dir,mode:e.mode}})}export{ge as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cn-DC80MJV0.js";import{it as t}from"./button-C9SQW3kI.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n();function i({warnings:n}){return n.length===0?null:(0,r.jsx)(`section`,{className:e(t,`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:n.map(e=>(0,r.jsx)(`li`,{children:e},e))})]})})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Lr as e,et as t,it as n,ot as r,rt as i,tt as a}from"./button-C9SQW3kI.js";import{D as o,T as s,i as c,k as l,m as u}from"./index-zmRH87D4.js";import{a as d}from"./studio-queries-CkUSByy7.js";import{t as f}from"./companion-view-C1F0_jbt.js";import{p}from"./studio-ndtFcS2Y.js";import{t as m}from"./warnings-Cnw99ugO.js";import{a as h,n as g,t as _}from"./jsx-runtime-MZURdZre.js";import{t as v}from"./cn-DC80MJV0.js";import{n as y,r as b,t as x}from"./panel-COgk0vP5.js";import{i as S,n as C,r as w,t as T}from"./steps-tVDWn7j6.js";var E=h(g(),1),D=e=>({id:e.id,kind:`stage`,step:e});function O(e){let t=e.map.map(e=>e.kind===`stage`?{nodes:[D(e.step)],optional:e.step.optional,phase:e.step.phase}:e.group===`human`?{nodes:[{id:C(e.steps[0]),kind:`review-group`,steps:e.steps}],optional:e.steps[0].optional,phase:e.steps[0].phase}:{nodes:e.steps.map(D),optional:!0,phase:e.steps[0].phase});return t.unshift({nodes:[{id:`start`,kind:`start`}],optional:!1,phase:t[0]?.phase??`plan`}),t}function k(e){return e.kind===`stage`?!!e.step.sessionBreakBefore:e.kind===`review-group`&&!!e.steps[0].sessionBreakBefore}function A(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:k(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 j(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:T[e.phase],from:n,to:n+1})}),t}function M(e){let t=e.findIndex(e=>e.nodes.some(e=>e.id===`submit`));return t===-1?null:{from:0,to:t+1}}function ee(e){let t=O(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:A(t),bands:j(t),cycle:M(t)}}var N=e=>e.rows*2+1;function P(e){return{along:e.column+.5,across:e.row*2+e.rowSpan}}var F=e=>Math.round(e*1e4)/1e4,I=(e,t)=>`${F(e/t*100)}%`,L=({along:e,across:t})=>`${F(t)} ${F(e)}`;function R(e,t){let n=t=>{let n=e.nodes.find(e=>e.id===t);if(!n)throw Error(`Unknown graph node: ${t}`);return P(n)};return[n(t.from),n(t.to)]}function z(e,t){let[n,r]=R(e,t);if(t.kind===`bypass`){let t=N(e);return`M ${L(n)} C ${L({along:n.along,across:t})}, ${L({along:r.along,across:t})}, ${L(r)}`}let i=(n.along+r.along)/2;return`M ${L(n)} C ${L({along:i,across:n.across})}, ${L({along:i,across:r.across})}, ${L(r)}`}function B(e,t){let[n,r]=R(e,t),i=(n.along+r.along)/2;return t.kind===`bypass`?{along:i,across:(n.across+r.across)/8+N(e)*3/4}:{along:i,across:(n.across+r.across)/2}}function V(e,t){return{x:I(t.across,N(e)),y:I(t.along,e.columns)}}function H(e,t){return{top:I(t.from,e.columns),height:I(t.to-t.from,e.columns)}}var U=_(),W={},G=[];function K({payload:e,counts:t=W,changesByStage:n=G}){let r=S({skills:e.skills&&e.skills.length>0?e.skills:void 0,topology:e.topology,workflow:e.workflow}),[i,a]=(0,E.useState)(r.paths[0].schema),o=r.paths.find(e=>e.schema===i)??r.paths[0];return(0,U.jsx)(`section`,{className:`workflow-delivery-path @container grid content-start gap-2`,"aria-label":`Delivery Path`,children:(0,U.jsx)(q,{path:o,paths:r.paths,onSchemaChange:a,counts:t,changesByStage:n})})}function q({path:e,paths:t,onSchemaChange:o,counts:s,changesByStage:c}){let[l,u]=(0,E.useState)(null),d=e.steps.find(e=>e.id===l)??null,f=c.filter(e=>e.changes.length>0);return(0,U.jsxs)(`div`,{className:v(n,`workflow-path grid grid-cols-[minmax(380px,520px)_minmax(260px,1fr)] items-start gap-10 pt-10 pb-12 @max-[880px]:grid-cols-1`),"data-workflow-schema-panel":e.schema,children:[(0,U.jsxs)(`div`,{className:`workflow-path-graph grid min-w-0 justify-items-center gap-9 px-8 pt-4`,children:[(0,U.jsx)(Z,{path:e,selected:l,onSelect:u,counts:s}),(0,U.jsx)(te,{})]}),(0,U.jsxs)(`div`,{className:`workflow-detail-overview grid content-start gap-5`,id:J(e),children:[(0,U.jsxs)(`div`,{className:`grid gap-2 text-sm leading-relaxed text-muted`,children:[(0,U.jsx)(`p`,{className:`workflow-description m-0 text-text`,children:e.description}),e.reviewsKnown?null:(0,U.jsx)(`p`,{className:`workflow-description m-0`,children:`The schema's artifacts could not be read, so its review stages are unknown.`}),(0,U.jsx)(`p`,{className:`workflow-description m-0`,children:`A workset is one or more changes published together: after Submit change, start again at the top for the next change, and publish once the workset is merged.`}),(0,U.jsx)(`p`,{className:`workflow-detail-hint m-0`,children:`Choose a stage to see what it does and the prompt that runs it.`})]}),f.length>0?(0,U.jsx)(i,{title:`Where your changes are`,children:(0,U.jsx)(`ul`,{className:`m-0 list-none p-0`,children:f.map(e=>(0,U.jsxs)(`li`,{className:`grid gap-1 border-t border-rule-soft px-4 py-2 first:border-t-0`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[e.label,(0,U.jsx)(a,{value:e.changes.length})]}),(0,U.jsx)(`span`,{className:`truncate font-mono text-xs text-muted`,children:e.changes.join(`, `)})]},e.node))})}):null]}),(0,U.jsx)(b,{items:e.steps.map(e=>e.id),current:d?.id??null,onSelect:u,title:d?`Stage ${d.label}`:`Stage`,children:d?(0,U.jsx)(re,{step:d,stepsKnown:e.stepsKnown,changes:c.find(e=>e.node===C(d))?.changes??[],children:d.kind===`human`?(0,U.jsx)(y,{title:`OpenSpec schema`,children:(0,U.jsxs)(`div`,{className:`grid gap-2`,"data-workflow-schema-root":!0,children:[t.length>1?(0,U.jsx)(r,{label:`OpenSpec schema`,value:e.schema,onChange:e=>{let n=t.find(t=>t.schema===e);n&&(n.steps.some(e=>e.id===l)||u(n.steps.find(e=>e.kind===`human`)?.id??null),o(e))},options:t.map(e=>({value:e.schema,label:e.label}))}):(0,U.jsx)(`code`,{className:`font-mono text-sm`,children:e.label}),(0,U.jsx)(`span`,{className:`text-sm text-muted`,children:e.tagline})]})}):null}):null})]})}var J=e=>`workflow-${e.schema}-overview`,Y=(e,t,n)=>e.startsWith(`reviews`)?`${n} ${n===1?`change waits`:`changes wait`} for review`:`${n} ${n===1?`change`:`changes`} at ${t}`;function X({count:e,name:t}){return e?(0,U.jsx)(`span`,{className:`workflow-graph-count absolute -top-2.5 -right-2.5 z-1 inline-grid h-5 min-w-5 place-items-center rounded-full border border-[color-mix(in_srgb,var(--accent)_45%,var(--border))] bg-accent-soft px-1.5 font-sans text-2xs font-bold text-text`,"aria-label":t,role:`img`,children:e}):null}function Z({path:e,label:t=`Delivery Path map`,selected:n=null,onSelect:r,counts:i=W}){let a=ee(e),o=!r;return(0,U.jsxs)(`nav`,{className:`workflow-graph`,"aria-label":t,style:{"--graph-columns":String(a.columns),"--graph-rows":String(a.rows)},children:[(0,U.jsxs)(`div`,{className:`workflow-graph-bands`,"aria-hidden":`true`,children:[a.bands.map(e=>(0,U.jsx)(`div`,{className:`workflow-graph-band`,"data-band":e.phase,style:H(a,e),children:e.label},e.phase)),a.cycle?(0,U.jsx)(`div`,{className:`workflow-graph-cycle`,style:H(a,a.cycle),children:(0,U.jsx)(`span`,{children:`repeats for each change`})}):null,(0,U.jsx)(`div`,{className:`workflow-graph-workset`,children:(0,U.jsx)(`span`,{children:`workset`})})]}),(0,U.jsx)(ne,{graph:a}),(0,U.jsx)(`ol`,{className:`workflow-graph-nodes`,children:a.nodes.map(e=>e.kind===`start`?null:(0,U.jsx)(`li`,{className:`workflow-graph-node`,"data-node-kind":e.kind,style:{"--graph-row":String(e.column+1),"--graph-lane":String(e.row+1),"--graph-span":String(e.rowSpan)},children:e.kind===`stage`?(0,U.jsxs)(`span`,{className:`relative max-w-full`,children:[(0,U.jsx)($,{step:e.step,box:!0,plain:o,current:n===e.step.id,onSelect:r}),o?null:(0,U.jsx)(X,{count:i[e.id],name:Y(e.id,e.step.label,i[e.id]??0)})]}):(0,U.jsxs)(`div`,{className:`workflow-graph-box workflow-graph-group relative`,"data-map-group":`human`,"data-current":e.steps.some(e=>e.id===n)?`true`:void 0,children:[o?(0,U.jsx)(`span`,{className:`workflow-graph-group-label`,children:Q(e.steps)}):(0,U.jsx)(`button`,{type:`button`,className:`workflow-graph-group-label cursor-pointer rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,onClick:()=>r?.(e.steps[0].id),children:Q(e.steps)}),(0,U.jsx)(`ol`,{children:e.steps.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)($,{step:e,plain:o,current:n===e.id,onSelect:r})},e.id))}),o?null:(0,U.jsx)(X,{count:i[e.id],name:Y(e.id,Q(e.steps),i[e.id]??0)})]})},e.id))})]})}function Q(e){let[t]=e;return t?.kind===`human`?t.groupLabel:`Human review`}function te(){return(0,U.jsxs)(`ul`,{className:`workflow-graph-legend`,"aria-hidden":`true`,children:[(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`i`,{className:`workflow-legend-optional`}),`optional`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`i`,{className:`workflow-graph-openspec`}),`OpenSpec`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`i`,{className:`workflow-legend-session`}),`new session`]}),(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`i`,{className:`workflow-legend-skip`}),`can be skipped`]})]})}function ne({graph:e}){return(0,U.jsxs)(`svg`,{className:`workflow-graph-layer`,"aria-hidden":`true`,focusable:`false`,children:[(0,U.jsx)(`svg`,{viewBox:`0 0 ${N(e)} ${e.columns}`,preserveAspectRatio:`none`,overflow:`visible`,children:e.edges.map(t=>(0,U.jsx)(`path`,{className:`workflow-graph-edge`,d:z(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},`${t.kind}-${t.from}-${t.to}`))}),e.nodes.map(t=>{if(t.kind!==`start`)return null;let{x:n,y:r}=V(e,P(t));return(0,U.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}=V(e,B(e,t));return(0,U.jsx)(`circle`,{className:`workflow-graph-session`,"data-session-mark":t.to,cx:n,cy:r,r:`3.5`},`${t.from}-${t.to}`)})]})}function $({step:e,box:t,plain:n,current:r,onSelect:i}){let a={className:t?`workflow-graph-link workflow-graph-box`:`workflow-graph-link`,"data-map-stage":e.id,"data-stage-kind":e.kind,"data-optional":e.optional?`true`:void 0},o=(0,U.jsxs)(U.Fragment,{children:[e.badges.includes(`openspec`)?(0,U.jsx)(`span`,{className:`workflow-graph-openspec`,"aria-hidden":`true`}):null,e.kind===`human`?e.artifact:e.label]});return n?(0,U.jsx)(`span`,{...a,children:o}):(0,U.jsx)(`button`,{type:`button`,...a,"aria-label":e.kind===`human`?e.label:void 0,"aria-current":r?`true`:void 0,onClick:()=>i?.(e.id),children:o})}function re({step:e,stepsKnown:t,changes:n,children:r}){return(0,U.jsxs)(`article`,{className:`workflow-card`,"data-stage":e.id,"data-stage-kind":e.kind,"data-optional":e.optional?`true`:void 0,children:[(0,U.jsx)(x,{title:e.label,kicker:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{children:T[e.phase]}),e.optional?(0,U.jsx)(`span`,{children:`· optional`}):null,e.kind===`human`?(0,U.jsx)(`span`,{className:`text-why`,children:`· human review`}):null,e.badges.includes(`openspec`)?(0,U.jsx)(`span`,{children:`· OpenSpec`}):null]}),children:e.skill||e.sessionBreakBefore?(0,U.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm text-muted`,children:[e.skill?(0,U.jsx)(`code`,{className:`font-mono text-text`,children:e.skill}):null,e.sessionBreakBefore?(0,U.jsxs)(`span`,{className:`workflow-card-session inline-flex items-center gap-1.5 text-accent`,children:[(0,U.jsx)(`span`,{className:`size-2 rounded-full border-[1.5px] border-accent`,"aria-hidden":`true`}),`New session / clean chat`]}):null]}):null}),r,(0,U.jsxs)(y,{title:e.kind===`human`?`How it runs`:`Run`,children:[(0,U.jsx)(ie,{step:e}),e.missingSkill?(0,U.jsxs)(`p`,{className:`workflow-missing-skill m-0 text-sm text-warn`,role:`note`,children:[`Skill not reported for this companion:`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:e.missingSkill}),`. Run`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:`mate companion update`}),`; this stage is not complete.`]}):null]}),e.kind===`skill`&&t?(0,U.jsx)(y,{title:`Steps`,aside:e.source,children:(0,U.jsx)(`ol`,{className:`workflow-stage-steps m-0 grid list-decimal gap-1 pl-5 text-sm`,children:e.steps.map((e,t)=>(0,U.jsx)(`li`,{children:(0,U.jsx)(`code`,{className:`font-mono`,children:e.skill})},`${t}-${e.skill}`))})}):null,(0,U.jsx)(y,{title:`What`,children:(0,U.jsx)(`p`,{className:`m-0 text-sm leading-relaxed`,children:e.what})}),(0,U.jsx)(y,{title:`Why`,children:(0,U.jsx)(`p`,{className:`m-0 text-sm leading-relaxed`,children:e.why})}),n.length>0?(0,U.jsx)(y,{title:`Changes at this stage`,aside:String(n.length),children:(0,U.jsx)(`ul`,{className:`m-0 grid list-none gap-1 p-0`,children:n.map(e=>(0,U.jsx)(`li`,{className:`truncate font-mono text-sm`,children:e},e))})}):null]})}function ie({step:e}){return e.kind===`human`?(0,U.jsxs)(`p`,{className:`workflow-card-human m-0 text-sm`,children:[`Review `,e.artifact,` yourself — no skill, no prompt`]}):e.alternatives?.length?(0,U.jsx)(`div`,{className:`workflow-option-list grid gap-3`,children:e.alternatives.map(e=>(0,U.jsxs)(`div`,{className:`workflow-option grid gap-1.5`,children:[(0,U.jsx)(t,{text:e.prompt,copy:e.copyPrompt,label:`${e.name} prompt`}),(0,U.jsx)(`small`,{className:`text-xs text-muted`,children:e.description})]},e.name))}):e.prompt?(0,U.jsx)(t,{text:e.prompt,copy:e.copyPrompt??e.prompt,label:`${e.label} prompt`}):null}var ae=p();function oe(e,t){let n=e.map(e=>({name:e.name,stage:l(e,t).stageId})),r=o(t).map(e=>({node:e.kind===`review`?w(e.id):e.id,label:e.label,changes:n.flatMap(t=>t.stage===e.id?[t.name]:[])})),i={};for(let e of r)e.changes.length>0&&(i[e.node]=e.changes.length);return{counts:i,byStage:r}}var se=[];function ce({payload:e,changes:t=se}){let{counts:n,byStage:r}=oe(t,e.workflow??ae);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(m,{warnings:e.warnings}),(0,U.jsx)(`div`,{className:`workflow-view`,children:(0,U.jsx)(K,{payload:e,counts:n,changesByStage:r})})]})}var le=function(){let t=c.useSearch(),n=u(),r=e({...d(`dashboard`,t),enabled:n});return(0,U.jsx)(f,{view:`workflow`,search:t,children:e=>(0,U.jsx)(ce,{payload:{skills:e.skills??[],topology:e.topology??null,warnings:e.warnings,workflow:e.workflow},changes:s(r.data?.changes??[],r.data?.submitted??[])})})};export{le as component};
|
|
@@ -39,75 +39,75 @@ function useMatch(opts) {
|
|
|
39
39
|
var manifest = {
|
|
40
40
|
"129eb7026f249381cdf25972dd63a821750853b2ea77ea3a1fdd22b56f1b24ec": {
|
|
41
41
|
functionName: "setFrictionRecording_createServerFn_handler",
|
|
42
|
-
importer: () => import("./friction-
|
|
42
|
+
importer: () => import("./friction-BW86PCPM.js")
|
|
43
43
|
},
|
|
44
44
|
"3d0d77471aa778cecabd4e5db91ab864e236510fba212a7e364cf9ee35750729": {
|
|
45
45
|
functionName: "getFriction_createServerFn_handler",
|
|
46
|
-
importer: () => import("./friction-
|
|
46
|
+
importer: () => import("./friction-BW86PCPM.js")
|
|
47
47
|
},
|
|
48
48
|
"3fcb2bd7158d460f09117ddf736a3fc4d2e1cf934bfd85a7de1e60845d0163a6": {
|
|
49
49
|
functionName: "getGraph_createServerFn_handler",
|
|
50
|
-
importer: () => import("./graph-
|
|
50
|
+
importer: () => import("./graph-DGZHV-Ek.js")
|
|
51
51
|
},
|
|
52
52
|
"5e73090d9c6425d4df9cce1d826a9c73a3d311894aa464b4ec5b9264b275b9b8": {
|
|
53
53
|
functionName: "getUsage_createServerFn_handler",
|
|
54
|
-
importer: () => import("./usage-
|
|
54
|
+
importer: () => import("./usage-Dw_UQFX-.js")
|
|
55
55
|
},
|
|
56
56
|
"63d1e2171062e2d082e16522c162963c4da2a71c447f69f0937bd6e5e10b73ba": {
|
|
57
57
|
functionName: "saveVaultFile_createServerFn_handler",
|
|
58
|
-
importer: () => import("./vault-
|
|
58
|
+
importer: () => import("./vault-BzarssiL.js")
|
|
59
59
|
},
|
|
60
60
|
"7564d662d1e0ede6133407d7dde8d613b3b11718bc4f95160680342deeaf9cfd": {
|
|
61
61
|
functionName: "getVaultChildren_createServerFn_handler",
|
|
62
|
-
importer: () => import("./vault-
|
|
62
|
+
importer: () => import("./vault-BzarssiL.js")
|
|
63
63
|
},
|
|
64
64
|
"8a3086c4bf87fd353e471c38fe6c5e531cb9aa6b29b234d7edb6de5d143cf689": {
|
|
65
65
|
functionName: "getSkillPreview_createServerFn_handler",
|
|
66
|
-
importer: () => import("./skills-
|
|
66
|
+
importer: () => import("./skills-Bj8eOgzR.js")
|
|
67
67
|
},
|
|
68
68
|
"990d830ca9afc020639551c43ec50904b734051c52b1ad91dbf739065b343bb3": {
|
|
69
69
|
functionName: "getReports_createServerFn_handler",
|
|
70
|
-
importer: () => import("./reports-
|
|
70
|
+
importer: () => import("./reports-DDaH5k0H.js")
|
|
71
71
|
},
|
|
72
72
|
"99f4d57911b5959a331ed18424ab13369de22f8b2b142a146ea967742dfbc997": {
|
|
73
73
|
functionName: "getVaultMatches_createServerFn_handler",
|
|
74
|
-
importer: () => import("./vault-
|
|
74
|
+
importer: () => import("./vault-BzarssiL.js")
|
|
75
75
|
},
|
|
76
76
|
"9d1ee2ce056a1b26a05141623f6d836fa1c4c283e555132764a528a212e3c50a": {
|
|
77
77
|
functionName: "deleteCompanion_createServerFn_handler",
|
|
78
|
-
importer: () => import("./companions-
|
|
78
|
+
importer: () => import("./companions-YNLsbnch.js")
|
|
79
79
|
},
|
|
80
80
|
"a09876e9d912d4f3edfe004081679f011fcebe77cfe1b2b25cf6f3e6f1eafc6a": {
|
|
81
81
|
functionName: "getCompanionView_createServerFn_handler",
|
|
82
|
-
importer: () => import("./views-
|
|
82
|
+
importer: () => import("./views-CAxwKHMK.js")
|
|
83
83
|
},
|
|
84
84
|
"b2e22d82aeef8a3802144ae67d3a53a4fff5860a1a0b957618e8dcc7c0ef36c8": {
|
|
85
85
|
functionName: "getGuide_createServerFn_handler",
|
|
86
|
-
importer: () => import("./guides-
|
|
86
|
+
importer: () => import("./guides-CEwLOZb9.js")
|
|
87
87
|
},
|
|
88
88
|
"b4cd58adfccec803b6c97478c78656e3acf554351ec97ef0ce550a10e235ebce": {
|
|
89
89
|
functionName: "getShell_createServerFn_handler",
|
|
90
|
-
importer: () => import("./shell-
|
|
90
|
+
importer: () => import("./shell-BxbYYaAk.js")
|
|
91
91
|
},
|
|
92
92
|
"c9e07976b298f1d1353d3422b03638f260b66975d28a1c8b07919923be8c488d": {
|
|
93
93
|
functionName: "previewVaultFile_createServerFn_handler",
|
|
94
|
-
importer: () => import("./vault-
|
|
94
|
+
importer: () => import("./vault-BzarssiL.js")
|
|
95
95
|
},
|
|
96
96
|
"cc0685774bfb5205a762c25bdd4b959c1f541584df4b67aac816fe529fa37c87": {
|
|
97
97
|
functionName: "getVault_createServerFn_handler",
|
|
98
|
-
importer: () => import("./vault-
|
|
98
|
+
importer: () => import("./vault-BzarssiL.js")
|
|
99
99
|
},
|
|
100
100
|
"ce3152edd0f9f5f9d010eb4e4217f988b6787024b3f6a48677370a325f4698aa": {
|
|
101
101
|
functionName: "addCompanion_createServerFn_handler",
|
|
102
|
-
importer: () => import("./companions-
|
|
102
|
+
importer: () => import("./companions-YNLsbnch.js")
|
|
103
103
|
},
|
|
104
104
|
"e257827a07a72fbb27ff303a6d721f51ae699f21ddaaa8fb7b1f33203d573c56": {
|
|
105
105
|
functionName: "markFriction_createServerFn_handler",
|
|
106
|
-
importer: () => import("./friction-
|
|
106
|
+
importer: () => import("./friction-BW86PCPM.js")
|
|
107
107
|
},
|
|
108
108
|
"f1599335a08f9f65c30311d4e51c4cfad933345d616c61c8945d5183444c2503": {
|
|
109
109
|
functionName: "getFrictionRecording_createServerFn_handler",
|
|
110
|
-
importer: () => import("./friction-
|
|
110
|
+
importer: () => import("./friction-BW86PCPM.js")
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
async function getServerFnById(id, access) {
|
|
@@ -16,141 +16,141 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
16
16
|
"/plugins/$service/$view"
|
|
17
17
|
],
|
|
18
18
|
preloads: [
|
|
19
|
-
"/assets/index-
|
|
19
|
+
"/assets/index-zmRH87D4.js",
|
|
20
20
|
"/assets/jsx-runtime-MZURdZre.js",
|
|
21
|
-
"/assets/button-
|
|
22
|
-
"/assets/
|
|
23
|
-
"/assets/studio-queries-
|
|
21
|
+
"/assets/button-C9SQW3kI.js",
|
|
22
|
+
"/assets/cn-DC80MJV0.js",
|
|
23
|
+
"/assets/studio-queries-CkUSByy7.js",
|
|
24
24
|
"/assets/useSelector-AYcH7lB0.js",
|
|
25
|
-
"/assets/studio-
|
|
26
|
-
"/assets/prepaint-
|
|
27
|
-
"/assets/queries-
|
|
28
|
-
"/assets/search-
|
|
25
|
+
"/assets/studio-ndtFcS2Y.js",
|
|
26
|
+
"/assets/prepaint-BkoDSw5X.js",
|
|
27
|
+
"/assets/queries-CMvC2OkU.js",
|
|
28
|
+
"/assets/search-DxidNK2M.js",
|
|
29
29
|
"/assets/react-BYUSgtBs.js",
|
|
30
|
-
"/assets/fields-
|
|
31
|
-
"/assets/useMutation-
|
|
30
|
+
"/assets/fields-CEep8IFT.js",
|
|
31
|
+
"/assets/useMutation-CqtM9COw.js",
|
|
32
32
|
"/assets/preload-helper-BLdHbfdN.js",
|
|
33
|
-
"/assets/guides-
|
|
34
|
-
"/assets/store-
|
|
35
|
-
"/assets/useAnchoredPopupScrollLock-
|
|
33
|
+
"/assets/guides-CsL0660B.js",
|
|
34
|
+
"/assets/store-BYnEU33C.js",
|
|
35
|
+
"/assets/useAnchoredPopupScrollLock-dc_kP4Go.js"
|
|
36
36
|
],
|
|
37
37
|
scripts: [{ attrs: {
|
|
38
38
|
type: "module",
|
|
39
39
|
async: !0,
|
|
40
|
-
src: "/assets/index-
|
|
40
|
+
src: "/assets/index-zmRH87D4.js"
|
|
41
41
|
} }]
|
|
42
42
|
},
|
|
43
43
|
"/": {
|
|
44
44
|
filePath: "src/routes/index.tsx",
|
|
45
45
|
children: void 0,
|
|
46
46
|
preloads: [
|
|
47
|
-
"/assets/routes-
|
|
48
|
-
"/assets/companion-view-
|
|
49
|
-
"/assets/panel-
|
|
50
|
-
"/assets/warnings-
|
|
51
|
-
"/assets/markdown-view-
|
|
47
|
+
"/assets/routes-BokQmHtC.js",
|
|
48
|
+
"/assets/companion-view-C1F0_jbt.js",
|
|
49
|
+
"/assets/panel-COgk0vP5.js",
|
|
50
|
+
"/assets/warnings-Cnw99ugO.js",
|
|
51
|
+
"/assets/markdown-view-dku7MGPn.js"
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
54
|
"/friction": {
|
|
55
55
|
filePath: "src/routes/friction.tsx",
|
|
56
56
|
children: void 0,
|
|
57
|
-
preloads: ["/assets/friction-
|
|
57
|
+
preloads: ["/assets/friction-D9dBU7WN.js", "/assets/select-CYFCbHUd.js"]
|
|
58
58
|
},
|
|
59
59
|
"/getting-started": {
|
|
60
60
|
filePath: "src/routes/getting-started.tsx",
|
|
61
61
|
children: ["/getting-started/$topic", "/getting-started/"],
|
|
62
|
-
preloads: ["/assets/getting-started-
|
|
62
|
+
preloads: ["/assets/getting-started-BDyGvHhc.js"]
|
|
63
63
|
},
|
|
64
64
|
"/graph": {
|
|
65
65
|
filePath: "src/routes/graph.tsx",
|
|
66
66
|
children: void 0,
|
|
67
67
|
preloads: [
|
|
68
|
-
"/assets/graph-
|
|
69
|
-
"/assets/panel-
|
|
70
|
-
"/assets/specs-view-
|
|
71
|
-
"/assets/select-
|
|
72
|
-
"/assets/combobox-
|
|
73
|
-
"/assets/markdown-view-
|
|
74
|
-
"/assets/warnings-
|
|
68
|
+
"/assets/graph-ah7ZXfTa.js",
|
|
69
|
+
"/assets/panel-COgk0vP5.js",
|
|
70
|
+
"/assets/specs-view-znqFPx9p.js",
|
|
71
|
+
"/assets/select-CYFCbHUd.js",
|
|
72
|
+
"/assets/combobox-D7mKYCBb.js",
|
|
73
|
+
"/assets/markdown-view-dku7MGPn.js",
|
|
74
|
+
"/assets/warnings-Cnw99ugO.js"
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"/reports": {
|
|
78
78
|
filePath: "src/routes/reports.tsx",
|
|
79
79
|
children: void 0,
|
|
80
|
-
preloads: ["/assets/reports-
|
|
80
|
+
preloads: ["/assets/reports-C_AqLBYH.js", "/assets/panel-COgk0vP5.js"]
|
|
81
81
|
},
|
|
82
82
|
"/skills": {
|
|
83
83
|
filePath: "src/routes/skills.tsx",
|
|
84
84
|
children: void 0,
|
|
85
85
|
preloads: [
|
|
86
|
-
"/assets/skills-
|
|
87
|
-
"/assets/companion-view-
|
|
88
|
-
"/assets/panel-
|
|
89
|
-
"/assets/steps-
|
|
90
|
-
"/assets/markdown-view-
|
|
86
|
+
"/assets/skills-R3vttWHM.js",
|
|
87
|
+
"/assets/companion-view-C1F0_jbt.js",
|
|
88
|
+
"/assets/panel-COgk0vP5.js",
|
|
89
|
+
"/assets/steps-tVDWn7j6.js",
|
|
90
|
+
"/assets/markdown-view-dku7MGPn.js"
|
|
91
91
|
]
|
|
92
92
|
},
|
|
93
93
|
"/specs": {
|
|
94
94
|
filePath: "src/routes/specs.tsx",
|
|
95
95
|
children: void 0,
|
|
96
96
|
preloads: [
|
|
97
|
-
"/assets/specs-
|
|
98
|
-
"/assets/companion-view-
|
|
99
|
-
"/assets/specs-view-
|
|
100
|
-
"/assets/select-
|
|
101
|
-
"/assets/combobox-
|
|
102
|
-
"/assets/markdown-view-
|
|
103
|
-
"/assets/panel-
|
|
104
|
-
"/assets/warnings-
|
|
97
|
+
"/assets/specs-Bqd1ajyD.js",
|
|
98
|
+
"/assets/companion-view-C1F0_jbt.js",
|
|
99
|
+
"/assets/specs-view-znqFPx9p.js",
|
|
100
|
+
"/assets/select-CYFCbHUd.js",
|
|
101
|
+
"/assets/combobox-D7mKYCBb.js",
|
|
102
|
+
"/assets/markdown-view-dku7MGPn.js",
|
|
103
|
+
"/assets/panel-COgk0vP5.js",
|
|
104
|
+
"/assets/warnings-Cnw99ugO.js"
|
|
105
105
|
]
|
|
106
106
|
},
|
|
107
107
|
"/usage": {
|
|
108
108
|
filePath: "src/routes/usage.tsx",
|
|
109
109
|
children: void 0,
|
|
110
110
|
preloads: [
|
|
111
|
-
"/assets/usage-
|
|
112
|
-
"/assets/combobox-
|
|
113
|
-
"/assets/select-
|
|
111
|
+
"/assets/usage-Kuhr8dSl.js",
|
|
112
|
+
"/assets/combobox-D7mKYCBb.js",
|
|
113
|
+
"/assets/select-CYFCbHUd.js"
|
|
114
114
|
]
|
|
115
115
|
},
|
|
116
116
|
"/vault": {
|
|
117
117
|
filePath: "src/routes/vault.tsx",
|
|
118
118
|
children: void 0,
|
|
119
|
-
preloads: ["/assets/vault-
|
|
119
|
+
preloads: ["/assets/vault-CSP8kwRg.js", "/assets/markdown-view-dku7MGPn.js"]
|
|
120
120
|
},
|
|
121
121
|
"/workflow": {
|
|
122
122
|
filePath: "src/routes/workflow.tsx",
|
|
123
123
|
children: void 0,
|
|
124
124
|
preloads: [
|
|
125
|
-
"/assets/workflow-
|
|
126
|
-
"/assets/companion-view-
|
|
127
|
-
"/assets/warnings-
|
|
128
|
-
"/assets/panel-
|
|
129
|
-
"/assets/steps-
|
|
125
|
+
"/assets/workflow-BPJAmmZi.js",
|
|
126
|
+
"/assets/companion-view-C1F0_jbt.js",
|
|
127
|
+
"/assets/warnings-Cnw99ugO.js",
|
|
128
|
+
"/assets/panel-COgk0vP5.js",
|
|
129
|
+
"/assets/steps-tVDWn7j6.js"
|
|
130
130
|
]
|
|
131
131
|
},
|
|
132
132
|
"/getting-started/$topic": {
|
|
133
133
|
filePath: "src/routes/getting-started.$topic.tsx",
|
|
134
134
|
children: void 0,
|
|
135
135
|
preloads: [
|
|
136
|
-
"/assets/getting-started._topic-
|
|
137
|
-
"/assets/getting-started-
|
|
138
|
-
"/assets/markdown-view-
|
|
136
|
+
"/assets/getting-started._topic-B9ajbF4o.js",
|
|
137
|
+
"/assets/getting-started-BN4aTpsz.js",
|
|
138
|
+
"/assets/markdown-view-dku7MGPn.js"
|
|
139
139
|
]
|
|
140
140
|
},
|
|
141
141
|
"/getting-started/": {
|
|
142
142
|
filePath: "src/routes/getting-started.index.tsx",
|
|
143
143
|
children: void 0,
|
|
144
144
|
preloads: [
|
|
145
|
-
"/assets/getting-started.index-
|
|
146
|
-
"/assets/getting-started-
|
|
147
|
-
"/assets/markdown-view-
|
|
145
|
+
"/assets/getting-started.index-CYiBPtb7.js",
|
|
146
|
+
"/assets/getting-started-BN4aTpsz.js",
|
|
147
|
+
"/assets/markdown-view-dku7MGPn.js"
|
|
148
148
|
]
|
|
149
149
|
},
|
|
150
150
|
"/plugins/$service/$view": {
|
|
151
151
|
filePath: "src/routes/plugins.$service.$view.tsx",
|
|
152
152
|
children: void 0,
|
|
153
|
-
preloads: ["/assets/plugins._service._view-
|
|
153
|
+
preloads: ["/assets/plugins._service._view-Cn3WBHab.js"]
|
|
154
154
|
}
|
|
155
155
|
} });
|
|
156
156
|
export { tsrStartManifest };
|