@cmodjs/core 5.10.0 → 5.12.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/docs/commands.md +21 -5
- package/docs/dependencies.md +1 -1
- package/docs/jobs.md +2 -2
- package/docs/mod.md +1 -1
- package/docs/ui.md +2 -0
- package/package.json +1 -1
- package/records.d.ts +14 -1
- package/records.d.ts.map +1 -1
- package/records.js +39 -5
- package/runtime/dependencies.d.ts +2 -0
- package/runtime/dependencies.d.ts.map +1 -1
- package/runtime/dependencies.js +6 -0
- package/runtime/engine.d.ts +2 -0
- package/runtime/engine.d.ts.map +1 -1
- package/runtime/lifecycle.d.ts.map +1 -1
- package/runtime/lifecycle.js +37 -6
- package/runtime/pages.d.ts.map +1 -1
- package/runtime/pages.js +8 -4
- package/runtime/parts.d.ts.map +1 -1
- package/runtime/parts.js +3 -0
- package/runtime/sessions.d.ts.map +1 -1
- package/runtime/sessions.js +6 -2
- package/runtime/toaster.d.ts +1 -0
- package/runtime/toaster.d.ts.map +1 -1
- package/runtime/toaster.js +21 -11
- package/runtime/web.d.ts +82 -0
- package/runtime/web.d.ts.map +1 -0
- package/runtime/web.js +381 -0
- package/runtime/widgets.js +2 -2
- package/src/records.ts +45 -5
- package/src/runtime/dependencies.ts +8 -0
- package/src/runtime/engine.ts +2 -0
- package/src/runtime/lifecycle.ts +39 -6
- package/src/runtime/pages.ts +6 -3
- package/src/runtime/parts.ts +2 -0
- package/src/runtime/sessions.ts +5 -2
- package/src/runtime/toaster.ts +22 -11
- package/src/runtime/web.ts +450 -0
- package/src/runtime/widgets.ts +2 -2
package/docs/commands.md
CHANGED
|
@@ -231,6 +231,14 @@ Reads every conversation Claude Code saved, as the sessions, contexts, turns, ta
|
|
|
231
231
|
- `--json` prints JSON instead of one line each.
|
|
232
232
|
- `index` reads every saved conversation into the index at `~/.local/share/cmod/history-12.sqlite`, which holds where each message is in its transcript, not a copy of it, and each conversation's turns, with the device each ran on, contexts, and tasks. While cmod has set up a mod other than cmod, the cmod plugin runs it in the background at each session's start, and a second run while one is running exits at once. The index forgets a conversation whose transcript is deleted.
|
|
233
233
|
|
|
234
|
+
### cmod web
|
|
235
|
+
|
|
236
|
+
```text
|
|
237
|
+
cmod web
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Opens the browser app at `http://127.0.0.1:<port>/` and prints that address. The browser app lists every Claude Code session that runs on the computer, in every project, in four groups: Needs you (a permission prompt, a question, or a turn that failed or was stopped), Replied (an answer the person has not opened), Working, and Idle. A session opens its conversation with a prompt box under it, which sends the text as the person's own prompt in that session, a Stop button while it works, and a tab for each Sidebar page its cmod plugin draws, where a press, a text, or a pick runs the mod's handler in that session. `j` and `k` move between sessions, `Enter` opens one and puts the cursor in its prompt box, `Esc` returns to the list, `e` marks a reply done, and `u` marks it unread. A permission prompt or a question is answered in the session's terminal. The browser app runs while `Show the Sidebar in your browser` is on in Settings, under cmod, Preferences, which `open in browser` on the Sidebar's key bar turns on and runs this command. When it does not run, `cmod web` exits 1 and says so. When `open` or `xdg-open` fails, it exits 1 after it printed the address.
|
|
241
|
+
|
|
234
242
|
## Run in an install script
|
|
235
243
|
|
|
236
244
|
### cmod watch
|
|
@@ -285,7 +293,7 @@ cmod runs these itself. A person runs them to see a step's whole log, or to fini
|
|
|
285
293
|
cmod setup <plugin-root> [--events]
|
|
286
294
|
```
|
|
287
295
|
|
|
288
|
-
Refuses a machine the `os` and `cpu` keys of the mod's `package.json` leave out. Downloads the program its `cmod.program` names, or builds it from the checkout's `cli/` when `cmod link` loaded the mod, so a linked checkout whose version has no release yet still sets up, and links it into cmod's programs folder, which Claude Code runs it from by its name, and into `~/.local/bin` unless a file there is not cmod's. Runs the mod's install step, saves its uninstall step, binds its hotkeys, records the mod as set up,
|
|
296
|
+
Refuses a machine the `os` and `cpu` keys of the mod's `package.json` leave out. Downloads the program its `cmod.program` names, or builds it from the checkout's `cli/` when `cmod link` loaded the mod, so a linked checkout whose version has no release yet still sets up, and links it into cmod's programs folder, which Claude Code runs it from by its name, and into `~/.local/bin` unless a file there is not cmod's. Runs the mod's install step, saves its uninstall step, binds its hotkeys, and records the mod as set up, asking nothing first ([install-steps.md](install-steps.md#when-the-steps-run)). A program the mod runs as one copy or as a service of the computer restarts on the new program by itself ([cmod program](#cmod-program)). A mod installed from a marketplace whose automatic updates the person has not turned on or off gets them turned on, unless the marketplace is a folder, which Claude Code reads in place, through `"autoUpdate": true` on the marketplace's `extraKnownMarketplaces` entry in Claude Code's `settings.json`, and the setup says so. An unchanged mod runs nothing. `--events` prints one event per line for a program to read, and the mod's install toast in Claude Code reads them. Before all of that, it links each folder a cmod before 4.1.0 left in `CLAUDE_CODE_PLUGIN_DIRS`, as [`cmod watch`](#cmod-watch) does.
|
|
289
297
|
|
|
290
298
|
### cmod teardown
|
|
291
299
|
|
|
@@ -293,7 +301,7 @@ Refuses a machine the `os` and `cpu` keys of the mod's `package.json` leave out.
|
|
|
293
301
|
cmod teardown <plugin-name> [--events]
|
|
294
302
|
```
|
|
295
303
|
|
|
296
|
-
Runs a removed mod's saved uninstall step, then deletes its install record, the saved step, every version of its program, its data folder, and `instances/<plugin-name>/`, where its `singleInstance` and `isService` programs keep their addresses, stops and deletes each service of the computer it runs a program as, with its record in `services/<plugin-name>/` ([cmod program](#cmod-program)), takes out each Claude Code setting it changed that still has the value it set, deletes its secrets ([cmod secret](#cmod-secret)), and deletes its entry in `consent.json`. It keeps the mod's config folder, `~/.claude/cmods/<plugin-name>`. A failed uninstall step keeps the record, so `cmod teardown` can run again.
|
|
304
|
+
Runs a removed mod's saved uninstall step, then deletes its install record, the saved step, every version of its program, its data folder, and `instances/<plugin-name>/`, where its `singleInstance` and `isService` programs keep their addresses, stops and deletes each service of the computer it runs a program as, with its record and log in `services/<plugin-name>/` ([cmod program](#cmod-program)), takes out each Claude Code setting it changed that still has the value it set, deletes its secrets ([cmod secret](#cmod-secret)), and deletes its entry in `consent.json`. It keeps the mod's config folder, `~/.claude/cmods/<plugin-name>`. A failed uninstall step keeps the record, so `cmod teardown` can run again.
|
|
297
305
|
|
|
298
306
|
### cmod hotkey
|
|
299
307
|
|
|
@@ -345,11 +353,19 @@ Starts a task in a new background Claude Code session, for a mod's `startTask` w
|
|
|
345
353
|
cmod program <mod> [--no-wait | --service [--env <name>]... | --remove-service] -- <command…>
|
|
346
354
|
```
|
|
347
355
|
|
|
348
|
-
Runs one copy of a mod's program for the whole computer, for a `program` job with `singleInstance` ([jobs.md](jobs.md#program)). The first one takes `instances/<mod>/<program>.json.lock` in the cmod store, runs the command without `CLAUDE_CODE_SESSION_ID`, because the copy serves every session, writes its first line on standard output, its address, with the copy's process to `instances/<mod>/<program>.json`, and prints it. It touches its file in the lock every 5 seconds. With `--no-wait`, which a mod's session passes, another one touches the holder's file, prints `held`, and exits 0, and the session reads the address from `instances/<mod>/<program>.json` and runs `cmod program` again once that file is gone or the holder's file is 15 seconds old. Without it, as a mod built on `@cmodjs/core` before 5.3.0 runs it, another one prints the address in that file, then each new one as it changes, and tries the lock again whenever that folder changes and every 5 seconds, so it takes over once the holder exits. A lock whose process is gone counts as free. The holder stops its copy and gives up the lock on SIGTERM, SIGINT, or SIGHUP, and when the session that started it exits, which it checks every 5 seconds. When the copy exits on its own, the holder exits with the copy's exit code, and the copy's standard error passes through. A new holder that finds a copy an earlier holder left running sends it SIGTERM, then SIGKILL after 5 seconds, and starts its own copy only once that one is gone, so two copies never run at once.
|
|
356
|
+
Runs one copy of a mod's program for the whole computer, for a `program` job with `singleInstance` ([jobs.md](jobs.md#program)). The first one takes `instances/<mod>/<program>.json.lock` in the cmod store, runs the command without `CLAUDE_CODE_SESSION_ID`, because the copy serves every session, writes its first line on standard output, its address, with the copy's process to `instances/<mod>/<program>.json`, and prints it. It touches its file in the lock every 5 seconds. With `--no-wait`, which a mod's session passes, another one touches the holder's file, prints `held`, and exits 0, and the session reads the address from `instances/<mod>/<program>.json` and runs `cmod program` again once that file is gone or the holder's file is 15 seconds old. Without it, as a mod built on `@cmodjs/core` before 5.3.0 runs it, another one prints the address in that file, then each new one as it changes, and tries the lock again whenever that folder changes and every 5 seconds, so it takes over once the holder exits. A lock whose process is gone counts as free. The holder stops its copy and gives up the lock on SIGTERM, SIGINT, or SIGHUP, and when the session that started it exits, which it checks every 5 seconds. When the copy exits on its own, the holder exits with the copy's exit code, and the copy's standard error passes through. Every 5 seconds the holder also checks the program's file in the cmod store's `programs` folder, and once a new version of the mod or a build of its linked checkout replaces it, the holder stops its copy, deletes `instances/<mod>/<program>.json`, and exits 0. The session that ran it runs `cmod program` again a second later, and every other session does too once that file is gone, so one of them starts the new file and the others follow its address. A service's holder exits the same way, and launchd or systemd starts it again. A build with the same bytes leaves the file as it was, so the copy keeps running. A new holder that finds a copy an earlier holder left running sends it SIGTERM, then SIGKILL after 5 seconds, and starts its own copy only once that one is gone, so two copies never run at once.
|
|
349
357
|
|
|
350
|
-
With `--service`, which a session passes for a `program` job with `isService`, it makes the holder a service of the computer named `com.claudemodmanager.<mod>.<program>`: a launchd agent in `~/Library/LaunchAgents` on macOS, loaded into the person's login session, and a systemd user service in `~/.config/systemd/user` on Linux, enabled for `default.target`. Its file is mode 600, because it holds the program's environment. The service runs `cmod program <mod> -- <command…>` through the cmod store's `programs/cmod` at login and again whenever it exits, launchd at most once every 10 seconds and systemd 10 seconds after the exit, with `HOME`, `XDG_DATA_HOME`, and `CLAUDE_CONFIG_DIR` as the session has them, a `PATH` of the cmod store's `programs` folder, `/usr/local/bin`, `/opt/homebrew/bin`, `/usr/bin`, `/bin`, `/usr/sbin`, and `/sbin`, and each `--env` variable, which the job passes for each key of its `environment`, `PATH` included. The `PATH` is fixed, because sessions started from different shells hold different ones, and a service rewritten for each would restart at every session start. cmod records it in `services/<mod>/<program>.json` in the cmod store. It loads the service when it is new, changed, or not loaded, waits up to 15 seconds for
|
|
358
|
+
With `--service`, which a session passes for a `program` job with `isService`, it makes the holder a service of the computer named `com.claudemodmanager.<mod>.<program>`: a launchd agent in `~/Library/LaunchAgents` on macOS, loaded into the person's login session, and a systemd user service in `~/.config/systemd/user` on Linux, enabled for `default.target`. Its file is mode 600, because it holds the program's environment. The service runs `cmod program <mod> -- <command…>` through the cmod store's `programs/cmod` at login and again whenever it exits, launchd at most once every 10 seconds and systemd 10 seconds after the exit, with `HOME`, `XDG_DATA_HOME`, and `CLAUDE_CONFIG_DIR` as the session has them, a `PATH` of the cmod store's `programs` folder, `/usr/local/bin`, `/opt/homebrew/bin`, `/usr/bin`, `/bin`, `/usr/sbin`, and `/sbin`, `CLAUDE_CODE_EXECPATH`, and each `--env` variable, which the job passes for each key of its `environment`, `PATH` included. The `PATH` is fixed, because sessions started from different shells hold different ones, and a service rewritten for each would restart at every session start. `CLAUDE_CODE_EXECPATH` names the Claude Code of the session that wrote the service, so a `cmod` command the program runs finds Claude Code though the `PATH` holds none. It names the path Claude Code's updates keep, `~/.local/bin/claude` when that launcher runs the same install, because the updater deletes old versions and a service rewritten for each version would restart at every update. cmod records it in `services/<mod>/<program>.json` in the cmod store. On macOS the launchd agent writes the service's standard error, the program's and cmod's own, to `services/<mod>/<program>.log` beside that record, because launchd keeps no output of its own. Each holder that starts the program first cuts a log over 1 MiB to the whole lines of its last 512 KiB, so a program that fails at every restart, which launchd starts again every 10 seconds, never fills the disk. Linux keeps the program's output in the systemd journal, so the systemd user service writes no log. It holds the mod's lock in the cmod store while it writes and loads the service and waits for it, so sessions that start the mod at once, as every session does after an update, never load it beside each other or beside `cmod setup` or `cmod teardown` of the mod. It loads the service when it is new, changed, or not loaded, waits up to 15 seconds for the program to write its address to `instances/<mod>/<program>.json`, prints `held`, and exits 0, so the session follows the instance file as with `--no-wait`. A program that has written no address after 15 seconds still counts as started while a holder holds `instances/<mod>/<program>.json.lock`, so a program slow to listen keeps its service. A service with neither, such as a program that exits at once and whose holder therefore held the lock only for a moment, is stopped, disabled, and deleted with its record, as `cmod remove` does, and it fails with what shows why: on macOS the service's log in the cmod store, which the removal keeps, and on Linux `journalctl --user -u <label>.service`. When the computer does not take the service, such as a Linux machine without a systemd user session, it deletes what it wrote, says why on standard error, and runs as `--no-wait` does. When the computer took the service, a loaded launchd agent or an enabled systemd user service, and starting it still failed, such as systemd refusing a program that exited too often, it stops, disables, and deletes the service and its record as `cmod remove` does, and fails with the service manager's error and what shows why, because the program fails and the person needs that error. The service restarts on a new program as every holder does, and `cmod teardown` stops and deletes each one.
|
|
359
|
+
|
|
360
|
+
With `--remove-service`, it stops the program's service, deletes its file, its record in `services/<mod>/<program>.json`, and its log, and exits 0, holding the mod's lock in the cmod store so it never runs beside `cmod setup` or `cmod teardown` of the mod. A program with no service changes nothing. A session that starts a mod runs it for each record in `services/<mod>/` whose program the mod's setup no longer adds as an `isService` program, so a new version that dropped `isService` or renamed the program leaves no service of the old one. A session reads that folder without a process, so a mod with no `services/<mod>/` folder runs nothing for it.
|
|
361
|
+
|
|
362
|
+
### cmod web serve
|
|
363
|
+
|
|
364
|
+
```text
|
|
365
|
+
cmod web serve
|
|
366
|
+
```
|
|
351
367
|
|
|
352
|
-
|
|
368
|
+
Serves the browser app that [`cmod web`](#cmod-web) opens, on 127.0.0.1 only. The cmod plugin of each session an app shows runs it through `cmod program` while `Show the Sidebar in your browser` is on, so one copy serves every session. It reads every running session itself: Claude Code's `sessions/<pid>.json` records, a process counting as running only while its pid runs with the start time Claude Code recorded, and leaving out each `sdk-cli` process, then each session's transcript through the conversation index, as [`cmod history`](#cmod-history) does. A session Claude Code records as waiting on a permission prompt or a question moves to Needs you as soon as the dialog opens, and a turn stopped while a command it ran keeps running in the background says so. Each session's cmod plugin adds what only its own hooks hear: the permission prompt or question it waits on, how its last turn ended, and its context fill, and long-polls for the tabs a browser shows, the presses there, and the prompts and Stops the browser sends it. A session whose cmod plugin is older shows only what its transcript says. It keeps `web.json` in the cmod store with its port, listens on that port again while it is free, so a browser tab left open reconnects after a restart, and prints `127.0.0.1:<port>` once it listens. It keeps which replies the person read or marked done in `web-read.json` beside it. It refuses a request for any host but `127.0.0.1` and `localhost` with its port, and a change from any other page. It exits once the preference is off or a newer cmod is in the cmod store. A session that already ran it then starts it again through `cmod program` with the newest cmod, and that copy waits without listening while the preference is off.
|
|
353
369
|
|
|
354
370
|
### cmod option
|
|
355
371
|
|
package/docs/dependencies.md
CHANGED
|
@@ -133,7 +133,7 @@ tracer: <the message of the error the method threw>
|
|
|
133
133
|
|
|
134
134
|
- `tracer is not installed` covers a provider whose code did not load. The caller's error toast shows a `Plugins` button, which opens Claude Code's `/plugin`.
|
|
135
135
|
- `tracer is not set up` covers a provider the person declined to install and one whose install failed, and names why. The provider's own toast shows the same reason, with `Retry` or `Install`.
|
|
136
|
-
- `tracer is installing` covers a provider
|
|
136
|
+
- `tracer is installing` covers a provider whose install step still runs 9 seconds after the call. A provider that is installing or only starting makes the call wait for it, up to 9 seconds.
|
|
137
137
|
- When tracer is disabled, Claude Code unloads the mod that lists it, with its own error: `Dependency "tracer" is disabled — enable it or remove the dependency`.
|
|
138
138
|
- A call fails with `mod.dependencies.tracer.signatures passed its 30 s deadline` when the other mod takes longer than 30 seconds. A job bounds the whole function that makes the call by its own deadline ([jobs.md](jobs.md)), so a slow call inside `slashCommand` can fail the command first, with `/outline passed the 30 s deadline of slashCommand`.
|
|
139
139
|
|
package/docs/jobs.md
CHANGED
|
@@ -332,8 +332,8 @@ type Program = {
|
|
|
332
332
|
- The program's first line on standard output must be its address: `127.0.0.1:<port>`, or `unix:<absolute socket path>`. `ready()` then resolves `{ url: 'http://127.0.0.1:<port>' }`, or `{ url: 'http://localhost', socketPath }`. Pass both to `http.fetch`, which reaches that address.
|
|
333
333
|
- In an interactive session the program starts with the mod. Otherwise it starts at the first `ready()`.
|
|
334
334
|
- When the program exits, cmod starts it again after 1, 2, 4, 8, and 16 seconds. After 5 failed tries, or a first line that is not an address, the state is `fatal`, `ready()` rejects, and cmod logs `<mod>: the <program> program stopped: <reason>`.
|
|
335
|
-
- `singleInstance: true` runs one copy on the computer, however many sessions load the mod, such as a server that is the only writer of its data. The first session starts the copy through [`cmod program`](commands.md#cmod-program), every other session reads the copy's address from the cmod store and runs no process of its own, and every session's `ready()` resolves that copy's address. When the session running the copy ends, another open session starts a new copy within a few seconds, or within 20 seconds when the copy's session was killed with its `cmod program`, and from then on `ready()` resolves the new address in every session, so ask `ready()` before each use rather than keeping its answer. A copy a killed session left running is stopped before the new one starts. Two `singleInstance` programs with the same program name in one mod throw at `mod.use`.
|
|
336
|
-
- `isService: true` makes the program a service of the computer, so it runs whenever the person is logged in, with no Claude Code open, such as a program that records sessions Claude Code never sees. The first session that starts the mod has [`cmod program`](commands.md#cmod-program) write a launchd agent on macOS, or a systemd user service on Linux, which starts the program at login and again whenever it exits, with `environment`. The service's `PATH` is cmod's programs folder, `/usr/local/bin`, `/opt/homebrew/bin`, and the system folders, unless `environment` sets `PATH
|
|
335
|
+
- `singleInstance: true` runs one copy on the computer, however many sessions load the mod, such as a server that is the only writer of its data. The first session starts the copy through [`cmod program`](commands.md#cmod-program), every other session reads the copy's address from the cmod store and runs no process of its own, and every session's `ready()` resolves that copy's address. When the session running the copy ends, another open session starts a new copy within a few seconds, or within 20 seconds when the copy's session was killed with its `cmod program`, and from then on `ready()` resolves the new address in every session, so ask `ready()` before each use rather than keeping its answer. A copy a killed session left running is stopped before the new one starts. When cmod installs a new version of the mod, or builds a new program from its linked checkout, the copy restarts on the new program a few seconds later, and `ready()` resolves the new copy's address. Two `singleInstance` programs with the same program name in one mod throw at `mod.use`.
|
|
336
|
+
- `isService: true` makes the program a service of the computer, so it runs whenever the person is logged in, with no Claude Code open, such as a program that records sessions Claude Code never sees. The first session that starts the mod has [`cmod program`](commands.md#cmod-program) write a launchd agent on macOS, or a systemd user service on Linux, which starts the program at login and again whenever it exits, with `environment`. The service's `PATH` is cmod's programs folder, `/usr/local/bin`, `/opt/homebrew/bin`, and the system folders, unless `environment` sets `PATH`, and its `CLAUDE_CODE_EXECPATH` names the session's Claude Code by the path its updates keep, so a `cmod` command the program runs, such as `cmod options`, finds Claude Code. Every session reads the service's address from the cmod store, as a `singleInstance` program's sessions do, and `ready()` resolves it. The service runs one copy, so `isService` needs no `singleInstance` beside it. The mod writes no service file: the service restarts on the new program when cmod installs a new version of the mod or builds a new program from its linked checkout, and cmod stops and deletes it when the mod is removed. When a new version's setup no longer adds the `isService` program, because it dropped `isService` or renamed the program, the first session that starts that version stops and deletes the old service, so the computer stops running a program the mod no longer ships. Settings shows `Runs as a service of this computer` on the mod's page, and [`cmod list`](commands.md#cmod-list) names the program. On a computer that does not take the service, such as a Linux machine without a systemd user session, the program runs as a `singleInstance` program does. A service the computer took but could not start is removed, and the program fails with the service manager's error, as an exiting program does. A service whose program printed no address within 15 seconds and no longer runs is removed the same way. On macOS the program's standard error goes to `services/<mod>/<program>.log` in the cmod store, which that error names, and on Linux to the systemd journal. Two `isService` programs with the same program name in one mod throw at `mod.use`.
|
|
337
337
|
- A program that ships with the mod gets onto `PATH` through the `program` key of the mod's `package.json` ([install-steps.md](install-steps.md)). A program an install step fetched with `cmod download` is not on `PATH`, so `command` names it by its full path, `${mod.dataFolder}/bin/<program>`.
|
|
338
338
|
|
|
339
339
|
```ts
|
package/docs/mod.md
CHANGED
|
@@ -537,7 +537,7 @@ type Device = { id: string; name: string; os: 'darwin' | 'linux'; arch: 'arm64'
|
|
|
537
537
|
```
|
|
538
538
|
|
|
539
539
|
- `id` is the same on one computer for every session, mod, and reinstall, and differs between computers. cmod reads it from the operating system and stores nothing: the IOPlatformUUID on macOS, and on Linux `/etc/machine-id`, or `/var/lib/dbus/machine-id` when that holds none, as systemd and D-Bus read them, hashed for cmod the way systemd's `sd_id128_get_machine_app_specific` hashes a machine id for an app, so the id never shows the computer's own.
|
|
540
|
-
- `name` is the name the computer goes by on its network: its LocalHostName on macOS, such as `
|
|
540
|
+
- `name` is the name the computer goes by on its network: its LocalHostName on macOS, such as `Office-Mac-mini`, and its hostname on Linux.
|
|
541
541
|
- `os` and `arch` are the names cmod's builds use, such as `darwin` and `arm64`.
|
|
542
542
|
- `read` reads the computer the first time the mod calls it, and answers the same device after that. It rejects on a computer other than macOS or Linux on arm64 or x64. It also rejects on a Linux computer where neither `/etc/machine-id` nor `/var/lib/dbus/machine-id` holds a machine id, as in many containers, with a sentence that names both files.
|
|
543
543
|
- A mod's program that runs with no session, such as over `ssh`, reads the same device with `cmod device --json` ([commands.md](commands.md#cmod-device)).
|
package/docs/ui.md
CHANGED
|
@@ -145,6 +145,8 @@ type Page<Params = undefined> = {
|
|
|
145
145
|
- A `render` that throws draws `The <title> page could not draw: <error>` in the page, and cmod shows the error toast `The <title> page could not draw` once, until the page draws again.
|
|
146
146
|
- A press on a `Button` from an older drawing, such as one drawn before the mod reloaded, runs nothing. cmod shows the toast `The <mod> button was from an older drawing, so nothing ran` and draws the page again.
|
|
147
147
|
|
|
148
|
+
The person can run their sessions from the browser app too, which `open in browser` on the Sidebar's key bar opens and Settings, under cmod, turns off. It lists every running session, and an open session shows its Dashboard, pages, and Settings in tabs beside its conversation, as in the Sidebar. A page needs no change: the browser draws the same `render`, with `props.columns` the browser's width in characters and `props.isFocused` true. A `Button`, `Input`, `Select`, or Markdown link pressed there runs the same handler, with `surface: 'desktop'`, and the page redraws in the browser and in the Sidebar. A page the browser shows counts as `isShown`. The browser draws an `Image` from a file or shared memory as its `alt` text, and `Code` without syntax colors.
|
|
149
|
+
|
|
148
150
|
A hotkey is the usual way in:
|
|
149
151
|
|
|
150
152
|
```tsx
|
package/package.json
CHANGED
package/records.d.ts
CHANGED
|
@@ -86,19 +86,32 @@ export declare function instanceFolder(store: string, mod: string): string;
|
|
|
86
86
|
export declare function instancePath(store: string, mod: string, executable: string): string;
|
|
87
87
|
export declare function serviceFolder(store: string, mod: string): string;
|
|
88
88
|
export declare function servicePath(store: string, mod: string, executable: string): string;
|
|
89
|
+
export declare function serviceLogPath(store: string, mod: string, executable: string): string;
|
|
89
90
|
export type Links = {
|
|
90
91
|
readonly marketplaces: Readonly<Record<string, string>>;
|
|
91
92
|
readonly turnedOff: Readonly<Record<string, readonly string[]>>;
|
|
92
93
|
};
|
|
93
94
|
export declare function parseLinks(value: unknown, path: string): Links;
|
|
94
95
|
export declare function linkedMarketplacesOf(knownMarketplaces: unknown, links: Links): [name: string, folder: string][];
|
|
96
|
+
export type LinkedCheckout = {
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly marketplace: string;
|
|
99
|
+
readonly folder: string;
|
|
100
|
+
};
|
|
101
|
+
export declare function linkedCheckoutsOf(read: ReadFile, knownMarketplaces: unknown, links: Links): Promise<LinkedCheckout[]>;
|
|
95
102
|
export declare function hasLinkedMods(knownMarketplaces: unknown, links: Links): boolean;
|
|
96
103
|
export declare function widgetsPath(store: string): string;
|
|
97
104
|
export declare function preferencesPath(store: string): string;
|
|
98
105
|
export type Preferences = {
|
|
99
106
|
readonly showsInstalledModErrors: boolean;
|
|
107
|
+
readonly servesWebUi: boolean;
|
|
100
108
|
};
|
|
101
109
|
export declare function parsePreferences(value: unknown, path: string): Preferences;
|
|
110
|
+
export declare function webPath(store: string): string;
|
|
111
|
+
export type WebUi = {
|
|
112
|
+
readonly port: number;
|
|
113
|
+
};
|
|
114
|
+
export declare function parseWebUi(value: unknown, path: string): WebUi | undefined;
|
|
102
115
|
export type Contact = {
|
|
103
116
|
readonly kind: 'github';
|
|
104
117
|
readonly repository: string;
|
|
@@ -135,7 +148,7 @@ export declare function newestLog(entries: readonly LogEntry[]): LogEntry[];
|
|
|
135
148
|
export declare function versionsLine({ mod, core, cmod, program, claudeCode }: LogVersions): string;
|
|
136
149
|
export declare function logReport(entry: LogEntry): string;
|
|
137
150
|
export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
|
|
138
|
-
export declare const coreVersion = "5.
|
|
151
|
+
export declare const coreVersion = "5.12.0";
|
|
139
152
|
export declare const oldestCmodVersion = "5.10.0";
|
|
140
153
|
export declare function hotkeyCommand(mod: string, hotkey: string): string;
|
|
141
154
|
export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
|
package/records.d.ts.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AAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAQnE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
|
package/records.js
CHANGED
|
@@ -232,6 +232,9 @@ export function serviceFolder(store, mod) {
|
|
|
232
232
|
export function servicePath(store, mod, executable) {
|
|
233
233
|
return `${serviceFolder(store, mod)}/${checkedName(executable)}.json`;
|
|
234
234
|
}
|
|
235
|
+
export function serviceLogPath(store, mod, executable) {
|
|
236
|
+
return `${serviceFolder(store, mod)}/${checkedName(executable)}.log`;
|
|
237
|
+
}
|
|
235
238
|
export function parseLinks(value, path) {
|
|
236
239
|
if (value === undefined)
|
|
237
240
|
return { marketplaces: {}, turnedOff: {} };
|
|
@@ -246,6 +249,27 @@ export function linkedMarketplacesOf(knownMarketplaces, links) {
|
|
|
246
249
|
return isObject(known) && isObject(known['source']) && known['source']['source'] === 'directory' && known['source']['path'] === folder;
|
|
247
250
|
});
|
|
248
251
|
}
|
|
252
|
+
export async function linkedCheckoutsOf(read, knownMarketplaces, links) {
|
|
253
|
+
const checkouts = [];
|
|
254
|
+
for (const [marketplace, folder] of linkedMarketplacesOf(knownMarketplaces, links)) {
|
|
255
|
+
const path = `${folder}/.claude-plugin/marketplace.json`;
|
|
256
|
+
const text = await read(path);
|
|
257
|
+
const manifest = text === undefined ? undefined : parsedJson(text, path);
|
|
258
|
+
const plugins = isObject(manifest) && Array.isArray(manifest['plugins']) ? manifest['plugins'] : [];
|
|
259
|
+
for (const plugin of plugins)
|
|
260
|
+
if (isObject(plugin) && typeof plugin['name'] === 'string' && typeof plugin['source'] === 'string')
|
|
261
|
+
checkouts.push({ name: plugin['name'], marketplace, folder: `${folder}/${plugin['source'].replace(/^\.\//, '')}` });
|
|
262
|
+
}
|
|
263
|
+
return checkouts;
|
|
264
|
+
}
|
|
265
|
+
function parsedJson(text, path) {
|
|
266
|
+
try {
|
|
267
|
+
return JSON.parse(text);
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
throw new Error(`${path} is not valid JSON: ${messageOf(error)}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
249
273
|
export function hasLinkedMods(knownMarketplaces, links) {
|
|
250
274
|
return linkedMarketplacesOf(knownMarketplaces, links).length > 0;
|
|
251
275
|
}
|
|
@@ -255,12 +279,22 @@ export function widgetsPath(store) {
|
|
|
255
279
|
export function preferencesPath(store) {
|
|
256
280
|
return `${store}/preferences.json`;
|
|
257
281
|
}
|
|
282
|
+
const preferenceKeys = ['showsInstalledModErrors', 'servesWebUi'];
|
|
258
283
|
export function parsePreferences(value, path) {
|
|
259
|
-
if (value
|
|
260
|
-
return { showsInstalledModErrors: false };
|
|
261
|
-
if (!isObject(value) || (value['showsInstalledModErrors'] !== undefined && typeof value['showsInstalledModErrors'] !== 'boolean'))
|
|
284
|
+
if (value !== undefined && (!isObject(value) || preferenceKeys.some((key) => value[key] !== undefined && typeof value[key] !== 'boolean')))
|
|
262
285
|
throw new Error(`${path} is not a map of cmod's preferences to true or false. Delete it, and cmod uses its defaults.`);
|
|
263
|
-
|
|
286
|
+
const saved = isObject(value) ? value : {};
|
|
287
|
+
return { showsInstalledModErrors: saved['showsInstalledModErrors'] === true, servesWebUi: saved['servesWebUi'] === true };
|
|
288
|
+
}
|
|
289
|
+
export function webPath(store) {
|
|
290
|
+
return `${store}/web.json`;
|
|
291
|
+
}
|
|
292
|
+
export function parseWebUi(value, path) {
|
|
293
|
+
if (value === undefined)
|
|
294
|
+
return undefined;
|
|
295
|
+
if (!isObject(value) || !Number.isInteger(value['port']))
|
|
296
|
+
throw new Error(`${path} is not the web UI's port. Delete it, and cmod web serve writes it again.`);
|
|
297
|
+
return { port: value['port'] };
|
|
264
298
|
}
|
|
265
299
|
export const loggedFailures = 100;
|
|
266
300
|
export function logFolder(store) {
|
|
@@ -308,7 +342,7 @@ function readHotkeys(hotkeys) {
|
|
|
308
342
|
throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
|
|
309
343
|
return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
|
|
310
344
|
}
|
|
311
|
-
export const coreVersion = '5.
|
|
345
|
+
export const coreVersion = '5.12.0';
|
|
312
346
|
export const oldestCmodVersion = '5.10.0';
|
|
313
347
|
export function hotkeyCommand(mod, hotkey) {
|
|
314
348
|
return `${mod}--${hotkey}`;
|
|
@@ -11,4 +11,6 @@ export declare function withBareRefusals(claude: Claude): Claude;
|
|
|
11
11
|
export declare function answeringOwnCalls(claude: Claude, router: Router): Claude;
|
|
12
12
|
export declare function notInstalled(name: string): string;
|
|
13
13
|
export declare function isNotInstalled(name: string, error: unknown): boolean;
|
|
14
|
+
export declare function stillInstalling(name: string): string;
|
|
15
|
+
export declare function isStillInstalling(name: string, error: unknown): boolean;
|
|
14
16
|
//# sourceMappingURL=dependencies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/runtime/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAG9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,cAAc,SAAS,CAAA;AAEpC,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAE3C,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,WAAW,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AAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAOpI;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQvD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CASxE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAEpE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAEvE"}
|
package/runtime/dependencies.js
CHANGED
|
@@ -43,3 +43,9 @@ export function notInstalled(name) {
|
|
|
43
43
|
export function isNotInstalled(name, error) {
|
|
44
44
|
return messageOf(error).endsWith(notInstalled(name));
|
|
45
45
|
}
|
|
46
|
+
export function stillInstalling(name) {
|
|
47
|
+
return `${name} is installing. Try again when it's ready.`;
|
|
48
|
+
}
|
|
49
|
+
export function isStillInstalling(name, error) {
|
|
50
|
+
return messageOf(error).endsWith(stillInstalling(name));
|
|
51
|
+
}
|
package/runtime/engine.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { HookStream, ProcessSpawnChunk, ProcessSpawnResult } from 'claude-c
|
|
|
2
2
|
import type { Claude } from './claude.js';
|
|
3
3
|
import type { Pages } from './pages.js';
|
|
4
4
|
import type { Router } from './router.js';
|
|
5
|
+
import type { Subscription } from '../utils/subscription.js';
|
|
5
6
|
import type { Failure } from './toaster.js';
|
|
6
7
|
import type { ToolCalls } from './tool-calls.js';
|
|
7
8
|
import type { Watches } from './watches.js';
|
|
@@ -15,6 +16,7 @@ export type Engine = {
|
|
|
15
16
|
readonly answerInput: <Answer>(run: () => Promise<Answer>, passOn: () => Promise<unknown>) => Promise<Answer>;
|
|
16
17
|
readonly spawnCmod: (args: readonly string[], env?: Readonly<Record<string, string>>) => HookStream<ProcessSpawnChunk, ProcessSpawnResult>;
|
|
17
18
|
readonly watches: Watches;
|
|
19
|
+
readonly onRedraw: (listener: () => void) => Subscription;
|
|
18
20
|
readonly widgets?: Widgets;
|
|
19
21
|
readonly pages?: Pages;
|
|
20
22
|
};
|
package/runtime/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/runtime/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,OAAO,CAAA;IAC1C,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,G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AE,MAAM,gBAAgB,GAAG,SAA2B,EACtE,OAAO,GAAE,aAAkB,EAC3B,UAAU,UAAO,EACjB,eAAe,CAAC,EAAE,eAAe,GAChC,SAAS,CAAC,KAAK,CAAC,CA6iBlB"}
|
package/runtime/lifecycle.js
CHANGED
|
@@ -4,7 +4,7 @@ import { firstLine, formatExit, messageOf } from '../utils/text.js';
|
|
|
4
4
|
import { beforeDeadline, settledAfterAbort } from './deadline.js';
|
|
5
5
|
import { announcementMs, announcementOf } from './announce.js';
|
|
6
6
|
import { bind } from './bound.js';
|
|
7
|
-
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, loadedMethod, withBareRefusals } from './dependencies.js';
|
|
7
|
+
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, isStillInstalling, loadedMethod, stillInstalling, withBareRefusals } from './dependencies.js';
|
|
8
8
|
import { keepEngine } from './engine.js';
|
|
9
9
|
import { classicFailure, classicHook, userSkillHook } from './hooks.js';
|
|
10
10
|
import { cmodError, locatingPrograms, newestCmodVersion, readLines, runCmod, spawnCmod } from './programs.js';
|
|
@@ -25,6 +25,7 @@ import { createUi, partMethods, stalePress } from './ui.js';
|
|
|
25
25
|
import { Progress } from '../ui/components.js';
|
|
26
26
|
import { Box, Text } from '../ui/elements.js';
|
|
27
27
|
const listenMethods = [conversationMethods.subscribe, conversationMethods.watchBefore];
|
|
28
|
+
const answeredAtOnce = [...listenMethods, partMethods.draw];
|
|
28
29
|
const announcedKey = 'cmod:announced';
|
|
29
30
|
const cmodUpdatedKey = 'cmod:cmod-updated-for';
|
|
30
31
|
const installId = 'cmod:install';
|
|
@@ -125,6 +126,16 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
125
126
|
const heldListens = new Map();
|
|
126
127
|
let settleStart = () => undefined;
|
|
127
128
|
const startSettled = new Promise((resolve) => (settleStart = resolve));
|
|
129
|
+
let installSettled;
|
|
130
|
+
let settleInstall = () => undefined;
|
|
131
|
+
const whenInstalled = () => phase === 'installing' || phase === 'waiting'
|
|
132
|
+
? (installSettled ??= new Promise((resolve) => {
|
|
133
|
+
settleInstall = () => {
|
|
134
|
+
installSettled = undefined;
|
|
135
|
+
resolve();
|
|
136
|
+
};
|
|
137
|
+
}))
|
|
138
|
+
: undefined;
|
|
128
139
|
const claude = () => {
|
|
129
140
|
if (runtime === undefined)
|
|
130
141
|
throw new Error(`${definition.name}: the lifecycle has not started. registerMod(addHook, mod, options) starts it at session.start.`);
|
|
@@ -134,6 +145,7 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
134
145
|
const toastFailure = (shown) => runtime?.toaster.fail(shown);
|
|
135
146
|
const fail = (reason, fix, retry, error) => {
|
|
136
147
|
phase = 'failed';
|
|
148
|
+
settleInstall();
|
|
137
149
|
failure ??= new Error(`${definition.name}: ${reason}${/[.!?]$/.test(reason) ? '' : '.'}${fix === undefined ? '' : ` ${fix}`}`, { cause: error });
|
|
138
150
|
const again = retry === undefined ? {} : { retry: () => ((failure = undefined), stopRetrying(), retry().catch(report)) };
|
|
139
151
|
toastFailure({ id: installId, message: reason, ...(fix === undefined ? {} : { description: fix }), ...(error === undefined ? {} : { error }), ...again, isCritical: true });
|
|
@@ -178,6 +190,7 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
178
190
|
await programs?.refresh();
|
|
179
191
|
phase = 'ready';
|
|
180
192
|
activation ??= new Promise((resolve) => claude().clock.after(0, () => resolve(activate().catch(report))));
|
|
193
|
+
settleInstall();
|
|
181
194
|
claude().ui.invalidate('ui.render');
|
|
182
195
|
};
|
|
183
196
|
const recordThroughCmod = async () => {
|
|
@@ -511,6 +524,7 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
511
524
|
});
|
|
512
525
|
});
|
|
513
526
|
const holdUntilStarted = (signal) => held(startSettled.then(whenActive), signal);
|
|
527
|
+
const holdUntilInstalled = (signal) => held(startSettled.then(whenInstalled).then(whenActive), signal);
|
|
514
528
|
const holdUntilActive = (signal) => {
|
|
515
529
|
const activating = whenActive();
|
|
516
530
|
return activation !== undefined && phase !== 'active' ? held(activating, signal) : activating.then(() => false);
|
|
@@ -544,17 +558,19 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
544
558
|
const isCallToThisMod = (event === 'cmod.call' && e.to === definition.name) || (event === 'tool.call' && typeof tool === 'string' && tool.startsWith(`mcp__${definition.name}__`));
|
|
545
559
|
if (event === 'cmod.call' && !isCallToThisMod)
|
|
546
560
|
return next(e);
|
|
547
|
-
const
|
|
561
|
+
const isListen = isCallToThisMod && event === 'cmod.call' && listenMethods.includes(asked.method);
|
|
562
|
+
const waitsForInstall = isCallToThisMod && !(event === 'cmod.call' && answeredAtOnce.includes(asked.method));
|
|
563
|
+
const isLate = await (waitsForInstall ? holdUntilInstalled(signal) : event === 'classic.SessionStart' || event === 'session.append' || isCallToThisMod ? holdUntilStarted(signal) : holdUntilActive(signal));
|
|
548
564
|
if (event === 'classic.SessionStart' && phase !== 'active') {
|
|
549
565
|
missedSessionStart = e;
|
|
550
566
|
return next(e);
|
|
551
567
|
}
|
|
552
568
|
if (isCallToThisMod && phase !== 'active') {
|
|
553
|
-
if (
|
|
569
|
+
if (isListen) {
|
|
554
570
|
heldListens.set(`${asked.caller}\n${asked.method}\n${String(asked.input.session)}`, asked);
|
|
555
571
|
return { value: null };
|
|
556
572
|
}
|
|
557
|
-
return { deny: phase === 'failed' ? notSetUp() :
|
|
573
|
+
return { deny: phase === 'failed' ? notSetUp() : stillInstalling(definition.name) };
|
|
558
574
|
}
|
|
559
575
|
if (isLate && phase !== 'active')
|
|
560
576
|
return (startingRouter ?? router).dispatchFailure(event, e, new Error(`it was still starting after ${startHoldMs / 1000} s`), next, false);
|
|
@@ -658,7 +674,15 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
658
674
|
async function createMod(definition, runtime) {
|
|
659
675
|
const { router, toaster } = runtime;
|
|
660
676
|
const report = (failure) => void toaster.fail(failure);
|
|
661
|
-
const
|
|
677
|
+
const redraws = new Set();
|
|
678
|
+
const calling = answeringOwnCalls(withBareRefusals(runtime.claude), router);
|
|
679
|
+
const invalidate = (event) => {
|
|
680
|
+
calling.ui.invalidate(event);
|
|
681
|
+
if (event === 'ui.render')
|
|
682
|
+
for (const redraw of redraws)
|
|
683
|
+
redraw();
|
|
684
|
+
};
|
|
685
|
+
const claude = { ...calling, ui: { ...calling.ui, invalidate } };
|
|
662
686
|
const added = [];
|
|
663
687
|
const announce = (feature) => {
|
|
664
688
|
added.push(feature);
|
|
@@ -983,7 +1007,10 @@ async function createMod(definition, runtime) {
|
|
|
983
1007
|
const tellColor = (to, told) => {
|
|
984
1008
|
if (told.session === '' || to === cmodPluginName)
|
|
985
1009
|
return;
|
|
986
|
-
claude.clock.after(0, () => void claude.cmod.call({ to, method: conversationMethods.sessionColor, input: told }).catch((error) =>
|
|
1010
|
+
claude.clock.after(0, () => void claude.cmod.call({ to, method: conversationMethods.sessionColor, input: told }).catch((error) => {
|
|
1011
|
+
if (!isStillInstalling(to, error))
|
|
1012
|
+
claude.ui.warn('color:tell', `cmod: ${to} did not hear the session's color: ${messageOf(error)}`);
|
|
1013
|
+
}));
|
|
987
1014
|
};
|
|
988
1015
|
conversations?.onColor((told) => {
|
|
989
1016
|
client.recolor(told);
|
|
@@ -1036,6 +1063,10 @@ async function createMod(definition, runtime) {
|
|
|
1036
1063
|
answerInput: area.answerInput,
|
|
1037
1064
|
spawnCmod: (args, env) => spawnCmod(claude, args, session, env),
|
|
1038
1065
|
watches,
|
|
1066
|
+
onRedraw(listener) {
|
|
1067
|
+
redraws.add(listener);
|
|
1068
|
+
return { remove: () => void redraws.delete(listener) };
|
|
1069
|
+
},
|
|
1039
1070
|
...(widgets === undefined ? {} : { widgets }),
|
|
1040
1071
|
...(pages === undefined ? {} : { pages }),
|
|
1041
1072
|
});
|
package/runtime/pages.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.d.ts","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AO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IACtE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAChE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACzC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAA;CAC3D,GAAG,KAAK,CAgIR"}
|
package/runtime/pages.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isObject } from '../records.js';
|
|
2
2
|
import { Text } from '../ui/elements.js';
|
|
3
3
|
import { messageOf } from '../utils/text.js';
|
|
4
|
-
import { cmodPluginName, isNotInstalled } from './dependencies.js';
|
|
4
|
+
import { cmodPluginName, isNotInstalled, isStillInstalling } from './dependencies.js';
|
|
5
5
|
import { partMethods } from './ui.js';
|
|
6
6
|
const askedWaitMs = 1000;
|
|
7
7
|
export function pagesOf(input) {
|
|
@@ -48,7 +48,7 @@ export function servePages({ claude, router, report, tellRefusedPress, widgets,
|
|
|
48
48
|
claude.cmod
|
|
49
49
|
.call({ to: mod, method: partMethods.list, input: null })
|
|
50
50
|
.then((parts) => void declared.set(mod, pagesOf(parts)), (error) => {
|
|
51
|
-
if (!isNotInstalled(mod, error))
|
|
51
|
+
if (!isNotInstalled(mod, error) && !isStillInstalling(mod, error))
|
|
52
52
|
claude.ui.warn(`pages:list:${mod}`, `cmod: ${mod} did not list its pages: ${messageOf(error)}`);
|
|
53
53
|
})
|
|
54
54
|
.finally(() => asking.delete(mod));
|
|
@@ -64,8 +64,12 @@ export function servePages({ claude, router, report, tellRefusedPress, widgets,
|
|
|
64
64
|
const listed = [...stylers];
|
|
65
65
|
tellStylers(listed);
|
|
66
66
|
for (const told of declared.keys()) {
|
|
67
|
-
if (told
|
|
68
|
-
|
|
67
|
+
if (told === cmodPluginName)
|
|
68
|
+
continue;
|
|
69
|
+
void claude.cmod.call({ to: told, method: partMethods.stylers, input: listed }).catch((error) => {
|
|
70
|
+
if (!isStillInstalling(told, error))
|
|
71
|
+
claude.ui.warn(`pages:stylers:${told}`, `cmod: ${told} did not hear which mods style markdown: ${messageOf(error)}`);
|
|
72
|
+
});
|
|
69
73
|
}
|
|
70
74
|
};
|
|
71
75
|
const update = (mod, { parts: listing, redraw, requests, isAsked }) => {
|
package/runtime/parts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../src/runtime/parts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../src/runtime/parts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,SAAS,CAAA;AAErE,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;IACpH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAA;IAClH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAA;AAMD,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;CAAE,GAAG,UAAU,CAyD9N"}
|
package/runtime/parts.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { elementOf } from '../ui/elements.js';
|
|
2
2
|
import { messageOf } from '../utils/text.js';
|
|
3
|
+
import { isStillInstalling } from './dependencies.js';
|
|
3
4
|
import { partMethods } from './ui.js';
|
|
4
5
|
const keptDrawings = 200;
|
|
5
6
|
export function drawnParts({ claude, report, press }) {
|
|
@@ -27,6 +28,8 @@ export function drawnParts({ claude, report, press }) {
|
|
|
27
28
|
claude.cmod
|
|
28
29
|
.call({ to: mod, method: partMethods.draw, input })
|
|
29
30
|
.then((data) => keep((data ?? null)), (error) => {
|
|
31
|
+
if (isStillInstalling(mod, error))
|
|
32
|
+
return keep(drawn.get(key)?.data ?? null);
|
|
30
33
|
report(`draw:${mod}`, `${name} drew nothing`, error);
|
|
31
34
|
keep(drawn.get(key)?.data ?? null, messageOf(error));
|
|
32
35
|
})
|