@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,80 @@
|
|
|
1
|
+
import { selectDocumentArtifact } from "../../application/policies/resolve-document-authoring.js";
|
|
2
|
+
function diagnostic(ruleId, subject, message) {
|
|
3
|
+
return Object.freeze({ ruleId, subject, message });
|
|
4
|
+
}
|
|
5
|
+
function sameEvidence(observed, planned) {
|
|
6
|
+
return observed.path === planned.path &&
|
|
7
|
+
observed.digest === planned.digest &&
|
|
8
|
+
observed.size === planned.size;
|
|
9
|
+
}
|
|
10
|
+
function authorityDiagnostics(catalog, plan) {
|
|
11
|
+
const diagnostics = [];
|
|
12
|
+
if (!sameEvidence(catalog.authority.profile, plan.authority.profile)) {
|
|
13
|
+
diagnostics.push(diagnostic("document.new.profile-authority-mismatch", plan.authority.profile.path, "The catalog profile authority does not match the applied plan."));
|
|
14
|
+
}
|
|
15
|
+
if (!sameEvidence(catalog.authority.metadataSchema, plan.authority.metadataSchema)) {
|
|
16
|
+
diagnostics.push(diagnostic("document.new.metadata-authority-mismatch", plan.authority.metadataSchema.path, "The catalog metadata authority does not match the applied plan."));
|
|
17
|
+
}
|
|
18
|
+
if (!sameEvidence(catalog.authority.ownerCatalog, plan.authority.ownerCatalog)) {
|
|
19
|
+
diagnostics.push(diagnostic("document.new.owner-authority-mismatch", plan.authority.ownerCatalog.path, "The catalog owner authority does not match the applied plan."));
|
|
20
|
+
}
|
|
21
|
+
if (catalog.projectId !== plan.projectId) {
|
|
22
|
+
diagnostics.push(diagnostic("document.new.project-mismatch", plan.destination, "The rebuilt catalog does not identify the planned project."));
|
|
23
|
+
}
|
|
24
|
+
return diagnostics;
|
|
25
|
+
}
|
|
26
|
+
function descriptorMatches(descriptor, plan, initialStatus, expectedTitle) {
|
|
27
|
+
return descriptor.id === plan.intent.id &&
|
|
28
|
+
descriptor.repositoryPath === plan.destination &&
|
|
29
|
+
descriptor.type === plan.intent.type &&
|
|
30
|
+
descriptor.title === expectedTitle &&
|
|
31
|
+
descriptor.owner === plan.intent.owner &&
|
|
32
|
+
descriptor.summary === plan.intent.summary &&
|
|
33
|
+
descriptor.status === initialStatus;
|
|
34
|
+
}
|
|
35
|
+
/** Rebuilds the catalog and proves that the applied document has one exact descriptor. */
|
|
36
|
+
export class NodeDocumentStructureVerifier {
|
|
37
|
+
#catalog;
|
|
38
|
+
#profiles;
|
|
39
|
+
constructor(dependencies) {
|
|
40
|
+
this.#catalog = dependencies.catalog;
|
|
41
|
+
this.#profiles = dependencies.profiles;
|
|
42
|
+
}
|
|
43
|
+
async verify(input) {
|
|
44
|
+
const request = {
|
|
45
|
+
consumerRoot: input.consumerRoot,
|
|
46
|
+
profilePath: input.plan.authority.profile.path,
|
|
47
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
48
|
+
};
|
|
49
|
+
const [catalog, profile] = await Promise.all([
|
|
50
|
+
this.#catalog.execute(request),
|
|
51
|
+
this.#profiles.read({
|
|
52
|
+
consumerRoot: input.consumerRoot,
|
|
53
|
+
path: input.plan.authority.profile.path,
|
|
54
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
55
|
+
}),
|
|
56
|
+
]);
|
|
57
|
+
const diagnostics = [...authorityDiagnostics(catalog, input.plan)];
|
|
58
|
+
if (!sameEvidence(profile.evidence, input.plan.authority.profile)) {
|
|
59
|
+
diagnostics.push(diagnostic("document.new.profile-authority-mismatch", input.plan.authority.profile.path, "The planning profile authority does not match the applied plan."));
|
|
60
|
+
}
|
|
61
|
+
if (catalog.status !== "complete") {
|
|
62
|
+
diagnostics.push(diagnostic("document.new.catalog-partial", input.plan.destination, "The post-apply documentation catalog is partial."));
|
|
63
|
+
}
|
|
64
|
+
const artifact = selectDocumentArtifact(profile, input.plan.intent.type);
|
|
65
|
+
const expectedTitle = artifact.heading.kind === "title"
|
|
66
|
+
? input.plan.intent.title
|
|
67
|
+
: `${input.plan.intent.id}: ${input.plan.intent.title}`;
|
|
68
|
+
const candidates = catalog.documents.filter((entry) => entry.id === input.plan.intent.id ||
|
|
69
|
+
entry.repositoryPath === input.plan.destination);
|
|
70
|
+
if (candidates.length !== 1 ||
|
|
71
|
+
!descriptorMatches(candidates[0], input.plan, artifact.initialStatus, expectedTitle)) {
|
|
72
|
+
diagnostics.push(diagnostic("document.new.descriptor-mismatch", input.plan.destination, "The rebuilt catalog does not contain exactly the planned document descriptor."));
|
|
73
|
+
}
|
|
74
|
+
return Object.freeze({
|
|
75
|
+
diagnostics: Object.freeze(diagnostics),
|
|
76
|
+
valid: diagnostics.length === 0,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=node-document-structure-verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-structure-verifier.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-structure-verifier.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAElG,SAAS,UAAU,CACjB,MAAc,EACd,OAAe,EACf,OAAe;IAEf,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,YAAY,CACnB,QAAmC,EACnC,OAAkC;IAElC,OAAO,QAAQ,CAAC,IAAI,KAAK,OAAO,CAAC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AI,CAAC,MAAM,CAAC,EAAE;YACjC,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,IAAI,CAAC,WAAW,CAChD,CAAC;QACF,IACE,UAAU,CAAC,MAAM,KAAK,CAAC;YACvB,CAAC,iBAAiB,CAChB,UAAU,CAAC,CAAC,CAAE,EACd,KAAK,CAAC,IAAI,EACV,QAAQ,CAAC,aAAa,EACtB,aAAa,CACd,EACD,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,UAAU,CACzB,kCAAkC,EAClC,KAAK,CAAC,IAAI,CAAC,WAAW,EACtB,+EAA+E,CAChF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YACvC,KAAK,EAAE,WAAW,CAAC,MAAM,KAAK,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DocumentTemplateSnapshot } from "../../application/model/document-planning.js";
|
|
2
|
+
import type { DocumentTemplateReader } from "../../application/ports/document-template-reader.js";
|
|
3
|
+
export declare class NodeDocumentTemplateReader implements DocumentTemplateReader {
|
|
4
|
+
read(request: {
|
|
5
|
+
readonly consumerRoot: string;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly signal?: AbortSignal;
|
|
8
|
+
}): Promise<DocumentTemplateSnapshot>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=node-document-template-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-template-reader.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-template-reader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAOlG,qBAAa,0BAA2B,YAAW,sBAAsB;IACjE,IAAI,CAAC,OAAO,EAAE;QAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA6BpC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { assertNotCancelled } from "../../../cancellation.js";
|
|
2
|
+
import { CapabilityInputError } from "../../../capability-runtime.js";
|
|
3
|
+
import { DocumentCatalogError } from "../../document-catalog-error.js";
|
|
4
|
+
import { DocumentPlanningError } from "../../document-planning-error.js";
|
|
5
|
+
import { readDocumentAuthorityFile } from "./read-document-authority-file.js";
|
|
6
|
+
const MAX_TEMPLATE_BYTES = 256 * 1024;
|
|
7
|
+
export class NodeDocumentTemplateReader {
|
|
8
|
+
async read(request) {
|
|
9
|
+
assertNotCancelled(request.signal);
|
|
10
|
+
try {
|
|
11
|
+
const file = await readDocumentAuthorityFile({
|
|
12
|
+
consumerRoot: request.consumerRoot,
|
|
13
|
+
maxBytes: MAX_TEMPLATE_BYTES,
|
|
14
|
+
path: request.path
|
|
15
|
+
});
|
|
16
|
+
assertNotCancelled(request.signal);
|
|
17
|
+
return Object.freeze({ evidence: file.evidence, source: file.source });
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof CapabilityInputError || error instanceof DocumentPlanningError) {
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
if (error instanceof DocumentCatalogError) {
|
|
24
|
+
throw new DocumentPlanningError(error.code === "DOCUMENT_CATALOG_INPUT_INVALID"
|
|
25
|
+
? "DOCUMENT_PLANNING_INPUT_INVALID"
|
|
26
|
+
: "DOCUMENT_PLANNING_AUTHORITY_UNAVAILABLE", `Document template is unavailable or invalid: ${request.path}.`, { cause: error });
|
|
27
|
+
}
|
|
28
|
+
throw new DocumentPlanningError("DOCUMENT_PLANNING_AUTHORITY_UNAVAILABLE", `Document template is unavailable or invalid: ${request.path}.`, { cause: error });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=node-document-template-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-template-reader.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-template-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,CAAC;AAEtC,MAAM,OAAO,0BAA0B;IACrC,KAAK,CAAC,IAAI,CAAC,OAIV;QACC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,yBAAyB,CAAC;gBAC3C,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAC,CAAC;YACH,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACnC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACzE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,oBAAoB,IAAI,KAAK,YAAY,qBAAqB,EAAE,CAAC;gBACpF,MAAM,KAAK,CAAC;YACd,CAAC;YACD,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;gBAC1C,MAAM,IAAI,qBAAqB,CAC7B,KAAK,CAAC,IAAI,KAAK,gCAAgC;oBAC7C,CAAC,CAAC,iCAAiC;oBACnC,CAAC,CAAC,yCAAyC,EAC7C,gDAAgD,OAAO,CAAC,IAAI,GAAG,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,qBAAqB,CAC7B,yCAAyC,EACzC,gDAAgD,OAAO,CAAC,IAAI,GAAG,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DocumentTransactionCoordinator, DocumentTransactionLease, DocumentTransactionStatus } from "../../application/ports/document-transaction-coordinator.js";
|
|
2
|
+
import type { FoundationTransactionLease } from "../../../transaction-coordination/application/foundation-transaction-coordinator.js";
|
|
3
|
+
import type { InternalFoundationTransactionStatus } from "../../../transaction-coordination/application/model/internal-transaction-status.js";
|
|
4
|
+
interface FoundationCoordinator {
|
|
5
|
+
inspect(): Promise<InternalFoundationTransactionStatus>;
|
|
6
|
+
acquire(options: {
|
|
7
|
+
readonly requestedMutation: "document-authoring";
|
|
8
|
+
readonly allowRecoveryOf?: "document-authoring";
|
|
9
|
+
}): Promise<FoundationTransactionLease>;
|
|
10
|
+
}
|
|
11
|
+
export declare class NodeDocumentTransactionCoordinator implements DocumentTransactionCoordinator {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(coordinator: FoundationCoordinator);
|
|
14
|
+
inspect(): Promise<DocumentTransactionStatus>;
|
|
15
|
+
acquire(request: {
|
|
16
|
+
readonly mode: "apply" | "recover";
|
|
17
|
+
}): Promise<DocumentTransactionLease>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createNodeDocumentTransactionCoordinator(consumerRoot: string): Promise<DocumentTransactionCoordinator>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=node-document-transaction-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-transaction-coordinator.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-transaction-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,6DAA6D,CAAC;AAErE,OAAO,KAAK,EAEV,0BAA0B,EAC3B,MAAM,qFAAqF,CAAC;AAC7F,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oFAAoF,CAAC;AAE9I,UAAU,qBAAqB;IAC7B,OAAO,IAAI,OAAO,CAAC,mCAAmC,CAAC,CAAC;IACxD,OAAO,CAAC,OAAO,EAAE;QACf,QAAQ,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;QACjD,QAAQ,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC;KACjD,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACzC;AAmFD,qBAAa,kCACX,YAAW,8BAA8B;;IAGzC,YAAY,WAAW,EAAE,qBAAqB,EAE7C;IAEK,OAAO,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAElD;IAEK,OAAO,CAAC,OAAO,EAAE;QACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;KACpC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAuBpC;CACF;AAED,wBAAsB,wCAAwC,CAC5D,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,8BAA8B,CAAC,CAIzC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createNodeFoundationTransactionCoordinator } from "../../../transaction-coordination/adapters/node/node-foundation-transaction-coordinator.js";
|
|
2
|
+
function observedProperty(value, property) {
|
|
3
|
+
return Reflect.get(value, property);
|
|
4
|
+
}
|
|
5
|
+
function isExactDocumentRecovery(status) {
|
|
6
|
+
return (status.state === "pending" &&
|
|
7
|
+
status.operationKind === "document-authoring" &&
|
|
8
|
+
observedProperty(status, "format") === "document-authoring-envelope-v3" &&
|
|
9
|
+
observedProperty(status.recovery, "commandId") === "docs-recover" &&
|
|
10
|
+
status.recovery.exactFoundationVersion === status.foundationVersion &&
|
|
11
|
+
status.recovery.exactFoundationBuildIdentity ===
|
|
12
|
+
status.foundationBuildIdentity &&
|
|
13
|
+
!status.diagnostics.some(({ code }) => code === "FOUNDATION_TRANSACTION_VERSION_MISMATCH"));
|
|
14
|
+
}
|
|
15
|
+
function manualReason(status) {
|
|
16
|
+
if (status.state === "manual-recovery-required") {
|
|
17
|
+
return status.reason;
|
|
18
|
+
}
|
|
19
|
+
return (status.diagnostics[0]?.message ??
|
|
20
|
+
`A ${status.operationKind} Foundation transaction blocks document authoring.`);
|
|
21
|
+
}
|
|
22
|
+
function toDocumentStatus(status) {
|
|
23
|
+
if (status.state === "idle") {
|
|
24
|
+
return { state: "idle" };
|
|
25
|
+
}
|
|
26
|
+
return isExactDocumentRecovery(status)
|
|
27
|
+
? { state: "recoverable" }
|
|
28
|
+
: { state: "manual-recovery-required", reason: manualReason(status) };
|
|
29
|
+
}
|
|
30
|
+
function combinedReleaseFailure(inspectionError, releaseError) {
|
|
31
|
+
return new Error("Document transaction inspection and barrier retention both failed.", {
|
|
32
|
+
cause: new AggregateError([inspectionError, releaseError], "Transaction evidence inspection and operation-lock release failed.")
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async function releaseSafely(options) {
|
|
36
|
+
let status;
|
|
37
|
+
try {
|
|
38
|
+
status = await options.coordinator.inspect();
|
|
39
|
+
}
|
|
40
|
+
catch (inspectionError) {
|
|
41
|
+
try {
|
|
42
|
+
await options.lease.release({ retainTransactionBarrier: true });
|
|
43
|
+
}
|
|
44
|
+
catch (releaseError) {
|
|
45
|
+
throw combinedReleaseFailure(inspectionError, releaseError);
|
|
46
|
+
}
|
|
47
|
+
throw inspectionError;
|
|
48
|
+
}
|
|
49
|
+
await options.lease.release({
|
|
50
|
+
retainTransactionBarrier: options.retainRequested || status.state !== "idle"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export class NodeDocumentTransactionCoordinator {
|
|
54
|
+
#coordinator;
|
|
55
|
+
constructor(coordinator) {
|
|
56
|
+
this.#coordinator = coordinator;
|
|
57
|
+
}
|
|
58
|
+
async inspect() {
|
|
59
|
+
return toDocumentStatus(await this.#coordinator.inspect());
|
|
60
|
+
}
|
|
61
|
+
async acquire(request) {
|
|
62
|
+
const lease = await this.#coordinator.acquire({
|
|
63
|
+
requestedMutation: "document-authoring",
|
|
64
|
+
...(request.mode === "recover"
|
|
65
|
+
? { allowRecoveryOf: "document-authoring" }
|
|
66
|
+
: {})
|
|
67
|
+
});
|
|
68
|
+
let held = true;
|
|
69
|
+
return {
|
|
70
|
+
status: toDocumentStatus(lease.status),
|
|
71
|
+
release: async (releaseOptions) => {
|
|
72
|
+
if (!held) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
await releaseSafely({
|
|
76
|
+
coordinator: this.#coordinator,
|
|
77
|
+
lease,
|
|
78
|
+
retainRequested: releaseOptions?.retainTransactionBarrier === true
|
|
79
|
+
});
|
|
80
|
+
held = false;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export async function createNodeDocumentTransactionCoordinator(consumerRoot) {
|
|
86
|
+
const coordinator = await createNodeFoundationTransactionCoordinator(consumerRoot);
|
|
87
|
+
return new NodeDocumentTransactionCoordinator(coordinator);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=node-document-transaction-coordinator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-transaction-coordinator.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-transaction-coordinator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0CAA0C,EAAE,MAAM,4FAA4F,CAAC;AAexJ,SAAS,gBAAgB,CAAC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,CAAC,EAAE,eAAe,EAAE,oBAA6B,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;QACH,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,OAAO;YACL,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;YACtC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;gBAChC,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;gBACT,CAAC;gBACD,MAAM,aAAa,CAAC;oBAClB,WAAW,EAAE,IAAI,CAAC,YAAY;oBAC9B,KAAK;oBACL,eAAe,EACb,cAAc,EAAE,wBAAwB,KAAK,IAAI;iBACpD,CAAC,CAAC;gBACH,IAAI,GAAG,KAAK,CAAC;YACf,CAAC;SACF,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,wCAAwC,CAC5D,YAAoB;IAEpB,MAAM,WAAW,GACf,MAAM,0CAA0C,CAAC,YAAY,CAAC,CAAC;IACjE,OAAO,IAAI,kCAAkC,CAAC,WAAW,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PortablePathIdentity } from "../../../repository-mutation/application/model/path-identity.js";
|
|
2
|
+
export interface RecapturedDocumentPublicationPaths {
|
|
3
|
+
readonly ancestryIdentities: readonly PortablePathIdentity[];
|
|
4
|
+
readonly destinationPath: string;
|
|
5
|
+
readonly parent: string;
|
|
6
|
+
readonly parentIdentity: PortablePathIdentity;
|
|
7
|
+
readonly root: string;
|
|
8
|
+
}
|
|
9
|
+
/** Recaptures strict real-directory ancestry; the result is valid only for the immediate operation. */
|
|
10
|
+
export declare function recaptureDocumentPublicationPaths(request: {
|
|
11
|
+
readonly consumerRoot: string;
|
|
12
|
+
readonly destination: string;
|
|
13
|
+
}): Promise<RecapturedDocumentPublicationPaths>;
|
|
14
|
+
export declare function sameDocumentPhysicalIdentity(left: PortablePathIdentity, right: PortablePathIdentity): boolean;
|
|
15
|
+
export declare function sameDocumentAncestry(left: readonly PortablePathIdentity[], right: readonly PortablePathIdentity[]): boolean;
|
|
16
|
+
//# sourceMappingURL=recapture-document-publication-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recapture-document-publication-paths.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/recapture-document-publication-paths.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAI5G,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,kBAAkB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC7D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAgDD,uGAAuG;AACvG,wBAAsB,iCAAiC,CAAC,OAAO,EAAE;IAC/D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,GAAG,OAAO,CAAC,kCAAkC,CAAC,CA0C9C;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,oBAAoB,EAC1B,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAIT;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,oBAAoB,EAAE,EACrC,KAAK,EAAE,SAAS,oBAAoB,EAAE,GACrC,OAAO,CAIT"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { lstat, readdir, realpath } from "node:fs/promises";
|
|
2
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { OWNED_TEMPORARY_CLEANUP_RESIDUE_MARKER } from "../../../repository-mutation/adapters/node/node-cleanup-owned-temporary.js";
|
|
4
|
+
import { isDocumentRepositoryPath } from "../../application/policies/document-repository-path.js";
|
|
5
|
+
function contained(root, candidate) {
|
|
6
|
+
const relation = relative(root, candidate);
|
|
7
|
+
return relation === "" ||
|
|
8
|
+
(!isAbsolute(relation) && relation !== ".." && !relation.startsWith(`..${sep}`));
|
|
9
|
+
}
|
|
10
|
+
function portableNameIdentity(name) {
|
|
11
|
+
return name.normalize("NFC").replace(/[A-Z]/gu, (character) => character.toLowerCase());
|
|
12
|
+
}
|
|
13
|
+
async function assertNoPortableAlias(parent, segment) {
|
|
14
|
+
const identity = portableNameIdentity(segment);
|
|
15
|
+
const entries = await readdir(parent);
|
|
16
|
+
if (entries.some((entry) => entry !== segment && portableNameIdentity(entry) === identity)) {
|
|
17
|
+
throw new Error(`Document publication ancestry has a portable name alias: ${segment}.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function assertNoOwnedCleanupResidue(parent) {
|
|
21
|
+
const entries = await readdir(parent);
|
|
22
|
+
if (entries.some((entry) => entry.includes(OWNED_TEMPORARY_CLEANUP_RESIDUE_MARKER))) {
|
|
23
|
+
throw new Error("A document temporary cleanup residue was preserved for manual recovery.");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function pathIdentity(metadata) {
|
|
27
|
+
const identity = {
|
|
28
|
+
birthtimeNs: metadata.birthtimeNs,
|
|
29
|
+
dev: metadata.dev,
|
|
30
|
+
ino: metadata.ino
|
|
31
|
+
};
|
|
32
|
+
if (identity.dev === 0n || identity.ino === 0n || identity.birthtimeNs === 0n) {
|
|
33
|
+
throw new Error("Document publication ancestry has zero physical identity.");
|
|
34
|
+
}
|
|
35
|
+
return identity;
|
|
36
|
+
}
|
|
37
|
+
/** Recaptures strict real-directory ancestry; the result is valid only for the immediate operation. */
|
|
38
|
+
export async function recaptureDocumentPublicationPaths(request) {
|
|
39
|
+
if (!isDocumentRepositoryPath(request.destination)) {
|
|
40
|
+
throw new Error("Document publication destination is not a portable repository path.");
|
|
41
|
+
}
|
|
42
|
+
const lexicalRoot = resolve(request.consumerRoot);
|
|
43
|
+
const rootMetadata = await lstat(lexicalRoot, { bigint: true });
|
|
44
|
+
if (rootMetadata.isSymbolicLink() || !rootMetadata.isDirectory()) {
|
|
45
|
+
throw new Error("Document publication root must be a real directory.");
|
|
46
|
+
}
|
|
47
|
+
const root = await realpath(lexicalRoot);
|
|
48
|
+
let parent = root;
|
|
49
|
+
const ancestryIdentities = [pathIdentity(rootMetadata)];
|
|
50
|
+
for (const segment of request.destination.split("/").slice(0, -1)) {
|
|
51
|
+
await assertNoOwnedCleanupResidue(parent);
|
|
52
|
+
await assertNoPortableAlias(parent, segment);
|
|
53
|
+
const candidate = join(parent, segment);
|
|
54
|
+
const metadata = await lstat(candidate, { bigint: true });
|
|
55
|
+
if (metadata.isSymbolicLink() || !metadata.isDirectory()) {
|
|
56
|
+
throw new Error(`Document publication ancestry is not a real directory: ${segment}.`);
|
|
57
|
+
}
|
|
58
|
+
const canonical = await realpath(candidate);
|
|
59
|
+
if (resolve(canonical) !== resolve(candidate) || !contained(root, canonical)) {
|
|
60
|
+
throw new Error("Document publication ancestry is redirected or escapes the repository.");
|
|
61
|
+
}
|
|
62
|
+
ancestryIdentities.push(pathIdentity(metadata));
|
|
63
|
+
parent = canonical;
|
|
64
|
+
}
|
|
65
|
+
const parentMetadata = await lstat(parent, { bigint: true });
|
|
66
|
+
if (parentMetadata.isSymbolicLink() || !parentMetadata.isDirectory()) {
|
|
67
|
+
throw new Error("Document publication parent changed during recapture.");
|
|
68
|
+
}
|
|
69
|
+
const basename = request.destination.split("/").at(-1);
|
|
70
|
+
await assertNoOwnedCleanupResidue(parent);
|
|
71
|
+
await assertNoPortableAlias(parent, basename);
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
ancestryIdentities: Object.freeze(ancestryIdentities),
|
|
74
|
+
destinationPath: join(parent, basename),
|
|
75
|
+
parent,
|
|
76
|
+
parentIdentity: pathIdentity(parentMetadata),
|
|
77
|
+
root
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
export function sameDocumentPhysicalIdentity(left, right) {
|
|
81
|
+
return left.dev === right.dev &&
|
|
82
|
+
left.ino === right.ino &&
|
|
83
|
+
left.birthtimeNs === right.birthtimeNs;
|
|
84
|
+
}
|
|
85
|
+
export function sameDocumentAncestry(left, right) {
|
|
86
|
+
return left.length === right.length &&
|
|
87
|
+
left.every((identity, index) => sameDocumentPhysicalIdentity(identity, right[index]));
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=recapture-document-publication-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recapture-document-publication-paths.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/recapture-document-publication-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGrE,OAAO,EAAE,sCAAsC,EAAE,MAAM,4EAA4E,CAAC;AACpI,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAUlG,SAAS,SAAS,CAAC,IAAY,EAAE,SAAiB;IAChD,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,OAAO,QAAQ,KAAK,EAAE;QACpB,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CAC5D,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;A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KAAsC;IAEtC,OAAO,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QACjC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAC7B,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAE,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { DocumentReceiptOutcome } from "./document-receipt.js";
|
|
2
|
+
export type DocumentCommandId = "docs.doctor" | "docs.new" | "docs.recover";
|
|
3
|
+
export type DocumentCommandOutcome = "authority-stale" | "cancelled" | "conflict" | "execution-failure" | "invalid-input" | "recovery-required" | "success" | "violation";
|
|
4
|
+
type DocumentCommandExitCode = 0 | 1 | 2 | 3 | 130;
|
|
5
|
+
export interface DocumentRecoveryCommand {
|
|
6
|
+
readonly commandId: "detach" | "docs.recover" | "scaffold-recover";
|
|
7
|
+
readonly args: Readonly<Record<string, string>>;
|
|
8
|
+
}
|
|
9
|
+
export type DocumentCommandRemediation = DocumentRecoveryCommand | {
|
|
10
|
+
readonly commandId: DocumentCommandId | "docs.find";
|
|
11
|
+
readonly args: Readonly<Record<string, string>>;
|
|
12
|
+
};
|
|
13
|
+
export interface DocumentCommandDiagnostic {
|
|
14
|
+
readonly ruleId: string;
|
|
15
|
+
readonly severity: "error" | "info" | "warning";
|
|
16
|
+
readonly phase: "apply" | "authority" | "input" | "planning" | "recovery";
|
|
17
|
+
readonly subject: string;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly remediation?: DocumentCommandRemediation;
|
|
20
|
+
}
|
|
21
|
+
interface DocumentCommandEnvelope<Result> {
|
|
22
|
+
readonly schemaVersion: 2;
|
|
23
|
+
readonly command: DocumentCommandId;
|
|
24
|
+
readonly outcome: DocumentCommandOutcome;
|
|
25
|
+
readonly diagnostics: readonly DocumentCommandDiagnostic[];
|
|
26
|
+
readonly result: Result;
|
|
27
|
+
}
|
|
28
|
+
export interface DocumentCommandExecution<Result> {
|
|
29
|
+
readonly envelope: DocumentCommandEnvelope<Result>;
|
|
30
|
+
readonly exitCode: DocumentCommandExitCode;
|
|
31
|
+
}
|
|
32
|
+
export interface DocumentReachabilityProjection {
|
|
33
|
+
readonly state: "managed" | "manual-required" | "not-required";
|
|
34
|
+
readonly indexPath?: string;
|
|
35
|
+
readonly markdownLink?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DocumentNewResult {
|
|
38
|
+
readonly kind: "new";
|
|
39
|
+
readonly documentPath?: string;
|
|
40
|
+
readonly writeState?: "already-applied" | "applied" | "preview";
|
|
41
|
+
readonly reservation: "none";
|
|
42
|
+
readonly receiptOutcome?: DocumentReceiptOutcome;
|
|
43
|
+
readonly reachability?: DocumentReachabilityProjection;
|
|
44
|
+
}
|
|
45
|
+
export interface DocumentDoctorResult {
|
|
46
|
+
readonly kind: "doctor";
|
|
47
|
+
readonly installedFoundationVersion?: string;
|
|
48
|
+
readonly installedFoundationBuildIdentity?: string;
|
|
49
|
+
readonly filesystem?: {
|
|
50
|
+
readonly basis: "platform-contract";
|
|
51
|
+
readonly strictDirectoryDurability: "platform-supported" | "platform-unsupported";
|
|
52
|
+
};
|
|
53
|
+
readonly transactionState: "corrupt" | "document" | "local-mode" | "none" | "scaffold" | "transition-residue" | "unknown" | "version-mismatch";
|
|
54
|
+
readonly protocolKind?: "document-authoring" | "local-mode" | "scaffolding" | "unknown";
|
|
55
|
+
readonly foundationVersion?: string;
|
|
56
|
+
readonly foundationBuildIdentity?: string;
|
|
57
|
+
readonly recoveryClass: "auto-recoverable" | "manual" | "not-required";
|
|
58
|
+
readonly recoveryCommand?: DocumentRecoveryCommand;
|
|
59
|
+
}
|
|
60
|
+
export interface DocumentRecoverResult {
|
|
61
|
+
readonly kind: "recover";
|
|
62
|
+
readonly transactionState: "already-applied" | "manual-required" | "no-pending-transaction" | "recovered" | "recovery-required" | "cancelled" | "failed";
|
|
63
|
+
readonly writeState: "already-committed" | "committed" | "unchanged" | "unknown";
|
|
64
|
+
readonly recoveryRequired: boolean;
|
|
65
|
+
readonly receiptDigest?: string;
|
|
66
|
+
readonly recoveryCommand?: DocumentRecoveryCommand;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=document-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-command.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/model/document-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,UAAU,GACV,cAAc,CAAC;AAEnB,MAAM,MAAM,sBAAsB,GAC9B,iBAAiB,GACjB,WAAW,GACX,UAAU,GACV,mBAAmB,GACnB,eAAe,GACf,mBAAmB,GACnB,SAAS,GACT,WAAW,CAAC;AAEhB,KAAK,uBAAuB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAEnD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,cAAc,GAAG,kBAAkB,CAAC;IACnE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,GAAG;IACjE,QAAQ,CAAC,SAAS,EAAE,iBAAiB,GAAG,WAAW,CAAC;IACpD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,KAAK,EACV,OAAO,GACP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src/document-authoring/application/model/document-command.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface DocumentPhysicalIdentity {
|
|
2
|
+
readonly adapter: "node-filesystem";
|
|
3
|
+
readonly version: 1;
|
|
4
|
+
readonly dev: string;
|
|
5
|
+
readonly ino: string;
|
|
6
|
+
readonly birthtimeNs: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function assertDocumentPhysicalIdentity(value: unknown): asserts value is DocumentPhysicalIdentity;
|
|
9
|
+
export declare function assertNonzeroDocumentPhysicalIdentity(value: unknown): asserts value is DocumentPhysicalIdentity;
|
|
10
|
+
//# sourceMappingURL=document-physical-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-physical-identity.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/model/document-physical-identity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAID,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,wBAAwB,CAsB3C;AAED,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,wBAAwB,CAW3C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const DECIMAL_IDENTITY_COMPONENT = /^(?:0|[1-9][0-9]{0,31})$/u;
|
|
2
|
+
export function assertDocumentPhysicalIdentity(value) {
|
|
3
|
+
if (typeof value !== "object" ||
|
|
4
|
+
value === null ||
|
|
5
|
+
Array.isArray(value)) {
|
|
6
|
+
throw new Error("Document physical identity is not an object.");
|
|
7
|
+
}
|
|
8
|
+
const candidate = value;
|
|
9
|
+
if (Reflect.ownKeys(candidate).length !== 5 ||
|
|
10
|
+
candidate.adapter !== "node-filesystem" ||
|
|
11
|
+
candidate.version !== 1 ||
|
|
12
|
+
![
|
|
13
|
+
candidate.dev,
|
|
14
|
+
candidate.ino,
|
|
15
|
+
candidate.birthtimeNs
|
|
16
|
+
].every((part) => typeof part === "string" &&
|
|
17
|
+
DECIMAL_IDENTITY_COMPONENT.test(part))) {
|
|
18
|
+
throw new Error("Document physical identity wire evidence is invalid.");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function assertNonzeroDocumentPhysicalIdentity(value) {
|
|
22
|
+
assertDocumentPhysicalIdentity(value);
|
|
23
|
+
if (value.dev === "0" ||
|
|
24
|
+
value.ino === "0" ||
|
|
25
|
+
value.birthtimeNs === "0") {
|
|
26
|
+
throw new Error("Document physical identity contains zero and grants no mutation authority.");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=document-physical-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-physical-identity.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/model/document-physical-identity.ts"],"names":[],"mappings":"AAQA,MAAM,0BAA0B,GAAG,2BAA2B,CAAC;AAE/D,MAAM,UAAU,8BAA8B,CAC5C,KAAc;IAEd,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EACpB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,SAAS,GAAG,KAAgC,CAAC;IACnD,IACE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC;QACvC,SAAS,CAAC,OAAO,KAAK,iBAAiB;QACvC,SAAS,CAAC,OAAO,KAAK,CAAC;QACvB,CAAC;YACC,SAAS,CAAC,GAAG;YACb,SAAS,CAAC,GAAG;YACb,SAAS,CAAC,WAAW;SACtB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ;YACxC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EACxC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,KAAc;IAEd,8BAA8B,CAAC,KAAK,CAAC,CAAC;IACtC,IACE,KAAK,CAAC,GAAG,KAAK,GAAG;QACjB,KAAK,CAAC,GAAG,KAAK,GAAG;QACjB,KAAK,CAAC,WAAW,KAAK,GAAG,EACzB,CAAC;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,CAAC;AACH,CAAC"}
|