@cmdoss/suipay-mcp 0.2.2-dev.0 → 0.2.2
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/README.md +6 -59
- package/dist/bin/suipay.js +3 -2
- package/dist/{chunk-NVTYOOMY.js → chunk-26NKQ37M.js} +1616 -3688
- package/dist/chunk-A3JIIDYT.js +161 -0
- package/dist/chunk-EM7PKWVL.js +39 -0
- package/dist/http-BnIjiwcR.d.ts +1149 -0
- package/dist/http.d.ts +2 -7
- package/dist/http.js +2 -1
- package/dist/index.d.ts +35 -109
- package/dist/index.js +3 -14
- package/dist/personal-message-5PF4KVLF.js +284 -0
- package/package.json +7 -9
- package/dist/chunk-K6WM4Z7H.js +0 -46
- package/dist/http-B4YTVw0k.d.ts +0 -392
package/dist/http-B4YTVw0k.d.ts
DELETED
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
import { GrantSnapshot } from '@cmdoss/suipay-core/policy/grant-target';
|
|
2
|
-
import { McpAccessContext } from '@cmdoss/suipay-sdk/mcp/access-context';
|
|
3
|
-
import { SettlementDTO } from '@cmdoss/suipay-sdk/buyer/settlement-dto';
|
|
4
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
-
import { GetObjectJson } from '@cmdoss/suipay-sdk/agent-sdk/reads';
|
|
6
|
-
import { DelegatedKeySigner, DelegatedPayerDeps } from '@cmdoss/suipay-sdk/delegated-signer/payer';
|
|
7
|
-
import { TraceRunResolver, TraceSink } from '@cmdoss/suipay-core/trace/types';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Authenticated MCP request context (remote Streamable HTTP).
|
|
11
|
-
* Bearer is required on /mcp; tools enforce scope from the resolved grant.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Read/prepare-only shared-pool context for an authenticated MCP bearer.
|
|
16
|
-
*
|
|
17
|
-
* Non-custodial: the gateway holds NO key that can spend. There is deliberately
|
|
18
|
-
* no `decryptDelegateSeed` and no forwarded `sponsorAuthorization` here — the
|
|
19
|
-
* `pay` tool only PREPARES an unsigned `spend_account::settle_policy_payment` transaction from the
|
|
20
|
-
* immutable grant snapshot (`prepareSpendAccountPayment`), and the client that
|
|
21
|
-
* holds the delegate key signs locally and submits. Only signatures ever reach
|
|
22
|
-
* the gateway. See docs/design/mcp-non-custodial-signing.md and ADR-0013 §3.
|
|
23
|
-
*/
|
|
24
|
-
interface McpSpendAccountPayAuth {
|
|
25
|
-
snapshot: GrantSnapshot;
|
|
26
|
-
packageId: string;
|
|
27
|
-
/**
|
|
28
|
-
* Re-verify the paying authority against a FRESH graph + injected clock at
|
|
29
|
-
* prepare time. Throws on drift/expiry so the pay tool refuses to hand back a
|
|
30
|
-
* signing request for a grant that just went paused/revoked/expired. Optional:
|
|
31
|
-
* absent for legacy/local paths.
|
|
32
|
-
*/
|
|
33
|
-
assertLive?: () => Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
interface McpAuthContext {
|
|
36
|
-
grantId: string;
|
|
37
|
-
buyerAccountId: string;
|
|
38
|
-
/** Space-separated scopes from the access token. */
|
|
39
|
-
scope: string;
|
|
40
|
-
/** Public, descriptive policy context. Never used as payment authority. */
|
|
41
|
-
access?: McpAccessContext;
|
|
42
|
-
/**
|
|
43
|
-
* When present, `pay` prepares unsigned spend_account::settle_policy_payment bytes for the
|
|
44
|
-
* client-held delegate key to sign locally — no server-side decrypt or
|
|
45
|
-
* signing. Stdio local V1 profile path remains when absent.
|
|
46
|
-
*/
|
|
47
|
-
spendAccountPay?: McpSpendAccountPayAuth;
|
|
48
|
-
/**
|
|
49
|
-
* Server-scoped receipts reader, built by the /mcp route from the verified
|
|
50
|
-
* bearer's connection. The `receipts` tool calls this instead of hitting the
|
|
51
|
-
* global settlement feed with a forwarded credential — the bearer never
|
|
52
|
-
* enters the tool surface, and scoping is enforced server-side. Absent for
|
|
53
|
-
* local stdio (no connection, no settlement source).
|
|
54
|
-
*/
|
|
55
|
-
listReceipts?: (challengeId?: string) => Promise<SettlementDTO[]>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type McpTarget = 'dev' | 'local';
|
|
59
|
-
/**
|
|
60
|
-
* Public suipay-dev origins (Railway). `local` is the laptop stack from
|
|
61
|
-
* `pnpm demo:testnet`. Explicit `SUIPAY_GATEWAY_URL` / `SUIPAY_CONSOLE_URL`
|
|
62
|
-
* still win over the preset.
|
|
63
|
-
*/
|
|
64
|
-
declare const MCP_TARGET_PRESETS: Record<McpTarget, {
|
|
65
|
-
consoleUrl: string;
|
|
66
|
-
gatewayUrl: string;
|
|
67
|
-
}>;
|
|
68
|
-
interface McpConfig {
|
|
69
|
-
/** Preset used when console/gateway env is unset. Set by `loadMcpConfig`. */
|
|
70
|
-
target?: McpTarget;
|
|
71
|
-
consoleUrl: string;
|
|
72
|
-
gatewayUrl: string;
|
|
73
|
-
rpcUrl: string;
|
|
74
|
-
network: 'testnet' | 'mainnet' | 'devnet' | 'localnet';
|
|
75
|
-
packageId: string;
|
|
76
|
-
recipient: string;
|
|
77
|
-
coinType: string;
|
|
78
|
-
sponsorUrl: string;
|
|
79
|
-
minFunded: bigint;
|
|
80
|
-
minMaxPerPayment: bigint;
|
|
81
|
-
label: string;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* CLI flags: `--local` / `-local`, `--dev` / `-dev`. Unknown args are ignored
|
|
85
|
-
* so an MCP host can pass extra argv without breaking stdio.
|
|
86
|
-
*/
|
|
87
|
-
declare function parseMcpTargetFlag(argv: readonly string[]): McpTarget | undefined;
|
|
88
|
-
declare function resolveMcpTarget(env?: NodeJS.ProcessEnv, argv?: readonly string[]): McpTarget;
|
|
89
|
-
/** Same public origin, or the same laptop loopback port (`localhost` ≡ `127.0.0.1`). */
|
|
90
|
-
declare function sameMcpGateway(a: string, b: string): boolean;
|
|
91
|
-
declare function loadMcpConfig(env?: NodeJS.ProcessEnv, argv?: readonly string[]): McpConfig;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Agent-held settlement wiring for the `pay` tool.
|
|
95
|
-
*
|
|
96
|
-
* The gateway prepares (it holds no key). Settlement needs the delegate key, so
|
|
97
|
-
* it can only happen in the process that holds one. This module answers a single
|
|
98
|
-
* question for a given grant: *is this process that grant's agent, and is it
|
|
99
|
-
* configured to settle?* Any "no" returns null and `pay` falls back to handing
|
|
100
|
-
* back unsigned bytes — the pre-existing behavior.
|
|
101
|
-
*
|
|
102
|
-
* Two conditions gate it, and the first is the security one:
|
|
103
|
-
*
|
|
104
|
-
* 1. **The persisted key must be the key the grant names.** A hosted gateway
|
|
105
|
-
* running this same tool code either holds no credentials file (null) or
|
|
106
|
-
* holds one for some unrelated key (address mismatch → null). It can only
|
|
107
|
-
* settle by already possessing the grant's delegate seed — which is exactly
|
|
108
|
-
* the custody ADR-0015 removed, not a state a flag protects against.
|
|
109
|
-
* 2. **The settlement dependencies must all be present.** A half-configured
|
|
110
|
-
* settler is worse than none: it would sign and then fail to confirm. Missing
|
|
111
|
-
* anything → null, prepare-only.
|
|
112
|
-
*
|
|
113
|
-
* The key is read, never minted. See `loadLocalSigner`.
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
/** Everything `pay` needs to settle rather than prepare. */
|
|
117
|
-
interface AgentHeldSettlement {
|
|
118
|
-
signer: DelegatedKeySigner;
|
|
119
|
-
getObjectJson: GetObjectJson;
|
|
120
|
-
payerDeps: DelegatedPayerDeps;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Resolve agent-held settlement for one grant, or null to stay prepare-only.
|
|
124
|
-
* Injectable so `createServer` can be driven without touching disk,
|
|
125
|
-
* chain, or environment.
|
|
126
|
-
*/
|
|
127
|
-
type AgentHeldResolver = (cfg: McpConfig, spendAccountPay: McpSpendAccountPayAuth) => AgentHeldSettlement | null;
|
|
128
|
-
/** Test seam: drop the process ledger so suites do not share reservations. */
|
|
129
|
-
declare function resetAgentHeldProcessLedger(): void;
|
|
130
|
-
declare function resolveAgentHeldSettlement(cfg: McpConfig, spendAccountPay: McpSpendAccountPayAuth, env?: NodeJS.ProcessEnv): AgentHeldSettlement | null;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Transparent MCP wire proxy.
|
|
134
|
-
*
|
|
135
|
-
* This module is the *only* place in the system that parses MCP methods and
|
|
136
|
-
* JSON-RPC ids. The gateway authenticates and hands over a run manager and a
|
|
137
|
-
* sink; it never sniffs an MCP body a second time. Payment code emits domain
|
|
138
|
-
* facts, never wire facts. That single-owner rule is what stops two subsystems
|
|
139
|
-
* from disagreeing about which tool call a payment belongs to.
|
|
140
|
-
*
|
|
141
|
-
* Transparency is the top invariant, and it is structural rather than
|
|
142
|
-
* best-effort:
|
|
143
|
-
*
|
|
144
|
-
* - With no runtime, this file is a pass-through and does not touch the
|
|
145
|
-
* request or the response at all.
|
|
146
|
-
* - With a runtime, observation reads `Request.clone()` and `Response.clone()`
|
|
147
|
-
* only. The exact `Response` instance the handler produced is what the caller
|
|
148
|
-
* receives, so byte equality is by construction, not by careful copying.
|
|
149
|
-
* - Response observation is started and deliberately not awaited. A trace
|
|
150
|
-
* store that hangs cannot hold an MCP response open.
|
|
151
|
-
* - The request side cannot be fire-and-forget — the proxy must know the run
|
|
152
|
-
* and the JSON-RPC ids before the handler runs — so it is bounded instead:
|
|
153
|
-
* one deadline over envelope parsing plus run selection, and the same byte
|
|
154
|
-
* cap the response observer uses. A hung store or an oversized body costs
|
|
155
|
-
* the trace, never the request.
|
|
156
|
-
* - Every observation path is wrapped: a hostile body, a failing run manager or
|
|
157
|
-
* a throwing sink degrades to "no trace", never to a changed response.
|
|
158
|
-
*
|
|
159
|
-
* Volume control lives here too. One `tool_called` per JSON-RPC id and one
|
|
160
|
-
* terminal `tool_result` / `tool_error` per id — never one row per SSE frame.
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
/** Everything the proxy needs to attribute wire facts to one owned run. */
|
|
164
|
-
interface McpTraceRuntime {
|
|
165
|
-
buyerAccountId: string;
|
|
166
|
-
connectionId: string;
|
|
167
|
-
runs: TraceRunResolver;
|
|
168
|
-
sink: TraceSink;
|
|
169
|
-
/**
|
|
170
|
-
* HMAC secret for signed cross-request context. Supplied by the composition
|
|
171
|
-
* root so a published SDK never reads a gateway-only environment variable.
|
|
172
|
-
* Absent means internal hops carry no correlation and the gateway simply
|
|
173
|
-
* emits no linked events.
|
|
174
|
-
*/
|
|
175
|
-
secret?: string | null;
|
|
176
|
-
/** Injected clock; tests pin it, production leaves it out. */
|
|
177
|
-
now?: () => number;
|
|
178
|
-
}
|
|
179
|
-
/** The proxy-resolved context handed down to payment code (Task 5 seams). */
|
|
180
|
-
interface McpTraceContext {
|
|
181
|
-
traceId: string;
|
|
182
|
-
requestId: string | null;
|
|
183
|
-
}
|
|
184
|
-
interface McpTraceHooks {
|
|
185
|
-
runtime: McpTraceRuntime;
|
|
186
|
-
context: McpTraceContext;
|
|
187
|
-
sink: TraceSink;
|
|
188
|
-
}
|
|
189
|
-
/** One JSON-RPC message read off the request side. */
|
|
190
|
-
interface McpEnvelopeEntry {
|
|
191
|
-
method: string | null;
|
|
192
|
-
jsonRpcId: string | number | null;
|
|
193
|
-
/** Canonical, header-safe request id. `null` for notifications. */
|
|
194
|
-
requestId: string | null;
|
|
195
|
-
toolName: string | null;
|
|
196
|
-
toolArguments: unknown;
|
|
197
|
-
clientName: string | null;
|
|
198
|
-
clientVersion: string | null;
|
|
199
|
-
protocolVersion: string | null;
|
|
200
|
-
}
|
|
201
|
-
interface McpEnvelope {
|
|
202
|
-
batch: boolean;
|
|
203
|
-
entries: McpEnvelopeEntry[];
|
|
204
|
-
/** First entry's method — what run selection keys on. */
|
|
205
|
-
method: string | null;
|
|
206
|
-
requestId: string | null;
|
|
207
|
-
clientName: string | null;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Canonical MCP request id.
|
|
211
|
-
*
|
|
212
|
-
* JSON-RPC allows both `7` and `"7"` as distinct ids, and they must stay
|
|
213
|
-
* distinct: correlating a payment to the wrong tool call is worse than not
|
|
214
|
-
* correlating it. Numbers keep their JSON form under `n:`; strings are
|
|
215
|
-
* base64url-encoded under `s:` so an id containing newlines, colons or quotes
|
|
216
|
-
* survives being carried in an HTTP header without escaping games.
|
|
217
|
-
*/
|
|
218
|
-
declare function canonicalMcpRequestId(id: unknown): string | null;
|
|
219
|
-
/**
|
|
220
|
-
* Read the JSON-RPC envelope from a request **clone**.
|
|
221
|
-
*
|
|
222
|
-
* The caller owns cloning; this consumes the body it is given. An unparsable,
|
|
223
|
-
* bodiless or over-cap request yields an empty envelope rather than an error — a
|
|
224
|
-
* malformed request is the transport's problem to answer, not tracing's problem
|
|
225
|
-
* to block.
|
|
226
|
-
*/
|
|
227
|
-
declare function inspectMcpEnvelope(request: Request, maxBytes?: number): Promise<McpEnvelope>;
|
|
228
|
-
interface TraceMcpHttpRequestInput {
|
|
229
|
-
request: Request;
|
|
230
|
-
/**
|
|
231
|
-
* The real MCP handler. Receives the untouched original request, plus the
|
|
232
|
-
* resolved trace context when tracing is live.
|
|
233
|
-
*/
|
|
234
|
-
handle: (request: Request, hooks?: McpTraceHooks) => Promise<Response>;
|
|
235
|
-
runtime?: McpTraceRuntime | null;
|
|
236
|
-
/** Cap on bytes read for observation, request and response. Never unbounded. */
|
|
237
|
-
maxObservedBytes?: number;
|
|
238
|
-
/**
|
|
239
|
-
* Deadline for envelope parsing plus run selection, the only trace work that
|
|
240
|
-
* happens before the handler. Past it the exchange proceeds untraced.
|
|
241
|
-
*/
|
|
242
|
-
runSetupTimeoutMs?: number;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Wrap one MCP HTTP exchange in observation.
|
|
246
|
-
*
|
|
247
|
-
* The response returned here is the exact object `handle` produced. Nothing on
|
|
248
|
-
* the observation path can change it, delay it, or prevent it.
|
|
249
|
-
*/
|
|
250
|
-
declare function traceMcpHttpRequest(input: TraceMcpHttpRequestInput): Promise<Response>;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Transport-neutral SuiPay MCP server + tool registry.
|
|
254
|
-
* Used by stdio (index.ts) and Streamable HTTP (http.ts).
|
|
255
|
-
* Remote HTTP passes McpAuthContext so tools enforce OAuth scope + shared-pool pay.
|
|
256
|
-
*/
|
|
257
|
-
|
|
258
|
-
declare const PACKAGE_NAME = "@cmdoss/suipay-mcp";
|
|
259
|
-
declare const TOOLS: readonly [{
|
|
260
|
-
readonly name: "access_context";
|
|
261
|
-
readonly description: "Inspect profiles, policies, service targets, spend caps, usage, and lifecycle state enforced for this authenticated SuiPay session. Call before choosing a paid service.";
|
|
262
|
-
readonly inputSchema: {
|
|
263
|
-
readonly type: "object";
|
|
264
|
-
readonly properties: {};
|
|
265
|
-
};
|
|
266
|
-
}, {
|
|
267
|
-
readonly name: "pay";
|
|
268
|
-
readonly description: string;
|
|
269
|
-
readonly inputSchema: {
|
|
270
|
-
readonly type: "object";
|
|
271
|
-
readonly properties: {
|
|
272
|
-
readonly url: {
|
|
273
|
-
readonly type: "string";
|
|
274
|
-
readonly description: "Full gateway resource URL.";
|
|
275
|
-
};
|
|
276
|
-
readonly method: {
|
|
277
|
-
readonly type: "string";
|
|
278
|
-
readonly enum: readonly ["GET", "POST"];
|
|
279
|
-
readonly description: "HTTP method of the paid request. Defaults to GET.";
|
|
280
|
-
};
|
|
281
|
-
readonly json: {
|
|
282
|
-
readonly type: "object";
|
|
283
|
-
readonly description: "JSON request body for a POST. Sent as application/json and bound to the payment.";
|
|
284
|
-
};
|
|
285
|
-
readonly recipient: {
|
|
286
|
-
readonly type: "string";
|
|
287
|
-
readonly description: "Sui address you expect to be paid. The payment is refused, unsigned, if the prepared transaction pays anyone else.";
|
|
288
|
-
};
|
|
289
|
-
readonly maxAmount: {
|
|
290
|
-
readonly type: "string";
|
|
291
|
-
readonly description: "Atomic ceiling you will spend on this call. The payment is refused, unsigned, if the offer costs more.";
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
readonly required: readonly ["url"];
|
|
295
|
-
};
|
|
296
|
-
}, {
|
|
297
|
-
readonly name: "discover";
|
|
298
|
-
readonly description: "Search SuiPay gateway resources. After login, each row includes name, path, url, catalog price, and whether the current session can cover one call at that price (descriptive only — pay still enforces the grant).";
|
|
299
|
-
readonly inputSchema: {
|
|
300
|
-
readonly type: "object";
|
|
301
|
-
readonly properties: {
|
|
302
|
-
readonly query: {
|
|
303
|
-
readonly type: "string";
|
|
304
|
-
readonly description: "Optional service search terms.";
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
};
|
|
308
|
-
}, {
|
|
309
|
-
readonly name: "receipts";
|
|
310
|
-
readonly description: "List SuiPay settlement receipts, optionally filtered by challenge id.";
|
|
311
|
-
readonly inputSchema: {
|
|
312
|
-
readonly type: "object";
|
|
313
|
-
readonly properties: {
|
|
314
|
-
readonly challengeId: {
|
|
315
|
-
readonly type: "string";
|
|
316
|
-
readonly description: "Optional payment challenge id.";
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
};
|
|
320
|
-
}, {
|
|
321
|
-
readonly name: "suipay_login";
|
|
322
|
-
readonly description: "Mint or reuse the local delegate key (version-2, mode 0600) and return a clickable console URL immediately so the owner can bind a spend-account grant. Does not wait for the wallet. Default target is Railway suipay-dev; pass target=\"local\" (or start the binary with --local) for the laptop stack. Stdio only; hosted /mcp never holds a spendable key.";
|
|
323
|
-
readonly inputSchema: {
|
|
324
|
-
readonly type: "object";
|
|
325
|
-
readonly properties: {
|
|
326
|
-
readonly label: {
|
|
327
|
-
readonly type: "string";
|
|
328
|
-
readonly description: "Label shown in SuiPay console.";
|
|
329
|
-
};
|
|
330
|
-
readonly target: {
|
|
331
|
-
readonly type: "string";
|
|
332
|
-
readonly enum: readonly ["dev", "local"];
|
|
333
|
-
readonly description: "Where to bind the grant. Default is Railway suipay-dev. Pass \"local\" for localhost:3000 / 127.0.0.1:4340.";
|
|
334
|
-
};
|
|
335
|
-
readonly gatewayResourceUrl: {
|
|
336
|
-
readonly type: "string";
|
|
337
|
-
readonly description: "Gateway resource URL whose 402 defines recipient, asset, and package.";
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
};
|
|
341
|
-
}, {
|
|
342
|
-
readonly name: "suipay_logout";
|
|
343
|
-
readonly description: "Remove the local delegate-key credentials file. Missing file is success. Force clears a corrupt file without printing the seed.";
|
|
344
|
-
readonly inputSchema: {
|
|
345
|
-
readonly type: "object";
|
|
346
|
-
readonly properties: {
|
|
347
|
-
readonly force: {
|
|
348
|
-
readonly type: "boolean";
|
|
349
|
-
readonly description: "Remove local credentials even if the file is unreadable.";
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
};
|
|
353
|
-
}];
|
|
354
|
-
/**
|
|
355
|
-
* Create a Server with the public SuiPay tool surface registered.
|
|
356
|
-
*
|
|
357
|
-
* `trace` is the proxy-resolved run for this HTTP exchange. It is threaded into
|
|
358
|
-
* tool dependencies so payment code can emit *domain* events, and nothing else:
|
|
359
|
-
* this wrapper deliberately emits no tool lifecycle of its own, because the
|
|
360
|
-
* proxy observes the actual JSON-RPC wire and a second source would double-count
|
|
361
|
-
* every call and disagree on ids.
|
|
362
|
-
*/
|
|
363
|
-
interface McpServerOptions {
|
|
364
|
-
/**
|
|
365
|
-
* How `pay` finds an agent-held delegate key for the authenticated grant.
|
|
366
|
-
* Defaults to the persisted local key (`resolveAgentHeldSettlement`), which
|
|
367
|
-
* returns null on any process that does not hold the key the grant names — so
|
|
368
|
-
* the default is prepare-only everywhere except the agent's own machine.
|
|
369
|
-
* Injectable for tests; there is no way to make it hand over a key the grant
|
|
370
|
-
* does not already authorize.
|
|
371
|
-
*/
|
|
372
|
-
resolveAgentHeld?: AgentHeldResolver;
|
|
373
|
-
}
|
|
374
|
-
declare function createServer(cfg: McpConfig, auth?: McpAuthContext, trace?: McpTraceHooks, options?: McpServerOptions): Server;
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Streamable HTTP transport for SuiPay MCP.
|
|
378
|
-
* Stateless per-request (sessionIdGenerator undefined) — same public tools as stdio.
|
|
379
|
-
* Auth context is required for remote gateway /mcp (bearer resolved upstream).
|
|
380
|
-
*
|
|
381
|
-
* The optional trace runtime turns on live observation. It is a pure wrapper:
|
|
382
|
-
* `traceMcpHttpRequest` reads clones and returns the transport's own Response,
|
|
383
|
-
* so passing a runtime cannot change what an MCP client sees.
|
|
384
|
-
*/
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Handle one MCP Streamable HTTP request (initialize, tools/list, tools/call, …).
|
|
388
|
-
* Creates a fresh transport+server pair per request (stateless mode).
|
|
389
|
-
*/
|
|
390
|
-
declare function handleSuipayMcpHttpRequest(req: Request, cfg: McpConfig, auth?: McpAuthContext, trace?: McpTraceRuntime | null, options?: McpServerOptions): Promise<Response>;
|
|
391
|
-
|
|
392
|
-
export { type AgentHeldResolver as A, type McpConfig as M, PACKAGE_NAME as P, TOOLS as T, type McpAuthContext as a, type McpTraceHooks as b, type AgentHeldSettlement as c, MCP_TARGET_PRESETS as d, type McpEnvelope as e, type McpEnvelopeEntry as f, type McpServerOptions as g, type McpTarget as h, type McpTraceContext as i, type McpTraceRuntime as j, canonicalMcpRequestId as k, createServer as l, handleSuipayMcpHttpRequest as m, inspectMcpEnvelope as n, loadMcpConfig as o, parseMcpTargetFlag as p, resolveAgentHeldSettlement as q, resetAgentHeldProcessLedger as r, resolveMcpTarget as s, sameMcpGateway as t, traceMcpHttpRequest as u };
|