@seanmars/tospec 0.19.0-beta.8 → 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 -310
- package/README.md +69 -82
- package/assets/dashboard/app.js +11 -0
- package/assets/dashboard/style.css +7 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +89 -106
- 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 +293 -145
- 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 +190 -313
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts +38 -27
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +296 -128
- 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 +12 -27
- package/dist/commands/shared-output.d.ts.map +1 -1
- package/dist/commands/shared-output.js +22 -45
- package/dist/commands/shared-output.js.map +1 -1
- package/dist/commands/show.d.ts +4 -7
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +23 -11
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/validate.d.ts +34 -58
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +225 -141
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/workflow/index.d.ts +1 -5
- package/dist/commands/workflow/index.d.ts.map +1 -1
- package/dist/commands/workflow/index.js +1 -5
- package/dist/commands/workflow/index.js.map +1 -1
- package/dist/commands/workflow/instructions.d.ts +14 -24
- package/dist/commands/workflow/instructions.d.ts.map +1 -1
- package/dist/commands/workflow/instructions.js +219 -128
- package/dist/commands/workflow/instructions.js.map +1 -1
- package/dist/commands/workflow/new-change.d.ts +2 -5
- package/dist/commands/workflow/new-change.d.ts.map +1 -1
- package/dist/commands/workflow/new-change.js +69 -32
- package/dist/commands/workflow/new-change.js.map +1 -1
- package/dist/commands/workflow/schemas.d.ts +1 -5
- package/dist/commands/workflow/schemas.d.ts.map +1 -1
- package/dist/commands/workflow/schemas.js +6 -17
- package/dist/commands/workflow/schemas.js.map +1 -1
- package/dist/commands/workflow/shared.d.ts +37 -42
- package/dist/commands/workflow/shared.d.ts.map +1 -1
- package/dist/commands/workflow/shared.js +23 -54
- package/dist/commands/workflow/shared.js.map +1 -1
- package/dist/commands/workflow/status.d.ts +7 -17
- package/dist/commands/workflow/status.d.ts.map +1 -1
- package/dist/commands/workflow/status.js +57 -72
- package/dist/commands/workflow/status.js.map +1 -1
- package/dist/commands/workflow/templates.d.ts +8 -8
- package/dist/commands/workflow/templates.d.ts.map +1 -1
- package/dist/commands/workflow/templates.js +32 -46
- package/dist/commands/workflow/templates.js.map +1 -1
- package/dist/core/archive.d.ts +22 -31
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +296 -283
- 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 +54 -120
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +129 -111
- 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 +36 -81
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
- package/dist/core/artifact-graph/resolver.js +60 -101
- 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 +6 -14
- package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -1
- package/dist/core/artifact-graph/stub-detection.js +13 -16
- package/dist/core/artifact-graph/stub-detection.js.map +1 -1
- 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 +16 -27
- package/dist/core/change-presenter.d.ts.map +1 -1
- package/dist/core/change-presenter.js +53 -53
- package/dist/core/change-presenter.js.map +1 -1
- package/dist/core/change-status-policy.d.ts +4 -8
- package/dist/core/change-status-policy.d.ts.map +1 -1
- package/dist/core/change-status-policy.js +9 -17
- 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 +7 -41
- package/dist/core/config-schema.d.ts.map +1 -1
- package/dist/core/config-schema.js +35 -74
- package/dist/core/config-schema.js.map +1 -1
- package/dist/core/config.d.ts +25 -49
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +22 -45
- 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 +35 -22
- package/dist/core/dashboard-data.d.ts.map +1 -1
- package/dist/core/dashboard-data.js +57 -72
- 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 +12 -28
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +90 -168
- package/dist/core/init.js.map +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +80 -38
- 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 +15 -23
- package/dist/core/markdown-render.d.ts.map +1 -1
- package/dist/core/markdown-render.js +25 -34
- package/dist/core/markdown-render.js.map +1 -1
- package/dist/core/migrate.d.ts +19 -16
- package/dist/core/migrate.d.ts.map +1 -1
- package/dist/core/migrate.js +151 -135
- 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 +23 -30
- 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 +8 -14
- package/dist/core/root-selection.d.ts.map +1 -1
- package/dist/core/root-selection.js +3 -6
- package/dist/core/root-selection.js.map +1 -1
- package/dist/core/rules.d.ts.map +1 -1
- package/dist/core/rules.js +2 -3
- 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.map +1 -1
- package/dist/core/schemas/base.schema.js +6 -12
- package/dist/core/schemas/base.schema.js.map +1 -1
- package/dist/core/schemas/change.schema.d.ts +8 -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/shared/index.d.ts +2 -7
- package/dist/core/shared/index.d.ts.map +1 -1
- package/dist/core/shared/index.js +2 -7
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/rules-generation.d.ts +5 -15
- package/dist/core/shared/rules-generation.d.ts.map +1 -1
- package/dist/core/shared/rules-generation.js +33 -37
- 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 +35 -76
- package/dist/core/shared/tool-detection.d.ts.map +1 -1
- package/dist/core/shared/tool-detection.js +73 -93
- 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.d.ts.map +1 -1
- package/dist/core/spec-presenter.js +5 -10
- package/dist/core/spec-presenter.js.map +1 -1
- package/dist/core/specs-apply.d.ts +16 -31
- package/dist/core/specs-apply.d.ts.map +1 -1
- package/dist/core/specs-apply.js +146 -195
- 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 +16 -5
- package/dist/core/templates/workflows/archive.js.map +1 -1
- package/dist/core/templates/workflows/decision.js +3 -3
- 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 +10 -36
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +59 -126
- 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 -25
- 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 +30 -12
- 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 +42 -68
- package/dist/core/validation/validator.d.ts.map +1 -1
- package/dist/core/validation/validator.js +468 -285
- 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 +24 -76
- package/dist/utils/change-utils.d.ts.map +1 -1
- package/dist/utils/change-utils.js +95 -142
- 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 +10 -20
- package/dist/utils/item-discovery.d.ts.map +1 -1
- package/dist/utils/item-discovery.js +31 -55
- 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/issue/schema.yaml +8 -1
- package/schemas/issue/templates/spec.md +20 -3
- package/schemas/sdd/schema.yaml +20 -1
- package/schemas/sdd/templates/spec.md +20 -3
|
@@ -2,9 +2,6 @@ import * as fs from 'node:fs';
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import fg from 'fast-glob';
|
|
4
4
|
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
5
|
-
/**
|
|
6
|
-
* Checks if a path contains glob pattern characters.
|
|
7
|
-
*/
|
|
8
5
|
export function isGlobPattern(pattern) {
|
|
9
6
|
return pattern.includes('*') || pattern.includes('?') || pattern.includes('[');
|
|
10
7
|
}
|
|
@@ -12,17 +9,13 @@ export function isGlobPattern(pattern) {
|
|
|
12
9
|
* A pattern whose wildcard occupies exactly one whole path segment, with every
|
|
13
10
|
* other segment literal — `specs/*` or `specs/<*>/spec.md`.
|
|
14
11
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* compilation and stream setup — the dominant cost on the dashboard's hot path,
|
|
20
|
-
* where the whole aggregation re-runs on every file save.
|
|
12
|
+
* The only glob shape any shipped schema declares. Answering it with `readdir` +
|
|
13
|
+
* `stat` skips a glob engine's per-call pattern compilation and stream setup —
|
|
14
|
+
* the dominant cost on the dashboard's hot path, which re-runs the whole
|
|
15
|
+
* aggregation on every file save.
|
|
21
16
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* something this cannot express; the fast path is an optimisation, not a
|
|
25
|
-
* narrowing of the contract.
|
|
17
|
+
* `null` for any other shape, so the caller falls back to fast-glob: the fast
|
|
18
|
+
* path is an optimisation, not a narrowing of the contract.
|
|
26
19
|
*/
|
|
27
20
|
function splitSingleWildcard(generates) {
|
|
28
21
|
const segments = FileSystemUtils.toPosixPath(generates).split('/');
|
|
@@ -40,16 +33,40 @@ function splitSingleWildcard(generates) {
|
|
|
40
33
|
return null;
|
|
41
34
|
return { prefix: segments.slice(0, wildcardIndex), suffix: segments.slice(wildcardIndex + 1) };
|
|
42
35
|
}
|
|
43
|
-
/** Shared tail so the sync and async resolvers
|
|
36
|
+
/** Shared tail, so the sync and async resolvers finish identically. */
|
|
44
37
|
function finalizeMatches(matches) {
|
|
45
38
|
return Array.from(new Set(matches)).sort();
|
|
46
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Whether each fixed segment after the wildcard is spelled on disk exactly as
|
|
42
|
+
* the pattern spells it. `stat` answers case-insensitively on Windows and
|
|
43
|
+
* macOS while fast-glob matches names literally, so without this the fast
|
|
44
|
+
* path counted `SPEC.MD` as done and the glob path did not.
|
|
45
|
+
*/
|
|
46
|
+
function hasExactSuffixSpelling(dir, suffix) {
|
|
47
|
+
let current = dir;
|
|
48
|
+
for (const segment of suffix) {
|
|
49
|
+
if (!fs.readdirSync(current).includes(segment))
|
|
50
|
+
return false;
|
|
51
|
+
current = path.join(current, segment);
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
async function hasExactSuffixSpellingAsync(dir, suffix) {
|
|
56
|
+
let current = dir;
|
|
57
|
+
for (const segment of suffix) {
|
|
58
|
+
if (!(await fs.promises.readdir(current)).includes(segment))
|
|
59
|
+
return false;
|
|
60
|
+
current = path.join(current, segment);
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
47
64
|
function globFallbackOptions(changeDir) {
|
|
48
65
|
return { cwd: changeDir, onlyFiles: true, absolute: true };
|
|
49
66
|
}
|
|
50
67
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
68
|
+
* Absolute paths of the files an artifact's `generates` currently resolves to.
|
|
69
|
+
* Sorted, for deterministic output.
|
|
53
70
|
*/
|
|
54
71
|
export function resolveArtifactOutputs(changeDir, generates) {
|
|
55
72
|
if (!isGlobPattern(generates)) {
|
|
@@ -81,10 +98,10 @@ export function resolveArtifactOutputs(changeDir, generates) {
|
|
|
81
98
|
continue;
|
|
82
99
|
const candidate = path.join(baseDir, entry, ...single.suffix);
|
|
83
100
|
try {
|
|
84
|
-
// statSync
|
|
85
|
-
// default followSymbolicLinks does
|
|
101
|
+
// statSync, not the Dirent type, so symlinks resolve as fast-glob's
|
|
102
|
+
// default followSymbolicLinks does and `onlyFiles` still holds for a
|
|
86
103
|
// *directory* named spec.md.
|
|
87
|
-
if (fs.statSync(candidate).isFile()) {
|
|
104
|
+
if (fs.statSync(candidate).isFile() && hasExactSuffixSpelling(path.join(baseDir, entry), single.suffix)) {
|
|
88
105
|
matches.push(FileSystemUtils.canonicalizeExistingPath(candidate));
|
|
89
106
|
}
|
|
90
107
|
}
|
|
@@ -101,24 +118,16 @@ export function resolveArtifactOutputs(changeDir, generates) {
|
|
|
101
118
|
return finalizeMatches(matches);
|
|
102
119
|
}
|
|
103
120
|
/**
|
|
104
|
-
* Async twin of {@link resolveArtifactOutputs}, for `collectChangeDetail
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* per-artifact resolution is the one that has something to interleave with.
|
|
121
|
+
* Async twin of {@link resolveArtifactOutputs}, for `collectChangeDetail`: a
|
|
122
|
+
* detail pane is fetched while the overview may still be aggregating, so it has
|
|
123
|
+
* something to interleave with.
|
|
108
124
|
*
|
|
109
|
-
* It does **not** serve the save-triggered overview,
|
|
110
|
-
*
|
|
111
|
-
* through `artifactSummaryFor` → `formatChangeStatus` → `artifactOutputExists`
|
|
112
|
-
* and through `listTasksForChange`, both synchronous — deliberately, and
|
|
113
|
-
* measured: dashboard-data.ts records 2.1 ms as the longest stall across 30
|
|
114
|
-
* changes with the sync resolver in place, because the awaits already sitting in
|
|
115
|
-
* that loop break the work across iterations. What removed the cost there was
|
|
116
|
-
* the single-wildcard `readdir` fast path above, not asynchrony.
|
|
125
|
+
* It does **not** serve the save-triggered overview, which reaches this module
|
|
126
|
+
* only through synchronous paths — see the measurement in dashboard-data.ts.
|
|
117
127
|
*
|
|
118
128
|
* The duplicated branch structure is held to the sync version by the parity
|
|
119
|
-
* cases in test/core/artifact-graph/outputs.test.ts
|
|
120
|
-
*
|
|
121
|
-
* and assert identical results. Any behaviour added to one belongs in that list.
|
|
129
|
+
* cases in test/core/artifact-graph/outputs.test.ts. Any behaviour added to one
|
|
130
|
+
* belongs in that list.
|
|
122
131
|
*/
|
|
123
132
|
export async function resolveArtifactOutputsAsync(changeDir, generates) {
|
|
124
133
|
if (!isGlobPattern(generates)) {
|
|
@@ -147,7 +156,8 @@ export async function resolveArtifactOutputsAsync(changeDir, generates) {
|
|
|
147
156
|
return null;
|
|
148
157
|
const candidate = path.join(baseDir, entry, ...single.suffix);
|
|
149
158
|
try {
|
|
150
|
-
return (await fs.promises.stat(candidate)).isFile()
|
|
159
|
+
return (await fs.promises.stat(candidate)).isFile() &&
|
|
160
|
+
(await hasExactSuffixSpellingAsync(path.join(baseDir, entry), single.suffix))
|
|
151
161
|
? FileSystemUtils.canonicalizeExistingPath(candidate)
|
|
152
162
|
: null;
|
|
153
163
|
}
|
|
@@ -161,9 +171,6 @@ export async function resolveArtifactOutputsAsync(changeDir, generates) {
|
|
|
161
171
|
const matches = (await fg(normalizedPattern, globFallbackOptions(changeDir))).map((match) => FileSystemUtils.canonicalizeExistingPath(path.normalize(match)));
|
|
162
172
|
return finalizeMatches(matches);
|
|
163
173
|
}
|
|
164
|
-
/**
|
|
165
|
-
* Checks if an artifact has at least one resolved output file.
|
|
166
|
-
*/
|
|
167
174
|
export function artifactOutputExists(changeDir, generates) {
|
|
168
175
|
return resolveArtifactOutputs(changeDir, generates).length > 0;
|
|
169
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../../src/core/artifact-graph/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,WAAW,CAAC,SAAS,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC1F,eAAe,CAAC,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAChE,CAAC;IAEF,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,SAAiB;IACvE,OAAO,sBAAsB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import type { SchemaYaml } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Error thrown when loading a schema fails.
|
|
5
|
-
*/
|
|
6
3
|
export declare class SchemaLoadError extends Error {
|
|
7
4
|
readonly schemaPath: string;
|
|
8
5
|
readonly cause?: Error | undefined;
|
|
9
6
|
constructor(message: string, schemaPath: string, cause?: Error | undefined);
|
|
10
7
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Gets the package's built-in schemas directory path.
|
|
13
|
-
* Uses import.meta.url to resolve relative to the current module.
|
|
14
|
-
*/
|
|
8
|
+
/** Walks up from dist/core/artifact-graph/ to the package root's schemas/. */
|
|
15
9
|
export declare function getPackageSchemasDir(): string;
|
|
16
10
|
/**
|
|
17
11
|
* The user's schema override directory: inside the config directory, unless
|
|
@@ -19,80 +13,50 @@ export declare function getPackageSchemasDir(): string;
|
|
|
19
13
|
* than adding to it, so exactly one user-level override directory is ever live.
|
|
20
14
|
*/
|
|
21
15
|
export declare function getUserSchemasDir(): string;
|
|
22
|
-
/**
|
|
23
|
-
* Gets the project-local schemas directory path.
|
|
24
|
-
* @param projectRoot - The project root directory
|
|
25
|
-
* @returns The path to the project's schemas directory
|
|
26
|
-
*/
|
|
27
16
|
export declare function getProjectSchemasDir(projectRoot: string): string;
|
|
28
17
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* `
|
|
32
|
-
* directory has `isDirectory() === false`; such entries are dereferenced via
|
|
33
|
-
* `statSync` to admit symlinked schema dirs while still rejecting
|
|
34
|
-
* symlinks-to-files and broken/dangling links.
|
|
18
|
+
* True for real directories and for symlinks pointing at one. `Dirent`'s
|
|
19
|
+
* `isDirectory()` reports the raw entry type, so a symlinked schema dir needs
|
|
20
|
+
* the `statSync` dereference below.
|
|
35
21
|
*/
|
|
36
22
|
export declare function isSchemaDir(parentDir: string, entry: fs.Dirent): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Resolves a schema name to its directory path.
|
|
39
|
-
*
|
|
40
|
-
* Resolution order (when projectRoot is provided):
|
|
41
|
-
* 1. Project-local: <projectRoot>/tospec/schemas/<name>/schema.yaml
|
|
42
|
-
* 2. User override: ${XDG_DATA_HOME}/tospec/schemas/<name>/schema.yaml
|
|
43
|
-
* 3. Package built-in: <package>/schemas/<name>/schema.yaml
|
|
44
|
-
*
|
|
45
|
-
* When projectRoot is not provided, only user override and package built-in are checked
|
|
46
|
-
* (backward compatible behavior).
|
|
47
|
-
*
|
|
48
|
-
* @param name - Schema name (e.g., "sdd")
|
|
49
|
-
* @param projectRoot - Optional project root directory for project-local schema resolution
|
|
50
|
-
* @returns The path to the schema directory, or null if not found
|
|
51
|
-
*/
|
|
52
23
|
/**
|
|
53
24
|
* Identity of a file's current contents, for cache invalidation. Null when the
|
|
54
25
|
* file cannot be stat'd, which disables caching for that path rather than
|
|
55
26
|
* risking a stale hit.
|
|
56
27
|
*/
|
|
57
28
|
export declare function fileStamp(filePath: string): string | null;
|
|
58
|
-
export declare function getSchemaDir(name: string, projectRoot?: string): string | null;
|
|
59
29
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* 2. User override: ${XDG_DATA_HOME}/tospec/schemas/<name>/schema.yaml
|
|
65
|
-
* 3. Package built-in: <package>/schemas/<name>/schema.yaml
|
|
66
|
-
*
|
|
67
|
-
* When projectRoot is not provided, only user override and package built-in are checked
|
|
68
|
-
* (backward compatible behavior).
|
|
30
|
+
* The directory holding `<name>/schema.yaml` and the layer it came from, or
|
|
31
|
+
* null when no layer has one. Project-local wins over the user override, which
|
|
32
|
+
* wins over the package built-in; without `projectRoot` only the last two are
|
|
33
|
+
* searched.
|
|
69
34
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @throws Error if schema is not found in any location
|
|
35
|
+
* The layer is resolved here rather than re-derived from the path by each
|
|
36
|
+
* caller: a directory is the *whole* schema, templates included, so "which layer
|
|
37
|
+
* won" is what explains a file the winning layer does not have.
|
|
74
38
|
*/
|
|
75
|
-
export declare function
|
|
39
|
+
export declare function getSchemaDirWithSource(name: string, projectRoot?: string): {
|
|
40
|
+
dir: string;
|
|
41
|
+
source: SchemaInfo['source'];
|
|
42
|
+
} | null;
|
|
43
|
+
/** As `getSchemaDirWithSource`, for callers that only need the path. */
|
|
44
|
+
export declare function getSchemaDir(name: string, projectRoot?: string): string | null;
|
|
76
45
|
/**
|
|
77
|
-
*
|
|
78
|
-
* Combines project-local, user override, and package built-in schemas.
|
|
46
|
+
* The parsed schema, resolved through `getSchemaDir`'s precedence order.
|
|
79
47
|
*
|
|
80
|
-
* @
|
|
48
|
+
* @throws SchemaLoadError when the file cannot be read or does not parse.
|
|
81
49
|
*/
|
|
50
|
+
export declare function resolveSchema(name: string, projectRoot?: string): SchemaYaml;
|
|
51
|
+
/** Every schema name on disk across all three layers. */
|
|
82
52
|
export declare function listSchemas(projectRoot?: string): string[];
|
|
83
53
|
/**
|
|
84
54
|
* Names of the schemas that actually load — what an "Available schemas:" list
|
|
85
|
-
* has to mean.
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* offered as a choice and then produced an unusable change (round 4 report 5).
|
|
89
|
-
* Anything phrased as advice to the user belongs on this list; enumeration of
|
|
90
|
-
* what is on disk stays on `listSchemas`.
|
|
55
|
+
* has to mean. `listSchemas` reports directory names, so a schema.yaml with a
|
|
56
|
+
* typo in it would be offered as a choice. Anything phrased as advice to the
|
|
57
|
+
* user belongs here.
|
|
91
58
|
*/
|
|
92
59
|
export declare function listLoadableSchemas(projectRoot?: string): string[];
|
|
93
|
-
/**
|
|
94
|
-
* Schema info with metadata (name, description, artifacts).
|
|
95
|
-
*/
|
|
96
60
|
export interface SchemaInfo {
|
|
97
61
|
name: string;
|
|
98
62
|
description: string;
|
|
@@ -100,44 +64,35 @@ export interface SchemaInfo {
|
|
|
100
64
|
source: 'project' | 'user' | 'package';
|
|
101
65
|
/**
|
|
102
66
|
* Absolute path to the directory holding schema.yaml (and its templates/).
|
|
103
|
-
* `source` says which of the three layers won; this says which file to open
|
|
104
|
-
* the question a schema author actually has when a resolution surprises them.
|
|
67
|
+
* `source` says which of the three layers won; this says which file to open.
|
|
105
68
|
*/
|
|
106
69
|
path: string;
|
|
107
70
|
/**
|
|
108
|
-
* Why this schema could not be loaded,
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* their YAML saw a list that simply did not contain their schema, with no
|
|
113
|
-
* hint why — while `new change --schema <typo>` still advertised the name as
|
|
114
|
-
* available and then created an unusable change from it. Carrying the failure
|
|
115
|
-
* in place is the same rule `list` follows for an unreadable change
|
|
116
|
-
* (tospec/decisions/20260917_234821-batch-commands-degrade-per-item.md).
|
|
71
|
+
* Why this schema could not be loaded, on a broken entry only (which also has
|
|
72
|
+
* an empty `artifacts` list). Carrying the failure in place rather than
|
|
73
|
+
* dropping the entry is the same rule `list` follows for an unreadable change:
|
|
74
|
+
* tospec/decisions/20260917_234821-batch-commands-degrade-per-item.md
|
|
117
75
|
*/
|
|
118
76
|
error?: string;
|
|
119
77
|
}
|
|
120
78
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
79
|
+
* Every schema with its description and artifact list, for agent skills that
|
|
80
|
+
* present a schema choice.
|
|
123
81
|
*
|
|
124
82
|
* A schema that fails to parse is reported with `error` set, but only when no
|
|
125
83
|
* lower-precedence layer supplies a working schema of that name — a broken
|
|
126
84
|
* project override must not hide the package schema it shadows.
|
|
127
|
-
*
|
|
128
|
-
* @param projectRoot - Optional project root directory for project-local schema resolution
|
|
129
85
|
*/
|
|
130
86
|
export declare function listSchemasWithInfo(projectRoot?: string): SchemaInfo[];
|
|
131
87
|
/**
|
|
132
88
|
* Union of every artifact ID across every available schema.
|
|
133
89
|
*
|
|
134
|
-
* Config keys
|
|
135
|
-
* legitimately name an artifact from any schema, so they
|
|
136
|
-
*
|
|
90
|
+
* Config keys scoped per-artifact but stored globally (`rules:`) can
|
|
91
|
+
* legitimately name an artifact from any schema, so they are checked against the
|
|
92
|
+
* union rather than the current change's schema.
|
|
137
93
|
*
|
|
138
|
-
* Built on listSchemasWithInfo
|
|
139
|
-
*
|
|
140
|
-
* custom schema must not turn every rules key into an unknown ID.
|
|
94
|
+
* Built on listSchemasWithInfo to inherit its tolerance for a schema that fails
|
|
95
|
+
* to parse: one broken custom schema must not turn every rules key unknown.
|
|
141
96
|
*/
|
|
142
97
|
export declare function collectAllArtifactIds(projectRoot?: string): Set<string>;
|
|
143
98
|
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAK9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/core/artifact-graph/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAK9B,O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