@ai-ecoverse/slicc-spectrum 1.86.2 → 1.86.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # slicc-spectrum
2
2
 
3
3
  Web components for SLICC: `<slicc-terminal>`, and SLICC's app UI on [Spectrum Web Components](https://opensource.adobe.com/spectrum-web-components/) (see [UI](#ui)).
4
- `<slicc-terminal>` is a terminal built on [wterm](https://github.com/vercel-labs/wterm) (`@wterm/dom` 0.5.4, Zig/WASM VT core) that talks to [`@ai-ecoverse/slicc-kernel`](https://github.com/ai-ecoverse/slicc-kernel) through a small backend interface.
4
+ `<slicc-terminal>` is a terminal built on [wterm](https://github.com/vercel-labs/wterm) (`@wterm/dom` 0.5.4 on the Ghostty VT core, `@wterm/ghostty` 0.5.4) that talks to [`@ai-ecoverse/slicc-kernel`](https://github.com/ai-ecoverse/slicc-kernel) through a small backend interface.
5
5
  It is a standards custom element with no framework and no shadow root, so it can move to a shared web-components repo unchanged.
6
6
 
7
7
  ```html
@@ -27,6 +27,7 @@ Setting it closes the current session and opens a new one.
27
27
 
28
28
  Fixed grid size.
29
29
  Without either, the grid fits the element and follows its size.
30
+ When the width changes, soft-wrapped lines reflow to it, on the screen and in the scrollback, with their colours and attributes; lines that ended in a newline stay as they are.
30
31
 
31
32
  ### `ready`
32
33
 
@@ -64,7 +65,8 @@ Sends `SIGINT`, `SIGTSTP`, `SIGQUIT` or `SIGHUP` to the backend.
64
65
 
65
66
  ### `readText()`
66
67
 
67
- Resolves with the text of the scrollback and the screen.
68
+ Resolves with the text of the scrollback and the screen, with soft-wrapped lines joined into one.
69
+ The scrollback keeps 4 MB of cells, about 3,500 lines at 80 columns and 1,200 at 200.
68
70
 
69
71
  ### `focus()`
70
72
 
@@ -143,8 +145,8 @@ The stylesheet (wterm's plus the theme) is constructed once per document and ado
143
145
 
144
146
  ## Distribution
145
147
 
146
- `npm run build` writes `dist/slicc-terminal.js` (one ESM bundle with no bare imports), its source map and `dist/wterm.wasm`.
147
- The bundle loads the WASM with `new URL('./wterm.wasm', import.meta.url)`, so `dist/` works from any path, including from OPFS through the slicc-bios service worker. wterm's base64-inlined copy of the WASM is left out of the bundle.
148
+ `npm run build` writes `dist/slicc-terminal.js` (one ESM bundle with no bare imports), its source map and `dist/ghostty-vt.wasm` (Ghostty's VT core, about 580 kB; it replaced the 27 kB `dist/wterm.wasm` of wterm's built-in core).
149
+ The bundle loads the WASM with `new URL('./ghostty-vt.wasm', import.meta.url)`, so `dist/` works from any path, including from OPFS through the slicc-bios service worker. It is fetched once per page and compiled once per URL, streaming when it is served as `application/wasm`, and each terminal gets its own instance. wterm's base64-inlined copy of its built-in WASM is left out of the bundle.
148
150
  TypeScript declarations go to `dist/types/`, and the package's `types` export points at them.
149
151
  Set `SliccTerminal.wasmUrl` before the first element connects to load it from elsewhere.
150
152
  `dist/swc.css` (exported as `@ai-ecoverse/slicc-spectrum/swc.css`) is the pinned `@adobe/spectrum-wc` stylesheet with its tokens inlined, one file with no `@import`.
@@ -154,8 +156,14 @@ A page that puts a UI element straight into the document, such as a guest's page
154
156
 
155
157
  Things found while building this against wterm 0.5.4, recorded here, not pushed upstream:
156
158
 
157
- - The Zig core maps 24-bit colours (`38;2;r;g;b`) to the nearest of the 256 palette colours, and the DOM renderer draws the 6×6×6 cube in steps of 51 rather than xterm's 0/95/135/175/215/255.
158
- `@wterm/ghostty` is the full-VT alternative.
159
+ - The built-in Zig core doesn't reflow: on a resize it cuts or pads each row and keeps no soft-wrap flags (its bridge has no `getRowMetadata`), so a line wrapped at 45 columns stays on two rows at 120, and `readText()` and copy split it.
160
+ It also maps 24-bit colours (`38;2;r;g;b`) to the nearest of the 256 palette colours.
161
+ The element runs on `@wterm/ghostty` instead, which reflows on resize, keeps wrap flags in the scrollback and renders 24-bit and 256 colours exactly (xterm's 0/95/135/175/215/255 cube).
162
+ - Ghostty resolves palette colours 0–15 to RGB inside the WASM, so wterm's `--term-color-N` variables (and `--slicc-terminal-color-N`) would stop applying.
163
+ The element gives the core a palette of 16 marker colours (`#51cc00` … `#51cc0f`) and maps cells in those colours back to palette indexes, so the CSS variables theme them and follow a theme switch, in the scrollback too. Text drawn in exactly one of those 24-bit colours shows in the theme's palette colour instead.
164
+ - Ghostty answers OSC 10 and OSC 11 queries itself, with the colours it was loaded with. The element drops those replies and answers from the theme it shows.
165
+ - Ghostty's `scrollbackLimit` is in bytes and allocated in pages, so the number of lines it keeps depends on the width. Its default of 10,000 bytes keeps about 300 lines at 200 columns; the element asks for 4 MB.
166
+ - `WTerm.destroy()` doesn't dispose a core passed in as `core`. The element disposes it.
159
167
  - wterm sends pasted text with its `\n` line breaks unchanged, whereas xterm.js turns them into `\r`. The element does that conversion itself.
160
168
  - `@wterm/core` always ships the WASM inlined as base64 behind a dynamic import. A build without it, or an explicit entry point that takes a URL, would save the bundler plugin.
161
169
  - wterm focuses its input when it finishes mounting. `<slicc-terminals>` hands focus back to where it was unless the terminal was focused on purpose.
@@ -514,7 +522,7 @@ With `guests` and no `network`, it shows only the Guests section (no connection,
514
522
 
515
523
  #### `<slicc-tray>`
516
524
 
517
- The tray items in the header, each opening a panel when that panel is in `panels`: the connection (`#chip`, a status light with the float's name and followers, `data-surface="network"`) opens Network at its **Sync** section, and the budget (`#usage`, `data-surface="monitor"`) opens the Monitor.
525
+ The tray items in the header, each opening a panel when that panel is in `panels`: the connection (`#chip`, a status light with the float's name and followers, `data-surface="network"`, neutral and labelled "…, can’t follow" while the follow is `refused` and `connected`, exactly when the follow light reads "Can’t follow") opens Network at its **Sync** section, and the budget (`#usage`, `data-surface="monitor"`) opens the Monitor.
518
526
  Without the panel an item is a plain status with its label.
519
527
 
520
528
  #### `<slicc-confirm>`