* feat(hooks): Initial implementation of hooks UI using background terminal UI * Hooks UI improvements * Hook discovery improvements * Separate hooks UI into separate files * Fix failing tests * Add missing docs * Hooks hardening and handling edge cases * Improvements to hooks error messaging * Improve TaskCancel hook UI * Simplify and improve console.log() output from hooks * Changes from usability feedback * test: verify linting fixes * fix: resolve cancel functionality in PostToolUse hook using flag pattern * fix: add cancel button support for TaskResume and UserPromptSubmit hooks * Getting things working again * Fixing cancel behaviors * Trying another fix * Demoed * Add examples to .clinerules/hooks/ directory * Refactored away loadTaskStateWithoutWorkflow * Fix unsafe return in finally block Refactored PostToolUse hook execution to avoid using return statement in finally block, which the linter flags as unsafe. Instead of early return, wrapped the hook logic in a conditional check for abort status. This resolves the biome lint error: lint/correctness/noUnsafeFinally - Unsafe usage of 'return' in finally block * Remove unnecessary files from branch * remove cancelHookExecution() in favor of cancelTask() * Remove unnecessary polling pattern for hook cancellation * Fixing cancel behavior * Fixing cancel behavior * Fix resume * Sqaush commits to improve merge tool behavior Plan out the work needed to resolve race conditions Fix race conditions (1) Fix race conditions (2) Fix race conditions (3) Fix race conditions (4) Fix race conditions (5) Fix unit tests Updated implementation plan doc Code quality improvement Temporary logging to troubleshoot race conditions in hooks UI blocks Fix streaming output for hooks Remove in-progress planning file Revert breakage Remove unneeded arg output in PreToolUse hook UI Fix race condition with PreToolUse and PostToolUse hooks Fix PreToolUse attempt_completion use case Fix ChatTextArea prompt input Fixed part of the rersume bug Clean-up before code review Change cancel button to abort button Fixed TaskCancel behavior Fixing resume behavior (partially fixed) Make notch arrow visible in hooks block up expand/contract toggle Prevent cancel/abort from clearing unsent user message Change 'Cancelled' to 'Aborted' in hook UI block Use color styles consistent with background terminal Fix npm compile issue Remove unneeded hot-cold tracking from hooks Remove unused constant as per PR feedback Minor changes Skip combineHookSequences() if hooks feature setting not enabled Improve mutex pattern for general use and fix additional race condition Refactor to reduce duplication (keep it DRY) Refactor to reduce duplication (keep it DRY) part 2 Fix tests Skip some tests on Windows (not yet supported) Hooks unsupported on Windows Fix broken unit tests * Fix broken unit tests * Bee and Eve fixing 'API Request...' test in e2e tests * Add comment as per ellipsis-dev PR feedback * Changes as per PR feedback from Evan * Remove if that always resolves to true * Don't use vscode API; use cross-compatible solutions instead * Remove mention of obsolete clineAsk handler
84 lines
1.8 KiB
Protocol Buffer
84 lines
1.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package cline;
|
|
|
|
option go_package = "github.com/cline/grpc-go/cline";
|
|
option java_multiple_files = true;
|
|
option java_package = "bot.cline.proto";
|
|
|
|
// Input message for all hooks
|
|
message HookInput {
|
|
string cline_version = 1;
|
|
string hook_name = 2;
|
|
string timestamp = 3;
|
|
string task_id = 4;
|
|
repeated string workspace_roots = 5;
|
|
string user_id = 6;
|
|
oneof data {
|
|
PreToolUseData pre_tool_use = 10;
|
|
PostToolUseData post_tool_use = 11;
|
|
UserPromptSubmitData user_prompt_submit = 12;
|
|
TaskStartData task_start = 13;
|
|
TaskResumeData task_resume = 14;
|
|
TaskCancelData task_cancel = 15;
|
|
TaskCompleteData task_complete = 16;
|
|
PreCompactData pre_compact = 17;
|
|
}
|
|
}
|
|
|
|
// Output message for all hooks
|
|
message HookOutput {
|
|
string context_modification = 1;
|
|
bool cancel = 2;
|
|
string error_message = 3;
|
|
}
|
|
|
|
// Data for PreToolUse hook
|
|
message PreToolUseData {
|
|
string tool_name = 1;
|
|
map<string, string> parameters = 2;
|
|
}
|
|
|
|
// Data for PostToolUse hook
|
|
message PostToolUseData {
|
|
string tool_name = 1;
|
|
map<string, string> parameters = 2;
|
|
string result = 3;
|
|
bool success = 4;
|
|
int64 execution_time_ms = 5;
|
|
}
|
|
|
|
// Data for UserPromptSubmit hook
|
|
message UserPromptSubmitData {
|
|
string prompt = 1;
|
|
repeated string attachments = 2;
|
|
}
|
|
|
|
// Data for TaskStart hook
|
|
message TaskStartData {
|
|
map<string, string> task_metadata = 1;
|
|
}
|
|
|
|
// Data for TaskResume hook
|
|
message TaskResumeData {
|
|
map<string, string> task_metadata = 1;
|
|
map<string, string> previous_state = 2;
|
|
}
|
|
|
|
// Data for TaskCancel hook
|
|
message TaskCancelData {
|
|
map<string, string> task_metadata = 1;
|
|
}
|
|
|
|
// Data for TaskComplete hook
|
|
message TaskCompleteData {
|
|
map<string, string> task_metadata = 1;
|
|
}
|
|
|
|
// Data for PreCompact hook
|
|
message PreCompactData {
|
|
int64 context_size = 1;
|
|
int32 messages_to_compact = 2;
|
|
string compaction_strategy = 3;
|
|
}
|