@wildo-ai/saas-specifications 1.1.5 → 1.1.6
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/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts +10 -8
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js +14 -13
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts +3 -2
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js +4 -3
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/index.d.ts +31 -15
- package/dist/esm/_catalogs/schema-org/index.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/index.js +34 -13
- package/dist/esm/_catalogs/schema-org/index.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.d.ts +2 -2
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.js +4 -4
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts +45 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts.map +1 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js +58 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js.map +1 -0
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts +3 -2
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
- package/dist/esm/_core/application-specification-family-identity.schemas.js +3 -2
- package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +18 -0
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +39 -13
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +43 -13
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +90 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +70 -6
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +26 -4
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/business-semantics.specifications.schemas.d.ts +14 -0
- package/dist/esm/_core/business-semantics.specifications.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-semantics.specifications.schemas.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.js +1 -0
- package/dist/esm/_core/capability-composition/capability-composition-validation.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +21 -2
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js +20 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +11 -32
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +70 -3
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts +142 -17
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +285 -30
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +183 -18
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js +165 -18
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts +139 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js +172 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts +306 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js +502 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts +107 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js +118 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts +56 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js +100 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js.map +1 -0
- package/dist/esm/_core/composite-view-specification.schemas.js +8 -1
- package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -2
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +3 -2
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts +16 -3
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js +70 -5
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
- package/dist/esm/_core/family-aspects.schemas.d.ts +10 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -1
- package/dist/esm/_core/family-aspects.schemas.js.map +1 -1
- package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +2 -2
- package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts +1 -0
- package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts.map +1 -1
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts +16 -0
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js +8 -0
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js.map +1 -1
- package/dist/esm/_core/index.d.ts +3 -0
- package/dist/esm/_core/index.d.ts.map +1 -1
- package/dist/esm/_core/index.js +3 -0
- package/dist/esm/_core/index.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +5 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +3 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +12 -2
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +30 -2
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +32 -2
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/market/feature-benefit.schemas.js +2 -2
- package/dist/esm/_core/market/feature-benefit.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-alternative.schemas.js +2 -2
- package/dist/esm/_core/market/market-alternative.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-buying-journey.schemas.js +2 -2
- package/dist/esm/_core/market/market-buying-journey.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-category.schemas.js +2 -2
- package/dist/esm/_core/market/market-category.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-channel.schemas.js +2 -2
- package/dist/esm/_core/market/market-channel.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-gain.schemas.js +2 -2
- package/dist/esm/_core/market/market-gain.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.js +2 -2
- package/dist/esm/_core/market/market-icp.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-job.schemas.js +2 -2
- package/dist/esm/_core/market/market-job.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-message-template.schemas.js +2 -2
- package/dist/esm/_core/market/market-message-template.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-objection.schemas.js +2 -2
- package/dist/esm/_core/market/market-objection.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-pain.schemas.js +2 -2
- package/dist/esm/_core/market/market-pain.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-persona.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-persona.schemas.js +2 -2
- package/dist/esm/_core/market/market-persona.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-positioning.schemas.js +2 -2
- package/dist/esm/_core/market/market-positioning.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-proof.schemas.js +2 -2
- package/dist/esm/_core/market/market-proof.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.d.ts +6 -0
- package/dist/esm/_core/market/market-references.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.js +6 -0
- package/dist/esm/_core/market/market-references.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +4 -4
- package/dist/esm/_core/market/market-tone-of-voice.schemas.js +2 -2
- package/dist/esm/_core/market/market-tone-of-voice.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-trigger.schemas.js +2 -2
- package/dist/esm/_core/market/market-trigger.schemas.js.map +1 -1
- package/dist/esm/_core/market/market.family-aspects.js +1 -1
- package/dist/esm/_core/market/market.family-aspects.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js +6 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts +1 -0
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.js +8 -0
- package/dist/esm/_core/requirements/functional-requirement.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts +1 -0
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.d.ts +86 -28
- package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.js +110 -24
- package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
- package/dist/esm/_core/utils/retention-clock-field-specs.d.ts +13 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.d.ts.map +1 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.js +26 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.js.map +1 -0
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts +31 -6
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/website-plan/website-plan.schemas.js +35 -6
- package/dist/esm/_core/website-plan/website-plan.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +142 -3
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js +148 -14
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +70 -10
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +98 -11
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts +215 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.js +253 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts +39 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js +37 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +5 -49
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/journey.application-creation.schemas.js +25 -60
- package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts +28 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js +32 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +26 -6
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +28 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +7 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +7 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +24 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +75 -5
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +6 -0
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts +11 -0
- package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-blueprint-selection.js +22 -3
- package/dist/esm/assurance/assurance-document-blueprint-selection.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.js +39 -6
- package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts +11 -0
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.js +19 -0
- package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +295 -31
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-foundation.schemas.d.ts +7 -0
- package/dist/esm/assurance/assurance-foundation.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-foundation.schemas.js +7 -0
- package/dist/esm/assurance/assurance-foundation.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +17 -0
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +5 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.js +6 -3
- package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-program.family-aspects.js +1 -1
- package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.d.ts +232 -3
- package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.js +107 -14
- package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js +77 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +23 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/governed-document-release.d.ts +7 -0
- package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
- package/dist/esm/assurance/governed-document-release.js +11 -2
- package/dist/esm/assurance/governed-document-release.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +6 -5
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts +1 -0
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +35 -33
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +6 -2
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +13 -12
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +26 -2
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.js +4 -4
- package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +11 -9
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +2 -2
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts +1 -0
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +45 -32
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts +1 -23
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +185 -31
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts +2 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js +29 -7
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +7 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +9 -6
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts +1 -0
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +11 -7
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +18 -16
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +9 -11
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +238 -219
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts +0 -24
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +76 -16
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts +2 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js +28 -6
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +29 -11
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js +1 -1
- package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +2 -0
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +13 -12
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +5 -5
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js +12 -9
- package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts +7 -4
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js +36 -16
- package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js +13 -10
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts +13 -8
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js +54 -20
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +30 -4
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +85 -25
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -2
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts +15 -2
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js +45 -10
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts +15 -2
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +52 -12
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/index.d.ts +1 -0
- package/dist/esm/engine/compliance/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/index.js +1 -0
- package/dist/esm/engine/compliance/resources/index.js.map +1 -1
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts +39 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js +325 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js.map +1 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts +23 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js +197 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js.map +1 -0
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +59 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.js +69 -0
- package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts +5 -5
- package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.js +9 -10
- package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts +5 -5
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js +11 -11
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +5 -5
- package/dist/esm/engine/features/resources/user-features.resource.specification.js +3 -3
- package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.js +7 -8
- package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +16 -4
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts +11 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js +382 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +139 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +150 -4
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +9 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js +162 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js +158 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts +2 -1
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js +16 -9
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js +3 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js +5 -4
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/index.d.ts +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/index.js +3 -0
- package/dist/esm/engine/frontend-components/index.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js +9 -4
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +4 -4
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +34 -0
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +26 -0
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js +122 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js +152 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js +94 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js +64 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts +4 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js +20 -16
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js +200 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +19 -6
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js +97 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +8 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts +8 -8
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js +4 -4
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js +153 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts +81 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js +437 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts +112 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js +287 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts +131 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +594 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/index.d.ts +1 -0
- package/dist/esm/engine/notifications/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/index.js +1 -0
- package/dist/esm/engine/notifications/resources/index.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts +6 -3
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +20 -5
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +12 -2
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts +6 -6
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +8 -11
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts +4 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js +62 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js.map +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts +2 -1
- package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.js +4 -2
- package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/index.d.ts +2 -0
- package/dist/esm/engine/organizations/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/index.js +2 -0
- package/dist/esm/engine/organizations/resources/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +3 -0
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +40 -12
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -2
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -2
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts +0 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +4 -6
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +7 -3
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +15 -8
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts +3 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +36 -21
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts +38 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js +152 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts +106 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js +417 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js.map +1 -0
- package/dist/esm/engine/providers/apple.provider.specification.js +1 -1
- package/dist/esm/engine/providers/apple.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/github.provider.specification.js +1 -1
- package/dist/esm/engine/providers/github.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/google-places.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/google-places.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/google-places.provider.specification.js +44 -0
- package/dist/esm/engine/providers/google-places.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/google.provider.specification.js +1 -1
- package/dist/esm/engine/providers/google.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/index.d.ts +2 -0
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -1
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/providers/microsoft.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/microsoft.provider.specification.js +10 -6
- package/dist/esm/engine/providers/microsoft.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.js +38 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/resend.provider.specification.js +3 -1
- package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/stripe.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/stripe.provider.specification.js +3 -2
- package/dist/esm/engine/providers/stripe.provider.specification.js.map +1 -1
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js +21 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js +21 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/index.d.ts +13 -5
- package/dist/esm/engine/roles/index.d.ts.map +1 -1
- package/dist/esm/engine/roles/index.js +19 -6
- package/dist/esm/engine/roles/index.js.map +1 -1
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js +21 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts +7 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js +72 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.js +22 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.js.map +1 -0
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -2
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +3 -3
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js +3 -6
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -2
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +2 -2
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +0 -4
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +0 -3
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +0 -3
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +7 -7
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +5 -5
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +0 -3
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +11 -18
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +6 -6
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.js +5 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts +8 -5
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js +49 -16
- package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +29 -10
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/dist/assurance/external-framework-mapping.json +0 -1228
package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource: `modelCallAttributions` — Wildo SaaS engine specification (application-scoped storage, engine-written). #1598.
|
|
3
|
+
*
|
|
4
|
+
* Inputs:
|
|
5
|
+
* - Schema: `ModelCallAttributionSchema` (`flows-actors/model-call-attributions.shared.schemas.ts`)
|
|
6
|
+
* - Factory: `modelCallAttributionsResourceConfiguration_InitializationFactory`
|
|
7
|
+
* - Writer: the provider-call recorder (`ProviderCallRecorderBackendService`), beside every provider-call record.
|
|
8
|
+
* - Readers: the model-cost summary (`POST /model-cost/summary`) and the period close, both engine services.
|
|
9
|
+
*
|
|
10
|
+
* The runtime reasoning (why a separate table from the evidence records, the closed projection, exact cost) lives
|
|
11
|
+
* in the schema file's header and is not restated here.
|
|
12
|
+
*/
|
|
13
|
+
import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
14
|
+
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
|
|
15
|
+
import { AgentCallTraceKind, CoreResourceOperation as Op, ModelCallAttributionSchema, ModelCallAttributionShare, ModelCallAttributionSource, ModelCallPricingStatus, ReasoningUsageReporting, ResourcePrimaryScope, modelCallAttributionsResourceConfiguration_InitializationFactory as modelCallAttributionsFactory, } from '@wildo-ai/saas-models';
|
|
16
|
+
import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
|
|
17
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
18
|
+
const enumDeclaration = (exportName) => ({
|
|
19
|
+
packageName: '@wildo-ai/saas-models',
|
|
20
|
+
exportName,
|
|
21
|
+
symbolKind: CodeSymbolKind.ENUM,
|
|
22
|
+
declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,
|
|
23
|
+
});
|
|
24
|
+
export const modelCallAttributionsResourceSpecification = resourceSpecification(modelCallAttributionsFactory, ModelCallAttributionSchema, ({ schemaShape }) => ({
|
|
25
|
+
purpose: 'Record, for every call the application makes to a model provider, which organization, which case and which run it served, what it consumed and what it cost.',
|
|
26
|
+
businessRole: 'What an AI-native service firm computes its cost per case from: inference cost attributed to the case it was spent on, beside the expert time spent on the same case.',
|
|
27
|
+
lifecycleRole: 'Written by the engine beside each provider-call record, never updated, deleted with its organization, and otherwise deleted by the retention-class sweep once the application\'s OPERATIONAL_LOGS period has passed since it was written.',
|
|
28
|
+
audience: LabelAudience.DEVELOPER,
|
|
29
|
+
subDomain: EngineResourceSubDomain.FLOWS_ACTORS,
|
|
30
|
+
codeHandling: {
|
|
31
|
+
mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ModelCallAttributionSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },
|
|
32
|
+
resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'modelCallAttributionsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },
|
|
33
|
+
resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'MODEL_CALL_ATTRIBUTIONS' },
|
|
34
|
+
operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },
|
|
35
|
+
notes: [
|
|
36
|
+
'Every operation is route-less: CREATE, READ and LIST are REPOSITORY_ONLY and DELETE_MANY is INTERNAL_CALL (the retention sweep and the tenant cascade delete through the service layer). The roles are never exercised by a request.',
|
|
37
|
+
'Rows are built only by `projectModelCallAttribution`, a closed projection of the provider-call record: no prompt, output, error message, userId or free-form trace attribute can reach the table.',
|
|
38
|
+
'Retention: `retentionBinding: { retentionClass: OPERATIONAL_LOGS, startPoint: CREATED }` (#1613). The invoice-backing record is `modelCostPeriodAggregates`, not these rows.',
|
|
39
|
+
'Teardown: the `organizations → modelCallAttributions` edge deletes a tenant\'s rows with it, after the purge has closed its open cost period into an aggregate.',
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
fields: {
|
|
43
|
+
_id: schemaShape._id.stringSpec({ meaning: 'Identity of this attribution row.', semanticRole: 'identifier' }),
|
|
44
|
+
applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the call was made by, stamped from the canonical identity.', semanticRole: 'identifier' }),
|
|
45
|
+
providerCallRecordId: schemaShape.providerCallRecordId.stringSpec({
|
|
46
|
+
meaning: 'The provider-call record this row attributes.',
|
|
47
|
+
whyItMatters: 'Several rows may name one record when one call served several cases (an embedding batch); a summary counts distinct records, never rows.',
|
|
48
|
+
semanticRole: 'identifier',
|
|
49
|
+
}),
|
|
50
|
+
agentRef: schemaShape.agentRef.stringSpec({ meaning: 'The agent the call served, or the engine service\'s label for an embedding or extraction.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),
|
|
51
|
+
kind: schemaShape.kind.enumSpec({
|
|
52
|
+
meaning: 'Whether the call generated text or produced embeddings.',
|
|
53
|
+
enumDeclaration: enumDeclaration('AgentCallTraceKind'),
|
|
54
|
+
values: {
|
|
55
|
+
[AgentCallTraceKind.GENERATION]: { meaning: 'A generation call: prompt tokens in, completion tokens out.' },
|
|
56
|
+
[AgentCallTraceKind.EMBEDDING]: { meaning: 'An embedding call: input tokens in, vectors out.' },
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
provider: schemaShape.provider.stringSpec({ meaning: 'The provider the call went to.', semanticRole: 'code' }),
|
|
60
|
+
model: schemaShape.model.stringSpec({ meaning: 'The model the call resolved to — what a registered price is matched against.', semanticRole: 'code' }),
|
|
61
|
+
calledAt: schemaShape.calledAt.dateSpec({ meaning: 'When the call was initiated.', whyItMatters: 'The instant a summary window and a monthly cost period are cut on.', temporalRole: 'occurred', importance: FieldSemanticImportance.PRIMARY }),
|
|
62
|
+
correlationId: schemaShape.correlationId.stringSpec({ meaning: 'The request or job correlation id the call ran under.', whyItMatters: 'A join key into the logs and the audit trail, never an authorization input.', semanticRole: 'identifier' }),
|
|
63
|
+
organizationId: schemaShape.organizationId.foreignKeySpec({
|
|
64
|
+
meaning: 'The organization the call served.',
|
|
65
|
+
whyItMatters: 'Derived by the engine from an authenticated owner field or from the case row\'s own scope, never from a caller or a model. Absent on an unattributed call.',
|
|
66
|
+
importance: FieldSemanticImportance.PRIMARY,
|
|
67
|
+
}),
|
|
68
|
+
caseRef: schemaShape.caseRef.objectSpec({
|
|
69
|
+
meaning: 'The case the call served: a row of a resource declared `workUnit: true`.',
|
|
70
|
+
whyItMatters: 'What a cost-per-case summary groups by. It names the row and copies nothing from it, so erasing the case leaves this row pointing at an impersonalized or absent record.',
|
|
71
|
+
}),
|
|
72
|
+
executionRef: schemaShape.executionRef.objectSpec({ meaning: 'The run the call was made in: a conversational turn, an actor execution, a batch run or an inbound delivery.' }),
|
|
73
|
+
taskRef: schemaShape.taskRef.stringSpec({ meaning: 'The actor task within that run, when there is one.', semanticRole: 'identifier' }),
|
|
74
|
+
attributionSource: schemaShape.attributionSource.enumSpec({
|
|
75
|
+
meaning: 'How this row learned which work the call served.',
|
|
76
|
+
whyItMatters: 'UNATTRIBUTED calls are counted apart by every summary: a cost per case that silently dropped them would look complete and be low.',
|
|
77
|
+
enumDeclaration: enumDeclaration('ModelCallAttributionSource'),
|
|
78
|
+
values: {
|
|
79
|
+
[ModelCallAttributionSource.EXPLICIT]: { meaning: 'The call site passed the attribution with the call.' },
|
|
80
|
+
[ModelCallAttributionSource.AMBIENT]: { meaning: 'Read from the work frame the engine opened around the call.' },
|
|
81
|
+
[ModelCallAttributionSource.UNATTRIBUTED]: { meaning: 'The call ran outside any work frame (platform tooling).' },
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
share: schemaShape.share.enumSpec({
|
|
85
|
+
meaning: 'Which part of the call this row accounts for.',
|
|
86
|
+
enumDeclaration: enumDeclaration('ModelCallAttributionShare'),
|
|
87
|
+
values: {
|
|
88
|
+
[ModelCallAttributionShare.WHOLE_CALL]: { meaning: 'The whole call served one unit of work (share 1/1).' },
|
|
89
|
+
[ModelCallAttributionShare.APPORTIONED_BY_INPUT_LENGTH]: { meaning: 'One call served several cases of one organization; this row carries its input length over the call\'s total.' },
|
|
90
|
+
},
|
|
91
|
+
}),
|
|
92
|
+
shareNumerator: schemaShape.shareNumerator.numberSpec({ meaning: 'This row\'s share of the call, numerator.' }),
|
|
93
|
+
shareDenominator: schemaShape.shareDenominator.numberSpec({ meaning: 'This row\'s share of the call, denominator.' }),
|
|
94
|
+
promptTokens: schemaShape.promptTokens.numberSpec({ meaning: 'Input tokens of the whole call.' }),
|
|
95
|
+
completionTokens: schemaShape.completionTokens.numberSpec({ meaning: 'Output tokens of the whole call, reasoning included.' }),
|
|
96
|
+
totalTokens: schemaShape.totalTokens.numberSpec({ meaning: 'Total tokens of the whole call.' }),
|
|
97
|
+
noCacheTokens: schemaShape.noCacheTokens.numberSpec({ meaning: 'Input tokens read without a prompt cache, when the provider reported the split.' }),
|
|
98
|
+
cacheReadTokens: schemaShape.cacheReadTokens.numberSpec({ meaning: 'Input tokens served from a prompt cache.' }),
|
|
99
|
+
cacheWriteTokens: schemaShape.cacheWriteTokens.numberSpec({ meaning: 'Input tokens written into a prompt cache.' }),
|
|
100
|
+
textTokens: schemaShape.textTokens.numberSpec({ meaning: 'Visible output tokens, when the provider reported the split.' }),
|
|
101
|
+
reasoningTokens: schemaShape.reasoningTokens.numberSpec({ meaning: 'Output tokens spent on reasoning, a part of the completion. Absent when the provider did not report the split.' }),
|
|
102
|
+
reasoningUsage: schemaShape.reasoningUsage.enumSpec({
|
|
103
|
+
meaning: 'Whether the provider reported how many output tokens were reasoning.',
|
|
104
|
+
whyItMatters: 'An unreported split is never read as zero reasoning: zero would be a claim the provider did not make.',
|
|
105
|
+
enumDeclaration: enumDeclaration('ReasoningUsageReporting'),
|
|
106
|
+
values: {
|
|
107
|
+
[ReasoningUsageReporting.REPORTED]: { meaning: 'The provider reported the reasoning split.' },
|
|
108
|
+
[ReasoningUsageReporting.UNREPORTED]: { meaning: 'The provider did not report it (Anthropic and Mistral do not).' },
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
pricingStatus: schemaShape.pricingStatus.enumSpec({
|
|
112
|
+
meaning: 'Whether one of the application\'s registered prices covered the call.',
|
|
113
|
+
enumDeclaration: enumDeclaration('ModelCallPricingStatus'),
|
|
114
|
+
values: {
|
|
115
|
+
[ModelCallPricingStatus.PRICED]: { meaning: 'A registered price for the provider and model was in effect at the call.' },
|
|
116
|
+
[ModelCallPricingStatus.UNPRICED]: { meaning: 'No registered price matched; the call is counted apart, never priced at zero.' },
|
|
117
|
+
},
|
|
118
|
+
}),
|
|
119
|
+
pricingAuthorityRef: schemaShape.pricingAuthorityRef.stringSpec({ meaning: 'The registered price used, by its stable name.', semanticRole: 'code' }),
|
|
120
|
+
pricingAuthorityVersion: schemaShape.pricingAuthorityVersion.numberSpec({ meaning: 'The version of that price.' }),
|
|
121
|
+
currency: schemaShape.currency.stringSpec({ meaning: 'ISO 4217 currency of the computed cost.', semanticRole: 'code' }),
|
|
122
|
+
callCostMinorNumerator: schemaShape.callCostMinorNumerator.stringSpec({
|
|
123
|
+
meaning: 'The whole call\'s exact cost in minor units, numerator (a decimal integer).',
|
|
124
|
+
whyItMatters: 'Stored unrounded: a total is rounded up once, when it is reported, so many small calls are not overstated by a minor unit each.',
|
|
125
|
+
}),
|
|
126
|
+
callCostUnitsDenominator: schemaShape.callCostUnitsDenominator.numberSpec({ meaning: 'The whole call\'s exact cost in minor units, denominator.' }),
|
|
127
|
+
reportedCostAmount: schemaShape.reportedCostAmount.numberSpec({ meaning: 'A cost the provider reported itself, verbatim in its own unit; kept apart from the computed cost.' }),
|
|
128
|
+
reportedCurrency: schemaShape.reportedCurrency.stringSpec({ meaning: 'The currency of the provider-reported cost.', semanticRole: 'code' }),
|
|
129
|
+
createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the row was written.', whyItMatters: 'The retention clock: the row is deleted once the declared OPERATIONAL_LOGS period has passed since this instant.', temporalRole: 'creation' }),
|
|
130
|
+
},
|
|
131
|
+
operations: {
|
|
132
|
+
[Op.CREATE]: {
|
|
133
|
+
purpose: 'Record the attribution of one provider call.',
|
|
134
|
+
outcome: 'The call counts toward its organization\'s and its case\'s cost.',
|
|
135
|
+
responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The attribution was recorded. Internal write path.' }],
|
|
136
|
+
},
|
|
137
|
+
[Op.READ]: {
|
|
138
|
+
purpose: 'Read one attribution row for an internal caller.',
|
|
139
|
+
outcome: 'The row is returned to the internal caller.',
|
|
140
|
+
idempotent: true,
|
|
141
|
+
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The row was found.' }],
|
|
142
|
+
},
|
|
143
|
+
[Op.LIST]: {
|
|
144
|
+
purpose: 'List attribution rows for an internal caller.',
|
|
145
|
+
outcome: 'The rows are returned to the internal caller.',
|
|
146
|
+
idempotent: true,
|
|
147
|
+
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The rows were returned.' }],
|
|
148
|
+
},
|
|
149
|
+
[Op.DELETE_MANY]: {
|
|
150
|
+
purpose: 'Internal cleanup: the retention-class sweep and the tenant cascade. No public deletion route.',
|
|
151
|
+
outcome: 'Rows past the OPERATIONAL_LOGS period, or of a deleted organization, are removed.',
|
|
152
|
+
idempotent: true,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
businessConstraints: [
|
|
156
|
+
'Identifiers and counts only: no prompt, output, error message or person is ever stored.',
|
|
157
|
+
'Every recorded provider call has at least one attribution row; a call made outside any unit of work has one UNATTRIBUTED row.',
|
|
158
|
+
'The organization is derived from the case row or an authenticated owner, never from the caller or the model.',
|
|
159
|
+
'Append-only: there is no update. Recording is best-effort and never fails the call it records.',
|
|
160
|
+
],
|
|
161
|
+
}), { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION });
|
|
162
|
+
//# sourceMappingURL=model-call-attributions.resource.specification.js.map
|
package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-call-attributions.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/flows-actors/resources/model-call-attributions.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,kBAAkB,EAClB,qBAAqB,IAAI,EAAE,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,gEAAgE,IAAI,4BAA4B,GACjG,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0CAA0C,GAAmC,qBAAqB,CAC7G,4BAA4B,EAC5B,0BAA0B,EAC1B,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,8JAA8J;IACvK,YAAY,EAAE,uKAAuK;IACrL,aAAa,EAAE,2OAA2O;IAC1P,QAAQ,E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,OAAO,EAAE,6CAA6C;YACtD,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;SAC3F;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,+CAA+C;YACxD,OAAO,EAAE,+CAA+C;YACxD,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;SAChG;QACD,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE;YAChB,OAAO,EAAE,+FAA+F;YACxG,OAAO,EAAE,mFAAmF;YAC5F,UAAU,EAAE,IAAI;SACjB;KACF;IAED,mBAAmB,EAAE;QACnB,yFAAyF;QACzF,+HAA+H;QAC/H,8GAA8G;QAC9G,gGAAgG;KACjG;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["/**\n * Resource: `modelCallAttributions` — Wildo SaaS engine specification (application-scoped storage, engine-written). #1598.\n *\n * Inputs:\n * - Schema: `ModelCallAttributionSchema` (`flows-actors/model-call-attributions.shared.schemas.ts`)\n * - Factory: `modelCallAttributionsResourceConfiguration_InitializationFactory`\n * - Writer: the provider-call recorder (`ProviderCallRecorderBackendService`), beside every provider-call record.\n * - Readers: the model-cost summary (`POST /model-cost/summary`) and the period close, both engine services.\n *\n * The runtime reasoning (why a separate table from the evidence records, the closed projection, exact cost) lives\n * in the schema file's header and is not restated here.\n */\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n AgentCallTraceKind,\n CoreResourceOperation as Op,\n ModelCallAttributionSchema,\n ModelCallAttributionShare,\n ModelCallAttributionSource,\n ModelCallPricingStatus,\n ReasoningUsageReporting,\n ResourcePrimaryScope,\n modelCallAttributionsResourceConfiguration_InitializationFactory as modelCallAttributionsFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nexport const modelCallAttributionsResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n modelCallAttributionsFactory,\n ModelCallAttributionSchema,\n ({ schemaShape }) => ({\n purpose: 'Record, for every call the application makes to a model provider, which organization, which case and which run it served, what it consumed and what it cost.',\n businessRole: 'What an AI-native service firm computes its cost per case from: inference cost attributed to the case it was spent on, beside the expert time spent on the same case.',\n lifecycleRole: 'Written by the engine beside each provider-call record, never updated, deleted with its organization, and otherwise deleted by the retention-class sweep once the application\\'s OPERATIONAL_LOGS period has passed since it was written.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ModelCallAttributionSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'modelCallAttributionsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'MODEL_CALL_ATTRIBUTIONS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'Every operation is route-less: CREATE, READ and LIST are REPOSITORY_ONLY and DELETE_MANY is INTERNAL_CALL (the retention sweep and the tenant cascade delete through the service layer). The roles are never exercised by a request.',\n 'Rows are built only by `projectModelCallAttribution`, a closed projection of the provider-call record: no prompt, output, error message, userId or free-form trace attribute can reach the table.',\n 'Retention: `retentionBinding: { retentionClass: OPERATIONAL_LOGS, startPoint: CREATED }` (#1613). The invoice-backing record is `modelCostPeriodAggregates`, not these rows.',\n 'Teardown: the `organizations → modelCallAttributions` edge deletes a tenant\\'s rows with it, after the purge has closed its open cost period into an aggregate.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of this attribution row.', semanticRole: 'identifier' }),\n applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the call was made by, stamped from the canonical identity.', semanticRole: 'identifier' }),\n providerCallRecordId: schemaShape.providerCallRecordId.stringSpec({\n meaning: 'The provider-call record this row attributes.',\n whyItMatters: 'Several rows may name one record when one call served several cases (an embedding batch); a summary counts distinct records, never rows.',\n semanticRole: 'identifier',\n }),\n agentRef: schemaShape.agentRef.stringSpec({ meaning: 'The agent the call served, or the engine service\\'s label for an embedding or extraction.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n kind: schemaShape.kind.enumSpec({\n meaning: 'Whether the call generated text or produced embeddings.',\n enumDeclaration: enumDeclaration('AgentCallTraceKind'),\n values: {\n [AgentCallTraceKind.GENERATION]: { meaning: 'A generation call: prompt tokens in, completion tokens out.' },\n [AgentCallTraceKind.EMBEDDING]: { meaning: 'An embedding call: input tokens in, vectors out.' },\n },\n }),\n provider: schemaShape.provider.stringSpec({ meaning: 'The provider the call went to.', semanticRole: 'code' }),\n model: schemaShape.model.stringSpec({ meaning: 'The model the call resolved to — what a registered price is matched against.', semanticRole: 'code' }),\n calledAt: schemaShape.calledAt.dateSpec({ meaning: 'When the call was initiated.', whyItMatters: 'The instant a summary window and a monthly cost period are cut on.', temporalRole: 'occurred', importance: FieldSemanticImportance.PRIMARY }),\n correlationId: schemaShape.correlationId.stringSpec({ meaning: 'The request or job correlation id the call ran under.', whyItMatters: 'A join key into the logs and the audit trail, never an authorization input.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization the call served.',\n whyItMatters: 'Derived by the engine from an authenticated owner field or from the case row\\'s own scope, never from a caller or a model. Absent on an unattributed call.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n caseRef: schemaShape.caseRef.objectSpec({\n meaning: 'The case the call served: a row of a resource declared `workUnit: true`.',\n whyItMatters: 'What a cost-per-case summary groups by. It names the row and copies nothing from it, so erasing the case leaves this row pointing at an impersonalized or absent record.',\n }),\n executionRef: schemaShape.executionRef.objectSpec({ meaning: 'The run the call was made in: a conversational turn, an actor execution, a batch run or an inbound delivery.' }),\n taskRef: schemaShape.taskRef.stringSpec({ meaning: 'The actor task within that run, when there is one.', semanticRole: 'identifier' }),\n attributionSource: schemaShape.attributionSource.enumSpec({\n meaning: 'How this row learned which work the call served.',\n whyItMatters: 'UNATTRIBUTED calls are counted apart by every summary: a cost per case that silently dropped them would look complete and be low.',\n enumDeclaration: enumDeclaration('ModelCallAttributionSource'),\n values: {\n [ModelCallAttributionSource.EXPLICIT]: { meaning: 'The call site passed the attribution with the call.' },\n [ModelCallAttributionSource.AMBIENT]: { meaning: 'Read from the work frame the engine opened around the call.' },\n [ModelCallAttributionSource.UNATTRIBUTED]: { meaning: 'The call ran outside any work frame (platform tooling).' },\n },\n }),\n share: schemaShape.share.enumSpec({\n meaning: 'Which part of the call this row accounts for.',\n enumDeclaration: enumDeclaration('ModelCallAttributionShare'),\n values: {\n [ModelCallAttributionShare.WHOLE_CALL]: { meaning: 'The whole call served one unit of work (share 1/1).' },\n [ModelCallAttributionShare.APPORTIONED_BY_INPUT_LENGTH]: { meaning: 'One call served several cases of one organization; this row carries its input length over the call\\'s total.' },\n },\n }),\n shareNumerator: schemaShape.shareNumerator.numberSpec({ meaning: 'This row\\'s share of the call, numerator.' }),\n shareDenominator: schemaShape.shareDenominator.numberSpec({ meaning: 'This row\\'s share of the call, denominator.' }),\n promptTokens: schemaShape.promptTokens.numberSpec({ meaning: 'Input tokens of the whole call.' }),\n completionTokens: schemaShape.completionTokens.numberSpec({ meaning: 'Output tokens of the whole call, reasoning included.' }),\n totalTokens: schemaShape.totalTokens.numberSpec({ meaning: 'Total tokens of the whole call.' }),\n noCacheTokens: schemaShape.noCacheTokens.numberSpec({ meaning: 'Input tokens read without a prompt cache, when the provider reported the split.' }),\n cacheReadTokens: schemaShape.cacheReadTokens.numberSpec({ meaning: 'Input tokens served from a prompt cache.' }),\n cacheWriteTokens: schemaShape.cacheWriteTokens.numberSpec({ meaning: 'Input tokens written into a prompt cache.' }),\n textTokens: schemaShape.textTokens.numberSpec({ meaning: 'Visible output tokens, when the provider reported the split.' }),\n reasoningTokens: schemaShape.reasoningTokens.numberSpec({ meaning: 'Output tokens spent on reasoning, a part of the completion. Absent when the provider did not report the split.' }),\n reasoningUsage: schemaShape.reasoningUsage.enumSpec({\n meaning: 'Whether the provider reported how many output tokens were reasoning.',\n whyItMatters: 'An unreported split is never read as zero reasoning: zero would be a claim the provider did not make.',\n enumDeclaration: enumDeclaration('ReasoningUsageReporting'),\n values: {\n [ReasoningUsageReporting.REPORTED]: { meaning: 'The provider reported the reasoning split.' },\n [ReasoningUsageReporting.UNREPORTED]: { meaning: 'The provider did not report it (Anthropic and Mistral do not).' },\n },\n }),\n pricingStatus: schemaShape.pricingStatus.enumSpec({\n meaning: 'Whether one of the application\\'s registered prices covered the call.',\n enumDeclaration: enumDeclaration('ModelCallPricingStatus'),\n values: {\n [ModelCallPricingStatus.PRICED]: { meaning: 'A registered price for the provider and model was in effect at the call.' },\n [ModelCallPricingStatus.UNPRICED]: { meaning: 'No registered price matched; the call is counted apart, never priced at zero.' },\n },\n }),\n pricingAuthorityRef: schemaShape.pricingAuthorityRef.stringSpec({ meaning: 'The registered price used, by its stable name.', semanticRole: 'code' }),\n pricingAuthorityVersion: schemaShape.pricingAuthorityVersion.numberSpec({ meaning: 'The version of that price.' }),\n currency: schemaShape.currency.stringSpec({ meaning: 'ISO 4217 currency of the computed cost.', semanticRole: 'code' }),\n callCostMinorNumerator: schemaShape.callCostMinorNumerator.stringSpec({\n meaning: 'The whole call\\'s exact cost in minor units, numerator (a decimal integer).',\n whyItMatters: 'Stored unrounded: a total is rounded up once, when it is reported, so many small calls are not overstated by a minor unit each.',\n }),\n callCostUnitsDenominator: schemaShape.callCostUnitsDenominator.numberSpec({ meaning: 'The whole call\\'s exact cost in minor units, denominator.' }),\n reportedCostAmount: schemaShape.reportedCostAmount.numberSpec({ meaning: 'A cost the provider reported itself, verbatim in its own unit; kept apart from the computed cost.' }),\n reportedCurrency: schemaShape.reportedCurrency.stringSpec({ meaning: 'The currency of the provider-reported cost.', semanticRole: 'code' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the row was written.', whyItMatters: 'The retention clock: the row is deleted once the declared OPERATIONAL_LOGS period has passed since this instant.', temporalRole: 'creation' }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Record the attribution of one provider call.',\n outcome: 'The call counts toward its organization\\'s and its case\\'s cost.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The attribution was recorded. Internal write path.' }],\n },\n [Op.READ]: {\n purpose: 'Read one attribution row for an internal caller.',\n outcome: 'The row is returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The row was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List attribution rows for an internal caller.',\n outcome: 'The rows are returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The rows were returned.' }],\n },\n [Op.DELETE_MANY]: {\n purpose: 'Internal cleanup: the retention-class sweep and the tenant cascade. No public deletion route.',\n outcome: 'Rows past the OPERATIONAL_LOGS period, or of a deleted organization, are removed.',\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Identifiers and counts only: no prompt, output, error message or person is ever stored.',\n 'Every recorded provider call has at least one attribution row; a call made outside any unit of work has one UNATTRIBUTED row.',\n 'The organization is derived from the case row or an authenticated owner, never from the caller or the model.',\n 'Append-only: there is no update. Recording is best-effort and never fails the call it records.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-cost-period-aggregates.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,8BAA8B,EAAiD,MAAM,6BAA6B,CAAC;AAkCjI,eAAO,MAAM,8CAA8C,EAAE,8BAwH5D,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource: `modelCostPeriodAggregates` — Wildo SaaS engine specification (application-scoped storage). #1598.
|
|
3
|
+
*
|
|
4
|
+
* Inputs:
|
|
5
|
+
* - Schema: `ModelCostPeriodAggregateSchema` (`flows-actors/model-cost-period-aggregates.shared.schemas.ts`)
|
|
6
|
+
* - Factory: `modelCostPeriodAggregatesResourceConfiguration_InitializationFactory`
|
|
7
|
+
* - Custom operation: `ModelCostPeriodAggregates_Operations.LINK_INVOICE`, implemented by
|
|
8
|
+
* `model-cost.custom-impl.backend.service.ts` (saas-backend-lib).
|
|
9
|
+
* - Writers: the model-cost period-close batch, and the close at an organization's deletion mark and purge.
|
|
10
|
+
*/
|
|
11
|
+
import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
12
|
+
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
|
|
13
|
+
import { CoreResourceOperation as Op, ModelCostPeriodAggregateSchema, ModelCostPeriodAggregates_Operations, ResourcePrimaryScope, modelCostPeriodAggregatesResourceConfiguration_InitializationFactory as modelCostPeriodAggregatesFactory, } from '@wildo-ai/saas-models';
|
|
14
|
+
import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
|
|
15
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
16
|
+
const enumDeclaration = (exportName) => ({
|
|
17
|
+
packageName: '@wildo-ai/saas-models',
|
|
18
|
+
exportName,
|
|
19
|
+
symbolKind: CodeSymbolKind.ENUM,
|
|
20
|
+
declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,
|
|
21
|
+
});
|
|
22
|
+
const EXAMPLE_AGGREGATE = {
|
|
23
|
+
_id: '66f6a1c2e3d4b5a697881234',
|
|
24
|
+
applicationId: 'app_01J4P8F1M2N3Q4R5S6T7V8W9XY',
|
|
25
|
+
periodKey: 'org_01J4P8F1M2N3Q4R5S6T7V8W9XZ:2026-08:USD',
|
|
26
|
+
organizationId: 'org_01J4P8F1M2N3Q4R5S6T7V8W9XZ',
|
|
27
|
+
periodStart: '2026-08-01T00:00:00.000Z',
|
|
28
|
+
periodEnd: '2026-09-01T00:00:00.000Z',
|
|
29
|
+
currency: 'USD',
|
|
30
|
+
attributedCallCount: 1204,
|
|
31
|
+
unpricedCallCount: 0,
|
|
32
|
+
promptTokens: 3_120_000,
|
|
33
|
+
completionTokens: 410_000,
|
|
34
|
+
totalTokens: 3_530_000,
|
|
35
|
+
cacheReadTokens: 900_000,
|
|
36
|
+
cacheWriteTokens: 0,
|
|
37
|
+
reasoningTokens: 120_000,
|
|
38
|
+
costMinor: 1_197,
|
|
39
|
+
pricingAuthorities: [{ pricingAuthorityRef: 'pricing:openai/gpt-5.6-terra', pricingAuthorityVersion: 1 }],
|
|
40
|
+
closedAt: '2026-09-04T02:17:00.000Z',
|
|
41
|
+
// The id of the organization's `organizationInvoiceRefs` row, not the payment provider's invoice number.
|
|
42
|
+
organizationInvoiceRefId: '66f6a1c2e3d4b5a697885678',
|
|
43
|
+
createdAt: '2026-09-04T02:17:00.000Z',
|
|
44
|
+
};
|
|
45
|
+
export const modelCostPeriodAggregatesResourceSpecification = resourceSpecification(modelCostPeriodAggregatesFactory, ModelCostPeriodAggregateSchema, ({ schemaShape }) => ({
|
|
46
|
+
purpose: 'Hold one organization\'s model cost for one calendar month in one currency, written once the month is over: the durable record an invoice cites.',
|
|
47
|
+
businessRole: 'The business record behind billing a client for the inference its cases consumed. Detail rows are operational logs; this total is what is kept, and kept past the client\'s deletion when an invoice bills it.',
|
|
48
|
+
lifecycleRole: 'Written by the period close after the month ends plus a declared grace, or at the organization\'s deletion for its open period (provisionally, until the month is due); linked once to the invoice that bills it; kept for the BUSINESS_RECORDS period from the end of the calendar year. At the organization\'s deletion, an aggregate no invoice bills is deleted.',
|
|
49
|
+
audience: LabelAudience.DEVELOPER,
|
|
50
|
+
subDomain: EngineResourceSubDomain.FLOWS_ACTORS,
|
|
51
|
+
codeHandling: {
|
|
52
|
+
mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ModelCostPeriodAggregateSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },
|
|
53
|
+
resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'modelCostPeriodAggregatesResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },
|
|
54
|
+
resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'MODEL_COST_PERIOD_AGGREGATES' },
|
|
55
|
+
operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation'), customEnum: enumDeclaration('ModelCostPeriodAggregates_Operations') },
|
|
56
|
+
notes: [
|
|
57
|
+
'Three routes under `/applications/{applicationId}` (the APPLICATION row\'s id, which the per-row authorization compares), all for the application\'s billing people (APP_ADMIN_SUPER_ADMIN, APP_ADMIN_BILLING_MANAGER): LIST, filtered by `organizationId`, `currency` or `periodKey`, and READ to find the month being invoiced, and `link_invoice`. CREATE is REPOSITORY_ONLY (the close writes through the repository); READ and LIST also keep a route-less INTERNAL_CALL default for the service tier; UPDATE_MANY and DELETE_MANY are INTERNAL_CALL.',
|
|
58
|
+
'An aggregate the deletion mark wrote before its month was due is PROVISIONAL: the next close rewrites it from the rows as they stand, unless an invoice billed it first. One closed after its month was due, or linked, is final.',
|
|
59
|
+
'Retention: `retentionBinding: { retentionClass: BUSINESS_RECORDS, startPoint: END_OF_CALENDAR_YEAR }`, and `retentionPolicy: { mode: RETAIN_ONLY, statutoryRetention: { ground: LEGAL_OBLIGATION } }` naming the bookkeeping statutes (HGB §257, AO §147, Code de commerce L123-22). The engine refuses a BUSINESS_RECORDS resource that names no statute (#1635), and the retention policy is why UPDATE_MANY and the service-resolvable reads exist. No personal data and no data subject (`dataSubjectPolicy: NO_PRINCIPAL`).',
|
|
60
|
+
'Teardown: the `organizations → modelCostPeriodAggregates` edge disables the cascade. The purge\'s own close deletes the organization\'s UNLINKED aggregates after it commits; a linked one outlives the organization for its statutory period.',
|
|
61
|
+
'Unpriced calls are totalled under the ISO 4217 code `XXX` ("no currency") so an unpriced month is recorded, not absent.',
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
fields: {
|
|
65
|
+
_id: schemaShape._id.stringSpec({ meaning: 'Identity of the aggregate.', semanticRole: 'identifier' }),
|
|
66
|
+
applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the cost belongs to.', semanticRole: 'identifier' }),
|
|
67
|
+
periodKey: schemaShape.periodKey.stringSpec({
|
|
68
|
+
meaning: 'The aggregate\'s natural key: organization, month and currency.',
|
|
69
|
+
whyItMatters: 'Unique, so a second close of the same period can never write a second total.',
|
|
70
|
+
semanticRole: 'identifier',
|
|
71
|
+
}),
|
|
72
|
+
organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization whose model cost this is.', importance: FieldSemanticImportance.PRIMARY }),
|
|
73
|
+
periodStart: schemaShape.periodStart.dateSpec({ meaning: 'First instant of the calendar month (UTC), inclusive.', temporalRole: 'occurred', importance: FieldSemanticImportance.PRIMARY }),
|
|
74
|
+
periodEnd: schemaShape.periodEnd.dateSpec({ meaning: 'First instant of the next month (UTC), exclusive.', temporalRole: 'occurred' }),
|
|
75
|
+
currency: schemaShape.currency.stringSpec({ meaning: 'ISO 4217 code of every total on the row, or XXX for the calls no registered price covered.', semanticRole: 'code' }),
|
|
76
|
+
attributedCallCount: schemaShape.attributedCallCount.numberSpec({ meaning: 'Distinct model calls attributed to the organization in the month, in this currency slot.' }),
|
|
77
|
+
unpricedCallCount: schemaShape.unpricedCallCount.numberSpec({ meaning: 'Of those, the calls no registered price covered.' }),
|
|
78
|
+
promptTokens: schemaShape.promptTokens.numberSpec({ meaning: 'Input tokens in the month, each row\'s share applied.' }),
|
|
79
|
+
completionTokens: schemaShape.completionTokens.numberSpec({ meaning: 'Output tokens in the month, each row\'s share applied.' }),
|
|
80
|
+
totalTokens: schemaShape.totalTokens.numberSpec({ meaning: 'Total tokens in the month, each row\'s share applied.' }),
|
|
81
|
+
cacheReadTokens: schemaShape.cacheReadTokens.numberSpec({ meaning: 'Input tokens served from a prompt cache.' }),
|
|
82
|
+
cacheWriteTokens: schemaShape.cacheWriteTokens.numberSpec({ meaning: 'Input tokens written into a prompt cache.' }),
|
|
83
|
+
reasoningTokens: schemaShape.reasoningTokens.numberSpec({ meaning: 'Reasoning tokens the providers reported (a part of the output).' }),
|
|
84
|
+
costMinor: schemaShape.costMinor.numberSpec({
|
|
85
|
+
meaning: 'The month\'s model cost in minor units of the currency.',
|
|
86
|
+
whyItMatters: 'The exact sum of every call\'s cost, rounded up once: never the sum of per-call roundings.',
|
|
87
|
+
importance: FieldSemanticImportance.PRIMARY,
|
|
88
|
+
}),
|
|
89
|
+
pricingAuthorities: schemaShape.pricingAuthorities.arraySpec({ meaning: 'The registered prices the month\'s calls were priced by.', elementMeaning: 'One price, as `pricingAuthorityRef@pricingAuthorityVersion`.' }),
|
|
90
|
+
closedAt: schemaShape.closedAt.dateSpec({ meaning: 'When the aggregate was written. A closed period is final.', temporalRole: 'occurred' }),
|
|
91
|
+
organizationInvoiceRefId: schemaShape.organizationInvoiceRefId.stringSpec({
|
|
92
|
+
meaning: 'The invoice that bills this cost, set once by `link_invoice`.',
|
|
93
|
+
whyItMatters: 'Its presence is what keeps the aggregate past its organization\'s deletion, for the statutory bookkeeping period.',
|
|
94
|
+
semanticRole: 'identifier',
|
|
95
|
+
}),
|
|
96
|
+
createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the row was written.', temporalRole: 'creation' }),
|
|
97
|
+
},
|
|
98
|
+
operations: {
|
|
99
|
+
[Op.CREATE]: {
|
|
100
|
+
purpose: 'Write one closed period. Written only by the engine\'s period close.',
|
|
101
|
+
outcome: 'The month\'s cost for the organization and currency is recorded.',
|
|
102
|
+
responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'Internal write path.' }],
|
|
103
|
+
},
|
|
104
|
+
[Op.READ]: {
|
|
105
|
+
purpose: 'Read one month\'s model cost of one organization, for the application\'s billing flow.',
|
|
106
|
+
outcome: 'The aggregate is returned.',
|
|
107
|
+
whenToUse: 'Before invoicing a month, to check its total and whether it is already linked.',
|
|
108
|
+
idempotent: true,
|
|
109
|
+
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The aggregate was found.' }],
|
|
110
|
+
errorScenarios: [{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an application super-administrator or billing manager.' }],
|
|
111
|
+
},
|
|
112
|
+
[Op.LIST]: {
|
|
113
|
+
purpose: 'Find the aggregates to invoice: by organization, month (`periodStart`) and currency.',
|
|
114
|
+
outcome: 'The matching aggregates are returned, with the id `link_invoice` takes.',
|
|
115
|
+
whenToUse: 'The billing flow is about to invoice an organization\'s month and needs the aggregate to link.',
|
|
116
|
+
idempotent: true,
|
|
117
|
+
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The aggregates were returned.' }],
|
|
118
|
+
errorScenarios: [{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an application super-administrator or billing manager.' }],
|
|
119
|
+
},
|
|
120
|
+
[Op.UPDATE_MANY]: {
|
|
121
|
+
purpose: 'The erasure writer\'s door the retention policy requires. Route-less; the rows hold no personal data, so nothing is scrubbed.',
|
|
122
|
+
outcome: 'The retained marker only.',
|
|
123
|
+
idempotent: true,
|
|
124
|
+
},
|
|
125
|
+
[Op.DELETE_MANY]: {
|
|
126
|
+
purpose: 'Internal cleanup: the retention-class sweep, and the unlinked aggregates of a deleted organization. No public deletion route.',
|
|
127
|
+
outcome: 'Aggregates past their BUSINESS_RECORDS period, or unbilled aggregates of a deleted organization, are removed.',
|
|
128
|
+
idempotent: true,
|
|
129
|
+
},
|
|
130
|
+
[ModelCostPeriodAggregates_Operations.LINK_INVOICE]: {
|
|
131
|
+
operationId: ModelCostPeriodAggregates_Operations.LINK_INVOICE,
|
|
132
|
+
purpose: 'Record that an invoice bills this aggregate\'s model cost.',
|
|
133
|
+
outcome: 'The aggregate names its invoice, and is kept past its organization\'s deletion for the statutory period. The link is written to the audit trail.',
|
|
134
|
+
whenToUse: 'The application\'s billing flow issued an invoice for the month\'s model cost of this organization.',
|
|
135
|
+
importance: FieldSemanticImportance.PRIMARY,
|
|
136
|
+
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The aggregate is linked; the updated aggregate is returned.' }],
|
|
137
|
+
errorScenarios: [
|
|
138
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an application super-administrator or billing manager.' },
|
|
139
|
+
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No such aggregate, or the invoice is not one of the aggregate\'s organization.' },
|
|
140
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The aggregate is already linked to another invoice; a link is set once.' },
|
|
141
|
+
],
|
|
142
|
+
idempotent: true,
|
|
143
|
+
examples: [{
|
|
144
|
+
title: 'Link August\'s model cost to the invoice that bills it',
|
|
145
|
+
request: { modelCostPeriodAggregateId: EXAMPLE_AGGREGATE._id, organizationInvoiceRefId: EXAMPLE_AGGREGATE.organizationInvoiceRefId },
|
|
146
|
+
response: EXAMPLE_AGGREGATE,
|
|
147
|
+
forStatus: HttpResponseStatusCode.OK_200,
|
|
148
|
+
}],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
businessConstraints: [
|
|
152
|
+
'One aggregate per organization, calendar month and currency; a closed period is final.',
|
|
153
|
+
'Every total is the exact sum of its calls\' costs, rounded up once.',
|
|
154
|
+
'Linked to at most one invoice, once. Only a linked aggregate outlives its organization.',
|
|
155
|
+
'Currencies are never converted: each currency has its own aggregate.',
|
|
156
|
+
],
|
|
157
|
+
}), { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION });
|
|
158
|
+
//# sourceMappingURL=model-cost-period-aggregates.resource.specification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-cost-period-aggregates.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,8BAA8B,EAC9B,oCAAoC,EACpC,oBAAoB,EACpB,oEAAoE,IAAI,gCAAgC,GACzG,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG;IACxB,GAAG,EAAE,0BAA0B;IAC/B,aAAa,EAAE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B;QACD,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE;YAChB,OAAO,EAAE,+HAA+H;YACxI,OAAO,EAAE,+GAA+G;YACxH,UAAU,EAAE,IAAI;SACjB;QACD,CAAC,oCAAoC,CAAC,YAAY,CAAC,EAAE;YACnD,WAAW,EAAE,oCAAoC,CAAC,YAAY;YAC9D,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,kJAAkJ;YAC3J,SAAS,EAAE,qGAAqG;YAChH,UAAU,EAAE,uBAAuB,CAAC,OAAO;YAC3C,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,6DAA6D,EAAE,CAAC;YACnI,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,0EAA0E,EAAE;gBAChI,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,gFAAgF,EAAE;gBACtI,EAAE,IAAI,EAAE,sBAAsB,CAAC,YAAY,EAAE,IAAI,EAAE,yEAAyE,EAAE;aAC/H;YACD,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,CAAC;oBACT,KAAK,EAAE,wDAAwD;oBAC/D,OAAO,EAAE,EAAE,0BAA0B,EAAE,iBAAiB,CAAC,GAAG,EAAE,wBAAwB,EAAE,iBAAiB,CAAC,wBAAwB,EAAE;oBACpI,QAAQ,EAAE,iBAAiB;oBAC3B,SAAS,EAAE,sBAAsB,CAAC,MAAM;iBACzC,CAAC;SACH;KACF;IAED,mBAAmB,EAAE;QACnB,wFAAwF;QACxF,qEAAqE;QACrE,yFAAyF;QACzF,sEAAsE;KACvE;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["/**\n * Resource: `modelCostPeriodAggregates` — Wildo SaaS engine specification (application-scoped storage). #1598.\n *\n * Inputs:\n * - Schema: `ModelCostPeriodAggregateSchema` (`flows-actors/model-cost-period-aggregates.shared.schemas.ts`)\n * - Factory: `modelCostPeriodAggregatesResourceConfiguration_InitializationFactory`\n * - Custom operation: `ModelCostPeriodAggregates_Operations.LINK_INVOICE`, implemented by\n * `model-cost.custom-impl.backend.service.ts` (saas-backend-lib).\n * - Writers: the model-cost period-close batch, and the close at an organization's deletion mark and purge.\n */\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ModelCostPeriodAggregateSchema,\n ModelCostPeriodAggregates_Operations,\n ResourcePrimaryScope,\n modelCostPeriodAggregatesResourceConfiguration_InitializationFactory as modelCostPeriodAggregatesFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nconst EXAMPLE_AGGREGATE = {\n _id: '66f6a1c2e3d4b5a697881234',\n applicationId: 'app_01J4P8F1M2N3Q4R5S6T7V8W9XY',\n periodKey: 'org_01J4P8F1M2N3Q4R5S6T7V8W9XZ:2026-08:USD',\n organizationId: 'org_01J4P8F1M2N3Q4R5S6T7V8W9XZ',\n periodStart: '2026-08-01T00:00:00.000Z',\n periodEnd: '2026-09-01T00:00:00.000Z',\n currency: 'USD',\n attributedCallCount: 1204,\n unpricedCallCount: 0,\n promptTokens: 3_120_000,\n completionTokens: 410_000,\n totalTokens: 3_530_000,\n cacheReadTokens: 900_000,\n cacheWriteTokens: 0,\n reasoningTokens: 120_000,\n costMinor: 1_197,\n pricingAuthorities: [{ pricingAuthorityRef: 'pricing:openai/gpt-5.6-terra', pricingAuthorityVersion: 1 }],\n closedAt: '2026-09-04T02:17:00.000Z',\n // The id of the organization's `organizationInvoiceRefs` row, not the payment provider's invoice number.\n organizationInvoiceRefId: '66f6a1c2e3d4b5a697885678',\n createdAt: '2026-09-04T02:17:00.000Z',\n};\n\nexport const modelCostPeriodAggregatesResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n modelCostPeriodAggregatesFactory,\n ModelCostPeriodAggregateSchema,\n ({ schemaShape }) => ({\n purpose: 'Hold one organization\\'s model cost for one calendar month in one currency, written once the month is over: the durable record an invoice cites.',\n businessRole: 'The business record behind billing a client for the inference its cases consumed. Detail rows are operational logs; this total is what is kept, and kept past the client\\'s deletion when an invoice bills it.',\n lifecycleRole: 'Written by the period close after the month ends plus a declared grace, or at the organization\\'s deletion for its open period (provisionally, until the month is due); linked once to the invoice that bills it; kept for the BUSINESS_RECORDS period from the end of the calendar year. At the organization\\'s deletion, an aggregate no invoice bills is deleted.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ModelCostPeriodAggregateSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'modelCostPeriodAggregatesResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'MODEL_COST_PERIOD_AGGREGATES' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation'), customEnum: enumDeclaration('ModelCostPeriodAggregates_Operations') },\n notes: [\n 'Three routes under `/applications/{applicationId}` (the APPLICATION row\\'s id, which the per-row authorization compares), all for the application\\'s billing people (APP_ADMIN_SUPER_ADMIN, APP_ADMIN_BILLING_MANAGER): LIST, filtered by `organizationId`, `currency` or `periodKey`, and READ to find the month being invoiced, and `link_invoice`. CREATE is REPOSITORY_ONLY (the close writes through the repository); READ and LIST also keep a route-less INTERNAL_CALL default for the service tier; UPDATE_MANY and DELETE_MANY are INTERNAL_CALL.',\n 'An aggregate the deletion mark wrote before its month was due is PROVISIONAL: the next close rewrites it from the rows as they stand, unless an invoice billed it first. One closed after its month was due, or linked, is final.',\n 'Retention: `retentionBinding: { retentionClass: BUSINESS_RECORDS, startPoint: END_OF_CALENDAR_YEAR }`, and `retentionPolicy: { mode: RETAIN_ONLY, statutoryRetention: { ground: LEGAL_OBLIGATION } }` naming the bookkeeping statutes (HGB §257, AO §147, Code de commerce L123-22). The engine refuses a BUSINESS_RECORDS resource that names no statute (#1635), and the retention policy is why UPDATE_MANY and the service-resolvable reads exist. No personal data and no data subject (`dataSubjectPolicy: NO_PRINCIPAL`).',\n 'Teardown: the `organizations → modelCostPeriodAggregates` edge disables the cascade. The purge\\'s own close deletes the organization\\'s UNLINKED aggregates after it commits; a linked one outlives the organization for its statutory period.',\n 'Unpriced calls are totalled under the ISO 4217 code `XXX` (\"no currency\") so an unpriced month is recorded, not absent.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of the aggregate.', semanticRole: 'identifier' }),\n applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the cost belongs to.', semanticRole: 'identifier' }),\n periodKey: schemaShape.periodKey.stringSpec({\n meaning: 'The aggregate\\'s natural key: organization, month and currency.',\n whyItMatters: 'Unique, so a second close of the same period can never write a second total.',\n semanticRole: 'identifier',\n }),\n organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization whose model cost this is.', importance: FieldSemanticImportance.PRIMARY }),\n periodStart: schemaShape.periodStart.dateSpec({ meaning: 'First instant of the calendar month (UTC), inclusive.', temporalRole: 'occurred', importance: FieldSemanticImportance.PRIMARY }),\n periodEnd: schemaShape.periodEnd.dateSpec({ meaning: 'First instant of the next month (UTC), exclusive.', temporalRole: 'occurred' }),\n currency: schemaShape.currency.stringSpec({ meaning: 'ISO 4217 code of every total on the row, or XXX for the calls no registered price covered.', semanticRole: 'code' }),\n attributedCallCount: schemaShape.attributedCallCount.numberSpec({ meaning: 'Distinct model calls attributed to the organization in the month, in this currency slot.' }),\n unpricedCallCount: schemaShape.unpricedCallCount.numberSpec({ meaning: 'Of those, the calls no registered price covered.' }),\n promptTokens: schemaShape.promptTokens.numberSpec({ meaning: 'Input tokens in the month, each row\\'s share applied.' }),\n completionTokens: schemaShape.completionTokens.numberSpec({ meaning: 'Output tokens in the month, each row\\'s share applied.' }),\n totalTokens: schemaShape.totalTokens.numberSpec({ meaning: 'Total tokens in the month, each row\\'s share applied.' }),\n cacheReadTokens: schemaShape.cacheReadTokens.numberSpec({ meaning: 'Input tokens served from a prompt cache.' }),\n cacheWriteTokens: schemaShape.cacheWriteTokens.numberSpec({ meaning: 'Input tokens written into a prompt cache.' }),\n reasoningTokens: schemaShape.reasoningTokens.numberSpec({ meaning: 'Reasoning tokens the providers reported (a part of the output).' }),\n costMinor: schemaShape.costMinor.numberSpec({\n meaning: 'The month\\'s model cost in minor units of the currency.',\n whyItMatters: 'The exact sum of every call\\'s cost, rounded up once: never the sum of per-call roundings.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n pricingAuthorities: schemaShape.pricingAuthorities.arraySpec({ meaning: 'The registered prices the month\\'s calls were priced by.', elementMeaning: 'One price, as `pricingAuthorityRef@pricingAuthorityVersion`.' }),\n closedAt: schemaShape.closedAt.dateSpec({ meaning: 'When the aggregate was written. A closed period is final.', temporalRole: 'occurred' }),\n organizationInvoiceRefId: schemaShape.organizationInvoiceRefId.stringSpec({\n meaning: 'The invoice that bills this cost, set once by `link_invoice`.',\n whyItMatters: 'Its presence is what keeps the aggregate past its organization\\'s deletion, for the statutory bookkeeping period.',\n semanticRole: 'identifier',\n }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the row was written.', temporalRole: 'creation' }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Write one closed period. Written only by the engine\\'s period close.',\n outcome: 'The month\\'s cost for the organization and currency is recorded.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'Internal write path.' }],\n },\n [Op.READ]: {\n purpose: 'Read one month\\'s model cost of one organization, for the application\\'s billing flow.',\n outcome: 'The aggregate is returned.',\n whenToUse: 'Before invoicing a month, to check its total and whether it is already linked.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The aggregate was found.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an application super-administrator or billing manager.' }],\n },\n [Op.LIST]: {\n purpose: 'Find the aggregates to invoice: by organization, month (`periodStart`) and currency.',\n outcome: 'The matching aggregates are returned, with the id `link_invoice` takes.',\n whenToUse: 'The billing flow is about to invoice an organization\\'s month and needs the aggregate to link.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The aggregates were returned.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an application super-administrator or billing manager.' }],\n },\n [Op.UPDATE_MANY]: {\n purpose: 'The erasure writer\\'s door the retention policy requires. Route-less; the rows hold no personal data, so nothing is scrubbed.',\n outcome: 'The retained marker only.',\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'Internal cleanup: the retention-class sweep, and the unlinked aggregates of a deleted organization. No public deletion route.',\n outcome: 'Aggregates past their BUSINESS_RECORDS period, or unbilled aggregates of a deleted organization, are removed.',\n idempotent: true,\n },\n [ModelCostPeriodAggregates_Operations.LINK_INVOICE]: {\n operationId: ModelCostPeriodAggregates_Operations.LINK_INVOICE,\n purpose: 'Record that an invoice bills this aggregate\\'s model cost.',\n outcome: 'The aggregate names its invoice, and is kept past its organization\\'s deletion for the statutory period. The link is written to the audit trail.',\n whenToUse: 'The application\\'s billing flow issued an invoice for the month\\'s model cost of this organization.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The aggregate is linked; the updated aggregate is returned.' }],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an application super-administrator or billing manager.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No such aggregate, or the invoice is not one of the aggregate\\'s organization.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The aggregate is already linked to another invoice; a link is set once.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Link August\\'s model cost to the invoice that bills it',\n request: { modelCostPeriodAggregateId: EXAMPLE_AGGREGATE._id, organizationInvoiceRefId: EXAMPLE_AGGREGATE.organizationInvoiceRefId },\n response: EXAMPLE_AGGREGATE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n\n businessConstraints: [\n 'One aggregate per organization, calendar month and currency; a closed period is final.',\n 'Every total is the exact sum of its calls\\' costs, rounded up once.',\n 'Linked to at most one invoice, once. Only a linked aggregate outlives its organization.',\n 'Currencies are never converted: each currency has its own aggregate.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|
package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import { type AnyResourceSpecificationConfig } from '../../../_core';
|
|
|
7
7
|
* kept, why the recorder writes on every call whatever the traceability level) lives in the schema
|
|
8
8
|
* file's header and is not restated here.
|
|
9
9
|
*
|
|
10
|
-
* Every operation is REPOSITORY_ONLY,
|
|
10
|
+
* Every operation is route-less (REPOSITORY_ONLY, and INTERNAL_CALL for the retention delete), so there
|
|
11
|
+
* is no HTTP surface. The evidence door
|
|
11
12
|
* `GET /assurance/provider-call-evidence` reads these rows as window aggregates and never returns one.
|
|
12
13
|
*/
|
|
13
14
|
export declare const providerCallRecordsResourceSpecification: AnyResourceSpecificationConfig;
|
package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-call-records.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/flows-actors/resources/provider-call-records.resource.specification.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,8BAA8B,EAAiD,MAAM,6BAA6B,CAAC;AAGjI
|
|
1
|
+
{"version":3,"file":"provider-call-records.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/flows-actors/resources/provider-call-records.resource.specification.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,8BAA8B,EAAiD,MAAM,6BAA6B,CAAC;AAGjI;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wCAAwC,EAAE,8BAoLtD,CAAC"}
|
package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js
CHANGED
|
@@ -11,13 +11,14 @@ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
|
11
11
|
* kept, why the recorder writes on every call whatever the traceability level) lives in the schema
|
|
12
12
|
* file's header and is not restated here.
|
|
13
13
|
*
|
|
14
|
-
* Every operation is REPOSITORY_ONLY,
|
|
14
|
+
* Every operation is route-less (REPOSITORY_ONLY, and INTERNAL_CALL for the retention delete), so there
|
|
15
|
+
* is no HTTP surface. The evidence door
|
|
15
16
|
* `GET /assurance/provider-call-evidence` reads these rows as window aggregates and never returns one.
|
|
16
17
|
*/
|
|
17
18
|
export const providerCallRecordsResourceSpecification = resourceSpecification(providerCallRecordsFactory, ProviderCallRecordSchema, ({ schemaShape }) => ({
|
|
18
19
|
purpose: 'Record every physical call the application makes to a model provider: which provider and model, what kind of call, how it ended and what it consumed.',
|
|
19
20
|
businessRole: 'The queryable record behind the claim that the application knows what it sent to which vendor. It is what an evidence reader counts, where the traces sent to logs and analytics vendors cannot be counted.',
|
|
20
|
-
lifecycleRole: 'Written once per provider call by the engine\'s recorder, never updated, and deleted
|
|
21
|
+
lifecycleRole: 'Written once per provider call by the engine\'s recorder, never updated, and deleted by the retention-class sweep once the application\'s declared OPERATIONAL_LOGS period has passed since it was written.',
|
|
21
22
|
audience: LabelAudience.DEVELOPER,
|
|
22
23
|
subDomain: EngineResourceSubDomain.FLOWS_ACTORS,
|
|
23
24
|
codeHandling: {
|
|
@@ -51,7 +52,8 @@ export const providerCallRecordsResourceSpecification = resourceSpecification(pr
|
|
|
51
52
|
},
|
|
52
53
|
},
|
|
53
54
|
notes: [
|
|
54
|
-
'Every operation is
|
|
55
|
+
'Every operation is route-less: CREATE, READ and LIST are REPOSITORY_ONLY, and DELETE_MANY is INTERNAL_CALL because the retention-class sweep deletes through the service layer, which resolves only INTERNAL_CALL. The roles are never exercised by a request.',
|
|
56
|
+
'Retention: `retentionBinding: { retentionClass: OPERATIONAL_LOGS, startPoint: CREATED }` (#1613). The period is the application\'s declared `dataRetention[OPERATIONAL_LOGS]`, never a number of this resource\'s own; while that class is undeclared the rows are kept and every sweep reports it.',
|
|
55
57
|
'Rows are built only by `projectProviderCallRecord`, a closed projection that cannot copy the prompt, the output or an error message.',
|
|
56
58
|
],
|
|
57
59
|
},
|
|
@@ -135,6 +137,14 @@ export const providerCallRecordsResourceSpecification = resourceSpecification(pr
|
|
|
135
137
|
usageComplete: schemaShape.usageComplete.booleanSpec({
|
|
136
138
|
meaning: 'Whether the provider reported every usage dimension this kind of call has. Absent means it said nothing about completeness.',
|
|
137
139
|
}),
|
|
140
|
+
noCacheTokens: schemaShape.noCacheTokens.numberSpec({ meaning: 'Input tokens read without a prompt cache, when the provider reported the input split (#1598).' }),
|
|
141
|
+
cacheReadTokens: schemaShape.cacheReadTokens.numberSpec({ meaning: 'Input tokens served from a prompt cache.', whyItMatters: 'Priced lower than uncached input, so a cost computed without the split would overstate a cached call.' }),
|
|
142
|
+
cacheWriteTokens: schemaShape.cacheWriteTokens.numberSpec({ meaning: 'Input tokens written into a prompt cache.' }),
|
|
143
|
+
textTokens: schemaShape.textTokens.numberSpec({ meaning: 'Visible output tokens, when the provider reported the output split.' }),
|
|
144
|
+
reasoningTokens: schemaShape.reasoningTokens.numberSpec({
|
|
145
|
+
meaning: 'Output tokens spent on reasoning — a part of the completion, never in addition to it.',
|
|
146
|
+
whyItMatters: 'Absent when the provider did not report the split (Anthropic and Mistral do not), which is not zero reasoning.',
|
|
147
|
+
}),
|
|
138
148
|
errorName: schemaShape.errorName.stringSpec({
|
|
139
149
|
meaning: 'On a failed call, the class of the error.',
|
|
140
150
|
semanticRole: 'code',
|
|
@@ -143,12 +153,9 @@ export const providerCallRecordsResourceSpecification = resourceSpecification(pr
|
|
|
143
153
|
meaning: 'On a failed call, the error code when there was one.',
|
|
144
154
|
semanticRole: 'code',
|
|
145
155
|
}),
|
|
146
|
-
expiresAt: schemaShape.expiresAt.dateSpec({
|
|
147
|
-
meaning: 'When this row is deleted: 400 days after the call.',
|
|
148
|
-
whyItMatters: 'Enforced by a TTL index on MongoDB and by the bounded retention sweep on PostgreSQL.',
|
|
149
|
-
}),
|
|
150
156
|
createdAt: schemaShape.createdAt.dateSpec({
|
|
151
157
|
meaning: 'When the row was written.',
|
|
158
|
+
whyItMatters: 'The retention clock: the row is deleted once the declared OPERATIONAL_LOGS period has passed since this instant.',
|
|
152
159
|
}),
|
|
153
160
|
},
|
|
154
161
|
operations: {
|
|
@@ -170,8 +177,8 @@ export const providerCallRecordsResourceSpecification = resourceSpecification(pr
|
|
|
170
177
|
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The records were returned.' }],
|
|
171
178
|
},
|
|
172
179
|
[Op.DELETE_MANY]: {
|
|
173
|
-
purpose: 'Internal
|
|
174
|
-
outcome: 'The retention sweep deletes the expired
|
|
180
|
+
purpose: 'Internal retention cleanup of rows past the declared OPERATIONAL_LOGS period; no public deletion route.',
|
|
181
|
+
outcome: 'The retention-class sweep deletes the expired page it selected through the service layer.',
|
|
175
182
|
idempotent: true,
|
|
176
183
|
},
|
|
177
184
|
},
|
package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-call-records.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/flows-actors/resources/provider-call-records.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,IAAI,EAAE,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,8DAA8D,IAAI,0BAA0B,GAC7F,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAmC,qBAAqB,CAC3G,0BAA0B,EAC1B,wBAAwB,EACxB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,uJAAuJ;IAChK,YAAY,EAAE,6MAA6M;IAC3N,aAAa,EAAE,uHAAuH;IACtI,QAAQ,EAAE,aAAa,CAAC,SAAS;IACjC,SAAS,EAAE,uBAAuB,CAAC,YAAY;IAC/C,YAAY,EAAE;QACZ,UAAU,EAAE;YACV,WAAW,EAAE,uBAAuB;YACpC,UAAU,EAAE,0BAA0B;YACtC,UAAU,EAAE,cAAc,CAAC,MAAM;YACjC,eAAe,EAAE,mBAAmB,CAAC,UAAU;SAChD;QACD,eAAe,EAAE;YACf,WAAW,EAAE,uBAAuB;YACpC,UAAU,EAAE,gEAAgE;YAC5E,UAAU,EAAE,cAAc,CAAC,OAAO;YAClC,eAAe,EAAE,mBAAmB,CAAC,QAAQ;SAC9C;QACD,YAAY,EAAE;YACZ,eAAe,EAAE;gBACf,WAAW,EAAE,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AE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;SAC9F;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,2CAA2C;YACpD,OAAO,EAAE,+CAA+C;YACxD,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;SACnG;QACD,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE;YAChB,OAAO,EAAE,+EAA+E;YACxF,OAAO,EAAE,sGAAsG;YAC/G,UAAU,EAAE,IAAI;SACjB;KACF;IAED,mBAAmB,EAAE;QACnB,iHAAiH;QACjH,0IAA0I;QAC1I,gGAAgG;KACjG;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n AgentCallOutcome,\n AgentCallTraceKind,\n CoreResourceOperation as Op,\n ProviderCallRecordSchema,\n ResourcePrimaryScope,\n providerCallRecordsResourceConfiguration_InitializationFactory as providerCallRecordsFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `providerCallRecords` resource: one row per physical\n * call to a model provider.\n *\n * The runtime reasoning (why a store when every call already emits a trace, why nothing but metadata is\n * kept, why the recorder writes on every call whatever the traceability level) lives in the schema\n * file's header and is not restated here.\n *\n * Every operation is REPOSITORY_ONLY, so there is no HTTP surface. The evidence door\n * `GET /assurance/provider-call-evidence` reads these rows as window aggregates and never returns one.\n */\nexport const providerCallRecordsResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n providerCallRecordsFactory,\n ProviderCallRecordSchema,\n ({ schemaShape }) => ({\n purpose: 'Record every physical call the application makes to a model provider: which provider and model, what kind of call, how it ended and what it consumed.',\n businessRole: 'The queryable record behind the claim that the application knows what it sent to which vendor. It is what an evidence reader counts, where the traces sent to logs and analytics vendors cannot be counted.',\n lifecycleRole: 'Written once per provider call by the engine\\'s recorder, never updated, and deleted only when its own expiry passes.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ProviderCallRecordSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'providerCallRecordsResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'PROVIDER_CALL_RECORDS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Every operation is REPOSITORY_ONLY: the roles gate repository-tier resolution and are never exercised by a request.',\n 'Rows are built only by `projectProviderCallRecord`, a closed projection that cannot copy the prompt, the output or an error message.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Identity of this call record.',\n semanticRole: 'identifier',\n }),\n applicationId: schemaShape.applicationId.stringSpec({\n meaning: 'The application record the call was made by, stamped from the canonical identity.',\n semanticRole: 'identifier',\n }),\n agentRef: schemaShape.agentRef.stringSpec({\n meaning: 'The agent the call served, or the engine service\\'s own label for an embedding or a document extraction.',\n whyItMatters: 'Groups calls by the feature that made them, which is how an operator answers \"what sends data to this vendor?\".',\n semanticRole: 'code',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n kind: schemaShape.kind.enumSpec({\n meaning: 'Whether the call generated text or produced embeddings.',\n whyItMatters: 'The two consume tokens differently, so usage is only comparable within one kind.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AgentCallTraceKind',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [AgentCallTraceKind.GENERATION]: { meaning: 'A generation call: prompt tokens in, completion tokens out.' },\n [AgentCallTraceKind.EMBEDDING]: { meaning: 'An embedding call: input tokens in, vectors out, with no completion dimension.' },\n },\n }),\n provider: schemaShape.provider.stringSpec({\n meaning: 'The provider the call went to.',\n whyItMatters: 'The vendor that received the request. Absent only when the call could not name its provider, and the evidence door counts that gap instead of hiding it.',\n semanticRole: 'code',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n model: schemaShape.model.stringSpec({\n meaning: 'The model the call resolved to.',\n semanticRole: 'code',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n attempt: schemaShape.attempt.numberSpec({\n meaning: 'The attempt number when the caller retries; every physical attempt is its own row.',\n }),\n calledAt: schemaShape.calledAt.dateSpec({\n meaning: 'When the call was initiated.',\n whyItMatters: 'The instant the evidence door filters a window on.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n outcome: schemaShape.outcome.enumSpec({\n meaning: 'How the call ended.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AgentCallOutcome',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [AgentCallOutcome.SUCCESS]: { meaning: 'The provider answered.' },\n [AgentCallOutcome.FAILURE]: { meaning: 'The call failed; the error class and code are kept, the message is not.' },\n },\n }),\n finishReason: schemaShape.finishReason.stringSpec({\n meaning: 'The provider\\'s reason for finishing, when it gave one.',\n semanticRole: 'code',\n }),\n durationMs: schemaShape.durationMs.numberSpec({\n meaning: 'How long the call took, in milliseconds.',\n }),\n promptTokens: schemaShape.promptTokens.numberSpec({\n meaning: 'Input tokens the provider reported.',\n }),\n completionTokens: schemaShape.completionTokens.numberSpec({\n meaning: 'Output tokens the provider reported. Absent on an embedding, which has no completion dimension.',\n }),\n totalTokens: schemaShape.totalTokens.numberSpec({\n meaning: 'Total tokens the provider reported.',\n }),\n usageComplete: schemaShape.usageComplete.booleanSpec({\n meaning: 'Whether the provider reported every usage dimension this kind of call has. Absent means it said nothing about completeness.',\n }),\n errorName: schemaShape.errorName.stringSpec({\n meaning: 'On a failed call, the class of the error.',\n semanticRole: 'code',\n }),\n errorCode: schemaShape.errorCode.stringSpec({\n meaning: 'On a failed call, the error code when there was one.',\n semanticRole: 'code',\n }),\n expiresAt: schemaShape.expiresAt.dateSpec({\n meaning: 'When this row is deleted: 400 days after the call.',\n whyItMatters: 'Enforced by a TTL index on MongoDB and by the bounded retention sweep on PostgreSQL.',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the row was written.',\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Record one physical provider call.',\n outcome: 'The call is countable by the evidence door for any window that contains it.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The call was recorded.' }],\n },\n [Op.READ]: {\n purpose: 'Read one call record.',\n outcome: 'The row is returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The record was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List call records for an internal caller.',\n outcome: 'The rows are returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The records were returned.' }],\n },\n [Op.DELETE_MANY]: {\n purpose: 'Internal bounded retention cleanup of expired rows; no public deletion route.',\n outcome: 'The retention sweep deletes the expired batch it selected through the declared repository operation.',\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Metadata only: no prompt, no output and no error message is ever stored, so the row holds no person\\'s content.',\n 'Written on every provider call, whatever the observability setting: evidence cannot depend on whether an analytics vendor is configured.',\n 'Append-only: there is no update. Recording is best-effort and never fails the call it records.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"provider-call-records.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/flows-actors/resources/provider-call-records.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,IAAI,EAAE,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,8DAA8D,IAAI,0BAA0B,GAC7F,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAmC,qBAAqB,CAC3G,0BAA0B,EAC1B,wBAAwB,EACxB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,uJAAuJ;IAChK,YAAY,EAAE,6MAA6M;IAC3N,aAAa,EAAE,6MAA6M;IAC5N,QAAQ,EAAE,aAAa,CAAC,SAAS;IACjC,SAAS,EAAE,uBAAuB,CAAC,YAAY;IAC/C,YAAY,EAAE;QACZ,UAAU,EAAE;YACV,WAAW,EAAE,uBAAuB;YACpC,UAAU,EA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IAA0I;QAC1I,gGAAgG;KACjG;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n AgentCallOutcome,\n AgentCallTraceKind,\n CoreResourceOperation as Op,\n ProviderCallRecordSchema,\n ResourcePrimaryScope,\n providerCallRecordsResourceConfiguration_InitializationFactory as providerCallRecordsFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `providerCallRecords` resource: one row per physical\n * call to a model provider.\n *\n * The runtime reasoning (why a store when every call already emits a trace, why nothing but metadata is\n * kept, why the recorder writes on every call whatever the traceability level) lives in the schema\n * file's header and is not restated here.\n *\n * Every operation is route-less (REPOSITORY_ONLY, and INTERNAL_CALL for the retention delete), so there\n * is no HTTP surface. The evidence door\n * `GET /assurance/provider-call-evidence` reads these rows as window aggregates and never returns one.\n */\nexport const providerCallRecordsResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n providerCallRecordsFactory,\n ProviderCallRecordSchema,\n ({ schemaShape }) => ({\n purpose: 'Record every physical call the application makes to a model provider: which provider and model, what kind of call, how it ended and what it consumed.',\n businessRole: 'The queryable record behind the claim that the application knows what it sent to which vendor. It is what an evidence reader counts, where the traces sent to logs and analytics vendors cannot be counted.',\n lifecycleRole: 'Written once per provider call by the engine\\'s recorder, never updated, and deleted by the retention-class sweep once the application\\'s declared OPERATIONAL_LOGS period has passed since it was written.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ProviderCallRecordSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'providerCallRecordsResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'PROVIDER_CALL_RECORDS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Every operation is route-less: CREATE, READ and LIST are REPOSITORY_ONLY, and DELETE_MANY is INTERNAL_CALL because the retention-class sweep deletes through the service layer, which resolves only INTERNAL_CALL. The roles are never exercised by a request.',\n 'Retention: `retentionBinding: { retentionClass: OPERATIONAL_LOGS, startPoint: CREATED }` (#1613). The period is the application\\'s declared `dataRetention[OPERATIONAL_LOGS]`, never a number of this resource\\'s own; while that class is undeclared the rows are kept and every sweep reports it.',\n 'Rows are built only by `projectProviderCallRecord`, a closed projection that cannot copy the prompt, the output or an error message.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Identity of this call record.',\n semanticRole: 'identifier',\n }),\n applicationId: schemaShape.applicationId.stringSpec({\n meaning: 'The application record the call was made by, stamped from the canonical identity.',\n semanticRole: 'identifier',\n }),\n agentRef: schemaShape.agentRef.stringSpec({\n meaning: 'The agent the call served, or the engine service\\'s own label for an embedding or a document extraction.',\n whyItMatters: 'Groups calls by the feature that made them, which is how an operator answers \"what sends data to this vendor?\".',\n semanticRole: 'code',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n kind: schemaShape.kind.enumSpec({\n meaning: 'Whether the call generated text or produced embeddings.',\n whyItMatters: 'The two consume tokens differently, so usage is only comparable within one kind.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AgentCallTraceKind',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [AgentCallTraceKind.GENERATION]: { meaning: 'A generation call: prompt tokens in, completion tokens out.' },\n [AgentCallTraceKind.EMBEDDING]: { meaning: 'An embedding call: input tokens in, vectors out, with no completion dimension.' },\n },\n }),\n provider: schemaShape.provider.stringSpec({\n meaning: 'The provider the call went to.',\n whyItMatters: 'The vendor that received the request. Absent only when the call could not name its provider, and the evidence door counts that gap instead of hiding it.',\n semanticRole: 'code',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n model: schemaShape.model.stringSpec({\n meaning: 'The model the call resolved to.',\n semanticRole: 'code',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n attempt: schemaShape.attempt.numberSpec({\n meaning: 'The attempt number when the caller retries; every physical attempt is its own row.',\n }),\n calledAt: schemaShape.calledAt.dateSpec({\n meaning: 'When the call was initiated.',\n whyItMatters: 'The instant the evidence door filters a window on.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n outcome: schemaShape.outcome.enumSpec({\n meaning: 'How the call ended.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AgentCallOutcome',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [AgentCallOutcome.SUCCESS]: { meaning: 'The provider answered.' },\n [AgentCallOutcome.FAILURE]: { meaning: 'The call failed; the error class and code are kept, the message is not.' },\n },\n }),\n finishReason: schemaShape.finishReason.stringSpec({\n meaning: 'The provider\\'s reason for finishing, when it gave one.',\n semanticRole: 'code',\n }),\n durationMs: schemaShape.durationMs.numberSpec({\n meaning: 'How long the call took, in milliseconds.',\n }),\n promptTokens: schemaShape.promptTokens.numberSpec({\n meaning: 'Input tokens the provider reported.',\n }),\n completionTokens: schemaShape.completionTokens.numberSpec({\n meaning: 'Output tokens the provider reported. Absent on an embedding, which has no completion dimension.',\n }),\n totalTokens: schemaShape.totalTokens.numberSpec({\n meaning: 'Total tokens the provider reported.',\n }),\n usageComplete: schemaShape.usageComplete.booleanSpec({\n meaning: 'Whether the provider reported every usage dimension this kind of call has. Absent means it said nothing about completeness.',\n }),\n noCacheTokens: schemaShape.noCacheTokens.numberSpec({ meaning: 'Input tokens read without a prompt cache, when the provider reported the input split (#1598).' }),\n cacheReadTokens: schemaShape.cacheReadTokens.numberSpec({ meaning: 'Input tokens served from a prompt cache.', whyItMatters: 'Priced lower than uncached input, so a cost computed without the split would overstate a cached call.' }),\n cacheWriteTokens: schemaShape.cacheWriteTokens.numberSpec({ meaning: 'Input tokens written into a prompt cache.' }),\n textTokens: schemaShape.textTokens.numberSpec({ meaning: 'Visible output tokens, when the provider reported the output split.' }),\n reasoningTokens: schemaShape.reasoningTokens.numberSpec({\n meaning: 'Output tokens spent on reasoning — a part of the completion, never in addition to it.',\n whyItMatters: 'Absent when the provider did not report the split (Anthropic and Mistral do not), which is not zero reasoning.',\n }),\n errorName: schemaShape.errorName.stringSpec({\n meaning: 'On a failed call, the class of the error.',\n semanticRole: 'code',\n }),\n errorCode: schemaShape.errorCode.stringSpec({\n meaning: 'On a failed call, the error code when there was one.',\n semanticRole: 'code',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the row was written.',\n whyItMatters: 'The retention clock: the row is deleted once the declared OPERATIONAL_LOGS period has passed since this instant.',\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Record one physical provider call.',\n outcome: 'The call is countable by the evidence door for any window that contains it.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The call was recorded.' }],\n },\n [Op.READ]: {\n purpose: 'Read one call record.',\n outcome: 'The row is returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The record was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List call records for an internal caller.',\n outcome: 'The rows are returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The records were returned.' }],\n },\n [Op.DELETE_MANY]: {\n purpose: 'Internal retention cleanup of rows past the declared OPERATIONAL_LOGS period; no public deletion route.',\n outcome: 'The retention-class sweep deletes the expired page it selected through the service layer.',\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Metadata only: no prompt, no output and no error message is ever stored, so the row holds no person\\'s content.',\n 'Written on every provider call, whatever the observability setting: evidence cannot depend on whether an analytics vendor is configured.',\n 'Append-only: there is no update. Recording is best-effort and never fails the call it records.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|