@ai-ecoverse/slicc-spectrum 1.105.0 → 1.106.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 (40) hide show
  1. package/README.md +3 -2
  2. package/dist/{chunk-AL43JFHF.js → chunk-3YXDXQZ5.js} +2 -1
  3. package/dist/{chunk-2GER7OHY.js → chunk-5PG4SBJB.js} +3 -3
  4. package/dist/{chunk-UFGJPRGL.js → chunk-CGFE5O6B.js} +2 -2
  5. package/dist/{chunk-6FZ7EIP5.js → chunk-FLJ46SM3.js} +3 -3
  6. package/dist/{chunk-X2FGXM6T.js → chunk-FVYTOJDL.js} +4 -4
  7. package/dist/{chunk-6JS2SZJ5.js → chunk-FZEPUKZ6.js} +5 -5
  8. package/dist/{chunk-CEAD4W2I.js → chunk-G3Q42QJS.js} +3 -3
  9. package/dist/{chunk-EAVYCN2X.js → chunk-H4RBXSBH.js} +2 -2
  10. package/dist/{chunk-K7CQ2PRH.js → chunk-JWUFVNM7.js} +1 -1
  11. package/dist/{chunk-3HYCVQIZ.js → chunk-JYL7FSMY.js} +16 -323
  12. package/dist/{chunk-3HYCVQIZ.js.map → chunk-JYL7FSMY.js.map} +4 -4
  13. package/dist/{chunk-4LNENAB3.js → chunk-KR2QKUMB.js} +1 -1
  14. package/dist/{chunk-KIDTSHLT.js → chunk-LCUBBZNK.js} +3 -3
  15. package/dist/chunk-LNKW3HPT.js +22 -0
  16. package/dist/{chunk-GFOHPOWP.js → chunk-M3XOLR2X.js} +3 -3
  17. package/dist/chunk-M3XOLR2X.js.map +7 -0
  18. package/dist/chunk-RAC3YJAB.js +330 -0
  19. package/dist/chunk-RAC3YJAB.js.map +7 -0
  20. package/dist/{chunk-B3ZH3IZR.js → chunk-V2C2XXFY.js} +2 -2
  21. package/dist/slicc-ui.js +33083 -32993
  22. package/dist/slicc-ui.js.map +4 -4
  23. package/dist/types/app/highlight.d.ts +7 -0
  24. package/dist/types/app/markdown.d.ts +1 -0
  25. package/dist/types/app/messages.d.ts +1 -1
  26. package/dist/types/components/code-theme.d.ts +3 -2
  27. package/package.json +4 -4
  28. /package/dist/{chunk-AL43JFHF.js.map → chunk-3YXDXQZ5.js.map} +0 -0
  29. /package/dist/{chunk-2GER7OHY.js.map → chunk-5PG4SBJB.js.map} +0 -0
  30. /package/dist/{chunk-UFGJPRGL.js.map → chunk-CGFE5O6B.js.map} +0 -0
  31. /package/dist/{chunk-6FZ7EIP5.js.map → chunk-FLJ46SM3.js.map} +0 -0
  32. /package/dist/{chunk-X2FGXM6T.js.map → chunk-FVYTOJDL.js.map} +0 -0
  33. /package/dist/{chunk-6JS2SZJ5.js.map → chunk-FZEPUKZ6.js.map} +0 -0
  34. /package/dist/{chunk-CEAD4W2I.js.map → chunk-G3Q42QJS.js.map} +0 -0
  35. /package/dist/{chunk-EAVYCN2X.js.map → chunk-H4RBXSBH.js.map} +0 -0
  36. /package/dist/{chunk-K7CQ2PRH.js.map → chunk-JWUFVNM7.js.map} +0 -0
  37. /package/dist/{chunk-4LNENAB3.js.map → chunk-KR2QKUMB.js.map} +0 -0
  38. /package/dist/{chunk-KIDTSHLT.js.map → chunk-LCUBBZNK.js.map} +0 -0
  39. /package/dist/{chunk-GFOHPOWP.js.map → chunk-LNKW3HPT.js.map} +0 -0
  40. /package/dist/{chunk-B3ZH3IZR.js.map → chunk-V2C2XXFY.js.map} +0 -0
package/README.md CHANGED
@@ -274,7 +274,7 @@ When cones share a name, their accessible names and the Delete cone, Freezer and
274
274
  One thread's conversation (its `agent`, or the active agent if unset), by day.
275
275
  Files dragged anywhere over the pane (not text, links or the dock's own drags) show Spectrum's drop zone over the whole pane (`swc-dropzone[data-surface=drop]`, in its dragged state: an accent border on an opaque accent-subtle fill, so the transcript doesn't show through), with an illustrated message: an attach icon, "Drop files to attach" and what it takes ("Images, text and other files up to 25 MB each join your next message. Folders can’t be attached."); a polite status (`[data-announce=drop]`) says "Drop to attach files to your message". The zone stays while the drag crosses into the composer or another child, and goes 100 ms after the drag leaves the pane (`SliccChat.leaveAfter`), on drop and on <kbd>Esc</kbd>. A drop anywhere on the pane attaches to the composer; while there is no composer (watch-only, frozen), on a guest seat, or while the composer waits to reconnect, the pane shows no zone and still consumes the file drag (`dropEffect` `none`), so a drop never opens the file in the tab.
276
276
  A message's time shows only when it is at least two minutes newer than the last time shown, and the first one after each day separator always shows; a hidden time stays for screen readers (`time.sr` with `datetime`, or `.sr` on licks and cards), and a meta row left empty isn't rendered.
277
- User messages (with attachments and a quiet timestamp, `time.when`, by that rule; the reader's own carry no name or delivery tag, while `data-mode` and `data-delivered` still say how they went; a message from another cone, a follower or a guest says who sent it, and an agent's request carries its name and an Agent badge; a message from another agent, an agent's request or a message `from` a cone (`origin` `agent`, or `from` set without `origin` `follower` or `guest`), is `[data-remote]`: a subtle indigo bubble and a 🤖 pill on its bottom edge, `aria-hidden` since the byline names the sender; people, the reader included, never get it), assistant messages (with the time by that rule, and the model only on the first reply and whenever it changes from the previous one, `.meta .model` with the usage as its tooltip; without a model the usage is the time's tooltip, and with neither it is the reply's own (`.reply[title]`); the turn always carries the usage as its `aria-description`; the cone's name isn't repeated; Markdown with tables, task lists, quotes, code and images; thinking; tool calls, as the steps of the reply's response status (below); media galleries with images, video and audio; action cards for tools, pull requests and status; plans and checklists; inline diffs; question prompts (as decision cards, below); delegations; link previews; errors with a fix-it action, as a grey card (`.error-card[role=alert]`, `data-id` on system errors) inset by a wide margin on each side, a narrower one under 480 px: a red alert icon, the title in bold, the detail subdued and the action on the right, or under the detail below 360 px, announced as "Error: " and the title; an error with `action: 'login'` and an `account` (an `Account.id`) signs that account in: **Log in** calls `settings.connect(account)` synchronously in the click when the account is OAuth or needs no secret or fields, so a sign-in pop-up opens within the user gesture, and otherwise, or when `accounts()` doesn't have it, opens Settings at its row; the card follows the account's status from `accounts` (`data-login` is `idle`, `signing-in` or `connected`): while it is `signing-in` or `connect` is pending, **Log in** is pending and reads “Signing in…”, for an OAuth account the detail reads “Continue in the sign-in window that opened.” and, after `SliccChat.closedAfter` (20 s, since a closed window can't be detected), “Closed the sign-in window? Cancel, then Log in again.”, with **Cancel** (`data-action="cancel-login"`) when the port has `cancel`; once `connected`, the card is no longer an alert: a neutral info icon in the detail colour replaces the red one, the "Error: " prefix goes, the title reads “Signed in to {provider} again.” (the account's `provider`), the detail reads “Signed in. Retry to send it again.” (a polite status) and the button becomes **Retry**, which sends the last prompt again only when clicked; a rejected `connect` shows its message as negative help text (`[data-error=login]`), keeps **Log in** and adds a quiet **Open settings** (`data-action="settings"`) to that account; without an `account`, **Log in** opens Settings at Accounts, and watch-only and guest seats keep their gating; a content-filter stop offers **Drop the last turn**, which rewinds that turn and puts its prompt back into the composer; when the turns right before it failed too, the button reads **Drop N failed turns** and rewinds to before the first of them, putting the latest prompt back), system messages (error cards; compactions and notices, rewinds and model changes included, as full-width dividers with a line on each side, like the day: a compaction shows only its title, its `text` kept for screen readers, one that lost messages (`state: 'fallback'`, by default "Compaction failed, transcript truncated", or `discarded`, "Context discarded") an alert icon in the negative colour, and a notice its title and text on one line, `role="note"`; a divider that wraps keeps a short line on each side) and licks, SLICC's events into a cone, on every channel, on the right (`.lick-turn`): a byline with the title and the time by the two-minute rule, then a dashed box (`.lick[data-id][data-channel]`) with the text and the count (×3); emoji pills on its bottom edge (`.reactions .reaction`, `aria-hidden`, each named by its `title`) give the channel (⏰ Schedule, 🪝 Webhook, ✨ Sprinkle, …) and the outcome (👍 Allowed, 👎 Denied, also said in the box's hidden text).
277
+ User messages (with attachments and a quiet timestamp, `time.when`, by that rule; the reader's own carry no name or delivery tag, while `data-mode` and `data-delivered` still say how they went; a message from another cone, a follower or a guest says who sent it, and an agent's request carries its name and an Agent badge; a message from another agent, an agent's request or a message `from` a cone (`origin` `agent`, or `from` set without `origin` `follower` or `guest`), is `[data-remote]`: a subtle indigo bubble and a 🤖 pill on its bottom edge, `aria-hidden` since the byline names the sender; people, the reader included, never get it), assistant messages (with the time by that rule, and the model only on the first reply and whenever it changes from the previous one, `.meta .model` with the usage as its tooltip; without a model the usage is the time's tooltip, and with neither it is the reply's own (`.reply[title]`); the turn always carries the usage as its `aria-description`; the cone's name isn't repeated; Markdown with tables, task lists, quotes, code and images, fenced code highlighted like the Files view (below); thinking; tool calls, as the steps of the reply's response status (below); media galleries with images, video and audio; action cards for tools, pull requests and status; plans and checklists; inline diffs; question prompts (as decision cards, below); delegations; link previews; errors with a fix-it action, as a grey card (`.error-card[role=alert]`, `data-id` on system errors) inset by a wide margin on each side, a narrower one under 480 px: a red alert icon, the title in bold, the detail subdued and the action on the right, or under the detail below 360 px, announced as "Error: " and the title; an error with `action: 'login'` and an `account` (an `Account.id`) signs that account in: **Log in** calls `settings.connect(account)` synchronously in the click when the account is OAuth or needs no secret or fields, so a sign-in pop-up opens within the user gesture, and otherwise, or when `accounts()` doesn't have it, opens Settings at its row; the card follows the account's status from `accounts` (`data-login` is `idle`, `signing-in` or `connected`): while it is `signing-in` or `connect` is pending, **Log in** is pending and reads “Signing in…”, for an OAuth account the detail reads “Continue in the sign-in window that opened.” and, after `SliccChat.closedAfter` (20 s, since a closed window can't be detected), “Closed the sign-in window? Cancel, then Log in again.”, with **Cancel** (`data-action="cancel-login"`) when the port has `cancel`; once `connected`, the card is no longer an alert: a neutral info icon in the detail colour replaces the red one, the "Error: " prefix goes, the title reads “Signed in to {provider} again.” (the account's `provider`), the detail reads “Signed in. Retry to send it again.” (a polite status) and the button becomes **Retry**, which sends the last prompt again only when clicked; a rejected `connect` shows its message as negative help text (`[data-error=login]`), keeps **Log in** and adds a quiet **Open settings** (`data-action="settings"`) to that account; without an `account`, **Log in** opens Settings at Accounts, and watch-only and guest seats keep their gating; a content-filter stop offers **Drop the last turn**, which rewinds that turn and puts its prompt back into the composer; when the turns right before it failed too, the button reads **Drop N failed turns** and rewinds to before the first of them, putting the latest prompt back), system messages (error cards; compactions and notices, rewinds and model changes included, as full-width dividers with a line on each side, like the day: a compaction shows only its title, its `text` kept for screen readers, one that lost messages (`state: 'fallback'`, by default "Compaction failed, transcript truncated", or `discarded`, "Context discarded") an alert icon in the negative colour, and a notice its title and text on one line, `role="note"`; a divider that wraps keeps a short line on each side) and licks, SLICC's events into a cone, on every channel, on the right (`.lick-turn`): a byline with the title and the time by the two-minute rule, then a dashed box (`.lick[data-id][data-channel]`) with the text and the count (×3); emoji pills on its bottom edge (`.reactions .reaction`, `aria-hidden`, each named by its `title`) give the channel (⏰ Schedule, 🪝 Webhook, ✨ Sprinkle, …) and the outcome (👍 Allowed, 👎 Denied, also said in the box's hidden text).
278
278
  A lick with a body is a `details.lick` whose head (`summary.lick-head`, with a quiet chevron that turns when open) toggles it with a click, <kbd>Enter</kbd> or <kbd>Space</kbd>; clicking the body doesn't close it.
279
279
  A reply's tool calls are the steps of its response status (`swc-response-status[slot=status]`, `data-id` the reply's), at the top of the reply: one `swc-response-status-step` per call (`id` `run-` and the call's id, `data-tool`, `data-status`, `data-kind`, and `data-id` the message the call came from), labelled with the tool and its `title`, `active` while it runs, `complete` when done and `stopped` when it failed or was cancelled, which its label says in words (" · Failed", " · Cancelled").
280
280
  The status keeps `data-action="open-cluster"` and each step `data-action="open-run"` with `data-target` the call's id: clicking the host from script opens it, as the old strip's buttons did, and opening a step opens its status too.
@@ -1138,7 +1138,8 @@ Replay plays a longer run across ten replies, with long commands whose arguments
1138
1138
  The UI is ESM with code splitting: `slicc-ui.js`, `slicc-dummy.js` and `chunk-*.js` next to them in `dist/`, with no bare imports, so the folder can be served as plain files from OPFS. dockview's ESM build has no CSS; the build takes it from dockview's UMD bundle.
1139
1139
  `@pierre/diffs` highlights with [`@pierre/highlights`](https://diffs.com/highlights) (`preferredHighlighter: 'highlights'`), whose lexers for every language it knows are in one WebAssembly module inside `dist/`, so nothing loads from a CDN and highlighting works offline.
1140
1140
  Files in a language Highlights doesn't know (it has about 80, so not ini, dotenv, nginx or CSV, for example) show as plain text.
1141
- The themes are `slicc-light` and `slicc-dark`: Pierre Light and Pierre Dark with every syntax colour shaded until it keeps 4.5:1 contrast on the code background, on the added and deleted line tints, and on the changed-word highlights inside them.
1141
+ The themes are `slicc-light` and `slicc-dark`: Pierre Light and Pierre Dark with every syntax colour shaded until it keeps 4.5:1 contrast on the code background, on the added and deleted line tints, on the changed-word highlights inside them, and on the background of a code block in chat markdown.
1142
+ Fenced code in chat, memory and release-notes markdown (`pre.code[data-lang]`) highlights with the same highlighter and themes, tokenized straight into the `<pre>`: text nodes inside `<span style>` runs coloured with `light-dark()`, so they follow the surface's `color-scheme`, with no line numbers, so selecting a block copies exactly its source. While a reply is streaming (`markdown(text, { streaming: true })`), a block highlights once its closing fence has arrived, so it shows as plain text until then and highlights once; a fence that never closes, because the reply was cut off, highlights when the reply is no longer streaming. the WebAssembly module and themes load on the first such block, which shows as plain text until they have. A block with no language, an unknown one, `text` or over 100,000 characters stays plain text, and a line of 1,000 characters or more is one run in the text colour.
1142
1143
  Shiki stays out of `dist/`: the build replaces `shiki` and `@shikijs/*` with a module that throws.
1143
1144
  `dist/` is about 130 files and 7 MB of JavaScript.
1144
1145
  The build fails if React is bundled; `@pierre/trees` lists React as a peer dependency, so npm installs it, but the `web-components` entry runs on Preact.
@@ -374,6 +374,7 @@ export {
374
374
  c,
375
375
  e2,
376
376
  o2,
377
+ f,
377
378
  l,
378
379
  n5 as n,
379
380
  e3,
@@ -419,4 +420,4 @@ lit-html/directives/join.js:
419
420
  * SPDX-License-Identifier: BSD-3-Clause
420
421
  *)
421
422
  */
422
- //# sourceMappingURL=chunk-AL43JFHF.js.map
423
+ //# sourceMappingURL=chunk-3YXDXQZ5.js.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-ZMBN6APP.js";
10
10
  import {
11
11
  o
12
- } from "./chunk-AL43JFHF.js";
12
+ } from "./chunk-3YXDXQZ5.js";
13
13
  import {
14
14
  SpectrumElement,
15
15
  b,
@@ -146,7 +146,7 @@ var Tooltip = class extends SpectrumElement {
146
146
  <span id="tip" aria-hidden="true"></span>
147
147
  </sp-tooltip-openable>
148
148
  `;
149
- return this.selfManaged ? (this.dependencyManager.add("sp-overlay"), import("./chunk-6FZ7EIP5.js"), b`
149
+ return this.selfManaged ? (this.dependencyManager.add("sp-overlay"), import("./chunk-FLJ46SM3.js"), b`
150
150
  <sp-overlay
151
151
  ?open=${this.open && !this.disabled && this.dependencyManager.loaded}
152
152
  ?delayed=${this.delayed}
@@ -178,4 +178,4 @@ o3([n({ type: Boolean })], Tooltip.prototype, "delayed", 2), o3([n({ type: Boole
178
178
 
179
179
  // node_modules/@spectrum-web-components/tooltip/sp-tooltip.js
180
180
  defineElement("sp-tooltip", Tooltip);
181
- //# sourceMappingURL=chunk-2GER7OHY.js.map
181
+ //# sourceMappingURL=chunk-5PG4SBJB.js.map
@@ -3,7 +3,7 @@ import {
3
3
  acquireHighlighterType,
4
4
  releaseHighlighterType,
5
5
  tokensToHtml
6
- } from "./chunk-KIDTSHLT.js";
6
+ } from "./chunk-LCUBBZNK.js";
7
7
 
8
8
  // node_modules/@pierre/diffs/dist/highlighter/DiffsHighlighter.js
9
9
  var DiffsHighlighter = class {
@@ -101,4 +101,4 @@ export {
101
101
  DiffsHighlighter,
102
102
  BaseStreamTokenizer
103
103
  };
104
- //# sourceMappingURL=chunk-UFGJPRGL.js.map
104
+ //# sourceMappingURL=chunk-CGFE5O6B.js.map
@@ -3,16 +3,16 @@ import {
3
3
  } from "./chunk-6A6NIESE.js";
4
4
  import {
5
5
  Overlay
6
- } from "./chunk-6JS2SZJ5.js";
6
+ } from "./chunk-FZEPUKZ6.js";
7
7
  import "./chunk-IBQ4O4NO.js";
8
8
  import "./chunk-ZMBN6APP.js";
9
9
  import "./chunk-KD66QY2Y.js";
10
10
  import "./chunk-ZSLV7QHA.js";
11
11
  import "./chunk-2JLDRHGH.js";
12
- import "./chunk-AL43JFHF.js";
12
+ import "./chunk-3YXDXQZ5.js";
13
13
  import "./chunk-LJ5HWLFA.js";
14
14
  import "./chunk-AXQFWXYZ.js";
15
15
 
16
16
  // node_modules/@spectrum-web-components/overlay/sp-overlay.js
17
17
  defineElement("sp-overlay", Overlay);
18
- //# sourceMappingURL=chunk-6FZ7EIP5.js.map
18
+ //# sourceMappingURL=chunk-FLJ46SM3.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  BaseStreamTokenizer,
3
3
  DiffsHighlighter
4
- } from "./chunk-UFGJPRGL.js";
4
+ } from "./chunk-CGFE5O6B.js";
5
5
  import "./chunk-KIKLCSNJ.js";
6
6
  import {
7
7
  RegisteredCustomLanguages,
8
8
  attachResolvedLanguages,
9
9
  resolveLanguages
10
- } from "./chunk-B3ZH3IZR.js";
10
+ } from "./chunk-V2C2XXFY.js";
11
11
  import {
12
12
  appendItems,
13
13
  createDiffsThemeResolver
14
- } from "./chunk-KIDTSHLT.js";
14
+ } from "./chunk-LCUBBZNK.js";
15
15
  import "./chunk-NEW2Q7FF.js";
16
16
  import "./chunk-AXQFWXYZ.js";
17
17
 
@@ -654,4 +654,4 @@ var ShikiHighlighter = class ShikiHighlighter2 extends DiffsHighlighter {
654
654
  export {
655
655
  ShikiHighlighter
656
656
  };
657
- //# sourceMappingURL=chunk-X2FGXM6T.js.map
657
+ //# sourceMappingURL=chunk-FVYTOJDL.js.map
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  o as o2,
34
34
  o2 as o3
35
- } from "./chunk-AL43JFHF.js";
35
+ } from "./chunk-3YXDXQZ5.js";
36
36
  import {
37
37
  A,
38
38
  SpectrumElement,
@@ -186,7 +186,7 @@ var AbstractOverlay = class _AbstractOverlay extends SpectrumElement {
186
186
  document.dispatchEvent(e2);
187
187
  }
188
188
  static async open(e2, r3, n2, a) {
189
- await import("./chunk-6FZ7EIP5.js");
189
+ await import("./chunk-FLJ46SM3.js");
190
190
  const m = arguments.length === 2, l2 = n2 || e2, t = new this();
191
191
  let p = false;
192
192
  t.dispose = () => {
@@ -1413,9 +1413,9 @@ var InteractionController = class {
1413
1413
  return;
1414
1414
  }
1415
1415
  e2 && (customElements.whenDefined("sp-overlay").then(async () => {
1416
- const { Overlay: t } = await import("./chunk-CEAD4W2I.js");
1416
+ const { Overlay: t } = await import("./chunk-G3Q42QJS.js");
1417
1417
  this.overlay = new t(), this.overlay.open = true, this.target[lastInteractionType] = this.type;
1418
- }), import("./chunk-6FZ7EIP5.js"));
1418
+ }), import("./chunk-FLJ46SM3.js"));
1419
1419
  }
1420
1420
  }
1421
1421
  get overlay() {
@@ -1886,4 +1886,4 @@ export {
1886
1886
  LONGPRESS_INSTRUCTIONS,
1887
1887
  Overlay
1888
1888
  };
1889
- //# sourceMappingURL=chunk-6JS2SZJ5.js.map
1889
+ //# sourceMappingURL=chunk-FZEPUKZ6.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  LONGPRESS_INSTRUCTIONS,
3
3
  Overlay
4
- } from "./chunk-6JS2SZJ5.js";
4
+ } from "./chunk-FZEPUKZ6.js";
5
5
  import "./chunk-IBQ4O4NO.js";
6
6
  import "./chunk-ZMBN6APP.js";
7
7
  import "./chunk-KD66QY2Y.js";
8
8
  import "./chunk-ZSLV7QHA.js";
9
9
  import "./chunk-2JLDRHGH.js";
10
- import "./chunk-AL43JFHF.js";
10
+ import "./chunk-3YXDXQZ5.js";
11
11
  import "./chunk-LJ5HWLFA.js";
12
12
  import "./chunk-AXQFWXYZ.js";
13
13
  export {
14
14
  LONGPRESS_INSTRUCTIONS,
15
15
  Overlay
16
16
  };
17
- //# sourceMappingURL=chunk-CEAD4W2I.js.map
17
+ //# sourceMappingURL=chunk-G3Q42QJS.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-6A6NIESE.js";
4
4
  import {
5
5
  o
6
- } from "./chunk-AL43JFHF.js";
6
+ } from "./chunk-3YXDXQZ5.js";
7
7
  import {
8
8
  SpectrumElement,
9
9
  b,
@@ -231,4 +231,4 @@ export {
231
231
  * SPDX-License-Identifier: BSD-3-Clause
232
232
  *)
233
233
  */
234
- //# sourceMappingURL=chunk-EAVYCN2X.js.map
234
+ //# sourceMappingURL=chunk-H4RBXSBH.js.map
@@ -240,4 +240,4 @@ export {
240
240
  shikiThemes,
241
241
  themes
242
242
  };
243
- //# sourceMappingURL=chunk-K7CQ2PRH.js.map
243
+ //# sourceMappingURL=chunk-JWUFVNM7.js.map
@@ -1,17 +1,3 @@
1
- import {
2
- BaseStreamTokenizer,
3
- DiffsHighlighter
4
- } from "./chunk-UFGJPRGL.js";
5
- import {
6
- formatCSSVariablePrefix
7
- } from "./chunk-5RPMYYR5.js";
8
- import {
9
- appendItems,
10
- createDiffsThemeResolver
11
- } from "./chunk-KIDTSHLT.js";
12
- import "./chunk-NEW2Q7FF.js";
13
- import "./chunk-AXQFWXYZ.js";
14
-
15
1
  // node_modules/@pierre/highlights/dist/languages.js
16
2
  var languages = {
17
3
  plain: 0,
@@ -1037,6 +1023,12 @@ function init(wasm) {
1037
1023
  pooledStreamHighlighter = void 0;
1038
1024
  return shared = new HighlightsHighlighter(wasm);
1039
1025
  }
1026
+ function createHighlighter(wasmModule2 = assertWasmModule()) {
1027
+ return new HighlightsHighlighter(wasmModule2);
1028
+ }
1029
+ function codeToHtml(input, options) {
1030
+ return assertShared(input).codeToHtml(input, options);
1031
+ }
1040
1032
  function codeToTokens(input, options) {
1041
1033
  return assertShared(input).codeToTokens(input, options);
1042
1034
  }
@@ -1186,6 +1178,7 @@ var StreamTokenizer = class extends TransformStream {
1186
1178
 
1187
1179
  // node_modules/@pierre/highlights/dist/live.js
1188
1180
  var enc4 = new TextEncoder();
1181
+ var tokenNames = tokenTypes;
1189
1182
  var fatalDecoder = new TextDecoder("utf-8", {
1190
1183
  fatal: true,
1191
1184
  ignoreBOM: true
@@ -1822,314 +1815,14 @@ var highlights_wasm_default = b;
1822
1815
  // node_modules/@pierre/highlights/dist/default.js
1823
1816
  init(new WebAssembly.Module(highlights_wasm_default));
1824
1817
 
1825
- // node_modules/@pierre/diffs/dist/highlighter/highlights-editor.js
1826
- var HighlightsEditorTokenizer = class {
1827
- options;
1828
- resolveOptions;
1829
- #tokenizer;
1830
- #version;
1831
- #disposed = false;
1832
- #returnedRange;
1833
- #paused = false;
1834
- #capturedLines;
1835
- #pendingDelivery;
1836
- constructor(options, resolveOptions) {
1837
- this.options = options;
1838
- this.resolveOptions = resolveOptions;
1839
- this.#version = options.textDocument.version;
1840
- this.#tokenizer = this.#createTokenizer();
1841
- }
1842
- #createTokenizer() {
1843
- return new LiveTokenizer({
1844
- ...this.resolveOptions({
1845
- lang: this.options.textDocument.languageId,
1846
- theme: this.options.theme,
1847
- cssVariablePrefix: formatCSSVariablePrefix("token"),
1848
- tokenizeMaxLineLength: this.options.tokenizeMaxLineLength ?? 1e3
1849
- }),
1850
- code: this.options.textDocument.getText(),
1851
- renderRange: [0, 0],
1852
- onDeferTokenize: (lines) => this.#deliver(lines)
1853
- });
1854
- }
1855
- #deliver(lines) {
1856
- const captured = this.#capturedLines;
1857
- if (captured != null) {
1858
- for (const [line, tokens] of lines) captured.set(line, tokens);
1859
- return;
1860
- }
1861
- const range = this.#returnedRange;
1862
- if (range != null) {
1863
- for (const line of lines.keys()) if (line >= range[0] && line < range[1]) lines.delete(line);
1864
- if (lines.size === 0) return;
1865
- }
1866
- this.options.onDeferTokenize(lines);
1867
- }
1868
- #queueDelivery(lines) {
1869
- const pending = this.#pendingDelivery;
1870
- if (pending != null) {
1871
- for (const [line, tokens] of lines) pending.set(line, tokens);
1872
- return;
1873
- }
1874
- this.#pendingDelivery = lines;
1875
- queueMicrotask(() => {
1876
- const batch = this.#pendingDelivery;
1877
- this.#pendingDelivery = void 0;
1878
- if (batch != null && batch.size > 0 && !this.#disposed) this.options.onDeferTokenize(batch);
1879
- });
1880
- }
1881
- tokenize(change, renderRange, hostRealignsRows = false) {
1882
- const document = this.options.textDocument;
1883
- const start = Math.min(renderRange?.startingLine ?? 0, document.lineCount);
1884
- const end = Math.min(start + (renderRange?.totalLines ?? Infinity), document.lineCount);
1885
- const returnedStart = Math.max(start, change.startLine);
1886
- this.#paused = false;
1887
- let lines;
1888
- if (this.#version !== document.version) {
1889
- this.#pendingDelivery = void 0;
1890
- lines = this.#syncDocument(change, [start, end]).lines;
1891
- this.#version = document.version;
1892
- } else if (this.#tokenizer.lineCount !== document.lineCount) {
1893
- this.#pendingDelivery = void 0;
1894
- lines = this.#tokenizer.reset(document.getText(), { renderRange: [start, end] }).lines;
1895
- } else {
1896
- lines = /* @__PURE__ */ new Map();
1897
- this.#readLines(lines, returnedStart, end);
1898
- if (this.#pendingDelivery != null) for (const line of lines.keys()) this.#pendingDelivery.delete(line);
1899
- return lines;
1900
- }
1901
- if (change.lineDelta === 0 ? change.changedLineChanges?.some(([, , lineDelta]) => lineDelta !== 0) ?? false : !hostRealignsRows) this.#readLines(lines, returnedStart, end);
1902
- return lines;
1903
- }
1904
- #syncDocument(change, renderRange) {
1905
- const document = this.options.textDocument;
1906
- const options = { renderRange };
1907
- if (Math.abs(document.version - this.#version) === 1 && change.changes.length > 0 && this.#tokenizer.lineCount === change.previousLineCount) try {
1908
- const update = this.#tokenizer.applyEdits(change.changes.map(({ range, text }) => ({
1909
- range,
1910
- newText: text
1911
- })), options);
1912
- if (this.#tokenizer.lineCount === document.lineCount) return update;
1913
- } catch (error) {
1914
- if (!(error instanceof RangeError)) throw error;
1915
- }
1916
- return this.#tokenizer.reset(document.getText(), options);
1917
- }
1918
- #readLines(lines, from, to) {
1919
- this.#returnedRange = [from, to];
1920
- try {
1921
- this.#tokenizer.flush(to);
1922
- } finally {
1923
- this.#returnedRange = void 0;
1924
- }
1925
- for (let line = from; line < to; line++) {
1926
- if (lines.has(line)) continue;
1927
- const { tokens } = this.#tokenizer.getLineTokens(line);
1928
- lines.set(line, tokens.length === 0 ? [[
1929
- 0,
1930
- "",
1931
- ""
1932
- ]] : tokens.map((token) => [
1933
- token.offset,
1934
- token.color ?? "",
1935
- token.content
1936
- ]));
1937
- }
1938
- }
1939
- setTheme(themeName) {
1940
- if (themeName === this.options.theme) return;
1941
- this.options.theme = themeName;
1942
- this.#tokenizer.dispose();
1943
- this.#pendingDelivery = void 0;
1944
- this.#paused = false;
1945
- this.#version = this.options.textDocument.version;
1946
- this.#tokenizer = this.#createTokenizer();
1947
- }
1948
- getStringCommentRegexpRangesInLine(lineIndex) {
1949
- const document = this.options.textDocument;
1950
- if (this.options.matchBrackets === false || lineIndex < 0 || lineIndex >= document.lineCount) return null;
1951
- const captured = /* @__PURE__ */ new Map();
1952
- this.#capturedLines = captured;
1953
- try {
1954
- if (this.#version !== document.version || this.#tokenizer.lineCount !== document.lineCount) {
1955
- this.#pendingDelivery = void 0;
1956
- this.#tokenizer.reset(document.getText(), { renderRange: [lineIndex, lineIndex + 1] });
1957
- this.#version = document.version;
1958
- }
1959
- this.#tokenizer.flush(lineIndex + 1);
1960
- } finally {
1961
- this.#capturedLines = void 0;
1962
- if (this.#paused) this.#tokenizer.pause();
1963
- }
1964
- if (captured.size > 0) this.#queueDelivery(captured);
1965
- return this.#tokenizer.getLineTokens(lineIndex).bracketIgnoredRanges;
1966
- }
1967
- prebuildStateStack() {
1968
- }
1969
- stopBackgroundTokenize() {
1970
- this.pauseBackgroundTokenize();
1971
- }
1972
- pauseBackgroundTokenize() {
1973
- this.#paused = true;
1974
- this.#tokenizer.pause();
1975
- }
1976
- resumeBackgroundTokenize() {
1977
- this.#paused = false;
1978
- this.#tokenizer.resume();
1979
- }
1980
- dispose() {
1981
- this.#disposed = true;
1982
- this.#pendingDelivery = void 0;
1983
- this.#tokenizer.dispose();
1984
- }
1985
- };
1986
-
1987
- // node_modules/@pierre/diffs/dist/highlighter/highlights-stream.js
1988
- var TRIM_LINE_COUNT = 1024;
1989
- var DOCUMENT_START = {
1990
- line: 0,
1991
- character: 0
1992
- };
1993
- var HighlightsStreamTokenizer = class HighlightsStreamTokenizer2 extends BaseStreamTokenizer {
1994
- options;
1995
- #tokenizer;
1996
- #trimLineCount = TRIM_LINE_COUNT;
1997
- constructor(options) {
1998
- super();
1999
- this.options = options;
2000
- this.#tokenizer = new LiveTokenizer(options);
2001
- }
2002
- tokenizeChunk(chunk, stable) {
2003
- const lineBreaks = [...chunk.matchAll(/\r\n|\r|\n/g)];
2004
- const startLine = this.#tokenizer.lineCount - 1;
2005
- const position = {
2006
- line: startLine,
2007
- character: this.#tokenizer.getLineLength(startLine)
2008
- };
2009
- this.#tokenizer.applyEdits([{
2010
- range: {
2011
- start: position,
2012
- end: position
2013
- },
2014
- newText: chunk
2015
- }]);
2016
- const lastLine = this.#tokenizer.lineCount - 1;
2017
- let unstable = [];
2018
- for (let line = startLine; line <= lastLine; line++) {
2019
- const { tokens } = this.#tokenizer.getLineTokens(line);
2020
- for (const token of tokens) token.offset += this.stableOffset;
2021
- if (line < lastLine) {
2022
- appendItems(stable, tokens);
2023
- this.pushLineBreak(stable, this.#tokenizer.getLineLength(line), lineBreaks[line - startLine][0]);
2024
- } else unstable = tokens;
2025
- }
2026
- const tailLength = this.#tokenizer.getLineLength(lastLine);
2027
- if (lastLine > this.#trimLineCount) {
2028
- const text = this.#tokenizer.getText();
2029
- const { lineChanges } = this.#tokenizer.applyEdits([{
2030
- range: {
2031
- start: DOCUMENT_START,
2032
- end: {
2033
- line: lastLine - 1,
2034
- character: 0
2035
- }
2036
- },
2037
- newText: ""
2038
- }]);
2039
- if (lineChanges.every((change) => change.newEndLine <= 1)) this.#trimLineCount = TRIM_LINE_COUNT;
2040
- else {
2041
- const keptLength = this.#tokenizer.getText().length;
2042
- this.#tokenizer.applyEdits([{
2043
- range: {
2044
- start: DOCUMENT_START,
2045
- end: DOCUMENT_START
2046
- },
2047
- newText: text.slice(0, text.length - keptLength)
2048
- }]);
2049
- this.#trimLineCount = lastLine * 2;
2050
- }
2051
- }
2052
- return {
2053
- unstable,
2054
- tailLength
2055
- };
2056
- }
2057
- clone() {
2058
- this.assertActive();
2059
- const clone = new HighlightsStreamTokenizer2(this.options);
2060
- clone.#tokenizer.reset(this.#tokenizer.getText());
2061
- this.copyStateTo(clone);
2062
- return clone;
2063
- }
2064
- resetSource() {
2065
- this.#tokenizer.reset("");
2066
- this.#trimLineCount = TRIM_LINE_COUNT;
2067
- }
2068
- releaseSource() {
2069
- this.#tokenizer.dispose();
2070
- }
2071
- };
2072
-
2073
- // node_modules/@pierre/diffs/dist/highlighter/backends/highlights.js
2074
- var HighlightsHighlighter2 = class extends DiffsHighlighter {
2075
- usedThemes = /* @__PURE__ */ new Map();
2076
- constructor() {
2077
- super("highlights", createDiffsThemeResolver("highlights"));
2078
- }
2079
- getTheme(name) {
2080
- this.assertNotDisposed();
2081
- const theme = this.themeResolver.getResolvedTheme(name) ?? this.usedThemes.get(name);
2082
- if (theme == null) throw new Error(`Theme "${name}" has not been resolved`);
2083
- this.usedThemes.set(name, theme);
2084
- return theme;
2085
- }
2086
- codeToTokens(code, options) {
2087
- this.assertNotDisposed();
2088
- return codeToTokens(code, this.resolveOptions(options));
2089
- }
2090
- createEditorTokenizer(options) {
2091
- this.assertNotDisposed();
2092
- return new HighlightsEditorTokenizer(options, (tokenizerOptions) => this.resolveOptions(tokenizerOptions));
2093
- }
2094
- createStreamTokenizer(options) {
2095
- return new HighlightsStreamTokenizer(this.resolveOptions(options));
2096
- }
2097
- loadLanguages() {
2098
- this.assertNotDisposed();
2099
- return Promise.resolve();
2100
- }
2101
- hasLoadedLanguages() {
2102
- return !this.disposed;
2103
- }
2104
- attachLanguages() {
2105
- this.assertNotDisposed();
2106
- }
2107
- releaseResources() {
2108
- this.usedThemes.clear();
2109
- }
2110
- resolveOptions({ theme, themes, ...options }) {
2111
- const lang = isSupportedLanguage(options.lang) ? options.lang : "text";
2112
- if (theme != null) return {
2113
- ...options,
2114
- lang,
2115
- theme: this.getZedTheme(theme)
2116
- };
2117
- if (themes == null) throw new Error("A theme or themes option is required");
2118
- const resolved = {};
2119
- for (const [key, name] of Object.entries(themes)) resolved[key] = this.getZedTheme(name);
2120
- return {
2121
- ...options,
2122
- lang,
2123
- themes: resolved
2124
- };
2125
- }
2126
- getZedTheme(name) {
2127
- const theme = this.getTheme(name);
2128
- if (theme.zed == null) throw new Error(`Theme "${name}" does not support Highlights`);
2129
- return theme.zed;
2130
- }
2131
- };
2132
1818
  export {
2133
- HighlightsHighlighter2 as HighlightsHighlighter
1819
+ isSupportedLanguage,
1820
+ init,
1821
+ createHighlighter,
1822
+ codeToHtml,
1823
+ codeToTokens,
1824
+ StreamTokenizer,
1825
+ tokenNames,
1826
+ LiveTokenizer
2134
1827
  };
2135
- //# sourceMappingURL=chunk-3HYCVQIZ.js.map
1828
+ //# sourceMappingURL=chunk-JYL7FSMY.js.map