token-goat 2.6.31 → 2.6.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/SECURITY.md +67 -3
- package/dist/{token-goat-chunk-VYC34TBW.mjs → token-goat-chunk-3KW5C2KQ.mjs} +1 -1
- package/dist/{token-goat-chunk-4WGVGN6W.mjs → token-goat-chunk-3UOG7PSZ.mjs} +12 -3
- package/dist/{token-goat-chunk-Q4N6SQWR.mjs → token-goat-chunk-4M7PSAO3.mjs} +8 -8
- package/dist/{token-goat-chunk-X7PIWZMB.mjs → token-goat-chunk-5EXIMDHA.mjs} +3 -227
- package/dist/{token-goat-chunk-PWD5XZ6C.mjs → token-goat-chunk-DFBD2FFU.mjs} +276 -90
- package/dist/{token-goat-chunk-56C3XUQY.mjs → token-goat-chunk-DNEPSN3P.mjs} +4 -4
- package/dist/{token-goat-chunk-N2S7UAVU.mjs → token-goat-chunk-GWZJ5SI2.mjs} +12 -2
- package/dist/{token-goat-chunk-P7I6LS5H.mjs → token-goat-chunk-N53GXI2Z.mjs} +39 -22
- package/dist/{token-goat-chunk-OIBTYBVR.mjs → token-goat-chunk-O7TGKV5I.mjs} +4 -4
- package/dist/{token-goat-chunk-XEJBPPD7.mjs → token-goat-chunk-RD6O3PJU.mjs} +150 -89
- package/dist/{token-goat-chunk-J6JTYE2B.mjs → token-goat-chunk-TBCLQTPG.mjs} +7 -7
- package/dist/{token-goat-chunk-QL2743EW.mjs → token-goat-chunk-W3MX4LQV.mjs} +6 -6
- package/dist/{token-goat-chunk-HPY7XE77.mjs → token-goat-chunk-X5OPORR4.mjs} +28 -8
- package/dist/{token-goat-chunk-DCGBS2YZ.mjs → token-goat-chunk-YWYITDOS.mjs} +4 -4
- package/dist/{token-goat-hook-chunk-YHRJMMEF.mjs → token-goat-hook-chunk-6NF4WM2U.mjs} +151 -90
- package/dist/token-goat-hook-chunk-ANFXTEQO.mjs +23 -0
- package/dist/{token-goat-hook-chunk-NIVRFAJ4.mjs → token-goat-hook-chunk-DHW6SRHR.mjs} +3 -227
- package/dist/{token-goat-hook-chunk-2K7FV2ME.mjs → token-goat-hook-chunk-DJZGX27J.mjs} +275 -89
- package/dist/{token-goat-hook-chunk-KNVHTGEX.mjs → token-goat-hook-chunk-J2ZK2FYW.mjs} +1 -1
- package/dist/{token-goat-hook-chunk-7WC2H3EW.mjs → token-goat-hook-chunk-K33JMLL7.mjs} +12 -3
- package/dist/{token-goat-hook-chunk-JT5RMRIY.mjs → token-goat-hook-chunk-LFYT4DLB.mjs} +4 -4
- package/dist/{token-goat-hook-chunk-5AQYD2SZ.mjs → token-goat-hook-chunk-PCP4W65Z.mjs} +4 -4
- package/dist/{token-goat-hook-chunk-66W63A4Y.mjs → token-goat-hook-chunk-Q5URQRIF.mjs} +39 -22
- package/dist/{token-goat-hook-chunk-K6HLYRRI.mjs → token-goat-hook-chunk-TBJ5PUPQ.mjs} +6 -6
- package/dist/{token-goat-hook-chunk-FKZ5RBT4.mjs → token-goat-hook-chunk-TKXOXN4J.mjs} +8 -8
- package/dist/{token-goat-hook-chunk-3OJELLK5.mjs → token-goat-hook-chunk-UXD3B4OY.mjs} +4 -4
- package/dist/{token-goat-hook-chunk-JVJUBWKT.mjs → token-goat-hook-chunk-VHZECEQD.mjs} +12 -2
- package/dist/{token-goat-hook-chunk-SJM4BUZQ.mjs → token-goat-hook-chunk-WBTHUYJP.mjs} +28 -8
- package/dist/token-goat-hook.mjs +7 -7
- package/dist/token-goat.core.mjs +7 -7
- package/package.json +12 -4
- package/dist/token-goat-hook-chunk-ULGSXGZK.mjs +0 -23
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
walkProject,
|
|
58
58
|
yamlLineClosesQuote,
|
|
59
59
|
yamlOpenQuoteAfter
|
|
60
|
-
} from "./token-goat-chunk-
|
|
60
|
+
} from "./token-goat-chunk-X5OPORR4.mjs";
|
|
61
61
|
import {
|
|
62
62
|
PER_FILE_COUNTERFACTUAL_CEILING,
|
|
63
63
|
atomicWriteBytes,
|
|
@@ -96,13 +96,13 @@ import {
|
|
|
96
96
|
toDisplayPath,
|
|
97
97
|
windowsCmdQuoteArg,
|
|
98
98
|
withExtension
|
|
99
|
-
} from "./token-goat-chunk-
|
|
99
|
+
} from "./token-goat-chunk-5EXIMDHA.mjs";
|
|
100
100
|
import {
|
|
101
101
|
registerReset
|
|
102
|
-
} from "./token-goat-chunk-
|
|
102
|
+
} from "./token-goat-chunk-3KW5C2KQ.mjs";
|
|
103
103
|
import {
|
|
104
104
|
init_define_import_meta_env
|
|
105
|
-
} from "./token-goat-chunk-
|
|
105
|
+
} from "./token-goat-chunk-3UOG7PSZ.mjs";
|
|
106
106
|
|
|
107
107
|
// src/repomap.ts
|
|
108
108
|
init_define_import_meta_env();
|
|
@@ -592,7 +592,7 @@ function queryJson(data, spec) {
|
|
|
592
592
|
|
|
593
593
|
// node_modules/js-yaml/dist/js-yaml.mjs
|
|
594
594
|
init_define_import_meta_env();
|
|
595
|
-
var NOT_RESOLVED = Symbol("NOT_RESOLVED");
|
|
595
|
+
var NOT_RESOLVED = /* @__PURE__ */ Symbol("NOT_RESOLVED");
|
|
596
596
|
function defineScalarTag(tagName, options) {
|
|
597
597
|
return {
|
|
598
598
|
tagName,
|
|
@@ -2892,9 +2892,6 @@ function load(input, options) {
|
|
|
2892
2892
|
if (documents.length === 1) return documents[0];
|
|
2893
2893
|
throw new YAMLException("expected a single document in the stream, but found more");
|
|
2894
2894
|
}
|
|
2895
|
-
var INVALID = Symbol("INVALID");
|
|
2896
|
-
var VISIT_BREAK = Symbol("visit:break");
|
|
2897
|
-
var VISIT_SKIP = Symbol("visit:skip");
|
|
2898
2895
|
var ESCAPE_SEQUENCES = {};
|
|
2899
2896
|
ESCAPE_SEQUENCES[0] = "\\0";
|
|
2900
2897
|
ESCAPE_SEQUENCES[7] = "\\a";
|
|
@@ -3073,10 +3070,25 @@ function formatOperationDetail(op) {
|
|
|
3073
3070
|
|
|
3074
3071
|
// src/archive_query.ts
|
|
3075
3072
|
init_define_import_meta_env();
|
|
3076
|
-
|
|
3077
|
-
|
|
3073
|
+
var loadFflate = createLazyModuleLoader(
|
|
3074
|
+
async () => await import("fflate"),
|
|
3075
|
+
"archive reading disabled (fflate unavailable)"
|
|
3076
|
+
);
|
|
3077
|
+
var ArchiveDependencyMissingError = class extends Error {
|
|
3078
|
+
constructor() {
|
|
3079
|
+
super("fflate is not installed; run `npm install fflate` to enable zip-list/zip-read");
|
|
3080
|
+
this.name = "ArchiveDependencyMissingError";
|
|
3081
|
+
}
|
|
3082
|
+
};
|
|
3083
|
+
async function requireFflate() {
|
|
3084
|
+
const fflate = await loadFflate();
|
|
3085
|
+
if (!fflate) throw new ArchiveDependencyMissingError();
|
|
3086
|
+
return fflate;
|
|
3087
|
+
}
|
|
3088
|
+
async function listZipEntries(data) {
|
|
3089
|
+
const fflate = await requireFflate();
|
|
3078
3090
|
const entries = [];
|
|
3079
|
-
unzipSync(data, {
|
|
3091
|
+
fflate.unzipSync(data, {
|
|
3080
3092
|
filter: (file) => {
|
|
3081
3093
|
entries.push({
|
|
3082
3094
|
path: file.name,
|
|
@@ -3094,8 +3106,9 @@ function formatZipList(entries) {
|
|
|
3094
3106
|
if (entries.length === 0) return "(no entries found)";
|
|
3095
3107
|
return entries.map((e) => `${String(e.size).padStart(10)} ${e.path}`).join("\n");
|
|
3096
3108
|
}
|
|
3097
|
-
function extractZipEntry(data, entryPath) {
|
|
3098
|
-
const
|
|
3109
|
+
async function extractZipEntry(data, entryPath) {
|
|
3110
|
+
const fflate = await requireFflate();
|
|
3111
|
+
const result = fflate.unzipSync(data, { filter: (file) => file.name === entryPath });
|
|
3099
3112
|
return result[entryPath];
|
|
3100
3113
|
}
|
|
3101
3114
|
|
|
@@ -6286,7 +6299,11 @@ function runOpenApiOp(opts) {
|
|
|
6286
6299
|
}
|
|
6287
6300
|
return 0;
|
|
6288
6301
|
}
|
|
6289
|
-
function
|
|
6302
|
+
function archiveReadFailure(err, file) {
|
|
6303
|
+
if (err instanceof ArchiveDependencyMissingError) return err.message;
|
|
6304
|
+
return `Failed to read archive (not a valid zip-format file): ${file}`;
|
|
6305
|
+
}
|
|
6306
|
+
async function runZipList(opts) {
|
|
6290
6307
|
const data = readFileBytes(opts.file);
|
|
6291
6308
|
if (data === null) {
|
|
6292
6309
|
emitErr(`Could not read: ${opts.file}`);
|
|
@@ -6294,9 +6311,9 @@ function runZipList(opts) {
|
|
|
6294
6311
|
}
|
|
6295
6312
|
let entries;
|
|
6296
6313
|
try {
|
|
6297
|
-
entries = listZipEntries(data);
|
|
6298
|
-
} catch {
|
|
6299
|
-
emitErr(
|
|
6314
|
+
entries = await listZipEntries(data);
|
|
6315
|
+
} catch (err) {
|
|
6316
|
+
emitErr(archiveReadFailure(err, opts.file));
|
|
6300
6317
|
return 1;
|
|
6301
6318
|
}
|
|
6302
6319
|
const fullSourceBytes = sumFileSizes([opts.file]);
|
|
@@ -6311,7 +6328,7 @@ function runZipList(opts) {
|
|
|
6311
6328
|
}
|
|
6312
6329
|
return 0;
|
|
6313
6330
|
}
|
|
6314
|
-
function runZipRead(opts) {
|
|
6331
|
+
async function runZipRead(opts) {
|
|
6315
6332
|
const data = readFileBytes(opts.file);
|
|
6316
6333
|
if (data === null) {
|
|
6317
6334
|
emitErr(`Could not read: ${opts.file}`);
|
|
@@ -6320,10 +6337,10 @@ function runZipRead(opts) {
|
|
|
6320
6337
|
let entries;
|
|
6321
6338
|
let content;
|
|
6322
6339
|
try {
|
|
6323
|
-
entries = listZipEntries(data);
|
|
6324
|
-
content = extractZipEntry(data, opts.entry);
|
|
6325
|
-
} catch {
|
|
6326
|
-
emitErr(
|
|
6340
|
+
entries = await listZipEntries(data);
|
|
6341
|
+
content = await extractZipEntry(data, opts.entry);
|
|
6342
|
+
} catch (err) {
|
|
6343
|
+
emitErr(archiveReadFailure(err, opts.file));
|
|
6327
6344
|
return 1;
|
|
6328
6345
|
}
|
|
6329
6346
|
const matchedEntry = entries.find((e) => e.path === opts.entry);
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
loadBlob,
|
|
7
7
|
sanitizeFtsQuery,
|
|
8
8
|
storeBlob
|
|
9
|
-
} from "./token-goat-chunk-
|
|
9
|
+
} from "./token-goat-chunk-X5OPORR4.mjs";
|
|
10
10
|
import {
|
|
11
11
|
SYMBOL_BODY_CHAR_CAP,
|
|
12
12
|
extractErrorMessage,
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
redactSecrets,
|
|
17
17
|
runGit,
|
|
18
18
|
shortFingerprint
|
|
19
|
-
} from "./token-goat-chunk-
|
|
19
|
+
} from "./token-goat-chunk-5EXIMDHA.mjs";
|
|
20
20
|
import {
|
|
21
21
|
registerReset
|
|
22
|
-
} from "./token-goat-chunk-
|
|
22
|
+
} from "./token-goat-chunk-3KW5C2KQ.mjs";
|
|
23
23
|
import {
|
|
24
24
|
init_define_import_meta_env
|
|
25
|
-
} from "./token-goat-chunk-
|
|
25
|
+
} from "./token-goat-chunk-3UOG7PSZ.mjs";
|
|
26
26
|
|
|
27
27
|
// src/hooks_cli.ts
|
|
28
28
|
init_define_import_meta_env();
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
runZipRead,
|
|
83
83
|
symbolNamesInFile,
|
|
84
84
|
upsertNote
|
|
85
|
-
} from "./token-goat-chunk-
|
|
85
|
+
} from "./token-goat-chunk-N53GXI2Z.mjs";
|
|
86
86
|
import {
|
|
87
87
|
BASH_OUTPUT_SUBDIR,
|
|
88
88
|
GEMINI_TOOL_NAME_MAP,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
readStdinJson,
|
|
104
104
|
searchRecall,
|
|
105
105
|
storeWebOutput
|
|
106
|
-
} from "./token-goat-chunk-
|
|
106
|
+
} from "./token-goat-chunk-O7TGKV5I.mjs";
|
|
107
107
|
import {
|
|
108
108
|
AGENT_SALT_MARKER,
|
|
109
109
|
CONTEXT_AUTOCOMPACT_TOKENS,
|
|
@@ -204,6 +204,7 @@ import {
|
|
|
204
204
|
pptxSlideText,
|
|
205
205
|
pptxTextGrep,
|
|
206
206
|
pruneBlobs,
|
|
207
|
+
pruneBlockedRoot,
|
|
207
208
|
pruneDeletedFiles,
|
|
208
209
|
pruneSkillOutputs,
|
|
209
210
|
pruneSystemTempFiles,
|
|
@@ -235,7 +236,7 @@ import {
|
|
|
235
236
|
vscodeDecoderConfigured,
|
|
236
237
|
walkProject,
|
|
237
238
|
writeCompact
|
|
238
|
-
} from "./token-goat-chunk-
|
|
239
|
+
} from "./token-goat-chunk-X5OPORR4.mjs";
|
|
239
240
|
import {
|
|
240
241
|
C,
|
|
241
242
|
CONFIG_KEY_ENV_OVERRIDES,
|
|
@@ -307,14 +308,14 @@ import {
|
|
|
307
308
|
withFileLock,
|
|
308
309
|
withRetryOnLock,
|
|
309
310
|
writeJsonSettings
|
|
310
|
-
} from "./token-goat-chunk-
|
|
311
|
+
} from "./token-goat-chunk-5EXIMDHA.mjs";
|
|
311
312
|
import {
|
|
312
313
|
__commonJS,
|
|
313
314
|
__export,
|
|
314
315
|
__require,
|
|
315
316
|
__toESM,
|
|
316
317
|
init_define_import_meta_env
|
|
317
|
-
} from "./token-goat-chunk-
|
|
318
|
+
} from "./token-goat-chunk-3UOG7PSZ.mjs";
|
|
318
319
|
|
|
319
320
|
// node_modules/commander/lib/error.js
|
|
320
321
|
var require_error = __commonJS({
|
|
@@ -1927,8 +1928,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1927
1928
|
* @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.
|
|
1928
1929
|
* @return {Command} `this` command for chaining
|
|
1929
1930
|
*/
|
|
1930
|
-
combineFlagAndOptionalValue(
|
|
1931
|
-
this._combineFlagAndOptionalValue = !!
|
|
1931
|
+
combineFlagAndOptionalValue(combine2 = true) {
|
|
1932
|
+
this._combineFlagAndOptionalValue = !!combine2;
|
|
1932
1933
|
return this;
|
|
1933
1934
|
}
|
|
1934
1935
|
/**
|
|
@@ -6358,6 +6359,7 @@ var closePattern = /\\}/g;
|
|
|
6358
6359
|
var commaPattern = /\\,/g;
|
|
6359
6360
|
var periodPattern = /\\\./g;
|
|
6360
6361
|
var EXPANSION_MAX = 1e5;
|
|
6362
|
+
var EXPANSION_MAX_LENGTH = 4e6;
|
|
6361
6363
|
function numeric(str) {
|
|
6362
6364
|
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
6363
6365
|
}
|
|
@@ -6392,11 +6394,11 @@ function expand(str, options = {}) {
|
|
|
6392
6394
|
if (!str) {
|
|
6393
6395
|
return [];
|
|
6394
6396
|
}
|
|
6395
|
-
const { max = EXPANSION_MAX } = options;
|
|
6397
|
+
const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options;
|
|
6396
6398
|
if (str.slice(0, 2) === "{}") {
|
|
6397
6399
|
str = "\\{\\}" + str.slice(2);
|
|
6398
6400
|
}
|
|
6399
|
-
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
|
|
6401
|
+
return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
|
|
6400
6402
|
}
|
|
6401
6403
|
function embrace(str) {
|
|
6402
6404
|
return "{" + str + "}";
|
|
@@ -6410,19 +6412,88 @@ function lte(i, y) {
|
|
|
6410
6412
|
function gte(i, y) {
|
|
6411
6413
|
return i >= y;
|
|
6412
6414
|
}
|
|
6413
|
-
function
|
|
6414
|
-
const
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6415
|
+
function combine(acc, pre, values, max, maxLength, dropEmpties) {
|
|
6416
|
+
const out2 = [];
|
|
6417
|
+
let length = 0;
|
|
6418
|
+
for (let a = 0; a < acc.length; a++) {
|
|
6419
|
+
for (let v = 0; v < values.length; v++) {
|
|
6420
|
+
if (out2.length >= max)
|
|
6421
|
+
return out2;
|
|
6422
|
+
const expansion = acc[a] + pre + values[v];
|
|
6423
|
+
if (dropEmpties && !expansion)
|
|
6424
|
+
continue;
|
|
6425
|
+
if (length + expansion.length > maxLength)
|
|
6426
|
+
return out2;
|
|
6427
|
+
out2.push(expansion);
|
|
6428
|
+
length += expansion.length;
|
|
6429
|
+
}
|
|
6430
|
+
}
|
|
6431
|
+
return out2;
|
|
6432
|
+
}
|
|
6433
|
+
function expandSequence(body, isAlphaSequence, max, maxLength) {
|
|
6434
|
+
const n = body.split(/\.\./);
|
|
6435
|
+
const N = [];
|
|
6436
|
+
if (n[0] === void 0 || n[1] === void 0) {
|
|
6437
|
+
return N;
|
|
6438
|
+
}
|
|
6439
|
+
const x = numeric(n[0]);
|
|
6440
|
+
const y = numeric(n[1]);
|
|
6441
|
+
const width = Math.max(n[0].length, n[1].length);
|
|
6442
|
+
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
|
6443
|
+
let test = lte;
|
|
6444
|
+
const reverse = y < x;
|
|
6445
|
+
if (reverse) {
|
|
6446
|
+
incr *= -1;
|
|
6447
|
+
test = gte;
|
|
6448
|
+
}
|
|
6449
|
+
const pad2 = n.some(isPadded);
|
|
6450
|
+
let length = 0;
|
|
6451
|
+
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
6452
|
+
let c;
|
|
6453
|
+
if (isAlphaSequence) {
|
|
6454
|
+
c = String.fromCharCode(i);
|
|
6455
|
+
if (c === "\\") {
|
|
6456
|
+
c = "";
|
|
6457
|
+
}
|
|
6458
|
+
} else {
|
|
6459
|
+
c = String(i);
|
|
6460
|
+
if (pad2) {
|
|
6461
|
+
const need = width - c.length;
|
|
6462
|
+
if (need > 0) {
|
|
6463
|
+
const z = new Array(need + 1).join("0");
|
|
6464
|
+
if (i < 0) {
|
|
6465
|
+
c = "-" + z + c.slice(1);
|
|
6466
|
+
} else {
|
|
6467
|
+
c = z + c;
|
|
6468
|
+
}
|
|
6469
|
+
}
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6472
|
+
if (length + c.length > maxLength)
|
|
6473
|
+
break;
|
|
6474
|
+
N.push(c);
|
|
6475
|
+
length += c.length;
|
|
6476
|
+
}
|
|
6477
|
+
return N;
|
|
6478
|
+
}
|
|
6479
|
+
function expand_(str, max, maxLength, isTop) {
|
|
6480
|
+
let acc = [""];
|
|
6481
|
+
let dropEmpties = false;
|
|
6482
|
+
let firstGroup = true;
|
|
6483
|
+
for (; ; ) {
|
|
6484
|
+
const m = balanced("{", "}", str);
|
|
6485
|
+
if (!m) {
|
|
6486
|
+
return combine(acc, str, [""], max, maxLength, dropEmpties);
|
|
6487
|
+
}
|
|
6488
|
+
const pre = m.pre;
|
|
6489
|
+
if (/\$$/.test(pre)) {
|
|
6490
|
+
acc = combine(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length);
|
|
6491
|
+
firstGroup = false;
|
|
6492
|
+
if (!m.post.length)
|
|
6493
|
+
break;
|
|
6494
|
+
str = m.post;
|
|
6495
|
+
continue;
|
|
6424
6496
|
}
|
|
6425
|
-
} else {
|
|
6426
6497
|
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
6427
6498
|
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
6428
6499
|
const isSequence = isNumericSequence || isAlphaSequence;
|
|
@@ -6430,75 +6501,58 @@ function expand_(str, max, isTop) {
|
|
|
6430
6501
|
if (!isSequence && !isOptions) {
|
|
6431
6502
|
if (m.post.match(/,(?!,).*\}/)) {
|
|
6432
6503
|
str = m.pre + "{" + m.body + escClose + m.post;
|
|
6433
|
-
|
|
6504
|
+
isTop = true;
|
|
6505
|
+
continue;
|
|
6434
6506
|
}
|
|
6435
|
-
return [
|
|
6507
|
+
return combine(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties);
|
|
6436
6508
|
}
|
|
6437
|
-
|
|
6509
|
+
if (firstGroup) {
|
|
6510
|
+
dropEmpties = isTop && !isSequence;
|
|
6511
|
+
firstGroup = false;
|
|
6512
|
+
}
|
|
6513
|
+
let values;
|
|
6438
6514
|
if (isSequence) {
|
|
6439
|
-
|
|
6515
|
+
values = expandSequence(m.body, isAlphaSequence, max, maxLength);
|
|
6440
6516
|
} else {
|
|
6441
|
-
n = parseCommaParts(m.body);
|
|
6517
|
+
let n = parseCommaParts(m.body);
|
|
6442
6518
|
if (n.length === 1 && n[0] !== void 0) {
|
|
6443
|
-
n = expand_(n[0], max, false).map(embrace);
|
|
6519
|
+
n = expand_(n[0], max, maxLength, false).map(embrace);
|
|
6444
6520
|
if (n.length === 1) {
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
|
|
6451
|
-
const x = numeric(n[0]);
|
|
6452
|
-
const y = numeric(n[1]);
|
|
6453
|
-
const width = Math.max(n[0].length, n[1].length);
|
|
6454
|
-
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
|
6455
|
-
let test = lte;
|
|
6456
|
-
const reverse = y < x;
|
|
6457
|
-
if (reverse) {
|
|
6458
|
-
incr *= -1;
|
|
6459
|
-
test = gte;
|
|
6460
|
-
}
|
|
6461
|
-
const pad2 = n.some(isPadded);
|
|
6462
|
-
N = [];
|
|
6463
|
-
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
6464
|
-
let c;
|
|
6465
|
-
if (isAlphaSequence) {
|
|
6466
|
-
c = String.fromCharCode(i);
|
|
6467
|
-
if (c === "\\") {
|
|
6468
|
-
c = "";
|
|
6469
|
-
}
|
|
6470
|
-
} else {
|
|
6471
|
-
c = String(i);
|
|
6472
|
-
if (pad2) {
|
|
6473
|
-
const need = width - c.length;
|
|
6474
|
-
if (need > 0) {
|
|
6475
|
-
const z = new Array(need + 1).join("0");
|
|
6476
|
-
if (i < 0) {
|
|
6477
|
-
c = "-" + z + c.slice(1);
|
|
6478
|
-
} else {
|
|
6479
|
-
c = z + c;
|
|
6480
|
-
}
|
|
6481
|
-
}
|
|
6482
|
-
}
|
|
6521
|
+
acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
|
|
6522
|
+
if (!m.post.length)
|
|
6523
|
+
break;
|
|
6524
|
+
str = m.post;
|
|
6525
|
+
continue;
|
|
6483
6526
|
}
|
|
6484
|
-
N.push(c);
|
|
6485
6527
|
}
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6528
|
+
let dropsEmpties = dropEmpties && !m.post.length && !pre;
|
|
6529
|
+
for (let d = 0; dropsEmpties && d < acc.length; d++) {
|
|
6530
|
+
if (acc[d]) {
|
|
6531
|
+
dropsEmpties = false;
|
|
6532
|
+
}
|
|
6490
6533
|
}
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
for (let
|
|
6494
|
-
const
|
|
6495
|
-
|
|
6496
|
-
|
|
6534
|
+
values = [];
|
|
6535
|
+
let valuesLength = 0;
|
|
6536
|
+
outer: for (let j = 0; j < n.length; j++) {
|
|
6537
|
+
const expanded = expand_(n[j], max, maxLength, false);
|
|
6538
|
+
for (let k = 0; k < expanded.length; k++) {
|
|
6539
|
+
const v = expanded[k];
|
|
6540
|
+
if (dropsEmpties && !v)
|
|
6541
|
+
continue;
|
|
6542
|
+
if (values.length >= max || valuesLength + v.length > maxLength) {
|
|
6543
|
+
break outer;
|
|
6544
|
+
}
|
|
6545
|
+
values.push(v);
|
|
6546
|
+
valuesLength += v.length;
|
|
6497
6547
|
}
|
|
6498
6548
|
}
|
|
6499
6549
|
}
|
|
6550
|
+
acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
|
|
6551
|
+
if (!m.post.length)
|
|
6552
|
+
break;
|
|
6553
|
+
str = m.post;
|
|
6500
6554
|
}
|
|
6501
|
-
return
|
|
6555
|
+
return acc;
|
|
6502
6556
|
}
|
|
6503
6557
|
|
|
6504
6558
|
// node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
@@ -6715,7 +6769,7 @@ var AST = class {
|
|
|
6715
6769
|
get depth() {
|
|
6716
6770
|
return (this.#parent?.depth ?? -1) + 1;
|
|
6717
6771
|
}
|
|
6718
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
6772
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
6719
6773
|
return {
|
|
6720
6774
|
"@@type": "AST",
|
|
6721
6775
|
id: this.id,
|
|
@@ -7353,7 +7407,7 @@ var path11 = {
|
|
|
7353
7407
|
};
|
|
7354
7408
|
var sep2 = defaultPlatform === "win32" ? path11.win32.sep : path11.posix.sep;
|
|
7355
7409
|
minimatch.sep = sep2;
|
|
7356
|
-
var GLOBSTAR = Symbol("globstar **");
|
|
7410
|
+
var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
|
|
7357
7411
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
7358
7412
|
var qmark2 = "[^/]";
|
|
7359
7413
|
var star2 = qmark2 + "*?";
|
|
@@ -11445,11 +11499,15 @@ function cmdProject(opts) {
|
|
|
11445
11499
|
cfg.worker.blocked_roots = [...cfg.worker.blocked_roots, target];
|
|
11446
11500
|
saveConfigSafe(cfg);
|
|
11447
11501
|
invalidateConfigCache();
|
|
11502
|
+
const purged = pruneBlockedRoot(target);
|
|
11448
11503
|
if (opts.json === true) {
|
|
11449
|
-
emit(JSON.stringify({ excluded: target, blocked_roots: cfg.worker.blocked_roots }, null, 2));
|
|
11504
|
+
emit(JSON.stringify({ excluded: target, purgedFromIndex: purged.length, blocked_roots: cfg.worker.blocked_roots }, null, 2));
|
|
11450
11505
|
return;
|
|
11451
11506
|
}
|
|
11452
11507
|
emit(`Excluded: ${target}`);
|
|
11508
|
+
if (purged.length > 0) {
|
|
11509
|
+
emit(`Removed ${purged.length} already-indexed file${purged.length === 1 ? "" : "s"} under it from the index.`);
|
|
11510
|
+
}
|
|
11453
11511
|
return;
|
|
11454
11512
|
}
|
|
11455
11513
|
if (action === "prune") {
|
|
@@ -12962,7 +13020,10 @@ async function cmdIndex(pathArg, opts = {}) {
|
|
|
12962
13020
|
fileIdx += 1;
|
|
12963
13021
|
paintProgress("scanning");
|
|
12964
13022
|
const key = resolveIndexPath(f);
|
|
12965
|
-
if (isUnderBlockedRoot(key, blockedRoots))
|
|
13023
|
+
if (isUnderBlockedRoot(key, blockedRoots)) {
|
|
13024
|
+
removeFileFromIndex(getDb(dbPath), key);
|
|
13025
|
+
continue;
|
|
13026
|
+
}
|
|
12966
13027
|
if (detectLanguage(key) === "unknown" && !isEmbeddableDocument(key)) continue;
|
|
12967
13028
|
if (isParseSkipEligible(key, ixCfg)) {
|
|
12968
13029
|
removeFileFromIndex(getDb(dbPath), key);
|
|
@@ -13052,7 +13113,7 @@ async function cmdMcpServe() {
|
|
|
13052
13113
|
let StdioServerTransport;
|
|
13053
13114
|
try {
|
|
13054
13115
|
;
|
|
13055
|
-
({ createMcpServer } = await import("./token-goat-chunk-
|
|
13116
|
+
({ createMcpServer } = await import("./token-goat-chunk-W3MX4LQV.mjs"));
|
|
13056
13117
|
({ StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js"));
|
|
13057
13118
|
} catch (err2) {
|
|
13058
13119
|
process.stderr.write(
|
|
@@ -13073,7 +13134,7 @@ async function cmdHook(event, opts) {
|
|
|
13073
13134
|
if (typeof opts.harness === "string" && opts.harness.length > 0) {
|
|
13074
13135
|
process.env[ENV_KEYS.HARNESS_OVERRIDE] = opts.harness;
|
|
13075
13136
|
}
|
|
13076
|
-
const { relay } = await import("./token-goat-chunk-
|
|
13137
|
+
const { relay } = await import("./token-goat-chunk-DFBD2FFU.mjs");
|
|
13077
13138
|
await relay(event);
|
|
13078
13139
|
}
|
|
13079
13140
|
async function cmdInstall(opts) {
|
|
@@ -13848,11 +13909,11 @@ function cmdOpenApiOutline(file, opts) {
|
|
|
13848
13909
|
function cmdOpenApiOp(file, operation, opts) {
|
|
13849
13910
|
process.exitCode = runOpenApiOp({ file, operation, ...opts });
|
|
13850
13911
|
}
|
|
13851
|
-
function cmdZipList(file, opts) {
|
|
13852
|
-
process.exitCode = runZipList({ file, ...opts });
|
|
13912
|
+
async function cmdZipList(file, opts) {
|
|
13913
|
+
process.exitCode = await runZipList({ file, ...opts });
|
|
13853
13914
|
}
|
|
13854
|
-
function cmdZipRead(file, entry, opts) {
|
|
13855
|
-
process.exitCode = runZipRead({ file, entry, ...opts });
|
|
13915
|
+
async function cmdZipRead(file, entry, opts) {
|
|
13916
|
+
process.exitCode = await runZipRead({ file, entry, ...opts });
|
|
13856
13917
|
}
|
|
13857
13918
|
function cmdPrSlice(pr, slice, opts) {
|
|
13858
13919
|
process.exitCode = runPrSlice({ pr, slice, ...opts });
|
|
@@ -13910,7 +13971,7 @@ function emitExtraFileArgsNote(command, first, extras, opts = {}) {
|
|
|
13910
13971
|
}
|
|
13911
13972
|
async function cmdCompress(opts) {
|
|
13912
13973
|
try {
|
|
13913
|
-
const bashRunner = await import("./token-goat-chunk-
|
|
13974
|
+
const bashRunner = await import("./token-goat-chunk-DNEPSN3P.mjs");
|
|
13914
13975
|
if (opts.compress === false) {
|
|
13915
13976
|
process.exitCode = bashRunner.runRaw(opts.cmd, parseTimeout(opts.timeout, bashRunner.DEFAULT_TIMEOUT_SECONDS));
|
|
13916
13977
|
return;
|
|
@@ -15506,7 +15567,7 @@ async function run(argv = process.argv) {
|
|
|
15506
15567
|
return;
|
|
15507
15568
|
}
|
|
15508
15569
|
if (argv[2] === "--batch-serve" && typeof argv[3] === "string") {
|
|
15509
|
-
const { serveBatch } = await import("./token-goat-chunk-
|
|
15570
|
+
const { serveBatch } = await import("./token-goat-chunk-YWYITDOS.mjs");
|
|
15510
15571
|
serveBatch(argv[3], (a) => run(a));
|
|
15511
15572
|
return;
|
|
15512
15573
|
}
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
expandGlobs,
|
|
8
8
|
leftoverIntegrations,
|
|
9
9
|
run
|
|
10
|
-
} from "./token-goat-chunk-
|
|
11
|
-
import "./token-goat-chunk-
|
|
12
|
-
import "./token-goat-chunk-
|
|
13
|
-
import "./token-goat-chunk-
|
|
14
|
-
import "./token-goat-chunk-
|
|
15
|
-
import "./token-goat-chunk-
|
|
16
|
-
import "./token-goat-chunk-
|
|
10
|
+
} from "./token-goat-chunk-RD6O3PJU.mjs";
|
|
11
|
+
import "./token-goat-chunk-N53GXI2Z.mjs";
|
|
12
|
+
import "./token-goat-chunk-O7TGKV5I.mjs";
|
|
13
|
+
import "./token-goat-chunk-X5OPORR4.mjs";
|
|
14
|
+
import "./token-goat-chunk-5EXIMDHA.mjs";
|
|
15
|
+
import "./token-goat-chunk-3KW5C2KQ.mjs";
|
|
16
|
+
import "./token-goat-chunk-3UOG7PSZ.mjs";
|
|
17
17
|
export {
|
|
18
18
|
applyExitOverride,
|
|
19
19
|
buildProgram,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
runSkeleton,
|
|
26
26
|
runSymbol,
|
|
27
27
|
withPinnedReads
|
|
28
|
-
} from "./token-goat-chunk-
|
|
28
|
+
} from "./token-goat-chunk-N53GXI2Z.mjs";
|
|
29
29
|
import {
|
|
30
30
|
buildProjectMap,
|
|
31
31
|
embeddingsDepsAvailable,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
getProjectIndexCounts,
|
|
35
35
|
isWorkerRunning,
|
|
36
36
|
mapLookupBytesSaved
|
|
37
|
-
} from "./token-goat-chunk-
|
|
37
|
+
} from "./token-goat-chunk-X5OPORR4.mjs";
|
|
38
38
|
import {
|
|
39
39
|
VERSION,
|
|
40
40
|
dataDir,
|
|
@@ -45,11 +45,11 @@ import {
|
|
|
45
45
|
normalizePath,
|
|
46
46
|
recordStat,
|
|
47
47
|
resolveProjectRoot
|
|
48
|
-
} from "./token-goat-chunk-
|
|
49
|
-
import "./token-goat-chunk-
|
|
48
|
+
} from "./token-goat-chunk-5EXIMDHA.mjs";
|
|
49
|
+
import "./token-goat-chunk-3KW5C2KQ.mjs";
|
|
50
50
|
import {
|
|
51
51
|
init_define_import_meta_env
|
|
52
|
-
} from "./token-goat-chunk-
|
|
52
|
+
} from "./token-goat-chunk-3UOG7PSZ.mjs";
|
|
53
53
|
|
|
54
54
|
// src/mcp_server.ts
|
|
55
55
|
init_define_import_meta_env();
|
|
@@ -202,7 +202,7 @@ function withConfinedRead(pins, fn) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
async function createMcpServer() {
|
|
205
|
-
const [{ McpServer }, { z }] = await Promise.all([import("@modelcontextprotocol/sdk/server/mcp.js"), import("./token-goat-chunk-
|
|
205
|
+
const [{ McpServer }, { z }] = await Promise.all([import("@modelcontextprotocol/sdk/server/mcp.js"), import("./token-goat-chunk-4M7PSAO3.mjs")]);
|
|
206
206
|
const server = new McpServer({ name: "token-goat", version: VERSION });
|
|
207
207
|
const makeProjectRootField = (verb) => z.string().optional().describe(
|
|
208
208
|
`absolute path to the workspace root to scope this ${verb} to; defaults to the MCP server process's cwd, which is not always the actual workspace root for MCP clients -- pass this explicitly when it might differ`
|