@adcp/sdk 15.9.1 → 16.0.0-beta.2
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/bin/adcp-identity.js +74 -0
- package/bin/adcp.js +2 -0
- package/dist/lib/adapters/keyed-account-backend.d.mts +37 -0
- package/dist/lib/adapters/keyed-account-backend.d.ts +37 -0
- package/dist/lib/adapters/keyed-account-backend.js +121 -0
- package/dist/lib/adapters/keyed-account-backend.mjs +94 -0
- package/dist/lib/adapters/keyed-account-store.d.mts +28 -0
- package/dist/lib/adapters/keyed-account-store.d.ts +28 -0
- package/dist/lib/adapters/keyed-account-store.js +227 -0
- package/dist/lib/adapters/keyed-account-store.mjs +203 -0
- package/dist/lib/core/SingleAgentClient.d.mts +25 -2
- package/dist/lib/core/SingleAgentClient.d.ts +25 -2
- package/dist/lib/core/SingleAgentClient.js +280 -62
- package/dist/lib/core/SingleAgentClient.mjs +282 -57
- package/dist/lib/core/TaskExecutor.d.mts +6 -0
- package/dist/lib/core/TaskExecutor.d.ts +6 -0
- package/dist/lib/core/TaskExecutor.js +66 -5
- package/dist/lib/core/TaskExecutor.mjs +71 -5
- package/dist/lib/core/postgres-webhook-registration-store.js +32 -5
- package/dist/lib/core/postgres-webhook-registration-store.mjs +32 -5
- package/dist/lib/core/redis-webhook-registration-store.js +23 -1
- package/dist/lib/core/redis-webhook-registration-store.mjs +23 -1
- package/dist/lib/core/webhook-registration.d.mts +7 -1
- package/dist/lib/core/webhook-registration.d.ts +7 -1
- package/dist/lib/core/webhook-registration.js +24 -2
- package/dist/lib/core/webhook-registration.mjs +23 -2
- package/dist/lib/identity-3.3/generated-compat.d.mts +34 -0
- package/dist/lib/identity-3.3/generated-compat.d.ts +34 -0
- package/dist/lib/identity-3.3/generated-compat.js +16 -0
- package/dist/lib/identity-3.3/generated-compat.mjs +0 -0
- package/dist/lib/identity-3.3/index.d.mts +10 -0
- package/dist/lib/identity-3.3/index.d.ts +10 -0
- package/dist/lib/identity-3.3/index.js +79 -0
- package/dist/lib/identity-3.3/index.mjs +50 -0
- package/dist/lib/identity-3.3/lifecycle.d.mts +125 -0
- package/dist/lib/identity-3.3/lifecycle.d.ts +125 -0
- package/dist/lib/identity-3.3/lifecycle.js +294 -0
- package/dist/lib/identity-3.3/lifecycle.mjs +272 -0
- package/dist/lib/identity-3.3/revocation.d.mts +86 -0
- package/dist/lib/identity-3.3/revocation.d.ts +86 -0
- package/dist/lib/identity-3.3/revocation.js +308 -0
- package/dist/lib/identity-3.3/revocation.mjs +286 -0
- package/dist/lib/identity-3.3/schemas.draft.d.mts +2472 -0
- package/dist/lib/identity-3.3/schemas.draft.d.ts +2472 -0
- package/dist/lib/identity-3.3/schemas.draft.js +1448 -0
- package/dist/lib/identity-3.3/schemas.draft.mjs +1428 -0
- package/dist/lib/identity-3.3/server.d.mts +46 -0
- package/dist/lib/identity-3.3/server.d.ts +46 -0
- package/dist/lib/identity-3.3/server.js +279 -0
- package/dist/lib/identity-3.3/server.mjs +260 -0
- package/dist/lib/identity-3.3/store.d.mts +24 -0
- package/dist/lib/identity-3.3/store.d.ts +24 -0
- package/dist/lib/identity-3.3/store.js +191 -0
- package/dist/lib/identity-3.3/store.mjs +169 -0
- package/dist/lib/identity-3.3/trust.d.mts +155 -0
- package/dist/lib/identity-3.3/trust.d.ts +155 -0
- package/dist/lib/identity-3.3/trust.js +383 -0
- package/dist/lib/identity-3.3/trust.mjs +342 -0
- package/dist/lib/identity-3.3/types.d.mts +155 -0
- package/dist/lib/identity-3.3/types.d.ts +155 -0
- package/dist/lib/identity-3.3/types.js +16 -0
- package/dist/lib/identity-3.3/types.mjs +0 -0
- package/dist/lib/identity-3.3/validation.d.mts +2 -0
- package/dist/lib/identity-3.3/validation.d.ts +2 -0
- package/dist/lib/identity-3.3/validation.js +125 -0
- package/dist/lib/identity-3.3/validation.mjs +91 -0
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.mjs +2 -0
- package/dist/lib/protocols/index.d.mts +1 -1
- package/dist/lib/protocols/index.d.ts +1 -1
- package/dist/lib/protocols/index.js +2 -2
- package/dist/lib/protocols/index.mjs +2 -2
- package/dist/lib/reporting/azure/index.d.mts +5 -0
- package/dist/lib/reporting/azure/index.d.ts +5 -0
- package/dist/lib/reporting/azure/index.js +26 -7
- package/dist/lib/reporting/azure/index.mjs +26 -7
- package/dist/lib/reporting/bigquery/index.d.mts +39 -5
- package/dist/lib/reporting/bigquery/index.d.ts +39 -5
- package/dist/lib/reporting/bigquery/index.js +26 -20
- package/dist/lib/reporting/bigquery/index.mjs +26 -20
- package/dist/lib/reporting/gcs/adapter.d.mts +8 -1
- package/dist/lib/reporting/gcs/adapter.d.ts +8 -1
- package/dist/lib/reporting/gcs/errors.d.mts +6 -0
- package/dist/lib/reporting/gcs/errors.d.ts +6 -0
- package/dist/lib/reporting/gcs/fence.d.mts +5 -0
- package/dist/lib/reporting/gcs/fence.d.ts +5 -0
- package/dist/lib/reporting/gcs/index.d.mts +9 -0
- package/dist/lib/reporting/gcs/index.d.ts +9 -0
- package/dist/lib/reporting/gcs/reader.d.mts +27 -3
- package/dist/lib/reporting/gcs/reader.d.ts +27 -3
- package/dist/lib/reporting/gcs/row-provider.d.mts +7 -0
- package/dist/lib/reporting/gcs/row-provider.d.ts +7 -0
- package/dist/lib/reporting/gcs/row-provider.js +34 -14
- package/dist/lib/reporting/gcs/row-provider.mjs +34 -14
- package/dist/lib/reporting/ledger/change-feed.d.mts +22 -1
- package/dist/lib/reporting/ledger/change-feed.d.ts +22 -1
- package/dist/lib/reporting/ledger/index.d.mts +11 -0
- package/dist/lib/reporting/ledger/index.d.ts +11 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +8 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +8 -0
- package/dist/lib/reporting/ledger/managed-router.d.mts +27 -2
- package/dist/lib/reporting/ledger/managed-router.d.ts +27 -2
- package/dist/lib/reporting/ledger/managed.d.mts +86 -6
- package/dist/lib/reporting/ledger/managed.d.ts +86 -6
- package/dist/lib/reporting/ledger/notification-activity.d.mts +65 -3
- package/dist/lib/reporting/ledger/notification-activity.d.ts +65 -3
- package/dist/lib/reporting/ledger/object-writes.d.mts +64 -5
- package/dist/lib/reporting/ledger/object-writes.d.ts +64 -5
- package/dist/lib/reporting/ledger/postgres.d.mts +43 -9
- package/dist/lib/reporting/ledger/postgres.d.ts +43 -9
- package/dist/lib/reporting/ledger/postgres.js +43 -27
- package/dist/lib/reporting/ledger/postgres.mjs +43 -27
- package/dist/lib/reporting/ledger/row-encoding.d.mts +92 -6
- package/dist/lib/reporting/ledger/row-encoding.d.ts +92 -6
- package/dist/lib/reporting/ledger/row-encoding.js +8 -4
- package/dist/lib/reporting/ledger/row-encoding.mjs +6 -3
- package/dist/lib/reporting/ledger/row-storage-errors.d.mts +11 -1
- package/dist/lib/reporting/ledger/row-storage-errors.d.ts +11 -1
- package/dist/lib/reporting/ledger/row-storage-migration.d.mts +19 -1
- package/dist/lib/reporting/ledger/row-storage-migration.d.ts +19 -1
- package/dist/lib/reporting/ledger/row-storage-migration.js +133 -18
- package/dist/lib/reporting/ledger/row-storage-migration.mjs +133 -18
- package/dist/lib/reporting/ledger/row-storage-object.d.mts +103 -12
- package/dist/lib/reporting/ledger/row-storage-object.d.ts +103 -12
- package/dist/lib/reporting/ledger/row-storage-object.js +106 -31
- package/dist/lib/reporting/ledger/row-storage-object.mjs +104 -31
- package/dist/lib/reporting/ledger/row-storage.d.mts +87 -20
- package/dist/lib/reporting/ledger/row-storage.d.ts +87 -20
- package/dist/lib/reporting/ledger/row-storage.js +126 -66
- package/dist/lib/reporting/ledger/row-storage.mjs +129 -67
- package/dist/lib/reporting/ledger/schedule.d.mts +13 -0
- package/dist/lib/reporting/ledger/schedule.d.ts +13 -0
- package/dist/lib/reporting/ledger/schedule.js +24 -0
- package/dist/lib/reporting/ledger/schedule.mjs +23 -0
- package/dist/lib/reporting/ledger/types.d.mts +23 -1
- package/dist/lib/reporting/ledger/types.d.ts +23 -1
- package/dist/lib/reporting/s3/index.d.mts +5 -0
- package/dist/lib/reporting/s3/index.d.ts +5 -0
- package/dist/lib/reporting/s3/index.js +37 -14
- package/dist/lib/reporting/s3/index.mjs +37 -14
- package/dist/lib/reporting/service/index.d.mts +10 -0
- package/dist/lib/reporting/service/index.d.ts +10 -0
- package/dist/lib/reporting/service/maintenance.d.mts +28 -2
- package/dist/lib/reporting/service/maintenance.d.ts +28 -2
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/account-sync-contract.d.mts +14 -0
- package/dist/lib/server/account-sync-contract.d.ts +14 -0
- package/dist/lib/server/account-sync-contract.js +225 -0
- package/dist/lib/server/account-sync-contract.mjs +197 -0
- package/dist/lib/server/adcp-server.js +5 -0
- package/dist/lib/server/adcp-server.mjs +10 -0
- package/dist/lib/server/auth-signature.d.mts +15 -0
- package/dist/lib/server/auth-signature.d.ts +15 -0
- package/dist/lib/server/auth-signature.js +72 -2
- package/dist/lib/server/auth-signature.mjs +81 -2
- package/dist/lib/server/auth.d.mts +6 -0
- package/dist/lib/server/auth.d.ts +6 -0
- package/dist/lib/server/auth.js +6 -0
- package/dist/lib/server/auth.mjs +6 -0
- package/dist/lib/server/create-adcp-server.d.mts +19 -5
- package/dist/lib/server/create-adcp-server.d.ts +19 -5
- package/dist/lib/server/create-adcp-server.js +259 -19
- package/dist/lib/server/create-adcp-server.mjs +266 -10
- package/dist/lib/server/decisioning/account.d.mts +24 -1
- package/dist/lib/server/decisioning/account.d.ts +24 -1
- package/dist/lib/server/decisioning/index.d.mts +1 -1
- package/dist/lib/server/decisioning/index.d.ts +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.d.mts +0 -50
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +0 -50
- package/dist/lib/server/decisioning/runtime/from-platform.js +61 -11
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +65 -12
- package/dist/lib/server/index.d.mts +2 -0
- package/dist/lib/server/index.d.ts +2 -0
- package/dist/lib/server/index.js +12 -0
- package/dist/lib/server/index.mjs +12 -0
- package/dist/lib/server/notification-subscriptions/runtime.js +9 -1
- package/dist/lib/server/notification-subscriptions/runtime.mjs +9 -1
- package/dist/lib/server/notification-subscriptions/types.d.mts +5 -0
- package/dist/lib/server/notification-subscriptions/types.d.ts +5 -0
- package/dist/lib/server/principal/types.d.mts +1 -1
- package/dist/lib/server/principal/types.d.ts +1 -1
- package/dist/lib/server/serve.js +5 -0
- package/dist/lib/server/serve.mjs +5 -0
- package/dist/lib/server/webhook-delivery/recovery.d.mts +1 -0
- package/dist/lib/server/webhook-delivery/recovery.d.ts +1 -0
- package/dist/lib/server/webhook-delivery/recovery.js +4 -0
- package/dist/lib/server/webhook-delivery/recovery.mjs +4 -0
- package/dist/lib/server/webhook-emitter.d.mts +10 -0
- package/dist/lib/server/webhook-emitter.d.ts +10 -0
- package/dist/lib/server/webhook-emitter.js +22 -0
- package/dist/lib/server/webhook-emitter.mjs +22 -0
- package/dist/lib/signing/agent-context.d.mts +0 -5
- package/dist/lib/signing/agent-context.d.ts +0 -5
- package/dist/lib/signing/agent-context.js +9 -1
- package/dist/lib/signing/agent-context.mjs +9 -1
- package/dist/lib/signing/agent-fetch.js +27 -2
- package/dist/lib/signing/agent-fetch.mjs +32 -2
- package/dist/lib/signing/agent-resolver/canonicalize.d.mts +10 -15
- package/dist/lib/signing/agent-resolver/canonicalize.d.ts +10 -15
- package/dist/lib/signing/agent-resolver/canonicalize.js +17 -5
- package/dist/lib/signing/agent-resolver/canonicalize.mjs +16 -5
- package/dist/lib/signing/agent-resolver/index.d.mts +1 -0
- package/dist/lib/signing/agent-resolver/index.d.ts +1 -0
- package/dist/lib/signing/agent-resolver/index.js +5 -0
- package/dist/lib/signing/agent-resolver/index.mjs +3 -0
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.mts +3 -2
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.ts +3 -2
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.js +30 -3
- package/dist/lib/signing/agent-resolver/resolved-agent-jwks.mjs +30 -3
- package/dist/lib/signing/agent-resolver/strict-json.d.mts +2 -2
- package/dist/lib/signing/agent-resolver/strict-json.d.ts +2 -2
- package/dist/lib/signing/agent-resolver/strict-json.js +5 -3
- package/dist/lib/signing/agent-resolver/strict-json.mjs +5 -3
- package/dist/lib/signing/brand-jwks.d.mts +2 -2
- package/dist/lib/signing/brand-jwks.d.ts +2 -2
- package/dist/lib/signing/brand-jwks.js +4 -4
- package/dist/lib/signing/brand-jwks.mjs +4 -4
- package/dist/lib/signing/client.d.mts +1 -0
- package/dist/lib/signing/client.d.ts +1 -0
- package/dist/lib/signing/client.js +5 -0
- package/dist/lib/signing/client.mjs +3 -0
- package/dist/lib/signing/crypto.js +8 -0
- package/dist/lib/signing/crypto.mjs +9 -1
- package/dist/lib/signing/fetch-async.js +1 -1
- package/dist/lib/signing/fetch-async.mjs +1 -1
- package/dist/lib/signing/fetch.js +1 -1
- package/dist/lib/signing/fetch.mjs +1 -1
- package/dist/lib/signing/jwks-https.d.mts +1 -1
- package/dist/lib/signing/jwks-https.d.ts +1 -1
- package/dist/lib/signing/jwks-https.js +1 -1
- package/dist/lib/signing/jwks-https.mjs +1 -1
- package/dist/lib/signing/jwks.d.mts +11 -3
- package/dist/lib/signing/jwks.d.ts +11 -3
- package/dist/lib/signing/jwks.js +1 -1
- package/dist/lib/signing/jwks.mjs +1 -1
- package/dist/lib/signing/middleware.js +9 -0
- package/dist/lib/signing/middleware.mjs +14 -0
- package/dist/lib/signing/parser.d.mts +9 -6
- package/dist/lib/signing/parser.d.ts +9 -6
- package/dist/lib/signing/parser.js +82 -64
- package/dist/lib/signing/parser.mjs +83 -65
- package/dist/lib/signing/revocation.d.mts +4 -1
- package/dist/lib/signing/revocation.d.ts +4 -1
- package/dist/lib/signing/revocation.js +36 -3
- package/dist/lib/signing/revocation.mjs +34 -2
- package/dist/lib/signing/server.d.mts +1 -1
- package/dist/lib/signing/server.d.ts +1 -1
- package/dist/lib/signing/server.js +4 -0
- package/dist/lib/signing/server.mjs +4 -0
- package/dist/lib/signing/types.d.mts +3 -0
- package/dist/lib/signing/types.d.ts +3 -0
- package/dist/lib/signing/verifier.js +1 -1
- package/dist/lib/signing/verifier.mjs +1 -1
- package/dist/lib/signing/web-bot-auth.d.mts +191 -0
- package/dist/lib/signing/web-bot-auth.d.ts +191 -0
- package/dist/lib/signing/web-bot-auth.js +837 -0
- package/dist/lib/signing/web-bot-auth.mjs +796 -0
- package/dist/lib/signing/webhook-verifier.js +1 -1
- package/dist/lib/signing/webhook-verifier.mjs +1 -1
- package/dist/lib/testing/client.d.mts +1 -4
- package/dist/lib/testing/client.d.ts +1 -4
- package/dist/lib/testing/client.js +141 -20
- package/dist/lib/testing/client.mjs +137 -19
- package/dist/lib/testing/compliance/comply.js +29 -10
- package/dist/lib/testing/compliance/comply.mjs +37 -11
- package/dist/lib/testing/storyboard/account-sync-contract.d.mts +3 -0
- package/dist/lib/testing/storyboard/account-sync-contract.d.ts +3 -0
- package/dist/lib/testing/storyboard/account-sync-contract.js +79 -0
- package/dist/lib/testing/storyboard/account-sync-contract.mjs +55 -0
- package/dist/lib/testing/storyboard/default-invariants.js +2 -0
- package/dist/lib/testing/storyboard/default-invariants.mjs +2 -0
- package/dist/lib/testing/storyboard/runner.js +23 -8
- package/dist/lib/testing/storyboard/runner.mjs +24 -8
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/types/adcp.d.mts +4 -0
- package/dist/lib/types/adcp.d.ts +4 -0
- package/dist/lib/types/schemas.generated.d.ts +6 -6
- package/dist/lib/utils/capabilities.d.mts +1 -0
- package/dist/lib/utils/capabilities.d.ts +1 -0
- package/dist/lib/utils/capabilities.js +5 -0
- package/dist/lib/utils/capabilities.mjs +5 -0
- package/dist/lib/v2/projection/catalog-snapshot.js +3 -1
- package/dist/lib/v2/projection/catalog-snapshot.mjs +3 -1
- package/dist/lib/v2/projection/creative-delivery.d.mts +34 -10
- package/dist/lib/v2/projection/creative-delivery.d.ts +34 -10
- package/dist/lib/v2/projection/creative-delivery.js +26 -10
- package/dist/lib/v2/projection/creative-delivery.mjs +26 -10
- package/dist/lib/v2/projection/index.d.mts +1 -1
- package/dist/lib/v2/projection/index.d.ts +1 -1
- package/dist/lib/v2/projection/index.js +2 -0
- package/dist/lib/v2/projection/index.mjs +2 -0
- package/dist/lib/v2/projection/legacy-routes.d.mts +34 -2
- package/dist/lib/v2/projection/legacy-routes.d.ts +34 -2
- package/dist/lib/v2/projection/legacy-routes.js +35 -2
- package/dist/lib/v2/projection/legacy-routes.mjs +32 -2
- package/dist/lib/validation/schema-loader.d.mts +2 -0
- package/dist/lib/validation/schema-loader.d.ts +2 -0
- package/dist/lib/validation/schema-loader.js +43 -4
- package/dist/lib/validation/schema-loader.mjs +39 -3
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +4 -0
- package/docs/guides/REPORTING-LEDGER-CUTOVER.md +1 -1
- package/docs/guides/REPORTING-LEDGER.md +99 -29
- package/docs/guides/REPORTING-OPERATIONS.md +29 -13
- package/docs/guides/REPORTING-STABILITY.md +76 -0
- package/docs/guides/account-resolution.md +101 -0
- package/docs/llms.txt +3 -2
- package/docs/migration-12-to-13.md +15 -0
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-agent-identity-3.3.md +494 -0
- package/docs/migration-agent-resolution-3.3.md +5 -0
- package/docs/migration-reporting-row-storage-alignment.md +137 -0
- package/examples/storyboards/account-sync-contract.yaml +57 -0
- package/package.json +17 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { isDeepStrictEqual } from "node:util";
|
|
3
|
+
import { accountReferenceKey } from "../core/account-key.mjs";
|
|
4
|
+
import { defaultImplicitKeyFn } from "./implicit-account-store.mjs";
|
|
5
|
+
import { AdcpError } from "../server/decisioning/async-outcome.mjs";
|
|
6
|
+
import { toWireAccount } from "../server/decisioning/account.mjs";
|
|
7
|
+
import { isSandboxOrMockAccount } from "../server/account-mode.mjs";
|
|
8
|
+
import { isolateAccountCallbackInput } from "../server/account-sync-contract.mjs";
|
|
9
|
+
function entryRef(entry) {
|
|
10
|
+
return entry.account ?? entry;
|
|
11
|
+
}
|
|
12
|
+
function recordFor(records, ref) {
|
|
13
|
+
return "account_id" in ref ? records.find((row) => row.account.id === ref.account_id) : records.find((row) => row.key === accountReferenceKey(ref));
|
|
14
|
+
}
|
|
15
|
+
function resultRow(account, action) {
|
|
16
|
+
const wire = toWireAccount(account);
|
|
17
|
+
return { ...wire, brand: account.brand, operator: account.operator, action };
|
|
18
|
+
}
|
|
19
|
+
function createKeyedAccountStore(options) {
|
|
20
|
+
if (!options.namespace) throw new TypeError("A keyed account store requires a namespace");
|
|
21
|
+
const maxAccounts = options.maxAccounts ?? 1e3;
|
|
22
|
+
if (!Number.isSafeInteger(maxAccounts) || maxAccounts < 1)
|
|
23
|
+
throw new TypeError("maxAccounts must be a positive integer");
|
|
24
|
+
const principalKey = options.principalKey ?? ((ctx) => ctx?.authInfo ? defaultImplicitKeyFn(ctx.authInfo) : void 0);
|
|
25
|
+
const scopeFor = async (ctx) => {
|
|
26
|
+
const principal = await principalKey(options.principalKey && ctx ? isolateAccountCallbackInput(ctx) : ctx);
|
|
27
|
+
if (typeof principal !== "string" || !principal.trim())
|
|
28
|
+
throw new AdcpError("AUTH_MISSING", {
|
|
29
|
+
message: "An authenticated account principal is required.",
|
|
30
|
+
recovery: "terminal"
|
|
31
|
+
});
|
|
32
|
+
return JSON.stringify([options.namespace, principal]);
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
resolution: options.resolution ?? "explicit",
|
|
36
|
+
strictIdempotency: true,
|
|
37
|
+
async resolve(ref, ctx) {
|
|
38
|
+
const records = (await options.backend.load(await scopeFor(ctx)))?.records ?? [];
|
|
39
|
+
return ref ? recordFor(records, ref)?.account ?? null : records.length === 1 ? records[0].account : null;
|
|
40
|
+
},
|
|
41
|
+
async upsert(entries, ctx) {
|
|
42
|
+
const dryRun = ctx?.input?.dry_run === true;
|
|
43
|
+
const deleteMissing = ctx?.input?.delete_missing === true;
|
|
44
|
+
const input = ctx?.input === void 0 ? void 0 : structuredClone(ctx.input);
|
|
45
|
+
entries = structuredClone(entries);
|
|
46
|
+
const scope = await scopeFor(ctx);
|
|
47
|
+
if (deleteMissing)
|
|
48
|
+
throw new AdcpError("UNSUPPORTED_FEATURE", {
|
|
49
|
+
message: "The keyed account store uses additive syncs; close accounts explicitly.",
|
|
50
|
+
recovery: "terminal"
|
|
51
|
+
});
|
|
52
|
+
for (let attempt = 0; attempt < 10; attempt++) {
|
|
53
|
+
const snapshot = await options.backend.load(scope);
|
|
54
|
+
const records = structuredClone(snapshot?.records ?? []);
|
|
55
|
+
const rows = [];
|
|
56
|
+
for (const entry of entries) {
|
|
57
|
+
const ref = entryRef(entry);
|
|
58
|
+
if ("account_id" in ref && !recordFor(records, ref))
|
|
59
|
+
throw new AdcpError("ACCOUNT_NOT_FOUND", { message: "Account not found", recovery: "terminal" });
|
|
60
|
+
}
|
|
61
|
+
for (const entry of entries) {
|
|
62
|
+
const ref = entryRef(entry);
|
|
63
|
+
const hit = recordFor(records, ref);
|
|
64
|
+
const source = hit?.ref ?? ref;
|
|
65
|
+
const natural = {
|
|
66
|
+
brand: source.brand,
|
|
67
|
+
operator: source.operator,
|
|
68
|
+
...source.operator_unit !== void 0 && { operator_unit: source.operator_unit },
|
|
69
|
+
...source.currency !== void 0 && { currency: source.currency },
|
|
70
|
+
...source.timezone !== void 0 && { timezone: source.timezone },
|
|
71
|
+
...source.sandbox !== void 0 && { sandbox: source.sandbox }
|
|
72
|
+
};
|
|
73
|
+
const key = accountReferenceKey(natural);
|
|
74
|
+
const accountId = hit?.account.id ?? `acct_${createHash("sha256").update(JSON.stringify([scope, key])).digest("hex")}`;
|
|
75
|
+
try {
|
|
76
|
+
if (!hit && records.length >= maxAccounts)
|
|
77
|
+
throw new AdcpError("INVALID_REQUEST", {
|
|
78
|
+
message: "The account limit for this principal has been reached.",
|
|
79
|
+
recovery: "correctable"
|
|
80
|
+
});
|
|
81
|
+
if ("account" in entry && !hit)
|
|
82
|
+
throw new AdcpError("UNSUPPORTED_PROVISIONING", {
|
|
83
|
+
message: "Settings updates require an existing account.",
|
|
84
|
+
recovery: "correctable"
|
|
85
|
+
});
|
|
86
|
+
if ("operator_identity" in entry)
|
|
87
|
+
throw new AdcpError("UNSUPPORTED_FEATURE", {
|
|
88
|
+
message: "The keyed account store does not implement identity reconciliation.",
|
|
89
|
+
recovery: "terminal"
|
|
90
|
+
});
|
|
91
|
+
const built = await options.buildAccount(
|
|
92
|
+
structuredClone(entry),
|
|
93
|
+
{
|
|
94
|
+
accountId,
|
|
95
|
+
existing: hit ? structuredClone(hit.account) : null,
|
|
96
|
+
dryRun,
|
|
97
|
+
ctx: ctx && isolateAccountCallbackInput({ ...ctx, ...input !== void 0 && { input } })
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
if (built.id !== accountId) throw new Error("buildAccount must preserve the supplied accountId");
|
|
101
|
+
const { authInfo: _authInfo, ...persisted } = built;
|
|
102
|
+
const account = JSON.parse(
|
|
103
|
+
JSON.stringify({
|
|
104
|
+
...persisted,
|
|
105
|
+
brand: natural.brand,
|
|
106
|
+
operator: natural.operator
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
if (natural.sandbox === true && !isSandboxOrMockAccount(account))
|
|
110
|
+
throw new AdcpError("UNSUPPORTED_FEATURE", {
|
|
111
|
+
message: "The seller did not authorize a sandbox account.",
|
|
112
|
+
recovery: "terminal"
|
|
113
|
+
});
|
|
114
|
+
const request = entry;
|
|
115
|
+
if (request.billing === "agent" && account.billing?.invoicedTo !== "agent") {
|
|
116
|
+
throw new AdcpError("BILLING_NOT_SUPPORTED", {
|
|
117
|
+
message: "The seller did not accept agent billing.",
|
|
118
|
+
recovery: "correctable"
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (account.status === "active" && request.payment_terms !== void 0 && account.payment_terms !== request.payment_terms) {
|
|
122
|
+
throw new AdcpError("PAYMENT_TERMS_NOT_SUPPORTED", {
|
|
123
|
+
message: "The seller did not accept the requested payment terms.",
|
|
124
|
+
recovery: "correctable"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (account.billing?.invoicedTo === "agent" && account.payment_terms === void 0) {
|
|
128
|
+
throw new AdcpError("PAYMENT_TERMS_NOT_SUPPORTED", {
|
|
129
|
+
message: "Agent-billed accounts require explicit payment terms.",
|
|
130
|
+
recovery: "correctable"
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
const action = !hit ? "created" : isDeepStrictEqual(hit.account, account) ? "unchanged" : "updated";
|
|
134
|
+
rows.push(resultRow(account, action));
|
|
135
|
+
const record = { key, ref: natural, account };
|
|
136
|
+
if (hit) records[records.indexOf(hit)] = record;
|
|
137
|
+
else records.push(record);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
if (!(error instanceof AdcpError)) throw error;
|
|
140
|
+
rows.push({
|
|
141
|
+
brand: natural.brand,
|
|
142
|
+
operator: natural.operator,
|
|
143
|
+
...hit && { account_id: hit.account.id },
|
|
144
|
+
action: "failed",
|
|
145
|
+
status: hit?.account.status ?? "rejected",
|
|
146
|
+
errors: [error.toStructuredError()]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (dryRun || isDeepStrictEqual(snapshot?.records ?? [], records)) return rows;
|
|
151
|
+
if (await options.backend.compareAndSwap(scope, snapshot?.version ?? null, records)) return rows;
|
|
152
|
+
}
|
|
153
|
+
throw new AdcpError("CONFLICT", {
|
|
154
|
+
message: "Concurrent account sync; retry the request.",
|
|
155
|
+
recovery: "correctable"
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
async list(request, ctx) {
|
|
159
|
+
const scope = await scopeFor(ctx);
|
|
160
|
+
const snapshot = await options.backend.load(scope);
|
|
161
|
+
let records = snapshot?.records ?? [];
|
|
162
|
+
if (request.account) records = records.filter((record) => recordFor([record], request.account) !== void 0);
|
|
163
|
+
if (request.status) records = records.filter((record) => record.account.status === request.status);
|
|
164
|
+
if (request.sandbox !== void 0)
|
|
165
|
+
records = records.filter((record) => isSandboxOrMockAccount(record.account) === request.sandbox);
|
|
166
|
+
const cursor = request.pagination?.cursor;
|
|
167
|
+
let offset = 0;
|
|
168
|
+
if (cursor !== void 0) {
|
|
169
|
+
try {
|
|
170
|
+
const parsed = JSON.parse(Buffer.from(cursor, "base64url").toString());
|
|
171
|
+
const binding2 = createHash("sha256").update(JSON.stringify([scope, snapshot?.version, request.account, request.status, request.sandbox])).digest("hex");
|
|
172
|
+
if (parsed.binding !== binding2 || !Number.isSafeInteger(parsed.offset) || parsed.offset < 0)
|
|
173
|
+
throw new Error();
|
|
174
|
+
offset = parsed.offset;
|
|
175
|
+
} catch {
|
|
176
|
+
throw new AdcpError("INVALID_REQUEST", {
|
|
177
|
+
message: "Invalid or stale account cursor.",
|
|
178
|
+
recovery: "correctable"
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const limit = request.pagination?.max_results ?? 100;
|
|
183
|
+
if (!Number.isSafeInteger(limit) || limit < 1)
|
|
184
|
+
throw new AdcpError("INVALID_REQUEST", {
|
|
185
|
+
message: "max_results must be a positive integer.",
|
|
186
|
+
recovery: "correctable"
|
|
187
|
+
});
|
|
188
|
+
const items = records.slice(offset, offset + limit).map((record) => record.account);
|
|
189
|
+
const next = offset + items.length;
|
|
190
|
+
const binding = createHash("sha256").update(JSON.stringify([scope, snapshot?.version, request.account, request.status, request.sandbox])).digest("hex");
|
|
191
|
+
return {
|
|
192
|
+
items,
|
|
193
|
+
totalCount: records.length,
|
|
194
|
+
...next < records.length && {
|
|
195
|
+
nextCursor: Buffer.from(JSON.stringify({ binding, offset: next })).toString("base64url")
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
export {
|
|
202
|
+
createKeyedAccountStore
|
|
203
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ListProductsResponseWithSupplyPath, type ProductSupplyPathOptions } from '../supply-path/products.mjs';
|
|
2
2
|
import type { AccountReference, AgentConfig } from '../types/index.mjs';
|
|
3
3
|
import { type AdcpVersion } from '../version.mjs';
|
|
4
|
-
import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListCreativeFormatsRequest, ListCreativeFormatsResponse, ListTransformersRequest, ListTransformersResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, Format, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, GetPrincipalRequest,
|
|
4
|
+
import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListCreativeFormatsRequest, ListCreativeFormatsResponse, ListTransformersRequest, ListTransformersResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, Format, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, GetPrincipalRequest, SyncPrincipalRequest, SyncPrincipalResponse, OutcomeType } from '../types/tools.generated.mjs';
|
|
5
5
|
import { type MutatingRequestInput } from '../utils/idempotency.mjs';
|
|
6
6
|
import type { MCPWebhookPayload, TaskStatus } from '../types/core.generated.mjs';
|
|
7
7
|
type A2ATask = Record<string, any>;
|
|
@@ -96,6 +96,19 @@ export type WebhookParseErrorCode = WebhookSignatureErrorCode | 'webhook_signatu
|
|
|
96
96
|
*/
|
|
97
97
|
| 'webhook_unverifiable' | 'webhook_registration_not_found' | 'webhook_registration_mismatch' | 'webhook_verification_context_missing' | 'webhook_registration_store_unavailable' | 'webhook_durable_settlement_unavailable' | 'webhook_publication_in_progress' | 'webhook_idempotency_conflict' | 'webhook_verification_unavailable';
|
|
98
98
|
export interface WebhookVerificationConfig {
|
|
99
|
+
webBotAuth?: {
|
|
100
|
+
directory: import('../signing/web-bot-auth.mjs').SignatureDirectoryResolver;
|
|
101
|
+
/**
|
|
102
|
+
* Seller origin revocation, checked after verification. A revoked key is
|
|
103
|
+
* refused; unknown status is retryable; a seller that serves no list is
|
|
104
|
+
* accepted (webhooks do not spend). Usually an `OriginRevocationResolver`.
|
|
105
|
+
*/
|
|
106
|
+
revocation?: {
|
|
107
|
+
status(origin: string, keyid: string): Promise<import('../identity-3.3/revocation.mjs').OriginRevocationStatus>;
|
|
108
|
+
};
|
|
109
|
+
/** @deprecated Use `revocation`. Conservative: a seller that serves no list is refused. */
|
|
110
|
+
isRevoked?: (origin: string, keyid: string) => Promise<boolean>;
|
|
111
|
+
};
|
|
99
112
|
/** Applicable pins from persisted media-buy records. Reuse refresh callbacks bound to the seller/publisher/tenant across deliveries to share their cooldown. Never use webhook payload fields. */
|
|
100
113
|
publisherPins?: (registration: Readonly<WebhookRegistration>) => Promise<readonly import('../signing/publisher-pins.mjs').PublisherSigningKeyPin[]>;
|
|
101
114
|
/** Local diagnostics for request_signature_* discovery causes. */
|
|
@@ -201,6 +214,9 @@ export interface StatusHandlerErrorContext {
|
|
|
201
214
|
* Configuration for SingleAgentClient (and multi-agent client)
|
|
202
215
|
*/
|
|
203
216
|
export interface SingleAgentClientConfig extends ConversationConfig {
|
|
217
|
+
/** Enable pinned draft identity schemas and positively negotiated 3.3 webhook rules. */
|
|
218
|
+
experimentalIdentity33?: boolean;
|
|
219
|
+
webhookSigningProfile?: 'adcp/webhook-signing/v1' | 'web-bot-auth';
|
|
204
220
|
/** Default off disables provisioning gates; auto/strict use the provisioning registry. */
|
|
205
221
|
accountPolicy?: AccountPolicy;
|
|
206
222
|
/** Auto selects seller IDs only with stable_account_id or an AdCP 4+ wire contract. Natural-key preserves legacy implicit references. */
|
|
@@ -553,6 +569,7 @@ export declare class SingleAgentClient {
|
|
|
553
569
|
private discoveredMcpEraAt;
|
|
554
570
|
private canonicalBaseUrl?;
|
|
555
571
|
private cachedCapabilities?;
|
|
572
|
+
private runAgentInfo?;
|
|
556
573
|
private cachedToolSchemas?;
|
|
557
574
|
private primedCapabilitiesExpiresAt?;
|
|
558
575
|
private capabilityEvidenceScopeKey;
|
|
@@ -1136,7 +1153,7 @@ export declare class SingleAgentClient {
|
|
|
1136
1153
|
/** Read the durable change feed for one account. */
|
|
1137
1154
|
listAccountChanges(params: ListAccountChangesRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<ListAccountChangesResponse>>;
|
|
1138
1155
|
/** Read the authenticated caller's durable principal configuration. */
|
|
1139
|
-
getPrincipal(params?: GetPrincipalRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<
|
|
1156
|
+
getPrincipal(params?: GetPrincipalRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<import('../identity-3.3/types.mjs').Identity33GetPrincipalResponse>>;
|
|
1140
1157
|
/** Atomically replace selected sections of the authenticated caller's principal configuration. */
|
|
1141
1158
|
syncPrincipal(params: MutatingRequestInput<SyncPrincipalRequest>, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<SyncPrincipalResponse>>;
|
|
1142
1159
|
/**
|
|
@@ -1492,6 +1509,7 @@ export declare class SingleAgentClient {
|
|
|
1492
1509
|
parameters?: string[];
|
|
1493
1510
|
}>;
|
|
1494
1511
|
}>;
|
|
1512
|
+
private getAgentInfoLive;
|
|
1495
1513
|
/**
|
|
1496
1514
|
* Get agent capabilities, including AdCP version support
|
|
1497
1515
|
*
|
|
@@ -1535,6 +1553,8 @@ export declare class SingleAgentClient {
|
|
|
1535
1553
|
getCapabilityEvidenceScope(): CapabilityEvidenceScope;
|
|
1536
1554
|
private currentCapabilityEvidenceAuthMaterial;
|
|
1537
1555
|
private synchronizeCapabilityEvidenceAuthorizationScope;
|
|
1556
|
+
/** A comply() run owns its configured fetch; per-call transport changes still discover separately. */
|
|
1557
|
+
private usesScopedDiscoveryTransport;
|
|
1538
1558
|
/**
|
|
1539
1559
|
* Reuse a fresh capability observation made by the embedding application.
|
|
1540
1560
|
*
|
|
@@ -1858,6 +1878,9 @@ export declare class SingleAgentClient {
|
|
|
1858
1878
|
* injected fields before the adapter gets a chance to clean them up, so
|
|
1859
1879
|
* the two passes have to agree on "extra keys are fine."
|
|
1860
1880
|
*/
|
|
1881
|
+
private usesIdentity33Schemas;
|
|
1882
|
+
private usesSigned33Webhooks;
|
|
1883
|
+
private selectedWebhookSigningProfile;
|
|
1861
1884
|
private validateRequest;
|
|
1862
1885
|
}
|
|
1863
1886
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ListProductsResponseWithSupplyPath, type ProductSupplyPathOptions } from '../supply-path/products';
|
|
2
2
|
import type { AccountReference, AgentConfig } from '../types';
|
|
3
3
|
import { type AdcpVersion } from '../version';
|
|
4
|
-
import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListCreativeFormatsRequest, ListCreativeFormatsResponse, ListTransformersRequest, ListTransformersResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, Format, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, GetPrincipalRequest,
|
|
4
|
+
import type { GetProductsRequest, GetProductsResponse, ListProductsRequest, ListCreativeFormatsRequest, ListCreativeFormatsResponse, ListTransformersRequest, ListTransformersResponse, CreateMediaBuyRequest, CreateMediaBuyResponse, UpdateMediaBuyRequest, UpdateMediaBuyResponse, SyncCreativesRequest, SyncCreativesResponse, ListCreativesRequest, ListCreativesResponse, GetMediaBuysRequest, GetMediaBuysResponse, GetMediaBuyDeliveryRequest, GetMediaBuyDeliveryResponse, GetCreativeDeliveryRequest, GetCreativeDeliveryResponse, ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackResponse, GetSignalsRequest, GetSignalsResponse, ActivateSignalRequest, ActivateSignalResponse, PreviewCreativeRequest, PreviewCreativeResponse, BuildCreativeRequest, BuildCreativeResponse, Format, GetAdCPCapabilitiesRequest, GetAdCPCapabilitiesResponse, ListAccountChangesRequest, ListAccountChangesResponse, ListAccountsRequest, ListAccountsResponse, SyncAccountsRequest, SyncAccountsResponse, SyncAudiencesRequest, SyncAudiencesResponse, CreatePropertyListRequest, CreatePropertyListResponse, GetPropertyListRequest, GetPropertyListResponse, UpdatePropertyListRequest, UpdatePropertyListResponse, ListPropertyListsRequest, ListPropertyListsResponse, DeletePropertyListRequest, DeletePropertyListResponse, ListContentStandardsRequest, ListContentStandardsResponse, GetContentStandardsRequest, GetContentStandardsResponse, CalibrateContentRequest, CalibrateContentResponse, ValidateContentDeliveryRequest, ValidateContentDeliveryResponse, SIGetOfferingRequest, SIGetOfferingResponse, SIInitiateSessionRequest, SIInitiateSessionResponse, SISendMessageRequest, SISendMessageResponse, SITerminateSessionRequest, SITerminateSessionResponse, SyncPlansRequest, SyncPlansResponse, GetPlanAuditLogsRequest, GetPlanAuditLogsResponse, GetPrincipalRequest, SyncPrincipalRequest, SyncPrincipalResponse, OutcomeType } from '../types/tools.generated';
|
|
5
5
|
import { type MutatingRequestInput } from '../utils/idempotency';
|
|
6
6
|
import type { MCPWebhookPayload, TaskStatus } from '../types/core.generated';
|
|
7
7
|
type A2ATask = Record<string, any>;
|
|
@@ -96,6 +96,19 @@ export type WebhookParseErrorCode = WebhookSignatureErrorCode | 'webhook_signatu
|
|
|
96
96
|
*/
|
|
97
97
|
| 'webhook_unverifiable' | 'webhook_registration_not_found' | 'webhook_registration_mismatch' | 'webhook_verification_context_missing' | 'webhook_registration_store_unavailable' | 'webhook_durable_settlement_unavailable' | 'webhook_publication_in_progress' | 'webhook_idempotency_conflict' | 'webhook_verification_unavailable';
|
|
98
98
|
export interface WebhookVerificationConfig {
|
|
99
|
+
webBotAuth?: {
|
|
100
|
+
directory: import('../signing/web-bot-auth').SignatureDirectoryResolver;
|
|
101
|
+
/**
|
|
102
|
+
* Seller origin revocation, checked after verification. A revoked key is
|
|
103
|
+
* refused; unknown status is retryable; a seller that serves no list is
|
|
104
|
+
* accepted (webhooks do not spend). Usually an `OriginRevocationResolver`.
|
|
105
|
+
*/
|
|
106
|
+
revocation?: {
|
|
107
|
+
status(origin: string, keyid: string): Promise<import('../identity-3.3/revocation').OriginRevocationStatus>;
|
|
108
|
+
};
|
|
109
|
+
/** @deprecated Use `revocation`. Conservative: a seller that serves no list is refused. */
|
|
110
|
+
isRevoked?: (origin: string, keyid: string) => Promise<boolean>;
|
|
111
|
+
};
|
|
99
112
|
/** Applicable pins from persisted media-buy records. Reuse refresh callbacks bound to the seller/publisher/tenant across deliveries to share their cooldown. Never use webhook payload fields. */
|
|
100
113
|
publisherPins?: (registration: Readonly<WebhookRegistration>) => Promise<readonly import('../signing/publisher-pins').PublisherSigningKeyPin[]>;
|
|
101
114
|
/** Local diagnostics for request_signature_* discovery causes. */
|
|
@@ -201,6 +214,9 @@ export interface StatusHandlerErrorContext {
|
|
|
201
214
|
* Configuration for SingleAgentClient (and multi-agent client)
|
|
202
215
|
*/
|
|
203
216
|
export interface SingleAgentClientConfig extends ConversationConfig {
|
|
217
|
+
/** Enable pinned draft identity schemas and positively negotiated 3.3 webhook rules. */
|
|
218
|
+
experimentalIdentity33?: boolean;
|
|
219
|
+
webhookSigningProfile?: 'adcp/webhook-signing/v1' | 'web-bot-auth';
|
|
204
220
|
/** Default off disables provisioning gates; auto/strict use the provisioning registry. */
|
|
205
221
|
accountPolicy?: AccountPolicy;
|
|
206
222
|
/** Auto selects seller IDs only with stable_account_id or an AdCP 4+ wire contract. Natural-key preserves legacy implicit references. */
|
|
@@ -553,6 +569,7 @@ export declare class SingleAgentClient {
|
|
|
553
569
|
private discoveredMcpEraAt;
|
|
554
570
|
private canonicalBaseUrl?;
|
|
555
571
|
private cachedCapabilities?;
|
|
572
|
+
private runAgentInfo?;
|
|
556
573
|
private cachedToolSchemas?;
|
|
557
574
|
private primedCapabilitiesExpiresAt?;
|
|
558
575
|
private capabilityEvidenceScopeKey;
|
|
@@ -1136,7 +1153,7 @@ export declare class SingleAgentClient {
|
|
|
1136
1153
|
/** Read the durable change feed for one account. */
|
|
1137
1154
|
listAccountChanges(params: ListAccountChangesRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<ListAccountChangesResponse>>;
|
|
1138
1155
|
/** Read the authenticated caller's durable principal configuration. */
|
|
1139
|
-
getPrincipal(params?: GetPrincipalRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<
|
|
1156
|
+
getPrincipal(params?: GetPrincipalRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<import('../identity-3.3/types').Identity33GetPrincipalResponse>>;
|
|
1140
1157
|
/** Atomically replace selected sections of the authenticated caller's principal configuration. */
|
|
1141
1158
|
syncPrincipal(params: MutatingRequestInput<SyncPrincipalRequest>, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<SyncPrincipalResponse>>;
|
|
1142
1159
|
/**
|
|
@@ -1492,6 +1509,7 @@ export declare class SingleAgentClient {
|
|
|
1492
1509
|
parameters?: string[];
|
|
1493
1510
|
}>;
|
|
1494
1511
|
}>;
|
|
1512
|
+
private getAgentInfoLive;
|
|
1495
1513
|
/**
|
|
1496
1514
|
* Get agent capabilities, including AdCP version support
|
|
1497
1515
|
*
|
|
@@ -1535,6 +1553,8 @@ export declare class SingleAgentClient {
|
|
|
1535
1553
|
getCapabilityEvidenceScope(): CapabilityEvidenceScope;
|
|
1536
1554
|
private currentCapabilityEvidenceAuthMaterial;
|
|
1537
1555
|
private synchronizeCapabilityEvidenceAuthorizationScope;
|
|
1556
|
+
/** A comply() run owns its configured fetch; per-call transport changes still discover separately. */
|
|
1557
|
+
private usesScopedDiscoveryTransport;
|
|
1538
1558
|
/**
|
|
1539
1559
|
* Reuse a fresh capability observation made by the embedding application.
|
|
1540
1560
|
*
|
|
@@ -1858,6 +1878,9 @@ export declare class SingleAgentClient {
|
|
|
1858
1878
|
* injected fields before the adapter gets a chance to clean them up, so
|
|
1859
1879
|
* the two passes have to agree on "extra keys are fine."
|
|
1860
1880
|
*/
|
|
1881
|
+
private usesIdentity33Schemas;
|
|
1882
|
+
private usesSigned33Webhooks;
|
|
1883
|
+
private selectedWebhookSigningProfile;
|
|
1861
1884
|
private validateRequest;
|
|
1862
1885
|
}
|
|
1863
1886
|
/**
|