@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
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module commands/adapter
|
|
3
|
+
* CLI commands for managing storage adapters.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* nexusflow adapter list # List all available adapters
|
|
7
|
+
* nexusflow adapter use <name> # Switch active adapter (prompts for config)
|
|
8
|
+
* nexusflow adapter info <name> # Show adapter details and current settings
|
|
9
|
+
* nexusflow adapter init <name> # Scaffold a new adapter plugin project
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import { input, confirm } from '@inquirer/prompts';
|
|
14
|
+
import * as fs from 'node:fs/promises';
|
|
15
|
+
import * as path from 'node:path';
|
|
16
|
+
|
|
17
|
+
import { listStorageProviders, getStorageProvider } from '../core/adapters/registry.js';
|
|
18
|
+
import { loadConfig, saveConfig } from '../core/config.js';
|
|
19
|
+
import type { StorageAdapterMeta, AdapterConfigField } from '../core/ports/storage.js';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Lists all registered storage adapters in a formatted table.
|
|
23
|
+
*/
|
|
24
|
+
export async function adapterListCommand(): Promise<void> {
|
|
25
|
+
const config = await loadConfig();
|
|
26
|
+
const activeName = config.storageProvider || 'local';
|
|
27
|
+
const adapters = listStorageProviders();
|
|
28
|
+
|
|
29
|
+
console.log(chalk.bold.cyan('\n📦 Available Storage Adapters\n'));
|
|
30
|
+
|
|
31
|
+
// Table header
|
|
32
|
+
const nameW = 18;
|
|
33
|
+
const dispW = 22;
|
|
34
|
+
const actW = 8;
|
|
35
|
+
console.log(
|
|
36
|
+
chalk.dim(' ') +
|
|
37
|
+
chalk.bold('Name'.padEnd(nameW)) +
|
|
38
|
+
chalk.bold('Display Name'.padEnd(dispW)) +
|
|
39
|
+
chalk.bold('Active'.padEnd(actW)) +
|
|
40
|
+
chalk.bold('Description')
|
|
41
|
+
);
|
|
42
|
+
console.log(chalk.dim(' ' + '─'.repeat(nameW + dispW + actW + 40)));
|
|
43
|
+
|
|
44
|
+
for (const adapter of adapters) {
|
|
45
|
+
const isActive = adapter.name === activeName;
|
|
46
|
+
const activeMarker = isActive ? chalk.green(' ✔') : ' ';
|
|
47
|
+
const configCount = adapter.configFields.length;
|
|
48
|
+
const configHint = configCount > 0 ? chalk.dim(` (${configCount} settings)`) : '';
|
|
49
|
+
|
|
50
|
+
console.log(
|
|
51
|
+
' ' +
|
|
52
|
+
chalk.white(adapter.name.padEnd(nameW)) +
|
|
53
|
+
chalk.cyan(adapter.displayName.padEnd(dispW)) +
|
|
54
|
+
activeMarker.padEnd(actW) +
|
|
55
|
+
chalk.gray(adapter.description) +
|
|
56
|
+
configHint
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
console.log();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Shows detailed information about a specific adapter.
|
|
64
|
+
*/
|
|
65
|
+
export async function adapterInfoCommand(adapterName: string): Promise<void> {
|
|
66
|
+
const config = await loadConfig();
|
|
67
|
+
const activeName = config.storageProvider || 'local';
|
|
68
|
+
|
|
69
|
+
let meta: StorageAdapterMeta;
|
|
70
|
+
try {
|
|
71
|
+
meta = getStorageProvider(adapterName).meta;
|
|
72
|
+
} catch {
|
|
73
|
+
console.error(chalk.red(`\n✖ Adapter "${adapterName}" is not registered.\n`));
|
|
74
|
+
const adapters = listStorageProviders();
|
|
75
|
+
console.log(chalk.dim(` Available: ${adapters.map(a => a.name).join(', ')}`));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log(chalk.bold.cyan(`\n📦 Adapter: ${meta.displayName}\n`));
|
|
80
|
+
console.log(` ${chalk.bold('Name:')} ${meta.name}`);
|
|
81
|
+
console.log(` ${chalk.bold('Active:')} ${meta.name === activeName ? chalk.green('Yes') : 'No'}`);
|
|
82
|
+
console.log(` ${chalk.bold('Description:')} ${meta.description}`);
|
|
83
|
+
|
|
84
|
+
if (meta.configFields.length > 0) {
|
|
85
|
+
console.log(`\n ${chalk.bold('Configuration Fields:')}`);
|
|
86
|
+
const currentSettings = config.adapterConfig?.[meta.name] ?? {};
|
|
87
|
+
|
|
88
|
+
for (const field of meta.configFields) {
|
|
89
|
+
const currentValue = currentSettings[field.key];
|
|
90
|
+
const defaultStr = field.default !== undefined ? chalk.dim(` (default: ${String(field.default)})`) : '';
|
|
91
|
+
const requiredStr = field.required ? chalk.yellow(' *required') : '';
|
|
92
|
+
const valueStr = currentValue !== undefined ? chalk.green(String(currentValue)) : chalk.dim('not set');
|
|
93
|
+
|
|
94
|
+
console.log(` ${chalk.white(field.label)} [${field.key}]${requiredStr}${defaultStr}`);
|
|
95
|
+
console.log(` ${chalk.dim(field.description || '')}`);
|
|
96
|
+
console.log(` Current: ${valueStr}`);
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
console.log(chalk.dim('\n No configuration needed.'));
|
|
100
|
+
}
|
|
101
|
+
console.log();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Switches the active adapter and prompts for any required configuration.
|
|
106
|
+
*/
|
|
107
|
+
export async function adapterUseCommand(adapterName: string): Promise<void> {
|
|
108
|
+
let provider;
|
|
109
|
+
try {
|
|
110
|
+
provider = getStorageProvider(adapterName);
|
|
111
|
+
} catch {
|
|
112
|
+
console.error(chalk.red(`\n✖ Adapter "${adapterName}" is not registered.\n`));
|
|
113
|
+
const adapters = listStorageProviders();
|
|
114
|
+
console.log(chalk.dim(` Available: ${adapters.map(a => a.name).join(', ')}`));
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const config = await loadConfig();
|
|
119
|
+
const meta = provider.meta;
|
|
120
|
+
const existingSettings = config.adapterConfig?.[meta.name] ?? {};
|
|
121
|
+
const newSettings: Record<string, unknown> = { ...existingSettings };
|
|
122
|
+
|
|
123
|
+
// Prompt for each config field
|
|
124
|
+
if (meta.configFields.length > 0) {
|
|
125
|
+
console.log(chalk.bold.cyan(`\n⚙️ Configure ${meta.displayName}\n`));
|
|
126
|
+
|
|
127
|
+
for (const field of meta.configFields) {
|
|
128
|
+
const currentValue = existingSettings[field.key];
|
|
129
|
+
const defaultValue = currentValue !== undefined ? String(currentValue) : (field.default !== undefined ? String(field.default) : undefined);
|
|
130
|
+
|
|
131
|
+
if (field.type === 'boolean') {
|
|
132
|
+
const result = await confirm({
|
|
133
|
+
message: field.label + (field.description ? chalk.dim(` — ${field.description}`) : ''),
|
|
134
|
+
default: defaultValue === 'true' || field.default === true,
|
|
135
|
+
});
|
|
136
|
+
newSettings[field.key] = result;
|
|
137
|
+
} else {
|
|
138
|
+
const result = await input({
|
|
139
|
+
message: field.label + (field.description ? chalk.dim(` — ${field.description}`) : ''),
|
|
140
|
+
default: defaultValue,
|
|
141
|
+
validate: (val) => {
|
|
142
|
+
if (field.required && !val.trim()) return `${field.label} is required`;
|
|
143
|
+
return true;
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
if (field.type === 'number') {
|
|
148
|
+
newSettings[field.key] = Number(result);
|
|
149
|
+
} else {
|
|
150
|
+
newSettings[field.key] = result;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Save config
|
|
157
|
+
if (!config.adapterConfig) {
|
|
158
|
+
config.adapterConfig = {};
|
|
159
|
+
}
|
|
160
|
+
config.adapterConfig[meta.name] = newSettings;
|
|
161
|
+
config.storageProvider = meta.name;
|
|
162
|
+
await saveConfig(config);
|
|
163
|
+
|
|
164
|
+
// Apply configuration
|
|
165
|
+
if (provider.configure) {
|
|
166
|
+
provider.configure(newSettings);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
console.log(chalk.green(`\n✔ Activated '${meta.displayName}' adapter.\n`));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Scaffolds a new adapter plugin project.
|
|
174
|
+
*/
|
|
175
|
+
export async function adapterInitCommand(adapterName: string): Promise<void> {
|
|
176
|
+
const targetDir = path.resolve(adapterName);
|
|
177
|
+
|
|
178
|
+
try {
|
|
179
|
+
await fs.access(targetDir);
|
|
180
|
+
console.error(chalk.red(`\n✖ Directory "${adapterName}" already exists.\n`));
|
|
181
|
+
return;
|
|
182
|
+
} catch {}
|
|
183
|
+
|
|
184
|
+
console.log(chalk.bold.cyan(`\n🔧 Scaffolding adapter: ${adapterName}\n`));
|
|
185
|
+
|
|
186
|
+
await fs.mkdir(path.join(targetDir, 'src'), { recursive: true });
|
|
187
|
+
|
|
188
|
+
// package.json
|
|
189
|
+
const pkg = {
|
|
190
|
+
name: `nexusflow-${adapterName}`,
|
|
191
|
+
version: '1.0.0',
|
|
192
|
+
type: 'module',
|
|
193
|
+
main: 'dist/index.js',
|
|
194
|
+
scripts: {
|
|
195
|
+
build: 'tsc',
|
|
196
|
+
dev: 'tsc --watch',
|
|
197
|
+
},
|
|
198
|
+
peerDependencies: {
|
|
199
|
+
'@mrpatronz/nexusflow': '>=0.2.0',
|
|
200
|
+
},
|
|
201
|
+
devDependencies: {
|
|
202
|
+
typescript: '^5.0.0',
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
await fs.writeFile(path.join(targetDir, 'package.json'), JSON.stringify(pkg, null, 2), 'utf8');
|
|
206
|
+
|
|
207
|
+
// tsconfig.json
|
|
208
|
+
const tsconfig = {
|
|
209
|
+
compilerOptions: {
|
|
210
|
+
target: 'ES2022',
|
|
211
|
+
module: 'Node16',
|
|
212
|
+
moduleResolution: 'Node16',
|
|
213
|
+
outDir: 'dist',
|
|
214
|
+
rootDir: 'src',
|
|
215
|
+
strict: true,
|
|
216
|
+
esModuleInterop: true,
|
|
217
|
+
declaration: true,
|
|
218
|
+
},
|
|
219
|
+
include: ['src/**/*'],
|
|
220
|
+
};
|
|
221
|
+
await fs.writeFile(path.join(targetDir, 'tsconfig.json'), JSON.stringify(tsconfig, null, 2), 'utf8');
|
|
222
|
+
|
|
223
|
+
// src/index.ts — starter adapter
|
|
224
|
+
const indexContent = `/**
|
|
225
|
+
* NexusFlow Storage Adapter: ${adapterName}
|
|
226
|
+
*
|
|
227
|
+
* Implement the StoragePort interface to create a custom storage backend.
|
|
228
|
+
* See: https://github.com/antan87/NexusFlow#adapters
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
import type { StoragePort, StorageAdapterMeta, NexusFlowPlugin } from '@mrpatronz/nexusflow';
|
|
232
|
+
// If the above import fails, use relative path to nexusflow's type definitions.
|
|
233
|
+
|
|
234
|
+
class ${toPascalCase(adapterName)}Adapter implements StoragePort {
|
|
235
|
+
readonly meta: StorageAdapterMeta = {
|
|
236
|
+
name: '${adapterName}',
|
|
237
|
+
displayName: '${toTitleCase(adapterName)}',
|
|
238
|
+
description: 'A custom NexusFlow storage adapter.',
|
|
239
|
+
configFields: [
|
|
240
|
+
// Add your configuration fields here, e.g.:
|
|
241
|
+
// { key: 'endpoint', label: 'API Endpoint', type: 'string', required: true, description: 'URL of the storage API' },
|
|
242
|
+
],
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
configure(settings: Record<string, unknown>): void {
|
|
246
|
+
// Read your adapter-specific settings here
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ── Workspace (feature) layer ────────────────────────────
|
|
250
|
+
|
|
251
|
+
async writeWorkspaceFile(workspacePath: string, featureId: string, filename: string, content: string): Promise<void> {
|
|
252
|
+
throw new Error('Not implemented yet');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
async readWorkspaceFile(workspacePath: string, featureId: string, filename: string): Promise<string> {
|
|
256
|
+
throw new Error('Not implemented yet');
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async workspaceFileExists(workspacePath: string, featureId: string, filename: string): Promise<boolean> {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
resolveWorkspaceFileUrl(workspacePath: string, featureId: string, filename: string): string {
|
|
264
|
+
return '';
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// ── Base (repo) layer ────────────────────────────────────
|
|
268
|
+
|
|
269
|
+
async writeBaseFile(workspacePath: string, repoName: string, filename: string, content: string): Promise<void> {
|
|
270
|
+
throw new Error('Not implemented yet');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
async readBaseFile(workspacePath: string, repoName: string, filename: string): Promise<string> {
|
|
274
|
+
throw new Error('Not implemented yet');
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
async baseFileExists(workspacePath: string, repoName: string, filename: string): Promise<boolean> {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
resolveBaseFileUrl(workspacePath: string, repoName: string, filename: string): string {
|
|
282
|
+
return '';
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const plugin: NexusFlowPlugin = {
|
|
287
|
+
name: 'nexusflow-${adapterName}',
|
|
288
|
+
version: '1.0.0',
|
|
289
|
+
register(context) {
|
|
290
|
+
context.registerStorageProvider('${adapterName}', new ${toPascalCase(adapterName)}Adapter());
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export default plugin;
|
|
295
|
+
`;
|
|
296
|
+
await fs.writeFile(path.join(targetDir, 'src', 'index.ts'), indexContent, 'utf8');
|
|
297
|
+
|
|
298
|
+
// README.md
|
|
299
|
+
const readme = `# nexusflow-${adapterName}
|
|
300
|
+
|
|
301
|
+
A custom storage adapter for [NexusFlow](https://github.com/antan87/NexusFlow).
|
|
302
|
+
|
|
303
|
+
## Development
|
|
304
|
+
|
|
305
|
+
\`\`\`bash
|
|
306
|
+
npm install
|
|
307
|
+
npm run build
|
|
308
|
+
\`\`\`
|
|
309
|
+
|
|
310
|
+
## Usage
|
|
311
|
+
|
|
312
|
+
Add to your NexusFlow config (\`~/.nexusflow/config.json\`):
|
|
313
|
+
|
|
314
|
+
\`\`\`json
|
|
315
|
+
{
|
|
316
|
+
"plugins": ["./path/to/nexusflow-${adapterName}/dist/index.js"],
|
|
317
|
+
"storageProvider": "${adapterName}"
|
|
318
|
+
}
|
|
319
|
+
\`\`\`
|
|
320
|
+
|
|
321
|
+
Or activate via CLI:
|
|
322
|
+
|
|
323
|
+
\`\`\`bash
|
|
324
|
+
nexusflow adapter use ${adapterName}
|
|
325
|
+
\`\`\`
|
|
326
|
+
`;
|
|
327
|
+
await fs.writeFile(path.join(targetDir, 'README.md'), readme, 'utf8');
|
|
328
|
+
|
|
329
|
+
console.log(chalk.green(' ✔ Created package.json'));
|
|
330
|
+
console.log(chalk.green(' ✔ Created tsconfig.json'));
|
|
331
|
+
console.log(chalk.green(' ✔ Created src/index.ts (starter adapter)'));
|
|
332
|
+
console.log(chalk.green(' ✔ Created README.md'));
|
|
333
|
+
console.log(chalk.bold.green(`\n✅ Adapter scaffolded at ${targetDir}\n`));
|
|
334
|
+
console.log(chalk.dim(' Next steps:'));
|
|
335
|
+
console.log(chalk.dim(` cd ${adapterName}`));
|
|
336
|
+
console.log(chalk.dim(' npm install'));
|
|
337
|
+
console.log(chalk.dim(' # Implement the StoragePort methods in src/index.ts'));
|
|
338
|
+
console.log(chalk.dim(' npm run build'));
|
|
339
|
+
console.log();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function toPascalCase(str: string): string {
|
|
343
|
+
return str.split(/[-_]/).map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('');
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function toTitleCase(str: string): string {
|
|
347
|
+
return str.split(/[-_]/).map(s => s.charAt(0).toUpperCase() + s.slice(1)).join(' ');
|
|
348
|
+
}
|
package/src/commands/add-repo.ts
CHANGED
|
@@ -1,157 +1,156 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module commands/add-repo
|
|
3
|
-
* Adds a repository to an existing NexusFlow workspace.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import ora from 'ora';
|
|
8
|
-
import { select, search } from '@inquirer/prompts';
|
|
9
|
-
import * as path from 'node:path';
|
|
10
|
-
|
|
11
|
-
import { loadConfig } from '../core/config.js';
|
|
12
|
-
import { scanForRepos } from '../core/scanner.js';
|
|
13
|
-
import { listWorkspaces, loadFeatureConfig, addRepoToWorkspace } from '../core/workspace.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Executes the add-repo command.
|
|
17
|
-
*
|
|
18
|
-
* @param repoPathArg - Optional repository path to add.
|
|
19
|
-
* @param workspaceArg - Optional workspace path or name.
|
|
20
|
-
*/
|
|
21
|
-
export async function addRepoCommand(
|
|
22
|
-
repoPathArg?: string,
|
|
23
|
-
workspaceArg?: string,
|
|
24
|
-
): Promise<void> {
|
|
25
|
-
console.log(chalk.bold.cyan('\n➕ NexusFlow — Adding Repository to Workspace\n'));
|
|
26
|
-
|
|
27
|
-
const config = await loadConfig();
|
|
28
|
-
|
|
29
|
-
// 1. Resolve workspace
|
|
30
|
-
let workspacePath: string | null = null;
|
|
31
|
-
let workspaceName = '';
|
|
32
|
-
|
|
33
|
-
if (workspaceArg) {
|
|
34
|
-
const resolvedPath = path.isAbsolute(workspaceArg)
|
|
35
|
-
? workspaceArg
|
|
36
|
-
: path.resolve(config.workspacesDir, workspaceArg);
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
const manifest = await loadFeatureConfig(resolvedPath);
|
|
40
|
-
if (manifest) {
|
|
41
|
-
workspacePath = resolvedPath;
|
|
42
|
-
workspaceName = manifest.branchName;
|
|
43
|
-
}
|
|
44
|
-
} catch {}
|
|
45
|
-
|
|
46
|
-
if (!workspacePath) {
|
|
47
|
-
const directPath = path.join(config.workspacesDir, workspaceArg);
|
|
48
|
-
const manifest = await loadFeatureConfig(directPath);
|
|
49
|
-
if (manifest) {
|
|
50
|
-
workspacePath = directPath;
|
|
51
|
-
workspaceName = manifest.branchName;
|
|
52
|
-
} else {
|
|
53
|
-
console.error(chalk.red(`✖ Invalid workspace: No nexusflow.json found at ${workspaceArg}`));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
59
|
-
if (cwdFeature) {
|
|
60
|
-
workspacePath = cwdFeature.workspacePath;
|
|
61
|
-
workspaceName = cwdFeature.branchName;
|
|
62
|
-
} else {
|
|
63
|
-
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
64
|
-
if (workspaces.length === 0) {
|
|
65
|
-
console.log(chalk.yellow('No workspaces found.\n'));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const selected = await search({
|
|
70
|
-
message: 'Search and select a workspace to add a repository to:',
|
|
71
|
-
source: async (input) => {
|
|
72
|
-
const query = (input || '').toLowerCase();
|
|
73
|
-
const filtered = workspaces.filter(
|
|
74
|
-
(ws) =>
|
|
75
|
-
ws.branchName.toLowerCase().includes(query) ||
|
|
76
|
-
ws.workspacePath.toLowerCase().includes(query)
|
|
77
|
-
);
|
|
78
|
-
return filtered.map((ws) => ({
|
|
79
|
-
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
80
|
-
value: ws,
|
|
81
|
-
}));
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
workspacePath = selected.workspacePath;
|
|
86
|
-
workspaceName = selected.branchName;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (!workspacePath) return;
|
|
91
|
-
|
|
92
|
-
const feature = await loadFeatureConfig(workspacePath);
|
|
93
|
-
if (!feature) {
|
|
94
|
-
console.error(chalk.red('✖ Failed to load workspace configuration.'));
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// 2. Resolve repository to add
|
|
99
|
-
let repoPathToAdd = '';
|
|
100
|
-
|
|
101
|
-
if (repoPathArg) {
|
|
102
|
-
repoPathToAdd = path.resolve(repoPathArg);
|
|
103
|
-
} else {
|
|
104
|
-
const scanSpinner = ora('Scanning for projects...').start();
|
|
105
|
-
let repos = [];
|
|
106
|
-
try {
|
|
107
|
-
repos = await scanForRepos(config.devDir, config.scanDepth);
|
|
108
|
-
scanSpinner.succeed(`Found ${chalk.bold(repos.length)} projects in ${config.devDir}`);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
scanSpinner.fail('Failed to scan for projects');
|
|
111
|
-
console.error(error);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const availableRepos = repos.filter(
|
|
116
|
-
(r) => !feature.repos.includes(r.path)
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
if (availableRepos.length === 0) {
|
|
120
|
-
console.log(chalk.yellow('All scanned repositories are already in the workspace.\n'));
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
repoPathToAdd = await search({
|
|
125
|
-
message: 'Search and select a repository to add:',
|
|
126
|
-
source: async (input) => {
|
|
127
|
-
const query = (input || '').toLowerCase();
|
|
128
|
-
const filtered = availableRepos.filter(
|
|
129
|
-
(r) =>
|
|
130
|
-
r.name.toLowerCase().includes(query) ||
|
|
131
|
-
r.path.toLowerCase().includes(query)
|
|
132
|
-
);
|
|
133
|
-
return filtered.map((r) => ({
|
|
134
|
-
name: `${r.name} ${chalk.dim(`(${r.path})`)}`,
|
|
135
|
-
value: r.path,
|
|
136
|
-
}));
|
|
137
|
-
},
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const repoName = path.basename(repoPathToAdd);
|
|
142
|
-
const spinner = ora(`Adding ${repoName} to workspace ${workspaceName}...`).start();
|
|
143
|
-
|
|
144
|
-
try {
|
|
145
|
-
await addRepoToWorkspace(workspacePath, repoPathToAdd);
|
|
146
|
-
spinner.succeed(`Successfully added ${chalk.bold(repoName)} to workspace ${chalk.bold(workspaceName)}`);
|
|
147
|
-
console.log(chalk.dim(' - Checked out git worktree'));
|
|
148
|
-
console.log(chalk.dim(' - Updated nexusflow.json and .gitignore'));
|
|
149
|
-
console.log(chalk.dim(' - Re-analyzed workspace codebases'));
|
|
150
|
-
console.log(chalk.dim(' - Regenerated LLM instruction context files'));
|
|
151
|
-
console.log(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module commands/add-repo
|
|
3
|
+
* Adds a repository to an existing NexusFlow workspace.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import ora from 'ora';
|
|
8
|
+
import { select, search } from '@inquirer/prompts';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
|
|
11
|
+
import { loadConfig } from '../core/config.js';
|
|
12
|
+
import { scanForRepos } from '../core/scanner.js';
|
|
13
|
+
import { listWorkspaces, loadFeatureConfig, addRepoToWorkspace } from '../core/workspace.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Executes the add-repo command.
|
|
17
|
+
*
|
|
18
|
+
* @param repoPathArg - Optional repository path to add.
|
|
19
|
+
* @param workspaceArg - Optional workspace path or name.
|
|
20
|
+
*/
|
|
21
|
+
export async function addRepoCommand(
|
|
22
|
+
repoPathArg?: string,
|
|
23
|
+
workspaceArg?: string,
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
console.log(chalk.bold.cyan('\n➕ NexusFlow — Adding Repository to Workspace\n'));
|
|
26
|
+
|
|
27
|
+
const config = await loadConfig();
|
|
28
|
+
|
|
29
|
+
// 1. Resolve workspace
|
|
30
|
+
let workspacePath: string | null = null;
|
|
31
|
+
let workspaceName = '';
|
|
32
|
+
|
|
33
|
+
if (workspaceArg) {
|
|
34
|
+
const resolvedPath = path.isAbsolute(workspaceArg)
|
|
35
|
+
? workspaceArg
|
|
36
|
+
: path.resolve(config.workspacesDir, workspaceArg);
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const manifest = await loadFeatureConfig(resolvedPath);
|
|
40
|
+
if (manifest) {
|
|
41
|
+
workspacePath = resolvedPath;
|
|
42
|
+
workspaceName = manifest.branchName;
|
|
43
|
+
}
|
|
44
|
+
} catch {}
|
|
45
|
+
|
|
46
|
+
if (!workspacePath) {
|
|
47
|
+
const directPath = path.join(config.workspacesDir, workspaceArg);
|
|
48
|
+
const manifest = await loadFeatureConfig(directPath);
|
|
49
|
+
if (manifest) {
|
|
50
|
+
workspacePath = directPath;
|
|
51
|
+
workspaceName = manifest.branchName;
|
|
52
|
+
} else {
|
|
53
|
+
console.error(chalk.red(`✖ Invalid workspace: No nexusflow.json found at ${workspaceArg}`));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
const cwdFeature = await loadFeatureConfig(process.cwd());
|
|
59
|
+
if (cwdFeature) {
|
|
60
|
+
workspacePath = cwdFeature.workspacePath;
|
|
61
|
+
workspaceName = cwdFeature.branchName;
|
|
62
|
+
} else {
|
|
63
|
+
const workspaces = await listWorkspaces(config.workspacesDir);
|
|
64
|
+
if (workspaces.length === 0) {
|
|
65
|
+
console.log(chalk.yellow('No workspaces found.\n'));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const selected = await search({
|
|
70
|
+
message: 'Search and select a workspace to add a repository to:',
|
|
71
|
+
source: async (input) => {
|
|
72
|
+
const query = (input || '').toLowerCase();
|
|
73
|
+
const filtered = workspaces.filter(
|
|
74
|
+
(ws) =>
|
|
75
|
+
ws.branchName.toLowerCase().includes(query) ||
|
|
76
|
+
ws.workspacePath.toLowerCase().includes(query)
|
|
77
|
+
);
|
|
78
|
+
return filtered.map((ws) => ({
|
|
79
|
+
name: `${ws.branchName} ${chalk.dim(`(${ws.repos.length} repos)`)}`,
|
|
80
|
+
value: ws,
|
|
81
|
+
}));
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
workspacePath = selected.workspacePath;
|
|
86
|
+
workspaceName = selected.branchName;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (!workspacePath) return;
|
|
91
|
+
|
|
92
|
+
const feature = await loadFeatureConfig(workspacePath);
|
|
93
|
+
if (!feature) {
|
|
94
|
+
console.error(chalk.red('✖ Failed to load workspace configuration.'));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 2. Resolve repository to add
|
|
99
|
+
let repoPathToAdd = '';
|
|
100
|
+
|
|
101
|
+
if (repoPathArg) {
|
|
102
|
+
repoPathToAdd = path.resolve(repoPathArg);
|
|
103
|
+
} else {
|
|
104
|
+
const scanSpinner = ora('Scanning for projects...').start();
|
|
105
|
+
let repos = [];
|
|
106
|
+
try {
|
|
107
|
+
repos = await scanForRepos(config.devDir, config.scanDepth);
|
|
108
|
+
scanSpinner.succeed(`Found ${chalk.bold(repos.length)} projects in ${config.devDir}`);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
scanSpinner.fail('Failed to scan for projects');
|
|
111
|
+
console.error(error);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const availableRepos = repos.filter(
|
|
116
|
+
(r) => !feature.repos.includes(r.path)
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
if (availableRepos.length === 0) {
|
|
120
|
+
console.log(chalk.yellow('All scanned repositories are already in the workspace.\n'));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
repoPathToAdd = await search({
|
|
125
|
+
message: 'Search and select a repository to add:',
|
|
126
|
+
source: async (input) => {
|
|
127
|
+
const query = (input || '').toLowerCase();
|
|
128
|
+
const filtered = availableRepos.filter(
|
|
129
|
+
(r) =>
|
|
130
|
+
r.name.toLowerCase().includes(query) ||
|
|
131
|
+
r.path.toLowerCase().includes(query)
|
|
132
|
+
);
|
|
133
|
+
return filtered.map((r) => ({
|
|
134
|
+
name: `${r.name} ${chalk.dim(`(${r.path})`)}`,
|
|
135
|
+
value: r.path,
|
|
136
|
+
}));
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const repoName = path.basename(repoPathToAdd);
|
|
142
|
+
const spinner = ora(`Adding ${repoName} to workspace ${workspaceName}...`).start();
|
|
143
|
+
|
|
144
|
+
try {
|
|
145
|
+
await addRepoToWorkspace(workspacePath, repoPathToAdd);
|
|
146
|
+
spinner.succeed(`Successfully added ${chalk.bold(repoName)} to workspace ${chalk.bold(workspaceName)}`);
|
|
147
|
+
console.log(chalk.dim(' - Checked out git worktree'));
|
|
148
|
+
console.log(chalk.dim(' - Updated nexusflow.json and .gitignore'));
|
|
149
|
+
console.log(chalk.dim(' - Re-analyzed workspace codebases'));
|
|
150
|
+
console.log(chalk.dim(' - Regenerated LLM instruction context files'));
|
|
151
|
+
console.log();
|
|
152
|
+
} catch (error) {
|
|
153
|
+
spinner.fail(`Failed to add repository: ${error instanceof Error ? error.message : String(error)}`);
|
|
154
|
+
console.log();
|
|
155
|
+
}
|
|
156
|
+
}
|