This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-9p/session/core.go

56 lines
1.5 KiB
Go

package session
import (
"context"
"github.com/simonfxr/pubsub"
agent "ollie/session"
"ollie/backend"
)
// Core is the interface that a session implementation must satisfy.
// Defined here (at the consumer) rather than in ollie/session so that
// the core package exports only a concrete struct with no interface overhead.
// Tests can substitute a lightweight stub.
type Core interface {
Submit(ctx context.Context, input string)
Interrupt(cause error) bool
Inject(prompt string)
Queue(prompt string)
PopQueue() (string, bool)
Bus() *pubsub.Bus
IsRunning() bool
State() string
Reply() string
AgentName() string
BackendName() string
ModelName() string
CWD() string
SetCWD(dir string) error
SetSessionID(newID string) error
Context() []backend.Message
SystemPrompt() string
GenerationParams() backend.GenerationParams
SetGenerationParams(params backend.GenerationParams) error
CompactionModel() string
SetCompactionModel(model string)
Usage() string
Cost() string
CtxSz() string
ListModels() string
WaitChange(ctx context.Context, field, current string) (string, bool)
SaveSession(path string) error
Close()
Detach() bool
ListDetached() []agent.DetachedInfo
SignalDetached(pid, signal int) error
GetDetachedOutput(pid int) (string, error)
DismissDetached(pid int) bool
InjectSystemEvent(content string)
React(emoji string)
ReactTo(responseID, emoji string) error
Reactions() map[string]string
ToolCallCount() int64
SetEnv(key, value string)
}