@nimbus-sh/worker 0.10.0 → 0.11.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.
- package/NOTICE.md +5 -0
- package/README.md +10 -0
- package/dist/_shared/session-router.d.ts +7 -0
- package/dist/_shared/session-router.d.ts.map +1 -1
- package/dist/_shared/session-router.js +7 -0
- package/dist/bindings/body.d.ts +6 -0
- package/dist/bindings/body.d.ts.map +1 -0
- package/dist/bindings/body.js +37 -0
- package/dist/bindings/kv.d.ts +0 -2
- package/dist/bindings/kv.d.ts.map +1 -1
- package/dist/bindings/kv.js +3 -42
- package/dist/bindings/r2.d.ts +0 -2
- package/dist/bindings/r2.d.ts.map +1 -1
- package/dist/bindings/r2.js +4 -44
- package/dist/esbuild-cli-artifact.generated.d.ts +18 -0
- package/dist/esbuild-cli-artifact.generated.d.ts.map +1 -0
- package/dist/esbuild-cli-artifact.generated.js +17 -0
- package/dist/facets/cirrus-real.d.ts.map +1 -1
- package/dist/facets/cirrus-real.js +9 -4
- package/dist/facets/compose.d.ts +11 -7
- package/dist/facets/compose.d.ts.map +1 -1
- package/dist/facets/compose.js +8 -38
- package/dist/facets/data-plan.d.ts +79 -0
- package/dist/facets/data-plan.d.ts.map +1 -0
- package/dist/facets/data-plan.js +477 -0
- package/dist/facets/esbuild-transform.d.ts +36 -10
- package/dist/facets/esbuild-transform.d.ts.map +1 -1
- package/dist/facets/esbuild-transform.js +216 -20
- package/dist/facets/exec-telemetry.d.ts +7 -3
- package/dist/facets/exec-telemetry.d.ts.map +1 -1
- package/dist/facets/manager.d.ts +179 -78
- package/dist/facets/manager.d.ts.map +1 -1
- package/dist/facets/manager.js +1221 -649
- package/dist/facets/opencode-staging.d.ts +0 -2
- package/dist/facets/opencode-staging.d.ts.map +1 -1
- package/dist/facets/opencode-staging.js +5 -11
- package/dist/facets/process.d.ts +4 -0
- package/dist/facets/process.d.ts.map +1 -1
- package/dist/facets/process.js +3 -0
- package/dist/facets/read-profile.d.ts +149 -0
- package/dist/facets/read-profile.d.ts.map +1 -0
- package/dist/facets/read-profile.js +483 -0
- package/dist/facets/resident-identity.d.ts +0 -1
- package/dist/facets/resident-identity.d.ts.map +1 -1
- package/dist/facets/resident-identity.js +0 -3
- package/dist/facets/wasm-swap-registry.d.ts +34 -25
- package/dist/facets/wasm-swap-registry.d.ts.map +1 -1
- package/dist/facets/wasm-swap-registry.js +62 -56
- package/dist/facets/ws-terminal.d.ts +4 -4
- package/dist/facets/ws-terminal.d.ts.map +1 -1
- package/dist/facets/ws-terminal.js +4 -5
- package/dist/git/commands.d.ts +16 -9
- package/dist/git/commands.d.ts.map +1 -1
- package/dist/git/commands.js +1818 -188
- package/dist/git/network-facet.d.ts +10 -2
- package/dist/git/network-facet.d.ts.map +1 -1
- package/dist/git/network-facet.js +62 -16
- package/dist/git/unified-diff.d.ts +74 -0
- package/dist/git/unified-diff.d.ts.map +1 -0
- package/dist/git/unified-diff.js +676 -0
- package/dist/git-bundle.generated.d.ts +7 -11
- package/dist/git-bundle.generated.d.ts.map +1 -1
- package/dist/git-bundle.generated.js +7 -11
- package/dist/hosted/commands.d.ts.map +1 -1
- package/dist/hosted/commands.js +62 -243
- package/dist/hosted/runtime.d.ts +19 -13
- package/dist/hosted/runtime.d.ts.map +1 -1
- package/dist/hosted/runtime.js +71 -14
- package/dist/hosted/services.d.ts +6 -7
- package/dist/hosted/services.d.ts.map +1 -1
- package/dist/hosted/services.js +10 -14
- package/dist/hosted/session.d.ts +165 -0
- package/dist/hosted/session.d.ts.map +1 -0
- package/dist/hosted/session.js +132 -0
- package/dist/loaders/generated-workers.d.ts +5 -2
- package/dist/loaders/generated-workers.d.ts.map +1 -1
- package/dist/loaders/generated-workers.js +6 -3
- package/dist/loaders/npm-resolve-preamble.d.ts.map +1 -1
- package/dist/loaders/npm-resolve-preamble.js +0 -27
- package/dist/node-shims-artifact.generated.d.ts +13 -4
- package/dist/node-shims-artifact.generated.d.ts.map +1 -1
- package/dist/node-shims-artifact.generated.js +16 -7
- package/dist/npm/bin-links.d.ts +3 -1
- package/dist/npm/bin-links.d.ts.map +1 -1
- package/dist/npm/bin-links.js +32 -8
- package/dist/npm/cache.d.ts +5 -0
- package/dist/npm/cache.d.ts.map +1 -1
- package/dist/npm/cache.js +13 -1
- package/dist/npm/install-batch-facet.d.ts +2 -2
- package/dist/npm/install-batch-facet.js +3 -3
- package/dist/npm/installer.d.ts +17 -1
- package/dist/npm/installer.d.ts.map +1 -1
- package/dist/npm/installer.js +159 -20
- package/dist/npm/package-lock.d.ts +32 -0
- package/dist/npm/package-lock.d.ts.map +1 -0
- package/dist/npm/package-lock.js +65 -0
- package/dist/npm/pre-bundle-facet.d.ts +1 -30
- package/dist/npm/pre-bundle-facet.d.ts.map +1 -1
- package/dist/npm/pre-bundle-facet.js +3 -5
- package/dist/npm/r2-cache.d.ts +2 -0
- package/dist/npm/r2-cache.d.ts.map +1 -1
- package/dist/npm/r2-cache.js +2 -0
- package/dist/npm/resolve-one-facet.d.ts.map +1 -1
- package/dist/npm/resolve-one-facet.js +14 -3
- package/dist/npm/resolver.d.ts +0 -7
- package/dist/npm/resolver.d.ts.map +1 -1
- package/dist/npm/resolver.js +0 -22
- package/dist/opencode-artifact.generated.js +2 -2
- package/dist/replica/routing.d.ts +2 -38
- package/dist/replica/routing.d.ts.map +1 -1
- package/dist/replica/routing.js +3 -55
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +15 -2
- package/dist/router/public-directory.d.ts +18 -0
- package/dist/router/public-directory.d.ts.map +1 -1
- package/dist/router/public-directory.js +1 -1
- package/dist/router/remote-api.d.ts +3 -1
- package/dist/router/remote-api.d.ts.map +1 -1
- package/dist/router/remote-api.js +42 -79
- package/dist/runtime/bash-repl.js +2 -2
- package/dist/runtime/bun-repl.d.ts.map +1 -1
- package/dist/runtime/bun-repl.js +2 -13
- package/dist/runtime/esbuild-wasm-bytes.d.ts +17 -5
- package/dist/runtime/esbuild-wasm-bytes.d.ts.map +1 -1
- package/dist/runtime/esbuild-wasm-bytes.js +43 -94
- package/dist/runtime/git-bundle-artifact.d.ts +17 -0
- package/dist/runtime/git-bundle-artifact.d.ts.map +1 -0
- package/dist/runtime/git-bundle-artifact.js +25 -0
- package/dist/runtime/node-repl.d.ts.map +1 -1
- package/dist/runtime/node-repl.js +2 -13
- package/dist/runtime/node-shims-artifact.d.ts +22 -23
- package/dist/runtime/node-shims-artifact.d.ts.map +1 -1
- package/dist/runtime/node-shims-artifact.js +48 -78
- package/dist/runtime/node-shims.d.ts.map +1 -1
- package/dist/runtime/node-shims.js +1567 -864
- package/dist/runtime/opencode-artifact.d.ts.map +1 -1
- package/dist/runtime/opencode-artifact.js +17 -53
- package/dist/runtime/opencode-facet-runner.d.ts +3 -6
- package/dist/runtime/opencode-facet-runner.d.ts.map +1 -1
- package/dist/runtime/opencode-facet-runner.js +45 -10
- package/dist/runtime/opentui-wasm-bytes.d.ts.map +1 -1
- package/dist/runtime/opentui-wasm-bytes.js +16 -49
- package/dist/runtime/package-manager.d.ts +0 -2
- package/dist/runtime/package-manager.d.ts.map +1 -1
- package/dist/runtime/package-manager.js +0 -3
- package/dist/runtime/python-repl.d.ts.map +1 -1
- package/dist/runtime/python-repl.js +2 -2
- package/dist/runtime/repl-session.d.ts +10 -0
- package/dist/runtime/repl-session.d.ts.map +1 -1
- package/dist/runtime/repl-session.js +7 -0
- package/dist/runtime/ruby-repl.d.ts.map +1 -1
- package/dist/runtime/ruby-repl.js +2 -2
- package/dist/runtime/ruby-resident.d.ts.map +1 -1
- package/dist/runtime/ruby-resident.js +36 -35
- package/dist/runtime/runtime-catalog.d.ts +10 -3
- package/dist/runtime/runtime-catalog.d.ts.map +1 -1
- package/dist/runtime/runtime-catalog.js +125 -15
- package/dist/runtime/sqlite-wasm-bytes.d.ts +4 -4
- package/dist/runtime/sqlite-wasm-bytes.d.ts.map +1 -1
- package/dist/runtime/sqlite-wasm-bytes.js +21 -57
- package/dist/runtime/staged-source.d.ts +67 -0
- package/dist/runtime/staged-source.d.ts.map +1 -0
- package/dist/runtime/staged-source.js +113 -0
- package/dist/runtime/wasi/preamble.d.ts.map +1 -1
- package/dist/runtime/wasi/preamble.js +0 -24
- package/dist/runtime-catalog.generated.js +1 -1
- package/dist/session/agent.d.ts +14 -2
- package/dist/session/agent.d.ts.map +1 -1
- package/dist/session/agent.js +57 -19
- package/dist/session/ai.d.ts +0 -11
- package/dist/session/ai.d.ts.map +1 -1
- package/dist/session/ai.js +0 -4
- package/dist/session/fs-watch.d.ts +0 -11
- package/dist/session/fs-watch.d.ts.map +1 -1
- package/dist/session/fs-watch.js +0 -21
- package/dist/session/hibernation.d.ts +34 -11
- package/dist/session/hibernation.d.ts.map +1 -1
- package/dist/session/hibernation.js +46 -29
- package/dist/session/init-phases.d.ts +1 -2
- package/dist/session/init-phases.d.ts.map +1 -1
- package/dist/session/init-phases.js +1 -2
- package/dist/session/init.d.ts.map +1 -1
- package/dist/session/init.js +7 -20
- package/dist/session/keys.d.ts +0 -3
- package/dist/session/keys.d.ts.map +1 -1
- package/dist/session/keys.js +0 -3
- package/dist/session/legacy-reset.d.ts +11 -0
- package/dist/session/legacy-reset.d.ts.map +1 -0
- package/dist/session/legacy-reset.js +16 -0
- package/dist/session/nimbus-session.d.ts +41 -15
- package/dist/session/nimbus-session.d.ts.map +1 -1
- package/dist/session/nimbus-session.js +64 -70
- package/dist/session/npm-install-port.d.ts.map +1 -1
- package/dist/session/npm-install-port.js +1 -0
- package/dist/session/programmatic.d.ts +13 -18
- package/dist/session/programmatic.d.ts.map +1 -1
- package/dist/session/programmatic.js +53 -39
- package/dist/session/replica-routes.d.ts +2 -3
- package/dist/session/replica-routes.d.ts.map +1 -1
- package/dist/session/replica-routes.js +3 -10
- package/dist/session/routes.d.ts.map +1 -1
- package/dist/session/routes.js +7 -10
- package/dist/session/rpc.d.ts +104 -20
- package/dist/session/rpc.d.ts.map +1 -1
- package/dist/session/rpc.js +184 -37
- package/dist/session/start-real-vite.js +2 -2
- package/dist/session/state-store.d.ts +1 -17
- package/dist/session/state-store.d.ts.map +1 -1
- package/dist/session/state-store.js +3 -53
- package/dist/session/supervisor-op.d.ts +7 -0
- package/dist/session/supervisor-op.d.ts.map +1 -1
- package/dist/session/supervisor-op.js +6 -1
- package/dist/session/supervisor-rpc.d.ts +104 -15
- package/dist/session/supervisor-rpc.d.ts.map +1 -1
- package/dist/session/supervisor-rpc.js +188 -71
- package/dist/session/vite-command.d.ts.map +1 -1
- package/dist/session/vite-command.js +17 -14
- package/dist/session/ws.d.ts.map +1 -1
- package/dist/session/ws.js +20 -8
- package/dist/shell/npm-bin-entrypoints.d.ts.map +1 -1
- package/dist/shell/npm-bin-entrypoints.js +30 -5
- package/dist/vfs/facet-resident-limits.d.ts +33 -0
- package/dist/vfs/facet-resident-limits.d.ts.map +1 -0
- package/dist/vfs/facet-resident-limits.js +33 -0
- package/dist/vfs/facet-resident-store.d.ts +2 -10
- package/dist/vfs/facet-resident-store.d.ts.map +1 -1
- package/dist/vfs/facet-resident-store.js +1594 -219
- package/dist/workspace-host.d.ts +2 -0
- package/dist/workspace-host.d.ts.map +1 -1
- package/dist/workspace-host.js +2 -0
- package/dist/wrangler/nimbus-wrangler.d.ts +0 -2
- package/dist/wrangler/nimbus-wrangler.d.ts.map +1 -1
- package/dist/wrangler/nimbus-wrangler.js +5 -22
- package/package.json +8 -7
- package/public/_assets/opencode/1.16.2/index-attach.js +2 -2
- package/public/_assets/runtime/esbuild-cli-c4fda380d52befc1.js +6892 -0
- package/public/_assets/runtime/git-de3e60c9f3ff006a.js +103 -0
- package/public/_assets/runtime/{node-shims-7b4dd7a76d95d21e.js → node-shims-06565b121555c194.js} +2089 -861
- package/public/_assets/runtime/resident-store-6ffb1939c53d982f.js +2264 -0
- package/public/_assets/runtime/vfs-write-ledger-e501e8fc793bc2c1.js +889 -0
- package/scripts/build-opencode-attach-entry.mjs +51 -1
- package/scripts/bundle-facet-workers.mjs +114 -3
- package/scripts/bundle-git.mjs +88 -27
- package/scripts/bundle-node-shims.mjs +72 -46
- package/scripts/bundle-runtime.mjs +18 -421
- package/scripts/cf-git-patch.mjs +137 -0
- package/scripts/patch-install-deps.mjs +49 -96
- package/scripts/runtime-specs.mjs +435 -0
- package/vendor/git-http.generated.d.ts +82 -0
- package/vendor/git-upstream.generated.d.ts +4378 -0
- package/vendor/git.LICENSE +7 -0
- package/vendor/git.generated.d.mts +21 -0
- package/vendor/git.generated.mjs +103 -0
- package/dist/replica/suspension.d.ts +0 -36
- package/dist/replica/suspension.d.ts.map +0 -1
- package/dist/replica/suspension.js +0 -49
- package/dist/runtime/static-server.d.ts +0 -3
- package/dist/runtime/static-server.d.ts.map +0 -1
- package/dist/runtime/static-server.js +0 -133
- package/scripts/clean-dist.mjs +0 -7
|
@@ -16,6 +16,7 @@ import type { SqliteVFS } from '@nimbus-sh/core/vfs/sqlite-vfs.js';
|
|
|
16
16
|
import { type VfsCred } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
17
17
|
import { type PortVisibility } from './port-capability.js';
|
|
18
18
|
import type { LongRunningWorkerSpawnOptions, ResidentAppSummary, ResidentIdentity, ResidentRestartPolicy, SpawnedWorker } from '../facets/manager.js';
|
|
19
|
+
import { type ExecOutput, type ExecStream } from '@nimbus-sh/core/runtime/exec-stream.js';
|
|
19
20
|
import type { RuntimeManager } from '@nimbus-sh/core/runtime/runtime-manager.js';
|
|
20
21
|
export interface ProgrammaticShell {
|
|
21
22
|
env?: Record<string, string>;
|
|
@@ -28,9 +29,9 @@ export interface ProgrammaticShell {
|
|
|
28
29
|
interface ProgrammaticShellExecuteOptions {
|
|
29
30
|
cwd?: string;
|
|
30
31
|
env?: Record<string, string>;
|
|
31
|
-
/** Bytes, as the shell's own ExecuteOptions: a process's stdio is bytes. */
|
|
32
|
-
onStdout?: (data: Uint8Array) => void
|
|
33
|
-
onStderr?: (data: Uint8Array) => void
|
|
32
|
+
/** Bytes, as the shell's own ExecuteOptions: a process's stdio is bytes. A returned promise is backpressure. */
|
|
33
|
+
onStdout?: (data: Uint8Array) => void | Promise<void>;
|
|
34
|
+
onStderr?: (data: Uint8Array) => void | Promise<void>;
|
|
34
35
|
signal?: AbortSignal;
|
|
35
36
|
stdin?: string;
|
|
36
37
|
isolateShellState?: boolean;
|
|
@@ -155,15 +156,8 @@ export interface ProgrammaticDestroyResult {
|
|
|
155
156
|
destroyedAt: number;
|
|
156
157
|
reason: string | null;
|
|
157
158
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
exitCode: number;
|
|
161
|
-
success: boolean;
|
|
162
|
-
stdout: string;
|
|
163
|
-
stderr: string;
|
|
164
|
-
duration: number;
|
|
165
|
-
timestamp: number;
|
|
166
|
-
}
|
|
159
|
+
/** The buffered exec result: the exec stream read to its end. */
|
|
160
|
+
export type ProgrammaticExecResult = ExecOutput;
|
|
167
161
|
/**
|
|
168
162
|
* A started background process. There is no exit code or output here — the
|
|
169
163
|
* process is still running when this returns. Read both back through
|
|
@@ -198,7 +192,14 @@ export declare function ensureProgrammaticReady(self: ProgrammaticHost, options?
|
|
|
198
192
|
ok: true;
|
|
199
193
|
preinstalled: string[];
|
|
200
194
|
}>;
|
|
195
|
+
/** Buffered exec: the exec stream collected into strings by the caller of this function. */
|
|
201
196
|
export declare function rpcExec(self: ProgrammaticHost, command: string, options?: ProgrammaticExecOptions): Promise<ProgrammaticExecResult>;
|
|
197
|
+
/**
|
|
198
|
+
* Run a command and hand back its output as it is written. Resolves once the
|
|
199
|
+
* command has started (after any earlier call on the same named shell);
|
|
200
|
+
* validation and readiness failures reject here, not on the stream.
|
|
201
|
+
*/
|
|
202
|
+
export declare function rpcExecStream(self: ProgrammaticHost, command: string, options?: ProgrammaticExecOptions): Promise<ExecStream>;
|
|
202
203
|
/**
|
|
203
204
|
* Start a command in the background and return its handle immediately.
|
|
204
205
|
*
|
|
@@ -378,12 +379,6 @@ export declare function rpcRemoveDurableApp(self: ProgrammaticHost, owner: strin
|
|
|
378
379
|
removed: boolean;
|
|
379
380
|
port: number | null;
|
|
380
381
|
}>;
|
|
381
|
-
/**
|
|
382
|
-
* Route an embedder request that carries a port capability. The embedder has
|
|
383
|
-
* authenticated the capability at its edge and stripped its own credentials,
|
|
384
|
-
* so the guest's `Authorization` is preserved through this path and no other.
|
|
385
|
-
*/
|
|
386
|
-
export declare function rpcRouteCapabilityPort(self: ProgrammaticHost, port: number, capability: string, request: Request, pathname: string): Promise<Response>;
|
|
387
382
|
/**
|
|
388
383
|
* `spawnWorker` for a colocated embedder holding the DO stub: boot the
|
|
389
384
|
* embedder's own Worker-class program — its main module, inline modules and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"programmatic.d.ts","sourceRoot":"","sources":["../../src/session/programmatic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,KAAK,EAAY,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uDAAuD,CAAC;AACjG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAwC,MAAM,0CAA0C,CAAC;AAC9G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAIpG,OAAO,EAAyO,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGlS,OAAO,KAAK,EAAE,6BAA6B,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKtJ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4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IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAInE;AAMD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,6BAAkC,GACvC,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,EACrC,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,gBAAgB,EACtB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,yBAAyB,CAAC,CA8EpC"}
|
|
@@ -21,13 +21,15 @@ import { CRED_KERNEL, requireVfsCred } from '@nimbus-sh/core/runtime/os-contract
|
|
|
21
21
|
import { endProcessInput, resizeProcess, signalProcess, writeProcessInput } from '@nimbus-sh/core/runtime/process-input-routing.js';
|
|
22
22
|
import { z } from 'zod/v4';
|
|
23
23
|
import { SESSION_DESTROYED_KEY, SHELL_STATE_KEY_PREFIX, VITE_CONFIG_KEY } from './keys.js';
|
|
24
|
-
import { clearPortCapability, isValidAppName, persistPortCapability, portRecordKey, readPortReservation, readPortReservationByName, readPortReservationByOwner, reservePort,
|
|
24
|
+
import { clearPortCapability, isValidAppName, persistPortCapability, portRecordKey, readPortReservation, readPortReservationByName, readPortReservationByOwner, reservePort, rotatePortCapability } from './port-capability.js';
|
|
25
25
|
import { bindPublicPortCapability, unbindPublicPortCapability } from '../router/public-directory.js';
|
|
26
26
|
import { buildPreviewHost, buildPublicPreviewHost, isPreviewHostSafeSid, readPreviewHostSuffix } from '../_shared/preview-host.js';
|
|
27
27
|
import { RESTART_POLICY_ENV } from '../facets/manager.js';
|
|
28
28
|
import { GENERATION_KEY, assumeGeneration, generation } from '@nimbus-sh/fabric/generation.js';
|
|
29
29
|
import { HeadlessTerminal, Shell } from '@nimbus-sh/core/substrate/lifo/index.js';
|
|
30
|
-
import {
|
|
30
|
+
import { enc } from '@nimbus-sh/core/_shared/bytes.js';
|
|
31
|
+
import { collectExecStream, createExecStream } from '@nimbus-sh/core/runtime/exec-stream.js';
|
|
32
|
+
import { _acquireForRoutedRequest } from './rpc.js';
|
|
31
33
|
const ShellIdSchema = z.string().min(1).max(160).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/);
|
|
32
34
|
const ShellStateSchema = z.object({
|
|
33
35
|
cwd: z.string().startsWith('/'),
|
|
@@ -49,6 +51,9 @@ export function createProgrammaticShell(self, pid, state) {
|
|
|
49
51
|
setUmask: (mask) => self.processes.setUmask(pid, mask),
|
|
50
52
|
runAs: parent.getRunAsHost(),
|
|
51
53
|
});
|
|
54
|
+
const hostSignals = parent.getHostProcessSignals();
|
|
55
|
+
if (hostSignals)
|
|
56
|
+
shell.setHostProcessSignals(hostSignals);
|
|
52
57
|
shell.setCwd(state.cwd);
|
|
53
58
|
return shell;
|
|
54
59
|
}
|
|
@@ -192,7 +197,7 @@ function startShellJob(self, command, options, job, scoped) {
|
|
|
192
197
|
}
|
|
193
198
|
catch { /* ring gone */ }
|
|
194
199
|
}
|
|
195
|
-
sink?.(data);
|
|
200
|
+
return sink?.(data);
|
|
196
201
|
};
|
|
197
202
|
const run = shell.execute(line, {
|
|
198
203
|
// A named shell already holds its own cwd and env; passing them again
|
|
@@ -240,22 +245,46 @@ function assertAbsoluteExecCwd(options) {
|
|
|
240
245
|
throw new Error(`cwd must be an absolute POSIX path starting with '/', got ${JSON.stringify(cwd)}`);
|
|
241
246
|
}
|
|
242
247
|
}
|
|
248
|
+
/** Buffered exec: the exec stream collected into strings by the caller of this function. */
|
|
243
249
|
export async function rpcExec(self, command, options = {}) {
|
|
250
|
+
return collectExecStream(await rpcExecStream(self, command, options));
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Run a command and hand back its output as it is written. Resolves once the
|
|
254
|
+
* command has started (after any earlier call on the same named shell);
|
|
255
|
+
* validation and readiness failures reject here, not on the stream.
|
|
256
|
+
*/
|
|
257
|
+
export async function rpcExecStream(self, command, options = {}) {
|
|
244
258
|
assertAbsoluteExecCwd(options);
|
|
245
259
|
await ensureProgrammaticReady(self, options);
|
|
246
|
-
|
|
260
|
+
let writer = null;
|
|
261
|
+
return new Promise((resolve, reject) => {
|
|
262
|
+
// The exit lands after a named shell's state is saved, so a caller that
|
|
263
|
+
// has read `exit` sees its `cd` on the next call.
|
|
264
|
+
withShellState(self, options, false, (scoped) => streamOnShell(self, command, options, scoped, (started) => {
|
|
265
|
+
writer = started;
|
|
266
|
+
resolve(started.stream);
|
|
267
|
+
})).then((exit) => writer.end(exit), (error) => (writer ? writer.fail(error) : reject(error)));
|
|
268
|
+
});
|
|
247
269
|
}
|
|
248
|
-
async function
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
270
|
+
async function streamOnShell(self, command, options, scoped, started) {
|
|
271
|
+
const began = Date.now();
|
|
272
|
+
let abort = () => { };
|
|
273
|
+
const writer = createExecStream(() => abort());
|
|
274
|
+
const wrote = { stdout: false, stderr: false };
|
|
275
|
+
const sink = (name) => (data) => {
|
|
276
|
+
wrote[name] = true;
|
|
277
|
+
return writer.write(name, data);
|
|
278
|
+
};
|
|
254
279
|
const job = startShellJob(self, command, options, {
|
|
255
280
|
background: false,
|
|
256
|
-
onStdout:
|
|
257
|
-
onStderr:
|
|
281
|
+
onStdout: sink('stdout'),
|
|
282
|
+
onStderr: sink('stderr'),
|
|
258
283
|
}, scoped);
|
|
284
|
+
abort = job.abort;
|
|
285
|
+
started(writer);
|
|
286
|
+
let timeout = null;
|
|
287
|
+
let timedOut = false;
|
|
259
288
|
let result;
|
|
260
289
|
try {
|
|
261
290
|
result = options.timeoutMs && options.timeoutMs > 0
|
|
@@ -271,27 +300,28 @@ async function execOnShell(self, command, options, scoped) {
|
|
|
271
300
|
])
|
|
272
301
|
: await job.run;
|
|
273
302
|
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
self.processes.exit(job.pid, 1);
|
|
305
|
+
throw error;
|
|
306
|
+
}
|
|
274
307
|
finally {
|
|
275
|
-
|
|
276
|
-
clearTimeout(timeout);
|
|
308
|
+
clearTimeout(timeout);
|
|
277
309
|
}
|
|
278
310
|
const exitCode = Number(result.exitCode ?? (timedOut ? 124 : 0));
|
|
279
311
|
self.processes.exit(job.pid, exitCode);
|
|
280
312
|
if (timedOut) {
|
|
281
|
-
stderr.
|
|
313
|
+
await sink('stderr')(enc.encode(`command timed out after ${options.timeoutMs}ms\n`));
|
|
282
314
|
}
|
|
283
315
|
const logged = collectJobOutput(self, job.pid);
|
|
284
|
-
if (stdout
|
|
285
|
-
stdout.
|
|
286
|
-
if (stderr
|
|
287
|
-
stderr.
|
|
316
|
+
if (!wrote.stdout && logged.stdout)
|
|
317
|
+
await writer.write('stdout', enc.encode(logged.stdout));
|
|
318
|
+
if (!wrote.stderr && logged.stderr)
|
|
319
|
+
await writer.write('stderr', enc.encode(logged.stderr));
|
|
288
320
|
return {
|
|
289
321
|
command: String(command),
|
|
290
322
|
exitCode,
|
|
291
323
|
success: exitCode === 0,
|
|
292
|
-
|
|
293
|
-
stderr: stderr.join(''),
|
|
294
|
-
duration: Date.now() - started,
|
|
324
|
+
duration: Date.now() - began,
|
|
295
325
|
timestamp: Date.now(),
|
|
296
326
|
};
|
|
297
327
|
}
|
|
@@ -930,22 +960,6 @@ export async function rpcRemoveDurableApp(self, owner) {
|
|
|
930
960
|
// The composed manager owns the durable-app verbs — validation included.
|
|
931
961
|
return self.ensureFacetManager().apps.removeDurableApp(owner);
|
|
932
962
|
}
|
|
933
|
-
/**
|
|
934
|
-
* Route an embedder request that carries a port capability. The embedder has
|
|
935
|
-
* authenticated the capability at its edge and stripped its own credentials,
|
|
936
|
-
* so the guest's `Authorization` is preserved through this path and no other.
|
|
937
|
-
*/
|
|
938
|
-
export async function rpcRouteCapabilityPort(self, port, capability, request, pathname) {
|
|
939
|
-
await ensureProgrammaticReady(self);
|
|
940
|
-
await restorePortCapability(self, port);
|
|
941
|
-
if (request.headers.get('upgrade')?.toLowerCase() === 'websocket') {
|
|
942
|
-
// A 101 cannot cross the DO RPC boundary this entrypoint is reached
|
|
943
|
-
// through; the session fetch route is the one that keeps fetch semantics.
|
|
944
|
-
return new Response('WebSocket upgrades must use the session fetch route', { status: 409 });
|
|
945
|
-
}
|
|
946
|
-
const routed = await self.portRegistry.routeCapabilityRequest(Number(port), String(capability), request, pathname);
|
|
947
|
-
return routed ?? new Response('Not found', { status: 404 });
|
|
948
|
-
}
|
|
949
963
|
/**
|
|
950
964
|
* `spawnWorker` for a colocated embedder holding the DO stub: boot the
|
|
951
965
|
* embedder's own Worker-class program — its main module, inline modules and
|
|
@@ -1146,7 +1160,7 @@ function successorGeneration(self) {
|
|
|
1146
1160
|
function installEmptyProcessState(self, generation) {
|
|
1147
1161
|
self.processes = new SessionProcessSupervisor();
|
|
1148
1162
|
self.processes.setPidBase(generation * PID_GEN_STRIDE);
|
|
1149
|
-
self.portRegistry = new PortRegistry();
|
|
1163
|
+
self.portRegistry = new PortRegistry((pid) => _acquireForRoutedRequest(self, pid));
|
|
1150
1164
|
self._w9PersistWired = false;
|
|
1151
1165
|
}
|
|
1152
1166
|
async function closeAcceptedWebSockets(self) {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* getReplicaState(self) — composes `_w12EnableResult` (constructor-time
|
|
11
11
|
* enable result) + live `inspectReplicaState(ctx)` (per-fetch isReplica
|
|
12
|
-
* + bookmark)
|
|
12
|
+
* + bookmark). Surfaced
|
|
13
13
|
* via `/api/_diag/memory.replica` so operators (and the CT1 drift
|
|
14
14
|
* detector) can confirm replicas landed and observe replication lag.
|
|
15
15
|
*
|
|
@@ -50,8 +50,7 @@ export declare function wireReplicasOnConstruct(ctx: any): W12EnableResult;
|
|
|
50
50
|
*
|
|
51
51
|
* - `state` / `error` come from the ctor-time enable result on `host`.
|
|
52
52
|
* - `isReplica` / `bookmark` come from per-fetch `inspectReplicaState(ctx)`.
|
|
53
|
-
* - `suspended`
|
|
54
|
-
* (npm install / git clone in flight) per CF research §G.4.
|
|
53
|
+
* - `suspended` is false: no production path suspends replicas.
|
|
55
54
|
*
|
|
56
55
|
* Never throws. Callers can rely on the shape always being filled.
|
|
57
56
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica-routes.d.ts","sourceRoot":"","sources":["../../src/session/replica-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAGL,KAAK,uBAAuB,IAAI,eAAe,EAChD,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"replica-routes.d.ts","sourceRoot":"","sources":["../../src/session/replica-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAGL,KAAK,uBAAuB,IAAI,eAAe,EAChD,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,CAQjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,GAAG;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;CACpB,CAgBA"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* getReplicaState(self) — composes `_w12EnableResult` (constructor-time
|
|
11
11
|
* enable result) + live `inspectReplicaState(ctx)` (per-fetch isReplica
|
|
12
|
-
* + bookmark)
|
|
12
|
+
* + bookmark). Surfaced
|
|
13
13
|
* via `/api/_diag/memory.replica` so operators (and the CT1 drift
|
|
14
14
|
* detector) can confirm replicas landed and observe replication lag.
|
|
15
15
|
*
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
* (`self._w12EnableResult`); this file is pure logic.
|
|
18
18
|
*/
|
|
19
19
|
import { tryEnableReplicas as _w12TryEnableReplicas, inspectReplicaState as _w12InspectReplicaState, } from '../replica/routing.js';
|
|
20
|
-
import { replicasSuspended as _w12ReplicasSuspended } from '../replica/suspension.js';
|
|
21
20
|
/**
|
|
22
21
|
* Run at DO ctor time. Calls `tryEnableReplicas(ctx)` and returns the
|
|
23
22
|
* result. Pre-GA runtimes lacking the SPEC API yield
|
|
@@ -44,8 +43,7 @@ export function wireReplicasOnConstruct(ctx) {
|
|
|
44
43
|
*
|
|
45
44
|
* - `state` / `error` come from the ctor-time enable result on `host`.
|
|
46
45
|
* - `isReplica` / `bookmark` come from per-fetch `inspectReplicaState(ctx)`.
|
|
47
|
-
* - `suspended`
|
|
48
|
-
* (npm install / git clone in flight) per CF research §G.4.
|
|
46
|
+
* - `suspended` is false: no production path suspends replicas.
|
|
49
47
|
*
|
|
50
48
|
* Never throws. Callers can rely on the shape always being filled.
|
|
51
49
|
*
|
|
@@ -62,16 +60,11 @@ export function getReplicaState(host, ctx) {
|
|
|
62
60
|
bookmark = inspect.bookmark;
|
|
63
61
|
}
|
|
64
62
|
catch { /* never throw from a diag helper */ }
|
|
65
|
-
let suspended = false;
|
|
66
|
-
try {
|
|
67
|
-
suspended = _w12ReplicasSuspended();
|
|
68
|
-
}
|
|
69
|
-
catch { }
|
|
70
63
|
return {
|
|
71
64
|
state: enable.state,
|
|
72
65
|
error: enable.error,
|
|
73
66
|
isReplica,
|
|
74
67
|
bookmark,
|
|
75
|
-
suspended,
|
|
68
|
+
suspended: false,
|
|
76
69
|
};
|
|
77
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/session/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/session/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAiEH,KAAK,UAAU,GAAG,GAAG,CAAC;AAyBtB;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuFlG;AAeD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,QAAQ,CAAC,CAMnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAiB9E;AAmDD,wBAAsB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CA0hCvF"}
|
package/dist/session/routes.js
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
* (~30 sites). RoutesHost = any pragmatic deviation, like InitHost in S6.
|
|
25
25
|
*/
|
|
26
26
|
import { handleReplicaPreflight as _w12HandleReplicaPreflight } from '../replica/routing.js';
|
|
27
|
-
import { replicasSuspended as _w12ReplicasSuspended } from '../replica/suspension.js';
|
|
28
27
|
import { sanitizeUntrustedRequest } from '@nimbus-sh/core/_shared/untrusted-request.js';
|
|
29
28
|
import { matchLogsPath, handleLogsWebSocketRequest, handleProcessesListRequest, } from '../runtime/process-logs-api.js';
|
|
30
29
|
import { readDiagCounters } from '@nimbus-sh/platform/diag-counters.js';
|
|
@@ -35,11 +34,11 @@ import { SEED_PROJECT_DIR, SEED_PROJECT_NAME } from '@nimbus-sh/core/vfs/seed-pr
|
|
|
35
34
|
import { BASE_PATH_HEADER } from '../_shared/session-router.js';
|
|
36
35
|
import { VITE_CONFIG_KEY } from './keys.js';
|
|
37
36
|
import { estimateSupervisorHeap, WORKERD_EVICTION_LABELS } from '@nimbus-sh/platform/heap-estimate.js';
|
|
38
|
-
import { loadShellState,
|
|
37
|
+
import { loadShellState, getScrollbackStats, clearSessionState, loadScrollback } from './state-store.js';
|
|
39
38
|
import { classifyWsUpgrade, joinExistingSession } from './init-phases.js';
|
|
40
39
|
import { shellTerminalTee } from './ws.js';
|
|
41
40
|
import { closeStaleShellSockets, tagShellSocket } from './shell-socket.js';
|
|
42
|
-
import {
|
|
41
|
+
import { supervisorEsbuildService } from '../facets/esbuild-transform.js';
|
|
43
42
|
import { ViteDevServer } from '../facets/vite-dev-server.js';
|
|
44
43
|
import { notifyTerminalEvent, wireProcessLogSocketBroadcast } from '../runtime/process-logs-api.js';
|
|
45
44
|
import { makeLongRunningPortStub } from '@nimbus-sh/core/runtime/long-running-handle.js';
|
|
@@ -149,7 +148,7 @@ export async function restorePersistedDevServer(self, onlyPort) {
|
|
|
149
148
|
if (!self.esbuildService) {
|
|
150
149
|
if (!self.sqliteFs)
|
|
151
150
|
throw new Error('Session VFS is not initialized');
|
|
152
|
-
self.esbuildService =
|
|
151
|
+
self.esbuildService = supervisorEsbuildService(self.ctx, self.env, self.getFilesystemAuthority().namespaceFs(CRED_KERNEL));
|
|
153
152
|
}
|
|
154
153
|
// Prefer the current request's basePath (just captured from the
|
|
155
154
|
// X-Nimbus-Base header) over the stored one — the latter is only
|
|
@@ -346,7 +345,6 @@ export async function handleFetch(self, request) {
|
|
|
346
345
|
try {
|
|
347
346
|
const w12Pre = await _w12HandleReplicaPreflight(self.ctx, request, {
|
|
348
347
|
isWarm: !!(self.viteDevServer?.isRunning || self.cirrusReal?.isRunning),
|
|
349
|
-
suspended: _w12ReplicasSuspended(),
|
|
350
348
|
});
|
|
351
349
|
if (w12Pre.delegated && w12Pre.response) {
|
|
352
350
|
return w12Pre.response;
|
|
@@ -750,15 +748,14 @@ export async function handleFetch(self, request) {
|
|
|
750
748
|
// hasPersistedState=false).
|
|
751
749
|
if (url.pathname === '/api/_diag/session') {
|
|
752
750
|
const snap = loadShellState(self.ctx);
|
|
753
|
-
const mounts =
|
|
751
|
+
const mounts = self.getFilesystemAuthority().mounts(CRED_KERNEL).map((mount) => mount.mountPoint);
|
|
754
752
|
const sbStats = getScrollbackStats(self.ctx);
|
|
755
753
|
return Response.json({
|
|
756
754
|
cwd: snap.cwd,
|
|
757
755
|
env: snap.env,
|
|
758
756
|
hydratedAt: snap.hydratedAt,
|
|
759
757
|
hasPersistedState: snap.hasPersistedState,
|
|
760
|
-
//
|
|
761
|
-
// initSession, populated after.
|
|
758
|
+
// The namespace's mount points, as /proc/mounts lists them.
|
|
762
759
|
mounts,
|
|
763
760
|
// [B'.3] scrollback stats — rows, total bytes, byte cap.
|
|
764
761
|
scrollbackRows: sbStats.rows,
|
|
@@ -901,7 +898,7 @@ export async function handleFetch(self, request) {
|
|
|
901
898
|
return Response.json({ reset: true });
|
|
902
899
|
}
|
|
903
900
|
// ── B'.1 session-state reset ─────────────────────────────────────
|
|
904
|
-
// Drops every nimbus_session_kv /
|
|
901
|
+
// Drops every nimbus_session_kv /
|
|
905
902
|
// nimbus_terminal_scrollback row so the next /ws upgrade
|
|
906
903
|
// takes the cold-start path (Phase O fires; banner reprints).
|
|
907
904
|
// Used by probes to start each scenario from a known-empty state.
|
|
@@ -1025,7 +1022,7 @@ export async function handleFetch(self, request) {
|
|
|
1025
1022
|
if (!self.esbuildService) {
|
|
1026
1023
|
if (!self.sqliteFs)
|
|
1027
1024
|
throw new Error('Session VFS is not initialized');
|
|
1028
|
-
self.esbuildService =
|
|
1025
|
+
self.esbuildService = supervisorEsbuildService(self.ctx, self.env, self.getFilesystemAuthority().namespaceFs(CRED_KERNEL));
|
|
1029
1026
|
}
|
|
1030
1027
|
const basePath = self.viteBasePath;
|
|
1031
1028
|
// process metadata support: allocate a PID + port even on the
|
package/dist/session/rpc.d.ts
CHANGED
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
* these ~3 sites would each need ctx threaded through; cast at boundary
|
|
22
22
|
* is acceptable per plan §IX recommendation 1.
|
|
23
23
|
*/
|
|
24
|
+
import type { RuntimeVfsStat } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
24
25
|
import type { HostRoute } from '@nimbus-sh/platform/composition.js';
|
|
25
26
|
import { type ResidentFacet } from '@nimbus-sh/fabric/workerd-facet-host.js';
|
|
26
27
|
import { type HostedHttpRequest, type HostedHttpResponse } from '@nimbus-sh/fabric/process-host.js';
|
|
27
|
-
import { type VfsAcquireResult, type VfsCred, type VfsListPage, type VfsMutationReceipt } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
28
|
+
import { type VfsAcquireOptions, type VfsAcquireResult, type VfsCred, type VfsListPage, type VfsMutationReceipt } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
28
29
|
import type { WriteBatchStreamResult } from '@nimbus-sh/core/vfs/sqlite-vfs.js';
|
|
29
30
|
import { z } from 'zod/v4';
|
|
30
31
|
type RpcHost = any;
|
|
@@ -85,10 +86,6 @@ export declare function _rpcWriteProtectedRootFile(self: RpcHost, rootPath: stri
|
|
|
85
86
|
export declare function _rpcStat(self: RpcHost, path: string, pid?: number, cred?: VfsCred): Promise<any>;
|
|
86
87
|
export declare function _rpcLstat(self: RpcHost, path: string, pid?: number, cred?: VfsCred): Promise<any>;
|
|
87
88
|
export declare function _rpcChmod(self: RpcHost, path: string, mode: number, pid?: number, cred?: VfsCred): Promise<void>;
|
|
88
|
-
export declare function _rpcAccess(self: RpcHost, path: string, mode: number, pid?: number): Promise<void>;
|
|
89
|
-
export declare function _rpcChown(self: RpcHost, path: string, uid: number, gid: number, pid?: number, options?: {
|
|
90
|
-
followSymlinks?: boolean;
|
|
91
|
-
}): Promise<void>;
|
|
92
89
|
export declare function _rpcSetUmask(self: RpcHost, mask: number, pid?: number): Promise<number>;
|
|
93
90
|
export declare function _rpcReaddir(self: RpcHost, path: string, pid?: number, cred?: VfsCred): Promise<{
|
|
94
91
|
name: string;
|
|
@@ -97,30 +94,57 @@ export declare function _rpcReaddir(self: RpcHost, path: string, pid?: number, c
|
|
|
97
94
|
export declare function _rpcExists(self: RpcHost, path: string, pid?: number, cred?: VfsCred): Promise<boolean>;
|
|
98
95
|
export declare function _rpcMkdir(self: RpcHost, path: string, pid?: number, cred?: VfsCred): Promise<void>;
|
|
99
96
|
export declare function _rpcRename(self: RpcHost, from: string, to: string, pid?: number, cred?: VfsCred): Promise<void>;
|
|
100
|
-
declare const FsReadBatchArgsSchema: z.ZodArray<z.ZodObject<{
|
|
97
|
+
declare const FsReadBatchArgsSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
98
|
+
path: z.ZodString;
|
|
99
|
+
lstat: z.ZodLiteral<true>;
|
|
100
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
101
101
|
path: z.ZodString;
|
|
102
102
|
offset: z.ZodNumber;
|
|
103
103
|
length: z.ZodNumber;
|
|
104
104
|
expectedEpoch: z.ZodOptional<z.ZodString>;
|
|
105
105
|
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
106
|
-
}, z.core.$strip>>;
|
|
107
|
-
/**
|
|
106
|
+
}, z.core.$strip>]>>;
|
|
107
|
+
/**
|
|
108
|
+
* One request in a batch read: a range, whose `length` bounds what it may
|
|
109
|
+
* return, or a path's lstat, which returns no file bytes.
|
|
110
|
+
*/
|
|
108
111
|
export type FsReadBatchRequest = z.infer<typeof FsReadBatchArgsSchema>[number];
|
|
112
|
+
/** The file bytes a batch request may return: its range's length; an lstat, none. */
|
|
113
|
+
export declare function fsReadBatchRequestBytes(request: FsReadBatchRequest): number;
|
|
109
114
|
export interface FsReadBatchEntryError {
|
|
110
115
|
readonly code?: string;
|
|
111
116
|
readonly message: string;
|
|
112
117
|
}
|
|
113
118
|
/**
|
|
114
|
-
* One
|
|
115
|
-
*
|
|
119
|
+
* One request's outcome, positionally matched to it. A range answers
|
|
120
|
+
* `bytes`, `null` when the path does not exist — the same answer
|
|
121
|
+
* `fsReadRange` gives. An lstat answers `stat`, `null` when the path does not
|
|
122
|
+
* exist — the same answer the `lstat` op gives.
|
|
116
123
|
*/
|
|
117
124
|
export type FsReadBatchEntry = {
|
|
118
125
|
bytes: Uint8Array | null;
|
|
126
|
+
stat?: undefined;
|
|
127
|
+
error?: undefined;
|
|
128
|
+
} | {
|
|
129
|
+
stat: RuntimeVfsStat | null;
|
|
130
|
+
bytes?: undefined;
|
|
119
131
|
error?: undefined;
|
|
120
132
|
} | {
|
|
121
133
|
bytes?: undefined;
|
|
134
|
+
stat?: undefined;
|
|
122
135
|
error: FsReadBatchEntryError;
|
|
123
136
|
};
|
|
137
|
+
declare const FsAcquireArgsSchema: z.ZodObject<{
|
|
138
|
+
epoch: z.ZodNullable<z.ZodString>;
|
|
139
|
+
cursor: z.ZodNumber;
|
|
140
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
namespace: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
push: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
roots: z.ZodArray<z.ZodString>;
|
|
144
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
}, z.core.$strip>;
|
|
124
148
|
export declare function _rpcWsOpen(self: RpcHost, url: string, protocols: string[], pid?: number): Promise<{
|
|
125
149
|
id: number;
|
|
126
150
|
protocol: string;
|
|
@@ -135,7 +159,56 @@ export declare function _rpcWsClose(self: RpcHost, id: number, code?: number, re
|
|
|
135
159
|
* survive structured clone across the RPC boundary, so a cursor carried that
|
|
136
160
|
* way would silently arrive as undefined.
|
|
137
161
|
*/
|
|
138
|
-
export declare function _rpcFsAcquire(self: RpcHost, epoch: string | null, cursor: number, pid?: number): Promise<VfsAcquireResult>;
|
|
162
|
+
export declare function _rpcFsAcquire(self: RpcHost, epoch: string | null, cursor: number, options?: VfsAcquireOptions | null, pid?: number): Promise<VfsAcquireResult>;
|
|
163
|
+
/**
|
|
164
|
+
* N18: a process's facet store asks for room to grow, reporting what its
|
|
165
|
+
* database measures. The ledger's row for the facet first takes the
|
|
166
|
+
* measurement where it is over the record (overshoot), then admits `bytes`
|
|
167
|
+
* more under the facet's name; refused, nothing is granted and the store
|
|
168
|
+
* keeps what it has (reading the rest through the session).
|
|
169
|
+
*/
|
|
170
|
+
export declare function _rpcFsStorageGrant(self: RpcHost, facet: string, bytes: number, databaseSize: number, pid?: number): Promise<{
|
|
171
|
+
granted: number;
|
|
172
|
+
}>;
|
|
173
|
+
/** What a process passes to fsAcquire: the cursor its resident set is at. */
|
|
174
|
+
export type FsAcquireArgs = z.infer<typeof FsAcquireArgsSchema>;
|
|
175
|
+
/** An ACQUIRE a delivery carries: fsAcquire's arguments and its answer to them. */
|
|
176
|
+
export interface VfsDeliveredAcquire {
|
|
177
|
+
args: FsAcquireArgs;
|
|
178
|
+
answer: VfsAcquireResult;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The ACQUIRE a delivery carries, so the process it is delivered to applies
|
|
182
|
+
* it instead of asking.
|
|
183
|
+
*
|
|
184
|
+
* A stdin packet, a child's output or exit, a request routed to a port: the
|
|
185
|
+
* supervisor hands each of these to a process, and the process may not run
|
|
186
|
+
* the code they wake until it has applied everything written before them
|
|
187
|
+
* (protocol §3, §5.6). Asking costs a round trip per delivery, which an
|
|
188
|
+
* attached terminal pays on every keystroke. But the supervisor is already
|
|
189
|
+
* answering: `args` are what the process would pass to fsAcquire, and
|
|
190
|
+
* `answer` is exactly what fsAcquire answers for them, computed here, after
|
|
191
|
+
* the thing delivered was queued. Every write that preceded it is in the
|
|
192
|
+
* answer, and the delivery carries it, so it cannot be lost or reordered
|
|
193
|
+
* apart from it.
|
|
194
|
+
*
|
|
195
|
+
* One format with fsAcquire's own: the same arguments, checked by the same
|
|
196
|
+
* schema, answered by the same function. Undefined when there is no answer
|
|
197
|
+
* to carry — the process sent no arguments it can be answered for, or this
|
|
198
|
+
* one could not be computed — and the process then asks, as it always has,
|
|
199
|
+
* where a failure is counted and handled. It is never a reason to fail the
|
|
200
|
+
* delivery: that would lose a dequeued keystroke or a routed request.
|
|
201
|
+
*/
|
|
202
|
+
export declare function _acquireOnDelivery(self: RpcHost, args: unknown, pid?: number): Promise<VfsDeliveredAcquire | undefined>;
|
|
203
|
+
/**
|
|
204
|
+
* The ACQUIRE a request routed to `pid`'s port carries. The supervisor, not
|
|
205
|
+
* the process, starts a request, so it holds no cursor of the process's to
|
|
206
|
+
* answer from, and answers from its own: "nothing since now". The process can
|
|
207
|
+
* use that only when it is already there, which is protocol §9.2's
|
|
208
|
+
* one-integer piggyback — true for any request no write preceded since the
|
|
209
|
+
* process last caught up — and otherwise asks.
|
|
210
|
+
*/
|
|
211
|
+
export declare function _acquireForRoutedRequest(self: RpcHost, pid: number): Promise<VfsDeliveredAcquire | undefined>;
|
|
139
212
|
/**
|
|
140
213
|
* Enumerate the session filesystem for a process, one bounded page at a time.
|
|
141
214
|
*
|
|
@@ -146,10 +219,11 @@ export declare function _rpcFsAcquire(self: RpcHost, epoch: string | null, curso
|
|
|
146
219
|
export declare function _rpcFsList(self: RpcHost, after: string | null, limit: number | null, pid?: number): Promise<VfsListPage>;
|
|
147
220
|
export declare function _rpcFsReadRange(self: RpcHost, path: string, offset: number, length: number, pid?: number, cred?: VfsCred): Promise<Uint8Array | null>;
|
|
148
221
|
/**
|
|
149
|
-
* Read many ranges in ONE round trip.
|
|
222
|
+
* Read many ranges, and lstat many paths, in ONE round trip.
|
|
150
223
|
*
|
|
151
|
-
* Every entry is the same read `_rpcFsReadRange` performs,
|
|
152
|
-
*
|
|
224
|
+
* Every entry is the same read `_rpcFsReadRange` performs, or the same stat
|
|
225
|
+
* the `lstat` op performs, through the same process credential and the same
|
|
226
|
+
* live bridge, in request order. A batch is
|
|
153
227
|
* therefore exactly as authoritative as the individual reads it replaces —
|
|
154
228
|
* it takes no snapshot and consults nothing the single-read path would not.
|
|
155
229
|
* What it saves is round trips, which is the whole cost of a read.
|
|
@@ -173,7 +247,6 @@ export declare function _rpcFsAppendAck(self: RpcHost, writerId: string, moduleI
|
|
|
173
247
|
* DO. The HmrBridge holds the client→WS map; we delegate to it.
|
|
174
248
|
*/
|
|
175
249
|
export declare function _rpcHmrRelay(self: RpcHost, clientId: string | null, msg: string): Promise<void>;
|
|
176
|
-
export declare function _rpcUnlink(self: RpcHost, path: string, pid?: number): Promise<void>;
|
|
177
250
|
/**
|
|
178
251
|
* Bulk-write files and directories via one transactionSync().
|
|
179
252
|
* Called from facets that accumulate writes locally (git clone/fetch/pull,
|
|
@@ -210,7 +283,7 @@ export declare function _rpcWriteBatchStream(self: RpcHost, stream: ReadableStre
|
|
|
210
283
|
* resolver-facet to flush a wave of resolved packages back to the
|
|
211
284
|
* supervisor without per-entry round-trips.
|
|
212
285
|
*
|
|
213
|
-
* Payload is the array of RegistryCacheEntry shapes from src/npm
|
|
286
|
+
* Payload is the array of RegistryCacheEntry shapes from src/npm/cache.ts.
|
|
214
287
|
* Returns { written, failed } so the facet can surface partial-write
|
|
215
288
|
* warnings to the install log.
|
|
216
289
|
*/
|
|
@@ -229,7 +302,7 @@ export declare function _rpcStderr(self: RpcHost, pid: number, data: Uint8Array)
|
|
|
229
302
|
*
|
|
230
303
|
* Idempotent — double-call is a no-op (ProcessLogStore.markExit guards).
|
|
231
304
|
*/
|
|
232
|
-
export declare function _rpcReportExit(self: RpcHost, pid: number, code: number, tail: string): Promise<void>;
|
|
305
|
+
export declare function _rpcReportExit(self: RpcHost, pid: number, code: number, tail: string, residencyMisses?: string[], profileUnread?: string[] | null): Promise<void>;
|
|
233
306
|
/**
|
|
234
307
|
* Emit a formatted exit-dump banner + last 30 lines of output to the
|
|
235
308
|
* terminal. Called from both the facet-reported exit path and the
|
|
@@ -296,11 +369,22 @@ export declare function _rpcCpStdinWrite(self: RpcHost, childPid: number, data:
|
|
|
296
369
|
ok: boolean;
|
|
297
370
|
}>;
|
|
298
371
|
export declare function _rpcCpStdinEnd(self: RpcHost, childPid: number): Promise<void>;
|
|
299
|
-
export declare function _rpcCpReadStdin(self: RpcHost, childPid: number, waitMs: number): Promise<
|
|
300
|
-
|
|
372
|
+
export declare function _rpcCpReadStdin(self: RpcHost, childPid: number, waitMs: number, acquire?: unknown, pid?: number): Promise<{
|
|
373
|
+
data: Uint8Array;
|
|
374
|
+
ended: boolean;
|
|
375
|
+
resize?: {
|
|
376
|
+
columns: number;
|
|
377
|
+
rows: number;
|
|
378
|
+
};
|
|
379
|
+
signal?: string;
|
|
380
|
+
} | {
|
|
381
|
+
signal: string;
|
|
382
|
+
ended: boolean;
|
|
383
|
+
}>;
|
|
384
|
+
export declare function _rpcCpReadOutput(self: RpcHost, childPid: number, fd: 1 | 2, sinceSeq: number, waitMs: number, acquire?: unknown, pid?: number): Promise<any>;
|
|
301
385
|
export declare function _rpcCpDrainOutput(self: RpcHost, childPid: number): Promise<any>;
|
|
302
386
|
export declare function _rpcCpKill(self: RpcHost, childPid: number, signal: string): Promise<boolean>;
|
|
303
|
-
export declare function _rpcCpWait(self: RpcHost, childPid: number, waitMs: number): Promise<any>;
|
|
387
|
+
export declare function _rpcCpWait(self: RpcHost, childPid: number, waitMs: number, acquire?: unknown, pid?: number): Promise<any>;
|
|
304
388
|
/**
|
|
305
389
|
* child-process isolation gap #1: dispatch a single cp.spawn request inline using the
|
|
306
390
|
* existing pure-builtin / facet-direct logic, returning final stdout/
|