diff --git a/README.md b/README.md index f8970e93..31654d39 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ A powerful, extensible AI coding agent CLI with multi-provider support, built-in ## Features - **Multi-Provider LLM Support**: Anthropic, OpenAI, Google Gemini, Ollama, Azure OpenAI, AWS Bedrock, OpenRouter, and more -- **Built-in Core Tools**: bash, read, write, edit, grep, find, ls, subagent - no MCP overhead +- **Built-in Core Tools**: bash (with interactive sudo password prompt), read, write, edit, grep, find, ls, subagent - no MCP overhead - **Smart @ Attachments**: Binary files auto-detected via MIME type, MCP resources via `@mcp:server:uri` - **MCP Integration**: Connect external MCP servers for expanded capabilities - **Extension System**: Write custom tools, commands, widgets, and UI modifications in Go diff --git a/skills/kit-sdk/SKILL.md b/skills/kit-sdk/SKILL.md index bc5b770b..b9527818 100644 --- a/skills/kit-sdk/SKILL.md +++ b/skills/kit-sdk/SKILL.md @@ -270,6 +270,27 @@ unsub := host.Subscribe(func(e kit.Event) { | `reasoning_delta` | `ReasoningDeltaEvent` | `Delta` | | `step_usage` | `StepUsageEvent` | `InputTokens`, `OutputTokens`, `CacheReadTokens`, `CacheWriteTokens` | | `steer_consumed` | `SteerConsumedEvent` | `Count` | +| `password_prompt` | `PasswordPromptEvent` | `Prompt`, `ResponseCh` | + +**PasswordPromptEvent** (for sudo password handling): +```go +// PasswordPromptEvent fires when a sudo command needs a password. +// The TUI should display a password prompt and send the result back via ResponseCh. +type PasswordPromptEvent struct { + // Prompt is the message to display to the user. + Prompt string + // ResponseCh receives the password from the TUI. + // The TUI must send exactly one value: (password, false) for submit + // or ("", true) for cancel. + ResponseCh chan<- PasswordPromptResponse +} + +// PasswordPromptResponse carries the password prompt result. +type PasswordPromptResponse struct { + Password string + Cancelled bool +} +``` ### Tool kind constants diff --git a/www/pages/development.md b/www/pages/development.md index 0aa28949..aa1b0874 100644 --- a/www/pages/development.md +++ b/www/pages/development.md @@ -37,7 +37,7 @@ internal/acpserver/ - ACP (Agent Client Protocol) server internal/clipboard/ - Cross-platform clipboard operations internal/compaction/ - Conversation compaction and summarization internal/config/ - Configuration management -internal/core/ - Built-in tools (bash, read, write, edit, grep, find, ls) +internal/core/ - Built-in tools (bash with sudo password prompt, read, write, edit, grep, find, ls) internal/extensions/ - Yaegi extension system internal/kitsetup/ - Initial setup wizard internal/message/ - Message content types and structured content blocks diff --git a/www/pages/index.md b/www/pages/index.md index 938e357d..ace41fce 100644 --- a/www/pages/index.md +++ b/www/pages/index.md @@ -13,7 +13,7 @@ A powerful, extensible AI coding agent CLI with multi-provider support, built-in ## Features - **Multi-Provider LLM Support** — Anthropic, OpenAI, Google Gemini, Ollama, Azure OpenAI, AWS Bedrock, OpenRouter, and more -- **Built-in Core Tools** — bash, read, write, edit, grep, find, ls, subagent with no MCP overhead +- **Built-in Core Tools** — bash (with interactive sudo password prompt), read, write, edit, grep, find, ls, subagent with no MCP overhead - **Smart @ Attachments** — Binary files auto-detected via MIME type, MCP resources via `@mcp:server:uri` - **MCP Integration** — Connect external MCP servers for expanded capabilities (tools, prompts, and resources) - **Extension System** — Write custom tools, commands, widgets, and UI modifications in Go diff --git a/www/pages/sdk/callbacks.md b/www/pages/sdk/callbacks.md index ce4732c4..aebca7a5 100644 --- a/www/pages/sdk/callbacks.md +++ b/www/pages/sdk/callbacks.md @@ -100,6 +100,19 @@ kit.HookPriorityLow = 100 // runs last Lower values run first. First non-nil result wins. +## All event types + +| Event | Description | +|-------|-------------| +| `ToolCallEvent` | Tool call parsed and about to execute | +| `ToolResultEvent` | Tool execution completed with result | +| `ToolOutputEvent` | Streaming output chunk from tool (e.g., bash stdout/stderr) | +| `MessageUpdateEvent` | Streaming text chunk from LLM | +| `ResponseEvent` | Final response received | +| `TurnStartEvent` | Agent turn started | +| `TurnEndEvent` | Agent turn completed | +| `PasswordPromptEvent` | Sudo command needs password (respond via `ResponseCh`) | + ## Subagent event monitoring Monitor real-time events from LLM-initiated subagents (when the model uses the `subagent` tool):