@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
|
@@ -1,152 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* package-manager.ts —
|
|
2
|
+
* package-manager.ts — the Worker's edge of runtime installation.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* The policy moved: installs, singleflight, bin registration and the `nimbus`
|
|
5
|
+
* verb itself live in `@nimbus-sh/core` (`runtime/runtime-manager.ts`,
|
|
6
|
+
* `runtime/nimbus-command.ts`) because a library workspace owns them too.
|
|
7
|
+
* What remains here is what only a Cloudflare host can answer:
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* nimbus install --reinstall <name> force refetch
|
|
11
|
-
* nimbus uninstall <name> remove installed runtime
|
|
12
|
-
*
|
|
13
|
-
* Per-user VFS layout:
|
|
14
|
-
*
|
|
15
|
-
* ~/.nimbus/runtimes/<name>/<version>/
|
|
16
|
-
* manifest.json
|
|
17
|
-
* bin/<entry>
|
|
18
|
-
* share/<name>/...
|
|
19
|
-
* LICENSE
|
|
20
|
-
*
|
|
21
|
-
* Survives DO eviction (SqliteFS-backed). Boot-time rehydration reads
|
|
22
|
-
* every `~/.nimbus/runtimes/STAR/STAR/manifest.json` and re-registers
|
|
23
|
-
* each `entrypoints[].binName` as a shell command pointing at the
|
|
24
|
-
* named runner factory.
|
|
25
|
-
*
|
|
26
|
-
* Errors throw and bubble up to the user as a single diagnostic line.
|
|
9
|
+
* - `runtimeCatalogSource(env)` — the R2-backed RuntimeSource (the digest
|
|
10
|
+
* chain stays in runtime-catalog.ts beside this file's fetchers);
|
|
11
|
+
* - the programmatic entry points the SDK surface calls;
|
|
12
|
+
* - the command-not-found hint resolver init.ts wires into exec dispatch.
|
|
27
13
|
*/
|
|
28
|
-
import { type RuntimeCatalogEnv } from './runtime-catalog.js';
|
|
29
|
-
import {
|
|
30
|
-
import type {
|
|
31
|
-
import {
|
|
32
|
-
import { type
|
|
33
|
-
import type {
|
|
34
|
-
|
|
35
|
-
export
|
|
36
|
-
args: string[];
|
|
37
|
-
env: Record<string, string>;
|
|
38
|
-
cwd: string;
|
|
39
|
-
stdout: {
|
|
40
|
-
write(s: string): void;
|
|
41
|
-
};
|
|
42
|
-
stderr: {
|
|
43
|
-
write(s: string): void;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export interface RuntimeWarmTarget {
|
|
47
|
-
name: string;
|
|
48
|
-
version: string;
|
|
49
|
-
root: string;
|
|
50
|
-
manifest: RuntimeManifest;
|
|
51
|
-
}
|
|
52
|
-
export type RuntimeWarmHook = (target: RuntimeWarmTarget, ctx: ShellCtx) => Promise<void>;
|
|
14
|
+
import { runtimeCatalogSource, type RuntimeCatalogEnv } from './runtime-catalog.js';
|
|
15
|
+
import type { CredentialedVfs } from '@nimbus-sh/core/vfs/sqlite-vfs.js';
|
|
16
|
+
import type { RuntimeManager } from '@nimbus-sh/core/runtime/runtime-manager.js';
|
|
17
|
+
import type { RuntimeAvailability } from '@nimbus-sh/core/runtime/runtime-package.js';
|
|
18
|
+
import { type RuntimeWarmHook } from '@nimbus-sh/core/runtime/nimbus-command.js';
|
|
19
|
+
import type { MinShellRegistry } from '@nimbus-sh/core/runtime/installed-runtimes.js';
|
|
20
|
+
export { runtimeCatalogSource };
|
|
21
|
+
export type { RuntimeWarmHook };
|
|
53
22
|
export interface RuntimeInstallSummary {
|
|
54
23
|
spec: string;
|
|
55
24
|
exitCode: number;
|
|
56
25
|
stdout: string;
|
|
57
26
|
stderr: string;
|
|
58
27
|
}
|
|
59
|
-
export interface RuntimeInstallTarget {
|
|
60
|
-
runtimeName: string;
|
|
61
|
-
versionOverride: string | null;
|
|
62
|
-
requestedName: string;
|
|
63
|
-
}
|
|
64
28
|
export interface RuntimeCommandHint {
|
|
65
29
|
command: string;
|
|
66
30
|
runtimeName: string;
|
|
67
31
|
installSpec: string;
|
|
68
32
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
version: string;
|
|
76
|
-
sizeBytes: number;
|
|
77
|
-
license: string;
|
|
78
|
-
}>;
|
|
79
|
-
}>>;
|
|
33
|
+
/**
|
|
34
|
+
* `nimbus install` without a shell: the same `runNimbusInstall` path the verb
|
|
35
|
+
* runs, with output captured instead of written to a terminal. Deps take the
|
|
36
|
+
* workspace's RuntimeManager — which already holds the source, the registry
|
|
37
|
+
* and the runner factories — rather than a catalog env.
|
|
38
|
+
*/
|
|
80
39
|
export declare function installRuntimeProgrammatic(deps: {
|
|
81
|
-
|
|
82
|
-
vfs: SqliteVFS;
|
|
40
|
+
runtimes: RuntimeManager;
|
|
83
41
|
registry: MinShellRegistry;
|
|
42
|
+
vfs: CredentialedVfs;
|
|
84
43
|
getHome(): string;
|
|
44
|
+
warmRuntime?: RuntimeWarmHook;
|
|
85
45
|
}, spec: string, opts?: {
|
|
86
46
|
force?: boolean;
|
|
87
47
|
}): Promise<RuntimeInstallSummary>;
|
|
88
48
|
export declare function ensureRuntimesProgrammatic(deps: {
|
|
89
|
-
|
|
90
|
-
vfs: SqliteVFS;
|
|
49
|
+
runtimes: RuntimeManager;
|
|
91
50
|
registry: MinShellRegistry;
|
|
51
|
+
vfs: CredentialedVfs;
|
|
92
52
|
getHome(): string;
|
|
53
|
+
warmRuntime?: RuntimeWarmHook;
|
|
93
54
|
}, specs: string[], opts?: {
|
|
94
55
|
force?: boolean;
|
|
95
56
|
}): Promise<RuntimeInstallSummary[]>;
|
|
57
|
+
export declare function listAvailableRuntimes(env: RuntimeCatalogEnv): Promise<RuntimeAvailability[]>;
|
|
96
58
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
export interface NimbusAppVerbs {
|
|
102
|
-
expose(target: number | string, options: {
|
|
103
|
-
visibility?: 'scoped' | 'public';
|
|
104
|
-
name?: string;
|
|
105
|
-
}): Promise<{
|
|
106
|
-
owner: string;
|
|
107
|
-
name: string | null;
|
|
108
|
-
port: number;
|
|
109
|
-
capability: string | null;
|
|
110
|
-
visibility: 'scoped' | 'public';
|
|
111
|
-
url: string | null;
|
|
112
|
-
}>;
|
|
113
|
-
list(): Promise<Array<{
|
|
114
|
-
owner: string;
|
|
115
|
-
name: string | null;
|
|
116
|
-
port: number | null;
|
|
117
|
-
pid: number | null;
|
|
118
|
-
status: string;
|
|
119
|
-
visibility: string;
|
|
120
|
-
restart: string;
|
|
121
|
-
diagnostic: string | null;
|
|
122
|
-
url: string | null;
|
|
123
|
-
}>>;
|
|
124
|
-
rotateLink(target: number | string): Promise<{
|
|
125
|
-
name: string | null;
|
|
126
|
-
port: number;
|
|
127
|
-
url: string | null;
|
|
128
|
-
capability: string | null;
|
|
129
|
-
}>;
|
|
130
|
-
remove(target: number | string): Promise<{
|
|
131
|
-
owner: string;
|
|
132
|
-
removed: boolean;
|
|
133
|
-
port: number | null;
|
|
134
|
-
}>;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Build the shell-command handler that implements `nimbus install …`,
|
|
138
|
-
* `nimbus uninstall …`, `nimbus expose …`, `nimbus app …` and
|
|
139
|
-
* `nimbus start …`. Registered under the name `nimbus`.
|
|
59
|
+
* Command-not-found hints, catalog-driven: a bare name the shell could not
|
|
60
|
+
* resolve is answered with the runtime that provides it, so `python3` hints
|
|
61
|
+
* at cpython and `wasm-ld` at clang. Loaded once and memoized; a fetch
|
|
62
|
+
* failure drops the memo so the next unknown command retries.
|
|
140
63
|
*/
|
|
141
|
-
export declare function
|
|
142
|
-
env: RuntimeCatalogEnv;
|
|
143
|
-
vfs: SqliteVFS;
|
|
144
|
-
registry: MinShellRegistry;
|
|
145
|
-
/** Returns `process.env.HOME` for the session. Computed by the
|
|
146
|
-
* caller (init.ts) from the shell env. */
|
|
147
|
-
getHome(): string;
|
|
148
|
-
warmRuntime?: RuntimeWarmHook;
|
|
149
|
-
/** The application verbs; absent on a host with no session (tests). */
|
|
150
|
-
apps?: NimbusAppVerbs;
|
|
151
|
-
}): (ctx: any) => Promise<number>;
|
|
64
|
+
export declare function createRuntimeCommandHintResolver(env: RuntimeCatalogEnv): (command: string) => Promise<RuntimeCommandHint | null>;
|
|
152
65
|
//# sourceMappingURL=package-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/runtime/package-manager.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../src/runtime/package-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAGL,oBAAoB,EACpB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB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