stitchkit 0.124.0 → 0.124.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/CHANGELOG.md +63 -0
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +7 -2
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +1 -1
- package/dist/entrypoints/agent-runtime/realtime.js +3 -3
- package/dist/entrypoints/agent-runtime/sandbox.js +2 -2
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
- package/dist/entrypoints/agent-runtime/testing.js +3 -3
- package/dist/entrypoints/agent-runtime.js +3 -3
- package/dist/entrypoints/application/diagnostic-journal.js +3 -5
- package/dist/entrypoints/application/directory-inbox.js +9 -11
- package/dist/entrypoints/application.js +3 -3
- package/dist/entrypoints/cli/publish.js +6 -6
- package/dist/entrypoints/cli.js +6 -3
- package/dist/entrypoints/files.js +5 -5
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +6 -6
- package/dist/entrypoints/node.js +1 -1
- package/dist/entrypoints/process.js +1 -1
- package/dist/entrypoints/remote.js +1 -1
- package/dist/entrypoints/server.js +8 -8
- package/dist/entrypoints/telegram.js +2 -2
- package/dist/entrypoints/testing.js +1 -1
- package/dist/entrypoints/tools/connections.d.ts +2 -2
- package/dist/entrypoints/tools/connections.d.ts.map +1 -1
- package/dist/entrypoints/tools/connections.js +122 -30
- package/dist/entrypoints/tools/mcp.d.ts +1 -1
- package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
- package/dist/entrypoints/tools/mcp.js +8 -6
- package/dist/entrypoints/tools/toolkit.js +2 -2
- package/dist/entrypoints/tools.js +3 -3
- package/dist/{index-8yky60kq.js → index-1szhrfsf.js} +5 -7
- package/dist/{index-mqttte96.js → index-3ymcmpa9.js} +3 -5
- package/dist/{index-v8xm2s9v.js → index-7177dxjn.js} +1 -1
- package/dist/{index-2x2ch0bt.js → index-782qtc24.js} +1 -1
- package/dist/{index-j8rda9n6.js → index-8pwwd6rp.js} +3 -3
- package/dist/{index-m616f0yz.js → index-8x0q6yfb.js} +134 -7
- package/dist/{index-jswst0h3.js → index-b2sey031.js} +50 -5
- package/dist/{index-tt3ej8r3.js → index-btjwc7xr.js} +217 -24
- package/dist/{index-ezwvsqx9.js → index-fvd6pvw3.js} +1 -1
- package/dist/{index-6qrspvxp.js → index-gbj964dt.js} +1 -1
- package/dist/{index-q89kd1xc.js → index-hzk4ydpy.js} +1 -1
- package/dist/{index-w0wy05gr.js → index-jkjh7zw4.js} +50 -40
- package/dist/{index-ac6vvm30.js → index-jp2qd9jb.js} +1 -1
- package/dist/{index-45dyex0j.js → index-m9hb9wnk.js} +1 -1
- package/dist/index-mm89hd8v.js +39 -0
- package/dist/{index-zbzagr9k.js → index-ne4j9998.js} +16 -15
- package/dist/{index-jc5xgkpk.js → index-qsm899qp.js} +1 -1
- package/dist/{index-cjbn98zt.js → index-ss67fxhj.js} +21 -3
- package/dist/index-wqzw3qg9.js +91 -0
- package/dist/{index-364k2zwa.js → index-wt6rw7rf.js} +5 -7
- package/dist/{index-5efrpfmj.js → index-wxadzdb7.js} +1 -1
- package/dist/internal/deadline.d.ts +30 -0
- package/dist/internal/deadline.d.ts.map +1 -1
- package/dist/internal/pinned-http.d.ts +1 -1
- package/dist/internal/pinned-http.d.ts.map +1 -1
- package/dist/internal/secure-fetch.d.ts +8 -0
- package/dist/internal/secure-fetch.d.ts.map +1 -1
- package/dist/internal/stream-chunks.d.ts +10 -0
- package/dist/internal/stream-chunks.d.ts.map +1 -1
- package/dist/tools/cli/resumable-download.d.ts +18 -0
- package/dist/tools/cli/resumable-download.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts +18 -0
- package/dist/tools/cli/update.d.ts.map +1 -1
- package/dist/tools/connections/catalog-cache.d.ts +9 -0
- package/dist/tools/connections/catalog-cache.d.ts.map +1 -0
- package/dist/tools/connections/errors.d.ts +10 -1
- package/dist/tools/connections/errors.d.ts.map +1 -1
- package/dist/tools/connections/limits.d.ts +16 -4
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/dist/tools/connections/mcp-client.d.ts +10 -2
- package/dist/tools/connections/mcp-client.d.ts.map +1 -1
- package/dist/tools/connections/mcp.d.ts.map +1 -1
- package/dist/tools/connections/operation-limits.d.ts +12 -1
- package/dist/tools/connections/operation-limits.d.ts.map +1 -1
- package/dist/tools/connections/sse-session.d.ts +2 -2
- package/dist/tools/connections/sse-session.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +38 -2
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/mcp/catalog-stamp.d.ts +47 -0
- package/dist/tools/mcp/catalog-stamp.d.ts.map +1 -0
- package/dist/tools/mcp/catalog.d.ts +1 -30
- package/dist/tools/mcp/catalog.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +6 -1
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +1 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/llms/cli.2.txt +60 -6
- package/llms/stitchkit.2.txt +6 -0
- package/llms/stitchkit.3.txt +1 -1
- package/llms/tools-connections.txt +5 -3
- package/llms/tools-mcp.txt +5 -2
- package/llms/tools.txt +10 -3
- package/llms-full.txt +87 -15
- package/llms.txt +5 -5
- package/package.json +6 -6
- package/dist/index-9tqbxv5p.js +0 -44
- package/dist/index-b56nnscm.js +0 -132
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
DEFAULT_STREAM_LINE_BYTES,
|
|
19
19
|
createBoundedLineDecoder,
|
|
20
20
|
readBoundedUtf8Lines
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-m9hb9wnk.js";
|
|
22
22
|
import {
|
|
23
23
|
inputIsQuery
|
|
24
24
|
} from "./index-xhzq2qvj.js";
|
|
@@ -26,6 +26,9 @@ import {
|
|
|
26
26
|
ApiError2,
|
|
27
27
|
refuseLocally
|
|
28
28
|
} from "./index-kfjkb396.js";
|
|
29
|
+
import {
|
|
30
|
+
isStreamResponse
|
|
31
|
+
} from "./index-ss67fxhj.js";
|
|
29
32
|
import {
|
|
30
33
|
typedEntries,
|
|
31
34
|
isRecord,
|
|
@@ -415,17 +418,17 @@ async function* parseSSE2(source, options) {
|
|
|
415
418
|
}
|
|
416
419
|
|
|
417
420
|
// src/browser/contract-stream.ts
|
|
418
|
-
function sourceFor(
|
|
421
|
+
function sourceFor(body, descriptor) {
|
|
419
422
|
const options = {
|
|
420
423
|
maxLineBytes: descriptor.maxFrameBytes ?? DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
|
|
421
424
|
finalLine: descriptor.finalLine
|
|
422
425
|
};
|
|
423
|
-
return descriptor.format === "sse" ? parseSSE2(
|
|
426
|
+
return descriptor.format === "sse" ? parseSSE2(body, options) : parseNDJSON2(body, options);
|
|
424
427
|
}
|
|
425
|
-
async function* readContractStream(
|
|
428
|
+
async function* readContractStream(body, descriptor, abort) {
|
|
426
429
|
let ended = false;
|
|
427
430
|
let terminalSeen = descriptor.terminal === undefined;
|
|
428
|
-
const source = sourceFor(
|
|
431
|
+
const source = sourceFor(body, descriptor);
|
|
429
432
|
try {
|
|
430
433
|
for (;; ) {
|
|
431
434
|
const next = await source.next();
|
|
@@ -525,7 +528,11 @@ class OwnedContractStream {
|
|
|
525
528
|
}
|
|
526
529
|
}
|
|
527
530
|
function parseContractStream(response, descriptor, abort) {
|
|
528
|
-
|
|
531
|
+
if (!isStreamResponse(response)) {
|
|
532
|
+
abort();
|
|
533
|
+
throw new Error("Streaming endpoint did not return a Response");
|
|
534
|
+
}
|
|
535
|
+
return new OwnedContractStream(readContractStream(response.body, descriptor, abort), abort);
|
|
529
536
|
}
|
|
530
537
|
|
|
531
538
|
// src/browser/client-executors.ts
|
|
@@ -543,15 +550,9 @@ function withOutput(endpoint, result, abortStream) {
|
|
|
543
550
|
if (endpoint.rawResponse)
|
|
544
551
|
return result;
|
|
545
552
|
if ("stream" in endpoint && endpoint.stream) {
|
|
546
|
-
return result.then((value) => {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
throw new Error("Streaming endpoint did not return a Response");
|
|
550
|
-
}
|
|
551
|
-
return parseContractStream(value, endpoint.stream, abortStream ?? (() => {
|
|
552
|
-
return;
|
|
553
|
-
}));
|
|
554
|
-
}, (error) => {
|
|
553
|
+
return result.then((value) => parseContractStream(value, endpoint.stream, abortStream ?? (() => {
|
|
554
|
+
return;
|
|
555
|
+
})), (error) => {
|
|
555
556
|
abortStream?.();
|
|
556
557
|
throw error;
|
|
557
558
|
});
|
|
@@ -2,14 +2,32 @@ import {
|
|
|
2
2
|
abortReason,
|
|
3
3
|
untilAborted
|
|
4
4
|
} from "./index-a5qr2rj6.js";
|
|
5
|
+
import {
|
|
6
|
+
isRecord
|
|
7
|
+
} from "./index-hkxgennw.js";
|
|
5
8
|
|
|
6
9
|
// src/internal/stream-chunks.ts
|
|
10
|
+
function isReadableByteStream(value) {
|
|
11
|
+
return isRecord(value) && typeof value.getReader === "function";
|
|
12
|
+
}
|
|
13
|
+
function isStreamResponse(value) {
|
|
14
|
+
return isRecord(value) && isReadableByteStream(value.body);
|
|
15
|
+
}
|
|
16
|
+
function bytesOf(source) {
|
|
17
|
+
if (isReadableByteStream(source))
|
|
18
|
+
return source;
|
|
19
|
+
if (Symbol.asyncIterator in source)
|
|
20
|
+
return source;
|
|
21
|
+
if (source.body === undefined)
|
|
22
|
+
throw new TypeError("The response has no body stream to read");
|
|
23
|
+
return source.body;
|
|
24
|
+
}
|
|
7
25
|
async function* chunksOf(source, signal) {
|
|
8
26
|
signal?.throwIfAborted();
|
|
9
|
-
const stream = source
|
|
27
|
+
const stream = bytesOf(source);
|
|
10
28
|
if (stream === null)
|
|
11
29
|
return;
|
|
12
|
-
if (stream
|
|
30
|
+
if (isReadableByteStream(stream)) {
|
|
13
31
|
const reader = stream.getReader();
|
|
14
32
|
const abort = () => {
|
|
15
33
|
if (signal)
|
|
@@ -65,4 +83,4 @@ async function* chunksOf(source, signal) {
|
|
|
65
83
|
}
|
|
66
84
|
}
|
|
67
85
|
|
|
68
|
-
export { chunksOf };
|
|
86
|
+
export { isStreamResponse, chunksOf };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAX_TIMER_MS
|
|
3
|
+
} from "./index-eemvahkc.js";
|
|
4
|
+
import {
|
|
5
|
+
assertPositiveSafeInteger
|
|
6
|
+
} from "./index-0s4xebbg.js";
|
|
7
|
+
|
|
8
|
+
// src/internal/deadline.ts
|
|
9
|
+
async function withDeadline(value, timeoutMs) {
|
|
10
|
+
if (!(value instanceof Promise))
|
|
11
|
+
return { settled: true, value };
|
|
12
|
+
let timer;
|
|
13
|
+
const expiry = new Promise((resolve) => {
|
|
14
|
+
timer = setTimeout(() => resolve({ settled: false }), timeoutMs);
|
|
15
|
+
});
|
|
16
|
+
try {
|
|
17
|
+
return await Promise.race([
|
|
18
|
+
value.then((settledValue) => ({
|
|
19
|
+
settled: true,
|
|
20
|
+
value: settledValue
|
|
21
|
+
})),
|
|
22
|
+
expiry
|
|
23
|
+
]);
|
|
24
|
+
} finally {
|
|
25
|
+
if (timer !== undefined)
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function withSignalDeadline(timeoutMs, caller, makeReason, body) {
|
|
30
|
+
assertPositiveSafeInteger("Deadline timeoutMs", timeoutMs, RangeError);
|
|
31
|
+
if (timeoutMs > MAX_TIMER_MS)
|
|
32
|
+
throw new RangeError("Deadline timeoutMs exceeds the timer range");
|
|
33
|
+
caller?.throwIfAborted();
|
|
34
|
+
const deadline = new AbortController;
|
|
35
|
+
const timer = setTimeout(() => deadline.abort(makeReason()), timeoutMs);
|
|
36
|
+
const signal = caller ? AbortSignal.any([caller, deadline.signal]) : deadline.signal;
|
|
37
|
+
try {
|
|
38
|
+
return await body(signal);
|
|
39
|
+
} finally {
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function withIdleDeadline(idleMs, parent, makeReason, body) {
|
|
44
|
+
if (idleMs === undefined)
|
|
45
|
+
return body({ signal: parent, touch: () => {
|
|
46
|
+
return;
|
|
47
|
+
} });
|
|
48
|
+
parent.throwIfAborted();
|
|
49
|
+
const quiet = new AbortController;
|
|
50
|
+
const timer = startIdleTimer(idleMs, () => quiet.abort(makeReason()));
|
|
51
|
+
const signal = AbortSignal.any([parent, quiet.signal]);
|
|
52
|
+
const touch = () => {
|
|
53
|
+
if (!signal.aborted)
|
|
54
|
+
timer.touch();
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
return await body({ signal, touch });
|
|
58
|
+
} finally {
|
|
59
|
+
timer.stop();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function startIdleTimer(idleMs, onIdle, options = {}) {
|
|
63
|
+
assertPositiveSafeInteger("Idle timer idleMs", idleMs, RangeError);
|
|
64
|
+
if (idleMs > MAX_TIMER_MS)
|
|
65
|
+
throw new RangeError("Idle timer idleMs exceeds the timer range");
|
|
66
|
+
let done = false;
|
|
67
|
+
const arm = () => {
|
|
68
|
+
const handle = setTimeout(() => {
|
|
69
|
+
done = true;
|
|
70
|
+
onIdle();
|
|
71
|
+
}, idleMs);
|
|
72
|
+
if (options.unref)
|
|
73
|
+
handle.unref?.();
|
|
74
|
+
return handle;
|
|
75
|
+
};
|
|
76
|
+
let handle = arm();
|
|
77
|
+
return {
|
|
78
|
+
touch() {
|
|
79
|
+
if (done)
|
|
80
|
+
return;
|
|
81
|
+
clearTimeout(handle);
|
|
82
|
+
handle = arm();
|
|
83
|
+
},
|
|
84
|
+
stop() {
|
|
85
|
+
done = true;
|
|
86
|
+
clearTimeout(handle);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { withDeadline, withSignalDeadline, withIdleDeadline, startIdleTimer };
|
|
@@ -5,17 +5,15 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
isWithinDir2
|
|
7
7
|
} from "./index-5cc6r990.js";
|
|
8
|
-
import {
|
|
9
|
-
BoundedFileReadError,
|
|
10
|
-
readBoundedFile
|
|
11
|
-
} from "./index-m616f0yz.js";
|
|
12
8
|
import {
|
|
13
9
|
writeAllBytes,
|
|
14
10
|
writeAtomicFileStaged
|
|
15
|
-
} from "./index-
|
|
11
|
+
} from "./index-jp2qd9jb.js";
|
|
16
12
|
import {
|
|
17
|
-
AtomicFilePublicationError2
|
|
18
|
-
|
|
13
|
+
AtomicFilePublicationError2,
|
|
14
|
+
BoundedFileReadError,
|
|
15
|
+
readBoundedFile
|
|
16
|
+
} from "./index-8x0q6yfb.js";
|
|
19
17
|
import {
|
|
20
18
|
raceAbort
|
|
21
19
|
} from "./index-b0kddvzw.js";
|
|
@@ -24,4 +24,34 @@ export declare function withDeadline(value: unknown, timeoutMs: number): Promise
|
|
|
24
24
|
* (referenced) timer, so a pending wait keeps the process alive until its deadline.
|
|
25
25
|
*/
|
|
26
26
|
export declare function withSignalDeadline<T>(timeoutMs: number, caller: AbortSignal | undefined, makeReason: () => unknown, body: (signal: AbortSignal) => Promise<T>): Promise<T>;
|
|
27
|
+
/** The signal and progress hook a body runs under in {@link withIdleDeadline}. */
|
|
28
|
+
export interface IdleDeadline {
|
|
29
|
+
/** Aborts with the parent's reason, or with `makeReason()` when no progress arrives in time. */
|
|
30
|
+
readonly signal: AbortSignal;
|
|
31
|
+
/** Report progress: the quiet period starts again. Does nothing once the body settled. */
|
|
32
|
+
touch(): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Run `body` under a deadline that restarts on every `touch()` — "nothing arrived for
|
|
36
|
+
* `idleMs`" rather than "the whole exchange took too long", so a slow transfer that keeps
|
|
37
|
+
* delivering is never cut off while a silent one still ends.
|
|
38
|
+
*
|
|
39
|
+
* With `idleMs` undefined there is no idle timer and `signal` is the parent's own. The timer is
|
|
40
|
+
* cleared on every outcome, and a `touch()` that arrives after the body settled — a read still
|
|
41
|
+
* finishing behind a released await — re-arms nothing, so no timer outlives the call.
|
|
42
|
+
*/
|
|
43
|
+
export declare function withIdleDeadline<T>(idleMs: number | undefined, parent: AbortSignal, makeReason: () => unknown, body: (idle: IdleDeadline) => Promise<T>): Promise<T>;
|
|
44
|
+
/** A quiet-period timer: `touch()` restarts it, `stop()` ends it for good. */
|
|
45
|
+
export interface IdleTimer {
|
|
46
|
+
touch(): void;
|
|
47
|
+
stop(): void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Call `onIdle` once `idleMs` pass without a `touch()`. After `stop()` — or after it fired —
|
|
51
|
+
* nothing re-arms it, so a late `touch()` from a read still draining cannot leave a timer
|
|
52
|
+
* behind. The one timer behind {@link withIdleDeadline} and the guarded fetch's idle bound.
|
|
53
|
+
*/
|
|
54
|
+
export declare function startIdleTimer(idleMs: number, onIdle: () => void, options?: {
|
|
55
|
+
unref?: boolean;
|
|
56
|
+
}): IdleTimer;
|
|
27
57
|
//# sourceMappingURL=deadline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../../src/internal/deadline.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC,CAiBjE;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,SAAS,E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I,IAAI,IAAI,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,IAAI,EAClB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAChC,SAAS,CAwBX"}
|
|
@@ -12,7 +12,7 @@ import type { IncomingMessage } from 'node:http';
|
|
|
12
12
|
export type PinnedTransport = (url: URL, resolved: {
|
|
13
13
|
address: string;
|
|
14
14
|
family: 4 | 6;
|
|
15
|
-
}, signal: AbortSignal | undefined) => Promise<Response>;
|
|
15
|
+
}, signal: AbortSignal | undefined, headers?: Record<string, string>) => Promise<Response>;
|
|
16
16
|
/**
|
|
17
17
|
* One hop over a socket opened to `resolved.address`: the `Host` header keeps
|
|
18
18
|
* the URL's host and, for TLS, the certificate is verified against it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pinned-http.d.ts","sourceRoot":"","sources":["../../src/internal/pinned-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjD,2EAA2E;AAC3E,MAAM,MAAM,eAAe,GAAG,CAC5B,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAA;CAAE,EAC5C,MAAM,EAAE,WAAW,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"pinned-http.d.ts","sourceRoot":"","sources":["../../src/internal/pinned-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjD,2EAA2E;AAC3E,MAAM,MAAM,eAAe,GAAG,CAC5B,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAA;CAAE,EAC5C,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC7B,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAA;CAAE,EAC5C,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACnC,OAAO,CAAC,QAAQ,CAAC,CAiCnB;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,QAAQ,CA6ClE"}
|
|
@@ -43,6 +43,14 @@ export interface GuardedFetchOptions {
|
|
|
43
43
|
* body must still end. Default 120 seconds.
|
|
44
44
|
*/
|
|
45
45
|
bodyTimeoutMs?: number;
|
|
46
|
+
/**
|
|
47
|
+
* End the fetch when nothing arrives for this long — no headers yet, or no body chunk since
|
|
48
|
+
* the last one. A slow download that keeps delivering is never cut off by it; `bodyTimeoutMs`
|
|
49
|
+
* still bounds the whole body. Unset: no idle bound.
|
|
50
|
+
*/
|
|
51
|
+
idleTimeoutMs?: number;
|
|
52
|
+
/** Request headers (`Range`, `If-Range`), sent on every hop to the starting URL's origin and dropped on a redirect to another. */
|
|
53
|
+
headers?: Record<string, string>;
|
|
46
54
|
/** Optional caller cancellation, combined with both deadlines. */
|
|
47
55
|
signal?: AbortSignal;
|
|
48
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secure-fetch.d.ts","sourceRoot":"","sources":["../../src/internal/secure-fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secure-fetch.d.ts","sourceRoot":"","sources":["../../src/internal/secure-fetch.ts"],"names":[],"mappings":"AAuB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AAM,EAAE,MAAM,CAAC,CAAC;IACjC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;CACV;AAED;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,2BAA2B;CACzC;AA+CD;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC,CA2CjC;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGnF"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
/** Bytes a stream reader accepts: a `Response` body, a web stream, or any async byte iterable. */
|
|
2
2
|
export type StreamByteSource = Response | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
3
|
+
/** A response of any fetch runtime whose body can be read as a web stream. */
|
|
4
|
+
export type StreamResponse = {
|
|
5
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Whether a value is a response with a readable body — the global `Response` or another runtime's,
|
|
9
|
+
* such as the `FetchResponse` of `expo/fetch`, which is its own class. A response without a body is
|
|
10
|
+
* not one.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isStreamResponse(value: unknown): value is StreamResponse;
|
|
3
13
|
/**
|
|
4
14
|
* Every chunk of a byte source: the chunk loop the line readers and the bounded body readers
|
|
5
15
|
* share. The source is cancelled or returned on every exit path.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-chunks.d.ts","sourceRoot":"","sources":["../../src/internal/stream-chunks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream-chunks.d.ts","sourceRoot":"","sources":["../../src/internal/stream-chunks.ts"],"names":[],"mappings":"AAGA,kGAAkG;AAClG,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,cAAc,CAAC,UAAU,CAAC,GAC1B,aAAa,CAAC,UAAU,CAAC,CAAC;AAE9B,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;CAAE,CAAC;AAO3E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAmBD;;;;;;;;GAQG;AACH,wBAAuB,QAAQ,CAC7B,MAAM,EAAE,gBAAgB,EACxB,MAAM,CAAC,EAAE,WAAW,GACnB,cAAc,CAAC,UAAU,CAAC,CA+C5B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface CliAssetDownload {
|
|
2
|
+
url: URL;
|
|
3
|
+
/** The build's digest from the manifest — what makes a kept part this build's part. */
|
|
4
|
+
sha256: string;
|
|
5
|
+
allowPrivateHosts: boolean;
|
|
6
|
+
/** Ceiling on transferred bytes, a continued part included. */
|
|
7
|
+
maxBytes: number;
|
|
8
|
+
timeoutMs: number;
|
|
9
|
+
idleTimeoutMs?: number;
|
|
10
|
+
/** Keep the transfer here between attempts; without it nothing survives a failure. */
|
|
11
|
+
partialPath?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Download the asset and hand it to `decode`, which throws when the bytes are not the build.
|
|
15
|
+
* Returns what `decode` returns.
|
|
16
|
+
*/
|
|
17
|
+
export declare function downloadCliAsset<T>(config: CliAssetDownload, decode: (bytes: Uint8Array) => Promise<T>): Promise<T>;
|
|
18
|
+
//# sourceMappingURL=resumable-download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resumable-download.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/resumable-download.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,GAAG,CAAC;IACT,uFAAuF;IACvF,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAgBD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC,CAgCZ"}
|
|
@@ -52,7 +52,25 @@ export interface CliUpdateApplyConfig {
|
|
|
52
52
|
asset: CliBuildAsset;
|
|
53
53
|
/** The file to replace; defaults to the running executable. */
|
|
54
54
|
targetPath?: string;
|
|
55
|
+
/**
|
|
56
|
+
* How long the download may take, in milliseconds — bounding the response headers and,
|
|
57
|
+
* separately, the body. Default 1 800 000 (30 minutes).
|
|
58
|
+
*/
|
|
55
59
|
timeoutMs?: number;
|
|
60
|
+
/**
|
|
61
|
+
* End the download when nothing arrives for this many milliseconds — no response yet, or no
|
|
62
|
+
* chunk since the last one. Default 30 000 when `timeoutMs` is not set either; with a
|
|
63
|
+
* declared `timeoutMs` there is none unless set.
|
|
64
|
+
*/
|
|
65
|
+
idleTimeoutMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Keep the transfer in this file between attempts, so an interrupted download continues from
|
|
68
|
+
* where it stopped (`Range` with `If-Range`) instead of starting over. A record of what the part
|
|
69
|
+
* holds is kept at `<partialPath>.json`, and `<partialPath>.lock` refuses a second download into
|
|
70
|
+
* the same part. Put it in the application's state directory; both files are removed once the
|
|
71
|
+
* download is decoded, whether it was the build or not. Unset: nothing survives a failure.
|
|
72
|
+
*/
|
|
73
|
+
partialPath?: string;
|
|
56
74
|
maxBytes?: number;
|
|
57
75
|
allowPrivateHosts?: boolean;
|
|
58
76
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/update.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/update.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAErB,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAYrB,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,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AW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA0D5F;AAoED,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,mBAAmB,CAchF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type McpCatalogStamp } from '../mcp/catalog-stamp.js';
|
|
2
|
+
import type { McpConnectionCatalogStore } from './types.js';
|
|
3
|
+
/** The `tools/list` result: the stored one when it is the served catalog, else a fresh one. */
|
|
4
|
+
export declare function listMcpCatalog(params: {
|
|
5
|
+
store: McpConnectionCatalogStore | undefined;
|
|
6
|
+
served: McpCatalogStamp | undefined;
|
|
7
|
+
list: () => Promise<unknown>;
|
|
8
|
+
}): Promise<unknown>;
|
|
9
|
+
//# sourceMappingURL=catalog-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-cache.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/catalog-cache.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,eAAe,EAAuB,MAAM,sBAAsB,CAAC;AACjF,OAAO,KAAK,EAA6B,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAkDpF,+FAA+F;AAC/F,wBAAsB,cAAc,CAAC,MAAM,EAAE;IAC3C,KAAK,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAC7C,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC;IACpC,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,CAmBnB"}
|
|
@@ -52,9 +52,17 @@ export declare class ConnectionBudgetExceededError extends Error implements Tool
|
|
|
52
52
|
constructor(limit: number, actual: number, unit?: string);
|
|
53
53
|
[TOOL_ERROR_PROJECTION](): AppError;
|
|
54
54
|
}
|
|
55
|
+
/** Which deadline ended an operation: the whole exchange's, or the quiet period's. */
|
|
56
|
+
export type ConnectionDeadline = 'total' | 'idle';
|
|
57
|
+
/** Diagnostics of a timeout: the operation, and which of its deadlines fired. */
|
|
58
|
+
export interface ConnectionTimeoutContext extends ConnectionFailureContext {
|
|
59
|
+
/** Defaults to `'total'`. */
|
|
60
|
+
deadline?: ConnectionDeadline;
|
|
61
|
+
}
|
|
55
62
|
/**
|
|
56
63
|
* One logical operation exceeded its deadline. The original error remains
|
|
57
64
|
* available to in-process observers while tools receive its safe projection.
|
|
65
|
+
* `timeoutMs` is the limit that fired — `idleTimeoutMs` when `deadline` is `'idle'`.
|
|
58
66
|
*/
|
|
59
67
|
export declare class ConnectionTimeoutError extends Error implements ToolErrorProjection {
|
|
60
68
|
readonly connectionName: string;
|
|
@@ -62,7 +70,8 @@ export declare class ConnectionTimeoutError extends Error implements ToolErrorPr
|
|
|
62
70
|
readonly operation: ConnectionOperation;
|
|
63
71
|
readonly phase: ConnectionPhase;
|
|
64
72
|
readonly observedReadBytes: number;
|
|
65
|
-
|
|
73
|
+
readonly deadline: ConnectionDeadline;
|
|
74
|
+
constructor(connectionName: string, timeoutMs: number, context?: ConnectionTimeoutContext);
|
|
66
75
|
[TOOL_ERROR_PROJECTION](): AppError;
|
|
67
76
|
}
|
|
68
77
|
/** A raw response body or legacy response frame exceeded its byte ceiling. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA0C,MAAM,uBAAuB,CAAC;AACzF,OAAO,EACL,qBAAqB,EACrB,KAAK,mBAAmB,EACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,qFAAqF;AACrF,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AAEH,4EAA4E;AAC5E,qBAAa,oCACX,SAAQ,KACR,YAAW,mBAAmB;IAE9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAEhC,YACE,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,wBAA6B,EAQvC;IAED,CAAC,qBAAqB,CAAC,IAAI,QAAQ,CAclC;CACF;AAED,kEAAkE;AAClE,qBAAa,sBAAuB,SAAQ,KAAM,YAAW,mBAAmB;IAC9E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,eAAe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AsF;AACtF,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,CAAC;AAElD,iFAAiF;AACjF,MAAM,WAAW,wBAAyB,SAAQ,wBAAwB;IACxE,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAM,YAAW,mBAAmB;IAC9E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IAEtC,YACE,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,wBAA6B,EAevC;IAED,CAAC,qBAAqB,CAAC,IAAI,QAAQ,CAiBlC;CACF;AAED,8EAA8E;AAC9E,qBAAa,+BAAgC,SAAQ,KAAM,YAAW,mBAAmB;IACvF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAEnC,YACE,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,wBAA6B,EASvC;IAED,CAAC,qBAAqB,CAAC,IAAI,QAAQ,CAgBlC;CACF"}
|
|
@@ -2,16 +2,28 @@ import type { ConnectionReadContext } from './operation-limits.js';
|
|
|
2
2
|
/** Shared defaults for both connection kinds; phase overrides inherit these. */
|
|
3
3
|
export declare const DEFAULT_CONNECTION_TIMEOUT_MS = 30000;
|
|
4
4
|
export declare const DEFAULT_MAX_RESPONSE_BYTES: number;
|
|
5
|
+
/**
|
|
6
|
+
* MCP discovery's own defaults when nothing names a deadline: a catalog of a few hundred tools
|
|
7
|
+
* is hundreds of kilobytes, which a slow link delivers in minutes, so the bound that ends a dead
|
|
8
|
+
* discovery is silence, not length.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEFAULT_DISCOVERY_TIMEOUT_MS = 300000;
|
|
11
|
+
export declare const DEFAULT_DISCOVERY_IDLE_TIMEOUT_MS = 30000;
|
|
5
12
|
export declare function connectionTimeoutMs(value: number | undefined): number;
|
|
13
|
+
export declare function connectionIdleTimeoutMs(value: number | undefined): number | undefined;
|
|
14
|
+
/** Count bytes read for an operation; every chunk is progress for its idle deadline. */
|
|
15
|
+
export declare function recordConnectionRead(context: ConnectionReadContext, bytes: number): void;
|
|
6
16
|
export declare function connectionMaxResponseBytes(value: number | undefined): number;
|
|
7
17
|
/** Abort races also cover injected streams or promises that do not observe fetch's signal. */
|
|
8
18
|
export declare function awaitConnection<T>(pending: Promise<T>, signal: AbortSignal | undefined): Promise<T>;
|
|
9
19
|
/**
|
|
10
|
-
* One deadline spans negotiation, response waiting and all body reads
|
|
20
|
+
* One deadline spans negotiation, response waiting and all body reads; an optional idle
|
|
21
|
+
* deadline inside it ends the operation when nothing arrives for `idleTimeoutMs` — response
|
|
22
|
+
* headers and every body chunk restart it.
|
|
11
23
|
*
|
|
12
|
-
* `body` receives a copy of `context` that carries the deadline signal
|
|
13
|
-
* own context object is never changed and a context reused across operations
|
|
14
|
-
* stale signal. The copy is the one whose read counters a timeout reports.
|
|
24
|
+
* `body` receives a copy of `context` that carries the deadline signal and the progress hook,
|
|
25
|
+
* so the caller's own context object is never changed and a context reused across operations
|
|
26
|
+
* never holds a stale signal. The copy is the one whose read counters a timeout reports.
|
|
15
27
|
*/
|
|
16
28
|
export declare function withConnectionDeadline<T>(connectionName: string, context: ConnectionReadContext, callerSignal: AbortSignal | undefined, body: (scoped: ConnectionReadContext) => Promise<T>): Promise<T>;
|
|
17
29
|
/** Count raw bytes; Content-Length is deliberately not a trust boundary. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/limits.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,QAAS,CAAC;AACpD,eAAO,MAAM,0BAA0B,QAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/limits.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,QAAS,CAAC;AACpD,eAAO,MAAM,0BAA0B,QAAc,CAAC;AACtD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,iCAAiC,QAAS,CAAC;AAExD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMrE;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQrF;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAGxF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI5E;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,CAAC,EAC/B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,MAAM,EAAE,WAAW,GAAG,SAAS,GAC9B,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,qBAAqB,EAC9B,YAAY,EAAE,WAAW,GAAG,SAAS,EACrC,IAAI,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,CAAC,CAAC,CAuBZ;AAED,4EAA4E;AAC5E,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,gFAAgF;AAChF,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAejB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type McpCatalogStamp } from '../mcp/catalog-stamp.js';
|
|
1
2
|
import type { McpConnectionLimits } from './types.js';
|
|
2
3
|
/**
|
|
3
4
|
* Minimal MCP client over the raw wire, on the global `fetch` — no peer SDK.
|
|
@@ -16,8 +17,9 @@ export interface McpHttpClientOptions {
|
|
|
16
17
|
transport: McpTransportConfig;
|
|
17
18
|
/** The host fence built from the connection URL and its `allowHosts`. */
|
|
18
19
|
allowedHosts: ReadonlySet<string>;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
/** The connection's shared bounds as declared; phase defaults apply where they are unset. */
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
maxResponseBytes?: number;
|
|
21
23
|
limits?: McpConnectionLimits;
|
|
22
24
|
}
|
|
23
25
|
export declare class McpHttpClient {
|
|
@@ -31,8 +33,14 @@ export declare class McpHttpClient {
|
|
|
31
33
|
private initialized;
|
|
32
34
|
private initialInitializePending;
|
|
33
35
|
private sse;
|
|
36
|
+
private served;
|
|
34
37
|
private readonly limits;
|
|
35
38
|
constructor(connectionName: string, instanceId: string, options: McpHttpClientOptions);
|
|
39
|
+
/**
|
|
40
|
+
* The catalog stamp the server sent with its `initialize` answer, or `undefined` when it sent
|
|
41
|
+
* none — a server that does not stamp, or the legacy SSE transport.
|
|
42
|
+
*/
|
|
43
|
+
servedCatalog(): McpCatalogStamp | undefined;
|
|
36
44
|
/** Forget the session so the next call starts a fresh handshake. */
|
|
37
45
|
teardown(): void;
|
|
38
46
|
initialize(token: string | undefined, signal?: AbortSignal): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/mcp-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/mcp-client.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,sBAAsB,CAAC;AAoB9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;;;GAQG;AAEH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,yEAAyE;IACzE,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AASD,qBAAa,aAAa;IAYtB,OAAO,CAAC,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C;AAUlE,gEAAgE;AAChE,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,mBAAmB,EAC/B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,0BAA0B,GACpC,OAAO,CAAC,qBAAqB,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/mcp.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAIhF,OAAO,EACL,KAAK,0BAA0B,EAIhC,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,SAAS,CAAC;AAUlE,gEAAgE;AAChE,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,mBAAmB,EAC/B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,0BAA0B,GACpC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA+ElC"}
|
|
@@ -2,18 +2,29 @@ import type { ConnectionOperation, ConnectionPhase, McpConnectionLimits } from '
|
|
|
2
2
|
export interface ResolvedConnectionLimits {
|
|
3
3
|
timeoutMs: number;
|
|
4
4
|
maxResponseBytes: number;
|
|
5
|
+
/** Absent: no idle deadline, only `timeoutMs` ends the operation. */
|
|
6
|
+
idleTimeoutMs?: number;
|
|
5
7
|
}
|
|
6
8
|
export interface ConnectionReadContext extends ResolvedConnectionLimits {
|
|
7
9
|
operation: ConnectionOperation;
|
|
8
10
|
phase: ConnectionPhase;
|
|
9
11
|
observedReadBytes: number;
|
|
10
12
|
signal?: AbortSignal;
|
|
13
|
+
/** Progress for the idle deadline; set by `withConnectionDeadline`. */
|
|
14
|
+
touch?: () => void;
|
|
11
15
|
}
|
|
12
16
|
export interface McpPhaseLimits {
|
|
13
17
|
discovery: ResolvedConnectionLimits;
|
|
14
18
|
call: ResolvedConnectionLimits;
|
|
15
19
|
}
|
|
16
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Resolve and validate once at the connection boundary, including unused phases.
|
|
22
|
+
*
|
|
23
|
+
* A phase field wins, then the connection's shared field, then the phase default. Discovery
|
|
24
|
+
* with no declared `timeoutMs` defaults to a long total deadline and a 30-second idle one — a
|
|
25
|
+
* large catalog on a slow link keeps arriving — while a call keeps the shared 30 seconds and no
|
|
26
|
+
* idle deadline, because a tool may legitimately compute in silence before it answers.
|
|
27
|
+
*/
|
|
17
28
|
export declare function resolveMcpLimits(config: {
|
|
18
29
|
timeoutMs?: number;
|
|
19
30
|
maxResponseBytes?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-limits.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/operation-limits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operation-limits.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/operation-limits.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEzF,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,wBAAwB;IACrE,SAAS,EAAE,mBAAmB,CAAC;IAC/B,KAAK,EAAE,eAAe,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,wBAAwB,CAAC;IACpC,IAAI,EAAE,wBAAwB,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B,GAAG,cAAc,CA6BjB;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAUhE;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,mBAAmB,EAC9B,MAAM,EAAE,cAAc,GACrB,qBAAqB,CAUvB"}
|
|
@@ -4,8 +4,8 @@ interface SseSessionOptions {
|
|
|
4
4
|
baseUrl: string;
|
|
5
5
|
allowedHosts: ReadonlySet<string>;
|
|
6
6
|
headers: Record<string, string>;
|
|
7
|
-
timeoutMs
|
|
8
|
-
maxResponseBytes
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
maxResponseBytes?: number;
|
|
9
9
|
phaseLimits?: McpPhaseLimits;
|
|
10
10
|
initialContext?: ConnectionReadContext;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse-session.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/sse-session.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,cAAc,EAAU,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"sse-session.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/sse-session.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,cAAc,EAAU,MAAM,YAAY,CAAC;AASzD,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,cAAc,EAGpB,MAAM,oBAAoB,CAAC;AAI5B,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,cAAc,CAAC,EAAE,q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