adapter

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIAdapter

type CLIAdapter struct {
	Args    []string
	Context context.Context
	Stdout  io.Writer
	Stderr  io.Writer
}

func (CLIAdapter) Adapt

func (a CLIAdapter) Adapt() (*RawInput, error)

type CommandInvocation

type CommandInvocation struct {
	Path  []string
	Args  []string
	Flags map[string]any
}

type DefaultMaterializer

type DefaultMaterializer struct{}

func (DefaultMaterializer) Materialize

func (m DefaultMaterializer) Materialize(params map[string]any) []string

type EntrypointAdapter

type EntrypointAdapter interface {
	Adapt() (*RawInput, error)
}

type IOMode

type IOMode int
const (
	IOModeTTY IOMode = iota
	IOModeStructured
	IOModeProgrammatic
)

type InputMaterializer

type InputMaterializer interface {
	Materialize(params map[string]any) []string
}

type InputSourceMeta

type InputSourceMeta struct {
	Channel string
	Command string
	Product string
	Version string
}

type RawInput

type RawInput struct {
	Args    []string
	Env     map[string]string
	Context context.Context
	IOMode  IOMode
	Source  InputSourceMeta
	Stdout  io.Writer
	Stderr  io.Writer
}

type SDKAdapter

type SDKAdapter struct {
	Invocation   *CommandInvocation
	Context      context.Context
	Materializer InputMaterializer
}

func (SDKAdapter) Adapt

func (a SDKAdapter) Adapt() (*RawInput, error)

type StructuredAdapter

type StructuredAdapter struct {
	Request      *StructuredCommandRequest
	Materializer InputMaterializer
}

func (StructuredAdapter) Adapt

func (a StructuredAdapter) Adapt() (*RawInput, error)

type StructuredCommandRequest

type StructuredCommandRequest struct {
	Path   []string
	Params map[string]any
}

Jump to

Keyboard shortcuts

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