copilotvscodeevent

package
v1.48.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package copilotvscodeevent owns Local admission, fixed informational copy and private observation claims. Installed policy/effect composition belongs to N2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	InstallationID, BindingID, ProfileIdentity, Product string
	Generation                                          uint64
}

Binding comes exclusively from trusted host installation state. Event data never chooses any of these identities, generation or product authority.

type Channel

type Channel string
const (
	DesktopChannel Channel = "desktop"
	WebhookChannel Channel = "webhook"
)

type Channels

type Channels struct{ Desktop, Webhook bool }

type Consumer

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

Desktop is likewise an effect owner; macOS already owns its helper lease. Consumer never wraps either effect owner in a second lease.

func (Consumer) Consume

func (c Consumer) Consume(parent context.Context, f source.Facts, d notification.Deadline) (out Receipt)

Consume uses exactly the pre-stdin Admission deadline. Claim is persisted and its lock released before Recheck/effects. Missing session skips shared claims.

type Gate

type Gate interface {
	Channels(context.Context, Binding) Channels
	Recheck(context.Context, Binding, Channel) bool
}

Gate denies unknown/missing policy. Effect owners independently Recheck under their single retained lease; it must not acquire another lease recursively.

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 reports boundary acceptance, never visibility. Causes/IDs stay private.

type WebhookSender

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

WebhookSender is an effect-owner seam: acquire its retained installation/policy lease and Recheck before NewWithContext(ctx). Consumer supplies the no-redirect context. No retry/fallback/legacy route.

Jump to

Keyboard shortcuts

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