From 0c462f014b23a04fcbc5f71c10d3a77075811660 Mon Sep 17 00:00:00 2001 From: Solar Lorian Date: Sun, 3 May 2026 11:52:12 +0100 Subject: [PATCH 1/3] feat: add kilo agent support to hcom - Add Kilo enum variant to tool.rs with kilo-start/status/read/stop hooks - Create hooks/kilo.rs with full lifecycle handlers (start, status, read, stop) - Create tools/kilo_preprocessing.rs for hcom bash auto-approval env vars - Add LaunchTool::Kilo to launcher.rs with PTY dispatch and plugin check - Add kilo to bootstrap.rs spawn list and delivery auto-check - Add kilo_args field to config.rs with HCOM_KILO_ARGS env and [launch.kilo] toml - Add kilo to router.rs LAUNCH_TOOLS and hook dispatch - Add kilo to commands/launch.rs preview and arg merging - Create hcom_kilo.ts plugin (kilocode-specific adaptation of hcom.ts) - Handle cross-agent merge conflicts with KiloCode naming --- src/bootstrap.rs | 6 +- src/commands/help.rs | 40 +- src/commands/hooks.rs | 33 +- src/commands/launch.rs | 4 +- src/commands/resume.rs | 43 +- src/commands/status.rs | 26 ++ src/config.rs | 11 + src/delivery.rs | 15 +- src/hooks/family.rs | 6 + src/hooks/kilo.rs | 655 ++++++++++++++++++++++++++++ src/hooks/mod.rs | 1 + src/instance_binding.rs | 2 +- src/launcher.rs | 67 ++- src/opencode_plugin/hcom_kilo.ts | 496 +++++++++++++++++++++ src/opencode_plugin/kilo-hcom.ts | 496 +++++++++++++++++++++ src/pty/screen.rs | 1 + src/router.rs | 6 +- src/shared/constants.rs | 6 +- src/shared/platform.rs | 2 + src/terminal.rs | 7 +- src/tool.rs | 44 +- src/tools/kilo_preprocessing.rs | 47 ++ src/tools/kilocode_preprocessing.rs | 4 + src/tools/mod.rs | 1 + src/tui/db.rs | 1 + src/tui/model.rs | 14 +- src/tui/render/agents.rs | 1 + src/tui/rpc.rs | 2 +- 28 files changed, 1974 insertions(+), 63 deletions(-) create mode 100644 src/hooks/kilo.rs create mode 100644 src/opencode_plugin/hcom_kilo.ts create mode 100644 src/opencode_plugin/kilo-hcom.ts create mode 100644 src/tools/kilo_preprocessing.rs create mode 100644 src/tools/kilocode_preprocessing.rs diff --git a/src/bootstrap.rs b/src/bootstrap.rs index ec61ec31..e53c0f8e 100644 --- a/src/bootstrap.rs +++ b/src/bootstrap.rs @@ -63,10 +63,10 @@ You MUST use `hcom --name {instance_name}` for all hcom commands: Filters (same flag=OR, different=AND): --agent NAME | --type message|status|life | --status listening|active|blocked | --cmd PATTERN (contains, ^prefix, =exact) | --file PATH (*.py for glob, file.py for contains) Event-based notifications, watch agents, subscribe, react: events sub [filters] | --help - Handoff context: bundle prepare -- Spawn agents: [num] [--tag labelOrGroup] [--terminal tmux|kitty|wezterm|etc] +- Spawn agents: [num] [--tag labelOrGroup] [--terminal tmux|kitty|wezterm|etc] Example: `hcom 1 claude --tag cool` -> automatic msg when ready -> send it task via hcom send Resume: hcom r [args] | Fork: hcom f [args] | Kill: hcom kill - background, set prompt, system, forward args: --help + background, set prompt, system, forward args: --help - Run workflows: run