co-mono/packages/coding-agent/docs
Mario Zechner ba185b0571 Hook API: replace send() with sendMessage(), add appendEntry() and registerCommand()
Breaking changes to Hook API:
- pi.send(text, attachments?) replaced with pi.sendMessage(message, triggerTurn?)
  - Creates CustomMessageEntry instead of user messages
  - Properly handles queuing during streaming via agent loop
  - Supports optional turn triggering when idle
- New pi.appendEntry(customType, data?) for hook state persistence
- New pi.registerCommand(name, options) for custom slash commands
- Handler types renamed: SendHandler -> SendMessageHandler, new AppendEntryHandler

Implementation:
- AgentSession.sendHookMessage() handles all three cases:
  - Streaming: queues message with _hookData marker, agent loop processes it
  - Not streaming + triggerTurn: appends to state/session, calls agent.continue()
  - Not streaming + no trigger: appends to state/session only
- message_end handler routes based on _hookData presence to correct persistence
- HookRunner gains getRegisteredCommands() and getCommand() methods

New types: HookMessage<T>, RegisteredCommand, CommandContext
2025-12-30 22:42:18 +01:00
..
custom-tools.md Rename /clear to /new, update hook events to before_new/new 2025-12-25 04:15:10 +01:00
extension-loading.md Update extension-loading.md with install/remove/update commands 2025-12-26 20:51:15 +01:00
hooks-v2.md Fix model selector not showing models with settings.json API keys 2025-12-24 21:23:44 +01:00
hooks.md Rename /clear to /new, update hook events to before_new/new 2025-12-25 04:15:10 +01:00
rpc.md Add before/after session events with cancellation support 2025-12-22 18:18:38 +01:00
sdk.md feat(coding-agent): Add --session-dir flag for custom session directory 2025-12-25 20:27:41 +01:00
session-tree-plan.md Hook API: replace send() with sendMessage(), add appendEntry() and registerCommand() 2025-12-30 22:42:18 +01:00
session-tree.md Add session version field and migrate-on-load strategy 2025-12-25 22:52:04 +01:00
session.md Add bash mode for executing shell commands 2025-12-08 22:40:32 +01:00
skills.md feat(coding-agent): add --skills CLI flag for filtering skills 2025-12-21 20:58:54 +01:00
theme.md Improve system prompt docs, clean up theme/skills/hooks docs, fix toolResults type 2025-12-17 21:27:28 +01:00