@mrpatronz/nexusflow 0.1.0 ā 0.1.2
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 +25 -0
- package/.github/workflows/release.yml +90 -0
- package/.vscode/launch.json +17 -0
- package/.vscode/tasks.json +17 -0
- package/README.md +1 -1
- package/dist/commands/commit.d.ts +18 -0
- package/dist/commands/commit.d.ts.map +1 -0
- package/dist/commands/commit.js +105 -0
- package/dist/commands/commit.js.map +1 -0
- package/dist/commands/diff.d.ts +11 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +101 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/sync.d.ts +11 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +96 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +3 -0
- package/dist/generators/base.js.map +1 -1
- package/dist/generators/index.d.ts +5 -2
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +88 -38
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/plan-generator.d.ts +40 -0
- package/dist/generators/plan-generator.d.ts.map +1 -0
- package/dist/generators/plan-generator.js +312 -0
- package/dist/generators/plan-generator.js.map +1 -0
- package/dist/gui/assets/index-B9Ph2bHH.css +2 -0
- package/dist/gui/assets/index-s4nRkpqY.js +21 -0
- package/dist/gui/index.html +2 -2
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +141 -1
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/multi-git.d.ts +108 -0
- package/dist/utils/multi-git.d.ts.map +1 -0
- package/dist/utils/multi-git.js +206 -0
- package/dist/utils/multi-git.js.map +1 -0
- package/extension/package-lock.json +2811 -0
- package/extension/package.json +61 -0
- package/extension/src/extension.ts +168 -0
- package/extension/tsconfig.json +19 -0
- package/gui/src/App.tsx +377 -24
- package/gui/src/features/changes/ChangesViewer.tsx +212 -0
- package/gui/src/features/knowledge/KnowledgeBase.tsx +84 -0
- package/gui/src/features/onboarding/OnboardingWizard.tsx +230 -0
- package/gui/src/features/plan/ImplementationPlan.tsx +32 -0
- package/gui/src/features/services/ServiceConsole.tsx +159 -0
- package/gui/src/features/sessions/SessionHistory.tsx +195 -0
- package/gui/src/features/workspace/WorkspaceBuilder.tsx +414 -0
- package/gui/src/features/workspace/WorkspaceList.tsx +382 -0
- package/gui/src/types.ts +61 -0
- package/package.json +6 -4
- package/src/commands/commit.ts +131 -0
- package/src/commands/diff.ts +125 -0
- package/src/commands/sync.ts +110 -0
- package/src/generators/base.ts +3 -0
- package/src/generators/index.ts +95 -40
- package/src/generators/plan-generator.ts +390 -0
- package/src/index.ts +59 -0
- package/src/server.ts +152 -1
- package/src/types.ts +17 -0
- package/src/utils/multi-git.ts +306 -0
- package/dist/gui/assets/index-Cq9V485S.js +0 -21
- package/dist/gui/assets/index-Dh1b5gSZ.css +0 -2
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Play, RefreshCw, FolderGit2, Sparkles, ExternalLink } from 'lucide-react';
|
|
3
|
+
import type { Feature, RunningService, ServiceConfig, OrchestrationDetection } from '../../types.js';
|
|
4
|
+
|
|
5
|
+
// Feature subcomponents
|
|
6
|
+
import { SessionHistory } from '../sessions/SessionHistory.js';
|
|
7
|
+
import { ServiceConsole } from '../services/ServiceConsole.js';
|
|
8
|
+
import { ChangesViewer } from '../changes/ChangesViewer.js';
|
|
9
|
+
import { KnowledgeBase } from '../knowledge/KnowledgeBase.js';
|
|
10
|
+
import { ImplementationPlan } from '../plan/ImplementationPlan.js';
|
|
11
|
+
|
|
12
|
+
interface WorkspaceListProps {
|
|
13
|
+
workspacesLoading: boolean;
|
|
14
|
+
workspaces: Feature[];
|
|
15
|
+
activeWsId: string | null;
|
|
16
|
+
setActiveWsId: (id: string | null) => void;
|
|
17
|
+
resumingWs: string | null;
|
|
18
|
+
handleResumeSession: (ws: Feature, sessionId?: string, assistant?: string) => Promise<void>;
|
|
19
|
+
handleCopyPrompt: (ws: Feature) => void;
|
|
20
|
+
handleOpenInEditor: (workspacePath: string) => Promise<void>;
|
|
21
|
+
fetchWorkspaces: () => Promise<void>;
|
|
22
|
+
|
|
23
|
+
// ServiceConsole props
|
|
24
|
+
services: ServiceConfig[];
|
|
25
|
+
runningServices: RunningService[];
|
|
26
|
+
selectedLogService: string | null;
|
|
27
|
+
serviceLogs: string;
|
|
28
|
+
logsEndRef: React.RefObject<HTMLDivElement | null>;
|
|
29
|
+
setSelectedLogService: (val: string | null) => void;
|
|
30
|
+
handleStartServices: (wsId: string) => Promise<void>;
|
|
31
|
+
handleStopServices: (wsId: string) => Promise<void>;
|
|
32
|
+
orchTools: OrchestrationDetection[];
|
|
33
|
+
servicesLoading: boolean;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// ChangesViewer props
|
|
37
|
+
gitChanges: any[];
|
|
38
|
+
gitChangesLoading: boolean;
|
|
39
|
+
syncLoading: boolean;
|
|
40
|
+
syncResults: any[] | null;
|
|
41
|
+
commitMessage: string;
|
|
42
|
+
showCommitModal: boolean;
|
|
43
|
+
commitLoading: boolean;
|
|
44
|
+
commitResults: any[] | null;
|
|
45
|
+
setSyncResults: (val: any[] | null) => void;
|
|
46
|
+
setCommitResults: (val: any[] | null) => void;
|
|
47
|
+
setCommitMessage: (val: string) => void;
|
|
48
|
+
setShowCommitModal: (val: boolean) => void;
|
|
49
|
+
fetchGitChanges: (wsId: string) => Promise<void>;
|
|
50
|
+
handleSyncAll: (wsId: string) => Promise<void>;
|
|
51
|
+
handleCommitAll: (wsId: string) => Promise<void>;
|
|
52
|
+
|
|
53
|
+
// KnowledgeBase props
|
|
54
|
+
knowledgeContent: string;
|
|
55
|
+
knowledgeLoading: boolean;
|
|
56
|
+
isEditingKnowledge: boolean;
|
|
57
|
+
editedKnowledge: string;
|
|
58
|
+
saveKnowledgeLoading: boolean;
|
|
59
|
+
setEditedKnowledge: (val: string) => void;
|
|
60
|
+
setIsEditingKnowledge: (val: boolean) => void;
|
|
61
|
+
handleSaveKnowledge: (wsId: string) => Promise<void>;
|
|
62
|
+
|
|
63
|
+
// ImplementationPlan props
|
|
64
|
+
planContent: string;
|
|
65
|
+
planLoading: boolean;
|
|
66
|
+
|
|
67
|
+
// SessionHistory props
|
|
68
|
+
sessions: any[];
|
|
69
|
+
sessionsLoading: boolean;
|
|
70
|
+
activeSession: any | null;
|
|
71
|
+
transcript: any[];
|
|
72
|
+
transcriptLoading: boolean;
|
|
73
|
+
setActiveSession: (val: any | null) => void;
|
|
74
|
+
setTranscript: (val: any[]) => void;
|
|
75
|
+
fetchSessionTranscript: (assistant: string, sessionId: string) => Promise<void>;
|
|
76
|
+
|
|
77
|
+
// Navigation tab states
|
|
78
|
+
subTab: any;
|
|
79
|
+
setSubTab: (tab: any) => void;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const WorkspaceList: React.FC<WorkspaceListProps> = ({
|
|
83
|
+
workspacesLoading,
|
|
84
|
+
workspaces,
|
|
85
|
+
activeWsId,
|
|
86
|
+
setActiveWsId,
|
|
87
|
+
resumingWs,
|
|
88
|
+
handleResumeSession,
|
|
89
|
+
handleCopyPrompt,
|
|
90
|
+
handleOpenInEditor,
|
|
91
|
+
fetchWorkspaces,
|
|
92
|
+
|
|
93
|
+
// ServiceConsole
|
|
94
|
+
services,
|
|
95
|
+
runningServices,
|
|
96
|
+
selectedLogService,
|
|
97
|
+
serviceLogs,
|
|
98
|
+
logsEndRef,
|
|
99
|
+
setSelectedLogService,
|
|
100
|
+
handleStartServices,
|
|
101
|
+
handleStopServices,
|
|
102
|
+
orchTools,
|
|
103
|
+
servicesLoading,
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
// ChangesViewer
|
|
107
|
+
gitChanges,
|
|
108
|
+
gitChangesLoading,
|
|
109
|
+
syncLoading,
|
|
110
|
+
syncResults,
|
|
111
|
+
commitMessage,
|
|
112
|
+
showCommitModal,
|
|
113
|
+
commitLoading,
|
|
114
|
+
commitResults,
|
|
115
|
+
setSyncResults,
|
|
116
|
+
setCommitResults,
|
|
117
|
+
setCommitMessage,
|
|
118
|
+
setShowCommitModal,
|
|
119
|
+
fetchGitChanges,
|
|
120
|
+
handleSyncAll,
|
|
121
|
+
handleCommitAll,
|
|
122
|
+
|
|
123
|
+
// KnowledgeBase
|
|
124
|
+
knowledgeContent,
|
|
125
|
+
knowledgeLoading,
|
|
126
|
+
isEditingKnowledge,
|
|
127
|
+
editedKnowledge,
|
|
128
|
+
saveKnowledgeLoading,
|
|
129
|
+
setEditedKnowledge,
|
|
130
|
+
setIsEditingKnowledge,
|
|
131
|
+
handleSaveKnowledge,
|
|
132
|
+
|
|
133
|
+
// ImplementationPlan
|
|
134
|
+
planContent,
|
|
135
|
+
planLoading,
|
|
136
|
+
|
|
137
|
+
// SessionHistory
|
|
138
|
+
sessions,
|
|
139
|
+
sessionsLoading,
|
|
140
|
+
activeSession,
|
|
141
|
+
transcript,
|
|
142
|
+
transcriptLoading,
|
|
143
|
+
setActiveSession,
|
|
144
|
+
setTranscript,
|
|
145
|
+
fetchSessionTranscript,
|
|
146
|
+
|
|
147
|
+
// Tabs
|
|
148
|
+
subTab,
|
|
149
|
+
setSubTab,
|
|
150
|
+
}) => {
|
|
151
|
+
return (
|
|
152
|
+
<div className="max-w-5xl mx-auto">
|
|
153
|
+
<header className="flex justify-between items-center mb-8">
|
|
154
|
+
<div>
|
|
155
|
+
<h1 className="text-3xl font-extrabold tracking-tight text-white mb-2">Active Workspaces</h1>
|
|
156
|
+
<p className="text-sm text-gray-400">Monitor running servers, libraries, and processes on your development branches.</p>
|
|
157
|
+
</div>
|
|
158
|
+
<button
|
|
159
|
+
className="inline-flex items-center justify-center gap-2 px-4 py-2 bg-gray-900 border border-gray-800 hover:bg-gray-800 hover:border-gray-700 rounded-lg text-xs font-semibold transition-all cursor-pointer"
|
|
160
|
+
onClick={fetchWorkspaces}
|
|
161
|
+
disabled={workspacesLoading}
|
|
162
|
+
>
|
|
163
|
+
<RefreshCw size={14} className={workspacesLoading ? 'animate-spin text-indigo-400' : ''} /> Refresh
|
|
164
|
+
</button>
|
|
165
|
+
</header>
|
|
166
|
+
|
|
167
|
+
{workspacesLoading ? (
|
|
168
|
+
<div className="flex flex-col items-center py-40 gap-4 text-gray-400">
|
|
169
|
+
<RefreshCw className="animate-spin text-indigo-400" size={32} />
|
|
170
|
+
<span className="text-sm">Fetching workspace details...</span>
|
|
171
|
+
</div>
|
|
172
|
+
) : workspaces.length === 0 ? (
|
|
173
|
+
<div className="flex flex-col items-center justify-center py-24 bg-[#111827]/20 border border-gray-800/80 rounded-xl text-center">
|
|
174
|
+
<FolderGit2 size={44} className="text-gray-600 mb-4" />
|
|
175
|
+
<h3 className="text-lg font-bold text-white">No Active Workspaces</h3>
|
|
176
|
+
<p className="text-xs text-gray-505 max-w-sm mt-1">
|
|
177
|
+
No feature workspaces were detected in your development folder. Create a workspace to start.
|
|
178
|
+
</p>
|
|
179
|
+
</div>
|
|
180
|
+
) : (
|
|
181
|
+
<div className="flex flex-col gap-6">
|
|
182
|
+
{workspaces.map((ws) => {
|
|
183
|
+
const isExpanded = activeWsId === ws.branchName;
|
|
184
|
+
return (
|
|
185
|
+
<div key={ws.id} className="bg-[#111827]/40 border border-gray-800/80 rounded-xl p-6 shadow-md">
|
|
186
|
+
<div className="flex justify-between items-start gap-4 mb-4">
|
|
187
|
+
<div>
|
|
188
|
+
<h3 className="text-lg font-bold text-white hover:text-indigo-400 transition-colors">{ws.branchName}</h3>
|
|
189
|
+
<div className="flex items-center gap-3 text-xs text-gray-500 mt-1">
|
|
190
|
+
<span>Created: {new Date(ws.createdAt).toLocaleDateString()}</span>
|
|
191
|
+
<span className="h-1 w-1 rounded-full bg-gray-700"></span>
|
|
192
|
+
<span>{ws.repos.length} repos</span>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
<div className="flex gap-2">
|
|
196
|
+
<button
|
|
197
|
+
className="inline-flex items-center justify-center gap-1.5 px-3.5 py-2 bg-emerald-650 hover:bg-emerald-600 text-white rounded-lg text-xs font-semibold transition-all cursor-pointer shadow-md shadow-emerald-600/10 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
198
|
+
onClick={() => handleResumeSession(ws)}
|
|
199
|
+
disabled={resumingWs === ws.branchName}
|
|
200
|
+
>
|
|
201
|
+
<Play size={12} className={resumingWs === ws.branchName ? 'animate-spin' : ''} />
|
|
202
|
+
{resumingWs === ws.branchName ? 'Resuming...' : 'Resume Session'}
|
|
203
|
+
</button>
|
|
204
|
+
<button
|
|
205
|
+
className="inline-flex items-center justify-center gap-1.5 px-3.5 py-2 bg-gray-900 border border-gray-800 hover:bg-gray-800 hover:border-gray-700 rounded-lg text-xs font-semibold transition-all cursor-pointer"
|
|
206
|
+
onClick={() => handleCopyPrompt(ws)}
|
|
207
|
+
>
|
|
208
|
+
<Sparkles size={12} className="text-cyan-400" /> Copy Prompt
|
|
209
|
+
</button>
|
|
210
|
+
<button
|
|
211
|
+
className="inline-flex items-center justify-center gap-1.5 px-3.5 py-2 bg-gray-900 border border-gray-800 hover:bg-gray-800 hover:border-gray-700 rounded-lg text-xs font-semibold transition-all cursor-pointer"
|
|
212
|
+
onClick={() => handleOpenInEditor(ws.workspacePath)}
|
|
213
|
+
>
|
|
214
|
+
<ExternalLink size={12} /> Open
|
|
215
|
+
</button>
|
|
216
|
+
<button
|
|
217
|
+
className="inline-flex items-center justify-center gap-1.5 px-3.5 py-2 bg-indigo-500 hover:bg-indigo-600 text-white rounded-lg text-xs font-semibold transition-all cursor-pointer shadow-md shadow-indigo-500/10"
|
|
218
|
+
onClick={() => {
|
|
219
|
+
if (isExpanded) {
|
|
220
|
+
setActiveWsId(null);
|
|
221
|
+
} else {
|
|
222
|
+
setActiveWsId(ws.branchName);
|
|
223
|
+
}
|
|
224
|
+
}}
|
|
225
|
+
>
|
|
226
|
+
{isExpanded ? 'Hide Runner' : 'Orchestrate'}
|
|
227
|
+
</button>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<p className="text-xs text-gray-400 bg-gray-950/40 border-l-2 border-indigo-500 rounded-r-lg px-4 py-3 mb-4 font-medium italic">
|
|
232
|
+
{ws.description}
|
|
233
|
+
</p>
|
|
234
|
+
|
|
235
|
+
<div className="flex flex-wrap gap-2 mb-4">
|
|
236
|
+
{ws.repos.map((repoPath) => (
|
|
237
|
+
<span key={repoPath} className="text-[10px] px-2.5 py-1 bg-gray-900 border border-gray-800 text-gray-300 rounded-md font-semibold">
|
|
238
|
+
{repoPath.split(/[\\/]/).pop()}
|
|
239
|
+
</span>
|
|
240
|
+
))}
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
{/* Expansion: Process management console */}
|
|
244
|
+
{isExpanded && (
|
|
245
|
+
<div className="mt-6 pt-6 border-t border-gray-800/80">
|
|
246
|
+
{/* Sub-tab Navigation */}
|
|
247
|
+
<div className="flex border-b border-gray-800/80 mb-6 gap-2">
|
|
248
|
+
<button
|
|
249
|
+
className={`px-4 py-2 border-b-2 text-xs font-bold transition-all cursor-pointer ${
|
|
250
|
+
subTab === 'sessions'
|
|
251
|
+
? 'border-indigo-500 text-white'
|
|
252
|
+
: 'border-transparent text-gray-500 hover:text-gray-300'
|
|
253
|
+
}`}
|
|
254
|
+
onClick={() => setSubTab('sessions')}
|
|
255
|
+
>
|
|
256
|
+
AI Session History
|
|
257
|
+
</button>
|
|
258
|
+
<button
|
|
259
|
+
className={`px-4 py-2 border-b-2 text-xs font-bold transition-all cursor-pointer ${
|
|
260
|
+
subTab === 'services'
|
|
261
|
+
? 'border-indigo-500 text-white'
|
|
262
|
+
: 'border-transparent text-gray-500 hover:text-gray-300'
|
|
263
|
+
}`}
|
|
264
|
+
onClick={() => setSubTab('services')}
|
|
265
|
+
>
|
|
266
|
+
Orchestrated Services
|
|
267
|
+
</button>
|
|
268
|
+
<button
|
|
269
|
+
className={`px-4 py-2 border-b-2 text-xs font-bold transition-all cursor-pointer ${
|
|
270
|
+
subTab === 'changes'
|
|
271
|
+
? 'border-indigo-500 text-white'
|
|
272
|
+
: 'border-transparent text-gray-500 hover:text-gray-300'
|
|
273
|
+
}`}
|
|
274
|
+
onClick={() => setSubTab('changes')}
|
|
275
|
+
>
|
|
276
|
+
Active Changes (AI Diffs)
|
|
277
|
+
</button>
|
|
278
|
+
<button
|
|
279
|
+
className={`px-4 py-2 border-b-2 text-xs font-bold transition-all cursor-pointer ${
|
|
280
|
+
subTab === 'knowledge'
|
|
281
|
+
? 'border-indigo-500 text-white'
|
|
282
|
+
: 'border-transparent text-gray-500 hover:text-gray-300'
|
|
283
|
+
}`}
|
|
284
|
+
onClick={() => setSubTab('knowledge')}
|
|
285
|
+
>
|
|
286
|
+
Knowledge Base
|
|
287
|
+
</button>
|
|
288
|
+
<button
|
|
289
|
+
className={`px-4 py-2 border-b-2 text-xs font-bold transition-all cursor-pointer ${
|
|
290
|
+
subTab === 'plan'
|
|
291
|
+
? 'border-indigo-500 text-white'
|
|
292
|
+
: 'border-transparent text-gray-500 hover:text-gray-300'
|
|
293
|
+
}`}
|
|
294
|
+
onClick={() => setSubTab('plan')}
|
|
295
|
+
>
|
|
296
|
+
Implementation Plan
|
|
297
|
+
</button>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{subTab === 'sessions' && (
|
|
301
|
+
<SessionHistory
|
|
302
|
+
ws={ws}
|
|
303
|
+
sessions={sessions}
|
|
304
|
+
sessionsLoading={sessionsLoading}
|
|
305
|
+
activeSession={activeSession}
|
|
306
|
+
transcript={transcript}
|
|
307
|
+
transcriptLoading={transcriptLoading}
|
|
308
|
+
workspaces={workspaces}
|
|
309
|
+
setActiveSession={setActiveSession}
|
|
310
|
+
setTranscript={setTranscript}
|
|
311
|
+
fetchSessionTranscript={fetchSessionTranscript}
|
|
312
|
+
handleResumeSession={handleResumeSession}
|
|
313
|
+
/>
|
|
314
|
+
)}
|
|
315
|
+
|
|
316
|
+
{subTab === 'services' && (
|
|
317
|
+
<ServiceConsole
|
|
318
|
+
ws={ws}
|
|
319
|
+
services={services}
|
|
320
|
+
runningServices={runningServices}
|
|
321
|
+
selectedLogService={selectedLogService}
|
|
322
|
+
serviceLogs={serviceLogs}
|
|
323
|
+
logsEndRef={logsEndRef}
|
|
324
|
+
setSelectedLogService={setSelectedLogService}
|
|
325
|
+
handleStartServices={handleStartServices}
|
|
326
|
+
handleStopServices={handleStopServices}
|
|
327
|
+
orchTools={orchTools}
|
|
328
|
+
servicesLoading={servicesLoading}
|
|
329
|
+
/>
|
|
330
|
+
)}
|
|
331
|
+
|
|
332
|
+
{subTab === 'changes' && (
|
|
333
|
+
<ChangesViewer
|
|
334
|
+
ws={ws}
|
|
335
|
+
gitChanges={gitChanges}
|
|
336
|
+
gitChangesLoading={gitChangesLoading}
|
|
337
|
+
syncLoading={syncLoading}
|
|
338
|
+
syncResults={syncResults}
|
|
339
|
+
commitMessage={commitMessage}
|
|
340
|
+
showCommitModal={showCommitModal}
|
|
341
|
+
commitLoading={commitLoading}
|
|
342
|
+
commitResults={commitResults}
|
|
343
|
+
setSyncResults={setSyncResults}
|
|
344
|
+
setCommitResults={setCommitResults}
|
|
345
|
+
setCommitMessage={setCommitMessage}
|
|
346
|
+
setShowCommitModal={setShowCommitModal}
|
|
347
|
+
fetchGitChanges={fetchGitChanges}
|
|
348
|
+
handleSyncAll={handleSyncAll}
|
|
349
|
+
handleCommitAll={handleCommitAll}
|
|
350
|
+
/>
|
|
351
|
+
)}
|
|
352
|
+
|
|
353
|
+
{subTab === 'knowledge' && (
|
|
354
|
+
<KnowledgeBase
|
|
355
|
+
ws={ws}
|
|
356
|
+
knowledgeContent={knowledgeContent}
|
|
357
|
+
knowledgeLoading={knowledgeLoading}
|
|
358
|
+
isEditingKnowledge={isEditingKnowledge}
|
|
359
|
+
editedKnowledge={editedKnowledge}
|
|
360
|
+
saveKnowledgeLoading={saveKnowledgeLoading}
|
|
361
|
+
setEditedKnowledge={setEditedKnowledge}
|
|
362
|
+
setIsEditingKnowledge={setIsEditingKnowledge}
|
|
363
|
+
handleSaveKnowledge={handleSaveKnowledge}
|
|
364
|
+
/>
|
|
365
|
+
)}
|
|
366
|
+
|
|
367
|
+
{subTab === 'plan' && (
|
|
368
|
+
<ImplementationPlan
|
|
369
|
+
planContent={planContent}
|
|
370
|
+
planLoading={planLoading}
|
|
371
|
+
/>
|
|
372
|
+
)}
|
|
373
|
+
</div>
|
|
374
|
+
)}
|
|
375
|
+
</div>
|
|
376
|
+
);
|
|
377
|
+
})}
|
|
378
|
+
</div>
|
|
379
|
+
)}
|
|
380
|
+
</div>
|
|
381
|
+
);
|
|
382
|
+
};
|
package/gui/src/types.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Types matched with src/types.ts
|
|
2
|
+
|
|
3
|
+
export interface NexusFlowConfig {
|
|
4
|
+
version: string;
|
|
5
|
+
devDir: string;
|
|
6
|
+
workspacesDir: string;
|
|
7
|
+
defaultAssistant: string | null;
|
|
8
|
+
scanDepth: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface DetectedAI {
|
|
12
|
+
name: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
detected: boolean;
|
|
15
|
+
command?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface DetectedEditor {
|
|
19
|
+
name: string;
|
|
20
|
+
command: string;
|
|
21
|
+
detected: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface RepoInfo {
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
defaultBranch: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Feature {
|
|
31
|
+
id: string;
|
|
32
|
+
branchName: string;
|
|
33
|
+
description: string;
|
|
34
|
+
repos: string[];
|
|
35
|
+
assistants: string[];
|
|
36
|
+
workspacePath: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ServiceConfig {
|
|
41
|
+
name: string;
|
|
42
|
+
cwd: string;
|
|
43
|
+
command: string;
|
|
44
|
+
args: string[];
|
|
45
|
+
port?: number;
|
|
46
|
+
source: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface OrchestrationDetection {
|
|
50
|
+
tool: string;
|
|
51
|
+
configPath: string;
|
|
52
|
+
startCommand: string;
|
|
53
|
+
stopCommand: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface RunningService {
|
|
57
|
+
name: string;
|
|
58
|
+
pid: number;
|
|
59
|
+
config: ServiceConfig;
|
|
60
|
+
startedAt: string;
|
|
61
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrpatronz/nexusflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Combine multiple repos into a workspace with rich AI assistant context",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,13 +8,15 @@
|
|
|
8
8
|
"nexusflow": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsc && npm run build --prefix gui",
|
|
11
|
+
"build": "tsc && npm run build --prefix gui && npm run extension:compile",
|
|
12
12
|
"dev": "tsc --watch",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
|
-
"test": "vitest run",
|
|
14
|
+
"test": "vitest run --passWithNoTests",
|
|
15
15
|
"test:watch": "vitest",
|
|
16
16
|
"clean": "rimraf dist",
|
|
17
|
-
"prepublishOnly": "npm run build"
|
|
17
|
+
"prepublishOnly": "npm run build",
|
|
18
|
+
"extension:install": "npm install --prefix extension",
|
|
19
|
+
"extension:compile": "npm run compile --prefix extension"
|
|
18
20
|
},
|
|
19
21
|
"keywords": [
|
|
20
22
|
"ai",
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module commands/commit
|
|
3
|
+
* Commits changes across all repositories in the workspace.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import { select } from '@inquirer/prompts';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import * as fs from 'node:fs/promises';
|
|
10
|
+
|
|
11
|
+
import { loadConfig } from '../core/config.js';
|
|
12
|
+
import { listWorkspaces, loadFeatureConfig } from '../core/workspace.js';
|
|
13
|
+
import { getWorkspaceRepos, getRepoStatus, commitAndPush } from '../utils/multi-git.js';
|
|
14
|
+
|
|
15
|
+
interface CommitOptions {
|
|
16
|
+
noPush?: boolean;
|
|
17
|
+
dryRun?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Executes the commit command.
|
|
22
|
+
*
|
|
23
|
+
* @param message - The commit message.
|
|
24
|
+
* @param workspaceArg - Optional workspace path.
|
|
25
|
+
* @param options - Optional flags.
|
|
26
|
+
*/
|
|
27
|
+
export async function commitCommand(
|
|
28
|
+
message: string,
|
|
29
|
+
workspaceArg?: string,
|
|
30
|
+
options?: CommitOptions,
|
|
31
|
+
): Promise<void> {
|
|
32
|
+
console.log(chalk.bold.cyan('\nš¾ NexusFlow ā Committing Workspace Changes\n'));
|
|
33
|
+
|
|
34
|
+
const workspacePath = await resolveWorkspace(workspaceArg);
|
|
35
|
+
if (!workspacePath) return;
|
|
36
|
+
|
|
37
|
+
const feature = await loadFeatureConfig(workspacePath);
|
|
38
|
+
if (!feature) {
|
|
39
|
+
console.error(chalk.red('ā Failed to load workspace configuration.'));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const repos = await getWorkspaceRepos(workspacePath);
|
|
44
|
+
const changedRepos = [];
|
|
45
|
+
|
|
46
|
+
for (const repo of repos) {
|
|
47
|
+
const status = await getRepoStatus(repo.path);
|
|
48
|
+
if (status.hasChanges) {
|
|
49
|
+
changedRepos.push({ repo, status });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (changedRepos.length === 0) {
|
|
54
|
+
console.log(chalk.green('ā
No changes to commit across any repositories.\n'));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
console.log(`Found ${chalk.bold(changedRepos.length)} repositor${changedRepos.length === 1 ? 'y' : 'ies'} with changes.`);
|
|
59
|
+
if (options?.dryRun) {
|
|
60
|
+
console.log(chalk.yellow('ā ļø Dry run mode enabled. No changes will actually be committed or pushed.'));
|
|
61
|
+
}
|
|
62
|
+
console.log();
|
|
63
|
+
|
|
64
|
+
for (const { repo, status } of changedRepos) {
|
|
65
|
+
console.log(`Repository: ${chalk.bold(repo.name)}`);
|
|
66
|
+
console.log(chalk.dim(` Changes: ${status.summary}`));
|
|
67
|
+
for (const file of status.changedFiles) {
|
|
68
|
+
console.log(` ${chalk.yellow('M')} ${file}`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (options?.dryRun) {
|
|
72
|
+
console.log(chalk.dim(' [Dry Run] Would commit and ' + (options?.noPush ? 'not push' : 'push')));
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const spinner = chalk.dim(' Committing...');
|
|
77
|
+
process.stdout.write(spinner);
|
|
78
|
+
|
|
79
|
+
const result = await commitAndPush(repo.path, message, repo.branchName, {
|
|
80
|
+
noPush: options?.noPush,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
process.stdout.write('\r' + ' '.repeat(spinner.length) + '\r');
|
|
84
|
+
|
|
85
|
+
if (result.success) {
|
|
86
|
+
const action = options?.noPush ? 'Committed' : 'Committed & pushed';
|
|
87
|
+
console.log(` ${chalk.green('ā
')} ${action} (${chalk.cyan(result.commitHash || 'no hash')})`);
|
|
88
|
+
} else {
|
|
89
|
+
console.log(` ${chalk.red('ā')} Failed: ${result.message}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
console.log();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Resolves workspace path.
|
|
98
|
+
*/
|
|
99
|
+
async function resolveWorkspace(workspaceArg?: string): Promise<string | null> {
|
|
100
|
+
if (workspaceArg) {
|
|
101
|
+
const absolutePath = path.resolve(workspaceArg);
|
|
102
|
+
try {
|
|
103
|
+
await fs.access(path.join(absolutePath, 'nexusflow.json'));
|
|
104
|
+
return absolutePath;
|
|
105
|
+
} catch {
|
|
106
|
+
console.error(chalk.red(`ā Invalid workspace: No nexusflow.json found at ${absolutePath}`));
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
112
|
+
if (cwdFeature) return process.cwd();
|
|
113
|
+
|
|
114
|
+
const config = await loadConfig();
|
|
115
|
+
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
116
|
+
|
|
117
|
+
if (workspaces.length === 0) {
|
|
118
|
+
console.log(chalk.yellow('No workspaces found.\n'));
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const selected = await select({
|
|
123
|
+
message: 'Select a workspace to commit:',
|
|
124
|
+
choices: workspaces.map((ws) => ({
|
|
125
|
+
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
126
|
+
value: ws.workspacePath,
|
|
127
|
+
})),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
return selected;
|
|
131
|
+
}
|