@mrpatronz/nexusflow 0.2.13 ā 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/workflows/ci.yml +44 -0
- package/.github/workflows/dependabot-merge.yml +53 -0
- 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/GETTING_STARTED.md +5 -0
- package/README.md +53 -0
- 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/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/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/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 +1 -8
- 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 +439 -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/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 +19 -6
- package/dist/generators/base.js.map +1 -1
- 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 +75 -18
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/map-generator.d.ts.map +1 -1
- package/dist/generators/map-generator.js +7 -11
- 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/gui/app_logo.png +0 -0
- package/dist/gui/assets/index-CB-jWded.css +1 -0
- package/dist/gui/assets/index-DDXpZZu3.js +25 -0
- package/dist/gui/index.html +2 -2
- package/dist/index.js +174 -20
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +212 -28
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +173 -38
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +11 -2
- 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/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/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 -34
- 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/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 +4893 -1660
- package/extension/package.json +58 -11
- package/extension/src/extension.ts +476 -27
- package/extension/tsconfig.json +4 -2
- package/gui/e2e/wizard.spec.ts +19 -0
- package/gui/package-lock.json +342 -381
- package/gui/package.json +12 -12
- package/gui/public/app_logo.png +0 -0
- package/gui/src/App.tsx +991 -81
- package/gui/src/features/workspace/WorkspaceList.tsx +30 -30
- package/gui/src/index.css +64 -22
- package/gui/src/main.tsx +89 -5
- package/package.json +11 -12
- 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/skills-lock.json +11 -0
- package/src/commands/adapter.ts +348 -0
- package/src/commands/add-repo.ts +0 -1
- package/src/commands/commands.test.ts +3 -2
- package/src/commands/config.ts +52 -0
- package/src/commands/create.ts +14 -17
- package/src/commands/desktop.ts +128 -0
- package/src/commands/doctor.ts +13 -0
- package/src/commands/mcp.ts +2 -0
- package/src/commands/refresh.ts +4 -14
- package/src/commands/sync.ts +2 -8
- package/src/commands/tui.ts +484 -0
- package/src/commands/ui.ts +83 -19
- 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.ts +29 -4
- 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/storage.ts +37 -0
- package/src/core/workspace.ts +122 -15
- package/src/generators/base.ts +21 -5
- package/src/generators/diff-context.ts +75 -0
- package/src/generators/index.ts +93 -21
- package/src/generators/map-generator.ts +7 -10
- package/src/generators/plan-generator.ts +6 -4
- package/src/index.ts +178 -21
- package/src/server.test.ts +193 -39
- package/src/server.ts +238 -28
- package/src/types.ts +14 -2
- package/src/utils/git.ts +56 -0
- package/src/utils/local-ai.ts +8 -3
- package/src/utils/multi-git.ts +16 -9
- package/src/utils/update-check.ts +42 -31
- package/src/utils/workflow-advisor.ts +118 -0
- package/src/utils/workflows.test.ts +114 -0
- package/src/utils/workflows.ts +178 -0
- package/.github/workflows/release.yml +0 -100
- 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-CFWwqFux.js +0 -23
- package/dist/gui/assets/index-Dvc9QMvl.css +0 -2
- 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
|
@@ -148,7 +148,6 @@ export async function addRepoCommand(
|
|
|
148
148
|
console.log(chalk.dim(' - Updated nexusflow.json and .gitignore'));
|
|
149
149
|
console.log(chalk.dim(' - Re-analyzed workspace codebases'));
|
|
150
150
|
console.log(chalk.dim(' - Regenerated LLM instruction context files'));
|
|
151
|
-
console.log(chalk.dim(' - Repacked codebase context using Repomix'));
|
|
152
151
|
console.log();
|
|
153
152
|
} catch (error) {
|
|
154
153
|
spinner.fail(`Failed to add repository: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -103,7 +103,8 @@ describe('NexusFlow CLI New Commands unit tests', () => {
|
|
|
103
103
|
expect.any(Object),
|
|
104
104
|
expect.any(Array),
|
|
105
105
|
mockWorkspacePath,
|
|
106
|
-
'repo-1'
|
|
106
|
+
'repo-1',
|
|
107
|
+
undefined
|
|
107
108
|
);
|
|
108
109
|
});
|
|
109
110
|
});
|
|
@@ -141,7 +142,7 @@ describe('NexusFlow CLI New Commands unit tests', () => {
|
|
|
141
142
|
existingAIConfigs: [],
|
|
142
143
|
});
|
|
143
144
|
vi.spyOn(analyzers, 'analyzeAllRepos').mockResolvedValue(mockAnalysis);
|
|
144
|
-
vi.spyOn(fs, 'access').mockResolvedValue(undefined);
|
|
145
|
+
vi.spyOn(fs, 'access').mockResolvedValue(undefined); // covers .code-workspace + artifact checks
|
|
145
146
|
vi.spyOn(fs, 'readFile').mockResolvedValue(JSON.stringify({ "search.useIgnoreFiles": false }));
|
|
146
147
|
|
|
147
148
|
// Run doctor command
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module commands/config
|
|
3
|
+
* CLI command to view and update NexusFlow configuration.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* nexusflow config # Show current config
|
|
7
|
+
* nexusflow config set storageProvider local # Set a config key
|
|
8
|
+
* nexusflow config get storageProvider # Get a specific key
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { loadConfig, saveConfig } from '../core/config.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Displays the current NexusFlow configuration.
|
|
15
|
+
*/
|
|
16
|
+
export async function configShowCommand(): Promise<void> {
|
|
17
|
+
const config = await loadConfig();
|
|
18
|
+
console.log('\nāļø NexusFlow Configuration\n');
|
|
19
|
+
console.log(JSON.stringify(config, null, 2));
|
|
20
|
+
console.log();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Gets a specific configuration key.
|
|
25
|
+
*/
|
|
26
|
+
export async function configGetCommand(key: string): Promise<void> {
|
|
27
|
+
const config = await loadConfig();
|
|
28
|
+
const value = (config as unknown as Record<string, unknown>)[key];
|
|
29
|
+
|
|
30
|
+
if (value === undefined) {
|
|
31
|
+
console.log(` Key "${key}" is not set.`);
|
|
32
|
+
} else {
|
|
33
|
+
console.log(` ${key} = ${typeof value === 'object' ? JSON.stringify(value, null, 2) : String(value)}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Sets a specific configuration key.
|
|
39
|
+
*/
|
|
40
|
+
export async function configSetCommand(key: string, value: string): Promise<void> {
|
|
41
|
+
const config = await loadConfig();
|
|
42
|
+
|
|
43
|
+
// Parse booleans and numbers
|
|
44
|
+
let parsed: unknown = value;
|
|
45
|
+
if (value === 'true') parsed = true;
|
|
46
|
+
else if (value === 'false') parsed = false;
|
|
47
|
+
else if (!isNaN(Number(value)) && value.trim() !== '') parsed = Number(value);
|
|
48
|
+
|
|
49
|
+
(config as unknown as Record<string, unknown>)[key] = parsed;
|
|
50
|
+
await saveConfig(config);
|
|
51
|
+
console.log(` ā Set ${key} = ${String(parsed)}`);
|
|
52
|
+
}
|
package/src/commands/create.ts
CHANGED
|
@@ -14,7 +14,6 @@ import { confirm } from '@inquirer/prompts';
|
|
|
14
14
|
import { loadConfig } from '../core/config.js';
|
|
15
15
|
import { scanForRepos } from '../core/scanner.js';
|
|
16
16
|
import { createWorkspace } from '../core/workspace.js';
|
|
17
|
-
import { packWorkspace } from '../core/packer.js';
|
|
18
17
|
import { generateContextFiles } from '../generators/index.js';
|
|
19
18
|
import { analyzeAllRepos } from '../analyzers/index.js';
|
|
20
19
|
import { detectAIAssistants } from '../utils/detect-ai.js';
|
|
@@ -27,6 +26,7 @@ import {
|
|
|
27
26
|
promptSelectEditor,
|
|
28
27
|
} from '../utils/prompts.js';
|
|
29
28
|
import type { Feature, WorkspaceContext } from '../types.js';
|
|
29
|
+
import { suggestWorkflow } from '../utils/workflow-advisor.js';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Executes the full "create workspace" flow:
|
|
@@ -86,6 +86,17 @@ export async function createCommand(): Promise<void> {
|
|
|
86
86
|
? await confirm({ message: 'Enable Local AI Co-processor in this workspace context?', default: true })
|
|
87
87
|
: false;
|
|
88
88
|
|
|
89
|
+
// āā 5.5. Suggest workflow strategy āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
90
|
+
const workflowSpinner = ora('Suggesting teamwork collaboration strategy...').start();
|
|
91
|
+
let teamworkInstructions = '';
|
|
92
|
+
try {
|
|
93
|
+
const suggestion = await suggestWorkflow(description, selectedRepos, config.localLlm);
|
|
94
|
+
teamworkInstructions = suggestion.customInstructions;
|
|
95
|
+
workflowSpinner.succeed(`Auto-selected strategy for ${chalk.bold(suggestion.difficulty)} difficulty task`);
|
|
96
|
+
} catch (err) {
|
|
97
|
+
workflowSpinner.fail('Failed to suggest teamwork strategy');
|
|
98
|
+
}
|
|
99
|
+
|
|
89
100
|
// āā 6. Create workspace āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
90
101
|
const workspacePath = path.join(config.workspacesDir, branchName);
|
|
91
102
|
const feature: Feature = {
|
|
@@ -98,6 +109,7 @@ export async function createCommand(): Promise<void> {
|
|
|
98
109
|
workspacePath,
|
|
99
110
|
createdAt: new Date().toISOString(),
|
|
100
111
|
localLlmEnabled,
|
|
112
|
+
teamworkInstructions,
|
|
101
113
|
};
|
|
102
114
|
|
|
103
115
|
const wsSpinner = ora('Creating workspace with git worktrees...').start();
|
|
@@ -124,22 +136,7 @@ export async function createCommand(): Promise<void> {
|
|
|
124
136
|
console.log(chalk.cyan('\nGenerating AI context files...'));
|
|
125
137
|
await generateContextFiles(ctx, selectedAI, workspacePath);
|
|
126
138
|
|
|
127
|
-
//
|
|
128
|
-
if (config.packContextXml) {
|
|
129
|
-
const packSpinner = ora('Packing codebase context with Repomix...').start();
|
|
130
|
-
try {
|
|
131
|
-
const packResult = await packWorkspace(workspacePath);
|
|
132
|
-
const filesCount = packResult.outputPaths?.length || 1;
|
|
133
|
-
packSpinner.succeed(
|
|
134
|
-
`Packed codebase context into ${filesCount} file(s) (${packResult.totalFiles} files total, ${(packResult.fileSize / 1024).toFixed(2)} KB)`
|
|
135
|
-
);
|
|
136
|
-
} catch (error) {
|
|
137
|
-
packSpinner.fail('Failed to pack codebase context');
|
|
138
|
-
console.error(chalk.red(` ${error}`));
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
141
|
-
console.log(chalk.gray('\n ā Skipping codebase context packing (packContextXml is disabled)'));
|
|
142
|
-
}
|
|
139
|
+
// Monolithic XML context packing removed.
|
|
143
140
|
|
|
144
141
|
// āā 8. Open in editor āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
145
142
|
const detectedEditors = await detectEditors();
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module commands/desktop
|
|
3
|
+
* Launches the NexusFlow desktop application (Neutralinojs).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { spawn } from 'node:child_process';
|
|
7
|
+
import { existsSync } from 'node:fs';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Resolves the workspace root directory.
|
|
14
|
+
*
|
|
15
|
+
* Assumes the standard NexusFlow workspace layout where the `desktop/`
|
|
16
|
+
* project is a sibling of the `NexusFlow/` project under the same
|
|
17
|
+
* workspace root:
|
|
18
|
+
*
|
|
19
|
+
* <workspace-root>/
|
|
20
|
+
* NexusFlow/ ā this CLI project
|
|
21
|
+
* desktop/ ā Neutralinojs desktop app
|
|
22
|
+
* dist/nexusflow-desktop/<platform-binary>
|
|
23
|
+
*
|
|
24
|
+
* At runtime this file is compiled to `NexusFlow/dist/commands/desktop.js`,
|
|
25
|
+
* so the workspace root is three levels up.
|
|
26
|
+
*/
|
|
27
|
+
function resolveWorkspaceRoot(): string {
|
|
28
|
+
const thisDir = path.dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
return path.resolve(thisDir, '..', '..', '..');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Returns the desktop dist directory path.
|
|
34
|
+
*/
|
|
35
|
+
function getDesktopDistDir(): string {
|
|
36
|
+
return path.join(resolveWorkspaceRoot(), 'desktop', 'dist', 'nexusflow-desktop');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Resolves the platform-specific binary path for the desktop app.
|
|
41
|
+
*
|
|
42
|
+
* On macOS the architecture is taken into account:
|
|
43
|
+
* - arm64 ā `nexusflow-desktop-mac_arm64`
|
|
44
|
+
* - x64 ā prefers `nexusflow-desktop-mac_x64`, falls back to universal
|
|
45
|
+
*/
|
|
46
|
+
function findDesktopBinary(): string | null {
|
|
47
|
+
const desktopDistDir = getDesktopDistDir();
|
|
48
|
+
const platform = process.platform;
|
|
49
|
+
const arch = process.arch;
|
|
50
|
+
let binaryName: string;
|
|
51
|
+
|
|
52
|
+
if (platform === 'win32') {
|
|
53
|
+
binaryName = 'nexusflow-desktop-win_x64.exe';
|
|
54
|
+
} else if (platform === 'darwin') {
|
|
55
|
+
if (arch === 'arm64') {
|
|
56
|
+
binaryName = 'nexusflow-desktop-mac_arm64';
|
|
57
|
+
} else {
|
|
58
|
+
// Prefer smaller x64 binary, fall back to universal
|
|
59
|
+
const x64Path = path.join(desktopDistDir, 'nexusflow-desktop-mac_x64');
|
|
60
|
+
binaryName = existsSync(x64Path) ? 'nexusflow-desktop-mac_x64' : 'nexusflow-desktop-mac_universal';
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
// Linux ā detect ARM architectures
|
|
64
|
+
if (arch === 'arm64') {
|
|
65
|
+
binaryName = 'nexusflow-desktop-linux_arm64';
|
|
66
|
+
} else if (arch === 'arm') {
|
|
67
|
+
binaryName = 'nexusflow-desktop-linux_armhf';
|
|
68
|
+
} else {
|
|
69
|
+
binaryName = 'nexusflow-desktop-linux_x64';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const fullPath = path.join(desktopDistDir, binaryName);
|
|
74
|
+
return existsSync(fullPath) ? fullPath : null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns the expected binary path for display in the "not found" message.
|
|
79
|
+
*/
|
|
80
|
+
function getExpectedBinaryPath(): string {
|
|
81
|
+
const desktopDistDir = getDesktopDistDir();
|
|
82
|
+
switch (process.platform) {
|
|
83
|
+
case 'win32':
|
|
84
|
+
return path.join(desktopDistDir, 'nexusflow-desktop-win_x64.exe');
|
|
85
|
+
case 'darwin':
|
|
86
|
+
return path.join(desktopDistDir, 'nexusflow-desktop-mac_*');
|
|
87
|
+
case 'linux':
|
|
88
|
+
default:
|
|
89
|
+
return path.join(desktopDistDir, 'nexusflow-desktop-linux_x64');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Launches the NexusFlow desktop application.
|
|
95
|
+
*
|
|
96
|
+
* Spawns the process detached and unrefs it so the CLI exits immediately
|
|
97
|
+
* while the desktop app keeps running.
|
|
98
|
+
*/
|
|
99
|
+
export async function desktopCommand(): Promise<void> {
|
|
100
|
+
console.log(chalk.bold.cyan('\nš„ļø NexusFlow ā Desktop App\n'));
|
|
101
|
+
|
|
102
|
+
const binaryPath = findDesktopBinary();
|
|
103
|
+
|
|
104
|
+
if (!binaryPath) {
|
|
105
|
+
const expectedPath = getExpectedBinaryPath();
|
|
106
|
+
console.log(chalk.yellow('Desktop binary not found at:'));
|
|
107
|
+
console.log(chalk.dim(` ${expectedPath}\n`));
|
|
108
|
+
console.log(chalk.white('To build it, run:\n'));
|
|
109
|
+
console.log(chalk.green(' cd desktop && npm install && npm run build\n'));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
console.log(chalk.dim(`Launching ${path.basename(binaryPath)}ā¦`));
|
|
114
|
+
|
|
115
|
+
const child = spawn(binaryPath, [], {
|
|
116
|
+
detached: true,
|
|
117
|
+
stdio: 'ignore',
|
|
118
|
+
cwd: path.dirname(binaryPath), // Required: Neutralino looks for resources.neu in cwd
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
child.on('error', (err) => {
|
|
122
|
+
console.error(chalk.red(` ā Desktop app process error: ${err.message}`));
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
child.unref();
|
|
126
|
+
|
|
127
|
+
console.log(chalk.green('Desktop app launched successfully.\n'));
|
|
128
|
+
}
|
package/src/commands/doctor.ts
CHANGED
|
@@ -211,6 +211,19 @@ export async function doctorCommand(workspaceArg?: string): Promise<void> {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
// Check .code-workspace file exists (required for VS Code SCM to discover worktrees)
|
|
215
|
+
const workspaceName = path.basename(workspacePath);
|
|
216
|
+
const codeWorkspacePath = path.join(workspacePath, `${workspaceName}.code-workspace`);
|
|
217
|
+
try {
|
|
218
|
+
await fs.access(codeWorkspacePath);
|
|
219
|
+
console.log(` ${chalk.green('ā')} ${workspaceName}.code-workspace exists`);
|
|
220
|
+
} catch {
|
|
221
|
+
warnings.push(
|
|
222
|
+
`Missing ${workspaceName}.code-workspace. VS Code SCM will not show changes inside repo sub-folders. Run \`nexusflow refresh\` to regenerate it.`
|
|
223
|
+
);
|
|
224
|
+
console.log(` ${chalk.yellow('ā ')} ${workspaceName}.code-workspace is missing`);
|
|
225
|
+
}
|
|
226
|
+
|
|
214
227
|
// Check VS Code Settings for search.useIgnoreFiles: false
|
|
215
228
|
const vscodeSettingsPath = path.join(workspacePath, '.vscode', 'settings.json');
|
|
216
229
|
try {
|
package/src/commands/mcp.ts
CHANGED
package/src/commands/refresh.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { WorkspaceContext } from '../types.js';
|
|
|
18
18
|
* @param workspaceArg - Optional workspace path.
|
|
19
19
|
*/
|
|
20
20
|
export async function refreshCommand(
|
|
21
|
-
options: { repo?: string },
|
|
21
|
+
options: { repo?: string; base?: boolean },
|
|
22
22
|
workspaceArg?: string,
|
|
23
23
|
): Promise<void> {
|
|
24
24
|
console.log(chalk.bold.cyan('\nš NexusFlow ā Refresh Workspace Context\n'));
|
|
@@ -66,19 +66,9 @@ export async function refreshCommand(
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
console.log(chalk.cyan('Regenerating context files and maps...'));
|
|
69
|
-
await generateContextFiles(ctx, feature.assistants, workspacePath, onlyRepo);
|
|
69
|
+
await generateContextFiles(ctx, feature.assistants, workspacePath, onlyRepo, options.base);
|
|
70
|
+
|
|
70
71
|
|
|
71
|
-
// If repopack context packing is enabled
|
|
72
|
-
const config = await loadConfig();
|
|
73
|
-
if (config.packContextXml) {
|
|
74
|
-
const { packWorkspace } = await import('../core/packer.js');
|
|
75
|
-
console.log(chalk.cyan('Re-packing workspace context...'));
|
|
76
|
-
try {
|
|
77
|
-
await packWorkspace(workspacePath);
|
|
78
|
-
} catch (error) {
|
|
79
|
-
console.warn(chalk.yellow(` ā Failed to repack context: ${error}`));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
72
|
|
|
83
73
|
// If handoff file exists, refresh it automatically too!
|
|
84
74
|
const handoffPath = path.join(workspacePath, 'nexusflow-handoff.md');
|
|
@@ -88,7 +78,7 @@ export async function refreshCommand(
|
|
|
88
78
|
hasHandoff = true;
|
|
89
79
|
} catch {}
|
|
90
80
|
|
|
91
|
-
if (hasHandoff) {
|
|
81
|
+
if (!options.base && hasHandoff) {
|
|
92
82
|
console.log(chalk.cyan('Refreshing handoff bundle...'));
|
|
93
83
|
try {
|
|
94
84
|
const { handoffCommand } = await import('./handoff.js');
|