@clawplays/ospec-cli 0.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/.ospec/templates/hooks/post-merge +8 -0
- package/.ospec/templates/hooks/pre-commit +8 -0
- package/LICENSE +21 -0
- package/README.md +549 -0
- package/README.zh-CN.md +549 -0
- package/assets/for-ai/en-US/ai-guide.md +98 -0
- package/assets/for-ai/en-US/execution-protocol.md +64 -0
- package/assets/for-ai/zh-CN/ai-guide.md +102 -0
- package/assets/for-ai/zh-CN/execution-protocol.md +68 -0
- package/assets/git-hooks/post-merge +12 -0
- package/assets/git-hooks/pre-commit +12 -0
- package/assets/global-skills/claude/ospec-change/SKILL.md +116 -0
- package/assets/global-skills/codex/ospec-change/SKILL.md +117 -0
- package/assets/global-skills/codex/ospec-change/agents/openai.yaml +7 -0
- package/assets/global-skills/codex/ospec-change/skill.yaml +19 -0
- package/assets/project-conventions/en-US/development-guide.md +32 -0
- package/assets/project-conventions/en-US/naming-conventions.md +51 -0
- package/assets/project-conventions/en-US/skill-conventions.md +40 -0
- package/assets/project-conventions/en-US/workflow-conventions.md +70 -0
- package/assets/project-conventions/zh-CN/development-guide.md +32 -0
- package/assets/project-conventions/zh-CN/naming-conventions.md +51 -0
- package/assets/project-conventions/zh-CN/skill-conventions.md +40 -0
- package/assets/project-conventions/zh-CN/workflow-conventions.md +74 -0
- package/dist/adapters/codex-stitch-adapter.js +420 -0
- package/dist/adapters/gemini-stitch-adapter.js +408 -0
- package/dist/adapters/playwright-checkpoint-adapter.js +2260 -0
- package/dist/advanced/BatchOperations.d.ts +36 -0
- package/dist/advanced/BatchOperations.js +159 -0
- package/dist/advanced/CachingLayer.d.ts +66 -0
- package/dist/advanced/CachingLayer.js +136 -0
- package/dist/advanced/FeatureUpdater.d.ts +46 -0
- package/dist/advanced/FeatureUpdater.js +151 -0
- package/dist/advanced/PerformanceMonitor.d.ts +52 -0
- package/dist/advanced/PerformanceMonitor.js +129 -0
- package/dist/advanced/StatePersistence.d.ts +61 -0
- package/dist/advanced/StatePersistence.js +168 -0
- package/dist/advanced/index.d.ts +14 -0
- package/dist/advanced/index.js +22 -0
- package/dist/cli/commands/config.d.ts +5 -0
- package/dist/cli/commands/config.js +6 -0
- package/dist/cli/commands/feature.d.ts +5 -0
- package/dist/cli/commands/feature.js +6 -0
- package/dist/cli/commands/index.d.ts +5 -0
- package/dist/cli/commands/index.js +6 -0
- package/dist/cli/commands/project.d.ts +5 -0
- package/dist/cli/commands/project.js +6 -0
- package/dist/cli/commands/validate.d.ts +5 -0
- package/dist/cli/commands/validate.js +6 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +1007 -0
- package/dist/commands/ArchiveCommand.d.ts +14 -0
- package/dist/commands/ArchiveCommand.js +241 -0
- package/dist/commands/BaseCommand.d.ts +33 -0
- package/dist/commands/BaseCommand.js +46 -0
- package/dist/commands/BatchCommand.d.ts +5 -0
- package/dist/commands/BatchCommand.js +42 -0
- package/dist/commands/ChangesCommand.d.ts +3 -0
- package/dist/commands/ChangesCommand.js +71 -0
- package/dist/commands/DocsCommand.d.ts +5 -0
- package/dist/commands/DocsCommand.js +118 -0
- package/dist/commands/FinalizeCommand.d.ts +3 -0
- package/dist/commands/FinalizeCommand.js +24 -0
- package/dist/commands/IndexCommand.d.ts +5 -0
- package/dist/commands/IndexCommand.js +57 -0
- package/dist/commands/InitCommand.d.ts +5 -0
- package/dist/commands/InitCommand.js +65 -0
- package/dist/commands/NewCommand.d.ts +11 -0
- package/dist/commands/NewCommand.js +262 -0
- package/dist/commands/PluginsCommand.d.ts +58 -0
- package/dist/commands/PluginsCommand.js +2491 -0
- package/dist/commands/ProgressCommand.d.ts +5 -0
- package/dist/commands/ProgressCommand.js +103 -0
- package/dist/commands/QueueCommand.d.ts +10 -0
- package/dist/commands/QueueCommand.js +147 -0
- package/dist/commands/RunCommand.d.ts +13 -0
- package/dist/commands/RunCommand.js +200 -0
- package/dist/commands/SkillCommand.d.ts +31 -0
- package/dist/commands/SkillCommand.js +1216 -0
- package/dist/commands/SkillsCommand.d.ts +5 -0
- package/dist/commands/SkillsCommand.js +68 -0
- package/dist/commands/StatusCommand.d.ts +6 -0
- package/dist/commands/StatusCommand.js +140 -0
- package/dist/commands/UpdateCommand.d.ts +8 -0
- package/dist/commands/UpdateCommand.js +251 -0
- package/dist/commands/VerifyCommand.d.ts +5 -0
- package/dist/commands/VerifyCommand.js +278 -0
- package/dist/commands/WorkflowCommand.d.ts +12 -0
- package/dist/commands/WorkflowCommand.js +150 -0
- package/dist/commands/index.d.ts +43 -0
- package/dist/commands/index.js +85 -0
- package/dist/core/constants.d.ts +41 -0
- package/dist/core/constants.js +73 -0
- package/dist/core/errors.d.ts +36 -0
- package/dist/core/errors.js +72 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +23 -0
- package/dist/core/types.d.ts +369 -0
- package/dist/core/types.js +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +27 -0
- package/dist/presets/ProjectPresets.d.ts +41 -0
- package/dist/presets/ProjectPresets.js +190 -0
- package/dist/scaffolds/ProjectScaffoldPresets.d.ts +20 -0
- package/dist/scaffolds/ProjectScaffoldPresets.js +151 -0
- package/dist/services/ConfigManager.d.ts +14 -0
- package/dist/services/ConfigManager.js +386 -0
- package/dist/services/FeatureManager.d.ts +5 -0
- package/dist/services/FeatureManager.js +6 -0
- package/dist/services/FileService.d.ts +21 -0
- package/dist/services/FileService.js +152 -0
- package/dist/services/IndexBuilder.d.ts +12 -0
- package/dist/services/IndexBuilder.js +130 -0
- package/dist/services/Logger.d.ts +20 -0
- package/dist/services/Logger.js +48 -0
- package/dist/services/ProjectAssetRegistry.d.ts +12 -0
- package/dist/services/ProjectAssetRegistry.js +96 -0
- package/dist/services/ProjectAssetService.d.ts +49 -0
- package/dist/services/ProjectAssetService.js +223 -0
- package/dist/services/ProjectScaffoldCommandService.d.ts +73 -0
- package/dist/services/ProjectScaffoldCommandService.js +159 -0
- package/dist/services/ProjectScaffoldService.d.ts +44 -0
- package/dist/services/ProjectScaffoldService.js +507 -0
- package/dist/services/ProjectService.d.ts +209 -0
- package/dist/services/ProjectService.js +13239 -0
- package/dist/services/QueueService.d.ts +17 -0
- package/dist/services/QueueService.js +142 -0
- package/dist/services/RunService.d.ts +40 -0
- package/dist/services/RunService.js +420 -0
- package/dist/services/SkillParser.d.ts +30 -0
- package/dist/services/SkillParser.js +88 -0
- package/dist/services/StateManager.d.ts +16 -0
- package/dist/services/StateManager.js +127 -0
- package/dist/services/TemplateEngine.d.ts +43 -0
- package/dist/services/TemplateEngine.js +119 -0
- package/dist/services/TemplateGenerator.d.ts +40 -0
- package/dist/services/TemplateGenerator.js +273 -0
- package/dist/services/ValidationService.d.ts +19 -0
- package/dist/services/ValidationService.js +44 -0
- package/dist/services/Validator.d.ts +5 -0
- package/dist/services/Validator.js +6 -0
- package/dist/services/index.d.ts +52 -0
- package/dist/services/index.js +91 -0
- package/dist/services/templates/ExecutionTemplateBuilder.d.ts +12 -0
- package/dist/services/templates/ExecutionTemplateBuilder.js +300 -0
- package/dist/services/templates/ProjectTemplateBuilder.d.ts +38 -0
- package/dist/services/templates/ProjectTemplateBuilder.js +1897 -0
- package/dist/services/templates/TemplateBuilderBase.d.ts +19 -0
- package/dist/services/templates/TemplateBuilderBase.js +60 -0
- package/dist/services/templates/TemplateInputFactory.d.ts +16 -0
- package/dist/services/templates/TemplateInputFactory.js +298 -0
- package/dist/services/templates/templateTypes.d.ts +90 -0
- package/dist/services/templates/templateTypes.js +3 -0
- package/dist/tools/build-index.js +632 -0
- package/dist/utils/DateUtils.d.ts +18 -0
- package/dist/utils/DateUtils.js +40 -0
- package/dist/utils/PathUtils.d.ts +9 -0
- package/dist/utils/PathUtils.js +66 -0
- package/dist/utils/StringUtils.d.ts +26 -0
- package/dist/utils/StringUtils.js +47 -0
- package/dist/utils/helpers.d.ts +5 -0
- package/dist/utils/helpers.js +6 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +23 -0
- package/dist/utils/logger.d.ts +5 -0
- package/dist/utils/logger.js +6 -0
- package/dist/utils/path.d.ts +5 -0
- package/dist/utils/path.js +6 -0
- package/dist/utils/subcommandHelp.d.ts +11 -0
- package/dist/utils/subcommandHelp.js +119 -0
- package/dist/workflow/ArchiveGate.d.ts +30 -0
- package/dist/workflow/ArchiveGate.js +93 -0
- package/dist/workflow/ConfigurableWorkflow.d.ts +89 -0
- package/dist/workflow/ConfigurableWorkflow.js +186 -0
- package/dist/workflow/HookSystem.d.ts +38 -0
- package/dist/workflow/HookSystem.js +66 -0
- package/dist/workflow/IndexRegenerator.d.ts +49 -0
- package/dist/workflow/IndexRegenerator.js +147 -0
- package/dist/workflow/PluginWorkflowComposer.d.ts +138 -0
- package/dist/workflow/PluginWorkflowComposer.js +239 -0
- package/dist/workflow/SkillUpdateEngine.d.ts +26 -0
- package/dist/workflow/SkillUpdateEngine.js +113 -0
- package/dist/workflow/VerificationSystem.d.ts +24 -0
- package/dist/workflow/VerificationSystem.js +116 -0
- package/dist/workflow/WorkflowEngine.d.ts +15 -0
- package/dist/workflow/WorkflowEngine.js +57 -0
- package/dist/workflow/index.d.ts +19 -0
- package/dist/workflow/index.js +32 -0
- package/package.json +78 -0
- package/scripts/postinstall.js +43 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,1007 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Object.defineProperty(o, k2, desc);
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
}) : (function(o, m, k, k2) {
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if (k2 === undefined) k2 = k;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
o[k2] = m[k];
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
}) : function(o, v) {
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
o["default"] = v;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
var ownKeys = function(o) {
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
var ar = [];
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
return ar;
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
return ownKeys(o);
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
return function (mod) {
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
if (mod && mod.__esModule) return mod;
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
var result = {};
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
__setModuleDefault(result, mod);
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
return result;
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
})();
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
const process = __importStar(require("process"));
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
const ArchiveCommand_1 = require("./commands/ArchiveCommand");
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
const BatchCommand_1 = require("./commands/BatchCommand");
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
const ChangesCommand_1 = require("./commands/ChangesCommand");
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
const DocsCommand_1 = require("./commands/DocsCommand");
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
const FinalizeCommand_1 = require("./commands/FinalizeCommand");
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
const IndexCommand_1 = require("./commands/IndexCommand");
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
const InitCommand_1 = require("./commands/InitCommand");
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
const NewCommand_1 = require("./commands/NewCommand");
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
const QueueCommand_1 = require("./commands/QueueCommand");
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
const ProgressCommand_1 = require("./commands/ProgressCommand");
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
const PluginsCommand_1 = require("./commands/PluginsCommand");
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
const UpdateCommand_1 = require("./commands/UpdateCommand");
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
const SkillCommand_1 = require("./commands/SkillCommand");
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
const SkillsCommand_1 = require("./commands/SkillsCommand");
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
const StatusCommand_1 = require("./commands/StatusCommand");
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
const RunCommand_1 = require("./commands/RunCommand");
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
const VerifyCommand_1 = require("./commands/VerifyCommand");
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
const WorkflowCommand_1 = require("./commands/WorkflowCommand");
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
const services_1 = require("./services");
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
const CLI_VERSION = '0.1.1';
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
function parseNewCommandArgs(commandArgs) {
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
const featureName = commandArgs[0];
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
let rootDir;
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
const flags = [];
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
for (let index = 1; index < commandArgs.length; index += 1) {
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
const arg = commandArgs[index];
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
if (arg === '--flags') {
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
const rawFlags = commandArgs[index + 1];
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
if (!rawFlags || rawFlags.startsWith('--')) {
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
console.error('Usage: ospec new <change-name> [root-dir] [--flags flag1,flag2]');
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
process.exit(1);
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
flags.push(...rawFlags.split(',').map(flag => flag.trim()).filter(Boolean));
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
index += 1;
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
continue;
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
if (arg.startsWith('--flags=')) {
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
flags.push(...arg.slice('--flags='.length).split(',').map(flag => flag.trim()).filter(Boolean));
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
continue;
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
if (arg.startsWith('--')) {
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
console.error(`Unknown option for new: ${arg}`);
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
console.error('Usage: ospec new <change-name> [root-dir] [--flags flag1,flag2]');
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
process.exit(1);
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
if (!rootDir) {
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
rootDir = arg;
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
continue;
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
console.error(`Unexpected argument for new: ${arg}`);
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
console.error('Usage: ospec new <change-name> [root-dir] [--flags flag1,flag2]');
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
process.exit(1);
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
return {
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
featureName,
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
rootDir,
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
flags: Array.from(new Set(flags)),
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
async function main() {
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
try {
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
const args = process.argv.slice(2);
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
if (args.length === 0) {
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
showHelp();
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
return;
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
const command = args[0];
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
const commandArgs = args.slice(1);
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
switch (command) {
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
case 'init': {
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
const initCmd = new InitCommand_1.InitCommand();
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
await initCmd.execute(commandArgs[0]);
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
break;
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
case 'new': {
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
if (commandArgs.length === 0) {
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
console.error('Error: change name is required');
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
console.log('Usage: ospec new <change-name> [root-dir] [--flags flag1,flag2]');
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
process.exit(1);
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
const { featureName, rootDir, flags } = parseNewCommandArgs(commandArgs);
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
const newCmd = new NewCommand_1.NewCommand();
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
await newCmd.execute(featureName, rootDir, { flags });
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
break;
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
case 'verify': {
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
const verifyCmd = new VerifyCommand_1.VerifyCommand();
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
await verifyCmd.execute(commandArgs[0]);
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
break;
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
case 'progress': {
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
const progressCmd = new ProgressCommand_1.ProgressCommand();
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
await progressCmd.execute(commandArgs[0]);
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
break;
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
case 'archive': {
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
const checkOnly = commandArgs.includes('--check');
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
const archiveArgs = commandArgs.filter(arg => arg !== '--check');
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
const archiveCmd = new ArchiveCommand_1.ArchiveCommand();
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
await archiveCmd.execute(archiveArgs[0], { checkOnly });
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
break;
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
case 'finalize': {
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
const finalizeCmd = new FinalizeCommand_1.FinalizeCommand();
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
await finalizeCmd.execute(commandArgs[0]);
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
break;
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
case 'status': {
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
const statusCmd = new StatusCommand_1.StatusCommand();
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
await statusCmd.execute(commandArgs[0]);
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
break;
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
case 'batch': {
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
if (commandArgs.length === 0) {
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
console.error('Error: batch action is required');
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
console.log('Usage: ospec batch <action> [root-dir]');
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
process.exit(1);
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
const batchCmd = new BatchCommand_1.BatchCommand();
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
await batchCmd.execute(commandArgs[0], commandArgs[1]);
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
break;
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
case 'changes': {
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
const changesCmd = new ChangesCommand_1.ChangesCommand();
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
await changesCmd.execute(commandArgs[0] || 'status', commandArgs[1]);
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
break;
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
case 'queue': {
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
const queueCmd = new QueueCommand_1.QueueCommand();
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
await queueCmd.execute(commandArgs[0] || 'status', ...commandArgs.slice(1));
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
break;
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
case 'run': {
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
const runCmd = new RunCommand_1.RunCommand();
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
await runCmd.execute(commandArgs[0] || 'status', ...commandArgs.slice(1));
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
break;
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
case 'docs': {
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
const docsCmd = new DocsCommand_1.DocsCommand();
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
await docsCmd.execute(commandArgs[0] || 'status', commandArgs[1]);
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
break;
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
case 'skills': {
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
const skillsCmd = new SkillsCommand_1.SkillsCommand();
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
await skillsCmd.execute(commandArgs[0] || 'status', commandArgs[1]);
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
break;
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
case 'skill': {
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
const skillCmd = new SkillCommand_1.SkillCommand();
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
await skillCmd.execute(commandArgs[0] || 'status', commandArgs[1], commandArgs[2]);
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
break;
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
case 'index': {
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
const indexCmd = new IndexCommand_1.IndexCommand();
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
await indexCmd.execute(commandArgs[0] || 'check', commandArgs[1]);
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
break;
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
case 'plugins': {
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
const pluginsCmd = new PluginsCommand_1.PluginsCommand();
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
await pluginsCmd.execute(commandArgs[0] || 'status', ...commandArgs.slice(1));
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
break;
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
case 'workflow': {
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
const workflowCmd = new WorkflowCommand_1.WorkflowCommand();
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
await workflowCmd.execute(commandArgs[0] || 'show', ...commandArgs.slice(1));
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
break;
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
case 'update': {
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
const updateCmd = new UpdateCommand_1.UpdateCommand();
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
await updateCmd.execute(commandArgs[0]);
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
break;
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
case 'help':
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
case '-h':
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
case '--help':
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
showHelp();
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
break;
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
case 'version':
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
case '-v':
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
case '--version':
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
console.log(`OSpec CLI v${CLI_VERSION}`);
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
break;
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
default:
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
console.error(`Unknown command: ${command}`);
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
showHelp();
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
process.exit(1);
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
catch (error) {
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
services_1.services.logger.error('CLI Error:', error);
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
process.exit(1);
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
function showHelp() {
|
|
924
|
+
console.log(`
|
|
925
|
+
OSpec CLI v${CLI_VERSION}
|
|
926
|
+
|
|
927
|
+
Usage: ospec <command> [options]
|
|
928
|
+
|
|
929
|
+
Commands:
|
|
930
|
+
init [root-dir] Initialize the OSpec protocol shell
|
|
931
|
+
new <change-name> [root] Create a new change (supports --flags)
|
|
932
|
+
verify [path] Verify change completion
|
|
933
|
+
progress [path] Show workflow progress
|
|
934
|
+
archive [path] [--check] Archive a ready change or only check readiness
|
|
935
|
+
status [path] Show project status
|
|
936
|
+
finalize [path] Verify a completed change and archive it before commit
|
|
937
|
+
batch <action> [path] Batch operations (export, stats)
|
|
938
|
+
changes [action] [path] Active change summaries (status)
|
|
939
|
+
queue [action] [path] Explicit queue helpers (status, add, activate, next)
|
|
940
|
+
run [action] [path] Explicit queue runner helpers (start, status, step, resume, stop)
|
|
941
|
+
docs [action] [path] Docs helpers (status, generate)
|
|
942
|
+
skills [action] [path] Skills status helpers (status)
|
|
943
|
+
plugins [action] [path] Plugin helpers (list, status, enable, disable, approve, reject)
|
|
944
|
+
skill [action] [skill] [dir] Skill package helpers (default skill is ospec-change)
|
|
945
|
+
index [action] [path] Index helpers (check, build)
|
|
946
|
+
workflow [action] Workflow configuration (show, list-flags)
|
|
947
|
+
update [path] Refresh protocol docs, tooling, hooks, and installed skills; does not enable or migrate plugins
|
|
948
|
+
help, -h, --help Show this help message
|
|
949
|
+
version, -v, --version Show version
|
|
950
|
+
|
|
951
|
+
Examples:
|
|
952
|
+
ospec init
|
|
953
|
+
ospec new onboarding-flow
|
|
954
|
+
ospec new landing-refresh . --flags ui_change,page_design
|
|
955
|
+
ospec verify ./changes/active/onboarding-flow
|
|
956
|
+
ospec progress ./changes/active/onboarding-flow
|
|
957
|
+
ospec archive ./changes/active/onboarding-flow
|
|
958
|
+
ospec archive ./changes/active/onboarding-flow --check
|
|
959
|
+
ospec finalize ./changes/active/onboarding-flow
|
|
960
|
+
ospec status
|
|
961
|
+
ospec queue add login-refresh . --flags ui_change
|
|
962
|
+
ospec queue status
|
|
963
|
+
ospec queue next
|
|
964
|
+
ospec run start . --profile manual-safe
|
|
965
|
+
ospec run step
|
|
966
|
+
ospec docs status
|
|
967
|
+
ospec docs generate
|
|
968
|
+
ospec docs sync-protocol
|
|
969
|
+
ospec skills status
|
|
970
|
+
ospec plugins status
|
|
971
|
+
ospec plugins enable stitch
|
|
972
|
+
ospec plugins enable checkpoint . --base-url http://127.0.0.1:3000
|
|
973
|
+
ospec plugins run checkpoint ./changes/active/onboarding-flow
|
|
974
|
+
ospec plugins approve stitch ./changes/active/onboarding-flow
|
|
975
|
+
ospec skill status
|
|
976
|
+
ospec skill install
|
|
977
|
+
ospec skill install ospec-init
|
|
978
|
+
ospec skill status-claude
|
|
979
|
+
ospec skill install-claude
|
|
980
|
+
ospec index build
|
|
981
|
+
ospec batch stats
|
|
982
|
+
ospec changes status
|
|
983
|
+
ospec workflow show
|
|
984
|
+
ospec workflow set-mode full
|
|
985
|
+
ospec update .
|
|
986
|
+
`);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
main().catch(error => {
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
console.error('Fatal error:', error);
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
process.exit(1);
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
//# sourceMappingURL=cli.js.map
|