agentfootprint 12.1.0 → 12.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/AGENTS.md +1 -1
- package/CAPABILITIES.md +3 -1
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/dist/adapters/mcp/agentcoreRuntime/invoke.js +113 -7
- package/dist/adapters/mcp/agentcoreRuntime/invoke.js.map +1 -1
- package/dist/adapters/mcp/agentcoreRuntime/session.js +21 -21
- package/dist/adapters/mcp/agentcoreRuntime/session.js.map +1 -1
- package/dist/adapters/mcp/agentcoreRuntime/transport.js +79 -5
- package/dist/adapters/mcp/agentcoreRuntime/transport.js.map +1 -1
- package/dist/core/Agent.js +6 -0
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +4 -0
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/slots/buildToolsSlot.js +8 -0
- package/dist/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/adapters/mcp/agentcoreRuntime/invoke.d.ts +23 -4
- package/dist/esm/adapters/mcp/agentcoreRuntime/invoke.js +112 -6
- package/dist/esm/adapters/mcp/agentcoreRuntime/invoke.js.map +1 -1
- package/dist/esm/adapters/mcp/agentcoreRuntime/session.d.ts +20 -6
- package/dist/esm/adapters/mcp/agentcoreRuntime/session.js +21 -21
- package/dist/esm/adapters/mcp/agentcoreRuntime/session.js.map +1 -1
- package/dist/esm/adapters/mcp/agentcoreRuntime/transport.js +81 -7
- package/dist/esm/adapters/mcp/agentcoreRuntime/transport.js.map +1 -1
- package/dist/esm/core/Agent.js +6 -0
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.js +4 -0
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/slots/buildToolsSlot.d.ts +12 -0
- package/dist/esm/core/slots/buildToolsSlot.js +8 -0
- package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +41 -0
- package/dist/esm/events/registry.d.ts +3 -1
- package/dist/esm/events/registry.js +2 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/identity/types.d.ts +7 -3
- package/dist/esm/identity/types.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/boundedJson.d.ts +14 -7
- package/dist/esm/lib/boundedJson.js +14 -7
- package/dist/esm/lib/boundedJson.js.map +1 -1
- package/dist/esm/mcp/callLifetime.js +5 -2
- package/dist/esm/mcp/callLifetime.js.map +1 -1
- package/dist/esm/mcp/clientPort.d.ts +78 -0
- package/dist/esm/mcp/clientPort.js +33 -0
- package/dist/esm/mcp/clientPort.js.map +1 -0
- package/dist/esm/mcp/gatewayTransport.js +13 -3
- package/dist/esm/mcp/gatewayTransport.js.map +1 -1
- package/dist/esm/mcp/index.d.ts +9 -1
- package/dist/esm/mcp/index.js +8 -0
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/mcp/mcpClient.d.ts +18 -1
- package/dist/esm/mcp/mcpClient.js +203 -43
- package/dist/esm/mcp/mcpClient.js.map +1 -1
- package/dist/esm/mcp/mockMcpClient.js +13 -0
- package/dist/esm/mcp/mockMcpClient.js.map +1 -1
- package/dist/esm/mcp/pool/boundTool.d.ts +58 -0
- package/dist/esm/mcp/pool/boundTool.js +218 -0
- package/dist/esm/mcp/pool/boundTool.js.map +1 -0
- package/dist/esm/mcp/pool/clientSet.d.ts +73 -0
- package/dist/esm/mcp/pool/clientSet.js +152 -0
- package/dist/esm/mcp/pool/clientSet.js.map +1 -0
- package/dist/esm/mcp/pool/definitions.d.ts +103 -0
- package/dist/esm/mcp/pool/definitions.js +168 -0
- package/dist/esm/mcp/pool/definitions.js.map +1 -0
- package/dist/esm/mcp/pool/errors.d.ts +76 -0
- package/dist/esm/mcp/pool/errors.js +91 -0
- package/dist/esm/mcp/pool/errors.js.map +1 -0
- package/dist/esm/mcp/pool/identityKey.d.ts +57 -0
- package/dist/esm/mcp/pool/identityKey.js +94 -0
- package/dist/esm/mcp/pool/identityKey.js.map +1 -0
- package/dist/esm/mcp/pool/lease.d.ts +36 -0
- package/dist/esm/mcp/pool/lease.js +51 -0
- package/dist/esm/mcp/pool/lease.js.map +1 -0
- package/dist/esm/mcp/pool/listTools.d.ts +33 -0
- package/dist/esm/mcp/pool/listTools.js +146 -0
- package/dist/esm/mcp/pool/listTools.js.map +1 -0
- package/dist/esm/mcp/pool/mcpClientPool.d.ts +121 -0
- package/dist/esm/mcp/pool/mcpClientPool.js +151 -0
- package/dist/esm/mcp/pool/mcpClientPool.js.map +1 -0
- package/dist/esm/mcp/pool/options.d.ts +183 -0
- package/dist/esm/mcp/pool/options.js +119 -0
- package/dist/esm/mcp/pool/options.js.map +1 -0
- package/dist/esm/mcp/pool/plan.d.ts +77 -0
- package/dist/esm/mcp/pool/plan.js +134 -0
- package/dist/esm/mcp/pool/plan.js.map +1 -0
- package/dist/esm/mcp/pool/pool.d.ts +307 -0
- package/dist/esm/mcp/pool/pool.js +1071 -0
- package/dist/esm/mcp/pool/pool.js.map +1 -0
- package/dist/esm/mcp/pool/pooledClient.d.ts +93 -0
- package/dist/esm/mcp/pool/pooledClient.js +90 -0
- package/dist/esm/mcp/pool/pooledClient.js.map +1 -0
- package/dist/esm/mcp/pool/record.d.ts +80 -0
- package/dist/esm/mcp/pool/record.js +75 -0
- package/dist/esm/mcp/pool/record.js.map +1 -0
- package/dist/esm/mcp/pool/sessionEnded.d.ts +24 -0
- package/dist/esm/mcp/pool/sessionEnded.js +31 -0
- package/dist/esm/mcp/pool/sessionEnded.js.map +1 -0
- package/dist/esm/mcp/pool/work.d.ts +116 -0
- package/dist/esm/mcp/pool/work.js +213 -0
- package/dist/esm/mcp/pool/work.js.map +1 -0
- package/dist/esm/mcp/requestGuard.d.ts +70 -0
- package/dist/esm/mcp/requestGuard.js +98 -0
- package/dist/esm/mcp/requestGuard.js.map +1 -0
- package/dist/esm/mcp/requestLedger.d.ts +35 -1
- package/dist/esm/mcp/requestLedger.js +76 -3
- package/dist/esm/mcp/requestLedger.js.map +1 -1
- package/dist/esm/mcp/seriesEvidence.d.ts +10 -6
- package/dist/esm/mcp/seriesEvidence.js +16 -7
- package/dist/esm/mcp/seriesEvidence.js.map +1 -1
- package/dist/esm/mcp/terminate.d.ts +94 -0
- package/dist/esm/mcp/terminate.js +184 -0
- package/dist/esm/mcp/terminate.js.map +1 -0
- package/dist/esm/mcp/throttleRetry.js +71 -7
- package/dist/esm/mcp/throttleRetry.js.map +1 -1
- package/dist/esm/mcp/types.d.ts +85 -7
- package/dist/esm/redaction/knownStrings.js +34 -0
- package/dist/esm/redaction/knownStrings.js.map +1 -1
- package/dist/esm/tool-providers/index.d.ts +2 -2
- package/dist/esm/tool-providers/index.js +7 -1
- package/dist/esm/tool-providers/index.js.map +1 -1
- package/dist/esm/tools/mcpClientUse.d.ts +59 -0
- package/dist/esm/tools/mcpClientUse.js +216 -0
- package/dist/esm/tools/mcpClientUse.js.map +1 -0
- package/dist/esm/tools/toolProvider.d.ts +16 -0
- package/dist/esm/tools/toolSessions.d.ts +41 -0
- package/dist/esm/tools/toolSessions.js +41 -1
- package/dist/esm/tools/toolSessions.js.map +1 -1
- package/dist/events/registry.js +2 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/identity/types.js.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/boundedJson.js +14 -7
- package/dist/lib/boundedJson.js.map +1 -1
- package/dist/mcp/callLifetime.js +5 -2
- package/dist/mcp/callLifetime.js.map +1 -1
- package/dist/mcp/clientPort.js +38 -0
- package/dist/mcp/clientPort.js.map +1 -0
- package/dist/mcp/gatewayTransport.js +13 -3
- package/dist/mcp/gatewayTransport.js.map +1 -1
- package/dist/mcp/index.js +16 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/mcpClient.js +207 -45
- package/dist/mcp/mcpClient.js.map +1 -1
- package/dist/mcp/mockMcpClient.js +13 -0
- package/dist/mcp/mockMcpClient.js.map +1 -1
- package/dist/mcp/pool/boundTool.js +223 -0
- package/dist/mcp/pool/boundTool.js.map +1 -0
- package/dist/mcp/pool/clientSet.js +157 -0
- package/dist/mcp/pool/clientSet.js.map +1 -0
- package/dist/mcp/pool/definitions.js +174 -0
- package/dist/mcp/pool/definitions.js.map +1 -0
- package/dist/mcp/pool/errors.js +96 -0
- package/dist/mcp/pool/errors.js.map +1 -0
- package/dist/mcp/pool/identityKey.js +99 -0
- package/dist/mcp/pool/identityKey.js.map +1 -0
- package/dist/mcp/pool/lease.js +55 -0
- package/dist/mcp/pool/lease.js.map +1 -0
- package/dist/mcp/pool/listTools.js +150 -0
- package/dist/mcp/pool/listTools.js.map +1 -0
- package/dist/mcp/pool/mcpClientPool.js +155 -0
- package/dist/mcp/pool/mcpClientPool.js.map +1 -0
- package/dist/mcp/pool/options.js +123 -0
- package/dist/mcp/pool/options.js.map +1 -0
- package/dist/mcp/pool/plan.js +140 -0
- package/dist/mcp/pool/plan.js.map +1 -0
- package/dist/mcp/pool/pool.js +1075 -0
- package/dist/mcp/pool/pool.js.map +1 -0
- package/dist/mcp/pool/pooledClient.js +94 -0
- package/dist/mcp/pool/pooledClient.js.map +1 -0
- package/dist/mcp/pool/record.js +80 -0
- package/dist/mcp/pool/record.js.map +1 -0
- package/dist/mcp/pool/sessionEnded.js +35 -0
- package/dist/mcp/pool/sessionEnded.js.map +1 -0
- package/dist/mcp/pool/work.js +219 -0
- package/dist/mcp/pool/work.js.map +1 -0
- package/dist/mcp/requestGuard.js +106 -0
- package/dist/mcp/requestGuard.js.map +1 -0
- package/dist/mcp/requestLedger.js +76 -3
- package/dist/mcp/requestLedger.js.map +1 -1
- package/dist/mcp/seriesEvidence.js +16 -7
- package/dist/mcp/seriesEvidence.js.map +1 -1
- package/dist/mcp/terminate.js +193 -0
- package/dist/mcp/terminate.js.map +1 -0
- package/dist/mcp/throttleRetry.js +71 -7
- package/dist/mcp/throttleRetry.js.map +1 -1
- package/dist/redaction/knownStrings.js +34 -0
- package/dist/redaction/knownStrings.js.map +1 -1
- package/dist/tool-providers/index.js +12 -1
- package/dist/tool-providers/index.js.map +1 -1
- package/dist/tools/mcpClientUse.js +225 -0
- package/dist/tools/mcpClientUse.js.map +1 -0
- package/dist/tools/toolSessions.js +44 -1
- package/dist/tools/toolSessions.js.map +1 -1
- package/dist/types/adapters/mcp/agentcoreRuntime/invoke.d.ts +23 -4
- package/dist/types/adapters/mcp/agentcoreRuntime/invoke.d.ts.map +1 -1
- package/dist/types/adapters/mcp/agentcoreRuntime/session.d.ts +20 -6
- package/dist/types/adapters/mcp/agentcoreRuntime/session.d.ts.map +1 -1
- package/dist/types/adapters/mcp/agentcoreRuntime/transport.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts +12 -0
- package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +41 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +3 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/identity/types.d.ts +7 -3
- package/dist/types/identity/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/boundedJson.d.ts +14 -7
- package/dist/types/lib/boundedJson.d.ts.map +1 -1
- package/dist/types/mcp/callLifetime.d.ts.map +1 -1
- package/dist/types/mcp/clientPort.d.ts +79 -0
- package/dist/types/mcp/clientPort.d.ts.map +1 -0
- package/dist/types/mcp/gatewayTransport.d.ts.map +1 -1
- package/dist/types/mcp/index.d.ts +9 -1
- package/dist/types/mcp/index.d.ts.map +1 -1
- package/dist/types/mcp/mcpClient.d.ts +18 -1
- package/dist/types/mcp/mcpClient.d.ts.map +1 -1
- package/dist/types/mcp/mockMcpClient.d.ts.map +1 -1
- package/dist/types/mcp/pool/boundTool.d.ts +59 -0
- package/dist/types/mcp/pool/boundTool.d.ts.map +1 -0
- package/dist/types/mcp/pool/clientSet.d.ts +74 -0
- package/dist/types/mcp/pool/clientSet.d.ts.map +1 -0
- package/dist/types/mcp/pool/definitions.d.ts +104 -0
- package/dist/types/mcp/pool/definitions.d.ts.map +1 -0
- package/dist/types/mcp/pool/errors.d.ts +77 -0
- package/dist/types/mcp/pool/errors.d.ts.map +1 -0
- package/dist/types/mcp/pool/identityKey.d.ts +58 -0
- package/dist/types/mcp/pool/identityKey.d.ts.map +1 -0
- package/dist/types/mcp/pool/lease.d.ts +37 -0
- package/dist/types/mcp/pool/lease.d.ts.map +1 -0
- package/dist/types/mcp/pool/listTools.d.ts +34 -0
- package/dist/types/mcp/pool/listTools.d.ts.map +1 -0
- package/dist/types/mcp/pool/mcpClientPool.d.ts +122 -0
- package/dist/types/mcp/pool/mcpClientPool.d.ts.map +1 -0
- package/dist/types/mcp/pool/options.d.ts +184 -0
- package/dist/types/mcp/pool/options.d.ts.map +1 -0
- package/dist/types/mcp/pool/plan.d.ts +78 -0
- package/dist/types/mcp/pool/plan.d.ts.map +1 -0
- package/dist/types/mcp/pool/pool.d.ts +308 -0
- package/dist/types/mcp/pool/pool.d.ts.map +1 -0
- package/dist/types/mcp/pool/pooledClient.d.ts +94 -0
- package/dist/types/mcp/pool/pooledClient.d.ts.map +1 -0
- package/dist/types/mcp/pool/record.d.ts +81 -0
- package/dist/types/mcp/pool/record.d.ts.map +1 -0
- package/dist/types/mcp/pool/sessionEnded.d.ts +25 -0
- package/dist/types/mcp/pool/sessionEnded.d.ts.map +1 -0
- package/dist/types/mcp/pool/work.d.ts +117 -0
- package/dist/types/mcp/pool/work.d.ts.map +1 -0
- package/dist/types/mcp/requestGuard.d.ts +71 -0
- package/dist/types/mcp/requestGuard.d.ts.map +1 -0
- package/dist/types/mcp/requestLedger.d.ts +35 -1
- package/dist/types/mcp/requestLedger.d.ts.map +1 -1
- package/dist/types/mcp/seriesEvidence.d.ts +10 -6
- package/dist/types/mcp/seriesEvidence.d.ts.map +1 -1
- package/dist/types/mcp/terminate.d.ts +95 -0
- package/dist/types/mcp/terminate.d.ts.map +1 -0
- package/dist/types/mcp/throttleRetry.d.ts.map +1 -1
- package/dist/types/mcp/types.d.ts +85 -7
- package/dist/types/mcp/types.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings.d.ts.map +1 -1
- package/dist/types/tool-providers/index.d.ts +2 -2
- package/dist/types/tool-providers/index.d.ts.map +1 -1
- package/dist/types/tools/mcpClientUse.d.ts +60 -0
- package/dist/types/tools/mcpClientUse.d.ts.map +1 -0
- package/dist/types/tools/toolProvider.d.ts +16 -0
- package/dist/types/tools/toolProvider.d.ts.map +1 -1
- package/dist/types/tools/toolSessions.d.ts +41 -0
- package/dist/types/tools/toolSessions.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../../../../src/mcp/pool/work.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,mFAAmF;AACnF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9D,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtE,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,IAAK,YAAW,YAAY;IAcrC,4BAA4B;IACrB,KAAK,EAAE,QAAQ;IAdxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsC;IAC3D,OAAO,CAAC,OAAO,CAAK;IACpB,OAA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aAAa,EAC5B,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,EAAE;IAC7C,iDAAiD;IACxC,UAAU,EAAE,MAAM;CAI9B;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAId,QAAQ,CAAC,GAAG,EAAE,MAAM;IAHhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6C;gBAElD,GAAG,EAAE,MAAM;IAEhC,8BAA8B;IAC9B,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,4BAA4B;IAC5B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;OAGG;IACH,KAAK,CACH,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,EAAE,EAC7C,GAAG,EAAE,MAAM,GACV,SAAS,GAAG,SAAS;IAWxB,kGAAkG;IAClG,YAAY,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI;IAQlE,qGAAqG;IACrG,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;CAOtC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* requestGuard — the last check a pooled operation's request meets at every
|
|
3
|
+
* boundary the library controls, and the count of the work under it until
|
|
4
|
+
* that work has settled.
|
|
5
|
+
*
|
|
6
|
+
* Pattern: one object per operation, carried on the request's `init` under a
|
|
7
|
+
* library-private symbol.
|
|
8
|
+
* Role: The send gate of the MCP client pool (`mcp/pool/`). The MCP SDK and
|
|
9
|
+
* the transport wait between a tool call and the network — `send()`
|
|
10
|
+
* awaits its own headers, a gateway vends a credential inside `fetch`,
|
|
11
|
+
* the AWS SDK signs inside `send` — so the last check cannot live in
|
|
12
|
+
* the tool. Each place that waits asks the request's guard after its
|
|
13
|
+
* wait and before it hands the request on:
|
|
14
|
+
*
|
|
15
|
+
* - the watched `send` (`requestLedger.ts`) — the last boundary on stdio,
|
|
16
|
+
* whose `send` writes without waiting;
|
|
17
|
+
* - the pool's own fetch, before the request enters the transport;
|
|
18
|
+
* - the retry series, before every attempt (`throttleRetry.ts`);
|
|
19
|
+
* - the vending fetch, once the credential has arrived (`gatewayTransport.ts`);
|
|
20
|
+
* - the AWS SDK command, after it is signed and before its request handler
|
|
21
|
+
* sends it (`adapters/mcp/agentcoreRuntime/invoke.ts`).
|
|
22
|
+
*
|
|
23
|
+
* A refusal there sends nothing. What no guard can recall is a request already
|
|
24
|
+
* handed on: to the network, or to an app's own `fetch`.
|
|
25
|
+
*
|
|
26
|
+
* The same object COUNTS the work under the request: every promise a boundary
|
|
27
|
+
* starts for it — an attempt's `fetch`, a credential vend, an AWS `send` — is
|
|
28
|
+
* tracked until it settles, whatever the caller was told. An abort is a
|
|
29
|
+
* signal, not proof that the work stopped, so the pool keeps an operation
|
|
30
|
+
* charged until this count says it has.
|
|
31
|
+
*
|
|
32
|
+
* The guard rides `init` under a symbol, so a layer that rebuilds `init` with
|
|
33
|
+
* a spread (`{ ...init, headers }`) carries it on, and nothing reaches the
|
|
34
|
+
* wire: `fetch` reads only the fields it knows. A request with no guard — every
|
|
35
|
+
* request of a client the pool did not build — is exactly what it always was.
|
|
36
|
+
*/
|
|
37
|
+
/** @internal The `init` key a pooled request's guard rides under. */
|
|
38
|
+
export declare const REQUEST_GUARD: unique symbol;
|
|
39
|
+
/** What one pooled operation's requests are checked against, and counted by. */
|
|
40
|
+
export interface RequestGuard {
|
|
41
|
+
/**
|
|
42
|
+
* Throw the refusal when the request may not be handed on now — its binding
|
|
43
|
+
* went stale, or its operation was aborted or ran out of time. Synchronous:
|
|
44
|
+
* nothing waits between this check and the hand-off it guards.
|
|
45
|
+
*/
|
|
46
|
+
check(): void;
|
|
47
|
+
/** Count `work` as work under this request until it settles. Never throws. */
|
|
48
|
+
track(work: PromiseLike<unknown>): void;
|
|
49
|
+
/** What aborts the operation's own work — linked into each request it makes. */
|
|
50
|
+
readonly signal?: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
/** The guard `init` carries, or `undefined` — a request no pool sent. Never throws. */
|
|
53
|
+
export declare function guardOf(init: RequestInit | undefined): RequestGuard | undefined;
|
|
54
|
+
/** `init` carrying `guard`: a new object, every other field in place. */
|
|
55
|
+
export declare function withGuard(init: RequestInit | undefined, guard: RequestGuard): RequestInit;
|
|
56
|
+
/**
|
|
57
|
+
* Track `work` under `init`'s guard, when it has one, and hand `work` back
|
|
58
|
+
* unchanged. The one line every boundary uses.
|
|
59
|
+
*/
|
|
60
|
+
export declare function trackedBy<T extends PromiseLike<unknown>>(init: RequestInit | undefined, work: T): T;
|
|
61
|
+
/**
|
|
62
|
+
* @internal The call-context key a pooled tool hands its guard down under, to
|
|
63
|
+
* the MCP tool it runs (`callLifetime.ts` · `openCall` issues the call with
|
|
64
|
+
* it). Enumerable, so a wrapper that copies the context keeps it.
|
|
65
|
+
*/
|
|
66
|
+
export declare const CALL_GUARD: unique symbol;
|
|
67
|
+
/** `ctx` carrying `guard` for the MCP tool it is handed to. */
|
|
68
|
+
export declare function withCallGuard<C extends object>(ctx: C, guard: RequestGuard): C;
|
|
69
|
+
/** The guard a call's context carries, or `undefined`. Never throws, whatever `ctx` is. */
|
|
70
|
+
export declare function callGuardOf(ctx: unknown): RequestGuard | undefined;
|
|
71
|
+
//# sourceMappingURL=requestGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestGuard.d.ts","sourceRoot":"","sources":["../../../src/mcp/requestGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,qEAAqE;AACrE,eAAO,MAAM,aAAa,EAAE,OAAO,MAAmD,CAAC;AAEvF,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;IACd,8EAA8E;IAC9E,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAKD,uFAAuF;AACvF,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAa/E;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,YAAY,GAAG,WAAW,CAEzF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,EACtD,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,IAAI,EAAE,CAAC,GACN,CAAC,CAGH;AAID;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,OAAO,MAAgD,CAAC;AAEjF,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,GAAG,CAAC,CAE9E;AAED,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAalE"}
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
* has stopped waiting for them.
|
|
68
68
|
*/
|
|
69
69
|
import type { RequestEvidenceSink } from '../tools/requestEvidence.js';
|
|
70
|
+
import type { RequestGuard } from './requestGuard.js';
|
|
70
71
|
import { RequestReplay } from './replay.js';
|
|
71
72
|
/** One call's claim on the request it sends. */
|
|
72
73
|
export interface RequestTicket {
|
|
@@ -83,6 +84,11 @@ export interface ClaimedRequest {
|
|
|
83
84
|
readonly cancelled: AbortSignal;
|
|
84
85
|
/** What this request's series and its call share (`replay.ts` · `RequestReplay`). */
|
|
85
86
|
readonly replay: RequestReplay;
|
|
87
|
+
/**
|
|
88
|
+
* The send gate of the pooled call this request belongs to (`requestGuard.ts`)
|
|
89
|
+
* — absent for a call no pool made.
|
|
90
|
+
*/
|
|
91
|
+
readonly guard?: RequestGuard;
|
|
86
92
|
}
|
|
87
93
|
/** How a connection's ledger is set up. */
|
|
88
94
|
export interface RequestLedgerOptions {
|
|
@@ -90,6 +96,16 @@ export interface RequestLedgerOptions {
|
|
|
90
96
|
readonly server: string;
|
|
91
97
|
/** The `'app-authorized'` policy is in force: see the module note. */
|
|
92
98
|
readonly strict: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* A pooled client's guard for every message that does not carry its own — its
|
|
101
|
+
* open, its listing, its ending (`mcp/pool/`) — and for a `tools/call` that
|
|
102
|
+
* reached `send` without a call carrying a guard: the pool answers that one
|
|
103
|
+
* with a guard that refuses it, so a pooled request is never sent unchecked,
|
|
104
|
+
* under either replay policy. A request it guards is checked before it is
|
|
105
|
+
* sent, and every message's send is counted under it. Absent for a client no
|
|
106
|
+
* pool built.
|
|
107
|
+
*/
|
|
108
|
+
readonly guardFor?: (message: unknown) => RequestGuard | undefined;
|
|
93
109
|
}
|
|
94
110
|
type JsonRpcId = string | number;
|
|
95
111
|
/** The request a call's marker was matched to. */
|
|
@@ -105,6 +121,8 @@ export interface MatchedRequest {
|
|
|
105
121
|
export interface IssuedCall {
|
|
106
122
|
readonly marker: string;
|
|
107
123
|
readonly ticket?: RequestTicket;
|
|
124
|
+
/** The pooled call's send gate, when a pool made the call (`requestGuard.ts`). */
|
|
125
|
+
readonly guard?: RequestGuard;
|
|
108
126
|
/** Set once, by the watched `send`: a marker matches ONE request. */
|
|
109
127
|
readonly request?: MatchedRequest;
|
|
110
128
|
}
|
|
@@ -117,6 +135,12 @@ export declare class RequestLedger {
|
|
|
117
135
|
private readonly sending;
|
|
118
136
|
/** Matched requests whose JSON-RPC answer is awaited (`strict` only) — by id. */
|
|
119
137
|
private readonly awaiting;
|
|
138
|
+
/**
|
|
139
|
+
* A pooled call's guard by its request's id, until the call settles: the SDK's
|
|
140
|
+
* `notifications/cancelled` for that request is work started for the call, and
|
|
141
|
+
* is counted under it (`requestGuard.ts`).
|
|
142
|
+
*/
|
|
143
|
+
private readonly guards;
|
|
120
144
|
private initializeId;
|
|
121
145
|
private initializeAnswered;
|
|
122
146
|
private markers;
|
|
@@ -129,7 +153,7 @@ export declare class RequestLedger {
|
|
|
129
153
|
* is where its attempts are filed, when the call carries the run's evidence
|
|
130
154
|
* port.
|
|
131
155
|
*/
|
|
132
|
-
issue(ticket?: RequestTicket): IssuedCall;
|
|
156
|
+
issue(ticket?: RequestTicket, guard?: RequestGuard): IssuedCall;
|
|
133
157
|
/** `call` settled: forget it, and stop awaiting its request's answer. */
|
|
134
158
|
settle(call: IssuedCall): void;
|
|
135
159
|
/** The connection closed: nothing it sent is awaited, and no call is pending, any more. */
|
|
@@ -172,6 +196,16 @@ export declare class RequestLedger {
|
|
|
172
196
|
claim(body: unknown): ClaimedRequest | undefined;
|
|
173
197
|
/** One message through the watched transport. */
|
|
174
198
|
private send;
|
|
199
|
+
/**
|
|
200
|
+
* Any message but a `tools/call`: sent as it always was — unless a pool
|
|
201
|
+
* guards it (`guardFor`), and then a REQUEST is checked first and refused
|
|
202
|
+
* unsent, and every message's send is counted under the guard.
|
|
203
|
+
* Notifications are never refused: a `notifications/cancelled` is the
|
|
204
|
+
* courtesy that tells the server to stop.
|
|
205
|
+
*/
|
|
206
|
+
private sendOther;
|
|
207
|
+
/** The guard of the pooled call a `notifications/cancelled` names, if any. */
|
|
208
|
+
private cancelledGuard;
|
|
175
209
|
/** The `initialize` request: its answer is the one that proves the observer is in place. */
|
|
176
210
|
private noteInitialize;
|
|
177
211
|
/** The SDK gave a request up: stop the series still sending it, and stop awaiting its answer. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestLedger.d.ts","sourceRoot":"","sources":["../../../src/mcp/requestLedger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,CAAS;IACnC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,YAAY,CAAS;gBAEA,OAAO,GAAE,oBAA8B;IAEpE;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,YAAY,GAAG,UAAU;IAW/D,yEAAyE;IACzE,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAW9B,2FAA2F;IAC3F,KAAK,IAAI,IAAI;IAOb;;;OAGG;IACH,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,gGAAgG;IAChG,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,8GAA8G;IAC9G,YAAY,IAAI,OAAO;IAMvB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAyBpD,4FAA4F;IAC5F,OAAO,CAAC,aAAa;IAcrB,0FAA0F;IAC1F,OAAO,CAAC,OAAO;IAUf;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS;IAmBhD,iDAAiD;IACjD,OAAO,CAAC,IAAI;IAyDZ;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IAiBjB,8EAA8E;IAC9E,OAAO,CAAC,cAAc;IAStB,4FAA4F;IAC5F,OAAO,CAAC,cAAc;IAQtB,iGAAiG;IACjG,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -119,11 +119,13 @@ export declare class SeriesEvidence {
|
|
|
119
119
|
/**
|
|
120
120
|
* The series delivered a response. It is the last attempt's — an answer, or a
|
|
121
121
|
* refusal it will not ask again after. A refusal it MEANT to ask again after
|
|
122
|
-
* is delivered when the
|
|
123
|
-
*
|
|
124
|
-
*
|
|
122
|
+
* is delivered when the series stopped inside the wait: the deadline landed
|
|
123
|
+
* there (`no-time-left`), or a pooled call's send gate refused the next
|
|
124
|
+
* attempt before it was sent (`stoppedBy`, `not-permitted`). The end says
|
|
125
|
+
* which, during the `wait`; the attempt that was never sent has no row.
|
|
126
|
+
* Filed when the call has read it.
|
|
125
127
|
*/
|
|
126
|
-
delivered(): void;
|
|
128
|
+
delivered(stoppedBy?: DeclineReason): void;
|
|
127
129
|
/**
|
|
128
130
|
* The series threw. The end is the last attempt's when that attempt ended it
|
|
129
131
|
* (a failure, a timed-out request). The rest is defensive — footprintjs 10.6's
|
|
@@ -131,9 +133,11 @@ export declare class SeriesEvidence {
|
|
|
131
133
|
* as one: a deadline that had passed before the first request (`timed-out`,
|
|
132
134
|
* no `during`, nothing sent) or one a future runner reports from inside a wait
|
|
133
135
|
* (`during: 'wait'`); anything else is filed as a failure the record cannot
|
|
134
|
-
* account for, so a request is never left unfiled.
|
|
136
|
+
* account for, so a request is never left unfiled. A pooled call's send gate
|
|
137
|
+
* that refused the next attempt before it was sent ends it as `stoppedBy`,
|
|
138
|
+
* during the `wait`. Filed when the call settles.
|
|
135
139
|
*/
|
|
136
|
-
threw(outOfTime: boolean): void;
|
|
140
|
+
threw(outOfTime: boolean, stoppedBy?: DeclineReason): void;
|
|
137
141
|
private add;
|
|
138
142
|
/**
|
|
139
143
|
* File `end` once the call has settled — its verdict is what says whether an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seriesEvidence.d.ts","sourceRoot":"","sources":["../../../src/mcp/seriesEvidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAGjB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK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,EAAE,aAAa,EACxB,KAAK,CAAC,EAAE,YAAY,GACnB,IAAI;IASP;;;;OAIG;IACH,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;IAajD;;;;;OAKG;IACH,SAAS,IAAI,IAAI;IAajB;;;;;;;;OAQG;IACH,SAAS,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI;IAa1C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI;IAwB1D,OAAO,CAAC,GAAG;IAOX;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,IAAI;IAsBZ;;;;;OAKG;IACH,OAAO,CAAC,YAAY;CAQrB;AAcD,wEAAwE;AACxE,wBAAgB,KAAK,CACnB,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,QAAQ,CAAC,EAAE,aAAa,GACvB,kBAAkB,CAqBpB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,YAAY,GAAG,SAAS,GAC9B,kBAAkB,CASpB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* terminate — ending a client's remote session, and saying what the remote side
|
|
3
|
+
* answered.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: a pass-through `fetch` that reads one status + one bounded procedure.
|
|
6
|
+
* Role: `McpClient.terminate()` (`mcpClient.ts`). The MCP SDK's
|
|
7
|
+
* `StreamableHTTPClientTransport.close()` only aborts the requests in
|
|
8
|
+
* flight; `terminateSession()` is the one method that sends the
|
|
9
|
+
* Streamable HTTP `DELETE` carrying `Mcp-Session-Id`. It treats a 405
|
|
10
|
+
* as success, so the status is read here, by a pass-through `fetch`
|
|
11
|
+
* the library installs on every transport it builds — it changes no
|
|
12
|
+
* request and reads only a `DELETE`'s answer.
|
|
13
|
+
*
|
|
14
|
+
* The procedure, at most once per client:
|
|
15
|
+
*
|
|
16
|
+
* 1. no session id was ever issued → `'no-session'`, nothing is sent;
|
|
17
|
+
* 2. otherwise the transport's own `terminateSession()`, bounded by
|
|
18
|
+
* `TOOL_TEARDOWN_TIMEOUT_MS` (the tool-session tier's `withTimeout`, shared):
|
|
19
|
+
* at the deadline the request is aborted and the outcome is `'timed-out'`;
|
|
20
|
+
* 3. a local close, whatever happened.
|
|
21
|
+
*
|
|
22
|
+
* ONE DEADLINE ANSWERS THE CALLER: the remote answer and the local close are
|
|
23
|
+
* waited for together for at most `TOOL_TEARDOWN_TIMEOUT_MS` of ELAPSED time,
|
|
24
|
+
* measured by timers started together at the start — never by reading the wall
|
|
25
|
+
* clock, so a clock stepped back cannot stretch it. A close that finishes in
|
|
26
|
+
* time is finished before the caller hears; one that hangs does not hold the
|
|
27
|
+
* answer. The work's own settlement — the `DELETE`, a `fetch` that ignores its
|
|
28
|
+
* abort, the close — may come later, and is returned apart (`settled`): the MCP
|
|
29
|
+
* client pool keeps an ending charged until then. The clock (`now`) only
|
|
30
|
+
* measures `durationMs`.
|
|
31
|
+
*
|
|
32
|
+
* Never vendor-aware: the one port is the Streamable HTTP `DELETE`. A transport
|
|
33
|
+
* that turns it into something else (AgentCore Runtime's `StopRuntimeSession`)
|
|
34
|
+
* answers it like a server would.
|
|
35
|
+
*/
|
|
36
|
+
import type { McpClient, McpTerminateOutcome } from './types.js';
|
|
37
|
+
/** An `McpClient` that can end its remote session. */
|
|
38
|
+
export type TerminableMcpClient = McpClient & {
|
|
39
|
+
terminate(): Promise<McpTerminateOutcome>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Can `client` end its remote session? Reads the member, never assumes it —
|
|
43
|
+
* the feature-detection law (`provider-contract/types.ts` · `canStageCodeInputs`).
|
|
44
|
+
* True for `mcpClient()` and `mockMcpClient()`; false for a hand-written client
|
|
45
|
+
* without `terminate`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function canTerminate(client: unknown): client is TerminableMcpClient;
|
|
48
|
+
/** What ending one client came to: the caller's answer, and when the work under it settled. */
|
|
49
|
+
export interface Ending {
|
|
50
|
+
/** Answers by `TOOL_TEARDOWN_TIMEOUT_MS`. Never rejects. */
|
|
51
|
+
readonly outcome: Promise<McpTerminateOutcome>;
|
|
52
|
+
/** Resolves once every piece of work the ending started has settled. Never rejects. */
|
|
53
|
+
readonly settled: Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
/** The slice of the SDK's Streamable HTTP transport the procedure uses. */
|
|
56
|
+
export interface TerminableTransport {
|
|
57
|
+
readonly sessionId?: string;
|
|
58
|
+
terminateSession(): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* What the pass-through `fetch` saw of a transport's `DELETE` requests: the
|
|
62
|
+
* status of the latest answer, and the signal it links into each one while an
|
|
63
|
+
* ending is under way.
|
|
64
|
+
*/
|
|
65
|
+
export declare class DeleteWatch {
|
|
66
|
+
private status;
|
|
67
|
+
private cut;
|
|
68
|
+
/** Arm for one ending: forget the last status, link `cut` into its `DELETE`. */
|
|
69
|
+
arm(cut: AbortSignal): void;
|
|
70
|
+
/** The status the latest `DELETE` was answered with, if one was. */
|
|
71
|
+
get answered(): number | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* `inner` (the global `fetch` when `undefined`, looked up at call time),
|
|
74
|
+
* passed through untouched except that a `DELETE`'s answer status is read and
|
|
75
|
+
* an armed ending's signal is linked into it.
|
|
76
|
+
*/
|
|
77
|
+
fetch(inner: ((input: string | URL, init?: RequestInit) => Promise<Response>) | undefined): (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
78
|
+
}
|
|
79
|
+
/** The outcome for an ending that sent nothing. */
|
|
80
|
+
export declare function outcomeWithout(remote: 'no-session' | 'unavailable', durationMs?: number): McpTerminateOutcome;
|
|
81
|
+
/**
|
|
82
|
+
* An ending that sends nothing — `remote` says why — only the local close:
|
|
83
|
+
* the caller is answered when the close finishes or at `timeoutMs`, whichever
|
|
84
|
+
* comes first; `settled` waits for the close itself.
|
|
85
|
+
*/
|
|
86
|
+
export declare function endLocally(remote: 'no-session' | 'unavailable', close: () => Promise<void>, now?: () => number, timeoutMs?: number): Ending;
|
|
87
|
+
/**
|
|
88
|
+
* End `transport`'s session, then close locally with `close` — the procedure
|
|
89
|
+
* in the module note. `watch` is the `DeleteWatch` installed on the transport's
|
|
90
|
+
* fetch. `now` is the clock the duration is measured with.
|
|
91
|
+
*/
|
|
92
|
+
export declare function endSession(transport: TerminableTransport, watch: DeleteWatch, close: () => Promise<void>, now?: () => number, timeoutMs?: number): Ending;
|
|
93
|
+
/** A failure's class name, never its message. */
|
|
94
|
+
export declare function classOf(error: unknown): string;
|
|
95
|
+
//# sourceMappingURL=terminate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminate.d.ts","sourceRoot":"","sources":["../../../src/mcp/terminate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjE,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,mBAAmB,CAO3E;AAED,+FAA+F;AAC/F,MAAM,WAAW,MAAM;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC/C,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS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d.ts","sourceRoot":"","sources":["../../../src/mcp/throttleRetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AAaH,OAAO,EAOL,KAAK,iBAAiB,EAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"throttleRetry.d.ts","sourceRoot":"","sources":["../../../src/mcp/throttleRetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AAaH,OAAO,EAOL,KAAK,iBAAiB,EAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,oBAAoB,CAAC;AAWvE;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAI3F;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,cAAc,CAAC;AAEpD,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;4DACwD;IACxD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;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a,EACrB,MAAM,CAAC,EAAE,iBAAiB,GACzB,aAAa,GAAG,SAAS,CAE3B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,GAAG,aAAa,CAStF;AA2iBD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOpF"}
|
|
@@ -93,7 +93,25 @@ export interface McpHttpTransport {
|
|
|
93
93
|
* reads, stores, logs or records the headers your function produces.
|
|
94
94
|
*/
|
|
95
95
|
readonly fetch?: (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
96
|
+
/**
|
|
97
|
+
* What a library-built transport keeps inside its `fetch`, stated as data:
|
|
98
|
+
* the settings that decide where a request lands and as whom, which no one can
|
|
99
|
+
* read back out of a function. `agentCoreRuntimeMcpTransport` fills it (its
|
|
100
|
+
* auth strategy, its session strategy, the bearer service, scopes and
|
|
101
|
+
* credential provider id). `mcpClientPool` compares it, with the URL and the
|
|
102
|
+
* header names, to decide whether two conversations open the same
|
|
103
|
+
* configuration (`McpClientPoolOptions.definitions`).
|
|
104
|
+
*
|
|
105
|
+
* Never a secret: names and modes only. A transport you write by hand may
|
|
106
|
+
* leave it out; your `configuration` name then covers what your `fetch` does.
|
|
107
|
+
*/
|
|
108
|
+
readonly settings?: McpTransportSettings;
|
|
96
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* The comparable settings of a transport — plain names and modes, never a
|
|
112
|
+
* credential. See {@link McpHttpTransport.settings}.
|
|
113
|
+
*/
|
|
114
|
+
export type McpTransportSettings = Readonly<Record<string, string | readonly string[]>>;
|
|
97
115
|
/**
|
|
98
116
|
* `gateway` transport — MCP over Streamable HTTP, with the auth headers vended
|
|
99
117
|
* **per request** by a {@link CredentialProvider} instead of fixed at connect
|
|
@@ -371,7 +389,9 @@ export interface McpConnectionOptions {
|
|
|
371
389
|
* let the SDK client refresh itself (`listChanged.tools` with `autoRefresh`,
|
|
372
390
|
* which is on by default once `listChanged.tools` is given): set
|
|
373
391
|
* `autoRefresh: false` and call `refresh()` from `onChanged`, or give
|
|
374
|
-
* `mcpClient` a connection of its own.
|
|
392
|
+
* `mcpClient` a connection of its own. A connection of its own still needs
|
|
393
|
+
* the SDK's automatic discovery off: no `listChanged.tools`, or
|
|
394
|
+
* `autoRefresh: false` on it.
|
|
375
395
|
*/
|
|
376
396
|
readonly connection: McpConnection;
|
|
377
397
|
/** Abort the list / call paths. Rides the SDK's request options. */
|
|
@@ -451,11 +471,13 @@ export interface McpClient {
|
|
|
451
471
|
* `listTools` calls, the SDK client's automatic discovery (`listChanged.tools`
|
|
452
472
|
* with `autoRefresh`, on by default once `listChanged.tools` is given), or any
|
|
453
473
|
* other replacement of the SDK client's cache leave a tool handed out here
|
|
454
|
-
* believing the SDK still holds its checks — so
|
|
455
|
-
* its required-task refusal
|
|
456
|
-
* the library builds (the `transport` and
|
|
457
|
-
* on a client you pass as `connection`,
|
|
458
|
-
* `refresh()` from `onChanged`, or give
|
|
474
|
+
* believing the SDK still holds its checks — so a call to it can bypass both
|
|
475
|
+
* checks, its output checks and its required-task refusal, even with
|
|
476
|
+
* `jsonSchemaValidator`. The client the library builds (the `transport` and
|
|
477
|
+
* `sdk` arms) never lists by itself; on a client you pass as `connection`,
|
|
478
|
+
* set `autoRefresh: false` and call `refresh()` from `onChanged`, or give
|
|
479
|
+
* `mcpClient` a connection of its own, which still needs the SDK's automatic
|
|
480
|
+
* discovery off (no `listChanged.tools`, or `autoRefresh: false` on it).
|
|
459
481
|
*/
|
|
460
482
|
tools(): Promise<readonly Tool[]>;
|
|
461
483
|
/**
|
|
@@ -468,8 +490,64 @@ export interface McpClient {
|
|
|
468
490
|
* itself: a listing the library does not send is not covered.
|
|
469
491
|
*/
|
|
470
492
|
refresh(): Promise<readonly Tool[]>;
|
|
471
|
-
/**
|
|
493
|
+
/**
|
|
494
|
+
* Close the underlying transport. After `close()` the client is unusable.
|
|
495
|
+
*
|
|
496
|
+
* `close()` does not end the remote session; `terminate()` does, and says
|
|
497
|
+
* whether it did.
|
|
498
|
+
*/
|
|
472
499
|
close(): Promise<void>;
|
|
500
|
+
/**
|
|
501
|
+
* End the remote session, then close locally, whatever happened — and say
|
|
502
|
+
* what the remote side answered (`McpTerminateOutcome`).
|
|
503
|
+
*
|
|
504
|
+
* Optional: a capability, not a required member, so a hand-written
|
|
505
|
+
* `McpClient` keeps compiling. Ask {@link canTerminate} before calling it.
|
|
506
|
+
* `mcpClient()` and `mockMcpClient()` provide it.
|
|
507
|
+
*
|
|
508
|
+
* It sends the transport's own session termination (Streamable HTTP: a
|
|
509
|
+
* `DELETE` carrying `Mcp-Session-Id`) and reads the status itself, because
|
|
510
|
+
* the MCP SDK treats a 405 as success. The wait is bounded: after
|
|
511
|
+
* `TOOL_TEARDOWN_TIMEOUT_MS` (5 s) the request is aborted and the outcome is
|
|
512
|
+
* `'timed-out'`. Ends the client at most once: a second call answers the
|
|
513
|
+
* first outcome. Never throws for a remote failure; the outcome says it.
|
|
514
|
+
*
|
|
515
|
+
* @throws when called after `close()`, like every other method
|
|
516
|
+
*/
|
|
517
|
+
terminate?(): Promise<McpTerminateOutcome>;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* What ending a client's remote session came to — `McpClient.terminate()`.
|
|
521
|
+
*
|
|
522
|
+
* `resolved` is true only when the remote side is known not to hold the session
|
|
523
|
+
* any more: `'terminated'`, `'already-gone'`, `'no-session'`. Every other
|
|
524
|
+
* outcome leaves the remote session to its own timeout, which nothing in this
|
|
525
|
+
* process can shorten. Local settlement and remote resolution are different
|
|
526
|
+
* facts: an ending can settle here and stay unresolved there.
|
|
527
|
+
*/
|
|
528
|
+
export interface McpTerminateOutcome {
|
|
529
|
+
/**
|
|
530
|
+
* - `'terminated'` — 2xx: the remote side ended the session it held.
|
|
531
|
+
* - `'already-gone'` — 404: it no longer held it.
|
|
532
|
+
* - `'no-session'` — nothing to end: no session id was ever issued (a
|
|
533
|
+
* `'per-call'` runtime transport, a server that issues none, stdio, the mock).
|
|
534
|
+
* - `'not-offered'` — 405: the server does not end sessions on request.
|
|
535
|
+
* - `'failed'` — the request failed (another status, or no answer).
|
|
536
|
+
* - `'timed-out'` — the local wait ended first, and the request was aborted.
|
|
537
|
+
* - `'handle-lost'` — this process no longer holds the session's handle, so
|
|
538
|
+
* nothing could be sent (`LocalSessionHandleLostError`).
|
|
539
|
+
* - `'unavailable'` — a client built on `connection`: the library did not
|
|
540
|
+
* build its transport, so it cannot end the session.
|
|
541
|
+
*/
|
|
542
|
+
readonly remote: 'terminated' | 'already-gone' | 'no-session' | 'not-offered' | 'failed' | 'timed-out' | 'handle-lost' | 'unavailable';
|
|
543
|
+
/** True only for `'terminated'`, `'already-gone'` and `'no-session'`. */
|
|
544
|
+
readonly resolved: boolean;
|
|
545
|
+
/** The HTTP status the remote side answered with, when one was read. */
|
|
546
|
+
readonly status?: number;
|
|
547
|
+
/** A failure's class name — never its message. */
|
|
548
|
+
readonly errorClass?: string;
|
|
549
|
+
/** How long the ending took, as the caller waited for it. */
|
|
550
|
+
readonly durationMs: number;
|
|
473
551
|
}
|
|
474
552
|
/**
|
|
475
553
|
* A live MCP connection you opened and connected yourself.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/mcp/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD;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ACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,SAAS,GACT,MAAM,GACN,UAAU,GACV,YAAY,CAAC;AAEjB,mCAAmC;AACnC,MAAM,MAAM,WAAW,GACnB,uBAAuB,GACvB,cAAc,CAAC,QAAQ,CAAC,GACxB,cAAc,CAAC,SAAS,CAAC,GACzB,OAAO,YAAY,GACnB,OAAO,qBAAqB,GAC5B,eAAe,GACf,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,gBAAgB,CAAC,MAAM,CAAC,GACxB,gBAAgB,CAAC;AAErB,iDAAiD;AACjD,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAwwCzE,6DAA6D;AAC7D,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAS,CAAC;AAEnE,2DAA2D;AAC3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAU,CAAC;AAKlE,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAKD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEvD"}
|
|
@@ -51,7 +51,7 @@ export { staticTools } from './staticTools.js';
|
|
|
51
51
|
export { gatedTools } from './gatedTools.js';
|
|
52
52
|
export { skillScopedTools, skillScopedToolsTarget, SKILL_SCOPED_TOOLS_ID_PREFIX, } from '../tools/skillScopedTools.js';
|
|
53
53
|
export type { ToolProvider, ToolDispatchContext, ToolGatePredicate, } from '../tools/toolProvider.js';
|
|
54
|
-
export { mcpClient, mcpServe, mockMcpClient, gatewayTransport, GatewayAuthorizationRequiredError, McpReplayUnavailableError, McpToolListIncompleteError, McpOutputUncheckedError, MCP_TOOL_EXTRAS_KEY, retryingFetch, } from '../mcp/index.js';
|
|
54
|
+
export { mcpClient, mcpServe, mockMcpClient, gatewayTransport, GatewayAuthorizationRequiredError, McpReplayUnavailableError, McpToolListIncompleteError, McpOutputUncheckedError, MCP_TOOL_EXTRAS_KEY, retryingFetch, canTerminate, mcpClientPool, MCP_POOL_DEFAULTS, MAX_DEFINITION_ENTRIES, MAX_SHARED_TOOLS, McpPoolRefusedError, PoolFullError, } from '../mcp/index.js';
|
|
55
55
|
export { agentCoreGatewayTransport, agentCoreGatewayUrl, gatewaySearchTool, hasGatewaySearch, AGENTCORE_GATEWAY_SEARCH_TOOL, AGENTCORE_POLICY_SESSION_HEADER, AGENTCORE_SIGV4_SERVICE, } from '../adapters/mcp/agentcore.js';
|
|
56
56
|
export type { AgentCoreGatewayTransportOptions, AgentCoreGatewayUrlOptions, } from '../adapters/mcp/agentcore.js';
|
|
57
57
|
export { agentCoreRuntimeMcpTransport, agentCoreRuntimeUrl, } from '../adapters/mcp/agentcoreRuntime/transport.js';
|
|
@@ -59,5 +59,5 @@ export { AGENTCORE_RUNTIME_SESSION_HEADER } from '../adapters/mcp/agentcoreRunti
|
|
|
59
59
|
export type { AgentCoreRuntimeAuth, AgentCoreRuntimeBearerAuth, AgentCoreRuntimeMcpTransportOptions, AgentCoreRuntimeRetryOptions, AgentCoreRuntimeUrlOptions, } from '../adapters/mcp/agentcoreRuntime/transport.js';
|
|
60
60
|
export type { AgentCoreRuntimeSession } from '../adapters/mcp/agentcoreRuntime/session.js';
|
|
61
61
|
export type { AgentCoreRuntimeSdkClient, BedrockAgentCoreRuntimeSdkModule, } from '../adapters/mcp/agentcoreRuntime/invoke.js';
|
|
62
|
-
export type { GatewayTransportOptions, McpCallToolResult, McpClient, McpClientOptions, McpReplayDeduplication, McpReplayKind, McpReplayOptions, McpReplayPolicy, McpReplayTool, McpReplayUnavailableReason, McpToolListIncompleteReason, McpConnection, McpConnectionOptions, McpJsonSchemaValidator, McpSdk, McpSdkClient, ThrottleFetch, McpTransport, McpStdioTransport, McpHttpTransport, McpGatewayTransport, MockMcpClientOptions, MockMcpTool, McpServeOptions, McpServeHandle, McpServeTransport, McpStdioServeTransport, McpHttpServeTransport, McpSdkServer, McpToolExtras, } from '../mcp/index.js';
|
|
62
|
+
export type { GatewayTransportOptions, McpCallToolResult, McpClient, McpClientOptions, McpReplayDeduplication, McpReplayKind, McpReplayOptions, McpReplayPolicy, McpReplayTool, McpReplayUnavailableReason, McpToolListIncompleteReason, McpConnection, McpConnectionOptions, McpJsonSchemaValidator, McpSdk, McpSdkClient, ThrottleFetch, McpTransport, McpStdioTransport, McpHttpTransport, McpGatewayTransport, MockMcpClientOptions, MockMcpTool, McpServeOptions, McpServeHandle, McpServeTransport, McpStdioServeTransport, McpHttpServeTransport, McpSdkServer, McpToolExtras, McpTerminateOutcome, TerminableMcpClient, McpTransportSettings, McpClientPool, McpClientPoolOptions, McpPoolDefinitionSharing, McpPoolEndReason, McpPoolIdentity, McpPoolLease, McpPoolLimit, McpPoolRefusal, McpPoolReport, McpPoolScope, McpPoolShareContext, McpPoolStats, } from '../mcp/index.js';
|
|
63
63
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","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,EAGhB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,iCAAiC,EAIjC,yBAAyB,EAIzB,0BAA0B,EAI1B,uBAAuB,EAIvB,mBAAmB,EAKnB,aAAa,GACd,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,gCAAgC,EAChC,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAC/F,YAAY,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,mCAAmC,EACnC,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,+CAA+C,CAAC;AACvD,YAAY,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAC3F,YAAY,EACV,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAGhB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,0BAA0B,EAC1B,2BAA2B,EAI3B,aAAa,EACb,oBAAoB,EAEpB,sBAAsB,EACtB,MAAM,EACN,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tool-providers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OA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,EAC1B,2BAA2B,EAI3B,aAAa,EACb,oBAAoB,EAEpB,sBAAsB,EACtB,MAAM,EACN,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EAEb,mBAAmB,EACnB,mBAAmB,EAEnB,oBAAoB,EAEpB,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,YAAY,GACb,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mcpClientUse — the door an MCP client pool's use of a client enters the run by.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: a per-dispatch port (the `requestEvidence.ts` precedent) for a call,
|
|
5
|
+
* and a per-context ledger for a listing, behind one allow-list.
|
|
6
|
+
* Role: `mcpClientPool` (`mcp/pool/`, layer L12) runs below the agent (L9):
|
|
7
|
+
* it cannot reach a scope, and the agent cannot import it. Both reach
|
|
8
|
+
* this module, which sits under both:
|
|
9
|
+
*
|
|
10
|
+
* - a CALL: the dispatch loop puts a port on each call's context
|
|
11
|
+
* (`mcpClientUseFor`), stamped with that call's id; a pooled tool files its
|
|
12
|
+
* use through it once, as its `execute` settles;
|
|
13
|
+
* - a LISTING: the pool files its use against the `ToolDispatchContext`
|
|
14
|
+
* object it was handed (`fileListUse`); the tools slot takes the uses filed
|
|
15
|
+
* against the context it passed (`takeListUses`) after `list(ctx)`, and
|
|
16
|
+
* emits them.
|
|
17
|
+
*
|
|
18
|
+
* Either way the event is `agentfootprint.tools.mcp_client`, emitted by the
|
|
19
|
+
* library stage that called the pool, mid-stage, through `typedEmit` — so the
|
|
20
|
+
* run's redaction rule serves it and its meta carries the real stage.
|
|
21
|
+
*
|
|
22
|
+
* THE ALLOW-LIST is the whole record: the fields of `ToolsMcpClientPayload`,
|
|
23
|
+
* the library's own words for each, numbers, and two ids of the pool's own
|
|
24
|
+
* making (`keyHash`, `clientId`) under a fixed shape. A filing with anything
|
|
25
|
+
* else — a field nobody listed, a word outside its set, a non-plain value — is
|
|
26
|
+
* refused whole, never trimmed into something it did not say.
|
|
27
|
+
*/
|
|
28
|
+
import type { ToolsMcpClientPayload } from '../events/payloads.js';
|
|
29
|
+
import { type EmitableScope } from '../recorders/core/typedEmit.js';
|
|
30
|
+
/** What a pool use files: the payload, less the call id the dispatch stamps. */
|
|
31
|
+
export type McpClientUse = Omit<ToolsMcpClientPayload, 'toolCallId'>;
|
|
32
|
+
/** Where one dispatched call's pool use goes. */
|
|
33
|
+
export interface McpClientUseSink {
|
|
34
|
+
/** File the use. Never throws; a filing outside the allow-list is refused whole. */
|
|
35
|
+
file(use: McpClientUse): void;
|
|
36
|
+
}
|
|
37
|
+
/** @internal The context key the dispatcher puts a call's sink under. */
|
|
38
|
+
export declare const MCP_CLIENT_USE: unique symbol;
|
|
39
|
+
/** What the dispatcher spreads into a call's context. */
|
|
40
|
+
export interface McpClientUsePort {
|
|
41
|
+
readonly [MCP_CLIENT_USE]: McpClientUseSink;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The port for one dispatch: files `agentfootprint.tools.mcp_client` at
|
|
45
|
+
* `'call'`, stamped with the call's id, at most once.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mcpClientUseFor(scope: EmitableScope, call: {
|
|
48
|
+
readonly toolCallId: string;
|
|
49
|
+
}): McpClientUsePort;
|
|
50
|
+
/** The sink a call's context carries, or `undefined`. Never throws, whatever `ctx` is. */
|
|
51
|
+
export declare function mcpClientUseOf(ctx: unknown): McpClientUseSink | undefined;
|
|
52
|
+
/** File a listing's use against the `ToolDispatchContext` it was asked with. Never throws. */
|
|
53
|
+
export declare function fileListUse(ctx: unknown, use: McpClientUse): void;
|
|
54
|
+
/** Take (and forget) every listing use filed against `ctx`. */
|
|
55
|
+
export declare function takeListUses(ctx: object): readonly McpClientUse[];
|
|
56
|
+
/** Emit the listing uses filed against `ctx`, as the tools slot does after `list(ctx)`. */
|
|
57
|
+
export declare function emitListUses(scope: EmitableScope, ctx: object): void;
|
|
58
|
+
/** The use as the record may carry it, or `undefined` when it is outside the allow-list. */
|
|
59
|
+
export declare function servedUse(use: McpClientUse): McpClientUse | undefined;
|
|
60
|
+
//# sourceMappingURL=mcpClientUse.d.ts.map
|