@chrischall/mcp-utils 2.11.0 → 2.12.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/README.md +431 -12
- package/dist/concurrency/index.d.ts +3 -1
- package/dist/concurrency/index.d.ts.map +1 -1
- package/dist/concurrency/index.js +3 -1
- package/dist/concurrency/index.js.map +1 -1
- package/dist/concurrency/verify-after-write.d.ts +84 -0
- package/dist/concurrency/verify-after-write.d.ts.map +1 -0
- package/dist/concurrency/verify-after-write.js +108 -0
- package/dist/concurrency/verify-after-write.js.map +1 -0
- package/dist/errors/index.d.ts +35 -1
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +79 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/fetchproxy/fallback.d.ts +130 -0
- package/dist/fetchproxy/fallback.d.ts.map +1 -0
- package/dist/fetchproxy/fallback.js +199 -0
- package/dist/fetchproxy/fallback.js.map +1 -0
- package/dist/fetchproxy/index.d.ts +31 -1
- package/dist/fetchproxy/index.d.ts.map +1 -1
- package/dist/fetchproxy/index.js +120 -13
- package/dist/fetchproxy/index.js.map +1 -1
- package/dist/fs/confine.d.ts +9 -0
- package/dist/fs/confine.d.ts.map +1 -1
- package/dist/fs/confine.js +11 -2
- package/dist/fs/confine.js.map +1 -1
- package/dist/fs/index.d.ts +9 -2
- package/dist/fs/index.d.ts.map +1 -1
- package/dist/fs/index.js +13 -4
- package/dist/fs/index.js.map +1 -1
- package/dist/fs/magic.d.ts +35 -0
- package/dist/fs/magic.d.ts.map +1 -0
- package/dist/fs/magic.js +110 -0
- package/dist/fs/magic.js.map +1 -0
- package/dist/fs/output.d.ts +14 -10
- package/dist/fs/output.d.ts.map +1 -1
- package/dist/fs/output.js +21 -45
- package/dist/fs/output.js.map +1 -1
- package/dist/fs/upload-guard.d.ts +97 -0
- package/dist/fs/upload-guard.d.ts.map +1 -0
- package/dist/fs/upload-guard.js +185 -0
- package/dist/fs/upload-guard.js.map +1 -0
- package/dist/fs/write.d.ts +100 -0
- package/dist/fs/write.d.ts.map +1 -0
- package/dist/fs/write.js +207 -0
- package/dist/fs/write.js.map +1 -0
- package/dist/graphql/client.d.ts +223 -0
- package/dist/graphql/client.d.ts.map +1 -0
- package/dist/graphql/client.js +335 -0
- package/dist/graphql/client.js.map +1 -0
- package/dist/graphql/index.d.ts +20 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/index.js +20 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/graphql/operation-kind.d.ts +58 -0
- package/dist/graphql/operation-kind.d.ts.map +1 -0
- package/dist/graphql/operation-kind.js +237 -0
- package/dist/graphql/operation-kind.js.map +1 -0
- package/dist/html/index.d.ts +33 -0
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +81 -1
- package/dist/html/index.js.map +1 -1
- package/dist/http/index.d.ts +11 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +35 -7
- package/dist/http/index.js.map +1 -1
- package/dist/response/index.d.ts +1 -0
- package/dist/response/index.d.ts.map +1 -1
- package/dist/response/index.js +1 -0
- package/dist/response/index.js.map +1 -1
- package/dist/response/untrusted.d.ts +72 -0
- package/dist/response/untrusted.d.ts.map +1 -0
- package/dist/response/untrusted.js +55 -0
- package/dist/response/untrusted.js.map +1 -0
- package/dist/scrape/index.d.ts +75 -0
- package/dist/scrape/index.d.ts.map +1 -1
- package/dist/scrape/index.js +272 -0
- package/dist/scrape/index.js.map +1 -1
- package/dist/server/confirm-write.d.ts +152 -0
- package/dist/server/confirm-write.d.ts.map +1 -0
- package/dist/server/confirm-write.js +107 -0
- package/dist/server/confirm-write.js.map +1 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/session/atomic-write.d.ts +15 -0
- package/dist/session/atomic-write.d.ts.map +1 -0
- package/dist/session/atomic-write.js +42 -0
- package/dist/session/atomic-write.js.map +1 -0
- package/dist/session/file-lock.d.ts +57 -0
- package/dist/session/file-lock.d.ts.map +1 -0
- package/dist/session/file-lock.js +215 -0
- package/dist/session/file-lock.js.map +1 -0
- package/dist/session/index.d.ts +118 -2
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +200 -82
- package/dist/session/index.js.map +1 -1
- package/dist/session/login-page.d.ts +73 -0
- package/dist/session/login-page.d.ts.map +1 -0
- package/dist/session/login-page.js +143 -0
- package/dist/session/login-page.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Accepted is not confirmed": after a write that acts on the physical world
|
|
3
|
+
* (unlock a door, arm an alarm, start a car, set a charge limit) the upstream's
|
|
4
|
+
* 2xx says only that the command was queued. The proof is a re-read that shows
|
|
5
|
+
* the new state — and the device takes seconds, sometimes a minute, to report.
|
|
6
|
+
*
|
|
7
|
+
* kiaaccess-mcp (`KiaClient.verifyCommand`, the reference: abort-aware sleep,
|
|
8
|
+
* progress, a `cancelled` flag) and simplisafe-mcp (the lock poll and the alarm
|
|
9
|
+
* re-read) each hand-rolled this loop (fleet-audit#1176). simplisafe's lock poll
|
|
10
|
+
* slept with a bare `setTimeout` and never consulted the caller's cancellation,
|
|
11
|
+
* and nothing bounded a hung re-read (fleet-audit#1117) — so the shared loop
|
|
12
|
+
* makes both bounds structural:
|
|
13
|
+
*
|
|
14
|
+
* - **Deadline.** `timeoutMs` is a hard bound on the whole verification. Each
|
|
15
|
+
* read is handed an `AbortSignal` that fires at the deadline (pass it to
|
|
16
|
+
* `fetch`), and a wait that would end at or past the deadline is not started.
|
|
17
|
+
* - **Cancellation.** The caller's signal — by default the running tool call's
|
|
18
|
+
* ({@link currentCallSignal}) — ends a wait at once and is folded into the
|
|
19
|
+
* read's signal, so a client that cancelled stops being polled for.
|
|
20
|
+
* - **A failed re-read never throws.** The write already went out; reporting
|
|
21
|
+
* the read's failure as the command's would invite a retry of a door that is
|
|
22
|
+
* already open. It comes back as `outcome: 'read_failed'` with the `error`
|
|
23
|
+
* and the last good `snapshot`, for the caller to report as unverified.
|
|
24
|
+
*
|
|
25
|
+
* Progress is reported before each re-read through {@link reportProgress} (a
|
|
26
|
+
* no-op unless the client sent a progress token); a failing reporter is ignored.
|
|
27
|
+
*/
|
|
28
|
+
/** Options for {@link verifyAfterWrite}. */
|
|
29
|
+
export interface VerifyAfterWriteOptions<T> {
|
|
30
|
+
/** Read the current state. Pass `signal` on to the request so a hung read is bounded. */
|
|
31
|
+
read: (signal: AbortSignal) => Promise<T>;
|
|
32
|
+
/**
|
|
33
|
+
* Whether `snapshot` ends the wait — the requested state, OR a terminal one
|
|
34
|
+
* that will not change by waiting (simplisafe's `jammed`). Classify the final
|
|
35
|
+
* snapshot yourself; this only decides when to stop reading.
|
|
36
|
+
*/
|
|
37
|
+
isSettled: (snapshot: T) => boolean;
|
|
38
|
+
/** Hard bound on the whole verification, in ms. */
|
|
39
|
+
timeoutMs: number;
|
|
40
|
+
/** Delay between re-reads. Default 2 000 ms. */
|
|
41
|
+
intervalMs?: number;
|
|
42
|
+
/** Delay before the FIRST read (a device that cannot have moved yet). Default 0. */
|
|
43
|
+
initialDelayMs?: number;
|
|
44
|
+
/**
|
|
45
|
+
* The caller's own cancellation. ALWAYS combined with the running tool call's
|
|
46
|
+
* ({@link currentCallSignal}) — whichever aborts first stops the loop.
|
|
47
|
+
*/
|
|
48
|
+
signal?: AbortSignal;
|
|
49
|
+
/**
|
|
50
|
+
* Called before each re-read after the first. Defaults to {@link reportProgress}
|
|
51
|
+
* with "Waiting for the change to be confirmed (read N)". Errors are ignored.
|
|
52
|
+
*/
|
|
53
|
+
onProgress?: (info: {
|
|
54
|
+
attempt: number;
|
|
55
|
+
elapsedMs: number;
|
|
56
|
+
timeoutMs: number;
|
|
57
|
+
}) => void | Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/** What {@link verifyAfterWrite} observed. */
|
|
60
|
+
export interface VerifyAfterWriteResult<T> {
|
|
61
|
+
/**
|
|
62
|
+
* - `settled` — a read satisfied `isSettled`.
|
|
63
|
+
* - `timeout` — the deadline passed first.
|
|
64
|
+
* - `cancelled` — the caller's signal aborted.
|
|
65
|
+
* - `read_failed` — a read threw (not because of the deadline or the caller).
|
|
66
|
+
*/
|
|
67
|
+
outcome: 'settled' | 'timeout' | 'cancelled' | 'read_failed';
|
|
68
|
+
/** `outcome === 'settled'`. */
|
|
69
|
+
settled: boolean;
|
|
70
|
+
/** The last snapshot successfully read, or `undefined` when none was. */
|
|
71
|
+
snapshot: T | undefined;
|
|
72
|
+
/** Reads that returned a snapshot. */
|
|
73
|
+
attempts: number;
|
|
74
|
+
/** Milliseconds from the call to the answer, including any initial delay and waits. */
|
|
75
|
+
elapsedMs: number;
|
|
76
|
+
/** The read's error, for `read_failed`. */
|
|
77
|
+
error?: unknown;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* After a write, re-read until the observed state settles, the deadline passes,
|
|
81
|
+
* or the caller cancels — see the module notes for the bounds it guarantees.
|
|
82
|
+
*/
|
|
83
|
+
export declare function verifyAfterWrite<T>(opts: VerifyAfterWriteOptions<T>): Promise<VerifyAfterWriteResult<T>>;
|
|
84
|
+
//# sourceMappingURL=verify-after-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-after-write.d.ts","sourceRoot":"","sources":["../../src/concurrency/verify-after-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,yFAAyF;IACzF,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1C;;;;OAIG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,CAAC;IACpC,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxG;AAED,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC;;;;;OAKG;IACH,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;IAC7D,+BAA+B;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,yEAAyE;IACzE,QAAQ,EAAE,CAAC,GAAG,SAAS,CAAC;IACxB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAgBD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CA2D9G"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Accepted is not confirmed": after a write that acts on the physical world
|
|
3
|
+
* (unlock a door, arm an alarm, start a car, set a charge limit) the upstream's
|
|
4
|
+
* 2xx says only that the command was queued. The proof is a re-read that shows
|
|
5
|
+
* the new state — and the device takes seconds, sometimes a minute, to report.
|
|
6
|
+
*
|
|
7
|
+
* kiaaccess-mcp (`KiaClient.verifyCommand`, the reference: abort-aware sleep,
|
|
8
|
+
* progress, a `cancelled` flag) and simplisafe-mcp (the lock poll and the alarm
|
|
9
|
+
* re-read) each hand-rolled this loop (fleet-audit#1176). simplisafe's lock poll
|
|
10
|
+
* slept with a bare `setTimeout` and never consulted the caller's cancellation,
|
|
11
|
+
* and nothing bounded a hung re-read (fleet-audit#1117) — so the shared loop
|
|
12
|
+
* makes both bounds structural:
|
|
13
|
+
*
|
|
14
|
+
* - **Deadline.** `timeoutMs` is a hard bound on the whole verification. Each
|
|
15
|
+
* read is handed an `AbortSignal` that fires at the deadline (pass it to
|
|
16
|
+
* `fetch`), and a wait that would end at or past the deadline is not started.
|
|
17
|
+
* - **Cancellation.** The caller's signal — by default the running tool call's
|
|
18
|
+
* ({@link currentCallSignal}) — ends a wait at once and is folded into the
|
|
19
|
+
* read's signal, so a client that cancelled stops being polled for.
|
|
20
|
+
* - **A failed re-read never throws.** The write already went out; reporting
|
|
21
|
+
* the read's failure as the command's would invite a retry of a door that is
|
|
22
|
+
* already open. It comes back as `outcome: 'read_failed'` with the `error`
|
|
23
|
+
* and the last good `snapshot`, for the caller to report as unverified.
|
|
24
|
+
*
|
|
25
|
+
* Progress is reported before each re-read through {@link reportProgress} (a
|
|
26
|
+
* no-op unless the client sent a progress token); a failing reporter is ignored.
|
|
27
|
+
*/
|
|
28
|
+
import { reportProgress, withAmbientCancellation } from '../cancel/index.js';
|
|
29
|
+
/** Resolve after `ms`, or as soon as `signal` aborts. Never rejects. */
|
|
30
|
+
function wait(ms, signal) {
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
if (signal.aborted)
|
|
33
|
+
return resolve();
|
|
34
|
+
const done = () => {
|
|
35
|
+
clearTimeout(timer);
|
|
36
|
+
signal.removeEventListener('abort', done);
|
|
37
|
+
resolve();
|
|
38
|
+
};
|
|
39
|
+
const timer = setTimeout(done, ms);
|
|
40
|
+
signal.addEventListener('abort', done, { once: true });
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* After a write, re-read until the observed state settles, the deadline passes,
|
|
45
|
+
* or the caller cancels — see the module notes for the bounds it guarantees.
|
|
46
|
+
*/
|
|
47
|
+
export async function verifyAfterWrite(opts) {
|
|
48
|
+
const { read, isSettled, timeoutMs } = opts;
|
|
49
|
+
const intervalMs = opts.intervalMs ?? 2_000;
|
|
50
|
+
// Combined, never either-or: a caller's own signal must not switch off the
|
|
51
|
+
// tool call's cancellation (or vice versa) — the convention every other call
|
|
52
|
+
// site in this package follows.
|
|
53
|
+
const caller = withAmbientCancellation(opts.signal);
|
|
54
|
+
const onProgress = opts.onProgress ??
|
|
55
|
+
((p) => reportProgress(p.elapsedMs, p.timeoutMs, `Waiting for the change to be confirmed (read ${p.attempt})`));
|
|
56
|
+
const started = Date.now();
|
|
57
|
+
const deadline = new AbortController();
|
|
58
|
+
const timer = setTimeout(() => deadline.abort(new Error(`verification deadline of ${timeoutMs}ms passed`)), timeoutMs);
|
|
59
|
+
const signal = caller ? AbortSignal.any([deadline.signal, caller]) : deadline.signal;
|
|
60
|
+
let snapshot;
|
|
61
|
+
let attempts = 0;
|
|
62
|
+
const result = (outcome, error) => ({
|
|
63
|
+
outcome,
|
|
64
|
+
settled: outcome === 'settled',
|
|
65
|
+
snapshot,
|
|
66
|
+
attempts,
|
|
67
|
+
elapsedMs: Date.now() - started,
|
|
68
|
+
...(outcome === 'read_failed' ? { error } : {}),
|
|
69
|
+
});
|
|
70
|
+
/** Why the loop must stop now, if it must. The caller wins a tie with the deadline. */
|
|
71
|
+
const stopped = () => caller?.aborted ? 'cancelled' : deadline.signal.aborted ? 'timeout' : null;
|
|
72
|
+
try {
|
|
73
|
+
if (opts.initialDelayMs !== undefined && opts.initialDelayMs > 0) {
|
|
74
|
+
if (Date.now() - started + opts.initialDelayMs >= timeoutMs)
|
|
75
|
+
return result(stopped() ?? 'timeout');
|
|
76
|
+
await wait(opts.initialDelayMs, signal);
|
|
77
|
+
}
|
|
78
|
+
for (;;) {
|
|
79
|
+
const halt = stopped();
|
|
80
|
+
if (halt)
|
|
81
|
+
return result(halt);
|
|
82
|
+
if (attempts > 0) {
|
|
83
|
+
try {
|
|
84
|
+
await onProgress({ attempt: attempts + 1, elapsedMs: Date.now() - started, timeoutMs });
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
/* a failed progress notification must never cost the verification */
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
snapshot = await read(signal);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
return result(stopped() ?? 'read_failed', err);
|
|
95
|
+
}
|
|
96
|
+
attempts += 1;
|
|
97
|
+
if (isSettled(snapshot))
|
|
98
|
+
return result('settled');
|
|
99
|
+
if (Date.now() - started + intervalMs >= timeoutMs)
|
|
100
|
+
return result(stopped() ?? 'timeout');
|
|
101
|
+
await wait(intervalMs, signal);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=verify-after-write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-after-write.js","sourceRoot":"","sources":["../../src/concurrency/verify-after-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAmD7E,wEAAwE;AACxE,SAAS,IAAI,CAAC,EAAU,EAAE,MAAmB;IAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,MAAM,CAAC,OAAO;YAAE,OAAO,OAAO,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,GAAS,EAAE;YACtB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC1C,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,U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,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,MAAM,CAAC,OAAO,EAAE,IAAI,aAAa,EAAE,GAAG,CAAC,CAAC;YACjD,CAAC;YACD,QAAQ,IAAI,CAAC,CAAC;YACd,IAAI,SAAS,CAAC,QAAQ,CAAC;gBAAE,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,UAAU,IAAI,SAAS;gBAAE,OAAO,MAAM,CAAC,OAAO,EAAE,IAAI,SAAS,CAAC,CAAC;YAC1F,MAAM,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -78,7 +78,8 @@ export declare function createHelpfulError(message: string, opts?: {
|
|
|
78
78
|
* is surfaced to a client: `Bearer <token>` / `Authorization: Basic <…>` headers,
|
|
79
79
|
* `Cookie:` / `Set-Cookie:` header values (cookie names stay visible), standalone
|
|
80
80
|
* JWTs, well-known API-key shapes (OpenAI/Anthropic `sk-…`, GitHub `ghp_…`,
|
|
81
|
-
* Slack `xox?-…`, Google `AIza…`, AWS `AKIA…`, `whsec_…`),
|
|
81
|
+
* Slack `xox?-…`, Google `AIza…`, AWS `AKIA…`, `whsec_…`), Google OAuth2
|
|
82
|
+
* access/refresh tokens (`ya29.…` / `1//…`, never mid-base64), secret-bearing
|
|
82
83
|
* URL query params (`access_token`/`accessToken`, `api_key`, `token`, `key`,
|
|
83
84
|
* `sig`, `password`, …) and long OAuth `code=` values, echoed form passwords,
|
|
84
85
|
* `X-Api-Key`-style headers (also as JSON keys, like `"authorization"`), and quote-wrapped JSON secret values (`"refresh_token":"…"` /
|
|
@@ -112,6 +113,39 @@ export declare const ERROR_REDACTION_INPUT_MAX: number;
|
|
|
112
113
|
export declare function truncateErrorMessage(text: string, max?: number): string;
|
|
113
114
|
/** Extract a string message from any thrown value. */
|
|
114
115
|
export declare function messageOf(err: unknown): string;
|
|
116
|
+
/**
|
|
117
|
+
* Whether `err` DECLARES itself a timeout — the one predicate the fleet uses
|
|
118
|
+
* to decide "retry this row once" and "classify this row as `timeout`"
|
|
119
|
+
* (fleet-audit#1078: onehome-mcp's own `OneHomeRequestTimeoutError` was
|
|
120
|
+
* bucketed with "listing not found" because only fetchproxy's class counted).
|
|
121
|
+
*
|
|
122
|
+
* Duck-typed (no `instanceof`, so any package's class qualifies and this core
|
|
123
|
+
* module stays zero-dep). An error is a timeout when, on it or on a short
|
|
124
|
+
* `cause` chain (undici wraps socket errors in `TypeError('fetch failed')`):
|
|
125
|
+
*
|
|
126
|
+
* - its `name` is `TimeoutError` or ENDS in `TimeoutError` — covers
|
|
127
|
+
* `AbortSignal.timeout()`'s `DOMException`, mcp-utils' `RequestTimeoutError`,
|
|
128
|
+
* `@fetchproxy/server`'s `FetchproxyTimeoutError`, and any consumer class
|
|
129
|
+
* following the convention (e.g. `OneHomeRequestTimeoutError`);
|
|
130
|
+
* - it carries the documented marker **`timedOut: true`** — the way to opt a
|
|
131
|
+
* class in without renaming it (mcp-utils' `GraphqlTransportError` sets it);
|
|
132
|
+
* - its `code` is `ETIMEDOUT` or one of undici's `UND_ERR_*_TIMEOUT` codes.
|
|
133
|
+
*
|
|
134
|
+
* NOT a timeout, deliberately:
|
|
135
|
+
* - a caller CANCELLATION — a link named `AbortError`, because retrying
|
|
136
|
+
* something the user cancelled is wrong (and a bare `AbortError` cannot
|
|
137
|
+
* say whether a deadline caused it);
|
|
138
|
+
* - a link with an explicit `timedOut: false` (it has declared otherwise).
|
|
139
|
+
*
|
|
140
|
+
* The chain is read outside-in and the FIRST link that declares anything
|
|
141
|
+
* (timeout or not) decides, so a timeout class that wraps its own timer's
|
|
142
|
+
* `AbortError` as `cause` is still a timeout, and an `AbortError` is never
|
|
143
|
+
* promoted by what it wraps. Plain links in between are skipped. Also NOT a
|
|
144
|
+
* timeout:
|
|
145
|
+
* - an error that merely says "timed out" in its message — the message is
|
|
146
|
+
* upstream-controlled text, not a declaration.
|
|
147
|
+
*/
|
|
148
|
+
export declare function isTimeoutError(err: unknown): boolean;
|
|
115
149
|
/**
|
|
116
150
|
* Prepend the tool name to an error's context and return an {@link McpToolError},
|
|
117
151
|
* preserving any `hint` and chaining the original via `cause`. The message is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,qFAAqF;AACrF,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,qDAAqD;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,YAAY,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAMrE;CACF;AAED;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,YAAY;IAC5D,YAAY,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAShD;CACF;AAED;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,wEAAwE;IACxE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,YACE,IAAI,EAAE,MAAM,EACZ,iBAAiB,GAAE,MAAuC,EAC1D,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAY3B;CACF;AAED,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;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsBlD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAY,CAAC;AAEnD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAkC,GAAG,MAAM,CAMlG;AAED,sDAAsD;AACtD,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAG9C;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAapD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,YAAY,CAM1E;AAED,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,MAAM,CAK9E"}
|
package/dist/errors/index.js
CHANGED
|
@@ -160,6 +160,21 @@ const API_KEY_RE = new RegExp([
|
|
|
160
160
|
]
|
|
161
161
|
.map((p) => `\\b${p}`)
|
|
162
162
|
.join('|'), 'g');
|
|
163
|
+
// Google OAuth2 tokens: access tokens (`ya29.…`) and refresh tokens (`1//…`).
|
|
164
|
+
// Upstreamed from gogcli-mcp's local wrapper (fleet audit #1160). Neither
|
|
165
|
+
// shape has a fixed length, so each takes its documented prefix plus 8+
|
|
166
|
+
// token characters — real tokens run to 100+, while prose like `ya29.1` or
|
|
167
|
+
// a `1//2` ratio stays visible.
|
|
168
|
+
//
|
|
169
|
+
// LEFT BOUNDARY: a real token is never WELDED to base64 text — it follows a
|
|
170
|
+
// quote, whitespace, `=`, `:`, a bracket, or the start of the string — while
|
|
171
|
+
// `1//` occurs by chance inside roughly a third of large standard-base64
|
|
172
|
+
// blobs. So the token may not follow a standard-base64 character
|
|
173
|
+
// (`[A-Za-z0-9+/]`). The class is exactly that alphabet and no wider: adding
|
|
174
|
+
// `=` would lose the form-encoded `refresh_token=1//…` spelling, which the
|
|
175
|
+
// query-param rule only catches after a `?`/`&`. The literal prefixes keep
|
|
176
|
+
// match starts sparse, so the scan stays linear.
|
|
177
|
+
const GOOGLE_OAUTH_TOKEN_RE = /(?<![A-Za-z0-9+/])(?:ya29\.|1\/\/)[A-Za-z0-9._-]{8,}/g;
|
|
163
178
|
// Secret-bearing query params — the value after `=` up to `&`/`#`/quote/space/end.
|
|
164
179
|
// Anchored on `?`/`&` so plain prose like `key=primary` (no URL context) never
|
|
165
180
|
// matches; that constraint is what makes short names like `key`/`sig` safe.
|
|
@@ -270,7 +285,8 @@ function redactJsonCookie(quote) {
|
|
|
270
285
|
* is surfaced to a client: `Bearer <token>` / `Authorization: Basic <…>` headers,
|
|
271
286
|
* `Cookie:` / `Set-Cookie:` header values (cookie names stay visible), standalone
|
|
272
287
|
* JWTs, well-known API-key shapes (OpenAI/Anthropic `sk-…`, GitHub `ghp_…`,
|
|
273
|
-
* Slack `xox?-…`, Google `AIza…`, AWS `AKIA…`, `whsec_…`),
|
|
288
|
+
* Slack `xox?-…`, Google `AIza…`, AWS `AKIA…`, `whsec_…`), Google OAuth2
|
|
289
|
+
* access/refresh tokens (`ya29.…` / `1//…`, never mid-base64), secret-bearing
|
|
274
290
|
* URL query params (`access_token`/`accessToken`, `api_key`, `token`, `key`,
|
|
275
291
|
* `sig`, `password`, …) and long OAuth `code=` values, echoed form passwords,
|
|
276
292
|
* `X-Api-Key`-style headers (also as JSON keys, like `"authorization"`), and quote-wrapped JSON secret values (`"refresh_token":"…"` /
|
|
@@ -288,6 +304,7 @@ export function redactSecrets(text) {
|
|
|
288
304
|
.replace(SET_COOKIE_RE, '$1$2=[REDACTED]')
|
|
289
305
|
.replace(COOKIE_HEADER_RE, (_m, prefix, pairs) => `${prefix}${pairs.replace(/=[^;,\s]*/g, '=[REDACTED]')}`)
|
|
290
306
|
.replace(API_KEY_RE, '[REDACTED]')
|
|
307
|
+
.replace(GOOGLE_OAUTH_TOKEN_RE, '[REDACTED]')
|
|
291
308
|
.replace(HEADER_SECRET_RE, '$1[REDACTED]')
|
|
292
309
|
.replace(QUERY_SECRET_RE, '$1[REDACTED]')
|
|
293
310
|
.replace(OAUTH_CODE_RE, '$1[REDACTED]')
|
|
@@ -333,6 +350,67 @@ export function messageOf(err) {
|
|
|
333
350
|
return err.message;
|
|
334
351
|
return String(err);
|
|
335
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* `code` values that name a socket/transport-level timeout: Node's
|
|
355
|
+
* `ETIMEDOUT` and undici's connect / headers / body deadlines.
|
|
356
|
+
*/
|
|
357
|
+
const TIMEOUT_ERROR_CODES = new Set([
|
|
358
|
+
'ETIMEDOUT',
|
|
359
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
360
|
+
'UND_ERR_HEADERS_TIMEOUT',
|
|
361
|
+
'UND_ERR_BODY_TIMEOUT',
|
|
362
|
+
]);
|
|
363
|
+
/** How many `cause` links {@link isTimeoutError} follows (also bounds a cyclic chain). */
|
|
364
|
+
const TIMEOUT_CAUSE_DEPTH = 4;
|
|
365
|
+
/**
|
|
366
|
+
* Whether `err` DECLARES itself a timeout — the one predicate the fleet uses
|
|
367
|
+
* to decide "retry this row once" and "classify this row as `timeout`"
|
|
368
|
+
* (fleet-audit#1078: onehome-mcp's own `OneHomeRequestTimeoutError` was
|
|
369
|
+
* bucketed with "listing not found" because only fetchproxy's class counted).
|
|
370
|
+
*
|
|
371
|
+
* Duck-typed (no `instanceof`, so any package's class qualifies and this core
|
|
372
|
+
* module stays zero-dep). An error is a timeout when, on it or on a short
|
|
373
|
+
* `cause` chain (undici wraps socket errors in `TypeError('fetch failed')`):
|
|
374
|
+
*
|
|
375
|
+
* - its `name` is `TimeoutError` or ENDS in `TimeoutError` — covers
|
|
376
|
+
* `AbortSignal.timeout()`'s `DOMException`, mcp-utils' `RequestTimeoutError`,
|
|
377
|
+
* `@fetchproxy/server`'s `FetchproxyTimeoutError`, and any consumer class
|
|
378
|
+
* following the convention (e.g. `OneHomeRequestTimeoutError`);
|
|
379
|
+
* - it carries the documented marker **`timedOut: true`** — the way to opt a
|
|
380
|
+
* class in without renaming it (mcp-utils' `GraphqlTransportError` sets it);
|
|
381
|
+
* - its `code` is `ETIMEDOUT` or one of undici's `UND_ERR_*_TIMEOUT` codes.
|
|
382
|
+
*
|
|
383
|
+
* NOT a timeout, deliberately:
|
|
384
|
+
* - a caller CANCELLATION — a link named `AbortError`, because retrying
|
|
385
|
+
* something the user cancelled is wrong (and a bare `AbortError` cannot
|
|
386
|
+
* say whether a deadline caused it);
|
|
387
|
+
* - a link with an explicit `timedOut: false` (it has declared otherwise).
|
|
388
|
+
*
|
|
389
|
+
* The chain is read outside-in and the FIRST link that declares anything
|
|
390
|
+
* (timeout or not) decides, so a timeout class that wraps its own timer's
|
|
391
|
+
* `AbortError` as `cause` is still a timeout, and an `AbortError` is never
|
|
392
|
+
* promoted by what it wraps. Plain links in between are skipped. Also NOT a
|
|
393
|
+
* timeout:
|
|
394
|
+
* - an error that merely says "timed out" in its message — the message is
|
|
395
|
+
* upstream-controlled text, not a declaration.
|
|
396
|
+
*/
|
|
397
|
+
export function isTimeoutError(err) {
|
|
398
|
+
let cur = err;
|
|
399
|
+
for (let depth = 0; depth < TIMEOUT_CAUSE_DEPTH && cur !== null && typeof cur === 'object'; depth++) {
|
|
400
|
+
const e = cur;
|
|
401
|
+
const name = typeof e.name === 'string' ? e.name : '';
|
|
402
|
+
// The OUTERMOST link that says anything decides: a wrapper's own
|
|
403
|
+
// declaration outranks whatever it wraps.
|
|
404
|
+
if (name === 'AbortError' || e.timedOut === false)
|
|
405
|
+
return false;
|
|
406
|
+
if (name.endsWith('TimeoutError') || e.timedOut === true)
|
|
407
|
+
return true;
|
|
408
|
+
if (typeof e.code === 'string' && TIMEOUT_ERROR_CODES.has(e.code))
|
|
409
|
+
return true;
|
|
410
|
+
cur = e.cause;
|
|
411
|
+
}
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
336
414
|
/**
|
|
337
415
|
* Prepend the tool name to an error's context and return an {@link McpToolError},
|
|
338
416
|
* preserving any `hint` and chaining the original via `cause`. The message is
|
package/dist/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wEAAwE;AACxE,qFAAqF;AACrF,iFAAiF;AACjF,gFAAgF;AAChF,yBAAyB;AAEzB,qFAAqF;AACrF,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAEjD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,qDAAqD;IAC5C,IAAI,CAAU;IAEvB,YAAY,OAAe,EAAE,IAAyC;QACpE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,IAAI,EAAE,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACpD,8DAA8D;QAC9D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,YAAY;IAC5D,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,EAAE;IACpE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,MAAM,IAAI,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC;IAC5C,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { BridgeHealthcheckTransport } from './index.js';
|
|
2
|
+
/** Which leg a consumer is pinned to: `direct`, `fetchproxy`, or `auto` (direct with fallback). */
|
|
3
|
+
export type TransportMode = 'direct' | 'fetchproxy' | 'auto';
|
|
4
|
+
/** Options for {@link readTransportMode}. */
|
|
5
|
+
export interface ReadTransportModeOptions {
|
|
6
|
+
/** The mode when the variable is unset. Default `'auto'`. */
|
|
7
|
+
default?: TransportMode;
|
|
8
|
+
/** Env to read (tests). Default `process.env`. */
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
/** Where the unknown-value warning goes. Default `console.error` (stderr — stdout is the MCP pipe). */
|
|
11
|
+
log?: (message: string) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Read a `<PREFIX>_TRANSPORT` pin (`direct` / `fetchproxy` / `auto`),
|
|
15
|
+
* case-insensitively, through the hardened {@link readEnvVar} (so an
|
|
16
|
+
* unexpanded `${…}` placeholder reads as unset). An unknown value warns —
|
|
17
|
+
* naming the variable — and means the default, rather than failing the boot.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readTransportMode(envVar: string, opts?: ReadTransportModeOptions): TransportMode;
|
|
20
|
+
/**
|
|
21
|
+
* Which leg serves calls now, for {@link registerBridgeHealthcheckTool}'s
|
|
22
|
+
* `path` option (a type alias so it is assignable to `HealthcheckPath`).
|
|
23
|
+
* `blocked_by` names the edge vendor that forced the switch, when known.
|
|
24
|
+
*/
|
|
25
|
+
export type DirectFirstStatus = {
|
|
26
|
+
transport: 'direct' | 'fetchproxy';
|
|
27
|
+
mode: TransportMode;
|
|
28
|
+
blocked_by?: string;
|
|
29
|
+
};
|
|
30
|
+
/** Request counters for a {@link DirectFirstTransport}; a snapshot. */
|
|
31
|
+
export interface DirectFirstStats {
|
|
32
|
+
/** Calls attempted on each leg (a walled call counts once on each). */
|
|
33
|
+
requests: {
|
|
34
|
+
direct: number;
|
|
35
|
+
fetchproxy: number;
|
|
36
|
+
};
|
|
37
|
+
/** Of those, how many threw. A wall counts as a direct failure. */
|
|
38
|
+
failures: {
|
|
39
|
+
direct: number;
|
|
40
|
+
fetchproxy: number;
|
|
41
|
+
};
|
|
42
|
+
/** Direct failures judged to be an edge block. */
|
|
43
|
+
edge_blocks: number;
|
|
44
|
+
/** Epoch ms of the switch to the bridge, or `null` while still direct. */
|
|
45
|
+
switched_at: number | null;
|
|
46
|
+
}
|
|
47
|
+
/** What a {@link DirectFirstTransport.run} call is told about its attempt. */
|
|
48
|
+
export interface DirectFirstCallContext {
|
|
49
|
+
/** The leg this attempt rides. */
|
|
50
|
+
leg: 'direct' | 'fetchproxy';
|
|
51
|
+
/** The effective cancellation (caller's + ambient), to pass to `fetch`. */
|
|
52
|
+
signal: AbortSignal | undefined;
|
|
53
|
+
}
|
|
54
|
+
/** Options for {@link createDirectFirstTransport}. */
|
|
55
|
+
export interface DirectFirstTransportOptions<D, B> {
|
|
56
|
+
/** The direct leg (e.g. a plain-`fetch` transport). */
|
|
57
|
+
direct: D;
|
|
58
|
+
/**
|
|
59
|
+
* Build the bridge leg. Called lazily — on the first wall in `auto`, on
|
|
60
|
+
* first use in `fetchproxy` — and at most once once it succeeds.
|
|
61
|
+
*/
|
|
62
|
+
bridge: () => B;
|
|
63
|
+
/** Default `'auto'`. Typically `readTransportMode('<PREFIX>_TRANSPORT')`. */
|
|
64
|
+
mode?: TransportMode;
|
|
65
|
+
/** Log prefix for the switch notice, e.g. `'hemnet-mcp'`. */
|
|
66
|
+
serverName: string;
|
|
67
|
+
/** The site's host, named in the switch notice (`keep a <host> tab open`). */
|
|
68
|
+
hostLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Which direct failures mean "walled — use the bridge". Default: an edge
|
|
71
|
+
* block by the shared rule (an `EdgeBlockedError`, or a refusal page /
|
|
72
|
+
* `cf-mitigated` on the error).
|
|
73
|
+
*/
|
|
74
|
+
shouldFallBack?: (err: unknown) => boolean;
|
|
75
|
+
/** Replaces the default stderr notice when the switch happens. */
|
|
76
|
+
onFallback?: (info: {
|
|
77
|
+
error: unknown;
|
|
78
|
+
vendor: string | null;
|
|
79
|
+
}) => void;
|
|
80
|
+
/**
|
|
81
|
+
* The bridge's healthcheck slice (`runProbe` + `status`). Default: the
|
|
82
|
+
* bridge's own `bridgeTransport()` when it has one, else the bridge itself
|
|
83
|
+
* when it has `runProbe` and `status`.
|
|
84
|
+
*/
|
|
85
|
+
bridgeHealth?: (bridge: B) => BridgeHealthcheckTransport | undefined;
|
|
86
|
+
/** Where the default notice goes. Default `console.error`. */
|
|
87
|
+
log?: (message: string) => void;
|
|
88
|
+
}
|
|
89
|
+
/** The router {@link createDirectFirstTransport} returns. */
|
|
90
|
+
export interface DirectFirstTransport<D, B> {
|
|
91
|
+
/** The configured mode. */
|
|
92
|
+
readonly mode: TransportMode;
|
|
93
|
+
/**
|
|
94
|
+
* Run one call on the leg currently in charge, falling back as described
|
|
95
|
+
* in the module docs. `call` may run twice (direct, then bridge) — it must
|
|
96
|
+
* not have side effects outside the request it makes.
|
|
97
|
+
*/
|
|
98
|
+
run<R>(call: (leg: D | B, ctx: DirectFirstCallContext) => Promise<R>, opts?: {
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
}): Promise<R>;
|
|
101
|
+
/** Which leg the NEXT call rides, for the healthcheck's `path`. */
|
|
102
|
+
status(): DirectFirstStatus;
|
|
103
|
+
/**
|
|
104
|
+
* The bridge's healthcheck slice once a bridge exists (always available in
|
|
105
|
+
* `fetchproxy` mode); `undefined` while on direct.
|
|
106
|
+
*/
|
|
107
|
+
bridgeTransport(): BridgeHealthcheckTransport | undefined;
|
|
108
|
+
/** A snapshot of the request counters. */
|
|
109
|
+
stats(): DirectFirstStats;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Build a direct-first transport router. See the module docs for the
|
|
113
|
+
* behaviour; the consumer keeps its own leg types and wraps its one call:
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* const legs = createDirectFirstTransport({
|
|
117
|
+
* direct: new DirectTransport(opts),
|
|
118
|
+
* bridge: () => new HemnetFetchproxyTransport(opts),
|
|
119
|
+
* mode: readTransportMode('HEMNET_TRANSPORT'),
|
|
120
|
+
* serverName: 'hemnet-mcp',
|
|
121
|
+
* hostLabel: 'www.hemnet.se',
|
|
122
|
+
* });
|
|
123
|
+
* const transport: HemnetTransport = {
|
|
124
|
+
* graphql: (q, v) => legs.run((leg) => leg.graphql(q, v)),
|
|
125
|
+
* status: () => legs.status(),
|
|
126
|
+
* bridgeTransport: () => legs.bridgeTransport(),
|
|
127
|
+
* };
|
|
128
|
+
*/
|
|
129
|
+
export declare function createDirectFirstTransport<D, B = D>(opts: DirectFirstTransportOptions<D, B>): DirectFirstTransport<D, B>;
|
|
130
|
+
//# sourceMappingURL=fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["../../src/fetchproxy/fallback.ts"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE7D,mGAAmG;AACnG,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAI7D,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,6DAA6D;IAC7D,OAA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