@cmodjs/core 5.12.2 → 5.13.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 +1 -1
- package/docs/dependencies.md +1 -1
- package/docs/install-steps.md +1 -1
- package/docs/jobs.md +1 -1
- package/docs/mod.md +8 -2
- package/docs/testing.md +1 -1
- package/docs/ui.md +15 -8
- package/jobs/program.js +1 -1
- package/mod.d.ts +1 -0
- package/mod.d.ts.map +1 -1
- package/package.json +1 -1
- package/records.d.ts +1 -1
- package/records.js +1 -1
- package/runtime/deadline.d.ts +1 -0
- package/runtime/deadline.d.ts.map +1 -1
- package/runtime/deadline.js +1 -0
- package/runtime/dependencies.d.ts +3 -0
- package/runtime/dependencies.d.ts.map +1 -1
- package/runtime/dependencies.js +14 -0
- package/runtime/hooks.d.ts.map +1 -1
- package/runtime/hooks.js +3 -2
- package/runtime/installer.d.ts +1 -0
- package/runtime/installer.d.ts.map +1 -1
- package/runtime/installer.js +4 -0
- package/runtime/lifecycle.d.ts.map +1 -1
- package/runtime/lifecycle.js +24 -14
- package/runtime/toaster.d.ts.map +1 -1
- package/runtime/toaster.js +29 -13
- package/src/jobs/program.ts +1 -1
- package/src/mod.ts +1 -1
- package/src/records.ts +1 -1
- package/src/runtime/deadline.ts +3 -0
- package/src/runtime/dependencies.ts +16 -0
- package/src/runtime/hooks.ts +2 -2
- package/src/runtime/installer.ts +4 -0
- package/src/runtime/lifecycle.ts +24 -18
- package/src/runtime/toaster.ts +29 -14
- package/src/testing/fake-elements.ts +13 -0
- package/src/utils/call-effects.ts +3 -1
- package/testing/fake-elements.d.ts.map +1 -1
- package/testing/fake-elements.js +15 -0
- package/utils/call-effects.d.ts +2 -0
- package/utils/call-effects.d.ts.map +1 -1
- package/utils/call-effects.js +3 -1
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 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.
|
|
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. It also exits once the process that started it ends, so a session that crashed leaves no watcher behind.
|
|
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
|
|
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 whose install step still runs
|
|
136
|
+
- `tracer is installing` covers a provider whose install step still runs 5 seconds after the call. A provider that is installing or only starting makes the call wait for it, up to 5 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/install-steps.md
CHANGED
|
@@ -123,7 +123,7 @@ The install step runs again on every new version of the mod and whenever its scr
|
|
|
123
123
|
|
|
124
124
|
- When the first install of a mod fails or is stopped, cmod runs the uninstall step to undo it. So the uninstall step must work on a partial install.
|
|
125
125
|
- When the install step of an upgrade fails or is stopped, cmod keeps the version it set up before.
|
|
126
|
-
- The failure shows at once as an error toast with `
|
|
126
|
+
- The failure shows at once as an error toast with `Report`, `Retry`, and `✕` ([ui.md](ui.md#toasts)).
|
|
127
127
|
- When waiting can fix the failure, cmod also retries in the background after 2, 4, 8, 16, 32, 64, and 128 seconds, then every 128 seconds, and the toast says `Trying again in <n> s.` A try that works replaces the toast with `Installed`. Waiting can fix two failures: a linked checkout whose build or install step failed, and a release download that got 404 or no answer, as when a release was published seconds ago. Any other failure waits for `Retry`. A linked checkout's failed build runs again only once a file in its program's folder changes, so a retry with no change shows the same error without building.
|
|
128
128
|
- A new version of a linked checkout whose install steps did not change keeps running on its last install while cmod builds the new version in the background, and other sessions wait for that one build. A failed build shows the build's own error.
|
|
129
129
|
- Before each try, cmod reads the mod's install record, so a mod another session installed starts without running its install again.
|
package/docs/jobs.md
CHANGED
|
@@ -331,7 +331,7 @@ type Program = {
|
|
|
331
331
|
- `command` is the program on `PATH` and its arguments. `environment` sets variables for it. An empty `command` throws.
|
|
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
|
-
- 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
|
|
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>`, which shows `The <program> program stopped` with `Retry` where the mod's errors toast ([ui.md](ui.md#toasts)).
|
|
335
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
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>`.
|
package/docs/mod.md
CHANGED
|
@@ -62,7 +62,7 @@ When a step fails, the mod does not start. An error toast above the prompt names
|
|
|
62
62
|
- `its open panes did not load: <error>` when Claude Code cannot list the open panes.
|
|
63
63
|
- `the details of its session did not load: <error>` when Claude Code cannot name the session's id, model, or start time.
|
|
64
64
|
|
|
65
|
-
Each of these has `Retry`, which starts the mod again, and `Report` and
|
|
65
|
+
Each of these has `Retry`, which starts the mod again, and `Report` and `✕` ([ui.md](ui.md#toasts)). A failed step is critical, so its toast shows for an installed mod too.
|
|
66
66
|
|
|
67
67
|
## Rules
|
|
68
68
|
|
|
@@ -259,13 +259,19 @@ mod.every(60_000, async () => {
|
|
|
259
259
|
### mod.log
|
|
260
260
|
|
|
261
261
|
```ts
|
|
262
|
-
mod.log(text: string, options?: { to?: 'debug' | 'transcript' }): void
|
|
262
|
+
mod.log(text: string, options?: { to?: 'debug' | 'transcript'; level?: 'warning' | 'error' }): void
|
|
263
263
|
```
|
|
264
264
|
|
|
265
265
|
`log` writes `<mod>: <text>` to Claude Code's debug log, which `claude --debug` shows. It is for what helps the mod's author find a fault and the person never needs to see. Tell the person with a toast instead ([ui.md](ui.md#toasts)).
|
|
266
266
|
|
|
267
267
|
With `{ to: 'transcript' }`, the line shows dim in the conversation, where the person reads it and Claude never does, such as "Formatted 3 files" after a turn.
|
|
268
268
|
|
|
269
|
+
With a `level`, the line is a failure the mod works around and goes on past, and it goes to the Log in Settings and `cmod log` too, which counts each repeat with the versions it happened on. An `error` shows a toast only where cmod shows a failure the mod throws: for a mod run from its checkout, in a session working inside it ([ui.md](ui.md#toasts)). A `warning` never shows one. Throw instead when the listener or handler cannot go on.
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
mod.log(`The rule ${name} did not load, so rulebook skips it: ${messageOf(error)}`, { level: 'error' })
|
|
273
|
+
```
|
|
274
|
+
|
|
269
275
|
### Hotkeys
|
|
270
276
|
|
|
271
277
|
A hotkey is a key combo the mod listens for, such as `alt+shift+p` to show a page. The mod declares each one with a title and an optional default combo, and the person changes the combo in Settings, under the mod, Hotkeys, the way VS Code handles an extension's keybindings.
|
package/docs/testing.md
CHANGED
|
@@ -215,7 +215,7 @@ A `before` listener on the current session answers what `raise` asks, such as `t
|
|
|
215
215
|
- `shown.page.lines()` draws the page the mod shows in the Sidebar now, and `shown.pane.lines()` the pane it shows now, and each returns its rows of text. Each rejects when the mod shows none, such as `No pane of notes shows. Open one with pane.open(), from a slash command, a hotkey, or setup.` A page gets `params`, `isFocused`, and `columns`, 80 unless `lines({ columns })` gives another. A pane gets `params`, `title`, `isFocused`, true once an `open` or `toggle` with `{ focus: true }` opened it, `bodyColumns`, which is the `columns` that `lines({ columns })` gives, else the pane's own `columns`, else 80, `placement: 'dock'`, `scroll: { offset: 0, bodyRows: 24 }`, and `view: {}`. `shown.page.id` and `shown.pane.id` name what shows, and `params` holds its params.
|
|
216
216
|
- A `Markdown` element in the mod's pages, panes, and widgets draws through the mod's own markdown styles, as it does in a session. Other mods' styles are not drawn.
|
|
217
217
|
- A key in a page or widget draws as the cmod plugin gives it to Claude Code: `<mod>/<page>:<key>` in a page, `<mod>/<widget>:<key>` in a widget, and `<mod>/markdown:<scope>:<block>:<key>` in what a markdown style draws, where `<scope>` is the drawn key of the `Markdown` element that holds the block, or its place among the `Markdown` elements without a key, and `<block>` is the block's number in that element's markdown, each from `0`. In the mod's own pane, a style's key draws as `<scope>:<block>:<key>`, and in a reply as `<block>:<key>`. `press`, `input`, and `select` take the key the mod wrote, and a key two blocks share reaches the first.
|
|
218
|
-
- Claude Code refuses a whole tree in which two `Input`, `Select`, `Markdown`, `Client`, `Raster`, or `Image` elements have one key, anywhere in it, and a refused Sidebar draws blank for the session. So drawing a page, a pane, a widget area, or a style that does it rejects with Claude Code's own text, such as `cmod: returned a tree Pane refuses: Markdown "notes/all:item-text:0" is drawn twice; each takes its own key`. Elements of different types, such as a `Box` and a `Markdown`, may share a key.
|
|
218
|
+
- Claude Code refuses a whole tree in which two `Input`, `Select`, `Markdown`, `Client`, `Raster`, or `Image` elements have one key, anywhere in it, and a refused Sidebar draws blank for the session. So drawing a page, a pane, a widget area, or a style that does it rejects with Claude Code's own text, such as `cmod: returned a tree Pane refuses: Markdown "notes/all:item-text:0" is drawn twice; each takes its own key`. Elements of different types, such as a `Box` and a `Markdown`, may share a key. Claude Code also refuses a `Box`, `Text`, or `Button` whose `hover` names no `scope` and has no `Box` with a key around it, the `Box` itself included, so drawing one rejects with `cmod: returned a tree Pane refuses: Button "notes/all:archive" hover has no Box with a key around it; the nearest keyed Box is what the pointer hovers, or a scope names its group`.
|
|
219
219
|
- A `Button` draws as Claude Code draws it: `[ Save ]`, or `1: Save` when it is `plain` with a `hotkey`, or `Save` when it is `plain` alone. Borders and colors are not drawn.
|
|
220
220
|
- `lines(area)` draws the mod's widgets in that area, in the rows the person would see, and returns them. A new widget is in the first row of its first area. A layout given in `files` as `/test/home/.local/share/cmod/widgets.json` places the widgets another way. `{ columns }` sets the row's width, 80 by default. `lines(TurnEnd)` draws under the last turn that ended, and rejects when none has: end one with `tested.endTurn()` first.
|
|
221
221
|
- `lines(kind, props, requestId?)` draws the mod's style of that kind with `props` and returns its rows. `Default` draws a plain listing of the props it gets, so a test sees what the style changed. Draw `Reply` with a reply's `text` to test a markdown style. Draws that pass one `requestId` grow one streamed reply.
|
package/docs/ui.md
CHANGED
|
@@ -441,9 +441,9 @@ type ToastOptions = {
|
|
|
441
441
|
- Each type draws its icon: `✓` success, `ℹ` info, `⚠` warning, `✗` error, and a spinner for loading.
|
|
442
442
|
- A toast stays 4 seconds once the band draws it, or `duration` ms. `Infinity` keeps it until the person closes it, and a loading toast stays until it changes.
|
|
443
443
|
- A toast with the `id` of a shown toast replaces it in place, so a loading toast turns into its success or error.
|
|
444
|
-
- A text `description` shows its first line dim under the message. A press on the message unfolds the whole text and stops the time. An element `description`, such as a `Progress`, draws as it is.
|
|
445
|
-
- Every toast takes the band's whole width, and its `✕` sits at the right end of its
|
|
446
|
-
- `action` draws a button
|
|
444
|
+
- A toast's first line holds its icon, the mod's name in a column 16 characters wide, and the message. A longer name shows whole and moves only its own toast's text. A text `description` shows its first line dim on the line under the message. A press on the message unfolds the whole text and stops the time. An element `description`, such as a `Progress`, draws as it is.
|
|
445
|
+
- Every toast takes the band's whole width, and its `✕` sits at the right end of its first line, so a stack of toasts closes with presses in one spot.
|
|
446
|
+
- `action` draws a button on the left, on its own line under the message, with the time after it. Give every toast that asks the person to do something an `action` that does it.
|
|
447
447
|
- `✕` closes the toast. The band shows the newest 3, and `+N more` shows every toast.
|
|
448
448
|
- `promise` shows `loading` while `task` runs, then `success` or `error` in the same row. `unwrap()` resolves or rejects as `task` does.
|
|
449
449
|
|
|
@@ -451,17 +451,24 @@ Every error cmod catches for a mod, such as a listener that throws, goes to the
|
|
|
451
451
|
|
|
452
452
|
An error also shows as a toast when any of these holds:
|
|
453
453
|
|
|
454
|
-
- it is critical: the mod's install or setup
|
|
455
|
-
- the mod runs from its checkout, linked with [`cmod link`](commands.md#cmod-link) or loaded with `--plugin-dir`, because the person is its author
|
|
454
|
+
- it is critical: the mod's install or setup in this session failed, or a button or hotkey the person pressed failed
|
|
455
|
+
- the mod runs from its checkout, linked with [`cmod link`](commands.md#cmod-link) or loaded with `--plugin-dir`, and the session works in that checkout or a folder inside it, because there the person is its author
|
|
456
456
|
- `Show errors from installed mods` is on, in Settings on cmod's page under Preferences
|
|
457
457
|
|
|
458
|
+
A failure every session meets at once, such as a program every session shares that stopped, is not critical, so it toasts only where its author works.
|
|
459
|
+
|
|
460
|
+
A failure whose cause is a call another mod did not answer, because it was installing or Claude Code stopped its hook, goes to the Log as a warning, because the mod that did not answer logs its own failure. A failure whose Log call cmod does not answer, such as while cmod installs, waits and tries the Log again after 10 seconds, 1 minute, and 5 minutes, and shows its toast only when cmod still has not answered.
|
|
461
|
+
|
|
458
462
|
A cmod older than 4.3.0 keeps no Log, so there every error shows its toast.
|
|
459
463
|
|
|
460
|
-
|
|
464
|
+
So a listener or handler that fails throws its error and lets cmod report it. A failure the mod works around and goes on past, such as one rule of many that did not load, goes to [`mod.log`](mod.md#modlog) with a `level`. A `mod.toast.error` for either reaches no Log and shows in every session, so a broken config of a mod the person runs in 30 sessions shows in all 30.
|
|
461
465
|
|
|
462
|
-
|
|
466
|
+
The error toast stays, with its buttons and the time on a line under the message. `Report`, which every error toast has, comes first, at the same column in every error toast, and the buttons only some errors have come after it:
|
|
467
|
+
|
|
468
|
+
- `✕` closes the toast and keeps the same failure hidden in later sessions. A new version of the mod, or a different failure, shows again.
|
|
463
469
|
- `Report` replaces the toast's buttons with the ways to tell the mod's author. `Ask Claude to report it` sends this session a prompt to file the report with the person's own tools. `Report it on GitHub (opens your browser)` opens a filled-in issue on the mod's `supportUrl` or `repository` in its `plugin.json`, or `Email the author (opens your mail app)` writes to its `author.email`. `Copy the error` copies the mod's name and version, the `@cmodjs/core` version, the message, the whole cause, and the stack.
|
|
464
|
-
- `
|
|
470
|
+
- `Retry` runs the failed step again, where running it again can work: an install, the mod's setup, or a program that stopped.
|
|
471
|
+
- `Plugins` or `Open /config` opens the place that fixes a missing mod or secret.
|
|
465
472
|
|
|
466
473
|
`clipboard.write(text)`, from `mod.js`, puts `text` on the person's clipboard. It rejects with Claude Code's reason when the terminal cannot take it.
|
|
467
474
|
|
package/jobs/program.js
CHANGED
|
@@ -47,7 +47,7 @@ export function program(options) {
|
|
|
47
47
|
failure = undefined;
|
|
48
48
|
void start();
|
|
49
49
|
};
|
|
50
|
-
report({ id: `program:${executable}`, message: `The ${executable} program stopped`, description: reason, retry
|
|
50
|
+
report({ id: `program:${executable}`, message: `The ${executable} program stopped`, description: reason, retry });
|
|
51
51
|
for (const waiter of waiting.splice(0))
|
|
52
52
|
waiter.reject(failure);
|
|
53
53
|
};
|
package/mod.d.ts
CHANGED
|
@@ -179,6 +179,7 @@ export type Mod<State extends object = Record<never, never>, Declared extends Op
|
|
|
179
179
|
use<Handle>(job: Job<Handle, State>): Handle;
|
|
180
180
|
log(text: string, options?: {
|
|
181
181
|
readonly to?: 'debug' | 'transcript';
|
|
182
|
+
readonly level?: 'warning' | 'error';
|
|
182
183
|
}): void;
|
|
183
184
|
readonly panes: {
|
|
184
185
|
add<Params = undefined>(pane: PaneInit<State, Params>): Pane<Params>;
|
package/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,SAAS,IAAI,eAAe,EAC5B,aAAa,EAC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E,MAAM,iDAAiD,CAAA;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAC/H,YAAY,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
|
package/package.json
CHANGED
package/records.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ export declare function newestLog(entries: readonly LogEntry[]): LogEntry[];
|
|
|
148
148
|
export declare function versionsLine({ mod, core, cmod, program, claudeCode }: LogVersions): string;
|
|
149
149
|
export declare function logReport(entry: LogEntry): string;
|
|
150
150
|
export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
|
|
151
|
-
export declare const coreVersion = "5.
|
|
151
|
+
export declare const coreVersion = "5.13.1";
|
|
152
152
|
export declare const oldestCmodVersion = "5.10.0";
|
|
153
153
|
export declare function hotkeyCommand(mod: string, hotkey: string): string;
|
|
154
154
|
export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
|
package/records.js
CHANGED
|
@@ -342,7 +342,7 @@ function readHotkeys(hotkeys) {
|
|
|
342
342
|
throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
|
|
343
343
|
return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
|
|
344
344
|
}
|
|
345
|
-
export const coreVersion = '5.
|
|
345
|
+
export const coreVersion = '5.13.1';
|
|
346
346
|
export const oldestCmodVersion = '5.10.0';
|
|
347
347
|
export function hotkeyCommand(mod, hotkey) {
|
|
348
348
|
return `${mod}--${hotkey}`;
|
package/runtime/deadline.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type ListenTime = {
|
|
|
14
14
|
readonly signal: AbortSignal;
|
|
15
15
|
};
|
|
16
16
|
export declare const listenerMs = 10000;
|
|
17
|
+
export declare const hookMs = 10000;
|
|
17
18
|
export declare class PassedTimeout extends Error {
|
|
18
19
|
}
|
|
19
20
|
export declare function listenerOf(name: string, method: string, args: readonly unknown[]): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../src/runtime/deadline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deadline.d.ts","sourceRoot":"","sources":["../src/runtime/deadline.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAErE,eAAO,MAAM,SAAS,SAAU,CAAA;AAEhC,eAAO,MAAM,YAAY,EAAE,QAAqC,CAAA;AAEhE,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AAEnG,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAAA;AAEpF,eAAO,MAAM,UAAU,QAAS,CAAA;AAEhC,eAAO,MAAM,MAAM,QAAoC,CAAA;AAEvD,qBAAa,aAAc,SAAQ,KAAK;CAAG;AAI3C,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;CAAE,CASnN;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,SAAsB,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAoB9N;AAED,eAAO,MAAM,YAAY,OAAO,CAAA;AAEhC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAY9G;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAe/H"}
|
package/runtime/deadline.js
CHANGED
|
@@ -13,4 +13,7 @@ export declare function notInstalled(name: string): string;
|
|
|
13
13
|
export declare function isNotInstalled(name: string, error: unknown): boolean;
|
|
14
14
|
export declare function stillInstalling(name: string): string;
|
|
15
15
|
export declare function isStillInstalling(name: string, error: unknown): boolean;
|
|
16
|
+
export declare function didNotAnswer(name: string): string;
|
|
17
|
+
export declare const overranHook: string;
|
|
18
|
+
export declare function isUnanswered(error: unknown): boolean;
|
|
16
19
|
//# 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;
|
|
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;AAEzC,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;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,eAAO,MAAM,WAAW,QAAgE,CAAA;AAExF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOpD"}
|
package/runtime/dependencies.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { installFix } from '../records.js';
|
|
2
2
|
import { messageOf } from '../utils/text.js';
|
|
3
|
+
import { hookMs } from './deadline.js';
|
|
3
4
|
export const cmodPluginName = 'cmod';
|
|
4
5
|
export const loadedMethod = 'cmod:isLoaded';
|
|
5
6
|
export async function answerCall(name, api, e) {
|
|
@@ -49,3 +50,16 @@ export function stillInstalling(name) {
|
|
|
49
50
|
export function isStillInstalling(name, error) {
|
|
50
51
|
return messageOf(error).endsWith(stillInstalling(name));
|
|
51
52
|
}
|
|
53
|
+
export function didNotAnswer(name) {
|
|
54
|
+
return `${name} did not answer in time, so Claude Code went on without it.`;
|
|
55
|
+
}
|
|
56
|
+
export const overranHook = `it ran past the ${hookMs / 1000} s Claude Code gives a hook`;
|
|
57
|
+
export function isUnanswered(error) {
|
|
58
|
+
const refusals = [stillInstalling(''), didNotAnswer(''), `: ${overranHook}`];
|
|
59
|
+
for (let cause = error; cause !== undefined; cause = cause instanceof Error ? cause.cause : undefined) {
|
|
60
|
+
const message = messageOf(cause);
|
|
61
|
+
if (refusals.some((refusal) => message.endsWith(refusal)))
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
package/runtime/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/runtime/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/runtime/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAA4B,KAAK,QAAQ,EAAmB,MAAM,0BAA0B,CAAA;AAKnG,MAAM,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAA;AAE1D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAE1D,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,KAAK,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC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AG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAgB3I"}
|
package/runtime/hooks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { configFolders } from '../records.js';
|
|
2
|
-
import { callEffects } from '../utils/call-effects.js';
|
|
2
|
+
import { callEffects, InvalidCall } from '../utils/call-effects.js';
|
|
3
3
|
import { dynamicPattern } from '../utils/parse-shell.js';
|
|
4
4
|
import { isMissing } from '../utils/paths.js';
|
|
5
5
|
import { messageOf } from '../utils/text.js';
|
|
@@ -62,7 +62,8 @@ export async function callFiles(name, claude, folders, use, cwd) {
|
|
|
62
62
|
return { read: read.flat(), changed: known(writes) };
|
|
63
63
|
}
|
|
64
64
|
catch (error) {
|
|
65
|
-
|
|
65
|
+
if (!(error instanceof InvalidCall))
|
|
66
|
+
claude.ui.warn('call:files', `${name}: the ${use.tool} call lists no files: ${messageOf(error)}`);
|
|
66
67
|
return { read: [], changed: [] };
|
|
67
68
|
}
|
|
68
69
|
}
|
package/runtime/installer.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type Installer = {
|
|
|
12
12
|
options(missing: readonly (readonly [string, Option])[], save: (key: string, value: string) => Promise<string | undefined>): Promise<boolean>;
|
|
13
13
|
step<State extends object>(mod: Mod<State>, step: Step<State>, index: number, total: number): Promise<boolean>;
|
|
14
14
|
close(): Promise<void>;
|
|
15
|
+
changed(): void;
|
|
15
16
|
shown(): Promise<void>;
|
|
16
17
|
collect(run: () => Promise<unknown>): Promise<PartsUpdate>;
|
|
17
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/runtime/installer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,M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IACtB,OAAO,IAAI,IAAI,CAAA;IACf,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,OAAO,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CAC3D,CAAA;AAID,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,EAAE,OAAO,EAAE;IAAE,IAAI,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAAC,IAAI,IAAI,IAAI,CAAA;CAAE,EAAE,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,CAqLvK"}
|
package/runtime/installer.js
CHANGED
|
@@ -170,6 +170,10 @@ export function createInstaller(name, claude, waiting, nextDraw) {
|
|
|
170
170
|
isSeen = false;
|
|
171
171
|
await send({ requests: [{ close: installPage }] }).catch(log('the install page stayed open'));
|
|
172
172
|
},
|
|
173
|
+
changed() {
|
|
174
|
+
if (question !== undefined && isOpen)
|
|
175
|
+
redraw();
|
|
176
|
+
},
|
|
173
177
|
shown: () => new Promise((resolve) => void waitingForShow.push(resolve)),
|
|
174
178
|
collect,
|
|
175
179
|
};
|
|
@@ -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,
|
|
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,EAAE,aAAa,EAAwB,MAAM,aAAa,CAAA;AAG5H,OAAO,KAAK,EAAW,GAAG,EAAE,aAAa,EAA8G,MAAM,WAAW,CAAA;AACxK,OAAO,KAAK,EAA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ACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IACtE,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAChE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAA;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;CACjD,KAAK,UAAU,CAAA;AAwDhB,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBhE;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,CA4iBlB"}
|
package/runtime/lifecycle.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { dataFolder, finishStepsMethod, isAtLeast, isProgramNewer, oldestCmodVersion, pendingStepsMethod, parseEvent, programPath, readRecord, readSteps, recordPath, scriptsSha256, serviceFolder, storeFolder } from '../records.js';
|
|
2
2
|
import { homePrefix, ifMissing, relativePath } from '../utils/paths.js';
|
|
3
3
|
import { firstLine, formatExit, messageOf } from '../utils/text.js';
|
|
4
|
-
import { beforeDeadline, settledAfterAbort } from './deadline.js';
|
|
4
|
+
import { beforeDeadline, hookMs, 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, isStillInstalling, loadedMethod, stillInstalling, withBareRefusals } from './dependencies.js';
|
|
7
|
+
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, isStillInstalling, loadedMethod, overranHook, 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';
|
|
@@ -37,8 +37,7 @@ const recordCheckMs = 1000;
|
|
|
37
37
|
const drawsPerMs = 1000;
|
|
38
38
|
const cmodWaitMs = 60_000;
|
|
39
39
|
const cmodSlowCheckMs = 10_000;
|
|
40
|
-
const
|
|
41
|
-
const startHoldMs = hookMs - 1_000;
|
|
40
|
+
const startHoldMs = hookMs / 2;
|
|
42
41
|
const dependencyCallMs = 30_000;
|
|
43
42
|
const stallTicks = 3;
|
|
44
43
|
const stallMs = 60_000;
|
|
@@ -288,7 +287,7 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
288
287
|
return;
|
|
289
288
|
const activeRouter = createRouter();
|
|
290
289
|
startingRouter = activeRouter;
|
|
291
|
-
const active = await createMod(definition, { ...runtime, router: activeRouter, dataFolder: dataFolder(plugin.store, plugin.name), store: plugin.store, permissionRoutes, options: pluginOptions, nextDraw, serveCmodPlugin })
|
|
290
|
+
const active = await createMod(definition, { ...runtime, router: activeRouter, dataFolder: dataFolder(plugin.store, plugin.name), store: plugin.store, permissionRoutes, options: pluginOptions, nextDraw, installer, serveCmodPlugin })
|
|
292
291
|
.catch(async (error) => {
|
|
293
292
|
if (error instanceof MissingOptions && (await askOptions(error)))
|
|
294
293
|
return undefined;
|
|
@@ -559,19 +558,19 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
559
558
|
if (event === 'cmod.call' && !isCallToThisMod)
|
|
560
559
|
return next(e);
|
|
561
560
|
const isListen = isCallToThisMod && event === 'cmod.call' && listenMethods.includes(asked.method);
|
|
561
|
+
if (isListen && phase !== 'active') {
|
|
562
|
+
heldListens.set(`${asked.caller}\n${asked.method}\n${String(asked.input.session)}`, asked);
|
|
563
|
+
void startSettled.then(whenInstalled).then(whenActive);
|
|
564
|
+
return { value: null };
|
|
565
|
+
}
|
|
562
566
|
const waitsForInstall = isCallToThisMod && !(event === 'cmod.call' && answeredAtOnce.includes(asked.method));
|
|
563
567
|
const isLate = await (waitsForInstall ? holdUntilInstalled(signal) : event === 'classic.SessionStart' || event === 'session.append' || isCallToThisMod ? holdUntilStarted(signal) : holdUntilActive(signal));
|
|
564
568
|
if (event === 'classic.SessionStart' && phase !== 'active') {
|
|
565
569
|
missedSessionStart = e;
|
|
566
570
|
return next(e);
|
|
567
571
|
}
|
|
568
|
-
if (isCallToThisMod && phase !== 'active')
|
|
569
|
-
if (isListen) {
|
|
570
|
-
heldListens.set(`${asked.caller}\n${asked.method}\n${String(asked.input.session)}`, asked);
|
|
571
|
-
return { value: null };
|
|
572
|
-
}
|
|
572
|
+
if (isCallToThisMod && phase !== 'active')
|
|
573
573
|
return { deny: phase === 'failed' ? notSetUp() : stillInstalling(definition.name) };
|
|
574
|
-
}
|
|
575
574
|
if (isLate && phase !== 'active')
|
|
576
575
|
return (startingRouter ?? router).dispatchFailure(event, e, new Error(`it was still starting after ${startHoldMs / 1000} s`), next, false);
|
|
577
576
|
const call = e;
|
|
@@ -659,7 +658,7 @@ export function createLifecycle(definition, permissionRoutes = () => undefined,
|
|
|
659
658
|
async caught(event, e, next, { error: { kind, message }, called }) {
|
|
660
659
|
const call = e;
|
|
661
660
|
const isAsk = event === 'cmod.call' && call.to === definition.name && beforeAskOf(call) !== undefined;
|
|
662
|
-
const reasons = { timeout:
|
|
661
|
+
const reasons = { timeout: overranHook, throw: message ?? 'it threw' };
|
|
663
662
|
const reason = reasons[kind];
|
|
664
663
|
if (reason === undefined)
|
|
665
664
|
return isAsk ? { value: null } : next(e);
|
|
@@ -721,7 +720,11 @@ async function createMod(definition, runtime) {
|
|
|
721
720
|
forkedFrom = parent;
|
|
722
721
|
return parent;
|
|
723
722
|
}));
|
|
724
|
-
const
|
|
723
|
+
const stateChanged = () => {
|
|
724
|
+
area.changed();
|
|
725
|
+
runtime.installer.changed();
|
|
726
|
+
};
|
|
727
|
+
const modState = createState({ name: definition.name, initial: definition.state ?? {}, session, root, claude, report, changed: stateChanged, forkParent });
|
|
725
728
|
const modOptions = createOptions({ name: definition.name, declared: definition.options ?? {}, fromClaude: runtime.options, claude, report, changed: modState.changed });
|
|
726
729
|
const hookOn = (hook, listener, failed) => router.add(`classic.${hook}`, classicHook(hook, listener, report), failed === undefined ? undefined : classicFailure(failed));
|
|
727
730
|
const expand = (path) => (homePrefix.test(path) ? resolvedPath(path, places) : path);
|
|
@@ -895,7 +898,14 @@ async function createMod(definition, runtime) {
|
|
|
895
898
|
every: (ms, listener) => timer(ms, 'every', true, listener),
|
|
896
899
|
after: (ms, listener) => timer(ms, 'after', false, listener),
|
|
897
900
|
use: (job) => job({ mod, announce, reserveName }),
|
|
898
|
-
log: (text, options) =>
|
|
901
|
+
log: (text, options) => {
|
|
902
|
+
if (options?.level === 'error')
|
|
903
|
+
report({ id: `log:${text}`, message: text });
|
|
904
|
+
else if (options?.level === 'warning')
|
|
905
|
+
claude.ui.warn(`log:${text}`, `${definition.name}: ${text}`);
|
|
906
|
+
else
|
|
907
|
+
claude.ui.log(`${definition.name}: ${text}`, { to: options?.to ?? 'debug' });
|
|
908
|
+
},
|
|
899
909
|
panes: area.panes,
|
|
900
910
|
sidebar: area.sidebar,
|
|
901
911
|
settings: area.settings,
|
package/runtime/toaster.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../src/runtime/toaster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAS,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAgB,SAAS,EAAE,MAAM,WAAW,CAAA;AAExE,OAAO,EAAgD,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEzG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAIzC,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9G,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvN,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,MAA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AO,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;AAkDD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,CA8VtG;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"}
|
package/runtime/toaster.js
CHANGED
|
@@ -2,14 +2,17 @@ import { Box, Button, drawWith, Link, Text } from '../ui/elements.js';
|
|
|
2
2
|
import { coreVersion, installFix, isObject, secretFix } from '../records.js';
|
|
3
3
|
import { firstLine, messageOf } from '../utils/text.js';
|
|
4
4
|
import { beforeDeadline } from './deadline.js';
|
|
5
|
-
import { cmodPluginName } from './dependencies.js';
|
|
5
|
+
import { cmodPluginName, isUnanswered } from './dependencies.js';
|
|
6
6
|
export const failedMethod = 'cmod:failed';
|
|
7
7
|
const githubRepository = /^https:\/\/github\.com\/([^/]+\/[^/#?]+?)(?:\.git)?(?:\/issues)?\/?$/;
|
|
8
8
|
const linkLimit = 2048;
|
|
9
9
|
const hiddenKey = 'cmod:hidden-failures';
|
|
10
10
|
const failedCallMs = 30_000;
|
|
11
|
+
const logAgainMs = [10_000, 60_000, 300_000];
|
|
11
12
|
const defaultDuration = 4000;
|
|
12
13
|
const visibleToasts = 3;
|
|
14
|
+
const columnGap = 2;
|
|
15
|
+
const nameColumn = 16;
|
|
13
16
|
const spinner = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
14
17
|
const spinnerMs = 100;
|
|
15
18
|
const spinFrames = 10_000 / spinnerMs;
|
|
@@ -168,19 +171,26 @@ export function createToaster(claude, name, version) {
|
|
|
168
171
|
});
|
|
169
172
|
};
|
|
170
173
|
const showsToast = async (failure, isShown) => {
|
|
174
|
+
const call = { isSettled: false };
|
|
171
175
|
try {
|
|
172
|
-
const logged = logFailure(failure);
|
|
176
|
+
const logged = logFailure(failure).finally(() => void (call.isSettled = true));
|
|
173
177
|
const answer = await (isShown ? logged : beforeDeadline(claude, { ms: failedCallMs }, failedMethod, logged));
|
|
174
178
|
if (isObject(answer) && typeof answer['showsToast'] === 'boolean')
|
|
175
179
|
return answer['showsToast'];
|
|
176
180
|
throw new Error(`cmod answered ${answer === undefined ? 'nothing' : JSON.stringify(answer)}, not { showsToast: true or false }`);
|
|
177
181
|
}
|
|
178
182
|
catch (error) {
|
|
183
|
+
if (!call.isSettled || isUnanswered(error))
|
|
184
|
+
return 'unanswered';
|
|
179
185
|
claude.ui.log(`${name}: cmod kept no Log of ${failure.id}, so it shows the toast: ${messageOf(error)}`, { to: 'debug' });
|
|
180
186
|
return undefined;
|
|
181
187
|
}
|
|
182
188
|
};
|
|
183
189
|
const fail = ({ id, message, error, description = error === undefined || describe(error) === message ? undefined : describe(error), retry, isCritical = false, root = claude.plugin.root }) => {
|
|
190
|
+
if (!isCritical && isUnanswered(error)) {
|
|
191
|
+
warn(id, `${name}: ${message}: ${describe(error)}`);
|
|
192
|
+
return id;
|
|
193
|
+
}
|
|
184
194
|
const hides = `${version() ?? ''}\n${message}\n${error === undefined ? '' : describe(error)}`;
|
|
185
195
|
const at = new Date();
|
|
186
196
|
const repeat = `${hides}\n${description ?? ''}\n${at.toISOString().slice(0, 16)}`;
|
|
@@ -189,11 +199,16 @@ export function createToaster(claude, name, version) {
|
|
|
189
199
|
sent.set(id, repeat);
|
|
190
200
|
const stack = error instanceof Error && error.stack !== undefined ? `\n\n${error.stack}` : '';
|
|
191
201
|
const details = async (failedAt) => detailsOf(await modVersion(), failedAt, `${message}${description === undefined ? '' : `\n${description}`}${stack}`);
|
|
192
|
-
const logged = async () => {
|
|
202
|
+
const logged = async (tries = 0) => {
|
|
193
203
|
const contact = await contactOf(claude);
|
|
194
204
|
const version = await modVersion();
|
|
195
205
|
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 };
|
|
196
206
|
const shows = await showsToast(failure, isCritical);
|
|
207
|
+
const wait = logAgainMs[tries];
|
|
208
|
+
if (shows === 'unanswered' && wait !== undefined)
|
|
209
|
+
return void claude.clock.after(wait, () => void logged(tries + 1));
|
|
210
|
+
if (shows === 'unanswered')
|
|
211
|
+
claude.ui.log(`${name}: cmod did not answer ${logAgainMs.length + 1} times, so ${id} reached no Log and shows its toast`, { to: 'debug' });
|
|
197
212
|
if (isCritical)
|
|
198
213
|
return;
|
|
199
214
|
if (shows !== false)
|
|
@@ -219,7 +234,7 @@ export function createToaster(claude, name, version) {
|
|
|
219
234
|
changed();
|
|
220
235
|
return;
|
|
221
236
|
}
|
|
222
|
-
const actions = [
|
|
237
|
+
const actions = [{ label: 'Report', onClick: startReporting }, ...(retry === undefined ? [] : [{ label: 'Retry', onClick: tryAgain }]), ...fixes];
|
|
223
238
|
put('error', message, { id, ...(description === undefined ? {} : { description }), duration: Infinity }, actions, hides);
|
|
224
239
|
};
|
|
225
240
|
const startReporting = async () => {
|
|
@@ -272,27 +287,28 @@ export function createToaster(claude, name, version) {
|
|
|
272
287
|
const message = isText ? Button({ plain: true, key: `toast:${entry.id}:open`, label: entry.message, onPress: toggle(entry) }) : Text({ children: entry.message });
|
|
273
288
|
const details = !isText ? description : Text({ dimColor: true, wrap: entry.isOpen ? 'wrap' : 'truncate-end', children: entry.isOpen ? description : firstLine(description) });
|
|
274
289
|
const fixed = (child) => Box({ flexShrink: 0, children: child });
|
|
275
|
-
const close = Button({ plain: true, dimColor: true, key: `toast:${entry.id}:close`, label:
|
|
290
|
+
const close = Button({ plain: true, dimColor: true, key: `toast:${entry.id}:close`, label: '✕', onPress: () => hide(entry) });
|
|
276
291
|
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) }));
|
|
277
|
-
const
|
|
292
|
+
const time = Text({ dimColor: true, children: entry.count > 1 ? `${clockTime(entry.at)} · ${entry.count} times` : clockTime(entry.at) });
|
|
293
|
+
const buttons = actions.length === 0 ? [] : [Box({ gap: columnGap, flexWrap: 'wrap', children: [...actions, time].map(fixed) })];
|
|
278
294
|
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] });
|
|
279
|
-
const text = details === undefined ? [
|
|
280
|
-
const under = trying !== undefined && details === undefined ? [trying] : entry.reporting === undefined ?
|
|
295
|
+
const text = details === undefined ? [] : [trying ?? details];
|
|
296
|
+
const under = trying !== undefined && details === undefined ? [trying] : entry.reporting === undefined ? buttons : reportChoices(entry, entry.reporting);
|
|
281
297
|
return Box({
|
|
282
298
|
width: columns,
|
|
283
|
-
gap:
|
|
299
|
+
gap: columnGap,
|
|
284
300
|
justifyContent: 'space-between',
|
|
285
301
|
children: [
|
|
286
302
|
Box({
|
|
287
|
-
gap:
|
|
303
|
+
gap: columnGap,
|
|
288
304
|
flexShrink: 1,
|
|
289
305
|
children: [
|
|
290
306
|
fixed(Text({ ...(icon.color === undefined ? {} : { color: icon.color }), children: icon.glyph })),
|
|
291
|
-
fixed(Text({ dimColor: true, children: name })),
|
|
292
|
-
Box({ flexDirection: 'column', flexShrink: 1, children:
|
|
307
|
+
fixed(Text({ dimColor: true, children: name.padEnd(nameColumn) })),
|
|
308
|
+
Box({ flexDirection: 'column', flexShrink: 1, children: [message, ...text, ...under] }),
|
|
293
309
|
],
|
|
294
310
|
}),
|
|
295
|
-
|
|
311
|
+
fixed(close),
|
|
296
312
|
],
|
|
297
313
|
});
|
|
298
314
|
};
|
package/src/jobs/program.ts
CHANGED
|
@@ -60,7 +60,7 @@ export function program(options: { readonly command: readonly string[]; readonly
|
|
|
60
60
|
failure = undefined
|
|
61
61
|
void start()
|
|
62
62
|
}
|
|
63
|
-
report({ id: `program:${executable}`, message: `The ${executable} program stopped`, description: reason, retry
|
|
63
|
+
report({ id: `program:${executable}`, message: `The ${executable} program stopped`, description: reason, retry })
|
|
64
64
|
for (const waiter of waiting.splice(0)) waiter.reject(failure)
|
|
65
65
|
}
|
|
66
66
|
|
package/src/mod.ts
CHANGED
|
@@ -225,7 +225,7 @@ export type Mod<State extends object = Record<never, never>, Declared extends Op
|
|
|
225
225
|
every(ms: number, listener: () => unknown): Timer
|
|
226
226
|
after(ms: number, listener: () => unknown): Timer
|
|
227
227
|
use<Handle>(job: Job<Handle, State>): Handle
|
|
228
|
-
log(text: string, options?: { readonly to?: 'debug' | 'transcript' }): void
|
|
228
|
+
log(text: string, options?: { readonly to?: 'debug' | 'transcript'; readonly level?: 'warning' | 'error' }): void
|
|
229
229
|
readonly panes: { add<Params = undefined>(pane: PaneInit<State, Params>): Pane<Params> }
|
|
230
230
|
readonly sidebar: { add<Params = undefined>(page: PageInit<State, Params>): Page<Params> }
|
|
231
231
|
readonly settings: {
|
package/src/records.ts
CHANGED
|
@@ -417,7 +417,7 @@ function readHotkeys(hotkeys: unknown): Steps {
|
|
|
417
417
|
return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys as Record<string, HotkeyInit>) }
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
export const coreVersion = '5.
|
|
420
|
+
export const coreVersion = '5.13.1'
|
|
421
421
|
|
|
422
422
|
export const oldestCmodVersion = '5.10.0'
|
|
423
423
|
|
package/src/runtime/deadline.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HookBudget } from 'claude-code'
|
|
1
2
|
import type { Claude } from './claude.js'
|
|
2
3
|
|
|
3
4
|
export type Deadline = { readonly ms: number; readonly job?: string }
|
|
@@ -12,6 +13,8 @@ export type ListenTime = { readonly deadline: number; readonly signal: AbortSign
|
|
|
12
13
|
|
|
13
14
|
export const listenerMs = 10_000
|
|
14
15
|
|
|
16
|
+
export const hookMs = 10_000 satisfies HookBudget['ms']
|
|
17
|
+
|
|
15
18
|
export class PassedTimeout extends Error {}
|
|
16
19
|
|
|
17
20
|
const timers = globalThis as unknown as { setTimeout(run: () => void, ms: number): unknown; clearTimeout(timer: unknown): void }
|
|
@@ -2,6 +2,7 @@ import type { Args, CmodDependencies, EventResult, Frozen } from 'claude-code'
|
|
|
2
2
|
import { installFix } from '../records.js'
|
|
3
3
|
import { messageOf } from '../utils/text.js'
|
|
4
4
|
import type { Claude } from './claude.js'
|
|
5
|
+
import { hookMs } from './deadline.js'
|
|
5
6
|
import type { Router } from './router.js'
|
|
6
7
|
|
|
7
8
|
export const cmodPluginName = 'cmod'
|
|
@@ -63,3 +64,18 @@ export function stillInstalling(name: string): string {
|
|
|
63
64
|
export function isStillInstalling(name: string, error: unknown): boolean {
|
|
64
65
|
return messageOf(error).endsWith(stillInstalling(name))
|
|
65
66
|
}
|
|
67
|
+
|
|
68
|
+
export function didNotAnswer(name: string): string {
|
|
69
|
+
return `${name} did not answer in time, so Claude Code went on without it.`
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const overranHook = `it ran past the ${hookMs / 1000} s Claude Code gives a hook`
|
|
73
|
+
|
|
74
|
+
export function isUnanswered(error: unknown): boolean {
|
|
75
|
+
const refusals = [stillInstalling(''), didNotAnswer(''), `: ${overranHook}`]
|
|
76
|
+
for (let cause = error; cause !== undefined; cause = cause instanceof Error ? cause.cause : undefined) {
|
|
77
|
+
const message = messageOf(cause)
|
|
78
|
+
if (refusals.some((refusal) => message.endsWith(refusal))) return true
|
|
79
|
+
}
|
|
80
|
+
return false
|
|
81
|
+
}
|
package/src/runtime/hooks.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { configFolders } from '../records.js'
|
|
|
3
3
|
import type { Claude } from './claude.js'
|
|
4
4
|
import type { RoutedFailure, RoutedHook } from './router.js'
|
|
5
5
|
import type { Failure } from './toaster.js'
|
|
6
|
-
import { callEffects, type CallBase, type FileAccess } from '../utils/call-effects.js'
|
|
6
|
+
import { callEffects, InvalidCall, type CallBase, type FileAccess } from '../utils/call-effects.js'
|
|
7
7
|
import { dynamicPattern } from '../utils/parse-shell.js'
|
|
8
8
|
import { isMissing } from '../utils/paths.js'
|
|
9
9
|
import { messageOf } from '../utils/text.js'
|
|
@@ -97,7 +97,7 @@ export async function callFiles(name: string, claude: Claude, folders: Promise<H
|
|
|
97
97
|
const read = await Promise.all(known(reads).map(async (path) => ((await claude.fs.stat(path).catch(unchecked(path)))?.kind === 'file' ? [path] : [])))
|
|
98
98
|
return { read: read.flat(), changed: known(writes) }
|
|
99
99
|
} catch (error) {
|
|
100
|
-
claude.ui.warn('call:files', `${name}: the ${use.tool} call lists no files: ${messageOf(error)}`)
|
|
100
|
+
if (!(error instanceof InvalidCall)) claude.ui.warn('call:files', `${name}: the ${use.tool} call lists no files: ${messageOf(error)}`)
|
|
101
101
|
return { read: [], changed: [] }
|
|
102
102
|
}
|
|
103
103
|
}
|
package/src/runtime/installer.ts
CHANGED
|
@@ -24,6 +24,7 @@ export type Installer = {
|
|
|
24
24
|
options(missing: readonly (readonly [string, Option])[], save: (key: string, value: string) => Promise<string | undefined>): Promise<boolean>
|
|
25
25
|
step<State extends object>(mod: Mod<State>, step: Step<State>, index: number, total: number): Promise<boolean>
|
|
26
26
|
close(): Promise<void>
|
|
27
|
+
changed(): void
|
|
27
28
|
shown(): Promise<void>
|
|
28
29
|
collect(run: () => Promise<unknown>): Promise<PartsUpdate>
|
|
29
30
|
}
|
|
@@ -205,6 +206,9 @@ export function createInstaller(name: string, claude: () => Claude, waiting: { s
|
|
|
205
206
|
isSeen = false
|
|
206
207
|
await send({ requests: [{ close: installPage }] }).catch(log('the install page stayed open'))
|
|
207
208
|
},
|
|
209
|
+
changed() {
|
|
210
|
+
if (question !== undefined && isOpen) redraw()
|
|
211
|
+
},
|
|
208
212
|
shown: () => new Promise<void>((resolve) => void waitingForShow.push(resolve)),
|
|
209
213
|
collect,
|
|
210
214
|
}
|
package/src/runtime/lifecycle.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Args, Caught, ClassicHookInputs, EventResult, Frozen,
|
|
1
|
+
import type { Args, Caught, ClassicHookInputs, EventResult, Frozen, PluginOptions, RenderElement, Timer } from 'claude-code'
|
|
2
2
|
import type { Step } from '../installer.js'
|
|
3
3
|
|
|
4
4
|
import type { Imports, Mod, ModDefinition, Reservation, SettingsFile, SettingsFileChange, SettingsFileChangeListener, Subscription, Timer as ModTimer } from '../mod.js'
|
|
@@ -7,11 +7,11 @@ import { dataFolder, finishStepsMethod, isAtLeast, isProgramNewer, oldestCmodVer
|
|
|
7
7
|
import { homePrefix, ifMissing, relativePath } from '../utils/paths.js'
|
|
8
8
|
import { firstLine, formatExit, messageOf } from '../utils/text.js'
|
|
9
9
|
import type { Claude } from './claude.js'
|
|
10
|
-
import { beforeDeadline, settledAfterAbort } from './deadline.js'
|
|
10
|
+
import { beforeDeadline, hookMs, 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, isStillInstalling, loadedMethod, stillInstalling, withBareRefusals } from './dependencies.js'
|
|
14
|
+
import { answerCall, answeringOwnCalls, cmodPluginName, dependencyCalls, isStillInstalling, loadedMethod, overranHook, 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'
|
|
@@ -19,7 +19,7 @@ import type { PermissionRoutes } from './permission-check.js'
|
|
|
19
19
|
import { cmodError, locatingPrograms, newestCmodVersion, readLines, runCmod, spawnCmod, type Programs } from './programs.js'
|
|
20
20
|
import { createModFiles, resolvedPath, type Places } from './metadata.js'
|
|
21
21
|
import { fitsOption } from '../options.js'
|
|
22
|
-
import { createInstaller } from './installer.js'
|
|
22
|
+
import { createInstaller, type Installer } from './installer.js'
|
|
23
23
|
import { createOptions, MissingOptions } from './options.js'
|
|
24
24
|
import { createRouter, unaborted, type Router, type RouterNext } from './router.js'
|
|
25
25
|
import { conversationMethods, createSessionsClient, type SessionColor, type SessionsClient } from './sessions.js'
|
|
@@ -89,6 +89,7 @@ type ModRuntime = {
|
|
|
89
89
|
readonly permissionRoutes: () => PermissionRoutes | undefined
|
|
90
90
|
readonly options: PluginOptions
|
|
91
91
|
readonly nextDraw: () => number
|
|
92
|
+
readonly installer: Pick<Installer, 'changed'>
|
|
92
93
|
readonly serveCmodPlugin: ServeCmodPlugin | undefined
|
|
93
94
|
}
|
|
94
95
|
|
|
@@ -122,9 +123,7 @@ const cmodWaitMs = 60_000
|
|
|
122
123
|
|
|
123
124
|
const cmodSlowCheckMs = 10_000
|
|
124
125
|
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
const startHoldMs = hookMs - 1_000
|
|
126
|
+
const startHoldMs = hookMs / 2
|
|
128
127
|
|
|
129
128
|
const dependencyCallMs = 30_000
|
|
130
129
|
|
|
@@ -395,7 +394,7 @@ export function createLifecycle<State extends object, Declared extends Options =
|
|
|
395
394
|
if (runtime === undefined || plugin === undefined) return
|
|
396
395
|
const activeRouter = createRouter()
|
|
397
396
|
startingRouter = activeRouter
|
|
398
|
-
const active = await createMod(definition, { ...runtime, router: activeRouter, dataFolder: dataFolder(plugin.store, plugin.name), store: plugin.store, permissionRoutes, options: pluginOptions, nextDraw, serveCmodPlugin })
|
|
397
|
+
const active = await createMod(definition, { ...runtime, router: activeRouter, dataFolder: dataFolder(plugin.store, plugin.name), store: plugin.store, permissionRoutes, options: pluginOptions, nextDraw, installer, serveCmodPlugin })
|
|
399
398
|
.catch(async (error: unknown) => {
|
|
400
399
|
if (error instanceof MissingOptions && (await askOptions(error))) return undefined
|
|
401
400
|
await installer.close()
|
|
@@ -647,19 +646,18 @@ export function createLifecycle<State extends object, Declared extends Options =
|
|
|
647
646
|
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}__`))
|
|
648
647
|
if (event === 'cmod.call' && !isCallToThisMod) return next(e)
|
|
649
648
|
const isListen = isCallToThisMod && event === 'cmod.call' && listenMethods.includes(asked.method)
|
|
649
|
+
if (isListen && phase !== 'active') {
|
|
650
|
+
heldListens.set(`${asked.caller}\n${asked.method}\n${String((asked.input as { readonly session?: unknown }).session)}`, asked)
|
|
651
|
+
void startSettled.then(whenInstalled).then(whenActive)
|
|
652
|
+
return { value: null } as EventResult<N>
|
|
653
|
+
}
|
|
650
654
|
const waitsForInstall = isCallToThisMod && !(event === 'cmod.call' && answeredAtOnce.includes(asked.method))
|
|
651
655
|
const isLate = await (waitsForInstall ? holdUntilInstalled(signal) : event === 'classic.SessionStart' || event === 'session.append' || isCallToThisMod ? holdUntilStarted(signal) : holdUntilActive(signal))
|
|
652
656
|
if (event === 'classic.SessionStart' && phase !== 'active') {
|
|
653
657
|
missedSessionStart = e as Frozen<Args<'classic.SessionStart'>>
|
|
654
658
|
return next(e)
|
|
655
659
|
}
|
|
656
|
-
if (isCallToThisMod && phase !== 'active') {
|
|
657
|
-
if (isListen) {
|
|
658
|
-
heldListens.set(`${asked.caller}\n${asked.method}\n${String((asked.input as { readonly session?: unknown }).session)}`, asked)
|
|
659
|
-
return { value: null } as EventResult<N>
|
|
660
|
-
}
|
|
661
|
-
return { deny: phase === 'failed' ? notSetUp() : stillInstalling(definition.name) } as EventResult<N>
|
|
662
|
-
}
|
|
660
|
+
if (isCallToThisMod && phase !== 'active') return { deny: phase === 'failed' ? notSetUp() : stillInstalling(definition.name) } as EventResult<N>
|
|
663
661
|
if (isLate && phase !== 'active') return (startingRouter ?? router).dispatchFailure(event, e, new Error(`it was still starting after ${startHoldMs / 1000} s`), next, false)
|
|
664
662
|
const call = e as Frozen<Args<'cmod.call'>>
|
|
665
663
|
if (event === 'cmod.call' && call.to === definition.name && mod !== undefined) {
|
|
@@ -738,7 +736,7 @@ export function createLifecycle<State extends object, Declared extends Options =
|
|
|
738
736
|
async caught<N extends RoutedEvent>(event: N, e: Frozen<Args<N>>, next: RouterNext<N>, { error: { kind, message }, called }: Caught): Promise<EventResult<N>> {
|
|
739
737
|
const call = e as Frozen<Args<'cmod.call'>>
|
|
740
738
|
const isAsk = event === 'cmod.call' && call.to === definition.name && beforeAskOf(call) !== undefined
|
|
741
|
-
const reasons: Readonly<Record<string, string>> = { timeout:
|
|
739
|
+
const reasons: Readonly<Record<string, string>> = { timeout: overranHook, throw: message ?? 'it threw' }
|
|
742
740
|
const reason = reasons[kind]
|
|
743
741
|
if (reason === undefined) return isAsk ? ({ value: null } as EventResult<N>) : next(e)
|
|
744
742
|
const error = new Error(reason)
|
|
@@ -796,7 +794,11 @@ async function createMod<State extends object, Declared extends Options>(definit
|
|
|
796
794
|
forkedFrom = parent
|
|
797
795
|
return parent
|
|
798
796
|
}))
|
|
799
|
-
const
|
|
797
|
+
const stateChanged = () => {
|
|
798
|
+
area.changed()
|
|
799
|
+
runtime.installer.changed()
|
|
800
|
+
}
|
|
801
|
+
const modState = createState<State>({ name: definition.name, initial: definition.state ?? {}, session, root, claude, report, changed: stateChanged, forkParent })
|
|
800
802
|
const modOptions = createOptions({ name: definition.name, declared: definition.options ?? {}, fromClaude: runtime.options, claude, report, changed: modState.changed })
|
|
801
803
|
const hookOn = <H extends Hook>(hook: H, listener: HookListener<H>, failed?: (input: ClassicHookInputs[H], error: Error) => HookFields | undefined): Subscription =>
|
|
802
804
|
router.add(`classic.${hook}`, classicHook(hook, listener, report), failed === undefined ? undefined : classicFailure(failed))
|
|
@@ -968,7 +970,11 @@ async function createMod<State extends object, Declared extends Options>(definit
|
|
|
968
970
|
every: (ms, listener) => timer(ms, 'every', true, listener),
|
|
969
971
|
after: (ms, listener) => timer(ms, 'after', false, listener),
|
|
970
972
|
use: (job) => job({ mod, announce, reserveName }),
|
|
971
|
-
log: (text, options) =>
|
|
973
|
+
log: (text, options) => {
|
|
974
|
+
if (options?.level === 'error') report({ id: `log:${text}`, message: text })
|
|
975
|
+
else if (options?.level === 'warning') claude.ui.warn(`log:${text}`, `${definition.name}: ${text}`)
|
|
976
|
+
else claude.ui.log(`${definition.name}: ${text}`, { to: options?.to ?? 'debug' })
|
|
977
|
+
},
|
|
972
978
|
panes: area.panes,
|
|
973
979
|
sidebar: area.sidebar,
|
|
974
980
|
settings: area.settings,
|
package/src/runtime/toaster.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { coreVersion, installFix, isObject, secretFix, type Contact, type LogLev
|
|
|
5
5
|
import { firstLine, messageOf } from '../utils/text.js'
|
|
6
6
|
import type { Claude } from './claude.js'
|
|
7
7
|
import { beforeDeadline } from './deadline.js'
|
|
8
|
-
import { cmodPluginName } from './dependencies.js'
|
|
8
|
+
import { cmodPluginName, isUnanswered } from './dependencies.js'
|
|
9
9
|
|
|
10
10
|
export type ShownToast = { readonly type: ToastType; readonly message: string; readonly description?: string }
|
|
11
11
|
|
|
@@ -65,8 +65,13 @@ const hiddenKey = 'cmod:hidden-failures'
|
|
|
65
65
|
|
|
66
66
|
const failedCallMs = 30_000
|
|
67
67
|
|
|
68
|
+
const logAgainMs = [10_000, 60_000, 300_000]
|
|
69
|
+
|
|
68
70
|
const defaultDuration = 4000
|
|
69
71
|
const visibleToasts = 3
|
|
72
|
+
const columnGap = 2
|
|
73
|
+
|
|
74
|
+
const nameColumn = 16
|
|
70
75
|
const spinner = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] as const
|
|
71
76
|
const spinnerMs = 100
|
|
72
77
|
const spinFrames = 10_000 / spinnerMs
|
|
@@ -236,19 +241,25 @@ export function createToaster(claude: Claude, name: string, version: () => strin
|
|
|
236
241
|
})
|
|
237
242
|
}
|
|
238
243
|
|
|
239
|
-
const showsToast = async (failure: LoggedFailure, isShown: boolean): Promise<boolean | undefined> => {
|
|
244
|
+
const showsToast = async (failure: LoggedFailure, isShown: boolean): Promise<boolean | 'unanswered' | undefined> => {
|
|
245
|
+
const call = { isSettled: false }
|
|
240
246
|
try {
|
|
241
|
-
const logged = logFailure(failure)
|
|
247
|
+
const logged = logFailure(failure).finally(() => void (call.isSettled = true))
|
|
242
248
|
const answer = await (isShown ? logged : beforeDeadline(claude, { ms: failedCallMs }, failedMethod, logged))
|
|
243
249
|
if (isObject(answer) && typeof answer['showsToast'] === 'boolean') return answer['showsToast']
|
|
244
250
|
throw new Error(`cmod answered ${answer === undefined ? 'nothing' : JSON.stringify(answer)}, not { showsToast: true or false }`)
|
|
245
251
|
} catch (error) {
|
|
252
|
+
if (!call.isSettled || isUnanswered(error)) return 'unanswered'
|
|
246
253
|
claude.ui.log(`${name}: cmod kept no Log of ${failure.id}, so it shows the toast: ${messageOf(error)}`, { to: 'debug' })
|
|
247
254
|
return undefined
|
|
248
255
|
}
|
|
249
256
|
}
|
|
250
257
|
|
|
251
258
|
const fail = ({ id, message, error, description = error === undefined || describe(error) === message ? undefined : describe(error), retry, isCritical = false, root = claude.plugin.root }: Failure): ToastId => {
|
|
259
|
+
if (!isCritical && isUnanswered(error)) {
|
|
260
|
+
warn(id, `${name}: ${message}: ${describe(error)}`)
|
|
261
|
+
return id
|
|
262
|
+
}
|
|
252
263
|
const hides = `${version() ?? ''}\n${message}\n${error === undefined ? '' : describe(error)}`
|
|
253
264
|
const at = new Date()
|
|
254
265
|
const repeat = `${hides}\n${description ?? ''}\n${at.toISOString().slice(0, 16)}`
|
|
@@ -256,11 +267,14 @@ export function createToaster(claude: Claude, name: string, version: () => strin
|
|
|
256
267
|
sent.set(id, repeat)
|
|
257
268
|
const stack = error instanceof Error && error.stack !== undefined ? `\n\n${error.stack}` : ''
|
|
258
269
|
const details = async (failedAt: Date) => detailsOf(await modVersion(), failedAt, `${message}${description === undefined ? '' : `\n${description}`}${stack}`)
|
|
259
|
-
const logged = async () => {
|
|
270
|
+
const logged = async (tries = 0): Promise<void> => {
|
|
260
271
|
const contact = await contactOf(claude)
|
|
261
272
|
const version = await modVersion()
|
|
262
273
|
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 }
|
|
263
274
|
const shows = await showsToast(failure, isCritical)
|
|
275
|
+
const wait = logAgainMs[tries]
|
|
276
|
+
if (shows === 'unanswered' && wait !== undefined) return void claude.clock.after(wait, () => void logged(tries + 1))
|
|
277
|
+
if (shows === 'unanswered') claude.ui.log(`${name}: cmod did not answer ${logAgainMs.length + 1} times, so ${id} reached no Log and shows its toast`, { to: 'debug' })
|
|
264
278
|
if (isCritical) return
|
|
265
279
|
if (shows !== false) return show()
|
|
266
280
|
claude.ui.log(`${name}: ${message}${description === undefined ? '' : `: ${description}`}`, { to: 'debug' })
|
|
@@ -283,7 +297,7 @@ export function createToaster(claude: Claude, name: string, version: () => strin
|
|
|
283
297
|
changed()
|
|
284
298
|
return
|
|
285
299
|
}
|
|
286
|
-
const actions = [
|
|
300
|
+
const actions = [{ label: 'Report', onClick: startReporting }, ...(retry === undefined ? [] : [{ label: 'Retry', onClick: tryAgain }]), ...fixes]
|
|
287
301
|
put('error', message, { id, ...(description === undefined ? {} : { description }), duration: Infinity }, actions, hides)
|
|
288
302
|
}
|
|
289
303
|
const startReporting = async () => {
|
|
@@ -332,27 +346,28 @@ export function createToaster(claude: Claude, name: string, version: () => strin
|
|
|
332
346
|
const message = isText ? Button({ plain: true, key: `toast:${entry.id}:open`, label: entry.message, onPress: toggle(entry) }) : Text({ children: entry.message })
|
|
333
347
|
const details = !isText ? description : Text({ dimColor: true, wrap: entry.isOpen ? 'wrap' : 'truncate-end', children: entry.isOpen ? description : firstLine(description) })
|
|
334
348
|
const fixed = (child: RenderElement) => Box({ flexShrink: 0, children: child })
|
|
335
|
-
const close = Button({ plain: true, dimColor: true, key: `toast:${entry.id}:close`, label:
|
|
349
|
+
const close = Button({ plain: true, dimColor: true, key: `toast:${entry.id}:close`, label: '✕', onPress: () => hide(entry) })
|
|
336
350
|
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) }))
|
|
337
|
-
const
|
|
351
|
+
const time = Text({ dimColor: true, children: entry.count > 1 ? `${clockTime(entry.at)} · ${entry.count} times` : clockTime(entry.at) })
|
|
352
|
+
const buttons = actions.length === 0 ? [] : [Box({ gap: columnGap, flexWrap: 'wrap', children: [...actions, time].map(fixed) })]
|
|
338
353
|
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] })
|
|
339
|
-
const text = details === undefined ? [
|
|
340
|
-
const under = trying !== undefined && details === undefined ? [trying] : entry.reporting === undefined ?
|
|
354
|
+
const text = details === undefined ? [] : [trying ?? details]
|
|
355
|
+
const under = trying !== undefined && details === undefined ? [trying] : entry.reporting === undefined ? buttons : reportChoices(entry, entry.reporting)
|
|
341
356
|
return Box({
|
|
342
357
|
width: columns,
|
|
343
|
-
gap:
|
|
358
|
+
gap: columnGap,
|
|
344
359
|
justifyContent: 'space-between',
|
|
345
360
|
children: [
|
|
346
361
|
Box({
|
|
347
|
-
gap:
|
|
362
|
+
gap: columnGap,
|
|
348
363
|
flexShrink: 1,
|
|
349
364
|
children: [
|
|
350
365
|
fixed(Text({ ...(icon.color === undefined ? {} : { color: icon.color }), children: icon.glyph })),
|
|
351
|
-
fixed(Text({ dimColor: true, children: name })),
|
|
352
|
-
Box({ flexDirection: 'column', flexShrink: 1, children:
|
|
366
|
+
fixed(Text({ dimColor: true, children: name.padEnd(nameColumn) })),
|
|
367
|
+
Box({ flexDirection: 'column', flexShrink: 1, children: [message, ...text, ...under] }),
|
|
353
368
|
],
|
|
354
369
|
}),
|
|
355
|
-
|
|
370
|
+
fixed(close),
|
|
356
371
|
],
|
|
357
372
|
})
|
|
358
373
|
}
|
|
@@ -66,6 +66,19 @@ export function checkKeys(tree: RenderNode, plugin: string, component: string):
|
|
|
66
66
|
if (seen.has(drawn)) throw new Error(`${plugin}: returned a tree ${component} refuses: ${type} "${key}" is drawn twice; each takes its own key`)
|
|
67
67
|
seen.add(drawn)
|
|
68
68
|
}
|
|
69
|
+
for (const { type, props } of hoversOutsideKeys(tree, false)) {
|
|
70
|
+
const key = typeof props['key'] === 'string' ? ` "${props['key']}"` : ''
|
|
71
|
+
throw new Error(`${plugin}: returned a tree ${component} refuses: ${type}${key} hover has no Box with a key around it; the nearest keyed Box is what the pointer hovers, or a scope names its group`)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function* hoversOutsideKeys(node: RenderNode, isInKeyedBox: boolean): Generator<Drawn> {
|
|
76
|
+
if (typeof node === 'string') return
|
|
77
|
+
const drawn = insideOf(node)
|
|
78
|
+
const isKeyed = isInKeyedBox || (drawn.type === 'Box' && typeof drawn.props['key'] === 'string')
|
|
79
|
+
const hover = drawn.props['hover']
|
|
80
|
+
if (typeof hover === 'object' && hover !== null && !('scope' in hover) && !isKeyed) yield drawn
|
|
81
|
+
for (const child of drawn.children ?? []) yield* hoversOutsideKeys(child, isKeyed)
|
|
69
82
|
}
|
|
70
83
|
|
|
71
84
|
function* drawnIn(node: RenderNode): Generator<Drawn> {
|
|
@@ -96,9 +96,11 @@ function fieldOf(use: CallBase, name: string): unknown {
|
|
|
96
96
|
return use.input[name]
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
export class InvalidCall extends Error {}
|
|
100
|
+
|
|
99
101
|
function textField(use: CallBase, name: string): string {
|
|
100
102
|
const value = fieldOf(use, name)
|
|
101
|
-
if (typeof value !== 'string') throw new
|
|
103
|
+
if (typeof value !== 'string') throw new InvalidCall(`The ${use.tool} call has no text field ${name}.`)
|
|
102
104
|
return value
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-elements.d.ts","sourceRoot":"","sources":["../src/testing/fake-elements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAiB,UAAU,EAAE,MAAM,aAAa,CAAA;AAE1E,KAAK,KAAK,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,CAAA;AAyB1H,eAAO,MAAM,QAAQ,EAAE,YAatB,CAAA;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAA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G,IAAI,CAanF;AAkBD,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAOhE;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAiB/C"}
|
package/testing/fake-elements.js
CHANGED
|
@@ -63,6 +63,21 @@ export function checkKeys(tree, plugin, component) {
|
|
|
63
63
|
throw new Error(`${plugin}: returned a tree ${component} refuses: ${type} "${key}" is drawn twice; each takes its own key`);
|
|
64
64
|
seen.add(drawn);
|
|
65
65
|
}
|
|
66
|
+
for (const { type, props } of hoversOutsideKeys(tree, false)) {
|
|
67
|
+
const key = typeof props['key'] === 'string' ? ` "${props['key']}"` : '';
|
|
68
|
+
throw new Error(`${plugin}: returned a tree ${component} refuses: ${type}${key} hover has no Box with a key around it; the nearest keyed Box is what the pointer hovers, or a scope names its group`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function* hoversOutsideKeys(node, isInKeyedBox) {
|
|
72
|
+
if (typeof node === 'string')
|
|
73
|
+
return;
|
|
74
|
+
const drawn = insideOf(node);
|
|
75
|
+
const isKeyed = isInKeyedBox || (drawn.type === 'Box' && typeof drawn.props['key'] === 'string');
|
|
76
|
+
const hover = drawn.props['hover'];
|
|
77
|
+
if (typeof hover === 'object' && hover !== null && !('scope' in hover) && !isKeyed)
|
|
78
|
+
yield drawn;
|
|
79
|
+
for (const child of drawn.children ?? [])
|
|
80
|
+
yield* hoversOutsideKeys(child, isKeyed);
|
|
66
81
|
}
|
|
67
82
|
function* drawnIn(node) {
|
|
68
83
|
if (typeof node === 'string')
|
package/utils/call-effects.d.ts
CHANGED
|
@@ -46,4 +46,6 @@ export declare function callEffects(use: CallBase, workspace: {
|
|
|
46
46
|
}): CallEffects;
|
|
47
47
|
export declare function inputOf(value: unknown): Readonly<Record<string, unknown>>;
|
|
48
48
|
export declare function callBaseOf({ tool, input, agentId, agentType }: CallBase): CallBase;
|
|
49
|
+
export declare class InvalidCall extends Error {
|
|
50
|
+
}
|
|
49
51
|
//# sourceMappingURL=call-effects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-effects.d.ts","sourceRoot":"","sources":["../src/utils/call-effects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAA;AAGnE,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AACvH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG;IAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAA;AAClG,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAC9F,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAClD,MAAM,MAAM,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEhE,MAAM,MAAM,QAAQ,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AACrE,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,CAAC,MAAM,OAAO,CAAC,QAAQ,C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AC,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,UAAU,CAAA;CAAE,GAAG,WAAW,CAsCrI;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAEzE;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,QAAQ,GAAG,QAAQ,CAElF;AAgCD,qBAAa,WAAY,SAAQ,KAAK;CAAG"}
|
package/utils/call-effects.js
CHANGED
|
@@ -82,10 +82,12 @@ function once(load) {
|
|
|
82
82
|
function fieldOf(use, name) {
|
|
83
83
|
return use.input[name];
|
|
84
84
|
}
|
|
85
|
+
export class InvalidCall extends Error {
|
|
86
|
+
}
|
|
85
87
|
function textField(use, name) {
|
|
86
88
|
const value = fieldOf(use, name);
|
|
87
89
|
if (typeof value !== 'string')
|
|
88
|
-
throw new
|
|
90
|
+
throw new InvalidCall(`The ${use.tool} call has no text field ${name}.`);
|
|
89
91
|
return value;
|
|
90
92
|
}
|
|
91
93
|
function optionalTextField(use, name) {
|