mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
docs(codemode): describe the crate's language and Code Mode layers
This commit is contained in:
parent
f2f3a08937
commit
fdabc8dde0
1 changed files with 1 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ In scope:
|
|||
|
||||
- The language subset needed by the nine reference benchmark programs (`conformance/cases/bench-*`), the plugin reducer example, and the other conformance cases.
|
||||
- Pipeline: parse → compile to bytecode → stack VM. Values cross the host boundary as JSON copies (`serde_json::Value`), never shared.
|
||||
- Two layers, as the reference's `src/language/` and `src/codemode/`: `crates/psychoscript/src/language/` (compiler, VM, runtime, stdlib, host functions and their crossing, snapshots) knows nothing about tools and asks the layer embedding it through `host::Embedder`; `src/codemode/` (tools, schemas, catalog, `search`, OpenAPI, hooks, the `Runtime`) builds on it. `tests/language_boundary.rs` fails when a language file names Code Mode.
|
||||
- Host API in `crates/psychoscript/src/lib.rs`, the Rust form of the reference's README API: schema-described tools (sync or futures) at dotted paths with namespaces, OpenAPI tools (`openapi::from_spec` over a host `HttpClient`), the catalog and `search`, hooks, extensions with `import`/`require`, their module names and constructible globals, runs that pick some of the runtime's extensions (`RunOptions`), programs (`Runtime::program`), suspending and resuming runs (`Suspender`, `Runtime::resume`, idempotent and durable tools, extension `snapshot` hooks), JSON bindings, limits (`timeout_ms`, `max_tool_calls`, `max_output_bytes`), `console.log` captured into `logs`.
|
||||
- Parity runs both ways: add no language feature or host API the reference lacks. Rust-native forms of reference APIs (futures for Effects, a blocking `execute`) are fine.
|
||||
- `conformance/catalog.json` is generated by `bun conformance/catalog.ts` from the reference; never edit it by hand.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue