You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update backend references to worker-shell and worker-javascript
Rename WorkerBackend to WorkerShellBackend and IsolateJavaScriptBackend
to WorkerJavaScriptBackend throughout the design docs, along with the
backends/worker-shell and backends/worker-javascript import subpaths and
the worker-shell and worker-javascript selector ids.
Command backends leave `value` unset. `isolate-javascript` uses `value` for the module's structured return value and reports a zero-entry completed sync. A command can complete while its post-command pull fails; in that case `sync.status` is `"pending"`, and a configured `SyncRetryScheduler` can durably retry the pull without rerunning the command.
65
+
Command backends leave `value` unset. `worker-javascript` uses `value` for the module's structured return value and reports a zero-entry completed sync. A command can complete while its post-command pull fails; in that case `sync.status` is `"pending"`, and a configured `SyncRetryScheduler` can durably retry the pull without rerunning the command.
@@ -94,16 +94,16 @@ Command backends continue to use the existing synchronization bracket:
94
94
push → spawn → events/result → pull
95
95
```
96
96
97
-
A backend with `sync: "none"`, such as `isolate-shell`, shares the host store and reports zero push/pull counts. A Container has its own VFS and synchronizes changes before and after command execution. Fully draining either `result()` or the event stream completes the post-command pull before the stream closes.
97
+
A backend with `sync: "none"`, such as `worker-shell`, shares the host store and reports zero push/pull counts. A Container has its own VFS and synchronizes changes before and after command execution. Fully draining either `result()` or the event stream completes the post-command pull before the stream closes.
98
98
99
99
Module backends use host capability calls against the authoritative Workspace and therefore require no push/pull round trip.
100
100
101
101
## Lifecycle differences
102
102
103
103
`container-shell` provides computerd's retained process log, replay, signals, and disposal.
104
104
105
-
`isolate-javascript` provides a Workspace-owned execution journal, retained result/events, host cancellation, and explicit disposal. Active Workers cannot be serialized across host restart; orphaned running records are reconciled to failed.
105
+
`worker-javascript` provides a Workspace-owned execution journal, retained result/events, host cancellation, and explicit disposal. Active Workers cannot be serialized across host restart; orphaned running records are reconciled to failed.
106
106
107
-
`isolate-shell` intentionally preserves one-call, buffered-result behavior in this release. It does not retain executions for later reattachment or disposal. `timeoutMs` and a concurrent `killExec()` for a caller-supplied execution ID cooperatively abort just-bash at statement boundaries; by the time an ordinary `exec()` promise returns, the command has already settled. Use the Container or JavaScript isolate when detached execution and retained lifecycle are required.
107
+
`worker-shell` intentionally preserves one-call, buffered-result behavior in this release. It does not retain executions for later reattachment or disposal. `timeoutMs` and a concurrent `killExec()` for a caller-supplied execution ID cooperatively abort just-bash at statement boundaries; by the time an ordinary `exec()` promise returns, the command has already settled. Use the Container or JavaScript isolate when detached execution and retained lifecycle are required.
108
108
109
109
See [16. Execution runtime architecture](./16_code_execution.md) and [17. Isolate JavaScript](./17_isolate_javascript.md).
Copy file name to clipboardExpand all lines: docs/10_project_layout.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ Runnable examples live at the repo root, not inside any package:
199
199
```
200
200
examples/
201
201
├── container/ # Reference container image for computerd
202
-
├── worker/ # WorkerBackend example
202
+
├── worker-shell/ # WorkerShellBackend example
203
203
├── code/ # workspace.runtime with Worker and Container shells
204
204
└── think/ # @cloudflare/think integration
205
205
```
@@ -210,7 +210,7 @@ so each example can declare its own dependencies and scripts.
210
210
## Testing
211
211
212
212
-**Unit tests live next to source.** Packages follow the `foo.ts` + `foo.test.ts` convention.
213
-
-**Workerd integration tests** for WorkerBackend, Workspace RPC, and `workspace.runtime` live in `packages/computer/tests/` with dedicated Vitest and Wrangler configuration.
213
+
-**Workerd integration tests** for WorkerShellBackend, Workspace RPC, and `workspace.runtime` live in `packages/computer/tests/` with dedicated Vitest and Wrangler configuration.
214
214
-**Container and load harness tests** live in `packages/computer/test-harness/`:
215
215
-`end-to-end.test.ts` — DO ↔ container round-trip
216
216
-`shell.test.ts` — shell surface against a real backend
Applications may register additional command or module backends under their own IDs. Backend IDs are part of the execution contract: changing the backend may change the source language.
23
23
@@ -26,19 +26,19 @@ Applications may register additional command or module backends under their own
Command backends leave `value` unset. Module backends use it for their structured return value.
61
61
62
-
`container-shell` retains the existing computerd process lifecycle. `isolate-javascript` keeps an execution journal in the Workspace database and retains events/results until `disposeExec`. Active isolate cancellation is host-driven by disposing the child Worker. An execution left running across a Workspace host restart is reconciled to failed because a live Worker capability cannot be serialized into SQLite.
62
+
`container-shell` retains the existing computerd process lifecycle. `worker-javascript` keeps an execution journal in the Workspace database and retains events/results until `disposeExec`. Active isolate cancellation is host-driven by disposing the child Worker. An execution left running across a Workspace host restart is reconciled to failed because a live Worker capability cannot be serialized into SQLite.
63
63
64
-
`isolate-shell` intentionally retains its existing behavior in this release: it buffers a just-bash call to completion, does not retain cross-request events, and cannot reattach by ID. Callers that require supervised process behavior should use `container-shell`; callers that require a managed isolate should use `isolate-javascript`.
64
+
`worker-shell` intentionally retains its existing behavior in this release: it buffers a just-bash call to completion, does not retain cross-request events, and cannot reattach by ID. Callers that require supervised process behavior should use `container-shell`; callers that require a managed isolate should use `worker-javascript`.
65
65
66
66
## Backend authority
67
67
@@ -70,14 +70,14 @@ There is no general `workspace.scope()` abstraction. Backend construction fixes
70
70
For different authority levels, configure distinct backend instances:
`import task from "./task.js"; export default task;`,
72
72
{
73
-
backend: "isolate-javascript",
73
+
backend: "worker-javascript",
74
74
cwd: "/workspace",
75
75
input: { value: 42 },
76
76
},
@@ -96,7 +96,7 @@ Host calls have a caller-visible deadline, controlled by `maxHostCallMs` and def
96
96
Bare imports are installed at backend construction, not passed on individual executions:
97
97
98
98
```ts
99
-
newIsolateJavaScriptBackend({
99
+
newWorkerJavaScriptBackend({
100
100
loader: env.LOADER,
101
101
modules: {
102
102
"tar-stream": TAR_STREAM_BUNDLE,
@@ -165,4 +165,4 @@ Console output is bounded but currently buffered in the Dynamic Worker and publi
165
165
166
166
## Trusted integrations
167
167
168
-
A host can configure additional reserved capability modules through `IsolateJavaScriptBackend.trustedModules`; these modules are fixed when the backend is constructed and cannot be supplied or replaced by caller source.
168
+
A host can configure additional reserved capability modules through `WorkerJavaScriptBackend.trustedModules`; these modules are fixed when the backend is constructed and cannot be supplied or replaced by caller source.
`WorkspaceShell` still exists internally to implement command backends. It is not a public Workspace property.
16
16
17
17
## Default backend IDs
18
18
19
19
- Cloudflare Container: `container-shell`
20
-
- just-bash Dynamic Worker: `isolate-shell`
21
-
- ECMAScript Dynamic Worker: `isolate-javascript`
20
+
- just-bash Dynamic Worker: `worker-shell`
21
+
- ECMAScript Dynamic Worker: `worker-javascript`
22
22
23
23
The first configured backend is the default for `runtime.exec()`. Pass `backend` explicitly at security boundaries. Routing is not authorization: trusted gateways must choose from a host-owned allowlist rather than accepting an arbitrary model-supplied backend ID.
24
24
25
25
## Source semantics
26
26
27
-
Command backends interpret the first argument as a shell command and reject structured `input`. `isolate-javascript` interprets it as an ECMAScript module and supports structured JSON-compatible input/results, durable relative modules, `node:fs/promises`, and host-owned trusted modules.
27
+
Command backends interpret the first argument as a shell command and reject structured `input`. `worker-javascript` interprets it as an ECMAScript module and supports structured JSON-compatible input/results, durable relative modules, `node:fs/promises`, and host-owned trusted modules.
28
28
29
29
## Lifecycle differences
30
30
31
-
Container command executions use the remote process journal and push/pull synchronization bracket. `isolate-shell` uses the documented limited one-call Worker lifecycle. `isolate-javascript` stores execution status and events in the Workspace database and supports replay, cancellation, disposal, and restart recovery. Completed filesystem and provider side effects are not rolled back when execution fails or is cancelled.
31
+
Container command executions use the remote process journal and push/pull synchronization bracket. `worker-shell` uses the documented limited one-call Worker lifecycle. `worker-javascript` stores execution status and events in the Workspace database and supports replay, cancellation, disposal, and restart recovery. Completed filesystem and provider side effects are not rolled back when execution fails or is cancelled.
0 commit comments