Documentation
¶
Overview ¶
Package hints provides a system for showing helpful suggestions to users, particularly for multi-agent workflows where Claude sessions need to understand inter-session communication protocols.
Index ¶
Constants ¶
const ( // PrimeInterval is how often to suggest running prime for multi-agent workflows. PrimeInterval = 7 * 24 * time.Hour // 1 week // FirstRunGracePeriod is how long before showing prime hint to new users. FirstRunGracePeriod = 1 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func CheckAndShowHints ¶
func CheckAndShowHints() bool
CheckAndShowHints checks if any hints should be shown and prints them. Returns true if any hints were shown.
func GetCurrentPrimeVersion ¶
func GetCurrentPrimeVersion() string
GetCurrentPrimeVersion returns the current prime content version.
func GetVersionHash ¶
func GetVersionHash() string
GetVersionHash returns a hash of the current binary's build info. This changes when the binary is rebuilt/updated.
func PrimeHintMessage ¶
PrimeHintMessage returns the hint message for running prime.
func SetPrimeVersionFunc ¶
func SetPrimeVersionFunc(f func() string)
SetPrimeVersionFunc sets the function to get the current prime version. Call this from main to wire up the prime package.
Types ¶
type HintState ¶
type HintState struct {
PrimeShownAt *time.Time `json:"prime_shown_at,omitempty"`
QuickstartShown *time.Time `json:"quickstart_shown_at,omitempty"`
LastCommandRunAt *time.Time `json:"last_command_run_at,omitempty"`
LastVersionHash string `json:"last_version_hash,omitempty"` // Hash of binary version info
LastPrimeVersion string `json:"last_prime_version,omitempty"` // Hash of prime message content
}
HintState tracks when hints were last shown.
func (*HintState) MarkCommandRun ¶
func (s *HintState) MarkCommandRun()
MarkCommandRun records that a command was run.
func (*HintState) MarkPrimeShown ¶
func (s *HintState) MarkPrimeShown()
MarkPrimeShown records that prime was shown.
func (*HintState) MarkQuickstartShown ¶
func (s *HintState) MarkQuickstartShown()
MarkQuickstartShown records that quickstart was shown.
func (*HintState) PrimeContentChanged ¶
PrimeContentChanged returns true if the prime message content has changed.
func (*HintState) ShouldShowPrimeHint ¶
ShouldShowPrimeHint returns true if the prime hint should be shown. This happens when: - Prime has never been shown, OR - It's been more than PrimeInterval since prime was last shown - The binary version has changed since last prime - The prime content has changed since last seen AND the user has been using it2 for at least FirstRunGracePeriod
func (*HintState) VersionChanged ¶
VersionChanged returns true if the binary version has changed since last run.