@adcp/sdk 5.25.0 → 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/conformance/runners.d.ts.map +1 -1
- package/dist/lib/conformance/runners.js +13 -1
- package/dist/lib/conformance/runners.js.map +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/protocols/index.d.ts +3 -1
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +23 -14
- package/dist/lib/protocols/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 +142 -11
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +211 -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/adcp.d.ts.map +1 -1
- package/dist/lib/types/adcp.js +1 -0
- package/dist/lib/types/adcp.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
|
@@ -42,7 +42,7 @@ Specialism ID (kebab-case) = storyboard directory. Storyboard `id:` (snake_case,
|
|
|
42
42
|
|
|
43
43
|
Every production governance agent — regardless of specialism — must wire these. Full treatment in `skills/build-seller-agent/SKILL.md` §Protocol-Wide Requirements and §Composing OAuth, signing, and idempotency; minimum-viable pointers:
|
|
44
44
|
|
|
45
|
-
- **`idempotency_key`** on every mutating request (`sync_plans`, `create_property_list`/`update_property_list`/`delete_property_list`, `create_collection_list`/`update_collection_list`/`delete_collection_list`, `create_content_standards`/`update_content_standards`, `calibrate_content`).
|
|
45
|
+
- **`idempotency_key`** on every mutating request (`sync_plans`, `create_property_list`/`update_property_list`/`delete_property_list`, `create_collection_list`/`update_collection_list`/`delete_collection_list`, `create_content_standards`/`update_content_standards`, `calibrate_content`). Pass `createIdempotencyStore` to `createAdcpServerFromPlatform(platform, { idempotency })`.
|
|
46
46
|
- **Authentication** via `serve({ authenticate: verifyApiKey(...)/verifyBearer(...) })` from `@adcp/sdk/server`. Unauthenticated agents fail the universal `security_baseline` storyboard.
|
|
47
47
|
- **Signature-header transparency**: don't reject requests that carry `Signature-Input`/`Signature` headers even if you don't claim `signed-requests`.
|
|
48
48
|
- **Resolve-then-authorize** on id lookups (`get_property_list`, `get_content_standards`, `get_collection_list`): return byte-equivalent errors whether the id is cross-tenant or nonexistent — always `REFERENCE_NOT_FOUND`, never `PERMISSION_DENIED`. `adcp fuzz` runs a paired-probe invariant that enforces this; stand up two test tenants and pass `--auth-token` + `--auth-token-cross-tenant` for full coverage. See `skills/build-seller-agent/SKILL.md` §Resolve-then-authorize for the full rules.
|
|
@@ -79,7 +79,7 @@ For campaign governance, how should the agent decide?
|
|
|
79
79
|
>
|
|
80
80
|
> **Cross-cutting pitfalls matrix runs keep catching:**
|
|
81
81
|
>
|
|
82
|
-
> - **Declare `capabilities
|
|
82
|
+
> - **Declare `capabilities.specialisms: ['governance-spend-authority', 'property-lists'] as const` on the `DecisioningPlatform` you pass to `createAdcpServerFromPlatform`.** Value is `string[]` of enum ids (not `[{id, version}]`). Agents that don't declare their specialism fail the grader with "No applicable tracks found" even if every tool works — tracks are gated on the specialism claim.
|
|
83
83
|
> - Every mutating-tool response (`create_property_list`, `create_collection_list`, `create_content_standards`, etc.) has `additionalProperties: false` — don't add extra fields. Return exactly what the schema declares.
|
|
84
84
|
|
|
85
85
|
### Campaign Governance
|
|
@@ -452,7 +452,7 @@ taskToolResponse({
|
|
|
452
452
|
|
|
453
453
|
### Context and Ext Passthrough
|
|
454
454
|
|
|
455
|
-
|
|
455
|
+
The framework auto-echoes the request's `context` into every response — **do not set `context` yourself in your handler return values.** It's injected post-handler only when the field isn't already present.
|
|
456
456
|
|
|
457
457
|
**Crucial:** `context` is schema-typed as an object. If your handler hand-sets a string or narrative description, validation fails with `/context: must be object` and the framework does not overwrite. Leave the field out entirely; the framework handles it.
|
|
458
458
|
|
|
@@ -462,14 +462,15 @@ Some schemas also define an `ext` field for vendor-namespaced extensions. If you
|
|
|
462
462
|
|
|
463
463
|
| SDK piece | Usage |
|
|
464
464
|
| ---------------------------------------- | -------------------------------------------------------------------------- |
|
|
465
|
-
| `
|
|
466
|
-
| `
|
|
465
|
+
| `createAdcpServerFromPlatform(platform, opts)` | Create server from a typed `DecisioningPlatform` — compile-time specialism enforcement, auto-generated capabilities, ctx_metadata round-trip |
|
|
466
|
+
| `createAdcpServer(config)` *(legacy)* | v5 handler-bag entry. Mid-migration / escape-hatch only; reach via `@adcp/sdk/server/legacy/v5` |
|
|
467
|
+
| `serve(() => createAdcpServerFromPlatform(platform, opts))` | Start HTTP server on `:3001/mcp` |
|
|
467
468
|
| `ctx.store` | State persistence — `get/put/patch/delete/list` domain objects |
|
|
468
469
|
| `adcpError(code, { message })` | Structured error |
|
|
469
470
|
|
|
470
471
|
Handlers return raw data objects. The framework auto-wraps responses and auto-generates `get_adcp_capabilities` from registered handlers.
|
|
471
472
|
|
|
472
|
-
Import: `import {
|
|
473
|
+
Import: `import { createAdcpServerFromPlatform, serve, adcpError } from '@adcp/sdk/server';`
|
|
473
474
|
|
|
474
475
|
## Setup
|
|
475
476
|
|
|
@@ -498,7 +499,7 @@ Minimal `tsconfig.json`:
|
|
|
498
499
|
|
|
499
500
|
## Implementation
|
|
500
501
|
|
|
501
|
-
1. Single `.ts` file —
|
|
502
|
+
1. Single `.ts` file — `class MyGovernance implements DecisioningPlatform` with `campaignGovernance`, `propertyLists`, `collectionLists`, `contentStandards` typed sub-platforms
|
|
502
503
|
2. Do not register `get_adcp_capabilities` — the framework generates it from registered handlers
|
|
503
504
|
3. Return raw data objects from handlers — the framework wraps responses automatically
|
|
504
505
|
4. Use `ctx.store` to persist plans, property lists, and content standards
|
|
@@ -507,48 +508,79 @@ Minimal `tsconfig.json`:
|
|
|
507
508
|
|
|
508
509
|
```typescript
|
|
509
510
|
import { randomUUID } from 'node:crypto';
|
|
510
|
-
import {
|
|
511
|
-
|
|
511
|
+
import {
|
|
512
|
+
createAdcpServerFromPlatform,
|
|
513
|
+
serve,
|
|
514
|
+
createIdempotencyStore,
|
|
515
|
+
memoryBackend,
|
|
516
|
+
type DecisioningPlatform,
|
|
517
|
+
type CampaignGovernancePlatform,
|
|
518
|
+
type PropertyListsPlatform,
|
|
519
|
+
type AccountStore,
|
|
520
|
+
} from '@adcp/sdk/server';
|
|
512
521
|
|
|
513
522
|
const idempotency = createIdempotencyStore({
|
|
514
523
|
backend: memoryBackend(),
|
|
515
524
|
ttlSeconds: 86400,
|
|
516
525
|
});
|
|
517
526
|
|
|
527
|
+
class MyGovernance implements DecisioningPlatform {
|
|
528
|
+
capabilities = {
|
|
529
|
+
specialisms: ['governance-spend-authority', 'property-lists'] as const,
|
|
530
|
+
config: {},
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
accounts: AccountStore = {
|
|
534
|
+
resolve: async ref => ({
|
|
535
|
+
id: 'account_id' in ref ? ref.account_id : 'gov_acc_1',
|
|
536
|
+
operator: 'me',
|
|
537
|
+
ctx_metadata: {},
|
|
538
|
+
}),
|
|
539
|
+
upsert: async () => ({ ok: true, items: [] }),
|
|
540
|
+
list: async () => ({ items: [], nextCursor: null }),
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
campaignGovernance: CampaignGovernancePlatform = {
|
|
544
|
+
syncPlans: async (req, ctx) => {
|
|
545
|
+
for (const plan of req.plans) {
|
|
546
|
+
await ctx.store.put('plan', plan.plan_id, plan);
|
|
547
|
+
}
|
|
548
|
+
return {
|
|
549
|
+
plans: req.plans.map(p => ({
|
|
550
|
+
plan_id: p.plan_id,
|
|
551
|
+
status: 'active' as const,
|
|
552
|
+
version: 1,
|
|
553
|
+
})),
|
|
554
|
+
};
|
|
555
|
+
},
|
|
556
|
+
checkGovernance: async (req, ctx) => {
|
|
557
|
+
const plan = await ctx.store.get('plan', req.plan_id);
|
|
558
|
+
// ... decision logic ...
|
|
559
|
+
return {
|
|
560
|
+
check_id: `chk_${randomUUID()}`,
|
|
561
|
+
status: 'approved' as const,
|
|
562
|
+
plan_id: req.plan_id,
|
|
563
|
+
explanation: 'Within spending authority',
|
|
564
|
+
};
|
|
565
|
+
},
|
|
566
|
+
// ... reportPlanOutcome, getPlanAuditLogs, etc.
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
propertyLists: PropertyListsPlatform = {
|
|
570
|
+
listPropertyLists: async (req, ctx) => ({ property_lists: [] }),
|
|
571
|
+
createPropertyList: async (req, ctx) => ({ /* ... */ }),
|
|
572
|
+
updatePropertyList: async (req, ctx) => ({ /* ... */ }),
|
|
573
|
+
deletePropertyList: async (req, ctx) => ({ /* ... */ }),
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
const platform = new MyGovernance();
|
|
578
|
+
|
|
518
579
|
serve(() =>
|
|
519
|
-
|
|
580
|
+
createAdcpServerFromPlatform(platform, {
|
|
520
581
|
name: 'Governance Agent',
|
|
521
582
|
version: '1.0.0',
|
|
522
583
|
idempotency,
|
|
523
|
-
// MUST never return undefined — or every mutating request rejects as
|
|
524
|
-
// SERVICE_UNAVAILABLE. See the Idempotency section for production guidance.
|
|
525
|
-
resolveSessionKey: () => 'default-principal',
|
|
526
|
-
|
|
527
|
-
governance: {
|
|
528
|
-
syncPlans: async (params, ctx) => {
|
|
529
|
-
for (const plan of params.plans) {
|
|
530
|
-
await ctx.store.put('plan', plan.plan_id, plan);
|
|
531
|
-
}
|
|
532
|
-
return {
|
|
533
|
-
plans: params.plans.map(p => ({
|
|
534
|
-
plan_id: p.plan_id,
|
|
535
|
-
status: 'active' as const,
|
|
536
|
-
version: 1,
|
|
537
|
-
})),
|
|
538
|
-
};
|
|
539
|
-
},
|
|
540
|
-
checkGovernance: async (params, ctx) => {
|
|
541
|
-
const plan = await ctx.store.get('plan', params.plan_id);
|
|
542
|
-
// ... decision logic ...
|
|
543
|
-
return {
|
|
544
|
-
check_id: `chk_${randomUUID()}`,
|
|
545
|
-
status: 'approved' as const,
|
|
546
|
-
plan_id: params.plan_id,
|
|
547
|
-
explanation: 'Within spending authority',
|
|
548
|
-
};
|
|
549
|
-
},
|
|
550
|
-
// ... other governance handlers
|
|
551
|
-
},
|
|
552
584
|
})
|
|
553
585
|
);
|
|
554
586
|
```
|
|
@@ -568,7 +600,7 @@ Route decisions based on the plan state and request parameters:
|
|
|
568
600
|
|
|
569
601
|
## Idempotency
|
|
570
602
|
|
|
571
|
-
AdCP v3 requires an `idempotency_key` on every mutating request — for governance agents that's `create_property_list` / `update_property_list` / `delete_property_list`, `create_content_standards` / `update_content_standards`, `sync_plans`, and `report_plan_outcome` (`check_governance` and the various `get_*` / `list_*` tools are read-only and exempt).
|
|
603
|
+
AdCP v3 requires an `idempotency_key` on every mutating request — for governance agents that's `create_property_list` / `update_property_list` / `delete_property_list`, `create_content_standards` / `update_content_standards`, `sync_plans`, and `report_plan_outcome` (`check_governance` and the various `get_*` / `list_*` tools are read-only and exempt). Pass `createIdempotencyStore` from `@adcp/sdk/server` to `createAdcpServerFromPlatform(platform, { idempotency })` and the framework handles missing-key rejection (`INVALID_REQUEST`), JCS-canonicalized payload hashing, `IDEMPOTENCY_CONFLICT` on same-key-different-payload (no payload leaked in the error), `IDEMPOTENCY_EXPIRED` past the TTL, `replayed: true` envelope injection on cache hits, and automatic declaration of `adcp.idempotency.replay_ttl_seconds` on `get_adcp_capabilities`. Only successful responses cache — errors re-execute on retry so a failed `sync_plans` or outcome report can be retried cleanly. Scoping is per-principal via `resolveSessionKey` (or override with `resolveIdempotencyPrincipal`) — typically the operator / tenant id.
|
|
572
604
|
|
|
573
605
|
```typescript
|
|
574
606
|
import { createIdempotencyStore, memoryBackend } from '@adcp/sdk/server';
|
|
@@ -578,14 +610,13 @@ const idempotency = createIdempotencyStore({
|
|
|
578
610
|
ttlSeconds: 86400, // 3600–604800 per spec; throws if out of range
|
|
579
611
|
});
|
|
580
612
|
|
|
581
|
-
const server =
|
|
613
|
+
const server = createAdcpServerFromPlatform(platform, {
|
|
614
|
+
name: '...', version: '...',
|
|
582
615
|
idempotency,
|
|
583
616
|
// MUST never return undefined — or every mutating request rejects as
|
|
584
|
-
// SERVICE_UNAVAILABLE. A constant works for a demo;
|
|
585
|
-
//
|
|
586
|
-
// and use `(ctx) => ctx.account?.id`.
|
|
617
|
+
// SERVICE_UNAVAILABLE. A constant works for a demo; production uses
|
|
618
|
+
// `(ctx) => ctx.account?.id` against the typed `Account<MyMeta>`.
|
|
587
619
|
resolveSessionKey: () => 'default-principal',
|
|
588
|
-
// ... governance handlers (create/update/delete property lists, content standards, syncPlans, reportPlanOutcome)
|
|
589
620
|
});
|
|
590
621
|
```
|
|
591
622
|
|
|
@@ -36,7 +36,7 @@ Attribution linkage (`log_event.content_ids` → catalog `item_id` → `media_bu
|
|
|
36
36
|
|
|
37
37
|
Full treatment in `skills/build-seller-agent/SKILL.md` §Protocol-Wide Requirements and §Composing — a retail-media agent inherits all the baseline-seller requirements. Minimum viable pointers:
|
|
38
38
|
|
|
39
|
-
- **`idempotency_key`** on every mutating request (`create_media_buy`, `update_media_buy`, `sync_accounts`, `sync_creatives`, `sync_catalogs`, `sync_event_sources`, `log_event`, `provide_performance_feedback`).
|
|
39
|
+
- **`idempotency_key`** on every mutating request (`create_media_buy`, `update_media_buy`, `sync_accounts`, `sync_creatives`, `sync_catalogs`, `sync_event_sources`, `log_event`, `provide_performance_feedback`). Pass `createIdempotencyStore` to `createAdcpServerFromPlatform(platform, { idempotency })`.
|
|
40
40
|
- **Authentication** via `serve({ authenticate })`. Unauthenticated agents fail the universal `security_baseline` storyboard.
|
|
41
41
|
- **Signature-header transparency**: accept `Signature-Input`/`Signature` headers even if you don't claim `signed-requests`.
|
|
42
42
|
|
|
@@ -73,7 +73,7 @@ Does the buyer send performance metrics back for optimization?
|
|
|
73
73
|
>
|
|
74
74
|
> **Cross-cutting pitfalls matrix runs keep catching:**
|
|
75
75
|
>
|
|
76
|
-
> - **Declare `capabilities
|
|
76
|
+
> - **Declare `capabilities.specialisms: ['sales-catalog-driven'] as const` on the `DecisioningPlatform` you pass to `createAdcpServerFromPlatform`.** Value is `string[]` of enum ids (not `[{id, version}]`). Agents that don't declare their specialism fail the grader with "No applicable tracks found" even if every tool works — tracks are gated on the specialism claim.
|
|
77
77
|
> - `get_media_buy_delivery` response requires **top-level `currency: string`** (ISO 4217).
|
|
78
78
|
> - `get_media_buy_delivery /media_buy_deliveries[i]/by_package[j]` rows require `package_id`, `spend`, `pricing_model`, `rate`, `currency`. Mock handlers that return `{package_id, impressions, clicks}` fail validation — include the billing quintet on every package row.
|
|
79
79
|
> - `get_media_buy_delivery /reporting_period/start` and `/end` are ISO 8601 **date-time** strings (`new Date().toISOString()`), not date-only. `'2026-04-21'` fails the GA format check.
|
|
@@ -82,7 +82,7 @@ Does the buyer send performance metrics back for optimization?
|
|
|
82
82
|
|
|
83
83
|
All standard seller tools apply (see `skills/build-seller-agent/SKILL.md`). The additional tools:
|
|
84
84
|
|
|
85
|
-
**`get_adcp_capabilities`** — auto-generated by `
|
|
85
|
+
**`get_adcp_capabilities`** — auto-generated by `createAdcpServerFromPlatform` from the typed `DecisioningPlatform` you provide. Do not implement manually.
|
|
86
86
|
|
|
87
87
|
**`sync_accounts`** — `SyncAccountsRequestSchema.shape`
|
|
88
88
|
|
|
@@ -219,7 +219,7 @@ deliveryResponse({
|
|
|
219
219
|
|
|
220
220
|
### Context and Ext Passthrough
|
|
221
221
|
|
|
222
|
-
|
|
222
|
+
The framework auto-echoes the request's `context` into every response — **do not set `context` yourself in your handler return values.** It's injected post-handler only when the field isn't already present.
|
|
223
223
|
|
|
224
224
|
**Crucial:** `context` is schema-typed as an object. If your handler hand-sets a string or narrative description, validation fails with `/context: must be object` and the framework does not overwrite. Leave the field out entirely.
|
|
225
225
|
|
|
@@ -256,8 +256,9 @@ Validate with: `adcp storyboard run <agent> deterministic_testing --json`
|
|
|
256
256
|
|
|
257
257
|
| SDK piece | Usage |
|
|
258
258
|
| --------------------------------------- | ----------------------------------------------------------------------- |
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
259
|
+
| `createAdcpServerFromPlatform(platform, opts)` | Create server from a typed `DecisioningPlatform` — compile-time specialism enforcement, ctx_metadata round-trip, auto-generated capabilities |
|
|
260
|
+
| `createAdcpServer(config)` *(legacy)* | v5 handler-bag entry. Mid-migration / escape-hatch only; reach via `@adcp/sdk/server/legacy/v5` |
|
|
261
|
+
| `serve(() => createAdcpServerFromPlatform(platform, opts))` | Start HTTP server on `:3001/mcp` |
|
|
261
262
|
| `ctx.store` | State persistence — `get/put/patch/delete/list` domain objects |
|
|
262
263
|
| `adcpError(code, { message })` | Structured error |
|
|
263
264
|
| `registerTestController(server, store)` | Add `comply_test_controller` for deterministic testing |
|
|
@@ -266,7 +267,7 @@ Response builders (`productsResponse`, `mediaBuyResponse`, `deliveryResponse`, e
|
|
|
266
267
|
|
|
267
268
|
`get_adcp_capabilities` is auto-generated from registered handlers. Do not register it manually.
|
|
268
269
|
|
|
269
|
-
Import: `import {
|
|
270
|
+
Import: `import { createAdcpServerFromPlatform, serve, adcpError } from '@adcp/sdk/server';`
|
|
270
271
|
|
|
271
272
|
## Setup
|
|
272
273
|
|
|
@@ -296,18 +297,26 @@ Minimal `tsconfig.json`:
|
|
|
296
297
|
## Implementation
|
|
297
298
|
|
|
298
299
|
1. Single `.ts` file — all tools in one file
|
|
299
|
-
2. Use `
|
|
300
|
+
2. Use `createAdcpServerFromPlatform` with `sales` (incl. `syncCatalogs`/`syncEventSources`/`logEvent`/`syncAudiences`) on a typed `DecisioningPlatform` class
|
|
300
301
|
3. Handlers return raw data objects — the framework auto-applies response builders
|
|
301
302
|
4. `get_adcp_capabilities` is auto-generated from registered handlers — do not register it manually
|
|
302
303
|
5. Use `ctx.store` for state persistence (accounts, media buys, catalogs)
|
|
303
304
|
6. Set `sandbox: true` on all mock/demo responses
|
|
304
305
|
|
|
305
|
-
|
|
306
|
+
Catalog/event/audience methods (`syncCatalogs`, `syncEventSources`, `logEvent`, `syncAudiences`, `providePerformanceFeedback`) live on the `sales: SalesPlatform` field — they're optional methods on the same interface as `getProducts`/`createMediaBuy`/etc. (See `src/lib/server/decisioning/specialisms/sales.ts`.)
|
|
306
307
|
|
|
307
308
|
```typescript
|
|
308
309
|
import { randomUUID } from 'node:crypto';
|
|
309
|
-
import {
|
|
310
|
-
|
|
310
|
+
import {
|
|
311
|
+
createAdcpServerFromPlatform,
|
|
312
|
+
serve,
|
|
313
|
+
adcpError,
|
|
314
|
+
createIdempotencyStore,
|
|
315
|
+
memoryBackend,
|
|
316
|
+
type DecisioningPlatform,
|
|
317
|
+
type SalesPlatform,
|
|
318
|
+
type AccountStore,
|
|
319
|
+
} from '@adcp/sdk/server';
|
|
311
320
|
|
|
312
321
|
// Idempotency — required for v3. Retail media has many mutating tools:
|
|
313
322
|
// create/update_media_buy, sync_creatives, sync_catalogs, sync_event_sources,
|
|
@@ -318,61 +327,77 @@ const idempotency = createIdempotencyStore({
|
|
|
318
327
|
ttlSeconds: 86400, // 24 hours (spec bounds: 1h–7d)
|
|
319
328
|
});
|
|
320
329
|
|
|
330
|
+
class MyRetailMedia implements DecisioningPlatform {
|
|
331
|
+
capabilities = {
|
|
332
|
+
specialisms: ['sales-non-guaranteed', 'sales-catalog-driven'] as const,
|
|
333
|
+
pricingModels: ['cpm'] as const,
|
|
334
|
+
channels: ['display'] as const,
|
|
335
|
+
config: {},
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
accounts: AccountStore = {
|
|
339
|
+
resolve: async ref => ({
|
|
340
|
+
id: 'account_id' in ref ? ref.account_id : 'rm_acc_1',
|
|
341
|
+
operator: 'me',
|
|
342
|
+
ctx_metadata: {},
|
|
343
|
+
}),
|
|
344
|
+
upsert: async () => ({ ok: true, items: [] }),
|
|
345
|
+
list: async () => ({ items: [], nextCursor: null }),
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
sales: SalesPlatform = {
|
|
349
|
+
getProducts: async (req, ctx) => ({ products: PRODUCTS, sandbox: true }),
|
|
350
|
+
createMediaBuy: async (req, ctx) => {
|
|
351
|
+
const buy = {
|
|
352
|
+
media_buy_id: `mb_${randomUUID()}`,
|
|
353
|
+
status: 'pending_creatives' as const,
|
|
354
|
+
packages:
|
|
355
|
+
req.packages?.map(p => ({
|
|
356
|
+
package_id: `pkg_${randomUUID()}`,
|
|
357
|
+
product_id: p.product_id,
|
|
358
|
+
pricing_option_id: p.pricing_option_id,
|
|
359
|
+
budget: p.budget,
|
|
360
|
+
})) ?? [],
|
|
361
|
+
};
|
|
362
|
+
await ctx.store.put('media_buys', buy.media_buy_id, buy);
|
|
363
|
+
return buy;
|
|
364
|
+
},
|
|
365
|
+
updateMediaBuy: async (id, patch, ctx) => ({ media_buy_id: id, status: 'active' }),
|
|
366
|
+
getMediaBuys: async () => ({ media_buys: [] }),
|
|
367
|
+
getMediaBuyDelivery: async () => ({ deliveries: [] }),
|
|
368
|
+
syncCreatives: async () => [],
|
|
369
|
+
listCreativeFormats: async () => ({ formats: [] }),
|
|
370
|
+
|
|
371
|
+
// Catalog-driven specialism methods — all optional on SalesPlatform.
|
|
372
|
+
syncCatalogs: async (req, ctx) => ({
|
|
373
|
+
catalogs: req.catalogs.map(c => ({
|
|
374
|
+
catalog_id: c.catalog_id,
|
|
375
|
+
action: 'created' as const,
|
|
376
|
+
item_count: c.items?.length ?? 0,
|
|
377
|
+
items_approved: c.items?.length ?? 0,
|
|
378
|
+
})),
|
|
379
|
+
}),
|
|
380
|
+
syncEventSources: async (req, ctx) => ({
|
|
381
|
+
event_sources: req.event_sources.map(s => ({
|
|
382
|
+
event_source_id: s.event_source_id,
|
|
383
|
+
action: 'created' as const,
|
|
384
|
+
})),
|
|
385
|
+
}),
|
|
386
|
+
logEvent: async (req, ctx) => ({
|
|
387
|
+
events_received: req.events?.length ?? 0,
|
|
388
|
+
events_processed: req.events?.length ?? 0,
|
|
389
|
+
}),
|
|
390
|
+
providePerformanceFeedback: async (req, ctx) => ({ feedback_id: `fb_${randomUUID()}` }),
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const platform = new MyRetailMedia();
|
|
395
|
+
|
|
321
396
|
serve(() =>
|
|
322
|
-
|
|
397
|
+
createAdcpServerFromPlatform(platform, {
|
|
323
398
|
name: 'My Retail Media Agent',
|
|
324
399
|
version: '1.0.0',
|
|
325
400
|
idempotency,
|
|
326
|
-
|
|
327
|
-
// Principal scoping. MUST never return undefined — or every mutating
|
|
328
|
-
// request rejects as SERVICE_UNAVAILABLE. Multi-tenant prod uses
|
|
329
|
-
// ctx.account.
|
|
330
|
-
resolveSessionKey: () => 'default-principal',
|
|
331
|
-
|
|
332
|
-
mediaBuy: {
|
|
333
|
-
getProducts: async (params, ctx) => ({ products: PRODUCTS, sandbox: true }),
|
|
334
|
-
createMediaBuy: async (params, ctx) => {
|
|
335
|
-
const buy = {
|
|
336
|
-
media_buy_id: `mb_${randomUUID()}`,
|
|
337
|
-
status: 'pending_creatives' as const,
|
|
338
|
-
packages:
|
|
339
|
-
params.packages?.map(p => ({
|
|
340
|
-
package_id: `pkg_${randomUUID()}`,
|
|
341
|
-
product_id: p.product_id,
|
|
342
|
-
pricing_option_id: p.pricing_option_id,
|
|
343
|
-
budget: p.budget,
|
|
344
|
-
})) ?? [],
|
|
345
|
-
};
|
|
346
|
-
await ctx.store.put('media_buys', buy.media_buy_id, buy);
|
|
347
|
-
return buy;
|
|
348
|
-
},
|
|
349
|
-
// ... updateMediaBuy, getMediaBuyDelivery, syncCreatives, listCreativeFormats
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
eventTracking: {
|
|
353
|
-
syncCatalogs: async (params, ctx) => ({
|
|
354
|
-
catalogs: params.catalogs.map(c => ({
|
|
355
|
-
catalog_id: c.catalog_id,
|
|
356
|
-
action: 'created' as const,
|
|
357
|
-
item_count: c.items?.length ?? 0,
|
|
358
|
-
items_approved: c.items?.length ?? 0,
|
|
359
|
-
})),
|
|
360
|
-
sandbox: true,
|
|
361
|
-
}),
|
|
362
|
-
syncEventSources: async (params, ctx) => ({
|
|
363
|
-
event_sources: params.event_sources.map(s => ({
|
|
364
|
-
event_source_id: s.event_source_id,
|
|
365
|
-
action: 'created' as const,
|
|
366
|
-
})),
|
|
367
|
-
sandbox: true,
|
|
368
|
-
}),
|
|
369
|
-
logEvent: async (params, ctx) => ({
|
|
370
|
-
events_received: params.events?.length ?? 0,
|
|
371
|
-
events_processed: params.events?.length ?? 0,
|
|
372
|
-
sandbox: true,
|
|
373
|
-
}),
|
|
374
|
-
// ... syncAudiences
|
|
375
|
-
},
|
|
376
401
|
})
|
|
377
402
|
);
|
|
378
403
|
```
|