@moxt-ai/mobius 0.0.108 → 0.0.110

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 (33) hide show
  1. package/dist/acp/process-session.d.ts +0 -1
  2. package/dist/acp/process-session.d.ts.map +1 -1
  3. package/dist/acp/process-session.js +0 -9
  4. package/dist/acp/process-session.js.map +1 -1
  5. package/dist/acp/session-manager.d.ts +1 -3
  6. package/dist/acp/session-manager.d.ts.map +1 -1
  7. package/dist/acp/session-manager.js +4 -37
  8. package/dist/acp/session-manager.js.map +1 -1
  9. package/dist/cli.js +22 -115
  10. package/dist/cli.js.map +2 -2
  11. package/dist/index.js +21 -114
  12. package/dist/index.js.map +2 -2
  13. package/dist/native-sessions/acp-adapter.d.ts.map +1 -1
  14. package/dist/native-sessions/acp-adapter.js +0 -1
  15. package/dist/native-sessions/acp-adapter.js.map +1 -1
  16. package/dist/native-sessions/agent-adapter.d.ts +0 -1
  17. package/dist/native-sessions/agent-adapter.d.ts.map +1 -1
  18. package/dist/native-sessions/agent-adapter.js +0 -3
  19. package/dist/native-sessions/agent-adapter.js.map +1 -1
  20. package/dist/native-sessions/codex-adapter.d.ts.map +1 -1
  21. package/dist/native-sessions/codex-adapter.js +0 -1
  22. package/dist/native-sessions/codex-adapter.js.map +1 -1
  23. package/dist/native-sessions/handle-native-requests.js +1 -1
  24. package/dist/native-sessions/handle-native-requests.js.map +1 -1
  25. package/dist/native-sessions/service.d.ts.map +1 -1
  26. package/dist/native-sessions/service.js +2 -40
  27. package/dist/native-sessions/service.js.map +1 -1
  28. package/dist/run-daemon.d.ts.map +1 -1
  29. package/dist/run-daemon.js +17 -1
  30. package/dist/run-daemon.js.map +1 -1
  31. package/dist/runtime.js +21 -114
  32. package/dist/runtime.js.map +2 -2
  33. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3381,7 +3381,7 @@ var program = new Command();
3381
3381
  // package.json
3382
3382
  var package_default = {
3383
3383
  name: "@moxt-ai/mobius",
3384
- version: "0.0.108",
3384
+ version: "0.0.110",
3385
3385
  description: "Mobius CLI for pairing and running local AI agent services.",
3386
3386
  type: "module",
3387
3387
  bin: {
@@ -29112,7 +29112,6 @@ var identity = {
29112
29112
  };
29113
29113
  var nativeSessionRequestSchema = external_exports.discriminatedUnion("action", [
29114
29114
  external_exports.strictObject({ ...identity, action: external_exports.literal("create") }).readonly(),
29115
- external_exports.strictObject({ ...identity, action: external_exports.literal("linked-history"), targetSessionId: identifier }).readonly(),
29116
29115
  external_exports.strictObject({ ...identity, action: external_exports.literal("active-turn"), targetSessionId: identifier }).readonly(),
29117
29116
  external_exports.strictObject({ ...identity, action: external_exports.literal("preview"), entryId: identifier }).readonly(),
29118
29117
  external_exports.strictObject({ ...identity, action: external_exports.literal("history"), entryId: identifier }).readonly(),
@@ -29136,7 +29135,6 @@ var nativeSessionRequestSchema = external_exports.discriminatedUnion("action", [
29136
29135
  ]);
29137
29136
  var nativeSessionCommandSchema = external_exports.discriminatedUnion("action", [
29138
29137
  external_exports.strictObject({ ...identity, action: external_exports.literal("create") }).readonly(),
29139
- external_exports.strictObject({ ...identity, action: external_exports.literal("linked-history"), targetSessionId: identifier }).readonly(),
29140
29138
  external_exports.strictObject({ ...identity, action: external_exports.literal("active-turn"), targetSessionId: identifier }).readonly(),
29141
29139
  external_exports.strictObject({ ...identity, action: external_exports.literal("preview"), entryId: identifier }).readonly(),
29142
29140
  external_exports.strictObject({ ...identity, action: external_exports.literal("history"), entryId: identifier }).readonly(),
@@ -29152,12 +29150,6 @@ var nativeSessionCommandSchema = external_exports.discriminatedUnion("action", [
29152
29150
  entryId: identifier,
29153
29151
  targetSessionId: identifier
29154
29152
  }).readonly(),
29155
- external_exports.strictObject({
29156
- ...identity,
29157
- action: external_exports.enum(["import-only", "fork-only"]),
29158
- entryId: identifier,
29159
- targetSessionId: identifier
29160
- }).readonly(),
29161
29153
  external_exports.strictObject({
29162
29154
  ...identity,
29163
29155
  action: external_exports.literal("delete"),
@@ -29180,12 +29172,6 @@ var resultEnvelope = {
29180
29172
  };
29181
29173
  var nativeSessionResultSchema = external_exports.discriminatedUnion("action", [
29182
29174
  external_exports.strictObject({ ...resultEnvelope, action: external_exports.literal("create"), nativeSessionId: identifier }).readonly(),
29183
- external_exports.strictObject({
29184
- ...resultEnvelope,
29185
- action: external_exports.literal("linked-history"),
29186
- targetSessionId: identifier,
29187
- history: sessionHistorySchema
29188
- }).readonly(),
29189
29175
  external_exports.strictObject({
29190
29176
  ...resultEnvelope,
29191
29177
  action: external_exports.literal("active-turn"),
@@ -29204,11 +29190,6 @@ var nativeSessionResultSchema = external_exports.discriminatedUnion("action", [
29204
29190
  state: external_exports.literal("running")
29205
29191
  }).readonly().nullable()
29206
29192
  }).readonly(),
29207
- external_exports.strictObject({
29208
- ...resultEnvelope,
29209
- action: external_exports.literal("unlinked-history"),
29210
- targetSessionId: identifier
29211
- }).readonly(),
29212
29193
  external_exports.strictObject({
29213
29194
  ...resultEnvelope,
29214
29195
  action: external_exports.literal("find"),
@@ -29226,7 +29207,6 @@ var nativeSessionResultSchema = external_exports.discriminatedUnion("action", [
29226
29207
  action: external_exports.enum(["import", "fork"]),
29227
29208
  targetSessionId: identifier,
29228
29209
  ready: sessionReadyEventSchema,
29229
- history: sessionHistorySchema,
29230
29210
  title: external_exports.string().max(500)
29231
29211
  }).readonly(),
29232
29212
  external_exports.strictObject({
@@ -32353,15 +32333,6 @@ var PendingElicitation = class {
32353
32333
  var PROCESS_STOP_TIMEOUT_MILLISECONDS = 1e3;
32354
32334
  var MAX_PRE_SESSION_UPDATES = 100;
32355
32335
  var MAX_PRE_SESSION_UPDATE_BYTES = 1024 * 1024;
32356
- function nativeHistoryNotRetained() {
32357
- return {
32358
- cause: {
32359
- code: "native_history_not_retained",
32360
- message: "Native message history is not retained in the cloud for this Session."
32361
- },
32362
- status: "unavailable"
32363
- };
32364
- }
32365
32336
  var NullAcpSessionObserver = class {
32366
32337
  onCommands = () => Promise.resolve();
32367
32338
  onConfig = () => Promise.resolve();
@@ -34108,7 +34079,7 @@ var AcpSessionManager = class {
34108
34079
  return await this.#startRetainedSessionProcess(
34109
34080
  options,
34110
34081
  async () => await AcpProcessSession.start(
34111
- this.#sessionIdentity === "native" && isNativeChatSessionId(options.agent.id, options.sessionId) && this.#store.read(options.sessionId) instanceof MissingAcpStoredSession ? { ...options, origin: { kind: "import", nativeSessionId: options.sessionId } } : options,
34082
+ options.origin === void 0 && this.#sessionIdentity === "native" && isNativeChatSessionId(options.agent.id, options.sessionId) && this.#store.read(options.sessionId) instanceof MissingAcpStoredSession ? { ...options, origin: { kind: "import", nativeSessionId: options.sessionId } } : options,
34112
34083
  () => this.#observer,
34113
34084
  this.#store,
34114
34085
  metrics
@@ -34651,26 +34622,7 @@ var AcpSessionManager = class {
34651
34622
  this.#endSessionUse(options.sessionId);
34652
34623
  }
34653
34624
  };
34654
- loadLinkedSessionHistory = async (options) => {
34655
- options.signal.throwIfAborted();
34656
- const stored = this.#store.read(options.sessionId);
34657
- if (!(stored instanceof FoundAcpStoredSession) || !stored.session.prompted) {
34658
- return null;
34659
- }
34660
- const linked = stored.session;
34661
- if (linked.agentId !== options.agent.id || linked.cwd !== options.cwd || linked.additionalDirectories.length !== options.additionalDirectories.length || linked.additionalDirectories.some((directory, index) => directory !== options.additionalDirectories[index])) {
34662
- throw new AcpExecutionError(
34663
- "The session belongs to another Agent or workspace",
34664
- {},
34665
- "session_identity_mismatch"
34666
- );
34667
- }
34668
- if (this.#nativeHistoryReader === null) {
34669
- return await this.loadSessionHistory(options);
34670
- }
34671
- return await this.#nativeHistoryReader.read(options, linked.nativeSessionId) ?? await this.loadSessionHistory(options);
34672
- };
34673
- openNativeSession = async (options, origin, loadHistory) => {
34625
+ openNativeSession = async (options, origin) => {
34674
34626
  const key = `${options.agent.id}:${origin.nativeSessionId}`;
34675
34627
  if (this.#nativeOperations.has(key)) {
34676
34628
  throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
@@ -34700,19 +34652,10 @@ var AcpSessionManager = class {
34700
34652
  }
34701
34653
  this.#nativeOperations.add(key);
34702
34654
  try {
34703
- const history = loadHistory ? await runtime.loadHistory(options.signal) : nativeHistoryNotRetained();
34704
34655
  return {
34705
34656
  prepared: runtime.prepared(),
34706
- sessionId: existing.sessionId,
34707
- history
34657
+ sessionId: existing.sessionId
34708
34658
  };
34709
- } catch (error62) {
34710
- await this.#retireSessionProcess(
34711
- existing.sessionId,
34712
- runtime,
34713
- async () => await runtime.closeProcess()
34714
- );
34715
- throw error62;
34716
34659
  } finally {
34717
34660
  this.#nativeOperations.delete(key);
34718
34661
  this.#notifyProcessCapacityChanged();
@@ -34731,16 +34674,10 @@ var AcpSessionManager = class {
34731
34674
  const openedKey = `${options.agent.id}:${runtime.nativeSessionId()}`;
34732
34675
  this.#nativeOperations.add(openedKey);
34733
34676
  try {
34734
- const history = loadHistory ? await runtime.loadHistory(options.signal) : nativeHistoryNotRetained();
34735
34677
  return {
34736
34678
  sessionId: options.sessionId,
34737
- prepared: runtime.prepared(),
34738
- history
34679
+ prepared: runtime.prepared()
34739
34680
  };
34740
- } catch (error62) {
34741
- this.#store.remove(options.sessionId);
34742
- await this.#retireSessionProcess(options.sessionId, runtime, async () => await runtime.closeProcess());
34743
- throw error62;
34744
34681
  } finally {
34745
34682
  this.#nativeOperations.delete(openedKey);
34746
34683
  this.#notifyProcessCapacityChanged();
@@ -38337,7 +38274,7 @@ function createNativeSessionRequestHandler(dependencies) {
38337
38274
  };
38338
38275
  const handle = (command) => {
38339
38276
  const previous = [...pending.values()].filter((request) => request.agentId === command.agentId);
38340
- const parallelRead = command.action === "linked-history" || command.action === "active-turn";
38277
+ const parallelRead = command.action === "active-turn";
38341
38278
  if (pending.has(command.requestId) || pending.size >= 4 || !parallelRead && previous.some((request) => !request.controller.signal.aborted)) {
38342
38279
  reportOperationFailure(
38343
38280
  socket,
@@ -38456,7 +38393,6 @@ async function readAcpHistory(sessions, directories, bindingId, options, nativeS
38456
38393
 
38457
38394
  // src/native-sessions/acp-adapter.ts
38458
38395
  var acpSessionAdapter = {
38459
- linkedHistory: async ({ sessions, directories, bindingId, options, nativeSessionId }) => await readAcpHistory(sessions, directories, bindingId, options, nativeSessionId),
38460
38396
  history: async ({ sessions, directories, bindingId, options, nativeSessionId }) => await readAcpHistory(sessions, directories, bindingId, options, nativeSessionId),
38461
38397
  preview: async ({ sessions, options, nativeSessionId }) => await sessions.previewNativeSession(options, nativeSessionId)
38462
38398
  };
@@ -38476,7 +38412,6 @@ async function verifiedHistory(context, full) {
38476
38412
  return snapshot.history;
38477
38413
  }
38478
38414
  var codexSessionAdapter = {
38479
- linkedHistory: async (context) => await verifiedHistory(context, true),
38480
38415
  history: async (context) => await verifiedHistory(context, true),
38481
38416
  // Codex enforces an exclusive writer per thread. Its read-only app-server
38482
38417
  // history path keeps externally owned conversations previewable.
@@ -38485,9 +38420,6 @@ var codexSessionAdapter = {
38485
38420
 
38486
38421
  // src/native-sessions/agent-adapter.ts
38487
38422
  var genericSessionAdapter = {
38488
- linkedHistory: async () => {
38489
- throw new AcpExecutionError("This Agent does not support Chat history", {}, "native_session_unsupported");
38490
- },
38491
38423
  history: async () => {
38492
38424
  throw new AcpExecutionError("Native history is unavailable for this Agent", {}, "native_session_unsupported");
38493
38425
  },
@@ -38547,42 +38479,6 @@ var NativeSessionService = class {
38547
38479
  turn: this.#activeTurn(command)
38548
38480
  };
38549
38481
  }
38550
- if (command.action === "linked-history") {
38551
- const nativeSessionId = nativeSessionIdSchema.parse(command.targetSessionId);
38552
- if (this.#sessions.hasPreparedSession(nativeSessionId, options.agent.id, cwd, additionalDirectories) && await this.#sessions.loadLinkedSessionHistory({ ...options, sessionId: nativeSessionId }) === null) {
38553
- this.record(command, "native_session_history_read");
38554
- return {
38555
- action: "linked-history",
38556
- history: {
38557
- status: "available",
38558
- messages: [],
38559
- truncated: false,
38560
- coveredCommandIds: [],
38561
- coveredMessageIds: []
38562
- },
38563
- kind: "native.session.result",
38564
- requestId: command.requestId,
38565
- sessionId: command.sessionId,
38566
- targetSessionId: command.targetSessionId
38567
- };
38568
- }
38569
- const history = await nativeSessionAdapter(options.agent.id).linkedHistory({
38570
- sessions: this.#sessions,
38571
- directories: this.#directories,
38572
- bindingId: command.bindingId,
38573
- options,
38574
- nativeSessionId
38575
- });
38576
- this.record(command, "native_session_history_read");
38577
- return {
38578
- action: "linked-history",
38579
- history,
38580
- kind: "native.session.result",
38581
- requestId: command.requestId,
38582
- sessionId: command.sessionId,
38583
- targetSessionId: command.targetSessionId
38584
- };
38585
- }
38586
38482
  if (command.action === "create") {
38587
38483
  if (!supportsNativeChat(options.agent.id)) {
38588
38484
  throw new AcpExecutionError(
@@ -38793,7 +38689,7 @@ var NativeSessionService = class {
38793
38689
  deletedSessionIds
38794
38690
  };
38795
38691
  }
38796
- const action = command.action === "import-only" ? "import" : command.action === "fork-only" ? "fork" : command.action;
38692
+ const action = command.action;
38797
38693
  if (action === "import" && !prepared.capabilities.loadSession && !prepared.capabilities.resumeSession) {
38798
38694
  throw new AcpExecutionError("This Agent cannot import native sessions", {}, "native_session_unsupported");
38799
38695
  }
@@ -38818,8 +38714,7 @@ var NativeSessionService = class {
38818
38714
  sessionId: command.targetSessionId,
38819
38715
  additionalDirectories: target.additionalDirectories
38820
38716
  },
38821
- { kind: action, nativeSessionId: target.info.sessionId },
38822
- command.action !== "import-only" && command.action !== "fork-only"
38717
+ { kind: action, nativeSessionId: target.info.sessionId }
38823
38718
  );
38824
38719
  signal.throwIfAborted();
38825
38720
  const ready = {
@@ -38843,8 +38738,7 @@ var NativeSessionService = class {
38843
38738
  action,
38844
38739
  ready,
38845
38740
  targetSessionId: command.targetSessionId,
38846
- title: target.info.title ?? "Untitled session",
38847
- history: opened.history
38741
+ title: target.info.title ?? "Untitled session"
38848
38742
  };
38849
38743
  };
38850
38744
  querySessions = async (sessionIds, signal) => {
@@ -39851,6 +39745,19 @@ async function runRelayConnection(config2, directories, audit, sessions, install
39851
39745
  );
39852
39746
  return;
39853
39747
  }
39748
+ if (kind === SESSION_QUERY_KIND) {
39749
+ const command2 = message;
39750
+ void nativeSessions.querySessions(command2.sessionIds, connectionController.signal).then((entries) => {
39751
+ send(socket, {
39752
+ entries,
39753
+ kind: SESSION_QUERIED_KIND,
39754
+ requestId: command2.requestId
39755
+ });
39756
+ }).catch((error62) => {
39757
+ reportOperationFailure(socket, command2.requestId, "", error62);
39758
+ });
39759
+ return;
39760
+ }
39854
39761
  if (kind === SESSION_PERMISSION_RESPOND_KIND) {
39855
39762
  const command2 = message;
39856
39763
  void sessions.respondPermission(command2).then(() => {