@opentui/core 0.6.8 → 0.8.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 (60) hide show
  1. package/NativeScene.d.ts +14 -29
  2. package/Renderable.d.ts +47 -34
  3. package/animation/Timeline.d.ts +9 -0
  4. package/audio.d.ts +1 -0
  5. package/buffer.d.ts +6 -2
  6. package/{chunk-bun-4e5bpeqh.js → chunk-bun-6kxdhkdc.js} +1243 -1034
  7. package/chunk-bun-6kxdhkdc.js.map +70 -0
  8. package/{chunk-bun-ehr9v0n8.js → chunk-bun-x6cz4jyg.js} +514 -84
  9. package/chunk-bun-x6cz4jyg.js.map +35 -0
  10. package/{chunk-node-yyjd8p1g.js → chunk-node-q5ccgbk5.js} +1243 -1034
  11. package/chunk-node-q5ccgbk5.js.map +70 -0
  12. package/{chunk-node-jhq62x0c.js → chunk-node-y0w0hq5m.js} +514 -84
  13. package/chunk-node-y0w0hq5m.js.map +34 -0
  14. package/edit-buffer.d.ts +4 -0
  15. package/index.bun.js +1086 -549
  16. package/index.bun.js.map +15 -13
  17. package/index.d.ts +1 -1
  18. package/index.node.js +1086 -549
  19. package/index.node.js.map +16 -12
  20. package/lib/detect-links.d.ts +2 -0
  21. package/lib/extmarks.d.ts +3 -1
  22. package/lib/parse.keypress-kitty.d.ts +2 -0
  23. package/lib/scroll-chain.d.ts +16 -0
  24. package/lib/stdin-parser-native.d.ts +90 -0
  25. package/lib/stdin-parser.d.ts +2 -0
  26. package/lib/terminal-capability-detection.d.ts +6 -1
  27. package/native-abi.generated.d.ts +700 -7
  28. package/package.json +9 -9
  29. package/renderables/Box.d.ts +2 -2
  30. package/renderables/Code.d.ts +2 -1
  31. package/renderables/Diff.d.ts +2 -2
  32. package/renderables/EditBufferRenderable.d.ts +2 -2
  33. package/renderables/EmbeddedTerminal.d.ts +2 -2
  34. package/renderables/FrameBuffer.d.ts +4 -3
  35. package/renderables/Image.d.ts +2 -2
  36. package/renderables/Markdown.d.ts +2 -2
  37. package/renderables/ScrollBar.d.ts +9 -3
  38. package/renderables/ScrollBox.d.ts +87 -44
  39. package/renderables/ScrollBoxParts.d.ts +165 -0
  40. package/renderables/Slider.d.ts +2 -2
  41. package/renderables/Text.d.ts +2 -2
  42. package/renderables/TextBufferRenderable.d.ts +2 -4
  43. package/renderables/index.d.ts +1 -1
  44. package/renderer-theme-mode.d.ts +1 -6
  45. package/renderer.d.ts +30 -7
  46. package/testing/test-renderer.d.ts +4 -0
  47. package/testing.bun.js +12 -4
  48. package/testing.bun.js.map +3 -3
  49. package/testing.js +12 -4
  50. package/testing.js.map +3 -3
  51. package/types.d.ts +11 -0
  52. package/yoga.bun.js +1 -1
  53. package/yoga.internal.d.ts +3 -3
  54. package/yoga.js +1 -1
  55. package/zig-structs.d.ts +26 -0
  56. package/zig.d.ts +96 -13
  57. package/chunk-bun-4e5bpeqh.js.map +0 -69
  58. package/chunk-bun-ehr9v0n8.js.map +0 -35
  59. package/chunk-node-jhq62x0c.js.map +0 -34
  60. package/chunk-node-yyjd8p1g.js.map +0 -69
@@ -156,7 +156,7 @@ __export(exports_yoga, {
156
156
  var nativeSymbols = {
157
157
  ot_scene_set_hooks: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
158
158
  ot_scene_frame_step_with_geometry: {
159
- args: ["ptr", "buffer", "ptr", "buffer", "u32", "ptr", "u32", "buffer", "buffer"],
159
+ args: ["ptr", "buffer", "ptr", "buffer", "ptr", "u32", "buffer", "buffer"],
160
160
  returns: "i32"
161
161
  },
162
162
  ot_scene_frame_get_paint_slots: { args: ["ptr", "buffer", "buffer", "buffer", "u32", "buffer"], returns: "i32" },
@@ -174,6 +174,11 @@ var nativeSymbols = {
174
174
  ot_scene_set_surface: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
175
175
  ot_scene_set_box_details: { args: ["ptr", "buffer", "buffer", "ptr", "u32", "ptr", "u32"], returns: "i32" },
176
176
  ot_scene_set_viewport: { args: ["ptr", "buffer", "ptr"], returns: "i32" },
177
+ ot_scene_set_scroll: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
178
+ ot_scene_set_scroll_arrow: { args: ["ptr", "buffer", "u32", "u32", "buffer", "ptr", "u32"], returns: "i32" },
179
+ ot_scene_scroll_to: { args: ["ptr", "buffer", "f64", "f64", "u32", "ptr"], returns: "i32" },
180
+ ot_scene_scroll_request: { args: ["ptr", "buffer", "u32", "ptr", "u32", "u32", "ptr"], returns: "i32" },
181
+ ot_scene_get_scroll: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
177
182
  ot_scene_set_focus: { args: ["ptr", "buffer", "u32"], returns: "i32" },
178
183
  ot_scene_set_slider: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
179
184
  ot_scene_set_arrow: { args: ["ptr", "buffer", "buffer", "ptr", "u32"], returns: "i32" },
@@ -191,6 +196,7 @@ var nativeSymbols = {
191
196
  ot_scene_paint: { args: ["ptr", "buffer", "buffer", "u32", "u32", "buffer"], returns: "i32" },
192
197
  ot_scene_hit_test: { args: ["ptr", "buffer", "i32", "i32", "buffer"], returns: "i32" },
193
198
  ot_scene_get_stats: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
199
+ ot_scene_set_debug_flags: { args: ["ptr", "buffer", "u32"], returns: "i32" },
194
200
  ot_scene_get_cursor_state: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
195
201
  ot_scene_frame_copy_buffer: { args: ["ptr", "buffer", "buffer", "buffer"], returns: "i32" },
196
202
  ot_scene_measure_layout: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
@@ -329,7 +335,7 @@ var nativeSymbols = {
329
335
  ot_scene_set_text_view_paint: { args: ["ptr", "buffer", "u32"], returns: "i32" },
330
336
  ot_buffer_draw_text_view: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
331
337
  ot_buffer_draw_editor_view: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
332
- ot_buffer_draw_scene_text: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
338
+ ot_buffer_draw_scene_body: { args: ["ptr", "buffer", "ptr", "buffer", "i32", "i32"], returns: "i32" },
333
339
  ot_scene_frame_acquire_buffer_lease: { args: ["ptr", "buffer", "buffer", "u32", "buffer"], returns: "i32" },
334
340
  ot_scene_frame_commit: { args: ["ptr", "buffer", "buffer", "u32", "buffer"], returns: "i32" },
335
341
  ot_context_abi_version: { args: [], returns: "u32" },
@@ -392,6 +398,12 @@ var nativeSymbols = {
392
398
  ot_session_set_palette_state: { args: ["ptr", "buffer", "buffer", "u32", "buffer", "buffer", "u32"], returns: "i32" },
393
399
  ot_session_notification: { args: ["ptr", "buffer", "buffer", "u32", "ptr", "u32", "buffer"], returns: "i32" },
394
400
  ot_session_pump: { args: ["ptr", "buffer", "u64", "u32", "buffer"], returns: "i32" },
401
+ ot_session_input_feed: {
402
+ args: ["ptr", "buffer", "ptr", "u32", "u64", "buffer", "u32", "buffer", "u32", "buffer"],
403
+ returns: "i32"
404
+ },
405
+ ot_session_input_expect: { args: ["ptr", "buffer", "u32"], returns: "i32" },
406
+ ot_session_input_reset: { args: ["ptr", "buffer", "u32"], returns: "i32" },
395
407
  ot_session_get_write_limit: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
396
408
  ot_session_write: { args: ["ptr", "buffer", "ptr", "u32"], returns: "i32" },
397
409
  ot_session_read_output: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
@@ -618,7 +630,7 @@ var nativeLayouts = {
618
630
  }
619
631
  },
620
632
  ot_scene_stats: {
621
- size: 64,
633
+ size: 224,
622
634
  alignment: 8,
623
635
  fields: {
624
636
  struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
@@ -631,7 +643,29 @@ var nativeLayouts = {
631
643
  cells_updated: { offset: 48, size: 4, alignment: 4, type: "u32" },
632
644
  average_cells_updated: { offset: 52, size: 4, alignment: 4, type: "u32" },
633
645
  render_time_valid: { offset: 56, size: 4, alignment: 4, type: "u32" },
634
- stdout_write_time_valid: { offset: 60, size: 4, alignment: 4, type: "u32" }
646
+ stdout_write_time_valid: { offset: 60, size: 4, alignment: 4, type: "u32" },
647
+ work_frame_id: { offset: 64, size: 8, alignment: 8, type: "u64" },
648
+ candidate_visits: { offset: 72, size: 8, alignment: 8, type: "u64" },
649
+ paint_visits: { offset: 80, size: 8, alignment: 8, type: "u64" },
650
+ view_preparations: { offset: 88, size: 8, alignment: 8, type: "u64" },
651
+ geometry_reads: { offset: 96, size: 8, alignment: 8, type: "u64" },
652
+ yoga_solves: { offset: 104, size: 8, alignment: 8, type: "u64" },
653
+ feedback_operations: { offset: 112, size: 8, alignment: 8, type: "u64" },
654
+ visibility_steps: { offset: 120, size: 8, alignment: 8, type: "u64" },
655
+ viewport_child_refreshes: { offset: 128, size: 8, alignment: 8, type: "u64" },
656
+ overlap_tests: { offset: 136, size: 8, alignment: 8, type: "u64" },
657
+ members_painted: { offset: 144, size: 8, alignment: 8, type: "u64" },
658
+ member_cells: { offset: 152, size: 8, alignment: 8, type: "u64" },
659
+ cells_cleared: { offset: 160, size: 8, alignment: 8, type: "u64" },
660
+ hit_cells_written: { offset: 168, size: 8, alignment: 8, type: "u64" },
661
+ hit_cells_cleared: { offset: 176, size: 8, alignment: 8, type: "u64" },
662
+ hit_cells_compared: { offset: 184, size: 8, alignment: 8, type: "u64" },
663
+ rows_compared: { offset: 192, size: 8, alignment: 8, type: "u64" },
664
+ rows_diffed: { offset: 200, size: 8, alignment: 8, type: "u64" },
665
+ full_path_reasons: { offset: 208, size: 4, alignment: 4, type: "u32" },
666
+ host_requests: { offset: 212, size: 4, alignment: 4, type: "u32" },
667
+ layout_rounds: { offset: 216, size: 4, alignment: 4, type: "u32" },
668
+ damage_rows: { offset: 220, size: 4, alignment: 4, type: "u32" }
635
669
  }
636
670
  },
637
671
  ot_scene_cursor_state: {
@@ -751,6 +785,66 @@ var nativeLayouts = {
751
785
  reserved: { offset: 12, size: 4, alignment: 4, type: "u32" }
752
786
  }
753
787
  },
788
+ ot_scene_scroll_bar_options: {
789
+ size: 40,
790
+ alignment: 4,
791
+ fields: {
792
+ policy: { offset: 0, size: 4, alignment: 4, type: "u32" },
793
+ placement: { offset: 4, size: 4, alignment: 4, type: "u32" },
794
+ thickness: { offset: 8, size: 4, alignment: 4, type: "u32" },
795
+ gap: { offset: 12, size: 4, alignment: 4, type: "u32" },
796
+ arrows: { offset: 16, size: 4, alignment: 4, type: "u32" },
797
+ reserved: { offset: 20, size: 4, alignment: 4, type: "u32" },
798
+ track_foreground: { offset: 24, size: 8, alignment: 2, type: "[4]u16" },
799
+ track_background: { offset: 32, size: 8, alignment: 2, type: "[4]u16" }
800
+ }
801
+ },
802
+ ot_scene_scroll_options: {
803
+ size: 144,
804
+ alignment: 4,
805
+ fields: {
806
+ struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
807
+ abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
808
+ axes: { offset: 8, size: 4, alignment: 4, type: "u32" },
809
+ follow: { offset: 12, size: 4, alignment: 4, type: "u32" },
810
+ culling: { offset: 16, size: 4, alignment: 4, type: "u32" },
811
+ fills: { offset: 20, size: 4, alignment: 4, type: "u32" },
812
+ padding: { offset: 24, size: 16, alignment: 4, type: "[4]f32" },
813
+ wrapper_background: { offset: 40, size: 8, alignment: 2, type: "[4]u16" },
814
+ viewport_background: { offset: 48, size: 8, alignment: 2, type: "[4]u16" },
815
+ content_background: { offset: 56, size: 8, alignment: 2, type: "[4]u16" },
816
+ bars: { offset: 64, size: 80, alignment: 4, type: "[2]ot_scene_scroll_bar_options" }
817
+ }
818
+ },
819
+ ot_scene_scroll_bar_state: {
820
+ size: 120,
821
+ alignment: 8,
822
+ fields: {
823
+ visible: { offset: 0, size: 4, alignment: 4, type: "u32" },
824
+ reserved: { offset: 4, size: 4, alignment: 4, type: "u32" },
825
+ track: { offset: 8, size: 32, alignment: 8, type: "[4]f64" },
826
+ start_arrow: { offset: 40, size: 32, alignment: 8, type: "[4]f64" },
827
+ end_arrow: { offset: 72, size: 32, alignment: 8, type: "[4]f64" },
828
+ thumb_start: { offset: 104, size: 8, alignment: 8, type: "f64" },
829
+ thumb_size: { offset: 112, size: 8, alignment: 8, type: "f64" }
830
+ }
831
+ },
832
+ ot_scene_scroll_state: {
833
+ size: 360,
834
+ alignment: 8,
835
+ fields: {
836
+ struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
837
+ abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
838
+ stuck: { offset: 8, size: 4, alignment: 4, type: "u32" },
839
+ changes: { offset: 12, size: 4, alignment: 4, type: "u32" },
840
+ generation: { offset: 16, size: 8, alignment: 8, type: "u64" },
841
+ offset: { offset: 24, size: 16, alignment: 8, type: "[2]f64" },
842
+ max: { offset: 40, size: 16, alignment: 8, type: "[2]f64" },
843
+ content: { offset: 56, size: 32, alignment: 8, type: "[4]f64" },
844
+ viewport: { offset: 88, size: 32, alignment: 8, type: "[4]f64" },
845
+ bars: { offset: 120, size: 240, alignment: 8, type: "[2]ot_scene_scroll_bar_state" }
846
+ }
847
+ },
754
848
  ot_session_options: {
755
849
  size: 32,
756
850
  alignment: 8,
@@ -1357,6 +1451,37 @@ var nativeLayouts = {
1357
1451
  deadline_ns: { offset: 16, size: 8, alignment: 8, type: "u64" }
1358
1452
  }
1359
1453
  },
1454
+ ot_input_event: {
1455
+ size: 32,
1456
+ alignment: 4,
1457
+ fields: {
1458
+ kind: { offset: 0, size: 1, alignment: 1, type: "u8" },
1459
+ action: { offset: 1, size: 1, alignment: 1, type: "u8" },
1460
+ modifiers: { offset: 2, size: 1, alignment: 1, type: "u8" },
1461
+ flags: { offset: 3, size: 1, alignment: 1, type: "u8" },
1462
+ code: { offset: 4, size: 4, alignment: 4, type: "u32" },
1463
+ base_code: { offset: 8, size: 4, alignment: 4, type: "u32" },
1464
+ x: { offset: 12, size: 2, alignment: 2, type: "u16" },
1465
+ y: { offset: 14, size: 2, alignment: 2, type: "u16" },
1466
+ raw_offset: { offset: 16, size: 4, alignment: 4, type: "u32" },
1467
+ raw_len: { offset: 20, size: 4, alignment: 4, type: "u32" },
1468
+ text_offset: { offset: 24, size: 4, alignment: 4, type: "u32" },
1469
+ text_len: { offset: 28, size: 4, alignment: 4, type: "u32" }
1470
+ }
1471
+ },
1472
+ ot_input_drain: {
1473
+ size: 32,
1474
+ alignment: 8,
1475
+ fields: {
1476
+ struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
1477
+ abi_version: { offset: 4, size: 4, alignment: 4, type: "u32" },
1478
+ consumed: { offset: 8, size: 4, alignment: 4, type: "u32" },
1479
+ count: { offset: 12, size: 4, alignment: 4, type: "u32" },
1480
+ payload_len: { offset: 16, size: 4, alignment: 4, type: "u32" },
1481
+ discarded: { offset: 20, size: 4, alignment: 4, type: "u32" },
1482
+ deadline_ns: { offset: 24, size: 8, alignment: 8, type: "u64" }
1483
+ }
1484
+ },
1360
1485
  ot_context_options: {
1361
1486
  size: 32,
1362
1487
  alignment: 4,
@@ -1539,7 +1664,7 @@ var nativeLayouts = {
1539
1664
  }
1540
1665
  };
1541
1666
  var nativeConstants = {
1542
- OT_CONTEXT_ABI_VERSION: 1,
1667
+ OT_CONTEXT_ABI_VERSION: 2,
1543
1668
  OT_OK: 0,
1544
1669
  OT_INVALID_ARGUMENT: -1,
1545
1670
  OT_UNSUPPORTED_VERSION: -2,
@@ -1600,6 +1725,7 @@ var nativeConstants = {
1600
1725
  OT_STYLE_BORDER_WIDTH: 0,
1601
1726
  OT_STYLE_FLAGS_NONE: 0,
1602
1727
  OT_STYLE_DISABLE_FLEX_SHRINK: 1,
1728
+ OT_STYLE_CONTENT: 2,
1603
1729
  OT_STYLE_ENUM_DIRECTION: 0,
1604
1730
  OT_STYLE_ENUM_FLEX_DIRECTION: 1,
1605
1731
  OT_STYLE_ENUM_JUSTIFY_CONTENT: 2,
@@ -1724,6 +1850,13 @@ var nativeConstants = {
1724
1850
  OT_SCENE_TEXT_BACKGROUND: 2,
1725
1851
  OT_SCENE_TEXT_LINK: 4,
1726
1852
  OT_SCENE_MUTATIONS_MAX: 4096,
1853
+ OT_SCENE_FULL_PATH_FORCED: 1,
1854
+ OT_SCENE_FULL_PATH_SCREEN: 2,
1855
+ OT_SCENE_FULL_PATH_IMAGES: 4,
1856
+ OT_SCENE_FULL_PATH_TAINTED: 8,
1857
+ OT_SCENE_FULL_PATH_UNRETAINED: 16,
1858
+ OT_SCENE_FULL_PATH_OPTIONS: 32,
1859
+ OT_SCENE_FULL_PATH_NON_LOCAL: 64,
1727
1860
  OT_SCENE_HOOK_UPDATE: 1,
1728
1861
  OT_SCENE_HOOK_RESIZE: 2,
1729
1862
  OT_SCENE_HOOK_LAYOUT_CHANGED: 4,
@@ -1731,12 +1864,13 @@ var nativeConstants = {
1731
1864
  OT_SCENE_HOOK_RENDER_AFTER: 16,
1732
1865
  OT_SCENE_HOOK_RENDER_SELF: 32,
1733
1866
  OT_SCENE_HOOK_IDLE_UPDATE: 64,
1867
+ OT_SCENE_HOOK_SCROLL: 128,
1734
1868
  OT_SCENE_FRAME_DONE: 0,
1735
1869
  OT_SCENE_FRAME_UPDATE: 1,
1736
1870
  OT_SCENE_FRAME_RESIZE: 2,
1737
1871
  OT_SCENE_FRAME_LAYOUT_CHANGED: 3,
1738
1872
  OT_SCENE_FRAME_RECORD: 4,
1739
- OT_SCENE_FRAME_YIELD: 5,
1873
+ OT_SCENE_FRAME_SCROLL: 5,
1740
1874
  OT_SCENE_GEOMETRY_PAINT: 1,
1741
1875
  OT_SCENE_GEOMETRY_PUBLIC: 2,
1742
1876
  OT_SCENE_PROPERTY_Z_INDEX: 1,
@@ -1754,6 +1888,37 @@ var nativeConstants = {
1754
1888
  OT_SCENE_PROPERTY_RESET_BORDER_CHARACTERS: 4096,
1755
1889
  OT_SCENE_PROPERTY_RECORD_MAX: 88,
1756
1890
  OT_SCENE_PROPERTY_BYTES_MAX: 360448,
1891
+ OT_SCENE_SCROLL_X: 1,
1892
+ OT_SCENE_SCROLL_Y: 2,
1893
+ OT_SCENE_SCROLL_FOLLOW_NONE: 0,
1894
+ OT_SCENE_SCROLL_FOLLOW_TOP: 1,
1895
+ OT_SCENE_SCROLL_FOLLOW_BOTTOM: 2,
1896
+ OT_SCENE_SCROLL_FOLLOW_LEFT: 3,
1897
+ OT_SCENE_SCROLL_FOLLOW_RIGHT: 4,
1898
+ OT_SCENE_SCROLL_FILL_WRAPPER: 1,
1899
+ OT_SCENE_SCROLL_FILL_VIEWPORT: 2,
1900
+ OT_SCENE_SCROLL_FILL_CONTENT: 4,
1901
+ OT_SCENE_SCROLL_BAR_AUTO: 0,
1902
+ OT_SCENE_SCROLL_BAR_ALWAYS: 1,
1903
+ OT_SCENE_SCROLL_BAR_NEVER: 2,
1904
+ OT_SCENE_SCROLL_BAR_INSET: 0,
1905
+ OT_SCENE_SCROLL_BAR_OVERLAY: 1,
1906
+ OT_SCENE_SCROLL_RELATIVE_X: 1,
1907
+ OT_SCENE_SCROLL_RELATIVE_Y: 2,
1908
+ OT_SCENE_SCROLL_REAPPLY: 4,
1909
+ OT_SCENE_SCROLL_REQUEST_INTO_VIEW: 0,
1910
+ OT_SCENE_SCROLL_REQUEST_ANCHOR: 1,
1911
+ OT_SCENE_SCROLL_REQUEST_LAYOUT: 2,
1912
+ OT_SCENE_SCROLL_ALIGN_NEAREST: 0,
1913
+ OT_SCENE_SCROLL_ALIGN_START: 1,
1914
+ OT_SCENE_SCROLL_ALIGN_END: 2,
1915
+ OT_SCENE_SCROLL_CHANGED_OFFSET_X: 1,
1916
+ OT_SCENE_SCROLL_CHANGED_OFFSET_Y: 2,
1917
+ OT_SCENE_SCROLL_CHANGED_CONTENT: 4,
1918
+ OT_SCENE_SCROLL_CHANGED_VIEWPORT: 8,
1919
+ OT_SCENE_SCROLL_CHANGED_LAYOUT: 16,
1920
+ OT_SCENE_DEBUG_FULL_FRAME: 1,
1921
+ OT_SCENE_DEBUG_VERIFY: 2,
1757
1922
  OT_SESSION_OPEN: 0,
1758
1923
  OT_SESSION_CLOSING: 1,
1759
1924
  OT_SESSION_CLOSED_STATE: 2,
@@ -1840,6 +2005,8 @@ var nativeConstants = {
1840
2005
  OT_EDIT_POSITION_OFFSET: 4,
1841
2006
  OT_EDIT_POSITION_COORDS: 5,
1842
2007
  OT_EDIT_POSITION_LINE_START: 6,
2008
+ OT_EDIT_POSITION_END: 7,
2009
+ OT_EDIT_POSITION_PREV_CHAR: 8,
1843
2010
  OT_EDITOR_STYLE_FOREGROUND: 1,
1844
2011
  OT_EDITOR_STYLE_BACKGROUND: 2,
1845
2012
  OT_EDITOR_STYLE_ATTRIBUTES: 4,
@@ -1848,6 +2015,7 @@ var nativeConstants = {
1848
2015
  OT_EDIT_HIGHLIGHT_REMOVE_REF: 2,
1849
2016
  OT_EDIT_HIGHLIGHT_CLEAR_LINE: 3,
1850
2017
  OT_EDIT_HIGHLIGHT_CLEAR_ALL: 4,
2018
+ OT_STYLE_RUN_FLAG: 2147483648,
1851
2019
  OT_EDITOR_MOVE_UP: 0,
1852
2020
  OT_EDITOR_MOVE_DOWN: 1,
1853
2021
  OT_EDITOR_GOTO_LINE_END: 2,
@@ -1956,6 +2124,10 @@ var nativeConstants = {
1956
2124
  OT_TERMINAL_MOUSE: 2,
1957
2125
  OT_TERMINAL_MOUSE_MOVEMENT: 4,
1958
2126
  OT_TERMINAL_CLEAR_ON_CLOSE: 8,
2127
+ OT_TERMINAL_REPLY_SENTINEL: 16,
2128
+ OT_TERMINAL_SYNC_ALWAYS: 32,
2129
+ OT_TERMINAL_SYNC_NEVER: 64,
2130
+ OT_TERMINAL_HOST_MULTIPLEXER: 128,
1959
2131
  OT_CONTROL_CAPABILITY_RESPONSE: 1,
1960
2132
  OT_CONTROL_TITLE: 2,
1961
2133
  OT_CONTROL_MOUSE: 3,
@@ -2015,6 +2187,118 @@ var nativeConstants = {
2015
2187
  OT_PUMP_OUTPUT_PENDING: 2,
2016
2188
  OT_PUMP_WAIT_UNTIL: 3,
2017
2189
  OT_PUMP_CLOSED: 4,
2190
+ OT_INPUT_KEY: 1,
2191
+ OT_INPUT_MOUSE: 2,
2192
+ OT_INPUT_PASTE: 3,
2193
+ OT_INPUT_FOCUS: 4,
2194
+ OT_INPUT_REPLY: 5,
2195
+ OT_INPUT_KEY_PRESS: 1,
2196
+ OT_INPUT_KEY_REPEAT: 2,
2197
+ OT_INPUT_KEY_RELEASE: 3,
2198
+ OT_INPUT_MOUSE_DOWN: 1,
2199
+ OT_INPUT_MOUSE_UP: 2,
2200
+ OT_INPUT_MOUSE_MOVE: 3,
2201
+ OT_INPUT_MOUSE_DRAG: 4,
2202
+ OT_INPUT_MOUSE_SCROLL: 5,
2203
+ OT_INPUT_MOUSE_BUTTON_NONE: 255,
2204
+ OT_INPUT_FOCUS_OUT: 0,
2205
+ OT_INPUT_FOCUS_IN: 1,
2206
+ OT_INPUT_MOD_SHIFT: 1,
2207
+ OT_INPUT_MOD_ALT: 2,
2208
+ OT_INPUT_MOD_CTRL: 4,
2209
+ OT_INPUT_MOD_SUPER: 8,
2210
+ OT_INPUT_MOD_HYPER: 16,
2211
+ OT_INPUT_MOD_META: 32,
2212
+ OT_INPUT_MOD_CAPS_LOCK: 64,
2213
+ OT_INPUT_MOD_NUM_LOCK: 128,
2214
+ OT_INPUT_KEY_KITTY: 1,
2215
+ OT_INPUT_KEY_TEXT_TRUNCATED: 2,
2216
+ OT_INPUT_PASTE_START: 1,
2217
+ OT_INPUT_PASTE_END: 2,
2218
+ OT_INPUT_REPLY_FRAGMENT: 1,
2219
+ OT_INPUT_REPLY_CURSOR_POSITION: 2,
2220
+ OT_INPUT_REPLY_CSI: 1,
2221
+ OT_INPUT_REPLY_SS3: 2,
2222
+ OT_INPUT_REPLY_OSC: 3,
2223
+ OT_INPUT_REPLY_DCS: 4,
2224
+ OT_INPUT_REPLY_APC: 5,
2225
+ OT_INPUT_KEY_ESCAPE: 27,
2226
+ OT_INPUT_KEY_ENTER: 13,
2227
+ OT_INPUT_KEY_TAB: 9,
2228
+ OT_INPUT_KEY_BACKSPACE: 127,
2229
+ OT_INPUT_KEY_INSERT: 57348,
2230
+ OT_INPUT_KEY_DELETE: 57349,
2231
+ OT_INPUT_KEY_LEFT: 57350,
2232
+ OT_INPUT_KEY_RIGHT: 57351,
2233
+ OT_INPUT_KEY_UP: 57352,
2234
+ OT_INPUT_KEY_DOWN: 57353,
2235
+ OT_INPUT_KEY_PAGE_UP: 57354,
2236
+ OT_INPUT_KEY_PAGE_DOWN: 57355,
2237
+ OT_INPUT_KEY_HOME: 57356,
2238
+ OT_INPUT_KEY_END: 57357,
2239
+ OT_INPUT_KEY_CAPS_LOCK: 57358,
2240
+ OT_INPUT_KEY_SCROLL_LOCK: 57359,
2241
+ OT_INPUT_KEY_NUM_LOCK: 57360,
2242
+ OT_INPUT_KEY_PRINT_SCREEN: 57361,
2243
+ OT_INPUT_KEY_PAUSE: 57362,
2244
+ OT_INPUT_KEY_MENU: 57363,
2245
+ OT_INPUT_KEY_F1: 57364,
2246
+ OT_INPUT_KEY_F35: 57398,
2247
+ OT_INPUT_KEY_KP_0: 57399,
2248
+ OT_INPUT_KEY_KP_9: 57408,
2249
+ OT_INPUT_KEY_KP_DECIMAL: 57409,
2250
+ OT_INPUT_KEY_KP_DIVIDE: 57410,
2251
+ OT_INPUT_KEY_KP_MULTIPLY: 57411,
2252
+ OT_INPUT_KEY_KP_SUBTRACT: 57412,
2253
+ OT_INPUT_KEY_KP_ADD: 57413,
2254
+ OT_INPUT_KEY_KP_ENTER: 57414,
2255
+ OT_INPUT_KEY_KP_EQUAL: 57415,
2256
+ OT_INPUT_KEY_KP_SEPARATOR: 57416,
2257
+ OT_INPUT_KEY_KP_LEFT: 57417,
2258
+ OT_INPUT_KEY_KP_RIGHT: 57418,
2259
+ OT_INPUT_KEY_KP_UP: 57419,
2260
+ OT_INPUT_KEY_KP_DOWN: 57420,
2261
+ OT_INPUT_KEY_KP_PAGE_UP: 57421,
2262
+ OT_INPUT_KEY_KP_PAGE_DOWN: 57422,
2263
+ OT_INPUT_KEY_KP_HOME: 57423,
2264
+ OT_INPUT_KEY_KP_END: 57424,
2265
+ OT_INPUT_KEY_KP_INSERT: 57425,
2266
+ OT_INPUT_KEY_KP_DELETE: 57426,
2267
+ OT_INPUT_KEY_KP_BEGIN: 57427,
2268
+ OT_INPUT_KEY_MEDIA_PLAY: 57428,
2269
+ OT_INPUT_KEY_MEDIA_PAUSE: 57429,
2270
+ OT_INPUT_KEY_MEDIA_PLAY_PAUSE: 57430,
2271
+ OT_INPUT_KEY_MEDIA_REVERSE: 57431,
2272
+ OT_INPUT_KEY_MEDIA_STOP: 57432,
2273
+ OT_INPUT_KEY_MEDIA_FAST_FORWARD: 57433,
2274
+ OT_INPUT_KEY_MEDIA_REWIND: 57434,
2275
+ OT_INPUT_KEY_MEDIA_TRACK_NEXT: 57435,
2276
+ OT_INPUT_KEY_MEDIA_TRACK_PREVIOUS: 57436,
2277
+ OT_INPUT_KEY_MEDIA_RECORD: 57437,
2278
+ OT_INPUT_KEY_LOWER_VOLUME: 57438,
2279
+ OT_INPUT_KEY_RAISE_VOLUME: 57439,
2280
+ OT_INPUT_KEY_MUTE_VOLUME: 57440,
2281
+ OT_INPUT_KEY_LEFT_SHIFT: 57441,
2282
+ OT_INPUT_KEY_LEFT_CONTROL: 57442,
2283
+ OT_INPUT_KEY_LEFT_ALT: 57443,
2284
+ OT_INPUT_KEY_LEFT_SUPER: 57444,
2285
+ OT_INPUT_KEY_LEFT_HYPER: 57445,
2286
+ OT_INPUT_KEY_LEFT_META: 57446,
2287
+ OT_INPUT_KEY_RIGHT_SHIFT: 57447,
2288
+ OT_INPUT_KEY_RIGHT_CONTROL: 57448,
2289
+ OT_INPUT_KEY_RIGHT_ALT: 57449,
2290
+ OT_INPUT_KEY_RIGHT_SUPER: 57450,
2291
+ OT_INPUT_KEY_RIGHT_HYPER: 57451,
2292
+ OT_INPUT_KEY_RIGHT_META: 57452,
2293
+ OT_INPUT_KEY_ISO_LEVEL3_SHIFT: 57453,
2294
+ OT_INPUT_KEY_ISO_LEVEL5_SHIFT: 57454,
2295
+ OT_INPUT_EXPECT_REPLIES: 1,
2296
+ OT_INPUT_EXPECT_KITTY_KEYBOARD: 2,
2297
+ OT_INPUT_EXPECT_CURSOR_POSITION: 4,
2298
+ OT_INPUT_EXPECT_SENTINEL: 8,
2299
+ OT_INPUT_EVENTS_MIN: 4,
2300
+ OT_INPUT_PAYLOAD_BYTES_MIN: 4384,
2301
+ OT_INPUT_TIMEOUT_NS: 20000000,
2018
2302
  OT_DIAGNOSTIC_MESSAGE_BYTES: 4096,
2019
2303
  OT_DIAGNOSTIC_TRUNCATED: 1,
2020
2304
  OT_SCENE_RECORD_BYTES_MAX: 67108864,
@@ -2031,12 +2315,13 @@ var nativeConstants = {
2031
2315
  OT_SCENE_RECORD_COLOR_MATRIX: 7,
2032
2316
  OT_SCENE_RECORD_TEXT_VIEW: 8,
2033
2317
  OT_SCENE_RECORD_EDITOR_VIEW: 9,
2034
- OT_SCENE_RECORD_SCENE_TEXT: 10,
2318
+ OT_SCENE_RECORD_SCENE_BODY: 10,
2035
2319
  OT_SCENE_RECORD_IMAGE: 11,
2036
2320
  OT_SCENE_RECORD_UNICODE: 12,
2037
2321
  OT_SCENE_RECORD_GRAYSCALE_FOREGROUND: 1,
2038
2322
  OT_SCENE_RECORD_GRAYSCALE_BACKGROUND: 2,
2039
2323
  OT_SCENE_RECORD_GRAYSCALE_SUPERSAMPLED: 4,
2324
+ OT_INPUT_RESET_KEEP_REPLY: 1,
2040
2325
  OT_CLIPBOARD_OPERATION_PENDING: 0,
2041
2326
  OT_CLIPBOARD_OPERATION_READ: 1,
2042
2327
  OT_CLIPBOARD_OPERATION_EMPTY: 2,
@@ -2069,7 +2354,6 @@ var nativeConstants = {
2069
2354
  OT_CLIPBOARD_SHUTDOWN_READY: 1,
2070
2355
  OT_CLIPBOARD_SHUTDOWN_INVALID_HANDLE: 2
2071
2356
  };
2072
- var nativeStyleEnumMaxima = [2, 3, 5, 8, 8, 8, 2, 2, 2, 1, 1];
2073
2357
 
2074
2358
  // src/platform/ffi.ts
2075
2359
  import { createRequire } from "node:module";
@@ -3753,21 +4037,21 @@ var YogaValueKind = {
3753
4037
  Position: nativeConstants.OT_STYLE_VALUE_POSITION,
3754
4038
  Gap: nativeConstants.OT_STYLE_VALUE_GAP
3755
4039
  };
3756
- function sceneSetEnum(scene, node, kind, value) {
3757
- scene.setStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value);
4040
+ function sceneSetEnum(scene, node, kind, value, flags = NativeStyleFlags.None) {
4041
+ scene.setStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value, flags);
3758
4042
  }
3759
4043
  function sceneGetEnum(scene, node, kind) {
3760
4044
  return scene.getStyle(node, NativeStyleGroup.Enum, kind, NATIVE_EDGE_NONE2).value;
3761
4045
  }
3762
- function sceneSetFloat(scene, node, kind, value) {
3763
- scene.setStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value ?? NaN);
4046
+ function sceneSetFloat(scene, node, kind, value, flags = NativeStyleFlags.None) {
4047
+ scene.setStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2, Unit2.Undefined, value ?? NaN, flags);
3764
4048
  }
3765
4049
  function sceneGetFloat(scene, node, kind) {
3766
4050
  return scene.getStyle(node, NativeStyleGroup.Float, kind, NATIVE_EDGE_NONE2).value;
3767
4051
  }
3768
- function sceneSetValue(scene, node, kind, edge, valueInput) {
4052
+ function sceneSetValue(scene, node, kind, edge, valueInput, flags = NativeStyleFlags.None) {
3769
4053
  const value = parseYogaValue(valueInput);
3770
- scene.setStyle(node, NativeStyleGroup.Value, kind, edge, value.unit, value.value);
4054
+ scene.setStyle(node, NativeStyleGroup.Value, kind, edge, value.unit, value.value, flags);
3771
4055
  }
3772
4056
  function sceneGetValue(scene, node, kind, edge) {
3773
4057
  return scene.getStyle(node, NativeStyleGroup.Value, kind, edge);
@@ -5466,6 +5750,8 @@ var NativeEditPositionQuery2;
5466
5750
  NativeEditPositionQuery[NativeEditPositionQuery["Offset"] = 4] = "Offset";
5467
5751
  NativeEditPositionQuery[NativeEditPositionQuery["Coords"] = 5] = "Coords";
5468
5752
  NativeEditPositionQuery[NativeEditPositionQuery["LineStart"] = 6] = "LineStart";
5753
+ NativeEditPositionQuery[NativeEditPositionQuery["End"] = 7] = "End";
5754
+ NativeEditPositionQuery[NativeEditPositionQuery["PrevChar"] = 8] = "PrevChar";
5469
5755
  })(NativeEditPositionQuery2 ||= {});
5470
5756
  var NativeEditorStyleMask2;
5471
5757
  ((NativeEditorStyleMask) => {
@@ -5533,6 +5819,7 @@ var NativeStyleFlags;
5533
5819
  ((NativeStyleFlags) => {
5534
5820
  NativeStyleFlags[NativeStyleFlags["None"] = nativeConstants.OT_STYLE_FLAGS_NONE] = "None";
5535
5821
  NativeStyleFlags[NativeStyleFlags["DisableFlexShrink"] = nativeConstants.OT_STYLE_DISABLE_FLEX_SHRINK] = "DisableFlexShrink";
5822
+ NativeStyleFlags[NativeStyleFlags["Content"] = nativeConstants.OT_STYLE_CONTENT] = "Content";
5536
5823
  })(NativeStyleFlags ||= {});
5537
5824
  var NATIVE_EDGE_NONE2 = nativeConstants.OT_EDGE_NONE;
5538
5825
  var NativeBorder2;
@@ -5553,6 +5840,7 @@ var NativeSceneHook2;
5553
5840
  NativeSceneHook[NativeSceneHook["RenderAfter"] = nativeConstants.OT_SCENE_HOOK_RENDER_AFTER] = "RenderAfter";
5554
5841
  NativeSceneHook[NativeSceneHook["RenderSelf"] = nativeConstants.OT_SCENE_HOOK_RENDER_SELF] = "RenderSelf";
5555
5842
  NativeSceneHook[NativeSceneHook["IdleUpdate"] = nativeConstants.OT_SCENE_HOOK_IDLE_UPDATE] = "IdleUpdate";
5843
+ NativeSceneHook[NativeSceneHook["Scroll"] = nativeConstants.OT_SCENE_HOOK_SCROLL] = "Scroll";
5556
5844
  })(NativeSceneHook2 ||= {});
5557
5845
  var NativeSceneFrame2;
5558
5846
  ((NativeSceneFrame) => {
@@ -5561,7 +5849,7 @@ var NativeSceneFrame2;
5561
5849
  NativeSceneFrame[NativeSceneFrame["Resize"] = nativeConstants.OT_SCENE_FRAME_RESIZE] = "Resize";
5562
5850
  NativeSceneFrame[NativeSceneFrame["LayoutChanged"] = nativeConstants.OT_SCENE_FRAME_LAYOUT_CHANGED] = "LayoutChanged";
5563
5851
  NativeSceneFrame[NativeSceneFrame["Record"] = nativeConstants.OT_SCENE_FRAME_RECORD] = "Record";
5564
- NativeSceneFrame[NativeSceneFrame["Yield"] = nativeConstants.OT_SCENE_FRAME_YIELD] = "Yield";
5852
+ NativeSceneFrame[NativeSceneFrame["Scroll"] = nativeConstants.OT_SCENE_FRAME_SCROLL] = "Scroll";
5565
5853
  })(NativeSceneFrame2 ||= {});
5566
5854
  var NativeScenePaintPhase2;
5567
5855
  ((NativeScenePaintPhase) => {
@@ -5569,6 +5857,42 @@ var NativeScenePaintPhase2;
5569
5857
  NativeScenePaintPhase[NativeScenePaintPhase["Self"] = nativeConstants.OT_SCENE_RECORD_PHASE_SELF] = "Self";
5570
5858
  NativeScenePaintPhase[NativeScenePaintPhase["After"] = nativeConstants.OT_SCENE_RECORD_PHASE_AFTER] = "After";
5571
5859
  })(NativeScenePaintPhase2 ||= {});
5860
+ var SCENE_SCROLL_FOLLOW = ["none", "top", "bottom", "left", "right"];
5861
+ var SCENE_SCROLL_BAR_POLICY = ["auto", "always", "never"];
5862
+ var SCENE_SCROLL_REQUESTS = ["into-view", "anchor", "layout"];
5863
+ var SCENE_SCROLL_ALIGNS = ["nearest", "start", "end"];
5864
+ function readSceneRect(values, index) {
5865
+ return { x: values[index], y: values[index + 1], width: values[index + 2], height: values[index + 3] };
5866
+ }
5867
+ function emptySceneScrollState() {
5868
+ return readSceneScrollState(new Uint32Array(nativeLayouts.ot_scene_scroll_state.size / 4));
5869
+ }
5870
+ function readSceneScrollState(record) {
5871
+ const { fields } = nativeLayouts.ot_scene_scroll_state;
5872
+ const bar = nativeLayouts.ot_scene_scroll_bar_state;
5873
+ const values = new Float64Array(record.buffer);
5874
+ const readBar = (axis) => {
5875
+ const base = fields.bars.offset + axis * bar.size;
5876
+ return {
5877
+ visible: record[(base + bar.fields.visible.offset) / 4] !== 0,
5878
+ track: readSceneRect(values, (base + bar.fields.track.offset) / 8),
5879
+ startArrow: readSceneRect(values, (base + bar.fields.start_arrow.offset) / 8),
5880
+ endArrow: readSceneRect(values, (base + bar.fields.end_arrow.offset) / 8),
5881
+ thumbStart: values[(base + bar.fields.thumb_start.offset) / 8],
5882
+ thumbSize: values[(base + bar.fields.thumb_size.offset) / 8]
5883
+ };
5884
+ };
5885
+ const offset = fields.offset.offset / 8;
5886
+ const max = fields.max.offset / 8;
5887
+ return {
5888
+ changes: record[fields.changes.offset / 4],
5889
+ offset: [values[offset], values[offset + 1]],
5890
+ max: [values[max], values[max + 1]],
5891
+ content: readSceneRect(values, fields.content.offset / 8),
5892
+ viewport: readSceneRect(values, fields.viewport.offset / 8),
5893
+ bars: [readBar(0), readBar(1)]
5894
+ };
5895
+ }
5572
5896
  var NATIVE_BUFFER_TEXT_BYTES_MAX2 = nativeConstants.OT_BUFFER_TEXT_BYTES_MAX;
5573
5897
  var NativeSessionState2;
5574
5898
  ((NativeSessionState) => {
@@ -5854,6 +6178,18 @@ var processLogLibraries = [];
5854
6178
  var globalTraceSymbols = null;
5855
6179
  var globalFFILogPath = null;
5856
6180
  var exitHandlerRegistered = false;
6181
+ function readFrameWork(layout, output, words) {
6182
+ const result = {};
6183
+ let counting = false;
6184
+ for (const [field, { offset, type }] of Object.entries(layout.fields)) {
6185
+ counting ||= field === "work_frame_id";
6186
+ if (!counting)
6187
+ continue;
6188
+ const name = field.replace(/_(.)/g, (_, letter) => letter.toUpperCase());
6189
+ result[name] = type === "u64" ? toNumber(output[offset / 8]) : words[offset / 4];
6190
+ }
6191
+ return result;
6192
+ }
5857
6193
  function toNumber(value) {
5858
6194
  return typeof value === "bigint" ? Number(value) : value;
5859
6195
  }
@@ -5893,6 +6229,11 @@ function toFFIBool(value, label) {
5893
6229
  throw new TypeError(`${label} must be a boolean`);
5894
6230
  return ffiBool(value);
5895
6231
  }
6232
+ var SYNCHRONIZED_OUTPUT_FLAGS = {
6233
+ auto: 0,
6234
+ always: nativeConstants.OT_TERMINAL_SYNC_ALWAYS,
6235
+ never: nativeConstants.OT_TERMINAL_SYNC_NEVER
6236
+ };
5896
6237
  function toFFIF32(value, label, allowNaN = false) {
5897
6238
  if (allowNaN && Number.isNaN(value))
5898
6239
  return value;
@@ -6310,35 +6651,24 @@ function encodeScenePaint(paint, scratch) {
6310
6651
  record[layout.fields.z_index.offset / 4] = toFFII32(zIndex, "Scene zIndex");
6311
6652
  fields |= nativeConstants.OT_SCENE_PROPERTY_Z_INDEX;
6312
6653
  }
6313
- const requestedOpacity = paint.opacity;
6314
- if (requestedOpacity !== undefined) {
6315
- const opacity = toFFIF32(requestedOpacity, "Scene opacity");
6316
- if (opacity < 0 || opacity > 1)
6317
- throw new RangeError("Scene opacity must be within 0..1");
6318
- floats[layout.fields.opacity.offset / 4] = opacity;
6654
+ const opacity = paint.opacity;
6655
+ if (opacity !== undefined) {
6656
+ floats[layout.fields.opacity.offset / 4] = toFFIF32(opacity, "Scene opacity");
6319
6657
  fields |= nativeConstants.OT_SCENE_PROPERTY_OPACITY;
6320
6658
  }
6321
6659
  const translateX = paint.translateX;
6322
6660
  const translateY = paint.translateY;
6323
6661
  if (translateX !== undefined) {
6324
- if (!Number.isFinite(translateX)) {
6325
- throw new RangeError("Scene translations must be finite numbers");
6326
- }
6327
- doubles[layout.fields.translate_x.offset / 8] = translateX;
6662
+ doubles[layout.fields.translate_x.offset / 8] = toFFIF32(translateX, "Scene translateX");
6328
6663
  fields |= nativeConstants.OT_SCENE_PROPERTY_TRANSLATE_X;
6329
6664
  }
6330
6665
  if (translateY !== undefined) {
6331
- if (!Number.isFinite(translateY))
6332
- throw new RangeError("Scene translations must be finite numbers");
6333
- doubles[layout.fields.translate_y.offset / 8] = translateY;
6666
+ doubles[layout.fields.translate_y.offset / 8] = toFFIF32(translateY, "Scene translateY");
6334
6667
  fields |= nativeConstants.OT_SCENE_PROPERTY_TRANSLATE_Y;
6335
6668
  }
6336
- const requestedBorder = paint.border;
6337
- if (requestedBorder !== undefined) {
6338
- const borderSides = toSafeFFIU32Length(requestedBorder, "Scene border");
6339
- if (borderSides > 15)
6340
- throw new RangeError("Scene border sides must use four edge bits");
6341
- record[layout.fields.border_sides.offset / 4] = borderSides;
6669
+ const border = paint.border;
6670
+ if (border !== undefined) {
6671
+ record[layout.fields.border_sides.offset / 4] = toSafeFFIU32Length(border, "Scene border");
6342
6672
  fields |= nativeConstants.OT_SCENE_PROPERTY_BORDER;
6343
6673
  }
6344
6674
  const shouldFill = paint.shouldFill;
@@ -6382,34 +6712,6 @@ function encodeScenePaint(paint, scratch) {
6382
6712
  }
6383
6713
  return fields;
6384
6714
  }
6385
- function validateSceneStyle(group, kind, edge, unit, value, flags) {
6386
- const c = nativeConstants;
6387
- if (group > c.OT_STYLE_DIMENSION || group === c.OT_STYLE_BORDER || group !== c.OT_STYLE_DIMENSION && flags !== 0 || flags > c.OT_STYLE_DISABLE_FLEX_SHRINK) {
6388
- throw new NativeError2("ot_scene_set_style", -1 /* InvalidArgument */);
6389
- }
6390
- if ((group === c.OT_STYLE_ENUM || group === c.OT_STYLE_FLOAT) && (edge !== c.OT_EDGE_NONE || unit !== c.OT_UNIT_UNDEFINED)) {
6391
- throw new NativeError2("ot_scene_set_style", -1 /* InvalidArgument */);
6392
- }
6393
- if (group === c.OT_STYLE_DIMENSION && edge !== c.OT_EDGE_NONE)
6394
- throw new NativeError2("ot_scene_set_style", -1 /* InvalidArgument */);
6395
- let valid = false;
6396
- switch (group) {
6397
- case c.OT_STYLE_ENUM:
6398
- valid = kind < nativeStyleEnumMaxima.length && value <= nativeStyleEnumMaxima[kind];
6399
- break;
6400
- case c.OT_STYLE_FLOAT:
6401
- valid = kind <= c.OT_STYLE_FLOAT_ASPECT_RATIO;
6402
- break;
6403
- case c.OT_STYLE_VALUE:
6404
- valid = kind <= c.OT_STYLE_VALUE_GAP && unit <= c.OT_UNIT_AUTO && (kind < c.OT_STYLE_VALUE_MARGIN || edge <= (kind === c.OT_STYLE_VALUE_GAP ? c.OT_GUTTER_ALL : c.OT_EDGE_ALL)) && !(unit === c.OT_UNIT_AUTO && (kind >= c.OT_STYLE_VALUE_MIN_WIDTH && kind <= c.OT_STYLE_VALUE_MAX_HEIGHT || kind === c.OT_STYLE_VALUE_PADDING || kind === c.OT_STYLE_VALUE_GAP));
6405
- break;
6406
- case c.OT_STYLE_DIMENSION:
6407
- valid = kind <= c.OT_DIMENSION_HEIGHT && unit <= c.OT_UNIT_AUTO;
6408
- break;
6409
- }
6410
- if (!valid)
6411
- throw new NativeError2("ot_scene_set_style", -1 /* InvalidArgument */);
6412
- }
6413
6715
  var scenePropertyWords = [
6414
6716
  ["z_index", nativeConstants.OT_SCENE_PROPERTY_Z_INDEX],
6415
6717
  ["opacity", nativeConstants.OT_SCENE_PROPERTY_OPACITY],
@@ -6541,7 +6843,8 @@ class SceneStaging {
6541
6843
  unit = toSafeFFIU32Length(unit, "Scene style unit");
6542
6844
  value = SceneStaging.checkStyleValue(group, value);
6543
6845
  flags = toSafeFFIU32Length(flags, "Scene style flags");
6544
- validateSceneStyle(group, kind, edge, unit, value, flags);
6846
+ if (Math.max(group, kind, edge, unit) > 255)
6847
+ throw new NativeError2("ot_scene_set_style", -1 /* InvalidArgument */);
6545
6848
  if (group === nativeConstants.OT_STYLE_VALUE && kind < nativeConstants.OT_STYLE_VALUE_MARGIN)
6546
6849
  edge = 0;
6547
6850
  const handle = encodedContextHandle(context, node);
@@ -7059,7 +7362,7 @@ class NativePaintRecorder {
7059
7362
  view(operation, source, x, y) {
7060
7363
  this.transaction(() => {
7061
7364
  const layout = nativeLayouts.ot_scene_record_view;
7062
- const base = this.reserve(operation === "text" ? nativeConstants.OT_SCENE_RECORD_TEXT_VIEW : operation === "editor" ? nativeConstants.OT_SCENE_RECORD_EDITOR_VIEW : nativeConstants.OT_SCENE_RECORD_SCENE_TEXT, layout.size);
7365
+ const base = this.reserve(operation === "text" ? nativeConstants.OT_SCENE_RECORD_TEXT_VIEW : operation === "editor" ? nativeConstants.OT_SCENE_RECORD_EDITOR_VIEW : nativeConstants.OT_SCENE_RECORD_SCENE_BODY, layout.size);
7063
7366
  this.encodeHandle(source, base + layout.fields.source.offset);
7064
7367
  this.signed[(base + layout.fields.x.offset) / 4] = toFFII32(x, "View x");
7065
7368
  this.signed[(base + layout.fields.y.offset) / 4] = toFFII32(y, "View y");
@@ -8571,15 +8874,15 @@ class FFIRenderLib2 {
8571
8874
  const pointer = this.nativeContextPointer(context, "ot_buffer_draw_editor_view");
8572
8875
  nativeResult("ot_buffer_draw_editor_view", this.opentui.symbols.ot_buffer_draw_editor_view(pointer, destination, request, source, column, row));
8573
8876
  }
8574
- contextDrawSceneText({ context, target, frame }, node, x, y) {
8877
+ contextDrawSceneBody({ context, target, frame }, node, x, y) {
8575
8878
  this.getYogaHost().assertMutable();
8576
8879
  const destination = encodeContextHandle(context, target);
8577
8880
  const request = frame === null ? null : encodeSceneFrameRequest(context, frame);
8578
8881
  const source = encodeContextHandle(context, node);
8579
- const column = toFFII32(x, "Scene text x");
8580
- const row = toFFII32(y, "Scene text y");
8581
- const pointer = this.nativeContextPointer(context, "ot_buffer_draw_scene_text");
8582
- nativeResult("ot_buffer_draw_scene_text", this.opentui.symbols.ot_buffer_draw_scene_text(pointer, destination, request, source, column, row));
8882
+ const column = toFFII32(x, "Scene body x");
8883
+ const row = toFFII32(y, "Scene body y");
8884
+ const pointer = this.nativeContextPointer(context, "ot_buffer_draw_scene_body");
8885
+ nativeResult("ot_buffer_draw_scene_body", this.opentui.symbols.ot_buffer_draw_scene_body(pointer, destination, request, source, column, row));
8583
8886
  }
8584
8887
  createContextEditBuffer(context, options = {}) {
8585
8888
  const layout = nativeLayouts.ot_edit_buffer_options;
@@ -9535,8 +9838,12 @@ class FFIRenderLib2 {
9535
9838
  sessionSetupTerminal(context, session, options = {}) {
9536
9839
  const layout = nativeLayouts.ot_session_terminal_options;
9537
9840
  const handle = encodeContextHandle(context, session);
9841
+ const synchronizedOutput = options.synchronizedOutput ?? "auto";
9842
+ if (!Object.hasOwn(SYNCHRONIZED_OUTPUT_FLAGS, synchronizedOutput)) {
9843
+ throw new TypeError("Session synchronizedOutput must be auto, always, or never");
9844
+ }
9538
9845
  const flag = (value, label, bit) => toFFIBool(value ?? true, `Session ${label}`) ? bit : 0;
9539
- const flags = flag(options.useAlternateScreen, "useAlternateScreen", nativeConstants.OT_TERMINAL_ALTERNATE_SCREEN) | flag(options.mouse, "mouse", nativeConstants.OT_TERMINAL_MOUSE) | flag(options.mouseMovement, "mouseMovement", nativeConstants.OT_TERMINAL_MOUSE_MOVEMENT) | flag(options.clearOnClose, "clearOnClose", nativeConstants.OT_TERMINAL_CLEAR_ON_CLOSE);
9846
+ const flags = flag(options.useAlternateScreen, "useAlternateScreen", nativeConstants.OT_TERMINAL_ALTERNATE_SCREEN) | flag(options.mouse, "mouse", nativeConstants.OT_TERMINAL_MOUSE) | flag(options.mouseMovement, "mouseMovement", nativeConstants.OT_TERMINAL_MOUSE_MOVEMENT) | flag(options.clearOnClose, "clearOnClose", nativeConstants.OT_TERMINAL_CLEAR_ON_CLOSE) | (options.replySentinel ? nativeConstants.OT_TERMINAL_REPLY_SENTINEL : 0) | SYNCHRONIZED_OUTPUT_FLAGS[synchronizedOutput] | (options.hostMultiplexer ? nativeConstants.OT_TERMINAL_HOST_MULTIPLEXER : 0);
9540
9847
  const record = createContextRecord(layout);
9541
9848
  record[layout.fields.flags.offset / 4] = flags;
9542
9849
  record[layout.fields.kitty_keyboard_flags.offset / 4] = toSafeFFIU32Length(options.kittyKeyboardFlags ?? 5, "Session kittyKeyboardFlags");
@@ -9584,6 +9891,41 @@ class FFIRenderLib2 {
9584
9891
  nativeResult("ot_session_pump_exit", this.opentui.symbols.ot_session_pump_exit(pointer, handle, output));
9585
9892
  return output[0];
9586
9893
  }
9894
+ sessionInputFeed(context, session, bytes, nowNs, records, payload) {
9895
+ const layout = nativeLayouts.ot_input_drain;
9896
+ const handle = encodeContextHandle(context, session);
9897
+ const input = sessionBytes(bytes, "Session input length");
9898
+ const now = toFFIU64(nowNs, "Session input nowNs");
9899
+ const recordView = sessionBytes(records, "Session input records length");
9900
+ const payloadView = sessionBytes(payload, "Session input payload length");
9901
+ if (recordView.byteOffset % nativeLayouts.ot_input_event.alignment !== 0) {
9902
+ throw new RangeError("Session input records must be aligned to ot_input_event");
9903
+ }
9904
+ const capacity = Math.floor(recordView.byteLength / nativeLayouts.ot_input_event.size);
9905
+ const output = new BigUint64Array(layout.size / 8);
9906
+ const words = new Uint32Array(output.buffer);
9907
+ words[layout.fields.struct_size.offset / 4] = layout.size;
9908
+ words[layout.fields.abi_version.offset / 4] = nativeConstants.OT_CONTEXT_ABI_VERSION;
9909
+ const pointer = this.nativeContextPointer(context, "ot_session_input_feed");
9910
+ nativeResult("ot_session_input_feed", this.opentui.symbols.ot_session_input_feed(pointer, handle, input.byteLength === 0 ? null : input, input.byteLength, now, recordView, capacity, payloadView, payloadView.byteLength, output));
9911
+ const deadline = output[layout.fields.deadline_ns.offset / 8];
9912
+ return {
9913
+ consumed: words[layout.fields.consumed.offset / 4],
9914
+ count: words[layout.fields.count.offset / 4],
9915
+ deadlineNs: deadline === 0n ? null : deadline
9916
+ };
9917
+ }
9918
+ sessionInputExpect(context, session, flags) {
9919
+ const handle = encodeContextHandle(context, session);
9920
+ const value = toSafeFFIU32Length(flags, "Session input expectations");
9921
+ const pointer = this.nativeContextPointer(context, "ot_session_input_expect");
9922
+ nativeResult("ot_session_input_expect", this.opentui.symbols.ot_session_input_expect(pointer, handle, value));
9923
+ }
9924
+ sessionInputReset(context, session, flags) {
9925
+ const handle = encodeContextHandle(context, session);
9926
+ const pointer = this.nativeContextPointer(context, "ot_session_input_reset");
9927
+ nativeResult("ot_session_input_reset", this.opentui.symbols.ot_session_input_reset(pointer, handle, flags));
9928
+ }
9587
9929
  terminalFlushInput() {
9588
9930
  nativeResult("ot_terminal_flush_input", this.opentui.symbols.ot_terminal_flush_input());
9589
9931
  }
@@ -9635,6 +9977,7 @@ class FFIRenderLib2 {
9635
9977
  break;
9636
9978
  case "query-pixel-resolution":
9637
9979
  record[kind] = nativeConstants.OT_CONTROL_QUERY_PIXEL_RESOLUTION;
9980
+ record[layout.fields.argument.offset / 4] = command.sentinel ? 1 : 0;
9638
9981
  break;
9639
9982
  case "query-theme-colors":
9640
9983
  record[kind] = nativeConstants.OT_CONTROL_QUERY_THEME_COLORS;
@@ -10194,6 +10537,90 @@ class FFIRenderLib2 {
10194
10537
  const pointer = this.nativeContextPointer(context, "ot_scene_set_arrow");
10195
10538
  nativeResult("ot_scene_set_arrow", this.opentui.symbols.ot_scene_set_arrow(pointer, handle, record, bytes?.length === 0 ? new Uint8Array(1) : bytes, bytes?.length ?? 0));
10196
10539
  }
10540
+ sceneSetScroll(context, node, options) {
10541
+ const layout = nativeLayouts.ot_scene_scroll_options;
10542
+ const bar = nativeLayouts.ot_scene_scroll_bar_options;
10543
+ this.getYogaHost().assertMutable();
10544
+ const handle = encodeContextHandle(context, node);
10545
+ const record = createContextRecord(layout);
10546
+ const floats = new Float32Array(record.buffer);
10547
+ const colors = new Uint16Array(record.buffer);
10548
+ const follow = SCENE_SCROLL_FOLLOW.indexOf(options.follow);
10549
+ if (follow < 0)
10550
+ throw new TypeError("Unknown scene scroll follow edge");
10551
+ const fields = layout.fields;
10552
+ record[fields.axes.offset / 4] = (options.scrollX ? nativeConstants.OT_SCENE_SCROLL_X : 0) | (options.scrollY ? nativeConstants.OT_SCENE_SCROLL_Y : 0);
10553
+ record[fields.follow.offset / 4] = follow;
10554
+ record[fields.culling.offset / 4] = toFFIBool(options.culling, "Scene scroll culling");
10555
+ for (let edge = 0;edge < 4; edge++)
10556
+ floats[fields.padding.offset / 4 + edge] = options.padding[edge];
10557
+ let fills = 0;
10558
+ for (const [index, field] of ["wrapper_background", "viewport_background", "content_background"].entries()) {
10559
+ const color = options.fills[index];
10560
+ if (!color)
10561
+ continue;
10562
+ fills |= 1 << index;
10563
+ contextBufferColor(color, colors, fields[field].offset / 2);
10564
+ }
10565
+ record[fields.fills.offset / 4] = fills;
10566
+ for (let axis = 0;axis < 2; axis++) {
10567
+ const base = fields.bars.offset + axis * bar.size;
10568
+ const value = options.bars[axis];
10569
+ const policy = SCENE_SCROLL_BAR_POLICY.indexOf(value.policy);
10570
+ if (policy < 0)
10571
+ throw new TypeError("Unknown scene scroll bar policy");
10572
+ record[(base + bar.fields.policy.offset) / 4] = policy;
10573
+ record[(base + bar.fields.placement.offset) / 4] = toFFIBool(value.overlay, "Scene scroll bar overlay");
10574
+ record[(base + bar.fields.thickness.offset) / 4] = toSafeFFIU32Length(value.thickness, "Scene scroll bar thickness");
10575
+ record[(base + bar.fields.gap.offset) / 4] = toSafeFFIU32Length(value.gap, "Scene scroll bar gap");
10576
+ record[(base + bar.fields.arrows.offset) / 4] = toFFIBool(value.arrows, "Scene scroll bar arrows");
10577
+ contextBufferColor(value.foregroundColor, colors, (base + bar.fields.track_foreground.offset) / 2);
10578
+ contextBufferColor(value.backgroundColor, colors, (base + bar.fields.track_background.offset) / 2);
10579
+ }
10580
+ const pointer = this.nativeContextPointer(context, "ot_scene_set_scroll");
10581
+ nativeResult("ot_scene_set_scroll", this.opentui.symbols.ot_scene_set_scroll(pointer, handle, record));
10582
+ }
10583
+ sceneSetScrollArrow(context, node, axis, end, options) {
10584
+ const layout = nativeLayouts.ot_scene_arrow_options;
10585
+ this.getYogaHost().assertMutable();
10586
+ const handle = encodeContextHandle(context, node);
10587
+ const record = createContextRecord(layout);
10588
+ record[layout.fields.attributes.offset / 4] = toSafeFFIU32Length(options.attributes, "Scene arrow attributes");
10589
+ const colors = new Uint16Array(record.buffer);
10590
+ contextBufferColor(options.foregroundColor, colors, layout.fields.foreground.offset / 2);
10591
+ contextBufferColor(options.backgroundColor, colors, layout.fields.background.offset / 2);
10592
+ const text = options.text;
10593
+ const bytes = text === undefined ? null : sessionBytes(this.encoder.encode(text), "Scene arrow text length");
10594
+ if (bytes && bytes.length > NATIVE_BUFFER_TEXT_BYTES_MAX2)
10595
+ throw new RangeError("Scene arrow text is too long");
10596
+ const pointer = this.nativeContextPointer(context, "ot_scene_set_scroll_arrow");
10597
+ nativeResult("ot_scene_set_scroll_arrow", this.opentui.symbols.ot_scene_set_scroll_arrow(pointer, handle, toSafeFFIU32Length(axis, "Scene scroll axis"), toSafeFFIU32Length(end, "Scene scroll arrow end"), record, bytes?.length === 0 ? new Uint8Array(1) : bytes, bytes?.length ?? 0));
10598
+ }
10599
+ sceneScrollTo(context, node, x, y, relativeX, relativeY, reapply = false) {
10600
+ this.getYogaHost().assertMutable();
10601
+ const handle = encodeContextHandle(context, node);
10602
+ const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
10603
+ const flags = (relativeX ? nativeConstants.OT_SCENE_SCROLL_RELATIVE_X : 0) | (relativeY ? nativeConstants.OT_SCENE_SCROLL_RELATIVE_Y : 0) | (reapply ? nativeConstants.OT_SCENE_SCROLL_REAPPLY : 0);
10604
+ const pointer = this.nativeContextPointer(context, "ot_scene_scroll_to");
10605
+ nativeResult("ot_scene_scroll_to", this.opentui.symbols.ot_scene_scroll_to(pointer, handle, x, y, flags, output));
10606
+ return readSceneScrollState(output);
10607
+ }
10608
+ sceneScrollRequest(context, node, kind, target, align = "nearest", inset = 0) {
10609
+ this.getYogaHost().assertMutable();
10610
+ const handle = encodeContextHandle(context, node);
10611
+ const encodedTarget = target === null ? null : encodeContextHandle(context, target);
10612
+ const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
10613
+ const pointer = this.nativeContextPointer(context, "ot_scene_scroll_request");
10614
+ nativeResult("ot_scene_scroll_request", this.opentui.symbols.ot_scene_scroll_request(pointer, handle, SCENE_SCROLL_REQUESTS.indexOf(kind), encodedTarget, SCENE_SCROLL_ALIGNS.indexOf(align), toSafeFFIU32Length(inset, "Scene scroll inset"), output));
10615
+ return readSceneScrollState(output);
10616
+ }
10617
+ sceneGetScroll(context, node) {
10618
+ const handle = encodeContextHandle(context, node);
10619
+ const output = createContextRecord(nativeLayouts.ot_scene_scroll_state);
10620
+ const pointer = this.nativeContextPointer(context, "ot_scene_get_scroll");
10621
+ nativeResult("ot_scene_get_scroll", this.opentui.symbols.ot_scene_get_scroll(pointer, handle, output));
10622
+ return readSceneScrollState(output);
10623
+ }
10197
10624
  sceneSetTextOptions(context, node, options) {
10198
10625
  const layout = nativeLayouts.ot_scene_text_options;
10199
10626
  this.getYogaHost().assertMutable();
@@ -10362,7 +10789,7 @@ class FFIRenderLib2 {
10362
10789
  this.sceneHooksRecord ??= scratch;
10363
10790
  }
10364
10791
  }
10365
- sceneFrameStep(context, session, previous, options, maxWorkItems, recording = null) {
10792
+ sceneFrameStep(context, session, previous, options, recording = null) {
10366
10793
  const layout = nativeLayouts.ot_scene_frame_options;
10367
10794
  this.getYogaHost().assertMutable();
10368
10795
  const scratch = this.sceneFrameRecord ?? createSceneFrameRecord();
@@ -10376,9 +10803,6 @@ class FFIRenderLib2 {
10376
10803
  config[layout.fields.max_layout_rounds.offset / 4] = toSafeFFIU32Length(options.maxLayoutRounds, "Scene layout round limit");
10377
10804
  config[layout.fields.max_host_requests.offset / 4] = toSafeFFIU32Length(options.maxHostRequests, "Scene host request limit");
10378
10805
  config[layout.fields.preserve_unwritten.offset / 4] = toFFIBool(options.preserveUnwritten ?? false, "Scene preserve unwritten cells");
10379
- const workBudget = maxWorkItems === undefined ? 4294967295 : toSafeFFIU32Length(maxWorkItems, "Scene work budget");
10380
- if (workBudget === 0)
10381
- throw new RangeError("Scene work budget must be positive");
10382
10806
  const recordingLength = recording === null ? 0 : toSafeFFIU32Length(recording.byteLength, "Scene recording");
10383
10807
  const recordingView = recordingLength === 0 ? null : recording;
10384
10808
  const output = encodeSceneFrameRequest(context, previous, scratch);
@@ -10388,9 +10812,9 @@ class FFIRenderLib2 {
10388
10812
  this.getYogaHost().flushSceneMutations();
10389
10813
  const pointer = this.nativeContextPointer(context, operation);
10390
10814
  if (measures) {
10391
- this.sceneFrameStepWithMeasures(context, pointer, handle, previous === null ? null : output, config, output, workBudget, recordingView, recordingLength, geometry);
10815
+ this.sceneFrameStepWithMeasures(context, pointer, handle, previous === null ? null : output, config, output, recordingView, recordingLength, geometry);
10392
10816
  } else {
10393
- nativeResult(operation, this.opentui.symbols.ot_scene_frame_step_with_geometry(pointer, handle, previous === null ? null : output, config, workBudget, recordingView, recordingLength, output, geometry));
10817
+ nativeResult(operation, this.opentui.symbols.ot_scene_frame_step_with_geometry(pointer, handle, previous === null ? null : output, config, recordingView, recordingLength, output, geometry));
10394
10818
  }
10395
10819
  try {
10396
10820
  const fields = nativeLayouts.ot_scene_frame_geometry.fields;
@@ -10408,8 +10832,7 @@ class FFIRenderLib2 {
10408
10832
  width: words[nativeLayouts.ot_scene_frame_request.fields.width.offset / 4],
10409
10833
  height: words[nativeLayouts.ot_scene_frame_request.fields.height.offset / 4],
10410
10834
  paintLayout: flags & nativeConstants.OT_SCENE_GEOMETRY_PAINT ? decodeSceneLayout(scratch.geometryValues, scratch.geometryCoordinates, fields.paint.offset) : undefined,
10411
- publicLayout: flags & nativeConstants.OT_SCENE_GEOMETRY_PUBLIC ? decodeSceneLayout(scratch.geometryValues, scratch.geometryCoordinates, fields.public_layout.offset) : undefined,
10412
- geometryRevision: undefined
10835
+ publicLayout: flags & nativeConstants.OT_SCENE_GEOMETRY_PUBLIC ? decodeSceneLayout(scratch.geometryValues, scratch.geometryCoordinates, fields.public_layout.offset) : undefined
10413
10836
  };
10414
10837
  } catch (error) {
10415
10838
  const livePointer = this.nativeContexts.get(context);
@@ -10421,11 +10844,11 @@ class FFIRenderLib2 {
10421
10844
  this.sceneFrameRecord ??= scratch;
10422
10845
  }
10423
10846
  }
10424
- sceneFrameStepWithMeasures(context, pointer, handle, previous, config, output, workBudget, recording, recordingLength, geometry) {
10847
+ sceneFrameStepWithMeasures(context, pointer, handle, previous, config, output, recording, recordingLength, geometry) {
10425
10848
  let accepted = false;
10426
10849
  try {
10427
10850
  this.getYogaHost().runMutation(() => {
10428
- nativeResult("ot_scene_frame_step_with_geometry", this.opentui.symbols.ot_scene_frame_step_with_geometry(pointer, handle, previous, config, workBudget, recording, recordingLength, output, geometry));
10851
+ nativeResult("ot_scene_frame_step_with_geometry", this.opentui.symbols.ot_scene_frame_step_with_geometry(pointer, handle, previous, config, recording, recordingLength, output, geometry));
10429
10852
  accepted = true;
10430
10853
  });
10431
10854
  } catch (error) {
@@ -10515,6 +10938,12 @@ class FFIRenderLib2 {
10515
10938
  nativeResult("ot_scene_hit_test", this.opentui.symbols.ot_scene_hit_test(pointer, handle, x, y, output));
10516
10939
  return output[0];
10517
10940
  }
10941
+ sceneSetDebugFlags(context, session, flags) {
10942
+ const handle = encodeContextHandle(context, session);
10943
+ const value = toSafeFFIU32Length(flags, "Scene debug flags");
10944
+ const pointer = this.nativeContextPointer(context, "ot_scene_set_debug_flags");
10945
+ nativeResult("ot_scene_set_debug_flags", this.opentui.symbols.ot_scene_set_debug_flags(pointer, handle, value));
10946
+ }
10518
10947
  sceneGetStats(context, session) {
10519
10948
  const layout = nativeLayouts.ot_scene_stats;
10520
10949
  const handle = encodeContextHandle(context, session);
@@ -10532,7 +10961,8 @@ class FFIRenderLib2 {
10532
10961
  cellsUpdated: words[layout.fields.cells_updated.offset / 4],
10533
10962
  averageCellsUpdated: words[layout.fields.average_cells_updated.offset / 4],
10534
10963
  nativeRenderTime: words[layout.fields.render_time_valid.offset / 4] !== 0 ? times[layout.fields.render_time.offset / 8] : undefined,
10535
- nativeStdoutWriteTime: words[layout.fields.stdout_write_time_valid.offset / 4] !== 0 ? times[layout.fields.stdout_write_time.offset / 8] : undefined
10964
+ nativeStdoutWriteTime: words[layout.fields.stdout_write_time_valid.offset / 4] !== 0 ? times[layout.fields.stdout_write_time.offset / 8] : undefined,
10965
+ frameWork: readFrameWork(layout, output, words)
10536
10966
  };
10537
10967
  }
10538
10968
  sceneGetCursorState(context, session) {
@@ -12607,7 +13037,7 @@ var Yoga = {
12607
13037
  };
12608
13038
  var yoga_default = Yoga;
12609
13039
 
12610
- export { nativeConstants, toArrayBuffer, singleton, getSingleton, destroySingleton, envRegistry2, registerEnvVar2, clearEnvCache2, generateEnvMarkdown2, generateEnvColored2, env2, stringWidth, resolveBundledFilePath2, Worker, TextAttributes2, ATTRIBUTE_BASE_BITS2, ATTRIBUTE_BASE_MASK2, getBaseAttributes2, DebugOverlayCorner2, TargetChannel2, DEFAULT_FOREGROUND_RGB2, DEFAULT_BACKGROUND_RGB2, normalizeIndexedColorIndex2, ansi256IndexToRgb2, RGBA2, normalizeColorValue2, hexToRgb2, rgbToHex2, hsvToRgb2, parseColor2, createTextAttributes2, attributesWithLink2, getLinkId2, visualizeRenderableTree2, isStyledText2, StyledText2, stringToStyledText2, black2, red2, green2, yellow2, blue2, magenta2, cyan2, white2, brightBlack2, brightRed2, brightGreen2, brightYellow2, brightBlue2, brightMagenta2, brightCyan2, brightWhite2, bgBlack2, bgRed2, bgGreen2, bgYellow2, bgBlue2, bgMagenta2, bgCyan2, bgWhite2, bold2, italic2, underline2, strikethrough2, dim2, reverse2, blink2, fg2, bg2, link2, t2, YogaEnumKind, YogaFloatKind, YogaValueKind, sceneSetEnum, sceneGetEnum, sceneSetFloat, sceneGetFloat, sceneSetValue, sceneGetValue, sceneSetDimension, UNDEFINED_VALUE, parseYogaValue, SpanInfoStruct, NativeAudioStreamFormat2, NativeAudioStreamState2, NativeAudioStreamStateNames, NativeAudioStreamCloseReason2, isBunfsPath, normalizeBunfsPath, resolveDefaultParserAsset, resolveDefaultTreeSitterWorkerPath, resolveTreeSitterWasm, NativeAudioStreamState3, NativeAudioStreamCloseReason3, NativeAudioStreamFormat3, MAX_LINK_URL_BYTES2, NativeTextViewCommand2, NativeEditCommand2, NativeEditPositionQuery2, NativeEditorStyleMask2, NativeEditHighlightOperation2, NativeEditorCommand2, NativeEditorSelectionOperation2, NativeEditorPositionQuery2, NativeEditEvent2, NativeStyleGroup, NativeStyleFlags, NATIVE_EDGE_NONE2, NativeBorder2, NativeSceneHook2, NativeSceneFrame2, NativeScenePaintPhase2, NATIVE_BUFFER_TEXT_BYTES_MAX2, NativeSessionState2, NativeSessionRenderStatus2, NATIVE_SESSION_CONTROL_PACKET_BYTES2, NativeSessionTerminalPhase2, NativeSessionPumpStatus2, NativeStatus2, NativeError2, NativeClipboardOperationStatus2, NativeClipboardStartStatus2, NativeClipboardCancelStatus2, NativeClipboardCopyStatus2, NativeClipboardDestroyStatus2, NativeClipboardShutdownStatus2, SceneStaging, NativePaintRecorder, LogLevel2, FFIRenderLib2, setRenderLibPath2, resolveRenderLib2, Align2, BoxSizing2, Dimension2, Direction2, Display2, Edge2, Errata2, ExperimentalFeature2, FlexDirection2, Gutter2, Justify2, LogLevel3, MeasureMode2, NodeType2, Overflow2, PositionType2, Unit2, Wrap2, ALIGN_AUTO2, ALIGN_FLEX_START2, ALIGN_CENTER2, ALIGN_FLEX_END2, ALIGN_STRETCH2, ALIGN_BASELINE2, ALIGN_SPACE_BETWEEN2, ALIGN_SPACE_AROUND2, ALIGN_SPACE_EVENLY2, BOX_SIZING_BORDER_BOX2, BOX_SIZING_CONTENT_BOX2, DIMENSION_WIDTH2, DIMENSION_HEIGHT2, DIRECTION_INHERIT2, DIRECTION_LTR2, DIRECTION_RTL2, DISPLAY_FLEX2, DISPLAY_NONE2, DISPLAY_CONTENTS2, EDGE_LEFT2, EDGE_TOP2, EDGE_RIGHT2, EDGE_BOTTOM2, EDGE_START2, EDGE_END2, EDGE_HORIZONTAL2, EDGE_VERTICAL2, EDGE_ALL2, ERRATA_NONE2, ERRATA_STRETCH_FLEX_BASIS2, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2, ERRATA_ALL2, ERRATA_CLASSIC2, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2, FLEX_DIRECTION_COLUMN2, FLEX_DIRECTION_COLUMN_REVERSE2, FLEX_DIRECTION_ROW2, FLEX_DIRECTION_ROW_REVERSE2, GUTTER_COLUMN2, GUTTER_ROW2, GUTTER_ALL2, JUSTIFY_FLEX_START2, JUSTIFY_CENTER2, JUSTIFY_FLEX_END2, JUSTIFY_SPACE_BETWEEN2, JUSTIFY_SPACE_AROUND2, JUSTIFY_SPACE_EVENLY2, LOG_LEVEL_ERROR2, LOG_LEVEL_WARN2, LOG_LEVEL_INFO2, LOG_LEVEL_DEBUG2, LOG_LEVEL_VERBOSE2, LOG_LEVEL_FATAL2, MEASURE_MODE_UNDEFINED2, MEASURE_MODE_EXACTLY2, MEASURE_MODE_AT_MOST2, NODE_TYPE_DEFAULT2, NODE_TYPE_TEXT2, OVERFLOW_VISIBLE2, OVERFLOW_HIDDEN2, OVERFLOW_SCROLL2, POSITION_TYPE_STATIC2, POSITION_TYPE_RELATIVE2, POSITION_TYPE_ABSOLUTE2, UNIT_UNDEFINED2, UNIT_POINT2, UNIT_PERCENT2, UNIT_AUTO2, WRAP_NO_WRAP2, WRAP_WRAP2, WRAP_WRAP_REVERSE2, YogaStatus2, YogaError2, Config2, Node2, exports_yoga, yoga_default };
13040
+ export { nativeLayouts, nativeConstants, toArrayBuffer, singleton, getSingleton, destroySingleton, envRegistry2, registerEnvVar2, clearEnvCache2, generateEnvMarkdown2, generateEnvColored2, env2, stringWidth, resolveBundledFilePath2, Worker, TextAttributes2, ATTRIBUTE_BASE_BITS2, ATTRIBUTE_BASE_MASK2, getBaseAttributes2, DebugOverlayCorner2, TargetChannel2, DEFAULT_FOREGROUND_RGB2, DEFAULT_BACKGROUND_RGB2, normalizeIndexedColorIndex2, ansi256IndexToRgb2, RGBA2, normalizeColorValue2, hexToRgb2, rgbToHex2, hsvToRgb2, parseColor2, createTextAttributes2, attributesWithLink2, getLinkId2, visualizeRenderableTree2, isStyledText2, StyledText2, stringToStyledText2, black2, red2, green2, yellow2, blue2, magenta2, cyan2, white2, brightBlack2, brightRed2, brightGreen2, brightYellow2, brightBlue2, brightMagenta2, brightCyan2, brightWhite2, bgBlack2, bgRed2, bgGreen2, bgYellow2, bgBlue2, bgMagenta2, bgCyan2, bgWhite2, bold2, italic2, underline2, strikethrough2, dim2, reverse2, blink2, fg2, bg2, link2, t2, YogaEnumKind, YogaFloatKind, YogaValueKind, sceneSetEnum, sceneGetEnum, sceneSetFloat, sceneGetFloat, sceneSetValue, sceneGetValue, sceneSetDimension, UNDEFINED_VALUE, parseYogaValue, SpanInfoStruct, NativeAudioStreamFormat2, NativeAudioStreamState2, NativeAudioStreamStateNames, NativeAudioStreamCloseReason2, isBunfsPath, normalizeBunfsPath, resolveDefaultParserAsset, resolveDefaultTreeSitterWorkerPath, resolveTreeSitterWasm, NativeAudioStreamState3, NativeAudioStreamCloseReason3, NativeAudioStreamFormat3, MAX_LINK_URL_BYTES2, NativeTextViewCommand2, NativeEditCommand2, NativeEditPositionQuery2, NativeEditorStyleMask2, NativeEditHighlightOperation2, NativeEditorCommand2, NativeEditorSelectionOperation2, NativeEditorPositionQuery2, NativeEditEvent2, NativeStyleGroup, NativeStyleFlags, NATIVE_EDGE_NONE2, NativeBorder2, NativeSceneHook2, NativeSceneFrame2, NativeScenePaintPhase2, emptySceneScrollState, NATIVE_BUFFER_TEXT_BYTES_MAX2, NativeSessionState2, NativeSessionRenderStatus2, NATIVE_SESSION_CONTROL_PACKET_BYTES2, NativeSessionTerminalPhase2, NativeSessionPumpStatus2, NativeStatus2, NativeError2, NativeClipboardOperationStatus2, NativeClipboardStartStatus2, NativeClipboardCancelStatus2, NativeClipboardCopyStatus2, NativeClipboardDestroyStatus2, NativeClipboardShutdownStatus2, SceneStaging, NativePaintRecorder, LogLevel2, FFIRenderLib2, setRenderLibPath2, resolveRenderLib2, Align2, BoxSizing2, Dimension2, Direction2, Display2, Edge2, Errata2, ExperimentalFeature2, FlexDirection2, Gutter2, Justify2, LogLevel3, MeasureMode2, NodeType2, Overflow2, PositionType2, Unit2, Wrap2, ALIGN_AUTO2, ALIGN_FLEX_START2, ALIGN_CENTER2, ALIGN_FLEX_END2, ALIGN_STRETCH2, ALIGN_BASELINE2, ALIGN_SPACE_BETWEEN2, ALIGN_SPACE_AROUND2, ALIGN_SPACE_EVENLY2, BOX_SIZING_BORDER_BOX2, BOX_SIZING_CONTENT_BOX2, DIMENSION_WIDTH2, DIMENSION_HEIGHT2, DIRECTION_INHERIT2, DIRECTION_LTR2, DIRECTION_RTL2, DISPLAY_FLEX2, DISPLAY_NONE2, DISPLAY_CONTENTS2, EDGE_LEFT2, EDGE_TOP2, EDGE_RIGHT2, EDGE_BOTTOM2, EDGE_START2, EDGE_END2, EDGE_HORIZONTAL2, EDGE_VERTICAL2, EDGE_ALL2, ERRATA_NONE2, ERRATA_STRETCH_FLEX_BASIS2, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2, ERRATA_ALL2, ERRATA_CLASSIC2, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2, FLEX_DIRECTION_COLUMN2, FLEX_DIRECTION_COLUMN_REVERSE2, FLEX_DIRECTION_ROW2, FLEX_DIRECTION_ROW_REVERSE2, GUTTER_COLUMN2, GUTTER_ROW2, GUTTER_ALL2, JUSTIFY_FLEX_START2, JUSTIFY_CENTER2, JUSTIFY_FLEX_END2, JUSTIFY_SPACE_BETWEEN2, JUSTIFY_SPACE_AROUND2, JUSTIFY_SPACE_EVENLY2, LOG_LEVEL_ERROR2, LOG_LEVEL_WARN2, LOG_LEVEL_INFO2, LOG_LEVEL_DEBUG2, LOG_LEVEL_VERBOSE2, LOG_LEVEL_FATAL2, MEASURE_MODE_UNDEFINED2, MEASURE_MODE_EXACTLY2, MEASURE_MODE_AT_MOST2, NODE_TYPE_DEFAULT2, NODE_TYPE_TEXT2, OVERFLOW_VISIBLE2, OVERFLOW_HIDDEN2, OVERFLOW_SCROLL2, POSITION_TYPE_STATIC2, POSITION_TYPE_RELATIVE2, POSITION_TYPE_ABSOLUTE2, UNIT_UNDEFINED2, UNIT_POINT2, UNIT_PERCENT2, UNIT_AUTO2, WRAP_NO_WRAP2, WRAP_WRAP2, WRAP_WRAP_REVERSE2, YogaStatus2, YogaError2, Config2, Node2, exports_yoga, yoga_default };
12611
13041
 
12612
- //# debugId=84623B9793C8945E64756E2164756E21
12613
- //# sourceMappingURL=chunk-node-jhq62x0c.js.map
13042
+ //# debugId=52FA770DF9A57B5D64756E2164756E21
13043
+ //# sourceMappingURL=chunk-node-y0w0hq5m.js.map