@kokorolx/ai-sandbox-wrapper 3.0.5 → 3.0.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.
package/bin/ai-run CHANGED
@@ -783,12 +783,15 @@ if [[ -d "$HOST_SKILLS_DIR" ]]; then
783
783
  SHARED_CACHE_MOUNTS="$SHARED_CACHE_MOUNTS -v $HOST_SKILLS_DIR:/home/agent/.config/opencode/skills:ro"
784
784
  fi
785
785
 
786
- # Nano-brain read-only mount
787
- # Exposes logs/index/sqlite files to container while preventing writes
786
+ # Nano-brain mount: data/index read-only, logs + memory writable
787
+ # Parent :ro protects index/sqlite/config from container writes
788
+ # Sub-mount :rw on logs/ allows CLI logging (appendFileSync in logger.ts)
789
+ # Sub-mount :rw on memory/ allows CLI write command (npx nano-brain write)
788
790
  NANO_BRAIN_MOUNT=""
789
791
  if [[ -d "$HOME/.nano-brain" ]]; then
790
- NANO_BRAIN_MOUNT="-v $HOME/.nano-brain:/home/agent/.nano-brain:ro"
791
- echo "ℹ️ Mounted .nano-brain as read-only at /home/agent/.nano-brain"
792
+ mkdir -p "$HOME/.nano-brain/logs" "$HOME/.nano-brain/memory"
793
+ NANO_BRAIN_MOUNT="-v $HOME/.nano-brain:/home/agent/.nano-brain:ro -v $HOME/.nano-brain/logs:/home/agent/.nano-brain/logs:rw -v $HOME/.nano-brain/memory:/home/agent/.nano-brain/memory:rw"
794
+ echo "ℹ️ Mounted .nano-brain (ro) with logs/ + memory/ overlay (rw)"
792
795
  fi
793
796
 
794
797
 
@@ -1036,8 +1039,8 @@ show_network_menu() {
1036
1039
  if [[ "$key" == $'\x1b' ]]; then
1037
1040
  read -rsn2 -t 1 escape_seq
1038
1041
  case "$escape_seq" in
1039
- '[A') ((cursor > 0)) && ((cursor--)) ;;
1040
- '[B') ((cursor < ${#all_nets[@]} - 1)) && ((cursor++)) ;;
1042
+ '[A') ((cursor > 0)) && ((cursor--)) || true ;;
1043
+ '[B') ((cursor < ${#all_nets[@]} - 1)) && ((cursor++)) || true ;;
1041
1044
  esac
1042
1045
  else
1043
1046
  case "$key" in
@@ -1083,8 +1086,8 @@ show_network_menu() {
1083
1086
  ''|$'\n'|$'\r')
1084
1087
  break
1085
1088
  ;;
1086
- k) ((cursor > 0)) && ((cursor--)) ;;
1087
- j) ((cursor < ${#all_nets[@]} - 1)) && ((cursor++)) ;;
1089
+ k) ((cursor > 0)) && ((cursor--)) || true ;;
1090
+ j) ((cursor < ${#all_nets[@]} - 1)) && ((cursor++)) || true ;;
1088
1091
  esac
1089
1092
  fi
1090
1093
  done
@@ -1139,14 +1142,14 @@ show_save_prompt() {
1139
1142
  if [[ "$key" == $'\x1b' ]]; then
1140
1143
  read -rsn2 -t 1 escape_seq
1141
1144
  case "$escape_seq" in
1142
- '[A') ((cursor > 0)) && ((cursor--)) ;;
1143
- '[B') ((cursor < 2)) && ((cursor++)) ;;
1145
+ '[A') ((cursor > 0)) && ((cursor--)) || true ;;
1146
+ '[B') ((cursor < 2)) && ((cursor++)) || true ;;
1144
1147
  esac
1145
1148
  else
1146
1149
  case "$key" in
1147
1150
  ''|$'\n'|$'\r') break ;;
1148
- k) ((cursor > 0)) && ((cursor--)) ;;
1149
- j) ((cursor < 2)) && ((cursor++)) ;;
1151
+ k) ((cursor > 0)) && ((cursor--)) || true ;;
1152
+ j) ((cursor < 2)) && ((cursor++)) || true ;;
1150
1153
  esac
1151
1154
  fi
1152
1155
  done
@@ -86,11 +86,10 @@ RUN mkdir -p /opt/playwright-browsers && \
86
86
  npx playwright-core install --no-shell chromium && \
87
87
  npx playwright-core install-deps chromium && \
88
88
  chmod -R 777 /opt/playwright-browsers && \
89
- ln -sf $(ls -d /opt/playwright-browsers/chromium-*/chrome-linux/chrome | head -1) /opt/chromium
89
+ ln -sf $(ls -d /opt/playwright-browsers/chromium-*/chrome-linux/chrome | sort -V | tail -1) /opt/chromium
90
90
  ENV CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1
91
91
  RUN npm install -g chrome-devtools-mcp@latest && \
92
92
  touch /opt/.mcp-chrome-devtools-installed
93
- RUN touch /opt/.mcp-playwright-installed
94
93
 
95
94
  # Create workspace
96
95
  WORKDIR /workspace
@@ -86,11 +86,10 @@ RUN mkdir -p /opt/playwright-browsers && \
86
86
  npx playwright-core install --no-shell chromium && \
87
87
  npx playwright-core install-deps chromium && \
88
88
  chmod -R 777 /opt/playwright-browsers && \
89
- ln -sf $(ls -d /opt/playwright-browsers/chromium-*/chrome-linux/chrome | head -1) /opt/chromium
89
+ ln -sf $(ls -d /opt/playwright-browsers/chromium-*/chrome-linux/chrome | sort -V | tail -1) /opt/chromium
90
90
  ENV CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS=1
91
91
  RUN npm install -g chrome-devtools-mcp@latest && \
92
92
  touch /opt/.mcp-chrome-devtools-installed
93
- RUN touch /opt/.mcp-playwright-installed
94
93
 
95
94
  # Create workspace
96
95
  WORKDIR /workspace
@@ -101,34 +100,12 @@ RUN useradd -m -u ${AGENT_UID} -d /home/agent agent && \
101
100
  chown -R agent:agent /home/agent/.cache /home/agent/.npm /home/agent/.opencode /home/agent/.config /workspace && \
102
101
  ([ -d /opt/playwright-browsers ] && chown -R agent:agent /opt/playwright-browsers || true)
103
102
 
104
- # === amp ===
105
- USER root
106
- RUN mkdir -p /usr/local/lib/amp && \
107
- cd /usr/local/lib/amp && \
108
- bun init -y && \
109
- bun add @sourcegraph/amp && \
110
- ln -s /usr/local/lib/amp/node_modules/.bin/amp /usr/local/bin/amp
111
-
112
103
  # === opencode ===
113
104
  USER root
114
105
  RUN curl -fsSL https://opencode.ai/install | bash && \
115
106
  mv /root/.opencode/bin/opencode /usr/local/bin/opencode && \
116
107
  rm -rf /root/.opencode
117
108
 
118
- # === claude ===
119
- USER root
120
- RUN apt-get update && apt-get install -y --no-install-recommends tmux && rm -rf /var/lib/apt/lists/*
121
- RUN npm install -g @kaitranntt/ccs --ignore-scripts && \
122
- mkdir -p /home/agent/.ccs && \
123
- chown -R agent:agent /home/agent/.ccs && \
124
- which ccs && ccs --version && \
125
- sed -i 's/fs\.symlinkSync(sourcePath, targetPath, symlinkType)/fs\.symlinkSync(require("path").relative(require("path").dirname(targetPath), sourcePath), targetPath, symlinkType)/g' /usr/local/lib/node_modules/@kaitranntt/ccs/dist/utils/claude-symlink-manager.js
126
- RUN export HOME=/root && curl -fsSL https://claude.ai/install.sh | bash && \
127
- mkdir -p /usr/local/share && \
128
- mv /root/.local/share/claude /usr/local/share/claude && \
129
- ln -sf /usr/local/share/claude/versions/$(ls /usr/local/share/claude/versions | head -1) /usr/local/bin/claude
130
- USER agent
131
-
132
109
  USER agent
133
110
  ENV HOME=/home/agent
134
111
  CMD ["bash"]
@@ -127,10 +127,10 @@ select_ssh_keys() {
127
127
  read -rsn1 -t 1 next2
128
128
  case "$next1$next2" in
129
129
  '[A') # Up arrow
130
- ((cursor--))
130
+ ((cursor--)) || true
131
131
  ;;
132
132
  '[B') # Down arrow
133
- ((cursor++))
133
+ ((cursor++)) || true
134
134
  ;;
135
135
  esac
136
136
  # Handle regular keys
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokorolx/ai-sandbox-wrapper",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
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",
package/setup.sh CHANGED
@@ -63,13 +63,13 @@ multi_select() {
63
63
  read -rsn1 -t 1 next1
64
64
  read -rsn1 -t 1 next2
65
65
  case "$next1$next2" in
66
- '[A') ((cursor--)) ;; # Up
67
- '[B') ((cursor++)) ;; # Down
66
+ '[A') ((cursor--)) || true ;; # Up
67
+ '[B') ((cursor++)) || true ;; # Down
68
68
  esac
69
69
  else
70
70
  case "$key" in
71
- k) ((cursor--)) ;; # k for Up
72
- j) ((cursor++)) ;; # j for Down
71
+ k) ((cursor--)) || true ;; # k for Up
72
+ j) ((cursor++)) || true ;; # j for Down
73
73
  " ") # Space (toggle)
74
74
  if [ "${selected[$cursor]}" -eq 1 ]; then
75
75
  selected[$cursor]=0
@@ -137,13 +137,13 @@ single_select() {
137
137
  read -rsn1 -t 1 next1
138
138
  read -rsn1 -t 1 next2
139
139
  case "$next1$next2" in
140
- '[A') ((cursor--)) ;;
141
- '[B') ((cursor++)) ;;
140
+ '[A') ((cursor--)) || true ;;
141
+ '[B') ((cursor++)) || true ;;
142
142
  esac
143
143
  else
144
144
  case "$key" in
145
- k) ((cursor--)) ;;
146
- j) ((cursor++)) ;;
145
+ k) ((cursor--)) || true ;;
146
+ j) ((cursor++)) || true ;;
147
147
  "") break ;;
148
148
  $'\n'|$'\r') break ;;
149
149
  esac