sessions

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountByWorkspace

func CountByWorkspace(cwd string) int

CountByWorkspace returns the number of alive session markers attached to cwd.

func MarkerPath

func MarkerPath(sessionID string) string

MarkerPath returns the file path for a given session ID.

func Register

func Register(m Marker) error

Register persists m atomically (tmp+rename).

func SessionsDir

func SessionsDir() string

SessionsDir returns the directory holding session marker files.

func Unregister

func Unregister(sessionID string) error

Unregister deletes the marker file. Idempotent.

Types

type Marker

type Marker struct {
	SessionID    string    `json:"session_id"`
	WorkspaceCwd string    `json:"workspace_cwd"`
	ClaudePID    int       `json:"claude_pid"`
	StartedAt    time.Time `json:"started_at"`
}

Marker is a per-session record. One JSON file per Marker at ~/.bones/sessions/<SessionID>.json.

func ListByWorkspace

func ListByWorkspace(cwd string) []Marker

ListByWorkspace returns markers whose WorkspaceCwd matches the argument AND whose ClaudePID is alive on this host. Dead markers are unlinked as a side effect (orphan GC).

Jump to

Keyboard shortcuts

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