@opentui/core 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NativeSession.d.ts +3 -0
- package/{chunk-bun-b3p27aka.js → chunk-bun-e2gttx65.js} +90 -2
- package/chunk-bun-e2gttx65.js.map +35 -0
- package/{chunk-bun-ehstr7d7.js → chunk-bun-qphgryjx.js} +24 -3
- package/{chunk-bun-ehstr7d7.js.map → chunk-bun-qphgryjx.js.map} +5 -5
- package/{chunk-node-jt82vcf9.js → chunk-node-6rc18den.js} +90 -2
- package/chunk-node-6rc18den.js.map +34 -0
- package/{chunk-node-fs50qdd7.js → chunk-node-j1h89sfg.js} +24 -3
- package/{chunk-node-fs50qdd7.js.map → chunk-node-j1h89sfg.js.map} +5 -5
- package/index.bun.js +2 -2
- package/index.node.js +2 -2
- package/lib/terminal-capability-detection.d.ts +1 -0
- package/native-abi.generated.d.ts +66 -0
- package/package.json +9 -9
- package/renderer.d.ts +8 -1
- package/testing.bun.js +4 -3
- package/testing.bun.js.map +3 -3
- package/testing.js +4 -3
- package/testing.js.map +3 -3
- package/types.d.ts +32 -0
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig.d.ts +4 -1
- package/chunk-bun-b3p27aka.js.map +0 -35
- package/chunk-node-jt82vcf9.js.map +0 -34
|
@@ -1312,6 +1312,20 @@ var nativeLayouts = {
|
|
|
1312
1312
|
color: { offset: 16, size: 8, alignment: 2, type: "[4]u16" }
|
|
1313
1313
|
}
|
|
1314
1314
|
},
|
|
1315
|
+
ot_session_program_status: {
|
|
1316
|
+
size: 32,
|
|
1317
|
+
alignment: 4,
|
|
1318
|
+
fields: {
|
|
1319
|
+
state: { offset: 0, size: 4, alignment: 4, type: "u32" },
|
|
1320
|
+
kind: { offset: 4, size: 4, alignment: 4, type: "u32" },
|
|
1321
|
+
fields: { offset: 8, size: 4, alignment: 4, type: "u32" },
|
|
1322
|
+
progress: { offset: 12, size: 4, alignment: 4, type: "u32" },
|
|
1323
|
+
id_len: { offset: 16, size: 4, alignment: 4, type: "u32" },
|
|
1324
|
+
app_len: { offset: 20, size: 4, alignment: 4, type: "u32" },
|
|
1325
|
+
title_len: { offset: 24, size: 4, alignment: 4, type: "u32" },
|
|
1326
|
+
message_len: { offset: 28, size: 4, alignment: 4, type: "u32" }
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1315
1329
|
ot_session_capabilities: {
|
|
1316
1330
|
size: 144,
|
|
1317
1331
|
alignment: 4,
|
|
@@ -1952,11 +1966,22 @@ var nativeConstants = {
|
|
|
1952
1966
|
OT_CONTROL_CURSOR: 8,
|
|
1953
1967
|
OT_CONTROL_RESET_BACKGROUND: 9,
|
|
1954
1968
|
OT_CONTROL_PALETTE_QUERY: 10,
|
|
1969
|
+
OT_CONTROL_PROGRAM_STATUS: 11,
|
|
1955
1970
|
OT_CURSOR_POSITION: 1,
|
|
1956
1971
|
OT_CURSOR_STYLE: 2,
|
|
1957
1972
|
OT_CURSOR_BLINKING: 4,
|
|
1958
1973
|
OT_CURSOR_COLOR: 8,
|
|
1959
1974
|
OT_CURSOR_MOUSE_POINTER: 16,
|
|
1975
|
+
OT_PROGRAM_STATE_IDLE: 1,
|
|
1976
|
+
OT_PROGRAM_STATE_WORKING: 2,
|
|
1977
|
+
OT_PROGRAM_STATE_DONE: 3,
|
|
1978
|
+
OT_PROGRAM_STATE_BLOCKED: 4,
|
|
1979
|
+
OT_PROGRAM_STATE_ERROR: 5,
|
|
1980
|
+
OT_PROGRAM_STATE_CLEAR: 6,
|
|
1981
|
+
OT_PROGRAM_KIND_PERMISSION: 1,
|
|
1982
|
+
OT_PROGRAM_KIND_QUESTION: 2,
|
|
1983
|
+
OT_PROGRAM_KIND_AUTH: 3,
|
|
1984
|
+
OT_PROGRAM_STATUS_PROGRESS: 1,
|
|
1960
1985
|
OT_CAP_KITTY_KEYBOARD: 1,
|
|
1961
1986
|
OT_CAP_KITTY_GRAPHICS: 2,
|
|
1962
1987
|
OT_CAP_RGB: 4,
|
|
@@ -1974,6 +1999,7 @@ var nativeConstants = {
|
|
|
1974
1999
|
OT_CAP_NOTIFICATIONS: 16384,
|
|
1975
2000
|
OT_CAP_EXPLICIT_CURSOR_POSITIONING: 32768,
|
|
1976
2001
|
OT_CAP_REMOTE: 65536,
|
|
2002
|
+
OT_CAP_PROGRAM_STATUS: 131072,
|
|
1977
2003
|
OT_TERMINAL_UNINITIALIZED: 0,
|
|
1978
2004
|
OT_TERMINAL_SETTING_UP: 1,
|
|
1979
2005
|
OT_TERMINAL_ACTIVE: 2,
|
|
@@ -5742,6 +5768,19 @@ registerEnvVar2({
|
|
|
5742
5768
|
});
|
|
5743
5769
|
var CURSOR_STYLE_TO_ID = { block: 0, line: 1, underline: 2, default: 3 };
|
|
5744
5770
|
var CURSOR_ID_TO_STYLE = ["block", "line", "underline", "default"];
|
|
5771
|
+
var PROGRAM_STATE_TO_ID = {
|
|
5772
|
+
idle: nativeConstants.OT_PROGRAM_STATE_IDLE,
|
|
5773
|
+
working: nativeConstants.OT_PROGRAM_STATE_WORKING,
|
|
5774
|
+
done: nativeConstants.OT_PROGRAM_STATE_DONE,
|
|
5775
|
+
blocked: nativeConstants.OT_PROGRAM_STATE_BLOCKED,
|
|
5776
|
+
error: nativeConstants.OT_PROGRAM_STATE_ERROR,
|
|
5777
|
+
clear: nativeConstants.OT_PROGRAM_STATE_CLEAR
|
|
5778
|
+
};
|
|
5779
|
+
var PROGRAM_KIND_TO_ID = {
|
|
5780
|
+
permission: nativeConstants.OT_PROGRAM_KIND_PERMISSION,
|
|
5781
|
+
question: nativeConstants.OT_PROGRAM_KIND_QUESTION,
|
|
5782
|
+
auth: nativeConstants.OT_PROGRAM_KIND_AUTH
|
|
5783
|
+
};
|
|
5745
5784
|
var MOUSE_STYLE_TO_ID = {
|
|
5746
5785
|
auto: nativeConstants.OT_MOUSE_POINTER_AUTO,
|
|
5747
5786
|
default: nativeConstants.OT_MOUSE_POINTER_DEFAULT,
|
|
@@ -5876,6 +5915,50 @@ function sessionBytes(bytes, label) {
|
|
|
5876
5915
|
}
|
|
5877
5916
|
return new Uint8Array(typedArrayAccessors.buffer.get.call(bytes), typedArrayAccessors.byteOffset.get.call(bytes), length);
|
|
5878
5917
|
}
|
|
5918
|
+
function programStatusPayload(status, encoder) {
|
|
5919
|
+
const layout = nativeLayouts.ot_session_program_status;
|
|
5920
|
+
const { state, kind, progress, id, app, title, message } = status;
|
|
5921
|
+
const stateId = typeof state === "string" ? PROGRAM_STATE_TO_ID[state] : undefined;
|
|
5922
|
+
if (typeof stateId !== "number")
|
|
5923
|
+
throw new TypeError("Unknown program status state");
|
|
5924
|
+
const header = new Uint32Array(layout.size / 4);
|
|
5925
|
+
header[layout.fields.state.offset / 4] = stateId;
|
|
5926
|
+
if (kind != null) {
|
|
5927
|
+
const kindId = typeof kind === "string" ? PROGRAM_KIND_TO_ID[kind] : undefined;
|
|
5928
|
+
if (typeof kindId !== "number")
|
|
5929
|
+
throw new TypeError("Unknown program status kind");
|
|
5930
|
+
header[layout.fields.kind.offset / 4] = kindId;
|
|
5931
|
+
}
|
|
5932
|
+
if (progress != null) {
|
|
5933
|
+
if (typeof progress !== "number")
|
|
5934
|
+
throw new TypeError("Program status progress must be a number");
|
|
5935
|
+
if (!isFFIU32(progress))
|
|
5936
|
+
throw new RangeError("Program status progress must be an integer percentage");
|
|
5937
|
+
header[layout.fields.fields.offset / 4] = nativeConstants.OT_PROGRAM_STATUS_PROGRESS;
|
|
5938
|
+
header[layout.fields.progress.offset / 4] = progress;
|
|
5939
|
+
}
|
|
5940
|
+
if (id === "")
|
|
5941
|
+
throw new RangeError("Program status id must not be empty; omit it for the root record");
|
|
5942
|
+
const text = { id, app, title, message };
|
|
5943
|
+
const parts = ["id", "app", "title", "message"].map((name) => {
|
|
5944
|
+
const value = text[name];
|
|
5945
|
+
if (value == null)
|
|
5946
|
+
return new Uint8Array(0);
|
|
5947
|
+
if (typeof value !== "string")
|
|
5948
|
+
throw new TypeError(`Program status ${name} must be a string`);
|
|
5949
|
+
const bytes = encoder.encode(value.slice(0, NATIVE_SESSION_CONTROL_PACKET_BYTES2 + 1));
|
|
5950
|
+
header[layout.fields[`${name}_len`].offset / 4] = bytes.byteLength;
|
|
5951
|
+
return bytes;
|
|
5952
|
+
});
|
|
5953
|
+
const payload = new Uint8Array(layout.size + parts.reduce((total, part) => total + part.byteLength, 0));
|
|
5954
|
+
payload.set(new Uint8Array(header.buffer));
|
|
5955
|
+
let offset = layout.size;
|
|
5956
|
+
for (const part of parts) {
|
|
5957
|
+
payload.set(part, offset);
|
|
5958
|
+
offset += part.byteLength;
|
|
5959
|
+
}
|
|
5960
|
+
return payload;
|
|
5961
|
+
}
|
|
5879
5962
|
function pixelInput(data, length) {
|
|
5880
5963
|
if (typeof data === "number" || typeof data === "bigint")
|
|
5881
5964
|
return toPointer(data);
|
|
@@ -9539,6 +9622,10 @@ class FFIRenderLib2 {
|
|
|
9539
9622
|
record[kind] = nativeConstants.OT_CONTROL_KITTY_KEYBOARD_FLAGS;
|
|
9540
9623
|
record[layout.fields.argument.offset / 4] = toSafeFFIU32Length(command.flags, "Session Kitty keyboard flags");
|
|
9541
9624
|
break;
|
|
9625
|
+
case "program-status":
|
|
9626
|
+
record[kind] = nativeConstants.OT_CONTROL_PROGRAM_STATUS;
|
|
9627
|
+
bytes = programStatusPayload(command.status, this.encoder);
|
|
9628
|
+
break;
|
|
9542
9629
|
case "restore-modes":
|
|
9543
9630
|
record[kind] = nativeConstants.OT_CONTROL_RESTORE_MODES;
|
|
9544
9631
|
break;
|
|
@@ -9672,6 +9759,7 @@ class FFIRenderLib2 {
|
|
|
9672
9759
|
notifications: flag(nativeConstants.OT_CAP_NOTIFICATIONS),
|
|
9673
9760
|
explicit_cursor_positioning: flag(nativeConstants.OT_CAP_EXPLICIT_CURSOR_POSITIONING),
|
|
9674
9761
|
remote: flag(nativeConstants.OT_CAP_REMOTE),
|
|
9762
|
+
program_status: flag(nativeConstants.OT_CAP_PROGRAM_STATUS),
|
|
9675
9763
|
unicode: widthMethodFromCode(output[layout.fields.width_method.offset / 4]),
|
|
9676
9764
|
multiplexer: ["none", "tmux", "zellij", "screen", "unknown"][output[layout.fields.multiplexer.offset / 4]],
|
|
9677
9765
|
image_protocol: ["auto", "kitty", "sixel", "blocks"][output[layout.fields.image_protocol.offset / 4]],
|
|
@@ -12514,5 +12602,5 @@ var yoga_default = Yoga;
|
|
|
12514
12602
|
|
|
12515
12603
|
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, 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 };
|
|
12516
12604
|
|
|
12517
|
-
//# debugId=
|
|
12518
|
-
//# sourceMappingURL=chunk-node-
|
|
12605
|
+
//# debugId=43D93278DFBE8F4F64756E2164756E21
|
|
12606
|
+
//# sourceMappingURL=chunk-node-6rc18den.js.map
|