Help us shape the future of Go! Take the 2026 Go Developer Survey

sessionactivity

package
v0.0.204 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sessionactivity reports the live phase of an agent session.

Eluc (and any other caller) should use Read rather than re-implementing per-runner log scans. Kinds are idle, thinking, responding, tool_calling, and error.

Index

Constants

View Source
const (
	RunnerDSH   = "dsh"
	RunnerGrok  = "grok"
	RunnerCodex = "codex"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string

Kind is the live phase of one session.

const (
	Idle        Kind = "idle"
	Thinking    Kind = "thinking"
	Responding  Kind = "responding"
	ToolCalling Kind = "tool_calling"
	ErrorKind   Kind = "error"
)

func ClassifyChat

func ClassifyChat(lastKind, tool string, live bool) (Kind, string)

ClassifyChat maps a grok/codex last coalesced message onto the five activity kinds. live is PID liveness, not "the TUI is still open".

type Probe

type Probe struct {
	DSH   func(sessionID string) (Snapshot, error)
	Grok  func(sessionID string) (Snapshot, error)
	Codex func(sessionID string) (Snapshot, error)
}

Probe is the injectable entry point. Nil fields use the live agent homes.

func Default

func Default() Probe

Default is the production probe. Tests replace fields.

func (Probe) Follow

func (p Probe) Follow(runner, sessionID string, afterSeq int64, tail int) (Snapshot, []dshsessions.TranscriptRow, error)

Follow returns activity plus a committed transcript tail.

func (Probe) Read

func (p Probe) Read(runner, sessionID string) (Snapshot, error)

Read reports one session's activity.

type Snapshot

type Snapshot struct {
	Runner    string `json:"runner"`
	SessionID string `json:"session_id"`
	Kind      Kind   `json:"kind"`
	Detail    string `json:"detail,omitempty"`
	Live      bool   `json:"live"`
	Workspace string `json:"workspace,omitempty"`
	Title     string `json:"title,omitempty"`
	UpdatedAt int64  `json:"updated_at,omitempty"`
	Outcome   string `json:"outcome,omitempty"`
}

Snapshot is one session's current phase plus durable facts the caller already needed for display.

func Follow

func Follow(runner, sessionID string, afterSeq int64, tail int) (Snapshot, []dshsessions.TranscriptRow, error)

Follow returns activity plus a committed transcript tail.

func Read

func Read(runner, sessionID string) (Snapshot, error)

Read reports one session's activity using the production probe.

Jump to

Keyboard shortcuts

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