@native-sdk/cli 0.5.3 → 0.6.0

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.
Files changed (172) hide show
  1. package/build/app.zig +91 -2
  2. package/build.zig +756 -5
  3. package/build.zig.zon +7 -0
  4. package/native-sdk.d.ts +19 -1
  5. package/package.json +9 -9
  6. package/packages/core/package-lock.json +2 -2
  7. package/packages/core/package.json +1 -1
  8. package/packages/core/rt/rt.zig +416 -9
  9. package/packages/core/sdk/core.ts +706 -5
  10. package/packages/core/sdk/events.ts +17 -8
  11. package/packages/core/src/checker.ts +305 -2
  12. package/packages/core/src/diagnostics.ts +12 -0
  13. package/packages/core/src/emitter.ts +3187 -264
  14. package/packages/core/src/typed_ast.ts +51 -4
  15. package/packages/core/src/types.ts +34 -1
  16. package/skill-data/native-ui/SKILL.md +42 -4
  17. package/skill-data/ts-core/SKILL.md +13 -3
  18. package/src/app_runner/root.zig +112 -10
  19. package/src/app_runner/ts_core_main.zig +4 -0
  20. package/src/automation/layout_fingerprint.zig +160 -0
  21. package/src/automation/protocol.zig +82 -33
  22. package/src/automation/root.zig +1 -0
  23. package/src/automation/server.zig +1 -1
  24. package/src/automation/snapshot.zig +68 -9
  25. package/src/automation/watcher.zig +1 -1
  26. package/src/embed/host.zig +5 -0
  27. package/src/embed/tests.zig +119 -1
  28. package/src/embed/ui_host.zig +13 -0
  29. package/src/platform/linux/gtk_host.c +639 -16
  30. package/src/platform/linux/gtk_host.h +25 -0
  31. package/src/platform/linux/root.zig +351 -7
  32. package/src/platform/macos/appkit_host.h +152 -8
  33. package/src/platform/macos/appkit_host.m +1816 -100
  34. package/src/platform/macos/cef_host.mm +372 -11
  35. package/src/platform/macos/root.zig +379 -11
  36. package/src/platform/null_platform.zig +696 -9
  37. package/src/platform/null_platform_tests.zig +35 -0
  38. package/src/platform/root.zig +42 -0
  39. package/src/platform/types.zig +524 -18
  40. package/src/platform/windows/root.zig +432 -9
  41. package/src/platform/windows/webview2_host.cpp +482 -45
  42. package/src/primitives/app_manifest/comptime_scene.zig +5 -0
  43. package/src/primitives/app_manifest/root.zig +1 -0
  44. package/src/primitives/app_manifest/types.zig +32 -0
  45. package/src/primitives/app_manifest/validation.zig +18 -0
  46. package/src/primitives/canvas/a11y_audit.zig +33 -11
  47. package/src/primitives/canvas/a11y_audit_tests.zig +20 -0
  48. package/src/primitives/canvas/drawing.zig +25 -0
  49. package/src/primitives/canvas/equality.zig +8 -0
  50. package/src/primitives/canvas/events.zig +103 -16
  51. package/src/primitives/canvas/frame.zig +125 -1
  52. package/src/primitives/canvas/layout_audit.zig +22 -5
  53. package/src/primitives/canvas/markdown_hostile_tests.zig +8 -4
  54. package/src/primitives/canvas/render_tests.zig +13 -10
  55. package/src/primitives/canvas/root.zig +48 -0
  56. package/src/primitives/canvas/terminal_box.zig +471 -0
  57. package/src/primitives/canvas/terminal_grid.zig +978 -0
  58. package/src/primitives/canvas/terminal_grid_tests.zig +1093 -0
  59. package/src/primitives/canvas/test_support.zig +1 -0
  60. package/src/primitives/canvas/tests.zig +2 -0
  61. package/src/primitives/canvas/text_tests.zig +39 -4
  62. package/src/primitives/canvas/tokens.zig +115 -12
  63. package/src/primitives/canvas/ui.zig +535 -12
  64. package/src/primitives/canvas/ui_markup.zig +253 -36
  65. package/src/primitives/canvas/ui_markup_binary.zig +4 -1
  66. package/src/primitives/canvas/ui_markup_compiled.zig +195 -9
  67. package/src/primitives/canvas/ui_markup_compiled_tests.zig +188 -8
  68. package/src/primitives/canvas/ui_markup_contract.zig +89 -6
  69. package/src/primitives/canvas/ui_markup_contract_tests.zig +65 -1
  70. package/src/primitives/canvas/ui_markup_huge_document_tests.zig +154 -0
  71. package/src/primitives/canvas/ui_markup_huge_model_tests.zig +1 -0
  72. package/src/primitives/canvas/ui_markup_reflect.zig +75 -24
  73. package/src/primitives/canvas/ui_markup_tests.zig +178 -9
  74. package/src/primitives/canvas/ui_markup_view.zig +220 -11
  75. package/src/primitives/canvas/ui_markup_view_tests.zig +553 -28
  76. package/src/primitives/canvas/ui_schema.zig +110 -17
  77. package/src/primitives/canvas/ui_schema_tests.zig +18 -10
  78. package/src/primitives/canvas/ui_tests.zig +141 -9
  79. package/src/primitives/canvas/widget_access.zig +28 -2
  80. package/src/primitives/canvas/widget_anchored_tests.zig +48 -0
  81. package/src/primitives/canvas/widget_invalidation.zig +81 -1
  82. package/src/primitives/canvas/widget_layout.zig +59 -11
  83. package/src/primitives/canvas/widget_layout_tests.zig +125 -4
  84. package/src/primitives/canvas/widget_render.zig +272 -18
  85. package/src/primitives/canvas/widget_render_scroll.zig +108 -27
  86. package/src/primitives/canvas/widget_routing.zig +59 -7
  87. package/src/primitives/canvas/widget_runtime.zig +23 -0
  88. package/src/primitives/canvas/widget_runtime_tests.zig +149 -0
  89. package/src/primitives/canvas/widget_semantics.zig +119 -11
  90. package/src/primitives/canvas/widget_semantics_tests.zig +409 -0
  91. package/src/primitives/canvas/widget_tree.zig +17 -0
  92. package/src/primitives/canvas/widgets.zig +132 -0
  93. package/src/root.zig +23 -0
  94. package/src/runtime/api.zig +76 -5
  95. package/src/runtime/automation_commands.zig +20 -1
  96. package/src/runtime/automation_snapshot.zig +25 -1
  97. package/src/runtime/automation_widget_dispatch.zig +73 -8
  98. package/src/runtime/bridge_payload.zig +8 -0
  99. package/src/runtime/bridge_responses.zig +5 -0
  100. package/src/runtime/builtin_bridge.zig +9 -4
  101. package/src/runtime/canvas_font_tests.zig +439 -2
  102. package/src/runtime/canvas_fonts.zig +61 -6
  103. package/src/runtime/canvas_frame.zig +62 -7
  104. package/src/runtime/canvas_frame_animation_tests.zig +5 -4
  105. package/src/runtime/canvas_frame_helpers.zig +190 -1
  106. package/src/runtime/canvas_frame_invalidation_tests.zig +531 -0
  107. package/src/runtime/canvas_frame_patch_tests.zig +161 -10
  108. package/src/runtime/canvas_frame_retained_tests.zig +5 -2
  109. package/src/runtime/canvas_image_tests.zig +195 -0
  110. package/src/runtime/canvas_images.zig +45 -12
  111. package/src/runtime/canvas_widget_accessibility_tests.zig +1 -1
  112. package/src/runtime/canvas_widget_clipboard_tests.zig +40 -0
  113. package/src/runtime/canvas_widget_context_menu.zig +269 -32
  114. package/src/runtime/canvas_widget_context_menu_tests.zig +640 -14
  115. package/src/runtime/canvas_widget_display.zig +1 -1
  116. package/src/runtime/canvas_widget_event_tests.zig +1823 -0
  117. package/src/runtime/canvas_widget_events.zig +240 -24
  118. package/src/runtime/canvas_widget_runtime.zig +213 -29
  119. package/src/runtime/canvas_widget_scroll_driver_tests.zig +170 -7
  120. package/src/runtime/canvas_widget_scroll_drivers.zig +151 -17
  121. package/src/runtime/canvas_widget_scroll_tests.zig +435 -23
  122. package/src/runtime/canvas_widget_state.zig +6 -0
  123. package/src/runtime/canvas_widget_text_tests.zig +1 -1
  124. package/src/runtime/core.zig +131 -13
  125. package/src/runtime/effects.zig +8136 -180
  126. package/src/runtime/effects_channel_tests.zig +3519 -0
  127. package/src/runtime/effects_fetch_tests.zig +89 -1
  128. package/src/runtime/effects_file_tests.zig +41 -1
  129. package/src/runtime/effects_image_tests.zig +1304 -0
  130. package/src/runtime/effects_pty_tests.zig +1362 -0
  131. package/src/runtime/effects_tests.zig +167 -9
  132. package/src/runtime/effects_video_tests.zig +3609 -0
  133. package/src/runtime/flow.zig +42 -4
  134. package/src/runtime/gpu_surface_events.zig +473 -13
  135. package/src/runtime/media_surface.zig +116 -11
  136. package/src/runtime/media_surface_tests.zig +61 -0
  137. package/src/runtime/pty.zig +1252 -0
  138. package/src/runtime/pty_windows.zig +1780 -0
  139. package/src/runtime/root.zig +36 -0
  140. package/src/runtime/runtime_event_tests.zig +20 -1
  141. package/src/runtime/session_blobs.zig +689 -0
  142. package/src/runtime/session_journal.zig +432 -62
  143. package/src/runtime/session_record.zig +43 -2
  144. package/src/runtime/session_replay.zig +556 -20
  145. package/src/runtime/session_tests.zig +2087 -1
  146. package/src/runtime/shell_layout.zig +7 -0
  147. package/src/runtime/terminal_session.zig +1569 -0
  148. package/src/runtime/terminal_session_tests.zig +450 -0
  149. package/src/runtime/terminal_vt_ghostty.zig +15 -0
  150. package/src/runtime/terminal_vt_stub.zig +13 -0
  151. package/src/runtime/testdata/fonts/NotoSansSC-Receipt.ttf +0 -0
  152. package/src/runtime/testdata/fonts/OFL.txt +93 -0
  153. package/src/runtime/tests.zig +8 -0
  154. package/src/runtime/ts_core_host.zig +1320 -45
  155. package/src/runtime/ts_core_host_tests.zig +1100 -1
  156. package/src/runtime/ts_ui_app.zig +23 -5
  157. package/src/runtime/ui_app.zig +2444 -69
  158. package/src/runtime/ui_app_tests.zig +3171 -744
  159. package/src/runtime/ui_app_virtual_variable_tests.zig +4 -2
  160. package/src/runtime/ui_app_window_tests.zig +736 -0
  161. package/src/runtime/view.zig +190 -2
  162. package/src/runtime/view_widget_scroll.zig +218 -68
  163. package/src/runtime/view_widget_text.zig +11 -2
  164. package/src/runtime/view_widget_tree.zig +111 -3
  165. package/src/runtime/window_command_bridge_tests.zig +117 -0
  166. package/src/runtime/window_storage.zig +77 -2
  167. package/src/runtime/window_view_runtime.zig +34 -2
  168. package/src/runtime/window_views.zig +62 -1
  169. package/src/terminal_session_tests_root.zig +15 -0
  170. package/src/tooling/manifest.zig +75 -0
  171. package/src/tooling/raw_manifest.zig +2 -0
  172. package/src/tooling/templates.zig +244 -8
@@ -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;
@@ -180,8 +182,9 @@ pub const DispatchErrorPolicy = enum { degrade, propagate };
180
182
  pub const Runtime = struct {
181
183
  options: Options,
182
184
  /// The allocator that owns every runtime-lifetime heap allocation
183
- /// (registered canvas font bytes, adopted media-surface texture
184
- /// buffers). Captured from `Options.allocator` at init precisely
185
+ /// (registered canvas font bytes, registered canvas image slot
186
+ /// buffers, adopted media-surface texture buffers). Captured from
187
+ /// `Options.allocator` at init precisely
185
188
  /// because `options` is public and mutable: allocation and free of
186
189
  /// owned storage can be a whole runtime lifetime apart, and they
187
190
  /// must resolve through ONE allocator identity. Mutating
@@ -230,6 +233,23 @@ pub const Runtime = struct {
230
233
  /// cannot analyze: honest absence, visible as such.
231
234
  audio_spectrum_bands: [platform.audio_spectrum_band_count]u8 = @splat(0),
232
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,
233
253
  shell_layouts: [platform.max_windows]RuntimeShellLayout = undefined,
234
254
  shell_layout_count: usize = 0,
235
255
  next_window_id: platform.WindowId = 2,
@@ -309,10 +329,50 @@ pub const Runtime = struct {
309
329
  /// provenance table exists (builder-only apps, release engines).
310
330
  automation_provenance_published: bool = false,
311
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,
312
367
  /// The in-flight native context-menu request: set when the
313
368
  /// platform is asked to present, resolved by the matching
314
369
  /// `context_menu_action` event. At most one menu tracks at a time.
315
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,
316
376
  canvas_widget_display_list_refresh_batch_depth: usize = 0,
317
377
  /// Nonzero while a gpu-surface input dispatch is live: accessibility
318
378
  /// publishes requested inside it defer to after the responding
@@ -361,11 +421,18 @@ pub const Runtime = struct {
361
421
  canvas_frame_render_override_samples: [max_canvas_render_overrides_per_view]canvas.CanvasRenderOverride = undefined,
362
422
  canvas_frame_render_override_combined: [max_canvas_render_overrides_per_view]canvas.CanvasRenderOverride = undefined,
363
423
  /// Runtime-registered canvas images (see canvas_images.zig): entry
364
- /// metadata, the per-slot pixel pool, and the `ReferenceImage` scratch
365
- /// the frame planner hands to renderers each plan.
424
+ /// metadata, the per-slot pixel buffers, and the `ReferenceImage`
425
+ /// scratch the frame planner hands to renderers each plan. Each
426
+ /// slot's buffer is ONE lazy slot-budget allocation from the frozen
427
+ /// `owned_allocator` at the slot's first registration (freed only by
428
+ /// `deinit`; unregister compaction swaps pointers and keeps vacated
429
+ /// buffers for reuse) — zero registered images cost zero bytes,
430
+ /// where an embedded pool at the budget would put 16 x 1 MiB =
431
+ /// 16 MiB in EVERY Runtime, the media-texture-pool regression's
432
+ /// twin.
366
433
  canvas_image_entries: [canvas_limits.max_registered_canvas_images]runtime_canvas_images.CanvasImageEntry = [_]runtime_canvas_images.CanvasImageEntry{.{}} ** canvas_limits.max_registered_canvas_images,
367
434
  canvas_image_count: usize = 0,
368
- canvas_image_pixels: [canvas_limits.max_registered_canvas_images][canvas_limits.max_registered_canvas_image_pixel_bytes]u8 = undefined,
435
+ canvas_image_pixels: [canvas_limits.max_registered_canvas_images][]u8 = [_][]u8{&.{}} ** canvas_limits.max_registered_canvas_images,
369
436
  /// `ReferenceImage` scratch the frame planner hands to renderers
370
437
  /// each plan: the registered images plus the adopted media-surface
371
438
  /// textures (appended as `presentation_only` entries).
@@ -451,10 +518,16 @@ pub const Runtime = struct {
451
518
  }
452
519
 
453
520
  /// Release the runtime's heap-owned on-demand storage (registered
454
- /// canvas font bytes and adopted media-surface texture buffers,
455
- /// allocated from the init-frozen `owned_allocator`) and disarm the
456
- /// media-surface wake bindings (a producer thread must never wake a
457
- /// dead host). Ends the runtime's life: parsed faces, atlas keys,
521
+ /// canvas font bytes, registered canvas image slot buffers, and
522
+ /// adopted media-surface texture buffers, allocated from the
523
+ /// init-frozen `owned_allocator`), return each registered font's
524
+ /// host-side registration (through the unregister owner captured
525
+ /// into the entry at registration time — host font state is
526
+ /// per-process, this runtime's ids are not, and live `options` may
527
+ /// no longer name the host that received the registration), and
528
+ /// disarm the media-surface wake bindings (a producer
529
+ /// thread must never wake a dead host). Ends the runtime's life:
530
+ /// parsed faces, atlas keys,
458
531
  /// measure providers, adopted textures, and the resource slices
459
532
  /// built over them are invalid past this point. Process-lifetime
460
533
  /// embeddings (the app runner) may skip it — the default
@@ -464,7 +537,36 @@ pub const Runtime = struct {
464
537
  /// host) call it to return the storage.
465
538
  pub fn deinit(self: *Runtime) void {
466
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
+ }
467
545
  for (self.canvas_font_entries[0..self.canvas_font_count]) |entry| {
546
+ // Return the HOST side of the registration before the bytes:
547
+ // registration pushed the face to platforms with host-side
548
+ // text (macOS installs a CoreText descriptor plus caches,
549
+ // keyed by an id that is only permanent per-RUNTIME while
550
+ // that host state is per-process), so a deinit that freed
551
+ // only the Zig-side bytes would leave an embedder cycling
552
+ // runtimes growing host font state for the process lifetime.
553
+ // Through the entry's owner captured at registration time,
554
+ // never live `options`: the option is publicly mutable, and
555
+ // an embedder that swapped the platform after registering
556
+ // must see this land on the host that holds the
557
+ // registration, not on the current platform or a null seam
558
+ // (the `owned_allocator` identity discipline two lines
559
+ // down, applied to the host). Best-effort by design —
560
+ // deinit cannot fail, and a null owner means the platform
561
+ // at registration time retained nothing to return. The
562
+ // entry's ownership token rides along so the host removes
563
+ // ONLY this runtime's registration: a later runtime may
564
+ // have re-registered the id (last wins), and presenting a
565
+ // stale token is a no-op accept — the newer runtime's live
566
+ // face survives this deinit.
567
+ if (entry.host_unregister_fn) |host_unregister_fn| {
568
+ host_unregister_fn(entry.host_unregister_context, entry.id, entry.host_registration_token) catch {};
569
+ }
468
570
  // Through the frozen identity, never `options.allocator`:
469
571
  // an embedder may have swapped the public option since these
470
572
  // bytes were made, and a free must hit the allocator that
@@ -472,6 +574,12 @@ pub const Runtime = struct {
472
574
  self.owned_allocator.free(entry.bytes);
473
575
  }
474
576
  self.canvas_font_count = 0;
577
+ for (&self.canvas_image_pixels) |*buffer| {
578
+ if (buffer.len != 0) self.owned_allocator.free(buffer.*);
579
+ buffer.* = &.{};
580
+ }
581
+ self.canvas_image_entries = [_]runtime_canvas_images.CanvasImageEntry{.{}} ** canvas_limits.max_registered_canvas_images;
582
+ self.canvas_image_count = 0;
475
583
  for (&self.media_surface_pixels) |*buffer| {
476
584
  if (buffer.len != 0) self.owned_allocator.free(buffer.*);
477
585
  buffer.* = &.{};
@@ -533,6 +641,7 @@ pub const Runtime = struct {
533
641
  pub const respondToBridge = FlowMethods.respondToBridge;
534
642
  pub const dispatchPlatformEvent = FlowMethods.dispatchPlatformEvent;
535
643
  pub const dispatchEvent = FlowMethods.dispatchEvent;
644
+ pub const recordDispatchError = FlowMethods.recordDispatchError;
536
645
  pub const dispatchCommand = FlowMethods.dispatchCommand;
537
646
  pub const frame = FlowMethods.frame;
538
647
  pub const automationSnapshot = FlowMethods.automationSnapshot;
@@ -550,6 +659,8 @@ pub const Runtime = struct {
550
659
  pub const focusWindow = WindowViewMethods.focusWindow;
551
660
  pub const closeWindow = WindowViewMethods.closeWindow;
552
661
  pub const minimizeWindow = WindowViewMethods.minimizeWindow;
662
+ pub const showWindow = WindowViewMethods.showWindow;
663
+ pub const quitApp = WindowViewMethods.quitApp;
553
664
  pub const createShellWindow = WindowViewMethods.createShellWindow;
554
665
  pub const createSourcelessShellWindow = WindowViewMethods.createSourcelessShellWindow;
555
666
  pub const createShellViews = WindowViewMethods.createShellViews;
@@ -612,7 +723,9 @@ pub const Runtime = struct {
612
723
  const relayoutDescendantWebViewBackends = WindowViewMethods.relayoutDescendantWebViewBackends;
613
724
  const relayoutDescendantWebViewBackendsDepth = WindowViewMethods.relayoutDescendantWebViewBackendsDepth;
614
725
  const reserveView = WindowViewMethods.reserveView;
615
- const findViewIndex = WindowViewMethods.findViewIndex;
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;
616
729
  const commandSourceForNativeView = WindowViewMethods.commandSourceForNativeView;
617
730
  const setFocusedView = WindowViewMethods.setFocusedView;
618
731
  const clearFocusedView = WindowViewMethods.clearFocusedView;
@@ -792,6 +905,7 @@ pub const Runtime = struct {
792
905
  pub const adoptMediaSurfaceFrames = MediaSurfaceMethods.adoptMediaSurfaceFrames;
793
906
  pub const disarmMediaSurfaceWakes = MediaSurfaceMethods.disarmMediaSurfaceWakes;
794
907
  pub const adoptedMediaSurfaceTexture = MediaSurfaceMethods.adoptedMediaSurfaceTexture;
908
+ pub const mediaSurfaceBinding = MediaSurfaceMethods.mediaSurfaceBinding;
795
909
  const adoptedMediaSurfaceTextures = MediaSurfaceMethods.adoptedMediaSurfaceTextures;
796
910
 
797
911
  const CanvasFontMethods = runtime_canvas_fonts.RuntimeCanvasFonts(Runtime);
@@ -820,7 +934,10 @@ pub const Runtime = struct {
820
934
  pub const emitCanvasWidgetDisplayListWithChrome = CanvasWidgetDisplayMethods.emitCanvasWidgetDisplayListWithChrome;
821
935
  pub const emitCanvasWidgetDisplayListWithStoredTokensAndChrome = CanvasWidgetDisplayMethods.emitCanvasWidgetDisplayListWithStoredTokensAndChrome;
822
936
  const emitCanvasWidgetDisplayListForViewWithChrome = CanvasWidgetDisplayMethods.emitCanvasWidgetDisplayListForViewWithChrome;
823
- const refreshCanvasWidgetDisplayListIfOwned = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwned;
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;
824
941
  const refreshCanvasWidgetDisplayListIfOwnedSkippingAccessibility = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwnedSkippingAccessibility;
825
942
  const refreshCanvasWidgetDisplayListIfOwnedWithAccessibility = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwnedWithAccessibility;
826
943
  const refreshCanvasWidgetDisplayListIfOwnedWithAccessibilityImmediate = CanvasWidgetDisplayMethods.refreshCanvasWidgetDisplayListIfOwnedWithAccessibilityImmediate;
@@ -917,7 +1034,7 @@ pub fn TestHarness() type {
917
1034
  pub fn destroy(self: *Self, gpa: std.mem.Allocator) void {
918
1035
  // The harness embeds the runtime's platform: deinit both
919
1036
  // returns the runtime's heap-owned storage (registered font
920
- // bytes, lazily allocated media buffers) to the leak-checked
1037
+ // bytes, lazily allocated image and media buffers) to the leak-checked
921
1038
  // test allocator AND disarms the wake bindings, so a
922
1039
  // producer handle a test keeps past destroy (the orphan
923
1040
  // tests) can never wake the freed host — the run loop's exit
@@ -933,7 +1050,8 @@ pub fn TestHarness() type {
933
1050
  .platform = self.null_platform.platform(),
934
1051
  .trace_sink = self.trace_sink.sink(),
935
1052
  // On-demand runtime storage (registered font bytes,
936
- // adopted media-surface texture buffers) routes through
1053
+ // registered image slot buffers, adopted media-surface
1054
+ // texture buffers) routes through
937
1055
  // the leak-checked test allocator (freed by `destroy`
938
1056
  // via Runtime.deinit), so a registration or adoption
939
1057
  // that leaks fails the test that made it.