@adcp/sdk 13.0.0-rc.6 → 13.0.0-rc.8
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/ADCP_VERSION +1 -1
- package/bin/adcp.js +29 -0
- package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/index.yaml +1 -0
- package/compliance/cache/{3.1.8.previous/protocols → 3.1.11/domains}/media-buy/scenarios/creative_fate_after_cancellation.yaml +46 -24
- package/compliance/cache/3.1.11/domains/media-buy/scenarios/dependency_impairment_audience.yaml +317 -0
- package/compliance/cache/{3.1.8 → 3.1.11}/index.json +3 -3
- package/compliance/cache/{3.1.8.previous/domains → 3.1.11/protocols}/media-buy/index.yaml +1 -0
- package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/creative_fate_after_cancellation.yaml +46 -24
- package/compliance/cache/3.1.11/protocols/media-buy/scenarios/dependency_impairment_audience.yaml +317 -0
- package/compliance/cache/{3.1.8.previous → 3.1.11}/universal/runner-output-contract.yaml +1 -1
- package/compliance/cache/{3.1.8 → 3.1.11}/universal/storyboard-schema.yaml +19 -6
- package/compliance/cache/{3.1.8/protocols → 3.1.11.previous/domains}/media-buy/index.yaml +1 -0
- package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/creative_fate_after_cancellation.yaml +46 -24
- package/compliance/cache/3.1.11.previous/domains/media-buy/scenarios/dependency_impairment_audience.yaml +317 -0
- package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/index.json +3 -3
- package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/index.yaml +1 -0
- package/compliance/cache/{3.1.8/domains → 3.1.11.previous/protocols}/media-buy/scenarios/creative_fate_after_cancellation.yaml +46 -24
- package/compliance/cache/3.1.11.previous/protocols/media-buy/scenarios/dependency_impairment_audience.yaml +317 -0
- package/compliance/cache/{3.1.8 → 3.1.11.previous}/universal/runner-output-contract.yaml +1 -1
- package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/storyboard-schema.yaml +19 -6
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.mts +4 -3
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.ts +4 -3
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.ts.map +1 -1
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.js.map +1 -1
- package/dist/lib/adapters/legacy/v2-5/sync_creatives.mjs.map +1 -1
- package/dist/lib/auth/oauth/ClientCredentialsFlow.d.mts +2 -0
- package/dist/lib/auth/oauth/ClientCredentialsFlow.d.ts +2 -0
- package/dist/lib/auth/oauth/ClientCredentialsFlow.d.ts.map +1 -1
- package/dist/lib/auth/oauth/ClientCredentialsFlow.js +69 -24
- package/dist/lib/auth/oauth/ClientCredentialsFlow.js.map +1 -1
- package/dist/lib/auth/oauth/ClientCredentialsFlow.mjs +69 -24
- package/dist/lib/auth/oauth/ClientCredentialsFlow.mjs.map +1 -1
- package/dist/lib/auth/oauth/MCPOAuthProvider.d.mts +2 -0
- package/dist/lib/auth/oauth/MCPOAuthProvider.d.ts +2 -0
- package/dist/lib/auth/oauth/MCPOAuthProvider.d.ts.map +1 -1
- package/dist/lib/auth/oauth/MCPOAuthProvider.js +8 -7
- package/dist/lib/auth/oauth/MCPOAuthProvider.js.map +1 -1
- package/dist/lib/auth/oauth/MCPOAuthProvider.mjs +8 -7
- package/dist/lib/auth/oauth/MCPOAuthProvider.mjs.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.d.mts +3 -0
- package/dist/lib/auth/oauth/authorization-required.d.ts +3 -0
- package/dist/lib/auth/oauth/authorization-required.d.ts.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.js +37 -7
- package/dist/lib/auth/oauth/authorization-required.js.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.mjs +37 -7
- package/dist/lib/auth/oauth/authorization-required.mjs.map +1 -1
- package/dist/lib/auth/oauth/discovery.d.mts +2 -0
- package/dist/lib/auth/oauth/discovery.d.ts +2 -0
- package/dist/lib/auth/oauth/discovery.d.ts.map +1 -1
- package/dist/lib/auth/oauth/discovery.js +7 -5
- package/dist/lib/auth/oauth/discovery.js.map +1 -1
- package/dist/lib/auth/oauth/discovery.mjs +7 -5
- package/dist/lib/auth/oauth/discovery.mjs.map +1 -1
- package/dist/lib/auth/oauth/file-storage.d.mts +2 -1
- package/dist/lib/auth/oauth/file-storage.d.ts +2 -1
- package/dist/lib/auth/oauth/file-storage.d.ts.map +1 -1
- package/dist/lib/auth/oauth/file-storage.js +5 -1
- package/dist/lib/auth/oauth/file-storage.js.map +1 -1
- package/dist/lib/auth/oauth/file-storage.mjs +5 -1
- package/dist/lib/auth/oauth/file-storage.mjs.map +1 -1
- package/dist/lib/auth/oauth/index.d.mts +5 -1
- package/dist/lib/auth/oauth/index.d.ts +5 -1
- package/dist/lib/auth/oauth/index.d.ts.map +1 -1
- package/dist/lib/auth/oauth/index.js +4 -0
- package/dist/lib/auth/oauth/index.js.map +1 -1
- package/dist/lib/auth/oauth/index.mjs +4 -0
- package/dist/lib/auth/oauth/index.mjs.map +1 -1
- package/dist/lib/auth/oauth/resource-url.d.mts +4 -0
- package/dist/lib/auth/oauth/resource-url.d.ts +5 -0
- package/dist/lib/auth/oauth/resource-url.d.ts.map +1 -0
- package/dist/lib/auth/oauth/resource-url.js +51 -0
- package/dist/lib/auth/oauth/resource-url.js.map +1 -0
- package/dist/lib/auth/oauth/resource-url.mjs +27 -0
- package/dist/lib/auth/oauth/resource-url.mjs.map +1 -0
- package/dist/lib/auth/oauth/types.d.mts +7 -0
- package/dist/lib/auth/oauth/types.d.ts +7 -0
- package/dist/lib/auth/oauth/types.d.ts.map +1 -1
- package/dist/lib/auth/oauth/types.js.map +1 -1
- package/dist/lib/auth/oauth/types.mjs.map +1 -1
- package/dist/lib/auth/oauth/web-flow.d.mts +30 -5
- package/dist/lib/auth/oauth/web-flow.d.ts +30 -5
- package/dist/lib/auth/oauth/web-flow.d.ts.map +1 -1
- package/dist/lib/auth/oauth/web-flow.js +52 -8
- package/dist/lib/auth/oauth/web-flow.js.map +1 -1
- package/dist/lib/auth/oauth/web-flow.mjs +51 -8
- package/dist/lib/auth/oauth/web-flow.mjs.map +1 -1
- package/dist/lib/core/AgentClient.d.mts +2 -2
- package/dist/lib/core/AgentClient.d.ts +2 -2
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/AgentClient.js.map +1 -1
- package/dist/lib/core/AgentClient.mjs.map +1 -1
- package/dist/lib/core/ConversationTypes.d.mts +6 -2
- package/dist/lib/core/ConversationTypes.d.ts +6 -2
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/ConversationTypes.js.map +1 -1
- package/dist/lib/core/GovernanceMiddleware.d.mts +3 -3
- package/dist/lib/core/GovernanceMiddleware.d.ts +3 -3
- package/dist/lib/core/GovernanceMiddleware.d.ts.map +1 -1
- package/dist/lib/core/GovernanceMiddleware.js +8 -4
- package/dist/lib/core/GovernanceMiddleware.js.map +1 -1
- package/dist/lib/core/GovernanceMiddleware.mjs +8 -4
- package/dist/lib/core/GovernanceMiddleware.mjs.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +12 -1
- package/dist/lib/core/SingleAgentClient.d.ts +12 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +89 -12
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/SingleAgentClient.mjs +89 -12
- package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
- package/dist/lib/core/TaskExecutor.d.mts +2 -4
- package/dist/lib/core/TaskExecutor.d.ts +2 -4
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +90 -14
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/core/TaskExecutor.mjs +95 -14
- package/dist/lib/core/TaskExecutor.mjs.map +1 -1
- package/dist/lib/core/task-deadline.d.mts +20 -0
- package/dist/lib/core/task-deadline.d.ts +21 -0
- package/dist/lib/core/task-deadline.d.ts.map +1 -0
- package/dist/lib/core/task-deadline.js +74 -0
- package/dist/lib/core/task-deadline.js.map +1 -0
- package/dist/lib/core/task-deadline.mjs +47 -0
- package/dist/lib/core/task-deadline.mjs.map +1 -0
- package/dist/lib/errors/index.d.mts +11 -0
- package/dist/lib/errors/index.d.ts +11 -0
- package/dist/lib/errors/index.d.ts.map +1 -1
- package/dist/lib/errors/index.js +6 -0
- package/dist/lib/errors/index.js.map +1 -1
- package/dist/lib/errors/index.mjs +6 -0
- package/dist/lib/errors/index.mjs.map +1 -1
- package/dist/lib/net/ssrf-fetch.d.ts.map +1 -1
- package/dist/lib/net/ssrf-fetch.js +11 -0
- package/dist/lib/net/ssrf-fetch.js.map +1 -1
- package/dist/lib/net/ssrf-fetch.mjs +11 -0
- package/dist/lib/net/ssrf-fetch.mjs.map +1 -1
- package/dist/lib/protocols/abort.d.mts +3 -1
- package/dist/lib/protocols/abort.d.ts +3 -1
- package/dist/lib/protocols/abort.d.ts.map +1 -1
- package/dist/lib/protocols/abort.js +19 -17
- package/dist/lib/protocols/abort.js.map +1 -1
- package/dist/lib/protocols/abort.mjs +19 -17
- package/dist/lib/protocols/abort.mjs.map +1 -1
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +13 -10
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/protocols/index.mjs +13 -10
- package/dist/lib/protocols/index.mjs.map +1 -1
- package/dist/lib/protocols/mcp.d.ts.map +1 -1
- package/dist/lib/protocols/mcp.js +8 -7
- package/dist/lib/protocols/mcp.js.map +1 -1
- package/dist/lib/protocols/mcp.mjs +8 -7
- package/dist/lib/protocols/mcp.mjs.map +1 -1
- package/dist/lib/registry/types.generated.d.mts +72 -9
- package/dist/lib/registry/types.generated.d.ts +72 -9
- package/dist/lib/registry/types.generated.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.js.map +1 -1
- package/dist/lib/schemas-data/3.1/a2ui/bound-value.json +1 -1
- package/dist/lib/schemas-data/3.1/a2ui/component.json +1 -1
- package/dist/lib/schemas-data/3.1/a2ui/si-catalog.json +25 -25
- package/dist/lib/schemas-data/3.1/a2ui/surface.json +2 -2
- package/dist/lib/schemas-data/3.1/a2ui/user-action.json +1 -1
- package/dist/lib/schemas-data/3.1/aao/agent-publishers.json +1 -1
- package/dist/lib/schemas-data/3.1/account/get-account-financials-request.json +6 -6
- package/dist/lib/schemas-data/3.1/account/get-account-financials-response.json +12 -12
- package/dist/lib/schemas-data/3.1/account/list-accounts-request.json +6 -6
- package/dist/lib/schemas-data/3.1/account/list-accounts-response.json +8 -8
- package/dist/lib/schemas-data/3.1/account/report-usage-request.json +6 -6
- package/dist/lib/schemas-data/3.1/account/report-usage-response.json +6 -6
- package/dist/lib/schemas-data/3.1/account/sync-accounts-request.json +12 -12
- package/dist/lib/schemas-data/3.1/account/sync-accounts-response.json +16 -16
- package/dist/lib/schemas-data/3.1/account/sync-governance-request.json +6 -6
- package/dist/lib/schemas-data/3.1/account/sync-governance-response.json +10 -10
- package/dist/lib/schemas-data/3.1/adagents.json +29 -29
- package/dist/lib/schemas-data/3.1/brand/acquire-rights-request.json +10 -10
- package/dist/lib/schemas-data/3.1/brand/acquire-rights-response.json +16 -16
- package/dist/lib/schemas-data/3.1/brand/creative-approval-request.json +5 -5
- package/dist/lib/schemas-data/3.1/brand/creative-approval-response.json +12 -12
- package/dist/lib/schemas-data/3.1/brand/get-brand-identity-request.json +4 -4
- package/dist/lib/schemas-data/3.1/brand/get-brand-identity-response.json +10 -10
- package/dist/lib/schemas-data/3.1/brand/get-rights-request.json +8 -8
- package/dist/lib/schemas-data/3.1/brand/get-rights-response.json +11 -11
- package/dist/lib/schemas-data/3.1/brand/revocation-notification.json +4 -4
- package/dist/lib/schemas-data/3.1/brand/rights-pricing-option.json +5 -5
- package/dist/lib/schemas-data/3.1/brand/rights-terms.json +3 -3
- package/dist/lib/schemas-data/3.1/brand/search-brands-request.json +6 -6
- package/dist/lib/schemas-data/3.1/brand/search-brands-response.json +11 -11
- package/dist/lib/schemas-data/3.1/brand/update-rights-request.json +6 -6
- package/dist/lib/schemas-data/3.1/brand/update-rights-response.json +11 -11
- package/dist/lib/schemas-data/3.1/brand/verification-status.json +1 -1
- package/dist/lib/schemas-data/3.1/brand/verify-brand-claim-request.json +2 -2
- package/dist/lib/schemas-data/3.1/brand/verify-brand-claim-response.json +13 -13
- package/dist/lib/schemas-data/3.1/brand/verify-brand-claims-request.json +2 -2
- package/dist/lib/schemas-data/3.1/brand/verify-brand-claims-response.json +13 -13
- package/dist/lib/schemas-data/3.1/brand.json +21 -21
- package/dist/lib/schemas-data/3.1/bundled/content-standards/calibrate-content-request.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/content-standards/calibrate-content-response.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/content-standards/create-content-standards-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/content-standards/create-content-standards-response.json +10 -10
- package/dist/lib/schemas-data/3.1/bundled/content-standards/get-content-standards-request.json +5 -5
- package/dist/lib/schemas-data/3.1/bundled/content-standards/get-content-standards-response.json +23 -23
- package/dist/lib/schemas-data/3.1/bundled/content-standards/get-media-buy-artifacts-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/content-standards/get-media-buy-artifacts-response.json +18 -18
- package/dist/lib/schemas-data/3.1/bundled/content-standards/list-content-standards-request.json +7 -7
- package/dist/lib/schemas-data/3.1/bundled/content-standards/list-content-standards-response.json +24 -24
- package/dist/lib/schemas-data/3.1/bundled/content-standards/update-content-standards-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/content-standards/update-content-standards-response.json +10 -10
- package/dist/lib/schemas-data/3.1/bundled/content-standards/validate-content-delivery-request.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/content-standards/validate-content-delivery-response.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/core/tasks-get-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/core/tasks-get-response.json +181 -181
- package/dist/lib/schemas-data/3.1/bundled/core/tasks-list-request.json +21 -21
- package/dist/lib/schemas-data/3.1/bundled/core/tasks-list-response.json +11 -11
- package/dist/lib/schemas-data/3.1/bundled/creative/get-creative-delivery-request.json +17 -17
- package/dist/lib/schemas-data/3.1/bundled/creative/get-creative-delivery-response.json +56 -56
- package/dist/lib/schemas-data/3.1/bundled/creative/get-creative-features-request.json +44 -44
- package/dist/lib/schemas-data/3.1/bundled/creative/get-creative-features-response.json +13 -13
- package/dist/lib/schemas-data/3.1/bundled/creative/list-creative-formats-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/creative/list-creative-formats-response.json +48 -48
- package/dist/lib/schemas-data/3.1/bundled/creative/list-creatives-request.json +17 -17
- package/dist/lib/schemas-data/3.1/bundled/creative/list-creatives-response.json +58 -58
- package/dist/lib/schemas-data/3.1/bundled/creative/list-transformers-request.json +18 -18
- package/dist/lib/schemas-data/3.1/bundled/creative/list-transformers-response.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/creative/preview-creative-request.json +44 -44
- package/dist/lib/schemas-data/3.1/bundled/creative/preview-creative-response.json +50 -50
- package/dist/lib/schemas-data/3.1/bundled/creative/sync-creatives-request.json +46 -46
- package/dist/lib/schemas-data/3.1/bundled/creative/sync-creatives-response.json +27 -27
- package/dist/lib/schemas-data/3.1/bundled/creative/validate-input-request.json +42 -42
- package/dist/lib/schemas-data/3.1/bundled/creative/validate-input-response.json +10 -10
- package/dist/lib/schemas-data/3.1/bundled/media-buy/build-creative-request.json +53 -53
- package/dist/lib/schemas-data/3.1/bundled/media-buy/build-creative-response.json +54 -54
- package/dist/lib/schemas-data/3.1/bundled/media-buy/create-media-buy-request.json +83 -83
- package/dist/lib/schemas-data/3.1/bundled/media-buy/create-media-buy-response.json +77 -77
- package/dist/lib/schemas-data/3.1/bundled/media-buy/get-media-buy-delivery-request.json +25 -25
- package/dist/lib/schemas-data/3.1/bundled/media-buy/get-media-buy-delivery-response.json +40 -40
- package/dist/lib/schemas-data/3.1/bundled/media-buy/get-media-buys-request.json +18 -18
- package/dist/lib/schemas-data/3.1/bundled/media-buy/get-media-buys-response.json +65 -65
- package/dist/lib/schemas-data/3.1/bundled/media-buy/get-products-request.json +49 -49
- package/dist/lib/schemas-data/3.1/bundled/media-buy/get-products-response.json +99 -99
- package/dist/lib/schemas-data/3.1/bundled/media-buy/list-creative-formats-request.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/media-buy/list-creative-formats-response.json +48 -48
- package/dist/lib/schemas-data/3.1/bundled/media-buy/log-event-request.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/media-buy/log-event-response.json +10 -10
- package/dist/lib/schemas-data/3.1/bundled/media-buy/package-request.json +79 -79
- package/dist/lib/schemas-data/3.1/bundled/media-buy/provide-performance-feedback-request.json +8 -8
- package/dist/lib/schemas-data/3.1/bundled/media-buy/provide-performance-feedback-response.json +10 -10
- package/dist/lib/schemas-data/3.1/bundled/media-buy/sync-audiences-request.json +18 -18
- package/dist/lib/schemas-data/3.1/bundled/media-buy/sync-audiences-response.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/media-buy/sync-catalogs-request.json +26 -26
- package/dist/lib/schemas-data/3.1/bundled/media-buy/sync-catalogs-response.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/media-buy/sync-event-sources-request.json +19 -19
- package/dist/lib/schemas-data/3.1/bundled/media-buy/sync-event-sources-response.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/media-buy/update-media-buy-request.json +79 -79
- package/dist/lib/schemas-data/3.1/bundled/media-buy/update-media-buy-response.json +71 -71
- package/dist/lib/schemas-data/3.1/bundled/property/create-property-list-request.json +18 -18
- package/dist/lib/schemas-data/3.1/bundled/property/create-property-list-response.json +26 -26
- package/dist/lib/schemas-data/3.1/bundled/property/delete-property-list-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/property/delete-property-list-response.json +10 -10
- package/dist/lib/schemas-data/3.1/bundled/property/get-property-list-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/property/get-property-list-response.json +27 -27
- package/dist/lib/schemas-data/3.1/bundled/property/list-property-lists-request.json +17 -17
- package/dist/lib/schemas-data/3.1/bundled/property/list-property-lists-response.json +27 -27
- package/dist/lib/schemas-data/3.1/bundled/property/update-property-list-request.json +18 -18
- package/dist/lib/schemas-data/3.1/bundled/property/update-property-list-response.json +26 -26
- package/dist/lib/schemas-data/3.1/bundled/property/validate-property-delivery-request.json +19 -19
- package/dist/lib/schemas-data/3.1/bundled/property/validate-property-delivery-response.json +15 -15
- package/dist/lib/schemas-data/3.1/bundled/protocol/get-adcp-capabilities-request.json +5 -5
- package/dist/lib/schemas-data/3.1/bundled/protocol/get-adcp-capabilities-response.json +35 -35
- package/dist/lib/schemas-data/3.1/bundled/protocol/get-task-status-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/protocol/get-task-status-response.json +181 -181
- package/dist/lib/schemas-data/3.1/bundled/protocol/list-tasks-request.json +21 -21
- package/dist/lib/schemas-data/3.1/bundled/protocol/list-tasks-response.json +11 -11
- package/dist/lib/schemas-data/3.1/bundled/signals/activate-signal-request.json +17 -17
- package/dist/lib/schemas-data/3.1/bundled/signals/activate-signal-response.json +12 -12
- package/dist/lib/schemas-data/3.1/bundled/signals/get-signals-request.json +24 -24
- package/dist/lib/schemas-data/3.1/bundled/signals/get-signals-response.json +53 -53
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-get-offering-request.json +5 -5
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-get-offering-response.json +23 -23
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-initiate-session-request.json +18 -18
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-initiate-session-response.json +25 -25
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-send-message-request.json +16 -16
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-send-message-response.json +26 -26
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-terminate-session-request.json +5 -5
- package/dist/lib/schemas-data/3.1/bundled/sponsored-intelligence/si-terminate-session-response.json +11 -11
- package/dist/lib/schemas-data/3.1/collection/base-collection-source.json +3 -3
- package/dist/lib/schemas-data/3.1/collection/collection-list-changed-webhook.json +2 -2
- package/dist/lib/schemas-data/3.1/collection/collection-list-filters.json +7 -7
- package/dist/lib/schemas-data/3.1/collection/collection-list.json +5 -5
- package/dist/lib/schemas-data/3.1/collection/create-collection-list-request.json +8 -8
- package/dist/lib/schemas-data/3.1/collection/create-collection-list-response.json +6 -6
- package/dist/lib/schemas-data/3.1/collection/delete-collection-list-request.json +5 -5
- package/dist/lib/schemas-data/3.1/collection/delete-collection-list-response.json +5 -5
- package/dist/lib/schemas-data/3.1/collection/get-collection-list-request.json +5 -5
- package/dist/lib/schemas-data/3.1/collection/get-collection-list-response.json +12 -12
- package/dist/lib/schemas-data/3.1/collection/list-collection-lists-request.json +6 -6
- package/dist/lib/schemas-data/3.1/collection/list-collection-lists-response.json +7 -7
- package/dist/lib/schemas-data/3.1/collection/update-collection-list-request.json +8 -8
- package/dist/lib/schemas-data/3.1/collection/update-collection-list-response.json +6 -6
- package/dist/lib/schemas-data/3.1/content-standards/artifact-webhook-payload.json +3 -3
- package/dist/lib/schemas-data/3.1/content-standards/artifact.json +7 -7
- package/dist/lib/schemas-data/3.1/content-standards/calibrate-content-request.json +5 -5
- package/dist/lib/schemas-data/3.1/content-standards/calibrate-content-response.json +10 -10
- package/dist/lib/schemas-data/3.1/content-standards/content-standards.json +7 -7
- package/dist/lib/schemas-data/3.1/content-standards/create-content-standards-request.json +8 -8
- package/dist/lib/schemas-data/3.1/content-standards/create-content-standards-response.json +8 -8
- package/dist/lib/schemas-data/3.1/content-standards/get-content-standards-request.json +4 -4
- package/dist/lib/schemas-data/3.1/content-standards/get-content-standards-response.json +9 -9
- package/dist/lib/schemas-data/3.1/content-standards/get-media-buy-artifacts-request.json +5 -5
- package/dist/lib/schemas-data/3.1/content-standards/get-media-buy-artifacts-response.json +10 -10
- package/dist/lib/schemas-data/3.1/content-standards/list-content-standards-request.json +6 -6
- package/dist/lib/schemas-data/3.1/content-standards/list-content-standards-response.json +10 -10
- package/dist/lib/schemas-data/3.1/content-standards/update-content-standards-request.json +8 -8
- package/dist/lib/schemas-data/3.1/content-standards/update-content-standards-response.json +8 -8
- package/dist/lib/schemas-data/3.1/content-standards/validate-content-delivery-request.json +5 -5
- package/dist/lib/schemas-data/3.1/content-standards/validate-content-delivery-response.json +10 -10
- package/dist/lib/schemas-data/3.1/core/account-authorization.json +1 -1
- package/dist/lib/schemas-data/3.1/core/account-ref.json +2 -2
- package/dist/lib/schemas-data/3.1/core/account-with-authorization.json +3 -3
- package/dist/lib/schemas-data/3.1/core/account.json +10 -10
- package/dist/lib/schemas-data/3.1/core/activation-key.json +1 -1
- package/dist/lib/schemas-data/3.1/core/ad-inventory-config.json +1 -1
- package/dist/lib/schemas-data/3.1/core/agent-encryption-key.json +1 -1
- package/dist/lib/schemas-data/3.1/core/agent-signing-key.json +1 -1
- package/dist/lib/schemas-data/3.1/core/app-item.json +4 -4
- package/dist/lib/schemas-data/3.1/core/asset-group-vocabulary.json +1 -1
- package/dist/lib/schemas-data/3.1/core/assets/asset-union.json +21 -21
- package/dist/lib/schemas-data/3.1/core/assets/audio-asset.json +3 -3
- package/dist/lib/schemas-data/3.1/core/assets/brief-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/card-asset.json +6 -6
- package/dist/lib/schemas-data/3.1/core/assets/catalog-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/css-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/daast-asset.json +4 -4
- package/dist/lib/schemas-data/3.1/core/assets/daast-tracker-asset.json +3 -3
- package/dist/lib/schemas-data/3.1/core/assets/html-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/image-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/javascript-asset.json +3 -3
- package/dist/lib/schemas-data/3.1/core/assets/markdown-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/pixel-tracker-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/published-post-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/text-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/assets/url-asset.json +3 -3
- package/dist/lib/schemas-data/3.1/core/assets/vast-asset.json +4 -4
- package/dist/lib/schemas-data/3.1/core/assets/vast-tracker-asset.json +3 -3
- package/dist/lib/schemas-data/3.1/core/assets/video-asset.json +7 -7
- package/dist/lib/schemas-data/3.1/core/assets/webhook-asset.json +7 -7
- package/dist/lib/schemas-data/3.1/core/assets/zip-asset.json +2 -2
- package/dist/lib/schemas-data/3.1/core/async-response-data.json +29 -29
- package/dist/lib/schemas-data/3.1/core/async-response-refs/creative/sync-creatives-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/creative/sync-creatives-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/creative/sync-creatives-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/build-creative-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/build-creative-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/build-creative-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/create-media-buy-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/create-media-buy-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/create-media-buy-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/get-products-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/get-products-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/get-products-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/sync-catalogs-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/sync-catalogs-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/sync-catalogs-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/update-media-buy-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/update-media-buy-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/media-buy/update-media-buy-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/core/async-response-refs/signals/get-signals-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/core/async-response-refs/signals/get-signals-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/core/attribution-window.json +4 -4
- package/dist/lib/schemas-data/3.1/core/audience-member.json +3 -3
- package/dist/lib/schemas-data/3.1/core/audience-selector.json +7 -7
- package/dist/lib/schemas-data/3.1/core/authorized-agent-base.json +3 -3
- package/dist/lib/schemas-data/3.1/core/brand-id.json +1 -1
- package/dist/lib/schemas-data/3.1/core/brand-ref.json +3 -3
- package/dist/lib/schemas-data/3.1/core/business-entity.json +2 -2
- package/dist/lib/schemas-data/3.1/core/cancellation-policy.json +2 -2
- package/dist/lib/schemas-data/3.1/core/canonical-format-kind.json +1 -1
- package/dist/lib/schemas-data/3.1/core/canonical-projection-ref.json +3 -3
- package/dist/lib/schemas-data/3.1/core/canonical-projection-slot-override.json +1 -1
- package/dist/lib/schemas-data/3.1/core/catalog-field-mapping.json +2 -2
- package/dist/lib/schemas-data/3.1/core/catalog-item-delivery-metrics.json +3 -3
- package/dist/lib/schemas-data/3.1/core/catalog.json +7 -7
- package/dist/lib/schemas-data/3.1/core/catchment.json +5 -5
- package/dist/lib/schemas-data/3.1/core/collection-distribution.json +2 -2
- package/dist/lib/schemas-data/3.1/core/collection-list-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/core/collection-selector.json +1 -1
- package/dist/lib/schemas-data/3.1/core/collection.json +13 -13
- package/dist/lib/schemas-data/3.1/core/committed-metric.json +9 -9
- package/dist/lib/schemas-data/3.1/core/content-rating.json +2 -2
- package/dist/lib/schemas-data/3.1/core/context.json +1 -1
- package/dist/lib/schemas-data/3.1/core/creative-asset.json +10 -10
- package/dist/lib/schemas-data/3.1/core/creative-assignment.json +2 -2
- package/dist/lib/schemas-data/3.1/core/creative-brief.json +4 -4
- package/dist/lib/schemas-data/3.1/core/creative-consumption.json +1 -1
- package/dist/lib/schemas-data/3.1/core/creative-delivery-metrics.json +2 -2
- package/dist/lib/schemas-data/3.1/core/creative-filters.json +5 -5
- package/dist/lib/schemas-data/3.1/core/creative-item.json +1 -1
- package/dist/lib/schemas-data/3.1/core/creative-manifest.json +11 -11
- package/dist/lib/schemas-data/3.1/core/creative-policy.json +3 -3
- package/dist/lib/schemas-data/3.1/core/creative-variable.json +1 -1
- package/dist/lib/schemas-data/3.1/core/creative-variant.json +5 -5
- package/dist/lib/schemas-data/3.1/core/data-provider-signal-selector.json +1 -1
- package/dist/lib/schemas-data/3.1/core/date-range.json +1 -1
- package/dist/lib/schemas-data/3.1/core/datetime-range.json +1 -1
- package/dist/lib/schemas-data/3.1/core/daypart-target.json +2 -2
- package/dist/lib/schemas-data/3.1/core/deadline-policy.json +1 -1
- package/dist/lib/schemas-data/3.1/core/delivery-forecast.json +7 -7
- package/dist/lib/schemas-data/3.1/core/delivery-metric-aggregate.json +9 -9
- package/dist/lib/schemas-data/3.1/core/delivery-metrics.json +8 -8
- package/dist/lib/schemas-data/3.1/core/deployment.json +3 -3
- package/dist/lib/schemas-data/3.1/core/destination-item.json +4 -4
- package/dist/lib/schemas-data/3.1/core/destination.json +1 -1
- package/dist/lib/schemas-data/3.1/core/diagnostic-issue.json +1 -1
- package/dist/lib/schemas-data/3.1/core/downstream-connection-requirement.json +1 -1
- package/dist/lib/schemas-data/3.1/core/duration.json +1 -1
- package/dist/lib/schemas-data/3.1/core/education-item.json +4 -4
- package/dist/lib/schemas-data/3.1/core/error.json +1 -1
- package/dist/lib/schemas-data/3.1/core/evaluator-spec.json +5 -5
- package/dist/lib/schemas-data/3.1/core/event-custom-data.json +2 -2
- package/dist/lib/schemas-data/3.1/core/event-source-health.json +3 -3
- package/dist/lib/schemas-data/3.1/core/event-surface.json +2 -2
- package/dist/lib/schemas-data/3.1/core/event.json +8 -8
- package/dist/lib/schemas-data/3.1/core/ext.json +1 -1
- package/dist/lib/schemas-data/3.1/core/feature-requirement.json +1 -1
- package/dist/lib/schemas-data/3.1/core/flight-item.json +4 -4
- package/dist/lib/schemas-data/3.1/core/forecast-dimension-audience.json +2 -2
- package/dist/lib/schemas-data/3.1/core/forecast-dimension-device-platform.json +2 -2
- package/dist/lib/schemas-data/3.1/core/forecast-dimension-device-type.json +2 -2
- package/dist/lib/schemas-data/3.1/core/forecast-dimension-geo.json +5 -5
- package/dist/lib/schemas-data/3.1/core/forecast-dimension-placement.json +2 -2
- package/dist/lib/schemas-data/3.1/core/forecast-dimension-signal.json +2 -2
- package/dist/lib/schemas-data/3.1/core/forecast-point-dimensions.json +7 -7
- package/dist/lib/schemas-data/3.1/core/forecast-point.json +27 -27
- package/dist/lib/schemas-data/3.1/core/forecast-range.json +1 -1
- package/dist/lib/schemas-data/3.1/core/forecast-vendor-metric-value.json +5 -5
- package/dist/lib/schemas-data/3.1/core/format-id.json +1 -1
- package/dist/lib/schemas-data/3.1/core/format-option-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/core/format-shape-vocabulary.json +1 -1
- package/dist/lib/schemas-data/3.1/core/format.json +44 -44
- package/dist/lib/schemas-data/3.1/core/frequency-cap.json +4 -4
- package/dist/lib/schemas-data/3.1/core/generation-credential.json +3 -3
- package/dist/lib/schemas-data/3.1/core/geo-breakdown-support.json +3 -3
- package/dist/lib/schemas-data/3.1/core/geo-delivery-metrics.json +6 -6
- package/dist/lib/schemas-data/3.1/core/hotel-item.json +4 -4
- package/dist/lib/schemas-data/3.1/core/identifier.json +2 -2
- package/dist/lib/schemas-data/3.1/core/impairment.json +3 -3
- package/dist/lib/schemas-data/3.1/core/industry-identifier.json +2 -2
- package/dist/lib/schemas-data/3.1/core/insertion-order.json +1 -1
- package/dist/lib/schemas-data/3.1/core/installment-deadlines.json +2 -2
- package/dist/lib/schemas-data/3.1/core/installment.json +9 -9
- package/dist/lib/schemas-data/3.1/core/job-item.json +3 -3
- package/dist/lib/schemas-data/3.1/core/keyword-delivery-metrics.json +3 -3
- package/dist/lib/schemas-data/3.1/core/limited-series.json +1 -1
- package/dist/lib/schemas-data/3.1/core/material-deadline.json +1 -1
- package/dist/lib/schemas-data/3.1/core/mcp-webhook-payload.json +5 -5
- package/dist/lib/schemas-data/3.1/core/measurement-readiness.json +5 -5
- package/dist/lib/schemas-data/3.1/core/measurement-terms.json +3 -3
- package/dist/lib/schemas-data/3.1/core/measurement-window.json +1 -1
- package/dist/lib/schemas-data/3.1/core/media-buy-available-action.json +4 -4
- package/dist/lib/schemas-data/3.1/core/media-buy-features.json +1 -1
- package/dist/lib/schemas-data/3.1/core/media-buy.json +10 -10
- package/dist/lib/schemas-data/3.1/core/missing-metric.json +9 -9
- package/dist/lib/schemas-data/3.1/core/notification-config.json +4 -4
- package/dist/lib/schemas-data/3.1/core/offering-asset-group.json +16 -16
- package/dist/lib/schemas-data/3.1/core/offering.json +5 -5
- package/dist/lib/schemas-data/3.1/core/optimization-goal.json +7 -7
- package/dist/lib/schemas-data/3.1/core/outcome-measurement.json +2 -2
- package/dist/lib/schemas-data/3.1/core/overlay.json +1 -1
- package/dist/lib/schemas-data/3.1/core/package-signal-targeting-group.json +2 -2
- package/dist/lib/schemas-data/3.1/core/package-signal-targeting-groups.json +2 -2
- package/dist/lib/schemas-data/3.1/core/package-signal-targeting.json +3 -3
- package/dist/lib/schemas-data/3.1/core/package.json +17 -17
- package/dist/lib/schemas-data/3.1/core/pagination-request.json +1 -1
- package/dist/lib/schemas-data/3.1/core/pagination-response.json +1 -1
- package/dist/lib/schemas-data/3.1/core/performance-feedback.json +12 -12
- package/dist/lib/schemas-data/3.1/core/performance-standard.json +4 -4
- package/dist/lib/schemas-data/3.1/core/placement-definition.json +10 -10
- package/dist/lib/schemas-data/3.1/core/placement-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/core/placement.json +7 -7
- package/dist/lib/schemas-data/3.1/core/planned-delivery.json +5 -5
- package/dist/lib/schemas-data/3.1/core/platform-extension-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/core/postal-area-support.json +2 -2
- package/dist/lib/schemas-data/3.1/core/postal-area.json +4 -4
- package/dist/lib/schemas-data/3.1/core/postal-country-system.json +2 -2
- package/dist/lib/schemas-data/3.1/core/price.json +1 -1
- package/dist/lib/schemas-data/3.1/core/pricing-option.json +10 -10
- package/dist/lib/schemas-data/3.1/core/product-allocation.json +4 -4
- package/dist/lib/schemas-data/3.1/core/product-allowed-action.json +5 -5
- package/dist/lib/schemas-data/3.1/core/product-filters.json +27 -27
- package/dist/lib/schemas-data/3.1/core/product-format-declaration.json +16 -16
- package/dist/lib/schemas-data/3.1/core/product-signal-targeting-option.json +3 -3
- package/dist/lib/schemas-data/3.1/core/product.json +40 -40
- package/dist/lib/schemas-data/3.1/core/property-id.json +1 -1
- package/dist/lib/schemas-data/3.1/core/property-list-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/core/property-tag.json +1 -1
- package/dist/lib/schemas-data/3.1/core/property.json +6 -6
- package/dist/lib/schemas-data/3.1/core/proposal.json +6 -6
- package/dist/lib/schemas-data/3.1/core/protocol-envelope.json +5 -5
- package/dist/lib/schemas-data/3.1/core/provenance.json +9 -9
- package/dist/lib/schemas-data/3.1/core/publisher-property-selector.json +3 -3
- package/dist/lib/schemas-data/3.1/core/push-notification-config.json +2 -2
- package/dist/lib/schemas-data/3.1/core/real-estate-item.json +4 -4
- package/dist/lib/schemas-data/3.1/core/reference-asset.json +1 -1
- package/dist/lib/schemas-data/3.1/core/registry-event.json +13 -13
- package/dist/lib/schemas-data/3.1/core/registry-feed-response.json +2 -2
- package/dist/lib/schemas-data/3.1/core/reporting-capabilities.json +8 -8
- package/dist/lib/schemas-data/3.1/core/reporting-webhook.json +3 -3
- package/dist/lib/schemas-data/3.1/core/requirements/asset-requirements.json +13 -13
- package/dist/lib/schemas-data/3.1/core/requirements/audio-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/catalog-field-binding.json +4 -4
- package/dist/lib/schemas-data/3.1/core/requirements/catalog-requirements.json +5 -5
- package/dist/lib/schemas-data/3.1/core/requirements/css-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/daast-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/html-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/image-asset-requirements.json +2 -2
- package/dist/lib/schemas-data/3.1/core/requirements/javascript-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/markdown-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/offering-asset-constraint.json +4 -4
- package/dist/lib/schemas-data/3.1/core/requirements/text-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/url-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/vast-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/requirements/video-asset-requirements.json +6 -6
- package/dist/lib/schemas-data/3.1/core/requirements/webhook-asset-requirements.json +1 -1
- package/dist/lib/schemas-data/3.1/core/response-payload-jws-envelope.json +1 -1
- package/dist/lib/schemas-data/3.1/core/response.json +1 -1
- package/dist/lib/schemas-data/3.1/core/rights-constraint.json +4 -4
- package/dist/lib/schemas-data/3.1/core/seller-agent-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/core/signal-coverage-forecast.json +5 -5
- package/dist/lib/schemas-data/3.1/core/signal-definition-enrichment.json +4 -4
- package/dist/lib/schemas-data/3.1/core/signal-definition.json +5 -5
- package/dist/lib/schemas-data/3.1/core/signal-filters.json +3 -3
- package/dist/lib/schemas-data/3.1/core/signal-id.json +1 -1
- package/dist/lib/schemas-data/3.1/core/signal-listing.json +4 -4
- package/dist/lib/schemas-data/3.1/core/signal-modeling-disclosure.json +1 -1
- package/dist/lib/schemas-data/3.1/core/signal-pricing-option.json +2 -2
- package/dist/lib/schemas-data/3.1/core/signal-pricing.json +6 -6
- package/dist/lib/schemas-data/3.1/core/signal-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/core/signal-selection-group-rule.json +1 -1
- package/dist/lib/schemas-data/3.1/core/signal-targeting-expression.json +4 -4
- package/dist/lib/schemas-data/3.1/core/signal-targeting-rules.json +2 -2
- package/dist/lib/schemas-data/3.1/core/signal-targeting.json +7 -7
- package/dist/lib/schemas-data/3.1/core/sla-window.json +1 -1
- package/dist/lib/schemas-data/3.1/core/special.json +2 -2
- package/dist/lib/schemas-data/3.1/core/start-timing.json +1 -1
- package/dist/lib/schemas-data/3.1/core/store-item.json +3 -3
- package/dist/lib/schemas-data/3.1/core/talent.json +2 -2
- package/dist/lib/schemas-data/3.1/core/targeting.json +22 -22
- package/dist/lib/schemas-data/3.1/core/tasks-get-request.json +5 -5
- package/dist/lib/schemas-data/3.1/core/tasks-get-response.json +10 -10
- package/dist/lib/schemas-data/3.1/core/tasks-list-request.json +13 -13
- package/dist/lib/schemas-data/3.1/core/tasks-list-response.json +8 -8
- package/dist/lib/schemas-data/3.1/core/transformer-param.json +1 -1
- package/dist/lib/schemas-data/3.1/core/transformer.json +5 -5
- package/dist/lib/schemas-data/3.1/core/truncation-sentinel.json +1 -1
- package/dist/lib/schemas-data/3.1/core/user-match.json +3 -3
- package/dist/lib/schemas-data/3.1/core/vehicle-item.json +4 -4
- package/dist/lib/schemas-data/3.1/core/vendor-metric-id.json +1 -1
- package/dist/lib/schemas-data/3.1/core/vendor-metric-optimization-supported-metric.json +3 -3
- package/dist/lib/schemas-data/3.1/core/vendor-metric-optimization.json +2 -2
- package/dist/lib/schemas-data/3.1/core/vendor-metric-value.json +3 -3
- package/dist/lib/schemas-data/3.1/core/vendor-pricing-option.json +3 -3
- package/dist/lib/schemas-data/3.1/core/version-envelope.json +1 -1
- package/dist/lib/schemas-data/3.1/core/webhook-activity-record.json +3 -3
- package/dist/lib/schemas-data/3.1/core/webhook-challenge-response.json +1 -1
- package/dist/lib/schemas-data/3.1/core/webhook-challenge.json +2 -2
- package/dist/lib/schemas-data/3.1/core/wholesale-feed-event.json +17 -17
- package/dist/lib/schemas-data/3.1/core/wholesale-feed-webhook.json +3 -3
- package/dist/lib/schemas-data/3.1/core/x-entity-types.json +1 -1
- package/dist/lib/schemas-data/3.1/creative/asset-types/index.json +6 -6
- package/dist/lib/schemas-data/3.1/creative/audit-observation.json +2 -2
- package/dist/lib/schemas-data/3.1/creative/creative-feature-result.json +2 -2
- package/dist/lib/schemas-data/3.1/creative/creative-purged-webhook.json +3 -3
- package/dist/lib/schemas-data/3.1/creative/creative-status-changed-webhook.json +4 -4
- package/dist/lib/schemas-data/3.1/creative/get-creative-delivery-request.json +6 -6
- package/dist/lib/schemas-data/3.1/creative/get-creative-delivery-response.json +9 -9
- package/dist/lib/schemas-data/3.1/creative/get-creative-features-request.json +6 -6
- package/dist/lib/schemas-data/3.1/creative/get-creative-features-response.json +11 -11
- package/dist/lib/schemas-data/3.1/creative/list-creative-formats-request.json +13 -13
- package/dist/lib/schemas-data/3.1/creative/list-creative-formats-response.json +9 -9
- package/dist/lib/schemas-data/3.1/creative/list-creatives-request.json +9 -9
- package/dist/lib/schemas-data/3.1/creative/list-creatives-response.json +21 -21
- package/dist/lib/schemas-data/3.1/creative/list-transformers-request.json +8 -8
- package/dist/lib/schemas-data/3.1/creative/list-transformers-response.json +8 -8
- package/dist/lib/schemas-data/3.1/creative/preview-creative-request.json +12 -12
- package/dist/lib/schemas-data/3.1/creative/preview-creative-response.json +14 -14
- package/dist/lib/schemas-data/3.1/creative/preview-render.json +1 -1
- package/dist/lib/schemas-data/3.1/creative/sync-creatives-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.1/creative/sync-creatives-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/creative/sync-creatives-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/creative/sync-creatives-request.json +8 -8
- package/dist/lib/schemas-data/3.1/creative/sync-creatives-response.json +15 -15
- package/dist/lib/schemas-data/3.1/creative/validate-input-request.json +4 -4
- package/dist/lib/schemas-data/3.1/creative/validate-input-response.json +4 -4
- package/dist/lib/schemas-data/3.1/creative/validate-input-result.json +1 -1
- package/dist/lib/schemas-data/3.1/creative/video-brief.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/account-scope.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/account-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/action-not-allowed-reason.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/action-source.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/adcp-protocol.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/adjustment-kind.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/advertiser-industry.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/age-verification-method.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/assessment-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/asset-content-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/attestation-claim.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/attribution-methodology.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/attribution-model.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/audience-source.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/audience-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/audio-channel-layout.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/audio-distribution-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/auth-scheme.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/available-metric.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/billing-party.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/binary-verdict.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/brand-agent-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/c2pa-watermark-action.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/canceled-by.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/catalog-action.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/catalog-item-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/catalog-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/channels.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/cloud-storage-protocol.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/co-branding-requirement.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/collection-cadence.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/collection-kind.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/collection-relationship.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/collection-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/completion-source.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/consent-basis.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/content-id-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/content-rating-system.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-action.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-agent-capability.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-approval-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-event-reason-code.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-identifier-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-quality.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-selection-strategy.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-sort-field.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/creative-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/daast-tracking-event.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/daast-version.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/day-of-week.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/delegation-authority.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/delivery-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/demographic-system.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/derivative-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/device-platform.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/device-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/digital-source-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/dimension-unit.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/disclosure-persistence.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/disclosure-position.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/distance-unit.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/distribution-identifier-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/embedded-provenance-method.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/error-code.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/error-scope.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/escalation-severity.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/event-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/exclusivity.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/feature-check-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/feed-format.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/feedback-source.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/forecast-method.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/forecast-range-unit.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/forecastable-metric.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/format-id-parameter.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/frame-rate-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/frequency-cap-scope.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/genre-taxonomy.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/geo-level.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/gop-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/governance-decision.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/governance-domain.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/governance-mode.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/governance-phase.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/history-entry-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/http-method.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/identifier-types.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/impairment-offline-state.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/impairment-reason-code.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/installment-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/javascript-module-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/landing-page-requirement.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/legacy-postal-system.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/lift-dimension.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/logo-slot.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/makegood-remedy.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/markdown-flavor.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/match-id-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/match-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/media-buy-action-mode.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/media-buy-health.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/media-buy-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/media-buy-valid-action.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/metric-scope.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/metric-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/metro-system.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/moov-atom-position.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/notification-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/offering-availability-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/outcome-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/pacing.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/payment-terms.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/performance-standard-metric.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/policy-category.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/policy-enforcement.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/postal-system.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/preview-output-format.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/pricing-model.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/production-quality.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/property-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/proposal-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/publisher-identifier-types.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/purchase-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/reach-unit.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/reporting-frequency.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/response-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/restricted-attribute.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/right-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/right-use.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/rights-billing-period.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/scan-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/si-session-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/signal-catalog-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/signal-source.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/signal-value-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/snapshot-unavailable-reason.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/social-placement-surface.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/sort-direction.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/sort-metric.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/special-category.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/specialism.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/sponsored-placement-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/talent-role.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/task-status.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/task-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/transport-mode.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/travel-time-unit.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/uid-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/universal-macro.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/update-frequency.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/url-asset-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/validation-mode.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/vast-tracking-event.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/vast-version.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/video-placement-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/viewability-standard.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/watermark-media-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/wcag-level.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/webhook-response-type.json +1 -1
- package/dist/lib/schemas-data/3.1/enums/webhook-security-method.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/account-setup-required.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/action-not-allowed.json +4 -4
- package/dist/lib/schemas-data/3.1/error-details/agent-permission-denied.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/audience-too-small.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/authorization-required.json +3 -3
- package/dist/lib/schemas-data/3.1/error-details/billing-not-permitted-for-agent.json +3 -3
- package/dist/lib/schemas-data/3.1/error-details/billing-not-supported.json +2 -2
- package/dist/lib/schemas-data/3.1/error-details/budget-too-low.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/conflict.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/creative-rejected.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/policy-violation.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/rate-limited.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/stale-response.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/vendor-error-codes.json +1 -1
- package/dist/lib/schemas-data/3.1/error-details/version-unsupported.json +2 -2
- package/dist/lib/schemas-data/3.1/extensions/extension-meta.json +1 -1
- package/dist/lib/schemas-data/3.1/extensions/index.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/_base.json +5 -5
- package/dist/lib/schemas-data/3.1/formats/canonical/agent_placement.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/audio_daast.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/audio_hosted.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/display_tag.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/html5.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/image.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/image_carousel.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/native_in_feed.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/responsive_creative.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/sponsored_placement.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/video_hosted.json +2 -2
- package/dist/lib/schemas-data/3.1/formats/canonical/video_vast.json +2 -2
- package/dist/lib/schemas-data/3.1/governance/attribute-definition.json +1 -1
- package/dist/lib/schemas-data/3.1/governance/audience-constraints.json +3 -3
- package/dist/lib/schemas-data/3.1/governance/check-governance-request.json +8 -8
- package/dist/lib/schemas-data/3.1/governance/check-governance-response.json +7 -7
- package/dist/lib/schemas-data/3.1/governance/get-plan-audit-logs-request.json +5 -5
- package/dist/lib/schemas-data/3.1/governance/get-plan-audit-logs-response.json +11 -11
- package/dist/lib/schemas-data/3.1/governance/policy-category-definition.json +2 -2
- package/dist/lib/schemas-data/3.1/governance/policy-entry.json +6 -6
- package/dist/lib/schemas-data/3.1/governance/policy-ref.json +1 -1
- package/dist/lib/schemas-data/3.1/governance/report-plan-outcome-request.json +7 -7
- package/dist/lib/schemas-data/3.1/governance/report-plan-outcome-response.json +5 -5
- package/dist/lib/schemas-data/3.1/governance/sync-plans-request.json +14 -14
- package/dist/lib/schemas-data/3.1/governance/sync-plans-response.json +6 -6
- package/dist/lib/schemas-data/3.1/index.json +452 -440
- package/dist/lib/schemas-data/3.1/manifest.json +3 -3
- package/dist/lib/schemas-data/3.1/manifest.schema.json +1 -1
- package/dist/lib/schemas-data/3.1/media-buy/build-creative-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/build-creative-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/build-creative-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/media-buy/build-creative-request.json +16 -16
- package/dist/lib/schemas-data/3.1/media-buy/build-creative-response.json +35 -35
- package/dist/lib/schemas-data/3.1/media-buy/create-media-buy-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/create-media-buy-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/create-media-buy-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/media-buy/create-media-buy-request.json +13 -13
- package/dist/lib/schemas-data/3.1/media-buy/create-media-buy-response.json +19 -19
- package/dist/lib/schemas-data/3.1/media-buy/get-media-buy-delivery-request.json +23 -23
- package/dist/lib/schemas-data/3.1/media-buy/get-media-buy-delivery-response.json +27 -27
- package/dist/lib/schemas-data/3.1/media-buy/get-media-buys-request.json +8 -8
- package/dist/lib/schemas-data/3.1/media-buy/get-media-buys-response.json +30 -30
- package/dist/lib/schemas-data/3.1/media-buy/get-products-async-response-input-required.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/get-products-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/get-products-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/media-buy/get-products-request.json +13 -13
- package/dist/lib/schemas-data/3.1/media-buy/get-products-response.json +10 -10
- package/dist/lib/schemas-data/3.1/media-buy/list-creative-formats-request.json +13 -13
- package/dist/lib/schemas-data/3.1/media-buy/list-creative-formats-response.json +9 -9
- package/dist/lib/schemas-data/3.1/media-buy/log-event-request.json +5 -5
- package/dist/lib/schemas-data/3.1/media-buy/log-event-response.json +8 -8
- package/dist/lib/schemas-data/3.1/media-buy/media-buy-delivery-webhook-result.json +9 -9
- package/dist/lib/schemas-data/3.1/media-buy/package-request.json +23 -23
- package/dist/lib/schemas-data/3.1/media-buy/package-update.json +13 -13
- package/dist/lib/schemas-data/3.1/media-buy/provide-performance-feedback-request.json +7 -7
- package/dist/lib/schemas-data/3.1/media-buy/provide-performance-feedback-response.json +8 -8
- package/dist/lib/schemas-data/3.1/media-buy/sync-audiences-request.json +8 -8
- package/dist/lib/schemas-data/3.1/media-buy/sync-audiences-response.json +14 -14
- package/dist/lib/schemas-data/3.1/media-buy/sync-catalogs-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.1/media-buy/sync-catalogs-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/sync-catalogs-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/media-buy/sync-catalogs-request.json +8 -8
- package/dist/lib/schemas-data/3.1/media-buy/sync-catalogs-response.json +14 -14
- package/dist/lib/schemas-data/3.1/media-buy/sync-event-sources-request.json +8 -8
- package/dist/lib/schemas-data/3.1/media-buy/sync-event-sources-response.json +14 -14
- package/dist/lib/schemas-data/3.1/media-buy/update-media-buy-async-response-input-required.json +3 -3
- package/dist/lib/schemas-data/3.1/media-buy/update-media-buy-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/media-buy/update-media-buy-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/media-buy/update-media-buy-request.json +11 -11
- package/dist/lib/schemas-data/3.1/media-buy/update-media-buy-response.json +17 -17
- package/dist/lib/schemas-data/3.1/pricing-options/cpa-option.json +4 -4
- package/dist/lib/schemas-data/3.1/pricing-options/cpc-option.json +4 -4
- package/dist/lib/schemas-data/3.1/pricing-options/cpcv-option.json +4 -4
- package/dist/lib/schemas-data/3.1/pricing-options/cpm-option.json +4 -4
- package/dist/lib/schemas-data/3.1/pricing-options/cpp-option.json +5 -5
- package/dist/lib/schemas-data/3.1/pricing-options/cpv-option.json +4 -4
- package/dist/lib/schemas-data/3.1/pricing-options/flat-rate-option.json +4 -4
- package/dist/lib/schemas-data/3.1/pricing-options/price-breakdown.json +2 -2
- package/dist/lib/schemas-data/3.1/pricing-options/price-guidance.json +1 -1
- package/dist/lib/schemas-data/3.1/pricing-options/time-option.json +4 -4
- package/dist/lib/schemas-data/3.1/pricing-options/vcpm-option.json +4 -4
- package/dist/lib/schemas-data/3.1/property/authorization-result.json +1 -1
- package/dist/lib/schemas-data/3.1/property/base-property-source.json +4 -4
- package/dist/lib/schemas-data/3.1/property/create-property-list-request.json +8 -8
- package/dist/lib/schemas-data/3.1/property/create-property-list-response.json +6 -6
- package/dist/lib/schemas-data/3.1/property/delete-property-list-request.json +5 -5
- package/dist/lib/schemas-data/3.1/property/delete-property-list-response.json +5 -5
- package/dist/lib/schemas-data/3.1/property/delivery-record.json +3 -3
- package/dist/lib/schemas-data/3.1/property/get-property-list-request.json +5 -5
- package/dist/lib/schemas-data/3.1/property/get-property-list-response.json +9 -9
- package/dist/lib/schemas-data/3.1/property/list-property-lists-request.json +6 -6
- package/dist/lib/schemas-data/3.1/property/list-property-lists-response.json +7 -7
- package/dist/lib/schemas-data/3.1/property/property-error.json +2 -2
- package/dist/lib/schemas-data/3.1/property/property-feature-definition.json +2 -2
- package/dist/lib/schemas-data/3.1/property/property-feature-result.json +4 -4
- package/dist/lib/schemas-data/3.1/property/property-feature-value.json +2 -2
- package/dist/lib/schemas-data/3.1/property/property-feature.json +1 -1
- package/dist/lib/schemas-data/3.1/property/property-list-changed-webhook.json +2 -2
- package/dist/lib/schemas-data/3.1/property/property-list-filters.json +5 -5
- package/dist/lib/schemas-data/3.1/property/property-list.json +6 -6
- package/dist/lib/schemas-data/3.1/property/update-property-list-request.json +8 -8
- package/dist/lib/schemas-data/3.1/property/update-property-list-response.json +6 -6
- package/dist/lib/schemas-data/3.1/property/validate-property-delivery-request.json +6 -6
- package/dist/lib/schemas-data/3.1/property/validate-property-delivery-response.json +6 -6
- package/dist/lib/schemas-data/3.1/property/validation-result.json +5 -5
- package/dist/lib/schemas-data/3.1/protocol/get-adcp-capabilities-request.json +4 -4
- package/dist/lib/schemas-data/3.1/protocol/get-adcp-capabilities-response.json +33 -33
- package/dist/lib/schemas-data/3.1/protocol/get-task-status-request.json +5 -5
- package/dist/lib/schemas-data/3.1/protocol/get-task-status-response.json +10 -10
- package/dist/lib/schemas-data/3.1/protocol/list-tasks-request.json +13 -13
- package/dist/lib/schemas-data/3.1/protocol/list-tasks-response.json +8 -8
- package/dist/lib/schemas-data/3.1/registries/v1-canonical-mapping.json +355 -5
- package/dist/lib/schemas-data/3.1/signals/activate-signal-request.json +6 -6
- package/dist/lib/schemas-data/3.1/signals/activate-signal-response.json +9 -9
- package/dist/lib/schemas-data/3.1/signals/get-signals-async-response-submitted.json +4 -4
- package/dist/lib/schemas-data/3.1/signals/get-signals-async-response-working.json +3 -3
- package/dist/lib/schemas-data/3.1/signals/get-signals-request.json +11 -11
- package/dist/lib/schemas-data/3.1/signals/get-signals-response.json +17 -17
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-capabilities.json +1 -1
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-context-use.json +1 -1
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-get-offering-request.json +4 -4
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-get-offering-response.json +9 -9
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-identity.json +1 -1
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-initiate-session-request.json +7 -7
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-initiate-session-response.json +10 -10
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-send-message-request.json +5 -5
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-send-message-response.json +10 -10
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-sponsored-context-receipt.json +4 -4
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-sponsored-context.json +4 -4
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-terminate-session-request.json +4 -4
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-terminate-session-response.json +7 -7
- package/dist/lib/schemas-data/3.1/sponsored-intelligence/si-ui-element.json +1 -1
- package/dist/lib/schemas-data/3.1/trusted-match/available-package.json +4 -4
- package/dist/lib/schemas-data/3.1/trusted-match/context-match-request.json +5 -5
- package/dist/lib/schemas-data/3.1/trusted-match/context-match-response.json +4 -4
- package/dist/lib/schemas-data/3.1/trusted-match/error.json +1 -1
- package/dist/lib/schemas-data/3.1/trusted-match/identity-match-request.json +4 -4
- package/dist/lib/schemas-data/3.1/trusted-match/identity-match-response.json +45 -45
- package/dist/lib/schemas-data/3.1/trusted-match/offer-price.json +1 -1
- package/dist/lib/schemas-data/3.1/trusted-match/offer.json +5 -5
- package/dist/lib/schemas-data/3.1/trusted-match/provider-identity-match-response.json +90 -0
- package/dist/lib/schemas-data/3.1/trusted-match/provider-registration.json +8 -7
- package/dist/lib/schemas-data/3.1/trusted-match/publisher-tmpx-config.json +41 -0
- package/dist/lib/schemas-data/3.1/trusted-match/tmpx-chunk.json +28 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/decisioning/runtime/entity-hydration.generated.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/entity-hydration.generated.mjs.map +1 -1
- package/dist/lib/server/wire-spec-fields.generated.d.mts +29 -29
- package/dist/lib/server/wire-spec-fields.generated.d.ts +29 -29
- package/dist/lib/server/wire-spec-fields.generated.d.ts.map +1 -1
- package/dist/lib/server/wire-spec-fields.generated.js +29 -29
- package/dist/lib/server/wire-spec-fields.generated.js.map +1 -1
- package/dist/lib/server/wire-spec-fields.generated.mjs +29 -29
- package/dist/lib/server/wire-spec-fields.generated.mjs.map +1 -1
- package/dist/lib/testing/index.d.mts +1 -1
- package/dist/lib/testing/index.d.ts +1 -1
- package/dist/lib/testing/index.d.ts.map +1 -1
- package/dist/lib/testing/index.js +12 -0
- package/dist/lib/testing/index.js.map +1 -1
- package/dist/lib/testing/index.mjs +12 -0
- package/dist/lib/testing/index.mjs.map +1 -1
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.mts +6 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts +6 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +11 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js.map +1 -1
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.mjs +10 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.mjs.map +1 -1
- package/dist/lib/testing/storyboard/creative-assets.d.mts +5 -0
- package/dist/lib/testing/storyboard/creative-assets.d.ts +6 -0
- package/dist/lib/testing/storyboard/creative-assets.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/creative-assets.js +180 -0
- package/dist/lib/testing/storyboard/creative-assets.js.map +1 -0
- package/dist/lib/testing/storyboard/creative-assets.mjs +154 -0
- package/dist/lib/testing/storyboard/creative-assets.mjs.map +1 -0
- package/dist/lib/testing/storyboard/fixture-resolution.d.mts +37 -0
- package/dist/lib/testing/storyboard/fixture-resolution.d.ts +38 -0
- package/dist/lib/testing/storyboard/fixture-resolution.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/fixture-resolution.js +424 -0
- package/dist/lib/testing/storyboard/fixture-resolution.js.map +1 -0
- package/dist/lib/testing/storyboard/fixture-resolution.mjs +395 -0
- package/dist/lib/testing/storyboard/fixture-resolution.mjs.map +1 -0
- package/dist/lib/testing/storyboard/index.d.mts +2 -1
- package/dist/lib/testing/storyboard/index.d.ts +2 -1
- package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/index.js +13 -0
- package/dist/lib/testing/storyboard/index.js.map +1 -1
- package/dist/lib/testing/storyboard/index.mjs +14 -0
- package/dist/lib/testing/storyboard/index.mjs.map +1 -1
- package/dist/lib/testing/storyboard/junit.js +14 -1
- package/dist/lib/testing/storyboard/junit.js.map +1 -1
- package/dist/lib/testing/storyboard/junit.mjs +14 -1
- package/dist/lib/testing/storyboard/junit.mjs.map +1 -1
- package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/loader.js +2 -0
- package/dist/lib/testing/storyboard/loader.js.map +1 -1
- package/dist/lib/testing/storyboard/loader.mjs +2 -0
- package/dist/lib/testing/storyboard/loader.mjs.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +170 -12
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.mjs +175 -13
- package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
- package/dist/lib/testing/storyboard/seeding.d.mts +10 -3
- package/dist/lib/testing/storyboard/seeding.d.ts +10 -3
- package/dist/lib/testing/storyboard/seeding.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/seeding.js +550 -2
- package/dist/lib/testing/storyboard/seeding.js.map +1 -1
- package/dist/lib/testing/storyboard/seeding.mjs +555 -2
- package/dist/lib/testing/storyboard/seeding.mjs.map +1 -1
- package/dist/lib/testing/storyboard/types.d.mts +106 -0
- package/dist/lib/testing/storyboard/types.d.ts +106 -0
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js +1 -0
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/types.mjs +1 -0
- package/dist/lib/testing/storyboard/types.mjs.map +1 -1
- package/dist/lib/testing/stubs/governance-agent-stub.d.ts.map +1 -1
- package/dist/lib/testing/stubs/governance-agent-stub.js +4 -1
- package/dist/lib/testing/stubs/governance-agent-stub.js.map +1 -1
- package/dist/lib/testing/stubs/governance-agent-stub.mjs +4 -1
- package/dist/lib/testing/stubs/governance-agent-stub.mjs.map +1 -1
- package/dist/lib/types/adcp.d.mts +10 -0
- package/dist/lib/types/adcp.d.ts +10 -0
- package/dist/lib/types/adcp.d.ts.map +1 -1
- package/dist/lib/types/adcp.js.map +1 -1
- package/dist/lib/types/adcp.mjs.map +1 -1
- package/dist/lib/types/core.generated.d.mts +127 -19
- package/dist/lib/types/core.generated.d.ts +127 -19
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js.map +1 -1
- package/dist/lib/types/inline-enums.generated.d.mts +2 -0
- package/dist/lib/types/inline-enums.generated.d.ts +2 -0
- package/dist/lib/types/inline-enums.generated.d.ts.map +1 -1
- package/dist/lib/types/inline-enums.generated.js +3 -0
- package/dist/lib/types/inline-enums.generated.js.map +1 -1
- package/dist/lib/types/inline-enums.generated.mjs +2 -0
- package/dist/lib/types/inline-enums.generated.mjs.map +1 -1
- package/dist/lib/types/manifest.generated.d.mts +3 -3
- package/dist/lib/types/manifest.generated.d.ts +3 -3
- package/dist/lib/types/manifest.generated.js.map +1 -1
- package/dist/lib/types/manifest.generated.mjs.map +1 -1
- package/dist/lib/types/per-tool-index.json +1 -1
- package/dist/lib/types/schemas.generated.d.mts +124 -20
- package/dist/lib/types/schemas.generated.d.ts +124 -20
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +83 -24
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/schemas.generated.mjs +79 -24
- package/dist/lib/types/schemas.generated.mjs.map +1 -1
- package/dist/lib/utils/response-schemas.js +1 -1
- package/dist/lib/utils/response-schemas.js.map +1 -1
- package/dist/lib/utils/response-schemas.mjs +1 -1
- package/dist/lib/utils/response-schemas.mjs.map +1 -1
- package/dist/lib/utils/sync-creatives-adapter.d.mts +6 -0
- package/dist/lib/utils/sync-creatives-adapter.d.ts +6 -0
- package/dist/lib/utils/sync-creatives-adapter.d.ts.map +1 -1
- package/dist/lib/utils/sync-creatives-adapter.js +22 -1
- package/dist/lib/utils/sync-creatives-adapter.js.map +1 -1
- package/dist/lib/utils/sync-creatives-adapter.mjs +22 -1
- package/dist/lib/utils/sync-creatives-adapter.mjs.map +1 -1
- package/dist/lib/validation/schema-loader.d.mts +16 -0
- package/dist/lib/validation/schema-loader.d.ts +16 -0
- package/dist/lib/validation/schema-loader.d.ts.map +1 -1
- package/dist/lib/validation/schema-loader.js +116 -0
- package/dist/lib/validation/schema-loader.js.map +1 -1
- package/dist/lib/validation/schema-loader.mjs +115 -0
- package/dist/lib/validation/schema-loader.mjs.map +1 -1
- package/dist/lib/version.d.mts +7 -7
- package/dist/lib/version.d.ts +7 -7
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +9 -6
- package/dist/lib/version.js.map +1 -1
- package/dist/lib/version.mjs +9 -6
- package/dist/lib/version.mjs.map +1 -1
- package/docs/llms.txt +13 -3
- package/package.json +2 -2
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/brand/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/brand/scenarios/distributed_brand_resolution.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/brand/scenarios/single_side_trust_extension.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/creative/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/creative/scenarios/billing_out_of_band.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/creative/scenarios/canonical_supported_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/creative/scenarios/evaluator_auth.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/creative/scenarios/native_in_feed.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/governance/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/audience_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/available_actions.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/billing_finality_delivery.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/canonical_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/clicks_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/completed_views_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/creative_reception.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/delivery_reporting.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/dependency_impairment.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/event_dedup_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/get_products_async.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/governance_approved.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/governance_conditions.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/inline_creatives_without_sync.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/invalid_transitions.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/measurement_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/package_correlation_legacy_fallback.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/performance_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/pricing_currency_filter.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/product_signal_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/proposal_finalize.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/proposal_not_found_errors.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/provenance_audit_observation.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/provenance_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/reach_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/refine_products.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/vendor_metric_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/media-buy/state-machine.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/signals/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/signals/scenarios/get_signals_async.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/domains/sponsored-intelligence/sponsored-context-accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/brand/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/brand/scenarios/distributed_brand_resolution.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/brand/scenarios/single_side_trust_extension.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/creative/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/creative/scenarios/billing_out_of_band.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/creative/scenarios/canonical_supported_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/creative/scenarios/evaluator_auth.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/creative/scenarios/native_in_feed.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/governance/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/audience_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/available_actions.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/billing_finality_delivery.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/canonical_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/clicks_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/completed_views_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/creative_reception.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/dependency_impairment.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/event_dedup_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/get_products_async.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/governance_approved.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/governance_conditions.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/inline_creatives_without_sync.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/measurement_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/package_correlation_legacy_fallback.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/performance_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/pricing_currency_filter.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/product_signal_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/proposal_not_found_errors.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/provenance_audit_observation.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/provenance_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/reach_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/refine_products.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/vendor_metric_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/media-buy/state-machine.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/signals/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/signals/scenarios/get_signals_async.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/protocols/sponsored-intelligence/sponsored-context-accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/audience-sync/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/brand-rights/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/collection-lists/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/content-standards/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/creative-ad-server/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/creative-generative/generative-seller.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/creative-generative/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/creative-template/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/creative-transformers/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/governance-aware-seller/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/governance-aware-seller/scenarios/governance_multi_agent_rejected.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/governance-delivery-monitor/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/governance-spend-authority/denied.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/governance-spend-authority/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/property-lists/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/sales-broadcast-tv/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/sales-catalog-driven/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/sales-guaranteed/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/sales-non-guaranteed/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/sales-proposal-mode/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/sales-social/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/signal-marketplace/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/signal-owned/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/specialisms/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/acme-outdoor-live.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/acme-outdoor.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/billing-gate-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/bistro-oranje.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/distributed-brand-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/nova-motors.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/osei-natural.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/parallel-dispatch-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/rate-limit-trip-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/signed-requests-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/single-side-trust-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/substitution-observer-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/summit-foods.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-kits/webhook-receiver-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/catalog-macro-substitution.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/001-minimal-plan.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/002-full-plan.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/004a-human-review-omitted.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/007-unicode-objectives.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/README.md +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/canonicalization.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/keys.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/001-no-signature-header.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/002-wrong-tag.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/003-expired-signature.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/004-window-too-long.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/011-malformed-header.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/013-expires-le-created.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/015-signature-invalid.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/017-key-revoked.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/020-rate-abuse.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/negative/028-unsigned-protocol-method-required.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/001-basic-post.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/003-es256-post.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-receiver-envelope.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/README.md +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/keys.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/001-basic-post.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/002-es256-post.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/test-vectors/webhook-signing/positive/008-request-signing-key-reuse.json +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/billing-gate-dispatch.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/canonical-format-validate-input.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/capability-discovery.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/collection-lists-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/comply-controller-mode-gate.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/content-standards-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/deterministic-testing.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/error-compliance-signals.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/error-compliance.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/fictional-entities.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/get-media-buys-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/get-products-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/get-signals-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/idempotency.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/notification-config-event-scope.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/notification-config-lifecycle.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/notification-config-rejections.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/pagination-integrity-creative-formats.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/pagination-integrity-list-accounts.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/property-lists-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/read-tool-idempotency.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/schema-validation-signals.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/schema-validation.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/security.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/signed-requests.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/stale-response-advisory.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/v3-envelope-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/version-negotiation.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/webhook-emission.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/webhook-receiver-envelope.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/wholesale-feed-bulk-webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/wholesale-feed-product-webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/wholesale-feed-products.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/wholesale-feed-signal-webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8 → 3.1.11}/universal/wholesale-feed-signals.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/brand/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/brand/scenarios/distributed_brand_resolution.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/brand/scenarios/single_side_trust_extension.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/creative/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/creative/scenarios/billing_out_of_band.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/creative/scenarios/canonical_supported_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/creative/scenarios/evaluator_auth.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/creative/scenarios/native_in_feed.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/governance/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/audience_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/available_actions.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/billing_finality_delivery.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/canonical_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/clicks_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/completed_views_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/creative_reception.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/delivery_reporting.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/dependency_impairment.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/event_dedup_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/get_products_async.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/governance_approved.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/governance_conditions.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/inline_creatives_without_sync.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/invalid_transitions.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/measurement_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/package_correlation_legacy_fallback.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/performance_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/pricing_currency_filter.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/product_signal_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/proposal_finalize.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/proposal_not_found_errors.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/provenance_audit_observation.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/provenance_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/reach_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/refine_products.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/vendor_metric_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/media-buy/state-machine.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/signals/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/signals/scenarios/get_signals_async.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/domains/sponsored-intelligence/sponsored-context-accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/brand/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/brand/scenarios/distributed_brand_resolution.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/brand/scenarios/single_side_trust_extension.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/creative/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/creative/scenarios/billing_out_of_band.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/creative/scenarios/canonical_supported_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/creative/scenarios/evaluator_auth.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/creative/scenarios/native_in_feed.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/governance/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/audience_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/available_actions.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/billing_finality_delivery.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/canonical_formats.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/clicks_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/completed_views_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/creative_reception.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/dependency_impairment.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/event_dedup_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/get_products_async.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/governance_approved.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/governance_conditions.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/inline_creatives_without_sync.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/measurement_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/package_correlation_legacy_fallback.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/performance_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/pricing_currency_filter.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/product_signal_targeting.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/proposal_not_found_errors.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/provenance_audit_observation.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/provenance_enforcement.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/reach_buy_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/refine_products.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/vendor_metric_accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/media-buy/state-machine.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/signals/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/signals/scenarios/get_signals_async.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/protocols/sponsored-intelligence/sponsored-context-accountability.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/audience-sync/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/brand-rights/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/collection-lists/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/content-standards/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/creative-ad-server/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/creative-generative/generative-seller.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/creative-generative/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/creative-template/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/creative-transformers/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/governance-aware-seller/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/governance-aware-seller/scenarios/governance_multi_agent_rejected.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/governance-delivery-monitor/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/governance-spend-authority/denied.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/governance-spend-authority/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/property-lists/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/sales-broadcast-tv/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/sales-catalog-driven/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/sales-guaranteed/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/sales-non-guaranteed/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/sales-proposal-mode/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/sales-social/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/signal-marketplace/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/signal-owned/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/specialisms/sponsored-intelligence/index.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/acme-outdoor-live.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/acme-outdoor.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/billing-gate-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/bistro-oranje.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/distributed-brand-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/nova-motors.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/osei-natural.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/parallel-dispatch-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/rate-limit-trip-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/signed-requests-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/single-side-trust-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/substitution-observer-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/summit-foods.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-kits/webhook-receiver-runner.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/catalog-macro-substitution.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/001-minimal-plan.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/002-full-plan.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/004a-human-review-omitted.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/007-unicode-objectives.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/README.md +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/canonicalization.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/keys.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/001-no-signature-header.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/002-wrong-tag.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/003-expired-signature.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/004-window-too-long.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/011-malformed-header.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/013-expires-le-created.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/015-signature-invalid.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/017-key-revoked.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/020-rate-abuse.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/negative/028-unsigned-protocol-method-required.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/001-basic-post.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/003-es256-post.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-receiver-envelope.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/README.md +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/keys.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/001-basic-post.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/002-es256-post.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/test-vectors/webhook-signing/positive/008-request-signing-key-reuse.json +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/billing-gate-dispatch.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/canonical-format-validate-input.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/capability-discovery.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/collection-lists-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/comply-controller-mode-gate.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/content-standards-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/deterministic-testing.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/error-compliance-signals.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/error-compliance.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/fictional-entities.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/get-media-buys-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/get-products-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/get-signals-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/idempotency.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/notification-config-event-scope.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/notification-config-lifecycle.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/notification-config-rejections.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/pagination-integrity-creative-formats.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/pagination-integrity-list-accounts.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/property-lists-pagination-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/read-tool-idempotency.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/schema-validation-signals.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/schema-validation.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/security.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/signed-requests.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/stale-response-advisory.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/v3-envelope-integrity.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/version-negotiation.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/webhook-emission.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/webhook-receiver-envelope.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/wholesale-feed-bulk-webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/wholesale-feed-product-webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/wholesale-feed-products.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/wholesale-feed-signal-webhooks.yaml +0 -0
- /package/compliance/cache/{3.1.8.previous → 3.1.11.previous}/universal/wholesale-feed-signals.yaml +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/auth/oauth/ClientCredentialsFlow.ts"],"sourcesContent":["/**\n * OAuth 2.0 client credentials grant — RFC 6749 §4.4.\n *\n * For machine-to-machine use cases (CI compliance runs, automated checks)\n * where there is no user to walk through an authorization-code flow. The\n * client POSTs its ID + secret to the authorization server's token endpoint\n * and gets back an access token directly.\n *\n * This file provides:\n * - {@link exchangeClientCredentials}: one-shot token exchange. Use for the\n * initial fetch during `--save-auth` and for forced refresh.\n * - {@link ensureClientCredentialsTokens}: reads the cached tokens on an\n * `AgentConfig`, checks expiry, re-exchanges if needed, and persists the\n * refreshed tokens via an optional {@link OAuthConfigStorage}.\n *\n * Why a dedicated module instead of the MCP SDK's `OAuthClientProvider`:\n * client credentials doesn't need discovery, dynamic client registration,\n * PKCE, or authorization code exchange — all the plumbing that provider\n * exists to coordinate. A direct token POST and a cached-token check is the\n * entire protocol. The call path keeps using the plain `Authorization:\n * Bearer` header path — the same path it already uses for `auth_token`.\n *\n * **Security note (library consumers):** `token_endpoint` is passed to\n * `fetch` directly. Callers that accept untrusted `AgentConfig` values\n * from network requests (e.g. a hosted compliance service accepting\n * user-supplied configs) MUST validate the URL against an allowlist or\n * SSRF-block private IPs before invoking these helpers. The CLI and\n * operator-driven flows are already trusted.\n */\n\nimport { fromMCPTokens, type OAuthTokens, type AgentConfig, type AgentOAuthTokens } from './types';\nimport type { AgentOAuthClientCredentials } from '../../types/adcp';\nimport type { OAuthConfigStorage } from './types';\nimport { resolveSecret } from './secret-resolver';\nimport { isLikelyPrivateUrl } from '../../net';\nimport { wrapFetchWithSizeLimit } from '../../protocols/responseSizeLimit';\n\n/** Max length we'll echo from an AS-supplied error description into errors. */\nconst MAX_AS_ERROR_LENGTH = 200;\n\n/**\n * Raised when the authorization server rejects a client credentials\n * exchange or the token endpoint is unreachable/malformed.\n *\n * The {@link kind} discriminator lets callers branch without\n * string-matching on the message:\n * - `oauth`: the AS returned a structured OAuth error (RFC 6749 §5.2 —\n * `invalid_client`, `invalid_grant`, `invalid_scope`, …). Read\n * {@link oauthError} / {@link oauthErrorDescription}.\n * - `malformed`: the AS returned HTTP 200 but no `access_token`, or a\n * non-JSON body.\n * - `network`: the exchange never reached the AS (DNS failure, connection\n * refused, timeout, TLS error).\n */\nexport class ClientCredentialsExchangeError extends Error {\n readonly code = 'client_credentials_exchange_failed';\n constructor(\n message: string,\n public readonly kind: 'oauth' | 'malformed' | 'network',\n public readonly oauthError?: string,\n public readonly oauthErrorDescription?: string,\n public readonly httpStatus?: number\n ) {\n super(message);\n this.name = 'ClientCredentialsExchangeError';\n }\n}\n\n/**\n * Options for {@link exchangeClientCredentials}.\n */\nexport interface ExchangeClientCredentialsOptions {\n /**\n * Custom fetch implementation (default: global `fetch`).\n * Primarily a testing hook — lets unit tests stub the authorization server\n * without intercepting the global.\n */\n fetch?: typeof fetch;\n /**\n * Request timeout in milliseconds (default: 30_000). Guards against a\n * silently hung authorization server blocking the caller indefinitely.\n */\n timeoutMs?: number;\n /**\n * Allow `token_endpoint` to resolve to a private / loopback IP address.\n * Default: false (SSRF guard). The CLI opts in because the operator is\n * explicitly configuring the endpoint; hosted consumers accepting\n * user-supplied configs should leave this off.\n */\n allowPrivateIp?: boolean;\n}\n\n/**\n * RFC 6749 §2.3.1 application/x-www-form-urlencoded encoding.\n *\n * Differs from `encodeURIComponent` in two important ways:\n * 1. Spaces are encoded as `+`, not `%20`.\n * 2. The characters `!'()*` are percent-encoded (URI component leaves them\n * alone).\n *\n * A secret containing any of those chars would hash to a different Basic\n * string than the AS computes, producing a spurious `invalid_client`.\n */\nfunction formUrlEncode(value: string): string {\n return encodeURIComponent(value)\n .replace(/%20/g, '+')\n .replace(/!/g, '%21')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29')\n .replace(/\\*/g, '%2A');\n}\n\n/**\n * Strip control chars (C0, C1, DEL) and truncate.\n *\n * Defensive cleanup on AS-controlled strings we print to a TTY. A\n * malicious or compromised AS could emit ANSI escape sequences or CRLF\n * payloads in `error_description`; we don't want those rewriting terminal\n * titles or forging log lines.\n */\nfunction sanitizeAsMessage(raw: string): string {\n // eslint-disable-next-line no-control-regex\n const stripped = raw.replace(/[\\x00-\\x1F\\x7F-\\x9F]/g, ' ');\n if (stripped.length <= MAX_AS_ERROR_LENGTH) return stripped;\n return stripped.slice(0, MAX_AS_ERROR_LENGTH) + '…';\n}\n\n/**\n * Validate the token endpoint before we hit it. Three checks, in order:\n *\n * 1. Parse as a URL. Unparseable → `malformed`.\n * 2. Reject URLs that carry `user:pass@` userinfo — they'd leak via error\n * messages and log aggregators, and the OAuth client credentials live\n * in `client_id` / `client_secret`, never the URL.\n * 3. Reject plaintext `http://` outside `localhost` / loopback IPs.\n * RFC 6749 §3.1 requires TLS; the loopback carve-out covers local dev\n * authorization servers where plaintext is not a leak risk.\n * 4. Reject private / loopback / link-local IPs unless `allowPrivateIp`.\n * The library default is a SSRF guard; the CLI (operator-driven) opts\n * in because a user pointing at `localhost:8080` is legitimate. Network\n * code behind this call will still do DNS resolution, so this is a\n * best-effort literal-IP / known-loopback check — host allowlisting\n * upstream is the right control for adversarial environments.\n */\nfunction validateTokenEndpoint(tokenEndpoint: string, options: { allowPrivateIp?: boolean } = {}): URL {\n let url: URL;\n try {\n url = new URL(tokenEndpoint);\n } catch {\n throw new ClientCredentialsExchangeError(`Invalid token_endpoint URL: ${tokenEndpoint}`, 'malformed');\n }\n\n if (url.username || url.password) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must not contain userinfo (user:pass@). Put credentials in client_id / client_secret instead.`,\n 'malformed'\n );\n }\n\n const host = url.hostname;\n const isLoopback = host === 'localhost' || host === '127.0.0.1' || host === '[::1]' || host === '::1';\n\n if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLoopback)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must be HTTPS (got ${url.protocol}//${host}). The client secret would be sent in plaintext over HTTP. Use https:// (or http://localhost for local dev).`,\n 'malformed'\n );\n }\n\n if (!options.allowPrivateIp && isLikelyPrivateUrl(tokenEndpoint)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint resolves to a private or loopback address (${host}). Pass { allowPrivateIp: true } to exchangeClientCredentials / ensureClientCredentialsTokens if this is intentional (operator-driven CLI or local test setups).`,\n 'malformed'\n );\n }\n\n return url;\n}\n\n/**\n * Exchange client credentials for an access token.\n *\n * Secret values in `credentials.client_id` / `client_secret` may be `$ENV:VAR`\n * references — they are resolved here at exchange time. Missing env vars\n * surface as `MissingEnvSecretError` (from `secret-resolver`), which\n * callers typically print with the variable name for the user to fix.\n *\n * @throws {ClientCredentialsExchangeError} on any non-2xx response, malformed 200, or network failure\n * @throws {MissingEnvSecretError} if a `$ENV:VAR` ref points at an unset var\n */\nexport async function exchangeClientCredentials(\n credentials: AgentOAuthClientCredentials,\n options: ExchangeClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n // Wrap with the response-size-limit guard so a hostile token endpoint\n // can't buffer-bomb on every refresh. Pass-through when no\n // `withResponseSizeLimit` slot is active. (#1175)\n const fetchImpl = wrapFetchWithSizeLimit(options.fetch ?? fetch);\n const timeoutMs = options.timeoutMs ?? 30_000;\n\n validateTokenEndpoint(credentials.token_endpoint, { allowPrivateIp: options.allowPrivateIp });\n\n const clientId = resolveSecret(credentials.client_id);\n const clientSecret = resolveSecret(credentials.client_secret);\n const authMethod = credentials.auth_method ?? 'basic';\n\n const body = new URLSearchParams();\n body.set('grant_type', 'client_credentials');\n if (credentials.scope) {\n body.set('scope', credentials.scope);\n }\n // RFC 8707 resource indicators — emitted as one `resource` field per URI\n // so the AS receives the full list. URLSearchParams#append is the only\n // way to produce repeated keys in form encoding.\n if (credentials.resource) {\n const resources = Array.isArray(credentials.resource) ? credentials.resource : [credentials.resource];\n for (const r of resources) body.append('resource', r);\n }\n if (credentials.audience) {\n body.set('audience', credentials.audience);\n }\n\n const headers: Record<string, string> = {\n 'content-type': 'application/x-www-form-urlencoded',\n accept: 'application/json',\n };\n\n if (authMethod === 'basic') {\n // RFC 6749 §2.3.1: form-urlencode ID/secret before base64 (NOT URI\n // component encoding — space is `+`, and `!'()*` must be percent-\n // encoded). Most deployed servers accept raw values too, but spec\n // compliance avoids a footgun with secrets containing those chars.\n const encoded = Buffer.from(`${formUrlEncode(clientId)}:${formUrlEncode(clientSecret)}`, 'utf-8').toString(\n 'base64'\n );\n headers.authorization = `Basic ${encoded}`;\n } else {\n body.set('client_id', clientId);\n body.set('client_secret', clientSecret);\n }\n\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), timeoutMs);\n\n let response: Response;\n try {\n response = await fetchImpl(credentials.token_endpoint, {\n method: 'POST',\n headers,\n body: body.toString(),\n signal: controller.signal,\n });\n } catch (err) {\n if ((err as { name?: string }).name === 'AbortError') {\n throw new ClientCredentialsExchangeError(\n `Token endpoint ${credentials.token_endpoint} did not respond within ${timeoutMs}ms.`,\n 'network'\n );\n }\n throw new ClientCredentialsExchangeError(\n `Failed to reach token endpoint ${credentials.token_endpoint}: ${(err as Error).message}`,\n 'network'\n );\n } finally {\n clearTimeout(timeout);\n }\n\n const bodyText = await response.text();\n let parsed: Record<string, unknown> | undefined;\n try {\n parsed = bodyText ? (JSON.parse(bodyText) as Record<string, unknown>) : undefined;\n } catch {\n // Non-JSON response; parsed stays undefined, handled below.\n }\n\n if (!response.ok) {\n const rawOauthError = typeof parsed?.error === 'string' ? parsed.error : undefined;\n const rawOauthDesc = typeof parsed?.error_description === 'string' ? parsed.error_description : undefined;\n const oauthError = rawOauthError ? sanitizeAsMessage(rawOauthError) : undefined;\n const oauthDesc = rawOauthDesc ? sanitizeAsMessage(rawOauthDesc) : undefined;\n const message =\n oauthError || oauthDesc\n ? `Client credentials exchange failed: ${oauthError ?? 'error'}${oauthDesc ? ` — ${oauthDesc}` : ''}`\n : `Client credentials exchange failed with HTTP ${response.status}: ${sanitizeAsMessage(bodyText) || '(empty body)'}`;\n const kind = rawOauthError ? 'oauth' : 'malformed';\n throw new ClientCredentialsExchangeError(message, kind, oauthError, oauthDesc, response.status);\n }\n\n if (!parsed || typeof parsed.access_token !== 'string') {\n throw new ClientCredentialsExchangeError(\n `Token endpoint returned HTTP ${response.status} but no access_token. Body: ${sanitizeAsMessage(bodyText)}`,\n 'malformed',\n undefined,\n undefined,\n response.status\n );\n }\n\n return fromMCPTokens(parsed as unknown as OAuthTokens);\n}\n\n/**\n * Options for {@link ensureClientCredentialsTokens}.\n */\nexport interface EnsureClientCredentialsOptions extends ExchangeClientCredentialsOptions {\n /**\n * Storage backend used to persist refreshed tokens. Optional — if omitted,\n * tokens are only mutated on the in-memory `agent` object and the caller\n * is responsible for persisting.\n */\n storage?: OAuthConfigStorage;\n /**\n * Force a re-exchange even if the cached token looks valid. Useful after a\n * 401 in case the authorization server rotated something out-of-band.\n */\n force?: boolean;\n /**\n * Expiration skew (ms). Treat the token as expired this many milliseconds\n * before its nominal `expires_at` — protects against clock skew and\n * in-flight requests. Default: 60_000 (1 minute). The interactive auth\n * code flow uses 5 minutes; client credentials refresh is cheap (single\n * POST) so the shorter window is fine here.\n */\n expirationSkewMs?: number;\n}\n\n/**\n * In-flight refresh coalescing map. Keyed by the tuple\n * `(agent.id, token_endpoint, client_id)` — concurrent\n * `ensureClientCredentialsTokens` calls for the same credentials share a\n * single token POST instead of each racing to exchange the same secret.\n *\n * Two different `AgentConfig` objects that accidentally reuse the same\n * `id` (e.g. two tenants both creating `cli-agent`) but hold different\n * credentials won't cross-contaminate — the endpoint + client_id in the\n * key keeps them distinct.\n *\n * Cleared on completion regardless of success/failure.\n *\n * Note: this is an in-process map. Multi-process deployments (worker\n * pools, multiple CLI invocations, horizontally scaled Node servers)\n * don't coalesce across workers — each process will do its own refresh.\n * For the CLI this is fine; for high-throughput server deployments,\n * coalesce upstream at the storage layer.\n */\nconst inFlightRefresh = new Map<string, Promise<AgentOAuthTokens>>();\n\n/**\n * Compute the coalesce key for `ensureClientCredentialsTokens`. `force: true`\n * uses a distinct bucket so a 401-triggered forced refresh never piggybacks\n * on a still-pending non-forced exchange — the whole point of forcing is\n * that the in-flight token is *known* stale, so awaiting it would defeat\n * the retry.\n */\nfunction coalesceKeyFor(agent: AgentConfig, credentials: AgentOAuthClientCredentials, force: boolean): string {\n return `${force ? 'force' : 'normal'}\\u0000${agent.id}\\u0000${credentials.token_endpoint}\\u0000${credentials.client_id}`;\n}\n\n/**\n * Ensure an agent has a valid access token, refreshing via client credentials\n * if the cached one is missing or expired. Idempotent and safe to call\n * before every request.\n *\n * Concurrent calls for the same `agent.id` are coalesced into a single\n * token POST via an in-process promise map — the common case of a\n * storyboard fan-out firing 10 tool calls in parallel does one refresh,\n * not ten.\n *\n * **Mutation:** this function writes `agent.oauth_tokens` in place. That is\n * the contract the MCP SDK's `OAuthClientProvider` pattern also uses, and\n * it lets the CLI's file-backed storage see the same object. Callers that\n * share an `AgentConfig` across different logical agents must copy first.\n *\n * Precondition: `agent.oauth_client_credentials` must be set. Throws a plain\n * Error if not — callers are expected to branch on its presence before\n * calling this.\n */\nexport async function ensureClientCredentialsTokens(\n agent: AgentConfig,\n options: EnsureClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n if (!agent.oauth_client_credentials) {\n throw new Error(\n `ensureClientCredentialsTokens called for agent '${agent.id}' with no oauth_client_credentials configured.`\n );\n }\n\n const skew = options.expirationSkewMs ?? 60_000;\n const cached = agent.oauth_tokens;\n const cachedIsValid =\n !options.force &&\n cached?.access_token &&\n (!cached.expires_at || new Date(cached.expires_at).getTime() - Date.now() > skew);\n\n if (cachedIsValid) {\n return cached!;\n }\n\n const coalesceKey = coalesceKeyFor(agent, agent.oauth_client_credentials, options.force === true);\n const existing = inFlightRefresh.get(coalesceKey);\n if (existing) {\n const tokens = await existing;\n agent.oauth_tokens = tokens;\n return tokens;\n }\n\n const exchange = (async () => {\n try {\n const tokens = await exchangeClientCredentials(agent.oauth_client_credentials!, {\n fetch: options.fetch,\n timeoutMs: options.timeoutMs,\n allowPrivateIp: options.allowPrivateIp,\n });\n agent.oauth_tokens = tokens;\n if (options.storage) {\n await options.storage.saveAgent(agent);\n }\n return tokens;\n } finally {\n inFlightRefresh.delete(co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AAAA,IACT,UAAE;AACA,sBAAgB,OAAO,WAAW;AAAA,IACpC;AAAA,EACF,GAAG;AAEH,kBAAgB,IAAI,aAAa,QAAQ;AACzC,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/auth/oauth/ClientCredentialsFlow.ts"],"sourcesContent":["/**\n * OAuth 2.0 client credentials grant — RFC 6749 §4.4.\n *\n * For machine-to-machine use cases (CI compliance runs, automated checks)\n * where there is no user to walk through an authorization-code flow. The\n * client POSTs its ID + secret to the authorization server's token endpoint\n * and gets back an access token directly.\n *\n * This file provides:\n * - {@link exchangeClientCredentials}: one-shot token exchange. Use for the\n * initial fetch during `--save-auth` and for forced refresh.\n * - {@link ensureClientCredentialsTokens}: reads the cached tokens on an\n * `AgentConfig`, checks expiry, re-exchanges if needed, and persists the\n * refreshed tokens via an optional {@link OAuthConfigStorage}.\n *\n * Why a dedicated module instead of the MCP SDK's `OAuthClientProvider`:\n * client credentials doesn't need discovery, dynamic client registration,\n * PKCE, or authorization code exchange — all the plumbing that provider\n * exists to coordinate. A direct token POST and a cached-token check is the\n * entire protocol. The call path keeps using the plain `Authorization:\n * Bearer` header path — the same path it already uses for `auth_token`.\n *\n * **Security note (library consumers):** `token_endpoint` is passed to\n * `fetch` directly. Callers that accept untrusted `AgentConfig` values\n * from network requests (e.g. a hosted compliance service accepting\n * user-supplied configs) MUST validate the URL against an allowlist or\n * SSRF-block private IPs before invoking these helpers. The CLI and\n * operator-driven flows are already trusted.\n */\n\nimport { fromMCPTokens, type OAuthTokens, type AgentConfig, type AgentOAuthTokens } from './types';\nimport type { AgentOAuthClientCredentials } from '../../types/adcp';\nimport type { OAuthConfigStorage } from './types';\nimport { resolveSecret } from './secret-resolver';\nimport { isLikelyPrivateUrl } from '../../net';\nimport { wrapFetchWithSizeLimit } from '../../protocols/responseSizeLimit';\nimport { createAbortError, throwIfAborted, withAbortSignal } from '../../protocols/abort';\n\n/** Max length we'll echo from an AS-supplied error description into errors. */\nconst MAX_AS_ERROR_LENGTH = 200;\n\n/**\n * Raised when the authorization server rejects a client credentials\n * exchange or the token endpoint is unreachable/malformed.\n *\n * The {@link kind} discriminator lets callers branch without\n * string-matching on the message:\n * - `oauth`: the AS returned a structured OAuth error (RFC 6749 §5.2 —\n * `invalid_client`, `invalid_grant`, `invalid_scope`, …). Read\n * {@link oauthError} / {@link oauthErrorDescription}.\n * - `malformed`: the AS returned HTTP 200 but no `access_token`, or a\n * non-JSON body.\n * - `network`: the exchange never reached the AS (DNS failure, connection\n * refused, timeout, TLS error).\n */\nexport class ClientCredentialsExchangeError extends Error {\n readonly code = 'client_credentials_exchange_failed';\n constructor(\n message: string,\n public readonly kind: 'oauth' | 'malformed' | 'network',\n public readonly oauthError?: string,\n public readonly oauthErrorDescription?: string,\n public readonly httpStatus?: number\n ) {\n super(message);\n this.name = 'ClientCredentialsExchangeError';\n }\n}\n\n/**\n * Options for {@link exchangeClientCredentials}.\n */\nexport interface ExchangeClientCredentialsOptions {\n /**\n * Custom fetch implementation (default: global `fetch`).\n * Primarily a testing hook — lets unit tests stub the authorization server\n * without intercepting the global.\n */\n fetch?: typeof fetch;\n /**\n * Request timeout in milliseconds (default: 30_000). Guards against a\n * silently hung authorization server blocking the caller indefinitely.\n */\n timeoutMs?: number;\n /**\n * Allow `token_endpoint` to resolve to a private / loopback IP address.\n * Default: false (SSRF guard). The CLI opts in because the operator is\n * explicitly configuring the endpoint; hosted consumers accepting\n * user-supplied configs should leave this off.\n */\n allowPrivateIp?: boolean;\n /** Caller-owned cancellation signal, composed with `timeoutMs`. */\n signal?: AbortSignal;\n}\n\n/**\n * RFC 6749 §2.3.1 application/x-www-form-urlencoded encoding.\n *\n * Differs from `encodeURIComponent` in two important ways:\n * 1. Spaces are encoded as `+`, not `%20`.\n * 2. The characters `!'()*` are percent-encoded (URI component leaves them\n * alone).\n *\n * A secret containing any of those chars would hash to a different Basic\n * string than the AS computes, producing a spurious `invalid_client`.\n */\nfunction formUrlEncode(value: string): string {\n return encodeURIComponent(value)\n .replace(/%20/g, '+')\n .replace(/!/g, '%21')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29')\n .replace(/\\*/g, '%2A');\n}\n\n/**\n * Strip control chars (C0, C1, DEL) and truncate.\n *\n * Defensive cleanup on AS-controlled strings we print to a TTY. A\n * malicious or compromised AS could emit ANSI escape sequences or CRLF\n * payloads in `error_description`; we don't want those rewriting terminal\n * titles or forging log lines.\n */\nfunction sanitizeAsMessage(raw: string): string {\n // eslint-disable-next-line no-control-regex\n const stripped = raw.replace(/[\\x00-\\x1F\\x7F-\\x9F]/g, ' ');\n if (stripped.length <= MAX_AS_ERROR_LENGTH) return stripped;\n return stripped.slice(0, MAX_AS_ERROR_LENGTH) + '…';\n}\n\n/**\n * Validate the token endpoint before we hit it. Three checks, in order:\n *\n * 1. Parse as a URL. Unparseable → `malformed`.\n * 2. Reject URLs that carry `user:pass@` userinfo — they'd leak via error\n * messages and log aggregators, and the OAuth client credentials live\n * in `client_id` / `client_secret`, never the URL.\n * 3. Reject plaintext `http://` outside `localhost` / loopback IPs.\n * RFC 6749 §3.1 requires TLS; the loopback carve-out covers local dev\n * authorization servers where plaintext is not a leak risk.\n * 4. Reject private / loopback / link-local IPs unless `allowPrivateIp`.\n * The library default is a SSRF guard; the CLI (operator-driven) opts\n * in because a user pointing at `localhost:8080` is legitimate. Network\n * code behind this call will still do DNS resolution, so this is a\n * best-effort literal-IP / known-loopback check — host allowlisting\n * upstream is the right control for adversarial environments.\n */\nfunction validateTokenEndpoint(tokenEndpoint: string, options: { allowPrivateIp?: boolean } = {}): URL {\n let url: URL;\n try {\n url = new URL(tokenEndpoint);\n } catch {\n throw new ClientCredentialsExchangeError(`Invalid token_endpoint URL: ${tokenEndpoint}`, 'malformed');\n }\n\n if (url.username || url.password) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must not contain userinfo (user:pass@). Put credentials in client_id / client_secret instead.`,\n 'malformed'\n );\n }\n\n const host = url.hostname;\n const isLoopback = host === 'localhost' || host === '127.0.0.1' || host === '[::1]' || host === '::1';\n\n if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLoopback)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must be HTTPS (got ${url.protocol}//${host}). The client secret would be sent in plaintext over HTTP. Use https:// (or http://localhost for local dev).`,\n 'malformed'\n );\n }\n\n if (!options.allowPrivateIp && isLikelyPrivateUrl(tokenEndpoint)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint resolves to a private or loopback address (${host}). Pass { allowPrivateIp: true } to exchangeClientCredentials / ensureClientCredentialsTokens if this is intentional (operator-driven CLI or local test setups).`,\n 'malformed'\n );\n }\n\n return url;\n}\n\n/**\n * Exchange client credentials for an access token.\n *\n * Secret values in `credentials.client_id` / `client_secret` may be `$ENV:VAR`\n * references — they are resolved here at exchange time. Missing env vars\n * surface as `MissingEnvSecretError` (from `secret-resolver`), which\n * callers typically print with the variable name for the user to fix.\n *\n * @throws {ClientCredentialsExchangeError} on any non-2xx response, malformed 200, or network failure\n * @throws {MissingEnvSecretError} if a `$ENV:VAR` ref points at an unset var\n */\nexport async function exchangeClientCredentials(\n credentials: AgentOAuthClientCredentials,\n options: ExchangeClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n throwIfAborted(options.signal);\n\n // Wrap with the response-size-limit guard so a hostile token endpoint\n // can't buffer-bomb on every refresh. Pass-through when no\n // `withResponseSizeLimit` slot is active. (#1175)\n const fetchImpl = wrapFetchWithSizeLimit(options.fetch ?? fetch);\n const timeoutMs = options.timeoutMs ?? 30_000;\n\n validateTokenEndpoint(credentials.token_endpoint, { allowPrivateIp: options.allowPrivateIp });\n\n const clientId = resolveSecret(credentials.client_id);\n const clientSecret = resolveSecret(credentials.client_secret);\n const authMethod = credentials.auth_method ?? 'basic';\n\n const body = new URLSearchParams();\n body.set('grant_type', 'client_credentials');\n if (credentials.scope) {\n body.set('scope', credentials.scope);\n }\n // RFC 8707 resource indicators — emitted as one `resource` field per URI\n // so the AS receives the full list. URLSearchParams#append is the only\n // way to produce repeated keys in form encoding.\n if (credentials.resource) {\n const resources = Array.isArray(credentials.resource) ? credentials.resource : [credentials.resource];\n for (const r of resources) body.append('resource', r);\n }\n if (credentials.audience) {\n body.set('audience', credentials.audience);\n }\n\n const headers: Record<string, string> = {\n 'content-type': 'application/x-www-form-urlencoded',\n accept: 'application/json',\n };\n\n if (authMethod === 'basic') {\n // RFC 6749 §2.3.1: form-urlencode ID/secret before base64 (NOT URI\n // component encoding — space is `+`, and `!'()*` must be percent-\n // encoded). Most deployed servers accept raw values too, but spec\n // compliance avoids a footgun with secrets containing those chars.\n const encoded = Buffer.from(`${formUrlEncode(clientId)}:${formUrlEncode(clientSecret)}`, 'utf-8').toString(\n 'base64'\n );\n headers.authorization = `Basic ${encoded}`;\n } else {\n body.set('client_id', clientId);\n body.set('client_secret', clientSecret);\n }\n\n let response: Response;\n let bodyText: string;\n const timeoutError = new Error(`Client credentials exchange timed out after ${timeoutMs}ms`);\n timeoutError.name = 'TimeoutError';\n try {\n ({ response, bodyText } = await withAbortSignal(\n [options.signal],\n timeoutMs,\n async signal => {\n const tokenResponse = await fetchImpl(credentials.token_endpoint, {\n method: 'POST',\n headers,\n body: body.toString(),\n signal,\n });\n return { response: tokenResponse, bodyText: await tokenResponse.text() };\n },\n { timeoutError }\n ));\n } catch (err) {\n if (options.signal?.aborted) {\n throw createAbortError(options.signal.reason);\n }\n if (err === timeoutError) {\n throw new ClientCredentialsExchangeError(\n `Token endpoint ${credentials.token_endpoint} did not respond within ${timeoutMs}ms.`,\n 'network'\n );\n }\n throw new ClientCredentialsExchangeError(\n `Failed to reach token endpoint ${credentials.token_endpoint}: ${(err as Error).message}`,\n 'network'\n );\n }\n\n let parsed: Record<string, unknown> | undefined;\n try {\n parsed = bodyText ? (JSON.parse(bodyText) as Record<string, unknown>) : undefined;\n } catch {\n // Non-JSON response; parsed stays undefined, handled below.\n }\n\n if (!response.ok) {\n const rawOauthError = typeof parsed?.error === 'string' ? parsed.error : undefined;\n const rawOauthDesc = typeof parsed?.error_description === 'string' ? parsed.error_description : undefined;\n const oauthError = rawOauthError ? sanitizeAsMessage(rawOauthError) : undefined;\n const oauthDesc = rawOauthDesc ? sanitizeAsMessage(rawOauthDesc) : undefined;\n const message =\n oauthError || oauthDesc\n ? `Client credentials exchange failed: ${oauthError ?? 'error'}${oauthDesc ? ` — ${oauthDesc}` : ''}`\n : `Client credentials exchange failed with HTTP ${response.status}: ${sanitizeAsMessage(bodyText) || '(empty body)'}`;\n const kind = rawOauthError ? 'oauth' : 'malformed';\n throw new ClientCredentialsExchangeError(message, kind, oauthError, oauthDesc, response.status);\n }\n\n if (!parsed || typeof parsed.access_token !== 'string') {\n throw new ClientCredentialsExchangeError(\n `Token endpoint returned HTTP ${response.status} but no access_token. Body: ${sanitizeAsMessage(bodyText)}`,\n 'malformed',\n undefined,\n undefined,\n response.status\n );\n }\n\n return fromMCPTokens(parsed as unknown as OAuthTokens);\n}\n\n/**\n * Options for {@link ensureClientCredentialsTokens}.\n */\nexport interface EnsureClientCredentialsOptions extends ExchangeClientCredentialsOptions {\n /**\n * Storage backend used to persist refreshed tokens. Optional — if omitted,\n * tokens are only mutated on the in-memory `agent` object and the caller\n * is responsible for persisting.\n */\n storage?: OAuthConfigStorage;\n /**\n * Force a re-exchange even if the cached token looks valid. Useful after a\n * 401 in case the authorization server rotated something out-of-band.\n */\n force?: boolean;\n /**\n * Expiration skew (ms). Treat the token as expired this many milliseconds\n * before its nominal `expires_at` — protects against clock skew and\n * in-flight requests. Default: 60_000 (1 minute). The interactive auth\n * code flow uses 5 minutes; client credentials refresh is cheap (single\n * POST) so the shorter window is fine here.\n */\n expirationSkewMs?: number;\n}\n\n/**\n * In-flight refresh coalescing map. Scoped by `AgentConfig` object identity\n * so only callers deliberately sharing one configuration can share a bearer.\n * A string key built from public OAuth fields is insufficient here: two\n * tenants can reuse an agent id, endpoint, and client id while differing in\n * secret, scope, audience, or resource.\n *\n * Cleared on completion regardless of success/failure.\n *\n * Note: this is an in-process map. Multi-process deployments (worker\n * pools, multiple CLI invocations, horizontally scaled Node servers)\n * don't coalesce across workers — each process will do its own refresh.\n * For the CLI this is fine; for high-throughput server deployments,\n * coalesce upstream at the storage layer.\n */\ninterface InFlightRefresh {\n promise: Promise<AgentOAuthTokens>;\n controller: AbortController;\n waiters: number;\n settled: boolean;\n}\n\ntype RefreshMode = 'normal' | 'force';\n\nconst inFlightRefresh = new WeakMap<AgentConfig, Map<RefreshMode, InFlightRefresh>>();\n\nasync function waitForRefresh(entry: InFlightRefresh, signal?: AbortSignal): Promise<AgentOAuthTokens> {\n if (signal?.aborted) throw createAbortError(signal.reason);\n entry.waiters += 1;\n let abortListener: (() => void) | undefined;\n try {\n if (!signal) return await entry.promise;\n const aborted = new Promise<never>((_resolve, reject) => {\n abortListener = () => reject(createAbortError(signal.reason));\n signal.addEventListener('abort', abortListener, { once: true });\n });\n return await Promise.race([entry.promise, aborted]);\n } finally {\n if (abortListener && signal) signal.removeEventListener('abort', abortListener);\n entry.waiters -= 1;\n if (entry.waiters === 0 && !entry.settled && !entry.controller.signal.aborted) {\n entry.controller.abort(createAbortError(signal?.reason ?? 'No callers remain for token refresh'));\n }\n }\n}\n\n/**\n * Ensure an agent has a valid access token, refreshing via client credentials\n * if the cached one is missing or expired. Idempotent and safe to call\n * before every request.\n *\n * Concurrent calls for the same `agent.id` are coalesced into a single\n * token POST via an in-process promise map — the common case of a\n * storyboard fan-out firing 10 tool calls in parallel does one refresh,\n * not ten.\n *\n * **Mutation:** this function writes `agent.oauth_tokens` in place. That is\n * the contract the MCP SDK's `OAuthClientProvider` pattern also uses, and\n * it lets the CLI's file-backed storage see the same object. Callers that\n * share an `AgentConfig` across different logical agents must copy first.\n *\n * Precondition: `agent.oauth_client_credentials` must be set. Throws a plain\n * Error if not — callers are expected to branch on its presence before\n * calling this.\n */\nexport async function ensureClientCredentialsTokens(\n agent: AgentConfig,\n options: EnsureClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n throwIfAborted(options.signal);\n\n if (!agent.oauth_client_credentials) {\n throw new Error(\n `ensureClientCredentialsTokens called for agent '${agent.id}' with no oauth_client_credentials configured.`\n );\n }\n\n const skew = options.expirationSkewMs ?? 60_000;\n const cached = agent.oauth_tokens;\n const cachedIsValid =\n !options.force &&\n cached?.access_token &&\n (!cached.expires_at || new Date(cached.expires_at).getTime() - Date.now() > skew);\n\n if (cachedIsValid) {\n return cached!;\n }\n\n const refreshMode: RefreshMode = options.force ? 'force' : 'normal';\n let agentRefreshes = inFlightRefresh.get(agent);\n const existing = agentRefreshes?.get(refreshMode);\n if (existing && !existing.controller.signal.aborted) {\n const tokens = await waitForRefresh(existing, options.signal);\n agent.oauth_tokens = tokens;\n return tokens;\n }\n\n const controller = new AbortController();\n const entry: InFlightRefresh = {\n promise: undefined as unknown as Promise<AgentOAuthTokens>,\n controller,\n waiters: 0,\n settled: false,\n };\n if (!agentRefreshes) {\n agentRefreshes = new Map();\n inFlightRefresh.set(agent, agentRefreshes);\n }\n entry.promise = (async () => {\n try {\n const tokens = await exchangeClientCredentials(agent.oauth_client_credentials!, {\n fetch: options.fetch,\n timeoutMs: options.timeoutMs,\n allowPrivateIp: options.allowPrivateIp,\n signal: controller.signal,\n });\n agent.oauth_tokens = tokens;\n if (options.storage) {\n await options.storage.saveAgent(agent);\n }\n return tokens;\n } finally {\n entry.settled = true;\n if (agentRefreshes?.get(refreshMode) === entry) {\n agentRefreshes.delete(refreshMode);\n if (agentRefreshes.size === 0) inFlightRefresh.delete(agent);\n }\n }\n })();\n\n agentRefreshes.set(refreshMode, entry);\n return waitForRefresh(entry, options.signal);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BA,mBAAyF;AAGzF,6BAA8B;AAC9B,iBAAmC;AACnC,+BAAuC;AACvC,mBAAkE;AAGlE,MAAM,sBAAsB;AAgBrB,MA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resolveSecret } from "./secret-resolver.mjs";
|
|
3
3
|
import { isLikelyPrivateUrl } from "../../net/index.mjs";
|
|
4
4
|
import { wrapFetchWithSizeLimit } from "../../protocols/responseSizeLimit.mjs";
|
|
5
|
+
import { createAbortError, throwIfAborted, withAbortSignal } from "../../protocols/abort.mjs";
|
|
5
6
|
const MAX_AS_ERROR_LENGTH = 200;
|
|
6
7
|
class ClientCredentialsExchangeError extends Error {
|
|
7
8
|
constructor(message, kind, oauthError, oauthErrorDescription, httpStatus) {
|
|
@@ -56,6 +57,7 @@ function validateTokenEndpoint(tokenEndpoint, options = {}) {
|
|
|
56
57
|
return url;
|
|
57
58
|
}
|
|
58
59
|
async function exchangeClientCredentials(credentials, options = {}) {
|
|
60
|
+
throwIfAborted(options.signal);
|
|
59
61
|
const fetchImpl = wrapFetchWithSizeLimit(options.fetch ?? fetch);
|
|
60
62
|
const timeoutMs = options.timeoutMs ?? 3e4;
|
|
61
63
|
validateTokenEndpoint(credentials.token_endpoint, { allowPrivateIp: options.allowPrivateIp });
|
|
@@ -87,18 +89,30 @@ async function exchangeClientCredentials(credentials, options = {}) {
|
|
|
87
89
|
body.set("client_id", clientId);
|
|
88
90
|
body.set("client_secret", clientSecret);
|
|
89
91
|
}
|
|
90
|
-
const controller = new AbortController();
|
|
91
|
-
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
92
92
|
let response;
|
|
93
|
+
let bodyText;
|
|
94
|
+
const timeoutError = new Error(`Client credentials exchange timed out after ${timeoutMs}ms`);
|
|
95
|
+
timeoutError.name = "TimeoutError";
|
|
93
96
|
try {
|
|
94
|
-
response = await
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
({ response, bodyText } = await withAbortSignal(
|
|
98
|
+
[options.signal],
|
|
99
|
+
timeoutMs,
|
|
100
|
+
async (signal) => {
|
|
101
|
+
const tokenResponse = await fetchImpl(credentials.token_endpoint, {
|
|
102
|
+
method: "POST",
|
|
103
|
+
headers,
|
|
104
|
+
body: body.toString(),
|
|
105
|
+
signal
|
|
106
|
+
});
|
|
107
|
+
return { response: tokenResponse, bodyText: await tokenResponse.text() };
|
|
108
|
+
},
|
|
109
|
+
{ timeoutError }
|
|
110
|
+
));
|
|
100
111
|
} catch (err) {
|
|
101
|
-
if (
|
|
112
|
+
if (options.signal?.aborted) {
|
|
113
|
+
throw createAbortError(options.signal.reason);
|
|
114
|
+
}
|
|
115
|
+
if (err === timeoutError) {
|
|
102
116
|
throw new ClientCredentialsExchangeError(
|
|
103
117
|
`Token endpoint ${credentials.token_endpoint} did not respond within ${timeoutMs}ms.`,
|
|
104
118
|
"network"
|
|
@@ -108,10 +122,7 @@ async function exchangeClientCredentials(credentials, options = {}) {
|
|
|
108
122
|
`Failed to reach token endpoint ${credentials.token_endpoint}: ${err.message}`,
|
|
109
123
|
"network"
|
|
110
124
|
);
|
|
111
|
-
} finally {
|
|
112
|
-
clearTimeout(timeout);
|
|
113
125
|
}
|
|
114
|
-
const bodyText = await response.text();
|
|
115
126
|
let parsed;
|
|
116
127
|
try {
|
|
117
128
|
parsed = bodyText ? JSON.parse(bodyText) : void 0;
|
|
@@ -137,11 +148,28 @@ async function exchangeClientCredentials(credentials, options = {}) {
|
|
|
137
148
|
}
|
|
138
149
|
return fromMCPTokens(parsed);
|
|
139
150
|
}
|
|
140
|
-
const inFlightRefresh = /* @__PURE__ */ new
|
|
141
|
-
function
|
|
142
|
-
|
|
151
|
+
const inFlightRefresh = /* @__PURE__ */ new WeakMap();
|
|
152
|
+
async function waitForRefresh(entry, signal) {
|
|
153
|
+
if (signal?.aborted) throw createAbortError(signal.reason);
|
|
154
|
+
entry.waiters += 1;
|
|
155
|
+
let abortListener;
|
|
156
|
+
try {
|
|
157
|
+
if (!signal) return await entry.promise;
|
|
158
|
+
const aborted = new Promise((_resolve, reject) => {
|
|
159
|
+
abortListener = () => reject(createAbortError(signal.reason));
|
|
160
|
+
signal.addEventListener("abort", abortListener, { once: true });
|
|
161
|
+
});
|
|
162
|
+
return await Promise.race([entry.promise, aborted]);
|
|
163
|
+
} finally {
|
|
164
|
+
if (abortListener && signal) signal.removeEventListener("abort", abortListener);
|
|
165
|
+
entry.waiters -= 1;
|
|
166
|
+
if (entry.waiters === 0 && !entry.settled && !entry.controller.signal.aborted) {
|
|
167
|
+
entry.controller.abort(createAbortError(signal?.reason ?? "No callers remain for token refresh"));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
143
170
|
}
|
|
144
171
|
async function ensureClientCredentialsTokens(agent, options = {}) {
|
|
172
|
+
throwIfAborted(options.signal);
|
|
145
173
|
if (!agent.oauth_client_credentials) {
|
|
146
174
|
throw new Error(
|
|
147
175
|
`ensureClientCredentialsTokens called for agent '${agent.id}' with no oauth_client_credentials configured.`
|
|
@@ -153,19 +181,32 @@ async function ensureClientCredentialsTokens(agent, options = {}) {
|
|
|
153
181
|
if (cachedIsValid) {
|
|
154
182
|
return cached;
|
|
155
183
|
}
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
184
|
+
const refreshMode = options.force ? "force" : "normal";
|
|
185
|
+
let agentRefreshes = inFlightRefresh.get(agent);
|
|
186
|
+
const existing = agentRefreshes?.get(refreshMode);
|
|
187
|
+
if (existing && !existing.controller.signal.aborted) {
|
|
188
|
+
const tokens = await waitForRefresh(existing, options.signal);
|
|
160
189
|
agent.oauth_tokens = tokens;
|
|
161
190
|
return tokens;
|
|
162
191
|
}
|
|
163
|
-
const
|
|
192
|
+
const controller = new AbortController();
|
|
193
|
+
const entry = {
|
|
194
|
+
promise: void 0,
|
|
195
|
+
controller,
|
|
196
|
+
waiters: 0,
|
|
197
|
+
settled: false
|
|
198
|
+
};
|
|
199
|
+
if (!agentRefreshes) {
|
|
200
|
+
agentRefreshes = /* @__PURE__ */ new Map();
|
|
201
|
+
inFlightRefresh.set(agent, agentRefreshes);
|
|
202
|
+
}
|
|
203
|
+
entry.promise = (async () => {
|
|
164
204
|
try {
|
|
165
205
|
const tokens = await exchangeClientCredentials(agent.oauth_client_credentials, {
|
|
166
206
|
fetch: options.fetch,
|
|
167
207
|
timeoutMs: options.timeoutMs,
|
|
168
|
-
allowPrivateIp: options.allowPrivateIp
|
|
208
|
+
allowPrivateIp: options.allowPrivateIp,
|
|
209
|
+
signal: controller.signal
|
|
169
210
|
});
|
|
170
211
|
agent.oauth_tokens = tokens;
|
|
171
212
|
if (options.storage) {
|
|
@@ -173,11 +214,15 @@ async function ensureClientCredentialsTokens(agent, options = {}) {
|
|
|
173
214
|
}
|
|
174
215
|
return tokens;
|
|
175
216
|
} finally {
|
|
176
|
-
|
|
217
|
+
entry.settled = true;
|
|
218
|
+
if (agentRefreshes?.get(refreshMode) === entry) {
|
|
219
|
+
agentRefreshes.delete(refreshMode);
|
|
220
|
+
if (agentRefreshes.size === 0) inFlightRefresh.delete(agent);
|
|
221
|
+
}
|
|
177
222
|
}
|
|
178
223
|
})();
|
|
179
|
-
|
|
180
|
-
return
|
|
224
|
+
agentRefreshes.set(refreshMode, entry);
|
|
225
|
+
return waitForRefresh(entry, options.signal);
|
|
181
226
|
}
|
|
182
227
|
export {
|
|
183
228
|
ClientCredentialsExchangeError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/auth/oauth/ClientCredentialsFlow.ts"],"sourcesContent":["/**\n * OAuth 2.0 client credentials grant — RFC 6749 §4.4.\n *\n * For machine-to-machine use cases (CI compliance runs, automated checks)\n * where there is no user to walk through an authorization-code flow. The\n * client POSTs its ID + secret to the authorization server's token endpoint\n * and gets back an access token directly.\n *\n * This file provides:\n * - {@link exchangeClientCredentials}: one-shot token exchange. Use for the\n * initial fetch during `--save-auth` and for forced refresh.\n * - {@link ensureClientCredentialsTokens}: reads the cached tokens on an\n * `AgentConfig`, checks expiry, re-exchanges if needed, and persists the\n * refreshed tokens via an optional {@link OAuthConfigStorage}.\n *\n * Why a dedicated module instead of the MCP SDK's `OAuthClientProvider`:\n * client credentials doesn't need discovery, dynamic client registration,\n * PKCE, or authorization code exchange — all the plumbing that provider\n * exists to coordinate. A direct token POST and a cached-token check is the\n * entire protocol. The call path keeps using the plain `Authorization:\n * Bearer` header path — the same path it already uses for `auth_token`.\n *\n * **Security note (library consumers):** `token_endpoint` is passed to\n * `fetch` directly. Callers that accept untrusted `AgentConfig` values\n * from network requests (e.g. a hosted compliance service accepting\n * user-supplied configs) MUST validate the URL against an allowlist or\n * SSRF-block private IPs before invoking these helpers. The CLI and\n * operator-driven flows are already trusted.\n */\n\nimport { fromMCPTokens, type OAuthTokens, type AgentConfig, type AgentOAuthTokens } from './types';\nimport type { AgentOAuthClientCredentials } from '../../types/adcp';\nimport type { OAuthConfigStorage } from './types';\nimport { resolveSecret } from './secret-resolver';\nimport { isLikelyPrivateUrl } from '../../net';\nimport { wrapFetchWithSizeLimit } from '../../protocols/responseSizeLimit';\n\n/** Max length we'll echo from an AS-supplied error description into errors. */\nconst MAX_AS_ERROR_LENGTH = 200;\n\n/**\n * Raised when the authorization server rejects a client credentials\n * exchange or the token endpoint is unreachable/malformed.\n *\n * The {@link kind} discriminator lets callers branch without\n * string-matching on the message:\n * - `oauth`: the AS returned a structured OAuth error (RFC 6749 §5.2 —\n * `invalid_client`, `invalid_grant`, `invalid_scope`, …). Read\n * {@link oauthError} / {@link oauthErrorDescription}.\n * - `malformed`: the AS returned HTTP 200 but no `access_token`, or a\n * non-JSON body.\n * - `network`: the exchange never reached the AS (DNS failure, connection\n * refused, timeout, TLS error).\n */\nexport class ClientCredentialsExchangeError extends Error {\n readonly code = 'client_credentials_exchange_failed';\n constructor(\n message: string,\n public readonly kind: 'oauth' | 'malformed' | 'network',\n public readonly oauthError?: string,\n public readonly oauthErrorDescription?: string,\n public readonly httpStatus?: number\n ) {\n super(message);\n this.name = 'ClientCredentialsExchangeError';\n }\n}\n\n/**\n * Options for {@link exchangeClientCredentials}.\n */\nexport interface ExchangeClientCredentialsOptions {\n /**\n * Custom fetch implementation (default: global `fetch`).\n * Primarily a testing hook — lets unit tests stub the authorization server\n * without intercepting the global.\n */\n fetch?: typeof fetch;\n /**\n * Request timeout in milliseconds (default: 30_000). Guards against a\n * silently hung authorization server blocking the caller indefinitely.\n */\n timeoutMs?: number;\n /**\n * Allow `token_endpoint` to resolve to a private / loopback IP address.\n * Default: false (SSRF guard). The CLI opts in because the operator is\n * explicitly configuring the endpoint; hosted consumers accepting\n * user-supplied configs should leave this off.\n */\n allowPrivateIp?: boolean;\n}\n\n/**\n * RFC 6749 §2.3.1 application/x-www-form-urlencoded encoding.\n *\n * Differs from `encodeURIComponent` in two important ways:\n * 1. Spaces are encoded as `+`, not `%20`.\n * 2. The characters `!'()*` are percent-encoded (URI component leaves them\n * alone).\n *\n * A secret containing any of those chars would hash to a different Basic\n * string than the AS computes, producing a spurious `invalid_client`.\n */\nfunction formUrlEncode(value: string): string {\n return encodeURIComponent(value)\n .replace(/%20/g, '+')\n .replace(/!/g, '%21')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29')\n .replace(/\\*/g, '%2A');\n}\n\n/**\n * Strip control chars (C0, C1, DEL) and truncate.\n *\n * Defensive cleanup on AS-controlled strings we print to a TTY. A\n * malicious or compromised AS could emit ANSI escape sequences or CRLF\n * payloads in `error_description`; we don't want those rewriting terminal\n * titles or forging log lines.\n */\nfunction sanitizeAsMessage(raw: string): string {\n // eslint-disable-next-line no-control-regex\n const stripped = raw.replace(/[\\x00-\\x1F\\x7F-\\x9F]/g, ' ');\n if (stripped.length <= MAX_AS_ERROR_LENGTH) return stripped;\n return stripped.slice(0, MAX_AS_ERROR_LENGTH) + '…';\n}\n\n/**\n * Validate the token endpoint before we hit it. Three checks, in order:\n *\n * 1. Parse as a URL. Unparseable → `malformed`.\n * 2. Reject URLs that carry `user:pass@` userinfo — they'd leak via error\n * messages and log aggregators, and the OAuth client credentials live\n * in `client_id` / `client_secret`, never the URL.\n * 3. Reject plaintext `http://` outside `localhost` / loopback IPs.\n * RFC 6749 §3.1 requires TLS; the loopback carve-out covers local dev\n * authorization servers where plaintext is not a leak risk.\n * 4. Reject private / loopback / link-local IPs unless `allowPrivateIp`.\n * The library default is a SSRF guard; the CLI (operator-driven) opts\n * in because a user pointing at `localhost:8080` is legitimate. Network\n * code behind this call will still do DNS resolution, so this is a\n * best-effort literal-IP / known-loopback check — host allowlisting\n * upstream is the right control for adversarial environments.\n */\nfunction validateTokenEndpoint(tokenEndpoint: string, options: { allowPrivateIp?: boolean } = {}): URL {\n let url: URL;\n try {\n url = new URL(tokenEndpoint);\n } catch {\n throw new ClientCredentialsExchangeError(`Invalid token_endpoint URL: ${tokenEndpoint}`, 'malformed');\n }\n\n if (url.username || url.password) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must not contain userinfo (user:pass@). Put credentials in client_id / client_secret instead.`,\n 'malformed'\n );\n }\n\n const host = url.hostname;\n const isLoopback = host === 'localhost' || host === '127.0.0.1' || host === '[::1]' || host === '::1';\n\n if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLoopback)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must be HTTPS (got ${url.protocol}//${host}). The client secret would be sent in plaintext over HTTP. Use https:// (or http://localhost for local dev).`,\n 'malformed'\n );\n }\n\n if (!options.allowPrivateIp && isLikelyPrivateUrl(tokenEndpoint)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint resolves to a private or loopback address (${host}). Pass { allowPrivateIp: true } to exchangeClientCredentials / ensureClientCredentialsTokens if this is intentional (operator-driven CLI or local test setups).`,\n 'malformed'\n );\n }\n\n return url;\n}\n\n/**\n * Exchange client credentials for an access token.\n *\n * Secret values in `credentials.client_id` / `client_secret` may be `$ENV:VAR`\n * references — they are resolved here at exchange time. Missing env vars\n * surface as `MissingEnvSecretError` (from `secret-resolver`), which\n * callers typically print with the variable name for the user to fix.\n *\n * @throws {ClientCredentialsExchangeError} on any non-2xx response, malformed 200, or network failure\n * @throws {MissingEnvSecretError} if a `$ENV:VAR` ref points at an unset var\n */\nexport async function exchangeClientCredentials(\n credentials: AgentOAuthClientCredentials,\n options: ExchangeClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n // Wrap with the response-size-limit guard so a hostile token endpoint\n // can't buffer-bomb on every refresh. Pass-through when no\n // `withResponseSizeLimit` slot is active. (#1175)\n const fetchImpl = wrapFetchWithSizeLimit(options.fetch ?? fetch);\n const timeoutMs = options.timeoutMs ?? 30_000;\n\n validateTokenEndpoint(credentials.token_endpoint, { allowPrivateIp: options.allowPrivateIp });\n\n const clientId = resolveSecret(credentials.client_id);\n const clientSecret = resolveSecret(credentials.client_secret);\n const authMethod = credentials.auth_method ?? 'basic';\n\n const body = new URLSearchParams();\n body.set('grant_type', 'client_credentials');\n if (credentials.scope) {\n body.set('scope', credentials.scope);\n }\n // RFC 8707 resource indicators — emitted as one `resource` field per URI\n // so the AS receives the full list. URLSearchParams#append is the only\n // way to produce repeated keys in form encoding.\n if (credentials.resource) {\n const resources = Array.isArray(credentials.resource) ? credentials.resource : [credentials.resource];\n for (const r of resources) body.append('resource', r);\n }\n if (credentials.audience) {\n body.set('audience', credentials.audience);\n }\n\n const headers: Record<string, string> = {\n 'content-type': 'application/x-www-form-urlencoded',\n accept: 'application/json',\n };\n\n if (authMethod === 'basic') {\n // RFC 6749 §2.3.1: form-urlencode ID/secret before base64 (NOT URI\n // component encoding — space is `+`, and `!'()*` must be percent-\n // encoded). Most deployed servers accept raw values too, but spec\n // compliance avoids a footgun with secrets containing those chars.\n const encoded = Buffer.from(`${formUrlEncode(clientId)}:${formUrlEncode(clientSecret)}`, 'utf-8').toString(\n 'base64'\n );\n headers.authorization = `Basic ${encoded}`;\n } else {\n body.set('client_id', clientId);\n body.set('client_secret', clientSecret);\n }\n\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), timeoutMs);\n\n let response: Response;\n try {\n response = await fetchImpl(credentials.token_endpoint, {\n method: 'POST',\n headers,\n body: body.toString(),\n signal: controller.signal,\n });\n } catch (err) {\n if ((err as { name?: string }).name === 'AbortError') {\n throw new ClientCredentialsExchangeError(\n `Token endpoint ${credentials.token_endpoint} did not respond within ${timeoutMs}ms.`,\n 'network'\n );\n }\n throw new ClientCredentialsExchangeError(\n `Failed to reach token endpoint ${credentials.token_endpoint}: ${(err as Error).message}`,\n 'network'\n );\n } finally {\n clearTimeout(timeout);\n }\n\n const bodyText = await response.text();\n let parsed: Record<string, unknown> | undefined;\n try {\n parsed = bodyText ? (JSON.parse(bodyText) as Record<string, unknown>) : undefined;\n } catch {\n // Non-JSON response; parsed stays undefined, handled below.\n }\n\n if (!response.ok) {\n const rawOauthError = typeof parsed?.error === 'string' ? parsed.error : undefined;\n const rawOauthDesc = typeof parsed?.error_description === 'string' ? parsed.error_description : undefined;\n const oauthError = rawOauthError ? sanitizeAsMessage(rawOauthError) : undefined;\n const oauthDesc = rawOauthDesc ? sanitizeAsMessage(rawOauthDesc) : undefined;\n const message =\n oauthError || oauthDesc\n ? `Client credentials exchange failed: ${oauthError ?? 'error'}${oauthDesc ? ` — ${oauthDesc}` : ''}`\n : `Client credentials exchange failed with HTTP ${response.status}: ${sanitizeAsMessage(bodyText) || '(empty body)'}`;\n const kind = rawOauthError ? 'oauth' : 'malformed';\n throw new ClientCredentialsExchangeError(message, kind, oauthError, oauthDesc, response.status);\n }\n\n if (!parsed || typeof parsed.access_token !== 'string') {\n throw new ClientCredentialsExchangeError(\n `Token endpoint returned HTTP ${response.status} but no access_token. Body: ${sanitizeAsMessage(bodyText)}`,\n 'malformed',\n undefined,\n undefined,\n response.status\n );\n }\n\n return fromMCPTokens(parsed as unknown as OAuthTokens);\n}\n\n/**\n * Options for {@link ensureClientCredentialsTokens}.\n */\nexport interface EnsureClientCredentialsOptions extends ExchangeClientCredentialsOptions {\n /**\n * Storage backend used to persist refreshed tokens. Optional — if omitted,\n * tokens are only mutated on the in-memory `agent` object and the caller\n * is responsible for persisting.\n */\n storage?: OAuthConfigStorage;\n /**\n * Force a re-exchange even if the cached token looks valid. Useful after a\n * 401 in case the authorization server rotated something out-of-band.\n */\n force?: boolean;\n /**\n * Expiration skew (ms). Treat the token as expired this many milliseconds\n * before its nominal `expires_at` — protects against clock skew and\n * in-flight requests. Default: 60_000 (1 minute). The interactive auth\n * code flow uses 5 minutes; client credentials refresh is cheap (single\n * POST) so the shorter window is fine here.\n */\n expirationSkewMs?: number;\n}\n\n/**\n * In-flight refresh coalescing map. Keyed by the tuple\n * `(agent.id, token_endpoint, client_id)` — concurrent\n * `ensureClientCredentialsTokens` calls for the same credentials share a\n * single token POST instead of each racing to exchange the same secret.\n *\n * Two different `AgentConfig` objects that accidentally reuse the same\n * `id` (e.g. two tenants both creating `cli-agent`) but hold different\n * credentials won't cross-contaminate — the endpoint + client_id in the\n * key keeps them distinct.\n *\n * Cleared on completion regardless of success/failure.\n *\n * Note: this is an in-process map. Multi-process deployments (worker\n * pools, multiple CLI invocations, horizontally scaled Node servers)\n * don't coalesce across workers — each process will do its own refresh.\n * For the CLI this is fine; for high-throughput server deployments,\n * coalesce upstream at the storage layer.\n */\nconst inFlightRefresh = new Map<string, Promise<AgentOAuthTokens>>();\n\n/**\n * Compute the coalesce key for `ensureClientCredentialsTokens`. `force: true`\n * uses a distinct bucket so a 401-triggered forced refresh never piggybacks\n * on a still-pending non-forced exchange — the whole point of forcing is\n * that the in-flight token is *known* stale, so awaiting it would defeat\n * the retry.\n */\nfunction coalesceKeyFor(agent: AgentConfig, credentials: AgentOAuthClientCredentials, force: boolean): string {\n return `${force ? 'force' : 'normal'}\\u0000${agent.id}\\u0000${credentials.token_endpoint}\\u0000${credentials.client_id}`;\n}\n\n/**\n * Ensure an agent has a valid access token, refreshing via client credentials\n * if the cached one is missing or expired. Idempotent and safe to call\n * before every request.\n *\n * Concurrent calls for the same `agent.id` are coalesced into a single\n * token POST via an in-process promise map — the common case of a\n * storyboard fan-out firing 10 tool calls in parallel does one refresh,\n * not ten.\n *\n * **Mutation:** this function writes `agent.oauth_tokens` in place. That is\n * the contract the MCP SDK's `OAuthClientProvider` pattern also uses, and\n * it lets the CLI's file-backed storage see the same object. Callers that\n * share an `AgentConfig` across different logical agents must copy first.\n *\n * Precondition: `agent.oauth_client_credentials` must be set. Throws a plain\n * Error if not — callers are expected to branch on its presence before\n * calling this.\n */\nexport async function ensureClientCredentialsTokens(\n agent: AgentConfig,\n options: EnsureClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n if (!agent.oauth_client_credentials) {\n throw new Error(\n `ensureClientCredentialsTokens called for agent '${agent.id}' with no oauth_client_credentials configured.`\n );\n }\n\n const skew = options.expirationSkewMs ?? 60_000;\n const cached = agent.oauth_tokens;\n const cachedIsValid =\n !options.force &&\n cached?.access_token &&\n (!cached.expires_at || new Date(cached.expires_at).getTime() - Date.now() > skew);\n\n if (cachedIsValid) {\n return cached!;\n }\n\n const coalesceKey = coalesceKeyFor(agent, agent.oauth_client_credentials, options.force === true);\n const existing = inFlightRefresh.get(coalesceKey);\n if (existing) {\n const tokens = await existing;\n agent.oauth_tokens = tokens;\n return tokens;\n }\n\n const exchange = (async () => {\n try {\n const tokens = await exchangeClientCredentials(agent.oauth_client_credentials!, {\n fetch: options.fetch,\n timeoutMs: options.timeoutMs,\n allowPrivateIp: options.allowPrivateIp,\n });\n agent.oauth_tokens = tokens;\n if (options.storage) {\n await options.storage.saveAgent(agent);\n }\n return tokens;\n } finally {\n inFlightRefresh.delete(coalesceKey);\n }\n })();\n\n inFlightRefresh.set(coalesceKey, exchange);\n return exchange;\n}\n"],"mappings":"AA8BA,SAAS,qBAAgF;AAGzF,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAGvC,MAAM,sBAAsB;AAgBrB,MAAM,uCAAuC,MAAM;AAAA,EAExD,YACE,SACgB,MACA,YACA,uBACA,YAChB;AACA,UAAM,OAAO;AALG;AACA;AACA;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AAAA,EAPkB;AAAA,EACA;AAAA,EACA;AAAA,EACA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UAA0C,CAAC,GAChB;AAC3B,MAAI,CAAC,MAAM,0BAA0B;AACnC,UAAM,IAAI;AAAA,MACR,mDAAmD,MAAM,EAAE;AAAA,IAC7D;AAAA,EACF;AAEA,QAAM,OAAO,QAAQ,oBAAoB;AACzC,QAAM,SAAS,MAAM;AACrB,QAAM,gBACJ,CAAC,QAAQ,SACT,QAAQ,iBACP,CAAC,OAAO,cAAc,IAAI,KAAK,OAAO,UAAU,EAAE,QAAQ,IAAI,KAAK,IAAI,IAAI;AAE9E,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,eAAe,OAAO,MAAM,0BAA0B,QAAQ,UAAU,IAAI;AAChG,QAAM,WAAW,gBAAgB,IAAI,WAAW;AAChD,MAAI,UAAU;AACZ,UAAM,SAAS,MAAM;AACrB,UAAM,eAAe;AACrB,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,YAAY;AAC5B,QAAI;AACF,YAAM,SAAS,MAAM,0BAA0B,MAAM,0BAA2B;AAAA,QAC9E,OAAO,QAAQ;AAAA,QACf,WAAW,QAAQ;AAAA,QACnB,gBAAgB,QAAQ;AAAA,MAC1B,CAAC;AACD,YAAM,eAAe;AACrB,UAAI,QAAQ,SAAS;AACnB,cAAM,QAAQ,QAAQ,UAAU,KAAK;AAAA,MACvC;AACA,aAAO;AAAA,IACT,UAAE;AACA,sBAAgB,OAAO,WAAW;AAAA,IACpC;AAAA,EACF,GAAG;AAEH,kBAAgB,IAAI,aAAa,QAAQ;AACzC,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/auth/oauth/ClientCredentialsFlow.ts"],"sourcesContent":["/**\n * OAuth 2.0 client credentials grant — RFC 6749 §4.4.\n *\n * For machine-to-machine use cases (CI compliance runs, automated checks)\n * where there is no user to walk through an authorization-code flow. The\n * client POSTs its ID + secret to the authorization server's token endpoint\n * and gets back an access token directly.\n *\n * This file provides:\n * - {@link exchangeClientCredentials}: one-shot token exchange. Use for the\n * initial fetch during `--save-auth` and for forced refresh.\n * - {@link ensureClientCredentialsTokens}: reads the cached tokens on an\n * `AgentConfig`, checks expiry, re-exchanges if needed, and persists the\n * refreshed tokens via an optional {@link OAuthConfigStorage}.\n *\n * Why a dedicated module instead of the MCP SDK's `OAuthClientProvider`:\n * client credentials doesn't need discovery, dynamic client registration,\n * PKCE, or authorization code exchange — all the plumbing that provider\n * exists to coordinate. A direct token POST and a cached-token check is the\n * entire protocol. The call path keeps using the plain `Authorization:\n * Bearer` header path — the same path it already uses for `auth_token`.\n *\n * **Security note (library consumers):** `token_endpoint` is passed to\n * `fetch` directly. Callers that accept untrusted `AgentConfig` values\n * from network requests (e.g. a hosted compliance service accepting\n * user-supplied configs) MUST validate the URL against an allowlist or\n * SSRF-block private IPs before invoking these helpers. The CLI and\n * operator-driven flows are already trusted.\n */\n\nimport { fromMCPTokens, type OAuthTokens, type AgentConfig, type AgentOAuthTokens } from './types';\nimport type { AgentOAuthClientCredentials } from '../../types/adcp';\nimport type { OAuthConfigStorage } from './types';\nimport { resolveSecret } from './secret-resolver';\nimport { isLikelyPrivateUrl } from '../../net';\nimport { wrapFetchWithSizeLimit } from '../../protocols/responseSizeLimit';\nimport { createAbortError, throwIfAborted, withAbortSignal } from '../../protocols/abort';\n\n/** Max length we'll echo from an AS-supplied error description into errors. */\nconst MAX_AS_ERROR_LENGTH = 200;\n\n/**\n * Raised when the authorization server rejects a client credentials\n * exchange or the token endpoint is unreachable/malformed.\n *\n * The {@link kind} discriminator lets callers branch without\n * string-matching on the message:\n * - `oauth`: the AS returned a structured OAuth error (RFC 6749 §5.2 —\n * `invalid_client`, `invalid_grant`, `invalid_scope`, …). Read\n * {@link oauthError} / {@link oauthErrorDescription}.\n * - `malformed`: the AS returned HTTP 200 but no `access_token`, or a\n * non-JSON body.\n * - `network`: the exchange never reached the AS (DNS failure, connection\n * refused, timeout, TLS error).\n */\nexport class ClientCredentialsExchangeError extends Error {\n readonly code = 'client_credentials_exchange_failed';\n constructor(\n message: string,\n public readonly kind: 'oauth' | 'malformed' | 'network',\n public readonly oauthError?: string,\n public readonly oauthErrorDescription?: string,\n public readonly httpStatus?: number\n ) {\n super(message);\n this.name = 'ClientCredentialsExchangeError';\n }\n}\n\n/**\n * Options for {@link exchangeClientCredentials}.\n */\nexport interface ExchangeClientCredentialsOptions {\n /**\n * Custom fetch implementation (default: global `fetch`).\n * Primarily a testing hook — lets unit tests stub the authorization server\n * without intercepting the global.\n */\n fetch?: typeof fetch;\n /**\n * Request timeout in milliseconds (default: 30_000). Guards against a\n * silently hung authorization server blocking the caller indefinitely.\n */\n timeoutMs?: number;\n /**\n * Allow `token_endpoint` to resolve to a private / loopback IP address.\n * Default: false (SSRF guard). The CLI opts in because the operator is\n * explicitly configuring the endpoint; hosted consumers accepting\n * user-supplied configs should leave this off.\n */\n allowPrivateIp?: boolean;\n /** Caller-owned cancellation signal, composed with `timeoutMs`. */\n signal?: AbortSignal;\n}\n\n/**\n * RFC 6749 §2.3.1 application/x-www-form-urlencoded encoding.\n *\n * Differs from `encodeURIComponent` in two important ways:\n * 1. Spaces are encoded as `+`, not `%20`.\n * 2. The characters `!'()*` are percent-encoded (URI component leaves them\n * alone).\n *\n * A secret containing any of those chars would hash to a different Basic\n * string than the AS computes, producing a spurious `invalid_client`.\n */\nfunction formUrlEncode(value: string): string {\n return encodeURIComponent(value)\n .replace(/%20/g, '+')\n .replace(/!/g, '%21')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29')\n .replace(/\\*/g, '%2A');\n}\n\n/**\n * Strip control chars (C0, C1, DEL) and truncate.\n *\n * Defensive cleanup on AS-controlled strings we print to a TTY. A\n * malicious or compromised AS could emit ANSI escape sequences or CRLF\n * payloads in `error_description`; we don't want those rewriting terminal\n * titles or forging log lines.\n */\nfunction sanitizeAsMessage(raw: string): string {\n // eslint-disable-next-line no-control-regex\n const stripped = raw.replace(/[\\x00-\\x1F\\x7F-\\x9F]/g, ' ');\n if (stripped.length <= MAX_AS_ERROR_LENGTH) return stripped;\n return stripped.slice(0, MAX_AS_ERROR_LENGTH) + '…';\n}\n\n/**\n * Validate the token endpoint before we hit it. Three checks, in order:\n *\n * 1. Parse as a URL. Unparseable → `malformed`.\n * 2. Reject URLs that carry `user:pass@` userinfo — they'd leak via error\n * messages and log aggregators, and the OAuth client credentials live\n * in `client_id` / `client_secret`, never the URL.\n * 3. Reject plaintext `http://` outside `localhost` / loopback IPs.\n * RFC 6749 §3.1 requires TLS; the loopback carve-out covers local dev\n * authorization servers where plaintext is not a leak risk.\n * 4. Reject private / loopback / link-local IPs unless `allowPrivateIp`.\n * The library default is a SSRF guard; the CLI (operator-driven) opts\n * in because a user pointing at `localhost:8080` is legitimate. Network\n * code behind this call will still do DNS resolution, so this is a\n * best-effort literal-IP / known-loopback check — host allowlisting\n * upstream is the right control for adversarial environments.\n */\nfunction validateTokenEndpoint(tokenEndpoint: string, options: { allowPrivateIp?: boolean } = {}): URL {\n let url: URL;\n try {\n url = new URL(tokenEndpoint);\n } catch {\n throw new ClientCredentialsExchangeError(`Invalid token_endpoint URL: ${tokenEndpoint}`, 'malformed');\n }\n\n if (url.username || url.password) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must not contain userinfo (user:pass@). Put credentials in client_id / client_secret instead.`,\n 'malformed'\n );\n }\n\n const host = url.hostname;\n const isLoopback = host === 'localhost' || host === '127.0.0.1' || host === '[::1]' || host === '::1';\n\n if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLoopback)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint must be HTTPS (got ${url.protocol}//${host}). The client secret would be sent in plaintext over HTTP. Use https:// (or http://localhost for local dev).`,\n 'malformed'\n );\n }\n\n if (!options.allowPrivateIp && isLikelyPrivateUrl(tokenEndpoint)) {\n throw new ClientCredentialsExchangeError(\n `token_endpoint resolves to a private or loopback address (${host}). Pass { allowPrivateIp: true } to exchangeClientCredentials / ensureClientCredentialsTokens if this is intentional (operator-driven CLI or local test setups).`,\n 'malformed'\n );\n }\n\n return url;\n}\n\n/**\n * Exchange client credentials for an access token.\n *\n * Secret values in `credentials.client_id` / `client_secret` may be `$ENV:VAR`\n * references — they are resolved here at exchange time. Missing env vars\n * surface as `MissingEnvSecretError` (from `secret-resolver`), which\n * callers typically print with the variable name for the user to fix.\n *\n * @throws {ClientCredentialsExchangeError} on any non-2xx response, malformed 200, or network failure\n * @throws {MissingEnvSecretError} if a `$ENV:VAR` ref points at an unset var\n */\nexport async function exchangeClientCredentials(\n credentials: AgentOAuthClientCredentials,\n options: ExchangeClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n throwIfAborted(options.signal);\n\n // Wrap with the response-size-limit guard so a hostile token endpoint\n // can't buffer-bomb on every refresh. Pass-through when no\n // `withResponseSizeLimit` slot is active. (#1175)\n const fetchImpl = wrapFetchWithSizeLimit(options.fetch ?? fetch);\n const timeoutMs = options.timeoutMs ?? 30_000;\n\n validateTokenEndpoint(credentials.token_endpoint, { allowPrivateIp: options.allowPrivateIp });\n\n const clientId = resolveSecret(credentials.client_id);\n const clientSecret = resolveSecret(credentials.client_secret);\n const authMethod = credentials.auth_method ?? 'basic';\n\n const body = new URLSearchParams();\n body.set('grant_type', 'client_credentials');\n if (credentials.scope) {\n body.set('scope', credentials.scope);\n }\n // RFC 8707 resource indicators — emitted as one `resource` field per URI\n // so the AS receives the full list. URLSearchParams#append is the only\n // way to produce repeated keys in form encoding.\n if (credentials.resource) {\n const resources = Array.isArray(credentials.resource) ? credentials.resource : [credentials.resource];\n for (const r of resources) body.append('resource', r);\n }\n if (credentials.audience) {\n body.set('audience', credentials.audience);\n }\n\n const headers: Record<string, string> = {\n 'content-type': 'application/x-www-form-urlencoded',\n accept: 'application/json',\n };\n\n if (authMethod === 'basic') {\n // RFC 6749 §2.3.1: form-urlencode ID/secret before base64 (NOT URI\n // component encoding — space is `+`, and `!'()*` must be percent-\n // encoded). Most deployed servers accept raw values too, but spec\n // compliance avoids a footgun with secrets containing those chars.\n const encoded = Buffer.from(`${formUrlEncode(clientId)}:${formUrlEncode(clientSecret)}`, 'utf-8').toString(\n 'base64'\n );\n headers.authorization = `Basic ${encoded}`;\n } else {\n body.set('client_id', clientId);\n body.set('client_secret', clientSecret);\n }\n\n let response: Response;\n let bodyText: string;\n const timeoutError = new Error(`Client credentials exchange timed out after ${timeoutMs}ms`);\n timeoutError.name = 'TimeoutError';\n try {\n ({ response, bodyText } = await withAbortSignal(\n [options.signal],\n timeoutMs,\n async signal => {\n const tokenResponse = await fetchImpl(credentials.token_endpoint, {\n method: 'POST',\n headers,\n body: body.toString(),\n signal,\n });\n return { response: tokenResponse, bodyText: await tokenResponse.text() };\n },\n { timeoutError }\n ));\n } catch (err) {\n if (options.signal?.aborted) {\n throw createAbortError(options.signal.reason);\n }\n if (err === timeoutError) {\n throw new ClientCredentialsExchangeError(\n `Token endpoint ${credentials.token_endpoint} did not respond within ${timeoutMs}ms.`,\n 'network'\n );\n }\n throw new ClientCredentialsExchangeError(\n `Failed to reach token endpoint ${credentials.token_endpoint}: ${(err as Error).message}`,\n 'network'\n );\n }\n\n let parsed: Record<string, unknown> | undefined;\n try {\n parsed = bodyText ? (JSON.parse(bodyText) as Record<string, unknown>) : undefined;\n } catch {\n // Non-JSON response; parsed stays undefined, handled below.\n }\n\n if (!response.ok) {\n const rawOauthError = typeof parsed?.error === 'string' ? parsed.error : undefined;\n const rawOauthDesc = typeof parsed?.error_description === 'string' ? parsed.error_description : undefined;\n const oauthError = rawOauthError ? sanitizeAsMessage(rawOauthError) : undefined;\n const oauthDesc = rawOauthDesc ? sanitizeAsMessage(rawOauthDesc) : undefined;\n const message =\n oauthError || oauthDesc\n ? `Client credentials exchange failed: ${oauthError ?? 'error'}${oauthDesc ? ` — ${oauthDesc}` : ''}`\n : `Client credentials exchange failed with HTTP ${response.status}: ${sanitizeAsMessage(bodyText) || '(empty body)'}`;\n const kind = rawOauthError ? 'oauth' : 'malformed';\n throw new ClientCredentialsExchangeError(message, kind, oauthError, oauthDesc, response.status);\n }\n\n if (!parsed || typeof parsed.access_token !== 'string') {\n throw new ClientCredentialsExchangeError(\n `Token endpoint returned HTTP ${response.status} but no access_token. Body: ${sanitizeAsMessage(bodyText)}`,\n 'malformed',\n undefined,\n undefined,\n response.status\n );\n }\n\n return fromMCPTokens(parsed as unknown as OAuthTokens);\n}\n\n/**\n * Options for {@link ensureClientCredentialsTokens}.\n */\nexport interface EnsureClientCredentialsOptions extends ExchangeClientCredentialsOptions {\n /**\n * Storage backend used to persist refreshed tokens. Optional — if omitted,\n * tokens are only mutated on the in-memory `agent` object and the caller\n * is responsible for persisting.\n */\n storage?: OAuthConfigStorage;\n /**\n * Force a re-exchange even if the cached token looks valid. Useful after a\n * 401 in case the authorization server rotated something out-of-band.\n */\n force?: boolean;\n /**\n * Expiration skew (ms). Treat the token as expired this many milliseconds\n * before its nominal `expires_at` — protects against clock skew and\n * in-flight requests. Default: 60_000 (1 minute). The interactive auth\n * code flow uses 5 minutes; client credentials refresh is cheap (single\n * POST) so the shorter window is fine here.\n */\n expirationSkewMs?: number;\n}\n\n/**\n * In-flight refresh coalescing map. Scoped by `AgentConfig` object identity\n * so only callers deliberately sharing one configuration can share a bearer.\n * A string key built from public OAuth fields is insufficient here: two\n * tenants can reuse an agent id, endpoint, and client id while differing in\n * secret, scope, audience, or resource.\n *\n * Cleared on completion regardless of success/failure.\n *\n * Note: this is an in-process map. Multi-process deployments (worker\n * pools, multiple CLI invocations, horizontally scaled Node servers)\n * don't coalesce across workers — each process will do its own refresh.\n * For the CLI this is fine; for high-throughput server deployments,\n * coalesce upstream at the storage layer.\n */\ninterface InFlightRefresh {\n promise: Promise<AgentOAuthTokens>;\n controller: AbortController;\n waiters: number;\n settled: boolean;\n}\n\ntype RefreshMode = 'normal' | 'force';\n\nconst inFlightRefresh = new WeakMap<AgentConfig, Map<RefreshMode, InFlightRefresh>>();\n\nasync function waitForRefresh(entry: InFlightRefresh, signal?: AbortSignal): Promise<AgentOAuthTokens> {\n if (signal?.aborted) throw createAbortError(signal.reason);\n entry.waiters += 1;\n let abortListener: (() => void) | undefined;\n try {\n if (!signal) return await entry.promise;\n const aborted = new Promise<never>((_resolve, reject) => {\n abortListener = () => reject(createAbortError(signal.reason));\n signal.addEventListener('abort', abortListener, { once: true });\n });\n return await Promise.race([entry.promise, aborted]);\n } finally {\n if (abortListener && signal) signal.removeEventListener('abort', abortListener);\n entry.waiters -= 1;\n if (entry.waiters === 0 && !entry.settled && !entry.controller.signal.aborted) {\n entry.controller.abort(createAbortError(signal?.reason ?? 'No callers remain for token refresh'));\n }\n }\n}\n\n/**\n * Ensure an agent has a valid access token, refreshing via client credentials\n * if the cached one is missing or expired. Idempotent and safe to call\n * before every request.\n *\n * Concurrent calls for the same `agent.id` are coalesced into a single\n * token POST via an in-process promise map — the common case of a\n * storyboard fan-out firing 10 tool calls in parallel does one refresh,\n * not ten.\n *\n * **Mutation:** this function writes `agent.oauth_tokens` in place. That is\n * the contract the MCP SDK's `OAuthClientProvider` pattern also uses, and\n * it lets the CLI's file-backed storage see the same object. Callers that\n * share an `AgentConfig` across different logical agents must copy first.\n *\n * Precondition: `agent.oauth_client_credentials` must be set. Throws a plain\n * Error if not — callers are expected to branch on its presence before\n * calling this.\n */\nexport async function ensureClientCredentialsTokens(\n agent: AgentConfig,\n options: EnsureClientCredentialsOptions = {}\n): Promise<AgentOAuthTokens> {\n throwIfAborted(options.signal);\n\n if (!agent.oauth_client_credentials) {\n throw new Error(\n `ensureClientCredentialsTokens called for agent '${agent.id}' with no oauth_client_credentials configured.`\n );\n }\n\n const skew = options.expirationSkewMs ?? 60_000;\n const cached = agent.oauth_tokens;\n const cachedIsValid =\n !options.force &&\n cached?.access_token &&\n (!cached.expires_at || new Date(cached.expires_at).getTime() - Date.now() > skew);\n\n if (cachedIsValid) {\n return cached!;\n }\n\n const refreshMode: RefreshMode = options.force ? 'force' : 'normal';\n let agentRefreshes = inFlightRefresh.get(agent);\n const existing = agentRefreshes?.get(refreshMode);\n if (existing && !existing.controller.signal.aborted) {\n const tokens = await waitForRefresh(existing, options.signal);\n agent.oauth_tokens = tokens;\n return tokens;\n }\n\n const controller = new AbortController();\n const entry: InFlightRefresh = {\n promise: undefined as unknown as Promise<AgentOAuthTokens>,\n controller,\n waiters: 0,\n settled: false,\n };\n if (!agentRefreshes) {\n agentRefreshes = new Map();\n inFlightRefresh.set(agent, agentRefreshes);\n }\n entry.promise = (async () => {\n try {\n const tokens = await exchangeClientCredentials(agent.oauth_client_credentials!, {\n fetch: options.fetch,\n timeoutMs: options.timeoutMs,\n allowPrivateIp: options.allowPrivateIp,\n signal: controller.signal,\n });\n agent.oauth_tokens = tokens;\n if (options.storage) {\n await options.storage.saveAgent(agent);\n }\n return tokens;\n } finally {\n entry.settled = true;\n if (agentRefreshes?.get(refreshMode) === entry) {\n agentRefreshes.delete(refreshMode);\n if (agentRefreshes.size === 0) inFlightRefresh.delete(agent);\n }\n }\n })();\n\n agentRefreshes.set(refreshMode, entry);\n return waitForRefresh(entry, options.signal);\n}\n"],"mappings":"AA8BA,SAAS,qBAAgF;AAGzF,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB,gBAAgB,uBAAuB;AAGlE,MAAM,sBAAsB;AAgBrB,MAAM,uCAAuC,MAAM;AAAA,EAExD,YACE,SACgB,MACA,YACA,uBACA,YAChB;AACA,UAAM,OAAO;AALG;AACA;AACA;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AAAA,EAPkB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EANT,OAAO;AAWlB;AAuCA,SAAS,cAAc,OAAuB;AAC5C,SAAO,mBAAmB,KAAK,EAC5B,QAAQ,QAAQ,GAAG,EACnB,QAAQ,MAAM,KAAK,EACnB,QAAQ,MAAM,KAAK,EACnB,QAAQ,OAAO,KAAK,EACpB,QAAQ,OAAO,KAAK,EACpB,QAAQ,OAAO,KAAK;AACzB;AAUA,SAA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,IACT;AAAA,IACA,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACA,MAAI,CAAC,gBAAgB;AACnB,qBAAiB,oBAAI,IAAI;AACzB,oBAAgB,IAAI,OAAO,cAAc;AAAA,EAC3C;AACA,QAAM,WAAW,YAAY;AAC3B,QAAI;AACF,YAAM,SAAS,MAAM,0BAA0B,MAAM,0BAA2B;AAAA,QAC9E,OAAO,QAAQ;AAAA,QACf,WAAW,QAAQ;AAAA,QACnB,gBAAgB,QAAQ;AAAA,QACxB,QAAQ,WAAW;AAAA,MACrB,CAAC;AACD,YAAM,eAAe;AACrB,UAAI,QAAQ,SAAS;AACnB,cAAM,QAAQ,QAAQ,UAAU,KAAK;AAAA,MACvC;AACA,aAAO;AAAA,IACT,UAAE;AACA,YAAM,UAAU;AAChB,UAAI,gBAAgB,IAAI,WAAW,MAAM,OAAO;AAC9C,uBAAe,OAAO,WAAW;AACjC,YAAI,eAAe,SAAS,EAAG,iBAAgB,OAAO,KAAK;AAAA,MAC7D;AAAA,IACF;AAAA,EACF,GAAG;AAEH,iBAAe,IAAI,aAAa,KAAK;AACrC,SAAO,eAAe,OAAO,QAAQ,MAAM;AAC7C;","names":[]}
|
|
@@ -40,12 +40,14 @@ export declare class MCPOAuthProvider implements OAuthClientProvider {
|
|
|
40
40
|
private readonly flowHandler;
|
|
41
41
|
private readonly _clientMetadata;
|
|
42
42
|
private readonly allowHttp;
|
|
43
|
+
private readonly configuredResourceOverride?;
|
|
43
44
|
constructor(config: OAuthProviderConfig);
|
|
44
45
|
/**
|
|
45
46
|
* Create a provider for CLI usage
|
|
46
47
|
*/
|
|
47
48
|
static forCLI(agent: AgentConfig, flowHandler: OAuthFlowHandler, storage?: OAuthConfigStorage, clientMetadataOverrides?: Partial<OAuthClientMetadata>, options?: {
|
|
48
49
|
allowHttp?: boolean;
|
|
50
|
+
resourceOverride?: string | null;
|
|
49
51
|
}): MCPOAuthProvider;
|
|
50
52
|
get redirectUrl(): string | URL;
|
|
51
53
|
get clientMetadata(): OAuthClientMetadata;
|
|
@@ -40,12 +40,14 @@ export declare class MCPOAuthProvider implements OAuthClientProvider {
|
|
|
40
40
|
private readonly flowHandler;
|
|
41
41
|
private readonly _clientMetadata;
|
|
42
42
|
private readonly allowHttp;
|
|
43
|
+
private readonly configuredResourceOverride?;
|
|
43
44
|
constructor(config: OAuthProviderConfig);
|
|
44
45
|
/**
|
|
45
46
|
* Create a provider for CLI usage
|
|
46
47
|
*/
|
|
47
48
|
static forCLI(agent: AgentConfig, flowHandler: OAuthFlowHandler, storage?: OAuthConfigStorage, clientMetadataOverrides?: Partial<OAuthClientMetadata>, options?: {
|
|
48
49
|
allowHttp?: boolean;
|
|
50
|
+
resourceOverride?: string | null;
|
|
49
51
|
}): MCPOAuthProvider;
|
|
50
52
|
get redirectUrl(): string | URL;
|
|
51
53
|
get clientMetadata(): OAuthClientMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MCPOAuthProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/auth/oauth/MCPOAuthProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACZ,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"MCPOAuthProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/auth/oauth/MCPOAuthProvider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACZ,MAAM,S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AAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpD;;OAEG;IACG,uBAAuB,CAAC,gBAAgB,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE;;OAEG;IACG,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3D;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAUrC;;OAEG;IACG,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB3F;;OAEG;YACW,YAAY;IAM1B;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAIxC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;OAGG;IACH,cAAc,IAAI,OAAO;IAgBzB;;;OAGG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC;;;OAGG;IACH,QAAQ,IAAI,WAAW;IAIvB;;;OAGG;IACH,UAAU,IAAI,MAAM;CAGrB"}
|
|
@@ -23,18 +23,21 @@ __export(MCPOAuthProvider_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(MCPOAuthProvider_exports);
|
|
24
24
|
var import_types = require('./types.js');
|
|
25
25
|
var import_crypto = require("crypto");
|
|
26
|
+
var import_resource_url = require('./resource-url.js');
|
|
26
27
|
class MCPOAuthProvider {
|
|
27
28
|
agent;
|
|
28
29
|
storage;
|
|
29
30
|
flowHandler;
|
|
30
31
|
_clientMetadata;
|
|
31
32
|
allowHttp;
|
|
33
|
+
configuredResourceOverride;
|
|
32
34
|
constructor(config) {
|
|
33
35
|
this.agent = config.agent;
|
|
34
36
|
this.storage = config.storage;
|
|
35
37
|
this.flowHandler = config.flowHandler;
|
|
36
38
|
this._clientMetadata = config.clientMetadata;
|
|
37
39
|
this.allowHttp = config.allowHttp === true;
|
|
40
|
+
this.configuredResourceOverride = config.resourceOverride;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Create a provider for CLI usage
|
|
@@ -50,7 +53,8 @@ class MCPOAuthProvider {
|
|
|
50
53
|
flowHandler,
|
|
51
54
|
storage,
|
|
52
55
|
clientMetadata,
|
|
53
|
-
allowHttp: options?.allowHttp
|
|
56
|
+
allowHttp: options?.allowHttp,
|
|
57
|
+
resourceOverride: options?.resourceOverride
|
|
54
58
|
});
|
|
55
59
|
}
|
|
56
60
|
// ========================================
|
|
@@ -76,14 +80,11 @@ class MCPOAuthProvider {
|
|
|
76
80
|
* mirrors the CLI's `--allow-http` flag.
|
|
77
81
|
*/
|
|
78
82
|
async validateResourceURL(serverUrl, resource) {
|
|
79
|
-
|
|
83
|
+
const selectedResource = this.configuredResourceOverride === null ? resource : this.configuredResourceOverride ?? this.agent.oauth_resource ?? resource;
|
|
84
|
+
if (!selectedResource) {
|
|
80
85
|
return void 0;
|
|
81
86
|
}
|
|
82
|
-
|
|
83
|
-
if (resourceURL.protocol !== "https:" && !this.allowHttp) {
|
|
84
|
-
throw new Error(`Server at ${serverUrl} advertised non-HTTPS resource URL: ${resource}`);
|
|
85
|
-
}
|
|
86
|
-
return resourceURL;
|
|
87
|
+
return (0, import_resource_url.validateOAuthResourceUrl)(selectedResource, { allowHttp: this.allowHttp });
|
|
87
88
|
}
|
|
88
89
|
/**
|
|
89
90
|
* Generate OAuth state parameter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/auth/oauth/MCPOAuthProvider.ts"],"sourcesContent":["/**\n * MCP OAuth Provider\n *\n * Implements the MCP SDK's OAuthClientProvider interface\n * using AgentConfig for token storage.\n */\n\nimport type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';\nimport type {\n OAuthClientMetadata,\n OAuthClientInformation,\n OAuthClientInformationFull,\n OAuthTokens,\n OAuthFlowHandler,\n OAuthProviderConfig,\n OAuthConfigStorage,\n AgentConfig,\n} from './types';\nimport { DEFAULT_CLIENT_METADATA, toMCPTokens, fromMCPTokens, toMCPClientInfo, fromMCPClientInfo } from './types';\nimport { randomBytes } from 'crypto';\n\n/**\n * MCP OAuth Client Provider\n *\n * This provider stores OAuth tokens directly in the AgentConfig,\n * using the same structure as static auth tokens.\n *\n * @example\n * ```typescript\n * const agent: AgentConfig = {\n * id: 'my-agent',\n * name: 'My Agent',\n * agent_uri: 'https://agent.example.com/mcp',\n * protocol: 'mcp',\n * // OAuth tokens stored here after auth flow\n * oauth_tokens: { access_token: '...', refresh_token: '...' }\n * };\n *\n * const provider = new MCPOAuthProvider({\n * agent,\n * flowHandler: new CLIFlowHandler(),\n * storage: myConfigStorage // Optional: persists tokens\n * });\n *\n * const transport = new StreamableHTTPClientTransport(url, {\n * authProvider: provider\n * });\n * ```\n */\nexport class MCPOAuthProvider implements OAuthClientProvider {\n private agent: AgentConfig;\n private readonly storage?: OAuthConfigStorage;\n private readonly flowHandler: OAuthFlowHandler;\n private readonly _clientMetadata: OAuthClientMetadata;\n private readonly allowHttp: boolean;\n\n constructor(config: OAuthProviderConfig) {\n this.agent = config.agent;\n this.storage = config.storage;\n this.flowHandler = config.flowHandler;\n this._clientMetadata = config.clientMetadata;\n this.allowHttp = config.allowHttp === true;\n }\n\n /**\n * Create a provider for CLI usage\n */\n static forCLI(\n agent: AgentConfig,\n flowHandler: OAuthFlowHandler,\n storage?: OAuthConfigStorage,\n clientMetadataOverrides?: Partial<OAuthClientMetadata>,\n options?: { allowHttp?: boolean }\n ): MCPOAuthProvider {\n // Build complete client metadata with required fields\n const clientMetadata: OAuthClientMetadata = {\n ...DEFAULT_CLIENT_METADATA,\n redirect_uris: [flowHandler.getRedirectUrl().toString()],\n ...clientMetadataOverrides,\n };\n\n return new MCPOAuthProvider({\n agent,\n flowHandler,\n storage,\n clientMetadata,\n allowHttp: options?.allowHttp,\n });\n }\n\n // ========================================\n // OAuthClientProvider interface\n // ========================================\n\n get redirectUrl(): string | URL {\n return this.flowHandler.getRedirectUrl();\n }\n\n get clientMetadata(): OAuthClientMetadata {\n return this._clientMetadata;\n }\n\n /**\n * Validate the protected resource URL from server metadata (RFC 9728).\n *\n * Servers behind reverse proxies or DNS aliases may advertise a canonical\n * resource URL (RFC 8707) that differs from the URL the client connected to.\n * We allow cross-origin resource URLs because agent configs are pre-configured\n * by the user, not discovered from untrusted sources. The authorization server\n * remains the final gatekeeper for token audience validation.\n *\n * Non-HTTPS resource URLs are rejected by default. Construct the provider\n * with `allowHttp: true` to lift that restriction for local development —\n * mirrors the CLI's `--allow-http` flag.\n */\n async validateResourceURL(serverUrl: string | URL, resource?: string): Promise<URL | undefined> {\n if (!resource) {\n return undefined;\n }\n\n const resourceURL = new URL(resource);\n\n if (resourceURL.protocol !== 'https:' && !this.allowHttp) {\n throw new Error(`Server at ${serverUrl} advertised non-HTTPS resource URL: ${resource}`);\n }\n\n return resourceURL;\n }\n\n /**\n * Generate OAuth state parameter\n */\n async state(): Promise<string> {\n return randomBytes(32).toString('base64url');\n }\n\n /**\n * Load client information from agent config\n */\n async clientInformation(): Promise<OAuthClientInformation | undefined> {\n if (this.agent.oauth_client) {\n return toMCPClientInfo(this.agent.oauth_client);\n }\n return undefined;\n }\n\n /**\n * Save client information after dynamic registration\n */\n async saveClientInformation(clientInfo: OAuthClientInformationFull): Promise<void> {\n this.agent.oauth_client = fromMCPClientInfo(clientInfo);\n await this.persistAgent();\n }\n\n /**\n * Load existing tokens from agent config\n */\n async tokens(): Promise<OAuthTokens | undefined> {\n if (this.agent.oauth_tokens) {\n return toMCPTokens(this.agent.oauth_tokens);\n }\n return undefined;\n }\n\n /**\n * Save tokens after authorization\n * Also cleans up the temporary code verifier\n */\n async saveTokens(tokens: OAuthTokens): Promise<void> {\n this.agent.oauth_tokens = fromMCPTokens(tokens);\n // Clean up temporary code verifier after successful token exchange\n delete this.agent.oauth_code_verifier;\n await this.persistAgent();\n }\n\n /**\n * Redirect user to authorization URL\n */\n async redirectToAuthorization(authorizationUrl: URL): Promise<void> {\n await this.flowHandler.redirectToAuthorization(authorizationUrl);\n }\n\n /**\n * Save PKCE code verifier\n */\n async saveCodeVerifier(codeVerifier: string): Promise<void> {\n this.agent.oauth_code_verifier = codeVerifier;\n await this.persistAgent();\n }\n\n /**\n * Load PKCE code verifier\n * The MCP SDK calls saveCodeVerifier() before authorization and\n * retrieves it here during token exchange.\n */\n async codeVerifier(): Promise<string> {\n if (!this.agent.oauth_code_verifier) {\n throw new Error(\n 'No PKCE code verifier found. The OAuth flow may have been interrupted or ' +\n 'the agent config was modified. Please try authenticating again.'\n );\n }\n return this.agent.oauth_code_verifier;\n }\n\n /**\n * Invalidate credentials when server indicates they're invalid\n */\n async invalidateCredentials(scope: 'all' | 'client' | 'tokens' | 'verifier'): Promise<void> {\n switch (scope) {\n case 'all':\n delete this.agent.oauth_tokens;\n delete this.agent.oauth_client;\n delete this.agent.oauth_code_verifier;\n break;\n case 'tokens':\n delete this.agent.oauth_tokens;\n break;\n case 'client':\n delete this.agent.oauth_client;\n break;\n case 'verifier':\n delete this.agent.oauth_code_verifier;\n break;\n }\n await this.persistAgent();\n }\n\n // ========================================\n // Additional methods\n // ========================================\n\n /**\n * Persist agent config to storage if configured\n */\n private async persistAgent(): Promise<void> {\n if (this.storage) {\n await this.storage.saveAgent(this.agent);\n }\n }\n\n /**\n * Wait for the OAuth callback\n * Call this after UnauthorizedError is thrown\n */\n async waitForCallback(): Promise<string> {\n return this.flowHandler.waitForCallback();\n }\n\n /**\n * Clean up resources\n */\n async cleanup(): Promise<void> {\n await this.flowHandler.cleanup();\n }\n\n /**\n * Check if we have valid, non-expired OAuth tokens\n * @returns true if access_token exists and hasn't expired (with 5 minute buffer)\n */\n hasValidTokens(): boolean {\n const tokens = this.agent.oauth_tokens;\n if (!tokens?.access_token) return false;\n\n // Check expiration if available\n if (tokens.expires_at) {\n const expiresAt = new Date(tokens.expires_at);\n // Consider expired if within 5 minutes of expiration\n if (expiresAt.getTime() - Date.now() < 5 * 60 * 1000) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Check if we have a refresh token available for token refresh\n * @returns true if refresh_token is present\n */\n hasRefreshToken(): boolean {\n return !!this.agent.oauth_tokens?.refresh_token;\n }\n\n /**\n * Clear all OAuth data for this agent\n */\n async clearAuth(): Promise<void> {\n await this.invalidateCredentials('all');\n }\n\n /**\n * Get the agent config this provider manages\n * @returns The AgentConfig with OAuth tokens populated after successful auth\n */\n getAgent(): AgentConfig {\n return this.agent;\n }\n\n /**\n * Get the agent identifier\n * @returns The agent's unique ID\n */\n getAgentId(): string {\n return this.agent.id;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,mBAAwG;AACxG,oBAA4B;AA8BrB,MAAM,iBAAgD;AAAA,EACnD;AAAA,EACS;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,QAA6B;AACvC,SAAK,QAAQ,OAAO;AACpB,SAAK,UAAU,OAAO;AACtB,SAAK,cAAc,OAAO;AAC1B,SAAK,kBAAkB,OAAO;AAC9B,SAAK,YAAY,OAAO,cAAc;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OACL,OACA,aACA,SACA,yBACA,SACkB;AAElB,UAAM,iBAAsC;AAAA,MAC1C,GAAG;AAAA,MACH,eAAe,CAAC,YAAY,eAAe,EAAE,SAAS,CAAC;AAAA,MACvD,GAAG;AAAA,IACL;AAEA,WAAO,IAAI,iBAAiB;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,SAAS;AAAA,IACtB,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,cAA4B;AAC9B,WAAO,KAAK,YAAY,eAAe;AAAA,EACzC;AAAA,EAEA,IAAI,iBAAsC;AACxC,WAAO,KAAK;AAAA,EACd;A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A2B;AACzB,WAAO,CAAC,CAAC,KAAK,MAAM,cAAc;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,YAA2B;AAC/B,UAAM,KAAK,sBAAsB,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAwB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAqB;AACnB,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/auth/oauth/MCPOAuthProvider.ts"],"sourcesContent":["/**\n * MCP OAuth Provider\n *\n * Implements the MCP SDK's OAuthClientProvider interface\n * using AgentConfig for token storage.\n */\n\nimport type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';\nimport type {\n OAuthClientMetadata,\n OAuthClientInformation,\n OAuthClientInformationFull,\n OAuthTokens,\n OAuthFlowHandler,\n OAuthProviderConfig,\n OAuthConfigStorage,\n AgentConfig,\n} from './types';\nimport { DEFAULT_CLIENT_METADATA, toMCPTokens, fromMCPTokens, toMCPClientInfo, fromMCPClientInfo } from './types';\nimport { randomBytes } from 'crypto';\nimport { validateOAuthResourceUrl } from './resource-url';\n\n/**\n * MCP OAuth Client Provider\n *\n * This provider stores OAuth tokens directly in the AgentConfig,\n * using the same structure as static auth tokens.\n *\n * @example\n * ```typescript\n * const agent: AgentConfig = {\n * id: 'my-agent',\n * name: 'My Agent',\n * agent_uri: 'https://agent.example.com/mcp',\n * protocol: 'mcp',\n * // OAuth tokens stored here after auth flow\n * oauth_tokens: { access_token: '...', refresh_token: '...' }\n * };\n *\n * const provider = new MCPOAuthProvider({\n * agent,\n * flowHandler: new CLIFlowHandler(),\n * storage: myConfigStorage // Optional: persists tokens\n * });\n *\n * const transport = new StreamableHTTPClientTransport(url, {\n * authProvider: provider\n * });\n * ```\n */\nexport class MCPOAuthProvider implements OAuthClientProvider {\n private agent: AgentConfig;\n private readonly storage?: OAuthConfigStorage;\n private readonly flowHandler: OAuthFlowHandler;\n private readonly _clientMetadata: OAuthClientMetadata;\n private readonly allowHttp: boolean;\n private readonly configuredResourceOverride?: string | null;\n\n constructor(config: OAuthProviderConfig) {\n this.agent = config.agent;\n this.storage = config.storage;\n this.flowHandler = config.flowHandler;\n this._clientMetadata = config.clientMetadata;\n this.allowHttp = config.allowHttp === true;\n this.configuredResourceOverride = config.resourceOverride;\n }\n\n /**\n * Create a provider for CLI usage\n */\n static forCLI(\n agent: AgentConfig,\n flowHandler: OAuthFlowHandler,\n storage?: OAuthConfigStorage,\n clientMetadataOverrides?: Partial<OAuthClientMetadata>,\n options?: { allowHttp?: boolean; resourceOverride?: string | null }\n ): MCPOAuthProvider {\n // Build complete client metadata with required fields\n const clientMetadata: OAuthClientMetadata = {\n ...DEFAULT_CLIENT_METADATA,\n redirect_uris: [flowHandler.getRedirectUrl().toString()],\n ...clientMetadataOverrides,\n };\n\n return new MCPOAuthProvider({\n agent,\n flowHandler,\n storage,\n clientMetadata,\n allowHttp: options?.allowHttp,\n resourceOverride: options?.resourceOverride,\n });\n }\n\n // ========================================\n // OAuthClientProvider interface\n // ========================================\n\n get redirectUrl(): string | URL {\n return this.flowHandler.getRedirectUrl();\n }\n\n get clientMetadata(): OAuthClientMetadata {\n return this._clientMetadata;\n }\n\n /**\n * Validate the protected resource URL from server metadata (RFC 9728).\n *\n * Servers behind reverse proxies or DNS aliases may advertise a canonical\n * resource URL (RFC 8707) that differs from the URL the client connected to.\n * We allow cross-origin resource URLs because agent configs are pre-configured\n * by the user, not discovered from untrusted sources. The authorization server\n * remains the final gatekeeper for token audience validation.\n *\n * Non-HTTPS resource URLs are rejected by default. Construct the provider\n * with `allowHttp: true` to lift that restriction for local development —\n * mirrors the CLI's `--allow-http` flag.\n */\n async validateResourceURL(serverUrl: string | URL, resource?: string): Promise<URL | undefined> {\n const selectedResource =\n this.configuredResourceOverride === null\n ? resource\n : (this.configuredResourceOverride ?? this.agent.oauth_resource ?? resource);\n if (!selectedResource) {\n return undefined;\n }\n\n return validateOAuthResourceUrl(selectedResource, { allowHttp: this.allowHttp });\n }\n\n /**\n * Generate OAuth state parameter\n */\n async state(): Promise<string> {\n return randomBytes(32).toString('base64url');\n }\n\n /**\n * Load client information from agent config\n */\n async clientInformation(): Promise<OAuthClientInformation | undefined> {\n if (this.agent.oauth_client) {\n return toMCPClientInfo(this.agent.oauth_client);\n }\n return undefined;\n }\n\n /**\n * Save client information after dynamic registration\n */\n async saveClientInformation(clientInfo: OAuthClientInformationFull): Promise<void> {\n this.agent.oauth_client = fromMCPClientInfo(clientInfo);\n await this.persistAgent();\n }\n\n /**\n * Load existing tokens from agent config\n */\n async tokens(): Promise<OAuthTokens | undefined> {\n if (this.agent.oauth_tokens) {\n return toMCPTokens(this.agent.oauth_tokens);\n }\n return undefined;\n }\n\n /**\n * Save tokens after authorization\n * Also cleans up the temporary code verifier\n */\n async saveTokens(tokens: OAuthTokens): Promise<void> {\n this.agent.oauth_tokens = fromMCPTokens(tokens);\n // Clean up temporary code verifier after successful token exchange\n delete this.agent.oauth_code_verifier;\n await this.persistAgent();\n }\n\n /**\n * Redirect user to authorization URL\n */\n async redirectToAuthorization(authorizationUrl: URL): Promise<void> {\n await this.flowHandler.redirectToAuthorization(authorizationUrl);\n }\n\n /**\n * Save PKCE code verifier\n */\n async saveCodeVerifier(codeVerifier: string): Promise<void> {\n this.agent.oauth_code_verifier = codeVerifier;\n await this.persistAgent();\n }\n\n /**\n * Load PKCE code verifier\n * The MCP SDK calls saveCodeVerifier() before authorization and\n * retrieves it here during token exchange.\n */\n async codeVerifier(): Promise<string> {\n if (!this.agent.oauth_code_verifier) {\n throw new Error(\n 'No PKCE code verifier found. The OAuth flow may have been interrupted or ' +\n 'the agent config was modified. Please try authenticating again.'\n );\n }\n return this.agent.oauth_code_verifier;\n }\n\n /**\n * Invalidate credentials when server indicates they're invalid\n */\n async invalidateCredentials(scope: 'all' | 'client' | 'tokens' | 'verifier'): Promise<void> {\n switch (scope) {\n case 'all':\n delete this.agent.oauth_tokens;\n delete this.agent.oauth_client;\n delete this.agent.oauth_code_verifier;\n break;\n case 'tokens':\n delete this.agent.oauth_tokens;\n break;\n case 'client':\n delete this.agent.oauth_client;\n break;\n case 'verifier':\n delete this.agent.oauth_code_verifier;\n break;\n }\n await this.persistAgent();\n }\n\n // ========================================\n // Additional methods\n // ========================================\n\n /**\n * Persist agent config to storage if configured\n */\n private async persistAgent(): Promise<void> {\n if (this.storage) {\n await this.storage.saveAgent(this.agent);\n }\n }\n\n /**\n * Wait for the OAuth callback\n * Call this after UnauthorizedError is thrown\n */\n async waitForCallback(): Promise<string> {\n return this.flowHandler.waitForCallback();\n }\n\n /**\n * Clean up resources\n */\n async cleanup(): Promise<void> {\n await this.flowHandler.cleanup();\n }\n\n /**\n * Check if we have valid, non-expired OAuth tokens\n * @returns true if access_token exists and hasn't expired (with 5 minute buffer)\n */\n hasValidTokens(): boolean {\n const tokens = this.agent.oauth_tokens;\n if (!tokens?.access_token) return false;\n\n // Check expiration if available\n if (tokens.expires_at) {\n const expiresAt = new Date(tokens.expires_at);\n // Consider expired if within 5 minutes of expiration\n if (expiresAt.getTime() - Date.now() < 5 * 60 * 1000) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Check if we have a refresh token available for token refresh\n * @returns true if refresh_token is present\n */\n hasRefreshToken(): boolean {\n return !!this.agent.oauth_tokens?.refresh_token;\n }\n\n /**\n * Clear all OAuth data for this agent\n */\n async clearAuth(): Promise<void> {\n await this.invalidateCredentials('all');\n }\n\n /**\n * Get the agent config this provider manages\n * @returns The AgentConfig with OAuth tokens populated after successful auth\n */\n getAgent(): AgentConfig {\n return this.agent;\n }\n\n /**\n * Get the agent identifier\n * @returns The agent's unique ID\n */\n getAgentId(): string {\n return this.agent.id;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,mBAAwG;AACxG,oBAA4B;AAC5B,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,eAAO,KAAK,MAAM;AAClB;AAAA,IACJ;AACA,UAAM,KAAK,aAAa;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAc,eAA8B;AAC1C,QAAI,KAAK,SAAS;AAChB,YAAM,KAAK,QAAQ,UAAU,KAAK,KAAK;AAAA,IACzC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,kBAAmC;AACvC,WAAO,KAAK,YAAY,gBAAgB;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAAyB;AAC7B,UAAM,KAAK,YAAY,QAAQ;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,iBAA0B;AACxB,UAAM,SAAS,KAAK,MAAM;AAC1B,QAAI,CAAC,QAAQ,aAAc,QAAO;AAGlC,QAAI,OAAO,YAAY;AACrB,YAAM,YAAY,IAAI,KAAK,OAAO,UAAU;AAE5C,UAAI,UAAU,QAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAM;AACpD,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,kBAA2B;AACzB,WAAO,CAAC,CAAC,KAAK,MAAM,cAAc;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,YAA2B;AAC/B,UAAM,KAAK,sBAAsB,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAwB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAqB;AACnB,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","names":[]}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { DEFAULT_CLIENT_METADATA, toMCPTokens, fromMCPTokens, toMCPClientInfo, fromMCPClientInfo } from "./types.mjs";
|
|
2
2
|
import { randomBytes } from "crypto";
|
|
3
|
+
import { validateOAuthResourceUrl } from "./resource-url.mjs";
|
|
3
4
|
class MCPOAuthProvider {
|
|
4
5
|
agent;
|
|
5
6
|
storage;
|
|
6
7
|
flowHandler;
|
|
7
8
|
_clientMetadata;
|
|
8
9
|
allowHttp;
|
|
10
|
+
configuredResourceOverride;
|
|
9
11
|
constructor(config) {
|
|
10
12
|
this.agent = config.agent;
|
|
11
13
|
this.storage = config.storage;
|
|
12
14
|
this.flowHandler = config.flowHandler;
|
|
13
15
|
this._clientMetadata = config.clientMetadata;
|
|
14
16
|
this.allowHttp = config.allowHttp === true;
|
|
17
|
+
this.configuredResourceOverride = config.resourceOverride;
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* Create a provider for CLI usage
|
|
@@ -27,7 +30,8 @@ class MCPOAuthProvider {
|
|
|
27
30
|
flowHandler,
|
|
28
31
|
storage,
|
|
29
32
|
clientMetadata,
|
|
30
|
-
allowHttp: options?.allowHttp
|
|
33
|
+
allowHttp: options?.allowHttp,
|
|
34
|
+
resourceOverride: options?.resourceOverride
|
|
31
35
|
});
|
|
32
36
|
}
|
|
33
37
|
// ========================================
|
|
@@ -53,14 +57,11 @@ class MCPOAuthProvider {
|
|
|
53
57
|
* mirrors the CLI's `--allow-http` flag.
|
|
54
58
|
*/
|
|
55
59
|
async validateResourceURL(serverUrl, resource) {
|
|
56
|
-
|
|
60
|
+
const selectedResource = this.configuredResourceOverride === null ? resource : this.configuredResourceOverride ?? this.agent.oauth_resource ?? resource;
|
|
61
|
+
if (!selectedResource) {
|
|
57
62
|
return void 0;
|
|
58
63
|
}
|
|
59
|
-
|
|
60
|
-
if (resourceURL.protocol !== "https:" && !this.allowHttp) {
|
|
61
|
-
throw new Error(`Server at ${serverUrl} advertised non-HTTPS resource URL: ${resource}`);
|
|
62
|
-
}
|
|
63
|
-
return resourceURL;
|
|
64
|
+
return validateOAuthResourceUrl(selectedResource, { allowHttp: this.allowHttp });
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
67
|
* Generate OAuth state parameter
|