heartbeat

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package heartbeat implements the ctx system heartbeat subcommand.

It sends a heartbeat webhook on every prompt for continuous session-alive visibility, without producing any agent-visible output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx system heartbeat" subcommand.

Returns:

  • *cobra.Command: Configured heartbeat subcommand

func Run

func Run(_ *cobra.Command, stdin *os.File) error

Run executes the heartbeat hook logic.

Increments a per-session prompt counter, detects context file modifications since the last heartbeat, reads token usage, and emits a notification plus event log entry. Produces no stdout output; the agent never sees this hook.

Parameters:

  • cmd: Cobra command (unused, heartbeat produces no output)
  • stdin: standard input for hook JSON

Returns:

  • error: Always nil (hook errors are non-fatal)

Types

This section is empty.

Jump to

Keyboard shortcuts

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