@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.
Files changed (236) hide show
  1. package/README.md +27 -3
  2. package/dist/analyzers/index.d.ts +23 -0
  3. package/dist/analyzers/index.d.ts.map +1 -1
  4. package/dist/analyzers/index.js +62 -0
  5. package/dist/analyzers/index.js.map +1 -1
  6. package/dist/commands/commands.test.js +20 -6
  7. package/dist/commands/commands.test.js.map +1 -1
  8. package/dist/commands/commit.d.ts +2 -0
  9. package/dist/commands/commit.d.ts.map +1 -1
  10. package/dist/commands/commit.js +27 -5
  11. package/dist/commands/commit.js.map +1 -1
  12. package/dist/commands/diff.d.ts +9 -2
  13. package/dist/commands/diff.d.ts.map +1 -1
  14. package/dist/commands/diff.js +36 -12
  15. package/dist/commands/diff.js.map +1 -1
  16. package/dist/commands/doctor.js +2 -2
  17. package/dist/commands/doctor.js.map +1 -1
  18. package/dist/commands/handoff.js +2 -2
  19. package/dist/commands/handoff.js.map +1 -1
  20. package/dist/commands/refresh.d.ts +4 -2
  21. package/dist/commands/refresh.d.ts.map +1 -1
  22. package/dist/commands/refresh.js +20 -36
  23. package/dist/commands/refresh.js.map +1 -1
  24. package/dist/commands/schedule.d.ts +35 -0
  25. package/dist/commands/schedule.d.ts.map +1 -0
  26. package/dist/commands/schedule.js +151 -0
  27. package/dist/commands/schedule.js.map +1 -0
  28. package/dist/commands/sync.d.ts.map +1 -1
  29. package/dist/commands/sync.js +58 -50
  30. package/dist/commands/sync.js.map +1 -1
  31. package/dist/core/analysis-cache.d.ts +58 -0
  32. package/dist/core/analysis-cache.d.ts.map +1 -0
  33. package/dist/core/analysis-cache.js +116 -0
  34. package/dist/core/analysis-cache.js.map +1 -0
  35. package/dist/core/analysis-cache.test.d.ts +2 -0
  36. package/dist/core/analysis-cache.test.d.ts.map +1 -0
  37. package/dist/core/analysis-cache.test.js +108 -0
  38. package/dist/core/analysis-cache.test.js.map +1 -0
  39. package/dist/core/refresh.d.ts +41 -0
  40. package/dist/core/refresh.d.ts.map +1 -0
  41. package/dist/core/refresh.js +60 -0
  42. package/dist/core/refresh.js.map +1 -0
  43. package/dist/core/scheduler.d.ts +117 -0
  44. package/dist/core/scheduler.d.ts.map +1 -0
  45. package/dist/core/scheduler.js +247 -0
  46. package/dist/core/scheduler.js.map +1 -0
  47. package/dist/core/scheduler.test.d.ts +2 -0
  48. package/dist/core/scheduler.test.d.ts.map +1 -0
  49. package/dist/core/scheduler.test.js +111 -0
  50. package/dist/core/scheduler.test.js.map +1 -0
  51. package/dist/core/sync.d.ts +50 -0
  52. package/dist/core/sync.d.ts.map +1 -0
  53. package/dist/core/sync.js +92 -0
  54. package/dist/core/sync.js.map +1 -0
  55. package/dist/core/workspace-state.d.ts +51 -0
  56. package/dist/core/workspace-state.d.ts.map +1 -0
  57. package/dist/core/workspace-state.js +108 -0
  58. package/dist/core/workspace-state.js.map +1 -0
  59. package/dist/core/workspace-state.test.d.ts +2 -0
  60. package/dist/core/workspace-state.test.d.ts.map +1 -0
  61. package/dist/core/workspace-state.test.js +84 -0
  62. package/dist/core/workspace-state.test.js.map +1 -0
  63. package/dist/generators/index.d.ts +7 -1
  64. package/dist/generators/index.d.ts.map +1 -1
  65. package/dist/generators/index.js +14 -1
  66. package/dist/generators/index.js.map +1 -1
  67. package/dist/gui/assets/index-Bdbld6yY.css +1 -0
  68. package/dist/gui/assets/index-D8iJPvnk.js +26 -0
  69. package/dist/gui/index.html +2 -2
  70. package/dist/index.js +107 -4
  71. package/dist/index.js.map +1 -1
  72. package/dist/mcp/server.d.ts.map +1 -1
  73. package/dist/mcp/server.js +42 -0
  74. package/dist/mcp/server.js.map +1 -1
  75. package/dist/server.d.ts.map +1 -1
  76. package/dist/server.js +175 -13
  77. package/dist/server.js.map +1 -1
  78. package/dist/server.test.js +66 -0
  79. package/dist/server.test.js.map +1 -1
  80. package/dist/types.d.ts +31 -0
  81. package/dist/types.d.ts.map +1 -1
  82. package/dist/utils/multi-git.d.ts +54 -8
  83. package/dist/utils/multi-git.d.ts.map +1 -1
  84. package/dist/utils/multi-git.js +129 -21
  85. package/dist/utils/multi-git.js.map +1 -1
  86. package/dist/utils/multi-git.test.d.ts +2 -0
  87. package/dist/utils/multi-git.test.d.ts.map +1 -0
  88. package/dist/utils/multi-git.test.js +125 -0
  89. package/dist/utils/multi-git.test.js.map +1 -0
  90. package/package.json +13 -1
  91. package/.agents/skills/ccc/SKILL.md +0 -71
  92. package/.agents/skills/ccc/references/management.md +0 -110
  93. package/.agents/skills/ccc/references/settings.md +0 -126
  94. package/.github/dependabot.yml +0 -52
  95. package/.github/workflows/ci.yml +0 -44
  96. package/.github/workflows/dependabot-merge.yml +0 -53
  97. package/.github/workflows/release-desktop.yml +0 -67
  98. package/.github/workflows/release-npm.yml +0 -65
  99. package/.github/workflows/release-vscode.yml +0 -61
  100. package/.vscode/launch.json +0 -17
  101. package/.vscode/tasks.json +0 -17
  102. package/GETTING_STARTED.md +0 -114
  103. package/desktop/build-installer.js +0 -228
  104. package/desktop/build.js +0 -118
  105. package/desktop/installer/nexusflow.iss +0 -35
  106. package/desktop/neutralino.config.json +0 -39
  107. package/desktop/package-lock.json +0 -1060
  108. package/desktop/package.json +0 -14
  109. package/dist/gui/assets/index-CB-jWded.css +0 -1
  110. package/dist/gui/assets/index-DDXpZZu3.js +0 -25
  111. package/extension/media/icon.svg +0 -1
  112. package/extension/package-lock.json +0 -6044
  113. package/extension/package.json +0 -117
  114. package/extension/src/extension.ts +0 -653
  115. package/extension/tsconfig.json +0 -21
  116. package/gui/README.md +0 -73
  117. package/gui/e2e/wizard.spec.ts +0 -346
  118. package/gui/eslint.config.js +0 -26
  119. package/gui/index.html +0 -17
  120. package/gui/package-lock.json +0 -3079
  121. package/gui/package.json +0 -36
  122. package/gui/playwright.config.ts +0 -41
  123. package/gui/public/app_logo.png +0 -0
  124. package/gui/public/favicon.svg +0 -1
  125. package/gui/public/icons.svg +0 -24
  126. package/gui/src/App.css +0 -1
  127. package/gui/src/App.tsx +0 -3632
  128. package/gui/src/assets/hero.png +0 -0
  129. package/gui/src/assets/react.svg +0 -1
  130. package/gui/src/assets/vite.svg +0 -1
  131. package/gui/src/features/changes/ChangesViewer.tsx +0 -388
  132. package/gui/src/features/knowledge/KnowledgeBase.tsx +0 -84
  133. package/gui/src/features/onboarding/OnboardingWizard.tsx +0 -230
  134. package/gui/src/features/plan/ImplementationPlan.tsx +0 -32
  135. package/gui/src/features/services/ServiceConsole.tsx +0 -250
  136. package/gui/src/features/sessions/SessionHistory.tsx +0 -195
  137. package/gui/src/features/workspace/WorkspaceList.tsx +0 -666
  138. package/gui/src/index.css +0 -152
  139. package/gui/src/main.tsx +0 -94
  140. package/gui/src/types.ts +0 -62
  141. package/gui/tsconfig.app.json +0 -25
  142. package/gui/tsconfig.json +0 -7
  143. package/gui/tsconfig.node.json +0 -24
  144. package/gui/vite.config.ts +0 -12
  145. package/resources/workflows/plan-implement-review.md +0 -8
  146. package/resources/workflows/research-verify.md +0 -6
  147. package/resources/workflows/solo-developer.md +0 -3
  148. package/scripts/simulate-workspaces.ts +0 -55
  149. package/skills-lock.json +0 -11
  150. package/src/analyzers/detect-apis.ts +0 -290
  151. package/src/analyzers/detect-deps.ts +0 -315
  152. package/src/analyzers/detect-existing.ts +0 -74
  153. package/src/analyzers/detect-ports.ts +0 -110
  154. package/src/analyzers/index.ts +0 -97
  155. package/src/analyzers/messaging-analyzer.ts +0 -254
  156. package/src/analyzers/readme-summarizer.ts +0 -102
  157. package/src/analyzers/run-analyzer.ts +0 -269
  158. package/src/analyzers/tech-stack.ts +0 -283
  159. package/src/commands/adapter.ts +0 -348
  160. package/src/commands/add-repo.ts +0 -156
  161. package/src/commands/commands.test.ts +0 -156
  162. package/src/commands/commit.ts +0 -131
  163. package/src/commands/config.ts +0 -52
  164. package/src/commands/create.ts +0 -204
  165. package/src/commands/desktop.ts +0 -128
  166. package/src/commands/diff.ts +0 -125
  167. package/src/commands/doctor.ts +0 -370
  168. package/src/commands/handoff.ts +0 -266
  169. package/src/commands/init.ts +0 -134
  170. package/src/commands/list.ts +0 -46
  171. package/src/commands/logs.ts +0 -63
  172. package/src/commands/mcp.ts +0 -94
  173. package/src/commands/open.ts +0 -129
  174. package/src/commands/refresh.ts +0 -137
  175. package/src/commands/remove.ts +0 -98
  176. package/src/commands/start.ts +0 -117
  177. package/src/commands/status.ts +0 -54
  178. package/src/commands/stop.ts +0 -55
  179. package/src/commands/sync.ts +0 -147
  180. package/src/commands/tui.ts +0 -484
  181. package/src/commands/ui.ts +0 -111
  182. package/src/core/adapters/local-storage.ts +0 -66
  183. package/src/core/adapters/obsidian-storage.ts +0 -151
  184. package/src/core/adapters/registry.ts +0 -44
  185. package/src/core/adapters/storage.test.ts +0 -174
  186. package/src/core/adapters/vault-storage.ts +0 -86
  187. package/src/core/config.test.ts +0 -96
  188. package/src/core/config.ts +0 -140
  189. package/src/core/graph.ts +0 -344
  190. package/src/core/plugins/index.ts +0 -17
  191. package/src/core/plugins/loader.ts +0 -36
  192. package/src/core/ports/storage.ts +0 -71
  193. package/src/core/scanner.test.ts +0 -61
  194. package/src/core/scanner.ts +0 -91
  195. package/src/core/storage.ts +0 -37
  196. package/src/core/workspace.ts +0 -487
  197. package/src/core/worktree.ts +0 -120
  198. package/src/generators/antigravity.ts +0 -32
  199. package/src/generators/base.ts +0 -243
  200. package/src/generators/claude.ts +0 -34
  201. package/src/generators/codex.ts +0 -48
  202. package/src/generators/copilot.ts +0 -56
  203. package/src/generators/cursor.ts +0 -44
  204. package/src/generators/diff-context.ts +0 -75
  205. package/src/generators/index.ts +0 -322
  206. package/src/generators/map-generator.test.ts +0 -159
  207. package/src/generators/map-generator.ts +0 -539
  208. package/src/generators/plan-generator.ts +0 -483
  209. package/src/generators/skills-generator.ts +0 -259
  210. package/src/index.ts +0 -539
  211. package/src/mcp/server.ts +0 -294
  212. package/src/orchestration/detect.ts +0 -313
  213. package/src/orchestration/index.ts +0 -7
  214. package/src/orchestration/runner.ts +0 -283
  215. package/src/server.test.ts +0 -618
  216. package/src/server.ts +0 -1314
  217. package/src/types.ts +0 -415
  218. package/src/utils/detect-ai.test.ts +0 -44
  219. package/src/utils/detect-ai.ts +0 -84
  220. package/src/utils/detect-editors.test.ts +0 -48
  221. package/src/utils/detect-editors.ts +0 -57
  222. package/src/utils/git.test.ts +0 -74
  223. package/src/utils/git.ts +0 -117
  224. package/src/utils/local-ai.test.ts +0 -130
  225. package/src/utils/local-ai.ts +0 -116
  226. package/src/utils/multi-git.ts +0 -313
  227. package/src/utils/prompts.ts +0 -209
  228. package/src/utils/session-finder.ts +0 -483
  229. package/src/utils/system-scanner.test.ts +0 -89
  230. package/src/utils/system-scanner.ts +0 -96
  231. package/src/utils/update-check.ts +0 -286
  232. package/src/utils/workflow-advisor.ts +0 -118
  233. package/src/utils/workflows.test.ts +0 -114
  234. package/src/utils/workflows.ts +0 -178
  235. package/tsconfig.json +0 -19
  236. package/vitest.config.ts +0 -14
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
-
@@ -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
- }
@@ -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
- }