codexsource

package
v1.45.17 Latest Latest
Warning

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

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

Documentation

Overview

Package codexsource is the only product package that imports plugin-kit-ai/sdk. It adapts one pre-read Codex hook payload into plain host DTOs; it never classifies, notifies, or touches product policy.

Index

Constants

View Source
const MaxPayloadBytes = pluginkitai.MaxPayloadBytes

MaxPayloadBytes re-exports the SDK's single wire limit so the rest of the product never imports the SDK or duplicates the number.

Variables

This section is empty.

Functions

func InvocationForEvent

func InvocationForEvent(publicEvent string) (string, bool)

InvocationForEvent maps the validated public event name to the prefixed SDK invocation name.

func ValidateProductOverride

func ValidateProductOverride(override string) (string, error)

ValidateProductOverride validates an explicit --product override through the SDK host detector. An unknown override is an error, never an arbitrary platform; detection fails closed.

Types

type Decoded

type Decoded struct {
	Stop              *StopData
	SubagentStop      *SubagentStopData
	PreToolUse        *PreToolUseData
	PermissionRequest *PermissionRequestData
}

Decoded holds exactly one non-nil DTO for the dispatched event.

func Decode

func Decode(ctx context.Context, publicEvent string, payload []byte) (Decoded, error)

Decode dispatches the payload through the SDK with synthetic argv and in-memory IO and returns the typed host DTO. Any SDK failure is an error; the caller owns the fail-open observation contract.

type PermissionRequestData

type PermissionRequestData struct {
	SessionID      string
	TurnID         string
	TranscriptPath string
	CWD            string
	HookEventName  string
	Model          string
	PermissionMode string
	ToolName       string
	ToolInput      json.RawMessage
	AgentID        string
	AgentType      string
}

PermissionRequestData mirrors the decoded Codex PermissionRequest payload.

type PreToolUseData

type PreToolUseData struct {
	SessionID      string
	TurnID         string
	TranscriptPath string
	CWD            string
	HookEventName  string
	Model          string
	PermissionMode string
	ToolName       string
	ToolInput      json.RawMessage
	ToolUseID      string
	AgentID        string
	AgentType      string
}

PreToolUseData mirrors the decoded Codex PreToolUse payload.

type StopData

type StopData struct {
	SessionID            string
	TurnID               string
	TranscriptPath       string
	CWD                  string
	HookEventName        string
	Model                string
	PermissionMode       string
	StopHookActive       bool
	LastAssistantMessage string
}

StopData mirrors the decoded Codex Stop payload without exposing SDK types.

type SubagentStopData

type SubagentStopData struct {
	Stop                StopData
	AgentID             string
	AgentType           string
	AgentTranscriptPath string
}

SubagentStopData mirrors the decoded Codex SubagentStop payload.

Jump to

Keyboard shortcuts

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