@qodeca/xezar 0.10.2 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +20 -18
  2. package/dist/automations/coordinator.js +3 -2
  3. package/dist/automations/coordinator.js.map +1 -1
  4. package/dist/automations/store.js +2 -0
  5. package/dist/automations/store.js.map +1 -1
  6. package/dist/config.d.ts +2 -2
  7. package/dist/config.js +6 -5
  8. package/dist/config.js.map +1 -1
  9. package/dist/contract/index.js +1 -1
  10. package/dist/contract/skills.d.ts +2 -2
  11. package/dist/contract/workflows.d.ts +2 -2
  12. package/dist/contract/workspace.d.ts +1 -1
  13. package/dist/core/agent-model-policy.js +2 -1
  14. package/dist/core/agent-model-policy.js.map +1 -1
  15. package/dist/core/secret-redaction.d.ts +1 -1
  16. package/dist/core/secret-redaction.js +1 -1
  17. package/dist/git-worktree.d.ts +4 -4
  18. package/dist/git-worktree.js +8 -7
  19. package/dist/git-worktree.js.map +1 -1
  20. package/dist/handoff.d.ts +1 -1
  21. package/dist/handoff.js +1 -1
  22. package/dist/index.js +18 -39
  23. package/dist/index.js.map +1 -1
  24. package/dist/paths.d.ts +1 -1
  25. package/dist/paths.js +1 -1
  26. package/dist/project-data-paths.d.ts +11 -0
  27. package/dist/project-data-paths.js +42 -0
  28. package/dist/project-data-paths.js.map +1 -0
  29. package/dist/project-kit-paths.d.ts +9 -0
  30. package/dist/project-kit-paths.js +21 -0
  31. package/dist/project-kit-paths.js.map +1 -0
  32. package/dist/runs/retention.js +1 -1
  33. package/dist/runs/retention.js.map +1 -1
  34. package/dist/runs/store.d.ts +1 -1
  35. package/dist/runs/store.js +3 -1
  36. package/dist/runs/store.js.map +1 -1
  37. package/dist/server/git-changes.js +2 -2
  38. package/dist/server/git-changes.js.map +1 -1
  39. package/dist/server/launch-key.d.ts +1 -1
  40. package/dist/server/launch-key.js +1 -1
  41. package/dist/server/open-in-terminal.js +2 -2
  42. package/dist/server/open-in-terminal.js.map +1 -1
  43. package/dist/server/project-context.d.ts +1 -1
  44. package/dist/server/project-context.js +2 -2
  45. package/dist/server/project-context.js.map +1 -1
  46. package/dist/server/server.js +14 -11
  47. package/dist/server/server.js.map +1 -1
  48. package/dist/skills-banner.d.ts +1 -1
  49. package/dist/skills-banner.js +1 -1
  50. package/dist/skills-remote.js +5 -5
  51. package/dist/skills-remote.js.map +1 -1
  52. package/dist/skills.d.ts +2 -2
  53. package/dist/skills.js +4 -3
  54. package/dist/skills.js.map +1 -1
  55. package/dist/todos.d.ts +1 -1
  56. package/dist/todos.js +1 -1
  57. package/dist/ui-state.d.ts +1 -1
  58. package/dist/ui-state.js +3 -2
  59. package/dist/ui-state.js.map +1 -1
  60. package/dist/workflows/load.d.ts +3 -2
  61. package/dist/workflows/load.js +8 -4
  62. package/dist/workflows/load.js.map +1 -1
  63. package/dist/workflows/run.d.ts +3 -3
  64. package/dist/workflows/run.js +7 -7
  65. package/dist/workflows/run.js.map +1 -1
  66. package/dist/workspace/config.js +1 -1
  67. package/dist/workspace/migrations.js +3 -2
  68. package/dist/workspace/migrations.js.map +1 -1
  69. package/dist/workspace/projects-cli.js +1 -1
  70. package/dist/workspace/projects-cli.js.map +1 -1
  71. package/dist/workspace/projects.d.ts +3 -3
  72. package/dist/workspace/projects.js +5 -6
  73. package/dist/workspace/projects.js.map +1 -1
  74. package/dist/workspace/ui-state.d.ts +1 -1
  75. package/dist/workspace/ui-state.js +1 -1
  76. package/package.json +5 -5
  77. package/web/dist/assets/{compare-variants-SR2zZfZq.js → compare-variants-Cp3Thwv2.js} +1 -1
  78. package/web/dist/assets/{git-toolbar-DZlZjTGz.js → git-toolbar-BAZPUijR.js} +1 -1
  79. package/web/dist/assets/{github-CFURo9kf.js → github-BBVKH-CW.js} +1 -1
  80. package/web/dist/assets/{index-DlC81_GI.js → index-GflrFgEB.js} +2 -2
  81. package/web/dist/assets/{repo-git-CJFDMauC.js → repo-git-C0lQ9_O3.js} +1 -1
  82. package/web/dist/assets/skill-empty-hint-CL0g7WBL.js +1 -0
  83. package/web/dist/assets/{skills-Cs-auniL.js → skills-BfcNlZEY.js} +1 -1
  84. package/web/dist/assets/{task-changes-DYgNXOyY.js → task-changes-DHpe4ZuJ.js} +1 -1
  85. package/web/dist/assets/{task-commits-BRpZSz1G.js → task-commits-DUWVyp0I.js} +1 -1
  86. package/web/dist/assets/{task-files-pKOwSyLh.js → task-files-Do3S40OR.js} +1 -1
  87. package/web/dist/assets/{use-desktop-C31lOFUD.js → use-desktop-Cec0eUGX.js} +1 -1
  88. package/web/dist/assets/{workflows-BmOehP-A.js → workflows-CJ1FV1hP.js} +2 -2
  89. package/web/dist/index.html +1 -1
  90. package/web/dist/assets/skill-empty-hint-DTu0LzaJ.js +0 -1
@@ -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{A as r,Ct as i,G as a,Ln as o,St as s,Ur as c,Vr as l,Z as u,a as d,fr as f,i as p,j as m,qr as h,t as g,wn as _,xt as v}from"./centered-state-B_V_Ai2h.js";import{n as y,t as b}from"./utils-Bb8ohcr3.js";import{t as x}from"./arrow-left-BJsIW6A0.js";import{y as S}from"./dropdown-menu-Z80KMInL.js";import{i as C,n as w,r as T,t as E}from"./use-desktop-C31lOFUD.js";import{t as D}from"./search-x-69n_672Y.js";import{t as O}from"./triangle-alert-D5tJwRD2.js";import{t as k}from"./project-router-BbCzrHKs.js";import{t as A}from"./diff-stat-btAmKFJr.js";import{S as j,a as M,g as N,x as P,y as F}from"./index-DlC81_GI.js";import{t as I}from"./diff-CbozNUJq.js";import{t as L}from"./tab-link-Cp2-CJS8.js";import{i as R,r as z,t as B}from"./git-toolbar-DZlZjTGz.js";import{t as V}from"./commit-list-C4Dv6vUL.js";var H=e(t(),1),U=n();function W({repo:e,info:t}){let n=u(),i=h(),a=e=>p(e.message,{tone:`danger`}),s=c({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}),l=c({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}),[g,_]=(0,H.useState)(``),[v,y]=(0,H.useState)(``),x=v.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:v,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)(d,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:s.isPending,onClick:()=>s.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 “`,v.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=g.trim();t&&s.mutate(t,{onSuccess:()=>_(``)})},children:[(0,U.jsx)(N,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:g,onChange:e=>_(e.target.value)}),(0,U.jsxs)(d,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!g.trim()||s.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:l.isPending,onChange:e=>l.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=a({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=s(),t=E(),[n,r]=(0,H.useState)(`unified`),[i,a]=(0,H.useState)(!1),[o,c]=(0,H.useState)(null),l=(0,H.useRef)(null),u=e.isError&&e.error instanceof _&&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)(g,{icon:u?(0,U.jsx)(j,{}):(0,U.jsx)(O,{}),tone:u?`neutral`:`danger`,heading:`h2`,title:u?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):d.length===0?(0,U.jsx)(g,{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`,{"data-slot":`changes-tree-pane`,className:`sticky top-28 hidden max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] w-60 shrink-0 overflow-y-auto overscroll-contain md:block lg:w-72`,children:(0,U.jsx)(R,{root:f,selected:o,onSelect:e=>{c(e),l.current?.scrollToPath(e)}})}),(0,U.jsx)(I,{files:d,viewRef:l,mode:p,wrap:m,className:`min-w-0 flex-1`})]})]})}function Y({log:e}){let{sha:t}=l();return t?(0,U.jsx)(X,{sha:t}):e.length===0?(0,U.jsx)(g,{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=i(e),n=E(),[r,a]=(0,H.useState)(`unified`),[o,s]=(0,H.useState)(!1),c=t.isError&&t.error instanceof _&&t.error.status===409,l=n?r:`unified`,u=!n||o;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)(d,{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:o,onModeChange:a,onWrapChange:s})})]}),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)(g,{icon:c?(0,U.jsx)(D,{}):(0,U.jsx)(O,{}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`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)(g,{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:l,wrap:u,className:`min-w-0`})})]})]})}function Z({tab:e}){let t=v();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)(g,{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)(g,{icon:(0,U.jsx)(P,{}),tone:`neutral`,title:`Not a git repository`,subtitle:`xezar 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
+ 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,Ct as i,G as a,Ln as o,St as s,Ur as c,Vr as l,Z as u,a as d,fr as f,i as p,j as m,qr as h,t as g,wn as _,xt as v}from"./centered-state-B_V_Ai2h.js";import{n as y,t as b}from"./utils-Bb8ohcr3.js";import{t as x}from"./arrow-left-BJsIW6A0.js";import{y as S}from"./dropdown-menu-Z80KMInL.js";import{i as C,n as w,r as T,t as E}from"./use-desktop-Cec0eUGX.js";import{t as D}from"./search-x-69n_672Y.js";import{t as O}from"./triangle-alert-D5tJwRD2.js";import{t as k}from"./project-router-BbCzrHKs.js";import{t as A}from"./diff-stat-btAmKFJr.js";import{S as j,a as M,g as N,x as P,y as F}from"./index-GflrFgEB.js";import{t as I}from"./diff-CbozNUJq.js";import{t as L}from"./tab-link-Cp2-CJS8.js";import{i as R,r as z,t as B}from"./git-toolbar-BAZPUijR.js";import{t as V}from"./commit-list-C4Dv6vUL.js";var H=e(t(),1),U=n();function W({repo:e,info:t}){let n=u(),i=h(),a=e=>p(e.message,{tone:`danger`}),s=c({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}),l=c({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}),[g,_]=(0,H.useState)(``),[v,y]=(0,H.useState)(``),x=v.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:v,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)(d,{variant:`ghost`,size:`sm`,"data-action":`switch-branch`,className:`ml-auto`,disabled:s.isPending,onClick:()=>s.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 “`,v.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=g.trim();t&&s.mutate(t,{onSuccess:()=>_(``)})},children:[(0,U.jsx)(N,{"aria-label":`New branch name`,placeholder:`new-branch-name`,value:g,onChange:e=>_(e.target.value)}),(0,U.jsxs)(d,{type:`submit`,variant:`outline`,size:`sm`,"data-action":`create-branch`,disabled:!g.trim()||s.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:l.isPending,onChange:e=>l.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=a({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=s(),t=E(),[n,r]=(0,H.useState)(`unified`),[i,a]=(0,H.useState)(!1),[o,c]=(0,H.useState)(null),l=(0,H.useRef)(null),u=e.isError&&e.error instanceof _&&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)(g,{icon:u?(0,U.jsx)(j,{}):(0,U.jsx)(O,{}),tone:u?`neutral`:`danger`,heading:`h2`,title:u?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):d.length===0?(0,U.jsx)(g,{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`,{"data-slot":`changes-tree-pane`,className:`sticky top-28 hidden max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] w-60 shrink-0 overflow-y-auto overscroll-contain md:block lg:w-72`,children:(0,U.jsx)(R,{root:f,selected:o,onSelect:e=>{c(e),l.current?.scrollToPath(e)}})}),(0,U.jsx)(I,{files:d,viewRef:l,mode:p,wrap:m,className:`min-w-0 flex-1`})]})]})}function Y({log:e}){let{sha:t}=l();return t?(0,U.jsx)(X,{sha:t}):e.length===0?(0,U.jsx)(g,{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=i(e),n=E(),[r,a]=(0,H.useState)(`unified`),[o,s]=(0,H.useState)(!1),c=t.isError&&t.error instanceof _&&t.error.status===409,l=n?r:`unified`,u=!n||o;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)(d,{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:o,onModeChange:a,onWrapChange:s})})]}),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)(g,{icon:c?(0,U.jsx)(D,{}):(0,U.jsx)(O,{}),tone:c?`neutral`:`danger`,heading:`h2`,title:c?`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)(g,{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:l,wrap:u,className:`min-w-0`})})]})]})}function Z({tab:e}){let t=v();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)(g,{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)(g,{icon:(0,U.jsx)(P,{}),tone:`neutral`,title:`Not a git repository`,subtitle:`xezar 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};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./utils-Bb8ohcr3.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=[`.xezar/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};
@@ -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{$ as r,Cn as i,Hr as a,Jt as o,Kt as s,Mn as c,Rn as l,Rt as u,Tn as d,Ur as f,Wt as p,_r as m,a as h,hr as g,i as _,j as v,qr as y,t as b,ut as x,zt as S}from"./centered-state-B_V_Ai2h.js";import{t as C}from"./utils-Bb8ohcr3.js";import{t as w}from"./arrow-left-BJsIW6A0.js";import{S as T,f as E,v as D}from"./new-task-form-BydHBbef.js";import{r as O,t as k}from"./skill-empty-hint-DTu0LzaJ.js";import{t as A}from"./refresh-cw-DGliez3E.js";import{t as j}from"./sparkles-B8agSxBZ.js";import{t as M}from"./triangle-alert-D5tJwRD2.js";import{a as N,c as P,l as F,o as I,r as L,s as R}from"./use-submit-shortcut-JY8M_MPL.js";import{c as z,t as B}from"./project-router-BbCzrHKs.js";import{i as V,n as H,o as U,p as W}from"./skills-D4P-Hgey.js";import{c as G,g as K,o as q,t as ee}from"./index-DlC81_GI.js";var J=e(t(),1),Y=n(),te=`https://github.com/open-mercato/skills`;function ne(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function X(e,t){return ne(e)??[...t]}function re({projectId:e}){let t=y(),n=s(),i=r(),[a,c]=(0,J.useState)(``),l=S(e,!!e),u=i.data??[],d=(0,J.useMemo)(()=>u.map(e=>e.name),[u]),f=(0,J.useRef)([]);f.current=d;let p=(0,J.useMemo)(()=>new Set(X(n.data,d)),[n.data,d]),m=(0,J.useRef)(Promise.resolve()),h=(0,J.useRef)(0),x=(0,J.useCallback)(e=>{let n=o.uiState,r=t.getQueryData(n),i=e(X(r,f.current));t.setQueryData(n,{...r,importedSkills:i});let a=++h.current;m.current=m.current.then(async()=>{try{let e=await g({importedSkills:i});a===h.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:v.skills}))}catch(e){_(e instanceof Error?e.message:String(e),{tone:`danger`}),a===h.current&&t.invalidateQueries({queryKey:n})}})},[t]),w=(0,J.useCallback)(e=>{x(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[x]),T=d.length>0&&d.every(e=>p.has(e)),E=(0,J.useCallback)(()=>{if(T){let e=new Set(f.current);x(t=>t.filter(t=>!e.has(t)))}else x(e=>[...new Set([...e,...f.current])])},[T,x]);if(i.isError)return(0,Y.jsx)(b,{icon:(0,Y.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:i.error.message});let D=a.trim().toLowerCase(),O=D?u.filter(e=>e.name.toLowerCase().includes(D)||(e.description??``).toLowerCase().includes(D)):u;return(0,Y.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`mx-auto w-full max-w-2xl`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold`,children:`Manage skills`}),(0,Y.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Reusable, technology-agnostic agent skills from`,` `,(0,Y.jsx)(`a`,{href:te,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,Y.jsx)(ie,{projectId:e,state:l.data,loadError:l.error}),(0,Y.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`These checkboxes choose what xezar shows; updates refresh installed skill files.`}),(0,Y.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,Y.jsx)(K,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:a,onChange:e=>c(e.target.value),className:`h-8 text-[13px]`}),(0,Y.jsx)(`button`,{type:`button`,"data-slot":`import-all`,disabled:d.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,Y.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:i.isPending?(0,Y.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):O.length>0?O.map(e=>{let t=p.has(e.name);return(0,Y.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,Y.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>w(e.name),className:`mt-0.5 size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-soft-foreground`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[13px] font-medium text-foreground`,children:e.name})]}),e.description?(0,Y.jsx)(`span`,{className:`mt-0.5 block pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,Y.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:u.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=y(),i=z(),a=(0,J.useRef)(0),[s,u]=(0,J.useState)(!1),p=f({mutationFn:()=>l({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=>{u(!1),i(E(e))},onError:e=>_(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===a.current&&(r.setQueryData(o.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:v.skills}),_(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),u(!0)))},g=(e,t)=>{t.seq===a.current&&_(e.message,{tone:`danger`})},b=f({mutationFn:t=>c(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>g(e,t)}),x=f({mutationFn:t=>d(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>g(e,t)}),S=e=>{let n=++a.current;e===`apply`?x.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):b.mutate({action:e,seq:n})},w=t?.scopes.some(e=>e.skills.length>0)??!1,D=t?.status===`error`,O=w&&(t?.available||D),k=x.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,Y.jsxs)(Y.Fragment,{children:[(0,Y.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,Y.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:B}),t?.checkedAt?(0,Y.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,Y.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,Y.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,j.length>0?(0,Y.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,Y.jsxs)(h,{"data-action":`skills-update-apply`,size:`sm`,disabled:k,onClick:()=>S(`apply`),children:[(0,Y.jsx)(A,{"aria-hidden":`true`,className:C(`size-3.5`,k&&`motion-safe:animate-spin`)}),k?`Updating…`:D?`Retry`:`Update now`]}):t?.status===`current`?(0,Y.jsx)(h,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:b.isPending,onClick:()=>S(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,Y.jsx)(h,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:b.isPending,onClick:()=>S(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,Y.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,Y.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,Y.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,Y.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,Y.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,Y.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,Y.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,Y.jsx)(L,{open:s,onOpenChange:e=>p.isPending?void 0:u(e),children:(0,Y.jsxs)(N,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{children:`Apply the upgrade notes now?`}),(0,Y.jsxs)(I,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,Y.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,Y.jsxs)(R,{children:[(0,Y.jsx)(h,{type:`button`,variant:`outline`,disabled:p.isPending,onClick:()=>u(!1),children:`No`}),(0,Y.jsx)(h,{type:`button`,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function ae(){return(0,Y.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,Y.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,Y.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,Y.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,Y.jsx)(oe,{})]})}function oe(){let e=u(),t=p(),n=r(),[o]=a(),[s,c]=(0,J.useState)(``),l=y(),d=x(),h=i().projectId??d.data?.bootProject??``,g=f({mutationFn:()=>m(),onSuccess:e=>{l.setQueryData(v.skills,e),_(`Team skills refreshed.`)},onError:e=>_(e.message,{tone:`danger`})});if(e.isError)return(0,Y.jsx)(b,{icon:(0,Y.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let S=U(e.data??[]),T=(n.data?.length??0)>0,E=o.get(`skill`),N=E===Q||E===$||E!==null&&S.some(e=>e.name===E)?E:S[0]?.name??(T?$:Q),P=S.find(e=>e.name===N)??null,F=H(S,s);return(0,Y.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,Y.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))]`,E===null?`flex`:`hidden md:flex`),children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,Y.jsx)(K,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:s,onChange:e=>c(e.target.value),className:`h-8 text-[13px]`}),(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:g.isPending,onClick:()=>g.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,Y.jsx)(A,{"aria-hidden":`true`,className:C(`size-3`,g.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,Y.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:e.isPending?(0,Y.jsx)(`li`,{className:`px-2.5 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):F.length>0?F.map(e=>(0,Y.jsx)(se,{skill:e,active:N===e.name},e.path)):(0,Y.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:S.length>0?`(no skills match)`:(0,Y.jsx)(k,{})})}),(0,Y.jsxs)(`div`,{className:`shrink-0 border-t border-border p-2`,children:[T?(0,Y.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,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(O,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Manage skills`}),(0,Y.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,Y.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`Choose which open-mercato skills appear in your catalog.`})]}):null,(0,Y.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,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(D,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Run from GitHub`}),(0,Y.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,Y.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`One-click skill launch from any GitHub PR or issue.`})]})]})]}),(0,Y.jsx)(`section`,{"data-slot":`skills-detail`,className:C(`min-w-0 flex-1 flex-col`,E===null?`hidden md:flex`:`flex`),children:(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:[(0,Y.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,Y.jsx)(w,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),N===$?(0,Y.jsx)(re,{projectId:h}):N===Q?(0,Y.jsx)(ee,{skills:S}):P?(0,Y.jsx)(q,{skill:P,usedBy:W(t.data?.workflows??[],P.name)}):e.isPending?null:(0,Y.jsx)(b,{icon:(0,Y.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=V(e);return(0,Y.jsx)(`li`,{children:(0,Y.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,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(j,{"aria-hidden":`true`,className:C(`size-3.5 shrink-0`,n?`text-violet`:`text-soft-foreground`)}),(0,Y.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,Y.jsx)(G,{source:e.source,className:`ml-auto`})]}),e.description?(0,Y.jsx)(`span`,{className:`line-clamp-2 pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})})}export{ae as SkillsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,Cn as i,Hr as a,Jt as o,Kt as s,Mn as c,Rn as l,Rt as u,Tn as d,Ur as f,Wt as p,_r as m,a as h,hr as g,i as _,j as v,qr as y,t as b,ut as x,zt as S}from"./centered-state-B_V_Ai2h.js";import{t as C}from"./utils-Bb8ohcr3.js";import{t as w}from"./arrow-left-BJsIW6A0.js";import{S as T,f as E,v as D}from"./new-task-form-BydHBbef.js";import{r as O,t as k}from"./skill-empty-hint-CL0g7WBL.js";import{t as A}from"./refresh-cw-DGliez3E.js";import{t as j}from"./sparkles-B8agSxBZ.js";import{t as M}from"./triangle-alert-D5tJwRD2.js";import{a as N,c as P,l as F,o as I,r as L,s as R}from"./use-submit-shortcut-JY8M_MPL.js";import{c as z,t as B}from"./project-router-BbCzrHKs.js";import{i as V,n as H,o as U,p as W}from"./skills-D4P-Hgey.js";import{c as G,g as K,o as q,t as ee}from"./index-GflrFgEB.js";var J=e(t(),1),Y=n(),te=`https://github.com/open-mercato/skills`;function ne(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function X(e,t){return ne(e)??[...t]}function re({projectId:e}){let t=y(),n=s(),i=r(),[a,c]=(0,J.useState)(``),l=S(e,!!e),u=i.data??[],d=(0,J.useMemo)(()=>u.map(e=>e.name),[u]),f=(0,J.useRef)([]);f.current=d;let p=(0,J.useMemo)(()=>new Set(X(n.data,d)),[n.data,d]),m=(0,J.useRef)(Promise.resolve()),h=(0,J.useRef)(0),x=(0,J.useCallback)(e=>{let n=o.uiState,r=t.getQueryData(n),i=e(X(r,f.current));t.setQueryData(n,{...r,importedSkills:i});let a=++h.current;m.current=m.current.then(async()=>{try{let e=await g({importedSkills:i});a===h.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:v.skills}))}catch(e){_(e instanceof Error?e.message:String(e),{tone:`danger`}),a===h.current&&t.invalidateQueries({queryKey:n})}})},[t]),w=(0,J.useCallback)(e=>{x(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[x]),T=d.length>0&&d.every(e=>p.has(e)),E=(0,J.useCallback)(()=>{if(T){let e=new Set(f.current);x(t=>t.filter(t=>!e.has(t)))}else x(e=>[...new Set([...e,...f.current])])},[T,x]);if(i.isError)return(0,Y.jsx)(b,{icon:(0,Y.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:i.error.message});let D=a.trim().toLowerCase(),O=D?u.filter(e=>e.name.toLowerCase().includes(D)||(e.description??``).toLowerCase().includes(D)):u;return(0,Y.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`mx-auto w-full max-w-2xl`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold`,children:`Manage skills`}),(0,Y.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Reusable, technology-agnostic agent skills from`,` `,(0,Y.jsx)(`a`,{href:te,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,Y.jsx)(ie,{projectId:e,state:l.data,loadError:l.error}),(0,Y.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`These checkboxes choose what xezar shows; updates refresh installed skill files.`}),(0,Y.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,Y.jsx)(K,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:a,onChange:e=>c(e.target.value),className:`h-8 text-[13px]`}),(0,Y.jsx)(`button`,{type:`button`,"data-slot":`import-all`,disabled:d.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,Y.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:i.isPending?(0,Y.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):O.length>0?O.map(e=>{let t=p.has(e.name);return(0,Y.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,Y.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>w(e.name),className:`mt-0.5 size-3.5 shrink-0`}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(j,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-soft-foreground`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[13px] font-medium text-foreground`,children:e.name})]}),e.description?(0,Y.jsx)(`span`,{className:`mt-0.5 block pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,Y.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:u.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=y(),i=z(),a=(0,J.useRef)(0),[s,u]=(0,J.useState)(!1),p=f({mutationFn:()=>l({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=>{u(!1),i(E(e))},onError:e=>_(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===a.current&&(r.setQueryData(o.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:v.skills}),_(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),u(!0)))},g=(e,t)=>{t.seq===a.current&&_(e.message,{tone:`danger`})},b=f({mutationFn:t=>c(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>g(e,t)}),x=f({mutationFn:t=>d(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>g(e,t)}),S=e=>{let n=++a.current;e===`apply`?x.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):b.mutate({action:e,seq:n})},w=t?.scopes.some(e=>e.skills.length>0)??!1,D=t?.status===`error`,O=w&&(t?.available||D),k=x.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,Y.jsxs)(Y.Fragment,{children:[(0,Y.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,Y.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:B}),t?.checkedAt?(0,Y.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,Y.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,Y.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,j.length>0?(0,Y.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,Y.jsxs)(h,{"data-action":`skills-update-apply`,size:`sm`,disabled:k,onClick:()=>S(`apply`),children:[(0,Y.jsx)(A,{"aria-hidden":`true`,className:C(`size-3.5`,k&&`motion-safe:animate-spin`)}),k?`Updating…`:D?`Retry`:`Update now`]}):t?.status===`current`?(0,Y.jsx)(h,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:b.isPending,onClick:()=>S(`check`),children:`Check again`}):t?.status===`unavailable`||n?(0,Y.jsx)(h,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:b.isPending,onClick:()=>S(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,Y.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,Y.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,Y.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,Y.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,Y.jsx)(T,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,Y.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,Y.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,Y.jsx)(L,{open:s,onOpenChange:e=>p.isPending?void 0:u(e),children:(0,Y.jsxs)(N,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{children:`Apply the upgrade notes now?`}),(0,Y.jsxs)(I,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,Y.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,Y.jsxs)(R,{children:[(0,Y.jsx)(h,{type:`button`,variant:`outline`,disabled:p.isPending,onClick:()=>u(!1),children:`No`}),(0,Y.jsx)(h,{type:`button`,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function ae(){return(0,Y.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,Y.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,Y.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,Y.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,Y.jsx)(oe,{})]})}function oe(){let e=u(),t=p(),n=r(),[o]=a(),[s,c]=(0,J.useState)(``),l=y(),d=x(),h=i().projectId??d.data?.bootProject??``,g=f({mutationFn:()=>m(),onSuccess:e=>{l.setQueryData(v.skills,e),_(`Team skills refreshed.`)},onError:e=>_(e.message,{tone:`danger`})});if(e.isError)return(0,Y.jsx)(b,{icon:(0,Y.jsx)(M,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let S=U(e.data??[]),T=(n.data?.length??0)>0,E=o.get(`skill`),N=E===Q||E===$||E!==null&&S.some(e=>e.name===E)?E:S[0]?.name??(T?$:Q),P=S.find(e=>e.name===N)??null,F=H(S,s);return(0,Y.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,Y.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))]`,E===null?`flex`:`hidden md:flex`),children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,Y.jsx)(K,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:s,onChange:e=>c(e.target.value),className:`h-8 text-[13px]`}),(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:g.isPending,onClick:()=>g.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,Y.jsx)(A,{"aria-hidden":`true`,className:C(`size-3`,g.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,Y.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:e.isPending?(0,Y.jsx)(`li`,{className:`px-2.5 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):F.length>0?F.map(e=>(0,Y.jsx)(se,{skill:e,active:N===e.name},e.path)):(0,Y.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:S.length>0?`(no skills match)`:(0,Y.jsx)(k,{})})}),(0,Y.jsxs)(`div`,{className:`shrink-0 border-t border-border p-2`,children:[T?(0,Y.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,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(O,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Manage skills`}),(0,Y.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,Y.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`Choose which open-mercato skills appear in your catalog.`})]}):null,(0,Y.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,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(D,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Run from GitHub`}),(0,Y.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,Y.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`One-click skill launch from any GitHub PR or issue.`})]})]})]}),(0,Y.jsx)(`section`,{"data-slot":`skills-detail`,className:C(`min-w-0 flex-1 flex-col`,E===null?`hidden md:flex`:`flex`),children:(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:[(0,Y.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,Y.jsx)(w,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),N===$?(0,Y.jsx)(re,{projectId:h}):N===Q?(0,Y.jsx)(ee,{skills:S}):P?(0,Y.jsx)(q,{skill:P,usedBy:W(t.data?.workflows??[],P.name)}):e.isPending?null:(0,Y.jsx)(b,{icon:(0,Y.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=V(e);return(0,Y.jsx)(`li`,{children:(0,Y.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,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(j,{"aria-hidden":`true`,className:C(`size-3.5 shrink-0`,n?`text-violet`:`text-soft-foreground`)}),(0,Y.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,Y.jsx)(G,{source:e.source,className:`ml-auto`})]}),e.description?(0,Y.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"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Et as r,Nn as i,Qn as a,Tt as o,Ur as s,Vr as c,Z as l,_n as u,a as d,br as f,dr as p,i as m,ir as h,j as g,or as _,qr as v,t as y,wn as b,xt as x,zn as S}from"./centered-state-B_V_Ai2h.js";import{l as C,u as w}from"./editable-title-wS5NWwob.js";import{t as ee}from"./run-header-Cd8mSKBG.js";import{i as T,t as E}from"./use-desktop-C31lOFUD.js";import{t as D}from"./textarea--cpYshee.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-JY8M_MPL.js";import{S as F,n as I,r as L}from"./index-DlC81_GI.js";import{t as R}from"./diff-CbozNUJq.js";import{i as z,n as B,r as V}from"./git-toolbar-DZlZjTGz.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=v(),[a,o]=(0,H.useState)(``),c=u(e),l=(0,H.useRef)(c);l.current=c,(0,H.useEffect)(()=>{t&&o(l.current)},[t]);let f=s({mutationFn:t=>i(e.id,t),onSuccess:t=>{m(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:g.runs.changes(e.id)}),r.invalidateQueries({queryKey:g.runs.all})},onError:e=>m(e.message,{tone:`danger`})}),p=()=>{let e=a.trim();e.length===0||f.isPending||f.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:a,onChange:e=>o(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(),p())}}),(0,Y.jsxs)(N,{children:[(0,Y.jsx)(d,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Y.jsx)(d,{"data-slot":`commit-confirm`,disabled:a.trim().length===0||f.isPending,onClick:p,children:f.isPending?`Committing…`:`Commit`})]})]})})}function X(){let{id:e}=c(),t=o(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(),i=r(e.id,C(e.status)),a=E(),[o,c]=(0,H.useState)(`unified`),[u,d]=(0,H.useState)(!1),[D,O]=(0,H.useState)(null),[k,A]=(0,H.useState)(!1),j=(0,H.useRef)(null),M=v(),N=()=>M.invalidateQueries({queryKey:g.runs.all}),P=e=>m(e.message,{tone:`danger`}),I=s({mutationFn:()=>p(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:()=>S(e.id),onSuccess:e=>{m(`Draft PR created — ${e.url}`),N()},onError:P}),U=s({mutationFn:()=>_(e.id),onError:e=>{if(e instanceof b&&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=>h(e.id,t),onError:P}),G=i.isError&&i.error instanceof b&&i.error.status===409,K=J({status:e.status,hasWorktree:!!e.worktreePath&&!G,branch:e.branch,changedFiles:i.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:w(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=i.data?.files??[],Z=(0,H.useMemo)(()=>V(X),[X]),Q=a?o:`unified`,$=!a||u;return(0,Y.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Y.jsx)(ee,{run:e,tab:`changes`}),(0,Y.jsx)(B,{bar:K,branch:e.branch,stat:i.data?.stat,mode:Q,wrap:$,onModeChange:c,onWrapChange:d,onAction:q}),i.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:i.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Y.jsx)(`code`,{children:i.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,i.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…`}):i.isError?(0,Y.jsx)(y,{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:i.error.message}):X.length===0?(0,Y.jsx)(y,{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`,{"data-slot":`changes-tree-pane`,className:`sticky top-40 hidden max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] w-60 shrink-0 overflow-y-auto overscroll-contain 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=>f(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
+ 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,Nn as i,Qn as a,Tt as o,Ur as s,Vr as c,Z as l,_n as u,a as d,br as f,dr as p,i as m,ir as h,j as g,or as _,qr as v,t as y,wn as b,xt as x,zn as S}from"./centered-state-B_V_Ai2h.js";import{l as C,u as w}from"./editable-title-wS5NWwob.js";import{t as ee}from"./run-header-Cd8mSKBG.js";import{i as T,t as E}from"./use-desktop-Cec0eUGX.js";import{t as D}from"./textarea--cpYshee.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-JY8M_MPL.js";import{S as F,n as I,r as L}from"./index-GflrFgEB.js";import{t as R}from"./diff-CbozNUJq.js";import{i as z,n as B,r as V}from"./git-toolbar-BAZPUijR.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=v(),[a,o]=(0,H.useState)(``),c=u(e),l=(0,H.useRef)(c);l.current=c,(0,H.useEffect)(()=>{t&&o(l.current)},[t]);let f=s({mutationFn:t=>i(e.id,t),onSuccess:t=>{m(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:g.runs.changes(e.id)}),r.invalidateQueries({queryKey:g.runs.all})},onError:e=>m(e.message,{tone:`danger`})}),p=()=>{let e=a.trim();e.length===0||f.isPending||f.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:a,onChange:e=>o(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(),p())}}),(0,Y.jsxs)(N,{children:[(0,Y.jsx)(d,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Y.jsx)(d,{"data-slot":`commit-confirm`,disabled:a.trim().length===0||f.isPending,onClick:p,children:f.isPending?`Committing…`:`Commit`})]})]})})}function X(){let{id:e}=c(),t=o(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(),i=r(e.id,C(e.status)),a=E(),[o,c]=(0,H.useState)(`unified`),[u,d]=(0,H.useState)(!1),[D,O]=(0,H.useState)(null),[k,A]=(0,H.useState)(!1),j=(0,H.useRef)(null),M=v(),N=()=>M.invalidateQueries({queryKey:g.runs.all}),P=e=>m(e.message,{tone:`danger`}),I=s({mutationFn:()=>p(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:()=>S(e.id),onSuccess:e=>{m(`Draft PR created — ${e.url}`),N()},onError:P}),U=s({mutationFn:()=>_(e.id),onError:e=>{if(e instanceof b&&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=>h(e.id,t),onError:P}),G=i.isError&&i.error instanceof b&&i.error.status===409,K=J({status:e.status,hasWorktree:!!e.worktreePath&&!G,branch:e.branch,changedFiles:i.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:w(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=i.data?.files??[],Z=(0,H.useMemo)(()=>V(X),[X]),Q=a?o:`unified`,$=!a||u;return(0,Y.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Y.jsx)(ee,{run:e,tab:`changes`}),(0,Y.jsx)(B,{bar:K,branch:e.branch,stat:i.data?.stat,mode:Q,wrap:$,onModeChange:c,onWrapChange:d,onAction:q}),i.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:i.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Y.jsx)(`code`,{children:i.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,i.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…`}):i.isError?(0,Y.jsx)(y,{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:i.error.message}):X.length===0?(0,Y.jsx)(y,{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`,{"data-slot":`changes-tree-pane`,className:`sticky top-40 hidden max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] w-60 shrink-0 overflow-y-auto overscroll-contain 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=>f(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{Dt as r,Ot as i,Tt as a,Vr as o,a as s,t as c,wn as l}from"./centered-state-B_V_Ai2h.js";import{l as u}from"./editable-title-wS5NWwob.js";import{t as d}from"./arrow-left-BJsIW6A0.js";import{t as f}from"./run-header-Cd8mSKBG.js";import{i as p,r as m,t as h}from"./use-desktop-C31lOFUD.js";import{t as g}from"./search-x-69n_672Y.js";import{t as _}from"./triangle-alert-D5tJwRD2.js";import{t as v}from"./project-router-BbCzrHKs.js";import{t as y}from"./diff-stat-btAmKFJr.js";import{n as b,r as x}from"./index-DlC81_GI.js";import{t as S}from"./diff-CbozNUJq.js";import{t as C}from"./commit-list-C4Dv6vUL.js";var w=e(t(),1),T=n();function E(){let{id:e}=o(),t=a(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}=o(),n=i(e.id,u(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 l&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof l&&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=r(e,t),i=h(),[a,o]=(0,w.useState)(`unified`),[u,f]=(0,w.useState)(!1),b=n.isError&&n.error instanceof l&&n.error.status===409,x=i?a:`unified`,C=!i||u;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)(s,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,T.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,T.jsx)(d,{"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:a,wrap:u,onModeChange:o,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
+ 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,Ot as i,Tt as a,Vr as o,a as s,t as c,wn as l}from"./centered-state-B_V_Ai2h.js";import{l as u}from"./editable-title-wS5NWwob.js";import{t as d}from"./arrow-left-BJsIW6A0.js";import{t as f}from"./run-header-Cd8mSKBG.js";import{i as p,r as m,t as h}from"./use-desktop-Cec0eUGX.js";import{t as g}from"./search-x-69n_672Y.js";import{t as _}from"./triangle-alert-D5tJwRD2.js";import{t as v}from"./project-router-BbCzrHKs.js";import{t as y}from"./diff-stat-btAmKFJr.js";import{n as b,r as x}from"./index-GflrFgEB.js";import{t as S}from"./diff-CbozNUJq.js";import{t as C}from"./commit-list-C4Dv6vUL.js";var w=e(t(),1),T=n();function E(){let{id:e}=o(),t=a(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}=o(),n=i(e.id,u(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 l&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof l&&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=r(e,t),i=h(),[a,o]=(0,w.useState)(`unified`),[u,f]=(0,w.useState)(!1),b=n.isError&&n.error instanceof l&&n.error.status===409,x=i?a:`unified`,C=!i||u;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)(s,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,T.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,T.jsx)(d,{"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:a,wrap:u,onModeChange:o,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{At as r,Tt as i,Vr as a,br as o,t as s,wn as c}from"./centered-state-B_V_Ai2h.js";import{r as l,t as u}from"./utils-Bb8ohcr3.js";import{t as d}from"./chevron-right-CFzn-von.js";import{t as f}from"./run-header-Cd8mSKBG.js";import{t as p}from"./file-DKoYWRsv.js";import{t as m}from"./folder-u01HScRT.js";import{t as h}from"./triangle-alert-D5tJwRD2.js";import{a as g,i as _,r as v}from"./highlighter-C8DK1_sG.js";import{n as y,r as b}from"./index-DlC81_GI.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)(s,{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 c&&i.error.status===409;return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(s,{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:o(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,M.jsx)(s,{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)(s,{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(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{At as r,Tt as i,Vr as a,br as o,t as s,wn as c}from"./centered-state-B_V_Ai2h.js";import{r as l,t as u}from"./utils-Bb8ohcr3.js";import{t as d}from"./chevron-right-CFzn-von.js";import{t as f}from"./run-header-Cd8mSKBG.js";import{t as p}from"./file-DKoYWRsv.js";import{t as m}from"./folder-u01HScRT.js";import{t as h}from"./triangle-alert-D5tJwRD2.js";import{a as g,i as _,r as v}from"./highlighter-C8DK1_sG.js";import{n as y,r as b}from"./index-GflrFgEB.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)(s,{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 c&&i.error.status===409;return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(s,{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:o(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,M.jsx)(s,{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)(s,{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
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}=a(),t=i(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 c&&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)(s,{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 [--diff-sticky-top:7rem] md:flex-row md:items-start md:px-6`,children:[(0,M.jsx)(`aside`,{"data-slot":`files-tree-pane`,className:`w-full shrink-0 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain 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};
@@ -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{a as r}from"./centered-state-B_V_Ai2h.js";import{r as i,t as a}from"./utils-Bb8ohcr3.js";import{x as o}from"./index-DlC81_GI.js";var s=i(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),c=i(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=n();function u({mode:e,wrap:t,onModeChange:n,onWrapChange:i}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,l.jsx)(d,{current:e,value:`unified`,onModeChange:n}),(0,l.jsx)(d,{current:e,value:`split`,onModeChange:n})]}),(0,l.jsx)(r,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":t,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:a(t&&`bg-muted text-foreground`),onClick:()=>i(!t),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({current:e,value:t,onModeChange:n}){let r=e===t;return(0,l.jsx)(`button`,{type:`button`,"data-mode":t,"aria-pressed":r,onClick:()=>n(t),className:a(`rounded-[5px] px-2 py-0.5 text-[11px] font-medium capitalize`,r?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:t})}function f({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,l.jsx)(o,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}var p=e(t(),1);function m(){let[e,t]=(0,p.useState)(()=>typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches);return(0,p.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(min-width: 768px)`),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}export{s as i,f as n,u as r,m as t};
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}from"./centered-state-B_V_Ai2h.js";import{r as i,t as a}from"./utils-Bb8ohcr3.js";import{x as o}from"./index-GflrFgEB.js";var s=i(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),c=i(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=n();function u({mode:e,wrap:t,onModeChange:n,onWrapChange:i}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center rounded-md border border-border p-0.5`,children:[(0,l.jsx)(d,{current:e,value:`unified`,onModeChange:n}),(0,l.jsx)(d,{current:e,value:`split`,onModeChange:n})]}),(0,l.jsx)(r,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":t,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:a(t&&`bg-muted text-foreground`),onClick:()=>i(!t),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({current:e,value:t,onModeChange:n}){let r=e===t;return(0,l.jsx)(`button`,{type:`button`,"data-mode":t,"aria-pressed":r,onClick:()=>n(t),className:a(`rounded-[5px] px-2 py-0.5 text-[11px] font-medium capitalize`,r?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:t})}function f({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,l.jsx)(o,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}var p=e(t(),1);function m(){let[e,t]=(0,p.useState)(()=>typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches);return(0,p.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(min-width: 768px)`),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}export{s as i,f as n,u as r,m as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,Bn as a,Hn as o,Rt as s,Ur as c,Vr as l,Vt as u,Wt as d,a as f,i as p,j as m,qr as h,sr as g,t as _,ur as v,wn as y}from"./centered-state-B_V_Ai2h.js";import{r as b,t as x}from"./utils-Bb8ohcr3.js";import{t as S}from"./arrow-down-G8adPhbu.js";import{n as C,t as w}from"./trash-2--ZtrzUx3.js";import{n as ee,r as te}from"./skill-empty-hint-DTu0LzaJ.js";import{t as T}from"./sparkles-B8agSxBZ.js";import{t as ne}from"./square-terminal-Cf4Og6ct.js";import{t as re}from"./triangle-alert-D5tJwRD2.js";import{t as ie}from"./upload-SnwVxKOA.js";import{n as ae,t as oe}from"./textarea--cpYshee.js";import{a as E,c as se,i as ce,n as D,o as le,r as O,s as ue,t as k}from"./alert-dialog-CGskMvgc.js";import{i as de,s as A}from"./skills-D4P-Hgey.js";import{b as j,g as M,i as fe,y as N}from"./index-DlC81_GI.js";var pe=b(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),me=e(n()),P=e(t());function he(){var e=[...arguments];return(0,P.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var F=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function I(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function L(e){return`nodeType`in e}function R(e){return e?I(e)?e:L(e)?e.ownerDocument?.defaultView??window:window:window}function ge(e){let{Document:t}=R(e);return e instanceof t}function _e(e){return!I(e)&&e instanceof R(e).HTMLElement}function ve(e){return e instanceof R(e).SVGElement}function z(e){return e?I(e)?e.document:L(e)?ge(e)?e:_e(e)||ve(e)?e.ownerDocument:document:document:document}var B=F?P.useLayoutEffect:P.useEffect;function ye(e){let t=(0,P.useRef)(e);return B(()=>{t.current=e}),(0,P.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function be(){let e=(0,P.useRef)(null);return[(0,P.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,P.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function xe(e,t){t===void 0&&(t=[e]);let n=(0,P.useRef)(e);return B(()=>{n.current!==e&&(n.current=e)},t),n}function V(e,t){let n=(0,P.useRef)();return(0,P.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function H(e){let t=ye(e),n=(0,P.useRef)(null);return[n,(0,P.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Se(e){let t=(0,P.useRef)();return(0,P.useEffect)(()=>{t.current=e},[e]),t.current}var U={};function Ce(e,t){return(0,P.useMemo)(()=>{if(t)return t;let n=U[e]==null?0:U[e]+1;return U[e]=n,e+`-`+n},[e,t])}function we(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Te=we(1),Ee=we(-1);function De(e){return`clientX`in e&&`clientY`in e}function W(e){if(!e)return!1;let{KeyboardEvent:t}=R(e.target);return t&&e instanceof t}function G(e){if(!e)return!1;let{TouchEvent:t}=R(e.target);return t&&e instanceof t}function Oe(e){if(G(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return De(e)?{x:e.clientX,y:e.clientY}:null}var K=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[K.Translate.toString(e),K.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ke=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ae(e){return e.matches(ke)?e:e.querySelector(ke)}var je={display:`none`};function Me(e){let{id:t,value:n}=e;return P.createElement(`div`,{id:t,style:je},n)}function Ne(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return P.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Pe(){let[e,t]=(0,P.useState)(``);return{announce:(0,P.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Fe=(0,P.createContext)(null);function Ie(e){let t=(0,P.useContext)(Fe);(0,P.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Le(){let[e]=(0,P.useState)(()=>new Set),t=(0,P.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,P.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Re={draggable:`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,Bn as a,Hn as o,Rt as s,Ur as c,Vr as l,Vt as u,Wt as d,a as f,i as p,j as m,qr as h,sr as g,t as _,ur as v,wn as y}from"./centered-state-B_V_Ai2h.js";import{r as b,t as x}from"./utils-Bb8ohcr3.js";import{t as S}from"./arrow-down-G8adPhbu.js";import{n as C,t as w}from"./trash-2--ZtrzUx3.js";import{n as ee,r as te}from"./skill-empty-hint-CL0g7WBL.js";import{t as T}from"./sparkles-B8agSxBZ.js";import{t as ne}from"./square-terminal-Cf4Og6ct.js";import{t as re}from"./triangle-alert-D5tJwRD2.js";import{t as ie}from"./upload-SnwVxKOA.js";import{n as ae,t as oe}from"./textarea--cpYshee.js";import{a as E,c as se,i as ce,n as D,o as le,r as O,s as ue,t as k}from"./alert-dialog-CGskMvgc.js";import{i as de,s as A}from"./skills-D4P-Hgey.js";import{b as j,g as M,i as fe,y as N}from"./index-GflrFgEB.js";var pe=b(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),me=e(n()),P=e(t());function he(){var e=[...arguments];return(0,P.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var F=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function I(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function L(e){return`nodeType`in e}function R(e){return e?I(e)?e:L(e)?e.ownerDocument?.defaultView??window:window:window}function ge(e){let{Document:t}=R(e);return e instanceof t}function _e(e){return!I(e)&&e instanceof R(e).HTMLElement}function ve(e){return e instanceof R(e).SVGElement}function z(e){return e?I(e)?e.document:L(e)?ge(e)?e:_e(e)||ve(e)?e.ownerDocument:document:document:document}var B=F?P.useLayoutEffect:P.useEffect;function ye(e){let t=(0,P.useRef)(e);return B(()=>{t.current=e}),(0,P.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function be(){let e=(0,P.useRef)(null);return[(0,P.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,P.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function xe(e,t){t===void 0&&(t=[e]);let n=(0,P.useRef)(e);return B(()=>{n.current!==e&&(n.current=e)},t),n}function V(e,t){let n=(0,P.useRef)();return(0,P.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function H(e){let t=ye(e),n=(0,P.useRef)(null);return[n,(0,P.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Se(e){let t=(0,P.useRef)();return(0,P.useEffect)(()=>{t.current=e},[e]),t.current}var U={};function Ce(e,t){return(0,P.useMemo)(()=>{if(t)return t;let n=U[e]==null?0:U[e]+1;return U[e]=n,e+`-`+n},[e,t])}function we(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Te=we(1),Ee=we(-1);function De(e){return`clientX`in e&&`clientY`in e}function W(e){if(!e)return!1;let{KeyboardEvent:t}=R(e.target);return t&&e instanceof t}function G(e){if(!e)return!1;let{TouchEvent:t}=R(e.target);return t&&e instanceof t}function Oe(e){if(G(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return De(e)?{x:e.clientX,y:e.clientY}:null}var K=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[K.Translate.toString(e),K.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ke=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ae(e){return e.matches(ke)?e:e.querySelector(ke)}var je={display:`none`};function Me(e){let{id:t,value:n}=e;return P.createElement(`div`,{id:t,style:je},n)}function Ne(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return P.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Pe(){let[e,t]=(0,P.useState)(``);return{announce:(0,P.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Fe=(0,P.createContext)(null);function Ie(e){let t=(0,P.useContext)(Fe);(0,P.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Le(){let[e]=(0,P.useState)(()=>new Set),t=(0,P.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,P.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Re={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -8,4 +8,4 @@ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}f
8
8
  `)}\n`}function Br(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function Vr(e){let t=Nr(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Hr(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Ur(e,t,n){let r=Nr(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var $=r(),Wr=`wb-canvas`;function Gr(){return{name:`my-workflow`,description:``,steps:[]}}function Kr(e){return{name:e.name,description:e.description??``,steps:structuredClone(e.steps??[])}}function qr(){let{name:e}=l();return(0,$.jsx)(Jr,{routeName:e},e??``)}function Jr({routeName:e}){let t=d(),n=s(),r=u(),l=h(),[b,S]=(0,P.useState)(null),[C,ee]=(0,P.useState)(``),[ne,ae]=(0,P.useState)(!1),[de,j]=(0,P.useState)(``),[N,me]=(0,P.useState)(``),[he,F]=(0,P.useState)(!1),[I,L]=(0,P.useState)(``),[R,ge]=(0,P.useState)(!1),[_e,ve]=(0,P.useState)(!1),[z,B]=(0,P.useState)(null),[ye,be]=(0,P.useState)(null),xe=(0,P.useRef)(null),V=t.data?.workflows??[],H=n.data??[],Se=A(H,r.data?.skillUsage);(0,P.useEffect)(()=>{if(b!==null||t.data===void 0)return;let n=t.data.workflows,r=(e?n.find(t=>t.name===e):void 0)??n.find(e=>e.source===`file`);S(r?Kr(r):Gr())},[b,t.data,e]);let U=e=>S(t=>t===null?t:{...t,steps:e}),Ce=c({mutationFn:e=>g(e),onSuccess:e=>{S({name:e.name,description:e.description??``,steps:e.steps}),ae(!1),j(``),me(``),p(`Imported "${e.name}" — review, then Save.`)},onError:e=>me(e.message)}),we=c({mutationFn:e=>v(e),onSuccess:e=>{S(t=>{let n=t??Gr(),{name:r,steps:i}=Hr(e,n.name);return{...n,name:r,steps:i}}),F(!1),L(``),p(e.fallback?`Planner unavailable — added a single step. Edit, then Save.`:`Built "${e.name??b?.name??`workflow`}" — review, tweak, then Save.`,e.fallback?{tone:`danger`}:void 0)},onError:e=>p(e instanceof Error?e.message:String(e),{tone:`danger`})}),Te=c({mutationFn:e=>a({...Ur(b?.name??``,b?.description??``,b?.steps??[]),...e?{overwrite:!0}:{}}),onSuccess:e=>{ge(!1),p(`Saved — ${e.path.split(`/`).pop()??e.path}`),l.invalidateQueries({queryKey:m.workflows})},onError:e=>{e instanceof y&&e.exists===!0?ge(!0):p(e instanceof Error?e.message:String(e),{tone:`danger`})}}),Ee=c({mutationFn:e=>o(e),onSuccess:(e,t)=>{ve(!1),p(`Deleted "${t}".`),S(Gr()),l.invalidateQueries({queryKey:m.workflows})},onError:e=>{ve(!1),p(e instanceof Error?e.message:String(e),{tone:`danger`})}}),De=Ue(He(Ht,{activationConstraint:{distance:4}}),He(Lt,{coordinateGetter:Ar}));if(t.isError)return(0,$.jsx)(`div`,{"data-route":`workflows`,className:`flex min-h-full flex-col`,children:(0,$.jsx)(_,{icon:(0,$.jsx)(re,{}),tone:`danger`,title:`Could not load workflows`,subtitle:t.error.message})});if(b===null)return(0,$.jsx)(fe,{});let W=b.steps,G=b.name.trim(),Oe=V.find(e=>e.name===G&&e.source===`file`),K=zr(b.name,b.description,W),ke=(e,t=W.length)=>{if(W.length>=8){p(`A workflow holds at most 8 steps.`,{tone:`danger`});return}U(Fr(W,Pr(e,W),t))},Ae=e=>{let t=e.active.data.current;B(t??null)},je=e=>{be(e.over?String(e.over.id):null)},Me=e=>{B(null),be(null);let{active:t,over:n}=e;if(n===null)return;let r=t.data.current;if(r?.type===`palette`){let e=n.id===Wr?W.length:W.findIndex(e=>e.id===n.id);ke(r.skill,e===-1?W.length:e);return}if(n.id===t.id)return;let i=W.findIndex(e=>e.id===t.id),a=W.findIndex(e=>e.id===n.id);i!==-1&&a!==-1&&U(Ir(W,i,a))},Ne=()=>{let e=de.trim();e!==``&&Ce.mutate(e)},Pe=()=>{let e=I.trim();e===``||we.isPending||we.mutate(e)};return(0,$.jsxs)(`div`,{"data-route":`workflows`,className:`flex min-h-full flex-col`,children:[(0,$.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,$.jsx)(`h1`,{className:`text-base font-semibold`,children:`Workflows`}),(0,$.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Portable skill chains — the agent applies them top to bottom.`})]}),(0,$.jsxs)(Bn,{sensors:De,collisionDetection:Ze,onDragStart:Ae,onDragOver:je,onDragEnd:Me,onDragCancel:()=>{B(null),be(null)},children:[(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col gap-6 p-3 pb-[calc(90px+env(safe-area-inset-bottom))] md:flex-row md:p-5 md:pb-5`,children:[(0,$.jsxs)(`section`,{"data-slot":`wb-main`,className:`mx-auto w-full min-w-0 max-w-3xl flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2.5`,children:[(0,$.jsx)(M,{ref:xe,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:b.name,onChange:e=>S({...b,name:e.target.value}),className:`h-8 max-w-56 font-mono text-[13px] font-semibold`}),(0,$.jsx)(`span`,{"data-slot":`wb-count`,className:`shrink-0 font-mono text-xs text-soft-foreground`,children:Vr(W)})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[Oe?(0,$.jsxs)(f,{type:`button`,variant:`danger-ghost`,size:`sm`,"data-slot":`wb-delete`,title:`Delete the saved workflow file`,onClick:()=>ve(!0),children:[(0,$.jsx)(w,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null,(0,$.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":he,title:`Describe a chain — the agent builds it`,onClick:()=>{ae(!1),F(e=>!e)},children:[(0,$.jsx)(pe,{"aria-hidden":`true`,className:`size-3`}),`Auto`]}),(0,$.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,onClick:()=>{me(``),F(!1),ae(e=>!e)},children:[(0,$.jsx)(ie,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,$.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,title:`Download workflow.yaml`,onClick:()=>{let e=new Blob([K],{type:`text/yaml`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${Br(b.name)}.yaml`,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)},children:[(0,$.jsx)(te,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,$.jsxs)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-save`,disabled:Te.isPending,onClick:()=>{if(G===``){xe.current?.focus();return}if(W.length===0){p(`Add at least one step first.`,{tone:`danger`});return}Te.mutate(!1)},children:[(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3`}),`Save`]})]})]}),(0,$.jsxs)(`div`,{"data-slot":`wb-load`,className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`mr-0.5 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`edit`}),V.map(e=>(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-load-chip`,"data-name":e.name,title:e.description??``,"aria-pressed":G===e.name,onClick:()=>S(Kr(e)),className:x(`rounded-full border border-border bg-card px-2.5 py-1 font-mono text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,G===e.name&&`border-primary/40 bg-primary/10 text-foreground`),children:e.name},e.name)),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-new`,title:`Start an empty workflow`,onClick:()=>S(Gr()),className:`rounded-full border border-dashed border-border px-2.5 py-1 font-mono text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:`+ new`})]}),he?(0,$.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`mt-4 rounded-lg border border-border bg-card p-3 shadow-xs`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Build a chain from a prompt`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Describe what the chain should do. An agent proposes a title and an ordered set of skill / check steps — land it on the canvas, then tweak and Save.`}),(0,$.jsx)(oe,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:I,onChange:e=>L(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),Pe())},className:`mt-2 min-h-20 text-[13px]`}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsxs)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-auto-run`,disabled:we.isPending||I.trim()===``,onClick:Pe,children:[(0,$.jsx)(pe,{"aria-hidden":`true`,className:`size-3`}),we.isPending?`Building…`:`Build chain`]}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:()=>{F(!1),L(``)},children:`Cancel`})]})]}):null,ne?(0,$.jsxs)(`div`,{"data-slot":`wb-import-panel`,className:`mt-4 rounded-lg border border-border bg-card p-3 shadow-xs`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Import workflow YAML`}),(0,$.jsx)(oe,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:6,spellCheck:!1,placeholder:`name: my-flow
9
9
  skills:
10
10
  - test-conventions
11
- - commit-style`,value:de,onChange:e=>j(e.target.value),className:`mt-2 min-h-28 font-mono text-xs`}),N===``?null:(0,$.jsx)(`p`,{"data-slot":`wb-import-error`,className:`mt-2 text-xs text-danger`,children:N}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsx)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-import-run`,disabled:Ce.isPending,onClick:Ne,children:`Import`}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import-cancel`,onClick:()=>{ae(!1),j(``),me(``)},children:`Cancel`})]})]}):null,(0,$.jsx)(Yr,{steps:W,skills:H,dragging:z!==null,overId:ye,activeStepId:z?.type===`step`?z.step.id:null,onRemove:e=>U(Lr(W,e))})]}),(0,$.jsxs)(`aside`,{"data-slot":`wb-aside`,className:`w-full shrink-0 md:w-[320px]`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Skills`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Drag into the flow. Order is execution order — the agent applies them top to bottom.`}),(0,$.jsx)(M,{"data-slot":`wb-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:C,onChange:e=>ee(e.target.value),className:`mt-2.5 h-8 text-[13px]`}),(0,$.jsx)(Qr,{skills:Se,query:C,error:n.isError?n.error.message:null,inFlow:new Set(W.map(e=>e.skill).filter(e=>!!e)),onAdd:e=>ke(e)}),(0,$.jsxs)(`div`,{className:`mt-5 flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`workflow.yaml`}),(0,$.jsx)(`span`,{className:`flex-1`}),(0,$.jsx)(ei,{yaml:K})]}),(0,$.jsx)(`pre`,{"data-slot":`wb-yaml`,className:`mt-2 overflow-x-auto rounded-lg border border-border bg-card p-3 font-mono text-[11.5px] leading-relaxed whitespace-pre text-muted-foreground shadow-xs`,children:K}),(0,$.jsx)(`p`,{className:`mt-2 text-[11.5px] leading-relaxed text-soft-foreground`,children:`Portable — export this file and import it in any repo running xezar.`})]})]}),(0,$.jsx)(or,{children:z?.type===`palette`?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[13px] font-medium shadow-md`,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 text-primary`}),z.skill]}):z?.type===`step`?(0,$.jsx)(Zr,{step:z.step,index:W.findIndex(e=>e.id===z.step.id),skills:H,overlay:!0}):null})]}),(0,$.jsx)(k,{open:R,onOpenChange:e=>!e&&ge(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-overwrite-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`“`,G,`” already exists`]}),(0,$.jsx)(E,{children:`Saving overwrites the existing workflow file. There is no undo.`})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep the file`}),(0,$.jsx)(D,{"data-slot":`wb-overwrite-confirm`,onClick:()=>Te.mutate(!0),children:`Overwrite`})]})]})}),(0,$.jsx)(k,{open:_e,onOpenChange:e=>!e&&ve(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-delete-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`Delete workflow “`,G,`”?`]}),(0,$.jsxs)(E,{children:[`Removes `,Oe?.path?.split(`/`).pop()??`the saved file`,` from`,` `,(0,$.jsx)(`span`,{className:`font-mono`,children:`.ai/xezar/workflows/`}),`. There is no undo.`]})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep it`}),(0,$.jsx)(D,{"data-slot":`wb-delete-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>Ee.mutate(G),children:`Delete`})]})]})})]})}function Yr({steps:e,skills:t,dragging:n,overId:r,activeStepId:i,onRemove:a}){let{setNodeRef:o,isOver:s}=Jn({id:Wr}),c=n&&r===Wr;return(0,$.jsx)(`div`,{ref:o,"data-slot":`wb-steps`,"data-dragging":n||void 0,className:x(`mt-4 rounded-lg border border-dashed p-2 transition-colors`,s?`border-primary/60 bg-primary/5`:`border-muted-foreground/25`),children:e.length===0?(0,$.jsx)(`p`,{className:x(`rounded-md px-3 py-10 text-center text-[13px] transition-colors`,s?`text-primary`:`text-muted-foreground`),children:`Drop a skill here — or Import a workflow.yaml`}):(0,$.jsxs)(vr,{items:e.map(e=>e.id),strategy:mr,children:[(0,$.jsx)(`ol`,{className:`flex flex-col gap-2.5`,children:e.map((e,o)=>(0,$.jsx)(Xr,{step:e,index:o,skills:t,connector:o>0,dragging:n,insertBefore:n&&r===e.id&&i!==e.id,onRemove:()=>a(o)},e.id))}),(0,$.jsx)(`div`,{"aria-hidden":`true`,className:x(`mx-1 mt-2.5 h-[3px] rounded-full transition-colors`,c?`bg-primary`:`bg-transparent`)}),(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 pt-1.5 pb-1 text-[11px] text-muted-foreground`,children:[(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`runs top to bottom`]})]})})}function Xr({step:e,index:t,skills:n,connector:r,dragging:i,insertBefore:a,onRemove:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:f}=Er({id:e.id,data:{type:`step`,step:e}});return(0,$.jsxs)(`li`,{ref:l,style:{transform:K.Transform.toString(u),transition:d},className:x(`relative`,f&&`opacity-40`),children:[r&&!i?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute -top-[11px] left-1/2 h-[9px] w-px -translate-x-1/2 bg-muted-foreground/30`}):null,a?(0,$.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`wb-drop-line`,className:`pointer-events-none absolute -top-[7px] right-0 left-0 h-[3px] rounded-full bg-primary`}):null,(0,$.jsx)(Zr,{step:e,index:t,skills:n,onRemove:o,gripProps:{...s,...c}})]})}function Zr({step:e,index:t,skills:n,onRemove:r,gripProps:i,overlay:a=!1}){let o=n.find(t=>t.name===e.skill),s=!!e.command,c=s||!e.skill?e.name??e.id:e.skill,l=s?`$ ${e.command}${e.onFail?` — on fail retry from "${e.onFail.retry}" (×${e.onFail.max??2})`:``}`:e.skill?o?.description??`Not in this repo or the team skills — the step runs on its plain prompt.`:e.prompt??``,u=s?`check`:e.skill?o?null:`unknown`:`prompt`;return(0,$.jsxs)(`div`,{"data-slot":`wb-step`,"data-id":e.id,"data-index":t,className:x(`flex items-center gap-2.5 rounded-md border border-muted-foreground/20 bg-card-2 px-2.5 py-2 shadow-xs`,a&&`shadow-md`),children:[(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-grip`,"aria-label":`Reorder step ${t+1}: ${c}`,className:`shrink-0 cursor-grab rounded text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,...i,children:(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-3.5`})}),(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:String(t+1).padStart(2,`0`)}),s?(0,$.jsx)(ne,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-mono text-[13px] font-medium`,children:c}),l?(0,$.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:l}):null]}),u?(0,$.jsx)(`span`,{"data-slot":`wb-step-badge`,className:x(`shrink-0 rounded-full border px-2 py-px font-mono text-[10.5px]`,u===`check`&&`border-success/30 text-success`,u===`unknown`&&`border-danger/35 text-danger`,u===`prompt`&&`border-border text-soft-foreground`),children:u}):null,r?(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-remove`,"aria-label":`Remove step ${t+1}: ${c}`,title:`Remove from flow`,onClick:r,className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-danger focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function Qr({skills:e,query:t,error:n,inFlow:r,onAdd:i}){if(n!==null)return(0,$.jsxs)(`p`,{"data-slot":`wb-palette`,className:`mt-2.5 text-xs text-danger`,children:[`Could not load skills: `,n]});let a=t.trim().toLowerCase(),o=e.filter(e=>a===``||e.name.toLowerCase().includes(a)||(e.description??``).toLowerCase().includes(a));return(0,$.jsx)(`div`,{"data-slot":`wb-palette`,className:`mt-2.5 flex flex-col gap-1`,children:o.length>0?o.map(e=>(0,$.jsx)($r,{skill:e,inFlow:r.has(e.name),onAdd:i},e.path)):(0,$.jsx)(`p`,{className:`py-1 text-xs leading-relaxed text-soft-foreground`,children:e.length>0?`No skills match.`:(0,$.jsx)(ee,{})})})}function $r({skill:e,inFlow:t,onAdd:n}){let{attributes:r,listeners:a,setNodeRef:o,isDragging:s}=Wn({id:`palette:${e.name}`,data:{type:`palette`,skill:e.name}});return(0,$.jsxs)(`div`,{ref:o,"data-slot":`wb-skill`,"data-skill":e.name,title:e.description??``,className:x(`flex cursor-grab items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 shadow-xs transition-colors hover:bg-muted`,s&&`opacity-40`),...r,...a,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:x(`size-3.5 shrink-0`,de(e)?`text-violet`:`text-soft-foreground`)}),(0,$.jsx)(`span`,{className:x(`min-w-0 flex-1 truncate font-mono text-[13px]`,de(e)?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),t?(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):null,(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-skill-add`,"aria-label":`Add ${e.name} to the flow`,title:`Add to the flow`,onClick:()=>n(e.name),className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(N,{"aria-hidden":`true`,className:`size-3.5`})})]})}function ei({yaml:e}){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(null);return(0,P.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-copy`,title:`Copy the YAML`,onClick:()=>{navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1600)},className:`flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3 text-success`}),`Copied`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(C,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})})}export{qr as WorkflowsRoute};
11
+ - commit-style`,value:de,onChange:e=>j(e.target.value),className:`mt-2 min-h-28 font-mono text-xs`}),N===``?null:(0,$.jsx)(`p`,{"data-slot":`wb-import-error`,className:`mt-2 text-xs text-danger`,children:N}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsx)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-import-run`,disabled:Ce.isPending,onClick:Ne,children:`Import`}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import-cancel`,onClick:()=>{ae(!1),j(``),me(``)},children:`Cancel`})]})]}):null,(0,$.jsx)(Yr,{steps:W,skills:H,dragging:z!==null,overId:ye,activeStepId:z?.type===`step`?z.step.id:null,onRemove:e=>U(Lr(W,e))})]}),(0,$.jsxs)(`aside`,{"data-slot":`wb-aside`,className:`w-full shrink-0 md:w-[320px]`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Skills`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Drag into the flow. Order is execution order — the agent applies them top to bottom.`}),(0,$.jsx)(M,{"data-slot":`wb-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:C,onChange:e=>ee(e.target.value),className:`mt-2.5 h-8 text-[13px]`}),(0,$.jsx)(Qr,{skills:Se,query:C,error:n.isError?n.error.message:null,inFlow:new Set(W.map(e=>e.skill).filter(e=>!!e)),onAdd:e=>ke(e)}),(0,$.jsxs)(`div`,{className:`mt-5 flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`workflow.yaml`}),(0,$.jsx)(`span`,{className:`flex-1`}),(0,$.jsx)(ei,{yaml:K})]}),(0,$.jsx)(`pre`,{"data-slot":`wb-yaml`,className:`mt-2 overflow-x-auto rounded-lg border border-border bg-card p-3 font-mono text-[11.5px] leading-relaxed whitespace-pre text-muted-foreground shadow-xs`,children:K}),(0,$.jsx)(`p`,{className:`mt-2 text-[11.5px] leading-relaxed text-soft-foreground`,children:`Portable — export this file and import it in any repo running xezar.`})]})]}),(0,$.jsx)(or,{children:z?.type===`palette`?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[13px] font-medium shadow-md`,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 text-primary`}),z.skill]}):z?.type===`step`?(0,$.jsx)(Zr,{step:z.step,index:W.findIndex(e=>e.id===z.step.id),skills:H,overlay:!0}):null})]}),(0,$.jsx)(k,{open:R,onOpenChange:e=>!e&&ge(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-overwrite-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`“`,G,`” already exists`]}),(0,$.jsx)(E,{children:`Saving overwrites the existing workflow file. There is no undo.`})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep the file`}),(0,$.jsx)(D,{"data-slot":`wb-overwrite-confirm`,onClick:()=>Te.mutate(!0),children:`Overwrite`})]})]})}),(0,$.jsx)(k,{open:_e,onOpenChange:e=>!e&&ve(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-delete-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`Delete workflow “`,G,`”?`]}),(0,$.jsxs)(E,{children:[`Removes `,Oe?.path?.split(`/`).pop()??`the saved file`,` from`,` `,(0,$.jsx)(`span`,{className:`font-mono`,children:`.xezar/workflows/`}),`. There is no undo.`]})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep it`}),(0,$.jsx)(D,{"data-slot":`wb-delete-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>Ee.mutate(G),children:`Delete`})]})]})})]})}function Yr({steps:e,skills:t,dragging:n,overId:r,activeStepId:i,onRemove:a}){let{setNodeRef:o,isOver:s}=Jn({id:Wr}),c=n&&r===Wr;return(0,$.jsx)(`div`,{ref:o,"data-slot":`wb-steps`,"data-dragging":n||void 0,className:x(`mt-4 rounded-lg border border-dashed p-2 transition-colors`,s?`border-primary/60 bg-primary/5`:`border-muted-foreground/25`),children:e.length===0?(0,$.jsx)(`p`,{className:x(`rounded-md px-3 py-10 text-center text-[13px] transition-colors`,s?`text-primary`:`text-muted-foreground`),children:`Drop a skill here — or Import a workflow.yaml`}):(0,$.jsxs)(vr,{items:e.map(e=>e.id),strategy:mr,children:[(0,$.jsx)(`ol`,{className:`flex flex-col gap-2.5`,children:e.map((e,o)=>(0,$.jsx)(Xr,{step:e,index:o,skills:t,connector:o>0,dragging:n,insertBefore:n&&r===e.id&&i!==e.id,onRemove:()=>a(o)},e.id))}),(0,$.jsx)(`div`,{"aria-hidden":`true`,className:x(`mx-1 mt-2.5 h-[3px] rounded-full transition-colors`,c?`bg-primary`:`bg-transparent`)}),(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 pt-1.5 pb-1 text-[11px] text-muted-foreground`,children:[(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`runs top to bottom`]})]})})}function Xr({step:e,index:t,skills:n,connector:r,dragging:i,insertBefore:a,onRemove:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:f}=Er({id:e.id,data:{type:`step`,step:e}});return(0,$.jsxs)(`li`,{ref:l,style:{transform:K.Transform.toString(u),transition:d},className:x(`relative`,f&&`opacity-40`),children:[r&&!i?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute -top-[11px] left-1/2 h-[9px] w-px -translate-x-1/2 bg-muted-foreground/30`}):null,a?(0,$.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`wb-drop-line`,className:`pointer-events-none absolute -top-[7px] right-0 left-0 h-[3px] rounded-full bg-primary`}):null,(0,$.jsx)(Zr,{step:e,index:t,skills:n,onRemove:o,gripProps:{...s,...c}})]})}function Zr({step:e,index:t,skills:n,onRemove:r,gripProps:i,overlay:a=!1}){let o=n.find(t=>t.name===e.skill),s=!!e.command,c=s||!e.skill?e.name??e.id:e.skill,l=s?`$ ${e.command}${e.onFail?` — on fail retry from "${e.onFail.retry}" (×${e.onFail.max??2})`:``}`:e.skill?o?.description??`Not in this repo or the team skills — the step runs on its plain prompt.`:e.prompt??``,u=s?`check`:e.skill?o?null:`unknown`:`prompt`;return(0,$.jsxs)(`div`,{"data-slot":`wb-step`,"data-id":e.id,"data-index":t,className:x(`flex items-center gap-2.5 rounded-md border border-muted-foreground/20 bg-card-2 px-2.5 py-2 shadow-xs`,a&&`shadow-md`),children:[(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-grip`,"aria-label":`Reorder step ${t+1}: ${c}`,className:`shrink-0 cursor-grab rounded text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,...i,children:(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-3.5`})}),(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:String(t+1).padStart(2,`0`)}),s?(0,$.jsx)(ne,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-mono text-[13px] font-medium`,children:c}),l?(0,$.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:l}):null]}),u?(0,$.jsx)(`span`,{"data-slot":`wb-step-badge`,className:x(`shrink-0 rounded-full border px-2 py-px font-mono text-[10.5px]`,u===`check`&&`border-success/30 text-success`,u===`unknown`&&`border-danger/35 text-danger`,u===`prompt`&&`border-border text-soft-foreground`),children:u}):null,r?(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-remove`,"aria-label":`Remove step ${t+1}: ${c}`,title:`Remove from flow`,onClick:r,className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-danger focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function Qr({skills:e,query:t,error:n,inFlow:r,onAdd:i}){if(n!==null)return(0,$.jsxs)(`p`,{"data-slot":`wb-palette`,className:`mt-2.5 text-xs text-danger`,children:[`Could not load skills: `,n]});let a=t.trim().toLowerCase(),o=e.filter(e=>a===``||e.name.toLowerCase().includes(a)||(e.description??``).toLowerCase().includes(a));return(0,$.jsx)(`div`,{"data-slot":`wb-palette`,className:`mt-2.5 flex flex-col gap-1`,children:o.length>0?o.map(e=>(0,$.jsx)($r,{skill:e,inFlow:r.has(e.name),onAdd:i},e.path)):(0,$.jsx)(`p`,{className:`py-1 text-xs leading-relaxed text-soft-foreground`,children:e.length>0?`No skills match.`:(0,$.jsx)(ee,{})})})}function $r({skill:e,inFlow:t,onAdd:n}){let{attributes:r,listeners:a,setNodeRef:o,isDragging:s}=Wn({id:`palette:${e.name}`,data:{type:`palette`,skill:e.name}});return(0,$.jsxs)(`div`,{ref:o,"data-slot":`wb-skill`,"data-skill":e.name,title:e.description??``,className:x(`flex cursor-grab items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 shadow-xs transition-colors hover:bg-muted`,s&&`opacity-40`),...r,...a,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:x(`size-3.5 shrink-0`,de(e)?`text-violet`:`text-soft-foreground`)}),(0,$.jsx)(`span`,{className:x(`min-w-0 flex-1 truncate font-mono text-[13px]`,de(e)?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),t?(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):null,(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-skill-add`,"aria-label":`Add ${e.name} to the flow`,title:`Add to the flow`,onClick:()=>n(e.name),className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(N,{"aria-hidden":`true`,className:`size-3.5`})})]})}function ei({yaml:e}){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(null);return(0,P.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-copy`,title:`Copy the YAML`,onClick:()=>{navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1600)},className:`flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3 text-success`}),`Copied`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(C,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})})}export{qr as WorkflowsRoute};
@@ -43,7 +43,7 @@
43
43
  }
44
44
  })()
45
45
  </script>
46
- <script type="module" crossorigin src="/assets/index-DlC81_GI.js"></script>
46
+ <script type="module" crossorigin src="/assets/index-GflrFgEB.js"></script>
47
47
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
48
48
  <link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
49
49
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-BT31bpU6.js">
@@ -1 +0,0 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t}from"./utils-Bb8ohcr3.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/xezar/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};