@opentui/core 0.8.0 → 0.8.2

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 (36) hide show
  1. package/NativeScene.d.ts +10 -2
  2. package/NativeSession.d.ts +22 -2
  3. package/buffer.d.ts +2 -0
  4. package/{chunk-bun-6kxdhkdc.js → chunk-bun-vd3rj9kv.js} +451 -74
  5. package/{chunk-bun-6kxdhkdc.js.map → chunk-bun-vd3rj9kv.js.map} +10 -10
  6. package/{chunk-bun-x6cz4jyg.js → chunk-bun-wdetc10w.js} +222 -10
  7. package/chunk-bun-wdetc10w.js.map +35 -0
  8. package/{chunk-node-y0w0hq5m.js → chunk-node-m8mjyx7h.js} +222 -10
  9. package/chunk-node-m8mjyx7h.js.map +34 -0
  10. package/{chunk-node-q5ccgbk5.js → chunk-node-s9be55eh.js} +451 -74
  11. package/{chunk-node-q5ccgbk5.js.map → chunk-node-s9be55eh.js.map} +10 -10
  12. package/index.bun.js +684 -415
  13. package/index.bun.js.map +13 -12
  14. package/index.d.ts +1 -1
  15. package/index.node.js +684 -415
  16. package/index.node.js.map +13 -11
  17. package/native-abi.generated.d.ts +171 -3
  18. package/package.json +9 -9
  19. package/renderables/Image.d.ts +13 -1
  20. package/renderables/LineNumberRenderable.d.ts +1 -1
  21. package/renderables/Markdown.d.ts +1 -6
  22. package/renderables/ScrollBox.d.ts +1 -1
  23. package/renderables/Select.d.ts +0 -2
  24. package/renderables/TabSelect.d.ts +0 -3
  25. package/renderables/TextTable.d.ts +1 -8
  26. package/renderables/Video.d.ts +126 -0
  27. package/renderables/index.d.ts +1 -0
  28. package/renderables/markdown-parser.d.ts +1 -0
  29. package/renderer.d.ts +23 -2
  30. package/testing.bun.js +2 -2
  31. package/testing.js +2 -2
  32. package/yoga.bun.js +1 -1
  33. package/yoga.js +1 -1
  34. package/zig.d.ts +54 -2
  35. package/chunk-bun-x6cz4jyg.js.map +0 -35
  36. package/chunk-node-y0w0hq5m.js.map +0 -34
@@ -257,6 +257,19 @@ var nativeSymbols = {
257
257
  ot_image_take_pixels: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
258
258
  ot_image_pixels_release: { args: ["ptr", "buffer"], returns: "i32" },
259
259
  ot_scene_set_image: { args: ["ptr", "buffer", "ptr", "u32", "u32", "ptr"], returns: "i32" },
260
+ ot_scene_set_crop: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32"], returns: "i32" },
261
+ ot_scene_set_video: { args: ["ptr", "buffer", "u32", "ptr"], returns: "i32" },
262
+ ot_video_open: { args: ["ptr", "buffer", "ptr", "u32", "u32", "buffer"], returns: "i32" },
263
+ ot_video_play: { args: ["ptr", "buffer"], returns: "i32" },
264
+ ot_video_pause: { args: ["ptr", "buffer"], returns: "i32" },
265
+ ot_video_seek: { args: ["ptr", "buffer", "i64"], returns: "i32" },
266
+ ot_video_set_loop: { args: ["ptr", "buffer", "u32"], returns: "i32" },
267
+ ot_video_set_muted: { args: ["ptr", "buffer", "u32"], returns: "i32" },
268
+ ot_video_set_volume: { args: ["ptr", "buffer", "f32"], returns: "i32" },
269
+ ot_video_set_av_sync_offset: { args: ["ptr", "buffer", "i64"], returns: "i32" },
270
+ ot_video_set_max_fps: { args: ["ptr", "buffer", "u32"], returns: "i32" },
271
+ ot_video_get_state: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
272
+ ot_video_get_error: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
260
273
  ot_buffer_draw_image: { args: ["ptr", "buffer", "ptr", "buffer", "buffer", "buffer"], returns: "i32" },
261
274
  ot_session_set_image_resolution: { args: ["ptr", "buffer", "u32", "u32", "u32", "u32"], returns: "i32" },
262
275
  ot_session_set_kitty_image_transport: { args: ["ptr", "buffer", "u32"], returns: "i32" },
@@ -371,8 +384,10 @@ var nativeSymbols = {
371
384
  ot_session_read_output: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
372
385
  ot_session_drain_output: { args: ["ptr", "buffer", "u32", "buffer", "ptr", "ptr"], returns: "i32" },
373
386
  ot_session_drain_stdout: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
387
+ ot_session_post_stdout: { args: ["ptr", "buffer", "u32", "u32", "buffer", "buffer"], returns: "i32" },
374
388
  ot_session_complete_output: { args: ["ptr", "buffer", "buffer", "u32"], returns: "i32" },
375
389
  ot_session_close: { args: ["ptr", "buffer"], returns: "i32" },
390
+ ot_session_drop_output: { args: ["ptr", "buffer"], returns: "i32" },
376
391
  ot_session_pump_exit: { args: ["ptr", "buffer", "buffer"], returns: "i32" },
377
392
  ot_terminal_flush_input: { args: [], returns: "i32" },
378
393
  ot_session_cancel: { args: ["ptr", "buffer"], returns: "i32" },
@@ -876,7 +891,7 @@ var nativeLayouts = {
876
891
  }
877
892
  },
878
893
  ot_session_renderer_state: {
879
- size: 32,
894
+ size: 40,
880
895
  alignment: 8,
881
896
  fields: {
882
897
  struct_size: { offset: 0, size: 4, alignment: 4, type: "u32" },
@@ -885,7 +900,9 @@ var nativeLayouts = {
885
900
  height: { offset: 12, size: 4, alignment: 4, type: "u32" },
886
901
  frame_count: { offset: 16, size: 8, alignment: 8, type: "u64" },
887
902
  frame_pending: { offset: 24, size: 4, alignment: 4, type: "u32" },
888
- reserved: { offset: 28, size: 4, alignment: 4, type: "u32" }
903
+ image_uploads_pending: { offset: 28, size: 4, alignment: 4, type: "u32" },
904
+ dropped_frames: { offset: 32, size: 4, alignment: 4, type: "u32" },
905
+ dropped_frame_bytes: { offset: 36, size: 4, alignment: 4, type: "u32" }
889
906
  }
890
907
  },
891
908
  ot_buffer_options: {
@@ -1139,6 +1156,29 @@ var nativeLayouts = {
1139
1156
  byte_count: { offset: 24, size: 8, alignment: 8, type: "u64" }
1140
1157
  }
1141
1158
  },
1159
+ ot_video_info: {
1160
+ size: 32,
1161
+ alignment: 8,
1162
+ fields: {
1163
+ duration_us: { offset: 0, size: 8, alignment: 8, type: "i64" },
1164
+ width: { offset: 8, size: 4, alignment: 4, type: "u32" },
1165
+ height: { offset: 12, size: 4, alignment: 4, type: "u32" },
1166
+ fps_num: { offset: 16, size: 4, alignment: 4, type: "u32" },
1167
+ fps_den: { offset: 20, size: 4, alignment: 4, type: "u32" },
1168
+ has_audio: { offset: 24, size: 4, alignment: 4, type: "u32" },
1169
+ reserved: { offset: 28, size: 4, alignment: 4, type: "u32" }
1170
+ }
1171
+ },
1172
+ ot_video_state: {
1173
+ size: 24,
1174
+ alignment: 8,
1175
+ fields: {
1176
+ current_time_us: { offset: 0, size: 8, alignment: 8, type: "i64" },
1177
+ frame_pts_us: { offset: 8, size: 8, alignment: 8, type: "i64" },
1178
+ flags: { offset: 16, size: 4, alignment: 4, type: "u32" },
1179
+ quality_tier: { offset: 20, size: 4, alignment: 4, type: "u32" }
1180
+ }
1181
+ },
1142
1182
  ot_image_draw_options: {
1143
1183
  size: 64,
1144
1184
  alignment: 4,
@@ -1242,7 +1282,7 @@ var nativeLayouts = {
1242
1282
  }
1243
1283
  },
1244
1284
  ot_buffer_draw_text_record: {
1245
- size: 44,
1285
+ size: 48,
1246
1286
  alignment: 4,
1247
1287
  fields: {
1248
1288
  header: { offset: 0, size: 16, alignment: 4, type: "ot_buffer_draw_header" },
@@ -1250,7 +1290,8 @@ var nativeLayouts = {
1250
1290
  y: { offset: 20, size: 4, alignment: 4, type: "i32" },
1251
1291
  attributes: { offset: 24, size: 4, alignment: 4, type: "u32" },
1252
1292
  foreground: { offset: 28, size: 8, alignment: 2, type: "[4]u16" },
1253
- background: { offset: 36, size: 8, alignment: 2, type: "[4]u16" }
1293
+ background: { offset: 36, size: 8, alignment: 2, type: "[4]u16" },
1294
+ max_width: { offset: 44, size: 4, alignment: 4, type: "u32" }
1254
1295
  }
1255
1296
  },
1256
1297
  ot_buffer_draw_cell: {
@@ -1664,6 +1705,7 @@ var nativeConstants = {
1664
1705
  OT_IMAGE_OUTPUT_TOO_SMALL: -45,
1665
1706
  OT_IMAGE_UNSUPPORTED_FEATURE: -46,
1666
1707
  OT_IMAGE_BUSY: -47,
1708
+ OT_VIDEO_FAILED: -60,
1667
1709
  OT_SCENE_ROOT: 0,
1668
1710
  OT_SCENE_BOX: 1,
1669
1711
  OT_SCENE_TEXT: 2,
@@ -1673,6 +1715,7 @@ var nativeConstants = {
1673
1715
  OT_SCENE_CUSTOM: 6,
1674
1716
  OT_SCENE_TEXT_VIEW: 7,
1675
1717
  OT_SCENE_IMAGE: 8,
1718
+ OT_SCENE_VIDEO: 9,
1676
1719
  OT_SCENE_WRAP_NONE: 0,
1677
1720
  OT_SCENE_WRAP_CHAR: 1,
1678
1721
  OT_SCENE_WRAP_WORD: 2,
@@ -2048,6 +2091,13 @@ var nativeConstants = {
2048
2091
  OT_IMAGE_BLEND_SOURCE_OVER: 0,
2049
2092
  OT_IMAGE_BLEND_SOURCE: 1,
2050
2093
  OT_IMAGE_BLEND_DESTINATION_OVER: 2,
2094
+ OT_VIDEO_OPEN_NO_AUDIO: 1,
2095
+ OT_VIDEO_PLAYING: 1,
2096
+ OT_VIDEO_ENDED: 2,
2097
+ OT_VIDEO_BUFFERING: 4,
2098
+ OT_VIDEO_AUDIO: 8,
2099
+ OT_VIDEO_HAS_FRAME: 16,
2100
+ OT_VIDEO_ERROR: 32,
2051
2101
  OT_TEXT_VIEW_WRAP_WIDTH: 0,
2052
2102
  OT_TEXT_VIEW_WRAP_MODE: 1,
2053
2103
  OT_TEXT_VIEW_FIRST_LINE_OFFSET: 2,
@@ -2071,6 +2121,7 @@ var nativeConstants = {
2071
2121
  OT_BUFFER_DRAW_HAS_BACKGROUND: 1,
2072
2122
  OT_BUFFER_DRAW_HAS_SOURCE_WIDTH: 2,
2073
2123
  OT_BUFFER_DRAW_HAS_SOURCE_HEIGHT: 4,
2124
+ OT_BUFFER_DRAW_FIT_ELLIPSIS: 16,
2074
2125
  OT_BUFFER_STACK_DEPTH_MAX: 256,
2075
2126
  OT_BUFFER_STACK_GET_OPACITY: 0,
2076
2127
  OT_BUFFER_STACK_PUSH_SCISSOR: 1,
@@ -2149,6 +2200,8 @@ var nativeConstants = {
2149
2200
  OT_PUMP_OUTPUT_PENDING: 2,
2150
2201
  OT_PUMP_WAIT_UNTIL: 3,
2151
2202
  OT_PUMP_CLOSED: 4,
2203
+ OT_STDOUT_IDLE: 0,
2204
+ OT_STDOUT_IN_FLIGHT: 1,
2152
2205
  OT_INPUT_KEY: 1,
2153
2206
  OT_INPUT_MOUSE: 2,
2154
2207
  OT_INPUT_PASTE: 3,
@@ -5982,6 +6035,7 @@ var NativeStatus2;
5982
6035
  NativeStatus[NativeStatus["LayoutLimit"] = -26] = "LayoutLimit";
5983
6036
  NativeStatus[NativeStatus["FrameBusy"] = -27] = "FrameBusy";
5984
6037
  NativeStatus[NativeStatus["FrameRequestLimit"] = -28] = "FrameRequestLimit";
6038
+ NativeStatus[NativeStatus["VideoFailed"] = -60] = "VideoFailed";
5985
6039
  })(NativeStatus2 ||= {});
5986
6040
 
5987
6041
  class NativeError2 extends Error {
@@ -6113,6 +6167,12 @@ registerEnvVar2({
6113
6167
  type: "string",
6114
6168
  required: false
6115
6169
  });
6170
+ registerEnvVar2({
6171
+ name: "OPENTUI_EXPERIMENTAL_VIDEO_HWACCEL",
6172
+ description: "Experimental: decode video with VideoToolbox on macOS when set to exactly 1 or true; otherwise or on failure, decode in software",
6173
+ type: "string",
6174
+ required: false
6175
+ });
6116
6176
  var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2, default: 3 };
6117
6177
  var CURSOR_ID_TO_STYLE = ["block", "line", "underline", "default"];
6118
6178
  var PROGRAM_STATE_TO_ID = {
@@ -6169,7 +6229,18 @@ var MOUSE_STYLE_TO_ID = {
6169
6229
  var SCENE_BORDER_STYLES = ["single", "double", "rounded", "heavy"];
6170
6230
  var SCENE_TEXT_WRAP_MODES = ["none", "char", "word"];
6171
6231
  var SCENE_TEXT_ALIGNS = ["left", "center", "right"];
6172
- var SCENE_NODE_KINDS = ["root", "box", "text", "slider", "arrow", "editor", "custom", "text_view", "image"];
6232
+ var SCENE_NODE_KINDS = [
6233
+ "root",
6234
+ "box",
6235
+ "text",
6236
+ "slider",
6237
+ "arrow",
6238
+ "editor",
6239
+ "custom",
6240
+ "text_view",
6241
+ "image",
6242
+ "video"
6243
+ ];
6173
6244
  var IMAGE_PROTOCOL_TO_ID = { auto: 0, kitty: 1, sixel: 2, blocks: 3 };
6174
6245
  var IMAGE_FITS = ["fit", "cover", "fill"];
6175
6246
  var BUFFER_DRAW_OPERATIONS = new Map([
@@ -6546,8 +6617,8 @@ function encodeBufferDrawRecord(context, options, words, signed, colors, base, s
6546
6617
  const fields = nativeLayouts.ot_buffer_draw_text_record.fields;
6547
6618
  encodeDrawPosition(signed, fields, options, base);
6548
6619
  words[word + fields.attributes.offset / 4] = toSafeFFIU32Length(options.attributes ?? 0, "Buffer attributes");
6549
- if (encodeDrawColors(colors, fields, options, base))
6550
- words[word + header.flags.offset / 4] = nativeConstants.OT_BUFFER_DRAW_HAS_BACKGROUND;
6620
+ words[word + fields.max_width.offset / 4] = toSafeFFIU32Length(options.maxWidth ?? 0, "Buffer text width");
6621
+ words[word + header.flags.offset / 4] = (encodeDrawColors(colors, fields, options, base) ? nativeConstants.OT_BUFFER_DRAW_HAS_BACKGROUND : 0) | (options.ellipsis ? nativeConstants.OT_BUFFER_DRAW_FIT_ELLIPSIS : 0);
6551
6622
  break;
6552
6623
  }
6553
6624
  case "cell":
@@ -8084,6 +8155,8 @@ class FFIRenderLib2 {
8084
8155
  sceneFlushApplied = new Uint32Array(1);
8085
8156
  editorSelectionRecord = createEditorSelectionRecord();
8086
8157
  editorViewInfoRecord = createContextRecord(nativeLayouts.ot_editor_view_info);
8158
+ videoStateRecord = new Uint8Array(nativeLayouts.ot_video_state.size);
8159
+ videoStateView = new DataView(this.videoStateRecord.buffer);
8087
8160
  selectionResetRecord = encodeEditorSelection({ operation: 2 /* Reset */ });
8088
8161
  localSelectionResetRecord = encodeEditorSelection({
8089
8162
  operation: 5 /* LocalReset */
@@ -9429,6 +9502,129 @@ class FFIRenderLib2 {
9429
9502
  nativeResult("ot_scene_set_image", this.opentui.symbols.ot_scene_set_image(pointer, handle, source, fitId, protocolId, storage));
9430
9503
  });
9431
9504
  }
9505
+ sceneSetVideo(context, node, fit, buffer) {
9506
+ const handle = encodeContextHandle(context, node);
9507
+ const storage = buffer === null ? null : encodeContextHandle(context, buffer);
9508
+ const fitId = IMAGE_FITS.indexOf(fit);
9509
+ if (fitId < 0)
9510
+ throw new TypeError("Unknown video fit");
9511
+ this.getYogaHost().runMutation(() => {
9512
+ const pointer = this.nativeContextPointer(context, "ot_scene_set_video");
9513
+ nativeResult("ot_scene_set_video", this.opentui.symbols.ot_scene_set_video(pointer, handle, fitId, storage));
9514
+ });
9515
+ }
9516
+ sceneSetCrop(context, node, crop) {
9517
+ const handle = encodeContextHandle(context, node);
9518
+ const { left = 0, top = 0, width = 0, height = 0 } = crop ?? {};
9519
+ this.getYogaHost().runMutation(() => {
9520
+ const pointer = this.nativeContextPointer(context, "ot_scene_set_crop");
9521
+ nativeResult("ot_scene_set_crop", this.opentui.symbols.ot_scene_set_crop(pointer, handle, left, top, width, height));
9522
+ });
9523
+ }
9524
+ videoOpen(context, node, path, audio) {
9525
+ const handle = encodeContextHandle(context, node);
9526
+ const bytes = path.length === 0 ? null : sessionBytes(this.encoder.encode(path), "Video path length");
9527
+ const layout = nativeLayouts.ot_video_info;
9528
+ const output = new Uint8Array(layout.size);
9529
+ const flags = audio ? 0 : nativeConstants.OT_VIDEO_OPEN_NO_AUDIO;
9530
+ this.getYogaHost().runMutation(() => {
9531
+ const pointer = this.nativeContextPointer(context, "ot_video_open");
9532
+ nativeResult("ot_video_open", this.opentui.symbols.ot_video_open(pointer, handle, bytes, bytes?.byteLength ?? 0, flags, output));
9533
+ });
9534
+ const view = new DataView(output.buffer);
9535
+ const fields = layout.fields;
9536
+ return {
9537
+ durationUs: view.getBigInt64(fields.duration_us.offset, true),
9538
+ width: view.getUint32(fields.width.offset, true),
9539
+ height: view.getUint32(fields.height.offset, true),
9540
+ fpsNum: view.getUint32(fields.fps_num.offset, true),
9541
+ fpsDen: view.getUint32(fields.fps_den.offset, true),
9542
+ hasAudio: view.getUint32(fields.has_audio.offset, true) !== 0
9543
+ };
9544
+ }
9545
+ videoCall(context, node, operation) {
9546
+ const handle = encodeContextHandle(context, node);
9547
+ this.getYogaHost().runMutation(() => {
9548
+ const pointer = this.nativeContextPointer(context, operation);
9549
+ nativeResult(operation, this.opentui.symbols[operation](pointer, handle));
9550
+ });
9551
+ }
9552
+ videoSeek(context, node, timeUs) {
9553
+ const handle = encodeContextHandle(context, node);
9554
+ this.getYogaHost().runMutation(() => {
9555
+ const pointer = this.nativeContextPointer(context, "ot_video_seek");
9556
+ nativeResult("ot_video_seek", this.opentui.symbols.ot_video_seek(pointer, handle, timeUs));
9557
+ });
9558
+ }
9559
+ videoSetLoop(context, node, loop) {
9560
+ const handle = encodeContextHandle(context, node);
9561
+ const value = toFFIBool(loop, "Video loop");
9562
+ this.getYogaHost().runMutation(() => {
9563
+ const pointer = this.nativeContextPointer(context, "ot_video_set_loop");
9564
+ nativeResult("ot_video_set_loop", this.opentui.symbols.ot_video_set_loop(pointer, handle, value));
9565
+ });
9566
+ }
9567
+ videoSetMuted(context, node, muted) {
9568
+ const handle = encodeContextHandle(context, node);
9569
+ const value = toFFIBool(muted, "Video muted");
9570
+ this.getYogaHost().runMutation(() => {
9571
+ const pointer = this.nativeContextPointer(context, "ot_video_set_muted");
9572
+ nativeResult("ot_video_set_muted", this.opentui.symbols.ot_video_set_muted(pointer, handle, value));
9573
+ });
9574
+ }
9575
+ videoSetVolume(context, node, volume) {
9576
+ const handle = encodeContextHandle(context, node);
9577
+ const value = toFFIF32(volume, "Video volume");
9578
+ this.getYogaHost().runMutation(() => {
9579
+ const pointer = this.nativeContextPointer(context, "ot_video_set_volume");
9580
+ nativeResult("ot_video_set_volume", this.opentui.symbols.ot_video_set_volume(pointer, handle, value));
9581
+ });
9582
+ }
9583
+ videoSetAvSyncOffset(context, node, offsetUs) {
9584
+ const handle = encodeContextHandle(context, node);
9585
+ this.getYogaHost().runMutation(() => {
9586
+ const pointer = this.nativeContextPointer(context, "ot_video_set_av_sync_offset");
9587
+ nativeResult("ot_video_set_av_sync_offset", this.opentui.symbols.ot_video_set_av_sync_offset(pointer, handle, offsetUs));
9588
+ });
9589
+ }
9590
+ videoSetMaxFps(context, node, fps) {
9591
+ const handle = encodeContextHandle(context, node);
9592
+ if (!isFFIU32(fps))
9593
+ throw new RangeError("Video maxFps must be a u32");
9594
+ this.getYogaHost().runMutation(() => {
9595
+ const pointer = this.nativeContextPointer(context, "ot_video_set_max_fps");
9596
+ nativeResult("ot_video_set_max_fps", this.opentui.symbols.ot_video_set_max_fps(pointer, handle, fps));
9597
+ });
9598
+ }
9599
+ videoGetState(context, node) {
9600
+ const handle = encodeContextHandle(context, node);
9601
+ const layout = nativeLayouts.ot_video_state;
9602
+ const output = this.videoStateRecord;
9603
+ this.getYogaHost().runMutation(() => {
9604
+ const pointer = this.nativeContextPointer(context, "ot_video_get_state");
9605
+ nativeResult("ot_video_get_state", this.opentui.symbols.ot_video_get_state(pointer, handle, output));
9606
+ });
9607
+ const view = this.videoStateView;
9608
+ const flags = view.getUint32(layout.fields.flags.offset, true);
9609
+ return {
9610
+ currentTimeUs: view.getBigInt64(layout.fields.current_time_us.offset, true),
9611
+ framePtsUs: view.getBigInt64(layout.fields.frame_pts_us.offset, true),
9612
+ playing: (flags & nativeConstants.OT_VIDEO_PLAYING) !== 0,
9613
+ ended: (flags & nativeConstants.OT_VIDEO_ENDED) !== 0,
9614
+ buffering: (flags & nativeConstants.OT_VIDEO_BUFFERING) !== 0,
9615
+ audio: (flags & nativeConstants.OT_VIDEO_AUDIO) !== 0,
9616
+ hasFrame: (flags & nativeConstants.OT_VIDEO_HAS_FRAME) !== 0,
9617
+ failed: (flags & nativeConstants.OT_VIDEO_ERROR) !== 0,
9618
+ qualityTier: view.getUint32(layout.fields.quality_tier.offset, true)
9619
+ };
9620
+ }
9621
+ videoGetError(context, node) {
9622
+ const handle = encodeContextHandle(context, node);
9623
+ return this.getYogaHost().runMutation(() => {
9624
+ const pointer = this.nativeContextPointer(context, "ot_video_get_error");
9625
+ return this.readText("ot_video_get_error", (bytes, capacity, count) => this.opentui.symbols.ot_video_get_error(pointer, handle, bytes, capacity, count));
9626
+ });
9627
+ }
9432
9628
  contextDrawImage({ context, target, frame }, image, options) {
9433
9629
  const layout = nativeLayouts.ot_image_draw_options;
9434
9630
  const handle = encodeContextHandle(context, target);
@@ -9781,7 +9977,10 @@ class FFIRenderLib2 {
9781
9977
  width: words[layout.fields.width.offset / 4],
9782
9978
  height: words[layout.fields.height.offset / 4],
9783
9979
  frameCount: output[layout.fields.frame_count.offset / 8],
9784
- framePending: words[layout.fields.frame_pending.offset / 4] !== 0
9980
+ framePending: words[layout.fields.frame_pending.offset / 4] !== 0,
9981
+ imageUploadsPending: words[layout.fields.image_uploads_pending.offset / 4],
9982
+ droppedFrames: words[layout.fields.dropped_frames.offset / 4],
9983
+ droppedFrameBytes: words[layout.fields.dropped_frame_bytes.offset / 4]
9785
9984
  };
9786
9985
  }
9787
9986
  sessionAcquireBufferLease(context, session, which) {
@@ -10162,6 +10361,15 @@ class FFIRenderLib2 {
10162
10361
  nativeResult("ot_session_drain_stdout", this.opentui.symbols.ot_session_drain_stdout(pointer, handle, limit, output));
10163
10362
  return output[0];
10164
10363
  }
10364
+ sessionPostStdout(context, session, maxBytes, wait) {
10365
+ const handle = encodeContextHandle(context, session);
10366
+ const limit = toSafeFFIU32Length(maxBytes, "Stdout byte limit");
10367
+ const state = new Uint32Array(1);
10368
+ const written = new Uint32Array(1);
10369
+ const pointer = this.nativeContextPointer(context, "ot_session_post_stdout");
10370
+ nativeResult("ot_session_post_stdout", this.opentui.symbols.ot_session_post_stdout(pointer, handle, limit, wait ? 1 : 0, state, written));
10371
+ return { written: written[0], inFlight: state[0] === 1 };
10372
+ }
10165
10373
  sessionCompleteOutput(context, session, ticket, success) {
10166
10374
  const layout = nativeLayouts.ot_output_ticket;
10167
10375
  const written = toFFIBool(success, "Session output success");
@@ -10177,6 +10385,10 @@ class FFIRenderLib2 {
10177
10385
  const handle = encodeContextHandle(context, session);
10178
10386
  nativeResult("ot_session_close", this.opentui.symbols.ot_session_close(this.nativeContextPointer(context, "ot_session_close"), handle));
10179
10387
  }
10388
+ sessionDropOutput(context, session) {
10389
+ const handle = encodeContextHandle(context, session);
10390
+ nativeResult("ot_session_drop_output", this.opentui.symbols.ot_session_drop_output(this.nativeContextPointer(context, "ot_session_drop_output"), handle));
10391
+ }
10180
10392
  sessionCancel(context, session) {
10181
10393
  const handle = encodeContextHandle(context, session);
10182
10394
  nativeResult("ot_session_cancel", this.opentui.symbols.ot_session_cancel(this.nativeContextPointer(context, "ot_session_cancel"), handle));
@@ -13059,5 +13271,5 @@ var yoga_default = Yoga;
13059
13271
 
13060
13272
  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 };
13061
13273
 
13062
- //# debugId=73DA944B9648B9C064756E2164756E21
13063
- //# sourceMappingURL=chunk-bun-x6cz4jyg.js.map
13274
+ //# debugId=B045E4F588BC986E64756E2164756E21
13275
+ //# sourceMappingURL=chunk-bun-wdetc10w.js.map