@cmodjs/core 5.5.4 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/docs/commands.md +7 -5
  2. package/docs/dependencies.md +2 -2
  3. package/docs/mod.md +1 -1
  4. package/docs/testing.md +7 -0
  5. package/docs/ui.md +7 -3
  6. package/package.json +2 -2
  7. package/records.d.ts +3 -1
  8. package/records.d.ts.map +1 -1
  9. package/records.js +7 -1
  10. package/runtime/before.d.ts +3 -0
  11. package/runtime/before.d.ts.map +1 -1
  12. package/runtime/before.js +66 -31
  13. package/runtime/conversations.d.ts.map +1 -1
  14. package/runtime/conversations.js +29 -9
  15. package/runtime/lifecycle.d.ts.map +1 -1
  16. package/runtime/lifecycle.js +23 -22
  17. package/runtime/programs.d.ts +1 -0
  18. package/runtime/programs.d.ts.map +1 -1
  19. package/runtime/programs.js +8 -1
  20. package/runtime/router.d.ts +4 -2
  21. package/runtime/router.d.ts.map +1 -1
  22. package/runtime/router.js +10 -8
  23. package/runtime/toaster.d.ts.map +1 -1
  24. package/runtime/toaster.js +15 -7
  25. package/runtime/ui.d.ts +3 -0
  26. package/runtime/ui.d.ts.map +1 -1
  27. package/runtime/ui.js +12 -1
  28. package/src/records.ts +9 -1
  29. package/src/runtime/before.ts +71 -34
  30. package/src/runtime/conversations.ts +26 -8
  31. package/src/runtime/lifecycle.ts +31 -35
  32. package/src/runtime/programs.ts +12 -1
  33. package/src/runtime/router.ts +11 -9
  34. package/src/runtime/toaster.ts +15 -7
  35. package/src/runtime/ui.ts +11 -1
  36. package/src/testing/fake-elements.ts +22 -3
  37. package/src/testing.ts +67 -8
  38. package/src/ui/elements.ts +11 -0
  39. package/src/ui/panes.ts +2 -0
  40. package/testing/fake-elements.d.ts +1 -0
  41. package/testing/fake-elements.d.ts.map +1 -1
  42. package/testing/fake-elements.js +22 -3
  43. package/testing.d.ts +1 -0
  44. package/testing.d.ts.map +1 -1
  45. package/testing.js +76 -8
  46. package/ui/elements.d.ts +1 -0
  47. package/ui/elements.d.ts.map +1 -1
  48. package/ui/elements.js +12 -0
  49. package/ui/panes.d.ts +2 -0
  50. package/ui/panes.d.ts.map +1 -1
  51. package/vendor-markdown.js +4 -8698
  52. package/vendor.js +7 -3384
package/docs/commands.md CHANGED
@@ -34,7 +34,7 @@ It loads the checkout through a marketplace cmod keeps in the checkout's parent
34
34
  3. It adds the marketplace to Claude Code with `claude plugin marketplace add <parent> --scope local`, which declares it in `<parent>/.claude/settings.local.json`, so the `settings.json` you share between computers holds no path of this one, the way `npm link` keeps a link out of the shared `package.json`. Then it installs `<mod>@<parent folder>-linked` from it, which loads the checkout's own files in every session, in any project, at the next reload.
35
35
  4. It turns off the installed copy of the mod from any other marketplace, and records it in `links.json` in the cmod store, so `cmod unlink` turns that copy back on.
36
36
 
37
- It refuses a parent folder whose `.claude-plugin/marketplace.json` cmod did not write. `cmod watch` reloads every session once a change builds.
37
+ It refuses a parent folder whose `.claude-plugin/marketplace.json` cmod did not write. Once a change builds, `cmod watch` reloads each session working inside the checkout, and every other session offers Reload.
38
38
 
39
39
  - `--option key=value` sets one of the mod's options through `claude plugin configure`, once per option, under the linked id, such as `my-mod@Developer-linked`. It refuses a key the mod does not declare, and names the keys it does ([options.md](options.md)).
40
40
 
@@ -61,7 +61,7 @@ Runs every check this machine can run on the mod at `path` (default: the current
61
61
  5. Checks the permission check. It adds `"approve": true` to `package.json` `"cmod"` when the mod allows or asks on Claude Code's permission check and `hooks/register.ts` calls `registerPermissionCheck`. It fails a mod whose `src/` hears the permission check while `register.ts` does not call `registerPermissionCheck`, and a mod on `@cmodjs/core` 5.0.0 or later whose `package.json` `"cmod"` still declares `"permissions"`, with the fix `Delete "permissions" from package.json "cmod", and write "approve": true there if the mod approves tool calls.`
62
62
  6. Reads the metadata of every file in the mod, and names each file whose metadata cmod cannot read.
63
63
  7. Writes the options `defineMod` declares into `.claude-plugin/plugin.json` `userConfig`, and its hotkeys into `package.json` `"cmod"` `hotkeys`, keeping each file's own formatting, so Claude Code shows the options in `/config` ([options.md](options.md)). It loads `hooks/register.ts` to read them, without starting the mod.
64
- 8. Writes the `cmod` dependency in `.claude-plugin/plugin.json` as `>=` the oldest cmod the `@cmodjs/core` the mod installed runs on, `oldestCmodVersion` in its `records.js`, such as `>=5.2.0`, so every newer cmod runs the mod. A `@cmodjs/core` that does not export `oldestCmodVersion` runs on the cmod of its own version, so the range is `>=` that version, such as `>=4.3.4`. A mod still on `@cmodjs/core` 3 keeps its own range ([dependencies.md](dependencies.md#call-the-methods-mod-dependencies)). Claude Code turns a mod off when its cmod is older than that dependency, so `cmod check` first compares it with every cmod plugin Claude Code installed on this machine. When an installed copy is older, it updates them as `cmod update cmod` does. When one is still older, as when your `@cmodjs/core` needs a cmod newer than every published one, the check fails, keeps the old dependency, and names the `@cmodjs/core` to install instead. When a cmod linked from a checkout is older, the check fails the same way and says to pull that checkout, because no update reaches it. On a machine without Claude Code or without a cmod plugin, such as CI, it writes the dependency at once.
64
+ 8. Writes the `cmod` dependency in `.claude-plugin/plugin.json` as `>=` the oldest cmod the `@cmodjs/core` the mod installed runs on, `oldestCmodVersion` in its `records.js`, such as `>=5.2.0`, so every newer cmod runs the mod. When the mod needs a newer cmod than that, such as one whose cmod plugin carries out a call the mod makes, write that minimum yourself as `>=` its version, such as `>=5.6.0`, and `cmod check` keeps it. It raises only a minimum below that oldest cmod, and writes any other range as `>=` that oldest cmod. A `@cmodjs/core` that does not export `oldestCmodVersion` runs on the cmod of its own version, so the range is `>=` that version, such as `>=4.3.4`. A mod still on `@cmodjs/core` 3 keeps its own range ([dependencies.md](dependencies.md#call-the-methods-mod-dependencies)). Claude Code turns a mod off when its cmod is older than that dependency, so `cmod check` first compares it with every cmod plugin Claude Code installed on this machine. When an installed copy is older, it updates them as `cmod update cmod` does. When one is still older, as when your `@cmodjs/core` needs a cmod newer than every published one, the check fails, keeps the old dependency, and names the `@cmodjs/core` to install instead. When a cmod linked from a checkout is older, the check fails the same way and says to pull that checkout, because no update reaches it. On a machine without Claude Code or without a cmod plugin, such as CI, it writes the dependency at once.
65
65
  9. Checks its imports.
66
66
  10. Looks for prebuilt binaries outside `cli/`.
67
67
  11. Builds the release in a temporary folder as `cmod publish` builds it, with its `"files"` list and its bundled hooks module, and validates the release with Claude Code, `claude plugin validate --strict`. So it fails on a path `plugin.json` names that `"files"` leaves out, a `"files"` path that matches no file in the mod, and each reason a bundle fails, and prints every line the validator writes. Then it deletes the folder.
@@ -71,6 +71,8 @@ Runs every check this machine can run on the mod at `path` (default: the current
71
71
  15. Runs, with `claude plugin test`, the test files that import `claude-code/testing`. It skips this when none does.
72
72
  16. Checks its name against other plugins. Only a project plugin, in `.claude/skills/<name>/` of a repository, runs this check: it fails when an installed or linked plugin has the same name and hides the project plugin. Any other mod passes it at once.
73
73
 
74
+ The checks that read the mod's files, the metadata, imports, binaries, permission check, and test files, skip every file git ignores, such as scratch work in an ignored folder, because no release holds it.
75
+
74
76
  `cmod check` fetches `tsc` 7.0.2 and `oxlint` 1.86.0 into the cmod store the first time. A check it cannot run, such as one that needs Claude Code on a machine without it, fails with the reason, and the later checks still run. It ends with a count of passed, failed, and skipped checks, and exits 1 when one failed.
75
77
 
76
78
  ### cmod try
@@ -141,7 +143,7 @@ It needs, and refuses to start without:
141
143
 
142
144
  ## Install mods
143
145
 
144
- `cmod install`, `cmod update`, `cmod remove`, `cmod enable`, `cmod disable`, `cmod link`, `cmod unlink`, and `cmod try` write the time to `plugins-changed` in the cmod store, then write `store-changed` beside it, when they finish, also when they fail partway, such as an update that updated some mods. The cmod plugin of every running session watches `store-changed` and Claude Code's `installed_plugins.json`, reads the `enabledPlugins` of the user's `settings.json` each time Claude Code reports that file changed and at each prompt, and runs `/reload-plugins` in its session once `plugins-changed`, `installed_plugins.json`, or `enabledPlugins` changed and then stayed the same for 2 seconds, whether a `cmod` command, `/plugin`, `claude plugin`, or Claude Code's automatic update changed them, so an update of several plugins reloads once. A session in the middle of a turn reloads when the turn ends, a session no app shows, such as `claude -p`, never reloads, and the prompt the person is typing stays. After the reload, each plugin whose version changed shows a corner toast, `<plugin> updated to <version>`, and more than 3 show one toast, `<n> plugins updated`. A reload keeps the prompt cache: the next request reads the whole conversation from the cache and pays only for the plugins' new content. A reload clears each mod's `memory` state. A machine where cmod set up no mod has no store, and these commands write nothing there.
146
+ `cmod install`, `cmod update`, `cmod remove`, `cmod enable`, `cmod disable`, `cmod link`, `cmod unlink`, and `cmod try` write the time to `plugins-changed` in the cmod store, then write `store-changed` beside it, when they finish, also when they fail partway, such as an update that updated some mods. The cmod plugin of every running session watches `store-changed` and Claude Code's `installed_plugins.json`, and reads the `enabledPlugins` of the user's `settings.json` each time Claude Code reports that file changed and at each prompt, whether a `cmod` command, `/plugin`, `claude plugin`, or Claude Code's automatic update changed them. While `plugins-changed`, `installed_plugins.json`, or `enabledPlugins` differs from what the session loaded, the session keeps running the plugins it loaded and shows one `Plugins changed` toast with a Reload button. It names each change, such as `notes updated to 1.3.0` or `inbox turned on`, or counts them past 3, and each further change updates the same toast. The person presses Reload, which runs `/reload-plugins`, or when the turn ends if Claude is working, and the prompt the person is typing stays. A change back to what the session loaded, or the person's own `/reload-plugins`, takes the toast away. A session no app shows, such as `claude -p`, shows nothing. A reload keeps the prompt cache: the next request reads the whole conversation from the cache and pays only for the plugins' new content. A reload clears each mod's `memory` state. A machine where cmod set up no mod has no store, and these commands write nothing there.
145
147
 
146
148
  ### cmod install
147
149
 
@@ -224,7 +226,7 @@ Reads every conversation Claude Code saved, as the sessions, contexts, turns, ta
224
226
  - `goal` prints what the conversation is for: the goal a mod set, or its first prompt.
225
227
  - `usage` prints the model and the context's tokens as of the last reply.
226
228
  - `--task` reads `turns`, `contexts`, `goal`, and `usage` of the session a task's owner runs, the way they read the conversation's.
227
- - `state` prints what a running conversation resumes from.
229
+ - `state` prints what a running conversation resumes from. It reads the index without writing to it, so it never waits for another cmod that is writing the index.
228
230
  - `follow` prints each message, turn, context, task, and goal change of the sessions named as Claude Code saves it, until stopped with Ctrl+C. `--running` follows every running session of the project too, and each one that starts later. The cmod plugin runs it to hear other running sessions.
229
231
  - `--json` prints JSON instead of one line each.
230
232
  - `index` reads every saved conversation into the index at `~/.local/share/cmod/history-12.sqlite`, which holds where each message is in its transcript, not a copy of it, and each conversation's turns, with the device each ran on, contexts, and tasks. While cmod has set up a mod other than cmod, the cmod plugin runs it in the background at each session's start, and a second run while one is running exits at once. The index forgets a conversation whose transcript is deleted.
@@ -237,7 +239,7 @@ Reads every conversation Claude Code saved, as the sessions, contexts, turns, ta
237
239
  cmod watch
238
240
  ```
239
241
 
240
- Tells every running session once a checkout `cmod link` linked builds after a change. 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. Once a folder has had no change for 2 seconds, it bundles the mod's hooks module as `cmod publish` does. A bundle that builds marks `plugins-changed`, so every session reloads its plugins, and shows no toast, because the version stays the same. A bundle that still fails 10 seconds after the last change shows `<mod> does not build` with the error as one toast in every session, 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.
242
+ 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. Once a folder has had no change for 2 seconds, it bundles the mod's hooks module as `cmod publish` does. A bundle 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 that still fails 10 seconds after the last change shows `<mod> does not build` with the error as one toast in every session, 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.
241
243
 
242
244
  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.
243
245
 
@@ -65,9 +65,9 @@ A provider that changes or removes a method breaks every mod that calls it, and
65
65
 
66
66
  Claude Code checks the range against the provider's `version` when it loads your mod. Every mod's marketplace lists cmod and each provider from its git repository, so Claude Code also installs it at the highest `<name>--v<version>` tag inside the range, which `cmod publish` pushes for every release ([Claude Code's plugin dependencies](https://code.claude.com/docs/en/plugins/dependencies)).
67
67
 
68
- cmod is a provider too, with one difference: every newer cmod runs every mod built on an older `@cmodjs/core`. So a mod names only the oldest cmod it runs on, which the `@cmodjs/core` it bundles names as `oldestCmodVersion` in its `records.js`, as `>=5.2.0`. `cmod check` writes that range whenever the mod's `@cmodjs/core` changes, and `cmod publish` refuses a release whose range differs. A caret range such as `^5.0.0` stops Claude Code from updating cmod past 5.x for every mod on the computer, so leave it to `cmod check`.
68
+ cmod is a provider too, with one difference: every newer cmod runs every mod built on an older `@cmodjs/core`. So a mod names only the oldest cmod it runs on, which the `@cmodjs/core` it bundles names as `oldestCmodVersion` in its `records.js`, as `>=5.2.0`. When the mod needs a newer cmod, such as one whose cmod plugin carries out a call the mod makes, write that minimum as `>=` its version, as `>=5.6.0`. `cmod check` writes the newer of the two whenever the mod's `@cmodjs/core` changes, and `cmod publish` refuses a release whose range is not `>=` a version at or above `oldestCmodVersion`. A caret range such as `^5.0.0` stops Claude Code from updating cmod past 5.x for every mod on the computer, so leave it to `cmod check`.
69
69
 
70
- Each mod's marketplace lists its own copy of cmod and of each provider, and Claude Code loads only one copy of each. When a mod needs a newer cmod than a copy Claude Code installed, the cmod plugin updates every copy of cmod, and when two copies of any plugin differ, it updates every copy of that plugin. Then it reloads the mods, so a mod never waits for the person to update its providers.
70
+ Each mod's marketplace lists its own copy of cmod and of each provider, and Claude Code loads only one copy of each. When a mod needs a newer cmod than a copy Claude Code installed, the cmod plugin updates every copy of cmod, and when two copies of any plugin differ, it updates every copy of that plugin. Then each session offers Reload, so a mod never waits for the person to update its providers, only to press Reload.
71
71
 
72
72
  Claude Code then lays tracer's types file beside the mod's own types, so the call is typed:
73
73
 
package/docs/mod.md CHANGED
@@ -47,7 +47,7 @@ export const greeter = defineMod({
47
47
 
48
48
  Claude Code loads the mod at the start of each session. cmod then checks that the mod is set up, and runs its install step when it is not, with a loading toast above the prompt ([install-steps.md](install-steps.md)). An option with no default and no value is asked on the mod's install page, the `Install <name>` tab of the Sidebar. Then cmod loads the saved state, runs `setup`, marks as open each of the mod's panes that Claude Code already shows, and opens the install page again for each `installer` step the mod declares that is not done.
49
49
 
50
- The first time a mod starts on a machine, cmod shows the toast `Installed` under its name. Opened, it lists the mod's `plugin.json` `description`, what setup added, such as `Adds the my-mod pane, the Branch widget and /deploy.`, and what its install step set up, with a Settings button that opens Settings at the mod. A new version shows no toast of the mod's own: after the reload that loads it, the cmod plugin shows `<mod> updated to <version>` in the corner ([commands.md](commands.md#install-mods)). A new session and `/reload-plugins` show no toast.
50
+ The first time a mod starts on a machine, cmod shows the toast `Installed` under its name. Opened, it lists the mod's `plugin.json` `description`, what setup added, such as `Adds the my-mod pane, the Branch widget and /deploy.`, and what its install step set up, with a Settings button that opens Settings at the mod. A new version shows no toast of the mod's own: each running session keeps the version it loaded, and the cmod plugin's `Plugins changed` toast names `<mod> updated to <version>` with a Reload button ([commands.md](commands.md#install-mods)). A new session and `/reload-plugins` show no toast.
51
51
 
52
52
  When a step fails, the mod stays stopped. Once another session sets it up, the mod starts at the next prompt of every session it stopped in, with no `/reload-plugins`.
53
53
 
package/docs/testing.md CHANGED
@@ -271,6 +271,13 @@ await tested.shown.page.select('agent', 'explorer')
271
271
  expect(await tested.shown.page.lines()).toContain('deploy by explorer')
272
272
  ```
273
273
 
274
+ `shown.page.focusedKey()` and `shown.pane.focusedKey()` return the `key` of the `Button`, `Input`, or `Select` that holds the keyboard in what shows, or `undefined` while it does not hold the keyboard or no element does. The page or pane takes the keyboard when it opens with `{ focus: true }`, and its first `autoFocus` element takes it then. `focus(key)` moves it to another element until the page or pane closes or opens again.
275
+
276
+ ```ts
277
+ await tested.shown.page.press('Answer')
278
+ expect(await tested.shown.page.focusedKey()).toBe('answer')
279
+ ```
280
+
274
281
  ### moveTo
275
282
 
276
283
  `moveTo(projectRoot, cwd?)` moves the session. A new `projectRoot` runs a `/cd` there, so the mod loads that project's state. A `cwd` then runs a Bash `cd` there. The mod's `onCwdChange` listeners run for each move, and `sessions.current` follows it.
package/docs/ui.md CHANGED
@@ -127,6 +127,7 @@ type Page<Params = undefined> = {
127
127
  toggle(options?: { readonly focus?: true }): Promise<void>
128
128
  close(): Promise<void>
129
129
  scrollTo(target: 'start' | 'end' | { readonly key: string }, options?: { readonly block?: 'start' | 'center' | 'end' | 'nearest' }): Promise<void>
130
+ focus(key: string): Promise<void>
130
131
  remove(): void
131
132
  }
132
133
  ```
@@ -137,6 +138,7 @@ type Page<Params = undefined> = {
137
138
  - `toggle` closes an open page and opens a closed one. `close` takes its tab away, and the Sidebar hides once no page is left.
138
139
  - `isOpen` is true while the page has a tab, `isShown` while its tab is the one on screen, and `isFocused` while it has the keyboard.
139
140
  - `scrollTo` brings an element the page drew with that `key` into view, or the page's start or end.
141
+ - `focus` moves the keyboard once to the `Button`, `Input`, or `Select` the page drew with that `key`, while the Sidebar holds the keyboard, such as from a `Button` the person pressed. Unlike `autoFocus`, which takes the keyboard each time the Sidebar shows, it moves it only when called. A key the page does not draw rejects with `<mod>: the <title> page draws no Button, Input, or Select with the key "<key>".` The cmod plugin moves the keyboard after the handler returns, so `focus` resolves once the cmod plugin has the request, and a move Claude Code refuses goes to the Log.
140
142
  - `props.columns` is the width the page draws in. The Sidebar draws the page in a panel titled with the mod's name, under its tab bar and above its key bar, so `columns` is the Sidebar's width less 6: its padding of one column on each side, and the panel's border and padding.
141
143
  - A page opened from what the person did, such as a slash command they typed, a hotkey, or a `Button` they pressed, shows at any terminal width. A page opened from anything else, such as `setup`, a timer, or a listener, shows only on a terminal 144 columns wide. Below that it waits until the person opens the Sidebar.
142
144
  - A page draws only the elements of `ui/elements.js` and `ui/components.js`, text, numbers, and plain objects, because the cmod plugin draws it. A `Button`'s `onPress` runs in the mod.
@@ -195,6 +197,7 @@ type PaneInit<State, Params = undefined> = {
195
197
  - `render` draws the pane's body. `props` holds `params`, `surface`, the app that draws it, `title`, `isFocused`, `bodyColumns`, `placement` (`'dock'` or `'inline'`), `scroll`, and `view`, which transcript is on screen beside the pane.
196
198
  - `onScroll` runs after this pane's window moved. `onClose` runs after the pane closed, by the person or by `close()`, and `e.origin.kind` is `'person'` or `'plugin'`. A handler that throws shows the error toast `The <title> pane's <handler> threw`.
197
199
  - `open` asks Claude Code to show the pane, and `isOpen` turns true once Claude Code places it. A pane opened from what the person did shows at any width, and one opened from anything else only at 144 columns, or 110 for a pane the person opened before.
200
+ - `focus` moves the keyboard once to the `Button`, `Input`, or `Select` the pane drew with that `key`, while the pane holds the keyboard. It resolves once the keyboard moved, and rejects with `<mod>: Claude Code did not focus "<key>" in the <title> pane: <reason>` when it did not.
198
201
  - Adding two panes with one id throws `<mod>: the pane "<id>" is already added. Give each pane its own id.`
199
202
  - A `render` that throws draws `The <title> pane could not draw: <error>` in the pane.
200
203
 
@@ -436,7 +439,8 @@ type ToastOptions = {
436
439
  - 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.
437
440
  - A toast with the `id` of a shown toast replaces it in place, so a loading toast turns into its success or error.
438
441
  - 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.
439
- - `action` draws a button after the message. Give every toast that asks the person to do something an `action` that does it.
442
+ - Every toast takes the band's whole width, and its `✕` sits at the right end of its last line, whatever its text. So a stack of toasts closes one after another with presses in one spot, because the band keeps its last line by the prompt and the next toast moves down into the closed one's place.
443
+ - `action` draws a button just before the `✕`. Give every toast that asks the person to do something an `action` that does it.
440
444
  - `✕` closes the toast. The band shows the newest 3, and `+N more` shows every toast.
441
445
  - `promise` shows `loading` while `task` runs, then `success` or `error` in the same row. `unwrap()` resolves or rejects as `task` does.
442
446
 
@@ -450,7 +454,7 @@ An error also shows as a toast when any of these holds:
450
454
 
451
455
  A cmod older than 4.3.0 keeps no Log, so there every error shows its toast.
452
456
 
453
- The error toast stays, with its buttons on a line under the message:
457
+ The error toast stays, with its buttons and the time on a line under the message, and `Hide` in the place of `✕`, at the right end of that line:
454
458
 
455
459
  - `Retry` runs the failed step again, where running it again can work: an install, the mod's setup, or a program that stopped.
456
460
  - `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.
@@ -496,4 +500,4 @@ sessions.current.caption(toolCall: ToolCall message, text: string | undefined):
496
500
 
497
501
  ## Test the UI
498
502
 
499
- `tested.shown.page` and `tested.shown.pane` read the page or pane the mod shows now, with `lines()`, `press(key)`, `input(key, text)`, and `select(key, value)`. `tested.lines(area)` draws the mod's widgets in an area, and `tested.lines(kind, props)` draws a style. `tested.hotkey(name)` presses a hotkey. `tested.shown.toasts` lists the toasts shown now, each as `{ type, message, description? }`. [testing.md](testing.md) covers each.
503
+ `tested.shown.page` and `tested.shown.pane` read the page or pane the mod shows now, with `lines()`, `press(key)`, `input(key, text)`, `select(key, value)`, and `focusedKey()`. `tested.lines(area)` draws the mod's widgets in an area, and `tested.lines(kind, props)` draws a style. `tested.hotkey(name)` presses a hotkey. `tested.shown.toasts` lists the toasts shown now, each as `{ type, message, description? }`. [testing.md](testing.md) covers each.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmodjs/core",
3
- "version": "5.5.4",
3
+ "version": "5.7.0",
4
4
  "description": "Build Claude Code mods: hooks, panes, checks, and an install that just works.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "docs/"
27
27
  ],
28
28
  "scripts": {
29
- "build": "tsc -p tsconfig.build.json && bun build src/vendor.ts --outfile vendor.js --format esm --target browser --define process=undefined && NODE_ENV=production bun build src/vendor-markdown.ts --outfile vendor-markdown.js --format esm --target browser --conditions worker",
29
+ "build": "tsc -p tsconfig.build.json && bun build src/vendor.ts --outfile vendor.js --format esm --target browser --define process=undefined --minify && NODE_ENV=production bun build src/vendor-markdown.ts --outfile vendor-markdown.js --format esm --target browser --conditions worker --minify",
30
30
  "check": "tsc -p tsconfig.json --noEmit && OXLINT_TSGOLINT_PATH=../lint/node_modules/.bin/tsgolint ../lint/node_modules/.bin/oxlint --type-aware --deny-warnings",
31
31
  "test": "bun test"
32
32
  },
package/records.d.ts CHANGED
@@ -77,6 +77,8 @@ export declare function marketplaceOf(root: string, name: string): string | unde
77
77
  export declare function updatesToTurnOn(marketplace: string | undefined, settings: unknown, known: unknown): string | undefined;
78
78
  export declare function consentPath(store: string): string;
79
79
  export declare function pluginsChangedPath(store: string): string;
80
+ export declare function pluginsChangedMark(at: number, pid: number, checkout?: string): string;
81
+ export declare function markedCheckout(mark: string): string | undefined;
80
82
  export declare function storeChangedPath(store: string): string;
81
83
  export declare function buildFailuresPath(store: string): string;
82
84
  export declare function linksPath(store: string): string;
@@ -131,7 +133,7 @@ export declare function newestLog(entries: readonly LogEntry[]): LogEntry[];
131
133
  export declare function versionsLine({ mod, core, cmod, program, claudeCode }: LogVersions): string;
132
134
  export declare function logReport(entry: LogEntry): string;
133
135
  export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
134
- export declare const coreVersion = "5.5.4";
136
+ export declare const coreVersion = "5.7.0";
135
137
  export declare const oldestCmodVersion = "5.4.0";
136
138
  export declare function hotkeyCommand(mod: string, hotkey: string): string;
137
139
  export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
package/records.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["src/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAG1E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACtC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAA;IACrC,eAAe,EAAE,SAAS,MAAM,E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angedPath(store) {
206
206
  return `${store}/plugins-changed`;
207
207
  }
208
+ export function pluginsChangedMark(at, pid, checkout) {
209
+ return `${at} ${pid}\n${checkout === undefined ? '' : `${checkout}\n`}`;
210
+ }
211
+ export function markedCheckout(mark) {
212
+ return mark.split('\n')[1] || undefined;
213
+ }
208
214
  export function storeChangedPath(store) {
209
215
  return `${store}/store-changed`;
210
216
  }
@@ -296,7 +302,7 @@ function readHotkeys(hotkeys) {
296
302
  throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
297
303
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
298
304
  }
299
- export const coreVersion = '5.5.4';
305
+ export const coreVersion = '5.7.0';
300
306
  export const oldestCmodVersion = '5.4.0';
301
307
  export function hotkeyCommand(mod, hotkey) {
302
308
  return `${mod}--${hotkey}`;
@@ -28,6 +28,9 @@ export type BeforeHooks = {
28
28
  readonly place: () => Promise<Place>;
29
29
  readonly wants: (event: BeforeEvent) => Promise<boolean>;
30
30
  readonly fold: (cancel: AbortSignal) => Decide;
31
+ readonly failedBefore: (event: BeforeEvent, change: (where: Place) => SessionChange | undefined, error: Error) => {
32
+ readonly refuse: string;
33
+ } | undefined;
31
34
  };
32
35
  export declare function relayOf(e: Frozen<Args<'session.receive'>>): string | undefined;
33
36
  export declare function installBefore({ claude, router, hooks }: {
@@ -1 +1 @@
1
- {"version":3,"file":"before.d.ts","sourceRoot":"","sources":["../src/runtime/before.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAc5D,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAgC,MAAM,4BAA4B,CAAA;AAEvK,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM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,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,CAE/M;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAM9F;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EAAE,OAAO,GAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAuB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAiBlV"}
package/runtime/before.js CHANGED
@@ -29,7 +29,7 @@ export function relayOf(e) {
29
29
  return isFromCmod ? relayTag.exec(e.text)?.[1] : undefined;
30
30
  }
31
31
  export function installBefore({ claude, router, hooks }) {
32
- const { place, wants, fold } = hooks;
32
+ const { place, wants, fold, failedBefore } = hooks;
33
33
  const now = () => new Date().toISOString();
34
34
  const asked = async (event, change, decide) => (await decide(event, change)) ?? {};
35
35
  const message = (where, unplaced, task, isInTurn = true) => {
@@ -38,6 +38,23 @@ export function installBefore({ claude, router, hooks }) {
38
38
  const call = unplaced.type === ToolResult ? where.openCalls?.[unplaced.callId] : undefined;
39
39
  return { type: Message, message: { ...unplaced, ...call, session: where.session, context, ...(turn === undefined ? {} : { turn: turn.prompt.id }), ...(task === undefined ? {} : { task }) } };
40
40
  };
41
+ const submitted = (e) => (where) => message(where, { id: '', at: now(), type: Prompt, text: e.text, from: senderOf(e.origin, false) }, undefined, false);
42
+ const received = (e) => (where) => message(where, { id: '', at: now(), type: Prompt, text: e.text, from: { type: 'session' } }, e.agentId, false);
43
+ const refusedOnFailure = (event, change, error, next) => (next.called ? undefined : failedBefore(event, change, error)?.refuse);
44
+ const toolCalled = (e, cwd) => (where) => message(where, { id: e.tool_use_id, at: now(), type: ToolCall, callId: e.tool_use_id, name: e.tool, input: toolInputOf(e), cwd, files: noFiles }, e.agentId);
45
+ const cwdOf = async (agentId) => (agentId === undefined ? undefined : agentFolders.get(agentId)) ?? (await claude.session.cwd());
46
+ const startedTask = (e, where) => ({ id: '', title: e.description, ...ownerOfSpawn(e.subagentType, where.session), model: e.model ?? e.parentModel, openedBy: e.tool_use_id, openedAt: now(), ...(e.parentAgentId === undefined ? {} : { parent: e.parentAgentId }), context: where.context });
47
+ const attachmentOf = (e) => {
48
+ if (e.type === 'nested_memory')
49
+ return { event: InstructionFile, found: { id: '', at: now(), type: InstructionFile, path: instructionPathOf(e.text), text: e.text, isRule: isRulePath(instructionPathOf(e.text)) } };
50
+ const attachmentType = attachmentTypeOf(e.type);
51
+ return attachmentType === undefined ? undefined : { event: AttachedFile, found: { id: '', at: now(), type: AttachedFile, path: attachedPathOf(e.text), attachmentType, text: e.text } };
52
+ };
53
+ const contextClosed = (e) => (where) => {
54
+ const task = e.agentId === undefined ? undefined : where.tasks[e.agentId];
55
+ return e.agentId !== undefined && task === undefined ? undefined : { type: ContextEnd, context: closingContext(where, task, now()) };
56
+ };
57
+ const turnEnded = (turn) => (turn === undefined ? undefined : { type: TurnEnd, turn: { ...turn, closedAt: now() } });
41
58
  const titles = new Map();
42
59
  const spawned = new Map();
43
60
  const startedBy = new Map();
@@ -49,12 +66,12 @@ export function installBefore({ claude, router, hooks }) {
49
66
  return waiting.length === 1 ? waiting[0]?.[0] : undefined;
50
67
  };
51
68
  const agentFolders = new Map();
52
- const askedAtStop = (turn, signal) => new Promise((resolve, reject) => {
69
+ const askedAtStop = (change, signal) => new Promise((resolve, reject) => {
53
70
  if (signal.aborted)
54
71
  return resolve({});
55
72
  const cancelled = () => resolve({});
56
73
  signal.addEventListener('abort', cancelled, { once: true });
57
- asked(TurnEnd, { type: TurnEnd, turn: { ...turn, closedAt: now() } }, fold(signal))
74
+ asked(TurnEnd, change, fold(signal))
58
75
  .then(resolve, reject)
59
76
  .finally(() => signal.removeEventListener('abort', cancelled));
60
77
  });
@@ -82,8 +99,7 @@ export function installBefore({ claude, router, hooks }) {
82
99
  router.add('prompt.submit', async (e, next) => {
83
100
  if (!(await wants(Prompt)))
84
101
  return next(e);
85
- const where = await place();
86
- const answer = await asked(Prompt, message(where, { id: '', at: now(), type: Prompt, text: e.text, from: senderOf(e.origin, false) }, undefined, false), fold(next.signal));
102
+ const answer = await asked(Prompt, submitted(e)(await place()), fold(next.signal));
87
103
  if (answer.refuse !== undefined)
88
104
  return { drop: answer.refuse };
89
105
  const text = answer.text ?? e.text;
@@ -98,6 +114,9 @@ export function installBefore({ claude, router, hooks }) {
98
114
  titles.set(ran.text, passed);
99
115
  }
100
116
  return ran;
117
+ }, (e, error, next) => {
118
+ const refusal = refusedOnFailure(Prompt, submitted(e), error, next);
119
+ return refusal === undefined ? undefined : { drop: refusal };
101
120
  }),
102
121
  router.add('classic.UserPromptSubmit', async (e, next) => {
103
122
  const named = titles.get(e.prompt);
@@ -110,11 +129,13 @@ export function installBefore({ claude, router, hooks }) {
110
129
  router.add('session.receive', async (e, next) => {
111
130
  if (!(await wants(Prompt)) || relayOf(e) !== undefined)
112
131
  return next(e);
113
- const where = await place();
114
- const answer = await asked(Prompt, message(where, { id: '', at: now(), type: Prompt, text: e.text, from: { type: 'session' } }, e.agentId, false), fold(next.signal));
132
+ const answer = await asked(Prompt, received(e)(await place()), fold(next.signal));
115
133
  if (answer.refuse !== undefined)
116
134
  return { consumed: answer.refuse };
117
135
  return next(answer.text === undefined ? e : { ...e, text: answer.text });
136
+ }, (e, error, next) => {
137
+ const refusal = relayOf(e) === undefined ? refusedOnFailure(Prompt, received(e), error, next) : undefined;
138
+ return refusal === undefined ? undefined : { consumed: refusal };
118
139
  }),
119
140
  router.add('skill.prompt', async (e, next) => {
120
141
  if (!(await wants(Skill)))
@@ -124,18 +145,17 @@ export function installBefore({ claude, router, hooks }) {
124
145
  return answer.text === undefined ? next(e) : { text: answer.text };
125
146
  }),
126
147
  router.add('prompt.attachment', async (e, next) => {
127
- const attachmentType = attachmentTypeOf(e.type);
128
- const event = e.type === 'nested_memory' ? InstructionFile : attachmentType === undefined ? undefined : AttachedFile;
129
- if (event === undefined || !(await wants(event)))
148
+ const attachment = attachmentOf(e);
149
+ if (attachment === undefined || !(await wants(attachment.event)))
130
150
  return next(e);
131
- const where = await place();
132
- const found = attachmentType === undefined
133
- ? { id: '', at: now(), type: InstructionFile, path: instructionPathOf(e.text), text: e.text, isRule: isRulePath(instructionPathOf(e.text)) }
134
- : { id: '', at: now(), type: AttachedFile, path: attachedPathOf(e.text), attachmentType, text: e.text };
135
- const answer = await asked(event, message(where, found, e.agentId), fold(next.signal));
151
+ const answer = await asked(attachment.event, message(await place(), attachment.found, e.agentId), fold(next.signal));
136
152
  if (answer.refuse !== undefined)
137
153
  return { text: null };
138
154
  return answer.text === undefined ? next(e) : { text: answer.text };
155
+ }, (e, error, next) => {
156
+ const attachment = attachmentOf(e);
157
+ const refusal = attachment === undefined ? undefined : refusedOnFailure(attachment.event, (where) => message(where, attachment.found, e.agentId), error, next);
158
+ return refusal === undefined ? undefined : { text: null };
139
159
  }),
140
160
  router.add('session.append', async (e, next) => {
141
161
  const wanted = new Set((await Promise.all(appended.map(async (event) => ((await wants(event)) ? [event] : [])))).flat());
@@ -161,17 +181,19 @@ export function installBefore({ claude, router, hooks }) {
161
181
  if (!(await wants(ToolCall)))
162
182
  return next(e);
163
183
  const where = await place();
164
- const input = toolInputOf(e);
165
- const cwd = (e.agentId === undefined ? undefined : agentFolders.get(e.agentId)) ?? (await claude.session.cwd());
166
- const answer = await asked(ToolCall, message(where, { id: e.tool_use_id, at: now(), type: ToolCall, callId: e.tool_use_id, name: e.tool, input, cwd, files: noFiles }, e.agentId), fold(next.signal));
184
+ const answer = await asked(ToolCall, toolCalled(e, await cwdOf(e.agentId))(where), fold(next.signal));
167
185
  if (answer.refuse !== undefined)
168
186
  return { deny: answer.refuse };
169
187
  if (answer.result !== undefined)
170
188
  return withContext({ result: answer.result }, answer.note);
171
189
  if (answer.input === undefined)
172
190
  return withContext(await next(e), answer.note);
191
+ const input = toolInputOf(e);
173
192
  const reserved = Object.fromEntries(Object.entries(e).filter(([key]) => !(key in input)));
174
193
  return withContext(await next({ ...reserved, ...answer.input }), answer.note);
194
+ }, async (e, error, next) => {
195
+ const refusal = refusedOnFailure(ToolCall, toolCalled(e, await cwdOf(e.agentId)), error, next);
196
+ return refusal === undefined ? undefined : { deny: refusal };
175
197
  }),
176
198
  router.add('agent.spawn', async (e, next) => {
177
199
  spawned.set(e.tool_use_id, { prompt: e.prompt, agentType: e.subagentType });
@@ -188,9 +210,8 @@ export function installBefore({ claude, router, hooks }) {
188
210
  };
189
211
  if (!(await wants(TaskStart)))
190
212
  return start(e);
191
- const where = await place();
192
- const task = { id: '', title: e.description, ...ownerOfSpawn(e.subagentType, where.session), model: e.model ?? e.parentModel, openedBy: e.tool_use_id, openedAt: now(), ...(e.parentAgentId === undefined ? {} : { parent: e.parentAgentId }) };
193
- const answer = await asked(TaskStart, { type: TaskStart, task: { ...task, context: where.context } }, fold(next.signal));
213
+ const task = startedTask(e, await place());
214
+ const answer = await asked(TaskStart, { type: TaskStart, task }, fold(next.signal));
194
215
  if (answer.refuse !== undefined) {
195
216
  spawned.delete(e.tool_use_id);
196
217
  return { deny: answer.refuse };
@@ -211,6 +232,12 @@ export function installBefore({ claude, router, hooks }) {
211
232
  };
212
233
  spawned.set(e.tool_use_id, { prompt: answered.prompt, agentType: answered.subagentType });
213
234
  return start(answered);
235
+ }, (e, error, next) => {
236
+ const refusal = refusedOnFailure(TaskStart, (where) => ({ type: TaskStart, task: startedTask(e, where) }), error, next);
237
+ if (refusal === undefined)
238
+ return undefined;
239
+ spawned.delete(e.tool_use_id);
240
+ return { deny: refusal };
214
241
  }),
215
242
  router.add('classic.SubagentStart', async (e, next) => {
216
243
  const where = await place();
@@ -236,32 +263,40 @@ export function installBefore({ claude, router, hooks }) {
236
263
  };
237
264
  if (next.signal.aborted || !(await wants(TurnEnd)))
238
265
  return stopped(await next(e));
239
- const turn = (await place()).taskTurns[e.agent_id];
240
- if (turn === undefined)
266
+ const change = turnEnded((await place()).taskTurns[e.agent_id]);
267
+ if (change === undefined)
241
268
  return stopped(await next(e));
242
- const answer = await askedAtStop(turn, next.signal);
269
+ const answer = await askedAtStop(change, next.signal);
243
270
  return stopped(answeredStop(await next(e), answer, next.signal));
271
+ }, async (e, error, next) => {
272
+ const refusal = refusedOnFailure(TurnEnd, (where) => turnEnded(where.taskTurns[e.agent_id]), error, next);
273
+ return refusal === undefined ? undefined : { ...(await next(e)), block: refusal };
244
274
  }),
245
275
  router.add('classic.Stop', async (e, next) => {
246
276
  if (next.signal.aborted || !(await wants(TurnEnd)))
247
277
  return next(e);
248
- const { turn } = await place();
249
- if (turn === undefined)
278
+ const change = turnEnded((await place()).turn);
279
+ if (change === undefined)
250
280
  return next(e);
251
- const answer = await askedAtStop(turn, next.signal);
281
+ const answer = await askedAtStop(change, next.signal);
252
282
  return answeredStop(await next(e), answer, next.signal);
283
+ }, async (e, error, next) => {
284
+ const refusal = refusedOnFailure(TurnEnd, (where) => turnEnded(where.turn), error, next);
285
+ return refusal === undefined ? undefined : { ...(await next(e)), block: refusal };
253
286
  }),
254
287
  router.add('session.compact', async (e, next) => {
255
288
  if (!(await wants(ContextEnd)) || e.trigger === 'precompute')
256
289
  return next(e);
257
- const where = await place();
258
- const task = e.agentId === undefined ? undefined : where.tasks[e.agentId];
259
- if (e.agentId !== undefined && task === undefined)
290
+ const change = contextClosed(e)(await place());
291
+ if (change === undefined)
260
292
  return next(e);
261
- const answer = await asked(ContextEnd, { type: ContextEnd, context: closingContext(where, task, now()) }, fold(next.signal));
293
+ const answer = await asked(ContextEnd, change, fold(next.signal));
262
294
  if (answer.refuse !== undefined)
263
295
  return { skip: answer.refuse };
264
296
  return answer.summary === undefined ? next(e) : { messages: [{ role: 'user', text: answer.summary, toolUses: [] }] };
297
+ }, (e, error, next) => {
298
+ const refusal = e.trigger === 'precompute' ? undefined : refusedOnFailure(ContextEnd, contextClosed(e), error, next);
299
+ return refusal === undefined ? undefined : { skip: refusal };
265
300
  }),
266
301
  ];
267
302
  return { remove: () => added.forEach((each) => each.remove()) };
@@ -1 +1 @@
1
- {"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../src/runtime/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAK5D,OAAO,EAA0L,KAAK,QAAQ,EAAmB,MAAM,4BAA4B,CAAA;AAUnQ,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,KAAK,EAAc,MAAM,EAAE,MAAM,aAAa,CAAA;AAErD,OAAO,EAAsI,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAuCrL,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAAA;IAClH,KAAK,IAAI,IAAI,CAAA;IACb,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;IACjD,KAAK,IAAI,YAAY,CAAA;IACrB,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAA;CACtD,CAAA;AAQD,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,MAAM,EACN,K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