just-bash 2.11.5 → 2.11.7

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.
Files changed (29) hide show
  1. package/dist/Bash.d.ts +8 -1
  2. package/dist/bin/chunks/chunk-4QM2TCNV.js +2 -0
  3. package/dist/bin/chunks/{chunk-X4GRWTSZ.js → chunk-ISOXAKGQ.js} +58 -58
  4. package/dist/bin/{shell/chunks/expansion-LT2QL7LY.js → chunks/expansion-AMH5BAVV.js} +1 -1
  5. package/dist/bin/chunks/python3-UK6DVXEU.js +14 -0
  6. package/dist/bin/chunks/worker.js +226 -2
  7. package/dist/bin/just-bash.js +233 -233
  8. package/dist/bin/shell/chunks/chunk-4QM2TCNV.js +2 -0
  9. package/dist/bin/shell/chunks/{chunk-X4GRWTSZ.js → chunk-ISOXAKGQ.js} +58 -58
  10. package/dist/bin/{chunks/expansion-LT2QL7LY.js → shell/chunks/expansion-AMH5BAVV.js} +1 -1
  11. package/dist/bin/shell/chunks/python3-UK6DVXEU.js +14 -0
  12. package/dist/bin/shell/shell.js +267 -266
  13. package/dist/bundle/browser.js +554 -554
  14. package/dist/bundle/chunks/{chunk-YSCUI42G.js → chunk-V4CDPGZH.js} +58 -58
  15. package/dist/bundle/chunks/chunk-YYAPW4OA.js +1 -0
  16. package/dist/bundle/chunks/{expansion-HFUNFLDT.js → expansion-5HXXJ2SG.js} +1 -1
  17. package/dist/bundle/chunks/python3-W2D6SNQF.js +13 -0
  18. package/dist/bundle/chunks/worker.js +226 -2
  19. package/dist/bundle/index.js +181 -181
  20. package/dist/fs/real-fs-utils.d.ts +3 -1
  21. package/dist/fs/sanitize-error.d.ts +16 -0
  22. package/dist/index.d.ts +1 -1
  23. package/dist/limits.d.ts +2 -0
  24. package/dist/parser/lexer.d.ts +6 -1
  25. package/dist/parser/parser.d.ts +3 -3
  26. package/package.json +1 -1
  27. package/dist/bin/chunks/python3-ZWX5SFJ3.js +0 -14
  28. package/dist/bin/shell/chunks/python3-ZWX5SFJ3.js +0 -14
  29. package/dist/bundle/chunks/python3-SKZGHYDO.js +0 -13
package/dist/Bash.d.ts CHANGED
@@ -11,7 +11,7 @@ import { type CommandName } from "./commands/registry.js";
11
11
  import { type CustomCommand } from "./custom-commands.js";
12
12
  import type { IFileSystem, InitialFiles } from "./fs/interface.js";
13
13
  import { type ExecutionLimits } from "./limits.js";
14
- import { type NetworkConfig } from "./network/index.js";
14
+ import { type NetworkConfig, type SecureFetch } from "./network/index.js";
15
15
  import type { DefenseInDepthConfig } from "./security/types.js";
16
16
  import type { BashTransformResult, TransformPlugin } from "./transform/types.js";
17
17
  import type { BashExecResult, Command, FeatureCoverageWriter, TraceCallback } from "./types.js";
@@ -48,6 +48,13 @@ export interface BashOptions {
48
48
  * @deprecated Use executionLimits.maxLoopIterations instead
49
49
  */
50
50
  maxLoopIterations?: number;
51
+ /**
52
+ * Custom secure fetch function. When provided, used instead of creating one
53
+ * from NetworkConfig. Enables wrapping the fetch layer with custom logic
54
+ * (e.g., policy evaluation) while keeping built-in curl unmodified.
55
+ * Network commands (curl, wget) are registered when either `fetch` or `network` is provided.
56
+ */
57
+ fetch?: SecureFetch;
51
58
  /**
52
59
  * Network configuration for commands like curl.
53
60
  * Network access is disabled by default - you must explicitly configure allowed URLs.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ function d(t){if(!t)return t;let e=t.replace(/\n\s+at\s.*/g,"");return e=e.replace(/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,"<path>"),e=e.replace(/[A-Z]:\\[^\s'",)}\]:]+/g,"<path>"),e}import*as o from"node:fs";import*as r from"node:path";function y(t){if(!t||t==="/")return"/";let e=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;e.startsWith("/")||(e=`/${e}`);let n=e.split("/").filter(i=>i&&i!=="."),s=[];for(let i of n)i===".."?s.pop():s.push(i);return`/${s.join("/")}`||"/"}function f(t,e){return t===e||t.startsWith(`${e}/`)}function a(t,e){try{let n=o.realpathSync(t);return f(n,e)?n:null}catch(n){if(n.code==="ENOENT"){let s=r.dirname(t);if(s===t)return null;let i=a(s,e);if(i===null)return null;try{if(o.lstatSync(t).isSymbolicLink()){let l=o.readlinkSync(t),u=r.isAbsolute(l)?l:r.resolve(r.dirname(t),l);if(a(u,e)===null)return null}}catch{}return r.join(i,r.basename(t))}return null}}function v(t,e,n){let s=a(t,n);if(s===null)return null;let i=r.resolve(t),c=i.slice(e.length),l=s.slice(n.length);if(c!==l)return null;try{if(o.lstatSync(i).isSymbolicLink())return null}catch{}return s}function m(t,e){if(!o.existsSync(t))throw new Error(`${e} root does not exist`);if(!o.statSync(t).isDirectory())throw new Error(`${e} root is not a directory`)}function S(t,e){if(t.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${e} '${t}'`)}function x(t,e){if(!r.isAbsolute(t))return{withinRoot:!0,relativePath:t};let n;try{n=o.realpathSync(t)}catch{n=r.resolve(t)}return f(n,e)?{withinRoot:!0,relativePath:n.slice(e.length)||"/"}:{withinRoot:!1,safeName:r.basename(t)}}export{d as a,y as b,f as c,a as d,v as e,m as f,S as g,x as h};