@google/gemini-cli-a2a-server 0.65.0-preview.0 → 0.66.0-nightly.20261016.gdebf42324
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/a2a-server.mjs +196 -58
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -45922,7 +45922,7 @@ var require_src5 = __commonJS({
|
|
|
45922
45922
|
var jws = require_jws();
|
|
45923
45923
|
var path103 = __require("path");
|
|
45924
45924
|
var util_1 = __require("util");
|
|
45925
|
-
var
|
|
45925
|
+
var readFile11 = fs90.readFile ? (0, util_1.promisify)(fs90.readFile) : async () => {
|
|
45926
45926
|
throw new ErrorWithCode("use key rather than keyFile.", "MISSING_CREDENTIALS");
|
|
45927
45927
|
};
|
|
45928
45928
|
var GOOGLE_TOKEN_URL = "https://www.googleapis.com/oauth2/v4/token";
|
|
@@ -46011,7 +46011,7 @@ var require_src5 = __commonJS({
|
|
|
46011
46011
|
const ext2 = path103.extname(keyFile);
|
|
46012
46012
|
switch (ext2) {
|
|
46013
46013
|
case ".json": {
|
|
46014
|
-
const key = await
|
|
46014
|
+
const key = await readFile11(keyFile, "utf8");
|
|
46015
46015
|
const body2 = JSON.parse(key);
|
|
46016
46016
|
const privateKey = body2.private_key;
|
|
46017
46017
|
const clientEmail = body2.client_email;
|
|
@@ -46023,7 +46023,7 @@ var require_src5 = __commonJS({
|
|
|
46023
46023
|
case ".der":
|
|
46024
46024
|
case ".crt":
|
|
46025
46025
|
case ".pem": {
|
|
46026
|
-
const privateKey = await
|
|
46026
|
+
const privateKey = await readFile11(keyFile, "utf8");
|
|
46027
46027
|
return { privateKey };
|
|
46028
46028
|
}
|
|
46029
46029
|
case ".p12":
|
|
@@ -47480,7 +47480,7 @@ var require_filesubjecttokensupplier = __commonJS({
|
|
|
47480
47480
|
exports2.FileSubjectTokenSupplier = void 0;
|
|
47481
47481
|
var util_1 = __require("util");
|
|
47482
47482
|
var fs90 = __require("fs");
|
|
47483
|
-
var
|
|
47483
|
+
var readFile11 = (0, util_1.promisify)((_a4 = fs90.readFile) !== null && _a4 !== void 0 ? _a4 : () => {
|
|
47484
47484
|
});
|
|
47485
47485
|
var realpath2 = (0, util_1.promisify)((_b = fs90.realpath) !== null && _b !== void 0 ? _b : () => {
|
|
47486
47486
|
});
|
|
@@ -47517,7 +47517,7 @@ var require_filesubjecttokensupplier = __commonJS({
|
|
|
47517
47517
|
throw err2;
|
|
47518
47518
|
}
|
|
47519
47519
|
let subjectToken;
|
|
47520
|
-
const rawText = await
|
|
47520
|
+
const rawText = await readFile11(parsedFilePath, { encoding: "utf8" });
|
|
47521
47521
|
if (this.formatType === "text") {
|
|
47522
47522
|
subjectToken = rawText;
|
|
47523
47523
|
} else if (this.formatType === "json" && this.subjectTokenFieldName) {
|
|
@@ -53087,8 +53087,8 @@ var require_graceful_fs = __commonJS({
|
|
|
53087
53087
|
fs91.createReadStream = createReadStream6;
|
|
53088
53088
|
fs91.createWriteStream = createWriteStream5;
|
|
53089
53089
|
var fs$readFile = fs91.readFile;
|
|
53090
|
-
fs91.readFile =
|
|
53091
|
-
function
|
|
53090
|
+
fs91.readFile = readFile11;
|
|
53091
|
+
function readFile11(path103, options, cb) {
|
|
53092
53092
|
if (typeof options === "function")
|
|
53093
53093
|
cb = options, options = null;
|
|
53094
53094
|
return go$readFile(path103, options, cb);
|
|
@@ -54456,7 +54456,7 @@ var require_jsonfile = __commonJS({
|
|
|
54456
54456
|
}
|
|
54457
54457
|
return obj;
|
|
54458
54458
|
}
|
|
54459
|
-
var
|
|
54459
|
+
var readFile11 = universalify.fromPromise(_readFile);
|
|
54460
54460
|
function readFileSync11(file, options = {}) {
|
|
54461
54461
|
if (typeof options === "string") {
|
|
54462
54462
|
options = { encoding: options };
|
|
@@ -54488,7 +54488,7 @@ var require_jsonfile = __commonJS({
|
|
|
54488
54488
|
return fs90.writeFileSync(file, str2, options);
|
|
54489
54489
|
}
|
|
54490
54490
|
module2.exports = {
|
|
54491
|
-
readFile:
|
|
54491
|
+
readFile: readFile11,
|
|
54492
54492
|
readFileSync: readFileSync11,
|
|
54493
54493
|
writeFile: writeFile9,
|
|
54494
54494
|
writeFileSync: writeFileSync8
|
|
@@ -84204,7 +84204,7 @@ var require_src14 = __commonJS({
|
|
|
84204
84204
|
});
|
|
84205
84205
|
};
|
|
84206
84206
|
}
|
|
84207
|
-
var
|
|
84207
|
+
var readFile11 = fs90.readFile ? (0, _util.promisify)(fs90.readFile) : /* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function _callee() {
|
|
84208
84208
|
return _regenerator().w(function(_context) {
|
|
84209
84209
|
while (1) switch (_context.n) {
|
|
84210
84210
|
case 0:
|
|
@@ -84344,7 +84344,7 @@ var require_src14 = __commonJS({
|
|
|
84344
84344
|
break;
|
|
84345
84345
|
case 1:
|
|
84346
84346
|
_context2.n = 2;
|
|
84347
|
-
return
|
|
84347
|
+
return readFile11(keyFile, "utf8");
|
|
84348
84348
|
case 2:
|
|
84349
84349
|
key = _context2.v;
|
|
84350
84350
|
body2 = JSON.parse(key);
|
|
@@ -84362,7 +84362,7 @@ var require_src14 = __commonJS({
|
|
|
84362
84362
|
});
|
|
84363
84363
|
case 4:
|
|
84364
84364
|
_context2.n = 5;
|
|
84365
|
-
return
|
|
84365
|
+
return readFile11(keyFile, "utf8");
|
|
84366
84366
|
case 5:
|
|
84367
84367
|
_privateKey = _context2.v;
|
|
84368
84368
|
return _context2.a(2, {
|
|
@@ -85959,7 +85959,7 @@ var require_filesubjecttokensupplier2 = __commonJS({
|
|
|
85959
85959
|
exports2.FileSubjectTokenSupplier = void 0;
|
|
85960
85960
|
var util_1 = __require("util");
|
|
85961
85961
|
var fs90 = __require("fs");
|
|
85962
|
-
var
|
|
85962
|
+
var readFile11 = (0, util_1.promisify)(fs90.readFile ?? (() => {
|
|
85963
85963
|
}));
|
|
85964
85964
|
var realpath2 = (0, util_1.promisify)(fs90.realpath ?? (() => {
|
|
85965
85965
|
}));
|
|
@@ -85999,7 +85999,7 @@ var require_filesubjecttokensupplier2 = __commonJS({
|
|
|
85999
85999
|
throw err2;
|
|
86000
86000
|
}
|
|
86001
86001
|
let subjectToken;
|
|
86002
|
-
const rawText = await
|
|
86002
|
+
const rawText = await readFile11(parsedFilePath, { encoding: "utf8" });
|
|
86003
86003
|
if (this.formatType === "text") {
|
|
86004
86004
|
subjectToken = rawText;
|
|
86005
86005
|
} else if (this.formatType === "json" && this.subjectTokenFieldName) {
|
|
@@ -112182,7 +112182,7 @@ var require_getCredentials = __commonJS({
|
|
|
112182
112182
|
var fs90 = __require("fs");
|
|
112183
112183
|
var util_1 = __require("util");
|
|
112184
112184
|
var errorWithCode_1 = require_errorWithCode();
|
|
112185
|
-
var
|
|
112185
|
+
var readFile11 = fs90.readFile ? (0, util_1.promisify)(fs90.readFile) : async () => {
|
|
112186
112186
|
throw new errorWithCode_1.ErrorWithCode("use key rather than keyFile.", "MISSING_CREDENTIALS");
|
|
112187
112187
|
};
|
|
112188
112188
|
var ExtensionFiles;
|
|
@@ -112204,7 +112204,7 @@ var require_getCredentials = __commonJS({
|
|
|
112204
112204
|
* @returns A promise that resolves with the credentials.
|
|
112205
112205
|
*/
|
|
112206
112206
|
async getCredentials() {
|
|
112207
|
-
const key = await
|
|
112207
|
+
const key = await readFile11(this.keyFilePath, "utf8");
|
|
112208
112208
|
let body2;
|
|
112209
112209
|
try {
|
|
112210
112210
|
body2 = JSON.parse(key);
|
|
@@ -112230,7 +112230,7 @@ var require_getCredentials = __commonJS({
|
|
|
112230
112230
|
* @returns A promise that resolves with the private key.
|
|
112231
112231
|
*/
|
|
112232
112232
|
async getCredentials() {
|
|
112233
|
-
const privateKey = await
|
|
112233
|
+
const privateKey = await readFile11(this.keyFilePath, "utf8");
|
|
112234
112234
|
return { privateKey };
|
|
112235
112235
|
}
|
|
112236
112236
|
};
|
|
@@ -113860,7 +113860,7 @@ var require_filesubjecttokensupplier3 = __commonJS({
|
|
|
113860
113860
|
exports2.FileSubjectTokenSupplier = void 0;
|
|
113861
113861
|
var util_1 = __require("util");
|
|
113862
113862
|
var fs90 = __require("fs");
|
|
113863
|
-
var
|
|
113863
|
+
var readFile11 = (0, util_1.promisify)(fs90.readFile ?? (() => {
|
|
113864
113864
|
}));
|
|
113865
113865
|
var realpath2 = (0, util_1.promisify)(fs90.realpath ?? (() => {
|
|
113866
113866
|
}));
|
|
@@ -113900,7 +113900,7 @@ var require_filesubjecttokensupplier3 = __commonJS({
|
|
|
113900
113900
|
throw err2;
|
|
113901
113901
|
}
|
|
113902
113902
|
let subjectToken;
|
|
113903
|
-
const rawText = await
|
|
113903
|
+
const rawText = await readFile11(parsedFilePath, { encoding: "utf8" });
|
|
113904
113904
|
if (this.formatType === "text") {
|
|
113905
113905
|
subjectToken = rawText;
|
|
113906
113906
|
} else if (this.formatType === "json" && this.subjectTokenFieldName) {
|
|
@@ -139667,6 +139667,25 @@ var init_token_storage = __esm({
|
|
|
139667
139667
|
}
|
|
139668
139668
|
});
|
|
139669
139669
|
|
|
139670
|
+
// packages/core/dist/src/utils/compatibility.js
|
|
139671
|
+
function isTmux() {
|
|
139672
|
+
return !!process.env["TMUX"];
|
|
139673
|
+
}
|
|
139674
|
+
function isDumbTerminal() {
|
|
139675
|
+
const term = process.env["TERM"] || "";
|
|
139676
|
+
return term === "dumb" || term === "vt100";
|
|
139677
|
+
}
|
|
139678
|
+
var WarningPriority;
|
|
139679
|
+
var init_compatibility = __esm({
|
|
139680
|
+
"packages/core/dist/src/utils/compatibility.js"() {
|
|
139681
|
+
"use strict";
|
|
139682
|
+
(function(WarningPriority2) {
|
|
139683
|
+
WarningPriority2["Low"] = "low";
|
|
139684
|
+
WarningPriority2["High"] = "high";
|
|
139685
|
+
})(WarningPriority || (WarningPriority = {}));
|
|
139686
|
+
}
|
|
139687
|
+
});
|
|
139688
|
+
|
|
139670
139689
|
// packages/core/dist/src/utils/stdio.js
|
|
139671
139690
|
function writeToStdout(...args2) {
|
|
139672
139691
|
return originalStdoutWrite(...args2);
|
|
@@ -139677,7 +139696,28 @@ function writeToStderr(...args2) {
|
|
|
139677
139696
|
function isKey(key, obj) {
|
|
139678
139697
|
return key in obj;
|
|
139679
139698
|
}
|
|
139680
|
-
function
|
|
139699
|
+
function wrapWithSynchronizedOutput(chunk) {
|
|
139700
|
+
if (!chunk || STANDALONE_MODE_SEQUENCES.has(chunk) || chunk.startsWith("\x1B]") && (chunk.endsWith("\x07") || chunk.endsWith("\x1B\\"))) {
|
|
139701
|
+
return chunk;
|
|
139702
|
+
}
|
|
139703
|
+
if (isDumbTerminal()) {
|
|
139704
|
+
return chunk;
|
|
139705
|
+
}
|
|
139706
|
+
const inTmux = isTmux();
|
|
139707
|
+
const syncStart = inTmux ? TMUX_ENTER_SYNCHRONIZED_OUTPUT_SEQ : ENTER_SYNCHRONIZED_OUTPUT_SEQ;
|
|
139708
|
+
const syncEnd = inTmux ? TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ : EXIT_SYNCHRONIZED_OUTPUT_SEQ;
|
|
139709
|
+
if (chunk.startsWith(syncStart) && chunk.endsWith(syncEnd)) {
|
|
139710
|
+
return chunk;
|
|
139711
|
+
}
|
|
139712
|
+
let inner = chunk;
|
|
139713
|
+
if (inner.startsWith(ENTER_SYNCHRONIZED_OUTPUT_SEQ) && inner.endsWith(EXIT_SYNCHRONIZED_OUTPUT_SEQ)) {
|
|
139714
|
+
inner = inner.slice(ENTER_SYNCHRONIZED_OUTPUT_SEQ.length, -EXIT_SYNCHRONIZED_OUTPUT_SEQ.length);
|
|
139715
|
+
} else if (inner.startsWith(TMUX_ENTER_SYNCHRONIZED_OUTPUT_SEQ) && inner.endsWith(TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ)) {
|
|
139716
|
+
inner = inner.slice(TMUX_ENTER_SYNCHRONIZED_OUTPUT_SEQ.length, -TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ.length);
|
|
139717
|
+
}
|
|
139718
|
+
return `${syncStart}${inner}${syncEnd}`;
|
|
139719
|
+
}
|
|
139720
|
+
function createWorkingStdio(options) {
|
|
139681
139721
|
let cursorShownForIme = false;
|
|
139682
139722
|
const workingStdoutWrite = (...args2) => {
|
|
139683
139723
|
const [chunk] = args2;
|
|
@@ -139692,12 +139732,18 @@ function createWorkingStdio() {
|
|
|
139692
139732
|
} else if (cursorShownForIme) {
|
|
139693
139733
|
if (chunk.endsWith(EXIT_SYNCHRONIZED_OUTPUT_SEQ)) {
|
|
139694
139734
|
args2[0] = `${chunk.slice(0, -EXIT_SYNCHRONIZED_OUTPUT_SEQ.length)}${HIDE_CURSOR_SEQ}${EXIT_SYNCHRONIZED_OUTPUT_SEQ}`;
|
|
139735
|
+
} else if (chunk.endsWith(TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ)) {
|
|
139736
|
+
args2[0] = `${chunk.slice(0, -TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ.length)}${HIDE_CURSOR_SEQ}${TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ}`;
|
|
139695
139737
|
} else {
|
|
139696
139738
|
args2[0] = `${chunk}${HIDE_CURSOR_SEQ}`;
|
|
139697
139739
|
}
|
|
139698
139740
|
cursorShownForIme = false;
|
|
139699
139741
|
}
|
|
139700
139742
|
}
|
|
139743
|
+
const currentChunk = args2[0];
|
|
139744
|
+
if (options?.synchronizedOutput && typeof currentChunk === "string") {
|
|
139745
|
+
args2[0] = wrapWithSynchronizedOutput(currentChunk);
|
|
139746
|
+
}
|
|
139701
139747
|
return writeToStdout(...args2);
|
|
139702
139748
|
};
|
|
139703
139749
|
const stdoutHandler = {
|
|
@@ -139734,18 +139780,32 @@ function createWorkingStdio() {
|
|
|
139734
139780
|
const inkStderr = new Proxy(process.stderr, stderrHandler);
|
|
139735
139781
|
return { stdout: inkStdout, stderr: inkStderr };
|
|
139736
139782
|
}
|
|
139737
|
-
var originalStdoutWrite, originalStderrWrite, INK_CURSOR_POSITION_END_REGEX, SHOW_CURSOR_SEQ, HIDE_CURSOR_SEQ, EXIT_SYNCHRONIZED_OUTPUT_SEQ;
|
|
139783
|
+
var originalStdoutWrite, originalStderrWrite, INK_CURSOR_POSITION_END_REGEX, SHOW_CURSOR_SEQ, HIDE_CURSOR_SEQ, ENTER_SYNCHRONIZED_OUTPUT_SEQ, EXIT_SYNCHRONIZED_OUTPUT_SEQ, TMUX_ENTER_SYNCHRONIZED_OUTPUT_SEQ, TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ, STANDALONE_MODE_SEQUENCES;
|
|
139738
139784
|
var init_stdio = __esm({
|
|
139739
139785
|
"packages/core/dist/src/utils/stdio.js"() {
|
|
139740
139786
|
"use strict";
|
|
139741
139787
|
init_events();
|
|
139788
|
+
init_compatibility();
|
|
139742
139789
|
originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
139743
139790
|
originalStderrWrite = process.stderr.write.bind(process.stderr);
|
|
139744
139791
|
INK_CURSOR_POSITION_END_REGEX = // eslint-disable-next-line no-control-regex
|
|
139745
|
-
/\x1b\[(?:\d+G|\d+;\d+H|D)(\x1b\[\?2026l)?$/;
|
|
139792
|
+
/\x1b\[(?:\d+G|\d+;\d+H|D)(\x1b\[\?2026l|\x1bP=2s\x1b\\)?$/;
|
|
139746
139793
|
SHOW_CURSOR_SEQ = "\x1B[?25h";
|
|
139747
139794
|
HIDE_CURSOR_SEQ = "\x1B[?25l";
|
|
139795
|
+
ENTER_SYNCHRONIZED_OUTPUT_SEQ = "\x1B[?2026h";
|
|
139748
139796
|
EXIT_SYNCHRONIZED_OUTPUT_SEQ = "\x1B[?2026l";
|
|
139797
|
+
TMUX_ENTER_SYNCHRONIZED_OUTPUT_SEQ = "\x1BP=1s\x1B\\";
|
|
139798
|
+
TMUX_EXIT_SYNCHRONIZED_OUTPUT_SEQ = "\x1BP=2s\x1B\\";
|
|
139799
|
+
STANDALONE_MODE_SEQUENCES = /* @__PURE__ */ new Set([
|
|
139800
|
+
SHOW_CURSOR_SEQ,
|
|
139801
|
+
HIDE_CURSOR_SEQ,
|
|
139802
|
+
"\x1B[?7l",
|
|
139803
|
+
"\x1B[?7h",
|
|
139804
|
+
"\x1B[?1004h",
|
|
139805
|
+
"\x1B[?1004l",
|
|
139806
|
+
"\x1B[?1049h",
|
|
139807
|
+
"\x1B[?1049l"
|
|
139808
|
+
]);
|
|
139749
139809
|
}
|
|
139750
139810
|
});
|
|
139751
139811
|
|
|
@@ -221368,8 +221428,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
221368
221428
|
var init_git_commit = __esm({
|
|
221369
221429
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
221370
221430
|
"use strict";
|
|
221371
|
-
GIT_COMMIT_INFO = "
|
|
221372
|
-
CLI_VERSION = "0.
|
|
221431
|
+
GIT_COMMIT_INFO = "debf42324";
|
|
221432
|
+
CLI_VERSION = "0.66.0-nightly.20261016.gdebf42324";
|
|
221373
221433
|
}
|
|
221374
221434
|
});
|
|
221375
221435
|
|
|
@@ -228065,7 +228125,7 @@ var require_discovery = __commonJS({
|
|
|
228065
228125
|
var util5 = __require("util");
|
|
228066
228126
|
var apirequest_1 = require_apirequest();
|
|
228067
228127
|
var endpoint_1 = require_endpoint();
|
|
228068
|
-
var
|
|
228128
|
+
var readFile11 = util5.promisify(fs90.readFile);
|
|
228069
228129
|
var Discovery = class {
|
|
228070
228130
|
/**
|
|
228071
228131
|
* Discovery for discovering API endpoints
|
|
@@ -228152,7 +228212,7 @@ var require_discovery = __commonJS({
|
|
|
228152
228212
|
const parts2 = resolve23.parse(apiDiscoveryUrl);
|
|
228153
228213
|
if (apiDiscoveryUrl && !parts2.protocol) {
|
|
228154
228214
|
this.log("Reading from file " + apiDiscoveryUrl);
|
|
228155
|
-
const file = await
|
|
228215
|
+
const file = await readFile11(apiDiscoveryUrl, { encoding: "utf8" });
|
|
228156
228216
|
return this.makeEndpoint(JSON.parse(file));
|
|
228157
228217
|
} else {
|
|
228158
228218
|
this.log("Requesting " + apiDiscoveryUrl);
|
|
@@ -249128,7 +249188,7 @@ var require_metadata5 = __commonJS({
|
|
|
249128
249188
|
var gcpMetadata = require_src4();
|
|
249129
249189
|
var google_auth_library_1 = require_src6();
|
|
249130
249190
|
var util_1 = __require("util");
|
|
249131
|
-
var
|
|
249191
|
+
var readFile11 = (0, util_1.promisify)(fs90.readFile);
|
|
249132
249192
|
function zoneFromQualifiedZone(qualified) {
|
|
249133
249193
|
return qualified.split("/").pop();
|
|
249134
249194
|
}
|
|
@@ -249197,7 +249257,7 @@ var require_metadata5 = __commonJS({
|
|
|
249197
249257
|
const location = zoneFromQualifiedZone(qualifiedZone);
|
|
249198
249258
|
let namespace = "";
|
|
249199
249259
|
try {
|
|
249200
|
-
namespace = await
|
|
249260
|
+
namespace = await readFile11(exports2.KUBERNETES_NAMESPACE_ID_PATH, "utf8");
|
|
249201
249261
|
} catch (err2) {
|
|
249202
249262
|
}
|
|
249203
249263
|
return {
|
|
@@ -297242,6 +297302,31 @@ function getDiffCommand(oldPath, newPath, editor) {
|
|
|
297242
297302
|
return null;
|
|
297243
297303
|
}
|
|
297244
297304
|
}
|
|
297305
|
+
function quoteCmdArg(arg) {
|
|
297306
|
+
if (/[\r\n\0]/.test(arg)) {
|
|
297307
|
+
throw new Error("Invalid argument: newlines are not allowed");
|
|
297308
|
+
}
|
|
297309
|
+
if (arg.includes('"')) {
|
|
297310
|
+
throw new Error("Invalid argument: double quotes are not allowed on Windows");
|
|
297311
|
+
}
|
|
297312
|
+
if (!arg) {
|
|
297313
|
+
return '""';
|
|
297314
|
+
}
|
|
297315
|
+
if (/^[a-zA-Z0-9\-_.:/\\]+$/.test(arg)) {
|
|
297316
|
+
return arg;
|
|
297317
|
+
}
|
|
297318
|
+
let result2 = '"' + arg;
|
|
297319
|
+
let backslashCount = 0;
|
|
297320
|
+
for (let i3 = arg.length - 1; i3 >= 0; i3--) {
|
|
297321
|
+
if (arg[i3] === "\\") {
|
|
297322
|
+
backslashCount++;
|
|
297323
|
+
} else {
|
|
297324
|
+
break;
|
|
297325
|
+
}
|
|
297326
|
+
}
|
|
297327
|
+
result2 += "\\".repeat(backslashCount) + '"';
|
|
297328
|
+
return result2;
|
|
297329
|
+
}
|
|
297245
297330
|
async function openDiff(oldPath, newPath, editor) {
|
|
297246
297331
|
if (isHeadlessMode()) {
|
|
297247
297332
|
debugLogger.warn("External editor spawning is disabled in headless/server mode.");
|
|
@@ -297272,10 +297357,19 @@ async function openDiff(oldPath, newPath, editor) {
|
|
|
297272
297357
|
return;
|
|
297273
297358
|
}
|
|
297274
297359
|
return new Promise((resolve23, reject) => {
|
|
297275
|
-
const
|
|
297276
|
-
|
|
297277
|
-
|
|
297278
|
-
|
|
297360
|
+
const isWindows2 = process.platform === "win32";
|
|
297361
|
+
let childProcess2;
|
|
297362
|
+
try {
|
|
297363
|
+
const spawnArgs = isWindows2 ? diffCommand.args.map(quoteCmdArg) : diffCommand.args;
|
|
297364
|
+
childProcess2 = spawn2(diffCommand.command, spawnArgs, {
|
|
297365
|
+
stdio: "inherit",
|
|
297366
|
+
shell: isWindows2
|
|
297367
|
+
});
|
|
297368
|
+
} catch (error2) {
|
|
297369
|
+
coreEvents.emit(CoreEvent.ExternalEditorClosed);
|
|
297370
|
+
reject(error2);
|
|
297371
|
+
return;
|
|
297372
|
+
}
|
|
297279
297373
|
let isSettled = false;
|
|
297280
297374
|
childProcess2.on("close", (code) => {
|
|
297281
297375
|
if (isSettled)
|
|
@@ -337673,7 +337767,7 @@ function getVersion() {
|
|
|
337673
337767
|
}
|
|
337674
337768
|
versionPromise = (async () => {
|
|
337675
337769
|
const pkgJson = await getPackageJson(__dirname4);
|
|
337676
|
-
return "0.
|
|
337770
|
+
return "0.66.0-nightly.20261016.gdebf42324";
|
|
337677
337771
|
})();
|
|
337678
337772
|
return versionPromise;
|
|
337679
337773
|
}
|
|
@@ -345467,9 +345561,33 @@ function getSafeGitEnv(baseEnv = process.env) {
|
|
|
345467
345561
|
cleanedEnv[key] = value;
|
|
345468
345562
|
}
|
|
345469
345563
|
}
|
|
345564
|
+
let baseSshCommand = cleanedEnv["GIT_SSH_COMMAND"];
|
|
345565
|
+
if (!baseSshCommand && cleanedEnv["GIT_SSH"]) {
|
|
345566
|
+
const gitSsh = cleanedEnv["GIT_SSH"];
|
|
345567
|
+
baseSshCommand = gitSsh.includes(" ") && !gitSsh.startsWith('"') && !gitSsh.startsWith("'") ? '"' + gitSsh + '"' : gitSsh;
|
|
345568
|
+
}
|
|
345569
|
+
if (!baseSshCommand) {
|
|
345570
|
+
baseSshCommand = "ssh";
|
|
345571
|
+
}
|
|
345572
|
+
const execMatch = baseSshCommand.match(/^\s*(?:"([^"]+)"|'([^']+)'|(\S+))/);
|
|
345573
|
+
const executable = execMatch ? execMatch[1] || execMatch[2] || execMatch[3] || "" : "";
|
|
345574
|
+
const execName = executable.split(/[/\\]/).pop() || "";
|
|
345575
|
+
const isPlink = /^(?:tortoise)?plink(?:\.exe)?$/i.test(execName);
|
|
345576
|
+
const batchFlag = isPlink ? "-batch" : "-o BatchMode=yes";
|
|
345577
|
+
const hasBatchFlag = isPlink ? /(?:^|\s)-batch(?:\s|$)/.test(baseSshCommand) : /\bbatchmode\s*=\s*yes\b/i.test(baseSshCommand) && !/\bbatchmode\s*=\s*no\b/i.test(baseSshCommand);
|
|
345578
|
+
let gitSshCommand = baseSshCommand;
|
|
345579
|
+
if (!hasBatchFlag && execMatch) {
|
|
345580
|
+
const execLength = execMatch[0].length;
|
|
345581
|
+
gitSshCommand = baseSshCommand.slice(0, execLength) + " " + batchFlag + baseSshCommand.slice(execLength);
|
|
345582
|
+
}
|
|
345470
345583
|
return {
|
|
345471
345584
|
...cleanedEnv,
|
|
345472
345585
|
GIT_TERMINAL_PROMPT: "0",
|
|
345586
|
+
GIT_ASKPASS: "",
|
|
345587
|
+
SSH_ASKPASS: "",
|
|
345588
|
+
GIT_SSH_COMMAND: gitSshCommand,
|
|
345589
|
+
GH_PROMPT_DISABLED: "1",
|
|
345590
|
+
GCM_INTERACTIVE: "never",
|
|
345473
345591
|
GIT_CONFIG_GLOBAL: devNullPath,
|
|
345474
345592
|
GIT_CONFIG_SYSTEM: devNullPath,
|
|
345475
345593
|
GIT_CONFIG_NOSYSTEM: "1",
|
|
@@ -375740,30 +375858,44 @@ function parseFrontmatter(content) {
|
|
|
375740
375858
|
}
|
|
375741
375859
|
return parseSimpleFrontmatter(content);
|
|
375742
375860
|
}
|
|
375861
|
+
function stripOuterQuotes(value) {
|
|
375862
|
+
if (value.length >= 2 && (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'"))) {
|
|
375863
|
+
return value.slice(1, -1);
|
|
375864
|
+
}
|
|
375865
|
+
return value;
|
|
375866
|
+
}
|
|
375743
375867
|
function parseSimpleFrontmatter(content) {
|
|
375744
375868
|
const lines = content.split(/\r?\n/);
|
|
375745
375869
|
let name3;
|
|
375746
375870
|
let description;
|
|
375747
375871
|
for (let i3 = 0; i3 < lines.length; i3++) {
|
|
375748
375872
|
const line = lines[i3];
|
|
375749
|
-
const
|
|
375750
|
-
if (
|
|
375751
|
-
name3 =
|
|
375873
|
+
const namePrefixMatch = line.match(/^[ \t]*name[ \t]*:/i);
|
|
375874
|
+
if (namePrefixMatch) {
|
|
375875
|
+
name3 = stripOuterQuotes(line.slice(namePrefixMatch[0].length).trim());
|
|
375752
375876
|
continue;
|
|
375753
375877
|
}
|
|
375754
|
-
const
|
|
375755
|
-
if (
|
|
375756
|
-
const
|
|
375878
|
+
const descPrefixMatch = line.match(/^([ \t]*)description[ \t]*:/i);
|
|
375879
|
+
if (descPrefixMatch) {
|
|
375880
|
+
const descIndent = descPrefixMatch[1].length;
|
|
375881
|
+
const firstLine = line.slice(descPrefixMatch[0].length).trim();
|
|
375882
|
+
const descLines = /^[>|][-+]?$/.test(firstLine) ? [] : [firstLine];
|
|
375757
375883
|
while (i3 + 1 < lines.length) {
|
|
375758
375884
|
const nextLine = lines[i3 + 1];
|
|
375759
|
-
|
|
375885
|
+
const nextIndentMatch = nextLine.match(/^[ \t]*/);
|
|
375886
|
+
const nextIndent = nextIndentMatch ? nextIndentMatch[0].length : 0;
|
|
375887
|
+
const isNonEmpty = nextIndent < nextLine.length;
|
|
375888
|
+
const isKnownKey = /^[ \t]*(?:name|description)[ \t]*:/i.test(nextLine);
|
|
375889
|
+
const isComment2 = /^[ \t]*#/.test(nextLine);
|
|
375890
|
+
const isOtherKeyAtOrAboveDescIndent = nextIndent <= descIndent && /^[ \t]*[a-zA-Z0-9_-]+[ \t]*:/.test(nextLine);
|
|
375891
|
+
if (isNonEmpty && !isKnownKey && !isComment2 && !isOtherKeyAtOrAboveDescIndent) {
|
|
375760
375892
|
descLines.push(nextLine.trim());
|
|
375761
375893
|
i3++;
|
|
375762
375894
|
} else {
|
|
375763
375895
|
break;
|
|
375764
375896
|
}
|
|
375765
375897
|
}
|
|
375766
|
-
description = descLines.filter(Boolean).join(" ");
|
|
375898
|
+
description = stripOuterQuotes(descLines.filter(Boolean).join(" "));
|
|
375767
375899
|
continue;
|
|
375768
375900
|
}
|
|
375769
375901
|
}
|
|
@@ -375806,7 +375938,7 @@ async function loadSkillsFromDir(dir) {
|
|
|
375806
375938
|
}
|
|
375807
375939
|
async function loadSkillFromFile(filePath) {
|
|
375808
375940
|
try {
|
|
375809
|
-
const content = await
|
|
375941
|
+
const content = await readFileWithEncoding(filePath);
|
|
375810
375942
|
const match2 = content.match(FRONTMATTER_REGEX);
|
|
375811
375943
|
if (!match2) {
|
|
375812
375944
|
return null;
|
|
@@ -375835,7 +375967,8 @@ var init_skillLoader = __esm({
|
|
|
375835
375967
|
init_js_yaml();
|
|
375836
375968
|
init_debugLogger();
|
|
375837
375969
|
init_events();
|
|
375838
|
-
|
|
375970
|
+
init_fileUtils();
|
|
375971
|
+
FRONTMATTER_REGEX = /^\uFEFF?---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n([\s\S]*))?$/;
|
|
375839
375972
|
}
|
|
375840
375973
|
});
|
|
375841
375974
|
|
|
@@ -389422,6 +389555,20 @@ var init_tool_modifier = __esm({
|
|
|
389422
389555
|
function isTaintRiskDetectable(invocation) {
|
|
389423
389556
|
return typeof invocation === "object" && invocation !== null && "hasTaintedOrBuildFileRisk" in invocation && typeof invocation.hasTaintedOrBuildFileRisk === "function";
|
|
389424
389557
|
}
|
|
389558
|
+
function getToolCallGroupIds(requests, isGroupable) {
|
|
389559
|
+
const groupable = requests.map(isGroupable);
|
|
389560
|
+
const groupIds = requests.map(() => void 0);
|
|
389561
|
+
let runStart = 0;
|
|
389562
|
+
for (let i3 = 0; i3 <= requests.length; i3++) {
|
|
389563
|
+
if (i3 < requests.length && groupable[i3])
|
|
389564
|
+
continue;
|
|
389565
|
+
if (i3 - runStart >= 2) {
|
|
389566
|
+
groupIds.fill(requests[runStart].callId, runStart, i3);
|
|
389567
|
+
}
|
|
389568
|
+
runStart = i3 + 1;
|
|
389569
|
+
}
|
|
389570
|
+
return groupIds;
|
|
389571
|
+
}
|
|
389425
389572
|
var createErrorResponse, Scheduler;
|
|
389426
389573
|
var init_scheduler = __esm({
|
|
389427
389574
|
"packages/core/dist/src/scheduler/scheduler.js"() {
|
|
@@ -389613,11 +389760,13 @@ var init_scheduler = __esm({
|
|
|
389613
389760
|
});
|
|
389614
389761
|
try {
|
|
389615
389762
|
const toolRegistry = this.context.toolRegistry;
|
|
389616
|
-
const
|
|
389763
|
+
const groupIds = getToolCallGroupIds(sortedRequests, (request) => toolRegistry.getTool(request.name)?.kind === Kind.Agent);
|
|
389764
|
+
const newCalls = sortedRequests.map((request, index) => {
|
|
389617
389765
|
const enrichedRequest = {
|
|
389618
389766
|
...request,
|
|
389619
389767
|
schedulerId: this.schedulerId,
|
|
389620
|
-
parentCallId: this.parentCallId
|
|
389768
|
+
parentCallId: this.parentCallId,
|
|
389769
|
+
groupId: groupIds[index]
|
|
389621
389770
|
};
|
|
389622
389771
|
const tool = toolRegistry.getTool(request.name);
|
|
389623
389772
|
if (!tool) {
|
|
@@ -389890,7 +390039,8 @@ var init_scheduler = __esm({
|
|
|
389890
390039
|
originalRequestArgs: result2.request.originalRequestArgs ?? result2.request.args,
|
|
389891
390040
|
isClientInitiated: result2.request.isClientInitiated,
|
|
389892
390041
|
prompt_id: result2.request.prompt_id,
|
|
389893
|
-
schedulerId: this.schedulerId
|
|
390042
|
+
schedulerId: this.schedulerId,
|
|
390043
|
+
groupId: result2.request.groupId
|
|
389894
390044
|
};
|
|
389895
390045
|
if (!newTool) {
|
|
389896
390046
|
const errorCall = this._createToolNotFoundErroredToolCall(newRequest, this.context.toolRegistry.getAllToolNames());
|
|
@@ -424087,18 +424237,6 @@ ${REFERENCE_CONTENT_END}`;
|
|
|
424087
424237
|
}
|
|
424088
424238
|
});
|
|
424089
424239
|
|
|
424090
|
-
// packages/core/dist/src/utils/compatibility.js
|
|
424091
|
-
var WarningPriority;
|
|
424092
|
-
var init_compatibility = __esm({
|
|
424093
|
-
"packages/core/dist/src/utils/compatibility.js"() {
|
|
424094
|
-
"use strict";
|
|
424095
|
-
(function(WarningPriority2) {
|
|
424096
|
-
WarningPriority2["Low"] = "low";
|
|
424097
|
-
WarningPriority2["High"] = "high";
|
|
424098
|
-
})(WarningPriority || (WarningPriority = {}));
|
|
424099
|
-
}
|
|
424100
|
-
});
|
|
424101
|
-
|
|
424102
424240
|
// packages/core/dist/src/services/worktreeService.js
|
|
424103
424241
|
var init_worktreeService = __esm({
|
|
424104
424242
|
"packages/core/dist/src/services/worktreeService.js"() {
|