@adcp/sdk 5.25.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -7
- package/dist/lib/compliance-fixtures/index.d.ts +1 -1
- package/dist/lib/compliance-fixtures/index.js +1 -1
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +15 -0
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/TaskExecutor.d.ts +7 -0
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +9 -2
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +7 -8
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/schemas/index.d.ts +1 -1
- package/dist/lib/schemas/index.js +1 -1
- package/dist/lib/server/create-adcp-server.d.ts +129 -11
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +112 -2
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/ctx-metadata/backends/memory.d.ts +27 -0
- package/dist/lib/server/ctx-metadata/backends/memory.d.ts.map +1 -0
- package/dist/lib/server/ctx-metadata/backends/memory.js +72 -0
- package/dist/lib/server/ctx-metadata/backends/memory.js.map +1 -0
- package/dist/lib/server/ctx-metadata/backends/pg.d.ts +62 -0
- package/dist/lib/server/ctx-metadata/backends/pg.d.ts.map +1 -0
- package/dist/lib/server/ctx-metadata/backends/pg.js +145 -0
- package/dist/lib/server/ctx-metadata/backends/pg.js.map +1 -0
- package/dist/lib/server/ctx-metadata/index.d.ts +15 -0
- package/dist/lib/server/ctx-metadata/index.d.ts.map +1 -0
- package/dist/lib/server/ctx-metadata/index.js +28 -0
- package/dist/lib/server/ctx-metadata/index.js.map +1 -0
- package/dist/lib/server/ctx-metadata/store.d.ts +177 -0
- package/dist/lib/server/ctx-metadata/store.d.ts.map +1 -0
- package/dist/lib/server/ctx-metadata/store.js +327 -0
- package/dist/lib/server/ctx-metadata/store.js.map +1 -0
- package/dist/lib/server/ctx-metadata/wire-shape.d.ts +55 -0
- package/dist/lib/server/ctx-metadata/wire-shape.d.ts.map +1 -0
- package/dist/lib/server/ctx-metadata/wire-shape.js +121 -0
- package/dist/lib/server/ctx-metadata/wire-shape.js.map +1 -0
- package/dist/lib/server/decisioning/account.d.ts +309 -0
- package/dist/lib/server/decisioning/account.d.ts.map +1 -0
- package/dist/lib/server/decisioning/account.js +102 -0
- package/dist/lib/server/decisioning/account.js.map +1 -0
- package/dist/lib/server/decisioning/admin-router.d.ts +75 -0
- package/dist/lib/server/decisioning/admin-router.d.ts.map +1 -0
- package/dist/lib/server/decisioning/admin-router.js +120 -0
- package/dist/lib/server/decisioning/admin-router.js.map +1 -0
- package/dist/lib/server/decisioning/assembly-helpers.d.ts +204 -0
- package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -0
- package/dist/lib/server/decisioning/assembly-helpers.js +173 -0
- package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -0
- package/dist/lib/server/decisioning/async-outcome.d.ts +154 -0
- package/dist/lib/server/decisioning/async-outcome.d.ts.map +1 -0
- package/dist/lib/server/decisioning/async-outcome.js +239 -0
- package/dist/lib/server/decisioning/async-outcome.js.map +1 -0
- package/dist/lib/server/decisioning/capabilities.d.ts +251 -0
- package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -0
- package/dist/lib/server/decisioning/capabilities.js +16 -0
- package/dist/lib/server/decisioning/capabilities.js.map +1 -0
- package/dist/lib/server/decisioning/context.d.ts +212 -0
- package/dist/lib/server/decisioning/context.d.ts.map +1 -0
- package/dist/lib/server/decisioning/context.js +26 -0
- package/dist/lib/server/decisioning/context.js.map +1 -0
- package/dist/lib/server/decisioning/errors-typed.d.ts +104 -0
- package/dist/lib/server/decisioning/errors-typed.d.ts.map +1 -0
- package/dist/lib/server/decisioning/errors-typed.js +304 -0
- package/dist/lib/server/decisioning/errors-typed.js.map +1 -0
- package/dist/lib/server/decisioning/helpers.d.ts +131 -0
- package/dist/lib/server/decisioning/helpers.d.ts.map +1 -0
- package/dist/lib/server/decisioning/helpers.js +134 -0
- package/dist/lib/server/decisioning/helpers.js.map +1 -0
- package/dist/lib/server/decisioning/index.d.ts +46 -0
- package/dist/lib/server/decisioning/index.d.ts.map +1 -0
- package/dist/lib/server/decisioning/index.js +120 -0
- package/dist/lib/server/decisioning/index.js.map +1 -0
- package/dist/lib/server/decisioning/list-helpers.d.ts +53 -0
- package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -0
- package/dist/lib/server/decisioning/list-helpers.js +96 -0
- package/dist/lib/server/decisioning/list-helpers.js.map +1 -0
- package/dist/lib/server/decisioning/manifest-helpers.d.ts +56 -0
- package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -0
- package/dist/lib/server/decisioning/manifest-helpers.js +78 -0
- package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -0
- package/dist/lib/server/decisioning/pagination.d.ts +21 -0
- package/dist/lib/server/decisioning/pagination.d.ts.map +1 -0
- package/dist/lib/server/decisioning/pagination.js +12 -0
- package/dist/lib/server/decisioning/pagination.js.map +1 -0
- package/dist/lib/server/decisioning/platform.d.ts +188 -0
- package/dist/lib/server/decisioning/platform.d.ts.map +1 -0
- package/dist/lib/server/decisioning/platform.js +19 -0
- package/dist/lib/server/decisioning/platform.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +510 -0
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +2196 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/postgres-task-registry.d.ts +114 -0
- package/dist/lib/server/decisioning/runtime/postgres-task-registry.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/postgres-task-registry.js +247 -0
- package/dist/lib/server/decisioning/runtime/postgres-task-registry.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/protocol-for-tool.d.ts +32 -0
- package/dist/lib/server/decisioning/runtime/protocol-for-tool.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/protocol-for-tool.js +127 -0
- package/dist/lib/server/decisioning/runtime/protocol-for-tool.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/task-registry.d.ts +105 -0
- package/dist/lib/server/decisioning/runtime/task-registry.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/task-registry.js +96 -0
- package/dist/lib/server/decisioning/runtime/task-registry.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/to-context.d.ts +54 -0
- package/dist/lib/server/decisioning/runtime/to-context.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/to-context.js +166 -0
- package/dist/lib/server/decisioning/runtime/to-context.js.map +1 -0
- package/dist/lib/server/decisioning/runtime/validate-platform.d.ts +20 -0
- package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -0
- package/dist/lib/server/decisioning/runtime/validate-platform.js +93 -0
- package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/audiences.d.ts +72 -0
- package/dist/lib/server/decisioning/specialisms/audiences.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/audiences.js +15 -0
- package/dist/lib/server/decisioning/specialisms/audiences.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +92 -0
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/brand-rights.js +28 -0
- package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/campaign-governance.d.ts +67 -0
- package/dist/lib/server/decisioning/specialisms/campaign-governance.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/campaign-governance.js +31 -0
- package/dist/lib/server/decisioning/specialisms/campaign-governance.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +78 -0
- package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/content-standards.js +35 -0
- package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +81 -0
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.js +28 -0
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/creative.d.ts +144 -0
- package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/creative.js +19 -0
- package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/lists.d.ts +61 -0
- package/dist/lib/server/decisioning/specialisms/lists.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/lists.js +30 -0
- package/dist/lib/server/decisioning/specialisms/lists.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/sales.d.ts +163 -0
- package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/sales.js +64 -0
- package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -0
- package/dist/lib/server/decisioning/specialisms/signals.d.ts +64 -0
- package/dist/lib/server/decisioning/specialisms/signals.d.ts.map +1 -0
- package/dist/lib/server/decisioning/specialisms/signals.js +28 -0
- package/dist/lib/server/decisioning/specialisms/signals.js.map +1 -0
- package/dist/lib/server/decisioning/start-time.d.ts +76 -0
- package/dist/lib/server/decisioning/start-time.d.ts.map +1 -0
- package/dist/lib/server/decisioning/start-time.js +81 -0
- package/dist/lib/server/decisioning/start-time.js.map +1 -0
- package/dist/lib/server/decisioning/status-changes.d.ts +165 -0
- package/dist/lib/server/decisioning/status-changes.d.ts.map +1 -0
- package/dist/lib/server/decisioning/status-changes.js +131 -0
- package/dist/lib/server/decisioning/status-changes.js.map +1 -0
- package/dist/lib/server/decisioning/status-mappers.d.ts +46 -0
- package/dist/lib/server/decisioning/status-mappers.d.ts.map +1 -0
- package/dist/lib/server/decisioning/status-mappers.js +46 -0
- package/dist/lib/server/decisioning/status-mappers.js.map +1 -0
- package/dist/lib/server/decisioning/tenant-registry.d.ts +289 -0
- package/dist/lib/server/decisioning/tenant-registry.d.ts.map +1 -0
- package/dist/lib/server/decisioning/tenant-registry.js +503 -0
- package/dist/lib/server/decisioning/tenant-registry.js.map +1 -0
- package/dist/lib/server/express-adapter.d.ts +1 -1
- package/dist/lib/server/express-adapter.js +1 -1
- package/dist/lib/server/governance.d.ts +1 -1
- package/dist/lib/server/governance.js +1 -1
- package/dist/lib/server/idempotency/store.d.ts +1 -1
- package/dist/lib/server/idempotency/store.js +1 -1
- package/dist/lib/server/index.d.ts +9 -2
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js +79 -4
- package/dist/lib/server/index.js.map +1 -1
- package/dist/lib/server/legacy/v5/index.d.ts +38 -0
- package/dist/lib/server/legacy/v5/index.d.ts.map +1 -0
- package/dist/lib/server/legacy/v5/index.js +60 -0
- package/dist/lib/server/legacy/v5/index.js.map +1 -0
- package/dist/lib/server/normalize-errors.d.ts +88 -0
- package/dist/lib/server/normalize-errors.d.ts.map +1 -0
- package/dist/lib/server/normalize-errors.js +146 -0
- package/dist/lib/server/normalize-errors.js.map +1 -0
- package/dist/lib/server/pick-safe-details.d.ts +90 -0
- package/dist/lib/server/pick-safe-details.d.ts.map +1 -0
- package/dist/lib/server/pick-safe-details.js +148 -0
- package/dist/lib/server/pick-safe-details.js.map +1 -0
- package/dist/lib/server/postgres-state-store.d.ts +1 -1
- package/dist/lib/server/postgres-state-store.js +1 -1
- package/dist/lib/server/responses.d.ts +38 -0
- package/dist/lib/server/responses.d.ts.map +1 -1
- package/dist/lib/server/responses.js +38 -0
- package/dist/lib/server/responses.js.map +1 -1
- package/dist/lib/server/state-store.d.ts +1 -1
- package/dist/lib/server/state-store.js +1 -1
- package/dist/lib/server/test-controller.d.ts +10 -3
- package/dist/lib/server/test-controller.d.ts.map +1 -1
- package/dist/lib/server/test-controller.js +10 -3
- package/dist/lib/server/test-controller.js.map +1 -1
- package/dist/lib/testing/comply-controller.d.ts +47 -1
- package/dist/lib/testing/comply-controller.d.ts.map +1 -1
- package/dist/lib/testing/comply-controller.js +11 -4
- package/dist/lib/testing/comply-controller.js.map +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.map +1 -1
- package/dist/lib/testing/personas/index.d.ts +143 -0
- package/dist/lib/testing/personas/index.d.ts.map +1 -0
- package/dist/lib/testing/personas/index.js +190 -0
- package/dist/lib/testing/personas/index.js.map +1 -0
- package/dist/lib/testing/storyboard/index.d.ts +1 -1
- package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/index.js +3 -2
- package/dist/lib/testing/storyboard/index.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts +13 -0
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +179 -7
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/types/asset-instances.d.ts +1 -0
- package/dist/lib/types/asset-instances.d.ts.map +1 -1
- package/dist/lib/types/core.generated.d.ts +203 -98
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +1 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.d.ts.map +1 -1
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/schemas.generated.d.ts +599 -159
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +175 -94
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/tools.generated.d.ts +315 -46
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.d.ts +1 -1
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +6 -0
- package/dist/lib/utils/capabilities.js.map +1 -1
- package/dist/lib/validation/schema-validator.d.ts +13 -0
- package/dist/lib/validation/schema-validator.d.ts.map +1 -1
- package/dist/lib/validation/schema-validator.js +240 -3
- package/dist/lib/validation/schema-validator.js.map +1 -1
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.js.map +1 -1
- package/docs/guides/BUILD-AN-AGENT.md +30 -5
- package/docs/llms.txt +28 -17
- package/examples/README.md +3 -1
- package/examples/decisioning-platform-broadcast-tv.ts +300 -0
- package/examples/decisioning-platform-identity-graph.ts +214 -0
- package/examples/decisioning-platform-mock-seller.ts +332 -0
- package/examples/decisioning-platform-multi-tenant.ts +128 -0
- package/examples/decisioning-platform-programmatic.ts +254 -0
- package/examples/signals-agent.ts +1 -1
- package/package.json +13 -2
- package/skills/build-brand-rights-agent/SKILL.md +10 -3
- package/skills/build-creative-agent/SKILL.md +94 -64
- package/skills/build-decisioning-creative-template/SKILL.md +554 -0
- package/skills/build-decisioning-platform/SKILL.md +304 -0
- package/skills/build-decisioning-platform/advanced/BRAND-RIGHTS.md +25 -0
- package/skills/build-decisioning-platform/advanced/COMPLIANCE.md +23 -0
- package/skills/build-decisioning-platform/advanced/GOVERNANCE.md +24 -0
- package/skills/build-decisioning-platform/advanced/HITL.md +34 -0
- package/skills/build-decisioning-platform/advanced/IDEMPOTENCY.md +52 -0
- package/skills/build-decisioning-platform/advanced/MULTI-TENANT.md +47 -0
- package/skills/build-decisioning-platform/advanced/OAUTH.md +22 -0
- package/skills/build-decisioning-platform/advanced/REFERENCE.md +991 -0
- package/skills/build-decisioning-platform/advanced/SANDBOX.md +24 -0
- package/skills/build-decisioning-platform/advanced/STATE-MACHINE.md +52 -0
- package/skills/build-decisioning-signal-marketplace/SKILL.md +269 -0
- package/skills/build-generative-seller-agent/SKILL.md +89 -53
- package/skills/build-governance-agent/SKILL.md +76 -45
- package/skills/build-retail-media-agent/SKILL.md +87 -62
- package/skills/build-seller-agent/SKILL.md +384 -255
- package/skills/build-seller-agent/deployment.md +5 -3
- package/skills/build-seller-agent/specialisms/audience-sync.md +0 -2
- package/skills/build-seller-agent/specialisms/sales-broadcast-tv.md +0 -2
- package/skills/build-seller-agent/specialisms/sales-guaranteed.md +0 -2
- package/skills/build-seller-agent/specialisms/sales-non-guaranteed.md +0 -2
- package/skills/build-seller-agent/specialisms/sales-proposal-mode.md +0 -2
- package/skills/build-seller-agent/specialisms/sales-social.md +0 -2
- package/skills/build-seller-agent/specialisms/signed-requests.md +0 -2
- package/skills/build-si-agent/SKILL.md +40 -32
- package/skills/build-signals-agent/SKILL.md +139 -92
- package/skills/call-adcp-agent.previous/SKILL.md +5 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-helpers.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/list-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AAqCH,gEA0CC;AA3DD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,0BAA0B,CAAC,IAAoC;IAC7E,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAE/D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,OAAO,CAAC,QAAQ,EAAE,MAAM;YAAE,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,OAAO,CAAC,QAAQ,EAAE,MAAM;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C,IAAI,CAAC,YAAY,CAAC,CAAC;QAClE,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS;YAAE,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,OAAO,GAA2C;QACtD,cAAc,EAAE,aAAa,IAAI,UAAU,CAAC,WAAW,IAAI,SAAS,CAAC,MAAM;QAC3E,QAAQ,EAAE,SAAS,CAAC,MAAM;QAC1B,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;QACrE,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI;YAClB,YAAY,EAAE;gBACZ,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACtE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;aACnF;SACF,CAAC;KACH,CAAC;IAEF,OAAO;QACL,aAAa,EAAE,OAAO;QACtB,UAAU;QACV,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for reading typed assets out of `creative_manifest.assets`.
|
|
3
|
+
*
|
|
4
|
+
* `creative_manifest.assets` is a keyed map (`{ [asset_id]: AssetInstance }`)
|
|
5
|
+
* where each value is a discriminated union by `asset_type`. Adopters
|
|
6
|
+
* narrowing per-call write the same null-check + discriminator-check
|
|
7
|
+
* boilerplate over and over. These helpers replace that boilerplate
|
|
8
|
+
* without compromising the discriminator-narrowing story.
|
|
9
|
+
*
|
|
10
|
+
* Status: Preview / 6.0.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
import type { CreativeManifest } from '../../types/tools.generated';
|
|
15
|
+
import type { AssetInstance, AssetInstanceType } from '../../types/asset-instances';
|
|
16
|
+
/**
|
|
17
|
+
* Type-narrowed asset accessor by asset_id and expected asset_type.
|
|
18
|
+
*
|
|
19
|
+
* Returns the asset narrowed to the matching variant, or `undefined` if the
|
|
20
|
+
* asset is missing or the asset_type doesn't match. Use when you want a
|
|
21
|
+
* silent skip for the wrong-type case (e.g., processing a heterogeneous
|
|
22
|
+
* batch where some entries don't apply to your transform).
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* const audio = getAsset(req.creative_manifest, 'rendered_audio', 'audio');
|
|
26
|
+
* // audio is `AudioAsset | undefined` — narrowed by the discriminator
|
|
27
|
+
* if (audio) {
|
|
28
|
+
* const url = audio.url; // typed access
|
|
29
|
+
* const ms = audio.duration_ms;
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* For the require-or-throw flavor, see {@link requireAsset}.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getAsset<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T): Extract<AssetInstance, {
|
|
36
|
+
asset_type: T;
|
|
37
|
+
}> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Same as {@link getAsset} but throws `AdcpError('INVALID_REQUEST')` when
|
|
40
|
+
* the asset is missing or the wrong type. Use when the asset is required
|
|
41
|
+
* for the platform method to proceed (the typical creative-template case).
|
|
42
|
+
*
|
|
43
|
+
* Throws with a precomposed `field` path so the buyer sees actionable
|
|
44
|
+
* feedback. Customize the message via the `messageOverride` arg if the
|
|
45
|
+
* default doesn't fit.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* const script = requireAsset(req.creative_manifest, 'script', 'text');
|
|
49
|
+
* // script is `TextAsset` — never undefined past this line
|
|
50
|
+
* await audioStackClient.synthesize({ text: script.content });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function requireAsset<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T, messageOverride?: string): Extract<AssetInstance, {
|
|
54
|
+
asset_type: T;
|
|
55
|
+
}>;
|
|
56
|
+
//# sourceMappingURL=manifest-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAClD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GACX,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,SAAS,CAIvD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,EACZ,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,CAmB3C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Helpers for reading typed assets out of `creative_manifest.assets`.
|
|
4
|
+
*
|
|
5
|
+
* `creative_manifest.assets` is a keyed map (`{ [asset_id]: AssetInstance }`)
|
|
6
|
+
* where each value is a discriminated union by `asset_type`. Adopters
|
|
7
|
+
* narrowing per-call write the same null-check + discriminator-check
|
|
8
|
+
* boilerplate over and over. These helpers replace that boilerplate
|
|
9
|
+
* without compromising the discriminator-narrowing story.
|
|
10
|
+
*
|
|
11
|
+
* Status: Preview / 6.0.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.getAsset = getAsset;
|
|
17
|
+
exports.requireAsset = requireAsset;
|
|
18
|
+
const async_outcome_1 = require("./async-outcome");
|
|
19
|
+
/**
|
|
20
|
+
* Type-narrowed asset accessor by asset_id and expected asset_type.
|
|
21
|
+
*
|
|
22
|
+
* Returns the asset narrowed to the matching variant, or `undefined` if the
|
|
23
|
+
* asset is missing or the asset_type doesn't match. Use when you want a
|
|
24
|
+
* silent skip for the wrong-type case (e.g., processing a heterogeneous
|
|
25
|
+
* batch where some entries don't apply to your transform).
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* const audio = getAsset(req.creative_manifest, 'rendered_audio', 'audio');
|
|
29
|
+
* // audio is `AudioAsset | undefined` — narrowed by the discriminator
|
|
30
|
+
* if (audio) {
|
|
31
|
+
* const url = audio.url; // typed access
|
|
32
|
+
* const ms = audio.duration_ms;
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* For the require-or-throw flavor, see {@link requireAsset}.
|
|
37
|
+
*/
|
|
38
|
+
function getAsset(manifest, assetId, assetType) {
|
|
39
|
+
const asset = manifest?.assets?.[assetId];
|
|
40
|
+
if (!asset || asset.asset_type !== assetType)
|
|
41
|
+
return undefined;
|
|
42
|
+
return asset;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Same as {@link getAsset} but throws `AdcpError('INVALID_REQUEST')` when
|
|
46
|
+
* the asset is missing or the wrong type. Use when the asset is required
|
|
47
|
+
* for the platform method to proceed (the typical creative-template case).
|
|
48
|
+
*
|
|
49
|
+
* Throws with a precomposed `field` path so the buyer sees actionable
|
|
50
|
+
* feedback. Customize the message via the `messageOverride` arg if the
|
|
51
|
+
* default doesn't fit.
|
|
52
|
+
*
|
|
53
|
+
* ```ts
|
|
54
|
+
* const script = requireAsset(req.creative_manifest, 'script', 'text');
|
|
55
|
+
* // script is `TextAsset` — never undefined past this line
|
|
56
|
+
* await audioStackClient.synthesize({ text: script.content });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
function requireAsset(manifest, assetId, assetType, messageOverride) {
|
|
60
|
+
const asset = manifest?.assets?.[assetId];
|
|
61
|
+
if (!asset) {
|
|
62
|
+
throw new async_outcome_1.AdcpError('INVALID_REQUEST', {
|
|
63
|
+
recovery: 'correctable',
|
|
64
|
+
message: messageOverride ?? `creative_manifest.assets.${assetId} is required`,
|
|
65
|
+
field: `creative_manifest.assets.${assetId}`,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (asset.asset_type !== assetType) {
|
|
69
|
+
throw new async_outcome_1.AdcpError('INVALID_REQUEST', {
|
|
70
|
+
recovery: 'correctable',
|
|
71
|
+
message: messageOverride ??
|
|
72
|
+
`creative_manifest.assets.${assetId} must be a ${assetType} asset (got asset_type='${asset.asset_type}')`,
|
|
73
|
+
field: `creative_manifest.assets.${assetId}.asset_type`,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return asset;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=manifest-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-helpers.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAyBH,4BAQC;AAiBD,oCAwBC;AAtED,mDAA4C;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,QAAQ,CACtB,QAAsC,EACtC,OAAe,EACf,SAAY;IAEZ,MAAM,KAAK,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC/D,OAAO,KAAkD,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,YAAY,CAC1B,QAAsC,EACtC,OAAe,EACf,SAAY,EACZ,eAAwB;IAExB,MAAM,KAAK,GAAG,QAAQ,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,yBAAS,CAAC,iBAAiB,EAAE;YACrC,QAAQ,EAAE,aAAa;YACvB,OAAO,EAAE,eAAe,IAAI,4BAA4B,OAAO,cAAc;YAC7E,KAAK,EAAE,4BAA4B,OAAO,EAAE;SAC7C,CAAC,CAAC;IACL,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAI,yBAAS,CAAC,iBAAiB,EAAE;YACrC,QAAQ,EAAE,aAAa;YACvB,OAAO,EACL,eAAe;gBACf,4BAA4B,OAAO,cAAc,SAAS,2BAA2B,KAAK,CAAC,UAAU,IAAI;YAC3G,KAAK,EAAE,4BAA4B,OAAO,aAAa;SACxD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAkD,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor-based pagination primitive for all list-returning methods.
|
|
3
|
+
* Cursor is opaque to the framework (platform-defined; usually a
|
|
4
|
+
* base64-encoded internal offset).
|
|
5
|
+
*
|
|
6
|
+
* Status: Preview / 6.0.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface CursorPage<T> {
|
|
11
|
+
items: T[];
|
|
12
|
+
/** Opaque continuation token; absent on the last page. */
|
|
13
|
+
nextCursor?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CursorRequest {
|
|
16
|
+
/** Maximum items to return; framework caps to a sane upper bound. */
|
|
17
|
+
limit?: number;
|
|
18
|
+
/** Continuation token from a previous response's `nextCursor`. */
|
|
19
|
+
cursor?: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cursor-based pagination primitive for all list-returning methods.
|
|
4
|
+
* Cursor is opaque to the framework (platform-defined; usually a
|
|
5
|
+
* base64-encoded internal offset).
|
|
6
|
+
*
|
|
7
|
+
* Status: Preview / 6.0.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/pagination.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DecisioningPlatform — the top-level interface adopters implement.
|
|
3
|
+
*
|
|
4
|
+
* Per-specialism sub-interfaces (sales, creative, audiences, etc.) are
|
|
5
|
+
* optional; framework's compile-time enforcement (RequiredPlatformsFor<S>)
|
|
6
|
+
* forces the right sub-interfaces based on `capabilities.specialisms[]`.
|
|
7
|
+
*
|
|
8
|
+
* Status: Preview / 6.0. Not yet wired into the framework.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
import type { DecisioningCapabilities, BrandCapabilities } from './capabilities';
|
|
13
|
+
import type { Account, AccountStore } from './account';
|
|
14
|
+
import type { StatusMappers } from './status-mappers';
|
|
15
|
+
import type { SalesPlatform } from './specialisms/sales';
|
|
16
|
+
import type { CreativeBuilderPlatform } from './specialisms/creative';
|
|
17
|
+
import type { CreativeAdServerPlatform } from './specialisms/creative-ad-server';
|
|
18
|
+
import type { AudiencePlatform } from './specialisms/audiences';
|
|
19
|
+
import type { SignalsPlatform } from './specialisms/signals';
|
|
20
|
+
import type { CampaignGovernancePlatform } from './specialisms/campaign-governance';
|
|
21
|
+
import type { ContentStandardsPlatform } from './specialisms/content-standards';
|
|
22
|
+
import type { BrandRightsPlatform } from './specialisms/brand-rights';
|
|
23
|
+
import type { PropertyListsPlatform, CollectionListsPlatform } from './specialisms/lists';
|
|
24
|
+
import type { AdCPSpecialism } from '../../types/tools.generated';
|
|
25
|
+
/**
|
|
26
|
+
* Top-level platform interface. Adopters implement this; framework wires
|
|
27
|
+
* the wire protocol around it.
|
|
28
|
+
*
|
|
29
|
+
* The "framework owns X" claims below are the v6.0 wiring contract — the
|
|
30
|
+
* runtime guarantees the framework will provide once this surface is wired.
|
|
31
|
+
* They are NOT yet enforced; this module is preview-only as of the scaffold
|
|
32
|
+
* landing. Treat them as the design contract a v6.0 reviewer should hold
|
|
33
|
+
* the framework refactor to, not as a description of existing behavior.
|
|
34
|
+
*
|
|
35
|
+
* **What the framework owns** (platform implementations DON'T see these):
|
|
36
|
+
* - Wire-shape mapping (MCP tools/list, A2A skill manifest, request/response envelopes)
|
|
37
|
+
* - Authentication + auth-principal extraction; `accounts.resolve()` is the only
|
|
38
|
+
* place the platform translates auth into its tenant model
|
|
39
|
+
* - Idempotency: dedupe + replay handled before dispatch; platforms see clean traffic
|
|
40
|
+
* - `sandbox` boundary: when `AccountReference.sandbox === true`, framework
|
|
41
|
+
* resolves the buyer's sandbox account via `accounts.resolve()`. The platform
|
|
42
|
+
* sees the resolved sandbox `Account` like any other and is responsible for
|
|
43
|
+
* routing reads/writes to its sandbox backend. There is no separate
|
|
44
|
+
* "dry-run" mode — sandbox subsumes "validate against real platform without
|
|
45
|
+
* writing to production." Tool-specific `dry_run` flags on `sync_catalogs`
|
|
46
|
+
* and `sync_creatives` are wire fields the platform receives and honors;
|
|
47
|
+
* they are NOT a framework-level mode.
|
|
48
|
+
* - `context` echo: framework round-trips `context` on every response
|
|
49
|
+
* - Task envelopes: `submitted` outcomes are wrapped into A2A Task envelopes /
|
|
50
|
+
* MCP polling responses; `taskHandle.notify` calls dedupe + retry
|
|
51
|
+
* - Schema validation: requests fail before reaching the platform; responses are
|
|
52
|
+
* shape-validated against the wire schema after the platform returns
|
|
53
|
+
*
|
|
54
|
+
* **What the platform owns**: the business decisions in each `SalesPlatform` /
|
|
55
|
+
* `CreativeBuilderPlatform` / `AudiencePlatform` method. Nothing else.
|
|
56
|
+
*
|
|
57
|
+
* @template TConfig Platform-specific config typed at the call site.
|
|
58
|
+
* Example: `class GAM implements DecisioningPlatform<{ networkId: string }>`.
|
|
59
|
+
* @template TCtxMeta Shape of the platform's opaque ctx_metadata blob — typed
|
|
60
|
+
* once and propagated into `ctx.account.ctx_metadata`,
|
|
61
|
+
* `ctx.ctxMetadata.get()`, and every specialism handler.
|
|
62
|
+
*/
|
|
63
|
+
export interface DecisioningPlatform<TConfig = unknown, TCtxMeta = Record<string, unknown>> {
|
|
64
|
+
/** Capability declaration; single source of truth for get_adcp_capabilities. */
|
|
65
|
+
capabilities: DecisioningCapabilities<TConfig>;
|
|
66
|
+
/** Account model + tenant resolution. */
|
|
67
|
+
accounts: AccountStore<TCtxMeta>;
|
|
68
|
+
/**
|
|
69
|
+
* Native-status mappers (account, mediaBuy, creative, plan).
|
|
70
|
+
*
|
|
71
|
+
* **Optional.** Default behavior treats the platform's status strings as
|
|
72
|
+
* already-canonical AdCP status values (no translation). Provide mappers
|
|
73
|
+
* only when your platform exposes non-AdCP status strings (e.g., GAM's
|
|
74
|
+
* `DELIVERY_PAUSED` → AdCP's `paused`).
|
|
75
|
+
*/
|
|
76
|
+
statusMappers?: StatusMappers;
|
|
77
|
+
/**
|
|
78
|
+
* Per-tenant capability override. Multi-tenant SaaS adopters (Prebid-style
|
|
79
|
+
* deployments where one server hosts many advertisers, each with different
|
|
80
|
+
* `manualApprovalOperations` / pricing tiers / channel mixes) implement this
|
|
81
|
+
* to scope capabilities per resolved Account. When absent, the framework
|
|
82
|
+
* uses `capabilities` for every request.
|
|
83
|
+
*
|
|
84
|
+
* The framework calls this AFTER `accounts.resolve()` and uses the returned
|
|
85
|
+
* capabilities to gate the rest of the request. The static `agent-card.json`
|
|
86
|
+
* AND `tools/list` shape is derived from `capabilities` (the union) — per-tenant
|
|
87
|
+
* differences are runtime-only.
|
|
88
|
+
*/
|
|
89
|
+
getCapabilitiesFor?(account: Account<TCtxMeta>): DecisioningCapabilities<TConfig> | Promise<DecisioningCapabilities<TConfig>>;
|
|
90
|
+
sales?: SalesPlatform<TCtxMeta>;
|
|
91
|
+
creative?: CreativeBuilderPlatform<TCtxMeta> | CreativeAdServerPlatform<TCtxMeta>;
|
|
92
|
+
audiences?: AudiencePlatform<TCtxMeta>;
|
|
93
|
+
signals?: SignalsPlatform<TCtxMeta>;
|
|
94
|
+
campaignGovernance?: CampaignGovernancePlatform<TCtxMeta>;
|
|
95
|
+
contentStandards?: ContentStandardsPlatform<TCtxMeta>;
|
|
96
|
+
propertyLists?: PropertyListsPlatform<TCtxMeta>;
|
|
97
|
+
collectionLists?: CollectionListsPlatform<TCtxMeta>;
|
|
98
|
+
brandRights?: BrandRightsPlatform<TCtxMeta>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Maps an AdCP specialism to the platform interface(s) it requires. The
|
|
102
|
+
* framework's `createAdcpServer<P extends DecisioningPlatform>` constrains
|
|
103
|
+
* `P` to satisfy `RequiredPlatformsFor<P['capabilities']['specialisms'][number]>`,
|
|
104
|
+
* forcing every claimed specialism's interface methods to exist.
|
|
105
|
+
*
|
|
106
|
+
* Drop a method, fail compile.
|
|
107
|
+
* Claim a specialism without an implementation, fail compile.
|
|
108
|
+
*
|
|
109
|
+
* The nested-conditional encoding (rather than a union of `S extends X ? {} : never`)
|
|
110
|
+
* is deliberate: when a specialism is claimed without its required platform
|
|
111
|
+
* interface, TypeScript surfaces "Property 'sales' is missing in type 'P'"
|
|
112
|
+
* rather than the unactionable "Type 'P' does not satisfy the constraint 'never'."
|
|
113
|
+
*
|
|
114
|
+
* v1.0 covers the 4 specialisms shipping in v1.0; extended in v1.1+.
|
|
115
|
+
* Unknown specialisms (v1.1+ when this module hasn't been updated yet)
|
|
116
|
+
* resolve to an empty requirement — the framework's runtime check is the
|
|
117
|
+
* fallback gate.
|
|
118
|
+
*/
|
|
119
|
+
type SalesSpecialism = 'sales-non-guaranteed' | 'sales-guaranteed' | 'sales-broadcast-tv' | 'sales-social' | 'sales-catalog-driven' | 'sales-proposal-mode';
|
|
120
|
+
type SignalSpecialism = 'signal-marketplace' | 'signal-owned';
|
|
121
|
+
type CampaignGovernanceSpecialism = 'governance-spend-authority' | 'governance-delivery-monitor';
|
|
122
|
+
export type RequiredPlatformsFor<S extends AdCPSpecialism, TCtxMeta = any> = S extends 'creative-template' | 'creative-generative' ? {
|
|
123
|
+
creative: CreativeBuilderPlatform<TCtxMeta>;
|
|
124
|
+
} : S extends 'creative-ad-server' ? {
|
|
125
|
+
creative: CreativeAdServerPlatform<TCtxMeta>;
|
|
126
|
+
} : S extends SalesSpecialism ? {
|
|
127
|
+
sales: SalesPlatform<TCtxMeta>;
|
|
128
|
+
} : S extends 'audience-sync' ? {
|
|
129
|
+
audiences: AudiencePlatform<TCtxMeta>;
|
|
130
|
+
} : S extends SignalSpecialism ? {
|
|
131
|
+
signals: SignalsPlatform<TCtxMeta>;
|
|
132
|
+
} : S extends CampaignGovernanceSpecialism ? {
|
|
133
|
+
campaignGovernance: CampaignGovernancePlatform<TCtxMeta>;
|
|
134
|
+
} : S extends 'property-lists' ? {
|
|
135
|
+
propertyLists: PropertyListsPlatform<TCtxMeta>;
|
|
136
|
+
} : S extends 'collection-lists' ? {
|
|
137
|
+
collectionLists: CollectionListsPlatform<TCtxMeta>;
|
|
138
|
+
} : S extends 'content-standards' ? {
|
|
139
|
+
contentStandards: ContentStandardsPlatform<TCtxMeta>;
|
|
140
|
+
} : S extends 'brand-rights' ? {
|
|
141
|
+
brandRights: BrandRightsPlatform<TCtxMeta>;
|
|
142
|
+
} : Record<string, never>;
|
|
143
|
+
/**
|
|
144
|
+
* The framework's createAdcpServer<P> signature uses this intersection to
|
|
145
|
+
* enforce capability claims at compile time. Sketch:
|
|
146
|
+
*
|
|
147
|
+
* ```ts
|
|
148
|
+
* declare function createAdcpServer<P extends DecisioningPlatform>(config: {
|
|
149
|
+
* platform: P & RequiredPlatformsFor<P['capabilities']['specialisms'][number]>;
|
|
150
|
+
* }): AdcpServer;
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* NOTE: The companion file is preview-only; the actual `createAdcpServer`
|
|
154
|
+
* doesn't yet enforce this. Wiring lands in a follow-up PR with the
|
|
155
|
+
* framework refactor.
|
|
156
|
+
*/
|
|
157
|
+
/**
|
|
158
|
+
* Compile-time mapping from a claimed specialism to the capability
|
|
159
|
+
* blocks the framework requires on `DecisioningCapabilities`. Sister
|
|
160
|
+
* type to `RequiredPlatformsFor<S>` — that one constrains the per-
|
|
161
|
+
* specialism platform interfaces; this one constrains capability-block
|
|
162
|
+
* declarations on `capabilities.*`.
|
|
163
|
+
*
|
|
164
|
+
* Mappings populated conservatively in v1.0:
|
|
165
|
+
*
|
|
166
|
+
* - `'brand-rights'` → `{ brand: BrandCapabilities }`. Adopters
|
|
167
|
+
* claiming brand-rights MUST declare `capabilities.brand`. The
|
|
168
|
+
* framework auto-derives `rights: true` from the
|
|
169
|
+
* `BrandRightsPlatform` impl, but adopters still need to declare
|
|
170
|
+
* the block (even as `{}`) so `right_types`, `available_uses`,
|
|
171
|
+
* etc. land coherently in `get_adcp_capabilities`.
|
|
172
|
+
*
|
|
173
|
+
* Other specialisms have no required capability blocks today —
|
|
174
|
+
* `audience_targeting` is recommended for `audience-sync` adopters but
|
|
175
|
+
* not enforced (some sync platforms accept anonymous IDs only and
|
|
176
|
+
* legitimately have no `supported_identifier_types` to declare).
|
|
177
|
+
*
|
|
178
|
+
* The `& Record<string, never>` fallthrough means specialisms not
|
|
179
|
+
* mapped here add no constraint — adopters can claim them without
|
|
180
|
+
* declaring extra capability blocks.
|
|
181
|
+
*/
|
|
182
|
+
export type RequiredCapabilitiesFor<S extends AdCPSpecialism> = S extends 'brand-rights' ? {
|
|
183
|
+
capabilities: {
|
|
184
|
+
brand: BrandCapabilities;
|
|
185
|
+
};
|
|
186
|
+
} : {};
|
|
187
|
+
export {};
|
|
188
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAA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SAAS,kBAAkB,GAC1B;IAAE,eAAe,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAA;CAAE,GACtD,CAAC,SAAS,mBAAmB,GAC3B;IAAE,gBAAgB,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAA;CAAE,GACxD,CAAC,SAAS,cAAc,GACtB;IAAE,WAAW,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;CAAE,GAC9C,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,cAAc,IAAI,CAAC,SAAS,cAAc,GACpF;IAAE,YAAY,EAAE;QAAE,KAAK,EAAE,iBAAiB,CAAA;KAAE,CAAA;CAAE,GAC9C,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DecisioningPlatform — the top-level interface adopters implement.
|
|
4
|
+
*
|
|
5
|
+
* Per-specialism sub-interfaces (sales, creative, audiences, etc.) are
|
|
6
|
+
* optional; framework's compile-time enforcement (RequiredPlatformsFor<S>)
|
|
7
|
+
* forces the right sub-interfaces based on `capabilities.specialisms[]`.
|
|
8
|
+
*
|
|
9
|
+
* Status: Preview / 6.0. Not yet wired into the framework.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
// `{}` (not `Record<string, never>`) is the right "no extra requirements"
|
|
15
|
+
// fallthrough: it intersects to identity (`P & {} = P`) for specialisms
|
|
16
|
+
// without capability constraints. `Record<string, never>` would force the
|
|
17
|
+
// platform to have NO extra properties, which would reject every real
|
|
18
|
+
// platform impl.
|
|
19
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/platform.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAmOH,0EAA0E;AAC1E,wEAAwE;AACxE,0EAA0E;AAC1E,sEAAsE;AACtE,iBAAiB"}
|