restty 0.1.34 → 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 (194) hide show
  1. package/README.md +49 -318
  2. package/dist/chunk-30px21q2.js +0 -0
  3. package/dist/chunk-db9dt7pr.js +55226 -0
  4. package/dist/chunk-s26trws6.js +9136 -0
  5. package/dist/chunk-wdme6j9c.js +1776 -0
  6. package/dist/chunk-xykzfd81.js +0 -0
  7. package/dist/chunk-y6hfk43b.js +1690 -0
  8. package/dist/fonts/local-font-access.types.d.ts +19 -0
  9. package/dist/fonts/manager/entries.d.ts +7 -0
  10. package/dist/headless.d.ts +102 -0
  11. package/dist/headless.js +350 -0
  12. package/dist/ime/ime.d.ts +4 -4
  13. package/dist/index.d.ts +8 -2
  14. package/dist/input/keymap/default-mapping.d.ts +1 -0
  15. package/dist/input/mouse.d.ts +13 -0
  16. package/dist/input/types.d.ts +10 -1
  17. package/dist/internal/runtime.d.ts +4 -0
  18. package/dist/internal/runtime.js +12 -0
  19. package/dist/internal/surface.d.ts +6 -0
  20. package/dist/internal/surface.js +15 -0
  21. package/dist/internal.d.ts +2 -4
  22. package/dist/internal.js +23 -5
  23. package/dist/restty.esm.js +10949 -0
  24. package/dist/restty.js +8 -2
  25. package/dist/runtime/core/api.d.ts +112 -0
  26. package/dist/runtime/core/config.d.ts +133 -0
  27. package/dist/runtime/core/lifecycle.d.ts +1 -0
  28. package/dist/runtime/core/models.d.ts +124 -0
  29. package/dist/runtime/core/resources.d.ts +50 -0
  30. package/dist/runtime/core/runtime-events.d.ts +28 -0
  31. package/dist/runtime/core/session.d.ts +9 -0
  32. package/dist/runtime/{codepoint-utils.d.ts → create-runtime/codepoint-utils.d.ts} +1 -1
  33. package/dist/runtime/create-runtime/{color-glyph-atlas.d.ts → font-runtime/color-glyph-atlas.d.ts} +2 -2
  34. package/dist/runtime/create-runtime/font-runtime/grid.d.ts +6 -0
  35. package/dist/runtime/create-runtime/font-runtime/grid.types.d.ts +22 -0
  36. package/dist/runtime/create-runtime/font-runtime/index.d.ts +15 -0
  37. package/dist/runtime/create-runtime/font-runtime/text.d.ts +12 -0
  38. package/dist/runtime/create-runtime/font-runtime/text.types.d.ts +10 -0
  39. package/dist/runtime/create-runtime/{font-runtime-helpers.types.d.ts → font-runtime/types.d.ts} +6 -8
  40. package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.d.ts +7 -0
  41. package/dist/runtime/create-runtime/font-runtime/webgpu-atlas.types.d.ts +23 -0
  42. package/dist/runtime/create-runtime/highlight-terminal-color-utils.d.ts +6 -0
  43. package/dist/runtime/create-runtime/highlight-terminal-color-utils.types.d.ts +9 -0
  44. package/dist/runtime/create-runtime/input-hooks.d.ts +2 -12
  45. package/dist/runtime/create-runtime/input-hooks.types.d.ts +10 -0
  46. package/dist/runtime/create-runtime/interaction-runtime/bind-ime-events.d.ts +2 -1
  47. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-aux-handlers.d.ts +2 -3
  48. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +5 -10
  49. package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +3 -2
  50. package/dist/runtime/create-runtime/interaction-runtime/desktop-word-selection.d.ts +8 -0
  51. package/dist/runtime/create-runtime/{interaction-runtime.d.ts → interaction-runtime/index.d.ts} +3 -2
  52. package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.d.ts +2 -17
  53. package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.types.d.ts +17 -0
  54. package/dist/runtime/create-runtime/interaction-runtime/{types.d.ts → runtime.types.d.ts} +4 -50
  55. package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +1 -29
  56. package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.types.d.ts +23 -0
  57. package/dist/runtime/create-runtime/interaction-runtime/state.types.d.ts +47 -0
  58. package/dist/runtime/create-runtime/kitty-render-runtime.d.ts +2 -36
  59. package/dist/runtime/create-runtime/kitty-render-runtime.types.d.ts +33 -0
  60. package/dist/runtime/create-runtime/{lifecycle-theme-size-canvas.d.ts → lifecycle-theme-size/canvas.d.ts} +1 -1
  61. package/dist/runtime/create-runtime/{lifecycle-theme-size.d.ts → lifecycle-theme-size/index.d.ts} +3 -3
  62. package/dist/runtime/create-runtime/lifecycle-theme-size/theme.d.ts +6 -0
  63. package/dist/runtime/create-runtime/{lifecycle-theme-size.types.d.ts → lifecycle-theme-size/types.d.ts} +13 -7
  64. package/dist/runtime/create-runtime/ligature-runs.d.ts +52 -0
  65. package/dist/runtime/{max-scrollback.d.ts → create-runtime/max-scrollback.d.ts} +2 -5
  66. package/dist/runtime/create-runtime/max-scrollback.types.d.ts +4 -0
  67. package/dist/runtime/create-runtime/native-scrollbar-host.d.ts +2 -0
  68. package/dist/runtime/create-runtime/native-scrollbar-host.types.d.ts +13 -0
  69. package/dist/runtime/create-runtime/overlay-scrollbar.d.ts +6 -0
  70. package/dist/runtime/create-runtime/overlay-scrollbar.types.d.ts +12 -0
  71. package/dist/runtime/create-runtime/pty-input-runtime.d.ts +2 -46
  72. package/dist/runtime/create-runtime/pty-input-runtime.types.d.ts +41 -0
  73. package/dist/runtime/{render-color-utils.d.ts → create-runtime/render-color-utils.d.ts} +1 -1
  74. package/dist/runtime/{render-stage-runtime.d.ts → create-runtime/render-stage-runtime.d.ts} +2 -2
  75. package/dist/runtime/{create-app-types.d.ts → create-runtime/render-stage-runtime.types.d.ts} +1 -29
  76. package/dist/runtime/create-runtime/render-tick-webgl-overlays.d.ts +1 -1
  77. package/dist/runtime/create-runtime/render-tick-webgl-scene.d.ts +1 -1
  78. package/dist/runtime/create-runtime/render-tick-webgl.types.d.ts +2 -5
  79. package/dist/runtime/create-runtime/render-tick-webgpu-cell-pass.d.ts +1 -1
  80. package/dist/runtime/create-runtime/render-tick-webgpu.types.d.ts +15 -11
  81. package/dist/runtime/create-runtime/runtime-controller.api.types.d.ts +96 -0
  82. package/dist/runtime/create-runtime/runtime-controller.clipboard.d.ts +10 -0
  83. package/dist/runtime/create-runtime/runtime-controller.d.ts +3 -0
  84. package/dist/runtime/create-runtime/runtime-controller.input.d.ts +24 -0
  85. package/dist/runtime/create-runtime/runtime-controller.keyboard.d.ts +19 -0
  86. package/dist/runtime/create-runtime/runtime-controller.lifecycle.d.ts +50 -0
  87. package/dist/runtime/create-runtime/runtime-controller.public-api.capabilities.d.ts +57 -0
  88. package/dist/runtime/create-runtime/runtime-controller.public-api.d.ts +28 -0
  89. package/dist/runtime/create-runtime/runtime-controller.render-loop.d.ts +20 -0
  90. package/dist/runtime/create-runtime/runtime-controller.state.types.d.ts +24 -0
  91. package/dist/runtime/create-runtime/runtime-reporting.d.ts +3 -21
  92. package/dist/runtime/create-runtime/runtime-reporting.types.d.ts +18 -0
  93. package/dist/runtime/{create-app-symbols.d.ts → create-runtime/runtime-symbols.d.ts} +2 -2
  94. package/dist/runtime/create-runtime/search-highlight-utils.d.ts +21 -0
  95. package/dist/runtime/create-runtime/search-runtime/index.d.ts +2 -0
  96. package/dist/runtime/create-runtime/search-runtime/types.d.ts +25 -0
  97. package/dist/runtime/create-runtime/shader-stage-runtime.d.ts +2 -29
  98. package/dist/runtime/create-runtime/shader-stage-runtime.types.d.ts +27 -0
  99. package/dist/runtime/{text-decoration.d.ts → create-runtime/text-decoration.d.ts} +1 -1
  100. package/dist/runtime/create-runtime.d.ts +7 -7
  101. package/dist/runtime/font-atlas-utils/glyph-atlas-builder.d.ts +1 -1
  102. package/dist/runtime/font-atlas-utils/nerd-metrics-utils.d.ts +1 -1
  103. package/dist/runtime/{atlas-builder.d.ts → fonts/atlas-builder.d.ts} +1 -1
  104. package/dist/runtime/{font-resource-store.d.ts → fonts/font-resource-store.d.ts} +3 -2
  105. package/dist/runtime/fonts/font-sources.d.ts +4 -0
  106. package/dist/runtime/shader-stages.d.ts +1 -1
  107. package/dist/runtime/types.d.ts +6 -365
  108. package/dist/surface/{panes-context-menu.d.ts → panes/context-menu.d.ts} +1 -1
  109. package/dist/surface/panes/default-context-menu-items.d.ts +2 -2
  110. package/dist/surface/panes/layout.d.ts +1 -1
  111. package/dist/surface/panes/managed-pane-create.d.ts +3 -0
  112. package/dist/surface/panes/managed-pane-create.types.d.ts +17 -0
  113. package/dist/surface/panes/managed-pane-dom.d.ts +13 -0
  114. package/dist/surface/panes/managed-pane-manager.d.ts +6 -0
  115. package/dist/surface/panes/managed-pane-options.d.ts +6 -0
  116. package/dist/surface/panes/managed-pane-options.types.d.ts +7 -0
  117. package/dist/surface/panes/managed-pane-runtime-config.d.ts +3 -0
  118. package/dist/surface/panes/managed-pane-runtime-config.types.d.ts +9 -0
  119. package/dist/surface/panes/managed-pane-runtime.d.ts +3 -0
  120. package/dist/surface/panes/managed-pane-runtime.types.d.ts +10 -0
  121. package/dist/surface/panes/managed-pane-search-ui.d.ts +9 -0
  122. package/dist/surface/panes/managed-pane-types.d.ts +102 -0
  123. package/dist/surface/panes/manager.d.ts +1 -1
  124. package/dist/surface/panes/pane-interactions.d.ts +2 -2
  125. package/dist/surface/{panes-styles.d.ts → panes/styles.d.ts} +1 -1
  126. package/dist/surface/{panes-types.d.ts → panes/types.d.ts} +48 -7
  127. package/dist/surface/panes/window-events.d.ts +1 -1
  128. package/dist/surface/{restty-plugin-types.d.ts → plugins/context.types.d.ts} +32 -88
  129. package/dist/surface/{restty/plugin-dispatcher.d.ts → plugins/dispatcher.d.ts} +4 -13
  130. package/dist/surface/plugins/dispatcher.types.d.ts +6 -0
  131. package/dist/surface/{restty/plugin-ops.d.ts → plugins/host.d.ts} +4 -3
  132. package/dist/surface/plugins/runtime.d.ts +18 -0
  133. package/dist/surface/plugins/runtime.types.d.ts +47 -0
  134. package/dist/surface/plugins/types.d.ts +83 -0
  135. package/dist/surface/restty/active-pane-api.d.ts +34 -16
  136. package/dist/surface/restty/assembly.d.ts +23 -0
  137. package/dist/surface/restty/bootstrap.d.ts +21 -0
  138. package/dist/surface/restty/config.d.ts +46 -0
  139. package/dist/surface/restty/controller.d.ts +45 -0
  140. package/dist/surface/restty/events.d.ts +14 -0
  141. package/dist/surface/restty/manager-options.d.ts +4 -23
  142. package/dist/surface/restty/manager-options.types.d.ts +32 -0
  143. package/dist/surface/restty/pane-command-ops.d.ts +37 -0
  144. package/dist/surface/restty/pane-handle-ops.d.ts +24 -0
  145. package/dist/surface/restty/pane-handle.d.ts +107 -0
  146. package/dist/surface/restty/pane-lookup.d.ts +22 -0
  147. package/dist/surface/restty/pane-manager-assembly.d.ts +18 -0
  148. package/dist/surface/restty/pane-ops.d.ts +3 -42
  149. package/dist/surface/restty/pane-style-ops.d.ts +6 -0
  150. package/dist/surface/restty/plugin-surface.d.ts +5 -0
  151. package/dist/surface/restty/shader-ops.d.ts +6 -5
  152. package/dist/surface/restty.d.ts +30 -49
  153. package/dist/surface/search-ui/controller.d.ts +2 -0
  154. package/dist/surface/search-ui/index.d.ts +2 -0
  155. package/dist/surface/search-ui/styles.d.ts +5 -0
  156. package/dist/surface/search-ui/types.d.ts +96 -0
  157. package/dist/theme/ghostty.d.ts +13 -2
  158. package/dist/wasm/embedded.d.ts +1 -1
  159. package/dist/wasm/index.d.ts +1 -1
  160. package/dist/wasm/runtime/restty-wasm.d.ts +15 -1
  161. package/dist/wasm/runtime/types.d.ts +24 -6
  162. package/dist/xterm/compat-services.d.ts +2 -0
  163. package/dist/xterm.d.ts +4 -3
  164. package/dist/xterm.js +14 -8
  165. package/package.json +59 -24
  166. package/dist/chunk-meqn8xtd.js +0 -66867
  167. package/dist/runtime/create-runtime/debug-tools/create-dump-glyph-render.d.ts +0 -2
  168. package/dist/runtime/create-runtime/debug-tools/diagnose-codepoint.d.ts +0 -2
  169. package/dist/runtime/create-runtime/debug-tools/dump-atlas-for-codepoint.d.ts +0 -2
  170. package/dist/runtime/create-runtime/debug-tools/read-texture-to-image-data.d.ts +0 -1
  171. package/dist/runtime/create-runtime/debug-tools/setup-debug-expose.d.ts +0 -2
  172. package/dist/runtime/create-runtime/debug-tools/types.d.ts +0 -63
  173. package/dist/runtime/create-runtime/debug-tools.d.ts +0 -6
  174. package/dist/runtime/create-runtime/font-runtime-grid-helpers.d.ts +0 -30
  175. package/dist/runtime/create-runtime/font-runtime-helpers.d.ts +0 -15
  176. package/dist/runtime/create-runtime/font-runtime-text-helpers.d.ts +0 -21
  177. package/dist/runtime/create-runtime/font-runtime-webgpu-atlas.d.ts +0 -29
  178. package/dist/runtime/create-runtime/lifecycle-theme-size-theme.d.ts +0 -6
  179. package/dist/runtime/create-runtime/runtime-app-api.d.ts +0 -105
  180. package/dist/runtime/create-runtime/runtime-logger.d.ts +0 -17
  181. package/dist/runtime/font-sources.d.ts +0 -5
  182. package/dist/runtime/overlay-scrollbar.d.ts +0 -24
  183. package/dist/runtime/pty-output-buffer.d.ts +0 -12
  184. package/dist/runtime/session.d.ts +0 -9
  185. package/dist/surface/app-factory.d.ts +0 -3
  186. package/dist/surface/pane-app-manager.d.ts +0 -89
  187. package/dist/surface/restty-pane-handle.d.ts +0 -70
  188. package/dist/surface/restty-plugin-runtime.d.ts +0 -57
  189. package/dist/xterm/app-options.d.ts +0 -2
  190. /package/dist/runtime/create-runtime/{atlas-debug-utils.d.ts → atlas-bitmap-utils.d.ts} +0 -0
  191. /package/dist/runtime/{clipboard-paste.d.ts → create-runtime/clipboard-paste.d.ts} +0 -0
  192. /package/dist/runtime/{render-stage-shaders.d.ts → create-runtime/render-stage-shaders.d.ts} +0 -0
  193. /package/dist/runtime/{create-app-io-utils.d.ts → create-runtime/runtime-io-utils.d.ts} +0 -0
  194. /package/dist/surface/{restty-plugin-utils.d.ts → plugins/utils.d.ts} +0 -0
@@ -1,66 +1,53 @@
1
- import type { DesktopNotification } from "../input";
2
- import { type CreateResttyAppPaneManagerOptions, type ResttyManagedAppPane, type ResttyManagedPaneStyleOptions, type ResttyPaneAppOptionsInput } from "./pane-app-manager";
3
- import type { ResttyPaneManager, ResttyPaneSplitDirection } from "./panes-types";
4
- import type { ResttyFontSource, ResttyShaderStage } from "../runtime/types";
5
- import { ResttyPaneHandle } from "./restty-pane-handle";
1
+ import type { ResttyFontInput, ResttyShaderStage } from "../runtime/core/models";
2
+ import type { ResttyManagedPaneManager, ResttyManagedPaneSearchUiStyleOptions, ResttyManagedPaneStyleOptions } from "./panes/managed-pane-types";
3
+ import { ResttyPaneHandle } from "./restty/pane-handle";
6
4
  import { ResttyActivePaneApi } from "./restty/active-pane-api";
7
- import { type ResttyPluginInfo, type ResttyPluginManifestEntry, type ResttyPluginRegistry, type ResttyPluginLoadResult, type ResttyRenderStageHandle, type ResttyPlugin } from "./restty-plugin-types";
8
- export { ResttyPaneHandle } from "./restty-pane-handle";
9
- export type { ResttyPaneApi } from "./restty-pane-handle";
10
- export { RESTTY_PLUGIN_API_VERSION } from "./restty-plugin-types";
11
- export type { ResttyPluginApiRange, ResttyPluginRequires, ResttyPluginInfo, ResttyPluginManifestEntry, ResttyPluginRegistryEntry, ResttyPluginRegistry, ResttyPluginLoadStatus, ResttyPluginLoadResult, ResttyPluginEvents, ResttyPluginDisposable, ResttyPluginCleanup, ResttyInputInterceptorPayload, ResttyOutputInterceptorPayload, ResttyInputInterceptor, ResttyOutputInterceptor, ResttyLifecycleHookPayload, ResttyLifecycleHook, ResttyRenderHookPayload, ResttyRenderHook, ResttyInterceptorOptions, ResttyRenderStageHandle, ResttyPluginContext, ResttyPlugin, } from "./restty-plugin-types";
12
- /**
13
- * Top-level configuration for creating a Restty instance.
14
- */
15
- export type ResttyOptions = Omit<CreateResttyAppPaneManagerOptions, "appOptions"> & {
16
- /** Per-pane app options, static or factory. */
17
- appOptions?: CreateResttyAppPaneManagerOptions["appOptions"];
18
- /** Font sources applied to every pane. */
19
- fontSources?: ResttyPaneAppOptionsInput["fontSources"];
20
- /** Global shader stages synchronized to all panes. */
21
- shaderStages?: ResttyShaderStage[];
22
- /** Global handler for desktop notifications emitted by any pane. */
23
- onDesktopNotification?: (notification: DesktopNotification & {
24
- paneId: number;
25
- }) => void;
26
- /** Whether to create the first pane automatically (default true). */
27
- createInitialPane?: boolean | {
28
- focus?: boolean;
29
- };
30
- };
5
+ import { type ResttyPluginInfo, type ResttyPluginManifestEntry, type ResttyPluginRegistry, type ResttyPluginLoadResult } from "./plugins/types";
6
+ import type { ResttyRenderStageHandle, ResttyPlugin } from "./plugins/context.types";
7
+ import type { ResttyConfig } from "./restty/config";
8
+ import type { ResttySurfacePane } from "./restty/events";
9
+ export { ResttyPaneHandle } from "./restty/pane-handle";
10
+ export type { ResttyPaneApi } from "./restty/pane-handle";
11
+ export { RESTTY_PLUGIN_API_VERSION } from "./plugins/types";
12
+ export type { ResttyPluginApiRange, ResttyPluginRequires, ResttyPluginInfo, ResttyPluginManifestEntry, ResttyPluginRegistryEntry, ResttyPluginRegistry, ResttyPluginLoadStatus, ResttyPluginLoadResult, ResttyPluginEvents, ResttyPluginDisposable, ResttyPluginCleanup, ResttyPluginHostApi, ResttyInputInterceptorPayload, ResttyOutputInterceptorPayload, ResttyInputInterceptor, ResttyOutputInterceptor, ResttyLifecycleHookPayload, ResttyLifecycleHook, ResttyRenderHookPayload, ResttyRenderHook, ResttyInterceptorOptions, ResttyRenderStageHandle, ResttyPluginContext, ResttyPlugin, } from "./plugins/types";
13
+ export type { ResttyConfig, ResttyServicesConfig, ResttyServicesConfigInput, ResttySurfaceConfig, } from "./restty/config";
14
+ export type { ResttySurfaceEvents, ResttySurfacePane } from "./restty/events";
31
15
  /**
32
16
  * Main entry point for the restty terminal widget. Manages a set of
33
- * split panes, each running its own terminal app, and exposes
17
+ * split panes, each running its own terminal runtime, and exposes
34
18
  * convenience methods that operate on the active pane.
35
19
  */
36
20
  export declare class Restty extends ResttyActivePaneApi {
37
- readonly paneManager: ResttyPaneManager<ResttyManagedAppPane>;
38
- private fontSources;
21
+ readonly paneManager: ResttyManagedPaneManager;
22
+ private fonts;
39
23
  private readonly shaderOps;
40
- private readonly pluginOps;
41
- constructor(options: ResttyOptions);
42
- getPanes(): ResttyManagedAppPane[];
43
- getPaneById(id: number): ResttyManagedAppPane | null;
44
- getActivePane(): ResttyManagedAppPane | null;
45
- getFocusedPane(): ResttyManagedAppPane | null;
24
+ private readonly controller;
25
+ private readonly paneLookupOps;
26
+ constructor(options: ResttyConfig);
27
+ getPanes(): ResttySurfacePane[];
28
+ getPaneById(id: number): ResttySurfacePane | null;
29
+ getActivePane(): ResttySurfacePane | null;
30
+ getFocusedPane(): ResttySurfacePane | null;
46
31
  panes(): ResttyPaneHandle[];
47
32
  pane(id: number): ResttyPaneHandle | null;
48
33
  activePane(): ResttyPaneHandle | null;
49
34
  focusedPane(): ResttyPaneHandle | null;
50
35
  forEachPane(visitor: (pane: ResttyPaneHandle) => void): void;
51
- setFontSources(sources: ResttyFontSource[]): Promise<void>;
36
+ setFonts(fonts: ResttyFontInput[]): Promise<void>;
52
37
  setShaderStages(stages: ResttyShaderStage[]): void;
53
38
  getShaderStages(): ResttyShaderStage[];
54
39
  addShaderStage(stage: ResttyShaderStage): ResttyRenderStageHandle;
55
40
  removeShaderStage(id: string): boolean;
56
41
  createInitialPane(options?: {
57
42
  focus?: boolean;
58
- }): ResttyManagedAppPane;
59
- splitActivePane(direction: ResttyPaneSplitDirection): ResttyManagedAppPane | null;
60
- splitPane(id: number, direction: ResttyPaneSplitDirection): ResttyManagedAppPane | null;
43
+ }): ResttySurfacePane;
44
+ splitActivePane(direction: ResttyPaneSplitDirection): ResttySurfacePane | null;
45
+ splitPane(id: number, direction: ResttyPaneSplitDirection): ResttySurfacePane | null;
61
46
  closePane(id: number): boolean;
62
47
  getPaneStyleOptions(): Readonly<Required<ResttyManagedPaneStyleOptions>>;
63
48
  setPaneStyleOptions(options: ResttyManagedPaneStyleOptions): void;
49
+ getSearchUiStyleOptions(): Readonly<Required<ResttyManagedPaneSearchUiStyleOptions>>;
50
+ setSearchUiStyleOptions(options: ResttyManagedPaneSearchUiStyleOptions): void;
64
51
  setActivePane(id: number, options?: {
65
52
  focus?: boolean;
66
53
  }): void;
@@ -81,13 +68,7 @@ export declare class Restty extends ResttyActivePaneApi {
81
68
  resize(cols: number, rows: number): void;
82
69
  focus(): void;
83
70
  blur(): void;
84
- private paneLookup;
85
- private lifecycleHooks;
86
- private lifecycleAndPluginHooks;
87
71
  protected requireActivePaneHandle(): ResttyPaneHandle;
88
- private runLifecycleHooks;
89
- private runRenderHooks;
90
- private emitPluginEvent;
91
72
  }
92
73
  /** Create a new Restty instance with the given options. */
93
- export declare function createRestty(options: ResttyOptions): Restty;
74
+ export declare function createRestty(options: ResttyConfig): Restty;
@@ -0,0 +1,2 @@
1
+ import type { CreatePaneSearchUiControllerOptions, PaneSearchUiController } from "./types";
2
+ export declare function createPaneSearchUiController(options: CreatePaneSearchUiControllerOptions): PaneSearchUiController;
@@ -0,0 +1,2 @@
1
+ export { createPaneSearchUiController } from "./controller";
2
+ export type { CreatePaneSearchUiControllerOptions, PaneSearchUiController, ResttyPaneSearchUiCloseOptions, ResttyPaneSearchUiOpenOptions, ResttyPaneSearchUiOptions, ResttyPaneSearchUiPane, ResttyPaneSearchUiShortcutOptions, ResttyPaneSearchUiStyleOptions, } from "./types";
@@ -0,0 +1,5 @@
1
+ import type { ResttyPaneSearchUiStyleOptions } from "./types";
2
+ export declare function normalizeSearchUiStyleOptions(options: ResttyPaneSearchUiStyleOptions | undefined): Required<ResttyPaneSearchUiStyleOptions>;
3
+ export declare function ensurePaneSearchUiStyles(doc: Document): void;
4
+ export declare function applySearchUiStyleOptions(root: HTMLElement, options: Readonly<Required<ResttyPaneSearchUiStyleOptions>>): void;
5
+ export declare function clearSearchUiStyleOptions(root: HTMLElement): void;
@@ -0,0 +1,96 @@
1
+ import type { ResttyRuntimeSearchApi } from "../../runtime/core/api";
2
+ import type { ResttySearchState } from "../../runtime/core/models";
3
+ export type ResttyPaneSearchUiPane = {
4
+ id: number;
5
+ container: HTMLDivElement;
6
+ focusTarget?: HTMLElement | null;
7
+ setSearchQuery: ResttyRuntimeSearchApi["setQuery"];
8
+ clearSearch: ResttyRuntimeSearchApi["clear"];
9
+ searchNext: ResttyRuntimeSearchApi["next"];
10
+ searchPrevious: ResttyRuntimeSearchApi["previous"];
11
+ getSearchState: ResttyRuntimeSearchApi["getState"];
12
+ };
13
+ export type ResttyPaneSearchUiStyleOptions = {
14
+ offsetTopPx?: number;
15
+ offsetRightPx?: number;
16
+ minWidthPx?: number;
17
+ maxWidthPx?: number;
18
+ zIndex?: number;
19
+ borderRadiusPx?: number;
20
+ backdropBlurPx?: number;
21
+ panelBackground?: string;
22
+ panelBorderColor?: string;
23
+ panelTextColor?: string;
24
+ panelShadow?: string;
25
+ inputBackground?: string;
26
+ inputTextColor?: string;
27
+ inputPlaceholderColor?: string;
28
+ buttonBackground?: string;
29
+ buttonTextColor?: string;
30
+ buttonHoverBackground?: string;
31
+ buttonDisabledOpacity?: number;
32
+ statusTextColor?: string;
33
+ statusActiveTextColor?: string;
34
+ statusCompleteTextColor?: string;
35
+ };
36
+ export type ResttyPaneSearchUiShortcutOptions = {
37
+ enabled?: boolean;
38
+ canOpen?: (event: KeyboardEvent, paneId: number) => boolean;
39
+ };
40
+ export type ResttyPaneSearchUiOptions = {
41
+ enabled?: boolean;
42
+ placeholder?: string;
43
+ previousButtonText?: string;
44
+ nextButtonText?: string;
45
+ clearButtonText?: string;
46
+ closeButtonText?: string;
47
+ statusFormatter?: (state: ResttySearchState) => string;
48
+ shortcut?: boolean | ResttyPaneSearchUiShortcutOptions;
49
+ styles?: ResttyPaneSearchUiStyleOptions;
50
+ };
51
+ export type ResttyPaneSearchUiOpenOptions = {
52
+ selectAll?: boolean;
53
+ };
54
+ export type ResttyPaneSearchUiCloseOptions = {
55
+ restoreFocus?: boolean;
56
+ };
57
+ export type PaneSearchUiController = {
58
+ registerPane: (pane: ResttyPaneSearchUiPane) => void;
59
+ unregisterPane: (paneId: number) => void;
60
+ handleSearchState: (paneId: number, state: ResttySearchState) => void;
61
+ handleActivePaneChange: (paneId: number | null) => void;
62
+ open: (paneId: number, options?: ResttyPaneSearchUiOpenOptions) => void;
63
+ close: (paneId: number, options?: ResttyPaneSearchUiCloseOptions) => void;
64
+ toggle: (paneId: number, options?: ResttyPaneSearchUiOpenOptions & ResttyPaneSearchUiCloseOptions) => void;
65
+ isOpen: (paneId: number) => boolean;
66
+ getStyleOptions: () => Readonly<Required<ResttyPaneSearchUiStyleOptions>>;
67
+ setStyleOptions: (options: ResttyPaneSearchUiStyleOptions) => void;
68
+ destroy: () => void;
69
+ };
70
+ export type CreatePaneSearchUiControllerOptions = {
71
+ root: HTMLElement;
72
+ enabled?: boolean;
73
+ placeholder?: string;
74
+ previousButtonText?: string;
75
+ nextButtonText?: string;
76
+ clearButtonText?: string;
77
+ closeButtonText?: string;
78
+ statusFormatter?: (state: ResttySearchState) => string;
79
+ shortcut?: boolean | ResttyPaneSearchUiShortcutOptions;
80
+ styles?: ResttyPaneSearchUiStyleOptions;
81
+ getActivePane: () => ResttyPaneSearchUiPane | null;
82
+ getFocusedPane: () => ResttyPaneSearchUiPane | null;
83
+ };
84
+ export type PaneSearchUiState = {
85
+ pane: ResttyPaneSearchUiPane;
86
+ root: HTMLDivElement;
87
+ input: HTMLInputElement;
88
+ prevButton: HTMLButtonElement;
89
+ nextButton: HTMLButtonElement;
90
+ clearButton: HTMLButtonElement;
91
+ closeButton: HTMLButtonElement;
92
+ status: HTMLDivElement;
93
+ cleanupFns: Array<() => void>;
94
+ state: ResttySearchState;
95
+ open: boolean;
96
+ };
@@ -5,6 +5,7 @@ export type ThemeColor = {
5
5
  b: number;
6
6
  a?: number;
7
7
  };
8
+ export type ThemeTerminalColor = ThemeColor | "cell-foreground" | "cell-background";
8
9
  /**
9
10
  * Parsed Ghostty terminal theme with semantic colors and full 256-color palette.
10
11
  */
@@ -22,9 +23,17 @@ export type GhosttyTheme = {
22
23
  /** Text color under the cursor. */
23
24
  cursorText?: ThemeColor;
24
25
  /** Selection background color. */
25
- selectionBackground?: ThemeColor;
26
+ selectionBackground?: ThemeTerminalColor;
26
27
  /** Selection foreground (text) color. */
27
- selectionForeground?: ThemeColor;
28
+ selectionForeground?: ThemeTerminalColor;
29
+ /** Search match background color. */
30
+ searchBackground?: ThemeTerminalColor;
31
+ /** Search match foreground color. */
32
+ searchForeground?: ThemeTerminalColor;
33
+ /** Active search match background color. */
34
+ searchSelectedBackground?: ThemeTerminalColor;
35
+ /** Active search match foreground color. */
36
+ searchSelectedForeground?: ThemeTerminalColor;
28
37
  /** 256-color palette (indices 0-255). */
29
38
  palette: Array<ThemeColor | undefined>;
30
39
  };
@@ -33,6 +42,8 @@ export type GhosttyTheme = {
33
42
  };
34
43
  /** Parse a Ghostty color value (hex, rgb/rgba, or named color). */
35
44
  export declare function parseGhosttyColor(value: string): ThemeColor | null;
45
+ /** Parse a Ghostty TerminalColor value. */
46
+ export declare function parseGhosttyTerminalColor(value: string): ThemeTerminalColor | null;
36
47
  /** Convert ThemeColor to normalized RGBA floats (0.0-1.0). */
37
48
  export declare function colorToFloats(color: ThemeColor, alphaOverride?: number): [number, number, number, number];
38
49
  /** Convert ThemeColor to packed 24-bit RGB integer (0xRRGGBB). */
@@ -1 +1 @@
1
- export declare const WASM_BASE64: string;
1
+ export declare const WASM_BINARY: string;
@@ -1,2 +1,2 @@
1
- export type { CursorInfo, KittyPlacement, RenderState, ResttyWasmExports, ResttyWasmOptions, WasmAbi, WasmAbiKind, } from "./runtime/types";
1
+ export type { CursorInfo, KittyPlacement, RenderState, SearchStatus, SearchViewportMatch, ResttyWasmExports, ResttyWasmOptions, WasmAbi, WasmAbiKind, } from "./runtime/types";
2
2
  export { ResttyWasm, loadResttyWasm } from "./runtime/restty-wasm";
@@ -1,4 +1,4 @@
1
- import type { KittyPlacement, RenderState, ResttyWasmExports, ResttyWasmOptions, WasmAbi } from "./types";
1
+ import type { KittyPlacement, RenderState, ResttyWasmExports, ResttyWasmOptions, SearchStatus, SearchViewportMatch, WasmAbi } from "./types";
2
2
  /** WASM terminal core runtime with memory management and typed array caching. */
3
3
  export declare class ResttyWasm {
4
4
  readonly exports: ResttyWasmExports;
@@ -25,6 +25,20 @@ export declare class ResttyWasm {
25
25
  drainOutput(handle: number): string;
26
26
  /** Get active Kitty keyboard protocol flags. */
27
27
  getKittyKeyboardFlags(handle: number): number;
28
+ /** Set the active terminal search query. */
29
+ setSearchQuery(handle: number, query: string): void;
30
+ /** Clear the active terminal search query and results. */
31
+ clearSearch(handle: number): void;
32
+ /** Advance terminal search work by a bounded budget. */
33
+ stepSearch(handle: number, budget: number): void;
34
+ /** Select the next search match. */
35
+ searchNext(handle: number): void;
36
+ /** Select the previous search match. */
37
+ searchPrevious(handle: number): void;
38
+ /** Get the current terminal search status. */
39
+ getSearchStatus(handle: number): SearchStatus;
40
+ /** Get visible search-highlight spans for the current viewport. */
41
+ getSearchViewportMatches(handle: number): SearchViewportMatch[];
28
42
  /** Get all active Kitty graphics placements. */
29
43
  getKittyPlacements(handle: number): KittyPlacement[];
30
44
  /** Write text to terminal for processing. */
@@ -19,6 +19,22 @@ export type CursorInfo = {
19
19
  wideTail: number;
20
20
  color: number;
21
21
  };
22
+ /** Search status snapshot from the WASM terminal core. */
23
+ export type SearchStatus = {
24
+ active: boolean;
25
+ pending: boolean;
26
+ complete: boolean;
27
+ generation: number;
28
+ totalMatches: number;
29
+ selectedIndex: number | null;
30
+ };
31
+ /** Visible search-highlight span in viewport coordinates. */
32
+ export type SearchViewportMatch = {
33
+ row: number;
34
+ startCol: number;
35
+ endCol: number;
36
+ selected: boolean;
37
+ };
22
38
  /** Kitty graphics protocol image placement descriptor. */
23
39
  export type KittyPlacement = {
24
40
  imageId: number;
@@ -125,12 +141,6 @@ export type ResttyWasmExports = WebAssembly.Exports & {
125
141
  restty_link_buffer_len?: (handle: number) => number;
126
142
  restty_active_cursor_x?: (handle: number) => number;
127
143
  restty_active_cursor_y?: (handle: number) => number;
128
- restty_debug_scroll_left?: (handle: number) => number;
129
- restty_debug_scroll_right?: (handle: number) => number;
130
- restty_debug_term_cols?: (handle: number) => number;
131
- restty_debug_term_rows?: (handle: number) => number;
132
- restty_debug_page_cols?: (handle: number) => number;
133
- restty_debug_page_rows?: (handle: number) => number;
134
144
  restty_output_ptr?: (handle: number) => number;
135
145
  restty_output_len?: (handle: number) => number;
136
146
  restty_output_consume?: (handle: number, len: number) => number;
@@ -138,6 +148,14 @@ export type ResttyWasmExports = WebAssembly.Exports & {
138
148
  restty_kitty_placement_stride?: () => number;
139
149
  restty_kitty_placement_count?: (handle: number) => number;
140
150
  restty_kitty_placements_ptr?: (handle: number) => number;
151
+ restty_search_set_query?: (handle: number, ptr: number, len: number) => number;
152
+ restty_search_clear?: (handle: number) => number;
153
+ restty_search_step?: (handle: number, budget: number) => number;
154
+ restty_search_status_ptr?: (handle: number) => number;
155
+ restty_search_viewport_match_count?: (handle: number) => number;
156
+ restty_search_viewport_matches_ptr?: (handle: number) => number;
157
+ restty_search_select_next?: (handle: number) => number;
158
+ restty_search_select_prev?: (handle: number) => number;
141
159
  };
142
160
  /** Construction options for WASM runtime. */
143
161
  export type ResttyWasmOptions = {
@@ -0,0 +1,2 @@
1
+ import type { ResttyConfig } from "../surface/restty";
2
+ export declare function createCompatServicesConfig(userServicesConfig: ResttyConfig["services"], emitData: (data: string) => void): ResttyConfig["services"];
package/dist/xterm.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type Restty, type ResttyOptions } from "./surface/restty";
1
+ import { type Restty, type ResttyConfig } from "./surface/restty";
2
2
  export type IDisposable = {
3
3
  dispose: () => void;
4
4
  };
@@ -20,7 +20,7 @@ export type TerminalAddon = {
20
20
  * Additional unknown keys are accepted for migration ergonomics and kept in
21
21
  * the terminal option bag, but are not forwarded to restty internals.
22
22
  */
23
- export type TerminalOptions = Omit<ResttyOptions, "root"> & {
23
+ export type TerminalOptions = Omit<ResttyConfig, "root"> & {
24
24
  cols?: number;
25
25
  rows?: number;
26
26
  [key: string]: unknown;
@@ -32,7 +32,8 @@ export type TerminalOptions = Omit<ResttyOptions, "root"> & {
32
32
  */
33
33
  export declare class Terminal {
34
34
  private readonly resttyOptionsBase;
35
- private readonly userAppOptions;
35
+ private readonly userTerminalConfig;
36
+ private readonly userServicesConfig;
36
37
  private readonly addons;
37
38
  private readonly pendingOutput;
38
39
  private readonly dataListeners;
package/dist/xterm.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import {
2
2
  createRestty
3
- } from "./chunk-meqn8xtd.js";
3
+ } from "./chunk-wdme6j9c.js";
4
+ import"./chunk-y6hfk43b.js";
5
+ import"./chunk-db9dt7pr.js";
6
+ import"./chunk-s26trws6.js";
4
7
 
5
- // src/xterm/app-options.ts
6
- function createCompatAppOptions(userAppOptions, emitData) {
8
+ // src/xterm/compat-services.ts
9
+ function createCompatServicesConfig(userServicesConfig, emitData) {
7
10
  return (context) => {
8
- const resolved = typeof userAppOptions === "function" ? userAppOptions(context) : userAppOptions ?? {};
11
+ const resolved = typeof userServicesConfig === "function" ? userServicesConfig(context) : userServicesConfig ?? {};
9
12
  const userBeforeInput = resolved.beforeInput;
10
13
  return {
11
14
  ...resolved,
@@ -53,7 +56,8 @@ function emitWithGuard(bucket, payload, label) {
53
56
  // src/xterm.ts
54
57
  class Terminal {
55
58
  resttyOptionsBase;
56
- userAppOptions;
59
+ userTerminalConfig;
60
+ userServicesConfig;
57
61
  addons = new Set;
58
62
  pendingOutput = [];
59
63
  dataListeners = new Set;
@@ -67,9 +71,10 @@ class Terminal {
67
71
  cols;
68
72
  rows;
69
73
  constructor(options = {}) {
70
- const { cols, rows, appOptions, ...resttyOptionsBase } = options;
74
+ const { cols, rows, terminal, services, ...resttyOptionsBase } = options;
71
75
  this.resttyOptionsBase = resttyOptionsBase;
72
- this.userAppOptions = appOptions;
76
+ this.userTerminalConfig = terminal;
77
+ this.userServicesConfig = services;
73
78
  this.optionValues = { ...options };
74
79
  delete this.optionValues.cols;
75
80
  delete this.optionValues.rows;
@@ -105,7 +110,8 @@ class Terminal {
105
110
  this.elementRef = parent;
106
111
  this.resttyInstance = createRestty({
107
112
  ...this.resttyOptionsBase,
108
- appOptions: createCompatAppOptions(this.userAppOptions, (data) => {
113
+ terminal: this.userTerminalConfig,
114
+ services: createCompatServicesConfig(this.userServicesConfig, (data) => {
109
115
  emitWithGuard(this.dataListeners, data, "onData");
110
116
  }),
111
117
  root: parent
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "restty",
3
- "version": "0.1.34",
3
+ "version": "0.2.0",
4
4
  "description": "Browser terminal rendering library powered by WASM, WebGPU/WebGL2, and TypeScript text shaping.",
5
5
  "keywords": [
6
- "terminal",
7
- "terminal-emulator",
8
- "tty",
9
6
  "ansi",
10
- "vt",
7
+ "font-shaping",
11
8
  "ghostty",
12
- "webgpu",
13
- "webgl2",
14
- "wasm",
9
+ "terminal",
10
+ "terminal-emulator",
15
11
  "text-shaper",
16
12
  "text-shaping",
13
+ "tty",
14
+ "typescript",
17
15
  "unicode",
18
- "font-shaping",
19
- "typescript"
16
+ "vt",
17
+ "wasm",
18
+ "webgl2",
19
+ "webgpu"
20
20
  ],
21
- "repository": {
22
- "type": "git",
23
- "url": "https://github.com/wiedymi/restty"
24
- },
21
+ "homepage": "https://github.com/wiedymi/restty#readme",
25
22
  "bugs": {
26
23
  "url": "https://github.com/wiedymi/restty/issues"
27
24
  },
28
- "homepage": "https://github.com/wiedymi/restty#readme",
29
25
  "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/wiedymi/restty"
29
+ },
30
30
  "files": [
31
31
  "dist",
32
32
  "README.md",
@@ -47,10 +47,30 @@
47
47
  "import": "./dist/internal.js",
48
48
  "default": "./dist/internal.js"
49
49
  },
50
+ "./internal/runtime": {
51
+ "types": "./dist/internal/runtime.d.ts",
52
+ "import": "./dist/internal/runtime.js",
53
+ "default": "./dist/internal/runtime.js"
54
+ },
55
+ "./internal/surface": {
56
+ "types": "./dist/internal/surface.d.ts",
57
+ "import": "./dist/internal/surface.js",
58
+ "default": "./dist/internal/surface.js"
59
+ },
50
60
  "./xterm": {
51
61
  "types": "./dist/xterm.d.ts",
52
62
  "import": "./dist/xterm.js",
53
63
  "default": "./dist/xterm.js"
64
+ },
65
+ "./headless": {
66
+ "types": "./dist/headless.d.ts",
67
+ "import": "./dist/headless.js",
68
+ "default": "./dist/headless.js"
69
+ },
70
+ "./esm": {
71
+ "types": "./dist/index.d.ts",
72
+ "import": "./dist/restty.esm.js",
73
+ "default": "./dist/restty.esm.js"
54
74
  }
55
75
  },
56
76
  "scripts": {
@@ -59,10 +79,11 @@
59
79
  "build:themes": "bun run scripts/generate-builtin-themes.ts",
60
80
  "build:wasm": "bun run scripts/build-wasm.ts",
61
81
  "build:lib": "bun run scripts/build-lib.ts",
82
+ "build:esm": "bun run scripts/build-esm.ts",
62
83
  "build:types": "tsc -p tsconfig.build.json",
63
- "build": "bun run build:themes && bun run clean:dist && bun run build:lib && bun run build:types",
64
- "build:playground-app": "bun run playground/build-playground-app.ts",
65
- "build:assets": "bun run build:playground-app",
84
+ "build": "bun run build:themes && bun run clean:dist && bun run build:lib && bun run build:esm && bun run build:types",
85
+ "playground:build": "bunx vite build --config playground/vite.config.ts",
86
+ "pages:build": "bun run playground:build",
66
87
  "check:themes": "bun run build:themes && git diff --exit-code -- src/theme/builtin-themes.ts",
67
88
  "lint": "oxlint src playground scripts tests",
68
89
  "format:base": "oxfmt src --config .oxfmtrc.json --ignore-path .gitignore --ignore-path .oxfmtignore",
@@ -71,19 +92,33 @@
71
92
  "prepublishOnly": "bun run build",
72
93
  "test": "bun test ./tests",
73
94
  "test:ci": "bun test $(find tests -name '*.test.ts' ! -name 'webgpu-glyph.test.ts' | sort)",
74
- "pty": "bun run playground/pty-server.ts",
75
95
  "playground": "bun run scripts/playground-dev.ts",
76
- "playground:static": "bun run playground/server.ts"
96
+ "playground:pty": "bun run playground/pty-server.ts",
97
+ "playground:preview": "bun run playground/server.ts"
77
98
  },
78
99
  "dependencies": {
79
- "text-shaper": "^0.1.18"
100
+ "text-shaper": "0.1.23"
80
101
  },
81
102
  "devDependencies": {
82
- "@webcontainer/api": "^1.6.1",
103
+ "@tailwindcss/vite": "^4.2.4",
104
+ "@types/mdx": "^2.0.13",
105
+ "@types/react": "^19.2.14",
106
+ "@types/react-dom": "^19.2.3",
107
+ "@vitejs/plugin-react": "^6.0.1",
108
+ "@webcontainer/api": "^1.6.4",
83
109
  "@webgpu/types": "^0.1.69",
84
- "oxfmt": "^0.28.0",
85
- "oxlint": "^1.19.0",
110
+ "fumadocs-core": "^16.8.7",
111
+ "fumadocs-mdx": "^14.3.2",
112
+ "fumadocs-ui": "^16.8.7",
113
+ "just-bash": "^2.14.4",
114
+ "oxfmt": "^0.47.0",
115
+ "oxlint": "^1.62.0",
116
+ "react": "^19.2.5",
117
+ "react-dom": "^19.2.5",
118
+ "react-router": "^7.14.2",
119
+ "tailwindcss": "^4.2.4",
86
120
  "typescript": "^5.9.3",
121
+ "vite": "^8.0.10",
87
122
  "wgpu-polyfill": "^0.1.0"
88
123
  },
89
124
  "engines": {