mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-09 04:02:35 +00:00
Two private experimental packages run the whole harness tree inside one dedicated Web Worker. dsh-experimental-webworker-runtime owns the in-memory VFS (BigInt stats with per-path identity and strictly increasing mtimes), the CommonJS wrapper loader over a lazily-evaluated builtin table whose shims typecheck against Node's own module types, the postMessage tunnel speaking plain HTTP, the AsyncLocalStorage runtime, and the worker assembly. dsh-experimental-webworker-packer lowers every module body at pack time against the shared wrapper contract, sweeps the profile closure by static reachability, and writes a deterministically gzip-compressed tar the worker inflates through the browser's native DecompressionStream while it downloads.
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
/**
|
|
* The wrapper contract packed bodies are emitted against, and the image-entry
|
|
* types the pack pass consumes.
|
|
*
|
|
* One transform serves both sides — the pack pass lowers with the runtime's
|
|
* own `lowerModuleSource`, never a reimplementation — and the image records
|
|
* the contract version it was lowered against. Bodies emitted against a
|
|
* different wrapper contract are refused at mount time rather than
|
|
* half-working at run time.
|
|
* @module @deepseek-ai/dsh-experimental-webworker-packer/src/transform-image
|
|
*/
|
|
import { LOWERING_VERSION } from '@deepseek-ai/dsh-experimental-webworker-runtime'
|
|
|
|
/** Image entries, keyed by their path relative to the virtual root. */
|
|
export type ImageFiles = Record<string, Uint8Array>
|
|
|
|
/** Wrapper contract the packed bodies are emitted against. */
|
|
export const WRAPPER_CONTRACT: string = LOWERING_VERSION
|
|
|
|
/** What one pack-time transform pass did. */
|
|
export interface TransformOutcome {
|
|
/** JavaScript entries visited. */
|
|
readonly visited: number
|
|
/** How many changed; the rest were already in final form. */
|
|
readonly rewritten: number
|
|
}
|