agentfootprint 9.66.0 → 9.68.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.
Files changed (36) hide show
  1. package/dist/adapters/hosting/a2aWire.js +172 -0
  2. package/dist/adapters/hosting/a2aWire.js.map +1 -0
  3. package/dist/adapters/hosting/agentCoreA2A.js +173 -0
  4. package/dist/adapters/hosting/agentCoreA2A.js.map +1 -0
  5. package/dist/adapters/mcp/agentcore.js +156 -0
  6. package/dist/adapters/mcp/agentcore.js.map +1 -0
  7. package/dist/esm/adapters/hosting/a2aWire.d.ts +110 -0
  8. package/dist/esm/adapters/hosting/a2aWire.js +166 -0
  9. package/dist/esm/adapters/hosting/a2aWire.js.map +1 -0
  10. package/dist/esm/adapters/hosting/agentCoreA2A.d.ts +95 -0
  11. package/dist/esm/adapters/hosting/agentCoreA2A.js +168 -0
  12. package/dist/esm/adapters/hosting/agentCoreA2A.js.map +1 -0
  13. package/dist/esm/adapters/mcp/agentcore.d.ts +143 -0
  14. package/dist/esm/adapters/mcp/agentcore.js +149 -0
  15. package/dist/esm/adapters/mcp/agentcore.js.map +1 -0
  16. package/dist/esm/hosting-providers.d.ts +19 -0
  17. package/dist/esm/hosting-providers.js +19 -0
  18. package/dist/esm/hosting-providers.js.map +1 -1
  19. package/dist/esm/tool-providers/index.d.ts +2 -0
  20. package/dist/esm/tool-providers/index.js +5 -0
  21. package/dist/esm/tool-providers/index.js.map +1 -1
  22. package/dist/hosting-providers.js +35 -1
  23. package/dist/hosting-providers.js.map +1 -1
  24. package/dist/tool-providers/index.js +13 -1
  25. package/dist/tool-providers/index.js.map +1 -1
  26. package/dist/types/adapters/hosting/a2aWire.d.ts +111 -0
  27. package/dist/types/adapters/hosting/a2aWire.d.ts.map +1 -0
  28. package/dist/types/adapters/hosting/agentCoreA2A.d.ts +96 -0
  29. package/dist/types/adapters/hosting/agentCoreA2A.d.ts.map +1 -0
  30. package/dist/types/adapters/mcp/agentcore.d.ts +144 -0
  31. package/dist/types/adapters/mcp/agentcore.d.ts.map +1 -0
  32. package/dist/types/hosting-providers.d.ts +19 -0
  33. package/dist/types/hosting-providers.d.ts.map +1 -1
  34. package/dist/types/tool-providers/index.d.ts +2 -0
  35. package/dist/types/tool-providers/index.d.ts.map +1 -1
  36. package/package.json +1 -1
@@ -0,0 +1,149 @@
1
+ /**
2
+ * adapters/mcp/agentcore — reaching an AWS Bedrock **AgentCore Gateway**.
3
+ *
4
+ * ── What lives here, and why it is one file ──────────────────────────────────
5
+ * A Gateway is an MCP server, and `mcpClient` + `gatewayTransport` already know
6
+ * how to talk to one of those. Neither knows — and neither should learn — the
7
+ * handful of facts that are AgentCore's alone: the hostname its endpoints take,
8
+ * the name of the tool that searches its catalogue, the header that groups a
9
+ * caller's requests into one policy session, and the service name a SigV4
10
+ * signature is computed against. Those four facts are this file, and this file
11
+ * is the only place in the library that holds them.
12
+ *
13
+ * `gatewayTransport` says of itself: *"Nothing here is vendor-specific."* That
14
+ * stays true precisely because this exists next to it.
15
+ *
16
+ * ── What it does NOT do ──────────────────────────────────────────────────────
17
+ * It does not manage a Gateway. Creating one, adding targets, attaching a
18
+ * policy engine, enabling semantic search — all control-plane operations on
19
+ * `bedrock-agentcore-control`, all things an operator does once with the
20
+ * console, the CLI or their IaC. This is the CLIENT side: an agent using a
21
+ * gateway somebody already stood up.
22
+ *
23
+ * @example An agent whose tools come from a Gateway
24
+ * import { mcpClient } from 'agentfootprint/providers';
25
+ * import { agentCoreGatewayTransport } from 'agentfootprint/providers';
26
+ * import { agentCoreIdentity } from 'agentfootprint/security';
27
+ *
28
+ * const gateway = await mcpClient({
29
+ * name: 'gateway',
30
+ * transport: agentCoreGatewayTransport({
31
+ * gatewayId: 'my-gateway-a1b2c3d4e5',
32
+ * region: 'us-east-1',
33
+ * credentials: agentCoreIdentity({ region: 'us-east-1' }),
34
+ * }),
35
+ * });
36
+ * const tools = await gateway.tools();
37
+ */
38
+ import { gatewayTransport } from '../../lib/mcp/gatewayTransport.js';
39
+ /**
40
+ * The Gateway's built-in semantic tool search, by its exact wire name.
41
+ *
42
+ * It is an ordinary MCP tool — `tools/call` with `{ query }` — that returns the
43
+ * catalogue entries closest to a natural-language description. It matters at
44
+ * the scale where listing every tool into a prompt stops being sensible.
45
+ *
46
+ * **It can only be enabled when the Gateway is CREATED**, never afterwards, so
47
+ * its absence from a catalogue is a fact about that gateway rather than a
48
+ * transient condition to retry.
49
+ */
50
+ export const AGENTCORE_GATEWAY_SEARCH_TOOL = 'x_amz_bedrock_agentcore_search';
51
+ /**
52
+ * The header that groups a caller's requests into ONE policy session.
53
+ *
54
+ * AgentCore's temporal policies decide on SEQUENCES of actions — "not after
55
+ * three refunds", "only once this was approved" — and a sequence needs a
56
+ * boundary. This header is that boundary, and without it every request is its
57
+ * own history of one, which quietly makes every sequence rule unenforceable.
58
+ */
59
+ export const AGENTCORE_POLICY_SESSION_HEADER = 'x-amzn-bedrock-agentcore-policy-session-id';
60
+ /** The service name a SigV4 signature for a Gateway is computed against. */
61
+ export const AGENTCORE_SIGV4_SERVICE = 'bedrock-agentcore';
62
+ /**
63
+ * The MCP endpoint of a Gateway.
64
+ *
65
+ * `https://{gatewayId}.gateway.bedrock-agentcore.{region}.amazonaws.com/mcp` —
66
+ * a shape nobody remembers correctly, which is the entire reason it is a
67
+ * function and not a line in a README.
68
+ */
69
+ export function agentCoreGatewayUrl(options) {
70
+ const { gatewayId, region } = options;
71
+ if (!gatewayId || !region) {
72
+ throw new TypeError('agentCoreGatewayUrl: both `gatewayId` and `region` are required — the endpoint hostname ' +
73
+ 'is built from the two.');
74
+ }
75
+ return `https://${gatewayId}.gateway.bedrock-agentcore.${region}.amazonaws.com/mcp`;
76
+ }
77
+ /**
78
+ * An MCP transport pointed at an AgentCore Gateway.
79
+ *
80
+ * A configuration of {@link gatewayTransport}: the endpoint built from your
81
+ * gateway's id and region, and — when you name one — the policy session header
82
+ * stamped on every request. Token vending, the once-and-dropped secrecy rule
83
+ * and the rotation behaviour are all the neutral transport's, unchanged.
84
+ */
85
+ export function agentCoreGatewayTransport(options) {
86
+ const { policySessionId, fetch: innerFetch } = options;
87
+ // The header is stamped in the `fetch` seam rather than in `headers` because
88
+ // the seam runs per request. That is what lets the session id come from a
89
+ // function, which is what keeps two people on one transport in two sessions.
90
+ const stampPolicySession = policySessionId === undefined
91
+ ? innerFetch
92
+ : async (input, init) => {
93
+ const id = typeof policySessionId === 'function' ? policySessionId() : policySessionId;
94
+ const next = id === undefined || id === ''
95
+ ? init
96
+ : {
97
+ ...init,
98
+ headers: {
99
+ ...init?.headers,
100
+ [AGENTCORE_POLICY_SESSION_HEADER]: id,
101
+ },
102
+ };
103
+ return innerFetch ? innerFetch(input, next) : globalThis.fetch(input, next);
104
+ };
105
+ return gatewayTransport({
106
+ url: agentCoreGatewayUrl(options),
107
+ credentials: options.credentials,
108
+ ...(options.service !== undefined && { service: options.service }),
109
+ ...(options.scopes !== undefined && { scopes: options.scopes }),
110
+ ...(options.mode !== undefined && { mode: options.mode }),
111
+ ...(options.headers !== undefined && { headers: options.headers }),
112
+ ...(stampPolicySession !== undefined && { fetch: stampPolicySession }),
113
+ });
114
+ }
115
+ /**
116
+ * The Gateway's semantic search tool, if this gateway has one.
117
+ *
118
+ * Returns `undefined` rather than throwing, because absence is a legitimate and
119
+ * PERMANENT answer: semantic search is enabled when a Gateway is created and
120
+ * cannot be turned on afterwards, so there is nothing to retry.
121
+ *
122
+ * ── Why this finds the tool instead of calling it ────────────────────────────
123
+ * The obvious convenience would be `search(gateway, 'refund an order')`, and it
124
+ * is deliberately not here. Executing a tool needs a `ToolExecutionContext` —
125
+ * the call id, the iteration, the credential seam, the artifact store — and
126
+ * that object belongs to the agent loop. A helper would have to invent one,
127
+ * and a call made on an invented context is a call that appears in no trace:
128
+ * the model would be handed a shortlist nobody can later explain the origin of,
129
+ * which is the opposite of what this library is for.
130
+ *
131
+ * So the search tool is registered like any other tool, the model calls it when
132
+ * the catalogue is too large to reason about, and that call is an ordinary
133
+ * tool call in the trace — visible, attributable, and replayable.
134
+ *
135
+ * @example Give the model the catalogue's own search
136
+ * const tools = await gateway.tools();
137
+ * const search = gatewaySearchTool(tools);
138
+ * Agent.create({ provider, model })
139
+ * .tools(search ? [search] : tools) // search it, or list it
140
+ * .build();
141
+ */
142
+ export function gatewaySearchTool(tools) {
143
+ return tools.find((t) => t.schema.name === AGENTCORE_GATEWAY_SEARCH_TOOL);
144
+ }
145
+ /** Whether this gateway's catalogue can be searched rather than listed. */
146
+ export function hasGatewaySearch(tools) {
147
+ return gatewaySearchTool(tools) !== undefined;
148
+ }
149
+ //# sourceMappingURL=agentcore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentcore.js","sourceRoot":"","sources":["../../../../src/adapters/mcp/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,gBAAgB,EAAkB,MAAM,mCAAmC,CAAC;AAKrF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,gCAAgC,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,4CAA4C,CAAC;AAE5F,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAS3D;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAmC;IACrE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACtC,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1B,MAAM,IAAI,SAAS,CACjB,0FAA0F;YACxF,wBAAwB,CAC3B,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,SAAS,8BAA8B,MAAM,oBAAoB,CAAC;AACtF,CAAC;AA6BD;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAyC;IAEzC,MAAM,EAAE,eAAe,EA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AO,EAAE,CAAC;QAClE,GAAG,CAAC,kBAAkB,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;KACvE,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAsB;IACtD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,6BAA6B,CAAC,CAAC;AAC5E,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,KAAsB;IACrD,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AAChD,CAAC"}
@@ -25,6 +25,21 @@
25
25
  * idleMs: 900000 }` declared, session affinity readable from header or
26
26
  * query, and a `Sec-WebSocket-Protocol` bearer mapped into
27
27
  * `headers.authorization`.
28
+ * • `agentCoreA2AHost({ card, port?, hostname?, maxBodyBytes? })` — an
29
+ * `AgentHost` for AgentCore's **A2A** container contract, so OTHER AGENTS
30
+ * can call yours: JSON-RPC 2.0 at `POST /` on port 9000, the agent card at
31
+ * `/.well-known/agent-card.json`, `GET /ping` answering
32
+ * `{"status":"Healthy"}`, and the session read from
33
+ * `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id`. It declares NO streaming
34
+ * capability and its card says `streaming: false`, because `message/send`
35
+ * has nowhere to put a chunk — the two agree on purpose. Errors carry a
36
+ * REAL HTTP status alongside the JSON-RPC error body (the platform's
37
+ * documented deviation from the A2A spec); `agentCoreA2AErrorCode` is the
38
+ * table, exported so a client shares it rather than keeping a copy.
39
+ * • `a2aWire({ card, health?, errorCodeFor? })` — the A2A PROTOCOL as an
40
+ * `HttpWire`, with no vendor in it, for the next runtime that speaks it.
41
+ * `a2aAgentCardDocument(card)` builds the discovery document on its own,
42
+ * for deployments that must serve it from somewhere else.
28
43
  * • `foundryResponsesHost({ port?, hostname?, model?, maxBodyBytes? })` — an
29
44
  * `AgentHost` for Microsoft Foundry's hosted-agent contract: `POST
30
45
  * /responses`, a `HEAD` capability probe on the same path, `GET /readiness`
@@ -100,6 +115,10 @@
100
115
  * symbols, one door. Import from the door.
101
116
  */
102
117
  export { agentCoreRuntimeHost, agentCoreRuntimeWire, readAgentCoreConversation, agentCoreSessions, DEFAULT_SESSION_STORAGE_PATH, } from './adapters/hosting/agentcore.js';
118
+ export { agentCoreA2AHost, agentCoreA2AErrorCode, DEFAULT_AGENTCORE_A2A_PORT, AGENTCORE_A2A_INVOKE_PATH, AGENTCORE_PING_PATH, AGENTCORE_SESSION_HEADER, } from './adapters/hosting/agentCoreA2A.js';
119
+ export type { AgentCoreA2AHostOptions } from './adapters/hosting/agentCoreA2A.js';
120
+ export { a2aWire, a2aAgentCardDocument, readA2AMessageText, A2A_PROTOCOL_VERSION, A2A_AGENT_CARD_PATH, A2A_SEND_METHOD, JSONRPC_METHOD_NOT_FOUND, JSONRPC_INVALID_PARAMS, JSONRPC_INTERNAL_ERROR, } from './adapters/hosting/a2aWire.js';
121
+ export type { A2AWireOptions, A2AAgentCard, A2ASkill } from './adapters/hosting/a2aWire.js';
103
122
  export { foundryResponsesHost, DEFAULT_FOUNDRY_PORT, FOUNDRY_INVOKE_PATH, FOUNDRY_READINESS_PATH, FOUNDRY_SESSION_FIELDS, } from './adapters/hosting/foundryResponses.js';
104
123
  export type { FoundryResponsesHostOptions } from './adapters/hosting/foundryResponses.js';
105
124
  export { responsesWire, readResponsesInput, readResponsesSession, DEFAULT_SESSION_FIELDS, PUBLIC_FAILURE_MESSAGE, } from './adapters/hosting/responsesWire.js';
@@ -25,6 +25,21 @@
25
25
  * idleMs: 900000 }` declared, session affinity readable from header or
26
26
  * query, and a `Sec-WebSocket-Protocol` bearer mapped into
27
27
  * `headers.authorization`.
28
+ * • `agentCoreA2AHost({ card, port?, hostname?, maxBodyBytes? })` — an
29
+ * `AgentHost` for AgentCore's **A2A** container contract, so OTHER AGENTS
30
+ * can call yours: JSON-RPC 2.0 at `POST /` on port 9000, the agent card at
31
+ * `/.well-known/agent-card.json`, `GET /ping` answering
32
+ * `{"status":"Healthy"}`, and the session read from
33
+ * `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id`. It declares NO streaming
34
+ * capability and its card says `streaming: false`, because `message/send`
35
+ * has nowhere to put a chunk — the two agree on purpose. Errors carry a
36
+ * REAL HTTP status alongside the JSON-RPC error body (the platform's
37
+ * documented deviation from the A2A spec); `agentCoreA2AErrorCode` is the
38
+ * table, exported so a client shares it rather than keeping a copy.
39
+ * • `a2aWire({ card, health?, errorCodeFor? })` — the A2A PROTOCOL as an
40
+ * `HttpWire`, with no vendor in it, for the next runtime that speaks it.
41
+ * `a2aAgentCardDocument(card)` builds the discovery document on its own,
42
+ * for deployments that must serve it from somewhere else.
28
43
  * • `foundryResponsesHost({ port?, hostname?, model?, maxBodyBytes? })` — an
29
44
  * `AgentHost` for Microsoft Foundry's hosted-agent contract: `POST
30
45
  * /responses`, a `HEAD` capability probe on the same path, `GET /readiness`
@@ -100,6 +115,10 @@
100
115
  * symbols, one door. Import from the door.
101
116
  */
102
117
  export { agentCoreRuntimeHost, agentCoreRuntimeWire, readAgentCoreConversation, agentCoreSessions, DEFAULT_SESSION_STORAGE_PATH, } from './adapters/hosting/agentcore.js';
118
+ export { agentCoreA2AHost, agentCoreA2AErrorCode, DEFAULT_AGENTCORE_A2A_PORT, AGENTCORE_A2A_INVOKE_PATH, AGENTCORE_PING_PATH, AGENTCORE_SESSION_HEADER, } from './adapters/hosting/agentCoreA2A.js';
119
+ // The protocol under it, on the barrel in its own right — A2A is an open
120
+ // protocol, and reaching it should not mean importing a vendor's module.
121
+ export { a2aWire, a2aAgentCardDocument, readA2AMessageText, A2A_PROTOCOL_VERSION, A2A_AGENT_CARD_PATH, A2A_SEND_METHOD, JSONRPC_METHOD_NOT_FOUND, JSONRPC_INVALID_PARAMS, JSONRPC_INTERNAL_ERROR, } from './adapters/hosting/a2aWire.js';
103
122
  export { foundryResponsesHost, DEFAULT_FOUNDRY_PORT, FOUNDRY_INVOKE_PATH, FOUNDRY_READINESS_PATH, FOUNDRY_SESSION_FIELDS, } from './adapters/hosting/foundryResponses.js';
104
123
  // The protocol under it, on the barrel in its own right: a deployment that
105
124
  // speaks Responses on paths of its own is a `httpHost` away, and having to
@@ -1 +1 @@
1
- {"version":3,"file":"hosting-providers.js","sourceRoot":"","sources":["../../src/hosting-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoGG;AAEH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAIhD,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,kCAAkC;AAClC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AAOjD,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,4EAA4E;AAC5E,6EAA6E;AAC7E,mBAAmB;AACnB,OAAO,EACL,iBAAiB,EACjB,0BAA0B;AAC1B,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,yEAAyE;AACzE,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,yCAAyC,CAAC"}
1
+ {"version":3,"file":"hosting-providers.js","sourceRoot":"","sources":["../../src/hosting-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmHG;AAEH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAI5C,yEAAyE;AACzE,yEAAyE;AACzE,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAIhD,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,kCAAkC;AAClC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AAOjD,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,4EAA4E;AAC5E,6EAA6E;AAC7E,mBAAmB;AACnB,OAAO,EACL,iBAAiB,EACjB,0BAA0B;AAC1B,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,yEAAyE;AACzE,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,yCAAyC,CAAC"}
@@ -52,4 +52,6 @@ export { gatedTools } from './gatedTools.js';
52
52
  export { skillScopedTools, skillScopedToolsTarget, SKILL_SCOPED_TOOLS_ID_PREFIX, } from './skillScopedTools.js';
53
53
  export type { ToolProvider, ToolDispatchContext, ToolGatePredicate } from './types.js';
54
54
  export { mcpClient, mcpServe, mockMcpClient, gatewayTransport, GatewayAuthorizationRequiredError, } from '../lib/mcp/index.js';
55
+ export { agentCoreGatewayTransport, agentCoreGatewayUrl, gatewaySearchTool, hasGatewaySearch, AGENTCORE_GATEWAY_SEARCH_TOOL, AGENTCORE_POLICY_SESSION_HEADER, AGENTCORE_SIGV4_SERVICE, } from '../adapters/mcp/agentcore.js';
56
+ export type { AgentCoreGatewayTransportOptions, AgentCoreGatewayUrlOptions, } from '../adapters/mcp/agentcore.js';
55
57
  export type { GatewayTransportOptions, McpCallToolResult, McpClient, McpClientOptions, McpSdkClient, McpTransport, McpStdioTransport, McpHttpTransport, McpGatewayTransport, MockMcpClientOptions, MockMcpTool, McpServeOptions, McpServeHandle, McpServeTransport, McpStdioServeTransport, McpHttpServeTransport, McpSdkServer, } from '../lib/mcp/index.js';
@@ -57,4 +57,9 @@ skillScopedToolsTarget, SKILL_SCOPED_TOOLS_ID_PREFIX, } from './skillScopedTools
57
57
  // one place. This subpath is the ONLY place `mcpClient` is public — the
58
58
  // top-level barrel does not re-export it.
59
59
  export { mcpClient, mcpServe, mockMcpClient, gatewayTransport, GatewayAuthorizationRequiredError, } from '../lib/mcp/index.js';
60
+ // Reaching an AWS Bedrock AgentCore Gateway (9.66.0). A configuration of
61
+ // `gatewayTransport` plus the four facts that are AgentCore's alone — kept in
62
+ // the vendor's own file so the transport above stays able to say, truthfully,
63
+ // that nothing in it is vendor-specific.
64
+ export { agentCoreGatewayTransport, agentCoreGatewayUrl, gatewaySearchTool, hasGatewaySearch, AGENTCORE_GATEWAY_SEARCH_TOOL, AGENTCORE_POLICY_SESSION_HEADER, AGENTCORE_SIGV4_SERVICE, } from '../adapters/mcp/agentcore.js';
60
65
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tool-providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,gBAAgB;AAChB,kFAAkF;AAClF,kFAAkF;AAClF,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAG/B,uEAAuE;AACvE,wEAAwE;AACxE,0CAA0C;AAC1C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tool-providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,gBAAgB;AAChB,kFAAkF;AAClF,kFAAkF;AAClF,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAG/B,uEAAuE;AACvE,wEAAwE;AACxE,0CAA0C;AAC1C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAC7B,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,yCAAyC;AACzC,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,8BAA8B,CAAC"}
@@ -26,6 +26,21 @@
26
26
  * idleMs: 900000 }` declared, session affinity readable from header or
27
27
  * query, and a `Sec-WebSocket-Protocol` bearer mapped into
28
28
  * `headers.authorization`.
29
+ * • `agentCoreA2AHost({ card, port?, hostname?, maxBodyBytes? })` — an
30
+ * `AgentHost` for AgentCore's **A2A** container contract, so OTHER AGENTS
31
+ * can call yours: JSON-RPC 2.0 at `POST /` on port 9000, the agent card at
32
+ * `/.well-known/agent-card.json`, `GET /ping` answering
33
+ * `{"status":"Healthy"}`, and the session read from
34
+ * `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id`. It declares NO streaming
35
+ * capability and its card says `streaming: false`, because `message/send`
36
+ * has nowhere to put a chunk — the two agree on purpose. Errors carry a
37
+ * REAL HTTP status alongside the JSON-RPC error body (the platform's
38
+ * documented deviation from the A2A spec); `agentCoreA2AErrorCode` is the
39
+ * table, exported so a client shares it rather than keeping a copy.
40
+ * • `a2aWire({ card, health?, errorCodeFor? })` — the A2A PROTOCOL as an
41
+ * `HttpWire`, with no vendor in it, for the next runtime that speaks it.
42
+ * `a2aAgentCardDocument(card)` builds the discovery document on its own,
43
+ * for deployments that must serve it from somewhere else.
29
44
  * • `foundryResponsesHost({ port?, hostname?, model?, maxBodyBytes? })` — an
30
45
  * `AgentHost` for Microsoft Foundry's hosted-agent contract: `POST
31
46
  * /responses`, a `HEAD` capability probe on the same path, `GET /readiness`
@@ -101,13 +116,32 @@
101
116
  * symbols, one door. Import from the door.
102
117
  */
103
118
  Object.defineProperty(exports, "__esModule", { value: true });
104
- exports.FirestoreIndexMissingError = exports.EnvelopeTooLargeError = exports.FIRESTORE_MAX_ENVELOPE_BYTES = exports.FIRESTORE_MAX_DOCUMENT_BYTES = exports.EXPIRES_AT_FIELD = exports.DEFAULT_SESSION_COLLECTION = exports.firestoreSessions = exports.SESSION_EVENT_AUTHOR = exports.SESSION_STATE_KEY = exports.DEFAULT_USER_ID = exports.agentEngineSessions = exports.PUBLIC_FAILURE_MESSAGE = exports.DEFAULT_SESSION_FIELDS = exports.readResponsesSession = exports.readResponsesInput = exports.responsesWire = exports.FOUNDRY_SESSION_FIELDS = exports.FOUNDRY_READINESS_PATH = exports.FOUNDRY_INVOKE_PATH = exports.DEFAULT_FOUNDRY_PORT = exports.foundryResponsesHost = exports.DEFAULT_SESSION_STORAGE_PATH = exports.agentCoreSessions = exports.readAgentCoreConversation = exports.agentCoreRuntimeWire = exports.agentCoreRuntimeHost = void 0;
119
+ exports.FirestoreIndexMissingError = exports.EnvelopeTooLargeError = exports.FIRESTORE_MAX_ENVELOPE_BYTES = exports.FIRESTORE_MAX_DOCUMENT_BYTES = exports.EXPIRES_AT_FIELD = exports.DEFAULT_SESSION_COLLECTION = exports.firestoreSessions = exports.SESSION_EVENT_AUTHOR = exports.SESSION_STATE_KEY = exports.DEFAULT_USER_ID = exports.agentEngineSessions = exports.PUBLIC_FAILURE_MESSAGE = exports.DEFAULT_SESSION_FIELDS = exports.readResponsesSession = exports.readResponsesInput = exports.responsesWire = exports.FOUNDRY_SESSION_FIELDS = exports.FOUNDRY_READINESS_PATH = exports.FOUNDRY_INVOKE_PATH = exports.DEFAULT_FOUNDRY_PORT = exports.foundryResponsesHost = exports.JSONRPC_INTERNAL_ERROR = exports.JSONRPC_INVALID_PARAMS = exports.JSONRPC_METHOD_NOT_FOUND = exports.A2A_SEND_METHOD = exports.A2A_AGENT_CARD_PATH = exports.A2A_PROTOCOL_VERSION = exports.readA2AMessageText = exports.a2aAgentCardDocument = exports.a2aWire = exports.AGENTCORE_SESSION_HEADER = exports.AGENTCORE_PING_PATH = exports.AGENTCORE_A2A_INVOKE_PATH = exports.DEFAULT_AGENTCORE_A2A_PORT = exports.agentCoreA2AErrorCode = exports.agentCoreA2AHost = exports.DEFAULT_SESSION_STORAGE_PATH = exports.agentCoreSessions = exports.readAgentCoreConversation = exports.agentCoreRuntimeWire = exports.agentCoreRuntimeHost = void 0;
105
120
  var agentcore_js_1 = require("./adapters/hosting/agentcore.js");
106
121
  Object.defineProperty(exports, "agentCoreRuntimeHost", { enumerable: true, get: function () { return agentcore_js_1.agentCoreRuntimeHost; } });
107
122
  Object.defineProperty(exports, "agentCoreRuntimeWire", { enumerable: true, get: function () { return agentcore_js_1.agentCoreRuntimeWire; } });
108
123
  Object.defineProperty(exports, "readAgentCoreConversation", { enumerable: true, get: function () { return agentcore_js_1.readAgentCoreConversation; } });
109
124
  Object.defineProperty(exports, "agentCoreSessions", { enumerable: true, get: function () { return agentcore_js_1.agentCoreSessions; } });
110
125
  Object.defineProperty(exports, "DEFAULT_SESSION_STORAGE_PATH", { enumerable: true, get: function () { return agentcore_js_1.DEFAULT_SESSION_STORAGE_PATH; } });
126
+ var agentCoreA2A_js_1 = require("./adapters/hosting/agentCoreA2A.js");
127
+ Object.defineProperty(exports, "agentCoreA2AHost", { enumerable: true, get: function () { return agentCoreA2A_js_1.agentCoreA2AHost; } });
128
+ Object.defineProperty(exports, "agentCoreA2AErrorCode", { enumerable: true, get: function () { return agentCoreA2A_js_1.agentCoreA2AErrorCode; } });
129
+ Object.defineProperty(exports, "DEFAULT_AGENTCORE_A2A_PORT", { enumerable: true, get: function () { return agentCoreA2A_js_1.DEFAULT_AGENTCORE_A2A_PORT; } });
130
+ Object.defineProperty(exports, "AGENTCORE_A2A_INVOKE_PATH", { enumerable: true, get: function () { return agentCoreA2A_js_1.AGENTCORE_A2A_INVOKE_PATH; } });
131
+ Object.defineProperty(exports, "AGENTCORE_PING_PATH", { enumerable: true, get: function () { return agentCoreA2A_js_1.AGENTCORE_PING_PATH; } });
132
+ Object.defineProperty(exports, "AGENTCORE_SESSION_HEADER", { enumerable: true, get: function () { return agentCoreA2A_js_1.AGENTCORE_SESSION_HEADER; } });
133
+ // The protocol under it, on the barrel in its own right — A2A is an open
134
+ // protocol, and reaching it should not mean importing a vendor's module.
135
+ var a2aWire_js_1 = require("./adapters/hosting/a2aWire.js");
136
+ Object.defineProperty(exports, "a2aWire", { enumerable: true, get: function () { return a2aWire_js_1.a2aWire; } });
137
+ Object.defineProperty(exports, "a2aAgentCardDocument", { enumerable: true, get: function () { return a2aWire_js_1.a2aAgentCardDocument; } });
138
+ Object.defineProperty(exports, "readA2AMessageText", { enumerable: true, get: function () { return a2aWire_js_1.readA2AMessageText; } });
139
+ Object.defineProperty(exports, "A2A_PROTOCOL_VERSION", { enumerable: true, get: function () { return a2aWire_js_1.A2A_PROTOCOL_VERSION; } });
140
+ Object.defineProperty(exports, "A2A_AGENT_CARD_PATH", { enumerable: true, get: function () { return a2aWire_js_1.A2A_AGENT_CARD_PATH; } });
141
+ Object.defineProperty(exports, "A2A_SEND_METHOD", { enumerable: true, get: function () { return a2aWire_js_1.A2A_SEND_METHOD; } });
142
+ Object.defineProperty(exports, "JSONRPC_METHOD_NOT_FOUND", { enumerable: true, get: function () { return a2aWire_js_1.JSONRPC_METHOD_NOT_FOUND; } });
143
+ Object.defineProperty(exports, "JSONRPC_INVALID_PARAMS", { enumerable: true, get: function () { return a2aWire_js_1.JSONRPC_INVALID_PARAMS; } });
144
+ Object.defineProperty(exports, "JSONRPC_INTERNAL_ERROR", { enumerable: true, get: function () { return a2aWire_js_1.JSONRPC_INTERNAL_ERROR; } });
111
145
  var foundryResponses_js_1 = require("./adapters/hosting/foundryResponses.js");
112
146
  Object.defineProperty(exports, "foundryResponsesHost", { enumerable: true, get: function () { return foundryResponses_js_1.foundryResponsesHost; } });
113
147
  Object.defineProperty(exports, "DEFAULT_FOUNDRY_PORT", { enumerable: true, get: function () { return foundryResponses_js_1.DEFAULT_FOUNDRY_PORT; } });
@@ -1 +1 @@
1
- {"version":3,"file":"hosting-providers.js","sourceRoot":"","sources":["../src/hosting-providers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,4EAA4E;AAC5E,6EAA6E;AAC7E,mBAAmB;AACnB,gFAaiD;AAZ/C,yHAAA,iBAAiB,OAAA;AACjB,kIAAA,0BAA0B,OAAA;AAC1B,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,yEAAyE;AACzE,wHAAA,gBAAgB,OAAA;AAChB,oIAAA,4BAA4B,OAAA;AAC5B,oIAAA,4BAA4B,OAAA;AAC5B,6HAAA,qBAAqB,OAAA;AACrB,kIAAA,0BAA0B,OAAA"}
@@ -49,7 +49,7 @@
49
49
  * symbols, one door. Import from the door.
50
50
  */
51
51
  Object.defineProperty(exports, "__esModule", { value: true });
52
- exports.GatewayAuthorizationRequiredError = exports.gatewayTransport = exports.mockMcpClient = exports.mcpServe = exports.mcpClient = exports.SKILL_SCOPED_TOOLS_ID_PREFIX = exports.skillScopedToolsTarget = exports.skillScopedTools = exports.gatedTools = exports.staticTools = void 0;
52
+ exports.AGENTCORE_SIGV4_SERVICE = exports.AGENTCORE_POLICY_SESSION_HEADER = exports.AGENTCORE_GATEWAY_SEARCH_TOOL = exports.hasGatewaySearch = exports.gatewaySearchTool = exports.agentCoreGatewayUrl = exports.agentCoreGatewayTransport = exports.GatewayAuthorizationRequiredError = exports.gatewayTransport = exports.mockMcpClient = exports.mcpServe = exports.mcpClient = exports.SKILL_SCOPED_TOOLS_ID_PREFIX = exports.skillScopedToolsTarget = exports.skillScopedTools = exports.gatedTools = exports.staticTools = void 0;
53
53
  var staticTools_js_1 = require("./staticTools.js");
54
54
  Object.defineProperty(exports, "staticTools", { enumerable: true, get: function () { return staticTools_js_1.staticTools; } });
55
55
  var gatedTools_js_1 = require("./gatedTools.js");
@@ -69,4 +69,16 @@ Object.defineProperty(exports, "mcpServe", { enumerable: true, get: function ()
69
69
  Object.defineProperty(exports, "mockMcpClient", { enumerable: true, get: function () { return index_js_1.mockMcpClient; } });
70
70
  Object.defineProperty(exports, "gatewayTransport", { enumerable: true, get: function () { return index_js_1.gatewayTransport; } });
71
71
  Object.defineProperty(exports, "GatewayAuthorizationRequiredError", { enumerable: true, get: function () { return index_js_1.GatewayAuthorizationRequiredError; } });
72
+ // Reaching an AWS Bedrock AgentCore Gateway (9.66.0). A configuration of
73
+ // `gatewayTransport` plus the four facts that are AgentCore's alone — kept in
74
+ // the vendor's own file so the transport above stays able to say, truthfully,
75
+ // that nothing in it is vendor-specific.
76
+ var agentcore_js_1 = require("../adapters/mcp/agentcore.js");
77
+ Object.defineProperty(exports, "agentCoreGatewayTransport", { enumerable: true, get: function () { return agentcore_js_1.agentCoreGatewayTransport; } });
78
+ Object.defineProperty(exports, "agentCoreGatewayUrl", { enumerable: true, get: function () { return agentcore_js_1.agentCoreGatewayUrl; } });
79
+ Object.defineProperty(exports, "gatewaySearchTool", { enumerable: true, get: function () { return agentcore_js_1.gatewaySearchTool; } });
80
+ Object.defineProperty(exports, "hasGatewaySearch", { enumerable: true, get: function () { return agentcore_js_1.hasGatewaySearch; } });
81
+ Object.defineProperty(exports, "AGENTCORE_GATEWAY_SEARCH_TOOL", { enumerable: true, get: function () { return agentcore_js_1.AGENTCORE_GATEWAY_SEARCH_TOOL; } });
82
+ Object.defineProperty(exports, "AGENTCORE_POLICY_SESSION_HEADER", { enumerable: true, get: function () { return agentcore_js_1.AGENTCORE_POLICY_SESSION_HEADER; } });
83
+ Object.defineProperty(exports, "AGENTCORE_SIGV4_SERVICE", { enumerable: true, get: function () { return agentcore_js_1.AGENTCORE_SIGV4_SERVICE; } });
72
84
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool-providers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;;;AAEH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AACpB,iDAA6C;AAApC,2GAAA,UAAU,OAAA;AACnB,6DAM+B;AAL7B,uHAAA,gBAAgB,OAAA;AAChB,kFAAkF;AAClF,kFAAkF;AAClF,6HAAA,sBAAsB,OAAA;AACtB,mIAAA,4BAA4B,OAAA;AAI9B,uEAAuE;AACvE,wEAAwE;AACxE,0CAA0C;AAC1C,gDAM6B;AAL3B,qGAAA,SAAS,OAAA;AACT,oGAAA,QAAQ,OAAA;AACR,yGAAA,aAAa,OAAA;AACb,4GAAA,gBAAgB,OAAA;AAChB,6HAAA,iCAAiC,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool-providers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;;;AAEH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AACpB,iDAA6C;AAApC,2GAAA,UAAU,OAAA;AACnB,6DAM+B;AAL7B,uHAAA,gBAAgB,OAAA;AAChB,kFAAkF;AAClF,kFAAkF;AAClF,6HAAA,sBAAsB,OAAA;AACtB,mIAAA,4BAA4B,OAAA;AAI9B,uEAAuE;AACvE,wEAAwE;AACxE,0CAA0C;AAC1C,gDAM6B;AAL3B,qGAAA,SAAS,OAAA;AACT,oGAAA,QAAQ,OAAA;AACR,yGAAA,aAAa,OAAA;AACb,4GAAA,gBAAgB,OAAA;AAChB,6HAAA,iCAAiC,OAAA;AAEnC,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,yCAAyC;AACzC,6DAQsC;AAPpC,yHAAA,yBAAyB,OAAA;AACzB,mHAAA,mBAAmB,OAAA;AACnB,iHAAA,iBAAiB,OAAA;AACjB,gHAAA,gBAAgB,OAAA;AAChB,6HAAA,6BAA6B,OAAA;AAC7B,+HAAA,+BAA+B,OAAA;AAC/B,uHAAA,uBAAuB,OAAA"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * adapters/hosting/a2aWire — the A2A protocol, as an `HttpWire`.
3
+ *
4
+ * ── What this is ─────────────────────────────────────────────────────────────
5
+ * **A2A** (agent-to-agent) is an open protocol for one agent calling another:
6
+ * JSON-RPC 2.0 over HTTP, a `message/send` method carrying text parts, a result
7
+ * carrying artifacts, and a discovery document — the **agent card** — that says
8
+ * what the agent is and what it can do. It is nobody's product; several
9
+ * runtimes speak it, so it lives here on its own and the runtimes that host it
10
+ * configure this rather than reimplement it.
11
+ *
12
+ * ── The subset, stated plainly ───────────────────────────────────────────────
13
+ * One method: `message/send`, text parts only. Deliberately NOT carried:
14
+ * `message/stream` and the rest of the task lifecycle (`tasks/get`,
15
+ * `tasks/cancel`, push notifications), non-text parts, and multi-turn task
16
+ * state. An agent card built here therefore declares `streaming: false` by
17
+ * default — advertising a capability this wire cannot honour is how a caller
18
+ * finds out by hanging.
19
+ *
20
+ * ── Why it fits `httpHost` without changing it ───────────────────────────────
21
+ * JSON-RPC's one hard requirement on a reply is that it ECHOES the request's
22
+ * `id`. That is possible here only because `HttpWire`'s body methods receive
23
+ * the request that produced them — a seam added for a different protocol
24
+ * entirely, and the reason this one needed no new machinery.
25
+ *
26
+ * @example A2A on paths of your own choosing
27
+ * httpHost({
28
+ * name: 'myA2AHost',
29
+ * wire: a2aWire({ card: { name: 'triage', description: '…', version: '1.0.0' } }),
30
+ * invokePath: '/',
31
+ * healthPath: '/health',
32
+ * });
33
+ */
34
+ import type { HttpWire } from '../../hosting/httpHost.js';
35
+ /** The A2A protocol revision this wire's documents declare. */
36
+ export declare const A2A_PROTOCOL_VERSION = "0.3.0";
37
+ /** Where the A2A specification puts an agent's discovery document. */
38
+ export declare const A2A_AGENT_CARD_PATH = "/.well-known/agent-card.json";
39
+ /** The one method this wire carries. */
40
+ export declare const A2A_SEND_METHOD = "message/send";
41
+ /**
42
+ * JSON-RPC's own reserved codes, the two this wire can raise.
43
+ *
44
+ * `-32601` is "method not found" and `-32602` is "invalid params" — both from
45
+ * the JSON-RPC specification rather than from A2A or any runtime, which is why
46
+ * they are the only numbers this neutral file knows. A runtime's own error
47
+ * codes belong to that runtime's adapter.
48
+ */
49
+ export declare const JSONRPC_METHOD_NOT_FOUND = -32601;
50
+ export declare const JSONRPC_INVALID_PARAMS = -32602;
51
+ export declare const JSONRPC_INTERNAL_ERROR = -32603;
52
+ /** One skill an agent card advertises. */
53
+ export interface A2ASkill {
54
+ readonly id: string;
55
+ readonly name: string;
56
+ readonly description: string;
57
+ readonly tags?: readonly string[];
58
+ }
59
+ /** The agent card this wire serves — what another agent reads to decide to call yours. */
60
+ export interface A2AAgentCard {
61
+ readonly name: string;
62
+ readonly description: string;
63
+ readonly version: string;
64
+ /** Where callers reach this agent. A runtime that mounts the agent behind its
65
+ * own URL fills this in; left out, the card simply omits it. */
66
+ readonly url?: string;
67
+ /** Default `false` — see the module note on why this wire does not claim it. */
68
+ readonly streaming?: boolean;
69
+ readonly defaultInputModes?: readonly string[];
70
+ readonly defaultOutputModes?: readonly string[];
71
+ readonly skills?: readonly A2ASkill[];
72
+ }
73
+ export interface A2AWireOptions {
74
+ /** The agent card. Required: A2A discovery is not optional in the protocol. */
75
+ readonly card: A2AAgentCard;
76
+ /** Body for the health probe. Default `{ status: 'ok' }`. */
77
+ readonly health?: unknown;
78
+ /**
79
+ * Map a refusal's stable code onto the numeric JSON-RPC code this deployment
80
+ * reports. Absent, everything that is not a malformed request is
81
+ * `-32603` (internal error) — the JSON-RPC catch-all.
82
+ *
83
+ * A runtime with its own published code table passes one; that table is the
84
+ * runtime's, and this file does not carry anybody's.
85
+ */
86
+ readonly errorCodeFor?: (code: string | undefined) => number;
87
+ /** Name used in refusal messages. Default `'a2aWire'`. */
88
+ readonly name?: string;
89
+ }
90
+ type JsonObject = Readonly<Record<string, unknown>>;
91
+ /**
92
+ * The text of one A2A message — every part concatenated, refusing what is not text.
93
+ *
94
+ * A non-text part is refused rather than skipped for the reason every dialect
95
+ * in this library refuses rather than skips: an answer produced from the parts
96
+ * that happened to be understood is a wrong answer delivered confidently.
97
+ */
98
+ export declare function readA2AMessageText(message: unknown): string;
99
+ /**
100
+ * The agent card document, as the protocol prints it.
101
+ *
102
+ * Exported on its own because a deployment often has to serve the card from
103
+ * somewhere this wire does not own — a CDN, a route in a framework, a runtime's
104
+ * own discovery API — and the document should be built once, here, rather than
105
+ * hand-copied into each of those places.
106
+ */
107
+ export declare function a2aAgentCardDocument(card: A2AAgentCard): JsonObject;
108
+ /** An `HttpWire` speaking A2A's `message/send`. */
109
+ export declare function a2aWire(options: A2AWireOptions): HttpWire;
110
+ export {};
111
+ //# sourceMappingURL=a2aWire.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2aWire.d.ts","sourceRoot":"","sources":["../../../../src/adapters/hosting/a2aWire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EAAmC,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE3F,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAE5C,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAElE,wCAAwC;AACxC,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAC/C,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAE7C,0CAA0C;AAC1C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,0FAA0F;AAC1F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;qEACiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,CAAC;IAC7D,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,KAAK,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAYpD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAyB3D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAkBnE;AAED,mDAAmD;AACnD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,QAAQ,CAwEzD"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * adapters/hosting/agentCoreA2A — an agentfootprint agent as an AWS Bedrock
3
+ * **AgentCore A2A** server, callable by other agents.
4
+ *
5
+ * ── The split, again ─────────────────────────────────────────────────────────
6
+ * Two different things are needed, and only one is Amazon's:
7
+ *
8
+ * • The **A2A protocol** — JSON-RPC 2.0, `message/send`, artifacts, the agent
9
+ * card. An open protocol several runtimes speak, so it lives in
10
+ * `a2aWire.ts` with no vendor in it.
11
+ * • The **container contract** — port 9000 (not 8080, and not 8000: each
12
+ * protocol gets its own), the agent mounted at `/`, `GET /ping` answering
13
+ * `{"status":"Healthy"}`, the session id arriving in
14
+ * `X-Amzn-Bedrock-AgentCore-Runtime-Session-Id`, and a table of JSON-RPC
15
+ * error codes that are this runtime's exceptions rather than A2A's. That
16
+ * IS Amazon's, and it is what this file supplies.
17
+ *
18
+ * ── One deviation you must know about ────────────────────────────────────────
19
+ * The A2A specification delivers JSON-RPC errors over HTTP 200. **AgentCore
20
+ * does not** — it returns the real status code (409, 404, …) with the JSON-RPC
21
+ * error body. That is a fact about the platform in front of your container, so
22
+ * a CLIENT must parse the error body even on a non-2xx response; see
23
+ * `agentCoreA2AErrorCode` for the table this host mirrors on the way out.
24
+ *
25
+ * ── What is NOT provided ─────────────────────────────────────────────────────
26
+ * `message/stream` and the task lifecycle. The agent card this host serves
27
+ * therefore declares `streaming: false` unless you overrule it, because a card
28
+ * that advertises streaming to a wire that cannot stream is a caller left
29
+ * waiting. AWS's own sample card says `true`; ours says what is true of ours.
30
+ *
31
+ * @example An agent other agents can call
32
+ * import { agentCoreA2AHost, memorySessions, standingAgent } from 'agentfootprint/hosting';
33
+ *
34
+ * const handle = await standingAgent({
35
+ * agent,
36
+ * sessions: memorySessions(),
37
+ * host: agentCoreA2AHost({
38
+ * card: { name: 'triage', description: 'Triages SAN alerts.', version: '1.0.0' },
39
+ * }),
40
+ * });
41
+ * process.on('SIGTERM', () => void handle.close());
42
+ */
43
+ /// <reference types="node" />
44
+ import type { IncomingMessage, Server, ServerResponse } from 'node:http';
45
+ import { type HttpHost } from '../../hosting/httpHost.js';
46
+ import { type A2AAgentCard } from './a2aWire.js';
47
+ /** The port an AgentCore A2A server is expected on — its own, not HTTP's or MCP's. */
48
+ export declare const DEFAULT_AGENTCORE_A2A_PORT = 9000;
49
+ /** A2A mounts the agent at the root. */
50
+ export declare const AGENTCORE_A2A_INVOKE_PATH = "/";
51
+ /** The runtime's health path for every protocol. */
52
+ export declare const AGENTCORE_PING_PATH = "/ping";
53
+ /** Where the platform puts the caller's session. */
54
+ export declare const AGENTCORE_SESSION_HEADER = "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id";
55
+ /**
56
+ * AgentCore's own JSON-RPC error codes, mapped from this library's refusal codes.
57
+ *
58
+ * These numbers are the RUNTIME's exception table, not A2A's: `-32051`
59
+ * ResourceNotFound, `-32052` Validation, `-32053` Throttling and
60
+ * ServiceQuotaExceeded, `-32054` Conflict and RetryableConflict, `-32055`
61
+ * RuntimeClientError, `-32603` anything else. A client reads them to decide
62
+ * whether to retry — `-32054` with "Session operation in progress" is the one
63
+ * that must be retried with backoff, and A2A clients do not do that on their
64
+ * own.
65
+ *
66
+ * Exported so a client built against this host can share one table with it
67
+ * rather than keep a second copy that drifts.
68
+ */
69
+ export declare function agentCoreA2AErrorCode(code: string | undefined): number;
70
+ export interface AgentCoreA2AHostOptions {
71
+ /** The agent card other agents read. Required — discovery is not optional in A2A. */
72
+ readonly card: A2AAgentCard;
73
+ /** Port to bind. Default {@link DEFAULT_AGENTCORE_A2A_PORT}. Pass `0` in tests. */
74
+ readonly port?: number;
75
+ /** Interface to bind. Default `'0.0.0.0'` — a container's door must be reachable. */
76
+ readonly hostname?: string;
77
+ /** Ceiling on a request body. Default one mebibyte. */
78
+ readonly maxBodyBytes?: number;
79
+ /** A `node:http` server you own. Refused together with `port`/`hostname`. */
80
+ readonly server?: Server;
81
+ /**
82
+ * Answer a path this host does not own. The agent card is served BEFORE this
83
+ * runs, and everything else falls through to you unchanged — so supplying one
84
+ * costs you nothing the card was not already going to take.
85
+ */
86
+ readonly onUnhandled?: (req: IncomingMessage, res: ServerResponse) => void;
87
+ }
88
+ /**
89
+ * An {@link HttpHost} serving AgentCore's A2A container contract.
90
+ *
91
+ * `httpHost` keeps its own promises — draining, aborting on disconnect, failing
92
+ * a handler that throws or answers nothing — and this supplies the protocol,
93
+ * the paths, the port, the session header and the error table.
94
+ */
95
+ export declare function agentCoreA2AHost(options: AgentCoreA2AHostOptions): HttpHost;
96
+ //# sourceMappingURL=agentCoreA2A.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentCoreA2A.d.ts","sourceRoot":"","sources":["../../../../src/adapters/hosting/agentCoreA2A.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAEtB,sFAAsF;AACtF,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,oDAAoD;AACpD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAE3C,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,gDAAgD,CAAC;AAEtF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CA4BtE;AAED,MAAM,WAAW,uBAAuB;IACtC,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,WA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