@theokit/sdk-tools 0.24.1 → 0.25.0
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/index.cjs +1 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1798,19 +1798,11 @@ function createQuestionTool(opts) {
|
|
|
1798
1798
|
}
|
|
1799
1799
|
var MAX_FILE_SIZE = 5 * 1024 * 1024;
|
|
1800
1800
|
var BINARY_PROBE_BYTES = 8 * 1024;
|
|
1801
|
-
var SENSITIVE_SEGMENTS = /* @__PURE__ */ new Set([".env", ".git", "node_modules", ".theo"]);
|
|
1802
|
-
function isForbiddenAtAnyDepth(path) {
|
|
1803
|
-
const segs = path.replace(/\\/g, "/").split("/").filter(Boolean);
|
|
1804
|
-
return segs.some((s) => {
|
|
1805
|
-
if (s === ".env.example") return false;
|
|
1806
|
-
return SENSITIVE_SEGMENTS.has(s) || /^\.env\./.test(s);
|
|
1807
|
-
});
|
|
1808
|
-
}
|
|
1809
1801
|
function forbiddenReadError(path, allowAbsolute) {
|
|
1810
1802
|
if (isForbiddenPath(path)) {
|
|
1811
1803
|
return JSON.stringify({ ok: false, error: "forbidden_path", path });
|
|
1812
1804
|
}
|
|
1813
|
-
if (allowAbsolute && isAbsolute(path) &&
|
|
1805
|
+
if (allowAbsolute && isAbsolute(path) && ehProibidoEmQualquerProfundidade(path)) {
|
|
1814
1806
|
return JSON.stringify({ ok: false, error: "forbidden_path", path });
|
|
1815
1807
|
}
|
|
1816
1808
|
return null;
|