@mrpatronz/nexusflow 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +15 -1
- package/dist/commands/create.js.map +1 -1
- package/dist/gui/assets/AgentsPage-B_3Vqn2y.js +3 -0
- package/dist/gui/assets/DashboardPage-W7KE2gn1.js +1 -0
- package/dist/gui/assets/{GettingStartedPage-BJvrh67p.js → GettingStartedPage-DQ5kCj0q.js} +1 -1
- package/dist/gui/assets/ProjectsPage-CrZhKj85.js +1 -0
- package/dist/gui/assets/{ScaffoldRepoInline-DSt_6QLb.js → ScaffoldRepoInline-BSpQbVe7.js} +1 -1
- package/dist/gui/assets/{SettingsPage-DO5HasvS.js → SettingsPage-Zvq-P6Hj.js} +1 -1
- package/dist/gui/assets/SkillsPage-DR-Y5ZM1.js +6 -0
- package/dist/gui/assets/StartWorkPage-DO6t_zFb.js +1 -0
- package/dist/gui/assets/{StrategiesPage-CWMrYI29.js → StrategiesPage-CkpJI4Q3.js} +1 -1
- package/dist/gui/assets/{WorkspaceLauncher-EIY_u44S.js → WorkspaceLauncher-CDtnv1IK.js} +1 -1
- package/dist/gui/assets/WorkspacesPage-B9QOLnq_.js +6 -0
- package/dist/gui/assets/{alert-dialog-CroDe9HW.js → alert-dialog-Cjwogh-W.js} +1 -1
- package/dist/gui/assets/{index-CcIOIZ24.js → index-ofoYKpCG.js} +20 -20
- package/dist/gui/assets/index-w-iQhEQv.css +2 -0
- package/dist/gui/assets/terminal-D1awFRPr.js +1 -0
- package/dist/gui/assets/zap-DhYfYRlq.js +1 -0
- package/dist/gui/index.html +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +7 -0
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +31 -0
- package/dist/server.test.js.map +1 -1
- package/dist/utils/prompts.d.ts +5 -1
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +16 -0
- package/dist/utils/prompts.js.map +1 -1
- package/package.json +1 -1
- package/dist/gui/assets/AgentsPage-C7wGK7q-.js +0 -3
- package/dist/gui/assets/DashboardPage-DqZRdOF3.js +0 -1
- package/dist/gui/assets/ProjectsPage-B0VFV1vX.js +0 -1
- package/dist/gui/assets/SkillsPage-CvRIKdsQ.js +0 -6
- package/dist/gui/assets/StartWorkPage-CK5QF6Oa.js +0 -1
- package/dist/gui/assets/WorkspacesPage-CHUfqrA6.js +0 -6
- package/dist/gui/assets/code-xml-Chu1p81J.js +0 -1
- package/dist/gui/assets/index-Bq5NL5AJ.css +0 -2
- package/dist/gui/assets/terminal-gK6BMl3E.js +0 -1
- package/dist/gui/assets/zap-FQrDnrgb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsCH;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAyUnD"}
|
package/dist/commands/create.js
CHANGED
|
@@ -18,9 +18,10 @@ import { detectEditors } from '../utils/detect-editors.js';
|
|
|
18
18
|
import { openInEditor } from '../utils/open-editor.js';
|
|
19
19
|
import { debugLog } from '../utils/debug.js';
|
|
20
20
|
import { getSessionCwd } from '../utils/feature.js';
|
|
21
|
-
import { promptBranchName, promptDescription, promptSelectRepos, promptSelectAI, promptSelectEditor, promptSelectStrategy, promptNewStrategy, promptNewProjectName, promptRepoBranches, } from '../utils/prompts.js';
|
|
21
|
+
import { promptBranchName, promptDescription, promptSelectRepos, promptSelectAI, promptSelectEditor, promptSelectStrategy, promptNewStrategy, promptNewProjectName, promptRepoBranches, promptSelectSkills, } from '../utils/prompts.js';
|
|
22
22
|
import { createNewRepo } from '../core/new-repo.js';
|
|
23
23
|
import { loadProjects, slugifyProjectName } from '../core/projects.js';
|
|
24
|
+
import { getAllSkills, saveWorkspaceSkillsConfig } from '../utils/skills-catalog.js';
|
|
24
25
|
import { suggestWorkflow } from '../utils/workflow-advisor.js';
|
|
25
26
|
import { getWorkflowTemplates, saveWorkflowTemplate } from '../utils/workflows.js';
|
|
26
27
|
/**
|
|
@@ -190,6 +191,12 @@ export async function createCommand() {
|
|
|
190
191
|
console.log(chalk.green(` ✔ Selected strategy: ${chalk.bold(selectedTemplate.name)}`));
|
|
191
192
|
}
|
|
192
193
|
}
|
|
194
|
+
// ── 5.6. Select Agent Skills to deploy ──────────────────────────────
|
|
195
|
+
const catalogSkills = await getAllSkills();
|
|
196
|
+
const selectedSkills = await promptSelectSkills(catalogSkills);
|
|
197
|
+
if (selectedSkills.length > 0) {
|
|
198
|
+
console.log(chalk.green(` ✔ Selected ${selectedSkills.length} skill(s) to deploy: ${selectedSkills.join(', ')}`));
|
|
199
|
+
}
|
|
193
200
|
// ── 6. Create workspace ─────────────────────────────────────────────
|
|
194
201
|
const workspacePath = path.join(config.workspacesDir, workspaceId);
|
|
195
202
|
const feature = {
|
|
@@ -213,6 +220,13 @@ export async function createCommand() {
|
|
|
213
220
|
await createWorkspace(feature, selectedRepos, (repoName, index, total) => {
|
|
214
221
|
wsSpinner.text = `Creating worktrees… ${repoName} (${index + 1}/${total})`;
|
|
215
222
|
});
|
|
223
|
+
if (selectedSkills.length > 0) {
|
|
224
|
+
await saveWorkspaceSkillsConfig(workspacePath, {
|
|
225
|
+
enabledSkills: selectedSkills,
|
|
226
|
+
enabledAgents: [],
|
|
227
|
+
enabledCategories: [],
|
|
228
|
+
});
|
|
229
|
+
}
|
|
216
230
|
wsSpinner.succeed(`Workspace created at ${chalk.bold(workspacePath)}`);
|
|
217
231
|
}
|
|
218
232
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/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,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-cPldH5S4.js";import{t as ee,xt as o}from"./spinner-BCEaGbib.js";import{t as s}from"./bot-wH0FKlic.js";import{a as te,c,i as l,n as ne,o as re,r as ie,s as ae,t as oe}from"./alert-dialog-Cjwogh-W.js";import{t as se}from"./search-ChVovkOL.js";import{t as ce}from"./trash-2-Da8F2gKd.js";import{B as le,Dt as ue,G as de,R as fe,Y as pe,d as u,f as d,ft as me,g as f,h as p,ht as he,jt as ge,p as m,pt as _e,tt as ve,u as h,wt as g}from"./index-ofoYKpCG.js";import{t as _}from"./badge-BnkhqVEF.js";import{t as ye}from"./card-82INhRRE.js";import{a as v,i as be,n as y,r as b,t as x}from"./empty-DWyDwDYB.js";import{t as S}from"./label-JFgMNsTn.js";import{t as C}from"./textarea-D3-elOAa.js";var xe=r(`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=t(e(),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`),[r,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}=fe(),{data:U=[]}=_e(),W=me(t===`global`?``:t),G=ve(),K=pe(),q=de(),J=le(),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=r.trim().toLowerCase();return e?H.filter(t=>[t.name,t.description,t.category].some(t=>t.toLowerCase().includes(e))):H},[H,r]),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)(s,{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)(a,{render:(0,T.jsx)(he,{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)(ue,{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)(a,{size:`sm`,onClick:Me,disabled:!Z||J.isPending,children:J.isPending?`Saving…`:`Save selection`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(a,{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)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(g,{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)(se,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(o,{value:r,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)(ee,{})}):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)(s,{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)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(g,{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:i(`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)(a,{variant:t?`default`:`outline`,size:`sm`,onClick:()=>je(e.id),disabled:!Z,children:[(0,T.jsx)(ge,{className:i(`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)(a,{variant:`ghost`,size:`icon`,"aria-label":`Edit ${e.name}`,onClick:()=>De(e),children:(0,T.jsx)(c,{className:`h-4 w-4`})}),(0,T.jsx)(a,{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)(h,{open:Se,onOpenChange:k,children:(0,T.jsxs)(p,{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)(o,{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)(o,{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)(o,{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)(d,{children:[(0,T.jsx)(a,{variant:`outline`,onClick:()=>k(!1),children:`Cancel`}),(0,T.jsx)(a,{onClick:Oe,disabled:G.isPending||!P.name||!P.description||!P.developerInstructions,children:G.isPending?`Saving…`:`Save agent`})]})]})}),(0,T.jsx)(h,{open:A,onOpenChange:j,children:(0,T.jsxs)(p,{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)(d,{children:[(0,T.jsx)(a,{variant:`outline`,onClick:()=>j(!1),children:`Cancel`}),(0,T.jsx)(a,{onClick:ke,disabled:K.isPending||!I.trim(),children:K.isPending?`Importing…`:`Import agent`})]})]})}),(0,T.jsx)(oe,{open:B!==null,onOpenChange:e=>!e&&V(null),children:(0,T.jsxs)(re,{children:[(0,T.jsxs)(te,{children:[(0,T.jsxs)(ae,{children:[`Delete “`,B?.name,`”?`]}),(0,T.jsx)(ie,{children:`This removes the agent from the personal catalog. Existing workspace copies remain until the workspace is refreshed.`})]}),(0,T.jsxs)(l,{children:[(0,T.jsx)(ne,{render:(0,T.jsx)(a,{variant:`outline`,children:`Cancel`})}),(0,T.jsx)(a,{variant:`destructive`,onClick:Ae,disabled:q.isPending,children:q.isPending?`Deleting…`:`Delete agent`})]})]})})]})}export{O as AgentsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./git-branch-Dw55pQWa.js";import{Ct as r,Dt as i,Pt as a,Tt as o,bt as s,c,l,wt as u}from"./index-ofoYKpCG.js";import{n as d,t as f}from"./card-82INhRRE.js";import{a as p,i as m,n as h,r as g,t as _}from"./empty-DWyDwDYB.js";import{t as v}from"./skeleton-CCPbfn1L.js";var y=e();function b({icon:e,label:t,value:n,tone:r}){return(0,y.jsxs)(d,{className:`gap-3.5 p-4`,children:[(0,y.jsx)(`div`,{className:`grid h-9 w-9 shrink-0 place-items-center rounded-md ${r}`,children:e}),(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsx)(`div`,{className:`text-xl font-bold leading-none text-foreground`,children:n}),(0,y.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})]})}function x({workspaces:e,workspaceStatuses:x,workspacesLoading:S,statusesLoading:C,onOpenWorkspace:w,onNewWorkspace:T}){let E=Object.values(x),D=E.filter(e=>e.changedFiles>0).length,O=E.reduce((e,t)=>e+t.runningServices,0),k=E.filter(e=>e.pendingValidation).length;return(0,y.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in`,children:[(0,y.jsxs)(`header`,{className:`mb-6`,children:[(0,y.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Overview`}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Your multi-repo environment at a glance.`})]}),(0,y.jsxs)(`div`,{className:`mb-8 grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,y.jsx)(b,{icon:(0,y.jsx)(i,{size:18,className:`text-primary`}),tone:`bg-primary/10`,label:`Workspaces`,value:e.length}),(0,y.jsx)(b,{icon:(0,y.jsx)(n,{size:18,className:`text-warning`}),tone:`bg-warning/10`,label:`With uncommitted changes`,value:D}),(0,y.jsx)(b,{icon:(0,y.jsx)(o,{size:18,className:`text-running`}),tone:`bg-running/10`,label:`Running services`,value:O}),(0,y.jsx)(b,{icon:(0,y.jsx)(s,{size:18,className:`text-warning`}),tone:`bg-warning/10`,label:`Need validation`,value:k})]}),(0,y.jsx)(`div`,{className:`mb-3 flex items-center justify-between`,children:(0,y.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-muted-foreground`,children:`Workspaces`})}),S?(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(v,{className:`h-20`}),(0,y.jsx)(v,{className:`h-20`}),(0,y.jsx)(v,{className:`h-20`})]}):e.length===0?(0,y.jsx)(f,{className:`border-dashed`,children:(0,y.jsxs)(_,{children:[(0,y.jsxs)(g,{children:[(0,y.jsx)(m,{variant:`icon`,children:(0,y.jsx)(i,{})}),(0,y.jsx)(p,{children:`No workspaces yet`}),(0,y.jsx)(h,{children:`Create a feature workspace to group repositories and give your AI assistants shared context.`})]}),(0,y.jsxs)(t,{onClick:T,children:[(0,y.jsx)(u,{size:16}),` New workspace`]})]})}):(0,y.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>{let t=x[e.branchName],n=t?c(t.syncStatus):null;return(0,y.jsxs)(d,{className:`group cursor-pointer gap-4 p-4 transition-colors hover:border-foreground/15 hover:bg-accent/50`,onClick:()=>w(e.branchName),children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate font-mono text-sm font-semibold text-foreground`,children:e.branchName}),(0,y.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[e.repos.length,` repos`]})]}),e.description&&(0,y.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description})]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[!t&&C?(0,y.jsx)(v,{className:`h-5 w-40`}):t?(0,y.jsxs)(y.Fragment,{children:[t.changedFiles>0?(0,y.jsxs)(l,{tone:`warning`,dot:!0,children:[t.changedFiles,` changed`]}):(0,y.jsx)(l,{tone:`idle`,dot:!0,children:`Clean`}),t.runningServices>0&&(0,y.jsxs)(l,{tone:`running`,dot:!0,children:[t.runningServices,` running`]}),n&&(0,y.jsxs)(l,{tone:n.tone,children:[(0,y.jsx)(r,{size:11}),` `,n.label]})]}):null,(0,y.jsx)(a,{size:16,className:`text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-foreground`})]})]},e.id)})})]})}export{x as DashboardPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./circle-plus-C0PNc7h4.js";import{
|
|
1
|
+
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./circle-plus-C0PNc7h4.js";import{St as r}from"./index-ofoYKpCG.js";var i=e();function a({config:e,onCreateWorkspace:a,onModifySettings:o}){return(0,i.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,i.jsxs)(`header`,{className:`mb-10`,children:[(0,i.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,i.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:`Welcome to NexusFlow`}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`NexusFlow orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`})]}),(0,i.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`NexusFlow Workflows`}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.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,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,i.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,i.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.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,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Choose repositories and feature branch. NexusFlow checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.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,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`NexusFlow writes files like `,(0,i.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,i.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,i.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,i.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,i.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,i.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,i.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,i.jsxs)(t,{className:`w-full gap-2`,onClick:a,children:[(0,i.jsx)(n,{size:14}),` Create a Workspace`]}),(0,i.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:o,children:[(0,i.jsx)(r,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{a as GettingStartedPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,t as r}from"./button-cPldH5S4.js";import{t as i,xt as a}from"./spinner-BCEaGbib.js";import{n as o,t as s}from"./ScaffoldRepoInline-BSpQbVe7.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./alert-dialog-Cjwogh-W.js";import{t as g}from"./trash-2-Da8F2gKd.js";import{Dt as _,H as v,K as y,Tt as b,Z as x,_t as S,d as ee,et as C,f as w,g as T,h as E,m as D,p as O,pt as k,st as A,u as j,wt as M}from"./index-ofoYKpCG.js";import{t as N}from"./badge-BnkhqVEF.js";import{a as P,i as F,n as I,r as L,t as te}from"./empty-DWyDwDYB.js";var R=t(e(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=S(),t=x(),n=C(),V=k(),H=v(),U=A(),W=y(),[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 items-center justify-between gap-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(M,{}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(i,{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)(_,{})}),(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)(r,{onClick:Q,children:[(0,z.jsx)(M,{}),` 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 bg-card p-4 transition-colors hover:border-foreground/15`,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)(r,{size:`sm`,onClick:()=>e(`/new?project=${encodeURIComponent(t.id)}`),children:[(0,z.jsx)(b,{}),` Start work`]}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Edit ${t.name}`,onClick:()=>ne(t),children:(0,z.jsx)(l,{})}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${t.name}`,onClick:()=>X(t),children:(0,z.jsx)(g,{})})]})]})},t.id))}),(0,z.jsx)(j,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(E,{className:`max-w-lg`,children:[(0,z.jsxs)(O,{children:[(0,z.jsx)(T,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(ee,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,z.jsxs)(D,{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)(a,{value:G?.name??``,onChange:e=>K(t=>t&&{...t,name:e.target.value}),placeholder:`e.g. Hogia 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)(a,{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)(o,{repos:n.data??[],selectedPaths:G?.repoPaths??[],onToggle:re,loading:n.isLoading,emptyHint:`No repositories found in your dev directory.`}),(0,z.jsx)(s,{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)(r,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(r,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(i,{}):null,G?.editingId?`Save changes`:`Create project`]})]})]})}),(0,z.jsx)(h,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,z.jsxs)(f,{children:[(0,z.jsxs)(c,{children:[(0,z.jsxs)(m,{children:[`Remove “`,Y?.name,`”?`]}),(0,z.jsx)(p,{children:`This only removes the project from the registry — repositories and workspaces on disk are not touched.`})]}),(0,z.jsxs)(u,{children:[(0,z.jsx)(d,{render:(0,z.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,z.jsxs)(r,{variant:`destructive`,onClick:ae,disabled:W.isPending,children:[W.isPending?(0,z.jsx)(i,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,b as t,d as n,g as r,h as i,i as a,l as o,m as s,o as c,p as l,s as u,t as d,u as ee}from"./button-cPldH5S4.js";import{$n as f,Bn as p,Ct as te,Ht as ne,Pt as m,Qn as re,S as ie,Ut as h,Vt as ae,Wt as g,Xn as oe,Yn as se,bt as ce,er as _,nr as v,qt as y,t as b,xt as x,yt as le}from"./spinner-BCEaGbib.js";import{t as S}from"./search-ChVovkOL.js";import{t as ue}from"./useAriaLabelledBy-DmwmZIqb.js";import{t as de}from"./useValueChanged-BfI2s7NX.js";import{U as C}from"./index-CcIOIZ24.js";var fe=i(`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=t(e(),1),T=w.createContext({disabled:!1});function pe(){return w.useContext(T)}var E=w.createContext(void 0);function me(e=!0){let t=w.useContext(E);if(t===void 0&&!e)throw Error(n(3));return t}function he(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}var D=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function ge(e){return w.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[D.checked]:``}:{[D.unchecked]:``}},..._}),[e.indeterminate])}var _e=w.createContext(void 0);function O(){let e=w.useContext(_e);if(e===void 0)throw Error(n(14));return e}var k=r(),ve=`data-parent`,ye=w.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":s,disabled:d=!1,form:h,id:g,indeterminate:_=!1,inputRef:y,name:b,onCheckedChange:x,parent:S=!1,readOnly:C=!1,render:fe,required:T=!1,uncheckedValue:E,value:D,nativeButton:O=!1,style:ye,...A}=e,{clearErrors:j}=re(),{disabled:M,name:N,setDirty:be,setFilled:P,setFocused:xe,setTouched:Se,state:Ce,validationMode:we,validityData:Te,validation:Ee}=f(),De=pe(),{labelId:Oe,controlId:ke,registerControlId:F,getDescriptionProps:Ae}=se(),I=me(),L=I?.parent,R=L&&I.allValues,z=M||De.disabled||I?.disabled||d,B=N??b,V=D??B,je=oe(),Me=oe(),H=ke;R?H=S?Me:`${L.id}-${V}`:g&&(H=g);let U={};R&&(S?U=I.parent.getParentProps():V&&(U=I.parent.getChildProps(V)));let{checked:Ne=n,indeterminate:Pe=_,onCheckedChange:Fe,...Ie}=U,W=I?.value,Le=I?.setValue,Re=I?.defaultValue,G=w.useRef(null),K=ee(()=>Symbol(`checkbox-control`)),q=w.useRef(!1),{getButtonProps:ze,buttonRef:Be}=ie({disabled:z,native:O}),J=I?.validation??Ee,[Y,Ve]=ne({controlled:V&&W&&!S?W.includes(V):Ne,default:V&&Re&&!S?Re.includes(V):i,name:`Checkbox`,state:`checked`}),X=R?!!Ne:Y,Z=R&&Pe||_;v(()=>{F!==u&&(q.current=!0,F(K.current,H))},[H,F,K]),w.useEffect(()=>{let e=K.current;return()=>{!q.current||F===u||(q.current=!1,F(e,void 0))}},[F,K]),ae(G,je,Y,void 0,!I&&!z,b);let Q=w.useRef(null),He=o(y,Q,J.inputRef,J.registerInput),Ue=ue(s,Oe,Q,!O,H??void 0);v(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&P(!0))},[Y,Z,P]),de(Y,()=>{I||(j(B),P(Y),be(Y!==Te.initialValue),J.change(Y))});let We=l({checked:Y,disabled:z,form:h,name:S?void 0:B,id:O?void 0:H??void 0,required:T,ref:He,style:B?ce:le,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(C){e.preventDefault();return}let t=e.currentTarget.checked,n=te(m,e.nativeEvent);if(x?.(t,n),!n.isCanceled&&(Fe?.(t,n),!n.isCanceled&&(Ve(t),V&&W&&Le&&!S&&!R))){let e=t?[...W,V]:W.filter(e=>e!==V);Le(e,n)}},onFocus(){G.current?.focus()}},D===void 0?c:{value:(I?Y&&D:D)||``},Ae,e=>J.getValidationProps(z,e));w.useEffect(()=>{if(!L||!V)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=w.useMemo(()=>({...Ce,checked:X,disabled:z,readOnly:C,required:T,indeterminate:Z}),[Ce,X,z,C,T,Z]),Ge=ge($),Ke=a(`span`,e,{state:$,ref:[Be,G,t,I?.registerControlRef],props:[{id:O?H??void 0:je,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":C||void 0,"aria-required":T||void 0,"aria-labelledby":Ue,[ve]:S?``:void 0,onFocus(){z||xe(!0)},onBlur(){let e=Q.current;e&&(Se(!0),xe(!1),we===`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),p(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||he(t)?.click()})},onClick(e){if(C||z)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(p(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},A,Ie,ze,Ae,e=>J.getValidationProps(z,e)],stateAttributesMapping:Ge});return(0,k.jsxs)(_e.Provider,{value:$,children:[Ke,!Y&&!I&&B&&!S&&E!==void 0&&(0,k.jsx)(`input`,{type:`hidden`,form:h,name:B,value:E,disabled:z}),(0,k.jsx)(`input`,{...We,suppressHydrationWarning:!0})]})}),A=w.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:o=!1,...s}=e,c=O(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:ee}=h(l),f=w.useRef(null),p={...c,transitionStatus:d};g({open:l,ref:f,onComplete(){l||ee(!1)}});let te={...ge(c),...y,..._},ne=o||u,m=a(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:te,props:s});return ne?m:null});function j({className:e,...t}){return(0,k.jsx)(ye,{className:s(`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)(A,{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 M({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a}){let[o,c]=(0,w.useState)(``),l=(0,w.useMemo)(()=>{let t=o.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,o]);return(0,k.jsxs)(`div`,{className:s(`flex flex-col gap-2`,a),children:[(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(S,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,k.jsx)(x,{value:o,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=>(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)(j,{checked:t.includes(e.path),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.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})},e.path))})})]})}function N({onCreated:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(``),[a,o]=(0,w.useState)(null),s=C(),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)(x,{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)(d,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,k.jsx)(b,{}):null,`Create`]}),(0,k.jsx)(d,{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)(fe,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{M as n,j as r,N as t};
|
|
1
|
+
import{_ as e,b as t,d as n,g as r,h as i,i as a,l as o,m as s,o as c,p as l,s as u,t as d,u as ee}from"./button-cPldH5S4.js";import{$n as f,Bn as p,Ct as te,Ht as ne,Pt as m,Qn as re,S as ie,Ut as h,Vt as ae,Wt as g,Xn as oe,Yn as se,bt as ce,er as _,nr as v,qt as y,t as b,xt as x,yt as le}from"./spinner-BCEaGbib.js";import{t as S}from"./search-ChVovkOL.js";import{t as ue}from"./useAriaLabelledBy-DmwmZIqb.js";import{t as de}from"./useValueChanged-BfI2s7NX.js";import{U as C}from"./index-ofoYKpCG.js";var fe=i(`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=t(e(),1),T=w.createContext({disabled:!1});function pe(){return w.useContext(T)}var E=w.createContext(void 0);function me(e=!0){let t=w.useContext(E);if(t===void 0&&!e)throw Error(n(3));return t}function he(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}var D=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function ge(e){return w.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[D.checked]:``}:{[D.unchecked]:``}},..._}),[e.indeterminate])}var _e=w.createContext(void 0);function O(){let e=w.useContext(_e);if(e===void 0)throw Error(n(14));return e}var k=r(),ve=`data-parent`,ye=w.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":s,disabled:d=!1,form:h,id:g,indeterminate:_=!1,inputRef:y,name:b,onCheckedChange:x,parent:S=!1,readOnly:C=!1,render:fe,required:T=!1,uncheckedValue:E,value:D,nativeButton:O=!1,style:ye,...A}=e,{clearErrors:j}=re(),{disabled:M,name:N,setDirty:be,setFilled:P,setFocused:xe,setTouched:Se,state:Ce,validationMode:we,validityData:Te,validation:Ee}=f(),De=pe(),{labelId:Oe,controlId:ke,registerControlId:F,getDescriptionProps:Ae}=se(),I=me(),L=I?.parent,R=L&&I.allValues,z=M||De.disabled||I?.disabled||d,B=N??b,V=D??B,je=oe(),Me=oe(),H=ke;R?H=S?Me:`${L.id}-${V}`:g&&(H=g);let U={};R&&(S?U=I.parent.getParentProps():V&&(U=I.parent.getChildProps(V)));let{checked:Ne=n,indeterminate:Pe=_,onCheckedChange:Fe,...Ie}=U,W=I?.value,Le=I?.setValue,Re=I?.defaultValue,G=w.useRef(null),K=ee(()=>Symbol(`checkbox-control`)),q=w.useRef(!1),{getButtonProps:ze,buttonRef:Be}=ie({disabled:z,native:O}),J=I?.validation??Ee,[Y,Ve]=ne({controlled:V&&W&&!S?W.includes(V):Ne,default:V&&Re&&!S?Re.includes(V):i,name:`Checkbox`,state:`checked`}),X=R?!!Ne:Y,Z=R&&Pe||_;v(()=>{F!==u&&(q.current=!0,F(K.current,H))},[H,F,K]),w.useEffect(()=>{let e=K.current;return()=>{!q.current||F===u||(q.current=!1,F(e,void 0))}},[F,K]),ae(G,je,Y,void 0,!I&&!z,b);let Q=w.useRef(null),He=o(y,Q,J.inputRef,J.registerInput),Ue=ue(s,Oe,Q,!O,H??void 0);v(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&P(!0))},[Y,Z,P]),de(Y,()=>{I||(j(B),P(Y),be(Y!==Te.initialValue),J.change(Y))});let We=l({checked:Y,disabled:z,form:h,name:S?void 0:B,id:O?void 0:H??void 0,required:T,ref:He,style:B?ce:le,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(C){e.preventDefault();return}let t=e.currentTarget.checked,n=te(m,e.nativeEvent);if(x?.(t,n),!n.isCanceled&&(Fe?.(t,n),!n.isCanceled&&(Ve(t),V&&W&&Le&&!S&&!R))){let e=t?[...W,V]:W.filter(e=>e!==V);Le(e,n)}},onFocus(){G.current?.focus()}},D===void 0?c:{value:(I?Y&&D:D)||``},Ae,e=>J.getValidationProps(z,e));w.useEffect(()=>{if(!L||!V)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=w.useMemo(()=>({...Ce,checked:X,disabled:z,readOnly:C,required:T,indeterminate:Z}),[Ce,X,z,C,T,Z]),Ge=ge($),Ke=a(`span`,e,{state:$,ref:[Be,G,t,I?.registerControlRef],props:[{id:O?H??void 0:je,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":C||void 0,"aria-required":T||void 0,"aria-labelledby":Ue,[ve]:S?``:void 0,onFocus(){z||xe(!0)},onBlur(){let e=Q.current;e&&(Se(!0),xe(!1),we===`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),p(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||he(t)?.click()})},onClick(e){if(C||z)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(p(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},A,Ie,ze,Ae,e=>J.getValidationProps(z,e)],stateAttributesMapping:Ge});return(0,k.jsxs)(_e.Provider,{value:$,children:[Ke,!Y&&!I&&B&&!S&&E!==void 0&&(0,k.jsx)(`input`,{type:`hidden`,form:h,name:B,value:E,disabled:z}),(0,k.jsx)(`input`,{...We,suppressHydrationWarning:!0})]})}),A=w.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:o=!1,...s}=e,c=O(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:ee}=h(l),f=w.useRef(null),p={...c,transitionStatus:d};g({open:l,ref:f,onComplete(){l||ee(!1)}});let te={...ge(c),...y,..._},ne=o||u,m=a(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:te,props:s});return ne?m:null});function j({className:e,...t}){return(0,k.jsx)(ye,{className:s(`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)(A,{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 M({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a}){let[o,c]=(0,w.useState)(``),l=(0,w.useMemo)(()=>{let t=o.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,o]);return(0,k.jsxs)(`div`,{className:s(`flex flex-col gap-2`,a),children:[(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(S,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,k.jsx)(x,{value:o,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=>(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)(j,{checked:t.includes(e.path),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.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})},e.path))})})]})}function N({onCreated:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(``),[a,o]=(0,w.useState)(null),s=C(),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)(x,{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)(d,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,k.jsx)(b,{}):null,`Create`]}),(0,k.jsx)(d,{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)(fe,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{M as n,j as r,N as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,b as t,d as n,g as r,i,l as a,m as o,n as s,o as c,p as l,t as u}from"./button-cPldH5S4.js";import{$n as d,Bn as f,Ct as p,Ht as m,Pt as ee,Qn as te,S as ne,Vt as h,Xn as g,Yn as re,bt as ie,er as _,jn as ae,nr as oe,t as v,xt as y,yt as se}from"./spinner-BCEaGbib.js";import{t as ce}from"./useAriaLabelledBy-DmwmZIqb.js";import{t as le}from"./useValueChanged-BfI2s7NX.js";import{t as b}from"./Separator-Chx6O62Y.js";import{A as x,At as S,M as C,N as w,St as ue,j as T,k as E,yt as de}from"./index-CcIOIZ24.js";import{t as D}from"./badge-BnkhqVEF.js";import{t as O}from"./card-82INhRRE.js";import{t as k}from"./label-JFgMNsTn.js";var A=t(e(),1),j=r(),M=s(`relative rounded-xl border px-3.5 py-3 text-card-foreground text-sm`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 text-destructive-foreground [&_[data-slot=alert-description]]:text-destructive-foreground/80 [&_svg]:text-destructive`,info:`border-info/32 bg-info/4 [&_svg]:text-info`,success:`border-success/32 bg-success/4 [&_svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&_svg]:text-warning`}}});function N(e){let t=e.props[`data-slot`];if(t)return t;let n=e.type;switch(n.displayName??n.name){case`AlertAction`:return`alert-action`;case`AlertTitle`:return`alert-title`;case`AlertDescription`:return`alert-description`;default:return}}function P({className:e,variant:t,children:n,...r}){let i=[],a=[],s=[];return A.Children.forEach(n,e=>{if(!(0,A.isValidElement)(e)){a.push(e);return}let t=N(e);t===`alert-action`?s.push(e):t===`alert-title`||t===`alert-description`?a.push(e):i.push(e)}),(0,j.jsx)(`div`,{className:o(M({variant:t}),e),"data-slot":`alert`,role:`alert`,...r,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i.length>0&&(0,j.jsx)(`div`,{className:`flex size-4 shrink-0 items-center justify-center [&>svg]:size-full`,children:i}),a.length>0&&(0,j.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:a}),s.length>0&&(0,j.jsx)(`div`,{className:`flex shrink-0 items-center self-center`,children:s})]})})}function F({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`font-medium`,e),"data-slot":`alert-title`,...t})}function I({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex flex-col gap-2.5 text-muted-foreground`,e),"data-slot":`alert-description`,...t})}function L({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex gap-1`,e),"data-slot":`alert-action`,...t})}F.displayName=`AlertTitle`,I.displayName=`AlertDescription`,L.displayName=`AlertAction`;function R({className:e,orientation:t=`horizontal`,...n}){return(0,j.jsx)(b,{className:o(`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 z=A.createContext(void 0);function B(){let e=A.useContext(z);if(e===void 0)throw Error(n(63));return e}var V=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),H={..._,checked(e){return e?{[V.checked]:``}:{[V.unchecked]:``}}},U=A.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:o,"aria-labelledby":s,form:u,id:_,inputRef:v,name:y,nativeButton:b=!1,onCheckedChange:x,readOnly:S=!1,required:C=!1,disabled:w=!1,render:ue,uncheckedValue:T,value:E,style:de,...D}=e,{clearErrors:O}=te(),{state:k,setTouched:M,setDirty:N,validityData:P,setFilled:F,setFocused:I,validationMode:L,disabled:R,name:B,validation:V}=d(),{labelId:U}=re(),W=R||w,G=B??y,K=A.useRef(null),fe=a(K,v,V.inputRef),q=A.useRef(null),J=g(),Y=ae({id:_,implicit:!1,controlRef:q}),X=b?void 0:Y,[Z,pe]=m({controlled:n,default:!!o,name:`Switch`,state:`checked`});h(q,J,Z,void 0,!W,y),oe(()=>{K.current&&F(K.current.checked)},[K,F]),le(Z,()=>{O(G),N(Z!==P.initialValue),F(Z),V.change(Z)});let{getButtonProps:Q,buttonRef:me}=ne({disabled:W,native:b}),he=ce(s,U,K,!b,X),ge={id:b?Y:J,role:`switch`,"aria-checked":Z,"aria-readonly":S||void 0,"aria-required":C||void 0,"aria-labelledby":he,onFocus(){W||I(!0)},onBlur(){let e=K.current;!e||W||(M(!0),I(!1),L===`onBlur`&&V.commit(e.checked))},onClick(e){if(S||W)return;e.preventDefault();let t=K.current;t&&t.dispatchEvent(new(f(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},_e=l({checked:Z,disabled:W,form:u,id:X,name:G,required:C,style:G?ie:se,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:fe,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(S){e.preventDefault();return}let t=e.currentTarget.checked,n=p(ee,e.nativeEvent);x?.(t,n),!n.isCanceled&&pe(t)},onFocus(){q.current?.focus()}},e=>V.getValidationProps(W,e),E===void 0?c:{value:E}),$=A.useMemo(()=>({...k,checked:Z,disabled:W,readOnly:S,required:C}),[k,Z,W,S,C]),ve=i(`span`,e,{state:$,ref:[t,q,me],props:[ge,D,Q,e=>V.getValidationProps(W,e)],stateAttributesMapping:H});return(0,j.jsxs)(z.Provider,{value:$,children:[ve,!Z&&G&&T!==void 0&&(0,j.jsx)(`input`,{type:`hidden`,form:u,name:G,value:T,disabled:W}),(0,j.jsx)(`input`,{..._e,suppressHydrationWarning:!0})]})}),W=A.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e;return i(`span`,e,{state:B(),ref:t,stateAttributesMapping:H,props:o})});function G({className:e,...t}){return(0,j.jsx)(U,{className:o(`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,j.jsx)(W,{className:o(`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 K({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:c,updatingToolId:l,fetchToolsStatus:d,handleUpdateTool:f}){if(!e)return null;let p=r.find(t=>t.command===e.defaultEditor),m=i.find(t=>t.name===(e.storageProvider||`local`));return(0,j.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,j.jsxs)(`header`,{className:`mb-6`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Global Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Configure your local directories, search parameters, and editor defaults.`})]}),n===`success`&&(0,j.jsxs)(P,{variant:`success`,className:`mb-6`,children:[(0,j.jsx)(S,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,j.jsxs)(P,{variant:`error`,className:`mb-6`,children:[(0,j.jsx)(de,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,j.jsx)(O,{className:`mb-6 rounded-xl p-6 shadow-sm`,children:(0,j.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Development Directory`}),(0,j.jsx)(y,{type:`text`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Workspaces Directory`}),(0,j.jsx)(y,{type:`text`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Repo Search Depth`}),(0,j.jsx)(y,{type:`number`,min:1,max:5,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Default Assistant`}),(0,j.jsxs)(E,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,j.jsx)(C,{"aria-label":`Default Assistant`,children:(0,j.jsx)(w,{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,j.jsxs)(T,{alignItemWithTrigger:!1,children:[(0,j.jsx)(x,{value:``,children:`None (Prompt me)`}),(0,j.jsx)(x,{value:`claude`,children:`Claude Code`}),(0,j.jsx)(x,{value:`antigravity`,children:`Antigravity`}),(0,j.jsx)(x,{value:`codex`,children:`Codex`}),(0,j.jsx)(x,{value:`copilot`,children:`GitHub Copilot`}),(0,j.jsx)(x,{value:`cursor`,children:`Cursor`})]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Preferred Editor`}),(0,j.jsxs)(E,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,j.jsx)(C,{"aria-label":`Preferred Editor`,children:(0,j.jsx)(w,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,j.jsxs)(T,{alignItemWithTrigger:!1,children:[(0,j.jsx)(x,{value:``,children:`No preference`}),r.map(e=>(0,j.jsxs)(x,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,j.jsx)(R,{className:`mt-1`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,j.jsx)(k,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,j.jsxs)(E,{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,j.jsx)(C,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,j.jsx)(w,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,j.jsx)(T,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,j.jsx)(x,{value:e.name,children:e.displayName},e.name)):(0,j.jsx)(x,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m?.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,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,j.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,j.jsxs)(k,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,j.jsx)(G,{checked:!!i,onCheckedChange:e=>a(e)}),(0,j.jsxs)(`span`,{className:`flex flex-col`,children:[(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,j.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:r.label}),(0,j.jsx)(y,{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,j.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,j.jsxs)(O,{className:`mt-6 rounded-xl p-6 shadow-sm`,children:[(0,j.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,j.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:c,children:[c?(0,j.jsx)(v,{className:`size-3`}):(0,j.jsx)(ue,{size:13}),c?`Checking...`:`Check Now`]})]}),c&&s.length===0?(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,j.jsx)(v,{className:`size-6`}),(0,j.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,j.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,j.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,j.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,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,j.jsx)(D,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,j.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,j.jsxs)(`span`,{children:[`Installed version: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,j.jsxs)(`span`,{children:[`Latest: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,j.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,j.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,j.jsx)(u,{size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(v,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(D,{variant:`success`,className:`gap-1.5`,children:[(0,j.jsx)(S,{size:12}),` Up to Date`]}),(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(v,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(v,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,j.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,j.jsxs)(u,{onClick:()=>a(e),disabled:!o,children:[(0,j.jsx)(S,{size:16}),` Save Configuration`]})})]})}export{K as SettingsPage};
|
|
1
|
+
import{_ as e,b as t,d as n,g as r,i,l as a,m as o,n as s,o as c,p as l,t as u}from"./button-cPldH5S4.js";import{$n as d,Bn as f,Ct as p,Ht as m,Pt as ee,Qn as te,S as ne,Vt as re,Xn as h,Yn as ie,bt as ae,er as g,jn as oe,nr as se,t as _,xt as v,yt as ce}from"./spinner-BCEaGbib.js";import{t as le}from"./useAriaLabelledBy-DmwmZIqb.js";import{t as ue}from"./useValueChanged-BfI2s7NX.js";import{t as y}from"./Separator-Chx6O62Y.js";import{A as b,Ct as x,M as S,N as C,bt as de,j as w,jt as T,k as E}from"./index-ofoYKpCG.js";import{t as D}from"./badge-BnkhqVEF.js";import{t as O}from"./card-82INhRRE.js";import{t as k}from"./label-JFgMNsTn.js";var A=t(e(),1),j=r(),M=s(`relative rounded-xl border px-3.5 py-3 text-card-foreground text-sm`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 text-destructive-foreground [&_[data-slot=alert-description]]:text-destructive-foreground/80 [&_svg]:text-destructive`,info:`border-info/32 bg-info/4 [&_svg]:text-info`,success:`border-success/32 bg-success/4 [&_svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&_svg]:text-warning`}}});function N(e){let t=e.props[`data-slot`];if(t)return t;let n=e.type;switch(n.displayName??n.name){case`AlertAction`:return`alert-action`;case`AlertTitle`:return`alert-title`;case`AlertDescription`:return`alert-description`;default:return}}function P({className:e,variant:t,children:n,...r}){let i=[],a=[],s=[];return A.Children.forEach(n,e=>{if(!(0,A.isValidElement)(e)){a.push(e);return}let t=N(e);t===`alert-action`?s.push(e):t===`alert-title`||t===`alert-description`?a.push(e):i.push(e)}),(0,j.jsx)(`div`,{className:o(M({variant:t}),e),"data-slot":`alert`,role:`alert`,...r,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i.length>0&&(0,j.jsx)(`div`,{className:`flex size-4 shrink-0 items-center justify-center [&>svg]:size-full`,children:i}),a.length>0&&(0,j.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:a}),s.length>0&&(0,j.jsx)(`div`,{className:`flex shrink-0 items-center self-center`,children:s})]})})}function F({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`font-medium`,e),"data-slot":`alert-title`,...t})}function I({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex flex-col gap-2.5 text-muted-foreground`,e),"data-slot":`alert-description`,...t})}function L({className:e,...t}){return(0,j.jsx)(`div`,{className:o(`flex gap-1`,e),"data-slot":`alert-action`,...t})}F.displayName=`AlertTitle`,I.displayName=`AlertDescription`,L.displayName=`AlertAction`;function R({className:e,orientation:t=`horizontal`,...n}){return(0,j.jsx)(y,{className:o(`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 z=A.createContext(void 0);function B(){let e=A.useContext(z);if(e===void 0)throw Error(n(63));return e}var V=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),H={...g,checked(e){return e?{[V.checked]:``}:{[V.unchecked]:``}}},U=A.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:o,"aria-labelledby":s,form:u,id:g,inputRef:_,name:v,nativeButton:y=!1,onCheckedChange:b,readOnly:x=!1,required:S=!1,disabled:C=!1,render:de,uncheckedValue:w,value:T,style:E,...D}=e,{clearErrors:O}=te(),{state:k,setTouched:M,setDirty:N,validityData:P,setFilled:F,setFocused:I,validationMode:L,disabled:R,name:B,validation:V}=d(),{labelId:U}=ie(),W=R||C,G=B??v,K=A.useRef(null),fe=a(K,_,V.inputRef),q=A.useRef(null),J=h(),Y=oe({id:g,implicit:!1,controlRef:q}),X=y?void 0:Y,[Z,pe]=m({controlled:n,default:!!o,name:`Switch`,state:`checked`});re(q,J,Z,void 0,!W,v),se(()=>{K.current&&F(K.current.checked)},[K,F]),ue(Z,()=>{O(G),N(Z!==P.initialValue),F(Z),V.change(Z)});let{getButtonProps:Q,buttonRef:me}=ne({disabled:W,native:y}),he=le(s,U,K,!y,X),ge={id:y?Y:J,role:`switch`,"aria-checked":Z,"aria-readonly":x||void 0,"aria-required":S||void 0,"aria-labelledby":he,onFocus(){W||I(!0)},onBlur(){let e=K.current;!e||W||(M(!0),I(!1),L===`onBlur`&&V.commit(e.checked))},onClick(e){if(x||W)return;e.preventDefault();let t=K.current;t&&t.dispatchEvent(new(f(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},_e=l({checked:Z,disabled:W,form:u,id:X,name:G,required:S,style:G?ae:ce,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:fe,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(x){e.preventDefault();return}let t=e.currentTarget.checked,n=p(ee,e.nativeEvent);b?.(t,n),!n.isCanceled&&pe(t)},onFocus(){q.current?.focus()}},e=>V.getValidationProps(W,e),T===void 0?c:{value:T}),$=A.useMemo(()=>({...k,checked:Z,disabled:W,readOnly:x,required:S}),[k,Z,W,x,S]),ve=i(`span`,e,{state:$,ref:[t,q,me],props:[ge,D,Q,e=>V.getValidationProps(W,e)],stateAttributesMapping:H});return(0,j.jsxs)(z.Provider,{value:$,children:[ve,!Z&&G&&w!==void 0&&(0,j.jsx)(`input`,{type:`hidden`,form:u,name:G,value:w,disabled:W}),(0,j.jsx)(`input`,{..._e,suppressHydrationWarning:!0})]})}),W=A.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e;return i(`span`,e,{state:B(),ref:t,stateAttributesMapping:H,props:o})});function G({className:e,...t}){return(0,j.jsx)(U,{className:o(`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,j.jsx)(W,{className:o(`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 K({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:c,updatingToolId:l,fetchToolsStatus:d,handleUpdateTool:f}){if(!e)return null;let p=r.find(t=>t.command===e.defaultEditor),m=i.find(t=>t.name===(e.storageProvider||`local`));return(0,j.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,j.jsxs)(`header`,{className:`mb-6`,children:[(0,j.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Global Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Configure your local directories, search parameters, and editor defaults.`})]}),n===`success`&&(0,j.jsxs)(P,{variant:`success`,className:`mb-6`,children:[(0,j.jsx)(T,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,j.jsxs)(P,{variant:`error`,className:`mb-6`,children:[(0,j.jsx)(de,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,j.jsx)(O,{className:`mb-6 rounded-xl p-6 shadow-sm`,children:(0,j.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Development Directory`}),(0,j.jsx)(v,{type:`text`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Workspaces Directory`}),(0,j.jsx)(v,{type:`text`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Repo Search Depth`}),(0,j.jsx)(v,{type:`number`,min:1,max:5,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Default Assistant`}),(0,j.jsxs)(E,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,j.jsx)(S,{"aria-label":`Default Assistant`,children:(0,j.jsx)(C,{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,j.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,j.jsx)(b,{value:``,children:`None (Prompt me)`}),(0,j.jsx)(b,{value:`claude`,children:`Claude Code`}),(0,j.jsx)(b,{value:`antigravity`,children:`Antigravity`}),(0,j.jsx)(b,{value:`codex`,children:`Codex`}),(0,j.jsx)(b,{value:`copilot`,children:`GitHub Copilot`}),(0,j.jsx)(b,{value:`cursor`,children:`Cursor`})]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:`Preferred Editor`}),(0,j.jsxs)(E,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,j.jsx)(S,{"aria-label":`Preferred Editor`,children:(0,j.jsx)(C,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,j.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,j.jsx)(b,{value:``,children:`No preference`}),r.map(e=>(0,j.jsxs)(b,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,j.jsx)(R,{className:`mt-1`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,j.jsx)(k,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,j.jsxs)(E,{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,j.jsx)(S,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,j.jsx)(C,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,j.jsx)(w,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,j.jsx)(b,{value:e.name,children:e.displayName},e.name)):(0,j.jsx)(b,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m?.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,j.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,j.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,j.jsxs)(k,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,j.jsx)(G,{checked:!!i,onCheckedChange:e=>a(e)}),(0,j.jsxs)(`span`,{className:`flex flex-col`,children:[(0,j.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,j.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(k,{className:`text-sm`,children:r.label}),(0,j.jsx)(v,{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,j.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,j.jsxs)(O,{className:`mt-6 rounded-xl p-6 shadow-sm`,children:[(0,j.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,j.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:c,children:[c?(0,j.jsx)(_,{className:`size-3`}):(0,j.jsx)(x,{size:13}),c?`Checking...`:`Check Now`]})]}),c&&s.length===0?(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,j.jsx)(_,{className:`size-6`}),(0,j.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,j.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,j.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,j.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,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,j.jsx)(D,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,j.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,j.jsxs)(`span`,{children:[`Installed version: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,j.jsxs)(`span`,{children:[`Latest: `,(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,j.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,j.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,j.jsx)(u,{size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(D,{variant:`success`,className:`gap-1.5`,children:[(0,j.jsx)(T,{size:12}),` Up to Date`]}),(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,j.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,j.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,j.jsxs)(u,{onClick:()=>a(e),disabled:!o,children:[(0,j.jsx)(T,{size:16}),` Save Configuration`]})})]})}export{K as SettingsPage};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-cPldH5S4.js";import{t as ee,xt as o}from"./spinner-BCEaGbib.js";import{t as te}from"./chevron-down-DDmhvRLr.js";import{a as s,c,i as ne,l,n as re,o as u,r as ie,s as d,t as f,u as ae}from"./terminal-D1awFRPr.js";import{n as oe,t as p}from"./zap-DhYfYRlq.js";import{t as m}from"./cpu-CPUNnHRM.js";import{t as se}from"./search-ChVovkOL.js";import{t as ce}from"./trash-2-Da8F2gKd.js";import{B as le,Dt as ue,J as de,Mt as h,_ as fe,at as pe,d as g,f as _,ft as me,g as v,h as y,ht as he,jt as ge,nt as _e,ot as ve,p as b,pt as ye,q as be,rt as xe,u as x,wt as Se,xt as Ce,yt as we}from"./index-ofoYKpCG.js";import{t as S}from"./badge-BnkhqVEF.js";import{t as Te}from"./card-82INhRRE.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./empty-DWyDwDYB.js";import{t as C}from"./label-JFgMNsTn.js";import{t as je}from"./textarea-D3-elOAa.js";var Me=r(`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`}]]),Ne=r(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Pe=r(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Fe=r(`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`}]]),Ie=r(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Le=r(`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=t(e(),1),T=n(),E={"git-pull-request":d,"flask-conical":c,package:s,database:l,"shield-check":ne,terminal:f,zap:p,cpu:m,layers:u,boxes:h,code:oe},Re=[{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`),[r,s]=(0,w.useState)(``),[c,ne]=(0,w.useState)({}),[l,u]=(0,w.useState)(!1),[d,f]=(0,w.useState)(null),[oe,p]=(0,w.useState)(!1),[m,D]=(0,w.useState)(null),[ze,O]=(0,w.useState)(!1),[k,A]=(0,w.useState)(`edit`),[Be,j]=(0,w.useState)(!1),[M,N]=(0,w.useState)(null),[Ve,P]=(0,w.useState)(!1),[F,I]=(0,w.useState)(null),[He,L]=(0,w.useState)(null),[R,z]=(0,w.useState)(null),{data:B=[],isLoading:Ue}=pe(),{data:V=[],isLoading:We}=ve(t===`global`?void 0:t),{data:Ge=[]}=ye(),{data:H,isLoading:U,isError:Ke}=me(t===`global`?``:t),[W,G]=(0,w.useState)(null),qe=xe(),Je=de(),K=_e(),Ye=be(),q=le(),J=t!==`global`,Y=new Set(W??H?.enabledSkills??[]),X=!J||!U&&!Ke&&!!H;(0,w.useEffect)(()=>{if(!J){G(null);return}H&&G([...H.enabledSkills])},[J,t,H]);let Xe=e=>{ne(t=>({...t,[e]:!t[e]}))},Z=V.filter(e=>{if(!r.trim())return!0;let t=r.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))}),Ze=B.reduce((e,t)=>(e[t.id]=Z.filter(e=>e.category===t.id),e),{}),Q=Z.filter(e=>!e.category||!B.some(t=>t.id===e.category)),Qe=e=>{f(e||{name:``,description:``,icon:`boxes`,color:`#3b82f6`,custom:!0}),u(!0)},$e=async()=>{if(!(!d||!d.name?.trim()))try{await qe.mutateAsync({id:d.id,name:d.name.trim(),description:d.description,icon:d.icon,color:d.color}),e?.(`Category saved successfully`,`success`),u(!1),f(null)}catch(t){e?.(`Failed to save category`,`error`),console.error(t)}},et=(e,t)=>{t.stopPropagation(),I({type:`category`,id:e.id,title:e.name}),P(!0)},$=(e,t)=>{D(e||{name:``,title:``,category:t||(B[0]?.id??`pull-requests`),description:``,tags:[],allowedTools:[],content:`# Skill Title
|
|
2
|
+
|
|
3
|
+
Instructions and playbook for the AI assistant.
|
|
4
|
+
`,custom:!0}),O(!!e),A(`edit`),p(!0)},tt=e=>{if(!m)return;let t={...m,title:e};!ze&&!m.id&&(t.name=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)),D(t)},nt=async()=>{if(!m||!m.name?.trim()||!m.description?.trim()||!m.content?.trim()){e?.(`Skill name, trigger description, and content are required`,`error`);return}try{await K.mutateAsync({id:m.id,name:m.name.trim(),title:m.title||m.name,category:m.category||`general`,description:m.description||``,tags:m.tags||[],allowedTools:m.allowedTools||[],content:m.content}),e?.(`Skill package saved successfully`,`success`),p(!1),D(null)}catch(t){e?.(`Failed to save skill`,`error`),console.error(t)}},rt=(e,t)=>{t.stopPropagation(),I({type:`skill`,id:e.id,title:e.title||e.name}),P(!0)},it=async()=>{if(F)try{F.type===`category`?(await Je.mutateAsync(F.id),e?.(`Category deleted`,`info`)):(await Ye.mutateAsync(F.id),e?.(`Skill package deleted`,`info`)),P(!1),I(null)}catch(t){e?.(`Failed to delete item`,`error`),console.error(t)}},at=e=>{if(!J||!X||W===null)return;let t=new Set(W);t.has(e)?t.delete(e):t.add(e),G(Array.from(t))},ot=()=>{if(!m||m.custom!==!1)return;let e=`${m.name}-copy`;D({...m,id:void 0,name:e,title:`${m.title||m.name} Copy`,allowedTools:[],custom:!0,sourcePath:void 0,references:void 0,scripts:void 0}),O(!0)},st=(e,t)=>{if(!J||!X||W===null)return;let n=Ze[e]||[],r=new Set(W);for(let e of n)t?r.add(e.id):r.delete(e.id);G(Array.from(r))},ct=async()=>{if(!(!H||W===null||!J))try{await q.mutateAsync({workspaceId:t,expectedRevision:H.revision??0,enabledSkills:W,enabledAgents:H.enabledAgents??[],enabledCategories:B.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`)}},lt=(e,t)=>{e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`,L(t)},ut=(e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,R!==t&&z(t)},dt=()=>{z(null)},ft=async(t,n)=>{t.preventDefault(),z(null);let r=t.dataTransfer.getData(`text/plain`)||He;if(L(null),!r)return;let i=V.find(e=>e.id===r);!i||!i.custom||J||i.category===n||(await K.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`))},pt=(e,t)=>{t.stopPropagation(),N(e),j(!0)},mt=async t=>{if(!M||M.category===t){j(!1),N(null);return}await K.mutateAsync({id:M.id,name:M.name,title:M.title,description:M.description,tags:M.tags,allowedTools:M.allowedTools,content:M.content,category:t}),e?.(`Skill moved to category`,`success`),j(!1),N(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)(h,{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)(a,{render:(0,T.jsx)(he,{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)(ue,{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`}),Ge.map(e=>(0,T.jsxs)(`option`,{value:e.id,className:`bg-popover text-popover-foreground`,children:[`📁 `,e.id,` (`,e.branchName,`)`]},e.id))]})]}),J&&(0,T.jsx)(a,{size:`sm`,onClick:ct,disabled:!X||q.isPending||W===null,children:q.isPending?`Saving…`:`Save selection`}),!J&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>Qe(),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`})]}),(0,T.jsxs)(a,{variant:`default`,size:`sm`,onClick:()=>$(),className:`flex items-center gap-1.5`,children:[(0,T.jsx)(Ce,{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)(se,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,T.jsx)(o,{value:r,onChange:e=>s(e.target.value),placeholder:`Search skills by keyword, tag, or tool...`,className:`pl-9 pr-8 h-9 text-xs`}),r&&(0,T.jsx)(`button`,{onClick:()=>s(``),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,T.jsx)(we,{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:Z.length}),` of`,` `,(0,T.jsx)(`strong`,{className:`text-foreground`,children:V.length}),` skills`]}),J&&(0,T.jsxs)(S,{variant:`secondary`,className:`text-[10px] uppercase font-mono`,children:[`Workspace Mode (`,Y.size,` active)`]})]})]}),(0,T.jsx)(fe,{className:`flex-1 p-6`,children:Ue||We||J&&U?(0,T.jsxs)(`div`,{className:`flex items-center justify-center p-12 gap-3 text-muted-foreground`,children:[(0,T.jsx)(ee,{}),(0,T.jsx)(`span`,{className:`text-sm`,children:`Loading skills catalog...`})]}):J&&Ke?(0,T.jsx)(Ae,{className:`py-12 border border-dashed rounded-xl`,children:(0,T.jsxs)(ke,{children:[(0,T.jsx)(Ee,{children:`Workspace resources could not be loaded`}),(0,T.jsx)(Oe,{children:`Assignment controls are disabled so an existing selection cannot be overwritten.`})]})}):Z.length===0&&r?(0,T.jsxs)(Ae,{className:`py-12 border border-dashed rounded-xl`,children:[(0,T.jsx)(De,{children:(0,T.jsx)(se,{className:`h-8 w-8 text-muted-foreground/60`})}),(0,T.jsxs)(ke,{children:[(0,T.jsx)(Ee,{children:`No matching skills found`}),(0,T.jsxs)(Oe,{children:[`No skills matched your search query "`,r,`".`]})]}),(0,T.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>s(``),children:`Clear Search`})]}):(0,T.jsxs)(`div`,{className:`space-y-6 max-w-7xl mx-auto pb-12`,children:[B.map(e=>{let t=E[e.icon||`boxes`]||h,n=Ze[e.id]||[],r=!!c[e.id],ee=R===e.id,o=n.length>0&&n.every(e=>Y.has(e.id));return(0,T.jsxs)(`div`,{onDragOver:t=>ut(t,e.id),onDragLeave:dt,onDrop:t=>ft(t,e.id),className:i(`border rounded-xl transition-all duration-150 overflow-hidden bg-card/60`,ee?`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:()=>Xe(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),Xe(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:[J&&n.length>0&&(0,T.jsxs)(a,{variant:`ghost`,size:`xs`,onClick:()=>st(e.id,!o),className:`h-7 text-xs mr-2 text-muted-foreground hover:text-foreground`,title:o?`Deselect all in category`:`Select all in category`,children:[o?(0,T.jsx)(ie,{className:`h-3.5 w-3.5 mr-1 text-primary`}):(0,T.jsx)(re,{className:`h-3.5 w-3.5 mr-1`}),(0,T.jsx)(`span`,{children:o?`Deselect All`:`Select All`})]}),!J&&(0,T.jsx)(a,{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`})}),!J&&(0,T.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:()=>Qe(e),title:`Edit category`,children:(0,T.jsx)(Ie,{className:`h-3 w-3`})}),!J&&e.custom&&(0,T.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>et(e,t),title:`Delete category`,className:`text-destructive hover:text-destructive`,children:(0,T.jsx)(ce,{className:`h-3 w-3`})}),(0,T.jsx)(`div`,{className:`p-1 text-muted-foreground`,children:r?(0,T.jsx)(ae,{className:`h-4 w-4`}):(0,T.jsx)(te,{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.`,!J&&(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=Y.has(e.id);return(0,T.jsxs)(Te,{draggable:!J&&!!e.custom,onDragStart:t=>{!J&&e.custom&<(t,e.id)},onClick:()=>$(e),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),$(e))},className:i(`group relative cursor-pointer hover:border-primary/60 transition-all p-3.5 flex flex-col justify-between select-none shadow-sm`,J&&!t&&`opacity-60 bg-muted/20`,He===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)(Fe,{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})]}),J?(0,T.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),at(e.id)},disabled:!X||q.isPending,className:i(`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)(ge,{className:i(`h-3 w-3`,!t&&`opacity-0`)}),(0,T.jsx)(`span`,{children:t?`Enabled`:`Disabled`})]}):(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,2).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)(Le,{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:[!J&&e.custom&&(0,T.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>pt(e,t),title:`Move to another category`,className:`h-6 w-6 text-muted-foreground hover:text-foreground`,children:(0,T.jsx)(Me,{className:`h-3 w-3`})}),!J&&e.custom&&(0,T.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>rt(e,t),title:`Delete skill`,className:`h-6 w-6 text-destructive hover:text-destructive`,children:(0,T.jsx)(ce,{className:`h-3 w-3`})})]})]})]},e.id)})})})]},e.id)}),Q.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)(h,{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:Q.length})]})}),(0,T.jsx)(`div`,{className:`p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3.5`,children:Q.map(e=>(0,T.jsxs)(Te,{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`,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}),J&&(0,T.jsx)(a,{size:`xs`,variant:Y.has(e.id)?`default`:`outline`,disabled:!X||q.isPending,onClick:t=>{t.stopPropagation(),at(e.id)},children:Y.has(e.id)?`Enabled`:`Disabled`})]}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:e.description})]},e.id))})]})]})}),(0,T.jsx)(x,{open:l,onOpenChange:u,children:(0,T.jsxs)(y,{className:`sm:max-w-lg`,children:[(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:d?.id?`Edit Skill Category`:`Create Skill Category`}),(0,T.jsx)(g,{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)(o,{id:`cat-name`,value:d?.name||``,onChange:e=>f(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)(o,{id:`cat-desc`,value:d?.description||``,onChange:e=>f(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];return(0,T.jsx)(`button`,{type:`button`,onClick:()=>f(t=>t?{...t,icon:e}:null),className:i(`p-2.5 rounded-lg border flex items-center justify-center transition-colors`,(d?.icon||`boxes`)===e?`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:Re.map(e=>{let t=d?.color===e.value;return(0,T.jsx)(`button`,{type:`button`,"aria-label":`Select color ${e.label}`,onClick:()=>f(t=>t?{...t,color:e.value}:null),className:i(`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)(ge,{className:`h-3.5 w-3.5 text-white`})},e.value)})})]})]}),(0,T.jsxs)(_,{children:[(0,T.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>u(!1),children:`Cancel`}),(0,T.jsx)(a,{variant:`default`,size:`sm`,onClick:$e,disabled:!d?.name?.trim(),children:`Save Category`})]})]})}),(0,T.jsx)(x,{open:oe,onOpenChange:p,children:(0,T.jsxs)(y,{className:`sm:max-w-3xl max-h-[90vh] flex flex-col`,children:[(0,T.jsx)(b,{children:(0,T.jsxs)(`div`,{className:`flex items-center justify-between pr-6`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(v,{children:m?.id?`Edit Skill Package`:`Create New Skill`}),(0,T.jsx)(g,{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:()=>A(`edit`),className:i(`px-2.5 py-1 rounded-md flex items-center gap-1 font-medium transition-colors`,k===`edit`?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[(0,T.jsx)(Pe,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:`Edit`})]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>A(`preview`),className:i(`px-2.5 py-1 rounded-md flex items-center gap-1 font-medium transition-colors`,k===`preview`?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[(0,T.jsx)(Ne,{className:`h-3.5 w-3.5`}),(0,T.jsx)(`span`,{children:`Preview`})]})]})]})}),(0,T.jsx)(fe,{className:`flex-1 pr-4 py-2`,children:k===`edit`?(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`skill-title`,className:`text-xs font-medium`,children:`Display Title`}),(0,T.jsx)(o,{id:`skill-title`,value:m?.title||``,onChange:e=>tt(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)(o,{id:`skill-name`,value:m?.name||``,disabled:!!m?.id,onChange:e=>{O(!0),D(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:`grid grid-cols-1 sm:grid-cols-2 gap-4`,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:m?.category||``,onChange:e=>D(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:B.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`skill-tags`,className:`text-xs font-medium`,children:`Tags (comma separated)`}),(0,T.jsx)(o,{id:`skill-tags`,value:m?.tags?.join(`, `)||``,onChange:e=>D(t=>t?{...t,tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}:null),placeholder:`e.g. git, pr, quality`,className:`mt-1 text-xs font-mono`})]})]}),(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)(o,{id:`skill-desc`,value:m?.description||``,onChange:e=>D(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`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C,{htmlFor:`skill-content`,className:`text-xs font-medium`,children:`Playbook Instructions (Markdown)`}),(0,T.jsx)(je,{id:`skill-content`,value:m?.content||``,onChange:e=>D(t=>t?{...t,content:e.target.value}:null),rows:12,placeholder:`# Playbook Title
|
|
5
|
+
|
|
6
|
+
Detailed instructions for the AI assistant...`,className:`mt-1 font-mono text-xs leading-relaxed`})]})]}):(0,T.jsxs)(`div`,{className:`p-4 border rounded-xl bg-card/40 prose prose-sm dark:prose-invert max-w-none`,children:[(0,T.jsxs)(`div`,{className:`mb-4 pb-3 border-b`,children:[(0,T.jsx)(`h2`,{className:`text-lg font-bold m-0`,children:m?.title||m?.name}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground m-0 mt-1`,children:m?.description})]}),(0,T.jsx)(`pre`,{className:`text-xs whitespace-pre-wrap font-sans bg-transparent p-0 border-0`,children:m?.content||`*(No playbook markdown provided)*`})]})}),(0,T.jsxs)(_,{className:`mt-4 pt-3 border-t`,children:[(0,T.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>p(!1),children:`Cancel`}),(0,T.jsx)(a,{variant:`default`,size:`sm`,onClick:m?.custom===!1?ot:nt,disabled:!m?.name?.trim()||!m?.description?.trim()||!m?.content?.trim(),children:m?.custom===!1?`Create editable copy`:`Save Skill`})]})]})}),(0,T.jsx)(x,{open:Be,onOpenChange:j,children:(0,T.jsxs)(y,{className:`sm:max-w-md`,children:[(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Move Skill to Category`}),(0,T.jsxs)(g,{children:[`Select the destination category box for "`,M?.title||M?.name,`".`]})]}),(0,T.jsx)(`div`,{className:`space-y-2 py-2`,children:B.map(e=>{let t=E[e.icon||`boxes`]||h,n=M?.category===e.id;return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>mt(e.id),className:i(`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)(_,{children:(0,T.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>j(!1),children:`Cancel`})})]})}),(0,T.jsx)(x,{open:Ve,onOpenChange:P,children:(0,T.jsxs)(y,{className:`sm:max-w-md`,children:[(0,T.jsxs)(b,{children:[(0,T.jsxs)(v,{className:`text-destructive`,children:[`Delete `,F?.type===`category`?`Category`:`Skill`]}),(0,T.jsxs)(g,{children:[`Are you sure you want to delete "`,F?.title,`"? This action cannot be undone.`]})]}),(0,T.jsxs)(_,{className:`mt-4`,children:[(0,T.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>P(!1),children:`Cancel`}),(0,T.jsx)(a,{variant:`destructive`,size:`sm`,onClick:it,children:`Delete Permanently`})]})]})})]})}export{D as SkillsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,m as r,t as i}from"./button-cPldH5S4.js";import{t as a,xt as o}from"./spinner-BCEaGbib.js";import{t as s}from"./WorkspaceLauncher-CDtnv1IK.js";import{t as ee}from"./bot-wH0FKlic.js";import{t as te}from"./chevron-down-DDmhvRLr.js";import{t as c}from"./zap-DhYfYRlq.js";import{n as ne,r as l,t as re}from"./ScaffoldRepoInline-BSpQbVe7.js";import{t as u}from"./git-branch-Dw55pQWa.js";import{$ as d,A as f,At as p,Dt as ie,Ft as m,M as h,Mt as ae,N as g,R as oe,W as se,Z as ce,_t as le,ct as ue,et as de,ht as fe,i as pe,j as me,jt as _,k as v,mt as he,n as ge,ot as _e,r as ve,s as ye,vt as be,xt as y,z as xe}from"./index-ofoYKpCG.js";import{t as Se}from"./badge-BnkhqVEF.js";import{t as b}from"./textarea-D3-elOAa.js";var x=t(e(),1),S={status:`idle`,steps:[]};function Ce(){let[e,t]=(0,x.useState)(S),n=(0,x.useRef)(null),r=m(),i=(0,x.useCallback)(()=>{n.current?.close(),n.current=null},[]);return(0,x.useEffect)(()=>i,[i]),{progress:e,start:(0,x.useCallback)(e=>{i(),t({status:`running`,steps:[]});let a=new EventSource(`/api/workspace/create-stream/${encodeURIComponent(e)}`);n.current=a;let o=0;a.addEventListener(`progress`,n=>{o=0;try{let a=JSON.parse(n.data);t({status:a.status===`completed`||a.status===`failed`?a.status:`running`,steps:a.steps??[],error:a.error,workspacePath:a.workspacePath,workspaceId:a.feature?.id??e}),(a.status===`completed`||a.status===`failed`)&&(i(),r.invalidateQueries({queryKey:[`workspaces`]}),r.invalidateQueries({queryKey:[`workspaces-status`]}))}catch{}}),a.onerror=()=>{o+=1,!(a.readyState!==EventSource.CLOSED&&o<5)&&(t(e=>e.status===`running`?{...e,status:`failed`,error:e.error??`Lost connection to the creation stream.`}:e),i())}},[i,r]),reset:(0,x.useCallback)(()=>{i(),t(S)},[i])}}var C=n(),w=`__ad-hoc__`,we=new URLSearchParams(window.location.search).get(`env`)===`vscode`,Te=[{value:`in-place`,icon:c,title:`In-place`,body:`Work directly in the source repos. No branches or worktrees — fastest start.`},{value:`worktree`,icon:u,title:`Isolated worktrees`,body:`A feature branch and worktree per repo. Your source checkouts stay untouched.`}];function Ee({repo:e,value:t,onChange:n,enabled:r}){let i=d(e.path,r),a=(0,x.useMemo)(()=>[...new Set([...i.data?.local??[],...i.data?.remote??[]])],[i.data]),s=`branches-${e.path.replace(/[^a-zA-Z0-9]/g,`-`)}`;return(0,C.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`w-40 shrink-0 truncate text-xs`,children:e.name}),(0,C.jsx)(o,{list:s,value:t,onChange:e=>n(e.target.value),placeholder:`existing branch (must exist)`,className:`h-7 font-mono text-xs`}),(0,C.jsx)(`datalist`,{id:s,children:a.map(e=>(0,C.jsx)(`option`,{value:e},e))})]})}function De({step:e}){return(0,C.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,C.jsx)(`span`,{className:r(`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,C.jsx)(_,{className:`size-3`}):e.status===`running`?(0,C.jsx)(a,{className:`size-3`}):e.status===`failed`?(0,C.jsx)(p,{className:`size-3`}):null}),(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,C.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.message})]})]})}function T(){let e=le(),[t]=be(),n=ce(),c=de(),u=xe(),d=ue(),p=_e(),m=oe(),_=se(),{progress:S,start:T}=Ce(),[E,Oe]=(0,x.useState)(t.get(`project`)??w),[D,O]=(0,x.useState)(`in-place`),[k,ke]=(0,x.useState)(``),[A,Ae]=(0,x.useState)(``),[j,je]=(0,x.useState)(``),[M,N]=(0,x.useState)([]),[P,Me]=(0,x.useState)(!1),[F,I]=(0,x.useState)([]),[L,R]=(0,x.useState)([]),[z,Ne]=(0,x.useState)([]),[B,V]=(0,x.useState)(``),[H,U]=(0,x.useState)(``),[W,G]=(0,x.useState)(!1),[Pe,Fe]=(0,x.useState)(null),[K,Ie]=(0,x.useState)({}),[Le,Re]=(0,x.useState)(!1),[q,J]=(0,x.useState)(null),Y=(0,x.useRef)(!1);(0,x.useEffect)(()=>{!Y.current&&u.data&&(Y.current=!0,I(u.data.filter(e=>e.detected).map(e=>e.name)))},[u.data]);let X=(0,x.useMemo)(()=>(n.data??[]).find(e=>e.id===E)??null,[n.data,E]),Z=(0,x.useMemo)(()=>X?X.repos.map(e=>({name:ye(e.path),path:e.path,defaultBranch:e.defaultBranch})):(c.data??[]).filter(e=>M.includes(e.path)),[X,c.data,M]),Q=D===`in-place`,ze=(Q?A.trim().length>0:k.trim().length>0)&&Z.length>0&&j.trim().length>0,Be=e=>{V(e),Fe(null);let t=(d.data??[]).find(t=>t.id===e);U(t?.content??``)},Ve=async()=>{if(!j.trim()){J(`Describe what you are building first — the suggestion is based on it.`);return}J(null),G(!0);try{let e=await he(`/api/workspace/suggest-workflow`,{method:`POST`,body:JSON.stringify({description:j,repos:Z})});V(e.suggestedWorkflowId),U(e.customInstructions),Fe(e.difficulty)}catch(e){J(e instanceof Error?e.message:String(e))}finally{G(!1)}},He=async()=>{J(null);let e={mode:D,projectId:X?.id,...Q?{name:A.trim()}:{branchName:k.trim()},description:j.trim(),repos:Z.map(e=>({...e,existingBranch:!Q&&K[e.path]?.trim()?K[e.path].trim():void 0})),assistants:F,enabledSkills:L.length>0?L:void 0,enabledAgents:z.length>0?z:void 0,teamworkInstructions:H.trim()||void 0};try{let{jobId:t}=await _.mutateAsync(e);T(t)}catch(e){J(e instanceof Error?e.message:String(e))}},$=F.find(e=>pe(e)!==null);if(S.status!==`idle`){let t=S.steps.find(e=>e.status===`failed`);return(0,C.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,C.jsx)(`h1`,{className:`text-xl font-semibold`,children:S.status===`running`?`Setting up your workspace…`:S.status===`completed`?`Workspace ready`:`Workspace creation failed`}),(0,C.jsx)(`ul`,{className:`mt-6 divide-y divide-border rounded-xl border border-border bg-card px-4`,children:S.steps.map(e=>(0,C.jsx)(De,{step:e},e.id))}),S.status===`failed`&&(0,C.jsx)(`p`,{className:`mt-4 text-sm text-destructive-foreground`,children:t?.message??S.error??`Something went wrong.`}),S.status===`completed`&&S.workspacePath&&(0,C.jsx)(`p`,{className:`mt-4 truncate font-mono text-xs text-muted-foreground`,children:S.workspacePath}),S.status===`completed`&&$&&(0,C.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Embedded start allows edits inside this workspace; you can switch to Review only in chat.`}),q&&(0,C.jsx)(`p`,{className:`mt-2 text-sm text-destructive-foreground`,children:q}),(0,C.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:[S.status===`completed`&&S.workspaceId&&(0,C.jsxs)(C.Fragment,{children:[$&&(0,C.jsxs)(i,{className:`w-full min-w-0 whitespace-normal sm:w-auto`,onClick:()=>e(`/workspaces/${encodeURIComponent(S.workspaceId)}`,{state:{chatLaunch:ve($,{kickoff:`Read the workspace instructions and implementation plan, inspect the repository state, then begin the task described for this workspace. Ask before making a decision that materially changes scope.`,executionProfile:`workspace-write`})}}),children:[(0,C.jsx)(y,{}),`Start editing with `,ge($)]}),(0,C.jsx)(i,{className:`w-full min-w-0 whitespace-normal sm:w-auto`,variant:$?`outline`:void 0,onClick:()=>e(`/workspaces/${encodeURIComponent(S.workspaceId)}`),children:`Open workspace`}),S.workspacePath&&(0,C.jsx)(s,{workspaceId:S.workspaceId,workspacePath:S.workspacePath,isVsCode:we,className:`w-full min-w-0 whitespace-normal sm:w-auto`})]}),S.status===`failed`&&(0,C.jsx)(i,{variant:`outline`,onClick:()=>window.location.reload(),children:`Start over`}),S.status===`running`&&(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This can take a moment for large repositories.`})]})]})}return(0,C.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,C.jsxs)(`header`,{className:`mb-6`,children:[(0,C.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Start work`}),(0,C.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Pick where the work happens and how isolated it should be.`})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`Project`}),(0,C.jsxs)(v,{value:E,onValueChange:e=>typeof e==`string`&&Oe(e),children:[(0,C.jsx)(h,{className:`w-full`,"aria-label":`Project`,children:(0,C.jsx)(g,{children:X?X.name:`Ad-hoc — pick repositories manually`})}),(0,C.jsxs)(me,{alignItemWithTrigger:!1,children:[(n.data??[]).map(e=>(0,C.jsx)(f,{value:e.id,children:e.name},e.id)),(0,C.jsx)(f,{value:w,children:`Ad-hoc — pick repositories manually`})]})]}),X?(0,C.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:X.repos.map(e=>(0,C.jsx)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.path},e.path))}):(0,C.jsxs)(`div`,{className:`mt-2`,children:[(0,C.jsx)(ne,{repos:c.data??[],selectedPaths:M,onToggle:e=>N(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path]),loading:c.isLoading}),(0,C.jsx)(re,{onCreated:e=>N(t=>[...t,e.path])})]}),(n.data??[]).length===0&&!n.isLoading&&(0,C.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Tip: `,(0,C.jsx)(fe,{to:`/projects`,className:`text-primary hover:underline`,children:`register a project`}),` to skip repo picking next time.`]})]}),(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`How do you want to work?`}),(0,C.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=D===`in-place`?`worktree`:`in-place`;O(t),document.getElementById(`mode-${t}`)?.focus()}},children:Te.map(e=>(0,C.jsxs)(`button`,{id:`mode-${e.value}`,type:`button`,role:`radio`,"aria-checked":D===e.value,tabIndex:D===e.value?0:-1,onClick:()=>O(e.value),className:r(`cursor-pointer rounded-xl border p-4 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,D===e.value?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border bg-card hover:border-foreground/20`),children:[(0,C.jsx)(e.icon,{className:r(`size-4`,D===e.value?`text-primary`:`text-muted-foreground`)}),(0,C.jsx)(`p`,{className:`mt-2 text-sm font-semibold`,children:e.title}),(0,C.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,C.jsx)(`section`,{children:Q?(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Workspace name`}),(0,C.jsx)(o,{value:A,onChange:e=>Ae(e.target.value),placeholder:`e.g. Fix invoice rounding`})]}):(0,C.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Feature branch`}),(0,C.jsx)(o,{value:k,onChange:e=>ke(e.target.value),placeholder:`e.g. feature/invoice-rounding`,className:`font-mono`})]}),Z.length>0&&(0,C.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2`,onToggle:e=>Re(e.target.open),children:[(0,C.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Use an existing branch for specific repos (optional)`}),(0,C.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:Z.map(e=>(0,C.jsx)(Ee,{repo:e,enabled:Le,value:K[e.path]??``,onChange:t=>Ie(n=>({...n,[e.path]:t}))},e.path))})]})]})}),(0,C.jsx)(`section`,{children:(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`What are you building?`}),(0,C.jsx)(b,{value:j,onChange:e=>je(e.target.value),placeholder:`A short description — your AI assistant reads this to plan the work.`,rows:3})]})}),(0,C.jsxs)(`section`,{className:`rounded-xl border border-border`,children:[(0,C.jsxs)(`button`,{type:`button`,onClick:()=>Me(e=>!e),className:`flex w-full items-center justify-between px-4 py-3 text-sm font-medium hover:bg-accent`,"aria-expanded":P,children:[`Advanced`,(0,C.jsx)(te,{className:r(`size-4 text-muted-foreground transition-transform`,P&&`rotate-180`)})]}),P&&(0,C.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border p-4`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`AI assistants`}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:(u.data??[]).map(e=>(0,C.jsxs)(`label`,{className:r(`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,C.jsx)(l,{checked:F.includes(e.name),onCheckedChange:()=>I(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name])}),e.displayName]},e.name))})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium`,children:`Teamwork strategy`}),(0,C.jsxs)(i,{size:`xs`,variant:`outline`,onClick:Ve,disabled:W,children:[W?(0,C.jsx)(a,{}):(0,C.jsx)(y,{}),`Suggest with AI`]})]}),(0,C.jsxs)(v,{value:B,onValueChange:e=>typeof e==`string`&&Be(e),children:[(0,C.jsx)(h,{className:`w-full`,"aria-label":`Teamwork strategy`,children:(0,C.jsx)(g,{children:(d.data??[]).find(e=>e.id===B)?.name??`None`})}),(0,C.jsxs)(me,{alignItemWithTrigger:!1,children:[(0,C.jsx)(f,{value:``,children:`None`}),(d.data??[]).map(e=>(0,C.jsx)(f,{value:e.id,children:e.name},e.id))]})]}),Pe&&(0,C.jsxs)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`AI classified this task as `,(0,C.jsx)(`span`,{className:`font-medium`,children:Pe}),` difficulty.`]}),(0,C.jsx)(b,{value:H,onChange:e=>U(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`})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,C.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,C.jsx)(ae,{className:`size-4 text-primary`}),`Agent Skills (`,L.length,` selected)`]}),(p.data??[]).length>0&&(0,C.jsx)(i,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>{let e=(p.data??[]).map(e=>e.id);R(L.length===e.length?[]:e)},className:`text-xs text-muted-foreground hover:text-foreground h-6 px-2`,children:L.length===(p.data??[]).length&&(p.data??[]).length>0?`Deselect All`:`Select All`})]}),(0,C.jsx)(`div`,{className:`max-h-48 overflow-y-auto rounded-lg border border-border bg-card/50 p-2 space-y-1.5`,children:p.isLoading?(0,C.jsxs)(`div`,{className:`flex items-center justify-center p-4 gap-2 text-xs text-muted-foreground`,children:[(0,C.jsx)(a,{className:`size-3`}),`Loading skills...`]}):(p.data??[]).length===0?(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground p-2 text-center`,children:`No skills available in catalog.`}):(p.data??[]).map(e=>{let t=L.includes(e.id);return(0,C.jsxs)(`label`,{className:r(`flex items-center justify-between gap-2 rounded-md p-2 text-xs cursor-pointer border transition-colors`,t?`border-primary/50 bg-primary/5 text-foreground`:`border-transparent hover:bg-muted/50 text-muted-foreground`),children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,C.jsx)(l,{checked:t,onCheckedChange:()=>R(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,C.jsx)(`span`,{className:`font-mono font-medium truncate`,children:e.title||e.name})]}),(0,C.jsx)(Se,{variant:`outline`,className:`text-[9px] px-1 py-0 shrink-0`,children:e.category})]},e.id)})})]}),(m.data??[]).length>0&&(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:(0,C.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,C.jsx)(ee,{className:`size-4 text-purple-400`}),`Codex Native Agents (`,z.length,` selected)`]})}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(m.data??[]).map(e=>{let t=z.includes(e.id);return(0,C.jsxs)(`label`,{className:r(`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,C.jsx)(l,{checked:t,onCheckedChange:()=>Ne(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,C.jsx)(`span`,{className:`font-mono`,children:e.name})]},e.id)})})]})]})]}),q&&(0,C.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:q}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border pt-4`,children:[(0,C.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,C.jsx)(ie,{className:`size-3.5`}),Z.length,` repositor`,Z.length===1?`y`:`ies`,` selected`]}),(0,C.jsxs)(i,{onClick:He,disabled:!ze||_.isPending,children:[_.isPending?(0,C.jsx)(a,{}):null,Q?`Start working`:`Create workspace`]})]})]})]})}export{T as StartWorkPage};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as e,g as t,h as n,m as r,t as i}from"./button-cPldH5S4.js";import{t as a,xt as o}from"./spinner-BCEaGbib.js";import{t as s}from"./circle-plus-C0PNc7h4.js";import{t as c}from"./cpu-CPUNnHRM.js";import{t as l}from"./trash-2-Da8F2gKd.js";import{A as u,M as d,N as f,_ as p,j as m,k as h}from"./index-
|
|
1
|
+
import{_ as e,g as t,h as n,m as r,t as i}from"./button-cPldH5S4.js";import{t as a,xt as o}from"./spinner-BCEaGbib.js";import{t as s}from"./circle-plus-C0PNc7h4.js";import{t as c}from"./cpu-CPUNnHRM.js";import{t as l}from"./trash-2-Da8F2gKd.js";import{A as u,M as d,N as f,_ as p,j as m,k as h}from"./index-ofoYKpCG.js";import{t as g}from"./badge-BnkhqVEF.js";import{t as _}from"./card-82INhRRE.js";import{a as v,i as y,n as b,r as x,t as S}from"./empty-DWyDwDYB.js";import{t as C}from"./label-JFgMNsTn.js";import{t as w}from"./textarea-D3-elOAa.js";var T=n(`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=n(`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:n,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`,children:[(0,D.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Team Collaboration Strategies`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Predefine and review custom teamwork guidelines 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 p-5 shadow-sm`,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)(i,{size:`sm`,onClick:()=>{O(!0),A(`New Strategy`),M(`# New Strategy
|
|
2
2
|
|
|
3
3
|
Write custom teamwork rules here for subagent orchestration...`),P(null),I(null)},children:[(0,D.jsx)(s,{size:12}),` Add New`]})]}),(0,D.jsx)(p,{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:r(`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:r(`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||n?(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:n?(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(C,{className:`text-sm`,children:`Strategy Name`}),(0,D.jsx)(o,{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:n?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(i,{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)(i,{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)(i,{variant:`outline`,size:`sm`,onClick:()=>O(!0),children:`Edit`}),(0,D.jsxs)(i,{variant:`destructive`,size:`sm`,onClick:()=>B(N),disabled:J,children:[(0,D.jsx)(l,{size:12}),` Delete`]})]}),!Z?.custom&&(0,D.jsx)(i,{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:!n,placeholder:`Write cooperation guidelines in Markdown...`})]}),!n&&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)(c,{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)(h,{value:Y,disabled:Q.length===0,onValueChange:e=>typeof e==`string`&&X(e),children:[(0,D.jsx)(d,{size:`sm`,className:`w-44`,"aria-label":`Harness`,children:(0,D.jsx)(f,{children:$})}),(0,D.jsx)(m,{alignItemWithTrigger:!1,children:Q.length>0?Q.map(e=>(0,D.jsx)(u,{value:e.name,children:e.displayName},e.name)):(0,D.jsx)(u,{value:``,children:`No Harness Found`})})]})]}),(0,D.jsx)(i,{size:`sm`,onClick:()=>R(N,j,Y),disabled:H||Q.length===0,children:H?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(a,{className:`size-3`}),` Inspecting...`]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{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)(p,{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)(i,{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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-cPldH5S4.js";import{t as o}from"./spinner-BCEaGbib.js";import{t as s}from"./code-xml-Chu1p81J.js";import{Dt as c,Ot as l,St as u,V as d,ct as ee,d as f,g as te,h as ne,lt as p,m,p as h,pt as g,u as _}from"./index-CcIOIZ24.js";import{t as v}from"./badge-BnkhqVEF.js";import{a as y,i as re,n as b,r as x,t as S}from"./empty-DWyDwDYB.js";var C=r(`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`}]]),w=r(`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`}]]),T=r(`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`}]]),E=t(e(),1),D={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},O=E.createContext&&E.createContext(D),k=[`attr`,`size`,`title`];function A(e,t){if(e==null)return{};var n,r,i=j(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function j(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M.apply(null,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?N(Object(n),!0).forEach(function(t){F(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function F(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e){var t=L(e,`string`);return typeof t==`symbol`?t:t+``}function L(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function R(e){return e&&e.map((e,t)=>E.createElement(e.tag,P({key:t},e.attr),R(e.child)))}function z(e){return t=>E.createElement(B,M({attr:P({},e.attr)},t),R(e.child))}function B(e){var t=t=>{var n=e.attr,r=e.size,i=e.title,a=A(e,k),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),E.createElement(`svg`,M({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:P(P({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&E.createElement(`title`,null,i),e.children)};return O===void 0?t(D):E.createElement(O.Consumer,null,e=>t(e))}function V(e){return z({tag:`svg`,attr:{fill:`currentColor`,viewBox:`0 0 16 16`},child:[{tag:`path`,attr:{d:`M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934A4.1 4.1 0 0 0 8.423.2 4.15 4.15 0 0 0 6.305.086a4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679A4 4 0 0 0 .554 4.72a3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z`},child:[]}]})(e)}function H(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M2.25 1.5a.75.75 0 0 0-.75.75v16.5H0V2.25A2.25 2.25 0 0 1 2.25 0h20.095c1.002 0 1.504 1.212.795 1.92L10.764 14.298h3.486V12.75h1.5v1.922a1.125 1.125 0 0 1-1.125 1.125H9.264l-2.578 2.578h11.689V9h1.5v9.375a1.5 1.5 0 0 1-1.5 1.5H5.185L2.562 22.5H21.75a.75.75 0 0 0 .75-.75V5.25H24v16.5A2.25 2.25 0 0 1 21.75 24H1.655C.653 24 .151 22.788.86 22.08L13.19 9.75H9.75v1.5h-1.5V9.375A1.125 1.125 0 0 1 9.375 8.25h5.314l2.625-2.625H5.625V15h-1.5V5.625a1.5 1.5 0 0 1 1.5-1.5h13.19L21.438 1.5z`},child:[]}]})(e)}function U(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M23.55 5.067c-1.2038-.002-2.1806.973-2.1806 2.1765v4.8676c0 .972-.8035 1.7594-1.7597 1.7594-.568 0-1.1352-.286-1.4718-.7659l-4.9713-7.1003c-.4125-.5896-1.0837-.941-1.8103-.941-1.1334 0-2.1533.9635-2.1533 2.153v4.8957c0 .972-.7969 1.7594-1.7596 1.7594-.57 0-1.1363-.286-1.4728-.7658L.4076 5.1598C.2822 4.9798 0 5.0688 0 5.2882v4.2452c0 .2147.0656.4228.1884.599l5.4748 7.8183c.3234.462.8006.8052 1.3509.9298 1.3771.313 2.6446-.747 2.6446-2.0977v-4.893c0-.972.7875-1.7593 1.7596-1.7593h.003a1.798 1.798 0 0 1 1.4718.7658l4.9723 7.0994c.4135.5905 1.05.941 1.8093.941 1.1587 0 2.1515-.9645 2.1515-2.153v-4.8948c0-.972.7875-1.7594 1.7596-1.7594h.194a.22.22 0 0 0 .2204-.2202v-4.622a.22.22 0 0 0-.2203-.2203Z`},child:[]}]})(e)}function W(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M0 0v24h24V0H0zm17.889 2.889c1.444 0 2.667.444 3.667 1.278l-1.111 1.667c-.889-.611-1.722-1-2.556-1s-1.278.389-1.278.889v.056c0 .667.444.889 2.111 1.333 2 .556 3.111 1.278 3.111 3v.056c0 2-1.5 3.111-3.611 3.111-1.5-.056-3-.611-4.167-1.667l1.278-1.556c.889.722 1.833 1.222 2.944 1.222.889 0 1.389-.333 1.389-.944v-.056c0-.556-.333-.833-2-1.278-2-.5-3.222-1.056-3.222-3.056v-.056c0-1.833 1.444-3 3.444-3zm-16.111.222h2.278l1.5 5.778 1.722-5.778h1.667l1.667 5.778 1.5-5.778h2.333l-2.833 9.944H9.723L8.112 7.277l-1.667 5.778H4.612L1.779 3.111zm.5 16.389h9V21h-9v-1.5z`},child:[]}]})(e)}function G(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M20.953.004a.397.397 0 0 0-.18.017L3.225 5.585c-.175.055-.323.214-.402.398a.42.42 0 0 0-.06.22v5.726a.42.42 0 0 0 .06.22c.079.183.227.341.402.397l7.454 2.364-7.454 2.363c-.255.08-.463.374-.463.655v5.688c0 .282.208.444.463.363l17.55-5.565c.237-.075.426-.336.452-.6.003-.022.013-.04.013-.065V12.06c0-.281-.208-.575-.463-.656L13.4 9.065l7.375-2.339c.255-.08.462-.375.462-.656V.384c0-.211-.117-.355-.283-.38z`},child:[]}]})(e)}function K(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M7.833 6.666v-.055c0-1-.667-1.5-1.778-1.5H4.389v3.055h1.723c1.111 0 1.721-.666 1.721-1.5zM0 0v24h24V0H0zm2.223 3.167h4c2.389 0 3.833 1.389 3.833 3.445v.055c0 2.278-1.778 3.5-4.001 3.5H4.389v2.945H2.223V3.167zM11.277 21h-9v-1.5h9V21zm4.779-7.777c-2.944.055-5.111-2.223-5.111-5.057C10.944 5.333 13.056 3 16.111 3c1.889 0 3 .611 3.944 1.556l-1.389 1.61c-.778-.722-1.556-1.111-2.556-1.111-1.658 0-2.873 1.375-2.887 3.084.014 1.709 1.174 3.083 2.887 3.083 1.111 0 1.833-.445 2.61-1.167l1.39 1.389c-.999 1.112-2.166 1.779-4.054 1.779z`},child:[]}]})(e)}function q(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M0 0v24h24V0zm3.723 3.111h5v1.834h-1.39v6.277h1.39v1.834h-5v-1.834h1.444V4.945H3.723zm11.055 0H17v6.5c0 .612-.055 1.111-.222 1.556-.167.444-.39.777-.723 1.11-.277.279-.666.557-1.11.668a3.933 3.933 0 0 1-1.445.278c-.778 0-1.444-.167-1.944-.445a4.81 4.81 0 0 1-1.279-1.056l1.39-1.555c.277.334.555.555.833.722.277.167.611.278.945.278.389 0 .721-.111 1-.389.221-.278.333-.667.333-1.278zM2.222 19.5h9V21h-9z`},child:[]}]})(e)}function J(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23`},child:[]}]})(e)}function Y(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`},child:[]}]})(e)}function ie(e){return z({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15.434 1.72887L12.14 0.144875C12.002 0.078875 11.855 0.046875 11.709 0.046875C11.353 0.046875 11.18 0.211875 11.155 0.228875C11.073 0.270875 11.005 0.337875 11.004 0.338875L4.698 6.08888L1.951 4.00488C1.832 3.91388 1.69 3.86987 1.548 3.86987C1.387 3.86987 1.226 3.92788 1.1 4.04288L0.219 4.84387C0.074 4.97587 0.001 5.15688 0.001 5.33687C0.001 5.51687 0.073 5.69688 0.218 5.82888L2.6 8.00088L0.217 10.1719C0.072 10.3039 0 10.4839 0 10.6639C0 10.8439 0.073 11.0249 0.218 11.1569L1.099 11.9579C1.226 12.0729 1.386 12.1309 1.547 12.1309C1.688 12.1309 1.83 12.0859 1.95 11.9959L4.697 9.91187L11.003 15.6619C11.003 15.6619 11.072 15.7299 11.155 15.7719C11.179 15.7889 11.353 15.9529 11.709 15.9529C11.855 15.9529 12.003 15.9209 12.141 15.8549L15.435 14.2709C15.781 14.1049 16.001 13.7539 16.001 13.3699V2.62888C16.001 2.24487 15.781 1.89488 15.435 1.72787L15.434 1.72887ZM7.217 7.99988L12.002 4.36987V11.6299L7.217 7.99988Z`},child:[]}]})(e)}function ae(e){return z({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.045 7.37722L5.449 5.40722L10.636 0.676223C10.685 0.631223 10.735 0.617223 10.778 0.617223C10.786 0.617223 10.999 0.627223 10.999 0.837223V5.13222L8.044 7.37622L8.045 7.37722ZM0.217 10.1762C0.072 10.3082 0 10.4882 0 10.6682C0 10.8482 0.073 11.0292 0.218 11.1612L1.099 11.9622C1.226 12.0772 1.386 12.1352 1.547 12.1352C1.688 12.1352 1.83 12.0902 1.95 12.0002L3.887 10.5312L1.858 8.68122L0.218 10.1762H0.217ZM1.95 4.00822C1.83 3.91722 1.689 3.87322 1.547 3.87322C1.386 3.87322 1.225 3.93122 1.099 4.04622L0.218 4.84722C0.073 4.97922 0 5.16022 0 5.34022C0 5.52022 0.072 5.70022 0.217 5.83222L2.202 7.64222L10.634 15.3332C10.684 15.3792 10.735 15.3922 10.779 15.3922C10.888 15.3922 11 15.3142 11 15.1752V10.8762L1.95 4.00822ZM15.434 1.73322L12.14 0.149223C12.002 0.0832227 11.855 0.0532227 11.709 0.0532227H11.704C11.888 0.268223 12.003 0.537223 12.003 0.837223V15.1752C12.004 15.4702 11.894 15.7342 11.716 15.9472H11.734C11.748 15.9472 11.761 15.9472 11.775 15.9472C11.962 15.9472 12.123 15.8682 12.14 15.8602L15.434 14.2762C15.78 14.1102 16 13.7592 16 13.3752V2.63422C16 2.25022 15.78 1.90022 15.434 1.73322Z`},child:[]}]})(e)}var X=n(),Z=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,oe={codex:V,claude:Y,vscode:ie,"vscode-insiders":ae,cursor:J,antigravity:w,intellij:q,webstorm:W,pycharm:K,sublime:G,zed:H,windsurf:U},se={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`,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 Q({icon:e}){let t=oe[e]??s;return(0,X.jsx)(`span`,{className:i(`grid size-10 shrink-0 place-items-center rounded-xl shadow-sm`,se[e]),"aria-hidden":`true`,children:(0,X.jsx)(t,{className:`size-5`})})}function $({target:e,busy:t,launching:n,preferred:r,onLaunch:a}){return(0,X.jsxs)(`button`,{type:`button`,disabled:!e.available||t,onClick:()=>a(e),"aria-label":`Open workspace in ${e.name}`,className:i(`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,X.jsx)(Q,{icon:e.icon}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:e.name}),n?(0,X.jsx)(o,{className:`size-4`}):r?(0,X.jsx)(v,{size:`sm`,variant:`secondary`,children:`Preferred`}):null]}),(0,X.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})}function ce({session:e,busy:t,launching:n,onResume:r}){let a=e.desktopHandoff.method===`direct`,s=a?`Codex Desktop`:`Claude Desktop`;return(0,X.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>r(e),"aria-label":a?`Resume ${e.title} in Codex Desktop`:`Move ${e.title} to Claude Desktop`,className:i(`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,X.jsx)(Q,{icon:a?`codex`:`claude`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate font-medium text-foreground`,title:e.title,children:e.title}),n?(0,X.jsx)(o,{className:`size-4 shrink-0`}):a?(0,X.jsx)(c,{className:`size-4 shrink-0 text-muted-foreground`}):(0,X.jsx)(l,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,X.jsxs)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:[a?`Open this existing task in ${s}`:`Resume in Claude Code, then type /desktop`,` · `,new Date(e.updatedAt).toLocaleString()]})]})]})}function le({workspaceId:e,workspacePath:t,isVsCode:n=!1,className:r}){let[i,s]=(0,E.useState)(!1),[c,l]=(0,E.useState)(null),[v,w]=(0,E.useState)(null),[D,O]=(0,E.useState)(null),k=(0,E.useRef)(!1),A=ee(),j=p(e,i),M=d().data?.config,N=A.data?.filter(e=>e.available)??[],P=N.filter(e=>e.kind===`ai-app`),F=M?.defaultEditor?{code:`vscode`,"code-insiders":`vscode-insiders`,cursor:`cursor`,antigravity:`antigravity`,idea:`intellij`,webstorm:`webstorm`,charm:`pycharm`,subl:`sublime`,zed:`zed`,windsurf:`windsurf`}[M.defaultEditor]:void 0,I=N.filter(e=>e.kind===`editor`).toSorted((e,t)=>Number(t.id===F)-Number(e.id===F)),L=new Set(N.map(e=>e.id)),R=(j.data??[]).filter(e=>e.desktopHandoff&&L.has(e.desktopHandoff.targetId)),z=n||N.length>0,B=async t=>{if(!k.current){k.current=!0,w(null),O(null),l(t.id);try{await g(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.id})}),s(!1)}catch(e){w(e instanceof Error?e.message:String(e)),await A.refetch()}finally{l(null),k.current=!1}}},V=async t=>{if(!(k.current||!t.desktopHandoff||!Z.test(t.id))){k.current=!0,w(null),O(null),l(`session:${t.id}`);try{if(t.desktopHandoff.method===`guided`){await navigator.clipboard.writeText(`claude --resume ${t.id}`),O(`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 g(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.desktopHandoff.targetId,action:`resume`,sessionId:t.id})}),s(!1)}catch(e){w(e instanceof Error?e.message:String(e)),await Promise.all([A.refetch(),j.refetch()])}finally{l(null),k.current=!1}}},H=()=>{window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:t},`*`),s(!1)},U=()=>Promise.all([A.refetch(),j.refetch()]),W=A.isFetching||j.isFetching;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(a,{variant:`outline`,className:r,onClick:()=>s(!0),children:[(0,X.jsx)(T,{}),`Open with…`]}),(0,X.jsx)(_,{open:i,onOpenChange:e=>{s(e),e||(w(null),O(null))},children:(0,X.jsxs)(ne,{className:`max-w-2xl`,"aria-busy":c!==null,children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(te,{children:`Open workspace with…`}),(0,X.jsx)(f,{children:`Continue recent AI work or start in an installed coding app or editor. AI apps may use their own online services.`})]}),(0,X.jsxs)(m,{className:`space-y-5`,children:[v&&(0,X.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-foreground`,children:v}),D&&(0,X.jsx)(`div`,{role:`status`,className:`rounded-lg border border-primary/25 bg-primary/5 px-3 py-2 text-sm text-foreground`,children:D}),j.isLoading?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,X.jsx)(o,{className:`size-4`}),` Checking recent sessions…`]}):R.length>0?(0,X.jsxs)(`section`,{"aria-labelledby":`recent-sessions-heading`,children:[(0,X.jsx)(`h3`,{id:`recent-sessions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Continue recent work`}),(0,X.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:R.map(e=>(0,X.jsx)(ce,{session:e,busy:c!==null,launching:c===`session:${e.id}`,onResume:V},`${e.assistant}:${e.id}`))})]}):j.isError?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent sessions could not be checked. Starting new work is still available.`}):null,n&&(0,X.jsxs)(`section`,{"aria-labelledby":`current-editor-heading`,children:[(0,X.jsx)(`h3`,{id:`current-editor-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Current window`}),(0,X.jsxs)(`button`,{type:`button`,disabled:c!==null,onClick:H,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,X.jsx)(Q,{icon:`vscode`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`block font-medium`,children:`Current VS Code window`}),(0,X.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:`Open through the installed NexusFlow extension.`})]})]})]}),A.isLoading?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,X.jsx)(o,{}),` Checking apps on this computer…`]}):A.isError?(0,X.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive-foreground`,children:A.error instanceof Error?A.error.message:`Could not check available apps.`}):(0,X.jsxs)(X.Fragment,{children:[P.length>0&&(0,X.jsxs)(`section`,{"aria-labelledby":`ai-apps-heading`,children:[(0,X.jsx)(`h3`,{id:`ai-apps-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`AI coding apps`}),(0,X.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:P.map(e=>(0,X.jsx)($,{target:e,busy:c!==null,launching:c===e.id,onLaunch:B},e.id))})]}),I.length>0&&(0,X.jsxs)(`section`,{"aria-labelledby":`editors-heading`,children:[(0,X.jsx)(`h3`,{id:`editors-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Code editors`}),(0,X.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:I.map(e=>(0,X.jsx)($,{target:e,busy:c!==null,launching:c===e.id,preferred:e.id===F,onLaunch:B},e.id))})]}),!z&&(0,X.jsx)(S,{className:`rounded-xl border border-dashed py-8 md:p-8`,children:(0,X.jsxs)(x,{children:[(0,X.jsx)(re,{variant:`icon`,children:(0,X.jsx)(C,{})}),(0,X.jsx)(y,{className:`text-base`,children:`No compatible apps detected`}),(0,X.jsx)(b,{children:`Install a supported coding app or add its command to PATH, then recheck.`})]})})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-3`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:W?`Checking recent sessions and apps…`:`Can’t find your app or session? Recheck detection.`}),(0,X.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:()=>void U(),disabled:W||c!==null,children:[(0,X.jsx)(u,{className:W?`animate-spin`:``}),`Recheck`]})]})]})]})})]})}export{le as t};
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-cPldH5S4.js";import{t as o}from"./spinner-BCEaGbib.js";import{n as s}from"./zap-DhYfYRlq.js";import{Ct as c,Ot as l,V as u,d as ee,g as te,h as d,kt as f,lt as ne,m as p,mt as m,p as h,u as g,ut as _}from"./index-ofoYKpCG.js";import{t as v}from"./badge-BnkhqVEF.js";import{a as re,i as y,n as b,r as x,t as S}from"./empty-DWyDwDYB.js";var C=r(`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`}]]),w=r(`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`}]]),T=r(`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`}]]),E=t(e(),1),D={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},O=E.createContext&&E.createContext(D),k=[`attr`,`size`,`title`];function A(e,t){if(e==null)return{};var n,r,i=j(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function j(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M.apply(null,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?N(Object(n),!0).forEach(function(t){F(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function F(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e){var t=L(e,`string`);return typeof t==`symbol`?t:t+``}function L(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function R(e){return e&&e.map((e,t)=>E.createElement(e.tag,P({key:t},e.attr),R(e.child)))}function z(e){return t=>E.createElement(B,M({attr:P({},e.attr)},t),R(e.child))}function B(e){var t=t=>{var n=e.attr,r=e.size,i=e.title,a=A(e,k),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),E.createElement(`svg`,M({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:P(P({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&E.createElement(`title`,null,i),e.children)};return O===void 0?t(D):E.createElement(O.Consumer,null,e=>t(e))}function V(e){return z({tag:`svg`,attr:{fill:`currentColor`,viewBox:`0 0 16 16`},child:[{tag:`path`,attr:{d:`M14.949 6.547a3.94 3.94 0 0 0-.348-3.273 4.11 4.11 0 0 0-4.4-1.934A4.1 4.1 0 0 0 8.423.2 4.15 4.15 0 0 0 6.305.086a4.1 4.1 0 0 0-1.891.948 4.04 4.04 0 0 0-1.158 1.753 4.1 4.1 0 0 0-1.563.679A4 4 0 0 0 .554 4.72a3.99 3.99 0 0 0 .502 4.731 3.94 3.94 0 0 0 .346 3.274 4.11 4.11 0 0 0 4.402 1.933c.382.425.852.764 1.377.995.526.231 1.095.35 1.67.346 1.78.002 3.358-1.132 3.901-2.804a4.1 4.1 0 0 0 1.563-.68 4 4 0 0 0 1.14-1.253 3.99 3.99 0 0 0-.506-4.716m-6.097 8.406a3.05 3.05 0 0 1-1.945-.694l.096-.054 3.23-1.838a.53.53 0 0 0 .265-.455v-4.49l1.366.778q.02.011.025.035v3.722c-.003 1.653-1.361 2.992-3.037 2.996m-6.53-2.75a2.95 2.95 0 0 1-.36-2.01l.095.057L5.29 12.09a.53.53 0 0 0 .527 0l3.949-2.246v1.555a.05.05 0 0 1-.022.041L6.473 13.3c-1.454.826-3.311.335-4.15-1.098m-.85-6.94A3.02 3.02 0 0 1 3.07 3.949v3.785a.51.51 0 0 0 .262.451l3.93 2.237-1.366.779a.05.05 0 0 1-.048 0L2.585 9.342a2.98 2.98 0 0 1-1.113-4.094zm11.216 2.571L8.747 5.576l1.362-.776a.05.05 0 0 1 .048 0l3.265 1.86a3 3 0 0 1 1.173 1.207 2.96 2.96 0 0 1-.27 3.2 3.05 3.05 0 0 1-1.36.997V8.279a.52.52 0 0 0-.276-.445m1.36-2.015-.097-.057-3.226-1.855a.53.53 0 0 0-.53 0L6.249 6.153V4.598a.04.04 0 0 1 .019-.04L9.533 2.7a3.07 3.07 0 0 1 3.257.139c.474.325.843.778 1.066 1.303.223.526.289 1.103.191 1.664zM5.503 8.575 4.139 7.8a.05.05 0 0 1-.026-.037V4.049c0-.57.166-1.127.476-1.607s.752-.864 1.275-1.105a3.08 3.08 0 0 1 3.234.41l-.096.054-3.23 1.838a.53.53 0 0 0-.265.455zm.742-1.577 1.758-1 1.762 1v2l-1.755 1-1.762-1z`},child:[]}]})(e)}function H(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M2.25 1.5a.75.75 0 0 0-.75.75v16.5H0V2.25A2.25 2.25 0 0 1 2.25 0h20.095c1.002 0 1.504 1.212.795 1.92L10.764 14.298h3.486V12.75h1.5v1.922a1.125 1.125 0 0 1-1.125 1.125H9.264l-2.578 2.578h11.689V9h1.5v9.375a1.5 1.5 0 0 1-1.5 1.5H5.185L2.562 22.5H21.75a.75.75 0 0 0 .75-.75V5.25H24v16.5A2.25 2.25 0 0 1 21.75 24H1.655C.653 24 .151 22.788.86 22.08L13.19 9.75H9.75v1.5h-1.5V9.375A1.125 1.125 0 0 1 9.375 8.25h5.314l2.625-2.625H5.625V15h-1.5V5.625a1.5 1.5 0 0 1 1.5-1.5h13.19L21.438 1.5z`},child:[]}]})(e)}function U(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M23.55 5.067c-1.2038-.002-2.1806.973-2.1806 2.1765v4.8676c0 .972-.8035 1.7594-1.7597 1.7594-.568 0-1.1352-.286-1.4718-.7659l-4.9713-7.1003c-.4125-.5896-1.0837-.941-1.8103-.941-1.1334 0-2.1533.9635-2.1533 2.153v4.8957c0 .972-.7969 1.7594-1.7596 1.7594-.57 0-1.1363-.286-1.4728-.7658L.4076 5.1598C.2822 4.9798 0 5.0688 0 5.2882v4.2452c0 .2147.0656.4228.1884.599l5.4748 7.8183c.3234.462.8006.8052 1.3509.9298 1.3771.313 2.6446-.747 2.6446-2.0977v-4.893c0-.972.7875-1.7593 1.7596-1.7593h.003a1.798 1.798 0 0 1 1.4718.7658l4.9723 7.0994c.4135.5905 1.05.941 1.8093.941 1.1587 0 2.1515-.9645 2.1515-2.153v-4.8948c0-.972.7875-1.7594 1.7596-1.7594h.194a.22.22 0 0 0 .2204-.2202v-4.622a.22.22 0 0 0-.2203-.2203Z`},child:[]}]})(e)}function W(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M0 0v24h24V0H0zm17.889 2.889c1.444 0 2.667.444 3.667 1.278l-1.111 1.667c-.889-.611-1.722-1-2.556-1s-1.278.389-1.278.889v.056c0 .667.444.889 2.111 1.333 2 .556 3.111 1.278 3.111 3v.056c0 2-1.5 3.111-3.611 3.111-1.5-.056-3-.611-4.167-1.667l1.278-1.556c.889.722 1.833 1.222 2.944 1.222.889 0 1.389-.333 1.389-.944v-.056c0-.556-.333-.833-2-1.278-2-.5-3.222-1.056-3.222-3.056v-.056c0-1.833 1.444-3 3.444-3zm-16.111.222h2.278l1.5 5.778 1.722-5.778h1.667l1.667 5.778 1.5-5.778h2.333l-2.833 9.944H9.723L8.112 7.277l-1.667 5.778H4.612L1.779 3.111zm.5 16.389h9V21h-9v-1.5z`},child:[]}]})(e)}function G(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M20.953.004a.397.397 0 0 0-.18.017L3.225 5.585c-.175.055-.323.214-.402.398a.42.42 0 0 0-.06.22v5.726a.42.42 0 0 0 .06.22c.079.183.227.341.402.397l7.454 2.364-7.454 2.363c-.255.08-.463.374-.463.655v5.688c0 .282.208.444.463.363l17.55-5.565c.237-.075.426-.336.452-.6.003-.022.013-.04.013-.065V12.06c0-.281-.208-.575-.463-.656L13.4 9.065l7.375-2.339c.255-.08.462-.375.462-.656V.384c0-.211-.117-.355-.283-.38z`},child:[]}]})(e)}function K(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M7.833 6.666v-.055c0-1-.667-1.5-1.778-1.5H4.389v3.055h1.723c1.111 0 1.721-.666 1.721-1.5zM0 0v24h24V0H0zm2.223 3.167h4c2.389 0 3.833 1.389 3.833 3.445v.055c0 2.278-1.778 3.5-4.001 3.5H4.389v2.945H2.223V3.167zM11.277 21h-9v-1.5h9V21zm4.779-7.777c-2.944.055-5.111-2.223-5.111-5.057C10.944 5.333 13.056 3 16.111 3c1.889 0 3 .611 3.944 1.556l-1.389 1.61c-.778-.722-1.556-1.111-2.556-1.111-1.658 0-2.873 1.375-2.887 3.084.014 1.709 1.174 3.083 2.887 3.083 1.111 0 1.833-.445 2.61-1.167l1.39 1.389c-.999 1.112-2.166 1.779-4.054 1.779z`},child:[]}]})(e)}function q(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M0 0v24h24V0zm3.723 3.111h5v1.834h-1.39v6.277h1.39v1.834h-5v-1.834h1.444V4.945H3.723zm11.055 0H17v6.5c0 .612-.055 1.111-.222 1.556-.167.444-.39.777-.723 1.11-.277.279-.666.557-1.11.668a3.933 3.933 0 0 1-1.445.278c-.778 0-1.444-.167-1.944-.445a4.81 4.81 0 0 1-1.279-1.056l1.39-1.555c.277.334.555.555.833.722.277.167.611.278.945.278.389 0 .721-.111 1-.389.221-.278.333-.667.333-1.278zM2.222 19.5h9V21h-9z`},child:[]}]})(e)}function J(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23`},child:[]}]})(e)}function Y(e){return z({tag:`svg`,attr:{role:`img`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`},child:[]}]})(e)}function ie(e){return z({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15.434 1.72887L12.14 0.144875C12.002 0.078875 11.855 0.046875 11.709 0.046875C11.353 0.046875 11.18 0.211875 11.155 0.228875C11.073 0.270875 11.005 0.337875 11.004 0.338875L4.698 6.08888L1.951 4.00488C1.832 3.91388 1.69 3.86987 1.548 3.86987C1.387 3.86987 1.226 3.92788 1.1 4.04288L0.219 4.84387C0.074 4.97587 0.001 5.15688 0.001 5.33687C0.001 5.51687 0.073 5.69688 0.218 5.82888L2.6 8.00088L0.217 10.1719C0.072 10.3039 0 10.4839 0 10.6639C0 10.8439 0.073 11.0249 0.218 11.1569L1.099 11.9579C1.226 12.0729 1.386 12.1309 1.547 12.1309C1.688 12.1309 1.83 12.0859 1.95 11.9959L4.697 9.91187L11.003 15.6619C11.003 15.6619 11.072 15.7299 11.155 15.7719C11.179 15.7889 11.353 15.9529 11.709 15.9529C11.855 15.9529 12.003 15.9209 12.141 15.8549L15.435 14.2709C15.781 14.1049 16.001 13.7539 16.001 13.3699V2.62888C16.001 2.24487 15.781 1.89488 15.435 1.72787L15.434 1.72887ZM7.217 7.99988L12.002 4.36987V11.6299L7.217 7.99988Z`},child:[]}]})(e)}function ae(e){return z({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.045 7.37722L5.449 5.40722L10.636 0.676223C10.685 0.631223 10.735 0.617223 10.778 0.617223C10.786 0.617223 10.999 0.627223 10.999 0.837223V5.13222L8.044 7.37622L8.045 7.37722ZM0.217 10.1762C0.072 10.3082 0 10.4882 0 10.6682C0 10.8482 0.073 11.0292 0.218 11.1612L1.099 11.9622C1.226 12.0772 1.386 12.1352 1.547 12.1352C1.688 12.1352 1.83 12.0902 1.95 12.0002L3.887 10.5312L1.858 8.68122L0.218 10.1762H0.217ZM1.95 4.00822C1.83 3.91722 1.689 3.87322 1.547 3.87322C1.386 3.87322 1.225 3.93122 1.099 4.04622L0.218 4.84722C0.073 4.97922 0 5.16022 0 5.34022C0 5.52022 0.072 5.70022 0.217 5.83222L2.202 7.64222L10.634 15.3332C10.684 15.3792 10.735 15.3922 10.779 15.3922C10.888 15.3922 11 15.3142 11 15.1752V10.8762L1.95 4.00822ZM15.434 1.73322L12.14 0.149223C12.002 0.0832227 11.855 0.0532227 11.709 0.0532227H11.704C11.888 0.268223 12.003 0.537223 12.003 0.837223V15.1752C12.004 15.4702 11.894 15.7342 11.716 15.9472H11.734C11.748 15.9472 11.761 15.9472 11.775 15.9472C11.962 15.9472 12.123 15.8682 12.14 15.8602L15.434 14.2762C15.78 14.1102 16 13.7592 16 13.3752V2.63422C16 2.25022 15.78 1.90022 15.434 1.73322Z`},child:[]}]})(e)}var X=n(),Z=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,oe={codex:V,claude:Y,vscode:ie,"vscode-insiders":ae,cursor:J,antigravity:w,intellij:q,webstorm:W,pycharm:K,sublime:G,zed:H,windsurf:U},se={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`,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 Q({icon:e}){let t=oe[e]??s;return(0,X.jsx)(`span`,{className:i(`grid size-10 shrink-0 place-items-center rounded-xl shadow-sm`,se[e]),"aria-hidden":`true`,children:(0,X.jsx)(t,{className:`size-5`})})}function $({target:e,busy:t,launching:n,preferred:r,onLaunch:a}){return(0,X.jsxs)(`button`,{type:`button`,disabled:!e.available||t,onClick:()=>a(e),"aria-label":`Open workspace in ${e.name}`,className:i(`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,X.jsx)(Q,{icon:e.icon}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:e.name}),n?(0,X.jsx)(o,{className:`size-4`}):r?(0,X.jsx)(v,{size:`sm`,variant:`secondary`,children:`Preferred`}):null]}),(0,X.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})}function ce({session:e,busy:t,launching:n,onResume:r}){let a=e.desktopHandoff.method===`direct`,s=a?`Codex Desktop`:`Claude Desktop`;return(0,X.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>r(e),"aria-label":a?`Resume ${e.title} in Codex Desktop`:`Move ${e.title} to Claude Desktop`,className:i(`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,X.jsx)(Q,{icon:a?`codex`:`claude`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate font-medium text-foreground`,title:e.title,children:e.title}),n?(0,X.jsx)(o,{className:`size-4 shrink-0`}):a?(0,X.jsx)(l,{className:`size-4 shrink-0 text-muted-foreground`}):(0,X.jsx)(f,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,X.jsxs)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:[a?`Open this existing task in ${s}`:`Resume in Claude Code, then type /desktop`,` · `,new Date(e.updatedAt).toLocaleString()]})]})]})}function le({workspaceId:e,workspacePath:t,isVsCode:n=!1,className:r}){let[i,s]=(0,E.useState)(!1),[l,f]=(0,E.useState)(null),[v,w]=(0,E.useState)(null),[D,O]=(0,E.useState)(null),k=(0,E.useRef)(!1),A=ne(),j=_(e,i),M=u().data?.config,N=A.data?.filter(e=>e.available)??[],P=N.filter(e=>e.kind===`ai-app`),F=M?.defaultEditor?{code:`vscode`,"code-insiders":`vscode-insiders`,cursor:`cursor`,antigravity:`antigravity`,idea:`intellij`,webstorm:`webstorm`,charm:`pycharm`,subl:`sublime`,zed:`zed`,windsurf:`windsurf`}[M.defaultEditor]:void 0,I=N.filter(e=>e.kind===`editor`).toSorted((e,t)=>Number(t.id===F)-Number(e.id===F)),L=new Set(N.map(e=>e.id)),R=(j.data??[]).filter(e=>e.desktopHandoff&&L.has(e.desktopHandoff.targetId)),z=n||N.length>0,B=async t=>{if(!k.current){k.current=!0,w(null),O(null),f(t.id);try{await m(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.id})}),s(!1)}catch(e){w(e instanceof Error?e.message:String(e)),await A.refetch()}finally{f(null),k.current=!1}}},V=async t=>{if(!(k.current||!t.desktopHandoff||!Z.test(t.id))){k.current=!0,w(null),O(null),f(`session:${t.id}`);try{if(t.desktopHandoff.method===`guided`){await navigator.clipboard.writeText(`claude --resume ${t.id}`),O(`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 m(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.desktopHandoff.targetId,action:`resume`,sessionId:t.id})}),s(!1)}catch(e){w(e instanceof Error?e.message:String(e)),await Promise.all([A.refetch(),j.refetch()])}finally{f(null),k.current=!1}}},H=()=>{window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:t},`*`),s(!1)},U=()=>Promise.all([A.refetch(),j.refetch()]),W=A.isFetching||j.isFetching;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(a,{variant:`outline`,className:r,onClick:()=>s(!0),children:[(0,X.jsx)(T,{}),`Open with…`]}),(0,X.jsx)(g,{open:i,onOpenChange:e=>{s(e),e||(w(null),O(null))},children:(0,X.jsxs)(d,{className:`max-w-2xl`,"aria-busy":l!==null,children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(te,{children:`Open workspace with…`}),(0,X.jsx)(ee,{children:`Continue recent AI work or start in an installed coding app or editor. AI apps may use their own online services.`})]}),(0,X.jsxs)(p,{className:`space-y-5`,children:[v&&(0,X.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-foreground`,children:v}),D&&(0,X.jsx)(`div`,{role:`status`,className:`rounded-lg border border-primary/25 bg-primary/5 px-3 py-2 text-sm text-foreground`,children:D}),j.isLoading?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,X.jsx)(o,{className:`size-4`}),` Checking recent sessions…`]}):R.length>0?(0,X.jsxs)(`section`,{"aria-labelledby":`recent-sessions-heading`,children:[(0,X.jsx)(`h3`,{id:`recent-sessions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Continue recent work`}),(0,X.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:R.map(e=>(0,X.jsx)(ce,{session:e,busy:l!==null,launching:l===`session:${e.id}`,onResume:V},`${e.assistant}:${e.id}`))})]}):j.isError?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent sessions could not be checked. Starting new work is still available.`}):null,n&&(0,X.jsxs)(`section`,{"aria-labelledby":`current-editor-heading`,children:[(0,X.jsx)(`h3`,{id:`current-editor-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Current window`}),(0,X.jsxs)(`button`,{type:`button`,disabled:l!==null,onClick:H,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,X.jsx)(Q,{icon:`vscode`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`block font-medium`,children:`Current VS Code window`}),(0,X.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:`Open through the installed NexusFlow extension.`})]})]})]}),A.isLoading?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,X.jsx)(o,{}),` Checking apps on this computer…`]}):A.isError?(0,X.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive-foreground`,children:A.error instanceof Error?A.error.message:`Could not check available apps.`}):(0,X.jsxs)(X.Fragment,{children:[P.length>0&&(0,X.jsxs)(`section`,{"aria-labelledby":`ai-apps-heading`,children:[(0,X.jsx)(`h3`,{id:`ai-apps-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`AI coding apps`}),(0,X.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:P.map(e=>(0,X.jsx)($,{target:e,busy:l!==null,launching:l===e.id,onLaunch:B},e.id))})]}),I.length>0&&(0,X.jsxs)(`section`,{"aria-labelledby":`editors-heading`,children:[(0,X.jsx)(`h3`,{id:`editors-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Code editors`}),(0,X.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:I.map(e=>(0,X.jsx)($,{target:e,busy:l!==null,launching:l===e.id,preferred:e.id===F,onLaunch:B},e.id))})]}),!z&&(0,X.jsx)(S,{className:`rounded-xl border border-dashed py-8 md:p-8`,children:(0,X.jsxs)(x,{children:[(0,X.jsx)(y,{variant:`icon`,children:(0,X.jsx)(C,{})}),(0,X.jsx)(re,{className:`text-base`,children:`No compatible apps detected`}),(0,X.jsx)(b,{children:`Install a supported coding app or add its command to PATH, then recheck.`})]})})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-3`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:W?`Checking recent sessions and apps…`:`Can’t find your app or session? Recheck detection.`}),(0,X.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:()=>void U(),disabled:W||l!==null,children:[(0,X.jsx)(c,{className:W?`animate-spin`:``}),`Recheck`]})]})]})]})})]})}export{le as t};
|