Documentation
¶
Index ¶
- Variables
- func CleanURL(raw string) string
- func FormatDiff(toolName, toolInput string, width int, styles DiffStyles) string
- func JSONField(jsonStr, field string) string
- func OpenInBrowser(u string) error
- func ShortenPath(path string) string
- func SummarizeChangeCount(summary string, count int) string
- type ChangeItem
- type DiffStyles
- type Item
- func BlockFilePaths(blocks []session.ContentBlock) []Item
- func BlockModifiedFiles(blocks []session.ContentBlock) []Item
- func BlockURLs(blocks []session.ContentBlock) []Item
- func CategorizeURL(u string) Item
- func EntryURLs(entries []session.Entry) []Item
- func SessionFilePaths(filePath string) []Item
- func SessionURLs(filePath string) []Item
Constants ¶
This section is empty.
Variables ¶
var FilePathTools = map[string]string{
"Read": "file_path",
"Write": "file_path",
"Edit": "file_path",
"LSP": "filePath",
"NotebookEdit": "notebook_path",
}
FilePathTools maps tool names to their JSON field containing the file path. Includes all tools that reference specific files (Read, Write, Edit, LSP, NotebookEdit). Used by buildStandardEntry to show file artifacts in conversation preview.
Functions ¶
func FormatDiff ¶ added in v0.3.0
func FormatDiff(toolName, toolInput string, width int, styles DiffStyles) string
FormatDiff renders a colorized diff from a tool name and its JSON input. Returns empty string if not a change tool or unparseable.
func JSONField ¶
JSONField extracts a string field value from a JSON string. Handles both "field":"value" and "field": "value" (with optional space).
func OpenInBrowser ¶
OpenInBrowser opens a URL in the default browser.
func ShortenPath ¶
ShortenPath creates a display label from a file path.
func SummarizeChangeCount ¶ added in v0.3.0
Types ¶
type ChangeItem ¶ added in v0.3.0
type ChangeItem struct {
Item Item
ToolNames []string
ToolInputs []string
Summary string
ChangeCount int
Timestamp time.Time
}
func BlockChanges ¶ added in v0.3.0
func BlockChanges(blocks []session.ContentBlock) []ChangeItem
func EntryChanges ¶ added in v0.3.0
func EntryChanges(entries []session.Entry) []ChangeItem
EntryChanges extracts change items from entries, preserving timestamps.
func SessionChanges ¶ added in v0.3.0
func SessionChanges(filePath string) []ChangeItem
type DiffStyles ¶ added in v0.3.0
type DiffStyles struct {
Add func(string) string
Del func(string) string
Hunk func(string) string
Header func(string) string
}
DiffStyles holds the ANSI color codes for diff rendering.
func DefaultDiffStyles ¶ added in v0.3.0
func DefaultDiffStyles() DiffStyles
DefaultDiffStyles returns plain text styling (no color).
type Item ¶
type Item struct {
URL string
Label string // short display label
Category string // github, jira, slack, pr, other
}
Item represents a URL or file path extracted from a session.
func BlockFilePaths ¶
func BlockFilePaths(blocks []session.ContentBlock) []Item
BlockFilePaths extracts unique file paths from tool_use blocks. Includes all file-referencing tools (Read, Write, Edit, etc.).
func BlockModifiedFiles ¶ added in v0.3.0
func BlockModifiedFiles(blocks []session.ContentBlock) []Item
BlockModifiedFiles extracts unique file paths from write/edit tool_use blocks. Excludes Read (context-only), image files, and search tools (Glob/Grep).
func BlockURLs ¶
func BlockURLs(blocks []session.ContentBlock) []Item
BlockURLs extracts unique URLs from content blocks.
func CategorizeURL ¶
CategorizeURL classifies a URL and generates a short label.
func SessionFilePaths ¶
SessionFilePaths loads messages and extracts file paths.
func SessionURLs ¶
SessionURLs loads all messages from a session file and extracts unique URLs.