Documentation
¶
Overview ¶
Package opencode captures callback objects from the pinned OpenCode plugin contract without treating the serialized object as a native wire stream.
Package opencode captures callback objects from the pinned OpenCode plugin contract without treating the serialized object as a native wire stream.
Code generated by hostcontractgen. DO NOT EDIT.
Code generated by hostcontractgen. DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capture ¶
type Capture struct {
Digest digest.Digest
Disposition model.CaptureDisposition
Cause model.CaptureCause
Delivery receipt.Delivery
}
func Parse ¶
func Parse(raw []byte, event registration.Event, observedVersion string, envelope model.OccurrenceEnvelopeRef) Capture
Parse captures the JSON serialization of the in-process callback object. The shared refusals run first, through ingress.Validate, so a malformed payload is refused with the same disposition on every harness. The selected event determines the provider-specific identity paths.
func ParseV2 ¶ added in v0.0.9
func ParseV2(raw []byte, event registration.Event, observedVersion string, envelope model.OccurrenceEnvelopeRef) Capture
ParseV2 captures the JSON serialization of a 2.0.20 hook input or bus event. The 2.0.20 plugin forwards each hook input verbatim, so every hook payload below is a flat object: session hooks carry a top-level sessionID, both tool hooks carry sessionID plus the call id, the permission evaluation carries sessionID, and the shell hook carries no identity at all. The session.created bus event instead wraps its payload in data, following the durable envelope in packages/schema/src/event.ts at the 2.0.20 tag, so its sessionID and version ride at data.sessionID and data.version where the 1.18.29 contract carried event.properties.sessionID.
The shared refusals run first, through ingress.Validate, so a malformed payload is refused with the same disposition on every harness and every OpenCode contract version. The selected event determines the provider-specific identity paths.