token-goat 2.9.29 → 2.9.30
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 +34 -40
- package/SECURITY.md +28 -10
- package/THIRD_PARTY_NOTICES.md +40 -3
- package/dist/native/linux-arm64/tg-hook +0 -0
- package/dist/native/linux-x64/tg-hook +0 -0
- package/dist/ort-wasm-simd-threaded.mjs +59 -0
- package/dist/token-goat-chunk-3CHUNJ2O.mjs +53 -0
- package/dist/token-goat-chunk-3Z5S4KGM.mjs +918 -0
- package/dist/token-goat-chunk-4FVIAHSI.mjs +211 -0
- package/dist/{token-goat-chunk-PGTH2U4C.mjs → token-goat-chunk-4JJS54TR.mjs} +4 -3
- package/dist/token-goat-chunk-4LCCNRTG.mjs +313 -0
- package/dist/{token-goat-chunk-L7H3U27L.mjs → token-goat-chunk-54K3EUV3.mjs} +1 -1
- package/dist/token-goat-chunk-56EIMS3E.mjs +159 -0
- package/dist/token-goat-chunk-5BCIJXMO.mjs +609 -0
- package/dist/token-goat-chunk-5KDMCMF2.mjs +362 -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-GLXRTTLE.mjs → token-goat-chunk-64FBPDTK.mjs} +12 -8
- package/dist/{token-goat-chunk-G23DWHV4.mjs → token-goat-chunk-664RTTUV.mjs} +28 -15
- package/dist/token-goat-chunk-67TQJ76B.mjs +57 -0
- package/dist/token-goat-chunk-6QMAS7AB.mjs +42 -0
- package/dist/token-goat-chunk-7BXSNBY5.mjs +253 -0
- package/dist/{token-goat-chunk-IVWI2OCK.mjs → token-goat-chunk-7F2UBPD3.mjs} +40 -11
- package/dist/{token-goat-chunk-TGOXNAHW.mjs → token-goat-chunk-7IN2MKDS.mjs} +682 -501
- package/dist/token-goat-chunk-7NADEDKJ.mjs +124 -0
- package/dist/{token-goat-chunk-KOPIR3KZ.mjs → token-goat-chunk-A3CK6N5Z.mjs} +618 -72
- package/dist/{token-goat-chunk-O6I2XU4P.mjs → token-goat-chunk-AFLYLHDH.mjs} +44 -31
- package/dist/{token-goat-chunk-TCQANXYC.mjs → token-goat-chunk-AM5V6GSX.mjs} +18 -2
- package/dist/{token-goat-chunk-E4ZOJIZK.mjs → token-goat-chunk-APGZXSPS.mjs} +39 -146
- package/dist/{token-goat-chunk-D4ETHJD6.mjs → token-goat-chunk-ARDNEC2U.mjs} +9 -7
- package/dist/token-goat-chunk-ATCPY7EQ.mjs +134 -0
- package/dist/token-goat-chunk-B2RZZCSS.mjs +354 -0
- package/dist/{token-goat-chunk-BGYOZ6DO.mjs → token-goat-chunk-B45VMIIH.mjs} +6 -7
- package/dist/token-goat-chunk-BPGCUMR7.mjs +30 -0
- package/dist/{token-goat-chunk-TDUT2CL6.mjs → token-goat-chunk-C63JQV5K.mjs} +45 -6
- package/dist/{token-goat-chunk-ZER6EAXZ.mjs → token-goat-chunk-COBQGL5S.mjs} +2661 -2440
- package/dist/token-goat-chunk-COTXZHTS.mjs +39 -0
- package/dist/{token-goat-chunk-RQGGMPCR.mjs → token-goat-chunk-CYCEYAEO.mjs} +76 -16
- package/dist/token-goat-chunk-CZ3LUXYZ.mjs +4115 -0
- package/dist/{token-goat-chunk-ASLWOQ3I.mjs → token-goat-chunk-DZX2YDPT.mjs} +2 -1
- package/dist/token-goat-chunk-E3OQX2XT.mjs +824 -0
- package/dist/token-goat-chunk-EFHMMIGP.mjs +68 -0
- package/dist/token-goat-chunk-ETBHVDB6.mjs +328 -0
- package/dist/token-goat-chunk-EVMZJ27Z.mjs +147 -0
- package/dist/token-goat-chunk-EXKGNHEG.mjs +2096 -0
- package/dist/{token-goat-chunk-RTMVLHWX.mjs → token-goat-chunk-FBNQNSJK.mjs} +2555 -5127
- package/dist/{token-goat-chunk-NMTKNYGF.mjs → token-goat-chunk-FNFBKLRD.mjs} +74 -9
- package/dist/{token-goat-chunk-RLP6J7WR.mjs → token-goat-chunk-FZ3NEW5O.mjs} +33 -19
- package/dist/token-goat-chunk-G5PJ7AGM.mjs +36 -0
- package/dist/{token-goat-chunk-DNRPXHYH.mjs → token-goat-chunk-GFBSN7BD.mjs} +29 -401
- package/dist/{token-goat-chunk-XYWPOSCN.mjs → token-goat-chunk-GOLEOXZP.mjs} +763 -211
- package/dist/token-goat-chunk-H2K3QP6H.mjs +24 -0
- package/dist/token-goat-chunk-H2PHHGM5.mjs +188 -0
- package/dist/token-goat-chunk-HAVAOB3S.mjs +87 -0
- package/dist/token-goat-chunk-HG45AF2B.mjs +2228 -0
- package/dist/{token-goat-chunk-HUYUHODZ.mjs → token-goat-chunk-HOJLCGDP.mjs} +12965 -11748
- package/dist/{token-goat-chunk-435UQTKD.mjs → token-goat-chunk-HYBFA5X3.mjs} +118 -19
- package/dist/token-goat-chunk-IVALLT3S.mjs +48 -0
- package/dist/{token-goat-chunk-UXSXQQIY.mjs → token-goat-chunk-IVKIZWAB.mjs} +3 -3
- package/dist/{token-goat-chunk-52NSDWYY.mjs → token-goat-chunk-JB6QN6VF.mjs} +6 -4
- package/dist/{token-goat-chunk-HNFZZHFW.mjs → token-goat-chunk-JDHE26RP.mjs} +10 -3
- package/dist/{token-goat-chunk-FTP4U4QA.mjs → token-goat-chunk-JDU3EXSU.mjs} +12 -11
- package/dist/token-goat-chunk-JDWCRD6M.mjs +253 -0
- package/dist/{token-goat-chunk-6AK46ZT7.mjs → token-goat-chunk-JN4XMLSD.mjs} +5 -1
- package/dist/token-goat-chunk-JTQQGXZH.mjs +733 -0
- package/dist/token-goat-chunk-KKUFXAPD.mjs +25 -0
- package/dist/token-goat-chunk-KQNZDCBD.mjs +47 -0
- package/dist/{token-goat-chunk-2WOUYWLM.mjs → token-goat-chunk-KWPNJBDH.mjs} +27 -3
- package/dist/{token-goat-chunk-DPNLUJWB.mjs → token-goat-chunk-LOBGHXPB.mjs} +30 -8
- package/dist/token-goat-chunk-MKPF4CL5.mjs +37 -0
- package/dist/token-goat-chunk-MNWKPRAL.mjs +13 -0
- package/dist/{token-goat-chunk-DNSPXQXQ.mjs → token-goat-chunk-N2NMER56.mjs} +25 -15
- package/dist/token-goat-chunk-NYKZLXMK.mjs +218 -0
- package/dist/token-goat-chunk-OJBNYTJP.mjs +3087 -0
- package/dist/token-goat-chunk-P4QMM4WK.mjs +295 -0
- package/dist/token-goat-chunk-PD5VKH46.mjs +184 -0
- package/dist/token-goat-chunk-PEPTHRFF.mjs +129 -0
- package/dist/{token-goat-chunk-NMBWLRHW.mjs → token-goat-chunk-PU7V3FD6.mjs} +8721 -11104
- package/dist/token-goat-chunk-PY533T7F.mjs +46 -0
- package/dist/token-goat-chunk-Q5VTGRH7.mjs +761 -0
- package/dist/{token-goat-chunk-67BNIKKO.mjs → token-goat-chunk-QCLDAQTS.mjs} +31 -20
- package/dist/{token-goat-chunk-SE6E4BKJ.mjs → token-goat-chunk-QSBRTGM2.mjs} +9 -2
- package/dist/{token-goat-chunk-VZQEWRVH.mjs → token-goat-chunk-RC35RBUL.mjs} +4 -4
- package/dist/{token-goat-chunk-VMFWNHGR.mjs → token-goat-chunk-RHXKCZX3.mjs} +873 -504
- package/dist/{token-goat-chunk-PYSUADX4.mjs → token-goat-chunk-RZRTDST7.mjs} +17 -7
- package/dist/{token-goat-chunk-ONXH6NZ5.mjs → token-goat-chunk-SJHWVNDQ.mjs} +15 -21
- package/dist/token-goat-chunk-SMVRN2HU.mjs +188 -0
- package/dist/{token-goat-chunk-QO3LXVVR.mjs → token-goat-chunk-SQSSNQPE.mjs} +2295 -1718
- package/dist/{token-goat-chunk-2AWQ2R5X.mjs → token-goat-chunk-T4FK7VOV.mjs} +2 -2
- package/dist/token-goat-chunk-U4N3BN2W.mjs +92 -0
- package/dist/token-goat-chunk-UA5V6P3P.mjs +122 -0
- package/dist/{token-goat-chunk-UA5BKWWQ.mjs → token-goat-chunk-UQ5UK2T7.mjs} +15 -4
- package/dist/token-goat-chunk-USILZ3T3.mjs +53 -0
- package/dist/{token-goat-chunk-MELOKFDJ.mjs → token-goat-chunk-VES7EL7O.mjs} +7 -1
- package/dist/{token-goat-chunk-7CPMDFGB.mjs → token-goat-chunk-VL3YIFHZ.mjs} +389 -14
- package/dist/{token-goat-chunk-E5TK5DNO.mjs → token-goat-chunk-VPBBTSJR.mjs} +356 -129
- package/dist/{token-goat-chunk-YOOVFPTP.mjs → token-goat-chunk-W3QCJS6G.mjs} +10 -2
- package/dist/{token-goat-chunk-LZNBQTDK.mjs → token-goat-chunk-WY3L4DVT.mjs} +11 -7
- package/dist/token-goat-chunk-XKI4SEMX.mjs +66 -0
- package/dist/token-goat-chunk-XU4P6Z24.mjs +133 -0
- package/dist/{token-goat-chunk-H5J3C56Q.mjs → token-goat-chunk-Y776AENC.mjs} +112 -26
- package/dist/token-goat-chunk-YARZFCZS.mjs +359 -0
- package/dist/{token-goat-chunk-S4VSXURL.mjs → token-goat-chunk-Z44YO3QZ.mjs} +4 -0
- package/dist/token-goat-chunk-Z57YODA2.mjs +35 -0
- package/dist/{token-goat-chunk-PQ53BSCF.mjs → token-goat-chunk-ZCDTCVIS.mjs} +48 -29
- package/dist/token-goat-chunk-ZEJVMUQH.mjs +48 -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-PKRWMHVP.mjs → token-goat-chunk-ZQSJMO2R.mjs} +338 -170
- package/dist/token-goat-hook-client.cjs +87 -23
- package/dist/token-goat-hook-client.mjs +3 -3
- package/dist/token-goat-hook.mjs +46 -30
- package/dist/token-goat.core.mjs +6 -6
- package/docs/C4_RUNTIME_ARCHITECTURE.md +1 -1
- package/docs/cli.md +80 -46
- package/docs/install.md +47 -14
- package/docs/security.md +7 -7
- package/package.json +17 -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-C5YPNZKQ.mjs +0 -318
- package/dist/token-goat-chunk-CIQ2FTY3.mjs +0 -1990
- package/dist/token-goat-chunk-EUSDXRXU.mjs +0 -1429
- package/dist/token-goat-chunk-G7IWXCFF.mjs +0 -456
- package/dist/token-goat-chunk-JTKCQMQA.mjs +0 -418
- package/dist/token-goat-chunk-ORNFMIER.mjs +0 -295
- package/dist/token-goat-chunk-VQ6F6T7X.mjs +0 -36
- 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,24 @@
|
|
|
1
|
+
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
+
const require = __cjsRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
copyFromSharedCache,
|
|
5
|
+
downloadPinned,
|
|
6
|
+
setPinnedRetryDelayForTesting,
|
|
7
|
+
sha256Of
|
|
8
|
+
} from "./token-goat-chunk-PD5VKH46.mjs";
|
|
9
|
+
import "./token-goat-chunk-SMVRN2HU.mjs";
|
|
10
|
+
import "./token-goat-chunk-7IN2MKDS.mjs";
|
|
11
|
+
import "./token-goat-chunk-U4N3BN2W.mjs";
|
|
12
|
+
import "./token-goat-chunk-YZAAZU2S.mjs";
|
|
13
|
+
import "./token-goat-chunk-IVE6U7KV.mjs";
|
|
14
|
+
import "./token-goat-chunk-GOLEOXZP.mjs";
|
|
15
|
+
import "./token-goat-chunk-AM5V6GSX.mjs";
|
|
16
|
+
import "./token-goat-chunk-FNFBKLRD.mjs";
|
|
17
|
+
import "./token-goat-chunk-VES7EL7O.mjs";
|
|
18
|
+
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
19
|
+
export {
|
|
20
|
+
copyFromSharedCache,
|
|
21
|
+
downloadPinned,
|
|
22
|
+
setPinnedRetryDelayForTesting,
|
|
23
|
+
sha256Of
|
|
24
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
+
const require = __cjsRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
registerHook
|
|
5
|
+
} from "./token-goat-chunk-P4QMM4WK.mjs";
|
|
6
|
+
import {
|
|
7
|
+
ensureWorkerAlive
|
|
8
|
+
} from "./token-goat-chunk-5KDMCMF2.mjs";
|
|
9
|
+
import {
|
|
10
|
+
passOutput
|
|
11
|
+
} from "./token-goat-chunk-VPBBTSJR.mjs";
|
|
12
|
+
import {
|
|
13
|
+
isUnderSystemTemp
|
|
14
|
+
} from "./token-goat-chunk-7IN2MKDS.mjs";
|
|
15
|
+
import {
|
|
16
|
+
atomicWriteBytes,
|
|
17
|
+
ensureDirSync
|
|
18
|
+
} from "./token-goat-chunk-GOLEOXZP.mjs";
|
|
19
|
+
import {
|
|
20
|
+
foldPath
|
|
21
|
+
} from "./token-goat-chunk-AM5V6GSX.mjs";
|
|
22
|
+
import {
|
|
23
|
+
normalizePath,
|
|
24
|
+
resolveIndexPath
|
|
25
|
+
} from "./token-goat-chunk-FNFBKLRD.mjs";
|
|
26
|
+
import {
|
|
27
|
+
dataDir
|
|
28
|
+
} from "./token-goat-chunk-VES7EL7O.mjs";
|
|
29
|
+
import {
|
|
30
|
+
init_define_import_meta_env
|
|
31
|
+
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
32
|
+
|
|
33
|
+
// src/dirty_queue.ts
|
|
34
|
+
init_define_import_meta_env();
|
|
35
|
+
import * as fs from "node:fs";
|
|
36
|
+
import * as path from "node:path";
|
|
37
|
+
function dirtyQueuePathFor(dir) {
|
|
38
|
+
return path.join(dir, "queue", "dirty.txt");
|
|
39
|
+
}
|
|
40
|
+
var ENCODED_LINE_MARKER = "!";
|
|
41
|
+
function encodeDirtyQueueLine(absPath) {
|
|
42
|
+
const needsEncoding = /[\r\n]/.test(absPath) || absPath !== absPath.trim();
|
|
43
|
+
return needsEncoding ? ENCODED_LINE_MARKER + JSON.stringify(absPath) : absPath;
|
|
44
|
+
}
|
|
45
|
+
function decodeDirtyQueueLine(line) {
|
|
46
|
+
if (!line.startsWith(ENCODED_LINE_MARKER)) return line;
|
|
47
|
+
try {
|
|
48
|
+
const decoded = JSON.parse(line.slice(ENCODED_LINE_MARKER.length));
|
|
49
|
+
return typeof decoded === "string" ? decoded : line;
|
|
50
|
+
} catch {
|
|
51
|
+
return line;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function parseDirtyQueueLines(raw) {
|
|
55
|
+
const seen = /* @__PURE__ */ new Set();
|
|
56
|
+
const out = [];
|
|
57
|
+
for (const line of raw.split("\n")) {
|
|
58
|
+
const trimmed = decodeDirtyQueueLine(line.trim());
|
|
59
|
+
if (trimmed === "") continue;
|
|
60
|
+
const normalized = normalizePath(trimmed);
|
|
61
|
+
const dedupeKey = foldPath(normalized);
|
|
62
|
+
if (seen.has(dedupeKey)) continue;
|
|
63
|
+
seen.add(dedupeKey);
|
|
64
|
+
out.push(trimmed);
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
function getDirtyPathsFor(dir) {
|
|
69
|
+
let raw;
|
|
70
|
+
try {
|
|
71
|
+
raw = fs.readFileSync(dirtyQueuePathFor(dir), "utf8");
|
|
72
|
+
} catch {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
return parseDirtyQueueLines(raw);
|
|
76
|
+
}
|
|
77
|
+
function dirtyQueueLeadingNewline(queuePath) {
|
|
78
|
+
let fd;
|
|
79
|
+
try {
|
|
80
|
+
const size = fs.statSync(queuePath).size;
|
|
81
|
+
if (size === 0) return "";
|
|
82
|
+
fd = fs.openSync(queuePath, "r");
|
|
83
|
+
const tail = Buffer.allocUnsafe(1);
|
|
84
|
+
fs.readSync(fd, tail, 0, 1, size - 1);
|
|
85
|
+
return tail[0] === 10 ? "" : "\n";
|
|
86
|
+
} catch {
|
|
87
|
+
return "";
|
|
88
|
+
} finally {
|
|
89
|
+
if (fd !== void 0) {
|
|
90
|
+
try {
|
|
91
|
+
fs.closeSync(fd);
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function appendToLiveQueue(queuePath, data) {
|
|
98
|
+
const fd = fs.openSync(queuePath, "a");
|
|
99
|
+
try {
|
|
100
|
+
fs.writeFileSync(fd, data);
|
|
101
|
+
return fs.statSync(queuePath, { bigint: true, throwIfNoEntry: false })?.ino === fs.fstatSync(fd, { bigint: true }).ino;
|
|
102
|
+
} finally {
|
|
103
|
+
fs.closeSync(fd);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function renderDirtyQueueLines(absPaths) {
|
|
107
|
+
return absPaths.map((p) => `${encodeDirtyQueueLine(p)}
|
|
108
|
+
`).join("");
|
|
109
|
+
}
|
|
110
|
+
function appendDirtyQueueFile(filePath, absPaths) {
|
|
111
|
+
if (absPaths.length === 0) return;
|
|
112
|
+
fs.appendFileSync(filePath, `${dirtyQueueLeadingNewline(filePath)}${renderDirtyQueueLines(absPaths)}`);
|
|
113
|
+
}
|
|
114
|
+
function appendDirtyQueuePaths(dir, absPaths) {
|
|
115
|
+
if (absPaths.length === 0) return true;
|
|
116
|
+
const queuePath = dirtyQueuePathFor(dir);
|
|
117
|
+
const queueDir = path.dirname(queuePath);
|
|
118
|
+
try {
|
|
119
|
+
ensureDirSync(queueDir);
|
|
120
|
+
} catch (e) {
|
|
121
|
+
if (e.code !== "EEXIST" || !fs.existsSync(queueDir)) throw e;
|
|
122
|
+
}
|
|
123
|
+
const body = renderDirtyQueueLines(absPaths);
|
|
124
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
125
|
+
if (appendToLiveQueue(queuePath, `${dirtyQueueLeadingNewline(queuePath)}${body}`)) return true;
|
|
126
|
+
}
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/hooks_index.ts
|
|
131
|
+
init_define_import_meta_env();
|
|
132
|
+
import * as path2 from "node:path";
|
|
133
|
+
function appendDirtyPaths(normalizedPaths) {
|
|
134
|
+
appendDirtyQueuePaths(dataDir(), normalizedPaths);
|
|
135
|
+
}
|
|
136
|
+
function appendDirtyPath(normalizedPath) {
|
|
137
|
+
appendDirtyPaths([normalizedPath]);
|
|
138
|
+
}
|
|
139
|
+
function enqueueDirtyPathSafe(filePath, opts) {
|
|
140
|
+
enqueueDirtyPathsSafe([filePath], opts);
|
|
141
|
+
}
|
|
142
|
+
function enqueueDirtyPathsSafe(filePaths, opts) {
|
|
143
|
+
const resolved = [];
|
|
144
|
+
try {
|
|
145
|
+
for (const filePath of filePaths) {
|
|
146
|
+
const r = opts?.alreadyResolved === true ? filePath : resolveIndexPath(filePath);
|
|
147
|
+
if (isUnderSystemTemp(r)) continue;
|
|
148
|
+
resolved.push(r);
|
|
149
|
+
}
|
|
150
|
+
if (resolved.length === 0) return 0;
|
|
151
|
+
appendDirtyPaths(resolved);
|
|
152
|
+
} catch {
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
ensureWorkerAlive();
|
|
157
|
+
} catch {
|
|
158
|
+
}
|
|
159
|
+
return resolved.length;
|
|
160
|
+
}
|
|
161
|
+
function getDirtyPaths() {
|
|
162
|
+
return getDirtyPathsFor(dataDir());
|
|
163
|
+
}
|
|
164
|
+
function preCompactIndexHandler(_event) {
|
|
165
|
+
const paths = getDirtyPaths();
|
|
166
|
+
if (paths.length > 0) {
|
|
167
|
+
const sidecar = path2.join(dataDir(), "queue", "pending.txt");
|
|
168
|
+
try {
|
|
169
|
+
ensureDirSync(path2.dirname(sidecar));
|
|
170
|
+
atomicWriteBytes(sidecar, Buffer.from(`${paths.join("\n")}
|
|
171
|
+
`, "utf8"));
|
|
172
|
+
} catch {
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return passOutput();
|
|
176
|
+
}
|
|
177
|
+
registerHook("pre_compact", preCompactIndexHandler, { advisory: true });
|
|
178
|
+
|
|
179
|
+
export {
|
|
180
|
+
dirtyQueuePathFor,
|
|
181
|
+
parseDirtyQueueLines,
|
|
182
|
+
getDirtyPathsFor,
|
|
183
|
+
appendDirtyQueueFile,
|
|
184
|
+
appendDirtyQueuePaths,
|
|
185
|
+
appendDirtyPath,
|
|
186
|
+
enqueueDirtyPathSafe,
|
|
187
|
+
enqueueDirtyPathsSafe
|
|
188
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { createRequire as __cjsRequire } from 'node:module';
|
|
2
|
+
const require = __cjsRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
init_define_import_meta_env
|
|
5
|
+
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
6
|
+
|
|
7
|
+
// src/render/ansi.ts
|
|
8
|
+
init_define_import_meta_env();
|
|
9
|
+
function _colorStream(isatty) {
|
|
10
|
+
if (process.env["NO_COLOR"]) return false;
|
|
11
|
+
return isatty;
|
|
12
|
+
}
|
|
13
|
+
function colorStdout() {
|
|
14
|
+
return _colorStream(process.stdout.isTTY === true);
|
|
15
|
+
}
|
|
16
|
+
var _E = "\x1B";
|
|
17
|
+
var RESET = `${_E}[0m`;
|
|
18
|
+
var _ANSI_ESCAPE_RE = /\x1B\[[0-?]*[ -/]*[@-~]|\x1B\].*?(?:\x07|\x1B\\|$)|\x1B[PX^_].*?\x1B\\|\x1B[@-_]/gs;
|
|
19
|
+
var _PUA_RE = /[\u{E000}-\u{F8FF}\u{F0000}-\u{FFFFD}]/gu;
|
|
20
|
+
function stripAnsiEscapes(s) {
|
|
21
|
+
if (!s.includes("\x1B")) {
|
|
22
|
+
return s;
|
|
23
|
+
}
|
|
24
|
+
return s.replace(_ANSI_ESCAPE_RE, "");
|
|
25
|
+
}
|
|
26
|
+
function fmtBytes(n) {
|
|
27
|
+
let value = n;
|
|
28
|
+
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
29
|
+
for (const unit of units) {
|
|
30
|
+
if (Math.abs(value) < 1024) {
|
|
31
|
+
return unit === "B" ? `${Math.trunc(value)}${unit}` : `${value.toFixed(1)}${unit}`;
|
|
32
|
+
}
|
|
33
|
+
value = value / 1024;
|
|
34
|
+
}
|
|
35
|
+
return `${value.toFixed(1)}PB`;
|
|
36
|
+
}
|
|
37
|
+
function fg(r, g, b) {
|
|
38
|
+
return `${_E}[38;2;${r};${g};${b}m`;
|
|
39
|
+
}
|
|
40
|
+
function vlen(s) {
|
|
41
|
+
return stripAnsiEscapes(s).replace(_PUA_RE, "").length;
|
|
42
|
+
}
|
|
43
|
+
function padR(s, w) {
|
|
44
|
+
return s + " ".repeat(Math.max(0, w - vlen(s)));
|
|
45
|
+
}
|
|
46
|
+
function padL(s, w) {
|
|
47
|
+
return " ".repeat(Math.max(0, w - vlen(s))) + s;
|
|
48
|
+
}
|
|
49
|
+
function lerpRgb(a, b, t) {
|
|
50
|
+
return [
|
|
51
|
+
Math.round(a[0] + (b[0] - a[0]) * t),
|
|
52
|
+
Math.round(a[1] + (b[1] - a[1]) * t),
|
|
53
|
+
Math.round(a[2] + (b[2] - a[2]) * t)
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
var C = {
|
|
57
|
+
TEXT_PRIMARY: [201, 209, 217],
|
|
58
|
+
TEXT_BRIGHT: [240, 246, 252],
|
|
59
|
+
TEXT_MUTED: [125, 133, 144],
|
|
60
|
+
TEXT_DIM: [72, 79, 88],
|
|
61
|
+
BG_TILE: [22, 27, 34],
|
|
62
|
+
TRACK: [28, 35, 41],
|
|
63
|
+
GREEN1: [31, 77, 44],
|
|
64
|
+
GREEN2: [46, 160, 67],
|
|
65
|
+
GREEN3: [63, 185, 80],
|
|
66
|
+
GREEN4: [86, 211, 100],
|
|
67
|
+
GREEN5: [126, 231, 135],
|
|
68
|
+
BLUE: [88, 166, 255],
|
|
69
|
+
PURPLE: [188, 140, 255],
|
|
70
|
+
TEAL: [138, 212, 255],
|
|
71
|
+
ORANGE: [235, 165, 80],
|
|
72
|
+
YELLOW: [240, 215, 80],
|
|
73
|
+
RED: [200, 60, 60]
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
colorStdout,
|
|
78
|
+
RESET,
|
|
79
|
+
stripAnsiEscapes,
|
|
80
|
+
fmtBytes,
|
|
81
|
+
fg,
|
|
82
|
+
vlen,
|
|
83
|
+
padR,
|
|
84
|
+
padL,
|
|
85
|
+
lerpRgb,
|
|
86
|
+
C
|
|
87
|
+
};
|