session

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 7 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 session stores per-worktree state in the git directory (never committed).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(p *project.Project, s *Session) error

Save writes the session.

Types

type Session

type Session struct {
	SchemaVersion int         `json:"schema_version"`
	ActiveTask    *string     `json:"active_task"`
	StartedAt     string      `json:"started_at,omitempty"`
	Tool          string      `json:"tool,omitempty"`
	LastCheck     *task.Check `json:"last_check,omitempty"`
	LastTask      string      `json:"last_task,omitempty"`
	LastTaskAt    string      `json:"last_task_at,omitempty"`
}

Session mirrors schemas/session.schema.json.

func Load

func Load(p *project.Project) *Session

Load returns the most recently written session among the state locations (a sandboxed tool may only be able to write the fallback), or an empty one.

func (*Session) Active

func (s *Session) Active() string

Active returns the active task ID, or "".

func (*Session) CommitTask

func (s *Session) CommitTask(now time.Time) string

CommitTask is the task a commit belongs to: the active one, else one closed in the last hour (agents usually commit right after closing).

func (*Session) SetActive

func (s *Session) SetActive(id, at, tool string)

SetActive sets or clears the active task.

Jump to

Keyboard shortcuts

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