@moxt-ai/mobius 0.0.321 → 0.0.323

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
@@ -2086,7 +2086,7 @@ var init_package = __esm({
2086
2086
  "package.json"() {
2087
2087
  package_default = {
2088
2088
  name: "@moxt-ai/mobius",
2089
- version: "0.0.321",
2089
+ version: "0.0.323",
2090
2090
  description: "Mobius CLI for pairing and running local AI agent services.",
2091
2091
  type: "module",
2092
2092
  bin: {
@@ -75468,8 +75468,15 @@ var init_usage = __esm({
75468
75468
  }
75469
75469
  });
75470
75470
 
75471
+ // ../mobius-sdk/src/protocol/session/recording/recorded-lifecycle-status.ts
75472
+ var init_recorded_lifecycle_status = __esm({
75473
+ "../mobius-sdk/src/protocol/session/recording/recorded-lifecycle-status.ts"() {
75474
+ "use strict";
75475
+ }
75476
+ });
75477
+
75471
75478
  // ../mobius-sdk/src/protocol/session/recording/recording.ts
75472
- var sessionRecordingWriteSchema, sessionRecordingHistorySchema, sessionRecordingStatusSchema, recordingCursorSchema, sessionRecordingHistoryPageSchema, sessionRecordingSummarySchema, sessionRecordingDirectorySchema;
75479
+ var sessionRecordingWriteSchema, sessionRecordingHistorySchema, sessionRecordingStatusSchema, recordingCursorSchema, sessionRecordingHistoryPageSchema, sessionRecordingSummaryFields, sessionRecordingSummaryV2Schema, sessionRecordingDirectoryV2Schema, sessionRecordingSummarySchema, sessionRecordingDirectorySchema;
75473
75480
  var init_recording = __esm({
75474
75481
  "../mobius-sdk/src/protocol/session/recording/recording.ts"() {
75475
75482
  "use strict";
@@ -75501,16 +75508,18 @@ var init_recording = __esm({
75501
75508
  truncated: external_exports.boolean(),
75502
75509
  version: external_exports.literal(2)
75503
75510
  }).readonly();
75504
- sessionRecordingSummarySchema = external_exports.object({
75511
+ sessionRecordingSummaryFields = {
75505
75512
  additionalDirectoryIds: external_exports.array(DIRECTORY_IDENTIFIER).max(16).readonly(),
75506
75513
  agentId: identifierStringSchema,
75507
75514
  directoryId: DIRECTORY_IDENTIFIER,
75508
75515
  runtimeId: identifierStringSchema,
75509
75516
  sessionId: identifierStringSchema,
75510
- status: sessionRecordingStatusSchema,
75511
75517
  title: external_exports.string().max(1e3),
75512
75518
  updatedAt: external_exports.iso.datetime({ offset: true })
75513
- }).readonly();
75519
+ };
75520
+ sessionRecordingSummaryV2Schema = external_exports.object(sessionRecordingSummaryFields).readonly();
75521
+ sessionRecordingDirectoryV2Schema = external_exports.object({ sessions: external_exports.array(sessionRecordingSummaryV2Schema).max(1e5).readonly() }).readonly();
75522
+ sessionRecordingSummarySchema = external_exports.object({ ...sessionRecordingSummaryFields, status: sessionRecordingStatusSchema }).readonly();
75514
75523
  sessionRecordingDirectorySchema = external_exports.object({
75515
75524
  sessions: external_exports.array(sessionRecordingSummarySchema).max(1e5).readonly()
75516
75525
  }).readonly();
@@ -76135,6 +76144,7 @@ var init_protocol = __esm({
76135
76144
  init_history2();
76136
76145
  init_commands();
76137
76146
  init_usage();
76147
+ init_recorded_lifecycle_status();
76138
76148
  init_turn_history();
76139
76149
  init_webhooks();
76140
76150
  init_turn();
@@ -91190,6 +91200,22 @@ async function copyVersionData(root, sourceVersion, targetVersion, signal) {
91190
91200
  await rm3(staging, { recursive: true, force: true });
91191
91201
  }
91192
91202
  }
91203
+ async function discardVersionData(root, version2, signal) {
91204
+ if (await readCurrentDataVersion(root, signal) === version2 || !await versionDataExists(root, version2, signal)) {
91205
+ return;
91206
+ }
91207
+ const versions = join25(root, STATE_ROOT_LAYOUT.versions);
91208
+ const discarded = join25(versions, `.${version2}-discarded-${randomUUID12()}`);
91209
+ try {
91210
+ await rename4(join25(versions, version2), discarded);
91211
+ } catch (cause) {
91212
+ if (isNodeError(cause, "ENOENT")) {
91213
+ return;
91214
+ }
91215
+ throw cause;
91216
+ }
91217
+ await rm3(discarded, { recursive: true, force: true });
91218
+ }
91193
91219
  async function writeCurrentDataVersion(root, version2, signal) {
91194
91220
  await validateLocalPath(root, true, true, signal);
91195
91221
  await validateLocalPath(join25(root, STATE_ROOT_LAYOUT.versions, version2), true, true, signal);
@@ -91430,6 +91456,9 @@ async function prepareVersionData(version2, signal, environment = process.env, f
91430
91456
  );
91431
91457
  }
91432
91458
  }
91459
+ async function discardRolledBackData(version2, signal) {
91460
+ await discardVersionData(readStateDirectory(), runtimeUpgradeVersionSchema.parse(version2), signal);
91461
+ }
91433
91462
  async function recordCurrentData(version2, signal) {
91434
91463
  await writeCurrentDataVersion(readStateDirectory(), runtimeUpgradeVersionSchema.parse(version2), signal);
91435
91464
  }
@@ -92685,6 +92714,7 @@ async function runManager(stateDirectory, signal) {
92685
92714
  retryAfter: Date.now() + 8 * 36e5
92686
92715
  };
92687
92716
  await start(transition2.previous);
92717
+ await discardRolledBackData(transition2.next.version, combined);
92688
92718
  }
92689
92719
  };
92690
92720
  const handle = async (value, requestSignal) => {
@@ -92789,6 +92819,7 @@ var init_manager = __esm({
92789
92819
  init_manager_lock();
92790
92820
  init_local_server();
92791
92821
  init_protocol2();
92822
+ init_data();
92792
92823
  init_unhandled_rejection();
92793
92824
  init_worker_lifecycle_log();
92794
92825
  init_worker_process();
@@ -96040,22 +96071,13 @@ var init_session_manager = __esm({
96040
96071
  throw new AcpExecutionError("The native session is being managed", {}, "session_busy");
96041
96072
  }
96042
96073
  const linked = this.#store.findNative(options2.agent.id, origin.nativeSessionId);
96043
- if (linked.some(
96044
- (entry) => this.#executions.command(entry.sessionId) !== void 0 || this.#executionProcesses.pending(entry.sessionId) !== void 0
96045
- )) {
96046
- throw new AcpExecutionError(
96047
- "Wait for the native session's running operation to finish",
96048
- {},
96049
- "session_busy"
96050
- );
96051
- }
96052
96074
  const existing = linked[0];
96053
96075
  if (origin.kind === "import" && existing !== void 0) {
96054
96076
  return await this.#executionProcesses.use(existing.sessionId, async () => {
96055
96077
  this.#closedSessions.delete(existing.sessionId);
96056
96078
  const target2 = await this.#nativeTargetOptions(options2, existing.sessionId, resolveAgent);
96057
96079
  const runtime = await this.ensureSession(target2);
96058
- if (this.#executions.command(existing.sessionId) !== void 0 || this.#nativeOperations.has(key)) {
96080
+ if (this.#nativeOperations.has(key)) {
96059
96081
  throw new AcpExecutionError(
96060
96082
  "Wait for the native session's running operation to finish",
96061
96083
  {},
@@ -96074,6 +96096,15 @@ var init_session_manager = __esm({
96074
96096
  }
96075
96097
  });
96076
96098
  }
96099
+ if (linked.some(
96100
+ (entry) => this.#executions.command(entry.sessionId) !== void 0 || this.#executionProcesses.pending(entry.sessionId) !== void 0
96101
+ )) {
96102
+ throw new AcpExecutionError(
96103
+ "Wait for the native session's running operation to finish",
96104
+ {},
96105
+ "session_busy"
96106
+ );
96107
+ }
96077
96108
  const target = await this.#nativeTargetOptions(options2, options2.sessionId, resolveAgent);
96078
96109
  if (this.#executionProcesses.get(options2.sessionId) !== void 0 || this.#executionProcesses.pending(options2.sessionId) !== void 0 || this.#store.read(options2.sessionId) instanceof FoundStoredSession) {
96079
96110
  throw new AcpExecutionError(