@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 @@
|
|
|
1
|
+
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../contracts/agent-readiness/src/declaration.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { authoringSourceSchema, entityIdentityAuthoringSchema } from "../../authoring/src/index.js";
|
|
3
|
+
import { catalogAuthoringUrlSchema } from "../../revisions/src/index.js";
|
|
4
|
+
import { standardImplementationBindingSchema } from "../../standards/src/index.js";
|
|
5
|
+
export { AGENT_READINESS_REPOSITORY, AGENT_READINESS_REPOSITORY_URL, agentReadinessDeclarationProvenanceSchema, agentReadinessDeclarationReferenceSchema, } from "./declaration-reference.js";
|
|
6
|
+
import { agentReadinessDigestSchema, agentReadinessEntityIdSchema, agentReadinessHostnameSchema, agentReadinessIdentifierSchema, agentReadinessInstantSchema, agentReadinessOfferIdSchema, agentReadinessResourceRoleSchema, agentReadinessScopeKeySchema, agentReadinessScopeSchema, agentReadinessStageSchema, agentReadinessSurfaceReferenceSchema, } from "./shared.js";
|
|
7
|
+
export const agentReadinessParticipantRoleSchema = z.enum([
|
|
8
|
+
"subject",
|
|
9
|
+
"access_operator",
|
|
10
|
+
"identity_provider",
|
|
11
|
+
"payment_provider",
|
|
12
|
+
"provisioning_provider",
|
|
13
|
+
"operations_provider",
|
|
14
|
+
]);
|
|
15
|
+
export const agentReadinessParticipantIdentitySchema = z.union([
|
|
16
|
+
z.object({ entity_id: agentReadinessEntityIdSchema }).strict(),
|
|
17
|
+
z.object({ origin_source_id: agentReadinessIdentifierSchema }).strict(),
|
|
18
|
+
]);
|
|
19
|
+
export const agentReadinessParticipantSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
participant_id: agentReadinessScopeKeySchema,
|
|
22
|
+
roles: z.array(agentReadinessParticipantRoleSchema).min(1),
|
|
23
|
+
identity: agentReadinessParticipantIdentitySchema,
|
|
24
|
+
})
|
|
25
|
+
.strict()
|
|
26
|
+
.superRefine((value, context) => {
|
|
27
|
+
assertUnique(value.roles, context, ["roles"], "Participant roles must be unique.");
|
|
28
|
+
});
|
|
29
|
+
export const agentReadinessResourceSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
resource_id: agentReadinessScopeKeySchema,
|
|
32
|
+
uri: catalogAuthoringUrlSchema,
|
|
33
|
+
roles: z.array(agentReadinessResourceRoleSchema).min(1),
|
|
34
|
+
operated_by_participant_id: agentReadinessScopeKeySchema,
|
|
35
|
+
standard_bindings: z.array(standardImplementationBindingSchema),
|
|
36
|
+
allowed_redirect_hosts: z.array(agentReadinessHostnameSchema).max(16).optional(),
|
|
37
|
+
})
|
|
38
|
+
.strict()
|
|
39
|
+
.superRefine((value, context) => {
|
|
40
|
+
assertUnique(value.roles, context, ["roles"], "Resource roles must be unique.");
|
|
41
|
+
assertUniqueStandardBindings(value.standard_bindings, context, ["standard_bindings"]);
|
|
42
|
+
assertCanonicalOptionalHosts(value.allowed_redirect_hosts, context);
|
|
43
|
+
});
|
|
44
|
+
export const agentReadinessEndpointTransportSchema = z.enum(["http", "websocket", "grpc"]);
|
|
45
|
+
export const agentReadinessEndpointRoleSchema = z.enum([
|
|
46
|
+
"service",
|
|
47
|
+
"authorization",
|
|
48
|
+
"token",
|
|
49
|
+
"registration",
|
|
50
|
+
"protected_resource",
|
|
51
|
+
"checkout",
|
|
52
|
+
"status",
|
|
53
|
+
"recovery",
|
|
54
|
+
"webhook",
|
|
55
|
+
]);
|
|
56
|
+
export const agentReadinessEndpointSchema = z
|
|
57
|
+
.object({
|
|
58
|
+
endpoint_id: agentReadinessScopeKeySchema,
|
|
59
|
+
uri: catalogAuthoringUrlSchema,
|
|
60
|
+
transport: agentReadinessEndpointTransportSchema,
|
|
61
|
+
roles: z.array(agentReadinessEndpointRoleSchema).min(1),
|
|
62
|
+
operated_by_participant_id: agentReadinessScopeKeySchema,
|
|
63
|
+
standard_bindings: z.array(standardImplementationBindingSchema),
|
|
64
|
+
allowed_redirect_hosts: z.array(agentReadinessHostnameSchema).max(16).optional(),
|
|
65
|
+
})
|
|
66
|
+
.strict()
|
|
67
|
+
.superRefine((value, context) => {
|
|
68
|
+
assertUnique(value.roles, context, ["roles"], "Endpoint roles must be unique.");
|
|
69
|
+
assertUniqueStandardBindings(value.standard_bindings, context, ["standard_bindings"]);
|
|
70
|
+
assertCanonicalOptionalHosts(value.allowed_redirect_hosts, context);
|
|
71
|
+
});
|
|
72
|
+
export const agentReadinessInterfaceModalitySchema = z.enum([
|
|
73
|
+
"web_application",
|
|
74
|
+
"network_api",
|
|
75
|
+
"command_line",
|
|
76
|
+
"software_library",
|
|
77
|
+
"tool_server",
|
|
78
|
+
"agent_service",
|
|
79
|
+
]);
|
|
80
|
+
export const agentReadinessInterfaceFunctionSchema = z.enum([
|
|
81
|
+
"service_operation",
|
|
82
|
+
"authentication",
|
|
83
|
+
"commerce",
|
|
84
|
+
"events",
|
|
85
|
+
"recovery",
|
|
86
|
+
]);
|
|
87
|
+
export const agentReadinessDeclaredInterfaceSchema = z
|
|
88
|
+
.object({
|
|
89
|
+
interface_id: agentReadinessScopeKeySchema,
|
|
90
|
+
modality: agentReadinessInterfaceModalitySchema,
|
|
91
|
+
functions: z.array(agentReadinessInterfaceFunctionSchema).min(1),
|
|
92
|
+
endpoint_ids: z.array(agentReadinessScopeKeySchema),
|
|
93
|
+
resource_ids: z.array(agentReadinessScopeKeySchema),
|
|
94
|
+
operated_by_participant_id: agentReadinessScopeKeySchema,
|
|
95
|
+
standard_bindings: z.array(standardImplementationBindingSchema),
|
|
96
|
+
})
|
|
97
|
+
.strict()
|
|
98
|
+
.superRefine((value, context) => {
|
|
99
|
+
assertUnique(value.functions, context, ["functions"], "Interface functions must be unique.");
|
|
100
|
+
assertUnique(value.endpoint_ids, context, ["endpoint_ids"], "Interface endpoint IDs must be unique.");
|
|
101
|
+
assertUnique(value.resource_ids, context, ["resource_ids"], "Interface resource IDs must be unique.");
|
|
102
|
+
assertUniqueStandardBindings(value.standard_bindings, context, ["standard_bindings"]);
|
|
103
|
+
if (value.endpoint_ids.length === 0 && value.resource_ids.length === 0) {
|
|
104
|
+
context.addIssue({
|
|
105
|
+
code: "custom",
|
|
106
|
+
path: ["endpoint_ids"],
|
|
107
|
+
message: "An interface must reference at least one endpoint or resource.",
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
export const agentReadinessAssessmentTargetSchema = z
|
|
112
|
+
.object({
|
|
113
|
+
target_id: agentReadinessScopeKeySchema,
|
|
114
|
+
name: z.string().trim().min(1).max(240),
|
|
115
|
+
interface_ids: z
|
|
116
|
+
.array(agentReadinessScopeKeySchema)
|
|
117
|
+
.min(1, "An assessment target must reference at least one interface."),
|
|
118
|
+
})
|
|
119
|
+
.strict()
|
|
120
|
+
.superRefine((value, context) => {
|
|
121
|
+
assertUnique(value.interface_ids, context, ["interface_ids"], "Assessment target interface IDs must be unique.");
|
|
122
|
+
});
|
|
123
|
+
export const agentReadinessSurfaceRelationKindSchema = z.enum([
|
|
124
|
+
"describes",
|
|
125
|
+
"authenticates",
|
|
126
|
+
"requires",
|
|
127
|
+
"alternative_to",
|
|
128
|
+
"precedes",
|
|
129
|
+
]);
|
|
130
|
+
export const agentReadinessSurfaceRelationSchema = z
|
|
131
|
+
.object({
|
|
132
|
+
relation_id: agentReadinessScopeKeySchema,
|
|
133
|
+
kind: agentReadinessSurfaceRelationKindSchema,
|
|
134
|
+
from: agentReadinessSurfaceReferenceSchema,
|
|
135
|
+
to: agentReadinessSurfaceReferenceSchema,
|
|
136
|
+
})
|
|
137
|
+
.strict();
|
|
138
|
+
export const agentReadinessOfferRelationPurposeSchema = z.enum([
|
|
139
|
+
"application_path",
|
|
140
|
+
"redemption_path",
|
|
141
|
+
"operating_path",
|
|
142
|
+
]);
|
|
143
|
+
export const agentReadinessOfferRelationProposalSchema = z
|
|
144
|
+
.object({
|
|
145
|
+
offer_relation_proposal_id: agentReadinessIdentifierSchema,
|
|
146
|
+
offer_id: agentReadinessOfferIdSchema,
|
|
147
|
+
purpose: agentReadinessOfferRelationPurposeSchema,
|
|
148
|
+
applicable_stages: z.array(agentReadinessStageSchema).min(1),
|
|
149
|
+
})
|
|
150
|
+
.strict()
|
|
151
|
+
.superRefine((value, context) => {
|
|
152
|
+
assertUnique(value.applicable_stages, context, ["applicable_stages"], "Offer relation stages must be unique.");
|
|
153
|
+
});
|
|
154
|
+
export const agentReadinessDeclarationSourceTargetSchema = z
|
|
155
|
+
.object({
|
|
156
|
+
node_kind: z.enum([
|
|
157
|
+
"declaration",
|
|
158
|
+
"participant",
|
|
159
|
+
"resource",
|
|
160
|
+
"endpoint",
|
|
161
|
+
"interface",
|
|
162
|
+
"relation",
|
|
163
|
+
"offer_relation",
|
|
164
|
+
"assessment_target",
|
|
165
|
+
"surface_exclusion",
|
|
166
|
+
]),
|
|
167
|
+
node_id: agentReadinessIdentifierSchema,
|
|
168
|
+
})
|
|
169
|
+
.strict();
|
|
170
|
+
const canonicalJsonPointerSchema = z.string().regex(/^\/(?:[^~/]|~0|~1)+(?:\/(?:[^~/]|~0|~1)+)*$/u);
|
|
171
|
+
const agentReadinessDeclarationSourceBindingFields = {
|
|
172
|
+
source_binding_id: agentReadinessIdentifierSchema,
|
|
173
|
+
source_id: agentReadinessIdentifierSchema,
|
|
174
|
+
field_paths: z.array(canonicalJsonPointerSchema).min(1),
|
|
175
|
+
};
|
|
176
|
+
export const agentReadinessDeclarationSourceBindingSchema = z
|
|
177
|
+
.object({
|
|
178
|
+
...agentReadinessDeclarationSourceBindingFields,
|
|
179
|
+
target: agentReadinessDeclarationSourceTargetSchema,
|
|
180
|
+
})
|
|
181
|
+
.strict()
|
|
182
|
+
.superRefine((value, context) => {
|
|
183
|
+
assertUnique(value.field_paths, context, ["field_paths"], "Source-binding paths must be unique.");
|
|
184
|
+
});
|
|
185
|
+
const agentReadinessDeclarationGraphSourceTargetSchema = z
|
|
186
|
+
.object({
|
|
187
|
+
node_kind: z.enum([
|
|
188
|
+
"declaration",
|
|
189
|
+
"participant",
|
|
190
|
+
"resource",
|
|
191
|
+
"endpoint",
|
|
192
|
+
"interface",
|
|
193
|
+
"relation",
|
|
194
|
+
"assessment_target",
|
|
195
|
+
"surface_exclusion",
|
|
196
|
+
]),
|
|
197
|
+
node_id: agentReadinessIdentifierSchema,
|
|
198
|
+
})
|
|
199
|
+
.strict();
|
|
200
|
+
const agentReadinessDeclarationGraphSourceBindingSchema = z
|
|
201
|
+
.object({
|
|
202
|
+
...agentReadinessDeclarationSourceBindingFields,
|
|
203
|
+
target: agentReadinessDeclarationGraphSourceTargetSchema,
|
|
204
|
+
})
|
|
205
|
+
.strict()
|
|
206
|
+
.superRefine((value, context) => {
|
|
207
|
+
assertUnique(value.field_paths, context, ["field_paths"], "Source-binding paths must be unique.");
|
|
208
|
+
});
|
|
209
|
+
export const agentReadinessSurfaceExclusionSchema = z
|
|
210
|
+
.object({
|
|
211
|
+
exclusion_id: agentReadinessScopeKeySchema,
|
|
212
|
+
role: agentReadinessResourceRoleSchema,
|
|
213
|
+
rationale: z.string().trim().min(1).max(300),
|
|
214
|
+
})
|
|
215
|
+
.strict();
|
|
216
|
+
const agentReadinessDeclarationCoreSchema = z
|
|
217
|
+
.object({
|
|
218
|
+
declaration_id: agentReadinessIdentifierSchema,
|
|
219
|
+
scope: agentReadinessScopeSchema,
|
|
220
|
+
assessment_targets: z.array(agentReadinessAssessmentTargetSchema).min(1),
|
|
221
|
+
participants: z.array(agentReadinessParticipantSchema).min(1),
|
|
222
|
+
resources: z.array(agentReadinessResourceSchema).min(1),
|
|
223
|
+
endpoints: z.array(agentReadinessEndpointSchema),
|
|
224
|
+
interfaces: z.array(agentReadinessDeclaredInterfaceSchema),
|
|
225
|
+
relations: z.array(agentReadinessSurfaceRelationSchema),
|
|
226
|
+
offer_relations: z.array(agentReadinessOfferRelationProposalSchema),
|
|
227
|
+
source_bindings: z.array(agentReadinessDeclarationSourceBindingSchema).min(1),
|
|
228
|
+
surface_exclusions: z.array(agentReadinessSurfaceExclusionSchema),
|
|
229
|
+
authority_intent: z.enum(["entity", "community"]),
|
|
230
|
+
declared_at: agentReadinessInstantSchema,
|
|
231
|
+
})
|
|
232
|
+
.strict();
|
|
233
|
+
function validateSurfaceExclusions(value, context) {
|
|
234
|
+
const ruledOut = value.surface_exclusions;
|
|
235
|
+
assertUnique(ruledOut.map(({ exclusion_id }) => exclusion_id), context, ["surface_exclusions"], "Surface exclusion IDs must be unique.");
|
|
236
|
+
const roles = ruledOut.map(({ role }) => role);
|
|
237
|
+
if (new Set(roles).size !== roles.length) {
|
|
238
|
+
context.addIssue({
|
|
239
|
+
code: "custom",
|
|
240
|
+
path: ["surface_exclusions"],
|
|
241
|
+
message: "A surface role may be excluded only once.",
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
const declared = new Set(value.resources.flatMap((resource) => resource.roles));
|
|
245
|
+
for (const [index, surface] of ruledOut.entries()) {
|
|
246
|
+
if (declared.has(surface.role)) {
|
|
247
|
+
context.addIssue({
|
|
248
|
+
code: "custom",
|
|
249
|
+
path: ["surface_exclusions", index, "role"],
|
|
250
|
+
message: `Role '${surface.role}' is declared by a resource and cannot also be excluded.`,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
export const agentReadinessDeclarationSchema = agentReadinessDeclarationCoreSchema
|
|
256
|
+
.superRefine(validateDeclarationGraph)
|
|
257
|
+
.superRefine(validateSurfaceExclusions);
|
|
258
|
+
const agentReadinessDeclarationGraphCoreSchema = agentReadinessDeclarationCoreSchema
|
|
259
|
+
.omit({ offer_relations: true, source_bindings: true })
|
|
260
|
+
.safeExtend({
|
|
261
|
+
source_bindings: z.array(agentReadinessDeclarationGraphSourceBindingSchema).min(1),
|
|
262
|
+
})
|
|
263
|
+
.strict();
|
|
264
|
+
export const agentReadinessDeclarationGraphSchema = agentReadinessDeclarationGraphCoreSchema.superRefine((value, context) => {
|
|
265
|
+
validateDeclarationGraph({ ...value, offer_relations: [] }, context);
|
|
266
|
+
validateSurfaceExclusions(value, context);
|
|
267
|
+
});
|
|
268
|
+
const agentReadinessDeclarationRevisionFieldsSchema = z
|
|
269
|
+
.object({
|
|
270
|
+
revision_contract: z.literal("sourcey.agent-readiness-declaration-revision/v1alpha1"),
|
|
271
|
+
entity_id: agentReadinessEntityIdSchema,
|
|
272
|
+
declaration: agentReadinessDeclarationGraphSchema,
|
|
273
|
+
sources: z.array(authoringSourceSchema).min(1),
|
|
274
|
+
})
|
|
275
|
+
.strict()
|
|
276
|
+
.superRefine((value, context) => {
|
|
277
|
+
const sourceIds = value.sources.map((source) => source.source_id);
|
|
278
|
+
assertUnique(sourceIds, context, ["sources"], "Declaration revision sources must be unique.");
|
|
279
|
+
const resolved = new Set(sourceIds);
|
|
280
|
+
for (const [index, binding] of value.declaration.source_bindings.entries()) {
|
|
281
|
+
if (!resolved.has(binding.source_id)) {
|
|
282
|
+
context.addIssue({
|
|
283
|
+
code: "custom",
|
|
284
|
+
path: ["declaration", "source_bindings", index, "source_id"],
|
|
285
|
+
message: `Declaration revision source '${binding.source_id}' is unresolved.`,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
for (const [index, participant] of value.declaration.participants.entries()) {
|
|
290
|
+
if ("origin_source_id" in participant.identity &&
|
|
291
|
+
!resolved.has(participant.identity.origin_source_id)) {
|
|
292
|
+
context.addIssue({
|
|
293
|
+
code: "custom",
|
|
294
|
+
path: ["declaration", "participants", index, "identity"],
|
|
295
|
+
message: `Participant origin source '${participant.identity.origin_source_id}' is unresolved.`,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
const subjects = value.declaration.participants.filter((participant) => participant.roles.includes("subject"));
|
|
300
|
+
const subject = subjects[0];
|
|
301
|
+
if (subjects.length !== 1 ||
|
|
302
|
+
!subject ||
|
|
303
|
+
!("entity_id" in subject.identity) ||
|
|
304
|
+
subject.identity.entity_id !== value.entity_id) {
|
|
305
|
+
context.addIssue({
|
|
306
|
+
code: "custom",
|
|
307
|
+
path: ["declaration", "participants"],
|
|
308
|
+
message: "A declaration revision must bind one subject participant to its Entity.",
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
export const agentReadinessDeclarationRevisionCoreSchema = agentReadinessDeclarationRevisionFieldsSchema;
|
|
313
|
+
export const agentReadinessDeclarationRevisionSchema = agentReadinessDeclarationRevisionCoreSchema
|
|
314
|
+
.safeExtend({ revision_digest: agentReadinessDigestSchema })
|
|
315
|
+
.strict();
|
|
316
|
+
export const agentReadinessAuthoringSchema = z
|
|
317
|
+
.object({
|
|
318
|
+
schema_version: z.literal("sourcey.agent-readiness-authoring/v1alpha1"),
|
|
319
|
+
entity: entityIdentityAuthoringSchema,
|
|
320
|
+
sources: z.array(authoringSourceSchema).min(1),
|
|
321
|
+
declarations: z.array(agentReadinessDeclarationSchema).min(1),
|
|
322
|
+
})
|
|
323
|
+
.strict()
|
|
324
|
+
.superRefine((value, context) => {
|
|
325
|
+
assertUnique(value.declarations.map((declaration) => declaration.declaration_id), context, ["declarations"], "Readiness declaration IDs must be unique inside an Entity declaration.");
|
|
326
|
+
assertUnique(value.declarations.map(({ scope }) => `${scope.product.key}\0${scope.funnel.key}`), context, ["declarations"], "An Entity can declare each product and funnel scope only once.");
|
|
327
|
+
const sourceIds = new Set(value.sources.map((source) => source.source_id));
|
|
328
|
+
for (const [declarationIndex, declaration] of value.declarations.entries()) {
|
|
329
|
+
const subjectParticipants = declaration.participants.filter((participant) => participant.roles.includes("subject"));
|
|
330
|
+
const subject = subjectParticipants[0];
|
|
331
|
+
if (subjectParticipants.length !== 1 ||
|
|
332
|
+
!subject ||
|
|
333
|
+
!("entity_id" in subject.identity) ||
|
|
334
|
+
subject.identity.entity_id !== value.entity.entity_id) {
|
|
335
|
+
context.addIssue({
|
|
336
|
+
code: "custom",
|
|
337
|
+
path: ["declarations", declarationIndex, "participants"],
|
|
338
|
+
message: "A declaration requires exactly one subject participant for its Entity.",
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
for (const [participantIndex, participant] of declaration.participants.entries()) {
|
|
342
|
+
if ("origin_source_id" in participant.identity &&
|
|
343
|
+
!sourceIds.has(participant.identity.origin_source_id)) {
|
|
344
|
+
context.addIssue({
|
|
345
|
+
code: "custom",
|
|
346
|
+
path: ["declarations", declarationIndex, "participants", participantIndex, "identity"],
|
|
347
|
+
message: `Unknown participant origin source '${participant.identity.origin_source_id}'.`,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
for (const [bindingIndex, binding] of declaration.source_bindings.entries()) {
|
|
352
|
+
if (!sourceIds.has(binding.source_id)) {
|
|
353
|
+
context.addIssue({
|
|
354
|
+
code: "custom",
|
|
355
|
+
path: ["declarations", declarationIndex, "source_bindings", bindingIndex, "source_id"],
|
|
356
|
+
message: `Unknown source_id '${binding.source_id}'.`,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
function validateDeclarationGraph(value, context) {
|
|
363
|
+
assertUnique(value.assessment_targets.map((target) => target.target_id), context, ["assessment_targets"], "Assessment target IDs must be unique.");
|
|
364
|
+
assertUnique(value.participants.map((participant) => participant.participant_id), context, ["participants"], "Participant IDs must be unique.");
|
|
365
|
+
assertUnique(value.resources.map((resource) => resource.resource_id), context, ["resources"], "Resource IDs must be unique.");
|
|
366
|
+
assertUnique(value.resources.map((resource) => resource.uri), context, ["resources"], "A resource URI must appear once and carry every applicable role.");
|
|
367
|
+
assertUnique(value.endpoints.map((endpoint) => endpoint.endpoint_id), context, ["endpoints"], "Endpoint IDs must be unique.");
|
|
368
|
+
assertUnique(value.endpoints.map((endpoint) => `${endpoint.transport}:${endpoint.uri}`), context, ["endpoints"], "An endpoint URI and transport pair must appear once and carry every applicable role.");
|
|
369
|
+
assertUnique(value.interfaces.map((declaredInterface) => declaredInterface.interface_id), context, ["interfaces"], "Interface IDs must be unique.");
|
|
370
|
+
assertUnique(value.relations.map((relation) => relation.relation_id), context, ["relations"], "Surface relation IDs must be unique.");
|
|
371
|
+
assertUnique(value.offer_relations.map((relation) => relation.offer_relation_proposal_id), context, ["offer_relations"], "Offer relation proposal IDs must be unique.");
|
|
372
|
+
assertUnique(value.offer_relations.map((relation) => `${relation.offer_id}:${relation.purpose}`), context, ["offer_relations"], "A declaration cannot repeat one Offer relation identity.");
|
|
373
|
+
assertUnique(value.source_bindings.map((binding) => binding.source_binding_id), context, ["source_bindings"], "Source binding IDs must be unique.");
|
|
374
|
+
const participants = new Set(value.participants.map((participant) => participant.participant_id));
|
|
375
|
+
assertSurfaceOperators(value.resources, "resources", participants, context);
|
|
376
|
+
assertSurfaceOperators(value.endpoints, "endpoints", participants, context);
|
|
377
|
+
assertSurfaceOperators(value.interfaces, "interfaces", participants, context);
|
|
378
|
+
const resourceIds = new Set(value.resources.map((resource) => resource.resource_id));
|
|
379
|
+
const endpointIds = new Set(value.endpoints.map((endpoint) => endpoint.endpoint_id));
|
|
380
|
+
const interfaceIds = new Set(value.interfaces.map((declaredInterface) => declaredInterface.interface_id));
|
|
381
|
+
for (const [index, target] of value.assessment_targets.entries()) {
|
|
382
|
+
for (const interfaceId of target.interface_ids) {
|
|
383
|
+
if (!interfaceIds.has(interfaceId)) {
|
|
384
|
+
context.addIssue({
|
|
385
|
+
code: "custom",
|
|
386
|
+
path: ["assessment_targets", index, "interface_ids"],
|
|
387
|
+
message: `Assessment target references unknown interface '${interfaceId}'.`,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
for (const [index, declaredInterface] of value.interfaces.entries()) {
|
|
393
|
+
for (const endpointId of declaredInterface.endpoint_ids) {
|
|
394
|
+
if (!endpointIds.has(endpointId)) {
|
|
395
|
+
context.addIssue({
|
|
396
|
+
code: "custom",
|
|
397
|
+
path: ["interfaces", index, "endpoint_ids"],
|
|
398
|
+
message: `Interface references unknown endpoint '${endpointId}'.`,
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
for (const resourceId of declaredInterface.resource_ids) {
|
|
403
|
+
if (!resourceIds.has(resourceId)) {
|
|
404
|
+
context.addIssue({
|
|
405
|
+
code: "custom",
|
|
406
|
+
path: ["interfaces", index, "resource_ids"],
|
|
407
|
+
message: `Interface references unknown resource '${resourceId}'.`,
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
const nodeKeys = new Set([
|
|
413
|
+
...value.resources.map((resource) => nodeKey("resource", resource.resource_id)),
|
|
414
|
+
...value.endpoints.map((endpoint) => nodeKey("endpoint", endpoint.endpoint_id)),
|
|
415
|
+
...value.interfaces.map((declaredInterface) => nodeKey("interface", declaredInterface.interface_id)),
|
|
416
|
+
]);
|
|
417
|
+
for (const [index, relation] of value.relations.entries()) {
|
|
418
|
+
const from = nodeKey(relation.from.node_kind, relation.from.node_id);
|
|
419
|
+
const to = nodeKey(relation.to.node_kind, relation.to.node_id);
|
|
420
|
+
if (!nodeKeys.has(from) || !nodeKeys.has(to)) {
|
|
421
|
+
context.addIssue({
|
|
422
|
+
code: "custom",
|
|
423
|
+
path: ["relations", index],
|
|
424
|
+
message: "A surface relation must close over nodes in the same declaration.",
|
|
425
|
+
});
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
if (from === to) {
|
|
429
|
+
context.addIssue({
|
|
430
|
+
code: "custom",
|
|
431
|
+
path: ["relations", index],
|
|
432
|
+
message: "A surface cannot relate to itself.",
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
if (relation.kind === "describes" && relation.from.node_kind !== "resource") {
|
|
436
|
+
context.addIssue({
|
|
437
|
+
code: "custom",
|
|
438
|
+
path: ["relations", index, "from"],
|
|
439
|
+
message: "Only a retrievable resource can describe another surface.",
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
if (relation.kind === "authenticates" &&
|
|
443
|
+
!["endpoint", "interface"].includes(relation.to.node_kind)) {
|
|
444
|
+
context.addIssue({
|
|
445
|
+
code: "custom",
|
|
446
|
+
path: ["relations", index, "to"],
|
|
447
|
+
message: "Authentication relations must target a callable endpoint or interface.",
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
if (relation.kind === "alternative_to" && from.localeCompare(to) >= 0) {
|
|
451
|
+
context.addIssue({
|
|
452
|
+
code: "custom",
|
|
453
|
+
path: ["relations", index],
|
|
454
|
+
message: "Alternative surfaces must be stored once in canonical node order.",
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
assertAcyclic(value.relations, "requires", context);
|
|
459
|
+
assertAcyclic(value.relations, "precedes", context);
|
|
460
|
+
assertInterfaceTargetClosure(value, context);
|
|
461
|
+
validateSourceBindings(value, context);
|
|
462
|
+
}
|
|
463
|
+
function assertInterfaceTargetClosure(value, context) {
|
|
464
|
+
const reachable = new Set(value.assessment_targets.flatMap((target) => target.interface_ids));
|
|
465
|
+
let changed = true;
|
|
466
|
+
while (changed) {
|
|
467
|
+
changed = false;
|
|
468
|
+
for (const relation of value.relations) {
|
|
469
|
+
if (relation.from.node_kind !== "interface" || relation.to.node_kind !== "interface") {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if (reachable.has(relation.from.node_id) && !reachable.has(relation.to.node_id)) {
|
|
473
|
+
reachable.add(relation.to.node_id);
|
|
474
|
+
changed = true;
|
|
475
|
+
}
|
|
476
|
+
if (reachable.has(relation.to.node_id) && !reachable.has(relation.from.node_id)) {
|
|
477
|
+
reachable.add(relation.from.node_id);
|
|
478
|
+
changed = true;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
const orphaned = value.interfaces
|
|
483
|
+
.map((declaredInterface) => declaredInterface.interface_id)
|
|
484
|
+
.filter((interfaceId) => !reachable.has(interfaceId));
|
|
485
|
+
if (orphaned.length > 0) {
|
|
486
|
+
context.addIssue({
|
|
487
|
+
code: "custom",
|
|
488
|
+
path: ["interfaces"],
|
|
489
|
+
message: `Interfaces must close from an assessment target: ${orphaned.sort().join(", ")}.`,
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
function validateSourceBindings(value, context) {
|
|
494
|
+
const targets = new Map();
|
|
495
|
+
const required = new Set();
|
|
496
|
+
const addTarget = (kind, id, paths) => {
|
|
497
|
+
targets.set(`${kind}:${id}`, new Set(paths));
|
|
498
|
+
for (const path of paths)
|
|
499
|
+
required.add(`${kind}:${id}:${path}`);
|
|
500
|
+
};
|
|
501
|
+
addTarget("declaration", value.declaration_id, ["/scope/product/name", "/scope/funnel/name"]);
|
|
502
|
+
for (const target of value.assessment_targets) {
|
|
503
|
+
addTarget("assessment_target", target.target_id, ["/name", "/interface_ids"]);
|
|
504
|
+
}
|
|
505
|
+
for (const participant of value.participants) {
|
|
506
|
+
addTarget("participant", participant.participant_id, ["/roles", "/identity"]);
|
|
507
|
+
}
|
|
508
|
+
for (const resource of value.resources) {
|
|
509
|
+
addTarget("resource", resource.resource_id, [
|
|
510
|
+
"/uri",
|
|
511
|
+
"/roles",
|
|
512
|
+
"/operated_by_participant_id",
|
|
513
|
+
...(resource.standard_bindings.length > 0 ? ["/standard_bindings"] : []),
|
|
514
|
+
...(resource.allowed_redirect_hosts ? ["/allowed_redirect_hosts"] : []),
|
|
515
|
+
]);
|
|
516
|
+
}
|
|
517
|
+
for (const endpoint of value.endpoints) {
|
|
518
|
+
addTarget("endpoint", endpoint.endpoint_id, [
|
|
519
|
+
"/uri",
|
|
520
|
+
"/transport",
|
|
521
|
+
"/roles",
|
|
522
|
+
"/operated_by_participant_id",
|
|
523
|
+
...(endpoint.standard_bindings.length > 0 ? ["/standard_bindings"] : []),
|
|
524
|
+
...(endpoint.allowed_redirect_hosts ? ["/allowed_redirect_hosts"] : []),
|
|
525
|
+
]);
|
|
526
|
+
}
|
|
527
|
+
for (const declaredInterface of value.interfaces) {
|
|
528
|
+
addTarget("interface", declaredInterface.interface_id, [
|
|
529
|
+
"/modality",
|
|
530
|
+
"/functions",
|
|
531
|
+
...(declaredInterface.endpoint_ids.length > 0 ? ["/endpoint_ids"] : []),
|
|
532
|
+
...(declaredInterface.resource_ids.length > 0 ? ["/resource_ids"] : []),
|
|
533
|
+
"/operated_by_participant_id",
|
|
534
|
+
...(declaredInterface.standard_bindings.length > 0 ? ["/standard_bindings"] : []),
|
|
535
|
+
]);
|
|
536
|
+
}
|
|
537
|
+
for (const relation of value.relations) {
|
|
538
|
+
addTarget("relation", relation.relation_id, ["/kind", "/from", "/to"]);
|
|
539
|
+
}
|
|
540
|
+
for (const relation of value.offer_relations) {
|
|
541
|
+
addTarget("offer_relation", relation.offer_relation_proposal_id, [
|
|
542
|
+
"/offer_id",
|
|
543
|
+
"/purpose",
|
|
544
|
+
"/applicable_stages",
|
|
545
|
+
]);
|
|
546
|
+
}
|
|
547
|
+
for (const exclusion of value.surface_exclusions) {
|
|
548
|
+
addTarget("surface_exclusion", exclusion.exclusion_id, ["/role", "/rationale"]);
|
|
549
|
+
}
|
|
550
|
+
const covered = new Set();
|
|
551
|
+
const claims = new Set();
|
|
552
|
+
for (const [index, binding] of value.source_bindings.entries()) {
|
|
553
|
+
const targetKey = `${binding.target.node_kind}:${binding.target.node_id}`;
|
|
554
|
+
const allowed = targets.get(targetKey);
|
|
555
|
+
if (!allowed) {
|
|
556
|
+
context.addIssue({
|
|
557
|
+
code: "custom",
|
|
558
|
+
path: ["source_bindings", index, "target"],
|
|
559
|
+
message: "A source binding must target a node in the same declaration.",
|
|
560
|
+
});
|
|
561
|
+
continue;
|
|
562
|
+
}
|
|
563
|
+
for (const [pathIndex, path] of binding.field_paths.entries()) {
|
|
564
|
+
if (!allowed.has(path)) {
|
|
565
|
+
context.addIssue({
|
|
566
|
+
code: "custom",
|
|
567
|
+
path: ["source_bindings", index, "field_paths", pathIndex],
|
|
568
|
+
message: `Source binding path '${path}' is not a material field of ${targetKey}.`,
|
|
569
|
+
});
|
|
570
|
+
continue;
|
|
571
|
+
}
|
|
572
|
+
const claim = `${binding.source_id}:${targetKey}:${path}`;
|
|
573
|
+
if (claims.has(claim)) {
|
|
574
|
+
context.addIssue({
|
|
575
|
+
code: "custom",
|
|
576
|
+
path: ["source_bindings", index, "field_paths", pathIndex],
|
|
577
|
+
message: "A source cannot bind the same target field more than once.",
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
claims.add(claim);
|
|
581
|
+
covered.add(`${targetKey}:${path}`);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
const missing = [...required].filter((claim) => !covered.has(claim)).sort();
|
|
585
|
+
if (missing.length > 0) {
|
|
586
|
+
context.addIssue({
|
|
587
|
+
code: "custom",
|
|
588
|
+
path: ["source_bindings"],
|
|
589
|
+
message: `Material declaration fields lack source coverage: ${missing.join(", ")}.`,
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function assertAcyclic(relations, kind, context) {
|
|
594
|
+
const edges = new Map();
|
|
595
|
+
for (const relation of relations) {
|
|
596
|
+
if (relation.kind !== kind)
|
|
597
|
+
continue;
|
|
598
|
+
const from = nodeKey(relation.from.node_kind, relation.from.node_id);
|
|
599
|
+
const to = nodeKey(relation.to.node_kind, relation.to.node_id);
|
|
600
|
+
edges.set(from, [...(edges.get(from) ?? []), to]);
|
|
601
|
+
}
|
|
602
|
+
const visiting = new Set();
|
|
603
|
+
const visited = new Set();
|
|
604
|
+
const visit = (node) => {
|
|
605
|
+
if (visiting.has(node))
|
|
606
|
+
return true;
|
|
607
|
+
if (visited.has(node))
|
|
608
|
+
return false;
|
|
609
|
+
visiting.add(node);
|
|
610
|
+
for (const next of edges.get(node) ?? [])
|
|
611
|
+
if (visit(next))
|
|
612
|
+
return true;
|
|
613
|
+
visiting.delete(node);
|
|
614
|
+
visited.add(node);
|
|
615
|
+
return false;
|
|
616
|
+
};
|
|
617
|
+
if ([...edges.keys()].some(visit)) {
|
|
618
|
+
context.addIssue({
|
|
619
|
+
code: "custom",
|
|
620
|
+
path: ["relations"],
|
|
621
|
+
message: `Surface ${kind} relations must be acyclic.`,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function assertSurfaceOperators(surfaces, path, participantIds, context) {
|
|
626
|
+
for (const [index, surface] of surfaces.entries()) {
|
|
627
|
+
if (!participantIds.has(surface.operated_by_participant_id)) {
|
|
628
|
+
context.addIssue({
|
|
629
|
+
code: "custom",
|
|
630
|
+
path: [path, index, "operated_by_participant_id"],
|
|
631
|
+
message: "A surface operator must reference a participant in the same declaration.",
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function assertUniqueStandardBindings(bindings, context, path) {
|
|
637
|
+
assertUnique(bindings.map((binding) => `${binding.namespace}:${binding.version}:${binding.relation}`), context, path, "Standard implementation bindings must be unique.");
|
|
638
|
+
}
|
|
639
|
+
function assertCanonicalOptionalHosts(hosts, context) {
|
|
640
|
+
if (!hosts)
|
|
641
|
+
return;
|
|
642
|
+
const ordered = [...hosts].sort();
|
|
643
|
+
if (new Set(hosts).size !== hosts.length ||
|
|
644
|
+
hosts.some((host, index) => host !== ordered[index])) {
|
|
645
|
+
context.addIssue({
|
|
646
|
+
code: "custom",
|
|
647
|
+
path: ["allowed_redirect_hosts"],
|
|
648
|
+
message: "Allowed redirect hosts must be unique and canonically ordered.",
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function nodeKey(kind, id) {
|
|
653
|
+
return `${kind}:${id}`;
|
|
654
|
+
}
|
|
655
|
+
function assertUnique(values, context, path, message) {
|
|
656
|
+
if (new Set(values).size !== values.length)
|
|
657
|
+
context.addIssue({ code: "custom", path, message });
|
|
658
|
+
}
|
|
659
|
+
//# sourceMappingURL=declaration.js.map
|