@mrpatronz/nexusflow 0.2.18 ā 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/dist/analyzers/index.d.ts +23 -0
- package/dist/analyzers/index.d.ts.map +1 -1
- package/dist/analyzers/index.js +62 -0
- package/dist/analyzers/index.js.map +1 -1
- package/dist/commands/commands.test.js +20 -6
- package/dist/commands/commands.test.js.map +1 -1
- package/dist/commands/commit.d.ts +2 -0
- package/dist/commands/commit.d.ts.map +1 -1
- package/dist/commands/commit.js +27 -5
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/diff.d.ts +9 -2
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +36 -12
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/handoff.js +2 -2
- package/dist/commands/handoff.js.map +1 -1
- package/dist/commands/refresh.d.ts +4 -2
- package/dist/commands/refresh.d.ts.map +1 -1
- package/dist/commands/refresh.js +20 -36
- package/dist/commands/refresh.js.map +1 -1
- package/dist/commands/schedule.d.ts +35 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +151 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +58 -50
- package/dist/commands/sync.js.map +1 -1
- package/dist/core/analysis-cache.d.ts +58 -0
- package/dist/core/analysis-cache.d.ts.map +1 -0
- package/dist/core/analysis-cache.js +116 -0
- package/dist/core/analysis-cache.js.map +1 -0
- package/dist/core/analysis-cache.test.d.ts +2 -0
- package/dist/core/analysis-cache.test.d.ts.map +1 -0
- package/dist/core/analysis-cache.test.js +108 -0
- package/dist/core/analysis-cache.test.js.map +1 -0
- package/dist/core/refresh.d.ts +41 -0
- package/dist/core/refresh.d.ts.map +1 -0
- package/dist/core/refresh.js +60 -0
- package/dist/core/refresh.js.map +1 -0
- package/dist/core/scheduler.d.ts +117 -0
- package/dist/core/scheduler.d.ts.map +1 -0
- package/dist/core/scheduler.js +247 -0
- package/dist/core/scheduler.js.map +1 -0
- package/dist/core/scheduler.test.d.ts +2 -0
- package/dist/core/scheduler.test.d.ts.map +1 -0
- package/dist/core/scheduler.test.js +111 -0
- package/dist/core/scheduler.test.js.map +1 -0
- package/dist/core/sync.d.ts +50 -0
- package/dist/core/sync.d.ts.map +1 -0
- package/dist/core/sync.js +92 -0
- package/dist/core/sync.js.map +1 -0
- package/dist/core/workspace-state.d.ts +51 -0
- package/dist/core/workspace-state.d.ts.map +1 -0
- package/dist/core/workspace-state.js +108 -0
- package/dist/core/workspace-state.js.map +1 -0
- package/dist/core/workspace-state.test.d.ts +2 -0
- package/dist/core/workspace-state.test.d.ts.map +1 -0
- package/dist/core/workspace-state.test.js +84 -0
- package/dist/core/workspace-state.test.js.map +1 -0
- package/dist/generators/index.d.ts +7 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +14 -1
- package/dist/generators/index.js.map +1 -1
- package/dist/gui/assets/index-Bdbld6yY.css +1 -0
- package/dist/gui/assets/index-D8iJPvnk.js +26 -0
- package/dist/gui/index.html +2 -2
- package/dist/index.js +107 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +42 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +175 -13
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +66 -0
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/multi-git.d.ts +54 -8
- package/dist/utils/multi-git.d.ts.map +1 -1
- package/dist/utils/multi-git.js +129 -21
- package/dist/utils/multi-git.js.map +1 -1
- package/dist/utils/multi-git.test.d.ts +2 -0
- package/dist/utils/multi-git.test.d.ts.map +1 -0
- package/dist/utils/multi-git.test.js +125 -0
- package/dist/utils/multi-git.test.js.map +1 -0
- package/package.json +13 -1
- package/.agents/skills/ccc/SKILL.md +0 -71
- package/.agents/skills/ccc/references/management.md +0 -110
- package/.agents/skills/ccc/references/settings.md +0 -126
- package/.github/dependabot.yml +0 -52
- package/.github/workflows/ci.yml +0 -44
- package/.github/workflows/dependabot-merge.yml +0 -53
- package/.github/workflows/release-desktop.yml +0 -67
- package/.github/workflows/release-npm.yml +0 -65
- package/.github/workflows/release-vscode.yml +0 -61
- package/.vscode/launch.json +0 -17
- package/.vscode/tasks.json +0 -17
- package/GETTING_STARTED.md +0 -114
- package/desktop/build-installer.js +0 -228
- package/desktop/build.js +0 -118
- package/desktop/installer/nexusflow.iss +0 -35
- package/desktop/neutralino.config.json +0 -39
- package/desktop/package-lock.json +0 -1060
- package/desktop/package.json +0 -14
- package/dist/gui/assets/index-CB-jWded.css +0 -1
- package/dist/gui/assets/index-DDXpZZu3.js +0 -25
- package/extension/media/icon.svg +0 -1
- package/extension/package-lock.json +0 -6044
- package/extension/package.json +0 -117
- package/extension/src/extension.ts +0 -653
- package/extension/tsconfig.json +0 -21
- package/gui/README.md +0 -73
- package/gui/e2e/wizard.spec.ts +0 -346
- package/gui/eslint.config.js +0 -26
- package/gui/index.html +0 -17
- package/gui/package-lock.json +0 -3079
- package/gui/package.json +0 -36
- package/gui/playwright.config.ts +0 -41
- package/gui/public/app_logo.png +0 -0
- package/gui/public/favicon.svg +0 -1
- package/gui/public/icons.svg +0 -24
- package/gui/src/App.css +0 -1
- package/gui/src/App.tsx +0 -3632
- package/gui/src/assets/hero.png +0 -0
- package/gui/src/assets/react.svg +0 -1
- package/gui/src/assets/vite.svg +0 -1
- package/gui/src/features/changes/ChangesViewer.tsx +0 -388
- package/gui/src/features/knowledge/KnowledgeBase.tsx +0 -84
- package/gui/src/features/onboarding/OnboardingWizard.tsx +0 -230
- package/gui/src/features/plan/ImplementationPlan.tsx +0 -32
- package/gui/src/features/services/ServiceConsole.tsx +0 -250
- package/gui/src/features/sessions/SessionHistory.tsx +0 -195
- package/gui/src/features/workspace/WorkspaceList.tsx +0 -666
- package/gui/src/index.css +0 -152
- package/gui/src/main.tsx +0 -94
- package/gui/src/types.ts +0 -62
- package/gui/tsconfig.app.json +0 -25
- package/gui/tsconfig.json +0 -7
- package/gui/tsconfig.node.json +0 -24
- package/gui/vite.config.ts +0 -12
- package/resources/workflows/plan-implement-review.md +0 -8
- package/resources/workflows/research-verify.md +0 -6
- package/resources/workflows/solo-developer.md +0 -3
- package/scripts/simulate-workspaces.ts +0 -55
- package/skills-lock.json +0 -11
- package/src/analyzers/detect-apis.ts +0 -290
- package/src/analyzers/detect-deps.ts +0 -315
- package/src/analyzers/detect-existing.ts +0 -74
- package/src/analyzers/detect-ports.ts +0 -110
- package/src/analyzers/index.ts +0 -97
- package/src/analyzers/messaging-analyzer.ts +0 -254
- package/src/analyzers/readme-summarizer.ts +0 -102
- package/src/analyzers/run-analyzer.ts +0 -269
- package/src/analyzers/tech-stack.ts +0 -283
- package/src/commands/adapter.ts +0 -348
- package/src/commands/add-repo.ts +0 -156
- package/src/commands/commands.test.ts +0 -156
- package/src/commands/commit.ts +0 -131
- package/src/commands/config.ts +0 -52
- package/src/commands/create.ts +0 -204
- package/src/commands/desktop.ts +0 -128
- package/src/commands/diff.ts +0 -125
- package/src/commands/doctor.ts +0 -370
- package/src/commands/handoff.ts +0 -266
- package/src/commands/init.ts +0 -134
- package/src/commands/list.ts +0 -46
- package/src/commands/logs.ts +0 -63
- package/src/commands/mcp.ts +0 -94
- package/src/commands/open.ts +0 -129
- package/src/commands/refresh.ts +0 -137
- package/src/commands/remove.ts +0 -98
- package/src/commands/start.ts +0 -117
- package/src/commands/status.ts +0 -54
- package/src/commands/stop.ts +0 -55
- package/src/commands/sync.ts +0 -147
- package/src/commands/tui.ts +0 -484
- package/src/commands/ui.ts +0 -111
- package/src/core/adapters/local-storage.ts +0 -66
- package/src/core/adapters/obsidian-storage.ts +0 -151
- package/src/core/adapters/registry.ts +0 -44
- package/src/core/adapters/storage.test.ts +0 -174
- package/src/core/adapters/vault-storage.ts +0 -86
- package/src/core/config.test.ts +0 -96
- package/src/core/config.ts +0 -140
- package/src/core/graph.ts +0 -344
- package/src/core/plugins/index.ts +0 -17
- package/src/core/plugins/loader.ts +0 -36
- package/src/core/ports/storage.ts +0 -71
- package/src/core/scanner.test.ts +0 -61
- package/src/core/scanner.ts +0 -91
- package/src/core/storage.ts +0 -37
- package/src/core/workspace.ts +0 -487
- package/src/core/worktree.ts +0 -120
- package/src/generators/antigravity.ts +0 -32
- package/src/generators/base.ts +0 -243
- package/src/generators/claude.ts +0 -34
- package/src/generators/codex.ts +0 -48
- package/src/generators/copilot.ts +0 -56
- package/src/generators/cursor.ts +0 -44
- package/src/generators/diff-context.ts +0 -75
- package/src/generators/index.ts +0 -322
- package/src/generators/map-generator.test.ts +0 -159
- package/src/generators/map-generator.ts +0 -539
- package/src/generators/plan-generator.ts +0 -483
- package/src/generators/skills-generator.ts +0 -259
- package/src/index.ts +0 -539
- package/src/mcp/server.ts +0 -294
- package/src/orchestration/detect.ts +0 -313
- package/src/orchestration/index.ts +0 -7
- package/src/orchestration/runner.ts +0 -283
- package/src/server.test.ts +0 -618
- package/src/server.ts +0 -1314
- package/src/types.ts +0 -415
- package/src/utils/detect-ai.test.ts +0 -44
- package/src/utils/detect-ai.ts +0 -84
- package/src/utils/detect-editors.test.ts +0 -48
- package/src/utils/detect-editors.ts +0 -57
- package/src/utils/git.test.ts +0 -74
- package/src/utils/git.ts +0 -117
- package/src/utils/local-ai.test.ts +0 -130
- package/src/utils/local-ai.ts +0 -116
- package/src/utils/multi-git.ts +0 -313
- package/src/utils/prompts.ts +0 -209
- package/src/utils/session-finder.ts +0 -483
- package/src/utils/system-scanner.test.ts +0 -89
- package/src/utils/system-scanner.ts +0 -96
- package/src/utils/update-check.ts +0 -286
- package/src/utils/workflow-advisor.ts +0 -118
- package/src/utils/workflows.test.ts +0 -114
- package/src/utils/workflows.ts +0 -178
- package/tsconfig.json +0 -19
- package/vitest.config.ts +0 -14
package/src/commands/remove.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/remove
|
|
3
|
-
* Deletes a NexusFlow workspace and cleanly removes/prunes its git worktrees.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import ora from 'ora';
|
|
8
|
-
import { select, confirm, search } from '@inquirer/prompts';
|
|
9
|
-
import * as path from 'node:path';
|
|
10
|
-
import * as fs from 'node:fs/promises';
|
|
11
|
-
|
|
12
|
-
import { loadConfig } from '../core/config.js';
|
|
13
|
-
import { listWorkspaces, deleteWorkspace } from '../core/workspace.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Executes the remove command.
|
|
17
|
-
*
|
|
18
|
-
* @param workspaceArg - Optional workspace path or branch name from CLI.
|
|
19
|
-
*/
|
|
20
|
-
export async function removeCommand(workspaceArg?: string): Promise<void> {
|
|
21
|
-
console.log(chalk.bold.red('\nšļø NexusFlow ā Deleting Workspace\n'));
|
|
22
|
-
|
|
23
|
-
const config = await loadConfig();
|
|
24
|
-
let workspacePath: string | null = null;
|
|
25
|
-
let workspaceName = '';
|
|
26
|
-
|
|
27
|
-
if (workspaceArg) {
|
|
28
|
-
const resolvedPath = path.isAbsolute(workspaceArg)
|
|
29
|
-
? workspaceArg
|
|
30
|
-
: path.resolve(config.workspacesDir, workspaceArg);
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
await fs.access(resolvedPath);
|
|
34
|
-
workspacePath = resolvedPath;
|
|
35
|
-
workspaceName = path.basename(resolvedPath);
|
|
36
|
-
} catch {
|
|
37
|
-
const directPath = path.join(config.workspacesDir, workspaceArg);
|
|
38
|
-
try {
|
|
39
|
-
await fs.access(directPath);
|
|
40
|
-
workspacePath = directPath;
|
|
41
|
-
workspaceName = workspaceArg;
|
|
42
|
-
} catch {
|
|
43
|
-
console.error(chalk.red(`ā Workspace not found: ${workspaceArg}`));
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
49
|
-
|
|
50
|
-
if (workspaces.length === 0) {
|
|
51
|
-
console.log(chalk.yellow('No workspaces found.\n'));
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const selected = await search({
|
|
56
|
-
message: 'Search and select a workspace to delete:',
|
|
57
|
-
source: async (input) => {
|
|
58
|
-
const query = (input || '').toLowerCase();
|
|
59
|
-
const filtered = workspaces.filter(
|
|
60
|
-
(ws) =>
|
|
61
|
-
ws.branchName.toLowerCase().includes(query) ||
|
|
62
|
-
ws.workspacePath.toLowerCase().includes(query)
|
|
63
|
-
);
|
|
64
|
-
return filtered.map((ws) => ({
|
|
65
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
66
|
-
value: ws,
|
|
67
|
-
}));
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
workspacePath = selected.workspacePath;
|
|
72
|
-
workspaceName = selected.branchName;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!workspacePath) return;
|
|
76
|
-
|
|
77
|
-
const confirmDelete = await confirm({
|
|
78
|
-
message: `Are you absolutely sure you want to delete the workspace "${workspaceName}"?\n This will FORCE remove all associated git worktrees and delete the folder from disk.`,
|
|
79
|
-
default: false,
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
if (!confirmDelete) {
|
|
83
|
-
console.log(chalk.yellow('\nCancelled.\n'));
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const spinner = ora('Deleting workspace and pruning git worktrees...').start();
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
await deleteWorkspace(workspacePath);
|
|
91
|
-
spinner.succeed(`Successfully deleted workspace ${chalk.bold(workspaceName)}`);
|
|
92
|
-
console.log();
|
|
93
|
-
} catch (error) {
|
|
94
|
-
spinner.fail(`Failed to delete workspace ${workspaceName}`);
|
|
95
|
-
console.error(chalk.red(` ${error instanceof Error ? error.message : String(error)}`));
|
|
96
|
-
console.log();
|
|
97
|
-
}
|
|
98
|
-
}
|
package/src/commands/start.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/start
|
|
3
|
-
* Starts all services in the current or specified workspace.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import * as path from 'node:path';
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import { select, confirm } from '@inquirer/prompts';
|
|
9
|
-
|
|
10
|
-
import { loadConfig } from '../core/config.js';
|
|
11
|
-
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
12
|
-
import {
|
|
13
|
-
detectAllServices,
|
|
14
|
-
detectOrchestrationTools,
|
|
15
|
-
startServices,
|
|
16
|
-
} from '../orchestration/index.js';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Start services for a workspace.
|
|
20
|
-
* If run inside a workspace dir, auto-detects it.
|
|
21
|
-
* Otherwise, prompts user to pick one.
|
|
22
|
-
*
|
|
23
|
-
* @param workspaceArg - Optional workspace path from CLI.
|
|
24
|
-
*/
|
|
25
|
-
export async function startCommand(workspaceArg?: string): Promise<void> {
|
|
26
|
-
console.log(chalk.bold.cyan('\nā¶ NexusFlow ā Start Services\n'));
|
|
27
|
-
|
|
28
|
-
const workspacePath = await resolveWorkspace(workspaceArg);
|
|
29
|
-
if (!workspacePath) return;
|
|
30
|
-
|
|
31
|
-
// Check for existing orchestration tools first
|
|
32
|
-
const tools = await detectOrchestrationTools(workspacePath);
|
|
33
|
-
if (tools.length > 0) {
|
|
34
|
-
console.log(chalk.cyan('Detected orchestration tools:'));
|
|
35
|
-
for (const tool of tools) {
|
|
36
|
-
console.log(` ${chalk.bold(tool.tool)} ā ${chalk.dim(tool.configPath)}`);
|
|
37
|
-
console.log(` Start: ${chalk.dim(tool.startCommand)}`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const useExisting = await confirm({
|
|
41
|
-
message: 'Use detected orchestration tool instead of NexusFlow runner?',
|
|
42
|
-
default: false,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
if (useExisting) {
|
|
46
|
-
console.log(chalk.dim(`\n Run manually: ${tools[0]!.startCommand}\n`));
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Auto-detect services
|
|
52
|
-
console.log(chalk.cyan('Detecting services...'));
|
|
53
|
-
const services = await detectAllServices(workspacePath);
|
|
54
|
-
|
|
55
|
-
if (services.length === 0) {
|
|
56
|
-
console.log(chalk.yellow(' No startable services found in workspace.'));
|
|
57
|
-
console.log(chalk.dim(' Make sure projects have package.json scripts, .csproj, or similar.\n'));
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
console.log(chalk.green(` Found ${services.length} service(s):\n`));
|
|
62
|
-
for (const svc of services) {
|
|
63
|
-
const portStr = svc.port ? chalk.dim(` :${svc.port}`) : '';
|
|
64
|
-
console.log(` ${chalk.bold(svc.name)}${portStr} ā ${chalk.dim(`${svc.command} ${svc.args.join(' ')}`)}`);
|
|
65
|
-
}
|
|
66
|
-
console.log();
|
|
67
|
-
|
|
68
|
-
const shouldStart = await confirm({
|
|
69
|
-
message: `Start ${services.length} service(s)?`,
|
|
70
|
-
default: true,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
if (!shouldStart) {
|
|
74
|
-
console.log(chalk.dim(' Cancelled.\n'));
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const logDir = path.join(workspacePath, '.nexusflow-logs');
|
|
79
|
-
await startServices(services, workspacePath, logDir);
|
|
80
|
-
|
|
81
|
-
console.log(chalk.bold.green('\nā
Services started!\n'));
|
|
82
|
-
console.log(chalk.dim(' View logs: nexusflow logs'));
|
|
83
|
-
console.log(chalk.dim(' Stop all: nexusflow stop'));
|
|
84
|
-
console.log(chalk.dim(` Log dir: ${logDir}\n`));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Resolves a workspace path from argument, cwd, or user prompt.
|
|
89
|
-
*/
|
|
90
|
-
async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
|
|
91
|
-
// If argument provided, use it
|
|
92
|
-
if (workspaceArg) return workspaceArg;
|
|
93
|
-
|
|
94
|
-
// Check if CWD is a workspace
|
|
95
|
-
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
96
|
-
if (cwdFeature) return cwdFeature.workspacePath;
|
|
97
|
-
|
|
98
|
-
// Otherwise, list workspaces and let user pick
|
|
99
|
-
const config = await loadConfig();
|
|
100
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
101
|
-
|
|
102
|
-
if (workspaces.length === 0) {
|
|
103
|
-
console.log(chalk.yellow('No workspaces found.'));
|
|
104
|
-
console.log(chalk.dim(' Run "nexusflow create" first.\n'));
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const selected = await select({
|
|
109
|
-
message: 'Select a workspace:',
|
|
110
|
-
choices: workspaces.map((ws) => ({
|
|
111
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
112
|
-
value: ws.workspacePath,
|
|
113
|
-
})),
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
return selected;
|
|
117
|
-
}
|
package/src/commands/status.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/status
|
|
3
|
-
* Shows the status of all services in a workspace.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import { select } from '@inquirer/prompts';
|
|
8
|
-
|
|
9
|
-
import { loadConfig } from '../core/config.js';
|
|
10
|
-
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
11
|
-
import { getServiceStatus, loadRunningState } from '../orchestration/index.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Shows status of running services for a workspace.
|
|
15
|
-
*
|
|
16
|
-
* @param workspaceArg - Optional workspace path from CLI.
|
|
17
|
-
*/
|
|
18
|
-
export async function statusCommand(workspaceArg?: string): Promise<void> {
|
|
19
|
-
console.log(chalk.bold.cyan('\nš NexusFlow ā Service Status\n'));
|
|
20
|
-
|
|
21
|
-
const workspacePath = await resolveWorkspace(workspaceArg);
|
|
22
|
-
if (!workspacePath) return;
|
|
23
|
-
|
|
24
|
-
await getServiceStatus(workspacePath);
|
|
25
|
-
console.log();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Resolves a workspace path from argument, cwd, or user prompt.
|
|
30
|
-
*/
|
|
31
|
-
async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
|
|
32
|
-
if (workspaceArg) return workspaceArg;
|
|
33
|
-
|
|
34
|
-
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
35
|
-
if (cwdFeature) return cwdFeature.workspacePath;
|
|
36
|
-
|
|
37
|
-
const config = await loadConfig();
|
|
38
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
39
|
-
|
|
40
|
-
if (workspaces.length === 0) {
|
|
41
|
-
console.log(chalk.yellow('No workspaces found.\n'));
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const selected = await select({
|
|
46
|
-
message: 'Select a workspace:',
|
|
47
|
-
choices: workspaces.map((ws) => ({
|
|
48
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
49
|
-
value: ws.workspacePath,
|
|
50
|
-
})),
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
return selected;
|
|
54
|
-
}
|
package/src/commands/stop.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/stop
|
|
3
|
-
* Stops all running services in the current or specified workspace.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import { select } from '@inquirer/prompts';
|
|
8
|
-
|
|
9
|
-
import { loadConfig } from '../core/config.js';
|
|
10
|
-
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
11
|
-
import { stopServices } from '../orchestration/index.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Stop all services for a workspace.
|
|
15
|
-
*
|
|
16
|
-
* @param workspaceArg - Optional workspace path from CLI.
|
|
17
|
-
*/
|
|
18
|
-
export async function stopCommand(workspaceArg?: string): Promise<void> {
|
|
19
|
-
console.log(chalk.bold.cyan('\nā¹ NexusFlow ā Stop Services\n'));
|
|
20
|
-
|
|
21
|
-
const workspacePath = await resolveWorkspace(workspaceArg);
|
|
22
|
-
if (!workspacePath) return;
|
|
23
|
-
|
|
24
|
-
await stopServices(workspacePath);
|
|
25
|
-
|
|
26
|
-
console.log(chalk.bold.green('\nā
All services stopped.\n'));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Resolves a workspace path from argument, cwd, or user prompt.
|
|
31
|
-
*/
|
|
32
|
-
async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
|
|
33
|
-
if (workspaceArg) return workspaceArg;
|
|
34
|
-
|
|
35
|
-
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
36
|
-
if (cwdFeature) return cwdFeature.workspacePath;
|
|
37
|
-
|
|
38
|
-
const config = await loadConfig();
|
|
39
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
40
|
-
|
|
41
|
-
if (workspaces.length === 0) {
|
|
42
|
-
console.log(chalk.yellow('No workspaces found.\n'));
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const selected = await select({
|
|
47
|
-
message: 'Select a workspace to stop services for:',
|
|
48
|
-
choices: workspaces.map((ws) => ({
|
|
49
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
50
|
-
value: ws.workspacePath,
|
|
51
|
-
})),
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
return selected;
|
|
55
|
-
}
|
package/src/commands/sync.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/sync
|
|
3
|
-
* Syncs the active workspace by fetching and rebasing all repos onto their base branch.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import { select, search } from '@inquirer/prompts';
|
|
8
|
-
import * as path from 'node:path';
|
|
9
|
-
import * as fs from 'node:fs/promises';
|
|
10
|
-
|
|
11
|
-
import { loadConfig } from '../core/config.js';
|
|
12
|
-
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
13
|
-
import { getWorkspaceRepos, rebaseRepo } from '../utils/multi-git.js';
|
|
14
|
-
import { analyzeAllRepos } from '../analyzers/index.js';
|
|
15
|
-
import { generateContextFiles } from '../generators/index.js';
|
|
16
|
-
import type { WorkspaceContext } from '../types.js';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Executes the sync command.
|
|
20
|
-
*
|
|
21
|
-
* @param workspaceArg - Optional workspace path from CLI.
|
|
22
|
-
*/
|
|
23
|
-
export async function syncCommand(workspaceArg?: string): Promise<void> {
|
|
24
|
-
console.log(chalk.bold.cyan('\nš NexusFlow ā Syncing Workspace\n'));
|
|
25
|
-
|
|
26
|
-
const workspacePath = await resolveWorkspace(workspaceArg);
|
|
27
|
-
if (!workspacePath) return;
|
|
28
|
-
|
|
29
|
-
const feature = await loadFeatureConfig(workspacePath);
|
|
30
|
-
if (!feature) {
|
|
31
|
-
console.error(chalk.red('ā Failed to load workspace configuration. Ensure nexusflow.json exists.'));
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
console.log(chalk.bold(`Syncing workspace: ${chalk.cyan(feature.branchName)}`));
|
|
36
|
-
console.log(chalk.dim(`Path: ${workspacePath}\n`));
|
|
37
|
-
|
|
38
|
-
let repos;
|
|
39
|
-
try {
|
|
40
|
-
repos = await getWorkspaceRepos(workspacePath);
|
|
41
|
-
} catch (error) {
|
|
42
|
-
console.error(chalk.red(`ā Failed to retrieve repos: ${error instanceof Error ? error.message : String(error)}`));
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
let syncedCount = 0;
|
|
47
|
-
let conflictCount = 0;
|
|
48
|
-
|
|
49
|
-
for (const repo of repos) {
|
|
50
|
-
console.log(`Repository: ${chalk.bold(repo.name)}`);
|
|
51
|
-
const defaultBranch = repo.defaultBranch || 'main';
|
|
52
|
-
|
|
53
|
-
const spinner = chalk.dim(' Rebasing...');
|
|
54
|
-
process.stdout.write(spinner);
|
|
55
|
-
|
|
56
|
-
const result = await rebaseRepo(repo.path, defaultBranch);
|
|
57
|
-
|
|
58
|
-
// Clear rebase message line
|
|
59
|
-
process.stdout.write('\r' + ' '.repeat(spinner.length) + '\r');
|
|
60
|
-
|
|
61
|
-
if (result.success) {
|
|
62
|
-
console.log(` ${chalk.green('ā
')} Synced (${result.message})`);
|
|
63
|
-
syncedCount++;
|
|
64
|
-
} else {
|
|
65
|
-
console.log(` ${chalk.red('ā ļø')} Conflict: ${result.message}`);
|
|
66
|
-
if (result.conflict) {
|
|
67
|
-
console.log(chalk.dim(result.conflict.split('\n').map(l => ` ${l}`).slice(0, 5).join('\n')));
|
|
68
|
-
}
|
|
69
|
-
conflictCount++;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
console.log(`\nš ${chalk.bold('Summary:')} ${syncedCount} synced, ${conflictCount} conflict(s)\n`);
|
|
74
|
-
|
|
75
|
-
if (syncedCount > 0) {
|
|
76
|
-
console.log(chalk.cyan('Regenerating architecture maps and context...'));
|
|
77
|
-
try {
|
|
78
|
-
const allRepos = await Promise.all(feature.repos.map(r => {
|
|
79
|
-
const repoName = path.basename(r);
|
|
80
|
-
return {
|
|
81
|
-
name: repoName,
|
|
82
|
-
path: r,
|
|
83
|
-
defaultBranch: 'main',
|
|
84
|
-
};
|
|
85
|
-
}));
|
|
86
|
-
|
|
87
|
-
const analysis = await analyzeAllRepos(allRepos);
|
|
88
|
-
const ctx: WorkspaceContext = {
|
|
89
|
-
feature,
|
|
90
|
-
repos: allRepos,
|
|
91
|
-
analysis,
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
await generateContextFiles(ctx, feature.assistants, workspacePath);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
console.log(chalk.green('ā
Workspace maps and contexts successfully updated.\n'));
|
|
98
|
-
} catch (error) {
|
|
99
|
-
console.error(chalk.red(`ā Failed to regenerate maps: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Resolves a workspace path from argument, cwd, or user prompt.
|
|
106
|
-
*/
|
|
107
|
-
async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
|
|
108
|
-
if (workspaceArg) {
|
|
109
|
-
const absolutePath = path.resolve(workspaceArg);
|
|
110
|
-
try {
|
|
111
|
-
await fs.access(path.join(absolutePath, 'nexusflow.json'));
|
|
112
|
-
return absolutePath;
|
|
113
|
-
} catch {
|
|
114
|
-
console.error(chalk.red(`ā Invalid workspace: No nexusflow.json found at ${absolutePath}`));
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
120
|
-
if (cwdFeature) return cwdFeature.workspacePath;
|
|
121
|
-
|
|
122
|
-
const config = await loadConfig();
|
|
123
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
124
|
-
|
|
125
|
-
if (workspaces.length === 0) {
|
|
126
|
-
console.log(chalk.yellow('No workspaces found.\n'));
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const selected = await search({
|
|
131
|
-
message: 'Search and select a workspace to sync:',
|
|
132
|
-
source: async (input) => {
|
|
133
|
-
const query = (input || '').toLowerCase();
|
|
134
|
-
const filtered = workspaces.filter(
|
|
135
|
-
(ws) =>
|
|
136
|
-
ws.branchName.toLowerCase().includes(query) ||
|
|
137
|
-
ws.workspacePath.toLowerCase().includes(query)
|
|
138
|
-
);
|
|
139
|
-
return filtered.map((ws) => ({
|
|
140
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
141
|
-
value: ws.workspacePath,
|
|
142
|
-
}));
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
return selected;
|
|
147
|
-
}
|