@adcp/sdk 14.0.0-beta.10 → 14.0.0-beta.12
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-storyboard-sandbox.js +16 -0
- package/bin/adcp.js +28 -30
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +2 -1
- package/dist/lib/core/SingleAgentClient.d.ts +2 -1
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +113 -64
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/SingleAgentClient.mjs +113 -64
- package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/protocols/a2a.d.mts +10 -3
- package/dist/lib/protocols/a2a.d.ts +10 -3
- package/dist/lib/protocols/a2a.d.ts.map +1 -1
- package/dist/lib/protocols/a2a.js +162 -34
- package/dist/lib/protocols/a2a.js.map +1 -1
- package/dist/lib/protocols/a2a.mjs +166 -34
- package/dist/lib/protocols/a2a.mjs.map +1 -1
- package/dist/lib/schemas/index.d.mts +385 -1
- package/dist/lib/schemas/index.d.ts +385 -1
- package/dist/lib/schemas/index.d.ts.map +1 -1
- package/dist/lib/schemas/index.js +13 -0
- package/dist/lib/schemas/index.js.map +1 -1
- package/dist/lib/schemas/index.mjs +11 -0
- package/dist/lib/schemas/index.mjs.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/a2a-adapter.d.mts +59 -33
- package/dist/lib/server/a2a-adapter.d.ts +59 -33
- package/dist/lib/server/a2a-adapter.d.ts.map +1 -1
- package/dist/lib/server/a2a-adapter.js +278 -67
- package/dist/lib/server/a2a-adapter.js.map +1 -1
- package/dist/lib/server/a2a-adapter.mjs +280 -68
- package/dist/lib/server/a2a-adapter.mjs.map +1 -1
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +35 -108
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/create-adcp-server.mjs +37 -109
- package/dist/lib/server/create-adcp-server.mjs.map +1 -1
- package/dist/lib/server/decisioning/index.d.mts +2 -0
- package/dist/lib/server/decisioning/index.d.ts +2 -0
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +5 -2
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/index.mjs +3 -1
- package/dist/lib/server/decisioning/index.mjs.map +1 -1
- package/dist/lib/server/decisioning/response-summary.d.mts +33 -0
- package/dist/lib/server/decisioning/response-summary.d.ts +34 -0
- package/dist/lib/server/decisioning/response-summary.d.ts.map +1 -0
- package/dist/lib/server/decisioning/response-summary.js +62 -0
- package/dist/lib/server/decisioning/response-summary.js.map +1 -0
- package/dist/lib/server/decisioning/response-summary.mjs +37 -0
- package/dist/lib/server/decisioning/response-summary.mjs.map +1 -0
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +27 -5
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +27 -5
- package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.d.mts +7 -1
- package/dist/lib/server/decisioning/specialisms/sales.d.ts +7 -1
- 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/server/index.d.mts +1 -1
- package/dist/lib/server/index.d.ts +1 -1
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js.map +1 -1
- package/dist/lib/server/index.mjs.map +1 -1
- package/dist/lib/server/responses.d.ts.map +1 -1
- package/dist/lib/server/responses.js +9 -1
- package/dist/lib/server/responses.js.map +1 -1
- package/dist/lib/server/responses.mjs +8 -1
- package/dist/lib/server/responses.mjs.map +1 -1
- package/dist/lib/signing/agent-context.d.mts +1 -0
- package/dist/lib/signing/agent-context.d.ts +1 -0
- package/dist/lib/signing/agent-context.d.ts.map +1 -1
- package/dist/lib/signing/agent-context.js +37 -2
- package/dist/lib/signing/agent-context.js.map +1 -1
- package/dist/lib/signing/agent-context.mjs +38 -3
- package/dist/lib/signing/agent-context.mjs.map +1 -1
- package/dist/lib/signing/agent-fetch.d.mts +1 -2
- package/dist/lib/signing/agent-fetch.d.ts +1 -2
- package/dist/lib/signing/agent-fetch.d.ts.map +1 -1
- package/dist/lib/signing/agent-fetch.js +2 -0
- package/dist/lib/signing/agent-fetch.js.map +1 -1
- package/dist/lib/signing/agent-fetch.mjs +2 -0
- package/dist/lib/signing/agent-fetch.mjs.map +1 -1
- package/dist/lib/signing/agent-resolver/etld.js.map +1 -1
- package/dist/lib/signing/agent-resolver/etld.mjs.map +1 -1
- package/dist/lib/testing/client.d.mts +6 -0
- package/dist/lib/testing/client.d.ts +6 -0
- package/dist/lib/testing/client.d.ts.map +1 -1
- package/dist/lib/testing/client.js +76 -4
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/client.mjs +75 -4
- package/dist/lib/testing/client.mjs.map +1 -1
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +6 -0
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/comply.mjs +7 -1
- package/dist/lib/testing/compliance/comply.mjs.map +1 -1
- package/dist/lib/testing/storyboard/context.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/context.js +9 -4
- package/dist/lib/testing/storyboard/context.js.map +1 -1
- package/dist/lib/testing/storyboard/context.mjs +9 -4
- package/dist/lib/testing/storyboard/context.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-builder.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-builder.js +28 -4
- package/dist/lib/testing/storyboard/request-builder.js.map +1 -1
- package/dist/lib/testing/storyboard/request-builder.mjs +28 -4
- package/dist/lib/testing/storyboard/request-builder.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/functional-dispatch.d.mts +15 -0
- package/dist/lib/testing/storyboard/request-signing/functional-dispatch.d.ts +16 -0
- package/dist/lib/testing/storyboard/request-signing/functional-dispatch.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/request-signing/functional-dispatch.js +106 -0
- package/dist/lib/testing/storyboard/request-signing/functional-dispatch.js.map +1 -0
- package/dist/lib/testing/storyboard/request-signing/functional-dispatch.mjs +82 -0
- package/dist/lib/testing/storyboard/request-signing/functional-dispatch.mjs.map +1 -0
- package/dist/lib/testing/storyboard/request-signing/test-kit.d.mts +15 -0
- package/dist/lib/testing/storyboard/request-signing/test-kit.d.ts +15 -0
- package/dist/lib/testing/storyboard/request-signing/test-kit.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/test-kit.js +58 -0
- package/dist/lib/testing/storyboard/request-signing/test-kit.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/test-kit.mjs +58 -0
- package/dist/lib/testing/storyboard/request-signing/test-kit.mjs.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.mts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +7 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js.map +1 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +6 -1
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +31 -7
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.mjs +31 -7
- package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/validations.js +18 -7
- package/dist/lib/testing/storyboard/validations.js.map +1 -1
- package/dist/lib/testing/storyboard/validations.mjs +18 -7
- package/dist/lib/testing/storyboard/validations.mjs.map +1 -1
- package/dist/lib/testing/storyboard/webhook-receiver.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/webhook-receiver.js +32 -20
- package/dist/lib/testing/storyboard/webhook-receiver.js.map +1 -1
- package/dist/lib/testing/storyboard/webhook-receiver.mjs +32 -20
- package/dist/lib/testing/storyboard/webhook-receiver.mjs.map +1 -1
- package/dist/lib/testing/types.d.mts +10 -0
- package/dist/lib/testing/types.d.ts +10 -0
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/testing/types.js.map +1 -1
- package/dist/lib/types/comply-test-controller.d.ts +1 -14
- package/dist/lib/types/core.generated.d.mts +1 -1
- package/dist/lib/types/core.generated.d.ts +1 -1
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js.map +1 -1
- package/dist/lib/types/get-products.d.ts +1 -14
- package/dist/lib/types/schemas.generated.d.ts +519 -571
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +2 -2
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/schemas.generated.mjs +2 -2
- package/dist/lib/types/schemas.generated.mjs.map +1 -1
- package/dist/lib/types/tools.generated.d.mts +1 -1
- package/dist/lib/types/tools.generated.d.ts +1 -1
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/types/tools.generated.js.map +1 -1
- package/dist/lib/utils/a2a-artifacts.d.ts.map +1 -1
- package/dist/lib/utils/a2a-artifacts.js +2 -2
- package/dist/lib/utils/a2a-artifacts.js.map +1 -1
- package/dist/lib/utils/a2a-artifacts.mjs +2 -2
- package/dist/lib/utils/a2a-artifacts.mjs.map +1 -1
- package/dist/lib/utils/a2a-discovery.d.mts +3 -3
- package/dist/lib/utils/a2a-discovery.d.ts +3 -3
- package/dist/lib/utils/a2a-discovery.js +1 -1
- package/dist/lib/utils/a2a-discovery.js.map +1 -1
- package/dist/lib/utils/a2a-discovery.mjs +1 -1
- package/dist/lib/utils/a2a-discovery.mjs.map +1 -1
- package/dist/lib/utils/tool-request-schemas.d.mts +31 -31
- package/dist/lib/utils/tool-request-schemas.d.ts +31 -31
- package/dist/lib/v2/projection/index.d.mts +2 -0
- package/dist/lib/v2/projection/index.d.ts +2 -0
- package/dist/lib/v2/projection/index.d.ts.map +1 -1
- package/dist/lib/v2/projection/index.js +3 -0
- package/dist/lib/v2/projection/index.js.map +1 -1
- package/dist/lib/v2/projection/index.mjs +2 -0
- package/dist/lib/v2/projection/index.mjs.map +1 -1
- package/dist/lib/v2/projection/legacy-normalization.d.mts +24 -0
- package/dist/lib/v2/projection/legacy-normalization.d.ts +25 -0
- package/dist/lib/v2/projection/legacy-normalization.d.ts.map +1 -0
- package/dist/lib/v2/projection/legacy-normalization.js +32 -0
- package/dist/lib/v2/projection/legacy-normalization.js.map +1 -0
- package/dist/lib/v2/projection/legacy-normalization.mjs +8 -0
- package/dist/lib/v2/projection/legacy-normalization.mjs.map +1 -0
- 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/docs/guides/BUILD-AN-AGENT.md +42 -6
- package/docs/llms.txt +2 -2
- package/docs/migration-13-to-14.md +17 -0
- package/package.json +44 -41
|
@@ -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-08-
|
|
7
|
+
"synced_at": "2026-08-26T12:02:34.820Z"
|
|
8
8
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* store, state store, resolveAccount, and governance — everything the
|
|
7
7
|
* framework pipeline owns is transport-agnostic.
|
|
8
8
|
*
|
|
9
|
-
* **Scope
|
|
10
|
-
* `GET /.well-known/agent-card.json`. Streaming
|
|
9
|
+
* **Scope**: A2A 1.0 `SendMessage`, `GetTask`, `CancelTask`, and
|
|
10
|
+
* `GET /.well-known/agent-card.json`. Streaming,
|
|
11
11
|
* push notifications, and mid-flight `input-required` interrupts are
|
|
12
12
|
* explicit "not yet" — see `docs/guides/BUILD-AN-AGENT.md`.
|
|
13
13
|
*
|
|
@@ -17,28 +17,25 @@
|
|
|
17
17
|
* |-------------------------------------|-------------------|--------------------------------------------------|
|
|
18
18
|
* | Success arm | `completed` | DataPart with the typed AdCP response |
|
|
19
19
|
* | Submitted arm (`status:'submitted'`)| `completed` [^1] | DataPart with AdCP response + `metadata.adcp_task_id` |
|
|
20
|
-
* | Error arm (`errors:[]`) | `
|
|
20
|
+
* | Error arm (`errors:[]`) | `completed` | DataPart with the AdCP Error arm payload |
|
|
21
21
|
* | `adcpError()` envelope | `failed` | DataPart with `adcp_error` |
|
|
22
22
|
*
|
|
23
23
|
* [^1]: A2A `submitted` is the INITIAL lifecycle state (before
|
|
24
24
|
* `working`); A2A `completed` marks the transport call as done.
|
|
25
25
|
* When the AdCP handler returns a Submitted arm the HTTP call itself
|
|
26
26
|
* has completed — the AdCP-level async work is queued and buyers
|
|
27
|
-
* resume it via `
|
|
27
|
+
* resume it via `task_id` in the typed DataPart response. The DataPart's
|
|
28
28
|
* `data` still carries `status: 'submitted'` from the AdCP response,
|
|
29
29
|
* so a buyer reading the artifact payload sees the ad-tech state
|
|
30
30
|
* directly; the A2A Task.state only mirrors whether the transport
|
|
31
31
|
* call itself terminated.
|
|
32
32
|
*
|
|
33
33
|
* **Message shape.** A client addresses a tool by sending a `Message`
|
|
34
|
-
* with a single `DataPart`: `{
|
|
34
|
+
* with a single structured `DataPart`: `{ skill, input }`.
|
|
35
35
|
* `skill` must match a registered AdCP tool name (e.g. `get_products`);
|
|
36
36
|
* `input` becomes the tool arguments before AdCP schema validation
|
|
37
|
-
* runs. The
|
|
38
|
-
*
|
|
39
|
-
* treated as an alias for `data.input`; new callers should prefer
|
|
40
|
-
* `input` since A2A `DataPart.data` is free-form and `input` matches
|
|
41
|
-
* the AdCP tool's typed request shape.
|
|
37
|
+
* runs. The 0.3 compatibility path accepts the older `{ skill, parameters }`
|
|
38
|
+
* convention, but A2A 1.0 callers must use the AdCP profile's `input` field.
|
|
42
39
|
*
|
|
43
40
|
* **Two lifecycles, one response.** A2A's `Task.state` tracks the
|
|
44
41
|
* TRANSPORT call (did the HTTP request complete?). AdCP's `status`
|
|
@@ -46,15 +43,15 @@
|
|
|
46
43
|
* failed). Don't conflate them: a `completed` A2A task can carry a
|
|
47
44
|
* `submitted` AdCP response, meaning the call returned successfully
|
|
48
45
|
* but the ad-tech operation itself is still queued. Buyers resume the
|
|
49
|
-
* AdCP work via the `
|
|
46
|
+
* AdCP work via the `task_id` in the structured response, not
|
|
50
47
|
* by re-polling the A2A Task.
|
|
51
48
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* recommended.
|
|
49
|
+
* The advertised Agent Card requires the normative AdCP profile extension
|
|
50
|
+
* `https://adcontextprotocol.org/extensions/adcp/v3`.
|
|
55
51
|
*/
|
|
56
52
|
import { type TaskStore } from '@a2a-js/sdk/server';
|
|
57
|
-
import
|
|
53
|
+
import { AgentCard } from '@a2a-js/sdk';
|
|
54
|
+
import type { AgentCapabilities, AgentProvider, AgentSkill, SecurityScheme } from '@a2a-js/sdk';
|
|
58
55
|
import type { Request, RequestHandler } from 'express';
|
|
59
56
|
import { type AdcpAuthInfo, type AdcpServer } from './adcp-server.mjs';
|
|
60
57
|
import type { AdcpLogger } from './create-adcp-server.mjs';
|
|
@@ -77,21 +74,19 @@ export interface A2AAgentCardOverrides {
|
|
|
77
74
|
provider?: AgentProvider;
|
|
78
75
|
documentationUrl?: string;
|
|
79
76
|
iconUrl?: string;
|
|
80
|
-
securitySchemes?:
|
|
81
|
-
[k: string]: SecurityScheme;
|
|
82
|
-
};
|
|
77
|
+
securitySchemes?: Record<string, SecurityScheme | LegacySecurityScheme>;
|
|
83
78
|
security?: {
|
|
84
79
|
[k: string]: string[];
|
|
85
80
|
}[];
|
|
81
|
+
/** @deprecated The adapter exposes JSON-RPC only; this value must be `JSONRPC` when supplied. */
|
|
86
82
|
preferredTransport?: string;
|
|
87
83
|
/**
|
|
88
84
|
* Override the auto-generated capabilities. The adapter sets
|
|
89
|
-
* `streaming: false` and `pushNotifications: false` by default (
|
|
85
|
+
* `streaming: false` and `pushNotifications: false` by default (this adapter
|
|
90
86
|
* ships neither). Set `streaming: true` if you wire a downstream
|
|
91
|
-
* extension; the adapter still
|
|
92
|
-
* on the stream path in v0.
|
|
87
|
+
* extension; the adapter still does not emit streaming updates.
|
|
93
88
|
*/
|
|
94
|
-
capabilities?:
|
|
89
|
+
capabilities?: A2AAgentCapabilitiesOverride;
|
|
95
90
|
/**
|
|
96
91
|
* Override the auto-generated skills list. When omitted the adapter
|
|
97
92
|
* derives one `AgentSkill` per registered AdCP tool from the server's
|
|
@@ -100,11 +95,45 @@ export interface A2AAgentCardOverrides {
|
|
|
100
95
|
* tools such as `comply_test_controller` are still filtered from the public
|
|
101
96
|
* A2A agent card.
|
|
102
97
|
*/
|
|
103
|
-
skills?:
|
|
98
|
+
skills?: A2AAgentSkillOverride[];
|
|
104
99
|
defaultInputModes?: string[];
|
|
105
100
|
defaultOutputModes?: string[];
|
|
101
|
+
/** @deprecated AdCP 3.2 always advertises A2A 1.0 plus the SDK's 0.3 compatibility interface. */
|
|
106
102
|
protocolVersion?: string;
|
|
107
103
|
}
|
|
104
|
+
export interface LegacyHttpSecurityScheme {
|
|
105
|
+
type: 'http';
|
|
106
|
+
scheme: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
bearerFormat?: string;
|
|
109
|
+
}
|
|
110
|
+
export type LegacySecurityScheme = LegacyHttpSecurityScheme | {
|
|
111
|
+
type: 'apiKey';
|
|
112
|
+
description?: string;
|
|
113
|
+
in: 'cookie' | 'header' | 'query';
|
|
114
|
+
name: string;
|
|
115
|
+
} | {
|
|
116
|
+
type: 'oauth2';
|
|
117
|
+
description?: string;
|
|
118
|
+
oauth2MetadataUrl?: string;
|
|
119
|
+
flows: Partial<Record<'authorizationCode' | 'clientCredentials' | 'implicit' | 'password', {
|
|
120
|
+
authorizationUrl?: string;
|
|
121
|
+
tokenUrl?: string;
|
|
122
|
+
refreshUrl?: string;
|
|
123
|
+
scopes: Record<string, string>;
|
|
124
|
+
} | undefined>>;
|
|
125
|
+
} | {
|
|
126
|
+
type: 'openIdConnect';
|
|
127
|
+
description?: string;
|
|
128
|
+
openIdConnectUrl: string;
|
|
129
|
+
} | {
|
|
130
|
+
type: 'mutualTLS';
|
|
131
|
+
description?: string;
|
|
132
|
+
};
|
|
133
|
+
export type A2AAgentSkillOverride = Omit<AgentSkill, 'examples' | 'inputModes' | 'outputModes' | 'securityRequirements'> & Partial<Pick<AgentSkill, 'examples' | 'inputModes' | 'outputModes' | 'securityRequirements'>>;
|
|
134
|
+
export type A2AAgentCapabilitiesOverride = Omit<AgentCapabilities, 'extensions'> & {
|
|
135
|
+
extensions?: AgentCapabilities['extensions'];
|
|
136
|
+
};
|
|
108
137
|
/**
|
|
109
138
|
* Options for {@link createA2AAdapter}.
|
|
110
139
|
*
|
|
@@ -119,13 +148,11 @@ export interface A2AAgentCardOverrides {
|
|
|
119
148
|
* the request reaches `jsonRpcHandler`. The `authenticate` option
|
|
120
149
|
* here is a last-line-of-defense guard, not the primary auth surface.
|
|
121
150
|
*
|
|
122
|
-
* **Agent-card `securitySchemes`.**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* `securitySchemes` at boot (v0 check is required-field presence
|
|
128
|
-
* only), so a hand-crafted malformed entry will ship as-written.
|
|
151
|
+
* **Agent-card `securitySchemes`.** Legacy 0.3 OpenAPI-style schemes are
|
|
152
|
+
* converted to the A2A 1.0 union and unsupported shapes fail at startup.
|
|
153
|
+
* Only put non-secret discovery data there (token endpoint, scopes, OIDC
|
|
154
|
+
* issuer URL). Never paste client secrets, private JWKS, or internal URLs
|
|
155
|
+
* into the card.
|
|
129
156
|
*
|
|
130
157
|
* Omitting `authenticate` makes the adapter anonymous — handlers see
|
|
131
158
|
* `ctx.authInfo === undefined`, matching `serve({ authenticate: undefined })`.
|
|
@@ -142,9 +169,8 @@ export interface A2AAdapterOptions {
|
|
|
142
169
|
/** Seller-supplied agent-card identity fields. Required. */
|
|
143
170
|
agentCard: A2AAgentCardOverrides;
|
|
144
171
|
/**
|
|
145
|
-
* A2A task store.
|
|
146
|
-
*
|
|
147
|
-
* (e.g. a Postgres-backed `TaskStore`).
|
|
172
|
+
* A2A task store. Tests and development default to the SDK's in-memory
|
|
173
|
+
* store. Production must supply a bounded, durable implementation.
|
|
148
174
|
*/
|
|
149
175
|
taskStore?: TaskStore;
|
|
150
176
|
/** Optional logger. Falls back to `console`. */
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* store, state store, resolveAccount, and governance — everything the
|
|
7
7
|
* framework pipeline owns is transport-agnostic.
|
|
8
8
|
*
|
|
9
|
-
* **Scope
|
|
10
|
-
* `GET /.well-known/agent-card.json`. Streaming
|
|
9
|
+
* **Scope**: A2A 1.0 `SendMessage`, `GetTask`, `CancelTask`, and
|
|
10
|
+
* `GET /.well-known/agent-card.json`. Streaming,
|
|
11
11
|
* push notifications, and mid-flight `input-required` interrupts are
|
|
12
12
|
* explicit "not yet" — see `docs/guides/BUILD-AN-AGENT.md`.
|
|
13
13
|
*
|
|
@@ -17,28 +17,25 @@
|
|
|
17
17
|
* |-------------------------------------|-------------------|--------------------------------------------------|
|
|
18
18
|
* | Success arm | `completed` | DataPart with the typed AdCP response |
|
|
19
19
|
* | Submitted arm (`status:'submitted'`)| `completed` [^1] | DataPart with AdCP response + `metadata.adcp_task_id` |
|
|
20
|
-
* | Error arm (`errors:[]`) | `
|
|
20
|
+
* | Error arm (`errors:[]`) | `completed` | DataPart with the AdCP Error arm payload |
|
|
21
21
|
* | `adcpError()` envelope | `failed` | DataPart with `adcp_error` |
|
|
22
22
|
*
|
|
23
23
|
* [^1]: A2A `submitted` is the INITIAL lifecycle state (before
|
|
24
24
|
* `working`); A2A `completed` marks the transport call as done.
|
|
25
25
|
* When the AdCP handler returns a Submitted arm the HTTP call itself
|
|
26
26
|
* has completed — the AdCP-level async work is queued and buyers
|
|
27
|
-
* resume it via `
|
|
27
|
+
* resume it via `task_id` in the typed DataPart response. The DataPart's
|
|
28
28
|
* `data` still carries `status: 'submitted'` from the AdCP response,
|
|
29
29
|
* so a buyer reading the artifact payload sees the ad-tech state
|
|
30
30
|
* directly; the A2A Task.state only mirrors whether the transport
|
|
31
31
|
* call itself terminated.
|
|
32
32
|
*
|
|
33
33
|
* **Message shape.** A client addresses a tool by sending a `Message`
|
|
34
|
-
* with a single `DataPart`: `{
|
|
34
|
+
* with a single structured `DataPart`: `{ skill, input }`.
|
|
35
35
|
* `skill` must match a registered AdCP tool name (e.g. `get_products`);
|
|
36
36
|
* `input` becomes the tool arguments before AdCP schema validation
|
|
37
|
-
* runs. The
|
|
38
|
-
*
|
|
39
|
-
* treated as an alias for `data.input`; new callers should prefer
|
|
40
|
-
* `input` since A2A `DataPart.data` is free-form and `input` matches
|
|
41
|
-
* the AdCP tool's typed request shape.
|
|
37
|
+
* runs. The 0.3 compatibility path accepts the older `{ skill, parameters }`
|
|
38
|
+
* convention, but A2A 1.0 callers must use the AdCP profile's `input` field.
|
|
42
39
|
*
|
|
43
40
|
* **Two lifecycles, one response.** A2A's `Task.state` tracks the
|
|
44
41
|
* TRANSPORT call (did the HTTP request complete?). AdCP's `status`
|
|
@@ -46,15 +43,15 @@
|
|
|
46
43
|
* failed). Don't conflate them: a `completed` A2A task can carry a
|
|
47
44
|
* `submitted` AdCP response, meaning the call returned successfully
|
|
48
45
|
* but the ad-tech operation itself is still queued. Buyers resume the
|
|
49
|
-
* AdCP work via the `
|
|
46
|
+
* AdCP work via the `task_id` in the structured response, not
|
|
50
47
|
* by re-polling the A2A Task.
|
|
51
48
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* recommended.
|
|
49
|
+
* The advertised Agent Card requires the normative AdCP profile extension
|
|
50
|
+
* `https://adcontextprotocol.org/extensions/adcp/v3`.
|
|
55
51
|
*/
|
|
56
52
|
import { type TaskStore } from '@a2a-js/sdk/server';
|
|
57
|
-
import
|
|
53
|
+
import { AgentCard } from '@a2a-js/sdk';
|
|
54
|
+
import type { AgentCapabilities, AgentProvider, AgentSkill, SecurityScheme } from '@a2a-js/sdk';
|
|
58
55
|
import type { Request, RequestHandler } from 'express';
|
|
59
56
|
import { type AdcpAuthInfo, type AdcpServer } from './adcp-server';
|
|
60
57
|
import type { AdcpLogger } from './create-adcp-server';
|
|
@@ -77,21 +74,19 @@ export interface A2AAgentCardOverrides {
|
|
|
77
74
|
provider?: AgentProvider;
|
|
78
75
|
documentationUrl?: string;
|
|
79
76
|
iconUrl?: string;
|
|
80
|
-
securitySchemes?:
|
|
81
|
-
[k: string]: SecurityScheme;
|
|
82
|
-
};
|
|
77
|
+
securitySchemes?: Record<string, SecurityScheme | LegacySecurityScheme>;
|
|
83
78
|
security?: {
|
|
84
79
|
[k: string]: string[];
|
|
85
80
|
}[];
|
|
81
|
+
/** @deprecated The adapter exposes JSON-RPC only; this value must be `JSONRPC` when supplied. */
|
|
86
82
|
preferredTransport?: string;
|
|
87
83
|
/**
|
|
88
84
|
* Override the auto-generated capabilities. The adapter sets
|
|
89
|
-
* `streaming: false` and `pushNotifications: false` by default (
|
|
85
|
+
* `streaming: false` and `pushNotifications: false` by default (this adapter
|
|
90
86
|
* ships neither). Set `streaming: true` if you wire a downstream
|
|
91
|
-
* extension; the adapter still
|
|
92
|
-
* on the stream path in v0.
|
|
87
|
+
* extension; the adapter still does not emit streaming updates.
|
|
93
88
|
*/
|
|
94
|
-
capabilities?:
|
|
89
|
+
capabilities?: A2AAgentCapabilitiesOverride;
|
|
95
90
|
/**
|
|
96
91
|
* Override the auto-generated skills list. When omitted the adapter
|
|
97
92
|
* derives one `AgentSkill` per registered AdCP tool from the server's
|
|
@@ -100,11 +95,45 @@ export interface A2AAgentCardOverrides {
|
|
|
100
95
|
* tools such as `comply_test_controller` are still filtered from the public
|
|
101
96
|
* A2A agent card.
|
|
102
97
|
*/
|
|
103
|
-
skills?:
|
|
98
|
+
skills?: A2AAgentSkillOverride[];
|
|
104
99
|
defaultInputModes?: string[];
|
|
105
100
|
defaultOutputModes?: string[];
|
|
101
|
+
/** @deprecated AdCP 3.2 always advertises A2A 1.0 plus the SDK's 0.3 compatibility interface. */
|
|
106
102
|
protocolVersion?: string;
|
|
107
103
|
}
|
|
104
|
+
export interface LegacyHttpSecurityScheme {
|
|
105
|
+
type: 'http';
|
|
106
|
+
scheme: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
bearerFormat?: string;
|
|
109
|
+
}
|
|
110
|
+
export type LegacySecurityScheme = LegacyHttpSecurityScheme | {
|
|
111
|
+
type: 'apiKey';
|
|
112
|
+
description?: string;
|
|
113
|
+
in: 'cookie' | 'header' | 'query';
|
|
114
|
+
name: string;
|
|
115
|
+
} | {
|
|
116
|
+
type: 'oauth2';
|
|
117
|
+
description?: string;
|
|
118
|
+
oauth2MetadataUrl?: string;
|
|
119
|
+
flows: Partial<Record<'authorizationCode' | 'clientCredentials' | 'implicit' | 'password', {
|
|
120
|
+
authorizationUrl?: string;
|
|
121
|
+
tokenUrl?: string;
|
|
122
|
+
refreshUrl?: string;
|
|
123
|
+
scopes: Record<string, string>;
|
|
124
|
+
} | undefined>>;
|
|
125
|
+
} | {
|
|
126
|
+
type: 'openIdConnect';
|
|
127
|
+
description?: string;
|
|
128
|
+
openIdConnectUrl: string;
|
|
129
|
+
} | {
|
|
130
|
+
type: 'mutualTLS';
|
|
131
|
+
description?: string;
|
|
132
|
+
};
|
|
133
|
+
export type A2AAgentSkillOverride = Omit<AgentSkill, 'examples' | 'inputModes' | 'outputModes' | 'securityRequirements'> & Partial<Pick<AgentSkill, 'examples' | 'inputModes' | 'outputModes' | 'securityRequirements'>>;
|
|
134
|
+
export type A2AAgentCapabilitiesOverride = Omit<AgentCapabilities, 'extensions'> & {
|
|
135
|
+
extensions?: AgentCapabilities['extensions'];
|
|
136
|
+
};
|
|
108
137
|
/**
|
|
109
138
|
* Options for {@link createA2AAdapter}.
|
|
110
139
|
*
|
|
@@ -119,13 +148,11 @@ export interface A2AAgentCardOverrides {
|
|
|
119
148
|
* the request reaches `jsonRpcHandler`. The `authenticate` option
|
|
120
149
|
* here is a last-line-of-defense guard, not the primary auth surface.
|
|
121
150
|
*
|
|
122
|
-
* **Agent-card `securitySchemes`.**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* `securitySchemes` at boot (v0 check is required-field presence
|
|
128
|
-
* only), so a hand-crafted malformed entry will ship as-written.
|
|
151
|
+
* **Agent-card `securitySchemes`.** Legacy 0.3 OpenAPI-style schemes are
|
|
152
|
+
* converted to the A2A 1.0 union and unsupported shapes fail at startup.
|
|
153
|
+
* Only put non-secret discovery data there (token endpoint, scopes, OIDC
|
|
154
|
+
* issuer URL). Never paste client secrets, private JWKS, or internal URLs
|
|
155
|
+
* into the card.
|
|
129
156
|
*
|
|
130
157
|
* Omitting `authenticate` makes the adapter anonymous — handlers see
|
|
131
158
|
* `ctx.authInfo === undefined`, matching `serve({ authenticate: undefined })`.
|
|
@@ -142,9 +169,8 @@ export interface A2AAdapterOptions {
|
|
|
142
169
|
/** Seller-supplied agent-card identity fields. Required. */
|
|
143
170
|
agentCard: A2AAgentCardOverrides;
|
|
144
171
|
/**
|
|
145
|
-
* A2A task store.
|
|
146
|
-
*
|
|
147
|
-
* (e.g. a Postgres-backed `TaskStore`).
|
|
172
|
+
* A2A task store. Tests and development default to the SDK's in-memory
|
|
173
|
+
* store. Production must supply a bounded, durable implementation.
|
|
148
174
|
*/
|
|
149
175
|
taskStore?: TaskStore;
|
|
150
176
|
/** Optional logger. Falls back to `console`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-adapter.d.ts","sourceRoot":"","sources":["../../../src/lib/server/a2a-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"a2a-adapter.d.ts","sourceRoot":"","sources":["../../../src/lib/server/a2a-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,EAIL,KAAK,SAAS,EAOf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,UAAU,EAIV,cAAc,EAIf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGvD,OAAO,EAAyC,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAMvD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IA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