@moxt-ai/mobius 0.0.61 → 0.0.64

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/cli.js CHANGED
@@ -11,7 +11,7 @@ import { mkdir as mkdir6 } from "node:fs/promises";
11
11
  // package.json
12
12
  var package_default = {
13
13
  name: "@moxt-ai/mobius",
14
- version: "0.0.61",
14
+ version: "0.0.64",
15
15
  description: "Mobius CLI for pairing and running local AI agent services.",
16
16
  type: "module",
17
17
  bin: {
@@ -22728,7 +22728,11 @@ var configValueSchema = external_exports.strictObject({
22728
22728
  groupId: external_exports.string().max(128),
22729
22729
  groupName: external_exports.string().max(255),
22730
22730
  name: external_exports.string().min(1).max(255),
22731
- value: external_exports.string().min(1).max(500)
22731
+ // ACP types a select value id as any string, and Agents use the empty
22732
+ // id to mean "the provider's own default" — no explicit setting is
22733
+ // sent. Refusing it would drop the whole option, so the id is bounded
22734
+ // by length alone.
22735
+ value: external_exports.string().max(500)
22732
22736
  }).readonly();
22733
22737
  var sessionConfigOptionSchema = external_exports.strictObject({
22734
22738
  booleanValue: external_exports.boolean(),
@@ -24035,6 +24039,39 @@ function decodeRecordedSessionEvent(encoded) {
24035
24039
  }
24036
24040
  var encodeRecordedSessionEvent = (event) => JSON.stringify(decodeRecordedSessionEvent(JSON.stringify(event)));
24037
24041
 
24042
+ // ../protocol/src/session-live-history.ts
24043
+ var SESSION_LIVE_HISTORY_LOAD_KIND = "session.live-history.load";
24044
+ var SESSION_LIVE_HISTORY_LOADED_KIND = "session.live-history.loaded";
24045
+ var identifier2 = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/);
24046
+ var directoryIdentifier = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/);
24047
+ var sessionLiveHistoryLoadSchema = external_exports.strictObject({
24048
+ additionalDirectoryIds: external_exports.array(directoryIdentifier).max(16).readonly(),
24049
+ agentId: identifier2,
24050
+ bindingId: identifier2,
24051
+ directoryId: directoryIdentifier,
24052
+ kind: external_exports.literal(SESSION_LIVE_HISTORY_LOAD_KIND),
24053
+ requestId: identifier2,
24054
+ sessionId: identifier2
24055
+ }).readonly();
24056
+ var sessionLiveHistoryLoadedSchema = external_exports.strictObject({
24057
+ history: sessionHistorySchema,
24058
+ kind: external_exports.literal(SESSION_LIVE_HISTORY_LOADED_KIND),
24059
+ requestId: identifier2,
24060
+ sessionId: identifier2
24061
+ }).readonly();
24062
+ function decode6(schema, encoded) {
24063
+ try {
24064
+ const value = JSON.parse(encoded);
24065
+ return schema.parse(value);
24066
+ } catch (cause) {
24067
+ throw new ProtocolMessageError("Invalid live Session history message", { cause });
24068
+ }
24069
+ }
24070
+ var decodeSessionLiveHistoryLoad = (encoded) => decode6(sessionLiveHistoryLoadSchema, encoded);
24071
+ var decodeSessionLiveHistoryLoaded = (encoded) => decode6(sessionLiveHistoryLoadedSchema, encoded);
24072
+ var encodeSessionLiveHistoryLoad = (value) => JSON.stringify(sessionLiveHistoryLoadSchema.parse(value));
24073
+ var encodeSessionLiveHistoryLoaded = (value) => JSON.stringify(sessionLiveHistoryLoadedSchema.parse(value));
24074
+
24038
24075
  // ../protocol/src/daemon-transport.ts
24039
24076
  function defineMessageSignature(kind, encoder, decoder) {
24040
24077
  const schema = (message) => decoder(JSON.stringify(message));
@@ -24132,6 +24169,11 @@ var serviceToDaemonSignatures = {
24132
24169
  encodeSessionEventRejection,
24133
24170
  decodeSessionEventRejection
24134
24171
  ),
24172
+ [SESSION_LIVE_HISTORY_LOAD_KIND]: defineMessageSignature(
24173
+ SESSION_LIVE_HISTORY_LOAD_KIND,
24174
+ encodeSessionLiveHistoryLoad,
24175
+ decodeSessionLiveHistoryLoad
24176
+ ),
24135
24177
  [SESSION_PERMISSION_RESPOND_KIND]: defineMessageSignature(
24136
24178
  SESSION_PERMISSION_RESPOND_KIND,
24137
24179
  encodeSessionPermissionRespondCommand,
@@ -24237,6 +24279,11 @@ var daemonToServiceSignatures = {
24237
24279
  encodeSessionOperationFailedEvent,
24238
24280
  decodeSessionOperationFailedEvent
24239
24281
  ),
24282
+ [SESSION_LIVE_HISTORY_LOADED_KIND]: defineMessageSignature(
24283
+ SESSION_LIVE_HISTORY_LOADED_KIND,
24284
+ encodeSessionLiveHistoryLoaded,
24285
+ decodeSessionLiveHistoryLoaded
24286
+ ),
24240
24287
  [SESSION_READY_KIND]: defineMessageSignature(SESSION_READY_KIND, encodeSessionReadyEvent, decodeSessionReadyEvent),
24241
24288
  [WORKSPACE_ENTRIES_KIND]: defineMessageSignature(
24242
24289
  WORKSPACE_ENTRIES_KIND,
@@ -30094,7 +30141,7 @@ var titleBefore = {
30094
30141
  };
30095
30142
  function tokenizeDefinition(effects, ok2, nok) {
30096
30143
  const self = this;
30097
- let identifier2;
30144
+ let identifier3;
30098
30145
  return start;
30099
30146
  function start(code) {
30100
30147
  effects.enter("definition");
@@ -30113,7 +30160,7 @@ function tokenizeDefinition(effects, ok2, nok) {
30113
30160
  )(code);
30114
30161
  }
30115
30162
  function labelAfter(code) {
30116
- identifier2 = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));
30163
+ identifier3 = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));
30117
30164
  if (code === 58) {
30118
30165
  effects.enter("definitionMarker");
30119
30166
  effects.consume(code);
@@ -30147,7 +30194,7 @@ function tokenizeDefinition(effects, ok2, nok) {
30147
30194
  function afterWhitespace(code) {
30148
30195
  if (code === null || markdownLineEnding(code)) {
30149
30196
  effects.exit("definition");
30150
- self.parser.defined.push(identifier2);
30197
+ self.parser.defined.push(identifier3);
30151
30198
  return ok2(code);
30152
30199
  }
30153
30200
  return nok(code);
@@ -32278,9 +32325,9 @@ function preprocess2() {
32278
32325
  // ../../node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js
32279
32326
  var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
32280
32327
  function decodeString(value) {
32281
- return value.replace(characterEscapeOrReference, decode6);
32328
+ return value.replace(characterEscapeOrReference, decode7);
32282
32329
  }
32283
- function decode6($0, $1, $2) {
32330
+ function decode7($0, $1, $2) {
32284
32331
  if ($1) {
32285
32332
  return $1;
32286
32333
  }
@@ -33320,12 +33367,16 @@ function readBoolean(value, fallback = false) {
33320
33367
  return typeof value === "boolean" ? value : fallback;
33321
33368
  }
33322
33369
  function normalizeConfigValue(option, groupId = "", groupName = "") {
33370
+ const value = option["value"];
33371
+ if (typeof value !== "string") {
33372
+ return void 0;
33373
+ }
33323
33374
  return {
33324
33375
  description: truncate2(readString2(option["description"]), 500),
33325
33376
  groupId: truncate2(groupId, 128),
33326
33377
  groupName: truncate2(groupName, 255),
33327
- name: truncate2(readString2(option["name"], readString2(option["value"])), 255),
33328
- value: truncate2(readString2(option["value"]), 500)
33378
+ name: truncate2(readString2(option["name"], value), 255),
33379
+ value: truncate2(value, 500)
33329
33380
  };
33330
33381
  }
33331
33382
  function normalizeConfigValues(value) {
@@ -33343,14 +33394,20 @@ function normalizeConfigValues(value) {
33343
33394
  const groupName = readString2(entry["name"]);
33344
33395
  for (const groupedOption of groupedOptions) {
33345
33396
  if (isRecord8(groupedOption)) {
33346
- normalized.push(normalizeConfigValue(groupedOption, groupId, groupName));
33397
+ const normalizedValue = normalizeConfigValue(groupedOption, groupId, groupName);
33398
+ if (normalizedValue !== void 0) {
33399
+ normalized.push(normalizedValue);
33400
+ }
33347
33401
  }
33348
33402
  }
33349
33403
  continue;
33350
33404
  }
33351
- normalized.push(normalizeConfigValue(entry));
33405
+ const normalizedEntry = normalizeConfigValue(entry);
33406
+ if (normalizedEntry !== void 0) {
33407
+ normalized.push(normalizedEntry);
33408
+ }
33352
33409
  }
33353
- return normalized.filter((entry) => entry.value.length > 0).slice(0, 500);
33410
+ return normalized.slice(0, 500);
33354
33411
  }
33355
33412
  function normalizeConfigOptions(value, modes) {
33356
33413
  const normalized = [];
@@ -33381,7 +33438,7 @@ function normalizeConfigOptions(value, modes) {
33381
33438
  if (option["type"] === "select") {
33382
33439
  const values = normalizeConfigValues(option["options"]);
33383
33440
  const currentValue = truncate2(readString2(option["currentValue"]), 500);
33384
- if (currentValue.length > 0 && values.some((entry) => entry.value === currentValue)) {
33441
+ if (values.some((entry) => entry.value === currentValue)) {
33385
33442
  normalized.push({
33386
33443
  booleanValue: false,
33387
33444
  category,
@@ -36565,6 +36622,14 @@ var AcpSessionManager = class {
36565
36622
  this.#nativeOperations.delete(key);
36566
36623
  }
36567
36624
  };
36625
+ loadSessionHistory = async (options) => {
36626
+ this.#beginSessionUse(options.sessionId);
36627
+ try {
36628
+ return await (await this.ensureSession(options)).loadHistory(options.signal);
36629
+ } finally {
36630
+ this.#endSessionUse(options.sessionId);
36631
+ }
36632
+ };
36568
36633
  openNativeSession = async (options, origin) => {
36569
36634
  const key = `${options.agent.id}:${origin.nativeSessionId}`;
36570
36635
  if (this.#nativeOperations.has(key)) {
@@ -40546,6 +40611,52 @@ async function executeSessionPrepare(publisher, socket, command, config2, direct
40546
40611
  reportOperationFailure(socket, command.requestId, command.sessionId, error62, metrics.snapshot());
40547
40612
  }
40548
40613
  }
40614
+ async function executeSessionLiveHistoryLoad(socket, command, config2, directories, audit, sessions, signal) {
40615
+ try {
40616
+ const resolved = await resolveSessionDirectories(
40617
+ directories,
40618
+ config2.bindingId,
40619
+ command.directoryId,
40620
+ command.additionalDirectoryIds,
40621
+ signal
40622
+ );
40623
+ const history = await sessions.loadSessionHistory({
40624
+ additionalDirectories: resolved.additionalDirectories,
40625
+ agent: config2.catalog.find(command.agentId),
40626
+ cwd: resolved.cwd,
40627
+ sessionId: command.sessionId,
40628
+ signal
40629
+ });
40630
+ signal.throwIfAborted();
40631
+ audit.record({
40632
+ commandId: command.requestId,
40633
+ event: "session_history_loaded",
40634
+ sessionId: command.sessionId
40635
+ });
40636
+ send(socket, {
40637
+ history,
40638
+ kind: "session.live-history.loaded",
40639
+ requestId: command.requestId,
40640
+ sessionId: command.sessionId
40641
+ });
40642
+ } catch (error62) {
40643
+ if (signal.aborted) {
40644
+ return;
40645
+ }
40646
+ audit.record({
40647
+ commandId: command.requestId,
40648
+ details: { code: operationErrorCode(error62) },
40649
+ event: "session_history_unavailable",
40650
+ sessionId: command.sessionId
40651
+ });
40652
+ send(socket, {
40653
+ history: { status: "unavailable" },
40654
+ kind: "session.live-history.loaded",
40655
+ requestId: command.requestId,
40656
+ sessionId: command.sessionId
40657
+ });
40658
+ }
40659
+ }
40549
40660
  async function executeSessionConfigure(publisher, socket, command, config2, directories, audit, sessions, signal) {
40550
40661
  try {
40551
40662
  const resolved = await resolveSessionDirectories(
@@ -41387,6 +41498,19 @@ async function runRelayConnection(config2, directories, audit, sessions, install
41387
41498
  }
41388
41499
  return;
41389
41500
  }
41501
+ if (kind === SESSION_LIVE_HISTORY_LOAD_KIND) {
41502
+ const command2 = decodeSessionLiveHistoryLoad(encoded);
41503
+ void executeSessionLiveHistoryLoad(
41504
+ socket,
41505
+ command2,
41506
+ config2,
41507
+ directories,
41508
+ audit,
41509
+ sessions,
41510
+ connectionController.signal
41511
+ );
41512
+ return;
41513
+ }
41390
41514
  if (kind === NATIVE_SESSION_CANCEL_KIND) {
41391
41515
  const command2 = message;
41392
41516
  const pending = nativeRequests.get(command2.requestId);