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