@specforge/mcp 3.0.7 → 3.1.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/autopilot/agents/agent-runner.d.ts.map +1 -1
- package/dist/autopilot/agents/agent-runner.js +7 -0
- package/dist/autopilot/agents/agent-runner.js.map +1 -1
- package/dist/autopilot/api/autopilot-api-client.d.ts +5 -4
- package/dist/autopilot/api/autopilot-api-client.d.ts.map +1 -1
- package/dist/autopilot/api/autopilot-api-client.js +21 -26
- package/dist/autopilot/api/autopilot-api-client.js.map +1 -1
- package/dist/autopilot/cli/run.d.ts.map +1 -1
- package/dist/autopilot/cli/run.js +28 -0
- package/dist/autopilot/cli/run.js.map +1 -1
- package/dist/autopilot/core/dependency-resolver.d.ts +10 -1
- package/dist/autopilot/core/dependency-resolver.d.ts.map +1 -1
- package/dist/autopilot/core/dependency-resolver.js +27 -1
- package/dist/autopilot/core/dependency-resolver.js.map +1 -1
- package/dist/autopilot/core/dispatcher.d.ts +26 -0
- package/dist/autopilot/core/dispatcher.d.ts.map +1 -1
- package/dist/autopilot/core/dispatcher.js +116 -6
- package/dist/autopilot/core/dispatcher.js.map +1 -1
- package/dist/autopilot/readiness/aggregation.d.ts +56 -0
- package/dist/autopilot/readiness/aggregation.d.ts.map +1 -0
- package/dist/autopilot/readiness/aggregation.js +94 -0
- package/dist/autopilot/readiness/aggregation.js.map +1 -0
- package/dist/autopilot/readiness/config.d.ts +15 -0
- package/dist/autopilot/readiness/config.d.ts.map +1 -0
- package/dist/autopilot/readiness/config.js +76 -0
- package/dist/autopilot/readiness/config.js.map +1 -0
- package/dist/autopilot/readiness/index.d.ts +16 -0
- package/dist/autopilot/readiness/index.d.ts.map +1 -0
- package/dist/autopilot/readiness/index.js +11 -0
- package/dist/autopilot/readiness/index.js.map +1 -0
- package/dist/autopilot/readiness/post-scoring.d.ts +28 -0
- package/dist/autopilot/readiness/post-scoring.d.ts.map +1 -0
- package/dist/autopilot/readiness/post-scoring.js +41 -0
- package/dist/autopilot/readiness/post-scoring.js.map +1 -0
- package/dist/autopilot/readiness/preflight.d.ts +36 -0
- package/dist/autopilot/readiness/preflight.d.ts.map +1 -0
- package/dist/autopilot/readiness/preflight.js +93 -0
- package/dist/autopilot/readiness/preflight.js.map +1 -0
- package/dist/autopilot/readiness/prompt-section.d.ts +19 -0
- package/dist/autopilot/readiness/prompt-section.d.ts.map +1 -0
- package/dist/autopilot/readiness/prompt-section.js +33 -0
- package/dist/autopilot/readiness/prompt-section.js.map +1 -0
- package/dist/autopilot/readiness/types.d.ts +25 -0
- package/dist/autopilot/readiness/types.d.ts.map +1 -0
- package/dist/autopilot/readiness/types.js +8 -0
- package/dist/autopilot/readiness/types.js.map +1 -0
- package/dist/autopilot/sync/sync-manager.d.ts.map +1 -1
- package/dist/autopilot/sync/sync-manager.js +2 -1
- package/dist/autopilot/sync/sync-manager.js.map +1 -1
- package/dist/autopilot/types.d.ts +28 -0
- package/dist/autopilot/types.d.ts.map +1 -1
- package/dist/autopilot/types.js.map +1 -1
- package/dist/cli/commands/index.d.ts +5 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +5 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +184 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/init.types.d.ts +37 -0
- package/dist/cli/commands/init.types.d.ts.map +1 -1
- package/dist/cli/commands/init.types.js +18 -0
- package/dist/cli/commands/init.types.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +18 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +154 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/plan.types.d.ts +60 -0
- package/dist/cli/commands/plan.types.d.ts.map +1 -0
- package/dist/cli/commands/plan.types.js +8 -0
- package/dist/cli/commands/plan.types.js.map +1 -0
- package/dist/cli/commands/review-implementation.d.ts +16 -0
- package/dist/cli/commands/review-implementation.d.ts.map +1 -0
- package/dist/cli/commands/review-implementation.js +226 -0
- package/dist/cli/commands/review-implementation.js.map +1 -0
- package/dist/cli/commands/review-planning.d.ts +15 -0
- package/dist/cli/commands/review-planning.d.ts.map +1 -0
- package/dist/cli/commands/review-planning.js +177 -0
- package/dist/cli/commands/review-planning.js.map +1 -0
- package/dist/cli/commands/score/display.d.ts +20 -0
- package/dist/cli/commands/score/display.d.ts.map +1 -0
- package/dist/cli/commands/score/display.js +111 -0
- package/dist/cli/commands/score/display.js.map +1 -0
- package/dist/cli/commands/score/index.d.ts +9 -0
- package/dist/cli/commands/score/index.d.ts.map +1 -0
- package/dist/cli/commands/score/index.js +12 -0
- package/dist/cli/commands/score/index.js.map +1 -0
- package/dist/cli/commands/score/score.d.ts +17 -0
- package/dist/cli/commands/score/score.d.ts.map +1 -0
- package/dist/cli/commands/score/score.js +144 -0
- package/dist/cli/commands/score/score.js.map +1 -0
- package/dist/cli/commands/score/types.d.ts +79 -0
- package/dist/cli/commands/score/types.d.ts.map +1 -0
- package/dist/cli/commands/score/types.js +51 -0
- package/dist/cli/commands/score/types.js.map +1 -0
- package/dist/cli/commands/spec-activate.d.ts +29 -0
- package/dist/cli/commands/spec-activate.d.ts.map +1 -0
- package/dist/cli/commands/spec-activate.js +155 -0
- package/dist/cli/commands/spec-activate.js.map +1 -0
- package/dist/cli/commands/spec-activate.types.d.ts +24 -0
- package/dist/cli/commands/spec-activate.types.d.ts.map +1 -0
- package/dist/cli/commands/spec-activate.types.js +8 -0
- package/dist/cli/commands/spec-activate.types.js.map +1 -0
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +89 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/status.types.d.ts +2 -0
- package/dist/cli/commands/status.types.d.ts.map +1 -1
- package/dist/cli/commands/status.types.js.map +1 -1
- package/dist/cli/config/agent-teams.types.d.ts +194 -0
- package/dist/cli/config/agent-teams.types.d.ts.map +1 -0
- package/dist/cli/config/agent-teams.types.js +36 -0
- package/dist/cli/config/agent-teams.types.js.map +1 -0
- package/dist/cli/config/index.d.ts +2 -0
- package/dist/cli/config/index.d.ts.map +1 -1
- package/dist/cli/config/index.js +2 -0
- package/dist/cli/config/index.js.map +1 -1
- package/dist/cli/config/loader.d.ts +36 -2
- package/dist/cli/config/loader.d.ts.map +1 -1
- package/dist/cli/config/loader.js +65 -0
- package/dist/cli/config/loader.js.map +1 -1
- package/dist/cli/config/validation.d.ts +69 -0
- package/dist/cli/config/validation.d.ts.map +1 -0
- package/dist/cli/config/validation.js +295 -0
- package/dist/cli/config/validation.js.map +1 -0
- package/dist/cli/config/writer.d.ts +39 -0
- package/dist/cli/config/writer.d.ts.map +1 -1
- package/dist/cli/config/writer.js +58 -0
- package/dist/cli/config/writer.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/monorepo-detector.d.ts +31 -0
- package/dist/lib/monorepo-detector.d.ts.map +1 -0
- package/dist/lib/monorepo-detector.js +271 -0
- package/dist/lib/monorepo-detector.js.map +1 -0
- package/dist/lib/prompt-generator.d.ts +65 -0
- package/dist/lib/prompt-generator.d.ts.map +1 -0
- package/dist/lib/prompt-generator.js +174 -0
- package/dist/lib/prompt-generator.js.map +1 -0
- package/dist/lib/strategy-analyzer.d.ts +59 -0
- package/dist/lib/strategy-analyzer.d.ts.map +1 -0
- package/dist/lib/strategy-analyzer.js +137 -0
- package/dist/lib/strategy-analyzer.js.map +1 -0
- package/dist/tools/core/context-helper.d.ts +22 -0
- package/dist/tools/core/context-helper.d.ts.map +1 -1
- package/dist/tools/core/context-helper.js +37 -1
- package/dist/tools/core/context-helper.js.map +1 -1
- package/dist/tools/core/workspace-files.d.ts +49 -0
- package/dist/tools/core/workspace-files.d.ts.map +1 -0
- package/dist/tools/core/workspace-files.js +259 -0
- package/dist/tools/core/workspace-files.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +147 -0
- package/dist/tools/index.js.map +1 -1
- package/package.json +3 -2
- package/src/cli/templates/agents/content/core/sfag-implementer.ts +113 -0
- package/src/cli/templates/agents/content/core/sfag-orchestrator.ts +107 -0
- package/src/cli/templates/agents/content/core/sfag-spec-creator.ts +126 -0
- package/src/cli/templates/agents/content/core/sfag-ticket-implementer.ts +132 -0
- package/src/cli/templates/agents/content/research/sfag-package-researcher.ts +153 -0
- package/src/cli/templates/agents/content/task-type/sfag-api-implementer.ts +132 -0
- package/src/cli/templates/agents/content/task-type/sfag-docs-writer.ts +183 -0
- package/src/cli/templates/agents/content/task-type/sfag-frontend-builder.ts +141 -0
- package/src/cli/templates/agents/content/task-type/sfag-infra-architect.ts +149 -0
- package/src/cli/templates/agents/content/task-type/sfag-schema-designer.ts +132 -0
- package/src/cli/templates/agents/content/task-type/sfag-test-writer.ts +171 -0
- package/src/cli/templates/agents/index.ts +74 -0
- package/src/cli/templates/commands.ts +179 -0
- package/src/cli/templates/content/sf-autonomous.ts +78 -0
- package/src/cli/templates/content/sf-blockers.ts +68 -0
- package/src/cli/templates/content/sf-commit.ts +78 -0
- package/src/cli/templates/content/sf-context.ts +64 -0
- package/src/cli/templates/content/sf-create-epics.ts +129 -0
- package/src/cli/templates/content/sf-create-spec.ts +136 -0
- package/src/cli/templates/content/sf-create-tickets.ts +148 -0
- package/src/cli/templates/content/sf-epic.ts +69 -0
- package/src/cli/templates/content/sf-help.ts +61 -0
- package/src/cli/templates/content/sf-import.ts +88 -0
- package/src/cli/templates/content/sf-init.ts +61 -0
- package/src/cli/templates/content/sf-next.ts +67 -0
- package/src/cli/templates/content/sf-reset.ts +78 -0
- package/src/cli/templates/content/sf-review.ts +67 -0
- package/src/cli/templates/content/sf-search.ts +64 -0
- package/src/cli/templates/content/sf-status.ts +67 -0
- package/src/cli/templates/content/sf-ticket.ts +76 -0
- package/src/cli/templates/content/sf-validate.ts +78 -0
- package/src/cli/templates/index.ts +16 -0
- package/src/cli/templates/skills/specforge-conventions.md +109 -0
- package/src/cli/templates/skills/specforge-orchestrator.md +401 -0
- package/src/cli/templates/skills/specforge-validator.md +122 -0
- package/src/cli/templates/skills/specforge-worker.md +378 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score Command Implementation
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for the score command that fetches and displays
|
|
5
|
+
* readiness scores for specifications, epics, and tickets.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
import { ScoreDisplayOptions } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Main score command handler
|
|
11
|
+
*/
|
|
12
|
+
export declare function scoreCommand(entityType: string | undefined, entityId: string | undefined, options: ScoreDisplayOptions): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Register score command with Commander
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerScoreCommand(program: Command): void;
|
|
17
|
+
//# sourceMappingURL=score.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/score/score.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,EACL,mBAAmB,EASpB,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAgHf;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0B3D"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score Command Implementation
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for the score command that fetches and displays
|
|
5
|
+
* readiness scores for specifications, epics, and tickets.
|
|
6
|
+
*/
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import ora from 'ora';
|
|
9
|
+
import { resolveConfig } from '../../config/index.js';
|
|
10
|
+
import { ApiClient } from '../../../client/api-client.js';
|
|
11
|
+
import { withErrorHandler, CliError } from '../../middleware/error-handler.js';
|
|
12
|
+
import { isValidEntityType, getOperationForType, getParamNameForType, getFullTypeName, VALID_ENTITY_TYPES, } from './types.js';
|
|
13
|
+
import { formatScoreResult, formatScoreReport } from './display.js';
|
|
14
|
+
/**
|
|
15
|
+
* Main score command handler
|
|
16
|
+
*/
|
|
17
|
+
export async function scoreCommand(entityType, entityId, options) {
|
|
18
|
+
const config = resolveConfig();
|
|
19
|
+
if (!config.apiKey) {
|
|
20
|
+
throw new CliError('Not authenticated', 1, 'Run `specforge login` to authenticate first');
|
|
21
|
+
}
|
|
22
|
+
// If no entity type specified, default to active specification
|
|
23
|
+
if (!entityType) {
|
|
24
|
+
if (!config.specificationId) {
|
|
25
|
+
console.error(chalk.red('\nError: No entity specified and no active specification.'));
|
|
26
|
+
console.error('Usage: specforge score [spec|epic|ticket] [id]');
|
|
27
|
+
console.error(chalk.dim("Run 'specforge init' or 'specforge switch' to set an active specification."));
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
entityType = 'spec';
|
|
31
|
+
entityId = config.specificationId;
|
|
32
|
+
}
|
|
33
|
+
if (!isValidEntityType(entityType)) {
|
|
34
|
+
console.error(chalk.red(`\nError: Unknown entity type "${entityType}"`));
|
|
35
|
+
console.error(`Valid types: ${VALID_ENTITY_TYPES.join(', ')}`);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
if (!entityId) {
|
|
39
|
+
console.error(chalk.red(`\nError: Entity ID is required.`));
|
|
40
|
+
console.error(`Usage: specforge score ${entityType} <id>`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
const spinner = options.json ? null : ora('Fetching readiness score...').start();
|
|
44
|
+
try {
|
|
45
|
+
const client = new ApiClient({
|
|
46
|
+
apiKey: config.apiKey,
|
|
47
|
+
apiUrl: config.apiUrl,
|
|
48
|
+
debug: config.debug,
|
|
49
|
+
});
|
|
50
|
+
// Fetch the entity
|
|
51
|
+
const operation = getOperationForType(entityType);
|
|
52
|
+
const paramName = getParamNameForType(entityType);
|
|
53
|
+
const entity = await client.call(operation, {
|
|
54
|
+
[paramName]: entityId,
|
|
55
|
+
});
|
|
56
|
+
const result = {
|
|
57
|
+
id: entity.id,
|
|
58
|
+
title: entity.title,
|
|
59
|
+
type: getFullTypeName(entityType),
|
|
60
|
+
readinessScore: typeof entity.readinessScore === 'number' ? entity.readinessScore : null,
|
|
61
|
+
readinessLevel: typeof entity.readinessLevel === 'string' ? entity.readinessLevel : null,
|
|
62
|
+
};
|
|
63
|
+
spinner?.stop();
|
|
64
|
+
// Output based on format
|
|
65
|
+
if (options.json && !options.report) {
|
|
66
|
+
console.log(JSON.stringify(result, null, 2));
|
|
67
|
+
}
|
|
68
|
+
else if (!options.report) {
|
|
69
|
+
console.log(formatScoreResult(result));
|
|
70
|
+
}
|
|
71
|
+
// Fetch and display full report if requested
|
|
72
|
+
if (options.report) {
|
|
73
|
+
const reportSpinner = options.json ? null : ora('Fetching readiness report...').start();
|
|
74
|
+
try {
|
|
75
|
+
const report = await client.call('get_report', {
|
|
76
|
+
type: 'readiness',
|
|
77
|
+
scope: getFullTypeName(entityType),
|
|
78
|
+
scopeId: entityId,
|
|
79
|
+
format: 'json',
|
|
80
|
+
});
|
|
81
|
+
reportSpinner?.stop();
|
|
82
|
+
if (options.json) {
|
|
83
|
+
console.log(JSON.stringify({ score: result, report }, null, 2));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.log(formatScoreResult(result));
|
|
87
|
+
console.log(formatScoreReport(report));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (reportError) {
|
|
91
|
+
reportSpinner?.fail('Failed to fetch readiness report');
|
|
92
|
+
// Still show the score even if report fails
|
|
93
|
+
if (!options.json) {
|
|
94
|
+
console.log(formatScoreResult(result));
|
|
95
|
+
}
|
|
96
|
+
const msg = reportError instanceof Error ? reportError.message : 'Unknown error';
|
|
97
|
+
console.error(chalk.dim(`\nReport unavailable: ${msg}`));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
spinner?.fail('Failed to fetch score');
|
|
103
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
104
|
+
console.error(chalk.red(`\nError: ${message}`));
|
|
105
|
+
if (!options.json) {
|
|
106
|
+
console.error(chalk.dim('\nPossible causes:'));
|
|
107
|
+
console.error(chalk.dim(' - Invalid entity ID'));
|
|
108
|
+
console.error(chalk.dim(' - Network connectivity issues'));
|
|
109
|
+
console.error(chalk.dim(' - Authentication expired (try: specforge login)'));
|
|
110
|
+
}
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Register score command with Commander
|
|
116
|
+
*/
|
|
117
|
+
export function registerScoreCommand(program) {
|
|
118
|
+
program
|
|
119
|
+
.command('score [type] [id]')
|
|
120
|
+
.description('Display readiness score for a specification, epic, or ticket')
|
|
121
|
+
.addHelpText('after', `
|
|
122
|
+
Arguments:
|
|
123
|
+
type Entity type: spec, epic, or ticket (default: spec)
|
|
124
|
+
id Entity ID (defaults to active specification)
|
|
125
|
+
|
|
126
|
+
Examples:
|
|
127
|
+
$ specforge score # Score for active specification
|
|
128
|
+
$ specforge score spec spec_abc123 # Score for specific specification
|
|
129
|
+
$ specforge score epic epic_def456 # Score for specific epic
|
|
130
|
+
$ specforge score ticket ticket_ghi789 # Score for specific ticket
|
|
131
|
+
$ specforge score --report # Full readiness report
|
|
132
|
+
$ specforge score --json # JSON output
|
|
133
|
+
|
|
134
|
+
Score Levels:
|
|
135
|
+
exemplary 90-100 Outstanding readiness
|
|
136
|
+
complete 70-89 Good readiness
|
|
137
|
+
partial 40-69 Needs improvement
|
|
138
|
+
minimal 0-39 Significant gaps
|
|
139
|
+
`)
|
|
140
|
+
.option('--report', 'Show full readiness report')
|
|
141
|
+
.option('--json', 'Output as JSON')
|
|
142
|
+
.action(withErrorHandler(scoreCommand));
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=score.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.js","sourceRoot":"","sources":["../../../../src/cli/commands/score/score.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAKL,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEpE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,UAA8B,EAC9B,QAA4B,EAC5B,OAA4B;IAE5B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,QAAQ,CAChB,mBAAmB,EACnB,CAAC,EACD,6CAA6C,CAC9C,CAAC;IACJ,CAAC;IAED,+DAA+D;IAC/D,IAAI,CAAC,UAAU,EAAE,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CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC,CAAC;QAEhD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;YAC/C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;YAClD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;YAC5D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CAAC,8DAA8D,CAAC;SAC3E,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;;;;;;;;;KAkBrB,CAAC;SACD,MAAM,CAAC,UAAU,EAAE,4BAA4B,CAAC;SAChD,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score Command Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the score command which displays
|
|
5
|
+
* readiness scores for specifications, epics, and tickets.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Score command options from Commander
|
|
9
|
+
*/
|
|
10
|
+
export interface ScoreDisplayOptions {
|
|
11
|
+
/** Entity type to fetch (spec, epic, ticket) */
|
|
12
|
+
entityType?: string;
|
|
13
|
+
/** Entity ID */
|
|
14
|
+
entityId?: string;
|
|
15
|
+
/** Generate full readiness report */
|
|
16
|
+
report?: boolean;
|
|
17
|
+
/** Output as JSON */
|
|
18
|
+
json?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Score result for a single entity
|
|
22
|
+
*/
|
|
23
|
+
export interface ScoreResult {
|
|
24
|
+
/** Entity ID */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Entity title */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Entity type */
|
|
29
|
+
type: 'specification' | 'epic' | 'ticket';
|
|
30
|
+
/** Readiness score (0-100 or null if unscored) */
|
|
31
|
+
readinessScore: number | null;
|
|
32
|
+
/** Readiness level (exemplary, complete, partial, minimal) */
|
|
33
|
+
readinessLevel: string | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* API response with readiness fields
|
|
37
|
+
*/
|
|
38
|
+
export interface EntityWithReadiness {
|
|
39
|
+
id: string;
|
|
40
|
+
title: string;
|
|
41
|
+
readinessScore?: number | null;
|
|
42
|
+
readinessLevel?: string | null;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Readiness report from get_report API
|
|
47
|
+
*/
|
|
48
|
+
export interface ReadinessReportResponse {
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Valid entity types for the score command
|
|
53
|
+
*/
|
|
54
|
+
export type ScoreEntityType = 'spec' | 'epic' | 'ticket';
|
|
55
|
+
/**
|
|
56
|
+
* Valid readiness levels
|
|
57
|
+
*/
|
|
58
|
+
export declare const READINESS_LEVELS: readonly ["exemplary", "complete", "partial", "minimal"];
|
|
59
|
+
/**
|
|
60
|
+
* Valid entity types
|
|
61
|
+
*/
|
|
62
|
+
export declare const VALID_ENTITY_TYPES: ScoreEntityType[];
|
|
63
|
+
/**
|
|
64
|
+
* Check if a string is a valid entity type
|
|
65
|
+
*/
|
|
66
|
+
export declare function isValidEntityType(type: string): type is ScoreEntityType;
|
|
67
|
+
/**
|
|
68
|
+
* Map short entity type to API operation name
|
|
69
|
+
*/
|
|
70
|
+
export declare function getOperationForType(type: ScoreEntityType): string;
|
|
71
|
+
/**
|
|
72
|
+
* Map short entity type to API parameter name
|
|
73
|
+
*/
|
|
74
|
+
export declare function getParamNameForType(type: ScoreEntityType): string;
|
|
75
|
+
/**
|
|
76
|
+
* Map short entity type to full type name
|
|
77
|
+
*/
|
|
78
|
+
export declare function getFullTypeName(type: ScoreEntityType): 'specification' | 'epic' | 'ticket';
|
|
79
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/score/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,IAAI,EAAE,eAAe,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC1C,kDAAkD;IAClD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,8DAA8D;IAC9D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,gBAAgB,0DAA2D,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,eAAe,EAA+B,CAAC;AAEhF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,eAAe,CAEvE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAMjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAMjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,GAAG,MAAM,GAAG,QAAQ,CAM1F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Score Command Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the score command which displays
|
|
5
|
+
* readiness scores for specifications, epics, and tickets.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Valid readiness levels
|
|
9
|
+
*/
|
|
10
|
+
export const READINESS_LEVELS = ['exemplary', 'complete', 'partial', 'minimal'];
|
|
11
|
+
/**
|
|
12
|
+
* Valid entity types
|
|
13
|
+
*/
|
|
14
|
+
export const VALID_ENTITY_TYPES = ['spec', 'epic', 'ticket'];
|
|
15
|
+
/**
|
|
16
|
+
* Check if a string is a valid entity type
|
|
17
|
+
*/
|
|
18
|
+
export function isValidEntityType(type) {
|
|
19
|
+
return VALID_ENTITY_TYPES.includes(type);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Map short entity type to API operation name
|
|
23
|
+
*/
|
|
24
|
+
export function getOperationForType(type) {
|
|
25
|
+
switch (type) {
|
|
26
|
+
case 'spec': return 'get_specification';
|
|
27
|
+
case 'epic': return 'get_epic';
|
|
28
|
+
case 'ticket': return 'get_ticket';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Map short entity type to API parameter name
|
|
33
|
+
*/
|
|
34
|
+
export function getParamNameForType(type) {
|
|
35
|
+
switch (type) {
|
|
36
|
+
case 'spec': return 'specificationId';
|
|
37
|
+
case 'epic': return 'epicId';
|
|
38
|
+
case 'ticket': return 'ticketId';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Map short entity type to full type name
|
|
43
|
+
*/
|
|
44
|
+
export function getFullTypeName(type) {
|
|
45
|
+
switch (type) {
|
|
46
|
+
case 'spec': return 'specification';
|
|
47
|
+
case 'epic': return 'epic';
|
|
48
|
+
case 'ticket': return 'ticket';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/cli/commands/score/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuDH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAEzF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,kBAAkB,CAAC,QAAQ,CAAC,IAAuB,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAqB;IACvD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM,CAAC,CAAC,OAAO,mBAAmB,CAAC;QACxC,KAAK,MAAM,CAAC,CAAC,OAAO,UAAU,CAAC;QAC/B,KAAK,QAAQ,CAAC,CAAC,OAAO,YAAY,CAAC;IACrC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAqB;IACvD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM,CAAC,CAAC,OAAO,iBAAiB,CAAC;QACtC,KAAK,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAC;QAC7B,KAAK,QAAQ,CAAC,CAAC,OAAO,UAAU,CAAC;IACnC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAqB;IACnD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM,CAAC,CAAC,OAAO,eAAe,CAAC;QACpC,KAAK,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC;QAC3B,KAAK,QAAQ,CAAC,CAAC,OAAO,QAAQ,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec Activate Command
|
|
3
|
+
*
|
|
4
|
+
* Sets or clears the active specification in .specforge.json.
|
|
5
|
+
* The active specification tells Agent Teams which spec to implement.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
/**
|
|
9
|
+
* Activate a specification as the active spec for Agent Teams
|
|
10
|
+
*
|
|
11
|
+
* @param specId Specification ID to activate
|
|
12
|
+
* @param options Command options
|
|
13
|
+
*/
|
|
14
|
+
export declare function specActivateAction(specId: string, options: {
|
|
15
|
+
json?: boolean;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Deactivate the current active specification
|
|
19
|
+
*
|
|
20
|
+
* @param options Command options
|
|
21
|
+
*/
|
|
22
|
+
export declare function specDeactivateAction(options: {
|
|
23
|
+
json?: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Register spec activate/deactivate commands with Commander
|
|
27
|
+
*/
|
|
28
|
+
export declare function registerSpecActivateCommand(program: Command): void;
|
|
29
|
+
//# sourceMappingURL=spec-activate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-activate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/spec-activate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1B,OAAO,CAAC,IAAI,CAAC,CA2Gf;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1B,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuClE"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec Activate Command
|
|
3
|
+
*
|
|
4
|
+
* Sets or clears the active specification in .specforge.json.
|
|
5
|
+
* The active specification tells Agent Teams which spec to implement.
|
|
6
|
+
*/
|
|
7
|
+
import ora from 'ora';
|
|
8
|
+
import { resolveConfig } from '../config/index.js';
|
|
9
|
+
import { setActiveSpecification } from '../config/writer.js';
|
|
10
|
+
import { withErrorHandler, CliError, NetworkError, ValidationError } from '../middleware/error-handler.js';
|
|
11
|
+
import { printBlank, printSuccess, printJson } from '../ui/output.js';
|
|
12
|
+
import { colors } from '../ui/colors.js';
|
|
13
|
+
import { ApiClient } from '../../client/api-client.js';
|
|
14
|
+
/**
|
|
15
|
+
* Activate a specification as the active spec for Agent Teams
|
|
16
|
+
*
|
|
17
|
+
* @param specId Specification ID to activate
|
|
18
|
+
* @param options Command options
|
|
19
|
+
*/
|
|
20
|
+
export async function specActivateAction(specId, options) {
|
|
21
|
+
if (!specId || specId.trim() === '') {
|
|
22
|
+
throw new ValidationError('Specification ID is required', 'Usage: specforge spec activate <specId>');
|
|
23
|
+
}
|
|
24
|
+
const config = resolveConfig();
|
|
25
|
+
if (!config.apiKey) {
|
|
26
|
+
throw new CliError('Not authenticated', 1, 'Run `specforge login` to authenticate first');
|
|
27
|
+
}
|
|
28
|
+
const spinner = ora({
|
|
29
|
+
text: 'Validating specification...',
|
|
30
|
+
color: 'cyan',
|
|
31
|
+
}).start();
|
|
32
|
+
try {
|
|
33
|
+
const client = new ApiClient({
|
|
34
|
+
apiKey: config.apiKey,
|
|
35
|
+
apiUrl: config.apiUrl,
|
|
36
|
+
debug: config.debug,
|
|
37
|
+
});
|
|
38
|
+
// Validate the specification exists
|
|
39
|
+
const spec = await client.call('get_specification', {
|
|
40
|
+
specificationId: specId,
|
|
41
|
+
summary: true,
|
|
42
|
+
});
|
|
43
|
+
if (!spec || !spec.id) {
|
|
44
|
+
spinner.fail('Specification not found');
|
|
45
|
+
throw new CliError(`Specification not found: ${specId}`, 1, "Run 'specforge specs' to list available specifications.");
|
|
46
|
+
}
|
|
47
|
+
// Set active specification in .specforge.json
|
|
48
|
+
spinner.text = 'Setting active specification...';
|
|
49
|
+
setActiveSpecification({
|
|
50
|
+
id: spec.id,
|
|
51
|
+
title: spec.title,
|
|
52
|
+
activatedAt: new Date().toISOString(),
|
|
53
|
+
});
|
|
54
|
+
spinner.succeed(`Active specification set to: ${colors.primary(spec.title)}`);
|
|
55
|
+
if (options.json) {
|
|
56
|
+
printJson({
|
|
57
|
+
action: 'activate',
|
|
58
|
+
specification: {
|
|
59
|
+
id: spec.id,
|
|
60
|
+
title: spec.title,
|
|
61
|
+
status: spec.status,
|
|
62
|
+
epicCount: spec.epicCount,
|
|
63
|
+
ticketCount: spec.ticketCount,
|
|
64
|
+
completedTicketCount: spec.completedTicketCount,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
printBlank();
|
|
70
|
+
console.log(colors.muted(` ID: ${spec.id}`));
|
|
71
|
+
console.log(colors.muted(` Status: ${spec.status}`));
|
|
72
|
+
if (spec.ticketCount !== undefined) {
|
|
73
|
+
const completed = spec.completedTicketCount ?? 0;
|
|
74
|
+
console.log(colors.muted(` Tickets: ${completed}/${spec.ticketCount} completed`));
|
|
75
|
+
}
|
|
76
|
+
printBlank();
|
|
77
|
+
console.log(colors.muted("Run 'specforge status' to see the current context."));
|
|
78
|
+
printBlank();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (error instanceof CliError || error instanceof ValidationError) {
|
|
83
|
+
spinner.stop();
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
spinner.fail('Failed to activate specification');
|
|
87
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
88
|
+
if (message.includes('401') || message.includes('Unauthorized')) {
|
|
89
|
+
throw new CliError('Authentication failed', 1, 'Your API key may be invalid. Run `specforge login` to re-authenticate');
|
|
90
|
+
}
|
|
91
|
+
if (message.includes('404') || message.includes('Not Found') || message.includes('not found')) {
|
|
92
|
+
throw new CliError(`Specification not found: ${specId}`, 1, "Run 'specforge specs' to list available specifications.");
|
|
93
|
+
}
|
|
94
|
+
throw new NetworkError(`Failed to activate specification: ${message}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Deactivate the current active specification
|
|
99
|
+
*
|
|
100
|
+
* @param options Command options
|
|
101
|
+
*/
|
|
102
|
+
export async function specDeactivateAction(options) {
|
|
103
|
+
setActiveSpecification(null);
|
|
104
|
+
if (options.json) {
|
|
105
|
+
printJson({ action: 'deactivate', specification: null });
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
printSuccess('Active specification cleared');
|
|
109
|
+
printBlank();
|
|
110
|
+
console.log(colors.muted("No specification is active. Run 'specforge spec activate <specId>' to set one."));
|
|
111
|
+
printBlank();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Register spec activate/deactivate commands with Commander
|
|
116
|
+
*/
|
|
117
|
+
export function registerSpecActivateCommand(program) {
|
|
118
|
+
const spec = program
|
|
119
|
+
.command('spec')
|
|
120
|
+
.description('Manage active specification for Agent Teams');
|
|
121
|
+
spec
|
|
122
|
+
.command('activate <specId>')
|
|
123
|
+
.description('Set active specification for Agent Teams implementation')
|
|
124
|
+
.option('--json', 'Output in JSON format')
|
|
125
|
+
.addHelpText('after', `
|
|
126
|
+
Arguments:
|
|
127
|
+
specId Specification ID to activate
|
|
128
|
+
|
|
129
|
+
Examples:
|
|
130
|
+
$ specforge spec activate ff1f8edb-4976-458b-acb0-b0860cd9a60d
|
|
131
|
+
$ specforge spec activate ff1f8edb --json
|
|
132
|
+
|
|
133
|
+
The active specification is stored in .specforge.json and tells Agent Teams
|
|
134
|
+
which specification to implement when you say "implement the active spec".
|
|
135
|
+
|
|
136
|
+
Use 'specforge specs' to list available specifications.
|
|
137
|
+
Use 'specforge spec deactivate' to clear the active specification.
|
|
138
|
+
`)
|
|
139
|
+
.action(withErrorHandler(specActivateAction));
|
|
140
|
+
spec
|
|
141
|
+
.command('deactivate')
|
|
142
|
+
.description('Clear the active specification')
|
|
143
|
+
.option('--json', 'Output in JSON format')
|
|
144
|
+
.addHelpText('after', `
|
|
145
|
+
Examples:
|
|
146
|
+
$ specforge spec deactivate
|
|
147
|
+
$ specforge spec deactivate --json
|
|
148
|
+
|
|
149
|
+
Removes the activeSpecification section from .specforge.json.
|
|
150
|
+
`)
|
|
151
|
+
.action(withErrorHandler(async (options) => {
|
|
152
|
+
await specDeactivateAction(options);
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=spec-activate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-activate.js","sourceRoot":"","sources":["../../../src/cli/commands/spec-activate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,OAA2B;IAE3B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,eAAe,CACvB,8BAA8B,EAC9B,yCAAyC,CAC1C,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,QAAQ,CAChB,mBAAmB,EACnB,CAAC,EACD,6CAA6C,CAC9C,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC;QAClB,IAAI,EAAE,6BAA6B;QACnC,KAAK,EAAE,MAAM;KACd,CAAC,CAAC,KAAK,EAAE,CAAC;IAEX,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,SAAS,C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CAAC,gBAAgB,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAC7D,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec Activate Command Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the spec activate/deactivate commands
|
|
5
|
+
* that manage the active specification in .specforge.json.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Specification summary from get_specification API (summary mode)
|
|
9
|
+
*/
|
|
10
|
+
export interface SpecificationSummary {
|
|
11
|
+
/** Specification ID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Specification title */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Current status */
|
|
16
|
+
status: string;
|
|
17
|
+
/** Number of epics */
|
|
18
|
+
epicCount?: number;
|
|
19
|
+
/** Total number of tickets */
|
|
20
|
+
ticketCount?: number;
|
|
21
|
+
/** Number of completed tickets */
|
|
22
|
+
completedTicketCount?: number;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=spec-activate.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-activate.types.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/spec-activate.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-activate.types.js","sourceRoot":"","sources":["../../../src/cli/commands/spec-activate.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,OAAO,EACL,aAAa,EAad,MAAM,mBAAmB,CAAC;AAmO3B;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAsIxE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2C5D"}
|