@mrpatronz/nexusflow 0.2.19 → 1.3.1

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 (294) hide show
  1. package/README.md +37 -7
  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/add-repo.d.ts +9 -0
  7. package/dist/commands/add-repo.d.ts.map +1 -1
  8. package/dist/commands/add-repo.js +12 -1
  9. package/dist/commands/add-repo.js.map +1 -1
  10. package/dist/commands/add-repo.test.d.ts +2 -0
  11. package/dist/commands/add-repo.test.d.ts.map +1 -0
  12. package/dist/commands/add-repo.test.js +30 -0
  13. package/dist/commands/add-repo.test.js.map +1 -0
  14. package/dist/commands/commands.test.js +26 -6
  15. package/dist/commands/commands.test.js.map +1 -1
  16. package/dist/commands/commit.d.ts +7 -1
  17. package/dist/commands/commit.d.ts.map +1 -1
  18. package/dist/commands/commit.js +31 -8
  19. package/dist/commands/commit.js.map +1 -1
  20. package/dist/commands/commit.test.d.ts +2 -0
  21. package/dist/commands/commit.test.d.ts.map +1 -0
  22. package/dist/commands/commit.test.js +54 -0
  23. package/dist/commands/commit.test.js.map +1 -0
  24. package/dist/commands/diff.d.ts +9 -2
  25. package/dist/commands/diff.d.ts.map +1 -1
  26. package/dist/commands/diff.js +36 -12
  27. package/dist/commands/diff.js.map +1 -1
  28. package/dist/commands/doctor.d.ts.map +1 -1
  29. package/dist/commands/doctor.js +16 -20
  30. package/dist/commands/doctor.js.map +1 -1
  31. package/dist/commands/handoff.d.ts.map +1 -1
  32. package/dist/commands/handoff.js +11 -15
  33. package/dist/commands/handoff.js.map +1 -1
  34. package/dist/commands/refresh.d.ts +4 -2
  35. package/dist/commands/refresh.d.ts.map +1 -1
  36. package/dist/commands/refresh.js +20 -36
  37. package/dist/commands/refresh.js.map +1 -1
  38. package/dist/commands/schedule.d.ts +35 -0
  39. package/dist/commands/schedule.d.ts.map +1 -0
  40. package/dist/commands/schedule.js +151 -0
  41. package/dist/commands/schedule.js.map +1 -0
  42. package/dist/commands/sync.d.ts.map +1 -1
  43. package/dist/commands/sync.js +28 -7
  44. package/dist/commands/sync.js.map +1 -1
  45. package/dist/commands/tui.js +1 -1
  46. package/dist/commands/tui.js.map +1 -1
  47. package/dist/commands/ui.d.ts +1 -0
  48. package/dist/commands/ui.d.ts.map +1 -1
  49. package/dist/commands/ui.js +5 -2
  50. package/dist/commands/ui.js.map +1 -1
  51. package/dist/core/adapters/local-storage.d.ts +7 -0
  52. package/dist/core/adapters/local-storage.d.ts.map +1 -1
  53. package/dist/core/adapters/local-storage.js +13 -4
  54. package/dist/core/adapters/local-storage.js.map +1 -1
  55. package/dist/core/adapters/storage.test.js +18 -0
  56. package/dist/core/adapters/storage.test.js.map +1 -1
  57. package/dist/core/analysis-cache.d.ts +58 -0
  58. package/dist/core/analysis-cache.d.ts.map +1 -0
  59. package/dist/core/analysis-cache.js +116 -0
  60. package/dist/core/analysis-cache.js.map +1 -0
  61. package/dist/core/analysis-cache.test.d.ts +2 -0
  62. package/dist/core/analysis-cache.test.d.ts.map +1 -0
  63. package/dist/core/analysis-cache.test.js +108 -0
  64. package/dist/core/analysis-cache.test.js.map +1 -0
  65. package/dist/core/refresh.d.ts +41 -0
  66. package/dist/core/refresh.d.ts.map +1 -0
  67. package/dist/core/refresh.js +56 -0
  68. package/dist/core/refresh.js.map +1 -0
  69. package/dist/core/scheduler.d.ts +117 -0
  70. package/dist/core/scheduler.d.ts.map +1 -0
  71. package/dist/core/scheduler.js +361 -0
  72. package/dist/core/scheduler.js.map +1 -0
  73. package/dist/core/scheduler.test.d.ts +2 -0
  74. package/dist/core/scheduler.test.d.ts.map +1 -0
  75. package/dist/core/scheduler.test.js +163 -0
  76. package/dist/core/scheduler.test.js.map +1 -0
  77. package/dist/core/sync.d.ts +6 -0
  78. package/dist/core/sync.d.ts.map +1 -1
  79. package/dist/core/sync.js +17 -12
  80. package/dist/core/sync.js.map +1 -1
  81. package/dist/core/workspace.d.ts +6 -0
  82. package/dist/core/workspace.d.ts.map +1 -1
  83. package/dist/core/workspace.js +32 -15
  84. package/dist/core/workspace.js.map +1 -1
  85. package/dist/core/workspace.test.d.ts +2 -0
  86. package/dist/core/workspace.test.d.ts.map +1 -0
  87. package/dist/core/workspace.test.js +42 -0
  88. package/dist/core/workspace.test.js.map +1 -0
  89. package/dist/generators/index.d.ts +7 -1
  90. package/dist/generators/index.d.ts.map +1 -1
  91. package/dist/generators/index.js +14 -1
  92. package/dist/generators/index.js.map +1 -1
  93. package/dist/generators/map-generator.d.ts.map +1 -1
  94. package/dist/generators/map-generator.js +4 -3
  95. package/dist/generators/map-generator.js.map +1 -1
  96. package/dist/generators/map-generator.test.js +4 -2
  97. package/dist/generators/map-generator.test.js.map +1 -1
  98. package/dist/gui/assets/index-ElroPpSP.js +26 -0
  99. package/dist/gui/index.html +1 -1
  100. package/dist/index.js +108 -4
  101. package/dist/index.js.map +1 -1
  102. package/dist/orchestration/index.d.ts +1 -1
  103. package/dist/orchestration/index.d.ts.map +1 -1
  104. package/dist/orchestration/index.js +1 -1
  105. package/dist/orchestration/index.js.map +1 -1
  106. package/dist/orchestration/runner.d.ts +16 -1
  107. package/dist/orchestration/runner.d.ts.map +1 -1
  108. package/dist/orchestration/runner.js +41 -5
  109. package/dist/orchestration/runner.js.map +1 -1
  110. package/dist/orchestration/runner.test.d.ts +2 -0
  111. package/dist/orchestration/runner.test.d.ts.map +1 -0
  112. package/dist/orchestration/runner.test.js +71 -0
  113. package/dist/orchestration/runner.test.js.map +1 -0
  114. package/dist/server.d.ts +17 -1
  115. package/dist/server.d.ts.map +1 -1
  116. package/dist/server.js +275 -114
  117. package/dist/server.js.map +1 -1
  118. package/dist/server.test.js +158 -1
  119. package/dist/server.test.js.map +1 -1
  120. package/dist/utils/multi-git.d.ts +21 -0
  121. package/dist/utils/multi-git.d.ts.map +1 -1
  122. package/dist/utils/multi-git.js +40 -4
  123. package/dist/utils/multi-git.js.map +1 -1
  124. package/dist/utils/prompts.d.ts.map +1 -1
  125. package/dist/utils/prompts.js +8 -2
  126. package/dist/utils/prompts.js.map +1 -1
  127. package/package.json +13 -1
  128. package/.agents/skills/ccc/SKILL.md +0 -71
  129. package/.agents/skills/ccc/references/management.md +0 -110
  130. package/.agents/skills/ccc/references/settings.md +0 -126
  131. package/.github/dependabot.yml +0 -52
  132. package/.github/workflows/ci.yml +0 -44
  133. package/.github/workflows/dependabot-merge.yml +0 -53
  134. package/.github/workflows/release-desktop.yml +0 -67
  135. package/.github/workflows/release-npm.yml +0 -65
  136. package/.github/workflows/release-vscode.yml +0 -61
  137. package/.vscode/launch.json +0 -17
  138. package/.vscode/tasks.json +0 -17
  139. package/GETTING_STARTED.md +0 -114
  140. package/desktop/build-installer.js +0 -228
  141. package/desktop/build.js +0 -118
  142. package/desktop/installer/nexusflow.iss +0 -35
  143. package/desktop/neutralino.config.json +0 -39
  144. package/desktop/package-lock.json +0 -1060
  145. package/desktop/package.json +0 -14
  146. package/dist/gui/assets/index-D8iJPvnk.js +0 -26
  147. package/extension/media/icon.svg +0 -1
  148. package/extension/package-lock.json +0 -6044
  149. package/extension/package.json +0 -117
  150. package/extension/src/extension.ts +0 -653
  151. package/extension/tsconfig.json +0 -21
  152. package/gui/README.md +0 -73
  153. package/gui/e2e/dashboard.spec.ts +0 -61
  154. package/gui/e2e/wizard.spec.ts +0 -346
  155. package/gui/eslint.config.js +0 -26
  156. package/gui/index.html +0 -17
  157. package/gui/package-lock.json +0 -3137
  158. package/gui/package.json +0 -37
  159. package/gui/playwright.config.ts +0 -41
  160. package/gui/public/app_logo.png +0 -0
  161. package/gui/public/favicon.svg +0 -1
  162. package/gui/public/icons.svg +0 -24
  163. package/gui/src/App.css +0 -1
  164. package/gui/src/App.tsx +0 -3573
  165. package/gui/src/app/AppSidebar.tsx +0 -69
  166. package/gui/src/assets/hero.png +0 -0
  167. package/gui/src/assets/react.svg +0 -1
  168. package/gui/src/assets/vite.svg +0 -1
  169. package/gui/src/components/AddRepoPicker.tsx +0 -81
  170. package/gui/src/components/ui/Button.tsx +0 -40
  171. package/gui/src/components/ui/Card.tsx +0 -6
  172. package/gui/src/components/ui/EmptyState.tsx +0 -22
  173. package/gui/src/components/ui/Input.tsx +0 -21
  174. package/gui/src/components/ui/Menu.tsx +0 -71
  175. package/gui/src/components/ui/Modal.tsx +0 -39
  176. package/gui/src/components/ui/PageHeader.tsx +0 -21
  177. package/gui/src/components/ui/RepoStatusStrip.tsx +0 -33
  178. package/gui/src/components/ui/Skeleton.tsx +0 -5
  179. package/gui/src/components/ui/StatusPill.tsx +0 -36
  180. package/gui/src/components/ui/Tabs.tsx +0 -40
  181. package/gui/src/components/ui/cn.ts +0 -4
  182. package/gui/src/components/ui/index.ts +0 -16
  183. package/gui/src/features/changes/ChangesViewer.tsx +0 -388
  184. package/gui/src/features/knowledge/KnowledgeBase.tsx +0 -84
  185. package/gui/src/features/onboarding/OnboardingWizard.tsx +0 -230
  186. package/gui/src/features/plan/ImplementationPlan.tsx +0 -32
  187. package/gui/src/features/services/ServiceConsole.tsx +0 -215
  188. package/gui/src/features/sessions/SessionHistory.tsx +0 -195
  189. package/gui/src/index.css +0 -167
  190. package/gui/src/lib/status.ts +0 -24
  191. package/gui/src/main.tsx +0 -94
  192. package/gui/src/pages/DashboardPage.tsx +0 -129
  193. package/gui/src/pages/WorkspacesPage.tsx +0 -352
  194. package/gui/src/types.ts +0 -81
  195. package/gui/tsconfig.app.json +0 -25
  196. package/gui/tsconfig.json +0 -7
  197. package/gui/tsconfig.node.json +0 -24
  198. package/gui/vite.config.ts +0 -12
  199. package/resources/workflows/plan-implement-review.md +0 -8
  200. package/resources/workflows/research-verify.md +0 -6
  201. package/resources/workflows/solo-developer.md +0 -3
  202. package/scripts/simulate-workspaces.ts +0 -55
  203. package/skills-lock.json +0 -11
  204. package/src/analyzers/detect-apis.ts +0 -290
  205. package/src/analyzers/detect-deps.ts +0 -315
  206. package/src/analyzers/detect-existing.ts +0 -74
  207. package/src/analyzers/detect-ports.ts +0 -110
  208. package/src/analyzers/index.ts +0 -97
  209. package/src/analyzers/messaging-analyzer.ts +0 -254
  210. package/src/analyzers/readme-summarizer.ts +0 -102
  211. package/src/analyzers/run-analyzer.ts +0 -269
  212. package/src/analyzers/tech-stack.ts +0 -283
  213. package/src/commands/adapter.ts +0 -348
  214. package/src/commands/add-repo.ts +0 -156
  215. package/src/commands/commands.test.ts +0 -156
  216. package/src/commands/commit.ts +0 -131
  217. package/src/commands/config.ts +0 -52
  218. package/src/commands/create.ts +0 -204
  219. package/src/commands/desktop.ts +0 -128
  220. package/src/commands/diff.ts +0 -125
  221. package/src/commands/doctor.ts +0 -370
  222. package/src/commands/handoff.ts +0 -266
  223. package/src/commands/init.ts +0 -134
  224. package/src/commands/list.ts +0 -46
  225. package/src/commands/logs.ts +0 -63
  226. package/src/commands/mcp.ts +0 -94
  227. package/src/commands/open.ts +0 -129
  228. package/src/commands/refresh.ts +0 -137
  229. package/src/commands/remove.ts +0 -98
  230. package/src/commands/start.ts +0 -117
  231. package/src/commands/status.ts +0 -54
  232. package/src/commands/stop.ts +0 -55
  233. package/src/commands/sync.ts +0 -125
  234. package/src/commands/tui.ts +0 -484
  235. package/src/commands/ui.ts +0 -111
  236. package/src/core/adapters/local-storage.ts +0 -66
  237. package/src/core/adapters/obsidian-storage.ts +0 -151
  238. package/src/core/adapters/registry.ts +0 -44
  239. package/src/core/adapters/storage.test.ts +0 -174
  240. package/src/core/adapters/vault-storage.ts +0 -86
  241. package/src/core/config.test.ts +0 -96
  242. package/src/core/config.ts +0 -140
  243. package/src/core/graph.ts +0 -344
  244. package/src/core/plugins/index.ts +0 -17
  245. package/src/core/plugins/loader.ts +0 -36
  246. package/src/core/ports/storage.ts +0 -71
  247. package/src/core/scanner.test.ts +0 -61
  248. package/src/core/scanner.ts +0 -91
  249. package/src/core/storage.ts +0 -37
  250. package/src/core/sync.ts +0 -121
  251. package/src/core/workspace-state.test.ts +0 -108
  252. package/src/core/workspace-state.ts +0 -130
  253. package/src/core/workspace.ts +0 -487
  254. package/src/core/worktree.ts +0 -120
  255. package/src/generators/antigravity.ts +0 -32
  256. package/src/generators/base.ts +0 -243
  257. package/src/generators/claude.ts +0 -34
  258. package/src/generators/codex.ts +0 -48
  259. package/src/generators/copilot.ts +0 -56
  260. package/src/generators/cursor.ts +0 -44
  261. package/src/generators/diff-context.ts +0 -75
  262. package/src/generators/index.ts +0 -322
  263. package/src/generators/map-generator.test.ts +0 -159
  264. package/src/generators/map-generator.ts +0 -539
  265. package/src/generators/plan-generator.ts +0 -483
  266. package/src/generators/skills-generator.ts +0 -259
  267. package/src/index.ts +0 -539
  268. package/src/mcp/server.ts +0 -338
  269. package/src/orchestration/detect.ts +0 -313
  270. package/src/orchestration/index.ts +0 -7
  271. package/src/orchestration/runner.ts +0 -283
  272. package/src/server.test.ts +0 -618
  273. package/src/server.ts +0 -1402
  274. package/src/types.ts +0 -451
  275. package/src/utils/detect-ai.test.ts +0 -44
  276. package/src/utils/detect-ai.ts +0 -84
  277. package/src/utils/detect-editors.test.ts +0 -48
  278. package/src/utils/detect-editors.ts +0 -57
  279. package/src/utils/git.test.ts +0 -74
  280. package/src/utils/git.ts +0 -117
  281. package/src/utils/local-ai.test.ts +0 -130
  282. package/src/utils/local-ai.ts +0 -116
  283. package/src/utils/multi-git.test.ts +0 -158
  284. package/src/utils/multi-git.ts +0 -405
  285. package/src/utils/prompts.ts +0 -209
  286. package/src/utils/session-finder.ts +0 -483
  287. package/src/utils/system-scanner.test.ts +0 -89
  288. package/src/utils/system-scanner.ts +0 -96
  289. package/src/utils/update-check.ts +0 -286
  290. package/src/utils/workflow-advisor.ts +0 -118
  291. package/src/utils/workflows.test.ts +0 -114
  292. package/src/utils/workflows.ts +0 -178
  293. package/tsconfig.json +0 -19
  294. package/vitest.config.ts +0 -14
@@ -1,131 +0,0 @@
1
- /**
2
- * @module commands/commit
3
- * Commits changes across all repositories in the workspace.
4
- */
5
-
6
- import chalk from 'chalk';
7
- import { select } from '@inquirer/prompts';
8
- import * as path from 'node:path';
9
- import * as fs from 'node:fs/promises';
10
-
11
- import { loadConfig } from '../core/config.js';
12
- import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
13
- import { getWorkspaceRepos, getRepoStatus, commitAndPush } from '../utils/multi-git.js';
14
-
15
- interface CommitOptions {
16
- noPush?: boolean;
17
- dryRun?: boolean;
18
- }
19
-
20
- /**
21
- * Executes the commit command.
22
- *
23
- * @param message - The commit message.
24
- * @param workspaceArg - Optional workspace path.
25
- * @param options - Optional flags.
26
- */
27
- export async function commitCommand(
28
- message: string,
29
- workspaceArg?: string,
30
- options?: CommitOptions,
31
- ): Promise<void> {
32
- console.log(chalk.bold.cyan('\n💾 NexusFlow — Committing Workspace Changes\n'));
33
-
34
- const workspacePath = await resolveWorkspace(workspaceArg);
35
- if (!workspacePath) return;
36
-
37
- const feature = await loadFeatureConfig(workspacePath);
38
- if (!feature) {
39
- console.error(chalk.red('✖ Failed to load workspace configuration.'));
40
- return;
41
- }
42
-
43
- const repos = await getWorkspaceRepos(workspacePath);
44
- const changedRepos = [];
45
-
46
- for (const repo of repos) {
47
- const status = await getRepoStatus(repo.path);
48
- if (status.hasChanges) {
49
- changedRepos.push({ repo, status });
50
- }
51
- }
52
-
53
- if (changedRepos.length === 0) {
54
- console.log(chalk.green('✅ No changes to commit across any repositories.\n'));
55
- return;
56
- }
57
-
58
- console.log(`Found ${chalk.bold(changedRepos.length)} repositor${changedRepos.length === 1 ? 'y' : 'ies'} with changes.`);
59
- if (options?.dryRun) {
60
- console.log(chalk.yellow('⚠️ Dry run mode enabled. No changes will actually be committed or pushed.'));
61
- }
62
- console.log();
63
-
64
- for (const { repo, status } of changedRepos) {
65
- console.log(`Repository: ${chalk.bold(repo.name)}`);
66
- console.log(chalk.dim(` Changes: ${status.summary}`));
67
- for (const file of status.changedFiles) {
68
- console.log(` ${chalk.yellow('M')} ${file}`);
69
- }
70
-
71
- if (options?.dryRun) {
72
- console.log(chalk.dim(' [Dry Run] Would commit and ' + (options?.noPush ? 'not push' : 'push')));
73
- continue;
74
- }
75
-
76
- const spinner = chalk.dim(' Committing...');
77
- process.stdout.write(spinner);
78
-
79
- const result = await commitAndPush(repo.path, message, repo.branchName, {
80
- noPush: options?.noPush,
81
- });
82
-
83
- process.stdout.write('\r' + ' '.repeat(spinner.length) + '\r');
84
-
85
- if (result.success) {
86
- const action = options?.noPush ? 'Committed' : 'Committed & pushed';
87
- console.log(` ${chalk.green('✅')} ${action} (${chalk.cyan(result.commitHash || 'no hash')})`);
88
- } else {
89
- console.log(` ${chalk.red('✖')} Failed: ${result.message}`);
90
- }
91
- }
92
-
93
- console.log();
94
- }
95
-
96
- /**
97
- * Resolves workspace path.
98
- */
99
- async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
100
- if (workspaceArg) {
101
- const absolutePath = path.resolve(workspaceArg);
102
- try {
103
- await fs.access(path.join(absolutePath, 'nexusflow.json'));
104
- return absolutePath;
105
- } catch {
106
- console.error(chalk.red(`✖ Invalid workspace: No nexusflow.json found at ${absolutePath}`));
107
- return null;
108
- }
109
- }
110
-
111
- const cwdFeature = await loadFeatureConfig(process.cwd());
112
- if (cwdFeature) return cwdFeature.workspacePath;
113
-
114
- const config = await loadConfig();
115
- const workspaces = await listWorkspaces(config.workspacesDir);
116
-
117
- if (workspaces.length === 0) {
118
- console.log(chalk.yellow('No workspaces found.\n'));
119
- return null;
120
- }
121
-
122
- const selected = await select({
123
- message: 'Select a workspace to commit:',
124
- choices: workspaces.map((ws) => ({
125
- name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
126
- value: ws.workspacePath,
127
- })),
128
- });
129
-
130
- return selected;
131
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * @module commands/config
3
- * CLI command to view and update NexusFlow configuration.
4
- *
5
- * Usage:
6
- * nexusflow config # Show current config
7
- * nexusflow config set storageProvider local # Set a config key
8
- * nexusflow config get storageProvider # Get a specific key
9
- */
10
-
11
- import { loadConfig, saveConfig } from '../core/config.js';
12
-
13
- /**
14
- * Displays the current NexusFlow configuration.
15
- */
16
- export async function configShowCommand(): Promise<void> {
17
- const config = await loadConfig();
18
- console.log('\n⚙️ NexusFlow Configuration\n');
19
- console.log(JSON.stringify(config, null, 2));
20
- console.log();
21
- }
22
-
23
- /**
24
- * Gets a specific configuration key.
25
- */
26
- export async function configGetCommand(key: string): Promise<void> {
27
- const config = await loadConfig();
28
- const value = (config as unknown as Record<string, unknown>)[key];
29
-
30
- if (value === undefined) {
31
- console.log(` Key "${key}" is not set.`);
32
- } else {
33
- console.log(` ${key} = ${typeof value === 'object' ? JSON.stringify(value, null, 2) : String(value)}`);
34
- }
35
- }
36
-
37
- /**
38
- * Sets a specific configuration key.
39
- */
40
- export async function configSetCommand(key: string, value: string): Promise<void> {
41
- const config = await loadConfig();
42
-
43
- // Parse booleans and numbers
44
- let parsed: unknown = value;
45
- if (value === 'true') parsed = true;
46
- else if (value === 'false') parsed = false;
47
- else if (!isNaN(Number(value)) && value.trim() !== '') parsed = Number(value);
48
-
49
- (config as unknown as Record<string, unknown>)[key] = parsed;
50
- await saveConfig(config);
51
- console.log(` ✔ Set ${key} = ${String(parsed)}`);
52
- }
@@ -1,204 +0,0 @@
1
- /**
2
- * @module commands/create
3
- * The main "create workspace" command — the core NexusFlow workflow.
4
- * Mirrors and enhances the user's existing Create-Workspace.ps1 script.
5
- */
6
-
7
- import chalk from 'chalk';
8
- import ora from 'ora';
9
- import path from 'node:path';
10
- import { execa } from 'execa';
11
-
12
- import { confirm } from '@inquirer/prompts';
13
-
14
- import { loadConfig } from '../core/config.js';
15
- import { scanForRepos } from '../core/scanner.js';
16
- import { createWorkspace } from '../core/workspace.js';
17
- import { generateContextFiles } from '../generators/index.js';
18
- import { analyzeAllRepos } from '../analyzers/index.js';
19
- import { detectAIAssistants } from '../utils/detect-ai.js';
20
- import { detectEditors } from '../utils/detect-editors.js';
21
- import {
22
- promptBranchName,
23
- promptDescription,
24
- promptSelectRepos,
25
- promptSelectAI,
26
- promptSelectEditor,
27
- } from '../utils/prompts.js';
28
- import type { Feature, WorkspaceContext } from '../types.js';
29
- import { suggestWorkflow } from '../utils/workflow-advisor.js';
30
-
31
- /**
32
- * Executes the full "create workspace" flow:
33
- * 1. Prompt for branch name
34
- * 2. Prompt for feature description
35
- * 3. Scan for repos and let user pick
36
- * 4. Detect AI assistants and let user pick
37
- * 5. Create workspace with git worktrees
38
- * 6. Generate AI context files
39
- * 7. Optionally open in editor
40
- */
41
- export async function createCommand(): Promise<void> {
42
- console.log(
43
- chalk.bold.cyan('\n🚀 NexusFlow — Create Feature Workspace\n'),
44
- );
45
-
46
- // ── 1. Branch name ──────────────────────────────────────────────────
47
- const branchName = await promptBranchName();
48
-
49
- // ── 2. Feature description ──────────────────────────────────────────
50
- const description = await promptDescription();
51
-
52
- // ── 3. Scan for repos ───────────────────────────────────────────────
53
- const config = await loadConfig();
54
- const spinner = ora('Scanning for projects...').start();
55
-
56
- let repos;
57
- try {
58
- repos = await scanForRepos(config.devDir, config.scanDepth);
59
- spinner.succeed(`Found ${chalk.bold(repos.length)} projects in ${config.devDir}`);
60
- } catch (error) {
61
- spinner.fail('Failed to scan for projects');
62
- throw error;
63
- }
64
-
65
- if (repos.length === 0) {
66
- console.log(chalk.yellow('No git projects found. Check your devDir setting.'));
67
- return;
68
- }
69
-
70
- // ── 4. Select repos ────────────────────────────────────────────────
71
- const selectedRepos = await promptSelectRepos(repos);
72
- if (selectedRepos.length === 0) {
73
- console.log(chalk.yellow('No projects selected. Exiting.'));
74
- return;
75
- }
76
-
77
- console.log(
78
- chalk.dim(` Selected: ${selectedRepos.map((r) => r.name).join(', ')}`),
79
- );
80
-
81
- // ── 5. Detect and select AI assistants ──────────────────────────────
82
- const detectedAI = await detectAIAssistants();
83
- const selectedAI = await promptSelectAI(detectedAI);
84
-
85
- const localLlmEnabled = config.localLlm?.enabled
86
- ? await confirm({ message: 'Enable Local AI Co-processor in this workspace context?', default: true })
87
- : false;
88
-
89
- // ── 5.5. Suggest workflow strategy ───────────────────────────────
90
- const workflowSpinner = ora('Suggesting teamwork collaboration strategy...').start();
91
- let teamworkInstructions = '';
92
- try {
93
- const suggestion = await suggestWorkflow(description, selectedRepos, config.localLlm);
94
- teamworkInstructions = suggestion.customInstructions;
95
- workflowSpinner.succeed(`Auto-selected strategy for ${chalk.bold(suggestion.difficulty)} difficulty task`);
96
- } catch (err) {
97
- workflowSpinner.fail('Failed to suggest teamwork strategy');
98
- }
99
-
100
- // ── 6. Create workspace ─────────────────────────────────────────────
101
- const workspacePath = path.join(config.workspacesDir, branchName);
102
- const feature: Feature = {
103
- id: branchName,
104
- branchName,
105
- description,
106
- repos: selectedRepos.map((r) => path.join(workspacePath, r.name)),
107
- originalRepos: selectedRepos.map((r) => r.path),
108
- assistants: selectedAI,
109
- workspacePath,
110
- createdAt: new Date().toISOString(),
111
- localLlmEnabled,
112
- teamworkInstructions,
113
- };
114
-
115
- const wsSpinner = ora('Creating workspace with git worktrees...').start();
116
- try {
117
- await createWorkspace(feature, selectedRepos);
118
- wsSpinner.succeed(`Workspace created at ${chalk.bold(workspacePath)}`);
119
- } catch (error) {
120
- wsSpinner.fail('Failed to create workspace');
121
- const message = error instanceof Error ? error.message : String(error);
122
- console.error(chalk.red(` ${message}`));
123
- return;
124
- }
125
-
126
- // ── 7. Analyze projects ─────────────────────────────────────────────
127
- console.log(chalk.cyan('\nAnalyzing projects...'));
128
- const workspaceRepos = selectedRepos.map((repo) => ({
129
- ...repo,
130
- path: path.join(workspacePath, repo.name),
131
- }));
132
- const analysis = await analyzeAllRepos(workspaceRepos);
133
-
134
- // ── 8. Generate AI context files ────────────────────────────────────
135
- const ctx: WorkspaceContext = { feature, repos: workspaceRepos, analysis, localLlm: config.localLlm };
136
- console.log(chalk.cyan('\nGenerating AI context files...'));
137
- await generateContextFiles(ctx, selectedAI, workspacePath);
138
-
139
- // Monolithic XML context packing removed.
140
-
141
- // ── 8. Open in editor ───────────────────────────────────────────────
142
- const detectedEditors = await detectEditors();
143
- const editor = await promptSelectEditor(detectedEditors);
144
-
145
- if (editor) {
146
- const editorSpinner = ora(`Opening in ${editor.name}...`).start();
147
- try {
148
- await execa(editor.command, [workspacePath], {
149
- stdio: 'ignore',
150
- shell: process.platform === 'win32',
151
- });
152
- editorSpinner.succeed(`Opened in ${editor.name}`);
153
- } catch {
154
- editorSpinner.warn(
155
- `Could not open ${editor.name}. Open manually:\n ${chalk.dim(`cd "${workspacePath}"`)}`,
156
- );
157
- }
158
- }
159
-
160
- // ── Done ────────────────────────────────────────────────────────────
161
- console.log(
162
- chalk.bold.green('\n✅ Workspace ready!\n'),
163
- );
164
- console.log(` ${chalk.dim('Path:')} ${workspacePath}`);
165
- console.log(` ${chalk.dim('Branch:')} ${branchName}`);
166
- console.log(` ${chalk.dim('Repos:')} ${selectedRepos.map((r) => r.name).join(', ')}`);
167
- console.log(` ${chalk.dim('AI:')} ${selectedAI.join(', ')}`);
168
- console.log(` ${chalk.dim('Local AI:')} ${localLlmEnabled ? 'Enabled' : 'Disabled'}`);
169
- console.log(
170
- `\n ${chalk.dim('To navigate:')} cd "${workspacePath}"`,
171
- );
172
- console.log();
173
-
174
- // ── 9. Start AI Assistant Session ───────────────────────────────────
175
- if (selectedAI.length > 0) {
176
- const assistant = selectedAI[0];
177
- const confirmStart = await confirm({
178
- message: `Do you want to start a session with ${assistant} inside the workspace now?`,
179
- default: true,
180
- });
181
-
182
- if (confirmStart) {
183
- console.log(chalk.cyan(`\n🚀 Starting ${assistant} session inside workspace...\n`));
184
-
185
- let cmd = 'agy';
186
- if (assistant === 'claude') cmd = 'claude';
187
- else if (assistant === 'codex') cmd = 'codex';
188
- else if (assistant === 'copilot') cmd = 'copilot';
189
-
190
- try {
191
- await execa(cmd, [], {
192
- cwd: workspacePath,
193
- stdio: 'inherit',
194
- shell: process.platform === 'win32',
195
- });
196
- console.log(chalk.green(`\n👋 Exited ${assistant} session.`));
197
- } catch {
198
- console.log(
199
- chalk.yellow(`\n⚠️ Could not start ${assistant}. Please start it manually:\n ${chalk.dim(`cd "${workspacePath}" && ${cmd}`)}`)
200
- );
201
- }
202
- }
203
- }
204
- }
@@ -1,128 +0,0 @@
1
- /**
2
- * @module commands/desktop
3
- * Launches the NexusFlow desktop application (Neutralinojs).
4
- */
5
-
6
- import { spawn } from 'node:child_process';
7
- import { existsSync } from 'node:fs';
8
- import path from 'node:path';
9
- import { fileURLToPath } from 'node:url';
10
- import chalk from 'chalk';
11
-
12
- /**
13
- * Resolves the workspace root directory.
14
- *
15
- * Assumes the standard NexusFlow workspace layout where the `desktop/`
16
- * project is a sibling of the `NexusFlow/` project under the same
17
- * workspace root:
18
- *
19
- * <workspace-root>/
20
- * NexusFlow/ ← this CLI project
21
- * desktop/ ← Neutralinojs desktop app
22
- * dist/nexusflow-desktop/<platform-binary>
23
- *
24
- * At runtime this file is compiled to `NexusFlow/dist/commands/desktop.js`,
25
- * so the workspace root is three levels up.
26
- */
27
- function resolveWorkspaceRoot(): string {
28
- const thisDir = path.dirname(fileURLToPath(import.meta.url));
29
- return path.resolve(thisDir, '..', '..', '..');
30
- }
31
-
32
- /**
33
- * Returns the desktop dist directory path.
34
- */
35
- function getDesktopDistDir(): string {
36
- return path.join(resolveWorkspaceRoot(), 'desktop', 'dist', 'nexusflow-desktop');
37
- }
38
-
39
- /**
40
- * Resolves the platform-specific binary path for the desktop app.
41
- *
42
- * On macOS the architecture is taken into account:
43
- * - arm64 → `nexusflow-desktop-mac_arm64`
44
- * - x64 → prefers `nexusflow-desktop-mac_x64`, falls back to universal
45
- */
46
- function findDesktopBinary(): string | null {
47
- const desktopDistDir = getDesktopDistDir();
48
- const platform = process.platform;
49
- const arch = process.arch;
50
- let binaryName: string;
51
-
52
- if (platform === 'win32') {
53
- binaryName = 'nexusflow-desktop-win_x64.exe';
54
- } else if (platform === 'darwin') {
55
- if (arch === 'arm64') {
56
- binaryName = 'nexusflow-desktop-mac_arm64';
57
- } else {
58
- // Prefer smaller x64 binary, fall back to universal
59
- const x64Path = path.join(desktopDistDir, 'nexusflow-desktop-mac_x64');
60
- binaryName = existsSync(x64Path) ? 'nexusflow-desktop-mac_x64' : 'nexusflow-desktop-mac_universal';
61
- }
62
- } else {
63
- // Linux — detect ARM architectures
64
- if (arch === 'arm64') {
65
- binaryName = 'nexusflow-desktop-linux_arm64';
66
- } else if (arch === 'arm') {
67
- binaryName = 'nexusflow-desktop-linux_armhf';
68
- } else {
69
- binaryName = 'nexusflow-desktop-linux_x64';
70
- }
71
- }
72
-
73
- const fullPath = path.join(desktopDistDir, binaryName);
74
- return existsSync(fullPath) ? fullPath : null;
75
- }
76
-
77
- /**
78
- * Returns the expected binary path for display in the "not found" message.
79
- */
80
- function getExpectedBinaryPath(): string {
81
- const desktopDistDir = getDesktopDistDir();
82
- switch (process.platform) {
83
- case 'win32':
84
- return path.join(desktopDistDir, 'nexusflow-desktop-win_x64.exe');
85
- case 'darwin':
86
- return path.join(desktopDistDir, 'nexusflow-desktop-mac_*');
87
- case 'linux':
88
- default:
89
- return path.join(desktopDistDir, 'nexusflow-desktop-linux_x64');
90
- }
91
- }
92
-
93
- /**
94
- * Launches the NexusFlow desktop application.
95
- *
96
- * Spawns the process detached and unrefs it so the CLI exits immediately
97
- * while the desktop app keeps running.
98
- */
99
- export async function desktopCommand(): Promise<void> {
100
- console.log(chalk.bold.cyan('\n🖥️ NexusFlow — Desktop App\n'));
101
-
102
- const binaryPath = findDesktopBinary();
103
-
104
- if (!binaryPath) {
105
- const expectedPath = getExpectedBinaryPath();
106
- console.log(chalk.yellow('Desktop binary not found at:'));
107
- console.log(chalk.dim(` ${expectedPath}\n`));
108
- console.log(chalk.white('To build it, run:\n'));
109
- console.log(chalk.green(' cd desktop && npm install && npm run build\n'));
110
- return;
111
- }
112
-
113
- console.log(chalk.dim(`Launching ${path.basename(binaryPath)}…`));
114
-
115
- const child = spawn(binaryPath, [], {
116
- detached: true,
117
- stdio: 'ignore',
118
- cwd: path.dirname(binaryPath), // Required: Neutralino looks for resources.neu in cwd
119
- });
120
-
121
- child.on('error', (err) => {
122
- console.error(chalk.red(` ✖ Desktop app process error: ${err.message}`));
123
- });
124
-
125
- child.unref();
126
-
127
- console.log(chalk.green('Desktop app launched successfully.\n'));
128
- }
@@ -1,125 +0,0 @@
1
- /**
2
- * @module commands/diff
3
- * Displays diff summaries across all repositories in a workspace.
4
- */
5
-
6
- import chalk from 'chalk';
7
- import { select } from '@inquirer/prompts';
8
- import * as path from 'node:path';
9
- import * as fs from 'node:fs/promises';
10
-
11
- import { loadConfig } from '../core/config.js';
12
- import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
13
- import { getWorkspaceRepos, getRepoStatus, getDiffSummary } from '../utils/multi-git.js';
14
-
15
- /**
16
- * Executes the diff command.
17
- *
18
- * @param workspaceArg - Optional workspace path.
19
- */
20
- export async function diffCommand(workspaceArg?: string): Promise<void> {
21
- console.log(chalk.bold.cyan('\n🔍 NexusFlow — Workspace Diff Summary\n'));
22
-
23
- const workspacePath = await resolveWorkspace(workspaceArg);
24
- if (!workspacePath) return;
25
-
26
- const feature = await loadFeatureConfig(workspacePath);
27
- if (!feature) {
28
- console.error(chalk.red('✖ Failed to load workspace configuration.'));
29
- return;
30
- }
31
-
32
- const repos = await getWorkspaceRepos(workspacePath);
33
- let cleanCount = 0;
34
-
35
- const results: Array<{
36
- name: string;
37
- filesChanged: number;
38
- additions: number;
39
- deletions: number;
40
- summary: string;
41
- }> = [];
42
-
43
- for (const repo of repos) {
44
- const status = await getRepoStatus(repo.path);
45
- if (!status.hasChanges) {
46
- cleanCount++;
47
- continue;
48
- }
49
-
50
- const diff = await getDiffSummary(repo.path);
51
- results.push({
52
- name: repo.name,
53
- filesChanged: status.changedFiles.length,
54
- additions: diff.additions,
55
- deletions: diff.deletions,
56
- summary: diff.summary,
57
- });
58
- }
59
-
60
- if (results.length === 0) {
61
- console.log(chalk.green('✅ All repositories are clean.\n'));
62
- return;
63
- }
64
-
65
- // Print unified table
66
- console.log(chalk.bold('Repository'.padEnd(25) + ' | ' + 'Files'.padEnd(6) + ' | ' + 'Additions'.padEnd(10) + ' | ' + 'Deletions'.padEnd(10)));
67
- console.log(chalk.dim('─'.repeat(61)));
68
-
69
- for (const res of results) {
70
- const fileStr = res.filesChanged.toString().padEnd(6);
71
- const addStr = `+${res.additions}`.padEnd(10);
72
- const delStr = `-${res.deletions}`.padEnd(10);
73
- console.log(
74
- chalk.bold(res.name.padEnd(25)) + ' | ' +
75
- fileStr + ' | ' +
76
- chalk.green(addStr) + ' | ' +
77
- chalk.red(delStr)
78
- );
79
- }
80
-
81
- console.log('\n' + chalk.bold('Detailed Diff Stats:'));
82
- for (const res of results) {
83
- console.log(`\n📂 ${chalk.bold.cyan(res.name)}:`);
84
- console.log(chalk.dim(res.summary.split('\n').map(l => ` ${l}`).join('\n')));
85
- }
86
-
87
- console.log();
88
- }
89
-
90
- /**
91
- * Resolves workspace path.
92
- */
93
- async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
94
- if (workspaceArg) {
95
- const absolutePath = path.resolve(workspaceArg);
96
- try {
97
- await fs.access(path.join(absolutePath, 'nexusflow.json'));
98
- return absolutePath;
99
- } catch {
100
- console.error(chalk.red(`✖ Invalid workspace: No nexusflow.json found at ${absolutePath}`));
101
- return null;
102
- }
103
- }
104
-
105
- const cwdFeature = await loadFeatureConfig(process.cwd());
106
- if (cwdFeature) return cwdFeature.workspacePath;
107
-
108
- const config = await loadConfig();
109
- const workspaces = await listWorkspaces(config.workspacesDir);
110
-
111
- if (workspaces.length === 0) {
112
- console.log(chalk.yellow('No workspaces found.\n'));
113
- return null;
114
- }
115
-
116
- const selected = await select({
117
- message: 'Select a workspace to view diff:',
118
- choices: workspaces.map((ws) => ({
119
- name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
120
- value: ws.workspacePath,
121
- })),
122
- });
123
-
124
- return selected;
125
- }