open-mcp-app 0.0.2 → 0.0.3

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.
@@ -2975,7 +2975,7 @@ var require_compile = __commonJS({
2975
2975
  const schOrFunc = root.refs[ref];
2976
2976
  if (schOrFunc)
2977
2977
  return schOrFunc;
2978
- let _sch = resolve2.call(this, root, ref);
2978
+ let _sch = resolve.call(this, root, ref);
2979
2979
  if (_sch === void 0) {
2980
2980
  const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
2981
2981
  const { schemaId } = this.opts;
@@ -3002,7 +3002,7 @@ var require_compile = __commonJS({
3002
3002
  function sameSchemaEnv(s1, s2) {
3003
3003
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3004
3004
  }
3005
- function resolve2(root, ref) {
3005
+ function resolve(root, ref) {
3006
3006
  let sch;
3007
3007
  while (typeof (sch = this.refs[ref]) == "string")
3008
3008
  ref = sch;
@@ -3577,55 +3577,55 @@ var require_fast_uri = __commonJS({
3577
3577
  }
3578
3578
  return uri;
3579
3579
  }
3580
- function resolve2(baseURI, relativeURI, options) {
3580
+ function resolve(baseURI, relativeURI, options) {
3581
3581
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
3582
3582
  const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
3583
3583
  schemelessOptions.skipEscape = true;
3584
3584
  return serialize(resolved, schemelessOptions);
3585
3585
  }
3586
- function resolveComponent(base, relative2, options, skipNormalization) {
3586
+ function resolveComponent(base, relative, options, skipNormalization) {
3587
3587
  const target = {};
3588
3588
  if (!skipNormalization) {
3589
3589
  base = parse(serialize(base, options), options);
3590
- relative2 = parse(serialize(relative2, options), options);
3590
+ relative = parse(serialize(relative, options), options);
3591
3591
  }
3592
3592
  options = options || {};
3593
- if (!options.tolerant && relative2.scheme) {
3594
- target.scheme = relative2.scheme;
3595
- target.userinfo = relative2.userinfo;
3596
- target.host = relative2.host;
3597
- target.port = relative2.port;
3598
- target.path = removeDotSegments(relative2.path || "");
3599
- target.query = relative2.query;
3593
+ if (!options.tolerant && relative.scheme) {
3594
+ target.scheme = relative.scheme;
3595
+ target.userinfo = relative.userinfo;
3596
+ target.host = relative.host;
3597
+ target.port = relative.port;
3598
+ target.path = removeDotSegments(relative.path || "");
3599
+ target.query = relative.query;
3600
3600
  } else {
3601
- if (relative2.userinfo !== void 0 || relative2.host !== void 0 || relative2.port !== void 0) {
3602
- target.userinfo = relative2.userinfo;
3603
- target.host = relative2.host;
3604
- target.port = relative2.port;
3605
- target.path = removeDotSegments(relative2.path || "");
3606
- target.query = relative2.query;
3601
+ if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
3602
+ target.userinfo = relative.userinfo;
3603
+ target.host = relative.host;
3604
+ target.port = relative.port;
3605
+ target.path = removeDotSegments(relative.path || "");
3606
+ target.query = relative.query;
3607
3607
  } else {
3608
- if (!relative2.path) {
3608
+ if (!relative.path) {
3609
3609
  target.path = base.path;
3610
- if (relative2.query !== void 0) {
3611
- target.query = relative2.query;
3610
+ if (relative.query !== void 0) {
3611
+ target.query = relative.query;
3612
3612
  } else {
3613
3613
  target.query = base.query;
3614
3614
  }
3615
3615
  } else {
3616
- if (relative2.path[0] === "/") {
3617
- target.path = removeDotSegments(relative2.path);
3616
+ if (relative.path[0] === "/") {
3617
+ target.path = removeDotSegments(relative.path);
3618
3618
  } else {
3619
3619
  if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3620
- target.path = "/" + relative2.path;
3620
+ target.path = "/" + relative.path;
3621
3621
  } else if (!base.path) {
3622
- target.path = relative2.path;
3622
+ target.path = relative.path;
3623
3623
  } else {
3624
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative2.path;
3624
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3625
3625
  }
3626
3626
  target.path = removeDotSegments(target.path);
3627
3627
  }
3628
- target.query = relative2.query;
3628
+ target.query = relative.query;
3629
3629
  }
3630
3630
  target.userinfo = base.userinfo;
3631
3631
  target.host = base.host;
@@ -3633,7 +3633,7 @@ var require_fast_uri = __commonJS({
3633
3633
  }
3634
3634
  target.scheme = base.scheme;
3635
3635
  }
3636
- target.fragment = relative2.fragment;
3636
+ target.fragment = relative.fragment;
3637
3637
  return target;
3638
3638
  }
3639
3639
  function equal(uriA, uriB, options) {
@@ -3804,7 +3804,7 @@ var require_fast_uri = __commonJS({
3804
3804
  var fastUri = {
3805
3805
  SCHEMES,
3806
3806
  normalize,
3807
- resolve: resolve2,
3807
+ resolve,
3808
3808
  resolveComponent,
3809
3809
  equal,
3810
3810
  serialize,
@@ -10279,7 +10279,7 @@ var Protocol = class {
10279
10279
  return;
10280
10280
  }
10281
10281
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
10282
- await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
10282
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
10283
10283
  options?.signal?.throwIfAborted();
10284
10284
  }
10285
10285
  } catch (error) {
@@ -10296,7 +10296,7 @@ var Protocol = class {
10296
10296
  */
10297
10297
  request(request, resultSchema, options) {
10298
10298
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
10299
- return new Promise((resolve2, reject) => {
10299
+ return new Promise((resolve, reject) => {
10300
10300
  const earlyReject = (error) => {
10301
10301
  reject(error);
10302
10302
  };
@@ -10374,7 +10374,7 @@ var Protocol = class {
10374
10374
  if (!parseResult.success) {
10375
10375
  reject(parseResult.error);
10376
10376
  } else {
10377
- resolve2(parseResult.data);
10377
+ resolve(parseResult.data);
10378
10378
  }
10379
10379
  } catch (error) {
10380
10380
  reject(error);
@@ -10635,12 +10635,12 @@ var Protocol = class {
10635
10635
  }
10636
10636
  } catch {
10637
10637
  }
10638
- return new Promise((resolve2, reject) => {
10638
+ return new Promise((resolve, reject) => {
10639
10639
  if (signal.aborted) {
10640
10640
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
10641
10641
  return;
10642
10642
  }
10643
- const timeoutId = setTimeout(resolve2, interval);
10643
+ const timeoutId = setTimeout(resolve, interval);
10644
10644
  signal.addEventListener("abort", () => {
10645
10645
  clearTimeout(timeoutId);
10646
10646
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -11600,7 +11600,7 @@ var McpServer = class {
11600
11600
  let task = createTaskResult.task;
11601
11601
  const pollInterval = task.pollInterval ?? 5e3;
11602
11602
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
11603
- await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
11603
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
11604
11604
  const updatedTask = await extra.taskStore.getTask(taskId);
11605
11605
  if (!updatedTask) {
11606
11606
  throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
@@ -12570,7 +12570,7 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
12570
12570
  });
12571
12571
  if (!chunk) {
12572
12572
  if (i === 1) {
12573
- await new Promise((resolve2) => setTimeout(resolve2));
12573
+ await new Promise((resolve) => setTimeout(resolve));
12574
12574
  maxReadCount = 3;
12575
12575
  continue;
12576
12576
  }
@@ -13047,9 +13047,9 @@ data:
13047
13047
  const initRequest = messages.find((m) => isInitializeRequest(m));
13048
13048
  const clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get("mcp-protocol-version") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
13049
13049
  if (this._enableJsonResponse) {
13050
- return new Promise((resolve2) => {
13050
+ return new Promise((resolve) => {
13051
13051
  this._streamMapping.set(streamId, {
13052
- resolveJson: resolve2,
13052
+ resolveJson: resolve,
13053
13053
  cleanup: () => {
13054
13054
  this._streamMapping.delete(streamId);
13055
13055
  }
@@ -13389,15 +13389,8 @@ var MIME_TYPES = {
13389
13389
  import fs from "fs";
13390
13390
  import path from "path";
13391
13391
 
13392
- // src/vite/index.ts
13393
- import { resolve, join, relative } from "path";
13394
- import { readdirSync, statSync, existsSync, writeFileSync, mkdirSync, rmSync, readFileSync } from "fs";
13395
- import { createServer as createNetServer } from "net";
13396
- import { createServer as createHttpServer } from "http";
13397
- import { createHash } from "crypto";
13398
- import { spawnSync } from "child_process";
13399
-
13400
13392
  // src/vite/hmr-client.ts
13393
+ var HMR_PORT_OFFSET = 1e3;
13401
13394
  var HMR_RELOAD_NOTIFICATION = "ui/notifications/hmr-reload";
13402
13395
  function generateHmrClientScript(port) {
13403
13396
  return `
@@ -13482,9 +13475,6 @@ function generateHmrClientScriptTag(port) {
13482
13475
  return `<script>${generateHmrClientScript(port)}</script>`;
13483
13476
  }
13484
13477
 
13485
- // src/vite/index.ts
13486
- var HMR_PORT_OFFSET = 1e3;
13487
-
13488
13478
  // src/server/utils.ts
13489
13479
  function svgToDataUri(svg) {
13490
13480
  const base64 = Buffer.from(svg).toString("base64");
@@ -13960,16 +13950,16 @@ var App = class {
13960
13950
  );
13961
13951
  await Promise.race([
13962
13952
  Promise.all(transportClosePromises),
13963
- new Promise((resolve2) => setTimeout(resolve2, gracefulTimeout))
13953
+ new Promise((resolve) => setTimeout(resolve, gracefulTimeout))
13964
13954
  ]);
13965
13955
  this.transports.clear();
13966
13956
  if (this.httpServer) {
13967
13957
  this.httpServer.keepAliveTimeout = keepAliveTimeout;
13968
- await new Promise((resolve2) => {
13969
- const forceClose = setTimeout(resolve2, gracefulTimeout);
13958
+ await new Promise((resolve) => {
13959
+ const forceClose = setTimeout(resolve, gracefulTimeout);
13970
13960
  this.httpServer?.close(() => {
13971
13961
  clearTimeout(forceClose);
13972
- resolve2();
13962
+ resolve();
13973
13963
  });
13974
13964
  });
13975
13965
  this.httpServer = null;
@@ -14618,12 +14608,10 @@ var App = class {
14618
14608
  },
14619
14609
  async (args) => {
14620
14610
  try {
14621
- console.log(`[DEBUG SDK] Tool ${name} received args._instanceId:`, args._instanceId, `type:`, typeof args._instanceId);
14622
14611
  const input = config.input ? config.input.parse(args) : args;
14623
14612
  let instanceId;
14624
14613
  if (hasUi && config.ui) {
14625
14614
  instanceId = this.resolveInstanceId(args._instanceId);
14626
- console.log(`[DEBUG SDK] Resolved instanceId: input=${args._instanceId} \u2192 output=${instanceId}`);
14627
14615
  }
14628
14616
  const resource = config.ui ? this.resources.get(config.ui) : void 0;
14629
14617
  const hasWebSocket = resource?.config.experimental?.websocket === true;