@agentvault/muse-bridge 0.1.0 → 0.1.1

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 (2) hide show
  1. package/dist/index.js +31 -43
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -17423,7 +17423,7 @@ var init_dist = __esm({
17423
17423
  }
17424
17424
  }
17425
17425
  _Module = Module;
17426
- Module.ready = new Promise(function(resolve32, reject) {
17426
+ Module.ready = new Promise(function(resolve3, reject) {
17427
17427
  var Module2 = _Module;
17428
17428
  Module2.onAbort = reject;
17429
17429
  Module2.print = function(what) {
@@ -17435,7 +17435,7 @@ var init_dist = __esm({
17435
17435
  Module2.onRuntimeInitialized = function() {
17436
17436
  try {
17437
17437
  Module2._crypto_secretbox_keybytes();
17438
- resolve32();
17438
+ resolve3();
17439
17439
  } catch (err2) {
17440
17440
  reject(err2);
17441
17441
  }
@@ -63990,8 +63990,8 @@ var init_dist = __esm({
63990
63990
  }
63991
63991
  async lock() {
63992
63992
  let releaseLock;
63993
- const nextLock = new Promise((resolve32) => {
63994
- releaseLock = resolve32;
63993
+ const nextLock = new Promise((resolve3) => {
63994
+ releaseLock = resolve3;
63995
63995
  });
63996
63996
  const previousLock = __classPrivateFieldGet(this, _Mutex_locked, "f");
63997
63997
  __classPrivateFieldSet(this, _Mutex_locked, nextLock, "f");
@@ -70191,7 +70191,7 @@ var init_dist = __esm({
70191
70191
  * Optional timeout rejects with an Error.
70192
70192
  */
70193
70193
  waitForDecision(decisionId, timeoutMs) {
70194
- return new Promise((resolve32, reject) => {
70194
+ return new Promise((resolve3, reject) => {
70195
70195
  let timer = null;
70196
70196
  const handler = (plaintext, metadata) => {
70197
70197
  if (metadata.messageType !== "decision_response") return;
@@ -70200,7 +70200,7 @@ var init_dist = __esm({
70200
70200
  if (parsed.decision?.decision_id === decisionId) {
70201
70201
  if (timer) clearTimeout(timer);
70202
70202
  this.removeListener("message", handler);
70203
- resolve32({
70203
+ resolve3({
70204
70204
  decision_id: parsed.decision.decision_id,
70205
70205
  selected_option_id: parsed.decision.selected_option_id,
70206
70206
  resolved_at: parsed.decision.resolved_at,
@@ -87277,7 +87277,7 @@ ${actionsText}`);
87277
87277
  return;
87278
87278
  }
87279
87279
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
87280
- await new Promise((resolve32) => setTimeout(resolve32, pollInterval));
87280
+ await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
87281
87281
  options?.signal?.throwIfAborted();
87282
87282
  }
87283
87283
  } catch (error2) {
@@ -87294,7 +87294,7 @@ ${actionsText}`);
87294
87294
  */
87295
87295
  request(request, resultSchema, options) {
87296
87296
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
87297
- return new Promise((resolve32, reject) => {
87297
+ return new Promise((resolve3, reject) => {
87298
87298
  const earlyReject = (error2) => {
87299
87299
  reject(error2);
87300
87300
  };
@@ -87372,7 +87372,7 @@ ${actionsText}`);
87372
87372
  if (!parseResult.success) {
87373
87373
  reject(parseResult.error);
87374
87374
  } else {
87375
- resolve32(parseResult.data);
87375
+ resolve3(parseResult.data);
87376
87376
  }
87377
87377
  } catch (error2) {
87378
87378
  reject(error2);
@@ -87633,12 +87633,12 @@ ${actionsText}`);
87633
87633
  }
87634
87634
  } catch {
87635
87635
  }
87636
- return new Promise((resolve32, reject) => {
87636
+ return new Promise((resolve3, reject) => {
87637
87637
  if (signal.aborted) {
87638
87638
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
87639
87639
  return;
87640
87640
  }
87641
- const timeoutId = setTimeout(resolve32, interval);
87641
+ const timeoutId = setTimeout(resolve3, interval);
87642
87642
  signal.addEventListener("abort", () => {
87643
87643
  clearTimeout(timeoutId);
87644
87644
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -90623,7 +90623,7 @@ ${actionsText}`);
90623
90623
  const schOrFunc = root3.refs[ref];
90624
90624
  if (schOrFunc)
90625
90625
  return schOrFunc;
90626
- let _sch = resolve32.call(this, root3, ref);
90626
+ let _sch = resolve3.call(this, root3, ref);
90627
90627
  if (_sch === void 0) {
90628
90628
  const schema = (_a3 = root3.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
90629
90629
  const { schemaId } = this.opts;
@@ -90650,7 +90650,7 @@ ${actionsText}`);
90650
90650
  function sameSchemaEnv(s1, s2) {
90651
90651
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
90652
90652
  }
90653
- function resolve32(root3, ref) {
90653
+ function resolve3(root3, ref) {
90654
90654
  let sch;
90655
90655
  while (typeof (sch = this.refs[ref]) == "string")
90656
90656
  ref = sch;
@@ -91217,7 +91217,7 @@ ${actionsText}`);
91217
91217
  }
91218
91218
  return uri;
91219
91219
  }
91220
- function resolve32(baseURI, relativeURI, options) {
91220
+ function resolve3(baseURI, relativeURI, options) {
91221
91221
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
91222
91222
  const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
91223
91223
  schemelessOptions.skipEscape = true;
@@ -91444,7 +91444,7 @@ ${actionsText}`);
91444
91444
  var fastUri = {
91445
91445
  SCHEMES,
91446
91446
  normalize,
91447
- resolve: resolve32,
91447
+ resolve: resolve3,
91448
91448
  resolveComponent,
91449
91449
  equal,
91450
91450
  serialize,
@@ -95281,7 +95281,7 @@ ${actionsText}`);
95281
95281
  let task = createTaskResult.task;
95282
95282
  const pollInterval = task.pollInterval ?? 5e3;
95283
95283
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
95284
- await new Promise((resolve32) => setTimeout(resolve32, pollInterval));
95284
+ await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
95285
95285
  const updatedTask = await extra.taskStore.getTask(taskId);
95286
95286
  if (!updatedTask) {
95287
95287
  throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
@@ -96145,7 +96145,7 @@ ${actionsText}`);
96145
96145
  });
96146
96146
  if (!chunk) {
96147
96147
  if (i2 === 1) {
96148
- await new Promise((resolve32) => setTimeout(resolve32));
96148
+ await new Promise((resolve3) => setTimeout(resolve3));
96149
96149
  maxReadCount = 3;
96150
96150
  continue;
96151
96151
  }
@@ -96644,9 +96644,9 @@ data:
96644
96644
  const initRequest = messages.find((m2) => isInitializeRequest(m2));
96645
96645
  const clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get("mcp-protocol-version") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
96646
96646
  if (this._enableJsonResponse) {
96647
- return new Promise((resolve32) => {
96647
+ return new Promise((resolve3) => {
96648
96648
  this._streamMapping.set(streamId, {
96649
- resolveJson: resolve32,
96649
+ resolveJson: resolve3,
96650
96650
  cleanup: () => {
96651
96651
  this._streamMapping.delete(streamId);
96652
96652
  }
@@ -97369,8 +97369,6 @@ data:
97369
97369
  init_config();
97370
97370
  init_log();
97371
97371
  import { chmodSync as chmodSync5, mkdirSync as mkdirSync6 } from "node:fs";
97372
- import { resolve as resolve3 } from "node:path";
97373
- import { pathToFileURL } from "node:url";
97374
97372
 
97375
97373
  // src/fence-auth.ts
97376
97374
  import { copyFileSync, chmodSync as chmodSync2, existsSync as existsSync2, mkdirSync as mkdirSync2 } from "node:fs";
@@ -97648,7 +97646,7 @@ var MuseDriver = class {
97648
97646
  }
97649
97647
  }
97650
97648
  execJsonl(spawn2) {
97651
- return new Promise((resolve4, reject) => {
97649
+ return new Promise((resolve3, reject) => {
97652
97650
  let reaped = false;
97653
97651
  let timedOut = false;
97654
97652
  let buf = "";
@@ -97672,7 +97670,7 @@ var MuseDriver = class {
97672
97670
  }
97673
97671
  const spoke = this.current?.spoke ?? false;
97674
97672
  if (terminal?.ok === true) {
97675
- resolve4({ text: terminal.text, spoke });
97673
+ resolve3({ text: terminal.text, spoke });
97676
97674
  return;
97677
97675
  }
97678
97676
  if (terminal?.ok === false) {
@@ -97775,7 +97773,7 @@ function onData(stream, fn) {
97775
97773
  stream?.on("data", fn);
97776
97774
  }
97777
97775
  function collectOutput(child) {
97778
- return new Promise((resolve4, reject) => {
97776
+ return new Promise((resolve3, reject) => {
97779
97777
  let stdout = "";
97780
97778
  let stderr = "";
97781
97779
  let settled = false;
@@ -97794,18 +97792,18 @@ function collectOutput(child) {
97794
97792
  finish(() => reject(err instanceof Error ? err : new Error(String(err))));
97795
97793
  });
97796
97794
  child.on("exit", () => {
97797
- finish(() => resolve4(stdout + stderr));
97795
+ finish(() => resolve3(stdout + stderr));
97798
97796
  });
97799
97797
  });
97800
97798
  }
97801
97799
  function waitForExit(child, ms) {
97802
- return new Promise((resolve4) => {
97800
+ return new Promise((resolve3) => {
97803
97801
  let done = false;
97804
97802
  const finish = (value) => {
97805
97803
  if (done) return;
97806
97804
  done = true;
97807
97805
  clearTimeout(timer);
97808
- resolve4(value);
97806
+ resolve3(value);
97809
97807
  };
97810
97808
  const timer = setTimeout(() => finish(false), ms);
97811
97809
  child.on("exit", () => finish(true));
@@ -98073,9 +98071,9 @@ data: ${JSON.stringify(out)}
98073
98071
  res.writeHead(200, { "content-type": "application/json", ...extra }).end(JSON.stringify(out));
98074
98072
  });
98075
98073
  }
98076
- await new Promise((resolve4, reject) => {
98074
+ await new Promise((resolve3, reject) => {
98077
98075
  server.once("error", reject);
98078
- server.listen(0, "127.0.0.1", () => resolve4());
98076
+ server.listen(0, "127.0.0.1", () => resolve3());
98079
98077
  });
98080
98078
  const addr = server.address();
98081
98079
  if (!addr || typeof addr === "string") throw new Error("room MCP server failed to bind");
@@ -98086,8 +98084,8 @@ data: ${JSON.stringify(out)}
98086
98084
  token,
98087
98085
  seenMethods: () => [...seen],
98088
98086
  seenHttp: () => traces.map((t2) => ({ ...t2 })),
98089
- close: () => new Promise((resolve4) => {
98090
- server.close(() => resolve4());
98087
+ close: () => new Promise((resolve3) => {
98088
+ server.close(() => resolve3());
98091
98089
  server.closeAllConnections?.();
98092
98090
  })
98093
98091
  };
@@ -98273,7 +98271,7 @@ function mkdir700(path2) {
98273
98271
  chmodSync5(path2, 448);
98274
98272
  }
98275
98273
  function packageVersion() {
98276
- return true ? "0.1.0" : void 0;
98274
+ return true ? "0.1.1" : void 0;
98277
98275
  }
98278
98276
  function helpText(version2) {
98279
98277
  return [
@@ -98432,17 +98430,7 @@ async function main(opts = {}) {
98432
98430
  shuttingDown: () => shuttingDown
98433
98431
  };
98434
98432
  }
98435
- function launchedAsCli() {
98436
- if (process.env.VITEST) return false;
98437
- const entry = process.argv[1];
98438
- if (!entry) return false;
98439
- try {
98440
- return import.meta.url === pathToFileURL(resolve3(entry)).href;
98441
- } catch {
98442
- return false;
98443
- }
98444
- }
98445
- if (launchedAsCli()) {
98433
+ if (!process.env.VITEST) {
98446
98434
  main().catch((err) => {
98447
98435
  logLine("[muse-bridge] fatal:", err);
98448
98436
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/muse-bridge",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "AgentVault Muse Bridge — daemon bridging a Muse agent into E2E-encrypted AgentVault direct messages and rooms.",
6
6
  "main": "dist/index.js",