silvermoon 0.3.0-rc.2 → 0.4.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/README.md +28 -28
- package/README.zh-CN.md +26 -24
- package/dist/bin/build-npm-tarball.d.ts +28 -0
- package/dist/bin/build-npm-tarball.d.ts.map +1 -0
- package/dist/bin/build-npm-tarball.js +200 -0
- package/dist/bin/build-npm-tarball.js.map +1 -0
- package/dist/bin/check-pack.d.ts +2 -0
- package/dist/bin/check-pack.d.ts.map +1 -0
- package/dist/bin/check-pack.js +421 -0
- package/dist/bin/check-pack.js.map +1 -0
- package/dist/bin/ci-package-risk.d.ts +19 -0
- package/dist/bin/ci-package-risk.d.ts.map +1 -0
- package/dist/bin/ci-package-risk.js +78 -0
- package/dist/bin/ci-package-risk.js.map +1 -0
- package/dist/bin/generate-npm-readme.d.ts +7 -0
- package/dist/bin/generate-npm-readme.d.ts.map +1 -0
- package/dist/bin/generate-npm-readme.js +232 -0
- package/dist/bin/generate-npm-readme.js.map +1 -0
- package/dist/bin/migrate-v1-to-v2.d.ts +3 -0
- package/dist/bin/migrate-v1-to-v2.d.ts.map +1 -0
- package/dist/bin/migrate-v1-to-v2.js +25 -0
- package/dist/bin/migrate-v1-to-v2.js.map +1 -0
- package/dist/bin/prepare-npm-release.d.ts +46 -0
- package/dist/bin/prepare-npm-release.d.ts.map +1 -0
- package/dist/bin/prepare-npm-release.js +210 -0
- package/dist/bin/prepare-npm-release.js.map +1 -0
- package/dist/bin/pure-check.d.ts +15 -0
- package/dist/bin/pure-check.d.ts.map +1 -0
- package/dist/bin/pure-check.js +448 -0
- package/dist/bin/pure-check.js.map +1 -0
- package/dist/bin/run-checks.d.ts +34 -0
- package/dist/bin/run-checks.d.ts.map +1 -0
- package/dist/bin/run-checks.js +149 -0
- package/dist/bin/run-checks.js.map +1 -0
- package/dist/bin/silvermoon.d.ts +76 -0
- package/dist/bin/silvermoon.d.ts.map +1 -0
- package/dist/bin/silvermoon.js +401 -0
- package/dist/bin/silvermoon.js.map +1 -0
- package/dist/bin/sync-skills.d.ts +2 -0
- package/dist/bin/sync-skills.d.ts.map +1 -0
- package/dist/bin/sync-skills.js +78 -0
- package/dist/bin/sync-skills.js.map +1 -0
- package/dist/bin/verify-npm-release.d.ts +55 -0
- package/dist/bin/verify-npm-release.d.ts.map +1 -0
- package/dist/bin/verify-npm-release.js +418 -0
- package/dist/bin/verify-npm-release.js.map +1 -0
- package/dist/src/business/agent-copilot.d.ts +82 -0
- package/dist/src/business/agent-copilot.d.ts.map +1 -0
- package/dist/src/business/agent-copilot.js +330 -0
- package/dist/src/business/agent-copilot.js.map +1 -0
- package/dist/src/business/agent-project-registry.d.ts +22 -0
- package/dist/src/business/agent-project-registry.d.ts.map +1 -0
- package/dist/src/business/agent-project-registry.js +239 -0
- package/dist/src/business/agent-project-registry.js.map +1 -0
- package/dist/src/business/agent-project-runtime.d.ts +37 -0
- package/dist/src/business/agent-project-runtime.d.ts.map +1 -0
- package/dist/src/business/agent-project-runtime.js +198 -0
- package/dist/src/business/agent-project-runtime.js.map +1 -0
- package/dist/src/business/append-event-history.d.ts +21 -0
- package/dist/src/business/append-event-history.d.ts.map +1 -0
- package/dist/src/business/append-event-history.js +138 -0
- package/dist/src/business/append-event-history.js.map +1 -0
- package/dist/src/business/append-event.d.ts +140 -0
- package/dist/src/business/append-event.d.ts.map +1 -0
- package/dist/src/business/append-event.js +292 -0
- package/dist/src/business/append-event.js.map +1 -0
- package/dist/src/business/check-repository.d.ts +109 -0
- package/dist/src/business/check-repository.d.ts.map +1 -0
- package/dist/src/business/check-repository.js +379 -0
- package/dist/src/business/check-repository.js.map +1 -0
- package/dist/src/business/create-idea.d.ts +100 -0
- package/dist/src/business/create-idea.d.ts.map +1 -0
- package/dist/src/business/create-idea.js +224 -0
- package/dist/src/business/create-idea.js.map +1 -0
- package/dist/src/business/event-command.d.ts +111 -0
- package/dist/src/business/event-command.d.ts.map +1 -0
- package/dist/src/business/event-command.js +239 -0
- package/dist/src/business/event-command.js.map +1 -0
- package/dist/src/business/index.d.ts +7 -0
- package/dist/src/business/index.d.ts.map +1 -0
- package/dist/src/business/index.js +7 -0
- package/dist/src/business/index.js.map +1 -0
- package/dist/src/business/list-ideas.d.ts +97 -0
- package/dist/src/business/list-ideas.d.ts.map +1 -0
- package/dist/src/business/list-ideas.js +177 -0
- package/dist/src/business/list-ideas.js.map +1 -0
- package/dist/src/business/migrate-v1-to-v2.d.ts +23 -0
- package/dist/src/business/migrate-v1-to-v2.d.ts.map +1 -0
- package/dist/src/business/migrate-v1-to-v2.js +152 -0
- package/dist/src/business/migrate-v1-to-v2.js.map +1 -0
- package/dist/src/business/replay-events.d.ts +20 -0
- package/dist/src/business/replay-events.d.ts.map +1 -0
- package/dist/src/business/replay-events.js +27 -0
- package/dist/src/business/replay-events.js.map +1 -0
- package/dist/src/business/schema-migration.d.ts +19 -0
- package/dist/src/business/schema-migration.d.ts.map +1 -0
- package/dist/src/business/schema-migration.js +23 -0
- package/dist/src/business/schema-migration.js.map +1 -0
- package/dist/src/business/shared/assess-idea-creation-readiness.d.ts +3 -0
- package/dist/src/business/shared/assess-idea-creation-readiness.d.ts.map +1 -0
- package/dist/src/business/shared/assess-idea-creation-readiness.js +9 -0
- package/dist/src/business/shared/assess-idea-creation-readiness.js.map +1 -0
- package/dist/src/business/shared/assess-repository-readiness-with.d.ts +18 -0
- package/dist/src/business/shared/assess-repository-readiness-with.d.ts.map +1 -0
- package/dist/src/business/shared/assess-repository-readiness-with.js +125 -0
- package/dist/src/business/shared/assess-repository-readiness-with.js.map +1 -0
- package/dist/src/business/shared/assess-repository-readiness.d.ts +3 -0
- package/dist/src/business/shared/assess-repository-readiness.d.ts.map +1 -0
- package/dist/src/business/shared/assess-repository-readiness.js +6 -0
- package/dist/src/business/shared/assess-repository-readiness.js.map +1 -0
- package/dist/src/business/shared/business-types.d.ts +151 -0
- package/dist/src/business/shared/business-types.d.ts.map +1 -0
- package/dist/src/business/shared/business-types.js +83 -0
- package/dist/src/business/shared/business-types.js.map +1 -0
- package/dist/src/business/shared/evaluate-local-readiness.d.ts +9 -0
- package/dist/src/business/shared/evaluate-local-readiness.d.ts.map +1 -0
- package/dist/src/business/shared/evaluate-local-readiness.js +97 -0
- package/dist/src/business/shared/evaluate-local-readiness.js.map +1 -0
- package/dist/src/business/shared/evaluate-primary-relation.d.ts +12 -0
- package/dist/src/business/shared/evaluate-primary-relation.d.ts.map +1 -0
- package/dist/src/business/shared/evaluate-primary-relation.js +40 -0
- package/dist/src/business/shared/evaluate-primary-relation.js.map +1 -0
- package/dist/src/business/shared/idea-layout.d.ts +55 -0
- package/dist/src/business/shared/idea-layout.d.ts.map +1 -0
- package/dist/src/business/shared/idea-layout.js +434 -0
- package/dist/src/business/shared/idea-layout.js.map +1 -0
- package/dist/src/business/shared/index.d.ts +18 -0
- package/dist/src/business/shared/index.d.ts.map +1 -0
- package/dist/src/business/shared/index.js +17 -0
- package/dist/src/business/shared/index.js.map +1 -0
- package/dist/src/business/shared/inspect-candidate.d.ts +5 -0
- package/dist/src/business/shared/inspect-candidate.d.ts.map +1 -0
- package/dist/src/business/shared/inspect-candidate.js +57 -0
- package/dist/src/business/shared/inspect-candidate.js.map +1 -0
- package/dist/src/business/shared/metadata-failure-observation.d.ts +21 -0
- package/dist/src/business/shared/metadata-failure-observation.d.ts.map +1 -0
- package/dist/src/business/shared/metadata-failure-observation.js +30 -0
- package/dist/src/business/shared/metadata-failure-observation.js.map +1 -0
- package/dist/src/business/shared/observe-device.d.ts +150 -0
- package/dist/src/business/shared/observe-device.d.ts.map +1 -0
- package/dist/src/business/shared/observe-device.js +71 -0
- package/dist/src/business/shared/observe-device.js.map +1 -0
- package/dist/src/business/shared/observe-idea.d.ts +14 -0
- package/dist/src/business/shared/observe-idea.d.ts.map +1 -0
- package/dist/src/business/shared/observe-idea.js +14 -0
- package/dist/src/business/shared/observe-idea.js.map +1 -0
- package/dist/src/business/shared/observe-project.d.ts +39 -0
- package/dist/src/business/shared/observe-project.d.ts.map +1 -0
- package/dist/src/business/shared/observe-project.js +11 -0
- package/dist/src/business/shared/observe-project.js.map +1 -0
- package/dist/src/business/shared/observe-snapshot.d.ts +35 -0
- package/dist/src/business/shared/observe-snapshot.d.ts.map +1 -0
- package/dist/src/business/shared/observe-snapshot.js +518 -0
- package/dist/src/business/shared/observe-snapshot.js.map +1 -0
- package/dist/src/business/shared/read-idea-inventory-item.d.ts +13 -0
- package/dist/src/business/shared/read-idea-inventory-item.d.ts.map +1 -0
- package/dist/src/business/shared/read-idea-inventory-item.js +18 -0
- package/dist/src/business/shared/read-idea-inventory-item.js.map +1 -0
- package/dist/src/business/shared/resolve-idea.d.ts +7 -0
- package/dist/src/business/shared/resolve-idea.d.ts.map +1 -0
- package/dist/src/business/shared/resolve-idea.js +14 -0
- package/dist/src/business/shared/resolve-idea.js.map +1 -0
- package/dist/src/business/shared/with-observation-language.d.ts +3 -0
- package/dist/src/business/shared/with-observation-language.d.ts.map +1 -0
- package/dist/src/business/shared/with-observation-language.js +20 -0
- package/dist/src/business/shared/with-observation-language.js.map +1 -0
- package/dist/src/business/whats-next.d.ts +94 -0
- package/dist/src/business/whats-next.d.ts.map +1 -0
- package/dist/src/business/whats-next.js +208 -0
- package/dist/src/business/whats-next.js.map +1 -0
- package/dist/src/foundation/command-message/index.d.ts +3 -0
- package/dist/src/foundation/command-message/index.d.ts.map +1 -0
- package/dist/src/foundation/command-message/index.js +3 -0
- package/dist/src/foundation/command-message/index.js.map +1 -0
- package/dist/src/foundation/command-message/observation.d.ts +223 -0
- package/dist/src/foundation/command-message/observation.d.ts.map +1 -0
- package/dist/src/foundation/command-message/observation.js +364 -0
- package/dist/src/foundation/command-message/observation.js.map +1 -0
- package/dist/src/foundation/command-message/runtime.d.ts +214 -0
- package/dist/src/foundation/command-message/runtime.d.ts.map +1 -0
- package/dist/src/foundation/command-message/runtime.js +215 -0
- package/dist/src/foundation/command-message/runtime.js.map +1 -0
- package/dist/src/foundation/coordinates/index.d.ts +3 -0
- package/dist/src/foundation/coordinates/index.d.ts.map +1 -0
- package/dist/src/foundation/coordinates/index.js +3 -0
- package/dist/src/foundation/coordinates/index.js.map +1 -0
- package/dist/src/foundation/coordinates/layout.d.ts +27 -0
- package/dist/src/foundation/coordinates/layout.d.ts.map +1 -0
- package/dist/src/foundation/coordinates/layout.js +41 -0
- package/dist/src/foundation/coordinates/layout.js.map +1 -0
- package/dist/src/foundation/coordinates/repository.d.ts +16 -0
- package/dist/src/foundation/coordinates/repository.d.ts.map +1 -0
- package/dist/src/foundation/coordinates/repository.js +75 -0
- package/dist/src/foundation/coordinates/repository.js.map +1 -0
- package/dist/src/foundation/device-config/index.d.ts +2 -0
- package/dist/src/foundation/device-config/index.d.ts.map +1 -0
- package/dist/src/foundation/device-config/index.js +2 -0
- package/dist/src/foundation/device-config/index.js.map +1 -0
- package/dist/src/foundation/device-config/user-config.d.ts +19 -0
- package/dist/src/foundation/device-config/user-config.d.ts.map +1 -0
- package/dist/src/foundation/device-config/user-config.js +94 -0
- package/dist/src/foundation/device-config/user-config.js.map +1 -0
- package/dist/src/foundation/event-codec/grammar.d.ts +172 -0
- package/dist/src/foundation/event-codec/grammar.d.ts.map +1 -0
- package/dist/src/foundation/event-codec/grammar.js +383 -0
- package/dist/src/foundation/event-codec/grammar.js.map +1 -0
- package/dist/src/foundation/event-codec/index.d.ts +3 -0
- package/dist/src/foundation/event-codec/index.d.ts.map +1 -0
- package/dist/src/foundation/event-codec/index.js +2 -0
- package/dist/src/foundation/event-codec/index.js.map +1 -0
- package/dist/src/foundation/event-cursor/cursor.d.ts +40 -0
- package/dist/src/foundation/event-cursor/cursor.d.ts.map +1 -0
- package/dist/src/foundation/event-cursor/cursor.js +42 -0
- package/dist/src/foundation/event-cursor/cursor.js.map +1 -0
- package/dist/src/foundation/event-cursor/index.d.ts +2 -0
- package/dist/src/foundation/event-cursor/index.d.ts.map +1 -0
- package/dist/src/foundation/event-cursor/index.js +2 -0
- package/dist/src/foundation/event-cursor/index.js.map +1 -0
- package/dist/src/foundation/event-history/digest.d.ts +2 -0
- package/dist/src/foundation/event-history/digest.d.ts.map +1 -0
- package/dist/src/foundation/event-history/digest.js +2 -0
- package/dist/src/foundation/event-history/digest.js.map +1 -0
- package/dist/src/foundation/event-history/history.d.ts +86 -0
- package/dist/src/foundation/event-history/history.d.ts.map +1 -0
- package/dist/src/foundation/event-history/history.js +481 -0
- package/dist/src/foundation/event-history/history.js.map +1 -0
- package/dist/src/foundation/event-history/index.d.ts +3 -0
- package/dist/src/foundation/event-history/index.d.ts.map +1 -0
- package/dist/src/foundation/event-history/index.js +3 -0
- package/dist/src/foundation/event-history/index.js.map +1 -0
- package/dist/src/foundation/event-reducer/index.d.ts +2 -0
- package/dist/src/foundation/event-reducer/index.d.ts.map +1 -0
- package/dist/src/foundation/event-reducer/index.js +2 -0
- package/dist/src/foundation/event-reducer/index.js.map +1 -0
- package/dist/src/foundation/event-reducer/policy.d.ts +69 -0
- package/dist/src/foundation/event-reducer/policy.d.ts.map +1 -0
- package/dist/src/foundation/event-reducer/policy.js +138 -0
- package/dist/src/foundation/event-reducer/policy.js.map +1 -0
- package/dist/src/foundation/event-store/digest.d.ts +11 -0
- package/dist/src/foundation/event-store/digest.d.ts.map +1 -0
- package/dist/src/foundation/event-store/digest.js +38 -0
- package/dist/src/foundation/event-store/digest.js.map +1 -0
- package/dist/src/foundation/event-store/index.d.ts +3 -0
- package/dist/src/foundation/event-store/index.d.ts.map +1 -0
- package/dist/src/foundation/event-store/index.js +3 -0
- package/dist/src/foundation/event-store/index.js.map +1 -0
- package/dist/src/foundation/event-store/storage.d.ts +50 -0
- package/dist/src/foundation/event-store/storage.d.ts.map +1 -0
- package/dist/src/foundation/event-store/storage.js +109 -0
- package/dist/src/foundation/event-store/storage.js.map +1 -0
- package/dist/src/foundation/git/derived-cache.d.ts +5 -0
- package/dist/src/foundation/git/derived-cache.d.ts.map +1 -0
- package/dist/src/foundation/git/derived-cache.js +117 -0
- package/dist/src/foundation/git/derived-cache.js.map +1 -0
- package/dist/src/foundation/git/git.d.ts +100 -0
- package/dist/src/foundation/git/git.d.ts.map +1 -0
- package/dist/src/foundation/git/git.js +677 -0
- package/dist/src/foundation/git/git.js.map +1 -0
- package/dist/src/foundation/git/index.d.ts +3 -0
- package/dist/src/foundation/git/index.d.ts.map +1 -0
- package/dist/src/foundation/git/index.js +3 -0
- package/dist/src/foundation/git/index.js.map +1 -0
- package/dist/src/foundation/guidance/guidance.d.ts +36 -0
- package/dist/src/foundation/guidance/guidance.d.ts.map +1 -0
- package/dist/src/foundation/guidance/guidance.js +198 -0
- package/dist/src/foundation/guidance/guidance.js.map +1 -0
- package/dist/src/foundation/guidance/index.d.ts +3 -0
- package/dist/src/foundation/guidance/index.d.ts.map +1 -0
- package/dist/src/foundation/guidance/index.js +3 -0
- package/dist/src/foundation/guidance/index.js.map +1 -0
- package/dist/src/foundation/guidance/rules.d.ts +36 -0
- package/dist/src/foundation/guidance/rules.d.ts.map +1 -0
- package/dist/src/foundation/guidance/rules.js +65 -0
- package/dist/src/foundation/guidance/rules.js.map +1 -0
- package/dist/src/foundation/idea-model/index.d.ts +3 -0
- package/dist/src/foundation/idea-model/index.d.ts.map +1 -0
- package/dist/src/foundation/idea-model/index.js +3 -0
- package/dist/src/foundation/idea-model/index.js.map +1 -0
- package/dist/src/foundation/idea-model/status.d.ts +28 -0
- package/dist/src/foundation/idea-model/status.d.ts.map +1 -0
- package/dist/src/foundation/idea-model/status.js +192 -0
- package/dist/src/foundation/idea-model/status.js.map +1 -0
- package/dist/src/foundation/idea-model/ulid.d.ts +6 -0
- package/dist/src/foundation/idea-model/ulid.d.ts.map +1 -0
- package/dist/src/foundation/idea-model/ulid.js +16 -0
- package/dist/src/foundation/idea-model/ulid.js.map +1 -0
- package/dist/src/foundation/idea-query/index.d.ts +3 -0
- package/dist/src/foundation/idea-query/index.d.ts.map +1 -0
- package/dist/src/foundation/idea-query/index.js +3 -0
- package/dist/src/foundation/idea-query/index.js.map +1 -0
- package/dist/src/foundation/idea-query/query.d.ts +13 -0
- package/dist/src/foundation/idea-query/query.d.ts.map +1 -0
- package/dist/src/foundation/idea-query/query.js +17 -0
- package/dist/src/foundation/idea-query/query.js.map +1 -0
- package/dist/src/foundation/idea-query/rules.d.ts +55 -0
- package/dist/src/foundation/idea-query/rules.d.ts.map +1 -0
- package/dist/src/foundation/idea-query/rules.js +223 -0
- package/dist/src/foundation/idea-query/rules.js.map +1 -0
- package/dist/src/foundation/idea-template/index.d.ts +2 -0
- package/dist/src/foundation/idea-template/index.d.ts.map +1 -0
- package/dist/src/foundation/idea-template/index.js +2 -0
- package/dist/src/foundation/idea-template/index.js.map +1 -0
- package/dist/src/foundation/idea-template/templates.d.ts +21 -0
- package/dist/src/foundation/idea-template/templates.d.ts.map +1 -0
- package/dist/src/foundation/idea-template/templates.js +265 -0
- package/dist/src/foundation/idea-template/templates.js.map +1 -0
- package/dist/src/foundation/installation/device-readiness.d.ts +94 -0
- package/dist/src/foundation/installation/device-readiness.d.ts.map +1 -0
- package/dist/src/foundation/installation/device-readiness.js +274 -0
- package/dist/src/foundation/installation/device-readiness.js.map +1 -0
- package/dist/src/foundation/installation/index.d.ts +4 -0
- package/dist/src/foundation/installation/index.d.ts.map +1 -0
- package/dist/src/foundation/installation/index.js +4 -0
- package/dist/src/foundation/installation/index.js.map +1 -0
- package/dist/src/foundation/installation/installation.d.ts +25 -0
- package/dist/src/foundation/installation/installation.d.ts.map +1 -0
- package/dist/src/foundation/installation/installation.js +125 -0
- package/dist/src/foundation/installation/installation.js.map +1 -0
- package/dist/src/foundation/installation/rules.d.ts +12 -0
- package/dist/src/foundation/installation/rules.d.ts.map +1 -0
- package/dist/src/foundation/installation/rules.js +63 -0
- package/dist/src/foundation/installation/rules.js.map +1 -0
- package/dist/src/foundation/language/index.d.ts +3 -0
- package/dist/src/foundation/language/index.d.ts.map +1 -0
- package/dist/src/foundation/language/index.js +2 -0
- package/dist/src/foundation/language/index.js.map +1 -0
- package/dist/src/foundation/language/language.d.ts +36 -0
- package/dist/src/foundation/language/language.d.ts.map +1 -0
- package/dist/src/foundation/language/language.js +94 -0
- package/dist/src/foundation/language/language.js.map +1 -0
- package/dist/src/foundation/owned-write/index.d.ts +2 -0
- package/dist/src/foundation/owned-write/index.d.ts.map +1 -0
- package/dist/src/foundation/owned-write/index.js +2 -0
- package/dist/src/foundation/owned-write/index.js.map +1 -0
- package/dist/src/foundation/owned-write/writer.d.ts +86 -0
- package/dist/src/foundation/owned-write/writer.d.ts.map +1 -0
- package/dist/src/foundation/owned-write/writer.js +244 -0
- package/dist/src/foundation/owned-write/writer.js.map +1 -0
- package/dist/src/foundation/package-resource/index.d.ts +2 -0
- package/dist/src/foundation/package-resource/index.d.ts.map +1 -0
- package/dist/src/foundation/package-resource/index.js +2 -0
- package/dist/src/foundation/package-resource/index.js.map +1 -0
- package/dist/src/foundation/package-resource/npm-tarball.d.ts +15 -0
- package/dist/src/foundation/package-resource/npm-tarball.d.ts.map +1 -0
- package/dist/src/foundation/package-resource/npm-tarball.js +124 -0
- package/dist/src/foundation/package-resource/npm-tarball.js.map +1 -0
- package/dist/src/foundation/process/index.d.ts +3 -0
- package/dist/src/foundation/process/index.d.ts.map +1 -0
- package/dist/src/foundation/process/index.js +3 -0
- package/dist/src/foundation/process/index.js.map +1 -0
- package/dist/src/foundation/process/npm-command.d.ts +9 -0
- package/dist/src/foundation/process/npm-command.d.ts.map +1 -0
- package/dist/src/foundation/process/npm-command.js +11 -0
- package/dist/src/foundation/process/npm-command.js.map +1 -0
- package/dist/src/foundation/process/subprocess.d.ts +8 -0
- package/dist/src/foundation/process/subprocess.d.ts.map +1 -0
- package/dist/src/foundation/process/subprocess.js +12 -0
- package/dist/src/foundation/process/subprocess.js.map +1 -0
- package/dist/src/foundation/project-config/config.d.ts +30 -0
- package/dist/src/foundation/project-config/config.d.ts.map +1 -0
- package/dist/src/foundation/project-config/config.js +112 -0
- package/dist/src/foundation/project-config/config.js.map +1 -0
- package/dist/src/foundation/project-config/index.d.ts +3 -0
- package/dist/src/foundation/project-config/index.d.ts.map +1 -0
- package/dist/src/foundation/project-config/index.js +3 -0
- package/dist/src/foundation/project-config/index.js.map +1 -0
- package/dist/src/foundation/project-config/rules.d.ts +32 -0
- package/dist/src/foundation/project-config/rules.d.ts.map +1 -0
- package/dist/src/foundation/project-config/rules.js +119 -0
- package/dist/src/foundation/project-config/rules.js.map +1 -0
- package/dist/src/foundation/projection-cache/index.d.ts +2 -0
- package/dist/src/foundation/projection-cache/index.d.ts.map +1 -0
- package/dist/src/foundation/projection-cache/index.js +2 -0
- package/dist/src/foundation/projection-cache/index.js.map +1 -0
- package/dist/src/foundation/projection-cache/projection.d.ts +36 -0
- package/dist/src/foundation/projection-cache/projection.d.ts.map +1 -0
- package/dist/src/foundation/projection-cache/projection.js +105 -0
- package/dist/src/foundation/projection-cache/projection.js.map +1 -0
- package/dist/src/foundation/renderer/index.d.ts +3 -0
- package/dist/src/foundation/renderer/index.d.ts.map +1 -0
- package/dist/src/foundation/renderer/index.js +3 -0
- package/dist/src/foundation/renderer/index.js.map +1 -0
- package/dist/src/foundation/renderer/markdown.d.ts +7 -0
- package/dist/src/foundation/renderer/markdown.d.ts.map +1 -0
- package/dist/src/foundation/renderer/markdown.js +355 -0
- package/dist/src/foundation/renderer/markdown.js.map +1 -0
- package/dist/src/foundation/renderer/render.d.ts +6 -0
- package/dist/src/foundation/renderer/render.d.ts.map +1 -0
- package/dist/src/foundation/renderer/render.js +23 -0
- package/dist/src/foundation/renderer/render.js.map +1 -0
- package/dist/src/foundation/report/dialogue.d.ts +37 -0
- package/dist/src/foundation/report/dialogue.d.ts.map +1 -0
- package/dist/src/foundation/report/dialogue.js +59 -0
- package/dist/src/foundation/report/dialogue.js.map +1 -0
- package/dist/src/foundation/report/index.d.ts +6 -0
- package/dist/src/foundation/report/index.d.ts.map +1 -0
- package/dist/src/foundation/report/index.js +6 -0
- package/dist/src/foundation/report/index.js.map +1 -0
- package/dist/src/foundation/report/instructions.d.ts +77 -0
- package/dist/src/foundation/report/instructions.d.ts.map +1 -0
- package/dist/src/foundation/report/instructions.js +374 -0
- package/dist/src/foundation/report/instructions.js.map +1 -0
- package/dist/src/foundation/report/observation.d.ts +31 -0
- package/dist/src/foundation/report/observation.d.ts.map +1 -0
- package/dist/src/foundation/report/observation.js +83 -0
- package/dist/src/foundation/report/observation.js.map +1 -0
- package/dist/src/foundation/report/projection.d.ts +7 -0
- package/dist/src/foundation/report/projection.d.ts.map +1 -0
- package/dist/src/foundation/report/projection.js +199 -0
- package/dist/src/foundation/report/projection.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/contract.d.ts +148 -0
- package/dist/src/foundation/report/templates/whats-next/contract.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/contract.js +34 -0
- package/dist/src/foundation/report/templates/whats-next/contract.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/content-language.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/content-language.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/content-language.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/content-language.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/detached-head.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/event-history-invalid.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/head-missing.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.d.ts +12 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-metadata-unavailable.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/idea-not-found.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/index.d.ts +63 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/index.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/index.js +63 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/index.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.js +13 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-deploying.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.js +13 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-implementing.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.js +11 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-inactive.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.js +13 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/lifecycle-preparing.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.js +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/navigation-ready.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/phase-guidance-invalid.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/preparation-seed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ahead.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-ancestry-inspection-failed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-behind.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-diverged.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-fetch-failed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-history-incomplete.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.js +11 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/primary-upstream-mismatch.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/project-recheck.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/repository-recheck.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.d.ts +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation-instruction.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.js +39 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/review-presentation.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.d.ts +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-changes-step.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.d.ts +8 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflict-step.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-conflicts.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-inspection-failed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.js +12 -0
- package/dist/src/foundation/report/templates/whats-next/en-US/worktree-summary.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/index.d.ts +5 -0
- package/dist/src/foundation/report/templates/whats-next/index.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/index.js +4 -0
- package/dist/src/foundation/report/templates/whats-next/index.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/registry.d.ts +4 -0
- package/dist/src/foundation/report/templates/whats-next/registry.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/registry.js +14 -0
- package/dist/src/foundation/report/templates/whats-next/registry.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/renderers.d.ts +63 -0
- package/dist/src/foundation/report/templates/whats-next/renderers.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/renderers.js +176 -0
- package/dist/src/foundation/report/templates/whats-next/renderers.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/content-language.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/detached-head.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/event-history-invalid.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/head-missing.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.d.ts +12 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-metadata-unavailable.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/idea-not-found.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/index.d.ts +63 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/index.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/index.js +63 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/index.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.js +13 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-deploying.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.js +13 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-implementing.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.js +11 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-inactive.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.js +13 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/lifecycle-preparing.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.js +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/navigation-ready.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/phase-guidance-invalid.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/preparation-seed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ahead.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-ancestry-inspection-failed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-behind.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-diverged.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-fetch-failed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.js +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-history-incomplete.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.js +11 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/primary-upstream-mismatch.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/project-recheck.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/repository-recheck.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.d.ts +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation-instruction.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.js +39 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/review-presentation.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.d.ts +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-changes-step.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.d.ts +8 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.js +10 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflict-step.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-conflicts.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.js +5 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-inspection-failed.js.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.d.ts +9 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.d.ts.map +1 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.js +12 -0
- package/dist/src/foundation/report/templates/whats-next/zh-CN/worktree-summary.js.map +1 -0
- package/dist/src/foundation/report/types.d.ts +321 -0
- package/dist/src/foundation/report/types.d.ts.map +1 -0
- package/dist/src/foundation/report/types.js +2 -0
- package/dist/src/foundation/report/types.js.map +1 -0
- package/dist/src/foundation/scaffold-plan/index.d.ts +2 -0
- package/dist/src/foundation/scaffold-plan/index.d.ts.map +1 -0
- package/dist/src/foundation/scaffold-plan/index.js +2 -0
- package/dist/src/foundation/scaffold-plan/index.js.map +1 -0
- package/dist/src/foundation/scaffold-plan/scaffold-plan.d.ts +11 -0
- package/dist/src/foundation/scaffold-plan/scaffold-plan.d.ts.map +1 -0
- package/dist/src/foundation/scaffold-plan/scaffold-plan.js +36 -0
- package/dist/src/foundation/scaffold-plan/scaffold-plan.js.map +1 -0
- package/dist/src/foundation/schema/index.d.ts +3 -0
- package/dist/src/foundation/schema/index.d.ts.map +1 -0
- package/dist/src/foundation/schema/index.js +3 -0
- package/dist/src/foundation/schema/index.js.map +1 -0
- package/dist/src/foundation/schema/schema.d.ts +3 -0
- package/dist/src/foundation/schema/schema.d.ts.map +1 -0
- package/dist/src/foundation/schema/schema.js +10 -0
- package/dist/src/foundation/schema/schema.js.map +1 -0
- package/dist/src/foundation/schema/yaml.d.ts +10 -0
- package/dist/src/foundation/schema/yaml.d.ts.map +1 -0
- package/dist/src/foundation/schema/yaml.js +60 -0
- package/dist/src/foundation/schema/yaml.js.map +1 -0
- package/dist/src/foundation/schema-capability/index.d.ts +6 -0
- package/dist/src/foundation/schema-capability/index.d.ts.map +1 -0
- package/dist/src/foundation/schema-capability/index.js +4 -0
- package/dist/src/foundation/schema-capability/index.js.map +1 -0
- package/dist/src/foundation/schema-capability/inspection.d.ts +38 -0
- package/dist/src/foundation/schema-capability/inspection.d.ts.map +1 -0
- package/dist/src/foundation/schema-capability/inspection.js +249 -0
- package/dist/src/foundation/schema-capability/inspection.js.map +1 -0
- package/dist/src/foundation/schema-capability/manifest.d.ts +6 -0
- package/dist/src/foundation/schema-capability/manifest.d.ts.map +1 -0
- package/dist/src/foundation/schema-capability/manifest.js +17 -0
- package/dist/src/foundation/schema-capability/manifest.js.map +1 -0
- package/dist/src/foundation/schema-capability/rules.d.ts +38 -0
- package/dist/src/foundation/schema-capability/rules.d.ts.map +1 -0
- package/dist/src/foundation/schema-capability/rules.js +297 -0
- package/dist/src/foundation/schema-capability/rules.js.map +1 -0
- package/dist/src/foundation/skill-registration/adoption.d.ts +40 -0
- package/dist/src/foundation/skill-registration/adoption.d.ts.map +1 -0
- package/dist/src/foundation/skill-registration/adoption.js +63 -0
- package/dist/src/foundation/skill-registration/adoption.js.map +1 -0
- package/dist/src/foundation/skill-registration/index.d.ts +2 -0
- package/dist/src/foundation/skill-registration/index.d.ts.map +1 -0
- package/dist/src/foundation/skill-registration/index.js +2 -0
- package/dist/src/foundation/skill-registration/index.js.map +1 -0
- package/dist/src/foundation/skill-registration/rules.d.ts +2 -0
- package/dist/src/foundation/skill-registration/rules.d.ts.map +1 -0
- package/dist/src/foundation/skill-registration/rules.js +2 -0
- package/dist/src/foundation/skill-registration/rules.js.map +1 -0
- package/dist/src/foundation/snapshot/git-snapshot.d.ts +40 -0
- package/dist/src/foundation/snapshot/git-snapshot.d.ts.map +1 -0
- package/dist/src/foundation/snapshot/git-snapshot.js +168 -0
- package/dist/src/foundation/snapshot/git-snapshot.js.map +1 -0
- package/dist/src/foundation/snapshot/index.d.ts +2 -0
- package/dist/src/foundation/snapshot/index.d.ts.map +1 -0
- package/dist/src/foundation/snapshot/index.js +2 -0
- package/dist/src/foundation/snapshot/index.js.map +1 -0
- package/dist/src/foundation/state-transaction/index.d.ts +2 -0
- package/dist/src/foundation/state-transaction/index.d.ts.map +1 -0
- package/dist/src/foundation/state-transaction/index.js +2 -0
- package/dist/src/foundation/state-transaction/index.js.map +1 -0
- package/dist/src/foundation/state-transaction/state-transaction.d.ts +48 -0
- package/dist/src/foundation/state-transaction/state-transaction.d.ts.map +1 -0
- package/dist/src/foundation/state-transaction/state-transaction.js +364 -0
- package/dist/src/foundation/state-transaction/state-transaction.js.map +1 -0
- package/dist/src/foundation/terminal/index.d.ts +2 -0
- package/dist/src/foundation/terminal/index.d.ts.map +1 -0
- package/dist/src/foundation/terminal/index.js +2 -0
- package/dist/src/foundation/terminal/index.js.map +1 -0
- package/dist/src/foundation/terminal/terminal.d.ts +17 -0
- package/dist/src/foundation/terminal/terminal.d.ts.map +1 -0
- package/dist/src/foundation/terminal/terminal.js +12 -0
- package/dist/src/foundation/terminal/terminal.js.map +1 -0
- package/dist/src/foundation/trace/index.d.ts +2 -0
- package/dist/src/foundation/trace/index.d.ts.map +1 -0
- package/dist/src/foundation/trace/index.js +2 -0
- package/dist/src/foundation/trace/index.js.map +1 -0
- package/dist/src/foundation/trace/trace.d.ts +12 -0
- package/dist/src/foundation/trace/trace.d.ts.map +1 -0
- package/dist/src/foundation/trace/trace.js +299 -0
- package/dist/src/foundation/trace/trace.js.map +1 -0
- package/dist/src/foundation/tui/index.d.ts +3 -0
- package/dist/src/foundation/tui/index.d.ts.map +1 -0
- package/dist/src/foundation/tui/index.js +3 -0
- package/dist/src/foundation/tui/index.js.map +1 -0
- package/dist/src/foundation/tui/table.d.ts +10 -0
- package/dist/src/foundation/tui/table.d.ts.map +1 -0
- package/dist/src/foundation/tui/table.js +91 -0
- package/dist/src/foundation/tui/table.js.map +1 -0
- package/dist/src/foundation/tui/tui.d.ts +33 -0
- package/dist/src/foundation/tui/tui.d.ts.map +1 -0
- package/dist/src/foundation/tui/tui.js +157 -0
- package/dist/src/foundation/tui/tui.js.map +1 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +16 -0
- package/dist/src/index.js.map +1 -0
- package/docs/core-concepts.md +48 -7
- package/docs/getting-started.md +60 -45
- package/docs/maintaining.md +132 -9
- package/docs/npm-package-releases.md +38 -9
- package/docs/operations.md +109 -35
- package/docs/reference.md +304 -35
- package/docs/repository-tasks.md +61 -20
- package/package.json +53 -27
- package/schema/capabilities.json +95 -0
- package/schema/capability-manifest.schema.json +139 -0
- package/schema/v1/command-report.schema.json +4 -2
- package/schema/v1/domain-message.schema.json +2 -1
- package/schema/v2/config.schema.json +14 -0
- package/schema/v2/idea-event.schema.json +121 -0
- package/skills/silvermoon/SKILL.md +204 -112
- package/skills/silvermoon/references/adoption.md +55 -24
- package/skills/silvermoon/references/events.md +296 -0
- package/bin/silvermoon.js +0 -10
- package/src/adoption.js +0 -559
- package/src/cli.js +0 -377
- package/src/config.js +0 -253
- package/src/create-idea.js +0 -497
- package/src/dialogue.js +0 -69
- package/src/domain.js +0 -592
- package/src/git-snapshot.js +0 -212
- package/src/git.js +0 -624
- package/src/guidance.js +0 -281
- package/src/idea-layout.js +0 -411
- package/src/idea-metadata.js +0 -48
- package/src/idea-query.js +0 -230
- package/src/idea-templates.js +0 -242
- package/src/ideas.js +0 -142
- package/src/index.js +0 -386
- package/src/language.js +0 -78
- package/src/layout.js +0 -38
- package/src/list-ideas.js +0 -196
- package/src/observation.js +0 -370
- package/src/repository.js +0 -82
- package/src/response.js +0 -492
- package/src/subprocess.js +0 -27
- package/src/trace.js +0 -292
- package/src/tui-table.js +0 -71
- package/src/tui.js +0 -205
- package/src/user-config.js +0 -135
- package/src/whatsnext.js +0 -726
- package/src/yaml.js +0 -66
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { gitContentDigest, snapshotEventFileHead, validateEventRecordSizes, } from "../event-store/index.js";
|
|
2
|
+
import { parseIdeaEvents } from "../event-codec/index.js";
|
|
3
|
+
export async function readEventDelta(root, paths, options, filesystem, cursor) {
|
|
4
|
+
if (!Number.isSafeInteger(cursor?.length) || cursor.length < 0
|
|
5
|
+
|| !new RegExp(`^[0-9a-f]{${options.objectIdLength}}$`).test(cursor.digest ?? "")) {
|
|
6
|
+
throw new Error("Incremental replay requires an exact prior length and file digest.");
|
|
7
|
+
}
|
|
8
|
+
const head = await snapshotEventFileHead(root, paths, options, filesystem);
|
|
9
|
+
const bytes = await filesystem.snapshotFile(paths.eventsPath);
|
|
10
|
+
validateEventRecordSizes(bytes);
|
|
11
|
+
if (cursor.length > bytes.length) {
|
|
12
|
+
throw new Error("Stale cursor length; reobserve without replaying the old intent.");
|
|
13
|
+
}
|
|
14
|
+
const prefix = bytes.subarray(0, cursor.length);
|
|
15
|
+
let prefixEvents;
|
|
16
|
+
try {
|
|
17
|
+
prefixEvents = parseIdeaEvents(prefix, options);
|
|
18
|
+
}
|
|
19
|
+
catch (cause) {
|
|
20
|
+
throw new Error("Cursor length is not an event boundary.", { cause });
|
|
21
|
+
}
|
|
22
|
+
const prefixDigest = gitContentDigest("blob", prefix, options);
|
|
23
|
+
if (prefixDigest !== cursor.digest) {
|
|
24
|
+
throw new Error("Stale cursor digest; historical content changed. Reobserve before deciding a new intent.");
|
|
25
|
+
}
|
|
26
|
+
const events = parseIdeaEvents(bytes.subarray(cursor.length), options);
|
|
27
|
+
for (const [index, event] of [...prefixEvents, ...events].entries()) {
|
|
28
|
+
if (event.sequence !== index + 1) {
|
|
29
|
+
throw new Error(`Event sequence is not continuous at record ${index + 1}.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const cursorSequence = prefixEvents.at(-1)?.sequence ?? 0;
|
|
33
|
+
return {
|
|
34
|
+
outcome: "delta-observed",
|
|
35
|
+
length: bytes.length,
|
|
36
|
+
digest: head,
|
|
37
|
+
after: { length: cursor.length, digest: cursor.digest },
|
|
38
|
+
events,
|
|
39
|
+
sequence: events.at(-1)?.sequence ?? cursorSequence,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../src/foundation/event-cursor/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAuB1D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAY,EACZ,KAA6B,EAC7B,OAAqD,EACrD,UAA8B,EAC9B,MAA0C;IAE1C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;WACzD,CAAC,IAAI,MAAM,CAAC,aAAa,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;QACpF,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC9D,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,YAAgD,CAAC;IACrD,IAAI,CAAC;QACH,YAAY,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,yCAAyC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,YAAY,GAAG,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/D,IAAI,YAAY,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IACvE,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACpE,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,8CAA8C,KAAK,GAAG,CAAC,GAAG,CAC3D,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,cAAc,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,CAAC,CAAC;IAC1D,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QACvD,MAAM;QACN,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,cAAc;KACpD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/foundation/event-cursor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GACf,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/foundation/event-cursor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,GACf,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../../../src/foundation/event-history/digest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.js","sourceRoot":"","sources":["../../../../src/foundation/event-history/digest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const SOURCE_REPOSITORY = "https://github.com/shazhou-ww/silvermoon.git";
|
|
2
|
+
type EventFormat = "legacy" | "final";
|
|
3
|
+
interface ProjectConfig {
|
|
4
|
+
version: 1 | 2;
|
|
5
|
+
primaryRepository: string;
|
|
6
|
+
primaryBranch: string;
|
|
7
|
+
}
|
|
8
|
+
export interface HistoryBaseline {
|
|
9
|
+
commit: string;
|
|
10
|
+
source: string;
|
|
11
|
+
ref: string | null;
|
|
12
|
+
}
|
|
13
|
+
interface InspectHistoryOptions {
|
|
14
|
+
root: string;
|
|
15
|
+
tree: string;
|
|
16
|
+
config: ProjectConfig;
|
|
17
|
+
commit?: string;
|
|
18
|
+
primary?: string;
|
|
19
|
+
overrides?: ReadonlyMap<string, Buffer>;
|
|
20
|
+
}
|
|
21
|
+
export declare function localPrimary(root: string, config: ProjectConfig): HistoryBaseline;
|
|
22
|
+
export declare function detectEventFormat({ root, tree, overrides, }: Pick<InspectHistoryOptions, "root" | "tree" | "overrides">): Promise<EventFormat>;
|
|
23
|
+
export declare function inspectEventHistory(options: InspectHistoryOptions): Promise<{
|
|
24
|
+
results: ({
|
|
25
|
+
id: string;
|
|
26
|
+
mode: string;
|
|
27
|
+
candidate: {
|
|
28
|
+
ok: true;
|
|
29
|
+
state: import("../event-codec/grammar.ts").IdeaEventState;
|
|
30
|
+
};
|
|
31
|
+
} | {
|
|
32
|
+
ok: unknown;
|
|
33
|
+
mode: unknown;
|
|
34
|
+
id: string;
|
|
35
|
+
candidate?: never;
|
|
36
|
+
})[];
|
|
37
|
+
parent?: string | null;
|
|
38
|
+
valid: boolean;
|
|
39
|
+
baseline: HistoryBaseline;
|
|
40
|
+
target: string;
|
|
41
|
+
}>;
|
|
42
|
+
export declare function inspectProjectedEventHistory({ root, tree, primary, }: {
|
|
43
|
+
root: string;
|
|
44
|
+
tree: string;
|
|
45
|
+
primary: string;
|
|
46
|
+
}): Promise<{
|
|
47
|
+
supported: boolean;
|
|
48
|
+
reason: string;
|
|
49
|
+
id?: never;
|
|
50
|
+
reduction?: never;
|
|
51
|
+
valid?: never;
|
|
52
|
+
detail?: never;
|
|
53
|
+
target?: never;
|
|
54
|
+
baseline?: never;
|
|
55
|
+
results?: never;
|
|
56
|
+
} | {
|
|
57
|
+
supported: boolean;
|
|
58
|
+
reason: string;
|
|
59
|
+
id: string;
|
|
60
|
+
reduction: {
|
|
61
|
+
ok: false;
|
|
62
|
+
code: string;
|
|
63
|
+
sequence: number;
|
|
64
|
+
} | undefined;
|
|
65
|
+
valid?: never;
|
|
66
|
+
detail?: never;
|
|
67
|
+
target?: never;
|
|
68
|
+
baseline?: never;
|
|
69
|
+
results?: never;
|
|
70
|
+
} | {
|
|
71
|
+
supported: boolean;
|
|
72
|
+
valid: boolean;
|
|
73
|
+
detail: string;
|
|
74
|
+
target: string;
|
|
75
|
+
baseline: {
|
|
76
|
+
commit: string;
|
|
77
|
+
source: string;
|
|
78
|
+
ref: null;
|
|
79
|
+
};
|
|
80
|
+
results: Record<string, unknown>[];
|
|
81
|
+
reason?: never;
|
|
82
|
+
id?: never;
|
|
83
|
+
reduction?: never;
|
|
84
|
+
}>;
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/foundation/event-history/history.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AAEhF,KAAK,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtC,UAAU,aAAa;IACrB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AA0BD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAgED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,eAAe,CAkBjF;AAyFD,wBAAsB,iBAAiB,CAAC,EACtC,IAAI,EACJ,IAAI,EACJ,SAAS,GACV,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,wBAY5D;AA8LD,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;GAUvE;AA2DD,wBAAsB,4BAA4B,CAAC,EACjD,IAAI,EACJ,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EA"}
|
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
import { loadConfigSnapshot } from "../project-config/index.js";
|
|
3
|
+
import { EVENT_RENAMES, checkEventChange, eventsFromStatus, parseIdeaEvents, renameLegacyEvents, replayIdeaEvents, serializeIdeaEvents, } from "../event-codec/index.js";
|
|
4
|
+
import { isValidUlid, parseIdeaStatus } from "../idea-model/index.js";
|
|
5
|
+
import { inspectTreeLineage, readGitBlob, readGitBlobs, resolveCommit, runGit, } from "../git/index.js";
|
|
6
|
+
import { CONFIG_PATH, IDEAS_ROOT, ideaPaths } from "../coordinates/index.js";
|
|
7
|
+
import { snapshotEventPrefix, validateEventRecordSizes } from "../event-store/index.js";
|
|
8
|
+
import { createGitSnapshotFileSystem } from "../snapshot/index.js";
|
|
9
|
+
import { projectEventSnapshot, ProjectedReductionError } from "../projection-cache/index.js";
|
|
10
|
+
export const SOURCE_REPOSITORY = "https://github.com/shazhou-ww/silvermoon.git";
|
|
11
|
+
function errorMessage(error) {
|
|
12
|
+
return error instanceof Error ? error.message : String(error);
|
|
13
|
+
}
|
|
14
|
+
function requireBuffer(value, label) {
|
|
15
|
+
if (!Buffer.isBuffer(value))
|
|
16
|
+
throw new TypeError(`${label} must provide raw bytes.`);
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
function requireTreeEntries(value) {
|
|
20
|
+
if (!Array.isArray(value))
|
|
21
|
+
throw new TypeError("Git tree inspection must return entries.");
|
|
22
|
+
return value.map((entry) => {
|
|
23
|
+
if (entry === null || typeof entry !== "object"
|
|
24
|
+
|| !("mode" in entry) || typeof entry.mode !== "string"
|
|
25
|
+
|| !("type" in entry) || typeof entry.type !== "string"
|
|
26
|
+
|| !("object" in entry) || typeof entry.object !== "string"
|
|
27
|
+
|| !("name" in entry) || typeof entry.name !== "string"
|
|
28
|
+
|| !("size" in entry)
|
|
29
|
+
|| (entry.size !== null && typeof entry.size !== "number")) {
|
|
30
|
+
throw new TypeError("Git tree inspection returned an invalid entry.");
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
mode: entry.mode,
|
|
34
|
+
type: entry.type,
|
|
35
|
+
object: entry.object,
|
|
36
|
+
size: entry.size,
|
|
37
|
+
name: entry.name,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function treeEntries(root, tree, path) {
|
|
42
|
+
return requireTreeEntries(inspectTreeLineage(root, tree, path));
|
|
43
|
+
}
|
|
44
|
+
function parsedEventType(bytes, id) {
|
|
45
|
+
let first;
|
|
46
|
+
try {
|
|
47
|
+
first = JSON.parse(bytes.toString("utf8").split("\n", 1)[0] ?? "");
|
|
48
|
+
}
|
|
49
|
+
catch (cause) {
|
|
50
|
+
throw new Error(`${id}: cannot identify historical event format: ${errorMessage(cause)}`, { cause });
|
|
51
|
+
}
|
|
52
|
+
if (first === null || typeof first !== "object"
|
|
53
|
+
|| !("type" in first) || typeof first.type !== "string") {
|
|
54
|
+
throw new Error(`${id}: cannot identify historical event format: first event type is invalid`);
|
|
55
|
+
}
|
|
56
|
+
return first.type;
|
|
57
|
+
}
|
|
58
|
+
function git(root, args) {
|
|
59
|
+
const result = runGit(root, args);
|
|
60
|
+
if (!result.ok)
|
|
61
|
+
throw new Error(`Event history unavailable: ${result.stderr}`);
|
|
62
|
+
return result.stdout;
|
|
63
|
+
}
|
|
64
|
+
export function localPrimary(root, config) {
|
|
65
|
+
const refs = [];
|
|
66
|
+
for (const remote of git(root, ["remote"]).split("\n").filter(Boolean)) {
|
|
67
|
+
const url = git(root, ["config", "--get", `remote.${remote}.url`]);
|
|
68
|
+
if (url !== config.primaryRepository)
|
|
69
|
+
continue;
|
|
70
|
+
const ref = `refs/remotes/${remote}/${config.primaryBranch}`;
|
|
71
|
+
const result = runGit(root, ["rev-parse", "--verify", `${ref}^{commit}`]);
|
|
72
|
+
if (result.ok)
|
|
73
|
+
refs.push({ ref, commit: result.stdout });
|
|
74
|
+
}
|
|
75
|
+
if (!refs.length) {
|
|
76
|
+
throw new Error("Primary tracking ref unavailable; fetch the configured primary into its named remote.");
|
|
77
|
+
}
|
|
78
|
+
if (new Set(refs.map(({ commit }) => commit)).size !== 1) {
|
|
79
|
+
throw new Error("Primary tracking refs disagree; refresh them before checking.");
|
|
80
|
+
}
|
|
81
|
+
const first = refs[0];
|
|
82
|
+
if (!first)
|
|
83
|
+
throw new Error("Primary tracking ref unavailable.");
|
|
84
|
+
return { ...first, source: "local-tracking-ref-not-fetched" };
|
|
85
|
+
}
|
|
86
|
+
async function snapshot(root, tree, overrides, commit, blobs) {
|
|
87
|
+
const configEntry = treeEntries(root, tree, CONFIG_PATH)
|
|
88
|
+
.find(({ name }) => name === CONFIG_PATH);
|
|
89
|
+
const entries = treeEntries(root, tree, IDEAS_ROOT);
|
|
90
|
+
const stateBlobs = blobs ?? new Map();
|
|
91
|
+
if (!configEntry) {
|
|
92
|
+
if (entries.length)
|
|
93
|
+
throw new Error("Historical ideas exist without project configuration.");
|
|
94
|
+
return {
|
|
95
|
+
version: null,
|
|
96
|
+
entries,
|
|
97
|
+
ids: [],
|
|
98
|
+
sourceProject: false,
|
|
99
|
+
overrides,
|
|
100
|
+
commit,
|
|
101
|
+
blobs: stateBlobs,
|
|
102
|
+
format: null,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const loaded = await loadConfigSnapshot({ gitRoot: root, tree });
|
|
106
|
+
if (!loaded.config) {
|
|
107
|
+
throw new Error(`Invalid historical configuration: ${loaded.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
|
|
108
|
+
}
|
|
109
|
+
if (loaded.config.version !== 1 && loaded.config.version !== 2) {
|
|
110
|
+
throw new Error("Invalid historical configuration version.");
|
|
111
|
+
}
|
|
112
|
+
const config = loaded.config;
|
|
113
|
+
const ids = entries
|
|
114
|
+
.filter(({ type, name }) => type === "tree" && name.split("/").length === 3)
|
|
115
|
+
.map(({ name }) => name.split("/")[2])
|
|
116
|
+
.filter((id) => id !== undefined);
|
|
117
|
+
if (ids.some((id) => !isValidUlid(id))) {
|
|
118
|
+
throw new Error("Historical idea identity is invalid.");
|
|
119
|
+
}
|
|
120
|
+
const sourceProject = config.primaryRepository === SOURCE_REPOSITORY;
|
|
121
|
+
const stateFile = config.version === 2 ? "events.jsonl" : "status.yaml";
|
|
122
|
+
const stateObjects = entries
|
|
123
|
+
.filter(({ name, object, type }) => type === "blob"
|
|
124
|
+
&& name.endsWith(`/${stateFile}`)
|
|
125
|
+
&& !overrides?.has(name)
|
|
126
|
+
&& !stateBlobs.has(object))
|
|
127
|
+
.map(({ object }) => object);
|
|
128
|
+
for (const [object, contents] of readGitBlobs(root, stateObjects)) {
|
|
129
|
+
if (typeof object !== "string")
|
|
130
|
+
throw new TypeError("Git batch returned an invalid object ID.");
|
|
131
|
+
stateBlobs.set(object, requireBuffer(contents, `Git object ${object}`));
|
|
132
|
+
}
|
|
133
|
+
const state = {
|
|
134
|
+
version: config.version,
|
|
135
|
+
entries,
|
|
136
|
+
ids,
|
|
137
|
+
sourceProject,
|
|
138
|
+
overrides,
|
|
139
|
+
commit,
|
|
140
|
+
blobs: stateBlobs,
|
|
141
|
+
format: null,
|
|
142
|
+
};
|
|
143
|
+
if (state.version !== 2)
|
|
144
|
+
return state;
|
|
145
|
+
const formats = new Set();
|
|
146
|
+
for (const id of ids) {
|
|
147
|
+
const bytes = source(root, state, id, "events.jsonl");
|
|
148
|
+
if (!bytes.length)
|
|
149
|
+
continue;
|
|
150
|
+
const format = Object.hasOwn(EVENT_RENAMES, parsedEventType(bytes, id))
|
|
151
|
+
? "legacy"
|
|
152
|
+
: "final";
|
|
153
|
+
if (format === "legacy" && !sourceProject) {
|
|
154
|
+
throw new Error(`${id}: legacy dotted event history is only supported in the Silvermoon source repository`);
|
|
155
|
+
}
|
|
156
|
+
parseIdeaEvents(bytes, { legacy: format === "legacy", objectIdLength: tree.length });
|
|
157
|
+
formats.add(format);
|
|
158
|
+
}
|
|
159
|
+
if (formats.size > 1) {
|
|
160
|
+
throw new Error("Mixed legacy and final idea logs in one snapshot; migrate every idea together.");
|
|
161
|
+
}
|
|
162
|
+
state.format = formats.values().next().value ?? null;
|
|
163
|
+
return state;
|
|
164
|
+
}
|
|
165
|
+
export async function detectEventFormat({ root, tree, overrides, }) {
|
|
166
|
+
const state = await snapshot(root, tree, overrides);
|
|
167
|
+
if (state.format)
|
|
168
|
+
return state.format;
|
|
169
|
+
if (!state.sourceProject || state.version !== 2)
|
|
170
|
+
return "final";
|
|
171
|
+
let commit = resolveCommit(root, "HEAD");
|
|
172
|
+
while (commit) {
|
|
173
|
+
const previous = await snapshot(root, commit);
|
|
174
|
+
if (previous.version !== 2)
|
|
175
|
+
break;
|
|
176
|
+
if (previous.format)
|
|
177
|
+
return previous.format;
|
|
178
|
+
commit = firstParent(root, commit);
|
|
179
|
+
}
|
|
180
|
+
return "legacy";
|
|
181
|
+
}
|
|
182
|
+
function source(root, state, id, name) {
|
|
183
|
+
const paths = ideaPaths(id);
|
|
184
|
+
const path = `${paths.ideaPath}/${name}`;
|
|
185
|
+
const override = state.overrides?.get(path);
|
|
186
|
+
if (override !== undefined) {
|
|
187
|
+
const bytes = requireBuffer(override, `Historical override ${path}`);
|
|
188
|
+
if (name === "events.jsonl")
|
|
189
|
+
validateEventRecordSizes(bytes);
|
|
190
|
+
return bytes;
|
|
191
|
+
}
|
|
192
|
+
const entry = state.entries.find(({ name: entryName }) => entryName === path);
|
|
193
|
+
if (!entry || entry.type !== "blob" || !["100644", "100755"].includes(entry.mode)) {
|
|
194
|
+
throw new Error(`Historical state file missing or irregular: ${path}`);
|
|
195
|
+
}
|
|
196
|
+
const cached = state.blobs.get(entry.object);
|
|
197
|
+
if (cached !== undefined) {
|
|
198
|
+
if (name === "events.jsonl")
|
|
199
|
+
validateEventRecordSizes(cached);
|
|
200
|
+
return cached;
|
|
201
|
+
}
|
|
202
|
+
const bytes = requireBuffer(readGitBlob(root, entry.object), `Git object ${entry.object}`);
|
|
203
|
+
state.blobs.set(entry.object, bytes);
|
|
204
|
+
if (name === "events.jsonl")
|
|
205
|
+
validateEventRecordSizes(bytes);
|
|
206
|
+
return bytes;
|
|
207
|
+
}
|
|
208
|
+
function reductionFailure(result) {
|
|
209
|
+
return {
|
|
210
|
+
code: "code" in result ? result.code : "missing-code",
|
|
211
|
+
sequence: "sequence" in result ? result.sequence : "unknown",
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function transition(root, base, candidate, id, options) {
|
|
215
|
+
const next = source(root, candidate, id, "events.jsonl");
|
|
216
|
+
const candidateOptions = { ...options, legacy: candidate.format === "legacy" };
|
|
217
|
+
if (!base.ids.includes(id)) {
|
|
218
|
+
const result = replayIdeaEvents(id, parseIdeaEvents(next, candidateOptions), candidateOptions);
|
|
219
|
+
if (!result.ok || !("state" in result)) {
|
|
220
|
+
const failure = reductionFailure(result);
|
|
221
|
+
throw new Error(`${id}: candidate ${String(failure.code)} at ${String(failure.sequence)}`);
|
|
222
|
+
}
|
|
223
|
+
return { id, mode: "initialization", candidate: result };
|
|
224
|
+
}
|
|
225
|
+
if (base.version === 1) {
|
|
226
|
+
const legacy = parseIdeaStatus(source(root, base, id, "status.yaml").toString("utf8"), options);
|
|
227
|
+
const result = replayIdeaEvents(id, parseIdeaEvents(next, candidateOptions), candidateOptions);
|
|
228
|
+
const { version: _version, ...facts } = legacy;
|
|
229
|
+
const migrationEvents = Reflect.apply(eventsFromStatus, undefined, [legacy, candidateOptions]);
|
|
230
|
+
if (!Array.isArray(migrationEvents)) {
|
|
231
|
+
throw new TypeError("Status migration did not produce an event list.");
|
|
232
|
+
}
|
|
233
|
+
if (legacy.id !== id || !result.ok || !("state" in result)
|
|
234
|
+
|| !isDeepStrictEqual(facts, result.state.status)
|
|
235
|
+
|| (!candidateOptions.legacy
|
|
236
|
+
&& !isDeepStrictEqual(result.state.interaction, { messages: [] }))
|
|
237
|
+
|| !next.equals(Buffer.from(serializeIdeaEvents(migrationEvents, candidateOptions)))) {
|
|
238
|
+
throw new Error(`${id}: migration must preserve every primary v1 fact exactly`);
|
|
239
|
+
}
|
|
240
|
+
return { id, mode: "migration", candidate: result };
|
|
241
|
+
}
|
|
242
|
+
const previous = source(root, base, id, "events.jsonl");
|
|
243
|
+
if (base.format === "legacy" && candidate.format === "final") {
|
|
244
|
+
if (base.ids.length !== candidate.ids.length) {
|
|
245
|
+
throw new Error("Legacy event migration must convert every existing idea without changing inventory.");
|
|
246
|
+
}
|
|
247
|
+
const legacyOptions = { ...options, legacy: true };
|
|
248
|
+
const oldEvents = parseIdeaEvents(previous, legacyOptions);
|
|
249
|
+
const old = replayIdeaEvents(id, oldEvents, legacyOptions);
|
|
250
|
+
if (!old.ok || !("state" in old)) {
|
|
251
|
+
const failure = reductionFailure(old);
|
|
252
|
+
throw new Error(`${id}: cannot migrate invalid legacy event ${String(failure.sequence)}: ${String(failure.code)}`);
|
|
253
|
+
}
|
|
254
|
+
const newEvents = parseIdeaEvents(next, candidateOptions);
|
|
255
|
+
if (!isDeepStrictEqual(newEvents, renameLegacyEvents(oldEvents))) {
|
|
256
|
+
throw new Error(`${id}: internal migration must preserve every legacy record, sequence and payload with only the exact type rename`);
|
|
257
|
+
}
|
|
258
|
+
const result = replayIdeaEvents(id, newEvents, candidateOptions);
|
|
259
|
+
if (!result.ok || !("state" in result) || !isDeepStrictEqual({ status: result.state.status, sequence: result.state.sequence }, old.state) || !isDeepStrictEqual(result.state.interaction, { messages: [] })) {
|
|
260
|
+
throw new Error(`${id}: internal migration changes historical facts or contains an invalid abandoned window`);
|
|
261
|
+
}
|
|
262
|
+
return { id, mode: "migration-final", candidate: result };
|
|
263
|
+
}
|
|
264
|
+
if (base.format === "final" && candidate.format === "legacy") {
|
|
265
|
+
throw new Error(`${id}: final event history cannot return to legacy dotted events`);
|
|
266
|
+
}
|
|
267
|
+
const checked = Reflect.apply(checkEventChange, undefined, [
|
|
268
|
+
id,
|
|
269
|
+
previous,
|
|
270
|
+
next,
|
|
271
|
+
{ ...options, legacy: (candidate.format ?? base.format) === "legacy" },
|
|
272
|
+
]);
|
|
273
|
+
if (checked === null || typeof checked !== "object"
|
|
274
|
+
|| !("ok" in checked) || typeof checked.ok !== "boolean"
|
|
275
|
+
|| !("mode" in checked) || typeof checked.mode !== "string") {
|
|
276
|
+
throw new TypeError("Event change inspection returned an invalid result.");
|
|
277
|
+
}
|
|
278
|
+
if (base.sourceProject && base.format === "final" && checked.mode === "repair"
|
|
279
|
+
&& hasLegacyAncestor(root, base.commit ?? null)) {
|
|
280
|
+
throw new Error(`${id}: final event history must remain append-only after the migration boundary`);
|
|
281
|
+
}
|
|
282
|
+
if (!checked.ok) {
|
|
283
|
+
const failure = reductionFailure(checked);
|
|
284
|
+
throw Object.assign(new Error(`${id}: ${String(failure.code)} (${checked.mode})`), { eventCheck: { id, ...checked } });
|
|
285
|
+
}
|
|
286
|
+
return { id, ...checked };
|
|
287
|
+
}
|
|
288
|
+
function noDeletion(base, candidate) {
|
|
289
|
+
for (const id of base.ids) {
|
|
290
|
+
if (!candidate.ids.includes(id)) {
|
|
291
|
+
throw new Error(`${id}: removing an integrated idea is not an event repair`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (base.version !== null && candidate.version !== null
|
|
295
|
+
&& base.version >= 2 && candidate.version < base.version) {
|
|
296
|
+
throw new Error("An event project cannot be downgraded to an earlier version.");
|
|
297
|
+
}
|
|
298
|
+
if (base.format === "legacy" && candidate.format === "final"
|
|
299
|
+
&& (base.ids.length !== candidate.ids.length
|
|
300
|
+
|| base.ids.some((id) => !candidate.ids.includes(id)))) {
|
|
301
|
+
throw new Error("Legacy event migration must convert every existing idea without changing inventory.");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function firstParent(root, commit) {
|
|
305
|
+
const body = git(root, ["cat-file", "-p", commit]);
|
|
306
|
+
return /^parent ([0-9a-f]+)$/m.exec(body.split("\n\n")[0] ?? "")?.[1] ?? null;
|
|
307
|
+
}
|
|
308
|
+
function hasLegacyAncestor(root, initialCommit) {
|
|
309
|
+
let commit = initialCommit;
|
|
310
|
+
while (commit) {
|
|
311
|
+
const state = snapshotFormat(root, commit);
|
|
312
|
+
if (state === "legacy")
|
|
313
|
+
return true;
|
|
314
|
+
if (state !== "final")
|
|
315
|
+
return false;
|
|
316
|
+
commit = firstParent(root, commit);
|
|
317
|
+
}
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
function snapshotFormat(root, commit) {
|
|
321
|
+
const entries = treeEntries(root, commit, IDEAS_ROOT);
|
|
322
|
+
for (const { name, type, object } of entries) {
|
|
323
|
+
if (type !== "blob" || !name.endsWith("/events.jsonl"))
|
|
324
|
+
continue;
|
|
325
|
+
const bytes = requireBuffer(readGitBlob(root, object), `Git object ${object}`);
|
|
326
|
+
if (!bytes.length)
|
|
327
|
+
continue;
|
|
328
|
+
return Object.hasOwn(EVENT_RENAMES, parsedEventType(bytes, name)) ? "legacy" : "final";
|
|
329
|
+
}
|
|
330
|
+
return treeEntries(root, commit, CONFIG_PATH).some(({ name }) => name === CONFIG_PATH)
|
|
331
|
+
? "final"
|
|
332
|
+
: null;
|
|
333
|
+
}
|
|
334
|
+
export async function inspectEventHistory(options) {
|
|
335
|
+
const baseline = options.primary
|
|
336
|
+
? { commit: options.primary, source: "fetched-primary", ref: null }
|
|
337
|
+
: localPrimary(options.root, options.config);
|
|
338
|
+
try {
|
|
339
|
+
return await inspectBoundHistory({ ...options, baseline });
|
|
340
|
+
}
|
|
341
|
+
catch (cause) {
|
|
342
|
+
if (cause instanceof Error)
|
|
343
|
+
throw Object.assign(cause, { eventBaseline: baseline });
|
|
344
|
+
throw Object.assign(new Error(errorMessage(cause), { cause }), { eventBaseline: baseline });
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function snapshotInventory(filesystem) {
|
|
348
|
+
const entries = requireTreeEntries(filesystem.snapshotEntries(IDEAS_ROOT));
|
|
349
|
+
return entries
|
|
350
|
+
.filter(({ type }) => type === "tree")
|
|
351
|
+
.map(({ name }) => name.slice(IDEAS_ROOT.length + 1));
|
|
352
|
+
}
|
|
353
|
+
function withPreciseReaddir(filesystem) {
|
|
354
|
+
async function readdir(path, options) {
|
|
355
|
+
if (options?.withFileTypes === true) {
|
|
356
|
+
const entries = await filesystem.readdir(path, options);
|
|
357
|
+
if (entries.every((entry) => typeof entry !== "string")) {
|
|
358
|
+
return entries;
|
|
359
|
+
}
|
|
360
|
+
throw new TypeError("Snapshot directory entry metadata is invalid.");
|
|
361
|
+
}
|
|
362
|
+
const entries = await filesystem.readdir(path);
|
|
363
|
+
if (entries.every((entry) => typeof entry === "string")) {
|
|
364
|
+
return entries;
|
|
365
|
+
}
|
|
366
|
+
throw new TypeError("Snapshot directory names are invalid.");
|
|
367
|
+
}
|
|
368
|
+
return { ...filesystem, readdir };
|
|
369
|
+
}
|
|
370
|
+
function projectedSummary(projected) {
|
|
371
|
+
if (projected === null || typeof projected !== "object"
|
|
372
|
+
|| !("digest" in projected) || typeof projected.digest !== "string"
|
|
373
|
+
|| !("length" in projected) || typeof projected.length !== "number"
|
|
374
|
+
|| !("state" in projected) || projected.state === null
|
|
375
|
+
|| typeof projected.state !== "object" || !("sequence" in projected.state)) {
|
|
376
|
+
throw new TypeError("Projected event snapshot returned an invalid summary.");
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
length: projected.length,
|
|
380
|
+
digest: projected.digest,
|
|
381
|
+
sequence: projected.state.sequence,
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
export async function inspectProjectedEventHistory({ root, tree, primary, }) {
|
|
385
|
+
const loaded = await loadConfigSnapshot({ gitRoot: root, tree: primary });
|
|
386
|
+
if (!loaded.config) {
|
|
387
|
+
throw new Error(`Invalid primary configuration: ${loaded.diagnostics.map((item) => item.message).join("; ")}`);
|
|
388
|
+
}
|
|
389
|
+
if (loaded.config.version !== 2) {
|
|
390
|
+
return { supported: false, reason: "version-transition" };
|
|
391
|
+
}
|
|
392
|
+
const baseline = withPreciseReaddir(createGitSnapshotFileSystem({ gitRoot: root, tree: primary }));
|
|
393
|
+
const candidate = withPreciseReaddir(createGitSnapshotFileSystem({ gitRoot: root, tree }));
|
|
394
|
+
const previousIds = snapshotInventory(baseline);
|
|
395
|
+
const ids = snapshotInventory(candidate);
|
|
396
|
+
if ([...previousIds, ...ids].some((id) => !isValidUlid(id))) {
|
|
397
|
+
throw new Error("Historical idea identity is invalid.");
|
|
398
|
+
}
|
|
399
|
+
if (previousIds.some((id) => !ids.includes(id))) {
|
|
400
|
+
throw new Error("Removing an integrated idea is not an event repair.");
|
|
401
|
+
}
|
|
402
|
+
if (previousIds.some((id) => baseline.snapshotEntry(ideaPaths(id).eventsPath)?.type !== "blob")
|
|
403
|
+
|| ids.some((id) => candidate.snapshotEntry(ideaPaths(id).eventsPath)?.type !== "blob")) {
|
|
404
|
+
return { supported: false, reason: "storage-transition" };
|
|
405
|
+
}
|
|
406
|
+
const options = { objectIdLength: primary.length };
|
|
407
|
+
const results = [];
|
|
408
|
+
for (const id of ids) {
|
|
409
|
+
const paths = ideaPaths(id);
|
|
410
|
+
const next = await projectEventSnapshot(root, id, paths, options, candidate);
|
|
411
|
+
if (!previousIds.includes(id)) {
|
|
412
|
+
results.push({ id, mode: "initialization", candidate: projectedSummary(next) });
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
let previous;
|
|
416
|
+
try {
|
|
417
|
+
previous = await projectEventSnapshot(root, id, paths, options, baseline);
|
|
418
|
+
}
|
|
419
|
+
catch (cause) {
|
|
420
|
+
if (!(cause instanceof ProjectedReductionError))
|
|
421
|
+
throw cause;
|
|
422
|
+
const reduction = "result" in cause ? cause.result : undefined;
|
|
423
|
+
return {
|
|
424
|
+
supported: false,
|
|
425
|
+
reason: "primary-reduction-failed",
|
|
426
|
+
id,
|
|
427
|
+
reduction,
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
if (await snapshotEventPrefix(root, paths, options, candidate, previous.length) !== previous.digest) {
|
|
431
|
+
throw new Error(`${id}: not-append-only (append)`);
|
|
432
|
+
}
|
|
433
|
+
results.push({
|
|
434
|
+
id,
|
|
435
|
+
mode: "append",
|
|
436
|
+
base: projectedSummary(previous),
|
|
437
|
+
candidate: projectedSummary(next),
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
return {
|
|
441
|
+
supported: true,
|
|
442
|
+
valid: true,
|
|
443
|
+
detail: "summary",
|
|
444
|
+
target: "candidate",
|
|
445
|
+
baseline: { commit: primary, source: "fetched-primary", ref: null },
|
|
446
|
+
results,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
async function inspectBoundHistory({ root, tree, commit, overrides, baseline, }) {
|
|
450
|
+
const blobs = new Map();
|
|
451
|
+
const primaryCommit = resolveCommit(root, baseline.commit);
|
|
452
|
+
const target = await snapshot(root, tree, overrides, commit, blobs);
|
|
453
|
+
const options = { objectIdLength: primaryCommit.length };
|
|
454
|
+
const results = [];
|
|
455
|
+
const targetCommit = commit === undefined ? null : resolveCommit(root, commit);
|
|
456
|
+
const parent = targetCommit ? firstParent(root, targetCommit) : null;
|
|
457
|
+
const baseCommit = targetCommit ? parent : primaryCommit;
|
|
458
|
+
const base = baseCommit
|
|
459
|
+
? await snapshot(root, baseCommit, undefined, baseCommit, blobs)
|
|
460
|
+
: await snapshot(root, tree, undefined, undefined, blobs);
|
|
461
|
+
if (!baseCommit) {
|
|
462
|
+
base.version = null;
|
|
463
|
+
base.ids = [];
|
|
464
|
+
base.entries = [];
|
|
465
|
+
base.format = null;
|
|
466
|
+
}
|
|
467
|
+
noDeletion(base, target);
|
|
468
|
+
if (target.version === 2) {
|
|
469
|
+
for (const id of target.ids) {
|
|
470
|
+
results.push(transition(root, base, target, id, options));
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return {
|
|
474
|
+
valid: true,
|
|
475
|
+
baseline,
|
|
476
|
+
target: targetCommit ? "commit" : "candidate",
|
|
477
|
+
...(targetCommit ? { parent: baseCommit } : {}),
|
|
478
|
+
results,
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
//# sourceMappingURL=history.js.map
|