@mrpatronz/nexusflow 2.20.0 → 2.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gui/assets/AgentsPage-BKwrbZTW.js +3 -0
- package/dist/gui/assets/DashboardPage-B5DuTyhZ.js +1 -0
- package/dist/gui/assets/{DocumentPreview-B1-9LSiH.js → DocumentPreview-Os281E1X.js} +1 -1
- package/dist/gui/assets/{GettingStartedPage-KkTgBu7C.js → GettingStartedPage-bcbneczR.js} +1 -1
- package/dist/gui/assets/MonacoDiffAdapter-D1wWcPlt.js +1 -0
- package/dist/gui/assets/ProjectsPage-CIEM54GU.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-DoqywP_g.js +1 -0
- package/dist/gui/assets/SettingsPage-sCzTlpxr.js +1 -0
- package/dist/gui/assets/SkillsPage-CoMf5sLE.js +7 -0
- package/dist/gui/assets/StartWorkPage-CVnUwx7O.js +1 -0
- package/dist/gui/assets/StrategiesPage-UIiETHGq.js +3 -0
- package/dist/gui/assets/WorkroomsPage-BTcKu4E8.js +4 -0
- package/dist/gui/assets/WorkspacesPage-2tYcZu28.js +17 -0
- package/dist/gui/assets/alert-dialog-CdWem4Th.js +1 -0
- package/dist/gui/assets/badge-DQIZRRDZ.js +1 -0
- package/dist/gui/assets/bot-D5yM1Tw6.js +1 -0
- package/dist/gui/assets/{brand-hHByyyzq.js → brand-Bj6g9sFF.js} +1 -1
- package/dist/gui/assets/{client-B5szthbF.js → client-CQ3EdyuW.js} +1 -1
- package/dist/gui/assets/cpu-Y6k3dlHb.js +1 -0
- package/dist/gui/assets/empty-DK2eW2rF.js +1 -0
- package/dist/gui/assets/index-qvc4aLwP.js +75 -0
- package/dist/gui/assets/index-zHrkxd7h.css +2 -0
- package/dist/gui/assets/input-LtE7Sz4D.js +1 -0
- package/dist/gui/assets/isElementDisabled-Cpw8EvLX.js +1 -0
- package/dist/gui/assets/{queries-DYi6drfC.js → queries-CtxmqmGJ.js} +1 -1
- package/dist/gui/assets/tabs-7VC4aq4J.js +1 -0
- package/dist/gui/assets/textarea-0lXkxsuX.js +1 -0
- package/dist/gui/assets/{useAriaLabelledBy-DAWGcnTk.js → useAriaLabelledBy-BAD_HQgN.js} +1 -1
- package/dist/gui/assets/useValueChanged-DcnEcpiS.js +1 -0
- package/dist/gui/index.html +8 -8
- package/dist/terminal/manager.d.ts +1 -0
- package/dist/terminal/manager.d.ts.map +1 -1
- package/dist/terminal/manager.js +4 -3
- package/dist/terminal/manager.js.map +1 -1
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +49 -1
- package/dist/utils/session-finder.js.map +1 -1
- package/package.json +1 -1
- package/dist/gui/assets/AgentsPage-DsJ8dxJG.js +0 -3
- package/dist/gui/assets/DashboardPage-CtJnqdvu.js +0 -1
- package/dist/gui/assets/MonacoDiffAdapter-CsyKXuq8.js +0 -1
- package/dist/gui/assets/ProjectsPage-Dsl46Cx5.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-BZBzfuYr.js +0 -1
- package/dist/gui/assets/SettingsPage-BYuNRM43.js +0 -1
- package/dist/gui/assets/SkillsPage-BmsLo_kt.js +0 -7
- package/dist/gui/assets/StartWorkPage-CY9s8_zb.js +0 -1
- package/dist/gui/assets/StrategiesPage-Bd9vJ5ml.js +0 -3
- package/dist/gui/assets/WorkroomsPage-Yoy1dJFI.js +0 -4
- package/dist/gui/assets/WorkspacesPage-CpZsBgiV.js +0 -13
- package/dist/gui/assets/alert-dialog-D24plC11.js +0 -1
- package/dist/gui/assets/badge-BObbahyU.js +0 -1
- package/dist/gui/assets/index-B5-rK_Uq.css +0 -2
- package/dist/gui/assets/index-CxyTuBKc.js +0 -80
- package/dist/gui/assets/isElementDisabled-BONWqXlb.js +0 -1
- package/dist/gui/assets/tabs--FCq-tVR.js +0 -1
- package/dist/gui/assets/useValueChanged-DfJmRF2P.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{t as r}from"./input-LtE7Sz4D.js";import{$ as ee,B as te,G as ne,T as re,et as ie,g as ae,l as oe,r as i,t as a,z as se}from"./queries-CtxmqmGJ.js";import{h as o,m as s,t as c}from"./button-BrcP8Wxx.js";import{t as l}from"./bot-D5yM1Tw6.js";import{t as ce}from"./trash-2-BrrLX4tD.js";import{C as u,D as d,Dt as le,Kt as ue,O as f,S as p,T as m,Tt as h,w as g,x as de}from"./index-qvc4aLwP.js";import{a as fe,i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./alert-dialog-CdWem4Th.js";import{t as _}from"./badge-DQIZRRDZ.js";import{t as ye}from"./card-BMggHY3n.js";import{a as v,i as be,n as y,r as b,t as x}from"./empty-DK2eW2rF.js";import{t as S}from"./label-C610MHwq.js";import{t as C}from"./textarea-0lXkxsuX.js";var xe=o(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),w=e(t(),1),T=n(),E={id:``,name:``,category:`general`,description:``,developerInstructions:``};function D(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function O({showToast:e}){let[t,n]=(0,w.useState)(`global`),[o,O]=(0,w.useState)(``),[Se,k]=(0,w.useState)(!1),[A,j]=(0,w.useState)(!1),[M,N]=(0,w.useState)(null),[P,F]=(0,w.useState)(E),[I,L]=(0,w.useState)(``),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(null),{data:H=[],isLoading:Ce,isError:we}=a(),{data:U=[]}=te(),W=se(t===`global`?``:t),G=re(),K=ae(),q=oe(),J=i(),Y=t!==`global`,Te=U.find(e=>e.id===t),X=!Y||Te?.assistants?.includes(`codex`),Z=Y&&X&&!W.isLoading&&!W.isError&&!!W.data;(0,w.useEffect)(()=>{if(!Y){z(null);return}W.data&&z([...W.data.enabledAgents??[]])},[Y,t,W.data]);let Q=(0,w.useMemo)(()=>{let e=o.trim().toLowerCase();return e?H.filter(t=>[t.name,t.description,t.category].some(t=>t.toLowerCase().includes(e))):H},[H,o]),Ee=new Set(R??W.data?.enabledAgents??[]);function $(){N(null),F(E),k(!0)}function De(e){N(e.id),F({id:e.id,name:e.name,category:e.category,description:e.description,developerInstructions:e.developerInstructions,model:e.model,modelReasoningEffort:e.modelReasoningEffort,sandboxMode:e.sandboxMode}),k(!0)}async function Oe(){try{let t=M??D(P.name);await G.mutateAsync({...P,id:t,name:t}),k(!1),e?.(`Codex agent saved`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent`,`error`)}}async function ke(){try{await K.mutateAsync({toml:I,category:`general`}),j(!1),L(``),e?.(`Codex agent imported`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to import agent`,`error`)}}async function Ae(){if(B)try{await q.mutateAsync(B.id),V(null),e?.(`Agent deleted from the personal catalog`,`info`)}catch(t){e?.(t instanceof Error?t.message:`Failed to delete agent`,`error`)}}function je(e){if(!Z||R===null)return;let t=new Set(R);t.has(e)?t.delete(e):t.add(e),z([...t])}async function Me(){if(!(!W.data||R===null))try{await J.mutateAsync({workspaceId:t,expectedRevision:W.data.revision??0,enabledSkills:W.data.enabledSkills,enabledAgents:R,enabledCategories:W.data.enabledCategories??[]}),e?.(`Agent selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent selection`,`error`)}}return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,T.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-4 border-b border-border px-6 py-5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`rounded-lg bg-primary/10 p-2 text-primary`,children:(0,T.jsx)(l,{className:`h-5 w-5`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Codex Agent Library`}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create and reuse project-scoped Codex custom agents.`})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(c,{render:(0,T.jsx)(ne,{to:`/skills`}),variant:`outline`,size:`sm`,children:`Skills`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-1.5`,children:[(0,T.jsx)(ie,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(S,{htmlFor:`agent-scope`,className:`text-xs text-muted-foreground`,children:`Scope`}),(0,T.jsxs)(`select`,{id:`agent-scope`,value:t,onChange:e=>n(e.target.value),className:`cursor-pointer bg-transparent text-xs font-semibold text-foreground focus:outline-none`,children:[(0,T.jsx)(`option`,{value:`global`,children:`Personal catalog`}),U.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),Y?(0,T.jsx)(c,{size:`sm`,onClick:Me,disabled:!Z||J.isPending,children:J.isPending?`Saving…`:`Save selection`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(c,{variant:`outline`,size:`sm`,onClick:()=>j(!0),children:[(0,T.jsx)(xe,{className:`mr-1.5 h-4 w-4`}),`Import TOML`]}),(0,T.jsxs)(c,{size:`sm`,onClick:$,children:[(0,T.jsx)(h,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]})]})]}),(0,T.jsx)(`div`,{className:`border-b border-border/60 bg-muted/20 px-6 py-3`,children:(0,T.jsxs)(`div`,{className:`relative max-w-md`,children:[(0,T.jsx)(ee,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(r,{value:o,onChange:e=>O(e.target.value),placeholder:`Search agents…`,className:`pl-9`})]})}),(0,T.jsx)(`main`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:Ce||Y&&W.isLoading?(0,T.jsx)(`div`,{className:`flex justify-center p-12`,children:(0,T.jsx)(de,{})}):we||Y&&W.isError?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Resources could not be loaded`}),(0,T.jsx)(y,{children:`Assignment controls remain disabled to protect the saved selection.`})]})}):Y&&!X?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Codex is not enabled for this workspace`}),(0,T.jsx)(y,{children:`Add Codex to the workspace before assigning Codex-native agents.`})]})}):Q.length===0?(0,T.jsxs)(x,{className:`border border-dashed py-12`,children:[(0,T.jsx)(be,{children:(0,T.jsx)(l,{className:`h-8 w-8 text-muted-foreground`})}),(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`No Codex agents found`}),(0,T.jsx)(y,{children:`Create an agent or import a native TOML definition.`})]}),!Y&&(0,T.jsxs)(c,{size:`sm`,onClick:$,children:[(0,T.jsx)(h,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]}):(0,T.jsx)(`div`,{className:`mx-auto grid max-w-6xl grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:Q.map(e=>{let t=Ee.has(e.id);return(0,T.jsxs)(ye,{className:s(`flex flex-col gap-4 p-4`,Y&&!t&&`opacity-60`),children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`h2`,{className:`font-semibold`,children:e.name}),(0,T.jsx)(_,{variant:`outline`,children:`Codex`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.description})]}),Y?(0,T.jsxs)(c,{variant:t?`default`:`outline`,size:`sm`,onClick:()=>je(e.id),disabled:!Z,children:[(0,T.jsx)(ue,{className:s(`mr-1 h-3.5 w-3.5`,!t&&`opacity-0`)}),t?`Enabled`:`Disabled`]}):(0,T.jsxs)(`div`,{className:`flex gap-1`,children:[(0,T.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":`Edit ${e.name}`,onClick:()=>De(e),children:(0,T.jsx)(le,{className:`h-4 w-4`})}),(0,T.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":`Delete ${e.name}`,onClick:()=>V(e),children:(0,T.jsx)(ce,{className:`h-4 w-4`})})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[e.sandboxMode&&(0,T.jsx)(_,{variant:`secondary`,children:e.sandboxMode}),e.modelReasoningEffort&&(0,T.jsx)(_,{variant:`secondary`,children:e.modelReasoningEffort}),e.model&&(0,T.jsx)(_,{variant:`secondary`,children:e.model})]})]},e.id)})})}),(0,T.jsx)(p,{open:Se,onOpenChange:k,children:(0,T.jsxs)(d,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(f,{children:M?`Edit Codex agent`:`Create Codex agent`}),(0,T.jsx)(u,{children:`Only the current stable native fields are managed. Omitted settings inherit from Codex.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-name`,children:`Name`}),(0,T.jsx)(r,{id:`agent-name`,value:P.name,disabled:!!M,onChange:e=>F({...P,name:D(e.target.value)}),placeholder:`code-reviewer`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-description`,children:`Description`}),(0,T.jsx)(r,{id:`agent-description`,value:P.description,onChange:e=>F({...P,description:e.target.value}),placeholder:`Use when reviewing a fixed diff for correctness and security.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-instructions`,children:`Developer instructions`}),(0,T.jsx)(C,{id:`agent-instructions`,value:P.developerInstructions,onChange:e=>F({...P,developerInstructions:e.target.value}),className:`min-h-48 font-mono`})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-model`,children:`Model override`}),(0,T.jsx)(r,{id:`agent-model`,value:P.model??``,onChange:e=>F({...P,model:e.target.value||void 0}),placeholder:`Inherit`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-effort`,children:`Reasoning`}),(0,T.jsxs)(`select`,{id:`agent-effort`,value:P.modelReasoningEffort??``,onChange:e=>F({...P,modelReasoningEffort:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`low`,children:`Low`}),(0,T.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,T.jsx)(`option`,{value:`high`,children:`High`}),(0,T.jsx)(`option`,{value:`xhigh`,children:`XHigh`}),(0,T.jsx)(`option`,{value:`max`,children:`Max`}),(0,T.jsx)(`option`,{value:`ultra`,children:`Ultra`})]})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-sandbox`,children:`Sandbox`}),(0,T.jsxs)(`select`,{id:`agent-sandbox`,value:P.sandboxMode??``,onChange:e=>F({...P,sandboxMode:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`read-only`,children:`Read only`}),(0,T.jsx)(`option`,{value:`workspace-write`,children:`Workspace write`})]})]})]})]}),(0,T.jsxs)(g,{children:[(0,T.jsx)(c,{variant:`outline`,onClick:()=>k(!1),children:`Cancel`}),(0,T.jsx)(c,{onClick:Oe,disabled:G.isPending||!P.name||!P.description||!P.developerInstructions,children:G.isPending?`Saving…`:`Save agent`})]})]})}),(0,T.jsx)(p,{open:A,onOpenChange:j,children:(0,T.jsxs)(d,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(f,{children:`Import Codex agent TOML`}),(0,T.jsx)(u,{children:`The import accepts the required native fields and supported model, reasoning, and sandbox overrides.`})]}),(0,T.jsx)(C,{value:I,onChange:e=>L(e.target.value),className:`min-h-72 font-mono`,placeholder:`name = "reviewer"
|
|
2
|
+
description = "Use for code review."
|
|
3
|
+
developer_instructions = "Review the fixed diff."`}),(0,T.jsxs)(g,{children:[(0,T.jsx)(c,{variant:`outline`,onClick:()=>j(!1),children:`Cancel`}),(0,T.jsx)(c,{onClick:ke,disabled:K.isPending||!I.trim(),children:K.isPending?`Importing…`:`Import agent`})]})]})}),(0,T.jsx)(ve,{open:B!==null,onOpenChange:e=>!e&&V(null),children:(0,T.jsxs)(he,{children:[(0,T.jsxs)(fe,{children:[(0,T.jsxs)(_e,{children:[`Delete “`,B?.name,`”?`]}),(0,T.jsx)(ge,{children:`This removes the agent from the personal catalog. Existing workspace copies remain until the workspace is refreshed.`})]}),(0,T.jsxs)(pe,{children:[(0,T.jsx)(me,{render:(0,T.jsx)(c,{variant:`outline`,children:`Cancel`})}),(0,T.jsx)(c,{variant:`destructive`,onClick:Ae,disabled:q.isPending,children:q.isPending?`Deleting…`:`Delete agent`})]})]})})]})}export{O as AgentsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{$ as r,F as i,U as a,Z as o,_ as ee,et as s,n as c}from"./queries-CtxmqmGJ.js";import{h as l,m as u,t as d}from"./button-BrcP8Wxx.js";import{a as f,g as p,i as m,m as h,n as g,r as te,s as _}from"./status-CKOvrZ16.js";import{t as ne}from"./brand-Bj6g9sFF.js";import{n as re}from"./client-CQ3EdyuW.js";import{Ft as v,Qt as y,Tt as b,Vt as x,Xt as S,b as C,qt as w,vt as T,x as E,xt as D,z as O}from"./index-qvc4aLwP.js";import{t as k}from"./card-BMggHY3n.js";import{a as ie,i as A,n as j,r as M,t as N}from"./empty-DK2eW2rF.js";var ae=l(`file-diff`,[[`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:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),P=e(t(),1),F=n(),oe=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,F.jsx)(m,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!1,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,F.jsx)(T,{size:12})},{id:`antigravity-ide`,label:`Antigravity IDE Workspace`,shortLabel:`IDE`,type:`editor`,targetId:`antigravity`,isAvailable:t.find(e=>e.id===`antigravity`)?.available??!1,unavailableReason:`Antigravity IDE not installed`,icon:(0,F.jsx)(x,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,F.jsx)(f,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`claude-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`claude`,isAvailable:e.claude??!1,unavailableReason:`CLI "claude" not found on PATH`,icon:(0,F.jsx)(T,{size:12})},{id:`claude-desktop`,label:`Claude Desktop App`,shortLabel:`App`,type:`app`,targetId:`claude-desktop`,isAvailable:t.find(e=>e.id===`claude-desktop`)?.available??!1,unavailableReason:`Claude Desktop not detected`,icon:(0,F.jsx)(p,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,F.jsx)(h,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`codex-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`codex`,isAvailable:e.codex??!1,unavailableReason:`CLI "codex" not found on PATH`,icon:(0,F.jsx)(T,{size:12})},{id:`codex-desktop`,label:`Codex Desktop App`,shortLabel:`App`,type:`app`,targetId:`codex-desktop`,isAvailable:t.find(e=>e.id===`codex-desktop`)?.available??!1,unavailableReason:`Codex Desktop not detected`,icon:(0,F.jsx)(p,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white shadow-2xs`,children:(0,F.jsx)(_,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`copilot-cli`,label:`Copilot CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`copilot`,isAvailable:e.copilot??!1,icon:(0,F.jsx)(T,{size:12})},{id:`copilot-vscode`,label:`VS Code with Copilot`,shortLabel:`VS Code`,type:`editor`,targetId:`vscode`,isAvailable:t.find(e=>e.id===`vscode`)?.available??!1,unavailableReason:`VS Code not detected`,icon:(0,F.jsx)(x,{size:12})}]}];function I({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:l,onNewWorkspace:f,showToast:p}){let m=c(),h=i(),_=ee(),{openCli:x}=a(),[I,L]=(0,P.useState)(``),[R,z]=(0,P.useState)(!1),[B,V]=(0,P.useState)(``),H=e.find(e=>e.branchName===B)??e[0],U=e.filter(e=>`${e.branchName} ${e.description??``} ${e.repos.join(` `)}`.toLowerCase().includes(I.trim().toLowerCase())&&(!R||(t[e.branchName]?.changedFiles??0)>0)),[W,G]=(0,P.useState)(null),K=e.flatMap(e=>t[e.branchName]?[t[e.branchName]]:[]),q=K.reduce((e,t)=>e+(t.changedFiles||0),0),se=K.filter(e=>e.changedFiles>0).length,ce=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,le=e.filter(e=>e.mode===`in-place`).length,J=(0,P.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=g(e),r=t.get(e);r?r.count+=1:t.set(e,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Y=(0,P.useMemo)(()=>{let e={};return(m.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[m.data]),X=(0,P.useMemo)(()=>h.data??[],[h.data]),Z=(0,P.useMemo)(()=>oe.map(e=>{let t=e.getOptions({aiDetected:Y,launchTargets:X}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Y,X]),ue=async(e,t)=>{if(W)return;let n=H;if(!n){p?.(`No active workspace available to launch harness in.`,`error`);return}let r=`${e.id}:${t.id}`;G(r);try{t.type===`cli`?(await _.mutateAsync({workspaceId:n.branchName,assistant:e.id,command:t.command}),p?.(`Opened ${e.name} inside ContextSpace for ${n.branchName}`,`success`)):t.targetId&&(await re(`/api/workspace/${encodeURIComponent(n.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.targetId})}),p?.(`Opened ${n.branchName} in ${e.name} (${t.label})`,`success`))}catch(t){p?.(`Failed to launch ${e.name}: ${t instanceof Error?t.message:String(t)}`,`error`)}finally{G(null)}},Q=o(),{customTitles:$}=O();return(0,F.jsxs)(`div`,{className:`mx-auto max-w-7xl space-y-6 pb-12 animate-fade-in`,children:[(0,F.jsxs)(`header`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-border/80 pb-4`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono text-muted-foreground mb-1`,children:[(0,F.jsx)(y,{size:14,className:`text-primary`}),(0,F.jsx)(`span`,{children:ne}),(0,F.jsx)(`span`,{className:`opacity-40`,children:`/`}),(0,F.jsx)(`span`,{className:`text-foreground font-semibold`,children:`Cockpit Overview`})]}),(0,F.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Multi-Worktree Process & Review Station`})]}),(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(d,{onClick:f,size:`sm`,className:`h-8 gap-1.5 px-3.5 bg-primary text-primary-foreground font-semibold hover:bg-primary/90 shadow-xs cursor-pointer text-xs`,children:[(0,F.jsx)(b,{size:14}),` New Worktree`]})})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[{label:`Active Worktrees`,value:n?`—`:e.length,detail:`${ce} isolated · ${le} host`,icon:s},{label:`Review Queue`,value:K.length?q:`—`,detail:`${se} worktrees with diffs`,icon:v,isDirty:q>0},{label:`Tracked Repos`,value:n?`—`:J.length,detail:`Connected on local host`,icon:w},{label:`AI Assistants`,value:m.isLoading||h.isLoading?`—`:Z.filter(e=>e.isAnyAvailable).length,detail:`Antigravity, Claude, Codex`,icon:D}].map(({label:e,value:t,detail:n,icon:r,isDirty:i})=>(0,F.jsxs)(k,{className:`bg-card border border-border p-3.5 rounded-xl shadow-xs transition-colors hover:border-border/80`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e}),(0,F.jsx)(r,{size:14,className:i?`text-amber-400`:`text-primary`})]}),(0,F.jsx)(`div`,{className:u(`my-1.5 text-2xl font-bold tracking-tight tabular-nums`,i?`text-amber-400`:`text-foreground`),children:t}),(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground font-mono`,children:n})]},e))}),(0,F.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,F.jsxs)(`section`,{className:`min-w-0`,"aria-labelledby":`workspaces-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsxs)(`span`,{id:`workspaces-heading`,className:`text-sm font-bold text-foreground`,children:[`Workspaces (`,U.length,`)`]})}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(r,{size:13,className:`absolute left-2.5 top-2.5 text-muted-foreground pointer-events-none`}),(0,F.jsx)(`input`,{"aria-label":`Search workspaces`,value:I,onChange:e=>L(e.target.value),placeholder:`Filter worktrees or repos…`,className:`h-8 w-48 sm:w-64 rounded-lg border border-input bg-card pl-8 pr-3 text-xs outline-none focus:border-primary transition-colors text-foreground`})]}),(0,F.jsxs)(d,{variant:R?`secondary`:`outline`,size:`xs`,className:`h-8 rounded-lg text-xs font-medium cursor-pointer`,"aria-pressed":R,onClick:()=>z(!R),children:[(0,F.jsx)(v,{size:13}),` Diffs only`]})]})]}),n?(0,F.jsx)(k,{className:`p-10 border border-border bg-card`,children:(0,F.jsx)(E,{"aria-label":`Loading workspaces`,className:`mx-auto size-5 text-primary`})}):e.length?U.length?(0,F.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:U.map(e=>{let n=t[e.branchName],r=e.mode===`in-place`||!n?null:te(n.syncStatus),i=(n?.changedFiles??0)>0,a=$[e.branchName]?.title||e.description||e.branchName,o=!!$[e.branchName]?.title;return(0,F.jsxs)(`div`,{className:`group rounded-xl border border-border bg-card p-4 transition-all hover:border-primary/50 flex flex-col justify-between gap-3 shadow-xs`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-1.5`,children:[(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h3`,{className:`font-bold text-sm text-foreground truncate cursor-pointer hover:text-primary transition-colors`,onClick:()=>l(e.branchName),title:a,children:a})}),(0,F.jsx)(`span`,{className:u(`shrink-0 px-2 py-0.5 rounded text-[10px] font-mono font-semibold uppercase tracking-wider border`,e.mode===`in-place`?`border-border bg-secondary text-muted-foreground`:`border-emerald-500/25 bg-emerald-500/10 text-emerald-400`),children:e.mode===`in-place`?`in-place`:`isolated`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground truncate mb-2`,children:[(0,F.jsx)(v,{size:12,className:`text-primary shrink-0`}),(0,F.jsx)(`span`,{className:`truncate font-semibold text-foreground/80`,children:e.branchName}),o&&e.description&&(0,F.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/70 truncate`,children:[`(`,e.description,`)`]})]}),(0,F.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-2.5`,children:e.repos.map(e=>(0,F.jsx)(`span`,{className:`rounded border border-border/60 bg-secondary/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:g(e)},e))}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-mono`,children:[i?(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-amber-400 font-semibold`,children:[(0,F.jsx)(`span`,{className:`size-2 rounded-full bg-amber-400 animate-pulse shrink-0`}),n?.changedFiles,` modified files`]}):(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-emerald-400 font-medium`,children:[(0,F.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-400 shrink-0`}),`Clean worktree`]}),r&&(0,F.jsxs)(`span`,{className:`text-muted-foreground text-[10px]`,children:[`• `,r.label]})]})]}),(0,F.jsxs)(`div`,{className:`border-t border-border/70 pt-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,F.jsxs)(d,{size:`xs`,variant:`secondary`,onClick:()=>x(e.branchName),className:`h-7 gap-1 px-2.5 text-xs font-semibold cursor-pointer`,"aria-label":`Open CLI chat for ${e.branchName}`,children:[(0,F.jsx)(T,{size:12}),` CLI chat`]}),i&&(0,F.jsxs)(d,{size:`xs`,onClick:()=>Q(`/workspaces/${encodeURIComponent(e.branchName)}/changes`),className:`h-7 gap-1 px-2.5 bg-primary text-primary-foreground font-semibold text-xs hover:bg-primary/90 cursor-pointer`,title:`Open Monaco Diff Review`,children:[(0,F.jsx)(ae,{size:12}),` Review Diffs`]}),(0,F.jsx)(d,{size:`xs`,variant:`outline`,onClick:()=>l(e.branchName),className:`h-7 text-xs border-border hover:bg-accent cursor-pointer`,children:`Cockpit`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>Q(`/workspaces/${encodeURIComponent(e.branchName)}/plan`),className:`text-[11px] text-muted-foreground hover:text-primary transition-colors flex items-center gap-1 cursor-pointer`,children:[`Plan `,(0,F.jsx)(S,{size:11})]})]})]},e.id)})}):(0,F.jsxs)(k,{className:`rounded-xl border border-border bg-card p-8 text-center`,children:[(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No worktrees match your filter.`}),(0,F.jsx)(d,{variant:`ghost`,size:`xs`,className:`mt-2`,onClick:()=>{L(``),z(!1)},children:`Clear filter`})]}):(0,F.jsx)(k,{className:`rounded-xl border border-dashed border-border bg-card/50 p-8`,children:(0,F.jsxs)(N,{children:[(0,F.jsxs)(M,{children:[(0,F.jsx)(A,{variant:`icon`,children:(0,F.jsx)(s,{})}),(0,F.jsx)(ie,{children:`No active worktrees`}),(0,F.jsx)(j,{children:`Create a worktree to start working on isolated features with dynamic plan steps.`})]}),(0,F.jsxs)(d,{onClick:f,className:`mt-4 bg-primary text-primary-foreground`,children:[(0,F.jsx)(b,{size:14}),` Create First Worktree`]})]})})]}),(0,F.jsxs)(`aside`,{className:`rounded-xl border border-border bg-card p-4 shadow-xs`,"aria-labelledby":`assistants-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] font-mono font-bold uppercase tracking-wider text-primary mb-1`,children:[(0,F.jsx)(D,{size:12}),` AI Launch Station`]}),(0,F.jsx)(`h2`,{id:`assistants-heading`,className:`text-sm font-bold tracking-tight text-foreground`,children:`External Coding Harnesses`}),(0,F.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Launch agents directly into the target worktree.`})]}),(0,F.jsx)(`label`,{className:`block text-[10px] font-mono uppercase font-bold text-muted-foreground mb-1.5`,htmlFor:`launch-workspace`,children:`Target Worktree`}),(0,F.jsxs)(`select`,{id:`launch-workspace`,value:H?.branchName??``,onChange:e=>V(e.target.value),disabled:!e.length||!!W,className:`mb-4 h-8 w-full rounded-md border border-input bg-secondary px-2 font-mono text-xs text-foreground focus-visible:outline-ring`,children:[!e.length&&(0,F.jsx)(`option`,{value:``,children:`Create a workspace first`}),e.map(e=>(0,F.jsx)(`option`,{value:e.branchName,children:$[e.branchName]?.title?`${$[e.branchName]?.title} (${e.branchName})`:e.branchName},e.id))]}),(0,F.jsx)(`div`,{className:`divide-y divide-border/60`,children:Z.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:r})=>(0,F.jsxs)(`div`,{className:`py-3 first:pt-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.icon,(0,F.jsx)(`h3`,{className:`text-xs font-semibold text-foreground`,children:e.name})]}),(0,F.jsx)(C,{tone:r,children:m.isLoading||h.isLoading?`Checking`:m.isError||h.isError?`Check failed`:n?`Ready`:`Not detected`})]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.map(t=>(0,F.jsxs)(d,{variant:`outline`,size:`xs`,disabled:!!W||!H,onClick:()=>void ue(e,t),title:`Launch ${e.name} in ${H?.branchName??`workspace`}`,className:`h-7 text-xs border-border hover:bg-accent cursor-pointer`,children:[W===`${e.id}:${t.id}`?(0,F.jsx)(E,{className:`size-3`}):t.icon,t.shortLabel,(0,F.jsx)(S,{size:10})]},t.id))})]},e.id))})]})]}),J.length>0&&(0,F.jsxs)(`section`,{className:`border-t border-border pt-4`,children:[(0,F.jsxs)(`div`,{className:`mb-2.5 flex items-center gap-2 text-xs font-mono font-medium text-muted-foreground`,children:[(0,F.jsx)(w,{size:13,className:`text-primary`}),` Tracked Repositories`]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:J.map(e=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{L(e.path),z(!1)},title:e.path,className:`flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-1.5 font-mono text-xs transition-colors hover:border-primary/50 text-foreground cursor-pointer`,children:[(0,F.jsx)(s,{size:12,className:`text-primary`}),(0,F.jsx)(`span`,{children:e.name}),(0,F.jsxs)(`span`,{className:`rounded bg-secondary px-1.5 py-0.2 text-[10px] text-muted-foreground`,children:[e.count,` `,e.count===1?`worktree`:`worktrees`]})]},e.path))})]})]})}export{I as DashboardPage};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{n,t as r}from"./jsx-runtime-DE3RlOCf.js";import{
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{n,t as r}from"./jsx-runtime-DE3RlOCf.js";import{k as i}from"./index-qvc4aLwP.js";var a=t(n(),1);function o(e,t){this.v=e,this.k=t}function s(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){if(Array.isArray(e))return e}function l(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function u(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(e,t){return c(e)||l(e,t)||f(e,t)||u()}function f(e,t){if(e){if(typeof e==`string`)return s(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function p(e){var t,n;function r(t,n){try{var a=e[t](n),s=a.value,c=s instanceof o;Promise.resolve(c?s.v:s).then(function(n){if(c){var o=t===`return`&&s.k?t:`next`;if(!s.k||n.done)return r(o,n);n=e[o](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}p.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},p.prototype.next=function(e){return this._invoke(`next`,e)},p.prototype.throw=function(e){return this._invoke(`throw`,e)},p.prototype.return=function(e){return this._invoke(`return`,e)};var ee=Object.entries,te=Object.setPrototypeOf,ne=Object.isFrozen,m=Object.getPrototypeOf,h=Object.getOwnPropertyDescriptor,g=Object.freeze,_=Object.seal,v=Object.create,re=typeof Reflect<`u`&&Reflect,ie=re.apply,y=re.construct;g||=function(e){return e},_||=function(e){return e},ie||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},y||=function(e){return new e(...[...arguments].slice(1))};var b=O(Array.prototype.forEach);Array.prototype.indexOf;var ae=O(Array.prototype.lastIndexOf),oe=O(Array.prototype.pop),se=O(Array.prototype.push);Array.prototype.slice;var ce=O(Array.prototype.splice),x=Array.isArray,le=O(String.prototype.toLowerCase),ue=O(String.prototype.toString),de=O(String.prototype.match),fe=O(String.prototype.replace),pe=O(String.prototype.indexOf),me=O(String.prototype.trim),S=O(Number.prototype.toString),he=O(Boolean.prototype.toString),C=typeof BigInt>`u`?null:O(BigInt.prototype.toString),ge=typeof Symbol>`u`?null:O(Symbol.prototype.toString),w=O(Object.prototype.hasOwnProperty),T=O(Object.prototype.toString),E=O(RegExp.prototype.test),D=_e(TypeError);function O(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ie(e,t,n)}}function _e(e){return function(){return y(e,[...arguments])}}function k(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:le;if(te&&te(e,null),!x(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ne(t)||(t[r]=e),i=e)}e[i]=!0}return e}function ve(e){for(let t=0;t<e.length;t++)w(e,t)||(e[t]=null);return e}function A(e){let t=v(null);for(let r of ee(e)){var n=d(r,2);let i=n[0],a=n[1];w(e,i)&&(t[i]=x(a)?ve(a):a&&typeof a==`object`&&a.constructor===Object?A(a):a)}return t}function ye(e){switch(typeof e){case`string`:return e;case`number`:return S(e);case`boolean`:return he(e);case`bigint`:return C?C(e):`0`;case`symbol`:return ge?ge(e):`Symbol()`;case`undefined`:return T(e);case`function`:case`object`:{if(e===null)return T(e);let t=e,n=j(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:T(e)}return T(e)}default:return T(e)}}function j(e,t){for(;e!==null;){let n=h(e,t);if(n){if(n.get)return O(n.get);if(typeof n.value==`function`)return O(n.value)}e=m(e)}function n(){return null}return n}function be(e){try{return E(e,``),!0}catch{return!1}}var xe=g(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Se=g(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ce=g([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),we=g([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Te=g(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ee=g([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),De=g([`#text`]),Oe=g(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),ke=g(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ae=g(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),je=g([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Me=_(/{{[\w\W]*|^[\w\W]*}}/g),Ne=_(/<%[\w\W]*|^[\w\W]*%>/g),Pe=_(/\${[\w\W]*/g),Fe=_(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ie=_(/^aria-[\-\w]+$/),Le=_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Re=_(/^(?:\w+script|data):/i),ze=_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Be=_(/^html$/i),Ve=_(/^[a-z][.\w]*(-[.\w]+)+$/i),He=_(/<[/\w!]/g),Ue=_(/<[/\w]/g),We=_(/<\/no(script|embed|frames)/i),Ge=_(/\/>/i),M={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},N=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],Ke=g(k({},N)),qe=function(){let e={};return b(N,t=>{e[t]=_(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),g(e)}(),Je=function(){return typeof window>`u`?null:window},Ye=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Xe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},P=function(e,t,n,r){return w(e,t)&&x(e[t])?k(r.base?A(r.base):{},e[t],r.transform):n},Ze=function(e,t,n){let r=w(e,t)?e[t]:void 0;return r&&typeof r==`object`?A(r):n()};function Qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Je(),t=e=>Qe(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==M.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=j(d,`cloneNode`),p=j(d,`remove`),te=j(d,`removeAttributeNode`),ne=j(d,`nextSibling`),m=j(d,`childNodes`),h=j(d,`parentNode`),re=j(d,`shadowRoot`),ie=j(d,`attributes`),y=o&&o.prototype?j(o.prototype,`nodeType`):null,S=o&&o.prototype?j(o.prototype,`nodeName`):null,he=o&&o.prototype?j(o.prototype,`ownerDocument`):null,C=function(e){return y?y(e):e.nodeType},ge=function(e){return S?S(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,O=``,_e,ve=!1,N=0,$e=function(){if(N>0)throw D(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},F=function(e){$e(),N++;try{return T.createHTML(e)}finally{N--}},I=function(e){$e(),N++;try{return T.createScriptURL(e)}finally{N--}},et=function(){return ve||=(_e=Ye(u,i),!0),_e},tt=n,nt=tt.implementation,rt=tt.createNodeIterator,it=tt.createDocumentFragment,at=tt.getElementsByTagName,ot=r.importNode,L=Xe();t.isSupported=typeof ee==`function`&&typeof h==`function`&&nt&&nt.createHTMLDocument!==void 0;let st=Me,ct=Ne,lt=Pe,ut=Fe,dt=Ie,ft=Re,pt=ze,mt=Ve,ht=Le,R=null,gt=k({},[...xe,...Se,...Ce,...Te,...De]),z=null,_t=k({},[...Oe,...ke,...Ae,...je]),B=Object.seal(v(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),vt=null,yt=null,V=Object.seal(v(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),bt=!0,xt=!0,St=!1,Ct=!0,H=!1,U=!0,W=!1,wt=!1,Tt=null,Et=null,Dt=!1,G=!1,Ot=!1,kt=!1,At=!0,jt=!1,Mt=`user-content-`,Nt=!0,Pt=!1,K={},q=null,Ft=k({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),It=null,Lt=k({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Rt=null,zt=k({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Bt=`http://www.w3.org/1998/Math/MathML`,Vt=`http://www.w3.org/2000/svg`,J=`http://www.w3.org/1999/xhtml`,Y=J,Ht=!1,Ut=null,Wt=k({},[Bt,Vt,J],ue),Gt=g([`mi`,`mo`,`mn`,`ms`,`mtext`]),Kt=k({},Gt),qt=g([`annotation-xml`]),Jt=k({},qt),Yt=k({},[`title`,`style`,`font`,`a`,`script`]),Xt=null,Zt=[`application/xhtml+xml`,`text/html`],X=null,Qt=null,$t=n.createElement(`form`),en=function(e){return e instanceof RegExp||e instanceof Function},tn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Qt&&Qt===e)return;(!e||typeof e!=`object`)&&(e={}),e=A(e),Xt=Zt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,X=Xt===`application/xhtml+xml`?ue:le,R=P(e,`ALLOWED_TAGS`,gt,{transform:X}),z=P(e,`ALLOWED_ATTR`,_t,{transform:X}),Ut=P(e,`ALLOWED_NAMESPACES`,Wt,{transform:ue}),Rt=P(e,`ADD_URI_SAFE_ATTR`,zt,{transform:X,base:zt}),It=P(e,`ADD_DATA_URI_TAGS`,Lt,{transform:X,base:Lt}),q=P(e,`FORBID_CONTENTS`,Ft,{transform:X}),vt=P(e,`FORBID_TAGS`,A({}),{transform:X}),yt=P(e,`FORBID_ATTR`,A({}),{transform:X}),K=w(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?A(e.USE_PROFILES):e.USE_PROFILES:!1,bt=e.ALLOW_ARIA_ATTR!==!1,xt=e.ALLOW_DATA_ATTR!==!1,St=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ct=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,U=e.SAFE_FOR_XML!==!1,W=e.WHOLE_DOCUMENT||!1,G=e.RETURN_DOM||!1,Ot=e.RETURN_DOM_FRAGMENT||!1,kt=e.RETURN_TRUSTED_TYPE||!1,Dt=e.FORCE_BODY||!1,At=e.SANITIZE_DOM!==!1,jt=e.SANITIZE_NAMED_PROPS||!1,Nt=e.KEEP_CONTENT!==!1,Pt=e.IN_PLACE||!1,ht=be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Le,Y=typeof e.NAMESPACE==`string`?e.NAMESPACE:J,Kt=Ze(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>k({},Gt)),Jt=Ze(e,`HTML_INTEGRATION_POINTS`,()=>k({},qt));let t=Ze(e,`CUSTOM_ELEMENT_HANDLING`,()=>v(null));if(B=v(null),w(t,`tagNameCheck`)&&en(t.tagNameCheck)&&(B.tagNameCheck=t.tagNameCheck),w(t,`attributeNameCheck`)&&en(t.attributeNameCheck)&&(B.attributeNameCheck=t.attributeNameCheck),w(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(B.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),_(B),H&&(xt=!1),Ot&&(G=!0),K&&(R=k({},De),z=v(null),K.html===!0&&(k(R,xe),k(z,Oe)),K.svg===!0&&(k(R,Se),k(z,ke),k(z,je)),K.svgFilters===!0&&(k(R,Ce),k(z,ke),k(z,je)),K.mathMl===!0&&(k(R,Te),k(z,Ae),k(z,je))),V.tagCheck=null,V.attributeCheck=null,w(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?V.tagCheck=e.ADD_TAGS:x(e.ADD_TAGS)&&(R===gt&&(R=A(R)),k(R,e.ADD_TAGS,X))),w(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?V.attributeCheck=e.ADD_ATTR:x(e.ADD_ATTR)&&(z===_t&&(z=A(z)),k(z,e.ADD_ATTR,X))),w(e,`ADD_FORBID_CONTENTS`)&&x(e.ADD_FORBID_CONTENTS)&&(q===Ft&&(q=A(q)),k(q,e.ADD_FORBID_CONTENTS,X)),Nt&&(R[`#text`]=!0),W&&k(R,[`html`,`head`,`body`]),R.table&&(k(R,[`tbody`]),delete vt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw D(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw D(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{O=F(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,O=``):(T===void 0&&(T=et()),T&&typeof O==`string`&&(O=F(``)));g&&g(e),Qt=e},nn=k({},[...Se,...Ce,...we]),rn=k({},[...Te,...Ee]),an=function(e,t,n){return t.namespaceURI===J?e===`svg`:t.namespaceURI===Bt?e===`svg`&&(n===`annotation-xml`||Kt[n]):!!nn[e]},on=function(e,t,n){return t.namespaceURI===J?e===`math`:t.namespaceURI===Vt?e===`math`&&Jt[n]:!!rn[e]},sn=function(e,t,n){return t.namespaceURI===Vt&&!Jt[n]||t.namespaceURI===Bt&&!Kt[n]?!1:!rn[e]&&(Yt[e]||!nn[e])},cn=function(e){let t=h(e);(!t||!t.tagName)&&(t={namespaceURI:Y,tagName:`template`});let n=le(e.tagName),r=le(t.tagName);return Ut[e.namespaceURI]?e.namespaceURI===Vt?an(n,t,r):e.namespaceURI===Bt?on(n,t,r):e.namespaceURI===J?sn(n,t,r):!!(Xt===`application/xhtml+xml`&&Ut[e.namespaceURI]):!1},Z=function(e){se(t.removed,{element:e});try{h(e).removeChild(e)}catch{if(p(e),!h(e))throw D(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ln=function(e,t,n){try{te(e,t)}catch{try{e.removeAttribute(n)}catch{}}},un=function(e){fn(e);let t=m(e);if(t){let e=[];b(t,t=>{se(e,t)}),b(e,e=>{try{p(e)}catch{}})}let n=ie(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&ln(e,r,i)}},Q=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}se(t.removed,{attribute:r||null,from:n});try{r?te(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(G||Ot)try{Z(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},dn=function(e){let t=ie(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||z[X(i)]||ln(e,r,i)}},fn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===M.element&&dn(e);let n=m(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},pn=function(e,t){return U?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},mn=function(e){if(!U)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===M.processingInstruction||n===M.comment&&E(Ue,e.data)){try{p(e)}catch{}continue}if(n===M.element){let t=e,n=X(ge(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&pn(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=m(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},hn=function(e){let t=null,r=null;if(Dt)e=`<remove></remove>`+e;else{let t=de(e,/^[\r\n\t ]+/);r=t&&t[0]}Xt===`application/xhtml+xml`&&Y===J&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?F(e):e;if(Y===J)try{t=new l().parseFromString(i,Xt)}catch{}if(!t||!t.documentElement){t=nt.createDocument(Y,`template`,null);try{t.documentElement.innerHTML=Ht?O:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Y===J?at.call(t,W?`html`:`body`)[0]:W?t.documentElement:a},gn=function(e){let t=he?he(e):e.ownerDocument;return rt.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},_n=function(e){return e=fe(e,st,` `),e=fe(e,ct,` `),e=fe(e,lt,` `),e},vn=function(e){e.normalize();let t=he?he(e):e.ownerDocument,n=rt.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=_n(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&b(i,e=>{bn(e.content)&&vn(e.content)})},yn=function(e){let t=S?S(e):null;return typeof t!=`string`||X(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==ie(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==m(e)},bn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===M.documentFragment}catch{return!1}},xn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&b(e,e=>{e.call(t,n,r,Qt)})}let Sn=function(e,t){return!!(U&&e.hasChildNodes()&&!xn(e.firstElementChild)&&E(He,e.textContent)&&E(He,e.innerHTML)||U&&e.namespaceURI===J&&Ke[t]&&(xn(e.firstElementChild)||typeof e.textContent==`string`&&E(qe[t],e.textContent))||e.nodeType===M.processingInstruction||U&&e.nodeType===M.comment&&E(Ue,e.data))},Cn=function(e,t){return e instanceof RegExp?E(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},wn=function(e,t,n){if(!vt[t]&&An(t)&&Cn(B.tagNameCheck,t))return!1;if(Nt&&!q[t]){let t=h(e),r=m(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,ne(e))}}}return Z(e),!0},Tn=function(e,t,n,r){return e.length===0?t:t===n||t===r?A(t):t},En=function(e,t){return e===t||h(e)!==null?!1:(Pt&&fn(e),!0)},Dn=function(e,n){if($(L.beforeSanitizeElements,e,null),En(e,n))return!0;if(yn(e))return Z(e),!0;let r=X(ge(e));if(R=Tn(L.uponSanitizeElement,R,gt,Tt),$(L.uponSanitizeElement,e,{tagName:r,allowedTags:R}),En(e,n))return!0;if(Sn(e,r))return Z(e),!0;if(vt[r]||!(V.tagCheck instanceof Function&&V.tagCheck(r))&&!R[r]){let t=wn(e,r,n);return t===!1&&($(L.afterSanitizeElements,e,null),En(e,n))?!0:t}if(C(e)===M.element&&!cn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&E(We,e.innerHTML))return Z(e),!0;if(H&&e.nodeType===M.text){let n=_n(e.textContent);e.textContent!==n&&(se(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(L.afterSanitizeElements,e,null),En(e,n)},On=function(e,t,r){if(yt[t]||pn(t,e)||At&&(t===`id`||t===`name`)&&(r in n||r in $t))return!1;let i=z[t]||V.attributeCheck instanceof Function&&V.attributeCheck(t,e);return xt&&E(ut,t)||bt&&E(dt,t)?!0:i?Rt[t]||E(ht,fe(r,pt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&pe(r,`data:`)===0&&It[e]||St&&!E(ft,fe(r,pt,``))?!0:!r:An(e)&&Cn(B.tagNameCheck,e)&&Cn(B.attributeNameCheck,t,e)||t===`is`&&B.allowCustomizedBuiltInElements&&Cn(B.tagNameCheck,r)},kn=k({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[le(e)]&&E(mt,e)},jn=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return F(r);case`TrustedScriptURL`:return I(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!yn(e)||(Z(e),!1)}catch{return Q(t,e),!1}},Nn=function(e,n){if($(L.beforeSanitizeAttributes,e,null),En(e,n))return;let r=e.attributes;if(!r||yn(e))return;z=Tn(L.uponSanitizeAttribute,z,_t,Et);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0},a=r.length,o=X(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=X(s),d=l,f=s===`value`?d:me(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(L.uponSanitizeAttribute,e,i),f=i.attrValue,jt&&(u===`id`||u===`name`)&&pe(f,Mt)!==0&&(Q(s,e,n),f=Mt+f,p=!0),U&&E(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Q(s,e,n);continue}if(u===`attributename`&&de(f,`href`)){Q(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){Q(s,e,n);continue}if(!Ct&&E(Ge,f)){Q(s,e,n);continue}if(H&&(f=_n(f)),!On(o,u,f)){Q(s,e,n);continue}f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&oe(t.removed)}}$(L.afterSanitizeAttributes,e,null),En(e,n)},Pn=function(e){let t=null,n=gn(e);for($(L.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(L.uponSanitizeShadowNode,t,null),Dn(t,e),Nn(t,e),bn(t.content)&&Pn(t.content),C(t)===M.element){let e=re(t);bn(e)&&(Fn(e),Pn(e))}$(L.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=C(n)===M.element,i=m(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=S?S(n):null;if(typeof e==`string`&&X(e)===`template`){let e=n.content;bn(e)&&t.push({node:e,shadow:null})}}if(r){let e=re(n);bn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ht=!e,Ht&&(e=`<!-->`),typeof e!=`string`&&!xn(e)&&(e=ye(e),typeof e!=`string`))throw D(`dirty is not a string, aborting`);if(!t.isSupported)return e;wt?(R=Tt,z=Et):tn(n),(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&(R=A(R)),L.uponSanitizeAttribute.length>0&&(z=A(z)),t.removed=[];let c=Pt&&typeof e!=`string`&&xn(e);if(c){mn(e);let t=ge(e);if(typeof t==`string`){let n=X(t);if(!R[n]||vt[n])throw un(e),D(`root node is forbidden and cannot be sanitized in-place`)}if(yn(e))throw un(e),D(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw un(e),t}}else if(xn(e))i=hn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===M.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!G&&!H&&!W&&e.indexOf(`<`)===-1)return T&&kt?F(e):e;if(i=hn(e),!i)return G?null:kt?O:``}i&&Dt&&Z(i.firstChild);let l=c?e:i;try{let e=gn(l);for(;o=e.nextNode();)Dn(o,l),Nn(o,l),bn(o.content)&&Pn(o.content)}catch(n){throw c&&(un(e),b(t.removed,e=>{e.element&&fn(e.element)})),n}if(c){let n=!1;if(b(t.removed,t=>{t.element&&(t.element===e&&(n=!0),fn(t.element))}),n)throw D(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return H&&vn(e),e}if(G){if(H&&vn(i),Ot)for(s=it.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(z.shadowroot||z.shadowrootmode)&&(s=ot.call(r,s,!0)),s}let u=W?i.outerHTML:i.innerHTML;return W&&R[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&E(Be,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
3
3
|
`+u),H&&(u=_n(u)),T&&kt?F(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tn(e),wt=!0,Tt=R,Et=z},t.clearConfig=function(){Qt=null,wt=!1,Tt=null,Et=null,T=_e,O=``},t.isValidAttribute=function(e,t,n){Qt||tn({});let r=X(e),i=X(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&w(L,e)&&se(L[e],t)},t.removeHook=function(e,t){if(w(L,e)){if(t!==void 0){let n=ae(L[e],t);return n===-1?void 0:ce(L[e],n,1)[0]}return oe(L[e])}},t.removeHooks=function(e){w(L,e)&&(L[e]=[])},t.removeAllHooks=function(){L=Xe()},t}var $e=Qe(),F=e({DocumentPreview:()=>et}),I=r();function et({preview:e,fileUrl:t,raw:n}){let r=`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:"></head><body>${(0,a.useMemo)(()=>e.kind===`html`&&!n?$e.sanitize(e.content??``,{USE_PROFILES:{html:!0},FORBID_TAGS:[`script`,`iframe`,`object`,`embed`,`form`,`link`,`meta`,`base`]}):``,[e,n])}</body></html>`;return e.kind===`markdown`&&!n?(0,I.jsx)(i,{content:e.content??``}):e.kind===`html`&&!n?(0,I.jsx)(`iframe`,{title:`Preview of ${e.name}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:r,className:`h-[65vh] w-full rounded border border-border bg-white`}):e.content===void 0?e.kind===`pdf`?(0,I.jsx)(`iframe`,{title:`Preview of ${e.name}`,src:t,className:`h-[65vh] w-full rounded border border-border`}):e.kind===`image`?(0,I.jsx)(`img`,{src:t,alt:e.name,className:`max-w-full h-auto`}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Preview is unavailable for this format. Download the document to open it in its application.`}):(0,I.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-sm`,children:e.content})}export{F as n,et as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DE3RlOCf.js";import{t}from"./button-BrcP8Wxx.js";import{t as n}from"./circle-plus-D0tjHKM4.js";import{t as r}from"./brand-
|
|
1
|
+
import{t as e}from"./jsx-runtime-DE3RlOCf.js";import{t}from"./button-BrcP8Wxx.js";import{t as n}from"./circle-plus-D0tjHKM4.js";import{t as r}from"./brand-Bj6g9sFF.js";import{St as i}from"./index-qvc4aLwP.js";var a=e();function o({config:e,onCreateWorkspace:o,onModifySettings:s}){return(0,a.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,a.jsxs)(`header`,{className:`mb-10`,children:[(0,a.jsx)(`div`,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary border border-primary/20 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Getting Started Guide`}),(0,a.jsxs)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:[`Welcome to `,r]}),(0,a.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[r,` orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,a.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,a.jsxs)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:[r,` Workflows`]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`1`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Specify your Development folder (where repositories live) and Workspaces folder. These are currently set to:`,(0,a.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`2`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Choose repositories and feature branch. `,r,` checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`]})]})]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`3`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[r,` writes files like `,(0,a.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,a.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,a.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,a.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,a.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,a.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,a.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,a.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,a.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,a.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,a.jsxs)(t,{className:`w-full gap-2`,onClick:o,children:[(0,a.jsx)(n,{size:14}),` Create a Workspace`]}),(0,a.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:s,children:[(0,a.jsx)(i,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{o as GettingStartedPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{a as r,i,n as a,r as o,t as s}from"./monaco-DLwhzYMT.js";import{c,d as l,f as u,p as d,u as f}from"./index-qvc4aLwP.js";var p=e(t(),1);a({id:`json`,extensions:[`.json`,`.bowerrc`,`.jshintrc`,`.jscsrc`,`.eslintrc`,`.babelrc`],aliases:[`JSON`,`json`],mimetypes:[`application/json`],loader:()=>Promise.resolve({conf:{comments:!1,brackets:[[`{`,`}`],[`[`,`]`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`"`,close:`"`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`"`,close:`"`}]},language:{defaultToken:``,tokenPostfix:`.json`,tokenizer:{root:[[/"([^"\\]|\\.)*"\s*(?=:)/,`type.identifier`],[/"([^"\\]|\\.)*"/,`string`],[/-?\d+(\.\d+)?([eE][+-]?\d+)?/,`number`],[/\b(true|false|null)\b/,`keyword`],[/[{}[\],]/,`delimiter`],{include:`@whitespace`}],whitespace:[[/\s+/,`white`]]}}})});var m={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,html:`html`,htm:`html`,css:`css`,scss:`scss`,less:`less`,md:`markdown`,markdown:`markdown`,py:`python`,rs:`rust`,go:`go`,sh:`shell`,bash:`shell`,zsh:`shell`,ps1:`powershell`,yml:`yaml`,yaml:`yaml`,sql:`sql`,xml:`xml`,svg:`xml`,diff:`diff`,patch:`diff`,dockerfile:`dockerfile`,toml:`ini`,java:`java`,c:`c`,cpp:`cpp`,cs:`csharp`,rb:`ruby`,php:`php`};function h(e){if(!e)return`plaintext`;let t=e.split(`?`)[0].split(`#`)[0].split(/[/\\]/).pop()?.toLowerCase()||``;return t===`dockerfile`?`dockerfile`:t===`package.json`||t===`tsconfig.json`?`json`:m[t.split(`.`).pop()||``]||`plaintext`}var g=!1;function _(){g||typeof window>`u`||(window.MonacoEnvironment={getWorker(){return new s}},g=!0)}var v={ES3:0,ES5:1,ES2015:2,ES2016:3,ES2017:4,ES2018:5,ES2019:6,ES2020:7,ESNext:99,JSON:100,Latest:99},y={None:0,CommonJS:1,AMD:2,UMD:3,System:4,ES2015:5,ESNext:99},b={Classic:1,NodeJs:2},x={None:0,Preserve:1,React:2,ReactNative:3,ReactJSX:4,ReactJSXDev:5},S=class{_compilerOptions;_diagnosticsOptions;_modeConfiguration;constructor(e={},t={},n={}){this._compilerOptions=e,this._diagnosticsOptions=t,this._modeConfiguration=n}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(e){this._compilerOptions={...this._compilerOptions,...e||{}}}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions={...this._diagnosticsOptions,...e||{}}}getModeConfiguration(){return this._modeConfiguration}setModeConfiguration(e){this._modeConfiguration={...this._modeConfiguration,...e||{}}}},C=new S({allowNonTsExtensions:!0,target:v.ESNext},{noSemanticValidation:!0,noSyntaxValidation:!0},{}),w=new S({allowNonTsExtensions:!0,allowJs:!0,target:v.ESNext},{noSemanticValidation:!0,noSyntaxValidation:!0},{}),T=!1;function E(){if(T)return;let e={target:v.ESNext,moduleResolution:b.NodeJs,module:y.ESNext,jsx:x.ReactJSX,allowNonTsExtensions:!0,allowJs:!0,noEmit:!0};C.setCompilerOptions(e),w.setCompilerOptions(e);let t={completionItems:!1,hovers:!1,documentSymbols:!1,definitions:!1,references:!1,documentHighlights:!1,rename:!1,diagnostics:!1,documentRangeFormattingEdits:!1,signatureHelp:!1,onTypeFormattingEdits:!1,codeActions:!1,inlayHints:!1};if(C.setModeConfiguration(t),w.setModeConfiguration(t),C.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),w.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),typeof window<`u`){let e=window;e.monaco=e.monaco||{},e.monaco.languages=e.monaco.languages||{},e.monaco.languages.typescript={typescriptDefaults:C,javascriptDefaults:w,ScriptTarget:v,ModuleResolutionKind:b,ModuleKind:y,JsxEmit:x}}T=!0}var D=n();_(),E(),c(r);var O=({filePath:e,repoName:t=`workspace`,originalContent:n,modifiedContent:a,viewMode:s,ignoreWhitespace:c,height:m=480,targetLine:g,jumpNonce:_,onOpenFile:v,onLineSelect:y})=>{let b=(0,p.useRef)(null),x=(0,p.useRef)(null),S=(0,p.useRef)(null),C=(0,p.useRef)({original:null,modified:null}),w=(0,p.useRef)(v),T=(0,p.useRef)(y);(0,p.useEffect)(()=>{w.current=v,T.current=y});let E=(0,p.useRef)(``),O=(0,p.useRef)(void 0);return(0,p.useEffect)(()=>{x.current&&x.current.updateOptions({renderSideBySide:s===`side-by-side`})},[s]),(0,p.useEffect)(()=>{x.current&&x.current.updateOptions({ignoreTrimWhitespace:c})},[c]),(0,p.useEffect)(()=>{let{original:e,modified:t}=C.current;e&&n!==void 0&&e.getValue()!==n&&e.setValue(n),t&&a!==void 0&&t.getValue()!==a&&t.setValue(a)},[n,a]),(0,p.useEffect)(()=>{if(!x.current||!g||g<=0||O.current===_)return;O.current=_;let e=x.current.getModifiedEditor();e.revealLineInCenter(g),e.setPosition({lineNumber:g,column:1}),e.focus(),S.current||=e.createDecorationsCollection(),S.current.set([{range:new o(g,1,g,1),options:{isWholeLine:!0,className:`bg-primary/20 border-l-2 border-primary`}}])},[g,_]),(0,p.useEffect)(()=>{if(!b.current)return;let o=h(e),p=u(t,e,r),m=f(t,e,r),_=l(p,n,o,r)||i.createModel(n,o),v=l(m,a,o,r)||i.createModel(a,o);C.current={original:_,modified:v};let y=d((e,t,n)=>{w.current?.(e,t,n)},r),S=document.documentElement.classList.contains(`dark`)||document.documentElement.getAttribute(`data-theme`)!==`light`,D=null,O=null,k=null;try{D=i.createDiffEditor(b.current,{readOnly:!0,renderSideBySide:s===`side-by-side`,ignoreTrimWhitespace:c,hideUnchangedRegions:{enabled:!1},renderIndicators:!0,originalEditable:!1,automaticLayout:!0,scrollBeyondLastLine:!1,minimap:{enabled:!0,maxColumn:60},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8,alwaysConsumeMouseWheel:!1},lineNumbersMinChars:3,fontSize:12,fontFamily:`'JetBrains Mono', Consolas, Menlo, monospace`,theme:S?`vs-dark`:`vs`,contextmenu:!0}),D.setModel({original:_,modified:v}),x.current=D;let t=D.getModifiedEditor();if(O=t.onDidChangeCursorPosition(e=>{T.current?.(e.position.lineNumber)}),k=D.onDidUpdateDiff(()=>{let n=`${e}:${g}`;g&&g>0&&E.current!==n&&(E.current=n,t.revealLineInCenter(g),t.setPosition({lineNumber:g,column:1}))}),g&&g>0){let n=`${e}:${g}`;E.current=n,t.revealLineInCenter(g),t.setPosition({lineNumber:g,column:1})}}catch(e){console.error(`[MonacoDiffAdapter] Error initializing diff editor:`,e)}return()=>{k?.dispose(),O?.dispose(),y?.dispose(),D?.dispose(),x.current=null}},[e,t]),(0,D.jsx)(`div`,{ref:b,style:{height:typeof m==`number`?`${m}px`:m},className:`w-full h-full rounded-lg overflow-hidden border border-border/70 bg-background`})};export{O as MonacoDiffAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{t as r}from"./input-LtE7Sz4D.js";import{B as i,C as a,N as o,Z as s,d as c,et as l,o as u,y as d}from"./queries-CtxmqmGJ.js";import{t as f}from"./button-BrcP8Wxx.js";import{n as p,t as m}from"./ScaffoldRepoInline-DoqywP_g.js";import{t as h}from"./trash-2-BrrLX4tD.js";import{C as g,D as _,Dt as v,E as y,Et as b,O as x,S,T as ee,Tt as C,w,x as T}from"./index-qvc4aLwP.js";import{a as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog-CdWem4Th.js";import{t as N}from"./badge-DQIZRRDZ.js";import{a as P,i as F,n as I,r as L,t as te}from"./empty-DK2eW2rF.js";var R=e(t(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=s(),t=d(),n=a(),V=i(),H=u(),U=o(),W=c(),[G,K]=(0,R.useState)(null),[q,J]=(0,R.useState)(null),[Y,X]=(0,R.useState)(null),Z=(0,R.useMemo)(()=>{let e={};for(let t of V.data??[])t.projectId&&(e[t.projectId]=(e[t.projectId]??0)+1);return e},[V.data]),Q=()=>{J(null),K(B)},ne=e=>{J(null),K({editingId:e.id,name:e.name,description:e.description??``,repoPaths:e.repos.map(e=>e.path)})},re=e=>{K(t=>t&&{...t,repoPaths:t.repoPaths.includes(e.path)?t.repoPaths.filter(t=>t!==e.path):[...t.repoPaths,e.path]})},ie=async()=>{if(G){J(null);try{G.editingId?await U.mutateAsync({id:G.editingId,name:G.name,description:G.description||null,repos:G.repoPaths}):await H.mutateAsync({name:G.name,description:G.description||void 0,repos:G.repoPaths}),K(null)}catch(e){J(e instanceof Error?e.message:String(e))}}},ae=async()=>{if(Y)try{await W.mutateAsync(Y.id)}finally{X(null)}},oe=!!(G&&G.name.trim()&&G.repoPaths.length>0),$=H.isPending||U.isPending;return(0,z.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,z.jsxs)(`header`,{className:`mb-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-border/70 pb-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature workspace.`})]}),(0,z.jsxs)(f,{onClick:Q,className:`gap-1.5 shadow-sm`,children:[(0,z.jsx)(C,{size:15}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(T,{className:`size-6`})}):(t.data??[]).length===0?(0,z.jsxs)(te,{className:`border border-border border-dashed`,children:[(0,z.jsxs)(L,{children:[(0,z.jsx)(F,{variant:`icon`,children:(0,z.jsx)(l,{})}),(0,z.jsx)(P,{children:`No projects yet`}),(0,z.jsx)(I,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,z.jsxs)(f,{onClick:Q,children:[(0,z.jsx)(C,{}),` New project`]})]}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-3`,children:(t.data??[]).map(t=>(0,z.jsx)(`li`,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-4 transition-all duration-200 hover:border-primary/40 hover:shadow-xs`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:t.name}),(Z[t.id]??0)>0&&(0,z.jsxs)(N,{variant:`secondary`,children:[Z[t.id],` workspace`,Z[t.id]===1?``:`s`]})]}),t.description&&(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:t.description}),(0,z.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:t.repos.map(e=>(0,z.jsxs)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[e.path,(0,z.jsxs)(`span`,{className:`ml-2 text-muted-foreground/60`,children:[`[`,e.defaultBranch,`]`]})]},e.path))})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,z.jsxs)(f,{size:`sm`,onClick:()=>e(`/new?project=${encodeURIComponent(t.id)}`),children:[(0,z.jsx)(b,{}),` Start work`]}),(0,z.jsx)(f,{size:`icon-sm`,variant:`ghost`,"aria-label":`Edit ${t.name}`,onClick:()=>ne(t),children:(0,z.jsx)(v,{})}),(0,z.jsx)(f,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${t.name}`,onClick:()=>X(t),children:(0,z.jsx)(h,{})})]})]})},t.id))}),(0,z.jsx)(S,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(_,{className:`max-w-lg`,children:[(0,z.jsxs)(ee,{children:[(0,z.jsx)(x,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(g,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,z.jsxs)(y,{className:`space-y-4`,children:[(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Name`}),(0,z.jsx)(r,{value:G?.name??``,onChange:e=>K(t=>t&&{...t,name:e.target.value}),placeholder:`e.g. Acme Billing`,autoFocus:!0})]}),(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsxs)(`span`,{className:`mb-1 block text-sm font-medium`,children:[`Description `,(0,z.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional)`})]}),(0,z.jsx)(r,{value:G?.description??``,onChange:e=>K(t=>t&&{...t,description:e.target.value}),placeholder:`What this group of repos is for`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Repositories`}),(0,z.jsx)(p,{repos:n.data??[],selectedPaths:G?.repoPaths??[],onToggle:re,loading:n.isLoading,emptyHint:`No repositories found in your dev directory.`}),(0,z.jsx)(m,{onCreated:e=>K(t=>t&&{...t,repoPaths:[...t.repoPaths,e.path]})})]}),q&&(0,z.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:q})]}),(0,z.jsxs)(w,{children:[(0,z.jsx)(f,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(f,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(T,{}):null,G?.editingId?`Save changes`:`Create project`]})]})]})}),(0,z.jsx)(M,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,z.jsxs)(k,{children:[(0,z.jsxs)(E,{children:[(0,z.jsxs)(j,{children:[`Remove “`,Y?.name,`”?`]}),(0,z.jsx)(A,{children:`This only removes the project from the registry — repositories and workspaces on disk are not touched.`})]}),(0,z.jsxs)(D,{children:[(0,z.jsx)(O,{render:(0,z.jsx)(f,{variant:`outline`,children:`Cancel`})}),(0,z.jsxs)(f,{variant:`destructive`,onClick:ae,disabled:W.isPending,children:[W.isPending?(0,z.jsx)(T,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{Gt as r,In as i,Jt as a,Tn as o,Ut as s,Yt as c,a as l,bt as u,c as d,gn as f,nn as ee,o as p,on as m,qn as te,r as ne,s as h,t as g,tn as re,yt as ie}from"./input-LtE7Sz4D.js";import{$ as _,s as v}from"./queries-CtxmqmGJ.js";import{c as ae,d as oe,f as se,h as ce,i as le,l as ue,m as y,o as de,p as b,t as x}from"./button-BrcP8Wxx.js";import{t as fe}from"./useValueChanged-DcnEcpiS.js";import{t as pe}from"./useAriaLabelledBy-BAD_HQgN.js";import{b as S,x as me}from"./index-qvc4aLwP.js";var C=ce(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),w=e(t(),1),T=w.createContext({disabled:!1});function he(){return w.useContext(T)}function ge(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}function _e(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":``}:{"data-unchecked":``}},...d}}var E=w.createContext(void 0);function ve(){return w.useContext(E)}var D=w.createContext(void 0);function O(){let e=w.useContext(D);if(e===void 0)throw Error(b(14));return e}var k=n(),ye=`data-parent`,be=w.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:s=!1,"aria-labelledby":d,disabled:te=!1,form:g,id:_,indeterminate:v=!1,inputRef:ce,name:y,onCheckedChange:b,parent:x=!1,readOnly:S=!1,render:me,required:C=!1,uncheckedValue:T,value:E,nativeButton:O=!1,style:be,...xe}=e,{clearErrors:A}=p(),{disabled:Se,name:Ce,setDirty:we,setFilled:j,setFocused:M,setTouched:Te,state:N,validationMode:Ee,validityData:De,validation:Oe}=h(),ke=he(),{labelId:Ae,controlId:je,registerControlId:P,getDescriptionProps:F}=l(),I=ve(),L=I?.allValues===void 0?void 0:I.parent,R=L!==void 0,z=Se||ke.disabled||I?.disabled||te,B=Ce??y,V=E??B,Me=c(),Ne=c(),H=_||je;R&&(x?H=Ne:V===void 0?H||=Ne:H=`${L.id}-${V}`);let U={};R&&(x?U=L.getParentProps():V!==void 0&&(U=L.getChildProps(V)));let{checked:Pe=n,indeterminate:Fe=v,onCheckedChange:Ie,...Le}=U,W=I?.value,G=w.useRef(null),K=se(()=>Symbol()),q=w.useRef(!1),{getButtonProps:Re,buttonRef:ze}=re({disabled:z,native:O}),J=I?.validation??Oe,[Y,Be]=o({controlled:V!==void 0&&W!==void 0&&!x?W.includes(V):Pe,default:s,name:`Checkbox`,state:`checked`}),X=R?!!Pe:Y,Z=R&&Fe||v;m(()=>{P!==ue&&(q.current=!0,P(K.current,H))},[H,P,K]),w.useEffect(()=>{let e=K.current;return()=>{!q.current||P===ue||(q.current=!1,P(e,void 0))}},[P,K]),ne(G,Me,Y,void 0,!I&&!z,y);let Q=w.useRef(null),Ve=J.registerInput,He=I?V:void 0,Ue=w.useCallback(e=>Ve(e,{controlRef:G,value:He}),[Ve,He]),We=oe(ce,Q,x?void 0:Ue),Ge=pe(d,Ae,Q,!O,H??void 0);m(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&j(!0))},[Y,Z,j]),fe(Y,()=>{I||(A(B),j(Y),we(Y!==De.initialValue),J.change(Y))});let Ke=de({checked:Y,disabled:z,form:g,name:x?void 0:B,id:O?void 0:H??void 0,required:C,ref:We,style:B?u:ie,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(S){e.preventDefault();return}let t=e.currentTarget.checked,n=a(i,e.nativeEvent);if(b?.(t,n),!n.isCanceled&&(Ie?.(t,n),!n.isCanceled&&(Be(t),V!==void 0&&I!==void 0&&!x&&!R))){let e=t?[...I.value,V]:I.value.filter(e=>e!==V);I.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){G.current?.focus()}},E===void 0?ae:{value:(I?Y&&E:E)||``},F,e=>J.getValidationProps(z,e));w.useEffect(()=>{if(!L||V===void 0)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=w.useMemo(()=>({...N,checked:X,disabled:z,readOnly:S,required:C,indeterminate:Z}),[N,X,z,S,C,Z]),qe=_e($),Je=le(`span`,e,{state:$,ref:[ze,G,t],props:[{id:O?H??void 0:Me,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":S||void 0,"aria-required":C||void 0,"aria-labelledby":Ge,[ye]:x?``:void 0,onFocus(){z||M(!0)},onBlur(){let e=Q.current;e&&(Te(!0),M(!1),Ee===`onBlur`&&J.commit(I?W:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),f(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||ge(t)?.click()})},onClick(e){if(S||z)return;e.preventDefault();let t=Q.current;t&&ee(t,e)}},xe,Le,Re,F,e=>J.getValidationProps(z,e)],stateAttributesMapping:qe});return(0,k.jsxs)(D.Provider,{value:$,children:[Je,!Y&&!I&&B&&!x&&T!==void 0&&(0,k.jsx)(`input`,{type:`hidden`,form:g,name:B,value:T,disabled:z}),(0,k.jsx)(`input`,{...Ke,suppressHydrationWarning:!0})]})}),xe=w.forwardRef(function(e,t){let{render:n,className:i,style:a,keepMounted:o=!1,...c}=e,l=O(),u=l.checked||l.indeterminate,{mounted:d,transitionStatus:f,setMounted:ee}=r(u),p=w.useRef(null),m={...l,transitionStatus:f};s({open:u,ref:p,onComplete(){u||ee(!1)}});let ne={..._e(l),...te},h=o||d,g=le(`span`,e,{ref:[t,p],state:m,stateAttributesMapping:ne,props:c});return h?g:null});function A({className:e,...t}){return(0,k.jsx)(be,{className:y(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,e),"data-slot":`checkbox`,...t,children:(0,k.jsx)(xe,{className:`-inset-px absolute flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground`,"data-slot":`checkbox-indicator`,render:(e,t)=>(0,k.jsx)(`span`,{...e,children:t.indeterminate?(0,k.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,k.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,k.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,k.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})})})}function Se({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a,freshnessMap:o}){let[s,c]=(0,w.useState)(``),l=(0,w.useMemo)(()=>{let t=s.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,s]);return(0,k.jsxs)(`div`,{className:y(`flex flex-col gap-2`,a),children:[(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(_,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,k.jsx)(g,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter repositories…`,className:`pl-8`,"aria-label":`Filter repositories`})]}),(0,k.jsx)(`div`,{className:`max-h-56 overflow-y-auto rounded-lg border border-border`,children:r?(0,k.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`Scanning for repositories…`}):l.length===0?(0,k.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:i??`No repositories found.`}):(0,k.jsx)(`ul`,{className:`divide-y divide-border`,children:l.map(e=>{let r=t.includes(e.path),i=o?.[e.path];return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-3 py-2 hover:bg-accent`,children:[(0,k.jsx)(A,{checked:r,onCheckedChange:()=>n(e),"aria-label":e.name}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,k.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.path})]}),(0,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&(0,k.jsx)(S,{tone:i.status===`up-to-date`?`success`:i.status===`behind`?`warning`:i.status===`diverged`?`danger`:i.status===`ahead`?`info`:`neutral`,title:i.message,children:i.status===`behind`?`↓ ${i.behind} behind`:i.status===`up-to-date`?`Up to date`:i.status===`diverged`?`Diverged`:i.status===`ahead`?`↑ ${i.ahead} ahead`:`Local`}),(0,k.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})]})},e.path)})})})]})}function Ce({onCreated:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(``),[a,o]=(0,w.useState)(null),s=v(),c=async()=>{o(null);try{let{repo:t}=await s.mutateAsync(r.trim());i(``),n(!1),e(t)}catch(e){o(e instanceof Error?e.message:String(e))}};return t?(0,k.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(g,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&c(),placeholder:`new-repo-name`,className:`h-7 font-mono text-xs`,"aria-label":`New repository name`,autoFocus:!0}),(0,k.jsxs)(x,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,k.jsx)(me,{}):null,`Create`]}),(0,k.jsx)(x,{size:`xs`,variant:`ghost`,onClick:()=>{n(!1),o(null)},children:`Cancel`})]}),a&&(0,k.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:a})]}):(0,k.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`mt-1.5 inline-flex cursor-pointer items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,k.jsx)(C,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{Se as n,A as r,Ce as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{In as r,Jt as i,Tn as a,Yt as o,a as s,bt as c,c as l,i as u,nn as d,o as f,on as p,r as m,s as ee,t as h,tn as g,yt as te}from"./input-LtE7Sz4D.js";import{c as ne,d as re,i as _,m as v,p as y,t as b}from"./button-BrcP8Wxx.js";import{t as ie}from"./useValueChanged-DcnEcpiS.js";import{t as ae}from"./useAriaLabelledBy-BAD_HQgN.js";import{A as x,Kt as S,M as C,N as w,P as T,_t as E,j as D,tt as oe,wt as O,x as k}from"./index-qvc4aLwP.js";import{t as A}from"./badge-DQIZRRDZ.js";import{t as j}from"./card-BMggHY3n.js";import{t as M}from"./label-C610MHwq.js";import{t as N}from"./alert-CHAmIFAx.js";var P=n();function F({className:e,orientation:t=`horizontal`,...n}){return(0,P.jsx)(oe,{className:v(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,e),"data-slot":`separator`,orientation:t,...n})}var I=e(t(),1),L=I.createContext(void 0);function R(){let e=I.useContext(L);if(e===void 0)throw Error(y(63));return e}var z={...l,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},B=I.forwardRef(function(e,t){let{checked:n,className:l,defaultChecked:h,"aria-labelledby":v,form:y,id:b,inputRef:x,name:S,nativeButton:C=!1,onCheckedChange:w,readOnly:T=!1,required:E=!1,disabled:D=!1,render:oe,uncheckedValue:O,value:k,style:A,...j}=e,{clearErrors:M}=f(),{state:N,setTouched:F,setDirty:R,validityData:B,setFilled:V,setFocused:H,validationMode:U,disabled:se,name:ce,validation:W}=ee(),{labelId:le}=s(),G=se||D,K=ce??S,q=I.useRef(null),ue=re(q,x,W.inputRef),J=I.useRef(null),Y=o(),X=u({id:b,implicit:!1,controlRef:J}),Z=C?void 0:X,[Q,de]=a({controlled:n,default:!!h,name:`Switch`,state:`checked`});m(J,Y,Q,void 0,!G,S),p(()=>{q.current&&V(q.current.checked)},[V]),ie(Q,()=>{M(K),R(Q!==B.initialValue),V(Q),W.change(Q)});let{getButtonProps:fe,buttonRef:pe}=g({disabled:G,native:C}),me=ae(v,le,q,!C,Z),he={id:C?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":T||void 0,"aria-required":E||void 0,"aria-labelledby":me,onFocus(){G||H(!0)},onBlur(){let e=q.current;!e||G||(F(!0),H(!1),U===`onBlur`&&W.commit(e.checked))},onClick(e){if(T||G)return;e.preventDefault();let t=q.current;t&&d(t,e)}},ge={...W.getValidationProps(G),checked:Q,disabled:G,form:y,id:Z,name:K,required:E,style:K?c:te,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ue,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(T){e.preventDefault();return}let t=e.currentTarget.checked,n=i(r,e.nativeEvent);w?.(t,n),!n.isCanceled&&de(t)},onClick(e){e.stopPropagation()},onFocus(){J.current?.focus()},...k===void 0?ne:{value:k}},$=I.useMemo(()=>({...N,checked:Q,disabled:G,readOnly:T,required:E}),[N,Q,G,T,E]),_e=_(`span`,e,{state:$,ref:[t,J,pe],props:[he,j,fe,e=>W.getValidationProps(G,e)],stateAttributesMapping:z});return(0,P.jsxs)(L.Provider,{value:$,children:[_e,!Q&&K&&O!==void 0&&(0,P.jsx)(`input`,{type:`hidden`,form:y,name:K,value:O,disabled:G}),(0,P.jsx)(`input`,{...ge,suppressHydrationWarning:!0})]})}),V=I.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=R();return _(`span`,e,{state:o,ref:t,stateAttributesMapping:z,props:a})});function H({className:e,...t}){return(0,P.jsx)(B,{className:v(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,e),"data-slot":`switch`,...t,children:(0,P.jsx)(V,{className:v(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`})})}function U({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:c,updatingToolId:l,fetchToolsStatus:u,handleUpdateTool:d}){if(!e)return null;let f=r.find(t=>t.command===e.defaultEditor),p=i.find(t=>t.name===(e.storageProvider||`local`));return(0,P.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,P.jsxs)(`header`,{className:`mb-6 border-b border-border/70 pb-4`,children:[(0,P.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Global Settings`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Configure your local development directories, AI search parameters, storage adapters, and editor defaults.`})]}),n===`success`&&(0,P.jsxs)(N,{variant:`success`,className:`mb-6`,children:[(0,P.jsx)(S,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,P.jsxs)(N,{variant:`error`,className:`mb-6`,children:[(0,P.jsx)(E,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,P.jsx)(j,{className:`mb-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:(0,P.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-devDir`,className:`text-sm`,children:`Development Directory`}),(0,P.jsx)(h,{type:`text`,id:`settings-devDir`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-workspacesDir`,className:`text-sm`,children:`Workspaces Directory`}),(0,P.jsx)(h,{type:`text`,id:`settings-workspacesDir`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-scanDepth`,className:`text-sm`,children:`Repo Search Depth`}),(0,P.jsx)(h,{type:`number`,min:1,max:5,id:`settings-scanDepth`,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:`Default Assistant`}),(0,P.jsxs)(x,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,P.jsx)(w,{"aria-label":`Default Assistant`,children:(0,P.jsx)(T,{children:e.defaultAssistant===`claude`?`Claude Code`:e.defaultAssistant===`antigravity`?`Antigravity`:e.defaultAssistant===`codex`?`Codex`:e.defaultAssistant===`copilot`?`GitHub Copilot`:e.defaultAssistant===`cursor`?`Cursor`:`None (Prompt me)`})}),(0,P.jsxs)(C,{alignItemWithTrigger:!1,children:[(0,P.jsx)(D,{value:``,children:`None (Prompt me)`}),(0,P.jsx)(D,{value:`claude`,children:`Claude Code`}),(0,P.jsx)(D,{value:`antigravity`,children:`Antigravity`}),(0,P.jsx)(D,{value:`codex`,children:`Codex`}),(0,P.jsx)(D,{value:`copilot`,children:`GitHub Copilot`}),(0,P.jsx)(D,{value:`cursor`,children:`Cursor`})]})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:`Preferred Editor`}),(0,P.jsxs)(x,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,P.jsx)(w,{"aria-label":`Preferred Editor`,children:(0,P.jsx)(T,{children:f?`${f.name} ${f.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,P.jsxs)(C,{alignItemWithTrigger:!1,children:[(0,P.jsx)(D,{value:``,children:`No preference`}),r.map(e=>(0,P.jsxs)(D,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,P.jsx)(F,{className:`mt-1`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,P.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,P.jsxs)(x,{value:e.storageProvider||`local`,onValueChange:n=>{if(typeof n!=`string`)return;let r=n,a={...e,storageProvider:r},o=i.find(e=>e.name===r);o?.configFields?.length&&(a.adapterConfig||={},a.adapterConfig[r]||(a.adapterConfig[r]={}),o.configFields.forEach(e=>{a.adapterConfig[r][e.key]===void 0&&e.default!==void 0&&(a.adapterConfig[r][e.key]=e.default)})),t(a)},children:[(0,P.jsx)(w,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,P.jsx)(T,{children:p?.displayName??`Local Workspace (Folders)`})}),(0,P.jsx)(C,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,P.jsx)(D,{value:e.name,children:e.displayName},e.name)):(0,P.jsx)(D,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:p?.description||`Choose where to store maps, plans, and knowledge files. Centralized vault keeps repositories 100% clean and allows Obsidian integration.`})]}),(()=>{let n=e.storageProvider||`local`,r=i.find(e=>e.name===n);return r?.configFields?.length?(0,P.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,P.jsxs)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[r.displayName,` Settings`]}),r.configFields.map(r=>{let i=e.adapterConfig?.[n]?.[r.key]??r.default??``,a=i=>{let a={...e.adapterConfig||{},[n]:{...e.adapterConfig?.[n]||{},[r.key]:i}};t({...e,adapterConfig:a})};return r.type===`boolean`?(0,P.jsxs)(M,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,P.jsx)(H,{checked:!!i,onCheckedChange:e=>a(e)}),(0,P.jsxs)(`span`,{className:`flex flex-col`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,P.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:r.label}),(0,P.jsx)(h,{type:r.type===`number`?`number`:`text`,value:i,onChange:e=>{let t=r.type===`number`?Number(e.target.value):e.target.value;a(t)}}),r.description&&(0,P.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,P.jsxs)(j,{className:`mt-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:[(0,P.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,P.jsxs)(b,{variant:`outline`,size:`sm`,onClick:()=>u(!0),disabled:c,children:[c?(0,P.jsx)(k,{className:`size-3`}):(0,P.jsx)(O,{size:13}),c?`Checking...`:`Check Now`]})]}),c&&s.length===0?(0,P.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,P.jsx)(k,{className:`size-6`}),(0,P.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,P.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,P.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,P.jsx)(A,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,P.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[`Installed version: `,(0,P.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,P.jsxs)(`span`,{children:[`Latest: `,(0,P.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,P.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,P.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,P.jsx)(b,{size:`sm`,onClick:()=>d(e.id),disabled:l!==null,children:l===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(k,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(A,{variant:`success`,className:`gap-1.5`,children:[(0,P.jsx)(S,{size:12}),` Up to Date`]}),(0,P.jsx)(b,{variant:`outline`,size:`sm`,onClick:()=>d(e.id),disabled:l!==null,children:l===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(k,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,P.jsx)(b,{variant:`outline`,size:`sm`,onClick:()=>d(e.id),disabled:l!==null,children:l===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(k,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,P.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,P.jsxs)(b,{onClick:()=>a(e),disabled:!o,children:[(0,P.jsx)(S,{size:16}),` Save Configuration`]})})]})}export{U as SettingsPage};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{t as r}from"./input-LtE7Sz4D.js";import{$ as i,A as a,B as ee,D as te,G as ne,M as re,O as ie,et as ae,f as oe,m as se,p as ce,r as le,z as ue}from"./queries-CtxmqmGJ.js";import{h as o,m as s,t as c}from"./button-BrcP8Wxx.js";import{t as de}from"./chevron-down-Dy03VL1q.js";import{t as l}from"./cpu-Y6k3dlHb.js";import{a as fe,i as pe,n as me,o as he,r as ge,s as u,t as _e}from"./square-check-big-DpHMT26q.js";import{t as d}from"./shield-check-FLrrAOFP.js";import{t as f}from"./trash-2-BrrLX4tD.js";import{B as ve,C as p,D as m,Gt as ye,It as be,Kt as xe,O as h,Pt as g,S as _,T as v,Tt as Se,Vt as Ce,bt as we,mt as Te,pt as Ee,qt as y,vt as b,w as x,x as De,xt as Oe}from"./index-qvc4aLwP.js";import{t as S}from"./badge-DQIZRRDZ.js";import{t as ke}from"./card-BMggHY3n.js";import{a as Ae,i as je,n as Me,r as Ne,t as Pe}from"./empty-DK2eW2rF.js";import{t as C}from"./label-C610MHwq.js";import{t as Fe}from"./textarea-0lXkxsuX.js";var Ie=o(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),Le=o(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Re=o(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),w=e(t(),1),T=n(),E={"git-pull-request":pe,"flask-conical":fe,package:ge,database:u,"shield-check":d,terminal:b,zap:Ee,cpu:l,layers:g,boxes:y,code:Ce},ze=[{label:`Blue`,value:`#3b82f6`},{label:`Green`,value:`#10b981`},{label:`Purple`,value:`#8b5cf6`},{label:`Amber`,value:`#f59e0b`},{label:`Red`,value:`#ef4444`},{label:`Cyan`,value:`#06b6d4`},{label:`Pink`,value:`#ec4899`},{label:`Emerald`,value:`#059669`}];function D({showToast:e}){let[t,n]=(0,w.useState)(`global`),[o,l]=(0,w.useState)(``),[fe,pe]=(0,w.useState)({}),[ge,u]=(0,w.useState)(!1),[d,g]=(0,w.useState)(null),[Ee,b]=(0,w.useState)(!1),[D,O]=(0,w.useState)(null),[Be,k]=(0,w.useState)(!1),[Ve,He]=(0,w.useState)(`edit`),[A,j]=(0,w.useState)(`global`),[M,N]=(0,w.useState)(``),[Ue,P]=(0,w.useState)(!1),[F,I]=(0,w.useState)(null),[We,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(null),[Ge,Ke]=(0,w.useState)(null),[qe,B]=(0,w.useState)(null),{data:V=[],isLoading:Je}=a(),{data:H=[],isLoading:Ye}=re(t===`global`?void 0:t),{data:U=[]}=ee(),{data:Xe=[]}=se(),{data:W,isLoading:Ze,isError:Qe}=ue(t===`global`?``:t),[G,K]=(0,w.useState)(null),$e=Array.from(new Set(Xe.flatMap(e=>[e.id,...e.tags||[]]).concat([`git`,`pr`,`testing`,`security`,`performance`,`database`,`ci-cd`,`frontend`,`backend`]).filter(Boolean))).slice(0,24),et=ie(),tt=ce(),q=te(),nt=oe(),J=le(),Y=t!==`global`,X=new Set(G??W?.enabledSkills??[]),Z=!Y||!Ze&&!Qe&&!!W;(0,w.useEffect)(()=>{if(!Y){K(null);return}W&&K([...W.enabledSkills])},[Y,t,W]);let rt=e=>{pe(t=>({...t,[e]:!t[e]}))},Q=H.filter(e=>{if(!o.trim())return!0;let t=o.toLowerCase();return e.title?.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags?.some(e=>e.toLowerCase().includes(t))}),it=V.reduce((e,t)=>(e[t.id]=Q.filter(e=>e.category===t.id),e),{}),at=Q.filter(e=>!e.category||!V.some(t=>t.id===e.category)),ot=e=>{g(e||{name:``,description:``,icon:`boxes`,color:`#3b82f6`,custom:!0}),u(!0)},st=async()=>{if(!(!d||!d.name?.trim()))try{await et.mutateAsync({id:d.id,name:d.name.trim(),description:d.description,icon:d.icon,color:d.color}),e?.(`Category saved successfully`,`success`),u(!1),g(null)}catch(t){e?.(`Failed to save category`,`error`),console.error(t)}},ct=(e,t)=>{t.stopPropagation(),z({type:`category`,id:e.id,title:e.name}),L(!0)},$=(e,n)=>{let r=e?.scope??(Y?`workspace`:`global`);j(r),N(Y?t:U[0]?.id||``),O(e||{name:``,title:``,category:n||(V[0]?.id??`pull-requests`),description:``,tags:[],allowedTools:[],content:`# Skill Title
|
|
2
|
+
|
|
3
|
+
Instructions and playbook for the AI assistant.
|
|
4
|
+
`,custom:!0,scope:r}),k(!!e),He(`edit`),b(!0)};(0,w.useEffect)(()=>{!M&&U.length>0&&N(U[0].id)},[U,M]);let lt=e=>{if(!D)return;let t={...D,title:e};!Be&&!D.id&&(t.name=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)),O(t)},ut=async()=>{if(!D||!D.name?.trim()||!D.description?.trim()||!D.content?.trim()){e?.(`Skill name, trigger description, and content are required`,`error`);return}if(A===`workspace`&&!M){e?.(`Please select a target workspace for workspace-local skill`,`error`);return}try{await q.mutateAsync({id:D.id,name:D.name.trim(),title:D.title||D.name,category:D.category||`general`,description:D.description||``,tags:D.tags||[],allowedTools:D.allowedTools||[],content:D.content,scope:A,workspaceId:A===`workspace`?M:void 0}),e?.(A===`workspace`?`Workspace skill saved successfully in .agents/skills/`:`Global skill package saved successfully`,`success`),b(!1),O(null)}catch(t){e?.(t?.message||`Failed to save skill`,`error`),console.error(t)}},dt=(e,n)=>{n.stopPropagation();let r=e.scope===`workspace`||A===`workspace`?t===`global`?M||void 0:t:void 0;z({type:`skill`,id:e.id,title:e.title||e.name,workspaceId:r}),L(!0)},ft=async()=>{if(R)try{R.type===`category`?(await tt.mutateAsync(R.id),e?.(`Category deleted`,`info`)):(await nt.mutateAsync({id:R.id,workspaceId:R.workspaceId}),e?.(`Skill package deleted`,`info`)),L(!1),z(null)}catch(t){e?.(t?.message||`Failed to delete item`,`error`),console.error(t)}},pt=e=>{if(!Y||!Z||G===null)return;let t=new Set(G);t.has(e)?t.delete(e):t.add(e),K(Array.from(t))},mt=()=>{if(!D||D.custom!==!1)return;let e=`${D.name}-copy`;O({...D,id:void 0,name:e,title:`${D.title||D.name} Copy`,allowedTools:[],custom:!0,sourcePath:void 0,references:void 0,scripts:void 0}),k(!0)},ht=(e,t)=>{if(!Y||!Z||G===null)return;let n=it[e]||[],r=new Set(G);for(let e of n)t?r.add(e.id):r.delete(e.id);K(Array.from(r))},gt=async()=>{if(!(!W||G===null||!Y))try{await J.mutateAsync({workspaceId:t,expectedRevision:W.revision??0,enabledSkills:G,enabledAgents:W.enabledAgents??[],enabledCategories:V.map(e=>e.id)}),e?.(`Skill selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save skill selection`,`error`)}},_t=(e,t)=>{e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`,Ke(t)},vt=(e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,qe!==t&&B(t)},yt=()=>{B(null)},bt=async(t,n)=>{t.preventDefault(),B(null);let r=t.dataTransfer.getData(`text/plain`)||Ge;if(Ke(null),!r)return;let i=H.find(e=>e.id===r);!i||!i.custom||Y||i.category===n||(await q.mutateAsync({id:i.id,name:i.name,title:i.title,description:i.description,tags:i.tags,allowedTools:i.allowedTools,content:i.content,category:n}),e?.(`Skill re-categorized`,`success`))},xt=(e,t)=>{t.stopPropagation(),I(e),P(!0)},St=async t=>{if(!F||F.category===t){P(!1),I(null);return}await q.mutateAsync({id:F.id,name:F.name,title:F.title,description:F.description,tags:F.tags,allowedTools:F.allowedTools,content:F.content,category:t}),e?.(`Skill moved to category`,`success`),P(!1),I(null)};return(0,T.jsxs)(`div`,{className:`flex-1 flex flex-col h-full overflow-hidden bg-background text-foreground`,children:[(0,T.jsxs)(`div`,{className:`p-6 border-b border-border flex flex-col sm:flex-row sm:items-center justify-between gap-4 bg-card/40 backdrop-blur-sm`,children:[(0,T.jsx)(`div`,{children:(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`p-2 rounded-xl bg-primary/10 text-primary`,children:(0,T.jsx)(y,{className:`h-6 w-6`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Skill Library`}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create, organize, and assign reusable Agent Skill packages.`})]})]})}),(0,T.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,T.jsx)(c,{render:(0,T.jsx)(ne,{to:`/agents`}),variant:`outline`,size:`sm`,children:`Codex Agents`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 bg-muted/50 rounded-lg px-3 py-1.5 border border-border`,children:[(0,T.jsx)(ae,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(C,{htmlFor:`skill-scope`,className:`text-xs font-medium text-muted-foreground`,children:`Scope:`}),(0,T.jsxs)(`select`,{id:`skill-scope`,value:t,onChange:e=>n(e.target.value),className:`bg-transparent text-xs font-semibold focus:outline-none cursor-pointer text-foreground`,children:[(0,T.jsx)(`option`,{value:`global`,className:`bg-popover text-popover-foreground`,children:`🌐 Global Skills Catalog`}),U.map(e=>(0,T.jsxs)(`option`,{value:e.id,className:`bg-popover text-popover-foreground`,children:[`📁 `,e.id,` (`,e.branchName,`)`]},e.id))]})]}),!Y&&(0,T.jsxs)(c,{variant:`outline`,size:`sm`,onClick:()=>ot(),className:`flex items-center gap-1.5`,children:[(0,T.jsx)(Se,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:`New Category`})]}),Y&&(0,T.jsx)(c,{size:`sm`,onClick:gt,disabled:!Z||J.isPending||G===null,children:J.isPending?`Saving…`:`Save selection`}),(0,T.jsxs)(c,{variant:`default`,size:`sm`,onClick:()=>$(),className:`flex items-center gap-1.5`,children:[(0,T.jsx)(Oe,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:`New Skill`})]})]})]}),(0,T.jsxs)(`div`,{className:`px-6 py-3 border-b border-border/60 bg-muted/20 flex items-center justify-between gap-4`,children:[(0,T.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,T.jsx)(i,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,T.jsx)(r,{value:o,onChange:e=>l(e.target.value),placeholder:`Search skills by keyword, tag, or tool...`,className:`pl-9 pr-8 h-9 text-xs`}),o&&(0,T.jsx)(`button`,{onClick:()=>l(``),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,T.jsx)(Te,{className:`h-3.5 w-3.5`})})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,T.jsxs)(`span`,{children:[`Showing `,(0,T.jsx)(`strong`,{className:`text-foreground`,children:Q.length}),` of`,` `,(0,T.jsx)(`strong`,{className:`text-foreground`,children:H.length}),` skills`]}),Y&&(0,T.jsxs)(S,{variant:`secondary`,className:`text-[10px] uppercase font-mono`,children:[`Workspace Mode (`,X.size,` active)`]})]})]}),(0,T.jsx)(ve,{className:`flex-1 p-6`,children:Je||Ye||Y&&Ze?(0,T.jsxs)(`div`,{className:`flex items-center justify-center p-12 gap-3 text-muted-foreground`,children:[(0,T.jsx)(De,{}),(0,T.jsx)(`span`,{className:`text-sm`,children:`Loading skills catalog...`})]}):Y&&Qe?(0,T.jsx)(Pe,{className:`py-12 border border-dashed rounded-xl`,children:(0,T.jsxs)(Ne,{children:[(0,T.jsx)(Ae,{children:`Workspace resources could not be loaded`}),(0,T.jsx)(Me,{children:`Assignment controls are disabled so an existing selection cannot be overwritten.`})]})}):Q.length===0&&o?(0,T.jsxs)(Pe,{className:`py-12 border border-dashed rounded-xl`,children:[(0,T.jsx)(je,{children:(0,T.jsx)(i,{className:`h-8 w-8 text-muted-foreground/60`})}),(0,T.jsxs)(Ne,{children:[(0,T.jsx)(Ae,{children:`No matching skills found`}),(0,T.jsxs)(Me,{children:[`No skills matched your search query "`,o,`".`]})]}),(0,T.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>l(``),children:`Clear Search`})]}):(0,T.jsxs)(`div`,{className:`space-y-6 max-w-7xl mx-auto pb-12`,children:[V.map(e=>{let t=E[e.icon||`boxes`]||y,n=it[e.id]||[],r=!!fe[e.id],i=qe===e.id,a=n.length>0&&n.every(e=>X.has(e.id));return(0,T.jsxs)(`div`,{onDragOver:t=>vt(t,e.id),onDragLeave:yt,onDrop:t=>bt(t,e.id),className:s(`border rounded-xl transition-all duration-150 overflow-hidden bg-card/60`,i?`border-primary ring-2 ring-primary/20 bg-primary/5`:`border-border`),children:[(0,T.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":!r,onClick:()=>rt(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),rt(e.id))},className:`p-4 flex items-center justify-between cursor-pointer hover:bg-muted/40 transition-colors border-b border-border/40 select-none`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`p-2 rounded-lg text-white shadow-sm flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,T.jsx)(t,{className:`h-4 w-4`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`h2`,{className:`font-semibold text-sm tracking-tight`,children:e.name}),(0,T.jsxs)(S,{variant:`outline`,className:`text-[10px] px-1.5 py-0`,children:[n.length,` `,n.length===1?`skill`:`skills`]}),e.isTemplate&&!e.custom&&(0,T.jsx)(S,{variant:`secondary`,className:`text-[9px] px-1 py-0 uppercase`,children:`Template`})]}),e.description&&(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[Y&&n.length>0&&(0,T.jsxs)(c,{variant:`ghost`,size:`xs`,onClick:()=>ht(e.id,!a),className:`h-7 text-xs mr-2 text-muted-foreground hover:text-foreground`,title:a?`Deselect all in category`:`Select all in category`,children:[a?(0,T.jsx)(_e,{className:`h-3.5 w-3.5 mr-1 text-primary`}):(0,T.jsx)(we,{className:`h-3.5 w-3.5 mr-1`}),(0,T.jsx)(`span`,{children:a?`Deselect All`:`Select All`})]}),!Y&&(0,T.jsx)(c,{variant:`ghost`,size:`icon-xs`,onClick:()=>$(void 0,e.id),title:`Add skill to this category`,children:(0,T.jsx)(Se,{className:`h-3.5 w-3.5`})}),!Y&&(0,T.jsx)(c,{variant:`ghost`,size:`icon-xs`,onClick:()=>ot(e),title:`Edit category`,children:(0,T.jsx)(me,{className:`h-3 w-3`})}),!Y&&e.custom&&(0,T.jsx)(c,{variant:`ghost`,size:`icon-xs`,onClick:t=>ct(e,t),title:`Delete category`,className:`text-destructive hover:text-destructive`,children:(0,T.jsx)(f,{className:`h-3 w-3`})}),(0,T.jsx)(`div`,{className:`p-1 text-muted-foreground`,children:r?(0,T.jsx)(ye,{className:`h-4 w-4`}):(0,T.jsx)(de,{className:`h-4 w-4`})})]})]}),!r&&(0,T.jsx)(`div`,{className:`p-4 bg-background/50`,children:n.length===0?(0,T.jsxs)(`div`,{className:`border border-dashed border-border/80 rounded-lg p-6 text-center text-xs text-muted-foreground`,children:[`No skills in this category.`,!Y&&(0,T.jsxs)(T.Fragment,{children:[` `,`Drag a custom skill here, or click`,` `,(0,T.jsx)(`button`,{onClick:()=>$(void 0,e.id),className:`text-primary underline font-medium`,children:`+ Add Skill`})]})]}):(0,T.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3.5`,children:n.map(e=>{let t=X.has(e.id);return(0,T.jsxs)(ke,{draggable:!Y&&!!e.custom,onDragStart:t=>{!Y&&e.custom&&_t(t,e.id)},onClick:()=>$(e),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),$(e))},className:s(`group relative cursor-pointer hover:border-primary/60 transition-all p-3.5 flex flex-col justify-between select-none shadow-sm`,Y&&!t&&`opacity-60 bg-muted/20`,Ge===e.id&&`opacity-40 border-dashed`),children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground group-hover:text-foreground cursor-grab active:cursor-grabbing`,title:`Drag to reorder or re-categorize`,"aria-label":`Drag handle`,children:[(0,T.jsx)(Le,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{className:`font-mono text-xs font-bold text-foreground`,children:e.title||e.name})]}),Y?(0,T.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{variant:`outline`,className:s(`text-[9px] font-mono px-1 py-0.2 uppercase`,e.scope===`workspace`?`border-amber-500/40 text-amber-300 bg-amber-500/10`:`border-blue-500/40 text-blue-300 bg-blue-500/10`),children:e.scope===`workspace`?`Workspace`:`Global`}),(0,T.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),pt(e.id)},disabled:!Z||J.isPending,className:s(`h-5 px-2 rounded-md flex items-center gap-1 text-[10px] font-semibold transition-colors`,t?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-muted/80`),children:[(0,T.jsx)(xe,{className:s(`h-3 w-3`,!t&&`opacity-0`)}),(0,T.jsx)(`span`,{children:t?`Enabled`:`Disabled`})]})]}):(0,T.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{variant:`outline`,className:s(`text-[9px] font-mono px-1 py-0.2 uppercase`,e.scope===`workspace`?`border-amber-500/40 text-amber-300 bg-amber-500/10`:`border-blue-500/40 text-blue-300 bg-blue-500/10`),children:e.scope===`workspace`?`Workspace`:`Global`}),(0,T.jsx)(S,{variant:`outline`,className:`text-[10px] font-mono`,children:e.custom?`Custom`:`Template`})]})]}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2 mb-3 leading-relaxed`,children:e.description||`No description provided.`})]}),(0,T.jsxs)(`div`,{className:`pt-2 border-t border-border/40 flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap overflow-hidden`,children:[e.tags?.slice(0,3).map(e=>(0,T.jsxs)(`span`,{className:`text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded text-muted-foreground`,children:[`#`,e]},e)),e.allowedTools&&e.allowedTools.length>0&&(0,T.jsxs)(`span`,{className:`text-[10px] text-muted-foreground flex items-center gap-0.5 font-mono`,children:[(0,T.jsx)(Re,{className:`h-2.5 w-2.5`}),e.allowedTools.length]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[!Y&&e.custom&&(0,T.jsx)(c,{variant:`ghost`,size:`icon-xs`,onClick:t=>xt(e,t),title:`Move to another category`,className:`h-6 w-6 text-muted-foreground hover:text-foreground`,children:(0,T.jsx)(Ie,{className:`h-3 w-3`})}),e.custom&&(0,T.jsx)(c,{variant:`ghost`,size:`icon-xs`,onClick:t=>dt(e,t),title:`Delete skill`,className:`h-6 w-6 text-destructive hover:text-destructive cursor-pointer`,children:(0,T.jsx)(f,{className:`h-3 w-3`})})]})]})]},e.id)})})})]},e.id)}),at.length>0&&(0,T.jsxs)(`div`,{className:`border border-border/80 rounded-xl overflow-hidden bg-card/60`,children:[(0,T.jsx)(`div`,{className:`p-4 bg-muted/30 border-b border-border/40 flex items-center justify-between`,children:(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(y,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(`h2`,{className:`font-semibold text-sm`,children:`Uncategorized Skills`}),(0,T.jsx)(S,{variant:`outline`,className:`text-[10px]`,children:at.length})]})}),(0,T.jsx)(`div`,{className:`p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3.5`,children:at.map(e=>(0,T.jsxs)(ke,{onClick:()=>$(e),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),$(e))},className:`p-3.5 cursor-pointer hover:border-primary/60 flex flex-col justify-between`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,T.jsx)(`div`,{className:`font-mono text-xs font-bold`,children:e.title||e.name}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{variant:`outline`,className:s(`text-[9px] font-mono px-1 py-0.2 uppercase`,e.scope===`workspace`?`border-amber-500/40 text-amber-300 bg-amber-500/10`:`border-blue-500/40 text-blue-300 bg-blue-500/10`),children:e.scope===`workspace`?`Workspace`:`Global`}),Y&&(0,T.jsx)(c,{size:`xs`,variant:X.has(e.id)?`default`:`outline`,disabled:!Z||J.isPending,onClick:t=>{t.stopPropagation(),pt(e.id)},children:X.has(e.id)?`Enabled`:`Disabled`})]})]}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:e.description})]}),(0,T.jsxs)(`div`,{className:`pt-2 mt-2 border-t border-border/40 flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap overflow-hidden`,children:[e.tags&&e.tags.length>0?e.tags.slice(0,3).map(e=>(0,T.jsxs)(`span`,{className:`text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded text-muted-foreground`,children:[`#`,e]},e)):(0,T.jsx)(`span`,{className:`text-[10px] text-muted-foreground italic`,children:`No tags`}),e.allowedTools&&e.allowedTools.length>0&&(0,T.jsxs)(`span`,{className:`text-[10px] text-muted-foreground flex items-center gap-0.5 font-mono`,children:[(0,T.jsx)(Re,{className:`h-2.5 w-2.5`}),e.allowedTools.length]})]}),e.custom&&(0,T.jsx)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:(0,T.jsx)(c,{variant:`ghost`,size:`icon-xs`,onClick:t=>dt(e,t),title:`Delete skill`,className:`h-6 w-6 text-destructive hover:text-destructive cursor-pointer`,children:(0,T.jsx)(f,{className:`h-3 w-3`})})})]})]},e.id))})]})]})}),(0,T.jsx)(_,{open:ge,onOpenChange:u,children:(0,T.jsxs)(m,{className:`sm:max-w-lg`,children:[(0,T.jsxs)(v,{children:[(0,T.jsx)(h,{children:d?.id?`Edit Skill Category`:`Create Skill Category`}),(0,T.jsx)(p,{children:`Categories group related procedural skills and agent tools into clean visual boxes.`})]}),(0,T.jsxs)(`div`,{className:`space-y-4 py-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`cat-name`,className:`text-xs font-medium`,children:`Category Name`}),(0,T.jsx)(r,{id:`cat-name`,value:d?.name||``,onChange:e=>g(t=>t?{...t,name:e.target.value}:null),placeholder:`e.g. Pull Requests & Review`,className:`mt-1 text-xs`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`cat-desc`,className:`text-xs font-medium`,children:`Description`}),(0,T.jsx)(r,{id:`cat-desc`,value:d?.description||``,onChange:e=>g(t=>t?{...t,description:e.target.value}:null),placeholder:`Brief summary of what skills belong in this box...`,className:`mt-1 text-xs`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{className:`text-xs font-medium`,children:`Icon`}),(0,T.jsx)(`div`,{className:`grid grid-cols-6 gap-2 mt-1.5`,children:Object.keys(E).map(e=>{let t=E[e],n=(d?.icon||`boxes`)===e;return(0,T.jsx)(`button`,{type:`button`,onClick:()=>g(t=>t?{...t,icon:e}:null),className:s(`p-2.5 rounded-lg border flex items-center justify-center transition-colors`,n?`border-primary bg-primary/10 text-primary`:`border-border hover:bg-muted text-muted-foreground`),children:(0,T.jsx)(t,{className:`h-4 w-4`})},e)})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{className:`text-xs font-medium`,children:`Color Accent`}),(0,T.jsx)(`div`,{className:`flex items-center gap-2 mt-1.5 flex-wrap`,children:ze.map(e=>{let t=d?.color===e.value;return(0,T.jsx)(`button`,{type:`button`,"aria-label":`Select color ${e.label}`,onClick:()=>g(t=>t?{...t,color:e.value}:null),className:s(`w-7 h-7 rounded-full transition-transform flex items-center justify-center shadow-sm`,t?`scale-110 ring-2 ring-primary ring-offset-2`:`hover:scale-105`),style:{backgroundColor:e.value},children:t&&(0,T.jsx)(xe,{className:`h-3.5 w-3.5 text-white`})},e.value)})})]})]}),(0,T.jsxs)(x,{children:[(0,T.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>u(!1),children:`Cancel`}),(0,T.jsx)(c,{variant:`default`,size:`sm`,onClick:st,disabled:!d?.name?.trim(),children:`Save Category`})]})]})}),(0,T.jsx)(_,{open:Ee,onOpenChange:b,children:(0,T.jsxs)(m,{className:`max-w-[96vw] sm:max-w-5xl lg:max-w-6xl xl:max-w-7xl h-[90vh] max-h-[92vh] flex flex-col p-6`,children:[(0,T.jsx)(v,{className:`pb-3 border-b border-border/70 shrink-0`,children:(0,T.jsxs)(`div`,{className:`flex items-center justify-between pr-8`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(h,{className:`text-base font-bold flex items-center gap-2`,children:[(0,T.jsx)(Oe,{className:`h-4 w-4 text-primary`}),(0,T.jsx)(`span`,{children:D?.id?`Edit Skill Package`:`Create New Skill`})]}),(0,T.jsx)(p,{className:`text-xs text-muted-foreground mt-0.5`,children:`Configure SKILL.md metadata triggers and markdown playbook instructions.`})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1 bg-muted/60 p-1 rounded-lg border border-border text-xs`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>He(`edit`),className:s(`px-3 py-1.5 rounded-md flex items-center gap-1.5 font-medium transition-colors cursor-pointer`,Ve===`edit`?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,T.jsx)(be,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:`Edit`})]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>He(`preview`),className:s(`px-3 py-1.5 rounded-md flex items-center gap-1.5 font-medium transition-colors cursor-pointer`,Ve===`preview`?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,T.jsx)(he,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:`Preview`})]})]})]})}),(0,T.jsxs)(`div`,{className:`flex-1 min-h-0 py-4 flex flex-col lg:flex-row gap-6 overflow-hidden`,children:[(0,T.jsxs)(`div`,{className:`lg:w-[420px] xl:w-[460px] shrink-0 flex flex-col gap-4 overflow-y-auto pr-2 pb-2`,children:[(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`skill-title`,className:`text-xs font-medium`,children:`Display Title`}),(0,T.jsx)(r,{id:`skill-title`,value:D?.title||``,onChange:e=>lt(e.target.value),placeholder:`e.g. Pull Request Reviewer`,className:`mt-1 text-xs`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`skill-name`,className:`text-xs font-medium`,children:`Identifier (Slug)`}),(0,T.jsx)(r,{id:`skill-name`,value:D?.name||``,disabled:!!D?.id,onChange:e=>{k(!0),O(t=>t?{...t,name:e.target.value}:null)},placeholder:`e.g. pr-review-toolkit`,className:`mt-1 text-xs font-mono`})]})]}),(0,T.jsxs)(`div`,{className:`p-3 rounded-lg border border-border/80 bg-muted/20 space-y-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsxs)(C,{className:`text-xs font-semibold text-foreground flex items-center gap-1.5`,children:[(0,T.jsx)(y,{className:`h-3.5 w-3.5 text-primary`}),(0,T.jsx)(`span`,{children:`Skill Scope`})]}),(0,T.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:A===`global`?`Machine-wide catalog`:`Project-specific (.agents/skills/)`})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,T.jsx)(`button`,{type:`button`,onClick:()=>j(`global`),className:s(`flex items-center justify-center gap-2 p-2 rounded-lg border text-xs font-medium transition-all cursor-pointer`,A===`global`?`border-blue-500/50 bg-blue-500/15 text-blue-300 font-semibold shadow-xs`:`border-border/60 bg-card/60 text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:(0,T.jsx)(`span`,{children:`🌐 Global Catalog`})}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>j(`workspace`),className:s(`flex items-center justify-center gap-2 p-2 rounded-lg border text-xs font-medium transition-all cursor-pointer`,A===`workspace`?`border-amber-500/50 bg-amber-500/15 text-amber-300 font-semibold shadow-xs`:`border-border/60 bg-card/60 text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:(0,T.jsx)(`span`,{children:`📁 Workspace-Local`})})]}),A===`workspace`&&(0,T.jsxs)(`div`,{className:`pt-1`,children:[(0,T.jsx)(C,{htmlFor:`target-ws`,className:`text-[11px] font-medium text-muted-foreground`,children:`Target Workspace:`}),U.length>0?(0,T.jsx)(`select`,{id:`target-ws`,value:M,onChange:e=>N(e.target.value),className:`mt-1 w-full bg-background border border-border rounded-md px-3 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-primary text-foreground`,children:U.map(e=>(0,T.jsxs)(`option`,{value:e.id,children:[`📁 `,e.id,` (`,e.branchName,`)`]},e.id))}):(0,T.jsx)(`div`,{className:`mt-1 text-xs text-destructive italic`,children:`No active workspaces found. Please create a workspace first.`})]})]}),(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`skill-cat`,className:`text-xs font-medium`,children:`Category Box`}),(0,T.jsx)(`select`,{id:`skill-cat`,value:D?.category||``,onChange:e=>O(t=>t?{...t,category:e.target.value}:null),className:`mt-1 w-full bg-background border border-border rounded-md px-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-primary`,children:V.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(C,{htmlFor:`skill-tags`,className:`text-xs font-medium`,children:`Tags & Domain Categories`}),(0,T.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`Click chips below to toggle`})]}),(0,T.jsx)(r,{id:`skill-tags`,value:D?.tags?.join(`, `)||``,onChange:e=>O(t=>t?{...t,tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}:null),placeholder:`e.g. nexusflow, core, cli, testing`,className:`mt-1 text-xs font-mono`})]}),$e.length>0&&(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Quick Tag Assignment:`}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1 max-h-24 overflow-y-auto pr-1`,children:$e.map(e=>{let t=D?.tags?.includes(e);return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>{O(n=>{if(!n)return null;let r=n.tags||[],i=t?r.filter(t=>t!==e):[...r,e];return{...n,tags:i}})},className:s(`px-2 py-0.5 rounded-md text-[11px] font-mono transition-colors cursor-pointer border`,t?`bg-primary/20 text-primary border-primary/40 font-semibold shadow-xs`:`bg-muted/40 text-muted-foreground border-border/60 hover:bg-muted hover:text-foreground`),children:[`#`,e]},e)})})]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`skill-desc`,className:`text-xs font-medium`,children:`Trigger Description (for AI Autonomous Discovery)`}),(0,T.jsx)(Fe,{id:`skill-desc`,rows:3,value:D?.description||``,onChange:e=>O(t=>t?{...t,description:e.target.value}:null),placeholder:`e.g. Use when reviewing PR diffs or when user asks for a PR audit...`,className:`mt-1 text-xs leading-relaxed resize-none`})]})]}),(0,T.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-[380px] lg:min-h-0 border-t lg:border-t-0 lg:border-l border-border/70 pt-4 lg:pt-0 lg:pl-6`,children:Ve===`edit`?(0,T.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 h-full`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between pb-2 shrink-0`,children:[(0,T.jsxs)(C,{htmlFor:`skill-content`,className:`text-xs font-semibold flex items-center gap-1.5`,children:[(0,T.jsx)(Ce,{className:`h-3.5 w-3.5 text-primary`}),(0,T.jsx)(`span`,{children:`Playbook Instructions (Markdown)`})]}),(0,T.jsxs)(`span`,{className:`text-[10px] text-muted-foreground font-mono`,children:[(D?.content||``).split(`
|
|
5
|
+
`).length,` lines · `,(D?.content||``).length,` characters`]})]}),(0,T.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-2 leading-relaxed`,children:[`Frontmatter (`,(0,T.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`name`}),`,`,` `,(0,T.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`description`}),`,`,` `,(0,T.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`tags`}),`) is managed in the Metadata panel on the left and auto-injected into`,` `,(0,T.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`SKILL.md`}),` on save.`]}),(0,T.jsx)(Fe,{id:`skill-content`,value:D?.content||``,onChange:e=>O(t=>t?{...t,content:e.target.value}:null),placeholder:`# Playbook Title
|
|
6
|
+
|
|
7
|
+
Detailed instructions for the AI assistant...`,className:`flex-1 w-full min-h-[360px] lg:min-h-full font-mono text-xs leading-relaxed resize-none focus:ring-1 focus:ring-primary`})]}):(0,T.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 h-full`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between pb-2 shrink-0`,children:[(0,T.jsxs)(`span`,{className:`text-xs font-semibold flex items-center gap-1.5 text-foreground`,children:[(0,T.jsx)(he,{className:`h-3.5 w-3.5 text-primary`}),(0,T.jsx)(`span`,{children:`Documentation Preview`})]}),(0,T.jsx)(S,{variant:`outline`,className:`text-[10px] font-mono`,children:`SKILL.md`})]}),(0,T.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-5 border rounded-lg bg-card/40 prose prose-sm dark:prose-invert max-w-none`,children:[(0,T.jsxs)(`div`,{className:`mb-4 pb-3 border-b border-border/70`,children:[(0,T.jsx)(`h2`,{className:`text-lg font-bold m-0 text-foreground`,children:D?.title||D?.name}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground m-0 mt-1`,children:D?.description}),D?.tags&&D.tags.length>0&&(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2.5`,children:D.tags.map(e=>(0,T.jsxs)(`span`,{className:`px-2 py-0.5 rounded bg-muted text-[11px] font-mono text-muted-foreground`,children:[`#`,e]},e))})]}),(0,T.jsx)(`pre`,{className:`text-xs whitespace-pre-wrap font-sans bg-transparent p-0 border-0 leading-relaxed`,children:D?.content||`*(No playbook markdown provided)*`})]})]})})]}),(0,T.jsxs)(x,{className:`mt-4 pt-3 border-t flex items-center justify-between sm:justify-between w-full`,children:[(0,T.jsx)(`div`,{children:D?.id&&D?.custom&&(0,T.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:e=>{let t=D;b(!1),dt(t,e)},className:`text-destructive hover:bg-destructive/10 border-destructive/30 text-xs gap-1.5`,children:[(0,T.jsx)(f,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:`Delete Skill`})]})}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>b(!1),children:`Cancel`}),(0,T.jsx)(c,{variant:`default`,size:`sm`,onClick:D?.custom===!1?mt:ut,disabled:!D?.name?.trim()||!D?.description?.trim()||!D?.content?.trim(),children:D?.custom===!1?`Create editable copy`:`Save Skill`})]})]})]})}),(0,T.jsx)(_,{open:Ue,onOpenChange:P,children:(0,T.jsxs)(m,{className:`sm:max-w-md`,children:[(0,T.jsxs)(v,{children:[(0,T.jsx)(h,{children:`Move Skill to Category`}),(0,T.jsxs)(p,{children:[`Select the destination category box for "`,F?.title||F?.name,`".`]})]}),(0,T.jsx)(`div`,{className:`space-y-2 py-2`,children:V.map(e=>{let t=E[e.icon||`boxes`]||y,n=F?.category===e.id;return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>St(e.id),className:s(`w-full p-3 rounded-lg border text-left flex items-center justify-between transition-colors`,n?`border-primary bg-primary/10`:`border-border hover:bg-muted/50 text-foreground`),children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`p-1.5 rounded text-white flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,T.jsx)(t,{className:`h-4 w-4`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`font-semibold text-xs`,children:e.name}),e.description&&(0,T.jsx)(`div`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),n&&(0,T.jsx)(S,{variant:`secondary`,className:`text-[10px]`,children:`Current`})]},e.id)})}),(0,T.jsx)(x,{children:(0,T.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>P(!1),children:`Cancel`})})]})}),(0,T.jsx)(_,{open:We,onOpenChange:L,children:(0,T.jsxs)(m,{className:`sm:max-w-md`,children:[(0,T.jsxs)(v,{children:[(0,T.jsxs)(h,{className:`text-destructive`,children:[`Delete `,R?.type===`category`?`Category`:R?.workspaceId?`Workspace Skill`:`Global Skill`]}),(0,T.jsxs)(p,{children:[`Are you sure you want to delete "`,R?.title,`"`,R?.workspaceId?` from workspace "${R.workspaceId}"`:``,`? This action cannot be undone.`]})]}),(0,T.jsxs)(x,{className:`mt-4`,children:[(0,T.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>L(!1),children:`Cancel`}),(0,T.jsx)(c,{variant:`destructive`,size:`sm`,onClick:ft,children:`Delete Permanently`})]})]})})]})}export{D as SkillsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{t as r}from"./input-LtE7Sz4D.js";import{C as i,F as a,G as o,H as s,L as c,M as l,P as ee,Q as u,S as d,Z as f,a as p,b as m,c as h,et as te,i as g,m as _,n as ne,t as re,vt as v,w as ie,y as ae}from"./queries-CtxmqmGJ.js";import{h as y,m as b,t as x}from"./button-BrcP8Wxx.js";import{t as oe}from"./bot-D5yM1Tw6.js";import{t as se}from"./chevron-down-Dy03VL1q.js";import{a as S,c as C,d as w,f as T,g as ce,l as E,m as le,n as ue,o as de,p as fe,u as pe}from"./status-CKOvrZ16.js";import{n as me,r as D,t as he}from"./ScaffoldRepoInline-DoqywP_g.js";import{n as ge,r as O,t as _e}from"./vsc-EOWFTqft.js";import{a as ve}from"./brand-Bj6g9sFF.js";import{n as ye}from"./client-CQ3EdyuW.js";import{A as be,C as xe,D as Se,E as Ce,Ft as we,Kt as Te,M as Ee,N as De,O as Oe,P as ke,S as Ae,T as je,Vt as k,Wt as Me,b as Ne,i as Pe,j as Fe,pt as Ie,qt as Le,vt as Re,w as ze,wt as Be,x as A,xt as Ve,y as He,zt as Ue}from"./index-qvc4aLwP.js";import{t as We}from"./badge-DQIZRRDZ.js";import{a as j,i as Ge,n as M,r as N,t as P}from"./empty-DK2eW2rF.js";import{t as Ke}from"./textarea-0lXkxsuX.js";var qe=y(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),F=y(`orbit`,[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]),Je=y(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),I=e(t(),1),L={status:`idle`,steps:[]};function Ye(){let[e,t]=(0,I.useState)(L),n=(0,I.useRef)(null),r=(0,I.useRef)(null),i=v(),a=(0,I.useCallback)(()=>{n.current?.close(),n.current=null,r.current=null},[]);return(0,I.useEffect)(()=>a,[a]),{progress:e,start:(0,I.useCallback)(e=>{if(n.current&&r.current===e)return;a(),r.current=e,t({status:`running`,steps:[]});let o=new EventSource(`/api/workspace/create-stream/${encodeURIComponent(e)}`);n.current=o;let s=0;o.addEventListener(`progress`,r=>{if(n.current===o){s=0;try{let n=JSON.parse(r.data);t({status:n.status===`completed`||n.status===`failed`?n.status:`running`,steps:n.steps??[],error:n.error,workspacePath:n.workspacePath,workspaceId:n.feature?.id??e}),(n.status===`completed`||n.status===`failed`)&&(a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]}))}catch{}}}),o.onerror=()=>{n.current===o&&(s+=1,!(o.readyState!==EventSource.CLOSED&&s<5)&&(t(e=>e.status===`running`?{...e,status:`unavailable`,error:e.error??`Unable to reconnect to the creation stream. The workspace may still have been created.`}:e),a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]})))}},[a,i]),reset:(0,I.useCallback)(()=>{a(),t(L)},[a])}}var R=n(),Xe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,z={codex:le,claude:S,vscode:_e,"vscode-insiders":ge,cursor:de,antigravity:F,powershell:Re,cmd:Re,terminal:Re,intellij:C,webstorm:w,pycharm:E,sublime:pe,zed:fe,windsurf:T},B={codex:`bg-foreground text-background`,claude:`bg-[#D97757] text-white`,vscode:`bg-[#007ACC] text-white`,"vscode-insiders":`bg-[#24A148] text-white`,cursor:`bg-zinc-950 text-white dark:bg-white dark:text-zinc-950`,antigravity:`bg-violet-600 text-white`,powershell:`bg-sky-700 text-white`,cmd:`bg-zinc-800 text-amber-400`,terminal:`bg-zinc-800 text-emerald-400`,intellij:`bg-fuchsia-600 text-white`,webstorm:`bg-cyan-600 text-white`,pycharm:`bg-lime-600 text-zinc-950`,sublime:`bg-orange-500 text-white`,zed:`bg-red-600 text-white`,windsurf:`bg-teal-600 text-white`};function V({icon:e}){let t=z[e]??k;return(0,R.jsx)(`span`,{className:b(`grid size-10 shrink-0 place-items-center rounded-xl shadow-sm`,B[e]),"aria-hidden":`true`,children:(0,R.jsx)(t,{className:`size-5`})})}function Ze({target:e,busy:t,launching:n,preferred:r,onLaunch:i}){return(0,R.jsxs)(`button`,{type:`button`,disabled:!e.available||t,onClick:()=>i(e),"aria-label":`Open workspace in ${e.name}`,className:b(`flex min-h-20 w-full items-center gap-3 rounded-xl border p-3 text-left outline-none transition-colors`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,`cursor-pointer border-border bg-card hover:border-primary/40 hover:bg-accent/60`),children:[(0,R.jsx)(V,{icon:e.icon}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.name}),n?(0,R.jsx)(A,{className:`size-4`}):r?(0,R.jsx)(We,{size:`sm`,variant:`secondary`,children:`Preferred`}):null]}),(0,R.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})}function Qe({session:e,busy:t,launching:n,onResume:r}){let i=e.desktopHandoff.method===`direct`,a=i?`Codex Desktop`:`Claude Desktop`;return(0,R.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>r(e),"aria-label":i?`Resume ${e.title} in Codex Desktop`:`Move ${e.title} to Claude Desktop`,className:b(`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/25 bg-primary/5 p-3 text-left outline-none transition-colors`,`hover:border-primary/45 hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-65`),children:[(0,R.jsx)(V,{icon:i?`codex`:`claude`}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`truncate font-medium text-foreground`,title:e.title,children:e.title}),n?(0,R.jsx)(A,{className:`size-4 shrink-0`}):i?(0,R.jsx)(ce,{className:`size-4 shrink-0 text-muted-foreground`}):(0,R.jsx)(Ue,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:[i?`Open this existing task in ${a}`:`Resume in Claude Code, then type /desktop`,` · `,new Date(e.updatedAt).toLocaleString()]})]})]})}function $e({workspaceId:e,workspacePath:t,isVsCode:n=!1,className:r}){let[i,o]=(0,I.useState)(!1),[s,l]=(0,I.useState)(null),[ee,u]=(0,I.useState)(null),[d,f]=(0,I.useState)(null),p=(0,I.useRef)(!1),m=a(),h=c(e,i),te=g().data?.config,_=m.data?.filter(e=>e.available)??[],ne=_.filter(e=>e.kind===`ai-app`),re=te?.defaultEditor?{code:`vscode`,"code-insiders":`vscode-insiders`,cursor:`cursor`,antigravity:`antigravity`,idea:`intellij`,webstorm:`webstorm`,charm:`pycharm`,subl:`sublime`,zed:`zed`,windsurf:`windsurf`}[te.defaultEditor]:void 0,v=_.filter(e=>e.kind===`editor`).toSorted((e,t)=>Number(t.id===re)-Number(e.id===re)),ie=new Set(_.map(e=>e.id)),ae=(h.data??[]).filter(e=>e.desktopHandoff&&ie.has(e.desktopHandoff.targetId)),y=n||_.length>0,b=async t=>{if(!p.current){p.current=!0,u(null),f(null),l(t.id);try{await ye(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.id})}),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await m.refetch()}finally{l(null),p.current=!1}}},oe=async t=>{if(!(p.current||!t.desktopHandoff||!Xe.test(t.id))){p.current=!0,u(null),f(null),l(`session:${t.id}`);try{if(t.desktopHandoff.method===`guided`){await He(`claude --resume ${t.id}`),f(`Claude resume command copied. With a Claude subscription login, run it in this workspace, then type /desktop in Claude to move the session into Claude Desktop.`);return}await ye(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.desktopHandoff.targetId,action:`resume`,sessionId:t.id})}),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await Promise.all([m.refetch(),h.refetch()])}finally{l(null),p.current=!1}}},se=()=>{window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:t},`*`),o(!1)},S=()=>Promise.all([m.refetch(),h.refetch()]),C=m.isFetching||h.isFetching;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(x,{variant:`outline`,className:r,onClick:()=>o(!0),children:[(0,R.jsx)(Je,{}),`Open with…`]}),(0,R.jsx)(Ae,{open:i,onOpenChange:e=>{o(e),e||(u(null),f(null))},children:(0,R.jsxs)(Se,{className:`max-w-2xl`,"aria-busy":s!==null,children:[(0,R.jsxs)(je,{children:[(0,R.jsx)(Oe,{children:`Open workspace with…`}),(0,R.jsx)(xe,{children:`Continue recent AI work or start in an installed coding app or editor. AI apps may use their own online services.`})]}),(0,R.jsxs)(Ce,{className:`space-y-5`,children:[ee&&(0,R.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-foreground`,children:ee}),d&&(0,R.jsx)(`div`,{role:`status`,className:`rounded-lg border border-primary/25 bg-primary/5 px-3 py-2 text-sm text-foreground`,children:d}),h.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,R.jsx)(A,{className:`size-4`}),` Checking recent sessions…`]}):ae.length>0?(0,R.jsxs)(`section`,{"aria-labelledby":`recent-sessions-heading`,children:[(0,R.jsx)(`h3`,{id:`recent-sessions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Continue recent work`}),(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ae.map(e=>(0,R.jsx)(Qe,{session:e,busy:s!==null,launching:s===`session:${e.id}`,onResume:oe},`${e.assistant}:${e.id}`))})]}):h.isError?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent sessions could not be checked. Starting new work is still available.`}):null,n&&(0,R.jsxs)(`section`,{"aria-labelledby":`current-editor-heading`,children:[(0,R.jsx)(`h3`,{id:`current-editor-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Current window`}),(0,R.jsxs)(`button`,{type:`button`,disabled:s!==null,onClick:se,className:`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 p-3 text-left outline-none transition-colors hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-65`,children:[(0,R.jsx)(V,{icon:`vscode`}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`span`,{className:`block font-medium`,children:`Current VS Code window`}),(0,R.jsxs)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:[`Open through the installed `,ve,` extension.`]})]})]})]}),m.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,R.jsx)(A,{}),` Checking apps on this computer…`]}):m.isError?(0,R.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive-foreground`,children:m.error instanceof Error?m.error.message:`Could not check available apps.`}):(0,R.jsxs)(R.Fragment,{children:[ne.length>0&&(0,R.jsxs)(`section`,{"aria-labelledby":`ai-apps-heading`,children:[(0,R.jsx)(`h3`,{id:`ai-apps-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`AI coding apps`}),(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ne.map(e=>(0,R.jsx)(Ze,{target:e,busy:s!==null,launching:s===e.id,onLaunch:b},e.id))})]}),v.length>0&&(0,R.jsxs)(`section`,{"aria-labelledby":`editors-heading`,children:[(0,R.jsx)(`h3`,{id:`editors-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Code editors`}),(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:v.map(e=>(0,R.jsx)(Ze,{target:e,busy:s!==null,launching:s===e.id,preferred:e.id===re,onLaunch:b},e.id))})]}),!y&&(0,R.jsx)(P,{className:`rounded-xl border border-dashed py-8 md:p-8`,children:(0,R.jsxs)(N,{children:[(0,R.jsx)(Ge,{variant:`icon`,children:(0,R.jsx)(qe,{})}),(0,R.jsx)(j,{className:`text-base`,children:`No compatible apps detected`}),(0,R.jsx)(M,{children:`Install a supported coding app or add its command to PATH, then recheck.`})]})})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-3`,children:[(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:C?`Checking recent sessions and apps…`:`Can’t find your app or session? Recheck detection.`}),(0,R.jsxs)(x,{size:`sm`,variant:`ghost`,onClick:()=>void S(),disabled:C||s!==null,children:[(0,R.jsx)(Be,{className:C?`animate-spin`:``}),`Recheck`]})]})]})]})})]})}var et=`__ad-hoc__`,tt=new URLSearchParams(window.location.search).get(`env`)===`vscode`,nt=[{value:`quick`,title:`Small task`,body:`Make and verify a focused change.`},{value:`feature`,title:`Standard change`,body:`Plan, implement, verify, and review a feature.`},{value:`epic`,title:`Epic`,body:`Track a larger change through dependent milestones.`}],rt=[{value:`in-place`,icon:Ie,title:`In-place`,body:`Work directly in the source repos. No branches or worktrees — fastest start.`},{value:`worktree`,icon:we,title:`Isolated worktrees`,body:`A feature branch and worktree per repo. Your source checkouts stay untouched.`}];function it({repo:e,value:t,onChange:n,enabled:i}){let a=d(e.path,i),o=(0,I.useMemo)(()=>[...new Set([...a.data?.local??[],...a.data?.remote??[]])],[a.data]),s=`branches-${e.path.replace(/[^a-zA-Z0-9]/g,`-`)}`;return(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`w-40 shrink-0 truncate text-xs`,children:e.name}),(0,R.jsx)(r,{list:s,value:t,onChange:e=>n(e.target.value),placeholder:`existing branch (must exist)`,className:`h-7 font-mono text-xs`}),(0,R.jsx)(`datalist`,{id:s,children:o.map(e=>(0,R.jsx)(`option`,{value:e},e))})]})}function at({step:e}){return(0,R.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,R.jsx)(`span`,{className:b(`grid size-5 shrink-0 place-items-center rounded-full border`,e.status===`completed`&&`border-success bg-success/15 text-success-foreground`,e.status===`running`&&`border-primary text-primary`,e.status===`failed`&&`border-destructive bg-destructive/15 text-destructive-foreground`,e.status===`pending`&&`border-border text-muted-foreground`),children:e.status===`completed`?(0,R.jsx)(Te,{className:`size-3`}):e.status===`running`?(0,R.jsx)(A,{className:`size-3`}):e.status===`failed`?(0,R.jsx)(Me,{className:`size-3`}):null}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,R.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.message})]})]})}function ot(){let e=f(),[t,n]=u(),a=ae(),c=i(),d=ne(),g=ee(),v=l(),y=re(),S=_(),C=h(),{progress:w,start:T,reset:ce}=Ye(),E=t.get(`job`),le=t.get(`from`)===`chat`,de=(0,I.useRef)(null);(0,I.useEffect)(()=>{!le||w.status!==`completed`||!w.workspaceId||de.current===w.workspaceId||(de.current=w.workspaceId,s.openCli(w.workspaceId),e(`/workspaces/${encodeURIComponent(w.workspaceId)}`))},[le,w.status,w.workspaceId,e]);let[fe,pe]=(0,I.useState)(t.get(`project`)??et),[ge,_e]=(0,I.useState)(`feature`),[ve,Te]=(0,I.useState)(`feature`),[k,Me]=(0,I.useState)(`in-place`),[Ie,Re]=(0,I.useState)(``),[He,Ue]=(0,I.useState)(``),[j,Ge]=(0,I.useState)(``),[M,N]=(0,I.useState)([]),[P,qe]=(0,I.useState)([]),[F,Je]=(0,I.useState)(!1),[L,Xe]=(0,I.useState)([]),[z,B]=(0,I.useState)([]),[V,Ze]=(0,I.useState)([]),[Qe,ot]=(0,I.useState)(``),[st,ct]=(0,I.useState)(``),[lt,ut]=(0,I.useState)(!1),[dt,ft]=(0,I.useState)(null),[H,pt]=(0,I.useState)({}),[mt,ht]=(0,I.useState)(!1),[gt,U]=(0,I.useState)(null),[_t,W]=(0,I.useState)(!1),[G,vt]=(0,I.useState)(``),[K,yt]=(0,I.useState)(``),[bt,xt]=(0,I.useState)(``),[St,Ct]=(0,I.useState)(`vertical`),[wt,Tt]=(0,I.useState)(``),[Et,Dt]=(0,I.useState)(!1),Ot=p(),kt=async()=>{if(!(!G.trim()||!K.trim())){Dt(!0);try{let e=K.trim().toLowerCase();await Ot.mutateAsync({id:e,name:G.trim(),description:bt.trim()||G.trim(),categoryType:St,verifyCommand:wt.trim()||void 0,tags:[e,...G.trim().toLowerCase().split(/\s+/).filter(Boolean)]}),N(t=>t.includes(e)?t:[...t,e]),W(!1),vt(``),yt(``),xt(``),Tt(``)}catch{}finally{Dt(!1)}}},At=(0,I.useMemo)(()=>{if(!j.trim()||j.trim().length<3)return[];let e=j.toLowerCase(),t=[];for(let n of S.data??[])M.includes(n.id)||[n.id,n.name,...n.tags??[]].some(t=>t&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:`#${n.id}`,type:`tag`});for(let n of v.data??[])z.includes(n.id)||[n.id,n.name,n.title,...n.tags??[]].some(t=>t&&t.length>2&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:n.title||n.name,type:`skill`});return t.slice(0,6)},[j,S.data,v.data,M,z]);(0,I.useEffect)(()=>{E?T(E):ce()},[E,ce,T]);let jt=()=>{ce(),n(e=>{let t=new URLSearchParams(e);return t.delete(`job`),t},{replace:!0})},Mt=()=>{let e=new URL(window.location.href);e.hash=`#/new`,window.location.replace(e.toString())},Nt=()=>{E&&T(E)},q=(0,I.useMemo)(()=>(a.data??[]).find(e=>e.id===fe)??null,[a.data,fe]),J=(0,I.useMemo)(()=>q?q.repos.map(e=>({name:ue(e.path),path:e.path,defaultBranch:e.defaultBranch})):(c.data??[]).filter(e=>P.includes(e.path)),[q,c.data,P]),[Pt,Ft]=(0,I.useState)(!0),[It,Y]=(0,I.useState)(null),X=m(),Lt=(0,I.useMemo)(()=>J.map(e=>({path:e.path,branch:H[e.path]||e.defaultBranch})),[J,H]),Z=ie(Lt,Lt.length>0),Rt=(0,I.useMemo)(()=>{let e={};for(let t of Z.data??[])e[t.repoPath]=t;return e},[Z.data]),zt=(0,I.useMemo)(()=>(Z.data??[]).filter(e=>e.status===`behind`),[Z.data]),Bt=async()=>{Y(null);try{let e=(await X.mutateAsync({repos:zt.map(e=>({path:e.repoPath,branch:e.branch}))})).results.filter(e=>e.status===`dirty`||e.status===`diverged`);e.length>0&&Y(`Could not update ${e.length} repo(s): ${e.map(e=>`${e.repoName} (${e.message})`).join(`; `)}`)}catch(e){Y(e instanceof Error?e.message:String(e))}},Vt=async(e,t)=>{Y(null);try{let n=(await X.mutateAsync({path:e,branch:t})).results.find(e=>!e.success);n&&Y(`Could not update ${n.repoName}: ${n.message}`)}catch(e){Y(e instanceof Error?e.message:String(e))}},Q=k===`in-place`,Ht=(Q?He.trim().length>0:Ie.trim().length>0)&&J.length>0&&j.trim().length>0,Ut=e=>{ot(e),ft(null);let t=(g.data??[]).find(t=>t.id===e);ct(t?.content??``)},Wt=async()=>{if(!j.trim()){U(`Describe what you are building first — the suggestion is based on it.`);return}U(null),ut(!0);try{let e=await ye(`/api/workspace/suggest-workflow`,{method:`POST`,body:JSON.stringify({description:j,repos:J})});ot(e.suggestedWorkflowId),ct(e.customInstructions),ft(e.difficulty)}catch(e){U(e instanceof Error?e.message:String(e))}finally{ut(!1)}},Gt=(0,I.useRef)(!1),Kt=async()=>{if(Gt.current||C.isPending||!Ht)return;Gt.current=!0,U(null);let e={flowType:ve,workType:ge,mode:k,projectId:q?.id,...Q?{name:He.trim()}:{branchName:Ie.trim()},description:j.trim(),repos:J.map(e=>({...e,existingBranch:!Q&&H[e.path]?.trim()?H[e.path].trim():void 0})),assistants:L,enabledSkills:z.length>0?z:void 0,enabledAgents:V.length>0?V:void 0,domainPacks:M.length>0?M:void 0,teamworkInstructions:st.trim()||void 0,autoUpdateBase:Pt};try{let{jobId:t}=await C.mutateAsync(e);T(t),n(e=>{let n=new URLSearchParams(e);return n.set(`job`,t),n},{replace:!0})}catch(e){U(e instanceof Error?e.message:String(e))}finally{Gt.current=!1}},$=w.status===`idle`&&E?{status:`running`,steps:[]}:w;if($.status!==`idle`){let t=$.steps.find(e=>e.status===`failed`);return(0,R.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold`,children:$.status===`running`?`Setting up your workspace…`:$.status===`completed`?`Workspace ready`:$.status===`failed`?`Workspace creation failed`:`Unable to reconnect to workspace setup`}),(0,R.jsx)(`ul`,{"aria-live":`polite`,"aria-relevant":`additions text`,className:`mt-6 divide-y divide-border rounded-xl border border-border bg-card px-4`,children:$.steps.length>0?$.steps.map(e=>(0,R.jsx)(at,{step:e},e.id)):(0,R.jsxs)(`li`,{className:`flex items-center gap-3 py-3.5`,children:[(0,R.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary`,children:(0,R.jsx)(A,{className:`size-3`})}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium`,children:`Connecting to workspace setup…`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Waiting for creation progress…`})]})]})}),($.status===`failed`||$.status===`unavailable`)&&(0,R.jsx)(`p`,{className:`mt-4 text-sm text-destructive-foreground`,children:t?.message??$.error??`Something went wrong.`}),$.status===`completed`&&$.workspacePath&&(0,R.jsx)(`p`,{className:`mt-4 truncate font-mono text-xs text-muted-foreground`,children:$.workspacePath}),gt&&(0,R.jsx)(`p`,{className:`mt-2 text-sm text-destructive-foreground`,children:gt}),(0,R.jsxs)(`div`,{"data-testid":`workspace-ready-actions`,className:`mt-6 flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[$.status===`completed`&&$.workspaceId&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(x,{className:`w-full min-w-0 whitespace-normal sm:w-auto`,onClick:()=>e(`/workspaces/${encodeURIComponent($.workspaceId)}`),children:`Open workspace`}),$.workspacePath&&(0,R.jsx)($e,{workspaceId:$.workspaceId,workspacePath:$.workspacePath,isVsCode:tt,className:`w-full min-w-0 whitespace-normal sm:w-auto`})]}),$.status===`failed`&&(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(x,{variant:`default`,onClick:jt,children:`Back to form (edit & retry)`}),(0,R.jsx)(x,{variant:`outline`,onClick:Mt,children:`Start over (clear form)`})]}),$.status===`unavailable`&&(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(x,{variant:`default`,onClick:Nt,children:`Try reconnecting`}),(0,R.jsx)(x,{variant:`outline`,onClick:jt,children:`Back to form`})]}),$.status===`running`&&(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This can take a moment for large repositories.`}),(0,R.jsx)(x,{variant:`outline`,size:`sm`,onClick:jt,children:`Return to form`})]})]})]})}return(0,R.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,R.jsxs)(`header`,{className:`mb-6`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Start work`}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Pick where the work happens and how isolated it should be.`})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`Project`}),(0,R.jsxs)(be,{value:fe,onValueChange:e=>typeof e==`string`&&pe(e),children:[(0,R.jsx)(De,{className:`w-full`,"aria-label":`Project`,children:(0,R.jsx)(ke,{children:q?q.name:`Ad-hoc — pick repositories manually`})}),(0,R.jsxs)(Ee,{alignItemWithTrigger:!1,children:[(a.data??[]).map(e=>(0,R.jsx)(Fe,{value:e.id,children:e.name},e.id)),(0,R.jsx)(Fe,{value:et,children:`Ad-hoc — pick repositories manually`})]})]}),q?(0,R.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:q.repos.map(e=>(0,R.jsx)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.path},e.path))}):(0,R.jsxs)(`div`,{className:`mt-2`,children:[(0,R.jsx)(me,{repos:c.data??[],selectedPaths:P,onToggle:e=>qe(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path]),loading:c.isLoading,freshnessMap:Rt}),(0,R.jsx)(he,{onCreated:e=>qe(t=>[...t,e.path])})]}),J.length>0&&(0,R.jsxs)(`div`,{className:`mt-3 rounded-lg border border-border bg-card p-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,R.jsx)(we,{className:`size-3.5`}),`Base repository sync (`,J.length,`)`]}),(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:zt.length>0&&(0,R.jsxs)(x,{size:`sm`,variant:`outline`,className:`h-6 text-xs px-2`,onClick:Bt,disabled:X.isPending,children:[X.isPending?(0,R.jsx)(A,{className:`size-3 mr-1`}):(0,R.jsx)(Be,{className:`size-3 mr-1`}),`Pull `,zt.length,` stale `,zt.length===1?`repo`:`repos`]})})]}),(0,R.jsx)(`ul`,{className:`mt-2 divide-y divide-border text-xs`,children:J.map(e=>{let t=Rt[e.path],n=t?.status===`behind`;return(0,R.jsxs)(`li`,{className:`flex items-center justify-between py-1.5`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 truncate pr-2`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,R.jsxs)(`span`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:[`(`,H[e.path]||e.defaultBranch,`)`]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[Z.isLoading?(0,R.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`Checking…`}):t?(0,R.jsx)(Ne,{tone:t.status===`up-to-date`?`success`:t.status===`behind`?`warning`:t.status===`diverged`?`danger`:t.status===`ahead`?`info`:`neutral`,title:t.message,children:t.status===`behind`?`↓ ${t.behind} behind ${t.trackingBranch}`:t.status===`up-to-date`?`Up to date`:t.status===`diverged`?`Diverged`:t.status===`ahead`?`↑ ${t.ahead} ahead`:`Local`}):null,n&&(0,R.jsx)(x,{size:`sm`,variant:`ghost`,className:`h-5 px-1.5 text-[11px] text-amber-500 hover:text-amber-600`,onClick:()=>Vt(e.path,H[e.path]||e.defaultBranch),disabled:X.isPending,children:`Pull`})]})]},e.path)})}),It&&(0,R.jsx)(`p`,{className:`mt-2 text-xs text-amber-500`,children:It})]}),(a.data??[]).length===0&&!a.isLoading&&(0,R.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Tip: `,(0,R.jsx)(o,{to:`/projects`,className:`text-primary hover:underline`,children:`register a project`}),` to skip repo picking next time.`]})]}),(0,R.jsxs)(`fieldset`,{children:[(0,R.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:`What kind of work is this?`}),(0,R.jsxs)(`label`,{className:`mb-3 block text-sm`,children:[`Work type`,(0,R.jsxs)(`select`,{"aria-label":`Work type`,className:`mt-1 block w-full rounded-md border border-border bg-background p-2`,value:ge,onChange:e=>_e(e.target.value),children:[(0,R.jsx)(`option`,{value:`bug`,children:`Bug fix`}),(0,R.jsx)(`option`,{value:`feature`,children:`Feature`}),(0,R.jsx)(`option`,{value:`performance`,children:`Performance`}),(0,R.jsx)(`option`,{value:`refactor`,children:`Refactor`}),(0,R.jsx)(`option`,{value:`rewrite`,children:`Rewrite`})]})]}),(0,R.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Choose a starting size and milestone preset. You can edit milestones in Plan.`}),(0,R.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:nt.map(e=>(0,R.jsxs)(`label`,{className:b(`cursor-pointer rounded-xl border p-4 focus-within:ring-2 focus-within:ring-ring`,ve===e.value?`border-primary bg-primary/5`:`border-border bg-card`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`flowType`,value:e.value,checked:ve===e.value,onChange:()=>Te(e.value),"aria-label":e.title,"aria-describedby":`flow-${e.value}-description`,className:`accent-primary`}),e.title]}),(0,R.jsx)(`p`,{id:`flow-${e.value}-description`,className:`mt-2 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`How do you want to work?`}),(0,R.jsx)(`div`,{role:`radiogroup`,"aria-label":`Work mode`,className:`grid gap-3 sm:grid-cols-2`,onKeyDown:e=>{if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(e.key)){e.preventDefault();let t=k===`in-place`?`worktree`:`in-place`;Me(t),document.getElementById(`mode-${t}`)?.focus()}},children:rt.map(e=>(0,R.jsxs)(`button`,{id:`mode-${e.value}`,type:`button`,role:`radio`,"aria-checked":k===e.value,tabIndex:k===e.value?0:-1,onClick:()=>Me(e.value),className:b(`cursor-pointer rounded-xl border p-4 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,k===e.value?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border bg-card hover:border-foreground/20`),children:[(0,R.jsx)(e.icon,{className:b(`size-4`,k===e.value?`text-primary`:`text-muted-foreground`)}),(0,R.jsx)(`p`,{className:`mt-2 text-sm font-semibold`,children:e.title}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,R.jsxs)(`section`,{children:[Q?(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Workspace name`}),(0,R.jsx)(r,{value:He,onChange:e=>Ue(e.target.value),placeholder:`e.g. Fix invoice rounding`})]}):(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Feature branch`}),(0,R.jsx)(r,{value:Ie,onChange:e=>Re(e.target.value),placeholder:`e.g. feature/invoice-rounding`,className:`font-mono`})]}),J.length>0&&(0,R.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2`,onToggle:e=>ht(e.target.open),children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Use an existing branch for specific repos (optional)`}),(0,R.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:J.map(e=>(0,R.jsx)(it,{repo:e,enabled:mt,value:H[e.path]??``,onChange:t=>pt(n=>({...n,[e.path]:t}))},e.path))})]})]}),(0,R.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 cursor-pointer text-xs text-muted-foreground`,children:[(0,R.jsx)(D,{checked:Pt,onCheckedChange:e=>Ft(!!e),"aria-label":`Fast-forward clean base branches before creating workspace`}),(0,R.jsx)(`span`,{children:`Fast-forward clean base branches to latest remote commits`})]})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`What are you building?`}),(0,R.jsx)(Ke,{value:j,onChange:e=>Ge(e.target.value),placeholder:`A short description — your AI assistant reads this to plan the work.`,rows:3})]}),At.length>0&&(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 p-2 rounded-lg bg-primary/5 border border-primary/20 text-xs`,children:[(0,R.jsxs)(`span`,{className:`text-primary font-medium flex items-center gap-1 text-[11px]`,children:[(0,R.jsx)(Ve,{className:`size-3`}),` Suggested for this task:`]}),At.map(e=>(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{e.type===`tag`?N(t=>t.includes(e.id)?t:[...t,e.id]):B(t=>t.includes(e.id)?t:[...t,e.id])},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-card border border-primary/30 text-[11px] font-mono hover:bg-primary/10 transition-colors text-foreground`,children:[(0,R.jsxs)(`span`,{children:[`+`,e.title]}),(0,R.jsx)(We,{variant:`outline`,className:`text-[8px] px-0.5 py-0 uppercase`,children:e.type})]},`${e.type}-${e.id}`))]})]}),(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,R.jsx)(O,{className:`size-4 text-primary`}),`Category & Domain Tags`,M.length>0&&(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,M.length,` attached)`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground hidden sm:inline`,children:`Tags attach curated skill bundles & standards`}),(0,R.jsxs)(x,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>W(!0),className:`h-6 text-xs gap-1 px-2 border-primary/40 text-primary hover:bg-primary/10`,children:[(0,R.jsx)(O,{className:`size-3`}),`+ New Tag`]})]})]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:S.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center justify-center p-4 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,R.jsx)(A,{className:`size-3`}),`Loading category tags...`]}):(S.data??[]).length===0?(0,R.jsx)(`div`,{className:`p-3.5 border border-border rounded-xl bg-card/40 space-y-2`,children:(0,R.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:`No domain tags defined yet`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Tags are optional bundles that package skills, rules, and test commands for a domain. You can create a tag now, or select skills directly below.`})]}),(0,R.jsxs)(x,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>W(!0),className:`text-xs gap-1.5 h-7 shrink-0 text-primary border-primary/40 hover:bg-primary/10`,children:[(0,R.jsx)(O,{className:`size-3 text-primary`}),`+ Create Tag`]})]})}):(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(S.data??[]).map(e=>{let t=M.includes(e.id),n=e.skills?.length??0,r=e.rules?.length??0;return(0,R.jsxs)(`div`,{onClick:()=>N(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:b(`flex flex-col justify-between p-3 rounded-xl border cursor-pointer transition-colors text-left outline-none select-none`,t?`border-primary bg-primary/5 ring-1 ring-primary/40`:`border-border bg-card hover:border-foreground/20`),children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(D,{checked:t,onCheckedChange:()=>N(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Attach ${e.name}`}),(0,R.jsxs)(`span`,{className:`font-medium text-xs font-mono`,children:[`#`,e.id]})]}),e.categoryType&&(0,R.jsx)(We,{variant:`outline`,className:`text-[10px] px-1 py-0 shrink-0 capitalize`,children:e.categoryType===`trait`?`trait`:`domain`})]}),(0,R.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground line-clamp-2`,children:e.description||e.name}),(n>0||r>0)&&(0,R.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border/50 flex flex-wrap gap-1 items-center text-[10px]`,children:[n>0&&(0,R.jsxs)(`span`,{className:`text-primary font-mono flex items-center gap-1`,children:[(0,R.jsx)(Le,{className:`size-2.5`}),e.skills.join(`, `)]}),r>0&&(0,R.jsxs)(`span`,{className:`text-muted-foreground ml-auto font-mono`,children:[r,` rule`,r===1?``:`s`]})]})]},e.id)})})}),(0,R.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-border/60`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,R.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,R.jsx)(Le,{className:`size-4 text-primary`}),`Direct Agent Skills`,z.length>0&&(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,z.length,` selected)`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(v.data??[]).length>0&&(0,R.jsx)(x,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>{let e=(v.data??[]).map(e=>e.id);B(z.length===e.length?[]:e)},className:`text-xs text-muted-foreground hover:text-foreground h-6 px-2`,children:z.length===(v.data??[]).length&&(v.data??[]).length>0?`Deselect All`:`Select All`}),(0,R.jsx)(o,{to:`/skills`,className:`text-xs text-primary hover:underline flex items-center gap-1`,children:`Skill Library →`})]})]}),v.isLoading?(0,R.jsxs)(`div`,{className:`flex items-center justify-center p-3 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,R.jsx)(A,{className:`size-3`}),`Loading skills...`]}):(v.data??[]).length===0?(0,R.jsx)(`div`,{className:`p-3 border border-dashed border-border rounded-lg bg-card/20 text-center`,children:(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No skills in your catalog yet. You can create skills in the`,` `,(0,R.jsx)(o,{to:`/skills`,className:`text-primary underline`,children:`Skill Library`}),` `,`or let AI agents create them during development.`]})}):(0,R.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(v.data??[]).map(e=>{let t=z.includes(e.id);return(0,R.jsxs)(`div`,{onClick:()=>B(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:b(`flex items-center justify-between gap-2 p-2.5 rounded-lg border cursor-pointer transition-colors select-none text-left`,t?`border-primary/60 bg-primary/5 ring-1 ring-primary/40 text-foreground`:`border-border bg-card hover:border-foreground/20 text-muted-foreground`),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,R.jsx)(D,{checked:t,onCheckedChange:()=>B(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Select ${e.title||e.name}`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`font-mono text-xs font-medium truncate text-foreground`,children:e.title||e.name}),e.description&&(0,R.jsx)(`p`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),e.category&&(0,R.jsx)(We,{variant:`outline`,className:`text-[9px] px-1 py-0 shrink-0 capitalize`,children:e.category})]},e.id)})})]})]}),(0,R.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-4`,"aria-label":`AI harnesses`,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`AI harnesses`}),(0,R.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Choose which tools receive workspace instructions. This does not start a session or choose a default harness.`}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:(d.data??[]).map(e=>(0,R.jsxs)(`label`,{className:b(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm`,!e.detected&&`opacity-50`),children:[(0,R.jsx)(D,{checked:L.includes(e.name),onCheckedChange:()=>Xe(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name])}),(0,R.jsx)(Pe,{harness:e.name}),e.displayName,!e.detected&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Not installed`})]},e.name))})]})}),(0,R.jsxs)(`section`,{className:`rounded-xl border border-border`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:()=>Je(e=>!e),className:`flex w-full items-center justify-between px-4 py-3 text-sm font-medium hover:bg-accent`,"aria-expanded":F,children:[`Advanced`,(0,R.jsx)(se,{className:b(`size-4 text-muted-foreground transition-transform`,F&&`rotate-180`)})]}),F&&(0,R.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border p-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:`Teamwork strategy`}),(0,R.jsxs)(x,{size:`xs`,variant:`outline`,onClick:Wt,disabled:lt,children:[lt?(0,R.jsx)(A,{}):(0,R.jsx)(Ve,{}),`Suggest with AI`]})]}),(0,R.jsxs)(be,{value:Qe,onValueChange:e=>typeof e==`string`&&Ut(e),children:[(0,R.jsx)(De,{className:`w-full`,"aria-label":`Teamwork strategy`,children:(0,R.jsx)(ke,{children:(g.data??[]).find(e=>e.id===Qe)?.name??`None`})}),(0,R.jsxs)(Ee,{alignItemWithTrigger:!1,children:[(0,R.jsx)(Fe,{value:``,children:`None`}),(g.data??[]).map(e=>(0,R.jsx)(Fe,{value:e.id,children:e.name},e.id))]})]}),dt&&(0,R.jsxs)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`AI classified this task as `,(0,R.jsx)(`span`,{className:`font-medium`,children:dt}),` difficulty.`]}),(0,R.jsx)(Ke,{value:st,onChange:e=>ct(e.target.value),placeholder:`Cooperation instructions for the agent team (editable — prefilled by the strategy pick or AI suggestion).`,rows:4,className:`mt-2 font-mono text-xs`})]}),(y.data??[]).length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:(0,R.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,R.jsx)(oe,{className:`size-4 text-purple-400`}),`Codex Native Agents (`,V.length,` selected)`]})}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(y.data??[]).map(e=>{let t=V.includes(e.id);return(0,R.jsxs)(`label`,{className:b(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-xs`,t?`border-purple-500/60 bg-purple-500/5 text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,R.jsx)(D,{checked:t,onCheckedChange:()=>Ze(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,R.jsx)(`span`,{className:`font-mono`,children:e.name})]},e.id)})})]})]})]}),gt&&(0,R.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:gt}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border pt-4`,children:[(0,R.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(te,{className:`size-3.5`}),J.length,` repositor`,J.length===1?`y`:`ies`,` selected`]}),(0,R.jsxs)(x,{onClick:Kt,disabled:!Ht||C.isPending,children:[C.isPending?(0,R.jsx)(A,{}):null,Q?`Start working`:`Create workspace`]})]})]}),(0,R.jsx)(Ae,{open:_t,onOpenChange:W,children:(0,R.jsxs)(Se,{className:`max-w-md`,children:[(0,R.jsxs)(je,{children:[(0,R.jsxs)(Oe,{className:`flex items-center gap-2`,children:[(0,R.jsx)(O,{size:16,className:`text-primary`}),(0,R.jsx)(`span`,{children:`Create Category Tag`})]}),(0,R.jsx)(xe,{children:`Tags bundle reusable skills, rules, and test verification commands for a domain.`})]}),(0,R.jsxs)(Ce,{className:`space-y-3 py-2`,children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag Name`}),(0,R.jsx)(r,{value:G,onChange:e=>{vt(e.target.value),(!K||K===G.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))&&yt(e.target.value.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))},placeholder:`e.g. Invoicing & Billing`,size:`sm`})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag ID / Slug`}),(0,R.jsx)(r,{value:K,onChange:e=>yt(e.target.value),placeholder:`e.g. billing`,size:`sm`,className:`font-mono`})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Type`}),(0,R.jsxs)(`select`,{value:St,onChange:e=>Ct(e.target.value),className:`w-full h-7.5 px-2 text-xs rounded-md border border-border bg-background text-foreground`,children:[(0,R.jsx)(`option`,{value:`vertical`,children:`Vertical Subsystem`}),(0,R.jsx)(`option`,{value:`trait`,children:`Horizontal Trait`})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Description (optional)`}),(0,R.jsx)(r,{value:bt,onChange:e=>xt(e.target.value),placeholder:`What this domain covers...`,size:`sm`})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Verification Command (optional)`}),(0,R.jsx)(r,{value:wt,onChange:e=>Tt(e.target.value),placeholder:`e.g. npm test -- billing`,size:`sm`,className:`font-mono`})]})]}),(0,R.jsxs)(ze,{className:`flex items-center justify-end gap-2 pt-2 border-t`,children:[(0,R.jsx)(x,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>W(!1),children:`Cancel`}),(0,R.jsx)(x,{type:`button`,size:`sm`,disabled:!G.trim()||!K.trim()||Et,onClick:()=>void kt(),children:Et?`Creating...`:`Create & Attach Tag`})]})]})})]})}export{ot as StartWorkPage};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{n as e,t}from"./jsx-runtime-DE3RlOCf.js";import{t as n}from"./input-LtE7Sz4D.js";import{h as r,m as i,t as a}from"./button-BrcP8Wxx.js";import{t as o}from"./circle-plus-D0tjHKM4.js";import{t as s}from"./cpu-Y6k3dlHb.js";import{t as c}from"./trash-2-BrrLX4tD.js";import{A as l,B as u,M as d,N as f,P as p,j as m,x as h}from"./index-qvc4aLwP.js";import{t as g}from"./badge-DQIZRRDZ.js";import{t as _}from"./card-BMggHY3n.js";import{a as v,i as y,n as b,r as x,t as S}from"./empty-DK2eW2rF.js";import{t as C}from"./label-C610MHwq.js";import{t as w}from"./textarea-0lXkxsuX.js";var T=r(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),E=r(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]);e();var D=t();function O(e){let{workflowTemplates:t,isEditingTemplate:r,setIsEditingTemplate:O,mgtTemplateName:k,setMgtTemplateName:A,mgtTemplateContent:j,setMgtTemplateContent:M,selectedMgtTemplateId:N,setSelectedMgtTemplateId:P,analysisResult:F,setAnalysisResult:I,showToast:L,handleAnalyzeTemplate:R,handleSaveTemplate:z,handleDeleteTemplate:B,aiAssistants:V,analyzingTemplate:H,mgtAnalysisComment:U,setMgtAnalysisComment:W,suggestedImprovement:G,setSuggestedImprovement:K,savingTemplate:q,deletingTemplate:J,selectedInspectAssistant:Y,setSelectedInspectAssistant:X}=e,Z=t.find(e=>e.id===N),Q=V.filter(e=>e.detected&&e.command),$=Q.find(e=>e.name===Y)?.displayName??`No Harness Found`;return(0,D.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in`,children:[(0,D.jsxs)(`header`,{className:`mb-6 border-b border-border/70 pb-4`,children:[(0,D.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Team Collaboration Strategies`}),(0,D.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Predefine and review custom teamwork orchestration templates injected into workspaces' AGENTS.md files.`})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 text-left lg:grid-cols-12`,children:[(0,D.jsx)(`div`,{className:`flex flex-col gap-4 lg:col-span-4`,children:(0,D.jsxs)(_,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-5 shadow-xs`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Strategies`}),(0,D.jsxs)(a,{size:`sm`,onClick:()=>{O(!0),A(`New Strategy`),M(`# New Strategy
|
|
2
|
+
|
|
3
|
+
Write custom teamwork rules here for subagent orchestration...`),P(null),I(null)},children:[(0,D.jsx)(o,{size:12}),` Add New`]})]}),(0,D.jsx)(u,{className:`mt-4 max-h-[480px]`,children:(0,D.jsx)(`div`,{className:`flex flex-col gap-2 pr-1`,children:t.map(e=>{let t=N===e.id;return(0,D.jsxs)(`div`,{className:i(`flex cursor-pointer flex-col gap-1.5 rounded-lg border p-3 text-left transition-colors`,t?`border-primary bg-primary/5 ring-1 ring-primary/40`:`border-border bg-card hover:border-foreground/15 hover:bg-muted/40`),onClick:()=>{P(e.id),O(!1),A(e.name),M(e.content),I(null)},children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,D.jsx)(`span`,{className:i(`text-xs font-semibold`,t?`text-primary`:`text-foreground`),children:e.name}),(0,D.jsx)(g,{variant:e.custom?`info`:`secondary`,size:`sm`,className:`font-mono uppercase`,children:e.custom?`Custom`:`Built-in`})]}),(0,D.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description})]},e.id)})})})]})}),(0,D.jsx)(`div`,{className:`flex flex-col gap-6 lg:col-span-8`,children:N||r?(0,D.jsxs)(_,{className:`flex flex-col gap-5 rounded-xl p-6 shadow-sm`,children:[(0,D.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,D.jsx)(`div`,{className:`flex-1`,children:r?(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(C,{className:`text-sm`,children:`Strategy Name`}),(0,D.jsx)(n,{type:`text`,value:k,onChange:e=>A(e.target.value),placeholder:`e.g. Test-Driven Development`})]}):(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold text-foreground`,children:[k,Z?.custom&&(0,D.jsx)(g,{variant:`info`,className:`font-mono uppercase`,children:`Custom Template`})]}),(0,D.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:Z?.description||`Custom strategy template.`})]})}),(0,D.jsx)(`div`,{className:`flex gap-2`,children:r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>{if(N){let e=t.find(e=>e.id===N);e&&(A(e.name),M(e.content)),O(!1)}else if(O(!1),t.length>0){let e=t[0];P(e.id),A(e.name),M(e.content)}},children:`Cancel`}),(0,D.jsx)(a,{size:`sm`,onClick:z,disabled:q,children:q?`Saving...`:`Save Strategy`})]}):(0,D.jsxs)(D.Fragment,{children:[Z?.custom&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>O(!0),children:`Edit`}),(0,D.jsxs)(a,{variant:`destructive`,size:`sm`,onClick:()=>B(N),disabled:J,children:[(0,D.jsx)(c,{size:12}),` Delete`]})]}),!Z?.custom&&(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>{O(!0),A(`${k} Copy`),M(j),P(null),I(null)},children:`Duplicate & Customize`})]})})]}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(C,{className:`text-sm`,children:`Guidelines Markdown`}),(0,D.jsx)(w,{className:`min-h-[250px] font-mono text-xs leading-relaxed`,value:j,onChange:e=>M(e.target.value),disabled:!r,placeholder:`Write cooperation guidelines in Markdown...`})]}),!r&&N&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border pt-5`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col`,children:[(0,D.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold text-foreground`,children:[(0,D.jsx)(s,{size:14,className:`text-muted-foreground`}),` AI Strategy Analysis`]}),(0,D.jsx)(`span`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Select an AI assistant harness installed on your system to inspect these guidelines.`})]}),(0,D.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 sm:w-auto`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Harness:`}),(0,D.jsxs)(l,{value:Y,disabled:Q.length===0,onValueChange:e=>typeof e==`string`&&X(e),children:[(0,D.jsx)(f,{size:`sm`,className:`w-44`,"aria-label":`Harness`,children:(0,D.jsx)(p,{children:$})}),(0,D.jsx)(d,{alignItemWithTrigger:!1,children:Q.length>0?Q.map(e=>(0,D.jsx)(m,{value:e.name,children:e.displayName},e.name)):(0,D.jsx)(m,{value:``,children:`No Harness Found`})})]})]}),(0,D.jsx)(a,{size:`sm`,onClick:()=>R(N,j,Y),disabled:H||Q.length===0,children:H?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(h,{className:`size-3`}),` Inspecting...`]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{size:12}),` Inspect Strategy`]})})]})]}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(C,{className:`text-left text-xs uppercase tracking-wider text-muted-foreground`,children:`Evaluation Focus / Instructions (Optional)`}),(0,D.jsx)(w,{className:`min-h-[60px] text-xs leading-relaxed`,value:U,onChange:e=>W(e.target.value),placeholder:`e.g. Focus on checking if timeouts are handled well, check subagent roles coordination...`,disabled:H})]})]}),F&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsx)(u,{className:`max-h-[300px] rounded-xl border border-border bg-muted/40 p-5`,children:(0,D.jsx)(`div`,{className:`select-text whitespace-pre-wrap text-left text-xs leading-relaxed text-foreground`,children:F})}),G&&(0,D.jsx)(`div`,{className:`flex justify-end`,children:(0,D.jsxs)(a,{size:`sm`,onClick:()=>{M(G),O(!0),K(null),I(null),L(`Suggested improvements applied! Click Save to persist changes.`,`success`)},children:[(0,D.jsx)(T,{size:14}),` Apply Suggested Improvements`]})})]})]})]}):(0,D.jsx)(`div`,{className:`flex min-h-[400px] flex-col items-center justify-center`,children:(0,D.jsx)(S,{className:`w-full max-w-md border border-dashed border-border`,children:(0,D.jsxs)(x,{children:[(0,D.jsx)(y,{variant:`icon`,children:(0,D.jsx)(E,{})}),(0,D.jsx)(v,{children:`No strategy template selected`}),(0,D.jsx)(b,{children:`Select a template from the list to view, edit, or analyze it, or add a new custom teamwork workflow template.`})]})})})})]})]})}export{O as StrategiesPage};
|