feat(agents): add Kiro support#101
Conversation
Kiro's hook docs only sanction "v1" as the top-level version value (https://kiro.dev/docs/hooks/); validation behavior for other values is undocumented, so writing "1" risks Kiro silently skipping the file. Pin the contract with an assertion in the roundtrip test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
deploy_hook already guards against duplicates via kiro_hook_matches, but restore_hook pushed unconditionally, so a double-restore (e.g. repeated enable) duplicated the entry. Use the same (event, matcher, command) identity on restore. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Kiro hooks carry an on-disk `enabled` field (default true, "set false to skip without deleting" — https://kiro.dev/docs/hooks/), and Kiro's own panel toggles it in place. Previously HK ignored the field when scanning (natively disabled hooks showed as enabled) and toggled by remove+DB snapshot, fighting Kiro's own mechanism. - HookEntry gains an `enabled` flag (always true for formats without a native per-hook flag), threaded through both hook scan paths - toggle_hook flips `enabled` in place for KiroIde configs and takes no DB snapshot — on-disk state is read back on rescan via the existing disabled_config-IS-NULL upsert CASE, mirroring the native MCP toggle - covered by an end-to-end disable → rescan → enable manager test Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
~/.kiro/agents and .kiro/agents hold two coexisting formats: Kiro CLI custom agents (*.json) and IDE custom subagents (*.md with YAML front matter, https://kiro.dev/docs/chat/subagents/). Globbing only *.json silently dropped every IDE-authored subagent — the more common format in public repos. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…hooks Kiro's docs describe `~/.kiro/hooks/` (user-level), but no released version loads it — verified on-device with 1.0.89 (macOS): the IDE only counts workspace `.kiro/hooks/` entries. Upstream: kirodotdev/Kiro#5440 (open feature request) and #9857 (open bug, 1.0.52). Deploying there produced a hook that HK reported installed but Kiro silently never ran. - new adapter capability supports_global_hook_install() (default true); Kiro returns false with the upstream references - install_to_agent (global-only in v1) refuses with a clear Validation error instead of writing a dead config - the detail panel's Install-to-Agent button for hooks greys out for Kiro with a dedicated bilingual tooltip (en/zh) - scanning and toggling of hook files already on disk is unaffected Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for adding Kiro! Really solid and thorough work! I tested everything on a real Kiro IDE 1.0.89 install and pushed five fixes on top of your commit:
Also tested end-to-end on a real machine: HK correctly scans hooks and MCP servers configured in Kiro, enable/disable stays in sync between HK and Kiro's panel, and both subagent formats show up in the scan. Thanks again! Merged. |
Summary
.kiro/hooks/*.jsonand~/.kiro/hooks/*.json.Motivation
Closes #96.
Verification
cargo test -p hk-corepnpm exec tsc --noEmitpnpm testpnpm buildSnapshots
The
Kirobrand animation: