@thiagodiogo/pastelsdd 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +3 -0
- package/bin/pastelsdd.js +5 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +526 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +264 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +611 -0
- package/dist/commands/context-store.d.ts +3 -0
- package/dist/commands/context-store.js +282 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +183 -0
- package/dist/commands/initiative.d.ts +13 -0
- package/dist/commands/initiative.js +318 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +869 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +294 -0
- package/dist/commands/workflow/index.d.ts +19 -0
- package/dist/commands/workflow/index.js +13 -0
- package/dist/commands/workflow/initiative-link.d.ts +24 -0
- package/dist/commands/workflow/initiative-link.js +47 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +344 -0
- package/dist/commands/workflow/new-change.d.ts +17 -0
- package/dist/commands/workflow/new-change.js +141 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/set-change.d.ts +13 -0
- package/dist/commands/workflow/set-change.js +87 -0
- package/dist/commands/workflow/shared.d.ts +59 -0
- package/dist/commands/workflow/shared.js +116 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +90 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +69 -0
- package/dist/commands/workspace/context-status.d.ts +4 -0
- package/dist/commands/workspace/context-status.js +59 -0
- package/dist/commands/workspace/open-view.d.ts +62 -0
- package/dist/commands/workspace/open-view.js +228 -0
- package/dist/commands/workspace/open.d.ts +37 -0
- package/dist/commands/workspace/open.js +102 -0
- package/dist/commands/workspace/opener-selection.d.ts +11 -0
- package/dist/commands/workspace/opener-selection.js +93 -0
- package/dist/commands/workspace/operations.d.ts +28 -0
- package/dist/commands/workspace/operations.js +543 -0
- package/dist/commands/workspace/prompt-theme.d.ts +29 -0
- package/dist/commands/workspace/prompt-theme.js +24 -0
- package/dist/commands/workspace/registration.d.ts +13 -0
- package/dist/commands/workspace/registration.js +84 -0
- package/dist/commands/workspace/selection.d.ts +6 -0
- package/dist/commands/workspace/selection.js +122 -0
- package/dist/commands/workspace/types.d.ts +103 -0
- package/dist/commands/workspace/types.js +36 -0
- package/dist/commands/workspace.d.ts +6 -0
- package/dist/commands/workspace.js +678 -0
- package/dist/core/archive.d.ts +11 -0
- package/dist/core/archive.js +318 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +9 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +183 -0
- package/dist/core/artifact-graph/instruction-loader.js +256 -0
- package/dist/core/artifact-graph/outputs.d.ts +14 -0
- package/dist/core/artifact-graph/outputs.js +39 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +257 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +31 -0
- package/dist/core/artifact-graph/types.d.ts +40 -0
- package/dist/core/artifact-graph/types.js +29 -0
- package/dist/core/available-tools.d.ts +17 -0
- package/dist/core/available-tools.js +43 -0
- package/dist/core/change-metadata/index.d.ts +2 -0
- package/dist/core/change-metadata/index.js +2 -0
- package/dist/core/change-metadata/schema.d.ts +18 -0
- package/dist/core/change-metadata/schema.js +28 -0
- package/dist/core/change-status-policy.d.ts +50 -0
- package/dist/core/change-status-policy.js +70 -0
- package/dist/core/collections/index.d.ts +3 -0
- package/dist/core/collections/index.js +3 -0
- package/dist/core/collections/initiatives/collection.d.ts +4 -0
- package/dist/core/collections/initiatives/collection.js +17 -0
- package/dist/core/collections/initiatives/index.d.ts +6 -0
- package/dist/core/collections/initiatives/index.js +6 -0
- package/dist/core/collections/initiatives/operations.d.ts +49 -0
- package/dist/core/collections/initiatives/operations.js +175 -0
- package/dist/core/collections/initiatives/resolution.d.ts +87 -0
- package/dist/core/collections/initiatives/resolution.js +374 -0
- package/dist/core/collections/initiatives/schema.d.ts +41 -0
- package/dist/core/collections/initiatives/schema.js +134 -0
- package/dist/core/collections/initiatives/templates.d.ts +12 -0
- package/dist/core/collections/initiatives/templates.js +90 -0
- package/dist/core/collections/runtime.d.ts +46 -0
- package/dist/core/collections/runtime.js +194 -0
- package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
- package/dist/core/command-generation/adapters/amazon-q.js +26 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +26 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +27 -0
- package/dist/core/command-generation/adapters/bob.d.ts +14 -0
- package/dist/core/command-generation/adapters/bob.js +45 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/cline.d.ts +14 -0
- package/dist/core/command-generation/adapters/cline.js +27 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +28 -0
- package/dist/core/command-generation/adapters/codex.d.ts +16 -0
- package/dist/core/command-generation/adapters/codex.js +39 -0
- package/dist/core/command-generation/adapters/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +28 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +27 -0
- package/dist/core/command-generation/adapters/crush.d.ts +13 -0
- package/dist/core/command-generation/adapters/crush.js +30 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +27 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +29 -0
- package/dist/core/command-generation/adapters/index.d.ts +32 -0
- package/dist/core/command-generation/adapters/index.js +32 -0
- package/dist/core/command-generation/adapters/junie.d.ts +13 -0
- package/dist/core/command-generation/adapters/junie.js +26 -0
- package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/kilocode.js +23 -0
- package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
- package/dist/core/command-generation/adapters/kiro.js +26 -0
- package/dist/core/command-generation/adapters/lingma.d.ts +13 -0
- package/dist/core/command-generation/adapters/lingma.js +30 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
- package/dist/core/command-generation/adapters/opencode.js +29 -0
- package/dist/core/command-generation/adapters/pi.d.ts +18 -0
- package/dist/core/command-generation/adapters/pi.js +55 -0
- package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
- package/dist/core/command-generation/adapters/qoder.js +30 -0
- package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
- package/dist/core/command-generation/adapters/qwen.js +26 -0
- package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/roocode.js +27 -0
- package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
- package/dist/core/command-generation/adapters/windsurf.js +51 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +36 -0
- package/dist/core/command-generation/registry.js +98 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/completions/command-registry.d.ts +3 -0
- package/dist/core/completions/command-registry.js +939 -0
- package/dist/core/completions/completion-provider.d.ts +71 -0
- package/dist/core/completions/completion-provider.js +129 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +35 -0
- package/dist/core/completions/generators/bash-generator.js +230 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +160 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +36 -0
- package/dist/core/completions/generators/powershell-generator.js +266 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +47 -0
- package/dist/core/completions/generators/zsh-generator.js +274 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +102 -0
- package/dist/core/completions/installers/powershell-installer.js +387 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +117 -0
- package/dist/core/completions/installers/zsh-installer.js +421 -0
- package/dist/core/completions/shared-flags.d.ts +12 -0
- package/dist/core/completions/shared-flags.js +28 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +30 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +45 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +34 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +45 -0
- package/dist/core/completions/types.d.ts +101 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +86 -0
- package/dist/core/config-schema.js +213 -0
- package/dist/core/config.d.ts +18 -0
- package/dist/core/config.js +38 -0
- package/dist/core/context-store/binding.d.ts +53 -0
- package/dist/core/context-store/binding.js +197 -0
- package/dist/core/context-store/errors.d.ts +20 -0
- package/dist/core/context-store/errors.js +22 -0
- package/dist/core/context-store/foundation.d.ts +54 -0
- package/dist/core/context-store/foundation.js +318 -0
- package/dist/core/context-store/index.d.ts +6 -0
- package/dist/core/context-store/index.js +6 -0
- package/dist/core/context-store/operations.d.ts +62 -0
- package/dist/core/context-store/operations.js +352 -0
- package/dist/core/context-store/registry.d.ts +35 -0
- package/dist/core/context-store/registry.js +158 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +49 -0
- package/dist/core/global-config.js +124 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +7 -0
- package/dist/core/init.d.ts +37 -0
- package/dist/core/init.js +593 -0
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +514 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +171 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +197 -0
- package/dist/core/parsers/markdown-parser.d.ts +26 -0
- package/dist/core/parsers/markdown-parser.js +227 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/spec-structure.d.ts +9 -0
- package/dist/core/parsers/spec-structure.js +88 -0
- package/dist/core/planning-home.d.ts +21 -0
- package/dist/core/planning-home.js +108 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +200 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +40 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +223 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +96 -0
- package/dist/core/shared/tool-detection.d.ts +71 -0
- package/dist/core/shared/tool-detection.js +158 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +392 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/skill-templates.d.ts +19 -0
- package/dist/core/templates/skill-templates.js +18 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +314 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +277 -0
- package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/bulk-archive-change.js +492 -0
- package/dist/core/templates/workflows/continue-change.d.ts +10 -0
- package/dist/core/templates/workflows/continue-change.js +234 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +459 -0
- package/dist/core/templates/workflows/feedback.d.ts +9 -0
- package/dist/core/templates/workflows/feedback.js +108 -0
- package/dist/core/templates/workflows/ff-change.d.ts +10 -0
- package/dist/core/templates/workflows/ff-change.js +200 -0
- package/dist/core/templates/workflows/new-change.d.ts +10 -0
- package/dist/core/templates/workflows/new-change.js +143 -0
- package/dist/core/templates/workflows/onboard.d.ts +10 -0
- package/dist/core/templates/workflows/onboard.js +563 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +218 -0
- package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
- package/dist/core/templates/workflows/sync-specs.js +290 -0
- package/dist/core/templates/workflows/verify-change.d.ts +10 -0
- package/dist/core/templates/workflows/verify-change.js +338 -0
- package/dist/core/update.d.ts +82 -0
- package/dist/core/update.js +557 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +418 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +168 -0
- package/dist/core/workspace/foundation.d.ts +62 -0
- package/dist/core/workspace/foundation.js +274 -0
- package/dist/core/workspace/index.d.ts +8 -0
- package/dist/core/workspace/index.js +8 -0
- package/dist/core/workspace/legacy-state.d.ts +28 -0
- package/dist/core/workspace/legacy-state.js +200 -0
- package/dist/core/workspace/link-input.d.ts +9 -0
- package/dist/core/workspace/link-input.js +32 -0
- package/dist/core/workspace/open-surface.d.ts +43 -0
- package/dist/core/workspace/open-surface.js +214 -0
- package/dist/core/workspace/openers.d.ts +21 -0
- package/dist/core/workspace/openers.js +119 -0
- package/dist/core/workspace/registry.d.ts +24 -0
- package/dist/core/workspace/registry.js +146 -0
- package/dist/core/workspace/skills.d.ts +57 -0
- package/dist/core/workspace/skills.js +334 -0
- package/dist/core/workspace/state-io.d.ts +10 -0
- package/dist/core/workspace/state-io.js +119 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.js +159 -0
- package/dist/telemetry/config.d.ts +38 -0
- package/dist/telemetry/config.js +136 -0
- package/dist/telemetry/index.d.ts +31 -0
- package/dist/telemetry/index.js +164 -0
- package/dist/ui/ascii-patterns.d.ts +16 -0
- package/dist/ui/ascii-patterns.js +133 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +146 -0
- package/dist/utils/change-metadata.d.ts +54 -0
- package/dist/utils/change-metadata.js +141 -0
- package/dist/utils/change-utils.d.ts +71 -0
- package/dist/utils/change-utils.js +123 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/file-system.d.ts +41 -0
- package/dist/utils/file-system.js +301 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +84 -0
- package/schemas/spec-driven/schema.yaml +153 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +23 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +9 -0
- package/schemas/workspace-planning/schema.yaml +72 -0
- package/schemas/workspace-planning/templates/design.md +33 -0
- package/schemas/workspace-planning/templates/proposal.md +28 -0
- package/schemas/workspace-planning/templates/spec.md +9 -0
- package/schemas/workspace-planning/templates/tasks.md +15 -0
- package/scripts/postinstall.js +83 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export function summarizePlanningHome(planningHome) {
|
|
2
|
+
if (!planningHome) {
|
|
3
|
+
return undefined;
|
|
4
|
+
}
|
|
5
|
+
return {
|
|
6
|
+
kind: planningHome.kind,
|
|
7
|
+
root: planningHome.root,
|
|
8
|
+
changesDir: planningHome.changesDir,
|
|
9
|
+
defaultSchema: planningHome.defaultSchema,
|
|
10
|
+
...(planningHome.workspace ? { workspaceName: planningHome.workspace.name } : {}),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function summarizeAffectedAreas(input) {
|
|
14
|
+
if (input.planningHome?.kind !== 'workspace') {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
const known = Array.from(new Set(input.metadata?.affected_areas ?? [])).sort((a, b) => a.localeCompare(b));
|
|
18
|
+
const validAreas = new Set(input.planningHome.workspace?.links ?? []);
|
|
19
|
+
const invalid = known.filter((areaName) => validAreas.size > 0 && !validAreas.has(areaName));
|
|
20
|
+
return {
|
|
21
|
+
known,
|
|
22
|
+
unresolved: known.length === 0,
|
|
23
|
+
invalid,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function buildActionContext(input) {
|
|
27
|
+
if (input.planningHome?.kind === 'workspace') {
|
|
28
|
+
return {
|
|
29
|
+
mode: 'workspace-planning',
|
|
30
|
+
sourceOfTruth: 'workspace-local',
|
|
31
|
+
planningArtifacts: input.artifactIds,
|
|
32
|
+
linkedContext: (input.planningHome.workspace?.links ?? []).map((name) => ({ name })),
|
|
33
|
+
allowedEditRoots: [],
|
|
34
|
+
requiresAffectedAreaSelection: true,
|
|
35
|
+
constraints: [
|
|
36
|
+
'Treat workspace-local planning artifacts as compatibility context for this local view.',
|
|
37
|
+
'Use initiatives for durable coordination when initiative context exists.',
|
|
38
|
+
'Treat linked repos and folders as context until an explicit edit root is selected.',
|
|
39
|
+
'Do not make implementation edits without an explicit allowed edit root.',
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
mode: 'repo-local',
|
|
45
|
+
sourceOfTruth: 'repo',
|
|
46
|
+
planningArtifacts: input.artifactIds,
|
|
47
|
+
linkedContext: [],
|
|
48
|
+
allowedEditRoots: [input.projectRoot],
|
|
49
|
+
requiresAffectedAreaSelection: false,
|
|
50
|
+
constraints: ['Repo-local change artifacts and implementation edits are scoped to this project.'],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function buildNextSteps(input) {
|
|
54
|
+
const readyArtifact = input.artifactStatuses.find((artifact) => artifact.status === 'ready');
|
|
55
|
+
const steps = [];
|
|
56
|
+
if (readyArtifact) {
|
|
57
|
+
steps.push(`Run pastelsdd instructions ${readyArtifact.id} --change "${input.changeName}" --json before writing that artifact.`);
|
|
58
|
+
}
|
|
59
|
+
else if (input.allArtifactsComplete) {
|
|
60
|
+
steps.push('All planning artifacts are complete; review tasks before implementation.');
|
|
61
|
+
}
|
|
62
|
+
if (input.planningHome?.kind === 'workspace') {
|
|
63
|
+
if (input.affectedAreas?.unresolved) {
|
|
64
|
+
steps.push('Identify affected areas in change metadata or coordination tasks as planning continues.');
|
|
65
|
+
}
|
|
66
|
+
steps.push('Select an affected area and allowed edit root before implementation edits.');
|
|
67
|
+
}
|
|
68
|
+
return steps;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=change-status-policy.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CollectionRegistry, type MountedCollection } from '../runtime.js';
|
|
2
|
+
export declare function createInitiativesCollectionRegistry(): CollectionRegistry;
|
|
3
|
+
export declare function mountInitiativesCollection(storeRoot: string): MountedCollection;
|
|
4
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createCollectionRegistry, mountCollections, } from '../runtime.js';
|
|
2
|
+
import { INITIATIVE_COLLECTION_ID } from './schema.js';
|
|
3
|
+
export function createInitiativesCollectionRegistry() {
|
|
4
|
+
return createCollectionRegistry([
|
|
5
|
+
{
|
|
6
|
+
id: INITIATIVE_COLLECTION_ID,
|
|
7
|
+
mount: INITIATIVE_COLLECTION_ID,
|
|
8
|
+
},
|
|
9
|
+
]);
|
|
10
|
+
}
|
|
11
|
+
export function mountInitiativesCollection(storeRoot) {
|
|
12
|
+
return mountCollections({
|
|
13
|
+
storeRoot,
|
|
14
|
+
collections: createInitiativesCollectionRegistry(),
|
|
15
|
+
}).require(INITIATIVE_COLLECTION_ID);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as nodeFs from 'node:fs';
|
|
2
|
+
import type { MountedCollection } from '../runtime.js';
|
|
3
|
+
import { type InitiativeMetadata, type InitiativeState, type InitiativeStatus } from './schema.js';
|
|
4
|
+
import { type InitiativeTemplateFile } from './templates.js';
|
|
5
|
+
export interface InitiativeDirectoryEntry {
|
|
6
|
+
name: string;
|
|
7
|
+
isDirectory(): boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface InitiativeOperationsFileSystem {
|
|
10
|
+
mkdir(dirPath: string, options: {
|
|
11
|
+
recursive?: boolean;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
writeFile(filePath: string, content: string, options: {
|
|
14
|
+
flag?: nodeFs.OpenMode;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
readFile(filePath: string): Promise<string>;
|
|
17
|
+
readdir(dirPath: string, options: {
|
|
18
|
+
withFileTypes: true;
|
|
19
|
+
}): Promise<readonly InitiativeDirectoryEntry[]>;
|
|
20
|
+
rm(dirPath: string, options: {
|
|
21
|
+
recursive?: boolean;
|
|
22
|
+
force?: boolean;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export interface InitiativeOperationDependencies {
|
|
26
|
+
fileSystem?: InitiativeOperationsFileSystem;
|
|
27
|
+
}
|
|
28
|
+
export interface CreateInitiativeInput extends InitiativeOperationDependencies {
|
|
29
|
+
collection: MountedCollection;
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
32
|
+
summary: string;
|
|
33
|
+
status?: InitiativeStatus;
|
|
34
|
+
owners?: string[];
|
|
35
|
+
metadata?: InitiativeMetadata;
|
|
36
|
+
getCurrentDate?: () => string;
|
|
37
|
+
buildTemplateFiles?: (state: InitiativeState) => readonly InitiativeTemplateFile[];
|
|
38
|
+
}
|
|
39
|
+
export interface ListInitiativesInput extends InitiativeOperationDependencies {
|
|
40
|
+
collection: MountedCollection;
|
|
41
|
+
}
|
|
42
|
+
export interface ReadInitiativeInput extends InitiativeOperationDependencies {
|
|
43
|
+
collection: MountedCollection;
|
|
44
|
+
id: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function createInitiative(input: CreateInitiativeInput): Promise<InitiativeState>;
|
|
47
|
+
export declare function readInitiative(input: ReadInitiativeInput): Promise<InitiativeState | null>;
|
|
48
|
+
export declare function listInitiatives(input: ListInitiativesInput): Promise<InitiativeState[]>;
|
|
49
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import * as nodeFs from 'node:fs';
|
|
2
|
+
import { INITIATIVE_COLLECTION_ID, INITIATIVE_FILE_NAME, parseInitiativeState, serializeInitiativeState, validateInitiativeId, } from './schema.js';
|
|
3
|
+
import { buildDefaultInitiativeFiles, } from './templates.js';
|
|
4
|
+
const fs = nodeFs.promises;
|
|
5
|
+
const nodeFileSystem = {
|
|
6
|
+
async mkdir(dirPath, options) {
|
|
7
|
+
await fs.mkdir(dirPath, options);
|
|
8
|
+
},
|
|
9
|
+
async writeFile(filePath, content, options) {
|
|
10
|
+
await fs.writeFile(filePath, content, {
|
|
11
|
+
encoding: 'utf-8',
|
|
12
|
+
flag: options.flag ?? 'w',
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
async readFile(filePath) {
|
|
16
|
+
return fs.readFile(filePath, 'utf-8');
|
|
17
|
+
},
|
|
18
|
+
async readdir(dirPath, options) {
|
|
19
|
+
return fs.readdir(dirPath, options);
|
|
20
|
+
},
|
|
21
|
+
async rm(dirPath, options) {
|
|
22
|
+
await fs.rm(dirPath, options);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
function getCurrentDate() {
|
|
26
|
+
return new Date().toISOString().split('T')[0];
|
|
27
|
+
}
|
|
28
|
+
function getFileSystem(fileSystem) {
|
|
29
|
+
return fileSystem ?? nodeFileSystem;
|
|
30
|
+
}
|
|
31
|
+
function isFileNotFoundError(error) {
|
|
32
|
+
return (typeof error === 'object' &&
|
|
33
|
+
error !== null &&
|
|
34
|
+
'code' in error &&
|
|
35
|
+
error.code === 'ENOENT');
|
|
36
|
+
}
|
|
37
|
+
function isPathExistsError(error) {
|
|
38
|
+
return (typeof error === 'object' &&
|
|
39
|
+
error !== null &&
|
|
40
|
+
'code' in error &&
|
|
41
|
+
error.code === 'EEXIST');
|
|
42
|
+
}
|
|
43
|
+
function errorMessage(error) {
|
|
44
|
+
return error instanceof Error ? error.message : String(error);
|
|
45
|
+
}
|
|
46
|
+
function assertInitiativesCollection(collection) {
|
|
47
|
+
if (collection.collectionId !== INITIATIVE_COLLECTION_ID) {
|
|
48
|
+
throw new Error(`Expected mounted '${INITIATIVE_COLLECTION_ID}' collection, got '${collection.collectionId}'`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function resolveInitiativeFilePath(collection, initiativeId, fileName) {
|
|
52
|
+
return collection.resolvePath(`${initiativeId}/${fileName}`);
|
|
53
|
+
}
|
|
54
|
+
function normalizeCreateState(input) {
|
|
55
|
+
return parseInitiativeState(serializeInitiativeState({
|
|
56
|
+
version: 1,
|
|
57
|
+
id: validateInitiativeId(input.id),
|
|
58
|
+
title: input.title,
|
|
59
|
+
summary: input.summary,
|
|
60
|
+
status: input.status ?? 'exploring',
|
|
61
|
+
created: (input.getCurrentDate ?? getCurrentDate)(),
|
|
62
|
+
owners: input.owners ?? [],
|
|
63
|
+
metadata: input.metadata ?? {},
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
async function writeExclusiveFile(fileSystem, filePath, content) {
|
|
67
|
+
await fileSystem.writeFile(filePath, content, { flag: 'wx' });
|
|
68
|
+
}
|
|
69
|
+
async function cleanupCreatedInitiative(fileSystem, initiativeRoot, originalError, initiativeId) {
|
|
70
|
+
try {
|
|
71
|
+
await fileSystem.rm(initiativeRoot, { recursive: true, force: true });
|
|
72
|
+
}
|
|
73
|
+
catch (cleanupError) {
|
|
74
|
+
throw new Error(`Failed to create initiative '${initiativeId}' and cleanup failed: ${errorMessage(originalError)}; cleanup: ${errorMessage(cleanupError)}`);
|
|
75
|
+
}
|
|
76
|
+
throw new Error(`Failed to create initiative '${initiativeId}': ${errorMessage(originalError)}`);
|
|
77
|
+
}
|
|
78
|
+
export async function createInitiative(input) {
|
|
79
|
+
assertInitiativesCollection(input.collection);
|
|
80
|
+
const state = normalizeCreateState(input);
|
|
81
|
+
const fileSystem = getFileSystem(input.fileSystem);
|
|
82
|
+
const initiativeRoot = input.collection.resolvePath(state.id);
|
|
83
|
+
const buildTemplateFiles = input.buildTemplateFiles ?? buildDefaultInitiativeFiles;
|
|
84
|
+
try {
|
|
85
|
+
await fileSystem.mkdir(input.collection.resolvePath(), { recursive: true });
|
|
86
|
+
await fileSystem.mkdir(initiativeRoot, { recursive: false });
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (isPathExistsError(error)) {
|
|
90
|
+
throw new Error(`Initiative '${state.id}' already exists at ${initiativeRoot}`);
|
|
91
|
+
}
|
|
92
|
+
throw new Error(`Failed to create initiative '${state.id}': ${errorMessage(error)}`);
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
await writeExclusiveFile(fileSystem, resolveInitiativeFilePath(input.collection, state.id, INITIATIVE_FILE_NAME), serializeInitiativeState(state));
|
|
96
|
+
for (const templateFile of buildTemplateFiles(state)) {
|
|
97
|
+
await writeExclusiveFile(fileSystem, resolveInitiativeFilePath(input.collection, state.id, templateFile.fileName), templateFile.content);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
await cleanupCreatedInitiative(fileSystem, initiativeRoot, error, state.id);
|
|
102
|
+
}
|
|
103
|
+
return state;
|
|
104
|
+
}
|
|
105
|
+
export async function readInitiative(input) {
|
|
106
|
+
assertInitiativesCollection(input.collection);
|
|
107
|
+
const initiativeId = validateInitiativeId(input.id);
|
|
108
|
+
const fileSystem = getFileSystem(input.fileSystem);
|
|
109
|
+
const initiativeFilePath = resolveInitiativeFilePath(input.collection, initiativeId, INITIATIVE_FILE_NAME);
|
|
110
|
+
let content;
|
|
111
|
+
try {
|
|
112
|
+
content = await fileSystem.readFile(initiativeFilePath);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
if (isFileNotFoundError(error)) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
throw new Error(`Invalid initiative '${initiativeId}': failed to read ${INITIATIVE_FILE_NAME}: ${errorMessage(error)}`);
|
|
119
|
+
}
|
|
120
|
+
let state;
|
|
121
|
+
try {
|
|
122
|
+
state = parseInitiativeState(content);
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
throw new Error(`Invalid initiative '${initiativeId}': ${errorMessage(error)}`);
|
|
126
|
+
}
|
|
127
|
+
if (state.id !== initiativeId) {
|
|
128
|
+
throw new Error(`Invalid initiative '${initiativeId}': ${INITIATIVE_FILE_NAME} id '${state.id}' must match folder name`);
|
|
129
|
+
}
|
|
130
|
+
return state;
|
|
131
|
+
}
|
|
132
|
+
export async function listInitiatives(input) {
|
|
133
|
+
assertInitiativesCollection(input.collection);
|
|
134
|
+
const fileSystem = getFileSystem(input.fileSystem);
|
|
135
|
+
let entries;
|
|
136
|
+
try {
|
|
137
|
+
entries = await fileSystem.readdir(input.collection.resolvePath(), { withFileTypes: true });
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
if (isFileNotFoundError(error)) {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
throw new Error(`Failed to list initiatives: ${errorMessage(error)}`);
|
|
144
|
+
}
|
|
145
|
+
const initiatives = [];
|
|
146
|
+
for (const entry of entries) {
|
|
147
|
+
if (!entry.isDirectory()) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const initiativeFilePath = resolveInitiativeFilePath(input.collection, entry.name, INITIATIVE_FILE_NAME);
|
|
151
|
+
let content;
|
|
152
|
+
try {
|
|
153
|
+
content = await fileSystem.readFile(initiativeFilePath);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
if (isFileNotFoundError(error)) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
throw new Error(`Invalid initiative '${entry.name}': failed to read ${INITIATIVE_FILE_NAME}: ${errorMessage(error)}`);
|
|
160
|
+
}
|
|
161
|
+
let state;
|
|
162
|
+
try {
|
|
163
|
+
state = parseInitiativeState(content);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
throw new Error(`Invalid initiative '${entry.name}': ${errorMessage(error)}`);
|
|
167
|
+
}
|
|
168
|
+
if (state.id !== entry.name) {
|
|
169
|
+
throw new Error(`Invalid initiative '${entry.name}': ${INITIATIVE_FILE_NAME} id '${state.id}' must match folder name`);
|
|
170
|
+
}
|
|
171
|
+
initiatives.push(state);
|
|
172
|
+
}
|
|
173
|
+
return initiatives.sort((a, b) => a.id.localeCompare(b.id));
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { formatContextStoreSelector, type ContextStoreSelectorOptions, type ContextStoreSelectorSource, type SelectedContextStore } from '../../context-store/index.js';
|
|
2
|
+
import { type InitiativeState } from './schema.js';
|
|
3
|
+
export interface InitiativeSelectorOptions extends ContextStoreSelectorOptions {
|
|
4
|
+
json?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export type { ContextStoreSelectorSource, SelectedContextStore };
|
|
7
|
+
export { formatContextStoreSelector };
|
|
8
|
+
export interface InitiativeResolutionMatch {
|
|
9
|
+
context_store: {
|
|
10
|
+
id: string;
|
|
11
|
+
root: string;
|
|
12
|
+
};
|
|
13
|
+
initiative: {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
root: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface InitiativeResolutionDetails extends Record<string, unknown> {
|
|
20
|
+
matches?: InitiativeResolutionMatch[];
|
|
21
|
+
}
|
|
22
|
+
export declare class InitiativeResolutionError extends Error {
|
|
23
|
+
readonly code: string;
|
|
24
|
+
readonly target?: string;
|
|
25
|
+
readonly fix?: string;
|
|
26
|
+
readonly details?: InitiativeResolutionDetails;
|
|
27
|
+
constructor(message: string, code: string, options?: {
|
|
28
|
+
target?: string;
|
|
29
|
+
fix?: string;
|
|
30
|
+
details?: InitiativeResolutionDetails;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export interface InitiativeViewReference {
|
|
34
|
+
store: string;
|
|
35
|
+
storeSource: ContextStoreSelectorSource;
|
|
36
|
+
storeRoot: string;
|
|
37
|
+
id: string;
|
|
38
|
+
title: string;
|
|
39
|
+
summary: string;
|
|
40
|
+
created: string;
|
|
41
|
+
root: string;
|
|
42
|
+
storePath: string;
|
|
43
|
+
metadataPath: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ListedInitiativeReference extends InitiativeViewReference {
|
|
46
|
+
status: InitiativeState['status'];
|
|
47
|
+
owners: InitiativeState['owners'];
|
|
48
|
+
metadata: InitiativeState['metadata'];
|
|
49
|
+
}
|
|
50
|
+
export type InitiativeDiagnosticSeverity = 'error' | 'warning';
|
|
51
|
+
export interface InitiativeDiagnostic {
|
|
52
|
+
severity: InitiativeDiagnosticSeverity;
|
|
53
|
+
code: string;
|
|
54
|
+
message: string;
|
|
55
|
+
target?: string;
|
|
56
|
+
fix?: string;
|
|
57
|
+
details?: InitiativeResolutionDetails;
|
|
58
|
+
}
|
|
59
|
+
export interface ContextStoreInitiativeListReference {
|
|
60
|
+
contextStore: SelectedContextStore;
|
|
61
|
+
initiatives: ListedInitiativeReference[];
|
|
62
|
+
status: InitiativeDiagnostic[];
|
|
63
|
+
}
|
|
64
|
+
export interface InitiativeListReferenceResult {
|
|
65
|
+
contextStore: SelectedContextStore | null;
|
|
66
|
+
contextStores: ContextStoreInitiativeListReference[];
|
|
67
|
+
initiatives: ListedInitiativeReference[];
|
|
68
|
+
status: InitiativeDiagnostic[];
|
|
69
|
+
}
|
|
70
|
+
export declare function initiativeDiagnosticFromError(error: unknown): InitiativeDiagnostic;
|
|
71
|
+
export declare function parseInitiativeReference(reference: string | undefined, options: InitiativeSelectorOptions): {
|
|
72
|
+
initiativeId: string;
|
|
73
|
+
options: InitiativeSelectorOptions;
|
|
74
|
+
};
|
|
75
|
+
export declare function resolveRegisteredInitiativeContextStore(storeId: string): Promise<SelectedContextStore>;
|
|
76
|
+
export declare function resolvePathInitiativeContextStore(storePath: string): Promise<SelectedContextStore>;
|
|
77
|
+
export declare function selectContextStoreForInitiative(options: InitiativeSelectorOptions, commandName: 'create' | 'list' | 'show'): Promise<SelectedContextStore>;
|
|
78
|
+
export declare function resolveSelectedInitiativeViewReference(selected: SelectedContextStore, initiativeId: string): Promise<InitiativeViewReference>;
|
|
79
|
+
export declare function listSelectedInitiativeViewReferences(selected: SelectedContextStore): Promise<ContextStoreInitiativeListReference>;
|
|
80
|
+
export declare function listInitiativeViewReferences(options?: InitiativeSelectorOptions): Promise<InitiativeListReferenceResult>;
|
|
81
|
+
export declare function resolveInitiativeViewReference(reference: string | undefined, options?: InitiativeSelectorOptions): Promise<InitiativeViewReference>;
|
|
82
|
+
export interface InitiativeLinkReference {
|
|
83
|
+
store: string;
|
|
84
|
+
id: string;
|
|
85
|
+
}
|
|
86
|
+
export declare function resolveInitiativeLinkReference(reference: string | undefined, options?: InitiativeSelectorOptions): Promise<InitiativeLinkReference>;
|
|
87
|
+
//# sourceMappingURL=resolution.d.ts.map
|