api

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveSkill

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

type ErrorCode

type ErrorCode string
const (
	ErrorCodeUnknown     ErrorCode = "unknown"
	ErrorCodeUnavailable ErrorCode = "unavailable"
	ErrorCodeInvalid     ErrorCode = "invalid"
	ErrorCodeInternal    ErrorCode = "internal"
)

type InputPolicy

type InputPolicy interface {
	Evaluate(req PastePolicyInput, hasPathLikeContent bool) Result[PastePolicyDecision]
}

type PastePolicyDecision

type PastePolicyDecision struct {
	ShouldCompress bool
	Reason         string
}

type PastePolicyInput

type PastePolicyInput struct {
	Input              string
	Source             string
	Workspace          string
	LastInputAt        time.Time
	LastPasteAt        time.Time
	InputBurstSize     int
	PasteSubmitGuard   time.Duration
	PasteBurstWindow   time.Duration
	PasteQuickChars    int
	BurstImmediateMin  int
	BurstCharThreshold int
	ContinuationWindow time.Duration
}

type PromptBuildRequest

type PromptBuildRequest struct {
	RawInput        string
	MentionBindings map[string]llm.AssetID
	Pasted          any
}

type PromptBuildResult

type PromptBuildResult struct {
	Prompt      agent.RunPromptInput
	DisplayText string
}

type PromptBuilder

type PromptBuilder interface {
	Build(req PromptBuildRequest, pasted tuiruntime.PastedState) Result[PromptBuildResult]
}

type Provider

type Provider interface {
	BindSession(sess *session.Session)
	Skills() SkillsManager
	InputPolicy() InputPolicy
	PromptBuilder() PromptBuilder
}

type Result

type Result[T any] struct {
	Success bool
	Data    T
	Error   string
	Code    ErrorCode
}

func Fail

func Fail[T any](msg string) Result[T]

func FailCode

func FailCode[T any](code ErrorCode, msg string) Result[T]

func Invalid

func Invalid[T any](msg string) Result[T]

func Ok

func Ok[T any](data T) Result[T]

func Unavailable

func Unavailable[T any](service string) Result[T]

func (Result[T]) IsUnavailable

func (r Result[T]) IsUnavailable() bool

type SkillActivation

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

type SkillDeleteResult

type SkillDeleteResult struct {
	Name          string
	Dir           string
	ClearedActive bool
}

type SkillDiagnostic

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

type SkillItem

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

type SkillsManager

type SkillsManager interface {
	GetState() Result[SkillsState]
	Activate(name string, args map[string]string) Result[SkillActivation]
	Clear() Result[string]
	Delete(name string) Result[SkillDeleteResult]
}

type SkillsState

type SkillsState struct {
	Active      *ActiveSkill
	Items       []SkillItem
	Diagnostics []SkillDiagnostic
}

Jump to

Keyboard shortcuts

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