Files

986 B

@opencode/codemode

  • The language (compiler, VM, runtime, stdlib, snapshots, Effect driver) is the psychoscript package (https://github.com/anomalyco/psychoscript). Language changes go there, get published, and are then bumped here. src/codemode/ is Code Mode, built on it (tools, schemas, catalog, search, scanTools, OpenAPI, hooks, maxToolCalls): it gives programs its functions through Host and Runtime.make, and imports only psychoscript's package entry (test/language-boundary.test.ts).
  • Host APIs meant for long-running scripts must survive program.suspend() / Runtime.resume(): keep iteration or progress state as plain JSON cursors or handle IDs in VM state (for example notes({ after: cursor })) rather than open host async iterators or stateful host closures, which cannot be snapshotted and become LostNative after resume. Only add non-durable host streams when callers explicitly accept breaking across suspend (like StreamingResponse.body).