Files
magpie/docs
yetone 8de4669fb6 library: hooks reach DeepSeek Harness through its Claude Code hooks plugin (eiyuuzaki2333 on X)
DSH was the one Library agent with no Hooks. Its plugin
@deepseek-ai/dsh-hooks-claude-code runs a Claude Code hooks.json on dsh's
interception points, so a hook given to dsh is written to
$DSH_HOME/magpie-hooks.json (Claude shape, dsh tool names bash|pwsh and
write|edit|str_replace_editor, the events the bridge runs). Each profile gets the
plugin and @deepseek-ai/dsh-hook-protocol installed at dsh's own version
(`dsh plugin --profile <name> add`), then one marked magpie-hooks insert row.
No row is written, and any magpie row is taken out, while the plugin isn't
there (a user removed it, or the install failed): dsh leaves out a row whose
plugin is missing, and a deny hook would then allow everything. A user's own
row for the plugin is left alone and said. Failed installs retry after 10 min.

Not supported by dsh, so left off (named in docs/subsystems/library.md):
subagents, slash commands, rules, env, project MCP/hooks, Claude plugins.

Run:
- real dsh 0.2.2-rc.5 on mote, sandbox HOME, fake model server: bash call
  denied through the bridge with the hook's reason shown to the model;
  without @deepseek-ai/dsh-hook-protocol the row fails to import (hence both
  packages are installed).
- mote: go test ./internal/library ./internal/agent -count=1 ok (before the
  removed-plugin fix); go test ./internal/library -run Hook ok after it;
  GOOS=windows, GOOS=linux and native go vet ./internal/library ok; gofmt -l clean.
- GUI library-hooks, project-hooks, library-rtk-nohook (12 tests, each
  covering en/zh/zh-TW/ja/de at 440px) in chromium and webkit: 12/12 both.
- New tests: TestHooksDsh*, red on the old code (dsh was no hook agent).
  The hooks page is driven by hookAgents, so no GUI change was needed.

Not tried: the full magpie sync against real dsh (full sync not run against
real dsh: the row format was written by hand and loaded by real dsh, the
install is faked in tests); Windows and WSL dsh; a dsh older than 0.2.2-rc.5;
session-start narrowing (dsh's source names unknown). Full suites run after
the tag.
2026-11-20 05:10:42 +08:00
..