localactivity

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 17 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 localactivity observes bounded local harness metadata. It does not send samples, control a session, install hooks, or retain message content.

Index

Constants

View Source
const (
	Unknown         = "unknown"
	Working         = "working"
	Idle            = "idle"
	ClaudeSessionV1 = "claude-session-v1"
	CodexRolloutV1  = "codex-rollout-v1"
	// CodexTaskPairV1 trusts only explicit same-turn start/complete pairs.
	// Producer versions are evidence, not a compatibility gate.
	CodexTaskPairV1 = "codex-task-pair-v1"
)

Variables

This section is empty.

Functions

func CodexTurnEnded

func CodexTurnEnded(ctx context.Context, config Config, turnID string) bool

CodexTurnEnded proves only the latest explicit same-turn terminal pair. It keeps no activity cache and never uses wall-clock time as end evidence.

func HomeRoot added in v1.2.1

func HomeRoot(root string) string

HomeRoot rejects traversal before lexical normalization can hide a symlink parent.

Types

type Binding

type Binding struct {
	Harness, SessionID, ClientID, RegistrationID, LeaseID string
	Generation                                            uint64
}

Binding must come from the client's current authenticated lease, not MCP arguments. A new lease or process identity requires a new Observer.

type Config

type Config struct {
	Binding                   Binding
	Home, CWD, Host, Platform string
	PID                       int
	// Format is deliberately empty by default. Callers may select a format
	// only after validating it against their installed harness version.
	RuntimeInfo bool
	Format      string
	Probe       func(context.Context, int) (Process, error)
	Now         func() time.Time
}

type Observation

type Observation struct {
	Model, Effort         string
	State, Source, Reason string
	Sequence              uint64
	ObservedAt, ChangedAt time.Time
}

Observation is safe to map to protocol fields. No path, PID, turn ID, raw error, token, or content is returned.

type Observer

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

func New

func New(config Config) *Observer

func (*Observer) Observe

func (o *Observer) Observe(ctx context.Context, current Binding) (out Observation)

type Process

type Process struct{ Key, RecordStart, Host, Platform string }

Process contains only process-creation metadata. RecordStart is the native creation value in the harness file's verified encoding; empty means unknown.

Jump to

Keyboard shortcuts

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