runtime

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureSessionImageAssets

func EnsureSessionImageAssets(sess *session.Session)

func ExtractLineRange

func ExtractLineRange(content string, startLine, endLine int) string

func IsUnavailableError

func IsUnavailableError(err error) bool

func NextSessionImageID

func NextSessionImageID(sess *session.Session) int

func NormalizeProviderType

func NormalizeProviderType(value string) (string, bool)

func ResolvePastedLineReference

func ResolvePastedLineReference(input string, state PastedState) (string, error)

func ResolvePastedSelection

func ResolvePastedSelection(state PastedState, pasteID, startLineStr, endLineStr string) (string, error)

func ResolveSessionID

func ResolveSessionID(summaries []session.Summary, prefix string) (string, error)

Types

type ActiveSkill

type ActiveSkill struct {
	Name  string
	Scope string
	Args  map[string]string
}

type CompactSessionResult

type CompactSessionResult struct {
	Summary string
	Changed bool
}

type Dependencies

type Dependencies struct {
	Runner     *agent.Runner
	Store      *session.Store
	ImageStore assets.ImageStore
	Workspace  string
}

type FileType added in v1.0.1

type FileType int
const (
	FileTypeImage FileType = iota
	FileTypeText
	FileTypePDF
	FileTypeBinary
	FileTypeUnknown
)

type ImagePayload

type ImagePayload struct {
	MediaType string
	Data      []byte
}

type PastedContent

type PastedContent struct {
	ID      string    `json:"id"`
	Content string    `json:"content"`
	Lines   int       `json:"lines"`
	Time    time.Time `json:"time"`
	Preview string    `json:"preview"`
}

func FindPastedContent

func FindPastedContent(state PastedState, pasteID string) (PastedContent, bool)

type PastedState

type PastedState struct {
	NextID   int
	Order    []string
	Contents map[string]PastedContent
}

type Service

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

func NewService

func NewService(deps Dependencies) *Service

func (*Service) ActivateSkill

func (s *Service) ActivateSkill(sess *session.Session, name string, args map[string]string) (SkillActivation, error)

func (*Service) ApplyStartupField

func (s *Service) ApplyStartupField(req StartupFieldRequest) (StartupFieldResult, error)

func (*Service) ClearActiveSkill

func (s *Service) ClearActiveSkill(sess *session.Session) (SkillClearResult, error)

func (*Service) CompactSession

func (s *Service) CompactSession(sess *session.Session) (CompactSessionResult, error)

func (*Service) DeleteSkill

func (s *Service) DeleteSkill(sess *session.Session, name string) (SkillDeleteResult, error)

func (*Service) EnsureSessionImageAssets

func (s *Service) EnsureSessionImageAssets(sess *session.Session)

func (*Service) FindSessionAssetByImageID

func (s *Service) FindSessionAssetByImageID(sess *session.Session, imageID int) (StoredImageRef, bool)

func (*Service) HydrateHistoricalAssets

func (s *Service) HydrateHistoricalAssets(sess *session.Session, current map[string]ImagePayload) map[string]ImagePayload

func (*Service) ListSessions

func (s *Service) ListSessions(limit int) ([]session.Summary, error)

func (*Service) LoadPastedContents

func (s *Service) LoadPastedContents(sess *session.Session) (PastedState, error)

func (*Service) LoadRecentPrompts

func (s *Service) LoadRecentPrompts(limit int) ([]history.PromptEntry, error)

func (*Service) LoadSessionImageAsset

func (s *Service) LoadSessionImageAsset(sess *session.Session, assetID string) (assets.ImageBlob, error)

func (*Service) LoadSkillCatalog

func (s *Service) LoadSkillCatalog(sess *session.Session) (SkillCatalog, error)

func (*Service) NewSession

func (s *Service) NewSession(workspace string) (*session.Session, error)

func (*Service) NextSessionImageID

func (s *Service) NextSessionImageID(sess *session.Session) int

func (*Service) PutSessionImage

func (s *Service) PutSessionImage(sess *session.Session, imageID int, mediaType, fileName string, data []byte) (StoredImage, error)

func (*Service) PutSessionImageFromPath

func (s *Service) PutSessionImageFromPath(sess *session.Session, imageID int, path string) (StoredImage, error)

func (*Service) ResumeSession

func (s *Service) ResumeSession(workspace, id string) (*session.Session, error)

func (*Service) RunPromptWithInput

func (s *Service) RunPromptWithInput(ctx context.Context, sess *session.Session, prompt agent.RunPromptInput, mode string, sink io.Writer) error

func (*Service) SavePastedContents

func (s *Service) SavePastedContents(sess *session.Session, state PastedState) error

func (*Service) SaveSession

func (s *Service) SaveSession(sess *session.Session) error

func (*Service) VerifyStartupAPIKey

func (s *Service) VerifyStartupAPIKey(req StartupVerifyRequest) (StartupVerifyResult, error)

type SkillActivation

type SkillActivation struct {
	Name       string
	Scope      string
	EntrySlash string
	ToolPolicy string
	Args       map[string]string
}

type SkillCatalog

type SkillCatalog struct {
	Active      *ActiveSkill
	Items       []SkillDescriptor
	Diagnostics []SkillDiagnostic
}

type SkillClearResult

type SkillClearResult struct {
	PreviousName string
	HadActive    bool
}

type SkillDeleteResult

type SkillDeleteResult struct {
	Name          string
	Dir           string
	ClearedActive bool
}

type SkillDescriptor

type SkillDescriptor struct {
	Name        string
	Scope       string
	Description string
	Slash       string
	Aliases     []string
	ToolPolicy  string
}

type SkillDiagnostic

type SkillDiagnostic struct {
	Level   string
	Skill   string
	Path    string
	Message string
}

type StartupFieldRequest

type StartupFieldRequest struct {
	Field      string
	Value      string
	ConfigPath string
	Provider   config.ProviderConfig
}

type StartupFieldResult

type StartupFieldResult struct {
	ConfigPath string
	Provider   config.ProviderConfig
}

type StartupVerifyRequest

type StartupVerifyRequest struct {
	APIKey     string
	ConfigPath string
	Provider   config.ProviderConfig
}

type StartupVerifyResult

type StartupVerifyResult struct {
	ConfigPath  string
	Provider    config.ProviderConfig
	Ready       bool
	Check       provider.Availability
	WrittenPath string
	SaveErr     error
}

type StoredImage

type StoredImage struct {
	AssetID   llm.AssetID
	ImageID   int
	MediaType string
	FileName  string
	CachePath string
	ByteSize  int64
	Width     int
	Height    int
}

type StoredImageRef

type StoredImageRef struct {
	AssetID llm.AssetID
	Meta    session.ImageAssetMeta
}

type UIAPI

type UIAPI interface {
	LoadSkillCatalog(sess *session.Session) (SkillCatalog, error)
	ActivateSkill(sess *session.Session, name string, args map[string]string) (SkillActivation, error)
	ClearActiveSkill(sess *session.Session) (SkillClearResult, error)
	DeleteSkill(sess *session.Session, name string) (SkillDeleteResult, error)
	NewSession(workspace string) (*session.Session, error)
	ResumeSession(workspace, id string) (*session.Session, error)
	SaveSession(sess *session.Session) error
	ListSessions(limit int) ([]session.Summary, error)
	LoadRecentPrompts(limit int) ([]history.PromptEntry, error)
	CompactSession(sess *session.Session) (CompactSessionResult, error)
	ApplyStartupField(req StartupFieldRequest) (StartupFieldResult, error)
	VerifyStartupAPIKey(req StartupVerifyRequest) (StartupVerifyResult, error)
	EnsureSessionImageAssets(sess *session.Session)
	NextSessionImageID(sess *session.Session) int
	PutSessionImage(sess *session.Session, imageID int, mediaType, fileName string, data []byte) (StoredImage, error)
	PutSessionImageFromPath(sess *session.Session, imageID int, path string) (StoredImage, error)
	FindSessionAssetByImageID(sess *session.Session, imageID int) (StoredImageRef, bool)
	LoadSessionImageAsset(sess *session.Session, assetID string) (assets.ImageBlob, error)
	HydrateHistoricalAssets(sess *session.Session, current map[string]ImagePayload) map[string]ImagePayload
	LoadPastedContents(sess *session.Session) (PastedState, error)
	SavePastedContents(sess *session.Session, state PastedState) error
	RunPromptWithInput(ctx context.Context, sess *session.Session, prompt agent.RunPromptInput, mode string, sink io.Writer) error
}

Jump to

Keyboard shortcuts

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