Commit graph

8 commits

Author SHA1 Message Date
OpenCode Agent
e2a4c7a3ce feat(core): a wheel pointer event for canvases that take input
widgets-input.md specifies { kind: "wheel", x, y, dx, dy } in logical pixels (lines 40 px, pages
the canvas's size), summed per frame, delivered as move is, and { kind, dx, dy } under capture.
The prelude passes it to onPointer and leaves widget.pointer alone. Two wire fixtures (wheel,
wheel-captured) take the TypeScript host's outcome, as protocol 1's prelude doesn't know the event;
four fixtures' prelude line numbers move by 5.
2026-11-23 17:49:10 +00:00
OpenCode Agent
065b86db1d build(core): widget runs have typed arrays (psychoscript rust b30b1c2, typedArrays: true)
The widget packages pin psychoscript to rust b30b1c2, where typed arrays are opt-in; steps, draws,
live runs and compiles turn them on, and widgets.md lists the globals. The GPU and wire fixtures
regenerate unchanged; without the opt-in the GPU ones fail.
2026-11-23 00:05:49 +00:00
OpenCode Agent
816a4416dd feat(core): widget runs take views 100 levels deep (maxValueDepth 202)
Widget packages pin psychoscript to rust 7b09bac (limits.maxValueDepth); the TypeScript host runs
steps and live programs at 202, the depth of a 100-level view. Fixtures add 100-level views (one
with the deepest prop) and a 150-level one, and 101 now fails in the host's walk.
2026-11-22 14:21:12 +00:00
OpenCode Agent
7fa6666a13 refactor(core): the prelude drops its in-script tree building; every host is native
The prelude keeps only protocol 2: __widget_native_step and the native live path, with handlers
found by path. The tree building, handler table and __widget_step go; tests hold the hosts to the
last prelude that had them (test/fixtures/scripted-prelude.js) and to the closure reference walk.
The spec keeps protocol 1 as history only, and says clients show protocol errors without a retry.
2026-11-22 14:05:22 +00:00
OpenCode Agent
523750c6a1 feat(core): widget protocol 2: split native step output, keys and depth rules, function rule
- __widget_native_step(__input()) hands the view to the host global __widget_emit and returns the
  rest of the step output as the run's result, under its JSON rules; the TypeScript host uses it.
- The prelude's first line declares __widget_protocol = 2; hosts refuse older programs as a program
  error (ask the agent to post it again) and newer ones as a client error.
- Keys are strings, numbers or booleans, and views nest at most 100 levels; both are program errors
  in phase view, in the prelude's tree building and in native hosts. The boundary depth for 100
  levels is 202.
- A function in a host call's argument anywhere but a node's handler props fails the call with the
  runtime's TypeError, the view's included.
- Wire fixtures gain the run's result, failures, keys, depth and JSON edge cases.
2026-11-22 13:25:02 +00:00
OpenCode Agent
8a565c6b84 feat(core): the TypeScript widget host builds view trees natively, on psychoscript's function markers
step, WidgetSession and LiveWidget run programs under translate.functions "mark" with the native
entry, build the tree in src/tree.ts (byte-identical to the wire fixtures), map live draw keys to
canvas ids, return from a render post whether its view has handlers, and fail functions where
none may go as the interpreter did. Widget packages pin psychoscript to rust c630d87.
2026-11-22 03:43:43 +00:00
OpenCode Agent
60732569af feat(core): native widget hosts build the view tree; the prelude hands them views as built
A host that passes true to __widget_step / __widget_live gets views with handler functions as
psychoscript function markers, assigns path ids itself and returns from a render post whether the
view has handlers; the prelude finds handlers by following an id's path, and live draws post the
canvas key. Without true the prelude builds the tree as before, so wire views are unchanged.
The spec defines the algorithm; the wire fixtures gain the view as built and edge cases, and
tests check both modes against them.
2026-11-22 03:08:29 +00:00
OpenCode Agent
99c21ad90b test(core): wire conformance fixtures for view tree building, from today's prelude 2026-11-22 02:34:40 +00:00