token-goat 2.8.1 → 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 CHANGED
@@ -395,7 +395,7 @@ This writes hook entries into `~/.gemini/settings.json` using Gemini CLI's `Befo
395
395
  token-goat install --qwen
396
396
  ```
397
397
 
398
- This writes hook entries into `~/.qwen/settings.json`. Unlike Gemini CLI (its own ancestor, with a custom `BeforeTool`/`AfterTool`/`PreCompress` event/matcher scheme), Qwen Code's hooks system diverged and now mirrors Claude Code's own natively — `PreToolUse`/`PostToolUse`/`PreCompact`/`UserPromptSubmit`/`SubagentStop` event names and snake_case stdin JSON — so token-goat wires all five events with no wire-format translation needed. Qwen Code's own tool-name taxonomy is only partially documented, so token-goat uses a catch-all matcher per event rather than an incomplete per-tool list. Image shrinking, session hints, post-edit indexing, compact assist, and bash output compression all work. This bridge was built from QwenLM/qwen-code's published docs, not dogfooded against a live Qwen Code install — if hooks aren't firing, `token-goat doctor` and the settings.json contents are the first things to check. To remove: `token-goat uninstall --qwen`.
398
+ This writes hook entries into `~/.qwen/settings.json`. Unlike Gemini CLI (its own ancestor, with a custom `BeforeTool`/`AfterTool`/`PreCompress` event/matcher scheme), Qwen Code's hooks system diverged and now mirrors Claude Code's own natively — `PreToolUse`/`PostToolUse`/`PreCompact`/`UserPromptSubmit`/`SubagentStop` event names and snake_case stdin JSON — so token-goat wires all five events with no wire-format translation needed. Qwen Code's own tool-name taxonomy is only partially documented, so token-goat uses a catch-all matcher per event rather than an incomplete per-tool list. Image shrinking, session hints, post-edit indexing, compact assist, and bash output compression all work. This bridge was built from QwenLM/qwen-code's published docs, not tested against a live Qwen Code install — if hooks aren't firing, `token-goat doctor` and the settings.json contents are the first things to check. To remove: `token-goat uninstall --qwen`.
399
399
 
400
400
  ### Kimi Code users
401
401
 
@@ -403,7 +403,7 @@ This writes hook entries into `~/.qwen/settings.json`. Unlike Gemini CLI (its ow
403
403
  token-goat install --kimi
404
404
  ```
405
405
 
406
- This writes `[[hooks]]` entries into `~/.kimi-code/config.toml` (or `$KIMI_CODE_HOME/config.toml`), covering Kimi Code's `PreToolUse`, `PostToolUse`, `PreCompact`, `UserPromptSubmit`, `SubagentStop`, and `SessionStart` events. Kimi Code sends a Claude-Code-shaped snake_case payload on stdin, but it reads a different response: only a top-level `message` and `hookSpecificOutput.permissionDecision` / `permissionDecisionReason`. So the install also writes a small shim at `~/.kimi-code/hooks/token-goat-shim.js` that translates token-goat's answer into that contract, turns a hint into `message`, and writes nothing at all for a no-op. Image shrinking, session hints, post-edit indexing, compact assist, and bash output compression all work. `Notification` and `Stop` are not wired, because token-goat has no handler for them. Input and output rewriting are not wired either: Kimi Code offers no channel to replace a tool's input or its result. This bridge was built from MoonshotAI/kimi-code's own source and docs, not dogfooded against a live Kimi Code install, so if hooks are not firing, `token-goat doctor` and the `config.toml` contents are the first things to check. To remove: `token-goat uninstall --kimi`.
406
+ This writes `[[hooks]]` entries into `~/.kimi-code/config.toml` (or `$KIMI_CODE_HOME/config.toml`), covering Kimi Code's `PreToolUse`, `PostToolUse`, `PreCompact`, `UserPromptSubmit`, `SubagentStop`, and `SessionStart` events. Kimi Code sends a Claude-Code-shaped snake_case payload on stdin, but it reads a different response: only a top-level `message` and `hookSpecificOutput.permissionDecision` / `permissionDecisionReason`. So the install also writes a small shim at `~/.kimi-code/hooks/token-goat-shim.js` that translates token-goat's answer into that contract, turns a hint into `message`, and writes nothing at all for a no-op. Image shrinking, session hints, post-edit indexing, compact assist, and bash output compression all work. `Notification` and `Stop` are not wired, because token-goat has no handler for them. Input and output rewriting are not wired either: Kimi Code offers no channel to replace a tool's input or its result. This bridge was built from MoonshotAI/kimi-code's own source and docs, not tested against a live Kimi Code install, so if hooks are not firing, `token-goat doctor` and the `config.toml` contents are the first things to check. To remove: `token-goat uninstall --kimi`.
407
407
 
408
408
  ### opencode users
409
409
 
@@ -423,7 +423,7 @@ The `--openclaw` flag patches Claude Code and registers a TypeScript bridge plug
423
423
 
424
424
  What works: **bash output compression**, **re-read denial** and **surgical-read redirects for oversized first reads**, **image shrinking**, and **post-edit indexing** (all via `before_tool_call`/`after_tool_call`). What doesn't: **session hints** — OpenClaw's tool-call hooks have no context-injection channel, only param rewriting — and the **compaction manifest** — OpenClaw's `before_compaction`/`after_compaction` are observation-only, with no return-value mechanism to inject a manifest into the next turn the way pi's compaction hooks do.
425
425
 
426
- This bridge has not been validated against a live OpenClaw instance — it's built from OpenClaw's documented plugin SDK and hook event types, not dogfooded against a real running gateway. If tool calls aren't being intercepted, the built-in tool name list in `openclaw.ts`'s `TOOL_TO_TG` map is the first thing to check. To remove: `token-goat uninstall --openclaw`.
426
+ This bridge has not been validated against a live OpenClaw instance — it's built from OpenClaw's documented plugin SDK and hook event types, not tested against a real running gateway. If tool calls aren't being intercepted, the built-in tool name list in `openclaw.ts`'s `TOOL_TO_TG` map is the first thing to check. To remove: `token-goat uninstall --openclaw`.
427
427
 
428
428
  ### pi users
429
429
 
@@ -86,7 +86,7 @@ import {
86
86
  runZipRead,
87
87
  symbolNamesInFile,
88
88
  upsertNote
89
- } from "./token-goat-chunk-RMDQFTQD.mjs";
89
+ } from "./token-goat-chunk-LILS6TIU.mjs";
90
90
  import {
91
91
  BASH_OUTPUT_SUBDIR,
92
92
  GEMINI_TOOL_NAME_MAP,
@@ -113,7 +113,7 @@ import {
113
113
  searchRecall,
114
114
  storeWebOutput,
115
115
  summarizeResidentContext
116
- } from "./token-goat-chunk-XEDQH5DA.mjs";
116
+ } from "./token-goat-chunk-5MLXFSRI.mjs";
117
117
  import {
118
118
  AGENT_SALT_MARKER,
119
119
  CONTEXT_AUTOCOMPACT_TOKENS,
@@ -256,7 +256,7 @@ import {
256
256
  vscodeDecoderConfigured,
257
257
  walkProject,
258
258
  writeCompact
259
- } from "./token-goat-chunk-2G6RAB4G.mjs";
259
+ } from "./token-goat-chunk-AM23GDIS.mjs";
260
260
  import {
261
261
  C,
262
262
  CONFIG_KEY_ENV_OVERRIDES,
@@ -338,11 +338,14 @@ import {
338
338
  withFileLock,
339
339
  withRetryOnLock,
340
340
  writeJsonSettings
341
- } from "./token-goat-chunk-ELDJRLHZ.mjs";
341
+ } from "./token-goat-chunk-IVCTQPZD.mjs";
342
342
  import {
343
343
  __export
344
344
  } from "./token-goat-chunk-AEX54RUZ.mjs";
345
345
 
346
+ // src/cli.ts
347
+ import { randomBytes } from "node:crypto";
348
+
346
349
  // node_modules/commander/lib/error.js
347
350
  var CommanderError = class extends Error {
348
351
  /**
@@ -4084,7 +4087,8 @@ var PI_EXTENSION_SCRIPT = `// token-goat bridge extension for pi (pi-coding-agen
4084
4087
  // Bridges pi's extension events to token-goat's subprocess hook protocol.
4085
4088
  // https://github.com/DFKHelper/token-goat
4086
4089
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
4087
- import { spawnSync } from "node:child_process";
4090
+ import { spawnSync } from "node:child_process"
4091
+ import crypto from "node:crypto";
4088
4092
  import * as fs from "node:fs";
4089
4093
  import * as os from "node:os";
4090
4094
  import * as path from "node:path";
@@ -4543,6 +4547,7 @@ var OPENCODE_PLUGIN_SCRIPT = `// token-goat bridge plugin for opencode
4543
4547
  // Bridges opencode's plugin hooks to token-goat's subprocess hook protocol.
4544
4548
  // https://github.com/DFKHelper/token-goat
4545
4549
  import { spawnSync } from "node:child_process"
4550
+ import crypto from "node:crypto"
4546
4551
  import fs from "node:fs"
4547
4552
  import os from "node:os"
4548
4553
  import path from "node:path"
@@ -9976,7 +9981,7 @@ function parseNodeBlock(lines, start) {
9976
9981
  }
9977
9982
  return { block: { frames, exception: header }, nextIndex: i };
9978
9983
  }
9979
- var RUST_PANIC_HEADER_RE = /^thread '[^']*' panicked at (.+):(\d+):(\d+):\s*$/;
9984
+ var RUST_PANIC_HEADER_RE = /^thread '[^']*' panicked at ([^:\r\n]+):(\d+):(\d+):\s*$/;
9980
9985
  var RUST_BACKTRACE_NOTE_RE = /^note: run with `RUST_BACKTRACE=1`/;
9981
9986
  var RUST_BACKTRACE_NUM_RE = /^\s*\d+:\s+(.+)$/;
9982
9987
  var RUST_BACKTRACE_AT_RE = /^\s+at\s+(.+):(\d+):(\d+)\s*$/;
@@ -10022,7 +10027,7 @@ function parseRustBlock(lines, start) {
10022
10027
  }
10023
10028
  return { block: { frames: [panicFrame], exception }, nextIndex: i };
10024
10029
  }
10025
- var JVM_HEADER_RE = /^(?:Exception in thread "[^"]*" )?(?:Caused by: )?((?:[A-Za-z_$][\w$]*\.)+[A-Za-z_$][\w$]*): (.*)$/;
10030
+ var JVM_HEADER_RE = /^(?:Exception in thread "[^"\r\n]*" )?(?:Caused by: )?((?:[A-Za-z_$][\w$]*\.)+[A-Za-z_$][\w$]*): (.*)$/;
10026
10031
  var JVM_FRAME_RE = /^\s+at\s+(\S+)\(([^)]*)\)\s*$/;
10027
10032
  var JVM_MORE_RE = /^\s*\.\.\.\s+\d+\s+more\s*$/;
10028
10033
  function parseJvmFrameLine(line) {
@@ -14038,7 +14043,7 @@ async function cmdMcpServe() {
14038
14043
  let StdioServerTransport;
14039
14044
  try {
14040
14045
  ;
14041
- ({ createMcpServer } = await import("./token-goat-chunk-73MF6YWW.mjs"));
14046
+ ({ createMcpServer } = await import("./token-goat-chunk-AL644JUV.mjs"));
14042
14047
  ({ StdioServerTransport } = await import("./token-goat-chunk-324QOJYZ.mjs"));
14043
14048
  } catch (err2) {
14044
14049
  process.stderr.write(
@@ -14063,7 +14068,7 @@ async function cmdHook(event, opts) {
14063
14068
  if (typeof opts.harness === "string" && opts.harness.length > 0) {
14064
14069
  process.env[ENV_KEYS.HARNESS_OVERRIDE] = opts.harness;
14065
14070
  }
14066
- const { relay } = await import("./token-goat-chunk-YUGNM3KL.mjs");
14071
+ const { relay } = await import("./token-goat-chunk-JU7QESB3.mjs");
14067
14072
  await relay(event);
14068
14073
  }
14069
14074
  async function cmdInstall(opts) {
@@ -14958,7 +14963,7 @@ function emitExtraFileArgsNote(command, first, extras, opts = {}) {
14958
14963
  }
14959
14964
  async function cmdCompress(opts) {
14960
14965
  try {
14961
- const bashRunner = await import("./token-goat-chunk-I6TOUPLP.mjs");
14966
+ const bashRunner = await import("./token-goat-chunk-BTZSUIYA.mjs");
14962
14967
  if (opts.compress === false) {
14963
14968
  process.exitCode = bashRunner.runRaw(opts.cmd, parseTimeout(opts.timeout, bashRunner.DEFAULT_TIMEOUT_SECONDS));
14964
14969
  return;
@@ -15227,7 +15232,7 @@ function atomicWriteBuffer(dest, data) {
15227
15232
  } catch (e) {
15228
15233
  if (e.code !== "ENOENT") throw e;
15229
15234
  }
15230
- const rnd = Math.random().toString(36).slice(2, 8);
15235
+ const rnd = randomBytes(4).toString("hex");
15231
15236
  const tmp = path27.join(path27.dirname(path27.resolve(dest)), `.tmp.${process.pid}.${rnd}`);
15232
15237
  try {
15233
15238
  fs27.writeFileSync(tmp, data, { mode: 384 });
@@ -8,7 +8,7 @@ import {
8
8
  loadBlob,
9
9
  sanitizeFtsQuery,
10
10
  storeBlob
11
- } from "./token-goat-chunk-2G6RAB4G.mjs";
11
+ } from "./token-goat-chunk-AM23GDIS.mjs";
12
12
  import {
13
13
  SYMBOL_BODY_CHAR_CAP,
14
14
  extractErrorMessage,
@@ -18,7 +18,7 @@ import {
18
18
  redactSecrets,
19
19
  runGit,
20
20
  shortFingerprint
21
- } from "./token-goat-chunk-ELDJRLHZ.mjs";
21
+ } from "./token-goat-chunk-IVCTQPZD.mjs";
22
22
  import {
23
23
  registerReset
24
24
  } from "./token-goat-chunk-AO2QD2AG.mjs";
@@ -404,10 +404,10 @@ var COMMAND_PATTERNS = {
404
404
  gitImmutable: /^\s*git\s+show\s+[0-9a-f]{40}\b/i,
405
405
  gitDiffScoped: /\s--\s+\S/,
406
406
  dirListing: /^\s*(?:ls|eza|exa|dir|Get-ChildItem|gci)\b/i,
407
- depList: /^\s*(?:npm\s+(?:-\S+\s+)*(?:ls|list)\b|pip\s+(?:-\S+\s+)*(?:list|freeze)\b|uv\s+pip\s+(?:-\S+\s+)*(?:list|freeze)\b|pnpm\s+(?:-\S+\s+)*(?:list|ls)\b|yarn\s+(?:-\S+\s+)*(?:list)\b|cargo\s+(?:-\S+\s+)*tree\b|bundle\s+(?:-\S+\s+)*(?:list|show)\b|composer\s+(?:-\S+\s+)*show\b)/i,
408
- npmInstall: /^\s*npm\s+(?:-\S+\s+)*(?:install|ci)\b/i,
409
- npmAudit: /^\s*npm\s+(?:-\S+\s+)*audit\b(?!.*(?:--fix|fix)\b)/i,
410
- npmOutdated: /^\s*npm\s+(?:-\S+\s+)*outdated\b/i,
407
+ depList: /^\s*(?:npm\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*(?:ls|list)\b|pip\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*(?:list|freeze)\b|uv\s+pip\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*(?:list|freeze)\b|pnpm\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*(?:list|ls)\b|yarn\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*(?:list)\b|cargo\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*tree\b|bundle\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*(?:list|show)\b|composer\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*show\b)/i,
408
+ npmInstall: /^\s*npm\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*(?:install|ci)\b/i,
409
+ npmAudit: /^\s*npm\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*audit\b(?!.*(?:--fix|fix)\b)/i,
410
+ npmOutdated: /^\s*npm\s+(?:--?[a-zA-Z0-9_-]+(?:\s+|=)?)*outdated\b/i,
411
411
  envProbe: /^\s*(?:node\s+(?:-v|--version)|npm\s+(?:-v|--version)|python3?\s+(?:(?:-V)\b|--?version)|git\s+--version|uv\s+--version|go\s+version|rustc\s+--version|cargo\s+--version|java\s+--version|ruby\s+--version|gem\s+--version|php\s+--version|which\b|where\b)/i,
412
412
  npx: /^\s*npx\s+(?:--?yes\s+)?(?!.*\b(?:install|add|remove|uninstall|i|rm|update|upgrade|set|get|publish|link|ci|audit|shrinkwrap|dedupe|prune|rebuild)\b)/i,
413
413
  gitPush: /^\s*git\s+push\b/i,
@@ -25,7 +25,7 @@ import {
25
25
  runSkeleton,
26
26
  runSymbol,
27
27
  withPinnedReads
28
- } from "./token-goat-chunk-RMDQFTQD.mjs";
28
+ } from "./token-goat-chunk-LILS6TIU.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-2G6RAB4G.mjs";
37
+ } from "./token-goat-chunk-AM23GDIS.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-ELDJRLHZ.mjs";
48
+ } from "./token-goat-chunk-IVCTQPZD.mjs";
49
49
  import "./token-goat-chunk-AO2QD2AG.mjs";
50
50
  import "./token-goat-chunk-AEX54RUZ.mjs";
51
51
 
@@ -91,7 +91,7 @@ import {
91
91
  withFileLock,
92
92
  writeIfDifferent,
93
93
  writeJsonSettings
94
- } from "./token-goat-chunk-ELDJRLHZ.mjs";
94
+ } from "./token-goat-chunk-IVCTQPZD.mjs";
95
95
  import {
96
96
  registerReset
97
97
  } from "./token-goat-chunk-AO2QD2AG.mjs";
@@ -9922,7 +9922,7 @@ function extractMarkdownHeadings(content, limit = MAX_HEADINGS) {
9922
9922
  const lines2 = content.split("\n");
9923
9923
  for (const [i, line] of eachUnfencedLine(lines2)) {
9924
9924
  if (!line) continue;
9925
- const match = /^(#+)\s+(.+?)(?:\s+#+\s*)?$/.exec(line);
9925
+ const match = /^(#+)\s+([^\r\n]+?)(?:\s+#+)?\s*$/.exec(line);
9926
9926
  if (!match || match.length < 3) continue;
9927
9927
  const hashes = match[1];
9928
9928
  const headingText = match[2];
@@ -10052,7 +10052,7 @@ function handleHtml(filePath, content, contentLengthHint) {
10052
10052
  message: `Large HTML file (${formatBytes(length)}) \u2014 too large to preview (exceeds the in-hook scan cap). Use token-goat section to extract a section by heading, or convert to text: pandoc "${filePath}" -t plain`
10053
10053
  };
10054
10054
  }
10055
- const title = content.match(/<title[^>]*>([^<]+)<\/title>/i)?.[1]?.trim();
10055
+ const title = content.match(/<title[^>]*>([^<]*)<\/title>/i)?.[1]?.trim();
10056
10056
  const headings = findHtmlHeadingMatches(content).slice(0, 20).map(({ level, heading }) => {
10057
10057
  if (!heading) return "";
10058
10058
  return `${" ".repeat(level - 1)}h${level}: ${heading}`;
@@ -10,11 +10,11 @@ import {
10
10
  selectFilter,
11
11
  shlexSplit,
12
12
  wrappedShell
13
- } from "./token-goat-chunk-7JDXDERZ.mjs";
13
+ } from "./token-goat-chunk-TF5NT3H5.mjs";
14
14
  import {
15
15
  loadConfig,
16
16
  recordStat
17
- } from "./token-goat-chunk-ELDJRLHZ.mjs";
17
+ } from "./token-goat-chunk-IVCTQPZD.mjs";
18
18
  import "./token-goat-chunk-AO2QD2AG.mjs";
19
19
  import "./token-goat-chunk-AEX54RUZ.mjs";
20
20
 
@@ -8,7 +8,7 @@ import {
8
8
  import { createRequire } from "node:module";
9
9
  function resolveVersion() {
10
10
  if (true) {
11
- return "2.8.1";
11
+ return "2.8.2";
12
12
  }
13
13
  const require2 = createRequire(import.meta.url);
14
14
  const pkg = require2("../package.json");
@@ -6657,7 +6657,7 @@ var SECRET_PATTERNS = [
6657
6657
  // identifier characters only, so prose that merely mentions a keyword still never reaches
6658
6658
  // a separator and stays unredacted. api[_-]?key covers the apikey and api-key spellings too.
6659
6659
  // `& ; # , :` play two incompatible roles. They separate one field from the next (a query
6660
- // string, a cookie header, an inline env list), and they are also perfectly ordinary password
6660
+ // string, a cookie header, an inline env list), and they are also perfectly ordinary credential
6661
6661
  // characters. Rejecting them outright got the first role right and the second badly wrong: the
6662
6662
  // match stopped at the first one and left everything after it in plain text, so
6663
6663
  // `password=corr&horse&battery` redacted four characters and printed the rest, and
@@ -4,14 +4,14 @@ import {
4
4
  buildEvent,
5
5
  relay,
6
6
  relayInProcess
7
- } from "./token-goat-chunk-AOBZUFNJ.mjs";
7
+ } from "./token-goat-chunk-KBVN4ELV.mjs";
8
8
  import {
9
9
  MAX_STDIN_BYTES,
10
10
  readStdinJson
11
- } from "./token-goat-chunk-XEDQH5DA.mjs";
12
- import "./token-goat-chunk-2G6RAB4G.mjs";
13
- import "./token-goat-chunk-7JDXDERZ.mjs";
14
- import "./token-goat-chunk-ELDJRLHZ.mjs";
11
+ } from "./token-goat-chunk-5MLXFSRI.mjs";
12
+ import "./token-goat-chunk-AM23GDIS.mjs";
13
+ import "./token-goat-chunk-TF5NT3H5.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 {
@@ -23,7 +23,7 @@ import {
23
23
  summarizeOutputDelta,
24
24
  summarizeResidentContext,
25
25
  taskListPruneHint
26
- } from "./token-goat-chunk-XEDQH5DA.mjs";
26
+ } from "./token-goat-chunk-5MLXFSRI.mjs";
27
27
  import {
28
28
  BODY_FIRST_TOOL_RESPONSE_KEYS,
29
29
  OUTPUT_FIRST_TOOL_RESPONSE_KEYS,
@@ -118,7 +118,7 @@ import {
118
118
  wasCliReadThisSession,
119
119
  wasFileReadThisSession,
120
120
  wasHintShown
121
- } from "./token-goat-chunk-2G6RAB4G.mjs";
121
+ } from "./token-goat-chunk-AM23GDIS.mjs";
122
122
  import {
123
123
  canRunWrappedShell,
124
124
  compressOutput,
@@ -129,7 +129,7 @@ import {
129
129
  isRewriteWorthwhile,
130
130
  resolveMinNetSavingsBytes,
131
131
  shlexSplit
132
- } from "./token-goat-chunk-7JDXDERZ.mjs";
132
+ } from "./token-goat-chunk-TF5NT3H5.mjs";
133
133
  import {
134
134
  VERSION,
135
135
  detectHarness,
@@ -149,7 +149,7 @@ import {
149
149
  runGit,
150
150
  shortFingerprint,
151
151
  toKB
152
- } from "./token-goat-chunk-ELDJRLHZ.mjs";
152
+ } from "./token-goat-chunk-IVCTQPZD.mjs";
153
153
 
154
154
  // src/hooks_grep.ts
155
155
  function grepIntInput(toolInput, key) {
@@ -620,7 +620,7 @@ import crypto from "node:crypto";
620
620
  var TRACKED_SKILL = "token-goat";
621
621
  var MAX_COMMANDS_SHOWN = 8;
622
622
  async function currentCommandNames() {
623
- const { buildProgram } = await import("./token-goat-chunk-Y2SYNH3S.mjs");
623
+ const { buildProgram } = await import("./token-goat-chunk-SE6V7LUZ.mjs");
624
624
  return flattenCommandNames(buildCommandManifest(buildProgram()));
625
625
  }
626
626
  async function recordSkillVersionSnapshot(sessionId, skillName) {
@@ -54,7 +54,7 @@ import {
54
54
  walkProject,
55
55
  yamlLineClosesQuote,
56
56
  yamlOpenQuoteAfter
57
- } from "./token-goat-chunk-2G6RAB4G.mjs";
57
+ } from "./token-goat-chunk-AM23GDIS.mjs";
58
58
  import {
59
59
  Database,
60
60
  PER_FILE_COUNTERFACTUAL_CEILING,
@@ -106,7 +106,7 @@ import {
106
106
  unsupportedLanguageName,
107
107
  windowsCmdQuoteArg,
108
108
  withExtension
109
- } from "./token-goat-chunk-ELDJRLHZ.mjs";
109
+ } from "./token-goat-chunk-IVCTQPZD.mjs";
110
110
  import {
111
111
  registerReset
112
112
  } from "./token-goat-chunk-AO2QD2AG.mjs";
@@ -139,7 +139,7 @@ function getTrackedFiles(cwd = process.cwd()) {
139
139
  // src/section_reader.ts
140
140
  import { readFileSync } from "node:fs";
141
141
  function parseHeadingSpec(spec, headers) {
142
- const m = /^(.*?)#(\d+)$/.exec(spec);
142
+ const m = /^([^#\r\n]+)#(\d+)$/.exec(spec);
143
143
  if (m !== null && m[1] !== void 0 && m[2] !== void 0) {
144
144
  const specLower = spec.trim().toLowerCase();
145
145
  const isLiteralHeading = headers?.some((h) => h.heading.trim().toLowerCase() === specLower) ?? false;
@@ -163,7 +163,7 @@ function normalizeHeadingStrip(s) {
163
163
  return n.replace(/\s+/g, " ").trim();
164
164
  }
165
165
  var MIN_WIDEN_WORD_LEN = 3;
166
- var MARKDOWN_HEADER_RE = /^(#{1,6})\s+(.+?)(?:\s+#+)?\s*$/;
166
+ var MARKDOWN_HEADER_RE = /^(#{1,6})\s+([^\r\n]+?)(?:\s+#+)?\s*$/;
167
167
  var TABLE_HEADER_RE = /^\s*\[+\s*([^\]]+?)\s*\]+\s*(?:[#;].*)?$/;
168
168
  var PYTHON_HEADER_RE = /^(\s*)(?:async\s+)?(?:def|class)\s+([A-Za-z_]\w*)/;
169
169
  var KEYVALUE_HEADER_RE = /^([A-Za-z_][\w.-]*)\s*(?:=|:(?!\/\/))/;
@@ -7,11 +7,11 @@ import {
7
7
  expandGlobs,
8
8
  leftoverIntegrations,
9
9
  run
10
- } from "./token-goat-chunk-VBXBLGTO.mjs";
11
- import "./token-goat-chunk-RMDQFTQD.mjs";
12
- import "./token-goat-chunk-XEDQH5DA.mjs";
13
- import "./token-goat-chunk-2G6RAB4G.mjs";
14
- import "./token-goat-chunk-ELDJRLHZ.mjs";
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-ELDJRLHZ.mjs";
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+edit(?:s)?(?:\s+to\s+\S+)?|Applied\s+edit\s+to\s+\S+)\s*\.{0,3}\s*$/i;
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\.\S+\.)?[a-z][a-z0-9_]+\.[a-zA-Z0-9_.[\]-]+):$/;
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.]+\(.*\)$|^\s+\.{3}\s*\d+\s+more|^Caused by:|^During handling of the above exception/;
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 '.*', (?: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?$/;
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: .+ is deprecated|Ignoring '.+' in '|\s*$)/i;
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+.*(?:done|finished)|\d+\s+unique\s+error)/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+[^\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.*lock/i;
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 ".+ > .+" has (?:unmet|incorrect) peer dependency/i;
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].*\d+\/\d+|\s+\d+\s+packages?\s+(?:fetched|resolved|downloaded|linked)/;
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) .+\(\d+%\)/;
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+.*\bis already installed/i;
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.*:\d+:\s+\S.*Warning\b/;
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/;
@@ -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-AOBZUFNJ.mjs";
6
- import "./token-goat-chunk-XEDQH5DA.mjs";
7
- import "./token-goat-chunk-2G6RAB4G.mjs";
8
- import "./token-goat-chunk-7JDXDERZ.mjs";
9
- import "./token-goat-chunk-ELDJRLHZ.mjs";
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 {
@@ -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-VBXBLGTO.mjs";
6
- import "./token-goat-chunk-RMDQFTQD.mjs";
7
- import "./token-goat-chunk-XEDQH5DA.mjs";
8
- import "./token-goat-chunk-2G6RAB4G.mjs";
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-ELDJRLHZ.mjs";
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.1",
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",