deltabox-lite 0.1.5 → 0.3.0

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 (3) hide show
  1. package/README.md +6 -0
  2. package/index.d.ts +24 -0
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -27,6 +27,12 @@ review calls return protocol-shaped typed objects. Every session record names
27
27
  its `isolation` profile and the resolved `isolation_provider` (`sandlock`,
28
28
  `seatbelt`, or Windows MXC).
29
29
 
30
+ A command has no time limit: it runs until it exits or the host cancels it.
31
+ Pass an `execId` as the last argument of `exec` and call `cancelExec(execId)` to
32
+ end that command's whole process tree, for example on your own deadline or when
33
+ the user aborts. Cancelling retires the warm sandbox runtime, so the next
34
+ command starts it again.
35
+
30
36
  Linux CB-CoW modes require `/dev/fuse` and `fusermount3` or `fusermount` on the
31
37
  host. Deltabox otherwise reports the reason and falls back to `copy-private`
32
38
  unless the requested mode is required.
package/index.d.ts CHANGED
@@ -122,6 +122,13 @@ export interface NativeDeltaboxInstance {
122
122
  requireFilesystemMode?: boolean,
123
123
  ): Promise<NativeSessionInfo>
124
124
  stopSession(sessionId: string): Promise<NativeSessionInfo>
125
+ /**
126
+ * Take ownership of a session whose owner process died (an orphan). Its
127
+ * pending changes are kept; commit or abort them, then stop the session.
128
+ */
129
+ adoptSession(sessionId: string): Promise<NativeSessionInfo>
130
+ /** Running sessions of this project whose owner process died. */
131
+ orphanedSessions(): Promise<string[]>
125
132
  sessionStatus(sessionId: string): Promise<NativeSessionInfo>
126
133
  exec(
127
134
  sessionId: string,
@@ -131,7 +138,24 @@ export interface NativeDeltaboxInstance {
131
138
  label?: string,
132
139
  executionProfile?: NativeExecutionProfile,
133
140
  networkAllow?: string[],
141
+ /**
142
+ * Lets the host end this command with {@link cancelExec}. Must be unique
143
+ * among executions that are still running.
144
+ */
145
+ execId?: string,
134
146
  ): Promise<NativeExecResult>
147
+ /**
148
+ * End the command started by `exec` with this `execId`: its whole process
149
+ * tree is killed. A sandboxed command's `exec` promise then rejects with
150
+ * "command cancelled"; an unsandboxed one resolves with a non-zero result.
151
+ * A cancel that arrives before the command has started is not lost.
152
+ * Returns false when no execution with that id is running.
153
+ *
154
+ * There is no time limit on a command, so hosts that want one should
155
+ * cancel on their own deadline or abort signal. Descendants that move
156
+ * themselves into a new session or process group are not reached.
157
+ */
158
+ cancelExec(execId: string): boolean
135
159
  readFile(sessionId: string, path: string): Promise<Buffer>
136
160
  writeFile(sessionId: string, path: string, content: Buffer): Promise<void>
137
161
  recordFileChanges(sessionId: string, paths: string[]): Promise<void>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deltabox-lite",
3
- "version": "0.1.5",
3
+ "version": "0.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Native sandbox runtime with diff, commit, and abort for AI coding agents",
6
6
  "repository": "https://github.com/delta-box/deltabox-lite",
@@ -24,10 +24,10 @@
24
24
  "README.md"
25
25
  ],
26
26
  "optionalDependencies": {
27
- "deltabox-lite-darwin-arm64": "0.1.5",
28
- "deltabox-lite-darwin-x64": "0.1.5",
29
- "deltabox-lite-linux-arm64": "0.1.5",
30
- "deltabox-lite-linux-x64": "0.1.5",
31
- "deltabox-lite-windows-x64": "0.1.5"
27
+ "deltabox-lite-darwin-arm64": "0.3.0",
28
+ "deltabox-lite-darwin-x64": "0.3.0",
29
+ "deltabox-lite-linux-arm64": "0.3.0",
30
+ "deltabox-lite-linux-x64": "0.3.0",
31
+ "deltabox-lite-windows-x64": "0.3.0"
32
32
  }
33
33
  }