token-goat 2.9.16 → 2.9.17
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 +2 -5
- package/dist/{token-goat-chunk-DMQ32ZSR.mjs → token-goat-chunk-26YUO7MP.mjs} +3 -3
- package/dist/{token-goat-chunk-GMXBQS6O.mjs → token-goat-chunk-2M33Q3O4.mjs} +30 -26
- package/dist/{token-goat-chunk-H3DXI6VD.mjs → token-goat-chunk-2VASS5VR.mjs} +1 -1
- package/dist/{token-goat-chunk-OCI25AXY.mjs → token-goat-chunk-2XA5ZW4T.mjs} +3 -3
- package/dist/{token-goat-chunk-4DC6DDIB.mjs → token-goat-chunk-5WB7GDH4.mjs} +5 -5
- package/dist/{token-goat-chunk-MA5BZ2KI.mjs → token-goat-chunk-66224KCZ.mjs} +1 -1
- package/dist/{token-goat-chunk-BFNTLGVA.mjs → token-goat-chunk-73GXYYZR.mjs} +31 -9
- package/dist/{token-goat-chunk-ULA4WCED.mjs → token-goat-chunk-7EGKXBWT.mjs} +7 -7
- package/dist/{token-goat-chunk-Z5VPAXTC.mjs → token-goat-chunk-7VQMOBPQ.mjs} +31 -20
- package/dist/{token-goat-chunk-63QWJ6UM.mjs → token-goat-chunk-BK3RPPTK.mjs} +2 -2
- package/dist/{token-goat-chunk-5USHO7B6.mjs → token-goat-chunk-C26ZBGBC.mjs} +5 -5
- package/dist/{token-goat-chunk-EJCY6KHO.mjs → token-goat-chunk-CICJFVIH.mjs} +2 -2
- package/dist/{token-goat-chunk-LJL6FGDS.mjs → token-goat-chunk-CKIJWTRQ.mjs} +11 -11
- package/dist/{token-goat-chunk-NQZCSVN2.mjs → token-goat-chunk-CPHVXKNU.mjs} +1 -1
- package/dist/{token-goat-chunk-VVIYEFBI.mjs → token-goat-chunk-EKGVCAES.mjs} +3 -3
- package/dist/{token-goat-chunk-QMZMHQRR.mjs → token-goat-chunk-G75WIVFM.mjs} +18 -18
- package/dist/{token-goat-chunk-UXHDBVUR.mjs → token-goat-chunk-GLOM5W5C.mjs} +1 -1
- package/dist/{token-goat-chunk-MIL62GMN.mjs → token-goat-chunk-GPCCYQSS.mjs} +6 -6
- package/dist/{token-goat-chunk-UMXD2M7O.mjs → token-goat-chunk-HRUGS6CO.mjs} +8 -8
- package/dist/{token-goat-chunk-2PCFAQAS.mjs → token-goat-chunk-IDHWKNKZ.mjs} +87 -10
- package/dist/{token-goat-chunk-GIMGT34T.mjs → token-goat-chunk-KZPO4DWC.mjs} +1 -1
- package/dist/{token-goat-chunk-R3X5TCPB.mjs → token-goat-chunk-MWSVUKVV.mjs} +1 -1
- package/dist/{token-goat-chunk-XOHTFRDH.mjs → token-goat-chunk-PKNOHVWP.mjs} +8 -8
- package/dist/{token-goat-chunk-M2R4UQ3B.mjs → token-goat-chunk-RB24DBBS.mjs} +2 -2
- package/dist/{token-goat-chunk-ZEHFYJ7Z.mjs → token-goat-chunk-RFFUCQK7.mjs} +4 -4
- package/dist/{token-goat-chunk-YPS64ACE.mjs → token-goat-chunk-SWRKVA3J.mjs} +1 -1
- package/dist/{token-goat-chunk-NAMH252H.mjs → token-goat-chunk-THBLW56G.mjs} +2 -2
- package/dist/{token-goat-chunk-3H6FQT62.mjs → token-goat-chunk-UBZCON6N.mjs} +1 -1
- package/dist/{token-goat-chunk-2IEIBVVD.mjs → token-goat-chunk-W2GUUQAQ.mjs} +1 -1
- package/dist/{token-goat-chunk-NOBZV7PM.mjs → token-goat-chunk-YFGEUIEO.mjs} +12 -12
- package/dist/token-goat-hook.mjs +11 -11
- package/dist/token-goat.core.mjs +18 -18
- package/docs/cli.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -341,12 +341,9 @@ Per-harness setup for Codex, Gemini, Qwen, Kimi, opencode, OpenClaw, pi, Copilot
|
|
|
341
341
|
|
|
342
342
|
## CLI
|
|
343
343
|
|
|
344
|
-
You rarely type these yourself. Installation writes a routing guide into the agent's instructions, and the agent picks the command that answers its question: a surgical read (`read`, `symbol`, `section`, `skeleton`), a search (`semantic`, `refs`), orientation in an unfamiliar repo (`map`, `arch`, `affected`), recall of output it already has (`bash-output`, `web-output`, `mcp-output`), or a bounded reader for a PDF, Word file, slide deck, workbook, SQLite database, HTML document or image.
|
|
344
|
+
You rarely type these yourself. Installation writes a routing guide into the agent's instructions, and the agent picks the command that answers its question: a surgical read (`read`, `symbol`, `locate`, `section`, `skeleton`), a search (`semantic`, `refs`), orientation in an unfamiliar repo (`map`, `arch`, `affected`), recall of output it already has (`bash-output`, `web-output`, `mcp-output`), or a bounded reader for a PDF, Word file, slide deck, workbook, SQLite database, HTML document or image.
|
|
345
345
|
|
|
346
|
-
One command is for people working on token-goat rather than for agents: `token-goat bench` replays a
|
|
347
|
-
corpus of captured shell output through the real compression path and reports how much smaller the
|
|
348
|
-
result got, alongside a count of the lines each case is not allowed to lose. Deleting output makes
|
|
349
|
-
the first number look better, so the second one is what keeps the first honest.
|
|
346
|
+
One command is for people working on token-goat rather than for agents: `token-goat bench` replays a corpus of captured shell output through the real compression path and reports how much smaller the result got, alongside a count of the lines each case is not allowed to lose. Deleting output makes the first number look better, so the second one is what keeps the first honest.
|
|
350
347
|
|
|
351
348
|
Every command, with its flags, its output, and the comparison workflows that chain them: **[CLI reference](docs/cli.md)**. For architectural analysis, empirical evaluations, and technical answers to common engineering questions: **[Architecture & Technical Q&A](docs/architecture-qa.html)**.
|
|
352
349
|
|
|
@@ -2,11 +2,11 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
getDb
|
|
5
|
-
} from "./token-goat-chunk-
|
|
5
|
+
} from "./token-goat-chunk-MWSVUKVV.mjs";
|
|
6
6
|
import {
|
|
7
7
|
getHarnessName,
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./token-goat-chunk-
|
|
9
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
10
10
|
import {
|
|
11
11
|
registerReset
|
|
12
12
|
} from "./token-goat-chunk-EEIDFMEM.mjs";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
ensureDirSync,
|
|
20
20
|
sanitizeIdForFilename,
|
|
21
21
|
tokenGoatHome
|
|
22
|
-
} from "./token-goat-chunk-
|
|
22
|
+
} from "./token-goat-chunk-UBZCON6N.mjs";
|
|
23
23
|
import {
|
|
24
24
|
displaySafeText
|
|
25
25
|
} from "./token-goat-chunk-ERTXEKB6.mjs";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
canRunWrappedShell,
|
|
5
5
|
clipToDeliveryCap,
|
|
6
6
|
deliveredOutputBytes
|
|
7
|
-
} from "./token-goat-chunk-
|
|
7
|
+
} from "./token-goat-chunk-GLOM5W5C.mjs";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_RECONCILE_BUDGET_MS,
|
|
10
10
|
HOOK_EVENTS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
readStdinJson,
|
|
18
18
|
reconcileProject,
|
|
19
19
|
storeWebOutput
|
|
20
|
-
} from "./token-goat-chunk-
|
|
20
|
+
} from "./token-goat-chunk-HRUGS6CO.mjs";
|
|
21
21
|
import {
|
|
22
22
|
BODY_FIRST_TOOL_RESPONSE_KEYS,
|
|
23
23
|
GENERIC_SERVED_OUTPUT_KEY,
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
wasFileReadThisSession,
|
|
145
145
|
wasHintShown,
|
|
146
146
|
withPreservedBlocks
|
|
147
|
-
} from "./token-goat-chunk-
|
|
147
|
+
} from "./token-goat-chunk-PKNOHVWP.mjs";
|
|
148
148
|
import {
|
|
149
149
|
BASH_OUTPUT_SUBDIR,
|
|
150
150
|
commandHash,
|
|
@@ -167,26 +167,26 @@ import {
|
|
|
167
167
|
splitOwnTrailingNotices,
|
|
168
168
|
storeBashOutput,
|
|
169
169
|
summarizeOutputDelta
|
|
170
|
-
} from "./token-goat-chunk-
|
|
170
|
+
} from "./token-goat-chunk-C26ZBGBC.mjs";
|
|
171
171
|
import {
|
|
172
172
|
recordStat,
|
|
173
173
|
redactSecrets,
|
|
174
174
|
savedTokensFromBytes,
|
|
175
175
|
storeBlob,
|
|
176
176
|
stripAnsiEscapes
|
|
177
|
-
} from "./token-goat-chunk-
|
|
177
|
+
} from "./token-goat-chunk-26YUO7MP.mjs";
|
|
178
178
|
import {
|
|
179
179
|
extractMarkdownHeadings,
|
|
180
180
|
formatHeadingTreeParts
|
|
181
|
-
} from "./token-goat-chunk-
|
|
181
|
+
} from "./token-goat-chunk-73GXYYZR.mjs";
|
|
182
182
|
import {
|
|
183
183
|
countSymbols
|
|
184
|
-
} from "./token-goat-chunk-
|
|
184
|
+
} from "./token-goat-chunk-BK3RPPTK.mjs";
|
|
185
185
|
import {
|
|
186
186
|
detectLanguage,
|
|
187
187
|
getDb,
|
|
188
188
|
languageHasFlag
|
|
189
|
-
} from "./token-goat-chunk-
|
|
189
|
+
} from "./token-goat-chunk-MWSVUKVV.mjs";
|
|
190
190
|
import {
|
|
191
191
|
detectHarness,
|
|
192
192
|
envBool,
|
|
@@ -196,7 +196,7 @@ import {
|
|
|
196
196
|
isUnderSystemTemp,
|
|
197
197
|
loadConfig,
|
|
198
198
|
shortFingerprint
|
|
199
|
-
} from "./token-goat-chunk-
|
|
199
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
200
200
|
import {
|
|
201
201
|
ENV_KEYS,
|
|
202
202
|
IDENTICAL_READ_MIN_BODY_BYTES,
|
|
@@ -207,6 +207,7 @@ import {
|
|
|
207
207
|
countNoun,
|
|
208
208
|
dataDir,
|
|
209
209
|
ensureDirSync,
|
|
210
|
+
escapeRegExp,
|
|
210
211
|
escapesOntoNetworkThroughLinks,
|
|
211
212
|
extractErrorMessage,
|
|
212
213
|
foldPath,
|
|
@@ -215,7 +216,7 @@ import {
|
|
|
215
216
|
isInsideRoot,
|
|
216
217
|
runGit,
|
|
217
218
|
toKB
|
|
218
|
-
} from "./token-goat-chunk-
|
|
219
|
+
} from "./token-goat-chunk-UBZCON6N.mjs";
|
|
219
220
|
import {
|
|
220
221
|
UNTRUSTED_TOOL_TAG,
|
|
221
222
|
displaySafePath,
|
|
@@ -945,7 +946,7 @@ init_define_import_meta_env();
|
|
|
945
946
|
var TRACKED_SKILL = "token-goat";
|
|
946
947
|
var MAX_COMMANDS_SHOWN = 8;
|
|
947
948
|
async function currentCommandNames() {
|
|
948
|
-
const { buildProgram } = await import("./token-goat-chunk-
|
|
949
|
+
const { buildProgram } = await import("./token-goat-chunk-G75WIVFM.mjs");
|
|
949
950
|
return flattenCommandNames(buildCommandManifest(buildProgram()));
|
|
950
951
|
}
|
|
951
952
|
async function recordSkillVersionSnapshot(sessionId, skillName) {
|
|
@@ -1234,8 +1235,10 @@ function reconcileNote(cwd, indexed) {
|
|
|
1234
1235
|
const budgetMs = envInt(ENV_KEYS.RECONCILE_BUDGET_MS, DEFAULT_RECONCILE_BUDGET_MS, 0, 6e4);
|
|
1235
1236
|
const result = reconcileProject({ cwd, budgetMs });
|
|
1236
1237
|
if (isReconcileClean(result) && !result.budgetExhausted) return null;
|
|
1238
|
+
const upgraded = result.parserStale + result.embedStale;
|
|
1239
|
+
const edited = result.changed.length - upgraded;
|
|
1237
1240
|
const parts = [];
|
|
1238
|
-
if (
|
|
1241
|
+
if (edited > 0) parts.push(`${edited} changed`);
|
|
1239
1242
|
if (result.added.length > 0) parts.push(`${result.added.length} new`);
|
|
1240
1243
|
if (result.removed.length > 0) parts.push(`${result.removed.length} removed`);
|
|
1241
1244
|
const breakdown = parts.length > 1 ? ` (${parts.join(", ")})` : "";
|
|
@@ -1244,7 +1247,11 @@ function reconcileNote(cwd, indexed) {
|
|
|
1244
1247
|
if (total === 0) {
|
|
1245
1248
|
return `token-goat: index drift check${truncated} found nothing in the part it had time to scan. Symbol lookups may be briefly stale.`;
|
|
1246
1249
|
}
|
|
1247
|
-
|
|
1250
|
+
const drifted = total - upgraded;
|
|
1251
|
+
const clauses = [];
|
|
1252
|
+
if (drifted > 0) clauses.push(`${countNoun(drifted, "file")} that changed outside this session${breakdown}`);
|
|
1253
|
+
if (upgraded > 0) clauses.push(`${countNoun(upgraded, "file")} unchanged on disk but indexed by an older version of token-goat`);
|
|
1254
|
+
return `token-goat: reindexing ${clauses.join(" and ")}${truncated}. Symbol lookups may be briefly stale.`;
|
|
1248
1255
|
} catch {
|
|
1249
1256
|
return null;
|
|
1250
1257
|
}
|
|
@@ -1773,11 +1780,11 @@ function toRegExp(r, i) {
|
|
|
1773
1780
|
if (r.str.length === 0) {
|
|
1774
1781
|
throw new Error(`Rule #${i} ("${r.name}") has empty "str" property, which is not allowed.`);
|
|
1775
1782
|
}
|
|
1776
|
-
return new RegExp(
|
|
1783
|
+
return new RegExp(escapeRegExp2(r.str), "y");
|
|
1777
1784
|
}
|
|
1778
|
-
return new RegExp(
|
|
1785
|
+
return new RegExp(escapeRegExp2(r.name), "y");
|
|
1779
1786
|
}
|
|
1780
|
-
function
|
|
1787
|
+
function escapeRegExp2(str) {
|
|
1781
1788
|
return str.replace(/[-[\]{}()*+!<=:?./\\^$|#\s,]/g, "\\$&");
|
|
1782
1789
|
}
|
|
1783
1790
|
function toSticky(re) {
|
|
@@ -7705,10 +7712,7 @@ function splitShellSegments(cmd) {
|
|
|
7705
7712
|
}
|
|
7706
7713
|
function isTempPath(fp) {
|
|
7707
7714
|
const norm = fp.replace(/\\/g, "/");
|
|
7708
|
-
return /^\/tmp\//i.test(norm) || /\/var\/folders\//i.test(norm) || // Anchored to a local drive root on purpose. Unanchored, this clause said yes to
|
|
7709
|
-
// `//host/share/AppData/Local/Temp/x.md`, and the caller's answer to yes is to stat the path --
|
|
7710
|
-
// which on Windows opens an SMB session to whatever host a command named. A temp directory is
|
|
7711
|
-
// somewhere on a local volume; nothing that starts with two separators is one.
|
|
7715
|
+
return /^\/tmp\//i.test(norm) || /\/var\/folders\//i.test(norm) || // Anchored to a local drive root on purpose. Unanchored, this clause said yes to `//host/share/AppData/Local/Temp/x.md`, and the caller's answer to yes is to stat the path -- which on Windows opens an SMB session to whatever host a command named. A temp directory is somewhere on a local volume; nothing that starts with two separators is one.
|
|
7712
7716
|
/^[a-z]:\/(?:[^/]+\/)*AppData\/Local\/Temp\//i.test(norm) || norm.startsWith("/c/Users/") && norm.includes("/AppData/Local/Temp/") || isUnderSystemTemp(fp);
|
|
7713
7717
|
}
|
|
7714
7718
|
function isOrchestratorStateFile(filePath) {
|
|
@@ -8256,6 +8260,7 @@ function extractNodeFileRead(cmd) {
|
|
|
8256
8260
|
const filePath = readSync2[1];
|
|
8257
8261
|
if (isOrchestratorStateFile(filePath)) return null;
|
|
8258
8262
|
if (isTempPath(filePath)) return null;
|
|
8263
|
+
if (new RegExp(`(?:writeFileSync|appendFileSync)\\(\\s*['"]${escapeRegExp(filePath)}['"]`).test(cmd)) return null;
|
|
8259
8264
|
const { isDoc, isConfig, isSql } = classifyDocConfig(filePath);
|
|
8260
8265
|
return { filePath, isDoc, isConfig, isSql };
|
|
8261
8266
|
}
|
|
@@ -8521,10 +8526,7 @@ var CURL_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
|
8521
8526
|
"--range",
|
|
8522
8527
|
"-r",
|
|
8523
8528
|
"--interface",
|
|
8524
|
-
// Options whose own value is a URL or a host. Leaving these out was the same defect as reading
|
|
8525
|
-
// the first URL in the string: `curl --doh-url https://doh/ -o f https://target` answered with
|
|
8526
|
-
// the DoH resolver rather than the file being fetched. `--url-query` belongs here too -- it
|
|
8527
|
-
// appends query data to the request, it does not name the request target.
|
|
8529
|
+
// Options whose own value is a URL or a host. Leaving these out was the same defect as reading the first URL in the string: `curl --doh-url https://doh/ -o f https://target` answered with the DoH resolver rather than the file being fetched. `--url-query` belongs here too -- it appends query data to the request, it does not name the request target.
|
|
8528
8530
|
"--url-query",
|
|
8529
8531
|
"--doh-url",
|
|
8530
8532
|
"--preproxy",
|
|
@@ -9988,7 +9990,8 @@ function recordBashFileReadsForSessionCache(cmd, cwd) {
|
|
|
9988
9990
|
}
|
|
9989
9991
|
async function maybeEmitLargeUncompressedHint(cmd, output, exitCode, cwd, isUnwrapped, event, ansiResult) {
|
|
9990
9992
|
const outputBytes = Buffer.byteLength(output, "utf-8");
|
|
9991
|
-
if (outputBytes < 4096 || process.env["TOKEN_GOAT_BASH_COMPRESS"] === "0" || exitCode !== null && exitCode !== 0 ||
|
|
9993
|
+
if (outputBytes < 4096 || process.env["TOKEN_GOAT_BASH_COMPRESS"] === "0" || exitCode !== null && exitCode !== 0 || // token-goat's own output is already the narrow form; telling the model to compress it is noise.
|
|
9994
|
+
/^\s*token-goat\s/.test(cmd) || event.raw["_tg_harness"] !== "vscode" && (isCompressibleSingleCommand(cmd) || !isUnwrapped)) {
|
|
9992
9995
|
return null;
|
|
9993
9996
|
}
|
|
9994
9997
|
const key = `bash-uncompressed-4k:${event.sessionId ?? ""}:${shortFingerprint(cmd)}`;
|
|
@@ -9997,7 +10000,8 @@ async function maybeEmitLargeUncompressedHint(cmd, output, exitCode, cwd, isUnwr
|
|
|
9997
10000
|
recordStat("session_hint", 0, 0);
|
|
9998
10001
|
const id = await storeBashOutput(cmd, output, exitCode ?? 0, cwd);
|
|
9999
10002
|
const kb = Math.round(outputBytes / 1024);
|
|
10000
|
-
const
|
|
10003
|
+
const compressable = !/["`$\r\n]/.test(cmd);
|
|
10004
|
+
const msg = `[tg] Output was ${kb}KB uncompressed; \`token-goat bash-output ${id}\` recalls it` + (compressable ? `, and \`token-goat compress -c "${displaySafeText(cmd)}"\` compresses the next run.` : ".");
|
|
10001
10005
|
if (ansiResult !== null && ansiResult.hookType === "rewriteOutput") {
|
|
10002
10006
|
return emitRewrite(msg + "\n" + fenceUntrusted(ansiResult.updatedOutput, UNTRUSTED_TOOL_TAG), "large uncompressed output hint", void 0, "counted-elsewhere");
|
|
10003
10007
|
}
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
pptxOutline,
|
|
7
7
|
pptxSlideText,
|
|
8
8
|
pptxTextGrep
|
|
9
|
-
} from "./token-goat-chunk-
|
|
10
|
-
import "./token-goat-chunk-
|
|
9
|
+
} from "./token-goat-chunk-W2GUUQAQ.mjs";
|
|
10
|
+
import "./token-goat-chunk-66224KCZ.mjs";
|
|
11
11
|
import "./token-goat-chunk-XTQAOTSO.mjs";
|
|
12
12
|
import "./token-goat-chunk-AH6QILZM.mjs";
|
|
13
|
-
import "./token-goat-chunk-
|
|
13
|
+
import "./token-goat-chunk-UBZCON6N.mjs";
|
|
14
14
|
import "./token-goat-chunk-ERTXEKB6.mjs";
|
|
15
15
|
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
16
16
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
@@ -20,17 +20,17 @@ import {
|
|
|
20
20
|
setOcrTimeoutForTesting,
|
|
21
21
|
setTesseractEntryForTesting,
|
|
22
22
|
verifyOcrLangCache
|
|
23
|
-
} from "./token-goat-chunk-
|
|
24
|
-
import "./token-goat-chunk-
|
|
25
|
-
import "./token-goat-chunk-
|
|
23
|
+
} from "./token-goat-chunk-CICJFVIH.mjs";
|
|
24
|
+
import "./token-goat-chunk-26YUO7MP.mjs";
|
|
25
|
+
import "./token-goat-chunk-MWSVUKVV.mjs";
|
|
26
26
|
import {
|
|
27
27
|
DEFAULT_OCR_LANG,
|
|
28
28
|
isSupportedOcrLang,
|
|
29
29
|
resolveOcrLangs
|
|
30
|
-
} from "./token-goat-chunk-
|
|
30
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
31
31
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
32
32
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
33
|
-
import "./token-goat-chunk-
|
|
33
|
+
import "./token-goat-chunk-UBZCON6N.mjs";
|
|
34
34
|
import "./token-goat-chunk-ERTXEKB6.mjs";
|
|
35
35
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
36
36
|
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
pathEqClause,
|
|
5
5
|
projectScopeClause,
|
|
6
6
|
querySymbols
|
|
7
|
-
} from "./token-goat-chunk-
|
|
7
|
+
} from "./token-goat-chunk-BK3RPPTK.mjs";
|
|
8
8
|
import {
|
|
9
9
|
TREE_SITTER_LANGUAGES,
|
|
10
10
|
_detectOpenQuote,
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
stripJsComments,
|
|
22
22
|
stripStringLiterals,
|
|
23
23
|
stripXmlComments
|
|
24
|
-
} from "./token-goat-chunk-
|
|
24
|
+
} from "./token-goat-chunk-MWSVUKVV.mjs";
|
|
25
25
|
import {
|
|
26
26
|
fingerprintContent,
|
|
27
27
|
loadConfig
|
|
28
|
-
} from "./token-goat-chunk-
|
|
28
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
29
29
|
import {
|
|
30
30
|
registerReset
|
|
31
31
|
} from "./token-goat-chunk-EEIDFMEM.mjs";
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
foldPath,
|
|
40
40
|
globalDbPath,
|
|
41
41
|
isCaseInsensitiveFs
|
|
42
|
-
} from "./token-goat-chunk-
|
|
42
|
+
} from "./token-goat-chunk-UBZCON6N.mjs";
|
|
43
43
|
import {
|
|
44
44
|
displaySafeText,
|
|
45
45
|
normalizePath
|
|
@@ -74,11 +74,11 @@ async function extractEmbeddableDocumentText(filePath) {
|
|
|
74
74
|
return text;
|
|
75
75
|
}
|
|
76
76
|
case ".docx":
|
|
77
|
-
return await (await import("./token-goat-chunk-
|
|
77
|
+
return await (await import("./token-goat-chunk-EKGVCAES.mjs")).docxText(filePath);
|
|
78
78
|
case ".pptx":
|
|
79
|
-
return await (await import("./token-goat-chunk-
|
|
79
|
+
return await (await import("./token-goat-chunk-2XA5ZW4T.mjs")).pptxAllSlidesText(filePath, true);
|
|
80
80
|
case ".xlsx":
|
|
81
|
-
return await (await import("./token-goat-chunk-
|
|
81
|
+
return await (await import("./token-goat-chunk-RFFUCQK7.mjs")).allSheetsHeadText(filePath, XLSX_SHEET_ROW_CAP);
|
|
82
82
|
default:
|
|
83
83
|
return null;
|
|
84
84
|
}
|
|
@@ -1413,7 +1413,7 @@ function _pathPriorityPenalty(filePath) {
|
|
|
1413
1413
|
|
|
1414
1414
|
// src/parser_fingerprint.ts
|
|
1415
1415
|
init_define_import_meta_env();
|
|
1416
|
-
var PARSER_FINGERPRINT = "
|
|
1416
|
+
var PARSER_FINGERPRINT = "0d80572d3abdfb19";
|
|
1417
1417
|
|
|
1418
1418
|
// src/parser.ts
|
|
1419
1419
|
init_define_import_meta_env();
|
|
@@ -1996,6 +1996,28 @@ function extractTsJsSymbols(root, filePath, lines2) {
|
|
|
1996
1996
|
out.push(makeSymbol(filePath, fieldName.text, "method", node, lines2, "c"));
|
|
1997
1997
|
}
|
|
1998
1998
|
}
|
|
1999
|
+
if (node.type === "method_definition" && node.parent?.type === "object") {
|
|
2000
|
+
const name = nodeName(node);
|
|
2001
|
+
if (name !== null && name !== "") {
|
|
2002
|
+
out.push(makeSymbol(filePath, name, "method", node, lines2, "c"));
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
if (node.type === "pair" && node.parent?.type === "object") {
|
|
2006
|
+
const key = node.childForFieldName("key");
|
|
2007
|
+
const value = node.childForFieldName("value");
|
|
2008
|
+
if (key !== null && value !== null) {
|
|
2009
|
+
const keyName = key.type === "identifier" || key.type === "property_identifier" || key.type === "string" ? key.text.replace(/^['"]|['"]$/g, "") : null;
|
|
2010
|
+
if (keyName !== null && keyName !== "") {
|
|
2011
|
+
const isFn = value.type === "arrow_function" || value.type === "function_expression" || value.type === "function";
|
|
2012
|
+
const isObjectOrArray = value.type === "object" || value.type === "array";
|
|
2013
|
+
if (isFn) {
|
|
2014
|
+
out.push(makeSymbol(filePath, keyName, "method", node, lines2, "c"));
|
|
2015
|
+
} else if (isObjectOrArray && node.endPosition.row - node.startPosition.row >= 1) {
|
|
2016
|
+
out.push(makeSymbol(filePath, keyName, "config", node, lines2, "c"));
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
1999
2021
|
const childInside = insideFunction || TSJS_FN_SCOPE_TYPES.has(node.type);
|
|
2000
2022
|
for (const child of node.namedChildren) {
|
|
2001
2023
|
visit(child, childInside);
|
|
@@ -3672,7 +3694,7 @@ function parseSourceSymbolsTreeSitterOnly(content, filePath, language) {
|
|
|
3672
3694
|
var REGEX_ADAPTERS_SLOT = /* @__PURE__ */ Symbol.for("token-goat.regex-adapters");
|
|
3673
3695
|
var adapterSlot = globalThis;
|
|
3674
3696
|
async function loadRegexExtractors() {
|
|
3675
|
-
adapterSlot[REGEX_ADAPTERS_SLOT] ??= await import("./token-goat-chunk-
|
|
3697
|
+
adapterSlot[REGEX_ADAPTERS_SLOT] ??= await import("./token-goat-chunk-GPCCYQSS.mjs");
|
|
3676
3698
|
}
|
|
3677
3699
|
function regexAdapters() {
|
|
3678
3700
|
const loaded = adapterSlot[REGEX_ADAPTERS_SLOT];
|
|
@@ -3,7 +3,7 @@ const require = __cjsRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
deliveredOutputBytes,
|
|
5
5
|
wrappedShell
|
|
6
|
-
} from "./token-goat-chunk-
|
|
6
|
+
} from "./token-goat-chunk-GLOM5W5C.mjs";
|
|
7
7
|
import {
|
|
8
8
|
ToolFilter,
|
|
9
9
|
capTokens,
|
|
@@ -14,18 +14,18 @@ import {
|
|
|
14
14
|
selectFilter,
|
|
15
15
|
shlexSplit,
|
|
16
16
|
storeBashOutputSync
|
|
17
|
-
} from "./token-goat-chunk-
|
|
17
|
+
} from "./token-goat-chunk-C26ZBGBC.mjs";
|
|
18
18
|
import {
|
|
19
19
|
recordStat
|
|
20
|
-
} from "./token-goat-chunk-
|
|
21
|
-
import "./token-goat-chunk-
|
|
22
|
-
import "./token-goat-chunk-
|
|
20
|
+
} from "./token-goat-chunk-26YUO7MP.mjs";
|
|
21
|
+
import "./token-goat-chunk-BK3RPPTK.mjs";
|
|
22
|
+
import "./token-goat-chunk-MWSVUKVV.mjs";
|
|
23
23
|
import {
|
|
24
24
|
loadConfig
|
|
25
|
-
} from "./token-goat-chunk-
|
|
25
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
26
26
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
27
27
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
28
|
-
import "./token-goat-chunk-
|
|
28
|
+
import "./token-goat-chunk-UBZCON6N.mjs";
|
|
29
29
|
import "./token-goat-chunk-ERTXEKB6.mjs";
|
|
30
30
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
31
31
|
import {
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
runJsonOutline,
|
|
57
57
|
runJsonQuery,
|
|
58
58
|
runListSections,
|
|
59
|
+
runLocate,
|
|
59
60
|
runLog,
|
|
60
61
|
runNoteGet,
|
|
61
62
|
runNoteList,
|
|
@@ -90,7 +91,7 @@ import {
|
|
|
90
91
|
symbolNamesInFile,
|
|
91
92
|
upsertNote,
|
|
92
93
|
warnIfFilesStale
|
|
93
|
-
} from "./token-goat-chunk-
|
|
94
|
+
} from "./token-goat-chunk-IDHWKNKZ.mjs";
|
|
94
95
|
import {
|
|
95
96
|
DEFAULT_RECONCILE_BUDGET_MS,
|
|
96
97
|
HOOK_EVENTS,
|
|
@@ -107,7 +108,7 @@ import {
|
|
|
107
108
|
readStdinJson,
|
|
108
109
|
runReconcile,
|
|
109
110
|
storeWebOutput
|
|
110
|
-
} from "./token-goat-chunk-
|
|
111
|
+
} from "./token-goat-chunk-HRUGS6CO.mjs";
|
|
111
112
|
import {
|
|
112
113
|
AGENT_SALT_MARKER,
|
|
113
114
|
CONTEXT_AUTOCOMPACT_TOKENS,
|
|
@@ -243,7 +244,7 @@ import {
|
|
|
243
244
|
visualStudioUserMcpPath,
|
|
244
245
|
walkProject,
|
|
245
246
|
writeCompact
|
|
246
|
-
} from "./token-goat-chunk-
|
|
247
|
+
} from "./token-goat-chunk-PKNOHVWP.mjs";
|
|
247
248
|
import {
|
|
248
249
|
BASH_OUTPUT_SUBDIR,
|
|
249
250
|
CompressedOutput,
|
|
@@ -261,7 +262,7 @@ import {
|
|
|
261
262
|
listRecentRecall,
|
|
262
263
|
normalizeCommandForCacheKey,
|
|
263
264
|
searchRecall
|
|
264
|
-
} from "./token-goat-chunk-
|
|
265
|
+
} from "./token-goat-chunk-C26ZBGBC.mjs";
|
|
265
266
|
import {
|
|
266
267
|
C,
|
|
267
268
|
DEFAULT_MAX_AGE_MS,
|
|
@@ -283,19 +284,19 @@ import {
|
|
|
283
284
|
savedTokensFromBytes,
|
|
284
285
|
stripAnsi,
|
|
285
286
|
summarize
|
|
286
|
-
} from "./token-goat-chunk-
|
|
287
|
+
} from "./token-goat-chunk-26YUO7MP.mjs";
|
|
287
288
|
import {
|
|
288
289
|
docxOutline,
|
|
289
290
|
docxTables,
|
|
290
291
|
docxText,
|
|
291
292
|
formatDocxTables
|
|
292
|
-
} from "./token-goat-chunk-
|
|
293
|
+
} from "./token-goat-chunk-CPHVXKNU.mjs";
|
|
293
294
|
import {
|
|
294
295
|
pptxNotesText,
|
|
295
296
|
pptxOutline,
|
|
296
297
|
pptxSlideText,
|
|
297
298
|
pptxTextGrep
|
|
298
|
-
} from "./token-goat-chunk-
|
|
299
|
+
} from "./token-goat-chunk-W2GUUQAQ.mjs";
|
|
299
300
|
import {
|
|
300
301
|
formatXlsxColumns,
|
|
301
302
|
formatXlsxRange,
|
|
@@ -304,11 +305,11 @@ import {
|
|
|
304
305
|
querySheet,
|
|
305
306
|
rangeSheet,
|
|
306
307
|
xlsxColumns
|
|
307
|
-
} from "./token-goat-chunk-
|
|
308
|
+
} from "./token-goat-chunk-THBLW56G.mjs";
|
|
308
309
|
import {
|
|
309
310
|
formatCsvTable,
|
|
310
311
|
parseWhereSpecs
|
|
311
|
-
} from "./token-goat-chunk-
|
|
312
|
+
} from "./token-goat-chunk-KZPO4DWC.mjs";
|
|
312
313
|
import {
|
|
313
314
|
PARSER_FINGERPRINT,
|
|
314
315
|
embeddingBackendLoadError,
|
|
@@ -331,11 +332,11 @@ import {
|
|
|
331
332
|
readSection,
|
|
332
333
|
treeSitterCoreAvailable,
|
|
333
334
|
treeSitterCoreLoadError
|
|
334
|
-
} from "./token-goat-chunk-
|
|
335
|
+
} from "./token-goat-chunk-73GXYYZR.mjs";
|
|
335
336
|
import {
|
|
336
337
|
getFileEntry,
|
|
337
338
|
querySymbols
|
|
338
|
-
} from "./token-goat-chunk-
|
|
339
|
+
} from "./token-goat-chunk-BK3RPPTK.mjs";
|
|
339
340
|
import {
|
|
340
341
|
TREE_SITTER_LANGUAGES,
|
|
341
342
|
detectLanguage,
|
|
@@ -346,7 +347,7 @@ import {
|
|
|
346
347
|
matchGroovySlashy,
|
|
347
348
|
nonTreeSitterLanguageCount,
|
|
348
349
|
redactIfDotenv
|
|
349
|
-
} from "./token-goat-chunk-
|
|
350
|
+
} from "./token-goat-chunk-MWSVUKVV.mjs";
|
|
350
351
|
import {
|
|
351
352
|
CONFIG_KEY_ENV_OVERRIDES,
|
|
352
353
|
PROJECT_LOCKED_KEYS,
|
|
@@ -375,7 +376,7 @@ import {
|
|
|
375
376
|
stringify,
|
|
376
377
|
validateEnumField,
|
|
377
378
|
validateNumericField
|
|
378
|
-
} from "./token-goat-chunk-
|
|
379
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
379
380
|
import {
|
|
380
381
|
ENV_KEYS,
|
|
381
382
|
LOCK_WAIT_MS_HARDENED,
|
|
@@ -435,7 +436,7 @@ import {
|
|
|
435
436
|
withRetryOnLock,
|
|
436
437
|
writeIfDifferent,
|
|
437
438
|
writeJsonSettings
|
|
438
|
-
} from "./token-goat-chunk-
|
|
439
|
+
} from "./token-goat-chunk-UBZCON6N.mjs";
|
|
439
440
|
import {
|
|
440
441
|
UNTRUSTED_FILE_TAG,
|
|
441
442
|
UNTRUSTED_TOOL_TAG,
|
|
@@ -8038,7 +8039,7 @@ async function runDoctorAndExit(opts) {
|
|
|
8038
8039
|
}
|
|
8039
8040
|
}
|
|
8040
8041
|
try {
|
|
8041
|
-
const { checkUpdateStatus } = await import("./token-goat-chunk-
|
|
8042
|
+
const { checkUpdateStatus } = await import("./token-goat-chunk-RB24DBBS.mjs");
|
|
8042
8043
|
const update = await checkUpdateStatus(1500);
|
|
8043
8044
|
if (update.updateAvailable && update.latest) {
|
|
8044
8045
|
console.log(`
|
|
@@ -15307,6 +15308,16 @@ function registerAnalysisCommands(program2, guard) {
|
|
|
15307
15308
|
})
|
|
15308
15309
|
)
|
|
15309
15310
|
);
|
|
15311
|
+
program2.command("locate <spec>").description("locate symbol or landmark with exact line spans (supports name or file::name, with fuzzy fallback)").option("-j, --json", "output as JSON").option("-l, --limit <n>", "max results (default: 25)").option("-f, --file <path>", "restrict search to a specific file").action(
|
|
15312
|
+
(spec, opts) => runExit(
|
|
15313
|
+
() => runLocate({
|
|
15314
|
+
spec,
|
|
15315
|
+
...opts.file !== void 0 ? { file: opts.file } : {},
|
|
15316
|
+
...opts.json === true ? { json: true } : {},
|
|
15317
|
+
...opts.limit !== void 0 ? { limit: requireNonNegativeInt("--limit", opts.limit) } : {}
|
|
15318
|
+
})
|
|
15319
|
+
)
|
|
15320
|
+
);
|
|
15310
15321
|
program2.command("grep <pattern> [paths...]").description("regex search over files, caching nothing (session-aware grep)").option("-j, --json", "output as JSON").option("--max-lines <n>", "max matching lines to print").option("--no-recursive", "do not descend into subdirectories").option("-C, --context <n>", "lines of context to show before and after each match").option("--symbol", "annotate each hit with its enclosing symbol (name and kind)").action(
|
|
15311
15322
|
(pattern, paths, opts) => runExit(
|
|
15312
15323
|
() => runGrep({
|
|
@@ -20066,7 +20077,7 @@ async function cmdMcpServe() {
|
|
|
20066
20077
|
let StdioServerTransport;
|
|
20067
20078
|
try {
|
|
20068
20079
|
;
|
|
20069
|
-
({ createMcpServer } = await import("./token-goat-chunk-
|
|
20080
|
+
({ createMcpServer } = await import("./token-goat-chunk-YFGEUIEO.mjs"));
|
|
20070
20081
|
({ StdioServerTransport } = await import("./token-goat-chunk-EVC4TOLE.mjs"));
|
|
20071
20082
|
} catch (err2) {
|
|
20072
20083
|
process.stderr.write(
|
|
@@ -20091,7 +20102,7 @@ async function cmdHook(event, opts) {
|
|
|
20091
20102
|
if (typeof opts.harness === "string" && opts.harness.length > 0) {
|
|
20092
20103
|
process.env[ENV_KEYS.HARNESS_OVERRIDE] = opts.harness;
|
|
20093
20104
|
}
|
|
20094
|
-
const { relay } = await import("./token-goat-chunk-
|
|
20105
|
+
const { relay } = await import("./token-goat-chunk-CKIJWTRQ.mjs");
|
|
20095
20106
|
await relay(event);
|
|
20096
20107
|
}
|
|
20097
20108
|
function projectHooksCommitNote(pathFiles, hooksConfigPath) {
|
|
@@ -20128,7 +20139,7 @@ async function cmdInstall(opts) {
|
|
|
20128
20139
|
if (opts.project === true && opts.user === true) {
|
|
20129
20140
|
throw new Error("install takes either -p/--project or --user, not both.");
|
|
20130
20141
|
}
|
|
20131
|
-
await import("./token-goat-chunk-
|
|
20142
|
+
await import("./token-goat-chunk-CKIJWTRQ.mjs");
|
|
20132
20143
|
const scope = opts.project === true ? "project" : "user";
|
|
20133
20144
|
if (wantsClaudeCodeBase(opts)) {
|
|
20134
20145
|
const result = installHooks(scope);
|
|
@@ -20718,7 +20729,7 @@ async function cmdCompress(commandArgs, opts = {}) {
|
|
|
20718
20729
|
process.exitCode = 1;
|
|
20719
20730
|
return;
|
|
20720
20731
|
}
|
|
20721
|
-
const bashRunner = await import("./token-goat-chunk-
|
|
20732
|
+
const bashRunner = await import("./token-goat-chunk-7EGKXBWT.mjs");
|
|
20722
20733
|
if (opts.compress === false) {
|
|
20723
20734
|
process.exitCode = bashRunner.runRaw(command, parseTimeout(opts.timeout, bashRunner.DEFAULT_TIMEOUT_SECONDS));
|
|
20724
20735
|
return;
|
|
@@ -20968,7 +20979,7 @@ function buildProgram() {
|
|
|
20968
20979
|
program2.command("compress [command...]").alias("bash").alias("run").description("run a shell command (under a POSIX shell / bash) and emit a compressed view of its output").allowUnknownOption(true).option("-c, --cmd <command>", "the shell command to run, as one string (use / for paths across platforms)").option("--cmd-b64 <payload>", "the shell command as a base64-encoded string (preserves quotes, backslashes, and symbols across platforms)").option("-f, --filter <name>", "filter name (auto-detected from the command when omitted)").option("--timeout <seconds>", "wall-clock timeout in seconds (0 = built-in default)").option("--no-compress", "stream output raw without compression (debug the wrapper)").option("--profile <name>", "compression profile: aggressive | balanced | minimal").option("--max-tokens <n>", "post-compress token cap (0 = no cap)").option("-q, --quiet-success", "on exit code 0, emit only [tg: ok] summary and store full output for recall via bash-output").option("--native", "use native platform shell (e.g. cmd.exe on Windows) instead of bash, preserving Windows path backslashes").action(cmdCompress);
|
|
20969
20980
|
program2.command("upgrade").alias("update").description("check for updates and upgrade token-goat to the latest version").option("--check", "check whether an update is available without installing").option("-j, --json", "emit version check status as JSON").action(
|
|
20970
20981
|
(opts) => guard(async () => {
|
|
20971
|
-
const { cmdUpgrade } = await import("./token-goat-chunk-
|
|
20982
|
+
const { cmdUpgrade } = await import("./token-goat-chunk-RB24DBBS.mjs");
|
|
20972
20983
|
await cmdUpgrade(opts, () => cmdInstall({}));
|
|
20973
20984
|
})()
|
|
20974
20985
|
);
|
|
@@ -2,12 +2,12 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
getDb
|
|
5
|
-
} from "./token-goat-chunk-
|
|
5
|
+
} from "./token-goat-chunk-MWSVUKVV.mjs";
|
|
6
6
|
import {
|
|
7
7
|
foldPath,
|
|
8
8
|
globalDbPath,
|
|
9
9
|
isCaseInsensitiveFs
|
|
10
|
-
} from "./token-goat-chunk-
|
|
10
|
+
} from "./token-goat-chunk-UBZCON6N.mjs";
|
|
11
11
|
import {
|
|
12
12
|
normalizePath
|
|
13
13
|
} from "./token-goat-chunk-ERTXEKB6.mjs";
|
|
@@ -9,24 +9,24 @@ import {
|
|
|
9
9
|
savedTokensFromBytes,
|
|
10
10
|
storeBlob,
|
|
11
11
|
stripAnsiEscapes
|
|
12
|
-
} from "./token-goat-chunk-
|
|
12
|
+
} from "./token-goat-chunk-26YUO7MP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
sanitizeFtsQuery
|
|
15
|
-
} from "./token-goat-chunk-
|
|
15
|
+
} from "./token-goat-chunk-BK3RPPTK.mjs";
|
|
16
16
|
import {
|
|
17
17
|
getDb
|
|
18
|
-
} from "./token-goat-chunk-
|
|
18
|
+
} from "./token-goat-chunk-MWSVUKVV.mjs";
|
|
19
19
|
import {
|
|
20
20
|
loadConfig,
|
|
21
21
|
shortFingerprint
|
|
22
|
-
} from "./token-goat-chunk-
|
|
22
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
23
23
|
import {
|
|
24
24
|
registerReset
|
|
25
25
|
} from "./token-goat-chunk-EEIDFMEM.mjs";
|
|
26
26
|
import {
|
|
27
27
|
globalDbPath,
|
|
28
28
|
runGit
|
|
29
|
-
} from "./token-goat-chunk-
|
|
29
|
+
} from "./token-goat-chunk-UBZCON6N.mjs";
|
|
30
30
|
import {
|
|
31
31
|
normalizePath,
|
|
32
32
|
resolveIndexPath
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
isSupportedOcrLang,
|
|
6
6
|
loadConfig,
|
|
7
7
|
resolveOcrLangs
|
|
8
|
-
} from "./token-goat-chunk-
|
|
8
|
+
} from "./token-goat-chunk-2VASS5VR.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ensureDirSync,
|
|
11
11
|
tokenGoatHome
|
|
12
|
-
} from "./token-goat-chunk-
|
|
12
|
+
} from "./token-goat-chunk-UBZCON6N.mjs";
|
|
13
13
|
import {
|
|
14
14
|
fenceUntrustedOcrText
|
|
15
15
|
} from "./token-goat-chunk-ERTXEKB6.mjs";
|