token-goat 2.6.32 → 2.6.34

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 (35) hide show
  1. package/README.md +24 -1
  2. package/dist/{token-goat-chunk-5EXIMDHA.mjs → token-goat-chunk-7FWBSPCT.mjs} +1573 -386
  3. package/dist/token-goat-chunk-AEX54RUZ.mjs +11 -0
  4. package/dist/{token-goat-chunk-3KW5C2KQ.mjs → token-goat-chunk-AO2QD2AG.mjs} +0 -4
  5. package/dist/{token-goat-chunk-TBCLQTPG.mjs → token-goat-chunk-CKRATWCJ.mjs} +7 -7
  6. package/dist/{token-goat-chunk-X5OPORR4.mjs → token-goat-chunk-CN7GUPX6.mjs} +1258 -1769
  7. package/dist/{token-goat-hook-chunk-TKXOXN4J.mjs → token-goat-chunk-DG53MVNJ.mjs} +2 -98
  8. package/dist/{token-goat-chunk-DFBD2FFU.mjs → token-goat-chunk-FRMEOIRU.mjs} +365 -139
  9. package/dist/{token-goat-chunk-YWYITDOS.mjs → token-goat-chunk-G6XLWJWI.mjs} +2 -5
  10. package/dist/{token-goat-chunk-RD6O3PJU.mjs → token-goat-chunk-GXBPEQR2.mjs} +3699 -3341
  11. package/dist/{token-goat-chunk-DNEPSN3P.mjs → token-goat-chunk-I6EQH27G.mjs} +4 -7
  12. package/dist/{token-goat-hook-chunk-Q5URQRIF.mjs → token-goat-chunk-IYYQOPY4.mjs} +811 -79
  13. package/dist/{token-goat-chunk-W3MX4LQV.mjs → token-goat-chunk-L7QLEVO7.mjs} +6 -9
  14. package/dist/{token-goat-chunk-O7TGKV5I.mjs → token-goat-chunk-OA3GFKP2.mjs} +23 -24
  15. package/dist/{token-goat-chunk-GWZJ5SI2.mjs → token-goat-chunk-WA2ER6TZ.mjs} +7 -32
  16. package/dist/{token-goat-hook-chunk-VHZECEQD.mjs → token-goat-hook-chunk-2ISZ4AZR.mjs} +7 -32
  17. package/dist/{token-goat-chunk-4M7PSAO3.mjs → token-goat-hook-chunk-3QYSN4QV.mjs} +2 -98
  18. package/dist/{token-goat-hook-chunk-LFYT4DLB.mjs → token-goat-hook-chunk-6C5RN3CM.mjs} +23 -24
  19. package/dist/{token-goat-hook-chunk-WBTHUYJP.mjs → token-goat-hook-chunk-6QTWMSRO.mjs} +1221 -1730
  20. package/dist/token-goat-hook-chunk-ATEGFQAU.mjs +23 -0
  21. package/dist/{token-goat-hook-chunk-DJZGX27J.mjs → token-goat-hook-chunk-BU5OFDGQ.mjs} +363 -138
  22. package/dist/{token-goat-hook-chunk-J2ZK2FYW.mjs → token-goat-hook-chunk-BUOCULAM.mjs} +0 -4
  23. package/dist/{token-goat-hook-chunk-DHW6SRHR.mjs → token-goat-hook-chunk-CNLMPHXT.mjs} +1569 -382
  24. package/dist/{token-goat-hook-chunk-6NF4WM2U.mjs → token-goat-hook-chunk-I5VM5PO5.mjs} +3700 -3342
  25. package/dist/{token-goat-chunk-N53GXI2Z.mjs → token-goat-hook-chunk-KGLMNOGD.mjs} +811 -79
  26. package/dist/{token-goat-hook-chunk-TBJ5PUPQ.mjs → token-goat-hook-chunk-OQML5EMA.mjs} +6 -9
  27. package/dist/{token-goat-hook-chunk-UXD3B4OY.mjs → token-goat-hook-chunk-QTZ6YUMQ.mjs} +4 -7
  28. package/dist/token-goat-hook-chunk-RFRLWOQH.mjs +11 -0
  29. package/dist/{token-goat-hook-chunk-PCP4W65Z.mjs → token-goat-hook-chunk-XUMIVYEN.mjs} +2 -5
  30. package/dist/token-goat-hook.mjs +7 -12
  31. package/dist/token-goat.core.mjs +7 -10
  32. package/package.json +20 -40
  33. package/dist/token-goat-chunk-3UOG7PSZ.mjs +0 -63
  34. package/dist/token-goat-hook-chunk-ANFXTEQO.mjs +0 -23
  35. package/dist/token-goat-hook-chunk-K33JMLL7.mjs +0 -63
@@ -6,7 +6,7 @@ import {
6
6
  loadBlob,
7
7
  sanitizeFtsQuery,
8
8
  storeBlob
9
- } from "./token-goat-hook-chunk-WBTHUYJP.mjs";
9
+ } from "./token-goat-hook-chunk-6QTWMSRO.mjs";
10
10
  import {
11
11
  SYMBOL_BODY_CHAR_CAP,
12
12
  extractErrorMessage,
@@ -16,16 +16,12 @@ import {
16
16
  redactSecrets,
17
17
  runGit,
18
18
  shortFingerprint
19
- } from "./token-goat-hook-chunk-DHW6SRHR.mjs";
19
+ } from "./token-goat-hook-chunk-CNLMPHXT.mjs";
20
20
  import {
21
21
  registerReset
22
- } from "./token-goat-hook-chunk-J2ZK2FYW.mjs";
23
- import {
24
- init_define_import_meta_env
25
- } from "./token-goat-hook-chunk-K33JMLL7.mjs";
22
+ } from "./token-goat-hook-chunk-BUOCULAM.mjs";
26
23
 
27
24
  // src/hooks_cli.ts
28
- init_define_import_meta_env();
29
25
  var _LOG = {
30
26
  warn: (msg, ...args) => console.warn(`[hooks_cli] ${msg}`, ...args),
31
27
  debug: (msg, ...args) => console.error(`[hooks_cli] ${msg}`, ...args),
@@ -76,6 +72,15 @@ var GROK_TOOL_NAME_MAP = {
76
72
  var GROK_INPUT_KEY_MAP = {
77
73
  Read: { target_file: "file_path" }
78
74
  };
75
+ var KIMI_TOOL_NAME_MAP = {
76
+ FetchURL: "WebFetch",
77
+ ReadMediaFile: "Read"
78
+ };
79
+ var KIMI_INPUT_KEY_MAP = {
80
+ Read: { path: "file_path" },
81
+ Write: { path: "file_path" },
82
+ Edit: { path: "file_path" }
83
+ };
79
84
  function remapInputKeys(input, keyMap) {
80
85
  const newInput = {};
81
86
  for (const [k, v] of Object.entries(input)) {
@@ -84,17 +89,13 @@ function remapInputKeys(input, keyMap) {
84
89
  return newInput;
85
90
  }
86
91
  function remapToolName(obj, toolName, nameMap, inputKeyMap) {
87
- const mapped = nameMap[toolName];
92
+ const mapped = nameMap[toolName] ?? toolName;
88
93
  const result = { ...obj };
89
- if (mapped) {
90
- result["tool_name"] = mapped;
91
- const rawInput = obj["tool_input"];
92
- if (typeof rawInput === "object" && rawInput !== null && !Array.isArray(rawInput)) {
93
- const keyMap = inputKeyMap[mapped];
94
- if (keyMap) {
95
- result["tool_input"] = remapInputKeys(rawInput, keyMap);
96
- }
97
- }
94
+ result["tool_name"] = mapped;
95
+ const rawInput = obj["tool_input"];
96
+ const keyMap = inputKeyMap[mapped];
97
+ if (keyMap && typeof rawInput === "object" && rawInput !== null && !Array.isArray(rawInput)) {
98
+ result["tool_input"] = remapInputKeys(rawInput, keyMap);
98
99
  }
99
100
  return result;
100
101
  }
@@ -149,6 +150,11 @@ function normalizePayload(payload, harness = "claude") {
149
150
  result2["_tg_harness"] = harness;
150
151
  return result2;
151
152
  }
153
+ if (harness === "kimi") {
154
+ const result2 = remapToolName(obj, toolName, KIMI_TOOL_NAME_MAP, KIMI_INPUT_KEY_MAP);
155
+ result2["_tg_harness"] = harness;
156
+ return result2;
157
+ }
152
158
  if (harness === "gemini") {
153
159
  const result2 = remapToolName(obj, toolName, GEMINI_TOOL_NAME_MAP, GEMINI_INPUT_KEY_MAP);
154
160
  if ("functionCallId" in result2 && !("toolUseId" in result2)) {
@@ -164,7 +170,6 @@ function normalizePayload(payload, harness = "claude") {
164
170
  }
165
171
 
166
172
  // src/types.ts
167
- init_define_import_meta_env();
168
173
  var HOOK_EVENTS = [
169
174
  "pre_tool_use",
170
175
  "post_tool_use",
@@ -177,7 +182,6 @@ var HOOK_EVENTS = [
177
182
  ];
178
183
 
179
184
  // src/stdin_json.ts
180
- init_define_import_meta_env();
181
185
  var DEFAULT_STDIN_TIMEOUT_MS = 5e3;
182
186
  var MAX_STDIN_BYTES = 64 * 1024 * 1024;
183
187
  function readStdinJson(timeoutMs = DEFAULT_STDIN_TIMEOUT_MS, maxBytes = MAX_STDIN_BYTES) {
@@ -232,7 +236,6 @@ function readStdinJson(timeoutMs = DEFAULT_STDIN_TIMEOUT_MS, maxBytes = MAX_STDI
232
236
  }
233
237
 
234
238
  // src/recall_index.ts
235
- init_define_import_meta_env();
236
239
  var VALID_TYPES = ["bash", "web", "mcp"];
237
240
  function isRecallCacheType(value) {
238
241
  return VALID_TYPES.includes(value);
@@ -367,7 +370,6 @@ function searchRecall(query, opts = {}) {
367
370
  }
368
371
 
369
372
  // src/bash_output_cache.ts
370
- init_define_import_meta_env();
371
373
  import { readdirSync, readFileSync, statSync } from "fs";
372
374
  import { resolve } from "path";
373
375
  var BASH_OUTPUT_SUBDIR = "bash_outputs";
@@ -717,7 +719,6 @@ registerReset(() => {
717
719
  });
718
720
 
719
721
  // src/cli_commands.ts
720
- init_define_import_meta_env();
721
722
  function toEntry(cmd) {
722
723
  return {
723
724
  name: cmd.name(),
@@ -786,7 +787,6 @@ function formatCommandManifest(manifest) {
786
787
  }
787
788
 
788
789
  // src/web_cache.ts
789
- init_define_import_meta_env();
790
790
  var WEB_OUTPUT_SUBDIR = "web_outputs";
791
791
  var _byId2 = /* @__PURE__ */ new Map();
792
792
  var _rawById = /* @__PURE__ */ new Map();
@@ -843,7 +843,6 @@ registerReset(() => {
843
843
  });
844
844
 
845
845
  // src/symbol_body_probe.ts
846
- init_define_import_meta_env();
847
846
  import * as fs from "fs";
848
847
  var OVERSIZED_BODY_PROBE_SQL = `SELECT 1 FROM symbols WHERE LENGTH(body) > ${SYMBOL_BODY_CHAR_CAP} LIMIT 1`;
849
848
  function checkSymbolBodySize(dbPath) {