@cmodjs/core 5.11.0 → 5.12.1

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 CHANGED
@@ -247,7 +247,7 @@ Opens the browser app at `http://127.0.0.1:<port>/` and prints that address. The
247
247
  cmod watch
248
248
  ```
249
249
 
250
- Reloads the sessions working inside a checkout `cmod link` linked once it builds after a change, and tells every other running session. It watches each linked folder, outside `node_modules` and `.git`, and skips a change to a file git ignores, such as the `.claude-plugin/types/` Claude Code writes each time it loads the mod, a change inside the program's `output` folder, and a change to a file that is gone again and git does not track, such as a build's temporary file. Once a folder has had no change for 2 seconds, it bundles the mod's hooks module as `cmod publish` does. When a changed file is one the program's build reads, a file in `cli/` or one the JavaScript or TypeScript file `cli/package.json` `bin` names imports, such as the mod's own `src/`, it also builds the program `cli/` declares and links it as `cmod link` does, so the program in cmod's programs folder is never older than the mod. A change no program build reads builds no program. A program whose build failed builds again at the next change, whatever it changed. A program that stops when its file changes then restarts on the new build, and a build that writes the same program leaves the file as it is. A mod that builds marks `plugins-changed` with the checkout's folder, so each session whose project is that folder or inside it reloads by itself once the change has been quiet for 2 seconds, after its turn ends, and every other session shows the `Plugins changed` toast. A bundle or program build that still fails 10 seconds after the last change shows `<mod> does not build` with the error as one toast in every session, the last program that built keeps running, and the toast goes once the mod builds. So an agent's half-written file reloads nothing and shows nothing. At its start it bundles again each mod whose failure it finds in `build-failures.json`, so a failure an older cmod wrote goes once the mod builds. The cmod plugin starts one only in a session that an app shows, once a mod is linked, at the session's start or later, so a machine with no linked mod runs none. The first holds `watch.lock` in the cmod store, watches, and touches its file there every 5 seconds. Another one exits at once while it runs, and the cmod plugin of each such session starts one again once that file is gone or 15 seconds old, so a machine runs one watcher however many sessions it has open. Before each touch it reads the newest cmod in the cmod store, the newest version folder of `bin/cmod` that the launcher runs. A `cmod watch` older than that exits and lets go of `watch.lock`, so after a cmod update the new cmod's watcher judges the linked mods by its own rules within 15 seconds.
250
+ Reloads the sessions working inside a checkout `cmod link` linked once it builds after a change, and tells every other running session. It watches each linked folder, outside `node_modules` and `.git`, and skips a change to a file git ignores, such as the `.claude-plugin/types/` Claude Code writes each time it loads the mod, a change inside the program's `output` folder, and a change to a file that is gone again and git does not track, such as a build's temporary file. Once a folder has had no change for 2 seconds, it bundles the mod's hooks module as `cmod publish` does. When a changed file is one the program's build reads, a file in `cli/` or one the JavaScript or TypeScript file `cli/package.json` `bin` names imports, such as the mod's own `src/`, it also builds the program `cli/` declares and links it as `cmod link` does, so the program in cmod's programs folder is never older than the mod. A change no program build reads builds no program. A program whose build failed builds again at the next change, whatever it changed. A build that changes the program stops its running copy, so a `singleInstance` or `isService` program restarts on the new build ([cmod program](#cmod-program)), and a build that writes the same program leaves the file and the copy as they are. A mod that builds marks `plugins-changed` with the checkout's folder, so each session whose project is that folder or inside it reloads by itself once the change has been quiet for 2 seconds, after its turn ends, and every other session shows the `Plugins changed` toast. A bundle or program build that still fails 10 seconds after the last change shows `<mod> does not build` with the error as one toast in every session, the last program that built keeps running, and the toast goes once the mod builds. So an agent's half-written file reloads nothing and shows nothing. At its start it bundles again each mod whose failure it finds in `build-failures.json`, so a failure an older cmod wrote goes once the mod builds. The cmod plugin starts one only in a session that an app shows, once a mod is linked, at the session's start or later, so a machine with no linked mod runs none. The first holds `watch.lock` in the cmod store, watches, and touches its file there every 5 seconds. Another one exits at once while it runs, and the cmod plugin of each such session starts one again once that file is gone or 15 seconds old, so a machine runs one watcher however many sessions it has open. Before each touch it reads the newest cmod in the cmod store, the newest version folder of `bin/cmod` that the launcher runs. A `cmod watch` older than that exits and lets go of `watch.lock`, so after a cmod update the new cmod's watcher judges the linked mods by its own rules within 15 seconds.
251
251
 
252
252
  A cmod before 4.1.0 linked a checkout by writing it into `CLAUDE_CODE_PLUGIN_DIRS` in the `env` block of Claude Code's `settings.json`. `cmod watch` at its start, and `cmod setup`, link each folder still in that list as `cmod link` does now and take it out of the list. A folder that fails to link stays in the list, and its error prints on stderr.
253
253
 
@@ -293,7 +293,7 @@ cmod runs these itself. A person runs them to see a step's whole log, or to fini
293
293
  cmod setup <plugin-root> [--events]
294
294
  ```
295
295
 
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, records the mod as set up, and restarts each service of the computer the mod runs a program as ([cmod program](#cmod-program)), so the service runs the new program, asking nothing first ([install-steps.md](install-steps.md#when-the-steps-run)). 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.
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)). Linking a new version stops the running copy of a program the mod runs as one copy or as a service of the computer, so it restarts on the new program, and an install step that fails links the old version back and stops the new one's copy the same way ([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.
297
297
 
298
298
  ### cmod teardown
299
299
 
@@ -353,9 +353,9 @@ Starts a task in a new background Claude Code session, for a mod's `startTask` w
353
353
  cmod program <mod> [--no-wait | --service [--env <name>]... | --remove-service] -- <command…>
354
354
  ```
355
355
 
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. 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. The cmod command that replaces the program's file in the cmod store's `programs` folder stops the copy itself: `cmod setup` when it links a new version, or links the old one back after a failed install step, `cmod link` and `cmod watch` when a build of the linked checkout changes the program, and `cmod download`. It sends SIGTERM, then SIGKILL after 5 seconds, to the copy each `instances/<mod>/<program>.json` names, once its process and start time match, so the copy restarts whatever cmod program holds it, an older one included. The holder then deletes that file and exits with the copy. 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, and a link placed again at the same file, leave the program 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.
357
357
 
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. `cmod setup` restarts each service of a mod it sets up, so the service runs the new program, and `cmod teardown` stops and deletes each one.
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 copy does, and `cmod teardown` stops and deletes each one.
359
359
 
360
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
361
 
@@ -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 that is still running its install step. A provider that is only starting makes the call wait for it, up to 9 seconds.
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`, 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: cmod restarts the service when it sets up a new version of the mod, and 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`.
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, it stops the copy, whichever cmod started it, so 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmodjs/core",
3
- "version": "5.11.0",
3
+ "version": "5.12.1",
4
4
  "description": "Build Claude Code mods: hooks, panes, checks, and an install that just works.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/records.d.ts CHANGED
@@ -93,6 +93,12 @@ export type Links = {
93
93
  };
94
94
  export declare function parseLinks(value: unknown, path: string): Links;
95
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[]>;
96
102
  export declare function hasLinkedMods(knownMarketplaces: unknown, links: Links): boolean;
97
103
  export declare function widgetsPath(store: string): string;
98
104
  export declare function preferencesPath(store: string): string;
@@ -142,7 +148,7 @@ export declare function newestLog(entries: readonly LogEntry[]): LogEntry[];
142
148
  export declare function versionsLine({ mod, core, cmod, program, claudeCode }: LogVersions): string;
143
149
  export declare function logReport(entry: LogEntry): string;
144
150
  export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
145
- export declare const coreVersion = "5.11.0";
151
+ export declare const coreVersion = "5.12.1";
146
152
  export declare const oldestCmodVersion = "5.10.0";
147
153
  export declare function hotkeyCommand(mod: string, hotkey: string): string;
148
154
  export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
package/records.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file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A;AAEzC,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEhG;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAQrE;AAYD,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK;IAEtC,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,SAAS;IACjB,QAAQ;IACR,MAAM;;;IACN,MAAM;QAAI,UAAU;QAAQ,WAAW;;EAE1C;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAMrD;AAMD,wBAAsB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BzI;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAiBtD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAiBpD;AAED,wBAAgB,SAAS,CAAC,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
@@ -249,6 +249,27 @@ export function linkedMarketplacesOf(knownMarketplaces, links) {
249
249
  return isObject(known) && isObject(known['source']) && known['source']['source'] === 'directory' && known['source']['path'] === folder;
250
250
  });
251
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
+ }
252
273
  export function hasLinkedMods(knownMarketplaces, links) {
253
274
  return linkedMarketplacesOf(knownMarketplaces, links).length > 0;
254
275
  }
@@ -321,7 +342,7 @@ function readHotkeys(hotkeys) {
321
342
  throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
322
343
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
323
344
  }
324
- export const coreVersion = '5.11.0';
345
+ export const coreVersion = '5.12.1';
325
346
  export const oldestCmodVersion = '5.10.0';
326
347
  export function hotkeyCommand(mod, hotkey) {
327
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,CAAC,WAAW,CAAC,CAAC,CAQ7K;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,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"}
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,CAAC,WAAW,CAAC,CAAC,CAQ7K;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,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"}
@@ -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
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/runtime/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAqB,WAAW,EAAE,MAAM,EAAc,aAAa,EAAwB,MAAM,aAAa,CAAA;AAGxI,OAAO,KAAK,EAAW,GAAG,EAAE,aAAa,EAA8G,MAAM,WAAW,CAAA;AACxK,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,eAAe,CAAA;AAC1D,OAAO,EAA2O,KAAK,KAAK,EAAE,MAAM,eAAe,CAAA;AAGnR,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAIzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIvD,OAAO,EAA6F,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AACxI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAM7D,OAAO,EAA2B,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAMnF,OAAO,EAA+B,KAAK,UAAU,EAAgB,MAAM,cAAc,CAAA;AAGzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAExD,OAAO,EAA8H,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AACjK,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;I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AAwBD,wBAAgB,eAAe,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,OAAO,GAAG,OAAO,EACtF,UAAU,EAAE,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAClD,gBAAgB,GAAE,MAAM,gBAAgB,GAAG,SAA2B,EACtE,OAAO,GAAE,aAAkB,EAC3B,UAAU,UAAO,EACjB,eAAe,CAAC,EAAE,eAAe,GAChC,SAAS,CAAC,KAAK,CAAC,CA6iBlB"}
@@ -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 isLate = await (event === 'classic.SessionStart' || event === 'session.append' || isCallToThisMod ? holdUntilStarted(signal) : holdUntilActive(signal));
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 (event === 'cmod.call' && listenMethods.includes(asked.method)) {
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() : `${definition.name} is installing. Try again when it's ready.` };
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);
@@ -991,7 +1007,10 @@ async function createMod(definition, runtime) {
991
1007
  const tellColor = (to, told) => {
992
1008
  if (told.session === '' || to === cmodPluginName)
993
1009
  return;
994
- claude.clock.after(0, () => void claude.cmod.call({ to, method: conversationMethods.sessionColor, input: told }).catch((error) => claude.ui.warn('color:tell', `cmod: ${to} did not hear the session's color: ${messageOf(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
+ }));
995
1014
  };
996
1015
  conversations?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,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,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 !== cmodPluginName)
68
- void claude.cmod.call({ to: told, method: partMethods.stylers, input: listed }).catch((error) => claude.ui.warn(`pages:stylers:${told}`, `cmod: ${told} did not hear which mods style markdown: ${messageOf(error)}`));
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 }) => {
@@ -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;AACzC,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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AE,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
  })
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/runtime/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAM5D,OAAO,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAA;AAC3E,OAAO,EAAsB,KAAK,IAAI,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,EAA+D,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAG5K,OAAO,EAAuD,KAAK,WAAW,EAA+F,KAAK,WAAW,EAA8D,KAAK,YAAY,EAAuC,KAAK,QAAQ,EAAkB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,K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AK,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAGrF;AAkBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,UAAU,CAI7L"}
@@ -11,7 +11,7 @@ import { TaskEnd, TaskStart } from '../session/goal/task.js';
11
11
  import { beforeEvents, processEvents, Session, sessionEvents } from '../session/session.js';
12
12
  import { matches, sentMatcher } from '../utils/matcher.js';
13
13
  import { beforeAnswerKeys, foldAnswers, foldBefore, methodOf, takenAnswer } from './before.js';
14
- import { cmodPluginName } from './dependencies.js';
14
+ import { cmodPluginName, isStillInstalling } from './dependencies.js';
15
15
  import { messageOf } from '../utils/text.js';
16
16
  import { listenerOf, PassedTimeout, withinTime } from './deadline.js';
17
17
  import { callFiles } from './hooks.js';
@@ -167,7 +167,11 @@ export function createSessionsClient({ name, claude, report, hookOn, routeOn, pe
167
167
  const tree = parentsOf(session);
168
168
  if (tree instanceof Map)
169
169
  return isInScope(scope, session, change, isUnderIn(tree));
170
- return tree.then((read) => isInScope(scope, session, change, isUnderIn(read)), (error) => (report(`tasks:${session}`, 'Could not read the tasks it listens under', error), false));
170
+ return tree.then((read) => isInScope(scope, session, change, isUnderIn(read)), (error) => {
171
+ if (!isStillInstalling(cmodPluginName, error))
172
+ report(`tasks:${session}`, 'Could not read the tasks it listens under', error);
173
+ return false;
174
+ });
171
175
  };
172
176
  const remember = (session, change) => {
173
177
  if (change.type !== TaskStart)
@@ -14,6 +14,7 @@ export type Failure = {
14
14
  readonly description?: string;
15
15
  readonly retry?: () => unknown;
16
16
  readonly isCritical?: boolean;
17
+ readonly root?: string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AAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAA;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,YAAY,gBAAgB,CAAA;AAEzC,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAA;IAC/B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;IACrC,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAA;CACnH,CAAA;AA6CD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,CAoVtG;AA2BD,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAS1G;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQhG"}
@@ -80,8 +80,10 @@ export function createToaster(claude, name, version) {
80
80
  else
81
81
  sent.delete(String(id));
82
82
  for (const entry of entries.values()) {
83
- if (id !== undefined && entry.id !== id)
83
+ if (id !== undefined && entry.id !== id && !entry.merged.has(String(id)))
84
84
  continue;
85
+ for (const merged of entry.merged.keys())
86
+ sent.delete(merged);
85
87
  disarm(entry);
86
88
  entries.delete(entry.id);
87
89
  }
@@ -98,7 +100,7 @@ export function createToaster(claude, name, version) {
98
100
  if (previous !== undefined)
99
101
  disarm(previous);
100
102
  const reporting = hides !== undefined && previous?.hides === hides ? previous.reporting : undefined;
101
- const entry = { id, type, message, options, actions, ...(hides === undefined ? {} : { hides }), at: new Date(), isOpen: previous?.isOpen ?? false, reporting, timer: undefined };
103
+ const entry = { id, type, message, options, actions, ...(hides === undefined ? {} : { hides }), merged: new Map(), count: 1, at: new Date(), isOpen: previous?.isOpen ?? false, reporting, timer: undefined };
102
104
  if (type === 'error' && previous?.message !== message)
103
105
  claude.ui.log(`${name}: ${message}${typeof options.description === 'string' ? `: ${options.description}` : ''}`, { to: 'debug' });
104
106
  entries.set(id, entry);
@@ -110,7 +112,8 @@ export function createToaster(claude, name, version) {
110
112
  dismiss(entry.id);
111
113
  if (entry.hides === undefined)
112
114
  return;
113
- hidden.set(String(entry.id), entry.hides);
115
+ for (const [id, hides] of [[String(entry.id), entry.hides], ...entry.merged])
116
+ hidden.set(id, hides);
114
117
  void claude.store.set(hiddenKey, Object.fromEntries(hidden)).catch((error) => warn('hidden:write', `${name}: could not remember the failure you hid: ${messageOf(error)}`));
115
118
  };
116
119
  const toast = Object.assign(show('default'), {
@@ -177,7 +180,7 @@ export function createToaster(claude, name, version) {
177
180
  return undefined;
178
181
  }
179
182
  };
180
- const fail = ({ id, message, error, description = error === undefined || describe(error) === message ? undefined : describe(error), retry, isCritical = false }) => {
183
+ const fail = ({ id, message, error, description = error === undefined || describe(error) === message ? undefined : describe(error), retry, isCritical = false, root = claude.plugin.root }) => {
181
184
  const hides = `${version() ?? ''}\n${message}\n${error === undefined ? '' : describe(error)}`;
182
185
  const at = new Date();
183
186
  const repeat = `${hides}\n${description ?? ''}\n${at.toISOString().slice(0, 16)}`;
@@ -189,7 +192,7 @@ export function createToaster(claude, name, version) {
189
192
  const logged = async () => {
190
193
  const contact = await contactOf(claude);
191
194
  const version = await modVersion();
192
- const failure = { mod: name, id, message, details: detailsOf(version, at, `${message}${description === undefined ? '' : `\n${description}`}${stack}`), at: at.toISOString(), isCritical, root: claude.plugin.root, ...(contact === undefined ? {} : { contact }), level: 'error', version, core: coreVersion };
195
+ const failure = { mod: name, id, message, details: detailsOf(version, at, `${message}${description === undefined ? '' : `\n${description}`}${stack}`), at: at.toISOString(), isCritical, root, ...(contact === undefined ? {} : { contact }), level: 'error', version, core: coreVersion };
193
196
  const shows = await showsToast(failure, isCritical);
194
197
  if (isCritical)
195
198
  return;
@@ -201,12 +204,19 @@ export function createToaster(claude, name, version) {
201
204
  if (hidden.get(id) === hides)
202
205
  return;
203
206
  hidden.delete(id);
204
- const shown = entries.get(id);
205
- if (shown?.hides === hides && shown.trying === undefined && shown.options.description === description) {
206
- const previous = clockTime(shown.at);
207
+ const own = entries.get(id);
208
+ const text = description ?? message;
209
+ const shown = own === undefined
210
+ ? [...entries.values()].find((entry) => entry.hides !== undefined && entry.trying === undefined && (entry.options.description ?? entry.message) === text)
211
+ : own.hides === hides && own.trying === undefined && own.options.description === description
212
+ ? own
213
+ : undefined;
214
+ if (shown !== undefined) {
215
+ if (shown !== own)
216
+ shown.merged.set(id, hides);
217
+ shown.count += 1;
207
218
  shown.at = new Date();
208
- if (clockTime(shown.at) !== previous)
209
- changed();
219
+ changed();
210
220
  return;
211
221
  }
212
222
  const actions = [...fixes, ...(retry === undefined ? [] : [{ label: 'Retry', onClick: tryAgain }]), { label: 'Report', onClick: startReporting }];
@@ -264,7 +274,7 @@ export function createToaster(claude, name, version) {
264
274
  const fixed = (child) => Box({ flexShrink: 0, children: child });
265
275
  const close = Button({ plain: true, dimColor: true, key: `toast:${entry.id}:close`, label: entry.hides === undefined ? '✕' : 'Hide', onPress: () => hide(entry) });
266
276
  const actions = entry.actions.map((action, index) => Button({ plain: true, key: `toast:${entry.id}:${index === 0 ? 'action' : `action-${index}`}`, label: action.label, onPress: press(entry, action.onClick) }));
267
- const buttons = Box({ gap: 2, flexWrap: 'wrap', children: [...actions, Text({ dimColor: true, children: clockTime(entry.at) })].map(fixed) });
277
+ const buttons = Box({ gap: 2, flexWrap: 'wrap', children: [...actions, Text({ dimColor: true, children: entry.count > 1 ? `${clockTime(entry.at)} · ${entry.count} times` : clockTime(entry.at) })].map(fixed) });
268
278
  const trying = entry.trying === undefined ? undefined : Box({ gap: 1, children: [Text({ dimColor: true, children: 'Trying again:' }), typeof entry.trying === 'string' ? Text({ dimColor: true, wrap: 'truncate-end', children: entry.trying }) : entry.trying] });
269
279
  const text = details === undefined ? [message] : [message, trying ?? details];
270
280
  const under = trying !== undefined && details === undefined ? [trying] : entry.reporting === undefined ? [buttons] : reportChoices(entry, entry.reporting);
@@ -3,7 +3,7 @@ import { AbovePrompt, areas, BelowPrompt, TurnEnd, Working } from '../ui/areas.j
3
3
  import { Box, drawWith } from '../ui/elements.js';
4
4
  import { ifMissing } from '../utils/paths.js';
5
5
  import { messageOf } from '../utils/text.js';
6
- import { cmodPluginName, isNotInstalled } from './dependencies.js';
6
+ import { cmodPluginName, isNotInstalled, isStillInstalling } from './dependencies.js';
7
7
  import { partMethods, styledAt, viewportColumns } from './ui.js';
8
8
  export const claudeHint = 'claude/hint';
9
9
  export const claudeModes = 'claude/modes';
@@ -122,7 +122,7 @@ export function serveWidgets({ claude, router, store, report, turnClosedBy, part
122
122
  }
123
123
  catch (error) {
124
124
  declared.delete(mod);
125
- if (!isNotInstalled(mod, error))
125
+ if (!isNotInstalled(mod, error) && !isStillInstalling(mod, error))
126
126
  claude.ui.warn(`widgets:list:${mod}`, `cmod: ${mod} did not list its widgets: ${messageOf(error)}`);
127
127
  }
128
128
  };
package/src/records.ts CHANGED
@@ -292,6 +292,28 @@ export function linkedMarketplacesOf(knownMarketplaces: unknown, links: Links):
292
292
  })
293
293
  }
294
294
 
295
+ export type LinkedCheckout = { readonly name: string; readonly marketplace: string; readonly folder: string }
296
+
297
+ export async function linkedCheckoutsOf(read: ReadFile, knownMarketplaces: unknown, links: Links): Promise<LinkedCheckout[]> {
298
+ const checkouts: LinkedCheckout[] = []
299
+ for (const [marketplace, folder] of linkedMarketplacesOf(knownMarketplaces, links)) {
300
+ const path = `${folder}/.claude-plugin/marketplace.json`
301
+ const text = await read(path)
302
+ const manifest: unknown = text === undefined ? undefined : parsedJson(text, path)
303
+ const plugins: unknown[] = isObject(manifest) && Array.isArray(manifest['plugins']) ? manifest['plugins'] : []
304
+ for (const plugin of plugins) if (isObject(plugin) && typeof plugin['name'] === 'string' && typeof plugin['source'] === 'string') checkouts.push({ name: plugin['name'], marketplace, folder: `${folder}/${plugin['source'].replace(/^\.\//, '')}` })
305
+ }
306
+ return checkouts
307
+ }
308
+
309
+ function parsedJson(text: string, path: string): unknown {
310
+ try {
311
+ return JSON.parse(text)
312
+ } catch (error) {
313
+ throw new Error(`${path} is not valid JSON: ${messageOf(error)}`)
314
+ }
315
+ }
316
+
295
317
  export function hasLinkedMods(knownMarketplaces: unknown, links: Links): boolean {
296
318
  return linkedMarketplacesOf(knownMarketplaces, links).length > 0
297
319
  }
@@ -395,7 +417,7 @@ function readHotkeys(hotkeys: unknown): Steps {
395
417
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys as Record<string, HotkeyInit>) }
396
418
  }
397
419
 
398
- export const coreVersion = '5.11.0'
420
+ export const coreVersion = '5.12.1'
399
421
 
400
422
  export const oldestCmodVersion = '5.10.0'
401
423
 
@@ -55,3 +55,11 @@ export function notInstalled(name: string): string {
55
55
  export function isNotInstalled(name: string, error: unknown): boolean {
56
56
  return messageOf(error).endsWith(notInstalled(name))
57
57
  }
58
+
59
+ export function stillInstalling(name: string): string {
60
+ return `${name} is installing. Try again when it's ready.`
61
+ }
62
+
63
+ export function isStillInstalling(name: string, error: unknown): boolean {
64
+ return messageOf(error).endsWith(stillInstalling(name))
65
+ }
@@ -11,7 +11,7 @@ import { beforeDeadline, settledAfterAbort } from './deadline.js'
11
11
  import { announcementMs, announcementOf } from './announce.js'
12
12
  import { bind } from './bound.js'
13
13
  import type { Conversations } from './conversations.js'
14
- import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, loadedMethod, withBareRefusals } from './dependencies.js'
14
+ import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, isStillInstalling, loadedMethod, stillInstalling, withBareRefusals } from './dependencies.js'
15
15
  import type { Device } from '../session/context/turn/device.js'
16
16
  import { keepEngine } from './engine.js'
17
17
  import { classicFailure, classicHook, userSkillHook, type Hook, type HookFields, type HookListener, type RoutedEvent } from './hooks.js'
@@ -52,6 +52,8 @@ export type Phase = 'starting' | 'installing' | 'waiting' | 'failed' | 'ready' |
52
52
 
53
53
  const listenMethods: readonly string[] = [conversationMethods.subscribe, conversationMethods.watchBefore]
54
54
 
55
+ const answeredAtOnce: readonly string[] = [...listenMethods, partMethods.draw]
56
+
55
57
  export type Lifecycle<State extends object> = {
56
58
  readonly phase: Phase
57
59
  readonly mod: Mod<State> | undefined
@@ -225,6 +227,17 @@ export function createLifecycle<State extends object, Declared extends Options =
225
227
  const heldListens = new Map<string, Frozen<Args<'cmod.call'>> & { readonly caller?: string }>()
226
228
  let settleStart: () => void = () => undefined
227
229
  const startSettled = new Promise<void>((resolve) => (settleStart = resolve))
230
+ let installSettled: Promise<void> | undefined
231
+ let settleInstall: () => void = () => undefined
232
+ const whenInstalled = () =>
233
+ phase === 'installing' || phase === 'waiting'
234
+ ? (installSettled ??= new Promise<void>((resolve) => {
235
+ settleInstall = () => {
236
+ installSettled = undefined
237
+ resolve()
238
+ }
239
+ }))
240
+ : undefined
228
241
 
229
242
  const claude = () => {
230
243
  if (runtime === undefined) throw new Error(`${definition.name}: the lifecycle has not started. registerMod(addHook, mod, options) starts it at session.start.`)
@@ -237,6 +250,7 @@ export function createLifecycle<State extends object, Declared extends Options =
237
250
 
238
251
  const fail = (reason: string, fix: string | undefined, retry?: () => Promise<void>, error?: unknown) => {
239
252
  phase = 'failed'
253
+ settleInstall()
240
254
  failure ??= new Error(`${definition.name}: ${reason}${/[.!?]$/.test(reason) ? '' : '.'}${fix === undefined ? '' : ` ${fix}`}`, { cause: error })
241
255
  const again = retry === undefined ? {} : { retry: () => ((failure = undefined), stopRetrying(), retry().catch(report)) }
242
256
  toastFailure({ id: installId, message: reason, ...(fix === undefined ? {} : { description: fix }), ...(error === undefined ? {} : { error }), ...again, isCritical: true })
@@ -289,6 +303,7 @@ export function createLifecycle<State extends object, Declared extends Options =
289
303
  await programs?.refresh()
290
304
  phase = 'ready'
291
305
  activation ??= new Promise<void>((resolve) => claude().clock.after(0, () => resolve(activate().catch(report))))
306
+ settleInstall()
292
307
  claude().ui.invalidate('ui.render')
293
308
  }
294
309
 
@@ -602,6 +617,8 @@ export function createLifecycle<State extends object, Declared extends Options =
602
617
 
603
618
  const holdUntilStarted = (signal?: AbortSignal): Promise<boolean> => held(startSettled.then(whenActive), signal)
604
619
 
620
+ const holdUntilInstalled = (signal?: AbortSignal): Promise<boolean> => held(startSettled.then(whenInstalled).then(whenActive), signal)
621
+
605
622
  const holdUntilActive = (signal: AbortSignal | undefined): Promise<boolean> => {
606
623
  const activating = whenActive()
607
624
  return activation !== undefined && phase !== 'active' ? held(activating, signal) : activating.then(() => false)
@@ -629,17 +646,19 @@ export function createLifecycle<State extends object, Declared extends Options =
629
646
  const tool = (e as { readonly tool?: unknown }).tool
630
647
  const isCallToThisMod = (event === 'cmod.call' && (e as Frozen<Args<'cmod.call'>>).to === definition.name) || (event === 'tool.call' && typeof tool === 'string' && tool.startsWith(`mcp__${definition.name}__`))
631
648
  if (event === 'cmod.call' && !isCallToThisMod) return next(e)
632
- const isLate = await (event === 'classic.SessionStart' || event === 'session.append' || isCallToThisMod ? holdUntilStarted(signal) : holdUntilActive(signal))
649
+ const isListen = isCallToThisMod && event === 'cmod.call' && listenMethods.includes(asked.method)
650
+ const waitsForInstall = isCallToThisMod && !(event === 'cmod.call' && answeredAtOnce.includes(asked.method))
651
+ const isLate = await (waitsForInstall ? holdUntilInstalled(signal) : event === 'classic.SessionStart' || event === 'session.append' || isCallToThisMod ? holdUntilStarted(signal) : holdUntilActive(signal))
633
652
  if (event === 'classic.SessionStart' && phase !== 'active') {
634
653
  missedSessionStart = e as Frozen<Args<'classic.SessionStart'>>
635
654
  return next(e)
636
655
  }
637
656
  if (isCallToThisMod && phase !== 'active') {
638
- if (event === 'cmod.call' && listenMethods.includes(asked.method)) {
657
+ if (isListen) {
639
658
  heldListens.set(`${asked.caller}\n${asked.method}\n${String((asked.input as { readonly session?: unknown }).session)}`, asked)
640
659
  return { value: null } as EventResult<N>
641
660
  }
642
- return { deny: phase === 'failed' ? notSetUp() : `${definition.name} is installing. Try again when it's ready.` } as EventResult<N>
661
+ return { deny: phase === 'failed' ? notSetUp() : stillInstalling(definition.name) } as EventResult<N>
643
662
  }
644
663
  if (isLate && phase !== 'active') return (startingRouter ?? router).dispatchFailure(event, e, new Error(`it was still starting after ${startHoldMs / 1000} s`), next, false)
645
664
  const call = e as Frozen<Args<'cmod.call'>>
@@ -1049,7 +1068,11 @@ async function createMod<State extends object, Declared extends Options>(definit
1049
1068
  pages = served?.pages
1050
1069
  const tellColor = (to: string, told: SessionColor) => {
1051
1070
  if (told.session === '' || to === cmodPluginName) return
1052
- claude.clock.after(0, () => void claude.cmod.call({ to, method: conversationMethods.sessionColor, input: told }).catch((error: unknown) => claude.ui.warn('color:tell', `cmod: ${to} did not hear the session's color: ${messageOf(error)}`)))
1071
+ claude.clock.after(0, () =>
1072
+ void claude.cmod.call({ to, method: conversationMethods.sessionColor, input: told }).catch((error: unknown) => {
1073
+ if (!isStillInstalling(to, error)) claude.ui.warn('color:tell', `cmod: ${to} did not hear the session's color: ${messageOf(error)}`)
1074
+ }),
1075
+ )
1053
1076
  }
1054
1077
  conversations?.onColor((told) => {
1055
1078
  client.recolor(told)
@@ -3,7 +3,7 @@ import { isObject } from '../records.js'
3
3
  import { Text } from '../ui/elements.js'
4
4
  import { messageOf } from '../utils/text.js'
5
5
  import type { Claude } from './claude.js'
6
- import { cmodPluginName, isNotInstalled } from './dependencies.js'
6
+ import { cmodPluginName, isNotInstalled, isStillInstalling } from './dependencies.js'
7
7
  import type { DrawnParts } from './parts.js'
8
8
  import type { Router } from './router.js'
9
9
  import { partMethods, type PageDeclaration, type PageRequest, type PartPress, type PartsUpdate, type ShownPages } from './ui.js'
@@ -93,7 +93,7 @@ export function servePages({
93
93
  .then(
94
94
  (parts) => void declared.set(mod, pagesOf(parts)),
95
95
  (error: unknown) => {
96
- if (!isNotInstalled(mod, error)) claude.ui.warn(`pages:list:${mod}`, `cmod: ${mod} did not list its pages: ${messageOf(error)}`)
96
+ if (!isNotInstalled(mod, error) && !isStillInstalling(mod, error)) claude.ui.warn(`pages:list:${mod}`, `cmod: ${mod} did not list its pages: ${messageOf(error)}`)
97
97
  },
98
98
  )
99
99
  .finally(() => asking.delete(mod))
@@ -108,7 +108,10 @@ export function servePages({
108
108
  const listed = [...stylers]
109
109
  tellStylers(listed)
110
110
  for (const told of declared.keys()) {
111
- if (told !== cmodPluginName) void claude.cmod.call({ to: told, method: partMethods.stylers, input: listed }).catch((error: unknown) => claude.ui.warn(`pages:stylers:${told}`, `cmod: ${told} did not hear which mods style markdown: ${messageOf(error)}`))
111
+ if (told === cmodPluginName) continue
112
+ void claude.cmod.call({ to: told, method: partMethods.stylers, input: listed }).catch((error: unknown) => {
113
+ if (!isStillInstalling(told, error)) claude.ui.warn(`pages:stylers:${told}`, `cmod: ${told} did not hear which mods style markdown: ${messageOf(error)}`)
114
+ })
112
115
  }
113
116
  }
114
117
 
@@ -2,6 +2,7 @@ import type { RenderElement } from 'claude-code'
2
2
  import { elementOf } from '../ui/elements.js'
3
3
  import { messageOf } from '../utils/text.js'
4
4
  import type { Claude } from './claude.js'
5
+ import { isStillInstalling } from './dependencies.js'
5
6
  import { partMethods, type DrawnPart, type PartPress } from './ui.js'
6
7
 
7
8
  export type DrawnParts = {
@@ -41,6 +42,7 @@ export function drawnParts({ claude, report, press }: { readonly claude: Claude;
41
42
  .then(
42
43
  (data) => keep((data ?? null) as DrawnPart | null),
43
44
  (error: unknown) => {
45
+ if (isStillInstalling(mod, error)) return keep(drawn.get(key)?.data ?? null)
44
46
  report(`draw:${mod}`, `${name} drew nothing`, error)
45
47
  keep(drawn.get(key)?.data ?? null, messageOf(error))
46
48
  },
@@ -14,7 +14,7 @@ import { beforeEvents, processEvents, Session, sessionEvents, type BeforeEvent,
14
14
  import { matches, sentMatcher, type Matcher, type SentMatcher } from '../utils/matcher.js'
15
15
  import { beforeAnswerKeys, foldAnswers, foldBefore, methodOf, takenAnswer, type Answers, type Place } from './before.js'
16
16
  import type { Claude } from './claude.js'
17
- import { cmodPluginName } from './dependencies.js'
17
+ import { cmodPluginName, isStillInstalling } from './dependencies.js'
18
18
  import { messageOf } from '../utils/text.js'
19
19
  import { listenerOf, PassedTimeout, withinTime, type ListenOptions, type ListenTime } from './deadline.js'
20
20
  import { callFiles, type HomeFolders, type HookFields } from './hooks.js'
@@ -195,7 +195,10 @@ export function createSessionsClient({ name, claude, report, hookOn, routeOn, pe
195
195
  if (tree instanceof Map) return isInScope(scope, session, change, isUnderIn(tree))
196
196
  return tree.then(
197
197
  (read) => isInScope(scope, session, change, isUnderIn(read)),
198
- (error: unknown) => (report(`tasks:${session}`, 'Could not read the tasks it listens under', error), false),
198
+ (error: unknown) => {
199
+ if (!isStillInstalling(cmodPluginName, error)) report(`tasks:${session}`, 'Could not read the tasks it listens under', error)
200
+ return false
201
+ },
199
202
  )
200
203
  }
201
204
 
@@ -9,7 +9,7 @@ import { cmodPluginName } from './dependencies.js'
9
9
 
10
10
  export type ShownToast = { readonly type: ToastType; readonly message: string; readonly description?: string }
11
11
 
12
- export type Failure = { readonly id: string; readonly message: string; readonly error?: unknown; readonly description?: string; readonly retry?: () => unknown; readonly isCritical?: boolean }
12
+ export type Failure = { readonly id: string; readonly message: string; readonly error?: unknown; readonly description?: string; readonly retry?: () => unknown; readonly isCritical?: boolean; readonly root?: string }
13
13
 
14
14
  export type LoggedFailure = {
15
15
  readonly mod: string
@@ -47,6 +47,8 @@ type Entry = {
47
47
  readonly options: ToastOptions
48
48
  readonly actions: readonly Action[]
49
49
  readonly hides?: string
50
+ readonly merged: Map<string, string>
51
+ count: number
50
52
  at: Date
51
53
  isOpen: boolean
52
54
  reporting?: Reporting | undefined
@@ -135,7 +137,8 @@ export function createToaster(claude: Claude, name: string, version: () => strin
135
137
  if (id === undefined) sent.clear()
136
138
  else sent.delete(String(id))
137
139
  for (const entry of entries.values()) {
138
- if (id !== undefined && entry.id !== id) continue
140
+ if (id !== undefined && entry.id !== id && !entry.merged.has(String(id))) continue
141
+ for (const merged of entry.merged.keys()) sent.delete(merged)
139
142
  disarm(entry)
140
143
  entries.delete(entry.id)
141
144
  }
@@ -152,7 +155,7 @@ export function createToaster(claude: Claude, name: string, version: () => strin
152
155
  }
153
156
  if (previous !== undefined) disarm(previous)
154
157
  const reporting = hides !== undefined && previous?.hides === hides ? previous.reporting : undefined
155
- const entry: Entry = { id, type, message, options, actions, ...(hides === undefined ? {} : { hides }), at: new Date(), isOpen: previous?.isOpen ?? false, reporting, timer: undefined }
158
+ const entry: Entry = { id, type, message, options, actions, ...(hides === undefined ? {} : { hides }), merged: new Map(), count: 1, at: new Date(), isOpen: previous?.isOpen ?? false, reporting, timer: undefined }
156
159
  if (type === 'error' && previous?.message !== message) claude.ui.log(`${name}: ${message}${typeof options.description === 'string' ? `: ${options.description}` : ''}`, { to: 'debug' })
157
160
  entries.set(id, entry)
158
161
  changed()
@@ -167,7 +170,7 @@ export function createToaster(claude: Claude, name: string, version: () => strin
167
170
  const hide = (entry: Entry) => {
168
171
  dismiss(entry.id)
169
172
  if (entry.hides === undefined) return
170
- hidden.set(String(entry.id), entry.hides)
173
+ for (const [id, hides] of [[String(entry.id), entry.hides] as const, ...entry.merged]) hidden.set(id, hides)
171
174
  void claude.store.set(hiddenKey, Object.fromEntries(hidden)).catch((error: unknown) => warn('hidden:write', `${name}: could not remember the failure you hid: ${messageOf(error)}`))
172
175
  }
173
176
 
@@ -245,7 +248,7 @@ export function createToaster(claude: Claude, name: string, version: () => strin
245
248
  }
246
249
  }
247
250
 
248
- const fail = ({ id, message, error, description = error === undefined || describe(error) === message ? undefined : describe(error), retry, isCritical = false }: Failure): ToastId => {
251
+ const fail = ({ id, message, error, description = error === undefined || describe(error) === message ? undefined : describe(error), retry, isCritical = false, root = claude.plugin.root }: Failure): ToastId => {
249
252
  const hides = `${version() ?? ''}\n${message}\n${error === undefined ? '' : describe(error)}`
250
253
  const at = new Date()
251
254
  const repeat = `${hides}\n${description ?? ''}\n${at.toISOString().slice(0, 16)}`
@@ -256,7 +259,7 @@ export function createToaster(claude: Claude, name: string, version: () => strin
256
259
  const logged = async () => {
257
260
  const contact = await contactOf(claude)
258
261
  const version = await modVersion()
259
- const failure: LoggedFailure = { mod: name, id, message, details: detailsOf(version, at, `${message}${description === undefined ? '' : `\n${description}`}${stack}`), at: at.toISOString(), isCritical, root: claude.plugin.root, ...(contact === undefined ? {} : { contact }), level: 'error', version, core: coreVersion }
262
+ const failure: LoggedFailure = { mod: name, id, message, details: detailsOf(version, at, `${message}${description === undefined ? '' : `\n${description}`}${stack}`), at: at.toISOString(), isCritical, root, ...(contact === undefined ? {} : { contact }), level: 'error', version, core: coreVersion }
260
263
  const shows = await showsToast(failure, isCritical)
261
264
  if (isCritical) return
262
265
  if (shows !== false) return show()
@@ -265,11 +268,19 @@ export function createToaster(claude: Claude, name: string, version: () => strin
265
268
  const show = () => {
266
269
  if (hidden.get(id) === hides) return
267
270
  hidden.delete(id)
268
- const shown = entries.get(id)
269
- if (shown?.hides === hides && shown.trying === undefined && shown.options.description === description) {
270
- const previous = clockTime(shown.at)
271
+ const own = entries.get(id)
272
+ const text = description ?? message
273
+ const shown =
274
+ own === undefined
275
+ ? [...entries.values()].find((entry) => entry.hides !== undefined && entry.trying === undefined && (entry.options.description ?? entry.message) === text)
276
+ : own.hides === hides && own.trying === undefined && own.options.description === description
277
+ ? own
278
+ : undefined
279
+ if (shown !== undefined) {
280
+ if (shown !== own) shown.merged.set(id, hides)
281
+ shown.count += 1
271
282
  shown.at = new Date()
272
- if (clockTime(shown.at) !== previous) changed()
283
+ changed()
273
284
  return
274
285
  }
275
286
  const actions = [...fixes, ...(retry === undefined ? [] : [{ label: 'Retry', onClick: tryAgain }]), { label: 'Report', onClick: startReporting }]
@@ -323,7 +334,7 @@ export function createToaster(claude: Claude, name: string, version: () => strin
323
334
  const fixed = (child: RenderElement) => Box({ flexShrink: 0, children: child })
324
335
  const close = Button({ plain: true, dimColor: true, key: `toast:${entry.id}:close`, label: entry.hides === undefined ? '✕' : 'Hide', onPress: () => hide(entry) })
325
336
  const actions = entry.actions.map((action, index) => Button({ plain: true, key: `toast:${entry.id}:${index === 0 ? 'action' : `action-${index}`}`, label: action.label, onPress: press(entry, action.onClick) }))
326
- const buttons = Box({ gap: 2, flexWrap: 'wrap', children: [...actions, Text({ dimColor: true, children: clockTime(entry.at) })].map(fixed) })
337
+ const buttons = Box({ gap: 2, flexWrap: 'wrap', children: [...actions, Text({ dimColor: true, children: entry.count > 1 ? `${clockTime(entry.at)} · ${entry.count} times` : clockTime(entry.at) })].map(fixed) })
327
338
  const trying = entry.trying === undefined ? undefined : Box({ gap: 1, children: [Text({ dimColor: true, children: 'Trying again:' }), typeof entry.trying === 'string' ? Text({ dimColor: true, wrap: 'truncate-end', children: entry.trying }) : entry.trying] })
328
339
  const text = details === undefined ? [message] : [message, trying ?? details]
329
340
  const under = trying !== undefined && details === undefined ? [trying] : entry.reporting === undefined ? [buttons] : reportChoices(entry, entry.reporting)
@@ -7,7 +7,7 @@ import type { StyledAt } from '../ui/styles.js'
7
7
  import { ifMissing } from '../utils/paths.js'
8
8
  import { messageOf } from '../utils/text.js'
9
9
  import type { Claude } from './claude.js'
10
- import { cmodPluginName, isNotInstalled } from './dependencies.js'
10
+ import { cmodPluginName, isNotInstalled, isStillInstalling } from './dependencies.js'
11
11
  import type { DrawnParts } from './parts.js'
12
12
  import type { Router } from './router.js'
13
13
  import { partMethods, styledAt, viewportColumns, type PartsUpdate, type WidgetDeclaration } from './ui.js'
@@ -183,7 +183,7 @@ export function serveWidgets({
183
183
  declared.set(mod, declarationsOf(await claude.cmod.call({ to: mod, method: partMethods.list, input: null })))
184
184
  } catch (error) {
185
185
  declared.delete(mod)
186
- if (!isNotInstalled(mod, error)) claude.ui.warn(`widgets:list:${mod}`, `cmod: ${mod} did not list its widgets: ${messageOf(error)}`)
186
+ if (!isNotInstalled(mod, error) && !isStillInstalling(mod, error)) claude.ui.warn(`widgets:list:${mod}`, `cmod: ${mod} did not list its widgets: ${messageOf(error)}`)
187
187
  }
188
188
  }
189
189