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