mirror of
https://github.com/anomalyco/opencode.git
synced 2026-12-01 22:13:19 +08:00
986 B
986 B
@opencode/codemode
- The language (compiler, VM, runtime, stdlib, snapshots, Effect driver) is the
psychoscriptpackage (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 throughHostandRuntime.make, and imports onlypsychoscript'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 examplenotes({ after: cursor })) rather than open host async iterators or stateful host closures, which cannot be snapshotted and becomeLostNativeafter resume. Only add non-durable host streams when callers explicitly accept breaking across suspend (likeStreamingResponse.body).