transcript

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 19 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 transcript reads what agents said.

Every agent that keeps a record of its conversations keeps it somewhere of its own and in a shape of its own, and three parts of Flockdeck want to read it: restoring a layout, which resumes a conversation only when there is one to resume; the history overlay, which lists them; and a fan-out, which takes the plan an agent just wrote out of its last few replies rather than off the screen. Each of those asks a Reader, so an agent Flockdeck has never heard of costs them nothing: it gets the null reader and they all cope.

Index

Constants

View Source
const NoPrompt = "(no prompt recorded)"

NoPrompt stands in for the summary of a conversation that says nothing about itself: no prompt in its opening entries, and no name from the agent either. It is a label for a row in a list, not a name for anything.

Variables

View Source
var Agents = func() []agent.Spec { return agent.Load().Specs }

Agents is the catalog the history overlay lists conversations for: every agent, hidden ones included, since a hidden agent's conversations are still there to resume.

It was Claude alone until whoever assembled the catalog pointed it there, and nothing ever did, so an API agent's chats were recorded and never offered. It is still a variable, so a test can put a catalog of its own behind it.

Functions

func ClaudeHome added in v0.3.0

func ClaudeHome() string

ClaudeHome returns the directory Claude Code keeps its state in: its settings, and the login whose limits every Claude pane shares.

func ClaudeHomeFor added in v0.3.3

func ClaudeHomeFor(spec agent.Spec) string

ClaudeHomeFor returns the directory Claude Code keeps its state in for a pane running spec.

A catalog entry may set CLAUDE_CONFIG_DIR, which is the usual way to run a second Claude account, and the entry's environment is laid over Flockdeck's own in the pane, the last setting of a name winning. Reading Flockdeck's own instead looked for the pane's transcripts under the other account: a restart found nothing to resume and started the conversation again, task and all, and the history listed the wrong account's. The catalog has already expanded the variables in the value.

func Exists

func Exists(spec agent.Spec, sessionID string) bool

Exists reports whether an agent has a stored conversation worth resuming.

The file existing is not enough. A session interrupted before it recorded anything leaves an empty one behind, and an agent asked to resume that refuses and exits -- which, on a restored layout, is every such pane dying at once.

Types

type Chat

type Chat struct{}

Chat reads the record Flockdeck's own chat client keeps: one JSONL file per session under the state directory, one object per entry.

It is the same reader for every API agent, because they are all the same program talking to different endpoints, and it is a great deal simpler than Claude Code's because Flockdeck writes it: the entries are small, they are all in one folder, and there is no derived folder name to reproduce.

func (Chat) Conversations

func (Chat) Conversations(spec agent.Spec, cwd string) ([]Conversation, error)

Conversations lists the chats that ran in a working directory, most recently used first, each labelled as spec's. All asks once for every API agent and works out which of them held each chat instead.

func (Chat) Path

func (Chat) Path(_ agent.Spec, sessionID string) string

func (Chat) Replies

func (c Chat) Replies(spec agent.Spec, sessionID string, n int) []string

Replies returns what the model said in its last few turns, newest first, turn by turn the way the Claude reader counts them.

type Claude

type Claude struct{}

Claude reads the transcripts Claude Code writes: one JSONL file per session, under a folder per working directory, below Claude Code's own state directory. Only where that state directory is comes from the Spec: the rest is Claude Code's arrangement rather than Flockdeck's, and Flockdeck only reproduces enough of it to find the files.

func (Claude) Conversations

func (Claude) Conversations(spec agent.Spec, cwd string) ([]Conversation, error)

func (Claude) Path

func (Claude) Path(spec agent.Spec, sessionID string) string

func (Claude) Replies

func (Claude) Replies(spec agent.Spec, sessionID string, n int) []string

type Conversation

type Conversation struct {
	// ID is the session id, which is also the transcript's file name and what
	// the agent is given to reattach to it.
	ID string
	// Agent is the id of the agent that held the conversation. The history
	// overlay draws several agents' conversations in one list, and which agent
	// a row belongs to decides what happens when it is opened, so a row that
	// does not say is a row that cannot be resumed correctly.
	Agent   string
	Cwd     string
	Summary string
	// Title is the name the agent gave the conversation, when it gave it one.
	// It is what the summary falls back to, and what tells apart conversations
	// that were opened with the same prompt.
	Title    string
	Modified time.Time
	Messages int
	Size     int64
}

Conversation is a stored conversation that can be resumed.

func All

func All(specs []agent.Spec, cwd string) ([]Conversation, error)

All lists the stored conversations of every given agent for a working directory, most recently used first, each labelled with the agent that held it.

The error is the first an agent reported, and it comes back beside whatever the others found: one agent whose store cannot be read is a thing to say, not a reason to tell somebody that the conversations they know they had are gone.

type Null

type Null struct{}

Null is the reader for an agent that records nothing Flockdeck can read.

It answers every question with "there is none", which is the answer each caller already has to cope with: a Claude pane that has not been prompted yet has no transcript either, so nothing downstream is new code.

func (Null) Conversations

func (Null) Conversations(agent.Spec, string) ([]Conversation, error)

func (Null) Path

func (Null) Path(agent.Spec, string) string

func (Null) Replies

func (Null) Replies(agent.Spec, string, int) []string

type Reader

type Reader interface {
	Path(spec agent.Spec, sessionID string) string // "" when unknown
	Replies(spec agent.Spec, sessionID string, n int) []string
	Conversations(spec agent.Spec, cwd string) ([]Conversation, error)
}

Reader finds and reads one agent's stored conversations.

func For

func For(spec agent.Spec) Reader

For returns the reader for an agent.

An agent that does not record what it said, or records it somewhere nobody here knows how to read, gets the null reader rather than a guess. Inventing a path for it would be worse than admitting there is none: a fan-out would draw its plan from a file that is not the conversation, and a restored pane would be told to resume something that is not there and die on the spot.

Jump to

Keyboard shortcuts

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