agentfootprint 12.0.1 → 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 -0
- 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/callChecks.d.ts +160 -0
- package/dist/esm/mcp/callChecks.js +237 -0
- package/dist/esm/mcp/callChecks.js.map +1 -0
- 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 +11 -1
- package/dist/esm/mcp/index.js +15 -0
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/mcp/listingGenerations.d.ts +54 -0
- package/dist/esm/mcp/listingGenerations.js +75 -0
- package/dist/esm/mcp/listingGenerations.js.map +1 -0
- package/dist/esm/mcp/mcpClient.d.ts +18 -1
- package/dist/esm/mcp/mcpClient.js +302 -57
- 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/toolList.d.ts +90 -0
- package/dist/esm/mcp/toolList.js +123 -0
- package/dist/esm/mcp/toolList.js.map +1 -0
- package/dist/esm/mcp/types.d.ts +197 -3
- 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 +15 -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/callChecks.js +247 -0
- package/dist/mcp/callChecks.js.map +1 -0
- 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 +25 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/listingGenerations.js +80 -0
- package/dist/mcp/listingGenerations.js.map +1 -0
- package/dist/mcp/mcpClient.js +306 -59
- 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/mcp/toolList.js +128 -0
- package/dist/mcp/toolList.js.map +1 -0
- package/dist/redaction/knownStrings.js +34 -0
- package/dist/redaction/knownStrings.js.map +1 -1
- package/dist/tool-providers/index.js +20 -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/callChecks.d.ts +161 -0
- package/dist/types/mcp/callChecks.d.ts.map +1 -0
- 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 +11 -1
- package/dist/types/mcp/index.d.ts.map +1 -1
- package/dist/types/mcp/listingGenerations.d.ts +55 -0
- package/dist/types/mcp/listingGenerations.d.ts.map +1 -0
- 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/toolList.d.ts +91 -0
- package/dist/types/mcp/toolList.d.ts.map +1 -0
- package/dist/types/mcp/types.d.ts +197 -3
- 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
package/dist/esm/mcp/index.js
CHANGED
|
@@ -18,4 +18,19 @@ export { retryingFetch } from './throttleRetry.js';
|
|
|
18
18
|
// A call under 'app-authorized' that a connection cannot honour is refused
|
|
19
19
|
// before it is sent, with a typed reason.
|
|
20
20
|
export { McpReplayUnavailableError } from './replayUnavailable.js';
|
|
21
|
+
// A tool list that could not be read to its end (past 100 requests, or a cursor
|
|
22
|
+
// sent twice) is refused with this error and a typed reason, never cut short.
|
|
23
|
+
export { McpToolListIncompleteError } from './toolList.js';
|
|
24
|
+
// A tool whose list the SDK no longer holds, and whose output this connection
|
|
25
|
+
// cannot check — no JSON Schema validator reachable — is refused, never answered
|
|
26
|
+
// unchecked.
|
|
27
|
+
export { McpOutputUncheckedError } from './callChecks.js';
|
|
28
|
+
// Ending a client's remote session: a feature-detected capability, never a
|
|
29
|
+
// required member of `McpClient` (`close()` stays local).
|
|
30
|
+
export { canTerminate } from './terminate.js';
|
|
31
|
+
// A client per conversation, for one server: bounded, ended remotely, and its
|
|
32
|
+
// tool definitions per client incarnation unless the app declares sharing.
|
|
33
|
+
export { mcpClientPool } from './pool/mcpClientPool.js';
|
|
34
|
+
export { MCP_POOL_DEFAULTS, MAX_DEFINITION_ENTRIES, MAX_SHARED_TOOLS, } from './pool/options.js';
|
|
35
|
+
export { McpPoolRefusedError, PoolFullError, } from './pool/errors.js';
|
|
21
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,8EAA8E;AAC9E,0EAA0E;AAC1E,OAAO,EAAE,mBAAmB,EAAsB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAA+C,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,iCAAiC,GAElC,MAAM,uBAAuB,CAAC;AAC/B,6EAA6E;AAC7E,4EAA4E;AAC5E,sEAAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAgBnD,2EAA2E;AAC3E,0CAA0C;AAC1C,OAAO,EAAE,yBAAyB,EAAmC,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,8EAA8E;AAC9E,0EAA0E;AAC1E,OAAO,EAAE,mBAAmB,EAAsB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAA+C,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,iCAAiC,GAElC,MAAM,uBAAuB,CAAC;AAC/B,6EAA6E;AAC7E,4EAA4E;AAC5E,sEAAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAgBnD,2EAA2E;AAC3E,0CAA0C;AAC1C,OAAO,EAAE,yBAAyB,EAAmC,MAAM,wBAAwB,CAAC;AACpG,gFAAgF;AAChF,8EAA8E;AAC9E,OAAO,EAAE,0BAA0B,EAAoC,MAAM,eAAe,CAAC;AAC7F,8EAA8E;AAC9E,iFAAiF;AACjF,aAAa;AACb,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,2EAA2E;AAC3E,0DAA0D;AAC1D,OAAO,EAAE,YAAY,EAA4B,MAAM,gBAAgB,CAAC;AACxE,8EAA8E;AAC9E,2EAA2E;AAC3E,OAAO,EAAE,aAAa,EAAyC,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,GAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,aAAa,GAGd,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* listingGenerations — which `tools/list` answer the MCP SDK's `Client` holds
|
|
3
|
+
* its per-tool call checks for, as far as one connection can tell.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: a count of the list requests one connection sent and settled.
|
|
6
|
+
* Role: The SDK's `Client` keeps its per-tool call checks (`callChecks.ts`)
|
|
7
|
+
* for the tools of the last `tools/list` answer it received: every
|
|
8
|
+
* answer replaces them. A request that FAILED can replace them too: the
|
|
9
|
+
* SDK caches an answer before it returns it, and caching can throw after
|
|
10
|
+
* the old checks are cleared (1.32: an `outputSchema` its validator
|
|
11
|
+
* cannot compile). The library cannot see inside the SDK, but it sends
|
|
12
|
+
* every list request it makes. So it counts them:
|
|
13
|
+
*
|
|
14
|
+
* - a request is OUT from the moment it is sent until it settles, because the
|
|
15
|
+
* SDK replaces its checks before the library sees the answer;
|
|
16
|
+
* - each request that settles, answered or failed, starts a new GENERATION.
|
|
17
|
+
*
|
|
18
|
+
* The SDK holds the checks of a listing's one answer only while the generation
|
|
19
|
+
* that answer settled at is the latest and no request is out. The SDK keeps one
|
|
20
|
+
* set of checks per client, so there is one count per connection object: every
|
|
21
|
+
* `mcpClient` over the same client shares it (`listingsOf`). A `tools/list`
|
|
22
|
+
* request the library did not send — your own code calling `listTools` on a
|
|
23
|
+
* client passed as `connection`, or that client's own automatic refresh
|
|
24
|
+
* (`listChanged.tools` with `autoRefresh`) — is not counted: the library cannot
|
|
25
|
+
* see it, and a tool it handed out goes on leaving its checks to an SDK that no
|
|
26
|
+
* longer holds them. That limit is documented, and pinned by
|
|
27
|
+
* `test/mcp/listingKeepsChecks.limits.test.ts`.
|
|
28
|
+
*/
|
|
29
|
+
/** One settled `tools/list` request's answer, and the generation it settled at. */
|
|
30
|
+
export interface SettledListing<T> {
|
|
31
|
+
readonly answer: T;
|
|
32
|
+
readonly generation: number;
|
|
33
|
+
}
|
|
34
|
+
/** The `tools/list` requests one connection has out, and the generations they settled at. */
|
|
35
|
+
export declare class ListingGenerations {
|
|
36
|
+
private settled;
|
|
37
|
+
private out;
|
|
38
|
+
/**
|
|
39
|
+
* Send one `tools/list` request with `send`, counted as out from the moment it
|
|
40
|
+
* is sent until it settles. Settling starts a new generation, answered or not.
|
|
41
|
+
*
|
|
42
|
+
* @throws whatever `send` rejects with, as it rejected
|
|
43
|
+
*/
|
|
44
|
+
ask<T>(send: () => Promise<T>): Promise<SettledListing<T>>;
|
|
45
|
+
/** True while `generation` is the latest settled one and no request is out. */
|
|
46
|
+
isLatest(generation: number): boolean;
|
|
47
|
+
private settle;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The count for `connection`: the same one for every `mcpClient` that adapts
|
|
51
|
+
* the same client, because the SDK keeps one set of checks per client and a
|
|
52
|
+
* listing by any of them replaces it.
|
|
53
|
+
*/
|
|
54
|
+
export declare function listingsOf(connection: object): ListingGenerations;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* listingGenerations — which `tools/list` answer the MCP SDK's `Client` holds
|
|
3
|
+
* its per-tool call checks for, as far as one connection can tell.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: a count of the list requests one connection sent and settled.
|
|
6
|
+
* Role: The SDK's `Client` keeps its per-tool call checks (`callChecks.ts`)
|
|
7
|
+
* for the tools of the last `tools/list` answer it received: every
|
|
8
|
+
* answer replaces them. A request that FAILED can replace them too: the
|
|
9
|
+
* SDK caches an answer before it returns it, and caching can throw after
|
|
10
|
+
* the old checks are cleared (1.32: an `outputSchema` its validator
|
|
11
|
+
* cannot compile). The library cannot see inside the SDK, but it sends
|
|
12
|
+
* every list request it makes. So it counts them:
|
|
13
|
+
*
|
|
14
|
+
* - a request is OUT from the moment it is sent until it settles, because the
|
|
15
|
+
* SDK replaces its checks before the library sees the answer;
|
|
16
|
+
* - each request that settles, answered or failed, starts a new GENERATION.
|
|
17
|
+
*
|
|
18
|
+
* The SDK holds the checks of a listing's one answer only while the generation
|
|
19
|
+
* that answer settled at is the latest and no request is out. The SDK keeps one
|
|
20
|
+
* set of checks per client, so there is one count per connection object: every
|
|
21
|
+
* `mcpClient` over the same client shares it (`listingsOf`). A `tools/list`
|
|
22
|
+
* request the library did not send — your own code calling `listTools` on a
|
|
23
|
+
* client passed as `connection`, or that client's own automatic refresh
|
|
24
|
+
* (`listChanged.tools` with `autoRefresh`) — is not counted: the library cannot
|
|
25
|
+
* see it, and a tool it handed out goes on leaving its checks to an SDK that no
|
|
26
|
+
* longer holds them. That limit is documented, and pinned by
|
|
27
|
+
* `test/mcp/listingKeepsChecks.limits.test.ts`.
|
|
28
|
+
*/
|
|
29
|
+
/** The `tools/list` requests one connection has out, and the generations they settled at. */
|
|
30
|
+
export class ListingGenerations {
|
|
31
|
+
settled = 0;
|
|
32
|
+
out = 0;
|
|
33
|
+
/**
|
|
34
|
+
* Send one `tools/list` request with `send`, counted as out from the moment it
|
|
35
|
+
* is sent until it settles. Settling starts a new generation, answered or not.
|
|
36
|
+
*
|
|
37
|
+
* @throws whatever `send` rejects with, as it rejected
|
|
38
|
+
*/
|
|
39
|
+
async ask(send) {
|
|
40
|
+
this.out += 1;
|
|
41
|
+
try {
|
|
42
|
+
const answer = await send();
|
|
43
|
+
return { answer, generation: this.settle() };
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
this.settle();
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** True while `generation` is the latest settled one and no request is out. */
|
|
51
|
+
isLatest(generation) {
|
|
52
|
+
return this.out === 0 && this.settled === generation;
|
|
53
|
+
}
|
|
54
|
+
settle() {
|
|
55
|
+
this.out -= 1;
|
|
56
|
+
this.settled += 1;
|
|
57
|
+
return this.settled;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** One count per connection object, held only as long as the connection is. */
|
|
61
|
+
const BY_CONNECTION = new WeakMap();
|
|
62
|
+
/**
|
|
63
|
+
* The count for `connection`: the same one for every `mcpClient` that adapts
|
|
64
|
+
* the same client, because the SDK keeps one set of checks per client and a
|
|
65
|
+
* listing by any of them replaces it.
|
|
66
|
+
*/
|
|
67
|
+
export function listingsOf(connection) {
|
|
68
|
+
let listings = BY_CONNECTION.get(connection);
|
|
69
|
+
if (listings === undefined) {
|
|
70
|
+
listings = new ListingGenerations();
|
|
71
|
+
BY_CONNECTION.set(connection, listings);
|
|
72
|
+
}
|
|
73
|
+
return listings;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=listingGenerations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listingGenerations.js","sourceRoot":"","sources":["../../../src/mcp/listingGenerations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAQH,6FAA6F;AAC7F,MAAM,OAAO,kBAAkB;IACrB,OAAO,GAAG,CAAC,CAAC;IACZ,GAAG,GAAG,CAAC,CAAC;IAEhB;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CAAI,IAAsB;QACjC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;YAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,+EAA+E;IAC/E,QAAQ,CAAC,UAAkB;QACzB,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC;IACvD,CAAC;IAEO,MAAM;QACZ,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAED,+EAA+E;AAC/E,MAAM,aAAa,GAAG,IAAI,OAAO,EAA8B,CAAC;AAEhE;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,UAAkB;IAC3C,IAAI,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACpC,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
* loads only when a consumer actually constructs a client. Tests
|
|
43
43
|
* inject `_client` and skip the import path entirely.
|
|
44
44
|
*/
|
|
45
|
-
import type {
|
|
45
|
+
import type { Tool } from '../tools/tools.js';
|
|
46
|
+
import type { McpClient, McpClientOptions, McpConnectionOptions, McpListedTool } from './types.js';
|
|
47
|
+
import { type ClientPort, type PooledClientSeam } from './clientPort.js';
|
|
46
48
|
/**
|
|
47
49
|
* Connect to an MCP server. Returns an `McpClient` that exposes the
|
|
48
50
|
* server's tools as agentfootprint `Tool[]` and a `close()` to tear
|
|
@@ -66,3 +68,18 @@ import type { McpClient, McpClientOptions, McpConnectionOptions } from './types.
|
|
|
66
68
|
* transport fails to connect.
|
|
67
69
|
*/
|
|
68
70
|
export declare function mcpClient(opts: McpClientOptions | McpConnectionOptions): Promise<McpClient>;
|
|
71
|
+
/**
|
|
72
|
+
* @internal The MCP client pool's way to open a client (`mcp/pool/`): an
|
|
73
|
+
* ordinary `mcpClient` — the same discovery, checks, ledger and retry series —
|
|
74
|
+
* plus what only a pool asks for (`clientPort.ts`), and the port back.
|
|
75
|
+
*/
|
|
76
|
+
export declare function openPooledClient(opts: McpClientOptions, seam: PooledClientSeam): Promise<{
|
|
77
|
+
readonly client: McpClient;
|
|
78
|
+
readonly port: ClientPort;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* @internal What a listed MCP tool looks like as a `Tool`, less its `execute`:
|
|
82
|
+
* its schema, its provenance and the declarations its `_meta` carries. The ONE
|
|
83
|
+
* shape both an `mcpClient` tool and an MCP client pool's bound tool take.
|
|
84
|
+
*/
|
|
85
|
+
export declare function mcpToolShape(serverName: string, mcp: McpListedTool): Omit<Tool, 'execute'>;
|