@moxt-ai/mobius 0.0.62 → 0.0.65

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.62",
14
+ version: "0.0.65",
15
15
  description: "Mobius CLI for pairing and running local AI agent services.",
16
16
  type: "module",
17
17
  bin: {
@@ -23278,7 +23278,7 @@ var RUNTIME_DELIVERY_COMMITTED_KIND = "runtime.delivery.committed";
23278
23278
  var SESSION_STARTED_KIND = "session.started";
23279
23279
  var AGENT_MESSAGE_DELTA_KIND = "agent.message.delta";
23280
23280
  var AGENT_ACTIVITY_KIND = "agent.activity";
23281
- var AGENT_ACTIVITY_DETAIL_LIMIT = 24e3;
23281
+ var AGENT_ACTIVITY_DETAIL_LIMIT = 5e5;
23282
23282
  var AGENT_ACTIVITY_RECORDED_FIELD_LIMIT = 4e6;
23283
23283
  var AGENT_ACTIVITY_RECORDED_DETAIL_LIMIT = 6e6;
23284
23284
  var AGENT_ACTIVITY_LOCATION_LIMIT = 12;
@@ -24039,6 +24039,39 @@ function decodeRecordedSessionEvent(encoded) {
24039
24039
  }
24040
24040
  var encodeRecordedSessionEvent = (event) => JSON.stringify(decodeRecordedSessionEvent(JSON.stringify(event)));
24041
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
+
24042
24075
  // ../protocol/src/daemon-transport.ts
24043
24076
  function defineMessageSignature(kind, encoder, decoder) {
24044
24077
  const schema = (message) => decoder(JSON.stringify(message));
@@ -24136,6 +24169,11 @@ var serviceToDaemonSignatures = {
24136
24169
  encodeSessionEventRejection,
24137
24170
  decodeSessionEventRejection
24138
24171
  ),
24172
+ [SESSION_LIVE_HISTORY_LOAD_KIND]: defineMessageSignature(
24173
+ SESSION_LIVE_HISTORY_LOAD_KIND,
24174
+ encodeSessionLiveHistoryLoad,
24175
+ decodeSessionLiveHistoryLoad
24176
+ ),
24139
24177
  [SESSION_PERMISSION_RESPOND_KIND]: defineMessageSignature(
24140
24178
  SESSION_PERMISSION_RESPOND_KIND,
24141
24179
  encodeSessionPermissionRespondCommand,
@@ -24241,6 +24279,11 @@ var daemonToServiceSignatures = {
24241
24279
  encodeSessionOperationFailedEvent,
24242
24280
  decodeSessionOperationFailedEvent
24243
24281
  ),
24282
+ [SESSION_LIVE_HISTORY_LOADED_KIND]: defineMessageSignature(
24283
+ SESSION_LIVE_HISTORY_LOADED_KIND,
24284
+ encodeSessionLiveHistoryLoaded,
24285
+ decodeSessionLiveHistoryLoaded
24286
+ ),
24244
24287
  [SESSION_READY_KIND]: defineMessageSignature(SESSION_READY_KIND, encodeSessionReadyEvent, decodeSessionReadyEvent),
24245
24288
  [WORKSPACE_ENTRIES_KIND]: defineMessageSignature(
24246
24289
  WORKSPACE_ENTRIES_KIND,
@@ -30098,7 +30141,7 @@ var titleBefore = {
30098
30141
  };
30099
30142
  function tokenizeDefinition(effects, ok2, nok) {
30100
30143
  const self = this;
30101
- let identifier2;
30144
+ let identifier3;
30102
30145
  return start;
30103
30146
  function start(code) {
30104
30147
  effects.enter("definition");
@@ -30117,7 +30160,7 @@ function tokenizeDefinition(effects, ok2, nok) {
30117
30160
  )(code);
30118
30161
  }
30119
30162
  function labelAfter(code) {
30120
- 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));
30121
30164
  if (code === 58) {
30122
30165
  effects.enter("definitionMarker");
30123
30166
  effects.consume(code);
@@ -30151,7 +30194,7 @@ function tokenizeDefinition(effects, ok2, nok) {
30151
30194
  function afterWhitespace(code) {
30152
30195
  if (code === null || markdownLineEnding(code)) {
30153
30196
  effects.exit("definition");
30154
- self.parser.defined.push(identifier2);
30197
+ self.parser.defined.push(identifier3);
30155
30198
  return ok2(code);
30156
30199
  }
30157
30200
  return nok(code);
@@ -32282,9 +32325,9 @@ function preprocess2() {
32282
32325
  // ../../node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js
32283
32326
  var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
32284
32327
  function decodeString(value) {
32285
- return value.replace(characterEscapeOrReference, decode6);
32328
+ return value.replace(characterEscapeOrReference, decode7);
32286
32329
  }
32287
- function decode6($0, $1, $2) {
32330
+ function decode7($0, $1, $2) {
32288
32331
  if ($1) {
32289
32332
  return $1;
32290
32333
  }
@@ -36579,6 +36622,14 @@ var AcpSessionManager = class {
36579
36622
  this.#nativeOperations.delete(key);
36580
36623
  }
36581
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
+ };
36582
36633
  openNativeSession = async (options, origin) => {
36583
36634
  const key = `${options.agent.id}:${origin.nativeSessionId}`;
36584
36635
  if (this.#nativeOperations.has(key)) {
@@ -40560,6 +40611,52 @@ async function executeSessionPrepare(publisher, socket, command, config2, direct
40560
40611
  reportOperationFailure(socket, command.requestId, command.sessionId, error62, metrics.snapshot());
40561
40612
  }
40562
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
+ }
40563
40660
  async function executeSessionConfigure(publisher, socket, command, config2, directories, audit, sessions, signal) {
40564
40661
  try {
40565
40662
  const resolved = await resolveSessionDirectories(
@@ -41401,6 +41498,19 @@ async function runRelayConnection(config2, directories, audit, sessions, install
41401
41498
  }
41402
41499
  return;
41403
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
+ }
41404
41514
  if (kind === NATIVE_SESSION_CANCEL_KIND) {
41405
41515
  const command2 = message;
41406
41516
  const pending = nativeRequests.get(command2.requestId);