@moxt-ai/mobius 0.0.119 → 0.0.120

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/dist/index.js CHANGED
@@ -41394,7 +41394,7 @@ var DaemonOperationState = class {
41394
41394
  const existing = this.#executions.get(commandId);
41395
41395
  if (existing !== void 0) {
41396
41396
  if (existing.sessionId !== sessionId || existing.commandHash !== commandHash) {
41397
- throw new Error("The daemon command identity conflicts with its in-memory receipt");
41397
+ return { kind: "conflict" };
41398
41398
  }
41399
41399
  return { attemptId: existing.attemptId, commandId, kind: "duplicate", state: existing.state };
41400
41400
  }
@@ -42231,10 +42231,28 @@ async function runRelayConnection(config2, directories, audit, sessions, install
42231
42231
  throw new Error("Unsupported protocol message");
42232
42232
  }
42233
42233
  const command = message;
42234
- if (activeTurns.has(command.commandId)) {
42234
+ const receipt = operations.claimExecution(
42235
+ command.commandId,
42236
+ command.sessionId,
42237
+ encodeSessionPromptCommand(command)
42238
+ );
42239
+ if (receipt.kind === "conflict") {
42240
+ const code = "command_identity_conflict";
42241
+ audit.record({
42242
+ commandId: command.commandId,
42243
+ details: { code },
42244
+ event: "session_prompt_rejected",
42245
+ sessionId: command.sessionId
42246
+ });
42247
+ send(socket, {
42248
+ code,
42249
+ requestId: command.commandId,
42250
+ kind: "session.operation.failed",
42251
+ message: "This command identifier was already used for a different request.",
42252
+ sessionId: command.sessionId
42253
+ });
42235
42254
  return;
42236
42255
  }
42237
- const receipt = operations.claimExecution(command.commandId, command.sessionId, encoded);
42238
42256
  if (receipt.kind === "duplicate") {
42239
42257
  return;
42240
42258
  }