@wirecat/tg-cli 0.133.0 → 0.134.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.
Files changed (153) hide show
  1. package/README.md +2 -3
  2. package/contracts/wirecat.json +82 -2
  3. package/dist/bin/tg.js +2 -2
  4. package/dist/bot/generated/types.d.ts +188 -0
  5. package/dist/bot/generated/types.d.ts.map +1 -1
  6. package/dist/bundle/{adapter-GSGX3WBH.js → adapter-Y4IXTXAG.js} +104 -69
  7. package/dist/bundle/agent-G7VHOJMS.js +37 -0
  8. package/dist/bundle/{all-profiles-VOCJ55YH.js → all-profiles-SUGID6CX.js} +62 -20
  9. package/dist/bundle/{anthropic-J6CTLU3W.js → anthropic-4QKTXT4B.js} +5 -5
  10. package/dist/bundle/{app-server-GVFGA4TJ.js → app-server-TPOD6LIJ.js} +72 -62
  11. package/dist/bundle/{bot-api-LWONPIGK.js → bot-api-KBESP422.js} +73 -92
  12. package/dist/bundle/{bot-history-XOW7Y2GC.js → bot-history-3EORA23G.js} +23 -22
  13. package/dist/bundle/{bun-436CH6CP.js → bun-FL76M4M2.js} +2 -2
  14. package/dist/bundle/{bun-sqlite-ZLB5RK5Q.js → bun-sqlite-H37OSTAJ.js} +6 -6
  15. package/dist/bundle/{chunk-YY6FGKGD.js → chunk-2GT563YH.js} +2 -2
  16. package/dist/bundle/{chunk-5L44DSHV.js → chunk-2JWY7CXJ.js} +4 -4
  17. package/dist/bundle/{chunk-OX73ERZW.js → chunk-3O25FAPA.js} +3 -4
  18. package/dist/bundle/{chunk-TCI7I6YF.js → chunk-3PG6QVQZ.js} +11 -25
  19. package/dist/bundle/{chunk-NTWXL2QV.js → chunk-3QQWTP77.js} +2 -2
  20. package/dist/bundle/{chunk-TTDZVWDU.js → chunk-3ZNO27UE.js} +1 -1
  21. package/dist/bundle/{chunk-7NYP4RBO.js → chunk-4R2ZJGFF.js} +2125 -1179
  22. package/dist/bundle/{chunk-VGN5YXYI.js → chunk-4S2DHHJM.js} +2 -100
  23. package/dist/bundle/{chunk-H7ML7X3G.js → chunk-4X6BX3XP.js} +144 -10
  24. package/dist/bundle/{chunk-D2SJLZSH.js → chunk-6DGVK5KS.js} +2 -2
  25. package/dist/bundle/chunk-6DJJVFSG.js +388 -0
  26. package/dist/bundle/{chunk-M6QOM6SL.js → chunk-6MEHKUN6.js} +1 -1
  27. package/dist/bundle/{chunk-6CHIGUCY.js → chunk-6UNLEQA5.js} +31 -20
  28. package/dist/bundle/{chunk-WCYKVX3B.js → chunk-77E7Q4EQ.js} +7 -7
  29. package/dist/bundle/chunk-7GGDCQJ5.js +353 -0
  30. package/dist/bundle/{chunk-UIAKLELF.js → chunk-AHVWZDXO.js} +79 -64
  31. package/dist/bundle/{chunk-NO2LIHWA.js → chunk-ANBI3OXK.js} +1 -1
  32. package/dist/bundle/{chunk-LQQSDGQ6.js → chunk-AYWST6NA.js} +56 -46
  33. package/dist/bundle/{chunk-NAXOT35J.js → chunk-CA7DY2YU.js} +3 -3
  34. package/dist/bundle/{chunk-UKBK2VWZ.js → chunk-CDKXZLMP.js} +225 -175
  35. package/dist/bundle/{chunk-5HKPQPD4.js → chunk-CNGNR4CY.js} +6 -6
  36. package/dist/bundle/{chunk-KUA24HWG.js → chunk-CSXCCK6J.js} +2 -2
  37. package/dist/bundle/{chunk-VTQMR3XG.js → chunk-DG35TQ6P.js} +3 -3
  38. package/dist/bundle/{chunk-IPPCQ7IK.js → chunk-EXMAWEHC.js} +2 -2
  39. package/dist/bundle/{chunk-CEJYNB3I.js → chunk-FR3ATU5I.js} +4 -4
  40. package/dist/bundle/{chunk-XOX4BX5A.js → chunk-FR4Y5CGW.js} +4 -4
  41. package/dist/bundle/{chunk-JPNVEPS4.js → chunk-GIGZTI74.js} +2023 -1928
  42. package/dist/bundle/{chunk-UZ63ORMY.js → chunk-H3TLAYGY.js} +4 -4
  43. package/dist/bundle/{chunk-LBZEZO32.js → chunk-HD7DV5B2.js} +65 -43
  44. package/dist/bundle/{chunk-TPD37ECC.js → chunk-HETHFOHC.js} +3 -3
  45. package/dist/bundle/{chunk-JKSD43L7.js → chunk-HEZK4W3U.js} +6 -6
  46. package/dist/bundle/{chunk-SMU6NA7F.js → chunk-IJ7R2WMK.js} +4 -4
  47. package/dist/bundle/{chunk-7NF3V5L2.js → chunk-ITJ7DGNA.js} +4 -4
  48. package/dist/bundle/{chunk-JGMXBAGH.js → chunk-J5RB4ASI.js} +140 -433
  49. package/dist/bundle/{chunk-57KJ3TRS.js → chunk-JAL443BH.js} +9 -9
  50. package/dist/bundle/{chunk-IH4Z3KZU.js → chunk-JCDD5T3A.js} +2 -2
  51. package/dist/bundle/{chunk-BXVB42KJ.js → chunk-JHZJBNDO.js} +2 -2
  52. package/dist/bundle/chunk-JWLODUN3.js +555 -0
  53. package/dist/bundle/{chunk-54WLIPIQ.js → chunk-JWNSG5GI.js} +1 -1
  54. package/dist/bundle/{chunk-UGS57TT5.js → chunk-JXEO5EIN.js} +2 -2
  55. package/dist/bundle/{chunk-QYLZD4DS.js → chunk-K5FK6WWN.js} +1 -1
  56. package/dist/bundle/{chunk-QWO7L4UH.js → chunk-L47PFECD.js} +7 -7
  57. package/dist/bundle/{chunk-IYAXLLGR.js → chunk-L4PNDW4S.js} +6 -6
  58. package/dist/bundle/{chunk-ZHO3TPHM.js → chunk-M323L5SG.js} +30 -15
  59. package/dist/bundle/{chunk-6A44ZZFC.js → chunk-MMDFPBFZ.js} +43 -64
  60. package/dist/bundle/{chunk-OWY52JBO.js → chunk-MUV73B5A.js} +7 -7
  61. package/dist/bundle/{chunk-2KQDJHF3.js → chunk-MXA3FU2R.js} +29 -1
  62. package/dist/bundle/{chunk-6H2NW6HK.js → chunk-NUD4CBHK.js} +3 -3
  63. package/dist/bundle/{chunk-RABUG4KA.js → chunk-NYEVPAF2.js} +511 -472
  64. package/dist/bundle/{chunk-VWJTYAIQ.js → chunk-O3QBO6NW.js} +17 -17
  65. package/dist/bundle/{chunk-N7QREPZW.js → chunk-O4ZOQJ6W.js} +9 -9
  66. package/dist/bundle/{chunk-KEN4B57V.js → chunk-OJSPB4LA.js} +2 -2
  67. package/dist/bundle/{chunk-UQYL6TJ7.js → chunk-PCBVSHKD.js} +4 -4
  68. package/dist/bundle/{chunk-LIQMUDIZ.js → chunk-PK5WEGPJ.js} +2 -2
  69. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  70. package/dist/bundle/{chunk-O6JUVATT.js → chunk-PRI2XTM7.js} +35 -12
  71. package/dist/bundle/chunk-PRM7GKBV.js +340 -0
  72. package/dist/bundle/{chunk-YAPDU3SV.js → chunk-PZ2ZFPGO.js} +1 -1
  73. package/dist/bundle/chunk-QYRK4XXH.js +727 -0
  74. package/dist/bundle/{chunk-XDQU5HBO.js → chunk-RVA3CRSY.js} +12 -12
  75. package/dist/bundle/{chunk-QVGEL66U.js → chunk-SPXNI53Z.js} +38 -9
  76. package/dist/bundle/{chunk-QGWISM4W.js → chunk-TI5U6AUT.js} +34 -28
  77. package/dist/bundle/{chunk-THYGLTRB.js → chunk-TKWYXM7L.js} +7 -7
  78. package/dist/bundle/{chunk-XKOMP3HV.js → chunk-TZCFJJEU.js} +6 -6
  79. package/dist/bundle/chunk-UTTEAOJ3.js +7 -0
  80. package/dist/bundle/chunk-V6G4LTXU.js +50 -0
  81. package/dist/bundle/{chunk-KVFUH5IT.js → chunk-VH4J7IIS.js} +1 -1
  82. package/dist/bundle/{chunk-VCAOH45X.js → chunk-VNJRWFHP.js} +1 -1
  83. package/dist/bundle/chunk-W2QSDPG6.js +80 -0
  84. package/dist/bundle/{chunk-LOS4D6ZB.js → chunk-WGGUKQE7.js} +113 -567
  85. package/dist/bundle/{chunk-ZYAHZKYF.js → chunk-WPXVJGSL.js} +3 -3
  86. package/dist/bundle/{chunk-IBCXEVNY.js → chunk-XLNV3U6N.js} +3 -3
  87. package/dist/bundle/{chunk-6S77EKZU.js → chunk-XS4EE7MO.js} +17 -15
  88. package/dist/bundle/{chunk-6VCSOQFL.js → chunk-XVRLD3LN.js} +2 -2
  89. package/dist/bundle/{chunk-HB5DP6L5.js → chunk-XZ6XEAJP.js} +18 -18
  90. package/dist/bundle/{chunk-N3JUHGKM.js → chunk-YHTSJMZ5.js} +3706 -3372
  91. package/dist/bundle/chunk-YPJCURT6.js +108 -0
  92. package/dist/bundle/{chunk-SMI2EUH4.js → chunk-Z77R76S2.js} +1 -1
  93. package/dist/bundle/{chunk-KHUXDSXN.js → chunk-ZC7OEYDX.js} +1 -1
  94. package/dist/bundle/{chunk-5LRTYBZW.js → chunk-ZW2N2GI2.js} +12 -12
  95. package/dist/bundle/command-contract-LEFXJAA3.js +37 -0
  96. package/dist/bundle/{command-server-entry-AE27QXTE.js → command-server-entry-WQAE5UGU.js} +27 -27
  97. package/dist/bundle/{decode-RQPPZ72F.js → decode-2J2DOVGV.js} +5 -5
  98. package/dist/bundle/{dispatch-KQO2MCSH.js → dispatch-IZ2TP5GW.js} +8 -8
  99. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  100. package/dist/bundle/{echarts-FZRIACN4.js → echarts-GFIIHZ4U.js} +2 -2
  101. package/dist/bundle/{embed-TOSWWMDL.js → embed-AGOXADHW.js} +6 -6
  102. package/dist/bundle/{embedder-JHIQSBGD.js → embedder-PCIXGM2Y.js} +9 -9
  103. package/dist/bundle/{entry-DU4KRXTG.js → entry-HUQXUV52.js} +9 -9
  104. package/dist/bundle/{failure-3YC3YGYO.js → failure-JSRHZ2S6.js} +2 -2
  105. package/dist/bundle/{first-run-DQQT4FID.js → first-run-2LXN7B33.js} +12 -12
  106. package/dist/bundle/first-screen-VUE6RCSF.js +37 -0
  107. package/dist/bundle/{instructions-WI64CJQ6.js → instructions-RSLTJVFJ.js} +1 -1
  108. package/dist/bundle/{mcp-VMS6PBCU.js → mcp-MMENCB7I.js} +2 -2
  109. package/dist/bundle/meeting-combined-PBNPHOM3.js +23 -0
  110. package/dist/bundle/{meeting-model-XNRSREIK.js → meeting-model-SI77WMMK.js} +11 -11
  111. package/dist/bundle/{meeting-semantic-OOSCHQMB.js → meeting-semantic-WRXWUR4M.js} +6 -6
  112. package/dist/bundle/{node-JLKDNVKV.js → node-5XGMCUGQ.js} +2 -2
  113. package/dist/bundle/{node-sqlite-YOGH26O2.js → node-sqlite-ES7SQSIC.js} +7 -7
  114. package/dist/bundle/{oauth-FOMXM5HP.js → oauth-QFM4Y6N7.js} +8 -8
  115. package/dist/bundle/{open-SM2UXUKM.js → open-2MD2DKGQ.js} +5 -5
  116. package/dist/bundle/{openai-J2H7S6ZF.js → openai-6TMKJKYO.js} +15 -15
  117. package/dist/bundle/{process-HI7OZBOI.js → process-VA2DP7MY.js} +1 -1
  118. package/dist/bundle/{program-VY4HFU25.js → program-K3SLEA42.js} +70 -64
  119. package/dist/bundle/{prompt-NUUVFMOF.js → prompt-VZSPCE6E.js} +5 -5
  120. package/dist/bundle/{proxy-transport-AN4VMRRN.js → proxy-transport-OJU2EOOC.js} +5 -5
  121. package/dist/bundle/{recognize-MALJHPDI.js → recognize-LH3ZZEIL.js} +4 -4
  122. package/dist/bundle/{remote-QUDRSTS2.js → remote-JNW5HN2I.js} +9 -9
  123. package/dist/bundle/{rerank-2DSO3D3S.js → rerank-P23UJMII.js} +7 -7
  124. package/dist/bundle/{serve-NCJ52MY3.js → serve-VSLLMILH.js} +15 -15
  125. package/dist/bundle/{server-Y3M544AM.js → server-FBRRRKCS.js} +65 -54
  126. package/dist/bundle/server-TA4QP7PG.js +78 -0
  127. package/dist/bundle/{sqlite-runtime-NJUSXVKK.js → sqlite-runtime-LWATDAAU.js} +6 -6
  128. package/dist/bundle/{state-AVOWQVET.js → state-3AFJL2EL.js} +6 -6
  129. package/dist/bundle/{store-MMIYOL4H.js → store-6TLYL2VU.js} +28 -17
  130. package/dist/bundle/{store-BZ5ICDRP.js → store-PEXV5DNA.js} +20 -19
  131. package/dist/bundle/store-maintenance-command-IYJLUQ5X.js +65 -0
  132. package/dist/bundle/surface-L4VY4WFG.js +64 -0
  133. package/dist/bundle/tg.js +13 -13
  134. package/dist/telegram/adapter.d.ts +9 -2
  135. package/dist/telegram/adapter.d.ts.map +1 -1
  136. package/dist/telegram/adapter.js +5 -6
  137. package/dist/telegram/adapter.js.map +1 -1
  138. package/dist/telegram/messages.d.ts +12 -0
  139. package/dist/telegram/messages.d.ts.map +1 -1
  140. package/dist/telegram/messages.js +40 -0
  141. package/dist/telegram/messages.js.map +1 -1
  142. package/dist/version.d.ts +1 -1
  143. package/dist/version.js +1 -1
  144. package/package.json +3 -3
  145. package/skills/tg-cli/SKILL.md +4 -2
  146. package/skills/tg-cli/references/messages.md +5 -1
  147. package/skills/tg-cli/references/search.md +2 -0
  148. package/dist/bundle/chunk-SHTHNBHG.js +0 -2
  149. package/dist/bundle/command-contract-TQIARAB4.js +0 -37
  150. package/dist/bundle/first-screen-7N4CTZSA.js +0 -37
  151. package/dist/bundle/meeting-combined-3RAOFQ7M.js +0 -23
  152. package/dist/bundle/server-CHGON5I2.js +0 -70
  153. package/dist/bundle/store-maintenance-command-VKZ4WHUB.js +0 -61
@@ -7207,7 +7207,15 @@ var SERVER_INFO_META_KEY = "io.modelcontextprotocol/serverInfo";
7207
7207
  var CLIENT_CAPABILITIES_META_KEY = "io.modelcontextprotocol/clientCapabilities";
7208
7208
  var SUBSCRIPTION_ID_META_KEY = "io.modelcontextprotocol/subscriptionId";
7209
7209
  var LOG_LEVEL_META_KEY = "io.modelcontextprotocol/logLevel";
7210
+ var TRACEPARENT_META_KEY = "traceparent";
7211
+ var TRACESTATE_META_KEY = "tracestate";
7212
+ var BAGGAGE_META_KEY = "baggage";
7210
7213
  var JSONRPC_VERSION = "2.0";
7214
+ var PARSE_ERROR = -32700;
7215
+ var INVALID_REQUEST = -32600;
7216
+ var METHOD_NOT_FOUND = -32601;
7217
+ var INVALID_PARAMS = -32602;
7218
+ var INTERNAL_ERROR = -32603;
7211
7219
  var JSONValueSchema = lazy(() => union([
7212
7220
  string2(),
7213
7221
  number2(),
@@ -8318,6 +8326,22 @@ var SdkHttpError = class extends SdkError {
8318
8326
  return this.data.statusText;
8319
8327
  }
8320
8328
  };
8329
+ function resourceUrlFromServerUrl(url2) {
8330
+ const resourceURL = typeof url2 === "string" ? new URL(url2) : new URL(url2.href);
8331
+ resourceURL.hash = "";
8332
+ return resourceURL;
8333
+ }
8334
+ __name(resourceUrlFromServerUrl, "resourceUrlFromServerUrl");
8335
+ function checkResourceAllowed({ requestedResource, configuredResource }) {
8336
+ const requested = typeof requestedResource === "string" ? new URL(requestedResource) : new URL(requestedResource.href);
8337
+ const configured = typeof configuredResource === "string" ? new URL(configuredResource) : new URL(configuredResource.href);
8338
+ if (requested.origin !== configured.origin) return false;
8339
+ if (requested.pathname.length < configured.pathname.length) return false;
8340
+ const requestedPath = requested.pathname.endsWith("/") ? requested.pathname : requested.pathname + "/";
8341
+ const configuredPath = configured.pathname.endsWith("/") ? configured.pathname : configured.pathname + "/";
8342
+ return requestedPath.startsWith(configuredPath);
8343
+ }
8344
+ __name(checkResourceAllowed, "checkResourceAllowed");
8321
8345
  var REQUIRED_CLIENT_CAPABILITIES_BY_METHOD = {};
8322
8346
  function requiredClientCapabilitiesForRequest(method) {
8323
8347
  return Object.hasOwn(REQUIRED_CLIENT_CAPABILITIES_BY_METHOD, method) ? REQUIRED_CLIENT_CAPABILITIES_BY_METHOD[method] : void 0;
@@ -9457,6 +9481,10 @@ function registryMaps() {
9457
9481
  return maps$1;
9458
9482
  }
9459
9483
  __name(registryMaps, "registryMaps");
9484
+ function warmRegistryMaps2025() {
9485
+ registryMaps();
9486
+ }
9487
+ __name(warmRegistryMaps2025, "warmRegistryMaps2025");
9460
9488
  function hasRequestMethod2025(method) {
9461
9489
  return Object.prototype.hasOwnProperty.call(requestMethodKeys$1, method);
9462
9490
  }
@@ -10743,6 +10771,10 @@ function inputSchemaMaps() {
10743
10771
  return maps;
10744
10772
  }
10745
10773
  __name(inputSchemaMaps, "inputSchemaMaps");
10774
+ function warmInputSchemaMaps2026() {
10775
+ inputSchemaMaps();
10776
+ }
10777
+ __name(warmInputSchemaMaps2026, "warmInputSchemaMaps2026");
10746
10778
  function isInputRequestMethod2026(method) {
10747
10779
  return INPUT_REQUEST_METHODS_2026.includes(method);
10748
10780
  }
@@ -10984,6 +11016,10 @@ function getWireResultSchemas() {
10984
11016
  return wireResultSchemasMemo;
10985
11017
  }
10986
11018
  __name(getWireResultSchemas, "getWireResultSchemas");
11019
+ function warmWireResultSchemas2026() {
11020
+ getWireResultSchemas();
11021
+ }
11022
+ __name(warmWireResultSchemas2026, "warmWireResultSchemas2026");
10987
11023
  var MODERN_WIRE_REVISION = "2026-07-28";
10988
11024
  function codecForVersion(version2) {
10989
11025
  return version2 !== void 0 && isModernProtocolVersion(version2) ? rev2026Codec : rev2025Codec;
@@ -11199,12 +11235,23 @@ var schemas_exports2 = /* @__PURE__ */ __exportAll({
11199
11235
  UntitledMultiSelectEnumSchemaSchema: /* @__PURE__ */ __name(() => UntitledMultiSelectEnumSchemaSchema, "UntitledMultiSelectEnumSchemaSchema"),
11200
11236
  UntitledSingleSelectEnumSchemaSchema: /* @__PURE__ */ __name(() => UntitledSingleSelectEnumSchemaSchema, "UntitledSingleSelectEnumSchemaSchema")
11201
11237
  });
11238
+ function parseJSONRPCMessage(value) {
11239
+ return JSONRPCMessageSchema.parse(value);
11240
+ }
11241
+ __name(parseJSONRPCMessage, "parseJSONRPCMessage");
11202
11242
  var isJSONRPCRequest = /* @__PURE__ */ __name((value) => JSONRPCRequestSchema.safeParse(value).success, "isJSONRPCRequest");
11203
11243
  var isJSONRPCNotification = /* @__PURE__ */ __name((value) => JSONRPCNotificationSchema.safeParse(value).success, "isJSONRPCNotification");
11204
11244
  var isJSONRPCResultResponse = /* @__PURE__ */ __name((value) => JSONRPCResultResponseSchema.safeParse(value).success, "isJSONRPCResultResponse");
11205
11245
  var isJSONRPCErrorResponse = /* @__PURE__ */ __name((value) => JSONRPCErrorResponseSchema.safeParse(value).success, "isJSONRPCErrorResponse");
11246
+ var isJSONRPCResponse = /* @__PURE__ */ __name((value) => JSONRPCResponseSchema.safeParse(value).success, "isJSONRPCResponse");
11247
+ var isCallToolResult = /* @__PURE__ */ __name((value) => {
11248
+ if (typeof value !== "object" || value === null || value.content === void 0) return false;
11249
+ return CallToolResultSchema.safeParse(value).success;
11250
+ }, "isCallToolResult");
11206
11251
  var isInputRequiredResult = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value) && value.resultType === "input_required", "isInputRequiredResult");
11252
+ var isTaskAugmentedRequestParams = /* @__PURE__ */ __name((value) => TaskAugmentedRequestParamsSchema.safeParse(value).success, "isTaskAugmentedRequestParams");
11207
11253
  var isInitializeRequest = /* @__PURE__ */ __name((value) => InitializeRequestSchema.safeParse(value).success, "isInitializeRequest");
11254
+ var isInitializedNotification = /* @__PURE__ */ __name((value) => InitializedNotificationSchema.safeParse(value).success, "isInitializedNotification");
11208
11255
  function assertCompleteRequestPrompt(request) {
11209
11256
  if (request.params.ref.type !== "ref/prompt") throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
11210
11257
  }
@@ -11988,6 +12035,39 @@ var inputRequired = Object.assign(buildInputRequired, {
11988
12035
  return { method: "roots/list" };
11989
12036
  }
11990
12037
  });
12038
+ function acceptedContent(responses, key, schema) {
12039
+ const view = inputResponse(responses, key);
12040
+ if (view.kind !== "elicit" || view.action !== "accept" || view.content === void 0) return void 0;
12041
+ if (schema === void 0) return view.content;
12042
+ const outcome = schema["~standard"].validate(view.content);
12043
+ if (outcome instanceof Promise) throw new TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");
12044
+ return outcome.issues === void 0 ? outcome.value : void 0;
12045
+ }
12046
+ __name(acceptedContent, "acceptedContent");
12047
+ function inputResponse(responses, key) {
12048
+ if (responses === void 0 || typeof responses !== "object" || responses === null) return { kind: "missing" };
12049
+ const entry = responses[key];
12050
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return { kind: "missing" };
12051
+ const candidate = entry;
12052
+ if (candidate["action"] === "accept" || candidate["action"] === "decline" || candidate["action"] === "cancel") {
12053
+ const content = candidate["content"];
12054
+ return {
12055
+ kind: "elicit",
12056
+ action: candidate["action"],
12057
+ ...content !== null && typeof content === "object" && !Array.isArray(content) && { content }
12058
+ };
12059
+ }
12060
+ if (Array.isArray(candidate["roots"])) return {
12061
+ kind: "roots",
12062
+ roots: candidate["roots"]
12063
+ };
12064
+ if (typeof candidate["role"] === "string" && candidate["content"] !== void 0) return {
12065
+ kind: "sampling",
12066
+ result: candidate
12067
+ };
12068
+ return { kind: "missing" };
12069
+ }
12070
+ __name(inputResponse, "inputResponse");
11991
12071
  var REQUEST_STATE_ONLY_LEG_PACING_MS = 250;
11992
12072
  function inputRequiredRoundsExceededMessage(method, maxRounds) {
11993
12073
  return `Multi-round-trip request '${method}' still required input after ${maxRounds} rounds (inputRequired.maxRounds)`;
@@ -13162,6 +13242,12 @@ function isJsonContentType(header) {
13162
13242
  return mediaTypeEssence(header) === "application/json";
13163
13243
  }
13164
13244
  __name(isJsonContentType, "isJsonContentType");
13245
+ function getDisplayName(metadata) {
13246
+ if (metadata.title !== void 0 && metadata.title !== "") return metadata.title;
13247
+ if ("annotations" in metadata && metadata.annotations?.title) return metadata.annotations.title;
13248
+ return metadata.name;
13249
+ }
13250
+ __name(getDisplayName, "getDisplayName");
13165
13251
  var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
13166
13252
  var ReadBuffer = class {
13167
13253
  static {
@@ -13251,6 +13337,27 @@ function validateAndWarnToolName(name) {
13251
13337
  return result.isValid;
13252
13338
  }
13253
13339
  __name(validateAndWarnToolName, "validateAndWarnToolName");
13340
+ function normalizeHeaders(headers) {
13341
+ if (!headers) return {};
13342
+ if (headers instanceof Headers) return Object.fromEntries(headers.entries());
13343
+ if (Array.isArray(headers)) return Object.fromEntries(headers);
13344
+ return { ...headers };
13345
+ }
13346
+ __name(normalizeHeaders, "normalizeHeaders");
13347
+ function createFetchWithInit(baseFetch = fetch, baseInit) {
13348
+ if (!baseInit) return baseFetch;
13349
+ return async (url2, init) => {
13350
+ return baseFetch(url2, {
13351
+ ...baseInit,
13352
+ ...init,
13353
+ headers: init?.headers ? {
13354
+ ...normalizeHeaders(baseInit.headers),
13355
+ ...normalizeHeaders(init.headers)
13356
+ } : baseInit.headers
13357
+ });
13358
+ };
13359
+ }
13360
+ __name(createFetchWithInit, "createFetchWithInit");
13254
13361
  var MAX_TEMPLATE_LENGTH = 1e6;
13255
13362
  var MAX_VARIABLE_LENGTH = 1e6;
13256
13363
  var MAX_TEMPLATE_EXPRESSIONS = 1e4;
@@ -13456,6 +13563,57 @@ var UriTemplate = class UriTemplate2 {
13456
13563
  return result;
13457
13564
  }
13458
13565
  };
13566
+ var InMemoryTransport = class InMemoryTransport2 {
13567
+ static {
13568
+ __name(this, "InMemoryTransport");
13569
+ }
13570
+ _otherTransport;
13571
+ _messageQueue = [];
13572
+ _closed = false;
13573
+ onclose;
13574
+ onerror;
13575
+ onmessage;
13576
+ sessionId;
13577
+ /**
13578
+ * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a {@linkcode @modelcontextprotocol/client!client/client.Client | Client} and one to a {@linkcode @modelcontextprotocol/server!server/server.Server | Server}.
13579
+ */
13580
+ static createLinkedPair() {
13581
+ const clientTransport = new InMemoryTransport2();
13582
+ const serverTransport = new InMemoryTransport2();
13583
+ clientTransport._otherTransport = serverTransport;
13584
+ serverTransport._otherTransport = clientTransport;
13585
+ return [clientTransport, serverTransport];
13586
+ }
13587
+ async start() {
13588
+ while (this._messageQueue.length > 0) {
13589
+ const queuedMessage = this._messageQueue.shift();
13590
+ this.onmessage?.(queuedMessage.message, queuedMessage.extra);
13591
+ }
13592
+ }
13593
+ async close() {
13594
+ if (this._closed) return;
13595
+ this._closed = true;
13596
+ const other = this._otherTransport;
13597
+ this._otherTransport = void 0;
13598
+ try {
13599
+ await other?.close();
13600
+ } finally {
13601
+ this.onclose?.();
13602
+ }
13603
+ }
13604
+ /**
13605
+ * Sends a message with optional auth info.
13606
+ * This is useful for testing authentication scenarios.
13607
+ */
13608
+ async send(message, options) {
13609
+ if (!this._otherTransport) throw new SdkError(SdkErrorCode.NotConnected, "Not connected");
13610
+ if (this._otherTransport.onmessage) this._otherTransport.onmessage(message, { authInfo: options?.authInfo });
13611
+ else this._otherTransport._messageQueue.push({
13612
+ message,
13613
+ extra: { authInfo: options?.authInfo }
13614
+ });
13615
+ }
13616
+ };
13459
13617
  function isZodV4Schema(v) {
13460
13618
  return typeof v === "object" && v !== null && "_zod" in v;
13461
13619
  }
@@ -13480,6 +13638,30 @@ function normalizeRawShapeSchema(schema) {
13480
13638
  return schema;
13481
13639
  }
13482
13640
  __name(normalizeRawShapeSchema, "normalizeRawShapeSchema");
13641
+ function preloadSchemas() {
13642
+ buildSchemas2025();
13643
+ buildSchemas2026();
13644
+ warmRegistryMaps2025();
13645
+ warmInputSchemaMaps2026();
13646
+ warmWireResultSchemas2026();
13647
+ }
13648
+ __name(preloadSchemas, "preloadSchemas");
13649
+ function fromJsonSchema(schema, validator) {
13650
+ const check = validator.getValidator(schema);
13651
+ return { "~standard": {
13652
+ version: 1,
13653
+ vendor: "mcp",
13654
+ jsonSchema: {
13655
+ input: /* @__PURE__ */ __name(() => schema, "input"),
13656
+ output: /* @__PURE__ */ __name(() => schema, "output")
13657
+ },
13658
+ validate: /* @__PURE__ */ __name((data) => {
13659
+ const result = check(data);
13660
+ return result.valid ? { value: result.data } : { issues: [{ message: result.errorMessage }] };
13661
+ }, "validate")
13662
+ } };
13663
+ }
13664
+ __name(fromJsonSchema, "fromJsonSchema");
13483
13665
 
13484
13666
  // node_modules/.pnpm/@modelcontextprotocol+server@2.4.0/node_modules/@modelcontextprotocol/server/dist/ajvProvider-DyjnscPj.mjs
13485
13667
  var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
@@ -21287,6 +21469,16 @@ import process from "node:process";
21287
21469
 
21288
21470
  // node_modules/.pnpm/@modelcontextprotocol+server@2.4.0/node_modules/@modelcontextprotocol/server/dist/mcp-oHn3ureC.mjs
21289
21471
  var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
21472
+ function completable(schema, complete) {
21473
+ Object.defineProperty(schema, COMPLETABLE_SYMBOL, {
21474
+ value: { complete },
21475
+ enumerable: false,
21476
+ writable: false,
21477
+ configurable: false
21478
+ });
21479
+ return schema;
21480
+ }
21481
+ __name(completable, "completable");
21290
21482
  function isCompletable(schema) {
21291
21483
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
21292
21484
  }
@@ -21708,6 +21900,18 @@ function validateScopeChallenge(challenge) {
21708
21900
  return challenge;
21709
21901
  }
21710
21902
  __name(validateScopeChallenge, "validateScopeChallenge");
21903
+ function requireScopes(...scopes) {
21904
+ if (scopes.length === 0) throw new TypeError("requireScopes must contain at least one scope");
21905
+ for (const [index, scope] of scopes.entries()) assertScope(scope, `requireScopes scope[${index}]`);
21906
+ const requiredScopes = [...scopes];
21907
+ return ({ authInfo }) => {
21908
+ if (authInfo === void 0) return;
21909
+ const activeScopes = new Set(authInfo.scopes);
21910
+ if (requiredScopes.every((scope) => activeScopes.has(scope))) return;
21911
+ return { scopes: requiredScopes };
21912
+ };
21913
+ }
21914
+ __name(requireScopes, "requireScopes");
21711
21915
  async function findScopeChallenge(requests, authInfo, resolve) {
21712
21916
  for (const request of requests) {
21713
21917
  const challenge = await resolve({
@@ -24440,6 +24644,10 @@ function createLegacyStatelessFallback(factory, onerror, keepAliveMs, maxRequest
24440
24644
  };
24441
24645
  }
24442
24646
  __name(createLegacyStatelessFallback, "createLegacyStatelessFallback");
24647
+ function legacyStatelessFallback(factory, onerror, options) {
24648
+ return createLegacyStatelessFallback(factory, onerror, void 0, resolveMaxRequestBodySize(options?.maxRequestBodySize));
24649
+ }
24650
+ __name(legacyStatelessFallback, "legacyStatelessFallback");
24443
24651
  function standardHeadersOf(request) {
24444
24652
  return {
24445
24653
  protocolVersionHeader: request.headers.get("mcp-protocol-version") ?? void 0,
@@ -24720,6 +24928,14 @@ function validateHostHeader(hostHeader, allowedHostnames) {
24720
24928
  };
24721
24929
  }
24722
24930
  __name(validateHostHeader, "validateHostHeader");
24931
+ function localhostAllowedHostnames() {
24932
+ return [
24933
+ "localhost",
24934
+ "127.0.0.1",
24935
+ "[::1]"
24936
+ ];
24937
+ }
24938
+ __name(localhostAllowedHostnames, "localhostAllowedHostnames");
24723
24939
  function hostHeaderValidationResponse(req, allowedHostnames) {
24724
24940
  const result = validateHostHeader(req.headers.get("host"), allowedHostnames);
24725
24941
  if (result.ok) return void 0;
@@ -24736,41 +24952,258 @@ function hostHeaderValidationResponse(req, allowedHostnames) {
24736
24952
  });
24737
24953
  }
24738
24954
  __name(hostHeaderValidationResponse, "hostHeaderValidationResponse");
24955
+ function validateOriginHeader(originHeader, allowedOriginHostnames) {
24956
+ if (originHeader === null || originHeader === void 0 || originHeader === "") return { ok: true };
24957
+ let hostname;
24958
+ let scheme;
24959
+ try {
24960
+ const url2 = new URL(originHeader);
24961
+ hostname = url2.hostname;
24962
+ scheme = url2.protocol;
24963
+ } catch {
24964
+ return {
24965
+ ok: false,
24966
+ errorCode: "invalid_origin_header",
24967
+ message: `Invalid Origin header: ${originHeader}`,
24968
+ originHeader
24969
+ };
24970
+ }
24971
+ if (hostname === "") return {
24972
+ ok: false,
24973
+ errorCode: "invalid_origin_header",
24974
+ message: `Invalid Origin header: ${originHeader}`,
24975
+ originHeader
24976
+ };
24977
+ if (!(scheme !== "http:" && scheme !== "https:" && allowedOriginHostnames.includes(`${scheme}//*`)) && !allowedOriginHostnames.includes(hostname)) return {
24978
+ ok: false,
24979
+ errorCode: "invalid_origin",
24980
+ message: `Invalid Origin: ${hostname}`,
24981
+ originHeader,
24982
+ hostname
24983
+ };
24984
+ return {
24985
+ ok: true,
24986
+ origin: originHeader,
24987
+ hostname
24988
+ };
24989
+ }
24990
+ __name(validateOriginHeader, "validateOriginHeader");
24991
+ function localhostAllowedOrigins() {
24992
+ return [
24993
+ "localhost",
24994
+ "127.0.0.1",
24995
+ "[::1]"
24996
+ ];
24997
+ }
24998
+ __name(localhostAllowedOrigins, "localhostAllowedOrigins");
24999
+ function originValidationResponse(req, allowedOriginHostnames) {
25000
+ const result = validateOriginHeader(req.headers.get("origin"), allowedOriginHostnames);
25001
+ if (result.ok) return void 0;
25002
+ return Response.json({
25003
+ jsonrpc: "2.0",
25004
+ error: {
25005
+ code: -32e3,
25006
+ message: result.message
25007
+ },
25008
+ id: null
25009
+ }, {
25010
+ status: 403,
25011
+ headers: { "Content-Type": "application/json" }
25012
+ });
25013
+ }
25014
+ __name(originValidationResponse, "originValidationResponse");
25015
+ var PREFIX = "v1.";
25016
+ function bytesToBase64Url(bytes) {
25017
+ let bin = "";
25018
+ for (const b of bytes) bin += String.fromCodePoint(b);
25019
+ return btoa(bin).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
25020
+ }
25021
+ __name(bytesToBase64Url, "bytesToBase64Url");
25022
+ function constantTimeTagEqual(a, b) {
25023
+ if (a.length !== b.length) return false;
25024
+ let r = 0;
25025
+ for (let i = 0; i < a.length; i++) r |= a.codePointAt(i) ^ b.codePointAt(i);
25026
+ return r === 0;
25027
+ }
25028
+ __name(constantTimeTagEqual, "constantTimeTagEqual");
25029
+ function base64UrlToBytes(s) {
25030
+ const b64 = s.replaceAll("-", "+").replaceAll("_", "/");
25031
+ const bin = atob(b64);
25032
+ const bytes = new Uint8Array(bin.length);
25033
+ for (let i = 0; i < bin.length; i++) bytes[i] = bin.codePointAt(i);
25034
+ return bytes;
25035
+ }
25036
+ __name(base64UrlToBytes, "base64UrlToBytes");
25037
+ function createRequestStateCodec(options) {
25038
+ const subtle = globalThis.crypto?.subtle;
25039
+ if (subtle === void 0) throw new TypeError("createRequestStateCodec requires the Web Crypto API (globalThis.crypto.subtle); see https://ts.sdk.modelcontextprotocol.io/v2/troubleshooting for the Node.js polyfill instructions");
25040
+ const keyBytes = typeof options.key === "string" ? new TextEncoder().encode(options.key) : Uint8Array.from(options.key);
25041
+ if (keyBytes.byteLength < 32) throw new RangeError(`createRequestStateCodec: key must be at least 32 bytes (got ${keyBytes.byteLength})`);
25042
+ const ttlSeconds = options.ttlSeconds ?? 600;
25043
+ if (!Number.isFinite(ttlSeconds)) throw new RangeError("createRequestStateCodec: ttlSeconds must be a finite number");
25044
+ const bind = options.bind;
25045
+ let cryptoKey;
25046
+ const importedKey = /* @__PURE__ */ __name(() => cryptoKey ??= subtle.importKey("raw", keyBytes, {
25047
+ name: "HMAC",
25048
+ hash: "SHA-256"
25049
+ }, false, ["sign", "verify"]), "importedKey");
25050
+ const utf8 = new TextEncoder();
25051
+ const BIND_LABEL = "mcp.requestState.bind:";
25052
+ const bindTag = /* @__PURE__ */ __name(async (value) => {
25053
+ return bytesToBase64Url(new Uint8Array(await subtle.sign("HMAC", await importedKey(), utf8.encode(BIND_LABEL + value))).slice(0, 16));
25054
+ }, "bindTag");
25055
+ return {
25056
+ async mint(payload, ctx) {
25057
+ const envelope = {
25058
+ p: payload,
25059
+ exp: Math.floor(Date.now() / 1e3) + ttlSeconds
25060
+ };
25061
+ if (bind !== void 0) {
25062
+ if (ctx === void 0) throw new TypeError("createRequestStateCodec: mint() requires ctx when a bind callback is configured");
25063
+ envelope.b = await bindTag(bind(ctx));
25064
+ }
25065
+ const body = bytesToBase64Url(utf8.encode(JSON.stringify(envelope)));
25066
+ return `${PREFIX}${body}.${bytesToBase64Url(new Uint8Array(await subtle.sign("HMAC", await importedKey(), utf8.encode(PREFIX + body))))}`;
25067
+ },
25068
+ async verify(state, ctx) {
25069
+ const dot = state.lastIndexOf(".");
25070
+ if (!state.startsWith(PREFIX) || dot <= 3) throw new Error("malformed");
25071
+ const body = state.slice(3, dot);
25072
+ let macBytes;
25073
+ try {
25074
+ macBytes = base64UrlToBytes(state.slice(dot + 1));
25075
+ } catch {
25076
+ throw new Error("malformed");
25077
+ }
25078
+ if (!await subtle.verify("HMAC", await importedKey(), macBytes, utf8.encode(PREFIX + body))) throw new Error("mac");
25079
+ let envelope;
25080
+ try {
25081
+ envelope = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(base64UrlToBytes(body)));
25082
+ } catch {
25083
+ throw new Error("malformed");
25084
+ }
25085
+ if (typeof envelope.exp !== "number" || envelope.exp < Math.floor(Date.now() / 1e3)) throw new Error("expired");
25086
+ if (bind !== void 0) {
25087
+ const expected = await bindTag(bind(ctx));
25088
+ if (envelope.b === void 0 || !constantTimeTagEqual(envelope.b, expected)) throw new Error("bind");
25089
+ } else if (envelope.b !== void 0) throw new Error("bind");
25090
+ return envelope.p;
25091
+ }
25092
+ };
25093
+ }
25094
+ __name(createRequestStateCodec, "createRequestStateCodec");
25095
+ var _defaultValidator;
25096
+ function fromJsonSchema2(schema, validator) {
25097
+ return fromJsonSchema(schema, validator ?? (_defaultValidator ??= new AjvJsonSchemaValidator()));
25098
+ }
25099
+ __name(fromJsonSchema2, "fromJsonSchema");
24739
25100
 
24740
25101
  export {
25102
+ LATEST_PROTOCOL_VERSION,
25103
+ DEFAULT_NEGOTIATED_PROTOCOL_VERSION,
25104
+ SUPPORTED_PROTOCOL_VERSIONS,
25105
+ RELATED_TASK_META_KEY,
25106
+ PROTOCOL_VERSION_META_KEY,
24741
25107
  CLIENT_INFO_META_KEY,
25108
+ SERVER_INFO_META_KEY,
25109
+ CLIENT_CAPABILITIES_META_KEY,
25110
+ SUBSCRIPTION_ID_META_KEY,
25111
+ LOG_LEVEL_META_KEY,
25112
+ TRACEPARENT_META_KEY,
25113
+ TRACESTATE_META_KEY,
25114
+ BAGGAGE_META_KEY,
25115
+ JSONRPC_VERSION,
25116
+ PARSE_ERROR,
25117
+ INVALID_REQUEST,
25118
+ METHOD_NOT_FOUND,
25119
+ INVALID_PARAMS,
25120
+ INTERNAL_ERROR,
24742
25121
  OAuthErrorCode,
24743
25122
  OAuthError,
25123
+ SdkErrorCode,
25124
+ SdkError,
25125
+ SdkHttpError,
25126
+ resourceUrlFromServerUrl,
25127
+ checkResourceAllowed,
24744
25128
  SUPPORTED_MODERN_PROTOCOL_VERSIONS,
24745
25129
  ProtocolErrorCode,
25130
+ ProtocolError,
25131
+ ResourceNotFoundError,
25132
+ UrlElicitationRequiredError,
24746
25133
  UnsupportedProtocolVersionError,
25134
+ MissingRequiredClientCapabilityError,
24747
25135
  requestMetaOf,
24748
25136
  hasEnvelopeClaim,
24749
25137
  envelopeClaimVersion,
24750
25138
  validateEnvelopeMeta,
25139
+ parseJSONRPCMessage,
24751
25140
  isJSONRPCRequest,
24752
25141
  isJSONRPCNotification,
24753
25142
  isJSONRPCResultResponse,
24754
25143
  isJSONRPCErrorResponse,
25144
+ isJSONRPCResponse,
25145
+ isCallToolResult,
25146
+ isInputRequiredResult,
25147
+ isTaskAugmentedRequestParams,
25148
+ isInitializeRequest,
25149
+ isInitializedNotification,
25150
+ assertCompleteRequestPrompt,
25151
+ assertCompleteRequestResourceTemplate,
24755
25152
  carriesValidModernEnvelopeClaim,
25153
+ classifyInboundRequest,
24756
25154
  modernOnlyStrictRejection,
25155
+ inputRequired,
25156
+ acceptedContent,
25157
+ inputResponse,
25158
+ specTypeSchemas,
25159
+ isSpecType,
25160
+ DEFAULT_REQUEST_TIMEOUT_MSEC,
24757
25161
  setNegotiatedProtocolVersion,
25162
+ Protocol,
25163
+ mergeCapabilities,
25164
+ isJsonContentType,
25165
+ getDisplayName,
25166
+ STDIO_DEFAULT_MAX_BUFFER_SIZE,
24758
25167
  ReadBuffer,
25168
+ deserializeMessage,
24759
25169
  serializeMessage,
25170
+ createFetchWithInit,
25171
+ UriTemplate,
25172
+ InMemoryTransport,
25173
+ preloadSchemas,
24760
25174
  process,
25175
+ completable,
25176
+ isCompletable,
25177
+ PerRequestHTTPServerTransport,
25178
+ verifyBearerToken,
25179
+ bearerAuthChallengeResponse,
24761
25180
  requireBearerAuth,
25181
+ buildOAuthProtectedResourceMetadata,
24762
25182
  getOAuthProtectedResourceMetadataUrl,
24763
25183
  oauthMetadataResponse,
25184
+ requireScopes,
24764
25185
  installModernOnlyHandlers,
24765
25186
  serverIdentityOf,
25187
+ Server,
24766
25188
  McpServer,
24767
25189
  ResourceTemplate,
25190
+ InMemoryServerEventBus,
24768
25191
  DEFAULT_MAX_SUBSCRIPTIONS,
24769
25192
  StdioListenRouter,
25193
+ DEFAULT_MAX_REQUEST_BODY_SIZE,
25194
+ readRequestBody,
24770
25195
  WebStandardStreamableHTTPServerTransport,
25196
+ legacyStatelessFallback,
24771
25197
  isLegacyRequest,
24772
25198
  createMcpHandler,
24773
- hostHeaderValidationResponse
25199
+ validateHostHeader,
25200
+ localhostAllowedHostnames,
25201
+ hostHeaderValidationResponse,
25202
+ validateOriginHeader,
25203
+ localhostAllowedOrigins,
25204
+ originValidationResponse,
25205
+ createRequestStateCodec,
25206
+ fromJsonSchema2 as fromJsonSchema
24774
25207
  };
24775
25208
  /*! Bundled license information:
24776
25209