@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/init.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/init
|
|
3
|
-
* Initializes the NexusFlow configuration.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import { input, confirm, select } from '@inquirer/prompts';
|
|
8
|
-
import path from 'node:path';
|
|
9
|
-
import os from 'node:os';
|
|
10
|
-
|
|
11
|
-
import { loadConfig, saveConfig, ensureConfigDir } from '../core/config.js';
|
|
12
|
-
import { scanSystemSpecs } from '../utils/system-scanner.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Initializes NexusFlow configuration interactively.
|
|
16
|
-
* Creates ~/.nexusflow/config.json with user preferences.
|
|
17
|
-
*/
|
|
18
|
-
export async function initCommand(): Promise<void> {
|
|
19
|
-
console.log(chalk.bold.cyan('\nāļø NexusFlow ā Initialize\n'));
|
|
20
|
-
|
|
21
|
-
await ensureConfigDir();
|
|
22
|
-
const existing = await loadConfig();
|
|
23
|
-
|
|
24
|
-
// āā 1. Basic Directories āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
25
|
-
const devDir = await input({
|
|
26
|
-
message: 'Development directory (where your repos live):',
|
|
27
|
-
default: existing.devDir || path.join(os.homedir(), 'dev'),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const workspacesDir = await input({
|
|
31
|
-
message: 'Workspaces directory (where feature workspaces are created):',
|
|
32
|
-
default: existing.workspacesDir || path.join(devDir, 'workspaces'),
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const scanDepth = await input({
|
|
36
|
-
message: 'How deep to scan for repos (directory levels):',
|
|
37
|
-
default: String(existing.scanDepth || 2),
|
|
38
|
-
validate: (value: string) => {
|
|
39
|
-
const num = parseInt(value, 10);
|
|
40
|
-
if (isNaN(num) || num < 1 || num > 10) return 'Enter a number between 1 and 10';
|
|
41
|
-
return true;
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// āā 2. Local AI Scanner & Config āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
46
|
-
console.log(chalk.cyan('\nProbing system hardware for local AI capabilities...'));
|
|
47
|
-
let specs;
|
|
48
|
-
try {
|
|
49
|
-
specs = await scanSystemSpecs();
|
|
50
|
-
} catch (error) {
|
|
51
|
-
specs = {
|
|
52
|
-
totalRamGb: 8,
|
|
53
|
-
gpuName: 'Unknown/Integrated',
|
|
54
|
-
hasHardwareAcceleration: false,
|
|
55
|
-
recommendedModel: 'qwen2.5-coder:1.5b',
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
console.log(chalk.dim(` RAM Detected: ${specs.totalRamGb} GB`));
|
|
59
|
-
console.log(chalk.dim(` GPU Detected: ${specs.gpuName}`));
|
|
60
|
-
console.log(chalk.dim(` Recommended model: ${chalk.bold(specs.recommendedModel)}`));
|
|
61
|
-
|
|
62
|
-
const enableLlm = await confirm({
|
|
63
|
-
message: 'Enable Local AI Co-processor (Ollama/LM Studio)?',
|
|
64
|
-
default: existing.localLlm?.enabled ?? false,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
let localLlmConfig = existing.localLlm || {
|
|
68
|
-
enabled: false,
|
|
69
|
-
provider: 'ollama',
|
|
70
|
-
endpoint: 'http://localhost:11434',
|
|
71
|
-
model: specs.recommendedModel,
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
if (enableLlm) {
|
|
75
|
-
const provider = await select({
|
|
76
|
-
message: 'Local AI Provider:',
|
|
77
|
-
choices: [
|
|
78
|
-
{ name: 'Ollama', value: 'ollama' as const },
|
|
79
|
-
{ name: 'OpenAI-Compatible (e.g. LM Studio, Llama.cpp)', value: 'openai-compatible' as const },
|
|
80
|
-
],
|
|
81
|
-
default: existing.localLlm?.provider || 'ollama',
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const defaultEndpoint = provider === 'ollama' ? 'http://localhost:11434' : 'http://localhost:1234';
|
|
85
|
-
const endpoint = await input({
|
|
86
|
-
message: 'Local AI Endpoint URL:',
|
|
87
|
-
default: existing.localLlm?.endpoint || defaultEndpoint,
|
|
88
|
-
validate: (value: string) => {
|
|
89
|
-
const trimmed = value.trim();
|
|
90
|
-
if (!trimmed.startsWith('http://') && !trimmed.startsWith('https://')) {
|
|
91
|
-
return 'Endpoint must start with http:// or https://';
|
|
92
|
-
}
|
|
93
|
-
try {
|
|
94
|
-
new URL(trimmed);
|
|
95
|
-
return true;
|
|
96
|
-
} catch {
|
|
97
|
-
return 'Please enter a valid URL';
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const model = await input({
|
|
103
|
-
message: `Local LLM Model Name (Recommended: ${specs.recommendedModel}):`,
|
|
104
|
-
default: existing.localLlm?.model || specs.recommendedModel,
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
localLlmConfig = {
|
|
108
|
-
enabled: true,
|
|
109
|
-
provider,
|
|
110
|
-
endpoint: endpoint.trim(),
|
|
111
|
-
model: model.trim(),
|
|
112
|
-
};
|
|
113
|
-
} else {
|
|
114
|
-
localLlmConfig.enabled = false;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const config = {
|
|
118
|
-
...existing,
|
|
119
|
-
devDir: devDir.trim(),
|
|
120
|
-
workspacesDir: workspacesDir.trim(),
|
|
121
|
-
scanDepth: parseInt(scanDepth, 10),
|
|
122
|
-
localLlm: localLlmConfig,
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
await saveConfig(config);
|
|
126
|
-
|
|
127
|
-
console.log(chalk.green('\nā
Configuration saved!\n'));
|
|
128
|
-
console.log(chalk.dim(' Config file: ~/.nexusflow/config.json'));
|
|
129
|
-
console.log(chalk.dim(` Dev dir: ${config.devDir}`));
|
|
130
|
-
console.log(chalk.dim(` Workspaces: ${config.workspacesDir}`));
|
|
131
|
-
console.log(chalk.dim(` Scan depth: ${config.scanDepth}`));
|
|
132
|
-
console.log(chalk.dim(` Local AI: ${config.localLlm.enabled ? `Enabled (${config.localLlm.provider}, model: ${config.localLlm.model})` : 'Disabled'}`));
|
|
133
|
-
console.log(chalk.dim('\n Run "nexusflow create" to create your first workspace.\n'));
|
|
134
|
-
}
|
package/src/commands/list.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/list
|
|
3
|
-
* Lists all existing NexusFlow workspaces.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
|
|
8
|
-
import { loadConfig } from '../core/config.js';
|
|
9
|
-
import { listWorkspaces } from '../core/workspace.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Lists all existing workspaces, showing feature name, repos, and status.
|
|
13
|
-
*/
|
|
14
|
-
export async function listCommand(): Promise<void> {
|
|
15
|
-
const config = await loadConfig();
|
|
16
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
17
|
-
|
|
18
|
-
if (workspaces.length === 0) {
|
|
19
|
-
console.log(chalk.yellow('\nNo workspaces found.'));
|
|
20
|
-
console.log(chalk.dim(` Workspaces directory: ${config.workspacesDir}`));
|
|
21
|
-
console.log(chalk.dim(' Run "nexusflow create" to create your first workspace.\n'));
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
console.log(chalk.bold.cyan(`\nš NexusFlow Workspaces (${workspaces.length})\n`));
|
|
26
|
-
|
|
27
|
-
for (const ws of workspaces) {
|
|
28
|
-
const repoCount = ws.repos.length;
|
|
29
|
-
const aiList = ws.assistants.join(', ');
|
|
30
|
-
const date = new Date(ws.createdAt).toLocaleDateString();
|
|
31
|
-
|
|
32
|
-
console.log(
|
|
33
|
-
` ${chalk.bold(ws.branchName)} ${chalk.dim(`(${date})`)}`,
|
|
34
|
-
);
|
|
35
|
-
console.log(
|
|
36
|
-
` ${chalk.dim('Repos:')} ${repoCount} project${repoCount !== 1 ? 's' : ''}`,
|
|
37
|
-
);
|
|
38
|
-
console.log(
|
|
39
|
-
` ${chalk.dim('AI:')} ${aiList || 'none'}`,
|
|
40
|
-
);
|
|
41
|
-
console.log(
|
|
42
|
-
` ${chalk.dim('Path:')} ${ws.workspacePath}`,
|
|
43
|
-
);
|
|
44
|
-
console.log();
|
|
45
|
-
}
|
|
46
|
-
}
|
package/src/commands/logs.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/logs
|
|
3
|
-
* Shows aggregated logs from all services in a workspace.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import * as path from 'node:path';
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import { select } from '@inquirer/prompts';
|
|
9
|
-
|
|
10
|
-
import { loadConfig } from '../core/config.js';
|
|
11
|
-
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
12
|
-
import { showLogs, getServiceStatus } from '../orchestration/index.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Shows logs and status for services in a workspace.
|
|
16
|
-
*
|
|
17
|
-
* @param workspaceArg - Optional workspace path from CLI.
|
|
18
|
-
* @param lines - Number of log lines to show per service.
|
|
19
|
-
*/
|
|
20
|
-
export async function logsCommand(workspaceArg?: string, lines: number = 30): Promise<void> {
|
|
21
|
-
console.log(chalk.bold.cyan('\nš NexusFlow ā Service Logs\n'));
|
|
22
|
-
|
|
23
|
-
const workspacePath = await resolveWorkspace(workspaceArg);
|
|
24
|
-
if (!workspacePath) return;
|
|
25
|
-
|
|
26
|
-
// Show service status first
|
|
27
|
-
console.log(chalk.cyan('Service Status:'));
|
|
28
|
-
await getServiceStatus(workspacePath);
|
|
29
|
-
|
|
30
|
-
// Show logs
|
|
31
|
-
const logDir = path.join(workspacePath, '.nexusflow-logs');
|
|
32
|
-
await showLogs(workspacePath, logDir, lines);
|
|
33
|
-
|
|
34
|
-
console.log();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Resolves a workspace path from argument, cwd, or user prompt.
|
|
39
|
-
*/
|
|
40
|
-
async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
|
|
41
|
-
if (workspaceArg) return workspaceArg;
|
|
42
|
-
|
|
43
|
-
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
44
|
-
if (cwdFeature) return cwdFeature.workspacePath;
|
|
45
|
-
|
|
46
|
-
const config = await loadConfig();
|
|
47
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
48
|
-
|
|
49
|
-
if (workspaces.length === 0) {
|
|
50
|
-
console.log(chalk.yellow('No workspaces found.\n'));
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const selected = await select({
|
|
55
|
-
message: 'Select a workspace to view logs for:',
|
|
56
|
-
choices: workspaces.map((ws) => ({
|
|
57
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
58
|
-
value: ws.workspacePath,
|
|
59
|
-
})),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
return selected;
|
|
63
|
-
}
|
package/src/commands/mcp.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import * as os from 'node:os';
|
|
2
|
-
import * as path from 'node:path';
|
|
3
|
-
import * as fs from 'node:fs/promises';
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
import { startMcpServer } from '../mcp/server.js';
|
|
6
|
-
|
|
7
|
-
export async function mcpRunCommand(workspace?: string) {
|
|
8
|
-
// If not provided, it attempts to use process.cwd() or waits for workspaceId in MCP calls.
|
|
9
|
-
// The startMcpServer function handles this.
|
|
10
|
-
await startMcpServer(workspace);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export async function mcpSetupCommand() {
|
|
14
|
-
console.log(chalk.blue.bold('\nSetting up NexusFlow MCP Server for AI Assistants...'));
|
|
15
|
-
|
|
16
|
-
const isWin = os.platform() === 'win32';
|
|
17
|
-
const isMac = os.platform() === 'darwin';
|
|
18
|
-
const home = os.homedir();
|
|
19
|
-
|
|
20
|
-
const configPaths = [
|
|
21
|
-
// Cursor
|
|
22
|
-
path.join(home, '.cursor', 'mcp.json'),
|
|
23
|
-
// VS Code Insiders (for Antigravity/Copilot)
|
|
24
|
-
isWin
|
|
25
|
-
? path.join(home, 'AppData', 'Roaming', 'Code - Insiders', 'User', 'mcp.json')
|
|
26
|
-
: isMac
|
|
27
|
-
? path.join(home, 'Library', 'Application Support', 'Code - Insiders', 'User', 'mcp.json')
|
|
28
|
-
: path.join(home, '.config', 'Code - Insiders', 'User', 'mcp.json'),
|
|
29
|
-
// VS Code (Stable)
|
|
30
|
-
isWin
|
|
31
|
-
? path.join(home, 'AppData', 'Roaming', 'Code', 'User', 'mcp.json')
|
|
32
|
-
: isMac
|
|
33
|
-
? path.join(home, 'Library', 'Application Support', 'Code', 'User', 'mcp.json')
|
|
34
|
-
: path.join(home, '.config', 'Code', 'User', 'mcp.json'),
|
|
35
|
-
// Claude Desktop
|
|
36
|
-
isWin
|
|
37
|
-
? path.join(home, 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json')
|
|
38
|
-
: isMac
|
|
39
|
-
? path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
|
|
40
|
-
: ''
|
|
41
|
-
].filter(Boolean);
|
|
42
|
-
|
|
43
|
-
const mcpConfig = {
|
|
44
|
-
command: 'npx',
|
|
45
|
-
args: ['-y', '@mrpatronz/nexusflow', 'mcp', 'run']
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
let updatedCount = 0;
|
|
49
|
-
|
|
50
|
-
for (const configPath of configPaths) {
|
|
51
|
-
if (!configPath) continue;
|
|
52
|
-
try {
|
|
53
|
-
let configData: any = { mcpServers: {} };
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
await fs.access(configPath);
|
|
57
|
-
const raw = await fs.readFile(configPath, 'utf8');
|
|
58
|
-
// Handle empty or invalid files gracefully
|
|
59
|
-
if (raw.trim()) {
|
|
60
|
-
configData = JSON.parse(raw);
|
|
61
|
-
}
|
|
62
|
-
if (!configData.mcpServers) configData.mcpServers = {};
|
|
63
|
-
} catch (e) {
|
|
64
|
-
// File doesn't exist, we will create it if the directory exists
|
|
65
|
-
const dir = path.dirname(configPath);
|
|
66
|
-
try {
|
|
67
|
-
await fs.access(dir);
|
|
68
|
-
} catch {
|
|
69
|
-
// Directory doesn't exist, skip this environment
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
configData.mcpServers['nexusflow'] = mcpConfig;
|
|
75
|
-
|
|
76
|
-
await fs.writeFile(configPath, JSON.stringify(configData, null, 2), 'utf8');
|
|
77
|
-
console.log(chalk.green(` ā Configured MCP in: ${configPath}`));
|
|
78
|
-
updatedCount++;
|
|
79
|
-
} catch (e: any) {
|
|
80
|
-
console.log(chalk.gray(` - Skipped ${configPath} (${e.message})`));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (updatedCount > 0) {
|
|
85
|
-
console.log(chalk.green.bold(`\nSuccessfully configured ${updatedCount} AI environments!`));
|
|
86
|
-
console.log(chalk.white('You may need to restart your editor or Claude Desktop for the changes to take effect.'));
|
|
87
|
-
} else {
|
|
88
|
-
console.log(chalk.yellow('\nCould not find any standard configuration files to update.'));
|
|
89
|
-
console.log('You can manually add this configuration to your mcp.json:');
|
|
90
|
-
console.log(JSON.stringify({ mcpServers: { nexusflow: mcpConfig } }, null, 2));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
package/src/commands/open.ts
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/open
|
|
3
|
-
* Re-opens an existing NexusFlow workspace in an editor.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import { execa } from 'execa';
|
|
8
|
-
import { select, confirm, search } from '@inquirer/prompts';
|
|
9
|
-
|
|
10
|
-
import { loadConfig } from '../core/config.js';
|
|
11
|
-
import { listWorkspaces } from '../core/workspace.js';
|
|
12
|
-
import { detectEditors } from '../utils/detect-editors.js';
|
|
13
|
-
import { promptSelectEditor } from '../utils/prompts.js';
|
|
14
|
-
import { findSessions } from '../utils/session-finder.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Lets the user pick an existing workspace and open it in an editor.
|
|
18
|
-
*/
|
|
19
|
-
export async function openCommand(): Promise<void> {
|
|
20
|
-
const config = await loadConfig();
|
|
21
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
22
|
-
|
|
23
|
-
if (workspaces.length === 0) {
|
|
24
|
-
console.log(chalk.yellow('\nNo workspaces found.'));
|
|
25
|
-
console.log(chalk.dim(' Run "nexusflow create" to create your first workspace.\n'));
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
console.log(chalk.bold.cyan('\nš Open Workspace\n'));
|
|
30
|
-
|
|
31
|
-
// Let user pick a workspace
|
|
32
|
-
const selected = await search({
|
|
33
|
-
message: 'Search and select a workspace to open:',
|
|
34
|
-
source: async (input) => {
|
|
35
|
-
const query = (input || '').toLowerCase();
|
|
36
|
-
const filtered = workspaces.filter(
|
|
37
|
-
(ws) =>
|
|
38
|
-
ws.branchName.toLowerCase().includes(query) ||
|
|
39
|
-
ws.workspacePath.toLowerCase().includes(query)
|
|
40
|
-
);
|
|
41
|
-
return filtered.map((ws) => ({
|
|
42
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos, ${ws.assistants.join(', ')})`)}`,
|
|
43
|
-
value: ws.workspacePath,
|
|
44
|
-
}));
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Let user pick an editor
|
|
49
|
-
const detectedEditors = await detectEditors();
|
|
50
|
-
const editor = await promptSelectEditor(detectedEditors);
|
|
51
|
-
|
|
52
|
-
if (editor) {
|
|
53
|
-
try {
|
|
54
|
-
await execa(editor.command, [selected], {
|
|
55
|
-
stdio: 'ignore',
|
|
56
|
-
shell: process.platform === 'win32',
|
|
57
|
-
});
|
|
58
|
-
console.log(chalk.green(`\nā
Opened ${selected} in ${editor.name}\n`));
|
|
59
|
-
} catch {
|
|
60
|
-
console.log(chalk.yellow(`\nā ļø Could not open editor. Navigate manually:`));
|
|
61
|
-
console.log(chalk.dim(` cd "${selected}"\n`));
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
console.log(chalk.dim(`\n To navigate: cd "${selected}"\n`));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// āā Start AI Assistant Session āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
68
|
-
const loadedFeature = workspaces.find((ws) => ws.workspacePath === selected);
|
|
69
|
-
if (loadedFeature && loadedFeature.assistants.length > 0) {
|
|
70
|
-
const assistant = loadedFeature.assistants[0];
|
|
71
|
-
const confirmStart = await confirm({
|
|
72
|
-
message: `Do you want to start a session with ${assistant} inside the workspace now?`,
|
|
73
|
-
default: true,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
if (confirmStart) {
|
|
77
|
-
console.log(chalk.cyan(`\nš Starting ${assistant} session inside workspace...\n`));
|
|
78
|
-
|
|
79
|
-
const sessions = await findSessions(selected, loadedFeature.repos);
|
|
80
|
-
let cmdName = 'agy';
|
|
81
|
-
let cmdArgs: string[] = [];
|
|
82
|
-
|
|
83
|
-
if (assistant === 'claude') {
|
|
84
|
-
cmdName = 'claude';
|
|
85
|
-
} else if (assistant === 'codex') {
|
|
86
|
-
cmdName = 'codex';
|
|
87
|
-
} else if (assistant === 'copilot') {
|
|
88
|
-
cmdName = 'copilot';
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (sessions.length > 0 && sessions[0].assistant === assistant) {
|
|
92
|
-
const latestSessionId = sessions[0].id;
|
|
93
|
-
if (assistant === 'antigravity') {
|
|
94
|
-
cmdArgs = ['--conversation', latestSessionId];
|
|
95
|
-
} else if (assistant === 'claude') {
|
|
96
|
-
cmdArgs = ['--resume', latestSessionId];
|
|
97
|
-
} else if (assistant === 'codex') {
|
|
98
|
-
cmdArgs = ['resume', latestSessionId];
|
|
99
|
-
} else if (assistant === 'copilot') {
|
|
100
|
-
cmdArgs = ['--resume', latestSessionId];
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
if (assistant === 'antigravity') {
|
|
104
|
-
cmdArgs = ['--continue'];
|
|
105
|
-
} else if (assistant === 'claude') {
|
|
106
|
-
cmdArgs = ['--resume'];
|
|
107
|
-
} else if (assistant === 'codex') {
|
|
108
|
-
cmdArgs = ['resume'];
|
|
109
|
-
} else if (assistant === 'copilot') {
|
|
110
|
-
cmdArgs = ['--resume'];
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
try {
|
|
115
|
-
await execa(cmdName, cmdArgs, {
|
|
116
|
-
cwd: selected,
|
|
117
|
-
stdio: 'inherit',
|
|
118
|
-
shell: process.platform === 'win32',
|
|
119
|
-
});
|
|
120
|
-
console.log(chalk.green(`\nš Exited ${assistant} session.`));
|
|
121
|
-
} catch {
|
|
122
|
-
const fullCmd = [cmdName, ...cmdArgs].join(' ');
|
|
123
|
-
console.log(
|
|
124
|
-
chalk.yellow(`\nā ļø Could not start ${assistant}. Please start it manually:\n ${chalk.dim(`cd "${selected}" && ${fullCmd}`)}`)
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
package/src/commands/refresh.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { select, search } from '@inquirer/prompts';
|
|
3
|
-
import * as path from 'node:path';
|
|
4
|
-
import * as fs from 'node:fs/promises';
|
|
5
|
-
|
|
6
|
-
import { loadConfig } from '../core/config.js';
|
|
7
|
-
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
8
|
-
import { getWorkspaceRepos } from '../utils/multi-git.js';
|
|
9
|
-
import { analyzeAllRepos } from '../analyzers/index.js';
|
|
10
|
-
import { generateContextFiles } from '../generators/index.js';
|
|
11
|
-
import type { WorkspaceContext } from '../types.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Runs the refresh command.
|
|
15
|
-
* Updates context files, maps, and plans.
|
|
16
|
-
*
|
|
17
|
-
* @param options - CLI options, e.g. { repo: 'API_CoworkerFacade' }.
|
|
18
|
-
* @param workspaceArg - Optional workspace path.
|
|
19
|
-
*/
|
|
20
|
-
export async function refreshCommand(
|
|
21
|
-
options: { repo?: string; base?: boolean },
|
|
22
|
-
workspaceArg?: string,
|
|
23
|
-
): Promise<void> {
|
|
24
|
-
console.log(chalk.bold.cyan('\nš NexusFlow ā Refresh Workspace Context\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
|
-
const onlyRepo = options.repo;
|
|
36
|
-
if (onlyRepo) {
|
|
37
|
-
const hasRepo = feature.repos.some(r => path.basename(r) === onlyRepo);
|
|
38
|
-
if (!hasRepo) {
|
|
39
|
-
console.error(chalk.red(`ā Repository "${onlyRepo}" is not part of this workspace.`));
|
|
40
|
-
console.log(chalk.dim(` Available repos: ${feature.repos.map(r => path.basename(r)).join(', ')}`));
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
console.log(`Refreshing context for repository: ${chalk.bold(onlyRepo)}`);
|
|
44
|
-
} else {
|
|
45
|
-
console.log('Refreshing context for all repositories...');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const allRepos = await Promise.all(
|
|
49
|
-
feature.repos.map(async (r) => {
|
|
50
|
-
const repoName = path.basename(r);
|
|
51
|
-
return {
|
|
52
|
-
name: repoName,
|
|
53
|
-
path: r,
|
|
54
|
-
defaultBranch: 'main',
|
|
55
|
-
};
|
|
56
|
-
})
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
console.log(chalk.cyan('Running project analysis...'));
|
|
60
|
-
const analysis = await analyzeAllRepos(allRepos);
|
|
61
|
-
|
|
62
|
-
const ctx: WorkspaceContext = {
|
|
63
|
-
feature,
|
|
64
|
-
repos: allRepos,
|
|
65
|
-
analysis,
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
console.log(chalk.cyan('Regenerating context files and maps...'));
|
|
69
|
-
await generateContextFiles(ctx, feature.assistants, workspacePath, onlyRepo, options.base);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// If handoff file exists, refresh it automatically too!
|
|
74
|
-
const handoffPath = path.join(workspacePath, 'nexusflow-handoff.md');
|
|
75
|
-
let hasHandoff = false;
|
|
76
|
-
try {
|
|
77
|
-
await fs.access(handoffPath);
|
|
78
|
-
hasHandoff = true;
|
|
79
|
-
} catch {}
|
|
80
|
-
|
|
81
|
-
if (!options.base && hasHandoff) {
|
|
82
|
-
console.log(chalk.cyan('Refreshing handoff bundle...'));
|
|
83
|
-
try {
|
|
84
|
-
const { handoffCommand } = await import('./handoff.js');
|
|
85
|
-
await handoffCommand(workspacePath);
|
|
86
|
-
} catch (error) {
|
|
87
|
-
console.warn(chalk.yellow(` ā Failed to refresh handoff bundle: ${error}`));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
console.log(chalk.bold.green('\nā
Workspace context successfully refreshed!\n'));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Resolves a workspace path.
|
|
96
|
-
*/
|
|
97
|
-
async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
|
|
98
|
-
if (workspaceArg) {
|
|
99
|
-
const absolutePath = path.resolve(workspaceArg);
|
|
100
|
-
try {
|
|
101
|
-
await fs.access(path.join(absolutePath, 'nexusflow.json'));
|
|
102
|
-
return absolutePath;
|
|
103
|
-
} catch {
|
|
104
|
-
console.error(chalk.red(`ā Invalid workspace: No nexusflow.json found at ${absolutePath}`));
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
110
|
-
if (cwdFeature) return cwdFeature.workspacePath;
|
|
111
|
-
|
|
112
|
-
const config = await loadConfig();
|
|
113
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
114
|
-
|
|
115
|
-
if (workspaces.length === 0) {
|
|
116
|
-
console.log(chalk.yellow('No workspaces found.\n'));
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const selected = await search({
|
|
121
|
-
message: 'Search and select a workspace to refresh:',
|
|
122
|
-
source: async (input) => {
|
|
123
|
-
const query = (input || '').toLowerCase();
|
|
124
|
-
const filtered = workspaces.filter(
|
|
125
|
-
(ws) =>
|
|
126
|
-
ws.branchName.toLowerCase().includes(query) ||
|
|
127
|
-
ws.workspacePath.toLowerCase().includes(query)
|
|
128
|
-
);
|
|
129
|
-
return filtered.map((ws) => ({
|
|
130
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
131
|
-
value: ws.workspacePath,
|
|
132
|
-
}));
|
|
133
|
-
},
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
return selected;
|
|
137
|
-
}
|