@moxt-ai/mobius 0.0.340 → 0.0.341

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.340",
2089
+ version: "0.0.341",
2090
2090
  description: "Mobius CLI for pairing and running local AI agent services.",
2091
2091
  type: "module",
2092
2092
  bin: {
@@ -73874,16 +73874,6 @@ var init_mobius_api = __esm({
73874
73874
  }
73875
73875
  });
73876
73876
 
73877
- // ../mobius-sdk/src/protocol/platform/project-location.ts
73878
- var PROJECT_LOCATION_HINTS, projectLocationHints;
73879
- var init_project_location = __esm({
73880
- "../mobius-sdk/src/protocol/platform/project-location.ts"() {
73881
- "use strict";
73882
- PROJECT_LOCATION_HINTS = ["wnam", "enam", "sam", "weur", "eeur", "apac", "apac-ne", "apac-se", "oc", "afr", "me"];
73883
- projectLocationHints = new Set(PROJECT_LOCATION_HINTS);
73884
- }
73885
- });
73886
-
73887
73877
  // ../mobius-sdk/src/protocol/shared/identifier.ts
73888
73878
  function isIdentifier(value) {
73889
73879
  return identifierSchema.safeParse(value).success;
@@ -74111,13 +74101,14 @@ var init_liveness = __esm({
74111
74101
  });
74112
74102
 
74113
74103
  // ../mobius-sdk/src/protocol/runtime/upgrade.ts
74114
- var runtimeUpgradeVersionSchema, runtimeUpgradeResultSchema, decodeRuntimeUpgradeResult, encodeRuntimeUpgradeResult;
74104
+ var runtimeUpgradeVersionSchema, decodeRuntimeUpgradeVersion, runtimeUpgradeResultSchema, decodeRuntimeUpgradeResult, encodeRuntimeUpgradeResult;
74115
74105
  var init_upgrade = __esm({
74116
74106
  "../mobius-sdk/src/protocol/runtime/upgrade.ts"() {
74117
74107
  "use strict";
74118
74108
  init_zod();
74119
74109
  init_identifier();
74120
74110
  runtimeUpgradeVersionSchema = external_exports.string().max(128).regex(/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/);
74111
+ decodeRuntimeUpgradeVersion = (value) => runtimeUpgradeVersionSchema.parse(value);
74121
74112
  runtimeUpgradeResultSchema = external_exports.strictObject({
74122
74113
  kind: external_exports.literal("runtime.upgrade.result"),
74123
74114
  requestId: external_exports.custom(isIdentifier),
@@ -74147,25 +74138,6 @@ var init_upgrade = __esm({
74147
74138
  }
74148
74139
  });
74149
74140
 
74150
- // ../mobius-sdk/src/protocol/session/access/index.ts
74151
- var MAXIMUM_LIFETIME_MILLISECONDS, claimsSchema;
74152
- var init_access = __esm({
74153
- "../mobius-sdk/src/protocol/session/access/index.ts"() {
74154
- "use strict";
74155
- init_zod();
74156
- init_identifier();
74157
- MAXIMUM_LIFETIME_MILLISECONDS = 15 * 60 * 1e3;
74158
- claimsSchema = external_exports.object({
74159
- expiresAtEpochMilliseconds: external_exports.number().int().nonnegative(),
74160
- issuedAtEpochMilliseconds: external_exports.number().int().nonnegative(),
74161
- projectId: identifierStringSchema,
74162
- purpose: external_exports.literal("session-access"),
74163
- runtimeId: identifierStringSchema,
74164
- sessionId: identifierStringSchema
74165
- }).readonly();
74166
- }
74167
- });
74168
-
74169
74141
  // ../mobius-sdk/src/protocol/session/agent/catalog.ts
74170
74142
  var AGENT_CATALOG_DISCOVER_KIND, AGENT_CATALOG_DISCOVERED_KIND, AGENT_CATALOG_DISCOVERY_FAILED_KIND, catalogedAgentSchema, agentCatalogDiscoverCommandSchema, agentCatalogDiscoveredEventSchema, agentCatalogDiscoveryFailedEventSchema, decodeAgentCatalogDiscoverCommand, encodeAgentCatalogDiscoverCommand, decodeAgentCatalogDiscoveredEvent, encodeAgentCatalogDiscoveredEvent, decodeAgentCatalogDiscoveryFailedEvent, encodeAgentCatalogDiscoveryFailedEvent;
74171
74143
  var init_catalog = __esm({
@@ -74537,7 +74509,7 @@ function boundedJsonIssue(value, depth = 0) {
74537
74509
  }
74538
74510
  return "Value is not bounded JSON";
74539
74511
  }
74540
- var MAX_CONTENT_LENGTH, MAX_COLLECTION_SIZE, MAX_JSON_DEPTH, MAX_JSON_KEYS, boundedString, boundedJsonSchema, toolCallLocationSchema;
74512
+ var MAX_CONTENT_LENGTH, MAX_COLLECTION_SIZE, MAX_JSON_DEPTH, MAX_JSON_KEYS, boundedString, boundedJsonSchema, isBoundedJson, toolCallLocationSchema;
74541
74513
  var init_tool_input = __esm({
74542
74514
  "../mobius-sdk/src/protocol/shared/tool-input.ts"() {
74543
74515
  "use strict";
@@ -74553,6 +74525,7 @@ var init_tool_input = __esm({
74553
74525
  context.addIssue({ code: "custom", message: issue2 });
74554
74526
  }
74555
74527
  });
74528
+ isBoundedJson = (value) => boundedJsonIssue(value) === null;
74556
74529
  toolCallLocationSchema = external_exports.object({
74557
74530
  line: external_exports.number().int().nonnegative().safe().nullable().optional(),
74558
74531
  path: boundedString
@@ -74723,7 +74696,6 @@ var init_events = __esm({
74723
74696
  init_zod();
74724
74697
  init_directory();
74725
74698
  init_tool_input();
74726
- init_tool_input();
74727
74699
  init_identifier();
74728
74700
  init_message_codec();
74729
74701
  init_interactions();
@@ -75283,73 +75255,6 @@ var init_files = __esm({
75283
75255
  }
75284
75256
  });
75285
75257
 
75286
- // ../mobius-sdk/src/protocol/session/interactions/model.ts
75287
- var timestampSchema, permissionRequestSchema, elicitationRequestSchema, interactionRequestSchema, interactionResponseSchema, interactionStateSchema, interactionSchema;
75288
- var init_model = __esm({
75289
- "../mobius-sdk/src/protocol/session/interactions/model.ts"() {
75290
- "use strict";
75291
- init_zod();
75292
- init_identifier();
75293
- init_interactions();
75294
- timestampSchema = external_exports.string().datetime({ offset: true });
75295
- permissionRequestSchema = external_exports.object({
75296
- kind: external_exports.literal("permission"),
75297
- options: external_exports.array(permissionOptionSchema).min(1).max(20).readonly(),
75298
- title: external_exports.string().min(1).max(500),
75299
- toolCallId: external_exports.string().min(1).max(255),
75300
- toolKind: external_exports.string().max(64)
75301
- }).readonly();
75302
- elicitationRequestSchema = external_exports.object({
75303
- elicitationId: external_exports.string().max(255),
75304
- fields: external_exports.array(elicitationFieldSchema).max(100).readonly(),
75305
- kind: external_exports.literal("elicitation"),
75306
- message: external_exports.string().min(1).max(2e3),
75307
- mode: external_exports.enum(["form", "url"]),
75308
- url: external_exports.string().max(4096)
75309
- }).readonly();
75310
- interactionRequestSchema = external_exports.discriminatedUnion("kind", [permissionRequestSchema, elicitationRequestSchema]);
75311
- interactionResponseSchema = external_exports.object({
75312
- content: external_exports.string().max(1e5),
75313
- kind: external_exports.enum(["permission", "elicitation"])
75314
- }).readonly();
75315
- interactionStateSchema = external_exports.discriminatedUnion("kind", [
75316
- external_exports.object({ kind: external_exports.literal("pending") }).readonly(),
75317
- external_exports.object({
75318
- kind: external_exports.literal("responded"),
75319
- respondedAt: timestampSchema,
75320
- responderId: identifierSchema,
75321
- response: interactionResponseSchema
75322
- }).readonly(),
75323
- external_exports.object({
75324
- kind: external_exports.literal("resolved"),
75325
- resolution: external_exports.discriminatedUnion("kind", [
75326
- external_exports.object({ kind: external_exports.literal("without_response") }).readonly(),
75327
- external_exports.object({
75328
- kind: external_exports.literal("response_applied"),
75329
- respondedAt: timestampSchema,
75330
- responderId: identifierSchema,
75331
- response: interactionResponseSchema
75332
- }).readonly()
75333
- ]),
75334
- resolvedAt: timestampSchema
75335
- }).readonly(),
75336
- external_exports.object({ expiredAt: timestampSchema, kind: external_exports.literal("expired") }).readonly(),
75337
- external_exports.object({
75338
- cancelledAt: timestampSchema,
75339
- kind: external_exports.literal("cancelled")
75340
- }).readonly()
75341
- ]);
75342
- interactionSchema = external_exports.object({
75343
- attemptId: identifierSchema,
75344
- interactionId: identifierSchema,
75345
- request: interactionRequestSchema,
75346
- sessionId: identifierSchema,
75347
- state: interactionStateSchema,
75348
- turnId: identifierSchema
75349
- }).readonly();
75350
- }
75351
- });
75352
-
75353
75258
  // ../mobius-sdk/src/protocol/session/lifecycle/index.ts
75354
75259
  var SESSION_PREPARE_KIND, SESSION_READY_KIND, SESSION_LIST_KIND, SESSION_LISTED_KIND, SESSION_QUERY_KIND, SESSION_QUERIED_KIND, SESSION_RESTORE_KIND, SESSION_RESTORED_KIND, SESSION_CLOSE_KIND, SESSION_CLOSED_KIND, SESSION_CLOSE_NOTICE_KIND, SESSION_CLOSED_ERROR_CODE, SESSION_STATUS_CHANGED_KIND, SESSION_COMMANDS_UPDATED_KIND, SESSION_INFO_UPDATED_KIND, SESSION_OPERATION_FAILED_KIND, sessionStatusChangedEventSchema, sessionMetadataSchema, sessionListCommandSchema, sessionsListedEventSchema, sessionQueryCommandSchema, sessionsQueriedEventSchema, sessionRestoreCommandSchema, sessionCloseCommandSchema, sessionPrepareCommandSchema, runtimeTimingsSchema, sessionReadyEventSchema, sessionRestoredEventSchema, sessionClosedEventSchema, sessionCloseNoticeEventSchema, sessionCommandsUpdatedEventSchema, sessionInfoUpdatedEventSchema, sessionOperationFailedEventSchema, decodeSessionListCommand, encodeSessionListCommand, decodeSessionsListedEvent, encodeSessionsListedEvent, decodeSessionQueryCommand, encodeSessionQueryCommand, decodeSessionsQueriedEvent, encodeSessionsQueriedEvent, decodeSessionRestoreCommand, encodeSessionRestoreCommand, decodeSessionRestoredEvent, encodeSessionRestoredEvent, decodeSessionCloseCommand, encodeSessionCloseCommand, decodeSessionClosedEvent, encodeSessionClosedEvent, decodeSessionCloseNoticeEvent, encodeSessionCloseNoticeEvent, decodeSessionStatusChangedEvent, encodeSessionStatusChangedEvent, decodeSessionPrepareCommand, encodeSessionPrepareCommand, decodeSessionReadyEvent, encodeSessionReadyEvent, decodeSessionInfoUpdatedEvent, encodeSessionInfoUpdatedEvent, decodeSessionOperationFailedEvent, encodeSessionOperationFailedEvent;
75355
75260
  var init_lifecycle = __esm({
@@ -75982,370 +75887,6 @@ var init_usage = __esm({
75982
75887
  }
75983
75888
  });
75984
75889
 
75985
- // ../mobius-sdk/src/protocol/session/recording/recorded-lifecycle-status.ts
75986
- var init_recorded_lifecycle_status = __esm({
75987
- "../mobius-sdk/src/protocol/session/recording/recorded-lifecycle-status.ts"() {
75988
- "use strict";
75989
- }
75990
- });
75991
-
75992
- // ../mobius-sdk/src/protocol/session/recording/recording.ts
75993
- var sessionRecordingWriteSchema, sessionRecordingWireWriteSchema, sessionRecordingHistorySchema, sessionRecordingStatusSchema, recordingCursorSchema, sessionRecordingHistoryPageSchema, sessionRecordingSummaryFields, sessionRecordingSummaryV2Schema, sessionRecordingDirectoryV2Schema, sessionRecordingSummarySchema, sessionRecordingDirectorySchema;
75994
- var init_recording = __esm({
75995
- "../mobius-sdk/src/protocol/session/recording/recording.ts"() {
75996
- "use strict";
75997
- init_zod();
75998
- init_directory();
75999
- init_identifier();
76000
- init_events();
76001
- sessionRecordingWriteSchema = external_exports.object({
76002
- envelope: sessionEventEnvelopeSchema,
76003
- projectId: identifierStringSchema,
76004
- runtimeId: identifierStringSchema
76005
- }).readonly();
76006
- sessionRecordingWireWriteSchema = external_exports.object({
76007
- envelope: sessionWireEnvelopeSchema,
76008
- projectId: identifierStringSchema,
76009
- runtimeId: identifierStringSchema
76010
- }).readonly();
76011
- sessionRecordingHistorySchema = external_exports.object({
76012
- events: external_exports.array(sessionLiveEventSchema).readonly(),
76013
- sessionId: identifierStringSchema
76014
- }).readonly();
76015
- sessionRecordingStatusSchema = external_exports.enum(["running", "idle", "failed"]);
76016
- recordingCursorSchema = external_exports.string().regex(/^v2:[1-9][0-9]*:(?:0|[1-9][0-9]*)$/);
76017
- sessionRecordingHistoryPageSchema = external_exports.object({
76018
- events: external_exports.array(sessionLiveEventSchema).max(1e4).readonly(),
76019
- // The append-order cursor after this page, or null when the caller has caught up.
76020
- nextCursor: recordingCursorSchema.nullable(),
76021
- // The append-order cursor at the newest recorded event, so an idle poller can compare one token.
76022
- tailCursor: recordingCursorSchema,
76023
- // True when a Session generation changed after the caller's cursor and it must replace its
76024
- // reconstructed state rather than append this page.
76025
- generationReset: external_exports.boolean(),
76026
- sessionId: identifierStringSchema,
76027
- truncated: external_exports.boolean(),
76028
- version: external_exports.literal(2)
76029
- }).readonly();
76030
- sessionRecordingSummaryFields = {
76031
- additionalDirectoryIds: external_exports.array(DIRECTORY_IDENTIFIER).max(16).readonly(),
76032
- agentId: identifierStringSchema,
76033
- directoryId: DIRECTORY_IDENTIFIER,
76034
- runtimeId: identifierStringSchema,
76035
- sessionId: identifierStringSchema,
76036
- title: external_exports.string().max(1e3),
76037
- updatedAt: external_exports.iso.datetime({ offset: true })
76038
- };
76039
- sessionRecordingSummaryV2Schema = external_exports.object(sessionRecordingSummaryFields).readonly();
76040
- sessionRecordingDirectoryV2Schema = external_exports.object({ sessions: external_exports.array(sessionRecordingSummaryV2Schema).max(1e5).readonly() }).readonly();
76041
- sessionRecordingSummarySchema = external_exports.object({ ...sessionRecordingSummaryFields, status: sessionRecordingStatusSchema }).readonly();
76042
- sessionRecordingDirectorySchema = external_exports.object({
76043
- sessions: external_exports.array(sessionRecordingSummarySchema).max(1e5).readonly()
76044
- }).readonly();
76045
- }
76046
- });
76047
-
76048
- // ../mobius-sdk/src/protocol/session/recording/turn-history.ts
76049
- var SESSION_RECORDING_TURN_PAGE_DECODE_MAX_ELEMENTS, SESSION_RECORDING_TURN_ITEM_ID_MAX_LENGTH, isoTimestamp, shortText, itemText, turnCursorSchema, turnItemCursorSchema, attemptTiming, promptSucceededOutcome, promptCancelledOutcome, promptFailedOutcome, sessionRecordingTurnAttemptSchema, turnItemBase, textItemFields, sessionRecordingToolDetailSchema, sessionRecordingTurnItemSchema, sessionRecordingTurnPromptSchema, sessionRecordingTurnPrecedingSchema, sessionRecordingTurnSchema, sessionRecordingInteractionSchema, SESSION_RECORDING_EXECUTION_COMMAND_MAX_LIMIT, recordingActiveCommandsSchema, sessionRecordingExecutionCommandSchema, sessionRecordingExecutionSchema, sessionRecordingTurnPageSchema, sessionRecordingTurnItemPageSchema, sessionRecordingTurnItemDetailSchema;
76050
- var init_turn_history = __esm({
76051
- "../mobius-sdk/src/protocol/session/recording/turn-history.ts"() {
76052
- "use strict";
76053
- init_zod();
76054
- init_identifier();
76055
- init_events();
76056
- init_interactions();
76057
- init_recording();
76058
- SESSION_RECORDING_TURN_PAGE_DECODE_MAX_ELEMENTS = 1e4;
76059
- SESSION_RECORDING_TURN_ITEM_ID_MAX_LENGTH = 4200;
76060
- isoTimestamp = external_exports.iso.datetime({ offset: true });
76061
- shortText = external_exports.string().max(2048);
76062
- itemText = external_exports.string().max(5e7);
76063
- turnCursorSchema = external_exports.string().regex(/^turn:[1-9][0-9]*$/);
76064
- turnItemCursorSchema = external_exports.string().regex(/^(?:before|after):item:(?:0|[1-9][0-9]*)$/);
76065
- attemptTiming = {
76066
- attemptId: identifierStringSchema.optional(),
76067
- startedAt: isoTimestamp.optional()
76068
- };
76069
- promptSucceededOutcome = { completedAt: isoTimestamp, stopReason: shortText };
76070
- promptCancelledOutcome = { cancelledAt: isoTimestamp };
76071
- promptFailedOutcome = {
76072
- code: identifierStringSchema,
76073
- failedAt: isoTimestamp,
76074
- message: external_exports.string().min(1).max(500)
76075
- };
76076
- sessionRecordingTurnAttemptSchema = external_exports.discriminatedUnion("kind", [
76077
- external_exports.object({ kind: external_exports.literal("none") }).readonly(),
76078
- external_exports.object({ ...attemptTiming, kind: external_exports.literal("running") }).readonly(),
76079
- external_exports.object({
76080
- ...attemptTiming,
76081
- interactionIds: external_exports.array(identifierStringSchema).min(1).max(100).readonly(),
76082
- kind: external_exports.literal("waiting_input")
76083
- }).readonly(),
76084
- external_exports.object({ ...attemptTiming, ...promptSucceededOutcome, kind: external_exports.literal("succeeded") }).readonly(),
76085
- external_exports.object({ ...attemptTiming, ...promptCancelledOutcome, kind: external_exports.literal("cancelled") }).readonly(),
76086
- external_exports.object({ ...attemptTiming, ...promptFailedOutcome, kind: external_exports.literal("failed") }).readonly(),
76087
- // A Session generation change restarted the local Agent process before this attempt ended.
76088
- external_exports.object({
76089
- ...attemptTiming,
76090
- detectedAt: isoTimestamp,
76091
- kind: external_exports.literal("indeterminate"),
76092
- reason: external_exports.literal("session_generation_changed")
76093
- }).readonly()
76094
- ]);
76095
- turnItemBase = {
76096
- // Opaque and stable for the life of the item; derived from the event, message, or tool call it merges.
76097
- itemId: external_exports.string().min(1).max(SESSION_RECORDING_TURN_ITEM_ID_MAX_LENGTH),
76098
- // Creation order inside the Turn; answer, thought, and tool items share one sequence.
76099
- sequence: external_exports.number().int().nonnegative().safe()
76100
- };
76101
- textItemFields = {
76102
- omittedCharacters: external_exports.number().int().nonnegative().safe(),
76103
- text: itemText
76104
- };
76105
- sessionRecordingToolDetailSchema = external_exports.discriminatedUnion("kind", [
76106
- external_exports.object({
76107
- content: external_exports.array(toolCallContentSchema).max(1e3).readonly(),
76108
- kind: external_exports.literal("inline"),
76109
- rawInput: boundedJsonSchema.optional(),
76110
- rawOutput: boundedJsonSchema.optional()
76111
- }).readonly(),
76112
- // The detail exceeded the page bound; a full item read returns it inline.
76113
- external_exports.object({ kind: external_exports.literal("omitted") }).readonly()
76114
- ]);
76115
- sessionRecordingTurnItemSchema = external_exports.discriminatedUnion("kind", [
76116
- external_exports.object({ ...turnItemBase, ...textItemFields, kind: external_exports.literal("answer") }).readonly(),
76117
- external_exports.object({ ...turnItemBase, ...textItemFields, kind: external_exports.literal("thought") }).readonly(),
76118
- external_exports.object({
76119
- ...turnItemBase,
76120
- attemptId: identifierStringSchema.optional(),
76121
- detail: sessionRecordingToolDetailSchema,
76122
- kind: external_exports.literal("tool"),
76123
- locations: external_exports.array(toolCallLocationSchema).max(1e3).readonly(),
76124
- name: shortText.nullable(),
76125
- status: toolStatusSchema.nullable(),
76126
- title: itemText,
76127
- toolCallId: shortText,
76128
- toolKind: toolKindSchema.nullable()
76129
- }).readonly()
76130
- ]);
76131
- sessionRecordingTurnPromptSchema = external_exports.object({
76132
- content: external_exports.array(contentBlockSchema).min(1).max(100).readonly(),
76133
- disposition: shortText.optional(),
76134
- targetCommandId: identifierStringSchema.optional()
76135
- }).readonly();
76136
- sessionRecordingTurnPrecedingSchema = external_exports.object({
76137
- commandId: identifierStringSchema,
76138
- itemCount: external_exports.number().int().nonnegative().safe()
76139
- }).readonly();
76140
- sessionRecordingTurnSchema = external_exports.object({
76141
- answerLength: external_exports.number().int().nonnegative().safe(),
76142
- attempt: sessionRecordingTurnAttemptSchema,
76143
- commandId: identifierStringSchema,
76144
- createdAt: isoTimestamp,
76145
- generationId: identifierStringSchema,
76146
- itemCount: external_exports.number().int().nonnegative().safe(),
76147
- items: external_exports.array(sessionRecordingTurnItemSchema).max(SESSION_RECORDING_TURN_PAGE_DECODE_MAX_ELEMENTS).readonly(),
76148
- // Continues this Turn's items before the listed run, or null when every item is listed. A
76149
- // page starts from the end of a Turn's sequence, so what it leaves out is the work that
76150
- // produced the conclusion it does show; this cursor reads that work back.
76151
- itemsCursor: turnItemCursorSchema.nullable(),
76152
- messageId: shortText.nullable(),
76153
- // Creation order of Turns in the Session; newer Turns have larger orders.
76154
- order: external_exports.number().int().positive().safe(),
76155
- // Null when the Recording holds Agent output for a command whose prompt it never recorded.
76156
- prompt: sessionRecordingTurnPromptSchema.nullable(),
76157
- // The command whose work was running when this prompt was requested and how many items it had
76158
- // by then, so a prompt that records no work of its own (a steer) can be placed where it was sent.
76159
- // Null when no other command was running.
76160
- preceding: sessionRecordingTurnPrecedingSchema.nullable()
76161
- }).readonly();
76162
- sessionRecordingInteractionSchema = external_exports.discriminatedUnion("kind", [
76163
- external_exports.object({
76164
- commandId: identifierStringSchema,
76165
- event: sessionPermissionRequestedEventSchema,
76166
- interactionId: identifierStringSchema,
76167
- kind: external_exports.literal("permission")
76168
- }).readonly(),
76169
- external_exports.object({
76170
- commandId: identifierStringSchema,
76171
- event: sessionElicitationRequestedEventSchema,
76172
- interactionId: identifierStringSchema,
76173
- kind: external_exports.literal("elicitation")
76174
- }).readonly()
76175
- ]);
76176
- SESSION_RECORDING_EXECUTION_COMMAND_MAX_LIMIT = 100;
76177
- recordingActiveCommandsSchema = external_exports.object({
76178
- commandIds: external_exports.array(identifierStringSchema).max(1e3).readonly(),
76179
- generationId: identifierStringSchema
76180
- }).readonly().nullable();
76181
- sessionRecordingExecutionCommandSchema = external_exports.object({
76182
- attempt: sessionRecordingTurnAttemptSchema,
76183
- commandId: identifierStringSchema,
76184
- generationId: identifierStringSchema
76185
- }).readonly();
76186
- sessionRecordingExecutionSchema = external_exports.object({
76187
- activeCommands: recordingActiveCommandsSchema,
76188
- commands: external_exports.array(sessionRecordingExecutionCommandSchema).max(SESSION_RECORDING_EXECUTION_COMMAND_MAX_LIMIT).readonly(),
76189
- sessionId: identifierStringSchema,
76190
- tailCursor: recordingCursorSchema,
76191
- version: external_exports.literal(1)
76192
- }).readonly();
76193
- sessionRecordingTurnPageSchema = external_exports.object({
76194
- // Commands that own Agent output in the newest Session generation, innermost last.
76195
- activeCommands: external_exports.object({
76196
- commandIds: external_exports.array(identifierStringSchema).max(1e3).readonly(),
76197
- generationId: identifierStringSchema
76198
- }).readonly().nullable(),
76199
- // Requests still waiting for an answer in a Turn that can still receive one.
76200
- interactions: external_exports.array(sessionRecordingInteractionSchema).max(1e3).readonly(),
76201
- // Continues with older Turns, or null when the oldest Turn is listed.
76202
- nextCursor: turnCursorSchema.nullable(),
76203
- sessionId: identifierStringSchema,
76204
- // The Recording cursor at the last event this snapshot includes; live reads continue after it.
76205
- tailCursor: recordingCursorSchema,
76206
- title: external_exports.string().max(1e3).nullable(),
76207
- turns: external_exports.array(sessionRecordingTurnSchema).max(SESSION_RECORDING_TURN_PAGE_DECODE_MAX_ELEMENTS).readonly(),
76208
- version: external_exports.literal(1)
76209
- }).readonly();
76210
- sessionRecordingTurnItemPageSchema = external_exports.object({
76211
- commandId: identifierStringSchema,
76212
- items: external_exports.array(sessionRecordingTurnItemSchema).max(SESSION_RECORDING_TURN_PAGE_DECODE_MAX_ELEMENTS).readonly(),
76213
- // Continues from the edge of this page in the direction it was read: `before` reads back
76214
- // toward a Turn's earlier work, `after` forward toward the work it is still producing. Null
76215
- // when the run reached that end of the Turn.
76216
- nextCursor: turnItemCursorSchema.nullable(),
76217
- sessionId: identifierStringSchema,
76218
- version: external_exports.literal(1)
76219
- }).readonly();
76220
- sessionRecordingTurnItemDetailSchema = external_exports.object({
76221
- commandId: identifierStringSchema,
76222
- item: sessionRecordingTurnItemSchema,
76223
- sessionId: identifierStringSchema,
76224
- version: external_exports.literal(1)
76225
- }).readonly();
76226
- }
76227
- });
76228
-
76229
- // ../mobius-sdk/src/protocol/session/recording/webhooks.ts
76230
- var isoTimestamp2, shortText2, promptSucceededOutcome2, promptCancelledOutcome2, promptFailedOutcome2, sessionStatusWebhookCommandSchema, sessionStatusWebhookBodyFields, sessionStatusWebhookBodySchema, consumedSessionStatusWebhookBodySchema;
76231
- var init_webhooks = __esm({
76232
- "../mobius-sdk/src/protocol/session/recording/webhooks.ts"() {
76233
- "use strict";
76234
- init_zod();
76235
- init_identifier();
76236
- init_recording();
76237
- isoTimestamp2 = external_exports.iso.datetime({ offset: true });
76238
- shortText2 = external_exports.string().max(2048);
76239
- promptSucceededOutcome2 = { completedAt: isoTimestamp2, stopReason: shortText2 };
76240
- promptCancelledOutcome2 = { cancelledAt: isoTimestamp2 };
76241
- promptFailedOutcome2 = {
76242
- code: identifierStringSchema,
76243
- failedAt: isoTimestamp2,
76244
- message: external_exports.string().min(1).max(500)
76245
- };
76246
- sessionStatusWebhookCommandSchema = external_exports.discriminatedUnion("outcome", [
76247
- external_exports.object({
76248
- ...promptSucceededOutcome2,
76249
- commandId: identifierStringSchema,
76250
- outcome: external_exports.literal("succeeded")
76251
- }).readonly(),
76252
- external_exports.object({
76253
- ...promptCancelledOutcome2,
76254
- commandId: identifierStringSchema,
76255
- outcome: external_exports.literal("cancelled")
76256
- }).readonly(),
76257
- external_exports.object({
76258
- ...promptFailedOutcome2,
76259
- commandId: identifierStringSchema,
76260
- outcome: external_exports.literal("failed")
76261
- }).readonly()
76262
- ]);
76263
- sessionStatusWebhookBodyFields = {
76264
- appId: identifierStringSchema,
76265
- projectId: identifierStringSchema,
76266
- runtimeId: identifierStringSchema,
76267
- sessionId: identifierStringSchema,
76268
- status: sessionRecordingStatusSchema
76269
- };
76270
- sessionStatusWebhookBodySchema = external_exports.object({
76271
- ...sessionStatusWebhookBodyFields,
76272
- commands: external_exports.array(sessionStatusWebhookCommandSchema).min(1).readonly()
76273
- }).readonly();
76274
- consumedSessionStatusWebhookBodySchema = external_exports.object({
76275
- ...sessionStatusWebhookBodyFields,
76276
- commands: external_exports.array(sessionStatusWebhookCommandSchema).readonly()
76277
- }).readonly();
76278
- }
76279
- });
76280
-
76281
- // ../mobius-sdk/src/protocol/session/turn/index.ts
76282
- var timestampSchema2, domainErrorSchema, executionResultSchema, reconciliationSchema, terminalTurnStateSchema, turnStateSchema, promptTurnRequestSchema, notRetainedTurnRequestSchema, turnRequestSchema, turnIdentitySchema, turnSchema2;
76283
- var init_turn = __esm({
76284
- "../mobius-sdk/src/protocol/session/turn/index.ts"() {
76285
- "use strict";
76286
- init_zod();
76287
- init_identifier();
76288
- init_configuration();
76289
- timestampSchema2 = external_exports.string().datetime({ offset: true });
76290
- domainErrorSchema = external_exports.object({
76291
- code: identifierSchema,
76292
- message: external_exports.string().min(1).max(2e3),
76293
- retryable: external_exports.boolean()
76294
- }).readonly();
76295
- executionResultSchema = external_exports.object({
76296
- kind: external_exports.literal("agent_result"),
76297
- stopReason: external_exports.string().min(1).max(128)
76298
- }).readonly();
76299
- reconciliationSchema = external_exports.object({
76300
- detectedAt: timestampSchema2,
76301
- reason: external_exports.enum(["connection_lost", "dispatch_indeterminate", "runtime_restarted"])
76302
- }).readonly();
76303
- terminalTurnStateSchema = external_exports.discriminatedUnion("kind", [
76304
- external_exports.object({
76305
- completedAt: timestampSchema2,
76306
- kind: external_exports.literal("succeeded"),
76307
- result: executionResultSchema
76308
- }).readonly(),
76309
- external_exports.object({
76310
- error: domainErrorSchema,
76311
- failedAt: timestampSchema2,
76312
- kind: external_exports.literal("failed")
76313
- }).readonly(),
76314
- external_exports.object({
76315
- cancelledAt: timestampSchema2,
76316
- kind: external_exports.literal("cancelled")
76317
- }).readonly()
76318
- ]);
76319
- turnStateSchema = external_exports.discriminatedUnion("kind", [
76320
- external_exports.object({ kind: external_exports.literal("queued") }).readonly(),
76321
- external_exports.object({ kind: external_exports.literal("running"), startedAt: timestampSchema2 }).readonly(),
76322
- ...terminalTurnStateSchema.options,
76323
- external_exports.object({
76324
- kind: external_exports.literal("indeterminate"),
76325
- reconciliation: reconciliationSchema
76326
- }).readonly()
76327
- ]);
76328
- promptTurnRequestSchema = external_exports.object({
76329
- content: external_exports.string().max(1e5),
76330
- kind: external_exports.literal("prompt"),
76331
- sessionConfigurations: sessionConfigurationSelectionsSchema.default([])
76332
- }).readonly();
76333
- notRetainedTurnRequestSchema = external_exports.object({ kind: external_exports.literal("not_retained") }).readonly();
76334
- turnRequestSchema = external_exports.discriminatedUnion("kind", [promptTurnRequestSchema, notRetainedTurnRequestSchema]);
76335
- turnIdentitySchema = external_exports.object({
76336
- acceptedAt: timestampSchema2,
76337
- bindingId: identifierSchema,
76338
- idempotencyKey: identifierSchema,
76339
- sessionId: identifierSchema,
76340
- turnId: identifierSchema
76341
- });
76342
- turnSchema2 = external_exports.union([
76343
- turnIdentitySchema.extend({ request: promptTurnRequestSchema, state: turnStateSchema }).readonly(),
76344
- turnIdentitySchema.extend({ request: notRetainedTurnRequestSchema, state: terminalTurnStateSchema }).readonly()
76345
- ]);
76346
- }
76347
- });
76348
-
76349
75890
  // ../mobius-sdk/src/protocol/session/workspace/index.ts
76350
75891
  var WORKSPACE_LIST_KIND, WORKSPACE_ENTRIES_KIND, RUNTIME_WORKSPACE_BINDING_ID, workspaceListCommandSchema, workspaceEntriesEventSchema, decodeWorkspaceListCommand, encodeWorkspaceListCommand, decodeWorkspaceEntriesEvent, encodeWorkspaceEntriesEvent;
76351
75892
  var init_workspace = __esm({
@@ -76693,11 +76234,8 @@ var init_protocol = __esm({
76693
76234
  "../mobius-sdk/src/protocol/index.ts"() {
76694
76235
  "use strict";
76695
76236
  init_mobius_api();
76696
- init_project_location();
76697
- init_diagnostics();
76698
76237
  init_liveness();
76699
76238
  init_upgrade();
76700
- init_access();
76701
76239
  init_catalog();
76702
76240
  init_settings2();
76703
76241
  init_configuration();
@@ -76705,19 +76243,15 @@ var init_protocol = __esm({
76705
76243
  init_events();
76706
76244
  init_files();
76707
76245
  init_interactions();
76708
- init_model();
76709
76246
  init_lifecycle();
76710
76247
  init_native();
76711
76248
  init_history2();
76712
76249
  init_commands();
76713
76250
  init_usage();
76714
- init_recorded_lifecycle_status();
76715
- init_turn_history();
76716
- init_webhooks();
76717
- init_turn();
76718
76251
  init_workspace();
76719
76252
  init_directory();
76720
76253
  init_identifier();
76254
+ init_tool_input();
76721
76255
  init_daemon_transport();
76722
76256
  }
76723
76257
  });
@@ -82859,24 +82393,7 @@ var init_agent_update_stream = __esm({
82859
82393
 
82860
82394
  // src/acp/adapter/session-events.ts
82861
82395
  import { setImmediate as yieldToRuntime2 } from "node:timers/promises";
82862
- function* reasoningWireUpdates(update) {
82863
- if (update.sessionUpdate !== "agent_thought_chunk" || update.content.type !== "text" || update.content.text.length <= MAXIMUM_REASONING_UPDATE_CHARACTERS) {
82864
- yield update;
82865
- return;
82866
- }
82867
- const text2 = update.content.text;
82868
- for (let start = 0; start < text2.length; ) {
82869
- let end = Math.min(start + MAXIMUM_REASONING_UPDATE_CHARACTERS, text2.length);
82870
- const last = text2.charCodeAt(end - 1);
82871
- const next = text2.charCodeAt(end);
82872
- if (last >= 55296 && last <= 56319 && next >= 56320 && next <= 57343) {
82873
- end -= 1;
82874
- }
82875
- yield { ...update, content: { ...update.content, text: text2.slice(start, end) } };
82876
- start = end;
82877
- }
82878
- }
82879
- var MAXIMUM_REASONING_UPDATE_CHARACTERS, AdapterSessionConnection, AcpSessionConnector;
82396
+ var AdapterSessionConnection, AcpSessionConnector;
82880
82397
  var init_session_events = __esm({
82881
82398
  "src/acp/adapter/session-events.ts"() {
82882
82399
  "use strict";
@@ -82885,7 +82402,6 @@ var init_session_events = __esm({
82885
82402
  init_acp_error();
82886
82403
  init_agent_update_stream();
82887
82404
  init_session_config_protocol();
82888
- MAXIMUM_REASONING_UPDATE_CHARACTERS = 1e6;
82889
82405
  AdapterSessionConnection = class {
82890
82406
  #connection;
82891
82407
  #onBackgroundActivity;
@@ -82906,68 +82422,66 @@ var init_session_events = __esm({
82906
82422
  throw new AcpExecutionError("ACP agent referenced an unknown session", {}, "invalid_agent_session");
82907
82423
  }
82908
82424
  const signal = AbortSignal.any([this.#lifetime.signal, AbortSignal.timeout(3e4)]);
82909
- for (const incoming of reasoningWireUpdates(notification.update)) {
82910
- const externalized = await externalizer.update(options.sessionId(), incoming, signal);
82911
- signal.throwIfAborted();
82912
- const update = externalized.agent;
82913
- const eventUpdate = externalized.event;
82914
- const backgroundTask = update._meta?.["mobius.backgroundTask"];
82915
- const payload = decodeAcpSessionUpdate(
82916
- JSON.stringify(
82917
- normalizeEvent(
82918
- (update.sessionUpdate === "tool_call" || update.sessionUpdate === "tool_call_update") && backgroundTask !== void 0 && typeof eventUpdate === "object" && eventUpdate !== null ? { ...eventUpdate, backgroundTask } : eventUpdate
82919
- )
82425
+ const externalized = await externalizer.update(options.sessionId(), notification.update, signal);
82426
+ signal.throwIfAborted();
82427
+ const update = externalized.agent;
82428
+ const eventUpdate = externalized.event;
82429
+ const backgroundTask = update._meta?.["mobius.backgroundTask"];
82430
+ const payload = decodeAcpSessionUpdate(
82431
+ JSON.stringify(
82432
+ normalizeEvent(
82433
+ (update.sessionUpdate === "tool_call" || update.sessionUpdate === "tool_call_update") && backgroundTask !== void 0 && typeof eventUpdate === "object" && eventUpdate !== null ? { ...eventUpdate, backgroundTask } : eventUpdate
82920
82434
  )
82921
- );
82922
- let event;
82923
- switch (update.sessionUpdate) {
82924
- case "available_commands_update":
82925
- event = {
82926
- kind: "commands",
82927
- payload,
82928
- commands: update.availableCommands.slice(0, 500).map((command) => ({
82929
- description: truncate(command.description, 500),
82930
- inputHint: truncate(command.input?.hint ?? "", 255),
82931
- name: truncate(command.name, 128)
82932
- })).filter((command) => command.name.length > 0)
82933
- };
82934
- break;
82935
- case "config_option_update":
82936
- event = {
82937
- kind: "configuration",
82938
- payload,
82939
- configOptions: protocol.normalizeUpdate(options.configOptions(), update.configOptions)
82940
- };
82941
- break;
82942
- case "current_mode_update":
82943
- event = { kind: "mode", payload, modeId: update.currentModeId };
82944
- break;
82945
- case "session_info_update": {
82946
- const changes = [];
82947
- if (Object.hasOwn(update, "title")) {
82948
- changes.push({ kind: "title", value: truncate(update.title ?? "", 500) });
82949
- }
82950
- if (Object.hasOwn(update, "updatedAt")) {
82951
- changes.push({ kind: "updated-at", value: truncate(update.updatedAt ?? "", 128) });
82952
- }
82953
- event = { kind: "info", payload, changes };
82954
- break;
82435
+ )
82436
+ );
82437
+ let event;
82438
+ switch (update.sessionUpdate) {
82439
+ case "available_commands_update":
82440
+ event = {
82441
+ kind: "commands",
82442
+ payload,
82443
+ commands: update.availableCommands.slice(0, 500).map((command) => ({
82444
+ description: truncate(command.description, 500),
82445
+ inputHint: truncate(command.input?.hint ?? "", 255),
82446
+ name: truncate(command.name, 128)
82447
+ })).filter((command) => command.name.length > 0)
82448
+ };
82449
+ break;
82450
+ case "config_option_update":
82451
+ event = {
82452
+ kind: "configuration",
82453
+ payload,
82454
+ configOptions: protocol.normalizeUpdate(options.configOptions(), update.configOptions)
82455
+ };
82456
+ break;
82457
+ case "current_mode_update":
82458
+ event = { kind: "mode", payload, modeId: update.currentModeId };
82459
+ break;
82460
+ case "session_info_update": {
82461
+ const changes = [];
82462
+ if (Object.hasOwn(update, "title")) {
82463
+ changes.push({ kind: "title", value: truncate(update.title ?? "", 500) });
82955
82464
  }
82956
- case "user_message_chunk":
82957
- case "agent_message_chunk":
82958
- case "agent_thought_chunk":
82959
- case "tool_call":
82960
- case "tool_call_update":
82961
- case "plan":
82962
- case "plan_update":
82963
- case "plan_removed":
82964
- event = { kind: "content", payload };
82965
- break;
82966
- default:
82967
- event = { kind: "other", payload };
82465
+ if (Object.hasOwn(update, "updatedAt")) {
82466
+ changes.push({ kind: "updated-at", value: truncate(update.updatedAt ?? "", 128) });
82467
+ }
82468
+ event = { kind: "info", payload, changes };
82469
+ break;
82968
82470
  }
82969
- await options.onEvent(event);
82471
+ case "user_message_chunk":
82472
+ case "agent_message_chunk":
82473
+ case "agent_thought_chunk":
82474
+ case "tool_call":
82475
+ case "tool_call_update":
82476
+ case "plan":
82477
+ case "plan_update":
82478
+ case "plan_removed":
82479
+ event = { kind: "content", payload };
82480
+ break;
82481
+ default:
82482
+ event = { kind: "other", payload };
82970
82483
  }
82484
+ await options.onEvent(event);
82971
82485
  });
82972
82486
  this.events = this.#updates;
82973
82487
  const client2 = {
@@ -83466,6 +82980,9 @@ function mergeTextChunk(previous, incoming) {
83466
82980
  if (previous.sessionUpdate !== "agent_message_chunk" && previous.sessionUpdate !== "agent_thought_chunk" && previous.sessionUpdate !== "user_message_chunk" || incoming.sessionUpdate !== previous.sessionUpdate || previous.messageId !== incoming.messageId || previous.content.type !== "text" || incoming.content.type !== "text") {
83467
82981
  return null;
83468
82982
  }
82983
+ if (previous.sessionUpdate !== "agent_thought_chunk" && previous.content.text.length + incoming.content.text.length > MAXIMUM_PROJECTED_MESSAGE_CHARACTERS) {
82984
+ return null;
82985
+ }
83469
82986
  const content = { text: `${previous.content.text}${incoming.content.text}`, type: "text" };
83470
82987
  if (previous.sessionUpdate === "agent_thought_chunk" && incoming.sessionUpdate === "agent_thought_chunk") {
83471
82988
  return boundReasoning({
@@ -83476,11 +82993,12 @@ function mergeTextChunk(previous, incoming) {
83476
82993
  }
83477
82994
  return { ...previous, content };
83478
82995
  }
83479
- var MAXIMUM_PROJECTED_REASONING_BYTES, SessionEventHistoryProjection;
82996
+ var MAXIMUM_PROJECTED_REASONING_BYTES, MAXIMUM_PROJECTED_MESSAGE_CHARACTERS, SessionEventHistoryProjection;
83480
82997
  var init_session_event_history_projection = __esm({
83481
82998
  "src/session/history/session-event-history-projection.ts"() {
83482
82999
  "use strict";
83483
83000
  MAXIMUM_PROJECTED_REASONING_BYTES = 24 * 1024;
83001
+ MAXIMUM_PROJECTED_MESSAGE_CHARACTERS = 1e6;
83484
83002
  SessionEventHistoryProjection = class {
83485
83003
  #toolCallEventIds = /* @__PURE__ */ new Map();
83486
83004
  #latestEvent = null;
@@ -90335,7 +89853,7 @@ function prepareCodexToolUpdate(update) {
90335
89853
  };
90336
89854
  }
90337
89855
  function fitPayload(value) {
90338
- if (value === void 0 || boundedJsonSchema.safeParse(value).success) {
89856
+ if (value === void 0 || isBoundedJson(value)) {
90339
89857
  return value;
90340
89858
  }
90341
89859
  return { truncated: true, text: payloadText(value) };
@@ -90564,6 +90082,28 @@ var init_registry = __esm({
90564
90082
  });
90565
90083
 
90566
90084
  // src/acp/content/content-externalizer.ts
90085
+ function boundedText2(text2) {
90086
+ if (text2.length <= MAXIMUM_TEXT_CHARACTERS) {
90087
+ return text2;
90088
+ }
90089
+ const marker = (start2) => `... [omit ${text2.length - start2} characters since ${start2}]`;
90090
+ let start = 0;
90091
+ let upper = MAXIMUM_TEXT_CHARACTERS;
90092
+ while (start < upper) {
90093
+ const candidate = Math.ceil((start + upper) / 2);
90094
+ if (candidate + marker(candidate).length <= MAXIMUM_TEXT_CHARACTERS) {
90095
+ start = candidate;
90096
+ } else {
90097
+ upper = candidate - 1;
90098
+ }
90099
+ }
90100
+ const last = text2.charCodeAt(start - 1);
90101
+ const next = text2.charCodeAt(start);
90102
+ if (last >= 55296 && last <= 56319 && next >= 56320 && next <= 57343) {
90103
+ start -= 1;
90104
+ }
90105
+ return text2.slice(0, start) + marker(start);
90106
+ }
90567
90107
  function decodeBase64(data) {
90568
90108
  if (data.length > MAXIMUM_ENCODED_CONTENT_CHARACTERS || data.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/u.test(data)) {
90569
90109
  throw new Error("The ACP embedded content is not valid bounded base64");
@@ -90577,13 +90117,14 @@ function decodeBase64(data) {
90577
90117
  function isRecord6(value) {
90578
90118
  return typeof value === "object" && value !== null && !Array.isArray(value);
90579
90119
  }
90580
- var MAXIMUM_ENCODED_CONTENT_CHARACTERS, embeddedImageSchema, inlineImageUrlSchema, toolImageSchema, AcpContentExternalizer;
90120
+ var MAXIMUM_ENCODED_CONTENT_CHARACTERS, MAXIMUM_TEXT_CHARACTERS, embeddedImageSchema, inlineImageUrlSchema, toolImageSchema, AcpContentExternalizer;
90581
90121
  var init_content_externalizer = __esm({
90582
90122
  "src/acp/content/content-externalizer.ts"() {
90583
90123
  "use strict";
90584
90124
  init_zod();
90585
90125
  init_raster();
90586
90126
  MAXIMUM_ENCODED_CONTENT_CHARACTERS = 4e6;
90127
+ MAXIMUM_TEXT_CHARACTERS = 1e6;
90587
90128
  embeddedImageSchema = external_exports.looseObject({
90588
90129
  type: external_exports.literal("image"),
90589
90130
  data: external_exports.string(),
@@ -90615,6 +90156,7 @@ var init_content_externalizer = __esm({
90615
90156
  async #content(sessionId, content, signal) {
90616
90157
  switch (content.type) {
90617
90158
  case "text":
90159
+ return { agent: content, event: { ...content, text: boundedText2(content.text) } };
90618
90160
  case "resource_link":
90619
90161
  return { agent: content, event: content };
90620
90162
  case "image": {
@@ -91741,7 +91283,7 @@ async function readCurrentDataVersion(root, signal) {
91741
91283
  if (!value.startsWith("versions/")) {
91742
91284
  throw new DataInheritanceError("The current data pointer must name a version directory");
91743
91285
  }
91744
- return runtimeUpgradeVersionSchema.parse(value.slice("versions/".length));
91286
+ return decodeRuntimeUpgradeVersion(value.slice("versions/".length));
91745
91287
  } catch (cause) {
91746
91288
  if (isNodeError(cause, "ENOENT")) {
91747
91289
  return null;
@@ -92713,7 +92255,7 @@ var init_switch_status = __esm({
92713
92255
  async function prepareVersionData(version2, signal, environment = process.env, fallbackVersion = null) {
92714
92256
  signal.throwIfAborted();
92715
92257
  const root = readStateDirectory(environment);
92716
- const targetVersion = runtimeUpgradeVersionSchema.parse(version2);
92258
+ const targetVersion = decodeRuntimeUpgradeVersion(version2);
92717
92259
  const current = await readCurrentDataVersion(root, signal);
92718
92260
  let previous;
92719
92261
  if (current !== null) {
@@ -92728,7 +92270,7 @@ async function prepareVersionData(version2, signal, environment = process.env, f
92728
92270
  }
92729
92271
  previous = fallbackVersion;
92730
92272
  }
92731
- const leftBehind = await copyVersionData(root, runtimeUpgradeVersionSchema.parse(previous), targetVersion, signal);
92273
+ const leftBehind = await copyVersionData(root, decodeRuntimeUpgradeVersion(previous), targetVersion, signal);
92732
92274
  for (const entry of leftBehind) {
92733
92275
  process.stderr.write(
92734
92276
  `Mobius did not carry ${entry} into version ${targetVersion}: an earlier Mobius ran with that installation as its state root.
@@ -92737,10 +92279,10 @@ async function prepareVersionData(version2, signal, environment = process.env, f
92737
92279
  }
92738
92280
  }
92739
92281
  async function discardRolledBackData(version2, signal) {
92740
- await discardVersionData(readStateDirectory(), runtimeUpgradeVersionSchema.parse(version2), signal);
92282
+ await discardVersionData(readStateDirectory(), decodeRuntimeUpgradeVersion(version2), signal);
92741
92283
  }
92742
92284
  async function recordCurrentData(version2, signal) {
92743
- await writeCurrentDataVersion(readStateDirectory(), runtimeUpgradeVersionSchema.parse(version2), signal);
92285
+ await writeCurrentDataVersion(readStateDirectory(), decodeRuntimeUpgradeVersion(version2), signal);
92744
92286
  }
92745
92287
  async function prepareUpgradeData(controlDirectory, version2, signal) {
92746
92288
  const transition2 = await readSwitchStatus(controlDirectory, signal);
@@ -93488,7 +93030,7 @@ var init_release_files = __esm({
93488
93030
  // src/daemon/upgrades/package.ts
93489
93031
  import { isAbsolute as isAbsolute16, join as join34, relative as relative4 } from "node:path";
93490
93032
  async function prepareDaemonReleaseVersion(version2, signal) {
93491
- runtimeUpgradeVersionSchema.parse(version2);
93033
+ decodeRuntimeUpgradeVersion(version2);
93492
93034
  signal.throwIfAborted();
93493
93035
  const prefix = releasePrefix(version2);
93494
93036
  let installed;
@@ -93518,7 +93060,7 @@ async function prepareDaemonReleaseVersion(version2, signal) {
93518
93060
  }
93519
93061
  }
93520
93062
  async function installDaemonReleaseVersion(version2, signal) {
93521
- runtimeUpgradeVersionSchema.parse(version2);
93063
+ decodeRuntimeUpgradeVersion(version2);
93522
93064
  const npm = await findExecutableOnPath("npm", process.env);
93523
93065
  if (npm === null) {
93524
93066
  throw new DaemonReleaseUpgradeError("npm_unavailable", "npm is required to download the new daemon");
@@ -93616,7 +93158,7 @@ async function findNewDaemonReleaseVersion(currentVersion, signal) {
93616
93158
  timeoutMilliseconds: 3e4,
93617
93159
  outputLimitBytes: 4096
93618
93160
  });
93619
- const version2 = npmViewVersionSchema.parse(JSON.parse(result.stdout));
93161
+ const version2 = decodeRuntimeUpgradeVersion(npmViewVersionSchema.parse(JSON.parse(result.stdout)));
93620
93162
  return (0, import_semver.gt)(version2, currentVersion) ? version2 : null;
93621
93163
  } catch (cause) {
93622
93164
  signal.throwIfAborted();
@@ -93645,7 +93187,7 @@ var init_package2 = __esm({
93645
93187
  this.code = code;
93646
93188
  }
93647
93189
  };
93648
- npmViewVersionSchema = external_exports.union([runtimeUpgradeVersionSchema, external_exports.tuple([runtimeUpgradeVersionSchema])]).transform((value) => typeof value === "string" ? value : value[0]);
93190
+ npmViewVersionSchema = external_exports.union([external_exports.string(), external_exports.tuple([external_exports.string()])]).transform((value) => typeof value === "string" ? value : value[0]);
93649
93191
  }
93650
93192
  });
93651
93193