lody 0.46.3-next.1 → 0.47.1
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 +673 -552
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -22780,7 +22780,7 @@ Event: ${getEventDescription(event)}`);
|
|
|
22780
22780
|
const mergedOptions = {
|
|
22781
22781
|
...options,
|
|
22782
22782
|
dsn: options.dsn ?? "https://080f9de535ff335a1a0440d0e385f796@o4510491299086336.ingest.us.sentry.io/4510559045681152",
|
|
22783
|
-
environment: options.environment ?? "
|
|
22783
|
+
environment: options.environment ?? "production",
|
|
22784
22784
|
sendClientReports: options.sendClientReports ?? true,
|
|
22785
22785
|
transport: options.transport ?? makeNodeTransport,
|
|
22786
22786
|
stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
|
|
@@ -36820,7 +36820,7 @@ Mongoose Error Code: ${error2.code}` : ""}`
|
|
|
36820
36820
|
return client;
|
|
36821
36821
|
}
|
|
36822
36822
|
const name = "lody";
|
|
36823
|
-
const version$4 = "0.
|
|
36823
|
+
const version$4 = "0.47.1";
|
|
36824
36824
|
const description = "Lody Agent CLI tool for managing remote command execution";
|
|
36825
36825
|
const type = "module";
|
|
36826
36826
|
const main$3 = "dist/index.js";
|
|
@@ -36864,7 +36864,7 @@ Mongoose Error Code: ${error2.code}` : ""}`
|
|
|
36864
36864
|
};
|
|
36865
36865
|
const optionalDependencies = {
|
|
36866
36866
|
"acp-extension-claude": "0.30.0",
|
|
36867
|
-
"acp-extension-codex": "0.12.
|
|
36867
|
+
"acp-extension-codex": "0.12.2"
|
|
36868
36868
|
};
|
|
36869
36869
|
const devDependencies = {
|
|
36870
36870
|
"@agentclientprotocol/sdk": "catalog:",
|
|
@@ -37068,15 +37068,15 @@ Mongoose Error Code: ${error2.code}` : ""}`
|
|
|
37068
37068
|
return "dev";
|
|
37069
37069
|
}
|
|
37070
37070
|
};
|
|
37071
|
-
const getRuntimeEnv = () => normalizeRuntimeEnv("
|
|
37071
|
+
const getRuntimeEnv = () => normalizeRuntimeEnv("production");
|
|
37072
37072
|
const isDevEnv = () => getRuntimeEnv() === "dev";
|
|
37073
37073
|
const runtimeEnv = getRuntimeEnv();
|
|
37074
|
-
const environment$1 = "
|
|
37074
|
+
const environment$1 = "production";
|
|
37075
37075
|
const dsn = "https://080f9de535ff335a1a0440d0e385f796@o4510491299086336.ingest.us.sentry.io/4510559045681152";
|
|
37076
37076
|
const postHogHost = process.env.LODY_POSTHOG_HOST ?? "https://us.i.posthog.com";
|
|
37077
37077
|
const postHogKey = process.env.LODY_POSTHOG_KEY ?? "phc_LFS5i5WIwg4irAhrG5oJR04iYPhReVZ3DdFZOKqCkjG";
|
|
37078
|
-
const tracesSampleRate = Number(process.env.SENTRY_TRACES_SAMPLE_RATE) ||
|
|
37079
|
-
const profilesSampleRate = Number(process.env.SENTRY_PROFILES_SAMPLE_RATE) || 0.
|
|
37078
|
+
const tracesSampleRate = Number(process.env.SENTRY_TRACES_SAMPLE_RATE) || 0.2;
|
|
37079
|
+
const profilesSampleRate = Number(process.env.SENTRY_PROFILES_SAMPLE_RATE) || 0.1;
|
|
37080
37080
|
const sentryEnabled = runtimeEnv !== "dev" && true;
|
|
37081
37081
|
const postHogEnabled = runtimeEnv !== "dev" && process.env.LODY_POSTHOG_DISABLED !== "1";
|
|
37082
37082
|
const release = `${name}@${version$4}`;
|
|
@@ -64257,14 +64257,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
64257
64257
|
};
|
|
64258
64258
|
return new ZodObject(def);
|
|
64259
64259
|
}
|
|
64260
|
-
function looseObject(shape, params) {
|
|
64261
|
-
return new ZodObject({
|
|
64262
|
-
type: "object",
|
|
64263
|
-
shape,
|
|
64264
|
-
catchall: unknown(),
|
|
64265
|
-
...normalizeParams(params)
|
|
64266
|
-
});
|
|
64267
|
-
}
|
|
64268
64260
|
const ZodUnion = $constructor("ZodUnion", (inst, def) => {
|
|
64269
64261
|
$ZodUnion.init(inst, def);
|
|
64270
64262
|
ZodType.init(inst, def);
|
|
@@ -64608,16 +64600,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
64608
64600
|
}
|
|
64609
64601
|
return _v4(options, buf, offset2);
|
|
64610
64602
|
}
|
|
64611
|
-
let LODY_AUTH_URL = "https://
|
|
64603
|
+
let LODY_AUTH_URL = "https://nautical-curlew-181.convex.cloud";
|
|
64612
64604
|
let LODY_AUTH_SITE_URL = "";
|
|
64613
|
-
let LODY_SERVER_URL = "https://lody
|
|
64614
|
-
let SITE_URL = "https://
|
|
64605
|
+
let LODY_SERVER_URL = "https://api.lody.ai";
|
|
64606
|
+
let SITE_URL = "https://lody.ai";
|
|
64615
64607
|
let SITE_APP_BASE_PATH = "";
|
|
64616
64608
|
const loadEnv = () => {
|
|
64617
|
-
LODY_AUTH_URL = "https://
|
|
64609
|
+
LODY_AUTH_URL = "https://nautical-curlew-181.convex.cloud";
|
|
64618
64610
|
LODY_AUTH_SITE_URL = "";
|
|
64619
|
-
LODY_SERVER_URL = "https://lody
|
|
64620
|
-
SITE_URL = "https://
|
|
64611
|
+
LODY_SERVER_URL = "https://api.lody.ai";
|
|
64612
|
+
SITE_URL = "https://lody.ai";
|
|
64621
64613
|
SITE_APP_BASE_PATH = process.env["SITE_APP_BASE_PATH"] ?? "";
|
|
64622
64614
|
};
|
|
64623
64615
|
const MACHINE_ID_FILE_NAME = "machine-id";
|
|
@@ -78827,12 +78819,12 @@ Task description:
|
|
|
78827
78819
|
{
|
|
78828
78820
|
id: "cline",
|
|
78829
78821
|
name: "Cline",
|
|
78830
|
-
version: "2.
|
|
78822
|
+
version: "2.17.0",
|
|
78831
78823
|
description: "Autonomous coding agent CLI - capable of creating/editing files, running commands, using the browser, and more",
|
|
78832
78824
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/cline.svg",
|
|
78833
78825
|
distribution: {
|
|
78834
78826
|
npx: {
|
|
78835
|
-
package: "cline@2.
|
|
78827
|
+
package: "cline@2.17.0",
|
|
78836
78828
|
args: [
|
|
78837
78829
|
"--acp"
|
|
78838
78830
|
]
|
|
@@ -78842,12 +78834,12 @@ Task description:
|
|
|
78842
78834
|
{
|
|
78843
78835
|
id: "codebuddy-code",
|
|
78844
78836
|
name: "Codebuddy Code",
|
|
78845
|
-
version: "2.93.
|
|
78837
|
+
version: "2.93.7",
|
|
78846
78838
|
description: "Tencent Cloud's official intelligent coding tool",
|
|
78847
78839
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/codebuddy-code.svg",
|
|
78848
78840
|
distribution: {
|
|
78849
78841
|
npx: {
|
|
78850
|
-
package: "@tencent-ai/codebuddy-code@2.93.
|
|
78842
|
+
package: "@tencent-ai/codebuddy-code@2.93.7",
|
|
78851
78843
|
args: [
|
|
78852
78844
|
"--acp"
|
|
78853
78845
|
]
|
|
@@ -78887,16 +78879,16 @@ Task description:
|
|
|
78887
78879
|
{
|
|
78888
78880
|
id: "factory-droid",
|
|
78889
78881
|
name: "Factory Droid",
|
|
78890
|
-
version: "0.
|
|
78882
|
+
version: "0.109.1",
|
|
78891
78883
|
description: "Factory Droid - AI coding agent powered by Factory AI",
|
|
78892
78884
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/factory-droid.svg",
|
|
78893
78885
|
distribution: {
|
|
78894
78886
|
npx: {
|
|
78895
|
-
package: "droid@0.
|
|
78887
|
+
package: "droid@0.109.1",
|
|
78896
78888
|
args: [
|
|
78897
78889
|
"exec",
|
|
78898
78890
|
"--output-format",
|
|
78899
|
-
"acp"
|
|
78891
|
+
"acp-daemon"
|
|
78900
78892
|
],
|
|
78901
78893
|
env: {
|
|
78902
78894
|
DROID_DISABLE_AUTO_UPDATE: "true",
|
|
@@ -78908,12 +78900,12 @@ Task description:
|
|
|
78908
78900
|
{
|
|
78909
78901
|
id: "gemini",
|
|
78910
78902
|
name: "Gemini CLI",
|
|
78911
|
-
version: "0.
|
|
78903
|
+
version: "0.39.1",
|
|
78912
78904
|
description: "Google's official CLI for Gemini",
|
|
78913
78905
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/gemini.svg",
|
|
78914
78906
|
distribution: {
|
|
78915
78907
|
npx: {
|
|
78916
|
-
package: "@google/gemini-cli@0.
|
|
78908
|
+
package: "@google/gemini-cli@0.39.1",
|
|
78917
78909
|
args: [
|
|
78918
78910
|
"--acp"
|
|
78919
78911
|
]
|
|
@@ -78923,12 +78915,12 @@ Task description:
|
|
|
78923
78915
|
{
|
|
78924
78916
|
id: "github-copilot-cli",
|
|
78925
78917
|
name: "GitHub Copilot",
|
|
78926
|
-
version: "1.0.
|
|
78918
|
+
version: "1.0.36",
|
|
78927
78919
|
description: "GitHub's AI pair programmer",
|
|
78928
78920
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/github-copilot-cli.svg",
|
|
78929
78921
|
distribution: {
|
|
78930
78922
|
npx: {
|
|
78931
|
-
package: "@github/copilot@1.0.
|
|
78923
|
+
package: "@github/copilot@1.0.36",
|
|
78932
78924
|
args: [
|
|
78933
78925
|
"--acp"
|
|
78934
78926
|
]
|
|
@@ -78938,7 +78930,7 @@ Task description:
|
|
|
78938
78930
|
{
|
|
78939
78931
|
id: "goose",
|
|
78940
78932
|
name: "goose",
|
|
78941
|
-
version: "1.
|
|
78933
|
+
version: "1.32.0",
|
|
78942
78934
|
description: "A local, extensible, open source AI agent that automates engineering tasks",
|
|
78943
78935
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/goose.svg",
|
|
78944
78936
|
distribution: {
|
|
@@ -78974,12 +78966,12 @@ Task description:
|
|
|
78974
78966
|
{
|
|
78975
78967
|
id: "kilo",
|
|
78976
78968
|
name: "Kilo",
|
|
78977
|
-
version: "7.2.
|
|
78969
|
+
version: "7.2.24",
|
|
78978
78970
|
description: "The open source coding agent",
|
|
78979
78971
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/kilo.svg",
|
|
78980
78972
|
distribution: {
|
|
78981
78973
|
npx: {
|
|
78982
|
-
package: "@kilocode/cli@7.2.
|
|
78974
|
+
package: "@kilocode/cli@7.2.24",
|
|
78983
78975
|
args: [
|
|
78984
78976
|
"acp"
|
|
78985
78977
|
]
|
|
@@ -78989,7 +78981,7 @@ Task description:
|
|
|
78989
78981
|
{
|
|
78990
78982
|
id: "kimi",
|
|
78991
78983
|
name: "Kimi CLI",
|
|
78992
|
-
version: "1.
|
|
78984
|
+
version: "1.39.0",
|
|
78993
78985
|
description: "Moonshot AI's coding assistant",
|
|
78994
78986
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/kimi.svg",
|
|
78995
78987
|
distribution: {
|
|
@@ -79056,7 +79048,7 @@ Task description:
|
|
|
79056
79048
|
{
|
|
79057
79049
|
id: "opencode",
|
|
79058
79050
|
name: "OpenCode",
|
|
79059
|
-
version: "1.14.
|
|
79051
|
+
version: "1.14.28",
|
|
79060
79052
|
description: "The open source coding agent",
|
|
79061
79053
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/opencode.svg",
|
|
79062
79054
|
distribution: {
|
|
@@ -79086,12 +79078,12 @@ Task description:
|
|
|
79086
79078
|
{
|
|
79087
79079
|
id: "qoder",
|
|
79088
79080
|
name: "Qoder CLI",
|
|
79089
|
-
version: "0.1.
|
|
79081
|
+
version: "0.1.48",
|
|
79090
79082
|
description: "AI coding assistant with agentic capabilities",
|
|
79091
79083
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/qoder.svg",
|
|
79092
79084
|
distribution: {
|
|
79093
79085
|
npx: {
|
|
79094
|
-
package: "@qoder-ai/qodercli@0.1.
|
|
79086
|
+
package: "@qoder-ai/qodercli@0.1.48",
|
|
79095
79087
|
args: [
|
|
79096
79088
|
"--acp"
|
|
79097
79089
|
]
|
|
@@ -79101,12 +79093,12 @@ Task description:
|
|
|
79101
79093
|
{
|
|
79102
79094
|
id: "qwen-code",
|
|
79103
79095
|
name: "Qwen Code",
|
|
79104
|
-
version: "0.
|
|
79096
|
+
version: "0.15.3",
|
|
79105
79097
|
description: "Alibaba's Qwen coding assistant",
|
|
79106
79098
|
icon: "https://cdn.agentclientprotocol.com/registry/v1/latest/qwen-code.svg",
|
|
79107
79099
|
distribution: {
|
|
79108
79100
|
npx: {
|
|
79109
|
-
package: "@qwen-code/qwen-code@0.
|
|
79101
|
+
package: "@qwen-code/qwen-code@0.15.3",
|
|
79110
79102
|
args: [
|
|
79111
79103
|
"--acp",
|
|
79112
79104
|
"--experimental-skills"
|
|
@@ -79291,24 +79283,24 @@ Task description:
|
|
|
79291
79283
|
const record2 = meta;
|
|
79292
79284
|
return record2.claudeCode !== void 0;
|
|
79293
79285
|
};
|
|
79294
|
-
const zAuthCapabilities =
|
|
79286
|
+
const zAuthCapabilities = object({
|
|
79295
79287
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79296
79288
|
terminal: boolean().optional().default(false)
|
|
79297
79289
|
});
|
|
79298
|
-
const zAuthEnvVar =
|
|
79290
|
+
const zAuthEnvVar = object({
|
|
79299
79291
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79300
79292
|
label: string$2().nullish(),
|
|
79301
79293
|
name: string$2(),
|
|
79302
79294
|
optional: boolean().optional().default(false),
|
|
79303
79295
|
secret: boolean().optional().default(true)
|
|
79304
79296
|
});
|
|
79305
|
-
const zAuthMethodAgent =
|
|
79297
|
+
const zAuthMethodAgent = object({
|
|
79306
79298
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79307
79299
|
description: string$2().nullish(),
|
|
79308
79300
|
id: string$2(),
|
|
79309
79301
|
name: string$2()
|
|
79310
79302
|
});
|
|
79311
|
-
const zAuthMethodEnvVar =
|
|
79303
|
+
const zAuthMethodEnvVar = object({
|
|
79312
79304
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79313
79305
|
description: string$2().nullish(),
|
|
79314
79306
|
id: string$2(),
|
|
@@ -79316,7 +79308,7 @@ Task description:
|
|
|
79316
79308
|
name: string$2(),
|
|
79317
79309
|
vars: array$3(zAuthEnvVar)
|
|
79318
79310
|
});
|
|
79319
|
-
const zAuthMethodTerminal =
|
|
79311
|
+
const zAuthMethodTerminal = object({
|
|
79320
79312
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79321
79313
|
args: array$3(string$2()).optional(),
|
|
79322
79314
|
description: string$2().nullish(),
|
|
@@ -79325,52 +79317,59 @@ Task description:
|
|
|
79325
79317
|
name: string$2()
|
|
79326
79318
|
});
|
|
79327
79319
|
const zAuthMethod = union$3([
|
|
79328
|
-
zAuthMethodEnvVar.and(
|
|
79320
|
+
zAuthMethodEnvVar.and(object({
|
|
79329
79321
|
type: literal("env_var")
|
|
79330
79322
|
})),
|
|
79331
|
-
zAuthMethodTerminal.and(
|
|
79323
|
+
zAuthMethodTerminal.and(object({
|
|
79332
79324
|
type: literal("terminal")
|
|
79333
79325
|
})),
|
|
79334
79326
|
zAuthMethodAgent
|
|
79335
79327
|
]);
|
|
79336
|
-
const zAuthenticateRequest =
|
|
79328
|
+
const zAuthenticateRequest = object({
|
|
79337
79329
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79338
79330
|
methodId: string$2()
|
|
79339
79331
|
});
|
|
79340
|
-
const zAuthenticateResponse =
|
|
79332
|
+
const zAuthenticateResponse = object({
|
|
79341
79333
|
_meta: record(string$2(), unknown()).nullish()
|
|
79342
79334
|
});
|
|
79343
|
-
const zBlobResourceContents =
|
|
79335
|
+
const zBlobResourceContents = object({
|
|
79344
79336
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79345
79337
|
blob: string$2(),
|
|
79346
79338
|
mimeType: string$2().nullish(),
|
|
79347
79339
|
uri: string$2()
|
|
79348
79340
|
});
|
|
79349
|
-
const zBooleanPropertySchema =
|
|
79341
|
+
const zBooleanPropertySchema = object({
|
|
79350
79342
|
default: boolean().nullish(),
|
|
79351
79343
|
description: string$2().nullish(),
|
|
79352
79344
|
title: string$2().nullish()
|
|
79353
79345
|
});
|
|
79354
|
-
const zCloseNesResponse =
|
|
79346
|
+
const zCloseNesResponse = object({
|
|
79355
79347
|
_meta: record(string$2(), unknown()).nullish()
|
|
79356
79348
|
});
|
|
79357
|
-
const zCloseSessionResponse =
|
|
79349
|
+
const zCloseSessionResponse = object({
|
|
79358
79350
|
_meta: record(string$2(), unknown()).nullish()
|
|
79359
79351
|
});
|
|
79360
|
-
const zCost =
|
|
79352
|
+
const zCost = object({
|
|
79361
79353
|
amount: number$3(),
|
|
79362
79354
|
currency: string$2()
|
|
79363
79355
|
});
|
|
79364
|
-
const zCreateTerminalResponse =
|
|
79356
|
+
const zCreateTerminalResponse = object({
|
|
79365
79357
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79366
79358
|
terminalId: string$2()
|
|
79367
79359
|
});
|
|
79368
|
-
const zDiff =
|
|
79360
|
+
const zDiff = object({
|
|
79369
79361
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79370
79362
|
newText: string$2(),
|
|
79371
79363
|
oldText: string$2().nullish(),
|
|
79372
79364
|
path: string$2()
|
|
79373
79365
|
});
|
|
79366
|
+
const zDisableProvidersRequest = object({
|
|
79367
|
+
_meta: record(string$2(), unknown()).nullish(),
|
|
79368
|
+
id: string$2()
|
|
79369
|
+
});
|
|
79370
|
+
const zDisableProvidersResponse = object({
|
|
79371
|
+
_meta: record(string$2(), unknown()).nullish()
|
|
79372
|
+
});
|
|
79374
79373
|
const zElicitationContentValue = union$3([
|
|
79375
79374
|
string$2(),
|
|
79376
79375
|
number$3(),
|
|
@@ -79378,51 +79377,45 @@ Task description:
|
|
|
79378
79377
|
boolean(),
|
|
79379
79378
|
array$3(string$2())
|
|
79380
79379
|
]);
|
|
79381
|
-
const zElicitationAcceptAction =
|
|
79380
|
+
const zElicitationAcceptAction = object({
|
|
79382
79381
|
content: record(string$2(), zElicitationContentValue).nullish()
|
|
79383
79382
|
});
|
|
79384
|
-
const
|
|
79385
|
-
zElicitationAcceptAction.and(
|
|
79383
|
+
const zCreateElicitationResponse = intersection(union$3([
|
|
79384
|
+
zElicitationAcceptAction.and(object({
|
|
79386
79385
|
action: literal("accept")
|
|
79387
79386
|
})),
|
|
79388
|
-
|
|
79387
|
+
object({
|
|
79389
79388
|
action: literal("decline")
|
|
79390
79389
|
}),
|
|
79391
|
-
|
|
79390
|
+
object({
|
|
79392
79391
|
action: literal("cancel")
|
|
79393
79392
|
})
|
|
79394
|
-
])
|
|
79395
|
-
|
|
79393
|
+
]), object({
|
|
79394
|
+
_meta: record(string$2(), unknown()).nullish()
|
|
79395
|
+
}));
|
|
79396
|
+
const zElicitationFormCapabilities = object({
|
|
79396
79397
|
_meta: record(string$2(), unknown()).nullish()
|
|
79397
79398
|
});
|
|
79398
79399
|
const zElicitationId = string$2();
|
|
79399
|
-
const
|
|
79400
|
+
const zCompleteElicitationNotification = object({
|
|
79400
79401
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79401
79402
|
elicitationId: zElicitationId
|
|
79402
79403
|
});
|
|
79403
|
-
const zElicitationResponse = looseObject({
|
|
79404
|
-
_meta: record(string$2(), unknown()).nullish(),
|
|
79405
|
-
action: zElicitationAction
|
|
79406
|
-
});
|
|
79407
79404
|
const zElicitationSchemaType = literal("object");
|
|
79408
79405
|
const zElicitationStringType = literal("string");
|
|
79409
|
-
const zElicitationUrlCapabilities =
|
|
79406
|
+
const zElicitationUrlCapabilities = object({
|
|
79410
79407
|
_meta: record(string$2(), unknown()).nullish()
|
|
79411
79408
|
});
|
|
79412
|
-
const zElicitationCapabilities =
|
|
79409
|
+
const zElicitationCapabilities = object({
|
|
79413
79410
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79414
79411
|
form: zElicitationFormCapabilities.nullish(),
|
|
79415
79412
|
url: zElicitationUrlCapabilities.nullish()
|
|
79416
79413
|
});
|
|
79417
|
-
const
|
|
79418
|
-
elicitationId: zElicitationId,
|
|
79419
|
-
url: string$2().url()
|
|
79420
|
-
});
|
|
79421
|
-
const zEnumOption = looseObject({
|
|
79414
|
+
const zEnumOption = object({
|
|
79422
79415
|
const: string$2(),
|
|
79423
79416
|
title: string$2()
|
|
79424
79417
|
});
|
|
79425
|
-
const zEnvVariable =
|
|
79418
|
+
const zEnvVariable = object({
|
|
79426
79419
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79427
79420
|
name: string$2(),
|
|
79428
79421
|
value: string$2()
|
|
@@ -79443,7 +79436,7 @@ Task description:
|
|
|
79443
79436
|
message: "Invalid value: Expected int32 to be <= 2147483647"
|
|
79444
79437
|
})
|
|
79445
79438
|
]);
|
|
79446
|
-
const zError =
|
|
79439
|
+
const zError = object({
|
|
79447
79440
|
code: zErrorCode,
|
|
79448
79441
|
data: unknown().optional(),
|
|
79449
79442
|
message: string$2()
|
|
@@ -79451,69 +79444,80 @@ Task description:
|
|
|
79451
79444
|
const zExtNotification = unknown();
|
|
79452
79445
|
const zExtRequest = unknown();
|
|
79453
79446
|
const zExtResponse = unknown();
|
|
79454
|
-
const zFileSystemCapabilities =
|
|
79447
|
+
const zFileSystemCapabilities = object({
|
|
79455
79448
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79456
79449
|
readTextFile: boolean().optional().default(false),
|
|
79457
79450
|
writeTextFile: boolean().optional().default(false)
|
|
79458
79451
|
});
|
|
79459
|
-
const zHttpHeader =
|
|
79452
|
+
const zHttpHeader = object({
|
|
79460
79453
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79461
79454
|
name: string$2(),
|
|
79462
79455
|
value: string$2()
|
|
79463
79456
|
});
|
|
79464
|
-
const zImplementation =
|
|
79457
|
+
const zImplementation = object({
|
|
79465
79458
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79466
79459
|
name: string$2(),
|
|
79467
79460
|
title: string$2().nullish(),
|
|
79468
79461
|
version: string$2()
|
|
79469
79462
|
});
|
|
79470
|
-
const zIntegerPropertySchema =
|
|
79463
|
+
const zIntegerPropertySchema = object({
|
|
79471
79464
|
default: number$3().nullish(),
|
|
79472
79465
|
description: string$2().nullish(),
|
|
79473
79466
|
maximum: number$3().nullish(),
|
|
79474
79467
|
minimum: number$3().nullish(),
|
|
79475
79468
|
title: string$2().nullish()
|
|
79476
79469
|
});
|
|
79477
|
-
const zKillTerminalResponse =
|
|
79470
|
+
const zKillTerminalResponse = object({
|
|
79471
|
+
_meta: record(string$2(), unknown()).nullish()
|
|
79472
|
+
});
|
|
79473
|
+
const zListProvidersRequest = object({
|
|
79478
79474
|
_meta: record(string$2(), unknown()).nullish()
|
|
79479
79475
|
});
|
|
79480
|
-
const zListSessionsRequest =
|
|
79476
|
+
const zListSessionsRequest = object({
|
|
79481
79477
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79482
79478
|
additionalDirectories: array$3(string$2()).optional(),
|
|
79483
79479
|
cursor: string$2().nullish(),
|
|
79484
79480
|
cwd: string$2().nullish()
|
|
79485
79481
|
});
|
|
79486
|
-
const
|
|
79482
|
+
const zLlmProtocol = union$3([
|
|
79483
|
+
literal("anthropic"),
|
|
79484
|
+
literal("openai"),
|
|
79485
|
+
literal("azure"),
|
|
79486
|
+
literal("vertex"),
|
|
79487
|
+
literal("bedrock"),
|
|
79488
|
+
string$2()
|
|
79489
|
+
]);
|
|
79490
|
+
const zLogoutCapabilities = object({
|
|
79487
79491
|
_meta: record(string$2(), unknown()).nullish()
|
|
79488
79492
|
});
|
|
79489
|
-
const zAgentAuthCapabilities =
|
|
79493
|
+
const zAgentAuthCapabilities = object({
|
|
79490
79494
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79491
79495
|
logout: zLogoutCapabilities.nullish()
|
|
79492
79496
|
});
|
|
79493
|
-
const zLogoutRequest =
|
|
79497
|
+
const zLogoutRequest = object({
|
|
79494
79498
|
_meta: record(string$2(), unknown()).nullish()
|
|
79495
79499
|
});
|
|
79496
|
-
const zLogoutResponse =
|
|
79500
|
+
const zLogoutResponse = object({
|
|
79497
79501
|
_meta: record(string$2(), unknown()).nullish()
|
|
79498
79502
|
});
|
|
79499
|
-
const zMcpCapabilities =
|
|
79503
|
+
const zMcpCapabilities = object({
|
|
79500
79504
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79501
79505
|
http: boolean().optional().default(false),
|
|
79502
79506
|
sse: boolean().optional().default(false)
|
|
79503
79507
|
});
|
|
79504
|
-
const zMcpServerHttp =
|
|
79508
|
+
const zMcpServerHttp = object({
|
|
79505
79509
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79506
79510
|
headers: array$3(zHttpHeader),
|
|
79507
79511
|
name: string$2(),
|
|
79508
79512
|
url: string$2()
|
|
79509
79513
|
});
|
|
79510
|
-
const zMcpServerSse =
|
|
79514
|
+
const zMcpServerSse = object({
|
|
79511
79515
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79512
79516
|
headers: array$3(zHttpHeader),
|
|
79513
79517
|
name: string$2(),
|
|
79514
79518
|
url: string$2()
|
|
79515
79519
|
});
|
|
79516
|
-
const zMcpServerStdio =
|
|
79520
|
+
const zMcpServerStdio = object({
|
|
79517
79521
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79518
79522
|
args: array$3(string$2()),
|
|
79519
79523
|
command: string$2(),
|
|
@@ -79521,16 +79525,16 @@ Task description:
|
|
|
79521
79525
|
name: string$2()
|
|
79522
79526
|
});
|
|
79523
79527
|
const zMcpServer = union$3([
|
|
79524
|
-
zMcpServerHttp.and(
|
|
79528
|
+
zMcpServerHttp.and(object({
|
|
79525
79529
|
type: literal("http")
|
|
79526
79530
|
})),
|
|
79527
|
-
zMcpServerSse.and(
|
|
79531
|
+
zMcpServerSse.and(object({
|
|
79528
79532
|
type: literal("sse")
|
|
79529
79533
|
})),
|
|
79530
79534
|
zMcpServerStdio
|
|
79531
79535
|
]);
|
|
79532
79536
|
const zModelId = string$2();
|
|
79533
|
-
const zModelInfo =
|
|
79537
|
+
const zModelInfo = object({
|
|
79534
79538
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79535
79539
|
description: string$2().nullish(),
|
|
79536
79540
|
modelId: zModelId,
|
|
@@ -79542,32 +79546,32 @@ Task description:
|
|
|
79542
79546
|
literal("information"),
|
|
79543
79547
|
literal("hint")
|
|
79544
79548
|
]);
|
|
79545
|
-
const zNesDiagnosticsCapabilities =
|
|
79549
|
+
const zNesDiagnosticsCapabilities = object({
|
|
79546
79550
|
_meta: record(string$2(), unknown()).nullish()
|
|
79547
79551
|
});
|
|
79548
|
-
const zNesDocumentDidCloseCapabilities =
|
|
79552
|
+
const zNesDocumentDidCloseCapabilities = object({
|
|
79549
79553
|
_meta: record(string$2(), unknown()).nullish()
|
|
79550
79554
|
});
|
|
79551
|
-
const zNesDocumentDidFocusCapabilities =
|
|
79555
|
+
const zNesDocumentDidFocusCapabilities = object({
|
|
79552
79556
|
_meta: record(string$2(), unknown()).nullish()
|
|
79553
79557
|
});
|
|
79554
|
-
const zNesDocumentDidOpenCapabilities =
|
|
79558
|
+
const zNesDocumentDidOpenCapabilities = object({
|
|
79555
79559
|
_meta: record(string$2(), unknown()).nullish()
|
|
79556
79560
|
});
|
|
79557
|
-
const zNesDocumentDidSaveCapabilities =
|
|
79561
|
+
const zNesDocumentDidSaveCapabilities = object({
|
|
79558
79562
|
_meta: record(string$2(), unknown()).nullish()
|
|
79559
79563
|
});
|
|
79560
|
-
const zNesEditHistoryCapabilities =
|
|
79564
|
+
const zNesEditHistoryCapabilities = object({
|
|
79561
79565
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79562
79566
|
maxCount: number$3().int().gte(0).max(4294967295, {
|
|
79563
79567
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
79564
79568
|
}).nullish()
|
|
79565
79569
|
});
|
|
79566
|
-
const zNesEditHistoryEntry =
|
|
79570
|
+
const zNesEditHistoryEntry = object({
|
|
79567
79571
|
diff: string$2(),
|
|
79568
79572
|
uri: string$2()
|
|
79569
79573
|
});
|
|
79570
|
-
const zNesExcerpt =
|
|
79574
|
+
const zNesExcerpt = object({
|
|
79571
79575
|
endLine: number$3().int().gte(0).max(4294967295, {
|
|
79572
79576
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
79573
79577
|
}),
|
|
@@ -79576,18 +79580,18 @@ Task description:
|
|
|
79576
79580
|
}),
|
|
79577
79581
|
text: string$2()
|
|
79578
79582
|
});
|
|
79579
|
-
const zNesJumpCapabilities =
|
|
79583
|
+
const zNesJumpCapabilities = object({
|
|
79580
79584
|
_meta: record(string$2(), unknown()).nullish()
|
|
79581
79585
|
});
|
|
79582
|
-
const zNesOpenFilesCapabilities =
|
|
79586
|
+
const zNesOpenFilesCapabilities = object({
|
|
79583
79587
|
_meta: record(string$2(), unknown()).nullish()
|
|
79584
79588
|
});
|
|
79585
|
-
const zNesRecentFile =
|
|
79589
|
+
const zNesRecentFile = object({
|
|
79586
79590
|
languageId: string$2(),
|
|
79587
79591
|
text: string$2(),
|
|
79588
79592
|
uri: string$2()
|
|
79589
79593
|
});
|
|
79590
|
-
const zNesRecentFilesCapabilities =
|
|
79594
|
+
const zNesRecentFilesCapabilities = object({
|
|
79591
79595
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79592
79596
|
maxCount: number$3().int().gte(0).max(4294967295, {
|
|
79593
79597
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
@@ -79599,31 +79603,31 @@ Task description:
|
|
|
79599
79603
|
literal("replaced"),
|
|
79600
79604
|
literal("cancelled")
|
|
79601
79605
|
]);
|
|
79602
|
-
const zNesRelatedSnippet =
|
|
79606
|
+
const zNesRelatedSnippet = object({
|
|
79603
79607
|
excerpts: array$3(zNesExcerpt),
|
|
79604
79608
|
uri: string$2()
|
|
79605
79609
|
});
|
|
79606
|
-
const zNesRelatedSnippetsCapabilities =
|
|
79610
|
+
const zNesRelatedSnippetsCapabilities = object({
|
|
79607
79611
|
_meta: record(string$2(), unknown()).nullish()
|
|
79608
79612
|
});
|
|
79609
|
-
const zNesRenameCapabilities =
|
|
79613
|
+
const zNesRenameCapabilities = object({
|
|
79610
79614
|
_meta: record(string$2(), unknown()).nullish()
|
|
79611
79615
|
});
|
|
79612
|
-
const zNesRepository =
|
|
79616
|
+
const zNesRepository = object({
|
|
79613
79617
|
name: string$2(),
|
|
79614
79618
|
owner: string$2(),
|
|
79615
79619
|
remoteUrl: string$2()
|
|
79616
79620
|
});
|
|
79617
|
-
const zNesSearchAndReplaceCapabilities =
|
|
79621
|
+
const zNesSearchAndReplaceCapabilities = object({
|
|
79618
79622
|
_meta: record(string$2(), unknown()).nullish()
|
|
79619
79623
|
});
|
|
79620
|
-
const zClientNesCapabilities =
|
|
79624
|
+
const zClientNesCapabilities = object({
|
|
79621
79625
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79622
79626
|
jump: zNesJumpCapabilities.nullish(),
|
|
79623
79627
|
rename: zNesRenameCapabilities.nullish(),
|
|
79624
79628
|
searchAndReplace: zNesSearchAndReplaceCapabilities.nullish()
|
|
79625
79629
|
});
|
|
79626
|
-
const zNesSearchAndReplaceSuggestion =
|
|
79630
|
+
const zNesSearchAndReplaceSuggestion = object({
|
|
79627
79631
|
id: string$2(),
|
|
79628
79632
|
isRegex: boolean().nullish(),
|
|
79629
79633
|
replace: string$2(),
|
|
@@ -79635,13 +79639,13 @@ Task description:
|
|
|
79635
79639
|
literal("diagnostic"),
|
|
79636
79640
|
literal("manual")
|
|
79637
79641
|
]);
|
|
79638
|
-
const zNesUserActionsCapabilities =
|
|
79642
|
+
const zNesUserActionsCapabilities = object({
|
|
79639
79643
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79640
79644
|
maxCount: number$3().int().gte(0).max(4294967295, {
|
|
79641
79645
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
79642
79646
|
}).nullish()
|
|
79643
79647
|
});
|
|
79644
|
-
const zNesContextCapabilities =
|
|
79648
|
+
const zNesContextCapabilities = object({
|
|
79645
79649
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79646
79650
|
diagnostics: zNesDiagnosticsCapabilities.nullish(),
|
|
79647
79651
|
editHistory: zNesEditHistoryCapabilities.nullish(),
|
|
@@ -79650,13 +79654,13 @@ Task description:
|
|
|
79650
79654
|
relatedSnippets: zNesRelatedSnippetsCapabilities.nullish(),
|
|
79651
79655
|
userActions: zNesUserActionsCapabilities.nullish()
|
|
79652
79656
|
});
|
|
79653
|
-
const zNewSessionRequest =
|
|
79657
|
+
const zNewSessionRequest = object({
|
|
79654
79658
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79655
79659
|
additionalDirectories: array$3(string$2()).optional(),
|
|
79656
79660
|
cwd: string$2(),
|
|
79657
79661
|
mcpServers: array$3(zMcpServer)
|
|
79658
79662
|
});
|
|
79659
|
-
const zNumberPropertySchema =
|
|
79663
|
+
const zNumberPropertySchema = object({
|
|
79660
79664
|
default: number$3().nullish(),
|
|
79661
79665
|
description: string$2().nullish(),
|
|
79662
79666
|
maximum: number$3().nullish(),
|
|
@@ -79670,7 +79674,7 @@ Task description:
|
|
|
79670
79674
|
literal("reject_once"),
|
|
79671
79675
|
literal("reject_always")
|
|
79672
79676
|
]);
|
|
79673
|
-
const zPermissionOption =
|
|
79677
|
+
const zPermissionOption = object({
|
|
79674
79678
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79675
79679
|
kind: zPermissionOptionKind,
|
|
79676
79680
|
name: string$2(),
|
|
@@ -79686,17 +79690,17 @@ Task description:
|
|
|
79686
79690
|
literal("in_progress"),
|
|
79687
79691
|
literal("completed")
|
|
79688
79692
|
]);
|
|
79689
|
-
const zPlanEntry =
|
|
79693
|
+
const zPlanEntry = object({
|
|
79690
79694
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79691
79695
|
content: string$2(),
|
|
79692
79696
|
priority: zPlanEntryPriority,
|
|
79693
79697
|
status: zPlanEntryStatus
|
|
79694
79698
|
});
|
|
79695
|
-
const zPlan =
|
|
79699
|
+
const zPlan = object({
|
|
79696
79700
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79697
79701
|
entries: array$3(zPlanEntry)
|
|
79698
79702
|
});
|
|
79699
|
-
const zPosition =
|
|
79703
|
+
const zPosition = object({
|
|
79700
79704
|
character: number$3().int().gte(0).max(4294967295, {
|
|
79701
79705
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
79702
79706
|
}),
|
|
@@ -79704,18 +79708,18 @@ Task description:
|
|
|
79704
79708
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
79705
79709
|
})
|
|
79706
79710
|
});
|
|
79707
|
-
const zNesJumpSuggestion =
|
|
79711
|
+
const zNesJumpSuggestion = object({
|
|
79708
79712
|
id: string$2(),
|
|
79709
79713
|
position: zPosition,
|
|
79710
79714
|
uri: string$2()
|
|
79711
79715
|
});
|
|
79712
|
-
const zNesRenameSuggestion =
|
|
79716
|
+
const zNesRenameSuggestion = object({
|
|
79713
79717
|
id: string$2(),
|
|
79714
79718
|
newName: string$2(),
|
|
79715
79719
|
position: zPosition,
|
|
79716
79720
|
uri: string$2()
|
|
79717
79721
|
});
|
|
79718
|
-
const zNesUserAction =
|
|
79722
|
+
const zNesUserAction = object({
|
|
79719
79723
|
action: string$2(),
|
|
79720
79724
|
position: zPosition,
|
|
79721
79725
|
timestampMs: number$3(),
|
|
@@ -79726,7 +79730,7 @@ Task description:
|
|
|
79726
79730
|
literal("utf-32"),
|
|
79727
79731
|
literal("utf-8")
|
|
79728
79732
|
]);
|
|
79729
|
-
const zClientCapabilities =
|
|
79733
|
+
const zClientCapabilities = object({
|
|
79730
79734
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79731
79735
|
auth: zAuthCapabilities.optional().default({
|
|
79732
79736
|
terminal: false
|
|
@@ -79740,14 +79744,14 @@ Task description:
|
|
|
79740
79744
|
positionEncodings: array$3(zPositionEncodingKind).optional(),
|
|
79741
79745
|
terminal: boolean().optional().default(false)
|
|
79742
79746
|
});
|
|
79743
|
-
const zPromptCapabilities =
|
|
79747
|
+
const zPromptCapabilities = object({
|
|
79744
79748
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79745
79749
|
audio: boolean().optional().default(false),
|
|
79746
79750
|
embeddedContext: boolean().optional().default(false),
|
|
79747
79751
|
image: boolean().optional().default(false)
|
|
79748
79752
|
});
|
|
79749
79753
|
const zProtocolVersion = number$3().int().gte(0).lte(65535);
|
|
79750
|
-
const zInitializeRequest =
|
|
79754
|
+
const zInitializeRequest = object({
|
|
79751
79755
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79752
79756
|
clientCapabilities: zClientCapabilities.optional().default({
|
|
79753
79757
|
auth: {
|
|
@@ -79762,23 +79766,41 @@ Task description:
|
|
|
79762
79766
|
clientInfo: zImplementation.nullish(),
|
|
79763
79767
|
protocolVersion: zProtocolVersion
|
|
79764
79768
|
});
|
|
79765
|
-
const
|
|
79769
|
+
const zProviderCurrentConfig = object({
|
|
79770
|
+
apiType: zLlmProtocol,
|
|
79771
|
+
baseUrl: string$2()
|
|
79772
|
+
});
|
|
79773
|
+
const zProviderInfo = object({
|
|
79774
|
+
_meta: record(string$2(), unknown()).nullish(),
|
|
79775
|
+
current: zProviderCurrentConfig.nullish(),
|
|
79776
|
+
id: string$2(),
|
|
79777
|
+
required: boolean(),
|
|
79778
|
+
supported: array$3(zLlmProtocol)
|
|
79779
|
+
});
|
|
79780
|
+
const zListProvidersResponse = object({
|
|
79781
|
+
_meta: record(string$2(), unknown()).nullish(),
|
|
79782
|
+
providers: array$3(zProviderInfo)
|
|
79783
|
+
});
|
|
79784
|
+
const zProvidersCapabilities = object({
|
|
79785
|
+
_meta: record(string$2(), unknown()).nullish()
|
|
79786
|
+
});
|
|
79787
|
+
const zRange = object({
|
|
79766
79788
|
end: zPosition,
|
|
79767
79789
|
start: zPosition
|
|
79768
79790
|
});
|
|
79769
|
-
const zNesDiagnostic =
|
|
79791
|
+
const zNesDiagnostic = object({
|
|
79770
79792
|
message: string$2(),
|
|
79771
79793
|
range: zRange,
|
|
79772
79794
|
severity: zNesDiagnosticSeverity,
|
|
79773
79795
|
uri: string$2()
|
|
79774
79796
|
});
|
|
79775
|
-
const zNesOpenFile =
|
|
79797
|
+
const zNesOpenFile = object({
|
|
79776
79798
|
languageId: string$2(),
|
|
79777
79799
|
lastFocusedMs: number$3().nullish(),
|
|
79778
79800
|
uri: string$2(),
|
|
79779
79801
|
visibleRange: zRange.nullish()
|
|
79780
79802
|
});
|
|
79781
|
-
const zNesSuggestContext =
|
|
79803
|
+
const zNesSuggestContext = object({
|
|
79782
79804
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79783
79805
|
diagnostics: array$3(zNesDiagnostic).nullish(),
|
|
79784
79806
|
editHistory: array$3(zNesEditHistoryEntry).nullish(),
|
|
@@ -79787,69 +79809,72 @@ Task description:
|
|
|
79787
79809
|
relatedSnippets: array$3(zNesRelatedSnippet).nullish(),
|
|
79788
79810
|
userActions: array$3(zNesUserAction).nullish()
|
|
79789
79811
|
});
|
|
79790
|
-
const zNesTextEdit =
|
|
79812
|
+
const zNesTextEdit = object({
|
|
79791
79813
|
newText: string$2(),
|
|
79792
79814
|
range: zRange
|
|
79793
79815
|
});
|
|
79794
|
-
const zNesEditSuggestion =
|
|
79816
|
+
const zNesEditSuggestion = object({
|
|
79795
79817
|
cursorPosition: zPosition.nullish(),
|
|
79796
79818
|
edits: array$3(zNesTextEdit),
|
|
79797
79819
|
id: string$2(),
|
|
79798
79820
|
uri: string$2()
|
|
79799
79821
|
});
|
|
79800
79822
|
const zNesSuggestion = union$3([
|
|
79801
|
-
zNesEditSuggestion.and(
|
|
79823
|
+
zNesEditSuggestion.and(object({
|
|
79802
79824
|
kind: literal("edit")
|
|
79803
79825
|
})),
|
|
79804
|
-
zNesJumpSuggestion.and(
|
|
79826
|
+
zNesJumpSuggestion.and(object({
|
|
79805
79827
|
kind: literal("jump")
|
|
79806
79828
|
})),
|
|
79807
|
-
zNesRenameSuggestion.and(
|
|
79829
|
+
zNesRenameSuggestion.and(object({
|
|
79808
79830
|
kind: literal("rename")
|
|
79809
79831
|
})),
|
|
79810
|
-
zNesSearchAndReplaceSuggestion.and(
|
|
79832
|
+
zNesSearchAndReplaceSuggestion.and(object({
|
|
79811
79833
|
kind: literal("searchAndReplace")
|
|
79812
79834
|
}))
|
|
79813
79835
|
]);
|
|
79814
|
-
const zReadTextFileResponse =
|
|
79836
|
+
const zReadTextFileResponse = object({
|
|
79815
79837
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79816
79838
|
content: string$2()
|
|
79817
79839
|
});
|
|
79818
|
-
const zReleaseTerminalResponse =
|
|
79840
|
+
const zReleaseTerminalResponse = object({
|
|
79819
79841
|
_meta: record(string$2(), unknown()).nullish()
|
|
79820
79842
|
});
|
|
79821
79843
|
const zRequestId = union$3([
|
|
79822
79844
|
number$3(),
|
|
79823
79845
|
string$2()
|
|
79824
79846
|
]).nullable();
|
|
79825
|
-
|
|
79847
|
+
object({
|
|
79826
79848
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79827
79849
|
requestId: zRequestId
|
|
79828
79850
|
});
|
|
79851
|
+
const zElicitationRequestScope = object({
|
|
79852
|
+
requestId: zRequestId
|
|
79853
|
+
});
|
|
79829
79854
|
const zRole = _enum([
|
|
79830
79855
|
"assistant",
|
|
79831
79856
|
"user"
|
|
79832
79857
|
]);
|
|
79833
|
-
const zAnnotations =
|
|
79858
|
+
const zAnnotations = object({
|
|
79834
79859
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79835
79860
|
audience: array$3(zRole).nullish(),
|
|
79836
79861
|
lastModified: string$2().nullish(),
|
|
79837
79862
|
priority: number$3().nullish()
|
|
79838
79863
|
});
|
|
79839
|
-
const zAudioContent =
|
|
79864
|
+
const zAudioContent = object({
|
|
79840
79865
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79841
79866
|
annotations: zAnnotations.nullish(),
|
|
79842
79867
|
data: string$2(),
|
|
79843
79868
|
mimeType: string$2()
|
|
79844
79869
|
});
|
|
79845
|
-
const zImageContent =
|
|
79870
|
+
const zImageContent = object({
|
|
79846
79871
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79847
79872
|
annotations: zAnnotations.nullish(),
|
|
79848
79873
|
data: string$2(),
|
|
79849
79874
|
mimeType: string$2(),
|
|
79850
79875
|
uri: string$2().nullish()
|
|
79851
79876
|
});
|
|
79852
|
-
const zResourceLink =
|
|
79877
|
+
const zResourceLink = object({
|
|
79853
79878
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79854
79879
|
annotations: zAnnotations.nullish(),
|
|
79855
79880
|
description: string$2().nullish(),
|
|
@@ -79859,29 +79884,29 @@ Task description:
|
|
|
79859
79884
|
title: string$2().nullish(),
|
|
79860
79885
|
uri: string$2()
|
|
79861
79886
|
});
|
|
79862
|
-
const zSelectedPermissionOutcome =
|
|
79887
|
+
const zSelectedPermissionOutcome = object({
|
|
79863
79888
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79864
79889
|
optionId: zPermissionOptionId
|
|
79865
79890
|
});
|
|
79866
79891
|
const zRequestPermissionOutcome = union$3([
|
|
79867
|
-
|
|
79892
|
+
object({
|
|
79868
79893
|
outcome: literal("cancelled")
|
|
79869
79894
|
}),
|
|
79870
|
-
zSelectedPermissionOutcome.and(
|
|
79895
|
+
zSelectedPermissionOutcome.and(object({
|
|
79871
79896
|
outcome: literal("selected")
|
|
79872
79897
|
}))
|
|
79873
79898
|
]);
|
|
79874
|
-
const zRequestPermissionResponse =
|
|
79899
|
+
const zRequestPermissionResponse = object({
|
|
79875
79900
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79876
79901
|
outcome: zRequestPermissionOutcome
|
|
79877
79902
|
});
|
|
79878
|
-
const zSessionAdditionalDirectoriesCapabilities =
|
|
79903
|
+
const zSessionAdditionalDirectoriesCapabilities = object({
|
|
79879
79904
|
_meta: record(string$2(), unknown()).nullish()
|
|
79880
79905
|
});
|
|
79881
|
-
const zSessionCloseCapabilities =
|
|
79906
|
+
const zSessionCloseCapabilities = object({
|
|
79882
79907
|
_meta: record(string$2(), unknown()).nullish()
|
|
79883
79908
|
});
|
|
79884
|
-
const zSessionConfigBoolean =
|
|
79909
|
+
const zSessionConfigBoolean = object({
|
|
79885
79910
|
currentValue: boolean()
|
|
79886
79911
|
});
|
|
79887
79912
|
const zSessionConfigGroupId = string$2();
|
|
@@ -79893,13 +79918,13 @@ Task description:
|
|
|
79893
79918
|
string$2()
|
|
79894
79919
|
]);
|
|
79895
79920
|
const zSessionConfigValueId = string$2();
|
|
79896
|
-
const zSessionConfigSelectOption =
|
|
79921
|
+
const zSessionConfigSelectOption = object({
|
|
79897
79922
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79898
79923
|
description: string$2().nullish(),
|
|
79899
79924
|
name: string$2(),
|
|
79900
79925
|
value: zSessionConfigValueId
|
|
79901
79926
|
});
|
|
79902
|
-
const zSessionConfigSelectGroup =
|
|
79927
|
+
const zSessionConfigSelectGroup = object({
|
|
79903
79928
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79904
79929
|
group: zSessionConfigGroupId,
|
|
79905
79930
|
name: string$2(),
|
|
@@ -79909,50 +79934,50 @@ Task description:
|
|
|
79909
79934
|
array$3(zSessionConfigSelectOption),
|
|
79910
79935
|
array$3(zSessionConfigSelectGroup)
|
|
79911
79936
|
]);
|
|
79912
|
-
const zSessionConfigSelect =
|
|
79937
|
+
const zSessionConfigSelect = object({
|
|
79913
79938
|
currentValue: zSessionConfigValueId,
|
|
79914
79939
|
options: zSessionConfigSelectOptions
|
|
79915
79940
|
});
|
|
79916
79941
|
const zSessionConfigOption = intersection(union$3([
|
|
79917
|
-
zSessionConfigSelect.and(
|
|
79942
|
+
zSessionConfigSelect.and(object({
|
|
79918
79943
|
type: literal("select")
|
|
79919
79944
|
})),
|
|
79920
|
-
zSessionConfigBoolean.and(
|
|
79945
|
+
zSessionConfigBoolean.and(object({
|
|
79921
79946
|
type: literal("boolean")
|
|
79922
79947
|
}))
|
|
79923
|
-
]),
|
|
79948
|
+
]), object({
|
|
79924
79949
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79925
79950
|
category: zSessionConfigOptionCategory.nullish(),
|
|
79926
79951
|
description: string$2().nullish(),
|
|
79927
79952
|
id: zSessionConfigId,
|
|
79928
79953
|
name: string$2()
|
|
79929
79954
|
}));
|
|
79930
|
-
const zConfigOptionUpdate =
|
|
79955
|
+
const zConfigOptionUpdate = object({
|
|
79931
79956
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79932
79957
|
configOptions: array$3(zSessionConfigOption)
|
|
79933
79958
|
});
|
|
79934
|
-
const zSessionForkCapabilities =
|
|
79959
|
+
const zSessionForkCapabilities = object({
|
|
79935
79960
|
_meta: record(string$2(), unknown()).nullish()
|
|
79936
79961
|
});
|
|
79937
79962
|
const zSessionId = string$2();
|
|
79938
|
-
const zAcceptNesNotification =
|
|
79963
|
+
const zAcceptNesNotification = object({
|
|
79939
79964
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79940
79965
|
id: string$2(),
|
|
79941
79966
|
sessionId: zSessionId
|
|
79942
79967
|
});
|
|
79943
|
-
const zCancelNotification =
|
|
79968
|
+
const zCancelNotification = object({
|
|
79944
79969
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79945
79970
|
sessionId: zSessionId
|
|
79946
79971
|
});
|
|
79947
|
-
const zCloseNesRequest =
|
|
79972
|
+
const zCloseNesRequest = object({
|
|
79948
79973
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79949
79974
|
sessionId: zSessionId
|
|
79950
79975
|
});
|
|
79951
|
-
const zCloseSessionRequest =
|
|
79976
|
+
const zCloseSessionRequest = object({
|
|
79952
79977
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79953
79978
|
sessionId: zSessionId
|
|
79954
79979
|
});
|
|
79955
|
-
const zCreateTerminalRequest =
|
|
79980
|
+
const zCreateTerminalRequest = object({
|
|
79956
79981
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79957
79982
|
args: array$3(string$2()).optional(),
|
|
79958
79983
|
command: string$2(),
|
|
@@ -79961,12 +79986,12 @@ Task description:
|
|
|
79961
79986
|
outputByteLimit: number$3().nullish(),
|
|
79962
79987
|
sessionId: zSessionId
|
|
79963
79988
|
});
|
|
79964
|
-
const zDidCloseDocumentNotification =
|
|
79989
|
+
const zDidCloseDocumentNotification = object({
|
|
79965
79990
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79966
79991
|
sessionId: zSessionId,
|
|
79967
79992
|
uri: string$2()
|
|
79968
79993
|
});
|
|
79969
|
-
const zDidFocusDocumentNotification =
|
|
79994
|
+
const zDidFocusDocumentNotification = object({
|
|
79970
79995
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79971
79996
|
position: zPosition,
|
|
79972
79997
|
sessionId: zSessionId,
|
|
@@ -79974,7 +79999,7 @@ Task description:
|
|
|
79974
79999
|
version: number$3(),
|
|
79975
80000
|
visibleRange: zRange
|
|
79976
80001
|
});
|
|
79977
|
-
const zDidOpenDocumentNotification =
|
|
80002
|
+
const zDidOpenDocumentNotification = object({
|
|
79978
80003
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79979
80004
|
languageId: string$2(),
|
|
79980
80005
|
sessionId: zSessionId,
|
|
@@ -79982,31 +80007,31 @@ Task description:
|
|
|
79982
80007
|
uri: string$2(),
|
|
79983
80008
|
version: number$3()
|
|
79984
80009
|
});
|
|
79985
|
-
const zDidSaveDocumentNotification =
|
|
80010
|
+
const zDidSaveDocumentNotification = object({
|
|
79986
80011
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79987
80012
|
sessionId: zSessionId,
|
|
79988
80013
|
uri: string$2()
|
|
79989
80014
|
});
|
|
79990
|
-
const zForkSessionRequest =
|
|
80015
|
+
const zForkSessionRequest = object({
|
|
79991
80016
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79992
80017
|
additionalDirectories: array$3(string$2()).optional(),
|
|
79993
80018
|
cwd: string$2(),
|
|
79994
80019
|
mcpServers: array$3(zMcpServer).optional(),
|
|
79995
80020
|
sessionId: zSessionId
|
|
79996
80021
|
});
|
|
79997
|
-
const zKillTerminalRequest =
|
|
80022
|
+
const zKillTerminalRequest = object({
|
|
79998
80023
|
_meta: record(string$2(), unknown()).nullish(),
|
|
79999
80024
|
sessionId: zSessionId,
|
|
80000
80025
|
terminalId: string$2()
|
|
80001
80026
|
});
|
|
80002
|
-
const zLoadSessionRequest =
|
|
80027
|
+
const zLoadSessionRequest = object({
|
|
80003
80028
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80004
80029
|
additionalDirectories: array$3(string$2()).optional(),
|
|
80005
80030
|
cwd: string$2(),
|
|
80006
80031
|
mcpServers: array$3(zMcpServer),
|
|
80007
80032
|
sessionId: zSessionId
|
|
80008
80033
|
});
|
|
80009
|
-
const zReadTextFileRequest =
|
|
80034
|
+
const zReadTextFileRequest = object({
|
|
80010
80035
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80011
80036
|
limit: number$3().int().gte(0).max(4294967295, {
|
|
80012
80037
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
@@ -80017,25 +80042,25 @@ Task description:
|
|
|
80017
80042
|
path: string$2(),
|
|
80018
80043
|
sessionId: zSessionId
|
|
80019
80044
|
});
|
|
80020
|
-
const zRejectNesNotification =
|
|
80045
|
+
const zRejectNesNotification = object({
|
|
80021
80046
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80022
80047
|
id: string$2(),
|
|
80023
80048
|
reason: zNesRejectReason.nullish(),
|
|
80024
80049
|
sessionId: zSessionId
|
|
80025
80050
|
});
|
|
80026
|
-
const zReleaseTerminalRequest =
|
|
80051
|
+
const zReleaseTerminalRequest = object({
|
|
80027
80052
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80028
80053
|
sessionId: zSessionId,
|
|
80029
80054
|
terminalId: string$2()
|
|
80030
80055
|
});
|
|
80031
|
-
const zResumeSessionRequest =
|
|
80056
|
+
const zResumeSessionRequest = object({
|
|
80032
80057
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80033
80058
|
additionalDirectories: array$3(string$2()).optional(),
|
|
80034
80059
|
cwd: string$2(),
|
|
80035
80060
|
mcpServers: array$3(zMcpServer).optional(),
|
|
80036
80061
|
sessionId: zSessionId
|
|
80037
80062
|
});
|
|
80038
|
-
const zSessionInfo =
|
|
80063
|
+
const zSessionInfo = object({
|
|
80039
80064
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80040
80065
|
additionalDirectories: array$3(string$2()).optional(),
|
|
80041
80066
|
cwd: string$2(),
|
|
@@ -80043,70 +80068,70 @@ Task description:
|
|
|
80043
80068
|
title: string$2().nullish(),
|
|
80044
80069
|
updatedAt: string$2().nullish()
|
|
80045
80070
|
});
|
|
80046
|
-
const zListSessionsResponse =
|
|
80071
|
+
const zListSessionsResponse = object({
|
|
80047
80072
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80048
80073
|
nextCursor: string$2().nullish(),
|
|
80049
80074
|
sessions: array$3(zSessionInfo)
|
|
80050
80075
|
});
|
|
80051
|
-
const zSessionInfoUpdate =
|
|
80076
|
+
const zSessionInfoUpdate = object({
|
|
80052
80077
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80053
80078
|
title: string$2().nullish(),
|
|
80054
80079
|
updatedAt: string$2().nullish()
|
|
80055
80080
|
});
|
|
80056
|
-
const zSessionListCapabilities =
|
|
80081
|
+
const zSessionListCapabilities = object({
|
|
80057
80082
|
_meta: record(string$2(), unknown()).nullish()
|
|
80058
80083
|
});
|
|
80059
80084
|
const zSessionModeId = string$2();
|
|
80060
|
-
const zCurrentModeUpdate =
|
|
80085
|
+
const zCurrentModeUpdate = object({
|
|
80061
80086
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80062
80087
|
currentModeId: zSessionModeId
|
|
80063
80088
|
});
|
|
80064
|
-
const zSessionMode =
|
|
80089
|
+
const zSessionMode = object({
|
|
80065
80090
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80066
80091
|
description: string$2().nullish(),
|
|
80067
80092
|
id: zSessionModeId,
|
|
80068
80093
|
name: string$2()
|
|
80069
80094
|
});
|
|
80070
|
-
const zSessionModeState =
|
|
80095
|
+
const zSessionModeState = object({
|
|
80071
80096
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80072
80097
|
availableModes: array$3(zSessionMode),
|
|
80073
80098
|
currentModeId: zSessionModeId
|
|
80074
80099
|
});
|
|
80075
|
-
const zSessionModelState =
|
|
80100
|
+
const zSessionModelState = object({
|
|
80076
80101
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80077
80102
|
availableModels: array$3(zModelInfo),
|
|
80078
80103
|
currentModelId: zModelId
|
|
80079
80104
|
});
|
|
80080
|
-
const zForkSessionResponse =
|
|
80105
|
+
const zForkSessionResponse = object({
|
|
80081
80106
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80082
80107
|
configOptions: array$3(zSessionConfigOption).nullish(),
|
|
80083
80108
|
models: zSessionModelState.nullish(),
|
|
80084
80109
|
modes: zSessionModeState.nullish(),
|
|
80085
80110
|
sessionId: zSessionId
|
|
80086
80111
|
});
|
|
80087
|
-
const zLoadSessionResponse =
|
|
80112
|
+
const zLoadSessionResponse = object({
|
|
80088
80113
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80089
80114
|
configOptions: array$3(zSessionConfigOption).nullish(),
|
|
80090
80115
|
models: zSessionModelState.nullish(),
|
|
80091
80116
|
modes: zSessionModeState.nullish()
|
|
80092
80117
|
});
|
|
80093
|
-
const zNewSessionResponse =
|
|
80118
|
+
const zNewSessionResponse = object({
|
|
80094
80119
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80095
80120
|
configOptions: array$3(zSessionConfigOption).nullish(),
|
|
80096
80121
|
models: zSessionModelState.nullish(),
|
|
80097
80122
|
modes: zSessionModeState.nullish(),
|
|
80098
80123
|
sessionId: zSessionId
|
|
80099
80124
|
});
|
|
80100
|
-
const zResumeSessionResponse =
|
|
80125
|
+
const zResumeSessionResponse = object({
|
|
80101
80126
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80102
80127
|
configOptions: array$3(zSessionConfigOption).nullish(),
|
|
80103
80128
|
models: zSessionModelState.nullish(),
|
|
80104
80129
|
modes: zSessionModeState.nullish()
|
|
80105
80130
|
});
|
|
80106
|
-
const zSessionResumeCapabilities =
|
|
80131
|
+
const zSessionResumeCapabilities = object({
|
|
80107
80132
|
_meta: record(string$2(), unknown()).nullish()
|
|
80108
80133
|
});
|
|
80109
|
-
const zSessionCapabilities =
|
|
80134
|
+
const zSessionCapabilities = object({
|
|
80110
80135
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80111
80136
|
additionalDirectories: zSessionAdditionalDirectoriesCapabilities.nullish(),
|
|
80112
80137
|
close: zSessionCloseCapabilities.nullish(),
|
|
@@ -80114,40 +80139,50 @@ Task description:
|
|
|
80114
80139
|
list: zSessionListCapabilities.nullish(),
|
|
80115
80140
|
resume: zSessionResumeCapabilities.nullish()
|
|
80116
80141
|
});
|
|
80142
|
+
const zSetProvidersRequest = object({
|
|
80143
|
+
_meta: record(string$2(), unknown()).nullish(),
|
|
80144
|
+
apiType: zLlmProtocol,
|
|
80145
|
+
baseUrl: string$2(),
|
|
80146
|
+
headers: record(string$2(), string$2()).optional(),
|
|
80147
|
+
id: string$2()
|
|
80148
|
+
});
|
|
80149
|
+
const zSetProvidersResponse = object({
|
|
80150
|
+
_meta: record(string$2(), unknown()).nullish()
|
|
80151
|
+
});
|
|
80117
80152
|
const zSetSessionConfigOptionRequest = intersection(union$3([
|
|
80118
|
-
|
|
80153
|
+
object({
|
|
80119
80154
|
type: literal("boolean"),
|
|
80120
80155
|
value: boolean()
|
|
80121
80156
|
}),
|
|
80122
|
-
|
|
80157
|
+
object({
|
|
80123
80158
|
value: zSessionConfigValueId
|
|
80124
80159
|
})
|
|
80125
|
-
]),
|
|
80160
|
+
]), object({
|
|
80126
80161
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80127
80162
|
configId: zSessionConfigId,
|
|
80128
80163
|
sessionId: zSessionId
|
|
80129
80164
|
}));
|
|
80130
|
-
const zSetSessionConfigOptionResponse =
|
|
80165
|
+
const zSetSessionConfigOptionResponse = object({
|
|
80131
80166
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80132
80167
|
configOptions: array$3(zSessionConfigOption)
|
|
80133
80168
|
});
|
|
80134
|
-
const zSetSessionModeRequest =
|
|
80169
|
+
const zSetSessionModeRequest = object({
|
|
80135
80170
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80136
80171
|
modeId: zSessionModeId,
|
|
80137
80172
|
sessionId: zSessionId
|
|
80138
80173
|
});
|
|
80139
|
-
const zSetSessionModeResponse =
|
|
80174
|
+
const zSetSessionModeResponse = object({
|
|
80140
80175
|
_meta: record(string$2(), unknown()).nullish()
|
|
80141
80176
|
});
|
|
80142
|
-
const zSetSessionModelRequest =
|
|
80177
|
+
const zSetSessionModelRequest = object({
|
|
80143
80178
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80144
80179
|
modelId: zModelId,
|
|
80145
80180
|
sessionId: zSessionId
|
|
80146
80181
|
});
|
|
80147
|
-
const zSetSessionModelResponse =
|
|
80182
|
+
const zSetSessionModelResponse = object({
|
|
80148
80183
|
_meta: record(string$2(), unknown()).nullish()
|
|
80149
80184
|
});
|
|
80150
|
-
const zStartNesResponse =
|
|
80185
|
+
const zStartNesResponse = object({
|
|
80151
80186
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80152
80187
|
sessionId: zSessionId
|
|
80153
80188
|
});
|
|
@@ -80164,7 +80199,7 @@ Task description:
|
|
|
80164
80199
|
literal("date"),
|
|
80165
80200
|
literal("date-time")
|
|
80166
80201
|
]);
|
|
80167
|
-
const zStringPropertySchema =
|
|
80202
|
+
const zStringPropertySchema = object({
|
|
80168
80203
|
default: string$2().nullish(),
|
|
80169
80204
|
description: string$2().nullish(),
|
|
80170
80205
|
enum: array$3(string$2()).nullish(),
|
|
@@ -80179,7 +80214,7 @@ Task description:
|
|
|
80179
80214
|
pattern: string$2().nullish(),
|
|
80180
80215
|
title: string$2().nullish()
|
|
80181
80216
|
});
|
|
80182
|
-
const zSuggestNesRequest =
|
|
80217
|
+
const zSuggestNesRequest = object({
|
|
80183
80218
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80184
80219
|
context: zNesSuggestContext.nullish(),
|
|
80185
80220
|
position: zPosition,
|
|
@@ -80189,49 +80224,49 @@ Task description:
|
|
|
80189
80224
|
uri: string$2(),
|
|
80190
80225
|
version: number$3()
|
|
80191
80226
|
});
|
|
80192
|
-
const zSuggestNesResponse =
|
|
80227
|
+
const zSuggestNesResponse = object({
|
|
80193
80228
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80194
80229
|
suggestions: array$3(zNesSuggestion)
|
|
80195
80230
|
});
|
|
80196
|
-
const zTerminal =
|
|
80231
|
+
const zTerminal = object({
|
|
80197
80232
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80198
80233
|
terminalId: string$2()
|
|
80199
80234
|
});
|
|
80200
|
-
const zTerminalExitStatus =
|
|
80235
|
+
const zTerminalExitStatus = object({
|
|
80201
80236
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80202
80237
|
exitCode: number$3().int().gte(0).max(4294967295, {
|
|
80203
80238
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
80204
80239
|
}).nullish(),
|
|
80205
80240
|
signal: string$2().nullish()
|
|
80206
80241
|
});
|
|
80207
|
-
const zTerminalOutputRequest =
|
|
80242
|
+
const zTerminalOutputRequest = object({
|
|
80208
80243
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80209
80244
|
sessionId: zSessionId,
|
|
80210
80245
|
terminalId: string$2()
|
|
80211
80246
|
});
|
|
80212
|
-
const zTerminalOutputResponse =
|
|
80247
|
+
const zTerminalOutputResponse = object({
|
|
80213
80248
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80214
80249
|
exitStatus: zTerminalExitStatus.nullish(),
|
|
80215
80250
|
output: string$2(),
|
|
80216
80251
|
truncated: boolean()
|
|
80217
80252
|
});
|
|
80218
|
-
const zTextContent =
|
|
80253
|
+
const zTextContent = object({
|
|
80219
80254
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80220
80255
|
annotations: zAnnotations.nullish(),
|
|
80221
80256
|
text: string$2()
|
|
80222
80257
|
});
|
|
80223
|
-
const zTextDocumentContentChangeEvent =
|
|
80258
|
+
const zTextDocumentContentChangeEvent = object({
|
|
80224
80259
|
range: zRange.nullish(),
|
|
80225
80260
|
text: string$2()
|
|
80226
80261
|
});
|
|
80227
|
-
const zDidChangeDocumentNotification =
|
|
80262
|
+
const zDidChangeDocumentNotification = object({
|
|
80228
80263
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80229
80264
|
contentChanges: array$3(zTextDocumentContentChangeEvent),
|
|
80230
80265
|
sessionId: zSessionId,
|
|
80231
80266
|
uri: string$2(),
|
|
80232
80267
|
version: number$3()
|
|
80233
80268
|
});
|
|
80234
|
-
|
|
80269
|
+
object({
|
|
80235
80270
|
method: string$2(),
|
|
80236
80271
|
params: union$3([
|
|
80237
80272
|
zCancelNotification,
|
|
@@ -80249,11 +80284,11 @@ Task description:
|
|
|
80249
80284
|
literal("full"),
|
|
80250
80285
|
literal("incremental")
|
|
80251
80286
|
]);
|
|
80252
|
-
const zNesDocumentDidChangeCapabilities =
|
|
80287
|
+
const zNesDocumentDidChangeCapabilities = object({
|
|
80253
80288
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80254
80289
|
syncKind: zTextDocumentSyncKind
|
|
80255
80290
|
});
|
|
80256
|
-
const zNesDocumentEventCapabilities =
|
|
80291
|
+
const zNesDocumentEventCapabilities = object({
|
|
80257
80292
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80258
80293
|
didChange: zNesDocumentDidChangeCapabilities.nullish(),
|
|
80259
80294
|
didClose: zNesDocumentDidCloseCapabilities.nullish(),
|
|
@@ -80261,16 +80296,16 @@ Task description:
|
|
|
80261
80296
|
didOpen: zNesDocumentDidOpenCapabilities.nullish(),
|
|
80262
80297
|
didSave: zNesDocumentDidSaveCapabilities.nullish()
|
|
80263
80298
|
});
|
|
80264
|
-
const zNesEventCapabilities =
|
|
80299
|
+
const zNesEventCapabilities = object({
|
|
80265
80300
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80266
80301
|
document: zNesDocumentEventCapabilities.nullish()
|
|
80267
80302
|
});
|
|
80268
|
-
const zNesCapabilities =
|
|
80303
|
+
const zNesCapabilities = object({
|
|
80269
80304
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80270
80305
|
context: zNesContextCapabilities.nullish(),
|
|
80271
80306
|
events: zNesEventCapabilities.nullish()
|
|
80272
80307
|
});
|
|
80273
|
-
const zAgentCapabilities =
|
|
80308
|
+
const zAgentCapabilities = object({
|
|
80274
80309
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80275
80310
|
auth: zAgentAuthCapabilities.optional().default({}),
|
|
80276
80311
|
loadSession: boolean().optional().default(false),
|
|
@@ -80285,9 +80320,10 @@ Task description:
|
|
|
80285
80320
|
embeddedContext: false,
|
|
80286
80321
|
image: false
|
|
80287
80322
|
}),
|
|
80323
|
+
providers: zProvidersCapabilities.nullish(),
|
|
80288
80324
|
sessionCapabilities: zSessionCapabilities.optional().default({})
|
|
80289
80325
|
});
|
|
80290
|
-
const zInitializeResponse =
|
|
80326
|
+
const zInitializeResponse = object({
|
|
80291
80327
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80292
80328
|
agentCapabilities: zAgentCapabilities.optional().default({
|
|
80293
80329
|
auth: {},
|
|
@@ -80307,7 +80343,7 @@ Task description:
|
|
|
80307
80343
|
authMethods: array$3(zAuthMethod).optional().default([]),
|
|
80308
80344
|
protocolVersion: zProtocolVersion
|
|
80309
80345
|
});
|
|
80310
|
-
const zTextResourceContents =
|
|
80346
|
+
const zTextResourceContents = object({
|
|
80311
80347
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80312
80348
|
mimeType: string$2().nullish(),
|
|
80313
80349
|
text: string$2(),
|
|
@@ -80317,59 +80353,70 @@ Task description:
|
|
|
80317
80353
|
zTextResourceContents,
|
|
80318
80354
|
zBlobResourceContents
|
|
80319
80355
|
]);
|
|
80320
|
-
const zEmbeddedResource =
|
|
80356
|
+
const zEmbeddedResource = object({
|
|
80321
80357
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80322
80358
|
annotations: zAnnotations.nullish(),
|
|
80323
80359
|
resource: zEmbeddedResourceResource
|
|
80324
80360
|
});
|
|
80325
80361
|
const zContentBlock = union$3([
|
|
80326
|
-
zTextContent.and(
|
|
80362
|
+
zTextContent.and(object({
|
|
80327
80363
|
type: literal("text")
|
|
80328
80364
|
})),
|
|
80329
|
-
zImageContent.and(
|
|
80365
|
+
zImageContent.and(object({
|
|
80330
80366
|
type: literal("image")
|
|
80331
80367
|
})),
|
|
80332
|
-
zAudioContent.and(
|
|
80368
|
+
zAudioContent.and(object({
|
|
80333
80369
|
type: literal("audio")
|
|
80334
80370
|
})),
|
|
80335
|
-
zResourceLink.and(
|
|
80371
|
+
zResourceLink.and(object({
|
|
80336
80372
|
type: literal("resource_link")
|
|
80337
80373
|
})),
|
|
80338
|
-
zEmbeddedResource.and(
|
|
80374
|
+
zEmbeddedResource.and(object({
|
|
80339
80375
|
type: literal("resource")
|
|
80340
80376
|
}))
|
|
80341
80377
|
]);
|
|
80342
|
-
const zContent =
|
|
80378
|
+
const zContent = object({
|
|
80343
80379
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80344
80380
|
content: zContentBlock
|
|
80345
80381
|
});
|
|
80346
|
-
const zContentChunk =
|
|
80382
|
+
const zContentChunk = object({
|
|
80347
80383
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80348
80384
|
content: zContentBlock,
|
|
80349
80385
|
messageId: string$2().nullish()
|
|
80350
80386
|
});
|
|
80351
|
-
const zPromptRequest =
|
|
80387
|
+
const zPromptRequest = object({
|
|
80352
80388
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80353
80389
|
messageId: string$2().nullish(),
|
|
80354
80390
|
prompt: array$3(zContentBlock),
|
|
80355
80391
|
sessionId: zSessionId
|
|
80356
80392
|
});
|
|
80357
|
-
const zTitledMultiSelectItems =
|
|
80393
|
+
const zTitledMultiSelectItems = object({
|
|
80358
80394
|
anyOf: array$3(zEnumOption)
|
|
80359
80395
|
});
|
|
80360
80396
|
const zToolCallContent = union$3([
|
|
80361
|
-
zContent.and(
|
|
80397
|
+
zContent.and(object({
|
|
80362
80398
|
type: literal("content")
|
|
80363
80399
|
})),
|
|
80364
|
-
zDiff.and(
|
|
80400
|
+
zDiff.and(object({
|
|
80365
80401
|
type: literal("diff")
|
|
80366
80402
|
})),
|
|
80367
|
-
zTerminal.and(
|
|
80403
|
+
zTerminal.and(object({
|
|
80368
80404
|
type: literal("terminal")
|
|
80369
80405
|
}))
|
|
80370
80406
|
]);
|
|
80371
80407
|
const zToolCallId = string$2();
|
|
80372
|
-
const
|
|
80408
|
+
const zElicitationSessionScope = object({
|
|
80409
|
+
sessionId: zSessionId,
|
|
80410
|
+
toolCallId: zToolCallId.nullish()
|
|
80411
|
+
});
|
|
80412
|
+
const zElicitationUrlMode = intersection(union$3([
|
|
80413
|
+
zElicitationSessionScope,
|
|
80414
|
+
zElicitationRequestScope
|
|
80415
|
+
]), object({
|
|
80416
|
+
elicitationId: zElicitationId,
|
|
80417
|
+
url: string$2().url()
|
|
80418
|
+
}));
|
|
80419
|
+
const zToolCallLocation = object({
|
|
80373
80420
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80374
80421
|
line: number$3().int().gte(0).max(4294967295, {
|
|
80375
80422
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
@@ -80394,7 +80441,7 @@ Task description:
|
|
|
80394
80441
|
literal("switch_mode"),
|
|
80395
80442
|
literal("other")
|
|
80396
80443
|
]);
|
|
80397
|
-
const zToolCall =
|
|
80444
|
+
const zToolCall = object({
|
|
80398
80445
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80399
80446
|
content: array$3(zToolCallContent).optional(),
|
|
80400
80447
|
kind: zToolKind.optional(),
|
|
@@ -80405,7 +80452,7 @@ Task description:
|
|
|
80405
80452
|
title: string$2(),
|
|
80406
80453
|
toolCallId: zToolCallId
|
|
80407
80454
|
});
|
|
80408
|
-
const zToolCallUpdate =
|
|
80455
|
+
const zToolCallUpdate = object({
|
|
80409
80456
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80410
80457
|
content: array$3(zToolCallContent).nullish(),
|
|
80411
80458
|
kind: zToolKind.nullish(),
|
|
@@ -80416,28 +80463,28 @@ Task description:
|
|
|
80416
80463
|
title: string$2().nullish(),
|
|
80417
80464
|
toolCallId: zToolCallId
|
|
80418
80465
|
});
|
|
80419
|
-
const zRequestPermissionRequest =
|
|
80466
|
+
const zRequestPermissionRequest = object({
|
|
80420
80467
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80421
80468
|
options: array$3(zPermissionOption),
|
|
80422
80469
|
sessionId: zSessionId,
|
|
80423
80470
|
toolCall: zToolCallUpdate
|
|
80424
80471
|
});
|
|
80425
|
-
const zUnstructuredCommandInput =
|
|
80472
|
+
const zUnstructuredCommandInput = object({
|
|
80426
80473
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80427
80474
|
hint: string$2()
|
|
80428
80475
|
});
|
|
80429
80476
|
const zAvailableCommandInput = zUnstructuredCommandInput;
|
|
80430
|
-
const zAvailableCommand =
|
|
80477
|
+
const zAvailableCommand = object({
|
|
80431
80478
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80432
80479
|
description: string$2(),
|
|
80433
80480
|
input: zAvailableCommandInput.nullish(),
|
|
80434
80481
|
name: string$2()
|
|
80435
80482
|
});
|
|
80436
|
-
const zAvailableCommandsUpdate =
|
|
80483
|
+
const zAvailableCommandsUpdate = object({
|
|
80437
80484
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80438
80485
|
availableCommands: array$3(zAvailableCommand)
|
|
80439
80486
|
});
|
|
80440
|
-
const zUntitledMultiSelectItems =
|
|
80487
|
+
const zUntitledMultiSelectItems = object({
|
|
80441
80488
|
enum: array$3(string$2()),
|
|
80442
80489
|
type: zElicitationStringType
|
|
80443
80490
|
});
|
|
@@ -80445,7 +80492,7 @@ Task description:
|
|
|
80445
80492
|
zUntitledMultiSelectItems,
|
|
80446
80493
|
zTitledMultiSelectItems
|
|
80447
80494
|
]);
|
|
80448
|
-
const zMultiSelectPropertySchema =
|
|
80495
|
+
const zMultiSelectPropertySchema = object({
|
|
80449
80496
|
default: array$3(string$2()).nullish(),
|
|
80450
80497
|
description: string$2().nullish(),
|
|
80451
80498
|
items: zMultiSelectItems,
|
|
@@ -80454,45 +80501,47 @@ Task description:
|
|
|
80454
80501
|
title: string$2().nullish()
|
|
80455
80502
|
});
|
|
80456
80503
|
const zElicitationPropertySchema = union$3([
|
|
80457
|
-
zStringPropertySchema.and(
|
|
80504
|
+
zStringPropertySchema.and(object({
|
|
80458
80505
|
type: literal("string")
|
|
80459
80506
|
})),
|
|
80460
|
-
zNumberPropertySchema.and(
|
|
80507
|
+
zNumberPropertySchema.and(object({
|
|
80461
80508
|
type: literal("number")
|
|
80462
80509
|
})),
|
|
80463
|
-
zIntegerPropertySchema.and(
|
|
80510
|
+
zIntegerPropertySchema.and(object({
|
|
80464
80511
|
type: literal("integer")
|
|
80465
80512
|
})),
|
|
80466
|
-
zBooleanPropertySchema.and(
|
|
80513
|
+
zBooleanPropertySchema.and(object({
|
|
80467
80514
|
type: literal("boolean")
|
|
80468
80515
|
})),
|
|
80469
|
-
zMultiSelectPropertySchema.and(
|
|
80516
|
+
zMultiSelectPropertySchema.and(object({
|
|
80470
80517
|
type: literal("array")
|
|
80471
80518
|
}))
|
|
80472
80519
|
]);
|
|
80473
|
-
const zElicitationSchema =
|
|
80520
|
+
const zElicitationSchema = object({
|
|
80474
80521
|
description: string$2().nullish(),
|
|
80475
80522
|
properties: record(string$2(), zElicitationPropertySchema).optional().default({}),
|
|
80476
80523
|
required: array$3(string$2()).nullish(),
|
|
80477
80524
|
title: string$2().nullish(),
|
|
80478
80525
|
type: zElicitationSchemaType.optional().default("object")
|
|
80479
80526
|
});
|
|
80480
|
-
const zElicitationFormMode =
|
|
80527
|
+
const zElicitationFormMode = intersection(union$3([
|
|
80528
|
+
zElicitationSessionScope,
|
|
80529
|
+
zElicitationRequestScope
|
|
80530
|
+
]), object({
|
|
80481
80531
|
requestedSchema: zElicitationSchema
|
|
80482
|
-
});
|
|
80483
|
-
const
|
|
80484
|
-
zElicitationFormMode.and(
|
|
80532
|
+
}));
|
|
80533
|
+
const zCreateElicitationRequest = intersection(union$3([
|
|
80534
|
+
zElicitationFormMode.and(object({
|
|
80485
80535
|
mode: literal("form")
|
|
80486
80536
|
})),
|
|
80487
|
-
zElicitationUrlMode.and(
|
|
80537
|
+
zElicitationUrlMode.and(object({
|
|
80488
80538
|
mode: literal("url")
|
|
80489
80539
|
}))
|
|
80490
|
-
]),
|
|
80540
|
+
]), object({
|
|
80491
80541
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80492
|
-
message: string$2()
|
|
80493
|
-
sessionId: zSessionId
|
|
80542
|
+
message: string$2()
|
|
80494
80543
|
}));
|
|
80495
|
-
const zUsage =
|
|
80544
|
+
const zUsage = object({
|
|
80496
80545
|
cachedReadTokens: number$3().nullish(),
|
|
80497
80546
|
cachedWriteTokens: number$3().nullish(),
|
|
80498
80547
|
inputTokens: number$3(),
|
|
@@ -80500,18 +80549,21 @@ Task description:
|
|
|
80500
80549
|
thoughtTokens: number$3().nullish(),
|
|
80501
80550
|
totalTokens: number$3()
|
|
80502
80551
|
});
|
|
80503
|
-
const zPromptResponse =
|
|
80552
|
+
const zPromptResponse = object({
|
|
80504
80553
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80505
80554
|
stopReason: zStopReason,
|
|
80506
80555
|
usage: zUsage.nullish(),
|
|
80507
80556
|
userMessageId: string$2().nullish()
|
|
80508
80557
|
});
|
|
80509
80558
|
union$3([
|
|
80510
|
-
|
|
80559
|
+
object({
|
|
80511
80560
|
id: zRequestId,
|
|
80512
80561
|
result: union$3([
|
|
80513
80562
|
zInitializeResponse,
|
|
80514
80563
|
zAuthenticateResponse,
|
|
80564
|
+
zListProvidersResponse,
|
|
80565
|
+
zSetProvidersResponse,
|
|
80566
|
+
zDisableProvidersResponse,
|
|
80515
80567
|
zLogoutResponse,
|
|
80516
80568
|
zNewSessionResponse,
|
|
80517
80569
|
zLoadSessionResponse,
|
|
@@ -80529,93 +80581,96 @@ Task description:
|
|
|
80529
80581
|
zExtResponse
|
|
80530
80582
|
])
|
|
80531
80583
|
}),
|
|
80532
|
-
|
|
80584
|
+
object({
|
|
80533
80585
|
error: zError,
|
|
80534
80586
|
id: zRequestId
|
|
80535
80587
|
})
|
|
80536
80588
|
]);
|
|
80537
|
-
const zUsageUpdate =
|
|
80589
|
+
const zUsageUpdate = object({
|
|
80538
80590
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80539
80591
|
cost: zCost.nullish(),
|
|
80540
80592
|
size: number$3(),
|
|
80541
80593
|
used: number$3()
|
|
80542
80594
|
});
|
|
80543
80595
|
const zSessionUpdate = union$3([
|
|
80544
|
-
zContentChunk.and(
|
|
80596
|
+
zContentChunk.and(object({
|
|
80545
80597
|
sessionUpdate: literal("user_message_chunk")
|
|
80546
80598
|
})),
|
|
80547
|
-
zContentChunk.and(
|
|
80599
|
+
zContentChunk.and(object({
|
|
80548
80600
|
sessionUpdate: literal("agent_message_chunk")
|
|
80549
80601
|
})),
|
|
80550
|
-
zContentChunk.and(
|
|
80602
|
+
zContentChunk.and(object({
|
|
80551
80603
|
sessionUpdate: literal("agent_thought_chunk")
|
|
80552
80604
|
})),
|
|
80553
|
-
zToolCall.and(
|
|
80605
|
+
zToolCall.and(object({
|
|
80554
80606
|
sessionUpdate: literal("tool_call")
|
|
80555
80607
|
})),
|
|
80556
|
-
zToolCallUpdate.and(
|
|
80608
|
+
zToolCallUpdate.and(object({
|
|
80557
80609
|
sessionUpdate: literal("tool_call_update")
|
|
80558
80610
|
})),
|
|
80559
|
-
zPlan.and(
|
|
80611
|
+
zPlan.and(object({
|
|
80560
80612
|
sessionUpdate: literal("plan")
|
|
80561
80613
|
})),
|
|
80562
|
-
zAvailableCommandsUpdate.and(
|
|
80614
|
+
zAvailableCommandsUpdate.and(object({
|
|
80563
80615
|
sessionUpdate: literal("available_commands_update")
|
|
80564
80616
|
})),
|
|
80565
|
-
zCurrentModeUpdate.and(
|
|
80617
|
+
zCurrentModeUpdate.and(object({
|
|
80566
80618
|
sessionUpdate: literal("current_mode_update")
|
|
80567
80619
|
})),
|
|
80568
|
-
zConfigOptionUpdate.and(
|
|
80620
|
+
zConfigOptionUpdate.and(object({
|
|
80569
80621
|
sessionUpdate: literal("config_option_update")
|
|
80570
80622
|
})),
|
|
80571
|
-
zSessionInfoUpdate.and(
|
|
80623
|
+
zSessionInfoUpdate.and(object({
|
|
80572
80624
|
sessionUpdate: literal("session_info_update")
|
|
80573
80625
|
})),
|
|
80574
|
-
zUsageUpdate.and(
|
|
80626
|
+
zUsageUpdate.and(object({
|
|
80575
80627
|
sessionUpdate: literal("usage_update")
|
|
80576
80628
|
}))
|
|
80577
80629
|
]);
|
|
80578
|
-
const zSessionNotification =
|
|
80630
|
+
const zSessionNotification = object({
|
|
80579
80631
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80580
80632
|
sessionId: zSessionId,
|
|
80581
80633
|
update: zSessionUpdate
|
|
80582
80634
|
});
|
|
80583
|
-
|
|
80635
|
+
object({
|
|
80584
80636
|
method: string$2(),
|
|
80585
80637
|
params: union$3([
|
|
80586
80638
|
zSessionNotification,
|
|
80587
|
-
|
|
80639
|
+
zCompleteElicitationNotification,
|
|
80588
80640
|
zExtNotification
|
|
80589
80641
|
]).nullish()
|
|
80590
80642
|
});
|
|
80591
|
-
const zWaitForTerminalExitRequest =
|
|
80643
|
+
const zWaitForTerminalExitRequest = object({
|
|
80592
80644
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80593
80645
|
sessionId: zSessionId,
|
|
80594
80646
|
terminalId: string$2()
|
|
80595
80647
|
});
|
|
80596
|
-
const zWaitForTerminalExitResponse =
|
|
80648
|
+
const zWaitForTerminalExitResponse = object({
|
|
80597
80649
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80598
80650
|
exitCode: number$3().int().gte(0).max(4294967295, {
|
|
80599
80651
|
message: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
80600
80652
|
}).nullish(),
|
|
80601
80653
|
signal: string$2().nullish()
|
|
80602
80654
|
});
|
|
80603
|
-
const zWorkspaceFolder =
|
|
80655
|
+
const zWorkspaceFolder = object({
|
|
80604
80656
|
name: string$2(),
|
|
80605
80657
|
uri: string$2()
|
|
80606
80658
|
});
|
|
80607
|
-
const zStartNesRequest =
|
|
80659
|
+
const zStartNesRequest = object({
|
|
80608
80660
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80609
80661
|
repository: zNesRepository.nullish(),
|
|
80610
80662
|
workspaceFolders: array$3(zWorkspaceFolder).nullish(),
|
|
80611
80663
|
workspaceUri: string$2().nullish()
|
|
80612
80664
|
});
|
|
80613
|
-
|
|
80665
|
+
object({
|
|
80614
80666
|
id: zRequestId,
|
|
80615
80667
|
method: string$2(),
|
|
80616
80668
|
params: union$3([
|
|
80617
80669
|
zInitializeRequest,
|
|
80618
80670
|
zAuthenticateRequest,
|
|
80671
|
+
zListProvidersRequest,
|
|
80672
|
+
zSetProvidersRequest,
|
|
80673
|
+
zDisableProvidersRequest,
|
|
80619
80674
|
zLogoutRequest,
|
|
80620
80675
|
zNewSessionRequest,
|
|
80621
80676
|
zLoadSessionRequest,
|
|
@@ -80633,13 +80688,13 @@ Task description:
|
|
|
80633
80688
|
zExtRequest
|
|
80634
80689
|
]).nullish()
|
|
80635
80690
|
});
|
|
80636
|
-
const zWriteTextFileRequest =
|
|
80691
|
+
const zWriteTextFileRequest = object({
|
|
80637
80692
|
_meta: record(string$2(), unknown()).nullish(),
|
|
80638
80693
|
content: string$2(),
|
|
80639
80694
|
path: string$2(),
|
|
80640
80695
|
sessionId: zSessionId
|
|
80641
80696
|
});
|
|
80642
|
-
|
|
80697
|
+
object({
|
|
80643
80698
|
id: zRequestId,
|
|
80644
80699
|
method: string$2(),
|
|
80645
80700
|
params: union$3([
|
|
@@ -80651,15 +80706,15 @@ Task description:
|
|
|
80651
80706
|
zReleaseTerminalRequest,
|
|
80652
80707
|
zWaitForTerminalExitRequest,
|
|
80653
80708
|
zKillTerminalRequest,
|
|
80654
|
-
|
|
80709
|
+
zCreateElicitationRequest,
|
|
80655
80710
|
zExtRequest
|
|
80656
80711
|
]).nullish()
|
|
80657
80712
|
});
|
|
80658
|
-
const zWriteTextFileResponse =
|
|
80713
|
+
const zWriteTextFileResponse = object({
|
|
80659
80714
|
_meta: record(string$2(), unknown()).nullish()
|
|
80660
80715
|
});
|
|
80661
80716
|
union$3([
|
|
80662
|
-
|
|
80717
|
+
object({
|
|
80663
80718
|
id: zRequestId,
|
|
80664
80719
|
result: union$3([
|
|
80665
80720
|
zWriteTextFileResponse,
|
|
@@ -80670,11 +80725,11 @@ Task description:
|
|
|
80670
80725
|
zReleaseTerminalResponse,
|
|
80671
80726
|
zWaitForTerminalExitResponse,
|
|
80672
80727
|
zKillTerminalResponse,
|
|
80673
|
-
|
|
80728
|
+
zCreateElicitationResponse,
|
|
80674
80729
|
zExtResponse
|
|
80675
80730
|
])
|
|
80676
80731
|
}),
|
|
80677
|
-
|
|
80732
|
+
object({
|
|
80678
80733
|
error: zError,
|
|
80679
80734
|
id: zRequestId
|
|
80680
80735
|
})
|
|
@@ -91164,7 +91219,8 @@ ${val.stack}`;
|
|
|
91164
91219
|
const requestUrl = this.subresourceEndpoint("/bootstrap");
|
|
91165
91220
|
const response = await this.http.fetchAuthorized(requestUrl, {
|
|
91166
91221
|
method: "GET",
|
|
91167
|
-
headers: this.mergeHeaders(input2.headers)
|
|
91222
|
+
headers: this.mergeHeaders(input2.headers),
|
|
91223
|
+
signal: input2.signal
|
|
91168
91224
|
}, this.timeoutConfig.connectTimeoutMs, "connect");
|
|
91169
91225
|
if (!response.ok) return {
|
|
91170
91226
|
ok: false,
|
|
@@ -92710,8 +92766,10 @@ stream:${scope2.streamId}`;
|
|
|
92710
92766
|
}
|
|
92711
92767
|
};
|
|
92712
92768
|
}
|
|
92713
|
-
async bootstrap() {
|
|
92714
|
-
const result = await this.client.bootstrap(
|
|
92769
|
+
async bootstrap(signal) {
|
|
92770
|
+
const result = await this.client.bootstrap({
|
|
92771
|
+
signal
|
|
92772
|
+
});
|
|
92715
92773
|
if (!result.ok) throw this.toTransportFailure(result.result);
|
|
92716
92774
|
return {
|
|
92717
92775
|
nextOffset: result.result.nextOffset,
|
|
@@ -94090,7 +94148,7 @@ stream:${scope2.streamId}`;
|
|
|
94090
94148
|
async startJoin(state2) {
|
|
94091
94149
|
try {
|
|
94092
94150
|
state2.requestController ??= new AbortController();
|
|
94093
|
-
const joined = await this.performInitialJoinSync(state2.liveMode);
|
|
94151
|
+
const joined = await this.performInitialJoinSync(state2.liveMode, state2.requestController?.signal);
|
|
94094
94152
|
state2.cursor = joined.cursor;
|
|
94095
94153
|
state2.streamCursor = joined.streamCursor;
|
|
94096
94154
|
state2.liveMode = joined.liveMode;
|
|
@@ -94133,8 +94191,8 @@ stream:${scope2.streamId}`;
|
|
|
94133
94191
|
}
|
|
94134
94192
|
return cursor;
|
|
94135
94193
|
}
|
|
94136
|
-
async performInitialJoinSync(preferredLiveMode) {
|
|
94137
|
-
const initial = await this.finalizeDirectLocalAppendIfNeeded(await this.resolveInitialRemoteState());
|
|
94194
|
+
async performInitialJoinSync(preferredLiveMode, signal) {
|
|
94195
|
+
const initial = await this.finalizeDirectLocalAppendIfNeeded(await this.resolveInitialRemoteState(signal));
|
|
94138
94196
|
let cursor = initial.cursor;
|
|
94139
94197
|
let localExportRefVersion = cursor.serverLowerBoundVersion;
|
|
94140
94198
|
let streamCursor = initial.streamCursor;
|
|
@@ -94143,7 +94201,7 @@ stream:${scope2.streamId}`;
|
|
|
94143
94201
|
localExportRefVersion = exportedLocal.nextRefVersion;
|
|
94144
94202
|
if (exportedLocal.batch != null) {
|
|
94145
94203
|
cursor = await this.appendLocalBatch(cursor, exportedLocal.batch);
|
|
94146
|
-
const caughtUp = await this.catchup(cursor);
|
|
94204
|
+
const caughtUp = await this.catchup(cursor, void 0, void 0, void 0, signal);
|
|
94147
94205
|
cursor = caughtUp.cursor;
|
|
94148
94206
|
streamCursor = caughtUp.streamCursor;
|
|
94149
94207
|
}
|
|
@@ -94162,31 +94220,37 @@ stream:${scope2.streamId}`;
|
|
|
94162
94220
|
serverLowerBoundVersion: this.adapter.emptyVersion()
|
|
94163
94221
|
});
|
|
94164
94222
|
}
|
|
94165
|
-
async resolveInitialRemoteState() {
|
|
94223
|
+
async resolveInitialRemoteState(signal) {
|
|
94166
94224
|
const loaded = await this.remoteCursorStore.load(this.streamUrl);
|
|
94167
94225
|
const cursor = loaded ?? this.createInitialCursor();
|
|
94168
94226
|
try {
|
|
94169
|
-
if (loaded == null) return await this.bootstrapState(cursor
|
|
94227
|
+
if (loaded == null) return await this.bootstrapState(cursor, {
|
|
94228
|
+
signal
|
|
94229
|
+
});
|
|
94170
94230
|
const caughtUp = await this.catchupOrGone(cursor, {
|
|
94171
|
-
goneStrategy: "return-gone"
|
|
94231
|
+
goneStrategy: "return-gone",
|
|
94232
|
+
signal
|
|
94172
94233
|
});
|
|
94173
|
-
if ("kind" in caughtUp) return await this.recoverFromGoneWithLocalBootstrap(cursor);
|
|
94234
|
+
if ("kind" in caughtUp) return await this.recoverFromGoneWithLocalBootstrap(cursor, signal);
|
|
94174
94235
|
return caughtUp;
|
|
94175
94236
|
} catch (error2) {
|
|
94176
94237
|
if (!isStreamNotFoundError(error2) || !this.createStreamIfMissing) throw error2;
|
|
94177
94238
|
await this.ensureStreamExists();
|
|
94178
|
-
return await this.bootstrapState(this.createInitialCursor()
|
|
94239
|
+
return await this.bootstrapState(this.createInitialCursor(), {
|
|
94240
|
+
signal
|
|
94241
|
+
});
|
|
94179
94242
|
}
|
|
94180
94243
|
}
|
|
94181
94244
|
async bootstrapState(cursor, options = {}) {
|
|
94182
94245
|
const cursorManager = options.cursorManager ?? this.cursorManager;
|
|
94183
|
-
const result = await this.client.bootstrap();
|
|
94246
|
+
const result = await this.client.bootstrap(options.signal);
|
|
94184
94247
|
let saved = await cursorManager.applyBootstrapPayload(cursor, result.snapshot, result.updates, result.nextOffset);
|
|
94185
94248
|
let bootstrapCursor = result.streamCursor;
|
|
94186
94249
|
if (!result.upToDate) {
|
|
94187
94250
|
const caughtUp = await this.catchupOrGone(saved, {
|
|
94188
94251
|
streamCursor: bootstrapCursor,
|
|
94189
|
-
cursorManager
|
|
94252
|
+
cursorManager,
|
|
94253
|
+
signal: options.signal
|
|
94190
94254
|
});
|
|
94191
94255
|
if ("kind" in caughtUp) throw new Error("bootstrap catch-up unexpectedly returned gone");
|
|
94192
94256
|
saved = caughtUp.cursor;
|
|
@@ -94197,11 +94261,12 @@ stream:${scope2.streamId}`;
|
|
|
94197
94261
|
streamCursor: bootstrapCursor
|
|
94198
94262
|
};
|
|
94199
94263
|
}
|
|
94200
|
-
async catchup(cursor, live, streamCursor, onRemoteVersionApplied) {
|
|
94264
|
+
async catchup(cursor, live, streamCursor, onRemoteVersionApplied, signal) {
|
|
94201
94265
|
const result = await this.catchupOrGone(cursor, {
|
|
94202
94266
|
live,
|
|
94203
94267
|
streamCursor,
|
|
94204
|
-
onRemoteVersionApplied
|
|
94268
|
+
onRemoteVersionApplied,
|
|
94269
|
+
signal
|
|
94205
94270
|
});
|
|
94206
94271
|
if ("kind" in result) throw new Error("catchup unexpectedly returned gone");
|
|
94207
94272
|
return result;
|
|
@@ -94213,7 +94278,7 @@ stream:${scope2.streamId}`;
|
|
|
94213
94278
|
const cursorManager = options.cursorManager ?? this.cursorManager;
|
|
94214
94279
|
while (true) {
|
|
94215
94280
|
const requestOffset = current2.nextOffset;
|
|
94216
|
-
const response = await this.client.readFromOffset(requestOffset, currentStreamCursor, options.live);
|
|
94281
|
+
const response = await this.client.readFromOffset(requestOffset, currentStreamCursor, options.live, options.signal);
|
|
94217
94282
|
if (response.kind === "gone") {
|
|
94218
94283
|
if (goneStrategy === "return-gone") return StreamsCrdt2.GONE_CATCHUP;
|
|
94219
94284
|
return await this.bootstrapState({
|
|
@@ -94221,7 +94286,8 @@ stream:${scope2.streamId}`;
|
|
|
94221
94286
|
nextOffset: "-1",
|
|
94222
94287
|
serverLowerBoundVersion: this.adapter.emptyVersion()
|
|
94223
94288
|
}, {
|
|
94224
|
-
cursorManager
|
|
94289
|
+
cursorManager,
|
|
94290
|
+
signal: options.signal
|
|
94225
94291
|
});
|
|
94226
94292
|
}
|
|
94227
94293
|
const result = response.value;
|
|
@@ -94388,9 +94454,10 @@ stream:${scope2.streamId}`;
|
|
|
94388
94454
|
if (isolated == null) return null;
|
|
94389
94455
|
return this.createCursorManager(isolated, async (cursor) => cursor);
|
|
94390
94456
|
}
|
|
94391
|
-
async inferRemoteAndAppendLocal(bootstrapCursor, cursorManager) {
|
|
94457
|
+
async inferRemoteAndAppendLocal(bootstrapCursor, cursorManager, signal) {
|
|
94392
94458
|
const inferredRemote = await this.bootstrapState(bootstrapCursor, {
|
|
94393
|
-
cursorManager
|
|
94459
|
+
cursorManager,
|
|
94460
|
+
signal
|
|
94394
94461
|
});
|
|
94395
94462
|
let pendingAppend;
|
|
94396
94463
|
if (this.frozenLocalAppend != null) {
|
|
@@ -94400,23 +94467,26 @@ stream:${scope2.streamId}`;
|
|
|
94400
94467
|
const localBatch = this.exportUpdates(inferredRemote.cursor.serverLowerBoundVersion);
|
|
94401
94468
|
if (localBatch.batch != null) pendingAppend = await this.appendLocalBatchRemote(inferredRemote.cursor, localBatch.batch);
|
|
94402
94469
|
}
|
|
94403
|
-
const result = await this.bootstrapState(bootstrapCursor
|
|
94470
|
+
const result = await this.bootstrapState(bootstrapCursor, {
|
|
94471
|
+
signal
|
|
94472
|
+
});
|
|
94404
94473
|
if (pendingAppend != null) this.commitProducerAck(pendingAppend.producerAck);
|
|
94405
94474
|
return result;
|
|
94406
94475
|
}
|
|
94407
|
-
async recoverFromGoneWithLocalBootstrap(cursor) {
|
|
94476
|
+
async recoverFromGoneWithLocalBootstrap(cursor, signal) {
|
|
94408
94477
|
const isolatedCursorManager = await this.createIsolatedCursorManager();
|
|
94409
94478
|
const bootstrapCursor = {
|
|
94410
94479
|
...cursor,
|
|
94411
94480
|
nextOffset: "-1",
|
|
94412
94481
|
serverLowerBoundVersion: this.adapter.emptyVersion()
|
|
94413
94482
|
};
|
|
94414
|
-
if (isolatedCursorManager != null) return await this.inferRemoteAndAppendLocal(bootstrapCursor, isolatedCursorManager);
|
|
94483
|
+
if (isolatedCursorManager != null) return await this.inferRemoteAndAppendLocal(bootstrapCursor, isolatedCursorManager, signal);
|
|
94415
94484
|
const preservedLocalSnapshot = this.adapter.exportSnapshot();
|
|
94416
94485
|
let restoredLocalSnapshot = false;
|
|
94417
94486
|
try {
|
|
94418
94487
|
const inferredRemote = await this.bootstrapState(bootstrapCursor, {
|
|
94419
|
-
cursorManager: this.volatileCursorManager
|
|
94488
|
+
cursorManager: this.volatileCursorManager,
|
|
94489
|
+
signal
|
|
94420
94490
|
});
|
|
94421
94491
|
await this.adapter.applySnapshot(preservedLocalSnapshot);
|
|
94422
94492
|
restoredLocalSnapshot = true;
|
|
@@ -94428,7 +94498,9 @@ stream:${scope2.streamId}`;
|
|
|
94428
94498
|
const localBatch = this.exportUpdates(inferredRemote.cursor.serverLowerBoundVersion);
|
|
94429
94499
|
if (localBatch.batch != null) pendingAppend = await this.appendLocalBatchRemote(inferredRemote.cursor, localBatch.batch);
|
|
94430
94500
|
}
|
|
94431
|
-
const result = await this.bootstrapState(bootstrapCursor
|
|
94501
|
+
const result = await this.bootstrapState(bootstrapCursor, {
|
|
94502
|
+
signal
|
|
94503
|
+
});
|
|
94432
94504
|
if (pendingAppend != null) this.commitProducerAck(pendingAppend.producerAck);
|
|
94433
94505
|
return result;
|
|
94434
94506
|
} catch (error2) {
|
|
@@ -94465,6 +94537,8 @@ stream:${scope2.streamId}`;
|
|
|
94465
94537
|
...state2.cursor,
|
|
94466
94538
|
nextOffset: "-1",
|
|
94467
94539
|
serverLowerBoundVersion: this.adapter.emptyVersion()
|
|
94540
|
+
}, {
|
|
94541
|
+
signal: capturedController?.signal
|
|
94468
94542
|
});
|
|
94469
94543
|
state2.cursor = bootstrapped2.cursor;
|
|
94470
94544
|
state2.streamCursor = bootstrapped2.streamCursor;
|
|
@@ -114189,7 +114263,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
114189
114263
|
const agent = proxyUrl ? new distExports.HttpsProxyAgent(proxyUrl) : void 0;
|
|
114190
114264
|
const logger2 = getLogger("loro:websocket");
|
|
114191
114265
|
logger2.debug(`Creating WebSocket url=${sanitizeUrlForLogging(urlString)} proxy=${proxyUrl ? redactProxyUrl(proxyUrl) : "none"} agentValid=${!!agent}`);
|
|
114192
|
-
if (
|
|
114266
|
+
if (globalThis.Bun && proxyUrl) {
|
|
114193
114267
|
logger2.debug("Bun does not support WebSocket proxy yet: https://github.com/oven-sh/bun/issues/14522");
|
|
114194
114268
|
}
|
|
114195
114269
|
super(urlString, protocols, {
|
|
@@ -115700,12 +115774,12 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
115700
115774
|
}));
|
|
115701
115775
|
return result.nextOffset;
|
|
115702
115776
|
},
|
|
115703
|
-
longPollJson: async (streamId, state2,
|
|
115777
|
+
longPollJson: async (streamId, state2, readOptions) => {
|
|
115704
115778
|
const result = unwrapStreamResult("long-poll stream", streamId, await getStreamClient(streamId).readOnce({
|
|
115705
115779
|
offset: state2.nextOffset ?? "now",
|
|
115706
115780
|
cursor: state2.cursor,
|
|
115707
115781
|
live: "long-poll",
|
|
115708
|
-
signal:
|
|
115782
|
+
signal: readOptions?.signal
|
|
115709
115783
|
}));
|
|
115710
115784
|
return {
|
|
115711
115785
|
messages: result.payload === null ? [] : parseJsonBatchPayload(result.payload, streamId, "long-poll read"),
|
|
@@ -115714,13 +115788,13 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
115714
115788
|
upToDate: result.upToDate
|
|
115715
115789
|
};
|
|
115716
115790
|
},
|
|
115717
|
-
readJsonLive: async (streamId, state2, onBatch,
|
|
115791
|
+
readJsonLive: async (streamId, state2, onBatch, liveOptions) => {
|
|
115718
115792
|
const pendingMessages = [];
|
|
115719
115793
|
const streamClient = getStreamClient(streamId);
|
|
115720
115794
|
for await (const event of streamClient.live({
|
|
115721
115795
|
offset: state2.nextOffset ?? "now",
|
|
115722
115796
|
mode: "auto",
|
|
115723
|
-
signal:
|
|
115797
|
+
signal: liveOptions?.signal
|
|
115724
115798
|
})) {
|
|
115725
115799
|
switch (event.type) {
|
|
115726
115800
|
case "data":
|
|
@@ -116817,6 +116891,8 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
116817
116891
|
session_set_model: "session/set_model"
|
|
116818
116892
|
};
|
|
116819
116893
|
const CLIENT_METHODS = {
|
|
116894
|
+
elicitation_complete: "elicitation/complete",
|
|
116895
|
+
elicitation_create: "elicitation/create",
|
|
116820
116896
|
fs_read_text_file: "fs/read_text_file",
|
|
116821
116897
|
fs_write_text_file: "fs/write_text_file",
|
|
116822
116898
|
session_request_permission: "session/request_permission",
|
|
@@ -116839,6 +116915,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
116839
116915
|
while (true) {
|
|
116840
116916
|
const { value, done: done2 } = await reader2.read();
|
|
116841
116917
|
if (done2) {
|
|
116918
|
+
content += textDecoder2.decode();
|
|
116842
116919
|
break;
|
|
116843
116920
|
}
|
|
116844
116921
|
if (!value) {
|
|
@@ -116850,17 +116927,26 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
116850
116927
|
const lines2 = content.split("\n");
|
|
116851
116928
|
content = lines2.pop() || "";
|
|
116852
116929
|
for (const line3 of lines2) {
|
|
116853
|
-
const
|
|
116854
|
-
if (
|
|
116930
|
+
const trimmedLine2 = line3.trim();
|
|
116931
|
+
if (trimmedLine2) {
|
|
116855
116932
|
try {
|
|
116856
|
-
const message = JSON.parse(
|
|
116933
|
+
const message = JSON.parse(trimmedLine2);
|
|
116857
116934
|
controller.enqueue(message);
|
|
116858
116935
|
} catch (err2) {
|
|
116859
|
-
console.error("Failed to parse JSON message:",
|
|
116936
|
+
console.error("Failed to parse JSON message:", trimmedLine2, err2);
|
|
116860
116937
|
}
|
|
116861
116938
|
}
|
|
116862
116939
|
}
|
|
116863
116940
|
}
|
|
116941
|
+
const trimmedLine = content.trim();
|
|
116942
|
+
if (trimmedLine) {
|
|
116943
|
+
try {
|
|
116944
|
+
const message = JSON.parse(trimmedLine);
|
|
116945
|
+
controller.enqueue(message);
|
|
116946
|
+
} catch (err2) {
|
|
116947
|
+
console.error("Failed to parse JSON message:", trimmedLine, err2);
|
|
116948
|
+
}
|
|
116949
|
+
}
|
|
116864
116950
|
} catch (err2) {
|
|
116865
116951
|
controller.error(err2);
|
|
116866
116952
|
return;
|
|
@@ -116887,7 +116973,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
116887
116973
|
};
|
|
116888
116974
|
}
|
|
116889
116975
|
class ClientSideConnection {
|
|
116890
|
-
|
|
116976
|
+
connection;
|
|
116891
116977
|
constructor(toClient, stream2) {
|
|
116892
116978
|
const client = toClient(this);
|
|
116893
116979
|
const requestHandler = async (method, params) => {
|
|
@@ -116926,6 +117012,13 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
116926
117012
|
const result = await client.killTerminal?.(validatedParams);
|
|
116927
117013
|
return result ?? {};
|
|
116928
117014
|
}
|
|
117015
|
+
case CLIENT_METHODS.elicitation_create: {
|
|
117016
|
+
if (!client.unstable_createElicitation) {
|
|
117017
|
+
throw RequestError.methodNotFound(method);
|
|
117018
|
+
}
|
|
117019
|
+
const validatedParams = zCreateElicitationRequest.parse(params);
|
|
117020
|
+
return client.unstable_createElicitation(validatedParams);
|
|
117021
|
+
}
|
|
116929
117022
|
default:
|
|
116930
117023
|
if (client.extMethod) {
|
|
116931
117024
|
return client.extMethod(method, params);
|
|
@@ -116939,6 +117032,11 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
116939
117032
|
const validatedParams = zSessionNotification.parse(params);
|
|
116940
117033
|
return client.sessionUpdate(validatedParams);
|
|
116941
117034
|
}
|
|
117035
|
+
case CLIENT_METHODS.elicitation_complete: {
|
|
117036
|
+
if (!client.unstable_completeElicitation) return;
|
|
117037
|
+
const validatedParams = zCompleteElicitationNotification.parse(params);
|
|
117038
|
+
return client.unstable_completeElicitation(validatedParams);
|
|
117039
|
+
}
|
|
116942
117040
|
default:
|
|
116943
117041
|
if (client.extNotification) {
|
|
116944
117042
|
return client.extNotification(method, params);
|
|
@@ -116946,123 +117044,123 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
116946
117044
|
throw RequestError.methodNotFound(method);
|
|
116947
117045
|
}
|
|
116948
117046
|
};
|
|
116949
|
-
this
|
|
117047
|
+
this.connection = new Connection(requestHandler, notificationHandler, stream2);
|
|
116950
117048
|
}
|
|
116951
117049
|
async initialize(params) {
|
|
116952
|
-
return await this
|
|
117050
|
+
return await this.connection.sendRequest(AGENT_METHODS.initialize, params);
|
|
116953
117051
|
}
|
|
116954
117052
|
async newSession(params) {
|
|
116955
|
-
return await this
|
|
117053
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_new, params);
|
|
116956
117054
|
}
|
|
116957
117055
|
async loadSession(params) {
|
|
116958
|
-
return await this
|
|
117056
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_load, params) ?? {};
|
|
116959
117057
|
}
|
|
116960
117058
|
async unstable_forkSession(params) {
|
|
116961
|
-
return await this
|
|
117059
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_fork, params);
|
|
116962
117060
|
}
|
|
116963
117061
|
async listSessions(params) {
|
|
116964
|
-
return await this
|
|
117062
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_list, params);
|
|
116965
117063
|
}
|
|
116966
|
-
async
|
|
116967
|
-
return await this
|
|
117064
|
+
async resumeSession(params) {
|
|
117065
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_resume, params);
|
|
116968
117066
|
}
|
|
116969
|
-
async
|
|
116970
|
-
return await this
|
|
117067
|
+
async closeSession(params) {
|
|
117068
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_close, params);
|
|
116971
117069
|
}
|
|
116972
117070
|
async setSessionMode(params) {
|
|
116973
|
-
return await this
|
|
117071
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_set_mode, params) ?? {};
|
|
116974
117072
|
}
|
|
116975
117073
|
async unstable_setSessionModel(params) {
|
|
116976
|
-
return await this
|
|
117074
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_set_model, params) ?? {};
|
|
116977
117075
|
}
|
|
116978
117076
|
async setSessionConfigOption(params) {
|
|
116979
|
-
return await this
|
|
117077
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_set_config_option, params);
|
|
116980
117078
|
}
|
|
116981
117079
|
async authenticate(params) {
|
|
116982
|
-
return await this
|
|
117080
|
+
return await this.connection.sendRequest(AGENT_METHODS.authenticate, params) ?? {};
|
|
116983
117081
|
}
|
|
116984
117082
|
async unstable_logout(params) {
|
|
116985
|
-
return await this
|
|
117083
|
+
return await this.connection.sendRequest(AGENT_METHODS.logout, params) ?? {};
|
|
116986
117084
|
}
|
|
116987
117085
|
async prompt(params) {
|
|
116988
|
-
return await this
|
|
117086
|
+
return await this.connection.sendRequest(AGENT_METHODS.session_prompt, params);
|
|
116989
117087
|
}
|
|
116990
117088
|
async cancel(params) {
|
|
116991
|
-
return await this
|
|
117089
|
+
return await this.connection.sendNotification(AGENT_METHODS.session_cancel, params);
|
|
116992
117090
|
}
|
|
116993
117091
|
async unstable_startNes(params) {
|
|
116994
|
-
return await this
|
|
117092
|
+
return await this.connection.sendRequest(AGENT_METHODS.nes_start, params);
|
|
116995
117093
|
}
|
|
116996
117094
|
async unstable_suggestNes(params) {
|
|
116997
|
-
return await this
|
|
117095
|
+
return await this.connection.sendRequest(AGENT_METHODS.nes_suggest, params);
|
|
116998
117096
|
}
|
|
116999
117097
|
async unstable_closeNes(params) {
|
|
117000
|
-
return await this
|
|
117098
|
+
return await this.connection.sendRequest(AGENT_METHODS.nes_close, params) ?? {};
|
|
117001
117099
|
}
|
|
117002
117100
|
async unstable_didOpenDocument(params) {
|
|
117003
|
-
return await this
|
|
117101
|
+
return await this.connection.sendNotification(AGENT_METHODS.document_did_open, params);
|
|
117004
117102
|
}
|
|
117005
117103
|
async unstable_didChangeDocument(params) {
|
|
117006
|
-
return await this
|
|
117104
|
+
return await this.connection.sendNotification(AGENT_METHODS.document_did_change, params);
|
|
117007
117105
|
}
|
|
117008
117106
|
async unstable_didCloseDocument(params) {
|
|
117009
|
-
return await this
|
|
117107
|
+
return await this.connection.sendNotification(AGENT_METHODS.document_did_close, params);
|
|
117010
117108
|
}
|
|
117011
117109
|
async unstable_didSaveDocument(params) {
|
|
117012
|
-
return await this
|
|
117110
|
+
return await this.connection.sendNotification(AGENT_METHODS.document_did_save, params);
|
|
117013
117111
|
}
|
|
117014
117112
|
async unstable_didFocusDocument(params) {
|
|
117015
|
-
return await this
|
|
117113
|
+
return await this.connection.sendNotification(AGENT_METHODS.document_did_focus, params);
|
|
117016
117114
|
}
|
|
117017
117115
|
async unstable_acceptNes(params) {
|
|
117018
|
-
return await this
|
|
117116
|
+
return await this.connection.sendNotification(AGENT_METHODS.nes_accept, params);
|
|
117019
117117
|
}
|
|
117020
117118
|
async unstable_rejectNes(params) {
|
|
117021
|
-
return await this
|
|
117119
|
+
return await this.connection.sendNotification(AGENT_METHODS.nes_reject, params);
|
|
117022
117120
|
}
|
|
117023
117121
|
async extMethod(method, params) {
|
|
117024
|
-
return await this
|
|
117122
|
+
return await this.connection.sendRequest(method, params);
|
|
117025
117123
|
}
|
|
117026
117124
|
async extNotification(method, params) {
|
|
117027
|
-
return await this
|
|
117125
|
+
return await this.connection.sendNotification(method, params);
|
|
117028
117126
|
}
|
|
117029
117127
|
get signal() {
|
|
117030
|
-
return this
|
|
117128
|
+
return this.connection.signal;
|
|
117031
117129
|
}
|
|
117032
117130
|
get closed() {
|
|
117033
|
-
return this
|
|
117131
|
+
return this.connection.closed;
|
|
117034
117132
|
}
|
|
117035
117133
|
}
|
|
117036
117134
|
class Connection {
|
|
117037
|
-
|
|
117038
|
-
|
|
117039
|
-
|
|
117040
|
-
|
|
117041
|
-
|
|
117042
|
-
|
|
117043
|
-
|
|
117044
|
-
|
|
117135
|
+
pendingResponses = /* @__PURE__ */ new Map();
|
|
117136
|
+
nextRequestId = 0;
|
|
117137
|
+
requestHandler;
|
|
117138
|
+
notificationHandler;
|
|
117139
|
+
stream;
|
|
117140
|
+
writeQueue = Promise.resolve();
|
|
117141
|
+
abortController = new AbortController();
|
|
117142
|
+
closedPromise;
|
|
117045
117143
|
constructor(requestHandler, notificationHandler, stream2) {
|
|
117046
|
-
this
|
|
117047
|
-
this
|
|
117048
|
-
this
|
|
117049
|
-
this
|
|
117050
|
-
this
|
|
117144
|
+
this.requestHandler = requestHandler;
|
|
117145
|
+
this.notificationHandler = notificationHandler;
|
|
117146
|
+
this.stream = stream2;
|
|
117147
|
+
this.closedPromise = new Promise((resolve2) => {
|
|
117148
|
+
this.abortController.signal.addEventListener("abort", () => resolve2());
|
|
117051
117149
|
});
|
|
117052
|
-
void this
|
|
117150
|
+
void this.receive();
|
|
117053
117151
|
}
|
|
117054
117152
|
get signal() {
|
|
117055
|
-
return this
|
|
117153
|
+
return this.abortController.signal;
|
|
117056
117154
|
}
|
|
117057
117155
|
get closed() {
|
|
117058
|
-
return this
|
|
117156
|
+
return this.closedPromise;
|
|
117059
117157
|
}
|
|
117060
|
-
async
|
|
117158
|
+
async receive() {
|
|
117061
117159
|
let closeError = void 0;
|
|
117062
117160
|
try {
|
|
117063
|
-
const reader2 = this
|
|
117161
|
+
const reader2 = this.stream.readable.getReader();
|
|
117064
117162
|
try {
|
|
117065
|
-
while (!this
|
|
117163
|
+
while (!this.abortController.signal.aborted) {
|
|
117066
117164
|
const { value: message, done: done2 } = await reader2.read();
|
|
117067
117165
|
if (done2) {
|
|
117068
117166
|
break;
|
|
@@ -117071,11 +117169,11 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117071
117169
|
continue;
|
|
117072
117170
|
}
|
|
117073
117171
|
try {
|
|
117074
|
-
this
|
|
117172
|
+
this.processMessage(message);
|
|
117075
117173
|
} catch (err2) {
|
|
117076
117174
|
console.error("Unexpected error during message processing:", message, err2);
|
|
117077
117175
|
if ("id" in message && message.id !== void 0) {
|
|
117078
|
-
this
|
|
117176
|
+
this.sendMessage({
|
|
117079
117177
|
jsonrpc: "2.0",
|
|
117080
117178
|
id: message.id,
|
|
117081
117179
|
error: {
|
|
@@ -117092,47 +117190,47 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117092
117190
|
} catch (error2) {
|
|
117093
117191
|
closeError = error2;
|
|
117094
117192
|
} finally {
|
|
117095
|
-
this
|
|
117193
|
+
this.close(closeError);
|
|
117096
117194
|
}
|
|
117097
117195
|
}
|
|
117098
|
-
|
|
117099
|
-
if (this
|
|
117196
|
+
close(error2) {
|
|
117197
|
+
if (this.abortController.signal.aborted) {
|
|
117100
117198
|
return;
|
|
117101
117199
|
}
|
|
117102
117200
|
const closeError = error2 ?? new Error("ACP connection closed");
|
|
117103
|
-
for (const pendingResponse of this
|
|
117201
|
+
for (const pendingResponse of this.pendingResponses.values()) {
|
|
117104
117202
|
pendingResponse.reject(closeError);
|
|
117105
117203
|
}
|
|
117106
|
-
this
|
|
117107
|
-
this
|
|
117204
|
+
this.pendingResponses.clear();
|
|
117205
|
+
this.abortController.abort(closeError);
|
|
117108
117206
|
}
|
|
117109
|
-
async
|
|
117207
|
+
async processMessage(message) {
|
|
117110
117208
|
if ("method" in message && "id" in message) {
|
|
117111
|
-
const response = await this
|
|
117209
|
+
const response = await this.tryCallRequestHandler(message.method, message.params);
|
|
117112
117210
|
if ("error" in response) {
|
|
117113
117211
|
console.error("Error handling request", message, response.error);
|
|
117114
117212
|
}
|
|
117115
|
-
await this
|
|
117213
|
+
await this.sendMessage({
|
|
117116
117214
|
jsonrpc: "2.0",
|
|
117117
117215
|
id: message.id,
|
|
117118
117216
|
...response
|
|
117119
117217
|
});
|
|
117120
117218
|
} else if ("method" in message) {
|
|
117121
|
-
const response = await this
|
|
117219
|
+
const response = await this.tryCallNotificationHandler(message.method, message.params);
|
|
117122
117220
|
if ("error" in response) {
|
|
117123
117221
|
console.error("Error handling notification", message, response.error);
|
|
117124
117222
|
}
|
|
117125
117223
|
} else if ("id" in message) {
|
|
117126
|
-
this
|
|
117224
|
+
this.handleResponse(message);
|
|
117127
117225
|
} else {
|
|
117128
117226
|
console.error("Invalid message", {
|
|
117129
117227
|
message
|
|
117130
117228
|
});
|
|
117131
117229
|
}
|
|
117132
117230
|
}
|
|
117133
|
-
async
|
|
117231
|
+
async tryCallRequestHandler(method, params) {
|
|
117134
117232
|
try {
|
|
117135
|
-
const result = await this
|
|
117233
|
+
const result = await this.requestHandler(method, params);
|
|
117136
117234
|
return {
|
|
117137
117235
|
result: result ?? null
|
|
117138
117236
|
};
|
|
@@ -117158,9 +117256,9 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117158
117256
|
}
|
|
117159
117257
|
}
|
|
117160
117258
|
}
|
|
117161
|
-
async
|
|
117259
|
+
async tryCallNotificationHandler(method, params) {
|
|
117162
117260
|
try {
|
|
117163
|
-
await this
|
|
117261
|
+
await this.notificationHandler(method, params);
|
|
117164
117262
|
return {
|
|
117165
117263
|
result: null
|
|
117166
117264
|
};
|
|
@@ -117186,8 +117284,8 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117186
117284
|
}
|
|
117187
117285
|
}
|
|
117188
117286
|
}
|
|
117189
|
-
|
|
117190
|
-
const pendingResponse = this
|
|
117287
|
+
handleResponse(response) {
|
|
117288
|
+
const pendingResponse = this.pendingResponses.get(response.id);
|
|
117191
117289
|
if (pendingResponse) {
|
|
117192
117290
|
if ("result" in response) {
|
|
117193
117291
|
pendingResponse.resolve(response.result);
|
|
@@ -117195,21 +117293,23 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117195
117293
|
const { code: code2, message, data } = response.error;
|
|
117196
117294
|
pendingResponse.reject(new RequestError(code2, message, data));
|
|
117197
117295
|
}
|
|
117198
|
-
this
|
|
117296
|
+
this.pendingResponses.delete(response.id);
|
|
117199
117297
|
} else {
|
|
117200
117298
|
console.error("Got response to unknown request", response.id);
|
|
117201
117299
|
}
|
|
117202
117300
|
}
|
|
117203
|
-
|
|
117204
|
-
this
|
|
117205
|
-
const id = this
|
|
117301
|
+
sendRequest(method, params) {
|
|
117302
|
+
this.throwIfClosed();
|
|
117303
|
+
const id = this.nextRequestId++;
|
|
117206
117304
|
const responsePromise = new Promise((resolve2, reject) => {
|
|
117207
|
-
this
|
|
117305
|
+
this.pendingResponses.set(id, {
|
|
117208
117306
|
resolve: resolve2,
|
|
117209
117307
|
reject
|
|
117210
117308
|
});
|
|
117211
117309
|
});
|
|
117212
|
-
|
|
117310
|
+
responsePromise.catch(() => {
|
|
117311
|
+
});
|
|
117312
|
+
void this.sendMessage({
|
|
117213
117313
|
jsonrpc: "2.0",
|
|
117214
117314
|
id,
|
|
117215
117315
|
method,
|
|
@@ -117218,30 +117318,30 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117218
117318
|
return responsePromise;
|
|
117219
117319
|
}
|
|
117220
117320
|
async sendNotification(method, params) {
|
|
117221
|
-
this
|
|
117222
|
-
await this
|
|
117321
|
+
this.throwIfClosed();
|
|
117322
|
+
await this.sendMessage({
|
|
117223
117323
|
jsonrpc: "2.0",
|
|
117224
117324
|
method,
|
|
117225
117325
|
params
|
|
117226
117326
|
});
|
|
117227
117327
|
}
|
|
117228
|
-
|
|
117229
|
-
if (this
|
|
117230
|
-
throw this
|
|
117328
|
+
throwIfClosed() {
|
|
117329
|
+
if (this.abortController.signal.aborted) {
|
|
117330
|
+
throw this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
117231
117331
|
}
|
|
117232
117332
|
}
|
|
117233
|
-
async
|
|
117234
|
-
this
|
|
117235
|
-
const writer = this
|
|
117333
|
+
async sendMessage(message) {
|
|
117334
|
+
this.writeQueue = this.writeQueue.then(async () => {
|
|
117335
|
+
const writer = this.stream.writable.getWriter();
|
|
117236
117336
|
try {
|
|
117237
117337
|
await writer.write(message);
|
|
117238
117338
|
} finally {
|
|
117239
117339
|
writer.releaseLock();
|
|
117240
117340
|
}
|
|
117241
117341
|
}).catch((error2) => {
|
|
117242
|
-
this
|
|
117342
|
+
this.close(error2);
|
|
117243
117343
|
});
|
|
117244
|
-
return this
|
|
117344
|
+
return this.writeQueue;
|
|
117245
117345
|
}
|
|
117246
117346
|
}
|
|
117247
117347
|
class RequestError extends Error {
|
|
@@ -117316,7 +117416,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117316
117416
|
throw err2;
|
|
117317
117417
|
}
|
|
117318
117418
|
logger2.debug(`[${sessionId}] ${operationName} failed after ${attempt + 1} attempt(s) with transport error: ${formatErrorMessage(err2)}`);
|
|
117319
|
-
reportError(`agent-client:${operationName}`, err2 instanceof Error ? err2 : new Error(String(err2)));
|
|
117419
|
+
void reportError(`agent-client:${operationName}`, err2 instanceof Error ? err2 : new Error(String(err2)));
|
|
117320
117420
|
return void 0;
|
|
117321
117421
|
}
|
|
117322
117422
|
}
|
|
@@ -117513,6 +117613,13 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117513
117613
|
return {};
|
|
117514
117614
|
}
|
|
117515
117615
|
async extMethod(method, params) {
|
|
117616
|
+
this.handleExtensionMessage(method, params);
|
|
117617
|
+
return {};
|
|
117618
|
+
}
|
|
117619
|
+
async extNotification(method, params) {
|
|
117620
|
+
this.handleExtensionMessage(method, params);
|
|
117621
|
+
}
|
|
117622
|
+
handleExtensionMessage(method, params) {
|
|
117516
117623
|
const resolvedMethod = method.startsWith("_") ? method.slice(1) : method;
|
|
117517
117624
|
switch (resolvedMethod) {
|
|
117518
117625
|
case "acp_ext:session_usage_update": {
|
|
@@ -117533,10 +117640,6 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117533
117640
|
break;
|
|
117534
117641
|
}
|
|
117535
117642
|
}
|
|
117536
|
-
return {};
|
|
117537
|
-
}
|
|
117538
|
-
async extNotification(_method, _params) {
|
|
117539
|
-
throw new Error("Method not implemented.");
|
|
117540
117643
|
}
|
|
117541
117644
|
async startSession(stream2, workdir, resumeSessionId, timeoutOptions = {}, startupAbort) {
|
|
117542
117645
|
const connection = new ClientSideConnection(() => this, stream2);
|
|
@@ -117569,10 +117672,10 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117569
117672
|
const hasLoadSessionMethod = typeof connection.loadSession === "function";
|
|
117570
117673
|
const resumeCapability = initResponse.agentCapabilities?.sessionCapabilities?.resume;
|
|
117571
117674
|
this.supportsResume = !!resumeCapability;
|
|
117572
|
-
const hasResumeMethod = typeof connection.
|
|
117675
|
+
const hasResumeMethod = typeof connection.resumeSession === "function";
|
|
117573
117676
|
const closeCapability = initResponse.agentCapabilities?.sessionCapabilities?.close;
|
|
117574
117677
|
this.supportsClose = !!closeCapability;
|
|
117575
|
-
const hasCloseMethod = typeof connection.
|
|
117678
|
+
const hasCloseMethod = typeof connection.closeSession === "function";
|
|
117576
117679
|
this.logger.debug(`[${this.options.sessionId}] ACP capabilities (loadSession=${this.supportsLoadSession ? "yes" : "no"} loadSessionMethod=${hasLoadSessionMethod ? "yes" : "no"} resume=${this.supportsResume ? "yes" : "no"} resumeMethod=${hasResumeMethod ? "yes" : "no"} close=${this.supportsClose ? "yes" : "no"} closeMethod=${hasCloseMethod ? "yes" : "no"})`);
|
|
117577
117680
|
this.logger.debug(`[${this.options.sessionId}] About to start new ACP session`);
|
|
117578
117681
|
const newSessionStart = performance$1.now();
|
|
@@ -117589,7 +117692,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117589
117692
|
reasons.push("agent_did_not_advertise_resume_or_loadSession");
|
|
117590
117693
|
}
|
|
117591
117694
|
if (!hasLoadSessionMethod && !hasResumeMethod) {
|
|
117592
|
-
reasons.push("
|
|
117695
|
+
reasons.push("sdk_missing_loadSession_and_resumeSession");
|
|
117593
117696
|
}
|
|
117594
117697
|
const reason = reasons.join(", ");
|
|
117595
117698
|
this.logger.error(`[${this.options.sessionId}] ACP resume unsupported (${reason}): ${resumeSessionId}`);
|
|
@@ -117625,7 +117728,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117625
117728
|
const resumeStart = performance$1.now();
|
|
117626
117729
|
try {
|
|
117627
117730
|
this.logger.debug(`[${this.options.sessionId}] Attempting ACP resume (acpSessionId=${resumeSessionId})`);
|
|
117628
|
-
const resumeResponse = await withAbort(connection.
|
|
117731
|
+
const resumeResponse = await withAbort(connection.resumeSession({
|
|
117629
117732
|
sessionId: resumeSessionId,
|
|
117630
117733
|
cwd: workdir,
|
|
117631
117734
|
mcpServers: []
|
|
@@ -117739,15 +117842,15 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117739
117842
|
this.logger.debug(`[${this.options.sessionId}] Skipping ACP session close: agent did not advertise session.close`);
|
|
117740
117843
|
return false;
|
|
117741
117844
|
}
|
|
117742
|
-
const closeSession2 = this.connection?.
|
|
117845
|
+
const closeSession2 = this.connection?.closeSession;
|
|
117743
117846
|
if (typeof closeSession2 !== "function") {
|
|
117744
|
-
this.logger.debug(`[${this.options.sessionId}] Skipping ACP session close: SDK connection has no
|
|
117847
|
+
this.logger.debug(`[${this.options.sessionId}] Skipping ACP session close: SDK connection has no closeSession`);
|
|
117745
117848
|
return false;
|
|
117746
117849
|
}
|
|
117747
117850
|
this.logger.debug(`[${this.options.sessionId}] Closing ACP session (acpSessionId=${sessionId} timeoutMs=${timeoutMs})`);
|
|
117748
117851
|
await withTimeout(closeSession2.call(this.connection, {
|
|
117749
117852
|
sessionId
|
|
117750
|
-
}), this.logger, "connection.
|
|
117853
|
+
}), this.logger, "connection.closeSession", this.options.sessionId, timeoutMs, Math.min(timeoutMs, 1e3));
|
|
117751
117854
|
this.logger.debug(`[${this.options.sessionId}] ACP session close finished (acpSessionId=${sessionId})`);
|
|
117752
117855
|
return true;
|
|
117753
117856
|
}
|
|
@@ -117883,7 +117986,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
117883
117986
|
},
|
|
117884
117987
|
codex: {
|
|
117885
117988
|
packageName: "acp-extension-codex",
|
|
117886
|
-
version: "0.12.
|
|
117989
|
+
version: "0.12.2",
|
|
117887
117990
|
binName: "acp-extension-codex",
|
|
117888
117991
|
args: [
|
|
117889
117992
|
"-c",
|
|
@@ -118918,6 +119021,7 @@ ${this.stack.split("\n").slice(1).join("\n")}` : this.toString();
|
|
|
118918
119021
|
case "idle":
|
|
118919
119022
|
return "idle";
|
|
118920
119023
|
}
|
|
119024
|
+
return "unknown";
|
|
118921
119025
|
};
|
|
118922
119026
|
class SessionHeartbeat {
|
|
118923
119027
|
constructor(sessionId, workspaceDocument, logger2, options = {}) {
|
|
@@ -120736,11 +120840,7 @@ path=/${options.repoFullName}.git
|
|
|
120736
120840
|
});
|
|
120737
120841
|
}
|
|
120738
120842
|
async function fetchAcpCapabilities(cliType, agentType, logger2, env2) {
|
|
120739
|
-
const
|
|
120740
|
-
const workdir = path__default.join(os__default.tmpdir(), "lody-acp-capabilities", `${cliType}-${safeAgentType}`);
|
|
120741
|
-
fs__default.mkdirSync(workdir, {
|
|
120742
|
-
recursive: true
|
|
120743
|
-
});
|
|
120843
|
+
const workdir = process.cwd();
|
|
120744
120844
|
let capturedCommands;
|
|
120745
120845
|
let commandsResolve;
|
|
120746
120846
|
const commandsPromise = new Promise((resolve2) => {
|
|
@@ -121892,91 +121992,94 @@ $mem | ConvertTo-Json -Compress
|
|
|
121892
121992
|
const runtime = this.createTurnRuntime(sessionId, turnId, userTurnId, session);
|
|
121893
121993
|
this.registerTurnRuntime(runtime);
|
|
121894
121994
|
const self2 = this;
|
|
121895
|
-
const program2 = scoped(acquireRelease(succeed(runtime), (
|
|
121995
|
+
const program2 = scoped(acquireRelease(succeed(runtime), (turnRuntime, exit2) => gen(function* () {
|
|
121896
121996
|
const wasInterrupted = isFailure(exit2) && isInterrupted(exit2.cause);
|
|
121897
|
-
const wasCancelled =
|
|
121997
|
+
const wasCancelled = turnRuntime.cancelRequested || self2.isTurnCancelled(sessionId, turnRuntime.turnId) || wasInterrupted;
|
|
121898
121998
|
if (wasCancelled) {
|
|
121899
121999
|
yield* self2.finalizeCancelledTurnEffect({
|
|
121900
122000
|
sessionId,
|
|
121901
122001
|
sessionDoc,
|
|
121902
|
-
turnId:
|
|
122002
|
+
turnId: turnRuntime.turnId,
|
|
121903
122003
|
userTurnId,
|
|
121904
|
-
session:
|
|
121905
|
-
pendingSession:
|
|
121906
|
-
terminateSession:
|
|
121907
|
-
reportTurnError: self2.shouldReportCancelledTurnError(
|
|
122004
|
+
session: turnRuntime.session,
|
|
122005
|
+
pendingSession: turnRuntime.pendingSession,
|
|
122006
|
+
terminateSession: turnRuntime.terminateSessionOnCancel,
|
|
122007
|
+
reportTurnError: self2.shouldReportCancelledTurnError(turnRuntime)
|
|
121908
122008
|
});
|
|
121909
122009
|
}
|
|
121910
|
-
self2.releaseTurnRuntime(sessionId,
|
|
121911
|
-
})).pipe(flatMap$1((
|
|
121912
|
-
yield* self2.tryPromise(() => self2.deps.createAssistantEntryForTurn(sessionId, sessionDoc,
|
|
122010
|
+
self2.releaseTurnRuntime(sessionId, turnRuntime.turnId);
|
|
122011
|
+
})).pipe(flatMap$1((turnRuntime) => gen(function* () {
|
|
122012
|
+
yield* self2.tryPromise(() => self2.deps.createAssistantEntryForTurn(sessionId, sessionDoc, turnRuntime.turnId, turnRuntime.session?.agentClient?.currentModel, userTurnId));
|
|
121913
122013
|
yield* self2.acquireSessionHeartbeat(sessionId);
|
|
121914
122014
|
if (userTurnId) {
|
|
121915
122015
|
yield* self2.tryPromise(() => self2.setDispatchProcessing(sessionId, sessionDoc, userTurnId));
|
|
121916
122016
|
}
|
|
121917
122017
|
const bindSession = (nextSession) => {
|
|
121918
|
-
|
|
121919
|
-
|
|
122018
|
+
runtime.session = nextSession;
|
|
122019
|
+
runtime.pendingSession = void 0;
|
|
121920
122020
|
};
|
|
121921
122021
|
const trackPendingSession = (pendingSession, pendingOptions) => gen(function* () {
|
|
121922
122022
|
const pending2 = yield* try_({
|
|
121923
122023
|
try: () => typeof pendingSession === "function" ? pendingSession() : pendingSession,
|
|
121924
122024
|
catch: (error2) => error2
|
|
121925
122025
|
});
|
|
121926
|
-
|
|
122026
|
+
runtime.pendingSession = pending2;
|
|
121927
122027
|
if (pendingOptions?.terminateOnCancel) {
|
|
121928
|
-
|
|
122028
|
+
runtime.terminateSessionOnCancel = true;
|
|
121929
122029
|
}
|
|
121930
122030
|
return yield* self2.tryPromise(() => pending2);
|
|
121931
122031
|
});
|
|
121932
122032
|
const abortIfCancelled = (cancelOptions) => gen(function* () {
|
|
121933
122033
|
if (cancelOptions?.terminateSession) {
|
|
121934
|
-
|
|
122034
|
+
runtime.terminateSessionOnCancel = true;
|
|
121935
122035
|
}
|
|
121936
122036
|
const userTurnWasCancelled = yield* self2.tryPromise(() => self2.isUserTurnCancelled(sessionDoc, userTurnId));
|
|
121937
|
-
if (!
|
|
121938
|
-
return;
|
|
122037
|
+
if (!runtime.cancelRequested && !self2.isTurnCancelled(sessionId, runtime.turnId) && !userTurnWasCancelled) {
|
|
122038
|
+
return void 0;
|
|
121939
122039
|
}
|
|
121940
122040
|
yield* self2.finalizeCancelledTurnEffect({
|
|
121941
122041
|
sessionId,
|
|
121942
122042
|
sessionDoc,
|
|
121943
|
-
turnId:
|
|
122043
|
+
turnId: runtime.turnId,
|
|
121944
122044
|
userTurnId,
|
|
121945
|
-
session:
|
|
121946
|
-
pendingSession:
|
|
121947
|
-
terminateSession: cancelOptions?.terminateSession ??
|
|
121948
|
-
reportTurnError: self2.shouldReportCancelledTurnError(
|
|
122045
|
+
session: runtime.session,
|
|
122046
|
+
pendingSession: runtime.pendingSession,
|
|
122047
|
+
terminateSession: cancelOptions?.terminateSession ?? runtime.terminateSessionOnCancel,
|
|
122048
|
+
reportTurnError: self2.shouldReportCancelledTurnError(runtime)
|
|
121949
122049
|
});
|
|
121950
|
-
|
|
122050
|
+
yield* fail(new SessionTurnCancelled({
|
|
121951
122051
|
sessionId,
|
|
121952
|
-
turnId:
|
|
122052
|
+
turnId: runtime.turnId
|
|
121953
122053
|
}));
|
|
122054
|
+
return void 0;
|
|
121954
122055
|
});
|
|
121955
|
-
const patchAssistantEntry = () => self2.tryPromise(() => self2.deps.createAssistantEntryForTurn(sessionId, sessionDoc,
|
|
122056
|
+
const patchAssistantEntry = () => self2.tryPromise(() => self2.deps.createAssistantEntryForTurn(sessionId, sessionDoc, runtime.turnId, runtime.session?.agentClient?.currentModel, userTurnId));
|
|
121956
122057
|
const prompt2 = (promptBlocks) => gen(function* () {
|
|
121957
|
-
const activeSession =
|
|
122058
|
+
const activeSession = runtime.session;
|
|
121958
122059
|
const agentClient = activeSession?.agentClient;
|
|
121959
122060
|
const acpSessionId = activeSession?.acpSessionId;
|
|
121960
122061
|
if (!agentClient || !acpSessionId) {
|
|
121961
|
-
|
|
122062
|
+
yield* fail(new Error("Agent session was not ready"));
|
|
122063
|
+
return void 0;
|
|
121962
122064
|
}
|
|
121963
|
-
|
|
121964
|
-
|
|
122065
|
+
runtime.terminateSessionOnCancel = false;
|
|
122066
|
+
runtime.promptStarted = true;
|
|
121965
122067
|
yield* acquireUseRelease(sync(() => {
|
|
121966
|
-
|
|
122068
|
+
runtime.promptInFlight = true;
|
|
121967
122069
|
return activeSession;
|
|
121968
122070
|
}), () => self2.tryPromise((signal) => agentClient.prompt(acpSessionId, promptBlocks, {
|
|
121969
122071
|
signal
|
|
121970
122072
|
})).pipe(catchAll((error2) => sync(() => {
|
|
121971
|
-
|
|
122073
|
+
runtime.promptFailed = true;
|
|
121972
122074
|
}).pipe(flatMap$1(() => fail(error2))))), () => sync(() => {
|
|
121973
|
-
|
|
122075
|
+
runtime.promptInFlight = false;
|
|
121974
122076
|
}));
|
|
121975
|
-
self2.deps.clearActiveTurnId(sessionId,
|
|
122077
|
+
self2.deps.clearActiveTurnId(sessionId, runtime.turnId);
|
|
122078
|
+
return void 0;
|
|
121976
122079
|
});
|
|
121977
122080
|
yield* body({
|
|
121978
|
-
turnId:
|
|
121979
|
-
runtime
|
|
122081
|
+
turnId: runtime.turnId,
|
|
122082
|
+
runtime,
|
|
121980
122083
|
bindSession,
|
|
121981
122084
|
trackPendingSession,
|
|
121982
122085
|
abortIfCancelled,
|
|
@@ -122649,7 +122752,8 @@ $mem | ConvertTo-Json -Compress
|
|
|
122649
122752
|
}, ({ turnId, runtime, bindSession, trackPendingSession, abortIfCancelled, patchAssistantEntry, prompt: prompt2 }) => gen(function* () {
|
|
122650
122753
|
yield* abortIfCancelled();
|
|
122651
122754
|
if (project?.kind === "local" && !workdir) {
|
|
122652
|
-
|
|
122755
|
+
yield* fail(new Error(`Local project not found in workspace: ${project.localProjectId}`));
|
|
122756
|
+
return void 0;
|
|
122653
122757
|
}
|
|
122654
122758
|
if (shouldPrepareWorktree) {
|
|
122655
122759
|
yield* self2.tryPromise(() => sessionDoc.setStatus(SessionStatusFactory.initializing("git-clone")));
|
|
@@ -122734,6 +122838,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
122734
122838
|
yield* abortIfCancelled();
|
|
122735
122839
|
self2.clearTurnCancellation(sessionId, turnId);
|
|
122736
122840
|
yield* self2.tryPromise(() => self2.deps.processMessageQueue(sessionId));
|
|
122841
|
+
return void 0;
|
|
122737
122842
|
}));
|
|
122738
122843
|
}
|
|
122739
122844
|
async cancelSession(message) {
|
|
@@ -123365,6 +123470,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
123365
123470
|
case "cli_token_invalid":
|
|
123366
123471
|
return "CLI token is invalid or has been revoked.";
|
|
123367
123472
|
}
|
|
123473
|
+
return "Machine access was denied.";
|
|
123368
123474
|
}
|
|
123369
123475
|
async markDispatchAccessDenied(sessionId, sessionDoc, userTurnId, reason) {
|
|
123370
123476
|
const message = this.getAccessDeniedMessage(reason);
|
|
@@ -124302,7 +124408,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
124302
124408
|
getActiveTurnId: (sessionId) => this.store.getActiveTurnId(sessionId),
|
|
124303
124409
|
clearActiveTurnId: (sessionId, turnId) => this.clearActiveTurnIdIfMatches(sessionId, turnId),
|
|
124304
124410
|
buildAcpPromptBlocks: async (args2) => await this.buildAcpPromptBlocks(args2),
|
|
124305
|
-
applyAcpModeAndModel: async (session,
|
|
124411
|
+
applyAcpModeAndModel: async (session, acpConfig) => await this.applyAcpModeAndModel(session, acpConfig),
|
|
124306
124412
|
createAssistantEntryForTurn: async (sessionId, sessionDoc, turnId, modelInfo, userTurnId) => await this.createAssistantEntryForTurn(sessionId, sessionDoc, turnId, modelInfo, userTurnId),
|
|
124307
124413
|
turnFinalization: {
|
|
124308
124414
|
finalizeACPState: async (sessionId) => await this.finalizeACPState(sessionId),
|
|
@@ -124607,7 +124713,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
124607
124713
|
trackPendingContextWindowPersist(sessionId, promise) {
|
|
124608
124714
|
const state2 = this.store.get(sessionId);
|
|
124609
124715
|
state2.pendingContextWindowHandlers.add(promise);
|
|
124610
|
-
promise.finally(() => {
|
|
124716
|
+
void promise.finally(() => {
|
|
124611
124717
|
state2.pendingContextWindowHandlers.delete(promise);
|
|
124612
124718
|
});
|
|
124613
124719
|
}
|
|
@@ -125075,7 +125181,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
125075
125181
|
}
|
|
125076
125182
|
}
|
|
125077
125183
|
setupSessionEventHandlers() {
|
|
125078
|
-
this.sessionManager.on("output",
|
|
125184
|
+
this.sessionManager.on("output", (output) => {
|
|
125079
125185
|
this.logger.debug(`Output from session [${output.sessionId}]: <${output.data.length} bytes>`);
|
|
125080
125186
|
});
|
|
125081
125187
|
this.sessionManager.on("onACPUpdateMessage", (sessionId, update2) => {
|
|
@@ -125085,53 +125191,59 @@ $mem | ConvertTo-Json -Compress
|
|
|
125085
125191
|
const promise = this.handleUsageUpdate(sessionId, acpSessionId, usage);
|
|
125086
125192
|
const usageState = this.store.get(sessionId);
|
|
125087
125193
|
usageState.pendingUsageHandlers.add(promise);
|
|
125088
|
-
promise.finally(() => {
|
|
125194
|
+
void promise.finally(() => {
|
|
125089
125195
|
usageState.pendingUsageHandlers.delete(promise);
|
|
125090
125196
|
});
|
|
125091
125197
|
});
|
|
125092
125198
|
this.sessionManager.on("onContextWindowUsageUpdate", (sessionId, usage) => {
|
|
125093
125199
|
this.enqueueContextWindowUsageUpdate(sessionId, usage);
|
|
125094
125200
|
});
|
|
125095
|
-
this.sessionManager.on("onRateLimitUpdate",
|
|
125096
|
-
|
|
125201
|
+
this.sessionManager.on("onRateLimitUpdate", (machineId, cliType, limits) => {
|
|
125202
|
+
void this.workspaceDocument.updateRateLimits(machineId, cliType, limits);
|
|
125097
125203
|
});
|
|
125098
|
-
this.sessionManager.on("error",
|
|
125099
|
-
|
|
125100
|
-
|
|
125101
|
-
|
|
125102
|
-
|
|
125103
|
-
|
|
125104
|
-
|
|
125105
|
-
|
|
125106
|
-
|
|
125204
|
+
this.sessionManager.on("error", (event) => {
|
|
125205
|
+
void (async () => {
|
|
125206
|
+
this.logger.error(`[${event.sessionId}] Session error event received:`, event);
|
|
125207
|
+
const sessionId = event.sessionId;
|
|
125208
|
+
this.stopMachineSessionHeartbeat(sessionId);
|
|
125209
|
+
await this.finalizeACPState(sessionId);
|
|
125210
|
+
await this.flushSessionUsage(sessionId);
|
|
125211
|
+
const sessionDoc = await this.workspaceDocument.getOrCreateSessionDoc(sessionId);
|
|
125212
|
+
await sessionDoc.setStatus(SessionStatusFactory.idle());
|
|
125213
|
+
this.logger.debug(`[${sessionId}] Status set to idle (via error event)`);
|
|
125214
|
+
})();
|
|
125107
125215
|
});
|
|
125108
|
-
this.sessionManager.on("exit",
|
|
125109
|
-
|
|
125110
|
-
|
|
125111
|
-
|
|
125112
|
-
this.
|
|
125113
|
-
|
|
125114
|
-
|
|
125115
|
-
|
|
125116
|
-
await this.finalizeACPState(sessionId);
|
|
125117
|
-
await this.flushSessionUsage(sessionId);
|
|
125118
|
-
const session = await this.workspaceDocument.getOrCreateSessionDoc(sessionId);
|
|
125119
|
-
await session.setStatus(SessionStatusFactory.idle());
|
|
125120
|
-
this.logger.debug(`[${sessionId}] Status set to idle (via exit event)`);
|
|
125121
|
-
});
|
|
125122
|
-
this.sessionManager.on("terminated", async (event) => {
|
|
125123
|
-
const sessionId = event.sessionId;
|
|
125124
|
-
if (!this.store.has(sessionId)) {
|
|
125125
|
-
this.logger.debug(`[${sessionId}] Ignoring terminated event for GC-cleaned session`);
|
|
125126
|
-
return;
|
|
125127
|
-
}
|
|
125128
|
-
try {
|
|
125216
|
+
this.sessionManager.on("exit", (exit2) => {
|
|
125217
|
+
void (async () => {
|
|
125218
|
+
const sessionId = exit2.sessionId;
|
|
125219
|
+
this.logger.debug(`[${sessionId}] Session exit event received (exitCode=${exit2.exitCode})`);
|
|
125220
|
+
if (!this.store.has(sessionId)) {
|
|
125221
|
+
this.logger.debug(`[${sessionId}] Ignoring exit event for GC-cleaned session`);
|
|
125222
|
+
return;
|
|
125223
|
+
}
|
|
125129
125224
|
this.stopMachineSessionHeartbeat(sessionId);
|
|
125130
125225
|
await this.finalizeACPState(sessionId);
|
|
125131
125226
|
await this.flushSessionUsage(sessionId);
|
|
125132
|
-
|
|
125133
|
-
|
|
125134
|
-
|
|
125227
|
+
const session = await this.workspaceDocument.getOrCreateSessionDoc(sessionId);
|
|
125228
|
+
await session.setStatus(SessionStatusFactory.idle());
|
|
125229
|
+
this.logger.debug(`[${sessionId}] Status set to idle (via exit event)`);
|
|
125230
|
+
})();
|
|
125231
|
+
});
|
|
125232
|
+
this.sessionManager.on("terminated", (event) => {
|
|
125233
|
+
void (async () => {
|
|
125234
|
+
const sessionId = event.sessionId;
|
|
125235
|
+
if (!this.store.has(sessionId)) {
|
|
125236
|
+
this.logger.debug(`[${sessionId}] Ignoring terminated event for GC-cleaned session`);
|
|
125237
|
+
return;
|
|
125238
|
+
}
|
|
125239
|
+
try {
|
|
125240
|
+
this.stopMachineSessionHeartbeat(sessionId);
|
|
125241
|
+
await this.finalizeACPState(sessionId);
|
|
125242
|
+
await this.flushSessionUsage(sessionId);
|
|
125243
|
+
} catch (error2) {
|
|
125244
|
+
this.logger.error(`[${sessionId}] Failed to handle termination event: ${formatErrorMessage(error2)}`);
|
|
125245
|
+
}
|
|
125246
|
+
})();
|
|
125135
125247
|
});
|
|
125136
125248
|
}
|
|
125137
125249
|
setupArchiveWatcher() {
|
|
@@ -125403,7 +125515,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
125403
125515
|
const batchWindowMs = state2.acpFlushCountInTurn === 0 ? MessageHandler.ACP_INITIAL_UPDATE_BATCH_WINDOW_MS : MessageHandler.ACP_SUBSEQUENT_UPDATE_BATCH_WINDOW_MS;
|
|
125404
125516
|
const timer2 = setTimeout(() => {
|
|
125405
125517
|
state2.acpFlushTimer = null;
|
|
125406
|
-
this.startACPUpdateFlush(sessionId);
|
|
125518
|
+
void this.startACPUpdateFlush(sessionId);
|
|
125407
125519
|
}, batchWindowMs);
|
|
125408
125520
|
timer2.unref?.();
|
|
125409
125521
|
state2.acpFlushTimer = timer2;
|
|
@@ -125416,7 +125528,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
125416
125528
|
if (state2.acpUpdateBuffer.length === 0) {
|
|
125417
125529
|
return;
|
|
125418
125530
|
}
|
|
125419
|
-
this.startACPUpdateFlush(sessionId);
|
|
125531
|
+
void this.startACPUpdateFlush(sessionId);
|
|
125420
125532
|
}
|
|
125421
125533
|
const inFlight = state2.acpFlushInFlight;
|
|
125422
125534
|
if (!inFlight) {
|
|
@@ -125572,11 +125684,11 @@ $mem | ConvertTo-Json -Compress
|
|
|
125572
125684
|
try {
|
|
125573
125685
|
await handleACPUpdateMessage(sessionDoc, queue2, {
|
|
125574
125686
|
logger: this.logger,
|
|
125575
|
-
getCurrentSessionTurnId: (
|
|
125576
|
-
const tid = this.store.getTurnId(
|
|
125687
|
+
getCurrentSessionTurnId: (currentSessionId) => {
|
|
125688
|
+
const tid = this.store.getTurnId(currentSessionId);
|
|
125577
125689
|
if (!tid) {
|
|
125578
|
-
captureException(new Error(`No turn id found for session ${
|
|
125579
|
-
throw new Error(`No turn id found for session ${
|
|
125690
|
+
void captureException(new Error(`No turn id found for session ${currentSessionId}`));
|
|
125691
|
+
throw new Error(`No turn id found for session ${currentSessionId}`);
|
|
125580
125692
|
}
|
|
125581
125693
|
return tid;
|
|
125582
125694
|
}
|
|
@@ -125954,7 +126066,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
125954
126066
|
});
|
|
125955
126067
|
attachedTo = "new_entry";
|
|
125956
126068
|
} else {
|
|
125957
|
-
const
|
|
126069
|
+
const failureMessage = latestAttachTarget.kind === "unavailable" ? `Session is ${latestAttachTarget.statusType} and the original assistant turn is no longer available for image upload` : "The original assistant turn is no longer available for image upload";
|
|
125958
126070
|
this.captureSessionImageUploadEvent(analyticsUserId, "session/image_upload_failed", {
|
|
125959
126071
|
entrypoint: dispatchContext.source === "local" ? "cli_command" : "session_runtime",
|
|
125960
126072
|
session_id: sessionId,
|
|
@@ -125964,13 +126076,13 @@ $mem | ConvertTo-Json -Compress
|
|
|
125964
126076
|
local_project_id: localProjectId,
|
|
125965
126077
|
repo_full_name: repoFullName,
|
|
125966
126078
|
failure_reason: "active_turn_unavailable",
|
|
125967
|
-
error_message:
|
|
126079
|
+
error_message: failureMessage
|
|
125968
126080
|
});
|
|
125969
126081
|
respond({
|
|
125970
126082
|
success: false,
|
|
125971
126083
|
workspaceId: this.workspaceId,
|
|
125972
126084
|
error: "active_turn_unavailable",
|
|
125973
|
-
message:
|
|
126085
|
+
message: failureMessage
|
|
125974
126086
|
});
|
|
125975
126087
|
return;
|
|
125976
126088
|
}
|
|
@@ -125987,7 +126099,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
125987
126099
|
});
|
|
125988
126100
|
if (!replaced) {
|
|
125989
126101
|
const latestAttachTarget = await this.resolveSessionImageUploadAttachTarget(sessionId, sessionDoc);
|
|
125990
|
-
const
|
|
126102
|
+
const failureMessage = latestAttachTarget.kind === "active_turn" ? "Session started a new assistant turn during image upload; retry after the turn completes" : latestAttachTarget.kind === "unavailable" ? `Session is ${latestAttachTarget.statusType} and no idle assistant entry can be created` : "Reserved assistant image entry is no longer available";
|
|
125991
126103
|
this.captureSessionImageUploadEvent(analyticsUserId, "session/image_upload_failed", {
|
|
125992
126104
|
entrypoint: dispatchContext.source === "local" ? "cli_command" : "session_runtime",
|
|
125993
126105
|
session_id: sessionId,
|
|
@@ -125997,13 +126109,13 @@ $mem | ConvertTo-Json -Compress
|
|
|
125997
126109
|
local_project_id: localProjectId,
|
|
125998
126110
|
repo_full_name: repoFullName,
|
|
125999
126111
|
failure_reason: "active_turn_unavailable",
|
|
126000
|
-
error_message:
|
|
126112
|
+
error_message: failureMessage
|
|
126001
126113
|
});
|
|
126002
126114
|
respond({
|
|
126003
126115
|
success: false,
|
|
126004
126116
|
workspaceId: this.workspaceId,
|
|
126005
126117
|
error: "active_turn_unavailable",
|
|
126006
|
-
message:
|
|
126118
|
+
message: failureMessage
|
|
126007
126119
|
});
|
|
126008
126120
|
return;
|
|
126009
126121
|
}
|
|
@@ -126241,20 +126353,22 @@ $mem | ConvertTo-Json -Compress
|
|
|
126241
126353
|
});
|
|
126242
126354
|
}
|
|
126243
126355
|
checkForOutcome();
|
|
126244
|
-
timeoutId = setTimeout(
|
|
126245
|
-
|
|
126246
|
-
|
|
126247
|
-
|
|
126248
|
-
|
|
126249
|
-
|
|
126356
|
+
timeoutId = setTimeout(() => {
|
|
126357
|
+
void (async () => {
|
|
126358
|
+
if (resolved) return;
|
|
126359
|
+
this.logger.warn(`Permission request timed out for session ${sessionId}`);
|
|
126360
|
+
this.logger.debug(`[${sessionId}] Permission request ${requestId} timed out after ${PERMISSION_REQUEST_TIMEOUT_MS}ms`);
|
|
126361
|
+
try {
|
|
126362
|
+
await updatePermissionOutcomeInHistory(doc, requestId, {
|
|
126363
|
+
outcome: "cancelled"
|
|
126364
|
+
}, this.logger);
|
|
126365
|
+
} catch (error2) {
|
|
126366
|
+
this.logger.error(`[${sessionId}] Failed to update permission timeout in history: ${formatErrorMessage(error2)}`);
|
|
126367
|
+
}
|
|
126368
|
+
void resolveWithOutcome({
|
|
126250
126369
|
outcome: "cancelled"
|
|
126251
|
-
}
|
|
126252
|
-
}
|
|
126253
|
-
this.logger.error(`[${sessionId}] Failed to update permission timeout in history: ${formatErrorMessage(error2)}`);
|
|
126254
|
-
}
|
|
126255
|
-
void resolveWithOutcome({
|
|
126256
|
-
outcome: "cancelled"
|
|
126257
|
-
});
|
|
126370
|
+
});
|
|
126371
|
+
})();
|
|
126258
126372
|
}, PERMISSION_REQUEST_TIMEOUT_MS);
|
|
126259
126373
|
});
|
|
126260
126374
|
}
|
|
@@ -127389,7 +127503,7 @@ $mem | ConvertTo-Json -Compress
|
|
|
127389
127503
|
}
|
|
127390
127504
|
const BROKER_STATE_FILE_PATH = path__default.join(os__default.homedir(), ".lody", "broker.json");
|
|
127391
127505
|
const createGitCredentialBrokerHandler = (options) => {
|
|
127392
|
-
|
|
127506
|
+
const handleRequest = async (req, res) => {
|
|
127393
127507
|
try {
|
|
127394
127508
|
if (req.method === "GET" && req.url === "/health") {
|
|
127395
127509
|
res.writeHead(200, {
|
|
@@ -127482,6 +127596,9 @@ $mem | ConvertTo-Json -Compress
|
|
|
127482
127596
|
}));
|
|
127483
127597
|
}
|
|
127484
127598
|
};
|
|
127599
|
+
return (req, res) => {
|
|
127600
|
+
void handleRequest(req, res);
|
|
127601
|
+
};
|
|
127485
127602
|
};
|
|
127486
127603
|
const DEFAULT_HEALTH_CHECK_INTERVAL_MS = 3e4;
|
|
127487
127604
|
const HEALTH_CHECK_TIMEOUT_MS = 5e3;
|
|
@@ -127587,15 +127704,17 @@ $mem | ConvertTo-Json -Compress
|
|
|
127587
127704
|
if (this.healthCheckTimer) {
|
|
127588
127705
|
return;
|
|
127589
127706
|
}
|
|
127590
|
-
this.healthCheckTimer = setInterval(
|
|
127591
|
-
|
|
127592
|
-
|
|
127593
|
-
|
|
127594
|
-
|
|
127595
|
-
|
|
127596
|
-
|
|
127597
|
-
|
|
127598
|
-
|
|
127707
|
+
this.healthCheckTimer = setInterval(() => {
|
|
127708
|
+
void (async () => {
|
|
127709
|
+
if (this.isRecovering) {
|
|
127710
|
+
return;
|
|
127711
|
+
}
|
|
127712
|
+
const isHealthy = await this.checkHealth();
|
|
127713
|
+
if (!isHealthy && this.env) {
|
|
127714
|
+
this.logger.debug("Git credential broker health check failed, attempting recovery...");
|
|
127715
|
+
await this.recover();
|
|
127716
|
+
}
|
|
127717
|
+
})();
|
|
127599
127718
|
}, DEFAULT_HEALTH_CHECK_INTERVAL_MS);
|
|
127600
127719
|
this.healthCheckTimer.unref();
|
|
127601
127720
|
}
|
|
@@ -134784,11 +134903,11 @@ export PATH=${toSingleQuotedShellString(ghShimBinDir)}:"$PATH"
|
|
|
134784
134903
|
responses
|
|
134785
134904
|
});
|
|
134786
134905
|
} catch (error2) {
|
|
134787
|
-
const
|
|
134788
|
-
config2.logger.debug(`Local session control dispatch failed: ${
|
|
134906
|
+
const errorMessage = formatErrorMessage(error2);
|
|
134907
|
+
config2.logger.debug(`Local session control dispatch failed: ${errorMessage}`);
|
|
134789
134908
|
jsonResponse(res, 500, {
|
|
134790
134909
|
ok: false,
|
|
134791
|
-
error:
|
|
134910
|
+
error: errorMessage
|
|
134792
134911
|
});
|
|
134793
134912
|
}
|
|
134794
134913
|
}
|
|
@@ -134985,21 +135104,23 @@ export PATH=${toSingleQuotedShellString(ghShimBinDir)}:"$PATH"
|
|
|
134985
135104
|
}
|
|
134986
135105
|
chunks.push(chunk);
|
|
134987
135106
|
});
|
|
134988
|
-
req.on("end",
|
|
134989
|
-
|
|
134990
|
-
|
|
134991
|
-
|
|
134992
|
-
|
|
134993
|
-
|
|
134994
|
-
|
|
134995
|
-
|
|
134996
|
-
|
|
134997
|
-
|
|
134998
|
-
|
|
134999
|
-
|
|
135000
|
-
|
|
135001
|
-
|
|
135002
|
-
|
|
135107
|
+
req.on("end", () => {
|
|
135108
|
+
void (async () => {
|
|
135109
|
+
if (res.headersSent || res.writableEnded || res.destroyed) {
|
|
135110
|
+
return;
|
|
135111
|
+
}
|
|
135112
|
+
const raw = Buffer.concat(chunks).toString("utf8");
|
|
135113
|
+
config2.logger.debug(`[local-control:${requestId}] request body received: bytes=${Buffer.byteLength(raw, "utf8")} path=${requestPath}`);
|
|
135114
|
+
if (requestPath === SESSION_CONTROL_PATH$1) {
|
|
135115
|
+
await handleSessionControlRequest(config2, raw, res, requestId);
|
|
135116
|
+
return;
|
|
135117
|
+
}
|
|
135118
|
+
if (requestPath === IMAGE_UPLOAD_PATH) {
|
|
135119
|
+
await handleImageUploadRequest(config2, raw, res, requestId);
|
|
135120
|
+
return;
|
|
135121
|
+
}
|
|
135122
|
+
await handleProjectControlRequest(config2, raw, res, requestId);
|
|
135123
|
+
})();
|
|
135003
135124
|
});
|
|
135004
135125
|
req.on("error", (error2) => {
|
|
135005
135126
|
config2.logger.debug(`[local-control:${requestId}] request stream error: ${error2.message}`);
|
|
@@ -136005,7 +136126,7 @@ export PATH=${toSingleQuotedShellString(ghShimBinDir)}:"$PATH"
|
|
|
136005
136126
|
this.retryTimers.clear();
|
|
136006
136127
|
this.unsubscribeWorkspaces?.();
|
|
136007
136128
|
this.unsubscribeWorkspaces = null;
|
|
136008
|
-
this.convex?.close();
|
|
136129
|
+
void this.convex?.close();
|
|
136009
136130
|
this.convex = null;
|
|
136010
136131
|
const runtimes = Array.from(this.runtimes.values());
|
|
136011
136132
|
this.runtimes.clear();
|
|
@@ -169715,7 +169836,7 @@ ${result.stderr}`;
|
|
|
169715
169836
|
if (error2 instanceof Error && error2.name === "CommanderError") {
|
|
169716
169837
|
process.exit(1);
|
|
169717
169838
|
} else {
|
|
169718
|
-
reportError("cli", error2, {
|
|
169839
|
+
void reportError("cli", error2, {
|
|
169719
169840
|
logger: cliLogger,
|
|
169720
169841
|
fatal: true
|
|
169721
169842
|
}).finally(() => process.exit(1));
|