@kokorolx/ai-sandbox-wrapper 1.0.0 → 1.1.1
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/README.md +63 -4
- package/bin/cli.js +0 -0
- package/package.json +2 -1
- package/setup.sh +23 -6
package/README.md
CHANGED
|
@@ -293,6 +293,41 @@ export DOCKER_HOST=unix:///var/run/docker.sock
|
|
|
293
293
|
export DOCKER_HOST=tcp://localhost:2375
|
|
294
294
|
```
|
|
295
295
|
|
|
296
|
+
#### Port Exposure
|
|
297
|
+
Expose container ports to the host for web development, APIs, and dev servers:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
# Expose a single port (localhost only - secure default)
|
|
301
|
+
PORT=3000 ai-run opencode
|
|
302
|
+
|
|
303
|
+
# Expose multiple ports
|
|
304
|
+
PORT=3000,5555,5556,5557 ai-run opencode
|
|
305
|
+
|
|
306
|
+
# Expose to network (use with caution)
|
|
307
|
+
PORT=3000 PORT_BIND=all ai-run opencode
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
| Variable | Values | Default | Description |
|
|
311
|
+
|----------|--------|---------|-------------|
|
|
312
|
+
| `PORT` | Comma-separated ports | (none) | Ports to expose (e.g., `3000,5555`) |
|
|
313
|
+
| `PORT_BIND` | `localhost`, `all` | `localhost` | Bind to localhost only or all interfaces |
|
|
314
|
+
|
|
315
|
+
**Security Notes:**
|
|
316
|
+
- Default binding is `127.0.0.1` (localhost only) - only accessible from your machine
|
|
317
|
+
- Using `PORT_BIND=all` exposes ports to your network - a warning is displayed
|
|
318
|
+
- Invalid port numbers (outside 1-65535) are skipped with a warning
|
|
319
|
+
|
|
320
|
+
**Example: Rails Development**
|
|
321
|
+
```bash
|
|
322
|
+
# Start container with Rails default port exposed
|
|
323
|
+
PORT=3000 ai-run opencode --shell
|
|
324
|
+
|
|
325
|
+
# Inside container, start Rails server
|
|
326
|
+
rails server -b 0.0.0.0
|
|
327
|
+
|
|
328
|
+
# Access from host browser at http://localhost:3000
|
|
329
|
+
```
|
|
330
|
+
|
|
296
331
|
#### API Keys
|
|
297
332
|
Configure in `~/.ai-env`:
|
|
298
333
|
|
|
@@ -353,7 +388,9 @@ Each tool's config is mounted to `/home/agent/` inside the container.
|
|
|
353
388
|
|
|
354
389
|
### Additional Tools (Container-Only)
|
|
355
390
|
|
|
356
|
-
During setup, you can optionally install additional tools into the base Docker image:
|
|
391
|
+
During setup, you can optionally install additional tools into the base Docker image. Tools are organized into two categories:
|
|
392
|
+
|
|
393
|
+
#### AI Enhancement Tools
|
|
357
394
|
|
|
358
395
|
| Tool | Description | Size Impact |
|
|
359
396
|
|------|-------------|-------------|
|
|
@@ -362,22 +399,44 @@ During setup, you can optionally install additional tools into the base Docker i
|
|
|
362
399
|
| openspec | OpenSpec - spec-driven development | ~20MB |
|
|
363
400
|
| playwright | Browser automation with Chromium/Firefox/WebKit | ~500MB |
|
|
364
401
|
|
|
365
|
-
**Always Installed (for LSP support):**
|
|
366
|
-
- `typescript` + `typescript-language-server` - Required for AI coding assistants with LSP integration
|
|
367
|
-
|
|
368
402
|
**Playwright** is useful when AI tools need to:
|
|
369
403
|
- Run browser-based tests
|
|
370
404
|
- Scrape web content
|
|
371
405
|
- Verify UI changes
|
|
372
406
|
- Automate browser workflows
|
|
373
407
|
|
|
408
|
+
#### Language Runtimes
|
|
409
|
+
|
|
410
|
+
| Runtime | Description | Size Impact |
|
|
411
|
+
|---------|-------------|-------------|
|
|
412
|
+
| ruby | Ruby 3.3.0 + Rails 8.0.2 (via rbenv) | ~500MB |
|
|
413
|
+
|
|
414
|
+
**Ruby/Rails** is useful when:
|
|
415
|
+
- Developing Ruby on Rails applications
|
|
416
|
+
- Running Rails generators and migrations
|
|
417
|
+
- Using Bundler for dependency management
|
|
418
|
+
- Building Ruby-based APIs and web apps
|
|
419
|
+
|
|
420
|
+
#### Always Installed
|
|
421
|
+
|
|
422
|
+
- `typescript` + `typescript-language-server` - Required for AI coding assistants with LSP integration
|
|
423
|
+
|
|
424
|
+
#### Manual Installation
|
|
425
|
+
|
|
374
426
|
```bash
|
|
375
427
|
# Manual build with Playwright (if not selected during setup)
|
|
376
428
|
INSTALL_PLAYWRIGHT=1 bash lib/install-base.sh
|
|
377
429
|
|
|
430
|
+
# Manual build with Ruby/Rails (if not selected during setup)
|
|
431
|
+
INSTALL_RUBY=1 bash lib/install-base.sh
|
|
432
|
+
|
|
378
433
|
# Verify Playwright in container
|
|
379
434
|
docker run --rm ai-base:latest npx playwright --version
|
|
380
435
|
|
|
436
|
+
# Verify Ruby/Rails in container
|
|
437
|
+
docker run --rm ai-base:latest ruby --version
|
|
438
|
+
docker run --rm ai-base:latest rails --version
|
|
439
|
+
|
|
381
440
|
# Verify TypeScript LSP
|
|
382
441
|
docker run --rm ai-base:latest tsc --version
|
|
383
442
|
```
|
package/bin/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kokorolx/ai-sandbox-wrapper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Docker-based security sandbox for AI coding agents. Isolate Claude, Gemini, Aider, and other AI tools from your host system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"author": "kokorolx",
|
|
26
26
|
"bin": {
|
|
27
|
+
"@kokorolx/ai-sandbox-wrapper": "./bin/cli.js",
|
|
27
28
|
"ai-sandbox-wrapper": "./bin/cli.js"
|
|
28
29
|
},
|
|
29
30
|
"files": [
|
package/setup.sh
CHANGED
|
@@ -315,15 +315,32 @@ done
|
|
|
315
315
|
|
|
316
316
|
echo ""
|
|
317
317
|
if [[ ${#CONTAINERIZED_TOOLS[@]} -gt 0 ]]; then
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
# Category 1: AI Enhancement Tools (spec-driven development, UI/UX, browser automation)
|
|
319
|
+
AI_TOOL_OPTIONS="spec-kit,ux-ui-promax,openspec,playwright"
|
|
320
|
+
AI_TOOL_DESCS="Spec-driven development toolkit,UI/UX design intelligence tool,OpenSpec - spec-driven development,Browser automation + Chromium/Firefox/WebKit (~500MB)"
|
|
320
321
|
|
|
321
|
-
multi_select "Select
|
|
322
|
-
|
|
322
|
+
multi_select "Select AI Enhancement Tools (installed in containers)" "$AI_TOOL_OPTIONS" "$AI_TOOL_DESCS"
|
|
323
|
+
AI_ENHANCEMENT_TOOLS=("${SELECTED_ITEMS[@]}")
|
|
323
324
|
|
|
324
|
-
if [[ ${#
|
|
325
|
-
echo "
|
|
325
|
+
if [[ ${#AI_ENHANCEMENT_TOOLS[@]} -gt 0 ]]; then
|
|
326
|
+
echo "AI tools selected: ${AI_ENHANCEMENT_TOOLS[*]}"
|
|
326
327
|
fi
|
|
328
|
+
|
|
329
|
+
echo ""
|
|
330
|
+
|
|
331
|
+
# Category 2: Language Runtimes (Ruby, etc.)
|
|
332
|
+
LANG_OPTIONS="ruby"
|
|
333
|
+
LANG_DESCS="Ruby 3.3.0 + Rails 8.0.2 via rbenv (~500MB)"
|
|
334
|
+
|
|
335
|
+
multi_select "Select Additional Language Runtimes (installed in containers)" "$LANG_OPTIONS" "$LANG_DESCS"
|
|
336
|
+
LANGUAGE_RUNTIMES=("${SELECTED_ITEMS[@]}")
|
|
337
|
+
|
|
338
|
+
if [[ ${#LANGUAGE_RUNTIMES[@]} -gt 0 ]]; then
|
|
339
|
+
echo "Language runtimes selected: ${LANGUAGE_RUNTIMES[*]}"
|
|
340
|
+
fi
|
|
341
|
+
|
|
342
|
+
# Combine both categories for processing
|
|
343
|
+
ADDITIONAL_TOOLS=("${AI_ENHANCEMENT_TOOLS[@]}" "${LANGUAGE_RUNTIMES[@]}")
|
|
327
344
|
else
|
|
328
345
|
ADDITIONAL_TOOLS=()
|
|
329
346
|
echo "ℹ️ No containerized AI tools selected. Skipping additional tools."
|