Files
deepseek-harness/packages/hooks
_KermanandTianyi Cui f4a32dbd0a refactor(llm): flatten tool results and validate native V4 sessions
Represent tool results as tool-role messages and migrate released wrappers
without losing outer own JSON fields, call identity, error state, or writer
field order. Refuse nested or wrapper-only information that has no lossless
current representation before successor publication.

Validate current event relationships directly instead of projecting V4 data
back into V3. Keep lifecycle, PTC, title/command, compaction, system-field and
retired-syntax checks on catalog restoration and ordinary JSONL opens. The
Worker JSON equality helper must inspect own keys so it cannot admit PTC
arguments that Node rejects.

Keep the source role change, required native admission and consumer fixture
updates in one complete review layer. Explain shared-type changes in the
persistence record and the native reader rationale in its existing note.
Use checked branded fixture identities and discriminant narrowing instead
of unknown double casts; fixture values and assertions remain intact.

This recomposes the original tool-role work by _Kerman with the independently
validated migration and admission repairs by Tianyi Cui. Frozen generations
and snapshot input version selection are retained.

Co-authored-by: Tianyi Cui <[email protected]>
2026-09-18 19:05:32 +08:00
..
2026-09-17 21:11:19 +08:00

description, kind
description kind
The hooks group map: run existing Claude Code and Codex shell-hook configs during agent runs, for users and maintainers navigating the group. package-group

packages/hooks

English | 中文

Summary

The hooks group lets agent runs reuse shell hooks written for Claude Code or Codex. Point the matching integration at an existing hooks.json to run supported command hooks when sessions start, prompts arrive, tools run, or runs stop. These hooks can block prompts or tool calls with model-visible messages, add conversation context, or require the run to continue. Choose this group to preserve existing hook configurations; each integration supports only the command-hook subset documented by its source tool.

Table of Contents


Packages

Package Role Shape
hook-protocol Shared hook engine both bridges use; never configured directly library
hooks-claude-code Run your existing Claude Code hooks.json hooks during agent runs plugin
hooks-codex Run your existing Codex hooks.json hooks during agent runs plugin


Dev Note

Working context for maintainers — click to expand

None.