@moxt-ai/mobius 0.0.191 → 0.0.192

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 (44) hide show
  1. package/dist/acp/agent-session.d.ts.map +1 -1
  2. package/dist/acp/agent-session.js +43 -15
  3. package/dist/acp/agent-session.js.map +1 -1
  4. package/dist/acp/codex/app-server-protocol.d.ts +12 -0
  5. package/dist/acp/codex/app-server-protocol.d.ts.map +1 -1
  6. package/dist/acp/codex/app-server-protocol.js +5 -5
  7. package/dist/acp/codex/app-server-protocol.js.map +1 -1
  8. package/dist/acp/codex/settings.d.ts +3 -0
  9. package/dist/acp/codex/settings.d.ts.map +1 -1
  10. package/dist/acp/codex/settings.js +5 -15
  11. package/dist/acp/codex/settings.js.map +1 -1
  12. package/dist/acp/session-configuration.d.ts +20 -0
  13. package/dist/acp/session-configuration.d.ts.map +1 -0
  14. package/dist/acp/session-configuration.js +49 -0
  15. package/dist/acp/session-configuration.js.map +1 -0
  16. package/dist/acp/session-store.d.ts +3 -1
  17. package/dist/acp/session-store.d.ts.map +1 -1
  18. package/dist/acp/session-store.js +9 -2
  19. package/dist/acp/session-store.js.map +1 -1
  20. package/dist/artifacts/local-file-streamer.d.ts.map +1 -1
  21. package/dist/artifacts/local-file-streamer.js +4 -2
  22. package/dist/artifacts/local-file-streamer.js.map +1 -1
  23. package/dist/cli.js +173 -95
  24. package/dist/cli.js.map +4 -4
  25. package/dist/daemon-command-handler.d.ts.map +1 -1
  26. package/dist/daemon-command-handler.js +1 -1
  27. package/dist/daemon-command-handler.js.map +1 -1
  28. package/dist/daemon-history-commands.d.ts +3 -2
  29. package/dist/daemon-history-commands.d.ts.map +1 -1
  30. package/dist/daemon-history-commands.js +12 -5
  31. package/dist/daemon-history-commands.js.map +1 -1
  32. package/dist/generated/acp-session-store-migrations.d.ts +3 -0
  33. package/dist/generated/acp-session-store-migrations.d.ts.map +1 -1
  34. package/dist/generated/acp-session-store-migrations.js +5 -1
  35. package/dist/generated/acp-session-store-migrations.js.map +1 -1
  36. package/dist/index.js +173 -95
  37. package/dist/index.js.map +4 -4
  38. package/dist/runtime.js +173 -95
  39. package/dist/runtime.js.map +4 -4
  40. package/dist/schema/acp-session-store/acp-session.d.ts +16 -0
  41. package/dist/schema/acp-session-store/acp-session.d.ts.map +1 -1
  42. package/dist/schema/acp-session-store/acp-session.js +1 -0
  43. package/dist/schema/acp-session-store/acp-session.js.map +1 -1
  44. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21459,18 +21459,21 @@ var SESSION_LIVE_HISTORY_V2_PAGE_LOADED_KIND = "session.live-history.v2.page.loa
21459
21459
  var SESSION_PREVIEW_HISTORY_PAGE_LOAD_KIND = "session.preview-history.page.load";
21460
21460
  var SESSION_PREVIEW_HISTORY_PAGE_LOADED_KIND = "session.preview-history.page.loaded";
21461
21461
  var directoryIdentifier = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/);
21462
- var pageLoadFields = {
21463
- additionalDirectoryIds: external_exports.array(directoryIdentifier).max(16).readonly(),
21464
- agentId: identifierStringSchema,
21465
- bindingId: identifierStringSchema,
21462
+ var pageRequestFields = {
21466
21463
  cursor: external_exports.string().min(1).max(512).nullable(),
21467
- directoryId: directoryIdentifier,
21468
21464
  eventLimit: external_exports.number().int().min(1).max(1e4),
21469
21465
  requestId: identifierStringSchema,
21470
21466
  sessionId: identifierStringSchema
21471
21467
  };
21472
- var sessionLiveHistoryV2PageLoadSchema = external_exports.object({ ...pageLoadFields, kind: external_exports.literal(SESSION_LIVE_HISTORY_V2_PAGE_LOAD_KIND) }).readonly();
21473
- var sessionPreviewHistoryPageLoadSchema = external_exports.object({ ...pageLoadFields, kind: external_exports.literal(SESSION_PREVIEW_HISTORY_PAGE_LOAD_KIND) }).readonly();
21468
+ var sessionLiveHistoryV2PageLoadSchema = external_exports.object({ ...pageRequestFields, kind: external_exports.literal(SESSION_LIVE_HISTORY_V2_PAGE_LOAD_KIND) }).readonly();
21469
+ var sessionPreviewHistoryPageLoadSchema = external_exports.object({
21470
+ ...pageRequestFields,
21471
+ additionalDirectoryIds: external_exports.array(directoryIdentifier).max(16).readonly(),
21472
+ agentId: identifierStringSchema,
21473
+ bindingId: identifierStringSchema,
21474
+ directoryId: directoryIdentifier,
21475
+ kind: external_exports.literal(SESSION_PREVIEW_HISTORY_PAGE_LOAD_KIND)
21476
+ }).readonly();
21474
21477
  var pageLoadedFields = {
21475
21478
  events: nativeSessionEventsV2Schema,
21476
21479
  requestId: identifierStringSchema,
@@ -24184,6 +24187,54 @@ function sessionConfigProtocolForAgent(_agentId) {
24184
24187
  return standardSessionConfigProtocol;
24185
24188
  }
24186
24189
 
24190
+ // src/acp/session-configuration.ts
24191
+ var storedSessionConfigurationsSchema = external_exports.array(
24192
+ external_exports.discriminatedUnion("type", [
24193
+ external_exports.object({ booleanValue: external_exports.boolean(), configId: external_exports.string().max(128), type: external_exports.literal("boolean") }),
24194
+ external_exports.object({ configId: external_exports.string().max(128), type: external_exports.literal("select"), value: external_exports.string().max(500) })
24195
+ ])
24196
+ ).max(100);
24197
+ var decodeStoredSessionConfigurations = (value) => storedSessionConfigurationsSchema.parse(value);
24198
+ var AcpSessionConfigurations = class {
24199
+ #selected = [];
24200
+ stored = () => this.#selected;
24201
+ capture = (options) => {
24202
+ this.#selected = this.#selected.map((selection) => {
24203
+ const current = options.find(
24204
+ (option) => option.id === selection.configId && option.type === selection.type
24205
+ );
24206
+ if (current === void 0) {
24207
+ return selection;
24208
+ }
24209
+ return current.type === "boolean" ? { booleanValue: current.booleanValue, configId: current.id, type: "boolean" } : { configId: current.id, type: "select", value: current.currentValue };
24210
+ });
24211
+ };
24212
+ select = (option) => {
24213
+ const selected = option.type === "boolean" ? { booleanValue: option.booleanValue, configId: option.id, type: "boolean" } : { configId: option.id, type: "select", value: option.currentValue };
24214
+ this.#selected = [...this.#selected.filter((selection) => selection.configId !== selected.configId), selected];
24215
+ };
24216
+ restore = async (stored, options, apply, signal) => {
24217
+ this.#selected = stored;
24218
+ for (const selection of this.#selected) {
24219
+ const current = options.find(
24220
+ (option) => option.id === selection.configId && option.type === selection.type
24221
+ );
24222
+ if (current === void 0) {
24223
+ continue;
24224
+ }
24225
+ if (selection.type === "boolean") {
24226
+ if (current.booleanValue !== selection.booleanValue) {
24227
+ await apply(selection, signal);
24228
+ }
24229
+ continue;
24230
+ }
24231
+ if (current.currentValue !== selection.value && current.values.some((value) => value.value === selection.value)) {
24232
+ await apply(selection, signal);
24233
+ }
24234
+ }
24235
+ };
24236
+ };
24237
+
24187
24238
  // src/acp/session-contracts.ts
24188
24239
  var acpNativeHistoryReader = {
24189
24240
  access: () => ({ kind: "acp" })
@@ -29850,6 +29901,7 @@ var acpSession = sqliteTable("acp_session", {
29850
29901
  nativeSessionId: text("native_session_id").notNull(),
29851
29902
  cwd: text("cwd").notNull(),
29852
29903
  additionalDirectories: text("additional_directories").notNull(),
29904
+ configurations: text("configurations").notNull().default("[]"),
29853
29905
  prompted: integer2("prompted", { mode: "boolean" }).notNull(),
29854
29906
  title: text("title").notNull(),
29855
29907
  updatedAt: text("updated_at").notNull()
@@ -30117,15 +30169,17 @@ var AcpStoredSession = class {
30117
30169
  additionalDirectories;
30118
30170
  agentId;
30119
30171
  cwd;
30172
+ configurations;
30120
30173
  nativeSessionId;
30121
30174
  prompted;
30122
30175
  sessionId;
30123
30176
  title;
30124
30177
  updatedAt;
30125
- constructor(sessionId, agentId, nativeSessionId, cwd, additionalDirectories, prompted, title2, updatedAt = (/* @__PURE__ */ new Date()).toISOString()) {
30178
+ constructor(sessionId, agentId, nativeSessionId, cwd, additionalDirectories, prompted, title2, updatedAt = (/* @__PURE__ */ new Date()).toISOString(), configurations = []) {
30126
30179
  this.additionalDirectories = [...additionalDirectories];
30127
30180
  this.agentId = agentId;
30128
30181
  this.cwd = cwd;
30182
+ this.configurations = configurations.map((configuration) => ({ ...configuration }));
30129
30183
  this.nativeSessionId = nativeSessionId;
30130
30184
  this.prompted = prompted;
30131
30185
  this.sessionId = sessionId;
@@ -30175,6 +30229,7 @@ var MemoryAcpSessionStore = class {
30175
30229
  var storedSessionRowSchema = external_exports.object({
30176
30230
  additionalDirectories: external_exports.string(),
30177
30231
  agentId: external_exports.string(),
30232
+ configurations: external_exports.string(),
30178
30233
  cwd: external_exports.string(),
30179
30234
  nativeSessionId: external_exports.string(),
30180
30235
  prompted: external_exports.boolean(),
@@ -30186,6 +30241,8 @@ function decodeStoredSession(value) {
30186
30241
  const row = storedSessionRowSchema.parse(value);
30187
30242
  const decodedAdditionalDirectories = JSON.parse(row.additionalDirectories);
30188
30243
  const additionalDirectories = external_exports.array(external_exports.string()).parse(decodedAdditionalDirectories);
30244
+ const decodedConfigurations = JSON.parse(row.configurations);
30245
+ const configurations = decodeStoredSessionConfigurations(decodedConfigurations);
30189
30246
  return new AcpStoredSession(
30190
30247
  row.sessionId,
30191
30248
  row.agentId,
@@ -30194,7 +30251,8 @@ function decodeStoredSession(value) {
30194
30251
  additionalDirectories,
30195
30252
  row.prompted,
30196
30253
  row.title,
30197
- row.updatedAt
30254
+ row.updatedAt,
30255
+ configurations
30198
30256
  );
30199
30257
  }
30200
30258
  var SqliteAcpSessionStore = class {
@@ -30227,6 +30285,7 @@ var SqliteAcpSessionStore = class {
30227
30285
  const value = {
30228
30286
  additionalDirectories: JSON.stringify(session.additionalDirectories),
30229
30287
  agentId: session.agentId,
30288
+ configurations: JSON.stringify(session.configurations),
30230
30289
  cwd: session.cwd,
30231
30290
  nativeSessionId: session.nativeSessionId,
30232
30291
  prompted: session.prompted,
@@ -30275,6 +30334,7 @@ var AgentSession = class _AgentSession {
30275
30334
  #commands = [];
30276
30335
  #configRevision = 0;
30277
30336
  #configOptions = [];
30337
+ #sessionConfigurations = new AcpSessionConfigurations();
30278
30338
  #nativeHistoryOwnership = { kind: "unbound" };
30279
30339
  #prompted = false;
30280
30340
  #nativePrompt = null;
@@ -30379,6 +30439,41 @@ var AgentSession = class _AgentSession {
30379
30439
  usesEnvironment = (environment) => recordsEqual(this.#environment, environment);
30380
30440
  canRebind = () => !this.#prompted && !this.#turn.running;
30381
30441
  hasRunningTurn = () => this.#turn.running;
30442
+ #writeStoredSession = () => {
30443
+ this.#store.write(
30444
+ new AcpStoredSession(
30445
+ this.#mobiusSessionId,
30446
+ this.#agentId,
30447
+ this.#updates.sessionId(),
30448
+ this.#cwd,
30449
+ this.#additionalDirectories,
30450
+ this.#prompted,
30451
+ this.#sessionTitle ?? "",
30452
+ (/* @__PURE__ */ new Date()).toISOString(),
30453
+ this.#sessionConfigurations.stored()
30454
+ )
30455
+ );
30456
+ };
30457
+ #captureSelectedConfigurationValues = () => {
30458
+ this.#sessionConfigurations.capture(this.#configOptions);
30459
+ if (this.#updates.sessionId().length > 0) {
30460
+ this.#writeStoredSession();
30461
+ }
30462
+ };
30463
+ #restoreStoredConfigurations = async (session, signal) => {
30464
+ await this.#sessionConfigurations.restore(
30465
+ session.configurations,
30466
+ this.#configOptions,
30467
+ async (selection, signal2) => await this.#applyConfiguration(
30468
+ selection.configId,
30469
+ selection.type === "select" ? selection.value : "",
30470
+ selection.type === "boolean" ? selection.booleanValue : false,
30471
+ selection.type,
30472
+ signal2
30473
+ ),
30474
+ signal
30475
+ );
30476
+ };
30382
30477
  prepared = () => new AcpPreparedSession(
30383
30478
  this.#agentName,
30384
30479
  this.#agentVersion,
@@ -30729,20 +30824,12 @@ var AgentSession = class _AgentSession {
30729
30824
  lifecycleResponse = created;
30730
30825
  }
30731
30826
  this.#configOptions = this.#sessionConfigProtocol.normalizeLifecycle(lifecycleResponse);
30827
+ if (stored instanceof FoundAcpStoredSession && this.#restored) {
30828
+ await this.#restoreStoredConfigurations(stored.session, signal);
30829
+ }
30732
30830
  await this.#updates.drained();
30733
30831
  signal.throwIfAborted();
30734
- this.#store.write(
30735
- new AcpStoredSession(
30736
- this.#mobiusSessionId,
30737
- this.#agentId,
30738
- this.#updates.sessionId(),
30739
- this.#cwd,
30740
- this.#additionalDirectories,
30741
- this.#prompted,
30742
- this.#sessionTitle ?? "",
30743
- (/* @__PURE__ */ new Date()).toISOString()
30744
- )
30745
- );
30832
+ this.#writeStoredSession();
30746
30833
  };
30747
30834
  listNativeSessions = async (cursor, signal) => {
30748
30835
  if (!this.#capabilities.listSessions) {
@@ -30783,15 +30870,17 @@ var AgentSession = class _AgentSession {
30783
30870
  this.#cwd,
30784
30871
  this.#additionalDirectories,
30785
30872
  false,
30786
- ""
30873
+ "",
30874
+ (/* @__PURE__ */ new Date()).toISOString(),
30875
+ this.#sessionConfigurations.stored()
30787
30876
  )
30788
30877
  );
30789
30878
  this.#store.remove(previousSessionId);
30790
30879
  this.#mobiusSessionId = sessionId;
30791
30880
  };
30792
- configure = async (options) => {
30793
- const existing = this.#configOptions.find((option) => option.id === options.configId);
30794
- if (existing === void 0 || existing.type !== options.valueType) {
30881
+ #applyConfiguration = async (configId, value, booleanValue, valueType, signal) => {
30882
+ const existing = this.#configOptions.find((option) => option.id === configId);
30883
+ if (existing === void 0 || existing.type !== valueType) {
30795
30884
  throw new AcpExecutionError(
30796
30885
  "The requested ACP configuration option is unavailable",
30797
30886
  {},
@@ -30806,10 +30895,10 @@ var AgentSession = class _AgentSession {
30806
30895
  "invalid_session_configuration"
30807
30896
  );
30808
30897
  }
30809
- if (!existing.values.some((entry) => entry.value === options.value)) {
30898
+ if (!existing.values.some((entry) => entry.value === value)) {
30810
30899
  throw new AcpConfigurationValueUnavailableError(
30811
- options.configId,
30812
- options.value,
30900
+ configId,
30901
+ value,
30813
30902
  existing.values.map((entry) => entry.value)
30814
30903
  );
30815
30904
  }
@@ -30818,20 +30907,20 @@ var AgentSession = class _AgentSession {
30818
30907
  try {
30819
30908
  const configured = await this.#sessionConfigProtocol.configure(
30820
30909
  this.#configOptions,
30821
- options,
30910
+ { booleanValue, configId, signal, value },
30822
30911
  this.#updates.sessionId(),
30823
30912
  {
30824
- request: async (method, params, failureMessage, signal) => await this.race(
30913
+ request: async (method, params, failureMessage, signal2) => await this.race(
30825
30914
  this.#connection.connection.agent.request(method, params, {
30826
- cancellationSignal: signal
30915
+ cancellationSignal: signal2
30827
30916
  }),
30828
30917
  failureMessage,
30829
- signal
30918
+ signal2
30830
30919
  )
30831
30920
  }
30832
30921
  );
30833
- const applied = configured.find((option) => option.id === options.configId);
30834
- if (applied === void 0 || applied.type !== options.valueType || applied.type === "boolean" && applied.booleanValue !== options.booleanValue || applied.type === "select" && applied.currentValue !== options.value) {
30922
+ const applied = configured.find((option) => option.id === configId);
30923
+ if (applied === void 0 || applied.type !== valueType || applied.type === "boolean" && applied.booleanValue !== booleanValue || applied.type === "select" && applied.currentValue !== value) {
30835
30924
  throw new AcpExecutionError(
30836
30925
  "The Agent did not apply the requested session configuration",
30837
30926
  {},
@@ -30848,6 +30937,21 @@ var AgentSession = class _AgentSession {
30848
30937
  }
30849
30938
  throw error62;
30850
30939
  }
30940
+ };
30941
+ configure = async (options) => {
30942
+ await this.#applyConfiguration(
30943
+ options.configId,
30944
+ options.value,
30945
+ options.booleanValue,
30946
+ options.valueType,
30947
+ options.signal
30948
+ );
30949
+ const applied = this.#configOptions.find((option) => option.id === options.configId);
30950
+ if (applied === void 0) {
30951
+ throw new AcpExecutionError("The requested ACP configuration option is unavailable");
30952
+ }
30953
+ this.#sessionConfigurations.select(applied);
30954
+ this.#writeStoredSession();
30851
30955
  return this.#configOptions;
30852
30956
  };
30853
30957
  buildPrompt = (options) => {
@@ -30922,19 +31026,8 @@ var AgentSession = class _AgentSession {
30922
31026
  if (this.#sessionTitle === null || this.#sessionTitle.length === 0) {
30923
31027
  this.#sessionTitle = truncate2(options.prompt, 500);
30924
31028
  }
30925
- this.#store.write(
30926
- new AcpStoredSession(
30927
- this.#mobiusSessionId,
30928
- this.#agentId,
30929
- this.#updates.sessionId(),
30930
- this.#cwd,
30931
- this.#additionalDirectories,
30932
- true,
30933
- this.#sessionTitle,
30934
- (/* @__PURE__ */ new Date()).toISOString()
30935
- )
30936
- );
30937
31029
  this.#prompted = true;
31030
+ this.#writeStoredSession();
30938
31031
  const running = new RunningAcpTurn(
30939
31032
  options.commandId,
30940
31033
  options.onActivity,
@@ -31005,18 +31098,7 @@ var AgentSession = class _AgentSession {
31005
31098
  usage: result.usage ?? null
31006
31099
  });
31007
31100
  }
31008
- this.#store.write(
31009
- new AcpStoredSession(
31010
- this.#mobiusSessionId,
31011
- this.#agentId,
31012
- this.#updates.sessionId(),
31013
- this.#cwd,
31014
- this.#additionalDirectories,
31015
- true,
31016
- this.#sessionTitle ?? "",
31017
- (/* @__PURE__ */ new Date()).toISOString()
31018
- )
31019
- );
31101
+ this.#writeStoredSession();
31020
31102
  if (lifecycleV2 !== void 0) {
31021
31103
  await this.recordLifecycleEventV2({
31022
31104
  payload: { commandId: options.commandId, kind: "prompt.completed", stopReason: result.stopReason },
@@ -31272,6 +31354,7 @@ var AgentSession = class _AgentSession {
31272
31354
  update.configOptions
31273
31355
  );
31274
31356
  this.#configRevision += 1;
31357
+ this.#captureSelectedConfigurationValues();
31275
31358
  await this.emitConfigUpdate();
31276
31359
  return;
31277
31360
  }
@@ -31280,6 +31363,7 @@ var AgentSession = class _AgentSession {
31280
31363
  (option) => option.category === "mode" ? { ...option, currentValue: update.currentModeId } : option
31281
31364
  );
31282
31365
  this.#configRevision += 1;
31366
+ this.#captureSelectedConfigurationValues();
31283
31367
  await this.emitConfigUpdate();
31284
31368
  return;
31285
31369
  }
@@ -31295,18 +31379,7 @@ var AgentSession = class _AgentSession {
31295
31379
  this.#sessionUpdatedAt = truncate2(update.updatedAt ?? "", 128);
31296
31380
  }
31297
31381
  if (this.#updates.sessionId().length > 0) {
31298
- this.#store.write(
31299
- new AcpStoredSession(
31300
- this.#mobiusSessionId,
31301
- this.#agentId,
31302
- this.#updates.sessionId(),
31303
- this.#cwd,
31304
- this.#additionalDirectories,
31305
- this.#prompted,
31306
- this.#sessionTitle ?? "",
31307
- (/* @__PURE__ */ new Date()).toISOString()
31308
- )
31309
- );
31382
+ this.#writeStoredSession();
31310
31383
  }
31311
31384
  await this.#getObserver().onInfo({
31312
31385
  kind: SESSION_INFO_UPDATED_KIND,
@@ -33872,7 +33945,11 @@ var threadTurnSchema = external_exports.object({
33872
33945
  items: external_exports.array(external_exports.unknown()).max(1e5)
33873
33946
  });
33874
33947
  var threadTurnsSchema = external_exports.array(threadTurnSchema).max(1e5);
33948
+ var collaborationModeSchema = external_exports.object({
33949
+ mode: external_exports.enum(["default", "plan"])
33950
+ });
33875
33951
  var threadLifecycleResponseSchema = external_exports.object({
33952
+ collaborationMode: collaborationModeSchema.nullish(),
33876
33953
  model: boundedText(256).nullish(),
33877
33954
  reasoningEffort: boundedText(256).nullish(),
33878
33955
  serviceTier: boundedText(256).nullish(),
@@ -33917,9 +33994,7 @@ var modelListResponseSchema = external_exports.object({
33917
33994
  var threadSettingsUpdatedSchema = external_exports.object({
33918
33995
  threadId: boundedText(256),
33919
33996
  threadSettings: external_exports.object({
33920
- collaborationMode: external_exports.object({
33921
- mode: external_exports.enum(["default", "plan"])
33922
- }).nullish()
33997
+ collaborationMode: collaborationModeSchema.nullish()
33923
33998
  })
33924
33999
  });
33925
34000
 
@@ -34396,7 +34471,7 @@ var FULL_ACCESS_MODE = Object.freeze({
34396
34471
  sandboxPolicy: { type: "dangerFullAccess" }
34397
34472
  });
34398
34473
  var AGENT_MODES = Object.freeze([READ_ONLY_MODE, AGENT_MODE, FULL_ACCESS_MODE]);
34399
- var DEFAULT_MODE = AGENT_MODE;
34474
+ var DEFAULT_MODE = FULL_ACCESS_MODE;
34400
34475
  function initialMode(environment) {
34401
34476
  const requested = environment["INITIAL_AGENT_MODE"];
34402
34477
  if (requested === void 0) {
@@ -34514,9 +34589,6 @@ function effortSetting(model, currentValue) {
34514
34589
  var CodexSettings = class {
34515
34590
  #appServer;
34516
34591
  #models = [];
34517
- // Whether the current turn must carry a policy at all. Until the user picks a mode, Codex's own
34518
- // configuration decides, so `turn/start` omits the fields and inherits what the host set up.
34519
- #policySelected = false;
34520
34592
  // Whether a collaboration mode choice has been made in this session. A restored thread keeps
34521
34593
  // the mode Codex already persisted, so the first turn does not reset it to Build.
34522
34594
  #collaborationModeSelected = false;
@@ -34556,14 +34628,9 @@ var CodexSettings = class {
34556
34628
  const mode = AGENT_MODES.find((candidate) => candidate.id === selection.mode) ?? DEFAULT_MODE;
34557
34629
  const supportsFast = this.#model(selection.model)?.additionalSpeedTiers?.includes(FAST_TIER) === true;
34558
34630
  return {
34559
- // Until a mode is chosen, `config.toml` decides the sandbox and approval
34560
- // policy, and those fields stay off the turn so the host's own setup is
34561
- // inherited rather than overridden.
34562
- ...this.#policySelected ? {
34563
- approvalPolicy: mode.approvalPolicy,
34564
- approvalsReviewer: mode.approvalsReviewer,
34565
- sandboxPolicy: mode.sandboxPolicy
34566
- } : {},
34631
+ approvalPolicy: mode.approvalPolicy,
34632
+ approvalsReviewer: mode.approvalsReviewer,
34633
+ sandboxPolicy: mode.sandboxPolicy,
34567
34634
  // The collaboration mode rides on the turn: Codex applies it to the
34568
34635
  // thread, where it persists until changed. "Build" is Codex's `default`
34569
34636
  // mode, so it is only sent once a choice exists to apply.
@@ -34656,6 +34723,7 @@ var CodexSettings = class {
34656
34723
  this.#selection = {
34657
34724
  ...this.#selection,
34658
34725
  ...supported,
34726
+ collaborationMode: thread.collaborationMode?.mode ?? this.#selection.collaborationMode,
34659
34727
  fastMode: thread.serviceTier === SERVICE_TIER_FAST
34660
34728
  };
34661
34729
  };
@@ -34695,7 +34763,6 @@ var CodexSettings = class {
34695
34763
  );
34696
34764
  }
34697
34765
  this.#selection = { ...this.#selection, mode: value };
34698
- this.#policySelected = true;
34699
34766
  return;
34700
34767
  }
34701
34768
  if (configId === COLLABORATION_MODE_SETTING_ID) {
@@ -39954,6 +40021,10 @@ var acpSessionStoreMigrations = [
39954
40021
  {
39955
40022
  "name": "0004_special_mathemanic.sql",
39956
40023
  "sql": "DROP TABLE `deleted_acp_session`;--> statement-breakpoint\nALTER TABLE `acp_session` DROP COLUMN `last_terminal_command_id`;"
40024
+ },
40025
+ {
40026
+ "name": "0005_orange_amphibian.sql",
40027
+ "sql": "ALTER TABLE `acp_session` ADD `configurations` text DEFAULT '[]' NOT NULL;"
39957
40028
  }
39958
40029
  ];
39959
40030
 
@@ -41443,7 +41514,7 @@ import { WebSocket as WebSocket5 } from "undici";
41443
41514
  // package.json
41444
41515
  var package_default = {
41445
41516
  name: "@moxt-ai/mobius",
41446
- version: "0.0.191",
41517
+ version: "0.0.192",
41447
41518
  description: "Mobius CLI for pairing and running local AI agent services.",
41448
41519
  type: "module",
41449
41520
  bin: {
@@ -42136,7 +42207,7 @@ function createAgentSettingsDiscoveryHandler(dependencies) {
42136
42207
  // src/artifacts/local-file-streamer.ts
42137
42208
  import { createReadStream as createReadStream2 } from "node:fs";
42138
42209
  import { realpath as realpath10, stat as stat9 } from "node:fs/promises";
42139
- import { basename as basename5, isAbsolute as isAbsolute11, normalize as normalize4, resolve as resolve7 } from "node:path";
42210
+ import { basename as basename5, extname, isAbsolute as isAbsolute11, normalize as normalize4, resolve as resolve7 } from "node:path";
42140
42211
  import { fileURLToPath as fileURLToPath2 } from "node:url";
42141
42212
  var CHUNK_BYTES = 192 * 1024;
42142
42213
  function requestedPath(value) {
@@ -42186,7 +42257,7 @@ async function streamLocalFile(command, send2, signal, workingDirectory, externa
42186
42257
  send2({
42187
42258
  byteLength: before.size,
42188
42259
  kind: FILE_BEGIN_KIND,
42189
- mediaType: external?.mediaType ?? raster?.mimeType ?? "application/octet-stream",
42260
+ mediaType: external?.mediaType ?? raster?.mimeType ?? (extname(target).toLowerCase() === ".svg" ? "image/svg+xml" : "application/octet-stream"),
42190
42261
  modifiedAt: before.mtime.toISOString(),
42191
42262
  name: external?.name ?? (basename5(target) || "file"),
42192
42263
  requestId: command.requestId,
@@ -42250,18 +42321,24 @@ async function resolveSessionDirectories(directories, bindingId, directoryId2, a
42250
42321
  }
42251
42322
 
42252
42323
  // src/daemon-history-commands.ts
42253
- async function executeSessionLiveHistoryV2PageLoad(socket, command, config2, directories, audit, diagnostics, sessions, eventLogV2, signal) {
42324
+ async function executeSessionLiveHistoryV2PageLoad(socket, command, config2, directories, audit, diagnostics, sessions, nativeSessions, eventLogV2, signal) {
42325
+ let agentId;
42254
42326
  try {
42327
+ const [entry] = await nativeSessions.querySessions([command.sessionId], signal);
42328
+ if (entry === void 0) {
42329
+ throw new AcpExecutionError("The Session was not found", {}, "session_not_found");
42330
+ }
42331
+ agentId = entry.agentId;
42255
42332
  const resolved = await resolveSessionDirectories(
42256
42333
  directories,
42257
42334
  config2.bindingId,
42258
- command.directoryId,
42259
- command.additionalDirectoryIds,
42335
+ entry.directoryId,
42336
+ entry.additionalDirectories.map((directory) => directory.directoryId),
42260
42337
  signal
42261
42338
  );
42262
42339
  const loadOptions = {
42263
42340
  additionalDirectories: resolved.additionalDirectories,
42264
- agent: config2.catalog.find(command.agentId),
42341
+ agent: config2.catalog.find(entry.agentId),
42265
42342
  cwd: resolved.cwd,
42266
42343
  sessionId: command.sessionId,
42267
42344
  signal
@@ -42306,7 +42383,7 @@ async function executeSessionLiveHistoryV2PageLoad(socket, command, config2, dir
42306
42383
  "session_history_v2_load_failed",
42307
42384
  command.requestId,
42308
42385
  {
42309
- agentId: command.agentId,
42386
+ ...agentId === void 0 ? {} : { agentId },
42310
42387
  code: operationErrorCode(error62),
42311
42388
  sessionId: command.sessionId
42312
42389
  },
@@ -42315,7 +42392,7 @@ async function executeSessionLiveHistoryV2PageLoad(socket, command, config2, dir
42315
42392
  audit.record({
42316
42393
  commandId: command.requestId,
42317
42394
  details: {
42318
- agentId: command.agentId,
42395
+ ...agentId === void 0 ? {} : { agentId },
42319
42396
  code: operationErrorCode(error62)
42320
42397
  },
42321
42398
  event: "session_history_v2_load_failed",
@@ -43175,6 +43252,7 @@ function createDaemonCommandHandler({
43175
43252
  audit,
43176
43253
  diagnostics,
43177
43254
  sessions,
43255
+ nativeSessions,
43178
43256
  eventLogV2,
43179
43257
  signal
43180
43258
  );