@adcp/sdk 15.0.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/adcp-grade.js +46 -2
- package/bin/adcp.js +7 -2
- package/dist/lib/canonical-references/index.d.mts +19 -1
- package/dist/lib/canonical-references/index.d.ts +19 -1
- package/dist/lib/canonical-references/index.js +81 -9
- package/dist/lib/canonical-references/index.mjs +80 -9
- package/dist/lib/client/core.d.mts +1 -0
- package/dist/lib/client/core.d.ts +1 -0
- package/dist/lib/core/AgentClient.d.mts +9 -1
- package/dist/lib/core/AgentClient.d.ts +9 -1
- package/dist/lib/core/AgentClient.js +10 -0
- package/dist/lib/core/AgentClient.mjs +10 -0
- package/dist/lib/core/SingleAgentClient.d.mts +13 -2
- package/dist/lib/core/SingleAgentClient.d.ts +13 -2
- package/dist/lib/core/SingleAgentClient.js +23 -5
- package/dist/lib/core/SingleAgentClient.mjs +23 -5
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/reporting/gcs/adapter.d.mts +31 -0
- package/dist/lib/reporting/gcs/adapter.d.ts +31 -0
- package/dist/lib/reporting/gcs/adapter.js +342 -0
- package/dist/lib/reporting/gcs/adapter.mjs +325 -0
- package/dist/lib/reporting/gcs/bucket-policy.d.mts +3 -0
- package/dist/lib/reporting/gcs/bucket-policy.d.ts +3 -0
- package/dist/lib/reporting/gcs/bucket-policy.js +31 -0
- package/dist/lib/reporting/gcs/bucket-policy.mjs +7 -0
- package/dist/lib/reporting/gcs/errors.d.mts +5 -0
- package/dist/lib/reporting/gcs/errors.d.ts +5 -0
- package/dist/lib/reporting/gcs/errors.js +41 -0
- package/dist/lib/reporting/gcs/errors.mjs +16 -0
- package/dist/lib/reporting/gcs/fence.d.mts +36 -0
- package/dist/lib/reporting/gcs/fence.d.ts +36 -0
- package/dist/lib/reporting/gcs/fence.js +250 -0
- package/dist/lib/reporting/gcs/fence.mjs +230 -0
- package/dist/lib/reporting/gcs/index.d.mts +7 -0
- package/dist/lib/reporting/gcs/index.d.ts +7 -0
- package/dist/lib/reporting/gcs/index.js +41 -0
- package/dist/lib/reporting/gcs/index.mjs +12 -0
- package/dist/lib/reporting/gcs/io.d.mts +7 -0
- package/dist/lib/reporting/gcs/io.d.ts +7 -0
- package/dist/lib/reporting/gcs/io.js +95 -0
- package/dist/lib/reporting/gcs/io.mjs +69 -0
- package/dist/lib/reporting/gcs/reader.d.mts +43 -0
- package/dist/lib/reporting/gcs/reader.d.ts +43 -0
- package/dist/lib/reporting/gcs/reader.js +193 -0
- package/dist/lib/reporting/gcs/reader.mjs +169 -0
- package/dist/lib/reporting/gcs/validation.d.mts +5 -0
- package/dist/lib/reporting/gcs/validation.d.ts +5 -0
- package/dist/lib/reporting/gcs/validation.js +49 -0
- package/dist/lib/reporting/gcs/validation.mjs +25 -0
- package/dist/lib/reporting/ledger/handler.d.mts +1 -0
- package/dist/lib/reporting/ledger/handler.d.ts +1 -0
- package/dist/lib/reporting/ledger/index.d.mts +1 -0
- package/dist/lib/reporting/ledger/index.d.ts +1 -0
- package/dist/lib/reporting/ledger/index.js +2 -0
- package/dist/lib/reporting/ledger/index.mjs +1 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +16 -1
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +16 -1
- package/dist/lib/reporting/ledger/managed-postgres.js +243 -2
- package/dist/lib/reporting/ledger/managed-postgres.mjs +248 -2
- package/dist/lib/reporting/ledger/object-writes.d.mts +69 -0
- package/dist/lib/reporting/ledger/object-writes.d.ts +69 -0
- package/dist/lib/reporting/ledger/object-writes.js +147 -0
- package/dist/lib/reporting/ledger/object-writes.mjs +114 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/a2a-adapter.d.mts +50 -1
- package/dist/lib/server/a2a-adapter.d.ts +50 -1
- package/dist/lib/server/a2a-adapter.js +230 -7
- package/dist/lib/server/a2a-adapter.mjs +237 -7
- package/dist/lib/server/auth-signature.d.mts +84 -46
- package/dist/lib/server/auth-signature.d.ts +84 -46
- package/dist/lib/server/auth-signature.js +48 -14
- package/dist/lib/server/auth-signature.mjs +58 -15
- package/dist/lib/server/create-adcp-server.js +5 -16
- package/dist/lib/server/create-adcp-server.mjs +5 -16
- package/dist/lib/server/index.d.mts +1 -1
- package/dist/lib/server/index.d.ts +1 -1
- package/dist/lib/server/index.js +2 -0
- package/dist/lib/server/index.mjs +3 -1
- package/dist/lib/signing/agent-fetch.js +3 -33
- package/dist/lib/signing/agent-fetch.mjs +3 -33
- package/dist/lib/signing/middleware.d.mts +9 -1
- package/dist/lib/signing/middleware.d.ts +9 -1
- package/dist/lib/signing/operation-resolution.d.mts +37 -0
- package/dist/lib/signing/operation-resolution.d.ts +37 -0
- package/dist/lib/signing/operation-resolution.js +154 -0
- package/dist/lib/signing/operation-resolution.mjs +125 -0
- package/dist/lib/signing/postgres-replay-store.d.mts +1 -1
- package/dist/lib/signing/postgres-replay-store.d.ts +1 -1
- package/dist/lib/signing/redis-replay-store.d.mts +1 -1
- package/dist/lib/signing/redis-replay-store.d.ts +1 -1
- package/dist/lib/signing/server.d.mts +1 -0
- package/dist/lib/signing/server.d.ts +1 -0
- package/dist/lib/signing/server.js +7 -0
- package/dist/lib/signing/server.mjs +8 -0
- package/dist/lib/signing/verifier.d.mts +36 -1
- package/dist/lib/signing/verifier.d.ts +36 -1
- package/dist/lib/signing/verifier.js +66 -34
- package/dist/lib/signing/verifier.mjs +61 -34
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.d.mts +12 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.d.ts +12 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.js +29 -2
- package/dist/lib/testing/storyboard/request-signing/a2a-dispatch.mjs +27 -1
- package/dist/lib/testing/storyboard/request-signing/a2a-operation-resolution.d.mts +61 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-operation-resolution.d.ts +61 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-operation-resolution.js +298 -0
- package/dist/lib/testing/storyboard/request-signing/a2a-operation-resolution.mjs +276 -0
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +31 -1
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +31 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +11 -0
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +11 -0
- package/dist/lib/testing/storyboard/request-signing/index.d.mts +5 -4
- package/dist/lib/testing/storyboard/request-signing/index.d.ts +5 -4
- package/dist/lib/testing/storyboard/request-signing/index.js +13 -0
- package/dist/lib/testing/storyboard/request-signing/index.mjs +18 -2
- package/dist/lib/testing/storyboard/request-signing/types.d.mts +43 -0
- package/dist/lib/testing/storyboard/request-signing/types.d.ts +43 -0
- package/dist/lib/testing/storyboard/request-signing/types.js +3 -0
- package/dist/lib/testing/storyboard/request-signing/types.mjs +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.mts +42 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts +42 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +100 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +104 -3
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +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.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/BUILD-AN-AGENT.md +9 -4
- package/docs/guides/CREATIVE-DELIVERY.md +34 -0
- package/docs/guides/REPORTING-GCS-FENCE.md +52 -0
- package/docs/guides/REPORTING-GCS-MANAGED.md +56 -0
- package/docs/guides/REPORTING-OPERATIONS.md +4 -0
- package/docs/guides/SIGNING-GUIDE.md +20 -6
- package/docs/guides/VALIDATE-YOUR-AGENT.md +4 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +5 -4
- package/docs/migration-buyer-agent-registry.md +1 -1
- package/package.json +19 -1
- package/skills/build-seller-agent/specialisms/signed-requests.md +2 -0
package/bin/adcp-grade.js
CHANGED
|
@@ -45,7 +45,25 @@ Options:
|
|
|
45
45
|
JSON-RPC tools/call envelope and posts to the
|
|
46
46
|
agent's MCP mount (see #612); \`raw\` posts to
|
|
47
47
|
per-operation AdCP endpoints (REST-binding agents);
|
|
48
|
-
\`a2a\` signs the official A2A client's request
|
|
48
|
+
\`a2a\` signs the official A2A client's request
|
|
49
|
+
and also grades the A2A operation-resolution
|
|
50
|
+
vectors (adcp#7945): required_for must be
|
|
51
|
+
enforced against the operation named by the
|
|
52
|
+
invocation DataPart's \`skill\`, not the JSON-RPC
|
|
53
|
+
method. Vector ids are prefixed a2a/. Tiers:
|
|
54
|
+
contradiction-resolution (MUST in 3.2) and
|
|
55
|
+
hardening (SHOULD in 3.2.x, MUST from 3.3). The
|
|
56
|
+
signed create_media_buy vectors need
|
|
57
|
+
--allow-live-side-effects (or a sandbox
|
|
58
|
+
contract). If the compliance bundle carries no
|
|
59
|
+
A2A vectors the run reports them unavailable.
|
|
60
|
+
--required-for <op[,op...]>
|
|
61
|
+
Agent's request_signing.required_for. Skips
|
|
62
|
+
vectors that assert an operation the agent does
|
|
63
|
+
not require (capability_profile_mismatch).
|
|
64
|
+
--protocol-methods-required-for <m[,m...]>
|
|
65
|
+
Agent's request_signing.protocol_methods_required_for
|
|
66
|
+
(e.g. SendMessage). Gates A2A negative/007.
|
|
49
67
|
--timeout <ms> Per-probe timeout (default 10000)
|
|
50
68
|
--json Emit the full GradeReport as JSON
|
|
51
69
|
-h, --help Show this help
|
|
@@ -54,6 +72,9 @@ Environment:
|
|
|
54
72
|
ADCP_GRADE_INITIALIZE_AUTHORIZATION
|
|
55
73
|
Authorization header used only for the MCP
|
|
56
74
|
initialize lifecycle (kept out of process argv).
|
|
75
|
+
ADCP_A2A_VECTORS_DIR Directory with the A2A operation-resolution
|
|
76
|
+
vectors (positive/ and negative/), overriding the
|
|
77
|
+
compliance bundle. For bundles that predate them.
|
|
57
78
|
|
|
58
79
|
Exit code:
|
|
59
80
|
0 all graded vectors passed (skipped vectors don't count as failures)
|
|
@@ -202,6 +223,12 @@ async function runRequestSigningGrader(args) {
|
|
|
202
223
|
options.signingProfileVersion = profile;
|
|
203
224
|
break;
|
|
204
225
|
}
|
|
226
|
+
case '--required-for':
|
|
227
|
+
options.agentRequiredFor = parseVectorList(args[++i], '--required-for');
|
|
228
|
+
break;
|
|
229
|
+
case '--protocol-methods-required-for':
|
|
230
|
+
options.agentProtocolMethodsRequiredFor = parseVectorList(args[++i], '--protocol-methods-required-for');
|
|
231
|
+
break;
|
|
205
232
|
case '--allow-live-side-effects':
|
|
206
233
|
options.allowLiveSideEffects = true;
|
|
207
234
|
break;
|
|
@@ -470,6 +497,7 @@ function printHumanReport(report, options = {}) {
|
|
|
470
497
|
`${report.passed_count} passed, ${report.failed_count} failed, ${report.skipped_count} skipped — total ${report.total_duration_ms}ms`
|
|
471
498
|
);
|
|
472
499
|
console.log(`Overall: ${report.passed ? 'PASS' : 'FAIL'}`);
|
|
500
|
+
printA2aOperationResolutionSummary(report.a2a_operation_resolution);
|
|
473
501
|
// Only hint on an EXPLICIT --transport raw run — mcp is the default now,
|
|
474
502
|
// so an unset transport already grades over MCP and the raw→mcp retry
|
|
475
503
|
// hint would misdirect (if mcp mode fails everywhere, it's a different
|
|
@@ -484,6 +512,22 @@ function printHumanReport(report, options = {}) {
|
|
|
484
512
|
console.log();
|
|
485
513
|
}
|
|
486
514
|
|
|
515
|
+
function printA2aOperationResolutionSummary(summary) {
|
|
516
|
+
if (!summary) return;
|
|
517
|
+
console.log();
|
|
518
|
+
if (!summary.vectors_available) {
|
|
519
|
+
console.log(`⚠ A2A operation-resolution: ${summary.message}. required_for over A2A was NOT graded.`);
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
const t = summary.tiers;
|
|
523
|
+
const line = (label, tier) =>
|
|
524
|
+
` ${label}: ${tier.passed} passed, ${tier.failed} failed, ${tier.skipped} skipped` +
|
|
525
|
+
(tier.failed_vectors.length ? ` (failed: ${tier.failed_vectors.join(', ')})` : '');
|
|
526
|
+
console.log(`A2A operation-resolution vectors (source: ${summary.source}):`);
|
|
527
|
+
console.log(line('contradiction-resolution (MUST in 3.2)', t['contradiction-resolution']));
|
|
528
|
+
console.log(line('hardening (SHOULD in 3.2.x, MUST from 3.3)', t.hardening));
|
|
529
|
+
}
|
|
530
|
+
|
|
487
531
|
/**
|
|
488
532
|
* Heuristic: if the grader ran in `raw` mode (explicit --transport raw —
|
|
489
533
|
* mcp is the default) and every non-skipped vector
|
|
@@ -516,7 +560,7 @@ function formatRow(r) {
|
|
|
516
560
|
: r.passed
|
|
517
561
|
? `${r.http_status}${r.actual_error_code ? ` ${r.actual_error_code}` : ''}`
|
|
518
562
|
: (r.diagnostic ?? 'see report');
|
|
519
|
-
return { id, status, detail };
|
|
563
|
+
return { id, status, detail: r.tier && !r.skipped ? `[${r.tier}] ${detail}` : detail };
|
|
520
564
|
}
|
|
521
565
|
|
|
522
566
|
module.exports = { handleGradeCommand };
|
package/bin/adcp.js
CHANGED
|
@@ -1966,7 +1966,9 @@ COMMANDS:
|
|
|
1966
1966
|
doctor [options] Check project secrets, SDK drift, and migrations
|
|
1967
1967
|
storyboard <subcommand> Test agent flows (run, list, show, step)
|
|
1968
1968
|
specialism <subcommand> Inspect a compliance specialism (list, show)
|
|
1969
|
-
grade <subject> <url> Conformance graders (e.g. request-signing
|
|
1969
|
+
grade <subject> <url> Conformance graders (e.g. request-signing; with
|
|
1970
|
+
--transport a2a it also grades the A2A
|
|
1971
|
+
operation-resolution vectors)
|
|
1970
1972
|
fuzz <url> Property-based conformance fuzzing against schemas
|
|
1971
1973
|
resolve <agent-url> Walk the brand_json_url discovery chain
|
|
1972
1974
|
(capabilities -> brand.json -> JWKS) and print
|
|
@@ -2191,7 +2193,10 @@ REQUEST-SIGNING VECTOR OPTIONS (signed_requests storyboard):
|
|
|
2191
2193
|
discovery. Pass raw for agents that
|
|
2192
2194
|
expose AdCP tools as per-operation HTTP
|
|
2193
2195
|
endpoints. Mirrors
|
|
2194
|
-
\`adcp grade request-signing --transport
|
|
2196
|
+
\`adcp grade request-signing --transport\`,
|
|
2197
|
+
which with a2a additionally grades the A2A
|
|
2198
|
+
operation-resolution vectors (required_for
|
|
2199
|
+
keyed on the DataPart skill, adcp#7945).
|
|
2195
2200
|
--signing-skip-vectors IDS Comma-separated vector ids to skip (graded
|
|
2196
2201
|
operator_skip), e.g.
|
|
2197
2202
|
025-jwk-alg-crv-mismatch. Unknown ids are
|
|
@@ -5,7 +5,7 @@ export interface CanonicalReference {
|
|
|
5
5
|
}
|
|
6
6
|
export type CanonicalReferenceKind = 'format_schema' | 'platform_extensions' | 'generic';
|
|
7
7
|
export type CanonicalReferenceStatus = 'resolved' | 'unresolvable' | 'invalid_document' | 'invalid_schema' | 'digest_mismatch' | 'blocked_unsafe_url' | 'invalid_ref';
|
|
8
|
-
export type CanonicalReferenceErrorCode = 'invalid_ref' | 'non_https_url' | 'unsafe_url' | 'redirect_blocked' | 'http_error' | 'network_error' | 'body_too_large' | 'invalid_json' | 'document_too_deep' | 'invalid_json_schema' | 'unsupported_schema_draft' | 'ref_sandbox_violation' | 'external_ref_unpinned' | 'keyword_limit_exceeded' | 'budget_exceeded' | 'digest_mismatch';
|
|
8
|
+
export type CanonicalReferenceErrorCode = 'invalid_ref' | 'non_https_url' | 'unsafe_url' | 'redirect_blocked' | 'http_error' | 'network_error' | 'body_too_large' | 'invalid_json' | 'document_too_deep' | 'invalid_json_schema' | 'unsupported_schema_draft' | 'ref_sandbox_violation' | 'external_ref_unpinned' | 'keyword_limit_exceeded' | 'budget_exceeded' | 'invalid_options' | 'aborted' | 'access_denied' | 'digest_mismatch';
|
|
9
9
|
export interface CanonicalReferenceError {
|
|
10
10
|
code: CanonicalReferenceErrorCode;
|
|
11
11
|
message: string;
|
|
@@ -63,7 +63,25 @@ export interface CanonicalReferenceCacheOptions {
|
|
|
63
63
|
/** Maximum estimated retained bytes. Default 32 MiB. Set to 0 to disable caching. */
|
|
64
64
|
maxBytes?: number;
|
|
65
65
|
}
|
|
66
|
+
/** Host-owned authenticated document transport. It must enforce destination scope before I/O. */
|
|
67
|
+
export interface CanonicalDocumentReader {
|
|
68
|
+
read(request: {
|
|
69
|
+
uri: string;
|
|
70
|
+
maxBytes: number;
|
|
71
|
+
signal: AbortSignal;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
body: Uint8Array;
|
|
74
|
+
contentType?: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
/** Stable, secret-free failure for an authenticated document transport. */
|
|
78
|
+
export declare class CanonicalDocumentReadError extends Error {
|
|
79
|
+
readonly code: 'access_denied' | 'unsafe_url' | 'body_too_large' | 'network_error' | 'invalid_options' | 'aborted';
|
|
80
|
+
constructor(code: 'access_denied' | 'unsafe_url' | 'body_too_large' | 'network_error' | 'invalid_options' | 'aborted');
|
|
81
|
+
}
|
|
66
82
|
export interface CanonicalReferenceResolverOptions {
|
|
83
|
+
/** Private transports bypass all caches so every resolution re-authorizes. No HTTP fallback. */
|
|
84
|
+
documentReader?: CanonicalDocumentReader;
|
|
67
85
|
/** Caller-owned cache. Defaults to a fresh bounded per-resolver LRU. */
|
|
68
86
|
cache?: CanonicalReferenceCache;
|
|
69
87
|
/** Default 5_000 ms. */
|
|
@@ -5,7 +5,7 @@ export interface CanonicalReference {
|
|
|
5
5
|
}
|
|
6
6
|
export type CanonicalReferenceKind = 'format_schema' | 'platform_extensions' | 'generic';
|
|
7
7
|
export type CanonicalReferenceStatus = 'resolved' | 'unresolvable' | 'invalid_document' | 'invalid_schema' | 'digest_mismatch' | 'blocked_unsafe_url' | 'invalid_ref';
|
|
8
|
-
export type CanonicalReferenceErrorCode = 'invalid_ref' | 'non_https_url' | 'unsafe_url' | 'redirect_blocked' | 'http_error' | 'network_error' | 'body_too_large' | 'invalid_json' | 'document_too_deep' | 'invalid_json_schema' | 'unsupported_schema_draft' | 'ref_sandbox_violation' | 'external_ref_unpinned' | 'keyword_limit_exceeded' | 'budget_exceeded' | 'digest_mismatch';
|
|
8
|
+
export type CanonicalReferenceErrorCode = 'invalid_ref' | 'non_https_url' | 'unsafe_url' | 'redirect_blocked' | 'http_error' | 'network_error' | 'body_too_large' | 'invalid_json' | 'document_too_deep' | 'invalid_json_schema' | 'unsupported_schema_draft' | 'ref_sandbox_violation' | 'external_ref_unpinned' | 'keyword_limit_exceeded' | 'budget_exceeded' | 'invalid_options' | 'aborted' | 'access_denied' | 'digest_mismatch';
|
|
9
9
|
export interface CanonicalReferenceError {
|
|
10
10
|
code: CanonicalReferenceErrorCode;
|
|
11
11
|
message: string;
|
|
@@ -63,7 +63,25 @@ export interface CanonicalReferenceCacheOptions {
|
|
|
63
63
|
/** Maximum estimated retained bytes. Default 32 MiB. Set to 0 to disable caching. */
|
|
64
64
|
maxBytes?: number;
|
|
65
65
|
}
|
|
66
|
+
/** Host-owned authenticated document transport. It must enforce destination scope before I/O. */
|
|
67
|
+
export interface CanonicalDocumentReader {
|
|
68
|
+
read(request: {
|
|
69
|
+
uri: string;
|
|
70
|
+
maxBytes: number;
|
|
71
|
+
signal: AbortSignal;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
body: Uint8Array;
|
|
74
|
+
contentType?: string;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
/** Stable, secret-free failure for an authenticated document transport. */
|
|
78
|
+
export declare class CanonicalDocumentReadError extends Error {
|
|
79
|
+
readonly code: 'access_denied' | 'unsafe_url' | 'body_too_large' | 'network_error' | 'invalid_options' | 'aborted';
|
|
80
|
+
constructor(code: 'access_denied' | 'unsafe_url' | 'body_too_large' | 'network_error' | 'invalid_options' | 'aborted');
|
|
81
|
+
}
|
|
66
82
|
export interface CanonicalReferenceResolverOptions {
|
|
83
|
+
/** Private transports bypass all caches so every resolution re-authorizes. No HTTP fallback. */
|
|
84
|
+
documentReader?: CanonicalDocumentReader;
|
|
67
85
|
/** Caller-owned cache. Defaults to a fresh bounded per-resolver LRU. */
|
|
68
86
|
cache?: CanonicalReferenceCache;
|
|
69
87
|
/** Default 5_000 ms. */
|
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var canonical_references_exports = {};
|
|
30
30
|
__export(canonical_references_exports, {
|
|
31
|
+
CanonicalDocumentReadError: () => CanonicalDocumentReadError,
|
|
31
32
|
canonicalReferenceCacheKey: () => canonicalReferenceCacheKey,
|
|
32
33
|
createCanonicalReferenceCache: () => createCanonicalReferenceCache,
|
|
33
34
|
createCanonicalReferenceResolver: () => createCanonicalReferenceResolver,
|
|
@@ -44,6 +45,18 @@ var import_sandbox_refs = require('../v2/format-schema/sandbox-refs.js');
|
|
|
44
45
|
var import_regex_safety = require('../v2/format-schema/regex-safety.js');
|
|
45
46
|
var import_strict_json = require('../signing/agent-resolver/strict-json.js');
|
|
46
47
|
const Ajv2020 = require("ajv/dist/2020");
|
|
48
|
+
class CanonicalDocumentReadError extends Error {
|
|
49
|
+
constructor(code) {
|
|
50
|
+
super(`Canonical document read: ${code}`);
|
|
51
|
+
this.code = code;
|
|
52
|
+
this.name = "CanonicalDocumentReadError";
|
|
53
|
+
Object.defineProperty(this, /* @__PURE__ */ Symbol.for("adcp.canonicalDocumentReadError"), { value: true });
|
|
54
|
+
}
|
|
55
|
+
code;
|
|
56
|
+
}
|
|
57
|
+
function isCanonicalDocumentReadError(error) {
|
|
58
|
+
return !!error && typeof error === "object" && error[/* @__PURE__ */ Symbol.for("adcp.canonicalDocumentReadError")] === true;
|
|
59
|
+
}
|
|
47
60
|
const DEFAULT_TIMEOUT_MS = 5e3;
|
|
48
61
|
const DEFAULT_MAX_BODY_BYTES = 1024 * 1024;
|
|
49
62
|
const DEFAULT_MAX_TOTAL_REF_BYTES = 8 * 1024 * 1024;
|
|
@@ -149,10 +162,13 @@ function exceedsJsonDocumentDepth(value) {
|
|
|
149
162
|
return false;
|
|
150
163
|
}
|
|
151
164
|
function createCanonicalReferenceResolver(defaults = {}) {
|
|
165
|
+
if (defaults.documentReader && (!Number.isSafeInteger(defaults.timeoutMs ?? DEFAULT_TIMEOUT_MS) || (defaults.timeoutMs ?? DEFAULT_TIMEOUT_MS) < 1 || (defaults.timeoutMs ?? DEFAULT_TIMEOUT_MS) > 6e4 || !Number.isSafeInteger(defaults.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES) || (defaults.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES) < 1 || (defaults.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES) > 8 * 1024 * 1024))
|
|
166
|
+
throw new RangeError("Private canonical document transport limits are invalid");
|
|
152
167
|
const cache = defaults.cache ?? createCanonicalReferenceCache();
|
|
153
168
|
const merge = (options = {}) => ({
|
|
154
169
|
...defaults,
|
|
155
170
|
...options,
|
|
171
|
+
documentReader: defaults.documentReader ?? options.documentReader,
|
|
156
172
|
cache
|
|
157
173
|
});
|
|
158
174
|
return {
|
|
@@ -205,7 +221,7 @@ async function fetchJsonReference(ref, options) {
|
|
|
205
221
|
const kind = options.kind ?? "generic";
|
|
206
222
|
const valid = validateRef(ref, kind, options);
|
|
207
223
|
if (!valid.ok) return valid.result;
|
|
208
|
-
const cache = options.cache;
|
|
224
|
+
const cache = options.documentReader ? void 0 : options.cache;
|
|
209
225
|
const cacheKey = canonicalReferenceCacheKey(ref, options);
|
|
210
226
|
const cached = cache?.get(cacheKey);
|
|
211
227
|
if (cached) {
|
|
@@ -223,15 +239,70 @@ async function fetchJsonReference(ref, options) {
|
|
|
223
239
|
}
|
|
224
240
|
let response;
|
|
225
241
|
try {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
242
|
+
if (options.documentReader) {
|
|
243
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
244
|
+
const maxBytes = options.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES;
|
|
245
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 6e4 || !Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 8 * 1024 * 1024)
|
|
246
|
+
throw new CanonicalDocumentReadError("invalid_options");
|
|
247
|
+
const controller = new AbortController();
|
|
248
|
+
const onAbort = () => controller.abort(new CanonicalDocumentReadError("aborted"));
|
|
249
|
+
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
250
|
+
if (options.signal?.aborted) onAbort();
|
|
251
|
+
let abortListener;
|
|
252
|
+
const timer = setTimeout(() => controller.abort(new CanonicalDocumentReadError("network_error")), timeoutMs);
|
|
253
|
+
try {
|
|
254
|
+
controller.signal.throwIfAborted();
|
|
255
|
+
const read = await Promise.race([
|
|
256
|
+
options.documentReader.read({ uri: ref.uri, maxBytes, signal: controller.signal }),
|
|
257
|
+
new Promise((_, reject) => {
|
|
258
|
+
abortListener = () => reject(controller.signal.reason);
|
|
259
|
+
controller.signal.addEventListener("abort", abortListener, { once: true });
|
|
260
|
+
if (controller.signal.aborted) abortListener();
|
|
261
|
+
})
|
|
262
|
+
]);
|
|
263
|
+
controller.signal.throwIfAborted();
|
|
264
|
+
if (!(read?.body instanceof Uint8Array) || read.body.byteLength > maxBytes)
|
|
265
|
+
throw new CanonicalDocumentReadError("body_too_large");
|
|
266
|
+
response = {
|
|
267
|
+
status: 200,
|
|
268
|
+
body: Uint8Array.from(read.body),
|
|
269
|
+
headers: { "content-type": read.contentType ?? "" }
|
|
270
|
+
};
|
|
271
|
+
} finally {
|
|
272
|
+
clearTimeout(timer);
|
|
273
|
+
options.signal?.removeEventListener("abort", onAbort);
|
|
274
|
+
if (abortListener) controller.signal.removeEventListener("abort", abortListener);
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
response = await (0, import_ssrf_fetch.ssrfSafeFetch)(ref.uri, {
|
|
278
|
+
method: "GET",
|
|
279
|
+
headers: { accept: "application/json, application/schema+json" },
|
|
280
|
+
timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
281
|
+
maxBodyBytes: options.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES,
|
|
282
|
+
allowPrivateIp: options.allowPrivateNetwork === true,
|
|
283
|
+
signal: options.signal
|
|
284
|
+
});
|
|
285
|
+
}
|
|
234
286
|
} catch (err) {
|
|
287
|
+
if (isCanonicalDocumentReadError(err)) {
|
|
288
|
+
const code = [
|
|
289
|
+
"access_denied",
|
|
290
|
+
"unsafe_url",
|
|
291
|
+
"body_too_large",
|
|
292
|
+
"network_error",
|
|
293
|
+
"invalid_options",
|
|
294
|
+
"aborted"
|
|
295
|
+
].includes(err.code) ? err.code : "network_error";
|
|
296
|
+
return fail(
|
|
297
|
+
kind,
|
|
298
|
+
ref,
|
|
299
|
+
cacheKey,
|
|
300
|
+
code === "unsafe_url" ? "blocked_unsafe_url" : "unresolvable",
|
|
301
|
+
code,
|
|
302
|
+
`Canonical document read failed: ${code}`,
|
|
303
|
+
{ retryable: code === "network_error" }
|
|
304
|
+
);
|
|
305
|
+
}
|
|
235
306
|
if (err instanceof import_ssrf_fetch.SsrfRefusedError) {
|
|
236
307
|
if (err.code === "body_exceeds_limit") {
|
|
237
308
|
return fail(
|
|
@@ -753,6 +824,7 @@ function countSchemaKeywords(root) {
|
|
|
753
824
|
}
|
|
754
825
|
// Annotate the CommonJS export names for ESM import in node:
|
|
755
826
|
0 && (module.exports = {
|
|
827
|
+
CanonicalDocumentReadError,
|
|
756
828
|
canonicalReferenceCacheKey,
|
|
757
829
|
createCanonicalReferenceCache,
|
|
758
830
|
createCanonicalReferenceResolver,
|
|
@@ -18,6 +18,18 @@ import {
|
|
|
18
18
|
} from "../v2/format-schema/sandbox-refs.mjs";
|
|
19
19
|
import { findUnsafeRegexPattern, unsafeRegexDetails } from "../v2/format-schema/regex-safety.mjs";
|
|
20
20
|
import { rejectDuplicateJsonKeys } from "../signing/agent-resolver/strict-json.mjs";
|
|
21
|
+
class CanonicalDocumentReadError extends Error {
|
|
22
|
+
constructor(code) {
|
|
23
|
+
super(`Canonical document read: ${code}`);
|
|
24
|
+
this.code = code;
|
|
25
|
+
this.name = "CanonicalDocumentReadError";
|
|
26
|
+
Object.defineProperty(this, /* @__PURE__ */ Symbol.for("adcp.canonicalDocumentReadError"), { value: true });
|
|
27
|
+
}
|
|
28
|
+
code;
|
|
29
|
+
}
|
|
30
|
+
function isCanonicalDocumentReadError(error) {
|
|
31
|
+
return !!error && typeof error === "object" && error[/* @__PURE__ */ Symbol.for("adcp.canonicalDocumentReadError")] === true;
|
|
32
|
+
}
|
|
21
33
|
const DEFAULT_TIMEOUT_MS = 5e3;
|
|
22
34
|
const DEFAULT_MAX_BODY_BYTES = 1024 * 1024;
|
|
23
35
|
const DEFAULT_MAX_TOTAL_REF_BYTES = 8 * 1024 * 1024;
|
|
@@ -123,10 +135,13 @@ function exceedsJsonDocumentDepth(value) {
|
|
|
123
135
|
return false;
|
|
124
136
|
}
|
|
125
137
|
function createCanonicalReferenceResolver(defaults = {}) {
|
|
138
|
+
if (defaults.documentReader && (!Number.isSafeInteger(defaults.timeoutMs ?? DEFAULT_TIMEOUT_MS) || (defaults.timeoutMs ?? DEFAULT_TIMEOUT_MS) < 1 || (defaults.timeoutMs ?? DEFAULT_TIMEOUT_MS) > 6e4 || !Number.isSafeInteger(defaults.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES) || (defaults.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES) < 1 || (defaults.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES) > 8 * 1024 * 1024))
|
|
139
|
+
throw new RangeError("Private canonical document transport limits are invalid");
|
|
126
140
|
const cache = defaults.cache ?? createCanonicalReferenceCache();
|
|
127
141
|
const merge = (options = {}) => ({
|
|
128
142
|
...defaults,
|
|
129
143
|
...options,
|
|
144
|
+
documentReader: defaults.documentReader ?? options.documentReader,
|
|
130
145
|
cache
|
|
131
146
|
});
|
|
132
147
|
return {
|
|
@@ -179,7 +194,7 @@ async function fetchJsonReference(ref, options) {
|
|
|
179
194
|
const kind = options.kind ?? "generic";
|
|
180
195
|
const valid = validateRef(ref, kind, options);
|
|
181
196
|
if (!valid.ok) return valid.result;
|
|
182
|
-
const cache = options.cache;
|
|
197
|
+
const cache = options.documentReader ? void 0 : options.cache;
|
|
183
198
|
const cacheKey = canonicalReferenceCacheKey(ref, options);
|
|
184
199
|
const cached = cache?.get(cacheKey);
|
|
185
200
|
if (cached) {
|
|
@@ -197,15 +212,70 @@ async function fetchJsonReference(ref, options) {
|
|
|
197
212
|
}
|
|
198
213
|
let response;
|
|
199
214
|
try {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
215
|
+
if (options.documentReader) {
|
|
216
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
217
|
+
const maxBytes = options.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES;
|
|
218
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 6e4 || !Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 8 * 1024 * 1024)
|
|
219
|
+
throw new CanonicalDocumentReadError("invalid_options");
|
|
220
|
+
const controller = new AbortController();
|
|
221
|
+
const onAbort = () => controller.abort(new CanonicalDocumentReadError("aborted"));
|
|
222
|
+
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
223
|
+
if (options.signal?.aborted) onAbort();
|
|
224
|
+
let abortListener;
|
|
225
|
+
const timer = setTimeout(() => controller.abort(new CanonicalDocumentReadError("network_error")), timeoutMs);
|
|
226
|
+
try {
|
|
227
|
+
controller.signal.throwIfAborted();
|
|
228
|
+
const read = await Promise.race([
|
|
229
|
+
options.documentReader.read({ uri: ref.uri, maxBytes, signal: controller.signal }),
|
|
230
|
+
new Promise((_, reject) => {
|
|
231
|
+
abortListener = () => reject(controller.signal.reason);
|
|
232
|
+
controller.signal.addEventListener("abort", abortListener, { once: true });
|
|
233
|
+
if (controller.signal.aborted) abortListener();
|
|
234
|
+
})
|
|
235
|
+
]);
|
|
236
|
+
controller.signal.throwIfAborted();
|
|
237
|
+
if (!(read?.body instanceof Uint8Array) || read.body.byteLength > maxBytes)
|
|
238
|
+
throw new CanonicalDocumentReadError("body_too_large");
|
|
239
|
+
response = {
|
|
240
|
+
status: 200,
|
|
241
|
+
body: Uint8Array.from(read.body),
|
|
242
|
+
headers: { "content-type": read.contentType ?? "" }
|
|
243
|
+
};
|
|
244
|
+
} finally {
|
|
245
|
+
clearTimeout(timer);
|
|
246
|
+
options.signal?.removeEventListener("abort", onAbort);
|
|
247
|
+
if (abortListener) controller.signal.removeEventListener("abort", abortListener);
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
response = await ssrfSafeFetch(ref.uri, {
|
|
251
|
+
method: "GET",
|
|
252
|
+
headers: { accept: "application/json, application/schema+json" },
|
|
253
|
+
timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
254
|
+
maxBodyBytes: options.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES,
|
|
255
|
+
allowPrivateIp: options.allowPrivateNetwork === true,
|
|
256
|
+
signal: options.signal
|
|
257
|
+
});
|
|
258
|
+
}
|
|
208
259
|
} catch (err) {
|
|
260
|
+
if (isCanonicalDocumentReadError(err)) {
|
|
261
|
+
const code = [
|
|
262
|
+
"access_denied",
|
|
263
|
+
"unsafe_url",
|
|
264
|
+
"body_too_large",
|
|
265
|
+
"network_error",
|
|
266
|
+
"invalid_options",
|
|
267
|
+
"aborted"
|
|
268
|
+
].includes(err.code) ? err.code : "network_error";
|
|
269
|
+
return fail(
|
|
270
|
+
kind,
|
|
271
|
+
ref,
|
|
272
|
+
cacheKey,
|
|
273
|
+
code === "unsafe_url" ? "blocked_unsafe_url" : "unresolvable",
|
|
274
|
+
code,
|
|
275
|
+
`Canonical document read failed: ${code}`,
|
|
276
|
+
{ retryable: code === "network_error" }
|
|
277
|
+
);
|
|
278
|
+
}
|
|
209
279
|
if (err instanceof SsrfRefusedError) {
|
|
210
280
|
if (err.code === "body_exceeds_limit") {
|
|
211
281
|
return fail(
|
|
@@ -726,6 +796,7 @@ function countSchemaKeywords(root) {
|
|
|
726
796
|
return walk(root);
|
|
727
797
|
}
|
|
728
798
|
export {
|
|
799
|
+
CanonicalDocumentReadError,
|
|
729
800
|
canonicalReferenceCacheKey,
|
|
730
801
|
createCanonicalReferenceCache,
|
|
731
802
|
createCanonicalReferenceResolver,
|
|
@@ -7,3 +7,4 @@ export { InMemoryWebhookRegistrationStore, type InMemoryWebhookRegistrationStore
|
|
|
7
7
|
export type { ConversationConfig, ConversationContext, InputHandler, InputHandlerResponse, InputRequest, Message, TaskInfo, TaskOptions, TaskResult, TaskResultCompleted, TaskResultFailure, TaskResultIntermediate, TaskResultMetadata, } from '../core/ConversationTypes.mjs';
|
|
8
8
|
export type { AgentConfig } from '../types/adcp.mjs';
|
|
9
9
|
export type { ResolveAccountOptions, ListedAccount } from '../core/account-resolution.mjs';
|
|
10
|
+
export type { CreativeFormatWireMode } from '../v2/projection/creative-delivery.mjs';
|
|
@@ -7,3 +7,4 @@ export { InMemoryWebhookRegistrationStore, type InMemoryWebhookRegistrationStore
|
|
|
7
7
|
export type { ConversationConfig, ConversationContext, InputHandler, InputHandlerResponse, InputRequest, Message, TaskInfo, TaskOptions, TaskResult, TaskResultCompleted, TaskResultFailure, TaskResultIntermediate, TaskResultMetadata, } from '../core/ConversationTypes';
|
|
8
8
|
export type { AgentConfig } from '../types/adcp';
|
|
9
9
|
export type { ResolveAccountOptions, ListedAccount } from '../core/account-resolution';
|
|
10
|
+
export type { CreativeFormatWireMode } from '../v2/projection/creative-delivery';
|
|
@@ -14,7 +14,7 @@ import type { MediaBuyLifecycleCoordinator, MediaBuyLifecycleCoordinatorOptions
|
|
|
14
14
|
import type { ProposalRefinementCapabilities, RefineProposalsInput, RefineProposalsResponse } from '../negotiation/types.mjs';
|
|
15
15
|
import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2.mjs';
|
|
16
16
|
import type { ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot.mjs';
|
|
17
|
-
import type { CanonicalCreateMediaBuyInput, CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalGetProductsResponse, CanonicalListCreativesRequest, CanonicalListCreativesResponse, CanonicalPreviewCreativeRequest, CanonicalPreviewCreativeResponse, CanonicalSyncCreativesRequest, CanonicalUpdateMediaBuyRequest } from '../v2/projection/creative-delivery.mjs';
|
|
17
|
+
import type { CanonicalCreateMediaBuyInput, CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalGetProductsResponse, CanonicalListCreativesRequest, CanonicalListCreativesResponse, CanonicalPreviewCreativeRequest, CanonicalPreviewCreativeResponse, CanonicalSyncCreativesRequest, CanonicalUpdateMediaBuyRequest, CreativeFormatWireMode } from '../v2/projection/creative-delivery.mjs';
|
|
18
18
|
export type { CanonicalGetProductsResponse } from '../v2/projection/creative-delivery.mjs';
|
|
19
19
|
export type CanonicalProjectionTaskOptions = TaskOptions & {
|
|
20
20
|
/** Migration escape hatch for seller-specific legacy refs absent from the bundled registry. */
|
|
@@ -533,6 +533,14 @@ export declare class AgentClient {
|
|
|
533
533
|
* For v2 servers: builds synthetic capabilities from tool list
|
|
534
534
|
*/
|
|
535
535
|
getCapabilities(options?: Pick<TaskOptions, 'signal' | 'transport'>): Promise<AdcpCapabilities>;
|
|
536
|
+
/**
|
|
537
|
+
* Resolve the creative wire mode used by canonical writes without sending a
|
|
538
|
+
* mutation. Uses capabilities, this tool's input schema, and the client wire
|
|
539
|
+
* pin. Older peers with insufficient evidence return `unknown` and require
|
|
540
|
+
* an unambiguous legacy reference during projection; conflicting evidence
|
|
541
|
+
* or unproven support with a 3.2+ buyer pin throws `CreativeFormatCapabilityError`.
|
|
542
|
+
*/
|
|
543
|
+
resolveCreativeFormatWireMode(taskType: 'sync_creatives' | 'create_media_buy' | 'update_media_buy', options?: Pick<TaskOptions, 'signal' | 'transport'>): Promise<CreativeFormatWireMode>;
|
|
536
544
|
/** Scope token for a tenant-bound, application-owned capability preflight. */
|
|
537
545
|
getCapabilityEvidenceScope(): import('./SingleAgentClient.mjs').CapabilityEvidenceScope;
|
|
538
546
|
/** Install fresh capability evidence without making a redundant probe. */
|
|
@@ -14,7 +14,7 @@ import type { MediaBuyLifecycleCoordinator, MediaBuyLifecycleCoordinatorOptions
|
|
|
14
14
|
import type { ProposalRefinementCapabilities, RefineProposalsInput, RefineProposalsResponse } from '../negotiation/types';
|
|
15
15
|
import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2';
|
|
16
16
|
import type { ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot';
|
|
17
|
-
import type { CanonicalCreateMediaBuyInput, CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalGetProductsResponse, CanonicalListCreativesRequest, CanonicalListCreativesResponse, CanonicalPreviewCreativeRequest, CanonicalPreviewCreativeResponse, CanonicalSyncCreativesRequest, CanonicalUpdateMediaBuyRequest } from '../v2/projection/creative-delivery';
|
|
17
|
+
import type { CanonicalCreateMediaBuyInput, CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalGetProductsResponse, CanonicalListCreativesRequest, CanonicalListCreativesResponse, CanonicalPreviewCreativeRequest, CanonicalPreviewCreativeResponse, CanonicalSyncCreativesRequest, CanonicalUpdateMediaBuyRequest, CreativeFormatWireMode } from '../v2/projection/creative-delivery';
|
|
18
18
|
export type { CanonicalGetProductsResponse } from '../v2/projection/creative-delivery';
|
|
19
19
|
export type CanonicalProjectionTaskOptions = TaskOptions & {
|
|
20
20
|
/** Migration escape hatch for seller-specific legacy refs absent from the bundled registry. */
|
|
@@ -533,6 +533,14 @@ export declare class AgentClient {
|
|
|
533
533
|
* For v2 servers: builds synthetic capabilities from tool list
|
|
534
534
|
*/
|
|
535
535
|
getCapabilities(options?: Pick<TaskOptions, 'signal' | 'transport'>): Promise<AdcpCapabilities>;
|
|
536
|
+
/**
|
|
537
|
+
* Resolve the creative wire mode used by canonical writes without sending a
|
|
538
|
+
* mutation. Uses capabilities, this tool's input schema, and the client wire
|
|
539
|
+
* pin. Older peers with insufficient evidence return `unknown` and require
|
|
540
|
+
* an unambiguous legacy reference during projection; conflicting evidence
|
|
541
|
+
* or unproven support with a 3.2+ buyer pin throws `CreativeFormatCapabilityError`.
|
|
542
|
+
*/
|
|
543
|
+
resolveCreativeFormatWireMode(taskType: 'sync_creatives' | 'create_media_buy' | 'update_media_buy', options?: Pick<TaskOptions, 'signal' | 'transport'>): Promise<CreativeFormatWireMode>;
|
|
536
544
|
/** Scope token for a tenant-bound, application-owned capability preflight. */
|
|
537
545
|
getCapabilityEvidenceScope(): import('./SingleAgentClient').CapabilityEvidenceScope;
|
|
538
546
|
/** Install fresh capability evidence without making a redundant probe. */
|
|
@@ -791,6 +791,16 @@ class AgentClient {
|
|
|
791
791
|
async getCapabilities(options) {
|
|
792
792
|
return this.client.getCapabilities(options);
|
|
793
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* Resolve the creative wire mode used by canonical writes without sending a
|
|
796
|
+
* mutation. Uses capabilities, this tool's input schema, and the client wire
|
|
797
|
+
* pin. Older peers with insufficient evidence return `unknown` and require
|
|
798
|
+
* an unambiguous legacy reference during projection; conflicting evidence
|
|
799
|
+
* or unproven support with a 3.2+ buyer pin throws `CreativeFormatCapabilityError`.
|
|
800
|
+
*/
|
|
801
|
+
async resolveCreativeFormatWireMode(taskType, options) {
|
|
802
|
+
return this.client.resolveCreativeFormatWireMode(taskType, options);
|
|
803
|
+
}
|
|
794
804
|
/** Scope token for a tenant-bound, application-owned capability preflight. */
|
|
795
805
|
getCapabilityEvidenceScope() {
|
|
796
806
|
return this.client.getCapabilityEvidenceScope();
|
|
@@ -759,6 +759,16 @@ class AgentClient {
|
|
|
759
759
|
async getCapabilities(options) {
|
|
760
760
|
return this.client.getCapabilities(options);
|
|
761
761
|
}
|
|
762
|
+
/**
|
|
763
|
+
* Resolve the creative wire mode used by canonical writes without sending a
|
|
764
|
+
* mutation. Uses capabilities, this tool's input schema, and the client wire
|
|
765
|
+
* pin. Older peers with insufficient evidence return `unknown` and require
|
|
766
|
+
* an unambiguous legacy reference during projection; conflicting evidence
|
|
767
|
+
* or unproven support with a 3.2+ buyer pin throws `CreativeFormatCapabilityError`.
|
|
768
|
+
*/
|
|
769
|
+
async resolveCreativeFormatWireMode(taskType, options) {
|
|
770
|
+
return this.client.resolveCreativeFormatWireMode(taskType, options);
|
|
771
|
+
}
|
|
762
772
|
/** Scope token for a tenant-bound, application-owned capability preflight. */
|
|
763
773
|
getCapabilityEvidenceScope() {
|
|
764
774
|
return this.client.getCapabilityEvidenceScope();
|
|
@@ -19,7 +19,7 @@ import type { ProductCache } from './product-cache.mjs';
|
|
|
19
19
|
import { type ResolveAccountOptions } from './account-resolution.mjs';
|
|
20
20
|
import { type BuyerPropertyPolicy, type ProductPropertyPolicyMode } from '../media-buy/property-policy.mjs';
|
|
21
21
|
import { type ResolveListOptions } from '../server/targeting-helpers.mjs';
|
|
22
|
-
import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery.mjs';
|
|
22
|
+
import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type CreativeFormatWireMode, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery.mjs';
|
|
23
23
|
import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2.mjs';
|
|
24
24
|
import { type ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot.mjs';
|
|
25
25
|
import type { CanonicalFormatLegacyResolver } from '../v2/projection/v2-to-v1.mjs';
|
|
@@ -927,7 +927,18 @@ export declare class SingleAgentClient {
|
|
|
927
927
|
* Projection-only options are ignored because this method preserves the caller's legacy wire payload.
|
|
928
928
|
*/
|
|
929
929
|
syncCreativesLegacy(params: MutatingRequestInput<SyncCreativesRequest>, inputHandler?: InputHandler, options?: SyncCreativesTaskOptions): Promise<TaskResult<SyncCreativesResponse>>;
|
|
930
|
-
|
|
930
|
+
/**
|
|
931
|
+
* Resolve the creative wire mode used by the canonical write methods without
|
|
932
|
+
* sending a mutation. Discovers capabilities and the current tool's input
|
|
933
|
+
* schema, or reuses fresh cached/primed evidence, with this client's wire pin.
|
|
934
|
+
*
|
|
935
|
+
* `unknown` preserves the conservative legacy projection for older peers
|
|
936
|
+
* whose capabilities and schema do not establish support. Projection still
|
|
937
|
+
* requires an unambiguous legacy reference for each creative in that case.
|
|
938
|
+
* Conflicting evidence and unproven support with a 3.2+ buyer pin throw
|
|
939
|
+
* `CreativeFormatCapabilityError`, just as they do during a write.
|
|
940
|
+
*/
|
|
941
|
+
resolveCreativeFormatWireMode(taskType: 'sync_creatives' | 'create_media_buy' | 'update_media_buy', options?: ReadRequestOptions): Promise<CreativeFormatWireMode>;
|
|
931
942
|
/** Validate malformed creative payloads before capability discovery can perform I/O. */
|
|
932
943
|
private validateBeforeCreativeCapabilityProbe;
|
|
933
944
|
/**
|
|
@@ -19,7 +19,7 @@ import type { ProductCache } from './product-cache';
|
|
|
19
19
|
import { type ResolveAccountOptions } from './account-resolution';
|
|
20
20
|
import { type BuyerPropertyPolicy, type ProductPropertyPolicyMode } from '../media-buy/property-policy';
|
|
21
21
|
import { type ResolveListOptions } from '../server/targeting-helpers';
|
|
22
|
-
import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery';
|
|
22
|
+
import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type CreativeFormatWireMode, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery';
|
|
23
23
|
import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2';
|
|
24
24
|
import { type ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot';
|
|
25
25
|
import type { CanonicalFormatLegacyResolver } from '../v2/projection/v2-to-v1';
|
|
@@ -927,7 +927,18 @@ export declare class SingleAgentClient {
|
|
|
927
927
|
* Projection-only options are ignored because this method preserves the caller's legacy wire payload.
|
|
928
928
|
*/
|
|
929
929
|
syncCreativesLegacy(params: MutatingRequestInput<SyncCreativesRequest>, inputHandler?: InputHandler, options?: SyncCreativesTaskOptions): Promise<TaskResult<SyncCreativesResponse>>;
|
|
930
|
-
|
|
930
|
+
/**
|
|
931
|
+
* Resolve the creative wire mode used by the canonical write methods without
|
|
932
|
+
* sending a mutation. Discovers capabilities and the current tool's input
|
|
933
|
+
* schema, or reuses fresh cached/primed evidence, with this client's wire pin.
|
|
934
|
+
*
|
|
935
|
+
* `unknown` preserves the conservative legacy projection for older peers
|
|
936
|
+
* whose capabilities and schema do not establish support. Projection still
|
|
937
|
+
* requires an unambiguous legacy reference for each creative in that case.
|
|
938
|
+
* Conflicting evidence and unproven support with a 3.2+ buyer pin throw
|
|
939
|
+
* `CreativeFormatCapabilityError`, just as they do during a write.
|
|
940
|
+
*/
|
|
941
|
+
resolveCreativeFormatWireMode(taskType: 'sync_creatives' | 'create_media_buy' | 'update_media_buy', options?: ReadRequestOptions): Promise<CreativeFormatWireMode>;
|
|
931
942
|
/** Validate malformed creative payloads before capability discovery can perform I/O. */
|
|
932
943
|
private validateBeforeCreativeCapabilityProbe;
|
|
933
944
|
/**
|