token-goat 2.8.0 → 2.8.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/README.md +8 -6
- package/dist/{token-goat-chunk-VXSYZGBA.mjs → token-goat-chunk-2MWF3OGR.mjs} +226 -20
- package/dist/{token-goat-chunk-AO6MFFTW.mjs → token-goat-chunk-5MLXFSRI.mjs} +6 -6
- package/dist/{token-goat-chunk-FBGBTICM.mjs → token-goat-chunk-AL644JUV.mjs} +3 -3
- package/dist/{token-goat-chunk-2F6TFBZE.mjs → token-goat-chunk-AM23GDIS.mjs} +121 -15
- package/dist/{token-goat-chunk-4KZILRZN.mjs → token-goat-chunk-BTZSUIYA.mjs} +2 -2
- package/dist/{token-goat-chunk-44Y77VHR.mjs → token-goat-chunk-IVCTQPZD.mjs} +129 -7
- package/dist/{token-goat-chunk-A62K4XW2.mjs → token-goat-chunk-JU7QESB3.mjs} +5 -5
- package/dist/{token-goat-chunk-LVCBDJVE.mjs → token-goat-chunk-KBVN4ELV.mjs} +5 -5
- package/dist/{token-goat-chunk-SRAR6DOK.mjs → token-goat-chunk-LILS6TIU.mjs} +97 -13
- package/dist/{token-goat-chunk-J35AKWEQ.mjs → token-goat-chunk-SE6V7LUZ.mjs} +5 -5
- package/dist/{token-goat-chunk-TUPJRK7R.mjs → token-goat-chunk-TF5NT3H5.mjs} +14 -14
- package/dist/token-goat-hook.mjs +5 -5
- package/dist/token-goat.core.mjs +5 -5
- package/package.json +4 -2
|
@@ -2,6 +2,7 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
IMPORT_RE,
|
|
5
|
+
ImageDecodeError,
|
|
5
6
|
MAX_OVER_FETCH,
|
|
6
7
|
OVER_FETCH_FACTOR,
|
|
7
8
|
SKIP_DIRS,
|
|
@@ -25,9 +26,11 @@ import {
|
|
|
25
26
|
isBlobStale,
|
|
26
27
|
isImagePath,
|
|
27
28
|
isIndexEmptyForProject,
|
|
29
|
+
isOcrEngineAvailable,
|
|
28
30
|
isTextHeavy,
|
|
29
31
|
lineOpenDelimiterAfter,
|
|
30
32
|
loadBlob,
|
|
33
|
+
locatePdfPages,
|
|
31
34
|
mergeNearbyHits,
|
|
32
35
|
ocrImage,
|
|
33
36
|
parseWhereSpecs,
|
|
@@ -51,7 +54,7 @@ import {
|
|
|
51
54
|
walkProject,
|
|
52
55
|
yamlLineClosesQuote,
|
|
53
56
|
yamlOpenQuoteAfter
|
|
54
|
-
} from "./token-goat-chunk-
|
|
57
|
+
} from "./token-goat-chunk-AM23GDIS.mjs";
|
|
55
58
|
import {
|
|
56
59
|
Database,
|
|
57
60
|
PER_FILE_COUNTERFACTUAL_CEILING,
|
|
@@ -103,7 +106,7 @@ import {
|
|
|
103
106
|
unsupportedLanguageName,
|
|
104
107
|
windowsCmdQuoteArg,
|
|
105
108
|
withExtension
|
|
106
|
-
} from "./token-goat-chunk-
|
|
109
|
+
} from "./token-goat-chunk-IVCTQPZD.mjs";
|
|
107
110
|
import {
|
|
108
111
|
registerReset
|
|
109
112
|
} from "./token-goat-chunk-AO2QD2AG.mjs";
|
|
@@ -136,7 +139,7 @@ function getTrackedFiles(cwd = process.cwd()) {
|
|
|
136
139
|
// src/section_reader.ts
|
|
137
140
|
import { readFileSync } from "node:fs";
|
|
138
141
|
function parseHeadingSpec(spec, headers) {
|
|
139
|
-
const m = /^(
|
|
142
|
+
const m = /^([^#\r\n]+)#(\d+)$/.exec(spec);
|
|
140
143
|
if (m !== null && m[1] !== void 0 && m[2] !== void 0) {
|
|
141
144
|
const specLower = spec.trim().toLowerCase();
|
|
142
145
|
const isLiteralHeading = headers?.some((h) => h.heading.trim().toLowerCase() === specLower) ?? false;
|
|
@@ -160,7 +163,7 @@ function normalizeHeadingStrip(s) {
|
|
|
160
163
|
return n.replace(/\s+/g, " ").trim();
|
|
161
164
|
}
|
|
162
165
|
var MIN_WIDEN_WORD_LEN = 3;
|
|
163
|
-
var MARKDOWN_HEADER_RE = /^(#{1,6})\s+(
|
|
166
|
+
var MARKDOWN_HEADER_RE = /^(#{1,6})\s+([^\r\n]+?)(?:\s+#+)?\s*$/;
|
|
164
167
|
var TABLE_HEADER_RE = /^\s*\[+\s*([^\]]+?)\s*\]+\s*(?:[#;].*)?$/;
|
|
165
168
|
var PYTHON_HEADER_RE = /^(\s*)(?:async\s+)?(?:def|class)\s+([A-Za-z_]\w*)/;
|
|
166
169
|
var KEYVALUE_HEADER_RE = /^([A-Za-z_][\w.-]*)\s*(?:=|:(?!\/\/))/;
|
|
@@ -3451,6 +3454,33 @@ function mergeParameters(pathLevelParams, ownParams) {
|
|
|
3451
3454
|
});
|
|
3452
3455
|
return [...inheritedParams, ...ownParams];
|
|
3453
3456
|
}
|
|
3457
|
+
function resolveJsonPointer(root, ref) {
|
|
3458
|
+
const parts = ref.slice(2).split("/").map((p) => p.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
3459
|
+
let cur = root;
|
|
3460
|
+
for (const part of parts) {
|
|
3461
|
+
if (typeof cur !== "object" || cur === null) return null;
|
|
3462
|
+
cur = cur[part];
|
|
3463
|
+
if (cur === void 0) return null;
|
|
3464
|
+
}
|
|
3465
|
+
return cur;
|
|
3466
|
+
}
|
|
3467
|
+
function dereferenceLocalRefs(node, root, seen) {
|
|
3468
|
+
if (Array.isArray(node)) return node.map((item) => dereferenceLocalRefs(item, root, seen));
|
|
3469
|
+
if (typeof node !== "object" || node === null) return node;
|
|
3470
|
+
const rec = node;
|
|
3471
|
+
const ref = rec["$ref"];
|
|
3472
|
+
if (typeof ref === "string" && ref.startsWith("#/")) {
|
|
3473
|
+
if (seen.has(ref)) return node;
|
|
3474
|
+
const target = resolveJsonPointer(root, ref);
|
|
3475
|
+
if (target === void 0 || target === null) return node;
|
|
3476
|
+
return dereferenceLocalRefs(target, root, /* @__PURE__ */ new Set([...seen, ref]));
|
|
3477
|
+
}
|
|
3478
|
+
const out = {};
|
|
3479
|
+
for (const [key, value] of Object.entries(rec)) {
|
|
3480
|
+
out[key] = dereferenceLocalRefs(value, root, seen);
|
|
3481
|
+
}
|
|
3482
|
+
return out;
|
|
3483
|
+
}
|
|
3454
3484
|
function extractOperations(spec) {
|
|
3455
3485
|
if (typeof spec !== "object" || spec === null) return [];
|
|
3456
3486
|
const paths = spec["paths"];
|
|
@@ -3473,9 +3503,9 @@ function extractOperations(spec) {
|
|
|
3473
3503
|
...typeof op["summary"] === "string" ? { summary: op["summary"] } : {},
|
|
3474
3504
|
...typeof op["description"] === "string" ? { description: op["description"] } : {},
|
|
3475
3505
|
...tags !== void 0 && tags.length > 0 ? { tags } : {},
|
|
3476
|
-
parameters: mergeParameters(pathLevelParams, ownParams),
|
|
3477
|
-
...op["requestBody"] !== void 0 ? { requestBody: op["requestBody"] } : {},
|
|
3478
|
-
responses: typeof op["responses"] === "object" && op["responses"] !== null ? op["responses"] : {}
|
|
3506
|
+
parameters: dereferenceLocalRefs(mergeParameters(pathLevelParams, ownParams), spec, /* @__PURE__ */ new Set()),
|
|
3507
|
+
...op["requestBody"] !== void 0 ? { requestBody: dereferenceLocalRefs(op["requestBody"], spec, /* @__PURE__ */ new Set()) } : {},
|
|
3508
|
+
responses: typeof op["responses"] === "object" && op["responses"] !== null ? dereferenceLocalRefs(op["responses"], spec, /* @__PURE__ */ new Set()) : {}
|
|
3479
3509
|
});
|
|
3480
3510
|
}
|
|
3481
3511
|
}
|
|
@@ -5105,6 +5135,7 @@ function findIdentifierNearPosition(ts, sourceFile, line0, position, name) {
|
|
|
5105
5135
|
|
|
5106
5136
|
// src/read_commands.ts
|
|
5107
5137
|
var DIDYOUMEAN_LIMIT = 5;
|
|
5138
|
+
var SYMBOL_PREVIEW_LINES = 5;
|
|
5108
5139
|
var AMBIGUOUS_HEADING_LIMIT = 10;
|
|
5109
5140
|
var TYPO_TWO_EDIT_MIN_LEN = 8;
|
|
5110
5141
|
var TYPO_MAX_QUERY_LEN = 64;
|
|
@@ -5657,9 +5688,13 @@ ${emptyIndexMessage(emptyIndexRoot)}`;
|
|
|
5657
5688
|
const goneTag = fileIsGone(sym.filePath) ? ` ${DELETED_TAG}` : "";
|
|
5658
5689
|
const header = `# ${sym.name} (${sym.kind}) \u2014 ${toDisplayPath(symbolDisplayRoot, sym.filePath)}:${sym.lineStart}-${sym.lineEnd}${statsStr}${goneTag}`;
|
|
5659
5690
|
const body = resolveBody(sym);
|
|
5660
|
-
const
|
|
5691
|
+
const bodyLines = body.split(/\r?\n/);
|
|
5692
|
+
const preview = bodyLines.slice(0, SYMBOL_PREVIEW_LINES).join("\n");
|
|
5693
|
+
const dropped = bodyLines.length - SYMBOL_PREVIEW_LINES;
|
|
5694
|
+
const elided = dropped > 0 ? `
|
|
5695
|
+
...(${countNoun(dropped, "more line")}; full body: token-goat read "${toDisplayPath(symbolDisplayRoot, sym.filePath)}::${sym.name}")` : "";
|
|
5661
5696
|
return preview.trim() !== "" ? `${header}
|
|
5662
|
-
${preview}` : header;
|
|
5697
|
+
${preview}${elided}` : header;
|
|
5663
5698
|
});
|
|
5664
5699
|
const warning = opts.file !== void 0 ? staleWarning(resolveIndexPath(opts.file, opts.projectRoot ?? process.cwd())) : "";
|
|
5665
5700
|
const text = guardText(warning + blocks.join("\n\n"), "symbol");
|
|
@@ -6773,8 +6808,29 @@ function runQueryCommand(opts, parse, formatLabel, guardTag, kind) {
|
|
|
6773
6808
|
function runJsonQuery(opts) {
|
|
6774
6809
|
return runQueryCommand(opts, JSON.parse, "JSON", "json-query", "json_query");
|
|
6775
6810
|
}
|
|
6811
|
+
function isPlainObject2(v) {
|
|
6812
|
+
return typeof v === "object" && v !== null && !Array.isArray(v) && Object.getPrototypeOf(v) === Object.prototype;
|
|
6813
|
+
}
|
|
6814
|
+
function resolveYamlMergeKeys(node) {
|
|
6815
|
+
if (Array.isArray(node)) return node.map(resolveYamlMergeKeys);
|
|
6816
|
+
if (!isPlainObject2(node)) return node;
|
|
6817
|
+
const merged = {};
|
|
6818
|
+
const mergeVal = node["<<"];
|
|
6819
|
+
if (mergeVal !== void 0) {
|
|
6820
|
+
const sources = Array.isArray(mergeVal) ? mergeVal : [mergeVal];
|
|
6821
|
+
for (const src of [...sources].reverse()) {
|
|
6822
|
+
const resolved = resolveYamlMergeKeys(src);
|
|
6823
|
+
if (isPlainObject2(resolved)) Object.assign(merged, resolved);
|
|
6824
|
+
}
|
|
6825
|
+
}
|
|
6826
|
+
for (const [key, value] of Object.entries(node)) {
|
|
6827
|
+
if (key === "<<") continue;
|
|
6828
|
+
merged[key] = resolveYamlMergeKeys(value);
|
|
6829
|
+
}
|
|
6830
|
+
return merged;
|
|
6831
|
+
}
|
|
6776
6832
|
function parseYamlDocument(text) {
|
|
6777
|
-
const docs = loadAll(text);
|
|
6833
|
+
const docs = loadAll(text).map(resolveYamlMergeKeys);
|
|
6778
6834
|
return docs.length === 1 ? docs[0] : docs;
|
|
6779
6835
|
}
|
|
6780
6836
|
function runYamlOutline(opts) {
|
|
@@ -7277,6 +7333,13 @@ async function runPdfMeta(file) {
|
|
|
7277
7333
|
const data = fs5.readFileSync(file);
|
|
7278
7334
|
return extractPdfMeta(new Uint8Array(data));
|
|
7279
7335
|
}
|
|
7336
|
+
async function runPdfLocate(file, pattern, opts) {
|
|
7337
|
+
if (!fileExists(file)) {
|
|
7338
|
+
throw new Error(`Could not read: ${file}`);
|
|
7339
|
+
}
|
|
7340
|
+
const data = fs5.readFileSync(file);
|
|
7341
|
+
return locatePdfPages(new Uint8Array(data), pattern, opts);
|
|
7342
|
+
}
|
|
7280
7343
|
async function runImageMeta(file) {
|
|
7281
7344
|
if (!fileExists(file)) {
|
|
7282
7345
|
throw new Error(`Could not read: ${file}`);
|
|
@@ -7286,7 +7349,15 @@ async function runImageMeta(file) {
|
|
|
7286
7349
|
}
|
|
7287
7350
|
const data = fs5.readFileSync(file);
|
|
7288
7351
|
const bytes = data.length;
|
|
7289
|
-
|
|
7352
|
+
let probe;
|
|
7353
|
+
try {
|
|
7354
|
+
probe = await probeImageMeta(data);
|
|
7355
|
+
} catch (e) {
|
|
7356
|
+
if (e instanceof ImageDecodeError) {
|
|
7357
|
+
throw new Error(`${file} is not a readable image: ${e.message}`, { cause: e });
|
|
7358
|
+
}
|
|
7359
|
+
throw e;
|
|
7360
|
+
}
|
|
7290
7361
|
if (probe === null) {
|
|
7291
7362
|
return { width: 0, height: 0, format: null, bytes, sharpAvailable: false, wouldShrink: false, shrunkBytes: null };
|
|
7292
7363
|
}
|
|
@@ -7311,6 +7382,9 @@ async function runImageText(file) {
|
|
|
7311
7382
|
const data = fs5.readFileSync(file);
|
|
7312
7383
|
const ocr = await ocrImage(data);
|
|
7313
7384
|
if (ocr === null) {
|
|
7385
|
+
if (isOcrEngineAvailable()) {
|
|
7386
|
+
throw new Error(`${file} could not be processed by OCR (unreadable image, timeout, or offline model fetch)`);
|
|
7387
|
+
}
|
|
7314
7388
|
return { ocrAvailable: false, confidence: 0, chars: 0, textHeavy: false, text: null };
|
|
7315
7389
|
}
|
|
7316
7390
|
const minConfidence = loadConfig().image_shrink.ocr_min_confidence;
|
|
@@ -9753,6 +9827,14 @@ function runScope(opts) {
|
|
|
9753
9827
|
const filePath = resolveIndexPath(file);
|
|
9754
9828
|
const syms = querySymbols({ filePath, limit: ALL_SYMBOLS_IN_FILE_LIMIT });
|
|
9755
9829
|
const enclosing = syms.filter((s) => s.lineStart <= line && line <= s.lineEnd).sort((a, b) => b.lineStart - a.lineStart);
|
|
9830
|
+
if (syms.length === 0) {
|
|
9831
|
+
if (!fs6.existsSync(filePath)) {
|
|
9832
|
+
emitErr2(`Could not read: ${file}`);
|
|
9833
|
+
return 1;
|
|
9834
|
+
}
|
|
9835
|
+
emitErr2(`No indexed symbols in '${file}' \u2014 the file exists but nothing is indexed for it, so every line looks empty`);
|
|
9836
|
+
return 1;
|
|
9837
|
+
}
|
|
9756
9838
|
if (enclosing.length === 0) {
|
|
9757
9839
|
emitErr2(`No symbols enclosing line ${line} in '${file}'`);
|
|
9758
9840
|
return 1;
|
|
@@ -10088,9 +10170,9 @@ function runBlame(opts) {
|
|
|
10088
10170
|
}
|
|
10089
10171
|
if (opts.json === true) {
|
|
10090
10172
|
const lines = raw.split("\n").filter((l) => l.length > 0).map((l) => {
|
|
10091
|
-
const m = /^([0-9a-f]+)\s+\((.+?)\s+(\d{4}-\d{2}-\d{2}[^)]*)\s+(\d+)\)(.*)/.exec(l);
|
|
10173
|
+
const m = /^(\^?)([0-9a-f]+)\s+\((.+?)\s+(\d{4}-\d{2}-\d{2}[^)]*)\s+(\d+)\)(.*)/.exec(l);
|
|
10092
10174
|
if (!m) return { raw: l };
|
|
10093
|
-
return { commit: m[1], author: (m[
|
|
10175
|
+
return { commit: m[2], boundary: m[1] === "^", author: (m[3] ?? "").trim(), date: (m[4] ?? "").trim(), line: Number.parseInt(m[5] ?? "0", 10), content: m[6] };
|
|
10094
10176
|
});
|
|
10095
10177
|
emit2(JSON.stringify({ symbol: sym.name, file: filePath, lines }, null, 2));
|
|
10096
10178
|
return 0;
|
|
@@ -10334,6 +10416,7 @@ export {
|
|
|
10334
10416
|
upsertNote,
|
|
10335
10417
|
isAvailable2 as isAvailable,
|
|
10336
10418
|
loadError,
|
|
10419
|
+
AMBIGUOUS_HEADING_LIMIT,
|
|
10337
10420
|
ConfinementIdentityError,
|
|
10338
10421
|
ABSENT_PIN,
|
|
10339
10422
|
pinKey,
|
|
@@ -10373,6 +10456,7 @@ export {
|
|
|
10373
10456
|
runPdfExtractText,
|
|
10374
10457
|
runPdfOutline,
|
|
10375
10458
|
runPdfMeta,
|
|
10459
|
+
runPdfLocate,
|
|
10376
10460
|
runImageMeta,
|
|
10377
10461
|
runImageText,
|
|
10378
10462
|
runScreenshot,
|
|
@@ -7,11 +7,11 @@ 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-
|
|
10
|
+
} from "./token-goat-chunk-2MWF3OGR.mjs";
|
|
11
|
+
import "./token-goat-chunk-LILS6TIU.mjs";
|
|
12
|
+
import "./token-goat-chunk-5MLXFSRI.mjs";
|
|
13
|
+
import "./token-goat-chunk-AM23GDIS.mjs";
|
|
14
|
+
import "./token-goat-chunk-IVCTQPZD.mjs";
|
|
15
15
|
import "./token-goat-chunk-AO2QD2AG.mjs";
|
|
16
16
|
import "./token-goat-chunk-AEX54RUZ.mjs";
|
|
17
17
|
export {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
loadConfig,
|
|
5
5
|
redactSecrets,
|
|
6
6
|
stripAnsiCodes
|
|
7
|
-
} from "./token-goat-chunk-
|
|
7
|
+
} from "./token-goat-chunk-IVCTQPZD.mjs";
|
|
8
8
|
|
|
9
9
|
// src/tool_filters/helpers.ts
|
|
10
10
|
import * as fs from "node:fs";
|
|
@@ -1424,7 +1424,7 @@ function makeLanguageFilter(cfg) {
|
|
|
1424
1424
|
var _GH_COPILOT_SPINNER_RE = /^\s*(?:Asking GitHub Copilot|Generating|Thinking|Fetching)\s*\.{0,3}\s*$/i;
|
|
1425
1425
|
var _GH_COPILOT_BANNER_RE = /^\s*(?:Welcome to GitHub Copilot|Using GitHub Copilot|Authenticated as|GitHub Copilot\s+v\d+)/i;
|
|
1426
1426
|
var _GH_COPILOT_DISCLAIMER_RE = /^\s*(?:Disclaimer:|This response was|GitHub Copilot|The commands?\s+(?:above|below)|Please review|Always review|Remember to|Note:|Tip:)/i;
|
|
1427
|
-
var _AIDER_APPLYING_RE = /^\s*(?:Applying\s+
|
|
1427
|
+
var _AIDER_APPLYING_RE = /^\s*(?:Applying\s+edits?(?:\s+to\s+\S+)?|Applied\s+edit\s+to\s+\S+)\s*(?:\.{1,3})?\s*$/i;
|
|
1428
1428
|
var _AIDER_TOKENS_RE = /^\s*Tokens:\s+\d[\d,]*\s+sent,\s+\d[\d,]*\s+received/i;
|
|
1429
1429
|
var _AIDER_COST_RE = /^\s*Cost:\s+\$[\d.]+\s+message,\s+\$[\d.]+\s+session/i;
|
|
1430
1430
|
var _AIDER_REPOMAP_RE = /^\s*(?:Repo-map:|Added\s+\S+\s+to\s+the\s+chat|Removed\s+\S+\s+from\s+the\s+chat|Loading\s+repo\s+map|Updating\s+repo\s+map|Scanning\s+repo\s+contents|Using\s+\d+\s+tokens\s+of\s+repo\s+map)/i;
|
|
@@ -4025,7 +4025,7 @@ var _TF_RESOURCE_COMPLETE_RE = /^[a-z0-9_.[\]"-]+: (?:Creation|Destruction|Modif
|
|
|
4025
4025
|
var _TF_PLAN_ATTR_DIFF_RE = /^\s+[~+-]\s+\S/;
|
|
4026
4026
|
var _TF_KNOWN_AFTER_APPLY_RE = /\(known after apply\)/;
|
|
4027
4027
|
var _TF_INIT_PROVIDER_RE = /^\s*-\s+(?:Finding|Installing|Installed|Downloading|Locking)\s+\S+/i;
|
|
4028
|
-
var _TF_SHOW_RESOURCE_HDR_RE = /^# (?:(?:module
|
|
4028
|
+
var _TF_SHOW_RESOURCE_HDR_RE = /^# (?:(?:module\.[^.\s]+\.)?[a-z][a-z0-9_]+\.[a-zA-Z0-9_.[\]-]+):$/;
|
|
4029
4029
|
var _TF_SHOW_KEY_ATTR_RE = /^\s+(?:id|arn|name|region|account_id|bucket|type|instance_type|endpoint|address|hostname|dns_name|tags(?:_all)?)\s*=/;
|
|
4030
4030
|
var TerraformFilter = class extends ToolFilter {
|
|
4031
4031
|
name = "terraform";
|
|
@@ -9030,7 +9030,7 @@ var LOG_WARN_RE = /\b(WARN(?:ING)?)\b|\[WARN(?:ING)?\]|level=warn/i;
|
|
|
9030
9030
|
var LOG_INFO_RE = /\b(INFO)\b|\[INFO\]|level=info/i;
|
|
9031
9031
|
var LOG_DEBUG_RE = /\b(DEBUG|TRACE|VERBOSE)\b|\[DEBUG\]|\[TRACE\]|level=(?:debug|trace)/i;
|
|
9032
9032
|
var LOG_ANY_RE = /\b(?:ERROR|FAIL(?:URE|ED)?|CRITICAL|EXCEPTION|FATAL|WARN(?:ING)?|INFO|DEBUG|TRACE|VERBOSE)\b|\[(?:ERROR|CRITICAL|FATAL|WARN(?:ING)?|INFO|DEBUG|TRACE)\]|level=(?:error|critical|fatal|warn|info|debug|trace)/i;
|
|
9033
|
-
var TRACE_CONTINUATION_RE = /^\s+(?:at |File "|in |\w+Error:|\w+Exception:)|^\s+\w+[\w.]+\(
|
|
9033
|
+
var TRACE_CONTINUATION_RE = /^\s+(?:at |File "|in |\w+Error:|\w+Exception:)|^\s+\w+[\w.]+\([^)\r\n]*\)$|^\s+\.{3}\s*\d+\s+more|^Caused by:|^During handling of the above exception/;
|
|
9034
9034
|
function scoreLogLine(line) {
|
|
9035
9035
|
if (LOG_LEVEL_RE.test(line)) return 1;
|
|
9036
9036
|
if (LOG_WARN_RE.test(line)) return 0.5;
|
|
@@ -9846,8 +9846,8 @@ function gitPositionalArgs(args) {
|
|
|
9846
9846
|
}
|
|
9847
9847
|
return out;
|
|
9848
9848
|
}
|
|
9849
|
-
var _GIT_CRLF_MODERN_RE = /^warning: in the working copy of '
|
|
9850
|
-
var _GIT_CRLF_WARNING_RE = /^warning: (?:LF will be replaced by CRLF|CRLF will be replaced by LF) in
|
|
9849
|
+
var _GIT_CRLF_MODERN_RE = /^warning: in the working copy of '[^']+', (?:LF will be replaced by CRLF|CRLF will be replaced by LF) the next time Git touches it\.?\r?$/m;
|
|
9850
|
+
var _GIT_CRLF_WARNING_RE = /^warning: (?:LF will be replaced by CRLF|CRLF will be replaced by LF) in [^\r\n]+\.?\r?$/;
|
|
9851
9851
|
var _GIT_CRLF_CONTINUATION_RE = /^The file will have its original line endings in your working directory\.?\r?$/;
|
|
9852
9852
|
function _stripGitCrlfWarnings(text) {
|
|
9853
9853
|
if (!text.includes("will be replaced by") && !text.includes("original line endings") && !text.includes("next time Git touches it")) {
|
|
@@ -11793,7 +11793,7 @@ var KtlintFilter = class _KtlintFilter extends ToolFilter {
|
|
|
11793
11793
|
}
|
|
11794
11794
|
};
|
|
11795
11795
|
var _SWIFTLINT_VIOLATION_RE = /^(.+\.swift):(\d+)(?::\d+)?: (warning|error|serious): (.+?) \(([a-z_]+)\)\s*$/i;
|
|
11796
|
-
var _SWIFTLINT_PROGRESS_RE = /^(Linting Swift files|Loading configuration|Linting '|Done linting!|Resolved \d|warning:
|
|
11796
|
+
var _SWIFTLINT_PROGRESS_RE = /^(?:Linting Swift files|Loading configuration|Linting '|Done linting!|Resolved \d|warning: [^\r\n]+ is deprecated|Ignoring '[^']+' in '|\s*$)/i;
|
|
11797
11797
|
var _SWIFTLINT_SUMMARY_RE = /^Done linting!/i;
|
|
11798
11798
|
var swiftlintFilter = makeLinterFilter({
|
|
11799
11799
|
name: "swiftlint",
|
|
@@ -12043,7 +12043,7 @@ var _CPPCHECK_PROGRESS_RE = /^\d+\/\d+\s+files\s+checked\s+\d+%\s+done/;
|
|
|
12043
12043
|
var _CPPCHECK_DIAGNOSTIC_RE = /^\[.+\.(?:c|cpp|cxx|cc|h|hpp|hxx):\d+\]:/;
|
|
12044
12044
|
var _CPPCHECK_DIAG_NOLINE_RE = /^\[.+\]:\s*\((?:error|warning|style|performance|portability|information)\)/i;
|
|
12045
12045
|
var _CPPCHECK_CONFIG_RE = /^(?:Checking\s+configuration|Active\s+checkers:|Enabled\s+checkers:|cppcheck:\s+(?:error:|warning:|note:))/i;
|
|
12046
|
-
var _CPPCHECK_SUMMARY_RE = /^(?:\d+\s+(?:error|warning|style|performance|portability)s?(?:\s+(?:found|detected))?|No\s+errors\s+found|Done\s+processing|cppcheck:\s
|
|
12046
|
+
var _CPPCHECK_SUMMARY_RE = /^(?:\d+\s+(?:error|warning|style|performance|portability)s?(?:\s+(?:found|detected))?|No\s+errors\s+found|Done\s+processing|cppcheck:\s+[^\r\n]*(?:done|finished)|\d+\s+unique\s+error)/i;
|
|
12047
12047
|
var CppcheckFilter = class extends ToolFilter {
|
|
12048
12048
|
name = "cppcheck";
|
|
12049
12049
|
binaries = /* @__PURE__ */ new Set(["cppcheck"]);
|
|
@@ -12215,14 +12215,14 @@ function dedupLines(lines, maxPerKey = 1, keyFn = (l) => l.trim()) {
|
|
|
12215
12215
|
}
|
|
12216
12216
|
var NPM_DEPRECATED_RE = /^npm warn deprecated\b/i;
|
|
12217
12217
|
var NPM_NOTICE_RE = /^npm notice\b/i;
|
|
12218
|
-
var NPM_NOTICE_LOCKFILE_RE = /^npm notice
|
|
12218
|
+
var NPM_NOTICE_LOCKFILE_RE = /^npm notice[^\r\n]*lock/i;
|
|
12219
12219
|
var NPM_ZERO_VULN_RE = /^found 0 vulnerabilities\b/i;
|
|
12220
12220
|
var NPM_FUNDING_RE = /^\d+\s+packages? are looking for funding\b/i;
|
|
12221
12221
|
var NPM_FUND_RUN_RE = /^\s*run `npm fund`/i;
|
|
12222
12222
|
var NPM_WARN_RE = /^npm warn\b/i;
|
|
12223
12223
|
var NPM_VERBOSE_RE = /^npm (?:timing|sill|http fetch|http request|http finish|verb)\b/i;
|
|
12224
12224
|
var NPM_REIFY_RE = /^[⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]\s/;
|
|
12225
|
-
var YARN_PEER_DEP_RE = /^warning "
|
|
12225
|
+
var YARN_PEER_DEP_RE = /^warning "[^"\r\n]+ > [^"\r\n]+" has (?:unmet|incorrect) peer dependency/i;
|
|
12226
12226
|
var YARN_PHASE_RE = /^\[\d+\/\d+\]/;
|
|
12227
12227
|
var YARN_FETCH_PHASE_RE = /^\[2\/4\]/;
|
|
12228
12228
|
var YARN_INFO_RE = /^info\b/i;
|
|
@@ -12233,7 +12233,7 @@ var YARN_BERRY_DONE_RE = /^➤\s+YN0000:\s+·\s+Done/;
|
|
|
12233
12233
|
var YARN_BERRY_PREFIX_RE = /^➤\s+YN\d{4}:/;
|
|
12234
12234
|
var PNPM_PLUS_BAR_RE = /^\++\s*$/;
|
|
12235
12235
|
var PNPM_PROGRESS_RE = /^Progress:/i;
|
|
12236
|
-
var PNPM_RESOLVER_PROGRESS_RE = /^\s*(?:Resolving|Downloading|Fetching)[:\s]
|
|
12236
|
+
var PNPM_RESOLVER_PROGRESS_RE = /^\s*(?:Resolving|Downloading|Fetching)[:\s][^\r\n]*\d+\/\d+|\s+\d+\s+packages?\s+(?:fetched|resolved|downloaded|linked)/;
|
|
12237
12237
|
var PNPM_SUMMARY_RE = /^(?:Packages:|Already up to date|Progress:|WARN|ERR!|added|removed|changed)/i;
|
|
12238
12238
|
var PNPM_LOCKFILE_RE = /^\s*(?:Lockfile|Saved|node_modules|symlink)/i;
|
|
12239
12239
|
var PIP_VERBOSE_DEBUG_RE = /^(?:DEBUG|VERBOSE|TRACE)\b/;
|
|
@@ -12266,13 +12266,13 @@ var BUNDLER_USING_RE = /^Using\s+\S+\s+[\d.]+/;
|
|
|
12266
12266
|
var BUNDLER_FETCH_INSTALL_RE = /^(?:Fetching|Installing)\s+\S+\s+[\d.]+/;
|
|
12267
12267
|
var COMPOSER_INSTALL_RE = /^\s+- Installing \S+ \(/;
|
|
12268
12268
|
var COMPOSER_DOWNLOADING_RE = /^\s+- Downloading \S+ \(/;
|
|
12269
|
-
var COMPOSER_DOWNLOAD_PROGRESS_RE = /^\s+- (?:Installing|Downloading)
|
|
12269
|
+
var COMPOSER_DOWNLOAD_PROGRESS_RE = /^\s+- (?:Installing|Downloading) [^\r\n]+\(\d+%\)/;
|
|
12270
12270
|
var COMPOSER_FUNDING_RE = /^\d+ packages? you are using are looking for funding/;
|
|
12271
12271
|
var COMPOSER_WARNING_RE = /^\s*(?:Warning|Deprecation|deprecated|constraint):/i;
|
|
12272
12272
|
var NUGET_INSTALLING_RE = /^\s*Installing\s+\S+\s+\d+\.\d+/i;
|
|
12273
12273
|
var NUGET_RESTORING_RE = /^\s*Restoring packages for\b/i;
|
|
12274
12274
|
var NUGET_OK_HTTPS_RE = /^\s*OK\s+https?:\/\//i;
|
|
12275
|
-
var NUGET_ALREADY_INSTALLED_RE = /^\s*Package\s+\S
|
|
12275
|
+
var NUGET_ALREADY_INSTALLED_RE = /^\s*Package\s+\S+[^\r\n]*\bis already installed/i;
|
|
12276
12276
|
var NUGET_SUCCESS_INSTALL_RE = /^\s*Successfully installed\s+/i;
|
|
12277
12277
|
var PUB_KEEP_RE2 = /^(?:Resolving dependencies|Changed \d+|No dependencies changed|Got dependencies|Downloading packages|Building package executable)/;
|
|
12278
12278
|
var PUB_PKG_LINE_RE2 = /^[+>!]\s+\S+\s+\S+/;
|
|
@@ -13278,7 +13278,7 @@ var PREAMBLE_RE = /^collecting\s/;
|
|
|
13278
13278
|
var HEADER_RE = /^=+\s*(?:test session starts|FAILURES|ERRORS|short test summary info|warnings summary|slowest \d+ durations|\d+ failed|\d+ passed|\d+ error)\b/;
|
|
13279
13279
|
var COV_TOTAL_RE = /^TOTAL\s+\d/;
|
|
13280
13280
|
var WARN_DOCS_RE = /^\s*--\s+Docs:\s+https?:\/\//;
|
|
13281
|
-
var WARN_MSG_RE = /^\s+\S
|
|
13281
|
+
var WARN_MSG_RE = /^\s+\S[^:\r\n]*:\d+:\s+\S[^\r\n]*Warning\b/;
|
|
13282
13282
|
var WARN_NODEID_RE = /^\S+::\S+/;
|
|
13283
13283
|
var SLOW_DURATION_RE = /^\d+\.\d+s\s+(?:call|setup|teardown)\s+\S/;
|
|
13284
13284
|
var FAIL_LINE_RE = /^(FAILED|ERROR|PASSED|SKIPPED|XFAIL|XPASS)\s+\S/;
|
package/dist/token-goat-hook.mjs
CHANGED
|
@@ -2,11 +2,11 @@ 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-chunk-
|
|
6
|
-
import "./token-goat-chunk-
|
|
7
|
-
import "./token-goat-chunk-
|
|
8
|
-
import "./token-goat-chunk-
|
|
9
|
-
import "./token-goat-chunk-
|
|
5
|
+
} from "./token-goat-chunk-KBVN4ELV.mjs";
|
|
6
|
+
import "./token-goat-chunk-5MLXFSRI.mjs";
|
|
7
|
+
import "./token-goat-chunk-AM23GDIS.mjs";
|
|
8
|
+
import "./token-goat-chunk-TF5NT3H5.mjs";
|
|
9
|
+
import "./token-goat-chunk-IVCTQPZD.mjs";
|
|
10
10
|
import "./token-goat-chunk-AO2QD2AG.mjs";
|
|
11
11
|
import "./token-goat-chunk-AEX54RUZ.mjs";
|
|
12
12
|
export {
|
package/dist/token-goat.core.mjs
CHANGED
|
@@ -2,13 +2,13 @@ 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-2MWF3OGR.mjs";
|
|
6
|
+
import "./token-goat-chunk-LILS6TIU.mjs";
|
|
7
|
+
import "./token-goat-chunk-5MLXFSRI.mjs";
|
|
8
|
+
import "./token-goat-chunk-AM23GDIS.mjs";
|
|
9
9
|
import {
|
|
10
10
|
installEpipeGuard
|
|
11
|
-
} from "./token-goat-chunk-
|
|
11
|
+
} from "./token-goat-chunk-IVCTQPZD.mjs";
|
|
12
12
|
import "./token-goat-chunk-AO2QD2AG.mjs";
|
|
13
13
|
import "./token-goat-chunk-AEX54RUZ.mjs";
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-goat",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.2",
|
|
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",
|
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
"typecheck:vscode-extension": "npm --prefix vscode-extension run compile",
|
|
31
31
|
"typecheck:vscode-extension:tests": "npm --prefix vscode-extension run typecheck:tests",
|
|
32
32
|
"dev": "tsx src/main.ts",
|
|
33
|
-
"prepare": "node scripts/install-git-hooks.mjs"
|
|
33
|
+
"prepare": "node scripts/install-git-hooks.mjs",
|
|
34
|
+
"schema:copilot": "node scripts/extract_harness_schema.mjs auto --harness copilot_cli --out schemas/copilot_cli.hooks.json",
|
|
35
|
+
"schema:copilot:check": "node scripts/extract_harness_schema.mjs auto --harness copilot_cli --out schemas/copilot_cli.hooks.json --check"
|
|
34
36
|
},
|
|
35
37
|
"contributors": [
|
|
36
38
|
{
|