Documentation
¶
Index ¶
- Constants
- func BuildCommitMsgPrompt(transcript []TranscriptEntry, diff 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 NarrativeResult
- type SuggestPROutput
- 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 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 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 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.