@ai-ecoverse/slicc-spectrum 1.27.0 → 1.27.2

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
@@ -135,7 +135,7 @@ Text is Adobe Clean Spectrum VF, falling back to Adobe Clean, and code is Spectr
135
135
  | `<slicc-dock>` | Generic. [dockview-core](https://dockview.dev/) 8 with a theme mapped to Spectrum tokens, in its own shadow root. Panels come from `factories` (`name → (params) => HTMLElement`). `open`, `close`, `has`, `content`, `focusPanel`, `cycleGroup`, `cycleTab`, `toJSON`, `restore`, `clear`, and the full `api`. Tabs have a context menu (close, close others, float, maximize). Events: `layout-change`, `active-panel-change`, `panel-close`. |
136
136
  | `<slicc-agents>` | Cones with their scoops, status, context fill and unread count. Selecting one makes it the active agent. |
137
137
  | `<slicc-chat>` | One thread's conversation (its `agent`, or the active agent if unset), by day: user messages (with attachments, tagged as steered or follow-up by `delivered`, or delegated from another cone), assistant messages (Markdown with tables, task lists, quotes, code and images; thinking; tool calls, grouped into a collapsible cluster from three in a row, each with its input (a shell command after `$`), an optional `meta` such as a timeout, and an edit's `diff` shown as a diff view; media galleries with images, video and audio; action cards for tools, pull requests and status; plans and checklists; inline diffs; question prompts; delegations; link previews; errors with a fix-it action; a content-filter stop offers **Drop the last turn**, which rewinds that turn and puts its prompt back into the composer), standalone tool results, system messages (compaction markers, error cards, notices) and licks, SLICC's events into a cone, on every channel; a lick's `severity` (`warn` or `error`) turns its channel badge into a notice or negative one with an alert icon. Permission requests are allowed or denied in place. |
138
- | `<slicc-composer>` | The message box. <kbd>Enter</kbd> sends, or steers a running reply: the message joins after the current tool round, without interrupting; <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>Enter</kbd> queues a follow-up that runs after the reply and can be withdrawn; <kbd>Shift</kbd>+<kbd>Enter</kbd> adds a line; <kbd>Tab</kbd> takes the suggested follow-up; <kbd>↑</kbd>/<kbd>↓</kbd> at the start or end walk this agent's history; <kbd>Esc</kbd> stops. `/` completes commands (`/clear`, `/compact`, `/model`, `/thinking`, `/scoop`, `/stop`, `/theme`) and their arguments, `@` mentions agents and files. Attach from the computer, from SLICC's files, a browser screenshot or a shared secret, or paste and drop files (25 MB each). Queued messages wait above it, to send now or drop. Model and thinking pickers, and dictation where the browser has speech recognition. Drafts are kept per agent. |
138
+ | `<slicc-composer>` | The message box. <kbd>Enter</kbd> sends, or steers a running reply: the message joins after the current tool round, without interrupting; <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>Enter</kbd> queues a follow-up that runs after the reply and can be withdrawn; <kbd>Shift</kbd>+<kbd>Enter</kbd> adds a line; <kbd>Tab</kbd> takes the suggested follow-up; <kbd>↑</kbd>/<kbd>↓</kbd> at the start or end walk this agent's history; <kbd>Esc</kbd> stops. `/` completes commands (`/clear`, `/compact`, `/model`, `/thinking`, `/scoop`, `/stop`, `/freeze` when the port can freeze, `/theme`) and their arguments, `@` mentions agents and files. Attach from the computer, from SLICC's files, a browser screenshot or a shared secret, or paste and drop files (25 MB each). Queued messages wait above it, to send now or drop. Model and thinking pickers, and dictation where the browser has speech recognition. Drafts are kept per agent. |
139
139
  | `<slicc-files>` | The file system as a `<slicc-file-tree>`, with pending changes as git status. Opening a file opens it in a tab. With `files.mountFolder`, **Mount a folder…** (`data-action="mount-folder"`) mounts a local folder, then selects and expands it in the tree; with `files.mounts`, a **Mounted** strip lists the mount points, each with **Eject** (`data-action="eject"`, `data-path` the mount point) when the port has `eject`. A failed mount or eject shows its message under the bar. |
140
140
  | `<slicc-file-view>` | One file (`path`), highlighted, with its pending change and a link to the diff. |
141
141
  | `<slicc-changes>` | Pending changes with their author. Opens the diff, accepts or reverts one change or all of them. |
@@ -194,7 +194,7 @@ Paths are the agent's: `/shared/…` and `/home/…`, nothing else. A refusal or
194
194
 
195
195
  | Port | Later backed by | |
196
196
  | :--- | :--- | :--- |
197
- | `agent` | `@ai-ecoverse/slicc-agent` | Cones and scoops, the active agent, conversations, `send` (with attachments, as a send, a steer or a queued follow-up) and `stop`, the queue, suggestions, answers to questions, permission decisions, compaction, clearing, the model per agent and new scoops. The optional `rewind(agentId, messageId)` drops the user turn before that message and everything after it, and resolves with the turn's prompt (text and attachments) for the composer, or `null`. The optional `drop(agentId)` removes a scoop (its files stay), and `createCone(name)` resolves with a new cone; the dummy rejects a cone name that is taken. Assistant messages stream: the same message is re-emitted as its parts grow and its tool calls go from `running` to `done`. |
197
+ | `agent` | `@ai-ecoverse/slicc-agent` | Cones and scoops, the active agent, conversations, `send` (with attachments, as a send, a steer or a queued follow-up) and `stop`, the queue, suggestions, answers to questions, permission decisions, compaction, clearing, the model per agent and new scoops. The optional `rewind(agentId, messageId)` drops the user turn before that message and everything after it, and resolves with the turn's prompt (text and attachments) for the composer, or `null`. The optional `drop(agentId)` removes a scoop (its files stay), and `createCone(name)` resolves with a new cone; the dummy rejects a cone name that is taken. `freeze(agentId)` is optional too: without it, `/freeze` and the Freezer's freeze button don't show. Assistant messages stream: the same message is re-emitted as its parts grow and its tool calls go from `running` to `done`. |
198
198
  | `files` | slicc-kernel's OPFS | `list`, `read`, `write`, `remove`, and pending changes with their before and after text (`accept`, `revert`). The optional `mountFolder()` asks for a local folder and resolves with its mount point (for example `/mnt/photos`), or `null` when the user cancels; the panel calls it synchronously in the click, so the port can call `showDirectoryPicker()`. The optional `mounts()` lists the mount points, and `eject(path)` unmounts one (the folder stays on disk). The port emits `mounts` and then `files` after every mount and eject, including those made from the shell. |
199
199
  | `terminals` | slicc-kernel's terminal API | Terminal sessions; `backend(id)` returns a `TerminalBackend` for `<slicc-terminal>`. |
200
200
  | `browser` | `@ai-ecoverse/slicc-cdp` | Tabs, the active tab, `open`, `navigate`, `close`, `screenshot`. |
package/dist/slicc-ui.js CHANGED
@@ -19929,12 +19929,13 @@ var SliccChat = class extends ThemedElement {
19929
19929
  for (const message of messages) {
19930
19930
  const label = day(message.createdAt);
19931
19931
  if (label !== previous) {
19932
- out.push(
19932
+ out.push([
19933
+ `day:${message.id}`,
19933
19934
  b`<div class="day" role="separator" data-day=${label}><span class="line"></span><span>${label}</span><span class="line"></span></div>`
19934
- );
19935
+ ]);
19935
19936
  previous = label;
19936
19937
  }
19937
- out.push(this.#message(message, agent, message === last ? suggestion : null));
19938
+ out.push([message.id, this.#message(message, agent, message === last ? suggestion : null)]);
19938
19939
  }
19939
19940
  return out;
19940
19941
  }
@@ -19979,7 +19980,11 @@ var SliccChat = class extends ThemedElement {
19979
19980
  @scroll=${this.#scroll}
19980
19981
  >
19981
19982
  <div class="column" @keydown=${this.#keys}>
19982
- ${agent && messages.length > 0 ? b`<swc-conversation-thread>${this.#items(messages, agent)}</swc-conversation-thread>` : b`<div class="empty">No messages yet. Ask ${agent?.name ?? "the agent"} something.</div>`}
19983
+ ${agent && messages.length > 0 ? b`<swc-conversation-thread>${c(
19984
+ this.#items(messages, agent),
19985
+ ([key2]) => key2,
19986
+ ([, item2]) => item2
19987
+ )}</swc-conversation-thread>` : b`<div class="empty">No messages yet. Ask ${agent?.name ?? "the agent"} something.</div>`}
19983
19988
  </div>
19984
19989
  </div>
19985
19990
  ${this.model && !agent?.frozen ? b`<slicc-composer .model=${this.model} .agent=${this.agent}></slicc-composer>` : A}
@@ -20832,6 +20837,9 @@ e25("swc-icon-clock", o60);
20832
20837
 
20833
20838
  // src/app/composer.ts
20834
20839
  var limit = 25 * 1024 * 1024;
20840
+ function available(model) {
20841
+ return commands.filter((command) => command.available?.(model) ?? true);
20842
+ }
20835
20843
  var commands = [
20836
20844
  {
20837
20845
  name: "clear",
@@ -20872,7 +20880,8 @@ var commands = [
20872
20880
  {
20873
20881
  name: "freeze",
20874
20882
  detail: "Archive this cone and its scoops in the freezer",
20875
- run: (model, id) => model.agent.freeze(id)
20883
+ available: (model) => typeof model.agent.freeze === "function",
20884
+ run: (model, id) => model.agent.freeze?.(id)
20876
20885
  },
20877
20886
  {
20878
20887
  name: "theme",
@@ -21195,7 +21204,7 @@ var SliccComposer = class extends ModelElement {
21195
21204
  const attachments = this.attachments.filter((attachment2) => !attachment2.error);
21196
21205
  if (!model || !text2 && attachments.length === 0) return;
21197
21206
  const command = text2.match(/^\/(\w+)(?:\s+(.*))?$/);
21198
- const known = command && commands.find((candidate) => candidate.name === command[1]);
21207
+ const known = command && available(model).find((candidate) => candidate.name === command[1]);
21199
21208
  this.value = "";
21200
21209
  this.attachments = [];
21201
21210
  this.popup = null;
@@ -21288,12 +21297,13 @@ var SliccComposer = class extends ModelElement {
21288
21297
  #choices(kind, query) {
21289
21298
  const model = this.model;
21290
21299
  if (kind === "command") {
21291
- const builtins = commands.map((command) => ({
21300
+ const usable = available(model);
21301
+ const builtins = usable.map((command) => ({
21292
21302
  value: command.name,
21293
21303
  label: `/${command.name}`,
21294
21304
  detail: command.detail
21295
21305
  }));
21296
- const own4 = model.agent.commands(this.#agent).filter((command) => !commands.some((builtin) => builtin.name === command.name)).map((command) => ({
21306
+ const own4 = model.agent.commands(this.#agent).filter((command) => !usable.some((builtin) => builtin.name === command.name)).map((command) => ({
21297
21307
  value: command.name,
21298
21308
  label: `/${command.name}`,
21299
21309
  detail: command.description,
@@ -21710,7 +21720,7 @@ var SliccFreezer = class extends ModelElement {
21710
21720
  const active = model?.agent.list().find((agent) => agent.id === model.agent.active());
21711
21721
  return b`<div class="bar">
21712
21722
  <span>${cones.length} frozen ${cones.length === 1 ? "cone" : "cones"}</span><span class="spacer"></span>
21713
- ${active?.kind === "cone" && !active.frozen ? b`<swc-action-button size="s" quiet @click=${() => model?.agent.freeze(active.id)}>Freeze ${active.name}</swc-action-button>` : ""}
21723
+ ${active?.kind === "cone" && !active.frozen && model?.agent.freeze ? b`<swc-action-button size="s" quiet @click=${() => model.agent.freeze?.(active.id)}>Freeze ${active.name}</swc-action-button>` : ""}
21714
21724
  </div>
21715
21725
  <div class="list">
21716
21726
  ${cones.length ? cones.map((cone) => this.#card(cone)) : b`<div class="note">Nothing frozen. Freeze a cone to archive it with its scoops.</div>`}
@@ -22900,6 +22910,12 @@ var SliccSprinkle = class extends ThemedElement {
22900
22910
  if (port?.call && (this.#held.port !== port || this.#held.id !== this.sprinkle))
22901
22911
  this.#hold(port, port.call, this.sprinkle);
22902
22912
  }
22913
+ #mounts = 0;
22914
+ connectedCallback() {
22915
+ this.#frame = { key: "", doc: "" };
22916
+ this.#mounts++;
22917
+ super.connectedCallback();
22918
+ }
22903
22919
  #dips = new Dips();
22904
22920
  #focusLater = false;
22905
22921
  focus() {
@@ -22960,7 +22976,10 @@ ${data.html}`;
22960
22976
  if (bridged && !this.#held.ready) return b``;
22961
22977
  const state = bridged ? this.#held : void 0;
22962
22978
  const style = `color-scheme:${this.color};${this.inline ? `height:${this.height}px;` : ""}`;
22963
- const frame = b`<iframe title=${data.title} sandbox="allow-scripts" style=${style} .srcdoc=${this.#document(data, state)}></iframe>`;
22979
+ const frame = b`${i17(
22980
+ this.#mounts,
22981
+ b`<iframe title=${data.title} sandbox="allow-scripts" style=${style} .srcdoc=${this.#document(data, state)}></iframe>`
22982
+ )}`;
22964
22983
  if (!this.inline) return frame;
22965
22984
  return b`<div class="handle" draggable="true" title="Drag into the dock or a rail to open as a panel" @dragstart=${this.#drag}>
22966
22985
  ${grip}