transcript

package
v0.0.0-...-820128f Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package transcript contains provider-neutral transcript formatting helpers shared by assistant persistence and terminal presentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanMergeStreamingRole

func CanMergeStreamingRole(role Role) bool

CanMergeStreamingRole reports whether adjacent streaming transcript blocks with the same role can be joined without changing their meaning.

func FormatToolEventDisplay

func FormatToolEventDisplay(event *ToolEvent) string

FormatToolEventDisplay formats a tool event for terminal display.

func FormatToolEventPersistence

func FormatToolEventPersistence(event *ToolEvent) string

FormatToolEventPersistence formats a tool event for durable transcript storage.

func ToDatabaseRole

func ToDatabaseRole(role Role) database.Role

ToDatabaseRole converts a transcript role into a durable database role.

Types

type Role

type Role string

Role identifies a transcript message category independent from storage roles.

const (
	// RoleUser is a user-authored prompt.
	RoleUser Role = "user"
	// RoleAssistant is an assistant response.
	RoleAssistant Role = "assistant"
	// RoleToolResult is output from a tool execution.
	RoleToolResult Role = "toolResult"
	// RoleThinking is model reasoning or thinking text.
	RoleThinking Role = "thinking"
	// RoleCustom is extension-provided context.
	RoleCustom Role = "custom"
	// RoleBashExecution is output from a user-run shell command.
	RoleBashExecution Role = "bashExecution"
	// RoleBranchSummary is summary context for an abandoned branch.
	RoleBranchSummary Role = "branchSummary"
	// RoleCompactionSummary is summary context for compacted history.
	RoleCompactionSummary Role = "compactionSummary"
)

func FromDatabaseRole

func FromDatabaseRole(role database.Role) Role

FromDatabaseRole converts a durable database role into a transcript role.

type ToolEvent

type ToolEvent struct {
	CallID        string
	ParentCallID  string
	Name          string
	ArgumentsJSON string
	DetailsJSON   string
	Result        string
	Error         string
	Sequence      int
	IsError       bool
}

ToolEvent captures the display/persistence fields of a completed tool call.

Jump to

Keyboard shortcuts

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