Help us shape the future of Go! Take the 2026 Go Developer Survey

vogon

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package vogon implements the Agent interface for a deterministic test agent used as an E2E canary. It exercises the full checkpoint/hook lifecycle without real API calls. Named after the Vogons from The Hitchhiker's Guide to the Galaxy — bureaucratic, procedural, and deterministic to a fault.

Index

Constants

View Source
const (
	HookNameSessionStart     = "session-start"
	HookNameSessionEnd       = "session-end"
	HookNameStop             = "stop"
	HookNameUserPromptSubmit = "user-prompt-submit"
)
View Source
const (
	// AgentNameVogon is the registry key for the vogon agent.
	AgentNameVogon types.AgentName = "vogon"
	// AgentTypeVogon is the type identifier stored in metadata.
	AgentTypeVogon types.AgentType = "Vogon Agent"
)

Variables

This section is empty.

Functions

func NewAgent

func NewAgent() agent.Agent

NewAgent creates a new vogon agent instance.

Types

type Agent

type Agent struct{}

Agent implements agent.Agent and agent.HookSupport for E2E canary tests.

func (*Agent) AreHooksInstalled

func (v *Agent) AreHooksInstalled(_ context.Context) bool

AreHooksInstalled returns false — vogon agent has no external hooks to install. The vogon binary fires hooks directly via `hawk trace hooks vogon <verb>`.

func (*Agent) ChunkTranscript

func (v *Agent) ChunkTranscript(_ context.Context, content []byte, maxSize int) ([][]byte, error)

func (*Agent) Description

func (v *Agent) Description() string

func (*Agent) DetectPresence

func (v *Agent) DetectPresence(_ context.Context) (bool, error)

DetectPresence returns false — vogon agent is never auto-detected.

func (*Agent) FormatResumeCommand

func (v *Agent) FormatResumeCommand(sessionID string) string

func (*Agent) GetSessionDir

func (v *Agent) GetSessionDir(_ string) (string, error)

func (*Agent) GetSessionID

func (v *Agent) GetSessionID(input *agent.HookInput) string

func (*Agent) HookNames

func (v *Agent) HookNames() []string

HookNames returns the hooks the vogon agent supports.

func (*Agent) InstallHooks

func (v *Agent) InstallHooks(_ context.Context, _ bool, _ bool) (int, error)

InstallHooks is a no-op — the vogon binary fires hooks directly.

func (*Agent) IsPreview

func (v *Agent) IsPreview() bool

func (*Agent) IsTestOnly

func (v *Agent) IsTestOnly() bool

IsTestOnly marks this agent as test-only, excluding it from `trace enable`.

func (*Agent) Name

func (v *Agent) Name() types.AgentName

func (*Agent) ParseHookEvent

func (v *Agent) ParseHookEvent(_ context.Context, hookName string, stdin io.Reader) (*agent.Event, error)

ParseHookEvent translates vogon agent hook JSON into a normalized lifecycle Event.

func (*Agent) ProtectedDirs

func (v *Agent) ProtectedDirs() []string

func (*Agent) ReadSession

func (v *Agent) ReadSession(input *agent.HookInput) (*agent.AgentSession, error)

func (*Agent) ReadTranscript

func (v *Agent) ReadTranscript(sessionRef string) ([]byte, error)

func (*Agent) ReassembleTranscript

func (v *Agent) ReassembleTranscript(chunks [][]byte) ([]byte, error)

func (*Agent) ResolveSessionFile

func (v *Agent) ResolveSessionFile(sessionDir, agentSessionID string) string

func (*Agent) Type

func (v *Agent) Type() types.AgentType

func (*Agent) UninstallHooks

func (v *Agent) UninstallHooks(_ context.Context) error

UninstallHooks is a no-op.

func (*Agent) WriteHookResponse

func (v *Agent) WriteHookResponse(message string) error

WriteHookResponse writes a plain text message to stdout.

func (*Agent) WriteSession

func (v *Agent) WriteSession(_ context.Context, session *agent.AgentSession) error

Jump to

Keyboard shortcuts

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