ostacky 0.9.4 → 0.9.6
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 +27 -25
- package/assets/agents/ostacky.md +3 -3
- package/assets/commands/install-stack.md +2 -2
- package/assets/mcp/ostacky-controller/index.js +80 -19
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/{auth-CVhIKulL.d.mts → auth--n_Yzytt.d.cts} +14 -9
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/{auth-CVhIKulL.d.mts.map → auth--n_Yzytt.d.cts.map} +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/{auth-CfDMXiII.cjs → auth-4-zilcqg.cjs} +3 -2
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-4-zilcqg.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/{auth-CUe6YdwF.mjs → auth-CGP0BDVq.mjs} +3 -2
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CGP0BDVq.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/{auth-B2Q9_Vxp.d.cts → auth-YUQV3RRv.d.mts} +14 -9
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/{auth-B2Q9_Vxp.d.cts.map → auth-YUQV3RRv.d.mts.map} +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.cjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.d.cts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.d.mts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/index.mjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.cjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/internal.mjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/package.json +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/README.md +3 -3
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{ajvProvider-CplOkyLC.mjs → ajvProvider-CEoC__sr.mjs} +483 -38
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{ajvProvider-BdSo9BII.d.mts → ajvProvider-CgI-5L6O.d.mts} +25 -8
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{ajvProvider-BdSo9BII.d.mts.map → ajvProvider-CgI-5L6O.d.mts.map} +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{ajvProvider-B_4czhCS.d.cts → ajvProvider-FOQRM7up.d.cts} +24 -7
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{ajvProvider-B_4czhCS.d.cts.map → ajvProvider-FOQRM7up.d.cts.map} +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{ajvProvider-Brn-Q2J_.cjs → ajvProvider-ZaoO9afR.cjs} +483 -38
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{cfWorkerProvider-ojcZaap3.cjs → cfWorkerProvider-BwbPzsdI.cjs} +25 -15
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{cfWorkerProvider-BYRW5af5.d.mts → cfWorkerProvider-C03CSigr.d.mts} +21 -6
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{cfWorkerProvider-D9GAttn8.d.cts → cfWorkerProvider-doTkZbTr.d.cts} +20 -5
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{cfWorkerProvider-Bd-iTHAF.mjs → cfWorkerProvider-p3WaZPqB.mjs} +26 -15
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{createMcpHandler-DzBzpE4_.d.cts → createMcpHandler-BLVe3qmU.d.cts} +137 -32
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-BLVe3qmU.d.cts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{createMcpHandler-CEckaSEs.d.mts → createMcpHandler-Bt6U_Fqb.d.mts} +138 -33
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-Bt6U_Fqb.d.mts.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.cjs +209 -257
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.cts +45 -3
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.mts +46 -4
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.mjs +201 -252
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{mcp-DM1iHYFo.cjs → mcp-DUcCQSTW.cjs} +458 -35
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-DUcCQSTW.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{mcp-IJurDZVN.mjs → mcp-Dw2OlZ1f.mjs} +389 -32
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-Dw2OlZ1f.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +2 -2
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +2 -2
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{src-BX_fm-dB.cjs → src-CgFsfg3E.cjs} +161 -48
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-CgFsfg3E.cjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{src-D86MbS1I.mjs → src-D-y6h4N7.mjs} +161 -48
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D-y6h4N7.mjs.map +1 -0
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +30 -3
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +9 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +9 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +30 -3
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{types-mS0yxCL0.d.mts → types-DUs7mGBv.d.mts} +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/{types-mS0yxCL0.d.mts.map → types-DUs7mGBv.d.mts.map} +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +1 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/package.json +4 -4
- package/assets/mcp/ostacky-controller/package.json +1 -1
- package/assets/plugins/ostacky-controller/index.ts +43 -8
- package/dist/cli.js +130 -74
- package/manifest.json +29 -29
- package/package.json +7 -2
- package/assets/mcp/openspec/bun.lock +0 -20
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-Brn-Q2J_.cjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CplOkyLC.mjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BYRW5af5.d.mts.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-Bd-iTHAF.mjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-D9GAttn8.d.cts.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-ojcZaap3.cjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CEckaSEs.d.mts.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-DzBzpE4_.d.cts.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-DM1iHYFo.cjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/mcp-IJurDZVN.mjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-BX_fm-dB.cjs.map +0 -1
- package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/src-D86MbS1I.mjs.map +0 -1
package/assets/mcp/ostacky-controller/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-Bnu9O96Y.cjs');
|
|
2
|
-
const require_ajvProvider = require('./ajvProvider-
|
|
2
|
+
const require_ajvProvider = require('./ajvProvider-ZaoO9afR.cjs');
|
|
3
3
|
let node_process = require("node:process");
|
|
4
4
|
node_process = require_chunk.__toESM(node_process);
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_src = require('./src-
|
|
2
|
-
const require_cfWorkerProvider = require('./cfWorkerProvider-
|
|
1
|
+
const require_src = require('./src-CgFsfg3E.cjs');
|
|
2
|
+
const require_cfWorkerProvider = require('./cfWorkerProvider-BwbPzsdI.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/shimsWorkerd.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as preloadSchemas } from "./src-
|
|
2
|
-
import { t as CfWorkerJsonSchemaValidator } from "./cfWorkerProvider-
|
|
1
|
+
import { n as preloadSchemas } from "./src-D-y6h4N7.mjs";
|
|
2
|
+
import { t as CfWorkerJsonSchemaValidator } from "./cfWorkerProvider-p3WaZPqB.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/shimsWorkerd.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-Bnu9O96Y.cjs');
|
|
2
|
+
const require_dialects = require('./dialects-D8eXzoGv.cjs');
|
|
2
3
|
let _modelcontextprotocol_core_internal = require("@modelcontextprotocol/core/internal");
|
|
3
4
|
let zod_v4 = require("zod/v4");
|
|
4
5
|
zod_v4 = require_chunk.__toESM(zod_v4);
|
|
@@ -176,6 +177,16 @@ let OAuthErrorCode = /* @__PURE__ */ function(OAuthErrorCode$1) {
|
|
|
176
177
|
* The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
|
|
177
178
|
*/
|
|
178
179
|
OAuthErrorCode$1["InvalidTarget"] = "invalid_target";
|
|
180
|
+
/**
|
|
181
|
+
* The DPoP proof accompanying the request is invalid, or does not match the key the grant
|
|
182
|
+
* (e.g. a refresh token) is bound to. (RFC 9449 §5 / §7.1)
|
|
183
|
+
*/
|
|
184
|
+
OAuthErrorCode$1["InvalidDpopProof"] = "invalid_dpop_proof";
|
|
185
|
+
/**
|
|
186
|
+
* The server requires a server-supplied nonce in the DPoP proof; retry with the `DPoP-Nonce`
|
|
187
|
+
* it returned. (RFC 9449 §8 / §9)
|
|
188
|
+
*/
|
|
189
|
+
OAuthErrorCode$1["UseDpopNonce"] = "use_dpop_nonce";
|
|
179
190
|
return OAuthErrorCode$1;
|
|
180
191
|
}({});
|
|
181
192
|
/**
|
|
@@ -289,14 +300,32 @@ let SdkErrorCode = /* @__PURE__ */ function(SdkErrorCode$1) {
|
|
|
289
300
|
/**
|
|
290
301
|
* Protocol-era negotiation at connect time failed without producing either a
|
|
291
302
|
* usable modern (2026-07-28+) era or a definitive legacy fallback signal —
|
|
292
|
-
* e.g. the negotiation mode forbids falling back (`pin`),
|
|
293
|
-
* network failure
|
|
303
|
+
* e.g. the negotiation mode forbids falling back (`pin`), the probe hit a
|
|
304
|
+
* network failure, or the server answered the probe with a 5xx (a typed
|
|
305
|
+
* connect error, never an era verdict).
|
|
294
306
|
*
|
|
295
|
-
* Negotiation-phase only: this code is never used once an era is
|
|
307
|
+
* Negotiation-phase only: this code is never used once an era is
|
|
308
|
+
* established. Auth walls never carry it: a 401/403 rejecting the probe
|
|
309
|
+
* uses {@linkcode ClientHttpAuthentication} / {@linkcode ClientHttpForbidden}
|
|
310
|
+
* instead, so era-recovery flows keyed on this code (e.g. cached-verdict
|
|
311
|
+
* gateways) can never persist a verdict for an unauthorized exchange.
|
|
296
312
|
*/
|
|
297
313
|
SdkErrorCode$1["EraNegotiationFailed"] = "ERA_NEGOTIATION_FAILED";
|
|
298
314
|
SdkErrorCode$1["ClientHttpNotImplemented"] = "CLIENT_HTTP_NOT_IMPLEMENTED";
|
|
315
|
+
/**
|
|
316
|
+
* HTTP 401 authentication failure: the transport's re-auth retry still got
|
|
317
|
+
* 401 (`Server returned 401 after re-authentication`), or the version
|
|
318
|
+
* negotiation probe was rejected 401 with no `authProvider` configured
|
|
319
|
+
* (`Version negotiation failed: the server requires authorization (HTTP 401)`).
|
|
320
|
+
* Carried on an {@linkcode SdkHttpError} with `status: 401`.
|
|
321
|
+
*/
|
|
299
322
|
SdkErrorCode$1["ClientHttpAuthentication"] = "CLIENT_HTTP_AUTHENTICATION";
|
|
323
|
+
/**
|
|
324
|
+
* HTTP 403 denial: the step-up re-authorization retry limit was reached,
|
|
325
|
+
* or the version negotiation probe was rejected 403
|
|
326
|
+
* (`Version negotiation failed: the server denied access (HTTP 403)`).
|
|
327
|
+
* Carried on an {@linkcode SdkHttpError} with `status: 403`.
|
|
328
|
+
*/
|
|
300
329
|
SdkErrorCode$1["ClientHttpForbidden"] = "CLIENT_HTTP_FORBIDDEN";
|
|
301
330
|
SdkErrorCode$1["ClientHttpUnexpectedContent"] = "CLIENT_HTTP_UNEXPECTED_CONTENT";
|
|
302
331
|
SdkErrorCode$1["ClientHttpFailedToOpenStream"] = "CLIENT_HTTP_FAILED_TO_OPEN_STREAM";
|
|
@@ -341,8 +370,18 @@ var SdkError = class extends Error {
|
|
|
341
370
|
if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
|
|
342
371
|
return brandedHasInstance(this, value);
|
|
343
372
|
}
|
|
344
|
-
|
|
345
|
-
|
|
373
|
+
/**
|
|
374
|
+
* @param code - Stable string code identifying the failure ({@linkcode SdkErrorCode}).
|
|
375
|
+
* @param message - Human-readable description.
|
|
376
|
+
* @param data - Optional structured payload (for example the HTTP status carried by
|
|
377
|
+
* {@linkcode SdkHttpError}). Opaque to the SDK: a `cause` key inside `data` is not
|
|
378
|
+
* promoted to `Error.cause`.
|
|
379
|
+
* @param options - Standard `ErrorOptions`, forwarded to `Error`. Pass the underlying
|
|
380
|
+
* failure as `{ cause }` so it is reachable through the `Error.cause` chain that
|
|
381
|
+
* loggers and error trackers walk.
|
|
382
|
+
*/
|
|
383
|
+
constructor(code, message, data, options) {
|
|
384
|
+
super(message, options);
|
|
346
385
|
this.code = code;
|
|
347
386
|
this.data = data;
|
|
348
387
|
this.name = "SdkError";
|
|
@@ -369,8 +408,11 @@ var SdkHttpError = class extends SdkError {
|
|
|
369
408
|
static {
|
|
370
409
|
Object.defineProperty(this, "mcpBrand", { value: "mcp.SdkHttpError" });
|
|
371
410
|
}
|
|
372
|
-
|
|
373
|
-
|
|
411
|
+
/**
|
|
412
|
+
* @param options - Standard `ErrorOptions`, forwarded to `Error` (see {@linkcode SdkError}).
|
|
413
|
+
*/
|
|
414
|
+
constructor(code, message, data, options) {
|
|
415
|
+
super(code, message, data, options);
|
|
374
416
|
this.name = "SdkHttpError";
|
|
375
417
|
}
|
|
376
418
|
get status() {
|
|
@@ -2080,9 +2122,19 @@ const REF_REWRITE_NAME_MAP_KEYS = new Set([
|
|
|
2080
2122
|
"patternProperties",
|
|
2081
2123
|
"$defs",
|
|
2082
2124
|
"definitions",
|
|
2083
|
-
"dependentSchemas"
|
|
2125
|
+
"dependentSchemas",
|
|
2126
|
+
"dependencies"
|
|
2084
2127
|
]);
|
|
2085
2128
|
/**
|
|
2129
|
+
* Whether a subtree's `$id` establishes a new resolution base. A fragment-only
|
|
2130
|
+
* `$id` (`"#item"`, the draft-07/06 spelling of 2020-12's `$anchor`) does not
|
|
2131
|
+
* change the RFC 3986 base URI — same-document pointers inside still resolve
|
|
2132
|
+
* against the document root and must be rewritten.
|
|
2133
|
+
*/
|
|
2134
|
+
function establishesNewBase(id) {
|
|
2135
|
+
return id !== void 0 && !(typeof id === "string" && id.startsWith("#"));
|
|
2136
|
+
}
|
|
2137
|
+
/**
|
|
2086
2138
|
* Wrap a non-object output schema in the 2025-era envelope:
|
|
2087
2139
|
* `{type:'object', properties:{result:<natural>}, required:['result']}`.
|
|
2088
2140
|
*
|
|
@@ -2095,31 +2147,37 @@ const REF_REWRITE_NAME_MAP_KEYS = new Set([
|
|
|
2095
2147
|
* The rewrite is position-aware: data-valued keywords
|
|
2096
2148
|
* (`const`/`enum`/`default`/`examples`) in keyword position are NOT descended
|
|
2097
2149
|
* into; the same names appearing as property names under
|
|
2098
|
-
* `properties`/`patternProperties`/`$defs`/`definitions`/`dependentSchemas
|
|
2099
|
-
* ARE descended into (they're subschemas). The rewrite is also
|
|
2100
|
-
* if the natural root carries `$id` no
|
|
2101
|
-
* refs inside resolve against the embedded
|
|
2102
|
-
* and any subtree that establishes its own
|
|
2103
|
-
* same reason.
|
|
2150
|
+
* `properties`/`patternProperties`/`$defs`/`definitions`/`dependentSchemas`/
|
|
2151
|
+
* `dependencies` ARE descended into (they're subschemas). The rewrite is also
|
|
2152
|
+
* `$id`-scoped: if the natural root carries a base-establishing `$id` no
|
|
2153
|
+
* pointer is rewritten (same-document refs inside resolve against the embedded
|
|
2154
|
+
* `$id` base, not the wrapper root), and any subtree that establishes its own
|
|
2155
|
+
* `$id` is left untouched for the same reason. Fragment-only `$id` (`"#item"`,
|
|
2156
|
+
* draft-07's anchor spelling) does not establish a base and IS descended into.
|
|
2104
2157
|
*/
|
|
2105
2158
|
function wrapOutputSchemaForLegacy(natural) {
|
|
2106
2159
|
const $schema = typeof natural["$schema"] === "string" ? natural["$schema"] : void 0;
|
|
2107
|
-
if (natural["$id"]
|
|
2160
|
+
if (establishesNewBase(natural["$id"])) return {
|
|
2108
2161
|
...$schema !== void 0 && { $schema },
|
|
2109
2162
|
type: "object",
|
|
2110
2163
|
properties: { result: natural },
|
|
2111
2164
|
required: ["result"]
|
|
2112
2165
|
};
|
|
2166
|
+
const convertRecursiveRefs = require_dialects.declares2019Dialect(natural["$schema"]) && natural["$recursiveAnchor"] !== true;
|
|
2113
2167
|
const rewriteRefs = (node, parentIsNameMap) => {
|
|
2114
2168
|
if (Array.isArray(node)) return node.map((item) => rewriteRefs(item, false));
|
|
2115
2169
|
if (node === null || typeof node !== "object") return node;
|
|
2116
|
-
if (!parentIsNameMap && node["$id"]
|
|
2170
|
+
if (!parentIsNameMap && establishesNewBase(node["$id"])) return node;
|
|
2117
2171
|
const out = {};
|
|
2172
|
+
let convertedRecursion = false;
|
|
2118
2173
|
for (const [k, v] of Object.entries(node)) if (parentIsNameMap) out[k] = rewriteRefs(v, false);
|
|
2119
2174
|
else if ((k === "$ref" || k === "$dynamicRef") && typeof v === "string") out[k] = v === "#" ? "#/properties/result" : v.startsWith("#/") ? `#/properties/result${v.slice(1)}` : v;
|
|
2175
|
+
else if (k === "$recursiveRef" && v === "#" && convertRecursiveRefs) convertedRecursion = true;
|
|
2120
2176
|
else if (REF_REWRITE_DATA_POSITION_KEYS.has(k)) out[k] = v;
|
|
2121
2177
|
else if (REF_REWRITE_NAME_MAP_KEYS.has(k)) out[k] = rewriteRefs(v, true);
|
|
2122
2178
|
else out[k] = rewriteRefs(v, false);
|
|
2179
|
+
if (convertedRecursion) if ("$ref" in out) out["allOf"] = [...Array.isArray(out["allOf"]) ? out["allOf"] : [], { $ref: "#/properties/result" }];
|
|
2180
|
+
else out["$ref"] = "#/properties/result";
|
|
2123
2181
|
return out;
|
|
2124
2182
|
};
|
|
2125
2183
|
return {
|
|
@@ -4736,9 +4794,15 @@ function paramHeaderMismatchRejection(cell, header, body) {
|
|
|
4736
4794
|
* named revision belongs to (a malformed envelope behind a present claim is
|
|
4737
4795
|
* a validation error, never a silent fall back to legacy handling).
|
|
4738
4796
|
* - A request without a claim is legacy-era traffic.
|
|
4739
|
-
* - The `MCP-Protocol-Version` header is a cross-check only
|
|
4740
|
-
* upgrades or downgrades a body-derived
|
|
4741
|
-
* between header and body is an explicit
|
|
4797
|
+
* - The `MCP-Protocol-Version` header is a cross-check only *for
|
|
4798
|
+
* classification*: it never upgrades or downgrades a body-derived
|
|
4799
|
+
* classification, and a disagreement between header and body is an explicit
|
|
4800
|
+
* ladder outcome. Its absence likewise never changes the era — but the spec
|
|
4801
|
+
* requires the header on every modern *request* POST, so a
|
|
4802
|
+
* modern-classified request that omits it is refused one rung later, by
|
|
4803
|
+
* {@linkcode validateStandardRequestHeaders}, not here. Notification POSTs
|
|
4804
|
+
* are exempt (see the next bullet), and that rung enforces presence on
|
|
4805
|
+
* requests only.
|
|
4742
4806
|
* - Notifications carry no envelope claim of their own under the current
|
|
4743
4807
|
* spec, so for notification POSTs without a body claim the modern header is
|
|
4744
4808
|
* determinative; the `Mcp-Method` header is validated against the body when
|
|
@@ -4866,7 +4930,7 @@ const INBOUND_VALIDATION_LADDER = [
|
|
|
4866
4930
|
evaluatedAt: "pre-dispatch",
|
|
4867
4931
|
codes: [HEADER_MISMATCH_ERROR_CODE],
|
|
4868
4932
|
conformance: ["http-header-validation"],
|
|
4869
|
-
rationale: "SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."
|
|
4933
|
+
rationale: "SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half — including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."
|
|
4870
4934
|
},
|
|
4871
4935
|
{
|
|
4872
4936
|
rung: "client-capabilities",
|
|
@@ -4949,15 +5013,51 @@ function crossCheckMismatch(cell, header, body, rung = "era-classification") {
|
|
|
4949
5013
|
} }), true);
|
|
4950
5014
|
}
|
|
4951
5015
|
/**
|
|
4952
|
-
* The methods whose body carries a `params.name` / `params.uri`
|
|
4953
|
-
* `Mcp-Name` header must mirror, and which body
|
|
4954
|
-
*
|
|
5016
|
+
* The methods whose body carries a `params.name` / `params.uri` /
|
|
5017
|
+
* `params.taskId` value the `Mcp-Name` header must mirror, and which body
|
|
5018
|
+
* field supplies it. The core rows come from SEP-2243 § Standard Request
|
|
5019
|
+
* Headers (`Required For` column); the `tasks/*` rows come from SEP-2663's
|
|
5020
|
+
* Streamable HTTP binding ("the client MUST set the `Mcp-Name` header to the
|
|
5021
|
+
* value of `params.taskId`" for `tasks/get` / `tasks/update` /
|
|
5022
|
+
* `tasks/cancel`, so intermediaries can route every request for a task to the
|
|
5023
|
+
* instance holding its state). Shared by the client transport (header
|
|
5024
|
+
* emission) and the server ladder (validation) so both sides derive from one
|
|
5025
|
+
* table.
|
|
4955
5026
|
*/
|
|
4956
5027
|
const MCP_NAME_HEADER_SOURCE = {
|
|
4957
5028
|
"tools/call": "name",
|
|
4958
5029
|
"prompts/get": "name",
|
|
4959
|
-
"resources/read": "uri"
|
|
5030
|
+
"resources/read": "uri",
|
|
5031
|
+
"tasks/get": "taskId",
|
|
5032
|
+
"tasks/update": "taskId",
|
|
5033
|
+
"tasks/cancel": "taskId"
|
|
4960
5034
|
};
|
|
5035
|
+
/**
|
|
5036
|
+
* Resolve the `Mcp-Name` source for one request against
|
|
5037
|
+
* {@linkcode MCP_NAME_HEADER_SOURCE}: which body field the header mirrors for
|
|
5038
|
+
* `method`, and the string value that field carries in `params`.
|
|
5039
|
+
*
|
|
5040
|
+
* Returns `undefined` when `method` is off-table (no `Mcp-Name` is emitted or
|
|
5041
|
+
* required). Otherwise `value` is the field's string value, or `undefined`
|
|
5042
|
+
* when `params` is not a plain object or the field is absent / not a string —
|
|
5043
|
+
* the client emits no header then, and the server leaves that body to the
|
|
5044
|
+
* rungs further down the ladder.
|
|
5045
|
+
*
|
|
5046
|
+
* `method` is peer-supplied on the server and caller-supplied on the client,
|
|
5047
|
+
* so the table lookup is `Object.hasOwn`-guarded against `Object.prototype`
|
|
5048
|
+
* collisions (`constructor`, `toString`, …). Shared by the client transport
|
|
5049
|
+
* (emission) and {@linkcode validateStandardRequestHeaders} (validation) so
|
|
5050
|
+
* the extraction — not just the table — cannot drift between the two sides.
|
|
5051
|
+
*/
|
|
5052
|
+
function mcpNameSource(method, params) {
|
|
5053
|
+
const field = Object.hasOwn(MCP_NAME_HEADER_SOURCE, method) ? MCP_NAME_HEADER_SOURCE[method] : void 0;
|
|
5054
|
+
if (field === void 0) return;
|
|
5055
|
+
const raw = isPlainObject$2(params) ? params[field] : void 0;
|
|
5056
|
+
return {
|
|
5057
|
+
field,
|
|
5058
|
+
value: typeof raw === "string" ? raw : void 0
|
|
5059
|
+
};
|
|
5060
|
+
}
|
|
4961
5061
|
/** Strip RFC 9110 optional whitespace (SP / HTAB) around a field value in linear time. */
|
|
4962
5062
|
function stripHttpOws(value) {
|
|
4963
5063
|
let start = 0;
|
|
@@ -4985,13 +5085,19 @@ function stripHttpOws(value) {
|
|
|
4985
5085
|
* `era-classification` rung for the `MCP-Protocol-Version` and
|
|
4986
5086
|
* `Mcp-Method` *mismatch* cells) when:
|
|
4987
5087
|
*
|
|
5088
|
+
* - the required `MCP-Protocol-Version` header is absent (SEP-2243 requires it
|
|
5089
|
+
* on every modern *request* POST, and lists it first among the required
|
|
5090
|
+
* standard headers — so a request missing it *and* `Mcp-Method` is answered
|
|
5091
|
+
* by this cell);
|
|
4988
5092
|
* - the required `Mcp-Method` header is absent;
|
|
4989
5093
|
* - the required `Mcp-Name` header is absent on a `tools/call`,
|
|
4990
|
-
* `prompts/get`,
|
|
4991
|
-
* `
|
|
5094
|
+
* `prompts/get`, `resources/read`, or (per SEP-2663's Streamable HTTP
|
|
5095
|
+
* binding) `tasks/get` / `tasks/update` / `tasks/cancel` request whose
|
|
5096
|
+
* body carries the `params.name` / `params.uri` / `params.taskId` value
|
|
5097
|
+
* the header mirrors;
|
|
4992
5098
|
* - the `Mcp-Name` header carries an invalid `=?base64?…?=` sentinel; or
|
|
4993
5099
|
* - the (decoded) `Mcp-Name` value disagrees with the body's
|
|
4994
|
-
* `params.name` / `params.uri`.
|
|
5100
|
+
* `params.name` / `params.uri` / `params.taskId`.
|
|
4995
5101
|
*
|
|
4996
5102
|
* Returns `undefined` (pass) for notifications (the spec table reads
|
|
4997
5103
|
* "All requests"), for methods that have no `Mcp-Name` source, and when the
|
|
@@ -5002,16 +5108,22 @@ function stripHttpOws(value) {
|
|
|
5002
5108
|
* call to the classifier (no headers passed) keeps routing a modern request
|
|
5003
5109
|
* unchanged: the classifier remains a pure body-primary router, and this
|
|
5004
5110
|
* function is the presence/`Mcp-Name` half of the standard-header rung the
|
|
5005
|
-
* entry layers on top.
|
|
5111
|
+
* entry layers on top. That separation is what lets the missing
|
|
5112
|
+
* `MCP-Protocol-Version` cell live here without disturbing the body-primary
|
|
5113
|
+
* rule — classification still resolves from the body (a proxy stripping the
|
|
5114
|
+
* header must not change the era), and only this rung refuses to serve it.
|
|
5006
5115
|
*/
|
|
5007
5116
|
function validateStandardRequestHeaders(request, route) {
|
|
5008
5117
|
if (route.messageKind !== "request") return;
|
|
5009
5118
|
const method = route.message.method;
|
|
5119
|
+
if (request.protocolVersionHeader === void 0) {
|
|
5120
|
+
const claimed = route.classification.revision;
|
|
5121
|
+
return crossCheckMismatch("version-header-missing", "(missing)", claimed === void 0 ? "the body carries a modern per-request envelope but the required MCP-Protocol-Version header is absent" : `the body envelope names protocol version ${claimed} but the required MCP-Protocol-Version header is absent`, "standard-header-validation");
|
|
5122
|
+
}
|
|
5010
5123
|
if (request.mcpMethodHeader === void 0) return crossCheckMismatch("method-header-missing", "(missing)", `the body names method ${method} but the required Mcp-Method header is absent`, "standard-header-validation");
|
|
5011
|
-
const
|
|
5012
|
-
if (
|
|
5013
|
-
const
|
|
5014
|
-
const bodyValue = typeof sourceValue === "string" ? sourceValue : void 0;
|
|
5124
|
+
const source = mcpNameSource(method, route.message.params);
|
|
5125
|
+
if (source === void 0) return;
|
|
5126
|
+
const { field: sourceField, value: bodyValue } = source;
|
|
5015
5127
|
if (request.mcpNameHeader === void 0) {
|
|
5016
5128
|
if (bodyValue === void 0) return;
|
|
5017
5129
|
return crossCheckMismatch("name-header-missing", "(missing)", `the body carries params.${sourceField}="${bodyValue}" but the required Mcp-Name header is absent`, "standard-header-validation");
|
|
@@ -6213,7 +6325,7 @@ var Protocol = class {
|
|
|
6213
6325
|
return this._requestHandlers.get(method);
|
|
6214
6326
|
}
|
|
6215
6327
|
async _oncancel(notification) {
|
|
6216
|
-
if (
|
|
6328
|
+
if (notification.params.requestId === void 0) return;
|
|
6217
6329
|
this._requestHandlerAbortControllers.get(notification.params.requestId)?.abort(notification.params.reason);
|
|
6218
6330
|
}
|
|
6219
6331
|
_setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
|
|
@@ -6612,19 +6724,20 @@ var Protocol = class {
|
|
|
6612
6724
|
const cancel = (reason) => {
|
|
6613
6725
|
if (responseReceived) return;
|
|
6614
6726
|
this._progressHandlers.delete(messageId);
|
|
6615
|
-
if (requestAbort === void 0)
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6727
|
+
if (requestAbort === void 0) {
|
|
6728
|
+
if (request.method !== "initialize") this._transport?.send(this._envelopeOutbound({
|
|
6729
|
+
jsonrpc: "2.0",
|
|
6730
|
+
method: "notifications/cancelled",
|
|
6731
|
+
params: {
|
|
6732
|
+
requestId: messageId,
|
|
6733
|
+
reason: String(reason)
|
|
6734
|
+
}
|
|
6735
|
+
}), {
|
|
6736
|
+
relatedRequestId,
|
|
6737
|
+
resumptionToken,
|
|
6738
|
+
onresumptiontoken
|
|
6739
|
+
}).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send cancellation: ${error}`)));
|
|
6740
|
+
} else requestAbort.abort();
|
|
6628
6741
|
reject(reason instanceof SdkError ? reason : new SdkError(SdkErrorCode.RequestTimeout, String(reason)));
|
|
6629
6742
|
};
|
|
6630
6743
|
this._responseHandlers.set(messageId, (response) => {
|
|
@@ -6704,7 +6817,7 @@ var Protocol = class {
|
|
|
6704
6817
|
jsonrpc: "2.0",
|
|
6705
6818
|
...notification
|
|
6706
6819
|
});
|
|
6707
|
-
if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params &&
|
|
6820
|
+
if ((this._options?.debouncedNotificationMethods ?? []).includes(notification.method) && !notification.params && options?.relatedRequestId === void 0) {
|
|
6708
6821
|
if (this._pendingDebouncedNotifications.has(notification.method)) return;
|
|
6709
6822
|
this._pendingDebouncedNotifications.add(notification.method);
|
|
6710
6823
|
Promise.resolve().then(() => {
|
|
@@ -8066,4 +8179,4 @@ Object.defineProperty(exports, 'withRequestStateValue', {
|
|
|
8066
8179
|
return withRequestStateValue;
|
|
8067
8180
|
}
|
|
8068
8181
|
});
|
|
8069
|
-
//# sourceMappingURL=src-
|
|
8182
|
+
//# sourceMappingURL=src-CgFsfg3E.cjs.map
|