token-goat 2.9.26 → 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-CQHY4SL7.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-5M3NRJD2.mjs → token-goat-chunk-4STDIGYC.mjs} +2 -2
- package/dist/{token-goat-chunk-BH4ZVRB2.mjs → token-goat-chunk-5NNYIUGV.mjs} +2 -2
- package/dist/{token-goat-chunk-LHUP4DXZ.mjs → token-goat-chunk-66LODAUT.mjs} +1 -1
- package/dist/{token-goat-chunk-M6CVNHTW.mjs → token-goat-chunk-6CCQDAYY.mjs} +69 -566
- package/dist/{token-goat-chunk-62IHOU6L.mjs → token-goat-chunk-6DQNNFJ6.mjs} +5 -3
- package/dist/{token-goat-chunk-H2CPLEMP.mjs → token-goat-chunk-6SGLIPQB.mjs} +40 -20
- package/dist/{token-goat-chunk-MBDJR6HU.mjs → token-goat-chunk-6Z5ULNE5.mjs} +3570 -3970
- package/dist/token-goat-chunk-7MAFDRVR.mjs +47 -0
- package/dist/{token-goat-chunk-POOI26O6.mjs → token-goat-chunk-7R2XYKC5.mjs} +6 -5
- package/dist/{token-goat-chunk-E6B2UFDF.mjs → token-goat-chunk-BCN2YQC6.mjs} +10 -8
- package/dist/token-goat-chunk-BJBRGPBX.mjs +244 -0
- package/dist/{token-goat-chunk-TG5ZPD6B.mjs → token-goat-chunk-CBMY2FGI.mjs} +479 -544
- package/dist/{token-goat-chunk-LRIZ7K3F.mjs → token-goat-chunk-CC2PYJM7.mjs} +2 -1
- package/dist/{token-goat-chunk-7EPYB34H.mjs → token-goat-chunk-D5ICEPSB.mjs} +14 -14
- package/dist/token-goat-chunk-D7GHQKQD.mjs +30 -0
- package/dist/{token-goat-chunk-JALB3KWJ.mjs → token-goat-chunk-EL7M26WP.mjs} +7623 -8462
- package/dist/{token-goat-chunk-ZZT6PVB3.mjs → token-goat-chunk-F7QZRIWM.mjs} +69 -20
- package/dist/{token-goat-chunk-FLEYOCAS.mjs → token-goat-chunk-FSTWAOW6.mjs} +3 -3
- package/dist/token-goat-chunk-GGLEE35R.mjs +564 -0
- package/dist/{token-goat-chunk-IKZLSRII.mjs → token-goat-chunk-HUDC5GS5.mjs} +2 -2
- package/dist/{token-goat-chunk-43JFN26X.mjs → token-goat-chunk-HXNAC4ZF.mjs} +22 -964
- package/dist/token-goat-chunk-I7CB3X4K.mjs +1379 -0
- package/dist/{token-goat-chunk-GKZ2US5B.mjs → token-goat-chunk-IFORDBGC.mjs} +32 -27
- package/dist/{token-goat-chunk-CXBOFPF4.mjs → token-goat-chunk-IHKZ3QNA.mjs} +26 -15
- package/dist/token-goat-chunk-IZXKVT4A.mjs +711 -0
- package/dist/{token-goat-chunk-PAV6NNY7.mjs → token-goat-chunk-JXK2HQXS.mjs} +22 -8
- package/dist/{token-goat-chunk-6E2IDLHF.mjs → token-goat-chunk-L45ZQRT7.mjs} +1 -1
- package/dist/{token-goat-chunk-MDV5VWF4.mjs → token-goat-chunk-L7SDVGBT.mjs} +196 -14
- package/dist/token-goat-chunk-LEG3JNJ6.mjs +139 -0
- package/dist/{token-goat-chunk-7SXPJOSZ.mjs → token-goat-chunk-M56BWPBN.mjs} +1 -1
- package/dist/{token-goat-chunk-G6EYO5CD.mjs → token-goat-chunk-MAMQPC43.mjs} +2 -87
- package/dist/{token-goat-chunk-VVROQBQJ.mjs → token-goat-chunk-MMLMALWK.mjs} +5 -3
- package/dist/{token-goat-chunk-D2X7XN5M.mjs → token-goat-chunk-MVSWBNMD.mjs} +7 -231
- package/dist/{token-goat-chunk-C2PG4K5D.mjs → token-goat-chunk-NILVK7XM.mjs} +4 -4
- package/dist/{token-goat-chunk-BAWKGODL.mjs → token-goat-chunk-Q4S3UQGO.mjs} +1 -1
- package/dist/{token-goat-chunk-MWID3YOY.mjs → token-goat-chunk-QM76S6YS.mjs} +3 -3
- package/dist/{token-goat-chunk-4GEDH2WU.mjs → token-goat-chunk-RJH64KQH.mjs} +81 -70
- package/dist/{token-goat-chunk-STYRLQIW.mjs → token-goat-chunk-RSS3TLXU.mjs} +2 -2
- package/dist/{token-goat-chunk-5BQ7W7D7.mjs → token-goat-chunk-SJEKA7Y2.mjs} +21 -16
- package/dist/{token-goat-chunk-RIB6XY2V.mjs → token-goat-chunk-UBUKHVYW.mjs} +1 -1
- package/dist/{token-goat-chunk-7Y6GWTII.mjs → token-goat-chunk-VE27HPIF.mjs} +14 -10
- package/dist/{token-goat-chunk-RH27ZSPF.mjs → token-goat-chunk-VWZKZPSR.mjs} +100 -23
- package/dist/{token-goat-chunk-L45IWWMC.mjs → token-goat-chunk-XI2VFAV6.mjs} +6 -6
- package/dist/{token-goat-chunk-WNBSCSAI.mjs → token-goat-chunk-XKY4VKJ4.mjs} +1 -1
- package/dist/{token-goat-chunk-L43RKNHA.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-ADMR3QVF.mjs +0 -41
- package/dist/token-goat-chunk-MZTO4FXH.mjs +0 -26
|
@@ -3,37 +3,41 @@ const require = __cjsRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
enqueueDirtyPathsSafe,
|
|
5
5
|
fenceUntrusted,
|
|
6
|
-
getToolName,
|
|
7
6
|
getTrackedFiles,
|
|
8
7
|
scanAndRecord
|
|
9
|
-
} from "./token-goat-chunk-
|
|
8
|
+
} from "./token-goat-chunk-6Z5ULNE5.mjs";
|
|
9
|
+
import {
|
|
10
|
+
getToolName
|
|
11
|
+
} from "./token-goat-chunk-IZXKVT4A.mjs";
|
|
10
12
|
import {
|
|
11
13
|
RECALL_DEFAULT_LIMIT,
|
|
12
14
|
indexRecallEntry,
|
|
13
15
|
listRecentRecall,
|
|
14
16
|
searchRecall
|
|
15
|
-
} from "./token-goat-chunk-
|
|
17
|
+
} from "./token-goat-chunk-HXNAC4ZF.mjs";
|
|
16
18
|
import {
|
|
17
19
|
isBlobStale,
|
|
18
20
|
loadBlob,
|
|
19
|
-
redactSecrets,
|
|
20
21
|
storeBlob
|
|
21
|
-
} from "./token-goat-chunk-
|
|
22
|
+
} from "./token-goat-chunk-BJBRGPBX.mjs";
|
|
23
|
+
import {
|
|
24
|
+
redactSecrets
|
|
25
|
+
} from "./token-goat-chunk-MVSWBNMD.mjs";
|
|
22
26
|
import {
|
|
23
27
|
parserFingerprintForLanguage
|
|
24
|
-
} from "./token-goat-chunk-
|
|
28
|
+
} from "./token-goat-chunk-D5ICEPSB.mjs";
|
|
25
29
|
import {
|
|
26
30
|
getProjectFileEntries,
|
|
27
31
|
projectScopeClause
|
|
28
|
-
} from "./token-goat-chunk-
|
|
32
|
+
} from "./token-goat-chunk-HUDC5GS5.mjs";
|
|
29
33
|
import {
|
|
30
34
|
getDb
|
|
31
|
-
} from "./token-goat-chunk-
|
|
35
|
+
} from "./token-goat-chunk-M56BWPBN.mjs";
|
|
32
36
|
import {
|
|
33
37
|
fingerprintFile,
|
|
34
38
|
getDisplayRoot,
|
|
35
39
|
shortFingerprint
|
|
36
|
-
} from "./token-goat-chunk-
|
|
40
|
+
} from "./token-goat-chunk-CC2PYJM7.mjs";
|
|
37
41
|
import {
|
|
38
42
|
registerReset
|
|
39
43
|
} from "./token-goat-chunk-EEIDFMEM.mjs";
|
|
@@ -44,7 +48,7 @@ import {
|
|
|
44
48
|
foldPath,
|
|
45
49
|
globalDbPath,
|
|
46
50
|
pad
|
|
47
|
-
} from "./token-goat-chunk-
|
|
51
|
+
} from "./token-goat-chunk-L45ZQRT7.mjs";
|
|
48
52
|
import {
|
|
49
53
|
UNTRUSTED_TOOL_TAG,
|
|
50
54
|
UNTRUSTED_WEB_TAG,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isTextHeavy,
|
|
6
6
|
ocrImage,
|
|
7
7
|
ocrIntegrityFailed
|
|
8
|
-
} from "./token-goat-chunk-
|
|
8
|
+
} from "./token-goat-chunk-4STDIGYC.mjs";
|
|
9
9
|
import {
|
|
10
10
|
formatSqliteQueryTable,
|
|
11
11
|
formatSqliteSchema,
|
|
@@ -42,23 +42,25 @@ import {
|
|
|
42
42
|
urlPolicyDenialReason,
|
|
43
43
|
virtualIndexedScopeNote,
|
|
44
44
|
walkProject
|
|
45
|
-
} from "./token-goat-chunk-
|
|
45
|
+
} from "./token-goat-chunk-6Z5ULNE5.mjs";
|
|
46
|
+
import {
|
|
47
|
+
isBlobStale,
|
|
48
|
+
loadBlob,
|
|
49
|
+
storeBlob
|
|
50
|
+
} from "./token-goat-chunk-BJBRGPBX.mjs";
|
|
46
51
|
import {
|
|
47
52
|
capJsonRows,
|
|
48
53
|
estimateTokens,
|
|
49
54
|
trimToBudget
|
|
50
|
-
} from "./token-goat-chunk-
|
|
55
|
+
} from "./token-goat-chunk-4JMWPWCS.mjs";
|
|
51
56
|
import {
|
|
52
57
|
BYTES_PER_TOKEN,
|
|
53
58
|
colorStdout,
|
|
54
|
-
isBlobStale,
|
|
55
|
-
loadBlob,
|
|
56
59
|
recordStat,
|
|
57
60
|
redactSecrets,
|
|
58
61
|
savedTokensFromBytes,
|
|
59
|
-
storeBlob,
|
|
60
62
|
stripAnsiEscapes
|
|
61
|
-
} from "./token-goat-chunk-
|
|
63
|
+
} from "./token-goat-chunk-MVSWBNMD.mjs";
|
|
62
64
|
import {
|
|
63
65
|
extractPdfMeta,
|
|
64
66
|
extractPdfOutline,
|
|
@@ -72,7 +74,7 @@ import {
|
|
|
72
74
|
parseWhereSpecs,
|
|
73
75
|
profileCsv,
|
|
74
76
|
queryCsv
|
|
75
|
-
} from "./token-goat-chunk-
|
|
77
|
+
} from "./token-goat-chunk-YWSP6IU7.mjs";
|
|
76
78
|
import {
|
|
77
79
|
MAX_ZIP_INPUT_BYTES,
|
|
78
80
|
MAX_ZIP_OUTPUT_BYTES,
|
|
@@ -107,7 +109,7 @@ import {
|
|
|
107
109
|
extractSolidity,
|
|
108
110
|
extractThrift,
|
|
109
111
|
stripLeadingAttributes
|
|
110
|
-
} from "./token-goat-chunk-
|
|
112
|
+
} from "./token-goat-chunk-66LODAUT.mjs";
|
|
111
113
|
import {
|
|
112
114
|
MAX_OVER_FETCH,
|
|
113
115
|
OVER_FETCH_FACTOR,
|
|
@@ -121,7 +123,7 @@ import {
|
|
|
121
123
|
mergeNearbyHits,
|
|
122
124
|
readSection,
|
|
123
125
|
searchSemantic
|
|
124
|
-
} from "./token-goat-chunk-
|
|
126
|
+
} from "./token-goat-chunk-D5ICEPSB.mjs";
|
|
125
127
|
import {
|
|
126
128
|
DEFAULT_QUERY_LIMIT,
|
|
127
129
|
countRefs,
|
|
@@ -134,7 +136,7 @@ import {
|
|
|
134
136
|
queryRefsByContext,
|
|
135
137
|
querySymbols,
|
|
136
138
|
searchSymbolsFts
|
|
137
|
-
} from "./token-goat-chunk-
|
|
139
|
+
} from "./token-goat-chunk-HUDC5GS5.mjs";
|
|
138
140
|
import {
|
|
139
141
|
FILENAME_LANGUAGE,
|
|
140
142
|
TREE_SITTER_LANGUAGES,
|
|
@@ -153,7 +155,7 @@ import {
|
|
|
153
155
|
partialRefsReason,
|
|
154
156
|
redactIfDotenv,
|
|
155
157
|
unsupportedLanguageName
|
|
156
|
-
} from "./token-goat-chunk-
|
|
158
|
+
} from "./token-goat-chunk-M56BWPBN.mjs";
|
|
157
159
|
import {
|
|
158
160
|
fileIsAbsent,
|
|
159
161
|
findProject,
|
|
@@ -163,7 +165,7 @@ import {
|
|
|
163
165
|
loadConfig,
|
|
164
166
|
resolveProjectRoot,
|
|
165
167
|
shortFingerprint
|
|
166
|
-
} from "./token-goat-chunk-
|
|
168
|
+
} from "./token-goat-chunk-CC2PYJM7.mjs";
|
|
167
169
|
import {
|
|
168
170
|
registerReset
|
|
169
171
|
} from "./token-goat-chunk-EEIDFMEM.mjs";
|
|
@@ -196,7 +198,7 @@ import {
|
|
|
196
198
|
supportRequestLine,
|
|
197
199
|
windowsCmdQuoteArg,
|
|
198
200
|
withExtension
|
|
199
|
-
} from "./token-goat-chunk-
|
|
201
|
+
} from "./token-goat-chunk-L45ZQRT7.mjs";
|
|
200
202
|
import {
|
|
201
203
|
UNTRUSTED_FILE_TAG,
|
|
202
204
|
UNTRUSTED_GITHUB_TAG,
|
|
@@ -253,15 +255,22 @@ function outlineJson(data, opts = {}) {
|
|
|
253
255
|
}
|
|
254
256
|
if (type === "object") {
|
|
255
257
|
const obj = data;
|
|
256
|
-
|
|
258
|
+
const keys = Object.keys(obj);
|
|
259
|
+
const needle = opts.keyFilter?.toLowerCase();
|
|
260
|
+
if (needle === void 0) return { kind: "object", fields: keys.map((k) => fieldSummary(k, obj[k])) };
|
|
261
|
+
const kept = keys.filter((k) => k.toLowerCase().includes(needle));
|
|
262
|
+
return { kind: "object", fields: kept.map((k) => fieldSummary(k, obj[k])), filter: { needle: opts.keyFilter, total: keys.length } };
|
|
257
263
|
}
|
|
258
264
|
return { kind: "primitive", type };
|
|
259
265
|
}
|
|
260
266
|
function formatJsonOutline(outline) {
|
|
261
267
|
if (outline.kind === "primitive") return `(scalar ${outline.type})`;
|
|
262
268
|
if (outline.kind === "object") {
|
|
263
|
-
|
|
264
|
-
|
|
269
|
+
const { filter } = outline;
|
|
270
|
+
const tally = filter === void 0 ? "" : `(${outline.fields.length} of ${filter.total} keys contain "${displaySafeText(filter.needle)}")`;
|
|
271
|
+
if (outline.fields.length === 0) return filter === void 0 ? "(empty object)" : tally;
|
|
272
|
+
const lines2 = outline.fields.map((f) => `${displaySafeText(f.name)}: ${f.type}${f.size !== void 0 ? ` (${f.size})` : ""}`);
|
|
273
|
+
return (filter === void 0 ? lines2 : [...lines2, tally]).join("\n");
|
|
265
274
|
}
|
|
266
275
|
const lines = [`array of ${outline.length} element${outline.length === 1 ? "" : "s"} (${outline.elementType})`];
|
|
267
276
|
if (outline.sampleKeys !== void 0) {
|
|
@@ -371,6 +380,9 @@ function parseJsonPath(spec) {
|
|
|
371
380
|
const inner = spec.slice(i + 1, close);
|
|
372
381
|
if (inner === "*") {
|
|
373
382
|
ops.push({ kind: "wildcard" });
|
|
383
|
+
} else if (/^\s*(["'])(?:\\.|(?!\1)[^\\])*\1\s*$/.test(inner)) {
|
|
384
|
+
const quoted = inner.trim();
|
|
385
|
+
ops.push({ kind: "key", name: quoted.slice(1, -1).replace(/\\(["'\\])/g, "$1") });
|
|
374
386
|
} else if (/^-?\d+$/.test(inner)) {
|
|
375
387
|
ops.push({ kind: "index", index: Number(inner) });
|
|
376
388
|
} else {
|
|
@@ -387,7 +399,7 @@ function parseJsonPath(spec) {
|
|
|
387
399
|
if (bareOperator !== null) {
|
|
388
400
|
throw new Error(`unsupported comparison operator '${bareOperator[0]}' in '[${inner}]' of path spec '${spec}': this grammar filters by equality only ([field=value])`);
|
|
389
401
|
}
|
|
390
|
-
throw new Error(`invalid bracket expression '[${inner}]' in path spec: '${spec}' (expected [n], [*], or [field=value])`);
|
|
402
|
+
throw new Error(`invalid bracket expression '[${inner}]' in path spec: '${spec}' (expected [n], [*], ["key"], or [field=value])`);
|
|
391
403
|
}
|
|
392
404
|
let field = m[1].trim();
|
|
393
405
|
if (field.startsWith("@.")) field = field.slice(2).trim();
|
|
@@ -7467,7 +7479,11 @@ function runOutlineCommand(opts, parse, formatLabel, kind) {
|
|
|
7467
7479
|
emitErr(`Failed to parse ${formatLabel}: ${opts.file}`);
|
|
7468
7480
|
return 1;
|
|
7469
7481
|
}
|
|
7470
|
-
const outline = outlineJson(data);
|
|
7482
|
+
const outline = outlineJson(data, opts.filter === void 0 ? {} : { keyFilter: opts.filter });
|
|
7483
|
+
if (opts.filter !== void 0 && outline.kind !== "object") {
|
|
7484
|
+
emitErr(`--filter narrows an object's keys, and the top level of ${opts.file} is ${outline.kind === "array" ? "an array" : "a scalar"}`);
|
|
7485
|
+
return 1;
|
|
7486
|
+
}
|
|
7471
7487
|
const fullSourceBytes = sumFileSizes([opts.file]);
|
|
7472
7488
|
if (opts.json === true) {
|
|
7473
7489
|
const jsonText = displaySafeJson(outline, 0);
|
|
@@ -11029,8 +11045,7 @@ ${emptyIndexMessage(emptyIndexRoot)}`;
|
|
|
11029
11045
|
const items = capped.items.map((s) => ({
|
|
11030
11046
|
...s,
|
|
11031
11047
|
filePath: toDisplayPath(symbolDisplayRoot, s.filePath),
|
|
11032
|
-
// Only present when true, so a result set of live files stays byte-identical to what this
|
|
11033
|
-
// command has always emitted and only the genuinely-gone rows grow a field.
|
|
11048
|
+
// Only present when true, so a result set of live files stays byte-identical to what this command has always emitted and only the genuinely-gone rows grow a field.
|
|
11034
11049
|
...fileIsGone(s.filePath) ? { deleted: true } : {},
|
|
11035
11050
|
...stillStale.has(s.filePath) ? { stale: true } : {},
|
|
11036
11051
|
...refCounts !== void 0 ? { refCount: refCounts.get(s.name) ?? 0, hasDoc: hasRealDocstring(s.docstring) } : {}
|
|
@@ -11413,8 +11428,7 @@ function runRefsCrossFile(pairs, opts) {
|
|
|
11413
11428
|
return renderRefsTargets(
|
|
11414
11429
|
pairs.map((p) => ({ file: p.file, symbol: p.symbol, key: keyFor(p) })),
|
|
11415
11430
|
opts,
|
|
11416
|
-
// Not annotated today; renderRefsTargets's own option doc explains why that is a preserved
|
|
11417
|
-
// divergence rather than a decision.
|
|
11431
|
+
// Not annotated today; renderRefsTargets's own option doc explains why that is a preserved divergence rather than a decision.
|
|
11418
11432
|
{ annotateHiddenByGrep: false }
|
|
11419
11433
|
);
|
|
11420
11434
|
}
|
|
@@ -11935,6 +11949,7 @@ function runGrep(opts) {
|
|
|
11935
11949
|
return 0;
|
|
11936
11950
|
}
|
|
11937
11951
|
var RRF_K = 60;
|
|
11952
|
+
var WEAK_MATCH_DISTANCE = 0.85;
|
|
11938
11953
|
function applyRelevanceFloor(hits, floor) {
|
|
11939
11954
|
const kept = [];
|
|
11940
11955
|
let nearestRejected = null;
|
|
@@ -12047,6 +12062,8 @@ async function runSemantic(query, opts) {
|
|
|
12047
12062
|
}
|
|
12048
12063
|
rawHits = kept;
|
|
12049
12064
|
}
|
|
12065
|
+
const closestDense = rawHits.reduce((best, h) => best === null || h.distance < best ? h.distance : best, null);
|
|
12066
|
+
const weakClosestDistance = closestDense !== null && closestDense > WEAK_MATCH_DISTANCE ? closestDense : null;
|
|
12050
12067
|
if (rawHits.length === 0 && floorNearestRejected === null && isAvailable() && preflight.status === "ready" && !searchSemanticError) {
|
|
12051
12068
|
try {
|
|
12052
12069
|
const enabled = loadConfig().indexing.embeddings_enabled;
|
|
@@ -12140,6 +12157,7 @@ async function runSemantic(query, opts) {
|
|
|
12140
12157
|
truncated: capped.truncated || limitTruncated,
|
|
12141
12158
|
totalCount: eligibleCount,
|
|
12142
12159
|
...candidatesClipped ? { totalCountIsFloor: true } : {},
|
|
12160
|
+
...weakClosestDistance !== null ? { lowConfidence: { closestDistance: weakClosestDistance, threshold: WEAK_MATCH_DISTANCE } } : {},
|
|
12143
12161
|
...preflight.status !== "ready" ? {
|
|
12144
12162
|
preflightStatus: preflight.status,
|
|
12145
12163
|
warning: preflight.summary,
|
|
@@ -12166,6 +12184,11 @@ ${previewLines(h.previewText, 3)}`;
|
|
|
12166
12184
|
if (hits.length < eligibleCount) {
|
|
12167
12185
|
emitErr(`Showing ${hits.length} of ${candidatesClipped ? "at least " : ""}${countNoun(eligibleCount, "match", "matches")} (raise --limit to see the rest).`);
|
|
12168
12186
|
}
|
|
12187
|
+
if (weakClosestDistance !== null) {
|
|
12188
|
+
console.warn(
|
|
12189
|
+
`Matching on meaning found nothing close for '${query}' (closest was ${weakClosestDistance.toFixed(3)}, weak above ${WEAK_MATCH_DISTANCE}); these results may be unrelated. For a known name try token-goat symbol --grep <pattern> or rg, or rephrase the query.`
|
|
12190
|
+
);
|
|
12191
|
+
}
|
|
12169
12192
|
recordReadStat("semantic_search", sumFileSizes(hits.map((h) => h.filePath)), text2, query);
|
|
12170
12193
|
return { text: text2, code: 0 };
|
|
12171
12194
|
}
|
|
@@ -12212,6 +12235,18 @@ ${previewLines(entry.text, 3)}`).join("\n\n"),
|
|
|
12212
12235
|
}
|
|
12213
12236
|
const indexEmpty = isIndexEmptyForProject(globalDbPath(), rootDir);
|
|
12214
12237
|
if (opts.json === true) {
|
|
12238
|
+
let symFound = false;
|
|
12239
|
+
const trimmedQuery2 = query.trim();
|
|
12240
|
+
const isIdentifier2 = /^[A-Za-z0-9_.:-]+$/.test(trimmedQuery2);
|
|
12241
|
+
if (!indexEmpty && isIdentifier2) {
|
|
12242
|
+
try {
|
|
12243
|
+
const symMatches = querySymbols({ name: trimmedQuery2, rootDir, limit: 1 });
|
|
12244
|
+
if (symMatches.length > 0) {
|
|
12245
|
+
symFound = true;
|
|
12246
|
+
}
|
|
12247
|
+
} catch {
|
|
12248
|
+
}
|
|
12249
|
+
}
|
|
12215
12250
|
const payload = indexEmpty ? {
|
|
12216
12251
|
source: "fts",
|
|
12217
12252
|
items: [],
|
|
@@ -12239,6 +12274,10 @@ ${previewLines(entry.text, 3)}`).join("\n\n"),
|
|
|
12239
12274
|
} : searchSemanticError !== null ? {
|
|
12240
12275
|
preflightStatus: "degraded",
|
|
12241
12276
|
warning: `Matching on meaning failed (${searchSemanticError}); results come from keyword search alone.`
|
|
12277
|
+
} : {},
|
|
12278
|
+
...!indexEmpty && isIdentifier2 ? {
|
|
12279
|
+
symbolSuggestion: `token-goat symbol "${trimmedQuery2}"`,
|
|
12280
|
+
...symFound ? { indexedSymbolFound: true } : {}
|
|
12242
12281
|
} : {}
|
|
12243
12282
|
};
|
|
12244
12283
|
const text2 = displaySafeJson(payload);
|
|
@@ -12246,6 +12285,25 @@ ${previewLines(entry.text, 3)}`).join("\n\n"),
|
|
|
12246
12285
|
}
|
|
12247
12286
|
let text = indexEmpty ? `token-goat: no matches for '${query}'
|
|
12248
12287
|
${emptyIndexMessage(rootDir)}` : `token-goat: no matches for '${query}'`;
|
|
12288
|
+
const trimmedQuery = query.trim();
|
|
12289
|
+
const isIdentifier = /^[A-Za-z0-9_.:-]+$/.test(trimmedQuery);
|
|
12290
|
+
if (!indexEmpty && isIdentifier) {
|
|
12291
|
+
let symFound = false;
|
|
12292
|
+
try {
|
|
12293
|
+
const symMatches = querySymbols({ name: trimmedQuery, rootDir, limit: 1 });
|
|
12294
|
+
if (symMatches.length > 0) {
|
|
12295
|
+
symFound = true;
|
|
12296
|
+
}
|
|
12297
|
+
} catch {
|
|
12298
|
+
}
|
|
12299
|
+
if (symFound) {
|
|
12300
|
+
text += `
|
|
12301
|
+
(note: '${trimmedQuery}' is an indexed symbol name; use: token-goat symbol "${trimmedQuery}")`;
|
|
12302
|
+
} else {
|
|
12303
|
+
text += `
|
|
12304
|
+
Try: token-goat symbol "${trimmedQuery}"`;
|
|
12305
|
+
}
|
|
12306
|
+
}
|
|
12249
12307
|
if (preflight.status !== "ready") {
|
|
12250
12308
|
text += `
|
|
12251
12309
|
(note: semantic indexing is degraded [${preflight.status}]: ${preflight.summary}${preflight.actionRequired ? ` \u2014 ${preflight.actionRequired}` : ""})`;
|
|
@@ -12255,6 +12313,24 @@ ${emptyIndexMessage(rootDir)}` : `token-goat: no matches for '${query}'`;
|
|
|
12255
12313
|
}
|
|
12256
12314
|
return { text, code: 1 };
|
|
12257
12315
|
}
|
|
12316
|
+
async function runSemanticMulti(queries, opts) {
|
|
12317
|
+
const laterOpts = { ...opts };
|
|
12318
|
+
delete laterOpts.warm;
|
|
12319
|
+
const blocks = [];
|
|
12320
|
+
const entries = [];
|
|
12321
|
+
let anyOk = false;
|
|
12322
|
+
for (const [i, query] of queries.entries()) {
|
|
12323
|
+
const sub = await runSemantic(query, i === 0 ? opts : laterOpts);
|
|
12324
|
+
if (sub.code === 0) anyOk = true;
|
|
12325
|
+
if (opts.json === true) {
|
|
12326
|
+
entries.push({ query, ...JSON.parse(sub.text) });
|
|
12327
|
+
continue;
|
|
12328
|
+
}
|
|
12329
|
+
blocks.push(`'${query}':
|
|
12330
|
+
${sub.text}`);
|
|
12331
|
+
}
|
|
12332
|
+
return { text: opts.json === true ? displaySafeJson(entries) : blocks.join("\n\n"), code: anyOk ? 0 : 1 };
|
|
12333
|
+
}
|
|
12258
12334
|
|
|
12259
12335
|
// src/read_spec.ts
|
|
12260
12336
|
function fileExists3(p) {
|
|
@@ -12848,6 +12924,7 @@ export {
|
|
|
12848
12924
|
runScreenshot,
|
|
12849
12925
|
runGrep,
|
|
12850
12926
|
runSemantic,
|
|
12927
|
+
runSemanticMulti,
|
|
12851
12928
|
CONTENT_MAX_INPUT_CHARS,
|
|
12852
12929
|
compressText,
|
|
12853
12930
|
retrieveText,
|
|
@@ -2,26 +2,26 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
renderWebFetchRow
|
|
5
|
-
} from "./token-goat-chunk-
|
|
5
|
+
} from "./token-goat-chunk-L7SDVGBT.mjs";
|
|
6
6
|
import {
|
|
7
7
|
SESSIONS_SUBDIR,
|
|
8
8
|
extractChecklistSection,
|
|
9
9
|
getSkillFilePath,
|
|
10
10
|
listSkills
|
|
11
|
-
} from "./token-goat-chunk-
|
|
11
|
+
} from "./token-goat-chunk-6CCQDAYY.mjs";
|
|
12
12
|
import {
|
|
13
13
|
getBashOutput
|
|
14
|
-
} from "./token-goat-chunk-
|
|
14
|
+
} from "./token-goat-chunk-HXNAC4ZF.mjs";
|
|
15
15
|
import {
|
|
16
16
|
loadBlob
|
|
17
|
-
} from "./token-goat-chunk-
|
|
17
|
+
} from "./token-goat-chunk-BJBRGPBX.mjs";
|
|
18
18
|
import {
|
|
19
19
|
resolveProjectRoot
|
|
20
|
-
} from "./token-goat-chunk-
|
|
20
|
+
} from "./token-goat-chunk-CC2PYJM7.mjs";
|
|
21
21
|
import {
|
|
22
22
|
runGit,
|
|
23
23
|
safeSlice
|
|
24
|
-
} from "./token-goat-chunk-
|
|
24
|
+
} from "./token-goat-chunk-L45ZQRT7.mjs";
|
|
25
25
|
import {
|
|
26
26
|
displaySafePath,
|
|
27
27
|
displaySafeText,
|
package/dist/token-goat-hook.mjs
CHANGED
|
@@ -2,26 +2,32 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
relayInProcess
|
|
5
|
-
} from "./token-goat-chunk-
|
|
6
|
-
import "./token-goat-chunk-
|
|
7
|
-
import "./token-goat-chunk-
|
|
8
|
-
import "./token-goat-chunk-
|
|
9
|
-
import "./token-goat-chunk-
|
|
10
|
-
import "./token-goat-chunk-
|
|
11
|
-
import "./token-goat-chunk-
|
|
12
|
-
import "./token-goat-chunk-
|
|
13
|
-
import "./token-goat-chunk-
|
|
14
|
-
import "./token-goat-chunk-
|
|
15
|
-
import "./token-goat-chunk-
|
|
16
|
-
import "./token-goat-chunk-
|
|
5
|
+
} from "./token-goat-chunk-EL7M26WP.mjs";
|
|
6
|
+
import "./token-goat-chunk-F7QZRIWM.mjs";
|
|
7
|
+
import "./token-goat-chunk-I7CB3X4K.mjs";
|
|
8
|
+
import "./token-goat-chunk-VE27HPIF.mjs";
|
|
9
|
+
import "./token-goat-chunk-6Z5ULNE5.mjs";
|
|
10
|
+
import "./token-goat-chunk-IZXKVT4A.mjs";
|
|
11
|
+
import "./token-goat-chunk-RJH64KQH.mjs";
|
|
12
|
+
import "./token-goat-chunk-6DQNNFJ6.mjs";
|
|
13
|
+
import "./token-goat-chunk-MMLMALWK.mjs";
|
|
14
|
+
import "./token-goat-chunk-L7SDVGBT.mjs";
|
|
15
|
+
import "./token-goat-chunk-6CCQDAYY.mjs";
|
|
16
|
+
import "./token-goat-chunk-GGLEE35R.mjs";
|
|
17
|
+
import "./token-goat-chunk-MAMQPC43.mjs";
|
|
18
|
+
import "./token-goat-chunk-HXNAC4ZF.mjs";
|
|
19
|
+
import "./token-goat-chunk-BJBRGPBX.mjs";
|
|
20
|
+
import "./token-goat-chunk-4JMWPWCS.mjs";
|
|
21
|
+
import "./token-goat-chunk-4RN64ZND.mjs";
|
|
22
|
+
import "./token-goat-chunk-MVSWBNMD.mjs";
|
|
17
23
|
import "./token-goat-chunk-3BTK54F3.mjs";
|
|
18
|
-
import "./token-goat-chunk-
|
|
19
|
-
import "./token-goat-chunk-
|
|
20
|
-
import "./token-goat-chunk-
|
|
21
|
-
import "./token-goat-chunk-
|
|
24
|
+
import "./token-goat-chunk-D5ICEPSB.mjs";
|
|
25
|
+
import "./token-goat-chunk-HUDC5GS5.mjs";
|
|
26
|
+
import "./token-goat-chunk-M56BWPBN.mjs";
|
|
27
|
+
import "./token-goat-chunk-CC2PYJM7.mjs";
|
|
22
28
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
23
29
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
24
|
-
import "./token-goat-chunk-
|
|
30
|
+
import "./token-goat-chunk-L45ZQRT7.mjs";
|
|
25
31
|
import "./token-goat-chunk-NMTKNYGF.mjs";
|
|
26
32
|
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
27
33
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
package/dist/token-goat.core.mjs
CHANGED
|
@@ -2,42 +2,47 @@ import { createRequire as __cjsRequire } from 'node:module';
|
|
|
2
2
|
const require = __cjsRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
run
|
|
5
|
-
} from "./token-goat-chunk-
|
|
6
|
-
import "./token-goat-chunk-
|
|
7
|
-
import "./token-goat-chunk-
|
|
8
|
-
import "./token-goat-chunk-
|
|
9
|
-
import "./token-goat-chunk-RH27ZSPF.mjs";
|
|
10
|
-
import "./token-goat-chunk-5M3NRJD2.mjs";
|
|
5
|
+
} from "./token-goat-chunk-CBMY2FGI.mjs";
|
|
6
|
+
import "./token-goat-chunk-VWZKZPSR.mjs";
|
|
7
|
+
import "./token-goat-chunk-4STDIGYC.mjs";
|
|
8
|
+
import "./token-goat-chunk-5NNYIUGV.mjs";
|
|
11
9
|
import "./token-goat-chunk-DA43OE7L.mjs";
|
|
12
|
-
import "./token-goat-chunk-
|
|
13
|
-
import "./token-goat-chunk-
|
|
14
|
-
import "./token-goat-chunk-
|
|
15
|
-
import "./token-goat-chunk-
|
|
16
|
-
import "./token-goat-chunk-
|
|
17
|
-
import "./token-goat-chunk-
|
|
18
|
-
import "./token-goat-chunk-
|
|
19
|
-
import "./token-goat-chunk-
|
|
20
|
-
import "./token-goat-chunk-
|
|
21
|
-
import "./token-goat-chunk-
|
|
10
|
+
import "./token-goat-chunk-JXK2HQXS.mjs";
|
|
11
|
+
import "./token-goat-chunk-XI2VFAV6.mjs";
|
|
12
|
+
import "./token-goat-chunk-VE27HPIF.mjs";
|
|
13
|
+
import "./token-goat-chunk-6Z5ULNE5.mjs";
|
|
14
|
+
import "./token-goat-chunk-IZXKVT4A.mjs";
|
|
15
|
+
import "./token-goat-chunk-RJH64KQH.mjs";
|
|
16
|
+
import "./token-goat-chunk-6DQNNFJ6.mjs";
|
|
17
|
+
import "./token-goat-chunk-MMLMALWK.mjs";
|
|
18
|
+
import "./token-goat-chunk-L7SDVGBT.mjs";
|
|
19
|
+
import "./token-goat-chunk-6CCQDAYY.mjs";
|
|
20
|
+
import "./token-goat-chunk-GGLEE35R.mjs";
|
|
21
|
+
import "./token-goat-chunk-MAMQPC43.mjs";
|
|
22
|
+
import "./token-goat-chunk-HXNAC4ZF.mjs";
|
|
23
|
+
import "./token-goat-chunk-BJBRGPBX.mjs";
|
|
24
|
+
import "./token-goat-chunk-4JMWPWCS.mjs";
|
|
25
|
+
import "./token-goat-chunk-4RN64ZND.mjs";
|
|
26
|
+
import "./token-goat-chunk-MVSWBNMD.mjs";
|
|
22
27
|
import "./token-goat-chunk-LKSXAMJB.mjs";
|
|
23
|
-
import "./token-goat-chunk-
|
|
24
|
-
import "./token-goat-chunk-
|
|
25
|
-
import "./token-goat-chunk-
|
|
26
|
-
import "./token-goat-chunk-
|
|
28
|
+
import "./token-goat-chunk-XKY4VKJ4.mjs";
|
|
29
|
+
import "./token-goat-chunk-Q4S3UQGO.mjs";
|
|
30
|
+
import "./token-goat-chunk-RSS3TLXU.mjs";
|
|
31
|
+
import "./token-goat-chunk-YWSP6IU7.mjs";
|
|
27
32
|
import "./token-goat-chunk-3BTK54F3.mjs";
|
|
28
|
-
import "./token-goat-chunk-
|
|
33
|
+
import "./token-goat-chunk-UBUKHVYW.mjs";
|
|
29
34
|
import "./token-goat-chunk-XTQAOTSO.mjs";
|
|
30
35
|
import "./token-goat-chunk-AH6QILZM.mjs";
|
|
31
|
-
import "./token-goat-chunk-
|
|
32
|
-
import "./token-goat-chunk-
|
|
33
|
-
import "./token-goat-chunk-
|
|
34
|
-
import "./token-goat-chunk-
|
|
35
|
-
import "./token-goat-chunk-
|
|
36
|
+
import "./token-goat-chunk-66LODAUT.mjs";
|
|
37
|
+
import "./token-goat-chunk-D5ICEPSB.mjs";
|
|
38
|
+
import "./token-goat-chunk-HUDC5GS5.mjs";
|
|
39
|
+
import "./token-goat-chunk-M56BWPBN.mjs";
|
|
40
|
+
import "./token-goat-chunk-CC2PYJM7.mjs";
|
|
36
41
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
37
42
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
38
43
|
import {
|
|
39
44
|
installEpipeGuard
|
|
40
|
-
} from "./token-goat-chunk-
|
|
45
|
+
} from "./token-goat-chunk-L45ZQRT7.mjs";
|
|
41
46
|
import "./token-goat-chunk-NMTKNYGF.mjs";
|
|
42
47
|
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
43
48
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|