opencode

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package opencode decodes the neutral OpenCode observer wire. It does not implement OpenCode's native event types or any notification policy.

Index

Constants

View Source
const (
	Version  = 1
	MaxBytes = 4096
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string
const (
	TurnIdleVerified Kind = "turn_idle_verified"
	QuestionAsked    Kind = "question_asked"
	PermissionAsked  Kind = "permission_asked"
	TerminalError    Kind = "terminal_error"
	Unknown          Kind = "unknown"
)

type ObservedEvent

type ObservedEvent struct {
	Version     int    `json:"version"`
	Kind        Kind   `json:"kind"`
	SessionID   string `json:"sessionID,omitempty"`
	TurnID      string `json:"turnID,omitempty"`
	MessageID   string `json:"messageID,omitempty"`
	RequestID   string `json:"requestID,omitempty"`
	NativeType  string `json:"nativeType,omitempty"`
	RootSession *bool  `json:"rootSession,omitempty"`
}

func Decode

func Decode(data []byte) (ObservedEvent, error)

Decode accepts additive fields and unfamiliar event kinds within wire v1. Consumers must ignore Unknown; a changed required shape needs a new version.

Jump to

Keyboard shortcuts

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