botmux 3.5.0 → 3.5.2

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 (147) hide show
  1. package/dist/adapters/backend/sandbox.d.ts +99 -279
  2. package/dist/adapters/backend/sandbox.d.ts.map +1 -1
  3. package/dist/adapters/backend/sandbox.js +424 -826
  4. package/dist/adapters/backend/sandbox.js.map +1 -1
  5. package/dist/adapters/cli/codex.d.ts.map +1 -1
  6. package/dist/adapters/cli/codex.js +4 -0
  7. package/dist/adapters/cli/codex.js.map +1 -1
  8. package/dist/adapters/cli/fs-policy.d.ts +244 -0
  9. package/dist/adapters/cli/fs-policy.d.ts.map +1 -0
  10. package/dist/adapters/cli/fs-policy.js +539 -0
  11. package/dist/adapters/cli/fs-policy.js.map +1 -0
  12. package/dist/adapters/cli/read-isolation.d.ts +14 -200
  13. package/dist/adapters/cli/read-isolation.d.ts.map +1 -1
  14. package/dist/adapters/cli/read-isolation.js +18 -477
  15. package/dist/adapters/cli/read-isolation.js.map +1 -1
  16. package/dist/bot-registry.d.ts +26 -23
  17. package/dist/bot-registry.d.ts.map +1 -1
  18. package/dist/bot-registry.js +16 -0
  19. package/dist/bot-registry.js.map +1 -1
  20. package/dist/cli.d.ts.map +1 -1
  21. package/dist/cli.js +25 -18
  22. package/dist/cli.js.map +1 -1
  23. package/dist/core/command-handler.d.ts.map +1 -1
  24. package/dist/core/command-handler.js +16 -58
  25. package/dist/core/command-handler.js.map +1 -1
  26. package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
  27. package/dist/core/dashboard-ipc-server.js +26 -27
  28. package/dist/core/dashboard-ipc-server.js.map +1 -1
  29. package/dist/core/passthrough-commands.d.ts.map +1 -1
  30. package/dist/core/passthrough-commands.js +1 -1
  31. package/dist/core/passthrough-commands.js.map +1 -1
  32. package/dist/core/plugins/mcp/gateway-installer.d.ts.map +1 -1
  33. package/dist/core/plugins/mcp/gateway-installer.js +14 -2
  34. package/dist/core/plugins/mcp/gateway-installer.js.map +1 -1
  35. package/dist/core/session-manager.d.ts.map +1 -1
  36. package/dist/core/session-manager.js +90 -60
  37. package/dist/core/session-manager.js.map +1 -1
  38. package/dist/core/worker-pool.d.ts +24 -0
  39. package/dist/core/worker-pool.d.ts.map +1 -1
  40. package/dist/core/worker-pool.js +50 -6
  41. package/dist/core/worker-pool.js.map +1 -1
  42. package/dist/daemon.d.ts.map +1 -1
  43. package/dist/daemon.js +6 -0
  44. package/dist/daemon.js.map +1 -1
  45. package/dist/dashboard/bot-payload.d.ts +5 -0
  46. package/dist/dashboard/bot-payload.d.ts.map +1 -1
  47. package/dist/dashboard/bot-payload.js +7 -0
  48. package/dist/dashboard/bot-payload.js.map +1 -1
  49. package/dist/dashboard/web/bot-defaults-page.d.ts +16 -0
  50. package/dist/dashboard/web/bot-defaults-page.d.ts.map +1 -1
  51. package/dist/dashboard/web/bot-defaults-page.js +225 -6
  52. package/dist/dashboard/web/bot-defaults-page.js.map +1 -1
  53. package/dist/dashboard/web/bot-defaults.d.ts +7 -0
  54. package/dist/dashboard/web/bot-defaults.d.ts.map +1 -1
  55. package/dist/dashboard/web/bot-defaults.js.map +1 -1
  56. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  57. package/dist/dashboard/web/i18n.js +38 -22
  58. package/dist/dashboard/web/i18n.js.map +1 -1
  59. package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
  60. package/dist/dashboard/web/sessions-page.js +1 -44
  61. package/dist/dashboard/web/sessions-page.js.map +1 -1
  62. package/dist/dashboard-web/app.js +1 -1
  63. package/dist/dashboard-web/chunks/bot-defaults-page-AUKV7P4L.js +10 -0
  64. package/dist/dashboard-web/chunks/{chunk-QCPPKCX3.js → chunk-KPQAUX7V.js} +1 -1
  65. package/dist/dashboard-web/chunks/{chunk-WXPMNEYV.js → chunk-NRL6CVAS.js} +1 -1
  66. package/dist/dashboard-web/chunks/{chunk-EJDYUINZ.js → chunk-R7IAKAYX.js} +1 -1
  67. package/dist/dashboard-web/chunks/{chunk-H7P5UV4W.js → chunk-X2L65IOM.js} +6 -6
  68. package/dist/dashboard-web/chunks/{connectors-page-IR54AOAI.js → connectors-page-HDQFEXZI.js} +1 -1
  69. package/dist/dashboard-web/chunks/{groups-page-3P4TLUMF.js → groups-page-6DKXBYOM.js} +1 -1
  70. package/dist/dashboard-web/chunks/{insights-page-TDCZV56A.js → insights-page-NWARTJ6J.js} +1 -1
  71. package/dist/dashboard-web/chunks/{monitor-room-QWCWL3SX.js → monitor-room-AGX3XRJX.js} +1 -1
  72. package/dist/dashboard-web/chunks/{monitoring-page-IOWFSNVC.js → monitoring-page-GGGIWN4C.js} +1 -1
  73. package/dist/dashboard-web/chunks/{office-page-5AUPEHZP.js → office-page-6SIVKSK3.js} +1 -1
  74. package/dist/dashboard-web/chunks/{overview-page-QJMI6NLW.js → overview-page-FVR3NKAF.js} +1 -1
  75. package/dist/dashboard-web/chunks/{roles-page-WJVB52ET.js → roles-page-WE2YB7KN.js} +1 -1
  76. package/dist/dashboard-web/chunks/{schedules-page-RVRWHP4V.js → schedules-page-TB3I24XN.js} +1 -1
  77. package/dist/dashboard-web/chunks/sessions-page-KOOOASIL.js +2 -0
  78. package/dist/dashboard-web/chunks/{settings-page-TNZEPC7V.js → settings-page-IEBR7TGN.js} +1 -1
  79. package/dist/dashboard-web/chunks/{skills-page-7YT5TIX5.js → skills-page-3QAT2IWD.js} +1 -1
  80. package/dist/dashboard-web/chunks/{team-federation-page-NJZKTU7A.js → team-federation-page-K4VVAVAK.js} +1 -1
  81. package/dist/dashboard-web/chunks/{v3-page-NQ73UA2Q.js → v3-page-V6IOJR2B.js} +1 -1
  82. package/dist/dashboard-web/chunks/{whiteboards-page-DSM3MDMN.js → whiteboards-page-V6CGKRNX.js} +1 -1
  83. package/dist/dashboard-web/style.css +20 -3
  84. package/dist/dashboard.js +86 -1
  85. package/dist/dashboard.js.map +1 -1
  86. package/dist/global-config.d.ts.map +1 -1
  87. package/dist/global-config.js +4 -1
  88. package/dist/global-config.js.map +1 -1
  89. package/dist/i18n/en.d.ts.map +1 -1
  90. package/dist/i18n/en.js +1 -19
  91. package/dist/i18n/en.js.map +1 -1
  92. package/dist/i18n/zh.d.ts.map +1 -1
  93. package/dist/i18n/zh.js +1 -19
  94. package/dist/i18n/zh.js.map +1 -1
  95. package/dist/im/lark/card-builder.d.ts +0 -13
  96. package/dist/im/lark/card-builder.d.ts.map +1 -1
  97. package/dist/im/lark/card-builder.js +0 -34
  98. package/dist/im/lark/card-builder.js.map +1 -1
  99. package/dist/im/lark/card-handler.d.ts.map +1 -1
  100. package/dist/im/lark/card-handler.js +1 -30
  101. package/dist/im/lark/card-handler.js.map +1 -1
  102. package/dist/im/lark/client.d.ts +36 -0
  103. package/dist/im/lark/client.d.ts.map +1 -1
  104. package/dist/im/lark/client.js +80 -0
  105. package/dist/im/lark/client.js.map +1 -1
  106. package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
  107. package/dist/im/lark/event-dispatcher.js +28 -3
  108. package/dist/im/lark/event-dispatcher.js.map +1 -1
  109. package/dist/services/sandbox-migration.d.ts +14 -0
  110. package/dist/services/sandbox-migration.d.ts.map +1 -0
  111. package/dist/services/sandbox-migration.js +85 -0
  112. package/dist/services/sandbox-migration.js.map +1 -0
  113. package/dist/services/sandbox-store.d.ts +28 -0
  114. package/dist/services/sandbox-store.d.ts.map +1 -1
  115. package/dist/services/sandbox-store.js +82 -0
  116. package/dist/services/sandbox-store.js.map +1 -1
  117. package/dist/types.d.ts +13 -1
  118. package/dist/types.d.ts.map +1 -1
  119. package/dist/utils/child-env.d.ts +2 -2
  120. package/dist/utils/child-env.d.ts.map +1 -1
  121. package/dist/utils/child-env.js +14 -0
  122. package/dist/utils/child-env.js.map +1 -1
  123. package/dist/worker.js +417 -498
  124. package/dist/worker.js.map +1 -1
  125. package/dist/workflows/events/payloads.d.ts +56 -0
  126. package/dist/workflows/events/payloads.d.ts.map +1 -1
  127. package/dist/workflows/events/payloads.js +9 -0
  128. package/dist/workflows/events/payloads.js.map +1 -1
  129. package/dist/workflows/events/schema.d.ts +86 -0
  130. package/dist/workflows/events/schema.d.ts.map +1 -1
  131. package/dist/workflows/shared/sandbox-policy.d.ts +10 -1
  132. package/dist/workflows/shared/sandbox-policy.d.ts.map +1 -1
  133. package/dist/workflows/shared/sandbox-policy.js +12 -0
  134. package/dist/workflows/shared/sandbox-policy.js.map +1 -1
  135. package/dist/workflows/v3/bot-resolve.d.ts.map +1 -1
  136. package/dist/workflows/v3/bot-resolve.js +36 -0
  137. package/dist/workflows/v3/bot-resolve.js.map +1 -1
  138. package/dist/workflows/v3/contract.d.ts +8 -0
  139. package/dist/workflows/v3/contract.d.ts.map +1 -1
  140. package/dist/workflows/v3/contract.js.map +1 -1
  141. package/package.json +1 -1
  142. package/dist/dashboard-web/chunks/bot-defaults-page-O376WSER.js +0 -5
  143. package/dist/dashboard-web/chunks/sessions-page-KWLGBX6G.js +0 -3
  144. package/dist/services/sandbox-land.d.ts +0 -45
  145. package/dist/services/sandbox-land.d.ts.map +0 -1
  146. package/dist/services/sandbox-land.js +0 -394
  147. package/dist/services/sandbox-land.js.map +0 -1
@@ -19,7 +19,6 @@
19
19
  * multi-bot cred file; each bot's lark-cli config holds its app secret in
20
20
  * plaintext). See the design doc for the two-layer rationale.
21
21
  */
22
- import { managedOriginCapabilityPath } from '../../core/managed-origin-capability.js';
23
22
  import { DEVICE_AUTHORITY_DIRECTORY, DEVICE_CREDENTIAL_FILE, DEVICE_ENROLLMENT_JOURNAL_FILE, } from '../../platform/device-paths.js';
24
23
  /** Normalize a path for the deny/allow lists: require ABSOLUTE, strip trailing
25
24
  * slashes, reject `..` traversal. Returns null for anything unusable so the
@@ -94,15 +93,11 @@ export function buildCliExecutableReadCarveOuts(input) {
94
93
  return [];
95
94
  return [standaloneRoot];
96
95
  }
97
- /** Root-level host authority files retained for machine binding/back-compat.
98
- * They live outside every per-bot BOT_HOME, so no chat-driven CLI may read or
99
- * rotate them. New device secrets live below DEVICE_AUTHORITY_DIRECTORY and
100
- * are masked by directory, so future filenames/atomic sidecars need no policy
101
- * update. */
96
+ /** Host device-authority files must never be visible to a chat-driven CLI.
97
+ * New credentials live below DEVICE_AUTHORITY_DIRECTORY; the exact legacy
98
+ * files remain covered for upgrades from older layouts. */
102
99
  export const HOST_DEVICE_CREDENTIAL_FILES = [
103
100
  'platform.json',
104
- // Pre-dedicated-directory builds. Keep exact + sidecar policy so an upgrade
105
- // never exposes a legacy credential left at BOTMUX_HOME root.
106
101
  DEVICE_CREDENTIAL_FILE,
107
102
  DEVICE_ENROLLMENT_JOURNAL_FILE,
108
103
  ];
@@ -113,15 +108,12 @@ function hostDeviceAuthorityPaths(root) {
113
108
  ...HOST_DEVICE_CREDENTIAL_FILES.map(file => `${root}/${file}`),
114
109
  ];
115
110
  }
116
- /** Fixed authority marker. It deliberately ignores SESSION_DATA_DIR and every
117
- * child-controlled env value: enrollment writes this under the real user home
118
- * before credentials exist, then workers treat it as a one-way security gate. */
111
+ /** Fixed host marker; deliberately independent of SESSION_DATA_DIR and child env. */
119
112
  export function deviceCredentialIsolationMarkerPath(homeDir) {
120
113
  return `${homeDir.replace(/\/+$/, '')}/.botmux/${DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME}`;
121
114
  }
122
- /** A root entry hidden by credential-only isolation. Prefix matching lets the
123
- * worker include current atomic-write sidecars and legacy backups; arbitrary
124
- * future device files are covered wholesale by DEVICE_AUTHORITY_DIRECTORY. */
115
+ /** Match current atomic-write sidecars and legacy backups as well as the
116
+ * dedicated authority directory. */
125
117
  export function isCredentialIsolationReservedBasename(name) {
126
118
  return name === DEVICE_AUTHORITY_DIRECTORY
127
119
  || name === DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME
@@ -131,12 +123,8 @@ export function isCredentialIsolationReservedBasename(name) {
131
123
  export function credentialIsolationRequired(input) {
132
124
  return input.markerExists || input.deviceCredentialExists;
133
125
  }
134
- /**
135
- * Resolve the mandatory credential boundary independently of optional/full
136
- * read isolation. There is intentionally no adapter capability or bot sandbox
137
- * toggle input: once the marker/device exists, every locally spawned CLI must
138
- * be covered even when `supportsReadIsolation=false` and `sandbox=false`.
139
- */
126
+ /** Mandatory device-credential isolation is independent of the optional bot
127
+ * sandbox toggle: once enrolled, every local child must be confined. */
140
128
  export function evaluateCredentialOnlyIsolationGate(input) {
141
129
  const required = credentialIsolationRequired(input);
142
130
  if (!required)
@@ -163,6 +151,11 @@ export function evaluateCredentialOnlyIsolationGate(input) {
163
151
  }
164
152
  return { required: true, mode: input.platform === 'darwin' ? 'seatbelt' : 'bwrap' };
165
153
  }
154
+ function escapeForRegex(p) {
155
+ return p.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
156
+ }
157
+ /** Legacy credential-only Seatbelt/bwrap rule shape. Full fs-policy sessions
158
+ * consume the same authority paths through buildFsPolicy instead. */
166
159
  export function buildCredentialIsolationRules(ctx) {
167
160
  const h = ctx.homeDir.replace(/\/+$/, '');
168
161
  const bh = ctx.botmuxHome.replace(/\/+$/, '');
@@ -178,423 +171,9 @@ export function buildCredentialIsolationRules(ctx) {
178
171
  denyRegexes: dedupe(denyRegexes),
179
172
  denyWritePaths: dedupe([...credentialPaths, markerPath]),
180
173
  denyWriteRegexes: dedupe(denyRegexes),
181
- // Prevent replacing a credential root symlink/directory to escape the
182
- // canonical path rules. Literal does not deny unrelated descendants.
183
174
  denyWriteLiterals: roots,
184
175
  };
185
176
  }
186
- /** v2 DENY set (HYBRID). The F1 fix is a WHOLE-deny of the CLI data dirs `~/.claude`
187
- * (+ `~/.claude.json`) and `~/.codex`: this bot's OWN CLI data is redirected into its
188
- * BOT_HOME (readable) via CLAUDE_CONFIG_DIR/CODEX_HOME, so whole-denying the globals
189
- * blocks the admin/other/pre-migration data + kills the per-cwd carve-out + /cd hole,
190
- * while own resume/memory keep working from BOT_HOME. `~/.botmux` is NOT whole-denied
191
- * (the agent's botmux CLI needs its config/registry/pm2/data structure) — instead its
192
- * cross-bot-SENSITIVE parts are denied surgically: bots.json, logs, other bots' lark
193
- * configs / session files / send-creds / BOT_HOMEs, and the shared conversation-content
194
- * dirs (frozen-cards, queues, attachments, whiteboards, …). Own BOT_HOME + own
195
- * session/cred + own attachments bucket + config/registry stay readable by default.
196
- * Plus the system-credential stores. Everything else (code/repos/runtime) stays open.
197
- *
198
- * NOTE: per-bot session stores (`sessions-<appId>.json`) are denied by PATTERN — see
199
- * {@link buildV2DenyRegexes} — so no sibling-appId enumeration is needed anywhere. */
200
- export function buildV2DenyPaths(ctx) {
201
- const h = ctx.homeDir.replace(/\/+$/, '');
202
- const bh = ctx.botmuxHome.replace(/\/+$/, '');
203
- const sd = ctx.sessionDataDir.replace(/\/+$/, '');
204
- const defaultBh = (ctx.defaultBotmuxHome ?? `${h}/.botmux`).replace(/\/+$/, '');
205
- return dedupe([
206
- // ── F1: whole-deny the CLI data dirs (own is redirected to BOT_HOME) ──
207
- `${h}/.claude`,
208
- `${h}/.claude.json`,
209
- `${h}/.codex`,
210
- // ── System credential / secret stores (broad, since outside is open by default) ──
211
- `${h}/.ssh`,
212
- `${h}/.aws`,
213
- `${h}/.azure`,
214
- `${h}/.gnupg`,
215
- `${h}/.netrc`,
216
- `${h}/.config/gh`,
217
- `${h}/.config/glab-cli`,
218
- `${h}/.config/gcloud`,
219
- `${h}/.config/op`,
220
- `${h}/.config/1Password`,
221
- `${h}/.1password`,
222
- `${h}/.password-store`,
223
- `${h}/.git-credentials`,
224
- `${h}/.npmrc`,
225
- `${h}/.pypirc`,
226
- `${h}/.docker/config.json`,
227
- `${h}/.kube`,
228
- `${h}/Library/Keychains`,
229
- // ── botmux SENSITIVE (surgical — leave config/registry/pm2/data structure readable) ──
230
- `${bh}/bots.json`, // ALL bots' secrets
231
- `${bh}/logs`, // daemon logs (cross-bot content)
232
- `${h}/.lark-cli`, // default lark config (may hold creds)
233
- // WHOLESALE-deny the per-bot lark config dir (same rationale as bots/ below): a
234
- // newly-added bot is covered without cold-restart, and `ls .lark-cli-bots/` can't
235
- // enumerate siblings. Own is re-allowed via buildV2CarveOuts (+ traverse shim).
236
- `${h}/.lark-cli-bots`,
237
- // WHOLESALE-deny the bots/ dir (every sibling BOT_HOME + their send-cred). Own is
238
- // re-allowed via buildV2CarveOuts (allow subpath own + file-read-metadata traverse
239
- // shim so the CLI can realpath its redirected config). Denying the DIR (not each
240
- // sibling appId) means a NEWLY-ADDED bot is covered WITHOUT cold-restarting this
241
- // one, and `ls bots/` can't enumerate siblings.
242
- `${bh}/bots`,
243
- `${sd}/sessions.json`, // legacy shared store
244
- `${sd}/frozen-cards`, // conversation content (all bots')
245
- `${sd}/turn-sends`, // CLI only APPENDS markers here — read-deny is safe
246
- `${sd}/crash-diagnostics`,
247
- // Long Pi first prompts may contain the full hidden routing/identity
248
- // context. Deny the shared root, then the worker carves back only this
249
- // session's private subdirectory.
250
- `${sd}/pi-initial-prompts`,
251
- // All bots' Feishu-uploaded files. Own per-appId bucket (attachments/<self>/) is
252
- // re-allowed via buildV2CarveOuts; siblings' buckets + the legacy flat
253
- // per-messageId layout stay denied.
254
- `${sd}/attachments`,
255
- // whiteboards/ is deliberately NOT denied (owner decision): whiteboards are
256
- // shared content, meant to be visible across the bots that collaborate on
257
- // them. NOTE the store is currently GLOBAL (no per-chat scoping), so a
258
- // sandboxed bot can `whiteboard list`/`read` boards from other chats too —
259
- // an accepted tradeoff until whiteboards are bucketed by chat/appId. Also
260
- // un-denying the read avoids the read-modify-write clobber a deny would cause.
261
- // Queued inbound messages (queues/<rootMessageId>.jsonl = full LarkMessage
262
- // content for EVERY bot). Daemon-side only — the CLI never reads it.
263
- `${sd}/queues`,
264
- // Seatbelt profiles + reattach markers: filenames/rules enumerate sibling
265
- // session ids and appIds. sandbox-exec parses the profile BEFORE applying it,
266
- // and the markers are read by the daemon — the sandboxed CLI never reads these.
267
- `${sd}/read-isolation`,
268
- // Worker PID markers contain every live session/turn/attempt tuple. They
269
- // are routing metadata, never a credential, and isolated CLIs now use an
270
- // exact per-session capability carve-out for fresh turn context.
271
- `${sd}/.botmux-cli-pids`,
272
- // NOTE: schedules.json is deliberately NOT denied. It's a read-modify-write
273
- // store: denying the read makes a sandboxed `botmux schedule` load an empty
274
- // map and then overwrite the shared file, silently wiping EVERY bot's tasks
275
- // (read-modify-write degraded to write-only). We accept the minor leak
276
- // (isolated bots can read others' scheduled prompts) until schedule-store
277
- // fail-closes on read errors (ENOENT vs EPERM). See PR #387 review.
278
- `${bh}/feishu-session.json`, // Feishu web login session (setup automation) — can mint bots
279
- // Machine + device bearer/refresh credentials belong to the trusted host.
280
- // Deny both the fixed ~/.botmux location used by platform binding and the
281
- // configured BOTMUX_HOME so a custom SESSION_DATA_DIR cannot create a gap.
282
- ...[defaultBh, bh].flatMap(hostDeviceAuthorityPaths),
283
- `${defaultBh}/${DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME}`,
284
- // The dashboard admin credentials. `.dashboard-secret` signs the loopback-HMAC
285
- // that gates `/__cli/rotate` AND the daemon-IPC write-link routes — the ipc-server
286
- // comment (dashboard-ipc-server.ts) explicitly relies on the sandbox hiding it to
287
- // "keep a sandboxed worker from minting write tokens" for sessions it doesn't own
288
- // (a cross-bot escalation reachable by a semi-trusted conversant driving the agent).
289
- // Only owner-facing admin verbs (`botmux dashboard`/`term-link`) sign with it — the
290
- // agent's send/list/status never do, so denying it costs the agent nothing. Its
291
- // sibling `.dashboard-token` (dashboard bearer) is denied for the same reason;
292
- // `.dashboard-port` is just a port number (no credential value) → left readable.
293
- // The dashboard IPC secret/token live at the fixed default home even
294
- // when SESSION_DATA_DIR points at a custom BOTMUX_HOME. Deny both roots:
295
- // the fixed real credential location and the custom runtime root.
296
- `${defaultBh}/.dashboard-secret`,
297
- `${defaultBh}/.dashboard-token`,
298
- `${bh}/.dashboard-secret`,
299
- `${bh}/.dashboard-token`,
300
- // NOTE: extraDenyPaths (readDenyExtraPaths) are NOT here — they go to
301
- // buildV2CarveOuts().finalDenyPaths so they win over the own-BOT_HOME allow.
302
- ]
303
- .map(normalizeIsolationPath)
304
- .filter((p) => !!p));
305
- }
306
- /** Escape a literal path for embedding in a Seatbelt regex filter. */
307
- function escapeForRegex(p) {
308
- return p.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
309
- }
310
- /** v2 PATTERN denies — Seatbelt `regex` filters that deny a whole FILENAME CLASS
311
- * instead of enumerating sibling app ids. Covers:
312
- * - per-bot session stores (`<sd>/sessions-<appId>.json`, routing metadata): a
313
- * newly-added bot's store is denied WITHOUT cold-restarting the ones already
314
- * running, and no caller needs to know the sibling app ids. The bot's OWN store
315
- * is re-allowed by carve-out (Seatbelt last-match).
316
- * - EVERY `bots.json.*` sidecar (`.bak` written by setup/migration, `.tmp`, ad-hoc
317
- * `.bak.<suffix>` copies): the exact `bots.json` is subpath-denied in
318
- * {@link buildV2DenyPaths}, but its backups carry the SAME plaintext
319
- * larkAppSecret for every bot under a DIFFERENT basename, which `subpath` does
320
- * not match — so without this an isolated bot could `cat bots.json.bak` and
321
- * recover all siblings' credentials, defeating the whole isolation. */
322
- export function buildV2DenyRegexes(ctx) {
323
- const sd = ctx.sessionDataDir.replace(/\/+$/, '');
324
- const bh = ctx.botmuxHome.replace(/\/+$/, '');
325
- const h = ctx.homeDir.replace(/\/+$/, '');
326
- const defaultBh = (ctx.defaultBotmuxHome ?? `${h}/.botmux`).replace(/\/+$/, '');
327
- const botmuxRoots = dedupe([defaultBh, bh]);
328
- return dedupe([
329
- `^${escapeForRegex(sd)}/sessions-[^/]+\\.json$`,
330
- // Any `bots.json.` sidecar (backups/temp) — trailing dot so it matches
331
- // bots.json.bak / .tmp / .bak.<suffix> but NOT the exact bots.json (that is
332
- // the subpath deny's job) and NOT an unrelated `bots.jsonx`.
333
- `^${escapeForRegex(bh)}/bots\\.json\\.`,
334
- // LEGACY pre-BOT_HOME send-cred files (`<sd>/.send-cred-<appId>`): current
335
- // builds write send-cred.json inside BOT_HOME, but leftovers from older
336
- // builds still carry live per-bot send credentials at the data root.
337
- `^${escapeForRegex(sd)}/\\.send-cred-`,
338
- // Per-bot user display-name caches (`identities-<appId>.json`): open_id→name
339
- // PII of every bot's interlocutors. The CLI never reads them (daemon-side
340
- // prompt injection only), so the OWN file gets NO carve-out — the whole
341
- // filename class is denied.
342
- `^${escapeForRegex(sd)}/identities-[^/]+\\.json$`,
343
- // Secret/token creation and atomic rotation use sibling temp files. Deny
344
- // the whole basename class at both the fixed and custom roots so a live
345
- // isolated process cannot race-read a fully populated temp inode.
346
- ...botmuxRoots.flatMap(root => [
347
- ...HOST_DEVICE_CREDENTIAL_FILES.map(file => `^${escapeForRegex(root)}/${escapeForRegex(file)}(?:\\.|$)`),
348
- `^${escapeForRegex(root)}/\\.dashboard-secret(?:\\.|$)`,
349
- `^${escapeForRegex(root)}/\\.dashboard-token(?:\\.|$)`,
350
- `^${escapeForRegex(root)}/plugins/[^/]+/private(?:/|$)`,
351
- `^${escapeForRegex(root)}/plugins/[^/]+/dist/mcp/index\\.json$`,
352
- ]),
353
- `^${escapeForRegex(defaultBh)}/${escapeForRegex(DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME)}(?:\\.|$)`,
354
- `^${escapeForRegex(sd)}/sessions/[^/]+/plugin-mcp-runtime\\.json$`,
355
- ]);
356
- }
357
- /** Host-owned authority files that a read-isolated child must not mutate.
358
- * Read isolation otherwise keeps normal write access for backwards
359
- * compatibility, so these rules are emitted after every other write allow. */
360
- export function buildReadIsolationProtectedWriteRules(ctx, extraRoots = {}) {
361
- const h = ctx.homeDir.replace(/\/+$/, '');
362
- const bh = ctx.botmuxHome.replace(/\/+$/, '');
363
- const sd = ctx.sessionDataDir.replace(/\/+$/, '');
364
- const defaultBh = (ctx.defaultBotmuxHome ?? `${h}/.botmux`).replace(/\/+$/, '');
365
- const dashboardRoots = dedupe([
366
- defaultBh,
367
- bh,
368
- ...(extraRoots.dashboardRoots ?? []).map(root => root.replace(/\/+$/, '')),
369
- ]);
370
- const sessionDataDirs = dedupe([
371
- sd,
372
- ...(extraRoots.sessionDataDirs ?? []).map(root => root.replace(/\/+$/, '')),
373
- ]);
374
- return {
375
- denyWritePaths: dedupe([
376
- ...dashboardRoots.flatMap(root => [
377
- `${root}/.dashboard-secret`,
378
- `${root}/.dashboard-token`,
379
- ...hostDeviceAuthorityPaths(root),
380
- ]),
381
- `${defaultBh}/${DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME}`,
382
- ...sessionDataDirs.flatMap(root => [
383
- `${root}/.botmux-cli-pids`,
384
- `${root}/read-isolation`,
385
- ]),
386
- ]),
387
- denyWriteRegexes: dedupe([
388
- ...dashboardRoots.flatMap(root => [
389
- ...HOST_DEVICE_CREDENTIAL_FILES.map(file => `^${escapeForRegex(root)}/${escapeForRegex(file)}(?:\\.|$)`),
390
- `^${escapeForRegex(root)}/\\.dashboard-secret(?:\\.|$)`,
391
- `^${escapeForRegex(root)}/\\.dashboard-token(?:\\.|$)`,
392
- `^${escapeForRegex(root)}/plugins/[^/]+/private(?:/|$)`,
393
- `^${escapeForRegex(root)}/plugins/[^/]+/dist/mcp/index\\.json$`,
394
- ]),
395
- ...sessionDataDirs.map(root => `^${escapeForRegex(root)}/sessions/[^/]+/plugin-mcp-runtime\\.json$`),
396
- `^${escapeForRegex(defaultBh)}/${escapeForRegex(DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME)}(?:\\.|$)`,
397
- ]),
398
- // Prevent replacing an entire authority-bearing root to sidestep the
399
- // exact/regex child rules. `literal` protects only the directory entry;
400
- // ordinary writes to unrelated descendants remain available.
401
- denyWriteLiterals: dedupe([...dashboardRoots, ...sessionDataDirs]),
402
- };
403
- }
404
- /** The v2 Seatbelt carve-outs that accompany {@link buildV2DenyPaths} +
405
- * {@link buildV2DenyRegexes}. They re-open the bot's OWN slice of each denied class:
406
- * - allowPaths: the own BOT_HOME subpath (redirected CLI data + creds + send-cred),
407
- * the own lark-cli config dir, and the own session store file.
408
- * - traverseDirs: `bots/` etc., as file-read-metadata ONLY — lets the CLI realpath()
409
- * its config dir THROUGH the denied parent WITHOUT allowing `ls bots/` (enumeration).
410
- * - finalDenyPaths: admin `readDenyExtraPaths`, emitted AFTER the allows so an admin
411
- * deny UNDER the own BOT_HOME still wins (Seatbelt last-match). */
412
- export function buildV2CarveOuts(ctx) {
413
- const bh = ctx.botmuxHome.replace(/\/+$/, '');
414
- const sd = ctx.sessionDataDir.replace(/\/+$/, '');
415
- const h = ctx.homeDir.replace(/\/+$/, '');
416
- const self = assertSafeAppId(ctx.currentAppId);
417
- return {
418
- // Re-open the bot's OWN slice of each wholesale/pattern-denied per-bot class.
419
- allowPaths: [
420
- botHomePath(bh, self),
421
- `${h}/.lark-cli-bots/${self}`,
422
- // Own routing metadata (`botmux send` reads it to route replies); siblings'
423
- // stay denied by the buildV2DenyRegexes filename pattern.
424
- `${sd}/sessions-${self}.json`,
425
- // Own Feishu-upload bucket (attachments/<appId>/<messageId>/…) — the agent must
426
- // read files the user uploads in chat. getAttachmentsDir keys the bucket on the
427
- // appId precisely so this spawn-time-static carve-out can exist.
428
- `${sd}/attachments/${self}`,
429
- // Parent read-isolation/ stays wholesale-denied; only this session's
430
- // rotating origin capability is visible to the confined CLI.
431
- managedOriginCapabilityPath(sd, ctx.currentSessionId),
432
- ],
433
- // file-read-metadata on the wholesale-denied parents so the CLI/skill can realpath()
434
- // through them WITHOUT `ls` (enumeration) leaking.
435
- traverseDirs: [
436
- `${bh}/bots`, `${h}/.lark-cli-bots`, `${sd}/attachments`, `${sd}/read-isolation`,
437
- ],
438
- finalDenyPaths: (ctx.extraDenyPaths ?? [])
439
- .map(normalizeIsolationPath)
440
- .filter((p) => !!p),
441
- };
442
- }
443
- /**
444
- * Write-isolation rules for the macOS file sandbox — the FUNCTIONAL twin of the
445
- * Linux bwrap overlay (which lets the agent read the whole real FS but confines
446
- * WRITES). Seatbelt has no copy-on-write overlay, so we approximate the same
447
- * guarantee with a deny-all-writes + allow-list: the agent can write its project
448
- * and the ephemeral scratch/cache the CLI needs, but CANNOT tamper the rest of
449
- * your real disk (home dotfiles, other projects, other bots' data, system dirs).
450
- * Reads stay wide open (like Linux) — this is orthogonal to read isolation, which
451
- * layers its own read-deny set into the SAME profile when also enabled.
452
- *
453
- * `allowWritePaths` re-open the writable zones AFTER the profile's `(deny
454
- * file-write* (subpath "/"))`; `denyWritePaths` are crown jewels re-denied AFTER
455
- * the allows (Seatbelt last-match), so they stay protected even if the project or
456
- * an allowed zone nests them. The allow-list is intentionally generous toward
457
- * CLI scratch/cache — the exact set is empirically tuned on real macOS (a missing
458
- * cache path makes the CLI fail, an over-broad one weakens the sandbox). Pure: the
459
- * worker realpath's every path (symlink-safe) before emitting.
460
- */
461
- export function buildWriteSandboxRules(ctx) {
462
- const h = ctx.homeDir.replace(/\/+$/, '');
463
- const bh = ctx.botmuxHome.replace(/\/+$/, '');
464
- const sd = ctx.sessionDataDir.replace(/\/+$/, '');
465
- const defaultBh = (ctx.defaultBotmuxHome ?? `${h}/.botmux`).replace(/\/+$/, '');
466
- const wd = ctx.workingDir.replace(/\/+$/, '');
467
- const keep = (arr) => dedupe(arr.map(normalizeIsolationPath).filter((p) => !!p));
468
- return {
469
- allowWritePaths: keep([
470
- // The project — writes here PERSIST (no overlay/landing step; direct like a
471
- // non-sandboxed run would, only nothing OUTSIDE the allow-list can be touched).
472
- wd,
473
- // Own BOT_HOME — where read isolation redirects the CLI's data when co-enabled;
474
- // harmless to allow when write-sandbox is standalone (dir just won't exist).
475
- botHomePath(bh, ctx.currentAppId),
476
- // CLI data dirs (write-sandbox standalone leaves them at the real path).
477
- `${h}/.claude`, `${h}/.claude.json`, `${h}/.codex`,
478
- // Claude Code's updater/OAuth refresh uses sibling lock directories rather
479
- // than placing every state file under ~/.claude. Without these, a valid
480
- // login can fail to refresh because lock acquisition returns EPERM.
481
- `${h}/.claude.lock`, `${h}/.claude.json.lock`,
482
- `${h}/.local/state/claude`,
483
- // Ephemeral scratch / caches every CLI + spawned tool (git, npm, node) needs.
484
- `${h}/Library/Caches`,
485
- `${h}/Library/Application Support`,
486
- `${h}/.cache`,
487
- `${h}/.npm`,
488
- '/private/var/folders', // macOS per-user TMPDIR / DARWIN_USER_TEMP_DIR root
489
- '/private/tmp', '/tmp', '/var/tmp',
490
- '/dev', // ptys, /dev/null, /dev/tty — required to run at all
491
- ...(ctx.extraWritePaths ?? []),
492
- ]),
493
- allowWriteRegexes: [
494
- // Claude Code saves ~/.claude.json atomically through a PID/random-suffixed
495
- // sibling (e.g. .claude.json.tmp.1234.abcd). A subpath rule for the exact
496
- // state file cannot match those siblings, so allow only that basename class
497
- // at the home root — not arbitrary home dotfiles.
498
- `^${escapeForRegex(h)}/\\.claude\\.json\\.tmp\\.[^/]+$`,
499
- ],
500
- denyWritePaths: keep([
501
- // Crown jewels — re-denied AFTER the allows so a semi-trusted operator can't
502
- // plant an ssh key or tamper another bot's creds even if the project/home
503
- // nests these. (Most already fall under deny-by-default; this is the guard for
504
- // a broad workingDir and defence-in-depth.)
505
- `${h}/.ssh`, `${h}/.aws`, `${h}/.gnupg`,
506
- `${bh}/bots.json`,
507
- `${bh}/feishu-session.json`,
508
- `${defaultBh}/.dashboard-secret`, `${defaultBh}/.dashboard-token`,
509
- `${bh}/.dashboard-secret`, `${bh}/.dashboard-token`,
510
- ...[defaultBh, bh].flatMap(hostDeviceAuthorityPaths),
511
- `${defaultBh}/${DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME}`,
512
- `${sd}/.botmux-cli-pids`, `${sd}/read-isolation`,
513
- ]),
514
- // Atomic credential writes use `<name>.<pid>.<random>.tmp` beside the
515
- // target. Protect the whole basename class so a broad project/home allow
516
- // cannot stage and rename a replacement around the exact-file deny.
517
- denyWriteRegexes: dedupe([defaultBh, bh].flatMap(root => HOST_DEVICE_CREDENTIAL_FILES.map(file => `^${escapeForRegex(root)}/${escapeForRegex(file)}(?:\\.|$)`)).concat(`^${escapeForRegex(defaultBh)}/${escapeForRegex(DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME)}(?:\\.|$)`)),
518
- };
519
- }
520
- /**
521
- * The bwrap MASK set for Linux read isolation — the functional twin of the macOS
522
- * Seatbelt read-deny profile ({@link buildV2DenyPaths} + regexes + carve-outs),
523
- * expressed for bwrap (which blanks paths with tmpfs/empty-binds and has no regex).
524
- *
525
- * SAME cross-bot-sensitive set as macOS, but the per-bot classes (other bots'
526
- * BOT_HOMEs / lark configs / session stores / identities / send-creds / attachment
527
- * buckets) are enumerated PER SIBLING instead of wholesale-denied + regex-matched.
528
- * The read-isolation-specific set does not mask the bot's OWN slice. The file
529
- * sandbox still masks BOTMUX_HOME wholesale as its mandatory credential
530
- * boundary, so `ownReadWritePaths` re-opens only this bot's BOT_HOME after that
531
- * parent mask; the worker separately re-masks send-cred.json.
532
- *
533
- * Pure: the worker resolves the impure inputs (sibling list, sidecar glob, realpath).
534
- * NOTE: keep the `shared` set in lock-step with {@link buildV2DenyPaths} — the
535
- * `read-isolation.test.ts` parity test fails if a sensitive path is added to one
536
- * platform but not the other.
537
- */
538
- export function buildLinuxReadIsolationMasks(input) {
539
- const { ctx } = input;
540
- const h = ctx.homeDir.replace(/\/+$/, '');
541
- const bh = ctx.botmuxHome.replace(/\/+$/, '');
542
- const sd = ctx.sessionDataDir.replace(/\/+$/, '');
543
- const defaultBh = (ctx.defaultBotmuxHome ?? `${h}/.botmux`).replace(/\/+$/, '');
544
- const self = assertSafeAppId(ctx.currentAppId);
545
- const keep = (arr) => dedupe(arr.map(normalizeIsolationPath).filter((p) => !!p));
546
- // Cross-bot-sensitive paths handled WHOLESALE (not per-bot, OR a per-bot dir with
547
- // a non-enumerable layout) — MUST mirror the same entries in buildV2DenyPaths.
548
- const shared = [
549
- `${h}/.claude`, `${h}/.claude.json`, `${h}/.codex`,
550
- `${h}/.ssh`, `${h}/.aws`, `${h}/.azure`, `${h}/.gnupg`, `${h}/.netrc`,
551
- `${h}/.config/gh`, `${h}/.config/glab-cli`, `${h}/.config/gcloud`, `${h}/.config/op`,
552
- `${h}/.config/1Password`, `${h}/.1password`, `${h}/.password-store`,
553
- `${h}/.git-credentials`, `${h}/.npmrc`, `${h}/.pypirc`, `${h}/.docker/config.json`, `${h}/.kube`,
554
- `${h}/Library/Keychains`,
555
- `${bh}/bots.json`, `${bh}/logs`, `${h}/.lark-cli`,
556
- `${bh}/feishu-session.json`,
557
- `${defaultBh}/.dashboard-secret`, `${defaultBh}/.dashboard-token`,
558
- `${bh}/.dashboard-secret`, `${bh}/.dashboard-token`,
559
- ...[defaultBh, bh].flatMap(hostDeviceAuthorityPaths),
560
- `${defaultBh}/${DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME}`,
561
- `${sd}/sessions.json`, `${sd}/frozen-cards`, `${sd}/turn-sends`,
562
- `${sd}/crash-diagnostics`, `${sd}/queues`, `${sd}/read-isolation`,
563
- `${sd}/pi-initial-prompts`,
564
- `${sd}/.botmux-cli-pids`,
565
- // attachments/ is masked WHOLESALE (like macOS) — covers every sibling bucket
566
- // AND the legacy flat per-messageId layout (which per-sibling enumeration can't
567
- // reach); the OWN bucket is re-exposed read-only via ownReadOnlyPaths below.
568
- `${sd}/attachments`,
569
- // schedules.json + whiteboards deliberately NOT masked (same owner decision as
570
- // macOS: RMW-clobber / shared content).
571
- ];
572
- // Per-sibling enumeration for the classes macOS covers by REGEX (bwrap has none):
573
- // other bots' BOT_HOMEs, lark configs, session stores, identities, send-creds. Own
574
- // BOT_HOME + lark + session stay UNMASKED by this per-bot set (the outer file
575
- // sandbox still masks BOTMUX_HOME wholesale and re-opens only own BOT_HOME).
576
- // identities/send-cred get NO own carve-out — the
577
- // CLI never reads them (daemon-side) — so the own ones are masked too.
578
- const perBot = [];
579
- for (const raw of input.siblingAppIds) {
580
- let sib;
581
- try {
582
- sib = assertSafeAppId(raw);
583
- }
584
- catch {
585
- continue;
586
- }
587
- if (sib === self)
588
- continue;
589
- perBot.push(`${bh}/bots/${sib}`, `${h}/.lark-cli-bots/${sib}`, `${sd}/sessions-${sib}.json`, `${sd}/identities-${sib}.json`, `${sd}/.send-cred-${sib}`);
590
- }
591
- perBot.push(`${sd}/identities-${self}.json`, `${sd}/.send-cred-${self}`);
592
- return {
593
- hidePaths: keep([...shared, ...perBot, ...(input.botsJsonSidecars ?? [])]),
594
- ownReadWritePaths: keep([botHomePath(bh, self)]),
595
- ownReadOnlyPaths: keep([`${sd}/attachments/${self}`]),
596
- };
597
- }
598
177
  /**
599
178
  * Decide whether read isolation is enabled for a session, or fail-closed.
600
179
  * Pure: the caller resolves the impure inputs. This is the SINGLE decision
@@ -618,55 +197,22 @@ export function evaluateReadIsolationGate(opts) {
618
197
  return { enabled: false, failClosedReason: 'missing SESSION_DATA_DIR' };
619
198
  return { enabled: true };
620
199
  }
621
- /**
622
- * macOS Seatbelt (sandbox-exec) profile for the whole-process isolation wrapper.
623
- * Blocklist: allow everything, deny reads of the sensitive paths/patterns, THEN
624
- * re-allow the carve-outs — `subpath` covers a file or a whole subtree. Rule ORDER
625
- * matters: Seatbelt applies the LAST matching rule, so an allow listed AFTER a
626
- * broader deny re-opens that subpath, and the final denies win over the allows.
627
- * Verified: reads of denied paths fail EPERM; carved-out subpaths read normally; the
628
- * wrapped CLI (which bypasses its OWN sandbox — nested Seatbelt would hang) runs fine.
629
- */
630
- export function buildSeatbeltProfile(denyPaths, allowPaths = [], finalDenyPaths = [], traverseDirs = [], denyRegexes = [],
631
- /** When set, layer the macOS file-sandbox WRITE isolation (Linux-bwrap twin) into
632
- * the SAME profile: deny all writes, re-allow the writable zones, then final-deny
633
- * the crown jewels. Reads are unaffected. Omit for read-isolation-only sessions. */
634
- writeSandbox,
635
- /** Host-owned files that must remain immutable even for legacy read-only
636
- * isolation (where writes are otherwise unrestricted). Emitted last so they
637
- * also win over a broad write-sandbox allow. */
638
- protectedWrites) {
200
+ /** Legacy allow-default profile retained only for mandatory credential-only
201
+ * confinement when the full fs-policy sandbox is disabled. */
202
+ export function buildSeatbeltProfile(denyPaths, allowPaths = [], finalDenyPaths = [], traverseDirs = [], denyRegexes = [], writeSandbox, protectedWrites) {
639
203
  const esc = (p) => p.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
640
- // Regex literals (#"…") pass backslashes RAW to the regex engine — do NOT
641
- // double-escape them. A `"` would terminate the literal; swap it for `.`
642
- // (single-char wildcard that still matches the quote) instead of breaking syntax.
643
204
  const escRe = (r) => r.replace(/"/g, '.');
644
205
  const lines = ['(version 1)', '(allow default)'];
645
206
  for (const p of denyPaths)
646
207
  lines.push(`(deny file-read* (subpath "${esc(p)}"))`);
647
- // Filename-pattern denies (e.g. every bot's sessions-<appId>.json) — no sibling
648
- // enumeration; the own file is re-opened by an allow below (last-match).
649
208
  for (const r of denyRegexes)
650
209
  lines.push(`(deny file-read* (regex #"${escRe(r)}"))`);
651
- // Traversal metadata-allows: a carve-out under a DENIED parent (e.g. BOT_HOME under
652
- // ~/.botmux) is reachable for a plain open (Seatbelt matches the final path), but a
653
- // realpath()/stat of an INTERMEDIATE dir is denied — which crashes CLIs that
654
- // canonicalize their config dir (Codex: "failed to canonicalize CODEX_HOME"). Allow
655
- // read-METADATA (stat/traverse) on those specific ancestor DIRS only (literal, not
656
- // subpath) — dir LISTING (read-data) stays denied, so no enumeration leak.
657
210
  for (const p of traverseDirs)
658
211
  lines.push(`(allow file-read-metadata (literal "${esc(p)}"))`);
659
- // Carve-outs override the broad denies above (Seatbelt applies the LAST match).
660
212
  for (const p of allowPaths)
661
213
  lines.push(`(allow file-read* (subpath "${esc(p)}"))`);
662
- // FINAL denies win over the carve-outs — admin `readDenyExtraPaths` must hold even
663
- // for a path that falls under the bot's own re-allowed BOT_HOME.
664
214
  for (const p of finalDenyPaths)
665
215
  lines.push(`(deny file-read* (subpath "${esc(p)}"))`);
666
- // ── Write isolation (macOS file sandbox): deny ALL writes, re-allow the writable
667
- // zones, then re-deny the crown jewels. Ordered AFTER the read rules but they are
668
- // an independent operation class (file-write* vs file-read*), so they never
669
- // interact with the read allow/deny above. Emitted only when write-sandbox is on.
670
216
  if (writeSandbox) {
671
217
  lines.push('(deny file-write* (subpath "/"))');
672
218
  for (const p of writeSandbox.allowWritePaths)
@@ -689,12 +235,8 @@ protectedWrites) {
689
235
  }
690
236
  return lines.join('\n') + '\n';
691
237
  }
692
- // Version 7 records the exact confinement capabilities attached to a live
693
- // process. A credential-only pane is safe to reattach while the bot remains in
694
- // credential-only mode, but must cold-spawn if full read/write isolation is
695
- // enabled later. A version alone cannot express that strengthening transition.
696
- // Version 6 was intentionally skipped to avoid colliding with an experimental
697
- // marker layout that briefly shipped in intermediate device-isolation branches.
238
+ // A marker records which confinement capabilities are attached to the live
239
+ // process. Credential-only panes must cold-spawn when a full sandbox is enabled.
698
240
  export const ISOLATION_PANE_MARKER_VERSION = 7;
699
241
  const ALL_ISOLATION_CAPABILITIES = [
700
242
  'credential',
@@ -705,7 +247,6 @@ function normalizeIsolationCapabilities(capabilities) {
705
247
  const requested = new Set(capabilities);
706
248
  return ALL_ISOLATION_CAPABILITIES.filter(capability => requested.has(capability));
707
249
  }
708
- /** Versioned marker written beside a freshly spawned persistent sandbox. */
709
250
  export function isolationPaneMarkerContent(bootId, capabilities) {
710
251
  return JSON.stringify({
711
252
  version: ISOLATION_PANE_MARKER_VERSION,
@@ -1 +1 @@
1
- {"version":3,"file":"read-isolation.js","sourceRoot":"","sources":["../../../src/adapters/cli/read-isolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AAExC;;;8EAG8E;AAC9E,MAAM,UAAU,sBAAsB,CAAC,CAAS;IAC9C,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAChC,IAAI,CAAC,CAAC,CAAC,UAAU,CA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