@seanmars/tospec 0.19.0-beta.7 → 0.20.0
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/CHANGELOG.md +60 -231
- package/README.md +69 -82
- package/assets/dashboard/app.js +14 -3
- package/assets/dashboard/style.css +7 -0
- package/assets/rules/tospec/decision.md +3 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +227 -86
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/config.d.ts +9 -17
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +366 -107
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/dashboard.d.ts +57 -99
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +224 -282
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts +41 -19
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +385 -79
- package/dist/commands/decision.js.map +1 -1
- package/dist/commands/metrics.d.ts +28 -51
- package/dist/commands/metrics.d.ts.map +1 -1
- package/dist/commands/metrics.js +62 -93
- package/dist/commands/metrics.js.map +1 -1
- package/dist/commands/shared-output.d.ts +18 -21
- package/dist/commands/shared-output.d.ts.map +1 -1
- package/dist/commands/shared-output.js +49 -23
- package/dist/commands/shared-output.js.map +1 -1
- package/dist/commands/show.d.ts +7 -0
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +29 -7
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/validate.d.ts +43 -45
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +262 -129
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/workflow/index.d.ts +6 -10
- package/dist/commands/workflow/index.d.ts.map +1 -1
- package/dist/commands/workflow/index.js +6 -10
- package/dist/commands/workflow/index.js.map +1 -1
- package/dist/commands/workflow/instructions.d.ts +21 -8
- package/dist/commands/workflow/instructions.d.ts.map +1 -1
- package/dist/commands/workflow/instructions.js +254 -95
- package/dist/commands/workflow/instructions.js.map +1 -1
- package/dist/commands/workflow/new-change.d.ts +4 -5
- package/dist/commands/workflow/new-change.d.ts.map +1 -1
- package/dist/commands/workflow/new-change.js +90 -25
- package/dist/commands/workflow/new-change.js.map +1 -1
- package/dist/commands/workflow/schemas.d.ts +3 -5
- package/dist/commands/workflow/schemas.d.ts.map +1 -1
- package/dist/commands/workflow/schemas.js +37 -11
- package/dist/commands/workflow/schemas.js.map +1 -1
- package/dist/commands/workflow/shared.d.ts +48 -21
- package/dist/commands/workflow/shared.d.ts.map +1 -1
- package/dist/commands/workflow/shared.js +36 -33
- package/dist/commands/workflow/shared.js.map +1 -1
- package/dist/commands/workflow/status.d.ts +10 -6
- package/dist/commands/workflow/status.d.ts.map +1 -1
- package/dist/commands/workflow/status.js +81 -42
- package/dist/commands/workflow/status.js.map +1 -1
- package/dist/commands/workflow/templates.d.ts +10 -3
- package/dist/commands/workflow/templates.d.ts.map +1 -1
- package/dist/commands/workflow/templates.js +39 -40
- package/dist/commands/workflow/templates.js.map +1 -1
- package/dist/core/archive.d.ts +26 -21
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +378 -235
- package/dist/core/archive.js.map +1 -1
- package/dist/core/artifact-graph/graph.d.ts +25 -42
- package/dist/core/artifact-graph/graph.d.ts.map +1 -1
- package/dist/core/artifact-graph/graph.js +45 -63
- package/dist/core/artifact-graph/graph.js.map +1 -1
- package/dist/core/artifact-graph/index.d.ts +1 -1
- package/dist/core/artifact-graph/index.d.ts.map +1 -1
- package/dist/core/artifact-graph/index.js +1 -1
- package/dist/core/artifact-graph/index.js.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.d.ts +97 -103
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +146 -119
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
- package/dist/core/artifact-graph/outputs.d.ts +9 -23
- package/dist/core/artifact-graph/outputs.d.ts.map +1 -1
- package/dist/core/artifact-graph/outputs.js +45 -38
- package/dist/core/artifact-graph/outputs.js.map +1 -1
- package/dist/core/artifact-graph/resolver.d.ts +44 -63
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
- package/dist/core/artifact-graph/resolver.js +85 -86
- package/dist/core/artifact-graph/resolver.js.map +1 -1
- package/dist/core/artifact-graph/schema.d.ts +0 -6
- package/dist/core/artifact-graph/schema.d.ts.map +1 -1
- package/dist/core/artifact-graph/schema.js +7 -32
- package/dist/core/artifact-graph/schema.js.map +1 -1
- package/dist/core/artifact-graph/state.d.ts +1 -8
- package/dist/core/artifact-graph/state.d.ts.map +1 -1
- package/dist/core/artifact-graph/state.js +2 -17
- package/dist/core/artifact-graph/state.js.map +1 -1
- package/dist/core/artifact-graph/stub-detection.d.ts +12 -0
- package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -0
- package/dist/core/artifact-graph/stub-detection.js +39 -0
- package/dist/core/artifact-graph/stub-detection.js.map +1 -0
- package/dist/core/artifact-graph/types.d.ts +4 -0
- package/dist/core/artifact-graph/types.d.ts.map +1 -1
- package/dist/core/artifact-graph/types.js +30 -10
- package/dist/core/artifact-graph/types.js.map +1 -1
- package/dist/core/available-tools.d.ts +3 -12
- package/dist/core/available-tools.d.ts.map +1 -1
- package/dist/core/available-tools.js +4 -13
- package/dist/core/available-tools.js.map +1 -1
- package/dist/core/change-metadata/schema.d.ts +1 -1
- package/dist/core/change-metadata/schema.d.ts.map +1 -1
- package/dist/core/change-metadata/schema.js +10 -7
- package/dist/core/change-metadata/schema.js.map +1 -1
- package/dist/core/change-presenter.d.ts +23 -18
- package/dist/core/change-presenter.d.ts.map +1 -1
- package/dist/core/change-presenter.js +102 -43
- package/dist/core/change-presenter.js.map +1 -1
- package/dist/core/change-status-policy.d.ts +8 -1
- package/dist/core/change-status-policy.d.ts.map +1 -1
- package/dist/core/change-status-policy.js +25 -1
- package/dist/core/change-status-policy.js.map +1 -1
- package/dist/core/codex-metrics.d.ts +25 -45
- package/dist/core/codex-metrics.d.ts.map +1 -1
- package/dist/core/codex-metrics.js +44 -88
- package/dist/core/codex-metrics.js.map +1 -1
- package/dist/core/codex-residue.d.ts +14 -15
- package/dist/core/codex-residue.d.ts.map +1 -1
- package/dist/core/codex-residue.js +18 -22
- package/dist/core/codex-residue.js.map +1 -1
- package/dist/core/command-generation/adapters/claude.d.ts +2 -9
- package/dist/core/command-generation/adapters/claude.d.ts.map +1 -1
- package/dist/core/command-generation/adapters/claude.js +2 -12
- package/dist/core/command-generation/adapters/claude.js.map +1 -1
- package/dist/core/command-generation/adapters/index.d.ts +1 -9
- package/dist/core/command-generation/adapters/index.d.ts.map +1 -1
- package/dist/core/command-generation/adapters/index.js +1 -9
- package/dist/core/command-generation/adapters/index.js.map +1 -1
- package/dist/core/command-generation/generator.d.ts +0 -17
- package/dist/core/command-generation/generator.d.ts.map +1 -1
- package/dist/core/command-generation/generator.js +0 -17
- package/dist/core/command-generation/generator.js.map +1 -1
- package/dist/core/command-generation/index.d.ts +2 -5
- package/dist/core/command-generation/index.d.ts.map +1 -1
- package/dist/core/command-generation/index.js +0 -9
- package/dist/core/command-generation/index.js.map +1 -1
- package/dist/core/command-generation/types.d.ts +10 -36
- package/dist/core/command-generation/types.d.ts.map +1 -1
- package/dist/core/command-generation/types.js +0 -6
- package/dist/core/command-generation/types.js.map +1 -1
- package/dist/core/command-generation/yaml.d.ts +3 -18
- package/dist/core/command-generation/yaml.d.ts.map +1 -1
- package/dist/core/command-generation/yaml.js +5 -23
- package/dist/core/command-generation/yaml.js.map +1 -1
- package/dist/core/config-prompts.d.ts +2 -4
- package/dist/core/config-prompts.d.ts.map +1 -1
- package/dist/core/config-prompts.js +2 -7
- package/dist/core/config-prompts.js.map +1 -1
- package/dist/core/config-schema.d.ts +8 -53
- package/dist/core/config-schema.d.ts.map +1 -1
- package/dist/core/config-schema.js +49 -62
- package/dist/core/config-schema.js.map +1 -1
- package/dist/core/config.d.ts +39 -26
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +36 -22
- package/dist/core/config.js.map +1 -1
- package/dist/core/dashboard-activity.d.ts +7 -9
- package/dist/core/dashboard-activity.d.ts.map +1 -1
- package/dist/core/dashboard-activity.js +26 -24
- package/dist/core/dashboard-activity.js.map +1 -1
- package/dist/core/dashboard-data.d.ts +40 -22
- package/dist/core/dashboard-data.d.ts.map +1 -1
- package/dist/core/dashboard-data.js +62 -70
- package/dist/core/dashboard-data.js.map +1 -1
- package/dist/core/global-config.d.ts +24 -53
- package/dist/core/global-config.d.ts.map +1 -1
- package/dist/core/global-config.js +38 -67
- package/dist/core/global-config.js.map +1 -1
- package/dist/core/init.d.ts +25 -19
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +168 -181
- package/dist/core/init.js.map +1 -1
- package/dist/core/list.d.ts +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +121 -28
- package/dist/core/list.js.map +1 -1
- package/dist/core/local-server.d.ts +41 -83
- package/dist/core/local-server.d.ts.map +1 -1
- package/dist/core/local-server.js +53 -98
- package/dist/core/local-server.js.map +1 -1
- package/dist/core/markdown-render.d.ts +25 -0
- package/dist/core/markdown-render.d.ts.map +1 -0
- package/dist/core/markdown-render.js +94 -0
- package/dist/core/markdown-render.js.map +1 -0
- package/dist/core/migrate.d.ts +29 -14
- package/dist/core/migrate.d.ts.map +1 -1
- package/dist/core/migrate.js +184 -122
- package/dist/core/migrate.js.map +1 -1
- package/dist/core/parsers/change-parser.d.ts +7 -10
- package/dist/core/parsers/change-parser.d.ts.map +1 -1
- package/dist/core/parsers/change-parser.js +48 -56
- package/dist/core/parsers/change-parser.js.map +1 -1
- package/dist/core/parsers/markdown-parser.d.ts +8 -9
- package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
- package/dist/core/parsers/markdown-parser.js +31 -22
- package/dist/core/parsers/markdown-parser.js.map +1 -1
- package/dist/core/parsers/requirement-blocks.d.ts +43 -15
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
- package/dist/core/parsers/requirement-blocks.js +142 -70
- package/dist/core/parsers/requirement-blocks.js.map +1 -1
- package/dist/core/parsers/requirement-text.d.ts +73 -79
- package/dist/core/parsers/requirement-text.d.ts.map +1 -1
- package/dist/core/parsers/requirement-text.js +137 -79
- package/dist/core/parsers/requirement-text.js.map +1 -1
- package/dist/core/parsers/spec-structure.d.ts.map +1 -1
- package/dist/core/parsers/spec-structure.js +10 -6
- package/dist/core/parsers/spec-structure.js.map +1 -1
- package/dist/core/profiles.d.ts +3 -10
- package/dist/core/profiles.d.ts.map +1 -1
- package/dist/core/profiles.js +5 -12
- package/dist/core/profiles.js.map +1 -1
- package/dist/core/project-config.d.ts +43 -44
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +107 -82
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/project-layout.d.ts +9 -17
- package/dist/core/project-layout.d.ts.map +1 -1
- package/dist/core/project-layout.js +16 -26
- package/dist/core/project-layout.js.map +1 -1
- package/dist/core/root-selection.d.ts +11 -7
- package/dist/core/root-selection.d.ts.map +1 -1
- package/dist/core/root-selection.js +7 -8
- package/dist/core/root-selection.js.map +1 -1
- package/dist/core/rules.d.ts +6 -1
- package/dist/core/rules.d.ts.map +1 -1
- package/dist/core/rules.js +23 -2
- package/dist/core/rules.js.map +1 -1
- package/dist/core/schema-names.d.ts +16 -0
- package/dist/core/schema-names.d.ts.map +1 -0
- package/dist/core/schema-names.js +16 -0
- package/dist/core/schema-names.js.map +1 -0
- package/dist/core/schemas/base.schema.d.ts +3 -0
- package/dist/core/schemas/base.schema.d.ts.map +1 -1
- package/dist/core/schemas/base.schema.js +22 -6
- package/dist/core/schemas/base.schema.js.map +1 -1
- package/dist/core/schemas/change.schema.d.ts +16 -0
- package/dist/core/schemas/change.schema.d.ts.map +1 -1
- package/dist/core/schemas/change.schema.js +41 -10
- package/dist/core/schemas/change.schema.js.map +1 -1
- package/dist/core/schemas/spec.schema.d.ts +2 -0
- package/dist/core/schemas/spec.schema.d.ts.map +1 -1
- package/dist/core/shared/index.d.ts +3 -8
- package/dist/core/shared/index.d.ts.map +1 -1
- package/dist/core/shared/index.js +3 -8
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/rules-generation.d.ts +19 -8
- package/dist/core/shared/rules-generation.d.ts.map +1 -1
- package/dist/core/shared/rules-generation.js +117 -50
- package/dist/core/shared/rules-generation.js.map +1 -1
- package/dist/core/shared/skill-generation.d.ts +28 -43
- package/dist/core/shared/skill-generation.d.ts.map +1 -1
- package/dist/core/shared/skill-generation.js +82 -51
- package/dist/core/shared/skill-generation.js.map +1 -1
- package/dist/core/shared/tool-detection.d.ts +39 -61
- package/dist/core/shared/tool-detection.d.ts.map +1 -1
- package/dist/core/shared/tool-detection.js +88 -80
- package/dist/core/shared/tool-detection.js.map +1 -1
- package/dist/core/skill-metrics.d.ts +36 -63
- package/dist/core/skill-metrics.d.ts.map +1 -1
- package/dist/core/skill-metrics.js +34 -73
- package/dist/core/skill-metrics.js.map +1 -1
- package/dist/core/spec-presenter.js +6 -6
- package/dist/core/spec-presenter.js.map +1 -1
- package/dist/core/specs-apply.d.ts +22 -23
- package/dist/core/specs-apply.d.ts.map +1 -1
- package/dist/core/specs-apply.js +166 -193
- package/dist/core/specs-apply.js.map +1 -1
- package/dist/core/templates/fragments/interview.d.ts +2 -6
- package/dist/core/templates/fragments/interview.d.ts.map +1 -1
- package/dist/core/templates/fragments/interview.js +2 -6
- package/dist/core/templates/fragments/interview.js.map +1 -1
- package/dist/core/templates/fragments/next-step.d.ts +4 -8
- package/dist/core/templates/fragments/next-step.d.ts.map +1 -1
- package/dist/core/templates/fragments/next-step.js +4 -8
- package/dist/core/templates/fragments/next-step.js.map +1 -1
- package/dist/core/templates/fragments/validate.d.ts +13 -0
- package/dist/core/templates/fragments/validate.d.ts.map +1 -0
- package/dist/core/templates/fragments/validate.js +13 -0
- package/dist/core/templates/fragments/validate.js.map +1 -0
- package/dist/core/templates/fragments/verify.d.ts +9 -12
- package/dist/core/templates/fragments/verify.d.ts.map +1 -1
- package/dist/core/templates/fragments/verify.js +9 -12
- package/dist/core/templates/fragments/verify.js.map +1 -1
- package/dist/core/templates/index.d.ts +0 -6
- package/dist/core/templates/index.d.ts.map +1 -1
- package/dist/core/templates/index.js +0 -7
- package/dist/core/templates/index.js.map +1 -1
- package/dist/core/templates/skill-templates.d.ts +1 -5
- package/dist/core/templates/skill-templates.d.ts.map +1 -1
- package/dist/core/templates/skill-templates.js +0 -5
- package/dist/core/templates/skill-templates.js.map +1 -1
- package/dist/core/templates/types.d.ts +3 -7
- package/dist/core/templates/types.d.ts.map +1 -1
- package/dist/core/templates/types.js +0 -3
- package/dist/core/templates/types.js.map +1 -1
- package/dist/core/templates/workflows/apply.d.ts +3 -9
- package/dist/core/templates/workflows/apply.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.js +11 -13
- package/dist/core/templates/workflows/apply.js.map +1 -1
- package/dist/core/templates/workflows/archive.d.ts +0 -6
- package/dist/core/templates/workflows/archive.d.ts.map +1 -1
- package/dist/core/templates/workflows/archive.js +19 -6
- package/dist/core/templates/workflows/archive.js.map +1 -1
- package/dist/core/templates/workflows/decision.js +4 -4
- package/dist/core/templates/workflows/decision.js.map +1 -1
- package/dist/core/templates/workflows/explore.js +1 -1
- package/dist/core/templates/workflows/grill.d.ts.map +1 -1
- package/dist/core/templates/workflows/grill.js +0 -2
- package/dist/core/templates/workflows/grill.js.map +1 -1
- package/dist/core/templates/workflows/issue.d.ts +0 -6
- package/dist/core/templates/workflows/issue.d.ts.map +1 -1
- package/dist/core/templates/workflows/issue.js +3 -2
- package/dist/core/templates/workflows/issue.js.map +1 -1
- package/dist/core/templates/workflows/propose.d.ts +0 -6
- package/dist/core/templates/workflows/propose.d.ts.map +1 -1
- package/dist/core/templates/workflows/propose.js +2 -2
- package/dist/core/templates/workflows/propose.js.map +1 -1
- package/dist/core/templates/workflows/sync.d.ts +2 -8
- package/dist/core/templates/workflows/sync.d.ts.map +1 -1
- package/dist/core/templates/workflows/sync.js +4 -3
- package/dist/core/templates/workflows/sync.js.map +1 -1
- package/dist/core/templates/workflows/update.d.ts +0 -6
- package/dist/core/templates/workflows/update.d.ts.map +1 -1
- package/dist/core/templates/workflows/update.js +9 -2
- package/dist/core/templates/workflows/update.js.map +1 -1
- package/dist/core/update.d.ts +23 -23
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +139 -118
- package/dist/core/update.js.map +1 -1
- package/dist/core/user-state-migration.d.ts +13 -15
- package/dist/core/user-state-migration.d.ts.map +1 -1
- package/dist/core/user-state-migration.js +16 -20
- package/dist/core/user-state-migration.js.map +1 -1
- package/dist/core/validation/constants.d.ts +4 -10
- package/dist/core/validation/constants.d.ts.map +1 -1
- package/dist/core/validation/constants.js +25 -20
- package/dist/core/validation/constants.js.map +1 -1
- package/dist/core/validation/prose-length.d.ts +15 -0
- package/dist/core/validation/prose-length.d.ts.map +1 -0
- package/dist/core/validation/prose-length.js +29 -0
- package/dist/core/validation/prose-length.js.map +1 -0
- package/dist/core/validation/purpose-placeholder.d.ts +9 -16
- package/dist/core/validation/purpose-placeholder.d.ts.map +1 -1
- package/dist/core/validation/purpose-placeholder.js +30 -44
- package/dist/core/validation/purpose-placeholder.js.map +1 -1
- package/dist/core/validation/section-validator.d.ts +4 -4
- package/dist/core/validation/section-validator.d.ts.map +1 -1
- package/dist/core/validation/section-validator.js +43 -7
- package/dist/core/validation/section-validator.js.map +1 -1
- package/dist/core/validation/task-numbering.d.ts +6 -3
- package/dist/core/validation/task-numbering.d.ts.map +1 -1
- package/dist/core/validation/task-numbering.js +23 -11
- package/dist/core/validation/task-numbering.js.map +1 -1
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.d.ts.map +1 -1
- package/dist/core/validation/types.js +12 -1
- package/dist/core/validation/types.js.map +1 -1
- package/dist/core/validation/validator.d.ts +43 -63
- package/dist/core/validation/validator.d.ts.map +1 -1
- package/dist/core/validation/validator.js +500 -267
- package/dist/core/validation/validator.js.map +1 -1
- package/dist/prompts/searchable-multi-select.d.ts +3 -8
- package/dist/prompts/searchable-multi-select.d.ts.map +1 -1
- package/dist/prompts/searchable-multi-select.js +16 -39
- package/dist/prompts/searchable-multi-select.js.map +1 -1
- package/dist/utils/change-metadata.d.ts +11 -50
- package/dist/utils/change-metadata.d.ts.map +1 -1
- package/dist/utils/change-metadata.js +48 -67
- package/dist/utils/change-metadata.js.map +1 -1
- package/dist/utils/change-utils.d.ts +30 -54
- package/dist/utils/change-utils.d.ts.map +1 -1
- package/dist/utils/change-utils.js +133 -91
- package/dist/utils/change-utils.js.map +1 -1
- package/dist/utils/file-lock.d.ts +39 -0
- package/dist/utils/file-lock.d.ts.map +1 -0
- package/dist/utils/file-lock.js +149 -0
- package/dist/utils/file-lock.js.map +1 -0
- package/dist/utils/file-system.d.ts +12 -32
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +16 -40
- package/dist/utils/file-system.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +7 -11
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +11 -11
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/interactive.d.ts +4 -9
- package/dist/utils/interactive.d.ts.map +1 -1
- package/dist/utils/interactive.js +2 -4
- package/dist/utils/interactive.js.map +1 -1
- package/dist/utils/item-discovery.d.ts +15 -10
- package/dist/utils/item-discovery.d.ts.map +1 -1
- package/dist/utils/item-discovery.js +42 -47
- package/dist/utils/item-discovery.js.map +1 -1
- package/dist/utils/link.d.ts +9 -18
- package/dist/utils/link.d.ts.map +1 -1
- package/dist/utils/link.js +9 -18
- package/dist/utils/link.js.map +1 -1
- package/dist/utils/requirement-diff.d.ts +13 -23
- package/dist/utils/requirement-diff.d.ts.map +1 -1
- package/dist/utils/requirement-diff.js +13 -23
- package/dist/utils/requirement-diff.js.map +1 -1
- package/dist/utils/spec-files.d.ts +7 -20
- package/dist/utils/spec-files.d.ts.map +1 -1
- package/dist/utils/spec-files.js +26 -51
- package/dist/utils/spec-files.js.map +1 -1
- package/dist/utils/task-progress.d.ts +11 -9
- package/dist/utils/task-progress.d.ts.map +1 -1
- package/dist/utils/task-progress.js +53 -32
- package/dist/utils/task-progress.js.map +1 -1
- package/dist/utils/timestamp.d.ts +5 -8
- package/dist/utils/timestamp.d.ts.map +1 -1
- package/dist/utils/timestamp.js +5 -8
- package/dist/utils/timestamp.js.map +1 -1
- package/package.json +2 -3
- package/schemas/decision/templates/decision.md +3 -1
- package/schemas/decision/templates/index.md +2 -2
- package/schemas/issue/schema.yaml +8 -1
- package/schemas/issue/templates/spec.md +27 -2
- package/schemas/sdd/schema.yaml +20 -1
- package/schemas/sdd/templates/spec.md +27 -2
- /package/assets/rules/tospec/{single-sourc-of-truth.md → single-source-of-truth.md} +0 -0
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The directory layout `tospec init` creates, and the anchors that make it
|
|
3
|
-
* survive version control.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the first command that looks for one reports the project as uninitialized.
|
|
8
|
-
* Nothing is lost — every writer creates the directory it needs on demand — but
|
|
9
|
-
* a diagnostic that sends the reader to re-run a command that will change
|
|
10
|
-
* nothing is worse than a crash.
|
|
3
|
+
* survive version control. Git does not track an empty directory, so without
|
|
4
|
+
* them a collaborator clones a layout whose directories are gone and the first
|
|
5
|
+
* command reports the project as uninitialized — nothing is lost, but the
|
|
6
|
+
* diagnostic sends the reader to re-run a command that changes nothing.
|
|
11
7
|
*/
|
|
12
8
|
import path from 'path';
|
|
13
9
|
import { promises as fs } from 'fs';
|
|
14
10
|
/**
|
|
15
|
-
* Relative to `tospec/`, in creation order.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* whether it ends up empty, and `changes/` never does because it holds
|
|
19
|
-
* `archive/`. A name asserting the property would be wrong for the next
|
|
20
|
-
* directory that ships with content.
|
|
11
|
+
* Relative to `tospec/`, in creation order. Not named for anchoring: whether a
|
|
12
|
+
* directory gets an anchor is computed from whether it ends up empty, and
|
|
13
|
+
* `changes/` never does because it holds `archive/`.
|
|
21
14
|
*/
|
|
22
15
|
export const TOSPEC_LAYOUT_DIRS = [
|
|
23
16
|
'specs',
|
|
24
17
|
'changes',
|
|
25
18
|
'changes/archive',
|
|
26
|
-
// Permanent decision records (`tospec decision new`)
|
|
27
|
-
// layout is visible from the start
|
|
19
|
+
// Permanent decision records (`tospec decision new`), scaffolded here so the
|
|
20
|
+
// layout is visible from the start rather than appearing on first use.
|
|
28
21
|
'decisions',
|
|
29
22
|
];
|
|
30
23
|
const DIRECTORY_ANCHOR_FILE_NAME = '.gitkeep';
|
|
@@ -33,27 +26,24 @@ export function tospecLayoutDirs(tospecPath) {
|
|
|
33
26
|
return TOSPEC_LAYOUT_DIRS.map((relative) => path.join(tospecPath, relative));
|
|
34
27
|
}
|
|
35
28
|
/**
|
|
36
|
-
* Anchor `directory` if it is empty.
|
|
37
|
-
*
|
|
38
|
-
* and adding one beside real content leaves a file nobody asked for.
|
|
29
|
+
* Anchor `directory` if it is empty. An anchor exists to make an empty directory
|
|
30
|
+
* representable, so adding one beside real content leaves a file nobody wanted.
|
|
39
31
|
*/
|
|
40
32
|
export async function ensureDirectoryAnchor(directory) {
|
|
41
33
|
if ((await fs.readdir(directory)).length > 0)
|
|
42
34
|
return;
|
|
43
35
|
try {
|
|
44
|
-
// Exclusive create
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// content the anchor never owned, or write *through* a link into a path
|
|
48
|
-
// outside the project entirely.
|
|
36
|
+
// Exclusive create, closing the window after the emptiness check where a
|
|
37
|
+
// file or link can appear at the anchor's path: an ordinary write would
|
|
38
|
+
// overwrite content the anchor never owned, or write *through* a link.
|
|
49
39
|
await fs.writeFile(path.join(directory, DIRECTORY_ANCHOR_FILE_NAME), '', {
|
|
50
40
|
encoding: 'utf-8',
|
|
51
41
|
flag: 'wx',
|
|
52
42
|
});
|
|
53
43
|
}
|
|
54
44
|
catch (error) {
|
|
55
|
-
// Something is already there, so the directory
|
|
56
|
-
//
|
|
45
|
+
// Something is already there, so the directory needs no anchor: done, not
|
|
46
|
+
// a failure.
|
|
57
47
|
if (error?.code === 'EEXIST')
|
|
58
48
|
return;
|
|
59
49
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-layout.js","sourceRoot":"","sources":["../../src/core/project-layout.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project-layout.js","sourceRoot":"","sources":["../../src/core/project-layout.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO;IACP,SAAS;IACT,iBAAiB;IACjB,6EAA6E;IAC7E,uEAAuE;IACvE,WAAW;CACH,CAAC;AAEX,MAAM,0BAA0B,GAAG,UAAU,CAAC;AAE9C,yEAAyE;AACzE,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,SAAiB;IAC3D,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO;IAErD,IAAI,CAAC;QACH,yEAAyE;QACzE,wEAAwE;QACxE,uEAAuE;QACvE,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,0BAA0B,CAAC,EAAE,EAAE,EAAE;YACvE,QAAQ,EAAE,OAAO;YACjB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0EAA0E;QAC1E,aAAa;QACb,IAAK,KAA+B,EAAE,IAAI,KAAK,QAAQ;YAAE,OAAO;QAChE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* rule: walk up from the start path to the nearest ancestor that contains a
|
|
6
|
-
* `tospec/` directory; if none is found, treat the current directory as an
|
|
7
|
-
* implicit root (unless the caller forbids it).
|
|
2
|
+
* Root resolution: walk up from the start path to the nearest ancestor holding
|
|
3
|
+
* a `tospec/` directory, else treat the current directory as an implicit root
|
|
4
|
+
* unless the caller forbids it.
|
|
8
5
|
*/
|
|
9
6
|
import { type PlanningHome } from './planning-home.js';
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* How a command arrived at the root it reports. `nearest` and `implicit` are the
|
|
9
|
+
* two outcomes of *searching*; `explicit` is the install layer (`init`,
|
|
10
|
+
* `update`, `rules`, `migrate`), which operates on the path it was handed.
|
|
11
|
+
* Naming that case keeps the key present: `JSON.stringify` drops an omitted
|
|
12
|
+
* one, leaving a caller unable to tell it from a renamed field.
|
|
13
|
+
*/
|
|
14
|
+
export type TospecRootSource = 'nearest' | 'implicit' | 'explicit';
|
|
11
15
|
export interface ResolveTospecRootOptions {
|
|
12
16
|
startPath?: string;
|
|
13
17
|
allowImplicitRoot?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-selection.d.ts","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"root-selection.d.ts","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA;;;;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AAI,EAAE,kBAAkB,GAAG,UAAU,CAKjE;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,YAAY,CAOrE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,OAAO,EAClB,MAAM,GAAE;IACN,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACxB,GACL,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAgBpC"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* rule: walk up from the start path to the nearest ancestor that contains a
|
|
6
|
-
* `tospec/` directory; if none is found, treat the current directory as an
|
|
7
|
-
* implicit root (unless the caller forbids it).
|
|
2
|
+
* Root resolution: walk up from the start path to the nearest ancestor holding
|
|
3
|
+
* a `tospec/` directory, else treat the current directory as an implicit root
|
|
4
|
+
* unless the caller forbids it.
|
|
8
5
|
*/
|
|
9
6
|
import * as path from 'node:path';
|
|
10
7
|
import { findRepoPlanningRootSync, getSearchStartDirectory, } from './planning-home.js';
|
|
11
|
-
import { emitFailureStatus } from '../commands/shared-output.js';
|
|
8
|
+
import { emitFailureStatus, recordResolvedRoot } from '../commands/shared-output.js';
|
|
12
9
|
export class RootSelectionError extends Error {
|
|
13
10
|
diagnostic;
|
|
14
11
|
constructor(message, code, options = {}) {
|
|
@@ -68,11 +65,13 @@ export function toPlanningHome(root) {
|
|
|
68
65
|
*/
|
|
69
66
|
export async function resolveRootForCommand(_selector, output = {}) {
|
|
70
67
|
try {
|
|
71
|
-
|
|
68
|
+
const root = await resolveTospecRoot({
|
|
72
69
|
...(output.allowImplicitRoot !== undefined
|
|
73
70
|
? { allowImplicitRoot: output.allowImplicitRoot }
|
|
74
71
|
: {}),
|
|
75
72
|
});
|
|
73
|
+
recordResolvedRoot(toRootOutput(root));
|
|
74
|
+
return root;
|
|
76
75
|
}
|
|
77
76
|
catch (error) {
|
|
78
77
|
if (output.json && isRootSelectionError(error)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-selection.js","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"root-selection.js","sourceRoot":"","sources":["../../src/core/root-selection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAkCrF,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,UAAU,CAA0B;IAE7C,YACE,OAAe,EACf,IAAY,EACZ,OAAO,GAAsC,EAAE;QAE/C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG;YAChB,QAAQ,EAAE,OAAO;YACjB,IAAI;YACJ,OAAO;YACP,GAAG,OAAO;SACX,CAAC;IACJ,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,KAAK,YAAY,kBAAkB,CAAC;AAC7C,CAAC;AAED,SAAS,QAAQ,CAAC,QAAgB,EAAE,MAAwB;IAC1D,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;QACpD,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;QAChD,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QA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K,SAAS;gBACxC,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,EAAE;gBACjD,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;QACH,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,IAAI,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,iBAAiB,CAAC,MAAM,CAAC,cAAc,IAAI,EAAE,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/core/rules.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export interface RulesCommandOptions {
|
|
2
|
+
json?: boolean;
|
|
3
|
+
}
|
|
4
|
+
/** The `--json` null-shape; mirrors the success payload with `rules` nulled. */
|
|
5
|
+
export declare const RULES_FAILURE_PAYLOAD: Record<string, unknown>;
|
|
1
6
|
/** Refresh only the workflow rule files of agents already configured for tospec. */
|
|
2
7
|
export declare class RulesCommand {
|
|
3
|
-
execute(targetPath: string): Promise<void>;
|
|
8
|
+
execute(targetPath: string, options?: RulesCommandOptions): Promise<void>;
|
|
4
9
|
}
|
|
5
10
|
//# sourceMappingURL=rules.d.ts.map
|
package/dist/core/rules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAA+B,CAAC;AAE1F,oFAAoF;AACpF,qBAAa,YAAY;IACjB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkClF;CACF"}
|
package/dist/core/rules.js
CHANGED
|
@@ -3,20 +3,41 @@ import { FileSystemUtils } from '../utils/file-system.js';
|
|
|
3
3
|
import { TOSPEC_DIR_NAME } from './config.js';
|
|
4
4
|
import { getConfiguredTools } from './shared/tool-detection.js';
|
|
5
5
|
import { planWorkflowRules, writeWorkflowRules } from './shared/rules-generation.js';
|
|
6
|
+
import { emitSuccess } from '../commands/shared-output.js';
|
|
7
|
+
/** The `--json` null-shape; mirrors the success payload with `rules` nulled. */
|
|
8
|
+
export const RULES_FAILURE_PAYLOAD = { rules: null, root: null };
|
|
6
9
|
/** Refresh only the workflow rule files of agents already configured for tospec. */
|
|
7
10
|
export class RulesCommand {
|
|
8
|
-
async execute(targetPath) {
|
|
11
|
+
async execute(targetPath, options = {}) {
|
|
9
12
|
const projectPath = path.resolve(targetPath);
|
|
10
13
|
if (!await FileSystemUtils.directoryExists(path.join(projectPath, TOSPEC_DIR_NAME))) {
|
|
11
14
|
throw new Error("No Tospec directory found. Run 'tospec init' first.");
|
|
12
15
|
}
|
|
13
16
|
const tools = getConfiguredTools(projectPath);
|
|
14
17
|
if (tools.length === 0) {
|
|
18
|
+
// Not an error: a project can legitimately have no agent configured. The
|
|
19
|
+
// JSON form says so with an empty list, so a caller need not read English
|
|
20
|
+
// to tell "nothing to do" from "something went wrong".
|
|
21
|
+
if (options.json) {
|
|
22
|
+
emitSuccess({ rules: [], message: 'No configured tools found.' }, { path: projectPath, source: 'explicit' });
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
15
25
|
console.log('No configured tools found. Run "tospec init" to set up tools.');
|
|
16
26
|
return;
|
|
17
27
|
}
|
|
18
28
|
const plan = await planWorkflowRules(projectPath, tools);
|
|
19
|
-
await writeWorkflowRules(plan);
|
|
29
|
+
await writeWorkflowRules(plan, { silent: options.json });
|
|
30
|
+
if (options.json) {
|
|
31
|
+
emitSuccess({
|
|
32
|
+
rules: plan.map((entry) => ({
|
|
33
|
+
tool: entry.toolId,
|
|
34
|
+
rule: entry.rule,
|
|
35
|
+
path: entry.destination,
|
|
36
|
+
action: entry.action,
|
|
37
|
+
...(entry.retire ? { retiredPath: entry.retire } : {}),
|
|
38
|
+
})),
|
|
39
|
+
}, { path: projectPath, source: 'explicit' });
|
|
40
|
+
}
|
|
20
41
|
}
|
|
21
42
|
}
|
|
22
43
|
//# sourceMappingURL=rules.js.map
|
package/dist/core/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,gFAAgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAA4B,EAAE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,IAAI,EAAE,KAAK,CAAC,WAAW;oBACvB,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACvD,CAAC,CAAC;aACJ,EACD,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAC1C,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema names the command layer keys behaviour on. Kept out of any command
|
|
3
|
+
* module: `workflow/shared.ts` needs the decision name to refuse it for `new
|
|
4
|
+
* change`, and `decision.ts` needs the default schema to complete a root — with
|
|
5
|
+
* the constants living in those two files, each imported the other and the
|
|
6
|
+
* ESM cycle left one of them reading `undefined` depending on entry order.
|
|
7
|
+
*/
|
|
8
|
+
/** The schema `new change` and `templates` fall back to. */
|
|
9
|
+
export declare const DEFAULT_SCHEMA = "sdd";
|
|
10
|
+
/**
|
|
11
|
+
* Backs the ADR writer, not the change graph: a change created against it
|
|
12
|
+
* lands under `tospec/changes/` where `decision list` never sees it, so `new
|
|
13
|
+
* change` refuses it by name.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DECISION_SCHEMA_NAME = "decision";
|
|
16
|
+
//# sourceMappingURL=schema-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-names.d.ts","sourceRoot":"","sources":["../../src/core/schema-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema names the command layer keys behaviour on. Kept out of any command
|
|
3
|
+
* module: `workflow/shared.ts` needs the decision name to refuse it for `new
|
|
4
|
+
* change`, and `decision.ts` needs the default schema to complete a root — with
|
|
5
|
+
* the constants living in those two files, each imported the other and the
|
|
6
|
+
* ESM cycle left one of them reading `undefined` depending on entry order.
|
|
7
|
+
*/
|
|
8
|
+
/** The schema `new change` and `templates` fall back to. */
|
|
9
|
+
export const DEFAULT_SCHEMA = 'sdd';
|
|
10
|
+
/**
|
|
11
|
+
* Backs the ADR writer, not the change graph: a change created against it
|
|
12
|
+
* lands under `tospec/changes/` where `decision list` never sees it, so `new
|
|
13
|
+
* change` refuses it by name.
|
|
14
|
+
*/
|
|
15
|
+
export const DECISION_SCHEMA_NAME = 'decision';
|
|
16
|
+
//# sourceMappingURL=schema-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-names.js","sourceRoot":"","sources":["../../src/core/schema-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ScenarioSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3
4
|
rawText: z.ZodString;
|
|
4
5
|
}, z.core.$strip>;
|
|
5
6
|
export declare const RequirementSchema: z.ZodObject<{
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
8
|
text: z.ZodString;
|
|
7
9
|
scenarios: z.ZodArray<z.ZodObject<{
|
|
10
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
11
|
rawText: z.ZodString;
|
|
9
12
|
}, z.core.$strip>>;
|
|
10
13
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/base.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"base.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/base.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;iBASzB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;iBAoB5B,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { VALIDATION_MESSAGES } from '../validation/constants.js';
|
|
3
3
|
export const ScenarioSchema = z.object({
|
|
4
|
+
/**
|
|
5
|
+
* The `#### Scenario: <name>` heading text, without the `Scenario:` prefix.
|
|
6
|
+
*
|
|
7
|
+
* Optional only so a hand-built Scenario in a test or a future caller does
|
|
8
|
+
* not have to invent one; every parsed scenario carries it.
|
|
9
|
+
*/
|
|
10
|
+
name: z.string().optional(),
|
|
4
11
|
rawText: z.string().min(1, VALIDATION_MESSAGES.SCENARIO_EMPTY),
|
|
5
12
|
});
|
|
6
13
|
export const RequirementSchema = z.object({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The `### Requirement: <name>` heading text, without the `Requirement:`
|
|
16
|
+
* prefix.
|
|
17
|
+
*
|
|
18
|
+
* Carried rather than discarded: a MODIFIED, REMOVED or RENAMED delta must
|
|
19
|
+
* reproduce the header exactly and archive hard-fails on a mismatch, so
|
|
20
|
+
* `show --json` has to report it.
|
|
21
|
+
*
|
|
22
|
+
* Optional in the schema so a hand-built Requirement need not supply one;
|
|
23
|
+
* every parsed requirement carries it.
|
|
24
|
+
*/
|
|
25
|
+
name: z.string().optional(),
|
|
26
|
+
// SHALL/MUST body-keyword enforcement lives in Validator.applySpecRules: the
|
|
27
|
+
// parser collapses the requirement header into `text`, so a Zod refine here
|
|
28
|
+
// cannot tell "keyword in header only" from "keyword in body".
|
|
13
29
|
text: z.string()
|
|
14
30
|
.min(1, VALIDATION_MESSAGES.REQUIREMENT_EMPTY),
|
|
15
31
|
scenarios: z.array(ScenarioSchema)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/base.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,
|
|
1
|
+
{"version":3,"file":"base.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/base.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC;;;;;OAKG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC;;;;;;;;;;OAUG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,6EAA6E;IAC7E,4EAA4E;IAC5E,+DAA+D;IAC/D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;SACb,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,iBAAiB,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;SAC/B,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,wBAAwB,CAAC;CACxD,CAAC,CAAC"}
|
|
@@ -15,14 +15,18 @@ export declare const DeltaSchema: z.ZodObject<{
|
|
|
15
15
|
}>;
|
|
16
16
|
description: z.ZodString;
|
|
17
17
|
requirement: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
name: z.ZodOptional<z.ZodString>;
|
|
18
19
|
text: z.ZodString;
|
|
19
20
|
scenarios: z.ZodArray<z.ZodObject<{
|
|
21
|
+
name: z.ZodOptional<z.ZodString>;
|
|
20
22
|
rawText: z.ZodString;
|
|
21
23
|
}, z.core.$strip>>;
|
|
22
24
|
}, z.core.$strip>>;
|
|
23
25
|
requirements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
|
+
name: z.ZodOptional<z.ZodString>;
|
|
24
27
|
text: z.ZodString;
|
|
25
28
|
scenarios: z.ZodArray<z.ZodObject<{
|
|
29
|
+
name: z.ZodOptional<z.ZodString>;
|
|
26
30
|
rawText: z.ZodString;
|
|
27
31
|
}, z.core.$strip>>;
|
|
28
32
|
}, z.core.$strip>>>;
|
|
@@ -31,6 +35,14 @@ export declare const DeltaSchema: z.ZodObject<{
|
|
|
31
35
|
to: z.ZodString;
|
|
32
36
|
}, z.core.$strip>>;
|
|
33
37
|
}, z.core.$strip>;
|
|
38
|
+
/**
|
|
39
|
+
* The *shape* of a parsed change — what `ChangeParser` returns and what `Change`
|
|
40
|
+
* is inferred from — not where a change's rules live. Those are in
|
|
41
|
+
* `schemas/<name>/schema.yaml` (read by `validateSections`) and
|
|
42
|
+
* `validateChangeDeltaSpecs`.
|
|
43
|
+
*
|
|
44
|
+
* Keep it that way: nothing in `src/` runs a rule added here.
|
|
45
|
+
*/
|
|
34
46
|
export declare const ChangeSchema: z.ZodObject<{
|
|
35
47
|
name: z.ZodString;
|
|
36
48
|
why: z.ZodString;
|
|
@@ -45,14 +57,18 @@ export declare const ChangeSchema: z.ZodObject<{
|
|
|
45
57
|
}>;
|
|
46
58
|
description: z.ZodString;
|
|
47
59
|
requirement: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
name: z.ZodOptional<z.ZodString>;
|
|
48
61
|
text: z.ZodString;
|
|
49
62
|
scenarios: z.ZodArray<z.ZodObject<{
|
|
63
|
+
name: z.ZodOptional<z.ZodString>;
|
|
50
64
|
rawText: z.ZodString;
|
|
51
65
|
}, z.core.$strip>>;
|
|
52
66
|
}, z.core.$strip>>;
|
|
53
67
|
requirements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
name: z.ZodOptional<z.ZodString>;
|
|
54
69
|
text: z.ZodString;
|
|
55
70
|
scenarios: z.ZodArray<z.ZodObject<{
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
56
72
|
rawText: z.ZodString;
|
|
57
73
|
}, z.core.$strip>>;
|
|
58
74
|
}, z.core.$strip>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"change.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;EAAsD,CAAC;AAatF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BtB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUvB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1,27 +1,58 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { RequirementSchema } from './base.schema.js';
|
|
3
|
-
import {
|
|
2
|
+
import { RequirementSchema, ScenarioSchema } from './base.schema.js';
|
|
3
|
+
import { VALIDATION_MESSAGES } from '../validation/constants.js';
|
|
4
4
|
export const DeltaOperationType = z.enum(['ADDED', 'MODIFIED', 'REMOVED', 'RENAMED']);
|
|
5
|
+
/**
|
|
6
|
+
* A requirement as a delta carries it. Identical to RequirementSchema except
|
|
7
|
+
* that the scenario list may be empty, because a REMOVED entry names a
|
|
8
|
+
* requirement that is going away: the canonical form for it is a bullet with
|
|
9
|
+
* Reason/Migration fields, which has no scenarios to restate. The min-1 rule
|
|
10
|
+
* still applies to every other operation — see the refinement below.
|
|
11
|
+
*/
|
|
12
|
+
const DeltaRequirementSchema = RequirementSchema.extend({
|
|
13
|
+
scenarios: z.array(ScenarioSchema),
|
|
14
|
+
});
|
|
5
15
|
export const DeltaSchema = z.object({
|
|
6
16
|
spec: z.string().min(1, VALIDATION_MESSAGES.DELTA_SPEC_EMPTY),
|
|
7
17
|
operation: DeltaOperationType,
|
|
8
18
|
description: z.string().min(1, VALIDATION_MESSAGES.DELTA_DESCRIPTION_EMPTY),
|
|
9
|
-
requirement:
|
|
10
|
-
requirements: z.array(
|
|
19
|
+
requirement: DeltaRequirementSchema.optional(),
|
|
20
|
+
requirements: z.array(DeltaRequirementSchema).optional(),
|
|
11
21
|
rename: z.object({
|
|
12
22
|
from: z.string(),
|
|
13
23
|
to: z.string(),
|
|
14
24
|
}).optional(),
|
|
25
|
+
}).superRefine((delta, ctx) => {
|
|
26
|
+
// Scenario-less requirements are only legal on a REMOVED delta. Enforced here
|
|
27
|
+
// rather than on the field so every operation keeps one shape.
|
|
28
|
+
if (delta.operation === 'REMOVED')
|
|
29
|
+
return;
|
|
30
|
+
const reject = (path) => ctx.addIssue({
|
|
31
|
+
code: z.ZodIssueCode.custom,
|
|
32
|
+
message: VALIDATION_MESSAGES.REQUIREMENT_NO_SCENARIOS,
|
|
33
|
+
path,
|
|
34
|
+
});
|
|
35
|
+
if (delta.requirement && delta.requirement.scenarios.length === 0) {
|
|
36
|
+
reject(['requirement', 'scenarios']);
|
|
37
|
+
}
|
|
38
|
+
delta.requirements?.forEach((requirement, index) => {
|
|
39
|
+
if (requirement.scenarios.length === 0)
|
|
40
|
+
reject(['requirements', index, 'scenarios']);
|
|
41
|
+
});
|
|
15
42
|
});
|
|
43
|
+
/**
|
|
44
|
+
* The *shape* of a parsed change — what `ChangeParser` returns and what `Change`
|
|
45
|
+
* is inferred from — not where a change's rules live. Those are in
|
|
46
|
+
* `schemas/<name>/schema.yaml` (read by `validateSections`) and
|
|
47
|
+
* `validateChangeDeltaSpecs`.
|
|
48
|
+
*
|
|
49
|
+
* Keep it that way: nothing in `src/` runs a rule added here.
|
|
50
|
+
*/
|
|
16
51
|
export const ChangeSchema = z.object({
|
|
17
52
|
name: z.string().min(1, VALIDATION_MESSAGES.CHANGE_NAME_EMPTY),
|
|
18
|
-
why: z.string()
|
|
19
|
-
.min(MIN_WHY_SECTION_LENGTH, VALIDATION_MESSAGES.CHANGE_WHY_TOO_SHORT)
|
|
20
|
-
.max(MAX_WHY_SECTION_LENGTH, VALIDATION_MESSAGES.CHANGE_WHY_TOO_LONG),
|
|
53
|
+
why: z.string(),
|
|
21
54
|
whatChanges: z.string().min(1, VALIDATION_MESSAGES.CHANGE_WHAT_EMPTY),
|
|
22
|
-
deltas: z.array(DeltaSchema)
|
|
23
|
-
.min(1, VALIDATION_MESSAGES.CHANGE_NO_DELTAS)
|
|
24
|
-
.max(MAX_DELTAS_PER_CHANGE, VALIDATION_MESSAGES.CHANGE_TOO_MANY_DELTAS),
|
|
55
|
+
deltas: z.array(DeltaSchema),
|
|
25
56
|
metadata: z.object({
|
|
26
57
|
version: z.string().default('1.0.0'),
|
|
27
58
|
format: z.literal('tospec-change'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"change.schema.js","sourceRoot":"","sources":["../../../src/core/schemas/change.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CA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AAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,iBAAiB,CAAC;IAC9D,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,iBAAiB,CAAC;IACrE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;QACpC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;QAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC"}
|
|
@@ -3,8 +3,10 @@ export declare const SpecSchema: z.ZodObject<{
|
|
|
3
3
|
name: z.ZodString;
|
|
4
4
|
overview: z.ZodString;
|
|
5
5
|
requirements: z.ZodArray<z.ZodObject<{
|
|
6
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
7
|
text: z.ZodString;
|
|
7
8
|
scenarios: z.ZodArray<z.ZodObject<{
|
|
9
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
10
|
rawText: z.ZodString;
|
|
9
11
|
}, z.core.$strip>>;
|
|
10
12
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/spec.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"spec.schema.d.ts","sourceRoot":"","sources":["../../../src/core/schemas/spec.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;iBAUrB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Common code shared between init and update commands.
|
|
5
|
-
*/
|
|
6
|
-
export { SKILL_NAMES, LEGACY_SKILL_DIRS, type ToolSkillStatus, type ToolVersionStatus, removeLegacySkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
7
|
-
export { type SkillTemplateEntry, type CommandTemplateEntry, getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, } from './skill-generation.js';
|
|
8
|
-
export { writeToolRules } from './rules-generation.js';
|
|
1
|
+
export { SKILL_NAMES, LEGACY_SKILL_DIRS, type ToolSkillStatus, type ToolVersionStatus, removeLegacySkillDirs, removeUnselectedSkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
2
|
+
export { type SkillTemplateEntry, type CommandTemplateEntry, type WorkflowReferenceGap, getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, findWorkflowReferenceGaps, describeWorkflowReferenceGaps, } from './skill-generation.js';
|
|
3
|
+
export { planWorkflowRules, writeWorkflowRules } from './rules-generation.js';
|
|
9
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Common code shared between init and update commands.
|
|
5
|
-
*/
|
|
6
|
-
export { SKILL_NAMES, LEGACY_SKILL_DIRS, removeLegacySkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
7
|
-
export { getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, } from './skill-generation.js';
|
|
8
|
-
export { writeToolRules } from './rules-generation.js';
|
|
1
|
+
export { SKILL_NAMES, LEGACY_SKILL_DIRS, removeLegacySkillDirs, removeUnselectedSkillDirs, removeLegacyToolSkillLayout, getToolsWithSkillsDir, getToolSkillStatus, getToolStates, extractGeneratedByVersion, getToolVersionStatus, getConfiguredTools, } from './tool-detection.js';
|
|
2
|
+
export { getSkillTemplates, getCommandTemplates, getCommandContents, generateSkillContent, writeSkillDir, writeToolCommands, findWorkflowReferenceGaps, describeWorkflowReferenceGaps, } from './skill-generation.js';
|
|
3
|
+
export { planWorkflowRules, writeWorkflowRules } from './rules-generation.js';
|
|
9
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EAGjB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Every rule document tospec writes is managed the same way: a shipped Markdown
|
|
3
|
+
* template, wrapped in a hash-stamped marker, planned read-only before any
|
|
4
|
+
* project write, and refused rather than overwritten once somebody has edited
|
|
5
|
+
* it. Without the marker there is no way to tell a generated file from an
|
|
6
|
+
* edited one, and `tospec init` silently loses the edit.
|
|
6
7
|
*/
|
|
7
|
-
/** Write tospec rule files into `<projectPath>/<agentBaseDir>/rules/` for one tool. */
|
|
8
|
-
export declare function writeToolRules(projectPath: string, agentBaseDir: string): Promise<void>;
|
|
9
8
|
export interface WorkflowRulePlan {
|
|
10
9
|
toolId: string;
|
|
10
|
+
/** Which managed rule this entry writes; distinguishes a tool's entries. */
|
|
11
|
+
rule: string;
|
|
11
12
|
destination: string;
|
|
12
13
|
content: string;
|
|
13
14
|
action: 'created' | 'updated' | 'unchanged';
|
|
15
|
+
/**
|
|
16
|
+
* A copy under the previous misspelled filename to delete after the write.
|
|
17
|
+
* Absent unless one is there and is verifiably tospec-generated.
|
|
18
|
+
*/
|
|
19
|
+
retire?: string;
|
|
14
20
|
}
|
|
15
21
|
/** Read every target before allowing any project mutation. */
|
|
16
22
|
export declare function planWorkflowRules(projectPath: string, toolIds: string[]): Promise<WorkflowRulePlan[]>;
|
|
17
|
-
/**
|
|
18
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Call only after the complete plan passed preflight. `silent` suppresses the
|
|
25
|
+
* progress prose for a `--json` caller, whose stdout must stay one document.
|
|
26
|
+
*/
|
|
27
|
+
export declare function writeWorkflowRules(plan: WorkflowRulePlan[], options?: {
|
|
28
|
+
silent?: boolean;
|
|
29
|
+
}): Promise<void>;
|
|
19
30
|
//# sourceMappingURL=rules-generation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-generation.d.ts","sourceRoot":"","sources":["../../../src/core/shared/rules-generation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rules-generation.d.ts","sourceRoot":"","sources":["../../../src/core/shared/rules-generation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoEH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAC5C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuCD,8DAA8D;AAC9D,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAkE3G;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,gBAAgB,EAAE,EACxB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|