token-goat 2.9.30 → 2.9.31
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 +24 -7
- package/SECURITY.md +10 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/native/linux-arm64/tg-hook +0 -0
- package/dist/native/linux-x64/tg-hook +0 -0
- package/dist/native/win32-arm64/tg-hook.exe +0 -0
- package/dist/native/win32-x64/tg-hook.exe +0 -0
- package/dist/{token-goat-chunk-QSBRTGM2.mjs → token-goat-chunk-25TRAWET.mjs} +17 -7
- package/dist/token-goat-chunk-2KXO6V2B.mjs +203 -0
- package/dist/{token-goat-chunk-IVKIZWAB.mjs → token-goat-chunk-2M7E4PF7.mjs} +41 -12
- package/dist/{token-goat-chunk-SMVRN2HU.mjs → token-goat-chunk-2UPZGKKY.mjs} +2 -2
- package/dist/token-goat-chunk-2WLPWKHV.mjs +135 -0
- package/dist/token-goat-chunk-2XBMMDBD.mjs +126 -0
- package/dist/token-goat-chunk-32ZOY4N5.mjs +23 -0
- package/dist/token-goat-chunk-3EZRNKTK.mjs +188 -0
- package/dist/token-goat-chunk-4ADZHI7J.mjs +63 -0
- package/dist/token-goat-chunk-4GBVPH3D.mjs +242 -0
- package/dist/{token-goat-chunk-KWPNJBDH.mjs → token-goat-chunk-4GILLLWY.mjs} +7 -4
- package/dist/{token-goat-chunk-67TQJ76B.mjs → token-goat-chunk-4NAPX7BA.mjs} +36 -3
- package/dist/{token-goat-chunk-PU7V3FD6.mjs → token-goat-chunk-4SC7UJYV.mjs} +3354 -2553
- package/dist/token-goat-chunk-4SMRO4TO.mjs +366 -0
- package/dist/{token-goat-chunk-AFLYLHDH.mjs → token-goat-chunk-4ZBFWLXF.mjs} +283 -427
- package/dist/{token-goat-chunk-JDWCRD6M.mjs → token-goat-chunk-57BIAXJL.mjs} +73 -40
- package/dist/token-goat-chunk-5AC66HNP.mjs +115 -0
- package/dist/token-goat-chunk-5IMLKSOP.mjs +145 -0
- package/dist/token-goat-chunk-646E6U44.mjs +398 -0
- package/dist/token-goat-chunk-65N4RHP4.mjs +33 -0
- package/dist/{token-goat-chunk-JN4XMLSD.mjs → token-goat-chunk-6DG6HWP3.mjs} +8 -2
- package/dist/token-goat-chunk-6ENQSNRZ.mjs +573 -0
- package/dist/token-goat-chunk-6ZY4GNF2.mjs +91 -0
- package/dist/{token-goat-chunk-VPBBTSJR.mjs → token-goat-chunk-76FGDLRO.mjs} +262 -255
- package/dist/{token-goat-chunk-7IN2MKDS.mjs → token-goat-chunk-7EZTZOMC.mjs} +121 -289
- package/dist/{token-goat-chunk-OJBNYTJP.mjs → token-goat-chunk-7MAOA6X4.mjs} +640 -80
- package/dist/token-goat-chunk-7R2ZVVAX.mjs +218 -0
- package/dist/{token-goat-chunk-PD5VKH46.mjs → token-goat-chunk-AUNGYYQX.mjs} +2 -2
- package/dist/{token-goat-chunk-HG45AF2B.mjs → token-goat-chunk-AUQYRMMH.mjs} +794 -37
- package/dist/token-goat-chunk-B3PEKBYG.mjs +128 -0
- package/dist/{token-goat-chunk-A3CK6N5Z.mjs → token-goat-chunk-BA4HI6BW.mjs} +1309 -110
- package/dist/{token-goat-chunk-JB6QN6VF.mjs → token-goat-chunk-BFCWY73P.mjs} +59 -23
- package/dist/{token-goat-chunk-B45VMIIH.mjs → token-goat-chunk-BWGFUZZE.mjs} +7 -5
- package/dist/{token-goat-chunk-P4QMM4WK.mjs → token-goat-chunk-C75NA7PL.mjs} +50 -23
- package/dist/token-goat-chunk-CBIQ7WTD.mjs +87 -0
- package/dist/token-goat-chunk-CETM74KC.mjs +307 -0
- package/dist/{token-goat-chunk-H2PHHGM5.mjs → token-goat-chunk-CIMQ2BB3.mjs} +57 -12
- package/dist/{token-goat-chunk-N2NMER56.mjs → token-goat-chunk-CJLS3CDL.mjs} +46 -4
- package/dist/{token-goat-chunk-VES7EL7O.mjs → token-goat-chunk-CO3UYX6G.mjs} +1 -1
- package/dist/token-goat-chunk-COPNXRJM.mjs +154 -0
- package/dist/token-goat-chunk-CSJ5L3NL.mjs +479 -0
- package/dist/{token-goat-chunk-4LCCNRTG.mjs → token-goat-chunk-CVCEVUGK.mjs} +8 -6
- package/dist/{token-goat-chunk-B2RZZCSS.mjs → token-goat-chunk-CXHOFN7R.mjs} +37 -20
- package/dist/token-goat-chunk-D735C4QM.mjs +603 -0
- package/dist/{token-goat-chunk-APGZXSPS.mjs → token-goat-chunk-DGS2LVNA.mjs} +47 -30
- package/dist/{token-goat-chunk-54K3EUV3.mjs → token-goat-chunk-DOWRSMWO.mjs} +1 -1
- package/dist/token-goat-chunk-E45INMY3.mjs +71 -0
- package/dist/token-goat-chunk-EC5F37F4.mjs +244 -0
- package/dist/{token-goat-chunk-XTQAOTSO.mjs → token-goat-chunk-EDBDRVH5.mjs} +4 -1
- package/dist/{token-goat-chunk-5BCIJXMO.mjs → token-goat-chunk-EELTBKDM.mjs} +14 -10
- package/dist/{token-goat-chunk-W3QCJS6G.mjs → token-goat-chunk-F4HYL64R.mjs} +8 -6
- package/dist/token-goat-chunk-F6PAUIEK.mjs +624 -0
- package/dist/token-goat-chunk-FDSREWLX.mjs +692 -0
- package/dist/token-goat-chunk-GGGG7RWB.mjs +236 -0
- package/dist/{token-goat-chunk-C63JQV5K.mjs → token-goat-chunk-GL3ETKSC.mjs} +233 -15
- package/dist/token-goat-chunk-GVB2MUST.mjs +1298 -0
- package/dist/token-goat-chunk-GWFLAUMQ.mjs +307 -0
- package/dist/{token-goat-chunk-ZEJVMUQH.mjs → token-goat-chunk-HLPW63A7.mjs} +2 -2
- package/dist/{token-goat-chunk-GOLEOXZP.mjs → token-goat-chunk-HU4TORC5.mjs} +44 -26
- package/dist/{token-goat-chunk-Z57YODA2.mjs → token-goat-chunk-I7VKZZAW.mjs} +2 -2
- package/dist/{token-goat-chunk-NYKZLXMK.mjs → token-goat-chunk-IA6XSPE3.mjs} +6 -6
- package/dist/{token-goat-chunk-E3OQX2XT.mjs → token-goat-chunk-IAGXMHIK.mjs} +81 -42
- package/dist/{token-goat-chunk-HYBFA5X3.mjs → token-goat-chunk-IK2DRMFX.mjs} +24 -68
- package/dist/{token-goat-chunk-COBQGL5S.mjs → token-goat-chunk-INNPTRUX.mjs} +249 -299
- package/dist/{token-goat-chunk-7NADEDKJ.mjs → token-goat-chunk-JJ5BX4F4.mjs} +6 -1
- package/dist/{token-goat-chunk-PEPTHRFF.mjs → token-goat-chunk-JVFSHVFJ.mjs} +6 -6
- package/dist/token-goat-chunk-KGEFFSHD.mjs +50 -0
- package/dist/token-goat-chunk-KQBLRPBN.mjs +433 -0
- package/dist/{token-goat-chunk-Q5VTGRH7.mjs → token-goat-chunk-LCNQ2CNN.mjs} +55 -319
- package/dist/token-goat-chunk-M3LFJDPU.mjs +58 -0
- package/dist/token-goat-chunk-M52KPT3C.mjs +87 -0
- package/dist/token-goat-chunk-MBEG42H7.mjs +150 -0
- package/dist/{token-goat-chunk-EVC4TOLE.mjs → token-goat-chunk-METECDOH.mjs} +3 -12
- package/dist/{token-goat-chunk-T4FK7VOV.mjs → token-goat-chunk-MHX7XCC3.mjs} +2 -1
- package/dist/token-goat-chunk-N5LSOVSU.mjs +137 -0
- package/dist/{token-goat-chunk-LOBGHXPB.mjs → token-goat-chunk-N5MMR2IW.mjs} +1 -1
- package/dist/token-goat-chunk-N7B3JQ2C.mjs +160 -0
- package/dist/{token-goat-chunk-RHXKCZX3.mjs → token-goat-chunk-NISNMD7T.mjs} +2182 -2959
- package/dist/token-goat-chunk-NMD42SFQ.mjs +434 -0
- package/dist/token-goat-chunk-NOSS5VWY.mjs +174 -0
- package/dist/{token-goat-chunk-KQNZDCBD.mjs → token-goat-chunk-NSNSPPBG.mjs} +25 -3
- package/dist/token-goat-chunk-OBOFIHKN.mjs +38 -0
- package/dist/token-goat-chunk-OBRFJ5O5.mjs +76 -0
- package/dist/{token-goat-chunk-JTQQGXZH.mjs → token-goat-chunk-ODBT2USM.mjs} +124 -57
- package/dist/token-goat-chunk-OS5EM5PP.mjs +107 -0
- package/dist/token-goat-chunk-OUKDTVNU.mjs +1178 -0
- package/dist/token-goat-chunk-OXFMP75N.mjs +566 -0
- package/dist/{token-goat-chunk-DZX2YDPT.mjs → token-goat-chunk-OYIYKDDT.mjs} +2 -2
- package/dist/{token-goat-chunk-QCLDAQTS.mjs → token-goat-chunk-P6HQSWQ3.mjs} +50 -53
- package/dist/token-goat-chunk-P6VGNTQT.mjs +71 -0
- package/dist/{token-goat-chunk-7BXSNBY5.mjs → token-goat-chunk-PFWIMH2E.mjs} +23 -15
- package/dist/token-goat-chunk-PJZXIS3G.mjs +39 -0
- package/dist/token-goat-chunk-PUO5INXP.mjs +606 -0
- package/dist/{token-goat-chunk-GFBSN7BD.mjs → token-goat-chunk-PX5PQWTY.mjs} +22 -250
- package/dist/token-goat-chunk-Q5QDBC6O.mjs +111 -0
- package/dist/token-goat-chunk-QFNQXSDT.mjs +40 -0
- package/dist/{token-goat-chunk-FBNQNSJK.mjs → token-goat-chunk-QH7YVYOY.mjs} +2198 -2782
- package/dist/{token-goat-chunk-64FBPDTK.mjs → token-goat-chunk-QLMUHEPB.mjs} +12 -9
- package/dist/{token-goat-chunk-RZRTDST7.mjs → token-goat-chunk-QQOJIHL3.mjs} +37 -11
- package/dist/{token-goat-chunk-XKI4SEMX.mjs → token-goat-chunk-QQTWJY2O.mjs} +19 -0
- package/dist/{token-goat-chunk-U4N3BN2W.mjs → token-goat-chunk-QYHO5CPH.mjs} +3 -2
- package/dist/token-goat-chunk-RELAVWAD.mjs +27 -0
- package/dist/{token-goat-chunk-ETBHVDB6.mjs → token-goat-chunk-RSLPOBKQ.mjs} +22 -11
- package/dist/token-goat-chunk-SAMFDIS2.mjs +712 -0
- package/dist/token-goat-chunk-SDELXLDM.mjs +48 -0
- package/dist/{token-goat-chunk-4JJS54TR.mjs → token-goat-chunk-SOAFZNNZ.mjs} +161 -38
- package/dist/{token-goat-chunk-664RTTUV.mjs → token-goat-chunk-SRTHT7KV.mjs} +21 -16
- package/dist/{token-goat-chunk-4FVIAHSI.mjs → token-goat-chunk-T5P5ACNQ.mjs} +7 -6
- package/dist/token-goat-chunk-T5YGG4V3.mjs +45 -0
- package/dist/token-goat-chunk-TAUZ4OFS.mjs +110 -0
- package/dist/{token-goat-chunk-COTXZHTS.mjs → token-goat-chunk-TM6MC754.mjs} +4 -3
- package/dist/token-goat-chunk-TWUKBOMP.mjs +72 -0
- package/dist/{token-goat-chunk-3CHUNJ2O.mjs → token-goat-chunk-U2KSB4SG.mjs} +8 -5
- package/dist/{token-goat-chunk-3Z5S4KGM.mjs → token-goat-chunk-U4WHMG6Y.mjs} +29 -49
- package/dist/{token-goat-chunk-PY533T7F.mjs → token-goat-chunk-UGJHGR5A.mjs} +21 -15
- package/dist/{token-goat-chunk-CYCEYAEO.mjs → token-goat-chunk-UOUDVA5U.mjs} +1 -1
- package/dist/{token-goat-chunk-JDHE26RP.mjs → token-goat-chunk-URRJ33GR.mjs} +16 -5
- package/dist/{token-goat-chunk-56EIMS3E.mjs → token-goat-chunk-UZOROKIS.mjs} +23 -17
- package/dist/{token-goat-chunk-CZ3LUXYZ.mjs → token-goat-chunk-VIHGGGEI.mjs} +427 -308
- package/dist/token-goat-chunk-VTJLAA7P.mjs +21 -0
- package/dist/token-goat-chunk-VWDXLT4F.mjs +678 -0
- package/dist/{token-goat-chunk-YARZFCZS.mjs → token-goat-chunk-VWZA2H4P.mjs} +62 -53
- package/dist/{token-goat-chunk-SQSSNQPE.mjs → token-goat-chunk-VXEXMJDL.mjs} +3979 -4745
- package/dist/token-goat-chunk-WBA5SKT4.mjs +547 -0
- package/dist/{token-goat-chunk-SJHWVNDQ.mjs → token-goat-chunk-WDH44VAU.mjs} +7 -4
- package/dist/token-goat-chunk-X2SUP3EI.mjs +107 -0
- package/dist/token-goat-chunk-X3BELZSJ.mjs +125 -0
- package/dist/{token-goat-chunk-FZ3NEW5O.mjs → token-goat-chunk-XLRBNZCC.mjs} +13 -8
- package/dist/{token-goat-chunk-Z44YO3QZ.mjs → token-goat-chunk-XRKUX6CM.mjs} +1 -1
- package/dist/token-goat-chunk-XX6O25RN.mjs +82 -0
- package/dist/token-goat-chunk-XZSUHBVS.mjs +65 -0
- package/dist/{token-goat-chunk-WY3L4DVT.mjs → token-goat-chunk-Y2ZTQOCL.mjs} +13 -8
- package/dist/{token-goat-chunk-UQ5UK2T7.mjs → token-goat-chunk-YB4VMGK2.mjs} +1 -1
- package/dist/token-goat-chunk-YBIIY3HR.mjs +51 -0
- package/dist/{token-goat-chunk-ZQSJMO2R.mjs → token-goat-chunk-YHVDKQBR.mjs} +105 -105
- package/dist/{token-goat-chunk-H2K3QP6H.mjs → token-goat-chunk-YJB5XLWI.mjs} +8 -6
- package/dist/{token-goat-chunk-ZCDTCVIS.mjs → token-goat-chunk-YKB6AQG3.mjs} +5 -2
- package/dist/token-goat-chunk-YMTG2YA5.mjs +35 -0
- package/dist/token-goat-chunk-YPBZYQRV.mjs +40 -0
- package/dist/{token-goat-chunk-HOJLCGDP.mjs → token-goat-chunk-YY6AVUFL.mjs} +2033 -2251
- package/dist/token-goat-chunk-Z7N5OMMP.mjs +98 -0
- package/dist/token-goat-chunk-ZNMNUPAZ.mjs +938 -0
- package/dist/token-goat-hook-client.cjs +1 -1
- package/dist/token-goat-hook-client.mjs +3 -3
- package/dist/token-goat-hook.mjs +67 -38
- package/dist/token-goat.core.mjs +4 -4
- package/docs/C4_RUNTIME_ARCHITECTURE.md +1 -1
- package/docs/cli.md +40 -21
- package/docs/install.md +19 -9
- package/docs/security.md +5 -3
- package/package.json +2 -1
- package/dist/token-goat-chunk-5KDMCMF2.mjs +0 -362
- package/dist/token-goat-chunk-6QMAS7AB.mjs +0 -42
- package/dist/token-goat-chunk-7F2UBPD3.mjs +0 -397
- package/dist/token-goat-chunk-ARDNEC2U.mjs +0 -248
- package/dist/token-goat-chunk-ATCPY7EQ.mjs +0 -134
- package/dist/token-goat-chunk-EFHMMIGP.mjs +0 -68
- package/dist/token-goat-chunk-IVALLT3S.mjs +0 -48
- package/dist/token-goat-chunk-JDU3EXSU.mjs +0 -65
- package/dist/token-goat-chunk-MKPF4CL5.mjs +0 -37
- package/dist/token-goat-chunk-RC35RBUL.mjs +0 -312
- package/dist/token-goat-chunk-USILZ3T3.mjs +0 -53
- package/dist/token-goat-chunk-VL3YIFHZ.mjs +0 -2975
- package/dist/token-goat-chunk-XU4P6Z24.mjs +0 -133
- package/dist/token-goat-chunk-Y776AENC.mjs +0 -1597
|
@@ -20,15 +20,18 @@ import {
|
|
|
20
20
|
saveCachedUpdateStatus,
|
|
21
21
|
updateAdvice,
|
|
22
22
|
upgradeDecision
|
|
23
|
-
} from "./token-goat-chunk-
|
|
24
|
-
import "./token-goat-chunk-
|
|
25
|
-
import "./token-goat-chunk-
|
|
23
|
+
} from "./token-goat-chunk-CXHOFN7R.mjs";
|
|
24
|
+
import "./token-goat-chunk-CBIQ7WTD.mjs";
|
|
25
|
+
import "./token-goat-chunk-7EZTZOMC.mjs";
|
|
26
|
+
import "./token-goat-chunk-QYHO5CPH.mjs";
|
|
27
|
+
import "./token-goat-chunk-4GBVPH3D.mjs";
|
|
26
28
|
import "./token-goat-chunk-YZAAZU2S.mjs";
|
|
27
29
|
import "./token-goat-chunk-IVE6U7KV.mjs";
|
|
28
|
-
import "./token-goat-chunk-
|
|
30
|
+
import "./token-goat-chunk-HU4TORC5.mjs";
|
|
31
|
+
import "./token-goat-chunk-GGGG7RWB.mjs";
|
|
29
32
|
import "./token-goat-chunk-AM5V6GSX.mjs";
|
|
30
33
|
import "./token-goat-chunk-FNFBKLRD.mjs";
|
|
31
|
-
import "./token-goat-chunk-
|
|
34
|
+
import "./token-goat-chunk-CO3UYX6G.mjs";
|
|
32
35
|
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
33
36
|
export {
|
|
34
37
|
DEV_CHECKOUT_ADVICE,
|
|
@@ -3,13 +3,16 @@ const require = __cjsRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getDb,
|
|
5
5
|
isReadOnlyDb
|
|
6
|
-
} from "./token-goat-chunk-
|
|
6
|
+
} from "./token-goat-chunk-GVB2MUST.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Database
|
|
9
9
|
} from "./token-goat-chunk-XB5KKOCG.mjs";
|
|
10
|
+
import {
|
|
11
|
+
creditDivisor
|
|
12
|
+
} from "./token-goat-chunk-XX6O25RN.mjs";
|
|
10
13
|
import {
|
|
11
14
|
getHarnessName
|
|
12
|
-
} from "./token-goat-chunk-
|
|
15
|
+
} from "./token-goat-chunk-QYHO5CPH.mjs";
|
|
13
16
|
import {
|
|
14
17
|
registerReset
|
|
15
18
|
} from "./token-goat-chunk-YZAAZU2S.mjs";
|
|
@@ -17,7 +20,7 @@ import {
|
|
|
17
20
|
countNoun,
|
|
18
21
|
ensureDirSync,
|
|
19
22
|
extractErrorMessage
|
|
20
|
-
} from "./token-goat-chunk-
|
|
23
|
+
} from "./token-goat-chunk-HU4TORC5.mjs";
|
|
21
24
|
import {
|
|
22
25
|
displaySafeText
|
|
23
26
|
} from "./token-goat-chunk-FNFBKLRD.mjs";
|
|
@@ -25,7 +28,7 @@ import {
|
|
|
25
28
|
VERSION,
|
|
26
29
|
dataDir,
|
|
27
30
|
dataDirForHome
|
|
28
|
-
} from "./token-goat-chunk-
|
|
31
|
+
} from "./token-goat-chunk-CO3UYX6G.mjs";
|
|
29
32
|
import {
|
|
30
33
|
init_define_import_meta_env
|
|
31
34
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -34,43 +37,6 @@ import {
|
|
|
34
37
|
init_define_import_meta_env();
|
|
35
38
|
import * as fs from "node:fs";
|
|
36
39
|
import * as path from "node:path";
|
|
37
|
-
|
|
38
|
-
// src/token_estimate.ts
|
|
39
|
-
init_define_import_meta_env();
|
|
40
|
-
var BYTES_PER_TOKEN = {
|
|
41
|
-
text: 4,
|
|
42
|
-
dense: 1.45
|
|
43
|
-
};
|
|
44
|
-
var GUARD_MARGIN = 0.75;
|
|
45
|
-
function creditDivisor(cls = "text") {
|
|
46
|
-
return BYTES_PER_TOKEN[cls];
|
|
47
|
-
}
|
|
48
|
-
function guardDivisor(cls = "text") {
|
|
49
|
-
return BYTES_PER_TOKEN[cls] * GUARD_MARGIN;
|
|
50
|
-
}
|
|
51
|
-
var DENSE_ALPHABET = /^[A-Za-z0-9+/=_-]$/;
|
|
52
|
-
var MIN_DENSE_SAMPLE = 200;
|
|
53
|
-
var MIN_DENSE_DISTINCT = 16;
|
|
54
|
-
var CLASSIFY_SAMPLE_CHARS = 4096;
|
|
55
|
-
function classifyContent(text) {
|
|
56
|
-
const sample = text.slice(0, CLASSIFY_SAMPLE_CHARS);
|
|
57
|
-
if (sample.length < MIN_DENSE_SAMPLE) return "text";
|
|
58
|
-
let whitespace = 0;
|
|
59
|
-
let dense = 0;
|
|
60
|
-
const distinct = /* @__PURE__ */ new Set();
|
|
61
|
-
for (const ch of sample) {
|
|
62
|
-
if (ch === " " || ch === "\n" || ch === " " || ch === "\r") whitespace++;
|
|
63
|
-
else if (DENSE_ALPHABET.test(ch)) {
|
|
64
|
-
dense++;
|
|
65
|
-
distinct.add(ch);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (whitespace / sample.length >= 0.05) return "text";
|
|
69
|
-
if (distinct.size < MIN_DENSE_DISTINCT) return "text";
|
|
70
|
-
return dense / sample.length >= 0.95 ? "dense" : "text";
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// src/stats.ts
|
|
74
40
|
var HARNESS_UNRECORDED = "unrecorded (pre-2.8.1)";
|
|
75
41
|
var PRICING_VERSION_UNRECORDED = "unrecorded (pre-tg_version column)";
|
|
76
42
|
function hasMixedPricingEras(summary) {
|
|
@@ -99,6 +65,10 @@ var KIND_TO_SOURCE = {
|
|
|
99
65
|
gdrive_image: SOURCE_IMAGE,
|
|
100
66
|
session_hint: SOURCE_HINT,
|
|
101
67
|
session_hint_suppressed: SOURCE_HINT,
|
|
68
|
+
// A guessed flag that option_intent.ts ran as the real one or answered with the corrected command (detail: command and the guessed flags).
|
|
69
|
+
cli_option_alias: SOURCE_HINT,
|
|
70
|
+
// The evidence receipt appended to a subagent report that carries a red flag (agent_receipt.ts), recorded at (0, 0): it saves nothing and is an advisory, so it counts as a hint fired.
|
|
71
|
+
agent_receipt: SOURCE_HINT,
|
|
102
72
|
diff_hint: SOURCE_HINT,
|
|
103
73
|
evidence_cache_hit: SOURCE_HINT,
|
|
104
74
|
structured_file_hint: SOURCE_HINT,
|
|
@@ -106,6 +76,10 @@ var KIND_TO_SOURCE = {
|
|
|
106
76
|
grep_dedup_hint: SOURCE_HINT,
|
|
107
77
|
glob_dedup_hint: SOURCE_HINT,
|
|
108
78
|
write_rewrite_hint: SOURCE_HINT,
|
|
79
|
+
// hooks_write.ts's partial-view guard (hints.write_blind_drop): a placeholder line or a blind whole-file overwrite, booked at 0 bytes / 0 tokens because the guard prevents a loss rather than saving output.
|
|
80
|
+
write_blind_drop: SOURCE_HINT,
|
|
81
|
+
// hooks_write.ts's sibling-copy advice (hints.write_sibling_copy): a new file that is mostly an existing sibling, booked at 0 bytes / 0 tokens because the advice can be ignored.
|
|
82
|
+
write_sibling_copy: SOURCE_HINT,
|
|
109
83
|
websearch_dedup_hint: SOURCE_HINT,
|
|
110
84
|
large_file_hint_followed: SOURCE_HINT,
|
|
111
85
|
large_file_hint_ignored: SOURCE_HINT,
|
|
@@ -197,6 +171,8 @@ var KIND_TO_SOURCE = {
|
|
|
197
171
|
known_root_record_failed: SOURCE_OTHER,
|
|
198
172
|
// Same fail-soft shape, from hooks_session_start.ts's reconcileNote: a thrown reconcile sweep must not block session start, but it also must not vanish silently, so the catch that swallows it records why instead of returning null with nothing recorded.
|
|
199
173
|
reconcile_note_failed: SOURCE_OTHER,
|
|
174
|
+
// A session start the Copilot shim answered with `{}` after its deadline, delivered on the first tool call instead (hooks_session.ts pendingContextHandler). A census of how often a slow machine needed the deferral, always recorded at (0, 0): the text was owed, not saved.
|
|
175
|
+
session_start_deferred: SOURCE_OTHER,
|
|
200
176
|
// Measurement of what a compaction produced (hooks_compact.ts postCompactHandler): summary size and how many manifest paths survived into it. SOURCE_OTHER and always recorded at (0, 0) -- the summary was written whether or not token-goat was watching, so there is no counterfactual in which those bytes were saved. Filing it anywhere with a savings total would credit token-goat for the whole summary, which is the accounting mistake this registry exists to prevent.
|
|
201
177
|
compact_summary: SOURCE_OTHER,
|
|
202
178
|
// One row per failed tool call the post_tool_use_failure hook sees (hooks_tool_failure.ts), with its tool_error_class.ts verdict in `detail` so failure rates by reason accumulate going forward. A measurement at (0, 0): a failure saves nothing.
|
|
@@ -529,6 +505,12 @@ function getGlobalDb(homeDir) {
|
|
|
529
505
|
}
|
|
530
506
|
return db;
|
|
531
507
|
}
|
|
508
|
+
function readGlobalDb(homeDir) {
|
|
509
|
+
if (fs.existsSync(path.join(homeDir ? dataDirForHome(homeDir) : dataDir(), "global.db"))) return getGlobalDb(homeDir);
|
|
510
|
+
const d = new Database(":memory:");
|
|
511
|
+
d.exec(GLOBAL_SCHEMA_SQL);
|
|
512
|
+
return d;
|
|
513
|
+
}
|
|
532
514
|
var STATS_RETENTION_DAYS = 180;
|
|
533
515
|
var UNMAPPED_TOOL_RETENTION_DAYS = 30;
|
|
534
516
|
var STATS_ROLLUP_INTERVAL_MS = 6 * 60 * 60 * 1e3;
|
|
@@ -605,7 +587,7 @@ function maybeRunStatsMaintenance(db) {
|
|
|
605
587
|
}
|
|
606
588
|
function noStatsMessage(windowDays, homeDir) {
|
|
607
589
|
if (windowDays <= 0) return "No stats recorded yet.";
|
|
608
|
-
const db =
|
|
590
|
+
const db = readGlobalDb(homeDir);
|
|
609
591
|
let total = db.prepare("SELECT COUNT(*) as c FROM stats").get().c;
|
|
610
592
|
try {
|
|
611
593
|
const rollupTable = db.prepare(`SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'stats_daily_rollup'`).get();
|
|
@@ -656,6 +638,7 @@ function withTelemetryWriteDb(write) {
|
|
|
656
638
|
}
|
|
657
639
|
}
|
|
658
640
|
function recordStat(kind, bytesSaved = 0, tokensSaved = 0, _testDb, detail, traceparent, durationMs) {
|
|
641
|
+
if (_testDb === void 0 && process.env[HOOK_PROBE_ENV] === "1") return;
|
|
659
642
|
const write = (db) => {
|
|
660
643
|
const ts = Math.floor(Date.now() / 1e3);
|
|
661
644
|
const tp = traceparent ?? process.env["TRACEPARENT"] ?? process.env["traceparent"] ?? null;
|
|
@@ -708,7 +691,7 @@ function recordUnmappedTool(toolName, eventName, nearMiss, _testDb) {
|
|
|
708
691
|
}
|
|
709
692
|
function readUnmappedTools(dbPath, homeDir) {
|
|
710
693
|
try {
|
|
711
|
-
const db = dbPath ? getDb(dbPath) :
|
|
694
|
+
const db = dbPath ? getDb(dbPath) : readGlobalDb(homeDir);
|
|
712
695
|
return db.prepare(
|
|
713
696
|
"SELECT harness, tool_name, event_name, near_miss, hits, last_seen FROM unmapped_tools ORDER BY hits DESC, tool_name ASC"
|
|
714
697
|
).all();
|
|
@@ -750,7 +733,7 @@ function claimFirstSavingsReceipt(testDb, homeDir, now = Date.now()) {
|
|
|
750
733
|
}
|
|
751
734
|
function firstReceiptShownAt(testDb, homeDir) {
|
|
752
735
|
try {
|
|
753
|
-
const db = testDb ??
|
|
736
|
+
const db = testDb ?? readGlobalDb(homeDir);
|
|
754
737
|
const row = db.prepare("SELECT set_ts FROM stats_flags WHERE name = ?").get(FIRST_RECEIPT_FLAG);
|
|
755
738
|
return row === void 0 ? null : row.set_ts * 1e3;
|
|
756
739
|
} catch {
|
|
@@ -767,7 +750,7 @@ function summarize(windowDays = 30, testDb, homeDir) {
|
|
|
767
750
|
let totalEvents = 0;
|
|
768
751
|
let totalBytes = 0;
|
|
769
752
|
let totalTokens = 0;
|
|
770
|
-
const db = testDb ??
|
|
753
|
+
const db = testDb ?? readGlobalDb(homeDir);
|
|
771
754
|
const hasHarness = statsHasHarnessColumn(db);
|
|
772
755
|
const hasVersion = statsHasVersionColumn(db);
|
|
773
756
|
const cols = [
|
|
@@ -893,9 +876,6 @@ function summarize(windowDays = 30, testDb, homeDir) {
|
|
|
893
876
|
}
|
|
894
877
|
|
|
895
878
|
export {
|
|
896
|
-
BYTES_PER_TOKEN,
|
|
897
|
-
guardDivisor,
|
|
898
|
-
classifyContent,
|
|
899
879
|
PRICING_VERSION_UNRECORDED,
|
|
900
880
|
hasMixedPricingEras,
|
|
901
881
|
SOURCE_HINT,
|
|
@@ -903,7 +883,7 @@ export {
|
|
|
903
883
|
formatLocalTimestamp,
|
|
904
884
|
statsHasHarnessColumn,
|
|
905
885
|
statsHasDurationColumn,
|
|
906
|
-
|
|
886
|
+
readGlobalDb,
|
|
907
887
|
HOOK_STATS_RETENTION_DAYS,
|
|
908
888
|
HOOK_PROBE_ENV,
|
|
909
889
|
noStatsMessage,
|
|
@@ -10,28 +10,34 @@ import {
|
|
|
10
10
|
findActiveGlobalGates,
|
|
11
11
|
findInstructionGateCandidates,
|
|
12
12
|
repairInstructionGates
|
|
13
|
-
} from "./token-goat-chunk-
|
|
14
|
-
import "./token-goat-chunk-
|
|
15
|
-
import "./token-goat-chunk-
|
|
16
|
-
import "./token-goat-chunk-
|
|
13
|
+
} from "./token-goat-chunk-IA6XSPE3.mjs";
|
|
14
|
+
import "./token-goat-chunk-7MAOA6X4.mjs";
|
|
15
|
+
import "./token-goat-chunk-CXHOFN7R.mjs";
|
|
16
|
+
import "./token-goat-chunk-QQTWJY2O.mjs";
|
|
17
17
|
import "./token-goat-chunk-G5PJ7AGM.mjs";
|
|
18
|
-
import "./token-goat-chunk-P4QMM4WK.mjs";
|
|
19
|
-
import "./token-goat-chunk-VPBBTSJR.mjs";
|
|
20
18
|
import "./token-goat-chunk-BPGCUMR7.mjs";
|
|
21
|
-
import "./token-goat-chunk-
|
|
22
|
-
import "./token-goat-chunk-
|
|
23
|
-
import "./token-goat-chunk-
|
|
19
|
+
import "./token-goat-chunk-C75NA7PL.mjs";
|
|
20
|
+
import "./token-goat-chunk-CBIQ7WTD.mjs";
|
|
21
|
+
import "./token-goat-chunk-76FGDLRO.mjs";
|
|
22
|
+
import "./token-goat-chunk-U4WHMG6Y.mjs";
|
|
23
|
+
import "./token-goat-chunk-GVB2MUST.mjs";
|
|
24
24
|
import "./token-goat-chunk-XB5KKOCG.mjs";
|
|
25
|
-
import "./token-goat-chunk-
|
|
26
|
-
import "./token-goat-chunk-
|
|
27
|
-
import "./token-goat-chunk-
|
|
25
|
+
import "./token-goat-chunk-OUKDTVNU.mjs";
|
|
26
|
+
import "./token-goat-chunk-BFCWY73P.mjs";
|
|
27
|
+
import "./token-goat-chunk-KGEFFSHD.mjs";
|
|
28
|
+
import "./token-goat-chunk-XX6O25RN.mjs";
|
|
29
|
+
import "./token-goat-chunk-HAVAOB3S.mjs";
|
|
30
|
+
import "./token-goat-chunk-T5P5ACNQ.mjs";
|
|
31
|
+
import "./token-goat-chunk-7EZTZOMC.mjs";
|
|
32
|
+
import "./token-goat-chunk-QYHO5CPH.mjs";
|
|
33
|
+
import "./token-goat-chunk-4GBVPH3D.mjs";
|
|
28
34
|
import "./token-goat-chunk-YZAAZU2S.mjs";
|
|
29
35
|
import "./token-goat-chunk-IVE6U7KV.mjs";
|
|
30
|
-
import "./token-goat-chunk-
|
|
36
|
+
import "./token-goat-chunk-HU4TORC5.mjs";
|
|
37
|
+
import "./token-goat-chunk-GGGG7RWB.mjs";
|
|
31
38
|
import "./token-goat-chunk-AM5V6GSX.mjs";
|
|
32
39
|
import "./token-goat-chunk-FNFBKLRD.mjs";
|
|
33
|
-
import "./token-goat-chunk-
|
|
34
|
-
import "./token-goat-chunk-HAVAOB3S.mjs";
|
|
40
|
+
import "./token-goat-chunk-CO3UYX6G.mjs";
|
|
35
41
|
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
36
42
|
export {
|
|
37
43
|
CODEX_GATE_BEGIN,
|
|
@@ -2,10 +2,10 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
redactSecrets
|
|
5
|
-
} from "./token-goat-chunk-
|
|
5
|
+
} from "./token-goat-chunk-T5P5ACNQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig
|
|
8
|
-
} from "./token-goat-chunk-
|
|
8
|
+
} from "./token-goat-chunk-7EZTZOMC.mjs";
|
|
9
9
|
import {
|
|
10
10
|
NotAnOfficeDocumentError,
|
|
11
11
|
assertOoxmlWithinDeadline,
|
|
@@ -18,10 +18,13 @@ import {
|
|
|
18
18
|
parseOoxmlPart,
|
|
19
19
|
readOoxmlZip,
|
|
20
20
|
sortNumberedParts
|
|
21
|
-
} from "./token-goat-chunk-
|
|
21
|
+
} from "./token-goat-chunk-2M7E4PF7.mjs";
|
|
22
|
+
import {
|
|
23
|
+
findOpenTags
|
|
24
|
+
} from "./token-goat-chunk-E45INMY3.mjs";
|
|
22
25
|
import {
|
|
23
26
|
compileGuardedRegex
|
|
24
|
-
} from "./token-goat-chunk-
|
|
27
|
+
} from "./token-goat-chunk-HU4TORC5.mjs";
|
|
25
28
|
import {
|
|
26
29
|
init_define_import_meta_env
|
|
27
30
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -115,7 +118,14 @@ async function notesPathFor(entries, slidePath, budget) {
|
|
|
115
118
|
return null;
|
|
116
119
|
}
|
|
117
120
|
function inlineSlideMath(xml) {
|
|
118
|
-
|
|
121
|
+
const withRuns = inlineMathRuns(xml, '<a:r><a:t xml:space="preserve">', "</a:t></a:r>");
|
|
122
|
+
let bare = "";
|
|
123
|
+
let pos = 0;
|
|
124
|
+
for (const tag of findOpenTags(withRuns, /<a14:m(?=[\s>])/g)) {
|
|
125
|
+
bare += withRuns.slice(pos, tag.start);
|
|
126
|
+
pos = tag.end;
|
|
127
|
+
}
|
|
128
|
+
return (bare + withRuns.slice(pos)).replace(/<\/a14:m>/g, "");
|
|
119
129
|
}
|
|
120
130
|
async function parseSlide(entries, path, budget) {
|
|
121
131
|
const xml = decodeZipEntry(entries, path, budget);
|
|
@@ -215,6 +225,7 @@ async function pptxTextGrep(filePath, pattern, deadline = ooxmlWorkDeadline()) {
|
|
|
215
225
|
}
|
|
216
226
|
|
|
217
227
|
export {
|
|
228
|
+
inlineSlideMath,
|
|
218
229
|
pptxOutline,
|
|
219
230
|
pptxSlideText,
|
|
220
231
|
pptxAllSlidesText,
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
isIndexedRoot,
|
|
5
|
+
recordIndexedRoot
|
|
6
|
+
} from "./token-goat-chunk-M3LFJDPU.mjs";
|
|
6
7
|
import {
|
|
7
8
|
MAX_FILES_SCANNED,
|
|
8
|
-
getTrackedFiles,
|
|
9
9
|
walkProject
|
|
10
|
-
} from "./token-goat-chunk-
|
|
10
|
+
} from "./token-goat-chunk-ZNMNUPAZ.mjs";
|
|
11
|
+
import {
|
|
12
|
+
reconcileProject
|
|
13
|
+
} from "./token-goat-chunk-PFWIMH2E.mjs";
|
|
11
14
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./token-goat-chunk-
|
|
15
|
+
getTrackedFiles
|
|
16
|
+
} from "./token-goat-chunk-OBOFIHKN.mjs";
|
|
14
17
|
import {
|
|
15
18
|
isDotenvPath
|
|
16
|
-
} from "./token-goat-chunk-
|
|
19
|
+
} from "./token-goat-chunk-GVB2MUST.mjs";
|
|
17
20
|
import {
|
|
18
|
-
findProject,
|
|
19
|
-
isUnderSystemTemp,
|
|
20
21
|
loadConfig
|
|
21
|
-
} from "./token-goat-chunk-
|
|
22
|
+
} from "./token-goat-chunk-7EZTZOMC.mjs";
|
|
23
|
+
import {
|
|
24
|
+
findProject,
|
|
25
|
+
isUnderSystemTemp
|
|
26
|
+
} from "./token-goat-chunk-4GBVPH3D.mjs";
|
|
22
27
|
import {
|
|
23
28
|
envBool
|
|
24
29
|
} from "./token-goat-chunk-IVE6U7KV.mjs";
|
|
@@ -27,7 +32,10 @@ import {
|
|
|
27
32
|
extractErrorMessage,
|
|
28
33
|
isUnderBlockedRoot,
|
|
29
34
|
runGit
|
|
30
|
-
} from "./token-goat-chunk-
|
|
35
|
+
} from "./token-goat-chunk-HU4TORC5.mjs";
|
|
36
|
+
import {
|
|
37
|
+
echoedValue
|
|
38
|
+
} from "./token-goat-chunk-GGGG7RWB.mjs";
|
|
31
39
|
import {
|
|
32
40
|
canonicalize,
|
|
33
41
|
foldPath
|
|
@@ -35,9 +43,6 @@ import {
|
|
|
35
43
|
import {
|
|
36
44
|
normalizePath
|
|
37
45
|
} from "./token-goat-chunk-FNFBKLRD.mjs";
|
|
38
|
-
import {
|
|
39
|
-
globalDbPath
|
|
40
|
-
} from "./token-goat-chunk-VES7EL7O.mjs";
|
|
41
46
|
import {
|
|
42
47
|
init_define_import_meta_env
|
|
43
48
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -76,7 +81,7 @@ function assertWalkableRoot(root) {
|
|
|
76
81
|
}
|
|
77
82
|
const boundary = norm.endsWith("/") ? norm : `${norm}/`;
|
|
78
83
|
if (normHome.startsWith(boundary)) {
|
|
79
|
-
throw new Error(`refusing to walk-index
|
|
84
|
+
throw new Error(`refusing to walk-index ${echoedValue(resolved)} \u2014 it contains the home directory`);
|
|
80
85
|
}
|
|
81
86
|
}
|
|
82
87
|
}
|
|
@@ -89,7 +94,7 @@ function collectWalkIndexFiles(root, opts = {}) {
|
|
|
89
94
|
const { files } = walkProject(resolved, { includeEmbeddableDocuments: true, maxFiles: ceiling });
|
|
90
95
|
if (files.length >= ceiling) {
|
|
91
96
|
throw new Error(
|
|
92
|
-
|
|
97
|
+
`${echoedValue(resolved)} has too many source files (walk stopped at ${ceiling}; the real total is at least that). ` + (force ? "Even --force-walk will not walk a tree this large \u2014 point at a narrower path." : `Index a git repo, point at a narrower path, or pass --force-walk to raise the cap to ${MAX_FILES_SCANNED_FORCED}.`)
|
|
93
98
|
);
|
|
94
99
|
}
|
|
95
100
|
return files.filter((f) => !isWalkExcluded(f));
|
|
@@ -116,9 +121,10 @@ function queueInstallIndex(cwd, opts = {}) {
|
|
|
116
121
|
}
|
|
117
122
|
if (isUnderSystemTemp(root)) return { status: "skipped", reason: "temp", root };
|
|
118
123
|
if (isUnderBlockedRoot(root, loadConfig().worker.blocked_roots)) return { status: "skipped", reason: "blocked", root };
|
|
119
|
-
if (
|
|
124
|
+
if (isIndexedRoot(root)) return { status: "skipped", reason: "indexed", root };
|
|
120
125
|
if (getTrackedFiles(root).length === 0) return { status: "skipped", reason: isOwnGitToplevel(root) ? "untracked" : "not-git", root };
|
|
121
126
|
const result = reconcileProject({ cwd: root, budgetMs: INSTALL_INDEX_BUDGET_MS });
|
|
127
|
+
recordIndexedRoot(root);
|
|
122
128
|
if (result.enqueued === 0) return { status: "skipped", reason: "nothing-queued", root };
|
|
123
129
|
return { status: "queued", root, files: result.enqueued };
|
|
124
130
|
} catch (e) {
|