Skip to content

Interfaces ​

An interface defines what a caller can request and what the owner returns. The communication section defines how requests cross process boundaries; formats defines the records carried across them.

Interface families ​

InterfaceCaller and ownerContract
Design APISource module → core/standard libraryTyped values and JSX nodes; syntax governs semantics
Compile APIHost → compilerCompile options, cancellation, requested views and board results; Compiler and plugin APIs
Plugin APICompiler → registered pluginDeclared stage inputs/outputs, hooks, deltas and checks; Plugin contract
Platform APICompiler → host environmentFiles, paths, hashing, environment and storage; Platform definition
Viewer APIVite/application → UI componentBoardRef, facet imports, component props/events and embedding; UI integration
Query APICLI or agent → project snapshotEntity records, resolution, events, scripts and stale envelopes; Queries
Render APICLI/session caller → rendererView, camera, selection, marks and image result; Rendering
Editor/agent adapterClient → session, LSP or MCP adapterProtocol declarations, LSP, MCP

Side-effect boundaries ​

A compile returns geometry and findings; it does not itself select an editor tab. A UI component renders and requests operations; displaying an object does not authorize modifying its source. Export/build commands can write generated artifacts without implying a design-source edit. Queries return a snapshot or an explicit stale result, not an assumed live mutable board.

Source changes go through the session's Sources authority. The caller must preserve the file version and originating project/board/target. A failed or unavailable operation must not be reported as a successful edit. Rendering may execute a supplied script only under the permission rules of the session method; plain image requests and scripted requests are not interchangeable.

Plugin obligations ​

Plugins declare the stages they add and the facets their work reads and writes. Hook deltas apply at the documented boundary. A plugin cannot safely mutate arbitrary existing items or rely on an undeclared input while expecting correct incremental caching. The stage runner and freeze checks enforce parts of this contract.

Registration order, available slots, hook signatures, ctx.resolve, emitted deltas and custom findings are defined in Compiler and plugin APIs. Exact shapes live in plugin.ts; avoid importing another package's private implementation by a relative source path.

Viewer obligations ​

The four viewers consume the facets appropriate to their job: 2D, 3D, schematic and DRC/ERC. A missing optional representation must be presented as unavailable rather than replaced with unrelated geometry. An embed can communicate through the declared host/page messages; it must not manufacture a second competing selection protocol.

Browser-facing components must be safe to import and render in an SSR environment. Browser globals and renderer initialization belong to the appropriate client lifecycle. A built static site has no source editing authority merely because its component has the same visual appearance as a development preview.

Authority and verification ​

SourceOwns
core/plugin.tsCompile/plugin interfaces
core/platform.tsHost services
core/site-facets.tsBoard references and facet contracts
core/protocol.tsRPC parameters/results, write classification and host/page frames
ui/index.tsExported UI components

A package's exported API and its internal helpers are different compatibility surfaces. This section does not declare every repository function to be stable. Type tests, plugin tests, query tests and browser integration tests provide different evidence; use Conformance to determine the required acceptance level.

MIT licensed. A proof of concept, pre 0.1.