pluginruntime

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalHonchoAPIKeySentinel = "local"

	GonchoConfigBaseURLInvalid = "goncho_config_base_url_invalid"
	GonchoConfigLocalBaseURL   = "goncho_config_local_base_url"
)
View Source
const (
	GonchoWriteFlushed     = "goncho_write_flushed"
	GonchoWriteDeferred    = "goncho_write_deferred"
	GonchoWriteQueued      = "goncho_write_queued"
	GonchoWriteFlushFailed = "goncho_write_flush_failed"

	GonchoAsyncEnqueued    = "goncho_async_enqueued"
	GonchoAsyncFlushed     = "goncho_async_flushed"
	GonchoAsyncRetry       = "goncho_async_retry"
	GonchoAsyncFlushFailed = "goncho_async_flush_failed"
	GonchoAsyncShutdown    = "goncho_async_shutdown"
	GonchoAsyncClosed      = "goncho_async_closed"
)

Variables

This section is empty.

Functions

func ResolvePluginSessionName

func ResolvePluginSessionName(cfg PluginConfig, input SessionNameInput) string

Types

type ConfigEvidence

type ConfigEvidence struct {
	Code    string `json:"code"`
	Source  string `json:"source,omitempty"`
	Message string `json:"message,omitempty"`
}

type PluginAsyncResult

type PluginAsyncResult struct {
	Code     string
	Flushed  int
	Pending  int
	Evidence []string
}

func (PluginAsyncResult) HasEvidence

func (r PluginAsyncResult) HasEvidence(code string) bool

type PluginAsyncWriter

type PluginAsyncWriter struct {
	// contains filtered or unexported fields
}

func NewPluginAsyncWriter

func NewPluginAsyncWriter(flusher PluginSessionFlusher) *PluginAsyncWriter

func (*PluginAsyncWriter) Cache

func (w *PluginAsyncWriter) Cache(session PluginMemorySession)

func (*PluginAsyncWriter) Enqueue

func (*PluginAsyncWriter) FlushAll

func (w *PluginAsyncWriter) FlushAll() PluginAsyncResult

func (*PluginAsyncWriter) Shutdown

func (w *PluginAsyncWriter) Shutdown() PluginAsyncResult

type PluginConfig

type PluginConfig struct {
	Host              string
	WorkspaceID       string
	APIKey            string
	APIKeySource      string
	Environment       string
	BaseURL           string
	PeerName          string
	AIPeer            string
	PinPeerName       bool
	Enabled           bool
	SaveMessages      bool
	WriteFrequency    PluginWriteFrequency
	SessionStrategy   string
	SessionPeerPrefix bool
	Sessions          map[string]string
	Raw               map[string]any
	Evidence          []ConfigEvidence
}

func ResolvePluginConfig

func ResolvePluginConfig(input PluginConfigInput) PluginConfig

func (PluginConfig) HasEvidence

func (c PluginConfig) HasEvidence(code string) bool

type PluginConfigInput

type PluginConfigInput struct {
	Host string
	Raw  map[string]any
	Env  map[string]string
}

type PluginMemoryMessage

type PluginMemoryMessage struct {
	Role    string
	Content string
	Synced  bool
}

type PluginMemorySession

type PluginMemorySession struct {
	Key             string
	UserPeerID      string
	AssistantPeerID string
	HonchoSessionID string
	Messages        []PluginMemoryMessage
}

type PluginPeerInput

type PluginPeerInput struct {
	Config              PluginConfig
	RuntimeUserPeerName string
	SessionKey          string
}

type PluginPeerResolution

type PluginPeerResolution struct {
	UserPeerID      string
	AssistantPeerID string
}

func ResolvePluginPeerNames

func ResolvePluginPeerNames(input PluginPeerInput) PluginPeerResolution

type PluginSessionFlusher

type PluginSessionFlusher interface {
	FlushPluginSession(PluginMemorySession) error
}

type PluginSessionFlusherFunc

type PluginSessionFlusherFunc func(PluginMemorySession) error

func (PluginSessionFlusherFunc) FlushPluginSession

func (f PluginSessionFlusherFunc) FlushPluginSession(session PluginMemorySession) error

type PluginWriteFrequency

type PluginWriteFrequency struct {
	Mode  WriteFrequencyMode
	Every int
	Raw   string
}

func ParsePluginWriteFrequency

func ParsePluginWriteFrequency(raw any) PluginWriteFrequency

type PluginWriteResult

type PluginWriteResult struct {
	Code     string
	Evidence []string
}

type PluginWriteRouter

type PluginWriteRouter struct {
	// contains filtered or unexported fields
}

func NewPluginWriteRouter

func NewPluginWriteRouter(cfg PluginWriteRouterConfig) *PluginWriteRouter

func (*PluginWriteRouter) Save

type PluginWriteRouterConfig

type PluginWriteRouterConfig struct {
	Frequency   PluginWriteFrequency
	Flusher     PluginSessionFlusher
	AsyncWriter *PluginAsyncWriter
}

type SessionNameInput

type SessionNameInput struct {
	CWD               string
	Title             string
	SessionID         string
	GatewaySessionKey string
}

type WriteFrequencyMode

type WriteFrequencyMode string
const (
	WriteFrequencyInvalid WriteFrequencyMode = "invalid"
	WriteFrequencyAsync   WriteFrequencyMode = "async"
	WriteFrequencyTurn    WriteFrequencyMode = "turn"
	WriteFrequencySession WriteFrequencyMode = "session"
	WriteFrequencyEvery   WriteFrequencyMode = "every"
)

Jump to

Keyboard shortcuts

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