@mrpatronz/nexusflow 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/agent/AcpCliAdapter.d.ts +75 -0
- package/dist/agent/AcpCliAdapter.d.ts.map +1 -0
- package/dist/agent/AcpCliAdapter.js +292 -0
- package/dist/agent/AcpCliAdapter.js.map +1 -0
- package/dist/agent/AcpCliAdapter.test.d.ts +2 -0
- package/dist/agent/AcpCliAdapter.test.d.ts.map +1 -0
- package/dist/agent/AcpCliAdapter.test.js +235 -0
- package/dist/agent/AcpCliAdapter.test.js.map +1 -0
- package/dist/agent/ClaudeCliAdapter.d.ts +40 -5
- package/dist/agent/ClaudeCliAdapter.d.ts.map +1 -1
- package/dist/agent/ClaudeCliAdapter.js +212 -15
- package/dist/agent/ClaudeCliAdapter.js.map +1 -1
- package/dist/agent/ClaudeCliAdapter.test.d.ts +2 -0
- package/dist/agent/ClaudeCliAdapter.test.d.ts.map +1 -0
- package/dist/agent/ClaudeCliAdapter.test.js +320 -0
- package/dist/agent/ClaudeCliAdapter.test.js.map +1 -0
- package/dist/agent/CliAdapterBase.d.ts +29 -12
- package/dist/agent/CliAdapterBase.d.ts.map +1 -1
- package/dist/agent/CliAdapterBase.js +76 -36
- package/dist/agent/CliAdapterBase.js.map +1 -1
- package/dist/agent/CodexCliAdapter.d.ts +51 -0
- package/dist/agent/CodexCliAdapter.d.ts.map +1 -0
- package/dist/agent/CodexCliAdapter.js +226 -0
- package/dist/agent/CodexCliAdapter.js.map +1 -0
- package/dist/agent/CodexCliAdapter.test.d.ts +2 -0
- package/dist/agent/CodexCliAdapter.test.d.ts.map +1 -0
- package/dist/agent/CodexCliAdapter.test.js +316 -0
- package/dist/agent/CodexCliAdapter.test.js.map +1 -0
- package/dist/agent/CopilotAcpAdapter.d.ts +7 -0
- package/dist/agent/CopilotAcpAdapter.d.ts.map +1 -0
- package/dist/agent/CopilotAcpAdapter.js +29 -0
- package/dist/agent/CopilotAcpAdapter.js.map +1 -0
- package/dist/agent/ProviderRegistry.d.ts +39 -3
- package/dist/agent/ProviderRegistry.d.ts.map +1 -1
- package/dist/agent/ProviderRegistry.js +43 -8
- package/dist/agent/ProviderRegistry.js.map +1 -1
- package/dist/agent/ProviderRegistry.test.js +52 -0
- package/dist/agent/ProviderRegistry.test.js.map +1 -1
- package/dist/agent/adapters.d.ts +7 -5
- package/dist/agent/adapters.d.ts.map +1 -1
- package/dist/agent/adapters.js +92 -17
- package/dist/agent/adapters.js.map +1 -1
- package/dist/agent/adapters.test.js +22 -0
- package/dist/agent/adapters.test.js.map +1 -1
- package/dist/agent/cliAvailability.d.ts +51 -13
- package/dist/agent/cliAvailability.d.ts.map +1 -1
- package/dist/agent/cliAvailability.js +163 -44
- package/dist/agent/cliAvailability.js.map +1 -1
- package/dist/agent/cliAvailability.test.js +140 -53
- package/dist/agent/cliAvailability.test.js.map +1 -1
- package/dist/agent/session.d.ts +2 -1
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +15 -4
- package/dist/agent/session.js.map +1 -1
- package/dist/agent/session.test.js +29 -8
- package/dist/agent/session.test.js.map +1 -1
- package/dist/core/workspace.d.ts +6 -0
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +17 -7
- package/dist/core/workspace.js.map +1 -1
- package/dist/core/workspace.test.js +12 -1
- package/dist/core/workspace.test.js.map +1 -1
- package/dist/gui/assets/DashboardPage-CUspfCap.js +1 -0
- package/dist/gui/assets/GettingStartedPage-BqtgARZW.js +1 -0
- package/dist/gui/assets/ProjectsPage-UBoQxI2G.js +1 -0
- package/dist/gui/assets/{ScaffoldRepoInline-D-2ZeuDK.js → ScaffoldRepoInline-DqoourJe.js} +1 -1
- package/dist/gui/assets/SettingsPage-BZl24tqD.js +1 -0
- package/dist/gui/assets/StartWorkPage-BGNFdBfj.js +1 -0
- package/dist/gui/assets/{StrategiesPage-Cizm0GWk.js → StrategiesPage-D0Y6A4Tw.js} +2 -2
- package/dist/gui/assets/WorkspaceLauncher-Cxv0O_wt.js +1 -0
- package/dist/gui/assets/WorkspacesPage-Cvb1rOeh.js +6 -0
- package/dist/gui/assets/index-CllPiiFL.js +52 -0
- package/dist/gui/assets/index-DGCBhMAn.css +2 -0
- package/dist/gui/index.html +2 -2
- package/dist/server.d.ts +13 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +267 -39
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +324 -18
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/detect-editors.d.ts.map +1 -1
- package/dist/utils/detect-editors.js +6 -0
- package/dist/utils/detect-editors.js.map +1 -1
- package/dist/utils/detect-editors.test.js +12 -0
- package/dist/utils/detect-editors.test.js.map +1 -1
- package/dist/utils/session-finder.d.ts +14 -0
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +127 -10
- package/dist/utils/session-finder.js.map +1 -1
- package/dist/utils/session-finder.test.js +104 -2
- package/dist/utils/session-finder.test.js.map +1 -1
- package/dist/utils/workspace-launch.d.ts +37 -0
- package/dist/utils/workspace-launch.d.ts.map +1 -0
- package/dist/utils/workspace-launch.js +200 -0
- package/dist/utils/workspace-launch.js.map +1 -0
- package/dist/utils/workspace-launch.test.d.ts +2 -0
- package/dist/utils/workspace-launch.test.d.ts.map +1 -0
- package/dist/utils/workspace-launch.test.js +94 -0
- package/dist/utils/workspace-launch.test.js.map +1 -0
- package/package.json +5 -3
- package/dist/gui/assets/DashboardPage-HNC3-OP0.js +0 -1
- package/dist/gui/assets/GettingStartedPage-Dguoya_Z.js +0 -1
- package/dist/gui/assets/ProjectsPage-DVR4j4sw.js +0 -1
- package/dist/gui/assets/SettingsPage-Bauo77q3.js +0 -1
- package/dist/gui/assets/StartWorkPage-DvuFEa5Y.js +0 -1
- package/dist/gui/assets/WorkspacesPage-DYOVfZqy.js +0 -6
- package/dist/gui/assets/external-link-BtYhMxno.js +0 -1
- package/dist/gui/assets/index-BqeoAIB1.js +0 -52
- package/dist/gui/assets/index-CsA2SueF.css +0 -2
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-owned workspace launch catalog.
|
|
3
|
+
*
|
|
4
|
+
* The renderer selects a stable id. It never supplies an executable, URI, or
|
|
5
|
+
* filesystem path, which keeps process construction on this trusted boundary.
|
|
6
|
+
*/
|
|
7
|
+
import { execa } from 'execa';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import { isValidSessionUuid } from '../agent/session.js';
|
|
10
|
+
import { detectEditors } from './detect-editors.js';
|
|
11
|
+
import { openInEditor } from './open-editor.js';
|
|
12
|
+
const DESKTOP_PROMPT_MAX_LENGTH = 1_600;
|
|
13
|
+
const DEFAULT_WORKSPACE_PROMPT = 'Read the workspace instructions and implementation plan, inspect the repository state, then begin the task described for this workspace. Ask before making a decision that materially changes scope.';
|
|
14
|
+
function truncateWellFormed(value, maxCodeUnits) {
|
|
15
|
+
let result = '';
|
|
16
|
+
for (const character of value) {
|
|
17
|
+
const codePoint = character.codePointAt(0);
|
|
18
|
+
const safeCharacter = codePoint >= 0xD800 && codePoint <= 0xDFFF ? '\uFFFD' : character;
|
|
19
|
+
if (result.length + safeCharacter.length > maxCodeUnits)
|
|
20
|
+
break;
|
|
21
|
+
result += safeCharacter;
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
/** Build a concise, server-owned kickoff for a provider Desktop composer. */
|
|
26
|
+
export function buildWorkspaceLaunchPrompt(feature) {
|
|
27
|
+
const description = feature.description?.trim();
|
|
28
|
+
if (!description)
|
|
29
|
+
return DEFAULT_WORKSPACE_PROMPT;
|
|
30
|
+
const prefix = `${DEFAULT_WORKSPACE_PROMPT}\n\nWorkspace task: `;
|
|
31
|
+
const remaining = Math.max(0, DESKTOP_PROMPT_MAX_LENGTH - prefix.length);
|
|
32
|
+
return `${prefix}${truncateWellFormed(description, remaining)}`;
|
|
33
|
+
}
|
|
34
|
+
const DESKTOP_TARGETS = [
|
|
35
|
+
{
|
|
36
|
+
id: 'codex-desktop',
|
|
37
|
+
name: 'Codex Desktop',
|
|
38
|
+
scheme: 'codex',
|
|
39
|
+
icon: 'codex',
|
|
40
|
+
description: 'Start a new Codex chat with this folder as its workspace.',
|
|
41
|
+
macAppNames: ['Codex', 'ChatGPT'],
|
|
42
|
+
buildNewUri: (workspacePath, prompt) => `codex://threads/new?path=${encodeURIComponent(workspacePath)}`
|
|
43
|
+
+ (prompt ? `&prompt=${encodeURIComponent(prompt)}` : ''),
|
|
44
|
+
buildResumeUri: (sessionId) => `codex://threads/${encodeURIComponent(sessionId)}`,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'claude-desktop',
|
|
48
|
+
name: 'Claude Desktop',
|
|
49
|
+
scheme: 'claude',
|
|
50
|
+
icon: 'claude',
|
|
51
|
+
description: 'Open Claude Code with this folder selected (Claude asks you to confirm it).',
|
|
52
|
+
macAppNames: ['Claude'],
|
|
53
|
+
buildNewUri: (workspacePath, prompt) => `claude://code/new?folder=${encodeURIComponent(workspacePath)}`
|
|
54
|
+
+ (prompt ? `&q=${encodeURIComponent(prompt)}` : ''),
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
const EDITOR_TARGETS = [
|
|
58
|
+
{ id: 'vscode', name: 'VS Code', command: 'code', icon: 'vscode', description: 'Open the generated VS Code workspace.' },
|
|
59
|
+
{ id: 'vscode-insiders', name: 'VS Code Insiders', command: 'code-insiders', icon: 'vscode-insiders', description: 'Open the generated workspace in Insiders.' },
|
|
60
|
+
{ id: 'cursor', name: 'Cursor', command: 'cursor', icon: 'cursor', description: 'Open the generated workspace in Cursor.' },
|
|
61
|
+
{ id: 'antigravity', name: 'Antigravity', command: 'antigravity', icon: 'antigravity', description: 'Open the workspace in Antigravity.' },
|
|
62
|
+
{ id: 'intellij', name: 'IntelliJ IDEA', command: 'idea', icon: 'intellij', description: 'Open the workspace folder in IntelliJ IDEA.' },
|
|
63
|
+
{ id: 'webstorm', name: 'WebStorm', command: 'webstorm', icon: 'webstorm', description: 'Open the workspace folder in WebStorm.' },
|
|
64
|
+
{ id: 'pycharm', name: 'PyCharm', command: 'charm', icon: 'pycharm', description: 'Open the workspace folder in PyCharm.' },
|
|
65
|
+
{ id: 'sublime', name: 'Sublime Text', command: 'subl', icon: 'sublime', description: 'Open the workspace folder in Sublime Text.' },
|
|
66
|
+
{ id: 'zed', name: 'Zed', command: 'zed', icon: 'zed', description: 'Open the workspace folder in Zed.' },
|
|
67
|
+
{ id: 'windsurf', name: 'Windsurf', command: 'windsurf', icon: 'windsurf', description: 'Open the workspace folder in Windsurf.' },
|
|
68
|
+
];
|
|
69
|
+
function unavailableTarget(definition, kind, unavailableReason) {
|
|
70
|
+
return { ...definition, kind, available: false, unavailableReason };
|
|
71
|
+
}
|
|
72
|
+
async function commandSucceeds(command, args) {
|
|
73
|
+
try {
|
|
74
|
+
const result = await execa(command, args, { reject: false, shell: false });
|
|
75
|
+
return result.exitCode === 0;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Check whether the OS can activate a provider-owned desktop URI scheme. */
|
|
82
|
+
export async function hasDesktopProtocol(definition, platform = process.platform) {
|
|
83
|
+
if (platform === 'win32') {
|
|
84
|
+
const keys = [
|
|
85
|
+
`HKCU\\Software\\Classes\\${definition.scheme}`,
|
|
86
|
+
`HKCR\\${definition.scheme}`,
|
|
87
|
+
];
|
|
88
|
+
for (const key of keys) {
|
|
89
|
+
if (await commandSucceeds('reg.exe', ['query', key]))
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (platform === 'darwin') {
|
|
95
|
+
for (const appName of definition.macAppNames) {
|
|
96
|
+
if (await commandSucceeds('/usr/bin/open', ['-Ra', appName]))
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (platform === 'linux' && definition.scheme === 'claude') {
|
|
102
|
+
try {
|
|
103
|
+
const result = await execa('xdg-mime', ['query', 'default', 'x-scheme-handler/claude'], { reject: false, shell: false });
|
|
104
|
+
return result.exitCode === 0 && Boolean(result.stdout?.trim());
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
/** Return every known target so unavailable choices can be explained in the UI. */
|
|
113
|
+
export async function detectWorkspaceLaunchTargets(platform = process.platform) {
|
|
114
|
+
const [desktopAvailability, detectedEditors] = await Promise.all([
|
|
115
|
+
Promise.all(DESKTOP_TARGETS.map((target) => hasDesktopProtocol(target, platform))),
|
|
116
|
+
detectEditors(),
|
|
117
|
+
]);
|
|
118
|
+
const editorAvailability = new Map(detectedEditors.map((editor) => [editor.command, editor.detected]));
|
|
119
|
+
const desktops = DESKTOP_TARGETS.map((target, index) => {
|
|
120
|
+
const base = {
|
|
121
|
+
id: target.id,
|
|
122
|
+
name: target.name,
|
|
123
|
+
icon: target.icon,
|
|
124
|
+
description: target.description,
|
|
125
|
+
};
|
|
126
|
+
return desktopAvailability[index]
|
|
127
|
+
? { ...base, kind: 'ai-app', available: true }
|
|
128
|
+
: unavailableTarget(base, 'ai-app', platform === 'linux' && target.scheme === 'codex'
|
|
129
|
+
? 'Codex Desktop launch is currently supported on Windows and macOS.'
|
|
130
|
+
: `${target.name} is not installed or its link handler is unavailable.`);
|
|
131
|
+
});
|
|
132
|
+
const editors = EDITOR_TARGETS.map((target) => {
|
|
133
|
+
const base = {
|
|
134
|
+
id: target.id,
|
|
135
|
+
name: target.name,
|
|
136
|
+
icon: target.icon,
|
|
137
|
+
description: target.description,
|
|
138
|
+
};
|
|
139
|
+
return editorAvailability.get(target.command)
|
|
140
|
+
? { ...base, kind: 'editor', available: true }
|
|
141
|
+
: unavailableTarget(base, 'editor', `${target.name} was not detected on PATH.`);
|
|
142
|
+
});
|
|
143
|
+
return [...desktops, ...editors];
|
|
144
|
+
}
|
|
145
|
+
export async function openDesktopUri(uri, platform = process.platform) {
|
|
146
|
+
if (platform === 'win32') {
|
|
147
|
+
await execa('explorer.exe', [uri], { shell: false });
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (platform === 'darwin') {
|
|
151
|
+
await execa('/usr/bin/open', [uri], { shell: false });
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (platform === 'linux') {
|
|
155
|
+
await execa('xdg-open', [uri], { shell: false });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
throw new Error('Desktop app launching is not supported on this platform.');
|
|
159
|
+
}
|
|
160
|
+
/** Launch one closed target at a validated absolute workspace directory. */
|
|
161
|
+
export async function launchWorkspaceTarget(targetId, workspacePath, intent = { kind: 'new-workspace' }, platform = process.platform) {
|
|
162
|
+
const absolutePath = path.resolve(workspacePath);
|
|
163
|
+
if (!path.isAbsolute(workspacePath)) {
|
|
164
|
+
throw new Error('Workspace path must be an absolute directory.');
|
|
165
|
+
}
|
|
166
|
+
const desktop = DESKTOP_TARGETS.find((target) => target.id === targetId);
|
|
167
|
+
if (desktop) {
|
|
168
|
+
if (!(await hasDesktopProtocol(desktop, platform))) {
|
|
169
|
+
throw new Error(`${desktop.name} is not available on this computer.`);
|
|
170
|
+
}
|
|
171
|
+
if (intent.kind === 'resume-session') {
|
|
172
|
+
if (!desktop.buildResumeUri) {
|
|
173
|
+
throw new Error(`${desktop.name} does not support opening an existing coding session.`);
|
|
174
|
+
}
|
|
175
|
+
if (!isValidSessionUuid(intent.sessionId)) {
|
|
176
|
+
throw new Error('Invalid desktop session id.');
|
|
177
|
+
}
|
|
178
|
+
await openDesktopUri(desktop.buildResumeUri(intent.sessionId), platform);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
await openDesktopUri(desktop.buildNewUri(absolutePath, intent.prompt), platform);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const editor = EDITOR_TARGETS.find((target) => target.id === targetId);
|
|
185
|
+
if (!editor)
|
|
186
|
+
throw new Error('Unknown workspace launch target.');
|
|
187
|
+
if (intent.kind === 'resume-session') {
|
|
188
|
+
throw new Error('Editors cannot resume an AI coding session.');
|
|
189
|
+
}
|
|
190
|
+
const detected = await detectEditors();
|
|
191
|
+
if (!detected.some((candidate) => candidate.command === editor.command && candidate.detected)) {
|
|
192
|
+
throw new Error(`${editor.name} is not available on this computer.`);
|
|
193
|
+
}
|
|
194
|
+
await openInEditor(editor.command, absolutePath);
|
|
195
|
+
}
|
|
196
|
+
/** Convert a legacy editor command to its closed target id. */
|
|
197
|
+
export function launchTargetIdForEditorCommand(command) {
|
|
198
|
+
return EDITOR_TARGETS.find((target) => target.command === command)?.id ?? null;
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=workspace-launch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-launch.js","sourceRoot":"","sources":["../../src/utils/workspace-launch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAQlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAyBhD,MAAM,yBAAyB,GAAG,KAAK,CAAC;AACxC,MAAM,wBAAwB,GAC5B,sMAAsM,CAAC;AAEzM,SAAS,kBAAkB,CAAC,KAAa,EAAE,YAAoB;IAC7D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE,CAAC;QAC9B,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AM,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,aAAa,EAAE,CAAC;IACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9F,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,qCAAqC,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACnD,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,8BAA8B,CAAC,OAAe;IAC5D,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-launch.test.d.ts","sourceRoot":"","sources":["../../src/utils/workspace-launch.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { execa } from 'execa';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { buildWorkspaceLaunchPrompt, detectWorkspaceLaunchTargets, hasDesktopProtocol, launchTargetIdForEditorCommand, launchWorkspaceTarget, openDesktopUri, } from './workspace-launch.js';
|
|
5
|
+
vi.mock('execa');
|
|
6
|
+
vi.mock('./detect-editors.js', () => ({
|
|
7
|
+
detectEditors: vi.fn().mockResolvedValue([
|
|
8
|
+
{ name: 'VS Code', command: 'code', detected: true },
|
|
9
|
+
{ name: 'VS Code Insiders', command: 'code-insiders', detected: false },
|
|
10
|
+
]),
|
|
11
|
+
}));
|
|
12
|
+
vi.mock('./open-editor.js', () => ({ openInEditor: vi.fn().mockResolvedValue(undefined) }));
|
|
13
|
+
describe('workspace launch catalog', () => {
|
|
14
|
+
beforeEach(() => vi.clearAllMocks());
|
|
15
|
+
it('detects a Windows protocol association without using a shell', async () => {
|
|
16
|
+
vi.mocked(execa).mockResolvedValue({ exitCode: 0 });
|
|
17
|
+
await expect(hasDesktopProtocol({ scheme: 'codex', macAppNames: [] }, 'win32')).resolves.toBe(true);
|
|
18
|
+
expect(execa).toHaveBeenCalledWith('reg.exe', ['query', 'HKCU\\Software\\Classes\\codex'], { reject: false, shell: false });
|
|
19
|
+
});
|
|
20
|
+
it('detects and activates Claude Desktop links on Linux', async () => {
|
|
21
|
+
vi.mocked(execa).mockResolvedValue({ exitCode: 0, stdout: 'claude.desktop\n' });
|
|
22
|
+
await expect(hasDesktopProtocol({ scheme: 'claude', macAppNames: [] }, 'linux')).resolves.toBe(true);
|
|
23
|
+
expect(execa).toHaveBeenCalledWith('xdg-mime', ['query', 'default', 'x-scheme-handler/claude'], { reject: false, shell: false });
|
|
24
|
+
await openDesktopUri('claude://code/new?folder=%2Ftmp%2Fworkspace', 'linux');
|
|
25
|
+
expect(execa).toHaveBeenCalledWith('xdg-open', ['claude://code/new?folder=%2Ftmp%2Fworkspace'], { shell: false });
|
|
26
|
+
});
|
|
27
|
+
it('does not advertise Codex Desktop on Linux', async () => {
|
|
28
|
+
await expect(hasDesktopProtocol({ scheme: 'codex', macAppNames: [] }, 'linux')).resolves.toBe(false);
|
|
29
|
+
expect(execa).not.toHaveBeenCalled();
|
|
30
|
+
});
|
|
31
|
+
it('returns unavailable targets with useful reasons', async () => {
|
|
32
|
+
vi.mocked(execa).mockResolvedValue({ exitCode: 1 });
|
|
33
|
+
const targets = await detectWorkspaceLaunchTargets();
|
|
34
|
+
expect(targets.find((target) => target.id === 'codex-desktop')).toMatchObject({
|
|
35
|
+
kind: 'ai-app',
|
|
36
|
+
available: false,
|
|
37
|
+
});
|
|
38
|
+
expect(targets.find((target) => target.id === 'vscode')).toMatchObject({
|
|
39
|
+
kind: 'editor',
|
|
40
|
+
available: true,
|
|
41
|
+
});
|
|
42
|
+
expect(targets.find((target) => target.id === 'vscode-insiders')).toMatchObject({
|
|
43
|
+
available: false,
|
|
44
|
+
unavailableReason: expect.stringMatching(/not detected/i),
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it('builds a once-encoded Codex URI and activates it without a shell', async () => {
|
|
48
|
+
vi.mocked(execa).mockImplementation((async (command) => ({
|
|
49
|
+
exitCode: command === 'reg.exe' ? 0 : 0,
|
|
50
|
+
})));
|
|
51
|
+
const workspacePath = path.resolve('work spaces', 'one & two');
|
|
52
|
+
const prompt = buildWorkspaceLaunchPrompt({ description: 'Fix launch & resume' });
|
|
53
|
+
await launchWorkspaceTarget('codex-desktop', workspacePath, { kind: 'new-workspace', prompt }, 'win32');
|
|
54
|
+
expect(execa).toHaveBeenCalledWith('explorer.exe', [`codex://threads/new?path=${encodeURIComponent(workspacePath)}&prompt=${encodeURIComponent(prompt)}`], { shell: false });
|
|
55
|
+
});
|
|
56
|
+
it('builds a once-encoded Claude URI with the workspace kickoff', async () => {
|
|
57
|
+
vi.mocked(execa).mockResolvedValue({ exitCode: 0, stdout: 'claude.desktop\n' });
|
|
58
|
+
const workspacePath = path.resolve('work spaces', 'claude & nexusflow');
|
|
59
|
+
const prompt = buildWorkspaceLaunchPrompt({ description: 'Continue the integration' });
|
|
60
|
+
await launchWorkspaceTarget('claude-desktop', workspacePath, { kind: 'new-workspace', prompt }, 'linux');
|
|
61
|
+
expect(execa).toHaveBeenCalledWith('xdg-open', [`claude://code/new?folder=${encodeURIComponent(workspacePath)}&q=${encodeURIComponent(prompt)}`], { shell: false });
|
|
62
|
+
});
|
|
63
|
+
it('keeps a truncated emoji-bearing kickoff well-formed for URI encoding', () => {
|
|
64
|
+
const basePrompt = buildWorkspaceLaunchPrompt({ description: '' });
|
|
65
|
+
const marker = '\n\nWorkspace task: ';
|
|
66
|
+
const remaining = 1_600 - basePrompt.length - marker.length;
|
|
67
|
+
const description = `${'a'.repeat(remaining - 1)}😀tail`;
|
|
68
|
+
const prompt = buildWorkspaceLaunchPrompt({ description });
|
|
69
|
+
expect(prompt.length).toBeLessThanOrEqual(1_600);
|
|
70
|
+
expect(() => encodeURIComponent(prompt)).not.toThrow();
|
|
71
|
+
expect(prompt.endsWith('a')).toBe(true);
|
|
72
|
+
});
|
|
73
|
+
it('opens an existing Codex thread by its validated technical id', async () => {
|
|
74
|
+
vi.mocked(execa).mockResolvedValue({ exitCode: 0 });
|
|
75
|
+
const workspacePath = path.resolve('workspace');
|
|
76
|
+
const sessionId = '0199a213-81c0-7800-8aa1-bbab2a035a53';
|
|
77
|
+
await launchWorkspaceTarget('codex-desktop', workspacePath, { kind: 'resume-session', sessionId }, 'win32');
|
|
78
|
+
expect(execa).toHaveBeenCalledWith('explorer.exe', [`codex://threads/${sessionId}`], { shell: false });
|
|
79
|
+
});
|
|
80
|
+
it('does not claim that Claude Desktop can resume a local Code session', async () => {
|
|
81
|
+
vi.mocked(execa).mockResolvedValue({ exitCode: 0, stdout: 'claude.desktop\n' });
|
|
82
|
+
await expect(launchWorkspaceTarget('claude-desktop', path.resolve('workspace'), { kind: 'resume-session', sessionId: '0199a213-81c0-7800-8aa1-bbab2a035a53' }, 'linux')).rejects.toThrow(/does not support/i);
|
|
83
|
+
expect(execa).not.toHaveBeenCalledWith('xdg-open', expect.anything(), expect.anything());
|
|
84
|
+
});
|
|
85
|
+
it('never maps arbitrary commands to launch targets', () => {
|
|
86
|
+
expect(launchTargetIdForEditorCommand('code')).toBe('vscode');
|
|
87
|
+
expect(launchTargetIdForEditorCommand('code && calc.exe')).toBeNull();
|
|
88
|
+
});
|
|
89
|
+
it('rejects unknown targets before launching anything', async () => {
|
|
90
|
+
await expect(launchWorkspaceTarget('editor:../../calc', path.resolve('workspace'))).rejects.toThrow('Unknown workspace launch target');
|
|
91
|
+
expect(execa).not.toHaveBeenCalled();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=workspace-launch.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-launch.test.js","sourceRoot":"","sources":["../../src/utils/workspace-launch.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,kBAAkB,EAClB,8BAA8B,EAC9B,qBAAqB,EACrB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAE/B,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACjB,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC;QACvC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpD,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE;KACxE,CAAC;CACH,CAAC,CAAC,CAAC;AACJ,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AAE5F,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC;IAErC,EAAE,C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,CAClC,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrpatronz/nexusflow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Combine multiple repos into a workspace with rich AI assistant context",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"author": "",
|
|
48
48
|
"license": "MIT",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@
|
|
50
|
+
"@agentclientprotocol/sdk": "1.3.0",
|
|
51
|
+
"@anthropic-ai/sdk": "^0.116.0",
|
|
51
52
|
"@google/genai": "^2.10.0",
|
|
52
53
|
"@hono/node-server": "^2.0.8",
|
|
53
54
|
"@hono/node-ws": "^1.3.1",
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
"hono": "^4.12.27",
|
|
62
63
|
"openai": "^6.45.0",
|
|
63
64
|
"ora": "^9.4.1",
|
|
64
|
-
"pm2": "^7.0.3"
|
|
65
|
+
"pm2": "^7.0.3",
|
|
66
|
+
"zod": "^4.4.3"
|
|
65
67
|
},
|
|
66
68
|
"overrides": {
|
|
67
69
|
"@hono/node-ws": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./git-branch-Dw55pQWa.js";import{Z as r,ct as i,et as a,n as o,nt as s,r as c,rt as l,tt as u}from"./index-BqeoAIB1.js";import{n as d,t as f}from"./card-82INhRRE.js";import{a as p,i as m,n as h,r as g,t as _}from"./empty-DWyDwDYB.js";import{t as v}from"./skeleton-CCPbfn1L.js";var y=e();function b({icon:e,label:t,value:n,tone:r}){return(0,y.jsxs)(d,{className:`gap-3.5 p-4`,children:[(0,y.jsx)(`div`,{className:`grid h-9 w-9 shrink-0 place-items-center rounded-md ${r}`,children:e}),(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsx)(`div`,{className:`text-xl font-bold leading-none text-foreground`,children:n}),(0,y.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})]})}function x({workspaces:e,workspaceStatuses:x,workspacesLoading:S,statusesLoading:C,onOpenWorkspace:w,onNewWorkspace:T}){let E=Object.values(x),D=E.filter(e=>e.changedFiles>0).length,O=E.reduce((e,t)=>e+t.runningServices,0),k=E.filter(e=>e.pendingValidation).length;return(0,y.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in`,children:[(0,y.jsxs)(`header`,{className:`mb-6`,children:[(0,y.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Overview`}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Your multi-repo environment at a glance.`})]}),(0,y.jsxs)(`div`,{className:`mb-8 grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,y.jsx)(b,{icon:(0,y.jsx)(l,{size:18,className:`text-primary`}),tone:`bg-primary/10`,label:`Workspaces`,value:e.length}),(0,y.jsx)(b,{icon:(0,y.jsx)(n,{size:18,className:`text-warning`}),tone:`bg-warning/10`,label:`With uncommitted changes`,value:D}),(0,y.jsx)(b,{icon:(0,y.jsx)(s,{size:18,className:`text-running`}),tone:`bg-running/10`,label:`Running services`,value:O}),(0,y.jsx)(b,{icon:(0,y.jsx)(r,{size:18,className:`text-warning`}),tone:`bg-warning/10`,label:`Need validation`,value:k})]}),(0,y.jsx)(`div`,{className:`mb-3 flex items-center justify-between`,children:(0,y.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-muted-foreground`,children:`Workspaces`})}),S?(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(v,{className:`h-20`}),(0,y.jsx)(v,{className:`h-20`}),(0,y.jsx)(v,{className:`h-20`})]}):e.length===0?(0,y.jsx)(f,{className:`border-dashed`,children:(0,y.jsxs)(_,{children:[(0,y.jsxs)(g,{children:[(0,y.jsx)(m,{variant:`icon`,children:(0,y.jsx)(l,{})}),(0,y.jsx)(p,{children:`No workspaces yet`}),(0,y.jsx)(h,{children:`Create a feature workspace to group repositories and give your AI assistants shared context.`})]}),(0,y.jsxs)(t,{onClick:T,children:[(0,y.jsx)(u,{size:16}),` New workspace`]})]})}):(0,y.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>{let t=x[e.branchName],n=t?o(t.syncStatus):null;return(0,y.jsxs)(d,{className:`group cursor-pointer gap-4 p-4 transition-colors hover:border-foreground/15 hover:bg-accent/50`,onClick:()=>w(e.branchName),children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate font-mono text-sm font-semibold text-foreground`,children:e.branchName}),(0,y.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[e.repos.length,` repos`]})]}),e.description&&(0,y.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description})]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[!t&&C?(0,y.jsx)(v,{className:`h-5 w-40`}):t?(0,y.jsxs)(y.Fragment,{children:[t.changedFiles>0?(0,y.jsxs)(c,{tone:`warning`,dot:!0,children:[t.changedFiles,` changed`]}):(0,y.jsx)(c,{tone:`idle`,dot:!0,children:`Clean`}),t.runningServices>0&&(0,y.jsxs)(c,{tone:`running`,dot:!0,children:[t.runningServices,` running`]}),n&&(0,y.jsxs)(c,{tone:n.tone,children:[(0,y.jsx)(a,{size:11}),` `,n.label]})]}):null,(0,y.jsx)(i,{size:16,className:`text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-foreground`})]})]},e.id)})})]})}export{x as DashboardPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./circle-plus-C0PNc7h4.js";import{$ as r}from"./index-BqeoAIB1.js";var i=e();function a({config:e,onCreateWorkspace:a,onModifySettings:o}){return(0,i.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,i.jsxs)(`header`,{className:`mb-10`,children:[(0,i.jsx)(`div`,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary border border-primary/20 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Getting Started Guide`}),(0,i.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:`Welcome to NexusFlow`}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`NexusFlow orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`})]}),(0,i.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`NexusFlow Workflows`}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`1`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Specify your Development folder (where repositories live) and Workspaces folder. These are currently set to:`,(0,i.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`2`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Choose repositories and feature branch. NexusFlow checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`3`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`NexusFlow writes files like `,(0,i.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,i.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,i.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,i.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,i.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,i.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,i.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,i.jsxs)(t,{className:`w-full gap-2`,onClick:a,children:[(0,i.jsx)(n,{size:14}),` Create a Workspace`]}),(0,i.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:o,children:[(0,i.jsx)(r,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{a as GettingStartedPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-cPldH5S4.js";import{St as o,t as s}from"./spinner-DXt6mnJk.js";import{n as c,t as l}from"./ScaffoldRepoInline-D-2ZeuDK.js";import{t as u}from"./trash-2-Da8F2gKd.js";import{K as d,L as f,P as p,U as m,V as h,Y as g,_,a as v,b as y,c as b,h as x,i as S,l as C,m as w,nt as ee,o as te,p as T,rt as E,s as D,tt as O,u as k,v as A,x as j,y as M,z as N}from"./index-BqeoAIB1.js";import{a as P,i as F,n as I,r as L,t as R}from"./empty-DWyDwDYB.js";import{t as z}from"./badge-BnkhqVEF.js";var ne=r(`pencil`,[[`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`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);function B(e){return x(e,`alert-dialog`)}var V=t(e(),1),H=n(),U=B,W=_;function G({className:e,...t}){return(0,H.jsx)(j,{forceRender:!0,className:i(`fixed inset-0 z-50 bg-background/60 backdrop-blur-xs transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`,e),"data-slot":`alert-dialog-backdrop`,...t})}function K({className:e,...t}){return(0,H.jsx)(w,{className:i(`fixed inset-0 z-50 grid grid-rows-[1fr_auto_1fr] justify-items-center p-4`,e),"data-slot":`alert-dialog-viewport`,...t})}function q({className:e,bottomStickOnMobile:t=!0,...n}){return(0,H.jsxs)(W,{children:[(0,H.jsx)(G,{}),(0,H.jsx)(K,{className:i(t&&`max-sm:grid-rows-[1fr_auto] max-sm:p-0 max-sm:pt-12`),children:(0,H.jsx)(A,{className:i(`-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover not-dark:bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,t&&`max-sm:max-w-none max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden max-sm:before:rounded-none`,e),"data-slot":`alert-dialog-popup`,...n})})]})}function J({className:e,...t}){return(0,H.jsx)(`div`,{className:i(`flex flex-col gap-2 p-6 text-center max-sm:pb-4 sm:text-left`,e),"data-slot":`alert-dialog-header`,...t})}function Y({className:e,variant:t=`default`,...n}){return(0,H.jsx)(`div`,{className:i(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,t==="default"&&`border-t bg-muted/72 py-4`,t===`bare`&&`pb-6`,e),"data-slot":`alert-dialog-footer`,...n})}function X({className:e,...t}){return(0,H.jsx)(T,{className:i(`font-heading font-semibold text-xl leading-none`,e),"data-slot":`alert-dialog-title`,...t})}function Z({className:e,...t}){return(0,H.jsx)(M,{className:i(`text-muted-foreground text-sm`,e),"data-slot":`alert-dialog-description`,...t})}function re(e){return(0,H.jsx)(y,{"data-slot":`alert-dialog-close`,...e})}var ie={editingId:null,name:``,description:``,repoPaths:[]};function Q(){let e=g(),t=N(),n=h(),r=d(),i=p(),_=m(),y=f(),[x,w]=(0,V.useState)(null),[T,A]=(0,V.useState)(null),[j,M]=(0,V.useState)(null),B=(0,V.useMemo)(()=>{let e={};for(let t of r.data??[])t.projectId&&(e[t.projectId]=(e[t.projectId]??0)+1);return e},[r.data]),W=()=>{A(null),w(ie)},G=e=>{A(null),w({editingId:e.id,name:e.name,description:e.description??``,repoPaths:e.repos.map(e=>e.path)})},K=e=>{w(t=>t&&{...t,repoPaths:t.repoPaths.includes(e.path)?t.repoPaths.filter(t=>t!==e.path):[...t.repoPaths,e.path]})},Q=async()=>{if(x){A(null);try{x.editingId?await _.mutateAsync({id:x.editingId,name:x.name,description:x.description||null,repos:x.repoPaths}):await i.mutateAsync({name:x.name,description:x.description||void 0,repos:x.repoPaths}),w(null)}catch(e){A(e instanceof Error?e.message:String(e))}}},ae=async()=>{if(j)try{await y.mutateAsync(j.id)}finally{M(null)}},oe=!!(x&&x.name.trim()&&x.repoPaths.length>0),$=i.isPending||_.isPending;return(0,H.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,H.jsxs)(`header`,{className:`mb-6 flex items-center justify-between gap-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Projects`}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature.`})]}),(0,H.jsxs)(a,{onClick:W,children:[(0,H.jsx)(O,{}),` New project`]})]}),t.isLoading?(0,H.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,H.jsx)(s,{className:`size-6`})}):(t.data??[]).length===0?(0,H.jsxs)(R,{className:`border border-border border-dashed`,children:[(0,H.jsxs)(L,{children:[(0,H.jsx)(F,{variant:`icon`,children:(0,H.jsx)(E,{})}),(0,H.jsx)(P,{children:`No projects yet`}),(0,H.jsx)(I,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,H.jsxs)(a,{onClick:W,children:[(0,H.jsx)(O,{}),` New project`]})]}):(0,H.jsx)(`ul`,{className:`flex flex-col gap-3`,children:(t.data??[]).map(t=>(0,H.jsx)(`li`,{className:`rounded-xl border border-border bg-card p-4 transition-colors hover:border-foreground/15`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:t.name}),(B[t.id]??0)>0&&(0,H.jsxs)(z,{variant:`secondary`,children:[B[t.id],` workspace`,B[t.id]===1?``:`s`]})]}),t.description&&(0,H.jsx)(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:t.description}),(0,H.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:t.repos.map(e=>(0,H.jsxs)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[e.path,(0,H.jsxs)(`span`,{className:`ml-2 text-muted-foreground/60`,children:[`[`,e.defaultBranch,`]`]})]},e.path))})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,H.jsxs)(a,{size:`sm`,onClick:()=>e(`/new?project=${encodeURIComponent(t.id)}`),children:[(0,H.jsx)(ee,{}),` Start work`]}),(0,H.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Edit ${t.name}`,onClick:()=>G(t),children:(0,H.jsx)(ne,{})}),(0,H.jsx)(a,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${t.name}`,onClick:()=>M(t),children:(0,H.jsx)(u,{})})]})]})},t.id))}),(0,H.jsx)(S,{open:x!==null,onOpenChange:e=>!e&&w(null),children:(0,H.jsxs)(C,{className:`max-w-lg`,children:[(0,H.jsxs)(D,{children:[(0,H.jsx)(k,{children:x?.editingId?`Edit project`:`New project`}),(0,H.jsx)(v,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,H.jsxs)(b,{className:`space-y-4`,children:[(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Name`}),(0,H.jsx)(o,{value:x?.name??``,onChange:e=>w(t=>t&&{...t,name:e.target.value}),placeholder:`e.g. Hogia Billing`,autoFocus:!0})]}),(0,H.jsxs)(`label`,{className:`block`,children:[(0,H.jsxs)(`span`,{className:`mb-1 block text-sm font-medium`,children:[`Description `,(0,H.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional)`})]}),(0,H.jsx)(o,{value:x?.description??``,onChange:e=>w(t=>t&&{...t,description:e.target.value}),placeholder:`What this group of repos is for`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Repositories`}),(0,H.jsx)(c,{repos:n.data??[],selectedPaths:x?.repoPaths??[],onToggle:K,loading:n.isLoading,emptyHint:`No repositories found in your dev directory.`}),(0,H.jsx)(l,{onCreated:e=>w(t=>t&&{...t,repoPaths:[...t.repoPaths,e.path]})})]}),T&&(0,H.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:T})]}),(0,H.jsxs)(te,{children:[(0,H.jsx)(a,{variant:`outline`,onClick:()=>w(null),children:`Cancel`}),(0,H.jsxs)(a,{onClick:Q,disabled:!oe||$,children:[$?(0,H.jsx)(s,{}):null,x?.editingId?`Save changes`:`Create project`]})]})]})}),(0,H.jsx)(U,{open:j!==null,onOpenChange:e=>!e&&M(null),children:(0,H.jsxs)(q,{children:[(0,H.jsxs)(J,{children:[(0,H.jsxs)(X,{children:[`Remove “`,j?.name,`”?`]}),(0,H.jsx)(Z,{children:`This only removes the project from the registry — repositories and workspaces on disk are not touched.`})]}),(0,H.jsxs)(Y,{children:[(0,H.jsx)(re,{render:(0,H.jsx)(a,{variant:`outline`,children:`Cancel`})}),(0,H.jsxs)(a,{variant:`destructive`,onClick:ae,disabled:y.isPending,children:[y.isPending?(0,H.jsx)(s,{}):null,`Remove project`]})]})]})})]})}export{Q as ProjectsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,d as n,g as r,i,l as a,m as o,n as s,o as c,p as l,t as u}from"./button-cPldH5S4.js";import{$n as d,Ft as f,Ht as p,M as m,Mn as ee,S as te,St as h,Ut as ne,Vn as g,Xn as re,Zn as ie,bt as ae,er as oe,rr as se,t as _,tr as v,wt as y,xt as ce}from"./spinner-DXt6mnJk.js";import{t as le}from"./useAriaLabelledBy-CjNlctb9.js";import{t as b}from"./Separator-Chx6O62Y.js";import{C as x,D as S,E as C,T as w,Z as ue,et as T,ot as E,w as D}from"./index-BqeoAIB1.js";import{t as O}from"./card-82INhRRE.js";import{t as k}from"./badge-BnkhqVEF.js";import{t as A}from"./label-JFgMNsTn.js";var j=t(e(),1),M=r(),N=s(`relative rounded-xl border px-3.5 py-3 text-card-foreground text-sm`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&_svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 text-destructive-foreground [&_[data-slot=alert-description]]:text-destructive-foreground/80 [&_svg]:text-destructive`,info:`border-info/32 bg-info/4 [&_svg]:text-info`,success:`border-success/32 bg-success/4 [&_svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&_svg]:text-warning`}}});function P(e){let t=e.props[`data-slot`];if(t)return t;let n=e.type;switch(n.displayName??n.name){case`AlertAction`:return`alert-action`;case`AlertTitle`:return`alert-title`;case`AlertDescription`:return`alert-description`;default:return}}function F({className:e,variant:t,children:n,...r}){let i=[],a=[],s=[];return j.Children.forEach(n,e=>{if(!(0,j.isValidElement)(e)){a.push(e);return}let t=P(e);t===`alert-action`?s.push(e):t===`alert-title`||t===`alert-description`?a.push(e):i.push(e)}),(0,M.jsx)(`div`,{className:o(N({variant:t}),e),"data-slot":`alert`,role:`alert`,...r,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i.length>0&&(0,M.jsx)(`div`,{className:`flex size-4 shrink-0 items-center justify-center [&>svg]:size-full`,children:i}),a.length>0&&(0,M.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:a}),s.length>0&&(0,M.jsx)(`div`,{className:`flex shrink-0 items-center self-center`,children:s})]})})}function I({className:e,...t}){return(0,M.jsx)(`div`,{className:o(`font-medium`,e),"data-slot":`alert-title`,...t})}function L({className:e,...t}){return(0,M.jsx)(`div`,{className:o(`flex flex-col gap-2.5 text-muted-foreground`,e),"data-slot":`alert-description`,...t})}function R({className:e,...t}){return(0,M.jsx)(`div`,{className:o(`flex gap-1`,e),"data-slot":`alert-action`,...t})}I.displayName=`AlertTitle`,L.displayName=`AlertDescription`,R.displayName=`AlertAction`;function z({className:e,orientation:t=`horizontal`,...n}){return(0,M.jsx)(b,{className:o(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,e),"data-slot":`separator`,orientation:t,...n})}var B=j.createContext(void 0);function V(){let e=j.useContext(B);if(e===void 0)throw Error(n(63));return e}var H=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),U={...v,checked(e){return e?{[H.checked]:``}:{[H.unchecked]:``}}},W=j.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:o,"aria-labelledby":s,form:u,id:h,inputRef:_,name:v,nativeButton:b=!1,onCheckedChange:x,readOnly:S=!1,required:C=!1,disabled:w=!1,render:ue,uncheckedValue:T,value:E,style:D,...O}=e,{clearErrors:k}=d(),{state:A,setTouched:N,setDirty:P,validityData:F,setFilled:I,setFocused:L,validationMode:R,disabled:z,name:V,validation:H}=oe(),{labelId:W}=re(),G=z||w,K=V??v,q=j.useRef(null),de=a(q,_,H.inputRef),J=j.useRef(null),Y=ie(),X=ee({id:h,implicit:!1,controlRef:J}),Z=b?void 0:X,[Q,fe]=ne({controlled:n,default:!!o,name:`Switch`,state:`checked`});p(J,Y,Q,void 0,!G,v),se(()=>{q.current&&I(q.current.checked)},[q,I]),m(Q,()=>{k(K),P(Q!==F.initialValue),I(Q),H.change(Q)});let{getButtonProps:pe,buttonRef:me}=te({disabled:G,native:b}),he=le(s,W,q,!b,Z),ge={id:b?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":S||void 0,"aria-required":C||void 0,"aria-labelledby":he,onFocus(){G||L(!0)},onBlur(){let e=q.current;!e||G||(N(!0),L(!1),R===`onBlur`&&H.commit(e.checked))},onClick(e){if(S||G)return;e.preventDefault();let t=q.current;t&&t.dispatchEvent(new(g(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},_e=l({checked:Q,disabled:G,form:u,id:Z,name:K,required:C,style:K?ce:ae,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:de,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(S){e.preventDefault();return}let t=e.currentTarget.checked,n=y(f,e.nativeEvent);x?.(t,n),!n.isCanceled&&fe(t)},onFocus(){J.current?.focus()}},e=>H.getValidationProps(G,e),E===void 0?c:{value:E}),$=j.useMemo(()=>({...A,checked:Q,disabled:G,readOnly:S,required:C}),[A,Q,G,S,C]),ve=i(`span`,e,{state:$,ref:[t,J,me],props:[ge,O,pe,e=>H.getValidationProps(G,e)],stateAttributesMapping:U});return(0,M.jsxs)(B.Provider,{value:$,children:[ve,!Q&&K&&T!==void 0&&(0,M.jsx)(`input`,{type:`hidden`,form:u,name:K,value:T,disabled:G}),(0,M.jsx)(`input`,{..._e,suppressHydrationWarning:!0})]})}),G=j.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e;return i(`span`,e,{state:V(),ref:t,stateAttributesMapping:U,props:o})});function K({className:e,...t}){return(0,M.jsx)(W,{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,M.jsx)(G,{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 q({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:c,updatingToolId:l,fetchToolsStatus:d,handleUpdateTool:f}){if(!e)return null;let p=r.find(t=>t.command===e.defaultEditor),m=i.find(t=>t.name===(e.storageProvider||`local`));return(0,M.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,M.jsxs)(`header`,{className:`mb-6`,children:[(0,M.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Global Settings`}),(0,M.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Configure your local directories, search parameters, and editor defaults.`})]}),n===`success`&&(0,M.jsxs)(F,{variant:`success`,className:`mb-6`,children:[(0,M.jsx)(E,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,M.jsxs)(F,{variant:`error`,className:`mb-6`,children:[(0,M.jsx)(ue,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,M.jsx)(O,{className:`mb-6 rounded-xl p-6 shadow-sm`,children:(0,M.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsx)(A,{className:`text-sm`,children:`Development Directory`}),(0,M.jsx)(h,{type:`text`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsx)(A,{className:`text-sm`,children:`Workspaces Directory`}),(0,M.jsx)(h,{type:`text`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsx)(A,{className:`text-sm`,children:`Repo Search Depth`}),(0,M.jsx)(h,{type:`number`,min:1,max:5,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsx)(A,{className:`text-sm`,children:`Default Assistant`}),(0,M.jsxs)(x,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,M.jsx)(C,{"aria-label":`Default Assistant`,children:(0,M.jsx)(S,{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,M.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,M.jsx)(D,{value:``,children:`None (Prompt me)`}),(0,M.jsx)(D,{value:`claude`,children:`Claude Code`}),(0,M.jsx)(D,{value:`antigravity`,children:`Antigravity`}),(0,M.jsx)(D,{value:`codex`,children:`Codex`}),(0,M.jsx)(D,{value:`copilot`,children:`GitHub Copilot`}),(0,M.jsx)(D,{value:`cursor`,children:`Cursor`})]})]}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsx)(A,{className:`text-sm`,children:`Default Editor`}),(0,M.jsxs)(x,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,M.jsx)(C,{"aria-label":`Default Editor`,children:(0,M.jsx)(S,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`None (Skip opening)`})}),(0,M.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,M.jsx)(D,{value:``,children:`None (Skip opening)`}),r.map(e=>(0,M.jsxs)(D,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred code editor for opening workspaces.`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,M.jsx)(z,{className:`mt-1`}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,M.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,M.jsx)(A,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,M.jsxs)(x,{value:e.storageProvider||`local`,onValueChange:n=>{if(typeof n!=`string`)return;let r=n,a={...e,storageProvider:r},o=i.find(e=>e.name===r);o?.configFields?.length&&(a.adapterConfig||={},a.adapterConfig[r]||(a.adapterConfig[r]={}),o.configFields.forEach(e=>{a.adapterConfig[r][e.key]===void 0&&e.default!==void 0&&(a.adapterConfig[r][e.key]=e.default)})),t(a)},children:[(0,M.jsx)(C,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,M.jsx)(S,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,M.jsx)(w,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,M.jsx)(D,{value:e.name,children:e.displayName},e.name)):(0,M.jsx)(D,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,M.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,M.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,M.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,M.jsxs)(A,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,M.jsx)(K,{checked:!!i,onCheckedChange:e=>a(e)}),(0,M.jsxs)(`span`,{className:`flex flex-col`,children:[(0,M.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,M.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsx)(A,{className:`text-sm`,children:r.label}),(0,M.jsx)(h,{type:r.type===`number`?`number`:`text`,value:i,onChange:e=>{let t=r.type===`number`?Number(e.target.value):e.target.value;a(t)}}),r.description&&(0,M.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,M.jsxs)(O,{className:`mt-6 rounded-xl p-6 shadow-sm`,children:[(0,M.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,M.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,M.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:c,children:[c?(0,M.jsx)(_,{className:`size-3`}):(0,M.jsx)(T,{size:13}),c?`Checking...`:`Check Now`]})]}),c&&s.length===0?(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,M.jsx)(_,{className:`size-6`}),(0,M.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,M.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,M.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,M.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,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,M.jsx)(k,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,M.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,M.jsxs)(`span`,{children:[`Installed version: `,(0,M.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,M.jsxs)(`span`,{children:[`Latest: `,(0,M.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,M.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,M.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,M.jsx)(u,{size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(_,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(k,{variant:`success`,className:`gap-1.5`,children:[(0,M.jsx)(E,{size:12}),` Up to Date`]}),(0,M.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(_,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,M.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:l!==null,children:l===e.id?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(_,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,M.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,M.jsxs)(u,{onClick:()=>a(e),disabled:!o,children:[(0,M.jsx)(E,{size:16}),` Save Configuration`]})})]})}export{q as SettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-cPldH5S4.js";import{St as o,t as s}from"./spinner-DXt6mnJk.js";import{S as ee}from"./useCompositeListItem-DWGFLKqA.js";import{t as te}from"./external-link-BtYhMxno.js";import{n as ne,r as re,t as ie}from"./ScaffoldRepoInline-D-2ZeuDK.js";import{t as c}from"./git-branch-Dw55pQWa.js";import{B as l,C as u,D as d,E as f,I as ae,J as oe,M as se,N as ce,Q as le,T as p,V as ue,W as de,X as fe,Y as pe,at as m,lt as h,ot as g,q as _,rt as me,t as he,w as v,z as ge}from"./index-BqeoAIB1.js";import{t as y}from"./textarea-BLU5HXmZ.js";var b=r(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),x=t(e(),1),S={status:`idle`,steps:[]};function _e(){let[e,t]=(0,x.useState)(S),n=(0,x.useRef)(null),r=h(),i=(0,x.useCallback)(()=>{n.current?.close(),n.current=null},[]);return(0,x.useEffect)(()=>i,[i]),{progress:e,start:(0,x.useCallback)(e=>{i(),t({status:`running`,steps:[]});let a=new EventSource(`/api/workspace/create-stream/${encodeURIComponent(e)}`);n.current=a;let o=0;a.addEventListener(`progress`,n=>{o=0;try{let a=JSON.parse(n.data);t({status:a.status===`completed`||a.status===`failed`?a.status:`running`,steps:a.steps??[],error:a.error,workspacePath:a.workspacePath,workspaceId:a.feature?.id??e}),(a.status===`completed`||a.status===`failed`)&&(i(),r.invalidateQueries({queryKey:[`workspaces`]}),r.invalidateQueries({queryKey:[`workspaces-status`]}))}catch{}}),a.onerror=()=>{o+=1,!(a.readyState!==EventSource.CLOSED&&o<5)&&(t(e=>e.status===`running`?{...e,status:`failed`,error:e.error??`Lost connection to the creation stream.`}:e),i())}},[i,r]),reset:(0,x.useCallback)(()=>{i(),t(S)},[i])}}var C=n(),w=`__ad-hoc__`,T=new URLSearchParams(window.location.search).get(`env`)===`vscode`,ve=[{value:`in-place`,icon:b,title:`In-place`,body:`Work directly in the source repos. No branches or worktrees — fastest start.`},{value:`worktree`,icon:c,title:`Isolated worktrees`,body:`A feature branch and worktree per repo. Your source checkouts stay untouched.`}];function ye({repo:e,value:t,onChange:n,enabled:r}){let i=l(e.path,r),a=(0,x.useMemo)(()=>[...new Set([...i.data?.local??[],...i.data?.remote??[]])],[i.data]),s=`branches-${e.path.replace(/[^a-zA-Z0-9]/g,`-`)}`;return(0,C.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`w-40 shrink-0 truncate text-xs`,children:e.name}),(0,C.jsx)(o,{list:s,value:t,onChange:e=>n(e.target.value),placeholder:`existing branch (must exist)`,className:`h-7 font-mono text-xs`}),(0,C.jsx)(`datalist`,{id:s,children:a.map(e=>(0,C.jsx)(`option`,{value:e},e))})]})}function be({step:e}){return(0,C.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,C.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,C.jsx)(g,{className:`size-3`}):e.status===`running`?(0,C.jsx)(s,{className:`size-3`}):e.status===`failed`?(0,C.jsx)(m,{className:`size-3`}):null}),(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,C.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.message})]})]})}function E(){let e=pe(),[t]=fe(),n=ge(),r=ue(),c=se(),l=de(),m=ce().data?.config,h=ae(),{progress:g,start:b}=_e(),[S,E]=(0,x.useState)(t.get(`project`)??w),[D,O]=(0,x.useState)(`in-place`),[k,xe]=(0,x.useState)(``),[A,Se]=(0,x.useState)(``),[j,Ce]=(0,x.useState)(``),[M,N]=(0,x.useState)([]),[P,we]=(0,x.useState)(!1),[F,I]=(0,x.useState)([]),[L,R]=(0,x.useState)(``),[z,B]=(0,x.useState)(``),[V,H]=(0,x.useState)(!1),[U,W]=(0,x.useState)(null),[G,Te]=(0,x.useState)({}),[Ee,De]=(0,x.useState)(!1),[K,q]=(0,x.useState)(null),[J,Y]=(0,x.useState)(!1),Oe=(0,x.useRef)(!1);(0,x.useEffect)(()=>{!Oe.current&&c.data&&(Oe.current=!0,I(c.data.filter(e=>e.detected).map(e=>e.name)))},[c.data]);let X=(0,x.useMemo)(()=>(n.data??[]).find(e=>e.id===S)??null,[n.data,S]),Z=(0,x.useMemo)(()=>X?X.repos.map(e=>({name:he(e.path),path:e.path,defaultBranch:e.defaultBranch})):(r.data??[]).filter(e=>M.includes(e.path)),[X,r.data,M]),Q=D===`in-place`,ke=(Q?A.trim().length>0:k.trim().length>0)&&Z.length>0&&j.trim().length>0,Ae=e=>{R(e),W(null);let t=(l.data??[]).find(t=>t.id===e);B(t?.content??``)},je=async()=>{if(!j.trim()){q(`Describe what you are building first — the suggestion is based on it.`);return}q(null),H(!0);try{let e=await _(`/api/workspace/suggest-workflow`,{method:`POST`,body:JSON.stringify({description:j,repos:Z})});R(e.suggestedWorkflowId),B(e.customInstructions),W(e.difficulty)}catch(e){q(e instanceof Error?e.message:String(e))}finally{H(!1)}},Me=async()=>{q(null);let e={mode:D,projectId:X?.id,...Q?{name:A.trim()}:{branchName:k.trim()},description:j.trim(),repos:Z.map(e=>({...e,existingBranch:!Q&&G[e.path]?.trim()?G[e.path].trim():void 0})),assistants:F,teamworkInstructions:z.trim()||void 0};try{let{jobId:t}=await h.mutateAsync(e);b(t)}catch(e){q(e instanceof Error?e.message:String(e))}},$=m?.defaultEditor&&m.defaultEditor!==`none`?m.defaultEditor:null,Ne=async()=>{if(g.workspacePath){if(T){window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:g.workspacePath},`*`);return}if($){Y(!0);try{await _(`/api/open-editor`,{method:`POST`,body:JSON.stringify({workspacePath:g.workspacePath,command:$})})}catch(e){q(e instanceof Error?e.message:String(e))}finally{Y(!1)}}}};if(g.status!==`idle`){let t=g.steps.find(e=>e.status===`failed`),n=T||!!$;return(0,C.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,C.jsx)(`h1`,{className:`text-xl font-semibold`,children:g.status===`running`?`Setting up your workspace…`:g.status===`completed`?`Workspace ready`:`Workspace creation failed`}),(0,C.jsx)(`ul`,{className:`mt-6 divide-y divide-border rounded-xl border border-border bg-card px-4`,children:g.steps.map(e=>(0,C.jsx)(be,{step:e},e.id))}),g.status===`failed`&&(0,C.jsx)(`p`,{className:`mt-4 text-sm text-destructive-foreground`,children:t?.message??g.error??`Something went wrong.`}),g.status===`completed`&&g.workspacePath&&(0,C.jsx)(`p`,{className:`mt-4 truncate font-mono text-xs text-muted-foreground`,children:g.workspacePath}),K&&(0,C.jsx)(`p`,{className:`mt-2 text-sm text-destructive-foreground`,children:K}),(0,C.jsxs)(`div`,{className:`mt-6 flex gap-2`,children:[g.status===`completed`&&g.workspaceId&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(a,{onClick:()=>e(`/workspaces/${encodeURIComponent(g.workspaceId)}`),children:`Open workspace`}),n&&(0,C.jsxs)(a,{variant:`outline`,onClick:Ne,disabled:J,children:[J?(0,C.jsx)(s,{}):(0,C.jsx)(te,{}),`Open in editor`]})]}),g.status===`failed`&&(0,C.jsx)(a,{variant:`outline`,onClick:()=>window.location.reload(),children:`Start over`}),g.status===`running`&&(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This can take a moment for large repositories.`})]})]})}return(0,C.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,C.jsxs)(`header`,{className:`mb-6`,children:[(0,C.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Start work`}),(0,C.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Pick where the work happens and how isolated it should be.`})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`Project`}),(0,C.jsxs)(u,{value:S,onValueChange:e=>typeof e==`string`&&E(e),children:[(0,C.jsx)(f,{className:`w-full`,"aria-label":`Project`,children:(0,C.jsx)(d,{children:X?X.name:`Ad-hoc — pick repositories manually`})}),(0,C.jsxs)(p,{alignItemWithTrigger:!1,children:[(n.data??[]).map(e=>(0,C.jsx)(v,{value:e.id,children:e.name},e.id)),(0,C.jsx)(v,{value:w,children:`Ad-hoc — pick repositories manually`})]})]}),X?(0,C.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:X.repos.map(e=>(0,C.jsx)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.path},e.path))}):(0,C.jsxs)(`div`,{className:`mt-2`,children:[(0,C.jsx)(ne,{repos:r.data??[],selectedPaths:M,onToggle:e=>N(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path]),loading:r.isLoading}),(0,C.jsx)(ie,{onCreated:e=>N(t=>[...t,e.path])})]}),(n.data??[]).length===0&&!n.isLoading&&(0,C.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Tip: `,(0,C.jsx)(oe,{to:`/projects`,className:`text-primary hover:underline`,children:`register a project`}),` to skip repo picking next time.`]})]}),(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`How do you want to work?`}),(0,C.jsx)(`div`,{role:`radiogroup`,"aria-label":`Work mode`,className:`grid gap-3 sm:grid-cols-2`,onKeyDown:e=>{if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(e.key)){e.preventDefault();let t=D===`in-place`?`worktree`:`in-place`;O(t),document.getElementById(`mode-${t}`)?.focus()}},children:ve.map(e=>(0,C.jsxs)(`button`,{id:`mode-${e.value}`,type:`button`,role:`radio`,"aria-checked":D===e.value,tabIndex:D===e.value?0:-1,onClick:()=>O(e.value),className: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,C.jsx)(e.icon,{className:i(`size-4`,D===e.value?`text-primary`:`text-muted-foreground`)}),(0,C.jsx)(`p`,{className:`mt-2 text-sm font-semibold`,children:e.title}),(0,C.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,C.jsx)(`section`,{children:Q?(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Workspace name`}),(0,C.jsx)(o,{value:A,onChange:e=>Se(e.target.value),placeholder:`e.g. Fix invoice rounding`})]}):(0,C.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Feature branch`}),(0,C.jsx)(o,{value:k,onChange:e=>xe(e.target.value),placeholder:`e.g. feature/invoice-rounding`,className:`font-mono`})]}),Z.length>0&&(0,C.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2`,onToggle:e=>De(e.target.open),children:[(0,C.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Use an existing branch for specific repos (optional)`}),(0,C.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:Z.map(e=>(0,C.jsx)(ye,{repo:e,enabled:Ee,value:G[e.path]??``,onChange:t=>Te(n=>({...n,[e.path]:t}))},e.path))})]})]})}),(0,C.jsx)(`section`,{children:(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`What are you building?`}),(0,C.jsx)(y,{value:j,onChange:e=>Ce(e.target.value),placeholder:`A short description — your AI assistant reads this to plan the work.`,rows:3})]})}),(0,C.jsxs)(`section`,{className:`rounded-xl border border-border`,children:[(0,C.jsxs)(`button`,{type:`button`,onClick:()=>we(e=>!e),className:`flex w-full items-center justify-between px-4 py-3 text-sm font-medium hover:bg-accent`,"aria-expanded":P,children:[`Advanced`,(0,C.jsx)(ee,{className:i(`size-4 text-muted-foreground transition-transform`,P&&`rotate-180`)})]}),P&&(0,C.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border p-4`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`AI assistants`}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:(c.data??[]).map(e=>(0,C.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,C.jsx)(re,{checked:F.includes(e.name),onCheckedChange:()=>I(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name])}),e.displayName]},e.name))})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,C.jsx)(`span`,{className:`text-sm font-medium`,children:`Teamwork strategy`}),(0,C.jsxs)(a,{size:`xs`,variant:`outline`,onClick:je,disabled:V,children:[V?(0,C.jsx)(s,{}):(0,C.jsx)(le,{}),`Suggest with AI`]})]}),(0,C.jsxs)(u,{value:L,onValueChange:e=>typeof e==`string`&&Ae(e),children:[(0,C.jsx)(f,{className:`w-full`,"aria-label":`Teamwork strategy`,children:(0,C.jsx)(d,{children:(l.data??[]).find(e=>e.id===L)?.name??`None`})}),(0,C.jsxs)(p,{alignItemWithTrigger:!1,children:[(0,C.jsx)(v,{value:``,children:`None`}),(l.data??[]).map(e=>(0,C.jsx)(v,{value:e.id,children:e.name},e.id))]})]}),U&&(0,C.jsxs)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`AI classified this task as `,(0,C.jsx)(`span`,{className:`font-medium`,children:U}),` difficulty.`]}),(0,C.jsx)(y,{value:z,onChange:e=>B(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`})]})]})]}),K&&(0,C.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:K}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border pt-4`,children:[(0,C.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,C.jsx)(me,{className:`size-3.5`}),Z.length,` repositor`,Z.length===1?`y`:`ies`,` selected`]}),(0,C.jsxs)(a,{onClick:Me,disabled:!ke||h.isPending,children:[h.isPending?(0,C.jsx)(s,{}):null,Q?`Start working`:`Create workspace`]})]})]})]})}export{E as StartWorkPage};
|