@moxt-ai/mobius 0.0.110 → 0.0.111
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 +154 -147
- package/dist/cli.js.map +4 -4
- package/dist/daemon-turn-reconciliation.d.ts.map +1 -1
- package/dist/daemon-turn-reconciliation.js +3 -3
- package/dist/daemon-turn-reconciliation.js.map +1 -1
- package/dist/index.js +154 -148
- package/dist/index.js.map +4 -4
- package/dist/native-sessions/service.d.ts +1 -1
- package/dist/native-sessions/service.d.ts.map +1 -1
- package/dist/native-sessions/service.js +7 -6
- package/dist/native-sessions/service.js.map +1 -1
- package/dist/pairing/pair-local-machine.d.ts.map +1 -1
- package/dist/pairing/pair-local-machine.js +5 -6
- package/dist/pairing/pair-local-machine.js.map +1 -1
- package/dist/prompt-artifact-resolver.d.ts +1 -1
- package/dist/prompt-artifact-resolver.d.ts.map +1 -1
- package/dist/prompt-artifact-resolver.js +2 -2
- package/dist/prompt-artifact-resolver.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +6191 -6187
- package/dist/runtime.js.map +4 -4
- package/dist/storage/runtime-installation-store.js +3 -3
- package/dist/storage/runtime-installation-store.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3381,7 +3381,7 @@ var program = new Command();
|
|
|
3381
3381
|
// package.json
|
|
3382
3382
|
var package_default = {
|
|
3383
3383
|
name: "@moxt-ai/mobius",
|
|
3384
|
-
version: "0.0.
|
|
3384
|
+
version: "0.0.111",
|
|
3385
3385
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
3386
3386
|
type: "module",
|
|
3387
3387
|
bin: {
|
|
@@ -27836,6 +27836,17 @@ async function discoverLocalAgentInventory(options) {
|
|
|
27836
27836
|
// src/config.ts
|
|
27837
27837
|
import { join as join14, resolve as resolve3 } from "node:path";
|
|
27838
27838
|
|
|
27839
|
+
// ../protocol/src/identifier.ts
|
|
27840
|
+
var IDENTIFIER_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
27841
|
+
var identifierStringSchema = external_exports.string().min(1).max(128).regex(IDENTIFIER_PATTERN);
|
|
27842
|
+
var identifierSchema = identifierStringSchema.brand();
|
|
27843
|
+
function isIdentifier(value) {
|
|
27844
|
+
return identifierSchema.safeParse(value).success;
|
|
27845
|
+
}
|
|
27846
|
+
function decodeIdentifier(value) {
|
|
27847
|
+
return identifierSchema.parse(value);
|
|
27848
|
+
}
|
|
27849
|
+
|
|
27839
27850
|
// ../protocol/src/prompt-usage.ts
|
|
27840
27851
|
var TOKEN_COUNT = external_exports.number().int().nonnegative();
|
|
27841
27852
|
function normalizeQuotaTokenCount(value) {
|
|
@@ -27943,9 +27954,7 @@ var FILE_BEGIN_KIND = "file.begin";
|
|
|
27943
27954
|
var FILE_CHUNK_KIND = "file.chunk";
|
|
27944
27955
|
var FILE_END_KIND = "file.end";
|
|
27945
27956
|
var FILE_FAILED_KIND = "file.failed";
|
|
27946
|
-
var IDENTIFIER_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
27947
27957
|
var DIRECTORY_IDENTIFIER_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/;
|
|
27948
|
-
var IDENTIFIER = external_exports.string().min(1).max(128).regex(IDENTIFIER_PATTERN);
|
|
27949
27958
|
var DIRECTORY_IDENTIFIER = external_exports.string().min(1).max(2048).regex(DIRECTORY_IDENTIFIER_PATTERN);
|
|
27950
27959
|
var SHORT_TEXT = external_exports.string().max(500);
|
|
27951
27960
|
var LONG_TEXT = external_exports.string().max(1e5);
|
|
@@ -27955,29 +27964,29 @@ var workspaceEntrySchema = external_exports.strictObject({
|
|
|
27955
27964
|
}).readonly();
|
|
27956
27965
|
var sessionMetadataSchema = external_exports.strictObject({
|
|
27957
27966
|
additionalDirectories: external_exports.array(workspaceEntrySchema).max(16).readonly(),
|
|
27958
|
-
agentId:
|
|
27967
|
+
agentId: identifierStringSchema,
|
|
27959
27968
|
directoryId: DIRECTORY_IDENTIFIER,
|
|
27960
27969
|
directoryLabel: external_exports.string().min(1).max(2048),
|
|
27961
27970
|
prompted: external_exports.boolean(),
|
|
27962
|
-
sessionId:
|
|
27971
|
+
sessionId: identifierStringSchema,
|
|
27963
27972
|
title: external_exports.string().max(500),
|
|
27964
27973
|
updatedAt: external_exports.iso.datetime({ offset: true })
|
|
27965
27974
|
}).readonly();
|
|
27966
27975
|
var sessionQueryCommandSchema = external_exports.strictObject({
|
|
27967
27976
|
kind: external_exports.literal(SESSION_QUERY_KIND),
|
|
27968
|
-
requestId:
|
|
27969
|
-
sessionIds: external_exports.array(
|
|
27977
|
+
requestId: identifierStringSchema,
|
|
27978
|
+
sessionIds: external_exports.array(identifierStringSchema).min(1).max(500).readonly()
|
|
27970
27979
|
}).readonly();
|
|
27971
27980
|
var sessionsQueriedEventSchema = external_exports.strictObject({
|
|
27972
27981
|
entries: external_exports.array(sessionMetadataSchema).max(500).readonly(),
|
|
27973
27982
|
kind: external_exports.literal(SESSION_QUERIED_KIND),
|
|
27974
|
-
requestId:
|
|
27983
|
+
requestId: identifierStringSchema
|
|
27975
27984
|
}).readonly();
|
|
27976
27985
|
var fileReadCommandSchema = external_exports.strictObject({
|
|
27977
27986
|
kind: external_exports.literal(FILE_READ_KIND),
|
|
27978
27987
|
maxBytes: external_exports.number().int().positive().max(128 * 1024 * 1024),
|
|
27979
|
-
requestId:
|
|
27980
|
-
sessionId:
|
|
27988
|
+
requestId: identifierStringSchema,
|
|
27989
|
+
sessionId: identifierStringSchema,
|
|
27981
27990
|
path: external_exports.string().min(1).max(4096)
|
|
27982
27991
|
}).readonly();
|
|
27983
27992
|
var fileBeginEventSchema = external_exports.strictObject({
|
|
@@ -27986,27 +27995,27 @@ var fileBeginEventSchema = external_exports.strictObject({
|
|
|
27986
27995
|
mediaType: external_exports.string().min(1).max(255),
|
|
27987
27996
|
modifiedAt: external_exports.iso.datetime({ offset: true }),
|
|
27988
27997
|
name: external_exports.string().min(1).max(500),
|
|
27989
|
-
requestId:
|
|
27990
|
-
sessionId:
|
|
27998
|
+
requestId: identifierStringSchema,
|
|
27999
|
+
sessionId: identifierStringSchema
|
|
27991
28000
|
}).readonly();
|
|
27992
28001
|
var fileChunkEventSchema = external_exports.strictObject({
|
|
27993
28002
|
data: external_exports.string().min(1).max(4e5),
|
|
27994
28003
|
kind: external_exports.literal(FILE_CHUNK_KIND),
|
|
27995
|
-
requestId:
|
|
28004
|
+
requestId: identifierStringSchema,
|
|
27996
28005
|
sequence: external_exports.number().int().nonnegative().max(1024),
|
|
27997
|
-
sessionId:
|
|
28006
|
+
sessionId: identifierStringSchema
|
|
27998
28007
|
}).readonly();
|
|
27999
28008
|
var fileEndEventSchema = external_exports.strictObject({
|
|
28000
28009
|
kind: external_exports.literal(FILE_END_KIND),
|
|
28001
|
-
requestId:
|
|
28002
|
-
sessionId:
|
|
28010
|
+
requestId: identifierStringSchema,
|
|
28011
|
+
sessionId: identifierStringSchema
|
|
28003
28012
|
}).readonly();
|
|
28004
28013
|
var fileFailedEventSchema = external_exports.strictObject({
|
|
28005
|
-
code:
|
|
28014
|
+
code: identifierStringSchema,
|
|
28006
28015
|
kind: external_exports.literal(FILE_FAILED_KIND),
|
|
28007
28016
|
message: external_exports.string().min(1).max(500),
|
|
28008
|
-
requestId:
|
|
28009
|
-
sessionId:
|
|
28017
|
+
requestId: identifierStringSchema,
|
|
28018
|
+
sessionId: identifierStringSchema
|
|
28010
28019
|
}).readonly();
|
|
28011
28020
|
var configValueSchema = external_exports.strictObject({
|
|
28012
28021
|
description: SHORT_TEXT,
|
|
@@ -28057,44 +28066,44 @@ var agentModelEffortSchema = external_exports.strictObject({
|
|
|
28057
28066
|
valuesByModel: external_exports.record(external_exports.string().min(1).max(500), external_exports.array(configValueSchema).max(500).readonly()).readonly()
|
|
28058
28067
|
}).readonly();
|
|
28059
28068
|
var agentSettingsDiscoverCommandSchema = external_exports.strictObject({
|
|
28060
|
-
agentId:
|
|
28069
|
+
agentId: identifierStringSchema,
|
|
28061
28070
|
kind: external_exports.literal(AGENT_SETTINGS_DISCOVER_KIND),
|
|
28062
28071
|
model: external_exports.string().min(1).max(500).optional(),
|
|
28063
|
-
requestId:
|
|
28072
|
+
requestId: identifierStringSchema
|
|
28064
28073
|
}).readonly();
|
|
28065
28074
|
var agentSettingsDiscoveredEventSchema = external_exports.strictObject({
|
|
28066
|
-
agentId:
|
|
28075
|
+
agentId: identifierStringSchema,
|
|
28067
28076
|
agentName: external_exports.string().max(255),
|
|
28068
28077
|
agentVersion: external_exports.string().max(128),
|
|
28069
28078
|
kind: external_exports.literal(AGENT_SETTINGS_DISCOVERED_KIND),
|
|
28070
28079
|
modelEffort: agentModelEffortSchema,
|
|
28071
|
-
requestId:
|
|
28080
|
+
requestId: identifierStringSchema,
|
|
28072
28081
|
settings: agentSettingsSchema,
|
|
28073
28082
|
settingsRevision: external_exports.string().regex(/^[a-f0-9]{64}$/)
|
|
28074
28083
|
}).readonly();
|
|
28075
28084
|
var agentSettingsDiscoveryFailedEventSchema = external_exports.strictObject({
|
|
28076
|
-
code:
|
|
28085
|
+
code: identifierStringSchema,
|
|
28077
28086
|
kind: external_exports.literal(AGENT_SETTINGS_DISCOVERY_FAILED_KIND),
|
|
28078
28087
|
message: external_exports.string().min(1).max(500),
|
|
28079
|
-
requestId:
|
|
28088
|
+
requestId: identifierStringSchema
|
|
28080
28089
|
}).readonly();
|
|
28081
28090
|
var agentCatalogRefreshCommandSchema = external_exports.strictObject({
|
|
28082
28091
|
kind: external_exports.literal(AGENT_CATALOG_REFRESH_KIND),
|
|
28083
|
-
requestId:
|
|
28092
|
+
requestId: identifierStringSchema
|
|
28084
28093
|
}).readonly();
|
|
28085
28094
|
var agentCatalogRefreshedEventSchema = external_exports.strictObject({
|
|
28086
28095
|
kind: external_exports.literal(AGENT_CATALOG_REFRESHED_KIND),
|
|
28087
|
-
requestId:
|
|
28096
|
+
requestId: identifierStringSchema
|
|
28088
28097
|
}).readonly();
|
|
28089
28098
|
var agentCatalogRefreshFailedEventSchema = external_exports.strictObject({
|
|
28090
|
-
code:
|
|
28099
|
+
code: identifierStringSchema,
|
|
28091
28100
|
kind: external_exports.literal(AGENT_CATALOG_REFRESH_FAILED_KIND),
|
|
28092
28101
|
message: external_exports.string().min(1).max(500),
|
|
28093
|
-
requestId:
|
|
28102
|
+
requestId: identifierStringSchema
|
|
28094
28103
|
}).readonly();
|
|
28095
28104
|
var sessionConfigurationSelectionSchema = external_exports.strictObject({
|
|
28096
28105
|
booleanValue: external_exports.boolean(),
|
|
28097
|
-
configId:
|
|
28106
|
+
configId: identifierStringSchema,
|
|
28098
28107
|
value: external_exports.string().max(500),
|
|
28099
28108
|
valueType: external_exports.enum(["boolean", "select"])
|
|
28100
28109
|
}).readonly();
|
|
@@ -28236,26 +28245,26 @@ var promptResourceSchema = external_exports.strictObject({
|
|
|
28236
28245
|
uri: external_exports.string().min(1).max(4096)
|
|
28237
28246
|
}).readonly();
|
|
28238
28247
|
var workspaceListCommandSchema = external_exports.strictObject({
|
|
28239
|
-
bindingId:
|
|
28248
|
+
bindingId: identifierStringSchema,
|
|
28240
28249
|
directoryId: DIRECTORY_IDENTIFIER,
|
|
28241
28250
|
kind: external_exports.literal(WORKSPACE_LIST_KIND),
|
|
28242
|
-
requestId:
|
|
28251
|
+
requestId: identifierStringSchema
|
|
28243
28252
|
}).readonly();
|
|
28244
28253
|
var workspaceEntriesEventSchema = external_exports.strictObject({
|
|
28245
|
-
bindingId:
|
|
28254
|
+
bindingId: identifierStringSchema,
|
|
28246
28255
|
directoryId: DIRECTORY_IDENTIFIER,
|
|
28247
28256
|
directoryLabel: external_exports.string().min(1).max(2048),
|
|
28248
28257
|
entries: external_exports.array(workspaceEntrySchema).max(500).readonly(),
|
|
28249
28258
|
kind: external_exports.literal(WORKSPACE_ENTRIES_KIND),
|
|
28250
28259
|
parentDirectoryId: external_exports.string().max(2048),
|
|
28251
|
-
requestId:
|
|
28260
|
+
requestId: identifierStringSchema
|
|
28252
28261
|
}).readonly();
|
|
28253
28262
|
var sessionIdentityFields = {
|
|
28254
28263
|
additionalDirectoryIds: external_exports.array(DIRECTORY_IDENTIFIER).max(16).readonly(),
|
|
28255
|
-
agentId:
|
|
28256
|
-
bindingId:
|
|
28264
|
+
agentId: identifierStringSchema,
|
|
28265
|
+
bindingId: identifierStringSchema,
|
|
28257
28266
|
directoryId: DIRECTORY_IDENTIFIER,
|
|
28258
|
-
sessionId:
|
|
28267
|
+
sessionId: identifierStringSchema
|
|
28259
28268
|
};
|
|
28260
28269
|
var sessionPrepareCommandSchema = external_exports.strictObject({
|
|
28261
28270
|
...sessionIdentityFields,
|
|
@@ -28266,7 +28275,7 @@ var sessionPrepareCommandSchema = external_exports.strictObject({
|
|
|
28266
28275
|
valueType: external_exports.enum(["boolean", "select"])
|
|
28267
28276
|
}).readonly().optional(),
|
|
28268
28277
|
kind: external_exports.literal(SESSION_PREPARE_KIND),
|
|
28269
|
-
requestId:
|
|
28278
|
+
requestId: identifierStringSchema,
|
|
28270
28279
|
sessionState: external_exports.literal("provisioned").optional(),
|
|
28271
28280
|
/** Marks an inspection-only Session preparation. */
|
|
28272
28281
|
transient: external_exports.boolean().optional()
|
|
@@ -28287,7 +28296,7 @@ var runtimeTimingsSchema = external_exports.array(
|
|
|
28287
28296
|
).max(16).readonly();
|
|
28288
28297
|
var sessionReadyEventSchema = external_exports.strictObject({
|
|
28289
28298
|
additionalDirectories: external_exports.array(workspaceEntrySchema).max(16).readonly(),
|
|
28290
|
-
agentId:
|
|
28299
|
+
agentId: identifierStringSchema,
|
|
28291
28300
|
agentName: external_exports.string().max(255),
|
|
28292
28301
|
agentVersion: external_exports.string().max(128),
|
|
28293
28302
|
capabilities: sessionCapabilitiesSchema,
|
|
@@ -28296,41 +28305,41 @@ var sessionReadyEventSchema = external_exports.strictObject({
|
|
|
28296
28305
|
directoryId: DIRECTORY_IDENTIFIER,
|
|
28297
28306
|
directoryLabel: external_exports.string().min(1).max(2048),
|
|
28298
28307
|
kind: external_exports.literal(SESSION_READY_KIND),
|
|
28299
|
-
requestId:
|
|
28308
|
+
requestId: identifierStringSchema,
|
|
28300
28309
|
restored: external_exports.boolean(),
|
|
28301
28310
|
runtimeTimings: runtimeTimingsSchema.optional(),
|
|
28302
|
-
sessionId:
|
|
28311
|
+
sessionId: identifierStringSchema
|
|
28303
28312
|
}).readonly();
|
|
28304
28313
|
var sessionConfigureCommandSchema = external_exports.strictObject({
|
|
28305
28314
|
...sessionIdentityFields,
|
|
28306
28315
|
booleanValue: external_exports.boolean(),
|
|
28307
28316
|
configId: external_exports.string().min(1).max(128),
|
|
28308
28317
|
kind: external_exports.literal(SESSION_CONFIGURE_KIND),
|
|
28309
|
-
requestId:
|
|
28318
|
+
requestId: identifierStringSchema,
|
|
28310
28319
|
value: external_exports.string().max(500),
|
|
28311
28320
|
valueType: external_exports.enum(["boolean", "select"])
|
|
28312
28321
|
}).readonly();
|
|
28313
28322
|
var sessionConfigUpdatedEventSchema = external_exports.strictObject({
|
|
28314
28323
|
configOptions: sessionConfigOptionsSchema,
|
|
28315
28324
|
kind: external_exports.literal(SESSION_CONFIG_UPDATED_KIND),
|
|
28316
|
-
requestId:
|
|
28317
|
-
sessionId:
|
|
28325
|
+
requestId: identifierStringSchema,
|
|
28326
|
+
sessionId: identifierStringSchema
|
|
28318
28327
|
}).readonly();
|
|
28319
28328
|
var sessionContextUsageUpdatedEventSchema = external_exports.strictObject({
|
|
28320
28329
|
costAmount: external_exports.number().finite().nonnegative(),
|
|
28321
28330
|
costCurrency: external_exports.string().max(16),
|
|
28322
28331
|
hasCost: external_exports.boolean(),
|
|
28323
28332
|
kind: external_exports.literal(SESSION_USAGE_UPDATED_KIND),
|
|
28324
|
-
sessionId:
|
|
28333
|
+
sessionId: identifierStringSchema,
|
|
28325
28334
|
size: external_exports.number().int().nonnegative(),
|
|
28326
28335
|
source: external_exports.literal("context").default("context"),
|
|
28327
28336
|
used: external_exports.number().int().nonnegative()
|
|
28328
28337
|
}).readonly();
|
|
28329
28338
|
var sessionPromptUsageUpdatedEventSchema = external_exports.strictObject({
|
|
28330
28339
|
_meta: promptMetadataSchema.nullable(),
|
|
28331
|
-
commandId:
|
|
28340
|
+
commandId: identifierStringSchema,
|
|
28332
28341
|
kind: external_exports.literal(SESSION_USAGE_UPDATED_KIND),
|
|
28333
|
-
sessionId:
|
|
28342
|
+
sessionId: identifierStringSchema,
|
|
28334
28343
|
source: external_exports.literal("prompt"),
|
|
28335
28344
|
usage: promptUsageSchema.nullable()
|
|
28336
28345
|
}).refine((event) => event.usage !== null || event._meta?.quota !== void 0).readonly();
|
|
@@ -28341,82 +28350,82 @@ var sessionUsageUpdatedEventSchema = external_exports.union([
|
|
|
28341
28350
|
var sessionCommandsUpdatedEventSchema = external_exports.strictObject({
|
|
28342
28351
|
commands: external_exports.array(sessionCommandSchema).max(500).readonly(),
|
|
28343
28352
|
kind: external_exports.literal(SESSION_COMMANDS_UPDATED_KIND),
|
|
28344
|
-
sessionId:
|
|
28353
|
+
sessionId: identifierStringSchema
|
|
28345
28354
|
}).readonly();
|
|
28346
28355
|
var sessionInfoUpdatedEventSchema = external_exports.strictObject({
|
|
28347
28356
|
kind: external_exports.literal(SESSION_INFO_UPDATED_KIND),
|
|
28348
|
-
sessionId:
|
|
28357
|
+
sessionId: identifierStringSchema,
|
|
28349
28358
|
title: external_exports.string().max(500).nullable(),
|
|
28350
28359
|
updatedAt: external_exports.string().max(128)
|
|
28351
28360
|
}).readonly();
|
|
28352
28361
|
var sessionPermissionRequestedEventSchema = external_exports.strictObject({
|
|
28353
|
-
commandId:
|
|
28354
|
-
interactionId:
|
|
28362
|
+
commandId: identifierStringSchema,
|
|
28363
|
+
interactionId: identifierStringSchema,
|
|
28355
28364
|
kind: external_exports.literal(SESSION_PERMISSION_REQUESTED_KIND),
|
|
28356
28365
|
options: external_exports.array(permissionOptionSchema).min(1).max(20).readonly(),
|
|
28357
|
-
sessionId:
|
|
28366
|
+
sessionId: identifierStringSchema,
|
|
28358
28367
|
title: external_exports.string().min(1).max(500),
|
|
28359
28368
|
toolCallId: external_exports.string().min(1).max(255),
|
|
28360
28369
|
toolKind: external_exports.string().max(64)
|
|
28361
28370
|
}).readonly();
|
|
28362
28371
|
var sessionPermissionRespondCommandSchema = external_exports.strictObject({
|
|
28363
|
-
interactionId:
|
|
28372
|
+
interactionId: identifierStringSchema,
|
|
28364
28373
|
kind: external_exports.literal(SESSION_PERMISSION_RESPOND_KIND),
|
|
28365
28374
|
optionId: external_exports.string().max(255),
|
|
28366
28375
|
outcome: external_exports.enum(["cancelled", "selected"]),
|
|
28367
|
-
sessionId:
|
|
28376
|
+
sessionId: identifierStringSchema
|
|
28368
28377
|
}).readonly();
|
|
28369
28378
|
var sessionPermissionResolvedEventSchema = external_exports.strictObject({
|
|
28370
|
-
interactionId:
|
|
28379
|
+
interactionId: identifierStringSchema,
|
|
28371
28380
|
kind: external_exports.literal(SESSION_PERMISSION_RESOLVED_KIND),
|
|
28372
28381
|
optionId: external_exports.string().max(255),
|
|
28373
28382
|
outcome: external_exports.enum(["cancelled", "selected"]),
|
|
28374
|
-
sessionId:
|
|
28383
|
+
sessionId: identifierStringSchema
|
|
28375
28384
|
}).readonly();
|
|
28376
28385
|
var sessionElicitationRequestedEventSchema = external_exports.strictObject({
|
|
28377
28386
|
accepted: external_exports.boolean(),
|
|
28378
|
-
commandId:
|
|
28387
|
+
commandId: identifierStringSchema,
|
|
28379
28388
|
elicitationId: external_exports.string().max(255),
|
|
28380
28389
|
fields: external_exports.array(elicitationFieldSchema).max(100).readonly(),
|
|
28381
|
-
interactionId:
|
|
28390
|
+
interactionId: identifierStringSchema,
|
|
28382
28391
|
kind: external_exports.literal(SESSION_ELICITATION_REQUESTED_KIND),
|
|
28383
28392
|
message: external_exports.string().min(1).max(2e3),
|
|
28384
28393
|
mode: external_exports.enum(["form", "url"]),
|
|
28385
|
-
sessionId:
|
|
28394
|
+
sessionId: identifierStringSchema,
|
|
28386
28395
|
url: external_exports.string().max(4096)
|
|
28387
28396
|
}).readonly();
|
|
28388
28397
|
var sessionElicitationRespondCommandSchema = external_exports.strictObject({
|
|
28389
28398
|
action: external_exports.enum(["accept", "cancel", "decline"]),
|
|
28390
28399
|
content: external_exports.string().max(1e5),
|
|
28391
|
-
interactionId:
|
|
28400
|
+
interactionId: identifierStringSchema,
|
|
28392
28401
|
kind: external_exports.literal(SESSION_ELICITATION_RESPOND_KIND),
|
|
28393
|
-
sessionId:
|
|
28402
|
+
sessionId: identifierStringSchema
|
|
28394
28403
|
}).readonly();
|
|
28395
28404
|
var sessionElicitationResolvedEventSchema = external_exports.strictObject({
|
|
28396
28405
|
action: external_exports.enum(["accept", "cancel", "decline", "complete"]),
|
|
28397
|
-
interactionId:
|
|
28406
|
+
interactionId: identifierStringSchema,
|
|
28398
28407
|
kind: external_exports.literal(SESSION_ELICITATION_RESOLVED_KIND),
|
|
28399
|
-
sessionId:
|
|
28408
|
+
sessionId: identifierStringSchema
|
|
28400
28409
|
}).readonly();
|
|
28401
28410
|
var sessionOperationFailedEventSchema = external_exports.strictObject({
|
|
28402
|
-
code:
|
|
28411
|
+
code: identifierStringSchema,
|
|
28403
28412
|
kind: external_exports.literal(SESSION_OPERATION_FAILED_KIND),
|
|
28404
28413
|
message: external_exports.string().min(1).max(500),
|
|
28405
|
-
requestId:
|
|
28414
|
+
requestId: identifierStringSchema,
|
|
28406
28415
|
runtimeTimings: runtimeTimingsSchema.optional(),
|
|
28407
28416
|
sessionId: external_exports.string().max(128)
|
|
28408
28417
|
}).readonly();
|
|
28409
28418
|
var agentContentEventSchema = external_exports.strictObject({
|
|
28410
|
-
commandId:
|
|
28419
|
+
commandId: identifierStringSchema,
|
|
28411
28420
|
content: displayContentSchema,
|
|
28412
|
-
contentId:
|
|
28421
|
+
contentId: identifierStringSchema,
|
|
28413
28422
|
kind: external_exports.literal(AGENT_CONTENT_KIND),
|
|
28414
28423
|
messageId: external_exports.string().max(255),
|
|
28415
|
-
sessionId:
|
|
28424
|
+
sessionId: identifierStringSchema
|
|
28416
28425
|
}).readonly();
|
|
28417
28426
|
var agentInstallIdentityFields = {
|
|
28418
|
-
agentId:
|
|
28419
|
-
requestId:
|
|
28427
|
+
agentId: identifierStringSchema,
|
|
28428
|
+
requestId: identifierStringSchema
|
|
28420
28429
|
};
|
|
28421
28430
|
var agentInstallRequestCommandSchema = external_exports.strictObject({
|
|
28422
28431
|
...agentInstallIdentityFields,
|
|
@@ -28424,7 +28433,7 @@ var agentInstallRequestCommandSchema = external_exports.strictObject({
|
|
|
28424
28433
|
}).readonly();
|
|
28425
28434
|
var agentInstallCancelCommandSchema = external_exports.strictObject({
|
|
28426
28435
|
kind: external_exports.literal(AGENT_INSTALL_CANCEL_KIND),
|
|
28427
|
-
requestId:
|
|
28436
|
+
requestId: identifierStringSchema
|
|
28428
28437
|
}).readonly();
|
|
28429
28438
|
var agentInstallStartedEventSchema = external_exports.strictObject({
|
|
28430
28439
|
...agentInstallIdentityFields,
|
|
@@ -28449,7 +28458,7 @@ var agentInstallCompletedEventSchema = external_exports.strictObject({
|
|
|
28449
28458
|
}).readonly();
|
|
28450
28459
|
var agentInstallFailedEventSchema = external_exports.strictObject({
|
|
28451
28460
|
...agentInstallIdentityFields,
|
|
28452
|
-
code:
|
|
28461
|
+
code: identifierStringSchema,
|
|
28453
28462
|
kind: external_exports.literal(AGENT_INSTALL_FAILED_KIND),
|
|
28454
28463
|
message: external_exports.string().min(1).max(500)
|
|
28455
28464
|
}).readonly();
|
|
@@ -28581,7 +28590,6 @@ var SessionPromptDisposition = Object.freeze({
|
|
|
28581
28590
|
});
|
|
28582
28591
|
|
|
28583
28592
|
// ../protocol/src/codecs/messages.ts
|
|
28584
|
-
var IDENTIFIER_PATTERN2 = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
28585
28593
|
var DIRECTORY_IDENTIFIER_PATTERN2 = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/;
|
|
28586
28594
|
var MAX_PROMPT_LENGTH = 1e4;
|
|
28587
28595
|
var MAX_PROMPT_ATTACHMENT_LENGTH = 6e6;
|
|
@@ -28762,11 +28770,11 @@ function readActivityDetail(value) {
|
|
|
28762
28770
|
throw new ProtocolMessageError("Invalid activity detail availability");
|
|
28763
28771
|
}
|
|
28764
28772
|
function readIdentifier(value, key) {
|
|
28765
|
-
|
|
28766
|
-
|
|
28767
|
-
|
|
28773
|
+
try {
|
|
28774
|
+
return decodeIdentifier(value[key]);
|
|
28775
|
+
} catch (cause) {
|
|
28776
|
+
throw new ProtocolMessageError(`Invalid identifier field: ${key}`, { cause });
|
|
28768
28777
|
}
|
|
28769
|
-
return field;
|
|
28770
28778
|
}
|
|
28771
28779
|
function readDirectoryIdentifier(value, key) {
|
|
28772
28780
|
const field = readString(value, key, 2048);
|
|
@@ -28815,7 +28823,7 @@ function decodeSessionPromptCommand(encoded) {
|
|
|
28815
28823
|
const disposition = readPromptDisposition(value);
|
|
28816
28824
|
const rawTargetCommandId = value["targetCommandId"];
|
|
28817
28825
|
const targetCommandId = rawTargetCommandId === void 0 ? "" : readText(value, "targetCommandId", 128);
|
|
28818
|
-
if (disposition === SessionPromptDisposition.Reject && targetCommandId.length > 0 || disposition !== SessionPromptDisposition.Reject && !
|
|
28826
|
+
if (disposition === SessionPromptDisposition.Reject && targetCommandId.length > 0 || disposition !== SessionPromptDisposition.Reject && !isIdentifier(targetCommandId)) {
|
|
28819
28827
|
throw new ProtocolMessageError("Prompt disposition has an invalid target command");
|
|
28820
28828
|
}
|
|
28821
28829
|
const sessionConfigurations = hasSessionConfigurations ? decodeSessionConfigurationSelections(value["sessionConfigurations"]) : [];
|
|
@@ -29061,8 +29069,13 @@ var availableSessionHistoryObjectSchema = external_exports.strictObject({
|
|
|
29061
29069
|
status: external_exports.literal("available"),
|
|
29062
29070
|
messages: external_exports.array(historyMessage).max(SESSION_HISTORY_MESSAGE_LIMIT).readonly(),
|
|
29063
29071
|
truncated: external_exports.boolean(),
|
|
29064
|
-
coveredCommandIds: external_exports.array(
|
|
29065
|
-
coveredMessageIds: external_exports.array(
|
|
29072
|
+
coveredCommandIds: external_exports.array(identifierStringSchema).max(1e4).readonly(),
|
|
29073
|
+
coveredMessageIds: external_exports.array(
|
|
29074
|
+
external_exports.string().refine((value) => {
|
|
29075
|
+
const suffix = value.endsWith(":user") ? ":user" : value.endsWith(":agent") ? ":agent" : null;
|
|
29076
|
+
return suffix !== null && isIdentifier(value.slice(0, -suffix.length));
|
|
29077
|
+
})
|
|
29078
|
+
).max(2e4).readonly().default([])
|
|
29066
29079
|
});
|
|
29067
29080
|
var availableSessionHistorySchema = availableSessionHistoryObjectSchema.readonly();
|
|
29068
29081
|
var unavailableSessionHistoryObjectSchema = external_exports.strictObject({
|
|
@@ -29096,70 +29109,69 @@ var NATIVE_SESSION_REQUEST_KIND = "native.session.request";
|
|
|
29096
29109
|
var NATIVE_SESSION_RESULT_KIND = "native.session.result";
|
|
29097
29110
|
var NATIVE_SESSION_CANCEL_KIND = "native.session.cancel";
|
|
29098
29111
|
var ACTIVE_TURN_TEXT_LIMIT = 1e6;
|
|
29099
|
-
var identifier = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/);
|
|
29100
29112
|
var directoryId = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/);
|
|
29101
29113
|
var envelope = {
|
|
29102
|
-
requestId:
|
|
29103
|
-
sessionId:
|
|
29114
|
+
requestId: identifierStringSchema,
|
|
29115
|
+
sessionId: identifierStringSchema
|
|
29104
29116
|
};
|
|
29105
29117
|
var identity = {
|
|
29106
29118
|
...envelope,
|
|
29107
29119
|
kind: external_exports.literal(NATIVE_SESSION_REQUEST_KIND),
|
|
29108
29120
|
additionalDirectoryIds: external_exports.array(directoryId).max(16).readonly(),
|
|
29109
|
-
agentId:
|
|
29110
|
-
bindingId:
|
|
29121
|
+
agentId: identifierStringSchema,
|
|
29122
|
+
bindingId: identifierStringSchema,
|
|
29111
29123
|
directoryId
|
|
29112
29124
|
};
|
|
29113
29125
|
var nativeSessionRequestSchema = external_exports.discriminatedUnion("action", [
|
|
29114
29126
|
external_exports.strictObject({ ...identity, action: external_exports.literal("create") }).readonly(),
|
|
29115
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("active-turn"), targetSessionId:
|
|
29116
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("preview"), entryId:
|
|
29117
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("history"), entryId:
|
|
29118
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("find"), nativeSessionId:
|
|
29127
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("active-turn"), targetSessionId: identifierStringSchema }).readonly(),
|
|
29128
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("preview"), entryId: identifierStringSchema }).readonly(),
|
|
29129
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("history"), entryId: identifierStringSchema }).readonly(),
|
|
29130
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("find"), nativeSessionId: identifierStringSchema }).readonly(),
|
|
29119
29131
|
external_exports.strictObject({
|
|
29120
29132
|
...identity,
|
|
29121
29133
|
action: external_exports.literal("list"),
|
|
29122
|
-
cursor:
|
|
29134
|
+
cursor: identifierStringSchema.nullable()
|
|
29123
29135
|
}).readonly(),
|
|
29124
29136
|
external_exports.strictObject({
|
|
29125
29137
|
...identity,
|
|
29126
29138
|
action: external_exports.enum(["import", "fork"]),
|
|
29127
|
-
entryId:
|
|
29128
|
-
targetSessionId:
|
|
29139
|
+
entryId: identifierStringSchema,
|
|
29140
|
+
targetSessionId: identifierStringSchema
|
|
29129
29141
|
}).readonly(),
|
|
29130
29142
|
external_exports.strictObject({
|
|
29131
29143
|
...identity,
|
|
29132
29144
|
action: external_exports.literal("delete"),
|
|
29133
|
-
entryId:
|
|
29145
|
+
entryId: identifierStringSchema
|
|
29134
29146
|
}).readonly()
|
|
29135
29147
|
]);
|
|
29136
29148
|
var nativeSessionCommandSchema = external_exports.discriminatedUnion("action", [
|
|
29137
29149
|
external_exports.strictObject({ ...identity, action: external_exports.literal("create") }).readonly(),
|
|
29138
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("active-turn"), targetSessionId:
|
|
29139
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("preview"), entryId:
|
|
29140
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("history"), entryId:
|
|
29141
|
-
external_exports.strictObject({ ...identity, action: external_exports.literal("find"), nativeSessionId:
|
|
29150
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("active-turn"), targetSessionId: identifierStringSchema }).readonly(),
|
|
29151
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("preview"), entryId: identifierStringSchema }).readonly(),
|
|
29152
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("history"), entryId: identifierStringSchema }).readonly(),
|
|
29153
|
+
external_exports.strictObject({ ...identity, action: external_exports.literal("find"), nativeSessionId: identifierStringSchema }).readonly(),
|
|
29142
29154
|
external_exports.strictObject({
|
|
29143
29155
|
...identity,
|
|
29144
29156
|
action: external_exports.literal("list"),
|
|
29145
|
-
cursor:
|
|
29157
|
+
cursor: identifierStringSchema.nullable()
|
|
29146
29158
|
}).readonly(),
|
|
29147
29159
|
external_exports.strictObject({
|
|
29148
29160
|
...identity,
|
|
29149
29161
|
action: external_exports.enum(["import", "fork"]),
|
|
29150
|
-
entryId:
|
|
29151
|
-
targetSessionId:
|
|
29162
|
+
entryId: identifierStringSchema,
|
|
29163
|
+
targetSessionId: identifierStringSchema
|
|
29152
29164
|
}).readonly(),
|
|
29153
29165
|
external_exports.strictObject({
|
|
29154
29166
|
...identity,
|
|
29155
29167
|
action: external_exports.literal("delete"),
|
|
29156
|
-
entryId:
|
|
29168
|
+
entryId: identifierStringSchema
|
|
29157
29169
|
}).readonly()
|
|
29158
29170
|
]);
|
|
29159
29171
|
var nativeSessionEntrySchema = external_exports.strictObject({
|
|
29160
|
-
entryId:
|
|
29161
|
-
mobiusSessionIds: external_exports.array(
|
|
29162
|
-
nativeSessionId:
|
|
29172
|
+
entryId: identifierStringSchema,
|
|
29173
|
+
mobiusSessionIds: external_exports.array(identifierStringSchema).max(500).readonly(),
|
|
29174
|
+
nativeSessionId: identifierStringSchema,
|
|
29163
29175
|
title: external_exports.string().max(500),
|
|
29164
29176
|
directoryId,
|
|
29165
29177
|
directoryLabel: external_exports.string().min(1).max(2048),
|
|
@@ -29171,17 +29183,17 @@ var resultEnvelope = {
|
|
|
29171
29183
|
kind: external_exports.literal(NATIVE_SESSION_RESULT_KIND)
|
|
29172
29184
|
};
|
|
29173
29185
|
var nativeSessionResultSchema = external_exports.discriminatedUnion("action", [
|
|
29174
|
-
external_exports.strictObject({ ...resultEnvelope, action: external_exports.literal("create"), nativeSessionId:
|
|
29186
|
+
external_exports.strictObject({ ...resultEnvelope, action: external_exports.literal("create"), nativeSessionId: identifierStringSchema }).readonly(),
|
|
29175
29187
|
external_exports.strictObject({
|
|
29176
29188
|
...resultEnvelope,
|
|
29177
29189
|
action: external_exports.literal("active-turn"),
|
|
29178
|
-
targetSessionId:
|
|
29190
|
+
targetSessionId: identifierStringSchema,
|
|
29179
29191
|
turn: external_exports.strictObject({
|
|
29180
|
-
commandId:
|
|
29192
|
+
commandId: identifierStringSchema,
|
|
29181
29193
|
prompt: external_exports.string().max(1e5),
|
|
29182
29194
|
text: external_exports.string().max(ACTIVE_TURN_TEXT_LIMIT),
|
|
29183
29195
|
truncated: external_exports.boolean(),
|
|
29184
|
-
epoch:
|
|
29196
|
+
epoch: identifierStringSchema,
|
|
29185
29197
|
interaction: external_exports.discriminatedUnion("kind", [
|
|
29186
29198
|
sessionPermissionRequestedEventSchema,
|
|
29187
29199
|
sessionElicitationRequestedEventSchema
|
|
@@ -29200,20 +29212,20 @@ var nativeSessionResultSchema = external_exports.discriminatedUnion("action", [
|
|
|
29200
29212
|
action: external_exports.literal("list"),
|
|
29201
29213
|
capabilities: sessionCapabilitiesSchema,
|
|
29202
29214
|
entries: external_exports.array(nativeSessionEntrySchema).max(500).readonly(),
|
|
29203
|
-
nextCursor:
|
|
29215
|
+
nextCursor: identifierStringSchema.nullable()
|
|
29204
29216
|
}).readonly(),
|
|
29205
29217
|
external_exports.strictObject({
|
|
29206
29218
|
...resultEnvelope,
|
|
29207
29219
|
action: external_exports.enum(["import", "fork"]),
|
|
29208
|
-
targetSessionId:
|
|
29220
|
+
targetSessionId: identifierStringSchema,
|
|
29209
29221
|
ready: sessionReadyEventSchema,
|
|
29210
29222
|
title: external_exports.string().max(500)
|
|
29211
29223
|
}).readonly(),
|
|
29212
29224
|
external_exports.strictObject({
|
|
29213
29225
|
...resultEnvelope,
|
|
29214
29226
|
action: external_exports.literal("preview"),
|
|
29215
|
-
entryId:
|
|
29216
|
-
targetSessionId:
|
|
29227
|
+
entryId: identifierStringSchema,
|
|
29228
|
+
targetSessionId: identifierStringSchema,
|
|
29217
29229
|
reason: external_exports.enum(["continuation_unavailable", "requested"]),
|
|
29218
29230
|
history: sessionHistorySchema,
|
|
29219
29231
|
title: external_exports.string().max(500)
|
|
@@ -29221,15 +29233,15 @@ var nativeSessionResultSchema = external_exports.discriminatedUnion("action", [
|
|
|
29221
29233
|
external_exports.strictObject({
|
|
29222
29234
|
...resultEnvelope,
|
|
29223
29235
|
action: external_exports.literal("history"),
|
|
29224
|
-
entryId:
|
|
29236
|
+
entryId: identifierStringSchema,
|
|
29225
29237
|
history: sessionHistorySchema,
|
|
29226
29238
|
title: external_exports.string().max(500)
|
|
29227
29239
|
}).readonly(),
|
|
29228
29240
|
external_exports.strictObject({
|
|
29229
29241
|
...resultEnvelope,
|
|
29230
29242
|
action: external_exports.literal("delete"),
|
|
29231
|
-
entryId:
|
|
29232
|
-
deletedSessionIds: external_exports.array(
|
|
29243
|
+
entryId: identifierStringSchema,
|
|
29244
|
+
deletedSessionIds: external_exports.array(identifierStringSchema).max(500).readonly()
|
|
29233
29245
|
}).readonly()
|
|
29234
29246
|
]);
|
|
29235
29247
|
var nativeSessionCancelSchema = external_exports.strictObject({ ...envelope, kind: external_exports.literal(NATIVE_SESSION_CANCEL_KIND) }).readonly();
|
|
@@ -29251,17 +29263,16 @@ var encodeNativeSessionCancel = (value) => JSON.stringify(nativeSessionCancelSch
|
|
|
29251
29263
|
// ../protocol/src/session-events.ts
|
|
29252
29264
|
var SESSION_EVENT_KIND = "session.event";
|
|
29253
29265
|
var SESSION_EVENT_COMMITTED_KIND = "session.event.committed";
|
|
29254
|
-
var IDENTIFIER_PATTERN3 = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
29255
29266
|
var MAX_RECORDED_EVENT_LENGTH = 8 * 1024 * 1024;
|
|
29256
29267
|
var eventEnvelopeSchema = external_exports.strictObject({
|
|
29257
29268
|
kind: external_exports.literal(SESSION_EVENT_KIND),
|
|
29258
29269
|
payload: external_exports.string().min(2).max(MAX_RECORDED_EVENT_LENGTH),
|
|
29259
|
-
sessionId:
|
|
29270
|
+
sessionId: identifierStringSchema
|
|
29260
29271
|
}).readonly();
|
|
29261
29272
|
var committedEventSchema = external_exports.strictObject({
|
|
29262
29273
|
kind: external_exports.literal(SESSION_EVENT_COMMITTED_KIND),
|
|
29263
29274
|
payload: external_exports.string().min(2).max(MAX_RECORDED_EVENT_LENGTH),
|
|
29264
|
-
sessionId:
|
|
29275
|
+
sessionId: identifierStringSchema
|
|
29265
29276
|
}).readonly();
|
|
29266
29277
|
function decode5(encoded, schema) {
|
|
29267
29278
|
let value;
|
|
@@ -29335,39 +29346,38 @@ var SESSION_LIVE_HISTORY_LOAD_KIND = "session.live-history.load";
|
|
|
29335
29346
|
var SESSION_LIVE_HISTORY_LOADED_KIND = "session.live-history.loaded";
|
|
29336
29347
|
var SESSION_LIVE_HISTORY_PAGE_LOAD_KIND = "session.live-history.page.load";
|
|
29337
29348
|
var SESSION_LIVE_HISTORY_PAGE_LOADED_KIND = "session.live-history.page.loaded";
|
|
29338
|
-
var identifier2 = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/);
|
|
29339
29349
|
var directoryIdentifier = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/);
|
|
29340
29350
|
var sessionLiveHistoryLoadSchema = external_exports.strictObject({
|
|
29341
29351
|
additionalDirectoryIds: external_exports.array(directoryIdentifier).max(16).readonly(),
|
|
29342
|
-
agentId:
|
|
29343
|
-
bindingId:
|
|
29352
|
+
agentId: identifierStringSchema,
|
|
29353
|
+
bindingId: identifierStringSchema,
|
|
29344
29354
|
directoryId: directoryIdentifier,
|
|
29345
29355
|
kind: external_exports.literal(SESSION_LIVE_HISTORY_LOAD_KIND),
|
|
29346
|
-
requestId:
|
|
29347
|
-
sessionId:
|
|
29356
|
+
requestId: identifierStringSchema,
|
|
29357
|
+
sessionId: identifierStringSchema
|
|
29348
29358
|
}).readonly();
|
|
29349
29359
|
var sessionLiveHistoryLoadedSchema = external_exports.strictObject({
|
|
29350
29360
|
history: sessionHistorySchema,
|
|
29351
29361
|
kind: external_exports.literal(SESSION_LIVE_HISTORY_LOADED_KIND),
|
|
29352
|
-
requestId:
|
|
29353
|
-
sessionId:
|
|
29362
|
+
requestId: identifierStringSchema,
|
|
29363
|
+
sessionId: identifierStringSchema
|
|
29354
29364
|
}).readonly();
|
|
29355
29365
|
var sessionLiveHistoryPageLoadSchema = external_exports.strictObject({
|
|
29356
29366
|
additionalDirectoryIds: external_exports.array(directoryIdentifier).max(16).readonly(),
|
|
29357
|
-
agentId:
|
|
29358
|
-
bindingId:
|
|
29367
|
+
agentId: identifierStringSchema,
|
|
29368
|
+
bindingId: identifierStringSchema,
|
|
29359
29369
|
cursor: external_exports.string().min(1).max(512).nullable(),
|
|
29360
29370
|
directoryId: directoryIdentifier,
|
|
29361
29371
|
kind: external_exports.literal(SESSION_LIVE_HISTORY_PAGE_LOAD_KIND),
|
|
29362
29372
|
limit: external_exports.number().int().min(1).max(100),
|
|
29363
|
-
requestId:
|
|
29364
|
-
sessionId:
|
|
29373
|
+
requestId: identifierStringSchema,
|
|
29374
|
+
sessionId: identifierStringSchema
|
|
29365
29375
|
}).readonly();
|
|
29366
29376
|
var sessionLiveHistoryPageLoadedSchema = external_exports.strictObject({
|
|
29367
29377
|
kind: external_exports.literal(SESSION_LIVE_HISTORY_PAGE_LOADED_KIND),
|
|
29368
29378
|
page: nativeMessagePageSchema,
|
|
29369
|
-
requestId:
|
|
29370
|
-
sessionId:
|
|
29379
|
+
requestId: identifierStringSchema,
|
|
29380
|
+
sessionId: identifierStringSchema
|
|
29371
29381
|
}).readonly();
|
|
29372
29382
|
function decode6(schema, encoded) {
|
|
29373
29383
|
try {
|
|
@@ -29686,7 +29696,6 @@ import { dirname as dirname3, join as join15, resolve as resolve4 } from "node:p
|
|
|
29686
29696
|
var APPLICATION_ID_PATTERN = /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+){1,31}$/;
|
|
29687
29697
|
var CONNECTION_ID_PATTERN = /^mcn_[a-f0-9]{32}$/;
|
|
29688
29698
|
var INSTALLATION_ID_PATTERN = /^min_[a-f0-9]{32}$/;
|
|
29689
|
-
var IDENTIFIER_PATTERN4 = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
29690
29699
|
var RUNTIME_CREDENTIAL_PATTERN = /^[a-zA-Z0-9_-]{32,256}$/;
|
|
29691
29700
|
var MAX_FILE_LENGTH = 16 * 1024;
|
|
29692
29701
|
var INSTALLATION_POINTER_KEYS = ["installationId", "version"];
|
|
@@ -29764,7 +29773,7 @@ function validateApplicationId(value) {
|
|
|
29764
29773
|
return value;
|
|
29765
29774
|
}
|
|
29766
29775
|
function validateRemoteAppId(value) {
|
|
29767
|
-
if (!
|
|
29776
|
+
if (!isIdentifier(value)) {
|
|
29768
29777
|
throw new RuntimeInstallationStoreError("invalid_app_id", "The remote App ID is invalid");
|
|
29769
29778
|
}
|
|
29770
29779
|
return value;
|
|
@@ -29782,7 +29791,7 @@ function validateInstallationId(value) {
|
|
|
29782
29791
|
return value;
|
|
29783
29792
|
}
|
|
29784
29793
|
function validateIdentifier(value, code) {
|
|
29785
|
-
if (!
|
|
29794
|
+
if (!isIdentifier(value)) {
|
|
29786
29795
|
throw new RuntimeInstallationStoreError(code, "The saved Runtime connection is invalid");
|
|
29787
29796
|
}
|
|
29788
29797
|
return value;
|
|
@@ -30186,7 +30195,6 @@ async function openRuntimeInstallationStore(options, signal) {
|
|
|
30186
30195
|
// src/pairing/pair-local-machine.ts
|
|
30187
30196
|
var PAIRING_TIMEOUT_MILLISECONDS = 2e4;
|
|
30188
30197
|
var PAIRING_CODE_PATTERN = /^[A-HJ-NP-Z2-9]{4}(?:-[A-HJ-NP-Z2-9]{4}){4}$/;
|
|
30189
|
-
var IDENTIFIER_PATTERN5 = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
30190
30198
|
var TOKEN_PATTERN = /^[a-zA-Z0-9_-]{32,256}$/;
|
|
30191
30199
|
var CLAIM_RESPONSE_KEYS = ["appId", "channelId", "daemonToken", "runtimeId"];
|
|
30192
30200
|
var REDEEM_RESPONSE_KEYS = ["appId", "channelId", "runtimeCredential", "runtimeId"];
|
|
@@ -30273,7 +30281,7 @@ function parsePairCommand(arguments_, defaultWorkspace) {
|
|
|
30273
30281
|
};
|
|
30274
30282
|
}
|
|
30275
30283
|
function validatePairingId(value) {
|
|
30276
|
-
if (!
|
|
30284
|
+
if (!isIdentifier(value)) {
|
|
30277
30285
|
throw new PairingClientError("invalid_pairing_id", "The Runtime pairing ID is invalid");
|
|
30278
30286
|
}
|
|
30279
30287
|
return value;
|
|
@@ -30342,7 +30350,7 @@ function decodePairingResponse(value, credentialField, expectedKeys) {
|
|
|
30342
30350
|
const channelId = value["channelId"];
|
|
30343
30351
|
const runtimeCredential2 = value[credentialField];
|
|
30344
30352
|
const runtimeId = value["runtimeId"];
|
|
30345
|
-
if (typeof appId !== "string" || !
|
|
30353
|
+
if (typeof appId !== "string" || !isIdentifier(appId) || typeof channelId !== "string" || !isIdentifier(channelId) || typeof runtimeCredential2 !== "string" || !TOKEN_PATTERN.test(runtimeCredential2) || typeof runtimeId !== "string" || !isIdentifier(runtimeId)) {
|
|
30346
30354
|
throw new PairingClientError("invalid_relay_response", "The relay returned an invalid pairing response");
|
|
30347
30355
|
}
|
|
30348
30356
|
return { appId, channelId, runtimeCredential: runtimeCredential2, runtimeId };
|
|
@@ -35246,7 +35254,6 @@ var ARTIFACT_SCHEME = "mobius-artifact:";
|
|
|
35246
35254
|
var ARTIFACT_DOWNLOAD_TIMEOUT_MILLISECONDS = 2e4;
|
|
35247
35255
|
var MAX_AGENT_IMAGE_BASE64_LENGTH = 4e6;
|
|
35248
35256
|
var MAX_AGENT_RESOURCE_BYTE_LENGTH = 1e6;
|
|
35249
|
-
var IDENTIFIER_PATTERN6 = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
35250
35257
|
var PromptArtifactError = class extends Error {
|
|
35251
35258
|
code;
|
|
35252
35259
|
constructor(code, message, options = {}) {
|
|
@@ -35289,7 +35296,7 @@ function parseReference(resource) {
|
|
|
35289
35296
|
const encodedByteLength2 = url2.searchParams.get("byteLength") ?? "";
|
|
35290
35297
|
const sha256 = url2.searchParams.get("sha256") ?? "";
|
|
35291
35298
|
const byteLength = Number(encodedByteLength2);
|
|
35292
|
-
if (url2.protocol !== ARTIFACT_SCHEME || url2.hash.length > 0 || resource.type !== "link" || resource.text.length > 0 || !
|
|
35299
|
+
if (url2.protocol !== ARTIFACT_SCHEME || url2.hash.length > 0 || resource.type !== "link" || resource.text.length > 0 || !isIdentifier(artifactId) || keys.length !== 2 || keys[0] !== "byteLength" || keys[1] !== "sha256" || !/^[1-9][0-9]*$/.test(encodedByteLength2) || !Number.isSafeInteger(byteLength) || !/^[a-f0-9]{64}$/.test(sha256)) {
|
|
35293
35300
|
throw new PromptArtifactError("artifact_reference_invalid", "The prompt artifact reference is invalid");
|
|
35294
35301
|
}
|
|
35295
35302
|
return new PromptArtifactReference(artifactId, byteLength, sha256, resource);
|
|
@@ -37687,7 +37694,7 @@ var ActiveDaemonTurn = class {
|
|
|
37687
37694
|
#truncated = false;
|
|
37688
37695
|
#sequence = 0;
|
|
37689
37696
|
#interaction = null;
|
|
37690
|
-
#epoch = randomUUID3();
|
|
37697
|
+
#epoch = decodeIdentifier(randomUUID3());
|
|
37691
37698
|
constructor(command, attemptId) {
|
|
37692
37699
|
this.attemptId = attemptId;
|
|
37693
37700
|
this.command = command;
|
|
@@ -37723,7 +37730,7 @@ var ActiveDaemonTurn = class {
|
|
|
37723
37730
|
}
|
|
37724
37731
|
};
|
|
37725
37732
|
snapshot = () => this.#accepted ? {
|
|
37726
|
-
commandId: this.command.commandId,
|
|
37733
|
+
commandId: decodeIdentifier(this.command.commandId),
|
|
37727
37734
|
prompt: this.command.prompt,
|
|
37728
37735
|
text: this.#text,
|
|
37729
37736
|
truncated: this.#truncated,
|
|
@@ -38493,7 +38500,7 @@ var NativeSessionService = class {
|
|
|
38493
38500
|
return {
|
|
38494
38501
|
action: "create",
|
|
38495
38502
|
kind: "native.session.result",
|
|
38496
|
-
nativeSessionId,
|
|
38503
|
+
nativeSessionId: decodeIdentifier(nativeSessionId),
|
|
38497
38504
|
requestId: command.requestId,
|
|
38498
38505
|
sessionId: command.sessionId
|
|
38499
38506
|
};
|
|
@@ -38513,7 +38520,7 @@ var NativeSessionService = class {
|
|
|
38513
38520
|
if (authorized === null) {
|
|
38514
38521
|
return null;
|
|
38515
38522
|
}
|
|
38516
|
-
const entryId = randomUUID4();
|
|
38523
|
+
const entryId = decodeIdentifier(randomUUID4());
|
|
38517
38524
|
if (this.#entries.size >= 5e3) {
|
|
38518
38525
|
this.#entries.clear();
|
|
38519
38526
|
}
|
|
@@ -38525,8 +38532,8 @@ var NativeSessionService = class {
|
|
|
38525
38532
|
});
|
|
38526
38533
|
return {
|
|
38527
38534
|
entryId,
|
|
38528
|
-
mobiusSessionIds: this.#sessions.findLinkedSessions(command.agentId, info.sessionId).filter((session) => session.prompted && session.cwd === authorized.cwd).map((session) => session.sessionId),
|
|
38529
|
-
nativeSessionId: info.sessionId,
|
|
38535
|
+
mobiusSessionIds: this.#sessions.findLinkedSessions(command.agentId, info.sessionId).filter((session) => session.prompted && session.cwd === authorized.cwd).map((session) => decodeIdentifier(session.sessionId)),
|
|
38536
|
+
nativeSessionId: decodeIdentifier(info.sessionId),
|
|
38530
38537
|
title: info.title ?? "Untitled session",
|
|
38531
38538
|
directoryId: authorized.directoryId,
|
|
38532
38539
|
directoryLabel: authorized.directoryLabel,
|
|
@@ -38569,7 +38576,7 @@ var NativeSessionService = class {
|
|
|
38569
38576
|
"invalid_native_session_response"
|
|
38570
38577
|
);
|
|
38571
38578
|
}
|
|
38572
|
-
nextCursor = randomUUID4();
|
|
38579
|
+
nextCursor = decodeIdentifier(randomUUID4());
|
|
38573
38580
|
if (this.#cursors.size >= 500) {
|
|
38574
38581
|
this.#cursors.clear();
|
|
38575
38582
|
}
|
|
@@ -38686,7 +38693,7 @@ var NativeSessionService = class {
|
|
|
38686
38693
|
...envelope2,
|
|
38687
38694
|
action: "delete",
|
|
38688
38695
|
entryId: command.entryId,
|
|
38689
|
-
deletedSessionIds
|
|
38696
|
+
deletedSessionIds: deletedSessionIds.map(decodeIdentifier)
|
|
38690
38697
|
};
|
|
38691
38698
|
}
|
|
38692
38699
|
const action = command.action;
|