transcript

package
v1.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package transcript is the operator's read projection over mast's sessions: list them, show one — its state, its pending interrupts, the edits and captures its approvals recorded — export its approval decisions, and look up a resume token. It reads the same ADK session store a daemon or a library embed writes through, so a session written by either reads identically here.

It is the read half. The writes — pause and abort markers, interrupt bookkeeping, token consumption, auto-resume attempts — are the daemon's and the root package's, and live under internal/ (#301). To pause or resume from Go, use mast.Pause, mast.ResumeSession and mast.ResumeByToken.

The record types are aliases of the store's own, so a value from mast.ListSessions or mast.Pause is the same type as one from here.

Index

Constants

View Source
const (
	StatePaused      = itr.StatePaused
	StateAborted     = itr.StateAborted
	StateInterrupted = itr.StateInterrupted
	StateIdle        = itr.StateIdle
)

Session states, as Detail.State and Summary.State report them.

View Source
const (
	AwaitingApproval = itr.AwaitingApproval
	AwaitingInput    = itr.AwaitingInput
)

What a session is waiting on, as Detail.Awaiting reports it.

View Source
const (
	PlaneGate      = itr.PlaneGate
	PlaneInterrupt = itr.PlaneInterrupt
)

Pause planes, as recorded in PauseRecord.Plane.

View Source
const (
	ReasonBudgetExhaustion  = itr.ReasonBudgetExhaustion
	ReasonWatchdogAnomaly   = itr.ReasonWatchdogAnomaly
	ReasonCostCoolDown      = itr.ReasonCostCoolDown
	ReasonMaintenanceWindow = itr.ReasonMaintenanceWindow
	ReasonRateLimitBackoff  = itr.ReasonRateLimitBackoff
	ReasonAmbiguity         = itr.ReasonAmbiguity
	ReasonOperator          = itr.ReasonOperator
	ReasonA2ATaskPending    = itr.ReasonA2ATaskPending
	ReasonOther             = itr.ReasonOther
)

Pause reasons a PauseSpec may carry; ValidReasons lists them.

View Source
const (
	RedactionNone           = itr.RedactionNone
	RedactionApproverDigest = itr.RedactionApproverDigest
)

Redaction modes for ExportOptions.

View Source
const DefaultTokenTTL = itr.DefaultTokenTTL

DefaultTokenTTL is how long a resume token lives when a PauseSpec names no TokenTTL.

Variables

View Source
var (
	ErrNotFound       = itr.ErrNotFound
	ErrTokenNotFound  = itr.ErrTokenNotFound
	ErrTokenExpired   = itr.ErrTokenExpired
	ErrAlreadyResumed = itr.ErrAlreadyResumed
)

Errors the read methods and mast's resume calls return; compare with errors.Is.

Functions

func ValidReasons added in v0.2.0

func ValidReasons() []string

ValidReasons lists the pause reasons a PauseSpec may carry.

Types

type Detail

type Detail = itr.Detail

Detail is one session as Get projects it.

type ExportMeta added in v0.4.0

type ExportMeta = itr.ExportMeta

ExportMeta is the header line ExportDecisions writes first.

type ExportOptions added in v0.4.0

type ExportOptions = itr.ExportOptions

ExportOptions selects and redacts what ExportDecisions writes.

type PauseHandle added in v0.2.0

type PauseHandle = itr.PauseHandle

PauseHandle is what mast.Pause returns: the token and its expiry.

type PauseRecord added in v0.2.0

type PauseRecord = itr.PauseRecord

PauseRecord is the durable record behind a resume token.

type PauseSpec added in v0.2.0

type PauseSpec = itr.PauseSpec

PauseSpec is what mast.Pause records.

type PendingInput

type PendingInput = itr.PendingInput

PendingInput is an interrupt a session is waiting on.

type Reason added in v0.2.0

type Reason = itr.Reason

Reason classifies a pause.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store reads mast's sessions out of an ADK session service.

func NewStore

func NewStore(svc adksession.Service, appName string) *Store

NewStore reads sessions for appName ("mast" for anything mast wrote) out of svc — the same service passed as mast.Config.Sessions or opened by the daemon's --session-db.

func (*Store) Decisions added in v0.4.0

func (s *Store) Decisions(ctx context.Context, userID, sessionID string) ([]approval.Decision, error)

Decisions returns a session's durable approval decisions, oldest first.

func (*Store) ExportDecisions added in v0.4.0

func (s *Store) ExportDecisions(ctx context.Context, w io.Writer, opts ExportOptions) (int, error)

ExportDecisions writes the decisions opts selects as JSONL — a meta line, then one mast.decision/v1 record per line — and returns how many records it wrote.

func (*Store) FindToken added in v0.2.0

func (s *Store) FindToken(ctx context.Context, token string) (*PauseRecord, error)

FindToken returns the pause record behind a resume token, consumed or not. ErrTokenNotFound when there is none.

func (*Store) Get

func (s *Store) Get(ctx context.Context, userID, sessionID string) (*Detail, error)

Get projects one session. An empty userID finds the session under whichever user owns it. ErrNotFound when there is none.

func (*Store) List

func (s *Store) List(ctx context.Context, userID string) ([]Summary, error)

List summarizes every session for userID; an empty userID lists every user's.

type Summary

type Summary = itr.Summary

Summary is one session in a List.

Jump to

Keyboard shortcuts

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