@moxt-ai/mobius 0.0.371 → 0.0.372

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __commonJS
3
- } from "./chunk-MS57BIBB.js";
3
+ } from "./chunk-ZMTQTDLO.js";
4
4
 
5
5
  // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
6
6
  var require_constants = __commonJS({
@@ -1999,4 +1999,4 @@ var require_semver2 = __commonJS({
1999
1999
  export {
2000
2000
  require_semver2 as require_semver
2001
2001
  };
2002
- //# sourceMappingURL=chunk-XQEFITZA.js.map
2002
+ //# sourceMappingURL=chunk-FTB53NU4.js.map
@@ -3,7 +3,7 @@ import {
3
3
  __export,
4
4
  __using,
5
5
  package_default
6
- } from "./chunk-MS57BIBB.js";
6
+ } from "./chunk-ZMTQTDLO.js";
7
7
 
8
8
  // src/engine/runtime/relay/runtime-revocation.ts
9
9
  var runtimeRevocationCloseCode = 1008;
@@ -87061,6 +87061,7 @@ var ActiveExecutions = class {
87061
87061
  // src/engine/session/manager/session-manager.ts
87062
87062
  var SESSION_CONTROL_TIMEOUT_MILLISECONDS = 3e4;
87063
87063
  var SESSION_CLOSE_TIMEOUT_MILLISECONDS = 3e4;
87064
+ var nativeOperationKey = (agentId, nativeSessionId) => `${agentId}:${nativeSessionId}`;
87064
87065
  var SessionManager2 = class {
87065
87066
  #operations = new RuntimeOperations();
87066
87067
  #processes;
@@ -87113,7 +87114,7 @@ var SessionManager2 = class {
87113
87114
  return false;
87114
87115
  }
87115
87116
  const stored = this.#store.read(sessionId);
87116
- return stored instanceof FoundStoredSession && this.#nativeOperations.has(`${stored.session.agentId}:${stored.session.nativeSessionId}`);
87117
+ return stored instanceof FoundStoredSession && this.#nativeOperations.has(nativeOperationKey(stored.session.agentId, stored.session.nativeSessionId));
87117
87118
  }
87118
87119
  #retention(sessionId) {
87119
87120
  return {
@@ -87326,8 +87327,10 @@ var SessionManager2 = class {
87326
87327
  } else {
87327
87328
  this.#assertOpen(options2.sessionId);
87328
87329
  }
87329
- const stored = metrics.measureSync("session-state-read", () => this.#store.read(options2.sessionId));
87330
- if (stored instanceof FoundStoredSession && this.#nativeOperations.has(`${stored.session.agentId}:${stored.session.nativeSessionId}`)) {
87330
+ if (metrics.measureSync(
87331
+ "session-state-read",
87332
+ () => this.#isNativeSessionOperationActive(options2.sessionId)
87333
+ )) {
87331
87334
  throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
87332
87335
  }
87333
87336
  const pending = this.#executionProcesses.pending(options2.sessionId);
@@ -87570,8 +87573,7 @@ var SessionManager2 = class {
87570
87573
  });
87571
87574
  runPrompt = async (options) => this.#operations.run(options, async (options2) => {
87572
87575
  this.#assertOpen(options2.sessionId);
87573
- const stored = this.#store.read(options2.sessionId);
87574
- if (stored instanceof FoundStoredSession && this.#nativeOperations.has(`${stored.session.agentId}:${stored.session.nativeSessionId}`)) {
87576
+ if (this.#isNativeSessionOperationActive(options2.sessionId)) {
87575
87577
  throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
87576
87578
  }
87577
87579
  this.#executions.begin(options2.sessionId, options2.commandId);
@@ -87585,7 +87587,7 @@ var SessionManager2 = class {
87585
87587
  return { stopReason: "cancelled" };
87586
87588
  }
87587
87589
  const runtime = await this.ensureSession(options2);
87588
- if (this.#nativeOperations.has(`${options2.agent.id}:${runtime.nativeSessionId()}`)) {
87590
+ if (this.#nativeOperations.has(nativeOperationKey(options2.agent.id, runtime.nativeSessionId()))) {
87589
87591
  throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
87590
87592
  }
87591
87593
  if (this.#executions.cancellation(options2.sessionId) !== void 0) {
@@ -87783,7 +87785,7 @@ var SessionManager2 = class {
87783
87785
  });
87784
87786
  /** Coordinates native-reader conflicts without owning the harness query. */
87785
87787
  withNativeSessionOperation = async (options, nativeSessionId, operation) => this.#operations.run(options, async (options2) => {
87786
- const key = `${options2.agent.id}:${nativeSessionId}`;
87788
+ const key = nativeOperationKey(options2.agent.id, nativeSessionId);
87787
87789
  if (this.#nativeOperations.has(key)) {
87788
87790
  throw new AcpExecutionError(
87789
87791
  "Wait for the native session's running operation to finish",
@@ -87812,7 +87814,7 @@ var SessionManager2 = class {
87812
87814
  return { ...options, ...resolved, sessionId };
87813
87815
  }
87814
87816
  openNativeSession = async (options, origin, resolveAgent) => this.#operations.run(options, async (options2) => {
87815
- const key = `${options2.agent.id}:${origin.nativeSessionId}`;
87817
+ const key = nativeOperationKey(options2.agent.id, origin.nativeSessionId);
87816
87818
  if (this.#nativeOperations.has(key)) {
87817
87819
  throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
87818
87820
  }
@@ -87863,7 +87865,7 @@ var SessionManager2 = class {
87863
87865
  this.#nativeOperations.add(key);
87864
87866
  try {
87865
87867
  const runtime = await this.#startPreparation({ ...target, origin }, { kind: "interactive-only" });
87866
- const openedKey = `${options2.agent.id}:${runtime.nativeSessionId()}`;
87868
+ const openedKey = nativeOperationKey(options2.agent.id, runtime.nativeSessionId());
87867
87869
  this.#nativeOperations.add(openedKey);
87868
87870
  try {
87869
87871
  const prepared = runtime.prepared();
@@ -93589,4 +93591,4 @@ export {
93589
93591
  * MIT Licensed
93590
93592
  *)
93591
93593
  */
93592
- //# sourceMappingURL=chunk-23EBYYOU.js.map
93594
+ //# sourceMappingURL=chunk-LLUMIVEG.js.map