@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
|
@@ -0,0 +1,66 @@
|
|
|
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.PathUtils = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const constants_1 = require("../core/constants");
|
|
39
|
+
class PathUtils {
|
|
40
|
+
static getChangeDir(rootDir, bucket, featureName) {
|
|
41
|
+
return path.join(rootDir, constants_1.DIR_NAMES.CHANGES, bucket, featureName);
|
|
42
|
+
}
|
|
43
|
+
static getFeatureDir(rootDir, featureName) {
|
|
44
|
+
return this.getChangeDir(rootDir, constants_1.DIR_NAMES.ACTIVE, featureName);
|
|
45
|
+
}
|
|
46
|
+
static getFeatureFile(featureDir, type) {
|
|
47
|
+
const fileNames = {
|
|
48
|
+
proposal: constants_1.FILE_NAMES.PROPOSAL,
|
|
49
|
+
tasks: constants_1.FILE_NAMES.TASKS,
|
|
50
|
+
state: constants_1.FILE_NAMES.STATE,
|
|
51
|
+
verification: constants_1.FILE_NAMES.VERIFICATION,
|
|
52
|
+
};
|
|
53
|
+
return path.join(featureDir, fileNames[type]);
|
|
54
|
+
}
|
|
55
|
+
static normalize(filePath) {
|
|
56
|
+
return path.normalize(filePath).replace(/\\/g, '/');
|
|
57
|
+
}
|
|
58
|
+
static isAbsolute(filePath) {
|
|
59
|
+
return path.isAbsolute(filePath);
|
|
60
|
+
}
|
|
61
|
+
static getRelative(from, to) {
|
|
62
|
+
return path.relative(from, to).replace(/\\/g, '/');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.PathUtils = PathUtils;
|
|
66
|
+
//# sourceMappingURL=PathUtils.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 字符串工具函数
|
|
3
|
+
*/
|
|
4
|
+
export declare class StringUtils {
|
|
5
|
+
/**
|
|
6
|
+
* 转换为 kebab-case
|
|
7
|
+
*/
|
|
8
|
+
static toKebabCase(str: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* 转换为 camelCase
|
|
11
|
+
*/
|
|
12
|
+
static toCamelCase(str: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* 转换为 PascalCase
|
|
15
|
+
*/
|
|
16
|
+
static toPascalCase(str: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* 截断字符串
|
|
19
|
+
*/
|
|
20
|
+
static truncate(str: string, length: number, suffix?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* 去除空白
|
|
23
|
+
*/
|
|
24
|
+
static trim(str: string): string;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=StringUtils.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 字符串工具函数
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.StringUtils = void 0;
|
|
7
|
+
class StringUtils {
|
|
8
|
+
/**
|
|
9
|
+
* 转换为 kebab-case
|
|
10
|
+
*/
|
|
11
|
+
static toKebabCase(str) {
|
|
12
|
+
return str
|
|
13
|
+
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
|
14
|
+
.replace(/[\s_]+/g, '-')
|
|
15
|
+
.toLowerCase();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 转换为 camelCase
|
|
19
|
+
*/
|
|
20
|
+
static toCamelCase(str) {
|
|
21
|
+
return str
|
|
22
|
+
.replace(/[-_\s](.)/g, (_, c) => c.toUpperCase())
|
|
23
|
+
.replace(/^(.)/, (_, c) => c.toLowerCase());
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 转换为 PascalCase
|
|
27
|
+
*/
|
|
28
|
+
static toPascalCase(str) {
|
|
29
|
+
return str
|
|
30
|
+
.replace(/[-_\s](.)/g, (_, c) => c.toUpperCase())
|
|
31
|
+
.replace(/^(.)/, (_, c) => c.toUpperCase());
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 截断字符串
|
|
35
|
+
*/
|
|
36
|
+
static truncate(str, length, suffix = '...') {
|
|
37
|
+
return str.length > length ? str.substring(0, length - suffix.length) + suffix : str;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 去除空白
|
|
41
|
+
*/
|
|
42
|
+
static trim(str) {
|
|
43
|
+
return str.trim();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.StringUtils = StringUtils;
|
|
47
|
+
//# sourceMappingURL=StringUtils.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 工具函数导出
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./PathUtils"), exports);
|
|
21
|
+
__exportStar(require("./StringUtils"), exports);
|
|
22
|
+
__exportStar(require("./DateUtils"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function isHelpAction(action?: string): boolean;
|
|
2
|
+
export declare function getDocsHelpText(): string;
|
|
3
|
+
export declare function getSkillsHelpText(): string;
|
|
4
|
+
export declare function getSkillHelpText(): string;
|
|
5
|
+
export declare function getIndexHelpText(): string;
|
|
6
|
+
export declare function getWorkflowHelpText(): string;
|
|
7
|
+
export declare function getBatchHelpText(): string;
|
|
8
|
+
export declare function getChangesHelpText(): string;
|
|
9
|
+
export declare function getQueueHelpText(): string;
|
|
10
|
+
export declare function getRunHelpText(): string;
|
|
11
|
+
//# sourceMappingURL=subcommandHelp.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHelpAction = isHelpAction;
|
|
4
|
+
exports.getDocsHelpText = getDocsHelpText;
|
|
5
|
+
exports.getSkillsHelpText = getSkillsHelpText;
|
|
6
|
+
exports.getSkillHelpText = getSkillHelpText;
|
|
7
|
+
exports.getIndexHelpText = getIndexHelpText;
|
|
8
|
+
exports.getWorkflowHelpText = getWorkflowHelpText;
|
|
9
|
+
exports.getPluginsHelpText = getPluginsHelpText;
|
|
10
|
+
exports.getBatchHelpText = getBatchHelpText;
|
|
11
|
+
exports.getChangesHelpText = getChangesHelpText;
|
|
12
|
+
exports.getQueueHelpText = getQueueHelpText;
|
|
13
|
+
exports.getRunHelpText = getRunHelpText;
|
|
14
|
+
const HELP_ACTIONS = new Set(['help', '--help', '-h']);
|
|
15
|
+
function isHelpAction(action) {
|
|
16
|
+
return HELP_ACTIONS.has(action || '');
|
|
17
|
+
}
|
|
18
|
+
function getDocsHelpText() {
|
|
19
|
+
return `
|
|
20
|
+
Docs Commands:
|
|
21
|
+
ospec docs status [path] - show project docs coverage and missing items
|
|
22
|
+
ospec docs generate [path] - explicitly backfill the project knowledge layer after protocol-shell init
|
|
23
|
+
- does not create business scaffold or docs/project/bootstrap-summary.md
|
|
24
|
+
ospec docs sync-protocol [path] - refresh protocol/AI adopted docs for an existing project
|
|
25
|
+
- affects future work only; does not migrate existing changes
|
|
26
|
+
ospec docs help - show docs command help
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
function getSkillsHelpText() {
|
|
30
|
+
return `
|
|
31
|
+
Skills Commands:
|
|
32
|
+
ospec skills status [path] - show layered skill coverage and index status
|
|
33
|
+
ospec skills help - show skills command help
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
function getSkillHelpText() {
|
|
37
|
+
return `
|
|
38
|
+
Skill Package Commands:
|
|
39
|
+
ospec skill status [skill-name] [dir] - inspect one Codex OSpec skill, defaults to ospec-change
|
|
40
|
+
ospec skill install [skill-name] [dir] - install one Codex OSpec skill, defaults to ospec-change
|
|
41
|
+
ospec skill status-claude [skill-name] [dir] - inspect one Claude Code OSpec skill, defaults to ospec-change
|
|
42
|
+
ospec skill install-claude [skill-name] [dir] - install one Claude Code OSpec skill, defaults to ospec-change
|
|
43
|
+
ospec skill help - show skill command help
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
function getIndexHelpText() {
|
|
47
|
+
return `
|
|
48
|
+
Index Commands:
|
|
49
|
+
ospec index check [path] - inspect index presence, freshness, and stats
|
|
50
|
+
ospec index build [path] - rebuild SKILL.index.json
|
|
51
|
+
ospec index help - show index command help
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
function getWorkflowHelpText() {
|
|
55
|
+
return `
|
|
56
|
+
Workflow Commands:
|
|
57
|
+
ospec workflow show [path] - show workflow configuration for the project
|
|
58
|
+
ospec workflow list-flags [path] - list supported workflow flags
|
|
59
|
+
ospec workflow set-mode <mode> [path] - switch the project workflow mode and sync .skillrc.workflow
|
|
60
|
+
ospec workflow help - show workflow command help
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
function getPluginsHelpText() {
|
|
64
|
+
return `
|
|
65
|
+
Plugins Commands:
|
|
66
|
+
ospec plugins list [path] - list plugins available in the project config
|
|
67
|
+
ospec plugins status [path] - show plugin and capability status
|
|
68
|
+
ospec plugins doctor stitch [path] - validate the configured Stitch provider adapter or custom Stitch runner config
|
|
69
|
+
ospec plugins doctor checkpoint [path] - validate checkpoint base_url, workspace scaffold, and runner config
|
|
70
|
+
ospec plugins enable stitch [path] - enable Stitch for new changes by default
|
|
71
|
+
ospec plugins enable checkpoint [path] --base-url <url> - enable checkpoint and save the runtime base URL
|
|
72
|
+
ospec plugins disable stitch [path] - disable Stitch for new changes by default
|
|
73
|
+
ospec plugins disable checkpoint [path] - disable checkpoint for new changes by default
|
|
74
|
+
ospec plugins run stitch <path> - run the configured Stitch provider adapter or custom runner and submit a preview
|
|
75
|
+
ospec plugins run checkpoint <path> - run checkpoint automation, write gate/result artifacts, and sync passed optional steps
|
|
76
|
+
ospec plugins approve stitch <path> - mark Stitch design review approved and sync verification.md
|
|
77
|
+
ospec plugins reject stitch <path> - mark Stitch design review rejected and sync verification.md
|
|
78
|
+
ospec plugins help - show plugins command help
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
function getBatchHelpText() {
|
|
82
|
+
return `
|
|
83
|
+
Batch Commands:
|
|
84
|
+
ospec batch export [path] - export change data in batch
|
|
85
|
+
ospec batch stats [path] - show aggregated change statistics
|
|
86
|
+
ospec batch help - show batch command help
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
function getChangesHelpText() {
|
|
90
|
+
return `
|
|
91
|
+
Changes Commands:
|
|
92
|
+
ospec changes status [path] - show PASS/WARN/FAIL protocol status for every active change
|
|
93
|
+
ospec finalize [path] - verify and archive a completed change before commit
|
|
94
|
+
ospec changes help - show changes command help
|
|
95
|
+
`;
|
|
96
|
+
}
|
|
97
|
+
function getQueueHelpText() {
|
|
98
|
+
return `
|
|
99
|
+
Queue Commands:
|
|
100
|
+
ospec queue status [path] - show queued changes without activating them
|
|
101
|
+
ospec queue add <change-name> [path] [--flags flag1,flag2] - create a queued change explicitly
|
|
102
|
+
ospec queue activate <change-name> [path] - move one queued change into changes/active
|
|
103
|
+
ospec queue next [path] - activate the next queued change
|
|
104
|
+
ospec queue help - show queue command help
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
function getRunHelpText() {
|
|
108
|
+
return `
|
|
109
|
+
Run Commands:
|
|
110
|
+
ospec run start [path] [--profile manual-safe|archive-chain] - start explicit queue tracking
|
|
111
|
+
ospec run status [path] - show current queue run status
|
|
112
|
+
ospec run step [path] - advance one explicit queue step
|
|
113
|
+
ospec run resume [path] - resume a paused or failed queue run
|
|
114
|
+
ospec run stop [path] - pause the current queue run
|
|
115
|
+
ospec run logs [path] - show recent queue run log lines
|
|
116
|
+
ospec run help - show run command help
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=subcommandHelp.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FeatureState } from '../core/types';
|
|
2
|
+
export interface ArchiveGateConfig {
|
|
3
|
+
require_verification: boolean;
|
|
4
|
+
require_skill_update: boolean;
|
|
5
|
+
require_index_regenerated: boolean;
|
|
6
|
+
require_optional_steps_passed: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ArchiveCheckResult {
|
|
9
|
+
canArchive: boolean;
|
|
10
|
+
checks: {
|
|
11
|
+
name: string;
|
|
12
|
+
passed: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
}[];
|
|
15
|
+
blockers: string[];
|
|
16
|
+
warnings: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface ArchiveProtocolState {
|
|
19
|
+
activatedSteps: string[];
|
|
20
|
+
tasksOptionalSteps: string[];
|
|
21
|
+
verificationOptionalSteps: string[];
|
|
22
|
+
passedOptionalSteps: string[];
|
|
23
|
+
tasksComplete: boolean;
|
|
24
|
+
verificationComplete: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare class ArchiveGate {
|
|
27
|
+
checkArchiveReadiness(featureState: FeatureState, config: ArchiveGateConfig, protocolState?: ArchiveProtocolState): Promise<ArchiveCheckResult>;
|
|
28
|
+
}
|
|
29
|
+
export declare const archiveGate: ArchiveGate;
|
|
30
|
+
//# sourceMappingURL=ArchiveGate.d.ts.map
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.archiveGate = exports.ArchiveGate = void 0;
|
|
4
|
+
class ArchiveGate {
|
|
5
|
+
async checkArchiveReadiness(featureState, config, protocolState) {
|
|
6
|
+
const checks = [];
|
|
7
|
+
const blockers = [];
|
|
8
|
+
const warnings = [];
|
|
9
|
+
const verificationPassed = featureState.completed.includes('verification_passed');
|
|
10
|
+
checks.push({
|
|
11
|
+
name: 'Verification Passed',
|
|
12
|
+
passed: verificationPassed || !config.require_verification,
|
|
13
|
+
message: verificationPassed
|
|
14
|
+
? 'Verification has been completed'
|
|
15
|
+
: 'Verification required but not completed',
|
|
16
|
+
});
|
|
17
|
+
if (config.require_verification && !verificationPassed) {
|
|
18
|
+
blockers.push('Verification must be completed before archiving');
|
|
19
|
+
}
|
|
20
|
+
const skillUpdated = featureState.completed.includes('skill_updated');
|
|
21
|
+
checks.push({
|
|
22
|
+
name: 'Skill Updated',
|
|
23
|
+
passed: skillUpdated || !config.require_skill_update,
|
|
24
|
+
message: skillUpdated
|
|
25
|
+
? 'Skill documentation has been updated'
|
|
26
|
+
: 'Skill update required but not completed',
|
|
27
|
+
});
|
|
28
|
+
if (config.require_skill_update && !skillUpdated) {
|
|
29
|
+
blockers.push('Skill documentation must be updated before archiving');
|
|
30
|
+
}
|
|
31
|
+
const indexRegenerated = featureState.completed.includes('index_regenerated');
|
|
32
|
+
checks.push({
|
|
33
|
+
name: 'Index Regenerated',
|
|
34
|
+
passed: indexRegenerated || !config.require_index_regenerated,
|
|
35
|
+
message: indexRegenerated
|
|
36
|
+
? 'Index has been regenerated'
|
|
37
|
+
: 'Index regeneration required but not completed',
|
|
38
|
+
});
|
|
39
|
+
if (config.require_index_regenerated && !indexRegenerated) {
|
|
40
|
+
blockers.push('Index must be regenerated before archiving');
|
|
41
|
+
}
|
|
42
|
+
const coreSteps = [
|
|
43
|
+
'proposal_complete',
|
|
44
|
+
'tasks_complete',
|
|
45
|
+
'implementation_complete',
|
|
46
|
+
'verification_passed',
|
|
47
|
+
];
|
|
48
|
+
const corePassed = coreSteps.every(step => featureState.completed.includes(step));
|
|
49
|
+
checks.push({
|
|
50
|
+
name: 'Core Steps Completed',
|
|
51
|
+
passed: corePassed,
|
|
52
|
+
message: corePassed
|
|
53
|
+
? 'All core steps have been completed'
|
|
54
|
+
: 'Some core steps are still pending',
|
|
55
|
+
});
|
|
56
|
+
if (!corePassed) {
|
|
57
|
+
blockers.push('All core steps must be completed before archiving');
|
|
58
|
+
}
|
|
59
|
+
if (featureState.status !== 'ready_to_archive') {
|
|
60
|
+
blockers.push('state.json.status must be ready_to_archive before archiving');
|
|
61
|
+
}
|
|
62
|
+
if (protocolState) {
|
|
63
|
+
const missingTaskCoverage = protocolState.activatedSteps.filter(step => !protocolState.tasksOptionalSteps.includes(step));
|
|
64
|
+
if (missingTaskCoverage.length > 0) {
|
|
65
|
+
blockers.push(`Activated optional steps missing from tasks.md: ${missingTaskCoverage.join(', ')}`);
|
|
66
|
+
}
|
|
67
|
+
const missingVerificationCoverage = protocolState.activatedSteps.filter(step => !protocolState.verificationOptionalSteps.includes(step));
|
|
68
|
+
if (missingVerificationCoverage.length > 0) {
|
|
69
|
+
blockers.push(`Activated optional steps missing from verification.md: ${missingVerificationCoverage.join(', ')}`);
|
|
70
|
+
}
|
|
71
|
+
const missingPassedSteps = protocolState.activatedSteps.filter(step => !protocolState.passedOptionalSteps.includes(step));
|
|
72
|
+
if (config.require_optional_steps_passed && missingPassedSteps.length > 0) {
|
|
73
|
+
blockers.push('All activated optional steps must be passed before archiving');
|
|
74
|
+
warnings.push(`Optional steps not yet passed: ${missingPassedSteps.join(', ')}`);
|
|
75
|
+
}
|
|
76
|
+
if (!protocolState.tasksComplete) {
|
|
77
|
+
blockers.push('tasks.md still has unchecked items');
|
|
78
|
+
}
|
|
79
|
+
if (!protocolState.verificationComplete) {
|
|
80
|
+
blockers.push('verification.md still has unchecked items');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
canArchive: blockers.length === 0,
|
|
85
|
+
checks,
|
|
86
|
+
blockers,
|
|
87
|
+
warnings,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.ArchiveGate = ArchiveGate;
|
|
92
|
+
exports.archiveGate = new ArchiveGate();
|
|
93
|
+
//# sourceMappingURL=ArchiveGate.js.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 可配置工作流系统
|
|
3
|
+
* 基于 OSpec 官方规范实现
|
|
4
|
+
* 支持核心步骤 + 可选步骤 + Feature Flags
|
|
5
|
+
*/
|
|
6
|
+
export type CoreStep = 'proposal' | 'tasks' | 'state' | 'verification' | 'skill_update' | 'index_regenerated';
|
|
7
|
+
export type OptionalStep = 'code_review' | 'design_doc' | 'plan_doc' | 'security_review' | 'adr' | 'db_change_doc' | 'api_change_doc';
|
|
8
|
+
export interface OptionalStepConfig {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
when: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface WorkflowConfigType {
|
|
13
|
+
core_required: CoreStep[];
|
|
14
|
+
optional_steps: Record<OptionalStep, OptionalStepConfig>;
|
|
15
|
+
archive_gate: {
|
|
16
|
+
require_verification: boolean;
|
|
17
|
+
require_skill_update: boolean;
|
|
18
|
+
require_index_regenerated: boolean;
|
|
19
|
+
require_optional_steps_passed: boolean;
|
|
20
|
+
};
|
|
21
|
+
feature_flags: {
|
|
22
|
+
supported: string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 3种预定义工作流模板
|
|
27
|
+
*/
|
|
28
|
+
export declare const WORKFLOW_PRESETS: Record<string, WorkflowConfigType>;
|
|
29
|
+
export declare class ConfigurableWorkflow {
|
|
30
|
+
private config;
|
|
31
|
+
private mode;
|
|
32
|
+
constructor(mode: string);
|
|
33
|
+
/**
|
|
34
|
+
* 根据 feature flags 确定激活的可选步骤
|
|
35
|
+
*/
|
|
36
|
+
getActivatedSteps(featureFlags: string[]): OptionalStep[];
|
|
37
|
+
/**
|
|
38
|
+
* 获取完整的工作流步骤(核心 + 激活的可选)
|
|
39
|
+
*/
|
|
40
|
+
getFullWorkflow(featureFlags: string[]): string[];
|
|
41
|
+
/**
|
|
42
|
+
* 获取核心步骤
|
|
43
|
+
*/
|
|
44
|
+
getCoreSteps(): CoreStep[];
|
|
45
|
+
/**
|
|
46
|
+
* 获取所有支持的 feature flags
|
|
47
|
+
*/
|
|
48
|
+
getSupportedFlags(): string[];
|
|
49
|
+
/**
|
|
50
|
+
* 验证 feature flags
|
|
51
|
+
*/
|
|
52
|
+
validateFlags(flags: string[]): {
|
|
53
|
+
valid: boolean;
|
|
54
|
+
unsupported: string[];
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* 获取步骤的依赖关系
|
|
58
|
+
*/
|
|
59
|
+
getStepDependencies(step: string): string[];
|
|
60
|
+
/**
|
|
61
|
+
* 获取工作流配置
|
|
62
|
+
*/
|
|
63
|
+
getConfig(): WorkflowConfigType;
|
|
64
|
+
/**
|
|
65
|
+
* 获取存档门禁配置
|
|
66
|
+
*/
|
|
67
|
+
getArchiveGate(): {
|
|
68
|
+
require_verification: boolean;
|
|
69
|
+
require_skill_update: boolean;
|
|
70
|
+
require_index_regenerated: boolean;
|
|
71
|
+
require_optional_steps_passed: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* 生成工作流摘要
|
|
75
|
+
*/
|
|
76
|
+
getSummary(featureFlags: string[]): {
|
|
77
|
+
mode: string;
|
|
78
|
+
coreSteps: number;
|
|
79
|
+
optionalSteps: string[];
|
|
80
|
+
totalSteps: number;
|
|
81
|
+
flags: string[];
|
|
82
|
+
unsupportedFlags: string[];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* 获取当前模式
|
|
86
|
+
*/
|
|
87
|
+
getMode(): string;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=ConfigurableWorkflow.d.ts.map
|