token-goat 2.9.15 → 2.9.16
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/dist/{token-goat-chunk-ASYEPR3S.mjs → token-goat-chunk-2IEIBVVD.mjs} +7 -3
- package/dist/{token-goat-chunk-LCZBPOIN.mjs → token-goat-chunk-2PCFAQAS.mjs} +66 -51
- package/dist/{token-goat-chunk-PM76YS22.mjs → token-goat-chunk-3H6FQT62.mjs} +1 -1
- package/dist/{token-goat-chunk-C5JIO6HK.mjs → token-goat-chunk-4DC6DDIB.mjs} +5 -5
- package/dist/{token-goat-chunk-YQ7WI2CO.mjs → token-goat-chunk-5USHO7B6.mjs} +393 -3957
- package/dist/{token-goat-chunk-2X2EBBC6.mjs → token-goat-chunk-63QWJ6UM.mjs} +2 -2
- package/dist/{token-goat-chunk-NDRP4KJQ.mjs → token-goat-chunk-BFNTLGVA.mjs} +226 -50
- package/dist/token-goat-chunk-BGHSSJUA.mjs +102 -0
- package/dist/{token-goat-chunk-IVUQLQWN.mjs → token-goat-chunk-DMQ32ZSR.mjs} +5 -3
- package/dist/{token-goat-chunk-SFAS46RE.mjs → token-goat-chunk-EJCY6KHO.mjs} +2 -2
- package/dist/{token-goat-chunk-Z6UXPYJA.mjs → token-goat-chunk-F2ARFHLJ.mjs} +1 -1
- package/dist/{token-goat-chunk-YKG35VHC.mjs → token-goat-chunk-GIMGT34T.mjs} +1 -1
- package/dist/{token-goat-chunk-SZWYESBS.mjs → token-goat-chunk-GMXBQS6O.mjs} +155 -54
- package/dist/{token-goat-chunk-S4XRY446.mjs → token-goat-chunk-H3DXI6VD.mjs} +4 -3
- package/dist/{token-goat-chunk-6DLVZDB6.mjs → token-goat-chunk-LJL6FGDS.mjs} +13 -12
- package/dist/{token-goat-chunk-NEI4NC54.mjs → token-goat-chunk-LKSXAMJB.mjs} +7 -2
- package/dist/{token-goat-chunk-A4JYKD5H.mjs → token-goat-chunk-M2R4UQ3B.mjs} +2 -2
- package/dist/{token-goat-chunk-MZDIJJ3R.mjs → token-goat-chunk-MA5BZ2KI.mjs} +40 -3
- package/dist/{token-goat-chunk-GIIHUSZX.mjs → token-goat-chunk-MIL62GMN.mjs} +41 -11
- package/dist/{token-goat-chunk-NU7TLMQK.mjs → token-goat-chunk-NAMH252H.mjs} +10 -7
- package/dist/{token-goat-chunk-DQ4J5AFF.mjs → token-goat-chunk-NOBZV7PM.mjs} +69 -18
- package/dist/{token-goat-chunk-5V7DAC7V.mjs → token-goat-chunk-NQZCSVN2.mjs} +10 -3
- package/dist/{token-goat-chunk-7ZYK25AO.mjs → token-goat-chunk-OCI25AXY.mjs} +4 -4
- package/dist/{token-goat-chunk-NDPO7GAH.mjs → token-goat-chunk-QMZMHQRR.mjs} +21 -20
- package/dist/{token-goat-chunk-K7F2BFIK.mjs → token-goat-chunk-R3X5TCPB.mjs} +1 -1
- package/dist/token-goat-chunk-RRNZMM3A.mjs +3364 -0
- package/dist/{token-goat-chunk-ATIFTMRC.mjs → token-goat-chunk-ULA4WCED.mjs} +7 -7
- package/dist/{token-goat-chunk-OUGNPMDA.mjs → token-goat-chunk-UMXD2M7O.mjs} +30 -14
- package/dist/{token-goat-chunk-YZX7EFG4.mjs → token-goat-chunk-UXHDBVUR.mjs} +1 -1
- package/dist/{token-goat-chunk-LT7JRU6K.mjs → token-goat-chunk-VVIYEFBI.mjs} +4 -4
- package/dist/{token-goat-chunk-BL5LNGBG.mjs → token-goat-chunk-XOHTFRDH.mjs} +2966 -3869
- package/dist/{token-goat-chunk-XEPXYDPI.mjs → token-goat-chunk-YPS64ACE.mjs} +11 -2
- package/dist/{token-goat-chunk-GMQQA7E4.mjs → token-goat-chunk-Z5VPAXTC.mjs} +2442 -722
- package/dist/{token-goat-chunk-3NSDDTGL.mjs → token-goat-chunk-ZEHFYJ7Z.mjs} +5 -5
- package/dist/token-goat-hook.mjs +13 -12
- package/dist/token-goat.core.mjs +21 -20
- package/package.json +1 -1
|
@@ -25,12 +25,11 @@ import {
|
|
|
25
25
|
extractSwift,
|
|
26
26
|
extractThrift,
|
|
27
27
|
extractWgsl
|
|
28
|
-
} from "./token-goat-chunk-
|
|
28
|
+
} from "./token-goat-chunk-YPS64ACE.mjs";
|
|
29
29
|
import {
|
|
30
30
|
extractShellBannerHeading
|
|
31
|
-
} from "./token-goat-chunk-
|
|
32
|
-
import "./token-goat-chunk-
|
|
33
|
-
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
31
|
+
} from "./token-goat-chunk-BFNTLGVA.mjs";
|
|
32
|
+
import "./token-goat-chunk-63QWJ6UM.mjs";
|
|
34
33
|
import {
|
|
35
34
|
GENERIC_CLAUSE,
|
|
36
35
|
assignBraceBlockSpans,
|
|
@@ -59,16 +58,17 @@ import {
|
|
|
59
58
|
stripMultilineStringSpan,
|
|
60
59
|
stripStringLiterals,
|
|
61
60
|
stripXmlComments
|
|
62
|
-
} from "./token-goat-chunk-
|
|
63
|
-
import "./token-goat-chunk-
|
|
61
|
+
} from "./token-goat-chunk-R3X5TCPB.mjs";
|
|
62
|
+
import "./token-goat-chunk-H3DXI6VD.mjs";
|
|
64
63
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
65
64
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
66
65
|
import {
|
|
67
66
|
countContentLines,
|
|
68
67
|
escapeRegExp,
|
|
69
68
|
pushAll
|
|
70
|
-
} from "./token-goat-chunk-
|
|
69
|
+
} from "./token-goat-chunk-3H6FQT62.mjs";
|
|
71
70
|
import "./token-goat-chunk-ERTXEKB6.mjs";
|
|
71
|
+
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
72
72
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
73
73
|
import {
|
|
74
74
|
init_define_import_meta_env
|
|
@@ -111,6 +111,27 @@ var PROPERTY_RE = new RegExp(
|
|
|
111
111
|
var PROPERTY_HEADER_RE = new RegExp(
|
|
112
112
|
`${MEMBER_INDENT}(?:(?:public|protected|private|internal|static|virtual|override|abstract|sealed|new|readonly)\\s+)*${TYPE_SLOT}\\s+${MEMBER_NAME}\\s*$`
|
|
113
113
|
);
|
|
114
|
+
var EVENT_RE = new RegExp(
|
|
115
|
+
`${MEMBER_INDENT}(?:(?:public|protected|private|internal|static|virtual|override|abstract|sealed|new|extern|unsafe)\\s+)*event\\s`
|
|
116
|
+
);
|
|
117
|
+
var EVENT_NAME_RE = new RegExp(`(${IDENT})\\s*$`);
|
|
118
|
+
function splitEventDeclarators(decl) {
|
|
119
|
+
const parts = [];
|
|
120
|
+
let depth = 0;
|
|
121
|
+
let start = 0;
|
|
122
|
+
for (let i = 0; i < decl.length; i++) {
|
|
123
|
+
const c = decl[i];
|
|
124
|
+
if (c === "<") depth++;
|
|
125
|
+
else if (c === ">") {
|
|
126
|
+
if (depth > 0) depth--;
|
|
127
|
+
} else if (c === "," && depth === 0) {
|
|
128
|
+
parts.push(decl.slice(start, i));
|
|
129
|
+
start = i + 1;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
parts.push(decl.slice(start));
|
|
133
|
+
return parts;
|
|
134
|
+
}
|
|
114
135
|
var ALLMAN_ACCESSOR_RE = /^(?:get\s*;\s*set\s*;|set\s*;\s*get\s*;|get\s*;|set\s*;)$/;
|
|
115
136
|
var ALLMAN_ACCESSOR_BODY_RE = /^(?:get|set)\b/;
|
|
116
137
|
var PROPERTY_ARROW_RE = new RegExp(
|
|
@@ -183,7 +204,7 @@ function extractCsharp(content, filePath) {
|
|
|
183
204
|
const delM = DELEGATE_RE.exec(stripLeadingAttributes(stripped));
|
|
184
205
|
if (delM) {
|
|
185
206
|
const delegateParent = classStack.length > 0 ? classStack[classStack.length - 1].name : void 0;
|
|
186
|
-
symbols.push(makeLineSymbol(filePath, stripVerbatim(delM[1] ?? ""), "
|
|
207
|
+
symbols.push(makeLineSymbol(filePath, stripVerbatim(delM[1] ?? ""), "type", lineNum, stripped.slice(0, 200), delegateParent, lines, "c"));
|
|
187
208
|
}
|
|
188
209
|
const cm = CLASS_HEADER_RE.exec(stripLeadingAttributes(stripped));
|
|
189
210
|
if (cm) {
|
|
@@ -206,7 +227,16 @@ function extractCsharp(content, filePath) {
|
|
|
206
227
|
symbols.push(makeLineSymbol(filePath, frame.name, "method", lineNum, sig.slice(0, 200), frame.name, lines, "c"));
|
|
207
228
|
}
|
|
208
229
|
let isPropertyLine = false;
|
|
209
|
-
const
|
|
230
|
+
const eventM = EVENT_RE.exec(lineNoAttr);
|
|
231
|
+
if (eventM) {
|
|
232
|
+
isPropertyLine = true;
|
|
233
|
+
const decl = lineNoAttr.slice(eventM[0].length).split(/[;{]/)[0] ?? "";
|
|
234
|
+
for (const part of splitEventDeclarators(decl)) {
|
|
235
|
+
const declM = EVENT_NAME_RE.exec(part.split("=")[0]?.trim() ?? "");
|
|
236
|
+
if (declM) symbols.push(makeLineSymbol(filePath, stripVerbatim(declM[1] ?? ""), "var", lineNum, stripped.slice(0, 200), frame.name, lines, "c"));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const propM = isPropertyLine ? null : PROPERTY_RE.exec(lineNoAttr);
|
|
210
240
|
if (propM) {
|
|
211
241
|
isPropertyLine = true;
|
|
212
242
|
symbols.push(makeLineSymbol(filePath, stripVerbatim(propM[1] ?? ""), "var", lineNum, stripped.slice(0, 200), frame.name, lines, "c"));
|
|
@@ -1164,7 +1194,7 @@ var VB6_PROPERTY_RE = new RegExp(String.raw`^Property\s+(?:Get|Let|Set)\s+(${ID}
|
|
|
1164
1194
|
var PROPERTY_RE2 = new RegExp(String.raw`^Property\s+(${ID})`, "i");
|
|
1165
1195
|
var PROCEDURE_RE = new RegExp(String.raw`^(Sub|Function)\s+(${ID})`, "i");
|
|
1166
1196
|
var OPERATOR_RE = /^Operator\s+([^\s(]+)\s*\(/i;
|
|
1167
|
-
var
|
|
1197
|
+
var EVENT_RE2 = new RegExp(String.raw`^Event\s+(${ID})`, "i");
|
|
1168
1198
|
var CONST_RE3 = /^Const\s+(\S.*)$/i;
|
|
1169
1199
|
var DIM_RE = /^Dim\s+(\S.*)$/i;
|
|
1170
1200
|
var FIELD_AFTER_MODIFIERS_RE = new RegExp(String.raw`^(${ID})\s*(?:\(|As\b|=|,|$)`, "i");
|
|
@@ -1496,7 +1526,7 @@ function extractVb(content, filePath) {
|
|
|
1496
1526
|
open("operator", m[1], "method", stmt);
|
|
1497
1527
|
continue;
|
|
1498
1528
|
}
|
|
1499
|
-
if ((m =
|
|
1529
|
+
if ((m = EVENT_RE2.exec(rest)) !== null) {
|
|
1500
1530
|
const name = cleanName(m[1]);
|
|
1501
1531
|
if (modifiers.has("custom") && !inInterface) open("event", name, "event", stmt);
|
|
1502
1532
|
else emit2(name, "event", stmt);
|
|
@@ -3,7 +3,7 @@ const require = __cjsRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
queryCsv,
|
|
5
5
|
quoteCsvCell
|
|
6
|
-
} from "./token-goat-chunk-
|
|
6
|
+
} from "./token-goat-chunk-GIMGT34T.mjs";
|
|
7
7
|
import {
|
|
8
8
|
NotAnOfficeDocumentError,
|
|
9
9
|
assertOoxmlWithinDeadline,
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
ooxmlWorkDeadline,
|
|
13
13
|
parseOoxmlPart,
|
|
14
14
|
readOoxmlZip
|
|
15
|
-
} from "./token-goat-chunk-
|
|
16
|
-
import {
|
|
17
|
-
DocumentRefusedError
|
|
18
|
-
} from "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
15
|
+
} from "./token-goat-chunk-MA5BZ2KI.mjs";
|
|
19
16
|
import {
|
|
20
17
|
displaySafeText
|
|
21
18
|
} from "./token-goat-chunk-ERTXEKB6.mjs";
|
|
19
|
+
import {
|
|
20
|
+
DocumentRefusedError
|
|
21
|
+
} from "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
22
22
|
import {
|
|
23
23
|
init_define_import_meta_env
|
|
24
24
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -158,8 +158,9 @@ function buildCell(c, shared, styles, date1904) {
|
|
|
158
158
|
raw = { error: e };
|
|
159
159
|
text = e;
|
|
160
160
|
} else {
|
|
161
|
-
const
|
|
162
|
-
|
|
161
|
+
const vText = textOf(c["v"]);
|
|
162
|
+
const n = Number(vText);
|
|
163
|
+
if (vText.trim() === "" || !Number.isFinite(n)) {
|
|
163
164
|
raw = null;
|
|
164
165
|
text = "";
|
|
165
166
|
} else if (isDateStyle) {
|
|
@@ -364,6 +365,8 @@ function cellText(cell) {
|
|
|
364
365
|
if (Array.isArray(obj.richText)) return obj.richText.map((t) => t.text).join("");
|
|
365
366
|
if (typeof obj.error === "string") return obj.error;
|
|
366
367
|
if (obj.result !== void 0) {
|
|
368
|
+
if (obj.result === null) return "";
|
|
369
|
+
if (typeof obj.result === "boolean") return obj.result ? "TRUE" : "FALSE";
|
|
367
370
|
if (obj.result instanceof Date) return formatDateCell(obj.result);
|
|
368
371
|
if (typeof obj.result === "object" && obj.result !== null && typeof obj.result.error === "string") {
|
|
369
372
|
return obj.result.error;
|
|
@@ -25,7 +25,8 @@ import {
|
|
|
25
25
|
runSkeleton,
|
|
26
26
|
runSymbol,
|
|
27
27
|
withPinnedReads
|
|
28
|
-
} from "./token-goat-chunk-
|
|
28
|
+
} from "./token-goat-chunk-2PCFAQAS.mjs";
|
|
29
|
+
import "./token-goat-chunk-EJCY6KHO.mjs";
|
|
29
30
|
import "./token-goat-chunk-LMFO66YD.mjs";
|
|
30
31
|
import {
|
|
31
32
|
buildProjectMap,
|
|
@@ -35,33 +36,31 @@ import {
|
|
|
35
36
|
getProjectIndexCounts,
|
|
36
37
|
isWorkerRunning,
|
|
37
38
|
mapLookupBytesSaved
|
|
38
|
-
} from "./token-goat-chunk-
|
|
39
|
-
import "./token-goat-chunk-
|
|
40
|
-
import
|
|
41
|
-
|
|
39
|
+
} from "./token-goat-chunk-XOHTFRDH.mjs";
|
|
40
|
+
import "./token-goat-chunk-5USHO7B6.mjs";
|
|
41
|
+
import {
|
|
42
|
+
recordStat,
|
|
43
|
+
savedTokensFromBytes
|
|
44
|
+
} from "./token-goat-chunk-DMQ32ZSR.mjs";
|
|
45
|
+
import "./token-goat-chunk-LKSXAMJB.mjs";
|
|
46
|
+
import "./token-goat-chunk-GIMGT34T.mjs";
|
|
42
47
|
import "./token-goat-chunk-3BTK54F3.mjs";
|
|
43
48
|
import "./token-goat-chunk-XTQAOTSO.mjs";
|
|
44
49
|
import "./token-goat-chunk-AH6QILZM.mjs";
|
|
45
|
-
import "./token-goat-chunk-
|
|
50
|
+
import "./token-goat-chunk-YPS64ACE.mjs";
|
|
46
51
|
import {
|
|
47
52
|
checkEmbeddingPreflight,
|
|
48
53
|
embeddingsDepsAvailable
|
|
49
|
-
} from "./token-goat-chunk-
|
|
50
|
-
import "./token-goat-chunk-
|
|
51
|
-
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
52
|
-
import "./token-goat-chunk-SFAS46RE.mjs";
|
|
53
|
-
import {
|
|
54
|
-
recordStat,
|
|
55
|
-
savedTokensFromBytes
|
|
56
|
-
} from "./token-goat-chunk-IVUQLQWN.mjs";
|
|
54
|
+
} from "./token-goat-chunk-BFNTLGVA.mjs";
|
|
55
|
+
import "./token-goat-chunk-63QWJ6UM.mjs";
|
|
57
56
|
import {
|
|
58
57
|
getDb
|
|
59
|
-
} from "./token-goat-chunk-
|
|
58
|
+
} from "./token-goat-chunk-R3X5TCPB.mjs";
|
|
60
59
|
import {
|
|
61
60
|
envStrList,
|
|
62
61
|
loadConfig,
|
|
63
62
|
resolveProjectRoot
|
|
64
|
-
} from "./token-goat-chunk-
|
|
63
|
+
} from "./token-goat-chunk-H3DXI6VD.mjs";
|
|
65
64
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
66
65
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
67
66
|
import {
|
|
@@ -71,12 +70,14 @@ import {
|
|
|
71
70
|
extractErrorMessage,
|
|
72
71
|
foldCaseForContainment,
|
|
73
72
|
globalDbPath
|
|
74
|
-
} from "./token-goat-chunk-
|
|
73
|
+
} from "./token-goat-chunk-3H6FQT62.mjs";
|
|
75
74
|
import {
|
|
76
75
|
displaySafeJson,
|
|
77
76
|
normalizePath
|
|
78
77
|
} from "./token-goat-chunk-ERTXEKB6.mjs";
|
|
78
|
+
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
79
79
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
80
|
+
import "./token-goat-chunk-RRNZMM3A.mjs";
|
|
80
81
|
import {
|
|
81
82
|
init_define_import_meta_env
|
|
82
83
|
} from "./token-goat-chunk-A37V4PBF.mjs";
|
|
@@ -84,6 +85,7 @@ import {
|
|
|
84
85
|
// src/mcp_server.ts
|
|
85
86
|
init_define_import_meta_env();
|
|
86
87
|
import * as fs from "fs";
|
|
88
|
+
import * as os from "os";
|
|
87
89
|
import * as path from "path";
|
|
88
90
|
var TOKEN_GOAT_RETRY_RE = /token-goat (\w[\w-]*) "([^"]+)"/g;
|
|
89
91
|
var MCP_MAX_LIMIT = 1e3;
|
|
@@ -166,10 +168,40 @@ function resolveToolRoot(projectRoot) {
|
|
|
166
168
|
}
|
|
167
169
|
var RootNotAllowedError = class extends Error {
|
|
168
170
|
};
|
|
171
|
+
function getStandardAuxiliaryRoots(targetPath) {
|
|
172
|
+
const home = os.homedir();
|
|
173
|
+
const roots = [
|
|
174
|
+
path.join(home, ".claude", "skills"),
|
|
175
|
+
path.join(home, ".copilot", "skills"),
|
|
176
|
+
path.join(home, ".claude", "projects"),
|
|
177
|
+
path.join(home, ".copilot", "session-state")
|
|
178
|
+
];
|
|
179
|
+
const appData = process.env["APPDATA"] || path.join(home, "AppData", "Roaming");
|
|
180
|
+
roots.push(
|
|
181
|
+
path.join(appData, "Code", "User", "workspaceStorage"),
|
|
182
|
+
path.join(appData, "Code - Insiders", "User", "workspaceStorage"),
|
|
183
|
+
path.join(appData, "Cursor", "User", "workspaceStorage"),
|
|
184
|
+
path.join(home, "Library", "Application Support", "Code", "User", "workspaceStorage"),
|
|
185
|
+
path.join(home, "Library", "Application Support", "Code - Insiders", "User", "workspaceStorage"),
|
|
186
|
+
path.join(home, "Library", "Application Support", "Cursor", "User", "workspaceStorage"),
|
|
187
|
+
path.join(home, ".config", "Code", "User", "workspaceStorage"),
|
|
188
|
+
path.join(home, ".config", "Code - Insiders", "User", "workspaceStorage"),
|
|
189
|
+
path.join(home, ".config", "Cursor", "User", "workspaceStorage")
|
|
190
|
+
);
|
|
191
|
+
if (targetPath) {
|
|
192
|
+
const norm = normalizePath(targetPath);
|
|
193
|
+
const promptIdx = norm.toLowerCase().indexOf("/resources/app/extensions/");
|
|
194
|
+
if (promptIdx !== -1) {
|
|
195
|
+
roots.push(norm.slice(0, promptIdx + "/resources/app/extensions/".length));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return roots;
|
|
199
|
+
}
|
|
169
200
|
function assertRootAllowed(resolvedRoot) {
|
|
170
201
|
const allowedRoots = loadConfig().mcp.allowed_roots;
|
|
171
202
|
if (allowedRoots.length === 0) return;
|
|
172
203
|
if (allowedRoots.some((allowed) => checkWithinProjectRoot(resolvedRoot, allowed).inside)) return;
|
|
204
|
+
if (getStandardAuxiliaryRoots(resolvedRoot).some((aux) => checkWithinProjectRoot(resolvedRoot, aux).inside)) return;
|
|
173
205
|
throw new RootNotAllowedError(
|
|
174
206
|
`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.`
|
|
175
207
|
);
|
|
@@ -229,6 +261,7 @@ function refusalText(file, resolvedRoot, reason) {
|
|
|
229
261
|
}
|
|
230
262
|
function confineTargets(targets, resolvedRoot, splitCommas = true) {
|
|
231
263
|
if (!loadConfig(resolvedRoot).mcp.confine_reads_to_project_root) return { ok: true, targets, pins: NO_PINS };
|
|
264
|
+
const allowedRoots = loadConfig().mcp.allowed_roots;
|
|
232
265
|
const checked = [];
|
|
233
266
|
const pins = /* @__PURE__ */ new Map();
|
|
234
267
|
for (const raw of targets) {
|
|
@@ -236,7 +269,25 @@ function confineTargets(targets, resolvedRoot, splitCommas = true) {
|
|
|
236
269
|
for (const part of parts) {
|
|
237
270
|
const file = specFilePart(part);
|
|
238
271
|
if (file === "") continue;
|
|
239
|
-
|
|
272
|
+
let check = checkWithinProjectRoot(file, resolvedRoot);
|
|
273
|
+
if (!check.inside) {
|
|
274
|
+
for (const allowed of allowedRoots) {
|
|
275
|
+
const altCheck = checkWithinProjectRoot(file, allowed);
|
|
276
|
+
if (altCheck.inside) {
|
|
277
|
+
check = altCheck;
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (!check.inside) {
|
|
283
|
+
for (const aux of getStandardAuxiliaryRoots(file)) {
|
|
284
|
+
const auxCheck = checkWithinProjectRoot(file, aux);
|
|
285
|
+
if (auxCheck.inside) {
|
|
286
|
+
check = auxCheck;
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
240
291
|
if (!check.inside) {
|
|
241
292
|
return { ok: false, refusal: toCallToolResult({ text: refusalText(file, resolvedRoot, check.reason), code: 1 }) };
|
|
242
293
|
}
|
|
@@ -6,10 +6,12 @@ import {
|
|
|
6
6
|
collectParagraphTexts,
|
|
7
7
|
collectTextRuns,
|
|
8
8
|
decodeZipEntry,
|
|
9
|
+
dropAlternateContentFallbacks,
|
|
10
|
+
inlineMathRuns,
|
|
9
11
|
ooxmlPartBudget,
|
|
10
12
|
parseOoxmlPart,
|
|
11
13
|
readOoxmlZip
|
|
12
|
-
} from "./token-goat-chunk-
|
|
14
|
+
} from "./token-goat-chunk-MA5BZ2KI.mjs";
|
|
13
15
|
import {
|
|
14
16
|
displaySafeText
|
|
15
17
|
} from "./token-goat-chunk-ERTXEKB6.mjs";
|
|
@@ -28,11 +30,16 @@ function headingLevel(styleVal) {
|
|
|
28
30
|
const m = /^heading\s*(\d)$/i.exec(styleVal);
|
|
29
31
|
return m?.[1] !== void 0 ? parseInt(m[1], 10) : null;
|
|
30
32
|
}
|
|
33
|
+
function inlineRunSeparators(xml) {
|
|
34
|
+
return xml.replace(/<w:tab\s*\/>/g, "<w:t> </w:t>").replace(/<w:(?:br|cr)(?:\s[^/>]*)?\/>/g, "<w:t>\n</w:t>");
|
|
35
|
+
}
|
|
31
36
|
async function loadDocumentBody(filePath) {
|
|
32
37
|
const entries = await readOoxmlZip(filePath, ".docx");
|
|
33
38
|
const xml = decodeZipEntry(entries, "word/document.xml", ooxmlPartBudget());
|
|
34
39
|
if (xml === null) throw new NotAnOfficeDocumentError(`no word/document.xml found in ${filePath} (not a valid .docx?)`);
|
|
35
|
-
|
|
40
|
+
const parsed = await parseOoxmlPart(inlineMathRuns(inlineRunSeparators(xml), '<w:r><w:t xml:space="preserve">', "</w:t></w:r>"));
|
|
41
|
+
dropAlternateContentFallbacks(parsed);
|
|
42
|
+
return parsed;
|
|
36
43
|
}
|
|
37
44
|
async function docxOutline(filePath) {
|
|
38
45
|
const parsed = await loadDocumentBody(filePath);
|
|
@@ -65,7 +72,7 @@ async function docxTables(filePath) {
|
|
|
65
72
|
const tcElements = collectElements(tr, "w:tc");
|
|
66
73
|
const rowCells = [];
|
|
67
74
|
for (const tc of tcElements) {
|
|
68
|
-
const cellText = collectParagraphTexts(tc, "w:p", "w:t", ["w:tbl"]
|
|
75
|
+
const cellText = collectParagraphTexts(tc, "w:p", "w:t", ["w:tbl"]).map((t) => t.replace(/\r?\n/g, " ").trim()).filter((t) => t.length > 0).join(" ");
|
|
69
76
|
rowCells.push(cellText);
|
|
70
77
|
}
|
|
71
78
|
if (rowCells.length > maxCols) maxCols = rowCells.length;
|
|
@@ -6,13 +6,13 @@ 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-2IEIBVVD.mjs";
|
|
10
|
+
import "./token-goat-chunk-MA5BZ2KI.mjs";
|
|
11
11
|
import "./token-goat-chunk-XTQAOTSO.mjs";
|
|
12
12
|
import "./token-goat-chunk-AH6QILZM.mjs";
|
|
13
|
-
import "./token-goat-chunk-
|
|
14
|
-
import "./token-goat-chunk-PM76YS22.mjs";
|
|
13
|
+
import "./token-goat-chunk-3H6FQT62.mjs";
|
|
15
14
|
import "./token-goat-chunk-ERTXEKB6.mjs";
|
|
15
|
+
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
16
16
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
17
17
|
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
18
18
|
export {
|
|
@@ -70,37 +70,38 @@ import {
|
|
|
70
70
|
requirePositiveInt,
|
|
71
71
|
run,
|
|
72
72
|
visualStudioManualSteps
|
|
73
|
-
} from "./token-goat-chunk-
|
|
74
|
-
import "./token-goat-chunk-
|
|
73
|
+
} from "./token-goat-chunk-Z5VPAXTC.mjs";
|
|
74
|
+
import "./token-goat-chunk-2PCFAQAS.mjs";
|
|
75
|
+
import "./token-goat-chunk-EJCY6KHO.mjs";
|
|
75
76
|
import "./token-goat-chunk-LMFO66YD.mjs";
|
|
76
77
|
import {
|
|
77
78
|
cmdDescribe,
|
|
78
79
|
cmdSessionSchema
|
|
79
|
-
} from "./token-goat-chunk-
|
|
80
|
-
import "./token-goat-chunk-
|
|
81
|
-
import "./token-goat-chunk-
|
|
82
|
-
import "./token-goat-chunk-
|
|
83
|
-
import "./token-goat-chunk-
|
|
84
|
-
import "./token-goat-chunk-
|
|
85
|
-
import "./token-goat-chunk-
|
|
86
|
-
import "./token-goat-chunk-
|
|
80
|
+
} from "./token-goat-chunk-UMXD2M7O.mjs";
|
|
81
|
+
import "./token-goat-chunk-XOHTFRDH.mjs";
|
|
82
|
+
import "./token-goat-chunk-5USHO7B6.mjs";
|
|
83
|
+
import "./token-goat-chunk-DMQ32ZSR.mjs";
|
|
84
|
+
import "./token-goat-chunk-LKSXAMJB.mjs";
|
|
85
|
+
import "./token-goat-chunk-NQZCSVN2.mjs";
|
|
86
|
+
import "./token-goat-chunk-2IEIBVVD.mjs";
|
|
87
|
+
import "./token-goat-chunk-NAMH252H.mjs";
|
|
88
|
+
import "./token-goat-chunk-GIMGT34T.mjs";
|
|
87
89
|
import "./token-goat-chunk-3BTK54F3.mjs";
|
|
88
|
-
import "./token-goat-chunk-
|
|
90
|
+
import "./token-goat-chunk-MA5BZ2KI.mjs";
|
|
89
91
|
import "./token-goat-chunk-XTQAOTSO.mjs";
|
|
90
92
|
import "./token-goat-chunk-AH6QILZM.mjs";
|
|
91
|
-
import "./token-goat-chunk-
|
|
92
|
-
import "./token-goat-chunk-
|
|
93
|
-
import "./token-goat-chunk-
|
|
94
|
-
import "./token-goat-chunk-
|
|
95
|
-
import "./token-goat-chunk-
|
|
96
|
-
import "./token-goat-chunk-IVUQLQWN.mjs";
|
|
97
|
-
import "./token-goat-chunk-K7F2BFIK.mjs";
|
|
98
|
-
import "./token-goat-chunk-S4XRY446.mjs";
|
|
93
|
+
import "./token-goat-chunk-YPS64ACE.mjs";
|
|
94
|
+
import "./token-goat-chunk-BFNTLGVA.mjs";
|
|
95
|
+
import "./token-goat-chunk-63QWJ6UM.mjs";
|
|
96
|
+
import "./token-goat-chunk-R3X5TCPB.mjs";
|
|
97
|
+
import "./token-goat-chunk-H3DXI6VD.mjs";
|
|
99
98
|
import "./token-goat-chunk-EEIDFMEM.mjs";
|
|
100
99
|
import "./token-goat-chunk-OSUFN2FV.mjs";
|
|
101
|
-
import "./token-goat-chunk-
|
|
100
|
+
import "./token-goat-chunk-3H6FQT62.mjs";
|
|
102
101
|
import "./token-goat-chunk-ERTXEKB6.mjs";
|
|
102
|
+
import "./token-goat-chunk-Y4AFKTHK.mjs";
|
|
103
103
|
import "./token-goat-chunk-GMOUBOX4.mjs";
|
|
104
|
+
import "./token-goat-chunk-RRNZMM3A.mjs";
|
|
104
105
|
import "./token-goat-chunk-A37V4PBF.mjs";
|
|
105
106
|
export {
|
|
106
107
|
CliError,
|