token-goat 2.9.25 → 2.9.28
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 +28 -88
- package/SECURITY.md +14 -0
- package/dist/{token-goat-chunk-ORO4GOMA.mjs → token-goat-chunk-4JJBFT7V.mjs} +3 -3
- package/dist/token-goat-chunk-4JMWPWCS.mjs +96 -0
- package/dist/token-goat-chunk-4RN64ZND.mjs +954 -0
- package/dist/{token-goat-chunk-6W2FFT6H.mjs → token-goat-chunk-4STDIGYC.mjs} +2 -2
- package/dist/{token-goat-chunk-EZVRN44Y.mjs → token-goat-chunk-5NNYIUGV.mjs} +2 -2
- package/dist/{token-goat-chunk-ILROZWXE.mjs → token-goat-chunk-66LODAUT.mjs} +1 -1
- package/dist/{token-goat-chunk-VAIJUZG6.mjs → token-goat-chunk-6CCQDAYY.mjs} +69 -566
- package/dist/{token-goat-chunk-UGCNTVF4.mjs → token-goat-chunk-6DQNNFJ6.mjs} +5 -3
- package/dist/{token-goat-chunk-ZWFP4ZU7.mjs → token-goat-chunk-6SGLIPQB.mjs} +40 -20
- package/dist/{token-goat-chunk-TWVFMUTZ.mjs → token-goat-chunk-6Z5ULNE5.mjs} +3570 -3970
- package/dist/token-goat-chunk-7MAFDRVR.mjs +47 -0
- package/dist/{token-goat-chunk-PPNKB5HP.mjs → token-goat-chunk-7R2XYKC5.mjs} +6 -5
- package/dist/{token-goat-chunk-KYV7E6ZJ.mjs → token-goat-chunk-BCN2YQC6.mjs} +10 -8
- package/dist/token-goat-chunk-BJBRGPBX.mjs +244 -0
- package/dist/{token-goat-chunk-Z5ZTBSHL.mjs → token-goat-chunk-CBMY2FGI.mjs} +479 -544
- package/dist/{token-goat-chunk-UTKNLKYE.mjs → token-goat-chunk-CC2PYJM7.mjs} +2 -1
- package/dist/{token-goat-chunk-7PQYG6TN.mjs → token-goat-chunk-D5ICEPSB.mjs} +14 -14
- package/dist/token-goat-chunk-D7GHQKQD.mjs +30 -0
- package/dist/{token-goat-chunk-NNXCBELZ.mjs → token-goat-chunk-EL7M26WP.mjs} +7623 -8455
- package/dist/{token-goat-chunk-TVTDINTO.mjs → token-goat-chunk-F7QZRIWM.mjs} +69 -20
- package/dist/{token-goat-chunk-MBRX5AP6.mjs → token-goat-chunk-FSTWAOW6.mjs} +3 -3
- package/dist/token-goat-chunk-GGLEE35R.mjs +564 -0
- package/dist/{token-goat-chunk-YZ67F2HJ.mjs → token-goat-chunk-HUDC5GS5.mjs} +2 -2
- package/dist/{token-goat-chunk-BIBZQRC6.mjs → token-goat-chunk-HXNAC4ZF.mjs} +22 -964
- package/dist/token-goat-chunk-I7CB3X4K.mjs +1379 -0
- package/dist/{token-goat-chunk-KMCVX3P2.mjs → token-goat-chunk-IFORDBGC.mjs} +32 -27
- package/dist/{token-goat-chunk-25NRXKIW.mjs → token-goat-chunk-IHKZ3QNA.mjs} +26 -15
- package/dist/token-goat-chunk-IZXKVT4A.mjs +711 -0
- package/dist/{token-goat-chunk-UEQUZDHQ.mjs → token-goat-chunk-JXK2HQXS.mjs} +22 -8
- package/dist/{token-goat-chunk-YE4TGC4Z.mjs → token-goat-chunk-L45ZQRT7.mjs} +1 -1
- package/dist/{token-goat-chunk-IEF2NZFZ.mjs → token-goat-chunk-L7SDVGBT.mjs} +196 -14
- package/dist/token-goat-chunk-LEG3JNJ6.mjs +139 -0
- package/dist/{token-goat-chunk-3FSAZR32.mjs → token-goat-chunk-M56BWPBN.mjs} +1 -1
- package/dist/{token-goat-chunk-QZZPWFVF.mjs → token-goat-chunk-MAMQPC43.mjs} +2 -87
- package/dist/{token-goat-chunk-OHMKCBZI.mjs → token-goat-chunk-MMLMALWK.mjs} +5 -3
- package/dist/{token-goat-chunk-KOL5WXDW.mjs → token-goat-chunk-MVSWBNMD.mjs} +7 -231
- package/dist/{token-goat-chunk-J2PRBQ24.mjs → token-goat-chunk-NILVK7XM.mjs} +4 -4
- package/dist/{token-goat-chunk-OUQIGPW3.mjs → token-goat-chunk-Q4S3UQGO.mjs} +1 -1
- package/dist/{token-goat-chunk-EX2DVKAT.mjs → token-goat-chunk-QM76S6YS.mjs} +3 -3
- package/dist/{token-goat-chunk-G7YWBH25.mjs → token-goat-chunk-RJH64KQH.mjs} +86 -72
- package/dist/{token-goat-chunk-RLDBVMXR.mjs → token-goat-chunk-RSS3TLXU.mjs} +2 -2
- package/dist/{token-goat-chunk-T6652D3F.mjs → token-goat-chunk-SJEKA7Y2.mjs} +21 -16
- package/dist/{token-goat-chunk-II5WBDFB.mjs → token-goat-chunk-UBUKHVYW.mjs} +1 -1
- package/dist/{token-goat-chunk-2SSDSUSF.mjs → token-goat-chunk-VE27HPIF.mjs} +14 -10
- package/dist/{token-goat-chunk-Y463KPAQ.mjs → token-goat-chunk-VWZKZPSR.mjs} +100 -23
- package/dist/{token-goat-chunk-K4TNHLGS.mjs → token-goat-chunk-XI2VFAV6.mjs} +6 -6
- package/dist/{token-goat-chunk-ZDFDCXU2.mjs → token-goat-chunk-XKY4VKJ4.mjs} +1 -1
- package/dist/{token-goat-chunk-BQ6ZDLTF.mjs → token-goat-chunk-YWSP6IU7.mjs} +1 -1
- package/dist/token-goat-hook.mjs +23 -17
- package/dist/token-goat.core.mjs +32 -27
- package/docs/cli.md +32 -21
- package/docs/install.md +2 -0
- package/package.json +1 -1
- package/dist/token-goat-chunk-EDCVQLBR.mjs +0 -26
- package/dist/token-goat-chunk-WEYODFTA.mjs +0 -41
|
@@ -4,14 +4,16 @@ import {
|
|
|
4
4
|
accumulateResidentLine,
|
|
5
5
|
claudeConfigDir,
|
|
6
6
|
createResidentContextStats,
|
|
7
|
-
estimateTokens,
|
|
8
7
|
summarizeResidentContext
|
|
9
|
-
} from "./token-goat-chunk-
|
|
8
|
+
} from "./token-goat-chunk-MAMQPC43.mjs";
|
|
10
9
|
import {
|
|
11
10
|
commandHash,
|
|
12
11
|
getBashOutput,
|
|
13
12
|
normalizeCommandForCacheKey
|
|
14
|
-
} from "./token-goat-chunk-
|
|
13
|
+
} from "./token-goat-chunk-HXNAC4ZF.mjs";
|
|
14
|
+
import {
|
|
15
|
+
estimateTokens
|
|
16
|
+
} from "./token-goat-chunk-4JMWPWCS.mjs";
|
|
15
17
|
import {
|
|
16
18
|
init_define_import_meta_env
|
|
17
19
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
extractSwift,
|
|
26
26
|
extractThrift,
|
|
27
27
|
extractWgsl
|
|
28
|
-
} from "./token-goat-chunk-
|
|
28
|
+
} from "./token-goat-chunk-66LODAUT.mjs";
|
|
29
29
|
import {
|
|
30
30
|
extractShellBannerHeading
|
|
31
|
-
} from "./token-goat-chunk-
|
|
32
|
-
import "./token-goat-chunk-
|
|
31
|
+
} from "./token-goat-chunk-D5ICEPSB.mjs";
|
|
32
|
+
import "./token-goat-chunk-HUDC5GS5.mjs";
|
|
33
33
|
import {
|
|
34
34
|
GENERIC_CLAUSE,
|
|
35
35
|
assignBraceBlockSpans,
|
|
@@ -59,15 +59,15 @@ import {
|
|
|
59
59
|
stripMultilineStringSpan,
|
|
60
60
|
stripStringLiterals,
|
|
61
61
|
stripXmlComments
|
|
62
|
-
} from "./token-goat-chunk-
|
|
63
|
-
import "./token-goat-chunk-
|
|
62
|
+
} from "./token-goat-chunk-M56BWPBN.mjs";
|
|
63
|
+
import "./token-goat-chunk-CC2PYJM7.mjs";
|
|
64
64
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
65
65
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
66
66
|
import {
|
|
67
67
|
countContentLines,
|
|
68
68
|
escapeRegExp,
|
|
69
69
|
pushAll
|
|
70
|
-
} from "./token-goat-chunk-
|
|
70
|
+
} from "./token-goat-chunk-L45ZQRT7.mjs";
|
|
71
71
|
import "./token-goat-chunk-NMTKNYGF.mjs";
|
|
72
72
|
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
73
73
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
@@ -3704,6 +3704,7 @@ function stripLeadingAttributes2(text) {
|
|
|
3704
3704
|
var FUNC_RE7 = new RegExp(`^(?:function|filter|workflow|configuration)\\s+(?:(?:global|local|script|private):)?(${FUNC_IDENT})`, "i");
|
|
3705
3705
|
var CLASS_RE5 = new RegExp(`^(class|enum)\\s+(${IDENT2})`, "i");
|
|
3706
3706
|
var PESTER_RE = /^(Describe|Context|It)\b(?:\s+-[A-Za-z0-9_-]+(?:\s+(?:'[^']*'|"[^"]*"|[^\s{]+))?)*\s*(?:'([^']*)'|"([^"]*)"|([A-Za-z0-9_.-]+))/i;
|
|
3707
|
+
var PESTER_SETUP_RE = /^(BeforeAll|BeforeEach|AfterAll|AfterEach)\b(?:\s+-[A-Za-z0-9_-]+(?:\s+(?:'[^']*'|"[^"]*"|[^\s{]+))?)*\s*(?:'([^']*)'|"([^"]*)"|([A-Za-z0-9_.-]+))?/i;
|
|
3707
3708
|
var METHOD_NAME_RE = new RegExp(
|
|
3708
3709
|
`^(?!(?:if|elseif|else|while|for|foreach|do|switch|return|throw|try|catch|finally|param|begin|process|end)\\b)(${IDENT2})\\s*\\(`,
|
|
3709
3710
|
"i"
|
|
@@ -3773,32 +3774,51 @@ function extractPowershell(content, filePath) {
|
|
|
3773
3774
|
if (!stripped) {
|
|
3774
3775
|
continue;
|
|
3775
3776
|
}
|
|
3776
|
-
|
|
3777
|
+
const isPesterScope = openBlocks.some((b) => b.kind === "test" || b.kind === "context" || b.kind === "setup" || b.kind === "describe");
|
|
3778
|
+
if ((braceDepth === 0 || isPesterScope) && currentClass === null) {
|
|
3777
3779
|
const funcMatch = FUNC_RE7.exec(stripped);
|
|
3778
3780
|
if (funcMatch) {
|
|
3779
3781
|
const fname = funcMatch[1] ?? "";
|
|
3780
3782
|
if (symbols.length < MAX_SYMBOLS9) {
|
|
3781
3783
|
const pushIdx = symbols.length;
|
|
3782
|
-
|
|
3784
|
+
const parentBlock = [...openBlocks].reverse().find((b) => b.kind === "test" || b.kind === "context" || b.kind === "setup" || b.kind === "describe");
|
|
3785
|
+
const parentName = parentBlock !== void 0 ? symbols[parentBlock.symbolIndex]?.name : void 0;
|
|
3786
|
+
symbols.push(makeLineSymbol(filePath, fname, "function", lineNum, line.trimEnd().slice(0, 200), parentName, lines, "hash"));
|
|
3783
3787
|
openBlocks.push({ symbolIndex: pushIdx, kind: "function", braceDepth, entered: false });
|
|
3784
3788
|
}
|
|
3785
3789
|
}
|
|
3786
3790
|
}
|
|
3787
3791
|
if (currentClass === null) {
|
|
3788
|
-
const pesterTrigger = /^(?:Describe|Context|It)\b/i.exec(stripped);
|
|
3792
|
+
const pesterTrigger = /^(?:Describe|Context|It|BeforeAll|BeforeEach|AfterAll|AfterEach)\b/i.exec(stripped);
|
|
3789
3793
|
if (pesterTrigger) {
|
|
3790
3794
|
const rawLine = sourceLine.trimStart();
|
|
3791
|
-
const
|
|
3792
|
-
if (
|
|
3793
|
-
const
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
const
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3795
|
+
const isSetupBlock = /^(?:BeforeAll|BeforeEach|AfterAll|AfterEach)\b/i.test(stripped);
|
|
3796
|
+
if (isSetupBlock) {
|
|
3797
|
+
const pesterMatch = PESTER_SETUP_RE.exec(rawLine);
|
|
3798
|
+
if (pesterMatch) {
|
|
3799
|
+
const explicitName = (pesterMatch[2] ?? pesterMatch[3] ?? pesterMatch[4] ?? "").trim();
|
|
3800
|
+
const testName = explicitName || (pesterMatch[1] ?? "BeforeAll");
|
|
3801
|
+
if (testName && symbols.length < MAX_SYMBOLS9) {
|
|
3802
|
+
const parentBlock = [...openBlocks].reverse().find((b) => b.kind === "test" || b.kind === "context" || b.kind === "setup" || b.kind === "describe");
|
|
3803
|
+
const parentName = parentBlock !== void 0 ? symbols[parentBlock.symbolIndex]?.name : void 0;
|
|
3804
|
+
const pushIdx = symbols.length;
|
|
3805
|
+
symbols.push(makeLineSymbol(filePath, testName, "setup", lineNum, sourceLine.trimEnd().slice(0, 200), parentName, lines, "hash"));
|
|
3806
|
+
openBlocks.push({ symbolIndex: pushIdx, kind: "setup", braceDepth, entered: false });
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3809
|
+
} else {
|
|
3810
|
+
const pesterMatch = PESTER_RE.exec(rawLine);
|
|
3811
|
+
if (pesterMatch) {
|
|
3812
|
+
const blockType = (pesterMatch[1] ?? "").toLowerCase();
|
|
3813
|
+
const testName = (pesterMatch[2] ?? pesterMatch[3] ?? pesterMatch[4] ?? "").trim();
|
|
3814
|
+
if (testName && symbols.length < MAX_SYMBOLS9) {
|
|
3815
|
+
const kind = blockType === "context" ? "context" : "test";
|
|
3816
|
+
const parentBlock = [...openBlocks].reverse().find((b) => b.kind === "test" || b.kind === "context" || b.kind === "setup" || b.kind === "describe");
|
|
3817
|
+
const parentName = parentBlock !== void 0 ? symbols[parentBlock.symbolIndex]?.name : void 0;
|
|
3818
|
+
const pushIdx = symbols.length;
|
|
3819
|
+
symbols.push(makeLineSymbol(filePath, testName, kind, lineNum, sourceLine.trimEnd().slice(0, 200), parentName, lines, "hash"));
|
|
3820
|
+
openBlocks.push({ symbolIndex: pushIdx, kind, braceDepth, entered: false });
|
|
3821
|
+
}
|
|
3802
3822
|
}
|
|
3803
3823
|
}
|
|
3804
3824
|
}
|