@native-sdk/cli 0.5.4 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/app.zig +50 -1
- package/build.zig +588 -32
- package/build.zig.zon +7 -0
- package/native-sdk.d.ts +3 -1
- package/package.json +9 -9
- package/packages/core/package-lock.json +2 -2
- package/packages/core/package.json +1 -1
- package/packages/core/rt/rt.zig +280 -8
- package/packages/core/sdk/core.ts +481 -2
- package/packages/core/sdk/events.ts +17 -8
- package/packages/core/src/checker.ts +305 -2
- package/packages/core/src/diagnostics.ts +12 -0
- package/packages/core/src/emitter.ts +599 -3
- package/packages/core/src/typed_ast.ts +51 -4
- package/packages/core/src/types.ts +34 -1
- package/skill-data/native-ui/SKILL.md +39 -2
- package/skill-data/ts-core/SKILL.md +4 -2
- package/src/app_runner/root.zig +32 -10
- package/src/automation/layout_fingerprint.zig +160 -0
- package/src/automation/protocol.zig +82 -33
- package/src/automation/root.zig +1 -0
- package/src/automation/server.zig +1 -1
- package/src/automation/snapshot.zig +68 -9
- package/src/automation/watcher.zig +1 -1
- package/src/embed/host.zig +5 -0
- package/src/embed/ui_host.zig +13 -0
- package/src/platform/linux/gtk_host.c +527 -13
- package/src/platform/linux/gtk_host.h +25 -0
- package/src/platform/linux/root.zig +280 -7
- package/src/platform/macos/appkit_host.h +104 -6
- package/src/platform/macos/appkit_host.m +1368 -74
- package/src/platform/macos/cef_host.mm +110 -1
- package/src/platform/macos/root.zig +287 -7
- package/src/platform/null_platform.zig +398 -4
- package/src/platform/null_platform_tests.zig +35 -0
- package/src/platform/root.zig +9 -0
- package/src/platform/types.zig +386 -14
- package/src/platform/windows/root.zig +298 -9
- package/src/platform/windows/webview2_host.cpp +330 -5
- package/src/primitives/app_manifest/validation.zig +18 -0
- package/src/primitives/canvas/a11y_audit.zig +33 -11
- package/src/primitives/canvas/a11y_audit_tests.zig +20 -0
- package/src/primitives/canvas/drawing.zig +25 -0
- package/src/primitives/canvas/equality.zig +8 -0
- package/src/primitives/canvas/events.zig +103 -16
- package/src/primitives/canvas/frame.zig +125 -1
- package/src/primitives/canvas/layout_audit.zig +22 -5
- package/src/primitives/canvas/markdown_hostile_tests.zig +8 -4
- package/src/primitives/canvas/render_tests.zig +13 -10
- package/src/primitives/canvas/root.zig +48 -0
- package/src/primitives/canvas/terminal_box.zig +471 -0
- package/src/primitives/canvas/terminal_grid.zig +978 -0
- package/src/primitives/canvas/terminal_grid_tests.zig +1093 -0
- package/src/primitives/canvas/test_support.zig +1 -0
- package/src/primitives/canvas/tests.zig +1 -0
- package/src/primitives/canvas/text_tests.zig +39 -4
- package/src/primitives/canvas/tokens.zig +115 -12
- package/src/primitives/canvas/ui.zig +524 -5
- package/src/primitives/canvas/ui_markup.zig +195 -2
- package/src/primitives/canvas/ui_markup_compiled.zig +172 -1
- package/src/primitives/canvas/ui_markup_compiled_tests.zig +133 -8
- package/src/primitives/canvas/ui_markup_contract.zig +88 -5
- package/src/primitives/canvas/ui_markup_contract_tests.zig +39 -1
- package/src/primitives/canvas/ui_markup_huge_model_tests.zig +1 -0
- package/src/primitives/canvas/ui_markup_reflect.zig +75 -24
- package/src/primitives/canvas/ui_markup_tests.zig +149 -0
- package/src/primitives/canvas/ui_markup_view.zig +191 -0
- package/src/primitives/canvas/ui_markup_view_tests.zig +403 -19
- package/src/primitives/canvas/ui_schema.zig +97 -17
- package/src/primitives/canvas/ui_schema_tests.zig +18 -11
- package/src/primitives/canvas/ui_tests.zig +141 -9
- package/src/primitives/canvas/widget_access.zig +28 -2
- package/src/primitives/canvas/widget_anchored_tests.zig +48 -0
- package/src/primitives/canvas/widget_invalidation.zig +81 -1
- package/src/primitives/canvas/widget_layout.zig +59 -11
- package/src/primitives/canvas/widget_layout_tests.zig +125 -4
- package/src/primitives/canvas/widget_render.zig +272 -18
- package/src/primitives/canvas/widget_render_scroll.zig +108 -27
- package/src/primitives/canvas/widget_routing.zig +59 -7
- package/src/primitives/canvas/widget_runtime.zig +23 -0
- package/src/primitives/canvas/widget_runtime_tests.zig +149 -0
- package/src/primitives/canvas/widget_semantics.zig +119 -11
- package/src/primitives/canvas/widget_semantics_tests.zig +409 -0
- package/src/primitives/canvas/widget_tree.zig +17 -0
- package/src/primitives/canvas/widgets.zig +132 -0
- package/src/root.zig +16 -0
- package/src/runtime/api.zig +76 -6
- package/src/runtime/automation_commands.zig +20 -1
- package/src/runtime/automation_snapshot.zig +25 -1
- package/src/runtime/automation_widget_dispatch.zig +73 -8
- package/src/runtime/bridge_payload.zig +1 -0
- package/src/runtime/canvas_frame.zig +62 -7
- package/src/runtime/canvas_frame_animation_tests.zig +5 -4
- package/src/runtime/canvas_frame_helpers.zig +190 -1
- package/src/runtime/canvas_frame_invalidation_tests.zig +531 -0
- package/src/runtime/canvas_frame_patch_tests.zig +161 -10
- package/src/runtime/canvas_frame_retained_tests.zig +5 -2
- package/src/runtime/canvas_widget_accessibility_tests.zig +1 -1
- package/src/runtime/canvas_widget_clipboard_tests.zig +40 -0
- package/src/runtime/canvas_widget_context_menu.zig +269 -32
- package/src/runtime/canvas_widget_context_menu_tests.zig +640 -14
- package/src/runtime/canvas_widget_display.zig +1 -1
- package/src/runtime/canvas_widget_event_tests.zig +1823 -0
- package/src/runtime/canvas_widget_events.zig +268 -26
- package/src/runtime/canvas_widget_runtime.zig +213 -29
- package/src/runtime/canvas_widget_scroll_driver_tests.zig +170 -7
- package/src/runtime/canvas_widget_scroll_drivers.zig +151 -17
- package/src/runtime/canvas_widget_scroll_tests.zig +435 -23
- package/src/runtime/canvas_widget_state.zig +6 -0
- package/src/runtime/canvas_widget_text_tests.zig +1 -1
- package/src/runtime/core.zig +73 -2
- package/src/runtime/effects.zig +6389 -54
- package/src/runtime/effects_channel_tests.zig +3519 -0
- package/src/runtime/effects_pty_tests.zig +1362 -0
- package/src/runtime/effects_tests.zig +14 -9
- package/src/runtime/effects_video_tests.zig +3609 -0
- package/src/runtime/flow.zig +25 -4
- package/src/runtime/gpu_surface_events.zig +475 -15
- package/src/runtime/media_surface.zig +116 -11
- package/src/runtime/media_surface_tests.zig +61 -0
- package/src/runtime/pty.zig +1252 -0
- package/src/runtime/pty_windows.zig +1780 -0
- package/src/runtime/root.zig +25 -0
- package/src/runtime/runtime_event_tests.zig +20 -1
- package/src/runtime/session_journal.zig +367 -61
- package/src/runtime/session_record.zig +16 -0
- package/src/runtime/session_replay.zig +395 -11
- package/src/runtime/session_tests.zig +114 -19
- package/src/runtime/terminal_session.zig +1569 -0
- package/src/runtime/terminal_session_tests.zig +450 -0
- package/src/runtime/terminal_vt_ghostty.zig +15 -0
- package/src/runtime/terminal_vt_stub.zig +13 -0
- package/src/runtime/tests.zig +6 -0
- package/src/runtime/ts_core_host.zig +980 -140
- package/src/runtime/ts_core_host_tests.zig +1059 -1
- package/src/runtime/ts_ui_app.zig +16 -5
- package/src/runtime/ui_app.zig +2338 -67
- package/src/runtime/ui_app_tests.zig +3171 -744
- package/src/runtime/ui_app_virtual_variable_tests.zig +4 -2
- package/src/runtime/ui_app_window_tests.zig +268 -0
- package/src/runtime/view.zig +190 -2
- package/src/runtime/view_widget_scroll.zig +218 -68
- package/src/runtime/view_widget_text.zig +11 -2
- package/src/runtime/view_widget_tree.zig +111 -3
- package/src/runtime/window_storage.zig +45 -2
- package/src/runtime/window_view_runtime.zig +34 -2
- package/src/runtime/window_views.zig +1 -0
- package/src/terminal_session_tests_root.zig +15 -0
- package/src/tooling/templates.zig +25 -7
package/src/runtime/core.zig
CHANGED
|
@@ -146,6 +146,8 @@ pub const CanvasWidgetAccessibilityAction = runtime_api.CanvasWidgetAccessibilit
|
|
|
146
146
|
pub const CanvasWidgetFileDropEvent = runtime_api.CanvasWidgetFileDropEvent;
|
|
147
147
|
pub const CanvasWidgetDragEvent = runtime_api.CanvasWidgetDragEvent;
|
|
148
148
|
pub const CanvasWidgetContextMenuEvent = runtime_api.CanvasWidgetContextMenuEvent;
|
|
149
|
+
pub const CanvasWidgetContextMenuShownEvent = runtime_api.CanvasWidgetContextMenuShownEvent;
|
|
150
|
+
pub const CanvasWidgetContextMenuDismissedEvent = runtime_api.CanvasWidgetContextMenuDismissedEvent;
|
|
149
151
|
pub const CanvasWidgetContextMenuRequestEvent = runtime_api.CanvasWidgetContextMenuRequestEvent;
|
|
150
152
|
pub const CanvasWidgetDismissEvent = runtime_api.CanvasWidgetDismissEvent;
|
|
151
153
|
pub const CanvasWidgetContextPressEvent = runtime_api.CanvasWidgetContextPressEvent;
|
|
@@ -231,6 +233,23 @@ pub const Runtime = struct {
|
|
|
231
233
|
/// cannot analyze: honest absence, visible as such.
|
|
232
234
|
audio_spectrum_bands: [platform.audio_spectrum_band_count]u8 = @splat(0),
|
|
233
235
|
audio_spectrum_events: u64 = 0,
|
|
236
|
+
/// Video playback mirrors (`UiApp.publishVideoState`) — the audio
|
|
237
|
+
/// mirrors' twin, so the automation snapshot reports the single
|
|
238
|
+
/// video channel honestly. Dimensions are the stream's decoded
|
|
239
|
+
/// pixels from the `.loaded` acknowledgment; the surface id names
|
|
240
|
+
/// which media-surface texture channel the frames feed.
|
|
241
|
+
video_active: bool = false,
|
|
242
|
+
video_key: u64 = 0,
|
|
243
|
+
video_surface_id: u64 = 0,
|
|
244
|
+
video_playing: bool = false,
|
|
245
|
+
video_buffering: bool = false,
|
|
246
|
+
video_looping: bool = false,
|
|
247
|
+
video_muted: bool = false,
|
|
248
|
+
video_source: runtime_effects.EffectVideoSource = .local,
|
|
249
|
+
video_position_ms: u64 = 0,
|
|
250
|
+
video_duration_ms: u64 = 0,
|
|
251
|
+
video_width: u64 = 0,
|
|
252
|
+
video_height: u64 = 0,
|
|
234
253
|
shell_layouts: [platform.max_windows]RuntimeShellLayout = undefined,
|
|
235
254
|
shell_layout_count: usize = 0,
|
|
236
255
|
next_window_id: platform.WindowId = 2,
|
|
@@ -310,10 +329,50 @@ pub const Runtime = struct {
|
|
|
310
329
|
/// provenance table exists (builder-only apps, release engines).
|
|
311
330
|
automation_provenance_published: bool = false,
|
|
312
331
|
widget_event_route_entries: [canvas.max_widget_depth * 2]canvas.WidgetEventRouteEntry = undefined,
|
|
332
|
+
/// The in-flight IME preedit for the TARGETLESS text path (an app
|
|
333
|
+
/// consuming committed text with no focused text widget — a terminal
|
|
334
|
+
/// grid): updated by `ime_set_composition`, delivered as committed
|
|
335
|
+
/// text on `ime_commit_composition` (the host emits an EMPTY commit
|
|
336
|
+
/// when the marked text is committed unchanged, so the composed
|
|
337
|
+
/// bytes live only here), cleared on cancel or a direct text_input.
|
|
338
|
+
/// Grows to fit the current composition (never truncated): each
|
|
339
|
+
/// `ime_set_composition` REPLACES the preedit with the host's full
|
|
340
|
+
/// composition string, so this holds at most one composition's
|
|
341
|
+
/// bytes, reallocated up through `owned_allocator` only when a
|
|
342
|
+
/// larger one arrives and freed at `deinit`. `.len` is the allocated
|
|
343
|
+
/// capacity; `targetless_ime_preedit_len` is the bytes in use.
|
|
344
|
+
/// Focused text widgets never use this — their editor applies the
|
|
345
|
+
/// composition directly.
|
|
346
|
+
targetless_ime_preedit: []u8 = &.{},
|
|
347
|
+
targetless_ime_preedit_len: usize = 0,
|
|
348
|
+
/// The surface that buffered the preedit (window + view label) —
|
|
349
|
+
/// target-less composition state is PER SURFACE, the way a focused
|
|
350
|
+
/// widget's editor scopes its own composition to the widget. Only
|
|
351
|
+
/// events from the owning surface consume or clear the buffer: a
|
|
352
|
+
/// second surface's empty commit must never insert a composition the
|
|
353
|
+
/// user typed into the first (its own cancel/commit, delivered on its
|
|
354
|
+
/// own label, clears it). A new `ime_set_composition` from any
|
|
355
|
+
/// surface takes ownership — at most one system composition exists.
|
|
356
|
+
targetless_ime_preedit_window: platform.WindowId = 0,
|
|
357
|
+
targetless_ime_preedit_label: [platform.max_view_label_bytes]u8 = undefined,
|
|
358
|
+
targetless_ime_preedit_label_len: usize = 0,
|
|
359
|
+
/// The target-less twin of `RuntimeView.canvas_widget_ime_commit_grace`:
|
|
360
|
+
/// armed when the owning surface's composition CANCELS, because the
|
|
361
|
+
/// hosts encode a converted commit as cancel-then-text_input — the
|
|
362
|
+
/// trailing text_input still belongs to the target-less composition
|
|
363
|
+
/// and must deliver target-less (to the same surface, matched via
|
|
364
|
+
/// the preedit owner fields above) rather than into whichever text
|
|
365
|
+
/// widget holds focus by then. One-shot: any other event disarms it.
|
|
366
|
+
targetless_ime_commit_grace: bool = false,
|
|
313
367
|
/// The in-flight native context-menu request: set when the
|
|
314
368
|
/// platform is asked to present, resolved by the matching
|
|
315
369
|
/// `context_menu_action` event. At most one menu tracks at a time.
|
|
316
370
|
canvas_widget_context_menu_pending: ?runtime_canvas_widget_context_menu.PendingCanvasWidgetContextMenu = null,
|
|
371
|
+
/// Monotonic per-request context-menu token source: each presented
|
|
372
|
+
/// (or automation-armed) request gets a fresh token, so a superseded
|
|
373
|
+
/// request's late dismissal can never resolve its successor — even
|
|
374
|
+
/// when both target the same widget.
|
|
375
|
+
canvas_widget_context_menu_token: u64 = 0,
|
|
317
376
|
canvas_widget_display_list_refresh_batch_depth: usize = 0,
|
|
318
377
|
/// Nonzero while a gpu-surface input dispatch is live: accessibility
|
|
319
378
|
/// publishes requested inside it defer to after the responding
|
|
@@ -478,6 +537,11 @@ pub const Runtime = struct {
|
|
|
478
537
|
/// host) call it to return the storage.
|
|
479
538
|
pub fn deinit(self: *Runtime) void {
|
|
480
539
|
self.disarmMediaSurfaceWakes();
|
|
540
|
+
if (self.targetless_ime_preedit.len > 0) {
|
|
541
|
+
self.owned_allocator.free(self.targetless_ime_preedit);
|
|
542
|
+
self.targetless_ime_preedit = &.{};
|
|
543
|
+
self.targetless_ime_preedit_len = 0;
|
|
544
|
+
}
|
|
481
545
|
for (self.canvas_font_entries[0..self.canvas_font_count]) |entry| {
|
|
482
546
|
// Return the HOST side of the registration before the bytes:
|
|
483
547
|
// registration pushed the face to platforms with host-side
|
|
@@ -577,6 +641,7 @@ pub const Runtime = struct {
|
|
|
577
641
|
pub const respondToBridge = FlowMethods.respondToBridge;
|
|
578
642
|
pub const dispatchPlatformEvent = FlowMethods.dispatchPlatformEvent;
|
|
579
643
|
pub const dispatchEvent = FlowMethods.dispatchEvent;
|
|
644
|
+
pub const recordDispatchError = FlowMethods.recordDispatchError;
|
|
580
645
|
pub const dispatchCommand = FlowMethods.dispatchCommand;
|
|
581
646
|
pub const frame = FlowMethods.frame;
|
|
582
647
|
pub const automationSnapshot = FlowMethods.automationSnapshot;
|
|
@@ -658,7 +723,9 @@ pub const Runtime = struct {
|
|
|
658
723
|
const relayoutDescendantWebViewBackends = WindowViewMethods.relayoutDescendantWebViewBackends;
|
|
659
724
|
const relayoutDescendantWebViewBackendsDepth = WindowViewMethods.relayoutDescendantWebViewBackendsDepth;
|
|
660
725
|
const reserveView = WindowViewMethods.reserveView;
|
|
661
|
-
|
|
726
|
+
// Public: the ui-app layer resolves view indices for targeted
|
|
727
|
+
// display-list refreshes (the terminal repaint path).
|
|
728
|
+
pub const findViewIndex = WindowViewMethods.findViewIndex;
|
|
662
729
|
const commandSourceForNativeView = WindowViewMethods.commandSourceForNativeView;
|
|
663
730
|
const setFocusedView = WindowViewMethods.setFocusedView;
|
|
664
731
|
const clearFocusedView = WindowViewMethods.clearFocusedView;
|
|
@@ -838,6 +905,7 @@ pub const Runtime = struct {
|
|
|
838
905
|
pub const adoptMediaSurfaceFrames = MediaSurfaceMethods.adoptMediaSurfaceFrames;
|
|
839
906
|
pub const disarmMediaSurfaceWakes = MediaSurfaceMethods.disarmMediaSurfaceWakes;
|
|
840
907
|
pub const adoptedMediaSurfaceTexture = MediaSurfaceMethods.adoptedMediaSurfaceTexture;
|
|
908
|
+
pub const mediaSurfaceBinding = MediaSurfaceMethods.mediaSurfaceBinding;
|
|
841
909
|
const adoptedMediaSurfaceTextures = MediaSurfaceMethods.adoptedMediaSurfaceTextures;
|
|
842
910
|
|
|
843
911
|
const CanvasFontMethods = runtime_canvas_fonts.RuntimeCanvasFonts(Runtime);
|
|
@@ -866,7 +934,10 @@ pub const Runtime = struct {
|
|
|
866
934
|
pub const emitCanvasWidgetDisplayListWithChrome = CanvasWidgetDisplayMethods.emitCanvasWidgetDisplayListWithChrome;
|
|
867
935
|
pub const emitCanvasWidgetDisplayListWithStoredTokensAndChrome = CanvasWidgetDisplayMethods.emitCanvasWidgetDisplayListWithStoredTokensAndChrome;
|
|
868
936
|
const emitCanvasWidgetDisplayListForViewWithChrome = CanvasWidgetDisplayMethods.emitCanvasWidgetDisplayListForViewWithChrome;
|
|
869
|
-
|
|
937
|
+
// Public: the ui-app layer repaints after a terminal session's
|
|
938
|
+
// published snapshot moved under the retained tree (batch-aware,
|
|
939
|
+
// a no-op for chrome-owned display lists).
|
|
940
|
+
pub const refreshCanvasWidgetDisplayListIfOwned = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwned;
|
|
870
941
|
const refreshCanvasWidgetDisplayListIfOwnedSkippingAccessibility = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwnedSkippingAccessibility;
|
|
871
942
|
const refreshCanvasWidgetDisplayListIfOwnedWithAccessibility = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwnedWithAccessibility;
|
|
872
943
|
const refreshCanvasWidgetDisplayListIfOwnedWithAccessibilityImmediate = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwnedWithAccessibilityImmediate;
|