@seanmars/tospec 0.4.2
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/LICENSE +21 -0
- package/README.md +114 -0
- package/assets/dashboard/app.js +1032 -0
- package/assets/dashboard/chart.umd.js +14 -0
- package/assets/dashboard/index.html +30 -0
- package/assets/dashboard/style.css +675 -0
- package/bin/tospec.js +5 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +330 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +486 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/dashboard.d.ts +40 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +385 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/shared-output.d.ts +24 -0
- package/dist/commands/shared-output.d.ts.map +1 -0
- package/dist/commands/shared-output.js +51 -0
- package/dist/commands/shared-output.js.map +1 -0
- package/dist/commands/show.d.ts +17 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +164 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/validate.d.ts +51 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +416 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.d.ts.map +1 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/index.js.map +1 -0
- package/dist/commands/workflow/instructions.d.ts +35 -0
- package/dist/commands/workflow/instructions.d.ts.map +1 -0
- package/dist/commands/workflow/instructions.js +359 -0
- package/dist/commands/workflow/instructions.js.map +1 -0
- package/dist/commands/workflow/new-change.d.ts +17 -0
- package/dist/commands/workflow/new-change.d.ts.map +1 -0
- package/dist/commands/workflow/new-change.js +97 -0
- package/dist/commands/workflow/new-change.js.map +1 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.d.ts.map +1 -0
- package/dist/commands/workflow/schemas.js +33 -0
- package/dist/commands/workflow/schemas.js.map +1 -0
- package/dist/commands/workflow/shared.d.ts +63 -0
- package/dist/commands/workflow/shared.d.ts.map +1 -0
- package/dist/commands/workflow/shared.js +111 -0
- package/dist/commands/workflow/shared.js.map +1 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.d.ts.map +1 -0
- package/dist/commands/workflow/status.js +77 -0
- package/dist/commands/workflow/status.js.map +1 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.d.ts.map +1 -0
- package/dist/commands/workflow/templates.js +60 -0
- package/dist/commands/workflow/templates.js.map +1 -0
- package/dist/core/archive.d.ts +33 -0
- package/dist/core/archive.d.ts.map +1 -0
- package/dist/core/archive.js +585 -0
- package/dist/core/archive.js.map +1 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.d.ts.map +1 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/graph.js.map +1 -0
- package/dist/core/artifact-graph/index.d.ts +9 -0
- package/dist/core/artifact-graph/index.d.ts.map +1 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/index.js.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +188 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.js +243 -0
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -0
- package/dist/core/artifact-graph/outputs.d.ts +14 -0
- package/dist/core/artifact-graph/outputs.d.ts.map +1 -0
- package/dist/core/artifact-graph/outputs.js +39 -0
- package/dist/core/artifact-graph/outputs.js.map +1 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -0
- package/dist/core/artifact-graph/resolver.js +257 -0
- package/dist/core/artifact-graph/resolver.js.map +1 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.d.ts.map +1 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/schema.js.map +1 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.d.ts.map +1 -0
- package/dist/core/artifact-graph/state.js +31 -0
- package/dist/core/artifact-graph/state.js.map +1 -0
- package/dist/core/artifact-graph/types.d.ts +55 -0
- package/dist/core/artifact-graph/types.d.ts.map +1 -0
- package/dist/core/artifact-graph/types.js +38 -0
- package/dist/core/artifact-graph/types.js.map +1 -0
- package/dist/core/available-tools.d.ts +17 -0
- package/dist/core/available-tools.d.ts.map +1 -0
- package/dist/core/available-tools.js +43 -0
- package/dist/core/available-tools.js.map +1 -0
- package/dist/core/change-metadata/index.d.ts +2 -0
- package/dist/core/change-metadata/index.d.ts.map +1 -0
- package/dist/core/change-metadata/index.js +2 -0
- package/dist/core/change-metadata/index.js.map +1 -0
- package/dist/core/change-metadata/schema.d.ts +12 -0
- package/dist/core/change-metadata/schema.d.ts.map +1 -0
- package/dist/core/change-metadata/schema.js +15 -0
- package/dist/core/change-metadata/schema.js.map +1 -0
- package/dist/core/change-presenter.d.ts +24 -0
- package/dist/core/change-presenter.d.ts.map +1 -0
- package/dist/core/change-presenter.js +135 -0
- package/dist/core/change-presenter.js.map +1 -0
- package/dist/core/change-status-policy.d.ts +35 -0
- package/dist/core/change-status-policy.d.ts.map +1 -0
- package/dist/core/change-status-policy.js +34 -0
- package/dist/core/change-status-policy.js.map +1 -0
- package/dist/core/command-generation/adapters/claude.d.ts +14 -0
- package/dist/core/command-generation/adapters/claude.d.ts.map +1 -0
- package/dist/core/command-generation/adapters/claude.js +38 -0
- package/dist/core/command-generation/adapters/claude.js.map +1 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.d.ts.map +1 -0
- package/dist/core/command-generation/adapters/cursor.js +31 -0
- package/dist/core/command-generation/adapters/cursor.js.map +1 -0
- package/dist/core/command-generation/adapters/index.d.ts +8 -0
- package/dist/core/command-generation/adapters/index.d.ts.map +1 -0
- package/dist/core/command-generation/adapters/index.js +8 -0
- package/dist/core/command-generation/adapters/index.js.map +1 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.d.ts.map +1 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/generator.js.map +1 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.d.ts.map +1 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/index.js.map +1 -0
- package/dist/core/command-generation/registry.d.ts +24 -0
- package/dist/core/command-generation/registry.d.ts.map +1 -0
- package/dist/core/command-generation/registry.js +38 -0
- package/dist/core/command-generation/registry.js.map +1 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.d.ts.map +1 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/command-generation/types.js.map +1 -0
- package/dist/core/command-generation/yaml.d.ts +22 -0
- package/dist/core/command-generation/yaml.d.ts.map +1 -0
- package/dist/core/command-generation/yaml.js +38 -0
- package/dist/core/command-generation/yaml.js.map +1 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.d.ts.map +1 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-prompts.js.map +1 -0
- package/dist/core/config-schema.d.ts +87 -0
- package/dist/core/config-schema.d.ts.map +1 -0
- package/dist/core/config-schema.js +239 -0
- package/dist/core/config-schema.js.map +1 -0
- package/dist/core/config.d.ts +19 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +14 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.d.ts.map +1 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/converters/json-converter.js.map +1 -0
- package/dist/core/dashboard-activity.d.ts +50 -0
- package/dist/core/dashboard-activity.d.ts.map +1 -0
- package/dist/core/dashboard-activity.js +147 -0
- package/dist/core/dashboard-activity.js.map +1 -0
- package/dist/core/dashboard-data.d.ts +100 -0
- package/dist/core/dashboard-data.d.ts.map +1 -0
- package/dist/core/dashboard-data.js +368 -0
- package/dist/core/dashboard-data.js.map +1 -0
- package/dist/core/global-config.d.ts +51 -0
- package/dist/core/global-config.d.ts.map +1 -0
- package/dist/core/global-config.js +124 -0
- package/dist/core/global-config.js.map +1 -0
- package/dist/core/id.d.ts +17 -0
- package/dist/core/id.d.ts.map +1 -0
- package/dist/core/id.js +30 -0
- package/dist/core/id.js.map +1 -0
- package/dist/core/init.d.ts +34 -0
- package/dist/core/init.d.ts.map +1 -0
- package/dist/core/init.js +495 -0
- package/dist/core/init.js.map +1 -0
- package/dist/core/list.d.ts +12 -0
- package/dist/core/list.d.ts.map +1 -0
- package/dist/core/list.js +192 -0
- package/dist/core/list.js.map +1 -0
- package/dist/core/migrate.d.ts +52 -0
- package/dist/core/migrate.d.ts.map +1 -0
- package/dist/core/migrate.js +300 -0
- package/dist/core/migrate.js.map +1 -0
- package/dist/core/parsers/change-parser.d.ts +19 -0
- package/dist/core/parsers/change-parser.d.ts.map +1 -0
- package/dist/core/parsers/change-parser.js +204 -0
- package/dist/core/parsers/change-parser.js.map +1 -0
- package/dist/core/parsers/markdown-parser.d.ts +29 -0
- package/dist/core/parsers/markdown-parser.d.ts.map +1 -0
- package/dist/core/parsers/markdown-parser.js +181 -0
- package/dist/core/parsers/markdown-parser.js.map +1 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/requirement-blocks.js.map +1 -0
- package/dist/core/parsers/requirement-text.d.ts +55 -0
- package/dist/core/parsers/requirement-text.d.ts.map +1 -0
- package/dist/core/parsers/requirement-text.js +136 -0
- package/dist/core/parsers/requirement-text.js.map +1 -0
- package/dist/core/parsers/spec-structure.d.ts +9 -0
- package/dist/core/parsers/spec-structure.d.ts.map +1 -0
- package/dist/core/parsers/spec-structure.js +88 -0
- package/dist/core/parsers/spec-structure.js.map +1 -0
- package/dist/core/planning-home.d.ts +16 -0
- package/dist/core/planning-home.d.ts.map +1 -0
- package/dist/core/planning-home.js +67 -0
- package/dist/core/planning-home.js.map +1 -0
- package/dist/core/profiles.d.ts +24 -0
- package/dist/core/profiles.d.ts.map +1 -0
- package/dist/core/profiles.js +27 -0
- package/dist/core/profiles.js.map +1 -0
- package/dist/core/project-config.d.ts +100 -0
- package/dist/core/project-config.d.ts.map +1 -0
- package/dist/core/project-config.js +389 -0
- package/dist/core/project-config.js.map +1 -0
- package/dist/core/references.d.ts +40 -0
- package/dist/core/references.d.ts.map +1 -0
- package/dist/core/references.js +11 -0
- package/dist/core/references.js.map +1 -0
- package/dist/core/root-selection.d.ts +57 -0
- package/dist/core/root-selection.d.ts.map +1 -0
- package/dist/core/root-selection.js +98 -0
- package/dist/core/root-selection.js.map +1 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.d.ts.map +1 -0
- package/dist/core/schemas/base.schema.js +18 -0
- package/dist/core/schemas/base.schema.js.map +1 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.d.ts.map +1 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/change.schema.js.map +1 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.d.ts.map +1 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/index.js.map +1 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.d.ts.map +1 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/schemas/spec.schema.js.map +1 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.d.ts.map +1 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/index.js.map +1 -0
- package/dist/core/shared/skill-generation.d.ts +63 -0
- package/dist/core/shared/skill-generation.d.ts.map +1 -0
- package/dist/core/shared/skill-generation.js +125 -0
- package/dist/core/shared/skill-generation.js.map +1 -0
- package/dist/core/shared/tool-detection.d.ts +96 -0
- package/dist/core/shared/tool-detection.d.ts.map +1 -0
- package/dist/core/shared/tool-detection.js +207 -0
- package/dist/core/shared/tool-detection.js.map +1 -0
- package/dist/core/spec-presenter.d.ts +17 -0
- package/dist/core/spec-presenter.d.ts.map +1 -0
- package/dist/core/spec-presenter.js +98 -0
- package/dist/core/spec-presenter.js.map +1 -0
- package/dist/core/specs-apply.d.ts +78 -0
- package/dist/core/specs-apply.d.ts.map +1 -0
- package/dist/core/specs-apply.js +429 -0
- package/dist/core/specs-apply.js.map +1 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.d.ts.map +1 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/index.js.map +1 -0
- package/dist/core/templates/skill-templates.d.ts +14 -0
- package/dist/core/templates/skill-templates.d.ts.map +1 -0
- package/dist/core/templates/skill-templates.js +13 -0
- package/dist/core/templates/skill-templates.js.map +1 -0
- package/dist/core/templates/types.d.ts +20 -0
- package/dist/core/templates/types.d.ts.map +1 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/types.js.map +1 -0
- package/dist/core/templates/workflows/apply.d.ts +10 -0
- package/dist/core/templates/workflows/apply.d.ts.map +1 -0
- package/dist/core/templates/workflows/apply.js +81 -0
- package/dist/core/templates/workflows/apply.js.map +1 -0
- package/dist/core/templates/workflows/archive.d.ts +10 -0
- package/dist/core/templates/workflows/archive.d.ts.map +1 -0
- package/dist/core/templates/workflows/archive.js +75 -0
- package/dist/core/templates/workflows/archive.js.map +1 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.d.ts.map +1 -0
- package/dist/core/templates/workflows/explore.js +75 -0
- package/dist/core/templates/workflows/explore.js.map +1 -0
- package/dist/core/templates/workflows/issue.d.ts +10 -0
- package/dist/core/templates/workflows/issue.d.ts.map +1 -0
- package/dist/core/templates/workflows/issue.js +89 -0
- package/dist/core/templates/workflows/issue.js.map +1 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.d.ts.map +1 -0
- package/dist/core/templates/workflows/propose.js +77 -0
- package/dist/core/templates/workflows/propose.js.map +1 -0
- package/dist/core/templates/workflows/sync.d.ts +14 -0
- package/dist/core/templates/workflows/sync.d.ts.map +1 -0
- package/dist/core/templates/workflows/sync.js +86 -0
- package/dist/core/templates/workflows/sync.js.map +1 -0
- package/dist/core/templates/workflows/update.d.ts +10 -0
- package/dist/core/templates/workflows/update.d.ts.map +1 -0
- package/dist/core/templates/workflows/update.js +99 -0
- package/dist/core/templates/workflows/update.js.map +1 -0
- package/dist/core/templates/workflows/verify.d.ts +9 -0
- package/dist/core/templates/workflows/verify.d.ts.map +1 -0
- package/dist/core/templates/workflows/verify.js +44 -0
- package/dist/core/templates/workflows/verify.js.map +1 -0
- package/dist/core/update.d.ts +46 -0
- package/dist/core/update.d.ts.map +1 -0
- package/dist/core/update.js +296 -0
- package/dist/core/update.js.map +1 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.d.ts.map +1 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/constants.js.map +1 -0
- package/dist/core/validation/section-validator.d.ts +19 -0
- package/dist/core/validation/section-validator.d.ts.map +1 -0
- package/dist/core/validation/section-validator.js +59 -0
- package/dist/core/validation/section-validator.js.map +1 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.d.ts.map +1 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/types.js.map +1 -0
- package/dist/core/validation/validator.d.ts +51 -0
- package/dist/core/validation/validator.d.ts.map +1 -0
- package/dist/core/validation/validator.js +469 -0
- package/dist/core/validation/validator.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.d.ts.map +1 -0
- package/dist/prompts/searchable-multi-select.js +158 -0
- package/dist/prompts/searchable-multi-select.js.map +1 -0
- package/dist/ui/welcome-screen.d.ts +5 -0
- package/dist/ui/welcome-screen.d.ts.map +1 -0
- package/dist/ui/welcome-screen.js +22 -0
- package/dist/ui/welcome-screen.js.map +1 -0
- package/dist/utils/change-metadata.d.ts +55 -0
- package/dist/utils/change-metadata.d.ts.map +1 -0
- package/dist/utils/change-metadata.js +141 -0
- package/dist/utils/change-metadata.js.map +1 -0
- package/dist/utils/change-utils.d.ts +73 -0
- package/dist/utils/change-utils.d.ts.map +1 -0
- package/dist/utils/change-utils.js +194 -0
- package/dist/utils/change-utils.js.map +1 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.d.ts.map +1 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/command-references.js.map +1 -0
- package/dist/utils/file-system.d.ts +41 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +320 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/interactive.js.map +1 -0
- package/dist/utils/item-discovery.d.ts +14 -0
- package/dist/utils/item-discovery.d.ts.map +1 -0
- package/dist/utils/item-discovery.js +104 -0
- package/dist/utils/item-discovery.js.map +1 -0
- package/dist/utils/link.d.ts +22 -0
- package/dist/utils/link.d.ts.map +1 -0
- package/dist/utils/link.js +85 -0
- package/dist/utils/link.js.map +1 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.d.ts.map +1 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/match.js.map +1 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.d.ts.map +1 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/shell-detection.js.map +1 -0
- package/dist/utils/task-progress.d.ts +32 -0
- package/dist/utils/task-progress.d.ts.map +1 -0
- package/dist/utils/task-progress.js +129 -0
- package/dist/utils/task-progress.js.map +1 -0
- package/dist/utils/timestamp.d.ts +9 -0
- package/dist/utils/timestamp.d.ts.map +1 -0
- package/dist/utils/timestamp.js +18 -0
- package/dist/utils/timestamp.js.map +1 -0
- package/package.json +55 -0
- package/schemas/issue/schema.yaml +34 -0
- package/schemas/issue/templates/spec.md +13 -0
- package/schemas/issue/templates/task.md +21 -0
- package/schemas/issue/templates/ticket.md +2 -0
- package/schemas/sdd/schema.yaml +55 -0
- package/schemas/sdd/templates/design.md +15 -0
- package/schemas/sdd/templates/proposal.md +15 -0
- package/schemas/sdd/templates/spec.md +13 -0
- package/schemas/sdd/templates/tasks.md +11 -0
- package/schemas/sdd/templates/ticket.md +2 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile System
|
|
3
|
+
*
|
|
4
|
+
* Defines workflow profiles that control which workflows are installed.
|
|
5
|
+
* Profiles determine WHICH workflows; delivery (in global config) determines HOW.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* All seven tospec workflows. There is only one profile's worth of
|
|
9
|
+
* workflows now (no more core/custom split) — every install gets the
|
|
10
|
+
* full explore → propose/issue → update → apply → sync → archive set.
|
|
11
|
+
* verify runs automatically at the end of apply; sync is a standalone
|
|
12
|
+
* skill the archive workflow offers to run when it judges one is needed.
|
|
13
|
+
*/
|
|
14
|
+
export const ALL_WORKFLOWS = ['explore', 'propose', 'issue', 'update', 'apply', 'sync', 'archive'];
|
|
15
|
+
/**
|
|
16
|
+
* Resolves which workflows should be active for a given profile configuration.
|
|
17
|
+
*
|
|
18
|
+
* - 'core' profile always returns ALL_WORKFLOWS (the only profile's worth of workflows)
|
|
19
|
+
* - 'custom' profile returns the provided customWorkflows, or empty array if not provided
|
|
20
|
+
*/
|
|
21
|
+
export function getProfileWorkflows(profile, customWorkflows) {
|
|
22
|
+
if (profile === 'custom') {
|
|
23
|
+
return customWorkflows ?? [];
|
|
24
|
+
}
|
|
25
|
+
return ALL_WORKFLOWS;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/core/profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAI5G;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAgB,EAChB,eAA0B;IAE1B,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,eAAe,IAAI,EAAE,CAAC;IAC/B,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for project configuration.
|
|
4
|
+
*
|
|
5
|
+
* Purpose:
|
|
6
|
+
* 1. Documentation - clearly defines the config file structure
|
|
7
|
+
* 2. Type safety - TypeScript infers ProjectConfig type from schema
|
|
8
|
+
* 3. Runtime validation - uses safeParse() for resilient field-by-field validation
|
|
9
|
+
*
|
|
10
|
+
* Why Zod over manual validation:
|
|
11
|
+
* - Helps understand Tospec's data interfaces at a glance
|
|
12
|
+
* - Single source of truth for type and validation
|
|
13
|
+
* - Consistent with other Tospec schemas
|
|
14
|
+
*/
|
|
15
|
+
export declare const ProjectConfigSchema: z.ZodObject<{
|
|
16
|
+
schema: z.ZodString;
|
|
17
|
+
context: z.ZodOptional<z.ZodString>;
|
|
18
|
+
rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
19
|
+
dashboard: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
staleDays: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
agentsLinkMode: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
23
|
+
skills: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
link: "link";
|
|
25
|
+
hardlink: "hardlink";
|
|
26
|
+
copy: "copy";
|
|
27
|
+
}>>;
|
|
28
|
+
commands: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
link: "link";
|
|
30
|
+
copy: "copy";
|
|
31
|
+
}>>;
|
|
32
|
+
}, z.core.$strip>>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
/** Normalized in-memory shape of a referenced store declaration. */
|
|
35
|
+
export interface DeclarationEntry {
|
|
36
|
+
id: string;
|
|
37
|
+
/** Clone source rendered into onboarding fixes. */
|
|
38
|
+
remote?: string;
|
|
39
|
+
}
|
|
40
|
+
export type ProjectConfig = z.infer<typeof ProjectConfigSchema> & {
|
|
41
|
+
references?: DeclarationEntry[];
|
|
42
|
+
};
|
|
43
|
+
export declare const MAX_CONTEXT_SIZE: number;
|
|
44
|
+
/**
|
|
45
|
+
* Read and parse tospec/config.yaml from project root.
|
|
46
|
+
* Uses resilient parsing - validates each field independently using Zod safeParse.
|
|
47
|
+
* Returns null if file doesn't exist.
|
|
48
|
+
* Returns partial config if some fields are invalid (with warnings).
|
|
49
|
+
*
|
|
50
|
+
* Performance note (Jan 2025):
|
|
51
|
+
* Benchmarks showed direct file reads are fast enough without caching:
|
|
52
|
+
* - Typical config (1KB): ~0.5ms per read
|
|
53
|
+
* - Large config (50KB): ~1.6ms per read
|
|
54
|
+
* - Missing config: ~0.01ms per read
|
|
55
|
+
* Config is read 1-2 times per command (schema resolution + instruction loading),
|
|
56
|
+
* adding ~1-3ms total overhead. Caching would add complexity (mtime checks,
|
|
57
|
+
* invalidation logic) for negligible benefit. Direct reads also ensure config
|
|
58
|
+
* changes are reflected immediately without stale cache issues.
|
|
59
|
+
*
|
|
60
|
+
* @param projectRoot - The root directory of the project (where `tospec/` lives)
|
|
61
|
+
* @returns Parsed config or null if file doesn't exist
|
|
62
|
+
*/
|
|
63
|
+
export declare function readProjectConfig(projectRoot: string): ProjectConfig | null;
|
|
64
|
+
/**
|
|
65
|
+
* Validate artifact IDs in rules against a schema's artifacts.
|
|
66
|
+
* Called during instruction loading (when schema is known).
|
|
67
|
+
* Returns warnings for unknown artifact IDs.
|
|
68
|
+
*
|
|
69
|
+
* @param rules - The rules object from config
|
|
70
|
+
* @param validArtifactIds - Set of valid artifact IDs from the schema
|
|
71
|
+
* @param schemaName - Name of the schema for error messages
|
|
72
|
+
* @returns Array of warning messages for unknown artifact IDs
|
|
73
|
+
*/
|
|
74
|
+
export declare function validateConfigRules(rules: Record<string, string[]>, validArtifactIds: Set<string>, schemaName: string): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Suggest valid schema names when user provides invalid schema.
|
|
77
|
+
* Uses fuzzy matching to find similar names.
|
|
78
|
+
*
|
|
79
|
+
* @param invalidSchemaName - The invalid schema name from config
|
|
80
|
+
* @param availableSchemas - List of available schemas with their type (built-in or project-local)
|
|
81
|
+
* @returns Error message with suggestions and available schemas
|
|
82
|
+
*/
|
|
83
|
+
export declare function suggestSchemas(invalidSchemaName: string, availableSchemas: {
|
|
84
|
+
name: string;
|
|
85
|
+
isBuiltIn: boolean;
|
|
86
|
+
}[]): string;
|
|
87
|
+
/** Shared .yaml/.yml probe used by project-config readers. */
|
|
88
|
+
export declare function resolveConfigFilePath(projectRoot: string): string | null;
|
|
89
|
+
/**
|
|
90
|
+
* Records how a tool's skills/commands were delivered (link vs copy) into
|
|
91
|
+
* tospec/config.yaml. Read-modify-write via the yaml package: does not
|
|
92
|
+
* preserve config-prompts.ts's hand-authored comment block if present —
|
|
93
|
+
* an accepted tradeoff of round-tripping a machine-owned field through a
|
|
94
|
+
* plain YAML parser/stringifier.
|
|
95
|
+
*/
|
|
96
|
+
export declare function writeAgentsLinkMode(projectRoot: string, toolId: string, modes: {
|
|
97
|
+
skills?: 'hardlink' | 'link' | 'copy';
|
|
98
|
+
commands?: 'link' | 'copy';
|
|
99
|
+
}): void;
|
|
100
|
+
//# sourceMappingURL=project-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../src/core/project-config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAoD9B,CAAC;AAEH,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,GAAG;IAChE,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACjC,CAAC;AAiEF,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAyI3E;AAMD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC/B,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAC7B,UAAU,EAAE,MAAM,GACjB,MAAM,EAAE,CAcV;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,iBAAiB,EAAE,MAAM,EACzB,gBAAgB,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,EAAE,GACvD,MAAM,CA4DR;AAED,8DAA8D;AAC9D,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOxE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;IAAE,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAC3E,IAAI,CA4BN"}
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/**
|
|
6
|
+
* Zod schema for project configuration.
|
|
7
|
+
*
|
|
8
|
+
* Purpose:
|
|
9
|
+
* 1. Documentation - clearly defines the config file structure
|
|
10
|
+
* 2. Type safety - TypeScript infers ProjectConfig type from schema
|
|
11
|
+
* 3. Runtime validation - uses safeParse() for resilient field-by-field validation
|
|
12
|
+
*
|
|
13
|
+
* Why Zod over manual validation:
|
|
14
|
+
* - Helps understand Tospec's data interfaces at a glance
|
|
15
|
+
* - Single source of truth for type and validation
|
|
16
|
+
* - Consistent with other Tospec schemas
|
|
17
|
+
*/
|
|
18
|
+
export const ProjectConfigSchema = z.object({
|
|
19
|
+
// Required: which schema to use (e.g., "sdd", or project-local schema name)
|
|
20
|
+
schema: z
|
|
21
|
+
.string()
|
|
22
|
+
.min(1)
|
|
23
|
+
.describe('The workflow schema to use (e.g., "sdd")'),
|
|
24
|
+
// Optional: project context (injected into all artifact instructions)
|
|
25
|
+
// Max size: 50KB (enforced during parsing)
|
|
26
|
+
context: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Project context injected into all artifact instructions'),
|
|
30
|
+
// Optional: per-artifact rules (additive to schema's built-in guidance)
|
|
31
|
+
rules: z
|
|
32
|
+
.record(z.string(), // artifact ID
|
|
33
|
+
z.array(z.string()) // list of rules
|
|
34
|
+
)
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Per-artifact rules, keyed by artifact ID'),
|
|
37
|
+
// Note: the `references` field (id strings or {id, remote} maps) is
|
|
38
|
+
// deliberately absent here — readProjectConfig parses and normalizes
|
|
39
|
+
// it by hand (see DeclarationEntry below); a schema entry nothing
|
|
40
|
+
// parses would only drift from the real behavior.
|
|
41
|
+
// Optional: dashboard tuning (ADR 001). staleDays: days without any file
|
|
42
|
+
// change before an active change is flagged stale (default 14).
|
|
43
|
+
dashboard: z
|
|
44
|
+
.object({
|
|
45
|
+
staleDays: z.number().int().positive().optional(),
|
|
46
|
+
})
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('Dashboard settings (staleDays: stale-change threshold in days)'),
|
|
49
|
+
// Optional: per-tool record of how init/update delivered skills into that
|
|
50
|
+
// tool's directory — 'hardlink' or a copy fallback. Legacy 'link' and
|
|
51
|
+
// command fields remain readable for migration. Named agentsLinkMode, not
|
|
52
|
+
// `delivery`, because the global config already uses `delivery` for an
|
|
53
|
+
// unrelated concept (which content types to generate).
|
|
54
|
+
agentsLinkMode: z
|
|
55
|
+
.record(z.string(), // tool id, e.g. "claude", "codex"
|
|
56
|
+
z.object({
|
|
57
|
+
skills: z.enum(['hardlink', 'link', 'copy']).optional(),
|
|
58
|
+
commands: z.enum(['link', 'copy']).optional(),
|
|
59
|
+
}))
|
|
60
|
+
.optional()
|
|
61
|
+
.describe('Per-tool record of skill delivery mode from .agents/skills'),
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Parser for `references:` declarations: string entries or
|
|
65
|
+
* {id, remote} maps, normalized to DeclarationEntry[]. Dedup keys on
|
|
66
|
+
* id and keeps the first position; the first entry carrying a remote
|
|
67
|
+
* supplies it (a later duplicate fills a missing remote, never
|
|
68
|
+
* overrides). Invalid entries drop with a warning like other resilient
|
|
69
|
+
* fields; returns undefined when the field is absent or normalizes to
|
|
70
|
+
* empty.
|
|
71
|
+
*/
|
|
72
|
+
function parseDeclarationList(raw) {
|
|
73
|
+
const fieldName = 'references';
|
|
74
|
+
if (raw === undefined) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
if (!Array.isArray(raw)) {
|
|
78
|
+
console.warn(`Invalid '${fieldName}' field in config (must be an array of store ids)`);
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const byId = new Map();
|
|
82
|
+
let droppedEntries = false;
|
|
83
|
+
let droppedRemotes = false;
|
|
84
|
+
for (const entry of raw) {
|
|
85
|
+
let declaration = null;
|
|
86
|
+
if (typeof entry === 'string') {
|
|
87
|
+
declaration = { id: entry };
|
|
88
|
+
}
|
|
89
|
+
else if (entry && typeof entry === 'object' && !Array.isArray(entry)) {
|
|
90
|
+
const candidate = entry;
|
|
91
|
+
if (typeof candidate.id === 'string') {
|
|
92
|
+
declaration = { id: candidate.id };
|
|
93
|
+
if (typeof candidate.remote === 'string' && candidate.remote.length > 0) {
|
|
94
|
+
declaration.remote = candidate.remote;
|
|
95
|
+
}
|
|
96
|
+
else if (candidate.remote !== undefined) {
|
|
97
|
+
droppedRemotes = true; // remote dropped, id kept
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (!declaration) {
|
|
102
|
+
droppedEntries = true;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const existing = byId.get(declaration.id);
|
|
106
|
+
if (!existing) {
|
|
107
|
+
byId.set(declaration.id, declaration);
|
|
108
|
+
}
|
|
109
|
+
else if (existing.remote === undefined && declaration.remote !== undefined) {
|
|
110
|
+
existing.remote = declaration.remote;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (droppedEntries) {
|
|
114
|
+
console.warn(`Some '${fieldName}' entries are invalid, ignoring them`);
|
|
115
|
+
}
|
|
116
|
+
if (droppedRemotes) {
|
|
117
|
+
console.warn(`Some '${fieldName}' remotes are not non-empty strings; the ids are kept without a clone source`);
|
|
118
|
+
}
|
|
119
|
+
return byId.size > 0 ? [...byId.values()] : undefined;
|
|
120
|
+
}
|
|
121
|
+
export const MAX_CONTEXT_SIZE = 50 * 1024; // 50KB hard limit, shared with the references index
|
|
122
|
+
/**
|
|
123
|
+
* Read and parse tospec/config.yaml from project root.
|
|
124
|
+
* Uses resilient parsing - validates each field independently using Zod safeParse.
|
|
125
|
+
* Returns null if file doesn't exist.
|
|
126
|
+
* Returns partial config if some fields are invalid (with warnings).
|
|
127
|
+
*
|
|
128
|
+
* Performance note (Jan 2025):
|
|
129
|
+
* Benchmarks showed direct file reads are fast enough without caching:
|
|
130
|
+
* - Typical config (1KB): ~0.5ms per read
|
|
131
|
+
* - Large config (50KB): ~1.6ms per read
|
|
132
|
+
* - Missing config: ~0.01ms per read
|
|
133
|
+
* Config is read 1-2 times per command (schema resolution + instruction loading),
|
|
134
|
+
* adding ~1-3ms total overhead. Caching would add complexity (mtime checks,
|
|
135
|
+
* invalidation logic) for negligible benefit. Direct reads also ensure config
|
|
136
|
+
* changes are reflected immediately without stale cache issues.
|
|
137
|
+
*
|
|
138
|
+
* @param projectRoot - The root directory of the project (where `tospec/` lives)
|
|
139
|
+
* @returns Parsed config or null if file doesn't exist
|
|
140
|
+
*/
|
|
141
|
+
export function readProjectConfig(projectRoot) {
|
|
142
|
+
const configPath = resolveConfigFilePath(projectRoot);
|
|
143
|
+
if (configPath === null) {
|
|
144
|
+
return null; // No config is OK
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
148
|
+
const raw = parseYaml(content);
|
|
149
|
+
if (!raw || typeof raw !== 'object') {
|
|
150
|
+
console.warn(`tospec/config.yaml is not a valid YAML object`);
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
const config = {};
|
|
154
|
+
// Parse schema field using Zod
|
|
155
|
+
const schemaField = z.string().min(1);
|
|
156
|
+
const schemaResult = schemaField.safeParse(raw.schema);
|
|
157
|
+
if (schemaResult.success) {
|
|
158
|
+
config.schema = schemaResult.data;
|
|
159
|
+
}
|
|
160
|
+
else if (raw.schema !== undefined) {
|
|
161
|
+
console.warn(`Invalid 'schema' field in config (must be non-empty string)`);
|
|
162
|
+
}
|
|
163
|
+
// Parse context field with size limit
|
|
164
|
+
if (raw.context !== undefined) {
|
|
165
|
+
const contextField = z.string();
|
|
166
|
+
const contextResult = contextField.safeParse(raw.context);
|
|
167
|
+
if (contextResult.success) {
|
|
168
|
+
const contextSize = Buffer.byteLength(contextResult.data, 'utf-8');
|
|
169
|
+
if (contextSize > MAX_CONTEXT_SIZE) {
|
|
170
|
+
console.warn(`Context too large (${(contextSize / 1024).toFixed(1)}KB, limit: ${MAX_CONTEXT_SIZE / 1024}KB)`);
|
|
171
|
+
console.warn(`Ignoring context field`);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
config.context = contextResult.data;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
console.warn(`Invalid 'context' field in config (must be string)`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// Parse rules field using Zod
|
|
182
|
+
if (raw.rules !== undefined) {
|
|
183
|
+
const rulesField = z.record(z.string(), z.array(z.string()));
|
|
184
|
+
// First check if it's an object structure (guard against null since typeof null === 'object')
|
|
185
|
+
if (typeof raw.rules === 'object' && raw.rules !== null && !Array.isArray(raw.rules)) {
|
|
186
|
+
const parsedRules = {};
|
|
187
|
+
let hasValidRules = false;
|
|
188
|
+
for (const [artifactId, rules] of Object.entries(raw.rules)) {
|
|
189
|
+
const rulesArrayResult = z.array(z.string()).safeParse(rules);
|
|
190
|
+
if (rulesArrayResult.success) {
|
|
191
|
+
// Filter out empty strings
|
|
192
|
+
const validRules = rulesArrayResult.data.filter((r) => r.length > 0);
|
|
193
|
+
if (validRules.length > 0) {
|
|
194
|
+
parsedRules[artifactId] = validRules;
|
|
195
|
+
hasValidRules = true;
|
|
196
|
+
}
|
|
197
|
+
if (validRules.length < rulesArrayResult.data.length) {
|
|
198
|
+
console.warn(`Some rules for '${artifactId}' are empty strings, ignoring them`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
console.warn(`Rules for '${artifactId}' must be an array of strings, ignoring this artifact's rules`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (hasValidRules) {
|
|
206
|
+
config.rules = parsedRules;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
console.warn(`Invalid 'rules' field in config (must be object)`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const references = parseDeclarationList(raw.references);
|
|
214
|
+
if (references) {
|
|
215
|
+
config.references = references;
|
|
216
|
+
}
|
|
217
|
+
// Parse dashboard field using Zod
|
|
218
|
+
if (raw.dashboard !== undefined) {
|
|
219
|
+
const dashboardField = z.object({ staleDays: z.number().int().positive().optional() });
|
|
220
|
+
const dashboardResult = dashboardField.safeParse(raw.dashboard);
|
|
221
|
+
if (dashboardResult.success) {
|
|
222
|
+
config.dashboard = dashboardResult.data;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
console.warn(`Invalid 'dashboard' field in config (staleDays must be a positive integer)`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// Parse agentsLinkMode field using Zod
|
|
229
|
+
if (raw.agentsLinkMode !== undefined) {
|
|
230
|
+
const modeShape = z.object({
|
|
231
|
+
skills: z.enum(['hardlink', 'link', 'copy']).optional(),
|
|
232
|
+
commands: z.enum(['link', 'copy']).optional(),
|
|
233
|
+
});
|
|
234
|
+
if (typeof raw.agentsLinkMode === 'object' && raw.agentsLinkMode !== null && !Array.isArray(raw.agentsLinkMode)) {
|
|
235
|
+
const parsedModes = {};
|
|
236
|
+
let hasValidModes = false;
|
|
237
|
+
for (const [toolId, mode] of Object.entries(raw.agentsLinkMode)) {
|
|
238
|
+
const modeResult = modeShape.safeParse(mode);
|
|
239
|
+
if (modeResult.success) {
|
|
240
|
+
parsedModes[toolId] = modeResult.data;
|
|
241
|
+
hasValidModes = true;
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
console.warn(`Invalid agentsLinkMode entry for '${toolId}', ignoring it`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (hasValidModes) {
|
|
248
|
+
config.agentsLinkMode = parsedModes;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
console.warn(`Invalid 'agentsLinkMode' field in config (must be object)`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// Return partial config even if some fields failed
|
|
256
|
+
return Object.keys(config).length > 0 ? config : null;
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
console.warn(`Warning: could not parse ${configPathForWarnings(projectRoot)} (${error instanceof Error ? error.message.split('\n')[0] : String(error)}); ignoring it.`);
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function configPathForWarnings(projectRoot) {
|
|
264
|
+
return resolveConfigFilePath(projectRoot) ?? path.join(projectRoot, 'tospec', 'config.yaml');
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Validate artifact IDs in rules against a schema's artifacts.
|
|
268
|
+
* Called during instruction loading (when schema is known).
|
|
269
|
+
* Returns warnings for unknown artifact IDs.
|
|
270
|
+
*
|
|
271
|
+
* @param rules - The rules object from config
|
|
272
|
+
* @param validArtifactIds - Set of valid artifact IDs from the schema
|
|
273
|
+
* @param schemaName - Name of the schema for error messages
|
|
274
|
+
* @returns Array of warning messages for unknown artifact IDs
|
|
275
|
+
*/
|
|
276
|
+
export function validateConfigRules(rules, validArtifactIds, schemaName) {
|
|
277
|
+
const warnings = [];
|
|
278
|
+
for (const artifactId of Object.keys(rules)) {
|
|
279
|
+
if (!validArtifactIds.has(artifactId)) {
|
|
280
|
+
const validIds = Array.from(validArtifactIds).sort().join(', ');
|
|
281
|
+
warnings.push(`Unknown artifact ID in rules: "${artifactId}". ` +
|
|
282
|
+
`Valid IDs for schema "${schemaName}": ${validIds}`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return warnings;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Suggest valid schema names when user provides invalid schema.
|
|
289
|
+
* Uses fuzzy matching to find similar names.
|
|
290
|
+
*
|
|
291
|
+
* @param invalidSchemaName - The invalid schema name from config
|
|
292
|
+
* @param availableSchemas - List of available schemas with their type (built-in or project-local)
|
|
293
|
+
* @returns Error message with suggestions and available schemas
|
|
294
|
+
*/
|
|
295
|
+
export function suggestSchemas(invalidSchemaName, availableSchemas) {
|
|
296
|
+
// Simple fuzzy match: Levenshtein distance
|
|
297
|
+
function levenshtein(a, b) {
|
|
298
|
+
const matrix = [];
|
|
299
|
+
for (let i = 0; i <= b.length; i++) {
|
|
300
|
+
matrix[i] = [i];
|
|
301
|
+
}
|
|
302
|
+
for (let j = 0; j <= a.length; j++) {
|
|
303
|
+
matrix[0][j] = j;
|
|
304
|
+
}
|
|
305
|
+
for (let i = 1; i <= b.length; i++) {
|
|
306
|
+
for (let j = 1; j <= a.length; j++) {
|
|
307
|
+
if (b.charAt(i - 1) === a.charAt(j - 1)) {
|
|
308
|
+
matrix[i][j] = matrix[i - 1][j - 1];
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, matrix[i][j - 1] + 1, matrix[i - 1][j] + 1);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return matrix[b.length][a.length];
|
|
316
|
+
}
|
|
317
|
+
// Find closest matches (distance <= 3)
|
|
318
|
+
const suggestions = availableSchemas
|
|
319
|
+
.map((s) => ({ ...s, distance: levenshtein(invalidSchemaName, s.name) }))
|
|
320
|
+
.filter((s) => s.distance <= 3)
|
|
321
|
+
.sort((a, b) => a.distance - b.distance)
|
|
322
|
+
.slice(0, 3);
|
|
323
|
+
const builtIn = availableSchemas.filter((s) => s.isBuiltIn).map((s) => s.name);
|
|
324
|
+
const projectLocal = availableSchemas.filter((s) => !s.isBuiltIn).map((s) => s.name);
|
|
325
|
+
let message = `Schema '${invalidSchemaName}' not found in tospec/config.yaml\n\n`;
|
|
326
|
+
if (suggestions.length > 0) {
|
|
327
|
+
message += `Did you mean one of these?\n`;
|
|
328
|
+
suggestions.forEach((s) => {
|
|
329
|
+
const type = s.isBuiltIn ? 'built-in' : 'project-local';
|
|
330
|
+
message += ` - ${s.name} (${type})\n`;
|
|
331
|
+
});
|
|
332
|
+
message += '\n';
|
|
333
|
+
}
|
|
334
|
+
message += `Available schemas:\n`;
|
|
335
|
+
if (builtIn.length > 0) {
|
|
336
|
+
message += ` Built-in: ${builtIn.join(', ')}\n`;
|
|
337
|
+
}
|
|
338
|
+
if (projectLocal.length > 0) {
|
|
339
|
+
message += ` Project-local: ${projectLocal.join(', ')}\n`;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
message += ` Project-local: (none found)\n`;
|
|
343
|
+
}
|
|
344
|
+
message += `\nFix: Edit tospec/config.yaml and change 'schema: ${invalidSchemaName}' to a valid schema name`;
|
|
345
|
+
return message;
|
|
346
|
+
}
|
|
347
|
+
/** Shared .yaml/.yml probe used by project-config readers. */
|
|
348
|
+
export function resolveConfigFilePath(projectRoot) {
|
|
349
|
+
const yamlPath = path.join(projectRoot, 'tospec', 'config.yaml');
|
|
350
|
+
if (existsSync(yamlPath)) {
|
|
351
|
+
return yamlPath;
|
|
352
|
+
}
|
|
353
|
+
const ymlPath = path.join(projectRoot, 'tospec', 'config.yml');
|
|
354
|
+
return existsSync(ymlPath) ? ymlPath : null;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Records how a tool's skills/commands were delivered (link vs copy) into
|
|
358
|
+
* tospec/config.yaml. Read-modify-write via the yaml package: does not
|
|
359
|
+
* preserve config-prompts.ts's hand-authored comment block if present —
|
|
360
|
+
* an accepted tradeoff of round-tripping a machine-owned field through a
|
|
361
|
+
* plain YAML parser/stringifier.
|
|
362
|
+
*/
|
|
363
|
+
export function writeAgentsLinkMode(projectRoot, toolId, modes) {
|
|
364
|
+
const configPath = resolveConfigFilePath(projectRoot) ?? path.join(projectRoot, 'tospec', 'config.yaml');
|
|
365
|
+
let raw = {};
|
|
366
|
+
if (existsSync(configPath)) {
|
|
367
|
+
try {
|
|
368
|
+
const parsed = parseYaml(readFileSync(configPath, 'utf-8'));
|
|
369
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
370
|
+
raw = parsed;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
catch {
|
|
374
|
+
// Unparseable config: overwrite with a fresh object rather than throw.
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const existingModes = (raw.agentsLinkMode && typeof raw.agentsLinkMode === 'object')
|
|
378
|
+
? raw.agentsLinkMode
|
|
379
|
+
: {};
|
|
380
|
+
const existingToolModes = (existingModes[toolId] && typeof existingModes[toolId] === 'object')
|
|
381
|
+
? existingModes[toolId]
|
|
382
|
+
: {};
|
|
383
|
+
raw.agentsLinkMode = {
|
|
384
|
+
...existingModes,
|
|
385
|
+
[toolId]: { ...existingToolModes, ...modes },
|
|
386
|
+
};
|
|
387
|
+
writeFileSync(configPath, stringifyYaml(raw), 'utf-8');
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=project-config.js.map
|
|
@@ -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AC,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Referenced-store index — stub for the single-team tospec build.
|
|
3
|
+
*
|
|
4
|
+
* Upstream Tospec lets a root declare `references:` (store ids whose specs
|
|
5
|
+
* feed the instructions output). tospec drops the store subsystem, so there
|
|
6
|
+
* are never any referenced stores: the index is always empty and the rendered
|
|
7
|
+
* blocks are always empty strings. The types and call surface are preserved so
|
|
8
|
+
* the engine and workflow commands compile and run unchanged.
|
|
9
|
+
*/
|
|
10
|
+
import type { ResolvedTospecRoot } from './root-selection.js';
|
|
11
|
+
import type { DeclarationEntry } from './project-config.js';
|
|
12
|
+
export interface ReferenceSpecEntry {
|
|
13
|
+
id: string;
|
|
14
|
+
summary: string;
|
|
15
|
+
}
|
|
16
|
+
interface ReferenceDiagnostic {
|
|
17
|
+
severity: 'error' | 'warning' | 'info';
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
target?: string;
|
|
21
|
+
fix?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ReferenceIndexEntry {
|
|
24
|
+
store_id: string;
|
|
25
|
+
root?: string;
|
|
26
|
+
specs?: ReferenceSpecEntry[];
|
|
27
|
+
fetch?: string;
|
|
28
|
+
status: ReferenceDiagnostic[];
|
|
29
|
+
}
|
|
30
|
+
export interface AssembleReferenceIndexInput {
|
|
31
|
+
references: DeclarationEntry[];
|
|
32
|
+
resolvedRoot: ResolvedTospecRoot;
|
|
33
|
+
globalDataDir?: string;
|
|
34
|
+
includeSpecs?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare function assembleReferenceIndex(_input: AssembleReferenceIndexInput): Promise<ReferenceIndexEntry[]>;
|
|
37
|
+
export declare function renderReferencedStoresBlock(_entries: ReferenceIndexEntry[]): string;
|
|
38
|
+
export declare function renderReferencedStoresSection(_entries: ReferenceIndexEntry[]): string;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../src/core/references.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,YAAY,EAAE,kBAAkB,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAGD,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAEhC;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAEnF;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAErF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// No store subsystem → no referenced stores → empty index.
|
|
2
|
+
export async function assembleReferenceIndex(_input) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
export function renderReferencedStoresBlock(_entries) {
|
|
6
|
+
return '';
|
|
7
|
+
}
|
|
8
|
+
export function renderReferencedStoresSection(_entries) {
|
|
9
|
+
return '';
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../src/core/references.ts"],"names":[],"mappings":"AAwCA,2DAA2D;AAC3D,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAmC;IAEnC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,QAA+B;IACzE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,QAA+B;IAC3E,OAAO,EAAE,CAAC;AACZ,CAAC"}
|