@agent-teams/engineering-foundation 0.14.0 → 0.16.0-rc.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 +66 -8
- package/dist/capability-runtime.d.ts +2 -1
- package/dist/capability-runtime.d.ts.map +1 -1
- package/dist/capability-runtime.js +1 -1
- package/dist/capability-runtime.js.map +1 -1
- package/dist/check-contract.d.ts +2 -1
- package/dist/check-contract.d.ts.map +1 -1
- package/dist/check-runner.d.ts.map +1 -1
- package/dist/check-runner.js +6 -2
- package/dist/check-runner.js.map +1 -1
- package/dist/cli-arguments.d.ts +6 -0
- package/dist/cli-arguments.d.ts.map +1 -1
- package/dist/cli-arguments.js +179 -49
- package/dist/cli-arguments.js.map +1 -1
- package/dist/cli.js +16 -10
- package/dist/cli.js.map +1 -1
- package/dist/command-error.d.ts +14 -0
- package/dist/command-error.d.ts.map +1 -0
- package/dist/command-error.js +98 -0
- package/dist/command-error.js.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.d.ts +5 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.d.ts.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.js +36 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.js.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.d.ts +6 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.d.ts.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.js +127 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.js.map +1 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.d.ts +33 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.js +47 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.js +14 -39
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-contract-validator.d.ts +7 -0
- package/dist/document-authoring/adapters/node/node-document-contract-validator.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js +306 -0
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.d.ts +17 -0
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.js +49 -0
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.d.ts +21 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.js +183 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.d.ts +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.js +18 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.d.ts +36 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.js +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.d.ts +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.js +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.d.ts +22 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.js +339 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.d.ts +10 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js +75 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.d.ts +10 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.js +164 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-publisher-private.d.ts +2 -0
- package/dist/document-authoring/adapters/node/node-document-publisher-private.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-publisher-private.js +2 -0
- package/dist/document-authoring/adapters/node/node-document-publisher-private.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.d.ts +54 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.js +252 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.d.ts +17 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.js +43 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.d.ts +21 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.js +80 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.d.ts +10 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.js +32 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.d.ts +21 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.js +89 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.js.map +1 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.d.ts +16 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.js +89 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.js.map +1 -0
- package/dist/document-authoring/application/model/document-command.d.ts +69 -0
- package/dist/document-authoring/application/model/document-command.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-command.js +2 -0
- package/dist/document-authoring/application/model/document-command.js.map +1 -0
- package/dist/document-authoring/application/model/document-physical-identity.d.ts +10 -0
- package/dist/document-authoring/application/model/document-physical-identity.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-physical-identity.js +29 -0
- package/dist/document-authoring/application/model/document-physical-identity.js.map +1 -0
- package/dist/document-authoring/application/model/document-planning.d.ts +182 -0
- package/dist/document-authoring/application/model/document-planning.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-planning.js +2 -0
- package/dist/document-authoring/application/model/document-planning.js.map +1 -0
- package/dist/document-authoring/application/model/document-receipt.d.ts +74 -0
- package/dist/document-authoring/application/model/document-receipt.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-receipt.js +2 -0
- package/dist/document-authoring/application/model/document-receipt.js.map +1 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.d.ts +43 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.js +2 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.js.map +1 -0
- package/dist/document-authoring/application/model/document-transaction.d.ts +81 -0
- package/dist/document-authoring/application/model/document-transaction.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-transaction.js +2 -0
- package/dist/document-authoring/application/model/document-transaction.js.map +1 -0
- package/dist/document-authoring/application/policies/authoring-profile-semantics.d.ts +5 -1
- package/dist/document-authoring/application/policies/authoring-profile-semantics.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/authoring-profile-semantics.js +7 -0
- package/dist/document-authoring/application/policies/authoring-profile-semantics.js.map +1 -1
- package/dist/document-authoring/application/policies/classify-document-recovery.d.ts +81 -0
- package/dist/document-authoring/application/policies/classify-document-recovery.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/classify-document-recovery.js +138 -0
- package/dist/document-authoring/application/policies/classify-document-recovery.js.map +1 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.d.ts +2 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.js +15 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.js.map +1 -0
- package/dist/document-authoring/application/policies/document-command-projection.d.ts +20 -0
- package/dist/document-authoring/application/policies/document-command-projection.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-command-projection.js +90 -0
- package/dist/document-authoring/application/policies/document-command-projection.js.map +1 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.d.ts +14 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.js +61 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.js.map +1 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.d.ts +6 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.js +9 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.js.map +1 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.d.ts +5 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.js +53 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.js.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.d.ts +5 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.js +12 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.js.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.d.ts +4 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.js +118 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.js.map +1 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.d.ts +3 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.js +104 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.js.map +1 -0
- package/dist/document-authoring/application/policies/project-document-reachability.d.ts +14 -0
- package/dist/document-authoring/application/policies/project-document-reachability.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/project-document-reachability.js +57 -0
- package/dist/document-authoring/application/policies/project-document-reachability.js.map +1 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.d.ts +4 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.js +17 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.js.map +1 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.d.ts +13 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.js +154 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.js.map +1 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.d.ts +19 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.js +2 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.js.map +1 -0
- package/dist/document-authoring/application/ports/document-contract-validator.d.ts +6 -0
- package/dist/document-authoring/application/ports/document-contract-validator.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-contract-validator.js +2 -0
- package/dist/document-authoring/application/ports/document-contract-validator.js.map +1 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.d.ts +12 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.js +2 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.js.map +1 -0
- package/dist/document-authoring/application/ports/document-file-state.d.ts +55 -0
- package/dist/document-authoring/application/ports/document-file-state.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-file-state.js +2 -0
- package/dist/document-authoring/application/ports/document-file-state.js.map +1 -0
- package/dist/document-authoring/application/ports/document-journal-store.d.ts +31 -0
- package/dist/document-authoring/application/ports/document-journal-store.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-journal-store.js +2 -0
- package/dist/document-authoring/application/ports/document-journal-store.js.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.d.ts +9 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.js +2 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.d.ts +9 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.js +2 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/document-publisher.d.ts +38 -0
- package/dist/document-authoring/application/ports/document-publisher.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-publisher.js +2 -0
- package/dist/document-authoring/application/ports/document-publisher.js.map +1 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.d.ts +13 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.js +2 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.js.map +1 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.d.ts +17 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.js +2 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.js.map +1 -0
- package/dist/document-authoring/application/ports/document-template-reader.d.ts +9 -0
- package/dist/document-authoring/application/ports/document-template-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-template-reader.js +2 -0
- package/dist/document-authoring/application/ports/document-template-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.d.ts +21 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.js +2 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.js.map +1 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.d.ts +11 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.js +2 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.d.ts +17 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.js +2 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.js.map +1 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.d.ts +16 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.js +215 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.js.map +1 -0
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.d.ts +2 -1
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.js.map +1 -1
- package/dist/document-authoring/application/use-cases/compile-document-plan.d.ts +6 -0
- package/dist/document-authoring/application/use-cases/compile-document-plan.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/compile-document-plan.js +156 -0
- package/dist/document-authoring/application/use-cases/compile-document-plan.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.d.ts +18 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.js +90 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.d.ts +59 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.js +360 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.d.ts +5 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.js +9 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.d.ts +9 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.js +40 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.js.map +1 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.d.ts +66 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.js +276 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.js.map +1 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.d.ts +10 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.js +233 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.js.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.d.ts +18 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.js +171 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.js.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-new.d.ts +30 -0
- package/dist/document-authoring/application/use-cases/run-document-new.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-new.js +221 -0
- package/dist/document-authoring/application/use-cases/run-document-new.js.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.d.ts +21 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.js +126 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.js.map +1 -0
- package/dist/document-authoring/composition/document-command-cli.d.ts +7 -0
- package/dist/document-authoring/composition/document-command-cli.d.ts.map +1 -0
- package/dist/document-authoring/composition/document-command-cli.js +32 -0
- package/dist/document-authoring/composition/document-command-cli.js.map +1 -0
- package/dist/document-authoring/composition/inspect-document-transaction.d.ts +8 -0
- package/dist/document-authoring/composition/inspect-document-transaction.d.ts.map +1 -0
- package/dist/document-authoring/composition/inspect-document-transaction.js +177 -0
- package/dist/document-authoring/composition/inspect-document-transaction.js.map +1 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.d.ts +11 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.js +62 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.js.map +1 -0
- package/dist/document-authoring/composition/node-document-commands.d.ts +10 -0
- package/dist/document-authoring/composition/node-document-commands.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-commands.js +68 -0
- package/dist/document-authoring/composition/node-document-commands.js.map +1 -0
- package/dist/document-authoring/composition/node-document-planning.d.ts +7 -0
- package/dist/document-authoring/composition/node-document-planning.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-planning.js +77 -0
- package/dist/document-authoring/composition/node-document-planning.js.map +1 -0
- package/dist/document-authoring/composition/node-document-writing-private.d.ts +15 -0
- package/dist/document-authoring/composition/node-document-writing-private.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-writing-private.js +52 -0
- package/dist/document-authoring/composition/node-document-writing-private.js.map +1 -0
- package/dist/document-authoring/composition/node-document-writing.d.ts +8 -0
- package/dist/document-authoring/composition/node-document-writing.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-writing.js +10 -0
- package/dist/document-authoring/composition/node-document-writing.js.map +1 -0
- package/dist/document-authoring/document-planning-error.d.ts +6 -0
- package/dist/document-authoring/document-planning-error.d.ts.map +1 -0
- package/dist/document-authoring/document-planning-error.js +9 -0
- package/dist/document-authoring/document-planning-error.js.map +1 -0
- package/dist/document-authoring/index.d.ts +22 -0
- package/dist/document-authoring/index.d.ts.map +1 -1
- package/dist/document-authoring/index.js +19 -0
- package/dist/document-authoring/index.js.map +1 -1
- package/dist/document-command.d.ts +9 -0
- package/dist/document-command.d.ts.map +1 -1
- package/dist/document-command.js +64 -3
- package/dist/document-command.js.map +1 -1
- package/dist/foundation-state-contract.d.ts +1 -0
- package/dist/foundation-state-contract.d.ts.map +1 -1
- package/dist/foundation-state-contract.js +1 -0
- package/dist/foundation-state-contract.js.map +1 -1
- package/dist/local-mode/inspection.d.ts.map +1 -1
- package/dist/local-mode/inspection.js +51 -3
- package/dist/local-mode/inspection.js.map +1 -1
- package/dist/package-self-check.d.ts +2 -1
- package/dist/package-self-check.d.ts.map +1 -1
- package/dist/package-self-check.js +30 -7
- package/dist/package-self-check.js.map +1 -1
- package/dist/report-renderer.d.ts.map +1 -1
- package/dist/report-renderer.js +1 -0
- package/dist/report-renderer.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.d.ts +19 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.js +74 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.d.ts +2 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.d.ts.map +1 -1
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.js +56 -154
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.d.ts +26 -0
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.js +151 -0
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.d.ts +6 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.d.ts.map +1 -1
- package/dist/repository-mutation/adapters/node/node-directory-durability.js +15 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.d.ts +14 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.js +26 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.d.ts +28 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.js +47 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.d.ts +22 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.js +59 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.js.map +1 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.d.ts +7 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.d.ts.map +1 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.js +2 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.d.ts +1 -1
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js +74 -53
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-finalization.d.ts +9 -1
- package/dist/scaffolding/adapters/node/filesystem-finalization.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-finalization.js +34 -6
- package/dist/scaffolding/adapters/node/filesystem-finalization.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal-state.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal-state.js +2 -1
- package/dist/scaffolding/adapters/node/filesystem-journal-state.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal.d.ts +13 -5
- package/dist/scaffolding/adapters/node/filesystem-journal.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal.js +112 -74
- package/dist/scaffolding/adapters/node/filesystem-journal.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts +10 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js +40 -2
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js.map +1 -1
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.d.ts +35 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.js +137 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.d.ts +11 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.js +95 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.d.ts +15 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.js +29 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.d.ts +46 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.js +2 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.d.ts +19 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.js +288 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.d.ts +2 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.js +34 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.js.map +1 -0
- package/dist/schema-catalog.d.ts.map +1 -1
- package/dist/schema-catalog.js +4 -0
- package/dist/schema-catalog.js.map +1 -1
- package/dist/schema-ids.d.ts +1 -1
- package/dist/schema-ids.d.ts.map +1 -1
- package/dist/schema-ids.js +3 -0
- package/dist/schema-ids.js.map +1 -1
- package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.d.ts.map +1 -1
- package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.js +17 -10
- package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.d.ts +22 -0
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.js +123 -0
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts +2 -2
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.js +4 -4
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.d.ts +4 -0
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.js +58 -0
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.d.ts +17 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.js +79 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.d.ts +9 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.js +34 -11
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.d.ts +7 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.js +15 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.d.ts +2 -2
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js +123 -140
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.d.ts +5 -4
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.d.ts.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.js +14 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.js.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-error.d.ts +4 -3
- package/dist/transaction-coordination/application/foundation-transaction-error.d.ts.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-error.js.map +1 -1
- package/dist/transaction-coordination/application/model/internal-transaction-status.d.ts +26 -0
- package/dist/transaction-coordination/application/model/internal-transaction-status.d.ts.map +1 -0
- package/dist/transaction-coordination/application/model/internal-transaction-status.js +2 -0
- package/dist/transaction-coordination/application/model/internal-transaction-status.js.map +1 -0
- package/dist/transaction-coordination/application/ports/foundation-transaction-slot.d.ts +2 -2
- package/dist/transaction-coordination/application/ports/foundation-transaction-slot.d.ts.map +1 -1
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.d.ts.map +1 -1
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.js +13 -9
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.js.map +1 -1
- package/package.json +12 -3
- package/schemas/document-authoring-profile/v1.schema.json +31 -1
- package/schemas/document-command-envelope/v2.schema.json +205 -0
- package/schemas/foundation-check-report/v1.schema.json +1 -1
- package/schemas/foundation-command-error/v1.schema.json +24 -0
- package/schemas/foundation-transaction-envelope/v3.schema.json +169 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { canonicalJson } from "../../../canonical-json.js";
|
|
2
|
+
import { assertSchema } from "../../../schema-catalog.js";
|
|
3
|
+
import { assertNonzeroDocumentPhysicalIdentity } from "../model/document-physical-identity.js";
|
|
4
|
+
import { assertDocumentPlanDigests } from "./document-contract-digests.js";
|
|
5
|
+
import { documentTemporaryPath } from "./document-temporary-path.js";
|
|
6
|
+
import { documentTransactionEnvelopeDigest, documentTransactionPayloadDigest } from "./document-transaction-digests.js";
|
|
7
|
+
class DocumentTransactionEnvelopeError extends Error {
|
|
8
|
+
constructor(message, options) {
|
|
9
|
+
super(message, options);
|
|
10
|
+
this.name = "DocumentTransactionEnvelopeError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function canonicalSnapshot(value) {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(canonicalJson(value));
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
throw new DocumentTransactionEnvelopeError("Document transaction envelope must use canonical JSON values.", { cause: error });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function deepFreezeCanonical(value) {
|
|
22
|
+
const pending = [];
|
|
23
|
+
if (value !== null && typeof value === "object") {
|
|
24
|
+
pending.push(value);
|
|
25
|
+
}
|
|
26
|
+
while (pending.length > 0) {
|
|
27
|
+
const current = pending.pop();
|
|
28
|
+
if (current === undefined || Object.isFrozen(current)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
for (const key of Reflect.ownKeys(current)) {
|
|
32
|
+
const descriptor = Object.getOwnPropertyDescriptor(current, key);
|
|
33
|
+
const child = descriptor !== undefined && "value" in descriptor
|
|
34
|
+
? descriptor.value
|
|
35
|
+
: undefined;
|
|
36
|
+
if (typeof child === "object" && child !== null) {
|
|
37
|
+
pending.push(child);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
Object.freeze(current);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
function isRecord(value) {
|
|
45
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
46
|
+
}
|
|
47
|
+
function hasOwnedTemporary(journal) {
|
|
48
|
+
return "ownedTemporary" in journal;
|
|
49
|
+
}
|
|
50
|
+
function assertLifecycleBindings(envelope) {
|
|
51
|
+
const { journal } = envelope;
|
|
52
|
+
const { destination } = journal;
|
|
53
|
+
if (destination.path !== journal.plan.destination ||
|
|
54
|
+
envelope.foundation.version !== journal.plan.compiler.version ||
|
|
55
|
+
envelope.foundation.buildIdentity !== journal.plan.compiler.buildIdentity) {
|
|
56
|
+
throw new DocumentTransactionEnvelopeError("Document transaction lifecycle does not bind the embedded Plan.");
|
|
57
|
+
}
|
|
58
|
+
if (hasOwnedTemporary(journal) &&
|
|
59
|
+
journal.ownedTemporary.digest !== journal.plan.output.digest) {
|
|
60
|
+
throw new DocumentTransactionEnvelopeError("Document transaction temporary does not bind the planned output.");
|
|
61
|
+
}
|
|
62
|
+
if (hasOwnedTemporary(journal)) {
|
|
63
|
+
assertNonzeroDocumentPhysicalIdentity(journal.ownedTemporary.identity);
|
|
64
|
+
if (journal.ownedTemporary.path !==
|
|
65
|
+
documentTemporaryPath(journal.plan.destination, journal.plan.planDigest)) {
|
|
66
|
+
throw new DocumentTransactionEnvelopeError("Document transaction temporary path does not bind the embedded Plan.");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (envelope.state === "PUBLISHED") {
|
|
70
|
+
assertNonzeroDocumentPhysicalIdentity(envelope.journal.publicationIdentity);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export async function assertDocumentTransactionEnvelope(value) {
|
|
74
|
+
const candidate = deepFreezeCanonical(canonicalSnapshot(value));
|
|
75
|
+
if (!isRecord(candidate)) {
|
|
76
|
+
throw new DocumentTransactionEnvelopeError("Document transaction envelope must be an object.");
|
|
77
|
+
}
|
|
78
|
+
const handler = candidate["recoveryHandler"];
|
|
79
|
+
if (candidate["schemaVersion"] !== 3 ||
|
|
80
|
+
candidate["operationKind"] !== "document-authoring" ||
|
|
81
|
+
!isRecord(handler) ||
|
|
82
|
+
handler["id"] !== "foundation.document-authoring" ||
|
|
83
|
+
handler["contractVersion"] !== 2 ||
|
|
84
|
+
candidate["adapterContractVersion"] !== 1 ||
|
|
85
|
+
candidate["payloadKind"] !== "document-authoring-journal/v2" ||
|
|
86
|
+
!["PREPARED", "PUBLISHING", "PUBLISHED"].includes(String(candidate["state"]))) {
|
|
87
|
+
throw new DocumentTransactionEnvelopeError("Document transaction envelope constants are invalid.");
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
await assertSchema("foundation-transaction-envelope/v3", candidate, "document-transaction-envelope");
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
throw new DocumentTransactionEnvelopeError("Document transaction envelope does not match the closed v3 schema.", { cause: error });
|
|
94
|
+
}
|
|
95
|
+
const envelope = candidate;
|
|
96
|
+
assertDocumentPlanDigests(envelope.journal.plan);
|
|
97
|
+
assertLifecycleBindings(envelope);
|
|
98
|
+
if (envelope.payloadDigest !==
|
|
99
|
+
documentTransactionPayloadDigest(envelope.journal) ||
|
|
100
|
+
envelope.envelopeDigest !==
|
|
101
|
+
documentTransactionEnvelopeDigest(envelope)) {
|
|
102
|
+
throw new DocumentTransactionEnvelopeError("Document transaction envelope digest is invalid.");
|
|
103
|
+
}
|
|
104
|
+
return envelope;
|
|
105
|
+
}
|
|
106
|
+
export async function createDocumentTransactionEnvelope(body) {
|
|
107
|
+
const snapshot = deepFreezeCanonical(canonicalSnapshot(body));
|
|
108
|
+
const withPayload = {
|
|
109
|
+
...snapshot,
|
|
110
|
+
payloadDigest: documentTransactionPayloadDigest(snapshot.journal)
|
|
111
|
+
};
|
|
112
|
+
const envelope = deepFreezeCanonical({
|
|
113
|
+
...withPayload,
|
|
114
|
+
envelopeDigest: documentTransactionEnvelopeDigest(withPayload)
|
|
115
|
+
});
|
|
116
|
+
return assertDocumentTransactionEnvelope(envelope);
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=document-transaction-envelope-policy.js.map
|
package/dist/document-authoring/application/policies/document-transaction-envelope-policy.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-transaction-envelope-policy.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/document-transaction-envelope-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1D,OAAO,EAAE,qCAAqC,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EACjC,MAAM,mCAAmC,CAAC;AAE3C,MAAM,gCAAiC,SAAQ,KAAK;IAClD,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC;IACjD,CAAC;CACF;AAED,SAAS,iBAAiB,CAAI,KAAQ;IACpC,IA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jD,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAClC,IACE,QAAQ,CAAC,aAAa;QACtB,gCAAgC,CAAC,QAAQ,CAAC,OAAO,CAAC;QAClD,QAAQ,CAAC,cAAc;YACvB,iCAAiC,CAAC,QAAQ,CAAC,EAC3C,CAAC;QACD,MAAM,IAAI,gCAAgC,CACxC,kDAAkD,CACnD,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,IAAqC;IAErC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAG;QAClB,GAAG,QAAQ;QACX,aAAa,EAAE,gCAAgC,CAAC,QAAQ,CAAC,OAAO,CAAC;KACX,CAAC;IACzD,MAAM,QAAQ,GAAG,mBAAmB,CAAC;QACnC,GAAG,WAAW;QACd,cAAc,EAAE,iCAAiC,CAAC,WAAW,CAAC;KAC/D,CAAgC,CAAC;IAClC,OAAO,iCAAiC,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-document-intent.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/normalize-document-intent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,+BAA+B,CAAC;AA4FvC,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAyB7E"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { compareBinaryStrings } from "../../../binary-string-comparator.js";
|
|
2
|
+
import { DocumentPlanningPolicyError } from "./document-planning-policy-error.js";
|
|
3
|
+
const FORBIDDEN_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
4
|
+
const GOVERNED_KEYS = new Set([
|
|
5
|
+
"destination",
|
|
6
|
+
"id",
|
|
7
|
+
"owner",
|
|
8
|
+
"related",
|
|
9
|
+
"slug",
|
|
10
|
+
"status",
|
|
11
|
+
"summary",
|
|
12
|
+
"title",
|
|
13
|
+
"type"
|
|
14
|
+
]);
|
|
15
|
+
function invalidJson(message) {
|
|
16
|
+
throw new DocumentPlanningPolicyError("invalid-intent-json", message);
|
|
17
|
+
}
|
|
18
|
+
function normalizeString(value) {
|
|
19
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
20
|
+
const unit = value.charCodeAt(index);
|
|
21
|
+
if (unit >= 0xd800 && unit <= 0xdbff) {
|
|
22
|
+
const next = value.charCodeAt(index + 1);
|
|
23
|
+
if (!Number.isInteger(next) || next < 0xdc00 || next > 0xdfff) {
|
|
24
|
+
return invalidJson("Document Intent contains a lone UTF-16 surrogate.");
|
|
25
|
+
}
|
|
26
|
+
index += 1;
|
|
27
|
+
}
|
|
28
|
+
else if (unit >= 0xdc00 && unit <= 0xdfff) {
|
|
29
|
+
return invalidJson("Document Intent contains a lone UTF-16 surrogate.");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return value.normalize("NFC");
|
|
33
|
+
}
|
|
34
|
+
function normalizeJsonObject(value) {
|
|
35
|
+
const normalized = new Map();
|
|
36
|
+
for (const [rawKey, rawValue] of Object.entries(value)) {
|
|
37
|
+
const key = normalizeString(rawKey);
|
|
38
|
+
if (FORBIDDEN_KEYS.has(key)) {
|
|
39
|
+
return invalidJson(`Document Intent contains forbidden metadata key: ${key}.`);
|
|
40
|
+
}
|
|
41
|
+
if (normalized.has(key)) {
|
|
42
|
+
return invalidJson("Document Intent metadata keys collide after NFC normalization.");
|
|
43
|
+
}
|
|
44
|
+
normalized.set(key, normalizeJson(rawValue));
|
|
45
|
+
}
|
|
46
|
+
return Object.freeze(Object.fromEntries([...normalized].toSorted(([left], [right]) => compareBinaryStrings(left, right))));
|
|
47
|
+
}
|
|
48
|
+
function isJsonArray(value) {
|
|
49
|
+
return Array.isArray(value);
|
|
50
|
+
}
|
|
51
|
+
function normalizeJson(value) {
|
|
52
|
+
if (typeof value === "string") {
|
|
53
|
+
return normalizeString(value);
|
|
54
|
+
}
|
|
55
|
+
if (typeof value === "number") {
|
|
56
|
+
if (!Number.isSafeInteger(value) || Object.is(value, -0)) {
|
|
57
|
+
return invalidJson("Document Intent numbers must be safe integers other than negative zero.");
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
if (value === null || typeof value === "boolean") {
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
if (isJsonArray(value)) {
|
|
65
|
+
return Object.freeze(value.map(normalizeJson));
|
|
66
|
+
}
|
|
67
|
+
return normalizeJsonObject(value);
|
|
68
|
+
}
|
|
69
|
+
function normalizeAdditionalMetadata(metadata) {
|
|
70
|
+
if (metadata === undefined) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const normalized = normalizeJsonObject(metadata);
|
|
74
|
+
for (const key of Object.keys(normalized)) {
|
|
75
|
+
if (GOVERNED_KEYS.has(key)) {
|
|
76
|
+
return invalidJson(`Document Intent additional metadata replaces governed key: ${key}.`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return normalized;
|
|
80
|
+
}
|
|
81
|
+
export function normalizeDocumentIntent(input) {
|
|
82
|
+
const related = input.related?.map(normalizeString);
|
|
83
|
+
if (related !== undefined && new Set(related).size !== related.length) {
|
|
84
|
+
throw new DocumentPlanningPolicyError("duplicate-related", "Document Intent related identifiers must remain unique after NFC normalization.");
|
|
85
|
+
}
|
|
86
|
+
const additionalMetadata = normalizeAdditionalMetadata(input.additionalMetadata);
|
|
87
|
+
return Object.freeze({
|
|
88
|
+
schemaVersion: 1,
|
|
89
|
+
type: normalizeString(input.type),
|
|
90
|
+
id: normalizeString(input.id),
|
|
91
|
+
title: normalizeString(input.title),
|
|
92
|
+
owner: normalizeString(input.owner),
|
|
93
|
+
summary: normalizeString(input.summary),
|
|
94
|
+
...(input.slug === undefined ? {} : { slug: normalizeString(input.slug) }),
|
|
95
|
+
...(input.destination === undefined
|
|
96
|
+
? {}
|
|
97
|
+
: { destination: normalizeString(input.destination) }),
|
|
98
|
+
...(related === undefined
|
|
99
|
+
? {}
|
|
100
|
+
: { related: Object.freeze(related.toSorted(compareBinaryStrings)) }),
|
|
101
|
+
...(additionalMetadata === undefined ? {} : { additionalMetadata })
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=normalize-document-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-document-intent.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/normalize-document-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAM5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;AAC1E,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,aAAa;IACb,IAAI;IACJ,OAAO;IACP,SAAS;IACT,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,MAAM;CACP,CAAC,CAAC;AAEH,SAAS,WAAW,CAAC,OAAe;IAClC,MAAM,IAAI,2BAA2B,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACpC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,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,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC;KACpE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DocumentArtifactType } from "../model/document-planning.js";
|
|
2
|
+
export type DocumentReachabilityProjection = {
|
|
3
|
+
readonly state: "manual-required";
|
|
4
|
+
readonly indexPath: string;
|
|
5
|
+
readonly markdownLink: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly state: "not-required";
|
|
8
|
+
};
|
|
9
|
+
export declare function projectDocumentReachability(input: {
|
|
10
|
+
readonly artifact: DocumentArtifactType;
|
|
11
|
+
readonly destination: string;
|
|
12
|
+
readonly heading: string;
|
|
13
|
+
}): DocumentReachabilityProjection;
|
|
14
|
+
//# sourceMappingURL=project-document-reachability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-document-reachability.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/project-document-reachability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,+BAA+B,CAAC;AAKvC,MAAM,MAAM,8BAA8B,GACtC;IACE,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,GACD;IAAE,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAkDvC,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GAAG,8BAA8B,CA2BjC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { isDocumentRepositoryPath } from "./document-repository-path.js";
|
|
2
|
+
import { isRepositoryPathAllowedByPlacement } from "./authoring-profile-semantics.js";
|
|
3
|
+
import { DocumentPlanningPolicyError } from "./document-planning-policy-error.js";
|
|
4
|
+
function markdownLinkLabel(heading) {
|
|
5
|
+
return heading.replace(/\\/gu, "\\\\").replace(/\[/gu, "\\[").replace(/\]/gu, "\\]");
|
|
6
|
+
}
|
|
7
|
+
function relativeRepositoryPath(fromFile, toFile) {
|
|
8
|
+
const from = fromFile.split("/").slice(0, -1);
|
|
9
|
+
const to = toFile.split("/");
|
|
10
|
+
let shared = 0;
|
|
11
|
+
while (shared < from.length && shared < to.length && from[shared] === to[shared]) {
|
|
12
|
+
shared += 1;
|
|
13
|
+
}
|
|
14
|
+
return [...from.slice(shared).map(() => ".."), ...to.slice(shared)].join("/");
|
|
15
|
+
}
|
|
16
|
+
function colocatedIndexPath(artifact, destination, strategy) {
|
|
17
|
+
if (artifact.placement.kind !== "explicit") {
|
|
18
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Colocated reachability requires explicit placement authority.");
|
|
19
|
+
}
|
|
20
|
+
if (!isRepositoryPathAllowedByPlacement(destination, artifact.placement)) {
|
|
21
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Colocated reachability destination is outside explicit placement authority.");
|
|
22
|
+
}
|
|
23
|
+
const destinationSegments = destination.split("/");
|
|
24
|
+
const directorySegments = destinationSegments.slice(0, -1);
|
|
25
|
+
const required = artifact.placement.requiredSegmentsInOrder;
|
|
26
|
+
const starts = directorySegments.flatMap((_segment, start) => required.every((segment, offset) => directorySegments[start + offset] === segment)
|
|
27
|
+
? [start]
|
|
28
|
+
: []);
|
|
29
|
+
if (starts.length !== 1 || starts[0] === 0) {
|
|
30
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Colocated reachability cannot project a unique index prefix.");
|
|
31
|
+
}
|
|
32
|
+
return `${directorySegments.slice(0, starts[0]).join("/")}/${strategy.indexBasename}`;
|
|
33
|
+
}
|
|
34
|
+
export function projectDocumentReachability(input) {
|
|
35
|
+
const strategy = input.artifact.reachability;
|
|
36
|
+
if (strategy.kind === "not-required") {
|
|
37
|
+
return Object.freeze({ state: "not-required" });
|
|
38
|
+
}
|
|
39
|
+
const indexPath = strategy.kind === "manual-fixed-index"
|
|
40
|
+
? strategy.indexPath
|
|
41
|
+
: colocatedIndexPath(input.artifact, input.destination, strategy);
|
|
42
|
+
if (!isDocumentRepositoryPath(indexPath) ||
|
|
43
|
+
!isDocumentRepositoryPath(input.destination) ||
|
|
44
|
+
indexPath === input.destination ||
|
|
45
|
+
input.heading.length === 0 ||
|
|
46
|
+
/[\r\n\0]/u.test(input.heading) ||
|
|
47
|
+
input.heading.normalize("NFC") !== input.heading) {
|
|
48
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Document reachability projection is invalid.");
|
|
49
|
+
}
|
|
50
|
+
const relative = relativeRepositoryPath(indexPath, input.destination);
|
|
51
|
+
return Object.freeze({
|
|
52
|
+
state: "manual-required",
|
|
53
|
+
indexPath,
|
|
54
|
+
markdownLink: `[${markdownLinkLabel(input.heading)}](${relative})`
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=project-document-reachability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-document-reachability.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/project-document-reachability.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAUlF,SAAS,iBAAiB,CAAC,OAAe;IACxC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACvF,CAA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;QAC/B,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;QAC1B,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC/B,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,OAAO,EAChD,CAAC;QACD,MAAM,IAAI,2BAA2B,CACnC,qBAAqB,EACrB,8CAA8C,CAC/C,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,sBAAsB,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACtE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,KAAK,EAAE,iBAAiB;QACxB,SAAS;QACT,YAAY,EAAE,IAAI,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,QAAQ,GAAG;KACnE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DocumentCommandDiagnostic } from "../model/document-command.js";
|
|
2
|
+
import type { SimilarDocumentAdvice } from "../ports/similar-document-advisor.js";
|
|
3
|
+
export declare function projectSimilarDocumentAdvice(advice: SimilarDocumentAdvice): readonly DocumentCommandDiagnostic[];
|
|
4
|
+
//# sourceMappingURL=project-similar-document-advice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-similar-document-advice.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/project-similar-document-advice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,qBAAqB,GAC5B,SAAS,yBAAyB,EAAE,CAetC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function projectSimilarDocumentAdvice(advice) {
|
|
2
|
+
if (advice.matches.length === 0) {
|
|
3
|
+
return Object.freeze([]);
|
|
4
|
+
}
|
|
5
|
+
return Object.freeze([Object.freeze({
|
|
6
|
+
ruleId: "document.new.similar-documents",
|
|
7
|
+
severity: "info",
|
|
8
|
+
phase: "planning",
|
|
9
|
+
subject: "document.new",
|
|
10
|
+
message: `${advice.matches.length} existing document(s) contain the exact title query. Review them before publishing if they overlap.`,
|
|
11
|
+
remediation: Object.freeze({
|
|
12
|
+
commandId: "docs.find",
|
|
13
|
+
args: Object.freeze({ text: advice.query }),
|
|
14
|
+
}),
|
|
15
|
+
})]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=project-similar-document-advice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-similar-document-advice.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/project-similar-document-advice.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,4BAA4B,CAC1C,MAA6B;IAE7B,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YAClC,MAAM,EAAE,gCAAgC;YACxC,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,cAAc;YACvB,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,qGAAqG;YACtI,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC;gBACzB,SAAS,EAAE,WAAW;gBACtB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;aAC5C,CAAC;SACH,CAAC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DocumentArtifactType, DocumentIntent, DocumentPlanningProfileSnapshot } from "../model/document-planning.js";
|
|
2
|
+
export interface ResolvedDocumentAuthoring {
|
|
3
|
+
readonly artifact: DocumentArtifactType;
|
|
4
|
+
readonly destination: string;
|
|
5
|
+
readonly heading: string;
|
|
6
|
+
readonly slug?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function selectDocumentArtifact(profile: DocumentPlanningProfileSnapshot, type: string): DocumentArtifactType;
|
|
9
|
+
export declare function resolveDocumentAuthoring(input: {
|
|
10
|
+
readonly artifact: DocumentArtifactType;
|
|
11
|
+
readonly intent: DocumentIntent;
|
|
12
|
+
}): ResolvedDocumentAuthoring;
|
|
13
|
+
//# sourceMappingURL=resolve-document-authoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-document-authoring.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/resolve-document-authoring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,+BAA+B,EAChC,MAAM,+BAA+B,CAAC;AAOvC,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,+BAA+B,EACxC,IAAI,EAAE,MAAM,GACX,oBAAoB,CAStB;AA2ID,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACjC,GAAG,yBAAyB,CAmC5B"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { isDocumentRepositoryPath } from "./document-repository-path.js";
|
|
2
|
+
import { DocumentPlanningPolicyError } from "./document-planning-policy-error.js";
|
|
3
|
+
const SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
4
|
+
const QUALIFIED_SEGMENT = /^[a-z][a-z0-9-]*$/u;
|
|
5
|
+
export function selectDocumentArtifact(profile, type) {
|
|
6
|
+
const matches = profile.artifactTypes.filter((artifact) => artifact.type === type);
|
|
7
|
+
if (matches.length !== 1) {
|
|
8
|
+
throw new DocumentPlanningPolicyError("invalid-artifact-type", `Document type must select exactly one artifact: ${type}.`);
|
|
9
|
+
}
|
|
10
|
+
return matches[0];
|
|
11
|
+
}
|
|
12
|
+
function derivedSlug(title) {
|
|
13
|
+
return title
|
|
14
|
+
.normalize("NFKD")
|
|
15
|
+
.replace(/[\u0300-\u036f]/gu, "")
|
|
16
|
+
.toLowerCase()
|
|
17
|
+
.replace(/[^a-z0-9]+/gu, "-")
|
|
18
|
+
.replace(/^-|-$/gu, "");
|
|
19
|
+
}
|
|
20
|
+
function resolveSlug(intent) {
|
|
21
|
+
const slug = intent.slug ?? derivedSlug(intent.title);
|
|
22
|
+
if (!SLUG.test(slug)) {
|
|
23
|
+
throw new DocumentPlanningPolicyError(intent.slug === undefined ? "missing-slug" : "invalid-slug", "Document collection placement requires a valid non-empty filename slug.");
|
|
24
|
+
}
|
|
25
|
+
return slug;
|
|
26
|
+
}
|
|
27
|
+
function assertIdentity(artifact, id) {
|
|
28
|
+
const identity = artifact.identity;
|
|
29
|
+
if (identity.format === "adr-four-digits") {
|
|
30
|
+
if (!/^ADR-[0-9]{4}$/u.test(id)) {
|
|
31
|
+
throw new DocumentPlanningPolicyError("invalid-identity", "Document ID is not ADR-NNNN.");
|
|
32
|
+
}
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
if (identity.format === "open-decision-three-digits") {
|
|
36
|
+
if (!/^OD-[0-9]{3}$/u.test(id)) {
|
|
37
|
+
throw new DocumentPlanningPolicyError("invalid-identity", "Document ID is not OD-NNN.");
|
|
38
|
+
}
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
if (!("grammar" in identity)) {
|
|
42
|
+
throw new DocumentPlanningPolicyError("invalid-identity", "Document identity format is unsupported.");
|
|
43
|
+
}
|
|
44
|
+
const segments = id.split(".");
|
|
45
|
+
const grammar = identity.grammar;
|
|
46
|
+
const prefix = grammar.prefixSegments;
|
|
47
|
+
const suffix = segments.slice(prefix.length);
|
|
48
|
+
if (prefix.length === 0 ||
|
|
49
|
+
prefix.some((segment) => !QUALIFIED_SEGMENT.test(segment)) ||
|
|
50
|
+
grammar.minSuffixSegments < 1 ||
|
|
51
|
+
grammar.minSuffixSegments > grammar.maxSuffixSegments ||
|
|
52
|
+
segments.some((segment) => !QUALIFIED_SEGMENT.test(segment)) ||
|
|
53
|
+
prefix.some((segment, index) => segments[index] !== segment) ||
|
|
54
|
+
suffix.length < grammar.minSuffixSegments ||
|
|
55
|
+
suffix.length > grammar.maxSuffixSegments) {
|
|
56
|
+
throw new DocumentPlanningPolicyError("invalid-identity", "Document ID does not match its qualified identity grammar.");
|
|
57
|
+
}
|
|
58
|
+
return suffix;
|
|
59
|
+
}
|
|
60
|
+
function assertNoDestination(intent) {
|
|
61
|
+
if (intent.destination !== undefined) {
|
|
62
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Selected placement forbids an explicit destination.");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function collectionDestination(artifact, intent) {
|
|
66
|
+
const placement = artifact.placement;
|
|
67
|
+
if (placement.kind !== "collection") {
|
|
68
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Invalid collection placement.");
|
|
69
|
+
}
|
|
70
|
+
assertNoDestination(intent);
|
|
71
|
+
if (placement.filename === "README.md") {
|
|
72
|
+
if (intent.slug !== undefined) {
|
|
73
|
+
throw new DocumentPlanningPolicyError("invalid-slug", "README placement forbids a slug.");
|
|
74
|
+
}
|
|
75
|
+
return { destination: `${placement.directory}/README.md` };
|
|
76
|
+
}
|
|
77
|
+
const slug = resolveSlug(intent);
|
|
78
|
+
const basename = placement.filename === "numeric-id-slug"
|
|
79
|
+
? `${intent.id.slice(4)}-${slug}.md`
|
|
80
|
+
: placement.filename === "id-slug"
|
|
81
|
+
? `${intent.id}-${slug}.md`
|
|
82
|
+
: `${slug}.md`;
|
|
83
|
+
return { destination: `${placement.directory}/${basename}`, slug };
|
|
84
|
+
}
|
|
85
|
+
function isPrefix(root, path) {
|
|
86
|
+
return path === root || path.startsWith(`${root}/`);
|
|
87
|
+
}
|
|
88
|
+
function explicitDestination(artifact, intent) {
|
|
89
|
+
const placement = artifact.placement;
|
|
90
|
+
if (placement.kind !== "explicit") {
|
|
91
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Invalid explicit placement.");
|
|
92
|
+
}
|
|
93
|
+
if (intent.slug !== undefined) {
|
|
94
|
+
throw new DocumentPlanningPolicyError("invalid-slug", "Explicit placement forbids a slug.");
|
|
95
|
+
}
|
|
96
|
+
const destination = intent.destination;
|
|
97
|
+
if (destination === undefined) {
|
|
98
|
+
throw new DocumentPlanningPolicyError("missing-destination", "Explicit placement requires a destination.");
|
|
99
|
+
}
|
|
100
|
+
const matchedRoots = placement.allowedRoots.filter((root) => isPrefix(root, destination));
|
|
101
|
+
const segments = destination.split("/");
|
|
102
|
+
if (!isDocumentRepositoryPath(destination) ||
|
|
103
|
+
matchedRoots.length !== 1 ||
|
|
104
|
+
segments.at(-1) !== placement.requiredBasename) {
|
|
105
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Destination is outside explicit placement authority.");
|
|
106
|
+
}
|
|
107
|
+
const root = matchedRoots[0];
|
|
108
|
+
const directories = segments.slice(root.split("/").length, -1);
|
|
109
|
+
const required = placement.requiredSegmentsInOrder;
|
|
110
|
+
const validSequence = directories.some((_segment, start) => start >= placement.minimumSegmentsBeforeRequired &&
|
|
111
|
+
directories.length - start - required.length >= placement.minimumSegmentsAfterRequired &&
|
|
112
|
+
required.every((segment, offset) => directories[start + offset] === segment));
|
|
113
|
+
if (!validSequence) {
|
|
114
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Destination does not satisfy the explicit placement shape.");
|
|
115
|
+
}
|
|
116
|
+
return destination;
|
|
117
|
+
}
|
|
118
|
+
export function resolveDocumentAuthoring(input) {
|
|
119
|
+
const { artifact, intent } = input;
|
|
120
|
+
const suffix = assertIdentity(artifact, intent.id);
|
|
121
|
+
let resolution;
|
|
122
|
+
if (artifact.placement.kind === "collection") {
|
|
123
|
+
if (artifact.placement.filename === "numeric-id-slug" &&
|
|
124
|
+
artifact.identity.format !== "adr-four-digits") {
|
|
125
|
+
throw new DocumentPlanningPolicyError("invalid-identity", "Numeric filename placement requires ADR identity.");
|
|
126
|
+
}
|
|
127
|
+
resolution = collectionDestination(artifact, intent);
|
|
128
|
+
}
|
|
129
|
+
else if (artifact.placement.kind === "qualified-leaf-index") {
|
|
130
|
+
if (artifact.identity.format !== "qualified") {
|
|
131
|
+
throw new DocumentPlanningPolicyError("invalid-identity", "Qualified leaf placement requires qualified identity.");
|
|
132
|
+
}
|
|
133
|
+
assertNoDestination(intent);
|
|
134
|
+
if (intent.slug !== undefined) {
|
|
135
|
+
throw new DocumentPlanningPolicyError("invalid-slug", "Qualified leaf placement forbids a slug.");
|
|
136
|
+
}
|
|
137
|
+
resolution = {
|
|
138
|
+
destination: `${artifact.placement.root}/${suffix.join("/")}/${artifact.placement.requiredBasename}`
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
resolution = { destination: explicitDestination(artifact, intent) };
|
|
143
|
+
}
|
|
144
|
+
if (!isDocumentRepositoryPath(resolution.destination)) {
|
|
145
|
+
throw new DocumentPlanningPolicyError("invalid-destination", "Resolved destination is not a portable repository path.");
|
|
146
|
+
}
|
|
147
|
+
return Object.freeze({
|
|
148
|
+
artifact,
|
|
149
|
+
destination: resolution.destination,
|
|
150
|
+
heading: artifact.heading.kind === "title" ? intent.title : `${intent.id}: ${intent.title}`,
|
|
151
|
+
...(resolution.slug === undefined ? {} : { slug: resolution.slug })
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=resolve-document-authoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-document-authoring.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/resolve-document-authoring.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,MAAM,IAAI,GAAG,6BAA6B,CAAC;AAC3C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAS/C,MAAM,UAAU,sBAAsB,CACpC,OAAwC,EACxC,IAAY;IAEZ,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACnF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,2BAA2B,CACnC,uBAAuB,EACvB,mDAAmD,IAAI,GAAG,CAC3D,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAE,CAAC;AACrB,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK;SACT,SAAS,CAAC,MAAM,CAAC;SACjB,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,WAAW,CAAC,MAAsB;IACzC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,2BAA2B,C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WAAW,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,2BAA2B,CAAC,qBAAqB,EAAE,yDAAyD,CAAC,CAAC;IAC1H,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ;QACR,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,KAAK,MAAM,CAAC,KAAK,EAAE;QAC3F,GAAG,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC;KACpE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DocumentPlan } from "../model/document-planning.js";
|
|
2
|
+
export type DocumentAuthorityAssessment = {
|
|
3
|
+
readonly state: "current";
|
|
4
|
+
readonly plan: DocumentPlan;
|
|
5
|
+
} | {
|
|
6
|
+
readonly state: "stale";
|
|
7
|
+
readonly reason: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly state: "unverifiable";
|
|
10
|
+
readonly reason: string;
|
|
11
|
+
};
|
|
12
|
+
export interface DocumentAuthorityRecompiler {
|
|
13
|
+
assess(request: {
|
|
14
|
+
readonly consumerRoot: string;
|
|
15
|
+
readonly plan: DocumentPlan;
|
|
16
|
+
readonly signal?: AbortSignal;
|
|
17
|
+
}): Promise<DocumentAuthorityAssessment>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=document-authority-recompiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-authority-recompiler.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/ports/document-authority-recompiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,MAAM,2BAA2B,GACnC;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,OAAO,EAAE;QACd,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;QAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-authority-recompiler.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/ports/document-authority-recompiler.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DocumentIntent, DocumentPlan } from "../model/document-planning.js";
|
|
2
|
+
export interface DocumentContractValidator {
|
|
3
|
+
validateIntent(input: unknown): Promise<DocumentIntent>;
|
|
4
|
+
validatePlan(input: unknown): Promise<DocumentPlan>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=document-contract-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-contract-validator.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/ports/document-contract-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACb,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,yBAAyB;IACxC,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACxD,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-contract-validator.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/ports/document-contract-validator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DocumentEnvironmentInspection {
|
|
2
|
+
readonly installedFoundationVersion: string;
|
|
3
|
+
readonly installedFoundationBuildIdentity: string;
|
|
4
|
+
readonly filesystem: {
|
|
5
|
+
readonly basis: "platform-contract";
|
|
6
|
+
readonly strictDirectoryDurability: "platform-supported" | "platform-unsupported";
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface DocumentEnvironmentInspector {
|
|
10
|
+
inspect(consumerRoot: string, signal?: AbortSignal): Promise<DocumentEnvironmentInspection>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=document-environment-inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-environment-inspector.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/ports/document-environment-inspector.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,gCAAgC,EAAE,MAAM,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;QACpC,QAAQ,CAAC,yBAAyB,EAC9B,oBAAoB,GACpB,sBAAsB,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CACL,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,6BAA6B,CAAC,CAAC;CAC3C"}
|