small gleam coding and persistent agent daemon with a detachable cli and a canvas ui albedo.sh

[draft] feat(hooks): Claude Code / Codex compatible hooks #99

Closed okami.mom
targeting main from feat/hooks
Closed opened by and assigned to okami.mom
targeting main from feat/hooks

Adds hooks (off by default; enable per session in /extensions).

Hooks are scripts, set up the same way as Claude Code and Codex, that run at points in a turn: before a prompt, before and after a tool call, and when the model stops. A hook can block a call, rewrite its input, or add context for the model. A Stop hook can keep the turn going, up to 8 times.

They run in the Python kernel, which also gates run() and files.edit/write inside cells. Cells can register Python callbacks with hooks.register. Config is $ALBEDO_HOME/hooks.json plus a per-workspace file in workspaces/<workspace>/hooks.json (memory moves there too, via a one-time migration owned by the memory extension) that wins conflicts and is never read from the repo. It only runs once approved on the user-only /hooks page (a TUI page built on the existing page-command machinery: review each hook, approve after a confirm, revoke), Codex-style; approval is the file's sha256 and any edit revokes it. Also fires SessionStart/SessionEnd and run() PostToolUse.

Left for follow-ups: compaction and subagent events, and hooks on files.read. Details in robot-docs/hooks.md. ./test.sh passes.

Commits 0