hooks

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoSyncDue added in v0.22.0

func AutoSyncDue(skaelDir string, now time.Time) bool

AutoSyncDue reports whether the last sync recorded in state.json is older than 30 minutes, or missing.

func Binary added in v0.22.0

func Binary() (path string, onPath bool, err error)

Binary returns the skael path that hooks name, and whether it is the skael on PATH. The PATH entry wins when it is the running file, because a brew symlink or a Scoop shim keeps its path across an upgrade.

func Detach added in v0.22.0

func Detach(bin string, args ...string) error

Detach starts bin with args in a new session, detached from the agent's process tree and console, and does not wait for it.

func InstallAutoSyncForAgent added in v0.8.0

func InstallAutoSyncForAgent(agentName, configPath, bin string) error

InstallAutoSyncForAgent registers `skael hook autosync` with one agent.

func InstallForAgent

func InstallForAgent(agentName, configPath, bin string) error

InstallForAgent registers `skael hook report` with one agent.

func RemoveLegacyScripts added in v0.22.0

func RemoveLegacyScripts(skaelDir string)

RemoveLegacyScripts deletes the bash hook scripts older releases wrote.

func Repair added in v0.22.0

func Repair(agentName, configPath, bin string) error

Repair rewrites the skael hooks an agent already has that name another binary or an old script. It adds no hook the user did not install.

func Send added in v0.22.0

func Send(ev Event, skaelDir string) error

Send posts ev to the server in skaelDir's config.json. It runs in the detached child, so the agent never waits on the network or on the harness's --version.

func UninstallAutoSyncForAgent added in v0.8.0

func UninstallAutoSyncForAgent(agentName, configPath string) error

UninstallAutoSyncForAgent removes the auto-sync hook from one agent.

func UninstallForAgent

func UninstallForAgent(agentName, configPath string) error

UninstallForAgent removes the activation hook from one agent.

Types

type Event added in v0.22.0

type Event struct {
	SkillName      string `json:"skill_name"`
	Agent          string `json:"agent"`
	TriggerType    string `json:"trigger_type"`
	ProjectHash    string `json:"project_hash"`
	DeveloperHash  string `json:"developer_hash"`
	EventSource    string `json:"event_source"`
	Model          string `json:"model"`
	HarnessVersion string `json:"harness_version,omitempty"`
	Version        int    `json:"version"`
}

Event is one activation as POST /api/events receives it.

func Report added in v0.22.0

func Report(agent string, in io.Reader, skaelDir string) *Event

Report turns one hook payload into the activation to send, or nil when the payload is not a skill load. skaelDir holds config.json, state.json and the session files.

type HookState added in v0.22.0

type HookState struct {
	Activation, ActivationCurrent bool
	AutoSync, AutoSyncCurrent     bool
}

HookState says which skael hooks an agent's config holds, and whether each names bin with the current subcommand.

func State added in v0.22.0

func State(agentName, configPath, bin string) HookState

State reads an agent's config and reports its skael hooks.

Jump to

Keyboard shortcuts

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