@kyo-so/cli 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/bin/kyoso.js +311 -103
- package/dist/cli/pluginRuntimeContract.d.ts +4 -4
- package/dist/core/constants.d.ts +1 -1
- package/dist/index.js +252 -74
- package/package.json +3 -3
package/dist/bin/kyoso.js
CHANGED
|
@@ -183964,7 +183964,7 @@ var JUDGE_MAX_OUTPUT_TOKENS = 4096;
|
|
|
183964
183964
|
var RAW_OUTPUT_MAX_CHARS = 16384;
|
|
183965
183965
|
var TRACE_DIR = ".kyoso/traces";
|
|
183966
183966
|
var KYOSO_CHILD_AGENT = "KYOSO_CHILD_AGENT";
|
|
183967
|
-
var KYOSO_VERSION = "0.15.
|
|
183967
|
+
var KYOSO_VERSION = "0.15.2";
|
|
183968
183968
|
|
|
183969
183969
|
// src/utils/pathContainment.ts
|
|
183970
183970
|
import { resolve, sep as sep2 } from "node:path";
|
|
@@ -184269,7 +184269,7 @@ var defaultConfig = {
|
|
|
184269
184269
|
enabled: true,
|
|
184270
184270
|
type: "acp",
|
|
184271
184271
|
command: "npx",
|
|
184272
|
-
args: ["-y", "@agentclientprotocol/codex-acp@1.1.
|
|
184272
|
+
args: ["-y", "@agentclientprotocol/codex-acp@1.1.7"],
|
|
184273
184273
|
role: "implementation_reviewer",
|
|
184274
184274
|
timeoutMs: DEFAULT_AGENT_TIMEOUT_MS,
|
|
184275
184275
|
allowProjectProvider: [],
|
|
@@ -184294,7 +184294,7 @@ var defaultConfig = {
|
|
|
184294
184294
|
enabled: true,
|
|
184295
184295
|
type: "acp",
|
|
184296
184296
|
command: "npx",
|
|
184297
|
-
args: ["-y", "@agentclientprotocol/claude-agent-acp@0.
|
|
184297
|
+
args: ["-y", "@agentclientprotocol/claude-agent-acp@0.61.0"],
|
|
184298
184298
|
role: "architecture_security_reviewer",
|
|
184299
184299
|
timeoutMs: DEFAULT_AGENT_TIMEOUT_MS,
|
|
184300
184300
|
env: {
|
|
@@ -187156,9 +187156,9 @@ var PLUGIN_RUNTIME_COMPATIBILITY_SCHEMA_VERSION = 2;
|
|
|
187156
187156
|
var MINIMUM_SUPPORTED_CODEX_VERSION = "0.144.0-alpha.4";
|
|
187157
187157
|
var PLUGIN_RUNTIME_EXPECTED_CONTRACT = {
|
|
187158
187158
|
distribution: {
|
|
187159
|
-
pluginVersion: "0.7.
|
|
187159
|
+
pluginVersion: "0.7.6",
|
|
187160
187160
|
mcpCommand: "npx",
|
|
187161
|
-
mcpPackagePin: "@kyo-so/cli@0.15.
|
|
187161
|
+
mcpPackagePin: "@kyo-so/cli@0.15.1",
|
|
187162
187162
|
mcpExecutable: "kyoso"
|
|
187163
187163
|
},
|
|
187164
187164
|
marketplace: {
|
|
@@ -191322,6 +191322,9 @@ var zToolCallUpdate = object({
|
|
|
191322
191322
|
title: defaultOnError(string2().nullish(), () => {
|
|
191323
191323
|
return;
|
|
191324
191324
|
}),
|
|
191325
|
+
name: defaultOnError(string2().nullish(), () => {
|
|
191326
|
+
return;
|
|
191327
|
+
}),
|
|
191325
191328
|
content: defaultOnError(vecSkipError(zToolCallContent).nullish(), () => {
|
|
191326
191329
|
return;
|
|
191327
191330
|
}),
|
|
@@ -192433,6 +192436,9 @@ var zContentChunk = object({
|
|
|
192433
192436
|
var zToolCall = object({
|
|
192434
192437
|
toolCallId: zToolCallId,
|
|
192435
192438
|
title: string2(),
|
|
192439
|
+
name: defaultOnError(string2().nullish(), () => {
|
|
192440
|
+
return;
|
|
192441
|
+
}),
|
|
192436
192442
|
kind: defaultOnError(zToolKind.optional(), () => {
|
|
192437
192443
|
return;
|
|
192438
192444
|
}),
|
|
@@ -193356,37 +193362,71 @@ var zCancelRequestNotification = object({
|
|
|
193356
193362
|
})
|
|
193357
193363
|
});
|
|
193358
193364
|
|
|
193359
|
-
// node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js
|
|
193360
|
-
var zGuardCreateElicitationRequestForm = zElicitationFormMode.and(object({ mode: literal("form") })).and(object({ message: string2() }));
|
|
193361
|
-
var zGuardCreateElicitationRequestUrl = zElicitationUrlMode.and(object({ mode: literal("url") })).and(object({ message: string2() }));
|
|
193362
|
-
var zGuardCreateElicitationRequestCustom = union([zElicitationSessionScope, zElicitationRequestScope]).and(object({ message: string2() }));
|
|
193363
|
-
var zGuardElicitationPropertySchemaString = zStringPropertySchema.and(object({ type: literal("string") }));
|
|
193364
|
-
var zGuardElicitationPropertySchemaNumber = zNumberPropertySchema.and(object({ type: literal("number") }));
|
|
193365
|
-
var zGuardElicitationPropertySchemaInteger = zIntegerPropertySchema.and(object({ type: literal("integer") }));
|
|
193366
|
-
var zGuardElicitationPropertySchemaBoolean = zBooleanPropertySchema.and(object({ type: literal("boolean") }));
|
|
193367
|
-
var zGuardElicitationPropertySchemaArray = zMultiSelectPropertySchema.and(object({ type: literal("array") }));
|
|
193368
|
-
var zGuardMultiSelectItemsString = zStringMultiSelectItems.and(object({ type: literal("string") }));
|
|
193369
|
-
var zGuardCreateElicitationResponseAccept = zElicitationAcceptAction.and(object({ action: literal("accept") }));
|
|
193370
|
-
var zGuardCreateElicitationResponseDecline = object({
|
|
193371
|
-
action: literal("decline")
|
|
193372
|
-
});
|
|
193373
|
-
var zGuardCreateElicitationResponseCancel = object({
|
|
193374
|
-
action: literal("cancel")
|
|
193375
|
-
});
|
|
193376
193365
|
// node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js
|
|
193377
193366
|
var CANCEL_REQUEST_METHOD = "$/cancel_request";
|
|
193367
|
+
function isRequestMessage(value) {
|
|
193368
|
+
return isJsonRpcEnvelope(value) && "id" in value && typeof value["method"] === "string" && isJsonRpcId(value["id"]);
|
|
193369
|
+
}
|
|
193370
|
+
function isResponseMessage(value) {
|
|
193371
|
+
if (!isJsonRpcEnvelope(value) || "method" in value) {
|
|
193372
|
+
return false;
|
|
193373
|
+
}
|
|
193374
|
+
if (!("id" in value) || !isJsonRpcId(value["id"])) {
|
|
193375
|
+
return false;
|
|
193376
|
+
}
|
|
193377
|
+
const hasResult = Object.hasOwn(value, "result");
|
|
193378
|
+
const hasError = Object.hasOwn(value, "error");
|
|
193379
|
+
if (hasResult === hasError) {
|
|
193380
|
+
return false;
|
|
193381
|
+
}
|
|
193382
|
+
return !hasError || isErrorResponse(value["error"]);
|
|
193383
|
+
}
|
|
193384
|
+
function isNotificationMessage(value) {
|
|
193385
|
+
return isJsonRpcEnvelope(value) && !("id" in value) && typeof value["method"] === "string";
|
|
193386
|
+
}
|
|
193378
193387
|
function isRecord11(value) {
|
|
193379
193388
|
return typeof value === "object" && value !== null;
|
|
193380
193389
|
}
|
|
193390
|
+
function isJsonRpcEnvelope(value) {
|
|
193391
|
+
return isRecord11(value) && value["jsonrpc"] === "2.0";
|
|
193392
|
+
}
|
|
193381
193393
|
function isJsonRpcId(value) {
|
|
193382
193394
|
return value === null || typeof value === "string" || typeof value === "number" && Number.isFinite(value);
|
|
193383
193395
|
}
|
|
193396
|
+
function isResponseShapedMessage(value) {
|
|
193397
|
+
return isRecord11(value) && !("method" in value) && (("id" in value) || ("result" in value) || ("error" in value));
|
|
193398
|
+
}
|
|
193399
|
+
function isResponseBatch(batch) {
|
|
193400
|
+
let hasValidCall = false;
|
|
193401
|
+
let hasValidResponse = false;
|
|
193402
|
+
let hasCallShape = false;
|
|
193403
|
+
let hasResponseShape = false;
|
|
193404
|
+
for (const entry of batch) {
|
|
193405
|
+
hasValidCall ||= isRequestMessage(entry) || isNotificationMessage(entry);
|
|
193406
|
+
hasValidResponse ||= isResponseMessage(entry);
|
|
193407
|
+
if (!isRecord11(entry)) {
|
|
193408
|
+
continue;
|
|
193409
|
+
}
|
|
193410
|
+
hasCallShape ||= "method" in entry;
|
|
193411
|
+
hasResponseShape ||= "result" in entry || "error" in entry;
|
|
193412
|
+
}
|
|
193413
|
+
if (hasValidCall) {
|
|
193414
|
+
return false;
|
|
193415
|
+
}
|
|
193416
|
+
if (hasValidResponse) {
|
|
193417
|
+
return true;
|
|
193418
|
+
}
|
|
193419
|
+
return hasResponseShape && !hasCallShape;
|
|
193420
|
+
}
|
|
193384
193421
|
function cancelRequestId(params) {
|
|
193385
193422
|
if (!isRecord11(params) || !isJsonRpcId(params["requestId"])) {
|
|
193386
193423
|
return;
|
|
193387
193424
|
}
|
|
193388
193425
|
return params["requestId"];
|
|
193389
193426
|
}
|
|
193427
|
+
function isErrorResponse(value) {
|
|
193428
|
+
return isRecord11(value) && typeof value["code"] === "number" && Number.isInteger(value["code"]) && typeof value["message"] === "string";
|
|
193429
|
+
}
|
|
193390
193430
|
var Handled = {
|
|
193391
193431
|
yes() {
|
|
193392
193432
|
return { handled: true };
|
|
@@ -193515,6 +193555,9 @@ class ConnectionContext {
|
|
|
193515
193555
|
sendNotification(method, params) {
|
|
193516
193556
|
return this.connection.sendNotification(method, params);
|
|
193517
193557
|
}
|
|
193558
|
+
sendBatch(entries) {
|
|
193559
|
+
return this.connection.sendBatch(entries);
|
|
193560
|
+
}
|
|
193518
193561
|
sendCancelRequest(requestId) {
|
|
193519
193562
|
return this.connection.sendCancelRequest(requestId);
|
|
193520
193563
|
}
|
|
@@ -193542,6 +193585,7 @@ class Connection {
|
|
|
193542
193585
|
retryQueue = [];
|
|
193543
193586
|
context = new ConnectionContext(this);
|
|
193544
193587
|
receiveReader;
|
|
193588
|
+
allowBatches = true;
|
|
193545
193589
|
constructor(requestHandlerOrStream, notificationHandlerOrHandlers, streamOrOptions, options) {
|
|
193546
193590
|
if (typeof requestHandlerOrStream === "function") {
|
|
193547
193591
|
const requestHandler = requestHandlerOrStream;
|
|
@@ -193550,16 +193594,13 @@ class Connection {
|
|
|
193550
193594
|
this.initialize(stream2, [
|
|
193551
193595
|
...options?.handlers ?? [],
|
|
193552
193596
|
this.legacyHandler(requestHandler, notificationHandler)
|
|
193553
|
-
]);
|
|
193597
|
+
], options);
|
|
193554
193598
|
return;
|
|
193555
193599
|
}
|
|
193556
193600
|
const stream = requestHandlerOrStream;
|
|
193557
193601
|
const handlers = notificationHandlerOrHandlers;
|
|
193558
193602
|
const connectionOptions = streamOrOptions;
|
|
193559
|
-
this.initialize(stream, [
|
|
193560
|
-
...connectionOptions?.handlers ?? [],
|
|
193561
|
-
...handlers
|
|
193562
|
-
]);
|
|
193603
|
+
this.initialize(stream, [...connectionOptions?.handlers ?? [], ...handlers], connectionOptions);
|
|
193563
193604
|
}
|
|
193564
193605
|
static builder() {
|
|
193565
193606
|
return new ConnectionBuilder;
|
|
@@ -193604,14 +193645,73 @@ class Connection {
|
|
|
193604
193645
|
if (this.abortController.signal.aborted) {
|
|
193605
193646
|
return rejectedPromise(this.closedReason());
|
|
193606
193647
|
}
|
|
193648
|
+
const request = this.prepareRequest(method, params, mapResponse, options);
|
|
193649
|
+
const requestSent = this.sendWireMessage(request.message);
|
|
193650
|
+
requestSent.catch(() => {});
|
|
193651
|
+
if (options.cancellationSignal?.aborted) {
|
|
193652
|
+
request.cancel();
|
|
193653
|
+
}
|
|
193654
|
+
return request.response;
|
|
193655
|
+
}
|
|
193656
|
+
sendBatch(entries) {
|
|
193657
|
+
if (this.abortController.signal.aborted) {
|
|
193658
|
+
return rejectedPromise(this.closedReason());
|
|
193659
|
+
}
|
|
193660
|
+
if (!this.allowBatches) {
|
|
193661
|
+
return rejectedPromise(new TypeError("JSON-RPC batches are not supported on this connection"));
|
|
193662
|
+
}
|
|
193663
|
+
if (entries.length === 0) {
|
|
193664
|
+
return rejectedPromise(new TypeError("JSON-RPC batch must contain at least one entry"));
|
|
193665
|
+
}
|
|
193666
|
+
const messages = [];
|
|
193667
|
+
const cancellations = [];
|
|
193668
|
+
const outputs = [];
|
|
193669
|
+
for (const entry of entries) {
|
|
193670
|
+
if (entry.kind === "notification") {
|
|
193671
|
+
messages.push({
|
|
193672
|
+
jsonrpc: "2.0",
|
|
193673
|
+
method: entry.method,
|
|
193674
|
+
params: entry.params
|
|
193675
|
+
});
|
|
193676
|
+
outputs.push(Promise.resolve(undefined));
|
|
193677
|
+
continue;
|
|
193678
|
+
}
|
|
193679
|
+
const request = this.prepareRequest(entry.method, entry.params, entry.mapResponse, entry.options);
|
|
193680
|
+
messages.push(request.message);
|
|
193681
|
+
outputs.push(request.response);
|
|
193682
|
+
cancellations.push({
|
|
193683
|
+
signal: entry.options?.cancellationSignal,
|
|
193684
|
+
cancel: request.cancel
|
|
193685
|
+
});
|
|
193686
|
+
}
|
|
193687
|
+
const batch = messages;
|
|
193688
|
+
const batchSent = this.sendWireMessage(batch);
|
|
193689
|
+
for (const cancellation of cancellations) {
|
|
193690
|
+
if (cancellation.signal?.aborted) {
|
|
193691
|
+
cancellation.cancel();
|
|
193692
|
+
}
|
|
193693
|
+
}
|
|
193694
|
+
const response = Promise.all([batchSent, ...outputs]).then(([, ...resolved]) => resolved);
|
|
193695
|
+
response.catch(() => {});
|
|
193696
|
+
return response;
|
|
193697
|
+
}
|
|
193698
|
+
sendCancelRequest(requestId) {
|
|
193699
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
193700
|
+
}
|
|
193701
|
+
sendNotification(method, params) {
|
|
193702
|
+
if (this.abortController.signal.aborted) {
|
|
193703
|
+
return rejectedPromise(this.closedReason());
|
|
193704
|
+
}
|
|
193705
|
+
return this.sendWireMessage({ jsonrpc: "2.0", method, params });
|
|
193706
|
+
}
|
|
193707
|
+
prepareRequest(method, params, mapResponse, options = {}) {
|
|
193607
193708
|
const id = this.nextRequestId++;
|
|
193608
193709
|
let cancel = () => {};
|
|
193609
|
-
const
|
|
193710
|
+
const response = new Promise((resolve9, reject) => {
|
|
193610
193711
|
const pendingResponse = {
|
|
193611
|
-
resolve: (
|
|
193712
|
+
resolve: (value) => {
|
|
193612
193713
|
try {
|
|
193613
|
-
|
|
193614
|
-
resolve9(value);
|
|
193714
|
+
resolve9(mapResponse ? mapResponse(value) : value);
|
|
193615
193715
|
} catch (error51) {
|
|
193616
193716
|
reject(error51);
|
|
193617
193717
|
}
|
|
@@ -193634,27 +193734,12 @@ class Connection {
|
|
|
193634
193734
|
};
|
|
193635
193735
|
this.pendingResponses.set(id, pendingResponse);
|
|
193636
193736
|
});
|
|
193637
|
-
|
|
193638
|
-
|
|
193639
|
-
jsonrpc: "2.0",
|
|
193640
|
-
|
|
193641
|
-
|
|
193642
|
-
|
|
193643
|
-
});
|
|
193644
|
-
requestSent.catch(() => {});
|
|
193645
|
-
if (options.cancellationSignal?.aborted) {
|
|
193646
|
-
cancel();
|
|
193647
|
-
}
|
|
193648
|
-
return responsePromise;
|
|
193649
|
-
}
|
|
193650
|
-
sendCancelRequest(requestId) {
|
|
193651
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
193652
|
-
}
|
|
193653
|
-
sendNotification(method, params) {
|
|
193654
|
-
if (this.abortController.signal.aborted) {
|
|
193655
|
-
return rejectedPromise(this.closedReason());
|
|
193656
|
-
}
|
|
193657
|
-
return this.sendMessage({ jsonrpc: "2.0", method, params });
|
|
193737
|
+
response.catch(() => {});
|
|
193738
|
+
return {
|
|
193739
|
+
message: { jsonrpc: "2.0", id, method, params },
|
|
193740
|
+
response,
|
|
193741
|
+
cancel: () => cancel()
|
|
193742
|
+
};
|
|
193658
193743
|
}
|
|
193659
193744
|
close(error51) {
|
|
193660
193745
|
if (this.abortController.signal.aborted) {
|
|
@@ -193673,9 +193758,10 @@ class Connection {
|
|
|
193673
193758
|
this.incomingRequests.clear();
|
|
193674
193759
|
this.receiveReader?.cancel(closeError).catch(() => {});
|
|
193675
193760
|
}
|
|
193676
|
-
initialize(stream, handlers) {
|
|
193761
|
+
initialize(stream, handlers, options) {
|
|
193677
193762
|
this.stream = stream;
|
|
193678
193763
|
this.staticHandlers = handlers;
|
|
193764
|
+
this.allowBatches = options?.allowBatches ?? true;
|
|
193679
193765
|
this.closedPromise = new Promise((resolve9) => {
|
|
193680
193766
|
this.abortController.signal.addEventListener("abort", () => resolve9());
|
|
193681
193767
|
});
|
|
@@ -193711,7 +193797,7 @@ class Connection {
|
|
|
193711
193797
|
if (!message) {
|
|
193712
193798
|
continue;
|
|
193713
193799
|
}
|
|
193714
|
-
this.
|
|
193800
|
+
this.receiveWireMessage(message);
|
|
193715
193801
|
}
|
|
193716
193802
|
} finally {
|
|
193717
193803
|
if (this.receiveReader === reader) {
|
|
@@ -193725,24 +193811,91 @@ class Connection {
|
|
|
193725
193811
|
this.close(closeError);
|
|
193726
193812
|
}
|
|
193727
193813
|
}
|
|
193728
|
-
|
|
193729
|
-
if (
|
|
193814
|
+
receiveWireMessage(message) {
|
|
193815
|
+
if (Array.isArray(message)) {
|
|
193816
|
+
if (!this.allowBatches) {
|
|
193817
|
+
this.close(new TypeError("JSON-RPC batches are not supported on this connection"));
|
|
193818
|
+
return;
|
|
193819
|
+
}
|
|
193820
|
+
this.receiveBatch(message);
|
|
193730
193821
|
return;
|
|
193731
193822
|
}
|
|
193732
193823
|
if (!isRecord11(message)) {
|
|
193733
193824
|
console.error("Invalid message", { message });
|
|
193734
193825
|
return;
|
|
193735
193826
|
}
|
|
193827
|
+
this.receiveMessage(message);
|
|
193828
|
+
}
|
|
193829
|
+
receiveBatch(batch) {
|
|
193830
|
+
if (batch.length === 0) {
|
|
193831
|
+
this.sendWireMessage({
|
|
193832
|
+
jsonrpc: "2.0",
|
|
193833
|
+
id: null,
|
|
193834
|
+
error: RequestError.invalidRequest(batch).toErrorResponse()
|
|
193835
|
+
}).catch(() => {});
|
|
193836
|
+
return;
|
|
193837
|
+
}
|
|
193838
|
+
const responseBatch = isResponseBatch(batch);
|
|
193839
|
+
const responseCount = responseBatch ? 0 : batch.reduce((count, message) => count + (isNotificationMessage(message) ? 0 : 1), 0);
|
|
193840
|
+
let remaining = responseCount;
|
|
193841
|
+
let remainingNotifications = batch.reduce((count, message) => count + (isNotificationMessage(message) ? 1 : 0), 0);
|
|
193842
|
+
let responseSent = false;
|
|
193843
|
+
const responses = [];
|
|
193844
|
+
const sendResponsesIfReady = async () => {
|
|
193845
|
+
if (responseSent || remaining !== 0 || remainingNotifications !== 0 || responses.length === 0) {
|
|
193846
|
+
return;
|
|
193847
|
+
}
|
|
193848
|
+
responseSent = true;
|
|
193849
|
+
await this.sendWireMessage(responses);
|
|
193850
|
+
};
|
|
193851
|
+
const collectResponse = async (response) => {
|
|
193852
|
+
responses.push(response);
|
|
193853
|
+
remaining -= 1;
|
|
193854
|
+
await sendResponsesIfReady();
|
|
193855
|
+
};
|
|
193856
|
+
for (const message of batch) {
|
|
193857
|
+
if (responseBatch) {
|
|
193858
|
+
if (isResponseShapedMessage(message)) {
|
|
193859
|
+
this.receiveMessage(message);
|
|
193860
|
+
}
|
|
193861
|
+
continue;
|
|
193862
|
+
}
|
|
193863
|
+
if (!isRequestMessage(message) && !isNotificationMessage(message)) {
|
|
193864
|
+
collectResponse({
|
|
193865
|
+
jsonrpc: "2.0",
|
|
193866
|
+
id: null,
|
|
193867
|
+
error: RequestError.invalidRequest(message).toErrorResponse()
|
|
193868
|
+
}).catch(() => {});
|
|
193869
|
+
continue;
|
|
193870
|
+
}
|
|
193871
|
+
const processing = this.receiveMessage(message, isRequestMessage(message) ? collectResponse : undefined);
|
|
193872
|
+
if (isNotificationMessage(message)) {
|
|
193873
|
+
processing.finally(() => {
|
|
193874
|
+
remainingNotifications -= 1;
|
|
193875
|
+
sendResponsesIfReady().catch((error51) => this.close(error51));
|
|
193876
|
+
});
|
|
193877
|
+
}
|
|
193878
|
+
}
|
|
193879
|
+
}
|
|
193880
|
+
receiveMessage(message, sendResponse) {
|
|
193881
|
+
if (this.abortController.signal.aborted) {
|
|
193882
|
+
return Promise.resolve();
|
|
193883
|
+
}
|
|
193884
|
+
if (!isRecord11(message)) {
|
|
193885
|
+
console.error("Invalid message", { message });
|
|
193886
|
+
return Promise.resolve();
|
|
193887
|
+
}
|
|
193736
193888
|
if ("method" in message) {
|
|
193737
193889
|
if (!("id" in message)) {
|
|
193738
193890
|
this.handleProtocolNotification(message);
|
|
193739
193891
|
}
|
|
193740
|
-
this.processIncomingMessage(this.toIncomingMessage(message)).catch((error51) => this.close(error51));
|
|
193892
|
+
return this.processIncomingMessage(this.toIncomingMessage(message, sendResponse)).catch((error51) => this.close(error51));
|
|
193741
193893
|
} else if ("id" in message) {
|
|
193742
193894
|
this.handleResponse(message);
|
|
193743
193895
|
} else {
|
|
193744
193896
|
console.error("Invalid message", { message });
|
|
193745
193897
|
}
|
|
193898
|
+
return Promise.resolve();
|
|
193746
193899
|
}
|
|
193747
193900
|
async processIncomingMessage(message) {
|
|
193748
193901
|
if (this.abortController.signal.aborted) {
|
|
@@ -193786,7 +193939,7 @@ class Connection {
|
|
|
193786
193939
|
}
|
|
193787
193940
|
}
|
|
193788
193941
|
}
|
|
193789
|
-
toIncomingMessage(message) {
|
|
193942
|
+
toIncomingMessage(message, sendResponse) {
|
|
193790
193943
|
if ("id" in message) {
|
|
193791
193944
|
const abortController = new AbortController;
|
|
193792
193945
|
this.incomingRequests.set(message.id, abortController);
|
|
@@ -193801,11 +193954,14 @@ class Connection {
|
|
|
193801
193954
|
params: message.params,
|
|
193802
193955
|
raw: message,
|
|
193803
193956
|
signal: abortController.signal,
|
|
193804
|
-
responder: new RequestResponder(message.id, (result) =>
|
|
193805
|
-
|
|
193806
|
-
|
|
193807
|
-
|
|
193808
|
-
|
|
193957
|
+
responder: new RequestResponder(message.id, (result) => {
|
|
193958
|
+
const response = {
|
|
193959
|
+
jsonrpc: "2.0",
|
|
193960
|
+
id: message.id,
|
|
193961
|
+
...result
|
|
193962
|
+
};
|
|
193963
|
+
return sendResponse ? sendResponse(response) : this.sendWireMessage(response);
|
|
193964
|
+
}, abortController.signal, finishRequest)
|
|
193809
193965
|
};
|
|
193810
193966
|
}
|
|
193811
193967
|
return {
|
|
@@ -193820,13 +193976,13 @@ class Connection {
|
|
|
193820
193976
|
if (pendingResponse) {
|
|
193821
193977
|
this.pendingResponses.delete(response.id);
|
|
193822
193978
|
pendingResponse.cleanup?.();
|
|
193823
|
-
if (
|
|
193979
|
+
if (!isResponseMessage(response)) {
|
|
193980
|
+
pendingResponse.reject(RequestError.invalidRequest(response));
|
|
193981
|
+
} else if ("result" in response) {
|
|
193824
193982
|
pendingResponse.resolve(response.result);
|
|
193825
|
-
} else
|
|
193983
|
+
} else {
|
|
193826
193984
|
const { code, message, data } = response.error;
|
|
193827
193985
|
pendingResponse.reject(new RequestError(code, message, data));
|
|
193828
|
-
} else {
|
|
193829
|
-
pendingResponse.reject(RequestError.invalidRequest(response));
|
|
193830
193986
|
}
|
|
193831
193987
|
} else {
|
|
193832
193988
|
console.error("Got response to unknown request", response.id);
|
|
@@ -193849,7 +194005,7 @@ class Connection {
|
|
|
193849
194005
|
closedReason() {
|
|
193850
194006
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
193851
194007
|
}
|
|
193852
|
-
async
|
|
194008
|
+
async sendWireMessage(message) {
|
|
193853
194009
|
if (this.abortController.signal.aborted) {
|
|
193854
194010
|
return rejectedPromise(this.closedReason());
|
|
193855
194011
|
}
|
|
@@ -194032,7 +194188,7 @@ function ndJsonStream(output2, input2) {
|
|
|
194032
194188
|
if (trimmedLine) {
|
|
194033
194189
|
try {
|
|
194034
194190
|
const message = JSON.parse(trimmedLine);
|
|
194035
|
-
if (isRecord11(message)) {
|
|
194191
|
+
if (isRecord11(message) || Array.isArray(message)) {
|
|
194036
194192
|
controller.enqueue(message);
|
|
194037
194193
|
} else {
|
|
194038
194194
|
console.warn("Skipping JSON line that is not an object:", trimmedLine);
|
|
@@ -194106,7 +194262,28 @@ function ndJsonStream(output2, input2) {
|
|
|
194106
194262
|
});
|
|
194107
194263
|
return { readable, writable };
|
|
194108
194264
|
}
|
|
194265
|
+
|
|
194266
|
+
// node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js
|
|
194267
|
+
var zGuardCreateElicitationRequestForm = zElicitationFormMode.and(object({ mode: literal("form") })).and(object({ message: string2() }));
|
|
194268
|
+
var zGuardCreateElicitationRequestUrl = zElicitationUrlMode.and(object({ mode: literal("url") })).and(object({ message: string2() }));
|
|
194269
|
+
var zGuardCreateElicitationRequestCustom = union([zElicitationSessionScope, zElicitationRequestScope]).and(object({ message: string2() }));
|
|
194270
|
+
var zGuardElicitationPropertySchemaString = zStringPropertySchema.and(object({ type: literal("string") }));
|
|
194271
|
+
var zGuardElicitationPropertySchemaNumber = zNumberPropertySchema.and(object({ type: literal("number") }));
|
|
194272
|
+
var zGuardElicitationPropertySchemaInteger = zIntegerPropertySchema.and(object({ type: literal("integer") }));
|
|
194273
|
+
var zGuardElicitationPropertySchemaBoolean = zBooleanPropertySchema.and(object({ type: literal("boolean") }));
|
|
194274
|
+
var zGuardElicitationPropertySchemaArray = zMultiSelectPropertySchema.and(object({ type: literal("array") }));
|
|
194275
|
+
var zGuardMultiSelectItemsString = zStringMultiSelectItems.and(object({ type: literal("string") }));
|
|
194276
|
+
var zGuardCreateElicitationResponseAccept = zElicitationAcceptAction.and(object({ action: literal("accept") }));
|
|
194277
|
+
var zGuardCreateElicitationResponseDecline = object({
|
|
194278
|
+
action: literal("decline")
|
|
194279
|
+
});
|
|
194280
|
+
var zGuardCreateElicitationResponseCancel = object({
|
|
194281
|
+
action: literal("cancel")
|
|
194282
|
+
});
|
|
194109
194283
|
// node_modules/@agentclientprotocol/sdk/dist/acp.js
|
|
194284
|
+
function ndJsonStream2(output2, input2) {
|
|
194285
|
+
return ndJsonStream(output2, input2);
|
|
194286
|
+
}
|
|
194110
194287
|
function emptyObjectResponse(response) {
|
|
194111
194288
|
return response ?? {};
|
|
194112
194289
|
}
|
|
@@ -194691,6 +194868,7 @@ function runConnectHandlers(connection, handlers) {
|
|
|
194691
194868
|
var appBuilder = Symbol("appBuilder");
|
|
194692
194869
|
var runAgentConnectHandlers = Symbol("runAgentConnectHandlers");
|
|
194693
194870
|
var runClientConnectHandlers = Symbol("runClientConnectHandlers");
|
|
194871
|
+
var stableConnectionOptions = { allowBatches: false };
|
|
194694
194872
|
class AgentApp {
|
|
194695
194873
|
builder = Connection.builder();
|
|
194696
194874
|
connectHandlers = [];
|
|
@@ -194753,7 +194931,7 @@ class AgentApp {
|
|
|
194753
194931
|
return state2;
|
|
194754
194932
|
}
|
|
194755
194933
|
const [thisStream, peerStream] = memoryStreamPair();
|
|
194756
|
-
const peerRawConnection = target[appBuilder]().connect(peerStream);
|
|
194934
|
+
const peerRawConnection = target[appBuilder]().connect(peerStream, stableConnectionOptions);
|
|
194757
194935
|
const peerConnection = clientConnection(peerRawConnection);
|
|
194758
194936
|
const state = this.openStreamConnection(thisStream);
|
|
194759
194937
|
state.rawConnection.closed.then(() => peerConnection.close());
|
|
@@ -194768,8 +194946,8 @@ class AgentApp {
|
|
|
194768
194946
|
}
|
|
194769
194947
|
return state;
|
|
194770
194948
|
}
|
|
194771
|
-
openStreamConnection(
|
|
194772
|
-
const rawConnection = this.builder.connect(
|
|
194949
|
+
openStreamConnection(stream) {
|
|
194950
|
+
const rawConnection = this.builder.connect(stream, stableConnectionOptions);
|
|
194773
194951
|
return {
|
|
194774
194952
|
rawConnection,
|
|
194775
194953
|
connection: agentConnection(rawConnection, this.connectHandlers)
|
|
@@ -194844,7 +195022,7 @@ class ClientApp {
|
|
|
194844
195022
|
return state2;
|
|
194845
195023
|
}
|
|
194846
195024
|
const [thisStream, peerStream] = memoryStreamPair();
|
|
194847
|
-
const peerRawConnection = target[appBuilder]().connect(peerStream);
|
|
195025
|
+
const peerRawConnection = target[appBuilder]().connect(peerStream, stableConnectionOptions);
|
|
194848
195026
|
const peerConnection = agentConnection(peerRawConnection);
|
|
194849
195027
|
const state = this.openStreamConnection(thisStream);
|
|
194850
195028
|
state.rawConnection.closed.then(() => peerConnection.close());
|
|
@@ -194859,8 +195037,8 @@ class ClientApp {
|
|
|
194859
195037
|
}
|
|
194860
195038
|
return state;
|
|
194861
195039
|
}
|
|
194862
|
-
openStreamConnection(
|
|
194863
|
-
const rawConnection = this.builder.connect(
|
|
195040
|
+
openStreamConnection(stream) {
|
|
195041
|
+
const rawConnection = this.builder.connect(stream, stableConnectionOptions);
|
|
194864
195042
|
return {
|
|
194865
195043
|
rawConnection,
|
|
194866
195044
|
connection: clientConnection(rawConnection, this.connectHandlers)
|
|
@@ -196057,7 +196235,7 @@ async function runAcpClientWorkflow(child, input2, abortController, configOption
|
|
|
196057
196235
|
}
|
|
196058
196236
|
const output2 = Writable.toWeb(child.stdin);
|
|
196059
196237
|
const inputStream = Readable.toWeb(child.stdout);
|
|
196060
|
-
const
|
|
196238
|
+
const stream = ndJsonStream2(output2, limitAcpNdJsonLineBytes(inputStream));
|
|
196061
196239
|
const app = client({ name: "kyoso" }).onRequest(methods.client.session.requestPermission, () => ({
|
|
196062
196240
|
outcome: { outcome: "cancelled" }
|
|
196063
196241
|
})).onRequest(methods.client.fs.readTextFile, async (ctx) => ({
|
|
@@ -196079,7 +196257,7 @@ async function runAcpClientWorkflow(child, input2, abortController, configOption
|
|
|
196079
196257
|
policy: "Kyoso does not create terminals."
|
|
196080
196258
|
});
|
|
196081
196259
|
}).onRequest(methods.client.terminal.kill, () => ({}));
|
|
196082
|
-
return app.connectWith(
|
|
196260
|
+
return app.connectWith(stream, async (ctx) => {
|
|
196083
196261
|
await ctx.request(methods.agent.initialize, {
|
|
196084
196262
|
protocolVersion: PROTOCOL_VERSION,
|
|
196085
196263
|
clientCapabilities: {
|
|
@@ -196814,7 +196992,7 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__
|
|
|
196814
196992
|
enumerable: true
|
|
196815
196993
|
}) : target, mod));
|
|
196816
196994
|
|
|
196817
|
-
// node_modules/@modelcontextprotocol/core/dist/auth-
|
|
196995
|
+
// node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs
|
|
196818
196996
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
196819
196997
|
var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
196820
196998
|
LATEST_PROTOCOL_VERSION,
|
|
@@ -196826,6 +197004,7 @@ var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
|
196826
197004
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
196827
197005
|
var PROTOCOL_VERSION_META_KEY = "io.modelcontextprotocol/protocolVersion";
|
|
196828
197006
|
var CLIENT_INFO_META_KEY = "io.modelcontextprotocol/clientInfo";
|
|
197007
|
+
var SERVER_INFO_META_KEY = "io.modelcontextprotocol/serverInfo";
|
|
196829
197008
|
var CLIENT_CAPABILITIES_META_KEY = "io.modelcontextprotocol/clientCapabilities";
|
|
196830
197009
|
var SUBSCRIPTION_ID_META_KEY = "io.modelcontextprotocol/subscriptionId";
|
|
196831
197010
|
var LOG_LEVEL_META_KEY = "io.modelcontextprotocol/logLevel";
|
|
@@ -196859,7 +197038,10 @@ var NotificationSchema = object({
|
|
|
196859
197038
|
method: string2(),
|
|
196860
197039
|
params: NotificationsParamsSchema.loose().optional()
|
|
196861
197040
|
});
|
|
196862
|
-
var
|
|
197041
|
+
var ResultMetaObjectSchema = looseObject({ get [SERVER_INFO_META_KEY]() {
|
|
197042
|
+
return ImplementationSchema.optional().catch(undefined);
|
|
197043
|
+
} });
|
|
197044
|
+
var ResultSchema = looseObject({ _meta: ResultMetaObjectSchema.optional() });
|
|
196863
197045
|
var RequestIdSchema = union([string2(), number2().int()]);
|
|
196864
197046
|
var JSONRPCRequestSchema = object({
|
|
196865
197047
|
jsonrpc: literal(JSONRPC_VERSION),
|
|
@@ -196990,7 +197172,6 @@ var DiscoverRequestSchema = RequestSchema.extend({
|
|
|
196990
197172
|
var DiscoverResultSchema = ResultSchema.extend({
|
|
196991
197173
|
supportedVersions: array(string2()),
|
|
196992
197174
|
capabilities: ServerCapabilitiesSchema,
|
|
196993
|
-
serverInfo: ImplementationSchema,
|
|
196994
197175
|
instructions: string2().optional()
|
|
196995
197176
|
});
|
|
196996
197177
|
var PingRequestSchema = RequestSchema.extend({
|
|
@@ -197095,7 +197276,7 @@ var SubscriptionsAcknowledgedNotificationSchema = NotificationSchema.extend({
|
|
|
197095
197276
|
method: literal("notifications/subscriptions/acknowledged"),
|
|
197096
197277
|
params: SubscriptionsAcknowledgedNotificationParamsSchema
|
|
197097
197278
|
});
|
|
197098
|
-
var SubscriptionsListenResultMetaSchema =
|
|
197279
|
+
var SubscriptionsListenResultMetaSchema = ResultMetaObjectSchema.extend({ [SUBSCRIPTION_ID_META_KEY]: RequestIdSchema });
|
|
197099
197280
|
var SubscriptionsListenResultSchema = ResultSchema.extend({ _meta: SubscriptionsListenResultMetaSchema });
|
|
197100
197281
|
var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({ uri: string2() });
|
|
197101
197282
|
var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
@@ -197752,7 +197933,7 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
197752
197933
|
token_type_hint: string2().optional()
|
|
197753
197934
|
}).strip();
|
|
197754
197935
|
|
|
197755
|
-
// node_modules/@modelcontextprotocol/server/dist/src-
|
|
197936
|
+
// node_modules/@modelcontextprotocol/server/dist/src-D86MbS1I.mjs
|
|
197756
197937
|
var BRANDS = Symbol.for("mcp.sdk.errorBrands");
|
|
197757
197938
|
function stampErrorBrands(instance, ctor) {
|
|
197758
197939
|
const brands = /* @__PURE__ */ new Set;
|
|
@@ -197870,7 +198051,7 @@ var SdkHttpError = class extends SdkError {
|
|
|
197870
198051
|
return this.data.statusText;
|
|
197871
198052
|
}
|
|
197872
198053
|
};
|
|
197873
|
-
function isPlainObject$
|
|
198054
|
+
function isPlainObject$7(value) {
|
|
197874
198055
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
197875
198056
|
}
|
|
197876
198057
|
function isImpliedCapabilityMember(capability, member, declaredValue) {
|
|
@@ -197904,7 +198085,7 @@ function missingClientCapabilities(required2, declared) {
|
|
|
197904
198085
|
missing[capability] = requirement;
|
|
197905
198086
|
continue;
|
|
197906
198087
|
}
|
|
197907
|
-
if (isPlainObject$
|
|
198088
|
+
if (isPlainObject$7(requirement) && isPlainObject$7(declaredValue)) {
|
|
197908
198089
|
const missingMembers = {};
|
|
197909
198090
|
for (const [member, memberRequirement] of Object.entries(requirement))
|
|
197910
198091
|
if (memberRequirement !== undefined && declaredValue[member] === undefined && !isImpliedCapabilityMember(capability, member, declaredValue))
|
|
@@ -199023,7 +199204,7 @@ function getNotificationSchema(method) {
|
|
|
199023
199204
|
}
|
|
199024
199205
|
var rev2025RequestMethods = Object.keys(requestMethodKeys$1);
|
|
199025
199206
|
var rev2025NotificationMethods = Object.keys(notificationMethodKeys$1);
|
|
199026
|
-
function isPlainObject$
|
|
199207
|
+
function isPlainObject$6(value) {
|
|
199027
199208
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
199028
199209
|
}
|
|
199029
199210
|
function triState$1(schema, raw) {
|
|
@@ -199047,7 +199228,7 @@ var NOT_IN_ERA$1 = {
|
|
|
199047
199228
|
reason: "not-in-era"
|
|
199048
199229
|
};
|
|
199049
199230
|
function toolNeedsLegacyWrap(t) {
|
|
199050
|
-
return isPlainObject$
|
|
199231
|
+
return isPlainObject$6(t) && isPlainObject$6(t["outputSchema"]) && isNonObjectJsonSchemaRoot(t["outputSchema"]);
|
|
199051
199232
|
}
|
|
199052
199233
|
function toNeutralResult(value) {
|
|
199053
199234
|
return value;
|
|
@@ -199085,7 +199266,7 @@ var rev2025Codec = {
|
|
|
199085
199266
|
};
|
|
199086
199267
|
},
|
|
199087
199268
|
decodeResult(_method, raw) {
|
|
199088
|
-
if (isPlainObject$
|
|
199269
|
+
if (isPlainObject$6(raw) && "resultType" in raw) {
|
|
199089
199270
|
const stripped = { ...raw };
|
|
199090
199271
|
delete stripped["resultType"];
|
|
199091
199272
|
return {
|
|
@@ -199506,7 +199687,7 @@ function build() {
|
|
|
199506
199687
|
const RequestMetaEnvelopeSchema = looseObject({
|
|
199507
199688
|
progressToken: ProgressTokenSchema$1.optional(),
|
|
199508
199689
|
[PROTOCOL_VERSION_META_KEY]: string2(),
|
|
199509
|
-
[CLIENT_INFO_META_KEY]: ImplementationSchema$1,
|
|
199690
|
+
[CLIENT_INFO_META_KEY]: ImplementationSchema$1.optional(),
|
|
199510
199691
|
[CLIENT_CAPABILITIES_META_KEY]: ClientCapabilities2026Schema,
|
|
199511
199692
|
[LOG_LEVEL_META_KEY]: LoggingLevelSchema$1.optional()
|
|
199512
199693
|
});
|
|
@@ -199543,7 +199724,8 @@ function build() {
|
|
|
199543
199724
|
_meta: record(string2(), unknown()).optional()
|
|
199544
199725
|
});
|
|
199545
199726
|
const ResultTypeSchema = string2();
|
|
199546
|
-
const
|
|
199727
|
+
const ResultMetaSchema = looseObject({ [SERVER_INFO_META_KEY]: ImplementationSchema$1.optional().catch(undefined) });
|
|
199728
|
+
const wireMeta = ResultMetaSchema.optional();
|
|
199547
199729
|
function wireResult(shape) {
|
|
199548
199730
|
return looseObject({
|
|
199549
199731
|
_meta: wireMeta,
|
|
@@ -199605,7 +199787,6 @@ function build() {
|
|
|
199605
199787
|
cacheScope: _enum2(["public", "private"]).catch("private"),
|
|
199606
199788
|
supportedVersions: array(string2()),
|
|
199607
199789
|
capabilities: ServerCapabilities2026Schema,
|
|
199608
|
-
serverInfo: ImplementationSchema$1,
|
|
199609
199790
|
instructions: string2().optional()
|
|
199610
199791
|
});
|
|
199611
199792
|
const CreateMessageRequestParamsSchema$1 = object({
|
|
@@ -199742,7 +199923,7 @@ function build() {
|
|
|
199742
199923
|
});
|
|
199743
199924
|
const subscriptionsListenParamsShape = { notifications: SubscriptionFilterSchema$1 };
|
|
199744
199925
|
const SubscriptionsListenRequestSchema$1 = wireRequest("subscriptions/listen", subscriptionsListenParamsShape);
|
|
199745
|
-
const SubscriptionsListenResultMetaSchema$1 =
|
|
199926
|
+
const SubscriptionsListenResultMetaSchema$1 = ResultMetaSchema.extend({ "io.modelcontextprotocol/subscriptionId": RequestIdSchema$1 });
|
|
199746
199927
|
const SubscriptionsListenResultSchema$1 = looseObject({
|
|
199747
199928
|
_meta: SubscriptionsListenResultMetaSchema$1,
|
|
199748
199929
|
resultType: ResultTypeSchema.default("complete")
|
|
@@ -199817,7 +199998,6 @@ function build() {
|
|
|
199817
199998
|
cacheScope: _enum2(["public", "private"]).catch("private"),
|
|
199818
199999
|
supportedVersions: array(string2()),
|
|
199819
200000
|
capabilities: ServerCapabilities2026Schema,
|
|
199820
|
-
serverInfo: ImplementationSchema$1,
|
|
199821
200001
|
instructions: string2().optional()
|
|
199822
200002
|
}),
|
|
199823
200003
|
"subscriptions/listen": liftedResult({})
|
|
@@ -199931,6 +200111,7 @@ function build() {
|
|
|
199931
200111
|
SamplingMessageContentBlockSchema: SamplingMessageContentBlockSchema$1,
|
|
199932
200112
|
SamplingMessageSchema: SamplingMessageSchema$1,
|
|
199933
200113
|
ResultTypeSchema,
|
|
200114
|
+
ResultMetaSchema,
|
|
199934
200115
|
ResultSchema: ResultSchema$1,
|
|
199935
200116
|
PaginatedResultSchema: PaginatedResultSchema$1,
|
|
199936
200117
|
CallToolResultSchema: CallToolResultSchema$1,
|
|
@@ -200182,6 +200363,30 @@ function fillCacheFields(method, result) {
|
|
|
200182
200363
|
delete filled[RESULT_CACHE_HINT_FALLBACK];
|
|
200183
200364
|
return filled;
|
|
200184
200365
|
}
|
|
200366
|
+
function isPlainObject$5(value) {
|
|
200367
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
200368
|
+
}
|
|
200369
|
+
function stampServerInfoMeta(result, serverInfo) {
|
|
200370
|
+
if (serverInfo === undefined)
|
|
200371
|
+
return result;
|
|
200372
|
+
const meta3 = result["_meta"];
|
|
200373
|
+
if (meta3 === undefined)
|
|
200374
|
+
return {
|
|
200375
|
+
...result,
|
|
200376
|
+
_meta: { [SERVER_INFO_META_KEY]: serverInfo }
|
|
200377
|
+
};
|
|
200378
|
+
if (!isPlainObject$5(meta3))
|
|
200379
|
+
return result;
|
|
200380
|
+
if (meta3[SERVER_INFO_META_KEY] !== undefined)
|
|
200381
|
+
return result;
|
|
200382
|
+
return {
|
|
200383
|
+
...result,
|
|
200384
|
+
_meta: {
|
|
200385
|
+
...meta3,
|
|
200386
|
+
[SERVER_INFO_META_KEY]: serverInfo
|
|
200387
|
+
}
|
|
200388
|
+
};
|
|
200389
|
+
}
|
|
200185
200390
|
function resolveTtlMs(fallback) {
|
|
200186
200391
|
return fallback !== undefined && isValidCacheTtlMs(fallback.ttlMs) ? fallback.ttlMs : DEFAULT_CACHE_TTL_MS;
|
|
200187
200392
|
}
|
|
@@ -200300,11 +200505,7 @@ var NOT_IN_ERA = {
|
|
|
200300
200505
|
ok: false,
|
|
200301
200506
|
reason: "not-in-era"
|
|
200302
200507
|
};
|
|
200303
|
-
var REQUIRED_ENVELOPE_KEYS = [
|
|
200304
|
-
PROTOCOL_VERSION_META_KEY,
|
|
200305
|
-
CLIENT_INFO_META_KEY,
|
|
200306
|
-
CLIENT_CAPABILITIES_META_KEY
|
|
200307
|
-
];
|
|
200508
|
+
var REQUIRED_ENVELOPE_KEYS = [PROTOCOL_VERSION_META_KEY, CLIENT_CAPABILITIES_META_KEY];
|
|
200308
200509
|
function enforceDeletedFields(method, result) {
|
|
200309
200510
|
let next = result;
|
|
200310
200511
|
let copied = false;
|
|
@@ -200441,13 +200642,13 @@ var rev2026Codec = {
|
|
|
200441
200642
|
result: lifted
|
|
200442
200643
|
};
|
|
200443
200644
|
},
|
|
200444
|
-
encodeResult(method, result) {
|
|
200445
|
-
return fillCacheFields(method, stampResultType(method, enforceDeletedFields(method, result)));
|
|
200645
|
+
encodeResult(method, result, serverInfo) {
|
|
200646
|
+
return stampServerInfoMeta(fillCacheFields(method, stampResultType(method, enforceDeletedFields(method, result))), serverInfo);
|
|
200446
200647
|
},
|
|
200447
200648
|
encodeErrorCode: (code) => code === -32002 ? -32602 : code,
|
|
200448
200649
|
checkInboundEnvelope(material) {
|
|
200449
200650
|
if (material.envelope === undefined)
|
|
200450
|
-
return "Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/
|
|
200651
|
+
return "Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";
|
|
200451
200652
|
const parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(material.envelope);
|
|
200452
200653
|
if (!parsed.success)
|
|
200453
200654
|
return `Invalid _meta envelope for protocol revision 2026-07-28: ${parsed.error.issues.map((issue2) => issue2.message).join("; ")}`;
|
|
@@ -200606,6 +200807,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
|
200606
200807
|
ResourceTemplateSchema: () => ResourceTemplateSchema,
|
|
200607
200808
|
ResourceUpdatedNotificationParamsSchema: () => ResourceUpdatedNotificationParamsSchema,
|
|
200608
200809
|
ResourceUpdatedNotificationSchema: () => ResourceUpdatedNotificationSchema,
|
|
200810
|
+
ResultMetaObjectSchema: () => ResultMetaObjectSchema,
|
|
200609
200811
|
ResultSchema: () => ResultSchema,
|
|
200610
200812
|
RoleSchema: () => RoleSchema,
|
|
200611
200813
|
RootSchema: () => RootSchema,
|
|
@@ -201287,6 +201489,7 @@ var SPEC_SCHEMA_KEYS = [
|
|
|
201287
201489
|
"ResourceTemplateReferenceSchema",
|
|
201288
201490
|
"ResourceUpdatedNotificationSchema",
|
|
201289
201491
|
"ResourceUpdatedNotificationParamsSchema",
|
|
201492
|
+
"ResultMetaObjectSchema",
|
|
201290
201493
|
"ResultSchema",
|
|
201291
201494
|
"RoleSchema",
|
|
201292
201495
|
"RootSchema",
|
|
@@ -201713,7 +201916,7 @@ var Protocol = class {
|
|
|
201713
201916
|
return;
|
|
201714
201917
|
let encoded;
|
|
201715
201918
|
try {
|
|
201716
|
-
encoded = codec2.encodeResult(request.method, result);
|
|
201919
|
+
encoded = codec2.encodeResult(request.method, result, this._outboundServerInfo());
|
|
201717
201920
|
} catch (error51) {
|
|
201718
201921
|
this._onerror(/* @__PURE__ */ new Error(`Failed to encode result for ${request.method}: ${error51}`));
|
|
201719
201922
|
sendErrorResponse(ProtocolErrorCode.InternalError, "Internal error");
|
|
@@ -202012,6 +202215,7 @@ var Protocol = class {
|
|
|
202012
202215
|
_wrapHandler(_method, handler) {
|
|
202013
202216
|
return handler;
|
|
202014
202217
|
}
|
|
202218
|
+
_outboundServerInfo() {}
|
|
202015
202219
|
removeRequestHandler(method) {
|
|
202016
202220
|
this._requestHandlers.delete(method);
|
|
202017
202221
|
}
|
|
@@ -209439,7 +209643,7 @@ var Ajv = import_ajv.Ajv;
|
|
|
209439
209643
|
// node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
|
|
209440
209644
|
import process3 from "node:process";
|
|
209441
209645
|
|
|
209442
|
-
// node_modules/@modelcontextprotocol/server/dist/mcp-
|
|
209646
|
+
// node_modules/@modelcontextprotocol/server/dist/mcp-IJurDZVN.mjs
|
|
209443
209647
|
var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
209444
209648
|
function isCompletable(schema) {
|
|
209445
209649
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -209602,6 +209806,7 @@ var INPUT_REQUIRED_CAPABLE_METHODS = new Set([
|
|
|
209602
209806
|
]);
|
|
209603
209807
|
var writeClientIdentity;
|
|
209604
209808
|
var installDiscoverHandler;
|
|
209809
|
+
var readServerIdentity;
|
|
209605
209810
|
var Server = class extends Protocol {
|
|
209606
209811
|
_clientCapabilities;
|
|
209607
209812
|
_clientVersion;
|
|
@@ -209618,6 +209823,7 @@ var Server = class extends Protocol {
|
|
|
209618
209823
|
server2._supportedProtocolVersions = [...server2._supportedProtocolVersions, ...missing];
|
|
209619
209824
|
server2.setRequestHandler("server/discover", () => server2._ondiscover());
|
|
209620
209825
|
};
|
|
209826
|
+
readServerIdentity = (server2) => server2._serverInfo;
|
|
209621
209827
|
}
|
|
209622
209828
|
_capabilities;
|
|
209623
209829
|
_instructions;
|
|
@@ -209922,10 +210128,12 @@ var Server = class extends Protocol {
|
|
|
209922
210128
|
return {
|
|
209923
210129
|
supportedVersions: modernProtocolVersions(this._supportedProtocolVersions),
|
|
209924
210130
|
capabilities: discoverAdvertisedCapabilities(this.getCapabilities()),
|
|
209925
|
-
serverInfo: this._serverInfo,
|
|
209926
210131
|
...this._instructions && { instructions: this._instructions }
|
|
209927
210132
|
};
|
|
209928
210133
|
}
|
|
210134
|
+
_outboundServerInfo() {
|
|
210135
|
+
return this._serverInfo;
|
|
210136
|
+
}
|
|
209929
210137
|
getClientCapabilities() {
|
|
209930
210138
|
return this._clientCapabilities;
|
|
209931
210139
|
}
|