ask-sandbox-providers 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb95b1b00d2c4ed3bb7e3e9a98f77d9035b8c3cc5e990b47870e3edec87f4ea8
4
- data.tar.gz: 64781ff4c3f4e8020d759cdef227a05b9f4a21f0b36a6bbb6776aca8849310f5
3
+ metadata.gz: 3a0d6fd353895bba424a5a181ccf55e6c0da0273dc9a411f65db972830c99516
4
+ data.tar.gz: 84eb48ca0657db9cf00232559e4ab977fe31c1bb7c530881f59e1f9b0ef70bd1
5
5
  SHA512:
6
- metadata.gz: a14deb3e21c8ae4f73b65fd20d5f5eb6176ea871f6184fc18ecf826285ea1c150fa2f22fdf3a03d33e4602f817c7401f1e2da976a1b0fee6e451d880a39e5278
7
- data.tar.gz: 3a1480416aa824fc853bdb6da60d278cad5699c6e8571d3d0bcd2bd5626f07a24b3664f884f7c7ac9166eaede264bfb954b2a8e1839a93bd9a566d819e9de9aa
6
+ metadata.gz: c7145f2991c6989fbdd58c70fe301a66a05d2848fe0244059c6d082c7cb75e36089271f1ef02b8d903c538945f6db813b8efbe498513b778663ba5c07623f154
7
+ data.tar.gz: bd310ad9bb7a8f5ff51e03911856d96348fc4091b824f09e53eca3b3eb32ec0c062e3a1850c0d810caa4399c324771be057ee1d8cfceb9f98d70b965bae8ef2c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [0.1.4] — 2026-08-03
2
+
3
+ ### Changed
4
+
5
+ - **Commands run in the caller's working directory by default** (was: a
6
+ fresh temp dir). The shell tools (Write, Edit, ...) operate relative to
7
+ the process CWD, so a sandboxed command that couldn't see a file the file
8
+ tools had just created — `ruby hello.rb` after writing it with Write
9
+ failed with `LoadError` — now works like a real terminal. Pass `workdir:`
10
+ to pin a specific directory (e.g. an empty temp dir for hermetic runs).
11
+
12
+ ## [0.1.3] — 2026-08-03
13
+
14
+ ### Fixed
15
+
16
+ - **`rlimit_nproc` default raised from 200 to 1024.** nproc limits the
17
+ *user's* total process count, not the sandbox's — 200 is easily exceeded
18
+ on a busy dev machine, which made every fork inside a sandboxed command
19
+ fail with `Resource temporarily unavailable` (EAGAIN). 1024 still guards
20
+ against fork bombs without breaking normal use.
21
+
1
22
  ## [0.1.2] - 2026-06-25
2
23
 
3
24
  ### Changed
data/README.md CHANGED
@@ -33,7 +33,7 @@ Ask::Sandbox.provider = Ask::Sandbox::Docker.new(image: "ruby:3.4-alpine", memor
33
33
 
34
34
  | Provider | Isolation | Requirement |
35
35
  |---|---|---|
36
- | `Ask::Sandbox::Local` (default) | Subprocess with rlimits (CPU, memory, processes, file size), temp directory, sanitized environment | None, stdlib only |
36
+ | `Ask::Sandbox::Local` (default) | Subprocess with rlimits (CPU, memory, processes, file size), caller's working directory (or `workdir:`), sanitized environment | None, stdlib only |
37
37
  | `Ask::Sandbox::Docker` | Container with read-only rootfs, no capabilities, no network | Docker daemon |
38
38
  | `Ask::Sandbox::Daytona` | Remote sandbox via the Daytona API | `daytona` gem, API key |
39
39
  | `Ask::Sandbox::Cloudflare` | Cloudflare Workers sandbox via a proxy Worker | Deployed proxy Worker URL |
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "tmpdir"
4
- require "fileutils"
5
-
6
3
  module Ask
7
4
  module Sandbox
8
5
  # Executes commands in a local subprocess with resource limits.
@@ -41,13 +38,10 @@ module Ask
41
38
  argv = build_argv(command)
42
39
  child_env = build_environment(env)
43
40
 
44
- if workdir
45
- execute_in_dir(argv, child_env, workdir, timeout, stdin)
46
- else
47
- Dir.mktmpdir("ask_sandbox") do |dir|
48
- execute_in_dir(argv, child_env, dir, timeout, stdin)
49
- end
50
- end
41
+ # Default to the caller's working directory so shell commands see the
42
+ # files the file tools (Write, Edit, ...) just created — like a real
43
+ # terminal. Pass workdir: to pin a specific directory instead.
44
+ execute_in_dir(argv, child_env, workdir || Dir.pwd, timeout, stdin)
51
45
  end
52
46
 
53
47
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Sandbox
5
- VERSION = "0.1.3"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-sandbox-providers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto