@yitom/acp-client 0.1.11 → 0.1.12
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/README.md +20 -0
- package/dist/client/acp-client.d.ts +2 -2
- package/dist/client/client-handlers.d.ts +3 -3
- package/dist/client/sdk-client.d.ts +6 -2
- package/dist/client/session-open.d.ts +16 -5
- package/dist/index.cjs +106 -44
- package/dist/index.js +123 -60
- package/dist/resources/app-resources.d.ts +7 -0
- package/dist/resources/runtime-bindings.d.ts +6 -1
- package/dist/sidecar.cjs +475 -670
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/sidecar.cjs
CHANGED
|
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
36
36
|
var readline2 = __toESM(require("node:readline"), 1);
|
|
37
37
|
|
|
38
38
|
// src/version.ts
|
|
39
|
-
var ACP_CLIENT_VERSION = "0.1.
|
|
39
|
+
var ACP_CLIENT_VERSION = "0.1.12";
|
|
40
40
|
// src/contracts/index.ts
|
|
41
41
|
function ok(value) {
|
|
42
42
|
return { ok: true, value };
|
|
@@ -197,17 +197,7 @@ var AGENT_METHODS = {
|
|
|
197
197
|
session_fork: "session/fork",
|
|
198
198
|
session_resume: "session/resume",
|
|
199
199
|
session_close: "session/close",
|
|
200
|
-
logout: "logout"
|
|
201
|
-
nes_start: "nes/start",
|
|
202
|
-
nes_suggest: "nes/suggest",
|
|
203
|
-
nes_accept: "nes/accept",
|
|
204
|
-
nes_reject: "nes/reject",
|
|
205
|
-
nes_close: "nes/close",
|
|
206
|
-
document_did_open: "document/didOpen",
|
|
207
|
-
document_did_change: "document/didChange",
|
|
208
|
-
document_did_close: "document/didClose",
|
|
209
|
-
document_did_save: "document/didSave",
|
|
210
|
-
document_did_focus: "document/didFocus"
|
|
200
|
+
logout: "logout"
|
|
211
201
|
};
|
|
212
202
|
var CLIENT_METHODS = {
|
|
213
203
|
session_request_permission: "session/request_permission",
|
|
@@ -219,9 +209,7 @@ var CLIENT_METHODS = {
|
|
|
219
209
|
terminal_release: "terminal/release",
|
|
220
210
|
terminal_wait_for_exit: "terminal/wait_for_exit",
|
|
221
211
|
terminal_kill: "terminal/kill",
|
|
222
|
-
mcp_connect: "mcp/connect",
|
|
223
212
|
mcp_message: "mcp/message",
|
|
224
|
-
mcp_disconnect: "mcp/disconnect",
|
|
225
213
|
elicitation_create: "elicitation/create",
|
|
226
214
|
elicitation_complete: "elicitation/complete"
|
|
227
215
|
};
|
|
@@ -1210,6 +1198,7 @@ var anyString = /^[\s\S]{0,}$/;
|
|
|
1210
1198
|
var integer = /^-?\d+$/;
|
|
1211
1199
|
var number = /^-?\d+(?:\.\d+)?$/;
|
|
1212
1200
|
var boolean = /^(?:true|false)$/i;
|
|
1201
|
+
var _null = /^null$/i;
|
|
1213
1202
|
var lowercase = /^[^A-Z]*$/;
|
|
1214
1203
|
var uppercase = /^[^a-z]*$/;
|
|
1215
1204
|
|
|
@@ -2111,6 +2100,23 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
2111
2100
|
return payload;
|
|
2112
2101
|
};
|
|
2113
2102
|
});
|
|
2103
|
+
var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
2104
|
+
$ZodType.init(inst, def);
|
|
2105
|
+
inst._zod.pattern = _null;
|
|
2106
|
+
inst._zod.values = new Set([null]);
|
|
2107
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2108
|
+
const input = payload.value;
|
|
2109
|
+
if (input === null)
|
|
2110
|
+
return payload;
|
|
2111
|
+
payload.issues.push({
|
|
2112
|
+
expected: "null",
|
|
2113
|
+
code: "invalid_type",
|
|
2114
|
+
input,
|
|
2115
|
+
inst
|
|
2116
|
+
});
|
|
2117
|
+
return payload;
|
|
2118
|
+
};
|
|
2119
|
+
});
|
|
2114
2120
|
var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
2115
2121
|
$ZodType.init(inst, def);
|
|
2116
2122
|
inst._zod.parse = (payload) => payload;
|
|
@@ -3055,6 +3061,9 @@ function handlePipeResult(left, next, ctx) {
|
|
|
3055
3061
|
}
|
|
3056
3062
|
return next._zod.run({ value: left.value, issues: left.issues }, ctx);
|
|
3057
3063
|
}
|
|
3064
|
+
var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
|
|
3065
|
+
$ZodPipe.init(inst, def);
|
|
3066
|
+
});
|
|
3058
3067
|
var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
|
|
3059
3068
|
$ZodType.init(inst, def);
|
|
3060
3069
|
defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
|
|
@@ -3809,6 +3818,12 @@ function _boolean(Class, params) {
|
|
|
3809
3818
|
...normalizeParams(params)
|
|
3810
3819
|
});
|
|
3811
3820
|
}
|
|
3821
|
+
function _null2(Class, params) {
|
|
3822
|
+
return new Class({
|
|
3823
|
+
type: "null",
|
|
3824
|
+
...normalizeParams(params)
|
|
3825
|
+
});
|
|
3826
|
+
}
|
|
3812
3827
|
function _unknown(Class) {
|
|
3813
3828
|
return new Class({
|
|
3814
3829
|
type: "unknown"
|
|
@@ -4694,6 +4709,15 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
4694
4709
|
var booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
4695
4710
|
json.type = "boolean";
|
|
4696
4711
|
};
|
|
4712
|
+
var nullProcessor = (_schema, ctx, json, _params) => {
|
|
4713
|
+
if (ctx.target === "openapi-3.0") {
|
|
4714
|
+
json.type = "string";
|
|
4715
|
+
json.nullable = true;
|
|
4716
|
+
json.enum = [null];
|
|
4717
|
+
} else {
|
|
4718
|
+
json.type = "null";
|
|
4719
|
+
}
|
|
4720
|
+
};
|
|
4697
4721
|
var neverProcessor = (_schema, _ctx, json, _params) => {
|
|
4698
4722
|
json.not = {};
|
|
4699
4723
|
};
|
|
@@ -5604,6 +5628,14 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
5604
5628
|
function boolean2(params) {
|
|
5605
5629
|
return _boolean(ZodBoolean, params);
|
|
5606
5630
|
}
|
|
5631
|
+
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
5632
|
+
$ZodNull.init(inst, def);
|
|
5633
|
+
ZodType.init(inst, def);
|
|
5634
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
|
|
5635
|
+
});
|
|
5636
|
+
function _null3(params) {
|
|
5637
|
+
return _null2(ZodNull, params);
|
|
5638
|
+
}
|
|
5607
5639
|
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
5608
5640
|
$ZodUnknown.init(inst, def);
|
|
5609
5641
|
ZodType.init(inst, def);
|
|
@@ -5704,6 +5736,14 @@ function object(shape, params) {
|
|
|
5704
5736
|
};
|
|
5705
5737
|
return new ZodObject(def);
|
|
5706
5738
|
}
|
|
5739
|
+
function looseObject(shape, params) {
|
|
5740
|
+
return new ZodObject({
|
|
5741
|
+
type: "object",
|
|
5742
|
+
shape,
|
|
5743
|
+
catchall: unknown(),
|
|
5744
|
+
...normalizeParams(params)
|
|
5745
|
+
});
|
|
5746
|
+
}
|
|
5707
5747
|
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
5708
5748
|
$ZodUnion.init(inst, def);
|
|
5709
5749
|
ZodType.init(inst, def);
|
|
@@ -5968,6 +6008,10 @@ function pipe(in_, out) {
|
|
|
5968
6008
|
out
|
|
5969
6009
|
});
|
|
5970
6010
|
}
|
|
6011
|
+
var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
|
|
6012
|
+
ZodPipe.init(inst, def);
|
|
6013
|
+
$ZodPreprocess.init(inst, def);
|
|
6014
|
+
});
|
|
5971
6015
|
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
5972
6016
|
$ZodReadonly.init(inst, def);
|
|
5973
6017
|
ZodType.init(inst, def);
|
|
@@ -5991,6 +6035,13 @@ function refine(fn, _params = {}) {
|
|
|
5991
6035
|
function superRefine(fn, params) {
|
|
5992
6036
|
return _superRefine(fn, params);
|
|
5993
6037
|
}
|
|
6038
|
+
function preprocess(fn, schema) {
|
|
6039
|
+
return new ZodPreprocess({
|
|
6040
|
+
type: "pipe",
|
|
6041
|
+
in: transform(fn),
|
|
6042
|
+
out: schema
|
|
6043
|
+
});
|
|
6044
|
+
}
|
|
5994
6045
|
// node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js
|
|
5995
6046
|
var skippedItem = Symbol("skippedItem");
|
|
5996
6047
|
function defaultOnError(schema, fallback) {
|
|
@@ -6050,6 +6101,21 @@ function preserveCustomPayload(schema, key, knownTags) {
|
|
|
6050
6101
|
return output;
|
|
6051
6102
|
});
|
|
6052
6103
|
}
|
|
6104
|
+
function defaultOnErrorOptionalStringTag(schema, key) {
|
|
6105
|
+
return preprocess((value) => {
|
|
6106
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
6107
|
+
return value;
|
|
6108
|
+
}
|
|
6109
|
+
const record = value;
|
|
6110
|
+
const tag = record[key];
|
|
6111
|
+
if (tag === undefined || tag === null || typeof tag === "string") {
|
|
6112
|
+
return value;
|
|
6113
|
+
}
|
|
6114
|
+
const normalized = { ...record };
|
|
6115
|
+
delete normalized[key];
|
|
6116
|
+
return normalized;
|
|
6117
|
+
}, schema);
|
|
6118
|
+
}
|
|
6053
6119
|
function vecSkipError(itemSchema) {
|
|
6054
6120
|
return array(itemSchema.catch(skippedItem)).transform((items) => items.filter((item) => item !== skippedItem));
|
|
6055
6121
|
}
|
|
@@ -6068,16 +6134,12 @@ var zWriteTextFileRequest = object({
|
|
|
6068
6134
|
var zReadTextFileRequest = object({
|
|
6069
6135
|
sessionId: zSessionId,
|
|
6070
6136
|
path: string2(),
|
|
6071
|
-
line:
|
|
6137
|
+
line: int().gte(0).max(4294967295, {
|
|
6072
6138
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
6073
|
-
}).nullish(),
|
|
6074
|
-
|
|
6075
|
-
}),
|
|
6076
|
-
limit: defaultOnError(int().gte(0).max(4294967295, {
|
|
6139
|
+
}).nullish(),
|
|
6140
|
+
limit: int().gte(0).max(4294967295, {
|
|
6077
6141
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
6078
|
-
}).nullish(),
|
|
6079
|
-
return;
|
|
6080
|
-
}),
|
|
6142
|
+
}).nullish(),
|
|
6081
6143
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6082
6144
|
return;
|
|
6083
6145
|
})
|
|
@@ -6328,14 +6390,10 @@ var zEnvVariable = object({
|
|
|
6328
6390
|
var zCreateTerminalRequest = object({
|
|
6329
6391
|
sessionId: zSessionId,
|
|
6330
6392
|
command: string2(),
|
|
6331
|
-
args:
|
|
6332
|
-
env:
|
|
6333
|
-
cwd:
|
|
6334
|
-
|
|
6335
|
-
}),
|
|
6336
|
-
outputByteLimit: defaultOnError(number2().nullish(), () => {
|
|
6337
|
-
return;
|
|
6338
|
-
}),
|
|
6393
|
+
args: array(string2()).optional(),
|
|
6394
|
+
env: array(zEnvVariable).optional(),
|
|
6395
|
+
cwd: string2().nullish(),
|
|
6396
|
+
outputByteLimit: number2().nullish(),
|
|
6339
6397
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6340
6398
|
return;
|
|
6341
6399
|
})
|
|
@@ -6561,27 +6619,16 @@ var zCreateElicitationRequest = preserveCustomPayload(intersection(union([
|
|
|
6561
6619
|
})
|
|
6562
6620
|
})), "mode", ["form", "url"]);
|
|
6563
6621
|
var zMcpServerAcpId = string2();
|
|
6564
|
-
var
|
|
6565
|
-
serverId: zMcpServerAcpId,
|
|
6566
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6567
|
-
return;
|
|
6568
|
-
})
|
|
6569
|
-
});
|
|
6570
|
-
var zMcpConnectionId = string2();
|
|
6622
|
+
var zMcpRequestId = string2();
|
|
6571
6623
|
var zMessageMcpRequest = object({
|
|
6572
|
-
|
|
6624
|
+
serverId: zMcpServerAcpId,
|
|
6625
|
+
requestId: zMcpRequestId,
|
|
6573
6626
|
method: string2(),
|
|
6574
6627
|
params: record(string2(), unknown()).nullish(),
|
|
6575
6628
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6576
6629
|
return;
|
|
6577
6630
|
})
|
|
6578
6631
|
});
|
|
6579
|
-
var zDisconnectMcpRequest = object({
|
|
6580
|
-
connectionId: zMcpConnectionId,
|
|
6581
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6582
|
-
return;
|
|
6583
|
-
})
|
|
6584
|
-
});
|
|
6585
6632
|
var zExtRequest = unknown();
|
|
6586
6633
|
var zAgentRequest = object({
|
|
6587
6634
|
id: zRequestId,
|
|
@@ -6596,9 +6643,7 @@ var zAgentRequest = object({
|
|
|
6596
6643
|
zWaitForTerminalExitRequest,
|
|
6597
6644
|
zKillTerminalRequest,
|
|
6598
6645
|
zCreateElicitationRequest,
|
|
6599
|
-
zConnectMcpRequest,
|
|
6600
6646
|
zMessageMcpRequest,
|
|
6601
|
-
zDisconnectMcpRequest,
|
|
6602
6647
|
zExtRequest
|
|
6603
6648
|
]).nullish()
|
|
6604
6649
|
});
|
|
@@ -6634,204 +6679,86 @@ var zSessionAdditionalDirectoriesCapabilities = object({
|
|
|
6634
6679
|
return;
|
|
6635
6680
|
})
|
|
6636
6681
|
});
|
|
6637
|
-
var
|
|
6638
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6639
|
-
return;
|
|
6640
|
-
})
|
|
6641
|
-
});
|
|
6642
|
-
var zSessionResumeCapabilities = object({
|
|
6643
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6644
|
-
return;
|
|
6645
|
-
})
|
|
6646
|
-
});
|
|
6647
|
-
var zSessionCloseCapabilities = object({
|
|
6682
|
+
var zSessionSystemPromptOverrideCapabilities = object({
|
|
6648
6683
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6649
6684
|
return;
|
|
6650
6685
|
})
|
|
6651
6686
|
});
|
|
6652
|
-
var
|
|
6653
|
-
|
|
6654
|
-
return;
|
|
6655
|
-
}),
|
|
6656
|
-
delete: defaultOnError(zSessionDeleteCapabilities.nullish(), () => {
|
|
6657
|
-
return;
|
|
6658
|
-
}),
|
|
6659
|
-
additionalDirectories: defaultOnError(zSessionAdditionalDirectoriesCapabilities.nullish(), () => {
|
|
6660
|
-
return;
|
|
6661
|
-
}),
|
|
6662
|
-
fork: defaultOnError(zSessionForkCapabilities.nullish(), () => {
|
|
6663
|
-
return;
|
|
6664
|
-
}),
|
|
6665
|
-
resume: defaultOnError(zSessionResumeCapabilities.nullish(), () => {
|
|
6666
|
-
return;
|
|
6667
|
-
}),
|
|
6668
|
-
close: defaultOnError(zSessionCloseCapabilities.nullish(), () => {
|
|
6687
|
+
var zSessionSystemPromptModeCapabilities = object({
|
|
6688
|
+
override: defaultOnError(zSessionSystemPromptOverrideCapabilities.nullish(), () => {
|
|
6669
6689
|
return;
|
|
6670
6690
|
}),
|
|
6671
6691
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6672
6692
|
return;
|
|
6673
6693
|
})
|
|
6674
6694
|
});
|
|
6675
|
-
var
|
|
6676
|
-
|
|
6677
|
-
return;
|
|
6678
|
-
})
|
|
6679
|
-
});
|
|
6680
|
-
var zAgentAuthCapabilities = object({
|
|
6681
|
-
logout: defaultOnError(zLogoutCapabilities.nullish(), () => {
|
|
6695
|
+
var zSessionSystemPromptCapabilities = object({
|
|
6696
|
+
mode: defaultOnError(zSessionSystemPromptModeCapabilities.nullish(), () => {
|
|
6682
6697
|
return;
|
|
6683
6698
|
}),
|
|
6684
6699
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6685
6700
|
return;
|
|
6686
6701
|
})
|
|
6687
6702
|
});
|
|
6688
|
-
var
|
|
6689
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6690
|
-
return;
|
|
6691
|
-
})
|
|
6692
|
-
});
|
|
6693
|
-
var zNesDocumentDidOpenCapabilities = object({
|
|
6694
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6695
|
-
return;
|
|
6696
|
-
})
|
|
6697
|
-
});
|
|
6698
|
-
var zTextDocumentSyncKind = union([
|
|
6699
|
-
literal("full"),
|
|
6700
|
-
literal("incremental")
|
|
6701
|
-
]);
|
|
6702
|
-
var zNesDocumentDidChangeCapabilities = object({
|
|
6703
|
-
syncKind: zTextDocumentSyncKind,
|
|
6704
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6705
|
-
return;
|
|
6706
|
-
})
|
|
6707
|
-
});
|
|
6708
|
-
var zNesDocumentDidCloseCapabilities = object({
|
|
6703
|
+
var zSessionForkCapabilities = object({
|
|
6709
6704
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6710
6705
|
return;
|
|
6711
6706
|
})
|
|
6712
6707
|
});
|
|
6713
|
-
var
|
|
6708
|
+
var zSessionResumeCapabilities = object({
|
|
6714
6709
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6715
6710
|
return;
|
|
6716
6711
|
})
|
|
6717
6712
|
});
|
|
6718
|
-
var
|
|
6713
|
+
var zSessionCloseCapabilities = object({
|
|
6719
6714
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6720
6715
|
return;
|
|
6721
6716
|
})
|
|
6722
6717
|
});
|
|
6723
|
-
var
|
|
6724
|
-
|
|
6725
|
-
return;
|
|
6726
|
-
}),
|
|
6727
|
-
didChange: defaultOnError(zNesDocumentDidChangeCapabilities.nullish(), () => {
|
|
6728
|
-
return;
|
|
6729
|
-
}),
|
|
6730
|
-
didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => {
|
|
6718
|
+
var zSessionCapabilities = object({
|
|
6719
|
+
list: defaultOnError(zSessionListCapabilities.nullish(), () => {
|
|
6731
6720
|
return;
|
|
6732
6721
|
}),
|
|
6733
|
-
|
|
6722
|
+
delete: defaultOnError(zSessionDeleteCapabilities.nullish(), () => {
|
|
6734
6723
|
return;
|
|
6735
6724
|
}),
|
|
6736
|
-
|
|
6725
|
+
additionalDirectories: defaultOnError(zSessionAdditionalDirectoriesCapabilities.nullish(), () => {
|
|
6737
6726
|
return;
|
|
6738
6727
|
}),
|
|
6739
|
-
|
|
6740
|
-
return;
|
|
6741
|
-
})
|
|
6742
|
-
});
|
|
6743
|
-
var zNesEventCapabilities = object({
|
|
6744
|
-
document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => {
|
|
6728
|
+
systemPrompt: defaultOnError(zSessionSystemPromptCapabilities.nullish(), () => {
|
|
6745
6729
|
return;
|
|
6746
6730
|
}),
|
|
6747
|
-
|
|
6748
|
-
return;
|
|
6749
|
-
})
|
|
6750
|
-
});
|
|
6751
|
-
var zNesRecentFilesCapabilities = object({
|
|
6752
|
-
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
6753
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
6754
|
-
}).nullish(), () => {
|
|
6731
|
+
fork: defaultOnError(zSessionForkCapabilities.nullish(), () => {
|
|
6755
6732
|
return;
|
|
6756
6733
|
}),
|
|
6757
|
-
|
|
6758
|
-
return;
|
|
6759
|
-
})
|
|
6760
|
-
});
|
|
6761
|
-
var zNesRelatedSnippetsCapabilities = object({
|
|
6762
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6763
|
-
return;
|
|
6764
|
-
})
|
|
6765
|
-
});
|
|
6766
|
-
var zNesEditHistoryCapabilities = object({
|
|
6767
|
-
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
6768
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
6769
|
-
}).nullish(), () => {
|
|
6734
|
+
resume: defaultOnError(zSessionResumeCapabilities.nullish(), () => {
|
|
6770
6735
|
return;
|
|
6771
6736
|
}),
|
|
6772
|
-
|
|
6773
|
-
return;
|
|
6774
|
-
})
|
|
6775
|
-
});
|
|
6776
|
-
var zNesUserActionsCapabilities = object({
|
|
6777
|
-
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
6778
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
6779
|
-
}).nullish(), () => {
|
|
6737
|
+
close: defaultOnError(zSessionCloseCapabilities.nullish(), () => {
|
|
6780
6738
|
return;
|
|
6781
6739
|
}),
|
|
6782
6740
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6783
6741
|
return;
|
|
6784
6742
|
})
|
|
6785
6743
|
});
|
|
6786
|
-
var
|
|
6787
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6788
|
-
return;
|
|
6789
|
-
})
|
|
6790
|
-
});
|
|
6791
|
-
var zNesDiagnosticsCapabilities = object({
|
|
6744
|
+
var zLogoutCapabilities = object({
|
|
6792
6745
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6793
6746
|
return;
|
|
6794
6747
|
})
|
|
6795
6748
|
});
|
|
6796
|
-
var
|
|
6797
|
-
|
|
6798
|
-
return;
|
|
6799
|
-
}),
|
|
6800
|
-
relatedSnippets: defaultOnError(zNesRelatedSnippetsCapabilities.nullish(), () => {
|
|
6801
|
-
return;
|
|
6802
|
-
}),
|
|
6803
|
-
editHistory: defaultOnError(zNesEditHistoryCapabilities.nullish(), () => {
|
|
6804
|
-
return;
|
|
6805
|
-
}),
|
|
6806
|
-
userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => {
|
|
6807
|
-
return;
|
|
6808
|
-
}),
|
|
6809
|
-
openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => {
|
|
6810
|
-
return;
|
|
6811
|
-
}),
|
|
6812
|
-
diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => {
|
|
6749
|
+
var zAgentAuthCapabilities = object({
|
|
6750
|
+
logout: defaultOnError(zLogoutCapabilities.nullish(), () => {
|
|
6813
6751
|
return;
|
|
6814
6752
|
}),
|
|
6815
6753
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6816
6754
|
return;
|
|
6817
6755
|
})
|
|
6818
6756
|
});
|
|
6819
|
-
var
|
|
6820
|
-
events: defaultOnError(zNesEventCapabilities.nullish(), () => {
|
|
6821
|
-
return;
|
|
6822
|
-
}),
|
|
6823
|
-
context: defaultOnError(zNesContextCapabilities.nullish(), () => {
|
|
6824
|
-
return;
|
|
6825
|
-
}),
|
|
6757
|
+
var zProvidersCapabilities = object({
|
|
6826
6758
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6827
6759
|
return;
|
|
6828
6760
|
})
|
|
6829
6761
|
});
|
|
6830
|
-
var zPositionEncodingKind = union([
|
|
6831
|
-
literal("utf-16"),
|
|
6832
|
-
literal("utf-32"),
|
|
6833
|
-
literal("utf-8")
|
|
6834
|
-
]);
|
|
6835
6762
|
var zAgentCapabilities = object({
|
|
6836
6763
|
loadSession: defaultOnError(boolean2().optional().default(false), () => false),
|
|
6837
6764
|
promptCapabilities: defaultOnError(zPromptCapabilities.optional().default({
|
|
@@ -6857,12 +6784,6 @@ var zAgentCapabilities = object({
|
|
|
6857
6784
|
providers: defaultOnError(zProvidersCapabilities.nullish(), () => {
|
|
6858
6785
|
return;
|
|
6859
6786
|
}),
|
|
6860
|
-
nes: defaultOnError(zNesCapabilities.nullish(), () => {
|
|
6861
|
-
return;
|
|
6862
|
-
}),
|
|
6863
|
-
positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => {
|
|
6864
|
-
return;
|
|
6865
|
-
}),
|
|
6866
6787
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6867
6788
|
return;
|
|
6868
6789
|
})
|
|
@@ -6874,10 +6795,8 @@ var zAuthMethodTerminal = object({
|
|
|
6874
6795
|
description: defaultOnError(string2().nullish(), () => {
|
|
6875
6796
|
return;
|
|
6876
6797
|
}),
|
|
6877
|
-
args:
|
|
6878
|
-
env:
|
|
6879
|
-
return;
|
|
6880
|
-
}),
|
|
6798
|
+
args: array(string2()).optional(),
|
|
6799
|
+
env: record(string2(), string2()).optional(),
|
|
6881
6800
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
6882
6801
|
return;
|
|
6883
6802
|
})
|
|
@@ -7198,103 +7117,7 @@ var zPromptResponse = object({
|
|
|
7198
7117
|
return;
|
|
7199
7118
|
})
|
|
7200
7119
|
});
|
|
7201
|
-
var zStartNesResponse = object({
|
|
7202
|
-
sessionId: zSessionId,
|
|
7203
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7204
|
-
return;
|
|
7205
|
-
})
|
|
7206
|
-
});
|
|
7207
|
-
var zNesSuggestionId = string2();
|
|
7208
|
-
var zPosition = object({
|
|
7209
|
-
line: int().gte(0).max(4294967295, {
|
|
7210
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
7211
|
-
}),
|
|
7212
|
-
character: int().gte(0).max(4294967295, {
|
|
7213
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
7214
|
-
}),
|
|
7215
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7216
|
-
return;
|
|
7217
|
-
})
|
|
7218
|
-
});
|
|
7219
|
-
var zRange = object({
|
|
7220
|
-
start: zPosition,
|
|
7221
|
-
end: zPosition,
|
|
7222
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7223
|
-
return;
|
|
7224
|
-
})
|
|
7225
|
-
});
|
|
7226
|
-
var zNesTextEdit = object({
|
|
7227
|
-
range: zRange,
|
|
7228
|
-
newText: string2(),
|
|
7229
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7230
|
-
return;
|
|
7231
|
-
})
|
|
7232
|
-
});
|
|
7233
|
-
var zNesEditSuggestion = object({
|
|
7234
|
-
id: zNesSuggestionId,
|
|
7235
|
-
uri: string2(),
|
|
7236
|
-
edits: array(zNesTextEdit),
|
|
7237
|
-
cursorPosition: defaultOnError(zPosition.nullish(), () => {
|
|
7238
|
-
return;
|
|
7239
|
-
}),
|
|
7240
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7241
|
-
return;
|
|
7242
|
-
})
|
|
7243
|
-
});
|
|
7244
|
-
var zNesJumpSuggestion = object({
|
|
7245
|
-
id: zNesSuggestionId,
|
|
7246
|
-
uri: string2(),
|
|
7247
|
-
position: zPosition,
|
|
7248
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7249
|
-
return;
|
|
7250
|
-
})
|
|
7251
|
-
});
|
|
7252
|
-
var zNesRenameSuggestion = object({
|
|
7253
|
-
id: zNesSuggestionId,
|
|
7254
|
-
uri: string2(),
|
|
7255
|
-
position: zPosition,
|
|
7256
|
-
newName: string2(),
|
|
7257
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7258
|
-
return;
|
|
7259
|
-
})
|
|
7260
|
-
});
|
|
7261
|
-
var zNesSearchAndReplaceSuggestion = object({
|
|
7262
|
-
id: zNesSuggestionId,
|
|
7263
|
-
uri: string2(),
|
|
7264
|
-
search: string2(),
|
|
7265
|
-
replace: string2(),
|
|
7266
|
-
isRegex: boolean2().nullish(),
|
|
7267
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7268
|
-
return;
|
|
7269
|
-
})
|
|
7270
|
-
});
|
|
7271
|
-
var zNesSuggestion = union([
|
|
7272
|
-
zNesEditSuggestion.and(object({
|
|
7273
|
-
kind: literal("edit")
|
|
7274
|
-
})),
|
|
7275
|
-
zNesJumpSuggestion.and(object({
|
|
7276
|
-
kind: literal("jump")
|
|
7277
|
-
})),
|
|
7278
|
-
zNesRenameSuggestion.and(object({
|
|
7279
|
-
kind: literal("rename")
|
|
7280
|
-
})),
|
|
7281
|
-
zNesSearchAndReplaceSuggestion.and(object({
|
|
7282
|
-
kind: literal("searchAndReplace")
|
|
7283
|
-
}))
|
|
7284
|
-
]);
|
|
7285
|
-
var zSuggestNesResponse = object({
|
|
7286
|
-
suggestions: array(zNesSuggestion),
|
|
7287
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7288
|
-
return;
|
|
7289
|
-
})
|
|
7290
|
-
});
|
|
7291
|
-
var zCloseNesResponse = object({
|
|
7292
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7293
|
-
return;
|
|
7294
|
-
})
|
|
7295
|
-
});
|
|
7296
7120
|
var zExtResponse = unknown();
|
|
7297
|
-
var zMessageMcpResponse = unknown();
|
|
7298
7121
|
var zErrorCode = union([
|
|
7299
7122
|
literal(-32700),
|
|
7300
7123
|
literal(-32600),
|
|
@@ -7337,11 +7160,7 @@ var zAgentResponse = union([
|
|
|
7337
7160
|
zSetSessionModeResponse,
|
|
7338
7161
|
zSetSessionConfigOptionResponse,
|
|
7339
7162
|
zPromptResponse,
|
|
7340
|
-
|
|
7341
|
-
zSuggestNesResponse,
|
|
7342
|
-
zCloseNesResponse,
|
|
7343
|
-
zExtResponse,
|
|
7344
|
-
zMessageMcpResponse
|
|
7163
|
+
zExtResponse
|
|
7345
7164
|
])
|
|
7346
7165
|
}),
|
|
7347
7166
|
object({
|
|
@@ -7559,20 +7378,166 @@ var zCompactionSummaryChunk = object({
|
|
|
7559
7378
|
return;
|
|
7560
7379
|
})
|
|
7561
7380
|
});
|
|
7562
|
-
var
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
})
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7381
|
+
var zSessionCancelCapabilities = object({
|
|
7382
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7383
|
+
return;
|
|
7384
|
+
})
|
|
7385
|
+
});
|
|
7386
|
+
var zSubagentSessionCapabilities = object({
|
|
7387
|
+
cancel: defaultOnError(zSessionCancelCapabilities.nullish(), () => {
|
|
7388
|
+
return;
|
|
7389
|
+
}),
|
|
7390
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7391
|
+
return;
|
|
7392
|
+
})
|
|
7393
|
+
});
|
|
7394
|
+
var zRunningStateUpdate = object({
|
|
7395
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7396
|
+
return;
|
|
7397
|
+
})
|
|
7398
|
+
});
|
|
7399
|
+
var zErrorStopReason = object({
|
|
7400
|
+
error: defaultOnError(zError.nullish(), () => {
|
|
7401
|
+
return;
|
|
7402
|
+
})
|
|
7403
|
+
});
|
|
7404
|
+
var zIdleStateUpdate = defaultOnErrorOptionalStringTag(preserveCustomPayload(intersection(union([
|
|
7405
|
+
object({
|
|
7406
|
+
stopReason: literal("end_turn")
|
|
7407
|
+
}),
|
|
7408
|
+
object({
|
|
7409
|
+
stopReason: literal("max_tokens")
|
|
7410
|
+
}),
|
|
7411
|
+
object({
|
|
7412
|
+
stopReason: literal("max_turn_requests")
|
|
7413
|
+
}),
|
|
7414
|
+
object({
|
|
7415
|
+
stopReason: literal("refusal")
|
|
7416
|
+
}),
|
|
7417
|
+
object({
|
|
7418
|
+
stopReason: literal("cancelled")
|
|
7419
|
+
}),
|
|
7420
|
+
zErrorStopReason.and(object({
|
|
7421
|
+
stopReason: literal("error")
|
|
7422
|
+
})),
|
|
7423
|
+
excludeKnownTags(object({
|
|
7424
|
+
stopReason: string2()
|
|
7425
|
+
}), "stopReason", [
|
|
7426
|
+
"cancelled",
|
|
7427
|
+
"end_turn",
|
|
7428
|
+
"error",
|
|
7429
|
+
"max_tokens",
|
|
7430
|
+
"max_turn_requests",
|
|
7431
|
+
"refusal"
|
|
7432
|
+
]),
|
|
7433
|
+
object({
|
|
7434
|
+
stopReason: _null3().optional()
|
|
7435
|
+
})
|
|
7436
|
+
]), object({
|
|
7437
|
+
usage: defaultOnError(zUsage.nullish(), () => {
|
|
7438
|
+
return;
|
|
7439
|
+
}),
|
|
7440
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7441
|
+
return;
|
|
7442
|
+
}),
|
|
7443
|
+
stopReason: defaultOnError(string2().nullish(), () => {
|
|
7444
|
+
return;
|
|
7445
|
+
})
|
|
7446
|
+
})), "stopReason", [
|
|
7447
|
+
"cancelled",
|
|
7448
|
+
"end_turn",
|
|
7449
|
+
"error",
|
|
7450
|
+
"max_tokens",
|
|
7451
|
+
"max_turn_requests",
|
|
7452
|
+
"refusal"
|
|
7453
|
+
]), "stopReason");
|
|
7454
|
+
var zRequiresActionStateUpdate = object({
|
|
7455
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7456
|
+
return;
|
|
7457
|
+
})
|
|
7458
|
+
});
|
|
7459
|
+
var zUnknownStateUpdate = object({
|
|
7460
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7461
|
+
return;
|
|
7462
|
+
})
|
|
7463
|
+
});
|
|
7464
|
+
var zStateUpdate = preserveCustomPayload(union([
|
|
7465
|
+
zRunningStateUpdate.and(object({
|
|
7466
|
+
state: literal("running")
|
|
7467
|
+
})),
|
|
7468
|
+
zIdleStateUpdate.and(object({
|
|
7469
|
+
state: literal("idle")
|
|
7470
|
+
})),
|
|
7471
|
+
zRequiresActionStateUpdate.and(object({
|
|
7472
|
+
state: literal("requires_action")
|
|
7473
|
+
})),
|
|
7474
|
+
zUnknownStateUpdate.and(object({
|
|
7475
|
+
state: literal("unknown")
|
|
7476
|
+
})),
|
|
7477
|
+
excludeKnownTags(object({
|
|
7478
|
+
state: string2()
|
|
7479
|
+
}), "state", ["idle", "requires_action", "running", "unknown"])
|
|
7480
|
+
]), "state", ["idle", "requires_action", "running", "unknown"]);
|
|
7481
|
+
var zSubagentUpdate = object({
|
|
7482
|
+
sessionId: zSessionId,
|
|
7483
|
+
title: defaultOnError(string2().nullish(), () => {
|
|
7484
|
+
return;
|
|
7485
|
+
}),
|
|
7486
|
+
description: defaultOnError(string2().nullish(), () => {
|
|
7487
|
+
return;
|
|
7488
|
+
}),
|
|
7489
|
+
capabilities: defaultOnError(zSubagentSessionCapabilities.nullish(), () => {
|
|
7490
|
+
return;
|
|
7491
|
+
}),
|
|
7492
|
+
state: defaultOnError(zStateUpdate.nullish(), () => {
|
|
7493
|
+
return;
|
|
7494
|
+
}),
|
|
7495
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7496
|
+
return;
|
|
7497
|
+
})
|
|
7498
|
+
});
|
|
7499
|
+
var zSessionMessage = object({
|
|
7500
|
+
messageId: zMessageId,
|
|
7501
|
+
senderSessionId: defaultOnError(zSessionId.nullish(), () => {
|
|
7502
|
+
return;
|
|
7503
|
+
}),
|
|
7504
|
+
recipientSessionId: defaultOnError(zSessionId.nullish(), () => {
|
|
7505
|
+
return;
|
|
7506
|
+
}),
|
|
7507
|
+
content: defaultOnError(vecSkipError(zContentBlock).nullish(), () => {
|
|
7508
|
+
return;
|
|
7509
|
+
}),
|
|
7510
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7511
|
+
return;
|
|
7512
|
+
})
|
|
7513
|
+
});
|
|
7514
|
+
var zSessionMessageChunk = object({
|
|
7515
|
+
messageId: zMessageId,
|
|
7516
|
+
senderSessionId: defaultOnError(zSessionId.nullish(), () => {
|
|
7517
|
+
return;
|
|
7518
|
+
}),
|
|
7519
|
+
recipientSessionId: defaultOnError(zSessionId.nullish(), () => {
|
|
7520
|
+
return;
|
|
7521
|
+
}),
|
|
7522
|
+
content: zContentBlock,
|
|
7523
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7524
|
+
return;
|
|
7525
|
+
})
|
|
7526
|
+
});
|
|
7527
|
+
var zSessionUpdate = union([
|
|
7528
|
+
zContentChunk.and(object({
|
|
7529
|
+
sessionUpdate: literal("user_message_chunk")
|
|
7530
|
+
})),
|
|
7531
|
+
zContentChunk.and(object({
|
|
7532
|
+
sessionUpdate: literal("agent_message_chunk")
|
|
7533
|
+
})),
|
|
7534
|
+
zContentChunk.and(object({
|
|
7535
|
+
sessionUpdate: literal("agent_thought_chunk")
|
|
7536
|
+
})),
|
|
7537
|
+
zToolCall.and(object({
|
|
7538
|
+
sessionUpdate: literal("tool_call")
|
|
7539
|
+
})),
|
|
7540
|
+
zToolCallUpdate.and(object({
|
|
7576
7541
|
sessionUpdate: literal("tool_call_update")
|
|
7577
7542
|
})),
|
|
7578
7543
|
zPlan.and(object({
|
|
@@ -7607,6 +7572,15 @@ var zSessionUpdate = union([
|
|
|
7607
7572
|
})),
|
|
7608
7573
|
zCompactionSummaryChunk.and(object({
|
|
7609
7574
|
sessionUpdate: literal("compaction_summary_chunk")
|
|
7575
|
+
})),
|
|
7576
|
+
zSubagentUpdate.and(object({
|
|
7577
|
+
sessionUpdate: literal("subagent_update")
|
|
7578
|
+
})),
|
|
7579
|
+
zSessionMessage.and(object({
|
|
7580
|
+
sessionUpdate: literal("session_message")
|
|
7581
|
+
})),
|
|
7582
|
+
zSessionMessageChunk.and(object({
|
|
7583
|
+
sessionUpdate: literal("session_message_chunk")
|
|
7610
7584
|
}))
|
|
7611
7585
|
]);
|
|
7612
7586
|
var zSessionNotification = object({
|
|
@@ -7622,23 +7596,12 @@ var zCompleteElicitationNotification = object({
|
|
|
7622
7596
|
return;
|
|
7623
7597
|
})
|
|
7624
7598
|
});
|
|
7625
|
-
var zMessageMcpNotification = object({
|
|
7626
|
-
connectionId: zMcpConnectionId,
|
|
7627
|
-
method: string2(),
|
|
7628
|
-
params: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7629
|
-
return;
|
|
7630
|
-
}),
|
|
7631
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7632
|
-
return;
|
|
7633
|
-
})
|
|
7634
|
-
});
|
|
7635
7599
|
var zExtNotification = unknown();
|
|
7636
7600
|
var zAgentNotification = object({
|
|
7637
7601
|
method: string2(),
|
|
7638
7602
|
params: union([
|
|
7639
7603
|
zSessionNotification,
|
|
7640
7604
|
zCompleteElicitationNotification,
|
|
7641
|
-
zMessageMcpNotification,
|
|
7642
7605
|
zExtNotification
|
|
7643
7606
|
]).nullish()
|
|
7644
7607
|
});
|
|
@@ -7678,6 +7641,11 @@ var zClientSessionCapabilities = object({
|
|
|
7678
7641
|
return;
|
|
7679
7642
|
})
|
|
7680
7643
|
});
|
|
7644
|
+
var zSubagentCapabilities = object({
|
|
7645
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7646
|
+
return;
|
|
7647
|
+
})
|
|
7648
|
+
});
|
|
7681
7649
|
var zPlanCapabilities = object({
|
|
7682
7650
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7683
7651
|
return;
|
|
@@ -7710,41 +7678,15 @@ var zElicitationCapabilities = object({
|
|
|
7710
7678
|
return;
|
|
7711
7679
|
})
|
|
7712
7680
|
});
|
|
7713
|
-
var zNesJumpCapabilities = object({
|
|
7714
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7715
|
-
return;
|
|
7716
|
-
})
|
|
7717
|
-
});
|
|
7718
|
-
var zNesRenameCapabilities = object({
|
|
7719
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7720
|
-
return;
|
|
7721
|
-
})
|
|
7722
|
-
});
|
|
7723
|
-
var zNesSearchAndReplaceCapabilities = object({
|
|
7724
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7725
|
-
return;
|
|
7726
|
-
})
|
|
7727
|
-
});
|
|
7728
|
-
var zClientNesCapabilities = object({
|
|
7729
|
-
jump: defaultOnError(zNesJumpCapabilities.nullish(), () => {
|
|
7730
|
-
return;
|
|
7731
|
-
}),
|
|
7732
|
-
rename: defaultOnError(zNesRenameCapabilities.nullish(), () => {
|
|
7733
|
-
return;
|
|
7734
|
-
}),
|
|
7735
|
-
searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => {
|
|
7736
|
-
return;
|
|
7737
|
-
}),
|
|
7738
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7739
|
-
return;
|
|
7740
|
-
})
|
|
7741
|
-
});
|
|
7742
7681
|
var zClientCapabilities = object({
|
|
7743
7682
|
fs: defaultOnError(zFileSystemCapabilities.optional().default({ readTextFile: false, writeTextFile: false }), () => ({ readTextFile: false, writeTextFile: false })),
|
|
7744
7683
|
terminal: defaultOnError(boolean2().optional().default(false), () => false),
|
|
7745
7684
|
session: defaultOnError(zClientSessionCapabilities.nullish(), () => {
|
|
7746
7685
|
return;
|
|
7747
7686
|
}),
|
|
7687
|
+
subagents: defaultOnError(zSubagentCapabilities.nullish(), () => {
|
|
7688
|
+
return;
|
|
7689
|
+
}),
|
|
7748
7690
|
plan: defaultOnError(zPlanCapabilities.nullish(), () => {
|
|
7749
7691
|
return;
|
|
7750
7692
|
}),
|
|
@@ -7752,10 +7694,6 @@ var zClientCapabilities = object({
|
|
|
7752
7694
|
elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => {
|
|
7753
7695
|
return;
|
|
7754
7696
|
}),
|
|
7755
|
-
nes: defaultOnError(zClientNesCapabilities.nullish(), () => {
|
|
7756
|
-
return;
|
|
7757
|
-
}),
|
|
7758
|
-
positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),
|
|
7759
7697
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7760
7698
|
return;
|
|
7761
7699
|
})
|
|
@@ -7860,19 +7798,33 @@ var zMcpServer = union([
|
|
|
7860
7798
|
})),
|
|
7861
7799
|
zMcpServerStdio
|
|
7862
7800
|
]);
|
|
7801
|
+
var zSystemPromptMode = union([
|
|
7802
|
+
literal("append"),
|
|
7803
|
+
literal("override"),
|
|
7804
|
+
string2()
|
|
7805
|
+
]);
|
|
7806
|
+
var zSystemPrompt = object({
|
|
7807
|
+
mode: zSystemPromptMode,
|
|
7808
|
+
content: array(zContentBlock),
|
|
7809
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7810
|
+
return;
|
|
7811
|
+
})
|
|
7812
|
+
});
|
|
7863
7813
|
var zNewSessionRequest = object({
|
|
7864
7814
|
cwd: string2(),
|
|
7865
|
-
additionalDirectories:
|
|
7866
|
-
mcpServers:
|
|
7815
|
+
additionalDirectories: array(string2()).optional(),
|
|
7816
|
+
mcpServers: array(zMcpServer),
|
|
7817
|
+
systemPrompt: zSystemPrompt.nullish(),
|
|
7867
7818
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7868
7819
|
return;
|
|
7869
7820
|
})
|
|
7870
7821
|
});
|
|
7871
7822
|
var zLoadSessionRequest = object({
|
|
7872
|
-
mcpServers:
|
|
7823
|
+
mcpServers: array(zMcpServer),
|
|
7873
7824
|
cwd: string2(),
|
|
7874
|
-
additionalDirectories:
|
|
7825
|
+
additionalDirectories: array(string2()).optional(),
|
|
7875
7826
|
sessionId: zSessionId,
|
|
7827
|
+
systemPrompt: zSystemPrompt.nullish(),
|
|
7876
7828
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7877
7829
|
return;
|
|
7878
7830
|
})
|
|
@@ -7893,8 +7845,9 @@ var zDeleteSessionRequest = object({
|
|
|
7893
7845
|
var zForkSessionRequest = object({
|
|
7894
7846
|
sessionId: zSessionId,
|
|
7895
7847
|
cwd: string2(),
|
|
7896
|
-
additionalDirectories:
|
|
7897
|
-
mcpServers:
|
|
7848
|
+
additionalDirectories: array(string2()).optional(),
|
|
7849
|
+
mcpServers: array(zMcpServer).optional(),
|
|
7850
|
+
systemPrompt: zSystemPrompt.nullish(),
|
|
7898
7851
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7899
7852
|
return;
|
|
7900
7853
|
})
|
|
@@ -7902,8 +7855,9 @@ var zForkSessionRequest = object({
|
|
|
7902
7855
|
var zResumeSessionRequest = object({
|
|
7903
7856
|
sessionId: zSessionId,
|
|
7904
7857
|
cwd: string2(),
|
|
7905
|
-
additionalDirectories:
|
|
7906
|
-
mcpServers:
|
|
7858
|
+
additionalDirectories: array(string2()).optional(),
|
|
7859
|
+
mcpServers: array(zMcpServer).optional(),
|
|
7860
|
+
systemPrompt: zSystemPrompt.nullish(),
|
|
7907
7861
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7908
7862
|
return;
|
|
7909
7863
|
})
|
|
@@ -7943,138 +7897,6 @@ var zPromptRequest = object({
|
|
|
7943
7897
|
return;
|
|
7944
7898
|
})
|
|
7945
7899
|
});
|
|
7946
|
-
var zWorkspaceFolder = object({
|
|
7947
|
-
uri: string2(),
|
|
7948
|
-
name: string2(),
|
|
7949
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7950
|
-
return;
|
|
7951
|
-
})
|
|
7952
|
-
});
|
|
7953
|
-
var zNesRepository = object({
|
|
7954
|
-
name: string2(),
|
|
7955
|
-
owner: string2(),
|
|
7956
|
-
remoteUrl: string2(),
|
|
7957
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7958
|
-
return;
|
|
7959
|
-
})
|
|
7960
|
-
});
|
|
7961
|
-
var zStartNesRequest = object({
|
|
7962
|
-
workspaceUri: defaultOnError(string2().nullish(), () => {
|
|
7963
|
-
return;
|
|
7964
|
-
}),
|
|
7965
|
-
workspaceFolders: array(zWorkspaceFolder).nullish(),
|
|
7966
|
-
repository: defaultOnError(zNesRepository.nullish(), () => {
|
|
7967
|
-
return;
|
|
7968
|
-
}),
|
|
7969
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7970
|
-
return;
|
|
7971
|
-
})
|
|
7972
|
-
});
|
|
7973
|
-
var zNesTriggerKind = union([
|
|
7974
|
-
literal("automatic"),
|
|
7975
|
-
literal("diagnostic"),
|
|
7976
|
-
literal("manual")
|
|
7977
|
-
]);
|
|
7978
|
-
var zNesRecentFile = object({
|
|
7979
|
-
uri: string2(),
|
|
7980
|
-
languageId: string2(),
|
|
7981
|
-
text: string2(),
|
|
7982
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7983
|
-
return;
|
|
7984
|
-
})
|
|
7985
|
-
});
|
|
7986
|
-
var zNesExcerpt = object({
|
|
7987
|
-
startLine: int().gte(0).max(4294967295, {
|
|
7988
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
7989
|
-
}),
|
|
7990
|
-
endLine: int().gte(0).max(4294967295, {
|
|
7991
|
-
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
7992
|
-
}),
|
|
7993
|
-
text: string2(),
|
|
7994
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
7995
|
-
return;
|
|
7996
|
-
})
|
|
7997
|
-
});
|
|
7998
|
-
var zNesRelatedSnippet = object({
|
|
7999
|
-
uri: string2(),
|
|
8000
|
-
excerpts: array(zNesExcerpt),
|
|
8001
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8002
|
-
return;
|
|
8003
|
-
})
|
|
8004
|
-
});
|
|
8005
|
-
var zNesEditHistoryEntry = object({
|
|
8006
|
-
uri: string2(),
|
|
8007
|
-
diff: string2(),
|
|
8008
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8009
|
-
return;
|
|
8010
|
-
})
|
|
8011
|
-
});
|
|
8012
|
-
var zNesUserAction = object({
|
|
8013
|
-
action: string2(),
|
|
8014
|
-
uri: string2(),
|
|
8015
|
-
position: zPosition,
|
|
8016
|
-
timestampMs: number2(),
|
|
8017
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8018
|
-
return;
|
|
8019
|
-
})
|
|
8020
|
-
});
|
|
8021
|
-
var zNesOpenFile = object({
|
|
8022
|
-
uri: string2(),
|
|
8023
|
-
languageId: string2(),
|
|
8024
|
-
visibleRange: defaultOnError(zRange.nullish(), () => {
|
|
8025
|
-
return;
|
|
8026
|
-
}),
|
|
8027
|
-
lastFocusedMs: defaultOnError(number2().nullish(), () => {
|
|
8028
|
-
return;
|
|
8029
|
-
}),
|
|
8030
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8031
|
-
return;
|
|
8032
|
-
})
|
|
8033
|
-
});
|
|
8034
|
-
var zNesDiagnosticSeverity = union([
|
|
8035
|
-
literal("error"),
|
|
8036
|
-
literal("warning"),
|
|
8037
|
-
literal("information"),
|
|
8038
|
-
literal("hint")
|
|
8039
|
-
]);
|
|
8040
|
-
var zNesDiagnostic = object({
|
|
8041
|
-
uri: string2(),
|
|
8042
|
-
range: zRange,
|
|
8043
|
-
severity: zNesDiagnosticSeverity,
|
|
8044
|
-
message: string2(),
|
|
8045
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8046
|
-
return;
|
|
8047
|
-
})
|
|
8048
|
-
});
|
|
8049
|
-
var zNesSuggestContext = object({
|
|
8050
|
-
recentFiles: array(zNesRecentFile).nullish(),
|
|
8051
|
-
relatedSnippets: array(zNesRelatedSnippet).nullish(),
|
|
8052
|
-
editHistory: array(zNesEditHistoryEntry).nullish(),
|
|
8053
|
-
userActions: array(zNesUserAction).nullish(),
|
|
8054
|
-
openFiles: array(zNesOpenFile).nullish(),
|
|
8055
|
-
diagnostics: array(zNesDiagnostic).nullish(),
|
|
8056
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8057
|
-
return;
|
|
8058
|
-
})
|
|
8059
|
-
});
|
|
8060
|
-
var zSuggestNesRequest = object({
|
|
8061
|
-
sessionId: zSessionId,
|
|
8062
|
-
uri: string2(),
|
|
8063
|
-
version: number2(),
|
|
8064
|
-
position: zPosition,
|
|
8065
|
-
selection: zRange.nullish(),
|
|
8066
|
-
triggerKind: zNesTriggerKind,
|
|
8067
|
-
context: zNesSuggestContext.nullish(),
|
|
8068
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8069
|
-
return;
|
|
8070
|
-
})
|
|
8071
|
-
});
|
|
8072
|
-
var zCloseNesRequest = object({
|
|
8073
|
-
sessionId: zSessionId,
|
|
8074
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8075
|
-
return;
|
|
8076
|
-
})
|
|
8077
|
-
});
|
|
8078
7900
|
var zClientRequest = object({
|
|
8079
7901
|
id: zRequestId,
|
|
8080
7902
|
method: string2(),
|
|
@@ -8095,10 +7917,6 @@ var zClientRequest = object({
|
|
|
8095
7917
|
zSetSessionModeRequest,
|
|
8096
7918
|
zSetSessionConfigOptionRequest,
|
|
8097
7919
|
zPromptRequest,
|
|
8098
|
-
zStartNesRequest,
|
|
8099
|
-
zSuggestNesRequest,
|
|
8100
|
-
zCloseNesRequest,
|
|
8101
|
-
zMessageMcpRequest,
|
|
8102
7920
|
zExtRequest
|
|
8103
7921
|
]).nullish()
|
|
8104
7922
|
});
|
|
@@ -8213,17 +8031,29 @@ var zCreateElicitationResponse = preserveCustomPayload(intersection(union([
|
|
|
8213
8031
|
return;
|
|
8214
8032
|
})
|
|
8215
8033
|
})), "action", ["accept", "cancel", "decline"]);
|
|
8216
|
-
var
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8034
|
+
var zMcpError = looseObject({
|
|
8035
|
+
code: int().min(-2147483648, {
|
|
8036
|
+
error: "Invalid value: Expected int32 to be >= -2147483648"
|
|
8037
|
+
}).max(2147483647, {
|
|
8038
|
+
error: "Invalid value: Expected int32 to be <= 2147483647"
|
|
8039
|
+
}),
|
|
8040
|
+
message: string2(),
|
|
8041
|
+
data: unknown().optional()
|
|
8221
8042
|
});
|
|
8222
|
-
var
|
|
8223
|
-
|
|
8224
|
-
|
|
8043
|
+
var zMessageMcpResponse = union([
|
|
8044
|
+
object({
|
|
8045
|
+
result: unknown(),
|
|
8046
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8047
|
+
return;
|
|
8048
|
+
})
|
|
8049
|
+
}),
|
|
8050
|
+
object({
|
|
8051
|
+
error: zMcpError,
|
|
8052
|
+
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8053
|
+
return;
|
|
8054
|
+
})
|
|
8225
8055
|
})
|
|
8226
|
-
|
|
8056
|
+
]);
|
|
8227
8057
|
var zClientResponse = union([
|
|
8228
8058
|
object({
|
|
8229
8059
|
id: zRequestId,
|
|
@@ -8237,8 +8067,6 @@ var zClientResponse = union([
|
|
|
8237
8067
|
zWaitForTerminalExitResponse,
|
|
8238
8068
|
zKillTerminalResponse,
|
|
8239
8069
|
zCreateElicitationResponse,
|
|
8240
|
-
zConnectMcpResponse,
|
|
8241
|
-
zDisconnectMcpResponse,
|
|
8242
8070
|
zMessageMcpResponse,
|
|
8243
8071
|
zExtResponse
|
|
8244
8072
|
])
|
|
@@ -8254,93 +8082,18 @@ var zCancelNotification = object({
|
|
|
8254
8082
|
return;
|
|
8255
8083
|
})
|
|
8256
8084
|
});
|
|
8257
|
-
var
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
text: string2(),
|
|
8263
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8264
|
-
return;
|
|
8265
|
-
})
|
|
8266
|
-
});
|
|
8267
|
-
var zTextDocumentContentChangeEvent = object({
|
|
8268
|
-
range: zRange.nullish(),
|
|
8269
|
-
text: string2(),
|
|
8270
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8271
|
-
return;
|
|
8272
|
-
})
|
|
8273
|
-
});
|
|
8274
|
-
var zDidChangeDocumentNotification = object({
|
|
8275
|
-
sessionId: zSessionId,
|
|
8276
|
-
uri: string2(),
|
|
8277
|
-
version: number2(),
|
|
8278
|
-
contentChanges: requiredDefaultOnError(vecSkipError(zTextDocumentContentChangeEvent), () => []),
|
|
8279
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8280
|
-
return;
|
|
8281
|
-
})
|
|
8282
|
-
});
|
|
8283
|
-
var zDidCloseDocumentNotification = object({
|
|
8284
|
-
sessionId: zSessionId,
|
|
8285
|
-
uri: string2(),
|
|
8286
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8287
|
-
return;
|
|
8288
|
-
})
|
|
8289
|
-
});
|
|
8290
|
-
var zDidSaveDocumentNotification = object({
|
|
8291
|
-
sessionId: zSessionId,
|
|
8292
|
-
uri: string2(),
|
|
8293
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8294
|
-
return;
|
|
8295
|
-
})
|
|
8296
|
-
});
|
|
8297
|
-
var zDidFocusDocumentNotification = object({
|
|
8298
|
-
sessionId: zSessionId,
|
|
8299
|
-
uri: string2(),
|
|
8300
|
-
version: number2(),
|
|
8301
|
-
position: zPosition,
|
|
8302
|
-
visibleRange: zRange,
|
|
8303
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8304
|
-
return;
|
|
8305
|
-
})
|
|
8306
|
-
});
|
|
8307
|
-
var zAcceptNesNotification = object({
|
|
8308
|
-
sessionId: zSessionId,
|
|
8309
|
-
id: zNesSuggestionId,
|
|
8310
|
-
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8311
|
-
return;
|
|
8312
|
-
})
|
|
8313
|
-
});
|
|
8314
|
-
var zNesRejectReason = union([
|
|
8315
|
-
literal("rejected"),
|
|
8316
|
-
literal("ignored"),
|
|
8317
|
-
literal("replaced"),
|
|
8318
|
-
literal("cancelled")
|
|
8319
|
-
]);
|
|
8320
|
-
var zRejectNesNotification = object({
|
|
8321
|
-
sessionId: zSessionId,
|
|
8322
|
-
id: zNesSuggestionId,
|
|
8323
|
-
reason: defaultOnError(zNesRejectReason.nullish(), () => {
|
|
8324
|
-
return;
|
|
8325
|
-
}),
|
|
8085
|
+
var zMessageMcpNotification = object({
|
|
8086
|
+
serverId: zMcpServerAcpId,
|
|
8087
|
+
requestId: zMcpRequestId,
|
|
8088
|
+
method: string2(),
|
|
8089
|
+
params: record(string2(), unknown()).nullish(),
|
|
8326
8090
|
_meta: defaultOnError(record(string2(), unknown()).nullish(), () => {
|
|
8327
8091
|
return;
|
|
8328
8092
|
})
|
|
8329
8093
|
});
|
|
8330
8094
|
var zClientNotification = object({
|
|
8331
8095
|
method: string2(),
|
|
8332
|
-
params: union([
|
|
8333
|
-
zCancelNotification,
|
|
8334
|
-
zDidOpenDocumentNotification,
|
|
8335
|
-
zDidChangeDocumentNotification,
|
|
8336
|
-
zDidCloseDocumentNotification,
|
|
8337
|
-
zDidSaveDocumentNotification,
|
|
8338
|
-
zDidFocusDocumentNotification,
|
|
8339
|
-
zAcceptNesNotification,
|
|
8340
|
-
zRejectNesNotification,
|
|
8341
|
-
zMessageMcpNotification,
|
|
8342
|
-
zExtNotification
|
|
8343
|
-
]).nullish()
|
|
8096
|
+
params: union([zCancelNotification, zMessageMcpNotification, zExtNotification]).nullish()
|
|
8344
8097
|
});
|
|
8345
8098
|
var zCancelRequestNotification = object({
|
|
8346
8099
|
requestId: zRequestId,
|
|
@@ -9091,6 +8844,12 @@ class RequestError extends Error {
|
|
|
9091
8844
|
static resourceNotFound(uri) {
|
|
9092
8845
|
return new RequestError(-32002, `Resource not found${uri ? `: ${uri}` : ""}`, uri && { uri });
|
|
9093
8846
|
}
|
|
8847
|
+
static unsupportedProtocolVersion(requested, supported) {
|
|
8848
|
+
return new RequestError(-32022, "Unsupported protocol version", {
|
|
8849
|
+
requested,
|
|
8850
|
+
supported: [...supported]
|
|
8851
|
+
});
|
|
8852
|
+
}
|
|
9094
8853
|
toResult() {
|
|
9095
8854
|
return {
|
|
9096
8855
|
error: {
|
|
@@ -9344,6 +9103,27 @@ var zGuardElicitationPropertySchemaInteger = zIntegerPropertySchema.and(object({
|
|
|
9344
9103
|
var zGuardElicitationPropertySchemaBoolean = zBooleanPropertySchema.and(object({ type: literal("boolean") }));
|
|
9345
9104
|
var zGuardElicitationPropertySchemaArray = zMultiSelectPropertySchema.and(object({ type: literal("array") }));
|
|
9346
9105
|
var zGuardMultiSelectItemsString = zStringMultiSelectItems.and(object({ type: literal("string") }));
|
|
9106
|
+
var zGuardStateUpdateRunning = zRunningStateUpdate.and(object({ state: literal("running") }));
|
|
9107
|
+
var zGuardStateUpdateIdle = zIdleStateUpdate.and(object({ usage: zUsage.nullish() })).and(object({ state: literal("idle") }));
|
|
9108
|
+
var zGuardStateUpdateRequiresAction = zRequiresActionStateUpdate.and(object({ state: literal("requires_action") }));
|
|
9109
|
+
var zGuardStateUpdateUnknown = zUnknownStateUpdate.and(object({ state: literal("unknown") }));
|
|
9110
|
+
var zGuardIdleStateUpdateEndTurn = object({
|
|
9111
|
+
stopReason: literal("end_turn")
|
|
9112
|
+
});
|
|
9113
|
+
var zGuardIdleStateUpdateMaxTokens = object({
|
|
9114
|
+
stopReason: literal("max_tokens")
|
|
9115
|
+
});
|
|
9116
|
+
var zGuardIdleStateUpdateMaxTurnRequests = object({
|
|
9117
|
+
stopReason: literal("max_turn_requests")
|
|
9118
|
+
});
|
|
9119
|
+
var zGuardIdleStateUpdateRefusal = object({
|
|
9120
|
+
stopReason: literal("refusal")
|
|
9121
|
+
});
|
|
9122
|
+
var zGuardIdleStateUpdateCancelled = object({
|
|
9123
|
+
stopReason: literal("cancelled")
|
|
9124
|
+
});
|
|
9125
|
+
var zGuardIdleStateUpdateError = zErrorStopReason.and(object({ error: zError.nullish() })).and(object({ stopReason: literal("error") }));
|
|
9126
|
+
var zGuardIdleStateUpdateNone = object({ stopReason: _null3().optional() });
|
|
9347
9127
|
var zGuardCreateElicitationResponseAccept = zElicitationAcceptAction.and(object({ action: literal("accept") }));
|
|
9348
9128
|
var zGuardCreateElicitationResponseDecline = object({
|
|
9349
9129
|
action: literal("decline")
|
|
@@ -9397,20 +9177,6 @@ var methods = {
|
|
|
9397
9177
|
setConfigOption: AGENT_METHODS.session_set_config_option,
|
|
9398
9178
|
prompt: AGENT_METHODS.session_prompt,
|
|
9399
9179
|
cancel: AGENT_METHODS.session_cancel
|
|
9400
|
-
},
|
|
9401
|
-
nes: {
|
|
9402
|
-
start: AGENT_METHODS.nes_start,
|
|
9403
|
-
suggest: AGENT_METHODS.nes_suggest,
|
|
9404
|
-
accept: AGENT_METHODS.nes_accept,
|
|
9405
|
-
reject: AGENT_METHODS.nes_reject,
|
|
9406
|
-
close: AGENT_METHODS.nes_close
|
|
9407
|
-
},
|
|
9408
|
-
document: {
|
|
9409
|
-
didOpen: AGENT_METHODS.document_did_open,
|
|
9410
|
-
didChange: AGENT_METHODS.document_did_change,
|
|
9411
|
-
didClose: AGENT_METHODS.document_did_close,
|
|
9412
|
-
didSave: AGENT_METHODS.document_did_save,
|
|
9413
|
-
didFocus: AGENT_METHODS.document_did_focus
|
|
9414
9180
|
}
|
|
9415
9181
|
},
|
|
9416
9182
|
client: {
|
|
@@ -9779,7 +9545,11 @@ function parseParams(parser, params) {
|
|
|
9779
9545
|
return parser.parse(params);
|
|
9780
9546
|
}
|
|
9781
9547
|
function requestSpec(method, params, mapResponse) {
|
|
9782
|
-
return {
|
|
9548
|
+
return {
|
|
9549
|
+
method,
|
|
9550
|
+
params: (value) => parseParams(params, value ?? {}),
|
|
9551
|
+
mapResponse
|
|
9552
|
+
};
|
|
9783
9553
|
}
|
|
9784
9554
|
function notificationSpec(method, params) {
|
|
9785
9555
|
return { method, params };
|
|
@@ -9816,20 +9586,10 @@ var agentRequestSpecs = {
|
|
|
9816
9586
|
unstable_setProvider: requestSpec(AGENT_METHODS.providers_set, zSetProviderRequest, emptyObjectResponse),
|
|
9817
9587
|
unstable_disableProvider: requestSpec(AGENT_METHODS.providers_disable, zDisableProviderRequest, emptyObjectResponse),
|
|
9818
9588
|
logout: requestSpec(AGENT_METHODS.logout, zLogoutRequest, emptyObjectResponse),
|
|
9819
|
-
prompt: requestSpec(AGENT_METHODS.session_prompt, zPromptRequest)
|
|
9820
|
-
unstable_startNes: requestSpec(AGENT_METHODS.nes_start, zStartNesRequest),
|
|
9821
|
-
unstable_suggestNes: requestSpec(AGENT_METHODS.nes_suggest, zSuggestNesRequest),
|
|
9822
|
-
unstable_closeNes: requestSpec(AGENT_METHODS.nes_close, zCloseNesRequest, emptyObjectResponse)
|
|
9589
|
+
prompt: requestSpec(AGENT_METHODS.session_prompt, zPromptRequest)
|
|
9823
9590
|
};
|
|
9824
9591
|
var agentNotificationSpecs = {
|
|
9825
|
-
cancel: notificationSpec(AGENT_METHODS.session_cancel, zCancelNotification)
|
|
9826
|
-
unstable_didOpenDocument: notificationSpec(AGENT_METHODS.document_did_open, zDidOpenDocumentNotification),
|
|
9827
|
-
unstable_didChangeDocument: notificationSpec(AGENT_METHODS.document_did_change, zDidChangeDocumentNotification),
|
|
9828
|
-
unstable_didCloseDocument: notificationSpec(AGENT_METHODS.document_did_close, zDidCloseDocumentNotification),
|
|
9829
|
-
unstable_didSaveDocument: notificationSpec(AGENT_METHODS.document_did_save, zDidSaveDocumentNotification),
|
|
9830
|
-
unstable_didFocusDocument: notificationSpec(AGENT_METHODS.document_did_focus, zDidFocusDocumentNotification),
|
|
9831
|
-
unstable_acceptNes: notificationSpec(AGENT_METHODS.nes_accept, zAcceptNesNotification),
|
|
9832
|
-
unstable_rejectNes: notificationSpec(AGENT_METHODS.nes_reject, zRejectNesNotification)
|
|
9592
|
+
cancel: notificationSpec(AGENT_METHODS.session_cancel, zCancelNotification)
|
|
9833
9593
|
};
|
|
9834
9594
|
var clientRequestSpecs = {
|
|
9835
9595
|
requestPermission: requestSpec(CLIENT_METHODS.session_request_permission, zRequestPermissionRequest),
|
|
@@ -10032,20 +9792,10 @@ var legacyAgentRequestMethods = new Set([
|
|
|
10032
9792
|
AGENT_METHODS.session_fork,
|
|
10033
9793
|
AGENT_METHODS.session_resume,
|
|
10034
9794
|
AGENT_METHODS.session_close,
|
|
10035
|
-
AGENT_METHODS.logout
|
|
10036
|
-
AGENT_METHODS.nes_start,
|
|
10037
|
-
AGENT_METHODS.nes_suggest,
|
|
10038
|
-
AGENT_METHODS.nes_close
|
|
9795
|
+
AGENT_METHODS.logout
|
|
10039
9796
|
]);
|
|
10040
9797
|
var legacyAgentNotificationMethods = new Set([
|
|
10041
|
-
AGENT_METHODS.session_cancel
|
|
10042
|
-
AGENT_METHODS.nes_accept,
|
|
10043
|
-
AGENT_METHODS.nes_reject,
|
|
10044
|
-
AGENT_METHODS.document_did_open,
|
|
10045
|
-
AGENT_METHODS.document_did_change,
|
|
10046
|
-
AGENT_METHODS.document_did_close,
|
|
10047
|
-
AGENT_METHODS.document_did_save,
|
|
10048
|
-
AGENT_METHODS.document_did_focus
|
|
9798
|
+
AGENT_METHODS.session_cancel
|
|
10049
9799
|
]);
|
|
10050
9800
|
var legacyClientRequestMethods = new Set([
|
|
10051
9801
|
CLIENT_METHODS.session_request_permission,
|
|
@@ -10068,6 +9818,8 @@ var ACP_SDK_REQUEST_TIMEOUT_MS = 120000;
|
|
|
10068
9818
|
function createSdkStreamHandle(child) {
|
|
10069
9819
|
const stdoutBridge = new import_node_stream.PassThrough;
|
|
10070
9820
|
const stdinBridge = new import_node_stream.PassThrough;
|
|
9821
|
+
stdoutBridge.on("error", () => {});
|
|
9822
|
+
stdinBridge.on("error", () => {});
|
|
10071
9823
|
child.stdout.pipe(stdoutBridge);
|
|
10072
9824
|
stdinBridge.pipe(child.stdin, { end: false });
|
|
10073
9825
|
const output = import_node_stream.Writable.toWeb(stdinBridge);
|
|
@@ -10095,11 +9847,11 @@ function createSdkStreamHandle(child) {
|
|
|
10095
9847
|
}
|
|
10096
9848
|
};
|
|
10097
9849
|
}
|
|
10098
|
-
function connectSdkClient(child, configure, runtimeId) {
|
|
9850
|
+
function connectSdkClient(child, configure, runtimeId, options = {}) {
|
|
10099
9851
|
if (runtimeId && true) {
|
|
10100
9852
|
console.info(`[acp:sdk] connect runtime=${runtimeId} pid=${child.pid ?? "?"}`);
|
|
10101
9853
|
}
|
|
10102
|
-
const app = client({ name: "inkdown" });
|
|
9854
|
+
const app = client({ name: options.name ?? "inkdown" });
|
|
10103
9855
|
configure(app);
|
|
10104
9856
|
const streamHandle = createSdkStreamHandle(child);
|
|
10105
9857
|
const connection = app.connect(streamHandle.stream);
|
|
@@ -10129,7 +9881,7 @@ async function closeAcpSessions(agent, sessionIds, timeoutMs = 2000) {
|
|
|
10129
9881
|
const failed = [];
|
|
10130
9882
|
await Promise.all([...new Set(sessionIds)].map(async (sessionId) => {
|
|
10131
9883
|
try {
|
|
10132
|
-
await sdkRequest(agent,
|
|
9884
|
+
await sdkRequest(agent, methods.agent.session.close, { sessionId }, timeoutMs);
|
|
10133
9885
|
} catch {
|
|
10134
9886
|
failed.push(sessionId);
|
|
10135
9887
|
}
|
|
@@ -11176,18 +10928,49 @@ function mergeOpenCodeAppConfig(raw, directory) {
|
|
|
11176
10928
|
skills: { ...skills, paths: [...new Set([...skills.paths ?? [], import_node_path8.join(directory, "skills")])] }
|
|
11177
10929
|
});
|
|
11178
10930
|
}
|
|
10931
|
+
function resolveOpenCodeQuestionMode(version) {
|
|
10932
|
+
const normalized = version.trim().replace(/^opencode\s+v?/i, "");
|
|
10933
|
+
return ["1.18.35", "2.0.6"].includes(normalized) ? "fallback" : "unverified";
|
|
10934
|
+
}
|
|
10935
|
+
function mergeOpenCodeQuestionConfig(raw) {
|
|
10936
|
+
const value = raw?.trim() ? JSON.parse(raw) : {};
|
|
10937
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
10938
|
+
throw new Error("invalid-opencode-config");
|
|
10939
|
+
const config = value;
|
|
10940
|
+
const permission = config.permission;
|
|
10941
|
+
if (permission !== undefined && (typeof permission !== "string" || !["allow", "ask", "deny"].includes(permission)) && (!permission || typeof permission !== "object" || Array.isArray(permission)))
|
|
10942
|
+
throw new Error("invalid-opencode-permission");
|
|
10943
|
+
const rules = typeof permission === "string" ? { "*": permission } : permission ?? {};
|
|
10944
|
+
return JSON.stringify({ ...config, permission: { ...rules, question: "deny" } });
|
|
10945
|
+
}
|
|
11179
10946
|
async function prepareOpenCodeResources(input) {
|
|
11180
10947
|
const prep = prepareCompatibilityResources(input.directory, "native-entry-not-verified");
|
|
11181
|
-
|
|
10948
|
+
prep.report.openCodeQuestions = { mode: "unverified", configuration: "unchanged", reason: "version-not-verified" };
|
|
10949
|
+
if (!input.command)
|
|
11182
10950
|
return prep;
|
|
11183
10951
|
try {
|
|
11184
10952
|
const { stdout } = await import_node_util.promisify(import_node_child_process2.execFile)(input.command, ["--version"], { env: input.env, timeout: 8000, windowsHide: true });
|
|
11185
|
-
|
|
10953
|
+
const version = stdout.trim().replace(/^opencode\s+v?/i, "");
|
|
10954
|
+
if (resolveOpenCodeQuestionMode(version) !== "fallback") {
|
|
10955
|
+
prep.report.openCodeQuestions.version = version;
|
|
11186
10956
|
return prep;
|
|
11187
|
-
|
|
11188
|
-
|
|
10957
|
+
}
|
|
10958
|
+
let json = mergeOpenCodeQuestionConfig(input.env?.OPENCODE_CONFIG_CONTENT);
|
|
10959
|
+
const hasRules = version === "1.18.35" && !!readAppRulesText(input.directory);
|
|
10960
|
+
if (hasRules)
|
|
10961
|
+
json = mergeOpenCodeAppConfig(json, input.directory);
|
|
10962
|
+
return { env: { OPENCODE_CONFIG_CONTENT: json }, report: {
|
|
10963
|
+
...prep.report,
|
|
10964
|
+
rulesPrepared: hasRules,
|
|
10965
|
+
reason: hasRules ? undefined : version === "2.0.6" ? "native-entry-not-verified" : "missing-app-rules",
|
|
10966
|
+
openCodeQuestions: { version, mode: "fallback", configuration: "prepared", reason: "acp-question-not-forwarded" }
|
|
10967
|
+
} };
|
|
11189
10968
|
} catch {
|
|
11190
|
-
return { ...prep, report: {
|
|
10969
|
+
return { ...prep, report: {
|
|
10970
|
+
...prep.report,
|
|
10971
|
+
reason: "native-config-prepare-failed",
|
|
10972
|
+
openCodeQuestions: { mode: "unverified", configuration: "unchanged", reason: "prepare-failed" }
|
|
10973
|
+
} };
|
|
11191
10974
|
}
|
|
11192
10975
|
}
|
|
11193
10976
|
function prepareClaudeResources(directory) {
|
|
@@ -11783,7 +11566,7 @@ var opencodeAdapter = {
|
|
|
11783
11566
|
// src/runtimes/opencode-v2/index.ts
|
|
11784
11567
|
var opencodeV2Adapter = {
|
|
11785
11568
|
id: "opencode-v2",
|
|
11786
|
-
prepareAppResources:
|
|
11569
|
+
prepareAppResources: prepareOpenCodeResources,
|
|
11787
11570
|
probeAuth: () => probeOpencodeAuth(),
|
|
11788
11571
|
orderAuthMethods: (methods) => methods,
|
|
11789
11572
|
canSkipInteractiveAuth: () => false,
|
|
@@ -12915,29 +12698,30 @@ function isTransientAcpTransportError(error) {
|
|
|
12915
12698
|
return /ACP connection closed|connection closed|closed|abort|超时|timeout|timed out|econnreset|epipe|stdio|stream/i.test(message);
|
|
12916
12699
|
}
|
|
12917
12700
|
async function restoreOrCreateAcpSession(input) {
|
|
12918
|
-
const resumeId = input.resumeSessionId?.trim() || null;
|
|
12919
|
-
const restoreAttempts = [];
|
|
12920
12701
|
let mcpServersAccepted = (input.mcpServers ?? []).length > 0;
|
|
12921
12702
|
let nativeSessionAccepted = false;
|
|
12703
|
+
let recoveredToolOutputs;
|
|
12922
12704
|
const request = async (method, params) => {
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12705
|
+
const opened = await requestSessionWithResources(input.request, method, params, input.sessionMeta);
|
|
12706
|
+
nativeSessionAccepted = opened.nativeSessionAccepted;
|
|
12707
|
+
const meta = opened.result._meta;
|
|
12708
|
+
const outputs = meta?.toolOutputRecovery?.outputs;
|
|
12709
|
+
let total = 0;
|
|
12710
|
+
recoveredToolOutputs = Array.isArray(outputs) ? outputs.slice(0, 20).filter((row) => {
|
|
12711
|
+
if (!row || typeof row.toolCallId !== "string" || row.toolCallId.length > 120 || typeof row.text !== "string")
|
|
12712
|
+
return false;
|
|
12713
|
+
const bytes = Buffer.byteLength(row.text);
|
|
12714
|
+
if (bytes > 128 * 1024 || total + bytes > 256 * 1024)
|
|
12715
|
+
return false;
|
|
12716
|
+
total += bytes;
|
|
12717
|
+
return true;
|
|
12718
|
+
}) : undefined;
|
|
12719
|
+
return opened.result;
|
|
12938
12720
|
};
|
|
12721
|
+
const resumeId = input.resumeSessionId?.trim() || null;
|
|
12722
|
+
const restoreAttempts = [];
|
|
12939
12723
|
const delayMs = input.retryDelayMs ?? 250;
|
|
12940
|
-
const
|
|
12724
|
+
const outputLog = input.log ?? ((level, message, data) => {
|
|
12941
12725
|
if (level === "info" && false)
|
|
12942
12726
|
;
|
|
12943
12727
|
const line = `[acp] ${message}`;
|
|
@@ -12946,6 +12730,7 @@ async function restoreOrCreateAcpSession(input) {
|
|
|
12946
12730
|
else
|
|
12947
12731
|
console.info(line, data ?? "");
|
|
12948
12732
|
});
|
|
12733
|
+
const log = outputLog;
|
|
12949
12734
|
const tryRestoreMethod = async (method, rpcMethod) => {
|
|
12950
12735
|
const maxTries = 2;
|
|
12951
12736
|
let lastError = "";
|
|
@@ -12996,19 +12781,17 @@ async function restoreOrCreateAcpSession(input) {
|
|
|
12996
12781
|
mcpServers: input.mcpServers ?? []
|
|
12997
12782
|
};
|
|
12998
12783
|
try {
|
|
12999
|
-
return await request(
|
|
12784
|
+
return await request(methods.agent.session.new, baseParams);
|
|
13000
12785
|
} catch (firstError) {
|
|
13001
12786
|
if ((input.mcpServers ?? []).length === 0)
|
|
13002
12787
|
throw firstError;
|
|
13003
|
-
log("warn", "session/new failed, retry without mcpServers", {
|
|
12788
|
+
log("warn", input.preserveMcpOnRetry ? "session/new failed, retry with mcpServers" : "session/new failed, retry without mcpServers", {
|
|
13004
12789
|
error: errorMessage(firstError)
|
|
13005
12790
|
});
|
|
13006
12791
|
try {
|
|
13007
|
-
const
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
});
|
|
13011
|
-
mcpServersAccepted = false;
|
|
12792
|
+
const retryServers = input.preserveMcpOnRetry ? input.mcpServers ?? [] : [];
|
|
12793
|
+
const result = await request(methods.agent.session.new, { cwd: input.cwd, mcpServers: retryServers });
|
|
12794
|
+
mcpServersAccepted = retryServers.length > 0;
|
|
13012
12795
|
return result;
|
|
13013
12796
|
} catch {
|
|
13014
12797
|
throw firstError;
|
|
@@ -13017,16 +12800,17 @@ async function restoreOrCreateAcpSession(input) {
|
|
|
13017
12800
|
};
|
|
13018
12801
|
const withModelsFallback = (result) => mergeTopLevelModelsIntoConfigOptions(result.configOptions, result);
|
|
13019
12802
|
if (resumeId && input.resumeSupported) {
|
|
13020
|
-
const resumed = await tryRestoreMethod("resume",
|
|
12803
|
+
const resumed = await tryRestoreMethod("resume", methods.agent.session.resume);
|
|
13021
12804
|
if (resumed) {
|
|
13022
12805
|
const id = typeof resumed.sessionId === "string" ? resumed.sessionId : resumeId;
|
|
13023
12806
|
return {
|
|
13024
12807
|
sessionId: id,
|
|
12808
|
+
mcpServersAccepted,
|
|
12809
|
+
recoveredToolOutputs,
|
|
12810
|
+
nativeSessionAccepted,
|
|
13025
12811
|
configOptions: withModelsFallback(resumed),
|
|
13026
12812
|
restoreMethod: "resume",
|
|
13027
12813
|
sessionRestored: true,
|
|
13028
|
-
mcpServersAccepted,
|
|
13029
|
-
nativeSessionAccepted,
|
|
13030
12814
|
requestedSessionId: resumeId,
|
|
13031
12815
|
restoreAttempts
|
|
13032
12816
|
};
|
|
@@ -13037,16 +12821,17 @@ async function restoreOrCreateAcpSession(input) {
|
|
|
13037
12821
|
if (resumeId && input.loadSupported) {
|
|
13038
12822
|
input.onSuppressUpdates?.(true);
|
|
13039
12823
|
try {
|
|
13040
|
-
const loaded = await tryRestoreMethod("load",
|
|
12824
|
+
const loaded = await tryRestoreMethod("load", methods.agent.session.load);
|
|
13041
12825
|
if (loaded) {
|
|
13042
12826
|
const id = typeof loaded.sessionId === "string" ? loaded.sessionId : resumeId;
|
|
13043
12827
|
return {
|
|
13044
12828
|
sessionId: id,
|
|
12829
|
+
mcpServersAccepted,
|
|
12830
|
+
recoveredToolOutputs,
|
|
12831
|
+
nativeSessionAccepted,
|
|
13045
12832
|
configOptions: withModelsFallback(loaded),
|
|
13046
12833
|
restoreMethod: "load",
|
|
13047
12834
|
sessionRestored: true,
|
|
13048
|
-
mcpServersAccepted,
|
|
13049
|
-
nativeSessionAccepted,
|
|
13050
12835
|
requestedSessionId: resumeId,
|
|
13051
12836
|
restoreAttempts
|
|
13052
12837
|
};
|
|
@@ -13065,15 +12850,27 @@ async function restoreOrCreateAcpSession(input) {
|
|
|
13065
12850
|
}
|
|
13066
12851
|
return {
|
|
13067
12852
|
sessionId: newSessionId,
|
|
12853
|
+
mcpServersAccepted,
|
|
12854
|
+
nativeSessionAccepted,
|
|
13068
12855
|
configOptions: withModelsFallback(sessionResult),
|
|
13069
12856
|
restoreMethod: "new",
|
|
13070
12857
|
sessionRestored: false,
|
|
13071
|
-
mcpServersAccepted,
|
|
13072
|
-
nativeSessionAccepted,
|
|
13073
12858
|
requestedSessionId: resumeId ?? undefined,
|
|
13074
12859
|
restoreAttempts
|
|
13075
12860
|
};
|
|
13076
12861
|
}
|
|
12862
|
+
async function requestSessionWithResources(request, method, params, sessionMeta) {
|
|
12863
|
+
if (!sessionMeta)
|
|
12864
|
+
return { result: await request(method, params), nativeSessionAccepted: false };
|
|
12865
|
+
try {
|
|
12866
|
+
return { result: await request(method, { ...params, _meta: sessionMeta }), nativeSessionAccepted: true };
|
|
12867
|
+
} catch (error) {
|
|
12868
|
+
const rejected = error instanceof RequestError && error.code === -32602 || /native.*meta.*reject|unsupported.*(meta|systemPrompt)|unknown.*(meta|systemPrompt)/i.test(errorMessage(error));
|
|
12869
|
+
if (!rejected || isTransientAcpTransportError(error))
|
|
12870
|
+
throw error;
|
|
12871
|
+
return { result: await request(method, params), nativeSessionAccepted: false };
|
|
12872
|
+
}
|
|
12873
|
+
}
|
|
13077
12874
|
|
|
13078
12875
|
// src/client/acp-terminal.ts
|
|
13079
12876
|
var import_node_child_process7 = require("node:child_process");
|
|
@@ -13574,6 +13371,13 @@ class AcpClient {
|
|
|
13574
13371
|
}
|
|
13575
13372
|
this.sessionConfig = profile;
|
|
13576
13373
|
resourceEnv = this.sessionConfig.env;
|
|
13374
|
+
const interactions = ["opencode", "opencode-v2"].includes(this.runtimeInfo.id) && this.adapter.prepareAppResources ? await this.adapter.prepareAppResources({
|
|
13375
|
+
directory: this.resourcesDir,
|
|
13376
|
+
command: effectiveRuntime.command,
|
|
13377
|
+
workspaceRoot: this.workspaceRoot,
|
|
13378
|
+
env: { ...process.env, ...spawnEnv.env, ...resourceEnv }
|
|
13379
|
+
}) : undefined;
|
|
13380
|
+
Object.assign(resourceEnv, interactions?.env);
|
|
13577
13381
|
const load = readAppResourcesDir(this.resourcesDir);
|
|
13578
13382
|
this.resourcePrep = { profileTag: null, report: {
|
|
13579
13383
|
rulesApplied: false,
|
|
@@ -13582,6 +13386,7 @@ class AcpClient {
|
|
|
13582
13386
|
rulesChars: load.rules?.chars ?? 0,
|
|
13583
13387
|
profileDigest: digestAppResources(load),
|
|
13584
13388
|
skillsFound: load.skills.map((s) => s.name),
|
|
13389
|
+
openCodeQuestions: interactions?.report.openCodeQuestions,
|
|
13585
13390
|
configurationScope: "session",
|
|
13586
13391
|
configurationDirectory: this.sessionConfig.directory,
|
|
13587
13392
|
configurationRulesFile: this.sessionConfig.rulesFile,
|