@mrpatronz/nexusflow 2.5.1 → 2.5.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/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +13 -1
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/schedule.d.ts +3 -1
- package/dist/commands/schedule.d.ts.map +1 -1
- package/dist/commands/schedule.js +12 -5
- package/dist/commands/schedule.js.map +1 -1
- package/dist/commands/status.d.ts +4 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +9 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/ui.d.ts +8 -0
- package/dist/commands/ui.d.ts.map +1 -1
- package/dist/commands/ui.js +41 -0
- package/dist/commands/ui.js.map +1 -1
- package/dist/core/worktree.test.js +2 -2
- package/dist/desktop-server.d.ts +1 -1
- package/dist/desktop-server.js +1 -1
- package/dist/gui/assets/{AgentsPage-gHbRof2y.js → AgentsPage-CGvhYtRS.js} +1 -1
- package/dist/gui/assets/{DashboardPage-CkXIpoFX.js → DashboardPage-BSVVVXuM.js} +1 -1
- package/dist/gui/assets/{GettingStartedPage-DRL_nbb6.js → GettingStartedPage-srl_5DA_.js} +1 -1
- package/dist/gui/assets/{ProjectsPage-C8XQ9dRr.js → ProjectsPage-BfFX3Rg1.js} +1 -1
- package/dist/gui/assets/{ScaffoldRepoInline-ys4l8ho4.js → ScaffoldRepoInline-DWsd4vxF.js} +1 -1
- package/dist/gui/assets/{SettingsPage-CRVDsRwi.js → SettingsPage-C16CjqlK.js} +1 -1
- package/dist/gui/assets/{SkillsPage-BfQu6PT3.js → SkillsPage-DKLoq_sH.js} +1 -1
- package/dist/gui/assets/{StartWorkPage-BNzeMcFc.js → StartWorkPage-D56-WIZp.js} +1 -1
- package/dist/gui/assets/{StrategiesPage-Bh6x7zhl.js → StrategiesPage-CY8xp7Lz.js} +1 -1
- package/dist/gui/assets/{WorkspacesPage-DYQt7CQ8.js → WorkspacesPage-CXtIMMUl.js} +1 -1
- package/dist/gui/assets/{alert-dialog-D7jNzvYQ.js → alert-dialog-CCwlEjU2.js} +1 -1
- package/dist/gui/assets/{index-C6qbn9Zq.js → index-pxzwuRLq.js} +2 -2
- package/dist/gui/assets/{vsc-CvlJSs-5.js → vsc-DkRhgYbO.js} +1 -1
- package/dist/gui/index.html +1 -1
- package/dist/index.js +17 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/commands/diff.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,UAAU,WAAW;IACnB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,UAAU,WAAW;IACnB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA0E7F"}
|
package/dist/commands/diff.js
CHANGED
|
@@ -14,12 +14,15 @@ import { resolveWorkspaceInteractive } from '../utils/resolve-workspace.js';
|
|
|
14
14
|
* @param options - Optional flags.
|
|
15
15
|
*/
|
|
16
16
|
export async function diffCommand(workspaceArg, options) {
|
|
17
|
-
console.log(chalk.bold.cyan('\n🔍 NexusFlow — Workspace Diff Summary\n'));
|
|
18
17
|
const workspacePath = await resolveWorkspaceInteractive(workspaceArg, 'Select a workspace to view diff:');
|
|
19
18
|
if (!workspacePath)
|
|
20
19
|
return;
|
|
21
20
|
const feature = await loadFeatureConfig(workspacePath);
|
|
22
21
|
if (!feature) {
|
|
22
|
+
if (options?.json) {
|
|
23
|
+
console.log(JSON.stringify({ error: 'Failed to load workspace configuration' }));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
23
26
|
console.error(chalk.red('✖ Failed to load workspace configuration.'));
|
|
24
27
|
return;
|
|
25
28
|
}
|
|
@@ -28,9 +31,18 @@ export async function diffCommand(workspaceArg, options) {
|
|
|
28
31
|
results = await getWorkspaceDiffReport(workspacePath, options?.repo);
|
|
29
32
|
}
|
|
30
33
|
catch (error) {
|
|
34
|
+
if (options?.json) {
|
|
35
|
+
console.log(JSON.stringify({ error: error instanceof Error ? error.message : String(error) }));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
31
38
|
console.error(chalk.red(`✖ ${error instanceof Error ? error.message : String(error)}`));
|
|
32
39
|
return;
|
|
33
40
|
}
|
|
41
|
+
if (options?.json) {
|
|
42
|
+
console.log(JSON.stringify(results, null, 2));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
console.log(chalk.bold.cyan('\n🔍 NexusFlow — Workspace Diff Summary\n'));
|
|
34
46
|
if (results.length === 0) {
|
|
35
47
|
console.log(chalk.green('✅ All repositories are clean and pushed.\n'));
|
|
36
48
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA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AAG,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9E,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,QAAQ,UAAU,GAAG,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,8DAA8D,CAAC,CAAC,CAAC;QACtJ,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -19,7 +19,9 @@ export declare function scheduleAddCommand(workspaceArg: string | undefined, opt
|
|
|
19
19
|
/**
|
|
20
20
|
* Lists all scheduled jobs with their status and next due time.
|
|
21
21
|
*/
|
|
22
|
-
export declare function scheduleListCommand(
|
|
22
|
+
export declare function scheduleListCommand(options?: {
|
|
23
|
+
json?: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
23
25
|
/**
|
|
24
26
|
* Removes a scheduled job by id.
|
|
25
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/commands/schedule.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsBH;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/commands/schedule.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsBH;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8CrF;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOrE;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBlE"}
|
|
@@ -13,7 +13,7 @@ import * as fs from 'node:fs/promises';
|
|
|
13
13
|
import { loadConfig } from '../core/config.js';
|
|
14
14
|
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
15
15
|
import { addSchedule, formatInterval, loadSchedules, nextDueAt, parseInterval, removeSchedule, runJob, setScheduleEnabled, } from '../core/scheduler.js';
|
|
16
|
-
import {
|
|
16
|
+
import { findActiveServerPort } from './ui.js';
|
|
17
17
|
/**
|
|
18
18
|
* Adds a recurring job for a workspace.
|
|
19
19
|
*
|
|
@@ -44,14 +44,21 @@ export async function scheduleAddCommand(workspaceArg, options) {
|
|
|
44
44
|
/**
|
|
45
45
|
* Lists all scheduled jobs with their status and next due time.
|
|
46
46
|
*/
|
|
47
|
-
export async function scheduleListCommand() {
|
|
47
|
+
export async function scheduleListCommand(options) {
|
|
48
|
+
const store = await loadSchedules();
|
|
49
|
+
const activePort = await findActiveServerPort();
|
|
50
|
+
if (options?.json) {
|
|
51
|
+
console.log(JSON.stringify({ jobs: store.jobs, serverActive: activePort !== null, serverPort: activePort }, null, 2));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
console.log(chalk.bold.cyan('\n🕐 NexusFlow — Scheduled Jobs\n'));
|
|
49
|
-
|
|
50
|
-
if (!serverActive) {
|
|
55
|
+
if (!activePort) {
|
|
51
56
|
console.log(chalk.yellow('⚠️ Notice: The NexusFlow background server is not currently active.'));
|
|
52
57
|
console.log(chalk.dim(' Jobs are dormant until started with: nexusflow ui --daemon\n'));
|
|
53
58
|
}
|
|
54
|
-
|
|
59
|
+
else {
|
|
60
|
+
console.log(chalk.green(`✔ NexusFlow background server is active (port ${activePort}).\n`));
|
|
61
|
+
}
|
|
55
62
|
if (store.jobs.length === 0) {
|
|
56
63
|
console.log(chalk.yellow('No scheduled jobs. Add one with:'));
|
|
57
64
|
console.log(chalk.dim(' nexusflow schedule add [workspace] --task sync --every 2h\n'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/commands/schedule.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,aAAa,EACb,cAAc,EACd,MAAM,EACN,kBAAkB,GAEnB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M,CAAC,aAAa,CAAC,CAAC;IAE9D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC;QAC5B,OAAO,EAAE,iCAAiC;QAC1C,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC/B,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,EAAE;YACnE,KAAK,EAAE,EAAE,CAAC,aAAa;SACxB,CAAC,CAAC;KACJ,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* Shows status of running services for a workspace.
|
|
7
7
|
*
|
|
8
8
|
* @param workspaceArg - Optional workspace path from CLI.
|
|
9
|
+
* @param options - Command options including --json.
|
|
9
10
|
*/
|
|
10
|
-
export declare function statusCommand(workspaceArg?: string
|
|
11
|
+
export declare function statusCommand(workspaceArg?: string, options?: {
|
|
12
|
+
json?: boolean;
|
|
13
|
+
}): Promise<void>;
|
|
11
14
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAatG"}
|
package/dist/commands/status.js
CHANGED
|
@@ -6,17 +6,23 @@ import chalk from 'chalk';
|
|
|
6
6
|
import { select } from '@inquirer/prompts';
|
|
7
7
|
import { loadConfig } from '../core/config.js';
|
|
8
8
|
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
9
|
-
import { getServiceStatus } from '../orchestration/index.js';
|
|
9
|
+
import { getServiceStatus, loadRunningState } from '../orchestration/index.js';
|
|
10
10
|
/**
|
|
11
11
|
* Shows status of running services for a workspace.
|
|
12
12
|
*
|
|
13
13
|
* @param workspaceArg - Optional workspace path from CLI.
|
|
14
|
+
* @param options - Command options including --json.
|
|
14
15
|
*/
|
|
15
|
-
export async function statusCommand(workspaceArg) {
|
|
16
|
-
console.log(chalk.bold.cyan('\n📊 NexusFlow — Service Status\n'));
|
|
16
|
+
export async function statusCommand(workspaceArg, options) {
|
|
17
17
|
const workspacePath = await resolveWorkspace(workspaceArg);
|
|
18
18
|
if (!workspacePath)
|
|
19
19
|
return;
|
|
20
|
+
if (options?.json) {
|
|
21
|
+
const runningState = await loadRunningState(workspacePath);
|
|
22
|
+
console.log(JSON.stringify(runningState, null, 2));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
console.log(chalk.bold.cyan('\n📊 NexusFlow — Service Status\n'));
|
|
20
26
|
await getServiceStatus(workspacePath);
|
|
21
27
|
console.log();
|
|
22
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzE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G,MAAM,UAAU,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAE9D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC;QAC5B,OAAO,EAAE,qBAAqB;QAC9B,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC/B,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,EAAE;YACnE,KAAK,EAAE,EAAE,CAAC,aAAa;SACxB,CAAC,CAAC;KACJ,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/commands/ui.d.ts
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
* Starts the Hono dashboard server (the backend the desktop app embeds).
|
|
4
4
|
* Opening a browser is opt-in via --open.
|
|
5
5
|
*/
|
|
6
|
+
export interface DaemonState {
|
|
7
|
+
pid: number;
|
|
8
|
+
port: number;
|
|
9
|
+
startedAt: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function getDaemonState(): Promise<DaemonState | null>;
|
|
12
|
+
export declare function recordDaemonState(state: DaemonState | null): Promise<void>;
|
|
13
|
+
export declare function findActiveServerPort(): Promise<number | null>;
|
|
6
14
|
export declare function isPortActive(port: number): Promise<boolean>;
|
|
7
15
|
export declare function findAvailablePort(startPort: number, attempts?: number): Promise<number>;
|
|
8
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/commands/ui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/commands/ui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAQlE;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAahF;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASnE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW3D;AAuBD,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU1F;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFvJ"}
|
package/dist/commands/ui.js
CHANGED
|
@@ -6,8 +6,48 @@
|
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
import { exec, spawn } from 'node:child_process';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import * as path from 'node:path';
|
|
9
10
|
import * as net from 'node:net';
|
|
11
|
+
import * as fs from 'node:fs/promises';
|
|
12
|
+
import { getConfigDir } from '../core/config.js';
|
|
10
13
|
import { startServer } from '../server.js';
|
|
14
|
+
export async function getDaemonState() {
|
|
15
|
+
try {
|
|
16
|
+
const filePath = path.join(getConfigDir(), 'daemon.json');
|
|
17
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
18
|
+
return JSON.parse(content);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export async function recordDaemonState(state) {
|
|
25
|
+
try {
|
|
26
|
+
const configDir = getConfigDir();
|
|
27
|
+
await fs.mkdir(configDir, { recursive: true });
|
|
28
|
+
const filePath = path.join(configDir, 'daemon.json');
|
|
29
|
+
if (state === null) {
|
|
30
|
+
await fs.unlink(filePath).catch(() => { });
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
await fs.writeFile(filePath, JSON.stringify(state, null, 2), 'utf-8');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// Non-fatal
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export async function findActiveServerPort() {
|
|
41
|
+
const daemonState = await getDaemonState();
|
|
42
|
+
if (daemonState && await isPortActive(daemonState.port)) {
|
|
43
|
+
return daemonState.port;
|
|
44
|
+
}
|
|
45
|
+
for (let p = 3000; p <= 3005; p++) {
|
|
46
|
+
if (await isPortActive(p))
|
|
47
|
+
return p;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
11
51
|
export function isPortActive(port) {
|
|
12
52
|
return new Promise((resolve) => {
|
|
13
53
|
const socket = net.connect(port, 'localhost');
|
|
@@ -104,6 +144,7 @@ export async function uiCommand(options) {
|
|
|
104
144
|
catch { }
|
|
105
145
|
throw new Error(`Backend daemon failed to bind port ${targetPort} within 10s`);
|
|
106
146
|
}
|
|
147
|
+
await recordDaemonState({ pid: child.pid ?? 0, port: targetPort, startedAt: new Date().toISOString() });
|
|
107
148
|
console.log(chalk.green(` ✔ Dashboard daemon successfully running on port ${chalk.bold(targetPort)}.`));
|
|
108
149
|
if (options.open) {
|
|
109
150
|
console.log(chalk.dim(' Opening browser...'));
|
package/dist/commands/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/commands/ui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/commands/ui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAQ3C,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,aAAa,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAAyB;IAC/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AAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAC/E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC;QAEpD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,WAAW,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;QAED,qBAAqB;QACrB,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
|
@@ -81,7 +81,7 @@ describe.skipIf(!hasGit)('createWorktree / removeWorktree (real git)', { timeout
|
|
|
81
81
|
expect(result.createdBranch).toBe(true);
|
|
82
82
|
// The worktree started from origin/main (post-fetch), so it has the new file.
|
|
83
83
|
await expect(fs.access(path.join(target, 'NEW.md'))).resolves.toBeUndefined();
|
|
84
|
-
},
|
|
84
|
+
}, 30000);
|
|
85
85
|
it('checks out a remote-only branch as a local tracking branch', async () => {
|
|
86
86
|
// Bare "remote" seeded from an initial repo.
|
|
87
87
|
const seed = path.join(base, 'seed');
|
|
@@ -108,7 +108,7 @@ describe.skipIf(!hasGit)('createWorktree / removeWorktree (real git)', { timeout
|
|
|
108
108
|
// The local branch tracks origin/feature/existing.
|
|
109
109
|
const upstream = await git(target, 'rev-parse', '--abbrev-ref', 'feature/existing@{upstream}');
|
|
110
110
|
expect(upstream.trim()).toBe('origin/feature/existing');
|
|
111
|
-
},
|
|
111
|
+
}, 30000);
|
|
112
112
|
it('mustExist fails when the branch exists neither locally nor on origin', async () => {
|
|
113
113
|
await initRepo(mainRepo);
|
|
114
114
|
const target = path.join(base, 'wt');
|
package/dist/desktop-server.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Minimal entry point for the desktop app's embedded backend: starts the Hono
|
|
4
4
|
* dashboard server directly, without the CLI layer (commander/pm2/inquirer and
|
|
5
5
|
* all the command modules). The Electron shell spawns this and parses the
|
|
6
|
-
* "
|
|
6
|
+
* explicit "NEXUSFLOW_READY_PORT=<port>" token from stdout.
|
|
7
7
|
*
|
|
8
8
|
* Running the full CLI (`index.js ui`) here is both unnecessary and fragile —
|
|
9
9
|
* under Electron-as-Node the CLI's commander import can resolve to pm2's
|
package/dist/desktop-server.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Minimal entry point for the desktop app's embedded backend: starts the Hono
|
|
4
4
|
* dashboard server directly, without the CLI layer (commander/pm2/inquirer and
|
|
5
5
|
* all the command modules). The Electron shell spawns this and parses the
|
|
6
|
-
* "
|
|
6
|
+
* explicit "NEXUSFLOW_READY_PORT=<port>" token from stdout.
|
|
7
7
|
*
|
|
8
8
|
* Running the full CLI (`index.js ui`) here is both unnecessary and fragile —
|
|
9
9
|
* under Electron-as-Node the CLI's commander import can resolve to pm2's
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-BDDZnIHx.js";import{n as o}from"./CSPContext-BG7no5S_.js";import{t as s}from"./bot-C2HWrAft.js";import{a as ee,c as te,i as ne,n as c,o as l,r as re,s as ie,t as ae}from"./alert-dialog-D7jNzvYQ.js";import{a as oe,h as se}from"./store-D7ixdVck.js";import{t as ce}from"./trash-2-CtR35_eF.js";import{Ft as u,H as le,Lt as ue,N as de,R as fe,Vt as pe,Y as me,a as he,c as d,d as f,f as p,j as ge,l as m,o as h,ot as _e,s as g,st as ve}from"./index-C6qbn9Zq.js";import{t as _}from"./badge-CAohJGj6.js";import{t as ye}from"./card-BKXzd_5L.js";import{a as v,i as be,n as y,r as b,t as x}from"./empty-BdlgbifD.js";import{t as S}from"./label-CG5exjag.js";import{t as C}from"./textarea-BNRuIXNs.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}=ge(),{data:U=[]}=ve(),W=_e(t===`global`?``:t),G=me(),K=le(),q=fe(),J=de(),Y=t!==`global`,Te=U.find(e=>e.id===t),X=!Y||Te?.assistants?.includes(`codex`),Z=Y&&X&&!W.isLoading&&!W.isError&&!!W.data;(0,w.useEffect)(()=>{if(!Y){z(null);return}W.data&&z([...W.data.enabledAgents??[]])},[Y,t,W.data]);let Q=(0,w.useMemo)(()=>{let e=r.trim().toLowerCase();return e?H.filter(t=>[t.name,t.description,t.category].some(t=>t.toLowerCase().includes(e))):H},[H,r]),Ee=new Set(R??W.data?.enabledAgents??[]);function $(){N(null),F(E),k(!0)}function De(e){N(e.id),F({id:e.id,name:e.name,category:e.category,description:e.description,developerInstructions:e.developerInstructions,model:e.model,modelReasoningEffort:e.modelReasoningEffort,sandboxMode:e.sandboxMode}),k(!0)}async function Oe(){try{let t=M??D(P.name);await G.mutateAsync({...P,id:t,name:t}),k(!1),e?.(`Codex agent saved`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent`,`error`)}}async function ke(){try{await K.mutateAsync({toml:I,category:`general`}),j(!1),L(``),e?.(`Codex agent imported`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to import agent`,`error`)}}async function Ae(){if(B)try{await q.mutateAsync(B.id),V(null),e?.(`Agent deleted from the personal catalog`,`info`)}catch(t){e?.(t instanceof Error?t.message:`Failed to delete agent`,`error`)}}function je(e){if(!Z||R===null)return;let t=new Set(R);t.has(e)?t.delete(e):t.add(e),z([...t])}async function Me(){if(!(!W.data||R===null))try{await J.mutateAsync({workspaceId:t,expectedRevision:W.data.revision??0,enabledSkills:W.data.enabledSkills,enabledAgents:R,enabledCategories:W.data.enabledCategories??[]}),e?.(`Agent selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent selection`,`error`)}}return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,T.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-4 border-b border-border px-6 py-5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`rounded-lg bg-primary/10 p-2 text-primary`,children:(0,T.jsx)(s,{className:`h-5 w-5`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Codex Agent Library`}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create and reuse project-scoped Codex custom agents.`})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(a,{render:(0,T.jsx)(oe,{to:`/skills`}),variant:`outline`,size:`sm`,children:`Skills`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-1.5`,children:[(0,T.jsx)(ue,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(S,{htmlFor:`agent-scope`,className:`text-xs text-muted-foreground`,children:`Scope`}),(0,T.jsxs)(`select`,{id:`agent-scope`,value:t,onChange:e=>n(e.target.value),className:`cursor-pointer bg-transparent text-xs font-semibold text-foreground focus:outline-none`,children:[(0,T.jsx)(`option`,{value:`global`,children:`Personal catalog`}),U.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),Y?(0,T.jsx)(a,{size:`sm`,onClick:Me,disabled:!Z||J.isPending,children:J.isPending?`Saving…`:`Save selection`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>j(!0),children:[(0,T.jsx)(xe,{className:`mr-1.5 h-4 w-4`}),`Import TOML`]}),(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(u,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]})]})]}),(0,T.jsx)(`div`,{className:`border-b border-border/60 bg-muted/20 px-6 py-3`,children:(0,T.jsxs)(`div`,{className:`relative max-w-md`,children:[(0,T.jsx)(se,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(o,{value:r,onChange:e=>O(e.target.value),placeholder:`Search agents…`,className:`pl-9`})]})}),(0,T.jsx)(`main`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:Ce||Y&&W.isLoading?(0,T.jsx)(`div`,{className:`flex justify-center p-12`,children:(0,T.jsx)(he,{})}):we||Y&&W.isError?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Resources could not be loaded`}),(0,T.jsx)(y,{children:`Assignment controls remain disabled to protect the saved selection.`})]})}):Y&&!X?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Codex is not enabled for this workspace`}),(0,T.jsx)(y,{children:`Add Codex to the workspace before assigning Codex-native agents.`})]})}):Q.length===0?(0,T.jsxs)(x,{className:`border border-dashed py-12`,children:[(0,T.jsx)(be,{children:(0,T.jsx)(s,{className:`h-8 w-8 text-muted-foreground`})}),(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`No Codex agents found`}),(0,T.jsx)(y,{children:`Create an agent or import a native TOML definition.`})]}),!Y&&(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(u,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]}):(0,T.jsx)(`div`,{className:`mx-auto grid max-w-6xl grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:Q.map(e=>{let t=Ee.has(e.id);return(0,T.jsxs)(ye,{className:i(`flex flex-col gap-4 p-4`,Y&&!t&&`opacity-60`),children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`h2`,{className:`font-semibold`,children:e.name}),(0,T.jsx)(_,{variant:`outline`,children:`Codex`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.description})]}),Y?(0,T.jsxs)(a,{variant:t?`default`:`outline`,size:`sm`,onClick:()=>je(e.id),disabled:!Z,children:[(0,T.jsx)(pe,{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)(ce,{className:`h-4 w-4`})})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[e.sandboxMode&&(0,T.jsx)(_,{variant:`secondary`,children:e.sandboxMode}),e.modelReasoningEffort&&(0,T.jsx)(_,{variant:`secondary`,children:e.modelReasoningEffort}),e.model&&(0,T.jsx)(_,{variant:`secondary`,children:e.model})]})]},e.id)})})}),(0,T.jsx)(h,{open:Se,onOpenChange:k,children:(0,T.jsxs)(f,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(p,{children:M?`Edit Codex agent`:`Create Codex agent`}),(0,T.jsx)(g,{children:`Only the current stable native fields are managed. Omitted settings inherit from Codex.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-name`,children:`Name`}),(0,T.jsx)(o,{id:`agent-name`,value:P.name,disabled:!!M,onChange:e=>F({...P,name:D(e.target.value)}),placeholder:`code-reviewer`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-description`,children:`Description`}),(0,T.jsx)(o,{id:`agent-description`,value:P.description,onChange:e=>F({...P,description:e.target.value}),placeholder:`Use when reviewing a fixed diff for correctness and security.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-instructions`,children:`Developer instructions`}),(0,T.jsx)(C,{id:`agent-instructions`,value:P.developerInstructions,onChange:e=>F({...P,developerInstructions:e.target.value}),className:`min-h-48 font-mono`})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-model`,children:`Model override`}),(0,T.jsx)(o,{id:`agent-model`,value:P.model??``,onChange:e=>F({...P,model:e.target.value||void 0}),placeholder:`Inherit`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-effort`,children:`Reasoning`}),(0,T.jsxs)(`select`,{id:`agent-effort`,value:P.modelReasoningEffort??``,onChange:e=>F({...P,modelReasoningEffort:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`low`,children:`Low`}),(0,T.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,T.jsx)(`option`,{value:`high`,children:`High`}),(0,T.jsx)(`option`,{value:`xhigh`,children:`XHigh`}),(0,T.jsx)(`option`,{value:`max`,children:`Max`}),(0,T.jsx)(`option`,{value:`ultra`,children:`Ultra`})]})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-sandbox`,children:`Sandbox`}),(0,T.jsxs)(`select`,{id:`agent-sandbox`,value:P.sandboxMode??``,onChange:e=>F({...P,sandboxMode:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`read-only`,children:`Read only`}),(0,T.jsx)(`option`,{value:`workspace-write`,children:`Workspace write`})]})]})]})]}),(0,T.jsxs)(d,{children:[(0,T.jsx)(a,{variant:`outline`,onClick:()=>k(!1),children:`Cancel`}),(0,T.jsx)(a,{onClick:Oe,disabled:G.isPending||!P.name||!P.description||!P.developerInstructions,children:G.isPending?`Saving…`:`Save agent`})]})]})}),(0,T.jsx)(h,{open:A,onOpenChange:j,children:(0,T.jsxs)(f,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(p,{children:`Import Codex agent TOML`}),(0,T.jsx)(g,{children:`The import accepts the required native fields and supported model, reasoning, and sandbox overrides.`})]}),(0,T.jsx)(C,{value:I,onChange:e=>L(e.target.value),className:`min-h-72 font-mono`,placeholder:`name = "reviewer"
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-BDDZnIHx.js";import{n as o}from"./CSPContext-BG7no5S_.js";import{t as s}from"./bot-C2HWrAft.js";import{a as ee,c as te,i as ne,n as c,o as l,r as re,s as ie,t as ae}from"./alert-dialog-CCwlEjU2.js";import{a as oe,h as se}from"./store-D7ixdVck.js";import{t as ce}from"./trash-2-CtR35_eF.js";import{Ft as u,H as le,Lt as ue,N as de,R as fe,Vt as pe,Y as me,a as he,c as d,d as f,f as p,j as ge,l as m,o as h,ot as _e,s as g,st as ve}from"./index-pxzwuRLq.js";import{t as _}from"./badge-CAohJGj6.js";import{t as ye}from"./card-BKXzd_5L.js";import{a as v,i as be,n as y,r as b,t as x}from"./empty-BdlgbifD.js";import{t as S}from"./label-CG5exjag.js";import{t as C}from"./textarea-BNRuIXNs.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}=ge(),{data:U=[]}=ve(),W=_e(t===`global`?``:t),G=me(),K=le(),q=fe(),J=de(),Y=t!==`global`,Te=U.find(e=>e.id===t),X=!Y||Te?.assistants?.includes(`codex`),Z=Y&&X&&!W.isLoading&&!W.isError&&!!W.data;(0,w.useEffect)(()=>{if(!Y){z(null);return}W.data&&z([...W.data.enabledAgents??[]])},[Y,t,W.data]);let Q=(0,w.useMemo)(()=>{let e=r.trim().toLowerCase();return e?H.filter(t=>[t.name,t.description,t.category].some(t=>t.toLowerCase().includes(e))):H},[H,r]),Ee=new Set(R??W.data?.enabledAgents??[]);function $(){N(null),F(E),k(!0)}function De(e){N(e.id),F({id:e.id,name:e.name,category:e.category,description:e.description,developerInstructions:e.developerInstructions,model:e.model,modelReasoningEffort:e.modelReasoningEffort,sandboxMode:e.sandboxMode}),k(!0)}async function Oe(){try{let t=M??D(P.name);await G.mutateAsync({...P,id:t,name:t}),k(!1),e?.(`Codex agent saved`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent`,`error`)}}async function ke(){try{await K.mutateAsync({toml:I,category:`general`}),j(!1),L(``),e?.(`Codex agent imported`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to import agent`,`error`)}}async function Ae(){if(B)try{await q.mutateAsync(B.id),V(null),e?.(`Agent deleted from the personal catalog`,`info`)}catch(t){e?.(t instanceof Error?t.message:`Failed to delete agent`,`error`)}}function je(e){if(!Z||R===null)return;let t=new Set(R);t.has(e)?t.delete(e):t.add(e),z([...t])}async function Me(){if(!(!W.data||R===null))try{await J.mutateAsync({workspaceId:t,expectedRevision:W.data.revision??0,enabledSkills:W.data.enabledSkills,enabledAgents:R,enabledCategories:W.data.enabledCategories??[]}),e?.(`Agent selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent selection`,`error`)}}return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,T.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-4 border-b border-border px-6 py-5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`rounded-lg bg-primary/10 p-2 text-primary`,children:(0,T.jsx)(s,{className:`h-5 w-5`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Codex Agent Library`}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create and reuse project-scoped Codex custom agents.`})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(a,{render:(0,T.jsx)(oe,{to:`/skills`}),variant:`outline`,size:`sm`,children:`Skills`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-1.5`,children:[(0,T.jsx)(ue,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(S,{htmlFor:`agent-scope`,className:`text-xs text-muted-foreground`,children:`Scope`}),(0,T.jsxs)(`select`,{id:`agent-scope`,value:t,onChange:e=>n(e.target.value),className:`cursor-pointer bg-transparent text-xs font-semibold text-foreground focus:outline-none`,children:[(0,T.jsx)(`option`,{value:`global`,children:`Personal catalog`}),U.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),Y?(0,T.jsx)(a,{size:`sm`,onClick:Me,disabled:!Z||J.isPending,children:J.isPending?`Saving…`:`Save selection`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>j(!0),children:[(0,T.jsx)(xe,{className:`mr-1.5 h-4 w-4`}),`Import TOML`]}),(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(u,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]})]})]}),(0,T.jsx)(`div`,{className:`border-b border-border/60 bg-muted/20 px-6 py-3`,children:(0,T.jsxs)(`div`,{className:`relative max-w-md`,children:[(0,T.jsx)(se,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(o,{value:r,onChange:e=>O(e.target.value),placeholder:`Search agents…`,className:`pl-9`})]})}),(0,T.jsx)(`main`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:Ce||Y&&W.isLoading?(0,T.jsx)(`div`,{className:`flex justify-center p-12`,children:(0,T.jsx)(he,{})}):we||Y&&W.isError?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Resources could not be loaded`}),(0,T.jsx)(y,{children:`Assignment controls remain disabled to protect the saved selection.`})]})}):Y&&!X?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Codex is not enabled for this workspace`}),(0,T.jsx)(y,{children:`Add Codex to the workspace before assigning Codex-native agents.`})]})}):Q.length===0?(0,T.jsxs)(x,{className:`border border-dashed py-12`,children:[(0,T.jsx)(be,{children:(0,T.jsx)(s,{className:`h-8 w-8 text-muted-foreground`})}),(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`No Codex agents found`}),(0,T.jsx)(y,{children:`Create an agent or import a native TOML definition.`})]}),!Y&&(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(u,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]}):(0,T.jsx)(`div`,{className:`mx-auto grid max-w-6xl grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:Q.map(e=>{let t=Ee.has(e.id);return(0,T.jsxs)(ye,{className:i(`flex flex-col gap-4 p-4`,Y&&!t&&`opacity-60`),children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`h2`,{className:`font-semibold`,children:e.name}),(0,T.jsx)(_,{variant:`outline`,children:`Codex`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.description})]}),Y?(0,T.jsxs)(a,{variant:t?`default`:`outline`,size:`sm`,onClick:()=>je(e.id),disabled:!Z,children:[(0,T.jsx)(pe,{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)(ce,{className:`h-4 w-4`})})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[e.sandboxMode&&(0,T.jsx)(_,{variant:`secondary`,children:e.sandboxMode}),e.modelReasoningEffort&&(0,T.jsx)(_,{variant:`secondary`,children:e.modelReasoningEffort}),e.model&&(0,T.jsx)(_,{variant:`secondary`,children:e.model})]})]},e.id)})})}),(0,T.jsx)(h,{open:Se,onOpenChange:k,children:(0,T.jsxs)(f,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(p,{children:M?`Edit Codex agent`:`Create Codex agent`}),(0,T.jsx)(g,{children:`Only the current stable native fields are managed. Omitted settings inherit from Codex.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-name`,children:`Name`}),(0,T.jsx)(o,{id:`agent-name`,value:P.name,disabled:!!M,onChange:e=>F({...P,name:D(e.target.value)}),placeholder:`code-reviewer`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-description`,children:`Description`}),(0,T.jsx)(o,{id:`agent-description`,value:P.description,onChange:e=>F({...P,description:e.target.value}),placeholder:`Use when reviewing a fixed diff for correctness and security.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-instructions`,children:`Developer instructions`}),(0,T.jsx)(C,{id:`agent-instructions`,value:P.developerInstructions,onChange:e=>F({...P,developerInstructions:e.target.value}),className:`min-h-48 font-mono`})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-model`,children:`Model override`}),(0,T.jsx)(o,{id:`agent-model`,value:P.model??``,onChange:e=>F({...P,model:e.target.value||void 0}),placeholder:`Inherit`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-effort`,children:`Reasoning`}),(0,T.jsxs)(`select`,{id:`agent-effort`,value:P.modelReasoningEffort??``,onChange:e=>F({...P,modelReasoningEffort:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`low`,children:`Low`}),(0,T.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,T.jsx)(`option`,{value:`high`,children:`High`}),(0,T.jsx)(`option`,{value:`xhigh`,children:`XHigh`}),(0,T.jsx)(`option`,{value:`max`,children:`Max`}),(0,T.jsx)(`option`,{value:`ultra`,children:`Ultra`})]})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(S,{htmlFor:`agent-sandbox`,children:`Sandbox`}),(0,T.jsxs)(`select`,{id:`agent-sandbox`,value:P.sandboxMode??``,onChange:e=>F({...P,sandboxMode:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`read-only`,children:`Read only`}),(0,T.jsx)(`option`,{value:`workspace-write`,children:`Workspace write`})]})]})]})]}),(0,T.jsxs)(d,{children:[(0,T.jsx)(a,{variant:`outline`,onClick:()=>k(!1),children:`Cancel`}),(0,T.jsx)(a,{onClick:Oe,disabled:G.isPending||!P.name||!P.description||!P.developerInstructions,children:G.isPending?`Saving…`:`Save agent`})]})]})}),(0,T.jsx)(h,{open:A,onOpenChange:j,children:(0,T.jsxs)(f,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(p,{children:`Import Codex agent TOML`}),(0,T.jsx)(g,{children:`The import accepts the required native fields and supported model, reasoning, and sandbox overrides.`})]}),(0,T.jsx)(C,{value:I,onChange:e=>L(e.target.value),className:`min-h-72 font-mono`,placeholder:`name = "reviewer"
|
|
2
2
|
description = "Use for code review."
|
|
3
3
|
developer_instructions = "Review the fixed diff."`}),(0,T.jsxs)(d,{children:[(0,T.jsx)(a,{variant:`outline`,onClick:()=>j(!1),children:`Cancel`}),(0,T.jsx)(a,{onClick:ke,disabled:K.isPending||!I.trim(),children:K.isPending?`Importing…`:`Import agent`})]})]})}),(0,T.jsx)(ae,{open:B!==null,onOpenChange:e=>!e&&V(null),children:(0,T.jsxs)(l,{children:[(0,T.jsxs)(ee,{children:[(0,T.jsxs)(ie,{children:[`Delete “`,B?.name,`”?`]}),(0,T.jsx)(re,{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)(c,{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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,m as r,t as i}from"./button-BDDZnIHx.js";import{t as a}from"./code-xml-jFAa3-TT.js";import{t as o}from"./git-branch-Cfj9D8yW.js";import{Ft as s,Gt as c,Ht as l,It as u,Lt as d,M as f,Mt as p,Ot as m,Rt as h,U as g,a as _,ct as v,i as y,jt as b,n as x,r as S,rt as C,vt as w,xt as T,yt as E}from"./index-C6qbn9Zq.js";import{t as D}from"./card-BKXzd_5L.js";import{a as O,i as k,n as A,r as j,t as M}from"./empty-BdlgbifD.js";var N=t(e(),1),P=n(),F=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,P.jsx)(w,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!0,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,P.jsx)(b,{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,P.jsx)(a,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(E,{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,P.jsx)(b,{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,P.jsx)(h,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(m,{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,P.jsx)(b,{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,P.jsx)(h,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,P.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,P.jsx)(T,{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??!0,icon:(0,P.jsx)(b,{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,P.jsx)(a,{size:12})}]}];function I({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:a,onNewWorkspace:h,showToast:b}){let I=f(),L=C(),R=g(),[z,B]=(0,N.useState)(null),V=Object.values(t),H=V.reduce((e,t)=>e+(t.changedFiles||0),0),U=V.filter(e=>e.changedFiles>0).length,W=V.reduce((e,t)=>e+(t.runningServices||0),0),G=V.filter(e=>e.runningServices>0).length,K=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,q=e.filter(e=>e.mode===`in-place`).length,J=(0,N.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=x(e),r=t.get(n);r?r.count+=1:t.set(n,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Y=(0,N.useMemo)(()=>{let e={};return(I.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[I.data]),X=(0,N.useMemo)(()=>L.data??[],[L.data]),Z=(0,N.useMemo)(()=>F.map(e=>{let t=e.getOptions({aiDetected:Y,launchTargets:X}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Y,X]),Q=async(t,n)=>{if(z)return;let r=e[0];if(!r){b?.(`No active workspace available to launch harness in.`,`error`);return}let i=`${t.id}:${n.id}`;B(i);try{n.type===`cli`?(await R.mutateAsync({workspaceId:r.branchName,assistant:t.id,command:n.command}),b?.(`Launched ${t.name} (${n.label}) for ${r.branchName}`,`success`)):n.targetId&&(await v(`/api/workspace/${encodeURIComponent(r.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:n.targetId})}),b?.(`Opened ${r.branchName} in ${t.name} (${n.label})`,`success`))}catch(e){b?.(`Failed to launch ${t.name}: ${e instanceof Error?e.message:String(e)}`,`error`)}finally{B(null)}};return(0,P.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in space-y-5 pb-10`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b border-border/70 pb-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h1`,{className:`text-lg sm:text-xl font-bold tracking-tight text-foreground`,children:`Environment Overview`}),(0,P.jsx)(y,{tone:`running`,dot:!0,children:`Live Telemetry`})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Multi-repo health, background services, and AI coding activity across your workspaces.`})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:(0,P.jsxs)(i,{size:`sm`,variant:`default`,onClick:h,children:[(0,P.jsx)(s,{size:14}),` Start work`]})})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Workspaces`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(d,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsx)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:e.length}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[K,` worktrees`]}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsxs)(`span`,{children:[q,` in-place`]})]})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Git Activity`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,H>0?`bg-amber-500/15 text-amber-600 dark:text-amber-400`:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`),children:(0,P.jsx)(o,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,H>0?`text-amber-600 dark:text-amber-400`:`text-emerald-600 dark:text-emerald-400`),children:[H,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`files`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:U>0?`${U} workspace${U===1?``:`s`} with changes`:`All workspaces clean`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Live Services`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,W>0?`bg-emerald-500/15 text-emerald-400`:`bg-muted/60 text-muted-foreground`),children:(0,P.jsx)(u,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,W>0?`text-emerald-400`:`text-muted-foreground`),children:[W,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`active`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:G>0?`In ${G} workspace${G===1?``:`s`}`:`No services running`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`AI Harnesses`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(p,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:[Z.filter(e=>e.isAnyAvailable).length,` / `,Z.length]}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[11px] text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{children:`Antigravity`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Claude`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Codex`})]})]})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`AI Coding Assistant Hub`}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Direct CLI & Desktop launcher with dynamic environment detection`})]}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Z.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:r})=>{let a=!!(z&&z.startsWith(`${e.id}:`));return(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[e.icon,(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`text-sm font-bold text-foreground block`,children:e.name}),(0,P.jsxs)(`span`,{className:`font-mono text-[10.5px] text-muted-foreground`,children:[`CLI command: `,e.cliCommand]})]})]}),(0,P.jsx)(y,{tone:r,dot:n,children:n?`Ready`:`Not installed`})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1 border-t border-border/50`,children:n?t.map(t=>{let n=z===`${e.id}:${t.id}`;return(0,P.jsxs)(i,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void Q(e,t),className:`gap-1.5 font-medium`,title:`Launch ${e.name} (${t.label}) in active workspace`,children:[n?(0,P.jsx)(_,{className:`size-3`}):t.icon,(0,P.jsx)(`span`,{children:t.label})]},t.id)}):(0,P.jsx)(i,{size:`xs`,variant:`outline`,disabled:!0,className:`opacity-50 text-muted-foreground cursor-not-allowed`,children:`Not Installed`})})]},e.id)})})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Workspace Divergence & Health Matrix`}),(0,P.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.2 font-mono text-[10px] text-foreground`,children:e.length})]})}),n?(0,P.jsx)(D,{className:`p-8 surface-card flex items-center justify-center`,children:(0,P.jsx)(_,{className:`size-5 text-primary`})}):e.length===0?(0,P.jsx)(D,{className:`border-dashed surface-card`,children:(0,P.jsxs)(M,{children:[(0,P.jsxs)(j,{children:[(0,P.jsx)(k,{variant:`icon`,children:(0,P.jsx)(d,{})}),(0,P.jsx)(O,{children:`No active workspaces`}),(0,P.jsx)(A,{children:`Start your first multi-repo workspace to automatically branch worktrees and prepare AI contexts.`})]}),(0,P.jsxs)(i,{onClick:h,children:[(0,P.jsx)(s,{size:15}),` Start work`]})]})}):(0,P.jsxs)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:[(0,P.jsxs)(`div`,{className:`hidden sm:grid grid-cols-12 gap-3 px-4 py-2 bg-muted/30 text-[10px] font-bold uppercase tracking-wider text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{className:`col-span-4`,children:`Workspace / Branch`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`AI Harness`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Git Status`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Services`}),(0,P.jsx)(`span`,{className:`col-span-2 text-right`,children:`Action`})]}),e.map(e=>{let n=t[e.branchName],o=!!(n&&n.changedFiles>0),s=!!(n&&n.runningServices>0),l=(e.mode??`worktree`)===`in-place`?null:n?S(n.syncStatus):null;return(0,P.jsxs)(`div`,{onClick:()=>a(e.branchName),className:`grid grid-cols-1 sm:grid-cols-12 gap-2 sm:gap-3 px-4 py-3 items-center hover:bg-accent/40 transition-colors cursor-pointer text-xs`,children:[(0,P.jsxs)(`div`,{className:`sm:col-span-4 min-w-0 flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:r(`size-2 rounded-full shrink-0`,o?`bg-amber-400`:`bg-emerald-500`)}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono font-bold text-foreground`,title:e.branchName,children:e.branchName}),(0,P.jsx)(`span`,{className:`text-[9px] font-mono uppercase tracking-wider text-muted-foreground bg-muted px-1 rounded shrink-0`,children:e.mode===`in-place`?`In-place`:`Worktree`})]}),(0,P.jsxs)(`div`,{className:`text-[10px] text-muted-foreground font-mono truncate mt-0.5`,children:[e.repos.length,` `,e.repos.length===1?`repo`:`repos`,` • `,new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center gap-1.5 min-w-0`,children:e.assistants&&e.assistants.length>0?e.assistants.map(e=>(0,P.jsx)(`span`,{className:`inline-flex items-center`,title:`Configured AI: ${e}`,children:e===`antigravity`?(0,P.jsx)(w,{className:`size-3.5`}):e===`claude`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(E,{className:`size-2`})}):e===`codex`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(m,{className:`size-2`})}):(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-blue-600 text-white shadow-2xs`,children:(0,P.jsx)(T,{className:`size-2`})})},e)):(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`—`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:o?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-amber-600 dark:text-amber-400 font-semibold`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500`}),n.changedFiles,` modified`,l&&l.tone!==`idle`&&(0,P.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-0.5 font-normal`,children:[`(`,l.label,`)`]})]}):(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500`}),`Clean`]})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:s?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500 animate-pulse`}),n.runningServices,` active`]}):(0,P.jsx)(`span`,{className:`text-muted-foreground/70`,children:`Offline`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center justify-end gap-1`,onClick:e=>e.stopPropagation(),children:(0,P.jsxs)(i,{size:`xs`,variant:`ghost`,onClick:()=>a(e.branchName),className:`gap-1 text-primary hover:text-primary`,children:[(0,P.jsx)(`span`,{children:`Inspect`}),(0,P.jsx)(c,{size:12})]})})]},e.id)})]})]}),J.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsxs)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:[`Repository Worktree Allocations (`,J.length,`)`]}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Underlying git repos mapped across features`})]}),(0,P.jsx)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:J.map(e=>(0,P.jsxs)(`div`,{className:`flex items-center justify-between p-3 text-xs`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0 font-mono`,children:[(0,P.jsx)(`span`,{className:`grid size-6 place-items-center rounded bg-muted/60 text-muted-foreground`,children:(0,P.jsx)(l,{size:13})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`font-bold text-foreground block truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate block`,children:e.path})]})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 font-mono text-[11px] text-muted-foreground`,children:(0,P.jsxs)(`span`,{className:`rounded bg-muted px-2 py-0.5 text-foreground font-semibold`,children:[e.count,` `,e.count===1?`workspace worktree`:`workspace worktrees`]})})]},e.name))})]})]})}export{I as DashboardPage};
|
|
1
|
+
import{_ as e,b as t,g as n,m as r,t as i}from"./button-BDDZnIHx.js";import{t as a}from"./code-xml-jFAa3-TT.js";import{t as o}from"./git-branch-Cfj9D8yW.js";import{Ft as s,Gt as c,Ht as l,It as u,Lt as d,M as f,Mt as p,Ot as m,Rt as h,U as g,a as _,ct as v,i as y,jt as b,n as x,r as S,rt as C,vt as w,xt as T,yt as E}from"./index-pxzwuRLq.js";import{t as D}from"./card-BKXzd_5L.js";import{a as O,i as k,n as A,r as j,t as M}from"./empty-BdlgbifD.js";var N=t(e(),1),P=n(),F=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,P.jsx)(w,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!0,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,P.jsx)(b,{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,P.jsx)(a,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(E,{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,P.jsx)(b,{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,P.jsx)(h,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,P.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(m,{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,P.jsx)(b,{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,P.jsx)(h,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,P.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,P.jsx)(T,{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??!0,icon:(0,P.jsx)(b,{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,P.jsx)(a,{size:12})}]}];function I({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:a,onNewWorkspace:h,showToast:b}){let I=f(),L=C(),R=g(),[z,B]=(0,N.useState)(null),V=Object.values(t),H=V.reduce((e,t)=>e+(t.changedFiles||0),0),U=V.filter(e=>e.changedFiles>0).length,W=V.reduce((e,t)=>e+(t.runningServices||0),0),G=V.filter(e=>e.runningServices>0).length,K=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,q=e.filter(e=>e.mode===`in-place`).length,J=(0,N.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=x(e),r=t.get(n);r?r.count+=1:t.set(n,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Y=(0,N.useMemo)(()=>{let e={};return(I.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[I.data]),X=(0,N.useMemo)(()=>L.data??[],[L.data]),Z=(0,N.useMemo)(()=>F.map(e=>{let t=e.getOptions({aiDetected:Y,launchTargets:X}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Y,X]),Q=async(t,n)=>{if(z)return;let r=e[0];if(!r){b?.(`No active workspace available to launch harness in.`,`error`);return}let i=`${t.id}:${n.id}`;B(i);try{n.type===`cli`?(await R.mutateAsync({workspaceId:r.branchName,assistant:t.id,command:n.command}),b?.(`Launched ${t.name} (${n.label}) for ${r.branchName}`,`success`)):n.targetId&&(await v(`/api/workspace/${encodeURIComponent(r.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:n.targetId})}),b?.(`Opened ${r.branchName} in ${t.name} (${n.label})`,`success`))}catch(e){b?.(`Failed to launch ${t.name}: ${e instanceof Error?e.message:String(e)}`,`error`)}finally{B(null)}};return(0,P.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in space-y-5 pb-10`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b border-border/70 pb-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h1`,{className:`text-lg sm:text-xl font-bold tracking-tight text-foreground`,children:`Environment Overview`}),(0,P.jsx)(y,{tone:`running`,dot:!0,children:`Live Telemetry`})]}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Multi-repo health, background services, and AI coding activity across your workspaces.`})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:(0,P.jsxs)(i,{size:`sm`,variant:`default`,onClick:h,children:[(0,P.jsx)(s,{size:14}),` Start work`]})})]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Workspaces`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(d,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsx)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:e.length}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[K,` worktrees`]}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsxs)(`span`,{children:[q,` in-place`]})]})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Git Activity`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,H>0?`bg-amber-500/15 text-amber-600 dark:text-amber-400`:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`),children:(0,P.jsx)(o,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,H>0?`text-amber-600 dark:text-amber-400`:`text-emerald-600 dark:text-emerald-400`),children:[H,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`files`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:U>0?`${U} workspace${U===1?``:`s`} with changes`:`All workspaces clean`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Live Services`}),(0,P.jsx)(`span`,{className:r(`grid size-7 place-items-center rounded`,W>0?`bg-emerald-500/15 text-emerald-400`:`bg-muted/60 text-muted-foreground`),children:(0,P.jsx)(u,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:r(`font-mono text-2xl font-bold`,W>0?`text-emerald-400`:`text-muted-foreground`),children:[W,` `,(0,P.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`active`})]}),(0,P.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:G>0?`In ${G} workspace${G===1?``:`s`}`:`No services running`})]})]}),(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`AI Harnesses`}),(0,P.jsx)(`span`,{className:`grid size-7 place-items-center rounded bg-primary/10 text-primary`,children:(0,P.jsx)(p,{size:15})})]}),(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsxs)(`div`,{className:`font-mono text-2xl font-bold text-foreground`,children:[Z.filter(e=>e.isAnyAvailable).length,` / `,Z.length]}),(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5 text-[11px] text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{children:`Antigravity`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Claude`}),(0,P.jsx)(`span`,{children:`•`}),(0,P.jsx)(`span`,{children:`Codex`})]})]})]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`AI Coding Assistant Hub`}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Direct CLI & Desktop launcher with dynamic environment detection`})]}),(0,P.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Z.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:r})=>{let a=!!(z&&z.startsWith(`${e.id}:`));return(0,P.jsxs)(D,{className:`p-4 surface-card flex flex-col justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[e.icon,(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`text-sm font-bold text-foreground block`,children:e.name}),(0,P.jsxs)(`span`,{className:`font-mono text-[10.5px] text-muted-foreground`,children:[`CLI command: `,e.cliCommand]})]})]}),(0,P.jsx)(y,{tone:r,dot:n,children:n?`Ready`:`Not installed`})]}),(0,P.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1 border-t border-border/50`,children:n?t.map(t=>{let n=z===`${e.id}:${t.id}`;return(0,P.jsxs)(i,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void Q(e,t),className:`gap-1.5 font-medium`,title:`Launch ${e.name} (${t.label}) in active workspace`,children:[n?(0,P.jsx)(_,{className:`size-3`}):t.icon,(0,P.jsx)(`span`,{children:t.label})]},t.id)}):(0,P.jsx)(i,{size:`xs`,variant:`outline`,disabled:!0,className:`opacity-50 text-muted-foreground cursor-not-allowed`,children:`Not Installed`})})]},e.id)})})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Workspace Divergence & Health Matrix`}),(0,P.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.2 font-mono text-[10px] text-foreground`,children:e.length})]})}),n?(0,P.jsx)(D,{className:`p-8 surface-card flex items-center justify-center`,children:(0,P.jsx)(_,{className:`size-5 text-primary`})}):e.length===0?(0,P.jsx)(D,{className:`border-dashed surface-card`,children:(0,P.jsxs)(M,{children:[(0,P.jsxs)(j,{children:[(0,P.jsx)(k,{variant:`icon`,children:(0,P.jsx)(d,{})}),(0,P.jsx)(O,{children:`No active workspaces`}),(0,P.jsx)(A,{children:`Start your first multi-repo workspace to automatically branch worktrees and prepare AI contexts.`})]}),(0,P.jsxs)(i,{onClick:h,children:[(0,P.jsx)(s,{size:15}),` Start work`]})]})}):(0,P.jsxs)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:[(0,P.jsxs)(`div`,{className:`hidden sm:grid grid-cols-12 gap-3 px-4 py-2 bg-muted/30 text-[10px] font-bold uppercase tracking-wider text-muted-foreground font-mono`,children:[(0,P.jsx)(`span`,{className:`col-span-4`,children:`Workspace / Branch`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`AI Harness`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Git Status`}),(0,P.jsx)(`span`,{className:`col-span-2`,children:`Services`}),(0,P.jsx)(`span`,{className:`col-span-2 text-right`,children:`Action`})]}),e.map(e=>{let n=t[e.branchName],o=!!(n&&n.changedFiles>0),s=!!(n&&n.runningServices>0),l=(e.mode??`worktree`)===`in-place`?null:n?S(n.syncStatus):null;return(0,P.jsxs)(`div`,{onClick:()=>a(e.branchName),className:`grid grid-cols-1 sm:grid-cols-12 gap-2 sm:gap-3 px-4 py-3 items-center hover:bg-accent/40 transition-colors cursor-pointer text-xs`,children:[(0,P.jsxs)(`div`,{className:`sm:col-span-4 min-w-0 flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:r(`size-2 rounded-full shrink-0`,o?`bg-amber-400`:`bg-emerald-500`)}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,P.jsx)(`span`,{className:`truncate font-mono font-bold text-foreground`,title:e.branchName,children:e.branchName}),(0,P.jsx)(`span`,{className:`text-[9px] font-mono uppercase tracking-wider text-muted-foreground bg-muted px-1 rounded shrink-0`,children:e.mode===`in-place`?`In-place`:`Worktree`})]}),(0,P.jsxs)(`div`,{className:`text-[10px] text-muted-foreground font-mono truncate mt-0.5`,children:[e.repos.length,` `,e.repos.length===1?`repo`:`repos`,` • `,new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center gap-1.5 min-w-0`,children:e.assistants&&e.assistants.length>0?e.assistants.map(e=>(0,P.jsx)(`span`,{className:`inline-flex items-center`,title:`Configured AI: ${e}`,children:e===`antigravity`?(0,P.jsx)(w,{className:`size-3.5`}):e===`claude`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,P.jsx)(E,{className:`size-2`})}):e===`codex`?(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,P.jsx)(m,{className:`size-2`})}):(0,P.jsx)(`span`,{className:`grid size-3.5 place-items-center rounded bg-blue-600 text-white shadow-2xs`,children:(0,P.jsx)(T,{className:`size-2`})})},e)):(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`—`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:o?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-amber-600 dark:text-amber-400 font-semibold`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500`}),n.changedFiles,` modified`,l&&l.tone!==`idle`&&(0,P.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-0.5 font-normal`,children:[`(`,l.label,`)`]})]}):(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500`}),`Clean`]})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 font-mono text-[11px]`,children:s?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,P.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500 animate-pulse`}),n.runningServices,` active`]}):(0,P.jsx)(`span`,{className:`text-muted-foreground/70`,children:`Offline`})}),(0,P.jsx)(`div`,{className:`sm:col-span-2 flex items-center justify-end gap-1`,onClick:e=>e.stopPropagation(),children:(0,P.jsxs)(i,{size:`xs`,variant:`ghost`,onClick:()=>a(e.branchName),className:`gap-1 text-primary hover:text-primary`,children:[(0,P.jsx)(`span`,{children:`Inspect`}),(0,P.jsx)(c,{size:12})]})})]},e.id)})]})]}),J.length>0&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,P.jsxs)(`h2`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:[`Repository Worktree Allocations (`,J.length,`)`]}),(0,P.jsx)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:`Underlying git repos mapped across features`})]}),(0,P.jsx)(D,{className:`divide-y divide-border/60 overflow-hidden surface-card`,children:J.map(e=>(0,P.jsxs)(`div`,{className:`flex items-center justify-between p-3 text-xs`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0 font-mono`,children:[(0,P.jsx)(`span`,{className:`grid size-6 place-items-center rounded bg-muted/60 text-muted-foreground`,children:(0,P.jsx)(l,{size:13})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`font-bold text-foreground block truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground truncate block`,children:e.path})]})]}),(0,P.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 font-mono text-[11px] text-muted-foreground`,children:(0,P.jsxs)(`span`,{className:`rounded bg-muted px-2 py-0.5 text-foreground font-semibold`,children:[e.count,` `,e.count===1?`workspace worktree`:`workspace worktrees`]})})]},e.name))})]})]})}export{I as DashboardPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,t}from"./button-BDDZnIHx.js";import{t as n}from"./circle-plus-lmU1yNJd.js";import{Nt as r}from"./index-
|
|
1
|
+
import{g as e,t}from"./button-BDDZnIHx.js";import{t as n}from"./circle-plus-lmU1yNJd.js";import{Nt as r}from"./index-pxzwuRLq.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 +1 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,t as r}from"./button-BDDZnIHx.js";import{n as i}from"./CSPContext-BG7no5S_.js";import{n as a,t as o}from"./ScaffoldRepoInline-
|
|
1
|
+
import{_ as e,b as t,g as n,t as r}from"./button-BDDZnIHx.js";import{n as i}from"./CSPContext-BG7no5S_.js";import{n as a,t as o}from"./ScaffoldRepoInline-DWsd4vxF.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m}from"./alert-dialog-CCwlEjU2.js";import{d as h}from"./store-D7ixdVck.js";import{t as g}from"./trash-2-CtR35_eF.js";import{F as _,Ft as v,G as ee,It as y,J as b,Lt as x,a as S,c as C,d as w,f as T,l as E,o as D,s as O,st as k,tt as A,u as j,z as M}from"./index-pxzwuRLq.js";import{t as N}from"./badge-CAohJGj6.js";import{a as P,i as F,n as I,r as L,t as te}from"./empty-BdlgbifD.js";var R=t(e(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=h(),t=ee(),n=b(),V=k(),H=_(),U=A(),W=M(),[G,K]=(0,R.useState)(null),[q,J]=(0,R.useState)(null),[Y,X]=(0,R.useState)(null),Z=(0,R.useMemo)(()=>{let e={};for(let t of V.data??[])t.projectId&&(e[t.projectId]=(e[t.projectId]??0)+1);return e},[V.data]),Q=()=>{J(null),K(B)},ne=e=>{J(null),K({editingId:e.id,name:e.name,description:e.description??``,repoPaths:e.repos.map(e=>e.path)})},re=e=>{K(t=>t&&{...t,repoPaths:t.repoPaths.includes(e.path)?t.repoPaths.filter(t=>t!==e.path):[...t.repoPaths,e.path]})},ie=async()=>{if(G){J(null);try{G.editingId?await U.mutateAsync({id:G.editingId,name:G.name,description:G.description||null,repos:G.repoPaths}):await H.mutateAsync({name:G.name,description:G.description||void 0,repos:G.repoPaths}),K(null)}catch(e){J(e instanceof Error?e.message:String(e))}}},ae=async()=>{if(Y)try{await W.mutateAsync(Y.id)}finally{X(null)}},oe=!!(G&&G.name.trim()&&G.repoPaths.length>0),$=H.isPending||U.isPending;return(0,z.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,z.jsxs)(`header`,{className:`mb-6 flex items-center justify-between gap-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(v,{}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(S,{className:`size-6`})}):(t.data??[]).length===0?(0,z.jsxs)(te,{className:`border border-border border-dashed`,children:[(0,z.jsxs)(L,{children:[(0,z.jsx)(F,{variant:`icon`,children:(0,z.jsx)(x,{})}),(0,z.jsx)(P,{children:`No projects yet`}),(0,z.jsx)(I,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(v,{}),` New project`]})]}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-3`,children:(t.data??[]).map(t=>(0,z.jsx)(`li`,{className:`rounded-xl border border-border bg-card p-4 transition-colors hover:border-foreground/15`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:t.name}),(Z[t.id]??0)>0&&(0,z.jsxs)(N,{variant:`secondary`,children:[Z[t.id],` workspace`,Z[t.id]===1?``:`s`]})]}),t.description&&(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:t.description}),(0,z.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:t.repos.map(e=>(0,z.jsxs)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[e.path,(0,z.jsxs)(`span`,{className:`ml-2 text-muted-foreground/60`,children:[`[`,e.defaultBranch,`]`]})]},e.path))})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,z.jsxs)(r,{size:`sm`,onClick:()=>e(`/new?project=${encodeURIComponent(t.id)}`),children:[(0,z.jsx)(y,{}),` Start work`]}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Edit ${t.name}`,onClick:()=>ne(t),children:(0,z.jsx)(c,{})}),(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)(D,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(w,{className:`max-w-lg`,children:[(0,z.jsxs)(E,{children:[(0,z.jsx)(T,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(O,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,z.jsxs)(j,{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)(a,{repos:n.data??[],selectedPaths:G?.repoPaths??[],onToggle:re,loading:n.isLoading,emptyHint:`No repositories found in your dev directory.`}),(0,z.jsx)(o,{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)(C,{children:[(0,z.jsx)(r,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(r,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(S,{}):null,G?.editingId?`Save changes`:`Create project`]})]})]})}),(0,z.jsx)(m,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,z.jsxs)(d,{children:[(0,z.jsxs)(s,{children:[(0,z.jsxs)(p,{children:[`Remove “`,Y?.name,`”?`]}),(0,z.jsx)(f,{children:`This only removes the project from the registry — repositories and workspaces on disk are not touched.`})]}),(0,z.jsxs)(l,{children:[(0,z.jsx)(u,{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)(S,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
|