Documentation
¶
Index ¶
- func AnsiLinesToHTML(lines []string) string
- func AnsiToHTML(text string) string
- func ExportFromFile(inputPath string, options Options) (string, error)
- func ExportMarkdownFromFile(inputPath, outputPath string) (string, error)
- func ExportSession(manager *session.SessionManager, options Options) (string, error)
- func ExportSessionMarkdown(manager *session.SessionManager, outputPath string) (string, error)
- type Options
- type ParsedSkillBlock
- type RenderedToolHTML
- type ToolHTMLRenderResult
- type ToolHTMLRenderer
- type ToolHTMLRendererDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnsiLinesToHTML ¶
AnsiLinesToHTML converts ANSI-escaped lines to HTML, one div per line.
func AnsiToHTML ¶
AnsiToHTML converts ANSI-escaped text to HTML with inline styles.
func ExportFromFile ¶
ExportFromFile exports an existing session file without runtime state.
func ExportMarkdownFromFile ¶
func ExportSession ¶
func ExportSession(manager *session.SessionManager, options Options) (string, error)
ExportSession writes a self-contained HTML view of a persisted session.
func ExportSessionMarkdown ¶
func ExportSessionMarkdown(manager *session.SessionManager, outputPath string) (string, error)
ExportSessionMarkdown writes the active session branch as portable Markdown.
Types ¶
type Options ¶
type Options struct {
OutputPath string
ThemeName string
SystemPrompt *string
Tools json.RawMessage
ToolRenderer ToolHTMLRenderer
Theme *modetheme.Theme
}
type ParsedSkillBlock ¶
ParsedSkillBlock is an upstream skill invocation embedded in a user message.
func ParseSkillBlock ¶
func ParseSkillBlock(text string) (ParsedSkillBlock, bool)
ParseSkillBlock parses the exact upstream skill-message envelope.
type RenderedToolHTML ¶
type RenderedToolHTML struct {
CallHTML *string `json:"callHtml,omitempty"`
ResultHTMLCollapsed *string `json:"resultHtmlCollapsed,omitempty"`
ResultHTMLExpanded *string `json:"resultHtmlExpanded,omitempty"`
}
RenderedToolHTML is the custom-tool HTML envelope consumed by the embedded upstream renderer. Pointer fields preserve optional property semantics.
type ToolHTMLRenderResult ¶
ToolHTMLRenderResult is the optional collapsed/expanded HTML returned for a custom tool result.
type ToolHTMLRenderer ¶
type ToolHTMLRenderer interface {
RenderCall(toolCallID, toolName string, arguments any) *string
RenderResult(toolCallID, toolName string, content, details any, isError bool) *ToolHTMLRenderResult
}
ToolHTMLRenderer pre-renders custom tool calls and results for live exports. NewToolHTMLRenderer adapts registered TUI tool renderers to this seam, matching upstream createToolHtmlRenderer and its ANSI-to-HTML conversion.
func NewToolHTMLRenderer ¶
func NewToolHTMLRenderer(deps ToolHTMLRendererDeps) ToolHTMLRenderer
NewToolHTMLRenderer creates the live-export ToolHTMLRenderer over the registered tool definitions (upstream createToolHtmlRenderer).
type ToolHTMLRendererDeps ¶
type ToolHTMLRendererDeps struct {
// GetToolDefinition looks up a tool definition by name.
GetToolDefinition func(name string) *extensions.ToolDefinition
// Theme styles the renders.
Theme extensions.Theme
// CWD is the working directory for the render context.
CWD string
// Width is the terminal width for rendering (default 100).
Width int
}
ToolHTMLRendererDeps configures NewToolHTMLRenderer.