Add multi-agent hook support and revamp CLI TUI with clack/prompts#31
Open
Add multi-agent hook support and revamp CLI TUI with clack/prompts#31
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR expands AI coding agent hook support from 2 to 5 agents and modernizes the CLI UI framework.
New agent setup modules
packages/server/src/setup/gemini.ts—configures~/.gemini/settings.jsonhooks, transforms BeforeAgent/BeforeTool/SessionStart/SessionEnd/AfterAgent events via inline Node.js script to normalized namespackages/server/src/setup/cursor.ts—configures~/.cursor/hooks.jsonwith sessionStart/preToolUse (matcher: "*")/stop hooks, transforms event names inline before POSTpackages/server/src/setup/cline.ts—creates executable Node scripts in~/Documents/Cline/Rules/Hooks/for TaskStart/UserPromptSubmit/PreToolUse/TaskComplete, uses marker comment// @distracted/server hookfor detection/removal, awaitsPromise.allSettledfor multi-event POSTSetup orchestration and CLI
packages/server/src/setup/index.ts—add gemini/cursor/cline to AgentType and SetupStatus, replace raw readline keypress multi-select with@clack/prompts.multiselect, update getSetupStatus/setupAgent/removeAgent interactiveSetup/interactiveRemove for all 5 agentspackages/server/src/bin.ts—removecacdependency, implement manualprocess.argvparsing for--setup/--remove/--status/--port/--help, add clack intro/outro/confirm/log flow, support comma-separated agent listsTypes and server
packages/server/src/types.ts—extendHookPayload.sourceunion to include"claude" | "opencode" | "gemini" | "cursor" | "cline" | "pi"packages/server/src/server.ts—validate source against expanded list, replace startServer banner withp.note/p.log.info, use picocolors for status outputpackages/server/src/state.ts—replace UI.Style.* and UI.println with@clack/prompts(p.log.stepfor hook events,p.log.infofor status updates), use picocolors for colored outputExisting setup and dependencies
packages/server/src/setup/claude.tsandopencode.ts—replace UI.println/UI.Style usage withp.log.success/p.log.infoand picocolors dimpackages/server/package.json—add@clack/promptsandpicocolors, removecac