mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-13 19:20:06 +00:00
f42d487214
Implement a Pi-style extension system where plain .go files are loaded at runtime via Yaegi. Extensions register typed event handlers against 13 lifecycle events (tool_call, tool_result, input, before_agent_start, etc.) using concrete-type-only API methods to avoid Yaegi interface panics. Key capabilities: - Tool interception: block calls, modify results (wrapper pattern) - Input handling: transform or fully handle user input (skip agent) - System prompt injection via BeforeAgentStartResult - Custom tool and slash command registration - Styled output: ctx.Print, PrintInfo, PrintError, PrintBlock - Legacy hooks.yml compatibility via adapter - Auto-discovery from ~/.config/kit/extensions/ and .kit/extensions/ - CLI: kit extensions list|validate|init, --no-extensions, -e flags - 58 unit tests covering runner, loader (Yaegi), wrapper, events