Direction issue rather than a near-term ask. Today a craft app is exactly one window:
- No
create/openaction inbridge_window.zig:55-111;window.craft.windowis implicitly "the" window, no handle anywhere. api.zig:199/254can create windows from zig, but nothing routes that to JS or the CLI.- Every bridge is a process-global singleton (
macos.zig:4074setupBridgeHandlers), and outbound JS resolves one global webview — every reply and event in the process is evaluated into a single page regardless of origin. - The single
NSWindowDelegateinstance is process-global and re-attached to each new window (macos_window_events.zig:59-63). window.open()is separately dead (#64).
The eventual want (stacksjs/harness: "pop this session out into its own window") needs: craft.window.create({url,...}) → handle, window-handle addressing on the window namespace, per-webview reply routing, and per-window event scoping. Sequencing: request-id correlation (#66) is a hard prerequisite — "which call asked" must be solved before "which window asked" — and #63's app delegate is where multi-window lifecycle naturally lives. Filing now so the singleton pattern stops spreading into new bridges in the meantime.
🤖 Generated with Claude Code