@fission-ai/openspec 1.13.2 → 1.14.1
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/cli/commands/config.d.ts +8 -0
- package/dist/cli/commands/config.js +88 -0
- package/dist/cli/commands/context.d.ts +3 -0
- package/dist/cli/commands/context.js +20 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +18 -0
- package/dist/cli/commands/schema.d.ts +6 -0
- package/dist/cli/commands/schema.js +57 -0
- package/dist/cli/commands/spec.d.ts +3 -0
- package/dist/cli/commands/spec.js +42 -0
- package/dist/cli/commands/store.d.ts +3 -0
- package/dist/cli/commands/store.js +130 -0
- package/dist/cli/commands/workset.d.ts +3 -0
- package/dist/cli/commands/workset.js +96 -0
- package/dist/cli/index.js +106 -43
- package/dist/commands/config.d.ts +16 -7
- package/dist/commands/config.js +342 -395
- package/dist/commands/context.d.ts +8 -2
- package/dist/commands/context.js +22 -37
- package/dist/commands/doctor.d.ts +6 -7
- package/dist/commands/doctor.js +14 -27
- package/dist/commands/schema.d.ts +19 -5
- package/dist/commands/schema.js +662 -702
- package/dist/commands/spec.d.ts +13 -4
- package/dist/commands/spec.js +92 -120
- package/dist/commands/store.d.ts +27 -2
- package/dist/commands/store.js +1 -120
- package/dist/commands/workflow/default-schema.d.ts +2 -0
- package/dist/commands/workflow/default-schema.js +4 -0
- package/dist/commands/workflow/instructions.js +32 -12
- package/dist/commands/workflow/shared.d.ts +3 -1
- package/dist/commands/workflow/shared.js +1 -1
- package/dist/commands/workflow/status.js +15 -2
- package/dist/commands/workset.d.ts +22 -2
- package/dist/commands/workset.js +1 -88
- package/dist/core/archive.js +28 -7
- package/dist/core/artifact-graph/instruction-loader.d.ts +7 -0
- package/dist/core/artifact-graph/instruction-loader.js +18 -1
- package/dist/core/change-metadata/schema.d.ts +3 -0
- package/dist/core/change-metadata/schema.js +10 -0
- package/dist/core/change-status-policy.d.ts +8 -0
- package/dist/core/change-status-policy.js +33 -2
- package/dist/core/command-generation/adapters/atomcode.d.ts +24 -0
- package/dist/core/command-generation/adapters/atomcode.js +46 -0
- package/dist/core/command-generation/adapters/codestudio.d.ts +13 -0
- package/dist/core/command-generation/adapters/codestudio.js +27 -0
- package/dist/core/command-generation/adapters/easycode.d.ts +17 -0
- package/dist/core/command-generation/adapters/easycode.js +28 -0
- package/dist/core/command-generation/adapters/gemini.js +1 -35
- package/dist/core/command-generation/adapters/gigacode.d.ts +17 -0
- package/dist/core/command-generation/adapters/gigacode.js +31 -0
- package/dist/core/command-generation/adapters/index.d.ts +4 -0
- package/dist/core/command-generation/adapters/index.js +4 -0
- package/dist/core/command-generation/registry.js +8 -0
- package/dist/core/command-generation/toml.d.ts +19 -0
- package/dist/core/command-generation/toml.js +39 -0
- package/dist/core/command-surface.js +1 -1
- package/dist/core/completion-tip.js +3 -1
- package/dist/core/completions/command-registry.js +19 -0
- package/dist/core/completions/installers/zsh-installer.js +4 -2
- package/dist/core/config-prompts.js +6 -6
- package/dist/core/config-schema.d.ts +1 -1
- package/dist/core/config.js +11 -1
- package/dist/core/init.js +35 -11
- package/dist/core/legacy-cleanup.js +11 -7
- package/dist/core/list.d.ts +2 -0
- package/dist/core/list.js +49 -23
- package/dist/core/parsers/markdown-parser.js +5 -0
- package/dist/core/parsers/requirement-blocks.d.ts +6 -0
- package/dist/core/parsers/requirement-blocks.js +9 -2
- package/dist/core/project-config.js +45 -1
- package/dist/core/references.js +3 -1
- package/dist/core/root-selection.d.ts +6 -0
- package/dist/core/root-selection.js +16 -0
- package/dist/core/schemas/base.schema.d.ts +3 -0
- package/dist/core/schemas/base.schema.js +6 -0
- package/dist/core/schemas/change.schema.d.ts +8 -0
- package/dist/core/schemas/spec.schema.d.ts +2 -0
- package/dist/core/templates/workflows/apply-change.js +9 -5
- package/dist/core/templates/workflows/archive-change.js +26 -4
- package/dist/core/templates/workflows/bulk-archive-change.js +6 -2
- package/dist/core/templates/workflows/continue-change.js +17 -0
- package/dist/core/templates/workflows/verify-change.js +12 -12
- package/dist/core/validation/constants.d.ts +1 -1
- package/dist/core/validation/constants.js +1 -1
- package/dist/core/validation/validator.js +21 -2
- package/dist/core/version-check.d.ts +23 -1
- package/dist/core/version-check.js +112 -26
- package/dist/core/view.d.ts +2 -0
- package/dist/core/view.js +36 -2
- package/dist/utils/change-metadata.d.ts +20 -1
- package/dist/utils/change-metadata.js +57 -1
- package/dist/utils/command-references.d.ts +1 -1
- package/dist/utils/command-references.js +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/schemas/spec-driven/schema.yaml +29 -4
- package/schemas/spec-driven/templates/proposal.md +6 -3
package/dist/cli/index.js
CHANGED
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
import { asStatus } from '../commands/shared-output.js';
|
|
2
1
|
import { Command, Option } from 'commander';
|
|
3
2
|
import { createRequire } from 'module';
|
|
4
|
-
import ora from 'ora';
|
|
5
3
|
import path from 'path';
|
|
6
4
|
import { fileURLToPath } from 'url';
|
|
7
5
|
import { existsSync, promises as fs } from 'fs';
|
|
8
6
|
import { AI_TOOLS, TOOL_ID_ALIASES } from '../core/config.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { ValidateCommand } from '../commands/validate.js';
|
|
18
|
-
import { ShowCommand } from '../commands/show.js';
|
|
19
|
-
import { CompletionCommand } from '../commands/completion.js';
|
|
20
|
-
import { FeedbackCommand } from '../commands/feedback.js';
|
|
21
|
-
import { registerConfigCommand } from '../commands/config.js';
|
|
22
|
-
import { registerSchemaCommand } from '../commands/schema.js';
|
|
23
|
-
import { registerStoreCommand } from '../commands/store.js';
|
|
24
|
-
import { registerDoctorCommand } from '../commands/doctor.js';
|
|
25
|
-
import { registerContextCommand } from '../commands/context.js';
|
|
26
|
-
import { registerWorksetCommand } from '../commands/workset.js';
|
|
27
|
-
import { statusCommand, BATCH_STATUS_FAILURE_PAYLOAD, instructionsCommand, applyInstructionsCommand, archiveInstructionsCommand, templatesCommand, schemasCommand, newChangeCommand, DEFAULT_SCHEMA, } from '../commands/workflow/index.js';
|
|
28
|
-
import { maybeShowTelemetryNotice, trackCommand, shutdown } from '../telemetry/index.js';
|
|
29
|
-
import { maybeShowCompletionTip } from '../core/completion-tip.js';
|
|
7
|
+
import { registerSpecCommand } from './commands/spec.js';
|
|
8
|
+
import { registerConfigCommand } from './commands/config.js';
|
|
9
|
+
import { registerSchemaCommand } from './commands/schema.js';
|
|
10
|
+
import { registerStoreCommand } from './commands/store.js';
|
|
11
|
+
import { registerDoctorCommand } from './commands/doctor.js';
|
|
12
|
+
import { registerContextCommand } from './commands/context.js';
|
|
13
|
+
import { registerWorksetCommand } from './commands/workset.js';
|
|
14
|
+
import { DEFAULT_SCHEMA } from '../commands/workflow/default-schema.js';
|
|
30
15
|
import { COMMON_FLAGS } from '../core/completions/shared-flags.js';
|
|
31
|
-
|
|
16
|
+
// Startup cost: every command's implementation, and the packages it uses,
|
|
17
|
+
// loads with `await import()` inside its action. This module and
|
|
18
|
+
// ./commands/ only define commands (names, options, help), so `--version`,
|
|
19
|
+
// `--help`, and each command load no other command's implementation.
|
|
32
20
|
const STORE_OPTION_DESCRIPTION = COMMON_FLAGS.store.description;
|
|
33
21
|
// Deliberate rejection path: --store-path stays registered (hidden) so the
|
|
34
22
|
// resolver can explain that registering the path is the supported route,
|
|
@@ -37,14 +25,16 @@ const STORE_OPTION_DESCRIPTION = COMMON_FLAGS.store.description;
|
|
|
37
25
|
function hiddenStorePathOption() {
|
|
38
26
|
return new Option('--store-path <path>', 'Not supported; register the path with "openspec store register <path>" and use --store <id>').hideHelp();
|
|
39
27
|
}
|
|
40
|
-
function failWithError(error, json) {
|
|
28
|
+
async function failWithError(error, json) {
|
|
41
29
|
// The agent contract: every --json failure leaves exactly one JSON
|
|
42
30
|
// document on stdout (the command's null-shape plus a status array).
|
|
43
31
|
if (json?.enabled) {
|
|
32
|
+
const { asStatus } = await import('../commands/shared-output.js');
|
|
44
33
|
console.log(JSON.stringify({ ...(json.payload ?? {}), status: [asStatus(error, json.fallbackCode ?? 'command_error')] }, null, 2));
|
|
45
34
|
process.exitCode = 1;
|
|
46
35
|
return;
|
|
47
36
|
}
|
|
37
|
+
const { default: ora } = await import('ora');
|
|
48
38
|
ora().fail(`Error: ${error.message}`);
|
|
49
39
|
// Resolution and store errors carry a pasteable fix - never drop it.
|
|
50
40
|
const fix = error.diagnostic?.fix;
|
|
@@ -118,6 +108,38 @@ program
|
|
|
118
108
|
.version(version);
|
|
119
109
|
// Global options
|
|
120
110
|
program.option('--no-color', 'Disable color output');
|
|
111
|
+
program
|
|
112
|
+
.command('version')
|
|
113
|
+
.description('Report the installed OpenSpec version and update availability')
|
|
114
|
+
.option('--json', 'Output as JSON')
|
|
115
|
+
.option('--check', 'Check the registry for a newer version')
|
|
116
|
+
.action(async (options) => {
|
|
117
|
+
const { getCliInstallInfo, checkForCliUpdate, getCliUpdateCommand, canSelfUpgrade, buildVersionReportLines, } = await import('../core/version-check.js');
|
|
118
|
+
const install = getCliInstallInfo();
|
|
119
|
+
const update = options.check ? await checkForCliUpdate() : undefined;
|
|
120
|
+
const command = update?.status === 'available' ? getCliUpdateCommand(install) : null;
|
|
121
|
+
const output = {
|
|
122
|
+
schemaVersion: 1,
|
|
123
|
+
version,
|
|
124
|
+
install,
|
|
125
|
+
...(update
|
|
126
|
+
? {
|
|
127
|
+
update: {
|
|
128
|
+
...update,
|
|
129
|
+
command,
|
|
130
|
+
canSelfUpgrade: update.status === 'available'
|
|
131
|
+
? canSelfUpgrade(install.location, process.cwd())
|
|
132
|
+
: false,
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
: {}),
|
|
136
|
+
};
|
|
137
|
+
if (options.json) {
|
|
138
|
+
console.log(JSON.stringify(output, null, 2));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
console.log(buildVersionReportLines(version, install, update, command).join('\n'));
|
|
142
|
+
});
|
|
121
143
|
// Apply global flags and telemetry before any command runs
|
|
122
144
|
// Note: preAction receives (thisCommand, actionCommand) where:
|
|
123
145
|
// - thisCommand: the command where hook was added (root program)
|
|
@@ -130,6 +152,7 @@ program.hook('preAction', async (thisCommand, actionCommand) => {
|
|
|
130
152
|
// Show first-run telemetry notice (if not seen). It's written to stderr, so it
|
|
131
153
|
// never pollutes stdout — but --json runs still defer it (see isJsonRun) so the
|
|
132
154
|
// very first invocation stays free of any incidental output on either stream.
|
|
155
|
+
const { maybeShowTelemetryNotice, trackCommand } = await import('../telemetry/index.js');
|
|
133
156
|
await maybeShowTelemetryNotice({ silent: isJsonRun(actionCommand) });
|
|
134
157
|
// Track command execution (use actionCommand to get the actual subcommand)
|
|
135
158
|
const commandPath = getCommandPath(actionCommand);
|
|
@@ -144,6 +167,7 @@ program.hook('postAction', async (_thisCommand, actionCommand) => {
|
|
|
144
167
|
// `openspec completion ...`, and a stderr that is not a terminal (agents and
|
|
145
168
|
// pipes would otherwise silently burn the user's one-shot tip).
|
|
146
169
|
try {
|
|
170
|
+
const { maybeShowCompletionTip } = await import('../core/completion-tip.js');
|
|
147
171
|
await maybeShowCompletionTip({
|
|
148
172
|
silent: shouldDeferCompletionTip(actionCommand, Boolean(process.stderr.isTTY)),
|
|
149
173
|
});
|
|
@@ -151,6 +175,7 @@ program.hook('postAction', async (_thisCommand, actionCommand) => {
|
|
|
151
175
|
finally {
|
|
152
176
|
// The flush runs even if the hint throws: parse() is synchronous, so a
|
|
153
177
|
// rejection here has no catch anywhere above it.
|
|
178
|
+
const { shutdown } = await import('../telemetry/index.js');
|
|
154
179
|
await shutdown();
|
|
155
180
|
}
|
|
156
181
|
});
|
|
@@ -205,7 +230,7 @@ program
|
|
|
205
230
|
await initCommand.execute(targetPath);
|
|
206
231
|
}
|
|
207
232
|
catch (error) {
|
|
208
|
-
failWithError(error);
|
|
233
|
+
await failWithError(error);
|
|
209
234
|
process.exit(1);
|
|
210
235
|
}
|
|
211
236
|
});
|
|
@@ -226,7 +251,7 @@ program
|
|
|
226
251
|
await initCommand.execute('.');
|
|
227
252
|
}
|
|
228
253
|
catch (error) {
|
|
229
|
-
failWithError(error);
|
|
254
|
+
await failWithError(error);
|
|
230
255
|
process.exit(1);
|
|
231
256
|
}
|
|
232
257
|
});
|
|
@@ -236,6 +261,11 @@ program
|
|
|
236
261
|
.option('--force', 'Force update even when tools are up to date')
|
|
237
262
|
.action(async (targetPath = '.', options) => {
|
|
238
263
|
try {
|
|
264
|
+
const [{ getInstallDir, isSourceCheckout, getAvailableCliUpdate, shouldOfferUpgrade, displayCliUpdateNote, offerCliUpgrade, rerunUpdateWithUpgradedCli, displayUpgradeCommand, }, { isInteractive }, { UpdateCommand },] = await Promise.all([
|
|
265
|
+
import('../core/version-check.js'),
|
|
266
|
+
import('../utils/interactive.js'),
|
|
267
|
+
import('../core/update.js'),
|
|
268
|
+
]);
|
|
239
269
|
const installDir = getInstallDir();
|
|
240
270
|
// Running from a clone: the version is whatever the branch says, so any
|
|
241
271
|
// upgrade advice would be noise. Decided before the request, so a
|
|
@@ -287,7 +317,7 @@ program
|
|
|
287
317
|
}
|
|
288
318
|
}
|
|
289
319
|
catch (error) {
|
|
290
|
-
failWithError(error);
|
|
320
|
+
await failWithError(error);
|
|
291
321
|
process.exit(1);
|
|
292
322
|
}
|
|
293
323
|
});
|
|
@@ -296,12 +326,21 @@ program
|
|
|
296
326
|
.description('List items (changes by default). Use --specs to list specs.')
|
|
297
327
|
.option('--specs', 'List specs instead of changes')
|
|
298
328
|
.option('--changes', 'List changes explicitly (default)')
|
|
329
|
+
.option('--archived', 'Show only archived changes')
|
|
330
|
+
.option('--all', 'Show both active and archived changes')
|
|
299
331
|
.option('--sort <order>', 'Sort order: "recent" (default) or "name"', 'recent')
|
|
300
332
|
.option('--json', 'Output as JSON (for programmatic use)')
|
|
301
333
|
.option('--store <id>', STORE_OPTION_DESCRIPTION)
|
|
302
334
|
.addOption(hiddenStorePathOption())
|
|
303
335
|
.action(async (options) => {
|
|
304
336
|
try {
|
|
337
|
+
if (options?.specs && (options.archived || options.all)) {
|
|
338
|
+
throw new Error('--archived and --all can only be used when listing changes.');
|
|
339
|
+
}
|
|
340
|
+
const [{ resolveRootForCommand, toRootOutput }, { ListCommand }] = await Promise.all([
|
|
341
|
+
import('../core/root-selection.js'),
|
|
342
|
+
import('../core/list.js'),
|
|
343
|
+
]);
|
|
305
344
|
const root = await resolveRootForCommand(options ?? {}, {
|
|
306
345
|
json: options?.json,
|
|
307
346
|
failurePayload: options?.specs ? { specs: [], root: null } : { changes: [], root: null },
|
|
@@ -318,11 +357,13 @@ program
|
|
|
318
357
|
await listCommand.execute(root.path, mode, {
|
|
319
358
|
sort,
|
|
320
359
|
json: options?.json,
|
|
360
|
+
archived: options?.archived,
|
|
361
|
+
all: options?.all,
|
|
321
362
|
...(options?.json ? { root: toRootOutput(root) } : {}),
|
|
322
363
|
});
|
|
323
364
|
}
|
|
324
365
|
catch (error) {
|
|
325
|
-
failWithError(error, {
|
|
366
|
+
await failWithError(error, {
|
|
326
367
|
enabled: options?.json,
|
|
327
368
|
payload: options?.specs ? { specs: [], root: null } : { changes: [], root: null },
|
|
328
369
|
fallbackCode: 'list_error',
|
|
@@ -340,6 +381,10 @@ program
|
|
|
340
381
|
// Implicit cwd fallback stays enabled so `view` keeps accepting the same
|
|
341
382
|
// directories as `list`/`status` — notably pre-config.yaml `openspec/`
|
|
342
383
|
// dirs. ViewCommand still reports a missing openspec/ directory itself.
|
|
384
|
+
const [{ resolveRootForCommand }, { ViewCommand }] = await Promise.all([
|
|
385
|
+
import('../core/root-selection.js'),
|
|
386
|
+
import('../core/view.js'),
|
|
387
|
+
]);
|
|
343
388
|
const root = await resolveRootForCommand(options ?? {});
|
|
344
389
|
if (!root) {
|
|
345
390
|
return;
|
|
@@ -348,7 +393,7 @@ program
|
|
|
348
393
|
await viewCommand.execute(root.path);
|
|
349
394
|
}
|
|
350
395
|
catch (error) {
|
|
351
|
-
failWithError(error);
|
|
396
|
+
await failWithError(error);
|
|
352
397
|
process.exit(1);
|
|
353
398
|
}
|
|
354
399
|
});
|
|
@@ -370,6 +415,7 @@ changeCmd
|
|
|
370
415
|
.option('--no-interactive', 'Disable interactive prompts')
|
|
371
416
|
.action(async (changeName, options) => {
|
|
372
417
|
try {
|
|
418
|
+
const { ChangeCommand } = await import('../commands/change.js');
|
|
373
419
|
const changeCommand = new ChangeCommand();
|
|
374
420
|
await changeCommand.show(changeName, options);
|
|
375
421
|
}
|
|
@@ -386,6 +432,7 @@ changeCmd
|
|
|
386
432
|
.action(async (options) => {
|
|
387
433
|
try {
|
|
388
434
|
console.error('Warning: "openspec change list" is deprecated. Use "openspec list".');
|
|
435
|
+
const { ChangeCommand } = await import('../commands/change.js');
|
|
389
436
|
const changeCommand = new ChangeCommand();
|
|
390
437
|
await changeCommand.list(options);
|
|
391
438
|
}
|
|
@@ -402,6 +449,7 @@ changeCmd
|
|
|
402
449
|
.option('--no-interactive', 'Disable interactive prompts')
|
|
403
450
|
.action(async (changeName, options) => {
|
|
404
451
|
try {
|
|
452
|
+
const { ChangeCommand } = await import('../commands/change.js');
|
|
405
453
|
const changeCommand = new ChangeCommand();
|
|
406
454
|
// validate() already sets process.exitCode, and Node honours it at
|
|
407
455
|
// natural exit. Calling process.exit() here would skip commander's
|
|
@@ -426,11 +474,12 @@ program
|
|
|
426
474
|
.addOption(hiddenStorePathOption())
|
|
427
475
|
.action(async (changeName, options) => {
|
|
428
476
|
try {
|
|
477
|
+
const { ArchiveCommand } = await import('../core/archive.js');
|
|
429
478
|
const archiveCommand = new ArchiveCommand();
|
|
430
479
|
await archiveCommand.execute(changeName, options);
|
|
431
480
|
}
|
|
432
481
|
catch (error) {
|
|
433
|
-
failWithError(error);
|
|
482
|
+
await failWithError(error);
|
|
434
483
|
process.exit(1);
|
|
435
484
|
}
|
|
436
485
|
});
|
|
@@ -459,11 +508,12 @@ program
|
|
|
459
508
|
.addOption(hiddenStorePathOption())
|
|
460
509
|
.action(async (itemName, options) => {
|
|
461
510
|
try {
|
|
511
|
+
const { ValidateCommand } = await import('../commands/validate.js');
|
|
462
512
|
const validateCommand = new ValidateCommand();
|
|
463
513
|
await validateCommand.execute(itemName, options);
|
|
464
514
|
}
|
|
465
515
|
catch (error) {
|
|
466
|
-
failWithError(error, { enabled: options?.json, fallbackCode: 'validate_error' });
|
|
516
|
+
await failWithError(error, { enabled: options?.json, fallbackCode: 'validate_error' });
|
|
467
517
|
process.exit(1);
|
|
468
518
|
}
|
|
469
519
|
});
|
|
@@ -490,11 +540,12 @@ program
|
|
|
490
540
|
.allowUnknownOption(true)
|
|
491
541
|
.action(async (itemName, options) => {
|
|
492
542
|
try {
|
|
543
|
+
const { ShowCommand } = await import('../commands/show.js');
|
|
493
544
|
const showCommand = new ShowCommand();
|
|
494
545
|
await showCommand.execute(itemName, options ?? {});
|
|
495
546
|
}
|
|
496
547
|
catch (error) {
|
|
497
|
-
failWithError(error, { enabled: options?.json, fallbackCode: 'show_error' });
|
|
548
|
+
await failWithError(error, { enabled: options?.json, fallbackCode: 'show_error' });
|
|
498
549
|
process.exit(1);
|
|
499
550
|
}
|
|
500
551
|
});
|
|
@@ -505,11 +556,12 @@ program
|
|
|
505
556
|
.option('--body <text>', 'Detailed description for the feedback')
|
|
506
557
|
.action(async (message, options) => {
|
|
507
558
|
try {
|
|
559
|
+
const { FeedbackCommand } = await import('../commands/feedback.js');
|
|
508
560
|
const feedbackCommand = new FeedbackCommand();
|
|
509
561
|
await feedbackCommand.execute(message, options);
|
|
510
562
|
}
|
|
511
563
|
catch (error) {
|
|
512
|
-
failWithError(error);
|
|
564
|
+
await failWithError(error);
|
|
513
565
|
process.exit(1);
|
|
514
566
|
}
|
|
515
567
|
});
|
|
@@ -522,11 +574,12 @@ completionCmd
|
|
|
522
574
|
.description('Generate completion script for a shell (outputs to stdout)')
|
|
523
575
|
.action(async (shell) => {
|
|
524
576
|
try {
|
|
577
|
+
const { CompletionCommand } = await import('../commands/completion.js');
|
|
525
578
|
const completionCommand = new CompletionCommand();
|
|
526
579
|
await completionCommand.generate({ shell });
|
|
527
580
|
}
|
|
528
581
|
catch (error) {
|
|
529
|
-
failWithError(error);
|
|
582
|
+
await failWithError(error);
|
|
530
583
|
process.exit(1);
|
|
531
584
|
}
|
|
532
585
|
});
|
|
@@ -536,11 +589,12 @@ completionCmd
|
|
|
536
589
|
.option('--verbose', 'Show detailed installation output')
|
|
537
590
|
.action(async (shell, options) => {
|
|
538
591
|
try {
|
|
592
|
+
const { CompletionCommand } = await import('../commands/completion.js');
|
|
539
593
|
const completionCommand = new CompletionCommand();
|
|
540
594
|
await completionCommand.install({ shell, verbose: options?.verbose });
|
|
541
595
|
}
|
|
542
596
|
catch (error) {
|
|
543
|
-
failWithError(error);
|
|
597
|
+
await failWithError(error);
|
|
544
598
|
process.exit(1);
|
|
545
599
|
}
|
|
546
600
|
});
|
|
@@ -550,11 +604,12 @@ completionCmd
|
|
|
550
604
|
.option('-y, --yes', 'Skip confirmation prompts')
|
|
551
605
|
.action(async (shell, options) => {
|
|
552
606
|
try {
|
|
607
|
+
const { CompletionCommand } = await import('../commands/completion.js');
|
|
553
608
|
const completionCommand = new CompletionCommand();
|
|
554
609
|
await completionCommand.uninstall({ shell, yes: options?.yes });
|
|
555
610
|
}
|
|
556
611
|
catch (error) {
|
|
557
|
-
failWithError(error);
|
|
612
|
+
await failWithError(error);
|
|
558
613
|
process.exit(1);
|
|
559
614
|
}
|
|
560
615
|
});
|
|
@@ -564,6 +619,7 @@ program
|
|
|
564
619
|
.description('Output completion data in machine-readable format (internal use)')
|
|
565
620
|
.action(async (type) => {
|
|
566
621
|
try {
|
|
622
|
+
const { CompletionCommand } = await import('../commands/completion.js');
|
|
567
623
|
const completionCommand = new CompletionCommand();
|
|
568
624
|
await completionCommand.complete({ type });
|
|
569
625
|
}
|
|
@@ -587,14 +643,17 @@ program
|
|
|
587
643
|
.addOption(hiddenStorePathOption())
|
|
588
644
|
.action(async (options) => {
|
|
589
645
|
try {
|
|
646
|
+
const { statusCommand } = await import('../commands/workflow/status.js');
|
|
590
647
|
await statusCommand(options);
|
|
591
648
|
}
|
|
592
649
|
catch (error) {
|
|
593
|
-
failWithError(error, {
|
|
650
|
+
await failWithError(error, {
|
|
594
651
|
enabled: options.json,
|
|
595
652
|
// The batch null-shape; the single-change failure shape is
|
|
596
653
|
// pre-existing contract and stays payload-free.
|
|
597
|
-
payload: options.all
|
|
654
|
+
payload: options.all
|
|
655
|
+
? (await import('../commands/workflow/status.js')).BATCH_STATUS_FAILURE_PAYLOAD
|
|
656
|
+
: undefined,
|
|
598
657
|
fallbackCode: 'change_error',
|
|
599
658
|
});
|
|
600
659
|
process.exit(1);
|
|
@@ -611,6 +670,7 @@ program
|
|
|
611
670
|
.addOption(hiddenStorePathOption())
|
|
612
671
|
.action(async (artifactId, options) => {
|
|
613
672
|
try {
|
|
673
|
+
const { applyInstructionsCommand, archiveInstructionsCommand, instructionsCommand } = await import('../commands/workflow/instructions.js');
|
|
614
674
|
// Workflow instruction surfaces are reserved command branches, not artifacts.
|
|
615
675
|
if (artifactId === 'apply') {
|
|
616
676
|
await applyInstructionsCommand(options);
|
|
@@ -623,7 +683,7 @@ program
|
|
|
623
683
|
}
|
|
624
684
|
}
|
|
625
685
|
catch (error) {
|
|
626
|
-
failWithError(error, { enabled: options.json, fallbackCode: 'change_error' });
|
|
686
|
+
await failWithError(error, { enabled: options.json, fallbackCode: 'change_error' });
|
|
627
687
|
process.exit(1);
|
|
628
688
|
}
|
|
629
689
|
});
|
|
@@ -635,10 +695,11 @@ program
|
|
|
635
695
|
.option('--json', 'Output as JSON mapping artifact IDs to template paths')
|
|
636
696
|
.action(async (options) => {
|
|
637
697
|
try {
|
|
698
|
+
const { templatesCommand } = await import('../commands/workflow/templates.js');
|
|
638
699
|
await templatesCommand(options);
|
|
639
700
|
}
|
|
640
701
|
catch (error) {
|
|
641
|
-
failWithError(error);
|
|
702
|
+
await failWithError(error);
|
|
642
703
|
process.exit(1);
|
|
643
704
|
}
|
|
644
705
|
});
|
|
@@ -651,10 +712,11 @@ program
|
|
|
651
712
|
.addOption(hiddenStorePathOption())
|
|
652
713
|
.action(async (options) => {
|
|
653
714
|
try {
|
|
715
|
+
const { schemasCommand } = await import('../commands/workflow/schemas.js');
|
|
654
716
|
await schemasCommand(options);
|
|
655
717
|
}
|
|
656
718
|
catch (error) {
|
|
657
|
-
failWithError(error, {
|
|
719
|
+
await failWithError(error, {
|
|
658
720
|
enabled: options.json,
|
|
659
721
|
payload: { schemas: [], root: null },
|
|
660
722
|
fallbackCode: 'schemas_error',
|
|
@@ -679,10 +741,11 @@ newCmd
|
|
|
679
741
|
.addOption(new Option('--areas <names>', 'No longer supported').hideHelp())
|
|
680
742
|
.action(async (name, options) => {
|
|
681
743
|
try {
|
|
744
|
+
const { newChangeCommand } = await import('../commands/workflow/new-change.js');
|
|
682
745
|
await newChangeCommand(name, options);
|
|
683
746
|
}
|
|
684
747
|
catch (error) {
|
|
685
|
-
failWithError(error);
|
|
748
|
+
await failWithError(error);
|
|
686
749
|
process.exit(1);
|
|
687
750
|
}
|
|
688
751
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
1
|
import { GlobalConfig } from '../core/global-config.js';
|
|
3
2
|
import type { Profile, Delivery } from '../core/global-config.js';
|
|
4
3
|
/**
|
|
@@ -40,11 +39,21 @@ export declare function formatWorkflowSummary(workflows: readonly string[], prof
|
|
|
40
39
|
* Build a user-facing diff summary between two profile states.
|
|
41
40
|
*/
|
|
42
41
|
export declare function diffProfileState(before: ProfileState, after: ProfileState): ProfileStateDiff;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export declare function
|
|
42
|
+
export declare function configPathCommand(): void;
|
|
43
|
+
export declare function configListCommand(options: {
|
|
44
|
+
json?: boolean;
|
|
45
|
+
}): void;
|
|
46
|
+
export declare function configGetCommand(key: string): void;
|
|
47
|
+
export declare function configSetCommand(key: string, value: string, options: {
|
|
48
|
+
string?: boolean;
|
|
49
|
+
allowUnknown?: boolean;
|
|
50
|
+
}): void;
|
|
51
|
+
export declare function configUnsetCommand(key: string): void;
|
|
52
|
+
export declare function configResetCommand(options: {
|
|
53
|
+
all?: boolean;
|
|
54
|
+
yes?: boolean;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
export declare function configEditCommand(): Promise<void>;
|
|
57
|
+
export declare function configProfileCommand(preset?: string): Promise<void>;
|
|
49
58
|
export {};
|
|
50
59
|
//# sourceMappingURL=config.d.ts.map
|