@sourcey/catalog-verifier 1.0.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/CHANGELOG.md +3 -0
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/SBOM.cdx.json +177 -0
- package/SECURITY.md +8 -0
- package/SOURCEY-CLOSURE.json +1559 -0
- package/SOURCEY-DISTRIBUTION.json +24 -0
- package/SOURCEY-LICENSE-POLICY.json +5 -0
- package/SOURCEY-TOOLCHAIN.json +8 -0
- package/SUPPORT.md +5 -0
- package/THIRD_PARTY_NOTICES.json +69 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.d.ts +548 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.js +159 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.js.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.d.ts +48 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.js +42 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.js.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration.d.ts +1357 -0
- package/dist/contracts/agent-readiness/src/declaration.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration.js +659 -0
- package/dist/contracts/agent-readiness/src/declaration.js.map +1 -0
- package/dist/contracts/agent-readiness/src/evidence.d.ts +146 -0
- package/dist/contracts/agent-readiness/src/evidence.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/evidence.js +154 -0
- package/dist/contracts/agent-readiness/src/evidence.js.map +1 -0
- package/dist/contracts/agent-readiness/src/index.d.ts +6487 -0
- package/dist/contracts/agent-readiness/src/index.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/index.js +1487 -0
- package/dist/contracts/agent-readiness/src/index.js.map +1 -0
- package/dist/contracts/agent-readiness/src/interaction.d.ts +26 -0
- package/dist/contracts/agent-readiness/src/interaction.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/interaction.js +24 -0
- package/dist/contracts/agent-readiness/src/interaction.js.map +1 -0
- package/dist/contracts/agent-readiness/src/method-pack.d.ts +391 -0
- package/dist/contracts/agent-readiness/src/method-pack.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/method-pack.js +181 -0
- package/dist/contracts/agent-readiness/src/method-pack.js.map +1 -0
- package/dist/contracts/agent-readiness/src/shared.d.ts +119 -0
- package/dist/contracts/agent-readiness/src/shared.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/shared.js +144 -0
- package/dist/contracts/agent-readiness/src/shared.js.map +1 -0
- package/dist/contracts/api/src/index.d.ts +48463 -0
- package/dist/contracts/api/src/index.d.ts.map +1 -0
- package/dist/contracts/api/src/index.js +1150 -0
- package/dist/contracts/api/src/index.js.map +1 -0
- package/dist/contracts/artifact/src/index.d.ts +1467 -0
- package/dist/contracts/artifact/src/index.d.ts.map +1 -0
- package/dist/contracts/artifact/src/index.js +325 -0
- package/dist/contracts/artifact/src/index.js.map +1 -0
- package/dist/contracts/assets/src/index.d.ts +1397 -0
- package/dist/contracts/assets/src/index.d.ts.map +1 -0
- package/dist/contracts/assets/src/index.js +560 -0
- package/dist/contracts/assets/src/index.js.map +1 -0
- package/dist/contracts/authoring/src/index.d.ts +1084 -0
- package/dist/contracts/authoring/src/index.d.ts.map +1 -0
- package/dist/contracts/authoring/src/index.js +211 -0
- package/dist/contracts/authoring/src/index.js.map +1 -0
- package/dist/contracts/authority/src/index.d.ts +135 -0
- package/dist/contracts/authority/src/index.d.ts.map +1 -0
- package/dist/contracts/authority/src/index.js +130 -0
- package/dist/contracts/authority/src/index.js.map +1 -0
- package/dist/contracts/billing/src/index.d.ts +587 -0
- package/dist/contracts/billing/src/index.d.ts.map +1 -0
- package/dist/contracts/billing/src/index.js +322 -0
- package/dist/contracts/billing/src/index.js.map +1 -0
- package/dist/contracts/catalog-verifier/src/index.d.ts +390 -0
- package/dist/contracts/catalog-verifier/src/index.d.ts.map +1 -0
- package/dist/contracts/catalog-verifier/src/index.js +222 -0
- package/dist/contracts/catalog-verifier/src/index.js.map +1 -0
- package/dist/contracts/commercial-work/src/index.d.ts +835 -0
- package/dist/contracts/commercial-work/src/index.d.ts.map +1 -0
- package/dist/contracts/commercial-work/src/index.js +510 -0
- package/dist/contracts/commercial-work/src/index.js.map +1 -0
- package/dist/contracts/events/src/index.d.ts +700 -0
- package/dist/contracts/events/src/index.d.ts.map +1 -0
- package/dist/contracts/events/src/index.js +553 -0
- package/dist/contracts/events/src/index.js.map +1 -0
- package/dist/contracts/evidence/src/index.d.ts +487 -0
- package/dist/contracts/evidence/src/index.d.ts.map +1 -0
- package/dist/contracts/evidence/src/index.js +342 -0
- package/dist/contracts/evidence/src/index.js.map +1 -0
- package/dist/contracts/feed/src/index.d.ts +159 -0
- package/dist/contracts/feed/src/index.d.ts.map +1 -0
- package/dist/contracts/feed/src/index.js +79 -0
- package/dist/contracts/feed/src/index.js.map +1 -0
- package/dist/contracts/funded-work/src/index.d.ts +64 -0
- package/dist/contracts/funded-work/src/index.d.ts.map +1 -0
- package/dist/contracts/funded-work/src/index.js +67 -0
- package/dist/contracts/funded-work/src/index.js.map +1 -0
- package/dist/contracts/observations/src/index.d.ts +134 -0
- package/dist/contracts/observations/src/index.d.ts.map +1 -0
- package/dist/contracts/observations/src/index.js +112 -0
- package/dist/contracts/observations/src/index.js.map +1 -0
- package/dist/contracts/policies/src/index.d.ts +151 -0
- package/dist/contracts/policies/src/index.d.ts.map +1 -0
- package/dist/contracts/policies/src/index.js +121 -0
- package/dist/contracts/policies/src/index.js.map +1 -0
- package/dist/contracts/publication/src/index.d.ts +4066 -0
- package/dist/contracts/publication/src/index.d.ts.map +1 -0
- package/dist/contracts/publication/src/index.js +535 -0
- package/dist/contracts/publication/src/index.js.map +1 -0
- package/dist/contracts/release/src/index.d.ts +2032 -0
- package/dist/contracts/release/src/index.d.ts.map +1 -0
- package/dist/contracts/release/src/index.js +252 -0
- package/dist/contracts/release/src/index.js.map +1 -0
- package/dist/contracts/revisions/src/index.d.ts +1405 -0
- package/dist/contracts/revisions/src/index.d.ts.map +1 -0
- package/dist/contracts/revisions/src/index.js +493 -0
- package/dist/contracts/revisions/src/index.js.map +1 -0
- package/dist/contracts/routes/src/index.d.ts +103 -0
- package/dist/contracts/routes/src/index.d.ts.map +1 -0
- package/dist/contracts/routes/src/index.js +163 -0
- package/dist/contracts/routes/src/index.js.map +1 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.d.ts +2 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.d.ts.map +1 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.js +56 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.js.map +1 -0
- package/dist/contracts/standards/src/index.d.ts +1482 -0
- package/dist/contracts/standards/src/index.d.ts.map +1 -0
- package/dist/contracts/standards/src/index.js +626 -0
- package/dist/contracts/standards/src/index.js.map +1 -0
- package/dist/contracts/taxonomy/src/index.d.ts +7 -0
- package/dist/contracts/taxonomy/src/index.d.ts.map +1 -0
- package/dist/contracts/taxonomy/src/index.js +25 -0
- package/dist/contracts/taxonomy/src/index.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.d.ts +20 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.js +604 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.d.ts +249 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.js +470 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/grading.d.ts +39 -0
- package/dist/modules/agent-readiness-policy/src/grading.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/grading.js +40 -0
- package/dist/modules/agent-readiness-policy/src/grading.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/impact.d.ts +103 -0
- package/dist/modules/agent-readiness-policy/src/impact.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/impact.js +249 -0
- package/dist/modules/agent-readiness-policy/src/impact.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/index.d.ts +811 -0
- package/dist/modules/agent-readiness-policy/src/index.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/index.js +499 -0
- package/dist/modules/agent-readiness-policy/src/index.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.d.ts +12 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.js +65 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.d.ts +4 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.js +59 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.d.ts +3 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.js +12 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/revision.d.ts +4 -0
- package/dist/modules/agent-readiness-policy/src/revision.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/revision.js +46 -0
- package/dist/modules/agent-readiness-policy/src/revision.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.d.ts +7 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.js +13 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.d.ts +36 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.js +214 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/admission.d.ts +35 -0
- package/dist/modules/agent-readiness-repository/src/admission.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/admission.js +56 -0
- package/dist/modules/agent-readiness-repository/src/admission.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/change.d.ts +62 -0
- package/dist/modules/agent-readiness-repository/src/change.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/change.js +218 -0
- package/dist/modules/agent-readiness-repository/src/change.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.d.ts +29 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.js +126 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/index.d.ts +102 -0
- package/dist/modules/agent-readiness-repository/src/index.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/index.js +208 -0
- package/dist/modules/agent-readiness-repository/src/index.js.map +1 -0
- package/dist/modules/artifact/src/agent-readiness-closure.d.ts +24 -0
- package/dist/modules/artifact/src/agent-readiness-closure.d.ts.map +1 -0
- package/dist/modules/artifact/src/agent-readiness-closure.js +98 -0
- package/dist/modules/artifact/src/agent-readiness-closure.js.map +1 -0
- package/dist/modules/artifact/src/asset-closure.d.ts +12 -0
- package/dist/modules/artifact/src/asset-closure.d.ts.map +1 -0
- package/dist/modules/artifact/src/asset-closure.js +40 -0
- package/dist/modules/artifact/src/asset-closure.js.map +1 -0
- package/dist/modules/artifact/src/authoring-closure.d.ts +4 -0
- package/dist/modules/artifact/src/authoring-closure.d.ts.map +1 -0
- package/dist/modules/artifact/src/authoring-closure.js +19 -0
- package/dist/modules/artifact/src/authoring-closure.js.map +1 -0
- package/dist/modules/artifact/src/index.d.ts +46 -0
- package/dist/modules/artifact/src/index.d.ts.map +1 -0
- package/dist/modules/artifact/src/index.js +563 -0
- package/dist/modules/artifact/src/index.js.map +1 -0
- package/dist/modules/artifact/src/trust-history.d.ts +3 -0
- package/dist/modules/artifact/src/trust-history.d.ts.map +1 -0
- package/dist/modules/artifact/src/trust-history.js +134 -0
- package/dist/modules/artifact/src/trust-history.js.map +1 -0
- package/dist/modules/assets/src/authority-bundle.d.ts +36 -0
- package/dist/modules/assets/src/authority-bundle.d.ts.map +1 -0
- package/dist/modules/assets/src/authority-bundle.js +206 -0
- package/dist/modules/assets/src/authority-bundle.js.map +1 -0
- package/dist/modules/assets/src/delta.d.ts +18 -0
- package/dist/modules/assets/src/delta.d.ts.map +1 -0
- package/dist/modules/assets/src/delta.js +183 -0
- package/dist/modules/assets/src/delta.js.map +1 -0
- package/dist/modules/assets/src/disposition.d.ts +3 -0
- package/dist/modules/assets/src/disposition.d.ts.map +1 -0
- package/dist/modules/assets/src/disposition.js +30 -0
- package/dist/modules/assets/src/disposition.js.map +1 -0
- package/dist/modules/assets/src/index.d.ts +25 -0
- package/dist/modules/assets/src/index.d.ts.map +1 -0
- package/dist/modules/assets/src/index.js +234 -0
- package/dist/modules/assets/src/index.js.map +1 -0
- package/dist/modules/assets/src/ingestion.d.ts +69 -0
- package/dist/modules/assets/src/ingestion.d.ts.map +1 -0
- package/dist/modules/assets/src/ingestion.js +169 -0
- package/dist/modules/assets/src/ingestion.js.map +1 -0
- package/dist/modules/authority/src/index.d.ts +47 -0
- package/dist/modules/authority/src/index.d.ts.map +1 -0
- package/dist/modules/authority/src/index.js +349 -0
- package/dist/modules/authority/src/index.js.map +1 -0
- package/dist/modules/authority-state/src/index.d.ts +43 -0
- package/dist/modules/authority-state/src/index.d.ts.map +1 -0
- package/dist/modules/authority-state/src/index.js +194 -0
- package/dist/modules/authority-state/src/index.js.map +1 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.d.ts +424 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.js +369 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.js.map +1 -0
- package/dist/modules/catalog-admission/src/index.d.ts +248 -0
- package/dist/modules/catalog-admission/src/index.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/index.js +601 -0
- package/dist/modules/catalog-admission/src/index.js.map +1 -0
- package/dist/modules/catalog-admission/src/machine-admission.d.ts +1273 -0
- package/dist/modules/catalog-admission/src/machine-admission.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/machine-admission.js +529 -0
- package/dist/modules/catalog-admission/src/machine-admission.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-assets.d.ts +5 -0
- package/dist/modules/catalog-admission/src/publication-assets.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-assets.js +26 -0
- package/dist/modules/catalog-admission/src/publication-assets.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.d.ts +96 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.js +177 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-entities.d.ts +9 -0
- package/dist/modules/catalog-admission/src/publication-entities.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-entities.js +48 -0
- package/dist/modules/catalog-admission/src/publication-entities.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.d.ts +42 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.js +163 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication.d.ts +92 -0
- package/dist/modules/catalog-admission/src/publication.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication.js +605 -0
- package/dist/modules/catalog-admission/src/publication.js.map +1 -0
- package/dist/modules/catalog-admission/src/submission.d.ts +47 -0
- package/dist/modules/catalog-admission/src/submission.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/submission.js +289 -0
- package/dist/modules/catalog-admission/src/submission.js.map +1 -0
- package/dist/modules/catalog-authoring-validation/src/index.d.ts +46 -0
- package/dist/modules/catalog-authoring-validation/src/index.d.ts.map +1 -0
- package/dist/modules/catalog-authoring-validation/src/index.js +98 -0
- package/dist/modules/catalog-authoring-validation/src/index.js.map +1 -0
- package/dist/modules/catalog-model/src/index.d.ts +26 -0
- package/dist/modules/catalog-model/src/index.d.ts.map +1 -0
- package/dist/modules/catalog-model/src/index.js +80 -0
- package/dist/modules/catalog-model/src/index.js.map +1 -0
- package/dist/modules/cli/src/index.d.ts +10 -0
- package/dist/modules/cli/src/index.d.ts.map +1 -0
- package/dist/modules/cli/src/index.js +31 -0
- package/dist/modules/cli/src/index.js.map +1 -0
- package/dist/modules/compiler/src/index.d.ts +23 -0
- package/dist/modules/compiler/src/index.d.ts.map +1 -0
- package/dist/modules/compiler/src/index.js +75 -0
- package/dist/modules/compiler/src/index.js.map +1 -0
- package/dist/modules/evidence-operations/src/dependency-versions.d.ts +2 -0
- package/dist/modules/evidence-operations/src/dependency-versions.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/dependency-versions.js +17 -0
- package/dist/modules/evidence-operations/src/dependency-versions.js.map +1 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.d.ts +111 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.js +309 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.js.map +1 -0
- package/dist/modules/evidence-operations/src/proof-graph.d.ts +22 -0
- package/dist/modules/evidence-operations/src/proof-graph.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/proof-graph.js +188 -0
- package/dist/modules/evidence-operations/src/proof-graph.js.map +1 -0
- package/dist/modules/evidence-operations/src/source-authority.d.ts +31 -0
- package/dist/modules/evidence-operations/src/source-authority.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/source-authority.js +60 -0
- package/dist/modules/evidence-operations/src/source-authority.js.map +1 -0
- package/dist/modules/evidence-operations/src/submission-verifier.d.ts +318 -0
- package/dist/modules/evidence-operations/src/submission-verifier.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/submission-verifier.js +392 -0
- package/dist/modules/evidence-operations/src/submission-verifier.js.map +1 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.d.ts +3 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.js +7 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.js.map +1 -0
- package/dist/modules/primitives/src/index.d.ts +40 -0
- package/dist/modules/primitives/src/index.d.ts.map +1 -0
- package/dist/modules/primitives/src/index.js +154 -0
- package/dist/modules/primitives/src/index.js.map +1 -0
- package/dist/modules/provenance/src/evidence-bindings.d.ts +10 -0
- package/dist/modules/provenance/src/evidence-bindings.d.ts.map +1 -0
- package/dist/modules/provenance/src/evidence-bindings.js +49 -0
- package/dist/modules/provenance/src/evidence-bindings.js.map +1 -0
- package/dist/modules/provenance/src/evidence-coverage.d.ts +35 -0
- package/dist/modules/provenance/src/evidence-coverage.d.ts.map +1 -0
- package/dist/modules/provenance/src/evidence-coverage.js +131 -0
- package/dist/modules/provenance/src/evidence-coverage.js.map +1 -0
- package/dist/modules/provenance/src/index.d.ts +68 -0
- package/dist/modules/provenance/src/index.d.ts.map +1 -0
- package/dist/modules/provenance/src/index.js +536 -0
- package/dist/modules/provenance/src/index.js.map +1 -0
- package/dist/modules/provenance/src/material-claims.d.ts +381 -0
- package/dist/modules/provenance/src/material-claims.d.ts.map +1 -0
- package/dist/modules/provenance/src/material-claims.js +375 -0
- package/dist/modules/provenance/src/material-claims.js.map +1 -0
- package/dist/modules/provenance/src/prospective-evidence.d.ts +6 -0
- package/dist/modules/provenance/src/prospective-evidence.d.ts.map +1 -0
- package/dist/modules/provenance/src/prospective-evidence.js +61 -0
- package/dist/modules/provenance/src/prospective-evidence.js.map +1 -0
- package/dist/modules/release/src/asset-delta-verifier.d.ts +12 -0
- package/dist/modules/release/src/asset-delta-verifier.d.ts.map +1 -0
- package/dist/modules/release/src/asset-delta-verifier.js +82 -0
- package/dist/modules/release/src/asset-delta-verifier.js.map +1 -0
- package/dist/modules/release/src/changes.d.ts +23 -0
- package/dist/modules/release/src/changes.d.ts.map +1 -0
- package/dist/modules/release/src/changes.js +389 -0
- package/dist/modules/release/src/changes.js.map +1 -0
- package/dist/modules/release/src/identity.d.ts +17 -0
- package/dist/modules/release/src/identity.d.ts.map +1 -0
- package/dist/modules/release/src/identity.js +433 -0
- package/dist/modules/release/src/identity.js.map +1 -0
- package/dist/modules/release/src/inputs.d.ts +89 -0
- package/dist/modules/release/src/inputs.d.ts.map +1 -0
- package/dist/modules/release/src/inputs.js +514 -0
- package/dist/modules/release/src/inputs.js.map +1 -0
- package/dist/modules/release/src/publication-inputs.d.ts +9 -0
- package/dist/modules/release/src/publication-inputs.d.ts.map +1 -0
- package/dist/modules/release/src/publication-inputs.js +67 -0
- package/dist/modules/release/src/publication-inputs.js.map +1 -0
- package/dist/modules/release/src/release-directory-files.d.ts +7 -0
- package/dist/modules/release/src/release-directory-files.d.ts.map +1 -0
- package/dist/modules/release/src/release-directory-files.js +49 -0
- package/dist/modules/release/src/release-directory-files.js.map +1 -0
- package/dist/modules/release/src/release-revision-parser.d.ts +5 -0
- package/dist/modules/release/src/release-revision-parser.d.ts.map +1 -0
- package/dist/modules/release/src/release-revision-parser.js +19 -0
- package/dist/modules/release/src/release-revision-parser.js.map +1 -0
- package/dist/modules/release/src/transition.d.ts +36 -0
- package/dist/modules/release/src/transition.d.ts.map +1 -0
- package/dist/modules/release/src/transition.js +263 -0
- package/dist/modules/release/src/transition.js.map +1 -0
- package/dist/modules/release/src/verification-policies.d.ts +278 -0
- package/dist/modules/release/src/verification-policies.d.ts.map +1 -0
- package/dist/modules/release/src/verification-policies.js +38 -0
- package/dist/modules/release/src/verification-policies.js.map +1 -0
- package/dist/modules/release/src/verification-transitions.d.ts +14 -0
- package/dist/modules/release/src/verification-transitions.d.ts.map +1 -0
- package/dist/modules/release/src/verification-transitions.js +26 -0
- package/dist/modules/release/src/verification-transitions.js.map +1 -0
- package/dist/modules/release/src/verifier.d.ts +41 -0
- package/dist/modules/release/src/verifier.d.ts.map +1 -0
- package/dist/modules/release/src/verifier.js +577 -0
- package/dist/modules/release/src/verifier.js.map +1 -0
- package/dist/modules/standard-adapter-runtime/src/index.d.ts +16 -0
- package/dist/modules/standard-adapter-runtime/src/index.d.ts.map +1 -0
- package/dist/modules/standard-adapter-runtime/src/index.js +43 -0
- package/dist/modules/standard-adapter-runtime/src/index.js.map +1 -0
- package/dist/modules/standard-evidence/src/index.d.ts +33 -0
- package/dist/modules/standard-evidence/src/index.d.ts.map +1 -0
- package/dist/modules/standard-evidence/src/index.js +149 -0
- package/dist/modules/standard-evidence/src/index.js.map +1 -0
- package/dist/packages/catalog-verifier/src/application.d.ts +89 -0
- package/dist/packages/catalog-verifier/src/application.d.ts.map +1 -0
- package/dist/packages/catalog-verifier/src/application.js +363 -0
- package/dist/packages/catalog-verifier/src/application.js.map +1 -0
- package/dist/packages/catalog-verifier/src/index.d.ts +7 -0
- package/dist/packages/catalog-verifier/src/index.d.ts.map +1 -0
- package/dist/packages/catalog-verifier/src/index.js +7 -0
- package/dist/packages/catalog-verifier/src/index.js.map +1 -0
- package/dist/packages/catalog-verifier/src/program.d.ts +4 -0
- package/dist/packages/catalog-verifier/src/program.d.ts.map +1 -0
- package/dist/packages/catalog-verifier/src/program.js +203 -0
- package/dist/packages/catalog-verifier/src/program.js.map +1 -0
- package/package.json +63 -0
- package/sourcey-catalog-verify.js +7 -0
- package/taxonomy.json +29 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AGENT_READINESS_REPOSITORY, type AgentReadinessPolicy } from "../../../contracts/agent-readiness/src/index.js";
|
|
2
|
+
import { type Digest } from "../../primitives/src/index.js";
|
|
3
|
+
import { type AgentReadinessDeclarationBlob } from "./declaration-blob.js";
|
|
4
|
+
export type AgentReadinessDeclarationDelta = {
|
|
5
|
+
readonly kind: "declaration_added";
|
|
6
|
+
readonly declarationId: string;
|
|
7
|
+
readonly currentRevisionDigest: Digest;
|
|
8
|
+
readonly changedNodeKeys: readonly string[];
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: "declaration_changed";
|
|
11
|
+
readonly declarationId: string;
|
|
12
|
+
readonly priorRevisionDigest: Digest;
|
|
13
|
+
readonly currentRevisionDigest: Digest;
|
|
14
|
+
readonly changedNodeKeys: readonly string[];
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: "declaration_removed";
|
|
17
|
+
readonly declarationId: string;
|
|
18
|
+
readonly priorRevisionDigest: Digest;
|
|
19
|
+
readonly changedNodeKeys: readonly string[];
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "declaration_unchanged";
|
|
22
|
+
readonly declarationId: string;
|
|
23
|
+
readonly revisionDigest: Digest;
|
|
24
|
+
readonly changedNodeKeys: readonly [];
|
|
25
|
+
};
|
|
26
|
+
export interface AgentReadinessRepositoryPathDelta {
|
|
27
|
+
readonly status: "added" | "modified" | "removed";
|
|
28
|
+
readonly path: string;
|
|
29
|
+
readonly base: AgentReadinessDeclarationBlob | null;
|
|
30
|
+
readonly head: AgentReadinessDeclarationBlob | null;
|
|
31
|
+
readonly entitySubjectChanged: boolean;
|
|
32
|
+
readonly declarations: readonly AgentReadinessDeclarationDelta[];
|
|
33
|
+
}
|
|
34
|
+
export interface AgentReadinessRepositoryChangePacket {
|
|
35
|
+
readonly change_contract: "sourcey.agent-readiness-repository-change/v1alpha1";
|
|
36
|
+
readonly repository: typeof AGENT_READINESS_REPOSITORY;
|
|
37
|
+
readonly comparisonBase: string;
|
|
38
|
+
readonly baseRootTreeOid: string;
|
|
39
|
+
readonly baseEntitiesTreeOid: string | null;
|
|
40
|
+
readonly headRevision: string;
|
|
41
|
+
readonly headRootTreeOid: string;
|
|
42
|
+
readonly headEntitiesTreeOid: string | null;
|
|
43
|
+
readonly paths: readonly AgentReadinessRepositoryPathDelta[];
|
|
44
|
+
readonly packetDigest: Digest;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Exact ordinary-change intake. Work is proportional to changed blobs and never
|
|
48
|
+
* constructs the recursive entities manifest retained by explicit cohort audits.
|
|
49
|
+
*/
|
|
50
|
+
export declare function inspectAgentReadinessRepositoryChangePacket(input: {
|
|
51
|
+
readonly repositoryRoot: string;
|
|
52
|
+
readonly baseRevision: string;
|
|
53
|
+
readonly headRevision: string;
|
|
54
|
+
readonly policy: AgentReadinessPolicy;
|
|
55
|
+
}): Promise<AgentReadinessRepositoryChangePacket>;
|
|
56
|
+
export declare function verifyAgentReadinessRepositoryChangePacket(input: {
|
|
57
|
+
readonly packet: AgentReadinessRepositoryChangePacket;
|
|
58
|
+
readonly repositoryRoot: string;
|
|
59
|
+
readonly policy: AgentReadinessPolicy;
|
|
60
|
+
}): Promise<void>;
|
|
61
|
+
export declare function selectedAgentReadinessDeclarationDeltas(packet: AgentReadinessRepositoryChangePacket): readonly AgentReadinessDeclarationDelta[];
|
|
62
|
+
//# sourceMappingURL=change.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../../../../modules/agent-readiness-repository/src/change.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAE1B,KAAK,oBAAoB,EAC1B,MAAM,iDAAiD,CAAC;AAGzD,OAAO,EAGL,KAAK,MAAM,EAEZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,uBAAuB,CAAC;AAI/B,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
import { AGENT_READINESS_REPOSITORY, } from "../../../contracts/agent-readiness/src/index.js";
|
|
5
|
+
import { assertAgentReadinessDeclarationPolicyClosure } from "../../agent-readiness-policy/src/index.js";
|
|
6
|
+
import { catalogPullRequestComparisonBase } from "../../catalog-admission/src/index.js";
|
|
7
|
+
import { canonicalJson, compareCanonicalStrings, digest, } from "../../primitives/src/index.js";
|
|
8
|
+
import { readAgentReadinessDeclarationBlobAtRevision, } from "./declaration-blob.js";
|
|
9
|
+
const executeFile = promisify(execFile);
|
|
10
|
+
/**
|
|
11
|
+
* Exact ordinary-change intake. Work is proportional to changed blobs and never
|
|
12
|
+
* constructs the recursive entities manifest retained by explicit cohort audits.
|
|
13
|
+
*/
|
|
14
|
+
export async function inspectAgentReadinessRepositoryChangePacket(input) {
|
|
15
|
+
const repositoryRoot = resolve(input.repositoryRoot);
|
|
16
|
+
const comparisonBase = await catalogPullRequestComparisonBase(input);
|
|
17
|
+
const changed = await changedRepositoryPaths(repositoryRoot, comparisonBase, input.headRevision);
|
|
18
|
+
const entityPaths = changed.filter(({ path }) => path.startsWith("entities/"));
|
|
19
|
+
const otherPaths = changed.filter(({ path }) => !path.startsWith("entities/"));
|
|
20
|
+
if (entityPaths.length > 0 && otherPaths.length > 0) {
|
|
21
|
+
throw new Error(`Agent Readiness declaration changes cannot be mixed with other repository paths: ${otherPaths
|
|
22
|
+
.map(({ path }) => path)
|
|
23
|
+
.join(", ")}.`);
|
|
24
|
+
}
|
|
25
|
+
const [headRevision, baseRootTreeOid, baseEntitiesTreeOid] = await Promise.all([
|
|
26
|
+
resolveGitObject(repositoryRoot, `${input.headRevision}^{commit}`),
|
|
27
|
+
resolveGitObject(repositoryRoot, `${comparisonBase}^{tree}`),
|
|
28
|
+
resolveOptionalGitObject(repositoryRoot, `${comparisonBase}:entities`),
|
|
29
|
+
]);
|
|
30
|
+
const pathStatuses = validateEntityPaths(entityPaths);
|
|
31
|
+
const [headRootTreeOid, headEntitiesTreeOid] = await Promise.all([
|
|
32
|
+
resolveGitObject(repositoryRoot, `${headRevision}^{tree}`),
|
|
33
|
+
resolveOptionalGitObject(repositoryRoot, `${headRevision}:entities`),
|
|
34
|
+
]);
|
|
35
|
+
const paths = await Promise.all(pathStatuses.map(async ({ status, path }) => {
|
|
36
|
+
const file = path.slice("entities/".length);
|
|
37
|
+
const [base, head] = await Promise.all([
|
|
38
|
+
status === "added"
|
|
39
|
+
? null
|
|
40
|
+
: readAgentReadinessDeclarationBlobAtRevision(repositoryRoot, comparisonBase, file),
|
|
41
|
+
status === "removed"
|
|
42
|
+
? null
|
|
43
|
+
: readAgentReadinessDeclarationBlobAtRevision(repositoryRoot, headRevision, file),
|
|
44
|
+
]);
|
|
45
|
+
assertBlobPolicy(base, input.policy);
|
|
46
|
+
assertBlobPolicy(head, input.policy);
|
|
47
|
+
return pathDelta(status, path, base, head);
|
|
48
|
+
}));
|
|
49
|
+
const core = {
|
|
50
|
+
change_contract: "sourcey.agent-readiness-repository-change/v1alpha1",
|
|
51
|
+
repository: AGENT_READINESS_REPOSITORY,
|
|
52
|
+
comparisonBase,
|
|
53
|
+
baseRootTreeOid,
|
|
54
|
+
baseEntitiesTreeOid,
|
|
55
|
+
headRevision,
|
|
56
|
+
headRootTreeOid,
|
|
57
|
+
headEntitiesTreeOid,
|
|
58
|
+
paths: paths.sort((left, right) => compareCanonicalStrings(left.path, right.path)),
|
|
59
|
+
};
|
|
60
|
+
return { ...core, packetDigest: digest(core) };
|
|
61
|
+
}
|
|
62
|
+
export async function verifyAgentReadinessRepositoryChangePacket(input) {
|
|
63
|
+
const verified = await inspectAgentReadinessRepositoryChangePacket({
|
|
64
|
+
repositoryRoot: input.repositoryRoot,
|
|
65
|
+
baseRevision: input.packet.comparisonBase,
|
|
66
|
+
headRevision: input.packet.headRevision,
|
|
67
|
+
policy: input.policy,
|
|
68
|
+
});
|
|
69
|
+
if (canonicalJson(verified) !== canonicalJson(input.packet)) {
|
|
70
|
+
throw new Error("Agent Readiness repository-change packet failed exact Git readback.");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export function selectedAgentReadinessDeclarationDeltas(packet) {
|
|
74
|
+
return packet.paths.flatMap((path) => path.declarations.filter((delta) => path.entitySubjectChanged || delta.kind !== "declaration_unchanged"));
|
|
75
|
+
}
|
|
76
|
+
function pathDelta(status, path, base, head) {
|
|
77
|
+
const prior = base?.declarationRevisions ?? {};
|
|
78
|
+
const current = head?.declarationRevisions ?? {};
|
|
79
|
+
const ids = [...new Set([...Object.keys(prior), ...Object.keys(current)])].sort(compareCanonicalStrings);
|
|
80
|
+
const declarations = ids.map((declarationId) => {
|
|
81
|
+
const before = prior[declarationId];
|
|
82
|
+
const after = current[declarationId];
|
|
83
|
+
if (!before && after) {
|
|
84
|
+
return {
|
|
85
|
+
kind: "declaration_added",
|
|
86
|
+
declarationId,
|
|
87
|
+
currentRevisionDigest: after.revision_digest,
|
|
88
|
+
changedNodeKeys: revisionNodeKeys(after),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (before && !after) {
|
|
92
|
+
return {
|
|
93
|
+
kind: "declaration_removed",
|
|
94
|
+
declarationId,
|
|
95
|
+
priorRevisionDigest: before.revision_digest,
|
|
96
|
+
changedNodeKeys: revisionNodeKeys(before),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (!before || !after)
|
|
100
|
+
throw new Error("Declaration delta is incomplete.");
|
|
101
|
+
if (before.revision_digest === after.revision_digest) {
|
|
102
|
+
return {
|
|
103
|
+
kind: "declaration_unchanged",
|
|
104
|
+
declarationId,
|
|
105
|
+
revisionDigest: after.revision_digest,
|
|
106
|
+
changedNodeKeys: [],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
kind: "declaration_changed",
|
|
111
|
+
declarationId,
|
|
112
|
+
priorRevisionDigest: before.revision_digest,
|
|
113
|
+
currentRevisionDigest: after.revision_digest,
|
|
114
|
+
changedNodeKeys: changedRevisionNodeKeys(before, after),
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
return {
|
|
118
|
+
status,
|
|
119
|
+
path,
|
|
120
|
+
base,
|
|
121
|
+
head,
|
|
122
|
+
entitySubjectChanged: base === null || head === null || digest(entitySubject(base)) !== digest(entitySubject(head)),
|
|
123
|
+
declarations,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function entitySubject(blob) {
|
|
127
|
+
return blob.authoring.entity;
|
|
128
|
+
}
|
|
129
|
+
function revisionNodeKeys(revision) {
|
|
130
|
+
return [...revisionNodes(revision).keys()].sort(compareCanonicalStrings);
|
|
131
|
+
}
|
|
132
|
+
function changedRevisionNodeKeys(before, after) {
|
|
133
|
+
const beforeNodes = revisionNodes(before);
|
|
134
|
+
const afterNodes = revisionNodes(after);
|
|
135
|
+
return [...new Set([...beforeNodes.keys(), ...afterNodes.keys()])]
|
|
136
|
+
.filter((key) => beforeNodes.get(key) !== afterNodes.get(key))
|
|
137
|
+
.sort(compareCanonicalStrings);
|
|
138
|
+
}
|
|
139
|
+
function revisionNodes(revision) {
|
|
140
|
+
const declaration = revision.declaration;
|
|
141
|
+
return new Map([
|
|
142
|
+
["declaration.identity", digest(declaration.declaration_id)],
|
|
143
|
+
["declaration.scope", digest(declaration.scope)],
|
|
144
|
+
["declaration.authority_intent", digest(declaration.authority_intent)],
|
|
145
|
+
["declaration.declared_at", digest(declaration.declared_at)],
|
|
146
|
+
...keyedNodes("assessment_target", declaration.assessment_targets, "target_id"),
|
|
147
|
+
...keyedNodes("participant", declaration.participants, "participant_id"),
|
|
148
|
+
...keyedNodes("resource", declaration.resources, "resource_id"),
|
|
149
|
+
...keyedNodes("endpoint", declaration.endpoints, "endpoint_id"),
|
|
150
|
+
...keyedNodes("interface", declaration.interfaces, "interface_id"),
|
|
151
|
+
...keyedNodes("relation", declaration.relations, "relation_id"),
|
|
152
|
+
...keyedNodes("source_binding", declaration.source_bindings, "source_binding_id"),
|
|
153
|
+
...keyedNodes("surface_exclusion", declaration.surface_exclusions, "exclusion_id"),
|
|
154
|
+
...keyedNodes("source", revision.sources, "source_id"),
|
|
155
|
+
]);
|
|
156
|
+
}
|
|
157
|
+
function keyedNodes(kind, values, identity) {
|
|
158
|
+
return values.map((value) => [`declaration.${kind}.${value[identity]}`, digest(value)]);
|
|
159
|
+
}
|
|
160
|
+
async function changedRepositoryPaths(repositoryRoot, baseRevision, headRevision) {
|
|
161
|
+
const { stdout } = await executeFile("git", ["diff", "--name-status", "-z", "--no-renames", baseRevision, headRevision], { cwd: repositoryRoot, encoding: "buffer", maxBuffer: 4 * 1024 * 1024 });
|
|
162
|
+
const fields = stdout.toString("utf8").split("\0").filter(Boolean);
|
|
163
|
+
if (fields.length % 2 !== 0)
|
|
164
|
+
throw new Error("Agent Readiness Git path delta is malformed.");
|
|
165
|
+
const paths = [];
|
|
166
|
+
for (let index = 0; index < fields.length; index += 2) {
|
|
167
|
+
const code = fields[index];
|
|
168
|
+
const path = fields[index + 1];
|
|
169
|
+
if (!path)
|
|
170
|
+
throw new Error("Agent Readiness change contains an invalid path.");
|
|
171
|
+
const status = code === "A" ? "added" : code === "M" ? "modified" : code === "D" ? "removed" : null;
|
|
172
|
+
if (!status)
|
|
173
|
+
throw new Error(`Agent Readiness change has unsupported Git status ${code}.`);
|
|
174
|
+
paths.push({ status, path });
|
|
175
|
+
}
|
|
176
|
+
return paths.sort((left, right) => compareCanonicalStrings(left.path, right.path));
|
|
177
|
+
}
|
|
178
|
+
function validateEntityPaths(paths) {
|
|
179
|
+
for (const { path } of paths) {
|
|
180
|
+
if (!/^entities\/[a-z0-9]{1,2}\/[a-z0-9]+(?:-[a-z0-9]+)*\.ya?ml$/u.test(path)) {
|
|
181
|
+
throw new Error("Agent Readiness change contains an invalid Entity path.");
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return paths;
|
|
185
|
+
}
|
|
186
|
+
async function resolveGitObject(repositoryRoot, revision) {
|
|
187
|
+
const { stdout } = await executeFile("git", ["rev-parse", revision], {
|
|
188
|
+
cwd: repositoryRoot,
|
|
189
|
+
encoding: "utf8",
|
|
190
|
+
maxBuffer: 1024,
|
|
191
|
+
});
|
|
192
|
+
const oid = stdout.trim();
|
|
193
|
+
if (!/^[a-f0-9]{40,64}$/u.test(oid))
|
|
194
|
+
throw new Error("Git object identity is invalid.");
|
|
195
|
+
return oid;
|
|
196
|
+
}
|
|
197
|
+
async function resolveOptionalGitObject(repositoryRoot, revision) {
|
|
198
|
+
try {
|
|
199
|
+
return await resolveGitObject(repositoryRoot, revision);
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
const candidate = error;
|
|
203
|
+
if (candidate.code === 128 && candidate.stderr?.includes("does not exist"))
|
|
204
|
+
return null;
|
|
205
|
+
if (candidate.code === 128 && candidate.stderr?.includes("exists on disk, but not in")) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
throw error;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function assertBlobPolicy(blob, policy) {
|
|
212
|
+
if (!blob)
|
|
213
|
+
return;
|
|
214
|
+
for (const revision of Object.values(blob.declarationRevisions)) {
|
|
215
|
+
assertAgentReadinessDeclarationPolicyClosure({ declaration: revision.declaration, policy });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=change.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change.js","sourceRoot":"","sources":["../../../../modules/agent-readiness-repository/src/change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,0BAA0B,GAG3B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,4CAA4C,EAAE,MAAM,2CAA2C,CAAC;AACzG,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,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SAAS,CAAC,IAAI,KAAK,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,4BAA4B,CAAC,EAAE,CAAC;YACvF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACvB,IAA0C,EAC1C,MAA4B;IAE5B,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAChE,4CAA4C,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AGENT_READINESS_REPOSITORY, type AgentReadinessAuthoring, type AgentReadinessDeclaration, type AgentReadinessDeclarationRevision } from "../../../contracts/agent-readiness/src/declaration.js";
|
|
2
|
+
import { type Digest } from "../../primitives/src/index.js";
|
|
3
|
+
export interface AgentReadinessDeclarationBlob {
|
|
4
|
+
readonly repository: typeof AGENT_READINESS_REPOSITORY;
|
|
5
|
+
readonly commit: string;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly gitBlobOid: string;
|
|
8
|
+
readonly blobDigest: Digest;
|
|
9
|
+
readonly authoring: AgentReadinessAuthoring;
|
|
10
|
+
readonly declarationRevisions: Readonly<Record<string, AgentReadinessDeclarationRevision>>;
|
|
11
|
+
}
|
|
12
|
+
/** Parse explicit non-Git authoring bytes without manufacturing Git identity. */
|
|
13
|
+
export declare function compileAgentReadinessDeclarationSource(input: {
|
|
14
|
+
readonly source: string;
|
|
15
|
+
readonly content: string;
|
|
16
|
+
}): {
|
|
17
|
+
readonly authoring: AgentReadinessAuthoring;
|
|
18
|
+
readonly declarationRevisions: Readonly<Record<string, AgentReadinessDeclarationRevision>>;
|
|
19
|
+
};
|
|
20
|
+
export declare function readAgentReadinessDeclarationBlobAtRevision(repositoryRoot: string, headRevision: string, file: string): Promise<AgentReadinessDeclarationBlob>;
|
|
21
|
+
export declare function agentReadinessDeclarationRevisionDigest(input: {
|
|
22
|
+
readonly authoring: AgentReadinessAuthoring;
|
|
23
|
+
readonly declaration: AgentReadinessDeclaration;
|
|
24
|
+
}): Digest;
|
|
25
|
+
export declare function compileAgentReadinessDeclarationRevision(input: {
|
|
26
|
+
readonly authoring: AgentReadinessAuthoring;
|
|
27
|
+
readonly declaration: AgentReadinessDeclaration;
|
|
28
|
+
}): AgentReadinessDeclarationRevision;
|
|
29
|
+
//# sourceMappingURL=declaration-blob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaration-blob.d.ts","sourceRoot":"","sources":["../../../../modules/agent-readiness-repository/src/declaration-blob.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,iCAAiC,EAIvC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAEL,KAAK,MAAM,EAGZ,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,UAAU,EAAE,OAAO,0BAA0B,CAAC;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iCAAiC,CAAC,CAAC,CAAC;CAC5F;AAED,iFAAiF;AACjF,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GAAG;IACF,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iCAAiC,CAAC,CAAC,CAAC;CAC5F,CAiBA;AAED,wBAAsB,2CAA2C,CAC/D,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,6BAA6B,CAAC,CA+BxC;AAED,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC7D,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,yBAAyB,CAAC;CACjD,GAAG,MAAM,CAET;AAED,wBAAgB,wCAAwC,CAAC,KAAK,EAAE;IAC9D,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,yBAAyB,CAAC;CACjD,GAAG,iCAAiC,CAoFpC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
import { AGENT_READINESS_REPOSITORY, agentReadinessAuthoringSchema, agentReadinessDeclarationRevisionCoreSchema, agentReadinessDeclarationRevisionSchema, } from "../../../contracts/agent-readiness/src/declaration.js";
|
|
5
|
+
import { compareCanonicalStrings, digest, sha256Bytes, } from "../../primitives/src/index.js";
|
|
6
|
+
const executeFile = promisify(execFile);
|
|
7
|
+
/** Parse explicit non-Git authoring bytes without manufacturing Git identity. */
|
|
8
|
+
export function compileAgentReadinessDeclarationSource(input) {
|
|
9
|
+
const authoring = agentReadinessAuthoringSchema.parse(parseYaml(input.content));
|
|
10
|
+
const expectedPath = `${authoring.entity.slug.slice(0, 2)}/${authoring.entity.slug}.yaml`;
|
|
11
|
+
if (input.source !== expectedPath) {
|
|
12
|
+
throw new Error(`Agent Readiness Entity ${authoring.entity.slug} must live at entities/${expectedPath}.`);
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
authoring,
|
|
16
|
+
declarationRevisions: Object.fromEntries(authoring.declarations.map((declaration) => [
|
|
17
|
+
declaration.declaration_id,
|
|
18
|
+
compileAgentReadinessDeclarationRevision({ authoring, declaration }),
|
|
19
|
+
])),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export async function readAgentReadinessDeclarationBlobAtRevision(repositoryRoot, headRevision, file) {
|
|
23
|
+
const path = `entities/${file}`;
|
|
24
|
+
const [{ stdout: bytes }, { stdout: oidOutput }] = await Promise.all([
|
|
25
|
+
executeFile("git", ["show", `${headRevision}:${path}`], {
|
|
26
|
+
cwd: repositoryRoot,
|
|
27
|
+
encoding: "buffer",
|
|
28
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
29
|
+
}),
|
|
30
|
+
executeFile("git", ["rev-parse", `${headRevision}:${path}`], {
|
|
31
|
+
cwd: repositoryRoot,
|
|
32
|
+
encoding: "utf8",
|
|
33
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
36
|
+
const compiled = compileAgentReadinessDeclarationSource({
|
|
37
|
+
source: file,
|
|
38
|
+
content: bytes.toString("utf8"),
|
|
39
|
+
});
|
|
40
|
+
const gitBlobOid = oidOutput.trim();
|
|
41
|
+
if (!/^[a-f0-9]{40,64}$/u.test(gitBlobOid)) {
|
|
42
|
+
throw new Error(`Agent Readiness declaration ${path} has an invalid Git blob identity.`);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
repository: AGENT_READINESS_REPOSITORY,
|
|
46
|
+
commit: headRevision,
|
|
47
|
+
path,
|
|
48
|
+
gitBlobOid,
|
|
49
|
+
blobDigest: sha256Bytes(bytes),
|
|
50
|
+
authoring: compiled.authoring,
|
|
51
|
+
declarationRevisions: compiled.declarationRevisions,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export function agentReadinessDeclarationRevisionDigest(input) {
|
|
55
|
+
return compileAgentReadinessDeclarationRevision(input).revision_digest;
|
|
56
|
+
}
|
|
57
|
+
export function compileAgentReadinessDeclarationRevision(input) {
|
|
58
|
+
const authoring = agentReadinessAuthoringSchema.parse(input.authoring);
|
|
59
|
+
const parsed = agentReadinessAuthoringSchema.shape.declarations.element.parse(input.declaration);
|
|
60
|
+
const standardBindings = (values) => [...values].sort((left, right) => compareCanonicalStrings(`${left.namespace}:${left.version}:${left.relation}`, `${right.namespace}:${right.version}:${right.relation}`));
|
|
61
|
+
const canonicalDeclaration = {
|
|
62
|
+
...parsed,
|
|
63
|
+
assessment_targets: [...parsed.assessment_targets]
|
|
64
|
+
.map((target) => ({
|
|
65
|
+
...target,
|
|
66
|
+
interface_ids: [...target.interface_ids].sort(compareCanonicalStrings),
|
|
67
|
+
}))
|
|
68
|
+
.sort((left, right) => compareCanonicalStrings(left.target_id, right.target_id)),
|
|
69
|
+
participants: [...parsed.participants]
|
|
70
|
+
.map((participant) => ({
|
|
71
|
+
...participant,
|
|
72
|
+
roles: [...participant.roles].sort(compareCanonicalStrings),
|
|
73
|
+
}))
|
|
74
|
+
.sort((left, right) => compareCanonicalStrings(left.participant_id, right.participant_id)),
|
|
75
|
+
resources: [...parsed.resources]
|
|
76
|
+
.map((resource) => ({
|
|
77
|
+
...resource,
|
|
78
|
+
roles: [...resource.roles].sort(compareCanonicalStrings),
|
|
79
|
+
standard_bindings: standardBindings(resource.standard_bindings),
|
|
80
|
+
}))
|
|
81
|
+
.sort((left, right) => compareCanonicalStrings(left.resource_id, right.resource_id)),
|
|
82
|
+
endpoints: [...parsed.endpoints]
|
|
83
|
+
.map((endpoint) => ({
|
|
84
|
+
...endpoint,
|
|
85
|
+
roles: [...endpoint.roles].sort(compareCanonicalStrings),
|
|
86
|
+
standard_bindings: standardBindings(endpoint.standard_bindings),
|
|
87
|
+
}))
|
|
88
|
+
.sort((left, right) => compareCanonicalStrings(left.endpoint_id, right.endpoint_id)),
|
|
89
|
+
interfaces: [...parsed.interfaces]
|
|
90
|
+
.map((declaredInterface) => ({
|
|
91
|
+
...declaredInterface,
|
|
92
|
+
functions: [...declaredInterface.functions].sort(compareCanonicalStrings),
|
|
93
|
+
endpoint_ids: [...declaredInterface.endpoint_ids].sort(compareCanonicalStrings),
|
|
94
|
+
resource_ids: [...declaredInterface.resource_ids].sort(compareCanonicalStrings),
|
|
95
|
+
standard_bindings: standardBindings(declaredInterface.standard_bindings),
|
|
96
|
+
}))
|
|
97
|
+
.sort((left, right) => compareCanonicalStrings(left.interface_id, right.interface_id)),
|
|
98
|
+
relations: [...parsed.relations].sort((left, right) => compareCanonicalStrings(left.relation_id, right.relation_id)),
|
|
99
|
+
surface_exclusions: [...parsed.surface_exclusions].sort((left, right) => compareCanonicalStrings(left.exclusion_id, right.exclusion_id)),
|
|
100
|
+
source_bindings: [...parsed.source_bindings]
|
|
101
|
+
.filter((binding) => binding.target.node_kind !== "offer_relation")
|
|
102
|
+
.map((binding) => ({
|
|
103
|
+
...binding,
|
|
104
|
+
field_paths: [...binding.field_paths].sort(compareCanonicalStrings),
|
|
105
|
+
}))
|
|
106
|
+
.sort((left, right) => compareCanonicalStrings(left.source_binding_id, right.source_binding_id)),
|
|
107
|
+
};
|
|
108
|
+
const { offer_relations: _, ...declaration } = canonicalDeclaration;
|
|
109
|
+
const requiredSourceIds = new Set([
|
|
110
|
+
...declaration.source_bindings.map((binding) => binding.source_id),
|
|
111
|
+
...declaration.participants.flatMap((participant) => "origin_source_id" in participant.identity ? [participant.identity.origin_source_id] : []),
|
|
112
|
+
]);
|
|
113
|
+
const core = agentReadinessDeclarationRevisionCoreSchema.parse({
|
|
114
|
+
revision_contract: "sourcey.agent-readiness-declaration-revision/v1alpha1",
|
|
115
|
+
entity_id: authoring.entity.entity_id,
|
|
116
|
+
declaration,
|
|
117
|
+
sources: authoring.sources
|
|
118
|
+
.filter((source) => requiredSourceIds.has(source.source_id))
|
|
119
|
+
.sort((left, right) => compareCanonicalStrings(left.source_id, right.source_id)),
|
|
120
|
+
});
|
|
121
|
+
return agentReadinessDeclarationRevisionSchema.parse({
|
|
122
|
+
...core,
|
|
123
|
+
revision_digest: digest(core),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=declaration-blob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaration-blob.js","sourceRoot":"","sources":["../../../../modules/agent-readiness-repository/src/declaration-blob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,0BAA0B,EAI1B,6BAA6B,EAC7B,2CAA2C,EAC3C,uCAAuC,GACxC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,uBAAuB,EAEvB,MAAM,EACN,WAAW,GACZ,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAYxC,iFAAiF;AACjF,MAAM,UAAU,sCAAsC,CAAC,KAGtD;IAIC,MAAM,SAAS,GAAG,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC;IAC1F,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,0BAA0B,SAAS,CAAC,MAAM,CAAC,IAAI,0BAA0B,YAAY,GAAG,CACzF,CAAC;IACJ,CA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AAC;QACnD,GAAG,IAAI;QACP,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AGENT_READINESS_REPOSITORY, AGENT_READINESS_REPOSITORY_URL, type AgentReadinessAuthoring, type AgentReadinessDeclaration } from "../../../contracts/agent-readiness/src/declaration.js";
|
|
2
|
+
import type { AgentReadinessPolicy } from "../../../contracts/agent-readiness/src/index.js";
|
|
3
|
+
import { type AgentReadinessDeclarationBlob } from "./declaration-blob.js";
|
|
4
|
+
export * from "./admission.js";
|
|
5
|
+
export * from "./declaration-blob.js";
|
|
6
|
+
export { AGENT_READINESS_REPOSITORY, AGENT_READINESS_REPOSITORY_URL };
|
|
7
|
+
export interface AgentReadinessRepositoryTreeEntry {
|
|
8
|
+
readonly path: string;
|
|
9
|
+
readonly mode: "100644" | "100755" | "120000" | "160000";
|
|
10
|
+
readonly objectType: "blob" | "commit";
|
|
11
|
+
readonly gitObjectOid: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AgentReadinessRepositoryInspection {
|
|
14
|
+
readonly comparisonBase: string;
|
|
15
|
+
readonly headRevision: string;
|
|
16
|
+
readonly entitiesTreeOid: string;
|
|
17
|
+
readonly treeEntries: readonly AgentReadinessRepositoryTreeEntry[];
|
|
18
|
+
readonly entityFiles: readonly string[];
|
|
19
|
+
readonly blobs: readonly AgentReadinessDeclarationBlob[];
|
|
20
|
+
readonly declarations: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Inspect one immutable repository tree for an explicit bootstrap or audit.
|
|
24
|
+
* Ordinary pull-request admission must use the exact repository-change packet
|
|
25
|
+
* so mixed-path and changed-closure rules remain enforced.
|
|
26
|
+
*/
|
|
27
|
+
export declare function inspectAgentReadinessRepositoryTreeAtRevision(input: {
|
|
28
|
+
readonly repositoryRoot: string;
|
|
29
|
+
readonly headRevision: string;
|
|
30
|
+
readonly policy: AgentReadinessPolicy;
|
|
31
|
+
}): Promise<AgentReadinessRepositoryInspection>;
|
|
32
|
+
export declare function validateAgentReadinessRepositoryChange(input: {
|
|
33
|
+
readonly repositoryRoot: string;
|
|
34
|
+
readonly baseRevision: string;
|
|
35
|
+
readonly headRevision: string;
|
|
36
|
+
readonly policy: AgentReadinessPolicy;
|
|
37
|
+
}): Promise<{
|
|
38
|
+
readonly entities: number;
|
|
39
|
+
readonly declarations: number;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Validate explicit non-Git declaration bytes through the same parser,
|
|
43
|
+
* revision compiler, and policy closure used by repository intake.
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateAgentReadinessCandidateSources(input: {
|
|
46
|
+
readonly sources: readonly {
|
|
47
|
+
readonly source: string;
|
|
48
|
+
readonly content: string;
|
|
49
|
+
}[];
|
|
50
|
+
readonly policy: AgentReadinessPolicy;
|
|
51
|
+
}): {
|
|
52
|
+
readonly entities: number;
|
|
53
|
+
readonly declarations: number;
|
|
54
|
+
};
|
|
55
|
+
export declare function inspectAgentReadinessCandidateSources(input: {
|
|
56
|
+
readonly sources: readonly {
|
|
57
|
+
readonly source: string;
|
|
58
|
+
readonly content: string;
|
|
59
|
+
}[];
|
|
60
|
+
readonly policy: AgentReadinessPolicy;
|
|
61
|
+
}): {
|
|
62
|
+
readonly authoring: readonly AgentReadinessAuthoring[];
|
|
63
|
+
readonly summary: {
|
|
64
|
+
readonly entities: number;
|
|
65
|
+
readonly declarations: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Validate the complete current declaration tree with the same canonical
|
|
70
|
+
* parser and policy-closure authority used for changed Git blobs. This is a
|
|
71
|
+
* local/audit adapter only; ordinary PR validation remains changed-closure.
|
|
72
|
+
*/
|
|
73
|
+
export declare function validateAgentReadinessRepositoryTree(input: {
|
|
74
|
+
readonly repositoryRoot: string;
|
|
75
|
+
readonly policy: AgentReadinessPolicy;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
readonly entities: number;
|
|
78
|
+
readonly declarations: number;
|
|
79
|
+
}>;
|
|
80
|
+
export type AgentReadinessCandidateDisposition = {
|
|
81
|
+
readonly status: "ready_for_scope_review";
|
|
82
|
+
readonly declarationAuthority: "community_claimed" | "entity_authority_proven";
|
|
83
|
+
} | {
|
|
84
|
+
readonly status: "held";
|
|
85
|
+
readonly reason: "identity_allocation_required" | "entity_identity_mismatch" | "entity_authority_required";
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Classify only exact identity and claimed authority context. A ready result is
|
|
89
|
+
* still a private scope-review candidate; it is never an observation or grade.
|
|
90
|
+
*/
|
|
91
|
+
export declare function dispositionAgentReadinessDeclaration(input: {
|
|
92
|
+
readonly authoring: AgentReadinessAuthoring;
|
|
93
|
+
readonly declaration: AgentReadinessDeclaration;
|
|
94
|
+
readonly context: {
|
|
95
|
+
readonly entity: {
|
|
96
|
+
readonly entityId: string;
|
|
97
|
+
} | undefined;
|
|
98
|
+
readonly entityAuthorityProven: boolean;
|
|
99
|
+
};
|
|
100
|
+
}): AgentReadinessCandidateDisposition;
|
|
101
|
+
export * from "./change.js";
|
|
102
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../modules/agent-readiness-repository/src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAE/B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAI5F,OAAO,EACL,KAAK,6BAA6B,EAInC,MAAM,uBAAuB,CAAC;AAE/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AAItC,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,CAAC;AAEtE,MAAM,WAAW,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