Documentation
¶
Overview ¶
Package transcript turns a conversation into cells that render at any width. Cells built from live events and from a saved history must look the same, so a conversation renders identically live, restored and in a sub-agent's view.
Index ¶
- func Ago(d time.Duration) string
- func Duration(d time.Duration) string
- func HomePath(p string) string
- func ShortPath(p string) string
- func Spinner(now time.Time) string
- func Title(name string) string
- func Tokens(n int) string
- type Agent
- type Assistant
- type Attached
- type Cell
- type Level
- type Notice
- type Params
- type Prompt
- type PromptKind
- type Toggler
- type Tool
- type ToolState
- type Transcript
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HomePath ¶
HomePath abbreviates the home directory as ~. Use it for the workspace itself, where ShortPath would show ".".
Types ¶
type Attached ¶
type Attached interface {
Attached() bool
}
An Attached cell renders with no gap below the cell above it.
type Cell ¶
type Cell interface {
// Render returns lines no wider than p.Width.
Render(p Params) []string
// Version changes whenever Render may return something else for the
// same Params.
Version() uint64
// Live cells animate with p.Now, so their rendering must not be cached.
Live() bool
}
A Cell keeps its content, not its rendering, so it can render at any width.
type Prompt ¶
type Prompt struct {
Text string
Images int
Kind PromptKind
// contains filtered or unexported fields
}
type Tool ¶
type Transcript ¶
type Transcript struct {
// contains filtered or unexported fields
}
func Load ¶
func Load(history []agentcore.Message) *Transcript
func New ¶
func New() *Transcript
func (*Transcript) Append ¶
func (t *Transcript) Append(c Cell)
func (*Transcript) Apply ¶
func (t *Transcript) Apply(ev agentcore.Event)
func (*Transcript) Cells ¶
func (t *Transcript) Cells() []Cell
Click to show internal directories.
Click to hide internal directories.