Spike: a policy mod whose throwing tool.call hook has a .catch handler

<h1>nixie</h1>
A personal assistant platform that its owner runs and controls: every rule readable and editable, every decision recorded, and personal data kept on the owner's own hosts.
<a href="./docs/README.md">Documentation</a> • <a href="./docs/README.md#decisions">Decisions</a> • <a href="./AGENTS.md">Agent Guidelines</a>
nixie is in Phase 2, Research, and has no product code. The work runs in 4 phases: brainstorm, research, design, and decide. Decisions are recorded as research settles each question.
bun install
bun run check # format, lint, and the prose check
hooks/register.js 16 lines1function handleToolCall() {
2 throw new Error('nixie-throw-hook-catch: hook failed');
3}
4
5function handleFailure($, e, next) {
6 return {
7 deny: `nixie policy failed (${next.error.kind}: ${next.error.message}), so the command did not run.`,
8 };
9}
10
11export function register(on) {
12 // `.catch` here is the mods API's error handler on a registration, not a promise method.
13 // oxlint-disable-next-line promise/prefer-await-to-then
14 on('tool.call', { tool: 'Bash' }, handleToolCall).catch(handleFailure);
15}
16