token-goat 2.6.32 → 2.6.33
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 +20 -1
- package/dist/{token-goat-chunk-W3MX4LQV.mjs → token-goat-chunk-72R7M5H7.mjs} +6 -9
- package/dist/{token-goat-chunk-DNEPSN3P.mjs → token-goat-chunk-77CX3MCN.mjs} +4 -7
- package/dist/token-goat-chunk-AEX54RUZ.mjs +11 -0
- package/dist/{token-goat-chunk-3KW5C2KQ.mjs → token-goat-chunk-AO2QD2AG.mjs} +0 -4
- package/dist/{token-goat-hook-chunk-TKXOXN4J.mjs → token-goat-chunk-DG53MVNJ.mjs} +2 -98
- package/dist/{token-goat-chunk-N53GXI2Z.mjs → token-goat-chunk-FN6WLFIX.mjs} +14 -32
- package/dist/{token-goat-chunk-YWYITDOS.mjs → token-goat-chunk-G6XLWJWI.mjs} +2 -5
- package/dist/{token-goat-chunk-TBCLQTPG.mjs → token-goat-chunk-HPWPUBAK.mjs} +7 -7
- package/dist/{token-goat-chunk-DFBD2FFU.mjs → token-goat-chunk-L6FVTDPD.mjs} +9 -121
- package/dist/{token-goat-chunk-O7TGKV5I.mjs → token-goat-chunk-OHQ7RBLL.mjs} +23 -24
- package/dist/{token-goat-chunk-RD6O3PJU.mjs → token-goat-chunk-RPOXYJWK.mjs} +3642 -3329
- package/dist/{token-goat-chunk-GWZJ5SI2.mjs → token-goat-chunk-RQQ4SY2P.mjs} +1 -31
- package/dist/{token-goat-chunk-X5OPORR4.mjs → token-goat-chunk-TDYTBCT4.mjs} +1031 -1784
- package/dist/{token-goat-chunk-5EXIMDHA.mjs → token-goat-chunk-WFRR2DBG.mjs} +1131 -51
- package/dist/{token-goat-hook-chunk-UXD3B4OY.mjs → token-goat-hook-chunk-26DLRODR.mjs} +4 -7
- package/dist/{token-goat-chunk-4M7PSAO3.mjs → token-goat-hook-chunk-3QYSN4QV.mjs} +2 -98
- package/dist/{token-goat-hook-chunk-J2ZK2FYW.mjs → token-goat-hook-chunk-BUOCULAM.mjs} +0 -4
- package/dist/{token-goat-hook-chunk-DHW6SRHR.mjs → token-goat-hook-chunk-E6AIPKNF.mjs} +1131 -51
- package/dist/{token-goat-hook-chunk-TBJ5PUPQ.mjs → token-goat-hook-chunk-EKGDLI4D.mjs} +6 -9
- package/dist/{token-goat-hook-chunk-VHZECEQD.mjs → token-goat-hook-chunk-HXHFLKEL.mjs} +1 -31
- package/dist/{token-goat-hook-chunk-DJZGX27J.mjs → token-goat-hook-chunk-QD2DX2U7.mjs} +7 -120
- package/dist/token-goat-hook-chunk-RFRLWOQH.mjs +11 -0
- package/dist/{token-goat-hook-chunk-WBTHUYJP.mjs → token-goat-hook-chunk-UWV4MTYI.mjs} +1039 -1790
- package/dist/{token-goat-hook-chunk-Q5URQRIF.mjs → token-goat-hook-chunk-VDXQXYJK.mjs} +14 -32
- package/dist/{token-goat-hook-chunk-6NF4WM2U.mjs → token-goat-hook-chunk-WBBHV6TZ.mjs} +3643 -3330
- package/dist/token-goat-hook-chunk-XBOWDNJB.mjs +23 -0
- package/dist/{token-goat-hook-chunk-PCP4W65Z.mjs → token-goat-hook-chunk-XUMIVYEN.mjs} +2 -5
- package/dist/{token-goat-hook-chunk-LFYT4DLB.mjs → token-goat-hook-chunk-ZT47M3IA.mjs} +23 -24
- package/dist/token-goat-hook.mjs +7 -12
- package/dist/token-goat.core.mjs +7 -10
- package/package.json +13 -33
- package/dist/token-goat-chunk-3UOG7PSZ.mjs +0 -63
- package/dist/token-goat-hook-chunk-ANFXTEQO.mjs +0 -23
- 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-chunk-
|
|
9
|
+
} from "./token-goat-chunk-TDYTBCT4.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-chunk-
|
|
19
|
+
} from "./token-goat-chunk-WFRR2DBG.mjs";
|
|
20
20
|
import {
|
|
21
21
|
registerReset
|
|
22
|
-
} from "./token-goat-chunk-
|
|
23
|
-
import {
|
|
24
|
-
init_define_import_meta_env
|
|
25
|
-
} from "./token-goat-chunk-3UOG7PSZ.mjs";
|
|
22
|
+
} from "./token-goat-chunk-AO2QD2AG.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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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/recall_index.ts
|
|
167
|
-
init_define_import_meta_env();
|
|
168
173
|
var VALID_TYPES = ["bash", "web", "mcp"];
|
|
169
174
|
function isRecallCacheType(value) {
|
|
170
175
|
return VALID_TYPES.includes(value);
|
|
@@ -299,7 +304,6 @@ function searchRecall(query, opts = {}) {
|
|
|
299
304
|
}
|
|
300
305
|
|
|
301
306
|
// src/bash_output_cache.ts
|
|
302
|
-
init_define_import_meta_env();
|
|
303
307
|
import { readdirSync, readFileSync, statSync } from "fs";
|
|
304
308
|
import { resolve } from "path";
|
|
305
309
|
var BASH_OUTPUT_SUBDIR = "bash_outputs";
|
|
@@ -649,7 +653,6 @@ registerReset(() => {
|
|
|
649
653
|
});
|
|
650
654
|
|
|
651
655
|
// src/web_cache.ts
|
|
652
|
-
init_define_import_meta_env();
|
|
653
656
|
var WEB_OUTPUT_SUBDIR = "web_outputs";
|
|
654
657
|
var _byId2 = /* @__PURE__ */ new Map();
|
|
655
658
|
var _rawById = /* @__PURE__ */ new Map();
|
|
@@ -706,7 +709,6 @@ registerReset(() => {
|
|
|
706
709
|
});
|
|
707
710
|
|
|
708
711
|
// src/types.ts
|
|
709
|
-
init_define_import_meta_env();
|
|
710
712
|
var HOOK_EVENTS = [
|
|
711
713
|
"pre_tool_use",
|
|
712
714
|
"post_tool_use",
|
|
@@ -719,7 +721,6 @@ var HOOK_EVENTS = [
|
|
|
719
721
|
];
|
|
720
722
|
|
|
721
723
|
// src/cli_commands.ts
|
|
722
|
-
init_define_import_meta_env();
|
|
723
724
|
function toEntry(cmd) {
|
|
724
725
|
return {
|
|
725
726
|
name: cmd.name(),
|
|
@@ -788,7 +789,6 @@ function formatCommandManifest(manifest) {
|
|
|
788
789
|
}
|
|
789
790
|
|
|
790
791
|
// src/stdin_json.ts
|
|
791
|
-
init_define_import_meta_env();
|
|
792
792
|
var DEFAULT_STDIN_TIMEOUT_MS = 5e3;
|
|
793
793
|
var MAX_STDIN_BYTES = 64 * 1024 * 1024;
|
|
794
794
|
function readStdinJson(timeoutMs = DEFAULT_STDIN_TIMEOUT_MS, maxBytes = MAX_STDIN_BYTES) {
|
|
@@ -843,7 +843,6 @@ function readStdinJson(timeoutMs = DEFAULT_STDIN_TIMEOUT_MS, maxBytes = MAX_STDI
|
|
|
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) {
|