@deepseek-ai/dsh-experimental-webworker-runtime 0.2.1-alpha.2 → 0.2.1-alpha.4

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Image layout contract shared by the packer and the worker host: the virtual
3
- * root, where the composed config and the manifest sit inside the image, and
4
- * the working directories every image carries empty. One definition, two
3
+ * root, where the manifest sits inside the image, where lazy archives sit beside
4
+ * it, and the working directories every image carries empty. One definition, two
5
5
  * consumers — the packer writes this layout, the worker host mounts it.
6
6
  */
7
7
  /** Default virtual root; the runtime mounts the image here unless told otherwise. */
@@ -12,12 +12,21 @@ export declare const DEFAULT_ROOT = "/dsh";
12
12
  * there, so the extension is part of what a deployment serves.
13
13
  */
14
14
  export declare const IMAGE_FILE_NAME = "vfs-image.tar.gz";
15
- /** Image path the composed profile is written to; the runtime's Loader reads it. */
16
- export declare const IMAGE_CONFIG_PATH = "config/cordis.yml";
17
15
  /** Image path of the manifest the runtime reads before it wraps a single module. */
18
16
  export declare const IMAGE_MANIFEST_PATH = "config/vfs-manifest.json";
17
+ /**
18
+ * Directory, relative to the base image URL, holding the lazy chunk archives:
19
+ * `lazy/<sha256 of the archive>.tar.gz`, one page chunk each.
20
+ */
21
+ export declare const IMAGE_LAZY_DIRECTORY = "lazy";
19
22
  /** Home directory under the root; the process shim's `DSH_HOME`/`HOME` default. */
20
23
  export declare const IMAGE_HOME_DIRECTORY = "home";
24
+ /**
25
+ * Config fields the Worker requires on Loader rows, by row id. The packer writes them into the image's home patch
26
+ * (`home/cordis.patch.yml`) over each row's composed config: the Worker carries no Zstandard codec, so JSONL Session
27
+ * logs stay plaintext.
28
+ */
29
+ export declare const PLATFORM_ENTRY_CONFIG: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
21
30
  /** Working directories the host tree expects to exist, empty. */
22
31
  export declare const IMAGE_EMPTY_DIRECTORIES: readonly string[];
23
32
  /**
@@ -0,0 +1,42 @@
1
+ /** One file a lazy archive supplies. */
2
+ export interface ImageLazyFile {
3
+ /** Path relative to the image root, as the archive names it. */
4
+ readonly path: string;
5
+ /** Byte length of the archived file. */
6
+ readonly size: number;
7
+ }
8
+ /** One archive beside the base image whose files arrive on first asynchronous read. */
9
+ export interface ImageLazyArchive {
10
+ /** Archive path relative to the base image URL. */
11
+ readonly archive: string;
12
+ /** Every file the archive carries. */
13
+ readonly files: readonly ImageLazyFile[];
14
+ }
15
+ /** Fields recorded in the base image's manifest. */
16
+ export interface ImageManifest {
17
+ /** Virtual root the image was packed for. */
18
+ readonly root: string;
19
+ /** Shipped profile template the worker host initializes and boots. */
20
+ readonly profile: string;
21
+ /** Package whose manifest alone anchors bundle resolution; absent in images that boot no tree. */
22
+ readonly installation?: string;
23
+ /** Wrapper contract every packed body was lowered against. */
24
+ readonly lowered: string;
25
+ /** JavaScript entries the image carries, lazy archives excluded. */
26
+ readonly javascriptEntries: number;
27
+ /** Entries the pack-time transform visited. */
28
+ readonly visitedEntries: number;
29
+ /** Visited entries the transform rewrote. */
30
+ readonly rewrittenEntries: number;
31
+ /** Page chunks requested only through `require.async`, one archive each. */
32
+ readonly lazy: readonly ImageLazyArchive[];
33
+ }
34
+ /**
35
+ * Validate a fetched base-image manifest.
36
+ * @param value - Parsed manifest JSON.
37
+ * @param path - Manifest path inside the image, named in refusals.
38
+ * @returns The detached manifest.
39
+ * @throws When the manifest is malformed, or its bodies were lowered against another wrapper contract.
40
+ */
41
+ export declare function parseImageManifest(value: unknown, path: string): ImageManifest;
42
+ //# sourceMappingURL=image-manifest.d.ts.map
@@ -13,11 +13,12 @@ export { lowerModuleSource, type LoweredModule } from './compile/transform.ts';
13
13
  export { API_PREFIX, SYNTHETIC_HOST, TunnelServer, type TunnelPort, type TunnelSeams, type TunnelServerOptions, } from './transport/tunnel.ts';
14
14
  export { installProcessGlobal, type ProcessShim, type ProcessShimOptions } from './node/globals/process.ts';
15
15
  export { createWorkerHost, type WorkerHost, type WorkerHostOptions, } from './worker-host.ts';
16
- export { DEFAULT_ROOT, IMAGE_CONFIG_PATH, IMAGE_EMPTY_DIRECTORIES, IMAGE_FILE_NAME, IMAGE_HOME_DIRECTORY, IMAGE_MANIFEST_PATH, IMAGE_OVERLAY_DIRECTORIES, LOWERING_VERSION, WRAPPER_PARAMS, } from './image-layout.ts';
16
+ export { DEFAULT_ROOT, IMAGE_EMPTY_DIRECTORIES, IMAGE_FILE_NAME, IMAGE_HOME_DIRECTORY, IMAGE_LAZY_DIRECTORY, IMAGE_MANIFEST_PATH, IMAGE_OVERLAY_DIRECTORIES, LOWERING_VERSION, PLATFORM_ENTRY_CONFIG, WRAPPER_PARAMS, } from './image-layout.ts';
17
+ export { parseImageManifest, type ImageLazyArchive, type ImageLazyFile, type ImageManifest, } from './image-manifest.ts';
17
18
  export { parsePreviewFixtureManifest, PREVIEW_FIXTURE_MANIFEST_FILE, PREVIEW_FIXTURE_MANIFEST_VERSION, type PreviewFixtureManifest, type PreviewFixtureManifestEntry, } from './fixture-manifest.ts';
18
19
  export { loadVfsImage, loadVfsOverlay, MemoryVfs } from './storage/memory.ts';
19
20
  export { inflateImage, inflateImageStream } from './storage/image-gzip.ts';
20
21
  export { packTar, parseTar, type TarEntry } from './storage/tar.ts';
21
22
  export { requireActiveVfs, setActiveVfs } from './storage/active.ts';
22
- export { type VfsDir, type VfsDirent, type VfsEncoding, type VfsError, type VfsFileHandle, type VfsReadOptions, type VfsStats, type VfsWriteOptions, } from './storage/types.ts';
23
+ export { type VfsDeferredArchive, type VfsDeferredFile, type VfsDir, type VfsDirent, type VfsEncoding, type VfsError, type VfsFileHandle, type VfsReadOptions, type VfsStats, type VfsWriteOptions, } from './storage/types.ts';
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,9 @@
1
1
  /**
2
- * CommonJS module loader over the worker VFS. It fills the `loader.internal`
3
- * seam Cordis uses for every entry import, and backs the `node:module`
4
- * `createRequire` proxy that `typert-loader`, `client-modules`, and the plugin
5
- * package inventory resolve package metadata through.
2
+ * CommonJS module loader over the worker VFS. It backs the Node internal ESM
3
+ * loader that `node-addon-require-builtin` answers, which Cordis's Loader uses
4
+ * for every entry import, and the `node:module` `createRequire` proxy that
5
+ * `typert-loader`, `client-modules`, and the plugin package inventory resolve
6
+ * package metadata through.
6
7
  *
7
8
  * Resolution is a narrowed Node `require` algorithm: `exports` walk with a
8
9
  * fixed condition order, extension probing, and one cache keyed by resolved
@@ -11,6 +12,7 @@
11
12
  * @module @deepseek-ai/dsh-experimental-webworker-runtime/src/module-system/module-loader
12
13
  */
13
14
  import { type AlsCausality } from '../polyfill/async-context/als-runtime.ts';
15
+ import { type CascadedLoader } from '../node/internal_modules/esm-loader.ts';
14
16
  import type { MemoryVfs } from '../storage/memory.ts';
15
17
  /** Condition keys honoured in `exports`, in order; `node` is deliberately absent. */
16
18
  export declare const DEFAULT_CONDITIONS: readonly ["browser", "require", "import", "default"];
@@ -96,9 +98,11 @@ export declare class WorkerModuleLoader {
96
98
  private readonly modules;
97
99
  private readonly manifests;
98
100
  private readonly stack;
101
+ private cascaded;
99
102
  /**
100
- * The Cordis module seam. `parentURL` positions relative specifiers;
101
- * import attributes are ignored, as the client implementation does.
103
+ * Resolution and loading over this mount, in Node's v1 argument order. The cascaded ESM loader
104
+ * ({@link cascadedLoader}) and the packer call it; `parentURL` positions relative specifiers and import attributes
105
+ * are ignored.
102
106
  */
103
107
  readonly internal: {
104
108
  readonly version: 'worker';
@@ -107,6 +111,16 @@ export declare class WorkerModuleLoader {
107
111
  resolveSync(specifier: string, parentURL?: string, attributes?: unknown): WorkerInternalResolution;
108
112
  };
109
113
  constructor(options: WorkerModuleLoaderOptions);
114
+ /**
115
+ * The `internal/modules/esm/loader` cascaded loader over this mount, created on first use.
116
+ * @returns This loader's one cascaded loader.
117
+ */
118
+ cascadedLoader(): CascadedLoader;
119
+ /**
120
+ * Throw this loader's diagnostic.
121
+ * @param detail - What failed.
122
+ * @param code - Node error code for a resolution failure Node also reports by code.
123
+ */
110
124
  private fail;
111
125
  /** @returns Directory a base path or URL resolves specifiers from. */
112
126
  private baseDirectoryOf;
@@ -98,11 +98,17 @@ export declare const posix: typeof posixFace & {
98
98
  readonly posix: unknown;
99
99
  readonly win32: unknown;
100
100
  };
101
- /** Windows member set: reaching it means a platform branch went the wrong way. */
101
+ /**
102
+ * Node's `path.win32.isAbsolute`, a string check cross-platform callers make on every platform.
103
+ * @param path - Path to classify.
104
+ * @returns Whether a Windows host would treat the path as absolute.
105
+ */
106
+ declare function win32IsAbsolute(path: string): boolean;
107
+ /** Windows member set: reaching a member other than `isAbsolute` means a platform branch went the wrong way. */
102
108
  export declare const win32: {
103
109
  resolve: () => never;
104
110
  normalize: () => never;
105
- isAbsolute: () => never;
111
+ isAbsolute: typeof win32IsAbsolute;
106
112
  join: () => never;
107
113
  relative: () => never;
108
114
  dirname: () => never;
@@ -54,6 +54,12 @@ export declare function parseArgs(): never;
54
54
  * @returns The same function, unwrapped.
55
55
  */
56
56
  export declare function deprecate<F>(fn: F): F;
57
+ /**
58
+ * Node's `util.inherits`: link `ctor.prototype` to `superCtor.prototype` and record `ctor.super_`.
59
+ * @param ctor - Constructor that inherits.
60
+ * @param superCtor - Constructor inherited from.
61
+ */
62
+ export declare function inherits(ctor: unknown, superCtor: unknown): void;
57
63
  /** Text decoder class, as `node:util` re-exports it. */
58
64
  declare const TextDecoderClass: {
59
65
  new (label?: string, options?: TextDecoderOptions): TextDecoder;
@@ -82,6 +88,7 @@ declare const _default: {
82
88
  };
83
89
  parseArgs: typeof parseArgs;
84
90
  deprecate: typeof deprecate;
91
+ inherits: typeof inherits;
85
92
  TextDecoder: {
86
93
  new (label?: string, options?: TextDecoderOptions): TextDecoder;
87
94
  prototype: TextDecoder;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Answer one Node internal module.
3
+ * @param moduleId - Node internal module id.
4
+ * @returns The Worker's module object for that id.
5
+ * @throws Error with `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` for an id the Worker does not provide.
6
+ */
7
+ export declare function requireBuiltin(moduleId: string): object;
8
+ //# sourceMappingURL=node-addon-require-builtin.d.ts.map
@@ -68,9 +68,9 @@ export interface ProcessShim {
68
68
  /**
69
69
  * Publish `globalThis.process`.
70
70
  *
71
- * `versions.node` is `0.0.0` on purpose: it makes Cordis's
72
- * `ModuleLoader.fromInternal()` return undefined instead of reaching for Node
73
- * internals, which is what lets the worker install its own module seam.
71
+ * `versions.node` names the Node release the Worker's `node-addon-require-builtin` internals follow, so Cordis's
72
+ * `ModuleLoader.fromInternal()` reaches them the way it reaches Node's; `execArgv` stays empty, without
73
+ * `--expose-internals`.
74
74
  * @param options - Root, environment, and argument vector.
75
75
  * @returns The published object, for the module proxy table.
76
76
  */
@@ -0,0 +1,50 @@
1
+ import { LoadCache } from './module-map.ts';
2
+ /** One module request in Node's v2 loader signature. */
3
+ export interface ModuleRequest {
4
+ readonly specifier: string;
5
+ readonly attributes?: Readonly<Record<string, string>>;
6
+ }
7
+ /** Worker module-loader operations a cascaded loader delegates to, in Node's v1 argument order. */
8
+ export interface CascadedLoaderSource {
9
+ import(specifier: string, parentURL?: string): Promise<unknown>;
10
+ resolveSync(specifier: string, parentURL?: string): {
11
+ readonly url: string;
12
+ readonly format: string;
13
+ };
14
+ }
15
+ /** The cascaded loader members provided in the Worker. */
16
+ export interface CascadedLoader {
17
+ /** Always empty: the Worker creates no ES module jobs. */
18
+ readonly loadCache: LoadCache;
19
+ /**
20
+ * Resolve one request for this repository's Node-loader callers.
21
+ * @param parentURL - URL of the requesting module; undefined resolves from the image root.
22
+ * @param request - Requested module.
23
+ * @returns The resolved URL and module format.
24
+ * @throws Error with `ERR_MODULE_NOT_FOUND` or `ERR_PACKAGE_PATH_NOT_EXPORTED` when the request does not resolve.
25
+ */
26
+ resolveSync(parentURL: string | undefined, request: ModuleRequest): {
27
+ url: string;
28
+ format: string;
29
+ };
30
+ /**
31
+ * Load one module through the Worker loader.
32
+ * @param specifier - Requested module.
33
+ * @param parentURL - URL of the requesting module.
34
+ * @param _importAttributes - Import attributes; the Worker loads CommonJS bodies and ignores them.
35
+ * @returns The module's exports.
36
+ */
37
+ import(specifier: string, parentURL: string | undefined, _importAttributes?: Readonly<Record<string, string>>): Promise<unknown>;
38
+ /**
39
+ * Refuse: the Worker creates no ES module jobs.
40
+ * @returns Never; always throws.
41
+ */
42
+ getOrCreateModuleJob(): never;
43
+ }
44
+ /**
45
+ * Build the cascaded loader for one Worker module loader.
46
+ * @param source - The Worker module loader's resolution and loading operations.
47
+ * @returns A cascaded loader delegating to `source`.
48
+ */
49
+ export declare function createCascadedLoader(source: CascadedLoaderSource): CascadedLoader;
50
+ //# sourceMappingURL=esm-loader.d.ts.map
@@ -0,0 +1,59 @@
1
+ /** Resolutions keyed by parent URL, then by serialized module request. */
2
+ export declare class ResolveCache extends Map<unknown, unknown> {
3
+ #private;
4
+ /**
5
+ * Serialize a module request: the specifier and its import attributes sorted by key.
6
+ * @param specifier - Requested module.
7
+ * @param importAttributes - Import attributes of the request.
8
+ * @returns The cache key Node uses for this request.
9
+ */
10
+ serializeKey(specifier: string, importAttributes: Record<string, string>): string;
11
+ /**
12
+ * Read one cached resolution.
13
+ * @param serializedKey - Key from {@link serializeKey}.
14
+ * @param parentURL - URL of the importing module.
15
+ * @returns The cached resolution, if any.
16
+ */
17
+ get(serializedKey: string, parentURL?: unknown): unknown;
18
+ /**
19
+ * Store one resolution.
20
+ * @param serializedKey - Key from {@link serializeKey}.
21
+ * @param parentURL - URL of the importing module.
22
+ * @param result - Resolution to cache.
23
+ * @returns This cache.
24
+ */
25
+ set(serializedKey: string, parentURL?: unknown, result?: unknown): this;
26
+ /**
27
+ * Check for one cached resolution.
28
+ * @param serializedKey - Key from {@link serializeKey}.
29
+ * @param parentURL - URL of the importing module.
30
+ * @returns Whether the request has a cached resolution.
31
+ */
32
+ has(serializedKey: string, parentURL?: unknown): boolean;
33
+ }
34
+ /** Module jobs keyed by URL, then by import `type` attribute; always empty in the Worker. */
35
+ export declare class LoadCache extends Map<string, unknown> {
36
+ /**
37
+ * Read the job for one URL and type.
38
+ * @param url - Module URL.
39
+ * @param type - Import `type` attribute.
40
+ * @returns The cached job, if any.
41
+ */
42
+ get(url: string, type?: string): unknown;
43
+ /**
44
+ * Refuse to store a job: the Worker creates no ES module jobs.
45
+ * @param url - Module URL.
46
+ * @param type - Import `type` attribute.
47
+ * @param _job - Job Node would store.
48
+ * @returns Never; always throws.
49
+ */
50
+ set(url: string, type?: unknown, _job?: unknown): never;
51
+ /**
52
+ * Check for the job of one URL and type.
53
+ * @param url - Module URL.
54
+ * @param type - Import `type` attribute.
55
+ * @returns Whether a job is cached.
56
+ */
57
+ has(url: string, type?: string): boolean;
58
+ }
59
+ //# sourceMappingURL=module-map.d.ts.map
@@ -0,0 +1,29 @@
1
+ /** `Module` with the static members HMR reads and replaces. */
2
+ export declare const Module: (() => never) & {
3
+ /** Empty: the Worker loader keeps its own resolution cache. */
4
+ _pathCache: Record<string, string>;
5
+ _resolveFilename: (...args: never[]) => never;
6
+ _load: (...args: never[]) => never;
7
+ };
8
+ /** `internal/modules/package_json_reader` with the member HMR replaces. */
9
+ export declare const packageJsonReader: {
10
+ getNearestParentPackageJSON: (...args: never[]) => never;
11
+ };
12
+ /** `internalBinding('modules')` with the members HMR replaces. */
13
+ declare const modulesBinding: {
14
+ readPackageJSON: (...args: never[]) => never;
15
+ getPackageScopeConfig: (...args: never[]) => never;
16
+ getPackageType: (...args: never[]) => never;
17
+ };
18
+ /** `internal/bootstrap/realm`: only the `modules` binding is provided. */
19
+ export declare const realm: {
20
+ /**
21
+ * Answer one internal binding.
22
+ * @param name - Binding name.
23
+ * @returns The `modules` binding.
24
+ * @throws Error with `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` for any other binding.
25
+ */
26
+ internalBinding(name: string): typeof modulesBinding;
27
+ };
28
+ export {};
29
+ //# sourceMappingURL=package-surfaces.d.ts.map
@@ -2,7 +2,9 @@
2
2
  * Structural not-implemented stubs: a replaced module must expose every symbol
3
3
  * its importers name (a missing CommonJS symbol degrades to `undefined` at call
4
4
  * time instead of failing at link time), and every one of those symbols must
5
- * report exactly what is unavailable when it is finally called.
5
+ * report exactly what is unavailable when it is finally called. The refusal
6
+ * carries Node's `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` code, so a caller that
7
+ * can run without the feature distinguishes it from other failures.
6
8
  */
7
9
  /**
8
10
  * Build a function that throws naming its module and symbol. The refusal is
@@ -28,7 +30,9 @@ export declare function notImplementedFail<Face = (...args: never[]) => never>(m
28
30
  * fakes).
29
31
  * @param module - module specifier being stubbed.
30
32
  * @param symbol - unavailable member, named as the importer sees it.
31
- * @returns the error to throw.
33
+ * @returns the error to throw, with `code` set to Node's `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`.
32
34
  */
33
- export declare function notAvailableError(module: string, symbol: string): Error;
35
+ export declare function notAvailableError(module: string, symbol: string): Error & {
36
+ code: string;
37
+ };
34
38
  //# sourceMappingURL=notImplementedFail.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { Vfs, VfsBigIntStats, VfsDir, VfsDirent, VfsFileHandle, VfsOpenFile, VfsMutationListener, VfsMutationSink, VfsReadOptions, VfsSeedOptions, VfsStatOptions, VfsStats, VfsWriteOptions } from './types.ts';
1
+ import type { Vfs, VfsBigIntStats, VfsDeferredArchive, VfsDir, VfsDirent, VfsFileHandle, VfsOpenFile, VfsMutationListener, VfsMutationSink, VfsReadOptions, VfsSeedOptions, VfsStatOptions, VfsStats, VfsWriteOptions } from './types.ts';
2
2
  /** Construction inputs for {@link MemoryVfs}. */
3
3
  export interface MemoryVfsOptions {
4
4
  /** Durable write-behind observer; absent leaves the filesystem ephemeral. */
@@ -11,6 +11,8 @@ export interface MemoryVfsOptions {
11
11
  */
12
12
  export declare class MemoryVfs implements Vfs {
13
13
  private readonly files;
14
+ /** Files a lazy archive supplies on their first asynchronous read. */
15
+ private readonly deferred;
14
16
  private readonly directories;
15
17
  /** Directory permission bits; absence means {@link DEFAULT_DIRECTORY_MODE}. */
16
18
  private readonly directoryModes;
@@ -71,6 +73,25 @@ export declare class MemoryVfs implements Vfs {
71
73
  };
72
74
  /** @returns Absolute path with no trailing separator. */
73
75
  private key;
76
+ /**
77
+ * Register files whose bytes arrive with one archive on the first
78
+ * asynchronous read of any of them. Their parent directories are created now.
79
+ * @param archive - Archive name, mount root, registered files, and fetch.
80
+ * @throws When a registered path already holds a file, directory, or another registration.
81
+ */
82
+ deferArchive(archive: VfsDeferredArchive): void;
83
+ /**
84
+ * Fetch the lazy archive that supplies a registered path. Concurrent readers
85
+ * of one archive share one fetch; a failed fetch leaves its files registered,
86
+ * so the next read fetches again.
87
+ * @param path - Path about to be read asynchronously.
88
+ * @returns A promise that settles once the archive arrived, or undefined when the path needs no fetch.
89
+ */
90
+ whenReadable(path: string): Promise<void> | undefined;
91
+ /** Fetch, validate against the registration, and mount one archive's files. */
92
+ private fetchArchive;
93
+ /** Refuse a synchronous operation on a registered file whose bytes have not arrived. */
94
+ private requireArrived;
74
95
  /**
75
96
  * Read a file.
76
97
  * @param path - File path.
@@ -283,7 +304,7 @@ export declare class MemoryVfs implements Vfs {
283
304
  /**
284
305
  * Mount a tar image produced by the build-time collector.
285
306
  *
286
- * Entry names are relative to `root` (`node_modules/...`, `config/cordis.yml`);
307
+ * Entry names are relative to `root` (`node_modules/...`, `config/vfs-manifest.json`);
287
308
  * an absolute entry name is a collector defect and fails loud. File contents
288
309
  * stay views into `image` — nothing is copied at mount time.
289
310
  * @param image - The ustar archive, as `inflateImage` produces it from the fetched image.
@@ -9,7 +9,7 @@ export declare const DSH_ROOT = "/dsh";
9
9
  export declare const DSH_HOME = "/dsh/home";
10
10
  /** Flat, symlink-free package tree resolved by the worker module loader. */
11
11
  export declare const DSH_NODE_MODULES = "/dsh/node_modules";
12
- /** Directory holding the composed cordis.yml. */
12
+ /** Image configuration directory: the VFS manifest and the shipped agent presets. */
13
13
  export declare const DSH_CONFIG = "/dsh/config";
14
14
  /** Default (empty) workspace directory. */
15
15
  export declare const DSH_WORKSPACE = "/dsh/workspace";
@@ -194,6 +194,34 @@ export type VfsMutation = {
194
194
  };
195
195
  /** Receives one committed VFS mutation. */
196
196
  export type VfsMutationListener = (mutation: VfsMutation) => void;
197
+ /** One file a lazy archive carries, by its path relative to the archive root. */
198
+ export interface VfsDeferredFile {
199
+ /** Entry name inside the archive, relative to {@link VfsDeferredArchive.root}. */
200
+ readonly path: string;
201
+ /** Byte length the archive must hold for this entry. */
202
+ readonly size: number;
203
+ }
204
+ /**
205
+ * Files registered by path and size whose bytes arrive with one archive on the
206
+ * first asynchronous read of any of them. Existence, stats, and listings answer
207
+ * from the registration. Until the archive arrives, synchronous reads, writes,
208
+ * appends, truncation, chmod, rename, and link are refused; unlink and recursive
209
+ * removal drop the registration, and seeding the path replaces it. The fetched
210
+ * archive is checked against the registered paths and sizes only.
211
+ */
212
+ export interface VfsDeferredArchive {
213
+ /** Archive name quoted in refusals and fetch failures. */
214
+ readonly name: string;
215
+ /** Virtual directory the archive's relative entry names mount under. */
216
+ readonly root: string;
217
+ /** Every regular file the archive carries; anything else in it refuses the archive. */
218
+ readonly files: readonly VfsDeferredFile[];
219
+ /**
220
+ * Fetch the archive.
221
+ * @returns The uncompressed ustar bytes.
222
+ */
223
+ load(): Promise<Uint8Array>;
224
+ }
197
225
  /** Durable observer attached to the synchronous VFS. */
198
226
  export interface VfsMutationSink {
199
227
  /**
@@ -275,5 +303,10 @@ export interface Vfs {
275
303
  subscribe(listener: VfsMutationListener): () => void;
276
304
  /** Settle the attached durable mutation sink, if any. */
277
305
  flush(): Promise<void>;
306
+ /**
307
+ * Fetch the lazy archive that supplies a registered path.
308
+ * @returns A promise that settles once the path's archive arrived, or undefined when the path needs no fetch.
309
+ */
310
+ whenReadable(path: string): Promise<void> | undefined;
278
311
  }
279
312
  //# sourceMappingURL=types.d.ts.map
@@ -16,9 +16,11 @@
16
16
  * message handler before its first await.
17
17
  *
18
18
  * The tree itself boots through the host's own `boot()` glue loaded from the
19
- * image, so entry mounting, the activation audit, and its diagnostics are the
20
- * same code the Node deployment runs. The Worker supplies module loading,
21
- * profile locations, and the command line.
19
+ * image, over the profile the image's own app-boot initializes from the shipped
20
+ * template and composes from the bundles the image carries, so profile
21
+ * composition, entry mounting, the activation audit, and its diagnostics are the
22
+ * same code the Node deployment runs. The Worker supplies module loading, the
23
+ * platform overlay, and the command line.
22
24
  * @module @deepseek-ai/dsh-experimental-webworker-runtime/src/worker-host
23
25
  */
24
26
  import { WorkerModuleLoader, type StaticModuleFactory } from './module-system/module-loader.ts';
@@ -46,14 +48,12 @@ export interface LogExporter {
46
48
  }
47
49
  /** Minimal view of the Cordis context the entry itself touches. */
48
50
  export interface HostContext {
49
- loader: {
50
- internal: unknown;
51
- };
52
51
  logger: {
53
52
  exporter(exporter: LogExporter): unknown;
54
53
  };
55
54
  get(service: string): unknown;
56
55
  provide(name: string, value: unknown): void;
56
+ plugin(plugin: unknown, config?: unknown): Promise<unknown>;
57
57
  fiber: {
58
58
  dispose(): Promise<void>;
59
59
  };
@@ -80,8 +80,6 @@ export interface WorkerHostOptions {
80
80
  readonly overlays?: readonly (Uint8Array | string)[];
81
81
  /** Virtual root; defaults to {@link DEFAULT_ROOT}. */
82
82
  readonly root?: string;
83
- /** Composed configuration inside the image; defaults to `<root>/config/cordis.yml`. */
84
- readonly configPath?: string;
85
83
  /**
86
84
  * Inner arguments the tree parses. The default binds the web server to the
87
85
  * loopback authority the tunnel synthesizes.
@@ -93,7 +91,8 @@ export interface WorkerHostOptions {
93
91
  readonly env?: Readonly<Record<string, string>>;
94
92
  /**
95
93
  * Image manifest path; defaults to `<root>/config/vfs-manifest.json`. Its
96
- * `lowered` field must name this build's wrapper contract.
94
+ * `lowered` field must name this build's wrapper contract, and its lazy
95
+ * archives resolve against the image URL.
97
96
  */
98
97
  readonly manifestPath?: string;
99
98
  /**