@nimbus-sh/worker 0.7.0 → 0.9.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/dist/facets/compose.d.ts +3 -0
- package/dist/facets/compose.d.ts.map +1 -1
- package/dist/facets/compose.js +1 -1
- package/dist/facets/manager.d.ts +26 -15
- package/dist/facets/manager.d.ts.map +1 -1
- package/dist/facets/manager.js +154 -112
- package/dist/facets/real-vite-hmr.d.ts +3 -1
- package/dist/facets/real-vite-hmr.d.ts.map +1 -1
- package/dist/facets/real-vite-hmr.js +18 -8
- package/dist/facets/ws-terminal.d.ts +9 -31
- package/dist/facets/ws-terminal.d.ts.map +1 -1
- package/dist/facets/ws-terminal.js +58 -51
- package/dist/hosted/commands.d.ts +12 -0
- package/dist/hosted/commands.d.ts.map +1 -0
- package/dist/hosted/commands.js +1647 -0
- package/dist/hosted/runtime.d.ts +135 -0
- package/dist/hosted/runtime.d.ts.map +1 -0
- package/dist/hosted/runtime.js +344 -0
- package/dist/hosted/services.d.ts +44 -0
- package/dist/hosted/services.d.ts.map +1 -0
- package/dist/hosted/services.js +522 -0
- package/dist/loaders/generated-workers.d.ts +1 -1
- package/dist/loaders/generated-workers.d.ts.map +1 -1
- package/dist/loaders/generated-workers.js +2 -2
- package/dist/node-shims-artifact.generated.js +3 -3
- package/dist/runtime/bash-repl.d.ts +6 -4
- package/dist/runtime/bash-repl.d.ts.map +1 -1
- package/dist/runtime/bash-repl.js +46 -7
- package/dist/runtime/bun-runner.js +1 -1
- package/dist/runtime/facet-loader-host.d.ts.map +1 -1
- package/dist/runtime/facet-loader-host.js +1 -3
- package/dist/runtime/node-runner.d.ts +1 -1
- package/dist/runtime/node-runner.d.ts.map +1 -1
- package/dist/runtime/node-runner.js +2 -2
- package/dist/runtime/node-shims.d.ts.map +1 -1
- package/dist/runtime/node-shims.js +14 -1
- package/dist/runtime/opencode-facet-runner.js +14 -14
- package/dist/runtime/package-manager.d.ts +35 -122
- package/dist/runtime/package-manager.d.ts.map +1 -1
- package/dist/runtime/package-manager.js +61 -596
- package/dist/runtime/process-logs-api.d.ts +1 -1
- package/dist/runtime/process-logs-api.d.ts.map +1 -1
- package/dist/runtime/process-logs-api.js +1 -1
- package/dist/runtime/python-repl.d.ts +6 -4
- package/dist/runtime/python-repl.d.ts.map +1 -1
- package/dist/runtime/python-repl.js +92 -67
- package/dist/runtime/repl-session.d.ts +9 -47
- package/dist/runtime/repl-session.d.ts.map +1 -1
- package/dist/runtime/repl-session.js +105 -105
- package/dist/runtime/ruby-repl.d.ts +3 -2
- package/dist/runtime/ruby-repl.d.ts.map +1 -1
- package/dist/runtime/ruby-repl.js +7 -6
- package/dist/runtime/runtime-catalog.d.ts +13 -0
- package/dist/runtime/runtime-catalog.d.ts.map +1 -1
- package/dist/runtime/runtime-catalog.js +88 -0
- package/dist/runtime/wasi/preamble.d.ts.map +1 -1
- package/dist/runtime/wasi/preamble.js +74 -56
- package/dist/runtime-catalog.generated.js +1 -1
- package/dist/session/agent.d.ts +1 -21
- package/dist/session/agent.d.ts.map +1 -1
- package/dist/session/ai.d.ts +5 -1
- package/dist/session/ai.d.ts.map +1 -1
- package/dist/session/ai.js +7 -0
- package/dist/session/hibernation.d.ts +2 -1
- package/dist/session/hibernation.d.ts.map +1 -1
- package/dist/session/hibernation.js +7 -4
- package/dist/session/init.d.ts +1 -36
- package/dist/session/init.d.ts.map +1 -1
- package/dist/session/init.js +18 -1773
- package/dist/session/loopback.d.ts +2 -29
- package/dist/session/loopback.d.ts.map +1 -1
- package/dist/session/loopback.js +3 -27
- package/dist/session/nimbus-session.d.ts +28 -34
- package/dist/session/nimbus-session.d.ts.map +1 -1
- package/dist/session/nimbus-session.js +78 -518
- package/dist/session/npm-install-port.d.ts +3 -1
- package/dist/session/npm-install-port.d.ts.map +1 -1
- package/dist/session/port-capability.d.ts.map +1 -1
- package/dist/session/port-capability.js +11 -1
- package/dist/session/programmatic.d.ts +5 -38
- package/dist/session/programmatic.d.ts.map +1 -1
- package/dist/session/programmatic.js +17 -49
- package/dist/session/rpc.d.ts +3 -43
- package/dist/session/rpc.d.ts.map +1 -1
- package/dist/session/rpc.js +8 -67
- package/dist/session/supervisor-op.d.ts +10 -5
- package/dist/session/supervisor-op.d.ts.map +1 -1
- package/dist/session/supervisor-op.js +21 -48
- package/dist/session/supervisor-rpc.d.ts +33 -16
- package/dist/session/supervisor-rpc.d.ts.map +1 -1
- package/dist/session/supervisor-rpc.js +49 -4
- package/dist/vfs/facet-resident-store.d.ts.map +1 -1
- package/dist/vfs/facet-resident-store.js +4 -2
- package/dist/workspace-host.d.ts +7 -0
- package/dist/workspace-host.d.ts.map +1 -0
- package/dist/workspace-host.js +5 -0
- package/dist/workspace.d.ts +2 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +1 -0
- package/package.json +17 -12
- package/public/_assets/runtime/{node-shims-8f8c64edd2a1f0f5.js → node-shims-acaa037e6d26ec0d.js} +14 -1
- package/scripts/bundle-runtime.mjs +35 -8
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* surface, so the same code serves process facets, the facet loopback stubs
|
|
5
5
|
* and the SDK's direct `_rpc*` calls.
|
|
6
6
|
*
|
|
7
|
-
* - The native filesystem ops
|
|
7
|
+
* - The native filesystem ops core's handler defines run in-process against
|
|
8
8
|
* the shared bridge store — the same cache `supervisorBridge` hands the
|
|
9
9
|
* handle-based and append RPC bodies.
|
|
10
10
|
* - `readFile`, `readFileBytes`, `fsReadRange`, `fsReadRangeUncached` and
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* session's `_rpc*` methods — `host` IS the session — exactly as the
|
|
16
16
|
* canonical route table maps them.
|
|
17
17
|
*/
|
|
18
|
-
import { type SupervisorOpBridgeStore, type SupervisorOpEnvelope } from '@nimbus-sh/core/workspace/supervisor-op.js';
|
|
19
|
-
import type {
|
|
18
|
+
import { type SupervisorOpBridgeStore, type SupervisorOpEnvelope, type SupervisorOpHost } from '@nimbus-sh/core/workspace/supervisor-op.js';
|
|
19
|
+
import type { RuntimeFsBridge, NimbusFilesystemAuthority } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
20
20
|
import type { SqliteVFS } from '@nimbus-sh/core/vfs/sqlite-vfs.js';
|
|
21
21
|
import type { SessionProcessSupervisor } from '@nimbus-sh/core/runtime/session-process-supervisor.js';
|
|
22
22
|
/**
|
|
@@ -29,14 +29,19 @@ export interface SessionSupervisorHost {
|
|
|
29
29
|
ensureSqliteFs(): void;
|
|
30
30
|
readonly sqliteFs: SqliteVFS | null;
|
|
31
31
|
readonly processes: SessionProcessSupervisor;
|
|
32
|
+
readonly runtimeWorkspace?: {
|
|
33
|
+
filesystem: NimbusFilesystemAuthority;
|
|
34
|
+
} | null;
|
|
35
|
+
getFilesystemAuthority?(): NimbusFilesystemAuthority;
|
|
32
36
|
_rpcStdout(pid: number, data: Uint8Array): Promise<void>;
|
|
33
37
|
_rpcStderr(pid: number, data: Uint8Array): Promise<void>;
|
|
34
38
|
}
|
|
35
39
|
export interface SessionSupervisorOps {
|
|
36
40
|
readonly dispatch: (envelope: SupervisorOpEnvelope) => Promise<unknown>;
|
|
37
|
-
readonly bridge: (pid?: number) =>
|
|
41
|
+
readonly bridge: (pid?: number) => RuntimeFsBridge;
|
|
38
42
|
/** Drop a pid's bridge — a process exit ends its credential's validity. */
|
|
39
43
|
readonly forget: (pid: number) => void;
|
|
44
|
+
readonly dispose: () => Promise<void>;
|
|
40
45
|
}
|
|
41
|
-
export declare function buildSessionSupervisorOps(host: SessionSupervisorHost, store?: SupervisorOpBridgeStore): SessionSupervisorOps;
|
|
46
|
+
export declare function buildSessionSupervisorOps(host: SessionSupervisorHost, store?: SupervisorOpBridgeStore, methods?: SupervisorOpHost): SessionSupervisorOps;
|
|
42
47
|
//# sourceMappingURL=supervisor-op.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor-op.d.ts","sourceRoot":"","sources":["../../src/session/supervisor-op.ts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2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAQD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,qBAAqB,EAC3B,KAAK,CAAC,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,gBAAgB,GACzB,oBAAoB,CA8CtB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* surface, so the same code serves process facets, the facet loopback stubs
|
|
5
5
|
* and the SDK's direct `_rpc*` calls.
|
|
6
6
|
*
|
|
7
|
-
* - The native filesystem ops
|
|
7
|
+
* - The native filesystem ops core's handler defines run in-process against
|
|
8
8
|
* the shared bridge store — the same cache `supervisorBridge` hands the
|
|
9
9
|
* handle-based and append RPC bodies.
|
|
10
10
|
* - `readFile`, `readFileBytes`, `fsReadRange`, `fsReadRangeUncached` and
|
|
@@ -15,58 +15,21 @@
|
|
|
15
15
|
* session's `_rpc*` methods — `host` IS the session — exactly as the
|
|
16
16
|
* canonical route table maps them.
|
|
17
17
|
*/
|
|
18
|
-
import { createSupervisorOpHandler, createSupervisorBridgeStore, } from '@nimbus-sh/core/workspace/supervisor-op.js';
|
|
19
|
-
import {
|
|
20
|
-
import { dec } from '@nimbus-sh/core/_shared/bytes.js';
|
|
18
|
+
import { createSupervisorOpHandler, createSupervisorBridgeStore, SUPERVISOR_OP_ROUTES, } from '@nimbus-sh/core/workspace/supervisor-op.js';
|
|
19
|
+
import { withReadAllocation } from './rpc.js';
|
|
21
20
|
/** The stdout/stderr ops carry bytes; anything else is a caller bug, named. */
|
|
22
21
|
function outputBytesArg(value) {
|
|
23
22
|
if (value instanceof Uint8Array)
|
|
24
23
|
return value;
|
|
25
24
|
throw new Error(`supervisor op stdout/stderr: expected bytes, got ${typeof value}`);
|
|
26
25
|
}
|
|
27
|
-
export function buildSessionSupervisorOps(host, store) {
|
|
26
|
+
export function buildSessionSupervisorOps(host, store, methods) {
|
|
28
27
|
host.ensureSqliteFs();
|
|
29
|
-
|
|
28
|
+
const vfs = host.sqliteFs;
|
|
29
|
+
if (!vfs)
|
|
30
|
+
throw new Error('Supervisor filesystem is not initialized');
|
|
31
|
+
store ??= createSupervisorBridgeStore({ vfs, processes: host.processes, filesystem: host.getFilesystemAuthority?.() ?? host.runtimeWorkspace?.filesystem });
|
|
30
32
|
const extend = {
|
|
31
|
-
// The native ops whose session bodies carry accounting the bridge
|
|
32
|
-
// alone doesn't know: a read lease sized to what the file can return.
|
|
33
|
-
readFile: async (envelope, tools) => {
|
|
34
|
-
const path = envelope.args?.[0];
|
|
35
|
-
const fs = tools.bridge(envelope.pid, envelope.cred);
|
|
36
|
-
const stat = await fs.stat(path);
|
|
37
|
-
if (!stat)
|
|
38
|
-
return null;
|
|
39
|
-
return withReadAllocation(stat.size, async () => {
|
|
40
|
-
const bytes = await fs.readFile(path);
|
|
41
|
-
return bytes ? dec.decode(bytes) : null;
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
readFileBytes: async (envelope, tools) => {
|
|
45
|
-
const path = envelope.args?.[0];
|
|
46
|
-
const fs = tools.bridge(envelope.pid, envelope.cred);
|
|
47
|
-
const stat = await fs.stat(path);
|
|
48
|
-
if (!stat)
|
|
49
|
-
return null;
|
|
50
|
-
return withReadAllocation(stat.size, () => fs.readFile(path));
|
|
51
|
-
},
|
|
52
|
-
fsReadRange: async (envelope, tools) => {
|
|
53
|
-
const args = FsReadRangeArgsSchema.parse({
|
|
54
|
-
path: envelope.args?.[0],
|
|
55
|
-
offset: envelope.args?.[1],
|
|
56
|
-
length: envelope.args?.[2],
|
|
57
|
-
});
|
|
58
|
-
const fs = tools.bridge(envelope.pid, envelope.cred);
|
|
59
|
-
return withReadAllocation(await rangeReadBytes(fs, args.path, args.offset, args.length), () => fs.readRange(args.path, args.offset, args.length));
|
|
60
|
-
},
|
|
61
|
-
fsReadRangeUncached: async (envelope, tools) => {
|
|
62
|
-
const args = FsReadRangeArgsSchema.parse({
|
|
63
|
-
path: envelope.args?.[0],
|
|
64
|
-
offset: envelope.args?.[1],
|
|
65
|
-
length: envelope.args?.[2],
|
|
66
|
-
});
|
|
67
|
-
const fs = tools.bridge(envelope.pid, envelope.cred);
|
|
68
|
-
return withReadAllocation(await rangeReadBytes(fs, args.path, args.offset, args.length), () => fs.readRange(args.path, args.offset, args.length, { cached: false }));
|
|
69
|
-
},
|
|
70
33
|
// The write stream's decode-drain timestamp starts when the envelope
|
|
71
34
|
// arrives, not when the DO first reads it — the same contract
|
|
72
35
|
// _rpcWriteBatchStream has always had.
|
|
@@ -79,7 +42,7 @@ export function buildSessionSupervisorOps(host, store) {
|
|
|
79
42
|
if (pid !== undefined && (!Number.isInteger(pid) || pid <= 0)) {
|
|
80
43
|
throw new Error('filesystem RPC requires a valid process pid');
|
|
81
44
|
}
|
|
82
|
-
return tools.
|
|
45
|
+
return tools.bridge(pid, envelope.cred).writeStream(envelope.stream, {
|
|
83
46
|
decodeDrainStartedAt: performance.now(),
|
|
84
47
|
mutationOwner: envelope.mutationOwner,
|
|
85
48
|
});
|
|
@@ -94,9 +57,19 @@ export function buildSessionSupervisorOps(host, store) {
|
|
|
94
57
|
processes: host.processes,
|
|
95
58
|
// The session IS the host — its _rpc* methods are the route table's
|
|
96
59
|
// targets. The index signature exists on the declared surface only.
|
|
97
|
-
host:
|
|
60
|
+
host: methods ?? Object.fromEntries(Object.values(SUPERVISOR_OP_ROUTES).map(({ method }) => [
|
|
61
|
+
method,
|
|
62
|
+
(...args) => {
|
|
63
|
+
const handler = Reflect.get(host, method);
|
|
64
|
+
if (typeof handler !== 'function')
|
|
65
|
+
throw new Error(`supervisor op: missing host method ${method}`);
|
|
66
|
+
return Reflect.apply(handler, host, args);
|
|
67
|
+
},
|
|
68
|
+
])),
|
|
98
69
|
bridge: store,
|
|
70
|
+
// Every native read holds a lease for the payload it can answer with.
|
|
71
|
+
readLease: withReadAllocation,
|
|
99
72
|
extend,
|
|
100
73
|
});
|
|
101
|
-
return { dispatch, bridge: store.bridge, forget: store.forget };
|
|
74
|
+
return { dispatch, bridge: store.bridge, forget: store.forget, dispose: store.dispose };
|
|
102
75
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*/
|
|
31
31
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
32
32
|
import type { PackumentReadThrough } from '../npm/r2-cache.js';
|
|
33
|
-
import type { VfsAcquireResult, VfsListPage } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
33
|
+
import type { VfsAcquireResult, VfsListPage, RuntimeFsBridge, RuntimeFsPath, RuntimeOpenFlags, RuntimeFileHandle } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
34
34
|
import type { WriteBatchStreamResult } from '@nimbus-sh/core/vfs/sqlite-vfs.js';
|
|
35
35
|
import type { FsReadBatchEntry, FsReadBatchRequest } from './rpc.js';
|
|
36
36
|
import type { CacheTier, CacheKind } from '@nimbus-sh/core/_shared/cache-stats.js';
|
|
@@ -67,29 +67,31 @@ export declare class SupervisorRPC extends WorkerEntrypoint {
|
|
|
67
67
|
* Read a file as raw bytes. Used by the git network facet for binary
|
|
68
68
|
* object/pack files where the text readFile would corrupt content.
|
|
69
69
|
*/
|
|
70
|
-
readFileBytes(path:
|
|
71
|
-
writeFile(path:
|
|
72
|
-
stat(path:
|
|
70
|
+
readFileBytes(path: RuntimeFsPath): Promise<Uint8Array | null>;
|
|
71
|
+
writeFile(path: RuntimeFsPath, content: string | Uint8Array): Promise<number>;
|
|
72
|
+
stat(path: RuntimeFsPath, options?: {
|
|
73
|
+
followSymlinks?: boolean;
|
|
74
|
+
}): Promise<Awaited<ReturnType<RuntimeFsBridge['stat']>>>;
|
|
73
75
|
lstat(path: string): Promise<any>;
|
|
74
76
|
hasLegacySymlinkUnder(path: string): Promise<boolean>;
|
|
75
|
-
utimes(path:
|
|
76
|
-
chmod(path:
|
|
77
|
-
access(path:
|
|
78
|
-
chown(path:
|
|
77
|
+
utimes(path: RuntimeFsPath, atimeMs: number, mtimeMs: number): Promise<void>;
|
|
78
|
+
chmod(path: RuntimeFsPath, mode: number): Promise<void>;
|
|
79
|
+
access(path: RuntimeFsPath, mode: number): Promise<void>;
|
|
80
|
+
chown(path: RuntimeFsPath, uid: number, gid: number, options?: {
|
|
79
81
|
followSymlinks?: boolean;
|
|
80
82
|
}): Promise<void>;
|
|
81
83
|
setUmask(mask: number): Promise<number>;
|
|
82
|
-
readdir(path:
|
|
84
|
+
readdir(path: RuntimeFsPath): Promise<{
|
|
83
85
|
name: string;
|
|
84
86
|
type: string;
|
|
85
87
|
}[]>;
|
|
86
88
|
exists(path: string): Promise<boolean>;
|
|
87
|
-
mkdir(path:
|
|
88
|
-
rmdir(path:
|
|
89
|
-
rename(from:
|
|
90
|
-
unlink(path:
|
|
91
|
-
readlink(path:
|
|
92
|
-
symlink(target: string, path:
|
|
89
|
+
mkdir(path: RuntimeFsPath, options?: Parameters<RuntimeFsBridge['mkdir']>[1]): Promise<void>;
|
|
90
|
+
rmdir(path: RuntimeFsPath): Promise<void>;
|
|
91
|
+
rename(from: RuntimeFsPath, to: RuntimeFsPath): Promise<void>;
|
|
92
|
+
unlink(path: RuntimeFsPath): Promise<void>;
|
|
93
|
+
readlink(path: RuntimeFsPath): Promise<string | null>;
|
|
94
|
+
symlink(target: string, path: RuntimeFsPath): Promise<void>;
|
|
93
95
|
/**
|
|
94
96
|
* ACQUIRE: the paths mutated since the facet's cursor, plus a fresh
|
|
95
97
|
* cursor. The facet drops those cells from its resident set before
|
|
@@ -136,9 +138,24 @@ export declare class SupervisorRPC extends WorkerEntrypoint {
|
|
|
136
138
|
wsPoll(id: number, waitMs: number): Promise<unknown[]>;
|
|
137
139
|
wsSend(id: number, text: string | null, bytes: Uint8Array | null): Promise<void>;
|
|
138
140
|
wsClose(id: number, code?: number, reason?: string): Promise<void>;
|
|
139
|
-
fsOpen(path:
|
|
141
|
+
fsOpen(path: RuntimeFsPath, flags: RuntimeOpenFlags): Promise<RuntimeFileHandle>;
|
|
140
142
|
fsRead(handleId: number, offset: number | null, length: number): Promise<Uint8Array>;
|
|
141
143
|
fsWrite(handleId: number, offset: number | null, bytes: Uint8Array | ArrayBuffer | number[]): Promise<number>;
|
|
144
|
+
fsFstat(...args: Parameters<RuntimeFsBridge['fstat']>): Promise<Awaited<ReturnType<RuntimeFsBridge['fstat']>>>;
|
|
145
|
+
fsDup(...args: Parameters<RuntimeFsBridge['dup']>): Promise<Awaited<ReturnType<RuntimeFsBridge['dup']>>>;
|
|
146
|
+
fsSeek(...args: Parameters<RuntimeFsBridge['seek']>): Promise<Awaited<ReturnType<RuntimeFsBridge['seek']>>>;
|
|
147
|
+
fsSetStatus(...args: Parameters<RuntimeFsBridge['setStatus']>): Promise<Awaited<ReturnType<RuntimeFsBridge['setStatus']>>>;
|
|
148
|
+
fsReaddirHandle(...args: Parameters<RuntimeFsBridge['readdirHandle']>): Promise<Awaited<ReturnType<RuntimeFsBridge['readdirHandle']>>>;
|
|
149
|
+
fsFtruncate(...args: Parameters<RuntimeFsBridge['ftruncate']>): Promise<Awaited<ReturnType<RuntimeFsBridge['ftruncate']>>>;
|
|
150
|
+
fsFchmod(...args: Parameters<RuntimeFsBridge['fchmod']>): Promise<Awaited<ReturnType<RuntimeFsBridge['fchmod']>>>;
|
|
151
|
+
fsFchown(...args: Parameters<RuntimeFsBridge['fchown']>): Promise<Awaited<ReturnType<RuntimeFsBridge['fchown']>>>;
|
|
152
|
+
fsFutimes(...args: Parameters<RuntimeFsBridge['futimes']>): Promise<Awaited<ReturnType<RuntimeFsBridge['futimes']>>>;
|
|
153
|
+
fsSync(...args: Parameters<RuntimeFsBridge['fsync']>): Promise<Awaited<ReturnType<RuntimeFsBridge['fsync']>>>;
|
|
154
|
+
fsRealpath(...args: Parameters<RuntimeFsBridge['realpath']>): Promise<Awaited<ReturnType<RuntimeFsBridge['realpath']>>>;
|
|
155
|
+
fsRemove(...args: Parameters<RuntimeFsBridge['remove']>): Promise<Awaited<ReturnType<RuntimeFsBridge['remove']>>>;
|
|
156
|
+
fsCopyFile(...args: Parameters<RuntimeFsBridge['copyFile']>): Promise<Awaited<ReturnType<RuntimeFsBridge['copyFile']>>>;
|
|
157
|
+
fsAcquireExclusiveMutation(...args: Parameters<RuntimeFsBridge['acquireExclusiveMutation']>): Promise<Awaited<ReturnType<RuntimeFsBridge['acquireExclusiveMutation']>>>;
|
|
158
|
+
fsReleaseExclusiveMutation(...args: Parameters<RuntimeFsBridge['releaseExclusiveMutation']>): Promise<Awaited<ReturnType<RuntimeFsBridge['releaseExclusiveMutation']>>>;
|
|
142
159
|
fsClose(handleId: number): Promise<void>;
|
|
143
160
|
/**
|
|
144
161
|
* Stateless ranged ops. Unlike fsOpen/fsRead/fsWrite they carry no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor-rpc.d.ts","sourceRoot":"","sources":["../../src/session/supervisor-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAStD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"supervisor-rpc.d.ts","sourceRoot":"","sources":["../../src/session/supervisor-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAStD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CA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E,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,UAAU,CAAA;SAAE,EAAE,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAItF,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,UAAU,CAAC;QAAC,MAAM,EAAE,UAAU,CAAC;QAAC,YAAY,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAE,CAAC;IAIlI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAI1H;;;;;;;OAOG;IACG,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACtD,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;KAClD,CAAC;CAGH"}
|
|
@@ -151,8 +151,8 @@ export class SupervisorRPC extends WorkerEntrypoint {
|
|
|
151
151
|
// Uint8Array transparently; downstream _rpcWriteFile also accepts
|
|
152
152
|
return this._call(this._fsOp('writeFile', [path, content]));
|
|
153
153
|
}
|
|
154
|
-
async stat(path) {
|
|
155
|
-
return this._call(this._fsOp('stat', [path]));
|
|
154
|
+
async stat(path, options) {
|
|
155
|
+
return this._call(this._fsOp('stat', [path, options]));
|
|
156
156
|
}
|
|
157
157
|
async lstat(path) {
|
|
158
158
|
return this._call(this._fsOp('lstat', [path]));
|
|
@@ -181,8 +181,8 @@ export class SupervisorRPC extends WorkerEntrypoint {
|
|
|
181
181
|
async exists(path) {
|
|
182
182
|
return this._call(this._fsOp('exists', [path]));
|
|
183
183
|
}
|
|
184
|
-
async mkdir(path) {
|
|
185
|
-
return this._call(this._fsOp('mkdir', [path]));
|
|
184
|
+
async mkdir(path, options) {
|
|
185
|
+
return this._call(this._fsOp('mkdir', [path, options]));
|
|
186
186
|
}
|
|
187
187
|
async rmdir(path) {
|
|
188
188
|
return this._call(this._fsOp('rmdir', [path]));
|
|
@@ -265,6 +265,51 @@ export class SupervisorRPC extends WorkerEntrypoint {
|
|
|
265
265
|
async fsWrite(handleId, offset, bytes) {
|
|
266
266
|
return this._call(this._fsOp('fsWrite', [handleId, offset, bytes]));
|
|
267
267
|
}
|
|
268
|
+
async fsFstat(...args) {
|
|
269
|
+
return this._call(this._fsOp('fsFstat', args));
|
|
270
|
+
}
|
|
271
|
+
async fsDup(...args) {
|
|
272
|
+
return this._call(this._fsOp('fsDup', args));
|
|
273
|
+
}
|
|
274
|
+
async fsSeek(...args) {
|
|
275
|
+
return this._call(this._fsOp('fsSeek', args));
|
|
276
|
+
}
|
|
277
|
+
async fsSetStatus(...args) {
|
|
278
|
+
return this._call(this._fsOp('fsSetStatus', args));
|
|
279
|
+
}
|
|
280
|
+
async fsReaddirHandle(...args) {
|
|
281
|
+
return this._call(this._fsOp('fsReaddirHandle', args));
|
|
282
|
+
}
|
|
283
|
+
async fsFtruncate(...args) {
|
|
284
|
+
return this._call(this._fsOp('fsFtruncate', args));
|
|
285
|
+
}
|
|
286
|
+
async fsFchmod(...args) {
|
|
287
|
+
return this._call(this._fsOp('fsFchmod', args));
|
|
288
|
+
}
|
|
289
|
+
async fsFchown(...args) {
|
|
290
|
+
return this._call(this._fsOp('fsFchown', args));
|
|
291
|
+
}
|
|
292
|
+
async fsFutimes(...args) {
|
|
293
|
+
return this._call(this._fsOp('fsFutimes', args));
|
|
294
|
+
}
|
|
295
|
+
async fsSync(...args) {
|
|
296
|
+
return this._call(this._fsOp('fsSync', args));
|
|
297
|
+
}
|
|
298
|
+
async fsRealpath(...args) {
|
|
299
|
+
return this._call(this._fsOp('fsRealpath', args));
|
|
300
|
+
}
|
|
301
|
+
async fsRemove(...args) {
|
|
302
|
+
return this._call(this._fsOp('fsRemove', args));
|
|
303
|
+
}
|
|
304
|
+
async fsCopyFile(...args) {
|
|
305
|
+
return this._call(this._fsOp('fsCopyFile', args));
|
|
306
|
+
}
|
|
307
|
+
async fsAcquireExclusiveMutation(...args) {
|
|
308
|
+
return this._call(this._fsOp('fsAcquireExclusiveMutation', args));
|
|
309
|
+
}
|
|
310
|
+
async fsReleaseExclusiveMutation(...args) {
|
|
311
|
+
return this._call(this._fsOp('fsReleaseExclusiveMutation', args));
|
|
312
|
+
}
|
|
268
313
|
async fsClose(handleId) {
|
|
269
314
|
return this._call(this._fsOp('fsClose', [handleId]));
|
|
270
315
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet-resident-store.d.ts","sourceRoot":"","sources":["../../src/vfs/facet-resident-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqLG;AAQH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,UAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,OAA2B,CAAC;AAClE,eAAO,MAAM,yBAAyB,QAA8B,CAAC;AAErE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"facet-resident-store.d.ts","sourceRoot":"","sources":["../../src/vfs/facet-resident-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqLG;AAQH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,UAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,OAA2B,CAAC;AAClE,eAAO,MAAM,yBAAyB,QAA8B,CAAC;AAErE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,QAo3BhC,CAAC;AAET,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG;IAAE,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1D,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE"}
|
|
@@ -795,7 +795,7 @@ async function __residentEnumerate(supervisor) {
|
|
|
795
795
|
if (!Number.isSafeInteger(size) || size < 0 || !Number.isSafeInteger(rev) || rev < 0) {
|
|
796
796
|
throw new Error("Nimbus: fsList returned unusable metadata for '" + path + "'");
|
|
797
797
|
}
|
|
798
|
-
entries.push({ path, size, rev });
|
|
798
|
+
entries.push({ path, size, rev, epoch: cursor.epoch });
|
|
799
799
|
}
|
|
800
800
|
if (listed.next === null || listed.next === undefined) {
|
|
801
801
|
return { entries, cursor, complete: true, reason: null };
|
|
@@ -844,6 +844,7 @@ async function __residentFetchFiles(supervisor, files) {
|
|
|
844
844
|
ranges.push({
|
|
845
845
|
path: file.path,
|
|
846
846
|
rev: file.rev,
|
|
847
|
+
epoch: file.epoch,
|
|
847
848
|
part,
|
|
848
849
|
parts,
|
|
849
850
|
offset,
|
|
@@ -874,7 +875,7 @@ async function __residentFetchFiles(supervisor, files) {
|
|
|
874
875
|
let results;
|
|
875
876
|
try {
|
|
876
877
|
results = await supervisor.fsReadBatch(
|
|
877
|
-
batch.map((r) => ({ path: r.path, offset: r.offset, length: r.length }))
|
|
878
|
+
batch.map((r) => ({ path: r.path, offset: r.offset, length: r.length, expectedEpoch: r.epoch, expectedRevision: r.rev }))
|
|
878
879
|
);
|
|
879
880
|
} catch {
|
|
880
881
|
for (const r of batch) failedPaths.add(r.path);
|
|
@@ -896,6 +897,7 @@ async function __residentFetchFiles(supervisor, files) {
|
|
|
896
897
|
}
|
|
897
898
|
if (entry.bytes === null || entry.bytes === undefined) { failedPaths.add(range.path); continue; }
|
|
898
899
|
const chunk = __residentBytes(entry.bytes);
|
|
900
|
+
if (chunk.byteLength !== range.length) { failedPaths.add(range.path); continue; }
|
|
899
901
|
fetchedBytes += chunk.byteLength;
|
|
900
902
|
__residentPutChunk(__residentSql, range.path, range.part, chunk);
|
|
901
903
|
const seen = (landed.get(range.path) || 0) + 1;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { composeFacetManager, type FacetManagerDeps, type FacetManagerHostHooks, type ComposedFacetManager } from './facets/compose.js';
|
|
2
|
+
export type { WorkerRecipe, ResolvedWorkerLaunch } from './facets/manager.js';
|
|
3
|
+
export { composeHostedRuntime, type HostedRuntime, type HostedRuntimeOptions, type HostedRuntimeLifecycle, type HostedRuntimeTask, type RuntimeFiles } from './hosted/runtime.js';
|
|
4
|
+
export { runtimeCatalogSource } from './runtime/runtime-catalog.js';
|
|
5
|
+
export { SupervisorRPC } from './session/supervisor-rpc.js';
|
|
6
|
+
export { NimbusAssetsRPC, NimbusLoaderRPC, NimbusLoadedWorker, NimbusLoadedEntrypoint, NimbusDurableObjectNamespace, NimbusDOStub } from '@nimbus-sh/fabric/bindings.js';
|
|
7
|
+
//# sourceMappingURL=workspace-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-host.d.ts","sourceRoot":"","sources":["../src/workspace-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACxI,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClL,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { composeFacetManager } from './facets/compose.js';
|
|
2
|
+
export { composeHostedRuntime } from './hosted/runtime.js';
|
|
3
|
+
export { runtimeCatalogSource } from './runtime/runtime-catalog.js';
|
|
4
|
+
export { SupervisorRPC } from './session/supervisor-rpc.js';
|
|
5
|
+
export { NimbusAssetsRPC, NimbusLoaderRPC, NimbusLoadedWorker, NimbusLoadedEntrypoint, NimbusDurableObjectNamespace, NimbusDOStub } from '@nimbus-sh/fabric/bindings.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NimbusWorkspace } from '@nimbus-sh/core/workspace';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbus-sh/worker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Nimbus runtime package for Cloudflare Workers, re-exported publicly through @nimbus-sh/sdk/worker.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"import": "./dist/index.js"
|
|
30
30
|
},
|
|
31
31
|
"./workspace": {
|
|
32
|
-
"workspace": "./src/workspace
|
|
33
|
-
"types": "./dist/workspace
|
|
34
|
-
"import": "./dist/workspace
|
|
32
|
+
"workspace": "./src/workspace.ts",
|
|
33
|
+
"types": "./dist/workspace.d.ts",
|
|
34
|
+
"import": "./dist/workspace.js"
|
|
35
35
|
},
|
|
36
36
|
"./router": {
|
|
37
37
|
"workspace": "./src/router/index.ts",
|
|
@@ -54,9 +54,14 @@
|
|
|
54
54
|
"import": "./dist/_shared/preview-host.js"
|
|
55
55
|
},
|
|
56
56
|
"./workspace-host": {
|
|
57
|
-
"workspace": "./src/
|
|
58
|
-
"types": "./dist/
|
|
59
|
-
"import": "./dist/
|
|
57
|
+
"workspace": "./src/workspace-host.ts",
|
|
58
|
+
"types": "./dist/workspace-host.d.ts",
|
|
59
|
+
"import": "./dist/workspace-host.js"
|
|
60
|
+
},
|
|
61
|
+
"./facet-host": {
|
|
62
|
+
"workspace": "./src/runtime/facet-loader-host.ts",
|
|
63
|
+
"types": "./dist/runtime/facet-loader-host.d.ts",
|
|
64
|
+
"import": "./dist/runtime/facet-loader-host.js"
|
|
60
65
|
},
|
|
61
66
|
"./port-capability": {
|
|
62
67
|
"workspace": "./src/session/port-capability.ts",
|
|
@@ -98,15 +103,15 @@
|
|
|
98
103
|
"bundle:agent-chat": "node scripts/bundle-agent-chat.mjs",
|
|
99
104
|
"bundle": "bun run bundle:git && bun run bundle:facets && bun run bundle:esbuild && bun run bundle:sqlite && bun run bundle:shims && bun run bundle:tailwind && bun run bundle:opencode && bun run bundle:agent-chat",
|
|
100
105
|
"clean:dist": "node scripts/clean-dist.mjs",
|
|
101
|
-
"build": "
|
|
102
|
-
"prepack": "
|
|
106
|
+
"build": "bun run clean:dist && tsc -p tsconfig.json --noCheck --noEmit false --declaration true --declarationMap true --outDir dist --rootDir src",
|
|
107
|
+
"prepack": "bun run build",
|
|
103
108
|
"typecheck": "tsc --noEmit && tsc -p frontend --noEmit"
|
|
104
109
|
},
|
|
105
110
|
"dependencies": {
|
|
106
111
|
"@ai-sdk/openai-compatible": "^2.0.41",
|
|
107
|
-
"@nimbus-sh/core": "^0.
|
|
108
|
-
"@nimbus-sh/fabric": "^0.
|
|
109
|
-
"@nimbus-sh/platform": "^0.
|
|
112
|
+
"@nimbus-sh/core": "^0.11.0",
|
|
113
|
+
"@nimbus-sh/fabric": "^0.7.0",
|
|
114
|
+
"@nimbus-sh/platform": "^0.5.0",
|
|
110
115
|
"@renovatebot/pep440": "^5.0.0",
|
|
111
116
|
"ai": "^6.0.182",
|
|
112
117
|
"clean-git-ref": "^2.0.1",
|
package/public/_assets/runtime/{node-shims-8f8c64edd2a1f0f5.js → node-shims-acaa037e6d26ec0d.js}
RENAMED
|
@@ -7712,7 +7712,20 @@ builtins.tty = {
|
|
|
7712
7712
|
// core and must not be reported as such — a package that sniffs this list
|
|
7713
7713
|
// would otherwise conclude e.g. undici ships with node.
|
|
7714
7714
|
const __nimbusFacetProvidedPackages = new Set(["undici"]);
|
|
7715
|
-
builtins.module = {
|
|
7715
|
+
builtins.module = {
|
|
7716
|
+
get builtinModules() { return Object.keys(builtins).filter((n) => !__nimbusFacetProvidedPackages.has(n)); },
|
|
7717
|
+
createRequire: (specifier) => __makeRequire(__requireBaseDir(specifier)),
|
|
7718
|
+
isBuiltin: (specifier) => Object.hasOwn(builtins, String(specifier).replace(/^node:/, '')) && !__nimbusFacetProvidedPackages.has(String(specifier).replace(/^node:/, '')),
|
|
7719
|
+
// Node 22.1's on-disk compile cache. There is no disk to cache into and
|
|
7720
|
+
// nothing to compile ahead: callers (pi's CLI entry calls it
|
|
7721
|
+
// unconditionally) get Node's own answer for a cache that is off.
|
|
7722
|
+
enableCompileCache: () => ({ status: 3, message: 'compile cache is not available in this runtime' }),
|
|
7723
|
+
getCompileCacheDir: () => undefined,
|
|
7724
|
+
flushCompileCache: () => {},
|
|
7725
|
+
constants: { compileCacheStatus: { FAILED: 0, ENABLED: 1, ALREADY_ENABLED: 2, DISABLED: 3 } },
|
|
7726
|
+
_resolveFilename: (id) => id,
|
|
7727
|
+
_cache: {},
|
|
7728
|
+
};
|
|
7716
7729
|
// Bind to globalThis: workerd's timer globals throw "Illegal invocation"
|
|
7717
7730
|
// when called with a receiver other than globalThis (i.e. as
|
|
7718
7731
|
// timers.setInterval(...)), which clack's spinner — used by
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* node scripts/bundle-runtime.mjs clang binji-2020 [--bucket nimbus-runtime-cache]
|
|
8
8
|
* node scripts/bundle-runtime.mjs python 0.29.4 [--bucket nimbus-runtime-cache]
|
|
9
9
|
* node scripts/bundle-runtime.mjs --pin-catalog (read-only; publishes nothing)
|
|
10
|
-
* node scripts/bundle-runtime.mjs bash 5.2.37 --npm-package <dir> (local; no R2)
|
|
10
|
+
* node scripts/bundle-runtime.mjs bash 5.2.37-2 --npm-package <dir> (local; no R2)
|
|
11
11
|
*
|
|
12
12
|
* `--npm-package` is the SECOND publisher for the same artifacts: it stages
|
|
13
13
|
* exactly what the R2 path stages, composes the same manifest bytes, and lays
|
|
@@ -50,6 +50,7 @@ import { mkdirSync, readFileSync, writeFileSync, existsSync, rmSync, openSync, c
|
|
|
50
50
|
import { execFileSync, execSync, spawnSync } from 'node:child_process';
|
|
51
51
|
import { tmpdir } from 'node:os';
|
|
52
52
|
import { basename, dirname, join } from 'node:path';
|
|
53
|
+
import { BASH_RUNNER } from '@nimbus-sh/core/runtime/os-contracts.js';
|
|
53
54
|
|
|
54
55
|
const ACCOUNT = process.env.CLOUDFLARE_ACCOUNT_ID;
|
|
55
56
|
// Resolve the wrangler bin from either the package-local or the
|
|
@@ -64,9 +65,14 @@ const PYODIDE_WORKERD_ADAPTER = JSON.parse(
|
|
|
64
65
|
);
|
|
65
66
|
|
|
66
67
|
const USAGE =
|
|
67
|
-
'usage: bundle-runtime.mjs <name> <version> [--bucket <bucket>]\n' +
|
|
68
|
+
'usage: bundle-runtime.mjs <name> <version> [--bucket <bucket>] [--keep-default]\n' +
|
|
68
69
|
' bundle-runtime.mjs <name> <version> --npm-package <dir>\n' +
|
|
69
|
-
' bundle-runtime.mjs --pin-catalog [--bucket <bucket>]'
|
|
70
|
+
' bundle-runtime.mjs --pin-catalog [--bucket <bucket>]\n' +
|
|
71
|
+
'\n' +
|
|
72
|
+
' --keep-default add the version to the catalog without making it the\n' +
|
|
73
|
+
' default: for a build whose runner contract a deployment\n' +
|
|
74
|
+
' still reading the catalog cannot bind yet. Re-run without\n' +
|
|
75
|
+
' the flag once every deployment can; the re-run is idempotent.';
|
|
70
76
|
|
|
71
77
|
/** The bucket the deployed Worker's NIMBUS_RUNTIME_CACHE binding points at.
|
|
72
78
|
* Only a publish to THIS bucket may rewrite the catalog pin: the pin
|
|
@@ -78,6 +84,7 @@ const rawArgs = process.argv.slice(2);
|
|
|
78
84
|
const positionalArgs = [];
|
|
79
85
|
let BUCKET = process.env.NIMBUS_RUNTIME_BUCKET || PRODUCTION_BUCKET;
|
|
80
86
|
let PIN_ONLY = false;
|
|
87
|
+
let KEEP_DEFAULT = false;
|
|
81
88
|
let NPM_OUT_DIR = null;
|
|
82
89
|
for (let i = 0; i < rawArgs.length; i++) {
|
|
83
90
|
const arg = rawArgs[i];
|
|
@@ -85,6 +92,10 @@ for (let i = 0; i < rawArgs.length; i++) {
|
|
|
85
92
|
PIN_ONLY = true;
|
|
86
93
|
continue;
|
|
87
94
|
}
|
|
95
|
+
if (arg === '--keep-default') {
|
|
96
|
+
KEEP_DEFAULT = true;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
88
99
|
if (arg === '--npm-package') {
|
|
89
100
|
NPM_OUT_DIR = rawArgs[++i];
|
|
90
101
|
if (!NPM_OUT_DIR) {
|
|
@@ -226,10 +237,16 @@ const SPECS = {
|
|
|
226
237
|
// `local_base`. The bash-runner aliases every applet name in
|
|
227
238
|
// busybox.applets onto the busybox module so bash's PATH lookup finds
|
|
228
239
|
// them in /bin and /usr/bin.
|
|
229
|
-
|
|
240
|
+
//
|
|
241
|
+
// The version is `<upstream>-<build>`: the build number advances with
|
|
242
|
+
// every rebuild, and the entrypoint names the runner contract the build
|
|
243
|
+
// was made for (BASH_RUNNER), so a deployment whose preamble predates it
|
|
244
|
+
// never binds it. 5.2.37 is build 1, published under `bash-runner`.
|
|
245
|
+
'bash/5.2.37-2': {
|
|
230
246
|
license: 'GPL-3.0-or-later AND GPL-2.0-only',
|
|
231
247
|
wasi_namespace: 'wasi_snapshot_preview1',
|
|
232
248
|
local_base: '../wasm/bash',
|
|
249
|
+
auxiliary_bins: 'coreutils/busybox.applets',
|
|
233
250
|
npm: {
|
|
234
251
|
name: '@nimbus-sh/runtime-bash',
|
|
235
252
|
summary: 'GNU bash 5.2.37 and BusyBox 1.37.0, cross-compiled to wasm32-wasi',
|
|
@@ -238,7 +255,7 @@ const SPECS = {
|
|
|
238
255
|
{ src: 'bash.async.wasm', vfs: 'share/bash/bash.async.wasm' },
|
|
239
256
|
{ src: 'coreutils/busybox.wasm', vfs: 'share/bash/coreutils/busybox.wasm' },
|
|
240
257
|
{ src: 'coreutils/busybox.applets', vfs: 'share/bash/coreutils/busybox.applets' },
|
|
241
|
-
{ src: 'BIN_MARKER', vfs: 'bin/bash', mode: 'exec', runner:
|
|
258
|
+
{ src: 'BIN_MARKER', vfs: 'bin/bash', mode: 'exec', runner: BASH_RUNNER, binName: 'bash' },
|
|
242
259
|
],
|
|
243
260
|
synthetic_files: {
|
|
244
261
|
'BIN_MARKER': Buffer.from(
|
|
@@ -427,6 +444,15 @@ if (!spec) {
|
|
|
427
444
|
console.error(`known: ${Object.keys(SPECS).join(', ')}`);
|
|
428
445
|
process.exit(2);
|
|
429
446
|
}
|
|
447
|
+
if (spec.auxiliary_bins) {
|
|
448
|
+
const list = new URL(`${spec.local_base}/${spec.auxiliary_bins}`, import.meta.url);
|
|
449
|
+
const names = readFileSync(list, 'utf8').split('\n').filter(Boolean);
|
|
450
|
+
spec.synthetic_files.NIMBUS_AUX_BIN = Buffer.from('Nimbus WASI multicall entry\n');
|
|
451
|
+
for (const name of names) {
|
|
452
|
+
if (name.includes('/') || name === '.' || name === '..') throw new Error(`Invalid multicall entry: ${name}`);
|
|
453
|
+
spec.files.push({ src: 'NIMBUS_AUX_BIN', vfs: `bin/${name}`, mode: 'exec' });
|
|
454
|
+
}
|
|
455
|
+
}
|
|
430
456
|
// Checked before anything is staged: which runtimes we publish to npm is a
|
|
431
457
|
// decision, and a spec that has not made it should cost nothing to find out.
|
|
432
458
|
if (NPM_OUT_DIR) {
|
|
@@ -617,8 +643,9 @@ if (spec.ingest_only) {
|
|
|
617
643
|
license: spec.license,
|
|
618
644
|
};
|
|
619
645
|
// Update default to the just-uploaded version (idempotent — if it was
|
|
620
|
-
// already the default, no-op)
|
|
621
|
-
|
|
646
|
+
// already the default, no-op), unless the publisher asked to hold it for
|
|
647
|
+
// deployments that cannot bind this build yet.
|
|
648
|
+
if (!KEEP_DEFAULT) catalog.runtimes[RUNTIME].default = VERSION;
|
|
622
649
|
|
|
623
650
|
// The catalog indexes every runtime, so an update that drops one is a
|
|
624
651
|
// publish that unregisters somebody else's. Cheap to assert, and it catches
|
|
@@ -644,7 +671,7 @@ if (spec.ingest_only) {
|
|
|
644
671
|
console.log(`\n[bundle-runtime] DONE`);
|
|
645
672
|
console.log(`[bundle-runtime] uploaded ${downloaded.length} files (${totalMb} MiB) for ${RUNTIME}@${VERSION}`);
|
|
646
673
|
console.log(`[bundle-runtime] manifest: r2://${BUCKET}/${manifestR2Key}`);
|
|
647
|
-
console.log(`[bundle-runtime] catalog: r2://${BUCKET}/${catalogR2Key}`);
|
|
674
|
+
console.log(`[bundle-runtime] catalog: r2://${BUCKET}/${catalogR2Key} (default ${catalog.runtimes[RUNTIME].default})`);
|
|
648
675
|
}
|
|
649
676
|
|
|
650
677
|
/**
|