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-hook-chunk-
|
|
60
|
+
} from "./token-goat-hook-chunk-WBTHUYJP.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-hook-chunk-
|
|
99
|
+
} from "./token-goat-hook-chunk-DHW6SRHR.mjs";
|
|
100
100
|
import {
|
|
101
101
|
registerReset
|
|
102
|
-
} from "./token-goat-hook-chunk-
|
|
102
|
+
} from "./token-goat-hook-chunk-J2ZK2FYW.mjs";
|
|
103
103
|
import {
|
|
104
104
|
init_define_import_meta_env
|
|
105
|
-
} from "./token-goat-hook-chunk-
|
|
105
|
+
} from "./token-goat-hook-chunk-K33JMLL7.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);
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
runSkeleton,
|
|
26
26
|
runSymbol,
|
|
27
27
|
withPinnedReads
|
|
28
|
-
} from "./token-goat-hook-chunk-
|
|
28
|
+
} from "./token-goat-hook-chunk-Q5URQRIF.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-hook-chunk-
|
|
37
|
+
} from "./token-goat-hook-chunk-WBTHUYJP.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-hook-chunk-
|
|
49
|
-
import "./token-goat-hook-chunk-
|
|
48
|
+
} from "./token-goat-hook-chunk-DHW6SRHR.mjs";
|
|
49
|
+
import "./token-goat-hook-chunk-J2ZK2FYW.mjs";
|
|
50
50
|
import {
|
|
51
51
|
init_define_import_meta_env
|
|
52
|
-
} from "./token-goat-hook-chunk-
|
|
52
|
+
} from "./token-goat-hook-chunk-K33JMLL7.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-hook-chunk-
|
|
205
|
+
const [{ McpServer }, { z }] = await Promise.all([import("@modelcontextprotocol/sdk/server/mcp.js"), import("./token-goat-hook-chunk-TKXOXN4J.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`
|
|
@@ -3,7 +3,7 @@ const require = __cjsRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
__export,
|
|
5
5
|
init_define_import_meta_env
|
|
6
|
-
} from "./token-goat-hook-chunk-
|
|
6
|
+
} from "./token-goat-hook-chunk-K33JMLL7.mjs";
|
|
7
7
|
|
|
8
8
|
// node_modules/zod/index.js
|
|
9
9
|
init_define_import_meta_env();
|
|
@@ -590,7 +590,7 @@ function $constructor(name, initializer3, params) {
|
|
|
590
590
|
Object.defineProperty(_, "name", { value: name });
|
|
591
591
|
return _;
|
|
592
592
|
}
|
|
593
|
-
var $brand = Symbol("zod_brand");
|
|
593
|
+
var $brand = /* @__PURE__ */ Symbol("zod_brand");
|
|
594
594
|
var $ZodAsyncError = class extends Error {
|
|
595
595
|
constructor() {
|
|
596
596
|
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
@@ -10407,8 +10407,8 @@ function yo_default() {
|
|
|
10407
10407
|
// node_modules/zod/v4/core/registries.js
|
|
10408
10408
|
init_define_import_meta_env();
|
|
10409
10409
|
var _a2;
|
|
10410
|
-
var $output = Symbol("ZodOutput");
|
|
10411
|
-
var $input = Symbol("ZodInput");
|
|
10410
|
+
var $output = /* @__PURE__ */ Symbol("ZodOutput");
|
|
10411
|
+
var $input = /* @__PURE__ */ Symbol("ZodInput");
|
|
10412
10412
|
var $ZodRegistry = class {
|
|
10413
10413
|
constructor() {
|
|
10414
10414
|
this._map = /* @__PURE__ */ new WeakMap();
|
|
@@ -11446,7 +11446,7 @@ function _stringbool(Classes, _params) {
|
|
|
11446
11446
|
type: "pipe",
|
|
11447
11447
|
in: stringSchema,
|
|
11448
11448
|
out: booleanSchema,
|
|
11449
|
-
transform: (input, payload) => {
|
|
11449
|
+
transform: ((input, payload) => {
|
|
11450
11450
|
let data = input;
|
|
11451
11451
|
if (params.case !== "sensitive")
|
|
11452
11452
|
data = data.toLowerCase();
|
|
@@ -11465,14 +11465,14 @@ function _stringbool(Classes, _params) {
|
|
|
11465
11465
|
});
|
|
11466
11466
|
return {};
|
|
11467
11467
|
}
|
|
11468
|
-
},
|
|
11469
|
-
reverseTransform: (input, _payload) => {
|
|
11468
|
+
}),
|
|
11469
|
+
reverseTransform: ((input, _payload) => {
|
|
11470
11470
|
if (input === true) {
|
|
11471
11471
|
return truthyArray[0] || "true";
|
|
11472
11472
|
} else {
|
|
11473
11473
|
return falsyArray[0] || "false";
|
|
11474
11474
|
}
|
|
11475
|
-
},
|
|
11475
|
+
}),
|
|
11476
11476
|
error: params.error
|
|
11477
11477
|
});
|
|
11478
11478
|
return codec2;
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
selectFilter,
|
|
11
11
|
shlexSplit,
|
|
12
12
|
wrappedShell
|
|
13
|
-
} from "./token-goat-hook-chunk-
|
|
13
|
+
} from "./token-goat-hook-chunk-VHZECEQD.mjs";
|
|
14
14
|
import {
|
|
15
15
|
loadConfig,
|
|
16
16
|
recordStat
|
|
17
|
-
} from "./token-goat-hook-chunk-
|
|
18
|
-
import "./token-goat-hook-chunk-
|
|
17
|
+
} from "./token-goat-hook-chunk-DHW6SRHR.mjs";
|
|
18
|
+
import "./token-goat-hook-chunk-J2ZK2FYW.mjs";
|
|
19
19
|
import {
|
|
20
20
|
init_define_import_meta_env
|
|
21
|
-
} from "./token-goat-hook-chunk-
|
|
21
|
+
} from "./token-goat-hook-chunk-K33JMLL7.mjs";
|
|
22
22
|
|
|
23
23
|
// src/bash_runner.ts
|
|
24
24
|
init_define_import_meta_env();
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
loadConfig,
|
|
5
5
|
redactSecrets,
|
|
6
6
|
stripAnsiCodes
|
|
7
|
-
} from "./token-goat-hook-chunk-
|
|
7
|
+
} from "./token-goat-hook-chunk-DHW6SRHR.mjs";
|
|
8
8
|
import {
|
|
9
9
|
init_define_import_meta_env
|
|
10
|
-
} from "./token-goat-hook-chunk-
|
|
10
|
+
} from "./token-goat-hook-chunk-K33JMLL7.mjs";
|
|
11
11
|
|
|
12
12
|
// src/tool_filters/helpers.ts
|
|
13
13
|
init_define_import_meta_env();
|
|
@@ -622,6 +622,12 @@ var CompressedOutput = class {
|
|
|
622
622
|
this.exitCode = exitCode;
|
|
623
623
|
this.notes = notes;
|
|
624
624
|
}
|
|
625
|
+
text;
|
|
626
|
+
originalBytes;
|
|
627
|
+
compressedBytes;
|
|
628
|
+
filterName;
|
|
629
|
+
exitCode;
|
|
630
|
+
notes;
|
|
625
631
|
/** Non-negative byte savings (`original - compressed`, clamped at 0). */
|
|
626
632
|
get bytesSaved() {
|
|
627
633
|
return Math.max(0, this.originalBytes - this.compressedBytes);
|
|
@@ -9272,6 +9278,10 @@ var DockerFilter = class extends ToolFilter {
|
|
|
9272
9278
|
oldNew.unshift(`[building ${oldStepCount} layers, ${oldCacheCount} cached]`);
|
|
9273
9279
|
}
|
|
9274
9280
|
kept = oldNew;
|
|
9281
|
+
void oldDroppedCache;
|
|
9282
|
+
void oldDroppedSha;
|
|
9283
|
+
void oldDroppedImd;
|
|
9284
|
+
void oldDroppedStep;
|
|
9275
9285
|
}
|
|
9276
9286
|
const parts = [];
|
|
9277
9287
|
if (droppedDigest) parts.push(`${droppedDigest} digest`);
|
|
@@ -56,13 +56,13 @@ import {
|
|
|
56
56
|
withFileLock,
|
|
57
57
|
writeIfDifferent,
|
|
58
58
|
writeJsonSettings
|
|
59
|
-
} from "./token-goat-hook-chunk-
|
|
59
|
+
} from "./token-goat-hook-chunk-DHW6SRHR.mjs";
|
|
60
60
|
import {
|
|
61
61
|
registerReset
|
|
62
|
-
} from "./token-goat-hook-chunk-
|
|
62
|
+
} from "./token-goat-hook-chunk-J2ZK2FYW.mjs";
|
|
63
63
|
import {
|
|
64
64
|
init_define_import_meta_env
|
|
65
|
-
} from "./token-goat-hook-chunk-
|
|
65
|
+
} from "./token-goat-hook-chunk-K33JMLL7.mjs";
|
|
66
66
|
|
|
67
67
|
// src/hook_registry.ts
|
|
68
68
|
init_define_import_meta_env();
|
|
@@ -16294,8 +16294,9 @@ function isTooShallowToPrune(rootPrefix) {
|
|
|
16294
16294
|
return segments.length === 0;
|
|
16295
16295
|
}
|
|
16296
16296
|
function foldedBounds(rootPrefix) {
|
|
16297
|
-
const
|
|
16298
|
-
|
|
16297
|
+
const normalized = normalizePath(rootPrefix);
|
|
16298
|
+
const prefix = normalized.endsWith("/") ? normalized : `${normalized}/`;
|
|
16299
|
+
return { foldedRootPrefix: foldPath(normalized), foldedPrefix: foldPath(prefix) };
|
|
16299
16300
|
}
|
|
16300
16301
|
function allIndexedPaths(dbPath) {
|
|
16301
16302
|
const db = getDb(dbPath);
|
|
@@ -16305,7 +16306,7 @@ function allIndexedPaths(dbPath) {
|
|
|
16305
16306
|
function foldedPathsUnderRoot(rootPrefix, dbPath) {
|
|
16306
16307
|
const { foldedRootPrefix, foldedPrefix } = foldedBounds(rootPrefix);
|
|
16307
16308
|
return allIndexedPaths(dbPath).filter((p) => {
|
|
16308
|
-
const foldedP = foldPath(p);
|
|
16309
|
+
const foldedP = foldPath(normalizePath(p));
|
|
16309
16310
|
return foldedP === foldedRootPrefix || foldedP.startsWith(foldedPrefix);
|
|
16310
16311
|
});
|
|
16311
16312
|
}
|
|
@@ -16351,6 +16352,11 @@ function pruneDeletedFiles(rootPrefix, dbPath = globalDbPath()) {
|
|
|
16351
16352
|
const db = getDb(dbPath);
|
|
16352
16353
|
return removeDeletedFilesBestEffort(db, findDeletablePaths(rootPrefix, dbPath)).length;
|
|
16353
16354
|
}
|
|
16355
|
+
function pruneBlockedRoot(rootPrefix, dbPath = globalDbPath()) {
|
|
16356
|
+
const normalized = normalizePath(rootPrefix);
|
|
16357
|
+
if (isTooShallowToPrune(normalized)) return [];
|
|
16358
|
+
return removeFilesBestEffort(getDb(dbPath), foldedPathsUnderRoot(normalized, dbPath));
|
|
16359
|
+
}
|
|
16354
16360
|
function findSystemTempFiles(dbPath = globalDbPath()) {
|
|
16355
16361
|
return allIndexedPaths(dbPath).filter((p) => isUnderSystemTemp(p));
|
|
16356
16362
|
}
|
|
@@ -16613,7 +16619,7 @@ function cleanupWorkerStateFiles(dir) {
|
|
|
16613
16619
|
}
|
|
16614
16620
|
sweepExpiredKnownRootMarkers(dir);
|
|
16615
16621
|
}
|
|
16616
|
-
var INDEX_FAILED = Symbol("indexFailed");
|
|
16622
|
+
var INDEX_FAILED = /* @__PURE__ */ Symbol("indexFailed");
|
|
16617
16623
|
var inFlightEmbeddings = /* @__PURE__ */ new Map();
|
|
16618
16624
|
var activeEmbedSlots = 0;
|
|
16619
16625
|
var embedSlotWaiters = [];
|
|
@@ -17972,6 +17978,7 @@ function formatMemSuggestions(projectRoot) {
|
|
|
17972
17978
|
|
|
17973
17979
|
// src/url_policy.ts
|
|
17974
17980
|
init_define_import_meta_env();
|
|
17981
|
+
import { domainToUnicode } from "node:url";
|
|
17975
17982
|
function wildcardToRegExp(pattern) {
|
|
17976
17983
|
const escaped = pattern.replace(/[.+^${}()|[\]\\?]/g, "\\$&").replace(/\*/g, ".*");
|
|
17977
17984
|
return new RegExp(`^${escaped}$`, "i");
|
|
@@ -17994,9 +18001,15 @@ function urlSpellings(url) {
|
|
|
17994
18001
|
const parsed = new URL(url);
|
|
17995
18002
|
if (parsed.hostname.endsWith(".")) parsed.hostname = parsed.hostname.replace(/\.+$/, "");
|
|
17996
18003
|
if (!out.includes(parsed.href)) out.push(parsed.href);
|
|
18004
|
+
const spellWith = (authority) => `${parsed.protocol}//${parsed.username === "" && parsed.password === "" ? "" : `${parsed.username}${parsed.password === "" ? "" : `:${parsed.password}`}@`}${authority}${parsed.pathname}${parsed.search}${parsed.hash}`;
|
|
17997
18005
|
const defaultPort = DEFAULT_PORTS[parsed.protocol];
|
|
17998
18006
|
if (parsed.port === "" && defaultPort !== void 0) {
|
|
17999
|
-
const spelled = `${parsed.
|
|
18007
|
+
const spelled = spellWith(`${parsed.hostname}:${defaultPort}`);
|
|
18008
|
+
if (!out.includes(spelled)) out.push(spelled);
|
|
18009
|
+
}
|
|
18010
|
+
const unicodeHost = domainToUnicode(parsed.hostname);
|
|
18011
|
+
if (unicodeHost !== "" && unicodeHost !== parsed.hostname) {
|
|
18012
|
+
const spelled = spellWith(parsed.port === "" ? unicodeHost : `${unicodeHost}:${parsed.port}`);
|
|
18000
18013
|
if (!out.includes(spelled)) out.push(spelled);
|
|
18001
18014
|
}
|
|
18002
18015
|
} catch {
|
|
@@ -18027,6 +18040,12 @@ function urlAuthorities(url) {
|
|
|
18027
18040
|
const hosts = [parsed.host, parsed.hostname];
|
|
18028
18041
|
const defaultPort = DEFAULT_PORTS[parsed.protocol];
|
|
18029
18042
|
if (parsed.port === "" && defaultPort !== void 0) hosts.push(`${parsed.hostname}:${defaultPort}`);
|
|
18043
|
+
const unicodeHost = domainToUnicode(parsed.hostname);
|
|
18044
|
+
if (unicodeHost !== "" && unicodeHost !== parsed.hostname) {
|
|
18045
|
+
hosts.push(unicodeHost);
|
|
18046
|
+
if (parsed.port !== "") hosts.push(`${unicodeHost}:${parsed.port}`);
|
|
18047
|
+
else if (defaultPort !== void 0) hosts.push(`${unicodeHost}:${defaultPort}`);
|
|
18048
|
+
}
|
|
18030
18049
|
return hosts;
|
|
18031
18050
|
} catch {
|
|
18032
18051
|
return null;
|
|
@@ -18269,6 +18288,7 @@ export {
|
|
|
18269
18288
|
indexFileEmbeddings,
|
|
18270
18289
|
removeFileFromIndex,
|
|
18271
18290
|
pruneDeletedFiles,
|
|
18291
|
+
pruneBlockedRoot,
|
|
18272
18292
|
findSystemTempFiles,
|
|
18273
18293
|
pruneSystemTempFiles,
|
|
18274
18294
|
recordKnownRootThrottled,
|
package/dist/token-goat-hook.mjs
CHANGED
|
@@ -2,15 +2,15 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
relayInProcess
|
|
5
|
-
} from "./token-goat-hook-chunk-
|
|
6
|
-
import "./token-goat-hook-chunk-
|
|
7
|
-
import "./token-goat-hook-chunk-
|
|
8
|
-
import "./token-goat-hook-chunk-
|
|
9
|
-
import "./token-goat-hook-chunk-
|
|
10
|
-
import "./token-goat-hook-chunk-
|
|
5
|
+
} from "./token-goat-hook-chunk-DJZGX27J.mjs";
|
|
6
|
+
import "./token-goat-hook-chunk-VHZECEQD.mjs";
|
|
7
|
+
import "./token-goat-hook-chunk-LFYT4DLB.mjs";
|
|
8
|
+
import "./token-goat-hook-chunk-WBTHUYJP.mjs";
|
|
9
|
+
import "./token-goat-hook-chunk-DHW6SRHR.mjs";
|
|
10
|
+
import "./token-goat-hook-chunk-J2ZK2FYW.mjs";
|
|
11
11
|
import {
|
|
12
12
|
init_define_import_meta_env
|
|
13
|
-
} from "./token-goat-hook-chunk-
|
|
13
|
+
} from "./token-goat-hook-chunk-K33JMLL7.mjs";
|
|
14
14
|
|
|
15
15
|
// src/hook_lib.ts
|
|
16
16
|
init_define_import_meta_env();
|
package/dist/token-goat.core.mjs
CHANGED
|
@@ -2,17 +2,17 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
run
|
|
5
|
-
} from "./token-goat-chunk-
|
|
6
|
-
import "./token-goat-chunk-
|
|
7
|
-
import "./token-goat-chunk-
|
|
8
|
-
import "./token-goat-chunk-
|
|
5
|
+
} from "./token-goat-chunk-RD6O3PJU.mjs";
|
|
6
|
+
import "./token-goat-chunk-N53GXI2Z.mjs";
|
|
7
|
+
import "./token-goat-chunk-O7TGKV5I.mjs";
|
|
8
|
+
import "./token-goat-chunk-X5OPORR4.mjs";
|
|
9
9
|
import {
|
|
10
10
|
installEpipeGuard
|
|
11
|
-
} from "./token-goat-chunk-
|
|
12
|
-
import "./token-goat-chunk-
|
|
11
|
+
} from "./token-goat-chunk-5EXIMDHA.mjs";
|
|
12
|
+
import "./token-goat-chunk-3KW5C2KQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
init_define_import_meta_env
|
|
15
|
-
} from "./token-goat-chunk-
|
|
15
|
+
} from "./token-goat-chunk-3UOG7PSZ.mjs";
|
|
16
16
|
|
|
17
17
|
// src/main.ts
|
|
18
18
|
init_define_import_meta_env();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-goat",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.32",
|
|
4
4
|
"description": "Surgical token-reduction companion for Claude Code and other AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/token-goat.mjs",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "node esbuild.config.mjs",
|
|
20
|
+
"sbom": "npm sbom --sbom-format cyclonedx --omit=dev",
|
|
20
21
|
"typecheck": "tsc --noEmit",
|
|
21
22
|
"typecheck:tests": "tsc -p tsconfig.tests.json --noEmit",
|
|
22
23
|
"test": "vitest run",
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
"SECURITY.md",
|
|
52
53
|
"LICENSE"
|
|
53
54
|
],
|
|
54
|
-
"license": "
|
|
55
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
55
56
|
"engines": {
|
|
56
57
|
"node": ">=22.0.0"
|
|
57
58
|
},
|
|
@@ -59,7 +60,6 @@
|
|
|
59
60
|
"better-sqlite3": "^11.3.0",
|
|
60
61
|
"commander": "^12.1.0",
|
|
61
62
|
"csv-parse": "^7.0.1",
|
|
62
|
-
"html-to-text": "^10.0.0",
|
|
63
63
|
"js-yaml": "^5.2.1",
|
|
64
64
|
"jsonc-parser": "^3.3.1",
|
|
65
65
|
"smol-toml": "^1.7.0",
|
|
@@ -69,8 +69,9 @@
|
|
|
69
69
|
"@eslint/js": "^10.0.1",
|
|
70
70
|
"@types/better-sqlite3": "^7.6.11",
|
|
71
71
|
"@types/node": "^22.0.0",
|
|
72
|
-
"esbuild": "^0.
|
|
72
|
+
"esbuild": "^0.28.2",
|
|
73
73
|
"eslint": "^10.5.0",
|
|
74
|
+
"html-to-text": "^10.0.0",
|
|
74
75
|
"lefthook": "^2.1.10",
|
|
75
76
|
"tsx": "^4.19.0",
|
|
76
77
|
"typescript": "^6.0.3",
|
|
@@ -119,5 +120,12 @@
|
|
|
119
120
|
"tree-sitter-ruby@0.23.1": true,
|
|
120
121
|
"tree-sitter-rust@0.23.3": true,
|
|
121
122
|
"tree-sitter-typescript@0.23.2": true
|
|
123
|
+
},
|
|
124
|
+
"overrides": {
|
|
125
|
+
"protobufjs": "^8.7.2",
|
|
126
|
+
"deepmerge-ts": "^8.0.1",
|
|
127
|
+
"uuid": "^14.0.1",
|
|
128
|
+
"sharp": "^0.35.3",
|
|
129
|
+
"unzipper": "^0.12.5"
|
|
122
130
|
}
|
|
123
131
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
-
const require = __cjsRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
buildEvent,
|
|
5
|
-
relay,
|
|
6
|
-
relayInProcess
|
|
7
|
-
} from "./token-goat-hook-chunk-2K7FV2ME.mjs";
|
|
8
|
-
import "./token-goat-hook-chunk-JVJUBWKT.mjs";
|
|
9
|
-
import {
|
|
10
|
-
MAX_STDIN_BYTES,
|
|
11
|
-
readStdinJson
|
|
12
|
-
} from "./token-goat-hook-chunk-JT5RMRIY.mjs";
|
|
13
|
-
import "./token-goat-hook-chunk-SJM4BUZQ.mjs";
|
|
14
|
-
import "./token-goat-hook-chunk-NIVRFAJ4.mjs";
|
|
15
|
-
import "./token-goat-hook-chunk-KNVHTGEX.mjs";
|
|
16
|
-
import "./token-goat-hook-chunk-7WC2H3EW.mjs";
|
|
17
|
-
export {
|
|
18
|
-
MAX_STDIN_BYTES,
|
|
19
|
-
buildEvent,
|
|
20
|
-
readStdinJson,
|
|
21
|
-
relay,
|
|
22
|
-
relayInProcess
|
|
23
|
-
};
|