Documentation
¶
Overview ¶
Package builtin holds Ether's built-in agent tools (SPEC §5.10, WS5). Every tool ends in an existing service behind a narrow interface, is bounded, and never mutates before approval: write tools return a tools.Proposal, and the one credential (a Stremio add-on URL) goes through a tools.SecretRequest so it never reaches a transcript.
Index ¶
- Variables
- func All(d Deps) []tools.Tool
- type ApprovalInfo
- type ApprovalReader
- type CatalogService
- type CollectionService
- type Deps
- type FrontendInfo
- type FrontendService
- type HealthCheck
- type LiveTVService
- type LogLine
- type LogService
- type PlaybackService
- type PluginInfo
- type PluginService
- type ProfileInfo
- type ProfileService
- type ReleaseHealth
- type ResolverService
- type RouteInfo
- type ServerService
- type ServerStatus
- type SourceInfo
- type SourceService
- type StatusService
Constants ¶
This section is empty.
Variables ¶
var ErrApprovalNotFound = errors.New("no such approval")
ErrApprovalNotFound reports an unknown approval id.
Functions ¶
Types ¶
type ApprovalInfo ¶
type ApprovalInfo struct {
ID string
Tool string
Category string
Description string
Status string // pending, approved, rejected, failed
Note string
CreatedAt time.Time
DecidedAt *time.Time
}
ApprovalInfo is one proposed write as approval_status reports it. The app adapts WS4's agent.Store (internal/agent) to ApprovalReader.
type ApprovalReader ¶
type ApprovalReader interface {
Approval(ctx context.Context, id string) (ApprovalInfo, error)
}
ApprovalReader reads approval records.
type CatalogService ¶
type CollectionService ¶
type CollectionService interface {
SnapshotList(ctx context.Context, offset, limit int) ([]core.Collection, error)
SnapshotItems(ctx context.Context, key core.RatingKey, offset, limit int) (core.Page, error)
Generate(ctx context.Context, prompt, mediaType string) (*core.CollectionSpec, string, error)
CreateSpec(ctx context.Context, sp core.CollectionSpec) (*core.CollectionSpec, error)
// Draft cleans and validates a model-written spec without saving it.
Draft(ctx context.Context, raw, mediaType string) (*core.CollectionSpec, []string, error)
// Preview runs an unsaved spec against the catalogue.
Preview(ctx context.Context, sp core.CollectionSpec, n int) (*core.CollectionPreview, error)
}
type Deps ¶
type Deps struct {
Status StatusService
Playback PlaybackService
Resolver ResolverService
Logs LogService
Catalog CatalogService
Collections CollectionService
LiveTV LiveTVService
Sources SourceService
Plugins PluginService // optional (WS7)
Approvals ApprovalReader
Profiles ProfileService
Frontends FrontendService
Server ServerService
OwnerUser func(ctx context.Context) (*core.User, error)
Routes func() []RouteInfo
Now func() time.Time
}
Deps are the services the built-in tools call. The app adapts its real services to these interfaces; tests use fakes. Plugins and Approvals may be nil until WS7 and WS4 land.
type FrontendInfo ¶
FrontendInfo is one client protocol frontend.
type FrontendService ¶
type HealthCheck ¶
HealthCheck is one health_details row. Status is ok, attention or error.
type LiveTVService ¶
type LogService ¶
type PlaybackService ¶
type PluginInfo ¶
type PluginInfo struct {
ID string
Name string
Version string
Kind string
Enabled bool
Health string
Detail string
}
PluginInfo is one installed plugin (WS7).
type PluginService ¶
type ProfileInfo ¶
type ProfileInfo struct {
Name string
Ranking []string
Rules []core.ReleaseRule
}
ProfileInfo is one quality profile with its ranking and rules.
type ProfileService ¶
type ReleaseHealth ¶
type ReleaseHealth struct {
Known bool // among recent search results
Blocked bool
Pinned bool
Status string // last recorded status, when known
Reason string
CheckedAt time.Time
}
ReleaseHealth is the last known health of one release, read without probing: a fresh check spends indexer budget and can blocklist, so it stays a console action, not a read tool.
type ResolverService ¶
type ResolverService interface {
History(ctx context.Context, f resolver.HistoryFilter) ([]resolver.HistoryRecord, int, error)
HistoryEntry(ctx context.Context, id int64) (resolver.HistoryRecord, error)
ReleaseHealth(ctx context.Context, releaseID string, titleKey core.RatingKey) (ReleaseHealth, error)
LookupRelease(id string) (core.Release, bool)
Block(ctx context.Context, req resolver.BlockRequest, reason string) (resolver.BlockEntry, error)
PinRelease(ctx context.Context, titleKey core.RatingKey, releaseID, note string) error
}
ResolverService is satisfied by resolver.Service except ReleaseHealth and PinRelease, which the app composes from its exported reads.
type ServerService ¶
type ServerStatus ¶
type ServerStatus struct {
Version string
ServerName string
StartedAt time.Time
SetupComplete bool
ActiveSessions int
IndexersEnabled int
IndexersTotal int
LiveChannels int
}
ServerStatus is the server_status snapshot.
type SourceInfo ¶
type SourceInfo struct {
Name string
Kind string // newznab, stremio, cardigann, usenet provider, debrid, budget…
Class string
Enabled bool
Host string
Health string // ok, attention, error or a short usage note
Detail string
}
SourceInfo is one sources_list row. Host is a bare host name; full URLs can carry keys and are never sent to a model.
type SourceService ¶
type SourceService interface {
Sources(ctx context.Context) ([]SourceInfo, error)
// AddStremio stores a Stremio add-on install URL and enables it. The
// URL can carry keys: callers must treat it as a secret.
AddStremio(ctx context.Context, addonURL string) (SourceInfo, error)
}
type StatusService ¶
type StatusService interface {
ServerStatus(ctx context.Context) (ServerStatus, error)
Health(ctx context.Context) ([]HealthCheck, error)
}