token-goat 2.9.29 → 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 +53 -42
- package/SECURITY.md +37 -11
- package/THIRD_PARTY_NOTICES.md +41 -4
- 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/ort-wasm-simd-threaded.mjs +59 -0
- package/dist/{token-goat-chunk-SE6E4BKJ.mjs → token-goat-chunk-25TRAWET.mjs} +23 -6
- package/dist/token-goat-chunk-2KXO6V2B.mjs +203 -0
- package/dist/{token-goat-chunk-UXSXQQIY.mjs → token-goat-chunk-2M7E4PF7.mjs} +43 -14
- package/dist/token-goat-chunk-2UPZGKKY.mjs +188 -0
- 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-2WOUYWLM.mjs → token-goat-chunk-4GILLLWY.mjs} +34 -7
- package/dist/token-goat-chunk-4NAPX7BA.mjs +90 -0
- package/dist/{token-goat-chunk-NMBWLRHW.mjs → token-goat-chunk-4SC7UJYV.mjs} +9981 -11563
- package/dist/token-goat-chunk-4SMRO4TO.mjs +366 -0
- package/dist/{token-goat-chunk-O6I2XU4P.mjs → token-goat-chunk-4ZBFWLXF.mjs} +310 -441
- package/dist/token-goat-chunk-57BIAXJL.mjs +286 -0
- package/dist/token-goat-chunk-5AC66HNP.mjs +115 -0
- package/dist/token-goat-chunk-5IMLKSOP.mjs +145 -0
- package/dist/token-goat-chunk-5RG5SBL6.mjs +221 -0
- package/dist/{token-goat-chunk-RRNZMM3A.mjs → token-goat-chunk-5Y6ZYL6U.mjs} +21 -2
- package/dist/token-goat-chunk-646E6U44.mjs +398 -0
- package/dist/token-goat-chunk-65N4RHP4.mjs +33 -0
- package/dist/{token-goat-chunk-6AK46ZT7.mjs → token-goat-chunk-6DG6HWP3.mjs} +13 -3
- package/dist/token-goat-chunk-6ENQSNRZ.mjs +573 -0
- package/dist/token-goat-chunk-6ZY4GNF2.mjs +91 -0
- package/dist/{token-goat-chunk-E5TK5DNO.mjs → token-goat-chunk-76FGDLRO.mjs} +574 -340
- package/dist/{token-goat-chunk-TGOXNAHW.mjs → token-goat-chunk-7EZTZOMC.mjs} +780 -767
- package/dist/token-goat-chunk-7MAOA6X4.mjs +3647 -0
- package/dist/token-goat-chunk-7R2ZVVAX.mjs +218 -0
- package/dist/{token-goat-chunk-TCQANXYC.mjs → token-goat-chunk-AM5V6GSX.mjs} +18 -2
- package/dist/token-goat-chunk-AUNGYYQX.mjs +184 -0
- package/dist/token-goat-chunk-AUQYRMMH.mjs +2985 -0
- package/dist/token-goat-chunk-B3PEKBYG.mjs +128 -0
- package/dist/{token-goat-chunk-KOPIR3KZ.mjs → token-goat-chunk-BA4HI6BW.mjs} +1910 -165
- package/dist/{token-goat-chunk-52NSDWYY.mjs → token-goat-chunk-BFCWY73P.mjs} +58 -20
- package/dist/token-goat-chunk-BPGCUMR7.mjs +30 -0
- package/dist/token-goat-chunk-BWGFUZZE.mjs +25 -0
- package/dist/token-goat-chunk-C75NA7PL.mjs +322 -0
- package/dist/token-goat-chunk-CBIQ7WTD.mjs +87 -0
- package/dist/token-goat-chunk-CETM74KC.mjs +307 -0
- package/dist/token-goat-chunk-CIMQ2BB3.mjs +233 -0
- package/dist/{token-goat-chunk-DNSPXQXQ.mjs → token-goat-chunk-CJLS3CDL.mjs} +70 -18
- package/dist/{token-goat-chunk-MELOKFDJ.mjs → token-goat-chunk-CO3UYX6G.mjs} +7 -1
- package/dist/token-goat-chunk-COPNXRJM.mjs +154 -0
- package/dist/token-goat-chunk-CSJ5L3NL.mjs +479 -0
- package/dist/token-goat-chunk-CVCEVUGK.mjs +315 -0
- package/dist/token-goat-chunk-CXHOFN7R.mjs +371 -0
- package/dist/token-goat-chunk-D735C4QM.mjs +603 -0
- package/dist/{token-goat-chunk-E4ZOJIZK.mjs → token-goat-chunk-DGS2LVNA.mjs} +70 -160
- package/dist/{token-goat-chunk-L7H3U27L.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-EELTBKDM.mjs +613 -0
- package/dist/token-goat-chunk-EVMZJ27Z.mjs +147 -0
- package/dist/token-goat-chunk-EXKGNHEG.mjs +2096 -0
- package/dist/{token-goat-chunk-YOOVFPTP.mjs → token-goat-chunk-F4HYL64R.mjs} +12 -2
- package/dist/token-goat-chunk-F6PAUIEK.mjs +624 -0
- package/dist/token-goat-chunk-FDSREWLX.mjs +692 -0
- package/dist/{token-goat-chunk-NMTKNYGF.mjs → token-goat-chunk-FNFBKLRD.mjs} +74 -9
- package/dist/token-goat-chunk-G5PJ7AGM.mjs +36 -0
- package/dist/token-goat-chunk-GGGG7RWB.mjs +236 -0
- package/dist/{token-goat-chunk-TDUT2CL6.mjs → token-goat-chunk-GL3ETKSC.mjs} +276 -19
- package/dist/{token-goat-chunk-7CPMDFGB.mjs → token-goat-chunk-GVB2MUST.mjs} +265 -1567
- package/dist/token-goat-chunk-GWFLAUMQ.mjs +307 -0
- package/dist/token-goat-chunk-HAVAOB3S.mjs +87 -0
- package/dist/token-goat-chunk-HLPW63A7.mjs +48 -0
- package/dist/token-goat-chunk-HU4TORC5.mjs +1377 -0
- package/dist/token-goat-chunk-I7VKZZAW.mjs +35 -0
- package/dist/token-goat-chunk-IA6XSPE3.mjs +218 -0
- package/dist/token-goat-chunk-IAGXMHIK.mjs +863 -0
- package/dist/{token-goat-chunk-435UQTKD.mjs → token-goat-chunk-IK2DRMFX.mjs} +129 -74
- package/dist/{token-goat-chunk-ZER6EAXZ.mjs → token-goat-chunk-INNPTRUX.mjs} +2954 -2783
- package/dist/token-goat-chunk-JJ5BX4F4.mjs +129 -0
- package/dist/token-goat-chunk-JVFSHVFJ.mjs +129 -0
- package/dist/token-goat-chunk-KGEFFSHD.mjs +50 -0
- package/dist/token-goat-chunk-KKUFXAPD.mjs +25 -0
- package/dist/token-goat-chunk-KQBLRPBN.mjs +433 -0
- package/dist/token-goat-chunk-LCNQ2CNN.mjs +497 -0
- 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-2AWQ2R5X.mjs → token-goat-chunk-MHX7XCC3.mjs} +3 -2
- package/dist/token-goat-chunk-MNWKPRAL.mjs +13 -0
- package/dist/token-goat-chunk-N5LSOVSU.mjs +137 -0
- package/dist/{token-goat-chunk-DPNLUJWB.mjs → token-goat-chunk-N5MMR2IW.mjs} +30 -8
- package/dist/token-goat-chunk-N7B3JQ2C.mjs +160 -0
- package/dist/{token-goat-chunk-VMFWNHGR.mjs → token-goat-chunk-NISNMD7T.mjs} +2545 -2953
- package/dist/token-goat-chunk-NMD42SFQ.mjs +434 -0
- package/dist/token-goat-chunk-NOSS5VWY.mjs +174 -0
- package/dist/token-goat-chunk-NSNSPPBG.mjs +69 -0
- package/dist/token-goat-chunk-OBOFIHKN.mjs +38 -0
- package/dist/token-goat-chunk-OBRFJ5O5.mjs +76 -0
- package/dist/token-goat-chunk-ODBT2USM.mjs +800 -0
- 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-ASLWOQ3I.mjs → token-goat-chunk-OYIYKDDT.mjs} +2 -1
- package/dist/{token-goat-chunk-67BNIKKO.mjs → token-goat-chunk-P6HQSWQ3.mjs} +55 -47
- package/dist/token-goat-chunk-P6VGNTQT.mjs +71 -0
- package/dist/token-goat-chunk-PFWIMH2E.mjs +261 -0
- package/dist/token-goat-chunk-PJZXIS3G.mjs +39 -0
- package/dist/token-goat-chunk-PUO5INXP.mjs +606 -0
- package/dist/token-goat-chunk-PX5PQWTY.mjs +462 -0
- package/dist/token-goat-chunk-Q5QDBC6O.mjs +111 -0
- package/dist/token-goat-chunk-QFNQXSDT.mjs +40 -0
- package/dist/token-goat-chunk-QH7YVYOY.mjs +3957 -0
- package/dist/token-goat-chunk-QLMUHEPB.mjs +43 -0
- package/dist/{token-goat-chunk-PYSUADX4.mjs → token-goat-chunk-QQOJIHL3.mjs} +50 -14
- package/dist/token-goat-chunk-QQTWJY2O.mjs +85 -0
- package/dist/token-goat-chunk-QYHO5CPH.mjs +93 -0
- package/dist/token-goat-chunk-RELAVWAD.mjs +27 -0
- package/dist/token-goat-chunk-RSLPOBKQ.mjs +339 -0
- package/dist/token-goat-chunk-SAMFDIS2.mjs +712 -0
- package/dist/token-goat-chunk-SDELXLDM.mjs +48 -0
- package/dist/{token-goat-chunk-PGTH2U4C.mjs → token-goat-chunk-SOAFZNNZ.mjs} +164 -40
- package/dist/{token-goat-chunk-G23DWHV4.mjs → token-goat-chunk-SRTHT7KV.mjs} +33 -15
- package/dist/token-goat-chunk-T5P5ACNQ.mjs +212 -0
- package/dist/token-goat-chunk-T5YGG4V3.mjs +45 -0
- package/dist/token-goat-chunk-TAUZ4OFS.mjs +110 -0
- package/dist/token-goat-chunk-TM6MC754.mjs +40 -0
- package/dist/token-goat-chunk-TWUKBOMP.mjs +72 -0
- package/dist/token-goat-chunk-U2KSB4SG.mjs +56 -0
- package/dist/token-goat-chunk-U4WHMG6Y.mjs +898 -0
- package/dist/token-goat-chunk-UA5V6P3P.mjs +122 -0
- package/dist/token-goat-chunk-UGJHGR5A.mjs +52 -0
- package/dist/{token-goat-chunk-RQGGMPCR.mjs → token-goat-chunk-UOUDVA5U.mjs} +76 -16
- package/dist/{token-goat-chunk-HNFZZHFW.mjs → token-goat-chunk-URRJ33GR.mjs} +22 -4
- package/dist/token-goat-chunk-UZOROKIS.mjs +165 -0
- package/dist/token-goat-chunk-VIHGGGEI.mjs +4234 -0
- package/dist/token-goat-chunk-VTJLAA7P.mjs +21 -0
- package/dist/token-goat-chunk-VWDXLT4F.mjs +678 -0
- package/dist/token-goat-chunk-VWZA2H4P.mjs +368 -0
- package/dist/{token-goat-chunk-QO3LXVVR.mjs → token-goat-chunk-VXEXMJDL.mjs} +2964 -3153
- package/dist/token-goat-chunk-WBA5SKT4.mjs +547 -0
- package/dist/{token-goat-chunk-ONXH6NZ5.mjs → token-goat-chunk-WDH44VAU.mjs} +19 -22
- package/dist/token-goat-chunk-X2SUP3EI.mjs +107 -0
- package/dist/token-goat-chunk-X3BELZSJ.mjs +125 -0
- package/dist/{token-goat-chunk-RLP6J7WR.mjs → token-goat-chunk-XLRBNZCC.mjs} +40 -21
- package/dist/{token-goat-chunk-S4VSXURL.mjs → token-goat-chunk-XRKUX6CM.mjs} +4 -0
- package/dist/token-goat-chunk-XX6O25RN.mjs +82 -0
- package/dist/token-goat-chunk-XZSUHBVS.mjs +65 -0
- package/dist/token-goat-chunk-Y2ZTQOCL.mjs +35 -0
- package/dist/{token-goat-chunk-UA5BKWWQ.mjs → token-goat-chunk-YB4VMGK2.mjs} +15 -4
- package/dist/token-goat-chunk-YBIIY3HR.mjs +51 -0
- package/dist/{token-goat-chunk-PKRWMHVP.mjs → token-goat-chunk-YHVDKQBR.mjs} +389 -221
- package/dist/token-goat-chunk-YJB5XLWI.mjs +26 -0
- package/dist/{token-goat-chunk-PQ53BSCF.mjs → token-goat-chunk-YKB6AQG3.mjs} +53 -31
- package/dist/token-goat-chunk-YMTG2YA5.mjs +35 -0
- package/dist/token-goat-chunk-YPBZYQRV.mjs +40 -0
- package/dist/{token-goat-chunk-HUYUHODZ.mjs → token-goat-chunk-YY6AVUFL.mjs} +13246 -12247
- package/dist/token-goat-chunk-Z7N5OMMP.mjs +98 -0
- package/dist/{token-goat-chunk-BGHSSJUA.mjs → token-goat-chunk-ZFOBKUWH.mjs} +1 -1
- package/dist/token-goat-chunk-ZMBL6UVV.mjs +110 -0
- package/dist/token-goat-chunk-ZNMNUPAZ.mjs +938 -0
- package/dist/token-goat-hook-client.cjs +87 -23
- package/dist/token-goat-hook-client.mjs +3 -3
- package/dist/token-goat-hook.mjs +76 -31
- package/dist/token-goat.core.mjs +6 -6
- package/docs/C4_RUNTIME_ARCHITECTURE.md +2 -2
- package/docs/cli.md +113 -60
- package/docs/install.md +63 -20
- package/docs/security.md +10 -8
- package/package.json +18 -7
- package/scripts/verify-native-dist.mjs +386 -0
- package/dist/token-goat-chunk-2NNUA2LR.mjs +0 -143
- package/dist/token-goat-chunk-44BM7DDQ.mjs +0 -294
- package/dist/token-goat-chunk-BGYOZ6DO.mjs +0 -24
- package/dist/token-goat-chunk-C5YPNZKQ.mjs +0 -318
- package/dist/token-goat-chunk-CIQ2FTY3.mjs +0 -1990
- package/dist/token-goat-chunk-D4ETHJD6.mjs +0 -246
- package/dist/token-goat-chunk-DNRPXHYH.mjs +0 -1062
- package/dist/token-goat-chunk-EUSDXRXU.mjs +0 -1429
- package/dist/token-goat-chunk-FTP4U4QA.mjs +0 -64
- package/dist/token-goat-chunk-G7IWXCFF.mjs +0 -456
- package/dist/token-goat-chunk-GLXRTTLE.mjs +0 -36
- package/dist/token-goat-chunk-H5J3C56Q.mjs +0 -1511
- package/dist/token-goat-chunk-IVWI2OCK.mjs +0 -368
- package/dist/token-goat-chunk-JTKCQMQA.mjs +0 -418
- package/dist/token-goat-chunk-LZNBQTDK.mjs +0 -26
- package/dist/token-goat-chunk-ORNFMIER.mjs +0 -295
- package/dist/token-goat-chunk-RTMVLHWX.mjs +0 -7113
- package/dist/token-goat-chunk-VQ6F6T7X.mjs +0 -36
- package/dist/token-goat-chunk-VZQEWRVH.mjs +0 -312
- package/dist/token-goat-chunk-XYWPOSCN.mjs +0 -807
- package/dist/token-goat-chunk-YAGLESS3.mjs +0 -23
- package/dist/token-goat-chunk-YKSRAWUU.mjs +0 -33
- package/dist/token-goat-chunk-Z6KBMOBI.mjs +0 -53
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
+
const require = __cjsRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
XlsxScanTooLargeError,
|
|
5
|
+
allSheetsHeadText,
|
|
6
|
+
formatXlsxColumns,
|
|
7
|
+
formatXlsxRange,
|
|
8
|
+
headSheet,
|
|
9
|
+
listSheets,
|
|
10
|
+
querySheet,
|
|
11
|
+
rangeSheet,
|
|
12
|
+
xlsxColumns
|
|
13
|
+
} from "./token-goat-chunk-QQOJIHL3.mjs";
|
|
14
|
+
import "./token-goat-chunk-CJLS3CDL.mjs";
|
|
15
|
+
import "./token-goat-chunk-3BTK54F3.mjs";
|
|
16
|
+
import "./token-goat-chunk-T5P5ACNQ.mjs";
|
|
17
|
+
import "./token-goat-chunk-7EZTZOMC.mjs";
|
|
18
|
+
import "./token-goat-chunk-QYHO5CPH.mjs";
|
|
19
|
+
import "./token-goat-chunk-4GBVPH3D.mjs";
|
|
20
|
+
import "./token-goat-chunk-YZAAZU2S.mjs";
|
|
21
|
+
import "./token-goat-chunk-IVE6U7KV.mjs";
|
|
22
|
+
import "./token-goat-chunk-2M7E4PF7.mjs";
|
|
23
|
+
import "./token-goat-chunk-E45INMY3.mjs";
|
|
24
|
+
import "./token-goat-chunk-EDBDRVH5.mjs";
|
|
25
|
+
import "./token-goat-chunk-AH6QILZM.mjs";
|
|
26
|
+
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
27
|
+
import "./token-goat-chunk-HU4TORC5.mjs";
|
|
28
|
+
import "./token-goat-chunk-GGGG7RWB.mjs";
|
|
29
|
+
import "./token-goat-chunk-AM5V6GSX.mjs";
|
|
30
|
+
import "./token-goat-chunk-FNFBKLRD.mjs";
|
|
31
|
+
import "./token-goat-chunk-CO3UYX6G.mjs";
|
|
32
|
+
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
33
|
+
export {
|
|
34
|
+
XlsxScanTooLargeError,
|
|
35
|
+
allSheetsHeadText,
|
|
36
|
+
formatXlsxColumns,
|
|
37
|
+
formatXlsxRange,
|
|
38
|
+
headSheet,
|
|
39
|
+
listSheets,
|
|
40
|
+
querySheet,
|
|
41
|
+
rangeSheet,
|
|
42
|
+
xlsxColumns
|
|
43
|
+
};
|
|
@@ -3,7 +3,13 @@ const require = __cjsRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
queryCsv,
|
|
5
5
|
quoteCsvCell
|
|
6
|
-
} from "./token-goat-chunk-
|
|
6
|
+
} from "./token-goat-chunk-CJLS3CDL.mjs";
|
|
7
|
+
import {
|
|
8
|
+
redactSecrets
|
|
9
|
+
} from "./token-goat-chunk-T5P5ACNQ.mjs";
|
|
10
|
+
import {
|
|
11
|
+
loadConfig
|
|
12
|
+
} from "./token-goat-chunk-7EZTZOMC.mjs";
|
|
7
13
|
import {
|
|
8
14
|
NotAnOfficeDocumentError,
|
|
9
15
|
assertOoxmlWithinDeadline,
|
|
@@ -12,13 +18,19 @@ import {
|
|
|
12
18
|
ooxmlWorkDeadline,
|
|
13
19
|
parseOoxmlPart,
|
|
14
20
|
readOoxmlZip
|
|
15
|
-
} from "./token-goat-chunk-
|
|
16
|
-
import {
|
|
17
|
-
displaySafeText
|
|
18
|
-
} from "./token-goat-chunk-NMTKNYGF.mjs";
|
|
21
|
+
} from "./token-goat-chunk-2M7E4PF7.mjs";
|
|
19
22
|
import {
|
|
20
23
|
DocumentRefusedError
|
|
21
24
|
} from "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
25
|
+
import {
|
|
26
|
+
countNoun
|
|
27
|
+
} from "./token-goat-chunk-HU4TORC5.mjs";
|
|
28
|
+
import {
|
|
29
|
+
echoedValue
|
|
30
|
+
} from "./token-goat-chunk-GGGG7RWB.mjs";
|
|
31
|
+
import {
|
|
32
|
+
displaySafeText
|
|
33
|
+
} from "./token-goat-chunk-FNFBKLRD.mjs";
|
|
22
34
|
import {
|
|
23
35
|
init_define_import_meta_env
|
|
24
36
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -314,7 +326,7 @@ function assertCellCount(cells, extent, hint) {
|
|
|
314
326
|
function assertScannableExtent(ws) {
|
|
315
327
|
assertCellCount(
|
|
316
328
|
(ws.rowCount || 0) * (ws.columnCount || 0),
|
|
317
|
-
`sheet
|
|
329
|
+
`sheet ${echoedValue(ws.name)} declares a used range of ${ws.rowCount} rows x ${ws.columnCount} cols`,
|
|
318
330
|
"read a bounded range with xlsx-range --range"
|
|
319
331
|
);
|
|
320
332
|
}
|
|
@@ -385,6 +397,7 @@ function cellFormula(cell) {
|
|
|
385
397
|
}
|
|
386
398
|
return void 0;
|
|
387
399
|
}
|
|
400
|
+
var EMPTY_SHEET_NOTE = "(nothing to show: the sheet is empty)";
|
|
388
401
|
function usedRange(ws) {
|
|
389
402
|
assertScannableExtent(ws);
|
|
390
403
|
let maxCol = 0;
|
|
@@ -453,13 +466,14 @@ function headSheetFromWorksheet(ws, rows, columns) {
|
|
|
453
466
|
const lines = [header.map(quoteCsvCell).join(",")];
|
|
454
467
|
for (const r of dataRows) lines.push(r.map(quoteCsvCell).join(","));
|
|
455
468
|
if (rowCount - 1 > dataRows.length) {
|
|
456
|
-
lines.push(`...(${rowCount - 1 - dataRows.length
|
|
469
|
+
lines.push(`...(${countNoun(rowCount - 1 - dataRows.length, "more row")} elided; use --rows to see more, or xlsx-query for filtering)`);
|
|
457
470
|
}
|
|
458
471
|
return lines.join("\n");
|
|
459
472
|
}
|
|
460
473
|
async function headSheet(filePath, sheetName, rows = 20, columns) {
|
|
461
474
|
const wb = await loadWorkbook(filePath);
|
|
462
475
|
const ws = requireSheet(wb, sheetName);
|
|
476
|
+
if ((ws.columnCount || 0) === 0) return EMPTY_SHEET_NOTE;
|
|
463
477
|
return headSheetFromWorksheet(ws, rows, columns);
|
|
464
478
|
}
|
|
465
479
|
async function allSheetsHeadText(filePath, rows, deadline = ooxmlWorkDeadline()) {
|
|
@@ -472,6 +486,18 @@ ${headSheetFromWorksheet(ws, rows)}`);
|
|
|
472
486
|
}
|
|
473
487
|
return sheetTexts.join("\n\n");
|
|
474
488
|
}
|
|
489
|
+
function pastUsedRangeNote(range, usedRows, usedCols) {
|
|
490
|
+
if (usedRows === 0 || usedCols === 0) return EMPTY_SHEET_NOTE;
|
|
491
|
+
const usedRef = `A1:${encodeCell({ r: usedRows, c: usedCols })}`;
|
|
492
|
+
if (range.s.r > usedRows || range.s.c > usedCols) {
|
|
493
|
+
return `(nothing to show: ${encodeCell(range.s)}:${encodeCell(range.e)} is past the sheet's used range ${usedRef})`;
|
|
494
|
+
}
|
|
495
|
+
const span = (noun, from, to) => from === to ? `${noun} ${from}` : `${noun}s ${from}-${to}`;
|
|
496
|
+
const parts = [];
|
|
497
|
+
if (range.e.r > usedRows) parts.push(span("row", String(usedRows + 1), String(range.e.r)));
|
|
498
|
+
if (range.e.c > usedCols) parts.push(span("column", indexToColLetters(usedCols + 1), indexToColLetters(range.e.c)));
|
|
499
|
+
return parts.length > 0 ? `(not shown: ${parts.join(" and ")}, past the sheet's used range ${usedRef})` : void 0;
|
|
500
|
+
}
|
|
475
501
|
async function rangeSheet(filePath, sheetName, rangeSpec, showFormulas) {
|
|
476
502
|
const wb = await loadWorkbook(filePath);
|
|
477
503
|
const ws = requireSheet(wb, sheetName);
|
|
@@ -479,10 +505,14 @@ async function rangeSheet(filePath, sheetName, rangeSpec, showFormulas) {
|
|
|
479
505
|
const rangeRows = range.e.r - range.s.r + 1;
|
|
480
506
|
const rangeCols = range.e.c - range.s.c + 1;
|
|
481
507
|
assertCellCount(rangeRows * rangeCols, `range ${rangeSpec} covers ${rangeRows} rows x ${rangeCols} cols`, "ask for a smaller --range");
|
|
508
|
+
const usedRows = ws.rowCount || 0;
|
|
509
|
+
const usedCols = ws.columnCount || 0;
|
|
510
|
+
const lastRow = range.s.c > usedCols ? 0 : Math.min(range.e.r, usedRows);
|
|
511
|
+
const lastCol = Math.min(range.e.c, usedCols);
|
|
482
512
|
const rowsOut = [];
|
|
483
|
-
for (let r = range.s.r; r <=
|
|
513
|
+
for (let r = range.s.r; r <= lastRow; r++) {
|
|
484
514
|
const rowOut = [];
|
|
485
|
-
for (let c = range.s.c; c <=
|
|
515
|
+
for (let c = range.s.c; c <= lastCol; c++) {
|
|
486
516
|
const addr = encodeCell({ r, c });
|
|
487
517
|
const cell = ws.getCell(addr);
|
|
488
518
|
if (showFormulas && cellFormula(cell) !== void 0) {
|
|
@@ -494,11 +524,13 @@ async function rangeSheet(filePath, sheetName, rangeSpec, showFormulas) {
|
|
|
494
524
|
rowsOut.push(rowOut);
|
|
495
525
|
}
|
|
496
526
|
const colLabels = rowsOut[0]?.map((_, i) => indexToColLetters(range.s.c + i)) ?? [];
|
|
497
|
-
|
|
527
|
+
const note = pastUsedRangeNote(range, usedRows, usedCols);
|
|
528
|
+
return { header: colLabels, rows: rowsOut, ...note !== void 0 ? { note } : {} };
|
|
498
529
|
}
|
|
499
530
|
function formatXlsxRange(result) {
|
|
500
|
-
const lines = [result.header.map(quoteCsvCell).join(",")];
|
|
531
|
+
const lines = result.rows.length > 0 ? [result.header.map(quoteCsvCell).join(",")] : [];
|
|
501
532
|
for (const r of result.rows) lines.push(r.map(quoteCsvCell).join(","));
|
|
533
|
+
if (result.note !== void 0) lines.push(result.note);
|
|
502
534
|
return lines.join("\n");
|
|
503
535
|
}
|
|
504
536
|
async function sheetToCsv(ws) {
|
|
@@ -562,14 +594,18 @@ async function xlsxColumns(filePath, sheetName, sampleLimit = 100) {
|
|
|
562
594
|
columns: colSummaries
|
|
563
595
|
};
|
|
564
596
|
}
|
|
565
|
-
function formatXlsxColumns(result) {
|
|
566
|
-
if (result.columns.length === 0) return `Sheet
|
|
597
|
+
function formatXlsxColumns(result, config = loadConfig()) {
|
|
598
|
+
if (result.columns.length === 0) return `Sheet ${echoedValue(result.sheetName)} is empty`;
|
|
599
|
+
const clip = (v) => {
|
|
600
|
+
const safe = redactSecrets(v, config).text;
|
|
601
|
+
return safe.length > 30 ? safe.slice(0, 27) + "..." : safe;
|
|
602
|
+
};
|
|
567
603
|
const lines = [
|
|
568
604
|
`Sheet: ${displaySafeText(result.sheetName)} (${result.totalSheetRows} data rows, ${result.columns.length} columns; sampled first ${result.sampleRows} rows)`
|
|
569
605
|
];
|
|
570
606
|
for (const c of result.columns) {
|
|
571
607
|
const pct = result.sampleRows > 0 ? Math.round(c.nonEmptyRows / c.sampleRows * 100) : 0;
|
|
572
|
-
const samples = c.sampleValues.length > 0 ? ` (e.g. ${c.sampleValues.map((v) => JSON.stringify(
|
|
608
|
+
const samples = c.sampleValues.length > 0 ? ` (e.g. ${c.sampleValues.map((v) => JSON.stringify(clip(v))).join(", ")})` : " (all empty)";
|
|
573
609
|
lines.push(` ${c.letter.padEnd(4)} ${displaySafeText(c.name).padEnd(25)} ${c.nonEmptyRows}/${c.sampleRows} (${pct}%)${samples}`);
|
|
574
610
|
}
|
|
575
611
|
return lines.join("\n");
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
+
const require = __cjsRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
colorStdout,
|
|
5
|
+
stripAnsiEscapes
|
|
6
|
+
} from "./token-goat-chunk-HAVAOB3S.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ensureNewline
|
|
9
|
+
} from "./token-goat-chunk-HU4TORC5.mjs";
|
|
10
|
+
import {
|
|
11
|
+
init_define_import_meta_env
|
|
12
|
+
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
13
|
+
|
|
14
|
+
// src/emit.ts
|
|
15
|
+
init_define_import_meta_env();
|
|
16
|
+
function emit(text) {
|
|
17
|
+
const payload = colorStdout() ? text : stripAnsiEscapes(text);
|
|
18
|
+
process.stdout.write(ensureNewline(payload));
|
|
19
|
+
}
|
|
20
|
+
function emitErr(text) {
|
|
21
|
+
process.stderr.write(ensureNewline(text));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/jsonc_text.ts
|
|
25
|
+
init_define_import_meta_env();
|
|
26
|
+
import { createRequire } from "node:module";
|
|
27
|
+
var jsoncParser;
|
|
28
|
+
function jsonc() {
|
|
29
|
+
jsoncParser ??= createRequire(import.meta.url)("jsonc-parser");
|
|
30
|
+
return jsoncParser;
|
|
31
|
+
}
|
|
32
|
+
var CLOSE_BRACE = 2;
|
|
33
|
+
var CLOSE_BRACKET = 4;
|
|
34
|
+
var COMMA = 5;
|
|
35
|
+
var LINE_COMMENT = 12;
|
|
36
|
+
var BLOCK_COMMENT = 13;
|
|
37
|
+
var LINE_BREAK = 14;
|
|
38
|
+
var WHITESPACE = 15;
|
|
39
|
+
var EOF = 17;
|
|
40
|
+
function jsoncToJson(text) {
|
|
41
|
+
const scanner = jsonc().createScanner(text, false);
|
|
42
|
+
const out = [];
|
|
43
|
+
let heldComma = false;
|
|
44
|
+
let heldTrivia = [];
|
|
45
|
+
for (let kind = scanner.scan(); kind !== EOF; kind = scanner.scan()) {
|
|
46
|
+
if (kind === LINE_COMMENT || kind === BLOCK_COMMENT) continue;
|
|
47
|
+
const raw = text.slice(scanner.getTokenOffset(), scanner.getTokenOffset() + scanner.getTokenLength());
|
|
48
|
+
if (heldComma) {
|
|
49
|
+
if (kind === LINE_BREAK || kind === WHITESPACE) {
|
|
50
|
+
heldTrivia.push(raw);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (kind !== CLOSE_BRACE && kind !== CLOSE_BRACKET) out.push(",");
|
|
54
|
+
out.push(...heldTrivia);
|
|
55
|
+
heldComma = false;
|
|
56
|
+
heldTrivia = [];
|
|
57
|
+
}
|
|
58
|
+
if (kind === COMMA) heldComma = true;
|
|
59
|
+
else out.push(raw);
|
|
60
|
+
}
|
|
61
|
+
if (heldComma) out.push(",", ...heldTrivia);
|
|
62
|
+
return out.join("");
|
|
63
|
+
}
|
|
64
|
+
function stripBom(text) {
|
|
65
|
+
return text.charCodeAt(0) === 65279 ? text.slice(1) : text;
|
|
66
|
+
}
|
|
67
|
+
function parseJsonOrJsonc(raw, opts = {}) {
|
|
68
|
+
const text = stripBom(raw);
|
|
69
|
+
try {
|
|
70
|
+
return JSON.parse(text);
|
|
71
|
+
} catch (strictError) {
|
|
72
|
+
const errors = [];
|
|
73
|
+
jsonc().parse(text, errors, { allowTrailingComma: opts.allowTrailingComma !== false, disallowComments: false, allowEmptyContent: false });
|
|
74
|
+
if (errors.length > 0) throw strictError;
|
|
75
|
+
return JSON.parse(jsoncToJson(text));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
emit,
|
|
81
|
+
emitErr,
|
|
82
|
+
jsonc,
|
|
83
|
+
stripBom,
|
|
84
|
+
parseJsonOrJsonc
|
|
85
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
+
const require = __cjsRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
registerReset
|
|
5
|
+
} from "./token-goat-chunk-YZAAZU2S.mjs";
|
|
6
|
+
import {
|
|
7
|
+
ENV_KEYS
|
|
8
|
+
} from "./token-goat-chunk-CO3UYX6G.mjs";
|
|
9
|
+
import {
|
|
10
|
+
init_define_import_meta_env
|
|
11
|
+
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
12
|
+
|
|
13
|
+
// src/bridges/registry.ts
|
|
14
|
+
init_define_import_meta_env();
|
|
15
|
+
var KNOWN_HARNESS_NAMES = /* @__PURE__ */ new Set([
|
|
16
|
+
"claudecode",
|
|
17
|
+
"codex",
|
|
18
|
+
"opencode",
|
|
19
|
+
"gemini",
|
|
20
|
+
"hermes",
|
|
21
|
+
"openclaw",
|
|
22
|
+
"pi",
|
|
23
|
+
"copilot_cli",
|
|
24
|
+
"grok",
|
|
25
|
+
"qwen",
|
|
26
|
+
"kimi",
|
|
27
|
+
"vscode",
|
|
28
|
+
"antigravity",
|
|
29
|
+
"visualstudio",
|
|
30
|
+
"generic"
|
|
31
|
+
]);
|
|
32
|
+
var relaySeededSessionIdValue;
|
|
33
|
+
function setRelaySeededSessionId(id) {
|
|
34
|
+
relaySeededSessionIdValue = id;
|
|
35
|
+
}
|
|
36
|
+
function relaySeededSessionId() {
|
|
37
|
+
return relaySeededSessionIdValue;
|
|
38
|
+
}
|
|
39
|
+
function detectHarness() {
|
|
40
|
+
const env = process.env;
|
|
41
|
+
const override = (env[ENV_KEYS.HARNESS_OVERRIDE] ?? "").toLowerCase().trim();
|
|
42
|
+
if (override && KNOWN_HARNESS_NAMES.has(override)) {
|
|
43
|
+
return override;
|
|
44
|
+
}
|
|
45
|
+
if (env["HERMES_SESSION_ID"] || env["HERMES_HOME"]) {
|
|
46
|
+
return "hermes";
|
|
47
|
+
}
|
|
48
|
+
if (env["TERM_PROGRAM"] === "claude-code" || env["CLAUDE_CODE_VERSION"] !== void 0 || env["CLAUDE_CODE_SESSION_ID"] && env["CLAUDE_CODE_SESSION_ID"] !== relaySeededSessionIdValue) {
|
|
49
|
+
return "claudecode";
|
|
50
|
+
}
|
|
51
|
+
if (env["CODEX_SESSION_ID"] !== void 0 || env["CODEX_SESSION"]) {
|
|
52
|
+
return "codex";
|
|
53
|
+
}
|
|
54
|
+
const opencodePid = env["OPENCODE_PID"];
|
|
55
|
+
if (env["OPENCODE_SESSION_ID"] !== void 0 || env["OPENCODE_SESSION"] || opencodePid !== void 0 && (opencodePid === String(process.pid) || opencodePid === String(process.ppid))) {
|
|
56
|
+
return "opencode";
|
|
57
|
+
}
|
|
58
|
+
if (env["GROK_SESSION_ID"] !== void 0) {
|
|
59
|
+
return "grok";
|
|
60
|
+
}
|
|
61
|
+
if (env["OPENCLAW_SESSION_ID"] !== void 0) {
|
|
62
|
+
return "openclaw";
|
|
63
|
+
}
|
|
64
|
+
if (env["ANTHROPIC_API_KEY"]) {
|
|
65
|
+
return "claudecode";
|
|
66
|
+
}
|
|
67
|
+
if (env["OPENAI_API_KEY"] && !env["ANTHROPIC_API_KEY"]) {
|
|
68
|
+
return "codex";
|
|
69
|
+
}
|
|
70
|
+
if ((env["GEMINI_API_KEY"] || env["GOOGLE_API_KEY"]) && !env["ANTHROPIC_API_KEY"]) {
|
|
71
|
+
return "gemini";
|
|
72
|
+
}
|
|
73
|
+
return "generic";
|
|
74
|
+
}
|
|
75
|
+
var _cached = null;
|
|
76
|
+
function getHarnessName() {
|
|
77
|
+
if (_cached === null) {
|
|
78
|
+
_cached = detectHarness();
|
|
79
|
+
}
|
|
80
|
+
return _cached;
|
|
81
|
+
}
|
|
82
|
+
function resetHarnessCache() {
|
|
83
|
+
_cached = null;
|
|
84
|
+
}
|
|
85
|
+
registerReset(resetHarnessCache, { perRequest: true });
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
KNOWN_HARNESS_NAMES,
|
|
89
|
+
setRelaySeededSessionId,
|
|
90
|
+
relaySeededSessionId,
|
|
91
|
+
detectHarness,
|
|
92
|
+
getHarnessName
|
|
93
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
+
const require = __cjsRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
capJsonRows,
|
|
5
|
+
estimateTokens,
|
|
6
|
+
estimateTokensFromLength,
|
|
7
|
+
isCappedOutput,
|
|
8
|
+
sliceToEstimatedTokens,
|
|
9
|
+
trimToBudget
|
|
10
|
+
} from "./token-goat-chunk-BFCWY73P.mjs";
|
|
11
|
+
import "./token-goat-chunk-KGEFFSHD.mjs";
|
|
12
|
+
import "./token-goat-chunk-XX6O25RN.mjs";
|
|
13
|
+
import "./token-goat-chunk-HAVAOB3S.mjs";
|
|
14
|
+
import "./token-goat-chunk-HU4TORC5.mjs";
|
|
15
|
+
import "./token-goat-chunk-GGGG7RWB.mjs";
|
|
16
|
+
import "./token-goat-chunk-AM5V6GSX.mjs";
|
|
17
|
+
import "./token-goat-chunk-FNFBKLRD.mjs";
|
|
18
|
+
import "./token-goat-chunk-CO3UYX6G.mjs";
|
|
19
|
+
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
20
|
+
export {
|
|
21
|
+
capJsonRows,
|
|
22
|
+
estimateTokens,
|
|
23
|
+
estimateTokensFromLength,
|
|
24
|
+
isCappedOutput,
|
|
25
|
+
sliceToEstimatedTokens,
|
|
26
|
+
trimToBudget
|
|
27
|
+
};
|