restty 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -1
- package/dist/{chunk-68qdtczc.js → chunk-y290zh3e.js} +11469 -7848
- package/dist/fonts/index.d.ts +4 -1
- package/dist/fonts/manager/classification.d.ts +13 -0
- package/dist/fonts/manager/entries.d.ts +13 -0
- package/dist/fonts/manager/picker.d.ts +6 -0
- package/dist/fonts/manager/sources.d.ts +16 -0
- package/dist/fonts/types.d.ts +20 -10
- package/dist/grid/grid.d.ts +5 -3
- package/dist/ime/ime.d.ts +13 -0
- package/dist/index.d.ts +3 -3
- package/dist/input/keymap/before-input.d.ts +4 -0
- package/dist/input/keymap/constants.d.ts +13 -0
- package/dist/input/keymap/control.d.ts +2 -0
- package/dist/input/keymap/default-mapping.d.ts +1 -0
- package/dist/input/keymap/kitty.d.ts +1 -0
- package/dist/input/keymap/normalization.d.ts +4 -0
- package/dist/input/keymap/pty-map.d.ts +4 -0
- package/dist/input/keymap.d.ts +2 -11
- package/dist/input/output/csi.d.ts +33 -0
- package/dist/input/{output.d.ts → output/index.d.ts} +3 -9
- package/dist/input/output/osc.d.ts +15 -0
- package/dist/input/output/prompt.d.ts +11 -0
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +13 -150
- package/dist/renderer/index.d.ts +7 -2
- package/dist/renderer/shaders/glyph-gl.d.ts +4 -0
- package/dist/renderer/{shaders.d.ts → shaders/glyph-wgsl.d.ts} +0 -10
- package/dist/renderer/shaders/rect.d.ts +6 -0
- package/dist/renderer/shapes/block-elements.d.ts +3 -0
- package/dist/renderer/shapes/box-drawing/dashed-lines.d.ts +3 -0
- package/dist/renderer/shapes/box-drawing/diagonal.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/draw-box-drawing.d.ts +6 -0
- package/dist/renderer/shapes/box-drawing/fallback.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/mapped.d.ts +2 -0
- package/dist/renderer/shapes/box-drawing/rounded-corner.d.ts +2 -0
- package/dist/renderer/shapes/braille.d.ts +3 -0
- package/dist/renderer/shapes/classify.d.ts +18 -0
- package/dist/renderer/shapes/geometry.d.ts +9 -0
- package/dist/renderer/shapes/glyph-box.d.ts +7 -0
- package/dist/renderer/shapes/powerline.d.ts +3 -0
- package/dist/renderer/shapes/types.d.ts +38 -0
- package/dist/renderer/shapes.d.ts +8 -81
- package/dist/renderer/webgpu/buffers.d.ts +7 -0
- package/dist/renderer/webgpu/setup.d.ts +10 -0
- package/dist/renderer/webgpu/state.d.ts +15 -0
- package/dist/renderer/webgpu/webgl.d.ts +3 -0
- package/dist/restty.js +1 -1
- package/dist/{app → runtime}/atlas-builder.d.ts +53 -18
- package/dist/runtime/codepoint-utils.d.ts +12 -0
- package/dist/runtime/create-app-io-utils.d.ts +9 -0
- package/dist/runtime/create-app-symbols.d.ts +11 -0
- package/dist/runtime/create-app-types.d.ts +72 -0
- package/dist/runtime/create-runtime/atlas-debug-utils.d.ts +5 -0
- package/dist/runtime/create-runtime/blend-utils.d.ts +11 -0
- package/dist/runtime/create-runtime/color-glyph-atlas.d.ts +11 -0
- package/dist/runtime/create-runtime/debug-tools/create-dump-glyph-render.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/diagnose-codepoint.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/dump-atlas-for-codepoint.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/read-texture-to-image-data.d.ts +1 -0
- package/dist/runtime/create-runtime/debug-tools/setup-debug-expose.d.ts +2 -0
- package/dist/runtime/create-runtime/debug-tools/types.d.ts +63 -0
- package/dist/runtime/create-runtime/debug-tools.d.ts +6 -0
- package/dist/runtime/create-runtime/font-runtime-grid-helpers.d.ts +39 -0
- package/dist/runtime/create-runtime/font-runtime-helpers.d.ts +20 -0
- package/dist/runtime/create-runtime/font-runtime-helpers.types.d.ts +108 -0
- package/dist/runtime/create-runtime/font-runtime-text-helpers.d.ts +21 -0
- package/dist/runtime/create-runtime/font-runtime-webgpu-atlas.d.ts +26 -0
- package/dist/runtime/create-runtime/format-utils.d.ts +2 -0
- package/dist/runtime/create-runtime/input-hooks.d.ts +12 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-ime-events.d.ts +12 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-aux-handlers.d.ts +28 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-events.d.ts +41 -0
- package/dist/runtime/create-runtime/interaction-runtime/bind-pointer-up-handler.d.ts +28 -0
- package/dist/runtime/create-runtime/interaction-runtime/kitty-image-cache.d.ts +18 -0
- package/dist/runtime/create-runtime/interaction-runtime/kitty-overlay-runtime.d.ts +15 -0
- package/dist/runtime/create-runtime/interaction-runtime/scrollbar-runtime.d.ts +30 -0
- package/dist/runtime/create-runtime/interaction-runtime/types.d.ts +110 -0
- package/dist/runtime/create-runtime/interaction-runtime.d.ts +3 -0
- package/dist/runtime/create-runtime/kitty-overlay-utils.d.ts +26 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size-canvas.d.ts +13 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size-theme.d.ts +6 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size.d.ts +16 -0
- package/dist/runtime/create-runtime/lifecycle-theme-size.types.d.ts +85 -0
- package/dist/runtime/create-runtime/pty-input-runtime.d.ts +45 -0
- package/dist/runtime/create-runtime/render-tick-webgl-context.d.ts +4 -0
- package/dist/runtime/create-runtime/render-tick-webgl-glyph-pipeline.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl-overlays.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl-scene.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgl.d.ts +3 -0
- package/dist/runtime/create-runtime/render-tick-webgl.types.d.ts +162 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-cell-pass.d.ts +25 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-draw-pass.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-emit-glyphs.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu-overlays-atlas.d.ts +2 -0
- package/dist/runtime/create-runtime/render-tick-webgpu.d.ts +3 -0
- package/dist/runtime/create-runtime/render-tick-webgpu.types.d.ts +386 -0
- package/dist/runtime/create-runtime/render-ticks.d.ts +9 -0
- package/dist/runtime/create-runtime/runtime-app-api.d.ts +103 -0
- package/dist/runtime/create-runtime/runtime-logger.d.ts +17 -0
- package/dist/runtime/create-runtime/runtime-reporting.d.ts +40 -0
- package/dist/runtime/create-runtime/shader-stage-runtime.d.ts +29 -0
- package/dist/runtime/create-runtime.d.ts +7 -0
- package/dist/runtime/font-atlas-utils/bitmap-utils.d.ts +5 -0
- package/dist/runtime/font-atlas-utils/glyph-atlas-builder.d.ts +29 -0
- package/dist/runtime/font-atlas-utils/nerd-metrics-utils.d.ts +25 -0
- package/dist/runtime/font-atlas-utils/packing-utils.d.ts +13 -0
- package/dist/runtime/overlay-scrollbar.d.ts +24 -0
- package/dist/runtime/pty-output-buffer.d.ts +12 -0
- package/dist/runtime/render-color-utils.d.ts +6 -0
- package/dist/runtime/render-stage-runtime.d.ts +18 -0
- package/dist/runtime/render-stage-shaders.d.ts +6 -0
- package/dist/runtime/shader-stages.d.ts +9 -0
- package/dist/runtime/text-decoration.d.ts +4 -0
- package/dist/{app → runtime}/types.d.ts +36 -0
- package/dist/selection/clipboard.d.ts +4 -0
- package/dist/selection/{selection.d.ts → core.d.ts} +0 -11
- package/dist/selection/index.d.ts +3 -1
- package/dist/selection/text.d.ts +8 -0
- package/dist/surface/app-factory.d.ts +3 -0
- package/dist/{app → surface}/pane-app-manager.d.ts +2 -2
- package/dist/surface/panes/default-context-menu-items.d.ts +8 -0
- package/dist/surface/panes/layout.d.ts +9 -0
- package/dist/surface/panes/manager.d.ts +2 -0
- package/dist/surface/panes/pane-interactions.d.ts +11 -0
- package/dist/surface/panes/window-events.d.ts +10 -0
- package/dist/{app → surface}/panes-types.d.ts +1 -1
- package/dist/surface/restty/active-pane-api.d.ts +23 -0
- package/dist/surface/restty/manager-options.d.ts +24 -0
- package/dist/surface/restty/pane-ops.d.ts +42 -0
- package/dist/surface/restty/plugin-dispatcher.d.ts +39 -0
- package/dist/surface/restty/plugin-ops.d.ts +24 -0
- package/dist/surface/restty/shader-ops.d.ts +27 -0
- package/dist/surface/restty-pane-handle.d.ts +70 -0
- package/dist/surface/restty-plugin-runtime.d.ts +57 -0
- package/dist/surface/restty-plugin-types.d.ts +164 -0
- package/dist/surface/restty-plugin-utils.d.ts +22 -0
- package/dist/surface/restty.d.ts +93 -0
- package/dist/utils/base64.d.ts +12 -0
- package/dist/wasm/index.d.ts +2 -1
- package/dist/wasm/runtime/abi.d.ts +7 -0
- package/dist/wasm/runtime/kitty.d.ts +2 -0
- package/dist/wasm/runtime/render-state.d.ts +2 -0
- package/dist/wasm/runtime/restty-wasm.d.ts +42 -0
- package/dist/wasm/{runtime.d.ts → runtime/types.d.ts} +48 -41
- package/dist/wasm/runtime/view-cache.d.ts +4 -0
- package/dist/xterm/app-options.d.ts +2 -0
- package/dist/xterm/dimensions.d.ts +1 -0
- package/dist/xterm/listeners.d.ts +5 -0
- package/dist/xterm.d.ts +1 -6
- package/dist/xterm.js +61 -63
- package/package.json +1 -1
- package/dist/app/index.d.ts +0 -9
- package/dist/app/panes.d.ts +0 -15
- package/dist/app/restty.d.ts +0 -340
- package/dist/fonts/manager.d.ts +0 -45
- package/dist/renderer/webgpu.d.ts +0 -33
- package/dist/restty-input.d.ts +0 -1
- /package/dist/{app → runtime}/clipboard-paste.d.ts +0 -0
- /package/dist/{app → runtime}/font-sources.d.ts +0 -0
- /package/dist/{app → runtime}/session.d.ts +0 -0
- /package/dist/{app → surface}/panes-context-menu.d.ts +0 -0
- /package/dist/{app → surface}/panes-styles.d.ts +0 -0
package/README.md
CHANGED
|
@@ -173,10 +173,23 @@ const metricsPlugin: ResttyPlugin = {
|
|
|
173
173
|
const lifecycle = ctx.addLifecycleHook(({ phase, action }) => {
|
|
174
174
|
console.log("lifecycle", phase, action);
|
|
175
175
|
});
|
|
176
|
+
const stage = ctx.addRenderStage({
|
|
177
|
+
id: "metrics/tint",
|
|
178
|
+
mode: "after-main",
|
|
179
|
+
uniforms: [0.12],
|
|
180
|
+
shader: {
|
|
181
|
+
wgsl: `
|
|
182
|
+
fn resttyStage(color: vec4f, uv: vec2f, time: f32, params0: vec4f, params1: vec4f) -> vec4f {
|
|
183
|
+
return vec4f(min(vec3f(1.0), color.rgb + vec3f(params0.x, 0.0, 0.0)), color.a);
|
|
184
|
+
}
|
|
185
|
+
`,
|
|
186
|
+
},
|
|
187
|
+
});
|
|
176
188
|
return () => {
|
|
177
189
|
paneCreated.dispose();
|
|
178
190
|
outgoing.dispose();
|
|
179
191
|
lifecycle.dispose();
|
|
192
|
+
stage.dispose();
|
|
180
193
|
};
|
|
181
194
|
},
|
|
182
195
|
};
|
|
@@ -199,6 +212,50 @@ await restty.loadPlugins(
|
|
|
199
212
|
|
|
200
213
|
See `docs/plugins.md` for full plugin authoring details.
|
|
201
214
|
|
|
215
|
+
### Shader stages
|
|
216
|
+
|
|
217
|
+
Shader stages let you extend the final frame pipeline with WGSL/GLSL passes.
|
|
218
|
+
|
|
219
|
+
Global stages:
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
restty.setShaderStages([
|
|
223
|
+
{
|
|
224
|
+
id: "app/crt-lite",
|
|
225
|
+
mode: "after-main",
|
|
226
|
+
backend: "both",
|
|
227
|
+
uniforms: [0.24, 0.12],
|
|
228
|
+
shader: {
|
|
229
|
+
wgsl: `
|
|
230
|
+
fn resttyStage(color: vec4f, uv: vec2f, time: f32, params0: vec4f, params1: vec4f) -> vec4f {
|
|
231
|
+
let v = clamp(params0.x, 0.0, 0.8);
|
|
232
|
+
let centered = (uv - vec2f(0.5, 0.5)) * 2.0;
|
|
233
|
+
let vignette = max(0.0, 1.0 - v * dot(centered, centered));
|
|
234
|
+
return vec4f(color.rgb * vignette, color.a);
|
|
235
|
+
}
|
|
236
|
+
`,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
]);
|
|
240
|
+
|
|
241
|
+
const stage = restty.addShaderStage({
|
|
242
|
+
id: "app/mono",
|
|
243
|
+
mode: "after-main",
|
|
244
|
+
uniforms: [1.0],
|
|
245
|
+
shader: {
|
|
246
|
+
wgsl: `
|
|
247
|
+
fn resttyStage(color: vec4f, uv: vec2f, time: f32, params0: vec4f, params1: vec4f) -> vec4f {
|
|
248
|
+
let l = dot(color.rgb, vec3f(0.2126, 0.7152, 0.0722));
|
|
249
|
+
return vec4f(l * 0.12, l * 0.95, l * 0.35, color.a);
|
|
250
|
+
}
|
|
251
|
+
`,
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
stage.setEnabled(false);
|
|
256
|
+
restty.removeShaderStage("app/mono");
|
|
257
|
+
```
|
|
258
|
+
|
|
202
259
|
### xterm compatibility layer
|
|
203
260
|
|
|
204
261
|
For migration from xterm.js-style app code, use `restty/xterm`:
|
|
@@ -260,7 +317,12 @@ Active-pane convenience:
|
|
|
260
317
|
Plugin host:
|
|
261
318
|
|
|
262
319
|
- `use(plugin, options?)` / `loadPlugins(manifest, registry)` / `unuse(pluginId)` / `plugins()` / `pluginInfo(pluginId?)`
|
|
263
|
-
- plugin context supports `on(...)`, `addInputInterceptor(...)`, `addOutputInterceptor(...)`, `addLifecycleHook(...)`, `addRenderHook(...)`
|
|
320
|
+
- plugin context supports `on(...)`, `addInputInterceptor(...)`, `addOutputInterceptor(...)`, `addLifecycleHook(...)`, `addRenderHook(...)`, `addRenderStage(...)`
|
|
321
|
+
|
|
322
|
+
Shader stages:
|
|
323
|
+
|
|
324
|
+
- `setShaderStages(stages)` / `getShaderStages()`
|
|
325
|
+
- `addShaderStage(stage)` / `removeShaderStage(id)`
|
|
264
326
|
|
|
265
327
|
## Advanced / Internal Modules
|
|
266
328
|
|
|
@@ -281,6 +343,13 @@ bun run playground
|
|
|
281
343
|
|
|
282
344
|
Open `http://localhost:5173`.
|
|
283
345
|
|
|
346
|
+
## Code Layout
|
|
347
|
+
|
|
348
|
+
- `src/surface/`: public API (`Restty`), pane manager orchestration, plugin host, xterm shim.
|
|
349
|
+
- `src/runtime/`: terminal runtime/render loop implementation.
|
|
350
|
+
- `src/renderer/`, `src/input/`, `src/pty/`, `src/fonts/`, `src/theme/`, `src/wasm/`, `src/selection/`: subsystem modules.
|
|
351
|
+
- `src/app/`: compatibility re-export layer while internals are refactored.
|
|
352
|
+
|
|
284
353
|
## Repository Commands
|
|
285
354
|
|
|
286
355
|
```bash
|