pub fn emit_runtime_module() -> StringExpand description
Emit the contents of out/runtime.ts. This module ships with every
project so the per-context / per-test emissions can import { Ok, Err, Some, None, ... } from a single source. It includes:
Result/Optiondiscriminated unions (usingtagfor the discriminant — same shape user sum types lower to).ValidationError(the record shape refined-value constructors return).- The
DurableObjectState/DurableObjectStorageinterfaces that agent classes consume, plus anInMemoryStorageimplementation and amakeTestState(name)factory for use in test execution.
The content is identical across projects — there is no per-project tailoring. Dead code is harmless; tsc handles it.