insight

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidAgents = map[string]bool{
	"claude": true,
	"codex":  true,
	"gemini": true,
}

ValidAgents lists the supported agent names.

Functions

func BuildPrompt

func BuildPrompt(
	ctx context.Context,
	database *db.DB,
	req GenerateRequest,
) (string, error)

BuildPrompt queries sessions for the given date and assembles a prompt for the AI agent.

Types

type GenerateFunc

type GenerateFunc func(
	ctx context.Context, agent, prompt string,
) (Result, error)

GenerateFunc is the signature for insight generation, allowing tests to substitute a stub.

type GenerateRequest

type GenerateRequest struct {
	Type     string
	DateFrom string
	DateTo   string
	Project  string
	Prompt   string
}

GenerateRequest describes what insight to generate.

type Result

type Result struct {
	Content string
	Agent   string
	Model   string
}

Result holds the output from an AI agent invocation.

func Generate

func Generate(
	ctx context.Context, agent, prompt string,
) (Result, error)

Generate invokes an AI agent CLI to generate an insight. The agent parameter selects which CLI to use (claude, codex, gemini). The prompt is passed via stdin.

Jump to

Keyboard shortcuts

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