@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/runtime.js CHANGED
@@ -23195,7 +23195,7 @@ var RUNTIME_DELIVERY_COMMITTED_KIND = "runtime.delivery.committed";
23195
23195
  var SESSION_STARTED_KIND = "session.started";
23196
23196
  var AGENT_MESSAGE_DELTA_KIND = "agent.message.delta";
23197
23197
  var AGENT_ACTIVITY_KIND = "agent.activity";
23198
- var AGENT_ACTIVITY_DETAIL_LIMIT = 24e3;
23198
+ var AGENT_ACTIVITY_DETAIL_LIMIT = 5e5;
23199
23199
  var AGENT_ACTIVITY_RECORDED_FIELD_LIMIT = 4e6;
23200
23200
  var AGENT_ACTIVITY_RECORDED_DETAIL_LIMIT = 6e6;
23201
23201
  var AGENT_ACTIVITY_LOCATION_LIMIT = 12;
@@ -23956,6 +23956,39 @@ function decodeRecordedSessionEvent(encoded) {
23956
23956
  }
23957
23957
  var encodeRecordedSessionEvent = (event) => JSON.stringify(decodeRecordedSessionEvent(JSON.stringify(event)));
23958
23958
 
23959
+ // ../protocol/src/session-live-history.ts
23960
+ var SESSION_LIVE_HISTORY_LOAD_KIND = "session.live-history.load";
23961
+ var SESSION_LIVE_HISTORY_LOADED_KIND = "session.live-history.loaded";
23962
+ var identifier2 = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/);
23963
+ var directoryIdentifier = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/);
23964
+ var sessionLiveHistoryLoadSchema = external_exports.strictObject({
23965
+ additionalDirectoryIds: external_exports.array(directoryIdentifier).max(16).readonly(),
23966
+ agentId: identifier2,
23967
+ bindingId: identifier2,
23968
+ directoryId: directoryIdentifier,
23969
+ kind: external_exports.literal(SESSION_LIVE_HISTORY_LOAD_KIND),
23970
+ requestId: identifier2,
23971
+ sessionId: identifier2
23972
+ }).readonly();
23973
+ var sessionLiveHistoryLoadedSchema = external_exports.strictObject({
23974
+ history: sessionHistorySchema,
23975
+ kind: external_exports.literal(SESSION_LIVE_HISTORY_LOADED_KIND),
23976
+ requestId: identifier2,
23977
+ sessionId: identifier2
23978
+ }).readonly();
23979
+ function decode6(schema, encoded) {
23980
+ try {
23981
+ const value = JSON.parse(encoded);
23982
+ return schema.parse(value);
23983
+ } catch (cause) {
23984
+ throw new ProtocolMessageError("Invalid live Session history message", { cause });
23985
+ }
23986
+ }
23987
+ var decodeSessionLiveHistoryLoad = (encoded) => decode6(sessionLiveHistoryLoadSchema, encoded);
23988
+ var decodeSessionLiveHistoryLoaded = (encoded) => decode6(sessionLiveHistoryLoadedSchema, encoded);
23989
+ var encodeSessionLiveHistoryLoad = (value) => JSON.stringify(sessionLiveHistoryLoadSchema.parse(value));
23990
+ var encodeSessionLiveHistoryLoaded = (value) => JSON.stringify(sessionLiveHistoryLoadedSchema.parse(value));
23991
+
23959
23992
  // ../protocol/src/daemon-transport.ts
23960
23993
  function defineMessageSignature(kind, encoder, decoder) {
23961
23994
  const schema = (message) => decoder(JSON.stringify(message));
@@ -24053,6 +24086,11 @@ var serviceToDaemonSignatures = {
24053
24086
  encodeSessionEventRejection,
24054
24087
  decodeSessionEventRejection
24055
24088
  ),
24089
+ [SESSION_LIVE_HISTORY_LOAD_KIND]: defineMessageSignature(
24090
+ SESSION_LIVE_HISTORY_LOAD_KIND,
24091
+ encodeSessionLiveHistoryLoad,
24092
+ decodeSessionLiveHistoryLoad
24093
+ ),
24056
24094
  [SESSION_PERMISSION_RESPOND_KIND]: defineMessageSignature(
24057
24095
  SESSION_PERMISSION_RESPOND_KIND,
24058
24096
  encodeSessionPermissionRespondCommand,
@@ -24158,6 +24196,11 @@ var daemonToServiceSignatures = {
24158
24196
  encodeSessionOperationFailedEvent,
24159
24197
  decodeSessionOperationFailedEvent
24160
24198
  ),
24199
+ [SESSION_LIVE_HISTORY_LOADED_KIND]: defineMessageSignature(
24200
+ SESSION_LIVE_HISTORY_LOADED_KIND,
24201
+ encodeSessionLiveHistoryLoaded,
24202
+ decodeSessionLiveHistoryLoaded
24203
+ ),
24161
24204
  [SESSION_READY_KIND]: defineMessageSignature(SESSION_READY_KIND, encodeSessionReadyEvent, decodeSessionReadyEvent),
24162
24205
  [WORKSPACE_ENTRIES_KIND]: defineMessageSignature(
24163
24206
  WORKSPACE_ENTRIES_KIND,
@@ -29100,7 +29143,7 @@ var titleBefore = {
29100
29143
  };
29101
29144
  function tokenizeDefinition(effects, ok2, nok) {
29102
29145
  const self = this;
29103
- let identifier2;
29146
+ let identifier3;
29104
29147
  return start;
29105
29148
  function start(code) {
29106
29149
  effects.enter("definition");
@@ -29119,7 +29162,7 @@ function tokenizeDefinition(effects, ok2, nok) {
29119
29162
  )(code);
29120
29163
  }
29121
29164
  function labelAfter(code) {
29122
- identifier2 = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));
29165
+ identifier3 = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));
29123
29166
  if (code === 58) {
29124
29167
  effects.enter("definitionMarker");
29125
29168
  effects.consume(code);
@@ -29153,7 +29196,7 @@ function tokenizeDefinition(effects, ok2, nok) {
29153
29196
  function afterWhitespace(code) {
29154
29197
  if (code === null || markdownLineEnding(code)) {
29155
29198
  effects.exit("definition");
29156
- self.parser.defined.push(identifier2);
29199
+ self.parser.defined.push(identifier3);
29157
29200
  return ok2(code);
29158
29201
  }
29159
29202
  return nok(code);
@@ -31284,9 +31327,9 @@ function preprocess2() {
31284
31327
  // ../../node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.js
31285
31328
  var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
31286
31329
  function decodeString(value) {
31287
- return value.replace(characterEscapeOrReference, decode6);
31330
+ return value.replace(characterEscapeOrReference, decode7);
31288
31331
  }
31289
- function decode6($0, $1, $2) {
31332
+ function decode7($0, $1, $2) {
31290
31333
  if ($1) {
31291
31334
  return $1;
31292
31335
  }
@@ -35581,6 +35624,14 @@ var AcpSessionManager = class {
35581
35624
  this.#nativeOperations.delete(key);
35582
35625
  }
35583
35626
  };
35627
+ loadSessionHistory = async (options) => {
35628
+ this.#beginSessionUse(options.sessionId);
35629
+ try {
35630
+ return await (await this.ensureSession(options)).loadHistory(options.signal);
35631
+ } finally {
35632
+ this.#endSessionUse(options.sessionId);
35633
+ }
35634
+ };
35584
35635
  openNativeSession = async (options, origin) => {
35585
35636
  const key = `${options.agent.id}:${origin.nativeSessionId}`;
35586
35637
  if (this.#nativeOperations.has(key)) {
@@ -39562,6 +39613,52 @@ async function executeSessionPrepare(publisher, socket, command, config2, direct
39562
39613
  reportOperationFailure(socket, command.requestId, command.sessionId, error62, metrics.snapshot());
39563
39614
  }
39564
39615
  }
39616
+ async function executeSessionLiveHistoryLoad(socket, command, config2, directories, audit, sessions, signal) {
39617
+ try {
39618
+ const resolved = await resolveSessionDirectories(
39619
+ directories,
39620
+ config2.bindingId,
39621
+ command.directoryId,
39622
+ command.additionalDirectoryIds,
39623
+ signal
39624
+ );
39625
+ const history = await sessions.loadSessionHistory({
39626
+ additionalDirectories: resolved.additionalDirectories,
39627
+ agent: config2.catalog.find(command.agentId),
39628
+ cwd: resolved.cwd,
39629
+ sessionId: command.sessionId,
39630
+ signal
39631
+ });
39632
+ signal.throwIfAborted();
39633
+ audit.record({
39634
+ commandId: command.requestId,
39635
+ event: "session_history_loaded",
39636
+ sessionId: command.sessionId
39637
+ });
39638
+ send(socket, {
39639
+ history,
39640
+ kind: "session.live-history.loaded",
39641
+ requestId: command.requestId,
39642
+ sessionId: command.sessionId
39643
+ });
39644
+ } catch (error62) {
39645
+ if (signal.aborted) {
39646
+ return;
39647
+ }
39648
+ audit.record({
39649
+ commandId: command.requestId,
39650
+ details: { code: operationErrorCode(error62) },
39651
+ event: "session_history_unavailable",
39652
+ sessionId: command.sessionId
39653
+ });
39654
+ send(socket, {
39655
+ history: { status: "unavailable" },
39656
+ kind: "session.live-history.loaded",
39657
+ requestId: command.requestId,
39658
+ sessionId: command.sessionId
39659
+ });
39660
+ }
39661
+ }
39565
39662
  async function executeSessionConfigure(publisher, socket, command, config2, directories, audit, sessions, signal) {
39566
39663
  try {
39567
39664
  const resolved = await resolveSessionDirectories(
@@ -40403,6 +40500,19 @@ async function runRelayConnection(config2, directories, audit, sessions, install
40403
40500
  }
40404
40501
  return;
40405
40502
  }
40503
+ if (kind === SESSION_LIVE_HISTORY_LOAD_KIND) {
40504
+ const command2 = decodeSessionLiveHistoryLoad(encoded);
40505
+ void executeSessionLiveHistoryLoad(
40506
+ socket,
40507
+ command2,
40508
+ config2,
40509
+ directories,
40510
+ audit,
40511
+ sessions,
40512
+ connectionController.signal
40513
+ );
40514
+ return;
40515
+ }
40406
40516
  if (kind === NATIVE_SESSION_CANCEL_KIND) {
40407
40517
  const command2 = message;
40408
40518
  const pending = nativeRequests.get(command2.requestId);