prompt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package prompt provides the system prompt for hawk.

Migration note: The full system prompt is now assembled by the modular template system in the prompts/ package (role.md, tools.md, practices.md, communication.md). This file retains only the identity preamble and system-level instructions that the templates do not cover. The two are combined in cmd/options.go via buildSystemPrompt().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func System

func System() string

System returns the identity and system-level preamble that the modular templates do not cover. Tools, practices, and communication style are handled by prompts.BuildSystemPrompt().

Types

type Suggestion

type Suggestion struct {
	Text       string  `json:"text"`
	Confidence float64 `json:"confidence"`
	Source     string  `json:"source"` // "speculation", "history", "context"
}

Suggestion represents a contextual prompt suggestion.

func GenerateFromHistory

func GenerateFromHistory(history []string, currentInput string) []Suggestion

GenerateFromHistory produces suggestions based on command history patterns.

type SuggestionService

type SuggestionService struct {
	// contains filtered or unexported fields
}

SuggestionService generates prompt suggestions based on conversation context.

func NewSuggestionService

func NewSuggestionService() *SuggestionService

NewSuggestionService creates a new prompt suggestion service.

func (*SuggestionService) Abort

func (s *SuggestionService) Abort()

Abort cancels any in-flight suggestion generation.

func (*SuggestionService) GetSuggestions

func (s *SuggestionService) GetSuggestions() []Suggestion

GetSuggestions returns cached suggestions or empty if none available.

func (*SuggestionService) IsEnabled

func (s *SuggestionService) IsEnabled() bool

IsEnabled returns whether suggestions are active.

func (*SuggestionService) SetEnabled

func (s *SuggestionService) SetEnabled(enabled bool)

SetEnabled enables or disables suggestions.

func (*SuggestionService) UpdateContext

func (s *SuggestionService) UpdateContext(lastAssistant string, speculateFn func(ctx context.Context, context string) ([]string, error))

UpdateContext triggers suggestion generation based on new conversation context. speculateFn is called asynchronously to generate suggestions via LLM.

Jump to

Keyboard shortcuts

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