token-goat 2.6.35 → 2.6.36

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.
Files changed (26) hide show
  1. package/README.md +4 -2
  2. package/SECURITY.md +3 -1
  3. package/dist/{token-goat-chunk-DRAIYVUI.mjs → token-goat-chunk-65BKISIS.mjs} +3 -3
  4. package/dist/{token-goat-chunk-UIZVX3HN.mjs → token-goat-chunk-CNDOJ3ZP.mjs} +2 -2
  5. package/dist/{token-goat-chunk-Y2NH6DGZ.mjs → token-goat-chunk-FRTBMRP7.mjs} +5 -5
  6. package/dist/{token-goat-chunk-D5IZEGN2.mjs → token-goat-chunk-IYTVE6KN.mjs} +13 -8
  7. package/dist/{token-goat-chunk-HW4VUKJ5.mjs → token-goat-chunk-KYFJC37X.mjs} +14 -13
  8. package/dist/{token-goat-chunk-YF67EWRH.mjs → token-goat-chunk-LN6OUHTV.mjs} +5 -5
  9. package/dist/{token-goat-hook-chunk-NIPXIAPA.mjs → token-goat-chunk-MGOUYAA2.mjs} +1 -1
  10. package/dist/{token-goat-chunk-I2KCEGIP.mjs → token-goat-chunk-UFOVM7ZN.mjs} +85 -45
  11. package/dist/{token-goat-chunk-K7W3P2TJ.mjs → token-goat-chunk-V465YKOR.mjs} +61 -17
  12. package/dist/{token-goat-chunk-SIHYQCTM.mjs → token-goat-chunk-VYMGEVZS.mjs} +16 -4
  13. package/dist/{token-goat-chunk-DQIT5JIF.mjs → token-goat-hook-chunk-3ZDBWJDF.mjs} +1 -1
  14. package/dist/{token-goat-hook-chunk-CRBMPT74.mjs → token-goat-hook-chunk-5UH54CW6.mjs} +16 -4
  15. package/dist/{token-goat-hook-chunk-VU6VGZBM.mjs → token-goat-hook-chunk-6ODM3MP7.mjs} +3 -3
  16. package/dist/{token-goat-hook-chunk-XM4W3WCO.mjs → token-goat-hook-chunk-A77A26A7.mjs} +85 -45
  17. package/dist/{token-goat-hook-chunk-4POU6OHK.mjs → token-goat-hook-chunk-BDR6C6IE.mjs} +5 -5
  18. package/dist/{token-goat-hook-chunk-3AAH72SO.mjs → token-goat-hook-chunk-C6GIABOX.mjs} +14 -13
  19. package/dist/{token-goat-hook-chunk-D6UJEFHX.mjs → token-goat-hook-chunk-E257IGSN.mjs} +2 -2
  20. package/dist/{token-goat-hook-chunk-NXVT4F3S.mjs → token-goat-hook-chunk-MW5HPEGD.mjs} +13 -8
  21. package/dist/{token-goat-hook-chunk-J4HKWUWZ.mjs → token-goat-hook-chunk-QSCYNJ2B.mjs} +5 -5
  22. package/dist/{token-goat-hook-chunk-2O7P4Z6Q.mjs → token-goat-hook-chunk-Y2WHX2P3.mjs} +61 -17
  23. package/dist/token-goat-hook.mjs +5 -5
  24. package/dist/token-goat.core.mjs +5 -5
  25. package/package.json +10 -9
  26. package/scripts/install-git-hooks.mjs +55 -0
package/README.md CHANGED
@@ -349,8 +349,10 @@ For archive/document work specifically, token-goat's bounded SQLite, XLSX, and P
349
349
  brew install ast-grep uv ruff ripgrep fd bat eza git-delta jq yq sd miller sqlite gh hyperfine fzf lazygit
350
350
 
351
351
  # Debian / Ubuntu — note the binary renames: rg=ripgrep, fd=fdfind, bat=batcat
352
- sudo apt install -y ripgrep fd-find bat jq sqlite3 fzf
353
- curl -LsSf https://astral.sh/uv/install.sh | sh # uv, then: uv tool install ruff
352
+ sudo apt install -y ripgrep fd-find bat jq sqlite3 fzf pipx
353
+ pipx install uv && pipx ensurepath # pipx puts uv in ~/.local/bin
354
+ export PATH="$HOME/.local/bin:$PATH" # this shell; ensurepath covers later ones
355
+ uv tool install ruff
354
356
  npm install -g @ast-grep/cli
355
357
  ```
356
358
 
package/SECURITY.md CHANGED
@@ -46,7 +46,7 @@ The following are not treated as security issues unless paired with a working pr
46
46
  | What you scan | Command | Result |
47
47
  | --- | --- | --- |
48
48
  | this repository | `npm audit` | clean, development dependencies included |
49
- | an install without optional packages | `npm install --omit=optional token-goat` then `npm audit --omit=dev --omit=optional` | clean, 46 packages |
49
+ | an install without optional packages | `npm install --omit=optional token-goat` then `npm audit --omit=dev --omit=optional` | clean, 40 packages |
50
50
  | a default install | `npm install token-goat` then `npm audit --omit=dev` | the optional packages in the table below |
51
51
 
52
52
  The repository is clean because [`package.json`](package.json) carries an `overrides` block that pins five transitive packages to patched versions. **npm applies `overrides` only in the root project**, so those pins do not travel to anyone who installs Token-Goat as a dependency. We are saying so plainly rather than letting a clean repository scan stand in for a clean install: if your scanner reads this repository or its lockfile it will report nothing, and that is not the whole picture.
@@ -63,6 +63,8 @@ Without the overrides a consumer resolves `protobufjs` at 6.x, which carries mor
63
63
 
64
64
  `html-to-text` used to appear in that table, carrying [`deepmerge-ts`](https://github.com/advisories/GHSA-ggr8-5vv4-36mx). It is now a development dependency instead. esbuild inlines it into `dist/token-goat.mjs` at build time and nothing in the published bundle imports it, so it was a runtime dependency in name only: moving it removes `html-to-text`, `deepmerge-ts`, `htmlparser2`, `selderee`, and `dom-serializer` from an installed copy while the HTML-to-text output stays byte-for-byte identical. That is what takes the no-optional install to zero, and it is better than the alternative we had considered, rolling `html-to-text` back to 9.x: that version pins `htmlparser2` two majors lower, and `htmlparser2` is what parses fetched pages, so it would have traded an advisory in an options merger for an older parser on the one path that handles untrusted input.
65
65
 
66
+ Five more packages were in `dependencies` for the same reason and have moved the same way: `commander`, `csv-parse`, `js-yaml`, `smol-toml` and `zod`. esbuild inlines each one into the bundle, and the published bundle resolves none of them, so a consumer was downloading code the artifact already carried. Moving them takes an install without optional packages from 46 packages to 40. `better-sqlite3` and `jsonc-parser` stay, because the bundle really does load them at run time: the first is a native addon, and the second is reached through `createRequire` rather than an import esbuild can inline. `zod` is the largest of the five on disk and the one that saves least in practice, because `@modelcontextprotocol/sdk` and `puppeteer-core` both depend on it and a default install still gets it from them.
67
+
66
68
  Direct dependencies with a forward patch are kept current rather than pinned: `sharp` and `puppeteer-core` were both moved across a major version to clear their advisories.
67
69
 
68
70
  For a scanner that ingests a bill of materials rather than a lockfile, `npm run sbom` writes CycloneDX 1.5 to stdout.
@@ -25,7 +25,7 @@ import {
25
25
  runSkeleton,
26
26
  runSymbol,
27
27
  withPinnedReads
28
- } from "./token-goat-chunk-D5IZEGN2.mjs";
28
+ } from "./token-goat-chunk-IYTVE6KN.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-I2KCEGIP.mjs";
37
+ } from "./token-goat-chunk-UFOVM7ZN.mjs";
38
38
  import {
39
39
  VERSION,
40
40
  dataDir,
@@ -45,7 +45,7 @@ import {
45
45
  normalizePath,
46
46
  recordStat,
47
47
  resolveProjectRoot
48
- } from "./token-goat-chunk-K7W3P2TJ.mjs";
48
+ } from "./token-goat-chunk-V465YKOR.mjs";
49
49
  import "./token-goat-chunk-AO2QD2AG.mjs";
50
50
  import "./token-goat-chunk-AEX54RUZ.mjs";
51
51
 
@@ -10,11 +10,11 @@ import {
10
10
  selectFilter,
11
11
  shlexSplit,
12
12
  wrappedShell
13
- } from "./token-goat-chunk-DQIT5JIF.mjs";
13
+ } from "./token-goat-chunk-MGOUYAA2.mjs";
14
14
  import {
15
15
  loadConfig,
16
16
  recordStat
17
- } from "./token-goat-chunk-K7W3P2TJ.mjs";
17
+ } from "./token-goat-chunk-V465YKOR.mjs";
18
18
  import "./token-goat-chunk-AO2QD2AG.mjs";
19
19
  import "./token-goat-chunk-AEX54RUZ.mjs";
20
20
 
@@ -10,7 +10,7 @@ import {
10
10
  isRewriteWorthwhile,
11
11
  resolveMinNetSavingsBytes,
12
12
  shlexSplit
13
- } from "./token-goat-chunk-DQIT5JIF.mjs";
13
+ } from "./token-goat-chunk-MGOUYAA2.mjs";
14
14
  import {
15
15
  BASH_OUTPUT_SUBDIR,
16
16
  HOOK_EVENTS,
@@ -29,7 +29,7 @@ import {
29
29
  storeBashOutput,
30
30
  storeWebOutput,
31
31
  summarizeOutputDelta
32
- } from "./token-goat-chunk-SIHYQCTM.mjs";
32
+ } from "./token-goat-chunk-VYMGEVZS.mjs";
33
33
  import {
34
34
  BODY_FIRST_TOOL_RESPONSE_KEYS,
35
35
  OUTPUT_FIRST_TOOL_RESPONSE_KEYS,
@@ -119,7 +119,7 @@ import {
119
119
  wasCliReadThisSession,
120
120
  wasFileReadThisSession,
121
121
  wasHintShown
122
- } from "./token-goat-chunk-I2KCEGIP.mjs";
122
+ } from "./token-goat-chunk-UFOVM7ZN.mjs";
123
123
  import {
124
124
  VERSION,
125
125
  detectHarness,
@@ -138,7 +138,7 @@ import {
138
138
  runGit,
139
139
  shortFingerprint,
140
140
  toKB
141
- } from "./token-goat-chunk-K7W3P2TJ.mjs";
141
+ } from "./token-goat-chunk-V465YKOR.mjs";
142
142
  import "./token-goat-chunk-AO2QD2AG.mjs";
143
143
  import "./token-goat-chunk-AEX54RUZ.mjs";
144
144
 
@@ -578,7 +578,7 @@ import crypto from "node:crypto";
578
578
  var TRACKED_SKILL = "token-goat";
579
579
  var MAX_COMMANDS_SHOWN = 8;
580
580
  async function currentCommandNames() {
581
- const { buildProgram } = await import("./token-goat-chunk-YF67EWRH.mjs");
581
+ const { buildProgram } = await import("./token-goat-chunk-LN6OUHTV.mjs");
582
582
  return flattenCommandNames(buildCommandManifest(buildProgram()));
583
583
  }
584
584
  async function recordSkillVersionSnapshot(sessionId, skillName) {
@@ -50,7 +50,7 @@ import {
50
50
  walkProject,
51
51
  yamlLineClosesQuote,
52
52
  yamlOpenQuoteAfter
53
- } from "./token-goat-chunk-I2KCEGIP.mjs";
53
+ } from "./token-goat-chunk-UFOVM7ZN.mjs";
54
54
  import {
55
55
  PER_FILE_COUNTERFACTUAL_CEILING,
56
56
  _detectOpenQuote,
@@ -83,6 +83,7 @@ import {
83
83
  loadConfig,
84
84
  normalizePath,
85
85
  offsetToLine,
86
+ pushAll,
86
87
  recordStat,
87
88
  redactIfDotenv,
88
89
  redactSecrets,
@@ -100,7 +101,7 @@ import {
100
101
  unsupportedLanguageName,
101
102
  windowsCmdQuoteArg,
102
103
  withExtension
103
- } from "./token-goat-chunk-K7W3P2TJ.mjs";
104
+ } from "./token-goat-chunk-V465YKOR.mjs";
104
105
  import {
105
106
  registerReset
106
107
  } from "./token-goat-chunk-AO2QD2AG.mjs";
@@ -563,9 +564,9 @@ function evalJsonPath(data, ops) {
563
564
  } else if (op.kind === "wildcard") {
564
565
  fanned = true;
565
566
  if (Array.isArray(item)) {
566
- next.push(...item);
567
+ pushAll(next, item);
567
568
  } else if (typeof item === "object" && item !== null) {
568
- next.push(...Object.values(item));
569
+ pushAll(next, Object.values(item));
569
570
  }
570
571
  } else {
571
572
  fanned = true;
@@ -997,7 +998,7 @@ function queryXml(xmlText, pathStr) {
997
998
  const attrName = step.attributeSelect;
998
999
  for (const cand of currentCandidates) {
999
1000
  if (attrName === "*") {
1000
- attrVals.push(...Object.values(cand.attributes));
1001
+ pushAll(attrVals, Object.values(cand.attributes));
1001
1002
  } else if (cand.attributes[attrName] !== void 0) {
1002
1003
  attrVals.push(cand.attributes[attrName]);
1003
1004
  }
@@ -1046,7 +1047,7 @@ function queryXml(xmlText, pathStr) {
1046
1047
  if (step.allIndices || matching.length > 1 || step.attributeFilter !== void 0) {
1047
1048
  hasFanned = true;
1048
1049
  }
1049
- nextCandidates.push(...matching);
1050
+ pushAll(nextCandidates, matching);
1050
1051
  }
1051
1052
  }
1052
1053
  currentCandidates = nextCandidates;
@@ -6552,6 +6553,10 @@ function mergeListingJson(files, blocks, anyOk) {
6552
6553
  const payload = { items, truncated, totalCount, ...errors.length > 0 ? { errors } : {} };
6553
6554
  return { text: JSON.stringify(payload, null, 2), code: anyOk ? 0 : 1 };
6554
6555
  }
6556
+ function symbolCountLabel(shown, truncated, trueCount) {
6557
+ if (!truncated || trueCount === void 0 || trueCount <= shown) return countNoun(shown, "symbol");
6558
+ return `${shown} of ${countNoun(trueCount, "symbol")}`;
6559
+ }
6555
6560
  function runSkeleton(opts) {
6556
6561
  const multiFiles = parseMultiFileSpec(opts.file);
6557
6562
  if (multiFiles !== null) return runPerFileListing(multiFiles, (file) => runSkeleton({ ...opts, file, includeFilePath: true }), opts.json === true);
@@ -6584,7 +6589,7 @@ function runSkeleton(opts) {
6584
6589
  return { text: text2, code: 0 };
6585
6590
  }
6586
6591
  const totalLines = filtered.length > 0 ? Math.max(...filtered.map((s) => s.lineEnd)) : 0;
6587
- const lines = [`# Skeleton: ${opts.file} (${countNoun(filtered.length, "symbol")}, ${countNoun(totalLines, "line")})`];
6592
+ const lines = [`# Skeleton: ${opts.file} (${symbolCountLabel(filtered.length, symbolsTruncated, trueSymbolCount)}, ${countNoun(totalLines, "line")})`];
6588
6593
  if (filtered.length === 0 && preFilterCount > 0) lines.push(filteredToEmptyNotice(preFilterCount, opts.minLines, opts.grep));
6589
6594
  for (const sym of filtered) {
6590
6595
  const lineStr = sym.lineStart.toString().padStart(6);
@@ -6626,7 +6631,7 @@ function runOutline(opts) {
6626
6631
  recordReadStat("outline", fullSourceBytes, text2, opts.file);
6627
6632
  return { text: text2, code: 0 };
6628
6633
  }
6629
- const lines = [`# Outline: ${opts.file} (${countNoun(filtered.length, "symbol")})`];
6634
+ const lines = [`# Outline: ${opts.file} (${symbolCountLabel(filtered.length, symbolsTruncated, trueSymbolCount)})`];
6630
6635
  if (filtered.length === 0 && preFilterCount > 0) lines.push(filteredToEmptyNotice(preFilterCount, opts.minLines, opts.grep));
6631
6636
  for (const sym of filtered) {
6632
6637
  const rangeStr = `${sym.lineStart.toString().padStart(4)}-${sym.lineEnd.toString().padEnd(6)}`;
@@ -84,7 +84,7 @@ import {
84
84
  runZipRead,
85
85
  symbolNamesInFile,
86
86
  upsertNote
87
- } from "./token-goat-chunk-D5IZEGN2.mjs";
87
+ } from "./token-goat-chunk-IYTVE6KN.mjs";
88
88
  import {
89
89
  BASH_OUTPUT_SUBDIR,
90
90
  GEMINI_TOOL_NAME_MAP,
@@ -105,7 +105,7 @@ import {
105
105
  readStdinJson,
106
106
  searchRecall,
107
107
  storeWebOutput
108
- } from "./token-goat-chunk-SIHYQCTM.mjs";
108
+ } from "./token-goat-chunk-VYMGEVZS.mjs";
109
109
  import {
110
110
  AGENT_SALT_MARKER,
111
111
  CONTEXT_AUTOCOMPACT_TOKENS,
@@ -243,7 +243,7 @@ import {
243
243
  vscodeDecoderConfigured,
244
244
  walkProject,
245
245
  writeCompact
246
- } from "./token-goat-chunk-I2KCEGIP.mjs";
246
+ } from "./token-goat-chunk-UFOVM7ZN.mjs";
247
247
  import {
248
248
  C,
249
249
  CONFIG_KEY_ENV_OVERRIDES,
@@ -294,6 +294,8 @@ import {
294
294
  normalizePath,
295
295
  pad,
296
296
  parse,
297
+ pushAll,
298
+ readConfigSource,
297
299
  recordStat,
298
300
  redactIfDotenv,
299
301
  redactUrlQuery,
@@ -322,7 +324,7 @@ import {
322
324
  withFileLock,
323
325
  withRetryOnLock,
324
326
  writeJsonSettings
325
- } from "./token-goat-chunk-K7W3P2TJ.mjs";
327
+ } from "./token-goat-chunk-V465YKOR.mjs";
326
328
  import {
327
329
  __export
328
330
  } from "./token-goat-chunk-AEX54RUZ.mjs";
@@ -5873,7 +5875,7 @@ function checkConfigValid(configPath2) {
5873
5875
  };
5874
5876
  }
5875
5877
  try {
5876
- const content = fs12.readFileSync(configPath2, "utf-8");
5878
+ const content = readConfigSource(configPath2);
5877
5879
  parse(content);
5878
5880
  return {
5879
5881
  name: "Config",
@@ -9561,7 +9563,7 @@ function collectTodoFiles(patterns) {
9561
9563
  try {
9562
9564
  const stat = fs16.statSync(abs);
9563
9565
  if (stat.isDirectory()) {
9564
- results.push(...walkProject(abs).files);
9566
+ pushAll(results, walkProject(abs).files);
9565
9567
  } else {
9566
9568
  results.push(abs);
9567
9569
  }
@@ -9579,7 +9581,7 @@ function cmdTodo(patterns, opts) {
9579
9581
  const files = collectTodoFiles(patterns);
9580
9582
  const items = [];
9581
9583
  for (const f of files) {
9582
- items.push(...scanFileForTodos(f, kindSet));
9584
+ pushAll(items, scanFileForTodos(f, kindSet));
9583
9585
  }
9584
9586
  if (opts.json === true) {
9585
9587
  process.stdout.write(JSON.stringify({ items }, null, 2) + "\n");
@@ -11332,7 +11334,7 @@ function reclaimIndex(dbPath, opts = {}) {
11332
11334
  db.prepare(`DELETE FROM "${table}"`).run();
11333
11335
  dropped[table] = before;
11334
11336
  }
11335
- })();
11337
+ }).immediate();
11336
11338
  if (tableExists(db, "symbols_fts")) {
11337
11339
  try {
11338
11340
  db.prepare(`INSERT INTO symbols_fts(symbols_fts) VALUES('rebuild')`).run();
@@ -11701,8 +11703,7 @@ function cmdConfig(opts) {
11701
11703
  let raw = {};
11702
11704
  let parseErr = null;
11703
11705
  try {
11704
- const text = fs19.readFileSync(cfgFile, "utf8");
11705
- raw = parse(text);
11706
+ raw = parse(readConfigSource(cfgFile));
11706
11707
  } catch (e) {
11707
11708
  const code = e.code;
11708
11709
  if (code !== "ENOENT") {
@@ -13446,7 +13447,7 @@ async function cmdMcpServe() {
13446
13447
  let StdioServerTransport;
13447
13448
  try {
13448
13449
  ;
13449
- ({ createMcpServer } = await import("./token-goat-chunk-DRAIYVUI.mjs"));
13450
+ ({ createMcpServer } = await import("./token-goat-chunk-65BKISIS.mjs"));
13450
13451
  ({ StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js"));
13451
13452
  } catch (err2) {
13452
13453
  process.stderr.write(
@@ -13467,7 +13468,7 @@ async function cmdHook(event, opts) {
13467
13468
  if (typeof opts.harness === "string" && opts.harness.length > 0) {
13468
13469
  process.env[ENV_KEYS.HARNESS_OVERRIDE] = opts.harness;
13469
13470
  }
13470
- const { relay } = await import("./token-goat-chunk-Y2NH6DGZ.mjs");
13471
+ const { relay } = await import("./token-goat-chunk-FRTBMRP7.mjs");
13471
13472
  await relay(event);
13472
13473
  }
13473
13474
  async function cmdInstall(opts) {
@@ -14324,7 +14325,7 @@ function emitExtraFileArgsNote(command, first, extras, opts = {}) {
14324
14325
  }
14325
14326
  async function cmdCompress(opts) {
14326
14327
  try {
14327
- const bashRunner = await import("./token-goat-chunk-UIZVX3HN.mjs");
14328
+ const bashRunner = await import("./token-goat-chunk-CNDOJ3ZP.mjs");
14328
14329
  if (opts.compress === false) {
14329
14330
  process.exitCode = bashRunner.runRaw(opts.cmd, parseTimeout(opts.timeout, bashRunner.DEFAULT_TIMEOUT_SECONDS));
14330
14331
  return;
@@ -7,11 +7,11 @@ import {
7
7
  expandGlobs,
8
8
  leftoverIntegrations,
9
9
  run
10
- } from "./token-goat-chunk-HW4VUKJ5.mjs";
11
- import "./token-goat-chunk-D5IZEGN2.mjs";
12
- import "./token-goat-chunk-SIHYQCTM.mjs";
13
- import "./token-goat-chunk-I2KCEGIP.mjs";
14
- import "./token-goat-chunk-K7W3P2TJ.mjs";
10
+ } from "./token-goat-chunk-KYFJC37X.mjs";
11
+ import "./token-goat-chunk-IYTVE6KN.mjs";
12
+ import "./token-goat-chunk-VYMGEVZS.mjs";
13
+ import "./token-goat-chunk-UFOVM7ZN.mjs";
14
+ import "./token-goat-chunk-V465YKOR.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-hook-chunk-2O7P4Z6Q.mjs";
7
+ } from "./token-goat-chunk-V465YKOR.mjs";
8
8
 
9
9
  // src/tool_filters/helpers.ts
10
10
  import * as fs from "node:fs";