wiggum-cli 0.9.8 → 0.10.0
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/dist/commands/init.d.ts +8 -19
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -351
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/new.d.ts +21 -13
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +10 -267
- package/dist/commands/new.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -85
- package/dist/index.js.map +1 -1
- package/dist/repl/index.d.ts +3 -3
- package/dist/repl/index.d.ts.map +1 -1
- package/dist/repl/index.js +3 -3
- package/dist/repl/index.js.map +1 -1
- package/dist/tui/app.d.ts +1 -5
- package/dist/tui/app.d.ts.map +1 -1
- package/dist/tui/app.js +7 -12
- package/dist/tui/app.js.map +1 -1
- package/dist/tui/components/Confirm.d.ts +39 -0
- package/dist/tui/components/Confirm.d.ts.map +1 -0
- package/dist/tui/components/Confirm.js +60 -0
- package/dist/tui/components/Confirm.js.map +1 -0
- package/dist/tui/components/PasswordInput.d.ts +39 -0
- package/dist/tui/components/PasswordInput.d.ts.map +1 -0
- package/dist/tui/components/PasswordInput.js +56 -0
- package/dist/tui/components/PasswordInput.js.map +1 -0
- package/dist/tui/components/Select.d.ts +55 -0
- package/dist/tui/components/Select.d.ts.map +1 -0
- package/dist/tui/components/Select.js +63 -0
- package/dist/tui/components/Select.js.map +1 -0
- package/dist/tui/components/index.d.ts +6 -0
- package/dist/tui/components/index.d.ts.map +1 -1
- package/dist/tui/components/index.js +3 -0
- package/dist/tui/components/index.js.map +1 -1
- package/dist/tui/hooks/index.d.ts +3 -0
- package/dist/tui/hooks/index.d.ts.map +1 -1
- package/dist/tui/hooks/index.js +2 -0
- package/dist/tui/hooks/index.js.map +1 -1
- package/dist/tui/hooks/useInit.d.ts +130 -0
- package/dist/tui/hooks/useInit.d.ts.map +1 -0
- package/dist/tui/hooks/useInit.js +326 -0
- package/dist/tui/hooks/useInit.js.map +1 -0
- package/dist/tui/hooks/useSpecGenerator.d.ts +4 -0
- package/dist/tui/hooks/useSpecGenerator.d.ts.map +1 -1
- package/dist/tui/hooks/useSpecGenerator.js +12 -1
- package/dist/tui/hooks/useSpecGenerator.js.map +1 -1
- package/dist/tui/screens/InitScreen.d.ts +17 -10
- package/dist/tui/screens/InitScreen.d.ts.map +1 -1
- package/dist/tui/screens/InitScreen.js +317 -18
- package/dist/tui/screens/InitScreen.js.map +1 -1
- package/dist/tui/screens/InterviewScreen.d.ts.map +1 -1
- package/dist/tui/screens/InterviewScreen.js +2 -2
- package/dist/tui/screens/InterviewScreen.js.map +1 -1
- package/dist/tui/screens/index.d.ts +6 -0
- package/dist/tui/screens/index.d.ts.map +1 -1
- package/dist/tui/screens/index.js +3 -0
- package/dist/tui/screens/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/init.ts +8 -432
- package/src/commands/new.ts +13 -319
- package/src/index.ts +85 -93
- package/src/repl/index.ts +3 -3
- package/src/tui/app.tsx +7 -15
- package/src/tui/components/Confirm.tsx +109 -0
- package/src/tui/components/PasswordInput.tsx +106 -0
- package/src/tui/components/Select.tsx +132 -0
- package/src/tui/components/index.ts +9 -0
- package/src/tui/hooks/index.ts +9 -0
- package/src/tui/hooks/useInit.ts +472 -0
- package/src/tui/hooks/useSpecGenerator.ts +17 -1
- package/src/tui/screens/InitScreen.tsx +562 -29
- package/src/tui/screens/InterviewScreen.tsx +2 -1
- package/src/tui/screens/index.ts +9 -0
- package/src/cli.ts +0 -274
- package/src/repl/repl-loop.ts +0 -389
- package/src/utils/repl-prompts.ts +0 -381
package/dist/commands/new.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* New Command
|
|
3
|
-
*
|
|
2
|
+
* New Command Types
|
|
3
|
+
*
|
|
4
|
+
* The new/interview workflow is now handled by the TUI (InterviewScreen.tsx).
|
|
5
|
+
* This file provides type exports and utility functions.
|
|
4
6
|
*/
|
|
5
|
-
import { existsSync
|
|
7
|
+
import { existsSync } from 'node:fs';
|
|
6
8
|
import { join, dirname } from 'node:path';
|
|
7
9
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import {
|
|
9
|
-
import { logger } from '../utils/logger.js';
|
|
10
|
-
import { loadConfigWithDefaults, hasConfig } from '../utils/config.js';
|
|
11
|
-
import { getAvailableProvider, AVAILABLE_MODELS } from '../ai/providers.js';
|
|
12
|
-
import { SpecGenerator } from '../ai/conversation/index.js';
|
|
13
|
-
import { Scanner } from '../scanner/index.js';
|
|
14
|
-
import { flushTracing, traced, initTracing } from '../utils/tracing.js';
|
|
15
|
-
import pc from 'picocolors';
|
|
16
|
-
import * as prompts from '@clack/prompts';
|
|
17
|
-
import { renderApp } from '../tui/app.js';
|
|
18
|
-
import { createSessionState } from '../repl/session-state.js';
|
|
10
|
+
import { loadConfigWithDefaults } from '../utils/config.js';
|
|
19
11
|
/**
|
|
20
12
|
* Default spec template content
|
|
21
13
|
*/
|
|
22
|
-
const DEFAULT_SPEC_TEMPLATE = `# {{feature}} Feature Specification
|
|
14
|
+
export const DEFAULT_SPEC_TEMPLATE = `# {{feature}} Feature Specification
|
|
23
15
|
|
|
24
16
|
**Status:** Planned
|
|
25
17
|
**Version:** 1.0
|
|
@@ -89,18 +81,10 @@ Describe what this feature does and why it's needed.
|
|
|
89
81
|
- [ ] Question 1 - Decision needed
|
|
90
82
|
- [ ] Question 2 - Clarification required
|
|
91
83
|
`;
|
|
92
|
-
/**
|
|
93
|
-
* Get default model for a provider
|
|
94
|
-
*/
|
|
95
|
-
function getDefaultModelForProvider(provider) {
|
|
96
|
-
const models = AVAILABLE_MODELS[provider];
|
|
97
|
-
const recommended = models.find(m => m.hint?.includes('recommended'));
|
|
98
|
-
return recommended?.value || models[0].value;
|
|
99
|
-
}
|
|
100
84
|
/**
|
|
101
85
|
* Find the _example.md template
|
|
102
86
|
*/
|
|
103
|
-
async function findExampleTemplate(projectRoot) {
|
|
87
|
+
export async function findExampleTemplate(projectRoot) {
|
|
104
88
|
const config = await loadConfigWithDefaults(projectRoot);
|
|
105
89
|
const specsDir = config.paths.specs;
|
|
106
90
|
// Check multiple locations
|
|
@@ -119,16 +103,15 @@ async function findExampleTemplate(projectRoot) {
|
|
|
119
103
|
/**
|
|
120
104
|
* Get template directory from the package
|
|
121
105
|
*/
|
|
122
|
-
function getPackageTemplateDir() {
|
|
106
|
+
export function getPackageTemplateDir() {
|
|
123
107
|
const __filename = fileURLToPath(import.meta.url);
|
|
124
108
|
const __dirname = dirname(__filename);
|
|
125
|
-
// Go up from commands/ to src/ or dist/, then to templates/
|
|
126
109
|
return join(__dirname, '..', 'templates', 'specs');
|
|
127
110
|
}
|
|
128
111
|
/**
|
|
129
112
|
* Process template variables
|
|
130
113
|
*/
|
|
131
|
-
function processTemplate(template, feature) {
|
|
114
|
+
export function processTemplate(template, feature) {
|
|
132
115
|
const date = new Date().toISOString().split('T')[0];
|
|
133
116
|
const featureTitle = feature
|
|
134
117
|
.split('-')
|
|
@@ -140,244 +123,4 @@ function processTemplate(template, feature) {
|
|
|
140
123
|
.replace(/\{\{date\}\}/g, date)
|
|
141
124
|
.replace(/YYYY-MM-DD/g, date);
|
|
142
125
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Open file in editor
|
|
145
|
-
*/
|
|
146
|
-
function openInEditor(filePath, editor) {
|
|
147
|
-
const editorCmd = editor || process.env.EDITOR || 'code';
|
|
148
|
-
logger.info(`Opening in editor: ${editorCmd}`);
|
|
149
|
-
const child = spawn(editorCmd, [filePath], {
|
|
150
|
-
detached: true,
|
|
151
|
-
stdio: 'ignore',
|
|
152
|
-
});
|
|
153
|
-
child.unref();
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Create a new feature specification
|
|
157
|
-
*/
|
|
158
|
-
export async function newCommand(feature, options = {}) {
|
|
159
|
-
const projectRoot = process.cwd();
|
|
160
|
-
// Validate feature name
|
|
161
|
-
if (!feature || typeof feature !== 'string') {
|
|
162
|
-
logger.error('Feature name is required');
|
|
163
|
-
process.exit(1);
|
|
164
|
-
}
|
|
165
|
-
// Sanitize feature name (allow alphanumeric, hyphens, underscores)
|
|
166
|
-
if (!/^[a-zA-Z0-9_-]+$/.test(feature)) {
|
|
167
|
-
logger.error('Feature name must contain only letters, numbers, hyphens, and underscores');
|
|
168
|
-
logger.info('Example: wiggum new my-feature or wiggum new user_auth');
|
|
169
|
-
process.exit(1);
|
|
170
|
-
}
|
|
171
|
-
// Check for reserved names
|
|
172
|
-
const reservedNames = ['_example', '_template', 'config', 'ralph'];
|
|
173
|
-
if (reservedNames.includes(feature.toLowerCase())) {
|
|
174
|
-
logger.error(`"${feature}" is a reserved name. Please choose a different feature name.`);
|
|
175
|
-
process.exit(1);
|
|
176
|
-
}
|
|
177
|
-
logger.info(`Creating new feature spec: ${pc.bold(feature)}`);
|
|
178
|
-
console.log('');
|
|
179
|
-
// Check for config
|
|
180
|
-
if (!hasConfig(projectRoot)) {
|
|
181
|
-
logger.warn('No ralph.config.cjs found. Run "wiggum init" first to configure your project.');
|
|
182
|
-
logger.info('Using default paths...');
|
|
183
|
-
console.log('');
|
|
184
|
-
}
|
|
185
|
-
// Load config
|
|
186
|
-
const config = await loadConfigWithDefaults(projectRoot);
|
|
187
|
-
const specsDir = join(projectRoot, config.paths.specs);
|
|
188
|
-
// Create specs directory if it doesn't exist
|
|
189
|
-
if (!existsSync(specsDir)) {
|
|
190
|
-
logger.info(`Creating specs directory: ${specsDir}`);
|
|
191
|
-
mkdirSync(specsDir, { recursive: true });
|
|
192
|
-
}
|
|
193
|
-
// Check if spec already exists
|
|
194
|
-
const specPath = join(specsDir, `${feature}.md`);
|
|
195
|
-
if (existsSync(specPath)) {
|
|
196
|
-
if (!options.force) {
|
|
197
|
-
logger.error(`Spec file already exists: ${specPath}`);
|
|
198
|
-
if (!options.yes) {
|
|
199
|
-
const shouldOverwrite = await prompts.confirm({
|
|
200
|
-
message: 'Do you want to overwrite the existing spec?',
|
|
201
|
-
initialValue: false,
|
|
202
|
-
});
|
|
203
|
-
if (prompts.isCancel(shouldOverwrite) || !shouldOverwrite) {
|
|
204
|
-
logger.info('Cancelled');
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
logger.info('Use --force to overwrite');
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
logger.warn('Overwriting existing spec file');
|
|
214
|
-
}
|
|
215
|
-
// Determine if we should use AI generation
|
|
216
|
-
const provider = options.provider || getAvailableProvider();
|
|
217
|
-
const useAi = options.ai && provider !== null;
|
|
218
|
-
let specContent;
|
|
219
|
-
if (useAi && provider) {
|
|
220
|
-
// Use AI-powered spec generation
|
|
221
|
-
const model = options.model || getDefaultModelForProvider(provider);
|
|
222
|
-
logger.info(`Using AI spec generation (${provider}/${model})`);
|
|
223
|
-
// Get or perform scan
|
|
224
|
-
let scanResult = options.scanResult;
|
|
225
|
-
if (!scanResult) {
|
|
226
|
-
const scanner = new Scanner();
|
|
227
|
-
scanResult = await scanner.scan(projectRoot);
|
|
228
|
-
}
|
|
229
|
-
// Check if TUI mode is requested
|
|
230
|
-
if (options.tui) {
|
|
231
|
-
// Use Ink TUI for interview
|
|
232
|
-
logger.info('Starting interactive TUI mode...');
|
|
233
|
-
console.log('');
|
|
234
|
-
// Create session state for TUI
|
|
235
|
-
const sessionState = createSessionState(projectRoot, provider, model, scanResult, config, true // initialized
|
|
236
|
-
);
|
|
237
|
-
// Wrap in a promise to get the generated spec
|
|
238
|
-
const generatedSpec = await new Promise((resolve) => {
|
|
239
|
-
const instance = renderApp({
|
|
240
|
-
screen: 'interview',
|
|
241
|
-
initialSessionState: sessionState,
|
|
242
|
-
interviewProps: {
|
|
243
|
-
featureName: feature,
|
|
244
|
-
projectRoot,
|
|
245
|
-
provider,
|
|
246
|
-
model,
|
|
247
|
-
scanResult,
|
|
248
|
-
},
|
|
249
|
-
onComplete: (spec) => {
|
|
250
|
-
instance.unmount();
|
|
251
|
-
resolve(spec);
|
|
252
|
-
},
|
|
253
|
-
onExit: () => {
|
|
254
|
-
instance.unmount();
|
|
255
|
-
resolve(null);
|
|
256
|
-
},
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
if (!generatedSpec) {
|
|
260
|
-
logger.info('Spec generation cancelled');
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
specContent = generatedSpec;
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
// Use readline-based SpecGenerator
|
|
267
|
-
const specGenerator = new SpecGenerator({
|
|
268
|
-
featureName: feature,
|
|
269
|
-
projectRoot,
|
|
270
|
-
provider,
|
|
271
|
-
model,
|
|
272
|
-
scanResult,
|
|
273
|
-
});
|
|
274
|
-
// Initialize tracing BEFORE creating parent span (ensures logger is ready)
|
|
275
|
-
initTracing();
|
|
276
|
-
const generatedSpec = await traced(async () => {
|
|
277
|
-
// All AI calls inside run() automatically become child spans
|
|
278
|
-
return await specGenerator.run();
|
|
279
|
-
}, {
|
|
280
|
-
name: `generate-spec-${feature}`,
|
|
281
|
-
type: 'task',
|
|
282
|
-
});
|
|
283
|
-
// Flush any pending Braintrust tracing spans
|
|
284
|
-
await flushTracing();
|
|
285
|
-
if (!generatedSpec) {
|
|
286
|
-
logger.info('Spec generation cancelled');
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
specContent = generatedSpec;
|
|
290
|
-
}
|
|
291
|
-
// Confirm saving (unless --yes)
|
|
292
|
-
if (!options.yes) {
|
|
293
|
-
console.log('');
|
|
294
|
-
const shouldSave = await prompts.confirm({
|
|
295
|
-
message: `Save spec to ${specPath}?`,
|
|
296
|
-
initialValue: true,
|
|
297
|
-
});
|
|
298
|
-
if (prompts.isCancel(shouldSave) || !shouldSave) {
|
|
299
|
-
logger.info('Spec not saved');
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
// Use template-based generation
|
|
306
|
-
if (options.ai && !provider) {
|
|
307
|
-
logger.warn('No API key found. Falling back to template mode.');
|
|
308
|
-
logger.info('Set ANTHROPIC_API_KEY, OPENAI_API_KEY, or OPENROUTER_API_KEY for AI generation.');
|
|
309
|
-
console.log('');
|
|
310
|
-
}
|
|
311
|
-
// Find or use default template
|
|
312
|
-
let templateContent;
|
|
313
|
-
// Try to find _example.md template
|
|
314
|
-
const exampleTemplate = await findExampleTemplate(projectRoot);
|
|
315
|
-
if (exampleTemplate) {
|
|
316
|
-
logger.info(`Using template: ${exampleTemplate}`);
|
|
317
|
-
templateContent = readFileSync(exampleTemplate, 'utf-8');
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
// Try package template
|
|
321
|
-
const packageTemplateDir = getPackageTemplateDir();
|
|
322
|
-
const packageTemplate = join(packageTemplateDir, '_example.md.tmpl');
|
|
323
|
-
if (existsSync(packageTemplate)) {
|
|
324
|
-
logger.info(`Using package template`);
|
|
325
|
-
templateContent = readFileSync(packageTemplate, 'utf-8');
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
// Use default template
|
|
329
|
-
logger.info('Using default template');
|
|
330
|
-
templateContent = DEFAULT_SPEC_TEMPLATE;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
// Process template
|
|
334
|
-
specContent = processTemplate(templateContent, feature);
|
|
335
|
-
// Confirm with user (unless --yes)
|
|
336
|
-
if (!options.yes) {
|
|
337
|
-
console.log('');
|
|
338
|
-
console.log(pc.cyan('--- Spec Preview ---'));
|
|
339
|
-
console.log(`File: ${specPath}`);
|
|
340
|
-
console.log('');
|
|
341
|
-
// Show first few lines of the processed template
|
|
342
|
-
const previewLines = specContent.split('\n').slice(0, 15);
|
|
343
|
-
console.log(pc.dim(previewLines.join('\n')));
|
|
344
|
-
if (specContent.split('\n').length > 15) {
|
|
345
|
-
console.log(pc.dim('...'));
|
|
346
|
-
}
|
|
347
|
-
console.log('');
|
|
348
|
-
const shouldCreate = await prompts.confirm({
|
|
349
|
-
message: 'Create this spec file?',
|
|
350
|
-
initialValue: true,
|
|
351
|
-
});
|
|
352
|
-
if (prompts.isCancel(shouldCreate) || !shouldCreate) {
|
|
353
|
-
logger.info('Cancelled');
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
// Write the spec file
|
|
359
|
-
try {
|
|
360
|
-
writeFileSync(specPath, specContent, 'utf-8');
|
|
361
|
-
logger.success(`Created spec: ${specPath}`);
|
|
362
|
-
}
|
|
363
|
-
catch (error) {
|
|
364
|
-
logger.error(`Failed to create spec: ${error instanceof Error ? error.message : String(error)}`);
|
|
365
|
-
process.exit(1);
|
|
366
|
-
}
|
|
367
|
-
// Open in editor if requested
|
|
368
|
-
if (options.edit) {
|
|
369
|
-
try {
|
|
370
|
-
openInEditor(specPath, options.editor);
|
|
371
|
-
}
|
|
372
|
-
catch (error) {
|
|
373
|
-
logger.warn(`Could not open editor: ${error instanceof Error ? error.message : String(error)}`);
|
|
374
|
-
logger.info(`Manually open: ${specPath}`);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
// Display next steps
|
|
378
|
-
console.log('');
|
|
379
|
-
console.log('Next steps:');
|
|
380
|
-
console.log(` 1. Edit the spec: ${pc.cyan(`$EDITOR ${specPath}`)}`);
|
|
381
|
-
console.log(` 2. When ready, run: ${pc.cyan(`wiggum run ${feature}`)}`);
|
|
382
|
-
}
|
|
383
126
|
//# sourceMappingURL=new.js.map
|
package/dist/commands/new.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,E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AU,eAAe,CAAC,QAAgB,EAAE,OAAe;IAC/D,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,YAAY,GAAG,OAAO;SACzB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,QAAQ;SACZ,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC;SACpC,OAAO,CAAC,uBAAuB,EAAE,YAAY,CAAC;SAC9C,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;SAC9B,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main entry point for the Wiggum CLI
|
|
3
|
-
* TUI-first:
|
|
3
|
+
* TUI-first: routes args to appropriate TUI screens
|
|
4
4
|
*/
|
|
5
5
|
export declare function main(): Promise<void>;
|
|
6
|
-
export { createCli } from './cli.js';
|
|
7
6
|
export { displayHeader } from './utils/header.js';
|
|
8
7
|
export { logger } from './utils/logger.js';
|
|
9
8
|
export { Scanner, scanProject, formatScanResult } from './scanner/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsGA;;;GAGG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA8D1C;AAGD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,YAAY,EACV,eAAe,EACf,aAAa,EACb,UAAU,EACV,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createSessionState } from './repl/index.js';
|
|
1
|
+
import { createSessionState } from './repl/session-state.js';
|
|
3
2
|
import { hasConfig, loadConfigWithDefaults } from './utils/config.js';
|
|
4
3
|
import { AVAILABLE_MODELS, getAvailableProvider, isAnthropicAlias } from './ai/providers.js';
|
|
5
4
|
import { notifyIfUpdateAvailable } from './utils/update-check.js';
|
|
6
5
|
import { renderApp } from './tui/app.js';
|
|
7
|
-
import { runInitWorkflow } from './commands/init.js';
|
|
8
6
|
import { logger } from './utils/logger.js';
|
|
9
7
|
import { readFileSync } from 'fs';
|
|
10
8
|
import { fileURLToPath } from 'url';
|
|
@@ -26,26 +24,11 @@ function getVersion() {
|
|
|
26
24
|
}
|
|
27
25
|
/**
|
|
28
26
|
* Start Ink TUI mode
|
|
29
|
-
* Called when wiggum is invoked with no arguments
|
|
27
|
+
* Called when wiggum is invoked with no arguments or with screen-routing args
|
|
30
28
|
*/
|
|
31
|
-
async function startInkTui() {
|
|
29
|
+
async function startInkTui(initialScreen = 'welcome', interviewFeature) {
|
|
32
30
|
const projectRoot = process.cwd();
|
|
33
31
|
const version = getVersion();
|
|
34
|
-
// Track current Ink instance for init workflow
|
|
35
|
-
let instance = null;
|
|
36
|
-
let shouldRestart = false;
|
|
37
|
-
/**
|
|
38
|
-
* Ensure stdin is active for readline-based prompts after Ink unmount
|
|
39
|
-
*/
|
|
40
|
-
const resetStdinForReadline = () => {
|
|
41
|
-
if (process.stdin.isTTY) {
|
|
42
|
-
process.stdin.setRawMode(false);
|
|
43
|
-
}
|
|
44
|
-
process.stdin.resume();
|
|
45
|
-
if (typeof process.stdin.ref === 'function') {
|
|
46
|
-
process.stdin.ref();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
32
|
/**
|
|
50
33
|
* Create session state based on current project state
|
|
51
34
|
*/
|
|
@@ -73,84 +56,93 @@ async function startInkTui() {
|
|
|
73
56
|
model, undefined, // No scan result yet
|
|
74
57
|
config, isInitialized);
|
|
75
58
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// Wait for Ink to fully clean up stdin handlers
|
|
103
|
-
if (currentInstance?.waitUntilExit) {
|
|
104
|
-
await currentInstance.waitUntilExit();
|
|
105
|
-
}
|
|
106
|
-
// Reset stdin again after Ink cleanup
|
|
107
|
-
resetStdinForReadline();
|
|
108
|
-
// Clear screen for init workflow
|
|
109
|
-
console.clear();
|
|
110
|
-
try {
|
|
111
|
-
const result = await runInitWorkflow(projectRoot, {});
|
|
112
|
-
if (result) {
|
|
113
|
-
logger.success('Initialization complete!');
|
|
114
|
-
console.log('');
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
logger.info('Initialization cancelled');
|
|
118
|
-
console.log('');
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
logger.error(`Init failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
123
|
-
console.log('');
|
|
124
|
-
}
|
|
125
|
-
// Re-render TUI with updated state
|
|
126
|
-
shouldRestart = false;
|
|
127
|
-
await renderTui('shell');
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
await instance.waitUntilExit();
|
|
131
|
-
}
|
|
132
|
-
// Start with welcome screen
|
|
133
|
-
await renderTui('welcome');
|
|
59
|
+
const initialState = await createCurrentSessionState();
|
|
60
|
+
// Build interview props if starting on interview screen
|
|
61
|
+
const interviewProps = interviewFeature && initialState.provider
|
|
62
|
+
? {
|
|
63
|
+
featureName: interviewFeature,
|
|
64
|
+
projectRoot,
|
|
65
|
+
provider: initialState.provider,
|
|
66
|
+
model: initialState.model,
|
|
67
|
+
scanResult: initialState.scanResult,
|
|
68
|
+
}
|
|
69
|
+
: undefined;
|
|
70
|
+
const instance = renderApp({
|
|
71
|
+
screen: initialScreen,
|
|
72
|
+
initialSessionState: initialState,
|
|
73
|
+
version,
|
|
74
|
+
interviewProps,
|
|
75
|
+
onComplete: (specPath) => {
|
|
76
|
+
// Spec was saved to disk by app.tsx
|
|
77
|
+
logger.success(`Created spec: ${specPath}`);
|
|
78
|
+
},
|
|
79
|
+
onExit: () => {
|
|
80
|
+
instance.unmount();
|
|
81
|
+
process.exit(0);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
await instance.waitUntilExit();
|
|
134
85
|
}
|
|
135
86
|
/**
|
|
136
87
|
* Main entry point for the Wiggum CLI
|
|
137
|
-
* TUI-first:
|
|
88
|
+
* TUI-first: routes args to appropriate TUI screens
|
|
138
89
|
*/
|
|
139
90
|
export async function main() {
|
|
140
91
|
const args = process.argv.slice(2);
|
|
141
92
|
// Check for updates (non-blocking, fails silently)
|
|
142
93
|
await notifyIfUpdateAvailable();
|
|
143
|
-
//
|
|
94
|
+
// No args = start with welcome screen
|
|
144
95
|
if (args.length === 0) {
|
|
145
|
-
await startInkTui();
|
|
96
|
+
await startInkTui('welcome');
|
|
146
97
|
return;
|
|
147
98
|
}
|
|
148
|
-
//
|
|
149
|
-
const
|
|
150
|
-
|
|
99
|
+
// Route commands to TUI screens
|
|
100
|
+
const command = args[0];
|
|
101
|
+
switch (command) {
|
|
102
|
+
case 'init':
|
|
103
|
+
// Start TUI at init screen
|
|
104
|
+
await startInkTui('init');
|
|
105
|
+
break;
|
|
106
|
+
case 'new':
|
|
107
|
+
// Start TUI at interview screen with feature name
|
|
108
|
+
const featureName = args[1];
|
|
109
|
+
if (!featureName) {
|
|
110
|
+
logger.error('Feature name required. Usage: wiggum new <feature-name>');
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
await startInkTui('interview', featureName);
|
|
114
|
+
break;
|
|
115
|
+
case '--help':
|
|
116
|
+
case '-h':
|
|
117
|
+
// Show help
|
|
118
|
+
console.log(`
|
|
119
|
+
Wiggum CLI - AI-powered feature development assistant
|
|
120
|
+
|
|
121
|
+
Usage:
|
|
122
|
+
wiggum Start interactive TUI
|
|
123
|
+
wiggum init Initialize project (TUI)
|
|
124
|
+
wiggum new <name> Create new feature spec (TUI)
|
|
125
|
+
|
|
126
|
+
In the TUI:
|
|
127
|
+
/init Initialize or reconfigure project
|
|
128
|
+
/new <name> Create a new feature specification
|
|
129
|
+
/help Show available commands
|
|
130
|
+
/exit Exit the application
|
|
131
|
+
|
|
132
|
+
Press Esc to cancel any operation.
|
|
133
|
+
`);
|
|
134
|
+
return;
|
|
135
|
+
case '--version':
|
|
136
|
+
case '-v':
|
|
137
|
+
console.log(getVersion());
|
|
138
|
+
return;
|
|
139
|
+
default:
|
|
140
|
+
// Unknown command - start TUI at shell
|
|
141
|
+
logger.warn(`Unknown command: ${command}. Starting TUI...`);
|
|
142
|
+
await startInkTui('shell');
|
|
143
|
+
}
|
|
151
144
|
}
|
|
152
145
|
// Export for programmatic use
|
|
153
|
-
export { createCli } from './cli.js';
|
|
154
146
|
export { displayHeader } from './utils/header.js';
|
|
155
147
|
export { logger } from './utils/logger.js';
|
|
156
148
|
// Export scanner
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC;;GAEG;AACH,SAAS,UAAU;IACjB,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACtC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QAC1D,MAAM,GAAG,GA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ACT,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAU9B,6CAA6C;AAC7C,OAAO,EAAE,SAAS,EAAyC,MAAM,cAAc,CAAC"}
|
package/dist/repl/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* State and Command Parsing Module
|
|
3
|
+
* Shared utilities for session state and slash command parsing
|
|
4
|
+
* (Originally REPL module, now used by TUI)
|
|
4
5
|
*/
|
|
5
|
-
export { startRepl, processInput, executeCommand } from './repl-loop.js';
|
|
6
6
|
export { type SessionState, createSessionState, updateSessionState, } from './session-state.js';
|
|
7
7
|
export { type SlashCommand, type ParsedInput, type InputType, type ReplCommandName, parseInput, parseSlashCommand, isSlashCommand, resolveCommandAlias, formatHelpText, REPL_COMMANDS, } from './command-parser.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/repl/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC"}
|
package/dist/repl/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* State and Command Parsing Module
|
|
3
|
+
* Shared utilities for session state and slash command parsing
|
|
4
|
+
* (Originally REPL module, now used by TUI)
|
|
4
5
|
*/
|
|
5
|
-
export { startRepl, processInput, executeCommand } from './repl-loop.js';
|
|
6
6
|
export { createSessionState, updateSessionState, } from './session-state.js';
|
|
7
7
|
export { parseInput, parseSlashCommand, isSlashCommand, resolveCommandAlias, formatHelpText, REPL_COMMANDS, } from './command-parser.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/repl/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repl/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAKL,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC"}
|
package/dist/tui/app.d.ts
CHANGED
|
@@ -44,8 +44,6 @@ export interface AppProps {
|
|
|
44
44
|
onComplete?: (result: string) => void;
|
|
45
45
|
/** Called when the user exits/cancels */
|
|
46
46
|
onExit?: () => void;
|
|
47
|
-
/** Called when init workflow should run (outside of Ink) */
|
|
48
|
-
onRunInit?: () => void;
|
|
49
47
|
}
|
|
50
48
|
/**
|
|
51
49
|
* Main App component for the Ink-based TUI
|
|
@@ -63,7 +61,7 @@ export interface AppProps {
|
|
|
63
61
|
* });
|
|
64
62
|
* ```
|
|
65
63
|
*/
|
|
66
|
-
export declare function App({ screen: initialScreen, initialSessionState, version, interviewProps, onComplete, onExit,
|
|
64
|
+
export declare function App({ screen: initialScreen, initialSessionState, version, interviewProps, onComplete, onExit, }: AppProps): React.ReactElement | null;
|
|
67
65
|
/**
|
|
68
66
|
* Render options for renderApp
|
|
69
67
|
*/
|
|
@@ -80,8 +78,6 @@ export interface RenderAppOptions {
|
|
|
80
78
|
onComplete?: (result: string) => void;
|
|
81
79
|
/** Called when user exits */
|
|
82
80
|
onExit?: () => void;
|
|
83
|
-
/** Called when init workflow should run (outside of Ink) */
|
|
84
|
-
onRunInit?: () => void;
|
|
85
81
|
}
|
|
86
82
|
/**
|
|
87
83
|
* Render the App component to the terminal
|