agenttranscript

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package agenttranscript reads the conversation a managed shell is exactly bound to.

It exists to keep two independent seams apart. The conversation-history adapters know how to read a provider's transcripts; `agentcontrol` knows how to address a managed agent. Joining them inside either one would make a terminal read depend on a history store, or a history store depend on tmux. This package is the join, and it is the only thing that has to know both.

It never guesses. The binding comes from an official integration's report, so a shell with no reported session gets `transcript_unavailable` rather than the newest conversation that happens to share its working directory — which is a different conversation often enough to be dangerous, and indistinguishable from the right one when it is wrong.

Index

Constants

View Source
const DefaultLimit = 50

DefaultLimit is the number of trailing messages returned when a caller does not choose. A transcript can be very long, and the recent end is the part a caller reaching for a transcript is almost always asking about.

Variables

This section is empty.

Functions

func DefaultAdapters

func DefaultAdapters(adapterID string) (adapter.Adapter, bool)

DefaultAdapters resolves a registered conversation adapter by id.

It reads the same registry the Conversations plugin does, but it does not construct that plugin, and it does not call Detect: the binding already names the exact session, so whether the adapter would have discovered this project on its own is not a question worth asking. That is what lets a transcript read work with the Conversations plugin disabled.

Types

type Adapters

type Adapters func(adapterID string) (adapter.Adapter, bool)

Adapters resolves a conversation-history adapter by its adapter id.

Injected so a test can supply a fake, and so the default can construct only the one adapter it needs rather than every registered adapter.

type Binding

type Binding struct {
	// Kind is the catalog family id running in the shell.
	Kind string
	// Ref is the reported session reference.
	Ref agentsession.Ref
}

Binding is the exact conversation one managed shell is bound to.

type Lookup

type Lookup func(agentcontrol.Target) (Binding, bool, error)

Lookup answers which conversation a target is bound to.

It is injected because resolving a target to its project manifest is the CLI's job, and giving this package its own project resolver would be a second answer to a question the CLI already answers.

type Reader

type Reader struct {
	Lookup   Lookup
	Adapters Adapters
	// Limit caps how many of the most recent messages are returned when the
	// caller asks for no specific number.
	Limit int
}

Reader is an agentcontrol.TranscriptReader over the adapter stack.

func (Reader) SessionMessages

func (r Reader) SessionMessages(ctx context.Context, target agentcontrol.Target, limit int) ([]agentcontrol.TranscriptMessage, error)

SessionMessages returns the messages of the conversation bound to target.

Jump to

Keyboard shortcuts

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