@opentui/core 0.1.86 → 0.1.88

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 (107) hide show
  1. package/3d/ThreeRenderable.d.ts +4 -4
  2. package/3d/WGPURenderer.d.ts +4 -4
  3. package/3d/animation/ExplodingSpriteEffect.d.ts +2 -2
  4. package/3d/animation/PhysicsExplodingSpriteEffect.d.ts +3 -3
  5. package/3d/animation/SpriteAnimator.d.ts +1 -1
  6. package/3d/animation/SpriteParticleGenerator.d.ts +1 -1
  7. package/3d/canvas.d.ts +2 -2
  8. package/3d/index.d.ts +12 -12
  9. package/3d/physics/PlanckPhysicsAdapter.d.ts +1 -1
  10. package/3d/physics/RapierPhysicsAdapter.d.ts +1 -1
  11. package/3d.d.ts +1 -1
  12. package/3d.js +4 -3
  13. package/3d.js.map +15 -15
  14. package/Renderable.d.ts +7 -7
  15. package/animation/Timeline.d.ts +1 -1
  16. package/buffer.d.ts +6 -6
  17. package/console.d.ts +7 -4
  18. package/edit-buffer.d.ts +4 -4
  19. package/editor-view.d.ts +4 -4
  20. package/index-e4hzc2j2.js +113 -0
  21. package/index-e4hzc2j2.js.map +10 -0
  22. package/{index-4sjb8n0n.js → index-nkrr8a4c.js} +2476 -1743
  23. package/index-nkrr8a4c.js.map +64 -0
  24. package/index-nyw5p3ep.js +12619 -0
  25. package/index-nyw5p3ep.js.map +43 -0
  26. package/index.d.ts +20 -17
  27. package/index.js +83 -11490
  28. package/index.js.map +3 -34
  29. package/lib/KeyHandler.d.ts +8 -8
  30. package/lib/ascii.font.d.ts +2 -2
  31. package/lib/border.d.ts +1 -1
  32. package/lib/clipboard.d.ts +1 -1
  33. package/lib/clock.d.ts +15 -0
  34. package/lib/extmarks-history.d.ts +1 -1
  35. package/lib/extmarks.d.ts +2 -2
  36. package/lib/hast-styled-text.d.ts +3 -3
  37. package/lib/index.d.ts +21 -19
  38. package/lib/objects-in-viewport.d.ts +1 -1
  39. package/lib/parse.keypress-kitty.d.ts +1 -1
  40. package/lib/parse.mouse.d.ts +2 -2
  41. package/lib/paste.d.ts +7 -0
  42. package/lib/renderable.validations.d.ts +2 -2
  43. package/lib/selection.d.ts +2 -2
  44. package/lib/stdin-parser.d.ts +76 -0
  45. package/lib/styled-text.d.ts +2 -2
  46. package/lib/terminal-palette.d.ts +11 -4
  47. package/lib/tree-sitter/client.d.ts +1 -1
  48. package/lib/tree-sitter/default-parsers.d.ts +1 -1
  49. package/lib/tree-sitter/download-utils.d.ts +1 -1
  50. package/lib/tree-sitter/index.d.ts +7 -7
  51. package/lib/tree-sitter-styled-text.d.ts +5 -5
  52. package/package.json +17 -7
  53. package/parser.worker.js +7 -7
  54. package/parser.worker.js.map +4 -4
  55. package/plugins/core-slot.d.ts +72 -0
  56. package/plugins/registry.d.ts +38 -0
  57. package/plugins/types.d.ts +34 -0
  58. package/post/filters.d.ts +1 -1
  59. package/renderables/ASCIIFont.d.ts +6 -6
  60. package/renderables/Box.d.ts +5 -5
  61. package/renderables/Code.d.ts +10 -8
  62. package/renderables/Diff.d.ts +13 -6
  63. package/renderables/EditBufferRenderable.d.ts +8 -8
  64. package/renderables/FrameBuffer.d.ts +3 -3
  65. package/renderables/Input.d.ts +3 -3
  66. package/renderables/LineNumberRenderable.d.ts +4 -4
  67. package/renderables/Markdown.d.ts +9 -9
  68. package/renderables/ScrollBar.d.ts +6 -6
  69. package/renderables/ScrollBox.d.ts +9 -8
  70. package/renderables/Select.d.ts +7 -7
  71. package/renderables/Slider.d.ts +1 -1
  72. package/renderables/TabSelect.d.ts +6 -6
  73. package/renderables/Text.d.ts +7 -7
  74. package/renderables/TextBufferRenderable.d.ts +9 -9
  75. package/renderables/TextNode.d.ts +6 -6
  76. package/renderables/Textarea.d.ts +7 -7
  77. package/renderables/TimeToFirstDraw.d.ts +24 -0
  78. package/renderables/__tests__/renderable-test-utils.d.ts +8 -3
  79. package/renderables/composition/VRenderable.d.ts +3 -3
  80. package/renderables/composition/constructs.d.ts +14 -14
  81. package/renderables/composition/vnode.d.ts +2 -2
  82. package/renderables/index.d.ts +22 -21
  83. package/renderer.d.ts +26 -17
  84. package/runtime-plugin-support.d.ts +3 -0
  85. package/runtime-plugin-support.js +29 -0
  86. package/runtime-plugin-support.js.map +10 -0
  87. package/runtime-plugin.d.ts +11 -0
  88. package/runtime-plugin.js +16 -0
  89. package/runtime-plugin.js.map +9 -0
  90. package/syntax-style.d.ts +2 -2
  91. package/testing/manual-clock.d.ts +16 -0
  92. package/testing/mock-keys.d.ts +2 -1
  93. package/testing/mock-mouse.d.ts +1 -1
  94. package/testing/mock-tree-sitter-client.d.ts +2 -2
  95. package/testing/test-recorder.d.ts +1 -1
  96. package/testing/test-renderer.d.ts +4 -4
  97. package/testing.d.ts +6 -6
  98. package/testing.js +12 -7
  99. package/testing.js.map +7 -7
  100. package/text-buffer-view.d.ts +4 -4
  101. package/text-buffer.d.ts +5 -5
  102. package/types.d.ts +13 -8
  103. package/utils.d.ts +1 -1
  104. package/zig-structs.d.ts +7 -7
  105. package/zig.d.ts +6 -6
  106. package/index-4sjb8n0n.js.map +0 -62
  107. package/lib/stdin-buffer.d.ts +0 -44
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from "events";
2
- import { type KeyEventType, type ParsedKey } from "./parse.keypress";
2
+ import { type KeyEventType, type ParsedKey } from "./parse.keypress.js";
3
+ import type { PasteMetadata } from "./paste.js";
3
4
  export declare class KeyEvent implements ParsedKey {
4
5
  name: string;
5
6
  ctrl: boolean;
@@ -27,10 +28,12 @@ export declare class KeyEvent implements ParsedKey {
27
28
  stopPropagation(): void;
28
29
  }
29
30
  export declare class PasteEvent {
30
- text: string;
31
+ type: "paste";
32
+ bytes: Uint8Array;
33
+ metadata?: PasteMetadata;
31
34
  private _defaultPrevented;
32
35
  private _propagationStopped;
33
- constructor(text: string);
36
+ constructor(bytes: Uint8Array, metadata?: PasteMetadata);
34
37
  get defaultPrevented(): boolean;
35
38
  get propagationStopped(): boolean;
36
39
  preventDefault(): void;
@@ -42,10 +45,8 @@ export type KeyHandlerEventMap = {
42
45
  paste: [PasteEvent];
43
46
  };
44
47
  export declare class KeyHandler extends EventEmitter<KeyHandlerEventMap> {
45
- protected useKittyKeyboard: boolean;
46
- constructor(useKittyKeyboard?: boolean);
47
- processInput(data: string): boolean;
48
- processPaste(data: string): void;
48
+ processParsedKey(parsedKey: ParsedKey): boolean;
49
+ processPaste(bytes: Uint8Array, metadata?: PasteMetadata): void;
49
50
  }
50
51
  /**
51
52
  * This class is used internally by the renderer to ensure global handlers
@@ -53,7 +54,6 @@ export declare class KeyHandler extends EventEmitter<KeyHandlerEventMap> {
53
54
  */
54
55
  export declare class InternalKeyHandler extends KeyHandler {
55
56
  private renderableHandlers;
56
- constructor(useKittyKeyboard?: boolean);
57
57
  emit<K extends keyof KeyHandlerEventMap>(event: K, ...args: KeyHandlerEventMap[K]): boolean;
58
58
  private emitWithPriority;
59
59
  onInternal<K extends keyof KeyHandlerEventMap>(event: K, handler: (...args: KeyHandlerEventMap[K]) => void): void;
@@ -1,5 +1,5 @@
1
- import { OptimizedBuffer } from "../buffer";
2
- import { type ColorInput } from "./RGBA";
1
+ import { OptimizedBuffer } from "../buffer.js";
2
+ import { type ColorInput } from "./RGBA.js";
3
3
  export type ASCIIFontName = "tiny" | "block" | "shade" | "slick" | "huge" | "grid" | "pallet";
4
4
  export declare const fonts: {
5
5
  tiny: {
package/lib/border.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ColorInput } from "./RGBA";
1
+ import type { ColorInput } from "./RGBA.js";
2
2
  export interface BorderCharacters {
3
3
  topLeft: string;
4
4
  topRight: string;
@@ -1,5 +1,5 @@
1
1
  import type { Pointer } from "bun:ffi";
2
- import type { RenderLib } from "../zig";
2
+ import type { RenderLib } from "../zig.js";
3
3
  export declare enum ClipboardTarget {
4
4
  Clipboard = 0,
5
5
  Primary = 1,
package/lib/clock.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export type TimerHandle = ReturnType<typeof globalThis.setTimeout> | number;
2
+ export interface Clock {
3
+ now(): number;
4
+ setTimeout(fn: () => void, delayMs: number): TimerHandle;
5
+ clearTimeout(handle: TimerHandle): void;
6
+ setInterval(fn: () => void, delayMs: number): TimerHandle;
7
+ clearInterval(handle: TimerHandle): void;
8
+ }
9
+ export declare class SystemClock implements Clock {
10
+ now(): number;
11
+ setTimeout(fn: () => void, delayMs: number): TimerHandle;
12
+ clearTimeout(handle: TimerHandle): void;
13
+ setInterval(fn: () => void, delayMs: number): TimerHandle;
14
+ clearInterval(handle: TimerHandle): void;
15
+ }
@@ -1,4 +1,4 @@
1
- import type { Extmark } from "./extmarks";
1
+ import type { Extmark } from "./extmarks.js";
2
2
  export interface ExtmarksSnapshot {
3
3
  extmarks: Map<number, Extmark>;
4
4
  nextId: number;
package/lib/extmarks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { EditBuffer } from "../edit-buffer";
2
- import type { EditorView } from "../editor-view";
1
+ import type { EditBuffer } from "../edit-buffer.js";
2
+ import type { EditorView } from "../editor-view.js";
3
3
  export interface Extmark {
4
4
  id: number;
5
5
  start: number;
@@ -1,5 +1,5 @@
1
- import { StyledText } from "./styled-text";
2
- import { SyntaxStyle } from "../syntax-style";
1
+ import { StyledText } from "./styled-text.js";
2
+ import { SyntaxStyle } from "../syntax-style.js";
3
3
  export interface HASTText {
4
4
  type: "text";
5
5
  value: string;
@@ -13,5 +13,5 @@ export interface HASTElement {
13
13
  children: HASTNode[];
14
14
  }
15
15
  export type HASTNode = HASTText | HASTElement;
16
- export type { StyleDefinition } from "../syntax-style";
16
+ export type { StyleDefinition } from "../syntax-style.js";
17
17
  export declare function hastToStyledText(hast: HASTNode, syntaxStyle: SyntaxStyle): StyledText;
package/lib/index.d.ts CHANGED
@@ -1,19 +1,21 @@
1
- export * from "./border";
2
- export * from "./KeyHandler";
3
- export * from "./ascii.font";
4
- export * from "./hast-styled-text";
5
- export * from "./RGBA";
6
- export * from "./parse.keypress";
7
- export * from "./scroll-acceleration";
8
- export * from "./stdin-buffer";
9
- export * from "./styled-text";
10
- export * from "./yoga.options";
11
- export * from "./parse.mouse";
12
- export * from "./selection";
13
- export * from "./env";
14
- export * from "./tree-sitter-styled-text";
15
- export * from "./tree-sitter";
16
- export * from "./data-paths";
17
- export * from "./extmarks";
18
- export * from "./terminal-palette";
19
- export { detectLinks } from "./detect-links";
1
+ export * from "./border.js";
2
+ export * from "./KeyHandler.js";
3
+ export * from "./ascii.font.js";
4
+ export * from "./hast-styled-text.js";
5
+ export * from "./RGBA.js";
6
+ export * from "./clock.js";
7
+ export * from "./parse.keypress.js";
8
+ export * from "./scroll-acceleration.js";
9
+ export * from "./styled-text.js";
10
+ export * from "./yoga.options.js";
11
+ export * from "./parse.mouse.js";
12
+ export * from "./selection.js";
13
+ export * from "./env.js";
14
+ export * from "./stdin-parser.js";
15
+ export * from "./tree-sitter-styled-text.js";
16
+ export * from "./tree-sitter/index.js";
17
+ export * from "./data-paths.js";
18
+ export * from "./extmarks.js";
19
+ export * from "./terminal-palette.js";
20
+ export * from "./paste.js";
21
+ export { detectLinks } from "./detect-links.js";
@@ -1,4 +1,4 @@
1
- import type { ViewportBounds } from "../types";
1
+ import type { ViewportBounds } from "../types.js";
2
2
  interface ViewportObject {
3
3
  x: number;
4
4
  y: number;
@@ -1,2 +1,2 @@
1
- import type { ParsedKey } from "./parse.keypress";
1
+ import type { ParsedKey } from "./parse.keypress.js";
2
2
  export declare function parseKittyKeyboard(sequence: string): ParsedKey | null;
@@ -20,8 +20,8 @@ export declare class MouseParser {
20
20
  private static readonly SCROLL_DIRECTIONS;
21
21
  reset(): void;
22
22
  private decodeInput;
23
- parseMouseEvent(data: Buffer): RawMouseEvent | null;
24
- parseAllMouseEvents(data: Buffer): RawMouseEvent[];
23
+ parseMouseEvent(data: Buffer | Uint8Array): RawMouseEvent | null;
24
+ parseAllMouseEvents(data: Buffer | Uint8Array): RawMouseEvent[];
25
25
  private parseMouseSequenceAt;
26
26
  private parseSgrSequence;
27
27
  private parseBasicSequence;
package/lib/paste.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export type PasteKind = "text" | "binary" | "unknown";
2
+ export interface PasteMetadata {
3
+ mimeType?: string;
4
+ kind?: PasteKind;
5
+ }
6
+ export declare function decodePasteBytes(bytes: Uint8Array): string;
7
+ export declare function stripAnsiSequences(text: string): string;
@@ -1,5 +1,5 @@
1
- import type { RenderableOptions, Renderable } from "../Renderable";
2
- import type { PositionTypeString, OverflowString } from "./yoga.options";
1
+ import type { RenderableOptions, Renderable } from "../Renderable.js";
2
+ import type { PositionTypeString, OverflowString } from "./yoga.options.js";
3
3
  export declare function validateOptions(id: string, options: RenderableOptions<Renderable>): void;
4
4
  export declare function isValidPercentage(value: any): value is `${number}%`;
5
5
  export declare function isMarginType(value: any): value is number | "auto" | `${number}%`;
@@ -1,5 +1,5 @@
1
- import { Renderable, type ViewportBounds } from "..";
2
- import { fonts } from "./ascii.font";
1
+ import { Renderable, type ViewportBounds } from "../index.js";
2
+ import { fonts } from "./ascii.font.js";
3
3
  export declare class Selection {
4
4
  private _anchor;
5
5
  private _focus;
@@ -0,0 +1,76 @@
1
+ import { type Clock } from "./clock";
2
+ import { type ParsedKey } from "./parse.keypress";
3
+ import { type RawMouseEvent } from "./parse.mouse";
4
+ import type { PasteMetadata } from "./paste";
5
+ export { SystemClock, type Clock, type TimerHandle } from "./clock";
6
+ export type StdinResponseProtocol = "csi" | "osc" | "dcs" | "apc" | "unknown";
7
+ export type StdinEvent = {
8
+ type: "key";
9
+ raw: string;
10
+ key: ParsedKey;
11
+ } | {
12
+ type: "mouse";
13
+ raw: string;
14
+ encoding: "sgr" | "x10";
15
+ event: RawMouseEvent;
16
+ } | {
17
+ type: "paste";
18
+ bytes: Uint8Array;
19
+ metadata?: PasteMetadata;
20
+ } | {
21
+ type: "response";
22
+ protocol: StdinResponseProtocol;
23
+ sequence: string;
24
+ };
25
+ export interface StdinParserOptions {
26
+ timeoutMs?: number;
27
+ maxPendingBytes?: number;
28
+ armTimeouts?: boolean;
29
+ onTimeoutFlush?: () => void;
30
+ useKittyKeyboard?: boolean;
31
+ clock?: Clock;
32
+ }
33
+ export declare class StdinParser {
34
+ private readonly pending;
35
+ private readonly events;
36
+ private readonly timeoutMs;
37
+ private readonly maxPendingBytes;
38
+ private readonly armTimeouts;
39
+ private readonly onTimeoutFlush;
40
+ private readonly useKittyKeyboard;
41
+ private readonly mouseParser;
42
+ private readonly clock;
43
+ private timeoutId;
44
+ private destroyed;
45
+ private pendingSinceMs;
46
+ private forceFlush;
47
+ private justFlushedEsc;
48
+ private state;
49
+ private cursor;
50
+ private unitStart;
51
+ private paste;
52
+ constructor(options?: StdinParserOptions);
53
+ get bufferCapacity(): number;
54
+ push(data: Uint8Array): void;
55
+ read(): StdinEvent | null;
56
+ drain(onEvent: (event: StdinEvent) => void): void;
57
+ flushTimeout(nowMsValue?: number): void;
58
+ reset(): void;
59
+ resetMouseState(): void;
60
+ destroy(): void;
61
+ private ensureAlive;
62
+ private scanPending;
63
+ private emitKeyOrResponse;
64
+ private emitMouse;
65
+ private emitLegacyHighByte;
66
+ private emitOpaqueResponse;
67
+ private consumePrefix;
68
+ private takePendingBytes;
69
+ private flushPendingOverflow;
70
+ private markPending;
71
+ private consumePasteBytes;
72
+ private pushPasteBytes;
73
+ private reconcileTimeoutState;
74
+ private clearTimeout;
75
+ private resetState;
76
+ }
@@ -1,5 +1,5 @@
1
- import type { TextChunk } from "../text-buffer";
2
- import { type ColorInput } from "./RGBA";
1
+ import type { TextChunk } from "../text-buffer.js";
2
+ import { type ColorInput } from "./RGBA.js";
3
3
  declare const BrandedStyledText: unique symbol;
4
4
  export type Color = ColorInput;
5
5
  export interface StyleAttrs {
@@ -1,3 +1,4 @@
1
+ import { type Clock } from "./clock";
1
2
  type Hex = string | null;
2
3
  export type WriteFunction = (data: string | Buffer) => boolean;
3
4
  export interface TerminalColors {
@@ -21,23 +22,29 @@ export interface TerminalPaletteDetector {
21
22
  detectOSCSupport(timeoutMs?: number): Promise<boolean>;
22
23
  cleanup(): void;
23
24
  }
25
+ export type OscSubscriptionSource = {
26
+ subscribeOsc(handler: (sequence: string) => void): () => void;
27
+ };
24
28
  export declare class TerminalPalette implements TerminalPaletteDetector {
25
29
  private stdin;
26
30
  private stdout;
27
31
  private writeFn;
28
- private activeListeners;
29
- private activeTimers;
32
+ private activeQuerySessions;
30
33
  private inLegacyTmux;
31
- constructor(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, writeFn?: WriteFunction, isLegacyTmux?: boolean);
34
+ private oscSource?;
35
+ private readonly clock;
36
+ constructor(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, writeFn?: WriteFunction, isLegacyTmux?: boolean, oscSource?: OscSubscriptionSource, clock?: Clock);
32
37
  /**
33
38
  * Write an OSC sequence, wrapping for tmux if needed
34
39
  */
35
40
  private writeOsc;
36
41
  cleanup(): void;
42
+ private subscribeInput;
43
+ private createQuerySession;
37
44
  detectOSCSupport(timeoutMs?: number): Promise<boolean>;
38
45
  private queryPalette;
39
46
  private querySpecialColors;
40
47
  detect(options?: GetPaletteOptions): Promise<TerminalColors>;
41
48
  }
42
- export declare function createTerminalPalette(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, writeFn?: WriteFunction, isLegacyTmux?: boolean): TerminalPaletteDetector;
49
+ export declare function createTerminalPalette(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, writeFn?: WriteFunction, isLegacyTmux?: boolean, oscSource?: OscSubscriptionSource, clock?: Clock): TerminalPaletteDetector;
43
50
  export {};
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from "events";
2
- import type { TreeSitterClientOptions, TreeSitterClientEvents, BufferState, FiletypeParserOptions, Edit, PerformanceStats, SimpleHighlight } from "./types";
2
+ import type { TreeSitterClientOptions, TreeSitterClientEvents, BufferState, FiletypeParserOptions, Edit, PerformanceStats, SimpleHighlight } from "./types.js";
3
3
  declare global {
4
4
  const OTUI_TREE_SITTER_WORKER_PATH: string;
5
5
  }
@@ -1,2 +1,2 @@
1
- import type { FiletypeParserOptions } from "./types";
1
+ import type { FiletypeParserOptions } from "./types.js";
2
2
  export declare function getParsers(): FiletypeParserOptions[];
@@ -1,5 +1,5 @@
1
1
  export interface DownloadResult {
2
- content?: ArrayBuffer;
2
+ content?: Buffer;
3
3
  filePath?: string;
4
4
  error?: string;
5
5
  }
@@ -1,8 +1,8 @@
1
- import { TreeSitterClient } from "./client";
2
- export * from "./client";
3
- export * from "../tree-sitter-styled-text";
4
- export * from "./types";
5
- export * from "./resolve-ft";
6
- export type { UpdateOptions } from "./assets/update";
7
- export { updateAssets } from "./assets/update";
1
+ import { TreeSitterClient } from "./client.js";
2
+ export * from "./client.js";
3
+ export * from "../tree-sitter-styled-text.js";
4
+ export * from "./types.js";
5
+ export * from "./resolve-ft.js";
6
+ export type { UpdateOptions } from "./assets/update.js";
7
+ export { updateAssets } from "./assets/update.js";
8
8
  export declare function getTreeSitterClient(): TreeSitterClient;
@@ -1,8 +1,8 @@
1
- import type { TextChunk } from "../text-buffer";
2
- import { StyledText } from "./styled-text";
3
- import { SyntaxStyle } from "../syntax-style";
4
- import { TreeSitterClient } from "./tree-sitter/client";
5
- import type { SimpleHighlight } from "./tree-sitter/types";
1
+ import type { TextChunk } from "../text-buffer.js";
2
+ import { StyledText } from "./styled-text.js";
3
+ import { SyntaxStyle } from "../syntax-style.js";
4
+ import { TreeSitterClient } from "./tree-sitter/client.js";
5
+ import type { SimpleHighlight } from "./tree-sitter/types.js";
6
6
  interface ConcealOptions {
7
7
  enabled: boolean;
8
8
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
7
- "version": "0.1.86",
7
+ "version": "0.1.88",
8
8
  "description": "OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -28,6 +28,16 @@
28
28
  "require": "./testing.js",
29
29
  "types": "./testing.d.ts"
30
30
  },
31
+ "./runtime-plugin": {
32
+ "import": "./runtime-plugin.js",
33
+ "require": "./runtime-plugin.js",
34
+ "types": "./runtime-plugin.d.ts"
35
+ },
36
+ "./runtime-plugin-support": {
37
+ "import": "./runtime-plugin-support.js",
38
+ "require": "./runtime-plugin-support.js",
39
+ "types": "./runtime-plugin-support.d.ts"
40
+ },
31
41
  "./parser.worker": {
32
42
  "import": "./lib/tree-sitter/parser.worker.js",
33
43
  "require": "./lib/tree-sitter/parser.worker.js",
@@ -57,11 +67,11 @@
57
67
  "bun-webgpu": "0.1.5",
58
68
  "planck": "^1.4.2",
59
69
  "three": "0.177.0",
60
- "@opentui/core-darwin-x64": "0.1.86",
61
- "@opentui/core-darwin-arm64": "0.1.86",
62
- "@opentui/core-linux-x64": "0.1.86",
63
- "@opentui/core-linux-arm64": "0.1.86",
64
- "@opentui/core-win32-x64": "0.1.86",
65
- "@opentui/core-win32-arm64": "0.1.86"
70
+ "@opentui/core-darwin-x64": "0.1.88",
71
+ "@opentui/core-darwin-arm64": "0.1.88",
72
+ "@opentui/core-linux-x64": "0.1.88",
73
+ "@opentui/core-linux-arm64": "0.1.88",
74
+ "@opentui/core-win32-x64": "0.1.88",
75
+ "@opentui/core-win32-arm64": "0.1.88"
66
76
  }
67
77
  }
package/parser.worker.js CHANGED
@@ -7,7 +7,7 @@ import { mkdir as mkdir2 } from "fs/promises";
7
7
  import * as path2 from "path";
8
8
 
9
9
  // src/lib/tree-sitter/download-utils.ts
10
- import { mkdir, writeFile } from "fs/promises";
10
+ import { mkdir, readFile, writeFile } from "fs/promises";
11
11
  import * as path from "path";
12
12
 
13
13
  class DownloadUtils {
@@ -33,7 +33,7 @@ class DownloadUtils {
33
33
  const cacheFile = path.join(cacheDir, cacheSubdir, cacheFileName);
34
34
  await mkdir(path.dirname(cacheFile), { recursive: true });
35
35
  try {
36
- const cachedContent = await Bun.file(cacheFile).arrayBuffer();
36
+ const cachedContent = await readFile(cacheFile);
37
37
  if (cachedContent.byteLength > 0) {
38
38
  console.log(`Loaded from cache: ${cacheFile} (${source})`);
39
39
  return { content: cachedContent, filePath: cacheFile };
@@ -45,7 +45,7 @@ class DownloadUtils {
45
45
  if (!response.ok) {
46
46
  return { error: `Failed to fetch from ${source}: ${response.statusText}` };
47
47
  }
48
- const content = await response.arrayBuffer();
48
+ const content = Buffer.from(await response.arrayBuffer());
49
49
  try {
50
50
  await writeFile(cacheFile, Buffer.from(content));
51
51
  console.log(`Cached: ${source}`);
@@ -59,7 +59,7 @@ class DownloadUtils {
59
59
  } else {
60
60
  try {
61
61
  console.log(`Loading from local path: ${source}`);
62
- const content = await Bun.file(source).arrayBuffer();
62
+ const content = await readFile(source);
63
63
  return { content, filePath: source };
64
64
  } catch (error) {
65
65
  return { error: `Error loading from local path ${source}: ${error}` };
@@ -76,7 +76,7 @@ class DownloadUtils {
76
76
  if (!response.ok) {
77
77
  return { error: `Failed to fetch from ${source}: ${response.statusText}` };
78
78
  }
79
- const content = await response.arrayBuffer();
79
+ const content = Buffer.from(await response.arrayBuffer());
80
80
  await writeFile(targetPath, Buffer.from(content));
81
81
  console.log(`Downloaded: ${source} -> ${targetPath}`);
82
82
  return { content, filePath: targetPath };
@@ -86,7 +86,7 @@ class DownloadUtils {
86
86
  } else {
87
87
  try {
88
88
  console.log(`Copying from local path: ${source}`);
89
- const content = await Bun.file(source).arrayBuffer();
89
+ const content = await readFile(source);
90
90
  await writeFile(targetPath, Buffer.from(content));
91
91
  return { content, filePath: targetPath };
92
92
  } catch (error) {
@@ -858,5 +858,5 @@ if (!isMainThread) {
858
858
  };
859
859
  }
860
860
 
861
- //# debugId=D486E9806A62187464756E2164756E21
861
+ //# debugId=9C8F94938CC7697764756E2164756E21
862
862
  //# sourceMappingURL=parser.worker.js.map