@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,283 +0,0 @@
1
- /**
2
- * @module orchestration/runner
3
- * Manages the lifecycle of services — start, stop, status, and log streaming.
4
- * Uses PM2 for process management.
5
- */
6
-
7
- import * as fs from 'node:fs/promises';
8
- import * as path from 'node:path';
9
- import chalk from 'chalk';
10
- import { execa } from 'execa';
11
-
12
- import type { ServiceConfig, RunningService, RunningState } from '../types.js';
13
-
14
- /** Name of the state file that tracks running services. */
15
- const STATE_FILE = '.nexusflow-running.json';
16
-
17
- /**
18
- * Returns the path to the running-state file for a workspace.
19
- */
20
- function getStatePath(workspacePath: string): string {
21
- return path.join(workspacePath, STATE_FILE);
22
- }
23
-
24
- /**
25
- * Loads the running state from disk, syncing active status with PM2.
26
- */
27
- export async function loadRunningState(workspacePath: string): Promise<RunningState | null> {
28
- try {
29
- const raw = await fs.readFile(getStatePath(workspacePath), 'utf-8');
30
- const state = JSON.parse(raw) as RunningState;
31
-
32
- try {
33
- // Query current PM2 process list to verify actual running status
34
- const { stdout } = await execa('npx', ['pm2', 'jlist']);
35
- const pm2List = JSON.parse(stdout);
36
- const workspaceId = path.basename(workspacePath);
37
- const prefix = `nexusflow-${workspaceId}-`;
38
-
39
- const activeServices = state.services.map((service) => {
40
- const uniqueName = `${prefix}${service.name}`;
41
- const pm2App = pm2List.find((app: any) => app.name === uniqueName);
42
- const running = pm2App && pm2App.pm2_env?.status === 'online';
43
- return {
44
- ...service,
45
- pid: running ? (pm2App.pid || service.pid) : 0,
46
- };
47
- }).filter((service) => service.pid > 0);
48
-
49
- return {
50
- ...state,
51
- services: activeServices,
52
- updatedAt: new Date().toISOString(),
53
- };
54
- } catch {
55
- // Fallback to cached state on disk if PM2 query fails
56
- return state;
57
- }
58
- } catch {
59
- return null;
60
- }
61
- }
62
-
63
- /**
64
- * Saves the running state to disk.
65
- */
66
- async function saveRunningState(state: RunningState): Promise<void> {
67
- const data = JSON.stringify(state, null, 2) + '\n';
68
- await fs.writeFile(getStatePath(state.workspacePath), data, 'utf-8');
69
- }
70
-
71
- /**
72
- * Clears the running state file.
73
- */
74
- async function clearRunningState(workspacePath: string): Promise<void> {
75
- try {
76
- await fs.unlink(getStatePath(workspacePath));
77
- } catch {
78
- // File doesn't exist, that's fine
79
- }
80
- }
81
-
82
- /**
83
- * Starts all services in the given list using PM2.
84
- *
85
- * @param services - Services to start.
86
- * @param workspacePath - Workspace root path.
87
- * @param logDir - Directory to write log files to.
88
- */
89
- export async function startServices(
90
- services: ServiceConfig[],
91
- workspacePath: string,
92
- logDir: string,
93
- ): Promise<void> {
94
- // Ensure log directory exists
95
- await fs.mkdir(logDir, { recursive: true });
96
-
97
- const runningServices: RunningService[] = [];
98
- const workspaceId = path.basename(workspacePath);
99
-
100
- for (const service of services) {
101
- const logFile = path.join(logDir, `${service.name}.log`);
102
- const portStr = service.port ? ` on port ${service.port}` : '';
103
- const uniqueName = `nexusflow-${workspaceId}-${service.name}`;
104
-
105
- console.log(
106
- chalk.cyan(` Starting ${chalk.bold(service.name)}${portStr} under PM2...`),
107
- );
108
- console.log(
109
- chalk.dim(` ${service.command} ${service.args.join(' ')} (in ${service.cwd})`),
110
- );
111
-
112
- try {
113
- // Ensure parent directory for this log file exists
114
- await fs.mkdir(path.dirname(logFile), { recursive: true });
115
-
116
- // Delete any existing PM2 configuration with the same name to avoid duplicate starts
117
- await execa('npx', ['pm2', 'delete', uniqueName], { reject: false });
118
-
119
- // Start the service using PM2 as a direct process execution
120
- await execa('npx', [
121
- 'pm2',
122
- 'start',
123
- service.command,
124
- '--name',
125
- uniqueName,
126
- '--cwd',
127
- service.cwd,
128
- '-o',
129
- logFile,
130
- '-e',
131
- logFile,
132
- '--interpreter',
133
- 'none',
134
- '--',
135
- ...service.args
136
- ]);
137
-
138
- // Retrieve the real PID from PM2
139
- const { stdout } = await execa('npx', ['pm2', 'jlist']);
140
- const pm2List = JSON.parse(stdout);
141
- const pm2App = pm2List.find((app: any) => app.name === uniqueName);
142
- const pid = pm2App?.pid || 0;
143
-
144
- if (pid) {
145
- runningServices.push({
146
- name: service.name,
147
- pid,
148
- config: service,
149
- startedAt: new Date().toISOString(),
150
- });
151
- console.log(chalk.green(` ✔ ${service.name} started under PM2 (PID: ${pid})`));
152
- } else {
153
- console.warn(chalk.yellow(` ⚠ Started ${service.name} but could not resolve PID from PM2.`));
154
- }
155
- } catch (error) {
156
- const msg = error instanceof Error ? error.message : String(error);
157
- console.error(chalk.red(` ✖ Failed to start ${service.name} via PM2: ${msg}`));
158
- }
159
- }
160
-
161
- // Save state
162
- if (runningServices.length > 0) {
163
- await saveRunningState({
164
- workspacePath,
165
- services: runningServices,
166
- updatedAt: new Date().toISOString(),
167
- });
168
- }
169
- }
170
-
171
- /**
172
- * Stops all services for a workspace under PM2.
173
- *
174
- * @param workspacePath - Workspace root path.
175
- */
176
- export async function stopServices(workspacePath: string): Promise<void> {
177
- const workspaceId = path.basename(workspacePath);
178
- const prefix = `nexusflow-${workspaceId}-`;
179
-
180
- console.log(chalk.cyan(` Stopping all services under PM2 for workspace: ${workspaceId}...`));
181
-
182
- try {
183
- const { stdout } = await execa('npx', ['pm2', 'jlist']);
184
- const pm2List = JSON.parse(stdout);
185
- const targetApps = pm2List.filter((app: any) => app.name && app.name.startsWith(prefix));
186
-
187
- if (targetApps.length === 0) {
188
- console.log(chalk.yellow(' No running services found for this workspace.'));
189
- } else {
190
- for (const app of targetApps) {
191
- console.log(chalk.dim(` Stopping PM2 process: ${app.name}`));
192
- await execa('npx', ['pm2', 'delete', app.name], { reject: false });
193
- }
194
- console.log(chalk.green(` ✔ All services stopped.`));
195
- }
196
- } catch (error: any) {
197
- console.error(chalk.red(` ✖ Failed to stop services via PM2: ${error.message}`));
198
- }
199
-
200
- await clearRunningState(workspacePath);
201
- }
202
-
203
- /**
204
- * Shows the status of all services in a workspace by querying PM2.
205
- *
206
- * @param workspacePath - Workspace root path.
207
- */
208
- export async function getServiceStatus(workspacePath: string): Promise<void> {
209
- const workspaceId = path.basename(workspacePath);
210
- const prefix = `nexusflow-${workspaceId}-`;
211
-
212
- try {
213
- const { stdout } = await execa('npx', ['pm2', 'jlist']);
214
- const pm2List = JSON.parse(stdout);
215
- const targetApps = pm2List.filter((app: any) => app.name && app.name.startsWith(prefix));
216
-
217
- if (targetApps.length === 0) {
218
- console.log(chalk.yellow(' No running services found for this workspace in PM2.'));
219
- return;
220
- }
221
-
222
- for (const app of targetApps) {
223
- const name = app.name.substring(prefix.length);
224
- const running = app.pm2_env?.status === 'online';
225
- const status = running ? chalk.green('● running') : chalk.red(`● ${app.pm2_env?.status || 'stopped'}`);
226
- const pid = app.pid || 'N/A';
227
- const uptime = app.pm2_env?.pm_uptime ? new Date(app.pm2_env.pm_uptime).toLocaleTimeString() : 'unknown';
228
-
229
- console.log(
230
- ` ${status} ${chalk.bold(name)} (PID: ${pid}, since ${uptime})`,
231
- );
232
- }
233
- } catch (error: any) {
234
- console.error(chalk.red(` ✖ Failed to query PM2 status: ${error.message}`));
235
- }
236
- }
237
-
238
- /**
239
- * Tails log files for all services in a workspace.
240
- *
241
- * @param workspacePath - Workspace root path.
242
- * @param logDir - Directory containing log files.
243
- * @param lines - Number of lines to show per service.
244
- */
245
- export async function showLogs(
246
- workspacePath: string,
247
- logDir: string,
248
- lines: number = 20,
249
- ): Promise<void> {
250
- let entries: string[];
251
- try {
252
- entries = await fs.readdir(logDir);
253
- } catch {
254
- console.log(chalk.yellow(' No log directory found.'));
255
- return;
256
- }
257
-
258
- const logFiles = entries.filter((e) => e.endsWith('.log'));
259
- if (logFiles.length === 0) {
260
- console.log(chalk.yellow(' No log files found.'));
261
- return;
262
- }
263
-
264
- for (const logFile of logFiles) {
265
- const serviceName = logFile.replace('.log', '');
266
- const filePath = path.join(logDir, logFile);
267
-
268
- try {
269
- const content = await fs.readFile(filePath, 'utf-8');
270
- const allLines = content.split('\n');
271
- const tail = allLines.slice(-lines).join('\n');
272
-
273
- console.log(chalk.bold.cyan(`\n─── ${serviceName} ───`));
274
- if (tail.trim()) {
275
- console.log(tail);
276
- } else {
277
- console.log(chalk.dim(' (no output yet)'));
278
- }
279
- } catch {
280
- console.log(chalk.dim(` Could not read ${logFile}`));
281
- }
282
- }
283
- }