@agentclientprotocol/codex-acp 1.1.0 → 1.1.2
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/index.js +946 -493
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -18274,6 +18274,48 @@ function requiredDefaultOnError(schema, fallback) {
|
|
|
18274
18274
|
return external_exports.NEVER;
|
|
18275
18275
|
});
|
|
18276
18276
|
}
|
|
18277
|
+
function stringTag(value, key) {
|
|
18278
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
18279
|
+
return void 0;
|
|
18280
|
+
}
|
|
18281
|
+
const tag = value[key];
|
|
18282
|
+
return typeof tag === "string" ? tag : void 0;
|
|
18283
|
+
}
|
|
18284
|
+
function excludeKnownTags(schema, key, knownTags) {
|
|
18285
|
+
return schema.superRefine((value, context) => {
|
|
18286
|
+
const tag = stringTag(value, key);
|
|
18287
|
+
if (tag !== void 0 && knownTags.includes(tag)) {
|
|
18288
|
+
context.addIssue({
|
|
18289
|
+
code: "custom",
|
|
18290
|
+
path: [key],
|
|
18291
|
+
message: `${key} ${JSON.stringify(tag)} is reserved by a known variant, but the value does not match that variant's schema`
|
|
18292
|
+
});
|
|
18293
|
+
}
|
|
18294
|
+
});
|
|
18295
|
+
}
|
|
18296
|
+
function preserveCustomPayload(schema, key, knownTags) {
|
|
18297
|
+
return external_exports.unknown().transform((value, context) => {
|
|
18298
|
+
const result = schema.safeParse(value);
|
|
18299
|
+
if (!result.success) {
|
|
18300
|
+
for (const issue2 of result.error.issues) {
|
|
18301
|
+
context.addIssue({ ...issue2, input: value });
|
|
18302
|
+
}
|
|
18303
|
+
return external_exports.NEVER;
|
|
18304
|
+
}
|
|
18305
|
+
const output = result.data;
|
|
18306
|
+
const tag = stringTag(value, key);
|
|
18307
|
+
if (tag !== void 0 && !knownTags.includes(tag)) {
|
|
18308
|
+
const raw = value;
|
|
18309
|
+
for (const [property, rawValue] of Object.entries(raw)) {
|
|
18310
|
+
if (property === "__proto__")
|
|
18311
|
+
continue;
|
|
18312
|
+
if (!Object.hasOwn(output, property))
|
|
18313
|
+
output[property] = rawValue;
|
|
18314
|
+
}
|
|
18315
|
+
}
|
|
18316
|
+
return output;
|
|
18317
|
+
});
|
|
18318
|
+
}
|
|
18277
18319
|
function vecSkipError(itemSchema) {
|
|
18278
18320
|
return external_exports.array(itemSchema.catch(skippedItem)).transform((items) => items.filter((item) => item !== skippedItem));
|
|
18279
18321
|
}
|
|
@@ -18285,18 +18327,18 @@ var zWriteTextFileRequest = object({
|
|
|
18285
18327
|
sessionId: zSessionId,
|
|
18286
18328
|
path: string2(),
|
|
18287
18329
|
content: string2(),
|
|
18288
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18330
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18289
18331
|
});
|
|
18290
18332
|
var zReadTextFileRequest = object({
|
|
18291
18333
|
sessionId: zSessionId,
|
|
18292
18334
|
path: string2(),
|
|
18293
|
-
line: int().gte(0).max(4294967295, {
|
|
18335
|
+
line: defaultOnError(int().gte(0).max(4294967295, {
|
|
18294
18336
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
18295
|
-
}).nullish(),
|
|
18296
|
-
limit: int().gte(0).max(4294967295, {
|
|
18337
|
+
}).nullish(), () => void 0),
|
|
18338
|
+
limit: defaultOnError(int().gte(0).max(4294967295, {
|
|
18297
18339
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
18298
|
-
}).nullish(),
|
|
18299
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18340
|
+
}).nullish(), () => void 0),
|
|
18341
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18300
18342
|
});
|
|
18301
18343
|
var zToolCallId = string2();
|
|
18302
18344
|
var zToolKind = union([
|
|
@@ -18320,49 +18362,49 @@ var zToolCallStatus = union([
|
|
|
18320
18362
|
var zRole = union([literal("assistant"), literal("user")]);
|
|
18321
18363
|
var zAnnotations = object({
|
|
18322
18364
|
audience: defaultOnError(vecSkipError(zRole).nullish(), () => void 0),
|
|
18323
|
-
lastModified: string2().nullish(),
|
|
18324
|
-
priority: number2().nullish(),
|
|
18325
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18365
|
+
lastModified: defaultOnError(string2().nullish(), () => void 0),
|
|
18366
|
+
priority: defaultOnError(number2().nullish(), () => void 0),
|
|
18367
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18326
18368
|
});
|
|
18327
18369
|
var zTextContent = object({
|
|
18328
18370
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
18329
18371
|
text: string2(),
|
|
18330
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18372
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18331
18373
|
});
|
|
18332
18374
|
var zImageContent = object({
|
|
18333
18375
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
18334
18376
|
data: string2(),
|
|
18335
18377
|
mimeType: string2(),
|
|
18336
|
-
uri: string2().nullish(),
|
|
18337
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18378
|
+
uri: defaultOnError(string2().nullish(), () => void 0),
|
|
18379
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18338
18380
|
});
|
|
18339
18381
|
var zAudioContent = object({
|
|
18340
18382
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
18341
18383
|
data: string2(),
|
|
18342
18384
|
mimeType: string2(),
|
|
18343
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18385
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18344
18386
|
});
|
|
18345
18387
|
var zResourceLink = object({
|
|
18346
18388
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
18347
|
-
description: string2().nullish(),
|
|
18348
|
-
mimeType: string2().nullish(),
|
|
18389
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18390
|
+
mimeType: defaultOnError(string2().nullish(), () => void 0),
|
|
18349
18391
|
name: string2(),
|
|
18350
|
-
size: number2().nullish(),
|
|
18351
|
-
title: string2().nullish(),
|
|
18392
|
+
size: defaultOnError(number2().nullish(), () => void 0),
|
|
18393
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18352
18394
|
uri: string2(),
|
|
18353
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18395
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18354
18396
|
});
|
|
18355
18397
|
var zTextResourceContents = object({
|
|
18356
|
-
mimeType: string2().nullish(),
|
|
18398
|
+
mimeType: defaultOnError(string2().nullish(), () => void 0),
|
|
18357
18399
|
text: string2(),
|
|
18358
18400
|
uri: string2(),
|
|
18359
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18401
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18360
18402
|
});
|
|
18361
18403
|
var zBlobResourceContents = object({
|
|
18362
18404
|
blob: string2(),
|
|
18363
|
-
mimeType: string2().nullish(),
|
|
18405
|
+
mimeType: defaultOnError(string2().nullish(), () => void 0),
|
|
18364
18406
|
uri: string2(),
|
|
18365
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18407
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18366
18408
|
});
|
|
18367
18409
|
var zEmbeddedResourceResource = union([
|
|
18368
18410
|
zTextResourceContents,
|
|
@@ -18371,7 +18413,7 @@ var zEmbeddedResourceResource = union([
|
|
|
18371
18413
|
var zEmbeddedResource = object({
|
|
18372
18414
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
18373
18415
|
resource: zEmbeddedResourceResource,
|
|
18374
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18416
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18375
18417
|
});
|
|
18376
18418
|
var zContentBlock = union([
|
|
18377
18419
|
zTextContent.and(object({
|
|
@@ -18392,18 +18434,18 @@ var zContentBlock = union([
|
|
|
18392
18434
|
]);
|
|
18393
18435
|
var zContent = object({
|
|
18394
18436
|
content: zContentBlock,
|
|
18395
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18437
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18396
18438
|
});
|
|
18397
18439
|
var zDiff = object({
|
|
18398
18440
|
path: string2(),
|
|
18399
|
-
oldText: string2().nullish(),
|
|
18441
|
+
oldText: defaultOnError(string2().nullish(), () => void 0),
|
|
18400
18442
|
newText: string2(),
|
|
18401
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18443
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18402
18444
|
});
|
|
18403
18445
|
var zTerminalId = string2();
|
|
18404
18446
|
var zTerminal = object({
|
|
18405
18447
|
terminalId: zTerminalId,
|
|
18406
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18448
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18407
18449
|
});
|
|
18408
18450
|
var zToolCallContent = union([
|
|
18409
18451
|
zContent.and(object({
|
|
@@ -18418,21 +18460,21 @@ var zToolCallContent = union([
|
|
|
18418
18460
|
]);
|
|
18419
18461
|
var zToolCallLocation = object({
|
|
18420
18462
|
path: string2(),
|
|
18421
|
-
line: int().gte(0).max(4294967295, {
|
|
18463
|
+
line: defaultOnError(int().gte(0).max(4294967295, {
|
|
18422
18464
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
18423
|
-
}).nullish(),
|
|
18424
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18465
|
+
}).nullish(), () => void 0),
|
|
18466
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18425
18467
|
});
|
|
18426
18468
|
var zToolCallUpdate = object({
|
|
18427
18469
|
toolCallId: zToolCallId,
|
|
18428
18470
|
kind: defaultOnError(zToolKind.nullish(), () => void 0),
|
|
18429
18471
|
status: defaultOnError(zToolCallStatus.nullish(), () => void 0),
|
|
18430
|
-
title: string2().nullish(),
|
|
18472
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18431
18473
|
content: defaultOnError(vecSkipError(zToolCallContent).nullish(), () => void 0),
|
|
18432
18474
|
locations: defaultOnError(vecSkipError(zToolCallLocation).nullish(), () => void 0),
|
|
18433
|
-
rawInput: unknown().optional(),
|
|
18434
|
-
rawOutput: unknown().optional(),
|
|
18435
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18475
|
+
rawInput: defaultOnError(unknown().optional(), () => void 0),
|
|
18476
|
+
rawOutput: defaultOnError(unknown().optional(), () => void 0),
|
|
18477
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18436
18478
|
});
|
|
18437
18479
|
var zPermissionOptionId = string2();
|
|
18438
18480
|
var zPermissionOptionKind = union([
|
|
@@ -18445,51 +18487,51 @@ var zPermissionOption = object({
|
|
|
18445
18487
|
optionId: zPermissionOptionId,
|
|
18446
18488
|
name: string2(),
|
|
18447
18489
|
kind: zPermissionOptionKind,
|
|
18448
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18490
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18449
18491
|
});
|
|
18450
18492
|
var zRequestPermissionRequest = object({
|
|
18451
18493
|
sessionId: zSessionId,
|
|
18452
18494
|
toolCall: zToolCallUpdate,
|
|
18453
18495
|
options: array(zPermissionOption),
|
|
18454
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18496
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18455
18497
|
});
|
|
18456
18498
|
var zEnvVariable = object({
|
|
18457
18499
|
name: string2(),
|
|
18458
18500
|
value: string2(),
|
|
18459
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18501
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18460
18502
|
});
|
|
18461
18503
|
var zCreateTerminalRequest = object({
|
|
18462
18504
|
sessionId: zSessionId,
|
|
18463
18505
|
command: string2(),
|
|
18464
|
-
args:
|
|
18465
|
-
env:
|
|
18466
|
-
cwd: string2().nullish(),
|
|
18467
|
-
outputByteLimit: number2().nullish(),
|
|
18468
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18506
|
+
args: defaultOnError(vecSkipError(string2()).optional(), () => []),
|
|
18507
|
+
env: defaultOnError(vecSkipError(zEnvVariable).optional(), () => []),
|
|
18508
|
+
cwd: defaultOnError(string2().nullish(), () => void 0),
|
|
18509
|
+
outputByteLimit: defaultOnError(number2().nullish(), () => void 0),
|
|
18510
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18469
18511
|
});
|
|
18470
18512
|
var zTerminalOutputRequest = object({
|
|
18471
18513
|
sessionId: zSessionId,
|
|
18472
18514
|
terminalId: zTerminalId,
|
|
18473
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18515
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18474
18516
|
});
|
|
18475
18517
|
var zReleaseTerminalRequest = object({
|
|
18476
18518
|
sessionId: zSessionId,
|
|
18477
18519
|
terminalId: zTerminalId,
|
|
18478
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18520
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18479
18521
|
});
|
|
18480
18522
|
var zWaitForTerminalExitRequest = object({
|
|
18481
18523
|
sessionId: zSessionId,
|
|
18482
18524
|
terminalId: zTerminalId,
|
|
18483
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18525
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18484
18526
|
});
|
|
18485
18527
|
var zKillTerminalRequest = object({
|
|
18486
18528
|
sessionId: zSessionId,
|
|
18487
18529
|
terminalId: zTerminalId,
|
|
18488
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18530
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18489
18531
|
});
|
|
18490
18532
|
var zElicitationSessionScope = object({
|
|
18491
18533
|
sessionId: zSessionId,
|
|
18492
|
-
toolCallId: zToolCallId.nullish()
|
|
18534
|
+
toolCallId: defaultOnError(zToolCallId.nullish(), () => void 0)
|
|
18493
18535
|
});
|
|
18494
18536
|
var zElicitationRequestScope = object({
|
|
18495
18537
|
requestId: zRequestId
|
|
@@ -18504,11 +18546,12 @@ var zStringFormat = union([
|
|
|
18504
18546
|
var zEnumOption = object({
|
|
18505
18547
|
const: string2(),
|
|
18506
18548
|
title: string2(),
|
|
18507
|
-
|
|
18549
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18550
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18508
18551
|
});
|
|
18509
18552
|
var zStringPropertySchema = object({
|
|
18510
|
-
title: string2().nullish(),
|
|
18511
|
-
description: string2().nullish(),
|
|
18553
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18554
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18512
18555
|
minLength: int().gte(0).max(4294967295, {
|
|
18513
18556
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
18514
18557
|
}).nullish(),
|
|
@@ -18517,57 +18560,60 @@ var zStringPropertySchema = object({
|
|
|
18517
18560
|
}).nullish(),
|
|
18518
18561
|
pattern: string2().nullish(),
|
|
18519
18562
|
format: zStringFormat.nullish(),
|
|
18520
|
-
default: string2().nullish(),
|
|
18563
|
+
default: defaultOnError(string2().nullish(), () => void 0),
|
|
18521
18564
|
enum: array(string2()).nullish(),
|
|
18522
18565
|
oneOf: array(zEnumOption).nullish(),
|
|
18523
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18566
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18524
18567
|
});
|
|
18525
18568
|
var zNumberPropertySchema = object({
|
|
18526
|
-
title: string2().nullish(),
|
|
18527
|
-
description: string2().nullish(),
|
|
18569
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18570
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18528
18571
|
minimum: number2().nullish(),
|
|
18529
18572
|
maximum: number2().nullish(),
|
|
18530
|
-
default: number2().nullish(),
|
|
18531
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18573
|
+
default: defaultOnError(number2().nullish(), () => void 0),
|
|
18574
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18532
18575
|
});
|
|
18533
18576
|
var zIntegerPropertySchema = object({
|
|
18534
|
-
title: string2().nullish(),
|
|
18535
|
-
description: string2().nullish(),
|
|
18577
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18578
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18536
18579
|
minimum: number2().nullish(),
|
|
18537
18580
|
maximum: number2().nullish(),
|
|
18538
|
-
default: number2().nullish(),
|
|
18539
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18581
|
+
default: defaultOnError(number2().nullish(), () => void 0),
|
|
18582
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18540
18583
|
});
|
|
18541
18584
|
var zBooleanPropertySchema = object({
|
|
18542
|
-
title: string2().nullish(),
|
|
18543
|
-
description: string2().nullish(),
|
|
18544
|
-
default: boolean2().nullish(),
|
|
18545
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18546
|
-
});
|
|
18547
|
-
var
|
|
18548
|
-
var zUntitledMultiSelectItems = object({
|
|
18549
|
-
type: zElicitationStringType,
|
|
18585
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18586
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18587
|
+
default: defaultOnError(boolean2().nullish(), () => void 0),
|
|
18588
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18589
|
+
});
|
|
18590
|
+
var zStringMultiSelectItems = object({
|
|
18550
18591
|
enum: array(string2()),
|
|
18551
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18592
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18552
18593
|
});
|
|
18553
18594
|
var zTitledMultiSelectItems = object({
|
|
18554
18595
|
anyOf: array(zEnumOption),
|
|
18555
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18596
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18556
18597
|
});
|
|
18557
|
-
var zMultiSelectItems = union([
|
|
18558
|
-
|
|
18598
|
+
var zMultiSelectItems = preserveCustomPayload(union([
|
|
18599
|
+
zStringMultiSelectItems.and(object({
|
|
18600
|
+
type: literal("string")
|
|
18601
|
+
})),
|
|
18602
|
+
excludeKnownTags(object({
|
|
18603
|
+
type: string2()
|
|
18604
|
+
}), "type", ["string"]),
|
|
18559
18605
|
zTitledMultiSelectItems
|
|
18560
|
-
]);
|
|
18606
|
+
]), "type", ["string"]);
|
|
18561
18607
|
var zMultiSelectPropertySchema = object({
|
|
18562
|
-
title: string2().nullish(),
|
|
18563
|
-
description: string2().nullish(),
|
|
18608
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18609
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18564
18610
|
minItems: number2().nullish(),
|
|
18565
18611
|
maxItems: number2().nullish(),
|
|
18566
18612
|
items: zMultiSelectItems,
|
|
18567
|
-
default:
|
|
18568
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18613
|
+
default: defaultOnError(vecSkipError(string2()).nullish(), () => void 0),
|
|
18614
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18569
18615
|
});
|
|
18570
|
-
var zElicitationPropertySchema = union([
|
|
18616
|
+
var zElicitationPropertySchema = preserveCustomPayload(union([
|
|
18571
18617
|
zStringPropertySchema.and(object({
|
|
18572
18618
|
type: literal("string")
|
|
18573
18619
|
})),
|
|
@@ -18582,15 +18628,18 @@ var zElicitationPropertySchema = union([
|
|
|
18582
18628
|
})),
|
|
18583
18629
|
zMultiSelectPropertySchema.and(object({
|
|
18584
18630
|
type: literal("array")
|
|
18585
|
-
}))
|
|
18586
|
-
|
|
18631
|
+
})),
|
|
18632
|
+
excludeKnownTags(object({
|
|
18633
|
+
type: string2()
|
|
18634
|
+
}), "type", ["array", "boolean", "integer", "number", "string"])
|
|
18635
|
+
]), "type", ["array", "boolean", "integer", "number", "string"]);
|
|
18587
18636
|
var zElicitationSchema = object({
|
|
18588
|
-
type: zElicitationSchemaType.optional().default("object"),
|
|
18589
|
-
title: string2().nullish(),
|
|
18637
|
+
type: defaultOnError(zElicitationSchemaType.optional().default("object"), () => "object"),
|
|
18638
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18590
18639
|
properties: record(string2(), zElicitationPropertySchema).optional().default({}),
|
|
18591
18640
|
required: array(string2()).nullish(),
|
|
18592
|
-
description: string2().nullish(),
|
|
18593
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18641
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18642
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18594
18643
|
});
|
|
18595
18644
|
var zElicitationFormMode = intersection(union([zElicitationSessionScope, zElicitationRequestScope]), object({
|
|
18596
18645
|
requestedSchema: zElicitationSchema
|
|
@@ -18600,32 +18649,35 @@ var zElicitationUrlMode = intersection(union([zElicitationSessionScope, zElicita
|
|
|
18600
18649
|
elicitationId: zElicitationId,
|
|
18601
18650
|
url: url()
|
|
18602
18651
|
}));
|
|
18603
|
-
var zCreateElicitationRequest = intersection(union([
|
|
18652
|
+
var zCreateElicitationRequest = preserveCustomPayload(intersection(union([
|
|
18604
18653
|
zElicitationFormMode.and(object({
|
|
18605
18654
|
mode: literal("form")
|
|
18606
18655
|
})),
|
|
18607
18656
|
zElicitationUrlMode.and(object({
|
|
18608
18657
|
mode: literal("url")
|
|
18609
|
-
}))
|
|
18658
|
+
})),
|
|
18659
|
+
excludeKnownTags(intersection(union([zElicitationSessionScope, zElicitationRequestScope]), object({
|
|
18660
|
+
mode: string2()
|
|
18661
|
+
})), "mode", ["form", "url"])
|
|
18610
18662
|
]), object({
|
|
18611
18663
|
message: string2(),
|
|
18612
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18613
|
-
}));
|
|
18664
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18665
|
+
})), "mode", ["form", "url"]);
|
|
18614
18666
|
var zMcpServerAcpId = string2();
|
|
18615
18667
|
var zConnectMcpRequest = object({
|
|
18616
|
-
|
|
18617
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18668
|
+
serverId: zMcpServerAcpId,
|
|
18669
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18618
18670
|
});
|
|
18619
18671
|
var zMcpConnectionId = string2();
|
|
18620
18672
|
var zMessageMcpRequest = object({
|
|
18621
18673
|
connectionId: zMcpConnectionId,
|
|
18622
18674
|
method: string2(),
|
|
18623
18675
|
params: record(string2(), unknown()).nullish(),
|
|
18624
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18676
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18625
18677
|
});
|
|
18626
18678
|
var zDisconnectMcpRequest = object({
|
|
18627
18679
|
connectionId: zMcpConnectionId,
|
|
18628
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18680
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18629
18681
|
});
|
|
18630
18682
|
var zExtRequest = unknown();
|
|
18631
18683
|
var zAgentRequest = object({
|
|
@@ -18649,34 +18701,34 @@ var zAgentRequest = object({
|
|
|
18649
18701
|
});
|
|
18650
18702
|
var zProtocolVersion = int().gte(0).lte(65535);
|
|
18651
18703
|
var zPromptCapabilities = object({
|
|
18652
|
-
image: boolean2().optional().default(false),
|
|
18653
|
-
audio: boolean2().optional().default(false),
|
|
18654
|
-
embeddedContext: boolean2().optional().default(false),
|
|
18655
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18704
|
+
image: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18705
|
+
audio: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18706
|
+
embeddedContext: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18707
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18656
18708
|
});
|
|
18657
18709
|
var zMcpCapabilities = object({
|
|
18658
|
-
http: boolean2().optional().default(false),
|
|
18659
|
-
sse: boolean2().optional().default(false),
|
|
18660
|
-
acp: boolean2().optional().default(false),
|
|
18661
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18710
|
+
http: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18711
|
+
sse: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18712
|
+
acp: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18713
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18662
18714
|
});
|
|
18663
18715
|
var zSessionListCapabilities = object({
|
|
18664
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18716
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18665
18717
|
});
|
|
18666
18718
|
var zSessionDeleteCapabilities = object({
|
|
18667
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18719
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18668
18720
|
});
|
|
18669
18721
|
var zSessionAdditionalDirectoriesCapabilities = object({
|
|
18670
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18722
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18671
18723
|
});
|
|
18672
18724
|
var zSessionForkCapabilities = object({
|
|
18673
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18725
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18674
18726
|
});
|
|
18675
18727
|
var zSessionResumeCapabilities = object({
|
|
18676
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18728
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18677
18729
|
});
|
|
18678
18730
|
var zSessionCloseCapabilities = object({
|
|
18679
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18731
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18680
18732
|
});
|
|
18681
18733
|
var zSessionCapabilities = object({
|
|
18682
18734
|
list: defaultOnError(zSessionListCapabilities.nullish(), () => void 0),
|
|
@@ -18685,20 +18737,20 @@ var zSessionCapabilities = object({
|
|
|
18685
18737
|
fork: defaultOnError(zSessionForkCapabilities.nullish(), () => void 0),
|
|
18686
18738
|
resume: defaultOnError(zSessionResumeCapabilities.nullish(), () => void 0),
|
|
18687
18739
|
close: defaultOnError(zSessionCloseCapabilities.nullish(), () => void 0),
|
|
18688
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18740
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18689
18741
|
});
|
|
18690
18742
|
var zLogoutCapabilities = object({
|
|
18691
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18743
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18692
18744
|
});
|
|
18693
18745
|
var zAgentAuthCapabilities = object({
|
|
18694
18746
|
logout: defaultOnError(zLogoutCapabilities.nullish(), () => void 0),
|
|
18695
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18747
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18696
18748
|
});
|
|
18697
18749
|
var zProvidersCapabilities = object({
|
|
18698
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18750
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18699
18751
|
});
|
|
18700
18752
|
var zNesDocumentDidOpenCapabilities = object({
|
|
18701
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18753
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18702
18754
|
});
|
|
18703
18755
|
var zTextDocumentSyncKind = union([
|
|
18704
18756
|
literal("full"),
|
|
@@ -18706,16 +18758,16 @@ var zTextDocumentSyncKind = union([
|
|
|
18706
18758
|
]);
|
|
18707
18759
|
var zNesDocumentDidChangeCapabilities = object({
|
|
18708
18760
|
syncKind: zTextDocumentSyncKind,
|
|
18709
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18761
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18710
18762
|
});
|
|
18711
18763
|
var zNesDocumentDidCloseCapabilities = object({
|
|
18712
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18764
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18713
18765
|
});
|
|
18714
18766
|
var zNesDocumentDidSaveCapabilities = object({
|
|
18715
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18767
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18716
18768
|
});
|
|
18717
18769
|
var zNesDocumentDidFocusCapabilities = object({
|
|
18718
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18770
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18719
18771
|
});
|
|
18720
18772
|
var zNesDocumentEventCapabilities = object({
|
|
18721
18773
|
didOpen: defaultOnError(zNesDocumentDidOpenCapabilities.nullish(), () => void 0),
|
|
@@ -18723,38 +18775,38 @@ var zNesDocumentEventCapabilities = object({
|
|
|
18723
18775
|
didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => void 0),
|
|
18724
18776
|
didSave: defaultOnError(zNesDocumentDidSaveCapabilities.nullish(), () => void 0),
|
|
18725
18777
|
didFocus: defaultOnError(zNesDocumentDidFocusCapabilities.nullish(), () => void 0),
|
|
18726
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18778
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18727
18779
|
});
|
|
18728
18780
|
var zNesEventCapabilities = object({
|
|
18729
18781
|
document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => void 0),
|
|
18730
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18782
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18731
18783
|
});
|
|
18732
18784
|
var zNesRecentFilesCapabilities = object({
|
|
18733
|
-
maxCount: int().gte(0).max(4294967295, {
|
|
18785
|
+
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
18734
18786
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
18735
|
-
}).nullish(),
|
|
18736
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18787
|
+
}).nullish(), () => void 0),
|
|
18788
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18737
18789
|
});
|
|
18738
18790
|
var zNesRelatedSnippetsCapabilities = object({
|
|
18739
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18791
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18740
18792
|
});
|
|
18741
18793
|
var zNesEditHistoryCapabilities = object({
|
|
18742
|
-
maxCount: int().gte(0).max(4294967295, {
|
|
18794
|
+
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
18743
18795
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
18744
|
-
}).nullish(),
|
|
18745
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18796
|
+
}).nullish(), () => void 0),
|
|
18797
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18746
18798
|
});
|
|
18747
18799
|
var zNesUserActionsCapabilities = object({
|
|
18748
|
-
maxCount: int().gte(0).max(4294967295, {
|
|
18800
|
+
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
18749
18801
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
18750
|
-
}).nullish(),
|
|
18751
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18802
|
+
}).nullish(), () => void 0),
|
|
18803
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18752
18804
|
});
|
|
18753
18805
|
var zNesOpenFilesCapabilities = object({
|
|
18754
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18806
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18755
18807
|
});
|
|
18756
18808
|
var zNesDiagnosticsCapabilities = object({
|
|
18757
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18809
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18758
18810
|
});
|
|
18759
18811
|
var zNesContextCapabilities = object({
|
|
18760
18812
|
recentFiles: defaultOnError(zNesRecentFilesCapabilities.nullish(), () => void 0),
|
|
@@ -18763,12 +18815,12 @@ var zNesContextCapabilities = object({
|
|
|
18763
18815
|
userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => void 0),
|
|
18764
18816
|
openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => void 0),
|
|
18765
18817
|
diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => void 0),
|
|
18766
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18818
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18767
18819
|
});
|
|
18768
18820
|
var zNesCapabilities = object({
|
|
18769
18821
|
events: defaultOnError(zNesEventCapabilities.nullish(), () => void 0),
|
|
18770
18822
|
context: defaultOnError(zNesContextCapabilities.nullish(), () => void 0),
|
|
18771
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18823
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18772
18824
|
});
|
|
18773
18825
|
var zPositionEncodingKind = union([
|
|
18774
18826
|
literal("utf-16"),
|
|
@@ -18776,53 +18828,61 @@ var zPositionEncodingKind = union([
|
|
|
18776
18828
|
literal("utf-8")
|
|
18777
18829
|
]);
|
|
18778
18830
|
var zAgentCapabilities = object({
|
|
18779
|
-
loadSession: boolean2().optional().default(false),
|
|
18780
|
-
promptCapabilities: zPromptCapabilities.optional().default({
|
|
18831
|
+
loadSession: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18832
|
+
promptCapabilities: defaultOnError(zPromptCapabilities.optional().default({
|
|
18781
18833
|
image: false,
|
|
18782
18834
|
audio: false,
|
|
18783
18835
|
embeddedContext: false
|
|
18784
|
-
}),
|
|
18785
|
-
|
|
18836
|
+
}), () => ({
|
|
18837
|
+
image: false,
|
|
18838
|
+
audio: false,
|
|
18839
|
+
embeddedContext: false
|
|
18840
|
+
})),
|
|
18841
|
+
mcpCapabilities: defaultOnError(zMcpCapabilities.optional().default({
|
|
18786
18842
|
http: false,
|
|
18787
18843
|
sse: false,
|
|
18788
18844
|
acp: false
|
|
18789
|
-
}),
|
|
18790
|
-
|
|
18791
|
-
|
|
18845
|
+
}), () => ({
|
|
18846
|
+
http: false,
|
|
18847
|
+
sse: false,
|
|
18848
|
+
acp: false
|
|
18849
|
+
})),
|
|
18850
|
+
sessionCapabilities: defaultOnError(zSessionCapabilities.optional().default({}), () => ({})),
|
|
18851
|
+
auth: defaultOnError(zAgentAuthCapabilities.optional().default({}), () => ({})),
|
|
18792
18852
|
providers: defaultOnError(zProvidersCapabilities.nullish(), () => void 0),
|
|
18793
18853
|
nes: defaultOnError(zNesCapabilities.nullish(), () => void 0),
|
|
18794
18854
|
positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => void 0),
|
|
18795
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18855
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18796
18856
|
});
|
|
18797
18857
|
var zAuthMethodId = string2();
|
|
18798
18858
|
var zAuthEnvVar = object({
|
|
18799
18859
|
name: string2(),
|
|
18800
|
-
label: string2().nullish(),
|
|
18801
|
-
secret: boolean2().optional().default(true),
|
|
18802
|
-
optional: boolean2().optional().default(false),
|
|
18803
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18860
|
+
label: defaultOnError(string2().nullish(), () => void 0),
|
|
18861
|
+
secret: defaultOnError(boolean2().optional().default(true), () => true),
|
|
18862
|
+
optional: defaultOnError(boolean2().optional().default(false), () => false),
|
|
18863
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18804
18864
|
});
|
|
18805
18865
|
var zAuthMethodEnvVar = object({
|
|
18806
18866
|
id: zAuthMethodId,
|
|
18807
18867
|
name: string2(),
|
|
18808
|
-
description: string2().nullish(),
|
|
18809
|
-
vars:
|
|
18810
|
-
link: string2().nullish(),
|
|
18811
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18868
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18869
|
+
vars: requiredDefaultOnError(vecSkipError(zAuthEnvVar), () => []),
|
|
18870
|
+
link: defaultOnError(string2().nullish(), () => void 0),
|
|
18871
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18812
18872
|
});
|
|
18813
18873
|
var zAuthMethodTerminal = object({
|
|
18814
18874
|
id: zAuthMethodId,
|
|
18815
18875
|
name: string2(),
|
|
18816
|
-
description: string2().nullish(),
|
|
18817
|
-
args:
|
|
18818
|
-
env: record(string2(), string2()).optional(),
|
|
18819
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18876
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18877
|
+
args: defaultOnError(vecSkipError(string2()).optional(), () => []),
|
|
18878
|
+
env: defaultOnError(record(string2(), string2()).optional(), () => void 0),
|
|
18879
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18820
18880
|
});
|
|
18821
18881
|
var zAuthMethodAgent = object({
|
|
18822
18882
|
id: zAuthMethodId,
|
|
18823
18883
|
name: string2(),
|
|
18824
|
-
description: string2().nullish(),
|
|
18825
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18884
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18885
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18826
18886
|
});
|
|
18827
18887
|
var zAuthMethod = union([
|
|
18828
18888
|
zAuthMethodEnvVar.and(object({
|
|
@@ -18835,13 +18895,13 @@ var zAuthMethod = union([
|
|
|
18835
18895
|
]);
|
|
18836
18896
|
var zImplementation = object({
|
|
18837
18897
|
name: string2(),
|
|
18838
|
-
title: string2().nullish(),
|
|
18898
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18839
18899
|
version: string2(),
|
|
18840
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18900
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18841
18901
|
});
|
|
18842
18902
|
var zInitializeResponse = object({
|
|
18843
18903
|
protocolVersion: zProtocolVersion,
|
|
18844
|
-
agentCapabilities: zAgentCapabilities.optional().default({
|
|
18904
|
+
agentCapabilities: defaultOnError(zAgentCapabilities.optional().default({
|
|
18845
18905
|
loadSession: false,
|
|
18846
18906
|
promptCapabilities: {
|
|
18847
18907
|
image: false,
|
|
@@ -18855,14 +18915,29 @@ var zInitializeResponse = object({
|
|
|
18855
18915
|
},
|
|
18856
18916
|
sessionCapabilities: {},
|
|
18857
18917
|
auth: {}
|
|
18858
|
-
}),
|
|
18918
|
+
}), () => ({
|
|
18919
|
+
loadSession: false,
|
|
18920
|
+
promptCapabilities: {
|
|
18921
|
+
image: false,
|
|
18922
|
+
audio: false,
|
|
18923
|
+
embeddedContext: false
|
|
18924
|
+
},
|
|
18925
|
+
mcpCapabilities: {
|
|
18926
|
+
http: false,
|
|
18927
|
+
sse: false,
|
|
18928
|
+
acp: false
|
|
18929
|
+
},
|
|
18930
|
+
sessionCapabilities: {},
|
|
18931
|
+
auth: {}
|
|
18932
|
+
})),
|
|
18859
18933
|
authMethods: defaultOnError(vecSkipError(zAuthMethod).optional().default([]), () => []),
|
|
18860
18934
|
agentInfo: defaultOnError(zImplementation.nullish(), () => void 0),
|
|
18861
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18935
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18862
18936
|
});
|
|
18863
18937
|
var zAuthenticateResponse = object({
|
|
18864
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18938
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18865
18939
|
});
|
|
18940
|
+
var zProviderId = string2();
|
|
18866
18941
|
var zLlmProtocol = union([
|
|
18867
18942
|
literal("anthropic"),
|
|
18868
18943
|
literal("openai"),
|
|
@@ -18874,39 +18949,39 @@ var zLlmProtocol = union([
|
|
|
18874
18949
|
var zProviderCurrentConfig = object({
|
|
18875
18950
|
apiType: zLlmProtocol,
|
|
18876
18951
|
baseUrl: string2(),
|
|
18877
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18952
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18878
18953
|
});
|
|
18879
18954
|
var zProviderInfo = object({
|
|
18880
|
-
|
|
18955
|
+
providerId: zProviderId,
|
|
18881
18956
|
supported: requiredDefaultOnError(vecSkipError(zLlmProtocol), () => []),
|
|
18882
18957
|
required: boolean2(),
|
|
18883
18958
|
current: zProviderCurrentConfig.nullish(),
|
|
18884
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18959
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18885
18960
|
});
|
|
18886
18961
|
var zListProvidersResponse = object({
|
|
18887
|
-
providers:
|
|
18888
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18962
|
+
providers: array(zProviderInfo),
|
|
18963
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18889
18964
|
});
|
|
18890
18965
|
var zSetProviderResponse = object({
|
|
18891
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18966
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18892
18967
|
});
|
|
18893
18968
|
var zDisableProviderResponse = object({
|
|
18894
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18969
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18895
18970
|
});
|
|
18896
18971
|
var zLogoutResponse = object({
|
|
18897
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18972
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18898
18973
|
});
|
|
18899
18974
|
var zSessionModeId = string2();
|
|
18900
18975
|
var zSessionMode = object({
|
|
18901
18976
|
id: zSessionModeId,
|
|
18902
18977
|
name: string2(),
|
|
18903
|
-
description: string2().nullish(),
|
|
18904
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18978
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18979
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18905
18980
|
});
|
|
18906
18981
|
var zSessionModeState = object({
|
|
18907
18982
|
currentModeId: zSessionModeId,
|
|
18908
18983
|
availableModes: requiredDefaultOnError(vecSkipError(zSessionMode), () => []),
|
|
18909
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18984
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18910
18985
|
});
|
|
18911
18986
|
var zSessionConfigId = string2();
|
|
18912
18987
|
var zSessionConfigOptionCategory = union([
|
|
@@ -18920,15 +18995,15 @@ var zSessionConfigValueId = string2();
|
|
|
18920
18995
|
var zSessionConfigSelectOption = object({
|
|
18921
18996
|
value: zSessionConfigValueId,
|
|
18922
18997
|
name: string2(),
|
|
18923
|
-
description: string2().nullish(),
|
|
18924
|
-
_meta: record(string2(), unknown()).nullish()
|
|
18998
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18999
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18925
19000
|
});
|
|
18926
19001
|
var zSessionConfigGroupId = string2();
|
|
18927
19002
|
var zSessionConfigSelectGroup = object({
|
|
18928
19003
|
group: zSessionConfigGroupId,
|
|
18929
19004
|
name: string2(),
|
|
18930
|
-
options:
|
|
18931
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19005
|
+
options: requiredDefaultOnError(vecSkipError(zSessionConfigSelectOption), () => []),
|
|
19006
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18932
19007
|
});
|
|
18933
19008
|
var zSessionConfigSelectOptions = union([
|
|
18934
19009
|
array(zSessionConfigSelectOption),
|
|
@@ -18951,57 +19026,57 @@ var zSessionConfigOption = intersection(union([
|
|
|
18951
19026
|
]), object({
|
|
18952
19027
|
id: zSessionConfigId,
|
|
18953
19028
|
name: string2(),
|
|
18954
|
-
description: string2().nullish(),
|
|
19029
|
+
description: defaultOnError(string2().nullish(), () => void 0),
|
|
18955
19030
|
category: defaultOnError(zSessionConfigOptionCategory.nullish(), () => void 0),
|
|
18956
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19031
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18957
19032
|
}));
|
|
18958
19033
|
var zNewSessionResponse = object({
|
|
18959
19034
|
sessionId: zSessionId,
|
|
18960
19035
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
18961
19036
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
18962
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19037
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18963
19038
|
});
|
|
18964
19039
|
var zLoadSessionResponse = object({
|
|
18965
19040
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
18966
19041
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
18967
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19042
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18968
19043
|
});
|
|
18969
19044
|
var zSessionInfo = object({
|
|
18970
19045
|
sessionId: zSessionId,
|
|
18971
19046
|
cwd: string2(),
|
|
18972
|
-
additionalDirectories:
|
|
19047
|
+
additionalDirectories: defaultOnError(vecSkipError(string2()).optional(), () => []),
|
|
18973
19048
|
title: defaultOnError(string2().nullish(), () => void 0),
|
|
18974
19049
|
updatedAt: defaultOnError(string2().nullish(), () => void 0),
|
|
18975
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19050
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18976
19051
|
});
|
|
18977
19052
|
var zListSessionsResponse = object({
|
|
18978
19053
|
sessions: requiredDefaultOnError(vecSkipError(zSessionInfo), () => []),
|
|
18979
|
-
nextCursor: string2().nullish(),
|
|
18980
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19054
|
+
nextCursor: defaultOnError(string2().nullish(), () => void 0),
|
|
19055
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18981
19056
|
});
|
|
18982
19057
|
var zDeleteSessionResponse = object({
|
|
18983
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19058
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18984
19059
|
});
|
|
18985
19060
|
var zForkSessionResponse = object({
|
|
18986
19061
|
sessionId: zSessionId,
|
|
18987
19062
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
18988
19063
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
18989
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19064
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18990
19065
|
});
|
|
18991
19066
|
var zResumeSessionResponse = object({
|
|
18992
19067
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
18993
19068
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
18994
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19069
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18995
19070
|
});
|
|
18996
19071
|
var zCloseSessionResponse = object({
|
|
18997
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19072
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
18998
19073
|
});
|
|
18999
19074
|
var zSetSessionModeResponse = object({
|
|
19000
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19075
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19001
19076
|
});
|
|
19002
19077
|
var zSetSessionConfigOptionResponse = object({
|
|
19003
19078
|
configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
|
|
19004
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19079
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19005
19080
|
});
|
|
19006
19081
|
var zStopReason = union([
|
|
19007
19082
|
literal("end_turn"),
|
|
@@ -19014,20 +19089,21 @@ var zUsage = object({
|
|
|
19014
19089
|
totalTokens: number2(),
|
|
19015
19090
|
inputTokens: number2(),
|
|
19016
19091
|
outputTokens: number2(),
|
|
19017
|
-
thoughtTokens: number2().nullish(),
|
|
19018
|
-
cachedReadTokens: number2().nullish(),
|
|
19019
|
-
cachedWriteTokens: number2().nullish(),
|
|
19020
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19092
|
+
thoughtTokens: defaultOnError(number2().nullish(), () => void 0),
|
|
19093
|
+
cachedReadTokens: defaultOnError(number2().nullish(), () => void 0),
|
|
19094
|
+
cachedWriteTokens: defaultOnError(number2().nullish(), () => void 0),
|
|
19095
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19021
19096
|
});
|
|
19022
19097
|
var zPromptResponse = object({
|
|
19023
19098
|
stopReason: zStopReason,
|
|
19024
19099
|
usage: defaultOnError(zUsage.nullish(), () => void 0),
|
|
19025
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19100
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19026
19101
|
});
|
|
19027
19102
|
var zStartNesResponse = object({
|
|
19028
19103
|
sessionId: zSessionId,
|
|
19029
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19104
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19030
19105
|
});
|
|
19106
|
+
var zNesSuggestionId = string2();
|
|
19031
19107
|
var zPosition = object({
|
|
19032
19108
|
line: int().gte(0).max(4294967295, {
|
|
19033
19109
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
@@ -19035,45 +19111,45 @@ var zPosition = object({
|
|
|
19035
19111
|
character: int().gte(0).max(4294967295, {
|
|
19036
19112
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
19037
19113
|
}),
|
|
19038
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19114
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19039
19115
|
});
|
|
19040
19116
|
var zRange = object({
|
|
19041
19117
|
start: zPosition,
|
|
19042
19118
|
end: zPosition,
|
|
19043
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19119
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19044
19120
|
});
|
|
19045
19121
|
var zNesTextEdit = object({
|
|
19046
19122
|
range: zRange,
|
|
19047
19123
|
newText: string2(),
|
|
19048
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19124
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19049
19125
|
});
|
|
19050
19126
|
var zNesEditSuggestion = object({
|
|
19051
|
-
id:
|
|
19127
|
+
id: zNesSuggestionId,
|
|
19052
19128
|
uri: string2(),
|
|
19053
19129
|
edits: array(zNesTextEdit),
|
|
19054
19130
|
cursorPosition: defaultOnError(zPosition.nullish(), () => void 0),
|
|
19055
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19131
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19056
19132
|
});
|
|
19057
19133
|
var zNesJumpSuggestion = object({
|
|
19058
|
-
id:
|
|
19134
|
+
id: zNesSuggestionId,
|
|
19059
19135
|
uri: string2(),
|
|
19060
19136
|
position: zPosition,
|
|
19061
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19137
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19062
19138
|
});
|
|
19063
19139
|
var zNesRenameSuggestion = object({
|
|
19064
|
-
id:
|
|
19140
|
+
id: zNesSuggestionId,
|
|
19065
19141
|
uri: string2(),
|
|
19066
19142
|
position: zPosition,
|
|
19067
19143
|
newName: string2(),
|
|
19068
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19144
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19069
19145
|
});
|
|
19070
19146
|
var zNesSearchAndReplaceSuggestion = object({
|
|
19071
|
-
id:
|
|
19147
|
+
id: zNesSuggestionId,
|
|
19072
19148
|
uri: string2(),
|
|
19073
19149
|
search: string2(),
|
|
19074
19150
|
replace: string2(),
|
|
19075
19151
|
isRegex: boolean2().nullish(),
|
|
19076
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19152
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19077
19153
|
});
|
|
19078
19154
|
var zNesSuggestion = union([
|
|
19079
19155
|
zNesEditSuggestion.and(object({
|
|
@@ -19090,11 +19166,11 @@ var zNesSuggestion = union([
|
|
|
19090
19166
|
}))
|
|
19091
19167
|
]);
|
|
19092
19168
|
var zSuggestNesResponse = object({
|
|
19093
|
-
suggestions:
|
|
19094
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19169
|
+
suggestions: array(zNesSuggestion),
|
|
19170
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19095
19171
|
});
|
|
19096
19172
|
var zCloseNesResponse = object({
|
|
19097
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19173
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19098
19174
|
});
|
|
19099
19175
|
var zExtResponse = unknown();
|
|
19100
19176
|
var zMessageMcpResponse = unknown();
|
|
@@ -19107,7 +19183,6 @@ var zErrorCode = union([
|
|
|
19107
19183
|
literal(-32800),
|
|
19108
19184
|
literal(-32e3),
|
|
19109
19185
|
literal(-32002),
|
|
19110
|
-
literal(-32042),
|
|
19111
19186
|
int().min(-2147483648, {
|
|
19112
19187
|
error: "Invalid value: Expected int32 to be >= -2147483648"
|
|
19113
19188
|
}).max(2147483647, {
|
|
@@ -19117,7 +19192,7 @@ var zErrorCode = union([
|
|
|
19117
19192
|
var zError = object({
|
|
19118
19193
|
code: zErrorCode,
|
|
19119
19194
|
message: string2(),
|
|
19120
|
-
data: unknown().optional()
|
|
19195
|
+
data: defaultOnError(unknown().optional(), () => void 0)
|
|
19121
19196
|
});
|
|
19122
19197
|
var zAgentResponse = union([
|
|
19123
19198
|
object({
|
|
@@ -19154,19 +19229,19 @@ var zAgentResponse = union([
|
|
|
19154
19229
|
var zMessageId = string2();
|
|
19155
19230
|
var zContentChunk = object({
|
|
19156
19231
|
content: zContentBlock,
|
|
19157
|
-
messageId: zMessageId.nullish(),
|
|
19158
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19232
|
+
messageId: defaultOnError(zMessageId.nullish(), () => void 0),
|
|
19233
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19159
19234
|
});
|
|
19160
19235
|
var zToolCall = object({
|
|
19161
19236
|
toolCallId: zToolCallId,
|
|
19162
19237
|
title: string2(),
|
|
19163
|
-
kind: zToolKind.optional(),
|
|
19164
|
-
status: zToolCallStatus.optional(),
|
|
19238
|
+
kind: defaultOnError(zToolKind.optional(), () => void 0),
|
|
19239
|
+
status: defaultOnError(zToolCallStatus.optional(), () => void 0),
|
|
19165
19240
|
content: defaultOnError(vecSkipError(zToolCallContent).optional(), () => []),
|
|
19166
19241
|
locations: defaultOnError(vecSkipError(zToolCallLocation).optional(), () => []),
|
|
19167
|
-
rawInput: unknown().optional(),
|
|
19168
|
-
rawOutput: unknown().optional(),
|
|
19169
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19242
|
+
rawInput: defaultOnError(unknown().optional(), () => void 0),
|
|
19243
|
+
rawOutput: defaultOnError(unknown().optional(), () => void 0),
|
|
19244
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19170
19245
|
});
|
|
19171
19246
|
var zPlanEntryPriority = union([
|
|
19172
19247
|
literal("high"),
|
|
@@ -19182,27 +19257,27 @@ var zPlanEntry = object({
|
|
|
19182
19257
|
content: string2(),
|
|
19183
19258
|
priority: zPlanEntryPriority,
|
|
19184
19259
|
status: zPlanEntryStatus,
|
|
19185
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19260
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19186
19261
|
});
|
|
19187
19262
|
var zPlan = object({
|
|
19188
19263
|
entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),
|
|
19189
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19264
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19190
19265
|
});
|
|
19191
19266
|
var zPlanId = string2();
|
|
19192
19267
|
var zPlanItems = object({
|
|
19193
|
-
|
|
19268
|
+
planId: zPlanId,
|
|
19194
19269
|
entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),
|
|
19195
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19270
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19196
19271
|
});
|
|
19197
19272
|
var zPlanFile = object({
|
|
19198
|
-
|
|
19273
|
+
planId: zPlanId,
|
|
19199
19274
|
uri: string2(),
|
|
19200
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19275
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19201
19276
|
});
|
|
19202
19277
|
var zPlanMarkdown = object({
|
|
19203
|
-
|
|
19278
|
+
planId: zPlanId,
|
|
19204
19279
|
content: string2(),
|
|
19205
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19280
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19206
19281
|
});
|
|
19207
19282
|
var zPlanUpdateContent = union([
|
|
19208
19283
|
zPlanItems.and(object({
|
|
@@ -19217,50 +19292,50 @@ var zPlanUpdateContent = union([
|
|
|
19217
19292
|
]);
|
|
19218
19293
|
var zPlanUpdate = object({
|
|
19219
19294
|
plan: zPlanUpdateContent,
|
|
19220
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19295
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19221
19296
|
});
|
|
19222
19297
|
var zPlanRemoved = object({
|
|
19223
|
-
|
|
19224
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19298
|
+
planId: zPlanId,
|
|
19299
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19225
19300
|
});
|
|
19226
19301
|
var zUnstructuredCommandInput = object({
|
|
19227
19302
|
hint: string2(),
|
|
19228
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19303
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19229
19304
|
});
|
|
19230
19305
|
var zAvailableCommandInput = zUnstructuredCommandInput;
|
|
19231
19306
|
var zAvailableCommand = object({
|
|
19232
19307
|
name: string2(),
|
|
19233
19308
|
description: string2(),
|
|
19234
19309
|
input: defaultOnError(zAvailableCommandInput.nullish(), () => void 0),
|
|
19235
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19310
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19236
19311
|
});
|
|
19237
19312
|
var zAvailableCommandsUpdate = object({
|
|
19238
19313
|
availableCommands: requiredDefaultOnError(vecSkipError(zAvailableCommand), () => []),
|
|
19239
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19314
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19240
19315
|
});
|
|
19241
19316
|
var zCurrentModeUpdate = object({
|
|
19242
19317
|
currentModeId: zSessionModeId,
|
|
19243
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19318
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19244
19319
|
});
|
|
19245
19320
|
var zConfigOptionUpdate = object({
|
|
19246
19321
|
configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
|
|
19247
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19322
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19248
19323
|
});
|
|
19249
19324
|
var zSessionInfoUpdate = object({
|
|
19250
|
-
title: string2().nullish(),
|
|
19251
|
-
updatedAt: string2().nullish(),
|
|
19252
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19325
|
+
title: defaultOnError(string2().nullish(), () => void 0),
|
|
19326
|
+
updatedAt: defaultOnError(string2().nullish(), () => void 0),
|
|
19327
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19253
19328
|
});
|
|
19254
19329
|
var zCost = object({
|
|
19255
19330
|
amount: number2(),
|
|
19256
19331
|
currency: string2(),
|
|
19257
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19332
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19258
19333
|
});
|
|
19259
19334
|
var zUsageUpdate = object({
|
|
19260
19335
|
used: number2(),
|
|
19261
19336
|
size: number2(),
|
|
19262
19337
|
cost: defaultOnError(zCost.nullish(), () => void 0),
|
|
19263
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19338
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19264
19339
|
});
|
|
19265
19340
|
var zSessionUpdate = union([
|
|
19266
19341
|
zContentChunk.and(object({
|
|
@@ -19306,17 +19381,17 @@ var zSessionUpdate = union([
|
|
|
19306
19381
|
var zSessionNotification = object({
|
|
19307
19382
|
sessionId: zSessionId,
|
|
19308
19383
|
update: zSessionUpdate,
|
|
19309
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19384
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19310
19385
|
});
|
|
19311
19386
|
var zCompleteElicitationNotification = object({
|
|
19312
19387
|
elicitationId: zElicitationId,
|
|
19313
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19388
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19314
19389
|
});
|
|
19315
19390
|
var zMessageMcpNotification = object({
|
|
19316
19391
|
connectionId: zMcpConnectionId,
|
|
19317
19392
|
method: string2(),
|
|
19318
|
-
params: record(string2(), unknown()).nullish(),
|
|
19319
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19393
|
+
params: defaultOnError(record(string2(), unknown()).nullish(), () => void 0),
|
|
19394
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19320
19395
|
});
|
|
19321
19396
|
var zExtNotification = unknown();
|
|
19322
19397
|
var zAgentNotification = object({
|
|
@@ -19329,124 +19404,128 @@ var zAgentNotification = object({
|
|
|
19329
19404
|
]).nullish()
|
|
19330
19405
|
});
|
|
19331
19406
|
var zFileSystemCapabilities = object({
|
|
19332
|
-
readTextFile: boolean2().optional().default(false),
|
|
19333
|
-
writeTextFile: boolean2().optional().default(false),
|
|
19334
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19407
|
+
readTextFile: defaultOnError(boolean2().optional().default(false), () => false),
|
|
19408
|
+
writeTextFile: defaultOnError(boolean2().optional().default(false), () => false),
|
|
19409
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19335
19410
|
});
|
|
19336
19411
|
var zBooleanConfigOptionCapabilities = object({
|
|
19337
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19412
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19338
19413
|
});
|
|
19339
19414
|
var zSessionConfigOptionsCapabilities = object({
|
|
19340
19415
|
boolean: defaultOnError(zBooleanConfigOptionCapabilities.nullish(), () => void 0),
|
|
19341
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19416
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19342
19417
|
});
|
|
19343
19418
|
var zClientSessionCapabilities = object({
|
|
19344
19419
|
configOptions: defaultOnError(zSessionConfigOptionsCapabilities.nullish(), () => void 0),
|
|
19345
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19420
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19346
19421
|
});
|
|
19347
19422
|
var zPlanCapabilities = object({
|
|
19348
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19423
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19349
19424
|
});
|
|
19350
19425
|
var zAuthCapabilities = object({
|
|
19351
|
-
terminal: boolean2().optional().default(false),
|
|
19352
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19426
|
+
terminal: defaultOnError(boolean2().optional().default(false), () => false),
|
|
19427
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19353
19428
|
});
|
|
19354
19429
|
var zElicitationFormCapabilities = object({
|
|
19355
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19430
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19356
19431
|
});
|
|
19357
19432
|
var zElicitationUrlCapabilities = object({
|
|
19358
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19433
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19359
19434
|
});
|
|
19360
19435
|
var zElicitationCapabilities = object({
|
|
19361
19436
|
form: defaultOnError(zElicitationFormCapabilities.nullish(), () => void 0),
|
|
19362
19437
|
url: defaultOnError(zElicitationUrlCapabilities.nullish(), () => void 0),
|
|
19363
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19438
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19364
19439
|
});
|
|
19365
19440
|
var zNesJumpCapabilities = object({
|
|
19366
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19441
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19367
19442
|
});
|
|
19368
19443
|
var zNesRenameCapabilities = object({
|
|
19369
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19444
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19370
19445
|
});
|
|
19371
19446
|
var zNesSearchAndReplaceCapabilities = object({
|
|
19372
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19447
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19373
19448
|
});
|
|
19374
19449
|
var zClientNesCapabilities = object({
|
|
19375
19450
|
jump: defaultOnError(zNesJumpCapabilities.nullish(), () => void 0),
|
|
19376
19451
|
rename: defaultOnError(zNesRenameCapabilities.nullish(), () => void 0),
|
|
19377
19452
|
searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => void 0),
|
|
19378
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19453
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19379
19454
|
});
|
|
19380
19455
|
var zClientCapabilities = object({
|
|
19381
|
-
fs: zFileSystemCapabilities.optional().default({ readTextFile: false, writeTextFile: false }),
|
|
19382
|
-
terminal: boolean2().optional().default(false),
|
|
19456
|
+
fs: defaultOnError(zFileSystemCapabilities.optional().default({ readTextFile: false, writeTextFile: false }), () => ({ readTextFile: false, writeTextFile: false })),
|
|
19457
|
+
terminal: defaultOnError(boolean2().optional().default(false), () => false),
|
|
19383
19458
|
session: defaultOnError(zClientSessionCapabilities.nullish(), () => void 0),
|
|
19384
19459
|
plan: defaultOnError(zPlanCapabilities.nullish(), () => void 0),
|
|
19385
|
-
auth: zAuthCapabilities.optional().default({ terminal: false }),
|
|
19460
|
+
auth: defaultOnError(zAuthCapabilities.optional().default({ terminal: false }), () => ({ terminal: false })),
|
|
19386
19461
|
elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => void 0),
|
|
19387
19462
|
nes: defaultOnError(zClientNesCapabilities.nullish(), () => void 0),
|
|
19388
19463
|
positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),
|
|
19389
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19464
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19390
19465
|
});
|
|
19391
19466
|
var zInitializeRequest = object({
|
|
19392
19467
|
protocolVersion: zProtocolVersion,
|
|
19393
|
-
clientCapabilities: zClientCapabilities.optional().default({
|
|
19468
|
+
clientCapabilities: defaultOnError(zClientCapabilities.optional().default({
|
|
19394
19469
|
fs: { readTextFile: false, writeTextFile: false },
|
|
19395
19470
|
terminal: false,
|
|
19396
19471
|
auth: { terminal: false }
|
|
19397
|
-
}),
|
|
19472
|
+
}), () => ({
|
|
19473
|
+
fs: { readTextFile: false, writeTextFile: false },
|
|
19474
|
+
terminal: false,
|
|
19475
|
+
auth: { terminal: false }
|
|
19476
|
+
})),
|
|
19398
19477
|
clientInfo: defaultOnError(zImplementation.nullish(), () => void 0),
|
|
19399
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19478
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19400
19479
|
});
|
|
19401
19480
|
var zAuthenticateRequest = object({
|
|
19402
19481
|
methodId: zAuthMethodId,
|
|
19403
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19482
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19404
19483
|
});
|
|
19405
19484
|
var zListProvidersRequest = object({
|
|
19406
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19485
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19407
19486
|
});
|
|
19408
19487
|
var zSetProviderRequest = object({
|
|
19409
|
-
|
|
19488
|
+
providerId: zProviderId,
|
|
19410
19489
|
apiType: zLlmProtocol,
|
|
19411
19490
|
baseUrl: string2(),
|
|
19412
19491
|
headers: record(string2(), string2()).optional(),
|
|
19413
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19492
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19414
19493
|
});
|
|
19415
19494
|
var zDisableProviderRequest = object({
|
|
19416
|
-
|
|
19417
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19495
|
+
providerId: zProviderId,
|
|
19496
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19418
19497
|
});
|
|
19419
19498
|
var zLogoutRequest = object({
|
|
19420
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19499
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19421
19500
|
});
|
|
19422
19501
|
var zHttpHeader = object({
|
|
19423
19502
|
name: string2(),
|
|
19424
19503
|
value: string2(),
|
|
19425
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19504
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19426
19505
|
});
|
|
19427
19506
|
var zMcpServerHttp = object({
|
|
19428
19507
|
name: string2(),
|
|
19429
19508
|
url: string2(),
|
|
19430
19509
|
headers: array(zHttpHeader),
|
|
19431
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19510
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19432
19511
|
});
|
|
19433
19512
|
var zMcpServerSse = object({
|
|
19434
19513
|
name: string2(),
|
|
19435
19514
|
url: string2(),
|
|
19436
19515
|
headers: array(zHttpHeader),
|
|
19437
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19516
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19438
19517
|
});
|
|
19439
19518
|
var zMcpServerAcp = object({
|
|
19440
19519
|
name: string2(),
|
|
19441
|
-
|
|
19442
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19520
|
+
serverId: zMcpServerAcpId,
|
|
19521
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19443
19522
|
});
|
|
19444
19523
|
var zMcpServerStdio = object({
|
|
19445
19524
|
name: string2(),
|
|
19446
19525
|
command: string2(),
|
|
19447
19526
|
args: array(string2()),
|
|
19448
19527
|
env: array(zEnvVariable),
|
|
19449
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19528
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19450
19529
|
});
|
|
19451
19530
|
var zMcpServer = union([
|
|
19452
19531
|
zMcpServerHttp.and(object({
|
|
@@ -19462,48 +19541,48 @@ var zMcpServer = union([
|
|
|
19462
19541
|
]);
|
|
19463
19542
|
var zNewSessionRequest = object({
|
|
19464
19543
|
cwd: string2(),
|
|
19465
|
-
additionalDirectories:
|
|
19466
|
-
mcpServers:
|
|
19467
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19544
|
+
additionalDirectories: defaultOnError(vecSkipError(string2()).optional(), () => []),
|
|
19545
|
+
mcpServers: requiredDefaultOnError(vecSkipError(zMcpServer), () => []),
|
|
19546
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19468
19547
|
});
|
|
19469
19548
|
var zLoadSessionRequest = object({
|
|
19470
|
-
mcpServers:
|
|
19549
|
+
mcpServers: requiredDefaultOnError(vecSkipError(zMcpServer), () => []),
|
|
19471
19550
|
cwd: string2(),
|
|
19472
|
-
additionalDirectories:
|
|
19551
|
+
additionalDirectories: defaultOnError(vecSkipError(string2()).optional(), () => []),
|
|
19473
19552
|
sessionId: zSessionId,
|
|
19474
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19553
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19475
19554
|
});
|
|
19476
19555
|
var zListSessionsRequest = object({
|
|
19477
19556
|
cwd: string2().nullish(),
|
|
19478
19557
|
cursor: string2().nullish(),
|
|
19479
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19558
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19480
19559
|
});
|
|
19481
19560
|
var zDeleteSessionRequest = object({
|
|
19482
19561
|
sessionId: zSessionId,
|
|
19483
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19562
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19484
19563
|
});
|
|
19485
19564
|
var zForkSessionRequest = object({
|
|
19486
19565
|
sessionId: zSessionId,
|
|
19487
19566
|
cwd: string2(),
|
|
19488
|
-
additionalDirectories:
|
|
19489
|
-
mcpServers:
|
|
19490
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19567
|
+
additionalDirectories: defaultOnError(vecSkipError(string2()).optional(), () => []),
|
|
19568
|
+
mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
|
|
19569
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19491
19570
|
});
|
|
19492
19571
|
var zResumeSessionRequest = object({
|
|
19493
19572
|
sessionId: zSessionId,
|
|
19494
19573
|
cwd: string2(),
|
|
19495
|
-
additionalDirectories:
|
|
19496
|
-
mcpServers:
|
|
19497
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19574
|
+
additionalDirectories: defaultOnError(vecSkipError(string2()).optional(), () => []),
|
|
19575
|
+
mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
|
|
19576
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19498
19577
|
});
|
|
19499
19578
|
var zCloseSessionRequest = object({
|
|
19500
19579
|
sessionId: zSessionId,
|
|
19501
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19580
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19502
19581
|
});
|
|
19503
19582
|
var zSetSessionModeRequest = object({
|
|
19504
19583
|
sessionId: zSessionId,
|
|
19505
19584
|
modeId: zSessionModeId,
|
|
19506
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19585
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19507
19586
|
});
|
|
19508
19587
|
var zSetSessionConfigOptionRequest = intersection(union([
|
|
19509
19588
|
object({
|
|
@@ -19516,29 +19595,29 @@ var zSetSessionConfigOptionRequest = intersection(union([
|
|
|
19516
19595
|
]), object({
|
|
19517
19596
|
sessionId: zSessionId,
|
|
19518
19597
|
configId: zSessionConfigId,
|
|
19519
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19598
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19520
19599
|
}));
|
|
19521
19600
|
var zPromptRequest = object({
|
|
19522
19601
|
sessionId: zSessionId,
|
|
19523
19602
|
prompt: array(zContentBlock),
|
|
19524
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19603
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19525
19604
|
});
|
|
19526
19605
|
var zWorkspaceFolder = object({
|
|
19527
19606
|
uri: string2(),
|
|
19528
19607
|
name: string2(),
|
|
19529
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19608
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19530
19609
|
});
|
|
19531
19610
|
var zNesRepository = object({
|
|
19532
19611
|
name: string2(),
|
|
19533
19612
|
owner: string2(),
|
|
19534
19613
|
remoteUrl: string2(),
|
|
19535
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19614
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19536
19615
|
});
|
|
19537
19616
|
var zStartNesRequest = object({
|
|
19538
|
-
workspaceUri: string2().nullish(),
|
|
19539
|
-
workspaceFolders:
|
|
19617
|
+
workspaceUri: defaultOnError(string2().nullish(), () => void 0),
|
|
19618
|
+
workspaceFolders: array(zWorkspaceFolder).nullish(),
|
|
19540
19619
|
repository: defaultOnError(zNesRepository.nullish(), () => void 0),
|
|
19541
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19620
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19542
19621
|
});
|
|
19543
19622
|
var zNesTriggerKind = union([
|
|
19544
19623
|
literal("automatic"),
|
|
@@ -19549,7 +19628,7 @@ var zNesRecentFile = object({
|
|
|
19549
19628
|
uri: string2(),
|
|
19550
19629
|
languageId: string2(),
|
|
19551
19630
|
text: string2(),
|
|
19552
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19631
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19553
19632
|
});
|
|
19554
19633
|
var zNesExcerpt = object({
|
|
19555
19634
|
startLine: int().gte(0).max(4294967295, {
|
|
@@ -19559,31 +19638,31 @@ var zNesExcerpt = object({
|
|
|
19559
19638
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
19560
19639
|
}),
|
|
19561
19640
|
text: string2(),
|
|
19562
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19641
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19563
19642
|
});
|
|
19564
19643
|
var zNesRelatedSnippet = object({
|
|
19565
19644
|
uri: string2(),
|
|
19566
19645
|
excerpts: array(zNesExcerpt),
|
|
19567
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19646
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19568
19647
|
});
|
|
19569
19648
|
var zNesEditHistoryEntry = object({
|
|
19570
19649
|
uri: string2(),
|
|
19571
19650
|
diff: string2(),
|
|
19572
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19651
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19573
19652
|
});
|
|
19574
19653
|
var zNesUserAction = object({
|
|
19575
19654
|
action: string2(),
|
|
19576
19655
|
uri: string2(),
|
|
19577
19656
|
position: zPosition,
|
|
19578
19657
|
timestampMs: number2(),
|
|
19579
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19658
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19580
19659
|
});
|
|
19581
19660
|
var zNesOpenFile = object({
|
|
19582
19661
|
uri: string2(),
|
|
19583
19662
|
languageId: string2(),
|
|
19584
19663
|
visibleRange: defaultOnError(zRange.nullish(), () => void 0),
|
|
19585
19664
|
lastFocusedMs: defaultOnError(number2().nullish(), () => void 0),
|
|
19586
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19665
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19587
19666
|
});
|
|
19588
19667
|
var zNesDiagnosticSeverity = union([
|
|
19589
19668
|
literal("error"),
|
|
@@ -19596,30 +19675,30 @@ var zNesDiagnostic = object({
|
|
|
19596
19675
|
range: zRange,
|
|
19597
19676
|
severity: zNesDiagnosticSeverity,
|
|
19598
19677
|
message: string2(),
|
|
19599
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19678
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19600
19679
|
});
|
|
19601
19680
|
var zNesSuggestContext = object({
|
|
19602
|
-
recentFiles:
|
|
19603
|
-
relatedSnippets:
|
|
19604
|
-
editHistory:
|
|
19605
|
-
userActions:
|
|
19606
|
-
openFiles:
|
|
19607
|
-
diagnostics:
|
|
19608
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19681
|
+
recentFiles: array(zNesRecentFile).nullish(),
|
|
19682
|
+
relatedSnippets: array(zNesRelatedSnippet).nullish(),
|
|
19683
|
+
editHistory: array(zNesEditHistoryEntry).nullish(),
|
|
19684
|
+
userActions: array(zNesUserAction).nullish(),
|
|
19685
|
+
openFiles: array(zNesOpenFile).nullish(),
|
|
19686
|
+
diagnostics: array(zNesDiagnostic).nullish(),
|
|
19687
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19609
19688
|
});
|
|
19610
19689
|
var zSuggestNesRequest = object({
|
|
19611
19690
|
sessionId: zSessionId,
|
|
19612
19691
|
uri: string2(),
|
|
19613
19692
|
version: number2(),
|
|
19614
19693
|
position: zPosition,
|
|
19615
|
-
selection:
|
|
19694
|
+
selection: zRange.nullish(),
|
|
19616
19695
|
triggerKind: zNesTriggerKind,
|
|
19617
|
-
context:
|
|
19618
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19696
|
+
context: zNesSuggestContext.nullish(),
|
|
19697
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19619
19698
|
});
|
|
19620
19699
|
var zCloseNesRequest = object({
|
|
19621
19700
|
sessionId: zSessionId,
|
|
19622
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19701
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19623
19702
|
});
|
|
19624
19703
|
var zClientRequest = object({
|
|
19625
19704
|
id: zRequestId,
|
|
@@ -19649,15 +19728,15 @@ var zClientRequest = object({
|
|
|
19649
19728
|
]).nullish()
|
|
19650
19729
|
});
|
|
19651
19730
|
var zWriteTextFileResponse = object({
|
|
19652
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19731
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19653
19732
|
});
|
|
19654
19733
|
var zReadTextFileResponse = object({
|
|
19655
19734
|
content: string2(),
|
|
19656
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19735
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19657
19736
|
});
|
|
19658
19737
|
var zSelectedPermissionOutcome = object({
|
|
19659
19738
|
optionId: zPermissionOptionId,
|
|
19660
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19739
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19661
19740
|
});
|
|
19662
19741
|
var zRequestPermissionOutcome = union([
|
|
19663
19742
|
object({
|
|
@@ -19669,37 +19748,37 @@ var zRequestPermissionOutcome = union([
|
|
|
19669
19748
|
]);
|
|
19670
19749
|
var zRequestPermissionResponse = object({
|
|
19671
19750
|
outcome: zRequestPermissionOutcome,
|
|
19672
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19751
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19673
19752
|
});
|
|
19674
19753
|
var zCreateTerminalResponse = object({
|
|
19675
19754
|
terminalId: zTerminalId,
|
|
19676
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19755
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19677
19756
|
});
|
|
19678
19757
|
var zTerminalExitStatus = object({
|
|
19679
|
-
exitCode: int().gte(0).max(4294967295, {
|
|
19758
|
+
exitCode: defaultOnError(int().gte(0).max(4294967295, {
|
|
19680
19759
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
19681
|
-
}).nullish(),
|
|
19682
|
-
signal: string2().nullish(),
|
|
19683
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19760
|
+
}).nullish(), () => void 0),
|
|
19761
|
+
signal: defaultOnError(string2().nullish(), () => void 0),
|
|
19762
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19684
19763
|
});
|
|
19685
19764
|
var zTerminalOutputResponse = object({
|
|
19686
19765
|
output: string2(),
|
|
19687
19766
|
truncated: boolean2(),
|
|
19688
|
-
exitStatus: zTerminalExitStatus.nullish(),
|
|
19689
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19767
|
+
exitStatus: defaultOnError(zTerminalExitStatus.nullish(), () => void 0),
|
|
19768
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19690
19769
|
});
|
|
19691
19770
|
var zReleaseTerminalResponse = object({
|
|
19692
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19771
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19693
19772
|
});
|
|
19694
19773
|
var zWaitForTerminalExitResponse = object({
|
|
19695
|
-
exitCode: int().gte(0).max(4294967295, {
|
|
19774
|
+
exitCode: defaultOnError(int().gte(0).max(4294967295, {
|
|
19696
19775
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
19697
|
-
}).nullish(),
|
|
19698
|
-
signal: string2().nullish(),
|
|
19699
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19776
|
+
}).nullish(), () => void 0),
|
|
19777
|
+
signal: defaultOnError(string2().nullish(), () => void 0),
|
|
19778
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19700
19779
|
});
|
|
19701
19780
|
var zKillTerminalResponse = object({
|
|
19702
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19781
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19703
19782
|
});
|
|
19704
19783
|
var zElicitationContentValue = union([
|
|
19705
19784
|
string2(),
|
|
@@ -19711,7 +19790,7 @@ var zElicitationContentValue = union([
|
|
|
19711
19790
|
var zElicitationAcceptAction = object({
|
|
19712
19791
|
content: record(string2(), zElicitationContentValue).nullish()
|
|
19713
19792
|
});
|
|
19714
|
-
var zCreateElicitationResponse = intersection(union([
|
|
19793
|
+
var zCreateElicitationResponse = preserveCustomPayload(intersection(union([
|
|
19715
19794
|
zElicitationAcceptAction.and(object({
|
|
19716
19795
|
action: literal("accept")
|
|
19717
19796
|
})),
|
|
@@ -19720,16 +19799,19 @@ var zCreateElicitationResponse = intersection(union([
|
|
|
19720
19799
|
}),
|
|
19721
19800
|
object({
|
|
19722
19801
|
action: literal("cancel")
|
|
19723
|
-
})
|
|
19802
|
+
}),
|
|
19803
|
+
excludeKnownTags(object({
|
|
19804
|
+
action: string2()
|
|
19805
|
+
}), "action", ["accept", "cancel", "decline"])
|
|
19724
19806
|
]), object({
|
|
19725
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19726
|
-
}));
|
|
19807
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19808
|
+
})), "action", ["accept", "cancel", "decline"]);
|
|
19727
19809
|
var zConnectMcpResponse = object({
|
|
19728
19810
|
connectionId: zMcpConnectionId,
|
|
19729
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19811
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19730
19812
|
});
|
|
19731
19813
|
var zDisconnectMcpResponse = object({
|
|
19732
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19814
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19733
19815
|
});
|
|
19734
19816
|
var zClientResponse = union([
|
|
19735
19817
|
object({
|
|
@@ -19746,8 +19828,8 @@ var zClientResponse = union([
|
|
|
19746
19828
|
zCreateElicitationResponse,
|
|
19747
19829
|
zConnectMcpResponse,
|
|
19748
19830
|
zDisconnectMcpResponse,
|
|
19749
|
-
|
|
19750
|
-
|
|
19831
|
+
zMessageMcpResponse,
|
|
19832
|
+
zExtResponse
|
|
19751
19833
|
])
|
|
19752
19834
|
}),
|
|
19753
19835
|
object({
|
|
@@ -19757,7 +19839,7 @@ var zClientResponse = union([
|
|
|
19757
19839
|
]);
|
|
19758
19840
|
var zCancelNotification = object({
|
|
19759
19841
|
sessionId: zSessionId,
|
|
19760
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19842
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19761
19843
|
});
|
|
19762
19844
|
var zDidOpenDocumentNotification = object({
|
|
19763
19845
|
sessionId: zSessionId,
|
|
@@ -19765,29 +19847,29 @@ var zDidOpenDocumentNotification = object({
|
|
|
19765
19847
|
languageId: string2(),
|
|
19766
19848
|
version: number2(),
|
|
19767
19849
|
text: string2(),
|
|
19768
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19850
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19769
19851
|
});
|
|
19770
19852
|
var zTextDocumentContentChangeEvent = object({
|
|
19771
19853
|
range: zRange.nullish(),
|
|
19772
19854
|
text: string2(),
|
|
19773
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19855
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19774
19856
|
});
|
|
19775
19857
|
var zDidChangeDocumentNotification = object({
|
|
19776
19858
|
sessionId: zSessionId,
|
|
19777
19859
|
uri: string2(),
|
|
19778
19860
|
version: number2(),
|
|
19779
|
-
contentChanges:
|
|
19780
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19861
|
+
contentChanges: requiredDefaultOnError(vecSkipError(zTextDocumentContentChangeEvent), () => []),
|
|
19862
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19781
19863
|
});
|
|
19782
19864
|
var zDidCloseDocumentNotification = object({
|
|
19783
19865
|
sessionId: zSessionId,
|
|
19784
19866
|
uri: string2(),
|
|
19785
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19867
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19786
19868
|
});
|
|
19787
19869
|
var zDidSaveDocumentNotification = object({
|
|
19788
19870
|
sessionId: zSessionId,
|
|
19789
19871
|
uri: string2(),
|
|
19790
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19872
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19791
19873
|
});
|
|
19792
19874
|
var zDidFocusDocumentNotification = object({
|
|
19793
19875
|
sessionId: zSessionId,
|
|
@@ -19795,12 +19877,12 @@ var zDidFocusDocumentNotification = object({
|
|
|
19795
19877
|
version: number2(),
|
|
19796
19878
|
position: zPosition,
|
|
19797
19879
|
visibleRange: zRange,
|
|
19798
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19880
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19799
19881
|
});
|
|
19800
19882
|
var zAcceptNesNotification = object({
|
|
19801
19883
|
sessionId: zSessionId,
|
|
19802
|
-
id:
|
|
19803
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19884
|
+
id: zNesSuggestionId,
|
|
19885
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19804
19886
|
});
|
|
19805
19887
|
var zNesRejectReason = union([
|
|
19806
19888
|
literal("rejected"),
|
|
@@ -19810,9 +19892,9 @@ var zNesRejectReason = union([
|
|
|
19810
19892
|
]);
|
|
19811
19893
|
var zRejectNesNotification = object({
|
|
19812
19894
|
sessionId: zSessionId,
|
|
19813
|
-
id:
|
|
19895
|
+
id: zNesSuggestionId,
|
|
19814
19896
|
reason: defaultOnError(zNesRejectReason.nullish(), () => void 0),
|
|
19815
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19897
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19816
19898
|
});
|
|
19817
19899
|
var zClientNotification = object({
|
|
19818
19900
|
method: string2(),
|
|
@@ -19831,98 +19913,54 @@ var zClientNotification = object({
|
|
|
19831
19913
|
});
|
|
19832
19914
|
var zCancelRequestNotification = object({
|
|
19833
19915
|
requestId: zRequestId,
|
|
19834
|
-
_meta: record(string2(), unknown()).nullish()
|
|
19916
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => void 0)
|
|
19835
19917
|
});
|
|
19836
19918
|
|
|
19837
|
-
// node_modules/@agentclientprotocol/sdk/dist/
|
|
19838
|
-
function
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
|
|
19863
|
-
|
|
19864
|
-
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
19881
|
-
|
|
19882
|
-
const trimmedLine = content.trim();
|
|
19883
|
-
if (trimmedLine) {
|
|
19884
|
-
try {
|
|
19885
|
-
const message = JSON.parse(trimmedLine);
|
|
19886
|
-
controller.enqueue(message);
|
|
19887
|
-
} catch (err) {
|
|
19888
|
-
console.error("Failed to parse JSON message:", trimmedLine, err);
|
|
19889
|
-
}
|
|
19890
|
-
}
|
|
19891
|
-
} catch (err) {
|
|
19892
|
-
if (cancelled) {
|
|
19893
|
-
return;
|
|
19894
|
-
}
|
|
19895
|
-
controller.error(err);
|
|
19896
|
-
return;
|
|
19897
|
-
} finally {
|
|
19898
|
-
if (inputReader === reader) {
|
|
19899
|
-
inputReader = void 0;
|
|
19900
|
-
}
|
|
19901
|
-
reader.releaseLock();
|
|
19902
|
-
}
|
|
19903
|
-
if (cancelled) {
|
|
19904
|
-
return;
|
|
19905
|
-
}
|
|
19906
|
-
controller.close();
|
|
19907
|
-
},
|
|
19908
|
-
cancel(reason) {
|
|
19909
|
-
cancelled = true;
|
|
19910
|
-
return inputReader?.cancel(reason);
|
|
19911
|
-
}
|
|
19912
|
-
});
|
|
19913
|
-
const writable = new WritableStream({
|
|
19914
|
-
async write(message) {
|
|
19915
|
-
const content = JSON.stringify(message) + "\n";
|
|
19916
|
-
const writer = output.getWriter();
|
|
19917
|
-
try {
|
|
19918
|
-
await writer.write(textEncoder.encode(content));
|
|
19919
|
-
} finally {
|
|
19920
|
-
writer.releaseLock();
|
|
19921
|
-
}
|
|
19922
|
-
}
|
|
19923
|
-
});
|
|
19924
|
-
return { readable, writable };
|
|
19925
|
-
}
|
|
19919
|
+
// node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js
|
|
19920
|
+
function tagOf(value, key) {
|
|
19921
|
+
return typeof value === "object" && value !== null ? value[key] : void 0;
|
|
19922
|
+
}
|
|
19923
|
+
var zGuardCreateElicitationRequestForm = zElicitationFormMode.and(object({ mode: literal("form") })).and(object({ message: string2() }));
|
|
19924
|
+
var zGuardCreateElicitationRequestUrl = zElicitationUrlMode.and(object({ mode: literal("url") })).and(object({ message: string2() }));
|
|
19925
|
+
var zGuardCreateElicitationRequestCustom = union([zElicitationSessionScope, zElicitationRequestScope]).and(object({ message: string2() }));
|
|
19926
|
+
var zGuardElicitationPropertySchemaString = zStringPropertySchema.and(object({ type: literal("string") }));
|
|
19927
|
+
var zGuardElicitationPropertySchemaNumber = zNumberPropertySchema.and(object({ type: literal("number") }));
|
|
19928
|
+
var zGuardElicitationPropertySchemaInteger = zIntegerPropertySchema.and(object({ type: literal("integer") }));
|
|
19929
|
+
var zGuardElicitationPropertySchemaBoolean = zBooleanPropertySchema.and(object({ type: literal("boolean") }));
|
|
19930
|
+
var zGuardElicitationPropertySchemaArray = zMultiSelectPropertySchema.and(object({ type: literal("array") }));
|
|
19931
|
+
var zGuardMultiSelectItemsString = zStringMultiSelectItems.and(object({ type: literal("string") }));
|
|
19932
|
+
var zGuardCreateElicitationResponseAccept = zElicitationAcceptAction.and(object({ action: literal("accept") }));
|
|
19933
|
+
var zGuardCreateElicitationResponseDecline = object({
|
|
19934
|
+
action: literal("decline")
|
|
19935
|
+
});
|
|
19936
|
+
var zGuardCreateElicitationResponseCancel = object({
|
|
19937
|
+
action: literal("cancel")
|
|
19938
|
+
});
|
|
19939
|
+
var CreateElicitationResponse = {
|
|
19940
|
+
/** Narrow to the `accept` variant, validating its payload. */
|
|
19941
|
+
isAccept(value) {
|
|
19942
|
+
return tagOf(value, "action") === "accept" && zGuardCreateElicitationResponseAccept.safeParse(value).success;
|
|
19943
|
+
},
|
|
19944
|
+
/** Narrow to the `decline` variant, validating its payload. */
|
|
19945
|
+
isDecline(value) {
|
|
19946
|
+
return tagOf(value, "action") === "decline" && zGuardCreateElicitationResponseDecline.safeParse(value).success;
|
|
19947
|
+
},
|
|
19948
|
+
/** Narrow to the `cancel` variant, validating its payload. */
|
|
19949
|
+
isCancel(value) {
|
|
19950
|
+
return tagOf(value, "action") === "cancel" && zGuardCreateElicitationResponseCancel.safeParse(value).success;
|
|
19951
|
+
},
|
|
19952
|
+
/**
|
|
19953
|
+
* Narrow to a custom or future variant: the `action` tag matches no known variant.
|
|
19954
|
+
*
|
|
19955
|
+
* TypeScript keeps the known variants in the narrowed union (they are
|
|
19956
|
+
* structural subtypes of the catch-all), so read vendor payload keys
|
|
19957
|
+
* via a widening cast: `(value as Record<string, unknown>).someKey`.
|
|
19958
|
+
*/
|
|
19959
|
+
isCustom(value) {
|
|
19960
|
+
const tag = tagOf(value, "action");
|
|
19961
|
+
return typeof tag === "string" && !["accept", "cancel", "decline"].includes(tag);
|
|
19962
|
+
}
|
|
19963
|
+
};
|
|
19926
19964
|
|
|
19927
19965
|
// node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js
|
|
19928
19966
|
var CANCEL_REQUEST_METHOD = "$/cancel_request";
|
|
@@ -20365,6 +20403,10 @@ var Connection = class {
|
|
|
20365
20403
|
if (this.abortController.signal.aborted) {
|
|
20366
20404
|
return;
|
|
20367
20405
|
}
|
|
20406
|
+
if (!isRecord(message)) {
|
|
20407
|
+
console.error("Invalid message", { message });
|
|
20408
|
+
return;
|
|
20409
|
+
}
|
|
20368
20410
|
if ("method" in message) {
|
|
20369
20411
|
if (!("id" in message)) {
|
|
20370
20412
|
this.handleProtocolNotification(message);
|
|
@@ -20454,7 +20496,7 @@ var Connection = class {
|
|
|
20454
20496
|
pendingResponse.cleanup?.();
|
|
20455
20497
|
if ("result" in response) {
|
|
20456
20498
|
pendingResponse.resolve(response.result);
|
|
20457
|
-
} else if ("error" in response) {
|
|
20499
|
+
} else if ("error" in response && isRecord(response.error)) {
|
|
20458
20500
|
const { code, message, data } = response.error;
|
|
20459
20501
|
pendingResponse.reject(new RequestError(code, message, data));
|
|
20460
20502
|
} else {
|
|
@@ -20660,6 +20702,147 @@ var RequestError = class _RequestError extends Error {
|
|
|
20660
20702
|
}
|
|
20661
20703
|
};
|
|
20662
20704
|
|
|
20705
|
+
// node_modules/@agentclientprotocol/sdk/dist/line-buffer.js
|
|
20706
|
+
var newline = 10;
|
|
20707
|
+
var LineBuffer = class {
|
|
20708
|
+
/** Bytes of the current (incomplete) line, carried across chunks. */
|
|
20709
|
+
#pending = [];
|
|
20710
|
+
/**
|
|
20711
|
+
* Consumes a chunk, returning each complete line without its trailing
|
|
20712
|
+
* newline.
|
|
20713
|
+
*/
|
|
20714
|
+
push(chunk) {
|
|
20715
|
+
const lines = [];
|
|
20716
|
+
let start = 0;
|
|
20717
|
+
let newlineIndex = chunk.indexOf(newline, start);
|
|
20718
|
+
while (newlineIndex !== -1) {
|
|
20719
|
+
lines.push(this.#takeLine(chunk.subarray(start, newlineIndex)));
|
|
20720
|
+
start = newlineIndex + 1;
|
|
20721
|
+
newlineIndex = chunk.indexOf(newline, start);
|
|
20722
|
+
}
|
|
20723
|
+
if (start < chunk.byteLength) {
|
|
20724
|
+
this.#pending.push(start === 0 ? chunk : new Uint8Array(chunk.subarray(start)));
|
|
20725
|
+
}
|
|
20726
|
+
return lines;
|
|
20727
|
+
}
|
|
20728
|
+
/**
|
|
20729
|
+
* Returns the trailing unterminated line and resets the buffer, or
|
|
20730
|
+
* undefined if no bytes are buffered.
|
|
20731
|
+
*/
|
|
20732
|
+
flush() {
|
|
20733
|
+
if (this.#pending.length === 0) {
|
|
20734
|
+
return void 0;
|
|
20735
|
+
}
|
|
20736
|
+
return this.#takeLine(new Uint8Array(0));
|
|
20737
|
+
}
|
|
20738
|
+
#takeLine(tail) {
|
|
20739
|
+
if (this.#pending.length === 0) {
|
|
20740
|
+
return tail;
|
|
20741
|
+
}
|
|
20742
|
+
let total = tail.byteLength;
|
|
20743
|
+
for (const part of this.#pending) {
|
|
20744
|
+
total += part.byteLength;
|
|
20745
|
+
}
|
|
20746
|
+
const line = new Uint8Array(total);
|
|
20747
|
+
let offset = 0;
|
|
20748
|
+
for (const part of this.#pending) {
|
|
20749
|
+
line.set(part, offset);
|
|
20750
|
+
offset += part.byteLength;
|
|
20751
|
+
}
|
|
20752
|
+
line.set(tail, offset);
|
|
20753
|
+
this.#pending = [];
|
|
20754
|
+
return line;
|
|
20755
|
+
}
|
|
20756
|
+
};
|
|
20757
|
+
|
|
20758
|
+
// node_modules/@agentclientprotocol/sdk/dist/stream.js
|
|
20759
|
+
function ndJsonStream(output, input) {
|
|
20760
|
+
const textEncoder = new TextEncoder();
|
|
20761
|
+
const textDecoder = new TextDecoder();
|
|
20762
|
+
let cancelled = false;
|
|
20763
|
+
let inputReader;
|
|
20764
|
+
const readable = new ReadableStream({
|
|
20765
|
+
async start(controller) {
|
|
20766
|
+
const lines = new LineBuffer();
|
|
20767
|
+
const enqueueLine = (lineBytes) => {
|
|
20768
|
+
const trimmedLine = textDecoder.decode(lineBytes).trim();
|
|
20769
|
+
if (trimmedLine) {
|
|
20770
|
+
try {
|
|
20771
|
+
const message = JSON.parse(trimmedLine);
|
|
20772
|
+
if (isRecord(message)) {
|
|
20773
|
+
controller.enqueue(message);
|
|
20774
|
+
} else {
|
|
20775
|
+
console.warn("Skipping JSON line that is not an object:", trimmedLine);
|
|
20776
|
+
}
|
|
20777
|
+
} catch (err) {
|
|
20778
|
+
console.error("Failed to parse JSON message:", trimmedLine, err);
|
|
20779
|
+
}
|
|
20780
|
+
}
|
|
20781
|
+
};
|
|
20782
|
+
const reader = input.getReader();
|
|
20783
|
+
inputReader = reader;
|
|
20784
|
+
try {
|
|
20785
|
+
while (true) {
|
|
20786
|
+
const { value, done } = await reader.read();
|
|
20787
|
+
if (cancelled) {
|
|
20788
|
+
return;
|
|
20789
|
+
}
|
|
20790
|
+
if (done) {
|
|
20791
|
+
break;
|
|
20792
|
+
}
|
|
20793
|
+
if (!value) {
|
|
20794
|
+
continue;
|
|
20795
|
+
}
|
|
20796
|
+
for (const line of lines.push(value)) {
|
|
20797
|
+
enqueueLine(line);
|
|
20798
|
+
if (cancelled) {
|
|
20799
|
+
return;
|
|
20800
|
+
}
|
|
20801
|
+
}
|
|
20802
|
+
}
|
|
20803
|
+
if (cancelled) {
|
|
20804
|
+
return;
|
|
20805
|
+
}
|
|
20806
|
+
const lastLine = lines.flush();
|
|
20807
|
+
if (lastLine) {
|
|
20808
|
+
enqueueLine(lastLine);
|
|
20809
|
+
}
|
|
20810
|
+
} catch (err) {
|
|
20811
|
+
if (cancelled) {
|
|
20812
|
+
return;
|
|
20813
|
+
}
|
|
20814
|
+
controller.error(err);
|
|
20815
|
+
return;
|
|
20816
|
+
} finally {
|
|
20817
|
+
if (inputReader === reader) {
|
|
20818
|
+
inputReader = void 0;
|
|
20819
|
+
}
|
|
20820
|
+
reader.releaseLock();
|
|
20821
|
+
}
|
|
20822
|
+
if (cancelled) {
|
|
20823
|
+
return;
|
|
20824
|
+
}
|
|
20825
|
+
controller.close();
|
|
20826
|
+
},
|
|
20827
|
+
cancel(reason) {
|
|
20828
|
+
cancelled = true;
|
|
20829
|
+
return inputReader?.cancel(reason);
|
|
20830
|
+
}
|
|
20831
|
+
});
|
|
20832
|
+
const writable = new WritableStream({
|
|
20833
|
+
async write(message) {
|
|
20834
|
+
const content = JSON.stringify(message) + "\n";
|
|
20835
|
+
const writer = output.getWriter();
|
|
20836
|
+
try {
|
|
20837
|
+
await writer.write(textEncoder.encode(content));
|
|
20838
|
+
} finally {
|
|
20839
|
+
writer.releaseLock();
|
|
20840
|
+
}
|
|
20841
|
+
}
|
|
20842
|
+
});
|
|
20843
|
+
return { readable, writable };
|
|
20844
|
+
}
|
|
20845
|
+
|
|
20663
20846
|
// node_modules/@agentclientprotocol/sdk/dist/acp.js
|
|
20664
20847
|
function emptyObjectResponse(response) {
|
|
20665
20848
|
return response ?? {};
|
|
@@ -23032,50 +23215,62 @@ function recoverCorruptedDiff(diff) {
|
|
|
23032
23215
|
}
|
|
23033
23216
|
|
|
23034
23217
|
// src/ContentChunks.ts
|
|
23035
|
-
function
|
|
23218
|
+
function createCodexMessagePhaseMeta(phase) {
|
|
23219
|
+
if (!phase) {
|
|
23220
|
+
return void 0;
|
|
23221
|
+
}
|
|
23222
|
+
return { codex: { phase } };
|
|
23223
|
+
}
|
|
23224
|
+
function createUserMessageChunk(content, messageId, meta3) {
|
|
23036
23225
|
if (messageId) {
|
|
23037
23226
|
return {
|
|
23038
23227
|
sessionUpdate: "user_message_chunk",
|
|
23039
23228
|
messageId,
|
|
23040
|
-
content
|
|
23229
|
+
content,
|
|
23230
|
+
...meta3 ? { _meta: meta3 } : {}
|
|
23041
23231
|
};
|
|
23042
23232
|
}
|
|
23043
23233
|
return {
|
|
23044
23234
|
sessionUpdate: "user_message_chunk",
|
|
23045
|
-
content
|
|
23235
|
+
content,
|
|
23236
|
+
...meta3 ? { _meta: meta3 } : {}
|
|
23046
23237
|
};
|
|
23047
23238
|
}
|
|
23048
|
-
function createAgentMessageChunk(content, messageId) {
|
|
23239
|
+
function createAgentMessageChunk(content, messageId, meta3) {
|
|
23049
23240
|
if (messageId) {
|
|
23050
23241
|
return {
|
|
23051
23242
|
sessionUpdate: "agent_message_chunk",
|
|
23052
23243
|
messageId,
|
|
23053
|
-
content
|
|
23244
|
+
content,
|
|
23245
|
+
...meta3 ? { _meta: meta3 } : {}
|
|
23054
23246
|
};
|
|
23055
23247
|
}
|
|
23056
23248
|
return {
|
|
23057
23249
|
sessionUpdate: "agent_message_chunk",
|
|
23058
|
-
content
|
|
23250
|
+
content,
|
|
23251
|
+
...meta3 ? { _meta: meta3 } : {}
|
|
23059
23252
|
};
|
|
23060
23253
|
}
|
|
23061
|
-
function createAgentThoughtChunk(content, messageId) {
|
|
23254
|
+
function createAgentThoughtChunk(content, messageId, meta3) {
|
|
23062
23255
|
if (messageId) {
|
|
23063
23256
|
return {
|
|
23064
23257
|
sessionUpdate: "agent_thought_chunk",
|
|
23065
23258
|
messageId,
|
|
23066
|
-
content
|
|
23259
|
+
content,
|
|
23260
|
+
...meta3 ? { _meta: meta3 } : {}
|
|
23067
23261
|
};
|
|
23068
23262
|
}
|
|
23069
23263
|
return {
|
|
23070
23264
|
sessionUpdate: "agent_thought_chunk",
|
|
23071
|
-
content
|
|
23265
|
+
content,
|
|
23266
|
+
...meta3 ? { _meta: meta3 } : {}
|
|
23072
23267
|
};
|
|
23073
23268
|
}
|
|
23074
|
-
function createAgentTextMessageChunk(text, messageId) {
|
|
23075
|
-
return createAgentMessageChunk({ type: "text", text }, messageId);
|
|
23269
|
+
function createAgentTextMessageChunk(text, messageId, meta3) {
|
|
23270
|
+
return createAgentMessageChunk({ type: "text", text }, messageId, meta3);
|
|
23076
23271
|
}
|
|
23077
|
-
function createAgentTextThoughtChunk(text, messageId) {
|
|
23078
|
-
return createAgentThoughtChunk({ type: "text", text }, messageId);
|
|
23272
|
+
function createAgentTextThoughtChunk(text, messageId, meta3) {
|
|
23273
|
+
return createAgentThoughtChunk({ type: "text", text }, messageId, meta3);
|
|
23079
23274
|
}
|
|
23080
23275
|
|
|
23081
23276
|
// src/CodexEventHandler.ts
|
|
@@ -23090,6 +23285,7 @@ var CodexEventHandler = class {
|
|
|
23090
23285
|
seenReasoningDeltaItemIds = /* @__PURE__ */ new Set();
|
|
23091
23286
|
terminalCommandIds = /* @__PURE__ */ new Set();
|
|
23092
23287
|
terminalCommandOutputIds = /* @__PURE__ */ new Set();
|
|
23288
|
+
agentMessagePhases = /* @__PURE__ */ new Map();
|
|
23093
23289
|
constructor(connection, sessionState) {
|
|
23094
23290
|
this.connection = connection;
|
|
23095
23291
|
this.sessionState = sessionState;
|
|
@@ -23233,7 +23429,8 @@ var CodexEventHandler = class {
|
|
|
23233
23429
|
};
|
|
23234
23430
|
}
|
|
23235
23431
|
async createTextEvent(event) {
|
|
23236
|
-
|
|
23432
|
+
const phase = this.agentMessagePhases.get(event.itemId) ?? null;
|
|
23433
|
+
return createAgentTextMessageChunk(event.delta, event.itemId, createCodexMessagePhaseMeta(phase));
|
|
23237
23434
|
}
|
|
23238
23435
|
async createConfigWarningEvent(event) {
|
|
23239
23436
|
const detailsText = event.details ? `
|
|
@@ -23320,11 +23517,13 @@ ${event.details}` : "";
|
|
|
23320
23517
|
return createImageGenerationStartUpdate(event.item);
|
|
23321
23518
|
case "collabAgentToolCall":
|
|
23322
23519
|
return createCollabAgentToolCallUpdate(event.item);
|
|
23520
|
+
case "agentMessage":
|
|
23521
|
+
this.rememberAgentMessagePhase(event.item);
|
|
23522
|
+
return null;
|
|
23323
23523
|
case "subAgentActivity":
|
|
23324
23524
|
case "sleep":
|
|
23325
23525
|
case "userMessage":
|
|
23326
23526
|
case "hookPrompt":
|
|
23327
|
-
case "agentMessage":
|
|
23328
23527
|
case "reasoning":
|
|
23329
23528
|
case "enteredReviewMode":
|
|
23330
23529
|
case "exitedReviewMode":
|
|
@@ -23371,6 +23570,9 @@ ${event.details}` : "";
|
|
|
23371
23570
|
return createWebSearchCompleteUpdate(event.item);
|
|
23372
23571
|
case "collabAgentToolCall":
|
|
23373
23572
|
return createCollabAgentToolCallCompleteUpdate(event.item);
|
|
23573
|
+
case "agentMessage":
|
|
23574
|
+
this.rememberAgentMessagePhase(event.item);
|
|
23575
|
+
return null;
|
|
23374
23576
|
case "exitedReviewMode":
|
|
23375
23577
|
return this.createExitedReviewModeEvent(event.item);
|
|
23376
23578
|
case "contextCompaction":
|
|
@@ -23380,12 +23582,14 @@ ${event.details}` : "";
|
|
|
23380
23582
|
case "sleep":
|
|
23381
23583
|
case "userMessage":
|
|
23382
23584
|
case "hookPrompt":
|
|
23383
|
-
case "agentMessage":
|
|
23384
23585
|
case "enteredReviewMode":
|
|
23385
23586
|
case "plan":
|
|
23386
23587
|
return null;
|
|
23387
23588
|
}
|
|
23388
23589
|
}
|
|
23590
|
+
rememberAgentMessagePhase(item) {
|
|
23591
|
+
this.agentMessagePhases.set(item.id, item.phase);
|
|
23592
|
+
}
|
|
23389
23593
|
createCompletedReasoningEvent(item) {
|
|
23390
23594
|
const parts = item.summary.length > 0 ? item.summary : item.content;
|
|
23391
23595
|
const text = parts.filter((part) => part.length > 0).join("\n\n");
|
|
@@ -23941,6 +24145,14 @@ var McpApprovalOptionId = {
|
|
|
23941
24145
|
Decline: "decline"
|
|
23942
24146
|
};
|
|
23943
24147
|
|
|
24148
|
+
// src/ElicitationCapabilities.ts
|
|
24149
|
+
function clientSupportsFormElicitation(clientCapabilities) {
|
|
24150
|
+
return clientCapabilities?.elicitation?.form != null;
|
|
24151
|
+
}
|
|
24152
|
+
function clientSupportsUrlElicitation(clientCapabilities) {
|
|
24153
|
+
return clientCapabilities?.elicitation?.url != null;
|
|
24154
|
+
}
|
|
24155
|
+
|
|
23944
24156
|
// src/CodexElicitationHandler.ts
|
|
23945
24157
|
var ELICITATION_OPTIONS = [
|
|
23946
24158
|
{ optionId: "accept", name: "Accept", kind: "allow_once" },
|
|
@@ -23963,6 +24175,124 @@ function parsePersistOptions(meta3) {
|
|
|
23963
24175
|
function isMcpToolCallApproval(meta3) {
|
|
23964
24176
|
return meta3 !== null && typeof meta3 === "object" && meta3["codex_approval_kind"] === "mcp_tool_call";
|
|
23965
24177
|
}
|
|
24178
|
+
function isRecord2(value) {
|
|
24179
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
24180
|
+
}
|
|
24181
|
+
function normalizeJsonValue(value) {
|
|
24182
|
+
if (value === null || value === void 0) {
|
|
24183
|
+
return null;
|
|
24184
|
+
}
|
|
24185
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
24186
|
+
return value;
|
|
24187
|
+
}
|
|
24188
|
+
if (typeof value === "bigint") {
|
|
24189
|
+
return Number(value);
|
|
24190
|
+
}
|
|
24191
|
+
if (Array.isArray(value)) {
|
|
24192
|
+
return value.map(normalizeJsonValue);
|
|
24193
|
+
}
|
|
24194
|
+
if (typeof value === "object") {
|
|
24195
|
+
return Object.fromEntries(
|
|
24196
|
+
Object.entries(value).filter(([, nested]) => nested !== void 0).map(([key, nested]) => [key, normalizeJsonValue(nested)])
|
|
24197
|
+
);
|
|
24198
|
+
}
|
|
24199
|
+
return String(value);
|
|
24200
|
+
}
|
|
24201
|
+
function normalizeJsonObject(value) {
|
|
24202
|
+
return Object.fromEntries(
|
|
24203
|
+
Object.entries(value).filter(([, nested]) => nested !== void 0).map(([key, nested]) => [key, normalizeJsonValue(nested)])
|
|
24204
|
+
);
|
|
24205
|
+
}
|
|
24206
|
+
function normalizeElicitationSchema(value) {
|
|
24207
|
+
const normalized = normalizeElicitationSchemaValue(value);
|
|
24208
|
+
if (!isRecord2(normalized)) {
|
|
24209
|
+
return { type: "object", properties: {} };
|
|
24210
|
+
}
|
|
24211
|
+
return {
|
|
24212
|
+
...normalized,
|
|
24213
|
+
type: "object"
|
|
24214
|
+
};
|
|
24215
|
+
}
|
|
24216
|
+
function normalizeElicitationSchemaValue(value) {
|
|
24217
|
+
if (typeof value === "bigint") {
|
|
24218
|
+
return Number(value);
|
|
24219
|
+
}
|
|
24220
|
+
if (Array.isArray(value)) {
|
|
24221
|
+
return value.map(normalizeElicitationSchemaValue);
|
|
24222
|
+
}
|
|
24223
|
+
if (!isRecord2(value)) {
|
|
24224
|
+
return value;
|
|
24225
|
+
}
|
|
24226
|
+
const result = Object.fromEntries(
|
|
24227
|
+
Object.entries(value).filter(([, nested]) => nested !== void 0).map(([key, nested]) => [key, normalizeElicitationSchemaValue(nested)])
|
|
24228
|
+
);
|
|
24229
|
+
if (result["type"] === "string" && Array.isArray(result["enum"]) && Array.isArray(result["enumNames"]) && !Array.isArray(result["oneOf"])) {
|
|
24230
|
+
const values = result["enum"];
|
|
24231
|
+
const names = result["enumNames"];
|
|
24232
|
+
result["oneOf"] = values.map((value2, index) => ({
|
|
24233
|
+
const: String(value2),
|
|
24234
|
+
title: String(names[index] ?? value2)
|
|
24235
|
+
}));
|
|
24236
|
+
delete result["enum"];
|
|
24237
|
+
delete result["enumNames"];
|
|
24238
|
+
}
|
|
24239
|
+
return result;
|
|
24240
|
+
}
|
|
24241
|
+
function metaRecord(meta3) {
|
|
24242
|
+
return isRecord2(meta3) ? meta3 : null;
|
|
24243
|
+
}
|
|
24244
|
+
function persistChoiceOption(value) {
|
|
24245
|
+
switch (value) {
|
|
24246
|
+
case "once":
|
|
24247
|
+
return { const: "once", title: "Allow once" };
|
|
24248
|
+
case "session":
|
|
24249
|
+
return { const: "session", title: "Allow for this session" };
|
|
24250
|
+
case "always":
|
|
24251
|
+
return { const: "always", title: "Allow and don't ask again" };
|
|
24252
|
+
}
|
|
24253
|
+
}
|
|
24254
|
+
function addPersistChoiceToSchema(schema, persistOptions) {
|
|
24255
|
+
if (persistOptions.size === 0) {
|
|
24256
|
+
return schema;
|
|
24257
|
+
}
|
|
24258
|
+
const choices = ["once"];
|
|
24259
|
+
if (persistOptions.has("session")) choices.push("session");
|
|
24260
|
+
if (persistOptions.has("always")) choices.push("always");
|
|
24261
|
+
return {
|
|
24262
|
+
...schema,
|
|
24263
|
+
properties: {
|
|
24264
|
+
...schema.properties,
|
|
24265
|
+
persist: {
|
|
24266
|
+
type: "string",
|
|
24267
|
+
title: "Approval scope",
|
|
24268
|
+
oneOf: choices.map(persistChoiceOption),
|
|
24269
|
+
default: "once"
|
|
24270
|
+
}
|
|
24271
|
+
},
|
|
24272
|
+
required: Array.from(/* @__PURE__ */ new Set([...schema.required ?? [], "persist"]))
|
|
24273
|
+
};
|
|
24274
|
+
}
|
|
24275
|
+
function contentRecord(content) {
|
|
24276
|
+
return isRecord2(content) ? content : {};
|
|
24277
|
+
}
|
|
24278
|
+
function jsonObjectOrNull(content) {
|
|
24279
|
+
const entries = Object.entries(content);
|
|
24280
|
+
if (entries.length === 0) {
|
|
24281
|
+
return null;
|
|
24282
|
+
}
|
|
24283
|
+
return Object.fromEntries(entries.map(([key, value]) => [key, normalizeJsonValue(value)]));
|
|
24284
|
+
}
|
|
24285
|
+
function elicitationResponseMeta(response, context, persist = void 0) {
|
|
24286
|
+
const responseMeta = metaRecord(response._meta);
|
|
24287
|
+
const meta3 = responseMeta ? normalizeJsonObject(responseMeta) : {};
|
|
24288
|
+
if (context.isToolApproval) {
|
|
24289
|
+
delete meta3["persist"];
|
|
24290
|
+
}
|
|
24291
|
+
if (persist === "session" || persist === "always") {
|
|
24292
|
+
meta3["persist"] = persist;
|
|
24293
|
+
}
|
|
24294
|
+
return Object.keys(meta3).length === 0 ? null : meta3;
|
|
24295
|
+
}
|
|
23966
24296
|
function buildToolApprovalOptions(persistOptions) {
|
|
23967
24297
|
const options = [
|
|
23968
24298
|
{ optionId: McpApprovalOptionId.AllowOnce, name: "Allow", kind: "allow_once" }
|
|
@@ -23979,6 +24309,7 @@ function buildToolApprovalOptions(persistOptions) {
|
|
|
23979
24309
|
var CodexElicitationHandler = class {
|
|
23980
24310
|
connection;
|
|
23981
24311
|
sessionState;
|
|
24312
|
+
clientCapabilities;
|
|
23982
24313
|
cancellationSignal;
|
|
23983
24314
|
// In Rust, the MCP elicitation handler receives ElicitationRequestEvent directly from the MCP
|
|
23984
24315
|
// protocol layer, where id is set to "mcp_tool_call_approval_<call_id>" — the call ID is extracted
|
|
@@ -23996,12 +24327,16 @@ var CodexElicitationHandler = class {
|
|
|
23996
24327
|
// call's elicitation before starting the next, so there is at most one pending approval per
|
|
23997
24328
|
// (threadId, serverName).
|
|
23998
24329
|
pendingMcpApprovals = /* @__PURE__ */ new Map();
|
|
23999
|
-
|
|
24330
|
+
// The app-server handler exposes URL elicitationId, while serverRequest/resolved only exposes
|
|
24331
|
+
// threadId here, so accepted URL elicitations are completed at thread scope.
|
|
24332
|
+
pendingUrlElicitations = /* @__PURE__ */ new Map();
|
|
24333
|
+
constructor(connection, sessionState, clientCapabilities = null, cancellationSignal) {
|
|
24000
24334
|
this.connection = connection;
|
|
24001
24335
|
this.sessionState = sessionState;
|
|
24336
|
+
this.clientCapabilities = clientCapabilities;
|
|
24002
24337
|
this.cancellationSignal = cancellationSignal;
|
|
24003
24338
|
}
|
|
24004
|
-
handleNotification(notification) {
|
|
24339
|
+
async handleNotification(notification) {
|
|
24005
24340
|
switch (notification.method) {
|
|
24006
24341
|
case "item/started":
|
|
24007
24342
|
this.handleItemStarted(notification.params);
|
|
@@ -24011,6 +24346,7 @@ var CodexElicitationHandler = class {
|
|
|
24011
24346
|
return;
|
|
24012
24347
|
case "serverRequest/resolved":
|
|
24013
24348
|
this.clearThread(notification.params.threadId);
|
|
24349
|
+
await this.completeUrlElicitations(notification.params.threadId);
|
|
24014
24350
|
return;
|
|
24015
24351
|
default:
|
|
24016
24352
|
return;
|
|
@@ -24018,7 +24354,21 @@ var CodexElicitationHandler = class {
|
|
|
24018
24354
|
}
|
|
24019
24355
|
async handleElicitation(params) {
|
|
24020
24356
|
try {
|
|
24021
|
-
const
|
|
24357
|
+
const context = this.createMcpElicitationContext(params);
|
|
24358
|
+
if (this.shouldUseAcpElicitation(params)) {
|
|
24359
|
+
const response2 = await this.connection.request(
|
|
24360
|
+
methods.client.elicitation.create,
|
|
24361
|
+
this.buildElicitationRequest(params, context),
|
|
24362
|
+
this.requestOptions()
|
|
24363
|
+
);
|
|
24364
|
+
const result = this.convertElicitationResponse(response2, context);
|
|
24365
|
+
if (params.mode === "url" && result.action === "accept") {
|
|
24366
|
+
this.trackUrlElicitation(params.threadId, params.elicitationId);
|
|
24367
|
+
}
|
|
24368
|
+
await this.publishAcceptedMcpToolApproval(context, result.action === "accept");
|
|
24369
|
+
return result;
|
|
24370
|
+
}
|
|
24371
|
+
const { request, correlatedCallId } = this.buildPermissionRequest(params, context);
|
|
24022
24372
|
const response = await this.connection.request(
|
|
24023
24373
|
methods.client.session.requestPermission,
|
|
24024
24374
|
request,
|
|
@@ -24033,7 +24383,7 @@ var CodexElicitationHandler = class {
|
|
|
24033
24383
|
});
|
|
24034
24384
|
}
|
|
24035
24385
|
}
|
|
24036
|
-
return this.
|
|
24386
|
+
return this.convertPermissionResponse(response);
|
|
24037
24387
|
} catch (error51) {
|
|
24038
24388
|
logger.error("Error handling MCP elicitation request", error51);
|
|
24039
24389
|
return { action: "cancel", content: null, _meta: null };
|
|
@@ -24042,23 +24392,64 @@ var CodexElicitationHandler = class {
|
|
|
24042
24392
|
requestOptions() {
|
|
24043
24393
|
return this.cancellationSignal ? { cancellationSignal: this.cancellationSignal } : void 0;
|
|
24044
24394
|
}
|
|
24045
|
-
|
|
24395
|
+
createMcpElicitationContext(params) {
|
|
24396
|
+
const isToolApproval = isMcpToolCallApproval(params._meta);
|
|
24397
|
+
const persistOptions = parsePersistOptions(params._meta);
|
|
24398
|
+
const correlatedCallId = isToolApproval && (params.mode === "form" || params.mode === "openai/form") ? this.popPendingApproval(params.threadId, params.serverName) : void 0;
|
|
24399
|
+
return { isToolApproval, persistOptions, correlatedCallId };
|
|
24400
|
+
}
|
|
24401
|
+
shouldUseAcpElicitation(params) {
|
|
24402
|
+
switch (params.mode) {
|
|
24403
|
+
case "form":
|
|
24404
|
+
return clientSupportsFormElicitation(this.clientCapabilities);
|
|
24405
|
+
case "url":
|
|
24406
|
+
return clientSupportsUrlElicitation(this.clientCapabilities);
|
|
24407
|
+
case "openai/form":
|
|
24408
|
+
return false;
|
|
24409
|
+
}
|
|
24410
|
+
}
|
|
24411
|
+
buildElicitationRequest(params, context) {
|
|
24412
|
+
const base = {
|
|
24413
|
+
sessionId: this.sessionState.sessionId,
|
|
24414
|
+
...context.correlatedCallId ? { toolCallId: context.correlatedCallId } : {},
|
|
24415
|
+
message: params.message,
|
|
24416
|
+
_meta: metaRecord(params._meta)
|
|
24417
|
+
};
|
|
24418
|
+
switch (params.mode) {
|
|
24419
|
+
case "form": {
|
|
24420
|
+
const requestedSchema = context.isToolApproval ? addPersistChoiceToSchema(
|
|
24421
|
+
normalizeElicitationSchema(params.requestedSchema),
|
|
24422
|
+
context.persistOptions
|
|
24423
|
+
) : normalizeElicitationSchema(params.requestedSchema);
|
|
24424
|
+
return {
|
|
24425
|
+
...base,
|
|
24426
|
+
mode: "form",
|
|
24427
|
+
requestedSchema
|
|
24428
|
+
};
|
|
24429
|
+
}
|
|
24430
|
+
case "url":
|
|
24431
|
+
return {
|
|
24432
|
+
...base,
|
|
24433
|
+
mode: "url",
|
|
24434
|
+
url: params.url,
|
|
24435
|
+
elicitationId: params.elicitationId
|
|
24436
|
+
};
|
|
24437
|
+
}
|
|
24438
|
+
}
|
|
24439
|
+
buildPermissionRequest(params, context) {
|
|
24046
24440
|
const sessionId = this.sessionState.sessionId;
|
|
24047
24441
|
const messageContent = {
|
|
24048
24442
|
type: "content",
|
|
24049
24443
|
content: { type: "text", text: params.message }
|
|
24050
24444
|
};
|
|
24051
|
-
const
|
|
24052
|
-
const isToolApproval = isMcpToolCallApproval(meta3);
|
|
24053
|
-
const options = isToolApproval ? buildToolApprovalOptions(parsePersistOptions(meta3)) : ELICITATION_OPTIONS;
|
|
24445
|
+
const options = context.isToolApproval ? buildToolApprovalOptions(context.persistOptions) : ELICITATION_OPTIONS;
|
|
24054
24446
|
if (params.mode === "form" || params.mode === "openai/form") {
|
|
24055
|
-
|
|
24056
|
-
if (correlatedCallId !== void 0) {
|
|
24447
|
+
if (context.correlatedCallId !== void 0) {
|
|
24057
24448
|
return {
|
|
24058
24449
|
request: {
|
|
24059
24450
|
sessionId,
|
|
24060
24451
|
toolCall: {
|
|
24061
|
-
toolCallId: correlatedCallId,
|
|
24452
|
+
toolCallId: context.correlatedCallId,
|
|
24062
24453
|
kind: "execute",
|
|
24063
24454
|
status: "pending"
|
|
24064
24455
|
// content: [messageContent], — omitted: already rendered via item/started
|
|
@@ -24067,7 +24458,7 @@ var CodexElicitationHandler = class {
|
|
|
24067
24458
|
_meta: { is_mcp_tool_approval: true },
|
|
24068
24459
|
options
|
|
24069
24460
|
},
|
|
24070
|
-
correlatedCallId
|
|
24461
|
+
correlatedCallId: context.correlatedCallId
|
|
24071
24462
|
};
|
|
24072
24463
|
}
|
|
24073
24464
|
return {
|
|
@@ -24075,12 +24466,12 @@ var CodexElicitationHandler = class {
|
|
|
24075
24466
|
sessionId,
|
|
24076
24467
|
toolCall: {
|
|
24077
24468
|
toolCallId: `elicitation-${params.serverName}`,
|
|
24078
|
-
kind: isToolApproval ? "execute" : "other",
|
|
24469
|
+
kind: context.isToolApproval ? "execute" : "other",
|
|
24079
24470
|
status: "pending",
|
|
24080
24471
|
content: [messageContent],
|
|
24081
24472
|
rawInput: { serverName: params.serverName, schema: params.requestedSchema }
|
|
24082
24473
|
},
|
|
24083
|
-
...isToolApproval ? { _meta: { is_mcp_tool_approval: true } } : {},
|
|
24474
|
+
...context.isToolApproval ? { _meta: { is_mcp_tool_approval: true } } : {},
|
|
24084
24475
|
options
|
|
24085
24476
|
},
|
|
24086
24477
|
correlatedCallId: void 0
|
|
@@ -24102,7 +24493,7 @@ var CodexElicitationHandler = class {
|
|
|
24102
24493
|
};
|
|
24103
24494
|
}
|
|
24104
24495
|
}
|
|
24105
|
-
|
|
24496
|
+
convertPermissionResponse(response) {
|
|
24106
24497
|
if (response.outcome.outcome === "cancelled") {
|
|
24107
24498
|
return { action: "cancel", content: null, _meta: null };
|
|
24108
24499
|
}
|
|
@@ -24118,6 +24509,59 @@ var CodexElicitationHandler = class {
|
|
|
24118
24509
|
}
|
|
24119
24510
|
return { action: "decline", content: null, _meta: null };
|
|
24120
24511
|
}
|
|
24512
|
+
convertElicitationResponse(response, context) {
|
|
24513
|
+
if (CreateElicitationResponse.isAccept(response)) {
|
|
24514
|
+
const content = contentRecord(response.content);
|
|
24515
|
+
const persist = context.isToolApproval ? content["persist"] : void 0;
|
|
24516
|
+
if (persist === "session" || persist === "always" || persist === "once") {
|
|
24517
|
+
delete content["persist"];
|
|
24518
|
+
}
|
|
24519
|
+
return {
|
|
24520
|
+
action: "accept",
|
|
24521
|
+
content: jsonObjectOrNull(content),
|
|
24522
|
+
_meta: elicitationResponseMeta(response, context, persist)
|
|
24523
|
+
};
|
|
24524
|
+
}
|
|
24525
|
+
if (CreateElicitationResponse.isDecline(response)) {
|
|
24526
|
+
return { action: "decline", content: null, _meta: elicitationResponseMeta(response, context) };
|
|
24527
|
+
}
|
|
24528
|
+
if (CreateElicitationResponse.isCancel(response)) {
|
|
24529
|
+
return { action: "cancel", content: null, _meta: elicitationResponseMeta(response, context) };
|
|
24530
|
+
}
|
|
24531
|
+
if (CreateElicitationResponse.isCustom(response)) {
|
|
24532
|
+
return { action: "cancel", content: null, _meta: null };
|
|
24533
|
+
}
|
|
24534
|
+
return { action: "cancel", content: null, _meta: null };
|
|
24535
|
+
}
|
|
24536
|
+
async publishAcceptedMcpToolApproval(context, accepted) {
|
|
24537
|
+
if (!accepted || context.correlatedCallId === void 0) {
|
|
24538
|
+
return;
|
|
24539
|
+
}
|
|
24540
|
+
await this.connection.notify(methods.client.session.update, {
|
|
24541
|
+
sessionId: this.sessionState.sessionId,
|
|
24542
|
+
update: { sessionUpdate: "tool_call_update", toolCallId: context.correlatedCallId, status: "in_progress" }
|
|
24543
|
+
});
|
|
24544
|
+
}
|
|
24545
|
+
trackUrlElicitation(threadId, elicitationId) {
|
|
24546
|
+
const existing = this.pendingUrlElicitations.get(threadId);
|
|
24547
|
+
if (existing) {
|
|
24548
|
+
existing.add(elicitationId);
|
|
24549
|
+
return;
|
|
24550
|
+
}
|
|
24551
|
+
this.pendingUrlElicitations.set(threadId, /* @__PURE__ */ new Set([elicitationId]));
|
|
24552
|
+
}
|
|
24553
|
+
async completeUrlElicitations(threadId) {
|
|
24554
|
+
const elicitationIds = this.pendingUrlElicitations.get(threadId);
|
|
24555
|
+
if (!elicitationIds) {
|
|
24556
|
+
return;
|
|
24557
|
+
}
|
|
24558
|
+
this.pendingUrlElicitations.delete(threadId);
|
|
24559
|
+
for (const elicitationId of elicitationIds) {
|
|
24560
|
+
await this.connection.notify(methods.client.elicitation.complete, {
|
|
24561
|
+
elicitationId
|
|
24562
|
+
});
|
|
24563
|
+
}
|
|
24564
|
+
}
|
|
24121
24565
|
handleItemStarted(event) {
|
|
24122
24566
|
if (event.item.type !== "mcpToolCall") {
|
|
24123
24567
|
return;
|
|
@@ -24955,7 +25399,7 @@ var package_default = {
|
|
|
24955
25399
|
publishConfig: {
|
|
24956
25400
|
access: "public"
|
|
24957
25401
|
},
|
|
24958
|
-
version: "1.1.
|
|
25402
|
+
version: "1.1.2",
|
|
24959
25403
|
description: "",
|
|
24960
25404
|
main: "dist/index.js",
|
|
24961
25405
|
bin: {
|
|
@@ -25005,16 +25449,16 @@ var package_default = {
|
|
|
25005
25449
|
license: "Apache-2.0",
|
|
25006
25450
|
type: "module",
|
|
25007
25451
|
devDependencies: {
|
|
25008
|
-
"@types/node": "^26.0
|
|
25452
|
+
"@types/node": "^26.1.0",
|
|
25009
25453
|
esbuild: "^0.28.1",
|
|
25010
25454
|
"mcp-hello-world": "^1.1.2",
|
|
25011
|
-
tsx: "^4.
|
|
25455
|
+
tsx: "^4.23.0",
|
|
25012
25456
|
typescript: "^6.0.3",
|
|
25013
|
-
vitest: "^4.1.
|
|
25457
|
+
vitest: "^4.1.10"
|
|
25014
25458
|
},
|
|
25015
25459
|
dependencies: {
|
|
25016
|
-
"@agentclientprotocol/sdk": "^1.1
|
|
25017
|
-
"@openai/codex": "^0.
|
|
25460
|
+
"@agentclientprotocol/sdk": "^1.2.1",
|
|
25461
|
+
"@openai/codex": "^0.144.0",
|
|
25018
25462
|
diff: "^9.0.0",
|
|
25019
25463
|
open: "^11.0.0",
|
|
25020
25464
|
"vscode-jsonrpc": "^9.0.1",
|
|
@@ -26409,10 +26853,8 @@ function createMessageUpdates(item) {
|
|
|
26409
26853
|
if (role !== "assistant") {
|
|
26410
26854
|
return [];
|
|
26411
26855
|
}
|
|
26412
|
-
|
|
26413
|
-
|
|
26414
|
-
content
|
|
26415
|
-
}));
|
|
26856
|
+
const phase = stringValue(item["phase"]);
|
|
26857
|
+
return contentBlocksFromResponseContent(item["content"]).map((content) => createAgentMessageChunk(content, void 0, createCodexMessagePhaseMeta(phase)));
|
|
26416
26858
|
}
|
|
26417
26859
|
function createEventMsgUpdates(record2) {
|
|
26418
26860
|
if (record2["type"] !== "event_msg") {
|
|
@@ -27262,6 +27704,7 @@ var CodexAcpServer = class _CodexAcpServer {
|
|
|
27262
27704
|
getRecentStderr;
|
|
27263
27705
|
availableCommands;
|
|
27264
27706
|
clientInfo;
|
|
27707
|
+
clientCapabilities;
|
|
27265
27708
|
terminalOutputMode;
|
|
27266
27709
|
booleanConfigOptionsSupported;
|
|
27267
27710
|
sessions;
|
|
@@ -27285,6 +27728,7 @@ var CodexAcpServer = class _CodexAcpServer {
|
|
|
27285
27728
|
this.getExitCode = getExitCode ?? (() => null);
|
|
27286
27729
|
this.getRecentStderr = getRecentStderr ?? (() => "");
|
|
27287
27730
|
this.clientInfo = null;
|
|
27731
|
+
this.clientCapabilities = null;
|
|
27288
27732
|
this.terminalOutputMode = "terminal_output_delta";
|
|
27289
27733
|
this.booleanConfigOptionsSupported = false;
|
|
27290
27734
|
this.availableCommands = new CodexCommands(
|
|
@@ -27297,6 +27741,7 @@ var CodexAcpServer = class _CodexAcpServer {
|
|
|
27297
27741
|
async initialize(_params) {
|
|
27298
27742
|
logger.log("Initialize request received");
|
|
27299
27743
|
this.clientInfo = _params.clientInfo ?? null;
|
|
27744
|
+
this.clientCapabilities = _params.clientCapabilities ?? null;
|
|
27300
27745
|
this.terminalOutputMode = resolveTerminalOutputMode(_params.clientCapabilities);
|
|
27301
27746
|
this.booleanConfigOptionsSupported = clientSupportsBooleanConfigOptions(_params.clientCapabilities);
|
|
27302
27747
|
await this.runWithProcessCheck(() => this.codexAcpClient.initialize(_params));
|
|
@@ -27974,12 +28419,15 @@ You have been logged out. Please try again.`);
|
|
|
27974
28419
|
case "subAgentActivity":
|
|
27975
28420
|
case "sleep":
|
|
27976
28421
|
return [];
|
|
27977
|
-
case "agentMessage":
|
|
28422
|
+
case "agentMessage": {
|
|
28423
|
+
const meta3 = createCodexMessagePhaseMeta(item.phase);
|
|
27978
28424
|
return [{
|
|
27979
28425
|
sessionUpdate: "agent_message_chunk",
|
|
27980
28426
|
messageId: item.id,
|
|
27981
|
-
content: { type: "text", text: item.text }
|
|
28427
|
+
content: { type: "text", text: item.text },
|
|
28428
|
+
...meta3 ? { _meta: meta3 } : {}
|
|
27982
28429
|
}];
|
|
28430
|
+
}
|
|
27983
28431
|
case "reasoning":
|
|
27984
28432
|
return this.createReasoningUpdates(item);
|
|
27985
28433
|
case "fileChange":
|
|
@@ -28360,11 +28808,16 @@ ${item.text}`
|
|
|
28360
28808
|
try {
|
|
28361
28809
|
const eventHandler = new CodexEventHandler(this.connection, sessionState);
|
|
28362
28810
|
const approvalHandler = new CodexApprovalHandler(this.connection, sessionState, activePrompt.signal);
|
|
28363
|
-
const elicitationHandler = new CodexElicitationHandler(
|
|
28811
|
+
const elicitationHandler = new CodexElicitationHandler(
|
|
28812
|
+
this.connection,
|
|
28813
|
+
sessionState,
|
|
28814
|
+
this.clientCapabilities,
|
|
28815
|
+
activePrompt.signal
|
|
28816
|
+
);
|
|
28364
28817
|
await this.codexAcpClient.subscribeToSessionEvents(
|
|
28365
28818
|
params.sessionId,
|
|
28366
|
-
(event) => {
|
|
28367
|
-
elicitationHandler.handleNotification(event);
|
|
28819
|
+
async (event) => {
|
|
28820
|
+
await elicitationHandler.handleNotification(event);
|
|
28368
28821
|
return eventHandler.handleNotification(event);
|
|
28369
28822
|
},
|
|
28370
28823
|
approvalHandler,
|