@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.
Files changed (191) hide show
  1. package/.ospec/templates/hooks/post-merge +8 -0
  2. package/.ospec/templates/hooks/pre-commit +8 -0
  3. package/LICENSE +21 -0
  4. package/README.md +549 -0
  5. package/README.zh-CN.md +549 -0
  6. package/assets/for-ai/en-US/ai-guide.md +98 -0
  7. package/assets/for-ai/en-US/execution-protocol.md +64 -0
  8. package/assets/for-ai/zh-CN/ai-guide.md +102 -0
  9. package/assets/for-ai/zh-CN/execution-protocol.md +68 -0
  10. package/assets/git-hooks/post-merge +12 -0
  11. package/assets/git-hooks/pre-commit +12 -0
  12. package/assets/global-skills/claude/ospec-change/SKILL.md +116 -0
  13. package/assets/global-skills/codex/ospec-change/SKILL.md +117 -0
  14. package/assets/global-skills/codex/ospec-change/agents/openai.yaml +7 -0
  15. package/assets/global-skills/codex/ospec-change/skill.yaml +19 -0
  16. package/assets/project-conventions/en-US/development-guide.md +32 -0
  17. package/assets/project-conventions/en-US/naming-conventions.md +51 -0
  18. package/assets/project-conventions/en-US/skill-conventions.md +40 -0
  19. package/assets/project-conventions/en-US/workflow-conventions.md +70 -0
  20. package/assets/project-conventions/zh-CN/development-guide.md +32 -0
  21. package/assets/project-conventions/zh-CN/naming-conventions.md +51 -0
  22. package/assets/project-conventions/zh-CN/skill-conventions.md +40 -0
  23. package/assets/project-conventions/zh-CN/workflow-conventions.md +74 -0
  24. package/dist/adapters/codex-stitch-adapter.js +420 -0
  25. package/dist/adapters/gemini-stitch-adapter.js +408 -0
  26. package/dist/adapters/playwright-checkpoint-adapter.js +2260 -0
  27. package/dist/advanced/BatchOperations.d.ts +36 -0
  28. package/dist/advanced/BatchOperations.js +159 -0
  29. package/dist/advanced/CachingLayer.d.ts +66 -0
  30. package/dist/advanced/CachingLayer.js +136 -0
  31. package/dist/advanced/FeatureUpdater.d.ts +46 -0
  32. package/dist/advanced/FeatureUpdater.js +151 -0
  33. package/dist/advanced/PerformanceMonitor.d.ts +52 -0
  34. package/dist/advanced/PerformanceMonitor.js +129 -0
  35. package/dist/advanced/StatePersistence.d.ts +61 -0
  36. package/dist/advanced/StatePersistence.js +168 -0
  37. package/dist/advanced/index.d.ts +14 -0
  38. package/dist/advanced/index.js +22 -0
  39. package/dist/cli/commands/config.d.ts +5 -0
  40. package/dist/cli/commands/config.js +6 -0
  41. package/dist/cli/commands/feature.d.ts +5 -0
  42. package/dist/cli/commands/feature.js +6 -0
  43. package/dist/cli/commands/index.d.ts +5 -0
  44. package/dist/cli/commands/index.js +6 -0
  45. package/dist/cli/commands/project.d.ts +5 -0
  46. package/dist/cli/commands/project.js +6 -0
  47. package/dist/cli/commands/validate.d.ts +5 -0
  48. package/dist/cli/commands/validate.js +6 -0
  49. package/dist/cli/index.d.ts +5 -0
  50. package/dist/cli/index.js +6 -0
  51. package/dist/cli.d.ts +3 -0
  52. package/dist/cli.js +1007 -0
  53. package/dist/commands/ArchiveCommand.d.ts +14 -0
  54. package/dist/commands/ArchiveCommand.js +241 -0
  55. package/dist/commands/BaseCommand.d.ts +33 -0
  56. package/dist/commands/BaseCommand.js +46 -0
  57. package/dist/commands/BatchCommand.d.ts +5 -0
  58. package/dist/commands/BatchCommand.js +42 -0
  59. package/dist/commands/ChangesCommand.d.ts +3 -0
  60. package/dist/commands/ChangesCommand.js +71 -0
  61. package/dist/commands/DocsCommand.d.ts +5 -0
  62. package/dist/commands/DocsCommand.js +118 -0
  63. package/dist/commands/FinalizeCommand.d.ts +3 -0
  64. package/dist/commands/FinalizeCommand.js +24 -0
  65. package/dist/commands/IndexCommand.d.ts +5 -0
  66. package/dist/commands/IndexCommand.js +57 -0
  67. package/dist/commands/InitCommand.d.ts +5 -0
  68. package/dist/commands/InitCommand.js +65 -0
  69. package/dist/commands/NewCommand.d.ts +11 -0
  70. package/dist/commands/NewCommand.js +262 -0
  71. package/dist/commands/PluginsCommand.d.ts +58 -0
  72. package/dist/commands/PluginsCommand.js +2491 -0
  73. package/dist/commands/ProgressCommand.d.ts +5 -0
  74. package/dist/commands/ProgressCommand.js +103 -0
  75. package/dist/commands/QueueCommand.d.ts +10 -0
  76. package/dist/commands/QueueCommand.js +147 -0
  77. package/dist/commands/RunCommand.d.ts +13 -0
  78. package/dist/commands/RunCommand.js +200 -0
  79. package/dist/commands/SkillCommand.d.ts +31 -0
  80. package/dist/commands/SkillCommand.js +1216 -0
  81. package/dist/commands/SkillsCommand.d.ts +5 -0
  82. package/dist/commands/SkillsCommand.js +68 -0
  83. package/dist/commands/StatusCommand.d.ts +6 -0
  84. package/dist/commands/StatusCommand.js +140 -0
  85. package/dist/commands/UpdateCommand.d.ts +8 -0
  86. package/dist/commands/UpdateCommand.js +251 -0
  87. package/dist/commands/VerifyCommand.d.ts +5 -0
  88. package/dist/commands/VerifyCommand.js +278 -0
  89. package/dist/commands/WorkflowCommand.d.ts +12 -0
  90. package/dist/commands/WorkflowCommand.js +150 -0
  91. package/dist/commands/index.d.ts +43 -0
  92. package/dist/commands/index.js +85 -0
  93. package/dist/core/constants.d.ts +41 -0
  94. package/dist/core/constants.js +73 -0
  95. package/dist/core/errors.d.ts +36 -0
  96. package/dist/core/errors.js +72 -0
  97. package/dist/core/index.d.ts +7 -0
  98. package/dist/core/index.js +23 -0
  99. package/dist/core/types.d.ts +369 -0
  100. package/dist/core/types.js +3 -0
  101. package/dist/index.d.ts +11 -0
  102. package/dist/index.js +27 -0
  103. package/dist/presets/ProjectPresets.d.ts +41 -0
  104. package/dist/presets/ProjectPresets.js +190 -0
  105. package/dist/scaffolds/ProjectScaffoldPresets.d.ts +20 -0
  106. package/dist/scaffolds/ProjectScaffoldPresets.js +151 -0
  107. package/dist/services/ConfigManager.d.ts +14 -0
  108. package/dist/services/ConfigManager.js +386 -0
  109. package/dist/services/FeatureManager.d.ts +5 -0
  110. package/dist/services/FeatureManager.js +6 -0
  111. package/dist/services/FileService.d.ts +21 -0
  112. package/dist/services/FileService.js +152 -0
  113. package/dist/services/IndexBuilder.d.ts +12 -0
  114. package/dist/services/IndexBuilder.js +130 -0
  115. package/dist/services/Logger.d.ts +20 -0
  116. package/dist/services/Logger.js +48 -0
  117. package/dist/services/ProjectAssetRegistry.d.ts +12 -0
  118. package/dist/services/ProjectAssetRegistry.js +96 -0
  119. package/dist/services/ProjectAssetService.d.ts +49 -0
  120. package/dist/services/ProjectAssetService.js +223 -0
  121. package/dist/services/ProjectScaffoldCommandService.d.ts +73 -0
  122. package/dist/services/ProjectScaffoldCommandService.js +159 -0
  123. package/dist/services/ProjectScaffoldService.d.ts +44 -0
  124. package/dist/services/ProjectScaffoldService.js +507 -0
  125. package/dist/services/ProjectService.d.ts +209 -0
  126. package/dist/services/ProjectService.js +13239 -0
  127. package/dist/services/QueueService.d.ts +17 -0
  128. package/dist/services/QueueService.js +142 -0
  129. package/dist/services/RunService.d.ts +40 -0
  130. package/dist/services/RunService.js +420 -0
  131. package/dist/services/SkillParser.d.ts +30 -0
  132. package/dist/services/SkillParser.js +88 -0
  133. package/dist/services/StateManager.d.ts +16 -0
  134. package/dist/services/StateManager.js +127 -0
  135. package/dist/services/TemplateEngine.d.ts +43 -0
  136. package/dist/services/TemplateEngine.js +119 -0
  137. package/dist/services/TemplateGenerator.d.ts +40 -0
  138. package/dist/services/TemplateGenerator.js +273 -0
  139. package/dist/services/ValidationService.d.ts +19 -0
  140. package/dist/services/ValidationService.js +44 -0
  141. package/dist/services/Validator.d.ts +5 -0
  142. package/dist/services/Validator.js +6 -0
  143. package/dist/services/index.d.ts +52 -0
  144. package/dist/services/index.js +91 -0
  145. package/dist/services/templates/ExecutionTemplateBuilder.d.ts +12 -0
  146. package/dist/services/templates/ExecutionTemplateBuilder.js +300 -0
  147. package/dist/services/templates/ProjectTemplateBuilder.d.ts +38 -0
  148. package/dist/services/templates/ProjectTemplateBuilder.js +1897 -0
  149. package/dist/services/templates/TemplateBuilderBase.d.ts +19 -0
  150. package/dist/services/templates/TemplateBuilderBase.js +60 -0
  151. package/dist/services/templates/TemplateInputFactory.d.ts +16 -0
  152. package/dist/services/templates/TemplateInputFactory.js +298 -0
  153. package/dist/services/templates/templateTypes.d.ts +90 -0
  154. package/dist/services/templates/templateTypes.js +3 -0
  155. package/dist/tools/build-index.js +632 -0
  156. package/dist/utils/DateUtils.d.ts +18 -0
  157. package/dist/utils/DateUtils.js +40 -0
  158. package/dist/utils/PathUtils.d.ts +9 -0
  159. package/dist/utils/PathUtils.js +66 -0
  160. package/dist/utils/StringUtils.d.ts +26 -0
  161. package/dist/utils/StringUtils.js +47 -0
  162. package/dist/utils/helpers.d.ts +5 -0
  163. package/dist/utils/helpers.js +6 -0
  164. package/dist/utils/index.d.ts +7 -0
  165. package/dist/utils/index.js +23 -0
  166. package/dist/utils/logger.d.ts +5 -0
  167. package/dist/utils/logger.js +6 -0
  168. package/dist/utils/path.d.ts +5 -0
  169. package/dist/utils/path.js +6 -0
  170. package/dist/utils/subcommandHelp.d.ts +11 -0
  171. package/dist/utils/subcommandHelp.js +119 -0
  172. package/dist/workflow/ArchiveGate.d.ts +30 -0
  173. package/dist/workflow/ArchiveGate.js +93 -0
  174. package/dist/workflow/ConfigurableWorkflow.d.ts +89 -0
  175. package/dist/workflow/ConfigurableWorkflow.js +186 -0
  176. package/dist/workflow/HookSystem.d.ts +38 -0
  177. package/dist/workflow/HookSystem.js +66 -0
  178. package/dist/workflow/IndexRegenerator.d.ts +49 -0
  179. package/dist/workflow/IndexRegenerator.js +147 -0
  180. package/dist/workflow/PluginWorkflowComposer.d.ts +138 -0
  181. package/dist/workflow/PluginWorkflowComposer.js +239 -0
  182. package/dist/workflow/SkillUpdateEngine.d.ts +26 -0
  183. package/dist/workflow/SkillUpdateEngine.js +113 -0
  184. package/dist/workflow/VerificationSystem.d.ts +24 -0
  185. package/dist/workflow/VerificationSystem.js +116 -0
  186. package/dist/workflow/WorkflowEngine.d.ts +15 -0
  187. package/dist/workflow/WorkflowEngine.js +57 -0
  188. package/dist/workflow/index.d.ts +19 -0
  189. package/dist/workflow/index.js +32 -0
  190. package/package.json +78 -0
  191. package/scripts/postinstall.js +43 -0
@@ -0,0 +1,5 @@
1
+ import { BaseCommand } from './BaseCommand';
2
+ export declare class ProgressCommand extends BaseCommand {
3
+ execute(featurePath?: string): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=ProgressCommand.d.ts.map
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ProgressCommand = void 0;
37
+ const path = __importStar(require("path"));
38
+ const constants_1 = require("../core/constants");
39
+ const services_1 = require("../services");
40
+ const BaseCommand_1 = require("./BaseCommand");
41
+ class ProgressCommand extends BaseCommand_1.BaseCommand {
42
+ async execute(featurePath) {
43
+ try {
44
+ const targetPath = featurePath || process.cwd();
45
+ this.logger.info(`Checking progress for change at ${targetPath}`);
46
+ const statePath = path.join(targetPath, constants_1.FILE_NAMES.STATE);
47
+ if (!(await services_1.services.fileService.exists(statePath))) {
48
+ throw new Error('Change state file not found.');
49
+ }
50
+ const featureState = await services_1.services.fileService.readJSON(statePath);
51
+ const statuses = [
52
+ 'draft',
53
+ 'proposed',
54
+ 'planned',
55
+ 'implementing',
56
+ 'verifying',
57
+ 'ready_to_archive',
58
+ 'archived',
59
+ ];
60
+ const completedPhases = Math.max(statuses.indexOf(featureState.status), 0);
61
+ const totalPhases = statuses.length - 1;
62
+ const percentage = Math.round((completedPhases / totalPhases) * 100);
63
+ const barLength = 30;
64
+ const filledLength = Math.round((completedPhases / totalPhases) * barLength);
65
+ const bar = '#'.repeat(filledLength) + '-'.repeat(barLength - filledLength);
66
+ console.log('\nWorkflow Progress:');
67
+ console.log('==================\n');
68
+ console.log(`Change: ${featureState.feature}`);
69
+ console.log(`Status: ${featureState.status}`);
70
+ console.log(`Current Step: ${featureState.current_step}\n`);
71
+ console.log(`Progress: [${bar}] ${percentage}%`);
72
+ console.log(`Completed: ${completedPhases}/${totalPhases} phases\n`);
73
+ console.log('Completed Items:');
74
+ if ((featureState.completed || []).length === 0) {
75
+ console.log(' - None');
76
+ }
77
+ else {
78
+ featureState.completed.forEach((step) => {
79
+ console.log(` - ${step}`);
80
+ });
81
+ }
82
+ console.log('\nPending Items:');
83
+ if ((featureState.pending || []).length === 0) {
84
+ console.log(' - None');
85
+ }
86
+ else {
87
+ featureState.pending.slice(0, 5).forEach((step) => {
88
+ console.log(` - ${step}`);
89
+ });
90
+ if (featureState.pending.length > 5) {
91
+ console.log(` ... and ${featureState.pending.length - 5} more`);
92
+ }
93
+ }
94
+ console.log('\n' + '='.repeat(20) + '\n');
95
+ }
96
+ catch (error) {
97
+ this.error(`Failed to check progress: ${error}`);
98
+ throw error;
99
+ }
100
+ }
101
+ }
102
+ exports.ProgressCommand = ProgressCommand;
103
+ //# sourceMappingURL=ProgressCommand.js.map
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from './BaseCommand';
2
+ export declare class QueueCommand extends BaseCommand {
3
+ execute(action?: string, ...args: string[]): Promise<void>;
4
+ private add;
5
+ private showStatus;
6
+ private activate;
7
+ private activateNext;
8
+ private parseAddArgs;
9
+ }
10
+ //# sourceMappingURL=QueueCommand.d.ts.map
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ var __importStar = (this && this.__importStar) || (function () {
3
+ var ownKeys = function(o) {
4
+ ownKeys = Object.getOwnPropertyNames || function (o) {
5
+ var ar = [];
6
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
7
+ return ar;
8
+ };
9
+ return ownKeys(o);
10
+ };
11
+ return function (mod) {
12
+ if (mod && mod.__esModule) return mod;
13
+ var result = {};
14
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") result[k[i]] = mod[k[i]];
15
+ result.default = mod;
16
+ return result;
17
+ };
18
+ })();
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.QueueCommand = void 0;
21
+ const path = __importStar(require("path"));
22
+ const services_1 = require("../services");
23
+ const subcommandHelp_1 = require("../utils/subcommandHelp");
24
+ const BaseCommand_1 = require("./BaseCommand");
25
+ const NewCommand_1 = require("./NewCommand");
26
+ class QueueCommand extends BaseCommand_1.BaseCommand {
27
+ async execute(action = 'status', ...args) {
28
+ try {
29
+ const normalizedAction = action || 'status';
30
+ if ((0, subcommandHelp_1.isHelpAction)(normalizedAction)) {
31
+ this.info((0, subcommandHelp_1.getQueueHelpText)());
32
+ return;
33
+ }
34
+ switch (normalizedAction) {
35
+ case 'status':
36
+ case 'list':
37
+ await this.showStatus(args[0]);
38
+ return;
39
+ case 'add':
40
+ await this.add(args);
41
+ return;
42
+ case 'activate':
43
+ if (!args[0]) {
44
+ console.error('Usage: ospec queue activate <change-name> [path]');
45
+ process.exit(1);
46
+ }
47
+ await this.activate(args[0], args[1]);
48
+ return;
49
+ case 'next':
50
+ await this.activateNext(args[0]);
51
+ return;
52
+ default:
53
+ this.info((0, subcommandHelp_1.getQueueHelpText)());
54
+ }
55
+ }
56
+ catch (error) {
57
+ this.error(`Queue command failed: ${error}`);
58
+ throw error;
59
+ }
60
+ }
61
+ async add(args) {
62
+ const parsed = this.parseAddArgs(args);
63
+ if (!parsed.changeName) {
64
+ console.error('Usage: ospec queue add <change-name> [path] [--flags flag1,flag2]');
65
+ process.exit(1);
66
+ }
67
+ const newCommand = new NewCommand_1.NewCommand();
68
+ await newCommand.execute(parsed.changeName, parsed.projectPath, {
69
+ flags: parsed.flags,
70
+ placement: 'queued',
71
+ source: 'queue',
72
+ });
73
+ }
74
+ async showStatus(rootDir) {
75
+ const targetDir = path.resolve(rootDir || process.cwd());
76
+ const queuedChanges = await services_1.services.queueService.getQueuedChanges(targetDir);
77
+ console.log('\nQueued Changes');
78
+ console.log('==============\n');
79
+ console.log(`Total queued: ${queuedChanges.length}\n`);
80
+ if (queuedChanges.length === 0) {
81
+ console.log('No queued changes.\n');
82
+ return;
83
+ }
84
+ queuedChanges.forEach((change, index) => {
85
+ console.log(`${index + 1}. ${change.name}`);
86
+ console.log(` Path: ${change.path}`);
87
+ console.log(` Status: ${change.status}`);
88
+ console.log(` Current step: ${change.currentStep}`);
89
+ if (change.flags.length > 0) {
90
+ console.log(` Flags: ${change.flags.join(', ')}`);
91
+ }
92
+ console.log(` Queued at: ${change.queuedAt ?? 'unknown'}`);
93
+ console.log(` Source: ${change.source ?? 'unknown'}`);
94
+ console.log('');
95
+ });
96
+ }
97
+ async activate(changeName, rootDir) {
98
+ const targetDir = path.resolve(rootDir || process.cwd());
99
+ const activated = await services_1.services.queueService.activateQueuedChange(targetDir, changeName, 'queue');
100
+ this.success(`Queued change ${changeName} activated at ${activated.path}`);
101
+ }
102
+ async activateNext(rootDir) {
103
+ const targetDir = path.resolve(rootDir || process.cwd());
104
+ const activated = await services_1.services.queueService.activateNextQueuedChange(targetDir, 'queue');
105
+ if (!activated) {
106
+ this.success('No queued changes to activate.');
107
+ return;
108
+ }
109
+ this.success(`Activated next queued change: ${activated.name}`);
110
+ }
111
+ parseAddArgs(args) {
112
+ const changeName = args[0];
113
+ let projectPath;
114
+ const flags = [];
115
+ for (let index = 1; index < args.length; index += 1) {
116
+ const value = args[index];
117
+ if (value === '--flags') {
118
+ const rawFlags = args[index + 1];
119
+ if (!rawFlags || rawFlags.startsWith('--')) {
120
+ throw new Error('Queue add requires a value after --flags.');
121
+ }
122
+ flags.push(...rawFlags.split(',').map(flag => flag.trim()).filter(Boolean));
123
+ index += 1;
124
+ continue;
125
+ }
126
+ if (value.startsWith('--flags=')) {
127
+ flags.push(...value.slice('--flags='.length).split(',').map(flag => flag.trim()).filter(Boolean));
128
+ continue;
129
+ }
130
+ if (value.startsWith('--')) {
131
+ throw new Error(`Unknown queue add flag: ${value}`);
132
+ }
133
+ if (!projectPath) {
134
+ projectPath = value;
135
+ continue;
136
+ }
137
+ throw new Error(`Unexpected queue add argument: ${value}`);
138
+ }
139
+ return {
140
+ changeName,
141
+ projectPath,
142
+ flags: Array.from(new Set(flags)),
143
+ };
144
+ }
145
+ }
146
+ exports.QueueCommand = QueueCommand;
147
+ //# sourceMappingURL=QueueCommand.js.map
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from './BaseCommand';
2
+ export declare class RunCommand extends BaseCommand {
3
+ execute(action?: string, ...args: string[]): Promise<void>;
4
+ private start;
5
+ private status;
6
+ private step;
7
+ private resume;
8
+ private stop;
9
+ private logs;
10
+ private printReport;
11
+ private parseStartArgs;
12
+ }
13
+ //# sourceMappingURL=RunCommand.d.ts.map
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __importStar = (this && this.__importStar) || (function () {
3
+ var ownKeys = function(o) {
4
+ ownKeys = Object.getOwnPropertyNames || function (o) {
5
+ var ar = [];
6
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
7
+ return ar;
8
+ };
9
+ return ownKeys(o);
10
+ };
11
+ return function (mod) {
12
+ if (mod && mod.__esModule) return mod;
13
+ var result = {};
14
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") result[k[i]] = mod[k[i]];
15
+ result.default = mod;
16
+ return result;
17
+ };
18
+ })();
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.RunCommand = void 0;
21
+ const path = __importStar(require("path"));
22
+ const services_1 = require("../services");
23
+ const subcommandHelp_1 = require("../utils/subcommandHelp");
24
+ const BaseCommand_1 = require("./BaseCommand");
25
+ class RunCommand extends BaseCommand_1.BaseCommand {
26
+ async execute(action = 'status', ...args) {
27
+ try {
28
+ const normalizedAction = action || 'status';
29
+ if ((0, subcommandHelp_1.isHelpAction)(normalizedAction)) {
30
+ this.info((0, subcommandHelp_1.getRunHelpText)());
31
+ return;
32
+ }
33
+ switch (normalizedAction) {
34
+ case 'start':
35
+ await this.start(args);
36
+ return;
37
+ case 'status':
38
+ await this.status(args[0]);
39
+ return;
40
+ case 'step':
41
+ case 'tick':
42
+ case 'advance':
43
+ await this.step(args[0]);
44
+ return;
45
+ case 'resume':
46
+ await this.resume(args[0]);
47
+ return;
48
+ case 'stop':
49
+ case 'pause':
50
+ await this.stop(args[0]);
51
+ return;
52
+ case 'logs':
53
+ await this.logs(args[0]);
54
+ return;
55
+ default:
56
+ this.info((0, subcommandHelp_1.getRunHelpText)());
57
+ }
58
+ }
59
+ catch (error) {
60
+ this.error(`Run command failed: ${error}`);
61
+ throw error;
62
+ }
63
+ }
64
+ async start(args) {
65
+ const parsed = this.parseStartArgs(args);
66
+ const targetPath = path.resolve(parsed.projectPath || process.cwd());
67
+ const report = await services_1.services.runService.start(targetPath, {
68
+ profileId: parsed.profileId,
69
+ });
70
+ this.printReport(report, targetPath);
71
+ }
72
+ async status(projectPath) {
73
+ const targetPath = path.resolve(projectPath || process.cwd());
74
+ const report = await services_1.services.runService.getStatusReport(targetPath);
75
+ this.printReport(report, targetPath);
76
+ }
77
+ async step(projectPath) {
78
+ const targetPath = path.resolve(projectPath || process.cwd());
79
+ const report = await services_1.services.runService.step(targetPath);
80
+ this.printReport(report, targetPath);
81
+ }
82
+ async resume(projectPath) {
83
+ const targetPath = path.resolve(projectPath || process.cwd());
84
+ const report = await services_1.services.runService.resume(targetPath);
85
+ this.printReport(report, targetPath);
86
+ }
87
+ async stop(projectPath) {
88
+ const targetPath = path.resolve(projectPath || process.cwd());
89
+ const report = await services_1.services.runService.stop(targetPath);
90
+ this.printReport(report, targetPath);
91
+ }
92
+ async logs(projectPath) {
93
+ const targetPath = path.resolve(projectPath || process.cwd());
94
+ const lines = await services_1.services.runService.getLogTail(targetPath, 30);
95
+ console.log('\nQueue Run Logs');
96
+ console.log('==============\n');
97
+ if (lines.length === 0) {
98
+ console.log('No queue run logs yet.\n');
99
+ return;
100
+ }
101
+ for (const line of lines) {
102
+ console.log(line);
103
+ }
104
+ console.log('');
105
+ }
106
+ printReport(report, projectPath) {
107
+ console.log('\nQueue Run Status');
108
+ console.log('================\n');
109
+ console.log(`Project: ${projectPath}`);
110
+ if (!report.currentRun) {
111
+ console.log('Run: idle');
112
+ console.log(`Queued changes: ${report.queuedChanges.length}`);
113
+ if (report.nextInstruction) {
114
+ console.log(`Next: ${report.nextInstruction}`);
115
+ }
116
+ console.log('');
117
+ return;
118
+ }
119
+ console.log(`Run ID: ${report.currentRun.id}`);
120
+ console.log(`Status: ${report.currentRun.status}`);
121
+ if (report.stage) {
122
+ console.log(`Stage: ${report.stage}`);
123
+ }
124
+ console.log(`Executor: ${report.currentRun.executor}`);
125
+ console.log(`Profile: ${report.currentRun.profileId}`);
126
+ console.log(`Started at: ${report.currentRun.startedAt}`);
127
+ console.log(`Updated at: ${report.currentRun.updatedAt}`);
128
+ console.log(`Completed changes: ${report.currentRun.completedChanges.length}`);
129
+ console.log(`Queued remaining: ${report.currentRun.remainingChanges.length}`);
130
+ if (report.activeChange) {
131
+ console.log(`Active change: ${report.activeChange.name} [${report.activeChange.status}]`);
132
+ console.log(`Active path: ${report.activeChange.path}`);
133
+ }
134
+ else {
135
+ console.log('Active change: none');
136
+ }
137
+ if (report.currentRun.failedChange) {
138
+ console.log(`Failed marker: ${report.currentRun.failedChange.name}`);
139
+ if (report.currentRun.failedChange.note) {
140
+ console.log(`Failure note: ${report.currentRun.failedChange.note}`);
141
+ }
142
+ }
143
+ if (report.queuedChanges.length > 0) {
144
+ console.log('\nQueued changes:');
145
+ for (const change of report.queuedChanges) {
146
+ console.log(` - ${change.name} [${change.status}]`);
147
+ }
148
+ }
149
+ if (report.nextInstruction) {
150
+ console.log('\nNext instruction:');
151
+ console.log(` ${report.nextInstruction}`);
152
+ }
153
+ if (report.logTail.length > 0) {
154
+ console.log('\nRecent log lines:');
155
+ for (const line of report.logTail.slice(-10)) {
156
+ console.log(` ${line}`);
157
+ }
158
+ }
159
+ console.log('');
160
+ }
161
+ parseStartArgs(args) {
162
+ let projectPath;
163
+ let profileId;
164
+ for (let index = 0; index < args.length; index += 1) {
165
+ const value = args[index];
166
+ if (!value) {
167
+ continue;
168
+ }
169
+ if (value === '--profile') {
170
+ profileId = args[index + 1];
171
+ if (!profileId) {
172
+ throw new Error('Run start requires a value after --profile.');
173
+ }
174
+ index += 1;
175
+ continue;
176
+ }
177
+ if (value.startsWith('--profile=')) {
178
+ profileId = value.slice('--profile='.length);
179
+ if (!profileId) {
180
+ throw new Error('Run start requires a value after --profile=');
181
+ }
182
+ continue;
183
+ }
184
+ if (value.startsWith('--')) {
185
+ throw new Error(`Unknown run start flag: ${value}`);
186
+ }
187
+ if (!projectPath) {
188
+ projectPath = value;
189
+ continue;
190
+ }
191
+ throw new Error(`Unexpected run start argument: ${value}`);
192
+ }
193
+ return {
194
+ projectPath,
195
+ profileId,
196
+ };
197
+ }
198
+ }
199
+ exports.RunCommand = RunCommand;
200
+ //# sourceMappingURL=RunCommand.js.map
@@ -0,0 +1,31 @@
1
+ import { BaseCommand } from './BaseCommand';
2
+ export declare class SkillCommand extends BaseCommand {
3
+ execute(action?: string, skillNameOrTargetDir?: string, targetDir?: string): Promise<void>;
4
+ private resolveAction;
5
+ private getInstallAction;
6
+ private resolveSkillSelection;
7
+ private isKnownSkillName;
8
+ private getAvailableSkillNames;
9
+ private installSkill;
10
+ private getInstalledSkillStatus;
11
+ private buildSkillPackage;
12
+ private getSkillDefinition;
13
+ private buildPrimarySkillDefinition;
14
+ private buildPackageAssets;
15
+ private buildLegacyAliasPackage;
16
+ private syncSkillFiles;
17
+ private isPackageInSync;
18
+ private buildCodexSkillYaml;
19
+ private buildOpenAiYaml;
20
+ private resolvePackageRoot;
21
+ private resolvePrimarySourceFiles;
22
+ private withClaudeFrontmatter;
23
+ private stripFrontmatter;
24
+ private buildSkillMarkdown;
25
+ private escapeYaml;
26
+ private extractInterfaceDefaultPrompt;
27
+ private buildCodexLegacyAliasFiles;
28
+ private resolveTargetDir;
29
+ private resolveProviderHome;
30
+ }
31
+ //# sourceMappingURL=SkillCommand.d.ts.map