@adcp/sdk 12.0.4 → 12.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/protocols/a2a.mjs +5 -0
- package/dist/lib/protocols/a2a.mjs.map +1 -1
- package/dist/lib/protocols/abort.mjs +5 -0
- package/dist/lib/protocols/abort.mjs.map +1 -1
- package/dist/lib/protocols/index.mjs +5 -0
- package/dist/lib/protocols/index.mjs.map +1 -1
- package/dist/lib/protocols/mcp-modern.mjs +5 -0
- package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
- package/dist/lib/protocols/mcp-tasks.mjs +5 -0
- package/dist/lib/protocols/mcp-tasks.mjs.map +1 -1
- package/dist/lib/protocols/mcp.mjs +5 -0
- package/dist/lib/protocols/mcp.mjs.map +1 -1
- package/dist/lib/protocols/rawResponseCapture.mjs +5 -0
- package/dist/lib/protocols/rawResponseCapture.mjs.map +1 -1
- package/dist/lib/protocols/responseSizeLimit.mjs +5 -0
- package/dist/lib/protocols/responseSizeLimit.mjs.map +1 -1
- package/dist/lib/protocols/transportDiagnostics.mjs +5 -0
- package/dist/lib/protocols/transportDiagnostics.mjs.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -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/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/index.mjs.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +21 -13
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +21 -13
- package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.d.mts +8 -2
- package/dist/lib/server/decisioning/specialisms/sales.d.ts +8 -2
- package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
- 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.js.map +1 -1
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/version.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/protocols/transportDiagnostics.ts"],"sourcesContent":["import { globalAsyncLocalStorage } from '../utils/global-async-local-storage';\nimport { createHmac } from 'node:crypto';\n\nexport type TransportActivityType = 'request_started' | 'response_received' | 'request_failed';\n\nexport interface TransportActivityContext {\n agentId: string;\n protocol: 'mcp' | 'a2a';\n tool?: string;\n taskType?: string;\n operationId?: string;\n taskId?: string;\n contextId?: string;\n idempotencyKey?: string;\n}\n\nexport interface TransportActivity {\n type: TransportActivityType;\n agentId: string;\n protocol: 'mcp' | 'a2a';\n tool?: string;\n taskType?: string;\n operationId?: string;\n taskId?: string;\n contextId?: string;\n idempotencyKeyHash?: string;\n method: string;\n url: string;\n requestHeaders: Record<string, string>;\n requestBody?: string;\n requestBodyTruncated?: boolean;\n startedAt: string;\n timestamp: string;\n durationMs?: number;\n httpStatus?: number;\n statusText?: string;\n responseHeaders?: Record<string, string>;\n responseBody?: string;\n responseBodyTruncated?: boolean;\n errorName?: string;\n errorMessage?: string;\n}\n\nexport type TransportActivityHandler = (event: TransportActivity) => void | Promise<void>;\n\ninterface TransportDiagnosticsSlot extends TransportActivityContext {\n onTransportActivity?: TransportActivityHandler;\n pending: Promise<void>[];\n}\n\nconst BODY_SNIPPET_LIMIT = 64 * 1024;\nconst REDACTED = '[redacted]';\n\nconst SAFE_HEADER_NAMES = new Set([\n 'accept',\n 'accept-encoding',\n 'content-type',\n 'last-event-id',\n 'mcp-protocol-version',\n 'traceparent',\n 'tracestate',\n 'user-agent',\n 'x-adcp-agent-id',\n 'x-adcp-request-id',\n 'x-correlation-id',\n 'x-request-id',\n 'x-scope3-debug-id',\n]);\n\nconst SENSITIVE_HEADER_NAMES = new Set([\n 'authorization',\n 'cookie',\n 'proxy-authorization',\n 'set-cookie',\n 'x-adcp-auth',\n 'x-api-key',\n 'mcp-session-id',\n]);\n\nconst SENSITIVE_KEY_RE =\n /(^|[_-])(authorization|cookie|credentials?|secret|signature|token|api[_-]?key|private[_-]?key|idempotency[_-]?key|password)([_-]|$)/i;\nconst SENSITIVE_TEXT_FIELD_RE =\n /((?:\"[^\"]*(?:authorization|cookie|credentials?|secret|signature|token|api[_-]?key|private[_-]?key|idempotency[_-]?key|password)[^\"]*\"\\s*:\\s*)|(?:^|[&\\s])[^=&\\s]*(?:authorization|cookie|credentials?|secret|signature|token|api[_-]?key|private[_-]?key|idempotency[_-]?key|password)[^=&\\s]*=)(\"[^\"]*\"|[^&\\s,}]+)/gi;\nconst URL_LIKE_RE = /\\bhttps?:\\/\\/[^\\s\"'<>]+/gi;\n\nexport const transportDiagnosticsStorage = globalAsyncLocalStorage<TransportDiagnosticsSlot>('transportDiagnostics');\n\nexport function withTransportDiagnostics<T>(\n context: TransportActivityContext & { onTransportActivity?: TransportActivityHandler },\n fn: () => Promise<T>\n): Promise<T> {\n if (!context.onTransportActivity) return fn();\n const slot: TransportDiagnosticsSlot = { ...context, pending: [] };\n return transportDiagnosticsStorage.run(slot, async () => {\n try {\n return await fn();\n } finally {\n await Promise.allSettled(slot.pending);\n }\n });\n}\n\nexport function sanitizeTransportUrl(value: string): string {\n try {\n const url = new URL(value);\n url.username = '';\n url.password = '';\n url.search = '';\n url.hash = '';\n return url.toString();\n } catch {\n return 'invalid_url';\n }\n}\n\nexport function sanitizeTransportHeaders(headers: HeadersInit | undefined): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of headerEntries(headers)) {\n const lower = key.toLowerCase();\n if (SENSITIVE_HEADER_NAMES.has(lower) || SENSITIVE_KEY_RE.test(lower)) {\n out[lower] = REDACTED;\n } else if (SAFE_HEADER_NAMES.has(lower) || isSafeCorrelationHeader(lower)) {\n out[lower] = value;\n }\n }\n return out;\n}\n\nexport function wrapFetchWithTransportDiagnostics(upstream: typeof fetch): typeof fetch {\n const wrapped: typeof fetch = async (input, init) => {\n const slot = transportDiagnosticsStorage.getStore();\n if (!slot?.onTransportActivity) return upstream(input, init);\n\n const startedAtMs = Date.now();\n const startedAt = new Date(startedAtMs).toISOString();\n const method = getMethod(input, init);\n const url = sanitizeTransportUrl(getUrl(input));\n const requestHeaders = sanitizeTransportHeaders(mergeRequestHeaders(input, init));\n const requestBody = bodySnippet(init?.body);\n const baseEvent = {\n agentId: slot.agentId,\n protocol: slot.protocol,\n ...(slot.tool && { tool: slot.tool, taskType: slot.taskType ?? slot.tool }),\n ...(slot.operationId && { operationId: slot.operationId }),\n ...(slot.taskId && { taskId: slot.taskId }),\n ...(slot.contextId && { contextId: slot.contextId }),\n ...(slot.idempotencyKey && { idempotencyKeyHash: fingerprintDiagnosticValue(slot.idempotencyKey) }),\n method,\n url,\n requestHeaders,\n ...(requestBody && {\n requestBody: requestBody.body,\n requestBodyTruncated: requestBody.truncated,\n }),\n startedAt,\n };\n\n emitTransportActivity(slot.onTransportActivity, {\n type: 'request_started',\n ...baseEvent,\n timestamp: startedAt,\n });\n\n try {\n const response = await upstream(input, init);\n const durationMs = Date.now() - startedAtMs;\n const responseHeaders = sanitizeResponseHeaders(response.headers);\n const responseBody = await responseBodySnippet(response);\n emitTransportActivity(slot.onTransportActivity, {\n type: 'response_received',\n ...baseEvent,\n timestamp: new Date().toISOString(),\n durationMs,\n httpStatus: response.status,\n statusText: response.statusText,\n responseHeaders,\n ...(responseBody && {\n responseBody: responseBody.body,\n responseBodyTruncated: responseBody.truncated,\n }),\n });\n return response;\n } catch (error) {\n emitTransportActivity(slot.onTransportActivity, {\n type: 'request_failed',\n ...baseEvent,\n timestamp: new Date().toISOString(),\n durationMs: Date.now() - startedAtMs,\n errorName: error instanceof Error ? error.name : typeof error,\n errorMessage: sanitizeDiagnosticText(error instanceof Error ? error.message : String(error)),\n });\n throw error;\n }\n };\n return wrapped;\n}\n\nfunction emitTransportActivity(handler: TransportActivityHandler, event: TransportActivity): void {\n try {\n const slot = transportDiagnosticsStorage.getStore();\n const frozen = Object.freeze(structuredClone(event));\n const pending = Promise.resolve()\n .then(() => handler(frozen))\n .then(\n () => {},\n () => {}\n );\n slot?.pending.push(pending);\n } catch {\n // Observability hooks must not change protocol behavior.\n }\n}\n\nfunction getUrl(input: RequestInfo | URL): string {\n return typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url;\n}\n\nfunction getMethod(input: RequestInfo | URL, init?: RequestInit): string {\n return (init?.method ?? (input instanceof Request ? input.method : 'GET')).toUpperCase();\n}\n\nfunction mergeRequestHeaders(input: RequestInfo | URL, init?: RequestInit): Headers {\n const headers = new Headers(input instanceof Request ? input.headers : undefined);\n if (init?.headers) {\n for (const [key, value] of headerEntries(init.headers)) {\n headers.set(key, value);\n }\n }\n return headers;\n}\n\nfunction sanitizeResponseHeaders(headers: Headers): Record<string, string> {\n return sanitizeTransportHeaders(headers);\n}\n\nfunction headerEntries(headers: HeadersInit | undefined): Array<[string, string]> {\n if (!headers) return [];\n if (headers instanceof Headers) {\n const entries: Array<[string, string]> = [];\n headers.forEach((value, key) => entries.push([key, value]));\n return entries;\n }\n if (Array.isArray(headers)) return headers.map(([key, value]) => [key, value]);\n return Object.entries(headers).map(([key, value]) => [key, String(value)]);\n}\n\nfunction isSafeCorrelationHeader(lower: string): boolean {\n if (!lower.startsWith('x-')) return false;\n return (\n lower.includes('correlation') || lower.includes('debug') || lower.includes('request-id') || lower.includes('trace')\n );\n}\n\nfunction bodySnippet(body: BodyInit | null | undefined): { body: string; truncated: boolean } | undefined {\n if (body == null) return undefined;\n if (typeof body === 'string') return sanitizeBodyText(body, BODY_SNIPPET_LIMIT);\n if (body instanceof URLSearchParams) return sanitizeBodyText(body.toString(), BODY_SNIPPET_LIMIT);\n if (body instanceof Blob) return { body: `[blob ${body.size} bytes]`, truncated: false };\n if (body instanceof ArrayBuffer) {\n return sanitizeBodyText(Buffer.from(body).toString('utf8'), BODY_SNIPPET_LIMIT);\n }\n if (ArrayBuffer.isView(body)) {\n return sanitizeBodyText(\n Buffer.from(body.buffer, body.byteOffset, body.byteLength).toString('utf8'),\n BODY_SNIPPET_LIMIT\n );\n }\n return undefined;\n}\n\nasync function responseBodySnippet(response: Response): Promise<{ body: string; truncated: boolean } | undefined> {\n const contentType = response.headers.get('content-type') ?? '';\n if (!isDiagnosticTextContentType(contentType)) return undefined;\n try {\n const { text, truncated } = await readResponseTextBounded(response.clone(), BODY_SNIPPET_LIMIT);\n return { body: redactSensitiveJsonOrText(text), truncated };\n } catch {\n return undefined;\n }\n}\n\nfunction sanitizeBodyText(text: string, limit: number): { body: string; truncated: boolean } {\n const truncated = text.length > limit;\n const bounded = truncated ? text.slice(0, limit) : text;\n return { body: redactSensitiveJsonOrText(bounded), truncated };\n}\n\nfunction redactSensitiveJsonOrText(text: string): string {\n try {\n return JSON.stringify(redactSensitiveValue(JSON.parse(text)));\n } catch {\n return sanitizeDiagnosticText(text);\n }\n}\n\nfunction redactSensitiveValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(redactSensitiveValue);\n if (typeof value === 'string') return sanitizeStringValue(value);\n if (!value || typeof value !== 'object') return value;\n const out: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value)) {\n out[key] = isSensitiveKey(key) ? REDACTED : redactSensitiveValue(child);\n }\n return out;\n}\n\nfunction sanitizeDiagnosticText(text: string): string {\n return text\n .replace(URL_LIKE_RE, value => sanitizeTransportUrl(value))\n .replace(/Bearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer [redacted]')\n .replace(/Basic\\s+[A-Za-z0-9+/=-]+/gi, 'Basic [redacted]')\n .replace(SENSITIVE_TEXT_FIELD_RE, (_match, prefix) => `${prefix}${REDACTED}`);\n}\n\nfunction sanitizeStringValue(value: string): string {\n return sanitizeDiagnosticText(value);\n}\n\nfunction normalizedKey(key: string): string {\n return key.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();\n}\n\nfunction isSensitiveKey(key: string): boolean {\n return SENSITIVE_KEY_RE.test(normalizedKey(key));\n}\n\nfunction isDiagnosticTextContentType(contentType: string): boolean {\n const lower = contentType.toLowerCase();\n if (!lower) return true;\n if (lower.includes('text/event-stream')) return false;\n return (\n lower.startsWith('text/') ||\n lower.includes('json') ||\n lower.includes('xml') ||\n lower.includes('javascript') ||\n lower.includes('x-www-form-urlencoded')\n );\n}\n\nasync function readResponseTextBounded(\n response: Response,\n limit: number\n): Promise<{ text: string; truncated: boolean }> {\n if (!response.body) {\n const text = await response.text();\n return { text: text.slice(0, limit), truncated: text.length > limit };\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let text = '';\n let truncated = false;\n\n try {\n while (text.length <= limit) {\n const { done, value } = await reader.read();\n if (done) break;\n text += decoder.decode(value, { stream: true });\n if (text.length > limit) {\n truncated = true;\n text = text.slice(0, limit);\n await reader.cancel();\n break;\n }\n }\n if (!truncated) text += decoder.decode();\n } finally {\n reader.releaseLock();\n }\n\n return { text, truncated };\n}\n\nfunction fingerprintDiagnosticValue(value: string): string {\n return createHmac('sha256', 'adcp-transport-diagnostics').update(value).digest('hex').slice(0, 16);\n}\n"],"mappings":"AAAA,SAAS,+BAA+B;AACxC,SAAS,kBAAkB;AAiD3B,MAAM,qBAAqB,KAAK;AAChC,MAAM,WAAW;AAEjB,MAAM,oBAAoB,oBAAI,IAAI;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,yBAAyB,oBAAI,IAAI;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,mBACJ;AACF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AK,EAAE,MAAM,GAAG,EAAE;AACnG;","names":["text"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/protocols/transportDiagnostics.ts"],"sourcesContent":["import { fileURLToPath as __adcpFileURLToPath } from 'node:url';\nimport { dirname as __adcpDirname } from 'node:path';\nimport { createRequire as __adcpCreateRequire } from 'node:module';\nconst __dirname = __adcpDirname(__adcpFileURLToPath(import.meta.url));\nconst require = __adcpCreateRequire(import.meta.url);\nimport { globalAsyncLocalStorage } from '../utils/global-async-local-storage';\nimport { createHmac } from 'node:crypto';\n\nexport type TransportActivityType = 'request_started' | 'response_received' | 'request_failed';\n\nexport interface TransportActivityContext {\n agentId: string;\n protocol: 'mcp' | 'a2a';\n tool?: string;\n taskType?: string;\n operationId?: string;\n taskId?: string;\n contextId?: string;\n idempotencyKey?: string;\n}\n\nexport interface TransportActivity {\n type: TransportActivityType;\n agentId: string;\n protocol: 'mcp' | 'a2a';\n tool?: string;\n taskType?: string;\n operationId?: string;\n taskId?: string;\n contextId?: string;\n idempotencyKeyHash?: string;\n method: string;\n url: string;\n requestHeaders: Record<string, string>;\n requestBody?: string;\n requestBodyTruncated?: boolean;\n startedAt: string;\n timestamp: string;\n durationMs?: number;\n httpStatus?: number;\n statusText?: string;\n responseHeaders?: Record<string, string>;\n responseBody?: string;\n responseBodyTruncated?: boolean;\n errorName?: string;\n errorMessage?: string;\n}\n\nexport type TransportActivityHandler = (event: TransportActivity) => void | Promise<void>;\n\ninterface TransportDiagnosticsSlot extends TransportActivityContext {\n onTransportActivity?: TransportActivityHandler;\n pending: Promise<void>[];\n}\n\nconst BODY_SNIPPET_LIMIT = 64 * 1024;\nconst REDACTED = '[redacted]';\n\nconst SAFE_HEADER_NAMES = new Set([\n 'accept',\n 'accept-encoding',\n 'content-type',\n 'last-event-id',\n 'mcp-protocol-version',\n 'traceparent',\n 'tracestate',\n 'user-agent',\n 'x-adcp-agent-id',\n 'x-adcp-request-id',\n 'x-correlation-id',\n 'x-request-id',\n 'x-scope3-debug-id',\n]);\n\nconst SENSITIVE_HEADER_NAMES = new Set([\n 'authorization',\n 'cookie',\n 'proxy-authorization',\n 'set-cookie',\n 'x-adcp-auth',\n 'x-api-key',\n 'mcp-session-id',\n]);\n\nconst SENSITIVE_KEY_RE =\n /(^|[_-])(authorization|cookie|credentials?|secret|signature|token|api[_-]?key|private[_-]?key|idempotency[_-]?key|password)([_-]|$)/i;\nconst SENSITIVE_TEXT_FIELD_RE =\n /((?:\"[^\"]*(?:authorization|cookie|credentials?|secret|signature|token|api[_-]?key|private[_-]?key|idempotency[_-]?key|password)[^\"]*\"\\s*:\\s*)|(?:^|[&\\s])[^=&\\s]*(?:authorization|cookie|credentials?|secret|signature|token|api[_-]?key|private[_-]?key|idempotency[_-]?key|password)[^=&\\s]*=)(\"[^\"]*\"|[^&\\s,}]+)/gi;\nconst URL_LIKE_RE = /\\bhttps?:\\/\\/[^\\s\"'<>]+/gi;\n\nexport const transportDiagnosticsStorage = globalAsyncLocalStorage<TransportDiagnosticsSlot>('transportDiagnostics');\n\nexport function withTransportDiagnostics<T>(\n context: TransportActivityContext & { onTransportActivity?: TransportActivityHandler },\n fn: () => Promise<T>\n): Promise<T> {\n if (!context.onTransportActivity) return fn();\n const slot: TransportDiagnosticsSlot = { ...context, pending: [] };\n return transportDiagnosticsStorage.run(slot, async () => {\n try {\n return await fn();\n } finally {\n await Promise.allSettled(slot.pending);\n }\n });\n}\n\nexport function sanitizeTransportUrl(value: string): string {\n try {\n const url = new URL(value);\n url.username = '';\n url.password = '';\n url.search = '';\n url.hash = '';\n return url.toString();\n } catch {\n return 'invalid_url';\n }\n}\n\nexport function sanitizeTransportHeaders(headers: HeadersInit | undefined): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of headerEntries(headers)) {\n const lower = key.toLowerCase();\n if (SENSITIVE_HEADER_NAMES.has(lower) || SENSITIVE_KEY_RE.test(lower)) {\n out[lower] = REDACTED;\n } else if (SAFE_HEADER_NAMES.has(lower) || isSafeCorrelationHeader(lower)) {\n out[lower] = value;\n }\n }\n return out;\n}\n\nexport function wrapFetchWithTransportDiagnostics(upstream: typeof fetch): typeof fetch {\n const wrapped: typeof fetch = async (input, init) => {\n const slot = transportDiagnosticsStorage.getStore();\n if (!slot?.onTransportActivity) return upstream(input, init);\n\n const startedAtMs = Date.now();\n const startedAt = new Date(startedAtMs).toISOString();\n const method = getMethod(input, init);\n const url = sanitizeTransportUrl(getUrl(input));\n const requestHeaders = sanitizeTransportHeaders(mergeRequestHeaders(input, init));\n const requestBody = bodySnippet(init?.body);\n const baseEvent = {\n agentId: slot.agentId,\n protocol: slot.protocol,\n ...(slot.tool && { tool: slot.tool, taskType: slot.taskType ?? slot.tool }),\n ...(slot.operationId && { operationId: slot.operationId }),\n ...(slot.taskId && { taskId: slot.taskId }),\n ...(slot.contextId && { contextId: slot.contextId }),\n ...(slot.idempotencyKey && { idempotencyKeyHash: fingerprintDiagnosticValue(slot.idempotencyKey) }),\n method,\n url,\n requestHeaders,\n ...(requestBody && {\n requestBody: requestBody.body,\n requestBodyTruncated: requestBody.truncated,\n }),\n startedAt,\n };\n\n emitTransportActivity(slot.onTransportActivity, {\n type: 'request_started',\n ...baseEvent,\n timestamp: startedAt,\n });\n\n try {\n const response = await upstream(input, init);\n const durationMs = Date.now() - startedAtMs;\n const responseHeaders = sanitizeResponseHeaders(response.headers);\n const responseBody = await responseBodySnippet(response);\n emitTransportActivity(slot.onTransportActivity, {\n type: 'response_received',\n ...baseEvent,\n timestamp: new Date().toISOString(),\n durationMs,\n httpStatus: response.status,\n statusText: response.statusText,\n responseHeaders,\n ...(responseBody && {\n responseBody: responseBody.body,\n responseBodyTruncated: responseBody.truncated,\n }),\n });\n return response;\n } catch (error) {\n emitTransportActivity(slot.onTransportActivity, {\n type: 'request_failed',\n ...baseEvent,\n timestamp: new Date().toISOString(),\n durationMs: Date.now() - startedAtMs,\n errorName: error instanceof Error ? error.name : typeof error,\n errorMessage: sanitizeDiagnosticText(error instanceof Error ? error.message : String(error)),\n });\n throw error;\n }\n };\n return wrapped;\n}\n\nfunction emitTransportActivity(handler: TransportActivityHandler, event: TransportActivity): void {\n try {\n const slot = transportDiagnosticsStorage.getStore();\n const frozen = Object.freeze(structuredClone(event));\n const pending = Promise.resolve()\n .then(() => handler(frozen))\n .then(\n () => {},\n () => {}\n );\n slot?.pending.push(pending);\n } catch {\n // Observability hooks must not change protocol behavior.\n }\n}\n\nfunction getUrl(input: RequestInfo | URL): string {\n return typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url;\n}\n\nfunction getMethod(input: RequestInfo | URL, init?: RequestInit): string {\n return (init?.method ?? (input instanceof Request ? input.method : 'GET')).toUpperCase();\n}\n\nfunction mergeRequestHeaders(input: RequestInfo | URL, init?: RequestInit): Headers {\n const headers = new Headers(input instanceof Request ? input.headers : undefined);\n if (init?.headers) {\n for (const [key, value] of headerEntries(init.headers)) {\n headers.set(key, value);\n }\n }\n return headers;\n}\n\nfunction sanitizeResponseHeaders(headers: Headers): Record<string, string> {\n return sanitizeTransportHeaders(headers);\n}\n\nfunction headerEntries(headers: HeadersInit | undefined): Array<[string, string]> {\n if (!headers) return [];\n if (headers instanceof Headers) {\n const entries: Array<[string, string]> = [];\n headers.forEach((value, key) => entries.push([key, value]));\n return entries;\n }\n if (Array.isArray(headers)) return headers.map(([key, value]) => [key, value]);\n return Object.entries(headers).map(([key, value]) => [key, String(value)]);\n}\n\nfunction isSafeCorrelationHeader(lower: string): boolean {\n if (!lower.startsWith('x-')) return false;\n return (\n lower.includes('correlation') || lower.includes('debug') || lower.includes('request-id') || lower.includes('trace')\n );\n}\n\nfunction bodySnippet(body: BodyInit | null | undefined): { body: string; truncated: boolean } | undefined {\n if (body == null) return undefined;\n if (typeof body === 'string') return sanitizeBodyText(body, BODY_SNIPPET_LIMIT);\n if (body instanceof URLSearchParams) return sanitizeBodyText(body.toString(), BODY_SNIPPET_LIMIT);\n if (body instanceof Blob) return { body: `[blob ${body.size} bytes]`, truncated: false };\n if (body instanceof ArrayBuffer) {\n return sanitizeBodyText(Buffer.from(body).toString('utf8'), BODY_SNIPPET_LIMIT);\n }\n if (ArrayBuffer.isView(body)) {\n return sanitizeBodyText(\n Buffer.from(body.buffer, body.byteOffset, body.byteLength).toString('utf8'),\n BODY_SNIPPET_LIMIT\n );\n }\n return undefined;\n}\n\nasync function responseBodySnippet(response: Response): Promise<{ body: string; truncated: boolean } | undefined> {\n const contentType = response.headers.get('content-type') ?? '';\n if (!isDiagnosticTextContentType(contentType)) return undefined;\n try {\n const { text, truncated } = await readResponseTextBounded(response.clone(), BODY_SNIPPET_LIMIT);\n return { body: redactSensitiveJsonOrText(text), truncated };\n } catch {\n return undefined;\n }\n}\n\nfunction sanitizeBodyText(text: string, limit: number): { body: string; truncated: boolean } {\n const truncated = text.length > limit;\n const bounded = truncated ? text.slice(0, limit) : text;\n return { body: redactSensitiveJsonOrText(bounded), truncated };\n}\n\nfunction redactSensitiveJsonOrText(text: string): string {\n try {\n return JSON.stringify(redactSensitiveValue(JSON.parse(text)));\n } catch {\n return sanitizeDiagnosticText(text);\n }\n}\n\nfunction redactSensitiveValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(redactSensitiveValue);\n if (typeof value === 'string') return sanitizeStringValue(value);\n if (!value || typeof value !== 'object') return value;\n const out: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value)) {\n out[key] = isSensitiveKey(key) ? REDACTED : redactSensitiveValue(child);\n }\n return out;\n}\n\nfunction sanitizeDiagnosticText(text: string): string {\n return text\n .replace(URL_LIKE_RE, value => sanitizeTransportUrl(value))\n .replace(/Bearer\\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer [redacted]')\n .replace(/Basic\\s+[A-Za-z0-9+/=-]+/gi, 'Basic [redacted]')\n .replace(SENSITIVE_TEXT_FIELD_RE, (_match, prefix) => `${prefix}${REDACTED}`);\n}\n\nfunction sanitizeStringValue(value: string): string {\n return sanitizeDiagnosticText(value);\n}\n\nfunction normalizedKey(key: string): string {\n return key.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();\n}\n\nfunction isSensitiveKey(key: string): boolean {\n return SENSITIVE_KEY_RE.test(normalizedKey(key));\n}\n\nfunction isDiagnosticTextContentType(contentType: string): boolean {\n const lower = contentType.toLowerCase();\n if (!lower) return true;\n if (lower.includes('text/event-stream')) return false;\n return (\n lower.startsWith('text/') ||\n lower.includes('json') ||\n lower.includes('xml') ||\n lower.includes('javascript') ||\n lower.includes('x-www-form-urlencoded')\n );\n}\n\nasync function readResponseTextBounded(\n response: Response,\n limit: number\n): Promise<{ text: string; truncated: boolean }> {\n if (!response.body) {\n const text = await response.text();\n return { text: text.slice(0, limit), truncated: text.length > limit };\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let text = '';\n let truncated = false;\n\n try {\n while (text.length <= limit) {\n const { done, value } = await reader.read();\n if (done) break;\n text += decoder.decode(value, { stream: true });\n if (text.length > limit) {\n truncated = true;\n text = text.slice(0, limit);\n await reader.cancel();\n break;\n }\n }\n if (!truncated) text += decoder.decode();\n } finally {\n reader.releaseLock();\n }\n\n return { text, truncated };\n}\n\nfunction fingerprintDiagnosticValue(value: string): string {\n return createHmac('sha256', 'adcp-transport-diagnostics').update(value).digest('hex').slice(0, 16);\n}\n"],"mappings":"AAAA,SAAS,iBAAiB,2BAA2B;AACrD,SAAS,WAAW,qBAAqB;AACzC,SAAS,iBAAiB,2BAA2B;AACrD,MAAM,YAAY,cAAc,oBAAoB,YAAY,GAAG,CAAC;AACpE,MAAMA,WAAU,oBAAoB,YAAY,GAAG;AACnD,SAAS,+BAA+B;AACxC,SAAS,kBAAkB;AAiD3B,MAAM,qBAAqB,KAAK;AAChC,MAAM,WAAW;AAEjB,MAAM,oBAAoB,oBAAI,IAAI;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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UAAE;AACA,WAAO,YAAY;AAAA,EACrB;AAEA,SAAO,EAAE,MAAM,UAAU;AAC3B;AAEA,SAAS,2BAA2B,OAAuB;AACzD,SAAO,WAAW,UAAU,4BAA4B,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE;AACnG;","names":["require","text"]}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"source_sha": "4e553ad955f83b49c7d221ab5c3ff78237ad02e3",
|
|
5
5
|
"source_tarball_sha256": "580656d6466ef9f0d1119985e6726c2efea718dc671e2ad30957fcb2fd54af0f",
|
|
6
6
|
"upstream_adcp_version": "2.5.3",
|
|
7
|
-
"synced_at": "2026-07-
|
|
7
|
+
"synced_at": "2026-07-23T20:20:53.569Z"
|
|
8
8
|
}
|
|
@@ -36,7 +36,7 @@ export type { CreativeAdServerPlatform, BuildCreativeReturn as CreativeAdServerB
|
|
|
36
36
|
export type { CampaignGovernancePlatform, CheckGovernancePayload, SyncPlansPayload, ReportPlanOutcomePayload, GetPlanAuditLogsPayload, } from './specialisms/campaign-governance.mjs';
|
|
37
37
|
export type { ContentStandardsPlatform, ListContentStandardsPayload, GetContentStandardsPayload, CreateContentStandardsPayload, UpdateContentStandardsPayload, CalibrateContentPayload, ValidateContentDeliveryPayload, GetMediaBuyArtifactsPayload, GetCreativeFeaturesPayload, } from './specialisms/content-standards.mjs';
|
|
38
38
|
export type { PropertyListsPlatform, CollectionListsPlatform, CreatePropertyListPayload, UpdatePropertyListPayload, GetPropertyListPayload, ListPropertyListsPayload, DeletePropertyListPayload, CreateCollectionListPayload, UpdateCollectionListPayload, GetCollectionListPayload, ListCollectionListsPayload, DeleteCollectionListPayload, } from './specialisms/lists.mjs';
|
|
39
|
-
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, GetMediaBuyDeliveryPayload, GetMediaBuysPayload, ProvidePerformanceFeedbackPayload, ListCreativeFormatsPayload, ListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales.mjs';
|
|
39
|
+
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, GetMediaBuysPayload, ProvidePerformanceFeedbackPayload, ListCreativeFormatsPayload, ListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales.mjs';
|
|
40
40
|
export type { AudiencePlatform, Audience, SyncAudiencesPayload, SyncAudiencesRow, SyncAudiencesHandlerResult, AudienceStatus, } from './specialisms/audiences.mjs';
|
|
41
41
|
export type { SignalsPlatform, GetSignalsPayload, GetSignalsHandlerResult, ActivateSignalPayload, } from './specialisms/signals.mjs';
|
|
42
42
|
export type { SponsoredIntelligencePlatform, SIGetOfferingPayload, SIInitiateSessionPayload, SISendMessagePayload, SITerminateSessionPayload, } from './specialisms/sponsored-intelligence.mjs';
|
|
@@ -36,7 +36,7 @@ export type { CreativeAdServerPlatform, BuildCreativeReturn as CreativeAdServerB
|
|
|
36
36
|
export type { CampaignGovernancePlatform, CheckGovernancePayload, SyncPlansPayload, ReportPlanOutcomePayload, GetPlanAuditLogsPayload, } from './specialisms/campaign-governance';
|
|
37
37
|
export type { ContentStandardsPlatform, ListContentStandardsPayload, GetContentStandardsPayload, CreateContentStandardsPayload, UpdateContentStandardsPayload, CalibrateContentPayload, ValidateContentDeliveryPayload, GetMediaBuyArtifactsPayload, GetCreativeFeaturesPayload, } from './specialisms/content-standards';
|
|
38
38
|
export type { PropertyListsPlatform, CollectionListsPlatform, CreatePropertyListPayload, UpdatePropertyListPayload, GetPropertyListPayload, ListPropertyListsPayload, DeletePropertyListPayload, CreateCollectionListPayload, UpdateCollectionListPayload, GetCollectionListPayload, ListCollectionListsPayload, DeleteCollectionListPayload, } from './specialisms/lists';
|
|
39
|
-
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, GetMediaBuyDeliveryPayload, GetMediaBuysPayload, ProvidePerformanceFeedbackPayload, ListCreativeFormatsPayload, ListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales';
|
|
39
|
+
export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, GetMediaBuysPayload, ProvidePerformanceFeedbackPayload, ListCreativeFormatsPayload, ListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales';
|
|
40
40
|
export type { AudiencePlatform, Audience, SyncAudiencesPayload, SyncAudiencesRow, SyncAudiencesHandlerResult, AudienceStatus, } from './specialisms/audiences';
|
|
41
41
|
export type { SignalsPlatform, GetSignalsPayload, GetSignalsHandlerResult, ActivateSignalPayload, } from './specialisms/signals';
|
|
42
42
|
export type { SponsoredIntelligencePlatform, SIGetOfferingPayload, SIInitiateSessionPayload, SISendMessagePayload, SITerminateSessionPayload, } from './specialisms/sponsored-intelligence';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAi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,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMxH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpF,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtF,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAMhE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO9D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,kBAA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CAAmC,EACnC,6BAA6B,EAC7B,8BAA8B,EAC9B,gCAAgC,EAChC,8BAA8B,EAC9B,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAM5B,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,MAAM,EACN,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,aAAa,EACb,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iCAAiC,EACjC,qCAAqC,EACrC,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMxH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpF,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n BuildCreativeReturn,\n BuildCreativePayload,\n BuildCreativeMultiPayload,\n PreviewCreativePayload as CreativePreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n BuildCreativeReturn as CreativeAdServerBuildCreativeReturn,\n BuildCreativePayload as CreativeAdServerBuildCreativePayload,\n BuildCreativeMultiPayload as CreativeAdServerBuildCreativeMultiPayload,\n PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeAdServerListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n ListContentStandardsPayload,\n GetContentStandardsPayload,\n CreateContentStandardsPayload,\n UpdateContentStandardsPayload,\n CalibrateContentPayload,\n ValidateContentDeliveryPayload,\n GetMediaBuyArtifactsPayload,\n GetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n GetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n ListCreativeFormatsPayload,\n ListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n GetRightsPayload,\n AcquireRightsAcquiredPayload,\n AcquireRightsPendingApprovalPayload,\n AcquireRightsRejectedPayload,\n AcquireRightsPayload,\n UpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest,\n GetRightsSuccess,\n AcquireRightsRequest,\n AcquireRightsAcquired,\n AcquireRightsPendingApproval,\n AcquireRightsRejected,\n AcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, requireAsset } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport { buildListCreativesResponse, type BuildListCreativesResponseOpts } from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Wire-shape assembly helpers — emit correct Product / PricingOption /\n// package shapes from intent-shaped input. Reduces 30+ lines of wire\n// boilerplate per resource. Used in slim skill examples so LLMs scaffold\n// correct shapes from first attempt.\nexport { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBA,2BAAoE;AAQpE,0BAuBO;AAUP,4BAUO;AAWP,0BAA2E;AA8B3E,qBAAmD;AAMnD,0BAAoD;AAsBpD,yBAAmC;AAInC,4BAAsC;AAkBtC,qBAA8B;AAM9B,6BAA6E;AAsJ7E,2BAOO;AACP,+BAAsD;AACtD,2BAKO;AACP,oCAKO;AAKP,6BAaO;AAKP,8BAAuC;AAIvC,0BAAgF;AAIhF,wBAA+D;AAI/D,0BAMO;AAIP,qBAA0D;AAW1D,8BAgBO;AAoBP,sBAeO;AAOP,8BAA+D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n BuildCreativeReturn,\n BuildCreativePayload,\n BuildCreativeMultiPayload,\n PreviewCreativePayload as CreativePreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n BuildCreativeReturn as CreativeAdServerBuildCreativeReturn,\n BuildCreativePayload as CreativeAdServerBuildCreativePayload,\n BuildCreativeMultiPayload as CreativeAdServerBuildCreativeMultiPayload,\n PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeAdServerListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n ListContentStandardsPayload,\n GetContentStandardsPayload,\n CreateContentStandardsPayload,\n UpdateContentStandardsPayload,\n CalibrateContentPayload,\n ValidateContentDeliveryPayload,\n GetMediaBuyArtifactsPayload,\n GetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n ListCreativeFormatsPayload,\n ListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n GetRightsPayload,\n AcquireRightsAcquiredPayload,\n AcquireRightsPendingApprovalPayload,\n AcquireRightsRejectedPayload,\n AcquireRightsPayload,\n UpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest,\n GetRightsSuccess,\n AcquireRightsRequest,\n AcquireRightsAcquired,\n AcquireRightsPendingApproval,\n AcquireRightsRejected,\n AcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, requireAsset } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport { buildListCreativesResponse, type BuildListCreativesResponseOpts } from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Wire-shape assembly helpers — emit correct Product / PricingOption /\n// package shapes from intent-shaped input. Reduces 30+ lines of wire\n// boilerplate per resource. Used in slim skill examples so LLMs scaffold\n// correct shapes from first attempt.\nexport { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBA,2BAAoE;AAQpE,0BAuBO;AAUP,4BAUO;AAWP,0BAA2E;AA8B3E,qBAAmD;AAMnD,0BAAoD;AAsBpD,yBAAmC;AAInC,4BAAsC;AAkBtC,qBAA8B;AAM9B,6BAA6E;AAuJ7E,2BAOO;AACP,+BAAsD;AACtD,2BAKO;AACP,oCAKO;AAKP,6BAaO;AAKP,8BAAuC;AAIvC,0BAAgF;AAIhF,wBAA+D;AAI/D,0BAMO;AAIP,qBAA0D;AAW1D,8BAgBO;AAoBP,sBAeO;AAOP,8BAA+D;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n BuildCreativeReturn,\n BuildCreativePayload,\n BuildCreativeMultiPayload,\n PreviewCreativePayload as CreativePreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n BuildCreativeReturn as CreativeAdServerBuildCreativeReturn,\n BuildCreativePayload as CreativeAdServerBuildCreativePayload,\n BuildCreativeMultiPayload as CreativeAdServerBuildCreativeMultiPayload,\n PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeAdServerListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n ListContentStandardsPayload,\n GetContentStandardsPayload,\n CreateContentStandardsPayload,\n UpdateContentStandardsPayload,\n CalibrateContentPayload,\n ValidateContentDeliveryPayload,\n GetMediaBuyArtifactsPayload,\n GetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n GetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n ListCreativeFormatsPayload,\n ListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n GetRightsPayload,\n AcquireRightsAcquiredPayload,\n AcquireRightsPendingApprovalPayload,\n AcquireRightsRejectedPayload,\n AcquireRightsPayload,\n UpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest,\n GetRightsSuccess,\n AcquireRightsRequest,\n AcquireRightsAcquired,\n AcquireRightsPendingApproval,\n AcquireRightsRejected,\n AcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, requireAsset } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport { buildListCreativesResponse, type BuildListCreativesResponseOpts } from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Wire-shape assembly helpers — emit correct Product / PricingOption /\n// package shapes from intent-shaped input. Reduces 30+ lines of wire\n// boilerplate per resource. Used in slim skill examples so LLMs scaffold\n// correct shapes from first attempt.\nexport { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers';\n"],"mappings":"AAsBA,SAAmD,iBAAiB;AAQpE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAWP,SAAS,4BAA4B,sCAAsC;AA8B3E,SAAS,sBAAsB,oBAAoB;AAMnD,SAAS,mBAAmB,wBAAwB;AAsBpD,SAAS,0BAA0B;AAInC,SAAS,6BAA6B;AAkBtC,SAAS,qBAAqB;AAM9B,SAAS,qBAAqB,wBAAwB,uBAAuB;AAsJ7E;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP,SAAS,qBAAqB,wBAAwB;AACtD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAKP,SAAS,UAAU,oBAAoB;AAIvC,SAAS,kCAAuE;AAIhF,SAAS,wBAAsD;AAI/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,WAAW,iBAAiB,qBAAqB;AAW1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,cAAc,oBAAoB,oBAAoB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n BuildCreativeReturn,\n BuildCreativePayload,\n BuildCreativeMultiPayload,\n PreviewCreativePayload as CreativePreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n BuildCreativeReturn as CreativeAdServerBuildCreativeReturn,\n BuildCreativePayload as CreativeAdServerBuildCreativePayload,\n BuildCreativeMultiPayload as CreativeAdServerBuildCreativeMultiPayload,\n PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeAdServerListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n ListContentStandardsPayload,\n GetContentStandardsPayload,\n CreateContentStandardsPayload,\n UpdateContentStandardsPayload,\n CalibrateContentPayload,\n ValidateContentDeliveryPayload,\n GetMediaBuyArtifactsPayload,\n GetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n ListCreativeFormatsPayload,\n ListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n GetRightsPayload,\n AcquireRightsAcquiredPayload,\n AcquireRightsPendingApprovalPayload,\n AcquireRightsRejectedPayload,\n AcquireRightsPayload,\n UpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest,\n GetRightsSuccess,\n AcquireRightsRequest,\n AcquireRightsAcquired,\n AcquireRightsPendingApproval,\n AcquireRightsRejected,\n AcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, requireAsset } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport { buildListCreativesResponse, type BuildListCreativesResponseOpts } from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Wire-shape assembly helpers — emit correct Product / PricingOption /\n// package shapes from intent-shaped input. Reduces 30+ lines of wire\n// boilerplate per resource. Used in slim skill examples so LLMs scaffold\n// correct shapes from first attempt.\nexport { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers';\n"],"mappings":"AAsBA,SAAmD,iBAAiB;AAQpE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAWP,SAAS,4BAA4B,sCAAsC;AA8B3E,SAAS,sBAAsB,oBAAoB;AAMnD,SAAS,mBAAmB,wBAAwB;AAsBpD,SAAS,0BAA0B;AAInC,SAAS,6BAA6B;AAkBtC,SAAS,qBAAqB;AAM9B,SAAS,qBAAqB,wBAAwB,uBAAuB;AAuJ7E;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP,SAAS,qBAAqB,wBAAwB;AACtD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAKP,SAAS,UAAU,oBAAoB;AAIvC,SAAS,kCAAuE;AAIhF,SAAS,wBAAsD;AAI/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,WAAW,iBAAiB,qBAAqB;AAW1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,cAAc,oBAAoB,oBAAoB;","names":[]}
|
|
@@ -2058,24 +2058,32 @@ function buildMediaBuyHandlers(platform, taskRegistry, taskWebhookEmit, observab
|
|
|
2058
2058
|
allowPrivateWebhookUrls: pushOpts.allowPrivateWebhookUrls
|
|
2059
2059
|
});
|
|
2060
2060
|
const result = await sales.updateMediaBuy(media_buy_id, params, reqCtx);
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2061
|
+
return routeIfHandoff(
|
|
2062
|
+
taskRegistry,
|
|
2063
|
+
{
|
|
2064
2064
|
tool: "update_media_buy",
|
|
2065
2065
|
accountId: reqCtx.account.id,
|
|
2066
|
+
ownerScope: taskOwnerScopeFor(ctx, reqCtx.account.id),
|
|
2066
2067
|
pushNotificationUrl: push.url,
|
|
2067
|
-
|
|
2068
|
-
|
|
2068
|
+
pushNotificationToken: push.token,
|
|
2069
|
+
pushNotificationOperationId: push.operationId,
|
|
2069
2070
|
emitWebhook: taskWebhookEmit ?? ctx.emitWebhook,
|
|
2070
|
-
|
|
2071
|
+
autoEmitCompletion: pushOpts.autoEmitCompletionWebhooks,
|
|
2072
|
+
observability,
|
|
2071
2073
|
logger
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2074
|
+
},
|
|
2075
|
+
result,
|
|
2076
|
+
async (r) => {
|
|
2077
|
+
await persistTargetingOverlayFromUpdate(
|
|
2078
|
+
mediaBuyStore,
|
|
2079
|
+
reqCtx.account?.id,
|
|
2080
|
+
media_buy_id,
|
|
2081
|
+
params,
|
|
2082
|
+
logger
|
|
2083
|
+
);
|
|
2084
|
+
return r;
|
|
2085
|
+
}
|
|
2086
|
+
);
|
|
2079
2087
|
},
|
|
2080
2088
|
(r) => r
|
|
2081
2089
|
);
|