chat

package
v5.24.2 Latest Latest
Warning

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

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

Documentation

Overview

Package chat provides services for the AI chat assistant feature.

This package implements the core functionality for KSail's AI-assisted chat, powered by GitHub Copilot SDK. It provides:

  • Context building: Aggregates KSail documentation, CLI help, and project configuration into a system context for the AI assistant.
  • Custom tools: Read-only tools for cluster inspection (list, info, get), file reading, and directory listing.

Security: All file and directory operations are restricted to paths within the current working directory to prevent directory traversal attacks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSystemContext

func BuildSystemContext() (string, error)

BuildSystemContext builds the system prompt context for the chat assistant. It combines multiple sources of information:

  • Identity and role description for the AI assistant
  • Current working directory and ksail.yaml configuration if present
  • KSail documentation loaded from the docs/ directory
  • Dynamic CLI help output from the ksail executable
  • Instructions for proper behavior and command usage

Returns the complete system context string and any error encountered. If documentation loading fails, a partial context is still returned.

func FindKSailExecutable

func FindKSailExecutable() string

FindKSailExecutable attempts to find the ksail executable.

func GetKSailTools

func GetKSailTools(rootCmd *cobra.Command, outputChan chan<- generator.OutputChunk) []copilot.Tool

GetKSailTools returns the tools available to the chat assistant. It combines auto-generated tools from Cobra commands with manual file system tools. The rootCmd parameter should be the root Cobra command for the CLI. The outputChan parameter enables real-time output streaming (can be nil).

Types

This section is empty.

Directories

Path Synopsis
Package generator provides automatic tool generation from Cobra commands.
Package generator provides automatic tool generation from Cobra commands.

Jump to

Keyboard shortcuts

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