wraithterm 0.0.0-stage → 0.2.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 (210) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +313 -2
  3. package/css/xterm.css +285 -0
  4. package/dist/index.d.ts +88 -0
  5. package/dist/index.js +707 -0
  6. package/dist/keycodes.d.ts +1 -0
  7. package/dist/keycodes.js +179 -0
  8. package/dist/protocol.d.ts +117 -0
  9. package/dist/protocol.js +1 -0
  10. package/dist/types.d.ts +66 -0
  11. package/dist/types.js +19 -0
  12. package/dist/vite.d.ts +11 -0
  13. package/dist/vite.js +11 -0
  14. package/dist/worker.d.ts +1 -0
  15. package/dist/worker.js +302 -0
  16. package/dist/xterm-api.d.ts +1956 -0
  17. package/dist/xterm-atlas.d.ts +39 -0
  18. package/dist/xterm-atlas.js +176 -0
  19. package/dist/xterm-internals.d.ts +120 -0
  20. package/dist/xterm-internals.js +19 -0
  21. package/dist/xterm-renderer.d.ts +77 -0
  22. package/dist/xterm-renderer.js +540 -0
  23. package/dist/xterm.d.ts +17 -0
  24. package/dist/xterm.js +35 -0
  25. package/docs/ARCHITECTURE.md +179 -0
  26. package/docs/COMPATIBILITY.md +66 -0
  27. package/docs/PERFORMANCE.md +122 -0
  28. package/docs/TOP_TIER.md +124 -0
  29. package/docs/XTERM_API.md +163 -0
  30. package/docs/compatibility/xterm-chrome.json +34 -0
  31. package/licenses/Ghostty-MIT.txt +21 -0
  32. package/licenses/JetBrainsMono-OFL.txt +93 -0
  33. package/licenses/NOTICE.md +93 -0
  34. package/licenses/Zig-MIT.txt +21 -0
  35. package/licenses/rust/arrayvec-0.7.8/LICENSE-APACHE +201 -0
  36. package/licenses/rust/arrayvec-0.7.8/LICENSE-MIT +25 -0
  37. package/licenses/rust/autocfg-1.5.1/LICENSE-APACHE +201 -0
  38. package/licenses/rust/autocfg-1.5.1/LICENSE-MIT +25 -0
  39. package/licenses/rust/bit-set-0.10.0/LICENSE-APACHE +201 -0
  40. package/licenses/rust/bit-set-0.10.0/LICENSE-MIT +25 -0
  41. package/licenses/rust/bit-vec-0.9.1/LICENSE-APACHE +201 -0
  42. package/licenses/rust/bit-vec-0.9.1/LICENSE-MIT +25 -0
  43. package/licenses/rust/bitflags-2.13.2/LICENSE-APACHE +201 -0
  44. package/licenses/rust/bitflags-2.13.2/LICENSE-MIT +25 -0
  45. package/licenses/rust/bumpalo-3.20.3/LICENSE-APACHE +201 -0
  46. package/licenses/rust/bumpalo-3.20.3/LICENSE-MIT +25 -0
  47. package/licenses/rust/bytemuck-1.25.2/LICENSE-APACHE +61 -0
  48. package/licenses/rust/bytemuck-1.25.2/LICENSE-MIT +9 -0
  49. package/licenses/rust/bytemuck-1.25.2/LICENSE-ZLIB +11 -0
  50. package/licenses/rust/bytemuck_derive-1.12.1/LICENSE-APACHE +61 -0
  51. package/licenses/rust/bytemuck_derive-1.12.1/LICENSE-MIT +9 -0
  52. package/licenses/rust/bytemuck_derive-1.12.1/LICENSE-ZLIB +11 -0
  53. package/licenses/rust/cfg-if-1.0.5/LICENSE-APACHE +201 -0
  54. package/licenses/rust/cfg-if-1.0.5/LICENSE-MIT +25 -0
  55. package/licenses/rust/cfg_aliases-0.2.2/LICENSE +9 -0
  56. package/licenses/rust/codespan-reporting-0.13.1/LICENSE +201 -0
  57. package/licenses/rust/crunchy-0.2.4/LICENSE +21 -0
  58. package/licenses/rust/document-features-0.2.12/LICENSE-APACHE +73 -0
  59. package/licenses/rust/document-features-0.2.12/LICENSE-MIT +19 -0
  60. package/licenses/rust/equivalent-1.0.2/LICENSE-APACHE +201 -0
  61. package/licenses/rust/equivalent-1.0.2/LICENSE-MIT +25 -0
  62. package/licenses/rust/foldhash-0.2.0/LICENSE +19 -0
  63. package/licenses/rust/font-types-0.12.6/LICENSE-APACHE +67 -0
  64. package/licenses/rust/font-types-0.12.6/LICENSE-MIT +25 -0
  65. package/licenses/rust/futures-core-0.3.34/LICENSE-APACHE +202 -0
  66. package/licenses/rust/futures-core-0.3.34/LICENSE-MIT +26 -0
  67. package/licenses/rust/futures-task-0.3.34/LICENSE-APACHE +202 -0
  68. package/licenses/rust/futures-task-0.3.34/LICENSE-MIT +26 -0
  69. package/licenses/rust/futures-util-0.3.34/LICENSE-APACHE +202 -0
  70. package/licenses/rust/futures-util-0.3.34/LICENSE-MIT +26 -0
  71. package/licenses/rust/half-2.7.1/LICENSE-APACHE +176 -0
  72. package/licenses/rust/half-2.7.1/LICENSE-MIT +19 -0
  73. package/licenses/rust/harfrust-0.13.3/LICENSE +22 -0
  74. package/licenses/rust/hashbrown-0.17.1/LICENSE-APACHE +201 -0
  75. package/licenses/rust/hashbrown-0.17.1/LICENSE-MIT +25 -0
  76. package/licenses/rust/indexmap-2.14.2/LICENSE-APACHE +201 -0
  77. package/licenses/rust/indexmap-2.14.2/LICENSE-MIT +25 -0
  78. package/licenses/rust/js-sys-0.3.106/LICENSE-APACHE +201 -0
  79. package/licenses/rust/js-sys-0.3.106/LICENSE-MIT +25 -0
  80. package/licenses/rust/libc-0.2.190/LICENSE-APACHE +176 -0
  81. package/licenses/rust/libc-0.2.190/LICENSE-MIT +25 -0
  82. package/licenses/rust/libloading-0.8.9/LICENSE +12 -0
  83. package/licenses/rust/libm-0.2.16/LICENSE.txt +258 -0
  84. package/licenses/rust/litrs-1.0.0/LICENSE-APACHE +176 -0
  85. package/licenses/rust/litrs-1.0.0/LICENSE-MIT +25 -0
  86. package/licenses/rust/lock_api-0.4.14/LICENSE-APACHE +201 -0
  87. package/licenses/rust/lock_api-0.4.14/LICENSE-MIT +25 -0
  88. package/licenses/rust/log-0.4.34/LICENSE-APACHE +201 -0
  89. package/licenses/rust/log-0.4.34/LICENSE-MIT +25 -0
  90. package/licenses/rust/naga-30.0.1/LICENSE.APACHE +176 -0
  91. package/licenses/rust/naga-30.0.1/LICENSE.MIT +21 -0
  92. package/licenses/rust/naga-types-30.0.1/LICENSE.APACHE +176 -0
  93. package/licenses/rust/naga-types-30.0.1/LICENSE.MIT +21 -0
  94. package/licenses/rust/num-traits-0.2.19/LICENSE-APACHE +201 -0
  95. package/licenses/rust/num-traits-0.2.19/LICENSE-MIT +25 -0
  96. package/licenses/rust/once_cell-1.21.4/LICENSE-APACHE +201 -0
  97. package/licenses/rust/once_cell-1.21.4/LICENSE-MIT +23 -0
  98. package/licenses/rust/parking_lot-0.12.5/LICENSE-APACHE +201 -0
  99. package/licenses/rust/parking_lot-0.12.5/LICENSE-MIT +25 -0
  100. package/licenses/rust/parking_lot_core-0.9.12/LICENSE-APACHE +201 -0
  101. package/licenses/rust/parking_lot_core-0.9.12/LICENSE-MIT +25 -0
  102. package/licenses/rust/pin-project-lite-0.2.17/LICENSE-APACHE +177 -0
  103. package/licenses/rust/pin-project-lite-0.2.17/LICENSE-MIT +23 -0
  104. package/licenses/rust/portable-atomic-1.15.0/LICENSE-APACHE +177 -0
  105. package/licenses/rust/portable-atomic-1.15.0/LICENSE-MIT +23 -0
  106. package/licenses/rust/portable-atomic-util-0.2.8/LICENSE-APACHE +177 -0
  107. package/licenses/rust/portable-atomic-util-0.2.8/LICENSE-MIT +23 -0
  108. package/licenses/rust/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
  109. package/licenses/rust/proc-macro2-1.0.107/LICENSE-MIT +23 -0
  110. package/licenses/rust/quote-1.0.47/LICENSE-APACHE +176 -0
  111. package/licenses/rust/quote-1.0.47/LICENSE-MIT +23 -0
  112. package/licenses/rust/raw-window-handle-0.6.2/LICENSE-APACHE.md +177 -0
  113. package/licenses/rust/raw-window-handle-0.6.2/LICENSE-MIT.md +21 -0
  114. package/licenses/rust/raw-window-handle-0.6.2/LICENSE-ZLIB.md +11 -0
  115. package/licenses/rust/read-fonts-0.41.0/LICENSE-APACHE +67 -0
  116. package/licenses/rust/read-fonts-0.41.0/LICENSE-MIT +25 -0
  117. package/licenses/rust/read-fonts-0.43.3/LICENSE-APACHE +67 -0
  118. package/licenses/rust/read-fonts-0.43.3/LICENSE-MIT +25 -0
  119. package/licenses/rust/redox_syscall-0.5.18/LICENSE +22 -0
  120. package/licenses/rust/renderdoc-sys-1.1.0/LICENSE-APACHE +201 -0
  121. package/licenses/rust/renderdoc-sys-1.1.0/LICENSE-MIT +25 -0
  122. package/licenses/rust/rustc-hash-1.1.0/LICENSE-APACHE +201 -0
  123. package/licenses/rust/rustc-hash-1.1.0/LICENSE-MIT +23 -0
  124. package/licenses/rust/rustversion-1.0.23/LICENSE-APACHE +176 -0
  125. package/licenses/rust/rustversion-1.0.23/LICENSE-MIT +23 -0
  126. package/licenses/rust/scopeguard-1.2.0/LICENSE-APACHE +201 -0
  127. package/licenses/rust/scopeguard-1.2.0/LICENSE-MIT +25 -0
  128. package/licenses/rust/serde-1.0.229/LICENSE-APACHE +176 -0
  129. package/licenses/rust/serde-1.0.229/LICENSE-MIT +23 -0
  130. package/licenses/rust/serde_core-1.0.229/LICENSE-APACHE +176 -0
  131. package/licenses/rust/serde_core-1.0.229/LICENSE-MIT +23 -0
  132. package/licenses/rust/serde_derive-1.0.229/LICENSE-APACHE +176 -0
  133. package/licenses/rust/serde_derive-1.0.229/LICENSE-MIT +23 -0
  134. package/licenses/rust/skrifa-0.44.0/LICENSE-APACHE +67 -0
  135. package/licenses/rust/skrifa-0.44.0/LICENSE-MIT +25 -0
  136. package/licenses/rust/slab-0.4.12/LICENSE +25 -0
  137. package/licenses/rust/smallvec-1.16.2/LICENSE-APACHE +201 -0
  138. package/licenses/rust/smallvec-1.16.2/LICENSE-MIT +25 -0
  139. package/licenses/rust/static_assertions-1.1.0/LICENSE-APACHE +202 -0
  140. package/licenses/rust/static_assertions-1.1.0/LICENSE-MIT +21 -0
  141. package/licenses/rust/swash-0.2.10/LICENSE-APACHE +201 -0
  142. package/licenses/rust/swash-0.2.10/LICENSE-MIT +25 -0
  143. package/licenses/rust/syn-2.0.119/LICENSE-APACHE +176 -0
  144. package/licenses/rust/syn-2.0.119/LICENSE-MIT +23 -0
  145. package/licenses/rust/syn-3.0.6/LICENSE-APACHE +176 -0
  146. package/licenses/rust/syn-3.0.6/LICENSE-MIT +23 -0
  147. package/licenses/rust/termcolor-1.4.1/COPYING +3 -0
  148. package/licenses/rust/termcolor-1.4.1/LICENSE-MIT +21 -0
  149. package/licenses/rust/termcolor-1.4.1/UNLICENSE +24 -0
  150. package/licenses/rust/thiserror-2.0.21/LICENSE-APACHE +176 -0
  151. package/licenses/rust/thiserror-2.0.21/LICENSE-MIT +23 -0
  152. package/licenses/rust/thiserror-impl-2.0.21/LICENSE-APACHE +176 -0
  153. package/licenses/rust/thiserror-impl-2.0.21/LICENSE-MIT +23 -0
  154. package/licenses/rust/tokio-1.53.2/LICENSE +21 -0
  155. package/licenses/rust/unicode-ident-1.0.26/LICENSE-APACHE +176 -0
  156. package/licenses/rust/unicode-ident-1.0.26/LICENSE-MIT +23 -0
  157. package/licenses/rust/unicode-ident-1.0.26/LICENSE-UNICODE +39 -0
  158. package/licenses/rust/unicode-width-0.2.2/LICENSE-APACHE +201 -0
  159. package/licenses/rust/unicode-width-0.2.2/LICENSE-MIT +25 -0
  160. package/licenses/rust/wasm-bindgen-0.2.129/LICENSE-APACHE +201 -0
  161. package/licenses/rust/wasm-bindgen-0.2.129/LICENSE-MIT +25 -0
  162. package/licenses/rust/wasm-bindgen-futures-0.4.79/LICENSE-APACHE +201 -0
  163. package/licenses/rust/wasm-bindgen-futures-0.4.79/LICENSE-MIT +25 -0
  164. package/licenses/rust/wasm-bindgen-macro-0.2.129/LICENSE-APACHE +201 -0
  165. package/licenses/rust/wasm-bindgen-macro-0.2.129/LICENSE-MIT +25 -0
  166. package/licenses/rust/wasm-bindgen-macro-support-0.2.129/LICENSE-APACHE +201 -0
  167. package/licenses/rust/wasm-bindgen-macro-support-0.2.129/LICENSE-MIT +25 -0
  168. package/licenses/rust/wasm-bindgen-shared-0.2.129/LICENSE-APACHE +201 -0
  169. package/licenses/rust/wasm-bindgen-shared-0.2.129/LICENSE-MIT +25 -0
  170. package/licenses/rust/web-sys-0.3.106/LICENSE-APACHE +201 -0
  171. package/licenses/rust/web-sys-0.3.106/LICENSE-MIT +25 -0
  172. package/licenses/rust/wgpu-30.0.1/LICENSE.APACHE +176 -0
  173. package/licenses/rust/wgpu-30.0.1/LICENSE.MIT +21 -0
  174. package/licenses/rust/wgpu-core-30.0.1/LICENSE.APACHE +176 -0
  175. package/licenses/rust/wgpu-core-30.0.1/LICENSE.MIT +21 -0
  176. package/licenses/rust/wgpu-core-deps-windows-linux-android-30.0.1/LICENSE.APACHE +176 -0
  177. package/licenses/rust/wgpu-core-deps-windows-linux-android-30.0.1/LICENSE.MIT +21 -0
  178. package/licenses/rust/wgpu-hal-30.0.1/LICENSE.APACHE +176 -0
  179. package/licenses/rust/wgpu-hal-30.0.1/LICENSE.MIT +21 -0
  180. package/licenses/rust/wgpu-naga-bridge-30.0.1/LICENSE.APACHE +176 -0
  181. package/licenses/rust/wgpu-naga-bridge-30.0.1/LICENSE.MIT +21 -0
  182. package/licenses/rust/wgpu-types-30.0.1/LICENSE.APACHE +176 -0
  183. package/licenses/rust/wgpu-types-30.0.1/LICENSE.MIT +21 -0
  184. package/licenses/rust/winapi-util-0.1.11/COPYING +3 -0
  185. package/licenses/rust/winapi-util-0.1.11/LICENSE-MIT +21 -0
  186. package/licenses/rust/winapi-util-0.1.11/UNLICENSE +24 -0
  187. package/licenses/rust/windows-link-0.2.1/license-apache-2.0 +201 -0
  188. package/licenses/rust/windows-link-0.2.1/license-mit +21 -0
  189. package/licenses/rust/windows-sys-0.61.2/license-apache-2.0 +201 -0
  190. package/licenses/rust/windows-sys-0.61.2/license-mit +21 -0
  191. package/licenses/rust/yazi-0.2.1/LICENSE-APACHE +201 -0
  192. package/licenses/rust/yazi-0.2.1/LICENSE-MIT +19 -0
  193. package/licenses/rust/zeno-0.3.3/LICENSE-APACHE +201 -0
  194. package/licenses/rust/zeno-0.3.3/LICENSE-MIT +25 -0
  195. package/licenses/rust/zerocopy-0.8.62/LICENSE-APACHE +202 -0
  196. package/licenses/rust/zerocopy-0.8.62/LICENSE-BSD +24 -0
  197. package/licenses/rust/zerocopy-0.8.62/LICENSE-MIT +26 -0
  198. package/licenses/rust/zerocopy-derive-0.8.62/LICENSE-APACHE +202 -0
  199. package/licenses/rust/zerocopy-derive-0.8.62/LICENSE-BSD +24 -0
  200. package/licenses/rust/zerocopy-derive-0.8.62/LICENSE-MIT +26 -0
  201. package/licenses/xterm-MIT.txt +21 -0
  202. package/package.json +69 -4
  203. package/wasm/Ghostty-MIT.txt +21 -0
  204. package/wasm/JetBrainsMono-Regular.ttf +0 -0
  205. package/wasm/OFL.txt +93 -0
  206. package/wasm/optimization.json +6 -0
  207. package/wasm/wraith_engine.d.ts +176 -0
  208. package/wasm/wraith_engine.js +2057 -0
  209. package/wasm/wraith_engine_bg.wasm +0 -0
  210. package/wasm/wraith_engine_bg.wasm.d.ts +71 -0
@@ -0,0 +1 @@
1
+ export declare const KEY_CODES: Readonly<Record<string, number>>;
@@ -0,0 +1,179 @@
1
+ // Generated from pinned libghostty-vt; W3C KeyboardEvent.code values.
2
+ export const KEY_CODES = {
3
+ Unidentified: 0,
4
+ Backquote: 1,
5
+ Backslash: 2,
6
+ BracketLeft: 3,
7
+ BracketRight: 4,
8
+ Comma: 5,
9
+ Digit0: 6,
10
+ Digit1: 7,
11
+ Digit2: 8,
12
+ Digit3: 9,
13
+ Digit4: 10,
14
+ Digit5: 11,
15
+ Digit6: 12,
16
+ Digit7: 13,
17
+ Digit8: 14,
18
+ Digit9: 15,
19
+ Equal: 16,
20
+ IntlBackslash: 17,
21
+ IntlRo: 18,
22
+ IntlYen: 19,
23
+ KeyA: 20,
24
+ KeyB: 21,
25
+ KeyC: 22,
26
+ KeyD: 23,
27
+ KeyE: 24,
28
+ KeyF: 25,
29
+ KeyG: 26,
30
+ KeyH: 27,
31
+ KeyI: 28,
32
+ KeyJ: 29,
33
+ KeyK: 30,
34
+ KeyL: 31,
35
+ KeyM: 32,
36
+ KeyN: 33,
37
+ KeyO: 34,
38
+ KeyP: 35,
39
+ KeyQ: 36,
40
+ KeyR: 37,
41
+ KeyS: 38,
42
+ KeyT: 39,
43
+ KeyU: 40,
44
+ KeyV: 41,
45
+ KeyW: 42,
46
+ KeyX: 43,
47
+ KeyY: 44,
48
+ KeyZ: 45,
49
+ Minus: 46,
50
+ Period: 47,
51
+ Quote: 48,
52
+ Semicolon: 49,
53
+ Slash: 50,
54
+ AltLeft: 51,
55
+ AltRight: 52,
56
+ Backspace: 53,
57
+ CapsLock: 54,
58
+ ContextMenu: 55,
59
+ ControlLeft: 56,
60
+ ControlRight: 57,
61
+ Enter: 58,
62
+ MetaLeft: 59,
63
+ MetaRight: 60,
64
+ ShiftLeft: 61,
65
+ ShiftRight: 62,
66
+ Space: 63,
67
+ Tab: 64,
68
+ Convert: 65,
69
+ KanaMode: 66,
70
+ NonConvert: 67,
71
+ Delete: 68,
72
+ End: 69,
73
+ Help: 70,
74
+ Home: 71,
75
+ Insert: 72,
76
+ PageDown: 73,
77
+ PageUp: 74,
78
+ ArrowDown: 75,
79
+ ArrowLeft: 76,
80
+ ArrowRight: 77,
81
+ ArrowUp: 78,
82
+ NumLock: 79,
83
+ Numpad0: 80,
84
+ Numpad1: 81,
85
+ Numpad2: 82,
86
+ Numpad3: 83,
87
+ Numpad4: 84,
88
+ Numpad5: 85,
89
+ Numpad6: 86,
90
+ Numpad7: 87,
91
+ Numpad8: 88,
92
+ Numpad9: 89,
93
+ NumpadAdd: 90,
94
+ NumpadBackspace: 91,
95
+ NumpadClear: 92,
96
+ NumpadClearEntry: 93,
97
+ NumpadComma: 94,
98
+ NumpadDecimal: 95,
99
+ NumpadDivide: 96,
100
+ NumpadEnter: 97,
101
+ NumpadEqual: 98,
102
+ NumpadMemoryAdd: 99,
103
+ NumpadMemoryClear: 100,
104
+ NumpadMemoryRecall: 101,
105
+ NumpadMemoryStore: 102,
106
+ NumpadMemorySubtract: 103,
107
+ NumpadMultiply: 104,
108
+ NumpadParenLeft: 105,
109
+ NumpadParenRight: 106,
110
+ NumpadSubtract: 107,
111
+ NumpadSeparator: 108,
112
+ NumpadUp: 109,
113
+ NumpadDown: 110,
114
+ NumpadRight: 111,
115
+ NumpadLeft: 112,
116
+ NumpadBegin: 113,
117
+ NumpadHome: 114,
118
+ NumpadEnd: 115,
119
+ NumpadInsert: 116,
120
+ NumpadDelete: 117,
121
+ NumpadPageUp: 118,
122
+ NumpadPageDown: 119,
123
+ Escape: 120,
124
+ F1: 121,
125
+ F2: 122,
126
+ F3: 123,
127
+ F4: 124,
128
+ F5: 125,
129
+ F6: 126,
130
+ F7: 127,
131
+ F8: 128,
132
+ F9: 129,
133
+ F10: 130,
134
+ F11: 131,
135
+ F12: 132,
136
+ F13: 133,
137
+ F14: 134,
138
+ F15: 135,
139
+ F16: 136,
140
+ F17: 137,
141
+ F18: 138,
142
+ F19: 139,
143
+ F20: 140,
144
+ F21: 141,
145
+ F22: 142,
146
+ F23: 143,
147
+ F24: 144,
148
+ F25: 145,
149
+ Fn: 146,
150
+ FnLock: 147,
151
+ PrintScreen: 148,
152
+ ScrollLock: 149,
153
+ Pause: 150,
154
+ BrowserBack: 151,
155
+ BrowserFavorites: 152,
156
+ BrowserForward: 153,
157
+ BrowserHome: 154,
158
+ BrowserRefresh: 155,
159
+ BrowserSearch: 156,
160
+ BrowserStop: 157,
161
+ Eject: 158,
162
+ LaunchApp1: 159,
163
+ LaunchApp2: 160,
164
+ LaunchMail: 161,
165
+ MediaPlayPause: 162,
166
+ MediaSelect: 163,
167
+ MediaStop: 164,
168
+ MediaTrackNext: 165,
169
+ MediaTrackPrevious: 166,
170
+ Power: 167,
171
+ Sleep: 168,
172
+ AudioVolumeDown: 169,
173
+ AudioVolumeMute: 170,
174
+ AudioVolumeUp: 171,
175
+ WakeUp: 172,
176
+ Copy: 173,
177
+ Cut: 174,
178
+ Paste: 175,
179
+ };
@@ -0,0 +1,117 @@
1
+ import type { BenchmarkOptions } from './types.js';
2
+ export type Command = {
3
+ type: 'init';
4
+ canvas: OffscreenCanvas;
5
+ font: Uint8Array;
6
+ fonts: Uint8Array[];
7
+ cols: number;
8
+ rows: number;
9
+ size: number;
10
+ lineHeight: number;
11
+ history: number;
12
+ theme: number[];
13
+ } | {
14
+ type: 'write';
15
+ bytes: Uint8Array;
16
+ ids: number[];
17
+ } | {
18
+ type: 'resize';
19
+ cols: number;
20
+ rows: number;
21
+ id: number;
22
+ } | {
23
+ type: 'key';
24
+ key: number;
25
+ mods: number;
26
+ action: number;
27
+ text: string;
28
+ unshifted: number;
29
+ } | {
30
+ type: 'mouse';
31
+ action: number;
32
+ button: number;
33
+ mods: number;
34
+ x: number;
35
+ y: number;
36
+ pressed: number;
37
+ } | {
38
+ type: 'scroll';
39
+ delta: number;
40
+ } | {
41
+ type: 'select';
42
+ x1: number;
43
+ y1: number;
44
+ x2: number;
45
+ y2: number;
46
+ } | {
47
+ type: 'paste';
48
+ text: string;
49
+ id: number;
50
+ } | {
51
+ type: 'focus';
52
+ focused: boolean;
53
+ } | {
54
+ type: 'text';
55
+ selected: boolean;
56
+ id: number;
57
+ } | {
58
+ type: 'link';
59
+ x: number;
60
+ y: number;
61
+ id: number;
62
+ } | {
63
+ type: 'theme';
64
+ colors: number[];
65
+ } | {
66
+ type: 'flush';
67
+ id: number;
68
+ } | {
69
+ type: 'benchmark';
70
+ options: BenchmarkOptions;
71
+ id: number;
72
+ } | {
73
+ type: 'visibility';
74
+ visible: boolean;
75
+ } | {
76
+ type: 'dispose';
77
+ id: number;
78
+ };
79
+ export type Reply = {
80
+ type: 'ready';
81
+ width: number;
82
+ height: number;
83
+ adapter: string;
84
+ } | {
85
+ type: 'result';
86
+ id: number;
87
+ value?: unknown;
88
+ error?: string;
89
+ } | {
90
+ type: 'written';
91
+ ids: number[];
92
+ error?: string;
93
+ } | {
94
+ type: 'data';
95
+ bytes: Uint8Array;
96
+ } | {
97
+ type: 'title';
98
+ title: string;
99
+ } | {
100
+ type: 'bell';
101
+ } | {
102
+ type: 'modes';
103
+ mouse: boolean;
104
+ } | {
105
+ type: 'cursor';
106
+ x: number;
107
+ y: number;
108
+ } | {
109
+ type: 'stats';
110
+ values: number[];
111
+ samples: number[];
112
+ fps: number;
113
+ adapter: string;
114
+ } | {
115
+ type: 'error';
116
+ error: string;
117
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,66 @@
1
+ export interface WraithTheme {
2
+ foreground?: string;
3
+ background?: string;
4
+ cursor?: string;
5
+ }
6
+ export interface WraithOptions {
7
+ cols?: number;
8
+ rows?: number;
9
+ /** CSS pixels. Rasterization follows devicePixelRatio captured at mount. */
10
+ fontSize?: number;
11
+ lineHeight?: number;
12
+ font?: string | URL | Uint8Array;
13
+ fallbackFonts?: (string | URL | Uint8Array)[];
14
+ scrollback?: number;
15
+ fit?: boolean;
16
+ theme?: WraithTheme;
17
+ /** Maintain an accessible text mirror. Off by default to minimize DOM work. */
18
+ screenReaderMode?: boolean;
19
+ /** Maximum unacknowledged input bytes. Defaults to 8 MiB. */
20
+ maxPendingBytes?: number;
21
+ }
22
+ export interface WraithStats {
23
+ frames: number;
24
+ inputBytes: number;
25
+ parseMs: number;
26
+ renderMs: number;
27
+ uploadBytes: number;
28
+ atlasGlyphs: number;
29
+ atlasHits: number;
30
+ atlasMisses: number;
31
+ atlasResets: number;
32
+ renderP50Ms: number;
33
+ renderP95Ms: number;
34
+ renderP99Ms: number;
35
+ activeFps: number;
36
+ adapter: string;
37
+ }
38
+ export type Workload = 'sparse' | 'dense' | 'scroll';
39
+ export interface BenchmarkOptions {
40
+ frames?: number;
41
+ warmup?: number;
42
+ workload?: Workload;
43
+ }
44
+ export interface BenchmarkResult {
45
+ workload: Workload;
46
+ frames: number;
47
+ cols: number;
48
+ rows: number;
49
+ elapsedMs: number;
50
+ /** Counts frames completed in batches fenced every 32 submissions; not display FPS. */
51
+ fencedFramesPerSecond: number;
52
+ cpuP50Ms: number;
53
+ cpuP95Ms: number;
54
+ cpuP99Ms: number;
55
+ inputMiBPerSecond: number;
56
+ adapter: string;
57
+ userAgent: string;
58
+ }
59
+ export interface Disposable {
60
+ dispose(): void;
61
+ }
62
+ export declare class BackpressureError extends Error {
63
+ constructor();
64
+ }
65
+ export declare function packColor(value: string): number;
66
+ export declare function percentile(values: readonly number[], fraction: number): number;
package/dist/types.js ADDED
@@ -0,0 +1,19 @@
1
+ export class BackpressureError extends Error {
2
+ constructor() {
3
+ super('Wraith input queue is full. Await write() before submitting more input.');
4
+ this.name = 'BackpressureError';
5
+ }
6
+ }
7
+ export function packColor(value) {
8
+ if (!/^#[\da-f]{6}$/i.test(value))
9
+ throw new TypeError(`Expected #rrggbb, received ${value}`);
10
+ return (parseInt(value.slice(1, 3), 16) |
11
+ (parseInt(value.slice(3, 5), 16) << 8) |
12
+ (parseInt(value.slice(5, 7), 16) << 16));
13
+ }
14
+ export function percentile(values, fraction) {
15
+ if (!values.length)
16
+ return 0;
17
+ const sorted = [...values].sort((a, b) => a - b);
18
+ return sorted[Math.min(sorted.length - 1, Math.max(0, Math.ceil(sorted.length * fraction) - 1))];
19
+ }
package/dist/vite.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /** Keep worker and Wasm asset URLs relative to their original package files.
2
+ * This plugin has no runtime dependency on Vite. Its shape matches PluginOption.
3
+ */
4
+ export declare function wraith(): {
5
+ name: string;
6
+ config(): {
7
+ optimizeDeps: {
8
+ exclude: string[];
9
+ };
10
+ };
11
+ };
package/dist/vite.js ADDED
@@ -0,0 +1,11 @@
1
+ /** Keep worker and Wasm asset URLs relative to their original package files.
2
+ * This plugin has no runtime dependency on Vite. Its shape matches PluginOption.
3
+ */
4
+ export function wraith() {
5
+ return {
6
+ name: 'wraith-terminal-assets',
7
+ config() {
8
+ return { optimizeDeps: { exclude: ['wraithterm', '@xterm/xterm'] } };
9
+ },
10
+ };
11
+ }
@@ -0,0 +1 @@
1
+ export {};