@kyo-so/cli 0.15.0 → 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 +42 -0
- package/README.ja.md +31 -7
- package/README.md +2 -2
- package/README.zh-CN.md +31 -7
- 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 +4 -4
|
@@ -10,9 +10,9 @@ export declare const PLUGIN_RUNTIME_COMPATIBILITY_SCHEMA_VERSION = 2;
|
|
|
10
10
|
export declare const MINIMUM_SUPPORTED_CODEX_VERSION = "0.144.0-alpha.4";
|
|
11
11
|
export declare const PLUGIN_RUNTIME_EXPECTED_CONTRACT: {
|
|
12
12
|
readonly distribution: {
|
|
13
|
-
readonly pluginVersion: "0.7.
|
|
13
|
+
readonly pluginVersion: "0.7.6";
|
|
14
14
|
readonly mcpCommand: "npx";
|
|
15
|
-
readonly mcpPackagePin: "@kyo-so/cli@0.
|
|
15
|
+
readonly mcpPackagePin: "@kyo-so/cli@0.15.1";
|
|
16
16
|
readonly mcpExecutable: "kyoso";
|
|
17
17
|
};
|
|
18
18
|
readonly marketplace: {
|
|
@@ -131,9 +131,9 @@ export declare const pluginRuntimeContract: {
|
|
|
131
131
|
readonly pluginListTopLevelKeys: readonly ["installed", "available"];
|
|
132
132
|
readonly expectedContract: {
|
|
133
133
|
readonly distribution: {
|
|
134
|
-
readonly pluginVersion: "0.7.
|
|
134
|
+
readonly pluginVersion: "0.7.6";
|
|
135
135
|
readonly mcpCommand: "npx";
|
|
136
|
-
readonly mcpPackagePin: "@kyo-so/cli@0.
|
|
136
|
+
readonly mcpPackagePin: "@kyo-so/cli@0.15.1";
|
|
137
137
|
readonly mcpExecutable: "kyoso";
|
|
138
138
|
};
|
|
139
139
|
readonly marketplace: {
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export declare const JUDGE_MAX_OUTPUT_TOKENS = 4096;
|
|
|
7
7
|
export declare const RAW_OUTPUT_MAX_CHARS = 16384;
|
|
8
8
|
export declare const TRACE_DIR = ".kyoso/traces";
|
|
9
9
|
export declare const KYOSO_CHILD_AGENT = "KYOSO_CHILD_AGENT";
|
|
10
|
-
export declare const KYOSO_VERSION = "0.15.
|
|
10
|
+
export declare const KYOSO_VERSION = "0.15.2";
|
package/dist/index.js
CHANGED
|
@@ -184178,7 +184178,7 @@ var defaultConfig = {
|
|
|
184178
184178
|
enabled: true,
|
|
184179
184179
|
type: "acp",
|
|
184180
184180
|
command: "npx",
|
|
184181
|
-
args: ["-y", "@agentclientprotocol/codex-acp@1.1.
|
|
184181
|
+
args: ["-y", "@agentclientprotocol/codex-acp@1.1.7"],
|
|
184182
184182
|
role: "implementation_reviewer",
|
|
184183
184183
|
timeoutMs: DEFAULT_AGENT_TIMEOUT_MS,
|
|
184184
184184
|
allowProjectProvider: [],
|
|
@@ -184203,7 +184203,7 @@ var defaultConfig = {
|
|
|
184203
184203
|
enabled: true,
|
|
184204
184204
|
type: "acp",
|
|
184205
184205
|
command: "npx",
|
|
184206
|
-
args: ["-y", "@agentclientprotocol/claude-agent-acp@0.
|
|
184206
|
+
args: ["-y", "@agentclientprotocol/claude-agent-acp@0.61.0"],
|
|
184207
184207
|
role: "architecture_security_reviewer",
|
|
184208
184208
|
timeoutMs: DEFAULT_AGENT_TIMEOUT_MS,
|
|
184209
184209
|
env: {
|
|
@@ -186448,6 +186448,9 @@ var zToolCallUpdate = object({
|
|
|
186448
186448
|
title: defaultOnError(string2().nullish(), () => {
|
|
186449
186449
|
return;
|
|
186450
186450
|
}),
|
|
186451
|
+
name: defaultOnError(string2().nullish(), () => {
|
|
186452
|
+
return;
|
|
186453
|
+
}),
|
|
186451
186454
|
content: defaultOnError(vecSkipError(zToolCallContent).nullish(), () => {
|
|
186452
186455
|
return;
|
|
186453
186456
|
}),
|
|
@@ -187559,6 +187562,9 @@ var zContentChunk = object({
|
|
|
187559
187562
|
var zToolCall = object({
|
|
187560
187563
|
toolCallId: zToolCallId,
|
|
187561
187564
|
title: string2(),
|
|
187565
|
+
name: defaultOnError(string2().nullish(), () => {
|
|
187566
|
+
return;
|
|
187567
|
+
}),
|
|
187562
187568
|
kind: defaultOnError(zToolKind.optional(), () => {
|
|
187563
187569
|
return;
|
|
187564
187570
|
}),
|
|
@@ -188482,37 +188488,71 @@ var zCancelRequestNotification = object({
|
|
|
188482
188488
|
})
|
|
188483
188489
|
});
|
|
188484
188490
|
|
|
188485
|
-
// node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js
|
|
188486
|
-
var zGuardCreateElicitationRequestForm = zElicitationFormMode.and(object({ mode: literal("form") })).and(object({ message: string2() }));
|
|
188487
|
-
var zGuardCreateElicitationRequestUrl = zElicitationUrlMode.and(object({ mode: literal("url") })).and(object({ message: string2() }));
|
|
188488
|
-
var zGuardCreateElicitationRequestCustom = union([zElicitationSessionScope, zElicitationRequestScope]).and(object({ message: string2() }));
|
|
188489
|
-
var zGuardElicitationPropertySchemaString = zStringPropertySchema.and(object({ type: literal("string") }));
|
|
188490
|
-
var zGuardElicitationPropertySchemaNumber = zNumberPropertySchema.and(object({ type: literal("number") }));
|
|
188491
|
-
var zGuardElicitationPropertySchemaInteger = zIntegerPropertySchema.and(object({ type: literal("integer") }));
|
|
188492
|
-
var zGuardElicitationPropertySchemaBoolean = zBooleanPropertySchema.and(object({ type: literal("boolean") }));
|
|
188493
|
-
var zGuardElicitationPropertySchemaArray = zMultiSelectPropertySchema.and(object({ type: literal("array") }));
|
|
188494
|
-
var zGuardMultiSelectItemsString = zStringMultiSelectItems.and(object({ type: literal("string") }));
|
|
188495
|
-
var zGuardCreateElicitationResponseAccept = zElicitationAcceptAction.and(object({ action: literal("accept") }));
|
|
188496
|
-
var zGuardCreateElicitationResponseDecline = object({
|
|
188497
|
-
action: literal("decline")
|
|
188498
|
-
});
|
|
188499
|
-
var zGuardCreateElicitationResponseCancel = object({
|
|
188500
|
-
action: literal("cancel")
|
|
188501
|
-
});
|
|
188502
188491
|
// node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js
|
|
188503
188492
|
var CANCEL_REQUEST_METHOD = "$/cancel_request";
|
|
188493
|
+
function isRequestMessage(value) {
|
|
188494
|
+
return isJsonRpcEnvelope(value) && "id" in value && typeof value["method"] === "string" && isJsonRpcId(value["id"]);
|
|
188495
|
+
}
|
|
188496
|
+
function isResponseMessage(value) {
|
|
188497
|
+
if (!isJsonRpcEnvelope(value) || "method" in value) {
|
|
188498
|
+
return false;
|
|
188499
|
+
}
|
|
188500
|
+
if (!("id" in value) || !isJsonRpcId(value["id"])) {
|
|
188501
|
+
return false;
|
|
188502
|
+
}
|
|
188503
|
+
const hasResult = Object.hasOwn(value, "result");
|
|
188504
|
+
const hasError = Object.hasOwn(value, "error");
|
|
188505
|
+
if (hasResult === hasError) {
|
|
188506
|
+
return false;
|
|
188507
|
+
}
|
|
188508
|
+
return !hasError || isErrorResponse(value["error"]);
|
|
188509
|
+
}
|
|
188510
|
+
function isNotificationMessage(value) {
|
|
188511
|
+
return isJsonRpcEnvelope(value) && !("id" in value) && typeof value["method"] === "string";
|
|
188512
|
+
}
|
|
188504
188513
|
function isRecord5(value) {
|
|
188505
188514
|
return typeof value === "object" && value !== null;
|
|
188506
188515
|
}
|
|
188516
|
+
function isJsonRpcEnvelope(value) {
|
|
188517
|
+
return isRecord5(value) && value["jsonrpc"] === "2.0";
|
|
188518
|
+
}
|
|
188507
188519
|
function isJsonRpcId(value) {
|
|
188508
188520
|
return value === null || typeof value === "string" || typeof value === "number" && Number.isFinite(value);
|
|
188509
188521
|
}
|
|
188522
|
+
function isResponseShapedMessage(value) {
|
|
188523
|
+
return isRecord5(value) && !("method" in value) && (("id" in value) || ("result" in value) || ("error" in value));
|
|
188524
|
+
}
|
|
188525
|
+
function isResponseBatch(batch) {
|
|
188526
|
+
let hasValidCall = false;
|
|
188527
|
+
let hasValidResponse = false;
|
|
188528
|
+
let hasCallShape = false;
|
|
188529
|
+
let hasResponseShape = false;
|
|
188530
|
+
for (const entry of batch) {
|
|
188531
|
+
hasValidCall ||= isRequestMessage(entry) || isNotificationMessage(entry);
|
|
188532
|
+
hasValidResponse ||= isResponseMessage(entry);
|
|
188533
|
+
if (!isRecord5(entry)) {
|
|
188534
|
+
continue;
|
|
188535
|
+
}
|
|
188536
|
+
hasCallShape ||= "method" in entry;
|
|
188537
|
+
hasResponseShape ||= "result" in entry || "error" in entry;
|
|
188538
|
+
}
|
|
188539
|
+
if (hasValidCall) {
|
|
188540
|
+
return false;
|
|
188541
|
+
}
|
|
188542
|
+
if (hasValidResponse) {
|
|
188543
|
+
return true;
|
|
188544
|
+
}
|
|
188545
|
+
return hasResponseShape && !hasCallShape;
|
|
188546
|
+
}
|
|
188510
188547
|
function cancelRequestId(params) {
|
|
188511
188548
|
if (!isRecord5(params) || !isJsonRpcId(params["requestId"])) {
|
|
188512
188549
|
return;
|
|
188513
188550
|
}
|
|
188514
188551
|
return params["requestId"];
|
|
188515
188552
|
}
|
|
188553
|
+
function isErrorResponse(value) {
|
|
188554
|
+
return isRecord5(value) && typeof value["code"] === "number" && Number.isInteger(value["code"]) && typeof value["message"] === "string";
|
|
188555
|
+
}
|
|
188516
188556
|
var Handled = {
|
|
188517
188557
|
yes() {
|
|
188518
188558
|
return { handled: true };
|
|
@@ -188641,6 +188681,9 @@ class ConnectionContext {
|
|
|
188641
188681
|
sendNotification(method, params) {
|
|
188642
188682
|
return this.connection.sendNotification(method, params);
|
|
188643
188683
|
}
|
|
188684
|
+
sendBatch(entries) {
|
|
188685
|
+
return this.connection.sendBatch(entries);
|
|
188686
|
+
}
|
|
188644
188687
|
sendCancelRequest(requestId) {
|
|
188645
188688
|
return this.connection.sendCancelRequest(requestId);
|
|
188646
188689
|
}
|
|
@@ -188668,6 +188711,7 @@ class Connection {
|
|
|
188668
188711
|
retryQueue = [];
|
|
188669
188712
|
context = new ConnectionContext(this);
|
|
188670
188713
|
receiveReader;
|
|
188714
|
+
allowBatches = true;
|
|
188671
188715
|
constructor(requestHandlerOrStream, notificationHandlerOrHandlers, streamOrOptions, options) {
|
|
188672
188716
|
if (typeof requestHandlerOrStream === "function") {
|
|
188673
188717
|
const requestHandler = requestHandlerOrStream;
|
|
@@ -188676,16 +188720,13 @@ class Connection {
|
|
|
188676
188720
|
this.initialize(stream2, [
|
|
188677
188721
|
...options?.handlers ?? [],
|
|
188678
188722
|
this.legacyHandler(requestHandler, notificationHandler)
|
|
188679
|
-
]);
|
|
188723
|
+
], options);
|
|
188680
188724
|
return;
|
|
188681
188725
|
}
|
|
188682
188726
|
const stream = requestHandlerOrStream;
|
|
188683
188727
|
const handlers = notificationHandlerOrHandlers;
|
|
188684
188728
|
const connectionOptions = streamOrOptions;
|
|
188685
|
-
this.initialize(stream, [
|
|
188686
|
-
...connectionOptions?.handlers ?? [],
|
|
188687
|
-
...handlers
|
|
188688
|
-
]);
|
|
188729
|
+
this.initialize(stream, [...connectionOptions?.handlers ?? [], ...handlers], connectionOptions);
|
|
188689
188730
|
}
|
|
188690
188731
|
static builder() {
|
|
188691
188732
|
return new ConnectionBuilder;
|
|
@@ -188730,14 +188771,73 @@ class Connection {
|
|
|
188730
188771
|
if (this.abortController.signal.aborted) {
|
|
188731
188772
|
return rejectedPromise(this.closedReason());
|
|
188732
188773
|
}
|
|
188774
|
+
const request = this.prepareRequest(method, params, mapResponse, options);
|
|
188775
|
+
const requestSent = this.sendWireMessage(request.message);
|
|
188776
|
+
requestSent.catch(() => {});
|
|
188777
|
+
if (options.cancellationSignal?.aborted) {
|
|
188778
|
+
request.cancel();
|
|
188779
|
+
}
|
|
188780
|
+
return request.response;
|
|
188781
|
+
}
|
|
188782
|
+
sendBatch(entries) {
|
|
188783
|
+
if (this.abortController.signal.aborted) {
|
|
188784
|
+
return rejectedPromise(this.closedReason());
|
|
188785
|
+
}
|
|
188786
|
+
if (!this.allowBatches) {
|
|
188787
|
+
return rejectedPromise(new TypeError("JSON-RPC batches are not supported on this connection"));
|
|
188788
|
+
}
|
|
188789
|
+
if (entries.length === 0) {
|
|
188790
|
+
return rejectedPromise(new TypeError("JSON-RPC batch must contain at least one entry"));
|
|
188791
|
+
}
|
|
188792
|
+
const messages = [];
|
|
188793
|
+
const cancellations = [];
|
|
188794
|
+
const outputs = [];
|
|
188795
|
+
for (const entry of entries) {
|
|
188796
|
+
if (entry.kind === "notification") {
|
|
188797
|
+
messages.push({
|
|
188798
|
+
jsonrpc: "2.0",
|
|
188799
|
+
method: entry.method,
|
|
188800
|
+
params: entry.params
|
|
188801
|
+
});
|
|
188802
|
+
outputs.push(Promise.resolve(undefined));
|
|
188803
|
+
continue;
|
|
188804
|
+
}
|
|
188805
|
+
const request = this.prepareRequest(entry.method, entry.params, entry.mapResponse, entry.options);
|
|
188806
|
+
messages.push(request.message);
|
|
188807
|
+
outputs.push(request.response);
|
|
188808
|
+
cancellations.push({
|
|
188809
|
+
signal: entry.options?.cancellationSignal,
|
|
188810
|
+
cancel: request.cancel
|
|
188811
|
+
});
|
|
188812
|
+
}
|
|
188813
|
+
const batch = messages;
|
|
188814
|
+
const batchSent = this.sendWireMessage(batch);
|
|
188815
|
+
for (const cancellation of cancellations) {
|
|
188816
|
+
if (cancellation.signal?.aborted) {
|
|
188817
|
+
cancellation.cancel();
|
|
188818
|
+
}
|
|
188819
|
+
}
|
|
188820
|
+
const response = Promise.all([batchSent, ...outputs]).then(([, ...resolved]) => resolved);
|
|
188821
|
+
response.catch(() => {});
|
|
188822
|
+
return response;
|
|
188823
|
+
}
|
|
188824
|
+
sendCancelRequest(requestId) {
|
|
188825
|
+
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
188826
|
+
}
|
|
188827
|
+
sendNotification(method, params) {
|
|
188828
|
+
if (this.abortController.signal.aborted) {
|
|
188829
|
+
return rejectedPromise(this.closedReason());
|
|
188830
|
+
}
|
|
188831
|
+
return this.sendWireMessage({ jsonrpc: "2.0", method, params });
|
|
188832
|
+
}
|
|
188833
|
+
prepareRequest(method, params, mapResponse, options = {}) {
|
|
188733
188834
|
const id = this.nextRequestId++;
|
|
188734
188835
|
let cancel = () => {};
|
|
188735
|
-
const
|
|
188836
|
+
const response = new Promise((resolve3, reject) => {
|
|
188736
188837
|
const pendingResponse = {
|
|
188737
|
-
resolve: (
|
|
188838
|
+
resolve: (value) => {
|
|
188738
188839
|
try {
|
|
188739
|
-
|
|
188740
|
-
resolve3(value);
|
|
188840
|
+
resolve3(mapResponse ? mapResponse(value) : value);
|
|
188741
188841
|
} catch (error51) {
|
|
188742
188842
|
reject(error51);
|
|
188743
188843
|
}
|
|
@@ -188760,27 +188860,12 @@ class Connection {
|
|
|
188760
188860
|
};
|
|
188761
188861
|
this.pendingResponses.set(id, pendingResponse);
|
|
188762
188862
|
});
|
|
188763
|
-
|
|
188764
|
-
|
|
188765
|
-
jsonrpc: "2.0",
|
|
188766
|
-
|
|
188767
|
-
|
|
188768
|
-
|
|
188769
|
-
});
|
|
188770
|
-
requestSent.catch(() => {});
|
|
188771
|
-
if (options.cancellationSignal?.aborted) {
|
|
188772
|
-
cancel();
|
|
188773
|
-
}
|
|
188774
|
-
return responsePromise;
|
|
188775
|
-
}
|
|
188776
|
-
sendCancelRequest(requestId) {
|
|
188777
|
-
return this.sendNotification(CANCEL_REQUEST_METHOD, { requestId });
|
|
188778
|
-
}
|
|
188779
|
-
sendNotification(method, params) {
|
|
188780
|
-
if (this.abortController.signal.aborted) {
|
|
188781
|
-
return rejectedPromise(this.closedReason());
|
|
188782
|
-
}
|
|
188783
|
-
return this.sendMessage({ jsonrpc: "2.0", method, params });
|
|
188863
|
+
response.catch(() => {});
|
|
188864
|
+
return {
|
|
188865
|
+
message: { jsonrpc: "2.0", id, method, params },
|
|
188866
|
+
response,
|
|
188867
|
+
cancel: () => cancel()
|
|
188868
|
+
};
|
|
188784
188869
|
}
|
|
188785
188870
|
close(error51) {
|
|
188786
188871
|
if (this.abortController.signal.aborted) {
|
|
@@ -188799,9 +188884,10 @@ class Connection {
|
|
|
188799
188884
|
this.incomingRequests.clear();
|
|
188800
188885
|
this.receiveReader?.cancel(closeError).catch(() => {});
|
|
188801
188886
|
}
|
|
188802
|
-
initialize(stream, handlers) {
|
|
188887
|
+
initialize(stream, handlers, options) {
|
|
188803
188888
|
this.stream = stream;
|
|
188804
188889
|
this.staticHandlers = handlers;
|
|
188890
|
+
this.allowBatches = options?.allowBatches ?? true;
|
|
188805
188891
|
this.closedPromise = new Promise((resolve3) => {
|
|
188806
188892
|
this.abortController.signal.addEventListener("abort", () => resolve3());
|
|
188807
188893
|
});
|
|
@@ -188837,7 +188923,7 @@ class Connection {
|
|
|
188837
188923
|
if (!message) {
|
|
188838
188924
|
continue;
|
|
188839
188925
|
}
|
|
188840
|
-
this.
|
|
188926
|
+
this.receiveWireMessage(message);
|
|
188841
188927
|
}
|
|
188842
188928
|
} finally {
|
|
188843
188929
|
if (this.receiveReader === reader) {
|
|
@@ -188851,24 +188937,91 @@ class Connection {
|
|
|
188851
188937
|
this.close(closeError);
|
|
188852
188938
|
}
|
|
188853
188939
|
}
|
|
188854
|
-
|
|
188855
|
-
if (
|
|
188940
|
+
receiveWireMessage(message) {
|
|
188941
|
+
if (Array.isArray(message)) {
|
|
188942
|
+
if (!this.allowBatches) {
|
|
188943
|
+
this.close(new TypeError("JSON-RPC batches are not supported on this connection"));
|
|
188944
|
+
return;
|
|
188945
|
+
}
|
|
188946
|
+
this.receiveBatch(message);
|
|
188856
188947
|
return;
|
|
188857
188948
|
}
|
|
188858
188949
|
if (!isRecord5(message)) {
|
|
188859
188950
|
console.error("Invalid message", { message });
|
|
188860
188951
|
return;
|
|
188861
188952
|
}
|
|
188953
|
+
this.receiveMessage(message);
|
|
188954
|
+
}
|
|
188955
|
+
receiveBatch(batch) {
|
|
188956
|
+
if (batch.length === 0) {
|
|
188957
|
+
this.sendWireMessage({
|
|
188958
|
+
jsonrpc: "2.0",
|
|
188959
|
+
id: null,
|
|
188960
|
+
error: RequestError.invalidRequest(batch).toErrorResponse()
|
|
188961
|
+
}).catch(() => {});
|
|
188962
|
+
return;
|
|
188963
|
+
}
|
|
188964
|
+
const responseBatch = isResponseBatch(batch);
|
|
188965
|
+
const responseCount = responseBatch ? 0 : batch.reduce((count, message) => count + (isNotificationMessage(message) ? 0 : 1), 0);
|
|
188966
|
+
let remaining = responseCount;
|
|
188967
|
+
let remainingNotifications = batch.reduce((count, message) => count + (isNotificationMessage(message) ? 1 : 0), 0);
|
|
188968
|
+
let responseSent = false;
|
|
188969
|
+
const responses = [];
|
|
188970
|
+
const sendResponsesIfReady = async () => {
|
|
188971
|
+
if (responseSent || remaining !== 0 || remainingNotifications !== 0 || responses.length === 0) {
|
|
188972
|
+
return;
|
|
188973
|
+
}
|
|
188974
|
+
responseSent = true;
|
|
188975
|
+
await this.sendWireMessage(responses);
|
|
188976
|
+
};
|
|
188977
|
+
const collectResponse = async (response) => {
|
|
188978
|
+
responses.push(response);
|
|
188979
|
+
remaining -= 1;
|
|
188980
|
+
await sendResponsesIfReady();
|
|
188981
|
+
};
|
|
188982
|
+
for (const message of batch) {
|
|
188983
|
+
if (responseBatch) {
|
|
188984
|
+
if (isResponseShapedMessage(message)) {
|
|
188985
|
+
this.receiveMessage(message);
|
|
188986
|
+
}
|
|
188987
|
+
continue;
|
|
188988
|
+
}
|
|
188989
|
+
if (!isRequestMessage(message) && !isNotificationMessage(message)) {
|
|
188990
|
+
collectResponse({
|
|
188991
|
+
jsonrpc: "2.0",
|
|
188992
|
+
id: null,
|
|
188993
|
+
error: RequestError.invalidRequest(message).toErrorResponse()
|
|
188994
|
+
}).catch(() => {});
|
|
188995
|
+
continue;
|
|
188996
|
+
}
|
|
188997
|
+
const processing = this.receiveMessage(message, isRequestMessage(message) ? collectResponse : undefined);
|
|
188998
|
+
if (isNotificationMessage(message)) {
|
|
188999
|
+
processing.finally(() => {
|
|
189000
|
+
remainingNotifications -= 1;
|
|
189001
|
+
sendResponsesIfReady().catch((error51) => this.close(error51));
|
|
189002
|
+
});
|
|
189003
|
+
}
|
|
189004
|
+
}
|
|
189005
|
+
}
|
|
189006
|
+
receiveMessage(message, sendResponse) {
|
|
189007
|
+
if (this.abortController.signal.aborted) {
|
|
189008
|
+
return Promise.resolve();
|
|
189009
|
+
}
|
|
189010
|
+
if (!isRecord5(message)) {
|
|
189011
|
+
console.error("Invalid message", { message });
|
|
189012
|
+
return Promise.resolve();
|
|
189013
|
+
}
|
|
188862
189014
|
if ("method" in message) {
|
|
188863
189015
|
if (!("id" in message)) {
|
|
188864
189016
|
this.handleProtocolNotification(message);
|
|
188865
189017
|
}
|
|
188866
|
-
this.processIncomingMessage(this.toIncomingMessage(message)).catch((error51) => this.close(error51));
|
|
189018
|
+
return this.processIncomingMessage(this.toIncomingMessage(message, sendResponse)).catch((error51) => this.close(error51));
|
|
188867
189019
|
} else if ("id" in message) {
|
|
188868
189020
|
this.handleResponse(message);
|
|
188869
189021
|
} else {
|
|
188870
189022
|
console.error("Invalid message", { message });
|
|
188871
189023
|
}
|
|
189024
|
+
return Promise.resolve();
|
|
188872
189025
|
}
|
|
188873
189026
|
async processIncomingMessage(message) {
|
|
188874
189027
|
if (this.abortController.signal.aborted) {
|
|
@@ -188912,7 +189065,7 @@ class Connection {
|
|
|
188912
189065
|
}
|
|
188913
189066
|
}
|
|
188914
189067
|
}
|
|
188915
|
-
toIncomingMessage(message) {
|
|
189068
|
+
toIncomingMessage(message, sendResponse) {
|
|
188916
189069
|
if ("id" in message) {
|
|
188917
189070
|
const abortController = new AbortController;
|
|
188918
189071
|
this.incomingRequests.set(message.id, abortController);
|
|
@@ -188927,11 +189080,14 @@ class Connection {
|
|
|
188927
189080
|
params: message.params,
|
|
188928
189081
|
raw: message,
|
|
188929
189082
|
signal: abortController.signal,
|
|
188930
|
-
responder: new RequestResponder(message.id, (result) =>
|
|
188931
|
-
|
|
188932
|
-
|
|
188933
|
-
|
|
188934
|
-
|
|
189083
|
+
responder: new RequestResponder(message.id, (result) => {
|
|
189084
|
+
const response = {
|
|
189085
|
+
jsonrpc: "2.0",
|
|
189086
|
+
id: message.id,
|
|
189087
|
+
...result
|
|
189088
|
+
};
|
|
189089
|
+
return sendResponse ? sendResponse(response) : this.sendWireMessage(response);
|
|
189090
|
+
}, abortController.signal, finishRequest)
|
|
188935
189091
|
};
|
|
188936
189092
|
}
|
|
188937
189093
|
return {
|
|
@@ -188946,13 +189102,13 @@ class Connection {
|
|
|
188946
189102
|
if (pendingResponse) {
|
|
188947
189103
|
this.pendingResponses.delete(response.id);
|
|
188948
189104
|
pendingResponse.cleanup?.();
|
|
188949
|
-
if (
|
|
189105
|
+
if (!isResponseMessage(response)) {
|
|
189106
|
+
pendingResponse.reject(RequestError.invalidRequest(response));
|
|
189107
|
+
} else if ("result" in response) {
|
|
188950
189108
|
pendingResponse.resolve(response.result);
|
|
188951
|
-
} else
|
|
189109
|
+
} else {
|
|
188952
189110
|
const { code, message, data } = response.error;
|
|
188953
189111
|
pendingResponse.reject(new RequestError(code, message, data));
|
|
188954
|
-
} else {
|
|
188955
|
-
pendingResponse.reject(RequestError.invalidRequest(response));
|
|
188956
189112
|
}
|
|
188957
189113
|
} else {
|
|
188958
189114
|
console.error("Got response to unknown request", response.id);
|
|
@@ -188975,7 +189131,7 @@ class Connection {
|
|
|
188975
189131
|
closedReason() {
|
|
188976
189132
|
return this.abortController.signal.reason ?? new Error("ACP connection closed");
|
|
188977
189133
|
}
|
|
188978
|
-
async
|
|
189134
|
+
async sendWireMessage(message) {
|
|
188979
189135
|
if (this.abortController.signal.aborted) {
|
|
188980
189136
|
return rejectedPromise(this.closedReason());
|
|
188981
189137
|
}
|
|
@@ -189158,7 +189314,7 @@ function ndJsonStream(output, input) {
|
|
|
189158
189314
|
if (trimmedLine) {
|
|
189159
189315
|
try {
|
|
189160
189316
|
const message = JSON.parse(trimmedLine);
|
|
189161
|
-
if (isRecord5(message)) {
|
|
189317
|
+
if (isRecord5(message) || Array.isArray(message)) {
|
|
189162
189318
|
controller.enqueue(message);
|
|
189163
189319
|
} else {
|
|
189164
189320
|
console.warn("Skipping JSON line that is not an object:", trimmedLine);
|
|
@@ -189232,7 +189388,28 @@ function ndJsonStream(output, input) {
|
|
|
189232
189388
|
});
|
|
189233
189389
|
return { readable, writable };
|
|
189234
189390
|
}
|
|
189391
|
+
|
|
189392
|
+
// node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js
|
|
189393
|
+
var zGuardCreateElicitationRequestForm = zElicitationFormMode.and(object({ mode: literal("form") })).and(object({ message: string2() }));
|
|
189394
|
+
var zGuardCreateElicitationRequestUrl = zElicitationUrlMode.and(object({ mode: literal("url") })).and(object({ message: string2() }));
|
|
189395
|
+
var zGuardCreateElicitationRequestCustom = union([zElicitationSessionScope, zElicitationRequestScope]).and(object({ message: string2() }));
|
|
189396
|
+
var zGuardElicitationPropertySchemaString = zStringPropertySchema.and(object({ type: literal("string") }));
|
|
189397
|
+
var zGuardElicitationPropertySchemaNumber = zNumberPropertySchema.and(object({ type: literal("number") }));
|
|
189398
|
+
var zGuardElicitationPropertySchemaInteger = zIntegerPropertySchema.and(object({ type: literal("integer") }));
|
|
189399
|
+
var zGuardElicitationPropertySchemaBoolean = zBooleanPropertySchema.and(object({ type: literal("boolean") }));
|
|
189400
|
+
var zGuardElicitationPropertySchemaArray = zMultiSelectPropertySchema.and(object({ type: literal("array") }));
|
|
189401
|
+
var zGuardMultiSelectItemsString = zStringMultiSelectItems.and(object({ type: literal("string") }));
|
|
189402
|
+
var zGuardCreateElicitationResponseAccept = zElicitationAcceptAction.and(object({ action: literal("accept") }));
|
|
189403
|
+
var zGuardCreateElicitationResponseDecline = object({
|
|
189404
|
+
action: literal("decline")
|
|
189405
|
+
});
|
|
189406
|
+
var zGuardCreateElicitationResponseCancel = object({
|
|
189407
|
+
action: literal("cancel")
|
|
189408
|
+
});
|
|
189235
189409
|
// node_modules/@agentclientprotocol/sdk/dist/acp.js
|
|
189410
|
+
function ndJsonStream2(output, input) {
|
|
189411
|
+
return ndJsonStream(output, input);
|
|
189412
|
+
}
|
|
189236
189413
|
function emptyObjectResponse(response) {
|
|
189237
189414
|
return response ?? {};
|
|
189238
189415
|
}
|
|
@@ -189817,6 +189994,7 @@ function runConnectHandlers(connection, handlers) {
|
|
|
189817
189994
|
var appBuilder = Symbol("appBuilder");
|
|
189818
189995
|
var runAgentConnectHandlers = Symbol("runAgentConnectHandlers");
|
|
189819
189996
|
var runClientConnectHandlers = Symbol("runClientConnectHandlers");
|
|
189997
|
+
var stableConnectionOptions = { allowBatches: false };
|
|
189820
189998
|
class AgentApp {
|
|
189821
189999
|
builder = Connection.builder();
|
|
189822
190000
|
connectHandlers = [];
|
|
@@ -189879,7 +190057,7 @@ class AgentApp {
|
|
|
189879
190057
|
return state2;
|
|
189880
190058
|
}
|
|
189881
190059
|
const [thisStream, peerStream] = memoryStreamPair();
|
|
189882
|
-
const peerRawConnection = target[appBuilder]().connect(peerStream);
|
|
190060
|
+
const peerRawConnection = target[appBuilder]().connect(peerStream, stableConnectionOptions);
|
|
189883
190061
|
const peerConnection = clientConnection(peerRawConnection);
|
|
189884
190062
|
const state = this.openStreamConnection(thisStream);
|
|
189885
190063
|
state.rawConnection.closed.then(() => peerConnection.close());
|
|
@@ -189894,8 +190072,8 @@ class AgentApp {
|
|
|
189894
190072
|
}
|
|
189895
190073
|
return state;
|
|
189896
190074
|
}
|
|
189897
|
-
openStreamConnection(
|
|
189898
|
-
const rawConnection = this.builder.connect(
|
|
190075
|
+
openStreamConnection(stream) {
|
|
190076
|
+
const rawConnection = this.builder.connect(stream, stableConnectionOptions);
|
|
189899
190077
|
return {
|
|
189900
190078
|
rawConnection,
|
|
189901
190079
|
connection: agentConnection(rawConnection, this.connectHandlers)
|
|
@@ -189970,7 +190148,7 @@ class ClientApp {
|
|
|
189970
190148
|
return state2;
|
|
189971
190149
|
}
|
|
189972
190150
|
const [thisStream, peerStream] = memoryStreamPair();
|
|
189973
|
-
const peerRawConnection = target[appBuilder]().connect(peerStream);
|
|
190151
|
+
const peerRawConnection = target[appBuilder]().connect(peerStream, stableConnectionOptions);
|
|
189974
190152
|
const peerConnection = agentConnection(peerRawConnection);
|
|
189975
190153
|
const state = this.openStreamConnection(thisStream);
|
|
189976
190154
|
state.rawConnection.closed.then(() => peerConnection.close());
|
|
@@ -189985,8 +190163,8 @@ class ClientApp {
|
|
|
189985
190163
|
}
|
|
189986
190164
|
return state;
|
|
189987
190165
|
}
|
|
189988
|
-
openStreamConnection(
|
|
189989
|
-
const rawConnection = this.builder.connect(
|
|
190166
|
+
openStreamConnection(stream) {
|
|
190167
|
+
const rawConnection = this.builder.connect(stream, stableConnectionOptions);
|
|
189990
190168
|
return {
|
|
189991
190169
|
rawConnection,
|
|
189992
190170
|
connection: clientConnection(rawConnection, this.connectHandlers)
|
|
@@ -191541,7 +191719,7 @@ async function runAcpClientWorkflow(child, input, abortController, configOption,
|
|
|
191541
191719
|
}
|
|
191542
191720
|
const output = Writable.toWeb(child.stdin);
|
|
191543
191721
|
const inputStream = Readable.toWeb(child.stdout);
|
|
191544
|
-
const
|
|
191722
|
+
const stream = ndJsonStream2(output, limitAcpNdJsonLineBytes(inputStream));
|
|
191545
191723
|
const app = client({ name: "kyoso" }).onRequest(methods.client.session.requestPermission, () => ({
|
|
191546
191724
|
outcome: { outcome: "cancelled" }
|
|
191547
191725
|
})).onRequest(methods.client.fs.readTextFile, async (ctx) => ({
|
|
@@ -191563,7 +191741,7 @@ async function runAcpClientWorkflow(child, input, abortController, configOption,
|
|
|
191563
191741
|
policy: "Kyoso does not create terminals."
|
|
191564
191742
|
});
|
|
191565
191743
|
}).onRequest(methods.client.terminal.kill, () => ({}));
|
|
191566
|
-
return app.connectWith(
|
|
191744
|
+
return app.connectWith(stream, async (ctx) => {
|
|
191567
191745
|
await ctx.request(methods.agent.initialize, {
|
|
191568
191746
|
protocolVersion: PROTOCOL_VERSION,
|
|
191569
191747
|
clientCapabilities: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyo-so/cli",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "Kyo-so: MCP-native, ACP-powered multi-agent review gates for AI coding workflows.",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"repository": {
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"prepack": "bun run build"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@agentclientprotocol/sdk": "1.
|
|
64
|
-
"@modelcontextprotocol/server": "2.0.0-beta.
|
|
63
|
+
"@agentclientprotocol/sdk": "1.3.0",
|
|
64
|
+
"@modelcontextprotocol/server": "2.0.0-beta.5",
|
|
65
65
|
"smol-toml": "1.7.0",
|
|
66
66
|
"typescript": "6.0.3",
|
|
67
67
|
"zod": "4.4.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/bun": "1.3.14",
|
|
71
|
-
"prettier": "3.9.
|
|
71
|
+
"prettier": "3.9.6"
|
|
72
72
|
}
|
|
73
73
|
}
|