Documentation
¶
Index ¶
- Constants
- func AppendLine(spoolDir, sessionID string, l Line) error
- func DropSpool(spoolDir, sessionID string, n int64) error
- func HookCommand(xisCmd, event string) string
- func Install(path, xisCmd string) ([]string, error)
- func Installed(path string) (map[string]bool, error)
- func IsHome(dir string) bool
- func LockIngest(spoolDir, sessionID string, timeout time.Duration) (*lockfile.Lock, error)
- func LockSession(spoolDir, sessionID string, timeout time.Duration) (*lockfile.Lock, error)
- func RemoveSpool(spoolDir, sessionID string) error
- func SettingsPath(scope, repoDir, home string) (string, error)
- func SpawnIngest(sessionID string) error
- func SpoolPath(spoolDir, sessionID string) string
- func Uninstall(path string) ([]string, error)
- type Handler
- type Line
- type RepoInfo
- type SpoolFile
Constants ¶
const NoSpawnEnv = "XIS_NO_ASYNC_INGEST"
const SpoolVersion = 1
Variables ¶
This section is empty.
Functions ¶
func AppendLine ¶
func DropSpool ¶
DropSpool removes the first n bytes that TakeSpool returned. Hooks only append, so the lines written after TakeSpool stay for the next ingest.
func HookCommand ¶
func Install ¶
Install merges the xis hooks into a Claude Code settings file. It keeps all other settings and hooks, and it does not add an entry twice.
func IsHome ¶
IsHome reports whether dir is the home directory. A git repository there holds all files of the user, so xis neither installs project hooks for it nor takes snapshots of it.
func LockIngest ¶
LockIngest lets one ingest of a session run at a time. Hooks never take it.
func LockSession ¶
LockSession serializes ingest with the hooks of the same session.
func RemoveSpool ¶
RemoveSpool deletes the spool file. It keeps the lock files: another process can hold them, and a new file would give a second lock holder.
func SettingsPath ¶
func SpawnIngest ¶
Types ¶
type Handler ¶
type Line ¶
type Line struct {
V int `json:"xis_v"`
Ts time.Time `json:"ts"`
Event string `json:"event"`
Payload json.RawMessage `json:"payload"`
Snapshot *string `json:"snapshot"`
Repo *RepoInfo `json:"repo,omitempty"`
NoGit bool `json:"no_git,omitempty"`
SnapshotError string `json:"snapshot_error,omitempty"`
}
func TakeSpool ¶
TakeSpool reads the spool of a session under the session lock and returns its lines and its size. The lock is held only for the read, so the hooks of a running session never wait for an ingest.