@theokit/sdk-tools 0.24.0 → 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 CHANGED
@@ -865,9 +865,7 @@ function createGitStatusTool(opts) {
865
865
  }
866
866
  const scopeCheck = checkPathScope(path$1, projectRoot);
867
867
  if (scopeCheck !== null) return scopeCheck;
868
- const args = ["status", "--porcelain=v1"];
869
- if (opts.includeBranch !== false) args.push("-b");
870
- if (path$1 !== void 0 && path$1 !== "") args.push("--", path$1);
868
+ const args = montarArgs(path$1, opts.includeBranch !== false);
871
869
  if (opts.sandbox !== void 0) {
872
870
  return statusViaSandbox(opts.sandbox, ctx, args, timeoutMs);
873
871
  }
@@ -876,6 +874,12 @@ function createGitStatusTool(opts) {
876
874
  }
877
875
  });
878
876
  }
877
+ function montarArgs(path, comBranch) {
878
+ const args = ["status", "--porcelain=v1"];
879
+ if (comBranch) args.push("-b");
880
+ if (path !== void 0 && path !== "") args.push("--", path);
881
+ return args;
882
+ }
879
883
  async function statusViaSandbox(sandbox$1, ctx, args, timeoutMs) {
880
884
  const command = ["git", ...args].map(shq).join(" ");
881
885
  const backend = await sandbox.resolveSandbox(sandbox$1, ctx ?? {});
@@ -1796,19 +1800,11 @@ function createQuestionTool(opts) {
1796
1800
  }
1797
1801
  var MAX_FILE_SIZE = 5 * 1024 * 1024;
1798
1802
  var BINARY_PROBE_BYTES = 8 * 1024;
1799
- var SENSITIVE_SEGMENTS = /* @__PURE__ */ new Set([".env", ".git", "node_modules", ".theo"]);
1800
- function isForbiddenAtAnyDepth(path) {
1801
- const segs = path.replace(/\\/g, "/").split("/").filter(Boolean);
1802
- return segs.some((s) => {
1803
- if (s === ".env.example") return false;
1804
- return SENSITIVE_SEGMENTS.has(s) || /^\.env\./.test(s);
1805
- });
1806
- }
1807
1803
  function forbiddenReadError(path$1, allowAbsolute) {
1808
1804
  if (pathSafety.isForbiddenPath(path$1)) {
1809
1805
  return JSON.stringify({ ok: false, error: "forbidden_path", path: path$1 });
1810
1806
  }
1811
- if (allowAbsolute && path.isAbsolute(path$1) && isForbiddenAtAnyDepth(path$1)) {
1807
+ if (allowAbsolute && path.isAbsolute(path$1) && ehProibidoEmQualquerProfundidade(path$1)) {
1812
1808
  return JSON.stringify({ ok: false, error: "forbidden_path", path: path$1 });
1813
1809
  }
1814
1810
  return null;