@ai-ecoverse/slicc-spectrum 1.40.0 → 1.42.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.
- package/README.md +5 -5
- package/dist/slicc-dummy.js +200 -7
- package/dist/slicc-dummy.js.map +3 -3
- package/dist/slicc-ui.js +5177 -4911
- package/dist/slicc-ui.js.map +4 -4
- package/dist/types/app/network.d.ts +3 -1
- package/dist/types/app/updates.d.ts +14 -2
- package/dist/types/dummy/index.d.ts +4 -2
- package/dist/types/dummy/updates.d.ts +17 -5
- package/dist/types/dummy.d.ts +2 -2
- package/dist/types/model/types.d.ts +29 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,12 +143,12 @@ Text is Adobe Clean Spectrum VF, falling back to Adobe Clean, and code is Spectr
|
|
|
143
143
|
| `<slicc-terminals>` | Terminal sessions in tabs, each a `<slicc-terminal>` on the session's `TerminalBackend`. Sessions stay alive while hidden; `exit` closes the tab. |
|
|
144
144
|
| `<slicc-browser>` | Browser tabs with the agent driving each, an address bar, reload, and the active tab's screenshot. |
|
|
145
145
|
| `<slicc-settings>` | Theme, the model and thinking level for new cones, composer and diff preferences, and accounts to connect, reconnect or disconnect. An account whose status is `signing-in` (or a non-API-key account while its `connect` is pending) reads “Signing in…”; when the port has `cancel(id)`, its row offers Cancel (`data-action="cancel-sign-in"`), and the rejected `connect` that follows shows no error. |
|
|
146
|
-
| `<slicc-updates>` | Install / Update: component states, version changes, last checks, download and link counts, action buttons, failures with Retry, and collapsible install logs. Opens at boot until the agent is ready without failures. Background updates stay in the header's update status; new failures reopen the panel, and after a reload into a boot that isn't ready yet such a panel closes once the agent is ready. Every automatic close is saved to the layout. Also available through View and the rails. |
|
|
146
|
+
| `<slicc-updates>` | Install / Update: component states, version changes, last checks, download and link counts, action buttons, failures with Retry, and collapsible install logs. Opens at boot until the agent is ready without failures. Background updates stay in the header's update status; new failures reopen the panel, and after a reload into a boot that isn't ready yet such a panel closes once the agent is ready. Every automatic close is saved to the layout. When the port offers packages, an Optional packages section lists them below as compact rows, each with its state, version, download size, requirements, commands, progress, errors and Install log; packages never count in the header or keep the panel open at boot. Also available through View and the rails. |
|
|
147
147
|
| `<slicc-memory>` | What agents remember, per scope (everyone, a cone or a role), grouped by section: search, filter by tag, expand, edit, add and forget. Free text outside an entry shows “From MEMORY.md”. |
|
|
148
148
|
| `<slicc-monitor>` | The live monitor: vitals with sparklines (active agents, spend, budget, fullest context), alerts, and the topology (cones and scoops, terminals, tabs, pending changes, sprinkles, tray followers). |
|
|
149
149
|
| `<slicc-freezer>` | Every conversation in the session, from `frozen()`: cones, scoops and agent runs, each with a kind badge, live ones first with a Live light, then the newest first. A live row offers **Open**, which selects that agent; a stopped one offers **Thaw** and **Remove**, which deletes its working folders after a confirmation. A thawed scoop or agent run keeps its row, which says what it was thawed as. **Delete cone**, in the agents list (or <kbd>Delete</kbd> on a cone's row) and the header's cone picker, stops a cone after a confirmation; `/freeze` does it at once. Either way its conversation stays here, and a row without a `kind` counts as a cone. |
|
|
150
150
|
| `<slicc-sprinkle>` | A SLICC sprinkle (`.shtml`), as a panel or, with `inline`, as a dip in the chat that grows to fit. A dip has a tab-like handle: drag it into the dock (or onto a rail, or use its open-as-panel button) and it lives on as a sprinkle panel, with a note in the chat where it was; which dips are out is saved in `slicc-ui.dips`. It runs in a sandboxed frame (`allow-scripts` only) with SLICC's sprinkle theme (the `--s2-*` tokens and `.sprinkle-*` classes), the app's fonts, and Lucide icons (`<i data-lucide>`, `LucideIcons.render()`). It talks back through `slicc.lick({ action, data })`, which reaches the owning cone as a `sprinkle` lick, and, when the port has `call`, reads files and keeps state (see [Sprinkle bridge](#sprinkle-bridge)). Panel sprinkles sit at the top of the right rail with their Lucide icon. |
|
|
151
|
-
| `<slicc-network>` | Network: the route and its health in plain words with the bios `detail`, a line on browser automation (`data-browser`: through the SLICC extension, through slicc-node, not available with how to get it, or `declined`, muted: off for this session, reload to be asked again) when the status has `browser`, **Check again** (`data-action="check"`) when the port has `check`, a **Tailscale** section (`data-tailnet` with the state) when the status has `tailnet`, **Get the whole web** with the Chrome extension link (`data-action="install-extension"`, when `extensionUrl` is set) and `npx @ai-ecoverse/slicc-node` with a copy button (`data-action="copy-command"`), folded away when the route already reaches the whole web, and recent failures with host, error and time. The header's **Network** indicator (`data-network`, `data-health`) opens it: a status light, green for `ok`, yellow for `limited` and red for `failing`, with the state in its text and label and `detail` as its tooltip, which adds "Tailscale is connected." while the tailnet runs; on a phone, a cloud icon for the state. Offered only when the model has a `network` port. |
|
|
151
|
+
| `<slicc-network>` | Network: the route and its health in plain words with the bios `detail`, a line on browser automation (`data-browser`: through the SLICC extension, through slicc-node, not available with how to get it, or `declined`, muted: off for this session, reload to be asked again) when the status has `browser`, **Check again** (`data-action="check"`) when the port has `check`, a **Tailscale** section (`data-tailnet` with the state) when the status has `tailnet`, **Get the whole web** with the Chrome extension link (`data-action="install-extension"`, when `extensionUrl` is set) and `npx @ai-ecoverse/slicc-node` with a copy button (`data-action="copy-command"`), folded away when the route already reaches the whole web (`proxy`, `extension` or `tailnet`, whose line names `tailnet.exitNode`), and recent failures with host, error and time. The header's **Network** indicator (`data-network`, `data-health`) opens it: a status light, green for `ok`, yellow for `limited` and red for `failing`, with the state in its text and label and `detail` as its tooltip, which adds "Tailscale is connected." while the tailnet runs; on a phone, a cloud icon for the state. Offered only when the model has a `network` port. |
|
|
152
152
|
| `<slicc-tray>` | The tray indicator in the header: connection, the float's name, followers and budget; its panel adds role, runtime, spend, the follower list, the join link, and disconnect or reconnect. |
|
|
153
153
|
| `<slicc-confirm>` | The confirmation dialog `confirm()` opens. Not for direct use. |
|
|
154
154
|
| `<slicc-prompt>` | The name dialog `prompt()` opens. Not for direct use. |
|
|
@@ -205,10 +205,10 @@ Paths are the agent's: `/shared/…` and `/home/…`, nothing else. A refusal or
|
|
|
205
205
|
| `monitor` | all of them | A snapshot of vitals, alerts and sections, re-emitted as the system changes, and `resync`. |
|
|
206
206
|
| `sprinkles` | `@ai-ecoverse/slicc-agent` | Sprinkles (`inline` ones show as dips in the chat, not in the rail) and `send`, which turns a sprinkle's lick into a lick on its cone. The optional `call(id, method, args)` serves the [sprinkle bridge](#sprinkle-bridge) for sprinkle `id`: `readFile` and `exists` (`[path]`) resolve with a string and a boolean, `getState` (`[]`) with the saved value or `null`, and `setState` (`[value]`) once it is saved. The adapter owns path policy and keeps state per sprinkle; `<slicc-sprinkle>` awaits `getState` before it builds a frame, mirrors what the frame saves, and forwards only these four methods from its own frame. The dummy keeps state in memory and maps `/shared/x` to `/home/x` in its files, refusing anything outside `/home`. |
|
|
207
207
|
| `tray` | the tray protocol | Connection, role, float kind, followers, spend and budget; `reconnect` and `disconnect`. |
|
|
208
|
-
| `updates` (optional) | BIOS installers | `list()` returns `UpdateItem` rows for BIOS, kernel, agent, grammars, global pnpm packages, skills and UI. `ready()` explicitly reports agent readiness, independently of agent activity. Emit `items` whenever rows or readiness change. Use `queued` for a row that waits for another component before it starts; it reads "Waiting" and doesn't count as updating. Use `starting` for an installed row that is only starting up: it reads "Starting" without a checked line, and the header shows a neutral "Starting" only when nothing is failed, updating or ready. A `failed` row with an installed `from` version reads "Update failed". `act(id, action)` resolves when dispatched or rejects with a displayed error; actions are `retry`, `update-now`, `restart-agent` and `reload`. Missing ports preserve existing adapters and report disconnected information in the panel. Real installer wiring belongs to ai-ecoverse/slicc-bios#70. |
|
|
209
|
-
| `network` (optional) | BIOS | `status()` returns the `NetworkStatus`: `route` (`proxy` for slicc-node, `extension` for the Chrome extension relay, `page` for the page's own fetch, limited by CORS, or `null`), `health` (`ok`, `limited` or `failing`, decided by the port), a one-line `detail`, recent `failures` (`{ url, error, at }`, newest first), an optional `extensionUrl` and an optional `browser` (`{ via, detail?, declined? }`, `via` being `extension`, `proxy` or `null` when browser automation isn't available, and `declined: true` once the user declined browser control for the session). Emit `network` when it changes. The optional `check()` tests the route again. An optional `tailnet` (`TailnetStatus`) shows the Tailscale section: `state` (`off`, `loading`, `needs-login`, `starting`, `running` or `failed`, a status light), a plain-language `detail` (progress, or the failure reason in an error box with **Retry** through `check()`), a `loginUrl` (**Sign in to Tailscale**, a new tab), the `node` (`{ name, addresses }`; the name and the first 100.x address, each with a Copy button), `exitNode` (the name in use or `null`), `exitNodes` (`{ id, name, online }`), `autoExitNode`, `shieldsUp` (a muted line when `true`, a warning when `false`) and `peers` (a count). The optional `setTailnet(on)` adds the **Use Tailscale** switch (`data-action="tailnet"`); `submitAuthKey(key)` adds an auth-key field to `needs-login` (a password field without a `name`, cleared on submit, never kept in component state); `setExitNode(id | 'auto' | null)` adds the **Exit node** picker (None, Automatic, and each node, offline ones disabled) to `running`, with a line saying where traffic goes; `logoutTailnet()` adds **Sign out**, behind a confirm. A rejected call shows its message in the section. Peers are never named beyond the exit-node list. Without the port, the indicator and the Network panel don't show. |
|
|
208
|
+
| `updates` (optional) | BIOS installers | `list()` returns `UpdateItem` rows for BIOS, kernel, agent, grammars, global pnpm packages, skills and UI. `ready()` explicitly reports agent readiness, independently of agent activity. Emit `items` whenever rows or readiness change. Use `queued` for a row that waits for another component before it starts; it reads "Waiting" and doesn't count as updating. Use `starting` for an installed row that is only starting up: it reads "Starting" without a checked line, and the header shows a neutral "Starting" only when nothing is failed, updating or ready. A `failed` row with an installed `from` version reads "Update failed". `act(id, action)` resolves when dispatched or rejects with a displayed error; actions are `retry`, `update-now`, `restart-agent` and `reload`. Missing ports preserve existing adapters and report disconnected information in the panel. Optional `packages()` returns `PackageItem` rows for optional tools, each with a short catalog `id`, its npm `package` (shown in the name's tooltip and at the top of its Install log), `label`, a one-sentence `description`, the `commands` it provides, `requires` (other package ids, read as "Needs Python", "Installs Python too", or "Needs Python (not installed)" on an installed row), `state` (`available`, `queued`, `installing`, `installed`, `outdated`, `updating`, `removing` or `failed`), the installed `version`, the `offered` version and its `size` in bytes, `progress` counted in packages (or `null` for an indeterminate bar), `error`, `actions` (`install`, `update`, `remove`, `retry`) and an optional `log`. Emit `packages` whenever they change. `actPackage(id, action)` keeps the row's button pending until it settles; it shows any confirm itself, resolves without a change when that confirm is cancelled, and rejects with a displayed error on a real failure. Hooks: `section[data-section="packages"]`, `li[data-id][data-state]`, buttons with `data-action` and `[data-error]`. Real installer wiring belongs to ai-ecoverse/slicc-bios#70. |
|
|
209
|
+
| `network` (optional) | BIOS | `status()` returns the `NetworkStatus`: `route` (`proxy` for slicc-node, `extension` for the Chrome extension relay, `tailnet` while a Tailscale exit node carries the traffic, `page` for the page's own fetch, limited by CORS, or `null`), `health` (`ok`, `limited` or `failing`, decided by the port), a one-line `detail`, recent `failures` (`{ url, error, at }`, newest first), an optional `extensionUrl` and an optional `browser` (`{ via, detail?, declined? }`, `via` being `extension`, `proxy` or `null` when browser automation isn't available, and `declined: true` once the user declined browser control for the session). Emit `network` when it changes. The optional `check()` tests the route again. An optional `tailnet` (`TailnetStatus`) shows the Tailscale section: `state` (`off`, `loading`, `needs-login`, `starting`, `running` or `failed`, a status light), a plain-language `detail` (progress, or the failure reason in an error box with **Retry** through `check()`), a `loginUrl` (**Sign in to Tailscale**, a new tab), the `node` (`{ name, addresses }`; the name and the first 100.x address, each with a Copy button), `exitNode` (the name in use or `null`), `exitNodes` (`{ id, name, online }`), `autoExitNode`, `shieldsUp` (a muted line when `true`, a warning when `false`) and `peers` (a count). The optional `setTailnet(on)` adds the **Use Tailscale** switch (`data-action="tailnet"`); `submitAuthKey(key)` adds an auth-key field to `needs-login` (a password field without a `name`, cleared on submit, never kept in component state); `setExitNode(id | 'auto' | null)` adds the **Exit node** picker (None, Automatic, and each node, offline ones disabled) to `running`, with a line saying where traffic goes; `logoutTailnet()` adds **Sign out**, behind a confirm. A rejected call shows its message in the section. Peers are never named beyond the exit-node list. Without the port, the indicator and the Network panel don't show. |
|
|
210
210
|
|
|
211
|
-
The dummy supports `createDummyModel({ updates: 'boot' | 'starting' | 'current' | 'available' | 'restart' | 'failure' })`, also selectable with `?updates=` on `/ui/`. Fixtures stay stable for inspection; `model.updates.setScenario('current')` completes boot. Dummy Update now and Retry simulate download and link progress; Restart agent and Reload only change fixture state, never restart a real process or reload the browser. `updateFixtures` and `DummyUpdates` are exported from `/dummy`. `createDummyModel({ mounts: 'mount' | 'cancel' | 'fail' | 'needs' })` (or `?mounts=` on `/ui/`) turns on the optional mount members, which are off by default: `mountFolder` mounts invented files at `/mnt/photos`, resolves with `null`, or rejects, as `model.files.mount.scenario` says; `needs` also lists `/mnt/photos` in `needsFolder()` until a folder is inserted there. `createDummyModel({ network: 'ok' | 'limited' | 'failing' | 'off' })` (or `?network=` on `/ui/`, default `limited`) sets the dummy network: slicc-node (with browser automation through it), the page fetch with CORS failures, or no route, all invented; `off` leaves out the port. `model.network.setScenario()` switches it and Check again re-emits after a short wait. `createDummyModel({ tailnet: 'off' | 'needs-login' | 'running' | 'failed' })` (or `?tailnet=` on `/ui/`, off by default) adds an invented tailnet: an auth key starting with `tskey-` signs in, `mast-pi` and `keel-router` are online exit nodes and `buoy-laptop` is offline, and Retry on `failed` connects. `networkFixtures`, `tailnetFixtures` and `DummyNetwork` are exported from `/dummy`. `createDummyModel({ changes: 'files' | 'git' | 'nogit' })` (or `?changes=` on `/ui/`, default `files`) adds a git `changes` port: `git` lists the pending changes under `/workspace/harbor` and `/workspace/skills` with their `repo` and no author, and `nogit` reports git as unavailable. `DummyChanges` is exported from `/dummy`.
|
|
211
|
+
The dummy supports `createDummyModel({ updates: 'boot' | 'starting' | 'current' | 'available' | 'restart' | 'failure' })`, also selectable with `?updates=` on `/ui/`. Fixtures stay stable for inspection; `model.updates.setScenario('current')` completes boot. Dummy Update now and Retry simulate download and link progress; Restart agent and Reload only change fixture state, never restart a real process or reload the browser. `createDummyModel({ packages: 'mixed' | 'empty' | 'fail' | 'off' })` (or `?packages=` on `/ui/`, off by default) adds invented optional packages in every state: Install and Retry finish after a short wait and install missing requirements too, `fail` makes them fail, and removing Python while uv is installed asks through the `confirm` option (the `/ui/` page passes spectrum's `confirm`). `updateFixtures`, `packageFixtures` and `DummyUpdates` are exported from `/dummy`. `createDummyModel({ mounts: 'mount' | 'cancel' | 'fail' | 'needs' })` (or `?mounts=` on `/ui/`) turns on the optional mount members, which are off by default: `mountFolder` mounts invented files at `/mnt/photos`, resolves with `null`, or rejects, as `model.files.mount.scenario` says; `needs` also lists `/mnt/photos` in `needsFolder()` until a folder is inserted there. `createDummyModel({ network: 'ok' | 'limited' | 'failing' | 'off' })` (or `?network=` on `/ui/`, default `limited`) sets the dummy network: slicc-node (with browser automation through it), the page fetch with CORS failures, or no route, all invented; `off` leaves out the port. `model.network.setScenario()` switches it and Check again re-emits after a short wait. `createDummyModel({ tailnet: 'off' | 'needs-login' | 'running' | 'failed' })` (or `?tailnet=` on `/ui/`, off by default) adds an invented tailnet: an auth key starting with `tskey-` signs in, `mast-pi` and `keel-router` are online exit nodes and `buoy-laptop` is offline, and Retry on `failed` connects. While the dummy tailnet runs with an exit node, the route is `tailnet` and the health `ok`. `networkFixtures`, `tailnetFixtures` and `DummyNetwork` are exported from `/dummy`. `createDummyModel({ changes: 'files' | 'git' | 'nogit' })` (or `?changes=` on `/ui/`, default `files`) adds a git `changes` port: `git` lists the pending changes under `/workspace/harbor` and `/workspace/skills` with their `repo` and no author, and `nogit` reports git as unavailable. `DummyChanges` is exported from `/dummy`.
|
|
212
212
|
|
|
213
213
|
On phones the update status and the tray show only their status light and the network indicator a cloud icon, with the text in their labels and tooltips; the agent picker keeps room for the cone's name, cut with an ellipsis when long, and the bottom rail scrolls when needed. The update status comes first so progress and failures remain reachable on narrow screens.
|
|
214
214
|
|
package/dist/slicc-dummy.js
CHANGED
|
@@ -3874,6 +3874,7 @@ function tailnetFixtures(scenario) {
|
|
|
3874
3874
|
}
|
|
3875
3875
|
var DummyNetwork = class extends Emitter {
|
|
3876
3876
|
scenario;
|
|
3877
|
+
#base;
|
|
3877
3878
|
#status;
|
|
3878
3879
|
#clock;
|
|
3879
3880
|
#tailnet;
|
|
@@ -3882,14 +3883,25 @@ var DummyNetwork = class extends Emitter {
|
|
|
3882
3883
|
this.scenario = scenario;
|
|
3883
3884
|
this.#clock = clock2;
|
|
3884
3885
|
this.#tailnet = tailnet ? tailnetFixtures(tailnet) : void 0;
|
|
3885
|
-
this.#
|
|
3886
|
+
this.#base = networkFixtures(scenario);
|
|
3887
|
+
this.#status = this.#with(this.#base);
|
|
3886
3888
|
}
|
|
3887
3889
|
#with(status) {
|
|
3888
|
-
|
|
3890
|
+
const tailnet = this.#tailnet;
|
|
3891
|
+
if (!tailnet) return status;
|
|
3892
|
+
const exit = tailnet.state === "running" ? tailnet.exitNode : null;
|
|
3893
|
+
if (!exit) return { ...status, tailnet };
|
|
3894
|
+
return {
|
|
3895
|
+
...status,
|
|
3896
|
+
route: "tailnet",
|
|
3897
|
+
health: "ok",
|
|
3898
|
+
detail: `${exit} carries everything except this computer\u2019s own services.`,
|
|
3899
|
+
tailnet
|
|
3900
|
+
};
|
|
3889
3901
|
}
|
|
3890
3902
|
#set(tailnet) {
|
|
3891
3903
|
this.#tailnet = tailnet;
|
|
3892
|
-
this.#status = this.#with(this.#
|
|
3904
|
+
this.#status = this.#with(this.#base);
|
|
3893
3905
|
this.emit("network", this.#status);
|
|
3894
3906
|
}
|
|
3895
3907
|
status() {
|
|
@@ -3897,13 +3909,15 @@ var DummyNetwork = class extends Emitter {
|
|
|
3897
3909
|
}
|
|
3898
3910
|
setScenario(scenario) {
|
|
3899
3911
|
this.scenario = scenario;
|
|
3900
|
-
this.#
|
|
3912
|
+
this.#base = networkFixtures(scenario);
|
|
3913
|
+
this.#status = this.#with(this.#base);
|
|
3901
3914
|
this.emit("network", this.#status);
|
|
3902
3915
|
}
|
|
3903
3916
|
async check() {
|
|
3904
3917
|
await this.#clock.sleep(4);
|
|
3905
3918
|
if (this.#tailnet?.state === "failed") this.#tailnet = tailnetFixtures("running");
|
|
3906
|
-
this.#
|
|
3919
|
+
this.#base = networkFixtures(this.scenario);
|
|
3920
|
+
this.#status = this.#with(this.#base);
|
|
3907
3921
|
this.emit("network", this.#status);
|
|
3908
3922
|
}
|
|
3909
3923
|
async setTailnet(on) {
|
|
@@ -4322,15 +4336,188 @@ function updateFixtures(scenario) {
|
|
|
4322
4336
|
}
|
|
4323
4337
|
return items;
|
|
4324
4338
|
}
|
|
4339
|
+
var offer = (id, label, description, commands, offered, size, requires) => ({
|
|
4340
|
+
id,
|
|
4341
|
+
package: `@harbor/${id}-wasm`,
|
|
4342
|
+
label,
|
|
4343
|
+
description,
|
|
4344
|
+
commands,
|
|
4345
|
+
...requires ? { requires } : {},
|
|
4346
|
+
state: "available",
|
|
4347
|
+
version: null,
|
|
4348
|
+
offered,
|
|
4349
|
+
size,
|
|
4350
|
+
progress: null,
|
|
4351
|
+
error: null,
|
|
4352
|
+
actions: ["install"]
|
|
4353
|
+
});
|
|
4354
|
+
var fetchFailed = "The download stopped. Check the connection and try again.";
|
|
4355
|
+
function packageFixtures(scenario) {
|
|
4356
|
+
if (scenario === "empty") return [];
|
|
4357
|
+
const items = [
|
|
4358
|
+
offer("git", "git", "Version control for your projects.", ["git"], "2.47.1", 43e5),
|
|
4359
|
+
offer(
|
|
4360
|
+
"python",
|
|
4361
|
+
"Python",
|
|
4362
|
+
"Python with pip, for scripts and data work.",
|
|
4363
|
+
["python3", "pip"],
|
|
4364
|
+
"3.13.1",
|
|
4365
|
+
284e5
|
|
4366
|
+
),
|
|
4367
|
+
offer(
|
|
4368
|
+
"uv",
|
|
4369
|
+
"uv",
|
|
4370
|
+
"Fast Python package and project manager.",
|
|
4371
|
+
["uv", "uvx"],
|
|
4372
|
+
"0.9.2",
|
|
4373
|
+
61e5,
|
|
4374
|
+
["python"]
|
|
4375
|
+
),
|
|
4376
|
+
offer("ruff", "Ruff", "Python linter and formatter.", ["ruff"], "0.14.0", 98e5, [
|
|
4377
|
+
"python"
|
|
4378
|
+
]),
|
|
4379
|
+
offer(
|
|
4380
|
+
"esbuild",
|
|
4381
|
+
"esbuild",
|
|
4382
|
+
"Bundles and minifies JavaScript and TypeScript.",
|
|
4383
|
+
["esbuild"],
|
|
4384
|
+
"0.25.10",
|
|
4385
|
+
101e5
|
|
4386
|
+
),
|
|
4387
|
+
offer(
|
|
4388
|
+
"tsc",
|
|
4389
|
+
"TypeScript",
|
|
4390
|
+
"Type-checks and compiles TypeScript.",
|
|
4391
|
+
["tsc"],
|
|
4392
|
+
"5.9.3",
|
|
4393
|
+
236e5
|
|
4394
|
+
),
|
|
4395
|
+
offer(
|
|
4396
|
+
"biome",
|
|
4397
|
+
"Biome",
|
|
4398
|
+
"Formats and lints JavaScript, TypeScript and JSON.",
|
|
4399
|
+
["biome"],
|
|
4400
|
+
"2.2.4",
|
|
4401
|
+
192e5
|
|
4402
|
+
),
|
|
4403
|
+
offer(
|
|
4404
|
+
"pdf",
|
|
4405
|
+
"PDF tools",
|
|
4406
|
+
"Extract text, pages and details from PDF files.",
|
|
4407
|
+
["pdftotext", "pdfinfo", "pdfseparate"],
|
|
4408
|
+
"24.8.0",
|
|
4409
|
+
79e5
|
|
4410
|
+
)
|
|
4411
|
+
];
|
|
4412
|
+
const at3 = (id) => items.findIndex((item) => item.id === id);
|
|
4413
|
+
const patch = (id, change) => {
|
|
4414
|
+
items[at3(id)] = { ...items[at3(id)], ...change };
|
|
4415
|
+
};
|
|
4416
|
+
patch("python", { state: "installed", version: "3.13.1", actions: ["remove"] });
|
|
4417
|
+
patch("uv", { state: "outdated", version: "0.8.1", actions: ["update", "remove"] });
|
|
4418
|
+
patch("esbuild", {
|
|
4419
|
+
state: "installing",
|
|
4420
|
+
actions: [],
|
|
4421
|
+
log: "Packages: +1\nProgress: resolved 1, downloaded 0, added 0"
|
|
4422
|
+
});
|
|
4423
|
+
patch("biome", { state: "installed", version: "2.2.4", actions: ["remove"] });
|
|
4424
|
+
patch("pdf", {
|
|
4425
|
+
state: "failed",
|
|
4426
|
+
error: fetchFailed,
|
|
4427
|
+
actions: ["retry"],
|
|
4428
|
+
log: "Packages: +1\nERR_PNPM_FETCH_TIMEOUT Request timed out after 30000ms"
|
|
4429
|
+
});
|
|
4430
|
+
return items;
|
|
4431
|
+
}
|
|
4325
4432
|
var DummyUpdates = class extends Emitter {
|
|
4326
4433
|
#items;
|
|
4327
4434
|
#ready;
|
|
4328
4435
|
#clock;
|
|
4329
|
-
|
|
4436
|
+
#packages = [];
|
|
4437
|
+
#fail = false;
|
|
4438
|
+
#confirm;
|
|
4439
|
+
constructor(scenario, clock2, options = {}) {
|
|
4330
4440
|
super();
|
|
4331
4441
|
this.#items = updateFixtures(scenario);
|
|
4332
4442
|
this.#ready = scenario !== "boot" && scenario !== "starting";
|
|
4333
4443
|
this.#clock = clock2;
|
|
4444
|
+
this.#confirm = options.confirm;
|
|
4445
|
+
if (options.packages) {
|
|
4446
|
+
this.#packages = packageFixtures(options.packages);
|
|
4447
|
+
this.#fail = options.packages === "fail";
|
|
4448
|
+
this.packages = () => this.#packages;
|
|
4449
|
+
this.actPackage = (id, action) => this.#actPackage(id, action);
|
|
4450
|
+
}
|
|
4451
|
+
}
|
|
4452
|
+
#patchPackage(id, patch) {
|
|
4453
|
+
this.#packages = this.#packages.map((item) => item.id === id ? { ...item, ...patch } : item);
|
|
4454
|
+
this.emit("packages", this.#packages);
|
|
4455
|
+
}
|
|
4456
|
+
async #actPackage(id, action) {
|
|
4457
|
+
const item = this.#packages.find((candidate) => candidate.id === id);
|
|
4458
|
+
if (!item?.actions.includes(action)) throw new Error(`Package action unavailable: ${id}`);
|
|
4459
|
+
if (action === "remove") {
|
|
4460
|
+
const users = this.#packages.filter((other) => other.version !== null && other.requires?.includes(id)).map((other) => other.label);
|
|
4461
|
+
if (users.length && this.#confirm) {
|
|
4462
|
+
const names = new Intl.ListFormat("en", { type: "conjunction" }).format(users);
|
|
4463
|
+
const verb = users.length === 1 ? "needs it and stops" : "need it and stop";
|
|
4464
|
+
const ok = await this.#confirm({
|
|
4465
|
+
title: `Remove ${item.label}?`,
|
|
4466
|
+
body: `${names} ${verb} working until ${item.label} is back.`,
|
|
4467
|
+
action: "Remove",
|
|
4468
|
+
variant: "confirmation"
|
|
4469
|
+
});
|
|
4470
|
+
if (!ok) return;
|
|
4471
|
+
}
|
|
4472
|
+
this.#patchPackage(id, { state: "removing", error: null, actions: [] });
|
|
4473
|
+
await this.#clock.sleep(2);
|
|
4474
|
+
this.#patchPackage(id, {
|
|
4475
|
+
state: "available",
|
|
4476
|
+
version: null,
|
|
4477
|
+
actions: ["install"],
|
|
4478
|
+
log: void 0
|
|
4479
|
+
});
|
|
4480
|
+
return;
|
|
4481
|
+
}
|
|
4482
|
+
const log = "Packages: +1";
|
|
4483
|
+
this.#patchPackage(id, {
|
|
4484
|
+
state: action === "update" ? "updating" : "installing",
|
|
4485
|
+
error: null,
|
|
4486
|
+
actions: [],
|
|
4487
|
+
log: `${log}
|
|
4488
|
+
Progress: resolved 1, downloaded 0, added 0`
|
|
4489
|
+
});
|
|
4490
|
+
await this.#clock.sleep(4);
|
|
4491
|
+
if (this.#fail) {
|
|
4492
|
+
this.#patchPackage(id, {
|
|
4493
|
+
state: "failed",
|
|
4494
|
+
error: fetchFailed,
|
|
4495
|
+
actions: ["retry"],
|
|
4496
|
+
log: `${log}
|
|
4497
|
+
ERR_PNPM_FETCH_TIMEOUT Request timed out after 30000ms`
|
|
4498
|
+
});
|
|
4499
|
+
throw new Error(fetchFailed);
|
|
4500
|
+
}
|
|
4501
|
+
for (const need of item.requires ?? []) {
|
|
4502
|
+
const required = this.#packages.find((candidate) => candidate.id === need);
|
|
4503
|
+
if (required && required.version === null) {
|
|
4504
|
+
this.#patchPackage(need, {
|
|
4505
|
+
state: "installed",
|
|
4506
|
+
version: required.offered,
|
|
4507
|
+
error: null,
|
|
4508
|
+
actions: ["remove"]
|
|
4509
|
+
});
|
|
4510
|
+
}
|
|
4511
|
+
}
|
|
4512
|
+
this.#patchPackage(id, {
|
|
4513
|
+
state: "installed",
|
|
4514
|
+
version: item.offered,
|
|
4515
|
+
progress: null,
|
|
4516
|
+
actions: ["remove"],
|
|
4517
|
+
log: `${log}
|
|
4518
|
+
Progress: resolved 1, downloaded 1, added 1
|
|
4519
|
+
Done in 3.8s`
|
|
4520
|
+
});
|
|
4334
4521
|
}
|
|
4335
4522
|
list() {
|
|
4336
4523
|
return this.#items;
|
|
@@ -4382,6 +4569,8 @@ function createDummyModel({
|
|
|
4382
4569
|
delay = 30,
|
|
4383
4570
|
storage = null,
|
|
4384
4571
|
updates = "current",
|
|
4572
|
+
packages = "off",
|
|
4573
|
+
confirm,
|
|
4385
4574
|
mounts = "off",
|
|
4386
4575
|
network = "limited",
|
|
4387
4576
|
tailnet,
|
|
@@ -4419,7 +4608,10 @@ function createDummyModel({
|
|
|
4419
4608
|
]),
|
|
4420
4609
|
sprinkles: new DummySprinkles(sprinkles, agent, files3),
|
|
4421
4610
|
tray: new DummyTray(tray, time),
|
|
4422
|
-
updates: new DummyUpdates(updates, time
|
|
4611
|
+
updates: new DummyUpdates(updates, time, {
|
|
4612
|
+
...packages === "off" ? {} : { packages },
|
|
4613
|
+
confirm
|
|
4614
|
+
}),
|
|
4423
4615
|
...network === "off" ? {} : { network: new DummyNetwork(network, time, tailnet) },
|
|
4424
4616
|
...changes === "files" ? {} : { changes: new DummyChanges(files3, changes === "git") }
|
|
4425
4617
|
};
|
|
@@ -4431,6 +4623,7 @@ export {
|
|
|
4431
4623
|
DummyUpdates,
|
|
4432
4624
|
createDummyModel,
|
|
4433
4625
|
networkFixtures,
|
|
4626
|
+
packageFixtures,
|
|
4434
4627
|
tailnetFixtures,
|
|
4435
4628
|
updateFixtures
|
|
4436
4629
|
};
|