Documentation
¶
Overview ¶
Package codexsession discovers and selects materialized interactive Codex sessions through app-server.
Index ¶
Constants ¶
const DefaultPageSize uint32 = 50
Variables ¶
var ( ErrNoCandidates = errors.New("codexsession: no resumable sessions") ErrNotResumable = errors.New("codexsession: session is not resumable by this picker") )
var ErrCanceled = errors.New("codexsession: selection canceled")
Functions ¶
func SanitizeDisplay ¶
SanitizeDisplay converts untrusted session metadata to one printable line. maxRunes <= 0 disables truncation. Unicode format characters and terminal controls are replaced, and all whitespace runs collapse to one ASCII space.
func ValidateID ¶
ValidateID performs transport-safe validation without assuming that future Codex thread identifiers will remain UUIDs.
Types ¶
type Candidate ¶
type Candidate struct {
Thread appserver.Thread
Source appserver.ThreadSourceKind
}
Candidate is a non-archived, non-ephemeral CLI or VS Code thread that satisfies the requested cwd filter.
func List ¶
List collects all eligible pages and returns a globally newest-first, thread-ID-deduplicated slice.
func Pick ¶
Pick writes a numbered session list and reads a selection. Terminal detection and the choice of output stream belong to the caller.
func Read ¶
Read resolves an explicit thread ID through the non-archived list, then refreshes it with thread/read. This applies the same source, cwd, ephemeral, and archive eligibility contract as interactive selection while retaining a current status and ancestry snapshot for adoption.
type Client ¶
type Client interface {
ThreadList(context.Context, appserver.ThreadListParams) (appserver.ThreadListResponse, error)
ThreadRead(context.Context, appserver.ThreadReadParams) (appserver.ThreadReadResponse, error)
}
Client is the read-only app-server surface used for session discovery.
type Options ¶
Options defines the sessions eligible for selection. By default, CWD is an exact project-directory filter. AllCWDs suppresses that filter.