chat

package
v5.58.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package chat implements the AI-assisted chat command.

This package provides the `ksail chat` command, which starts an interactive AI chat session powered by GitHub Copilot. It supports both TUI and non-TUI modes, with tool permission enforcement and plan/agent mode switching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPreToolUseHook added in v5.33.0

func BuildPreToolUseHook(
	allowedRoot string,
) copilot.PreToolUseHandler

BuildPreToolUseHook creates a PreToolUseHandler that enforces path sandboxing on ALL tool invocations (both custom KSail tools and SDK-managed tools like git/shell/filesystem). Mode enforcement (plan mode tool blocking) is handled server-side via Session.RPC.Mode.Set().

func NewChatCmd

func NewChatCmd(_ *di.Runtime) *cobra.Command

NewChatCmd creates and returns the chat command.

func WrapToolsWithPermissionAndModeMetadata

func WrapToolsWithPermissionAndModeMetadata(
	tools []copilot.Tool,
	eventChan chan tea.Msg,
	yoloModeRef *chatui.YoloModeRef,
	toolMetadata map[string]toolgen.ToolDefinition,
) []copilot.Tool

WrapToolsWithPermissionAndModeMetadata wraps ALL tools with permission prompts. In agent mode, edit tools require permission (based on RequiresPermission annotation), while read-only tools are auto-approved. When YOLO mode is enabled, permission prompts are skipped and all tools are auto-approved. Mode enforcement (plan mode tool blocking) is handled server-side via Session.RPC.Mode.Set().

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL