agentcli

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DailyPrompt

func DailyPrompt(observations []string, date, guidelines string, citedFacts []FactCitation) string

DailyPrompt builds a prompt for distilling observations into a daily memory summary. If guidelines is non-empty, it is prepended as team-specific distillation preferences.

Facts are rendered inline with citation numbers. The LLM is instructed to include `[N]` markers (or `[anchor][N]` reference links) in its synthesis; the caller post-processes the output to append a "## Sources" section with resolved URLs. See cmd/ox/distill_citations.go for the rendering side.

func DiscussionFactsPrompt

func DiscussionFactsPrompt(title, summary, transcript, guidelines, annotations string) string

DiscussionFactsPrompt builds a prompt for extracting structured facts from a discussion. The LLM extracts decisions, learnings, open questions, action items, and key context as JSONL output (one JSON object per line). When annotations is non-empty, server-extracted annotations are included as ground truth.

func MonthlyPrompt

func MonthlyPrompt(weeklySummaries []string, month, guidelines string, hasCitations bool) string

MonthlyPrompt builds a prompt for synthesizing weekly summaries into a monthly memory.

hasCitations behaves the same way as in WeeklyPrompt — when true, the LLM is instructed to preserve `[N]` markers and the caller appends a unified "## Sources" section after generation.

func WeeklyPrompt

func WeeklyPrompt(dailySummaries []string, weekID, guidelines string, hasCitations bool) string

WeeklyPrompt builds a prompt for synthesizing daily summaries into a weekly memory.

hasCitations should be true when the daily summaries contain `[N]` citation markers (the new format from gh #476). When true, the prompt instructs the LLM to preserve those markers verbatim — the caller has already renumbered them to a unified weekly numbering, and a fresh "## Sources" section will be appended after the LLM returns.

func WriteGuidelines added in v0.6.0

func WriteGuidelines(sb *strings.Builder, guidelines, stage string)

WriteGuidelines wraps team guidelines in a <team-guidelines> tag and tells the LLM which pipeline stage it's in. The stage identifier lets the guidelines reference optional per-stage override files via progressive disclosure (e.g., "if extracting discussions, read EXTRACT-discussions.md"). The LLM MAY use the Read tool to access files in memory/guidance/.

Types

type Backend

type Backend interface {
	// Name returns the backend identifier (e.g., "claude").
	Name() string
	// Available checks if the CLI exists in PATH.
	Available() bool
	// Run sends a prompt and returns the text output.
	Run(ctx context.Context, prompt string) (string, error)
}

Backend represents an AI agent CLI that can process prompts.

func Detect

func Detect() (Backend, error)

Detect returns the first available backend, or an error.

type Claude

type Claude struct {
	// Timeout for the claude process. Zero means no timeout (uses ctx).
	Timeout time.Duration
	// WorkDir sets the working directory for the claude process.
	// When set, relative file paths in prompts resolve from this directory.
	WorkDir string
	// Model overrides the default model (e.g., "sonnet" or "claude-sonnet-4-6").
	// Empty string uses the claude CLI default.
	Model string
}

Claude implements Backend using the claude CLI in pipe mode.

func (*Claude) Available

func (c *Claude) Available() bool

func (*Claude) Name

func (c *Claude) Name() string

func (*Claude) Run

func (c *Claude) Run(ctx context.Context, prompt string) (string, error)

type FactCitation added in v0.6.2

type FactCitation struct {
	Num         int    // 1-based citation number (the [N] the LLM should emit)
	Headline    string // required
	Summary     string // optional
	Rationale   string // optional
	Who         string // optional
	SourceType  string // "discussion" | "github" | "session" | "observation"
	SourceTitle string // optional human label (e.g., PR or discussion title)
	Date        string // YYYY-MM-DD slice of the fact's timestamp
	Category    string // optional: decision | learning | ship | ...
}

FactCitation is a fact-with-citation-number passed into DailyPrompt for inline rendering. The Num field is the citation marker the LLM should use when referencing this fact in its synthesis. Multiple facts may share the same Num if they originate from the same source (deduped by URL upstream).

Added for gh #476: distill summaries must carry source links so readers can drill down to the original discussion / PR / session.

Jump to

Keyboard shortcuts

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