token-goat 2.6.33 → 2.6.35
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 +4 -0
- package/SECURITY.md +11 -10
- package/dist/{token-goat-chunk-FN6WLFIX.mjs → token-goat-chunk-D5IZEGN2.mjs} +817 -53
- package/dist/{token-goat-hook-chunk-HXHFLKEL.mjs → token-goat-chunk-DQIT5JIF.mjs} +7 -2
- package/dist/{token-goat-chunk-72R7M5H7.mjs → token-goat-chunk-DRAIYVUI.mjs} +16 -14
- package/dist/{token-goat-chunk-RPOXYJWK.mjs → token-goat-chunk-HW4VUKJ5.mjs} +77 -26
- package/dist/{token-goat-chunk-TDYTBCT4.mjs → token-goat-chunk-I2KCEGIP.mjs} +704 -138
- package/dist/{token-goat-chunk-WFRR2DBG.mjs → token-goat-chunk-K7W3P2TJ.mjs} +583 -343
- package/dist/{token-goat-chunk-OHQ7RBLL.mjs → token-goat-chunk-SIHYQCTM.mjs} +2 -2
- package/dist/{token-goat-chunk-77CX3MCN.mjs → token-goat-chunk-UIZVX3HN.mjs} +2 -2
- package/dist/{token-goat-chunk-L6FVTDPD.mjs → token-goat-chunk-Y2NH6DGZ.mjs} +564 -31
- package/dist/{token-goat-chunk-HPWPUBAK.mjs → token-goat-chunk-YF67EWRH.mjs} +5 -5
- package/dist/{token-goat-hook-chunk-E6AIPKNF.mjs → token-goat-hook-chunk-2O7P4Z6Q.mjs} +579 -339
- package/dist/{token-goat-hook-chunk-WBBHV6TZ.mjs → token-goat-hook-chunk-3AAH72SO.mjs} +77 -26
- package/dist/{token-goat-hook-chunk-QD2DX2U7.mjs → token-goat-hook-chunk-4POU6OHK.mjs} +564 -31
- package/dist/{token-goat-hook-chunk-ZT47M3IA.mjs → token-goat-hook-chunk-CRBMPT74.mjs} +2 -2
- package/dist/{token-goat-hook-chunk-26DLRODR.mjs → token-goat-hook-chunk-D6UJEFHX.mjs} +2 -2
- package/dist/{token-goat-hook-chunk-XBOWDNJB.mjs → token-goat-hook-chunk-J4HKWUWZ.mjs} +5 -5
- package/dist/{token-goat-chunk-RQQ4SY2P.mjs → token-goat-hook-chunk-NIPXIAPA.mjs} +7 -2
- package/dist/{token-goat-hook-chunk-VDXQXYJK.mjs → token-goat-hook-chunk-NXVT4F3S.mjs} +817 -53
- package/dist/{token-goat-hook-chunk-EKGDLI4D.mjs → token-goat-hook-chunk-VU6VGZBM.mjs} +16 -14
- package/dist/{token-goat-hook-chunk-UWV4MTYI.mjs → token-goat-hook-chunk-XM4W3WCO.mjs} +704 -138
- package/dist/token-goat-hook.mjs +5 -5
- package/dist/token-goat.core.mjs +5 -5
- package/package.json +11 -10
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
runSkeleton,
|
|
26
26
|
runSymbol,
|
|
27
27
|
withPinnedReads
|
|
28
|
-
} from "./token-goat-hook-chunk-
|
|
28
|
+
} from "./token-goat-hook-chunk-NXVT4F3S.mjs";
|
|
29
29
|
import {
|
|
30
30
|
buildProjectMap,
|
|
31
31
|
embeddingsDepsAvailable,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
getProjectIndexCounts,
|
|
35
35
|
isWorkerRunning,
|
|
36
36
|
mapLookupBytesSaved
|
|
37
|
-
} from "./token-goat-hook-chunk-
|
|
37
|
+
} from "./token-goat-hook-chunk-XM4W3WCO.mjs";
|
|
38
38
|
import {
|
|
39
39
|
VERSION,
|
|
40
40
|
dataDir,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
normalizePath,
|
|
46
46
|
recordStat,
|
|
47
47
|
resolveProjectRoot
|
|
48
|
-
} from "./token-goat-hook-chunk-
|
|
48
|
+
} from "./token-goat-hook-chunk-2O7P4Z6Q.mjs";
|
|
49
49
|
import "./token-goat-hook-chunk-BUOCULAM.mjs";
|
|
50
50
|
import "./token-goat-hook-chunk-RFRLWOQH.mjs";
|
|
51
51
|
|
|
@@ -126,7 +126,19 @@ function forCompare(p) {
|
|
|
126
126
|
return process.platform === "win32" ? p.toLowerCase() : p;
|
|
127
127
|
}
|
|
128
128
|
function resolveToolRoot(projectRoot) {
|
|
129
|
-
|
|
129
|
+
const resolved = resolveProjectRoot(projectRoot !== void 0 ? { project: projectRoot } : {});
|
|
130
|
+
assertRootAllowed(resolved);
|
|
131
|
+
return resolved;
|
|
132
|
+
}
|
|
133
|
+
var RootNotAllowedError = class extends Error {
|
|
134
|
+
};
|
|
135
|
+
function assertRootAllowed(resolvedRoot) {
|
|
136
|
+
const allowedRoots = loadConfig().mcp.allowed_roots;
|
|
137
|
+
if (allowedRoots.length === 0) return;
|
|
138
|
+
if (allowedRoots.some((allowed) => checkWithinProjectRoot(resolvedRoot, allowed).inside)) return;
|
|
139
|
+
throw new RootNotAllowedError(
|
|
140
|
+
`refused: "${resolvedRoot}" is not inside any root listed in mcp.allowed_roots. A caller-supplied projectRoot is untrusted input, so this deployment pins which roots may be named; add the root to mcp.allowed_roots (or TOKEN_GOAT_MCP_ALLOWED_ROOTS) to permit it.`
|
|
141
|
+
);
|
|
130
142
|
}
|
|
131
143
|
function checkWithinProjectRoot(target, resolvedRoot) {
|
|
132
144
|
const root = forCompare(normalizePath(realPathOrSelf(resolvedRoot)));
|
|
@@ -150,16 +162,6 @@ function specFilePart(spec) {
|
|
|
150
162
|
var NO_PINS = /* @__PURE__ */ new Map();
|
|
151
163
|
function confineTargets(targets, resolvedRoot, splitCommas = true) {
|
|
152
164
|
if (!loadConfig(resolvedRoot).mcp.confine_reads_to_project_root) return { ok: true, targets, pins: NO_PINS };
|
|
153
|
-
const allowedRoots = loadConfig().mcp.allowed_roots;
|
|
154
|
-
if (allowedRoots.length > 0 && !allowedRoots.some((allowed) => checkWithinProjectRoot(resolvedRoot, allowed).inside)) {
|
|
155
|
-
return {
|
|
156
|
-
ok: false,
|
|
157
|
-
refusal: toCallToolResult({
|
|
158
|
-
text: `refused: "${resolvedRoot}" is not inside any root listed in mcp.allowed_roots. A caller-supplied projectRoot is untrusted input, so this deployment pins which roots may be named; add the root to mcp.allowed_roots (or TOKEN_GOAT_MCP_ALLOWED_ROOTS) to permit it.`,
|
|
159
|
-
code: 1
|
|
160
|
-
})
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
165
|
const checked = [];
|
|
164
166
|
const pins = /* @__PURE__ */ new Map();
|
|
165
167
|
for (const raw of targets) {
|