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