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
@@ -60,42 +60,15 @@ export declare function buildCliExecutableReadCarveOuts(input: {
60
60
  cliId: string;
61
61
  resolvedBin: string;
62
62
  }): string[];
63
- export interface V2IsolationContext {
64
- /** The bot user's home directory. */
65
- homeDir: string;
66
- /** BOTMUX_HOME root (e.g. `~/.botmux`). NOT denied wholesale — the botmux CLI the
67
- * agent runs (`botmux send`/`list`/`status`) needs broad read access to it (config,
68
- * daemon registry, pm2, session store). Only its cross-bot-SENSITIVE parts are denied. */
69
- botmuxHome: string;
70
- /** Canonical fixed `~/.botmux` root when it differs from botmuxHome (custom
71
- * SESSION_DATA_DIR or a symlinked default root). */
72
- defaultBotmuxHome?: string;
73
- /** botmux session data root (SESSION_DATA_DIR, e.g. `~/.botmux/data`). */
74
- sessionDataDir: string;
75
- /** This bot's Feishu app id. All carve-outs are keyed on it (immutable, never the
76
- * user-controllable cwd) — sibling data needs NO enumeration: per-bot dirs are
77
- * denied WHOLESALE and per-bot session files by a filename-pattern regex. */
78
- currentAppId: string;
79
- /** Current botmux session. Used only to carve back the exact rotating IPC
80
- * capability file from the otherwise denied read-isolation runtime dir. */
81
- currentSessionId: string;
82
- /** Per-bot extra deny paths (BotConfig.readDenyExtraPaths). */
83
- extraDenyPaths?: string[];
84
- }
85
- /** Root-level host authority files retained for machine binding/back-compat.
86
- * They live outside every per-bot BOT_HOME, so no chat-driven CLI may read or
87
- * rotate them. New device secrets live below DEVICE_AUTHORITY_DIRECTORY and
88
- * are masked by directory, so future filenames/atomic sidecars need no policy
89
- * update. */
63
+ /** Host device-authority files must never be visible to a chat-driven CLI.
64
+ * New credentials live below DEVICE_AUTHORITY_DIRECTORY; the exact legacy
65
+ * files remain covered for upgrades from older layouts. */
90
66
  export declare const HOST_DEVICE_CREDENTIAL_FILES: readonly ["platform.json", "device.json", "device-enroll-pending.json"];
91
67
  export declare const DEVICE_CREDENTIAL_ISOLATION_MARKER_BASENAME = ".device-credential-isolation";
92
- /** Fixed authority marker. It deliberately ignores SESSION_DATA_DIR and every
93
- * child-controlled env value: enrollment writes this under the real user home
94
- * before credentials exist, then workers treat it as a one-way security gate. */
68
+ /** Fixed host marker; deliberately independent of SESSION_DATA_DIR and child env. */
95
69
  export declare function deviceCredentialIsolationMarkerPath(homeDir: string): string;
96
- /** A root entry hidden by credential-only isolation. Prefix matching lets the
97
- * worker include current atomic-write sidecars and legacy backups; arbitrary
98
- * future device files are covered wholesale by DEVICE_AUTHORITY_DIRECTORY. */
70
+ /** Match current atomic-write sidecars and legacy backups as well as the
71
+ * dedicated authority directory. */
99
72
  export declare function isCredentialIsolationReservedBasename(name: string): boolean;
100
73
  export declare function credentialIsolationRequired(input: {
101
74
  markerExists: boolean;
@@ -118,19 +91,14 @@ export type CredentialOnlyIsolationGate = {
118
91
  mode: 'blocked';
119
92
  failClosedReason: string;
120
93
  };
121
- /**
122
- * Resolve the mandatory credential boundary independently of optional/full
123
- * read isolation. There is intentionally no adapter capability or bot sandbox
124
- * toggle input: once the marker/device exists, every locally spawned CLI must
125
- * be covered even when `supportsReadIsolation=false` and `sandbox=false`.
126
- */
94
+ /** Mandatory device-credential isolation is independent of the optional bot
95
+ * sandbox toggle: once enrolled, every local child must be confined. */
127
96
  export declare function evaluateCredentialOnlyIsolationGate(input: {
128
97
  markerExists: boolean;
129
98
  deviceCredentialExists: boolean;
130
99
  remoteBackend: boolean;
131
100
  platform: string;
132
101
  mechanismAvailable: boolean;
133
- /** An already-selected Seatbelt/full-bwrap profile will include this policy. */
134
102
  fullIsolationCoversCredentials: boolean;
135
103
  }): CredentialOnlyIsolationGate;
136
104
  export interface CredentialIsolationContext {
@@ -138,6 +106,8 @@ export interface CredentialIsolationContext {
138
106
  botmuxHome: string;
139
107
  defaultBotmuxHome?: string;
140
108
  }
109
+ /** Legacy credential-only Seatbelt/bwrap rule shape. Full fs-policy sessions
110
+ * consume the same authority paths through buildFsPolicy instead. */
141
111
  export declare function buildCredentialIsolationRules(ctx: CredentialIsolationContext): {
142
112
  roots: string[];
143
113
  denyPaths: string[];
@@ -146,146 +116,6 @@ export declare function buildCredentialIsolationRules(ctx: CredentialIsolationCo
146
116
  denyWriteRegexes: string[];
147
117
  denyWriteLiterals: string[];
148
118
  };
149
- /** v2 DENY set (HYBRID). The F1 fix is a WHOLE-deny of the CLI data dirs `~/.claude`
150
- * (+ `~/.claude.json`) and `~/.codex`: this bot's OWN CLI data is redirected into its
151
- * BOT_HOME (readable) via CLAUDE_CONFIG_DIR/CODEX_HOME, so whole-denying the globals
152
- * blocks the admin/other/pre-migration data + kills the per-cwd carve-out + /cd hole,
153
- * while own resume/memory keep working from BOT_HOME. `~/.botmux` is NOT whole-denied
154
- * (the agent's botmux CLI needs its config/registry/pm2/data structure) — instead its
155
- * cross-bot-SENSITIVE parts are denied surgically: bots.json, logs, other bots' lark
156
- * configs / session files / send-creds / BOT_HOMEs, and the shared conversation-content
157
- * dirs (frozen-cards, queues, attachments, whiteboards, …). Own BOT_HOME + own
158
- * session/cred + own attachments bucket + config/registry stay readable by default.
159
- * Plus the system-credential stores. Everything else (code/repos/runtime) stays open.
160
- *
161
- * NOTE: per-bot session stores (`sessions-<appId>.json`) are denied by PATTERN — see
162
- * {@link buildV2DenyRegexes} — so no sibling-appId enumeration is needed anywhere. */
163
- export declare function buildV2DenyPaths(ctx: V2IsolationContext): string[];
164
- /** v2 PATTERN denies — Seatbelt `regex` filters that deny a whole FILENAME CLASS
165
- * instead of enumerating sibling app ids. Covers:
166
- * - per-bot session stores (`<sd>/sessions-<appId>.json`, routing metadata): a
167
- * newly-added bot's store is denied WITHOUT cold-restarting the ones already
168
- * running, and no caller needs to know the sibling app ids. The bot's OWN store
169
- * is re-allowed by carve-out (Seatbelt last-match).
170
- * - EVERY `bots.json.*` sidecar (`.bak` written by setup/migration, `.tmp`, ad-hoc
171
- * `.bak.<suffix>` copies): the exact `bots.json` is subpath-denied in
172
- * {@link buildV2DenyPaths}, but its backups carry the SAME plaintext
173
- * larkAppSecret for every bot under a DIFFERENT basename, which `subpath` does
174
- * not match — so without this an isolated bot could `cat bots.json.bak` and
175
- * recover all siblings' credentials, defeating the whole isolation. */
176
- export declare function buildV2DenyRegexes(ctx: V2IsolationContext): string[];
177
- /** Host-owned authority files that a read-isolated child must not mutate.
178
- * Read isolation otherwise keeps normal write access for backwards
179
- * compatibility, so these rules are emitted after every other write allow. */
180
- export declare function buildReadIsolationProtectedWriteRules(ctx: V2IsolationContext, extraRoots?: {
181
- dashboardRoots?: string[];
182
- sessionDataDirs?: string[];
183
- }): {
184
- denyWritePaths: string[];
185
- denyWriteRegexes: string[];
186
- denyWriteLiterals: string[];
187
- };
188
- /** The v2 Seatbelt carve-outs that accompany {@link buildV2DenyPaths} +
189
- * {@link buildV2DenyRegexes}. They re-open the bot's OWN slice of each denied class:
190
- * - allowPaths: the own BOT_HOME subpath (redirected CLI data + creds + send-cred),
191
- * the own lark-cli config dir, and the own session store file.
192
- * - traverseDirs: `bots/` etc., as file-read-metadata ONLY — lets the CLI realpath()
193
- * its config dir THROUGH the denied parent WITHOUT allowing `ls bots/` (enumeration).
194
- * - finalDenyPaths: admin `readDenyExtraPaths`, emitted AFTER the allows so an admin
195
- * deny UNDER the own BOT_HOME still wins (Seatbelt last-match). */
196
- export declare function buildV2CarveOuts(ctx: V2IsolationContext): {
197
- allowPaths: string[];
198
- traverseDirs: string[];
199
- finalDenyPaths: string[];
200
- };
201
- export interface WriteSandboxContext {
202
- /** The bot user's home directory. */
203
- homeDir: string;
204
- /** BOTMUX_HOME root (e.g. `~/.botmux`). */
205
- botmuxHome: string;
206
- /** Canonical fixed `~/.botmux` root when it differs from botmuxHome. */
207
- defaultBotmuxHome?: string;
208
- /** botmux session data root (SESSION_DATA_DIR, e.g. `~/.botmux/data`). */
209
- sessionDataDir: string;
210
- /** The session's project working dir — writes here PERSIST (the point of the sandbox). */
211
- workingDir: string;
212
- /** This bot's Feishu app id (keys its own BOT_HOME carve-out). */
213
- currentAppId: string;
214
- /** Extra writable roots the worker resolves at spawn time (realpath'd TMPDIR,
215
- * extra worktrees, admin-configured writable paths). */
216
- extraWritePaths?: string[];
217
- }
218
- /**
219
- * Write-isolation rules for the macOS file sandbox — the FUNCTIONAL twin of the
220
- * Linux bwrap overlay (which lets the agent read the whole real FS but confines
221
- * WRITES). Seatbelt has no copy-on-write overlay, so we approximate the same
222
- * guarantee with a deny-all-writes + allow-list: the agent can write its project
223
- * and the ephemeral scratch/cache the CLI needs, but CANNOT tamper the rest of
224
- * your real disk (home dotfiles, other projects, other bots' data, system dirs).
225
- * Reads stay wide open (like Linux) — this is orthogonal to read isolation, which
226
- * layers its own read-deny set into the SAME profile when also enabled.
227
- *
228
- * `allowWritePaths` re-open the writable zones AFTER the profile's `(deny
229
- * file-write* (subpath "/"))`; `denyWritePaths` are crown jewels re-denied AFTER
230
- * the allows (Seatbelt last-match), so they stay protected even if the project or
231
- * an allowed zone nests them. The allow-list is intentionally generous toward
232
- * CLI scratch/cache — the exact set is empirically tuned on real macOS (a missing
233
- * cache path makes the CLI fail, an over-broad one weakens the sandbox). Pure: the
234
- * worker realpath's every path (symlink-safe) before emitting.
235
- */
236
- export declare function buildWriteSandboxRules(ctx: WriteSandboxContext): {
237
- allowWritePaths: string[];
238
- allowWriteRegexes: string[];
239
- denyWritePaths: string[];
240
- denyWriteRegexes: string[];
241
- };
242
- export interface LinuxReadIsolationInput {
243
- ctx: V2IsolationContext;
244
- /** Every OTHER bot's appId — the worker enumerates these from the registry.
245
- * bwrap has NO regex (unlike the macOS Seatbelt profile), so each sibling's
246
- * per-bot paths are masked INDIVIDUALLY. Consequence: the mask set is
247
- * spawn-time-static — a bot added AFTER this session spawned isn't covered
248
- * until a cold restart (the macOS regex covers new bots without one). */
249
- siblingAppIds: string[];
250
- /** Existing `bots.json.*` sidecars (backups/tmp) globbed by the worker at spawn
251
- * — each carries every bot's plaintext secret under a dynamic name that no
252
- * wholesale rule matches, so they're masked individually. */
253
- botsJsonSidecars?: string[];
254
- }
255
- /**
256
- * The bwrap MASK set for Linux read isolation — the functional twin of the macOS
257
- * Seatbelt read-deny profile ({@link buildV2DenyPaths} + regexes + carve-outs),
258
- * expressed for bwrap (which blanks paths with tmpfs/empty-binds and has no regex).
259
- *
260
- * SAME cross-bot-sensitive set as macOS, but the per-bot classes (other bots'
261
- * BOT_HOMEs / lark configs / session stores / identities / send-creds / attachment
262
- * buckets) are enumerated PER SIBLING instead of wholesale-denied + regex-matched.
263
- * The read-isolation-specific set does not mask the bot's OWN slice. The file
264
- * sandbox still masks BOTMUX_HOME wholesale as its mandatory credential
265
- * boundary, so `ownReadWritePaths` re-opens only this bot's BOT_HOME after that
266
- * parent mask; the worker separately re-masks send-cred.json.
267
- *
268
- * Pure: the worker resolves the impure inputs (sibling list, sidecar glob, realpath).
269
- * NOTE: keep the `shared` set in lock-step with {@link buildV2DenyPaths} — the
270
- * `read-isolation.test.ts` parity test fails if a sensitive path is added to one
271
- * platform but not the other.
272
- */
273
- export declare function buildLinuxReadIsolationMasks(input: LinuxReadIsolationInput): {
274
- /** Paths to blank inside bwrap (prepareSandbox stat-classifies: dir→tmpfs,
275
- * file→empty ro-bind; a missing ancestor of another mask is treated as a
276
- * directory so nested mounts remain valid). Feed as prepareSandbox.hidePaths. */
277
- hidePaths: string[];
278
- /** The bot's OWN BOT_HOME — bound REAL + writable (feed as
279
- * prepareSandbox.trustedWritablePaths) so the
280
- * redirected CLI data (CLAUDE_CONFIG_DIR/CODEX_HOME) persists and escapes the
281
- * write overlay after the mandatory BOTMUX_HOME mask. */
282
- ownReadWritePaths: string[];
283
- /** The bot's OWN slices that sit UNDER a wholesale-masked parent and must be
284
- * re-exposed read-only AFTER the masks (feed as readonlyRoots — bound after the
285
- * tmpfs masks). Currently the own attachments bucket, under the wholesale
286
- * `data/attachments` mask. Read-only is enough (the agent only READS uploads). */
287
- ownReadOnlyPaths: string[];
288
- };
289
119
  /**
290
120
  * Decide whether read isolation is enabled for a session, or fail-closed.
291
121
  * Pure: the caller resolves the impure inputs. This is the SINGLE decision
@@ -311,36 +141,20 @@ export declare function evaluateReadIsolationGate(opts: {
311
141
  enabled: boolean;
312
142
  failClosedReason?: string;
313
143
  };
314
- /**
315
- * macOS Seatbelt (sandbox-exec) profile for the whole-process isolation wrapper.
316
- * Blocklist: allow everything, deny reads of the sensitive paths/patterns, THEN
317
- * re-allow the carve-outs — `subpath` covers a file or a whole subtree. Rule ORDER
318
- * matters: Seatbelt applies the LAST matching rule, so an allow listed AFTER a
319
- * broader deny re-opens that subpath, and the final denies win over the allows.
320
- * Verified: reads of denied paths fail EPERM; carved-out subpaths read normally; the
321
- * wrapped CLI (which bypasses its OWN sandbox — nested Seatbelt would hang) runs fine.
322
- */
323
- export declare function buildSeatbeltProfile(denyPaths: string[], allowPaths?: string[], finalDenyPaths?: string[], traverseDirs?: string[], denyRegexes?: string[],
324
- /** When set, layer the macOS file-sandbox WRITE isolation (Linux-bwrap twin) into
325
- * the SAME profile: deny all writes, re-allow the writable zones, then final-deny
326
- * the crown jewels. Reads are unaffected. Omit for read-isolation-only sessions. */
327
- writeSandbox?: {
144
+ /** Legacy allow-default profile retained only for mandatory credential-only
145
+ * confinement when the full fs-policy sandbox is disabled. */
146
+ export declare function buildSeatbeltProfile(denyPaths: string[], allowPaths?: string[], finalDenyPaths?: string[], traverseDirs?: string[], denyRegexes?: string[], writeSandbox?: {
328
147
  allowWritePaths: string[];
329
148
  allowWriteRegexes?: string[];
330
149
  denyWritePaths: string[];
331
150
  denyWriteRegexes?: string[];
332
- },
333
- /** Host-owned files that must remain immutable even for legacy read-only
334
- * isolation (where writes are otherwise unrestricted). Emitted last so they
335
- * also win over a broad write-sandbox allow. */
336
- protectedWrites?: {
151
+ }, protectedWrites?: {
337
152
  denyWritePaths: string[];
338
153
  denyWriteRegexes?: string[];
339
154
  denyWriteLiterals?: string[];
340
155
  }): string;
341
156
  export declare const ISOLATION_PANE_MARKER_VERSION = 7;
342
157
  export type IsolationCapability = 'credential' | 'read' | 'write';
343
- /** Versioned marker written beside a freshly spawned persistent sandbox. */
344
158
  export declare function isolationPaneMarkerContent(bootId: string, capabilities: readonly IsolationCapability[]): string;
345
159
  /**
346
160
  * Decide whether a live persistent pane (tmux/zellij/herdr) may be reattached for
@@ -1 +1 @@
1
- {"version":3,"file":"read-isolation.d.ts","sourceRoot":"","sources":["../../../src/adapters/cli/read-isolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AASH;;;8EAG8E;AAC9E,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM/D;AAED;;;;;;;;;;;;;wBAawB;AACxB,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG9E;AAOD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED;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