@mrpatronz/nexusflow 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/desktop/assets/icon.png +0 -0
- package/dist/agent/ClaudeCliAdapter.d.ts +2 -2
- package/dist/agent/ClaudeCliAdapter.d.ts.map +1 -1
- package/dist/agent/ClaudeCliAdapter.js +6 -4
- package/dist/agent/ClaudeCliAdapter.js.map +1 -1
- package/dist/agent/CliAdapterBase.d.ts.map +1 -1
- package/dist/agent/CliAdapterBase.js +8 -1
- package/dist/agent/CliAdapterBase.js.map +1 -1
- package/dist/agent/cliAvailability.d.ts +2 -5
- package/dist/agent/cliAvailability.d.ts.map +1 -1
- package/dist/agent/cliAvailability.js +6 -41
- package/dist/agent/cliAvailability.js.map +1 -1
- package/dist/agent/session.d.ts +5 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +8 -0
- package/dist/agent/session.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +40 -0
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/desktop.d.ts +2 -0
- package/dist/commands/desktop.d.ts.map +1 -1
- package/dist/commands/desktop.js +102 -31
- package/dist/commands/desktop.js.map +1 -1
- package/dist/core/workspace.d.ts +10 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +21 -4
- package/dist/core/workspace.js.map +1 -1
- package/dist/core/worktree.d.ts +10 -4
- package/dist/core/worktree.d.ts.map +1 -1
- package/dist/core/worktree.js +34 -47
- package/dist/core/worktree.js.map +1 -1
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +0 -1
- package/dist/generators/base.js.map +1 -1
- package/dist/gui/assets/AgentsPage-DbivhmK0.js +3 -0
- package/dist/gui/assets/DashboardPage-D50Qrm3e.js +1 -0
- package/dist/gui/assets/{GettingStartedPage-BKeuSHZQ.js → GettingStartedPage-1MOTng3B.js} +1 -1
- package/dist/gui/assets/{NullStore-DuSDhGOe.js → NullStore-tdPen1kp.js} +1 -1
- package/dist/gui/assets/ProjectsPage-srKgf7VN.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-CP0yn5mw.js +1 -0
- package/dist/gui/assets/SettingsPage-DWmrLV8o.js +1 -0
- package/dist/gui/assets/SkillsPage-CKjTXdrd.js +6 -0
- package/dist/gui/assets/StartWorkPage-BCUnJ9k8.js +1 -0
- package/dist/gui/assets/{StrategiesPage-BRQMly_d.js → StrategiesPage-CdCbbIu-.js} +2 -2
- package/dist/gui/assets/WorkroomsPage-BcT-mGtT.js +4 -0
- package/dist/gui/assets/WorkspacesPage-CYFCm-7_.js +2 -0
- package/dist/gui/assets/{alert-dialog-BHEUQVyS.js → alert-dialog-u7qgb9Hq.js} +1 -1
- package/dist/gui/assets/badge-DwXvB44H.js +1 -0
- package/dist/gui/assets/chunk-BV7QT456-DfUBKG-z.js +3 -0
- package/dist/gui/assets/index-3tD_IeyQ.js +55 -0
- package/dist/gui/assets/index-CK5YRfPV.css +2 -0
- package/dist/gui/assets/tabs-BrHKp5bD.js +1 -0
- package/dist/gui/assets/{useAriaLabelledBy-BmJErI5a.js → useAriaLabelledBy-C4zV-1Ra.js} +1 -1
- package/dist/gui/assets/{vsc-eMRaEwN3.js → vsc-D80c4gBT.js} +1 -1
- package/dist/gui/index.html +5 -8
- package/dist/orchestration/runner.d.ts.map +1 -1
- package/dist/orchestration/runner.js +28 -10
- package/dist/orchestration/runner.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +116 -10
- package/dist/server.js.map +1 -1
- package/dist/utils/repo-freshness.d.ts +106 -0
- package/dist/utils/repo-freshness.d.ts.map +1 -0
- package/dist/utils/repo-freshness.js +405 -0
- package/dist/utils/repo-freshness.js.map +1 -0
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +23 -8
- package/dist/utils/session-finder.js.map +1 -1
- package/dist/utils/terminal-launch.d.ts +4 -2
- package/dist/utils/terminal-launch.d.ts.map +1 -1
- package/dist/utils/terminal-launch.js +26 -16
- package/dist/utils/terminal-launch.js.map +1 -1
- package/dist/utils/user-paths.d.ts +23 -0
- package/dist/utils/user-paths.d.ts.map +1 -0
- package/dist/utils/user-paths.js +126 -0
- package/dist/utils/user-paths.js.map +1 -0
- package/package.json +6 -2
- package/dist/gui/assets/AgentsPage-CnXzZFo1.js +0 -3
- package/dist/gui/assets/DashboardPage-rm3hKgsw.js +0 -1
- package/dist/gui/assets/ProjectsPage-CioaA4uf.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-DKZ1rPmE.js +0 -1
- package/dist/gui/assets/Separator-BgWyHDtg.js +0 -1
- package/dist/gui/assets/SettingsPage-BevO8oge.js +0 -1
- package/dist/gui/assets/SkillsPage-D2stJRWy.js +0 -6
- package/dist/gui/assets/StartWorkPage-C8a6eN90.js +0 -1
- package/dist/gui/assets/WorkroomsPage-KqBkRD-x.js +0 -4
- package/dist/gui/assets/WorkspacesPage-DcA2i5HN.js +0 -2
- package/dist/gui/assets/badge-DTBzXOWn.js +0 -1
- package/dist/gui/assets/index-BB4BuHBQ.css +0 -2
- package/dist/gui/assets/index-BTe-_1Mu.js +0 -57
- package/dist/gui/assets/isElementDisabled-BrwmCB1d.js +0 -1
- package/dist/gui/assets/menu-d_G9km1-.js +0 -1
- package/dist/gui/assets/tabs-BHwTt4t1.js +0 -1
- package/dist/gui/assets/useValueChanged-WS99hTmm.js +0 -1
package/dist/core/worktree.js
CHANGED
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { execa } from 'execa';
|
|
6
6
|
import { isValidBranchName } from '../utils/git.js';
|
|
7
|
+
import { resolveTrackingBranch, fastForwardBranch } from '../utils/repo-freshness.js';
|
|
7
8
|
/**
|
|
8
9
|
* Creates a git worktree for a branch, materializing the branch as needed:
|
|
9
10
|
*
|
|
10
|
-
* 1.
|
|
11
|
-
* 2.
|
|
12
|
-
* 3.
|
|
11
|
+
* 1. Resolves remote tracking branch (origin, upstream, etc.) and fetches remote refs.
|
|
12
|
+
* 2. Safely fast-forwards the local base branch if clean and autoUpdateBase is not false.
|
|
13
|
+
* 3. If `branchName` exists locally, check it out into the worktree.
|
|
14
|
+
* 4. Else if `<remote>/<branchName>` exists, create a tracking local branch
|
|
13
15
|
* from it in the worktree.
|
|
14
|
-
*
|
|
16
|
+
* 5. Else create a new branch from `<remote>/<baseBranch>` (or the local
|
|
15
17
|
* `baseBranch` when there is no remote).
|
|
16
18
|
*
|
|
17
19
|
* @param repoPath - Absolute path to the main repo checkout.
|
|
@@ -28,47 +30,25 @@ export async function createWorktree(repoPath, targetPath, branchName, baseBranc
|
|
|
28
30
|
if (!isValidBranchName(baseBranch)) {
|
|
29
31
|
throw new Error(`Invalid base branch name "${baseBranch}".`);
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fetched = true;
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
// Silently ignore fetch failures (e.g., offline or no remote origin)
|
|
39
|
-
}
|
|
40
|
-
// Update local base branch, main, and master to keep them in sync with remote before branching
|
|
41
|
-
if (fetched) {
|
|
33
|
+
// Resolve tracking branch for baseBranch (checks origin, upstream, etc.)
|
|
34
|
+
const { trackingBranch, remoteName, hasRemote } = await resolveTrackingBranch(repoPath, baseBranch);
|
|
35
|
+
// If remote exists and autoUpdateBase is enabled, safely fast-forward clean repos
|
|
36
|
+
if (hasRemote && options.autoUpdateBase !== false) {
|
|
42
37
|
try {
|
|
43
|
-
|
|
44
|
-
const currentBranch = currentBranchRaw.trim();
|
|
45
|
-
const branchesToUpdate = Array.from(new Set([baseBranch, 'main', 'master']));
|
|
46
|
-
for (const branch of branchesToUpdate) {
|
|
47
|
-
try {
|
|
48
|
-
if (currentBranch === branch) {
|
|
49
|
-
// Safe fast-forward merge from remote tracking branch for the currently checked-out branch
|
|
50
|
-
await execa('git', ['merge', '--ff-only', `origin/${branch}`], { cwd: repoPath });
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// Fast-forward local ref from remote ref without checkout
|
|
54
|
-
await execa('git', ['fetch', 'origin', `${branch}:${branch}`], { cwd: repoPath });
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
// Ignore individual branch update failures
|
|
59
|
-
}
|
|
60
|
-
}
|
|
38
|
+
await fastForwardBranch(repoPath, baseBranch);
|
|
61
39
|
}
|
|
62
40
|
catch {
|
|
63
|
-
//
|
|
41
|
+
// Best-effort fast-forward; uncommitted work is preserved on dirty trees
|
|
64
42
|
}
|
|
65
43
|
}
|
|
66
|
-
// Determine starting point: remote
|
|
44
|
+
// Determine starting point: remote tracking ref if verified, else local baseBranch
|
|
67
45
|
let startPoint = baseBranch;
|
|
68
|
-
if (
|
|
46
|
+
if (hasRemote && trackingBranch) {
|
|
69
47
|
try {
|
|
70
|
-
await execa('git', ['rev-parse', '--verify', `
|
|
71
|
-
|
|
48
|
+
await execa('git', ['rev-parse', '--verify', `refs/remotes/${trackingBranch}`], {
|
|
49
|
+
cwd: repoPath,
|
|
50
|
+
});
|
|
51
|
+
startPoint = trackingBranch;
|
|
72
52
|
}
|
|
73
53
|
catch {
|
|
74
54
|
// remote tracking branch does not exist, fallback to local branch
|
|
@@ -83,15 +63,22 @@ export async function createWorktree(repoPath, targetPath, branchName, baseBranc
|
|
|
83
63
|
catch {
|
|
84
64
|
// Branch does not exist locally
|
|
85
65
|
}
|
|
86
|
-
// Check for a remote-only branch (
|
|
66
|
+
// Check for a remote-only branch (<remote>/<branchName> without a local ref).
|
|
87
67
|
let remoteBranchExists = false;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
68
|
+
let remoteRefToTrack = `origin/${branchName}`;
|
|
69
|
+
if (!branchExists && hasRemote) {
|
|
70
|
+
const targetTracking = await resolveTrackingBranch(repoPath, branchName);
|
|
71
|
+
if (targetTracking.trackingBranch) {
|
|
72
|
+
try {
|
|
73
|
+
await execa('git', ['rev-parse', '--verify', `refs/remotes/${targetTracking.trackingBranch}`], {
|
|
74
|
+
cwd: repoPath,
|
|
75
|
+
});
|
|
76
|
+
remoteBranchExists = true;
|
|
77
|
+
remoteRefToTrack = targetTracking.trackingBranch;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Branch does not exist on remote either
|
|
81
|
+
}
|
|
95
82
|
}
|
|
96
83
|
}
|
|
97
84
|
if (options.mustExist && !branchExists && !remoteBranchExists) {
|
|
@@ -105,7 +92,7 @@ export async function createWorktree(repoPath, targetPath, branchName, baseBranc
|
|
|
105
92
|
else if (remoteBranchExists) {
|
|
106
93
|
// Materialize the remote-only branch as a local tracking branch. The local
|
|
107
94
|
// ref is new, so rollback may delete it — the remote still has the branch.
|
|
108
|
-
await execa('git', ['worktree', 'add', '--track', '-b', branchName, targetPath,
|
|
95
|
+
await execa('git', ['worktree', 'add', '--track', '-b', branchName, targetPath, remoteRefToTrack], { cwd: repoPath });
|
|
109
96
|
}
|
|
110
97
|
else {
|
|
111
98
|
// If the branch does not exist, create a new branch based on the start point without tracking it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/core/worktree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/core/worktree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,4BAA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;CACjB;AAmFD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/generators/base.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpD,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAmFD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmHhF"}
|
package/dist/generators/base.js
CHANGED
|
@@ -208,7 +208,6 @@ ${reposSection}
|
|
|
208
208
|
- \`contextspace-knowledge.md\` — decisions and gotchas from earlier sessions, one per \`###\` heading. Use MCP \`search_knowledge\` for fast lookup or search headings for your topic and read only those entries, not the whole file. Add with \`ctxspace knowledge add -t decision|gotcha --title "..." -m "..."\`, keeping each entry to a rule and its reason
|
|
209
209
|
- \`contextspace-plan.md\` — cross-repo package merge order only; runtime and intra-repo contracts are represented by scoped knowledge entries
|
|
210
210
|
- \`.agents/skills/\` — procedural playbooks and specialized skills for this workspace (also mirrored to \`.codex/skills/\`, \`.claude/skills/\`, \`.github/skills/\`, \`.cursor/skills/\` where supported)
|
|
211
|
-
- Cross-harness collaboration — Use MCP \`read_workroom_stream\` and \`post_workroom_handoff\` to coordinate plans and handoffs across AI agents
|
|
212
211
|
${ownInstructions}${customCommands}${teamwork}`;
|
|
213
212
|
}
|
|
214
213
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-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ae,t as oe}from"./alert-dialog-u7qgb9Hq.js";import{t as se}from"./trash-2-CMdv3eD3.js";import{n as ce}from"./chunk-BV7QT456-DfUBKG-z.js";import{Dn as le,E as ue,L as de,N as l,O as fe,_ as u,a as d,d as pe,f,gn as p,h as m,i as me,it as he,kn as h,m as g,mn as ge,n as _,o as v,ot as _e,p as y,q as ve,r as b,t as x,v as S,xn as ye}from"./index-3tD_IeyQ.js";import{t as be}from"./card-yrg6ov8B.js";import{t as C}from"./label-DC730X8s.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}=ue(),{data:U=[]}=_e(),W=he(t===`global`?``:t),G=ve(),K=de(),q=l(),J=fe(),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)(h,{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)(ce,{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)(ye,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(C,{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)(p,{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)(ge,{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)(pe,{})}):we||Y&&W.isError?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(d,{children:`Resources could not be loaded`}),(0,T.jsx)(_,{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)(d,{children:`Codex is not enabled for this workspace`}),(0,T.jsx)(_,{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)(me,{children:(0,T.jsx)(h,{className:`h-8 w-8 text-muted-foreground`})}),(0,T.jsxs)(b,{children:[(0,T.jsx)(d,{children:`No Codex agents found`}),(0,T.jsx)(_,{children:`Create an agent or import a native TOML definition.`})]}),!Y&&(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(p,{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)(be,{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)(s,{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)(le,{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)(te,{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)(se,{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)(s,{variant:`secondary`,children:e.sandboxMode}),e.modelReasoningEffort&&(0,T.jsx)(s,{variant:`secondary`,children:e.modelReasoningEffort}),e.model&&(0,T.jsx)(s,{variant:`secondary`,children:e.model})]})]},e.id)})})}),(0,T.jsx)(f,{open:Se,onOpenChange:k,children:(0,T.jsxs)(u,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(S,{children:M?`Edit Codex agent`:`Create Codex agent`}),(0,T.jsx)(y,{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)(C,{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)(C,{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)(C,{htmlFor:`agent-instructions`,children:`Developer instructions`}),(0,T.jsx)(v,{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)(C,{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)(C,{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)(C,{htmlFor:`agent-sandbox`,children:`Sandbox`}),(0,T.jsxs)(`select`,{id:`agent-sandbox`,value:P.sandboxMode??``,onChange:e=>F({...P,sandboxMode:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`read-only`,children:`Read only`}),(0,T.jsx)(`option`,{value:`workspace-write`,children:`Workspace write`})]})]})]})]}),(0,T.jsxs)(g,{children:[(0,T.jsx)(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)(f,{open:A,onOpenChange:j,children:(0,T.jsxs)(u,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(S,{children:`Import Codex agent TOML`}),(0,T.jsx)(y,{children:`The import accepts the required native fields and supported model, reasoning, and sandbox overrides.`})]}),(0,T.jsx)(v,{value:I,onChange:e=>L(e.target.value),className:`min-h-72 font-mono`,placeholder:`name = "reviewer"
|
|
2
|
+
description = "Use for code review."
|
|
3
|
+
developer_instructions = "Review the fixed diff."`}),(0,T.jsxs)(g,{children:[(0,T.jsx)(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)(c,{children:[(0,T.jsxs)(ee,{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)(ne,{children:[(0,T.jsx)(re,{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{_ as e,b as t,g as n,t as r}from"./button-CREn1mup.js";import{t as i}from"./code-xml-DH-38Tt7.js";import{t as a}from"./git-branch-Ce0I2663.js";import{t as o}from"./layers-j_brOuoa.js";import{t as s}from"./brand-hHByyyzq.js";import{Cn as c,D as l,Jt as u,Mn as d,On as f,R as ee,Yt as p,Zt as m,a as h,c as g,ct as _,d as v,dn as y,gn as b,i as x,in as S,l as C,ln as w,mn as T,n as E,qt as D,r as O,t as k,tt as A,u as j,xn as M}from"./index-3tD_IeyQ.js";import{t as N}from"./card-yrg6ov8B.js";var P=t(e(),1),F=n(),I=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,F.jsx)(u,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!1,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,F.jsx)(w,{size:12})},{id:`antigravity-ide`,label:`Antigravity IDE Workspace`,shortLabel:`IDE`,type:`editor`,targetId:`antigravity`,isAvailable:t.find(e=>e.id===`antigravity`)?.available??!1,unavailableReason:`Antigravity IDE not installed`,icon:(0,F.jsx)(i,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,F.jsx)(p,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`claude-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`claude`,isAvailable:e.claude??!1,unavailableReason:`CLI "claude" not found on PATH`,icon:(0,F.jsx)(w,{size:12})},{id:`claude-desktop`,label:`Claude Desktop App`,shortLabel:`App`,type:`app`,targetId:`claude-desktop`,isAvailable:t.find(e=>e.id===`claude-desktop`)?.available??!1,unavailableReason:`Claude Desktop not detected`,icon:(0,F.jsx)(c,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,F.jsx)(S,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`codex-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`codex`,isAvailable:e.codex??!1,unavailableReason:`CLI "codex" not found on PATH`,icon:(0,F.jsx)(w,{size:12})},{id:`codex-desktop`,label:`Codex Desktop App`,shortLabel:`App`,type:`app`,targetId:`codex-desktop`,isAvailable:t.find(e=>e.id===`codex-desktop`)?.available??!1,unavailableReason:`Codex Desktop not detected`,icon:(0,F.jsx)(c,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white shadow-2xs`,children:(0,F.jsx)(m,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`copilot-cli`,label:`Copilot CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`copilot`,isAvailable:e.copilot??!1,icon:(0,F.jsx)(w,{size:12})},{id:`copilot-vscode`,label:`VS Code with Copilot`,shortLabel:`VS Code`,type:`editor`,targetId:`vscode`,isAvailable:t.find(e=>e.id===`vscode`)?.available??!1,unavailableReason:`VS Code not detected`,icon:(0,F.jsx)(i,{size:12})}]}];function L({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:i,onNewWorkspace:c,showToast:u}){let p=l(),m=A(),S=ee(),[w,L]=(0,P.useState)(``),[R,z]=(0,P.useState)(!1),[B,V]=(0,P.useState)(``),H=e.find(e=>e.branchName===B)??e[0],U=e.filter(e=>`${e.branchName} ${e.description??``} ${e.repos.join(` `)}`.toLowerCase().includes(w.trim().toLowerCase())&&(!R||(t[e.branchName]?.changedFiles??0)>0)),[W,G]=(0,P.useState)(null),K=e.flatMap(e=>t[e.branchName]?[t[e.branchName]]:[]),q=K.reduce((e,t)=>e+(t.changedFiles||0),0),J=K.filter(e=>e.changedFiles>0).length,Y=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,te=e.filter(e=>e.mode===`in-place`).length,X=(0,P.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=g(e),r=t.get(e);r?r.count+=1:t.set(e,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Z=(0,P.useMemo)(()=>{let e={};return(p.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[p.data]),Q=(0,P.useMemo)(()=>m.data??[],[m.data]),$=(0,P.useMemo)(()=>I.map(e=>{let t=e.getOptions({aiDetected:Z,launchTargets:Q}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Z,Q]),ne=async(e,t)=>{if(W)return;let n=H;if(!n){u?.(`No active workspace available to launch harness in.`,`error`);return}let r=`${e.id}:${t.id}`;G(r);try{t.type===`cli`?(await S.mutateAsync({workspaceId:n.branchName,assistant:e.id,command:t.command}),u?.(`Launched ${e.name} (${t.label}) for ${n.branchName}`,`success`)):t.targetId&&(await _(`/api/workspace/${encodeURIComponent(n.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.targetId})}),u?.(`Opened ${n.branchName} in ${e.name} (${t.label})`,`success`))}catch(t){u?.(`Failed to launch ${e.name}: ${t instanceof Error?t.message:String(t)}`,`error`)}finally{G(null)}};return(0,F.jsxs)(`div`,{className:`context-home mx-auto max-w-7xl space-y-7 pb-10`,children:[(0,F.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,F.jsx)(o,{size:15}),(0,F.jsx)(`span`,{children:s}),(0,F.jsx)(`span`,{className:`opacity-40`,children:`/`}),(0,F.jsx)(`span`,{className:`text-foreground`,children:`Overview`})]}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your next idea starts here.`})]}),(0,F.jsxs)(`section`,{className:`context-hero relative overflow-hidden rounded-2xl border border-border p-6 sm:p-9 lg:p-11`,children:[(0,F.jsxs)(`div`,{className:`relative z-10 max-w-2xl`,children:[(0,F.jsxs)(`div`,{className:`mb-5 flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[0.22em] text-primary`,children:[(0,F.jsx)(D,{size:23}),` A space for what’s next`]}),(0,F.jsxs)(`h1`,{className:`text-4xl font-semibold leading-[1.08] tracking-[-0.055em] sm:text-5xl lg:text-6xl`,children:[`Many repositories.`,(0,F.jsx)(`br`,{}),(0,F.jsx)(`span`,{className:`context-hero-accent`,children:`One clear direction.`})]}),(0,F.jsx)(`p`,{className:`mt-5 max-w-md text-sm leading-relaxed text-muted-foreground`,children:`Bring your code, context, and AI assistants together. Pick up a workspace, follow an idea, and make your next move.`}),(0,F.jsxs)(`div`,{className:`mt-7 flex flex-wrap gap-3`,children:[(0,F.jsxs)(r,{onClick:c,className:`h-10 rounded-lg px-5`,children:[(0,F.jsx)(b,{size:16}),` Start work `,(0,F.jsx)(d,{size:15})]}),H&&(0,F.jsxs)(r,{variant:`outline`,className:`h-10 max-w-full rounded-lg`,onClick:()=>i(H.branchName),children:[(0,F.jsxs)(`span`,{className:`truncate`,children:[`Open `,H.branchName]}),(0,F.jsx)(d,{size:14})]})]})]}),(0,F.jsx)(`div`,{className:`context-hero-signature pointer-events-none absolute right-10 top-1/2 hidden -translate-y-1/2 opacity-20 xl:block`,"aria-hidden":`true`,children:(0,F.jsx)(D,{size:220})}),(0,F.jsxs)(`div`,{className:`relative mt-9 flex flex-wrap gap-x-6 gap-y-2 border-t border-border pt-4 text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:`Isolated workspaces`}),(0,F.jsx)(`span`,{children:`Shared knowledge`}),(0,F.jsx)(`span`,{children:`Your choice of AI`})]})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[{label:`Workspaces`,value:n?`—`:e.length,detail:`${Y} worktrees · ${te} in-place`,icon:o},{label:`Connected repositories`,value:n?`—`:X.length,detail:`Across your workspaces`,icon:M},{label:`Changed files`,value:K.length?q:`—`,detail:`${J} workspaces with changes`,icon:a},{label:`Available assistants`,value:p.isLoading||m.isLoading?`—`:$.filter(e=>e.isAnyAvailable).length,detail:`Choose how you work`,icon:y}].map(({label:e,value:t,detail:n,icon:r})=>(0,F.jsxs)(N,{className:`context-metric gap-0 rounded-xl p-4 sm:p-5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:e}),(0,F.jsx)(r,{size:15,className:`text-primary`})]}),(0,F.jsx)(`div`,{className:`my-3 text-3xl font-semibold tracking-tight tabular-nums`,children:t}),(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:n})]},e))}),(0,F.jsxs)(`div`,{className:`grid items-start gap-7 xl:grid-cols-[minmax(0,1fr)_310px]`,children:[(0,F.jsxs)(`section`,{className:`min-w-0`,"aria-labelledby":`workspaces-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{id:`workspaces-heading`,className:`text-lg font-semibold tracking-tight`,children:`Your workspaces`}),(0,F.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`A little context. A lot of possibility.`})]}),(0,F.jsxs)(r,{variant:`ghost`,size:`sm`,onClick:c,children:[(0,F.jsx)(b,{size:14}),` New`]})]}),(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-input bg-card px-3`,children:[(0,F.jsx)(T,{size:15,className:`shrink-0 text-muted-foreground`}),(0,F.jsx)(`input`,{"aria-label":`Search workspaces`,value:w,onChange:e=>L(e.target.value),placeholder:`Find a workspace or repository…`,className:`h-10 w-full min-w-0 bg-transparent text-xs outline-none`})]}),(0,F.jsxs)(r,{variant:R?`secondary`:`outline`,className:`h-10 rounded-lg`,"aria-pressed":R,onClick:()=>z(!R),children:[(0,F.jsx)(a,{size:14}),` With changes`]})]}),n?(0,F.jsx)(N,{className:`p-10`,children:(0,F.jsx)(v,{"aria-label":`Loading workspaces`,className:`mx-auto size-5`})}):e.length?U.length?(0,F.jsx)(`div`,{className:`space-y-3`,children:U.map(e=>{let n=t[e.branchName],r=e.mode===`in-place`||!n?null:C(n.syncStatus);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>i(e.branchName),className:`context-workspace group w-full rounded-xl border border-border bg-card p-5 text-left transition duration-200 hover:border-primary/50 hover:bg-accent/30 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,F.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-lg border border-border bg-primary/5 text-primary`,children:(0,F.jsx)(M,{size:19})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.branchName}),(0,F.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.mode===`in-place`?`In-place workspace`:`Isolated worktree`})]})]}),(0,F.jsx)(d,{size:17,className:`mt-2 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-1 group-hover:text-primary`})]}),e.description&&(0,F.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description}),(0,F.jsx)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:e.repos.map(e=>(0,F.jsx)(`span`,{className:`rounded-md bg-muted px-2 py-1 font-mono text-[10px] text-muted-foreground`,children:g(e)},e))}),(0,F.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-border/60 pt-3 text-[11px] text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:n?.changedFiles?`text-warning-foreground`:``,children:n?n.changedFiles?`${n.changedFiles} changed files`:`Working tree clean`:`Status pending`}),r&&(0,F.jsx)(`span`,{children:r.label}),!!n?.runningServices&&(0,F.jsxs)(`span`,{className:`text-success-foreground`,children:[n.runningServices,` services running`]}),(0,F.jsx)(`span`,{className:`ml-auto`,children:`Open workspace`})]})]},e.id)})}):(0,F.jsxs)(N,{className:`rounded-xl p-8 text-center`,children:[(0,F.jsx)(`p`,{className:`text-sm`,children:`No workspaces match this view.`}),(0,F.jsx)(r,{variant:`ghost`,className:`mt-3`,onClick:()=>{L(``),z(!1)},children:`Clear filters`})]}):(0,F.jsx)(N,{className:`rounded-xl border-dashed`,children:(0,F.jsxs)(k,{children:[(0,F.jsxs)(O,{children:[(0,F.jsx)(x,{variant:`icon`,children:(0,F.jsx)(M,{})}),(0,F.jsx)(h,{children:`Make room for your next idea`}),(0,F.jsx)(E,{children:`Create a workspace to bring repositories and assistant context together.`})]}),(0,F.jsxs)(r,{onClick:c,children:[(0,F.jsx)(b,{size:15}),` Create your first workspace`]})]})})]}),(0,F.jsxs)(`aside`,{className:`rounded-xl border border-border bg-card p-5`,"aria-labelledby":`assistants-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-5`,children:[(0,F.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-primary`,children:[(0,F.jsx)(y,{size:14}),` Ready when you are`]}),(0,F.jsx)(`h2`,{id:`assistants-heading`,className:`text-lg font-semibold tracking-tight`,children:`Your AI, your way.`}),(0,F.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:`Launch an assistant with the right workspace already in place.`})]}),(0,F.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,htmlFor:`launch-workspace`,children:`Launch into`}),(0,F.jsxs)(`select`,{id:`launch-workspace`,value:H?.branchName??``,onChange:e=>V(e.target.value),disabled:!e.length||!!W,className:`mt-2 mb-5 h-9 w-full min-w-0 rounded-md border border-input bg-background px-2 text-xs focus-visible:outline-ring`,children:[!e.length&&(0,F.jsx)(`option`,{value:``,children:`Create a workspace first`}),e.map(e=>(0,F.jsx)(`option`,{value:e.branchName,children:e.branchName},e.id))]}),(0,F.jsx)(`div`,{className:`divide-y divide-border`,children:$.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:i})=>(0,F.jsxs)(`div`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[e.icon,(0,F.jsx)(`h3`,{className:`text-xs font-semibold`,children:e.shortName})]}),(0,F.jsx)(j,{tone:i,children:p.isLoading||m.isLoading?`Checking`:p.isError||m.isError?`Check failed`:n?`Available`:`Not detected`})]}),(0,F.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:t.map(t=>(0,F.jsxs)(r,{variant:`outline`,size:`xs`,disabled:!!W||!H,onClick:()=>void ne(e,t),title:`Open ${e.name} in ${H?.branchName??`a workspace`}`,children:[W===`${e.id}:${t.id}`?(0,F.jsx)(v,{className:`size-3`}):t.icon,t.shortLabel,(0,F.jsx)(d,{size:11})]},t.id))})]},e.id))})]})]}),X.length>0&&(0,F.jsxs)(`section`,{className:`border-t border-border pt-5`,children:[(0,F.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,F.jsx)(f,{size:14}),` Connected repositories`]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:X.map(e=>(0,F.jsxs)(`button`,{onClick:()=>{L(e.path),z(!1),document.getElementById(`workspaces-heading`)?.scrollIntoView({block:`start`})},title:e.path,className:`flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs transition-colors hover:border-primary/50 focus-visible:outline-ring`,children:[(0,F.jsx)(M,{size:13,className:`text-primary`}),e.name,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:e.count})]},e.path))})]})]})}export{L as DashboardPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,t}from"./button-CREn1mup.js";import{t as n}from"./circle-plus--zM3-3r3.js";import{t as r}from"./brand-hHByyyzq.js";import{
|
|
1
|
+
import{g as e,t}from"./button-CREn1mup.js";import{t as n}from"./circle-plus--zM3-3r3.js";import{t as r}from"./brand-hHByyyzq.js";import{fn as i}from"./index-3tD_IeyQ.js";var a=e();function o({config:e,onCreateWorkspace:o,onModifySettings:s}){return(0,a.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,a.jsxs)(`header`,{className:`mb-10`,children:[(0,a.jsx)(`div`,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary border border-primary/20 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Getting Started Guide`}),(0,a.jsxs)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:[`Welcome to `,r]}),(0,a.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[r,` orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,a.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,a.jsxs)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:[r,` Workflows`]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`1`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Specify your Development folder (where repositories live) and Workspaces folder. These are currently set to:`,(0,a.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`2`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Choose repositories and feature branch. `,r,` checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`]})]})]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`3`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[r,` writes files like `,(0,a.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,a.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,a.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,a.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,a.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,a.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,a.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,a.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,a.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,a.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,a.jsxs)(t,{className:`w-full gap-2`,onClick:o,children:[(0,a.jsx)(n,{size:14}),` Create a Workspace`]}),(0,a.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:s,children:[(0,a.jsx)(i,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{o as GettingStartedPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,p as t}from"./button-CREn1mup.js";import{
|
|
1
|
+
import{c as e,p as t}from"./button-CREn1mup.js";import{Gt as n,L as r,On as i,R as a,w as o}from"./badge-DwXvB44H.js";var s=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let r=this.attachedStore;if(r===null)return;let a;if(e){for(let t=this.attachedStores.length-1;t>=0&&!a;--t)a=this.attachedStores[t].context.triggerElements.getById(e);a??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!a&&this.throwOnMissingTrigger)throw Error(t(99,this.componentName,e,this.componentName));r.setOpen(!0,n(i,void 0,a))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,n(i))}};function c(){return new r({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new o,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function l(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:c(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:e,inactiveTriggerProps:e,popupProps:e}}function u(e,t,n=!1){return new r({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var d=e=>e.triggerIdProp??e.activeTriggerId,f=e=>e.openProp??e.open,p=e=>(e.popupElement?.id??e.floatingId)||void 0;function m(e,t){return t!==void 0&&f(e)&&d(e)===t}function h(e,t){return m(e,t)?!0:t!==void 0&&f(e)&&d(e)==null&&e.triggerCount===1}var g={open:f,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:d,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:p,isTriggerActive:(e,t)=>t!==void 0&&d(e)===t,isOpenedByTrigger:(e,t)=>m(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&d(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>h(e,t)?p(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},_=class extends a{setState(e){}update(e){}set(e,t){}notifyAll(){}};export{s as a,g as i,l as n,u as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,t as r}from"./button-CREn1mup.js";import{n as i,t as a}from"./badge-DwXvB44H.js";import{n as o,t as s}from"./ScaffoldRepoInline-CP0yn5mw.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-u7qgb9Hq.js";import{t as g}from"./trash-2-CMdv3eD3.js";import{c as _}from"./chunk-BV7QT456-DfUBKG-z.js";import{$ as v,A as y,G as b,P as x,V as S,_ as ee,_n as C,a as w,d as T,f as E,g as D,gn as O,h as k,i as A,m as j,n as M,ot as N,p as P,r as F,t as I,v as L,xn as te}from"./index-3tD_IeyQ.js";var R=t(e(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=_(),t=S(),n=b(),V=N(),H=y(),U=v(),W=x(),[G,K]=(0,R.useState)(null),[q,J]=(0,R.useState)(null),[Y,X]=(0,R.useState)(null),Z=(0,R.useMemo)(()=>{let e={};for(let t of V.data??[])t.projectId&&(e[t.projectId]=(e[t.projectId]??0)+1);return e},[V.data]),Q=()=>{J(null),K(B)},ne=e=>{J(null),K({editingId:e.id,name:e.name,description:e.description??``,repoPaths:e.repos.map(e=>e.path)})},re=e=>{K(t=>t&&{...t,repoPaths:t.repoPaths.includes(e.path)?t.repoPaths.filter(t=>t!==e.path):[...t.repoPaths,e.path]})},ie=async()=>{if(G){J(null);try{G.editingId?await U.mutateAsync({id:G.editingId,name:G.name,description:G.description||null,repos:G.repoPaths}):await H.mutateAsync({name:G.name,description:G.description||void 0,repos:G.repoPaths}),K(null)}catch(e){J(e instanceof Error?e.message:String(e))}}},ae=async()=>{if(Y)try{await W.mutateAsync(Y.id)}finally{X(null)}},oe=!!(G&&G.name.trim()&&G.repoPaths.length>0),$=H.isPending||U.isPending;return(0,z.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,z.jsxs)(`header`,{className:`mb-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-border/70 pb-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature workspace.`})]}),(0,z.jsxs)(r,{onClick:Q,className:`gap-1.5 shadow-sm`,children:[(0,z.jsx)(O,{size:15}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(T,{className:`size-6`})}):(t.data??[]).length===0?(0,z.jsxs)(I,{className:`border border-border border-dashed`,children:[(0,z.jsxs)(F,{children:[(0,z.jsx)(A,{variant:`icon`,children:(0,z.jsx)(te,{})}),(0,z.jsx)(w,{children:`No projects yet`}),(0,z.jsx)(M,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(O,{}),` New project`]})]}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-3`,children:(t.data??[]).map(t=>(0,z.jsx)(`li`,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-4 transition-all duration-200 hover:border-primary/40 hover:shadow-xs`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:t.name}),(Z[t.id]??0)>0&&(0,z.jsxs)(a,{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)(C,{}),` 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)(E,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(ee,{className:`max-w-lg`,children:[(0,z.jsxs)(k,{children:[(0,z.jsx)(L,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(P,{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)(i,{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)(i,{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)(j,{children:[(0,z.jsx)(r,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(r,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(T,{}):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)(T,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,o as u,p as d,t as f}from"./button-CREn1mup.js";import{$t as p,Bt as m,Gt as h,Ht as g,Kt as _,Nn as ee,Qt as te,Sn as ne,Wn as v,_t as re,c as ie,gt as ae,i as oe,l as se,n as y,o as ce,pn as le,rn as ue,s as de}from"./badge-DwXvB44H.js";import{t as fe}from"./useAriaLabelledBy-C4zV-1Ra.js";import{d as b,j as x,jt as pe,mn as S,u as me}from"./index-3tD_IeyQ.js";var C=o(`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 he(){return w.useContext(T)}function ge(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}function E(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":``}:{"data-unchecked":``}},...se}}var D=w.createContext(void 0);function _e(){return w.useContext(D)}var O=w.createContext(void 0);function k(){let e=w.useContext(O);if(e===void 0)throw Error(d(14));return e}var A=a(),ve=`data-parent`,ye=w.forwardRef(function(e,t){let{checked:a,className:o,defaultChecked:l=!1,"aria-labelledby":d,disabled:f=!1,form:m,id:g,indeterminate:v=!1,inputRef:se,name:y,onCheckedChange:b,parent:x=!1,readOnly:S=!1,render:me,required:C=!1,uncheckedValue:T,value:D,nativeButton:k=!1,style:ye,...j}=e,{clearErrors:M}=de(),{disabled:N,name:be,setDirty:xe,setFilled:P,setFocused:Se,setTouched:Ce,state:we,validationMode:Te,validityData:Ee,validation:De}=ie(),Oe=he(),{labelId:ke,controlId:Ae,registerControlId:F,getDescriptionProps:je}=ce(),I=_e(),L=I?.allValues===void 0?void 0:I.parent,R=L!==void 0,z=N||Oe.disabled||I?.disabled||f,B=be??y,V=D??B,Me=_(),Ne=_(),H=g||Ae;R&&(x?H=Ne:V===void 0?H||=Ne:H=`${L.id}-${V}`);let U={};R&&(x?U=L.getParentProps():V!==void 0&&(U=L.getChildProps(V)));let{checked:Pe=a,indeterminate:Fe=v,onCheckedChange:Ie,...Le}=U,W=I?.value,G=w.useRef(null),K=i(()=>Symbol()),q=w.useRef(!1),{getButtonProps:Re,buttonRef:ze}=te({disabled:z,native:k}),J=I?.validation??De,[Y,Be]=ne({controlled:V!==void 0&&W!==void 0&&!x?W.includes(V):Pe,default:l,name:`Checkbox`,state:`checked`}),X=R?!!Pe:Y,Z=R&&Fe||v;ue(()=>{F!==c&&(q.current=!0,F(K.current,H))},[H,F,K]),w.useEffect(()=>{let e=K.current;return()=>{!q.current||F===c||(q.current=!1,F(e,void 0))}},[F,K]),oe(G,Me,Y,void 0,!I&&!z,y);let Q=w.useRef(null),Ve=J.registerInput,He=I?V:void 0,Ue=w.useCallback(e=>Ve(e,{controlRef:G,value:He}),[Ve,He]),We=r(se,Q,x?void 0:Ue),Ge=fe(d,ke,Q,!k,H??void 0);ue(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&P(!0))},[Y,Z,P]),pe(Y,()=>{I||(M(B),P(Y),xe(Y!==Ee.initialValue),J.change(Y))});let Ke=u({checked:Y,disabled:z,form:m,name:x?void 0:B,id:k?void 0:H??void 0,required:C,ref:We,style:B?re:ae,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(S){e.preventDefault();return}let t=e.currentTarget.checked,n=h(ee,e.nativeEvent);if(b?.(t,n),!n.isCanceled&&(Ie?.(t,n),!n.isCanceled&&(Be(t),V!==void 0&&I!==void 0&&!x&&!R))){let e=t?[...I.value,V]:I.value.filter(e=>e!==V);I.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){G.current?.focus()}},D===void 0?n:{value:(I?Y&&D:D)||``},je,e=>J.getValidationProps(z,e));w.useEffect(()=>{if(!L||V===void 0)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=w.useMemo(()=>({...we,checked:X,disabled:z,readOnly:S,required:C,indeterminate:Z}),[we,X,z,S,C,Z]),qe=E($),Je=s(`span`,e,{state:$,ref:[ze,G,t],props:[{id:k?H??void 0:Me,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":S||void 0,"aria-required":C||void 0,"aria-labelledby":Ge,[ve]:x?``:void 0,onFocus(){z||Se(!0)},onBlur(){let e=Q.current;e&&(Ce(!0),Se(!1),Te===`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),le(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||ge(t)?.click()})},onClick(e){if(S||z)return;e.preventDefault();let t=Q.current;t&&p(t,e)}},j,Le,Re,je,e=>J.getValidationProps(z,e)],stateAttributesMapping:qe});return(0,A.jsxs)(O.Provider,{value:$,children:[Je,!Y&&!I&&B&&!x&&T!==void 0&&(0,A.jsx)(`input`,{type:`hidden`,form:m,name:B,value:T,disabled:z}),(0,A.jsx)(`input`,{...Ke,suppressHydrationWarning:!0})]})}),j=w.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,c=k(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:f}=g(l),p=w.useRef(null),h={...c,transitionStatus:d};m({open:l,ref:p,onComplete(){l||f(!1)}});let _={...E(c),...v},ee=a||u,te=s(`span`,e,{ref:[t,p],state:h,stateAttributesMapping:_,props:o});return ee?te:null});function M({className:e,...t}){return(0,A.jsx)(ye,{className:l(`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,A.jsx)(j,{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,A.jsx)(`span`,{...e,children:t.indeterminate?(0,A.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,A.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,A.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,A.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})})})}function N({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a,freshnessMap:o}){let[s,c]=(0,w.useState)(``),u=(0,w.useMemo)(()=>{let t=s.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,s]);return(0,A.jsxs)(`div`,{className:l(`flex flex-col gap-2`,a),children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(S,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(y,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter repositories…`,className:`pl-8`,"aria-label":`Filter repositories`})]}),(0,A.jsx)(`div`,{className:`max-h-56 overflow-y-auto rounded-lg border border-border`,children:r?(0,A.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`Scanning for repositories…`}):u.length===0?(0,A.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:i??`No repositories found.`}):(0,A.jsx)(`ul`,{className:`divide-y divide-border`,children:u.map(e=>{let r=t.includes(e.path),i=o?.[e.path];return(0,A.jsx)(`li`,{children:(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-3 py-2 hover:bg-accent`,children:[(0,A.jsx)(M,{checked:r,onCheckedChange:()=>n(e),"aria-label":e.name}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,A.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.path})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&(0,A.jsx)(me,{tone:i.status===`up-to-date`?`success`:i.status===`behind`?`warning`:i.status===`diverged`?`danger`:i.status===`ahead`?`info`:`neutral`,title:i.message,children:i.status===`behind`?`↓ ${i.behind} behind`:i.status===`up-to-date`?`Up to date`:i.status===`diverged`?`Diverged`:i.status===`ahead`?`↑ ${i.ahead} ahead`:`Local`}),(0,A.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})]})},e.path)})})})]})}function be({onCreated:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(``),[a,o]=(0,w.useState)(null),s=x(),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,A.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(y,{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,A.jsxs)(f,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,A.jsx)(b,{}):null,`Create`]}),(0,A.jsx)(f,{size:`xs`,variant:`ghost`,onClick:()=>{n(!1),o(null)},children:`Cancel`})]}),a&&(0,A.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:a})]}):(0,A.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,A.jsx)(C,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{N as n,M as r,be as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,c as n,d as r,g as i,i as a,m as o,p as s,t as c}from"./button-CREn1mup.js";import{$t as l,Gt as u,Kt as d,Nn as f,Qt as p,Sn as m,_t as ee,a as h,c as te,gt as g,i as ne,l as _,n as v,o as re,rn as ie,s as y,t as b}from"./badge-DwXvB44H.js";import{t as ae}from"./useAriaLabelledBy-C4zV-1Ra.js";import{C as x,Dn as S,Et as C,S as w,b as T,cn as E,d as D,hn as O,jt as oe,w as k,x as A}from"./index-3tD_IeyQ.js";import{t as j}from"./card-yrg6ov8B.js";import{t as M}from"./label-DC730X8s.js";import{t as N}from"./alert-QnMXzwpU.js";var P=i();function F({className:e,orientation:t=`horizontal`,...n}){return(0,P.jsx)(C,{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 I=t(e(),1),L=I.createContext(void 0);function R(){let e=I.useContext(L);if(e===void 0)throw Error(s(63));return e}var z={..._,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},B=I.forwardRef(function(e,t){let{checked:i,className:o,defaultChecked:s,"aria-labelledby":c,form:_,id:v,inputRef:b,name:x,nativeButton:S=!1,onCheckedChange:C,readOnly:w=!1,required:T=!1,disabled:E=!1,render:D,uncheckedValue:O,value:k,style:A,...j}=e,{clearErrors:M}=y(),{state:N,setTouched:F,setDirty:R,validityData:B,setFilled:V,setFocused:H,validationMode:U,disabled:se,name:ce,validation:W}=te(),{labelId:le}=re(),G=se||E,K=ce??x,q=I.useRef(null),ue=r(q,b,W.inputRef),J=I.useRef(null),Y=d(),X=h({id:v,implicit:!1,controlRef:J}),Z=S?void 0:X,[Q,de]=m({controlled:i,default:!!s,name:`Switch`,state:`checked`});ne(J,Y,Q,void 0,!G,x),ie(()=>{q.current&&V(q.current.checked)},[V]),oe(Q,()=>{M(K),R(Q!==B.initialValue),V(Q),W.change(Q)});let{getButtonProps:fe,buttonRef:pe}=p({disabled:G,native:S}),me=ae(c,le,q,!S,Z),he={id:S?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":w||void 0,"aria-required":T||void 0,"aria-labelledby":me,onFocus(){G||H(!0)},onBlur(){let e=q.current;!e||G||(F(!0),H(!1),U===`onBlur`&&W.commit(e.checked))},onClick(e){if(w||G)return;e.preventDefault();let t=q.current;t&&l(t,e)}},ge={...W.getValidationProps(G),checked:Q,disabled:G,form:_,id:Z,name:K,required:T,style:K?ee:g,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ue,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(w){e.preventDefault();return}let t=e.currentTarget.checked,n=u(f,e.nativeEvent);C?.(t,n),!n.isCanceled&&de(t)},onClick(e){e.stopPropagation()},onFocus(){J.current?.focus()},...k===void 0?n:{value:k}},$=I.useMemo(()=>({...N,checked:Q,disabled:G,readOnly:w,required:T}),[N,Q,G,w,T]),_e=a(`span`,e,{state:$,ref:[t,J,pe],props:[he,j,fe,e=>W.getValidationProps(G,e)],stateAttributesMapping:z});return(0,P.jsxs)(L.Provider,{value:$,children:[_e,!Q&&K&&O!==void 0&&(0,P.jsx)(`input`,{type:`hidden`,form:_,name:K,value:O,disabled:G}),(0,P.jsx)(`input`,{...ge,suppressHydrationWarning:!0})]})}),V=I.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,s=R();return a(`span`,e,{state:s,ref:t,stateAttributesMapping:z,props:o})});function H({className:e,...t}){return(0,P.jsx)(B,{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,P.jsx)(V,{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 U({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:l,updatingToolId:u,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,P.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,P.jsxs)(`header`,{className:`mb-6 border-b border-border/70 pb-4`,children:[(0,P.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Global Settings`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Configure your local development directories, AI search parameters, storage adapters, and editor defaults.`})]}),n===`success`&&(0,P.jsxs)(N,{variant:`success`,className:`mb-6`,children:[(0,P.jsx)(S,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,P.jsxs)(N,{variant:`error`,className:`mb-6`,children:[(0,P.jsx)(E,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,P.jsx)(j,{className:`mb-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:(0,P.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-devDir`,className:`text-sm`,children:`Development Directory`}),(0,P.jsx)(v,{type:`text`,id:`settings-devDir`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-workspacesDir`,className:`text-sm`,children:`Workspaces Directory`}),(0,P.jsx)(v,{type:`text`,id:`settings-workspacesDir`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-scanDepth`,className:`text-sm`,children:`Repo Search Depth`}),(0,P.jsx)(v,{type:`number`,min:1,max:5,id:`settings-scanDepth`,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:`Default Assistant`}),(0,P.jsxs)(T,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,P.jsx)(x,{"aria-label":`Default Assistant`,children:(0,P.jsx)(k,{children:e.defaultAssistant===`claude`?`Claude Code`:e.defaultAssistant===`antigravity`?`Antigravity`:e.defaultAssistant===`codex`?`Codex`:e.defaultAssistant===`copilot`?`GitHub Copilot`:e.defaultAssistant===`cursor`?`Cursor`:`None (Prompt me)`})}),(0,P.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,P.jsx)(A,{value:``,children:`None (Prompt me)`}),(0,P.jsx)(A,{value:`claude`,children:`Claude Code`}),(0,P.jsx)(A,{value:`antigravity`,children:`Antigravity`}),(0,P.jsx)(A,{value:`codex`,children:`Codex`}),(0,P.jsx)(A,{value:`copilot`,children:`GitHub Copilot`}),(0,P.jsx)(A,{value:`cursor`,children:`Cursor`})]})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:`Preferred Editor`}),(0,P.jsxs)(T,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,P.jsx)(x,{"aria-label":`Preferred Editor`,children:(0,P.jsx)(k,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,P.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,P.jsx)(A,{value:``,children:`No preference`}),r.map(e=>(0,P.jsxs)(A,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,P.jsx)(F,{className:`mt-1`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,P.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,P.jsxs)(T,{value:e.storageProvider||`local`,onValueChange:n=>{if(typeof n!=`string`)return;let r=n,a={...e,storageProvider:r},o=i.find(e=>e.name===r);o?.configFields?.length&&(a.adapterConfig||={},a.adapterConfig[r]||(a.adapterConfig[r]={}),o.configFields.forEach(e=>{a.adapterConfig[r][e.key]===void 0&&e.default!==void 0&&(a.adapterConfig[r][e.key]=e.default)})),t(a)},children:[(0,P.jsx)(x,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,P.jsx)(k,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,P.jsx)(w,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,P.jsx)(A,{value:e.name,children:e.displayName},e.name)):(0,P.jsx)(A,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,P.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,P.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,P.jsxs)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[r.displayName,` Settings`]}),r.configFields.map(r=>{let i=e.adapterConfig?.[n]?.[r.key]??r.default??``,a=i=>{let a={...e.adapterConfig||{},[n]:{...e.adapterConfig?.[n]||{},[r.key]:i}};t({...e,adapterConfig:a})};return r.type===`boolean`?(0,P.jsxs)(M,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,P.jsx)(H,{checked:!!i,onCheckedChange:e=>a(e)}),(0,P.jsxs)(`span`,{className:`flex flex-col`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,P.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:r.label}),(0,P.jsx)(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,P.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,P.jsxs)(j,{className:`mt-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:[(0,P.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,P.jsxs)(c,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:l,children:[l?(0,P.jsx)(D,{className:`size-3`}):(0,P.jsx)(O,{size:13}),l?`Checking...`:`Check Now`]})]}),l&&s.length===0?(0,P.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,P.jsx)(D,{className:`size-6`}),(0,P.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,P.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,P.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,P.jsx)(b,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,P.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[`Installed version: `,(0,P.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,P.jsxs)(`span`,{children:[`Latest: `,(0,P.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,P.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,P.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,P.jsx)(c,{size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(D,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(b,{variant:`success`,className:`gap-1.5`,children:[(0,P.jsx)(S,{size:12}),` Up to Date`]}),(0,P.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(D,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,P.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(D,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,P.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,P.jsxs)(c,{onClick:()=>a(e),disabled:!o,children:[(0,P.jsx)(S,{size:16}),` Save Configuration`]})})]})}export{U 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-CREn1mup.js";import{n as o,t as s}from"./badge-DwXvB44H.js";import{t as ee}from"./chevron-down-B_Mwbim8.js";import{n as c,r as te,t as l}from"./shield-check-Dd1Yv3l2.js";import{t as ne}from"./code-xml-DH-38Tt7.js";import{a as re,i as ie,n as u,r as d,t as ae}from"./square-check-big-BSIiYXPI.js";import{t as f}from"./layers-j_brOuoa.js";import{t as p}from"./trash-2-CMdv3eD3.js";import{d as oe,n as se}from"./chunk-BV7QT456-DfUBKG-z.js";import{Dn as m,F as ce,I as le,J as ue,O as de,On as h,Q as fe,Y as pe,Z as me,_ as g,a as he,d as ge,dn as _e,f as _,gn as ve,h as v,i as ye,it as be,ln as xe,m as y,mn as Se,n as Ce,o as we,on as b,ot as Te,p as x,r as Ee,t as S,un as De,ut as Oe,v as C,wn as w,xn as ke}from"./index-3tD_IeyQ.js";import{t as Ae}from"./card-yrg6ov8B.js";import{t as T}from"./label-DC730X8s.js";var je=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`}]]),Me=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`}]]),Ne=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`}]]),Pe=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`}]]),Fe=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`}]]),E=t(e(),1),D=n(),O={"git-pull-request":d,"flask-conical":ie,package:u,database:re,"shield-check":l,terminal:xe,zap:b,cpu:w,layers:f,boxes:h,code:ne},Ie=[{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 k({showToast:e}){let[t,n]=(0,E.useState)(`global`),[r,l]=(0,E.useState)(``),[ne,re]=(0,E.useState)({}),[ie,u]=(0,E.useState)(!1),[d,f]=(0,E.useState)(null),[xe,b]=(0,E.useState)(!1),[w,k]=(0,E.useState)(null),[Le,A]=(0,E.useState)(!1),[j,M]=(0,E.useState)(`edit`),[Re,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(null),[ze,I]=(0,E.useState)(!1),[L,R]=(0,E.useState)(null),[Be,Ve]=(0,E.useState)(null),[z,B]=(0,E.useState)(null),{data:V=[],isLoading:He}=me(),{data:H=[],isLoading:Ue}=fe(t===`global`?void 0:t),{data:We=[]}=Te(),{data:U,isLoading:Ge,isError:Ke}=be(t===`global`?``:t),[W,G]=(0,E.useState)(null),qe=pe(),Je=le(),K=ue(),Ye=ce(),q=de(),J=t!==`global`,Y=new Set(W??U?.enabledSkills??[]),X=!J||!Ge&&!Ke&&!!U;(0,E.useEffect)(()=>{if(!J){G(null);return}U&&G([...U.enabledSkills])},[J,t,U]);let Xe=e=>{re(t=>({...t,[e]:!t[e]}))},Z=H.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=V.reduce((e,t)=>(e[t.id]=Z.filter(e=>e.category===t.id),e),{}),Q=Z.filter(e=>!e.category||!V.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(),R({type:`category`,id:e.id,title:e.name}),I(!0)},$=(e,t)=>{k(e||{name:``,title:``,category:t||(V[0]?.id??`pull-requests`),description:``,tags:[],allowedTools:[],content:`# Skill Title
|
|
2
|
+
|
|
3
|
+
Instructions and playbook for the AI assistant.
|
|
4
|
+
`,custom:!0}),A(!!e),M(`edit`),b(!0)},tt=e=>{if(!w)return;let t={...w,title:e};!Le&&!w.id&&(t.name=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)),k(t)},nt=async()=>{if(!w||!w.name?.trim()||!w.description?.trim()||!w.content?.trim()){e?.(`Skill name, trigger description, and content are required`,`error`);return}try{await K.mutateAsync({id:w.id,name:w.name.trim(),title:w.title||w.name,category:w.category||`general`,description:w.description||``,tags:w.tags||[],allowedTools:w.allowedTools||[],content:w.content}),e?.(`Skill package saved successfully`,`success`),b(!1),k(null)}catch(t){e?.(`Failed to save skill`,`error`),console.error(t)}},rt=(e,t)=>{t.stopPropagation(),R({type:`skill`,id:e.id,title:e.title||e.name}),I(!0)},it=async()=>{if(L)try{L.type===`category`?(await Je.mutateAsync(L.id),e?.(`Category deleted`,`info`)):(await Ye.mutateAsync(L.id),e?.(`Skill package deleted`,`info`)),I(!1),R(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(!w||w.custom!==!1)return;let e=`${w.name}-copy`;k({...w,id:void 0,name:e,title:`${w.title||w.name} Copy`,allowedTools:[],custom:!0,sourcePath:void 0,references:void 0,scripts:void 0}),A(!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(!(!U||W===null||!J))try{await q.mutateAsync({workspaceId:t,expectedRevision:U.revision??0,enabledSkills:W,enabledAgents:U.enabledAgents??[],enabledCategories:V.map(e=>e.id)}),e?.(`Skill selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save skill selection`,`error`)}},lt=(e,t)=>{e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`,Ve(t)},ut=(e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,z!==t&&B(t)},dt=()=>{B(null)},ft=async(t,n)=>{t.preventDefault(),B(null);let r=t.dataTransfer.getData(`text/plain`)||Be;if(Ve(null),!r)return;let i=H.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(),F(e),N(!0)},mt=async t=>{if(!P||P.category===t){N(!1),F(null);return}await K.mutateAsync({id:P.id,name:P.name,title:P.title,description:P.description,tags:P.tags,allowedTools:P.allowedTools,content:P.content,category:t}),e?.(`Skill moved to category`,`success`),N(!1),F(null)};return(0,D.jsxs)(`div`,{className:`flex-1 flex flex-col h-full overflow-hidden bg-background text-foreground`,children:[(0,D.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,D.jsx)(`div`,{children:(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`p-2 rounded-xl bg-primary/10 text-primary`,children:(0,D.jsx)(h,{className:`h-6 w-6`})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Skill Library`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create, organize, and assign reusable Agent Skill packages.`})]})]})}),(0,D.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,D.jsx)(a,{render:(0,D.jsx)(se,{to:`/agents`}),variant:`outline`,size:`sm`,children:`Codex Agents`}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 bg-muted/50 rounded-lg px-3 py-1.5 border border-border`,children:[(0,D.jsx)(ke,{className:`h-4 w-4 text-muted-foreground`}),(0,D.jsx)(T,{htmlFor:`skill-scope`,className:`text-xs font-medium text-muted-foreground`,children:`Scope:`}),(0,D.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,D.jsx)(`option`,{value:`global`,className:`bg-popover text-popover-foreground`,children:`🌐 Global Skills Catalog`}),We.map(e=>(0,D.jsxs)(`option`,{value:e.id,className:`bg-popover text-popover-foreground`,children:[`📁 `,e.id,` (`,e.branchName,`)`]},e.id))]})]}),J&&(0,D.jsx)(a,{size:`sm`,onClick:ct,disabled:!X||q.isPending||W===null,children:q.isPending?`Saving…`:`Save selection`}),!J&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>Qe(),className:`flex items-center gap-1.5`,children:[(0,D.jsx)(ve,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`New Category`})]}),(0,D.jsxs)(a,{variant:`default`,size:`sm`,onClick:()=>$(),className:`flex items-center gap-1.5`,children:[(0,D.jsx)(_e,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`New Skill`})]})]})]})]}),(0,D.jsxs)(`div`,{className:`px-6 py-3 border-b border-border/60 bg-muted/20 flex items-center justify-between gap-4`,children:[(0,D.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,D.jsx)(Se,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,D.jsx)(o,{value:r,onChange:e=>l(e.target.value),placeholder:`Search skills by keyword, tag, or tool...`,className:`pl-9 pr-8 h-9 text-xs`}),r&&(0,D.jsx)(`button`,{onClick:()=>l(``),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,D.jsx)(oe,{className:`h-3.5 w-3.5`})})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,D.jsxs)(`span`,{children:[`Showing `,(0,D.jsx)(`strong`,{className:`text-foreground`,children:Z.length}),` of`,` `,(0,D.jsx)(`strong`,{className:`text-foreground`,children:H.length}),` skills`]}),J&&(0,D.jsxs)(s,{variant:`secondary`,className:`text-[10px] uppercase font-mono`,children:[`Workspace Mode (`,Y.size,` active)`]})]})]}),(0,D.jsx)(Oe,{className:`flex-1 p-6`,children:He||Ue||J&&Ge?(0,D.jsxs)(`div`,{className:`flex items-center justify-center p-12 gap-3 text-muted-foreground`,children:[(0,D.jsx)(ge,{}),(0,D.jsx)(`span`,{className:`text-sm`,children:`Loading skills catalog...`})]}):J&&Ke?(0,D.jsx)(S,{className:`py-12 border border-dashed rounded-xl`,children:(0,D.jsxs)(Ee,{children:[(0,D.jsx)(he,{children:`Workspace resources could not be loaded`}),(0,D.jsx)(Ce,{children:`Assignment controls are disabled so an existing selection cannot be overwritten.`})]})}):Z.length===0&&r?(0,D.jsxs)(S,{className:`py-12 border border-dashed rounded-xl`,children:[(0,D.jsx)(ye,{children:(0,D.jsx)(Se,{className:`h-8 w-8 text-muted-foreground/60`})}),(0,D.jsxs)(Ee,{children:[(0,D.jsx)(he,{children:`No matching skills found`}),(0,D.jsxs)(Ce,{children:[`No skills matched your search query "`,r,`".`]})]}),(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>l(``),children:`Clear Search`})]}):(0,D.jsxs)(`div`,{className:`space-y-6 max-w-7xl mx-auto pb-12`,children:[V.map(e=>{let t=O[e.icon||`boxes`]||h,n=Ze[e.id]||[],r=!!ne[e.id],o=z===e.id,c=n.length>0&&n.every(e=>Y.has(e.id));return(0,D.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`,o?`border-primary ring-2 ring-primary/20 bg-primary/5`:`border-border`),children:[(0,D.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,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`p-2 rounded-lg text-white shadow-sm flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,D.jsx)(t,{className:`h-4 w-4`})}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`h2`,{className:`font-semibold text-sm tracking-tight`,children:e.name}),(0,D.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,D.jsx)(s,{variant:`secondary`,className:`text-[9px] px-1 py-0 uppercase`,children:`Template`})]}),e.description&&(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description})]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[J&&n.length>0&&(0,D.jsxs)(a,{variant:`ghost`,size:`xs`,onClick:()=>st(e.id,!c),className:`h-7 text-xs mr-2 text-muted-foreground hover:text-foreground`,title:c?`Deselect all in category`:`Select all in category`,children:[c?(0,D.jsx)(ae,{className:`h-3.5 w-3.5 mr-1 text-primary`}):(0,D.jsx)(De,{className:`h-3.5 w-3.5 mr-1`}),(0,D.jsx)(`span`,{children:c?`Deselect All`:`Select All`})]}),!J&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:()=>$(void 0,e.id),title:`Add skill to this category`,children:(0,D.jsx)(ve,{className:`h-3.5 w-3.5`})}),!J&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:()=>Qe(e),title:`Edit category`,children:(0,D.jsx)(Pe,{className:`h-3 w-3`})}),!J&&e.custom&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>et(e,t),title:`Delete category`,className:`text-destructive hover:text-destructive`,children:(0,D.jsx)(p,{className:`h-3 w-3`})}),(0,D.jsx)(`div`,{className:`p-1 text-muted-foreground`,children:r?(0,D.jsx)(te,{className:`h-4 w-4`}):(0,D.jsx)(ee,{className:`h-4 w-4`})})]})]}),!r&&(0,D.jsx)(`div`,{className:`p-4 bg-background/50`,children:n.length===0?(0,D.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,D.jsxs)(D.Fragment,{children:[` `,`Drag a custom skill here, or click`,` `,(0,D.jsx)(`button`,{onClick:()=>$(void 0,e.id),className:`text-primary underline font-medium`,children:`+ Add Skill`})]})]}):(0,D.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,D.jsxs)(Ae,{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`,Be===e.id&&`opacity-40 border-dashed`),children:[(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,D.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,D.jsx)(Ne,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{className:`font-mono text-xs font-bold text-foreground`,children:e.title||e.name})]}),J?(0,D.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,D.jsx)(m,{className:i(`h-3 w-3`,!t&&`opacity-0`)}),(0,D.jsx)(`span`,{children:t?`Enabled`:`Disabled`})]}):(0,D.jsx)(s,{variant:`outline`,className:`text-[10px] font-mono`,children:e.custom?`Custom`:`Template`})]}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2 mb-3 leading-relaxed`,children:e.description||`No description provided.`})]}),(0,D.jsxs)(`div`,{className:`pt-2 border-t border-border/40 flex items-center justify-between gap-2`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap overflow-hidden`,children:[e.tags?.slice(0,2).map(e=>(0,D.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,D.jsxs)(`span`,{className:`text-[10px] text-muted-foreground flex items-center gap-0.5 font-mono`,children:[(0,D.jsx)(Fe,{className:`h-2.5 w-2.5`}),e.allowedTools.length]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[!J&&e.custom&&(0,D.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,D.jsx)(je,{className:`h-3 w-3`})}),!J&&e.custom&&(0,D.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,D.jsx)(p,{className:`h-3 w-3`})})]})]})]},e.id)})})})]},e.id)}),Q.length>0&&(0,D.jsxs)(`div`,{className:`border border-border/80 rounded-xl overflow-hidden bg-card/60`,children:[(0,D.jsx)(`div`,{className:`p-4 bg-muted/30 border-b border-border/40 flex items-center justify-between`,children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(h,{className:`h-4 w-4 text-muted-foreground`}),(0,D.jsx)(`h2`,{className:`font-semibold text-sm`,children:`Uncategorized Skills`}),(0,D.jsx)(s,{variant:`outline`,className:`text-[10px]`,children:Q.length})]})}),(0,D.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,D.jsxs)(Ae,{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,D.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,D.jsx)(`div`,{className:`font-mono text-xs font-bold`,children:e.title||e.name}),J&&(0,D.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,D.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:e.description})]},e.id))})]})]})}),(0,D.jsx)(_,{open:ie,onOpenChange:u,children:(0,D.jsxs)(g,{className:`sm:max-w-lg`,children:[(0,D.jsxs)(v,{children:[(0,D.jsx)(C,{children:d?.id?`Edit Skill Category`:`Create Skill Category`}),(0,D.jsx)(x,{children:`Categories group related procedural skills and agent tools into clean visual boxes.`})]}),(0,D.jsxs)(`div`,{className:`space-y-4 py-2`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`cat-name`,className:`text-xs font-medium`,children:`Category Name`}),(0,D.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,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`cat-desc`,className:`text-xs font-medium`,children:`Description`}),(0,D.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,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{className:`text-xs font-medium`,children:`Icon`}),(0,D.jsx)(`div`,{className:`grid grid-cols-6 gap-2 mt-1.5`,children:Object.keys(O).map(e=>{let t=O[e],n=(d?.icon||`boxes`)===e;return(0,D.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`,n?`border-primary bg-primary/10 text-primary`:`border-border hover:bg-muted text-muted-foreground`),children:(0,D.jsx)(t,{className:`h-4 w-4`})},e)})})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{className:`text-xs font-medium`,children:`Color Accent`}),(0,D.jsx)(`div`,{className:`flex items-center gap-2 mt-1.5 flex-wrap`,children:Ie.map(e=>{let t=d?.color===e.value;return(0,D.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,D.jsx)(m,{className:`h-3.5 w-3.5 text-white`})},e.value)})})]})]}),(0,D.jsxs)(y,{children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>u(!1),children:`Cancel`}),(0,D.jsx)(a,{variant:`default`,size:`sm`,onClick:$e,disabled:!d?.name?.trim(),children:`Save Category`})]})]})}),(0,D.jsx)(_,{open:xe,onOpenChange:b,children:(0,D.jsxs)(g,{className:`sm:max-w-3xl max-h-[90vh] flex flex-col`,children:[(0,D.jsx)(v,{children:(0,D.jsxs)(`div`,{className:`flex items-center justify-between pr-6`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(C,{children:w?.id?`Edit Skill Package`:`Create New Skill`}),(0,D.jsx)(x,{children:`Configure SKILL.md metadata triggers and markdown playbook instructions.`})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1 bg-muted/60 p-1 rounded-lg border border-border text-xs`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>M(`edit`),className:i(`px-2.5 py-1 rounded-md flex items-center gap-1 font-medium transition-colors`,j===`edit`?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[(0,D.jsx)(c,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`Edit`})]}),(0,D.jsxs)(`button`,{type:`button`,onClick:()=>M(`preview`),className:i(`px-2.5 py-1 rounded-md flex items-center gap-1 font-medium transition-colors`,j===`preview`?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[(0,D.jsx)(Me,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`Preview`})]})]})]})}),(0,D.jsx)(Oe,{className:`flex-1 pr-4 py-2`,children:j===`edit`?(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-title`,className:`text-xs font-medium`,children:`Display Title`}),(0,D.jsx)(o,{id:`skill-title`,value:w?.title||``,onChange:e=>tt(e.target.value),placeholder:`e.g. Pull Request Reviewer`,className:`mt-1 text-xs`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-name`,className:`text-xs font-medium`,children:`Identifier (Slug)`}),(0,D.jsx)(o,{id:`skill-name`,value:w?.name||``,disabled:!!w?.id,onChange:e=>{A(!0),k(t=>t?{...t,name:e.target.value}:null)},placeholder:`e.g. pr-review-toolkit`,className:`mt-1 text-xs font-mono`})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-cat`,className:`text-xs font-medium`,children:`Category Box`}),(0,D.jsx)(`select`,{id:`skill-cat`,value:w?.category||``,onChange:e=>k(t=>t?{...t,category:e.target.value}:null),className:`mt-1 w-full bg-background border border-border rounded-md px-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-primary`,children:V.map(e=>(0,D.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-tags`,className:`text-xs font-medium`,children:`Tags (comma separated)`}),(0,D.jsx)(o,{id:`skill-tags`,value:w?.tags?.join(`, `)||``,onChange:e=>k(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,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-desc`,className:`text-xs font-medium`,children:`Trigger Description (for AI Autonomous Discovery)`}),(0,D.jsx)(o,{id:`skill-desc`,value:w?.description||``,onChange:e=>k(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,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-content`,className:`text-xs font-medium`,children:`Playbook Instructions (Markdown)`}),(0,D.jsx)(we,{id:`skill-content`,value:w?.content||``,onChange:e=>k(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,D.jsxs)(`div`,{className:`p-4 border rounded-xl bg-card/40 prose prose-sm dark:prose-invert max-w-none`,children:[(0,D.jsxs)(`div`,{className:`mb-4 pb-3 border-b`,children:[(0,D.jsx)(`h2`,{className:`text-lg font-bold m-0`,children:w?.title||w?.name}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground m-0 mt-1`,children:w?.description})]}),(0,D.jsx)(`pre`,{className:`text-xs whitespace-pre-wrap font-sans bg-transparent p-0 border-0`,children:w?.content||`*(No playbook markdown provided)*`})]})}),(0,D.jsxs)(y,{className:`mt-4 pt-3 border-t`,children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>b(!1),children:`Cancel`}),(0,D.jsx)(a,{variant:`default`,size:`sm`,onClick:w?.custom===!1?ot:nt,disabled:!w?.name?.trim()||!w?.description?.trim()||!w?.content?.trim(),children:w?.custom===!1?`Create editable copy`:`Save Skill`})]})]})}),(0,D.jsx)(_,{open:Re,onOpenChange:N,children:(0,D.jsxs)(g,{className:`sm:max-w-md`,children:[(0,D.jsxs)(v,{children:[(0,D.jsx)(C,{children:`Move Skill to Category`}),(0,D.jsxs)(x,{children:[`Select the destination category box for "`,P?.title||P?.name,`".`]})]}),(0,D.jsx)(`div`,{className:`space-y-2 py-2`,children:V.map(e=>{let t=O[e.icon||`boxes`]||h,n=P?.category===e.id;return(0,D.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,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`p-1.5 rounded text-white flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,D.jsx)(t,{className:`h-4 w-4`})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`font-semibold text-xs`,children:e.name}),e.description&&(0,D.jsx)(`div`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),n&&(0,D.jsx)(s,{variant:`secondary`,className:`text-[10px]`,children:`Current`})]},e.id)})}),(0,D.jsx)(y,{children:(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>N(!1),children:`Cancel`})})]})}),(0,D.jsx)(_,{open:ze,onOpenChange:I,children:(0,D.jsxs)(g,{className:`sm:max-w-md`,children:[(0,D.jsxs)(v,{children:[(0,D.jsxs)(C,{className:`text-destructive`,children:[`Delete `,L?.type===`category`?`Category`:`Skill`]}),(0,D.jsxs)(x,{children:[`Are you sure you want to delete "`,L?.title,`"? This action cannot be undone.`]})]}),(0,D.jsxs)(y,{className:`mt-4`,children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>I(!1),children:`Cancel`}),(0,D.jsx)(a,{variant:`destructive`,size:`sm`,onClick:it,children:`Delete Permanently`})]})]})})]})}export{k as SkillsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-CREn1mup.js";import{n as o,t as s}from"./badge-DwXvB44H.js";import{t as c}from"./chevron-down-B_Mwbim8.js";import{t as l}from"./code-xml-DH-38Tt7.js";import{n as u,r as d,t as f}from"./ScaffoldRepoInline-CP0yn5mw.js";import{t as p}from"./git-branch-Ce0I2663.js";import{c as m,l as h,n as ee}from"./chunk-BV7QT456-DfUBKG-z.js";import{s as g}from"./brand-hHByyyzq.js";import{$t as _,C as v,Cn as y,D as te,Dn as b,E as ne,En as x,G as re,H as ie,K as ae,M as oe,On as S,Pn as se,Q as ce,Qt as C,S as le,Tn as w,V as ue,W as T,Xt as E,Yt as de,_ as D,a as fe,b as pe,c as me,ct as he,d as O,dn as ge,en as k,et as _e,f as ve,g as A,h as ye,hn as be,i as j,in as xe,k as M,kn as Se,ln as N,n as P,nn as Ce,nt as we,o as Te,on as Ee,p as F,r as De,rn as I,s as Oe,t as ke,tn as Ae,tt as je,u as Me,v as L,w as Ne,x as R,xn as Pe}from"./index-3tD_IeyQ.js";import{n as Fe,t as Ie}from"./vsc-D80c4gBT.js";var Le=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`}]]),z=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`}]]),B=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`}]]),V=t(e(),1),Re={status:`idle`,steps:[]};function ze(){let[e,t]=(0,V.useState)(Re),n=(0,V.useRef)(null),r=(0,V.useRef)(null),i=se(),a=(0,V.useCallback)(()=>{n.current?.close(),n.current=null,r.current=null},[]);return(0,V.useEffect)(()=>a,[a]),{progress:e,start:(0,V.useCallback)(e=>{if(n.current&&r.current===e)return;a(),r.current=e,t({status:`running`,steps:[]});let o=new EventSource(`/api/workspace/create-stream/${encodeURIComponent(e)}`);n.current=o;let s=0;o.addEventListener(`progress`,r=>{if(n.current===o){s=0;try{let n=JSON.parse(r.data);t({status:n.status===`completed`||n.status===`failed`?n.status:`running`,steps:n.steps??[],error:n.error,workspacePath:n.workspacePath,workspaceId:n.feature?.id??e}),(n.status===`completed`||n.status===`failed`)&&(a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]}))}catch{}}}),o.onerror=()=>{n.current===o&&(s+=1,!(o.readyState!==EventSource.CLOSED&&s<5)&&(t(e=>e.status===`running`?{...e,status:`unavailable`,error:e.error??`Unable to reconnect to the creation stream. The workspace may still have been created.`}:e),a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]})))}},[a,i]),reset:(0,V.useCallback)(()=>{a(),t(Re)},[a])}}var H=n(),Be=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ve={codex:xe,claude:de,vscode:Ie,"vscode-insiders":Fe,cursor:E,antigravity:z,powershell:N,cmd:N,terminal:N,intellij:C,webstorm:Ae,pycharm:_,sublime:k,zed:I,windsurf:Ce},U={codex:`bg-foreground text-background`,claude:`bg-[#D97757] text-white`,vscode:`bg-[#007ACC] text-white`,"vscode-insiders":`bg-[#24A148] text-white`,cursor:`bg-zinc-950 text-white dark:bg-white dark:text-zinc-950`,antigravity:`bg-violet-600 text-white`,powershell:`bg-sky-700 text-white`,cmd:`bg-zinc-800 text-amber-400`,terminal:`bg-zinc-800 text-emerald-400`,intellij:`bg-fuchsia-600 text-white`,webstorm:`bg-cyan-600 text-white`,pycharm:`bg-lime-600 text-zinc-950`,sublime:`bg-orange-500 text-white`,zed:`bg-red-600 text-white`,windsurf:`bg-teal-600 text-white`};function W({icon:e}){let t=Ve[e]??l;return(0,H.jsx)(`span`,{className:i(`grid size-10 shrink-0 place-items-center rounded-xl shadow-sm`,U[e]),"aria-hidden":`true`,children:(0,H.jsx)(t,{className:`size-5`})})}function G({target:e,busy:t,launching:n,preferred:r,onLaunch:a}){return(0,H.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,H.jsx)(W,{icon:e.icon}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`font-medium text-foreground`,children:e.name}),n?(0,H.jsx)(O,{className:`size-4`}):r?(0,H.jsx)(s,{size:`sm`,variant:`secondary`,children:`Preferred`}):null]}),(0,H.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})}function He({session:e,busy:t,launching:n,onResume:r}){let a=e.desktopHandoff.method===`direct`,o=a?`Codex Desktop`:`Claude Desktop`;return(0,H.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,H.jsx)(W,{icon:a?`codex`:`claude`}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate font-medium text-foreground`,title:e.title,children:e.title}),n?(0,H.jsx)(O,{className:`size-4 shrink-0`}):a?(0,H.jsx)(y,{className:`size-4 shrink-0 text-muted-foreground`}):(0,H.jsx)(w,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,H.jsxs)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:[a?`Open this existing task in ${o}`:`Resume in Claude Code, then type /desktop`,` · `,new Date(e.updatedAt).toLocaleString()]})]})]})}function Ue({workspaceId:e,workspacePath:t,isVsCode:n=!1,className:r}){let[i,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(null),p=(0,V.useRef)(!1),m=je(),h=we(e,i),ee=M().data?.config,_=m.data?.filter(e=>e.available)??[],v=_.filter(e=>e.kind===`ai-app`),y=ee?.defaultEditor?{code:`vscode`,"code-insiders":`vscode-insiders`,cursor:`cursor`,antigravity:`antigravity`,idea:`intellij`,webstorm:`webstorm`,charm:`pycharm`,subl:`sublime`,zed:`zed`,windsurf:`windsurf`}[ee.defaultEditor]:void 0,te=_.filter(e=>e.kind===`editor`).toSorted((e,t)=>Number(t.id===y)-Number(e.id===y)),b=new Set(_.map(e=>e.id)),ne=(h.data??[]).filter(e=>e.desktopHandoff&&b.has(e.desktopHandoff.targetId)),x=n||_.length>0,re=async t=>{if(!p.current){p.current=!0,u(null),f(null),c(t.id);try{await he(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.id})}),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await m.refetch()}finally{c(null),p.current=!1}}},ie=async t=>{if(!(p.current||!t.desktopHandoff||!Be.test(t.id))){p.current=!0,u(null),f(null),c(`session:${t.id}`);try{if(t.desktopHandoff.method===`guided`){await Oe(`claude --resume ${t.id}`),f(`Claude resume command copied. With a Claude subscription login, run it in this workspace, then type /desktop in Claude to move the session into Claude Desktop.`);return}await he(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.desktopHandoff.targetId,action:`resume`,sessionId:t.id})}),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await Promise.all([m.refetch(),h.refetch()])}finally{c(null),p.current=!1}}},ae=()=>{window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:t},`*`),o(!1)},oe=()=>Promise.all([m.refetch(),h.refetch()]),S=m.isFetching||h.isFetching;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(a,{variant:`outline`,className:r,onClick:()=>o(!0),children:[(0,H.jsx)(B,{}),`Open with…`]}),(0,H.jsx)(ve,{open:i,onOpenChange:e=>{o(e),e||(u(null),f(null))},children:(0,H.jsxs)(D,{className:`max-w-2xl`,"aria-busy":s!==null,children:[(0,H.jsxs)(ye,{children:[(0,H.jsx)(L,{children:`Open workspace with…`}),(0,H.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,H.jsxs)(A,{className:`space-y-5`,children:[l&&(0,H.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-foreground`,children:l}),d&&(0,H.jsx)(`div`,{role:`status`,className:`rounded-lg border border-primary/25 bg-primary/5 px-3 py-2 text-sm text-foreground`,children:d}),h.isLoading?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,H.jsx)(O,{className:`size-4`}),` Checking recent sessions…`]}):ne.length>0?(0,H.jsxs)(`section`,{"aria-labelledby":`recent-sessions-heading`,children:[(0,H.jsx)(`h3`,{id:`recent-sessions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Continue recent work`}),(0,H.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ne.map(e=>(0,H.jsx)(He,{session:e,busy:s!==null,launching:s===`session:${e.id}`,onResume:ie},`${e.assistant}:${e.id}`))})]}):h.isError?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent sessions could not be checked. Starting new work is still available.`}):null,n&&(0,H.jsxs)(`section`,{"aria-labelledby":`current-editor-heading`,children:[(0,H.jsx)(`h3`,{id:`current-editor-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Current window`}),(0,H.jsxs)(`button`,{type:`button`,disabled:s!==null,onClick:ae,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,H.jsx)(W,{icon:`vscode`}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`block font-medium`,children:`Current VS Code window`}),(0,H.jsxs)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:[`Open through the installed `,g,` extension.`]})]})]})]}),m.isLoading?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,H.jsx)(O,{}),` Checking apps on this computer…`]}):m.isError?(0,H.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive-foreground`,children:m.error instanceof Error?m.error.message:`Could not check available apps.`}):(0,H.jsxs)(H.Fragment,{children:[v.length>0&&(0,H.jsxs)(`section`,{"aria-labelledby":`ai-apps-heading`,children:[(0,H.jsx)(`h3`,{id:`ai-apps-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`AI coding apps`}),(0,H.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:v.map(e=>(0,H.jsx)(G,{target:e,busy:s!==null,launching:s===e.id,onLaunch:re},e.id))})]}),te.length>0&&(0,H.jsxs)(`section`,{"aria-labelledby":`editors-heading`,children:[(0,H.jsx)(`h3`,{id:`editors-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Code editors`}),(0,H.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:te.map(e=>(0,H.jsx)(G,{target:e,busy:s!==null,launching:s===e.id,preferred:e.id===y,onLaunch:re},e.id))})]}),!x&&(0,H.jsx)(ke,{className:`rounded-xl border border-dashed py-8 md:p-8`,children:(0,H.jsxs)(De,{children:[(0,H.jsx)(j,{variant:`icon`,children:(0,H.jsx)(Le,{})}),(0,H.jsx)(fe,{className:`text-base`,children:`No compatible apps detected`}),(0,H.jsx)(P,{children:`Install a supported coding app or add its command to PATH, then recheck.`})]})})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:S?`Checking recent sessions and apps…`:`Can’t find your app or session? Recheck detection.`}),(0,H.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:()=>void oe(),disabled:S||s!==null,children:[(0,H.jsx)(be,{className:S?`animate-spin`:``}),`Recheck`]})]})]})]})})]})}var We=`__ad-hoc__`,Ge=new URLSearchParams(window.location.search).get(`env`)===`vscode`,Ke=[{value:`in-place`,icon:Ee,title:`In-place`,body:`Work directly in the source repos. No branches or worktrees — fastest start.`},{value:`worktree`,icon:p,title:`Isolated worktrees`,body:`A feature branch and worktree per repo. Your source checkouts stay untouched.`}];function qe({repo:e,value:t,onChange:n,enabled:r}){let i=T(e.path,r),a=(0,V.useMemo)(()=>[...new Set([...i.data?.local??[],...i.data?.remote??[]])],[i.data]),s=`branches-${e.path.replace(/[^a-zA-Z0-9]/g,`-`)}`;return(0,H.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`w-40 shrink-0 truncate text-xs`,children:e.name}),(0,H.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,H.jsx)(`datalist`,{id:s,children:a.map(e=>(0,H.jsx)(`option`,{value:e},e))})]})}function Je({step:e}){return(0,H.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,H.jsx)(`span`,{className:i(`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,H.jsx)(b,{className:`size-3`}):e.status===`running`?(0,H.jsx)(O,{className:`size-3`}):e.status===`failed`?(0,H.jsx)(x,{className:`size-3`}):null}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,H.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.message})]})]})}function Ye(){let e=m(),[t,n]=h(),r=ue(),l=re(),g=te(),_=_e(),y=ce(),b=ne(),x=oe(),{progress:se,start:C,reset:w}=ze(),T=t.get(`job`),[E,de]=(0,V.useState)(t.get(`project`)??We),[D,fe]=(0,V.useState)(`in-place`),[k,ve]=(0,V.useState)(``),[A,ye]=(0,V.useState)(``),[j,xe]=(0,V.useState)(``),[M,N]=(0,V.useState)([]),[P,Ce]=(0,V.useState)(!1),[we,Ee]=(0,V.useState)([]),[F,De]=(0,V.useState)([]),[I,Oe]=(0,V.useState)([]),[ke,Ae]=(0,V.useState)(``),[je,L]=(0,V.useState)(``),[Fe,Ie]=(0,V.useState)(!1),[Le,z]=(0,V.useState)(null),[B,Re]=(0,V.useState)({}),[Be,Ve]=(0,V.useState)(!1),[U,W]=(0,V.useState)(null);(0,V.useEffect)(()=>{T?C(T):w()},[T,w,C]);let G=()=>{w(),n(e=>{let t=new URLSearchParams(e);return t.delete(`job`),t},{replace:!0})},He=()=>{let e=new URL(window.location.href);e.hash=`#/new`,window.location.replace(e.toString())},Ye=()=>{T&&C(T)},Xe=(0,V.useRef)(!1);(0,V.useEffect)(()=>{!Xe.current&&g.data&&(Xe.current=!0,Ee(g.data.filter(e=>e.detected).map(e=>e.name)))},[g.data]);let K=(0,V.useMemo)(()=>(r.data??[]).find(e=>e.id===E)??null,[r.data,E]),q=(0,V.useMemo)(()=>K?K.repos.map(e=>({name:me(e.path),path:e.path,defaultBranch:e.defaultBranch})):(l.data??[]).filter(e=>M.includes(e.path)),[K,l.data,M]),[Ze,Qe]=(0,V.useState)(!0),[$e,J]=(0,V.useState)(null),Y=ie(),et=(0,V.useMemo)(()=>q.map(e=>({path:e.path,branch:B[e.path]||e.defaultBranch})),[q,B]),X=ae(et,et.length>0),tt=(0,V.useMemo)(()=>{let e={};for(let t of X.data??[])e[t.repoPath]=t;return e},[X.data]),Z=(0,V.useMemo)(()=>(X.data??[]).filter(e=>e.status===`behind`),[X.data]),nt=async()=>{J(null);try{let e=(await Y.mutateAsync({repos:Z.map(e=>({path:e.repoPath,branch:e.branch}))})).results.filter(e=>e.status===`dirty`||e.status===`diverged`);e.length>0&&J(`Could not update ${e.length} repo(s): ${e.map(e=>`${e.repoName} (${e.message})`).join(`; `)}`)}catch(e){J(e instanceof Error?e.message:String(e))}},rt=async(e,t)=>{J(null);try{let n=(await Y.mutateAsync({path:e,branch:t})).results.find(e=>!e.success);n&&J(`Could not update ${n.repoName}: ${n.message}`)}catch(e){J(e instanceof Error?e.message:String(e))}},Q=D===`in-place`,it=(Q?A.trim().length>0:k.trim().length>0)&&q.length>0&&j.trim().length>0,at=e=>{Ae(e),z(null);let t=(_.data??[]).find(t=>t.id===e);L(t?.content??``)},ot=async()=>{if(!j.trim()){W(`Describe what you are building first — the suggestion is based on it.`);return}W(null),Ie(!0);try{let e=await he(`/api/workspace/suggest-workflow`,{method:`POST`,body:JSON.stringify({description:j,repos:q})});Ae(e.suggestedWorkflowId),L(e.customInstructions),z(e.difficulty)}catch(e){W(e instanceof Error?e.message:String(e))}finally{Ie(!1)}},st=(0,V.useRef)(!1),ct=async()=>{if(st.current||x.isPending||!it)return;st.current=!0,W(null);let e={mode:D,projectId:K?.id,...Q?{name:A.trim()}:{branchName:k.trim()},description:j.trim(),repos:q.map(e=>({...e,existingBranch:!Q&&B[e.path]?.trim()?B[e.path].trim():void 0})),assistants:we,enabledSkills:F.length>0?F:void 0,enabledAgents:I.length>0?I:void 0,teamworkInstructions:je.trim()||void 0,autoUpdateBase:Ze};try{let{jobId:t}=await x.mutateAsync(e);C(t),n(e=>{let n=new URLSearchParams(e);return n.set(`job`,t),n},{replace:!0})}catch(e){W(e instanceof Error?e.message:String(e))}finally{st.current=!1}},$=se.status===`idle`&&T?{status:`running`,steps:[]}:se;if($.status!==`idle`){let t=$.steps.find(e=>e.status===`failed`);return(0,H.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,H.jsx)(`h1`,{className:`text-xl font-semibold`,children:$.status===`running`?`Setting up your workspace…`:$.status===`completed`?`Workspace ready`:$.status===`failed`?`Workspace creation failed`:`Unable to reconnect to workspace setup`}),(0,H.jsx)(`ul`,{"aria-live":`polite`,"aria-relevant":`additions text`,className:`mt-6 divide-y divide-border rounded-xl border border-border bg-card px-4`,children:$.steps.length>0?$.steps.map(e=>(0,H.jsx)(Je,{step:e},e.id)):(0,H.jsxs)(`li`,{className:`flex items-center gap-3 py-3.5`,children:[(0,H.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary`,children:(0,H.jsx)(O,{className:`size-3`})}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:`Connecting to workspace setup…`}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Waiting for creation progress…`})]})]})}),($.status===`failed`||$.status===`unavailable`)&&(0,H.jsx)(`p`,{className:`mt-4 text-sm text-destructive-foreground`,children:t?.message??$.error??`Something went wrong.`}),$.status===`completed`&&$.workspacePath&&(0,H.jsx)(`p`,{className:`mt-4 truncate font-mono text-xs text-muted-foreground`,children:$.workspacePath}),U&&(0,H.jsx)(`p`,{className:`mt-2 text-sm text-destructive-foreground`,children:U}),(0,H.jsxs)(`div`,{"data-testid":`workspace-ready-actions`,className:`mt-6 flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[$.status===`completed`&&$.workspaceId&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(a,{className:`w-full min-w-0 whitespace-normal sm:w-auto`,onClick:()=>e(`/workspaces/${encodeURIComponent($.workspaceId)}`),children:`Open workspace`}),$.workspacePath&&(0,H.jsx)(Ue,{workspaceId:$.workspaceId,workspacePath:$.workspacePath,isVsCode:Ge,className:`w-full min-w-0 whitespace-normal sm:w-auto`})]}),$.status===`failed`&&(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(a,{variant:`default`,onClick:G,children:`Back to form (edit & retry)`}),(0,H.jsx)(a,{variant:`outline`,onClick:He,children:`Start over (clear form)`})]}),$.status===`unavailable`&&(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(a,{variant:`default`,onClick:Ye,children:`Try reconnecting`}),(0,H.jsx)(a,{variant:`outline`,onClick:G,children:`Back to form`})]}),$.status===`running`&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This can take a moment for large repositories.`}),(0,H.jsx)(a,{variant:`outline`,size:`sm`,onClick:G,children:`Return to form`})]})]})]})}return(0,H.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,H.jsxs)(`header`,{className:`mb-6`,children:[(0,H.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Start work`}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Pick where the work happens and how isolated it should be.`})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`Project`}),(0,H.jsxs)(pe,{value:E,onValueChange:e=>typeof e==`string`&&de(e),children:[(0,H.jsx)(v,{className:`w-full`,"aria-label":`Project`,children:(0,H.jsx)(Ne,{children:K?K.name:`Ad-hoc — pick repositories manually`})}),(0,H.jsxs)(le,{alignItemWithTrigger:!1,children:[(r.data??[]).map(e=>(0,H.jsx)(R,{value:e.id,children:e.name},e.id)),(0,H.jsx)(R,{value:We,children:`Ad-hoc — pick repositories manually`})]})]}),K?(0,H.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:K.repos.map(e=>(0,H.jsx)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.path},e.path))}):(0,H.jsxs)(`div`,{className:`mt-2`,children:[(0,H.jsx)(u,{repos:l.data??[],selectedPaths:M,onToggle:e=>N(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path]),loading:l.isLoading,freshnessMap:tt}),(0,H.jsx)(f,{onCreated:e=>N(t=>[...t,e.path])})]}),q.length>0&&(0,H.jsxs)(`div`,{className:`mt-3 rounded-lg border border-border bg-card p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,H.jsx)(p,{className:`size-3.5`}),`Base repository sync (`,q.length,`)`]}),(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:Z.length>0&&(0,H.jsxs)(a,{size:`sm`,variant:`outline`,className:`h-6 text-xs px-2`,onClick:nt,disabled:Y.isPending,children:[Y.isPending?(0,H.jsx)(O,{className:`size-3 mr-1`}):(0,H.jsx)(be,{className:`size-3 mr-1`}),`Pull `,Z.length,` stale `,Z.length===1?`repo`:`repos`]})})]}),(0,H.jsx)(`ul`,{className:`mt-2 divide-y divide-border text-xs`,children:q.map(e=>{let t=tt[e.path],n=t?.status===`behind`;return(0,H.jsxs)(`li`,{className:`flex items-center justify-between py-1.5`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 truncate pr-2`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,H.jsxs)(`span`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:[`(`,B[e.path]||e.defaultBranch,`)`]})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[X.isLoading?(0,H.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`Checking…`}):t?(0,H.jsx)(Me,{tone:t.status===`up-to-date`?`success`:t.status===`behind`?`warning`:t.status===`diverged`?`danger`:t.status===`ahead`?`info`:`neutral`,title:t.message,children:t.status===`behind`?`↓ ${t.behind} behind ${t.trackingBranch}`:t.status===`up-to-date`?`Up to date`:t.status===`diverged`?`Diverged`:t.status===`ahead`?`↑ ${t.ahead} ahead`:`Local`}):null,n&&(0,H.jsx)(a,{size:`sm`,variant:`ghost`,className:`h-5 px-1.5 text-[11px] text-amber-500 hover:text-amber-600`,onClick:()=>rt(e.path,B[e.path]||e.defaultBranch),disabled:Y.isPending,children:`Pull`})]})]},e.path)})}),$e&&(0,H.jsx)(`p`,{className:`mt-2 text-xs text-amber-500`,children:$e})]}),(r.data??[]).length===0&&!r.isLoading&&(0,H.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Tip: `,(0,H.jsx)(ee,{to:`/projects`,className:`text-primary hover:underline`,children:`register a project`}),` to skip repo picking next time.`]})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`How do you want to work?`}),(0,H.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`;fe(t),document.getElementById(`mode-${t}`)?.focus()}},children:Ke.map(e=>(0,H.jsxs)(`button`,{id:`mode-${e.value}`,type:`button`,role:`radio`,"aria-checked":D===e.value,tabIndex:D===e.value?0:-1,onClick:()=>fe(e.value),className:i(`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,H.jsx)(e.icon,{className:i(`size-4`,D===e.value?`text-primary`:`text-muted-foreground`)}),(0,H.jsx)(`p`,{className:`mt-2 text-sm font-semibold`,children:e.title}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,H.jsxs)(`section`,{children:[Q?(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Workspace name`}),(0,H.jsx)(o,{value:A,onChange:e=>ye(e.target.value),placeholder:`e.g. Fix invoice rounding`})]}):(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Feature branch`}),(0,H.jsx)(o,{value:k,onChange:e=>ve(e.target.value),placeholder:`e.g. feature/invoice-rounding`,className:`font-mono`})]}),q.length>0&&(0,H.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2`,onToggle:e=>Ve(e.target.open),children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Use an existing branch for specific repos (optional)`}),(0,H.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:q.map(e=>(0,H.jsx)(qe,{repo:e,enabled:Be,value:B[e.path]??``,onChange:t=>Re(n=>({...n,[e.path]:t}))},e.path))})]})]}),(0,H.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 cursor-pointer text-xs text-muted-foreground`,children:[(0,H.jsx)(d,{checked:Ze,onCheckedChange:e=>Qe(!!e),"aria-label":`Fast-forward clean base branches before creating workspace`}),(0,H.jsx)(`span`,{children:`Fast-forward clean base branches to latest remote commits`})]})]}),(0,H.jsx)(`section`,{children:(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`What are you building?`}),(0,H.jsx)(Te,{value:j,onChange:e=>xe(e.target.value),placeholder:`A short description — your AI assistant reads this to plan the work.`,rows:3})]})}),(0,H.jsxs)(`section`,{className:`rounded-xl border border-border`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ce(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,H.jsx)(c,{className:i(`size-4 text-muted-foreground transition-transform`,P&&`rotate-180`)})]}),P&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border p-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`AI assistants`}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:(g.data??[]).map(e=>(0,H.jsxs)(`label`,{className:i(`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,H.jsx)(d,{checked:we.includes(e.name),onCheckedChange:()=>Ee(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name])}),e.displayName]},e.name))})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:`Teamwork strategy`}),(0,H.jsxs)(a,{size:`xs`,variant:`outline`,onClick:ot,disabled:Fe,children:[Fe?(0,H.jsx)(O,{}):(0,H.jsx)(ge,{}),`Suggest with AI`]})]}),(0,H.jsxs)(pe,{value:ke,onValueChange:e=>typeof e==`string`&&at(e),children:[(0,H.jsx)(v,{className:`w-full`,"aria-label":`Teamwork strategy`,children:(0,H.jsx)(Ne,{children:(_.data??[]).find(e=>e.id===ke)?.name??`None`})}),(0,H.jsxs)(le,{alignItemWithTrigger:!1,children:[(0,H.jsx)(R,{value:``,children:`None`}),(_.data??[]).map(e=>(0,H.jsx)(R,{value:e.id,children:e.name},e.id))]})]}),Le&&(0,H.jsxs)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`AI classified this task as `,(0,H.jsx)(`span`,{className:`font-medium`,children:Le}),` difficulty.`]}),(0,H.jsx)(Te,{value:je,onChange:e=>L(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,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,H.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,H.jsx)(S,{className:`size-4 text-primary`}),`Agent Skills (`,F.length,` selected)`]}),(y.data??[]).length>0&&(0,H.jsx)(a,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>{let e=(y.data??[]).map(e=>e.id);De(F.length===e.length?[]:e)},className:`text-xs text-muted-foreground hover:text-foreground h-6 px-2`,children:F.length===(y.data??[]).length&&(y.data??[]).length>0?`Deselect All`:`Select All`})]}),(0,H.jsx)(`div`,{className:`max-h-48 overflow-y-auto rounded-lg border border-border bg-card/50 p-2 space-y-1.5`,children:y.isLoading?(0,H.jsxs)(`div`,{className:`flex items-center justify-center p-4 gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(O,{className:`size-3`}),`Loading skills...`]}):(y.data??[]).length===0?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground p-2 text-center`,children:`No skills available in catalog.`}):(y.data??[]).map(e=>{let t=F.includes(e.id);return(0,H.jsxs)(`label`,{className:i(`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,H.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,H.jsx)(d,{checked:t,onCheckedChange:()=>De(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,H.jsx)(`span`,{className:`font-mono font-medium truncate`,children:e.title||e.name})]}),(0,H.jsx)(s,{variant:`outline`,className:`text-[9px] px-1 py-0 shrink-0`,children:e.category})]},e.id)})})]}),(b.data??[]).length>0&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:(0,H.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,H.jsx)(Se,{className:`size-4 text-purple-400`}),`Codex Native Agents (`,I.length,` selected)`]})}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(b.data??[]).map(e=>{let t=I.includes(e.id);return(0,H.jsxs)(`label`,{className:i(`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,H.jsx)(d,{checked:t,onCheckedChange:()=>Oe(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,H.jsx)(`span`,{className:`font-mono`,children:e.name})]},e.id)})})]})]})]}),U&&(0,H.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:U}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border pt-4`,children:[(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(Pe,{className:`size-3.5`}),q.length,` repositor`,q.length===1?`y`:`ies`,` selected`]}),(0,H.jsxs)(a,{onClick:ct,disabled:!it||x.isPending,children:[x.isPending?(0,H.jsx)(O,{}):null,Q?`Start working`:`Create workspace`]})]})]})]})}export{Ye as StartWorkPage};
|