@jitl/opentui-core 0.1.97 → 0.2.15

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 (132) hide show
  1. package/NativeSpanFeed.d.ts +2 -2
  2. package/README.md +2 -1
  3. package/Renderable.d.ts +12 -1
  4. package/audio.d.ts +89 -0
  5. package/buffer.d.ts +6 -5
  6. package/console.d.ts +3 -1
  7. package/edit-buffer.d.ts +1 -1
  8. package/editor-view.d.ts +1 -1
  9. package/{index-yxe6e14n.js → index-46f5e8m6.js} +1388 -1721
  10. package/index-46f5e8m6.js.map +36 -0
  11. package/index-5zwezmgj.js +639 -0
  12. package/index-5zwezmgj.js.map +11 -0
  13. package/index-axv7cw60.js +44 -0
  14. package/index-axv7cw60.js.map +10 -0
  15. package/{index-rhfjv9c1.js → index-g9agybj3.js} +4626 -984
  16. package/index-g9agybj3.js.map +82 -0
  17. package/index-k18nf2r7.js +21 -0
  18. package/{ffi-x3zvcksd.js.map → index-k18nf2r7.js.map} +1 -1
  19. package/{index-tkk6cmr2.js → index-rp7vz5rh.js} +125 -23
  20. package/index-rp7vz5rh.js.map +10 -0
  21. package/{index-kcpn1hka.js → index-xwsdfq5x.js} +16 -6
  22. package/index-xwsdfq5x.js.map +10 -0
  23. package/index.d.ts +1 -0
  24. package/index.js +37 -17
  25. package/index.js.map +1 -1
  26. package/lib/RGBA.d.ts +22 -6
  27. package/lib/clipboard.d.ts +1 -1
  28. package/lib/{keymapping.d.ts → keybinding.internal.d.ts} +10 -2
  29. package/lib/objects-in-viewport.d.ts +4 -4
  30. package/lib/parse.keypress-kitty.d.ts +1 -0
  31. package/lib/parse.keypress.d.ts +1 -0
  32. package/lib/render-geometry.d.ts +8 -0
  33. package/lib/stdin-parser.d.ts +4 -1
  34. package/lib/terminal-capability-detection.d.ts +2 -0
  35. package/lib/terminal-palette.d.ts +20 -5
  36. package/lib/tree-sitter/assets/update.d.ts +1 -0
  37. package/lib/tree-sitter/client.d.ts +2 -0
  38. package/lib/tree-sitter/default-parsers.d.ts +1 -1
  39. package/lib/tree-sitter/index.d.ts +0 -2
  40. package/lib/tree-sitter/update-assets.d.ts +3 -0
  41. package/lib/tree-sitter/update-assets.js +377 -0
  42. package/lib/tree-sitter/update-assets.js.map +12 -0
  43. package/lib/tree-sitter-styled-text.d.ts +6 -4
  44. package/node22-bun-ffi-structs-ha8fmzzb.js +396 -0
  45. package/node22-bun-ffi-structs-ha8fmzzb.js.map +10 -0
  46. package/package.json +23 -22
  47. package/parser.worker.js +161 -24
  48. package/parser.worker.js.map +12 -5
  49. package/platform/bun-ffi-structs.d.ts +2 -0
  50. package/platform/ffi.d.ts +126 -0
  51. package/platform/node22-bun-ffi-structs.d.ts +33 -0
  52. package/platform/node22-ffi.d.ts +33 -0
  53. package/{compat → platform}/runtime.d.ts +6 -0
  54. package/platform/worker.d.ts +4 -0
  55. package/renderables/Code.d.ts +4 -0
  56. package/renderables/Markdown.d.ts +62 -0
  57. package/renderables/ScrollBox.d.ts +1 -0
  58. package/renderables/Select.d.ts +3 -1
  59. package/renderables/TabSelect.d.ts +3 -1
  60. package/renderables/TextBufferRenderable.d.ts +1 -0
  61. package/renderables/TextTable.d.ts +15 -1
  62. package/renderables/Textarea.d.ts +5 -3
  63. package/renderables/markdown-parser.d.ts +1 -0
  64. package/renderer-theme-mode.d.ts +29 -0
  65. package/renderer.d.ts +142 -16
  66. package/runtime-plugin-support-configure.d.ts +4 -0
  67. package/runtime-plugin-support-configure.js +20 -0
  68. package/{index-re3ntm60.js.map → runtime-plugin-support-configure.js.map} +1 -1
  69. package/runtime-plugin-support.d.ts +3 -3
  70. package/runtime-plugin-support.js +9 -18
  71. package/runtime-plugin-support.js.map +3 -3
  72. package/runtime-plugin.d.ts +1 -4
  73. package/runtime-plugin.js +5 -5
  74. package/syntax-style.d.ts +11 -3
  75. package/testing/terminal-capabilities.d.ts +7 -0
  76. package/testing/test-recorder.d.ts +6 -6
  77. package/testing/test-renderer.d.ts +34 -2
  78. package/testing.d.ts +2 -0
  79. package/testing.js +329 -23
  80. package/testing.js.map +7 -5
  81. package/text-buffer-view.d.ts +2 -1
  82. package/text-buffer.d.ts +1 -1
  83. package/types.d.ts +33 -1
  84. package/zig-structs.d.ts +111 -20
  85. package/zig.d.ts +57 -7
  86. package/3d/SpriteResourceManager.d.ts +0 -74
  87. package/3d/SpriteUtils.d.ts +0 -13
  88. package/3d/TextureUtils.d.ts +0 -24
  89. package/3d/ThreeRenderable.d.ts +0 -40
  90. package/3d/WGPURenderer.d.ts +0 -61
  91. package/3d/animation/ExplodingSpriteEffect.d.ts +0 -71
  92. package/3d/animation/PhysicsExplodingSpriteEffect.d.ts +0 -76
  93. package/3d/animation/SpriteAnimator.d.ts +0 -124
  94. package/3d/animation/SpriteParticleGenerator.d.ts +0 -62
  95. package/3d/canvas.d.ts +0 -44
  96. package/3d/index.d.ts +0 -12
  97. package/3d/physics/PlanckPhysicsAdapter.d.ts +0 -19
  98. package/3d/physics/RapierPhysicsAdapter.d.ts +0 -19
  99. package/3d/physics/physics-interface.d.ts +0 -27
  100. package/3d.d.ts +0 -2
  101. package/3d.js +0 -33843
  102. package/3d.js.map +0 -155
  103. package/Worker-vajwjk0s.js +0 -94
  104. package/Worker-vajwjk0s.js.map +0 -10
  105. package/compat/FFIType.d.ts +0 -304
  106. package/compat/Worker.d.ts +0 -1
  107. package/compat/bun-ffi-structs.d.ts +0 -2
  108. package/compat/ffi.d.ts +0 -86
  109. package/compat/nodejs/Worker.d.ts +0 -16
  110. package/compat/nodejs/bun-ffi-structs/index.d.ts +0 -46
  111. package/compat/nodejs/ffi.d.ts +0 -21
  112. package/compat/nodejs/registerResolveJs.d.ts +0 -1
  113. package/compat/nodejs/runtime.d.ts +0 -7
  114. package/compat/nodejs/test.d.ts +0 -4
  115. package/compat/nodejs/trampoline.worker.d.ts +0 -1
  116. package/compat/test.d.ts +0 -1
  117. package/compat/testHelpers.d.ts +0 -18
  118. package/ffi-x3zvcksd.js +0 -25
  119. package/index-5yqvbmcz.js +0 -220
  120. package/index-5yqvbmcz.js.map +0 -10
  121. package/index-bnfz2g63.js +0 -654
  122. package/index-bnfz2g63.js.map +0 -10
  123. package/index-cbvybypy.js +0 -43
  124. package/index-cbvybypy.js.map +0 -10
  125. package/index-kcpn1hka.js.map +0 -10
  126. package/index-re3ntm60.js +0 -51
  127. package/index-rhfjv9c1.js.map +0 -70
  128. package/index-tkk6cmr2.js.map +0 -10
  129. package/index-yxe6e14n.js.map +0 -42
  130. package/runtime-hdpkc6qf.js +0 -220
  131. package/runtime-hdpkc6qf.js.map +0 -17
  132. /package/{compat/nodejs/registerBun.d.ts → native-event-worker-repro.worker.d.ts} +0 -0
package/index.js CHANGED
@@ -4,13 +4,12 @@ import {
4
4
  ASCIIFont,
5
5
  ASCIIFontRenderable,
6
6
  ArrowRenderable,
7
+ Audio,
7
8
  BloomEffect,
8
9
  Box,
9
- BoxRenderable,
10
10
  CRTRollingBarEffect,
11
11
  CloudsEffect,
12
12
  Code,
13
- CodeRenderable,
14
13
  DEUTERANOPIA_COMP_MATRIX,
15
14
  DEUTERANOPIA_SIM_MATRIX,
16
15
  DiffRenderable,
@@ -31,7 +30,6 @@ import {
31
30
  PROTANOPIA_COMP_MATRIX,
32
31
  PROTANOPIA_SIM_MATRIX,
33
32
  RainbowTextEffect,
34
- RootTextNodeRenderable,
35
33
  SEPIA_MATRIX,
36
34
  SOLARIZATION_MATRIX,
37
35
  SYNTHWAVE_MATRIX,
@@ -44,7 +42,6 @@ import {
44
42
  SliderRenderable,
45
43
  SlotRegistry,
46
44
  SlotRenderable,
47
- SyntaxStyle,
48
45
  TECHNICOLOR_MATRIX,
49
46
  TRITANOPIA_COMP_MATRIX,
50
47
  TRITANOPIA_SIM_MATRIX,
@@ -52,10 +49,6 @@ import {
52
49
  TabSelectRenderable,
53
50
  TabSelectRenderableEvents,
54
51
  Text,
55
- TextBufferRenderable,
56
- TextBufferView,
57
- TextNodeRenderable,
58
- TextRenderable,
59
52
  TextTableRenderable,
60
53
  TextareaRenderable,
61
54
  TimeToFirstDrawRenderable,
@@ -70,16 +63,16 @@ import {
70
63
  applyNoise,
71
64
  applySaturation,
72
65
  applyScanlines,
73
- convertThemeToStyles,
74
66
  createCoreSlotRegistry,
75
67
  createSlotRegistry,
76
68
  createTimeline,
69
+ defaultTextareaKeyBindings,
77
70
  engine,
78
- isTextNodeRenderable,
79
71
  registerCorePlugin,
80
72
  resolveCoreSlot,
73
+ setupAudio,
81
74
  vstyles
82
- } from "./index-yxe6e14n.js";
75
+ } from "./index-46f5e8m6.js";
83
76
  import {
84
77
  ASCIIFontSelectionHelper,
85
78
  ATTRIBUTE_BASE_BITS,
@@ -87,9 +80,13 @@ import {
87
80
  BaseRenderable,
88
81
  BorderCharArrays,
89
82
  BorderChars,
83
+ BoxRenderable,
90
84
  CliRenderEvents,
91
85
  CliRenderer,
86
+ CodeRenderable,
92
87
  ConsolePosition,
88
+ DEFAULT_BACKGROUND_RGB,
89
+ DEFAULT_FOREGROUND_RGB,
93
90
  DataPathsManager,
94
91
  DebugOverlayCorner,
95
92
  EditBuffer,
@@ -114,17 +111,24 @@ import {
114
111
  RenderableEvents,
115
112
  RendererControlState,
116
113
  RootRenderable,
114
+ RootTextNodeRenderable,
117
115
  Selection,
118
116
  StdinParser,
119
117
  StyledText,
118
+ SyntaxStyle,
120
119
  SystemClock,
121
120
  TargetChannel,
122
121
  TerminalConsole,
123
122
  TerminalPalette,
124
123
  TextAttributes,
125
124
  TextBuffer,
125
+ TextBufferRenderable,
126
+ TextBufferView,
127
+ TextNodeRenderable,
128
+ TextRenderable,
126
129
  TreeSitterClient,
127
130
  addDefaultParsers,
131
+ ansi256IndexToRgb,
128
132
  attributesWithLink,
129
133
  basenameToFiletype,
130
134
  bg,
@@ -150,9 +154,11 @@ import {
150
154
  brightWhite,
151
155
  brightYellow,
152
156
  buildKittyKeyboardFlags,
157
+ buildTerminalPaletteSignature,
153
158
  capture,
154
159
  clearEnvCache,
155
160
  convertGlobalToLocalSelection,
161
+ convertThemeToStyles,
156
162
  coordinateToCharacterIndex,
157
163
  createCliRenderer,
158
164
  createExtmarksController,
@@ -189,15 +195,18 @@ import {
189
195
  isEditBufferRenderable,
190
196
  isRenderable,
191
197
  isStyledText,
198
+ isTextNodeRenderable,
192
199
  isVNode,
193
200
  isValidBorderStyle,
194
201
  italic,
195
202
  link,
196
203
  magenta,
197
- main,
198
204
  maybeMakeRenderable,
199
205
  measureText,
200
206
  nonAlphanumericKeys,
207
+ normalizeColorValue,
208
+ normalizeIndexedColorIndex,
209
+ normalizeTerminalPalette,
201
210
  parseAlign,
202
211
  parseAlignItems,
203
212
  parseBorderStyle,
@@ -229,6 +238,7 @@ import {
229
238
  stringToStyledText,
230
239
  stripAnsiSequences,
231
240
  t,
241
+ terminalNamedSingleStrokeKeys,
232
242
  treeSitterToStyledText,
233
243
  treeSitterToTextChunks,
234
244
  underline,
@@ -236,23 +246,24 @@ import {
236
246
  white,
237
247
  wrapWithDelegates,
238
248
  yellow
239
- } from "./index-rhfjv9c1.js";
240
- import"./index-cbvybypy.js";
241
- import"./index-re3ntm60.js";
249
+ } from "./index-g9agybj3.js";
250
+ import"./index-5zwezmgj.js";
251
+ import"./index-k18nf2r7.js";
242
252
  export {
243
253
  yellow,
244
254
  wrapWithDelegates,
245
255
  white,
246
256
  vstyles,
247
257
  visualizeRenderableTree,
248
- main as updateAssets,
249
258
  underline,
250
259
  treeSitterToTextChunks,
251
260
  treeSitterToStyledText,
261
+ terminalNamedSingleStrokeKeys,
252
262
  t,
253
263
  stripAnsiSequences,
254
264
  stringToStyledText,
255
265
  strikethrough,
266
+ setupAudio,
256
267
  setRenderLibPath,
257
268
  rgbToHex,
258
269
  reverse,
@@ -282,6 +293,9 @@ export {
282
293
  parseBorderStyle,
283
294
  parseAlignItems,
284
295
  parseAlign,
296
+ normalizeTerminalPalette,
297
+ normalizeIndexedColorIndex,
298
+ normalizeColorValue,
285
299
  nonAlphanumericKeys,
286
300
  measureText,
287
301
  maybeMakeRenderable,
@@ -320,6 +334,7 @@ export {
320
334
  dim,
321
335
  detectLinks,
322
336
  delegate,
337
+ defaultTextareaKeyBindings,
323
338
  decodePasteBytes,
324
339
  cyan,
325
340
  createTimeline,
@@ -334,6 +349,7 @@ export {
334
349
  convertGlobalToLocalSelection,
335
350
  clearEnvCache,
336
351
  capture,
352
+ buildTerminalPaletteSignature,
337
353
  buildKittyKeyboardFlags,
338
354
  brightYellow,
339
355
  brightWhite,
@@ -367,6 +383,7 @@ export {
367
383
  applyChromaticAberration,
368
384
  applyBrightness,
369
385
  applyAsciiArt,
386
+ ansi256IndexToRgb,
370
387
  addDefaultParsers,
371
388
  exports_src as Yoga,
372
389
  VignetteEffect,
@@ -454,6 +471,8 @@ export {
454
471
  DataPathsManager,
455
472
  DEUTERANOPIA_SIM_MATRIX,
456
473
  DEUTERANOPIA_COMP_MATRIX,
474
+ DEFAULT_FOREGROUND_RGB,
475
+ DEFAULT_BACKGROUND_RGB,
457
476
  ConsolePosition,
458
477
  CodeRenderable,
459
478
  Code,
@@ -467,6 +486,7 @@ export {
467
486
  BorderCharArrays,
468
487
  BloomEffect,
469
488
  BaseRenderable,
489
+ Audio,
470
490
  ArrowRenderable,
471
491
  ATTRIBUTE_BASE_MASK,
472
492
  ATTRIBUTE_BASE_BITS,
@@ -476,5 +496,5 @@ export {
476
496
  ACHROMATOPSIA_MATRIX
477
497
  };
478
498
 
479
- //# debugId=AE4840697A2ED81E64756E2164756E21
499
+ //# debugId=5776EF784D8C968A64756E2164756E21
480
500
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "AE4840697A2ED81E64756E2164756E21",
7
+ "debugId": "5776EF784D8C968A64756E2164756E21",
8
8
  "names": []
9
9
  }
package/lib/RGBA.d.ts CHANGED
@@ -1,11 +1,24 @@
1
+ export type RGBTriplet = readonly [number, number, number];
2
+ export type ColorIntent = "rgb" | "indexed" | "default";
3
+ export type ColorInput = string | RGBA;
4
+ export declare const DEFAULT_FOREGROUND_RGB: RGBTriplet;
5
+ export declare const DEFAULT_BACKGROUND_RGB: RGBTriplet;
6
+ export interface NormalizedColorValue {
7
+ rgba: RGBA;
8
+ }
9
+ export declare function normalizeIndexedColorIndex(index: number): number;
10
+ export declare function ansi256IndexToRgb(index: number): RGBTriplet;
1
11
  export declare class RGBA {
2
- static readonly BYTE_LENGTH = 16;
3
- buffer: Float32Array;
4
- constructor(buffer: Float32Array);
5
- static fromArray(array: Float32Array): RGBA;
12
+ buffer: Uint16Array;
13
+ constructor(buffer: Uint16Array);
14
+ static fromArray(array: Uint16Array): RGBA;
6
15
  static fromValues(r: number, g: number, b: number, a?: number): RGBA;
16
+ static clone(rgba: RGBA): RGBA;
7
17
  static fromInts(r: number, g: number, b: number, a?: number): RGBA;
8
18
  static fromHex(hex: string): RGBA;
19
+ static fromIndex(index: number, snapshot?: ColorInput): RGBA;
20
+ static defaultForeground(snapshot?: ColorInput): RGBA;
21
+ static defaultBackground(snapshot?: ColorInput): RGBA;
9
22
  toInts(): [number, number, number, number];
10
23
  get r(): number;
11
24
  set r(value: number);
@@ -15,11 +28,14 @@ export declare class RGBA {
15
28
  set b(value: number);
16
29
  get a(): number;
17
30
  set a(value: number);
18
- map<R>(fn: (value: number) => R): R[];
31
+ get meta(): number;
32
+ get intent(): ColorIntent;
33
+ get slot(): number;
34
+ map<R>(fn: (value: number) => R): [R, R, R, R];
19
35
  toString(): string;
20
36
  equals(other?: RGBA): boolean;
21
37
  }
22
- export type ColorInput = string | RGBA;
38
+ export declare function normalizeColorValue(value: ColorInput | null | undefined): NormalizedColorValue | null;
23
39
  export declare function hexToRgb(hex: string): RGBA;
24
40
  export declare function rgbToHex(rgb: RGBA): string;
25
41
  export declare function hsvToRgb(h: number, s: number, v: number): RGBA;
@@ -1,4 +1,4 @@
1
- import type { Pointer } from "../compat/ffi.js";
1
+ import type { Pointer } from "../platform/ffi.js";
2
2
  import type { RenderLib } from "../zig.js";
3
3
  export declare enum ClipboardTarget {
4
4
  Clipboard = 0,
@@ -1,16 +1,24 @@
1
- export interface KeyBinding<Action extends string = string> {
1
+ export interface KeyBindingLike {
2
2
  name: string;
3
3
  ctrl?: boolean;
4
4
  shift?: boolean;
5
5
  meta?: boolean;
6
6
  super?: boolean;
7
+ }
8
+ export interface KeyBinding<Action extends string = string> extends KeyBindingLike {
7
9
  action: Action;
8
10
  }
11
+ export interface KeyBindingLookup extends KeyBindingLike {
12
+ baseCode?: number;
13
+ }
9
14
  export type KeyAliasMap = Record<string, string>;
10
15
  export declare const defaultKeyAliases: KeyAliasMap;
11
16
  export declare function mergeKeyAliases(defaults: KeyAliasMap, custom: KeyAliasMap): KeyAliasMap;
12
17
  export declare function mergeKeyBindings<Action extends string>(defaults: KeyBinding<Action>[], custom: KeyBinding<Action>[]): KeyBinding<Action>[];
13
- export declare function getKeyBindingKey<Action extends string>(binding: KeyBinding<Action>): string;
18
+ export declare function getKeyBindingKey(binding: KeyBindingLike): string;
19
+ export declare function getKeyBindingKeys(binding: KeyBindingLookup): string[];
20
+ export declare function getKeyBindingAction<Action extends string>(map: Map<string, Action>, binding: KeyBindingLookup): Action | undefined;
21
+ export declare function matchesKeyBinding(binding: KeyBindingLookup, match: KeyBindingLike): boolean;
14
22
  export declare function buildKeyBindingsMap<Action extends string>(bindings: KeyBinding<Action>[], aliasMap?: KeyAliasMap): Map<string, Action>;
15
23
  /**
16
24
  * Converts a key binding to a human-readable string representation
@@ -1,7 +1,7 @@
1
1
  import type { ViewportBounds } from "../types.js";
2
2
  interface ViewportObject {
3
- x: number;
4
- y: number;
3
+ screenX: number;
4
+ screenY: number;
5
5
  width: number;
6
6
  height: number;
7
7
  zIndex: number;
@@ -10,14 +10,14 @@ interface ViewportObject {
10
10
  * Returns objects that overlap with the viewport bounds.
11
11
  *
12
12
  * @param viewport - The viewport bounds to check against
13
- * @param objects - Array of objects MUST be sorted by position (y for column, x for row direction)
13
+ * @param objects - Array of objects MUST be sorted by screen position (screenY for column, screenX for row direction)
14
14
  * @param direction - Primary scroll direction: "column" (vertical) or "row" (horizontal)
15
15
  * @param padding - Extra padding around viewport to include nearby objects
16
16
  * @param minTriggerSize - Minimum array size to use binary search optimization
17
17
  * @returns Array of visible objects sorted by zIndex
18
18
  *
19
19
  * @remarks
20
- * Objects must be pre-sorted by their start position (y for column direction, x for row direction).
20
+ * Objects must be pre-sorted by their start screen position (screenY for column direction, screenX for row direction).
21
21
  * Unsorted input will produce incorrect results.
22
22
  */
23
23
  export declare function getObjectsInViewport<T extends ViewportObject>(viewport: ViewportBounds, objects: T[], direction?: "row" | "column", padding?: number, minTriggerSize?: number): T[];
@@ -1,2 +1,3 @@
1
1
  import type { ParsedKey } from "./parse.keypress.js";
2
+ export declare const kittyNamedSingleStrokeKeys: string[];
2
3
  export declare function parseKittyKeyboard(sequence: string): ParsedKey | null;
@@ -1,5 +1,6 @@
1
1
  import { Buffer } from "node:buffer";
2
2
  export declare const nonAlphanumericKeys: string[];
3
+ export declare const terminalNamedSingleStrokeKeys: string[];
3
4
  export type KeyEventType = "press" | "repeat" | "release";
4
5
  export interface ParsedKey {
5
6
  name: string;
@@ -0,0 +1,8 @@
1
+ export type RenderGeometryScreenMode = "alternate-screen" | "main-screen" | "split-footer";
2
+ export interface RenderGeometry {
3
+ effectiveFooterHeight: number;
4
+ renderOffset: number;
5
+ renderWidth: number;
6
+ renderHeight: number;
7
+ }
8
+ export declare function calculateRenderGeometry(screenMode: RenderGeometryScreenMode, terminalWidth: number, terminalHeight: number, footerHeight: number): RenderGeometry;
@@ -3,7 +3,7 @@ import { type ParsedKey } from "./parse.keypress.js";
3
3
  import { type RawMouseEvent } from "./parse.mouse.js";
4
4
  import type { PasteMetadata } from "./paste.js";
5
5
  export { SystemClock, type Clock, type TimerHandle } from "./clock.js";
6
- export type StdinResponseProtocol = "csi" | "osc" | "dcs" | "apc" | "unknown";
6
+ export type StdinResponseProtocol = "csi" | "cpr" | "osc" | "dcs" | "apc" | "unknown";
7
7
  export type StdinEvent = {
8
8
  type: "key";
9
9
  raw: string;
@@ -27,6 +27,7 @@ export interface StdinParserProtocolContext {
27
27
  privateCapabilityRepliesActive: boolean;
28
28
  pixelResolutionQueryActive: boolean;
29
29
  explicitWidthCprActive: boolean;
30
+ startupCursorCprActive: boolean;
30
31
  }
31
32
  export interface StdinParserOptions {
32
33
  timeoutMs?: number;
@@ -60,6 +61,8 @@ export declare class StdinParser {
60
61
  constructor(options?: StdinParserOptions);
61
62
  get bufferCapacity(): number;
62
63
  updateProtocolContext(patch: Partial<StdinParserProtocolContext>): void;
64
+ private getAbortableStartupCursorCprState;
65
+ abortPendingStartupCursorCpr(): void;
63
66
  push(data: Uint8Array): void;
64
67
  read(): StdinEvent | null;
65
68
  drain(onEvent: (event: StdinEvent) => void): void;
@@ -9,6 +9,8 @@
9
9
  * - Kitty Keyboard Query: ESC[?Nu where N is 0,1,2,etc
10
10
  * - DA1 (Device Attributes): ESC[?...c
11
11
  * - Pixel Resolution: ESC[4;height;widtht
12
+ * - OSC 99 notification capability query response
13
+ * - iTerm2 OSC 1337 feature-reporting response
12
14
  */
13
15
  /**
14
16
  * Check if a sequence is a terminal capability response.
@@ -1,3 +1,4 @@
1
+ import { RGBA } from "./RGBA.js";
1
2
  import { type Clock } from "./clock.js";
2
3
  type Hex = string | null;
3
4
  export type WriteFunction = (data: string | Buffer) => boolean;
@@ -22,21 +23,33 @@ export interface TerminalPaletteDetector {
22
23
  detectOSCSupport(timeoutMs?: number): Promise<boolean>;
23
24
  cleanup(): void;
24
25
  }
26
+ export interface NormalizedTerminalPalette {
27
+ palette: RGBA[];
28
+ defaultForeground: RGBA;
29
+ defaultBackground: RGBA;
30
+ }
25
31
  export type OscSubscriptionSource = {
26
32
  subscribeOsc(handler: (sequence: string) => void): () => void;
27
33
  };
34
+ export interface TerminalPaletteOptions {
35
+ stdin: NodeJS.ReadStream;
36
+ stdout: NodeJS.WriteStream;
37
+ writeFn?: WriteFunction;
38
+ isLegacyTmux?: boolean;
39
+ isTmux?: boolean;
40
+ oscSource?: OscSubscriptionSource;
41
+ clock?: Clock;
42
+ }
28
43
  export declare class TerminalPalette implements TerminalPaletteDetector {
29
44
  private stdin;
30
45
  private stdout;
31
46
  private writeFn;
32
47
  private activeQuerySessions;
33
48
  private inLegacyTmux;
49
+ private inTmux;
34
50
  private oscSource?;
35
51
  private readonly clock;
36
- constructor(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, writeFn?: WriteFunction, isLegacyTmux?: boolean, oscSource?: OscSubscriptionSource, clock?: Clock);
37
- /**
38
- * Write an OSC sequence, wrapping for tmux if needed
39
- */
52
+ constructor(options: TerminalPaletteOptions);
40
53
  private writeOsc;
41
54
  cleanup(): void;
42
55
  private subscribeInput;
@@ -46,5 +59,7 @@ export declare class TerminalPalette implements TerminalPaletteDetector {
46
59
  private querySpecialColors;
47
60
  detect(options?: GetPaletteOptions): Promise<TerminalColors>;
48
61
  }
49
- export declare function createTerminalPalette(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, writeFn?: WriteFunction, isLegacyTmux?: boolean, oscSource?: OscSubscriptionSource, clock?: Clock): TerminalPaletteDetector;
62
+ export declare function createTerminalPalette(options: TerminalPaletteOptions): TerminalPaletteDetector;
63
+ export declare function normalizeTerminalPalette(colors?: TerminalColors | null): NormalizedTerminalPalette;
64
+ export declare function buildTerminalPaletteSignature(colors?: TerminalColors | null): string;
50
65
  export {};
@@ -8,4 +8,5 @@ export interface UpdateOptions {
8
8
  outputPath: string;
9
9
  }
10
10
  declare function main(options?: Partial<UpdateOptions>): Promise<void>;
11
+ export declare function runUpdateAssetsCli(): Promise<void>;
11
12
  export { main as updateAssets };
@@ -19,9 +19,11 @@ export declare class TreeSitterClient extends EventEmitter<TreeSitterClientEvent
19
19
  private emitError;
20
20
  private emitWarning;
21
21
  private startWorker;
22
+ private resolveWorkerPath;
22
23
  private stopWorker;
23
24
  private handleReset;
24
25
  initialize(): Promise<void>;
26
+ private initializeClient;
25
27
  private registerDefaultParsers;
26
28
  private resolvePath;
27
29
  addFiletypeParser(filetypeParser: FiletypeParserOptions): void;
@@ -1,2 +1,2 @@
1
1
  import type { FiletypeParserOptions } from "./types.js";
2
- export declare function getParsers(): FiletypeParserOptions[];
2
+ export declare function getParsers(): Promise<FiletypeParserOptions[]>;
@@ -3,6 +3,4 @@ export * from "./client.js";
3
3
  export * from "../tree-sitter-styled-text.js";
4
4
  export * from "./types.js";
5
5
  export * from "./resolve-ft.js";
6
- export type { UpdateOptions } from "./assets/update.js";
7
- export { updateAssets } from "./assets/update.js";
8
6
  export declare function getTreeSitterClient(): TreeSitterClient;
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export { runUpdateAssetsCli, updateAssets } from "./assets/update.js";
3
+ export type { UpdateOptions } from "./assets/update.js";