opencodeevent

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package opencodeevent consumes the bounded, neutral OpenCode observer wire. It never displays or forwards native event data or opaque identifiers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelGate

type ChannelGate interface {
	Channels(context.Context) (desktop, webhook bool)
}

ChannelGate binds a product setup decision to the same event observation. Legacy test gates retain their existing allow-all-channel behavior.

type Clock

type Clock interface {
	Now() (bootID string, seconds float64, err error)
}

type Consumer

type Consumer struct {
	Gate        Gate
	Config      *config.Config
	Desktop     notification.DeliveryPort
	Clock       Clock
	SendWebhook WebhookSender
}

func (Consumer) Consume

func (c Consumer) Consume(ctx context.Context, input io.Reader) Receipt

Consume reads exactly one bounded JSON object. Unknown v1 facts and subagent facts are intentionally silent. Delivery is at most once per call.

type Gate

type Gate interface{ Enabled(context.Context) bool }

Gate is the current, read-only opt-in and registration decision. A nil gate denies delivery. PR4 supplies the persisted implementation at composition.

type GateFunc

type GateFunc func(context.Context) bool

func (GateFunc) Enabled

func (f GateFunc) Enabled(ctx context.Context) bool

type Receipt

type Receipt struct {
	Status  string `json:"status"`
	Reason  string `json:"reason,omitempty"`
	Desktop string `json:"desktop,omitempty"`
	Webhook string `json:"webhook,omitempty"`
}

Receipt contains only stable classification. It never includes event IDs, raw data, transport errors, configuration, or remote response content.

type WebhookSender

type WebhookSender func(*config.Config, webhook.SendContext) error

WebhookSender allows a single, non-replayed external attempt.

Jump to

Keyboard shortcuts

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