@mrpatronz/nexusflow 0.2.17 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/ccc/SKILL.md +71 -0
- package/.agents/skills/ccc/references/management.md +110 -0
- package/.agents/skills/ccc/references/settings.md +126 -0
- package/.github/dependabot.yml +52 -52
- package/.github/workflows/ci.yml +44 -0
- package/.github/workflows/dependabot-merge.yml +53 -53
- package/.github/workflows/release-desktop.yml +67 -0
- package/.github/workflows/release-npm.yml +65 -0
- package/.github/workflows/release-vscode.yml +61 -0
- package/.vscode/launch.json +17 -17
- package/.vscode/tasks.json +17 -17
- package/GETTING_STARTED.md +114 -114
- package/README.md +364 -336
- package/desktop/build-installer.js +228 -228
- package/desktop/build.js +118 -118
- package/desktop/installer/nexusflow.iss +35 -35
- package/desktop/neutralino.config.json +38 -38
- package/desktop/package-lock.json +1060 -1060
- package/desktop/package.json +14 -14
- package/dist/commands/adapter.d.ts +27 -0
- package/dist/commands/adapter.d.ts.map +1 -0
- package/dist/commands/adapter.js +318 -0
- package/dist/commands/adapter.js.map +1 -0
- package/dist/commands/add-repo.d.ts.map +1 -1
- package/dist/commands/add-repo.js +0 -1
- package/dist/commands/add-repo.js.map +1 -1
- package/dist/commands/commands.test.js +2 -2
- package/dist/commands/commands.test.js.map +1 -1
- package/dist/commands/config.d.ts +22 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +50 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +14 -17
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +11 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/refresh.d.ts +1 -0
- package/dist/commands/refresh.d.ts.map +1 -1
- package/dist/commands/refresh.js +2 -14
- package/dist/commands/refresh.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +0 -5
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/tui.d.ts.map +1 -1
- package/dist/commands/tui.js +63 -10
- package/dist/commands/tui.js.map +1 -1
- package/dist/core/adapters/local-storage.d.ts +14 -0
- package/dist/core/adapters/local-storage.d.ts.map +1 -0
- package/dist/core/adapters/local-storage.js +58 -0
- package/dist/core/adapters/local-storage.js.map +1 -0
- package/dist/core/adapters/obsidian-storage.d.ts +28 -0
- package/dist/core/adapters/obsidian-storage.d.ts.map +1 -0
- package/dist/core/adapters/obsidian-storage.js +135 -0
- package/dist/core/adapters/obsidian-storage.js.map +1 -0
- package/dist/core/adapters/registry.d.ts +8 -0
- package/dist/core/adapters/registry.d.ts.map +1 -0
- package/dist/core/adapters/registry.js +37 -0
- package/dist/core/adapters/registry.js.map +1 -0
- package/dist/core/adapters/storage.test.d.ts +2 -0
- package/dist/core/adapters/storage.test.d.ts.map +1 -0
- package/dist/core/adapters/storage.test.js +106 -0
- package/dist/core/adapters/storage.test.js.map +1 -0
- package/dist/core/adapters/vault-storage.d.ts +16 -0
- package/dist/core/adapters/vault-storage.d.ts.map +1 -0
- package/dist/core/adapters/vault-storage.js +77 -0
- package/dist/core/adapters/vault-storage.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -4
- package/dist/core/config.js.map +1 -1
- package/dist/core/plugins/index.d.ts +14 -0
- package/dist/core/plugins/index.d.ts.map +1 -0
- package/dist/core/plugins/index.js +2 -0
- package/dist/core/plugins/index.js.map +1 -0
- package/dist/core/plugins/loader.d.ts +2 -0
- package/dist/core/plugins/loader.d.ts.map +1 -0
- package/dist/core/plugins/loader.js +34 -0
- package/dist/core/plugins/loader.js.map +1 -0
- package/dist/core/ports/storage.d.ts +59 -0
- package/dist/core/ports/storage.d.ts.map +1 -0
- package/dist/core/ports/storage.js +10 -0
- package/dist/core/ports/storage.js.map +1 -0
- package/dist/core/storage.d.ts +10 -0
- package/dist/core/storage.d.ts.map +1 -0
- package/dist/core/storage.js +29 -0
- package/dist/core/storage.js.map +1 -0
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +110 -16
- package/dist/core/workspace.js.map +1 -1
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +80 -79
- package/dist/generators/base.js.map +1 -1
- package/dist/generators/codex.js +11 -11
- package/dist/generators/copilot.js +17 -17
- package/dist/generators/cursor.js +5 -5
- package/dist/generators/diff-context.d.ts +6 -0
- package/dist/generators/diff-context.d.ts.map +1 -0
- package/dist/generators/diff-context.js +68 -0
- package/dist/generators/diff-context.js.map +1 -0
- package/dist/generators/index.d.ts +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +125 -68
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/map-generator.d.ts.map +1 -1
- package/dist/generators/map-generator.js +21 -25
- package/dist/generators/map-generator.js.map +1 -1
- package/dist/generators/plan-generator.d.ts.map +1 -1
- package/dist/generators/plan-generator.js +3 -5
- package/dist/generators/plan-generator.js.map +1 -1
- package/dist/generators/skills-generator.js +28 -28
- package/dist/gui/assets/index-CB-jWded.css +1 -0
- package/dist/gui/assets/index-DDXpZZu3.js +25 -0
- package/dist/gui/icons.svg +24 -24
- package/dist/gui/index.html +18 -18
- package/dist/index.js +131 -20
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +46 -43
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +105 -48
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +7 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/local-ai.d.ts.map +1 -1
- package/dist/utils/local-ai.js +7 -3
- package/dist/utils/local-ai.js.map +1 -1
- package/dist/utils/update-check.d.ts.map +1 -1
- package/dist/utils/update-check.js +0 -28
- package/dist/utils/update-check.js.map +1 -1
- package/dist/utils/workflow-advisor.d.ts +16 -0
- package/dist/utils/workflow-advisor.d.ts.map +1 -0
- package/dist/utils/workflow-advisor.js +100 -0
- package/dist/utils/workflow-advisor.js.map +1 -0
- package/extension/package-lock.json +6044 -2673
- package/extension/package.json +117 -108
- package/extension/src/extension.ts +653 -631
- package/extension/tsconfig.json +21 -21
- package/gui/README.md +73 -73
- package/gui/e2e/wizard.spec.ts +346 -346
- package/gui/eslint.config.js +26 -26
- package/gui/index.html +17 -17
- package/gui/package-lock.json +3079 -3079
- package/gui/package.json +36 -36
- package/gui/playwright.config.ts +41 -41
- package/gui/public/icons.svg +24 -24
- package/gui/src/App.css +1 -1
- package/gui/src/App.tsx +3632 -3407
- package/gui/src/assets/vite.svg +1 -1
- package/gui/src/features/changes/ChangesViewer.tsx +388 -388
- package/gui/src/features/knowledge/KnowledgeBase.tsx +84 -84
- package/gui/src/features/onboarding/OnboardingWizard.tsx +230 -230
- package/gui/src/features/plan/ImplementationPlan.tsx +32 -32
- package/gui/src/features/services/ServiceConsole.tsx +250 -250
- package/gui/src/features/sessions/SessionHistory.tsx +195 -195
- package/gui/src/features/workspace/WorkspaceList.tsx +666 -666
- package/gui/src/index.css +152 -152
- package/gui/src/main.tsx +94 -94
- package/gui/src/types.ts +62 -62
- package/gui/tsconfig.app.json +25 -25
- package/gui/tsconfig.json +7 -7
- package/gui/tsconfig.node.json +24 -24
- package/gui/vite.config.ts +12 -12
- package/package.json +55 -56
- package/resources/workflows/plan-implement-review.md +8 -8
- package/resources/workflows/research-verify.md +6 -6
- package/resources/workflows/solo-developer.md +3 -3
- package/scripts/simulate-workspaces.ts +55 -55
- package/skills-lock.json +11 -0
- package/src/analyzers/detect-apis.ts +290 -290
- package/src/analyzers/detect-deps.ts +315 -315
- package/src/analyzers/detect-existing.ts +74 -74
- package/src/analyzers/detect-ports.ts +110 -110
- package/src/analyzers/index.ts +97 -97
- package/src/analyzers/messaging-analyzer.ts +254 -254
- package/src/analyzers/readme-summarizer.ts +102 -102
- package/src/analyzers/run-analyzer.ts +269 -269
- package/src/analyzers/tech-stack.ts +283 -283
- package/src/commands/adapter.ts +348 -0
- package/src/commands/add-repo.ts +156 -157
- package/src/commands/commands.test.ts +156 -155
- package/src/commands/commit.ts +131 -131
- package/src/commands/config.ts +52 -0
- package/src/commands/create.ts +204 -207
- package/src/commands/desktop.ts +128 -128
- package/src/commands/diff.ts +125 -125
- package/src/commands/doctor.ts +370 -357
- package/src/commands/handoff.ts +266 -266
- package/src/commands/init.ts +134 -134
- package/src/commands/list.ts +46 -46
- package/src/commands/logs.ts +63 -63
- package/src/commands/mcp.ts +94 -92
- package/src/commands/open.ts +129 -129
- package/src/commands/refresh.ts +137 -147
- package/src/commands/remove.ts +98 -98
- package/src/commands/start.ts +117 -117
- package/src/commands/status.ts +54 -54
- package/src/commands/stop.ts +55 -55
- package/src/commands/sync.ts +147 -151
- package/src/commands/tui.ts +484 -424
- package/src/commands/ui.ts +111 -111
- package/src/core/adapters/local-storage.ts +66 -0
- package/src/core/adapters/obsidian-storage.ts +151 -0
- package/src/core/adapters/registry.ts +44 -0
- package/src/core/adapters/storage.test.ts +174 -0
- package/src/core/adapters/vault-storage.ts +86 -0
- package/src/core/config.test.ts +96 -96
- package/src/core/config.ts +140 -115
- package/src/core/graph.ts +344 -344
- package/src/core/plugins/index.ts +17 -0
- package/src/core/plugins/loader.ts +36 -0
- package/src/core/ports/storage.ts +71 -0
- package/src/core/scanner.test.ts +61 -61
- package/src/core/scanner.ts +91 -91
- package/src/core/storage.ts +37 -0
- package/src/core/workspace.ts +487 -380
- package/src/core/worktree.ts +120 -120
- package/src/generators/antigravity.ts +32 -32
- package/src/generators/base.ts +243 -240
- package/src/generators/claude.ts +34 -34
- package/src/generators/codex.ts +48 -48
- package/src/generators/copilot.ts +56 -56
- package/src/generators/cursor.ts +44 -44
- package/src/generators/diff-context.ts +75 -0
- package/src/generators/index.ts +322 -250
- package/src/generators/map-generator.test.ts +159 -159
- package/src/generators/map-generator.ts +539 -542
- package/src/generators/plan-generator.ts +483 -481
- package/src/generators/skills-generator.ts +259 -259
- package/src/index.ts +539 -426
- package/src/mcp/server.ts +294 -294
- package/src/orchestration/detect.ts +313 -313
- package/src/orchestration/index.ts +7 -7
- package/src/orchestration/runner.ts +283 -283
- package/src/server.test.ts +618 -555
- package/src/server.ts +1314 -1308
- package/src/types.ts +415 -408
- package/src/utils/detect-ai.test.ts +44 -44
- package/src/utils/detect-ai.ts +84 -84
- package/src/utils/detect-editors.test.ts +48 -48
- package/src/utils/detect-editors.ts +57 -57
- package/src/utils/git.test.ts +74 -74
- package/src/utils/git.ts +117 -117
- package/src/utils/local-ai.test.ts +130 -130
- package/src/utils/local-ai.ts +116 -111
- package/src/utils/multi-git.ts +313 -313
- package/src/utils/prompts.ts +209 -209
- package/src/utils/session-finder.ts +483 -483
- package/src/utils/system-scanner.test.ts +89 -89
- package/src/utils/system-scanner.ts +96 -96
- package/src/utils/update-check.ts +286 -309
- package/src/utils/workflow-advisor.ts +118 -0
- package/src/utils/workflows.test.ts +114 -114
- package/src/utils/workflows.ts +178 -178
- package/tsconfig.json +19 -19
- package/vitest.config.ts +14 -14
- package/.github/workflows/release.yml +0 -112
- package/dist/commands/pack.d.ts +0 -7
- package/dist/commands/pack.d.ts.map +0 -1
- package/dist/commands/pack.js +0 -64
- package/dist/commands/pack.js.map +0 -1
- package/dist/core/packer.d.ts +0 -14
- package/dist/core/packer.d.ts.map +0 -1
- package/dist/core/packer.js +0 -87
- package/dist/core/packer.js.map +0 -1
- package/dist/core/packer.test.d.ts +0 -2
- package/dist/core/packer.test.d.ts.map +0 -1
- package/dist/core/packer.test.js +0 -82
- package/dist/core/packer.test.js.map +0 -1
- package/dist/gui/assets/index-Ct3qq-X4.js +0 -25
- package/dist/gui/assets/index-P_ZrgHXg.css +0 -1
- package/src/commands/pack.ts +0 -73
- package/src/core/packer.test.ts +0 -99
- package/src/core/packer.ts +0 -107
|
@@ -1,631 +1,653 @@
|
|
|
1
|
-
import * as vscode from 'vscode';
|
|
2
|
-
import * as http from 'http';
|
|
3
|
-
import * as child_process from 'child_process';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import * as fs from 'fs';
|
|
6
|
-
|
|
7
|
-
let serverProcess: child_process.ChildProcess | null = null;
|
|
8
|
-
let myStatusBarItem: vscode.StatusBarItem | null = null;
|
|
9
|
-
|
|
10
|
-
function checkServerRunning(): Promise<boolean> {
|
|
11
|
-
return new Promise((resolve) => {
|
|
12
|
-
const req = http.get('http://localhost:3000/api/config', (res) => {
|
|
13
|
-
resolve(res.statusCode === 200);
|
|
14
|
-
});
|
|
15
|
-
req.on('error', () => {
|
|
16
|
-
resolve(false);
|
|
17
|
-
});
|
|
18
|
-
req.setTimeout(1000, () => {
|
|
19
|
-
req.destroy();
|
|
20
|
-
resolve(false);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function startHonoServer(context: vscode.ExtensionContext) {
|
|
26
|
-
const isRunning = await checkServerRunning();
|
|
27
|
-
if (isRunning) {
|
|
28
|
-
console.log('Hono server is already running.');
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
console.log('Starting Hono server...');
|
|
33
|
-
const serverScript = path.join(context.extensionPath, '..', 'dist', 'index.js');
|
|
34
|
-
|
|
35
|
-
serverProcess = child_process.spawn('node', [serverScript, 'ui'], {
|
|
36
|
-
cwd: path.join(context.extensionPath, '..'),
|
|
37
|
-
env: { ...process.env, PORT: '3000' },
|
|
38
|
-
detached: false
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
serverProcess.stdout?.on('data', (data) => {
|
|
42
|
-
console.log(`[Hono Server]: ${data}`);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
serverProcess.stderr?.on('data', (data) => {
|
|
46
|
-
console.error(`[Hono Server Error]: ${data}`);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
serverProcess.on('close', (code) => {
|
|
50
|
-
console.log(`Hono server exited with code ${code}`);
|
|
51
|
-
serverProcess = null;
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function activate(context: vscode.ExtensionContext) {
|
|
56
|
-
console.log('NexusFlow extension is activating...');
|
|
57
|
-
|
|
58
|
-
// Start Hono server in background if not running
|
|
59
|
-
startHonoServer(context);
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
display: flex;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
font-size:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
font-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
display:
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.btn
|
|
439
|
-
background:
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
</
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
<
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
<div class="card">
|
|
517
|
-
<h4>
|
|
518
|
-
<
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
<
|
|
525
|
-
<
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
<
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
1
|
+
import * as vscode from 'vscode';
|
|
2
|
+
import * as http from 'http';
|
|
3
|
+
import * as child_process from 'child_process';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
|
|
7
|
+
let serverProcess: child_process.ChildProcess | null = null;
|
|
8
|
+
let myStatusBarItem: vscode.StatusBarItem | null = null;
|
|
9
|
+
|
|
10
|
+
function checkServerRunning(): Promise<boolean> {
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
const req = http.get('http://localhost:3000/api/config', (res) => {
|
|
13
|
+
resolve(res.statusCode === 200);
|
|
14
|
+
});
|
|
15
|
+
req.on('error', () => {
|
|
16
|
+
resolve(false);
|
|
17
|
+
});
|
|
18
|
+
req.setTimeout(1000, () => {
|
|
19
|
+
req.destroy();
|
|
20
|
+
resolve(false);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function startHonoServer(context: vscode.ExtensionContext) {
|
|
26
|
+
const isRunning = await checkServerRunning();
|
|
27
|
+
if (isRunning) {
|
|
28
|
+
console.log('Hono server is already running.');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.log('Starting Hono server...');
|
|
33
|
+
const serverScript = path.join(context.extensionPath, '..', 'dist', 'index.js');
|
|
34
|
+
|
|
35
|
+
serverProcess = child_process.spawn('node', [serverScript, 'ui'], {
|
|
36
|
+
cwd: path.join(context.extensionPath, '..'),
|
|
37
|
+
env: { ...process.env, PORT: '3000' },
|
|
38
|
+
detached: false
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
serverProcess.stdout?.on('data', (data) => {
|
|
42
|
+
console.log(`[Hono Server]: ${data}`);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
serverProcess.stderr?.on('data', (data) => {
|
|
46
|
+
console.error(`[Hono Server Error]: ${data}`);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
serverProcess.on('close', (code) => {
|
|
50
|
+
console.log(`Hono server exited with code ${code}`);
|
|
51
|
+
serverProcess = null;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function activate(context: vscode.ExtensionContext) {
|
|
56
|
+
console.log('NexusFlow extension is activating...');
|
|
57
|
+
|
|
58
|
+
// Start Hono server in background if not running
|
|
59
|
+
startHonoServer(context);
|
|
60
|
+
|
|
61
|
+
// Scope keybindings to workspaces where nexusflow.json exists
|
|
62
|
+
vscode.commands.executeCommand('setContext', 'nexusflow.workspaceActive', true);
|
|
63
|
+
|
|
64
|
+
// Initialize Status Bar Item
|
|
65
|
+
myStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 100);
|
|
66
|
+
myStatusBarItem.command = 'nexusflow.openTui';
|
|
67
|
+
context.subscriptions.push(myStatusBarItem);
|
|
68
|
+
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(updateStatusBarItem));
|
|
69
|
+
updateStatusBarItem();
|
|
70
|
+
|
|
71
|
+
// Register Webview Provider
|
|
72
|
+
const provider = new NexusFlowSidebarProvider(context);
|
|
73
|
+
context.subscriptions.push(
|
|
74
|
+
vscode.window.registerWebviewViewProvider(
|
|
75
|
+
NexusFlowSidebarProvider.viewType,
|
|
76
|
+
provider
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// Register MCP Server Definition Provider if supported by the VS Code version
|
|
81
|
+
if (typeof (vscode as any).lm?.registerMcpServerDefinitionProvider === 'function') {
|
|
82
|
+
const mcpProvider = {
|
|
83
|
+
provideMcpServerDefinitions: async () => {
|
|
84
|
+
const serverScript = path.join(context.extensionPath, '..', 'dist', 'index.js');
|
|
85
|
+
const workspaceFolders = vscode.workspace.workspaceFolders;
|
|
86
|
+
const args = [serverScript, 'mcp', 'run'];
|
|
87
|
+
if (workspaceFolders && workspaceFolders.length > 0) {
|
|
88
|
+
args.push(workspaceFolders[0].uri.fsPath);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return [
|
|
92
|
+
new (vscode as any).McpStdioServerDefinition({
|
|
93
|
+
label: 'NexusFlow MCP Server',
|
|
94
|
+
command: 'node',
|
|
95
|
+
args: args
|
|
96
|
+
})
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
context.subscriptions.push(
|
|
101
|
+
(vscode as any).lm.registerMcpServerDefinitionProvider('nexusflow-mcp', mcpProvider)
|
|
102
|
+
);
|
|
103
|
+
console.log('NexusFlow MCP Server Definition Provider registered successfully.');
|
|
104
|
+
} else {
|
|
105
|
+
console.log('registerMcpServerDefinitionProvider is not supported on this VS Code version.');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Register Focus Dashboard Command
|
|
109
|
+
context.subscriptions.push(
|
|
110
|
+
vscode.commands.registerCommand('nexusflow.openDashboard', () => {
|
|
111
|
+
vscode.commands.executeCommand('workbench.view.extension.nexusflow-sidebar');
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Register Open Browser Dashboard Command
|
|
116
|
+
context.subscriptions.push(
|
|
117
|
+
vscode.commands.registerCommand('nexusflow.openBrowserDashboard', () => {
|
|
118
|
+
vscode.env.openExternal(vscode.Uri.parse('http://localhost:3000'));
|
|
119
|
+
})
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// Register Open TUI Command
|
|
123
|
+
context.subscriptions.push(
|
|
124
|
+
vscode.commands.registerCommand('nexusflow.openTui', () => {
|
|
125
|
+
runNexusFlowCommand(context, 'tui');
|
|
126
|
+
})
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
// Register Create Workspace Command
|
|
130
|
+
context.subscriptions.push(
|
|
131
|
+
vscode.commands.registerCommand('nexusflow.createWorkspace', () => {
|
|
132
|
+
runNexusFlowCommand(context, 'create');
|
|
133
|
+
})
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
// Register Sync Workspace Command
|
|
137
|
+
context.subscriptions.push(
|
|
138
|
+
vscode.commands.registerCommand('nexusflow.syncWorkspace', () => {
|
|
139
|
+
runNexusFlowCommand(context, 'sync');
|
|
140
|
+
})
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
// Register Run Doctor Command
|
|
144
|
+
context.subscriptions.push(
|
|
145
|
+
vscode.commands.registerCommand('nexusflow.runDoctor', () => {
|
|
146
|
+
runNexusFlowCommand(context, 'doctor');
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// Register Commit Workspace Command
|
|
151
|
+
context.subscriptions.push(
|
|
152
|
+
vscode.commands.registerCommand('nexusflow.commitWorkspace', async () => {
|
|
153
|
+
const message = await vscode.window.showInputBox({
|
|
154
|
+
prompt: 'Enter commit message for all changed repositories in the workspace:',
|
|
155
|
+
placeHolder: 'e.g., feat: implement new UI components'
|
|
156
|
+
});
|
|
157
|
+
if (message) {
|
|
158
|
+
runNexusFlowCommand(context, `commit "${message.replace(/"/g, '\\"')}"`);
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function runNexusFlowCommand(context: vscode.ExtensionContext, command: string) {
|
|
165
|
+
const folders = vscode.workspace.workspaceFolders;
|
|
166
|
+
const isCreate = command.startsWith('create');
|
|
167
|
+
|
|
168
|
+
if (!isCreate && (!folders || folders.length === 0)) {
|
|
169
|
+
vscode.window.showErrorMessage('No active workspace folders found.');
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const cwd = (folders && folders.length > 0) ? folders[0].uri.fsPath : undefined;
|
|
174
|
+
const serverScript = path.join(context.extensionPath, '..', 'dist', 'index.js');
|
|
175
|
+
|
|
176
|
+
let terminal = vscode.window.terminals.find((t: vscode.Terminal) => t.name === "NexusFlow Runner");
|
|
177
|
+
if (!terminal) {
|
|
178
|
+
terminal = vscode.window.createTerminal({
|
|
179
|
+
name: "NexusFlow Runner",
|
|
180
|
+
cwd: cwd
|
|
181
|
+
});
|
|
182
|
+
} else {
|
|
183
|
+
// send Ctrl+C to cancel any active operations
|
|
184
|
+
terminal.sendText('\u0003', true);
|
|
185
|
+
}
|
|
186
|
+
terminal.show(true);
|
|
187
|
+
const escapedScriptPath = `"${serverScript}"`;
|
|
188
|
+
terminal.sendText(`node ${escapedScriptPath} ${command}`);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function deactivate() {
|
|
192
|
+
if (serverProcess) {
|
|
193
|
+
console.log('Stopping Hono server...');
|
|
194
|
+
serverProcess.kill();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function getWorkspaceDetails(): any {
|
|
199
|
+
const folders = vscode.workspace.workspaceFolders;
|
|
200
|
+
if (!folders || folders.length === 0) {
|
|
201
|
+
return { hasWorkspace: false };
|
|
202
|
+
}
|
|
203
|
+
const rootPath = folders[0].uri.fsPath;
|
|
204
|
+
const manifestPath = path.join(rootPath, 'nexusflow.json');
|
|
205
|
+
if (!fs.existsSync(manifestPath)) {
|
|
206
|
+
return { hasWorkspace: false };
|
|
207
|
+
}
|
|
208
|
+
try {
|
|
209
|
+
const content = fs.readFileSync(manifestPath, 'utf8');
|
|
210
|
+
const data = JSON.parse(content);
|
|
211
|
+
return {
|
|
212
|
+
hasWorkspace: true,
|
|
213
|
+
rootPath,
|
|
214
|
+
id: data.id || data.branchName,
|
|
215
|
+
branchName: data.branchName,
|
|
216
|
+
description: data.description || 'No description',
|
|
217
|
+
repos: (data.repos || []).map((repo: string) => ({
|
|
218
|
+
name: path.basename(repo),
|
|
219
|
+
path: repo
|
|
220
|
+
}))
|
|
221
|
+
};
|
|
222
|
+
} catch (e) {
|
|
223
|
+
return { hasWorkspace: false };
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
class NexusFlowSidebarProvider implements vscode.WebviewViewProvider {
|
|
228
|
+
public static readonly viewType = 'nexusflow.dashboardView';
|
|
229
|
+
private _view?: vscode.WebviewView;
|
|
230
|
+
|
|
231
|
+
constructor(
|
|
232
|
+
private readonly _context: vscode.ExtensionContext,
|
|
233
|
+
) { }
|
|
234
|
+
|
|
235
|
+
public resolveWebviewView(
|
|
236
|
+
webviewView: vscode.WebviewView,
|
|
237
|
+
context: vscode.WebviewViewResolveContext,
|
|
238
|
+
_token: vscode.CancellationToken,
|
|
239
|
+
) {
|
|
240
|
+
this._view = webviewView;
|
|
241
|
+
|
|
242
|
+
webviewView.webview.options = {
|
|
243
|
+
enableScripts: true,
|
|
244
|
+
localResourceRoots: [
|
|
245
|
+
this._context.extensionUri
|
|
246
|
+
]
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
webviewView.webview.html = this._getHtmlForWebview(webviewView.webview);
|
|
250
|
+
|
|
251
|
+
webviewView.webview.onDidReceiveMessage((data: any) => {
|
|
252
|
+
switch (data.type) {
|
|
253
|
+
case 'openWorkspaceFolder': {
|
|
254
|
+
const uri = vscode.Uri.file(data.workspacePath);
|
|
255
|
+
vscode.commands.executeCommand('vscode.openFolder', uri, false);
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
case 'openFile': {
|
|
259
|
+
const uri = vscode.Uri.file(data.filePath);
|
|
260
|
+
vscode.workspace.openTextDocument(uri).then((doc: vscode.TextDocument) => {
|
|
261
|
+
vscode.window.showTextDocument(doc);
|
|
262
|
+
});
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
case 'getWorkspaceStatus': {
|
|
266
|
+
const details = getWorkspaceDetails();
|
|
267
|
+
webviewView.webview.postMessage({ type: 'workspaceStatus', details });
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
case 'runCommand': {
|
|
271
|
+
runNexusFlowCommand(this._context, data.command);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
case 'triggerCommand': {
|
|
275
|
+
vscode.commands.executeCommand(data.command);
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
case 'executeTerminalCommand': {
|
|
279
|
+
let terminal = vscode.window.terminals.find((t: vscode.Terminal) => t.name === "NexusFlow Runner");
|
|
280
|
+
if (!terminal) {
|
|
281
|
+
terminal = vscode.window.createTerminal({
|
|
282
|
+
name: "NexusFlow Runner",
|
|
283
|
+
cwd: data.cwd
|
|
284
|
+
});
|
|
285
|
+
} else {
|
|
286
|
+
// send Ctrl+C to cancel any active operations
|
|
287
|
+
terminal.sendText('\u0003', true);
|
|
288
|
+
}
|
|
289
|
+
terminal.show(true);
|
|
290
|
+
terminal.sendText(data.command);
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
private _getHtmlForWebview(webview: vscode.Webview) {
|
|
298
|
+
const nonce = getNonce();
|
|
299
|
+
const codiconsUri = webview.asWebviewUri(
|
|
300
|
+
vscode.Uri.joinPath(this._context.extensionUri, 'node_modules', '@vscode/codicons', 'dist', 'codicon.css')
|
|
301
|
+
);
|
|
302
|
+
return `<!DOCTYPE html>
|
|
303
|
+
<html lang="en">
|
|
304
|
+
<head>
|
|
305
|
+
<meta charset="UTF-8">
|
|
306
|
+
<meta http-equiv="Content-Security-Policy"
|
|
307
|
+
content="default-src 'none';
|
|
308
|
+
style-src ${webview.cspSource} 'unsafe-inline';
|
|
309
|
+
script-src 'nonce-${nonce}';
|
|
310
|
+
font-src ${webview.cspSource};">
|
|
311
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
312
|
+
<link href="${codiconsUri}" rel="stylesheet" />
|
|
313
|
+
<title>NexusFlow Sidebar Console</title>
|
|
314
|
+
<style>
|
|
315
|
+
:root {
|
|
316
|
+
--bg-base: var(--vscode-sideBar-background, #080a13);
|
|
317
|
+
--bg-surface: var(--vscode-editor-background, #0d1127);
|
|
318
|
+
--accent-cyan: #00f0ff;
|
|
319
|
+
--accent-green: #39ff14;
|
|
320
|
+
--text-primary: var(--vscode-sideBar-foreground, #f0f3ff);
|
|
321
|
+
--text-secondary: var(--vscode-descriptionForeground, #8e9bb4);
|
|
322
|
+
--border-color: rgba(0, 240, 255, 0.15);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
* {
|
|
326
|
+
box-sizing: border-box;
|
|
327
|
+
margin: 0;
|
|
328
|
+
padding: 0;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
body {
|
|
332
|
+
font-family: var(--vscode-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
|
|
333
|
+
background-color: var(--bg-base);
|
|
334
|
+
color: var(--text-primary);
|
|
335
|
+
padding: 12px;
|
|
336
|
+
font-size: 13px;
|
|
337
|
+
overflow-y: auto;
|
|
338
|
+
min-height: 100vh;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* Header block */
|
|
342
|
+
.header {
|
|
343
|
+
display: flex;
|
|
344
|
+
justify-content: space-between;
|
|
345
|
+
align-items: center;
|
|
346
|
+
border-bottom: 1px solid var(--border-color);
|
|
347
|
+
padding-bottom: 8px;
|
|
348
|
+
margin-bottom: 15px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.header h3 {
|
|
352
|
+
font-size: 14px;
|
|
353
|
+
font-weight: bold;
|
|
354
|
+
color: var(--text-primary);
|
|
355
|
+
letter-spacing: 0.5px;
|
|
356
|
+
display: flex;
|
|
357
|
+
align-items: center;
|
|
358
|
+
gap: 6px;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.status-indicator {
|
|
362
|
+
display: flex;
|
|
363
|
+
align-items: center;
|
|
364
|
+
gap: 6px;
|
|
365
|
+
font-size: 11px;
|
|
366
|
+
color: var(--accent-cyan);
|
|
367
|
+
font-family: monospace;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.status-dot {
|
|
371
|
+
width: 7px;
|
|
372
|
+
height: 7px;
|
|
373
|
+
border-radius: 50%;
|
|
374
|
+
background-color: var(--accent-green);
|
|
375
|
+
box-shadow: 0 0 6px var(--accent-green);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* Card Container */
|
|
379
|
+
.card {
|
|
380
|
+
background-color: var(--bg-surface);
|
|
381
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
382
|
+
border-radius: 8px;
|
|
383
|
+
padding: 12px;
|
|
384
|
+
margin-bottom: 15px;
|
|
385
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.25);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.card h4 {
|
|
389
|
+
font-size: 12px;
|
|
390
|
+
color: var(--accent-cyan);
|
|
391
|
+
text-transform: uppercase;
|
|
392
|
+
letter-spacing: 0.5px;
|
|
393
|
+
margin-bottom: 6px;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.branch-badge {
|
|
397
|
+
font-family: monospace;
|
|
398
|
+
background: rgba(0, 240, 255, 0.08);
|
|
399
|
+
border: 1px solid rgba(0, 240, 255, 0.2);
|
|
400
|
+
color: var(--accent-cyan);
|
|
401
|
+
padding: 4px 8px;
|
|
402
|
+
border-radius: 4px;
|
|
403
|
+
display: inline-block;
|
|
404
|
+
margin-bottom: 8px;
|
|
405
|
+
font-weight: bold;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.desc-text {
|
|
409
|
+
color: var(--text-secondary);
|
|
410
|
+
font-size: 12px;
|
|
411
|
+
line-height: 1.4;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/* Action Buttons Grid */
|
|
415
|
+
.btn-grid {
|
|
416
|
+
display: grid;
|
|
417
|
+
grid-template-columns: 1fr 1fr;
|
|
418
|
+
gap: 8px;
|
|
419
|
+
margin-bottom: 15px;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.btn {
|
|
423
|
+
background: rgba(0, 240, 255, 0.06);
|
|
424
|
+
border: 1px solid rgba(0, 240, 255, 0.2);
|
|
425
|
+
color: var(--accent-cyan);
|
|
426
|
+
border-radius: 4px;
|
|
427
|
+
padding: 8px 12px;
|
|
428
|
+
font-size: 12px;
|
|
429
|
+
font-weight: 600;
|
|
430
|
+
cursor: pointer;
|
|
431
|
+
display: flex;
|
|
432
|
+
align-items: center;
|
|
433
|
+
justify-content: center;
|
|
434
|
+
gap: 6px;
|
|
435
|
+
transition: all 0.2s ease;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.btn:hover {
|
|
439
|
+
background: var(--accent-cyan);
|
|
440
|
+
color: black;
|
|
441
|
+
box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.btn-primary {
|
|
445
|
+
grid-column: span 2;
|
|
446
|
+
background: var(--accent-cyan);
|
|
447
|
+
color: black;
|
|
448
|
+
font-weight: bold;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.btn-primary:hover {
|
|
452
|
+
background: #00d0de;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/* File Links List */
|
|
456
|
+
.file-list {
|
|
457
|
+
list-style: none;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.file-row {
|
|
461
|
+
display: flex;
|
|
462
|
+
align-items: center;
|
|
463
|
+
gap: 8px;
|
|
464
|
+
padding: 6px 8px;
|
|
465
|
+
border-radius: 4px;
|
|
466
|
+
cursor: pointer;
|
|
467
|
+
color: var(--text-secondary);
|
|
468
|
+
transition: all 0.2s ease;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.file-row:hover {
|
|
472
|
+
background: rgba(255, 255, 255, 0.03);
|
|
473
|
+
color: var(--text-primary);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.file-icon {
|
|
477
|
+
color: var(--accent-cyan);
|
|
478
|
+
font-size: 14px;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/* Loading / Wizard view */
|
|
482
|
+
.loading-view, .wizard-view {
|
|
483
|
+
display: flex;
|
|
484
|
+
flex-direction: column;
|
|
485
|
+
align-items: center;
|
|
486
|
+
justify-content: center;
|
|
487
|
+
padding: 30px 15px;
|
|
488
|
+
text-align: center;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.wizard-icon {
|
|
492
|
+
font-size: 32px;
|
|
493
|
+
margin-bottom: 12px;
|
|
494
|
+
animation: pulse 2s infinite;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.wizard-text {
|
|
498
|
+
color: var(--text-secondary);
|
|
499
|
+
margin-bottom: 20px;
|
|
500
|
+
line-height: 1.5;
|
|
501
|
+
}
|
|
502
|
+
</style>
|
|
503
|
+
</head>
|
|
504
|
+
<body>
|
|
505
|
+
|
|
506
|
+
<div class="header">
|
|
507
|
+
<h3><i class="codicon codicon-extensions"></i> NexusFlow</h3>
|
|
508
|
+
<div class="status-indicator">
|
|
509
|
+
<div class="status-dot"></div>
|
|
510
|
+
<span>ACTIVE</span>
|
|
511
|
+
</div>
|
|
512
|
+
</div>
|
|
513
|
+
|
|
514
|
+
<!-- Active Workspace View -->
|
|
515
|
+
<div id="workspace-view" style="display: none;">
|
|
516
|
+
<div class="card">
|
|
517
|
+
<h4>Active Feature</h4>
|
|
518
|
+
<div class="branch-badge" id="branch-badge">🌿 improve_nexusflow</div>
|
|
519
|
+
<div class="desc-text" id="workspace-desc">Loading workspace description...</div>
|
|
520
|
+
</div>
|
|
521
|
+
|
|
522
|
+
<div class="btn-grid">
|
|
523
|
+
<button class="btn" onclick="runCommand('tui')"><i class="codicon codicon-terminal"></i> Open TUI</button>
|
|
524
|
+
<button class="btn" onclick="runCommand('sync')"><i class="codicon codicon-sync"></i> Rebase Sync</button>
|
|
525
|
+
<button class="btn" onclick="runCommand('doctor')"><i class="codicon codicon-pulse"></i> Run Doctor</button>
|
|
526
|
+
<button class="btn" onclick="triggerCommand('nexusflow.commitWorkspace')"><i class="codicon codicon-git-commit"></i> Commit</button>
|
|
527
|
+
</div>
|
|
528
|
+
|
|
529
|
+
<div class="card">
|
|
530
|
+
<h4>Workspace Repositories</h4>
|
|
531
|
+
<ul class="file-list" id="repo-list">
|
|
532
|
+
<!-- Repo items injected here -->
|
|
533
|
+
</ul>
|
|
534
|
+
</div>
|
|
535
|
+
|
|
536
|
+
<div class="card">
|
|
537
|
+
<h4>Core Context Files</h4>
|
|
538
|
+
<ul class="file-list" id="context-files">
|
|
539
|
+
<!-- Links injected here -->
|
|
540
|
+
</ul>
|
|
541
|
+
</div>
|
|
542
|
+
</div>
|
|
543
|
+
|
|
544
|
+
<!-- Empty Wizard Setup View -->
|
|
545
|
+
<div id="wizard-view" style="display: none;" class="wizard-view">
|
|
546
|
+
<div class="wizard-icon"><i class="codicon codicon-rocket"></i></div>
|
|
547
|
+
<h4 style="margin-bottom: 8px; font-size: 14px; color: var(--text-primary);">No Workspace Detected</h4>
|
|
548
|
+
<p class="wizard-text">NexusFlow coordinates multi-repo workspaces with Git worktrees and auto-generated AI contexts.</p>
|
|
549
|
+
|
|
550
|
+
<button class="btn btn-primary" onclick="triggerCommand('nexusflow.createWorkspace')" style="width: 100%; margin-bottom: 10px;">
|
|
551
|
+
Initialize Workspace Setup
|
|
552
|
+
</button>
|
|
553
|
+
<button class="btn" onclick="triggerCommand('nexusflow.openTui')" style="width: 100%;">
|
|
554
|
+
Open TUI Dashboard
|
|
555
|
+
</button>
|
|
556
|
+
</div>
|
|
557
|
+
|
|
558
|
+
<!-- Loading View -->
|
|
559
|
+
<div id="loading-view" class="loading-view">
|
|
560
|
+
<p style="color: var(--text-secondary);">Querying workspace configuration...</p>
|
|
561
|
+
</div>
|
|
562
|
+
|
|
563
|
+
<script nonce="${nonce}">
|
|
564
|
+
const vscode = acquireVsCodeApi();
|
|
565
|
+
|
|
566
|
+
// Listen for messages from extension backend
|
|
567
|
+
window.addEventListener('message', event => {
|
|
568
|
+
const message = event.data;
|
|
569
|
+
if (message.type === 'workspaceStatus') {
|
|
570
|
+
renderWorkspace(message.details);
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
// Request workspace status on load
|
|
575
|
+
vscode.postMessage({ type: 'getWorkspaceStatus' });
|
|
576
|
+
|
|
577
|
+
function runCommand(cmd) {
|
|
578
|
+
vscode.postMessage({ type: 'runCommand', command: cmd });
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function triggerCommand(cmd) {
|
|
582
|
+
vscode.postMessage({ type: 'triggerCommand', command: cmd });
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
function openFile(path) {
|
|
586
|
+
vscode.postMessage({ type: 'openFile', filePath: path });
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
function renderWorkspace(details) {
|
|
590
|
+
document.getElementById('loading-view').style.display = 'none';
|
|
591
|
+
|
|
592
|
+
if (details.hasWorkspace) {
|
|
593
|
+
document.getElementById('wizard-view').style.display = 'none';
|
|
594
|
+
document.getElementById('workspace-view').style.display = 'block';
|
|
595
|
+
|
|
596
|
+
document.getElementById('branch-badge').innerText = '🌿 ' + details.branchName;
|
|
597
|
+
document.getElementById('workspace-desc').innerText = details.description;
|
|
598
|
+
|
|
599
|
+
// Render Repos list
|
|
600
|
+
const repoList = document.getElementById('repo-list');
|
|
601
|
+
repoList.innerHTML = details.repos.map(r => \`
|
|
602
|
+
<li class="file-row" onclick="openFile('\${r.path.replace(/\\\\/g, '/')}')">
|
|
603
|
+
<i class="codicon codicon-folder file-icon"></i>
|
|
604
|
+
<span>\${r.name}</span>
|
|
605
|
+
</li>
|
|
606
|
+
\`).join('');
|
|
607
|
+
|
|
608
|
+
// Render Core Context Files list
|
|
609
|
+
const contextFiles = document.getElementById('context-files');
|
|
610
|
+
const root = details.rootPath.replace(/\\\\/g, '/');
|
|
611
|
+
const files = ['WORKSPACE.md', 'nexusflow-knowledge.md', 'nexusflow-plan.md'];
|
|
612
|
+
contextFiles.innerHTML = files.map(file => \`
|
|
613
|
+
<li class="file-row" onclick="openFile('\${root}/\${file}')">
|
|
614
|
+
<i class="codicon codicon-file-text file-icon"></i>
|
|
615
|
+
<span>\${file}</span>
|
|
616
|
+
</li>
|
|
617
|
+
\`).join('');
|
|
618
|
+
|
|
619
|
+
} else {
|
|
620
|
+
document.getElementById('workspace-view').style.display = 'none';
|
|
621
|
+
document.getElementById('wizard-view').style.display = 'block';
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
</script>
|
|
625
|
+
</body>
|
|
626
|
+
</html>`;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function getNonce(): string {
|
|
631
|
+
let text = '';
|
|
632
|
+
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
633
|
+
for (let i = 0; i < 32; i++) {
|
|
634
|
+
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
|
635
|
+
}
|
|
636
|
+
return text;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
function updateStatusBarItem() {
|
|
640
|
+
if (!myStatusBarItem) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const folders = vscode.workspace.workspaceFolders;
|
|
644
|
+
if (folders && folders.length > 0) {
|
|
645
|
+
const branchName = path.basename(folders[0].uri.fsPath);
|
|
646
|
+
myStatusBarItem.text = `$(git-branch) NexusFlow: ${branchName}`;
|
|
647
|
+
myStatusBarItem.tooltip = 'Click to open NexusFlow Terminal Console (TUI)';
|
|
648
|
+
myStatusBarItem.show();
|
|
649
|
+
} else {
|
|
650
|
+
myStatusBarItem.hide();
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|