@open-mercato/cezar 0.9.3 → 0.10.0-pr892.1298
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/README.md +165 -36
- package/dist/agent-config/account-identity.d.ts +44 -0
- package/dist/agent-config/account-identity.js +128 -0
- package/dist/agent-config/account-identity.js.map +1 -0
- package/dist/agent-config/catalog.d.ts +8 -0
- package/dist/agent-config/catalog.js +18 -0
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/model-settings/claude.d.ts +2 -0
- package/dist/agent-config/model-settings/claude.js +11 -0
- package/dist/agent-config/model-settings/claude.js.map +1 -0
- package/dist/agent-config/model-settings/codex.d.ts +2 -0
- package/dist/agent-config/model-settings/codex.js +16 -0
- package/dist/agent-config/model-settings/codex.js.map +1 -0
- package/dist/agent-config/model-settings/opencode.d.ts +2 -0
- package/dist/agent-config/model-settings/opencode.js +8 -0
- package/dist/agent-config/model-settings/opencode.js.map +1 -0
- package/dist/agent-config/model-settings/pi.d.ts +12 -0
- package/dist/agent-config/model-settings/pi.js +18 -0
- package/dist/agent-config/model-settings/pi.js.map +1 -0
- package/dist/agent-config/model-settings/shared.d.ts +9 -0
- package/dist/agent-config/model-settings/shared.js +93 -0
- package/dist/agent-config/model-settings/shared.js.map +1 -0
- package/dist/agent-config/model-settings/types.d.ts +9 -0
- package/dist/agent-config/model-settings/types.js +2 -0
- package/dist/agent-config/model-settings/types.js.map +1 -0
- package/dist/agent-config/models.d.ts +9 -0
- package/dist/agent-config/models.js +32 -0
- package/dist/agent-config/models.js.map +1 -0
- package/dist/agent-config/service.js +4 -4
- package/dist/agent-config/service.js.map +1 -1
- package/dist/automations/types.d.ts +4 -0
- package/dist/automations/types.js +2 -1
- package/dist/automations/types.js.map +1 -1
- package/dist/config.d.ts +10 -1
- package/dist/config.js +48 -5
- package/dist/config.js.map +1 -1
- package/dist/contract/agent-config.d.ts +2 -0
- package/dist/contract/agent-profiles.d.ts +347 -0
- package/dist/contract/automations.d.ts +24 -0
- package/dist/contract/events.d.ts +59 -0
- package/dist/contract/github.d.ts +88 -0
- package/dist/contract/health.d.ts +5 -1
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +981 -544
- package/dist/contract/projects.d.ts +33 -5
- package/dist/contract/runs.d.ts +247 -0
- package/dist/contract/skills.d.ts +7 -0
- package/dist/contract/workflows.d.ts +6 -0
- package/dist/contract/workspace.d.ts +137 -2
- package/dist/core/agent-env.js +41 -16
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-model-policy.d.ts +10 -0
- package/dist/core/agent-model-policy.js +36 -0
- package/dist/core/agent-model-policy.js.map +1 -0
- package/dist/core/agent-profiles.d.ts +62 -0
- package/dist/core/agent-profiles.js +90 -0
- package/dist/core/agent-profiles.js.map +1 -0
- package/dist/core/agent-runner.d.ts +37 -6
- package/dist/core/agent-runner.js +35 -3
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/backend-detect.d.ts +5 -5
- package/dist/core/backend-detect.js +44 -7
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/claude-cli-runner.js +10 -5
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.js +13 -3
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.js +7 -2
- package/dist/core/codex-app-server-transport.js.map +1 -1
- package/dist/core/model-identity.d.ts +23 -11
- package/dist/core/model-identity.js +41 -24
- package/dist/core/model-identity.js.map +1 -1
- package/dist/core/model-presets.d.ts +8 -2
- package/dist/core/model-presets.js +51 -8
- package/dist/core/model-presets.js.map +1 -1
- package/dist/core/opencode-model-catalog.d.ts +32 -0
- package/dist/core/opencode-model-catalog.js +153 -0
- package/dist/core/opencode-model-catalog.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +2 -0
- package/dist/core/opencode-server-runner.js +42 -11
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-runner.d.ts +24 -0
- package/dist/core/pi-runner.js +349 -0
- package/dist/core/pi-runner.js.map +1 -0
- package/dist/core/pi-ui-mapper.d.ts +34 -0
- package/dist/core/pi-ui-mapper.js +270 -0
- package/dist/core/pi-ui-mapper.js.map +1 -0
- package/dist/core/provider-auth.d.ts +95 -3
- package/dist/core/provider-auth.js +234 -15
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/provider-availability.d.ts +1 -1
- package/dist/core/provider-availability.js +2 -1
- package/dist/core/provider-availability.js.map +1 -1
- package/dist/core/runner-factory.js +3 -0
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/shell-env.d.ts +28 -0
- package/dist/core/shell-env.js +56 -0
- package/dist/core/shell-env.js.map +1 -0
- package/dist/core/ui-events.d.ts +1 -1
- package/dist/core/usage-limit.d.ts +42 -0
- package/dist/core/usage-limit.js +209 -0
- package/dist/core/usage-limit.js.map +1 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +53 -5
- package/dist/paths.js +63 -9
- package/dist/paths.js.map +1 -1
- package/dist/planner.js +6 -0
- package/dist/planner.js.map +1 -1
- package/dist/release/snapshot.d.ts +13 -2
- package/dist/release/snapshot.js +25 -1
- package/dist/release/snapshot.js.map +1 -1
- package/dist/runs/agent-tmpdir.d.ts +41 -0
- package/dist/runs/agent-tmpdir.js +183 -0
- package/dist/runs/agent-tmpdir.js.map +1 -0
- package/dist/runs/auto-name.js +6 -1
- package/dist/runs/auto-name.js.map +1 -1
- package/dist/runs/event-history.d.ts +50 -0
- package/dist/runs/event-history.js +613 -0
- package/dist/runs/event-history.js.map +1 -0
- package/dist/runs/run-index.d.ts +19 -0
- package/dist/runs/run-index.js +43 -0
- package/dist/runs/run-index.js.map +1 -0
- package/dist/runs/store.d.ts +78 -19
- package/dist/runs/store.js +175 -43
- package/dist/runs/store.js.map +1 -1
- package/dist/server/forge/github.d.ts +169 -0
- package/dist/server/forge/github.js +511 -0
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/index.d.ts +9 -0
- package/dist/server/forge/index.js +14 -0
- package/dist/server/forge/index.js.map +1 -1
- package/dist/server/github.d.ts +2 -2
- package/dist/server/github.js +1 -1
- package/dist/server/github.js.map +1 -1
- package/dist/server/open-in-app.d.ts +2 -1
- package/dist/server/open-in-app.js +3 -1
- package/dist/server/open-in-app.js.map +1 -1
- package/dist/server/open-in-terminal.d.ts +46 -1
- package/dist/server/open-in-terminal.js +72 -13
- package/dist/server/open-in-terminal.js.map +1 -1
- package/dist/server/provider-action-gate.js +3 -1
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/server.d.ts +2199 -428
- package/dist/server/server.js +1171 -139
- package/dist/server/server.js.map +1 -1
- package/dist/server-install/engine.js +5 -18
- package/dist/server-install/engine.js.map +1 -1
- package/dist/server-install/steps.js +6 -2
- package/dist/server-install/steps.js.map +1 -1
- package/dist/skills.js +4 -0
- package/dist/skills.js.map +1 -1
- package/dist/workflows/run.d.ts +202 -2
- package/dist/workflows/run.js +782 -115
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +3 -0
- package/dist/workflows/types.js +11 -2
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/agent-accounts.d.ts +153 -0
- package/dist/workspace/agent-accounts.js +304 -0
- package/dist/workspace/agent-accounts.js.map +1 -0
- package/dist/workspace/agent-profiles.d.ts +78 -0
- package/dist/workspace/agent-profiles.js +115 -0
- package/dist/workspace/agent-profiles.js.map +1 -0
- package/dist/workspace/config.d.ts +19 -1
- package/dist/workspace/config.js +56 -2
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/projects-cli.js +54 -4
- package/dist/workspace/projects-cli.js.map +1 -1
- package/dist/workspace/projects.d.ts +19 -1
- package/dist/workspace/projects.js +34 -1
- package/dist/workspace/projects.js.map +1 -1
- package/dist/workspace/semaphore.d.ts +39 -0
- package/dist/workspace/semaphore.js +31 -0
- package/dist/workspace/semaphore.js.map +1 -1
- package/package.json +3 -3
- package/scripts/mock-claude.mjs +20 -0
- package/scripts/mock-pi-rpc.mjs +83 -0
- package/web/dist/assets/{alert-dialog-V9cigyAO.js → alert-dialog-Byp42_IG.js} +1 -1
- package/web/dist/assets/arrow-down-CGDbDYKD.js +1 -0
- package/web/dist/assets/arrow-left-ESCjr1Hq.js +1 -0
- package/web/dist/assets/centered-state-LfAW-igm.js +43 -0
- package/web/dist/assets/chevron-right-Du-P1IUd.js +1 -0
- package/web/dist/assets/{collapsible-BlF-7CeC.js → collapsible-CBiiqDJM.js} +1 -1
- package/web/dist/assets/{commit-list-D2mKElUx.js → commit-list-6PPve7PE.js} +1 -1
- package/web/dist/assets/{compare-variants-CFBY16Rc.js → compare-variants-BDnp6mXJ.js} +1 -1
- package/web/dist/assets/{diff-DE6u5dTe.js → diff-_jK0OWpF.js} +2 -2
- package/web/dist/assets/{diff-stat-B1j6L7C6.js → diff-stat-CIrTu4Ym.js} +1 -1
- package/web/dist/assets/{diff-view-Gb2kk3Le.js → diff-view-COA_5IyY.js} +1 -1
- package/web/dist/assets/dropdown-menu-BofYpFFw.js +1 -0
- package/web/dist/assets/editable-title-_J0zFDl-.js +1 -0
- package/web/dist/assets/{ellipsis-vertical-BbxtXb6s.js → ellipsis-vertical-BeMR-l62.js} +1 -1
- package/web/dist/assets/{file-j5O4NryU.js → file-DY996Pee.js} +1 -1
- package/web/dist/assets/{folder-w9Lwj9x9.js → folder-NO3Ec-TY.js} +1 -1
- package/web/dist/assets/git-toolbar-BqJeUWcD.js +1 -0
- package/web/dist/assets/github-C96HPV9E.js +1 -0
- package/web/dist/assets/{image-preview-CcFdkZXW.js → image-preview-D9cCDfKQ.js} +1 -1
- package/web/dist/assets/index-Bx-grqa9.css +2 -0
- package/web/dist/assets/index-DoVvGDfW.js +7 -0
- package/web/dist/assets/{markdown-q9lm7kQ2.js → markdown-DDzk11zj.js} +1 -1
- package/web/dist/assets/new-task-form-BNLLgC6P.js +1 -0
- package/web/dist/assets/pill-CVM1EmV4.js +1 -0
- package/web/dist/assets/{project-router-DudOmkHf.js → project-router-LRCtP48W.js} +1 -1
- package/web/dist/assets/prompt-templates-DFOvYgtW.js +15 -0
- package/web/dist/assets/{refresh-cw-_C2EGJK5.js → refresh-cw-D1ys6QY2.js} +1 -1
- package/web/dist/assets/repo-git-CzUnsgWY.js +1 -0
- package/web/dist/assets/{run-diff-BLoKEnTx.js → run-diff-BlnqwfSS.js} +2 -2
- package/web/dist/assets/run-header-Bn7cN0Z1.js +1 -0
- package/web/dist/assets/{search-x-BgxaJgro.js → search-x-D6FSpxId.js} +1 -1
- package/web/dist/assets/{skill-empty-hint-D5MOmycv.js → skill-empty-hint-iwpCcqgI.js} +1 -1
- package/web/dist/assets/skills-CezbOaol.js +1 -0
- package/web/dist/assets/{sparkles-ANSka5bH.js → sparkles-MrQrgCI9.js} +1 -1
- package/web/dist/assets/{square-terminal-qojq20cH.js → square-terminal-TTH64lO7.js} +1 -1
- package/web/dist/assets/tab-link-FYksz037.js +1 -0
- package/web/dist/assets/task-changes-ClWlnzBL.js +1 -0
- package/web/dist/assets/{task-commits-yXmDrCoE.js → task-commits-Crbrl86b.js} +1 -1
- package/web/dist/assets/{task-files-BDRmCCPN.js → task-files-uSCWyD0-.js} +2 -2
- package/web/dist/assets/task-thread-DPmamBA1.js +9 -0
- package/web/dist/assets/{textarea-DVO7pg8Y.js → textarea-B9Ahj4E4.js} +1 -1
- package/web/dist/assets/thread-loading-BH_ypQoy.js +1 -0
- package/web/dist/assets/{trash-2-DKcnmg6e.js → trash-2-D8S3V3fu.js} +1 -1
- package/web/dist/assets/{triangle-alert-CPUEVSZ3.js → triangle-alert-bB7p9n5E.js} +1 -1
- package/web/dist/assets/{upload-D5Jrq7QK.js → upload-Bd5oRLPV.js} +1 -1
- package/web/dist/assets/{use-desktop-CXae6uyk.js → use-desktop-BNvbRBeZ.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-RKJLKdsW.js → use-submit-shortcut-B-xhu4Bf.js} +1 -1
- package/web/dist/assets/utils-BhpbVMwN.js +64 -0
- package/web/dist/assets/{workflows-CGyTdyds.js → workflows-RmfbM9Vy.js} +3 -3
- package/web/dist/assets/{zoomable-image-hcqwUIlQ.js → zoomable-image-BCW6ZBV0.js} +1 -1
- package/web/dist/index.html +24 -23
- package/web/dist/assets/arrow-down-DflHdNlN.js +0 -1
- package/web/dist/assets/arrow-left-IIL4uR-C.js +0 -1
- package/web/dist/assets/centered-state-BkAJVLJE.js +0 -43
- package/web/dist/assets/chevron-right-CxAoD1eD.js +0 -1
- package/web/dist/assets/circle-check-CdwcIbkx.js +0 -1
- package/web/dist/assets/circle-x-Cnc43xJ2.js +0 -1
- package/web/dist/assets/dropdown-menu-Ns-rY6sm.js +0 -1
- package/web/dist/assets/editable-title-BGuiDxFT.js +0 -1
- package/web/dist/assets/git-pull-request-DlSop3Ch.js +0 -1
- package/web/dist/assets/git-toolbar-BdJ8XSxI.js +0 -1
- package/web/dist/assets/github-CCLn2OAU.js +0 -1
- package/web/dist/assets/index-BmHHLbwc.js +0 -6
- package/web/dist/assets/index-u8OAnq0r.css +0 -2
- package/web/dist/assets/new-task-form-BuYxAWN7.js +0 -1
- package/web/dist/assets/pill-t97MvPW_.js +0 -1
- package/web/dist/assets/prompt-templates-C5iO3Lda.js +0 -15
- package/web/dist/assets/repo-git-DqQzj33d.js +0 -1
- package/web/dist/assets/run-header-Dho4eurS.js +0 -1
- package/web/dist/assets/skills-B5g064CC.js +0 -1
- package/web/dist/assets/tab-link-CIcwFJtC.js +0 -1
- package/web/dist/assets/task-changes-yRfsEsnh.js +0 -1
- package/web/dist/assets/task-thread-C9AnIz4Z.js +0 -9
- package/web/dist/assets/thread-loading-DJDl701Z.js +0 -1
- package/web/dist/assets/utils-Wtkd5E6j.js +0 -64
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./alert-dialog-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./alert-dialog-Byp42_IG.js";import{i as d,n as f}from"./chunk-BO2N2NFS-DE6qKn3r.js";import{i as p,o as m,r as h,t as g}from"./highlighter-CdHqIwFr.js";function _(e,t=Date.now()){if(!e)return``;let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,(t-n)/1e3);return r<60?`${Math.floor(r)}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function v(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}var y=e(t(),1),b=n();function x({isOpen:e,onClose:t,onConfirm:n,url:d}){return(0,b.jsx)(u,{open:e,onOpenChange:e=>{e||t()},children:(0,b.jsxs)(a,{"data-slot":`link-safety-dialog`,children:[(0,b.jsxs)(l,{children:[(0,b.jsx)(i,{children:`Open this link?`}),(0,b.jsxs)(r,{children:[`It leaves cezar in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,b.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:d})]})]}),(0,b.jsxs)(s,{children:[(0,b.jsx)(c,{children:`Cancel`}),(0,b.jsx)(o,{onClick:n,children:`Open link`})]})]})})}var S={name:`shiki`,type:`code-highlighter`,getThemes:()=>[g,g],getSupportedLanguages:()=>m(),supportsLanguage:e=>m().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>p(e,String(t))||(h(e,String(t)).then(e=>n?.(e)),null)};function C(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
|
|
2
2
|
`)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var w=[...Object.values(f),C],T=[`p`,`strong`,`em`,`del`,`code`,`a`],E={p:`span`,a:`span`},D={enabled:!0,renderModal:e=>(0,b.jsx)(x,{...e})},O=(0,y.memo)(function({children:e,breaks:t=!1,inline:n=!1}){return(0,b.jsx)(d,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:{code:S},shikiTheme:[g,g],remarkPlugins:t?w:void 0,allowedElements:n?T:void 0,unwrapDisallowed:n||void 0,components:n?E:void 0,linkSafety:D,controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});export{v as n,_ as r,O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as e,r as t}from"./utils-BhpbVMwN.js";var n=t(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),r=t(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),i=t(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),a=t(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),o=t(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),s=t(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function c(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var l=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`}],u={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`},{id:`claude-fable-5`,label:`Fable 5`,desc:`Most capable — the Claude 5 family`},{id:`claude-opus-4-8`,label:`Opus 4.8`,desc:`Pinned version`},{id:`claude-sonnet-5`,label:`Sonnet 5`,desc:`Pinned version`},{id:`claude-haiku-4-5`,label:`Haiku 4.5`,desc:`Pinned version`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`},{id:`anthropic/claude-opus-4-8`,label:`claude-opus-4.8`,desc:`via Anthropic`},{id:`anthropic/claude-sonnet-5`,label:`claude-sonnet-5`,desc:`via Anthropic`},{id:`openai/gpt-5.1`,label:`gpt-5.1`,desc:`via OpenAI`}]},d=[`opencode`,`pi`];function f(e,t){return!e||u[t].some(t=>t.id===e)?!1:Object.entries(u).some(([n,r])=>n!==t&&!d.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function p(t,n,r=[]){let i=[...u[t]??u.claude],a=new Set(i.map(e=>e.id));if(e(t))for(let e of n?.models??[])!e.id||a.has(e.id)||(a.add(e.id),i.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let e of r)!e||a.has(e)||f(e,t)||(a.add(e),i.push({id:e,label:e,desc:`Custom or legacy model`}));return i}var m={codex:`Codex`,opencode:`OpenCode`};function h(t,n,r=!1){if(!e(t))return;let i=m[t];if(n?.stale)return`Using cached ${i} model list`;if(r||n?.source===`unavailable`)return`Latest ${i} models unavailable`}function g(e){let t=l.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function _(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function v(e,t,n=!1){return!n&&e===t?void 0:e}function y(e,t,n,r){let i=p(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function b(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function x(e,t,n){for(let r of e)if(r&&b(r,t,n))return r;if(n.some(e=>e.name===`quick-task`))return{source:`workflow`,ref:`quick-task`};let r=t[0];return r?{source:`skill`,ref:r.name}:{source:`workflow`,ref:n[0]?.name??`quick-task`}}function S(e){let{task:t,source:n,model:r,modelsLocked:i,runner:a,runnerExplicit:o,defaultRunner:s,agentProfile:c,variants:l,images:u,worktree:d,autonomous:f,generateFollowups:p,todoId:m}=e;return{task:t,...n.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n.ref},model:i?void 0:r||void 0,runner:v(a,s,o),agentProfile:c||void 0,variants:l>1?l:void 0,images:u.length>0?[...u]:void 0,worktree:d===!1&&l<=1?!1:void 0,autonomous:f===!0||void 0,generateFollowups:p!==!1&&void 0,todoId:m||void 0}}function C(e){let t=`runs`in e?e.runs[0]:e;return t?`/tasks/${t.id}`:`/`}export{n as _,p as a,_ as c,C as d,s as f,r as g,i as h,h as i,x as l,a as m,g as n,c as o,o as p,S as r,y as s,l as t,v as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{O as n}from"./centered-state-LfAW-igm.js";import{t as r}from"./utils-BhpbVMwN.js";import{n as i}from"./markdown-DDzk11zj.js";e();var a=t(),o=n(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending`,danger:`bg-danger`,violet:`bg-violet`,neutral:`bg-soft-foreground`},pulse:{true:`animate-pulse`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function s({className:e,tone:t=`neutral`,pulse:n=!1,...i}){return(0,a.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:r(o({tone:t,pulse:n,className:e})),...i})}var c={permission:0,error:1,waiting:2,running:3,unseen:4,none:5};function l(e){return!1}function u(e){return!1}function d(e){return l(e)?{bucket:`permission`,tone:`violet`,pulse:!0,label:`needs permission`}:e.status===`failed`&&e.autoResumeAt?{bucket:`none`,tone:`pending`,pulse:!1,label:`scheduled`}:e.status===`failed`?{bucket:`error`,tone:`danger`,pulse:!1,label:`failed`}:e.status===`waiting`?{bucket:`waiting`,tone:`pending`,pulse:!0,label:`needs you`}:e.status===`review`?{bucket:`waiting`,tone:`violet`,pulse:!0,label:`needs review`}:e.status===`running`&&e.activity===`monitoring`?{bucket:`running`,tone:`violet`,pulse:!0,label:`monitoring`}:e.status===`running`?{bucket:`running`,tone:`violet`,pulse:!0,label:`running`}:u(e)?{bucket:`unseen`,tone:`violet`,pulse:!1,label:`unseen`}:e.status===`queued`?{bucket:`none`,tone:`neutral`,pulse:!1,label:`queued`}:e.status===`done`?{bucket:`none`,tone:`success`,pulse:!1,label:`done`}:{bucket:`none`,tone:`neutral`,pulse:!1,label:`cancelled`}}function f(e){return c[d(e).bucket]<=c.waiting}function p(e){return e===void 0?`unknown`:new Intl.NumberFormat().format(e)}function m(e,t){return`Input tokens: ${p(e)}; output tokens: ${p(t)}`}function h(e,t,n=`compact`){let r=e===void 0?`—`:i(e),a=t===void 0?`—`:i(t);return n===`table`?`${r} / ${a}`:`IN ${r} · OUT ${a}`}function g({inputTokens:e,outputTokens:t,variant:n=`compact`,omitWhenUnknown:i=!0,className:o}){return i&&e===void 0&&t===void 0?null:(0,a.jsx)(`span`,{"data-slot":`directional-usage`,"aria-label":m(e,t),className:r(`font-mono tabular-nums`,o),children:h(e,t,n)})}function _(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}function v({className:e,dot:t,pulse:n=!1,children:i,...o}){return(0,a.jsxs)(`span`,{"data-slot":`pill`,className:r(`inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-[3px] text-xs font-medium whitespace-nowrap text-muted-foreground`,e),...o,children:[t?(0,a.jsx)(s,{tone:t,pulse:n}):null,i]})}export{d as a,h as i,_ as n,f as o,g as r,s,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ar as r,Fr as i,Ir as a,Or as o,Pr as s,kr as c,yn as l}from"./centered-state-LfAW-igm.js";var u=e(t(),1),d=n(),f=/^\/p\/([^/]+)(?=\/|$)/;function p(e){let t=f.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function m(e){let t=f.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function h(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function g(e,t){return e===null?t:typeof t==`string`?h(e,t):t.pathname===void 0?t:{...t,pathname:h(e,t.pathname)}}function _(){let{projectId:e}=l(),{pathname:t}=i();return e??p(t)}function v(){let e=_();return(0,u.useCallback)(t=>g(e,t),[e])}function y(e){let{pathname:t}=i();return(0,u.useMemo)(()=>s(e,m(t)),[e,t])}function b({to:e,...t}){let n=v();return(0,d.jsx)(o,{...t,to:n(e)})}function x({to:e,...t}){let n=v();return(0,d.jsx)(c,{...t,to:n(e)})}function S({to:e,...t}){let n=v();return(0,d.jsx)(r,{...t,to:n(e)})}function C(){let e=a(),t=v();return(0,u.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{g as a,C as c,p as i,y as l,x as n,m as o,S as r,_ as s,b as t};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,E as i,_ as a,b as o,c as s,d as c,f as l,g as u,h as d,l as f,s as p,u as m,w as h,x as g,y as _}from"./centered-state-LfAW-igm.js";import{r as v,t as y}from"./utils-BhpbVMwN.js";import{_ as ee,t as te}from"./new-task-form-BNLLgC6P.js";import{a as b,c as x,f as S,g as C,h as w,m as ne,n as T,o as E,p as D,r as re,t as O}from"./dropdown-menu-BofYpFFw.js";import{d as k,l as A,m as j,p as ie}from"./alert-dialog-Byp42_IG.js";import{a as M,c as N,l as ae,o as oe,r as se}from"./use-submit-shortcut-B-xhu4Bf.js";var ce=v(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),le=v(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),P=e(t(),1),F=n(),I=`Popover`,[ue,de]=o(I,[C]),L=C(),[fe,R]=ue(I),pe=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,c=L(t),l=P.useRef(null),[u,f]=P.useState(!1),[p,m]=a({prop:r,defaultProp:i??!1,onChange:o,caller:I});return(0,F.jsx)(w,{...c,children:(0,F.jsx)(fe,{scope:t,contentId:d(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:P.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:u,onCustomAnchorAdd:P.useCallback(()=>f(!0),[]),onCustomAnchorRemove:P.useCallback(()=>f(!1),[]),modal:s,children:n})})};pe.displayName=I;var me=`PopoverAnchor`,he=P.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=R(me,n),a=L(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return P.useEffect(()=>(o(),()=>s()),[o,s]),(0,F.jsx)(S,{...a,...r,ref:t})});he.displayName=me;var ge=`PopoverTrigger`,_e=P.forwardRef((e,t)=>{let{__scopePopover:n,...i}=e,a=R(ge,n),o=L(n),s=r(t,a.triggerRef),c=(0,F.jsx)(g.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":Ae(a.open),...i,ref:s,onClick:_(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,F.jsx)(S,{asChild:!0,...o,children:c})});_e.displayName=ge;var z=`PopoverPortal`,[ve,ye]=ue(z,{forceMount:void 0}),be=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=R(z,t);return(0,F.jsx)(ve,{scope:t,forceMount:n,children:(0,F.jsx)(u,{present:n||a.open,children:(0,F.jsx)(m,{asChild:!0,container:i,children:r})})})};be.displayName=z;var B=`PopoverContent`,xe=P.forwardRef((e,t)=>{let n=ye(B,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=R(B,e.__scopePopover);return(0,F.jsx)(u,{present:r||a.open,children:a.modal?(0,F.jsx)(Ce,{...i,ref:t}):(0,F.jsx)(we,{...i,ref:t})})});xe.displayName=B;var Se=h(`PopoverContent.RemoveScroll`),Ce=P.forwardRef((e,t)=>{let n=R(B,e.__scopePopover),i=P.useRef(null),a=r(t,i),o=P.useRef(!1);return P.useEffect(()=>{let e=i.current;if(e)return p(e)},[]),(0,F.jsx)(s,{as:Se,allowPinchZoom:!0,children:(0,F.jsx)(Te,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:_(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:_(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),we=P.forwardRef((e,t)=>{let n=R(B,e.__scopePopover),r=P.useRef(!1),i=P.useRef(!1);return(0,F.jsx)(Te,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Te=P.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...m}=e,h=R(B,n),g=L(n);return f(),(0,F.jsx)(c,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(l,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:p,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,F.jsx)(ne,{"data-state":Ae(h.open),role:`dialog`,id:h.contentId,...g,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),Ee=`PopoverClose`,De=P.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=R(Ee,n);return(0,F.jsx)(g.button,{type:`button`,...r,ref:t,onClick:_(e.onClick,()=>i.onOpenChange(!1))})});De.displayName=Ee;var Oe=`PopoverArrow`,ke=P.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=L(n);return(0,F.jsx)(D,{...i,...r,ref:t})});ke.displayName=Oe;function Ae(e){return e?`open`:`closed`}var je=pe,Me=he,Ne=_e,Pe=be,Fe=xe,Ie=1,Le=.9,Re=.8,ze=.17,V=.1,H=.999,Be=.9999,Ve=.99,He=/[\\\/_+.#"@\[\(\{&]/,Ue=/[\\\/_+.#"@\[\(\{&]/g,We=/[\s-]/,Ge=/[\s-]/g;function U(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Ie:Ve;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=U(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Ie:He.test(e.charAt(l-1))?(d*=Re,p=e.slice(i,l-1).match(Ue),p&&i>0&&(d*=H**+p.length)):We.test(e.charAt(l-1))?(d*=Le,m=e.slice(i,l-1).match(Ge),m&&i>0&&(d*=H**+m.length)):(d*=ze,i>0&&(d*=H**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Be)),(d<V&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=U(e,t,n,r,l+1,a+2,o),f*V>d&&(d=f*V)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Ke(e){return e.toLowerCase().replace(Ge,` `)}function qe(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,U(e,t,Ke(e),Ke(t),0,0,{})}var W=`[cmdk-group=""]`,Je=`[cmdk-group-items=""]`,Ye=`[cmdk-group-heading=""]`,Xe=`[cmdk-item=""]`,Ze=`${Xe}:not([aria-disabled="true"])`,Qe=`cmdk-item-select`,G=`data-value`,$e=(e,t,n)=>qe(e,t,n),et=P.createContext(void 0),K=()=>P.useContext(et),tt=P.createContext(void 0),nt=()=>P.useContext(tt),rt=P.createContext(void 0),it=P.forwardRef((e,t)=>{let n=Y(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Y(()=>new Set),i=Y(()=>new Map),a=Y(()=>new Map),o=Y(()=>new Set),s=ht(e),{label:c,children:l,value:u,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,ee=d(),te=d(),b=d(),x=P.useRef(null),S=_t();J(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),J(()=>{S(6,re)},[]);let C=P.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),T(),S(1,E);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(ee))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=O()?.id,C.emit()}),r||S(5,re),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=P.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ne(t,r)),S(2,()=>{T(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),T(),n.current.value||E(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{D(),t?.getAttribute(`id`)===e&&E(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:ee,inputId:b,labelId:te,listInnerRef:x}),[]);function ne(e,t){let r=s.current?.filter??$e;return e?r(e,n.current.search,t):0}function T(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;k().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Je);t?t.appendChild(e.parentElement===t?e:e.closest(`${Je} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Je} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${W}[${G}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function E(){let e=k().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(G);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=ne(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function re(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(W)?.querySelector(Ye))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return x.current?.querySelector(`${Xe}[aria-selected="true"]`)}function k(){return Array.from(x.current?.querySelectorAll(Ze)||[])}function A(e){let t=k()[e];t&&C.setState(`value`,t.getAttribute(G))}function j(e){var t;let n=O(),r=k(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(G))}function ie(e){let t=O()?.closest(W),n;for(;t&&!n;)t=e>0?pt(t,W):mt(t,W),n=t?.querySelector(Ze);n?C.setState(`value`,n.getAttribute(G)):j(e)}let M=()=>A(k().length-1),N=e=>{e.preventDefault(),e.metaKey?M():e.altKey?ie(1):j(1)},ae=e=>{e.preventDefault(),e.metaKey?A(0):e.altKey?ie(-1):j(-1)};return P.createElement(g.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&N(e);break;case`ArrowDown`:N(e);break;case`p`:case`k`:v&&e.ctrlKey&&ae(e);break;case`ArrowUp`:ae(e);break;case`Home`:e.preventDefault(),A(0);break;case`End`:e.preventDefault(),M();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(Qe);t.dispatchEvent(e)}}}}},P.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:yt},c),Z(e,e=>P.createElement(tt.Provider,{value:C},P.createElement(et.Provider,{value:w},e))))}),at=P.forwardRef((e,t)=>{let n=d(),r=P.useRef(null),a=P.useContext(rt),o=K(),s=ht(e),c=s.current?.forceMount??a?.forceMount;J(()=>{if(!c)return o.item(n,a?.id)},[c]);let l=gt(n,r,[e.value,e.children,r],e.keywords),u=nt(),f=X(e=>e.value&&e.value===l.current),p=X(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);P.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Qe,m),()=>t.removeEventListener(Qe,m)},[p,e.onSelect,e.disabled]);function m(){var e,t;h(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function h(){u.setState(`value`,l.current,!0)}if(!p)return null;let{disabled:_,value:v,onSelect:y,forceMount:ee,keywords:te,...b}=e;return P.createElement(g.div,{ref:i(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!f,"data-disabled":!!_,"data-selected":!!f,onPointerMove:_||o.getDisablePointerSelection()?void 0:h,onClick:_?void 0:m},e.children)}),ot=P.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=d(),c=P.useRef(null),l=P.useRef(null),u=d(),f=K(),p=X(e=>a||f.filter()===!1?!0:!e.search||e.filtered.groups.has(s));J(()=>f.group(s),[]),gt(s,c,[e.value,e.heading,l]);let m=P.useMemo(()=>({id:s,forceMount:a}),[a]);return P.createElement(g.div,{ref:i(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!p||void 0},n&&P.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Z(e,e=>P.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},P.createElement(rt.Provider,{value:m},e))))}),st=P.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=P.useRef(null),o=X(e=>!e.search);return!n&&!o?null:P.createElement(g.div,{ref:i(a,t),...r,"cmdk-separator":``,role:`separator`})}),ct=P.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=nt(),o=X(e=>e.search),s=X(e=>e.selectedItemId),c=K();return P.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),P.createElement(g.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),lt=P.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...a}=e,o=P.useRef(null),s=P.useRef(null),c=X(e=>e.selectedItemId),l=K();return P.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),P.createElement(g.div,{ref:i(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Z(e,e=>P.createElement(`div`,{ref:i(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),ut=P.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return P.createElement(A,{open:n,onOpenChange:r},P.createElement(j,{container:o},P.createElement(ie,{"cmdk-overlay":``,className:i}),P.createElement(k,{"aria-label":e.label,"cmdk-dialog":``,className:a},P.createElement(it,{ref:t,...s}))))}),dt=P.forwardRef((e,t)=>X(e=>e.filtered.count===0)?P.createElement(g.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ft=P.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return P.createElement(g.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Z(e,e=>P.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(it,{List:lt,Item:at,Input:ct,Group:ot,Separator:st,Dialog:ut,Empty:dt,Loading:ft});function pt(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function mt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ht(e){let t=P.useRef(e);return J(()=>{t.current=e}),t}var J=typeof window>`u`?P.useEffect:P.useLayoutEffect;function Y(e){let t=P.useRef();return t.current===void 0&&(t.current=e()),t}function X(e){let t=nt(),n=()=>e(t.snapshot());return P.useSyncExternalStore(t.subscribe,n,n)}function gt(e,t,n,r=[]){let i=P.useRef(),a=K();return J(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(G,s),i.current=s}),i}var _t=()=>{let[e,t]=P.useState(),n=Y(()=>new Map);return J(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function vt(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Z({asChild:e,children:t},n){return e&&P.isValidElement(t)?P.cloneElement(vt(t),{ref:t.ref},n(t.props.children)):n(t)}var yt={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function bt({className:e,...t}){return(0,F.jsx)(q,{"data-slot":`command`,className:y(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function xt({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,filter:a,...o}){return(0,F.jsxs)(se,{...o,children:[(0,F.jsxs)(N,{className:`sr-only`,children:[(0,F.jsx)(ae,{children:e}),(0,F.jsx)(oe,{children:t})]}),(0,F.jsx)(M,{className:y(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,F.jsx)(bt,{filter:a,className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function St({className:e,...t}){return(0,F.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,F.jsx)(le,{className:`size-4 shrink-0 opacity-50`}),(0,F.jsx)(q.Input,{"data-slot":`command-input`,className:y(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function Ct({className:e,...t}){return(0,F.jsx)(q.List,{"data-slot":`command-list`,className:y(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function wt({...e}){return(0,F.jsx)(q.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Tt({className:e,...t}){return(0,F.jsx)(q.Group,{"data-slot":`command-group`,className:y(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Et({className:e,...t}){return(0,F.jsx)(q.Separator,{"data-slot":`command-separator`,className:y(`-mx-1 h-px bg-border`,e),...t})}function Dt({className:e,...t}){return(0,F.jsx)(q.Item,{"data-slot":`command-item`,className:y(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ot({className:e,...t}){return(0,F.jsx)(`span`,{"data-slot":`command-shortcut`,className:y(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var kt=`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-55`,At=(0,F.jsx)(ee,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`});function jt({slot:e,ariaLabel:t,label:n,value:r,options:i,onPick:a,disabled:o=!1,readOnly:s=!1,hint:c,disabledHint:l,status:u}){if(s)return(0,F.jsx)(`span`,{"data-slot":e,"aria-label":t,title:l??c,className:`${kt} cursor-default hover:bg-card hover:text-muted-foreground`,children:n});let d=(0,F.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":t,disabled:o,title:o?l:c,className:kt,children:[n,At]});return o?(0,F.jsx)(`span`,{title:l,className:`inline-flex`,children:d}):(0,F.jsxs)(O,{children:[(0,F.jsx)(x,{asChild:!0,children:d}),(0,F.jsxs)(T,{align:`start`,"data-testid":`${e}-menu`,children:[(0,F.jsx)(b,{value:r,onValueChange:a,children:i.map(e=>(0,F.jsx)(E,{value:e.value,className:`gap-2.5`,children:(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,F.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:e.label}),e.desc?(0,F.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),u?(0,F.jsx)(re,{disabled:!0,className:`border-t border-border text-[11.5px] text-muted-foreground`,children:u}):null]})]})}var Q=(e,t)=>t===null?e:`${e}:${t}`;function Mt({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o}){let s=te.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:Q(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:Q(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),c=a??o?.[t]??`default`,l=s.some(e=>e.value===Q(t,c))?Q(t,c):Q(t,null);return(0,F.jsx)(jt,{slot:`runner-pill`,ariaLabel:`Runner`,label:s.find(e=>e.value===l)?.label??t,value:l,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:s})}function $(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function Nt(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=$(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t($(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function Pt(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:$(e)}:{top:0,bottom:0}}function Ft(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function It(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(Pt(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function Lt(){let[e,t]=(0,P.useState)({top:0,bottom:0});return(0,P.useEffect)(()=>It(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function Rt(e){let t=(0,P.useRef)(e);t.current=e,(0,P.useEffect)(()=>{let e=document.documentElement;return Nt(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}function zt({...e}){return(0,F.jsx)(je,{"data-slot":`popover`,...e})}function Bt({...e}){return(0,F.jsx)(Ne,{"data-slot":`popover-trigger`,...e})}function Vt({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,...i}){let a=Lt();return(0,F.jsx)(Pe,{children:(0,F.jsx)(Fe,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:Ft(a,r),className:y(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i})})}function Ht({...e}){return(0,F.jsx)(Me,{"data-slot":`popover-anchor`,...e})}var Ut=80,Wt=2e3,Gt=50,Kt=200,qt=50,Jt=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`}];function Yt(e){return!!e&&typeof e==`object`}function Xt(e){if(e===void 0||!Array.isArray(e))return Jt.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!Yt(r))continue;let e=typeof r.id==`string`?r.id.trim():``,i=typeof r.label==`string`?r.label.trim():``,a=typeof r.text==`string`?r.text.trim():``;if(!e||!i||!a||t.has(e))continue;t.add(e);let o=Zt(r.skills);if(n.push({id:e,label:i.slice(0,Ut),text:a.slice(0,Wt),...o.length>0?{skills:o}:{}}),n.length>=Gt)break}return n}function Zt(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(!(!e||t.has(e))&&(t.add(e.slice(0,Kt)),t.size>=qt))break}return[...t]}function Qt(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function $t(e,t){return Qt(e,t).map(e=>e.text).join(`
|
|
2
|
+
|
|
3
|
+
`)}function en(e,t,n,r=``){if(e===``||e===r||e===t){let e=r&&n?`${r}\n\n${n}`:r||n;return{text:e,applied:n?e:``}}return{text:e,applied:t}}function tn(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function nn(e,t,n){let r=Math.max(0,Math.min(t,e.length)),i=e.slice(0,r),a=e.slice(r),o=``;i.length>0&&(o=i.endsWith(`
|
|
4
|
+
|
|
5
|
+
`)?``:i.endsWith(`
|
|
6
|
+
`)?`
|
|
7
|
+
`:`
|
|
8
|
+
|
|
9
|
+
`);let s=a.replace(/^[ \t]+/,``),c=``;return s.length>0&&(c=s.startsWith(`
|
|
10
|
+
|
|
11
|
+
`)?``:s.startsWith(`
|
|
12
|
+
`)?`
|
|
13
|
+
`:`
|
|
14
|
+
|
|
15
|
+
`),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}export{Et as C,ce as E,Ct as S,le as T,xt as _,Xt as a,St as b,Ht as c,Rt as d,jt as f,bt as g,kt as h,tn as i,Vt as l,At as m,$t as n,en as o,Mt as p,nn as r,zt as s,Jt as t,Bt as u,wt as v,Ot as w,Dt as x,Tt as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BhpbVMwN.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,G as i,Lr as a,Nn as o,Ur as s,X as c,a as l,bn as u,bt as d,cr as f,i as p,j as m,t as h,vt as g,yt as _,zr as v}from"./centered-state-LfAW-igm.js";import{n as y,t as b}from"./utils-BhpbVMwN.js";import{t as x}from"./arrow-left-ESCjr1Hq.js";import{y as S}from"./dropdown-menu-BofYpFFw.js";import{i as C,n as w,r as T,t as E}from"./use-desktop-BNvbRBeZ.js";import{t as D}from"./search-x-D6FSpxId.js";import{t as O}from"./triangle-alert-bB7p9n5E.js";import{t as k}from"./project-router-LRCtP48W.js";import{t as A}from"./diff-stat-CIrTu4Ym.js";import{S as j,a as M,g as N,x as P,y as F}from"./index-DoVvGDfW.js";import{t as I}from"./diff-_jK0OWpF.js";import{t as L}from"./tab-link-FYksz037.js";import{i as R,r as z,t as B}from"./git-toolbar-BqJeUWcD.js";import{t as V}from"./commit-list-6PPve7PE.js";var H=e(t(),1),U=n();function W({repo:e,info:t}){let n=c(),i=s(),a=e=>p(e.message,{tone:`danger`}),u=v({mutationFn:e=>o({name:e}),onSuccess:async e=>{p(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([i.invalidateQueries({queryKey:m.repo}),i.invalidateQueries({queryKey:m.health})]),i.setQueryData(m.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),i.setQueryData(m.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:a}),d=v({mutationFn:e=>f({baseBranch:e}),onSuccess:e=>{p(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),i.invalidateQueries({queryKey:m.repo})},onError:a}),[h,g]=(0,H.useState)(``),[_,y]=(0,H.useState)(``),x=_.trim().toLowerCase(),S=x?e.branches.filter(e=>e.toLowerCase().includes(x)):e.branches;return(0,U.jsxs)(`section`,{"data-slot":`repo-branches`,className:`flex flex-col gap-6 px-4 py-4 md:px-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Branches`}),(0,U.jsx)(N,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:_,onChange:e=>y(e.target.value),className:`mt-2 max-w-xl`}),(0,U.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-2 flex max-w-xl flex-col divide-y divide-border`,children:[S.map(e=>{let n=e===t.branch;return(0,U.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,className:`flex min-h-9 items-center gap-2 py-1`,children:[(0,U.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,U.jsx)(`span`,{className:b(`min-w-0 truncate font-mono text-xs`,n&&`font-semibold`),children:e}),n?(0,U.jsxs)(`span`,{"data-slot":`branch-current`,className:`flex shrink-0 items-center gap-1 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:[(0,U.jsx)(r,{"aria-hidden":`true`,className:`size-3`}),`current`]}):(0,U.jsx)(l,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:u.isPending,onClick:()=>u.mutate(e),children:`Switch`})]},e)}),S.length===0?(0,U.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,_.trim(),`”.`]}):null]}),(0,U.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-3 flex max-w-md items-center gap-2`,onSubmit:e=>{e.preventDefault();let t=h.trim();t&&u.mutate(t,{onSuccess:()=>g(``)})},children:[(0,U.jsx)(N,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:h,onChange:e=>g(e.target.value)}),(0,U.jsxs)(l,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!h.trim()||u.isPending,children:[(0,U.jsx)(F,{"aria-hidden":`true`}),`Create`]})]})]}),(0,U.jsxs)(`div`,{className:`max-w-md`,children:[(0,U.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Agents’ base branch`}),(0,U.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:d.isPending,onChange:e=>d.mutate(e.target.value===``?null:e.target.value),className:`mt-1.5 block w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,U.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]}),(0,U.jsx)(`p`,{className:`mt-1 text-[11px] text-soft-foreground`,children:`New task worktrees branch from this.`})]}),n.data?.forge?.available?(0,U.jsx)(G,{}):null]})}function G(){let e=i({limit:20});return(0,U.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,U.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Open pull requests`}),e.isPending?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,U.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,U.jsx)(K,{pr:e},e.number))}):(0,U.jsx)(`p`,{"data-slot":`repo-prs-unavailable`,className:`mt-2 text-xs text-soft-foreground`,children:e.data.reason??`The forge is unreachable right now.`})]})}function K({pr:e}){let t=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,U.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,U.jsx)(q,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,U.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:y(e.url)?(0,U.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:b(n,`hover:bg-muted`),children:t}):(0,U.jsx)(`span`,{className:n,children:t})})}function q({checks:e}){return(0,U.jsx)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:b(`shrink-0 text-[10px] font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e})}function J(){let e=_(),t=E(),[n,r]=(0,H.useState)(`unified`),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(null),c=(0,H.useRef)(null),l=e.isError&&e.error instanceof u&&e.error.status===409,d=e.data?.files??[],f=(0,H.useMemo)(()=>z(d),[d]),p=t?n:`unified`,m=!t||i;return(0,U.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Uncommitted changes`}),e.data?(0,U.jsx)(B,{stat:e.data.stat}):null,(0,U.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,U.jsx)(T,{mode:n,wrap:i,onModeChange:r,onWrapChange:a})})]}),e.isPending?(0,U.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading changes…`}):e.isError?(0,U.jsx)(h,{icon:l?(0,U.jsx)(j,{}):(0,U.jsx)(O,{}),tone:l?`neutral`:`danger`,heading:`h2`,title:l?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):d.length===0?(0,U.jsx)(h,{icon:(0,U.jsx)(j,{}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-start gap-5 px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:[(0,U.jsx)(`aside`,{className:`sticky top-28 hidden w-60 shrink-0 md:block lg:w-72`,children:(0,U.jsx)(R,{root:f,selected:o,onSelect:e=>{s(e),c.current?.scrollToPath(e)}})}),(0,U.jsx)(I,{files:d,viewRef:c,mode:p,wrap:m,className:`min-w-0 flex-1`})]})]})}function Y({log:e}){let{sha:t}=a();return t?(0,U.jsx)(X,{sha:t}):e.length===0?(0,U.jsx)(h,{icon:(0,U.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,U.jsx)(V,{slot:`repo-commits`,commits:e.map(e=>({sha:e.hash,shaLabel:e.hash,subject:e.subject,author:e.author,when:e.when,href:`/git/commits/${e.hash}`}))})}function X({sha:e}){let t=d(e),n=E(),[r,i]=(0,H.useState)(`unified`),[a,o]=(0,H.useState)(!1),s=t.isError&&t.error instanceof u&&t.error.status===409,c=n?r:`unified`,f=!n||a;return(0,U.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,U.jsx)(l,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,U.jsxs)(k,{to:`/git/commits`,children:[(0,U.jsx)(x,{"aria-hidden":`true`}),`All commits`]})}),t.data?(0,U.jsx)(A,{stat:t.data.stat}):null,(0,U.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,U.jsx)(T,{mode:r,wrap:a,onModeChange:i,onWrapChange:o})})]}),t.isPending?(0,U.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):t.isError?(0,U.jsx)(h,{icon:s?(0,U.jsx)(D,{}):(0,U.jsx)(O,{}),tone:s?`neutral`:`danger`,heading:`h2`,title:s?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,U.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,U.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,U.jsx)(h,{icon:(0,U.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,U.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:7rem] md:px-6`,children:(0,U.jsx)(I,{files:t.data.files,mode:c,wrap:f,className:`min-w-0`})})]})]})}function Z({tab:e}){let t=g();if(t.isPending)return(0,U.jsx)(M,{});if(t.isError)return(0,U.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(h,{icon:(0,U.jsx)(O,{}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,U.jsx)(Q,{repo:t.data,info:n,tab:e}):(0,U.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(h,{icon:(0,U.jsx)(P,{}),tone:`neutral`,title:`Not a git repository`,subtitle:`cezar is running outside a git repository — start it inside one to browse changes, commits and branches.`})})}function Q({repo:e,info:t,tab:n}){return(0,U.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,U.jsxs)(`header`,{"data-slot":`repo-header`,className:`sticky top-0 z-20 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur md:px-6`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,U.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Git`}),(0,U.jsx)(w,{branch:t.branch}),t.remote?(0,U.jsx)(`span`,{"data-slot":`repo-remote`,className:`hidden min-w-0 truncate text-[11px] text-soft-foreground md:inline`,children:t.remote}):null]}),(0,U.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,U.jsx)(L,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,U.jsx)(L,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,U.jsx)(L,{to:`/git/branches`,active:n===`branches`,children:`Branches`})]})]}),n===`changes`?(0,U.jsx)(J,{}):n===`commits`?(0,U.jsx)(Y,{log:e.log}):(0,U.jsx)(W,{repo:e,info:t})]})}export{Z as RepoGitRoute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
2
|
-
`)){if(h.test(i)){n={path:g(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=_(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=_(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=v(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=v(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function b(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var x=n(),S=20,C=300;function w({runId:e}){let t=
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Et as r,Ur as i,a,j as o}from"./centered-state-LfAW-igm.js";import{t as s}from"./utils-BhpbVMwN.js";import{t as c}from"./chevron-right-Du-P1IUd.js";import{n as l,r as u,t as d}from"./collapsible-CBiiqDJM.js";import{i as f,r as p}from"./highlighter-CdHqIwFr.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){let t=[],n=null,r=!1;for(let i of e.split(`
|
|
2
|
+
`)){if(h.test(i)){n={path:g(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=_(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=_(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=v(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=v(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function b(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var x=n(),S=20,C=300;function w({runId:e}){let t=i(),n=r(e);(0,m.useEffect)(()=>{t.invalidateQueries({queryKey:o.runs.diff(e)})},[t,e]);let s=(0,m.useMemo)(()=>y(n.data??``),[n.data]),[c,l]=(0,m.useState)(!1);if(n.isPending)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(s.length===0)return(0,x.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let u=b(s),d=c?s:s.slice(0,S);return(0,x.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,x.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,x.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]})]})]}),d.map(e=>(0,x.jsx)(E,{file:e},`${e.oldPath??``}→${e.path}`)),s.length>d.length?(0,x.jsxs)(a,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>l(!0),children:[`Show `,s.length-d.length,` more files`]}):null]})}var T={added:`added`,deleted:`deleted`,renamed:`renamed`};function E({file:e}){let[t,n]=(0,m.useState)(!0),r=T[e.status];return(0,x.jsxs)(d,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,x.jsxs)(u,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,x.jsx)(c,{className:s(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:r}):null,e.binary?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:`binary`}):null,(0,x.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,x.jsx)(l,{children:(0,x.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,x.jsx)(D,{lines:e.lines})})})]})}function D({lines:e}){let[t,n]=(0,m.useState)(!1),r=t?e:e.slice(0,C),i=r.join(`
|
|
3
3
|
`),[a,o]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=!1;return p(i,`diff`).then(t=>{e||o({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let c=a?.text===i?a.tokens:f(i,`diff`)?.tokens??null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,x.jsxs)(`span`,{className:s(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[c?.[t]===void 0?e:c[t].map((e,t)=>(0,x.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>C?(0,x.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}export{w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,En as i,Er as a,L as o,Ln as s,Ot as c,Qt as l,Ur as u,X as d,a as f,an as p,at as m,bn as h,ct as g,dt as ee,en as _,fn as te,i as v,it as ne,j as y,jn as re,jt as ie,k as ae,mn as b,nn as oe,nr as se,rn as ce,rt as le,sn as ue,tr as de,tt as fe,wn as pe,z as me,zn as he,zr as x}from"./centered-state-LfAW-igm.js";import{n as S,r as C,t as w}from"./utils-BhpbVMwN.js";import{a as T,b as E,f as ge,g as _e,i as D,m as ve,n as ye,r as be,t as xe,u as Se,x as O,y as Ce}from"./editable-title-_J0zFDl-.js";import{_ as we,c as Te,g as Ee,m as De,p as k}from"./new-task-form-BNLLgC6P.js";import{c as A,i as j,n as M,r as N,s as P,t as F,x as Oe}from"./dropdown-menu-BofYpFFw.js";import{n as I,t as L}from"./trash-2-D8S3V3fu.js";import{t as ke}from"./ellipsis-vertical-BeMR-l62.js";import{t as R}from"./square-terminal-TTH64lO7.js";import{n as Ae,r as je,t as Me}from"./collapsible-CBiiqDJM.js";import{a as Ne,c as Pe,i as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be}from"./alert-dialog-Byp42_IG.js";import{c as Ve,t as He}from"./project-router-LRCtP48W.js";import{a as Ue,n as We,r as Ge,t as Ke}from"./pill-CVM1EmV4.js";import{t as qe}from"./markdown-DDzk11zj.js";import{t as Je}from"./diff-stat-CIrTu4Ym.js";import{t as z}from"./tab-link-FYksz037.js";var B=C(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),V=C(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),H=C(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),U=e(t(),1);function W(e){return e===`running`||e===`queued`||e===`waiting`}function G(e){return[...e.steps].reverse().find(e=>e.sessionId)?.sessionId}var Ye=/^[A-Za-z0-9._][A-Za-z0-9._-]{0,199}$/;function Xe(e,t){if(Ye.test(t))switch(e){case`codex`:return`codex resume ${t}`;case`opencode`:return`opencode --session ${t}`;default:return`claude --resume ${t}`}}function Ze(e){if(W(e.status))return;let t=G(e);if(t===void 0)return;let n=Xe(e.runner,t);if(n!==void 0)return e.worktreePath?`cd ${e.worktreePath} && ${n}`:n}function Qe(e,t){let n=D(t);return!n||W(e.status)?!1:n===(e.runner??`claude`)&&G(e)!==void 0}function K(e){let t=W(e.status),n=G(e)!==void 0;return{finish:e.status===`waiting`||e.status===`review`,continueRun:!t&&n,terminal:!t&&n,notes:!0,archive:!t,markUnread:ge(e)&&!ve(e),cancel:t,deleteRun:!t}}function q(e){return e===`review`?`Accept the changes without a PR`:`Close the session`}function $e(e,t){let n=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)).findIndex(e=>e.id===t);return n>=0?n+1:void 0}function J(e,t=null){let n=g(),r=a(n.data),i=e.runner??`claude`,o=Te(t,r,i),s=r.includes(i),c=n.isSuccess&&r.length>0,l=n.isPending?`Checking agent providers…`:n.isError?`Provider authentication could not be verified.`:c?void 0:`Connect an agent provider to continue.`;return{runners:r,currentRunner:i,runner:o,currentRunnerConnected:s,canContinue:c,providerPending:n.isPending,providerError:n.isError,reason:l,runnerOverride:t!==null||!s?o:void 0}}var Y=n();function X(e){switch(e){case`done`:return`done`;case`running`:case`waiting`:case`review`:return`active`;case`failed`:case`cancelled`:return`failed`;case`pending`:case`skipped`:return`pending`}}function Z(e){if(e.length===0)return 0;let t=new Set([`done`,`failed`,`cancelled`,`skipped`]),n=new Set([`running`,`waiting`,`review`]),r=0;for(let i of e)t.has(i.status)?r+=1:n.has(i.status)&&(r+=.5);return r/e.length}function et({steps:e}){if(e.length===0)return null;let t=Z(e)*100;return(0,Y.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((t,n)=>(0,Y.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":X(t.status),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,Y.jsx)(tt,{visual:X(t.status)}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:t.name}),t.iterations>1?(0,Y.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,t.iterations]}):null,(0,Y.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-[11.5px] text-soft-foreground tabular-nums`,children:[t.kind,` · step `,n+1,` of `,e.length]})]},t.id)),(0,Y.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,Y.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${t}%`}})})]})}function tt({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,Y.jsx)(Ee,{"aria-hidden":!0,className:w(t,`text-success`)});case`active`:return(0,Y.jsx)(ae,{role:`status`,"aria-label":`Step running`,className:w(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,Y.jsx)(De,{"aria-hidden":!0,className:w(t,`text-danger`)});case`pending`:return(0,Y.jsx)(Oe,{"aria-hidden":!0,className:w(t,`text-soft-foreground`)})}}function nt(e){let t=e.findIndex(e=>X(e.status)===`active`);if(t>=0)return t;let n=e.findIndex(e=>X(e.status)===`pending`);return n>=0?n:Math.max(0,e.length-1)}function rt({visual:e}){return(0,Y.jsx)(`span`,{"aria-hidden":!0,"data-slot":`step-dot`,"data-visual":e,className:w(`size-1.5 rounded-full`,e===`done`?`bg-success`:e===`failed`?`bg-danger`:e===`active`?`bg-pending`:`bg-soft-foreground`,e===`active`&&`animate-pulse motion-reduce:animate-none`)})}var Q=new Map;function it({runId:e,steps:t}){let[n,r]=(0,U.useState)(()=>Q.get(e)??!1);if(t.length===0)return null;let i=t=>{Q.set(e,t),r(t)},a=nt(t),o=t[a],s=Z(t)*100;return(0,Y.jsxs)(Me,{"data-slot":`workflow-steps`,open:n,onOpenChange:i,className:`min-w-0`,children:[(0,Y.jsxs)(je,{"aria-label":`Workflow: ${o.name}, step ${a+1} of ${t.length}`,className:`group flex min-h-[30px] w-full items-center gap-2.5 text-left text-xs text-muted-foreground hover:text-foreground`,children:[(0,Y.jsx)(`span`,{"data-slot":`step-dots`,className:`flex shrink-0 items-center gap-1`,children:t.map(e=>(0,Y.jsx)(rt,{visual:X(e.status)},e.id))}),(0,Y.jsx)(`span`,{className:`min-w-0 max-w-[45%] shrink truncate font-semibold text-foreground`,children:o.name}),(0,Y.jsxs)(`span`,{className:`shrink-0 text-soft-foreground tabular-nums`,children:[`step `,a+1,` of `,t.length]}),(0,Y.jsx)(`span`,{"data-slot":`step-summary-progress`,className:`h-0.5 min-w-[36px] flex-1 overflow-hidden rounded-full bg-muted`,children:(0,Y.jsx)(`span`,{className:`block h-full rounded-full bg-pending`,style:{width:`${s}%`}})}),(0,Y.jsx)(we,{"aria-hidden":!0,className:`size-4 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-180`})]}),(0,Y.jsx)(Ae,{children:(0,Y.jsx)(`div`,{className:`pt-2`,children:(0,Y.jsx)(et,{steps:t})})})]})}function at(e){let t=u();return x({mutationFn:()=>he(e),onSuccess:()=>t.invalidateQueries({queryKey:y.runs.all}),onError:e=>v(e.message,{tone:`danger`})})}function ot({run:e,planTally:t,tab:n=`session`,onMarkedUnread:i}){let a=Ue(e),o=K(e),s=Ze(e),[c,l]=(0,U.useState)(!1),u=ct(e,i),p=ie(),m=d(),h=We(m.data),g=e.status===`queued`?te(p.data??[]).get(e.id):void 0;return(0,Y.jsxs)(`header`,{"data-slot":`run-header`,className:`sticky top-0 z-20 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur md:px-6`,children:[(0,Y.jsxs)(`div`,{className:`mx-auto w-full max-w-[var(--measure)]`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(lt,{run:e}),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2.5`,children:[t?(0,Y.jsxs)(`span`,{"data-slot":`plan-mirror`,className:`text-[11px] text-soft-foreground tabular-nums`,children:[`Plan `,t.done,`/`,t.total]}):null,(0,Y.jsxs)(Ke,{dot:a.tone,pulse:a.pulse,children:[a.label,g===void 0?``:` #${g}`]}),(0,Y.jsx)(pt,{run:e,actions:u,onToggleNotes:()=>l(e=>!e)})]})]}),(0,Y.jsx)(ut,{run:e,showTokens:h.tokens,showCost:h.cost,automationsAvailable:m.data?.capabilities?.automations===!0}),(0,Y.jsx)(dt,{run:e}),(0,Y.jsxs)(`div`,{"data-slot":`run-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,Y.jsx)(z,{to:`/tasks/${e.id}`,active:n===`session`,children:`Session`}),(0,Y.jsx)(z,{to:`/tasks/${e.id}/changes`,active:n===`changes`,children:`Changes`}),(0,Y.jsx)(z,{to:`/tasks/${e.id}/commits`,active:n===`commits`,children:`Commits`}),(0,Y.jsx)(z,{to:`/tasks/${e.id}/files`,active:n===`files`,children:`Files`}),(0,Y.jsxs)(`div`,{"data-slot":`run-actions`,className:`ml-auto hidden items-center gap-1 pb-1 md:flex`,children:[o.finish?(0,Y.jsxs)(f,{variant:`outline`,size:`sm`,title:q(e.status),onClick:()=>u.finish.mutate(),children:[(0,Y.jsx)(r,{"aria-hidden":`true`}),`Finish`]}):null,o.continueRun?(0,Y.jsxs)(f,{variant:`outline`,size:`sm`,title:u.continuation.reason??`Reopen the session`,disabled:u.continueRun.isPending||!u.continuation.canContinue,onClick:()=>u.continueRun.mutate(),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),`Continue`]}):null,(0,Y.jsx)(st,{run:e,canResume:o.terminal,onResume:()=>u.terminal.mutate()}),(0,Y.jsxs)(f,{variant:`ghost`,size:`sm`,title:`Handoff notes — what the agent did and what's left`,"aria-expanded":c,onClick:()=>l(e=>!e),children:[(0,Y.jsx)(V,{"aria-hidden":`true`}),`Notes`]}),o.markUnread?(0,Y.jsxs)(f,{variant:`ghost`,size:`sm`,title:`Put this task back in the unread list`,disabled:u.markUnread.isPending,onClick:()=>u.markUnread.mutate(),children:[(0,Y.jsx)(H,{"aria-hidden":`true`}),`Mark unread`]}):null,o.archive?(0,Y.jsxs)(f,{variant:`ghost`,size:`sm`,onClick:()=>u.archive.mutate(),children:[e.archived?(0,Y.jsx)(O,{"aria-hidden":`true`}):(0,Y.jsx)(E,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive`]}):null,o.cancel?(0,Y.jsxs)(f,{variant:`danger-ghost`,size:`sm`,onClick:()=>u.setConfirming(`cancel`),children:[(0,Y.jsx)(B,{"aria-hidden":`true`}),`Cancel`]}):null,o.deleteRun?(0,Y.jsxs)(f,{variant:`danger-ghost`,size:`sm`,onClick:()=>u.setConfirming(`delete`),children:[(0,Y.jsx)(L,{"aria-hidden":`true`}),`Delete`]}):null]})]}),e.steps.length>0?(0,Y.jsx)(`div`,{className:`border-t border-border pt-2 pb-1`,children:(0,Y.jsx)(it,{runId:e.id,steps:e.steps})}):null,s?(0,Y.jsx)(ht,{hint:s}):null,c?(0,Y.jsx)(gt,{runId:e.id}):null]}),(0,Y.jsx)(mt,{run:e,actions:u})]})}function st({run:e,canResume:t,onResume:n}){let r=le(),i=g(),o=x({mutationFn:t=>de(e.id,t),onError:e=>v(e.message,{tone:`danger`})}),s=a(i.data),c=e=>!i.isSuccess||s.includes(e??`claude`),l=t&&c(e.runner),u=e.worktreePath?(r.data?.targets??[]).filter(e=>{let t=D(e.id);return t===void 0||c(t)}).map(t=>({target:t,...Qe(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[];return!l&&u.length===0?null:(0,Y.jsx)(be,{choices:u,onPick:e=>o.mutate(e),title:`Resume in a terminal, or open the worktree locally`,leading:l?(0,Y.jsxs)(N,{"data-target":`terminal-resume`,onSelect:n,children:[(0,Y.jsx)(R,{"aria-hidden":`true`}),`Terminal (resume session)`]}):null,trailing:e.worktreePath?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(P,{}),(0,Y.jsxs)(N,{onSelect:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>v(`Worktree path copied`)).catch(()=>v(`Path: ${t}`))},children:[(0,Y.jsx)(I,{"aria-hidden":`true`}),`Copy worktree path`]})]}):null})}function ct(e,t){let n=u(),r=Ve(),[a,o]=(0,U.useState)(null),c=()=>n.invalidateQueries({queryKey:y.runs.all}),l=e=>v(e.message,{tone:`danger`}),d=at(e.id),f=J(e),p=x({mutationFn:async()=>f.canContinue?re(e.id,{runner:f.runnerOverride}):null,onSuccess:e=>{e!==null&&c()},onError:l}),m=x({mutationFn:()=>pe(e.id,!e.archived),onSuccess:c,onError:l}),g=fe();return{finish:d,continuation:f,continueRun:p,archive:m,markUnread:{isPending:g.isPending,mutate:()=>{t?.(),g.mutate(e.id,{onError:l})}},cancel:x({mutationFn:()=>i(e.id),onSuccess:c,onError:l}),delete:x({mutationFn:()=>s(e.id),onSuccess:()=>{c(),r(`/`)},onError:l}),terminal:x({mutationFn:()=>se(e.id),onError:e=>{if(e instanceof h&&e.command){$(e.command,`No terminal found — command copied to clipboard.`);return}l(e)}}),confirming:a,setConfirming:o}}async function $(e,t){try{await navigator.clipboard.writeText(e),v(t)}catch{v(`Run manually: ${e}`)}}function lt({run:e}){let t=ne(e.id),n=b(e),r=ye(n,e=>t.mutate({title:e},{onError:e=>v(e.message,{tone:`danger`})}));return r.editing?(0,Y.jsx)(xe,{editor:r,className:`flex-1 text-[15px] font-semibold`}):(0,Y.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,Y.jsx)(`h1`,{className:`min-w-0 truncate text-[15px] font-semibold`,title:e.task,children:n}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,onClick:r.begin,className:`shrink-0 rounded-sm p-1 text-soft-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Y.jsx)(_e,{className:`size-3.5`,"aria-hidden":`true`})})]})}function ut({run:e,showTokens:t,showCost:n,automationsAvailable:r}){let i=m(),a=ee(),o=(0,U.useMemo)(()=>a===void 0?[]:p(e,i).map(e=>({projectId:a,kind:e.kind,number:e.number})),[e,i,a]),s=[(0,Y.jsx)(`span`,{children:ue(e)},`workflow`)];e.branch&&s.push((0,Y.jsx)(`span`,{"data-slot":`branch-chip`,className:`rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:e.branch},`branch`));let c=ce(e);if(c&&S(c)){let t=_(c);s.push((0,Y.jsx)(T,{reference:{kind:`PR`,...t?{number:Number(t)}:{},url:c},taskTitle:b(e),className:`h-5`},`pr`))}let u=oe(e,i);if(u&&S(u)){let t=_(u);s.push((0,Y.jsx)(T,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:u},taskTitle:b(e),className:`h-5`},`issue`))}e.diffStat&&s.push((0,Y.jsx)(Je,{stat:e.diffStat},`diff`)),e.automation&&s.push(r?(0,Y.jsx)(He,{to:`/automations/${encodeURIComponent(e.automation.automationId)}/log`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium hover:text-foreground`,children:`Automation`},`automation`):(0,Y.jsx)(`span`,{"data-slot":`automation-origin`,title:`Automations are off on this server (CEZ_AUTOMATIONS)`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium`,children:`Automation`},`automation`));let d=[];return t&&(e.inputTokens!==void 0||e.outputTokens!==void 0)&&d.push((0,Y.jsx)(Ge,{inputTokens:e.inputTokens,outputTokens:e.outputTokens},`tokens`)),n&&e.costUsd&&d.push((0,Y.jsx)(`span`,{className:`tabular-nums`,children:l(e.costUsd)},`cost`)),(0,Y.jsx)(Se,{projectId:a,requests:o,children:(0,Y.jsxs)(`div`,{"data-slot":`run-meta`,className:`mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[s.map((e,t)=>(0,Y.jsxs)(U.Fragment,{children:[t>0?(0,Y.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[d.map((e,t)=>(0,Y.jsxs)(U.Fragment,{children:[t>0?(0,Y.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,Y.jsx)(ft,{run:e})]})]})})}function dt({run:e}){if(e.status!==`running`||e.activity!==`monitoring`)return null;if(e.monitoringWakeCapReached)return(0,Y.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Automatic checks paused — 40/40 reached`});let t=e.monitoringWakeAt?new Date(e.monitoringWakeAt):null,n=t&&Number.isFinite(t.getTime())?t:null;if(!n)return(0,Y.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Parked — no automatic check scheduled`});let r=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n);return(0,Y.jsxs)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:[`Next automatic check`,` `,(0,Y.jsx)(`time`,{dateTime:e.monitoringWakeAt,className:`font-medium text-foreground`,children:r})]})}function ft({run:e}){let t=me(),n=o(),r=e.runner??t.data?.defaultRunner??`claude`,i=e.model??`auto`,a=[...e.steps].reverse().find(e=>e.profileId)?.profileId,s=a===void 0?void 0:a==="default"?`default`:n.data?.profiles.find(e=>e.id===a)?.label??`${a} (removed)`,c=e.modelIdentity&&e.modelIdentity!==i?e.modelIdentity:void 0,l=[r,s,i].filter(Boolean).join(` · `);return(0,Y.jsxs)(F,{children:[(0,Y.jsx)(A,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`agent-badge`,title:l,"aria-label":`Agent: ${r}, ${s?`account ${s}, `:``}model ${i}`,className:`flex min-w-0 shrink items-center gap-1.5 rounded-sm px-1 py-1 text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:[(0,Y.jsx)(Ce,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{"data-slot":`agent-badge-summary`,className:`truncate font-mono text-[11px]`,children:l})]})}),(0,Y.jsxs)(M,{align:`end`,className:`min-w-[9rem]`,children:[(0,Y.jsxs)(j,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`runner: `,r]}),s?(0,Y.jsxs)(j,{"data-slot":`agent-badge-account`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`account: `,s]}):null,(0,Y.jsxs)(j,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`model: `,i]}),c?(0,Y.jsxs)(j,{"data-slot":`agent-badge-identity`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`identity: `,c]}):null]})]})}function pt({run:e,actions:t,onToggleNotes:n}){let i=K(e);return(0,Y.jsxs)(F,{children:[(0,Y.jsx)(A,{asChild:!0,children:(0,Y.jsx)(f,{variant:`ghost`,size:`icon-sm`,"aria-label":`Run actions`,className:`md:hidden`,children:(0,Y.jsx)(ke,{"aria-hidden":`true`})})}),(0,Y.jsxs)(M,{align:`end`,"data-slot":`run-actions-menu`,children:[i.finish?(0,Y.jsxs)(N,{onSelect:()=>t.finish.mutate(),children:[(0,Y.jsx)(r,{"aria-hidden":`true`}),` Finish`]}):null,i.continueRun?(0,Y.jsxs)(N,{disabled:!t.continuation.canContinue||t.continueRun.isPending,title:t.continuation.reason,onSelect:()=>t.continueRun.mutate(),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),` Continue`]}):null,i.terminal?(0,Y.jsxs)(N,{onSelect:()=>t.terminal.mutate(),children:[(0,Y.jsx)(R,{"aria-hidden":`true`}),` Terminal`]}):null,(0,Y.jsxs)(N,{onSelect:n,children:[(0,Y.jsx)(V,{"aria-hidden":`true`}),` Notes`]}),i.markUnread?(0,Y.jsxs)(N,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,Y.jsx)(H,{"aria-hidden":`true`}),` Mark unread`]}):null,i.archive?(0,Y.jsxs)(N,{onSelect:()=>t.archive.mutate(),children:[e.archived?(0,Y.jsx)(O,{"aria-hidden":`true`}):(0,Y.jsx)(E,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive`]}):null,i.cancel||i.deleteRun?(0,Y.jsx)(P,{}):null,i.cancel?(0,Y.jsxs)(N,{variant:`destructive`,onSelect:()=>t.setConfirming(`cancel`),children:[(0,Y.jsx)(B,{"aria-hidden":`true`}),` Cancel`]}):null,i.deleteRun?(0,Y.jsxs)(N,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Y.jsx)(L,{"aria-hidden":`true`}),` Delete`]}):null]})]})}function mt({run:e,actions:t}){let n=t.confirming;return(0,Y.jsx)(Be,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Y.jsxs)(Fe,{children:[(0,Y.jsxs)(ze,{children:[(0,Y.jsx)(Pe,{children:n===`delete`?`Delete this task?`:`Cancel this task?`}),(0,Y.jsx)(Ne,{children:n===`delete`?(0,Y.jsxs)(Y.Fragment,{children:[`This removes the run, its transcript, its worktree and its branch. There is no undo.`,(0,Y.jsx)(`span`,{className:`mt-1 block truncate font-medium text-foreground`,title:b(e),children:b(e)})]}):`The agent is stopped and the run completes as cancelled. The worktree stays.`})]}),(0,Y.jsxs)(Le,{children:[(0,Y.jsx)(Re,{children:`Keep it`}),(0,Y.jsx)(Ie,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{n===`delete`?t.delete.mutate():t.cancel.mutate(),t.setConfirming(null)},children:n===`delete`?`Delete`:`Cancel the run`})]})]})})}function ht({hint:e}){return(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`resume-hint`,title:`Copy the command`,onClick:()=>void $(e,`Command copied to clipboard.`),className:`mb-2 flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left font-mono text-[11px] text-soft-foreground hover:bg-muted hover:text-foreground`,children:[(0,Y.jsx)(I,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{className:`truncate`,children:[`take over interactively: `,e]})]})}function gt({runId:e}){let t=c(e);return(0,Y.jsx)(`div`,{"data-slot":`notes-panel`,className:`mb-3 max-h-72 overflow-y-auto rounded-md border border-border bg-card px-4 py-3`,children:t.isPending?(0,Y.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):t.isError?(0,Y.jsx)(`p`,{className:`text-xs text-danger`,children:t.error.message}):t.data.trim().length>0?(0,Y.jsx)(qe,{children:t.data}):(0,Y.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`})})}export{W as a,K as c,q as i,V as l,at as n,G as o,J as r,$e as s,ot as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BhpbVMwN.js";var t=e(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./utils-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./utils-BhpbVMwN.js";var n=t(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),r=e(),i=[`.ai/cezar/skills/`,`.ai/skills/`,`.agents/skills/`];function a({children:e}){return(0,r.jsx)(`span`,{className:`font-mono`,children:e})}function o(){return(0,r.jsx)(r.Fragment,{children:i.map((e,t)=>(0,r.jsxs)(`span`,{children:[t>0?t===i.length-1?`, or `:`, `:``,(0,r.jsx)(a,{children:e})]},e))})}function s(){return(0,r.jsxs)(r.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,r.jsx)(o,{}),` (agent mirrors like`,` `,(0,r.jsx)(a,{children:`.claude/skills/`}),` work too) — optional frontmatter: `,(0,r.jsx)(a,{children:`name`}),`,`,` `,(0,r.jsx)(a,{children:`description`}),`. Global (`,(0,r.jsx)(a,{children:`~/.agents/skills`}),`) and team-repo skills appear here too — try Refresh.`]})}function c(){return(0,r.jsxs)(r.Fragment,{children:[`No skills yet — drop Markdown files into `,(0,r.jsx)(o,{}),` (or a global/team-repo skill source).`]})}export{c as n,n as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,Gt as i,It as a,On as o,Pn as s,Q as c,Rr as l,Ur as u,Ut as d,Vt as f,a as p,dr as m,i as h,j as g,pr as _,st as v,t as y,xn as b,yn as x,zr as S}from"./centered-state-LfAW-igm.js";import{t as C}from"./utils-BhpbVMwN.js";import{t as w}from"./arrow-left-ESCjr1Hq.js";import{d as T,f as E,g as D}from"./new-task-form-BNLLgC6P.js";import{r as O,t as k}from"./skill-empty-hint-iwpCcqgI.js";import{t as A}from"./refresh-cw-D1ys6QY2.js";import{t as j}from"./sparkles-MrQrgCI9.js";import{t as M}from"./triangle-alert-bB7p9n5E.js";import{a as N,c as P,l as F,o as I,r as L,s as R}from"./use-submit-shortcut-B-xhu4Bf.js";import{c as z,t as B}from"./project-router-LRCtP48W.js";import{f as V,i as ee,n as te,o as ne}from"./skills-BiWfHmCR.js";import{c as H,g as U,o as W,t as G}from"./index-DoVvGDfW.js";var K=e(t(),1),q=n(),J=`https://github.com/open-mercato/skills`;function Y(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function X(e,t){return Y(e)??[...t]}function re({projectId:e}){let t=u(),n=d(),r=c(),[o,s]=(0,K.useState)(``),l=a(e,!!e),f=r.data??[],p=(0,K.useMemo)(()=>f.map(e=>e.name),[f]),_=(0,K.useRef)([]);_.current=p;let v=(0,K.useMemo)(()=>new Set(X(n.data,p)),[n.data,p]),b=(0,K.useRef)(Promise.resolve()),x=(0,K.useRef)(0),S=(0,K.useCallback)(e=>{let n=i.uiState,r=t.getQueryData(n),a=e(X(r,_.current));t.setQueryData(n,{...r,importedSkills:a});let o=++x.current;b.current=b.current.then(async()=>{try{let e=await m({importedSkills:a});o===x.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:g.skills}))}catch(e){h(e instanceof Error?e.message:String(e),{tone:`danger`}),o===x.current&&t.invalidateQueries({queryKey:n})}})},[t]),w=(0,K.useCallback)(e=>{S(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[S]),T=p.length>0&&p.every(e=>v.has(e)),E=(0,K.useCallback)(()=>{if(T){let e=new Set(_.current);S(t=>t.filter(t=>!e.has(t)))}else S(e=>[...new Set([...e,..._.current])])},[T,S]);if(r.isError)return(0,q.jsx)(y,{icon:(0,q.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:r.error.message});let D=o.trim().toLowerCase(),O=D?f.filter(e=>e.name.toLowerCase().includes(D)||(e.description??``).toLowerCase().includes(D)):f;return(0,q.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`mx-auto w-full max-w-2xl`,children:[(0,q.jsx)(`h2`,{className:`text-base font-semibold`,children:`Manage skills`}),(0,q.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Reusable, technology-agnostic agent skills from`,` `,(0,q.jsx)(`a`,{href:J,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2 hover:text-foreground`,children:`open-mercato/skills`}),` `,`— PR creation, code review, CI stabilisation, spec writing and more. They're all in your catalog and the composer picker by default; uncheck any you don't want.`]}),(0,q.jsx)(ie,{projectId:e,state:l.data,loadError:l.error}),(0,q.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`These checkboxes choose what cezar shows; updates refresh installed skill files.`}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,q.jsx)(U,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:o,onChange:e=>s(e.target.value),className:`h-8 text-[13px]`}),(0,q.jsx)(`button`,{type:`button`,"data-slot":`import-all`,disabled:p.length===0||n.isPending,onClick:E,className:`h-8 shrink-0 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:T?`Remove all`:`Enable all`})]}),(0,q.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:r.isPending?(0,q.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):O.length>0?O.map(e=>{let t=v.has(e.name);return(0,q.jsxs)(`label`,{"data-slot":`import-row`,"data-skill":e.name,"data-imported":t?`true`:void 0,className:C(`flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-2.5 py-2 transition-colors hover:bg-muted`,t&&`bg-muted`),children:[(0,q.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>w(e.name),className:`mt-0.5 size-3.5 shrink-0`}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(j,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-soft-foreground`}),(0,q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[13px] font-medium text-foreground`,children:e.name})]}),e.description?(0,q.jsx)(`span`,{className:`mt-0.5 block pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,q.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:f.length>0?`(no skills match)`:`(no skills available — the repo may still be cloning)`})})]})}function Z(e){return e===`project`?`Project installation`:`Global installation`}function ie({projectId:e,state:t,loadError:n}){let r=u(),a=z(),c=(0,K.useRef)(0),[l,d]=(0,K.useState)(!1),f=S({mutationFn:()=>s({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{d(!1),a(T(e))},onError:e=>h(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===c.current&&(r.setQueryData(i.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:g.skills}),h(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),d(!0)))},_=(e,t)=>{t.seq===c.current&&h(e.message,{tone:`danger`})},v=S({mutationFn:t=>o(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>_(e,t)}),y=S({mutationFn:t=>b(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>_(e,t)}),x=e=>{let n=++c.current;e===`apply`?y.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):v.mutate({action:e,seq:n})},w=t?.scopes.some(e=>e.skills.length>0)??!1,E=t?.status===`error`,O=w&&(t?.available||E),k=y.isPending||t?.status===`updating`,j=t?.scopes.filter(e=>e.status===`error`||e.status===`unavailable`)??[],M=t?.scopes.filter(e=>e.updatedAt&&!j.includes(e))??[],B=`Checking installed Open Mercato skills…`;return n?B=`Update status is unavailable right now.`:t?.status===`available`?B=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?B=`Updating installed Open Mercato skills…`:t?.status===`current`?B=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?B=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(B=`The update did not finish for every installation.`),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`mt-4 rounded-lg border border-border bg-muted/30 p-3`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:B}),t?.checkedAt?(0,q.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,t?.scopes.some(e=>e.skills.length>0)?(0,q.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,q.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,j.length>0?(0,q.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,j.map(e=>Z(e.scope)).join(`, `),M.length?`; updated: ${M.map(e=>Z(e.scope)).join(`, `)}`:``,`.`]}):null]}),O?(0,q.jsxs)(p,{"data-action":`skills-update-apply`,size:`sm`,disabled:k,onClick:()=>x(`apply`),children:[(0,q.jsx)(A,{"aria-hidden":`true`,className:C(`size-3.5`,k&&`motion-safe:animate-spin`)}),k?`Updating…`:E?`Retry`:`Update now`]}):t?.status===`current`?(0,q.jsx)(p,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:v.isPending,onClick:()=>x(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,q.jsx)(p,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:v.isPending,onClick:()=>x(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,q.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,q.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,q.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,q.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-primary/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,q.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,q.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,q.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,q.jsx)(L,{open:l,onOpenChange:e=>f.isPending?void 0:d(e),children:(0,q.jsxs)(N,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,q.jsxs)(P,{children:[(0,q.jsx)(F,{children:`Apply the upgrade notes now?`}),(0,q.jsxs)(I,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,q.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,q.jsxs)(R,{children:[(0,q.jsx)(p,{type:`button`,variant:`outline`,disabled:f.isPending,onClick:()=>d(!1),children:`No`}),(0,q.jsx)(p,{type:`button`,disabled:f.isPending,onClick:()=>f.mutate(),children:f.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function ae(){return(0,q.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,q.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,q.jsx)(oe,{})]})}function oe(){let e=r(),t=f(),n=c(),[i]=l(),[a,o]=(0,K.useState)(``),s=u(),d=v(),p=x().projectId??d.data?.bootProject??``,m=S({mutationFn:()=>_(),onSuccess:e=>{s.setQueryData(g.skills,e),h(`Team skills refreshed.`)},onError:e=>h(e.message,{tone:`danger`})});if(e.isError)return(0,q.jsx)(y,{icon:(0,q.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let b=ne(e.data??[]),T=(n.data?.length??0)>0,D=i.get(`skill`),N=D===Q||D===$||D!==null&&b.some(e=>e.name===D)?D:b[0]?.name??(T?$:Q),P=b.find(e=>e.name===N)??null,F=te(b,a);return(0,q.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,q.jsxs)(`section`,{"data-slot":`skills-list`,className:C(`w-full flex-col border-border md:flex md:w-[320px] md:shrink-0 md:border-r`,`md:sticky md:top-14 md:max-h-[calc(100dvh-(var(--spacing)*14))]`,D===null?`flex`:`hidden md:flex`),children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,q.jsx)(U,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:a,onChange:e=>o(e.target.value),className:`h-8 text-[13px]`}),(0,q.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:m.isPending,onClick:()=>m.mutate(),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,q.jsx)(A,{"aria-hidden":`true`,className:C(`size-3`,m.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,q.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:e.isPending?(0,q.jsx)(`li`,{className:`px-2.5 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):F.length>0?F.map(e=>(0,q.jsx)(se,{skill:e,active:N===e.name},e.path)):(0,q.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:b.length>0?`(no skills match)`:(0,q.jsx)(k,{})})}),(0,q.jsxs)(`div`,{className:`shrink-0 border-t border-border p-2`,children:[T?(0,q.jsxs)(B,{to:`/skills?skill=${$}`,"data-slot":`import-skills-row`,"aria-current":N===$?`page`:void 0,className:C(`mb-1 flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,N===$&&`bg-muted`),children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(O,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,q.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Manage skills`}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full border border-border px-2 py-px font-mono text-[10.5px] text-soft-foreground`,children:`open-mercato`})]}),(0,q.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`Choose which open-mercato skills appear in your catalog.`})]}):null,(0,q.jsxs)(B,{to:`/skills?skill=${Q}`,"data-slot":`bookmarklets-row`,"aria-current":N===Q?`page`:void 0,className:C(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,N===Q&&`bg-muted`),children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(E,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,q.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Run from GitHub`}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full border border-border px-2 py-px font-mono text-[10.5px] text-soft-foreground`,children:`bookmarklets`})]}),(0,q.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`One-click skill launch from any GitHub PR or issue.`})]})]})]}),(0,q.jsx)(`section`,{"data-slot":`skills-detail`,className:C(`min-w-0 flex-1 flex-col`,D===null?`hidden md:flex`:`flex`),children:(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:[(0,q.jsxs)(B,{to:`/skills`,"data-slot":`skills-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,q.jsx)(w,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),N===$?(0,q.jsx)(re,{projectId:p}):N===Q?(0,q.jsx)(G,{skills:b}):P?(0,q.jsx)(W,{skill:P,usedBy:V(t.data?.workflows??[],P.name)}):e.isPending?null:(0,q.jsx)(y,{icon:(0,q.jsx)(j,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})}function se({skill:e,active:t}){let n=ee(e);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(B,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-project":n?`true`:void 0,"aria-current":t?`page`:void 0,className:C(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,t&&`bg-muted`),children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(j,{"aria-hidden":`true`,className:C(`size-3.5 shrink-0`,n?`text-violet`:`text-soft-foreground`)}),(0,q.jsx)(`span`,{className:C(`min-w-0 truncate font-mono text-[13px]`,n?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,q.jsx)(H,{source:e.source,className:`ml-auto`})]}),e.description?(0,q.jsx)(`span`,{className:`line-clamp-2 pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})})}export{ae as SkillsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BhpbVMwN.js";var t=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-BhpbVMwN.js";var t=e(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-BhpbVMwN.js";import{t as n}from"./project-router-LRCtP48W.js";var r=e();function i({to:e,active:i=!1,onClick:a,children:o}){return(0,r.jsx)(n,{to:e,"aria-current":i?`page`:void 0,onClick:a,className:t(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,i?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:o})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ct as r,Fn as i,Jn as a,Lr as o,St as s,Ur as c,X as l,a as u,bn as d,er as f,gr as p,i as m,j as h,kn as g,mn as _,nr as v,sr as y,t as b,vt as x,zr as S}from"./centered-state-LfAW-igm.js";import{a as C,o as ee,t as w}from"./run-header-Bn7cN0Z1.js";import{i as T,t as E}from"./use-desktop-BNvbRBeZ.js";import{t as D}from"./textarea-B9Ahj4E4.js";import{a as O,c as k,l as A,o as j,r as M,s as N,t as P}from"./use-submit-shortcut-B-xhu4Bf.js";import{S as F,n as I,r as L}from"./index-DoVvGDfW.js";import{t as R}from"./diff-_jK0OWpF.js";import{i as z,n as B,r as V}from"./git-toolbar-BqJeUWcD.js";var H=e(t(),1),U=e=>e===`running`||e===`queued`||e===`waiting`,W=`no worktree — this task ran directly in the repo working tree`;function G(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${W}`)}function K(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${W}`)}function q(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${W}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?U(e.status)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function J(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:G(e),n=e.prUrl?[G(e),K(e)]:[K(e),q(e)],r=[];if(e.localHandoff){let t=e.hasSession?U(e.status)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var Y=n();function te({run:e,open:t,onOpenChange:n}){let r=c(),[i,a]=(0,H.useState)(``),o=_(e),s=(0,H.useRef)(o);s.current=o,(0,H.useEffect)(()=>{t&&a(s.current)},[t]);let l=S({mutationFn:t=>g(e.id,t),onSuccess:t=>{m(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:h.runs.changes(e.id)}),r.invalidateQueries({queryKey:h.runs.all})},onError:e=>m(e.message,{tone:`danger`})}),d=()=>{let e=i.trim();e.length===0||l.isPending||l.mutate(e)};return(0,Y.jsx)(M,{open:t,onOpenChange:n,children:(0,Y.jsxs)(O,{"data-slot":`commit-dialog`,children:[(0,Y.jsxs)(k,{children:[(0,Y.jsx)(A,{children:`Commit changes`}),(0,Y.jsxs)(j,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,Y.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,Y.jsx)(D,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{P({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d())}}),(0,Y.jsxs)(N,{children:[(0,Y.jsx)(u,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Y.jsx)(u,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||l.isPending,onClick:d,children:l.isPending?`Committing…`:`Commit`})]})]})})}function X(){let{id:e}=o(),t=s(e);return t.isPending?(0,Y.jsx)(L,{tab:`changes`}):t.isError?(0,Y.jsx)(I,{tab:`changes`,error:t.error}):(0,Y.jsx)(Z,{run:t.data})}function Z({run:e}){let t=l(),n=x(),a=r(e.id,C(e.status)),o=E(),[s,u]=(0,H.useState)(`unified`),[g,_]=(0,H.useState)(!1),[D,O]=(0,H.useState)(null),[k,A]=(0,H.useState)(!1),j=(0,H.useRef)(null),M=c(),N=()=>M.invalidateQueries({queryKey:h.runs.all}),P=e=>m(e.message,{tone:`danger`}),I=S({mutationFn:()=>y(e.id),onSuccess:e=>m(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:P}),L=S({mutationFn:()=>i(e.id),onSuccess:e=>{m(`Draft PR created — ${e.url}`),N()},onError:P}),U=S({mutationFn:()=>v(e.id),onError:e=>{if(e instanceof d&&e.command){navigator.clipboard.writeText(e.command).then(()=>m(`No terminal found — command copied to clipboard.`)).catch(()=>m(`Run manually: ${e.command}`));return}P(e)}}),W=S({mutationFn:t=>f(e.id,t),onError:P}),G=a.isError&&a.error instanceof d&&a.error.status===409,K=J({status:e.status,hasWorktree:!!e.worktreePath&&!G,branch:e.branch,changedFiles:a.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:ee(e)!==void 0,prUrl:e.pullRequestUrl}),q=e=>{switch(e){case`commit`:A(!0);break;case`push`:I.mutate();break;case`create-pr`:L.mutate();break;case`open-terminal`:U.mutate();break;case`view-pr`:break}},X=a.data?.files??[],Z=(0,H.useMemo)(()=>V(X),[X]),Q=o?s:`unified`,$=!o||g;return(0,Y.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Y.jsx)(w,{run:e,tab:`changes`}),(0,Y.jsx)(B,{bar:K,branch:e.branch,stat:a.data?.stat,mode:Q,wrap:$,onModeChange:u,onWrapChange:_,onAction:q}),a.data?.repointedHead?(0,Y.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-6`,children:[`HEAD is on `,(0,Y.jsx)(`code`,{children:a.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Y.jsx)(`code`,{children:a.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,a.isPending?(0,Y.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading changes…`}):a.isError?(0,Y.jsx)(b,{icon:G?(0,Y.jsx)(F,{}):(0,Y.jsx)(T,{}),tone:G?`neutral`:`danger`,heading:`h2`,title:G?`No changes to show`:`Could not load the changes`,subtitle:a.error.message}):X.length===0?(0,Y.jsx)(b,{icon:(0,Y.jsx)(F,{}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-start gap-5 px-4 py-4 [--diff-sticky-top:10rem] md:px-6`,children:[(0,Y.jsx)(`aside`,{className:`sticky top-40 hidden w-60 shrink-0 md:block lg:w-72`,children:(0,Y.jsx)(z,{root:Z,selected:D,onSelect:e=>{O(e),j.current?.scrollToPath(e)}})}),(0,Y.jsx)(R,{files:X,viewRef:j,mode:Q,wrap:$,loadFileText:t=>ne(e.id,t),imageSrc:t=>p(e.id,t),onOpenInApp:t.data?.capabilities.localHandoff?e=>W.mutate(e):void 0,className:`min-w-0 flex-1`})]}),(0,Y.jsx)(te,{run:e,open:k,onOpenChange:A})]})}async function ne(e,t){try{let n=await a(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{X as TaskChangesRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Lr as r,St as i,Tt as a,a as o,bn as s,t as c,wt as l}from"./centered-state-LfAW-igm.js";import{t as u}from"./arrow-left-ESCjr1Hq.js";import{a as d,t as f}from"./run-header-Bn7cN0Z1.js";import{i as p,r as m,t as h}from"./use-desktop-BNvbRBeZ.js";import{t as g}from"./search-x-D6FSpxId.js";import{t as _}from"./triangle-alert-bB7p9n5E.js";import{t as v}from"./project-router-LRCtP48W.js";import{t as y}from"./diff-stat-CIrTu4Ym.js";import{n as b,r as x}from"./index-DoVvGDfW.js";import{t as S}from"./diff-_jK0OWpF.js";import{t as C}from"./commit-list-6PPve7PE.js";var w=e(t(),1),T=n();function E(){let{id:e}=r(),t=i(e);return t.isPending?(0,T.jsx)(x,{tab:`changes`}):t.isError?(0,T.jsx)(b,{tab:`changes`,error:t.error}):(0,T.jsx)(D,{run:t.data})}function D({run:e}){let{sha:t}=r(),n=a(e.id,d(e.status));return(0,T.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,T.jsx)(f,{run:e,tab:`commits`}),t?(0,T.jsx)(O,{runId:e.id,sha:t}):n.isPending?(0,T.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,T.jsx)(c,{icon:(0,T.jsx)(p,{}),tone:n.error instanceof s&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof s&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,T.jsx)(c,{icon:(0,T.jsx)(p,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,T.jsx)(C,{slot:`task-commits`,className:`mx-auto w-full max-w-[var(--measure)]`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))})]})}function O({runId:e,sha:t}){let n=l(e,t),r=h(),[i,a]=(0,w.useState)(`unified`),[d,f]=(0,w.useState)(!1),b=n.isError&&n.error instanceof s&&n.error.status===409,x=r?i:`unified`,C=!r||d;return(0,T.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,T.jsx)(o,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,T.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,T.jsx)(u,{"aria-hidden":`true`}),`All commits`]})}),n.data?(0,T.jsx)(y,{stat:n.data.stat}):null,(0,T.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,T.jsx)(m,{mode:i,wrap:d,onModeChange:a,onWrapChange:f})})]}),n.isPending?(0,T.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,T.jsx)(c,{icon:b?(0,T.jsx)(g,{}):(0,T.jsx)(_,{}),tone:b?`neutral`:`danger`,heading:`h2`,title:b?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,T.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,T.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,T.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,T.jsx)(c,{icon:(0,T.jsx)(p,{}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,T.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:10rem] md:px-6`,children:(0,T.jsx)(S,{files:n.data.files,mode:x,wrap:C,className:`min-w-0`})})]})]})}export{E as TaskCommitsRoute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
2
|
-
`).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>g(e),[e]),i=n.length>I,[a,o]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(r===null||i)return;let n=!1;return v(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:_(t,r)?.tokens??n}function R({path:e,text:t}){let n=L(e,t);return(0,M.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":g(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex px-4`,children:[(0,M.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,M.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function z({runId:e,selected:t,onSelect:n}){return(0,M.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,M.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,M.jsx)(B,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function B({runId:e,path:t,depth:n,selected:
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Dt as r,Lr as i,St as a,bn as o,gr as s,t as c}from"./centered-state-LfAW-igm.js";import{r as l,t as u}from"./utils-BhpbVMwN.js";import{t as d}from"./chevron-right-Du-P1IUd.js";import{t as f}from"./run-header-Bn7cN0Z1.js";import{t as p}from"./file-DY996Pee.js";import{t as m}from"./folder-NO3Ec-TY.js";import{t as h}from"./triangle-alert-bB7p9n5E.js";import{a as g,i as _,r as v}from"./highlighter-CdHqIwFr.js";import{n as y,r as b}from"./index-DoVvGDfW.js";var x=l(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),S=l(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),C=l(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),w=l(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),T=l(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),E=l(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),D=e(t(),1),O=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function k(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:O.has(t.slice(n+1).toLowerCase())}function A(e){return e.tooLarge?`too-large`:k(e.path)?`image`:e.binary?`binary`:`text`}function j(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var M=n();function N({runId:e,path:t,className:n}){let i=r(e,t??void 0);if(t===null)return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(c,{icon:(0,M.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from the tree to preview it here.`})});if(i.isPending)return(0,M.jsx)(F,{className:n,children:(0,M.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(i.isError){let e=i.error instanceof o&&i.error.status===409;return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(c,{icon:e?(0,M.jsx)(C,{}):(0,M.jsx)(h,{}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:i.error.message})})}return i.data.type===`file`?(0,M.jsx)(P,{runId:e,entry:i.data,className:n}):null}function P({runId:e,entry:t,className:n}){let r=A(t);return(0,M.jsxs)(F,{className:n,children:[(0,M.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,M.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,M.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:j(t.size)})]}),r===`image`?(0,M.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,M.jsx)(`img`,{"data-slot":`file-preview-image`,src:s(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,M.jsx)(c,{icon:(0,M.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${j(t.size)} — past the preview cap. Open it in your editor instead.`}):r===`binary`?(0,M.jsx)(c,{icon:(0,M.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${j(t.size)} of binary data — no text preview.`}):(0,M.jsx)(R,{path:t.path,text:t.content??``})]})}function F({className:e,children:t}){return(0,M.jsx)(`section`,{"data-slot":`file-preview`,className:u(`overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var I=1500;function L(e,t){let n=(0,D.useMemo)(()=>t.split(`
|
|
2
|
+
`).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>g(e),[e]),i=n.length>I,[a,o]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(r===null||i)return;let n=!1;return v(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:_(t,r)?.tokens??n}function R({path:e,text:t}){let n=L(e,t);return(0,M.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":g(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex px-4`,children:[(0,M.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,M.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function z({runId:e,selected:t,onSelect:n}){return(0,M.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,M.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,M.jsx)(B,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function B({runId:e,path:t,depth:n,selected:i,onSelect:a}){let o=r(e,t);return o.isPending?(0,M.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${24+n*14}px`},children:`Loading…`}):o.isError?(0,M.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${24+n*14}px`},children:o.error.message}):o.data.type===`dir`?o.data.entries.length===0?(0,M.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${24+n*14}px`},children:`Empty directory`}):(0,M.jsx)(M.Fragment,{children:o.data.entries.map(r=>r.type===`dir`?(0,M.jsx)(V,{runId:e,name:r.name,path:t===``?r.name:`${t}/${r.name}`,depth:n,selected:i,onSelect:a},r.name):(0,M.jsx)(H,{name:r.name,path:t===``?r.name:`${t}/${r.name}`,size:r.size,depth:n,selected:i,onSelect:a},r.name))}):null}function V({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let[o,s]=(0,D.useState)(!1);return(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+r*14}px`},children:[(0,M.jsx)(d,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform`,o&&`rotate-90`)}),(0,M.jsx)(m,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:t})]}),o?(0,M.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,M.jsx)(B,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function H({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=k(t)?T:p;return(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:u(`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,o?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+r*14}px`},children:[(0,M.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,M.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:j(n)})]})})}function U(){let{id:e}=i(),t=a(e);return t.isPending?(0,M.jsx)(b,{tab:`files`}):t.isError?(0,M.jsx)(y,{tab:`files`,error:t.error}):(0,M.jsx)(W,{run:t.data})}function W({run:e}){let t=r(e.id,``),[n,i]=(0,D.useState)(null),a=t.isError&&t.error instanceof o&&t.error.status===409;return(0,M.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,M.jsx)(f,{run:e,tab:`files`}),t.isPending?(0,M.jsx)(`p`,{"data-slot":`files-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading files…`}):t.isError?(0,M.jsx)(c,{icon:a?(0,M.jsx)(w,{}):(0,M.jsx)(h,{}),tone:a?`neutral`:`danger`,heading:`h2`,title:a?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 px-4 py-4 md:flex-row md:items-start md:px-6`,children:[(0,M.jsx)(`aside`,{className:`w-full shrink-0 md:sticky md:top-28 md:w-60 lg:w-72`,children:(0,M.jsx)(z,{runId:e.id,selected:n,onSelect:i})}),(0,M.jsx)(N,{runId:e.id,path:n,className:`min-w-0 flex-1`})]})]})}export{U as TaskFilesRoute};
|