✨ feat(sarathi): a PreToolUse handler holds direct claude.ai publishes to the action box
Slice: #669
The first of two pull requests (#669, "How"). veda's hooks run only the sarathi release the root package.json pins, so this one ships the handler and the check in sarathi 0.8.17. The pin bump and veda's .claude/sarathi.json and .claude/settings.json wiring follow the v0.8.17 tag, as a fix under a State of #669.
-
hooks/action-box.sh(sourcesrc/hooks/action-box.ts): a PreToolUse handler for^mcp__.+__(publish_version|publish_files|edit_version)$, matched by suffix, not by server id. UsingrequireActionBoxfromsrc/page/page.ts, it refuses (exit 2):- a
publish_versionwhosecontentlacks a whole action box; - a
publish_fileswhoseindex.html(read from itspath) lacks one, or cannot be read. A republish with noindex.htmlpasses. - an
edit_versionon the page (nopath, orindex.html) whose edits take out adata-action-box,data-action-linkordata-if-silent.
Any fault refuses too.
- a
-
sarathi checktakes several settings entries that run sarathi for one event. A handler's regular expression is covered only by an entry with the identical matcher, or one with none. A plain name two entries both cover is a problem, since sarathi would run twice. Every entry is held to the longest handler timeout.handlerMatchersreplacessettingsMatcher. A single entry is judged as before, except that a regex handler no longer forces the settings entry to drop its matcher. -
README ("The hooks", the handler table, SubagentStop, "Pages"), and two
smokelines: the wrapper on its own, and throughsarathi hook PreToolUsewith a regex-matched fixture config. -
sarathi 0.8.17:
v0.8.16was tagged while this was built, so this takes the next legal version.VERSIONfollows.
deniedMcpServers, asked for with this work, is left out: #669's "Not here" gives the evidence that it did not drop the desktop's connectors, and that it could not be tested from a worktree.
Guards: per #669, packages/sarathi/README.md and packages/sarathi/package.json's smoke script.
🤖 Generated with Claude Code
Summary by cubic
The first of two PRs for #669 ("How"): ships a PreToolUse handler that holds a session's direct claude.ai publishes to the action box, in sarathi 0.8.17, along with the sarathi check rules its settings must meet. veda's pin bump and .claude wiring follow the v0.8.17 tag.
New Features
action-box.shrefusespublish_version,publish_files, andedit_versioncalls, matched by tool suffix, when the page lacks a whole action box, and refuses on any fault.publish_filesreads each servedindex.htmlfrom itspath; a republish without one passes.edit_versionon the page refuses only an edit that takes out adata-action-box,data-action-link, ordata-if-silentmarker.sarathi checknow accepts several settings entries per event, counts a regex handler as covered only by an entry with the identical matcher or one matching every tool, and holds every entry to the longest handler timeout.