Documentation
¶
Index ¶
- Constants
- func BuildCommitMsgPrompt(transcript []TranscriptEntry, diff string) string
- func BuildSuggestImplementationPrompt(state string, startedIn string, repos string, sessionCount int, ...) string
- func BuildSuggestMergeCandidatesPrompt(implementationSummaries string) string
- func BuildSuggestPRPrompt(diff, commitSubjects, prTemplate string) string
- func BuildUserPrompt(commitHash, subject string, stats ExplainContext, transcript []TranscriptEntry, ...) string
- func FormatCondensedTranscript(entries []TranscriptEntry) string
- func StripHTMLComments(s string) string
- type ExplainContext
- type GenerateResult
- type GenerateTextResult
- type MergeSuggestion
- type NarrativeResult
- type SuggestImplementationOutput
- type SuggestMergeCandidateOutput
- type SuggestPROutput
- type TitleSuggestion
- type TranscriptEntry
Constants ¶
const CommitMsgPrompt = `` /* 990-byte string literal not displayed */
CommitMsgPrompt instructs the model to generate a commit message.
const SuggestPRPrompt = `` /* 832-byte string literal not displayed */
SuggestPRPrompt instructs the model to author a pull request.
const SystemPrompt = `` /* 1247-byte string literal not displayed */
SystemPrompt instructs the model to analyze a development session.
Variables ¶
This section is empty.
Functions ¶
func BuildCommitMsgPrompt ¶
func BuildCommitMsgPrompt(transcript []TranscriptEntry, diff string) string
BuildCommitMsgPrompt assembles transcript context plus a bounded change summary and diff excerpt for commit message generation.
func BuildSuggestImplementationPrompt ¶ added in v0.2.0
func BuildSuggestImplementationPrompt( state string, startedIn string, repos string, sessionCount int, tokensIn, tokensOut string, commits string, fileChanges string, ) string
BuildSuggestImplementationPrompt assembles the prompt for a single implementation.
func BuildSuggestMergeCandidatesPrompt ¶ added in v0.2.0
BuildSuggestMergeCandidatesPrompt assembles the prompt for batch title/merge suggestions.
func BuildSuggestPRPrompt ¶
BuildSuggestPRPrompt assembles the prompt for PR generation. It reuses the summary+excerpt strategy from commit-msg prompts.
func BuildUserPrompt ¶
func BuildUserPrompt(commitHash, subject string, stats ExplainContext, transcript []TranscriptEntry, diff string) string
BuildUserPrompt assembles transcript, diff, and stats into the prompt.
func FormatCondensedTranscript ¶
func FormatCondensedTranscript(entries []TranscriptEntry) string
FormatCondensedTranscript formats transcript entries into a human-readable format for LLM consumption.
func StripHTMLComments ¶
Types ¶
type ExplainContext ¶
type ExplainContext struct {
FilesChanged int `json:"files_changed"`
LinesAdded int `json:"lines_added"`
LinesDeleted int `json:"lines_deleted"`
AIPercentage float64 `json:"ai_percentage"`
AILines int `json:"ai_lines"`
HumanLines int `json:"human_lines"`
SessionCount int `json:"session_count"`
RootSessions int `json:"root_sessions"`
Subagents int `json:"subagents"`
TopFiles []struct {
Path string `json:"path"`
Added int `json:"added"`
Deleted int `json:"deleted"`
TotalLines int `json:"total_lines"`
AILines int `json:"ai_lines"`
HumanLines int `json:"human_lines"`
AIPercent float64 `json:"ai_percentage"`
} `json:"top_files"`
}
ExplainContext is the subset of explain stats needed for the prompt.
type GenerateResult ¶
type GenerateResult struct {
Narrative *NarrativeResult
Provider string
Model string
}
GenerateResult holds the narrative plus metadata about how it was generated.
type GenerateTextResult ¶
GenerateTextResult holds a raw text response plus metadata.
func GenerateText ¶
func GenerateText(ctx context.Context, prompt string) (*GenerateTextResult, error)
GenerateText sends a redacted prompt to an available AI CLI and returns raw text. Providers are tried in order until one succeeds.
type MergeSuggestion ¶ added in v0.2.0
type MergeSuggestion struct {
ImplementationA string `json:"implementation_a"`
ImplementationB string `json:"implementation_b"`
Reason string `json:"reason"`
}
MergeSuggestion proposes merging two implementations.
type NarrativeResult ¶
type NarrativeResult struct {
Title string `json:"title"`
Intent string `json:"intent"`
Outcome string `json:"outcome"`
Learnings []string `json:"learnings"`
Friction []string `json:"friction"`
OpenItems []string `json:"open_items"`
Keywords []string `json:"keywords"`
}
NarrativeResult holds the structured LLM response.
type SuggestImplementationOutput ¶ added in v0.2.0
type SuggestImplementationOutput struct {
Title string `json:"title"`
Summary string `json:"summary"`
}
SuggestImplementationOutput is the structured JSON the LLM must return for a single implementation.
func ParseSuggestImplementationOutput ¶ added in v0.2.0
func ParseSuggestImplementationOutput(raw string) (*SuggestImplementationOutput, error)
ParseSuggestImplementationOutput extracts the structured response for a single implementation.
type SuggestMergeCandidateOutput ¶ added in v0.2.0
type SuggestMergeCandidateOutput struct {
Titles []TitleSuggestion `json:"titles,omitempty"`
Merges []MergeSuggestion `json:"merges,omitempty"`
}
SuggestMergeCandidateOutput is the structured JSON for merge suggestions across multiple implementations.
func ParseSuggestMergeCandidatesOutput ¶ added in v0.2.0
func ParseSuggestMergeCandidatesOutput(raw string) (*SuggestMergeCandidateOutput, error)
ParseSuggestMergeCandidatesOutput extracts the batch title/merge response.
type SuggestPROutput ¶
SuggestPROutput is the structured JSON the LLM must return.
func ParseSuggestPROutput ¶
func ParseSuggestPROutput(raw string) (*SuggestPROutput, error)
ParseSuggestPROutput extracts the structured title/body from the LLM response.
type TitleSuggestion ¶ added in v0.2.0
type TitleSuggestion struct {
ImplementationID string `json:"implementation_id"`
Title string `json:"title"`
}
TitleSuggestion proposes a title for an untitled implementation.