hookclient

package
v0.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package hookclient provides a gRPC client for the local agentd daemon.

Owns: dial transport, HookService/ConfigService/SessionService RPC wrappers. Must not: hook wire decode/encode (hookedge).

Entry: Dial, DialReady, Client.Invoke, Client.Subscribe, Client.Health. See DESIGN.md §1.5 (invoke_sync, async_side).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps daemon, hook, config, and session service clients.

func Dial

func Dial(ctx context.Context, socket string) (*Client, error)

Dial connects to the daemon socket. Note: gRPC dial is lazy — prefer DialReady on the hook path when the process must fail closed/open immediately if the daemon is unreachable.

func DialReady added in v0.0.3

func DialReady(ctx context.Context, socket string) (*Client, error)

DialReady dials and confirms Health. Use on the hook hot path so an unreachable daemon is detected before the first Invoke (grpc.NewClient connects lazily).

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying connection.

func (*Client) GetConfig

GetConfig fetches a config layer from the daemon.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (*agentdv1.HealthResponse, error)

Health returns daemon health.

func (*Client) Invoke

Invoke sends a hook invocation.

func (*Client) PatchConfig

PatchConfig applies a runtime overlay patch on the daemon.

func (*Client) RecordDecision

RecordDecision records an approval in the runtime overlay.

func (*Client) Reload

Reload reloads config on the daemon.

func (*Client) Shutdown

func (c *Client) Shutdown(ctx context.Context) error

Shutdown requests daemon shutdown.

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*agentdv1.StatusResponse, error)

Status returns daemon status.

func (*Client) Subscribe

Subscribe opens a live trajectory event stream from the daemon.

Jump to

Keyboard shortcuts

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