Documentation
¶
Overview ¶
Package plugins is Ether's plugin host core (SPEC §5.1, §5.4, §5.5, §5.7, §5.13, WS7): manifest parsing and validation, install and lifecycle, permissions and grants, settings and sealed secrets, KV, health, the pull scheduler, the event outbox and log, the journal (shadow and undo), update and rollback, removal, cluster placement, and the owner API.
Runtimes are separate workstreams and plug in through Runtime and RuntimeFactory: WS8a registers the hosted (wazero) runtime, WS8b the remote (URL and tunnel) runtimes. Capability adapters (WS9) call plugins through Manager.Call and read state through Manager's accessors; they never touch the tables directly. The conformance kit (WS11) reuses ParseManifest, Manifest.Validate and LintCopy.
Index ¶
- Constants
- Variables
- func AICompleteAllowedPath(man Manifest, path string, background bool) bool
- func AICompleteSearchPath(man Manifest, path string) bool
- func AIPermissionAllowsComplete(level string) bool
- func AIPermissionAllowsSearch(level string) bool
- func AddonResult(resp Response) (json.RawMessage, error)
- func BuildPluginActionSpec(pluginID, group string, act FlowActionMeta, ...) flows.ActionSpec
- func BuildPluginEventSchemas(pluginID string, man Manifest, resolve func(raw, fallback string) string) []events.EventSchema
- func CallDataHost(ctx context.Context, h Host, name string, raw json.RawMessage) (json.RawMessage, error)
- func CheckKindItem(decl MediaKindMeta, it core.KindItem) string
- func CollectionPluginID(ctx context.Context) string
- func CompareSemVer(a, b string) int
- func DataReadBytes(memoryBytes uint64) int64
- func DeadlineFor(path string) time.Duration
- func DeclaredLocalHosts(man Manifest) []string
- func DeclaresOperatorHosts(man Manifest) bool
- func DescriptorsFor(man Manifest) []extend.Descriptor
- func ExternalBadgeKeys(ref BadgeTitleRef) (tmdbKey, imdbKey string)
- func FetchManyResultWire(results []FetchManyResult) []map[string]any
- func FetchResult(resp FetchResponse) map[string]any
- func HotLimits(m Manifest) wasm.Limits
- func IsGitHubURL(raw string) bool
- func IsLocalNetworkHost(raw string) bool
- func IsSubscribableEvent(name string) bool
- func KindRuleFields(fields []KindField) map[string]string
- func LintCopy(s string, max int) string
- func LintSettingsSchema(raw json.RawMessage) error
- func NonSecretSettings(settings map[string]any, schema json.RawMessage, declaredSecrets []string) map[string]any
- func NormalizeAISearchQuery(q string) string
- func NormalizeBadgeLabel(raw string) (string, error)
- func NormalizeLocalHost(raw string) (string, error)
- func NormalizeNotify(kind string) string
- func NormalizeOperatorHost(raw string) (string, error)
- func NormalizePlayback(kind, state string) string
- func OpenFrontendArchiveMember(ctx context.Context, source io.ReadSeeker, index int, limits RuntimeLimits) (io.ReadCloser, int64, error)
- func ParamFieldsFromList(pluginID string, fields []ListParamField) ([]extend.ParamField, string)
- func ParseFetchManyArgs(args []json.RawMessage) ([]FetchRequest, FetchManyOptions, *wasm.Fault)
- func ParseSemVer(v string) ([3]int, bool)
- func PendingOperatorHosts(man Manifest, g Grants, settings map[string]any, schema json.RawMessage, ...) []string
- func PermissionDiff(cur, next Manifest) []string
- func PermissionSheet(man Manifest) (lines []string, needsViewers, needsFolders bool)
- func PkgDigest(files map[string][]byte) string
- func ResolveTextValue(val, fallback string, resolve func(string) (string, bool)) string
- func RuntimeLimitsFor(m Manifest) wasm.Limits
- func SettingsCandidateHosts(settings map[string]any, schema json.RawMessage, declaredSecrets []string, ...) []string
- func StremioCatalogKey(c StremioCat) string
- func StremioInstallID(link string) (id, base string, err error)
- func ToolName(plugin, name string) string
- func ValidExternalID(id string) bool
- func ValidateAICompleteRequest(req AICompleteRequest) (*compiledAIRequest, error)
- func ValidateBadgeClearCall(man Manifest, setKey string) error
- func ValidateFeed(f OnAirFeed, raw []byte, files func(string) ([]byte, bool)) (map[string]any, map[string]image.Image, error)
- func ValidateMediaKindsUpgrade(prev, next []MediaKindMeta) error
- func ViewerFromContext(ctx context.Context) (int64, bool)
- func WithBackgroundCall(ctx context.Context) context.Context
- func WithCallContext(ctx context.Context, path, searchQuery string) context.Context
- func WithViewer(ctx context.Context, viewerID int64) context.Context
- type AICompleteBackendRequest
- type AICompleteRequest
- type AICompleteResponse
- type AIMessage
- type ActionJobStatus
- type ActivePosterBadgeSet
- type AdapterCallInfo
- type AddonCat
- type AddonConfig
- type AddonConfigChange
- type AddonConfigField
- type AddonConfigOption
- type AddonConfigResult
- type AddonFetcher
- type AddonInstall
- type AddonPreview
- type ArchiveExtractOptions
- type ArchiveExtractResult
- type ArchiveMember
- type ArchiveReadItem
- type ArchiveReadResult
- type Author
- type Backends
- type BadgeEntry
- type BadgeTitleRef
- type BadgeUsage
- type BlockedLocalHostError
- type BlockedOperatorHostError
- type CallRecord
- type CandidateFacts
- type Capability
- type Catalogue
- type CatalogueArtifact
- type ChannelsMeta
- type ClientCaps
- type CollectionInputError
- type CommandMeta
- type Contributes
- type DataRange
- type Deps
- type Detail
- type DirectoryEntry
- type DirectoryMeta
- type DirectoryResult
- type EtherBlock
- type Event
- type EventEnumOption
- type EventFieldMeta
- type EventsMeta
- type ExpandJobRunner
- type FetchCacheRequest
- type FetchCacheResult
- type FetchManyError
- type FetchManyOptions
- type FetchManyResult
- type FetchRequest
- type FetchResponse
- type FieldError
- type FlowActionMeta
- type FlowActionParamMeta
- type FolderEntry
- type FolderHash
- type FolderHashJob
- type FrontendAdapterMeta
- type FrontendBlob
- type Grants
- type HashRequest
- type HashResult
- type Health
- type HealthDecl
- type Host
- type HostJobHandle
- type HotBudgets
- type HotOutcome
- type HotRuntime
- type InstallOptions
- type Installed
- type IntegrationMeta
- type JournalEntry
- type KVUsage
- type Kind
- type KindArt
- type KindBackends
- type KindBrowseDecl
- type KindBrowseExpand
- type KindCacheDecl
- type KindField
- type KindLevel
- type KindLibraryDecl
- type KindLibraryShelf
- type KindLibraryShelfFilters
- type KindLibraryTab
- type KindLiveFilter
- type KindLiveItem
- type KindLivePage
- type KindLiveRequest
- type KindLiveResolveRequest
- type KindLiveResolveResponse
- type KindMatchDecl
- type KindSyncDecl
- type KindUpsertResult
- type ListParamField
- type ListSourceMeta
- type Manager
- func (m *Manager) AISearchGranted(ctx context.Context, pluginID string) bool
- func (m *Manager) ActivePosterBadgeSets(ctx context.Context) []ActivePosterBadgeSet
- func (m *Manager) Addon(rec Record) stremio.Addon
- func (m *Manager) AddonConfig(ctx context.Context, id string) (AddonConfig, error)
- func (m *Manager) AddonConfigPage(ctx context.Context, id string) (string, error)
- func (m *Manager) AddonFetch(ctx context.Context, id, route string) (Response, error)
- func (m *Manager) AddonLink(ctx context.Context, id string) (string, error)
- func (m *Manager) AddonLinkConfigPage(link string) (string, error)
- func (m *Manager) AllowNetworkHost(ctx context.Context, pluginID, hostName string) bool
- func (m *Manager) ApplyUpdate(ctx context.Context, id string, acceptAdded bool) (Record, error)
- func (m *Manager) BeginHostJob(pluginID, dedupKey, routePath, label, kind string, cancel context.CancelFunc) *HostJobHandle
- func (m *Manager) BlockedLocalHosts(pluginID string) []string
- func (m *Manager) BlockedOperatorHosts(pluginID string) []string
- func (m *Manager) BrowseDirectory(ctx context.Context, plugin, key string) (DirectoryResult, error)
- func (m *Manager) Call(ctx context.Context, pluginID string, req Request) (Response, error)
- func (m *Manager) CallStream(ctx context.Context, pluginID string, req Request) (Response, io.ReadCloser, error)
- func (m *Manager) CheckHealth(ctx context.Context, id string) (Health, error)
- func (m *Manager) CheckUpdate(ctx context.Context, id string) (*Preview, bool, error)
- func (m *Manager) Configure(ctx context.Context, id string, incoming map[string]any) (map[string]string, error)
- func (m *Manager) DeliverOutbox(ctx context.Context, pluginID string) error
- func (m *Manager) FetchPickedSubtitle(ctx context.Context, plugin, title, subtitle, token, rawURL string) ([]byte, error)
- func (m *Manager) Fetcher(plugin string) AddonFetcher
- func (m *Manager) Get(ctx context.Context, id string) (Record, error)
- func (m *Manager) GetSettings(ctx context.Context, id string) (map[string]any, json.RawMessage, error)
- func (m *Manager) GrantsOf(ctx context.Context, id string) (Grants, error)
- func (m *Manager) HandleBusEvent(ctx context.Context, env events.Envelope)
- func (m *Manager) Handler() http.Handler
- func (m *Manager) HealthOf(ctx context.Context, id string) (Health, error)
- func (m *Manager) HostFor(pluginID string) Host
- func (m *Manager) Hot(ctx context.Context, pluginID string) (HotRuntime, bool)
- func (m *Manager) HotReady(pluginID string) (HotRuntime, bool)
- func (m *Manager) Install(ctx context.Context, p *Preview, opts InstallOptions) (Record, error)
- func (m *Manager) InstallAddon(ctx context.Context, in AddonInstall) (Record, error)
- func (m *Manager) IsExpandJobRunning(pluginID, dedupKey string) bool
- func (m *Manager) Journal(ctx context.Context, id string, limit int, shadowOnly bool) ([]JournalEntry, error)
- func (m *Manager) List(ctx context.Context) ([]Record, error)
- func (m *Manager) MaxPluginItems(id string) int
- func (m *Manager) MintSubtitlePick(plugin, title, subtitle string) (string, error)
- func (m *Manager) MintSubtitleURLPick(plugin, title, subtitle, rawURL string) (string, error)
- func (m *Manager) OnInstall(fn func(ctx context.Context, r Record))
- func (m *Manager) OnRemove(fn func(ctx context.Context, id string))
- func (m *Manager) OnSync(fn func(ctx context.Context, r Record))
- func (m *Manager) Options(ctx context.Context, id, field string, query ...map[string]string) (json.RawMessage, error)
- func (m *Manager) PackageFiles(ctx context.Context, id string) (map[string][]byte, error)
- func (m *Manager) PluginSegment(id string) (onair.PluginSegment, bool)
- func (m *Manager) PluginSettings(ctx context.Context, pluginID string) (map[string]any, error)
- func (m *Manager) PoolStats(pluginID string) (wasm.PoolStats, bool)
- func (m *Manager) PreviewAIComplete(ctx context.Context, projectKey string, req AICompleteRequest) (AICompleteResponse, error)
- func (m *Manager) PreviewCatalogGet(ctx context.Context, id string) (json.RawMessage, bool, error)
- func (m *Manager) PreviewCatalogSearch(ctx context.Context, query string, limit, offset int) (json.RawMessage, bool, error)
- func (m *Manager) PreviewFetch(ctx context.Context, network []string, req FetchRequest) (FetchResponse, error)
- func (m *Manager) PreviewFetchMany(ctx context.Context, network []string, reqs []FetchRequest, ...) ([]FetchManyResult, error)
- func (m *Manager) PreviewInstall(ctx context.Context, src Source) (*Preview, error)
- func (m *Manager) Prune(ctx context.Context) (int64, error)
- func (m *Manager) Publish(ctx context.Context, ev Event)
- func (m *Manager) RecordFailure(ctx context.Context, pluginID, reason string)
- func (m *Manager) RecordRanking(ctx context.Context, pluginID string, r RankingReport)
- func (m *Manager) RecordSlow(ctx context.Context, pluginID string, n int)
- func (m *Manager) RegisterRuntime(kind string, f RuntimeFactory)
- func (m *Manager) RelayHandler() http.Handler
- func (m *Manager) Remove(ctx context.Context, id string, undoFirst bool) error
- func (m *Manager) ResolveAdapterCallToken(pluginID, token string) (AdapterCallInfo, bool)
- func (m *Manager) ResolveAdapterViewerToken(pluginID, token string) (int64, bool)
- func (m *Manager) ResolveText(ctx context.Context, plugin, key, locale string) (string, bool)
- func (m *Manager) ResolveTextFunc(ctx context.Context, id, locale string) func(string) (string, bool)
- func (m *Manager) Revoke(ctx context.Context, id, reason string) (bool, error)
- func (m *Manager) Rollback(ctx context.Context, id string) (Record, error)
- func (m *Manager) Run(ctx context.Context)
- func (m *Manager) SaveAddonConfig(ctx context.Context, id string, ch AddonConfigChange) (Record, error)
- func (m *Manager) SetBadgeQuotaForTest(quota int64)
- func (m *Manager) SetCatalogue(c Catalogue)
- func (m *Manager) SetEnabled(ctx context.Context, id string, enabled bool) error
- func (m *Manager) SetFlowsBackends(bus *events.Bus, reg *events.Registry, actions flows.ActionRegistry)
- func (m *Manager) SetGrants(ctx context.Context, id string, g Grants) error
- func (m *Manager) SetKindBackends(b KindBackends)
- func (m *Manager) SetResolveBadgeTitles(fn func(ctx context.Context, refs []BadgeTitleRef) ([]string, error))
- func (m *Manager) SetRoles(ctx context.Context, id string, off []Capability) (Record, error)
- func (m *Manager) SetShadow(ctx context.Context, id string, shadow bool) error
- func (m *Manager) SetSidecarState(f SidecarState)
- func (m *Manager) SettingsSchema(ctx context.Context, id string) (json.RawMessage, error)
- func (m *Manager) SetupBlockers(ctx context.Context, pluginID string) ([]string, error)
- func (m *Manager) SetupState(ctx context.Context, pluginID string) ([]SetupStepState, error)
- func (m *Manager) SkipSetupStep(ctx context.Context, pluginID, stepKey string) error
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) StartEventBridge(ctx context.Context) func()
- func (m *Manager) StartExpandJob(pluginID, routePath, dedupKey string, ...) (bool, error)
- func (m *Manager) StremioResource(ctx context.Context, plugin, resource, typ, id string, extra map[string]string) (Response, error)
- func (m *Manager) SubscribeInvalidations() func()
- func (m *Manager) Test(ctx context.Context, id string) (TestResult, error)
- func (m *Manager) TestAddonConfig(ctx context.Context, id string, ch AddonConfigChange) (AddonConfigResult, error)
- func (m *Manager) TestSetupStep(ctx context.Context, pluginID, stepKey string) (SetupTestResult, error)
- func (m *Manager) TextResolver() extend.TextResolver
- func (m *Manager) UndoAll(ctx context.Context, pluginID string) (int, error)
- func (m *Manager) UndoSince(ctx context.Context, pluginID string, since int64) (int, error)
- func (m *Manager) UpdateHostJob(pluginID, dedupKey, state, code, outcome, errMsg string)
- type Manifest
- func (m Manifest) AcceptsResource(name, typ, id string) bool
- func (m Manifest) AddonRoles() []Capability
- func (m Manifest) CatalogsOfType(typ string) []StremioCat
- func (m Manifest) ConfigurationRequired() bool
- func (m Manifest) EffectiveEther() *EtherBlock
- func (m Manifest) HasCapability(c Capability) bool
- func (m Manifest) HasResource(name string) bool
- func (m Manifest) IsStremioOnly() bool
- func (m Manifest) MediaKindByKey(key string) (MediaKindMeta, bool)
- func (m Manifest) RuntimeKind() string
- func (m Manifest) Serves(name, typ string) bool
- func (m Manifest) ServesLiveEvents() bool
- func (m Manifest) ServesTV() bool
- func (m Manifest) SpeaksStremio() bool
- func (m Manifest) Stremio() stremio.Manifest
- func (m *Manifest) UnmarshalJSON(b []byte) error
- func (m Manifest) Validate() error
- type MarkersMeta
- type MediaKindMeta
- type MetadataMeta
- type NotificationMeta
- type OnAirFeed
- type OnAirSegment
- type PackStyle
- type PageMeta
- type PendingReply
- type PermissionIncreaseError
- type Permissions
- type PoolHealth
- type PoolHolderHealth
- type PosterBadgeSetMeta
- type Preview
- type PublishedEventMeta
- type RankingReport
- type RankingStepMeta
- type RasterizeOptions
- type RasterizeResult
- type Record
- type Request
- type Response
- type RoleState
- type RuleConditionMeta
- type Runtime
- type RuntimeDecl
- type RuntimeFactory
- type RuntimeLimits
- type ScheduleEntry
- type SetupMeta
- type SetupStep
- type SetupStepState
- type SetupTestResult
- type SidecarDecl
- type SidecarState
- type SlotMeta
- type Source
- type SourceMeta
- type StreamURLOptions
- type StremioCat
- type StremioExtra
- type SubtitlesMeta
- type Summary
- type TestResult
- type ToolMeta
- type UnsafeArchiveMemberError
- type ValidationError
- type ViewerPerms
Constants ¶
const ( ActionJobTotal = 12 * time.Hour ActionJobAttempts = 1000000 ActionJobConcurrency = 2 ResolverJobConcurrency = 4 )
const ( KindSyncPull = "pull" KindSyncPush = "push" )
Kind sync modes (spec §3.5 as narrowed by §15.4: no ondemand mode).
const ( DefaultKindCacheMaxBytes int64 = 2 << 30 )
Blob cache budget defaults (§15.5): the per-library default quota and the shared absolute cap. The shared cap is also bounded by 5% of the cache disk at runtime, which only the cache owner can measure.
const ( MaxPosterBadgeSets = 4 MaxBadgeEntriesPerCall = 500 MaxBadgeLabelsPerTitle = 3 MaxBadgeLabelLen = 16 PosterBadgeQuotaTitles = 200_000 )
Poster badge bounds (#594).
const ( EventPlaybackStarted = "playback.started" EventPlaybackPaused = "playback.paused" EventPlaybackResumed = "playback.resumed" EventPlaybackStopped = "playback.stopped" EventPlaybackCompleted = "playback.completed" EventPlaybackError = "playback.error" EventPlaybackFailover = "playback.failover" EventTitleAvailable = "title.available" EventViewerAdded = "viewer.added" EventViewerAccess = "viewer.access_changed" EventCollectionRebuilt = "collection.rebuilt" EventServerHealth = "server.health_changed" )
Normalized event names (SPEC §5.7).
const ( // MaxDerivedSecretBytes caps a single plugin-written derived secret value. MaxDerivedSecretBytes = 16 << 10 // MaxDerivedSecrets caps the number of derived secrets a plugin may store. MaxDerivedSecrets = 32 // MaxDerivedSecretTTLSec caps an explicit derived-secret TTL (1 year). MaxDerivedSecretTTLSec int64 = 365 * 24 * 3600 )
const ( // DefaultAICompletePerMin caps completions per plugin in a sliding minute. DefaultAICompletePerMin = 20 // DefaultAISearchCompletePerMin caps uncached interactive search completions // per (plugin, viewer) in a sliding minute, separate from the plugin's // background completion budget (#702). DefaultAISearchCompletePerMin = 10 // MaxAIMessages caps the chat message count in a single completion request. MaxAIMessages = 20 // MaxAIInputBytes caps total UTF-8 message content bytes per request. MaxAIInputBytes = 32 * 1024 // MaxAISchemaBytes caps the optional JSON Schema document size. MaxAISchemaBytes = 32 * 1024 // DefaultAIMaxTokens is the reply token budget when maxTokens is omitted. DefaultAIMaxTokens = 1024 // MaxAIMaxTokens is the hard ceiling on maxTokens per completion. MaxAIMaxTokens = 4096 // DefaultAITimeout bounds one background/action completion when timeoutMs is omitted. DefaultAITimeout = 30 * time.Second // MaxAITimeout is the hard ceiling on timeoutMs for background/action completions. MaxAITimeout = 30 * time.Second // DefaultAISearchTimeout bounds one completion on an interactive search route // when timeoutMs is omitted (#702). Matches Ether's own descriptive search // wait bound (experience.DescriptiveSearchWaitBound). DefaultAISearchTimeout = 20 * time.Second // MaxAISearchTimeout is the hard per-request ceiling on timeoutMs for // interactive search completions (#702), never exceeding Ether's 20 s // descriptive search wait bound. MaxAISearchTimeout = 20 * time.Second // AISearchRouteDeadline gives an opted-in catalog/kind search route room // for MaxAISearchTimeout plus fallback serialization after a timeout. AISearchRouteDeadline = MaxAISearchTimeout + 2*time.Second // MaxAISearchQueryBytes bounds the search query string used for interactive // search completions and per-query caching (matches Ether's descriptive search). MaxAISearchQueryBytes = 1000 // DefaultAISearchCacheTTL bounds how long a search completion stays cached // per normalized query before re-asking the model (matches Ether's search cache). DefaultAISearchCacheTTL = 10 * time.Minute // MaxAISearchCacheEntries caps cached search completions per plugin. MaxAISearchCacheEntries = 256 // MaxAdapterSearchPaths caps declared searchPaths entries per frontend adapter. MaxAdapterSearchPaths = 16 // MaxAIResponseBytes caps the model reply text / validated JSON returned // to the plugin. MaxAIResponseBytes = 64 * 1024 )
Safe per-plugin bounds for Host.AIComplete (#669, #702). No owner settings are exposed for these bounds; they protect the owner's configured language model and memory budget with predictable defaults.
const ( MaxDataFetchBytes = 8 << 30 MinDataReadBytes = wasm.MinDataReadBytes MaxDataReadBytes = wasm.MaxDataReadBytes MaxArchiveReadItems = 4096 )
Data-service limits are host enforced. Per-call read ceilings scale with the plugin's memory grant; all operations use the plugin-owned cache namespace.
const ( // DefaultFetchManyConcurrency and MaxFetchManyConcurrency bound the // per-call parallelism of http.fetchMany (safe host default, no owner setting). DefaultFetchManyConcurrency = 8 MaxFetchManyConcurrency = 8 // MaxFetchManyRequests caps the number of requests in one http.fetchMany call. MaxFetchManyRequests = 64 // DefaultMaxFetchPerHost bounds concurrent outbound plugin HTTP fetches // (http.fetch and http.fetchMany) to any single origin (scheme://host:port) // across the manager so plugins cannot flood an upstream host. DefaultMaxFetchPerHost = 6 // MaxFetchManyBytes caps the aggregate raw response body bytes buffered across // all items in one http.fetchMany call so a batch cannot exhaust host or guest // memory. Each individual response remains bounded by MaxFetchBytes as well. MaxFetchManyBytes = MaxFetchBytes )
const ( // DefaultEventPublishPerMin bounds custom events published per plugin per minute. DefaultEventPublishPerMin = 30 // MaxPublishedEventPayloadBytes caps the JSON payload size of a plugin-published event. MaxPublishedEventPayloadBytes = 64 * 1024 // DefaultPluginFlowActionTimeout is applied when a flow action omits timeout. DefaultPluginFlowActionTimeout = 30 * time.Second // MaxPluginFlowActionTimeout is the hard ceiling for any plugin flow action. MaxPluginFlowActionTimeout = 60 * time.Second // MaxPluginFlowActionResponseBytes caps a plugin flow action JSON response body. MaxPluginFlowActionResponseBytes = 64 * 1024 // MaxPluginPublishedEvents caps how many published event schemas a plugin may declare. MaxPluginPublishedEvents = 64 // MaxPluginFlowActions caps how many flow actions a plugin may declare. MaxPluginFlowActions = 64 // MaxEventFields caps how many fields an event schema or action output may declare. MaxEventFields = 64 // MaxFlowActionParams caps how many parameters a flow action may declare. MaxFlowActionParams = 64 // HeaderIdempotencyKey carries the Flow step idempotency key on plugin action calls. HeaderIdempotencyKey = "X-Ether-Idempotency-Key" )
const ( MaxKindUpsertItems = 1000 MaxKindVisibleIDs = 500 MaxKindHintsBytes = 16 << 10 MaxKindArtRoles = 16 // HeaderAdapterViewerToken carries a host-minted, request-scoped token on // frontend adapter calls so remote plugins can prove the authenticated // viewer on viewer-scoped host callbacks without supplying viewer IDs. HeaderAdapterViewerToken = "X-Ether-Viewer-Token" )
Per-call caps for kind host services (spec §3.3 sizes, host side).
const ( SetupPending = "pending" SetupOK = "ok" SetupFailed = "failed" SetupSkipped = "skipped" )
Setup step statuses stored in plugins_setup.
const ( KVQuotaBytes = 50 << 20 KVQuotaKeys = 10000 KVKeyChargeBytes = 256 OutboxCap = 1000 CallsCap = 200 LogsCap = 200 EventLogMaxAge = 7 * 24 * time.Hour // JournalSettledMaxAge is how long an undone or shadow journal entry // (one undo can no longer act on) stays in the activity history. JournalSettledMaxAge = 90 * 24 * time.Hour MaxFetchBytes = wasm.MaxFetchBodyBytes )
Limits from SPEC §5.1.5, §5.7 and §5.13.
const DefaultKindExpandTTLHours = 168
DefaultKindExpandTTLHours is the default freshness window (7 days) for an expanded facet bucket or people credit before opening it again triggers a fresh background expansion.
const DefaultMaxPluginItems = 2_000_000
DefaultMaxPluginItems is the default per-plugin stored item ceiling across its content libraries; owners can raise or lower it globally or per plugin without an upper bound.
const DefaultUsenetCheckPerMin = 20
DefaultUsenetCheckPerMin bounds per-plugin on-demand usenet_check calls per minute so a resolver cannot flood Usenet indexers or NNTP providers.
const MaxKindLibraryShelves = 40
MaxKindLibraryShelves is the maximum number of declared Recommended shelves per kind library.
const MaxKindLibraryTabs = 50
MaxKindLibraryTabs is the maximum number of declared sub-tabs per kind library.
const OperatorNetworkEntry = "operator"
OperatorNetworkEntry is the manifest token in ether.permissions.network that declares the plugin connects to server addresses chosen and approved by the server owner, without allowing a wildcard.
const Protocol = 1
Protocol is the Ether Plugin Protocol major this host speaks (EPP/1).
const RelayPublicPrefix = "/ether/api/addon-relay/"
RelayPublicPrefix is where the console reaches the relay.
const RemoteHashDailyBytes int64 = 50 << 30
const RemoteHashMaxBytes int64 = 64 << 30
const ResolverTotal = 25 * time.Second
const StremioChannelsKey = "channels"
StremioChannelsKey is the channel-source key of a `tv` add-on.
Variables ¶
var ( ErrNotFound = errors.New("plugins: not found") ErrPermissionDenied = errors.New("plugins: permission denied") ErrQuotaExceeded = errors.New("plugins: storage quota exceeded") ErrRateLimited = errors.New("plugins: rate limit exceeded") ErrDisabled = errors.New("plugins: plugin is disabled") ErrNoRuntime = errors.New("plugins: no runtime registered for this plugin") ErrNotConfigured = errors.New("plugins: language model is not configured") ErrInvalidOutput = errors.New("plugins: invalid language model output") ErrBusy = errors.New("plugins: plugin is busy") // ErrUnsupportedBody reports a request body Ether could not encode for // the plugin at all: the guest never ran, so it is never a plugin crash. ErrUnsupportedBody = errors.New("plugins: request body cannot be delivered to the plugin") ErrJobsBusy = core.ErrJobsBusy ErrDigestMismatch = errors.New("plugins: artifact digest does not match") ErrRevoked = errors.New("plugins: plugin was revoked") )
Sentinel errors. Adapters and the API map them to plain reasons.
var AddonCapabilities = []Capability{CapStreamSource, CapListSource, CapLiveTV, CapSubtitles, CapMetadata, CapPluginDirectory}
AddonCapabilities are the roles a plain Stremio add-on can play.
var BuiltinKindArtRoles = map[string]bool{"poster": true, "backdrop": true, "thumb": true, "logo": true}
Builtin kind art roles; declared roles must not repeat them.
var CanonicalToLegacyEvent = map[string]string{ "playback.session.started": EventPlaybackStarted, "playback.session.paused": EventPlaybackPaused, "playback.session.resumed": EventPlaybackResumed, "playback.session.stopped": EventPlaybackStopped, "playback.session.completed": EventPlaybackCompleted, "playback.session.failed": EventPlaybackError, "playback.source.failover": EventPlaybackFailover, "library.title.available": EventTitleAvailable, "viewer.account.joined": EventViewerAdded, "viewer.access.changed": EventViewerAccess, "library.collection.rebuilt": EventCollectionRebuilt, "system.health.changed": EventServerHealth, }
CanonicalToLegacyEvent maps canonical event types back to the 12 legacy EPP/1 plugin event names so existing plugin subscriptions keep working unchanged through the event bus.
var ErrFetchFailed = errors.New("plugins: request failed")
ErrFetchFailed is returned when a plugin's outbound request fails. Its message names only the host and a category: request URLs can carry plugin secrets (API keys in the query), and net/http errors include the full URL, so neither the URL nor the underlying error text is exposed.
var ErrNoAddon = errors.New("plugins: this plugin is not bound to an add-on")
ErrNoAddon reports a plugin with no add-on link behind it.
var ErrNoAddonLink = errors.New("plugins: this plugin has no add-on link")
ErrNoAddonLink reports a plugin without a sealed add-on link.
var ErrStreamUnsupported = errors.New("plugins: runtime does not support streaming")
ErrStreamUnsupported indicates that a runtime cannot relay file bodies.
var KnownEvents = map[string]bool{ EventPlaybackStarted: true, EventPlaybackPaused: true, EventPlaybackResumed: true, EventPlaybackStopped: true, EventPlaybackCompleted: true, EventPlaybackError: true, EventPlaybackFailover: true, EventTitleAvailable: true, EventViewerAdded: true, EventViewerAccess: true, EventCollectionRebuilt: true, EventServerHealth: true, }
KnownEvents is the closed v1 event set.
var LegacyToCanonicalEvent = map[string]string{
EventPlaybackStarted: "playback.session.started",
EventPlaybackPaused: "playback.session.paused",
EventPlaybackResumed: "playback.session.resumed",
EventPlaybackStopped: "playback.session.stopped",
EventPlaybackCompleted: "playback.session.completed",
EventPlaybackError: "playback.session.failed",
EventPlaybackFailover: "playback.source.failover",
EventTitleAvailable: "library.title.available",
EventViewerAdded: "viewer.account.joined",
EventViewerAccess: "viewer.access.changed",
EventCollectionRebuilt: "library.collection.rebuilt",
EventServerHealth: "system.health.changed",
}
LegacyToCanonicalEvent maps the 12 EPP/1 plugin event names to their canonical domain.noun.verb event types on Ether's event bus.
var ReservedCapabilities = map[Capability]bool{ "artwork": true, "ratings": true, "stats_export": true, "sign_in": true, }
Reserved capabilities are known names a manifest may not claim in v1.
Functions ¶
func AICompleteAllowedPath ¶
AICompleteAllowedPath reports whether a plugin route may call ai.complete. Interactive viewer/client request paths are refused except opted-in search routes (Stremio catalog search with a query, kinds search, and frontend adapter search routes) when the manifest declares permissions.ai: "complete+search" (#702). Actions, jobs, Flow actions, tools, event deliveries, setup/test, background sync, and declared scheduled routes are allowed under both "complete" and "complete+search".
func AICompleteSearchPath ¶
AICompleteSearchPath reports whether path is an interactive viewer search route eligible for ai.complete when permissions.ai is "complete+search":
- a Stremio-style catalog search with a non-empty query (/catalog/{type}/{id}/search=….json),
- a media-kind live search (/ether/v1/kinds/{kind}/search), or
- a declared frontend adapter's search route (/ether/v1/frontend/{key}/…).
func AIPermissionAllowsComplete ¶
AIPermissionAllowsComplete reports whether an ether.permissions.ai level grants base ai.complete access ("complete" or "complete+search").
func AIPermissionAllowsSearch ¶
AIPermissionAllowsSearch reports whether an ether.permissions.ai level opts in to bounded, cached ai.complete on interactive search routes (#702).
func AddonResult ¶
func AddonResult(resp Response) (json.RawMessage, error)
AddonResult is the guest-facing answer for an add-on fetch made on a draft's behalf (Studio previews).
func BuildPluginActionSpec ¶
func BuildPluginActionSpec(pluginID, group string, act FlowActionMeta, resolve func(raw, fallback string) string) flows.ActionSpec
BuildPluginActionSpec builds the flows.ActionSpec for one manifest-declared plugin flow action.
func BuildPluginEventSchemas ¶
func BuildPluginEventSchemas(pluginID string, man Manifest, resolve func(raw, fallback string) string) []events.EventSchema
BuildPluginEventSchemas builds the events.EventSchema entries contributed by man for pluginID. resolve may be nil to keep literal labels.
func CallDataHost ¶
func CallDataHost(ctx context.Context, h Host, name string, raw json.RawMessage) (json.RawMessage, error)
CallDataHost is the shared hosted/remote data-service funnel. Only named services are accepted; cache access rechecks plugin ownership each call.
func CheckKindItem ¶
func CheckKindItem(decl MediaKindMeta, it core.KindItem) string
CheckKindItem validates one item envelope against its kind declaration: identity, level, the string caps and the hints shape. Field-value typing against KindField is the item store's deeper check (spec §3.3); this one is shared by the host and the kit so a plugin is told the same thing everywhere. It returns a plain reason, or "" when the item passes.
func CollectionPluginID ¶
CollectionPluginID identifies the installed plugin for a backend write or undo. Only the host supplies this context value; plugin documents cannot set it.
func CompareSemVer ¶
CompareSemVer returns -1, 0 or 1. Unparseable versions compare equal to 0.
func DataReadBytes ¶
DataReadBytes returns the per-call byte ceiling for cache.read, archive.open, and archive.read derived from the plugin's memory grant: clamp(memoryBytes/4, 8 MiB, 512 MiB).
func DeadlineFor ¶
DeadlineFor returns the per-route deadline from SPEC §5.1.2.
func DeclaredLocalHosts ¶
DeclaredLocalHosts returns any local-network hosts declared in a manifest's permissions.network list, normalized and deduplicated.
func DeclaresOperatorHosts ¶
DeclaresOperatorHosts reports whether man declares "operator" in ether.permissions.network for an executable plugin.
func DescriptorsFor ¶
func DescriptorsFor(man Manifest) []extend.Descriptor
DescriptorsFor builds the registry descriptors a manifest contributes. Exported for the kit and Studio previews.
func ExternalBadgeKeys ¶
func ExternalBadgeKeys(ref BadgeTitleRef) (tmdbKey, imdbKey string)
ExternalBadgeKeys returns the deterministic external-id fallback keys ("tmdb:<type>:<id>", "imdb:<type>:<id>") for a normalized BadgeTitleRef.
func FetchManyResultWire ¶
func FetchManyResultWire(results []FetchManyResult) []map[string]any
FetchManyResultWire encodes FetchManyResult entries for the hosted JSON wire shape: successful items match FetchResult ({status, headers, body, bodyBase64?}) and failed items carry {error: {code, message}}.
func FetchResult ¶
func FetchResult(resp FetchResponse) map[string]any
FetchResult is the guest-facing http.fetch answer. body is the response as text (JSON, HTML, playlists); bodyBase64 carries the exact bytes only for responses that are not valid UTF-8 (archives, images), so a large text response is not sent twice into guest memory.
func HotLimits ¶
HotLimits lowers the runtime's hot-path defaults to the tightest budget a manifest declares across its ranking steps. The engine clamps anything above its defaults, so a manifest can lower budgets but never raise them. Studio replay uses it to run a plugin under its installed budgets.
func IsLocalNetworkHost ¶
IsLocalNetworkHost reports whether raw is an exact non-public LAN host (dotless hostname, .local, .lan, .home.arpa, or a private/CGNAT IP literal). Loopback (localhost, 127.0.0.1, ::1), "operator", and wildcards are excluded so a manifest never pre-grants loopback or operator-placeholder access.
func IsSubscribableEvent ¶
IsSubscribableEvent reports whether name is either one of the 12 legacy EPP/1 event names or a valid canonical event type ("domain.noun.verb" or "plugin:<pluginId>/<key>").
func KindRuleFields ¶
KindRuleFields maps built-in rule facts (genre, studio, runtime, ...) onto declared, indexed plugin field keys. Shared by manifest validation and pluginitems SQL compilation so both agree on which built-in facts exist.
func LintCopy ¶
LintCopy checks one user-visible string against the copy rules: at most max characters (0 means no limit), no em or en dashes, no exclamation marks, no "simply", "just" or "easily", and sentence case. It returns a plain reason, or "" when the copy passes. Shared with the kit (WS11).
func LintSettingsSchema ¶
func LintSettingsSchema(raw json.RawMessage) error
LintSettingsSchema validates a resolved settings schema document (SPEC §5.5 copy rules). Shared with the kit.
func NonSecretSettings ¶
func NonSecretSettings(settings map[string]any, schema json.RawMessage, declaredSecrets []string) map[string]any
NonSecretSettings applies declared defaults, then stored public settings. Explicit zero, false, empty and null values take precedence over defaults. Studio uses the same secret field classifier as installed settings storage.
func NormalizeAISearchQuery ¶
NormalizeAISearchQuery normalizes a viewer search query for per-query caching (lowercased, runs of whitespace collapsed to a single space).
func NormalizeBadgeLabel ¶
NormalizeBadgeLabel uppercases ASCII lowercase characters and validates that raw is 1..16 characters from [A-Z0-9 +&'./-] and not blank (#594).
func NormalizeLocalHost ¶
NormalizeLocalHost validates a single local-network host grant ("host" or "host:port", or a single IP literal with optional port, without wildcards or CIDRs) and returns its canonical lowercase form.
func NormalizeNotify ¶
NormalizeNotify maps a notify event kind to §5.7 names.
func NormalizeOperatorHost ¶
NormalizeOperatorHost validates a single owner-approved host grant ("host" or "host:port", or a single IP literal with optional port, without schemes, wildcards, or CIDRs) and returns its canonical lowercase form. Wildcards (including bare "*") and the manifest token "operator" are rejected.
func NormalizePlayback ¶
NormalizePlayback maps a playback.Manager event kind to §5.7 names. state is the raw timeline state for updates (playing, paused, stopped). It returns "" for kinds with no normalized event.
func OpenFrontendArchiveMember ¶
func OpenFrontendArchiveMember(ctx context.Context, source io.ReadSeeker, index int, limits RuntimeLimits) (io.ReadCloser, int64, error)
OpenFrontendArchiveMember shares the data API's bounded archive parser and opens any non-directory member by index without using its name as a path. The caller owns source and must close it after reader.
func ParamFieldsFromList ¶
func ParamFieldsFromList(pluginID string, fields []ListParamField) ([]extend.ParamField, string)
func ParseFetchManyArgs ¶
func ParseFetchManyArgs(args []json.RawMessage) ([]FetchRequest, FetchManyOptions, *wasm.Fault)
ParseFetchManyArgs decodes the positional JSON arguments [requests, options?] for the http.fetchMany host service.
func ParseSemVer ¶
ParseSemVer parses a plain major.minor.patch version.
func PendingOperatorHosts ¶
func PendingOperatorHosts(man Manifest, g Grants, settings map[string]any, schema json.RawMessage, blocked []string, excludeLoopback bool) []string
PendingOperatorHosts returns distinct unapproved host or host:port entries referenced by a plugin's non-secret settings or recently blocked at runtime for a plugin declaring "operator" in permissions.network.
func PermissionDiff ¶
PermissionDiff lists the permissions `next` asks for that `cur` does not have. A non-empty result pauses auto-update and asks the owner.
func PermissionSheet ¶
PermissionSheet returns the plain-language lines the owner sees at install (SPEC §5.4). needsViewers and needsFolders say the sheet needs viewer or folder picks.
func PkgDigest ¶
PkgDigest computes an .etherpkg digest over its files (excluding the digest entry itself). pack (WS11) writes it; install verifies it.
func ResolveTextValue ¶
ResolveTextValue resolves a manifest label that may be plain text or a "$t:key" reference. Plain text is returned trimmed (or fallback when empty). A "$t:key" reference is looked up through resolve (when non-nil); if the key is missing, empty, or resolves to another "$t:" token, fallback is returned (falling back to key when fallback is empty) so an unresolved "$t:" key is never emitted anywhere.
func RuntimeLimitsFor ¶
RuntimeLimitsFor returns the granted hosted resources, also used by Studio.
func SettingsCandidateHosts ¶
func SettingsCandidateHosts(settings map[string]any, schema json.RawMessage, declaredSecrets []string, excludeLoopback bool) []string
SettingsCandidateHosts extracts normalized host or host:port candidates from a plugin's non-secret settings (including schema defaults when settings omit a field). Secret fields are never inspected.
func StremioCatalogKey ¶
func StremioCatalogKey(c StremioCat) string
StremioCatalogKey is the list-source key of a Stremio catalog.
func StremioInstallID ¶
StremioInstallID is the record id of a plain Stremio add-on installed from link, and the normalised base URL it is reached at. The id depends on the link alone: the same link pasted on any page is the same add-on, even when its manifest changes, and two configurations of one add-on (two debrid accounts) are two add-ons.
func ToolName ¶
ToolName namespaces a plugin tool for the catalogue: dots and dashes become underscores ("<plugin>__<name>").
func ValidExternalID ¶
ValidExternalID reports whether id is a legal plugin external id (spec §2.2: no ':' or '/').
func ValidateAICompleteRequest ¶
func ValidateAICompleteRequest(req AICompleteRequest) (*compiledAIRequest, error)
ValidateAICompleteRequest validates messages, size/token/temperature/timeout bounds, and compiles any optional JSON Schema. Exported for Studio and the conformance kit so offline checks enforce the same contract as the host.
func ValidateBadgeClearCall ¶
ValidateBadgeClearCall checks poster_badges capability and setKey against a manifest, for use by conformance and Studio sandboxes (#594).
func ValidateFeed ¶
func ValidateFeed(f OnAirFeed, raw []byte, files func(string) ([]byte, bool)) (map[string]any, map[string]image.Image, error)
ValidateFeed rejects the complete update on any bad field, preserving the last good value.
func ValidateMediaKindsUpgrade ¶
func ValidateMediaKindsUpgrade(prev, next []MediaKindMeta) error
ValidateMediaKindsUpgrade applies the additive-only upgrade rule (spec §2.5): a new manifest may add kinds, fields, trailing levels and art roles, and may change labels, presentations, browse, cache and match defaults, but it may not drop or rename a kind, drop or retype a field, shrink an enum, drop a field's index, or remove, reorder or re-flag a level. A caller that gets an error refuses the upgrade unless the owner chose to replace the library contents.
func ViewerFromContext ¶
ViewerFromContext returns the viewer attached by WithViewer, if any.
func WithBackgroundCall ¶
WithBackgroundCall marks a plugin invocation context as background work (such as a scheduled job or catalog sync/expand). On-demand-only host queries such as usenet_check refuse background contexts.
func WithCallContext ¶
WithCallContext attaches the active plugin route path and any host-extracted search query to ctx (used by remote host callbacks authenticated with a host-minted X-Ether-Viewer-Token).
Types ¶
type AICompleteBackendRequest ¶
type AICompleteBackendRequest struct {
Messages []AIMessage
JSONMode bool
MaxTokens int
Temperature *float64
}
AICompleteBackendRequest is passed from the plugin host to Backends.AIComplete after permissions, route policy, input bounds, and rate limits have been checked.
type AICompleteRequest ¶
type AICompleteRequest struct {
Messages []AIMessage `json:"messages"`
// Schema is an optional JSON Schema object. When set, the host extracts
// JSON from the reply, validates it against Schema, and populates JSON
// (returning ErrInvalidOutput if validation fails). External $ref URLs
// are rejected.
Schema json.RawMessage `json:"schema,omitempty"`
// MaxTokens bounds output tokens (default DefaultAIMaxTokens, max MaxAIMaxTokens).
MaxTokens int `json:"maxTokens,omitempty"`
// Temperature optionally adjusts sampling in [0, 2]. Providers or models
// that disallow explicit temperature ignore it safely.
Temperature *float64 `json:"temperature,omitempty"`
// TimeoutMS optionally tightens the call timeout (clamped to MaxAITimeout
// on background/action paths, MaxAISearchTimeout on interactive search
// routes, and the enclosing call deadline).
TimeoutMS int64 `json:"timeoutMs,omitempty"`
// SearchQuery identifies the viewer's search query when calling ai.complete
// on an interactive search route under permissions.ai: "complete+search"
// (#702). Required on frontend-adapter search routes that do not carry a
// query parameter in the URL (such as GraphQL POST endpoints) and used for
// normalized per-query caching so repeated searches do not re-ask the model.
SearchQuery string `json:"searchQuery,omitempty"`
}
AICompleteRequest configures one completion on the owner's configured language model (#669).
type AICompleteResponse ¶
type AICompleteResponse struct {
// Text is the assistant reply (with reasoning blocks stripped). When
// Schema was provided, Text holds the compact canonical JSON of JSON.
Text string `json:"text"`
// JSON holds the validated JSON value when Schema was provided.
JSON json.RawMessage `json:"json,omitempty"`
}
AICompleteResponse is the completion returned by Host.AIComplete.
type ActionJobStatus ¶
type ActionJobStatus struct {
Path string `json:"path"`
Label string `json:"label,omitempty"`
Kind string `json:"kind,omitempty"`
Code string `json:"code,omitempty"`
State string `json:"state"` // running, done, canceled, error
Progress string `json:"progress,omitempty"`
Outcome string `json:"outcome,omitempty"`
Error string `json:"error,omitempty"`
Attempts int `json:"attempts"`
Started time.Time `json:"started"`
Finished time.Time `json:"finished,omitzero"`
TotalLimitMS int64 `json:"totalLimitMs"`
AttemptLimit int `json:"attemptLimit"`
}
ActionJobStatus is a bounded, in-memory snapshot. Checkpoints belong in plugin KV when they must survive a server restart; tokens are only passed between calls.
type ActivePosterBadgeSet ¶
type ActivePosterBadgeSet struct {
PluginID string `json:"pluginId"`
PluginName string `json:"pluginName"`
Key string `json:"key"`
LayerKey string `json:"layerKey"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
}
ActivePosterBadgeSet describes one enabled, non-shadow plugin's declared poster badge set for overlay rendering and console settings (#594).
type AdapterCallInfo ¶
AdapterCallInfo identifies the active /ether/v1/frontend/* call that minted an X-Ether-Viewer-Token so remote host callbacks enforce the same viewer and route policies as hosted plugins.
type AddonCat ¶
type AddonCat struct {
Key string `json:"key"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
}
AddonCat is one catalog an add-on lists, for pickers.
type AddonConfig ¶
type AddonConfig struct {
Configurable bool `json:"configurable"`
Required bool `json:"required"`
Configured bool `json:"configured"`
Layer string `json:"layer"` // declared, decoded, page, none
Fields []AddonConfigField `json:"fields"`
Host string `json:"host"`
}
AddonConfig describes how an add-on is configured, for the console.
type AddonConfigChange ¶
AddonConfigChange is either new values for the drawn fields or a whole install link (from the add-on's own configure page, or pasted).
type AddonConfigField ¶
type AddonConfigField struct {
Key string `json:"key"`
Label string `json:"label"`
Kind string `json:"kind"` // text, number, switch, list, secret, select, fixed
Value any `json:"value,omitempty"`
Set bool `json:"set,omitempty"` // a secret has a value (never sent)
Options []AddonConfigOption `json:"options,omitempty"`
Required bool `json:"required,omitempty"`
Summary string `json:"summary,omitempty"` // fixed (structured) values, described
// Group names the nested setting a field belongs to ("Languages"); its
// Key is then a path ("languages/preferred").
Group string `json:"group,omitempty"`
}
AddonConfigField is one setting as the console draws it.
type AddonConfigOption ¶
AddonConfigOption is one choice of a select field.
type AddonConfigResult ¶
type AddonConfigResult struct {
Name string `json:"name"`
Added []string `json:"added,omitempty"` // catalogues it would add
Removed []string `json:"removed,omitempty"` // catalogues it would drop
Roles []string `json:"roles"` // what it would do in Ether
Sample string `json:"sample,omitempty"` // a live result, in words
Problems []string `json:"problems,omitempty"`
}
AddonConfigResult is what a configuration would change, before saving.
type AddonFetcher ¶
type AddonFetcher struct {
// contains filtered or unexported fields
}
AddonFetcher reads an installed add-on's routes through Call, so every request is guarded, metered, redacted and counted in its health.
type AddonInstall ¶
type AddonInstall struct {
Link string
Name string
Roles []Capability
Offline []string
// Exclusive turns every other role off on a newly created record
// (migrations keep exactly what the legacy entry did).
Exclusive bool
}
AddonInstall is one request to install (or reuse) the add-on at Link and switch Roles on. Name is a fallback display name when the manifest cannot be read; Offline lists the resources a legacy entry proves the add-on serves, used to record it while its host is unreachable.
type AddonPreview ¶
type AddonPreview struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Logo string `json:"logo,omitempty"`
Version string `json:"version,omitempty"`
Host string `json:"host"`
Roles []RoleState `json:"roles"`
Catalogs []AddonCat `json:"catalogs,omitempty"`
AlreadyInstalled bool `json:"alreadyInstalled,omitempty"`
ConfigureFirst bool `json:"configureFirst,omitempty"`
}
AddonPreview is what the console shows before adding a Stremio add-on: the add-on, the roles it can play, and whether that link is already installed (adding it again only switches roles on).
type ArchiveExtractOptions ¶
type ArchiveExtractOptions struct {
LibraryKey string `json:"libraryKey,omitempty"`
Name string `json:"name,omitempty"`
}
ArchiveExtractOptions optionally targets one of the plugin's declared media kind libraries or overrides the stored entry name when extracting a member. When omitted, archive.extract writes into the source archive's own library cache namespace (or the plugin's first declared media kind) using the member's base name.
type ArchiveExtractResult ¶
type ArchiveExtractResult struct {
Ref string `json:"ref"`
Size int64 `json:"size"`
SHA1 string `json:"sha1"`
MD5 string `json:"md5"`
CRC32 string `json:"crc32"`
}
ArchiveExtractResult is returned by archive.extract after streaming an uncompressed archive member into the plugin's own blob cache in one pass.
type ArchiveMember ¶
type ArchiveReadItem ¶
type ArchiveReadItem struct {
Member int `json:"member"`
Offset int64 `json:"offset"`
Length int64 `json:"length"`
}
ArchiveReadItem selects one byte range inside one archive member for archive.read.
type ArchiveReadResult ¶
type ArchiveReadResult struct {
Index int `json:"index"`
Member int `json:"member"`
Size int `json:"size"`
BodyBase64 string `json:"bodyBase64"`
}
ArchiveReadResult is one item returned by archive.read in request order.
type Backends ¶
type Backends struct {
CatalogSearch func(ctx context.Context, query string, limit, offset int) (json.RawMessage, error)
CatalogGet func(ctx context.Context, id string) (json.RawMessage, error)
ViewerHistory func(ctx context.Context, viewerID int64, limit, offset int) (json.RawMessage, error)
ViewerNames func(ctx context.Context, ids []int64) (json.RawMessage, error)
// SetWatchState applies a watch-state write and returns its inverse
// (the previous state) for the journal.
SetWatchState func(ctx context.Context, viewerID int64, titleID string, watched bool) (previous bool, err error)
// CollectionsUpsert creates or updates a collection and returns the
// previous document (empty when new) for the journal.
CollectionsUpsert func(ctx context.Context, doc json.RawMessage) (previous json.RawMessage, err error)
// CollectionsDelete removes a collection by the id in its document;
// used by undo for a create.
CollectionsDelete func(ctx context.Context, doc json.RawMessage) error
// Notice posts a console notice ("console notice" in SPEC §5.2).
Notice func(text string)
// Kind host services (spec §3.6, §4.5, §5.4): plugin-item store,
// source resolver and per-library blob cache.
KindUpsert func(ctx context.Context, pluginID, kindKey string, items []core.KindItem) (accepted int, err error)
KindUpsertStats func(ctx context.Context, pluginID, kindKey string, items []core.KindItem) (KindUpsertResult, error)
KindDelete func(ctx context.Context, pluginID, kindKey string, externalIDs []string) error
KindItems func(ctx context.Context, pluginID, kindKey, cursor string, limit int) (core.KindPage, error)
KindItemsByID func(ctx context.Context, pluginID, kindKey string, externalIDs []string) ([]core.KindItem, error)
KindItemCount func(ctx context.Context, pluginID string) (int, error)
KindVisible func(ctx context.Context, pluginID string, viewerID int64, kindKey string, ids []string) ([]string, error)
KindBrowse func(ctx context.Context, pluginID string, viewerID int64, kindKey string, q core.KindBrowseRequest) (core.KindPage, error)
ResolveSources func(ctx context.Context, pluginID string, q core.SourceQuery) ([]core.SourceCandidate, error)
CachePut func(ctx context.Context, pluginID, libraryKey, name string, r io.Reader) (blobRef string, err error)
CacheOpen func(ctx context.Context, pluginID, blobRef string) (io.ReadSeekCloser, error)
CacheDelete func(ctx context.Context, pluginID, blobRef string) error
// StreamURL mints a scoped stream ticket for one of a plugin's own kind
// items for one viewer and returns the Ether stream URL (spec §6.5).
StreamURL func(ctx context.Context, pluginID string, viewerID int64, itemRef string) (string, error)
StreamPartURL func(ctx context.Context, pluginID string, viewerID int64, itemRef string, partIndex *int) (string, error)
StreamURLOptions func(ctx context.Context, pluginID string, viewerID int64, itemRef string, opts StreamURLOptions) (string, error)
// ResolveBadgeTitles maps (type, tmdb, imdb) refs to local canonical rating keys (#594).
ResolveBadgeTitles func(ctx context.Context, refs []BadgeTitleRef) ([]string, error)
// AIComplete runs one completion on the owner's configured language model (#669).
// Returns ErrNotConfigured when no model is enabled/configured.
AIComplete func(ctx context.Context, req AICompleteBackendRequest) (string, error)
}
Backends are the Ether services host calls end in. Any may be nil; the matching host call then returns ErrUnavailable. App wiring fills them.
type BadgeEntry ¶
type BadgeEntry struct {
Title BadgeTitleRef `json:"title"`
Labels []string `json:"labels"`
}
BadgeEntry pushes or clears (empty Labels) poster badges for one title.
func ValidateBadgeSetCall ¶
func ValidateBadgeSetCall(man Manifest, setKey string, entries []BadgeEntry) ([]BadgeEntry, error)
ValidateBadgeSetCall validates setKey and entries against manifest and label bounds, returning normalized entries for sandbox hosts (#594).
type BadgeTitleRef ¶
type BadgeTitleRef struct {
Type string `json:"type"`
TMDB int64 `json:"tmdb,omitempty"`
IMDB string `json:"imdb,omitempty"`
}
BadgeTitleRef identifies a canonical movie or show by TMDB and/or IMDb id.
type BadgeUsage ¶
BadgeUsage reports a plugin's badged title count and per-plugin title quota.
type BlockedLocalHostError ¶
type BlockedLocalHostError struct {
Host string
}
BlockedLocalHostError reports that a plugin fetch targeted a non-public network address that the owner has not granted in Grants.LocalHosts.
func (*BlockedLocalHostError) Error ¶
func (e *BlockedLocalHostError) Error() string
func (*BlockedLocalHostError) PluginMessage ¶
func (e *BlockedLocalHostError) PluginMessage() string
PluginMessage returns the message exposed to the plugin runtime.
func (*BlockedLocalHostError) Unwrap ¶
func (e *BlockedLocalHostError) Unwrap() []error
type BlockedOperatorHostError ¶
type BlockedOperatorHostError struct {
Host string
}
BlockedOperatorHostError reports that a plugin declaring "operator" in permissions.network targeted an address the owner has not yet approved in Grants.OperatorHosts.
func (*BlockedOperatorHostError) Error ¶
func (e *BlockedOperatorHostError) Error() string
func (*BlockedOperatorHostError) PluginMessage ¶
func (e *BlockedOperatorHostError) PluginMessage() string
PluginMessage returns the message exposed to the plugin runtime.
func (*BlockedOperatorHostError) Unwrap ¶
func (e *BlockedOperatorHostError) Unwrap() []error
type CallRecord ¶
type CallRecord struct {
ID int64 `json:"id"`
Plugin string `json:"plugin"`
Route string `json:"route"`
Method string `json:"method"`
Status int `json:"status"`
MS int64 `json:"ms"`
Error string `json:"error,omitempty"`
Request string `json:"request,omitempty"`
Response string `json:"response,omitempty"`
Created time.Time `json:"created"`
}
CallRecord is one inspector entry (redacted, capped per plugin).
type CandidateFacts ¶
type CandidateFacts struct {
ReleaseID string `json:"releaseId"`
Name string `json:"name"`
Size int64 `json:"size,omitempty"`
Protocol string `json:"protocol,omitempty"` // usenet|torrent|direct
SourceClass string `json:"sourceClass,omitempty"`
Indexer string `json:"indexer,omitempty"`
Resolution string `json:"resolution,omitempty"`
HDR []string `json:"hdr,omitempty"`
VideoCodec string `json:"videoCodec,omitempty"`
AudioCodecs []string `json:"audioCodecs,omitempty"`
AudioChannels string `json:"audioChannels,omitempty"`
Languages []string `json:"languages,omitempty"`
Subtitles []string `json:"subtitles,omitempty"`
ReleaseType string `json:"releaseType,omitempty"`
Group string `json:"group,omitempty"`
Cached bool `json:"cached,omitempty"`
Verified bool `json:"verified,omitempty"`
ClientCaps ClientCaps `json:"clientCaps,omitempty"`
}
CandidateFacts is the hot-path input for ranking steps and rule conditions (SPEC §5.8), JSON-encoded. It never carries viewer data.
type Capability ¶
type Capability string
Capability is one thing a plugin can do (SPEC §5.1.3).
const ( CapStreamSource Capability = "stream_source" CapDebridProvider Capability = "debrid_provider" CapListSource Capability = "list_source" CapMetadata Capability = "metadata" CapPluginDirectory Capability = "plugin_directory" CapLiveTV Capability = "livetv_channels" CapSubtitles Capability = "subtitles" CapMarkers Capability = "markers" CapNotify Capability = "notify" CapEvents Capability = "events" CapFlowActions Capability = "flow_actions" CapRankingStep Capability = "ranking_step" CapRuleCondition Capability = "rule_condition" CapTools Capability = "tools" CapUI Capability = "ui" CapOnAirContent Capability = "onair_content" CapLiveTVPack Capability = "livetv_pack" CapPosterBadges Capability = "poster_badges" // Content-kind capabilities (spec §2.1). Catalog provider, kind // resolver and matcher need kind content; a frontend adapter may // also be an extension over the built-in libraries. CapCatalogProvider Capability = "catalog_provider" CapKindResolver Capability = "kind_resolver" CapFrontendAdapter Capability = "frontend_adapter" CapMatcher Capability = "matcher" )
type Catalogue ¶
type Catalogue interface {
http.Handler
// Resolve looks up a plugin in the verified catalogue by plugin ID (or
// artifact URL) and optional version (empty means latest). It fails when
// the plugin is not in the catalogue or is revoked.
Resolve(ctx context.Context, idOrURL, version string) (CatalogueArtifact, error)
}
Catalogue is the signed catalogue hook used by the owner API, install and update flows (WS12).
type CatalogueArtifact ¶
type CatalogueArtifact struct {
ID string
Version string
URL string
SHA256 string
Icon string
Kind Kind
Permissions Permissions
Capabilities []Capability
}
CatalogueArtifact is a resolved version from the signed plugin catalogue (WS12).
type ChannelsMeta ¶
ChannelsMeta is mandatory for livetv_channels.
type ClientCaps ¶
type ClientCaps struct {
MaxHeight int `json:"maxHeight,omitempty"`
HDR []string `json:"hdr,omitempty"`
Codecs []string `json:"codecs,omitempty"`
}
ClientCaps is what the playing client can show.
type CollectionInputError ¶
type CollectionInputError struct{ Message string }
CollectionInputError is a safe, actionable validation failure supplied by the collection backend. It survives the hosted runtime as a client error.
func (*CollectionInputError) Error ¶
func (e *CollectionInputError) Error() string
type CommandMeta ¶
type CommandMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Action string `json:"action"` // plugin action name
}
CommandMeta is one contributed ⌘K command.
type Contributes ¶
type Contributes struct {
Looks []PackStyle `json:"looks,omitempty"`
OnAirFeeds []OnAirFeed `json:"onairFeeds,omitempty"`
OnAirSegments []OnAirSegment `json:"onairSegments,omitempty"`
Directories []DirectoryMeta `json:"directories,omitempty"`
Metadata *MetadataMeta `json:"metadata,omitempty"`
Source *SourceMeta `json:"source,omitempty"`
Channels *ChannelsMeta `json:"channels,omitempty"`
Subtitles *SubtitlesMeta `json:"subtitles,omitempty"`
Markers *MarkersMeta `json:"markers,omitempty"`
Notification *NotificationMeta `json:"notification,omitempty"`
Events *EventsMeta `json:"events,omitempty"`
FlowActions []FlowActionMeta `json:"flowActions,omitempty"`
Integration *IntegrationMeta `json:"integration,omitempty"`
ListSources []ListSourceMeta `json:"listSources,omitempty"`
RankingSteps []RankingStepMeta `json:"rankingSteps,omitempty"`
RuleConditions []RuleConditionMeta `json:"ruleConditions,omitempty"`
PosterBadges []PosterBadgeSetMeta `json:"posterBadges,omitempty"`
Tools []ToolMeta `json:"tools,omitempty"`
Pages []PageMeta `json:"pages,omitempty"`
Slots []SlotMeta `json:"slots,omitempty"`
Commands []CommandMeta `json:"commands,omitempty"`
// MediaKinds declares the content kinds this plugin serves; each entry
// that declares a library block becomes its own library (spec §2.1).
MediaKinds []MediaKindMeta `json:"mediaKinds,omitempty"`
// FrontendAdapters declares protocol surfaces this plugin serves
// through Ether's generic adapter frontend (spec §6.5).
FrontendAdapters []FrontendAdapterMeta `json:"frontendAdapters,omitempty"`
// Setup declares guided setup steps for any plugin kind (§8).
Setup *SetupMeta `json:"setup,omitempty"`
}
type Deps ¶
type Deps struct {
Busy func() bool
ReadRuntimeConfig func() config.Plugins
SaveRuntimeConfig func(string, config.PluginRuntimeLimits) error
ImportStylePack func(context.Context, string, map[string][]byte) error
OnAirContent *onair.PluginContentCache
DB *sql.DB
Sealer config.FieldSealer
Registry *extend.Registry
Tools *tools.Catalogue
Notifications *notify.Service
// EventBus, EventRegistry, and FlowActions wire structured plugin lifecycle
// events and Flows integration (F6): plugins publish schema-validated events
// to EventBus, register event schemas in EventRegistry, and contribute Flow
// actions to FlowActions.
EventBus *events.Bus
EventRegistry *events.Registry
FlowActions flows.ActionRegistry
Logger *slog.Logger
// IsLeader reports cluster leadership; nil means always leader.
IsLeader func() bool
// Bus broadcasts invalidate:plugins; nil disables it.
Bus clusterbus.Bus
// FetchClient fetches manifests and artifacts; nil builds one from
// safefetch and egress CapPlugins. Tests inject an httptest client.
FetchClient *http.Client
// CheckPackage runs the conformance kit during install previews.
CheckPackage func(context.Context, []byte, map[string][]byte) error
Backends Backends
Now func() time.Time
}
Deps are the plugin host's explicit dependencies.
type Detail ¶
type Detail struct {
Summary
Manifest Manifest `json:"manifest"`
RuntimeLimits *RuntimeLimits `json:"runtimeLimits,omitempty"`
Permissions struct {
Lines []string `json:"lines"`
Declared Permissions `json:"declared"`
Grants Grants `json:"grants"`
NeedsViewers bool `json:"needsViewers"`
NeedsFolders bool `json:"needsFolders"`
NeedsOperatorHosts bool `json:"needsOperatorHosts,omitempty"`
} `json:"permissions"`
HealthDetail Health `json:"healthDetail"`
Privacy struct {
DeclaredHosts []string `json:"declaredHosts"`
ObservedHosts map[string]int `json:"observedHosts"`
Undeclared []string `json:"undeclared,omitempty"`
} `json:"privacy"`
Impact struct {
Calls int `json:"calls"`
Errors int `json:"errors"`
P50MS int64 `json:"p50Ms"`
P95MS int64 `json:"p95Ms"`
EgressBytes int64 `json:"egressBytes"`
KVBytes int64 `json:"kvBytes"`
Items int `json:"items"`
MaxItems int `json:"maxItems,omitempty"`
Slow int64 `json:"slow"`
EventDrops int64 `json:"eventDrops"`
Restarts int64 `json:"restarts"`
} `json:"impact"`
// AddedPermissions is set when an update is waiting and asks for more.
AddedPermissions []string `json:"addedPermissions,omitempty"`
// BlockedLocalHosts lists private-network hosts recently blocked for this plugin.
BlockedLocalHosts []string `json:"blockedLocalHosts,omitempty"`
// PendingOperatorHosts lists unapproved addresses from settings or recent requests
// when the plugin declares "operator" in permissions.network.
PendingOperatorHosts []string `json:"pendingOperatorHosts,omitempty"`
}
Detail is the plugin drawer payload: overview, permissions, health, the privacy label and impact.
type DirectoryEntry ¶
type DirectoryEntry struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
ManifestURL string `json:"manifestURL,omitempty"`
Unsupported string `json:"unsupported,omitempty"`
}
DirectoryEntry is a discovery suggestion from a native or adapted provider. ManifestURL must pass the normal fetch/preview/install policy before use. Directory claims never confer verified status or install permissions.
type DirectoryMeta ¶
DirectoryMeta declares a protocol-neutral plugin discovery source. Entries are suggestions, never installation authorization or verification.
type DirectoryResult ¶
type DirectoryResult struct {
Entries []DirectoryEntry `json:"entries"`
}
type EtherBlock ¶
type EtherBlock struct {
Protocol int `json:"protocol"`
// Stremio marks a native plugin that answers Stremio add-on routes,
// such as an add-on opened and edited in Studio: Ether talks to it
// exactly as to the add-on it came from.
Stremio bool `json:"stremio,omitempty"`
Kind Kind `json:"kind"`
Capabilities []Capability `json:"capabilities,omitempty"`
// Summary is plain text or a "$t:key" reference into Strings.
Summary string `json:"summary,omitempty"`
Author Author `json:"author,omitempty"`
License string `json:"license,omitempty"`
Repo string `json:"repo,omitempty"`
Icon string `json:"icon,omitempty"`
Runtime RuntimeDecl `json:"runtime"`
// Sidecar tells the console how to run a remote plugin's program: a
// Docker image, a download+command pair, or neither (docs only). Only
// meaningful when Runtime.Kind is "remote".
Sidecar *SidecarDecl `json:"sidecar,omitempty"`
// Cluster is "leader" (default) or "every_node".
Cluster string `json:"cluster,omitempty"`
Health HealthDecl `json:"health,omitempty"`
Permissions Permissions `json:"permissions,omitempty"`
// Settings is a settings schema (SPEC §5.5), {} or {"$ref":"file"}.
Settings json.RawMessage `json:"settings,omitempty"`
// Strings maps a locale to a file path (string) or an inline
// key-to-text object. "en" is required when any $t: key is used.
Strings map[string]json.RawMessage `json:"strings,omitempty"`
Schedule []ScheduleEntry `json:"schedule,omitempty"`
Contributes Contributes `json:"contributes,omitempty"`
}
EtherBlock is the `ether` object of a manifest.
func (*EtherBlock) UnmarshalJSON ¶
func (e *EtherBlock) UnmarshalJSON(raw []byte) error
Accept the feed interval shorthand without changing existing job manifests.
type Event ¶
type Event struct {
ID string `json:"id"`
Name string `json:"name"`
At time.Time `json:"at"`
ViewerID int64 `json:"viewerId,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Event is one normalized Ether event (SPEC §5.7). Payload is JSON with no secrets; viewer identity appears only for plugins granted it (the host strips it per plugin at delivery).
type EventEnumOption ¶
EventEnumOption describes one allowed option for an enum event field or flow action parameter.
type EventFieldMeta ¶
type EventFieldMeta struct {
Name string `json:"name"`
Type string `json:"type"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Unit string `json:"unit,omitempty"`
Enum []EventEnumOption `json:"enum,omitempty"`
PII bool `json:"pii,omitempty"`
Secret bool `json:"secret,omitempty"`
Filterable bool `json:"filterable,omitempty"`
Example any `json:"example,omitempty"`
}
EventFieldMeta describes one typed field in a published plugin event payload or a flow action output object.
type EventsMeta ¶
type EventsMeta struct {
Subscribe []string `json:"subscribe,omitempty"`
Publish []PublishedEventMeta `json:"publish,omitempty"`
}
EventsMeta is mandatory for events. Subscribe lists built-in or plugin event names delivered to POST /ether/event; Publish declares custom event schemas the plugin may emit onto Ether's event bus as "plugin:<pluginId>/<key>".
type ExpandJobRunner ¶
type ExpandJobRunner struct {
// contains filtered or unexported fields
}
ExpandJobRunner executes plugin calls and optional /ether/job/... continuations inside an active lowered-priority background expansion job slot.
func (*ExpandJobRunner) Call ¶
Call invokes a plugin route and increments the job's attempt counter. A fill always starts because a viewer opened that studio or person and is waiting for it, so it does not yield to other streams the way speculative background work does.
func (*ExpandJobRunner) RunContinuation ¶
func (r *ExpandJobRunner) RunContinuation(ctx context.Context, jobPath string, initial json.RawMessage, onStep func(body json.RawMessage) error) error
RunContinuation drives a /ether/job/... continuation inside the same background job slot so long-running expansions never consume a second ActionJobConcurrency slot.
func (*ExpandJobRunner) SetProgress ¶
func (r *ExpandJobRunner) SetProgress(progress string)
SetProgress updates the job's human-readable progress string.
type FetchCacheRequest ¶
type FetchCacheRequest struct {
FetchRequest
LibraryKey string `json:"libraryKey"`
Name string `json:"name"`
}
type FetchCacheResult ¶
type FetchManyError ¶
FetchManyError describes one failed request inside http.fetchMany. Code matches the hosted fault code vocabulary ("timeout", "forbidden", "invalid_input", "host_error", "bad_arguments").
type FetchManyOptions ¶
type FetchManyOptions struct {
Concurrency int `json:"concurrency,omitempty"`
}
FetchManyOptions configures a bounded concurrent http.fetchMany batch call. Concurrency defaults to DefaultFetchManyConcurrency (8) and clamps to MaxFetchManyConcurrency (8); there is no owner setting.
type FetchManyResult ¶
type FetchManyResult struct {
Response FetchResponse `json:"-"`
Error *FetchManyError `json:"error,omitempty"`
}
FetchManyResult is one ordered answer from http.fetchMany. Either Error is non-nil or Response carries the received HTTP response (including non-2xx statuses, matching http.fetch).
type FetchRequest ¶
type FetchRequest struct {
TimeoutMS int64 `json:"timeoutMs,omitempty"`
Method string `json:"method"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
Body []byte `json:"body,omitempty"`
// KeepHeadersOnRedirect lists optional host or wildcard (*.example.org)
// patterns (within permissions.network / granted hosts) that may keep
// credentials and caller headers across redirects when the target is not
// already the same origin or a strict same-site subdomain. Never applies
// across HTTPS -> HTTP downgrades.
KeepHeadersOnRedirect []string `json:"keepHeadersOnRedirect,omitempty"`
}
FetchRequest is one plugin outbound HTTP call.
type FetchResponse ¶
type FetchResponse struct {
Status int `json:"status"`
Headers map[string]string `json:"headers,omitempty"`
Body []byte `json:"body,omitempty"`
}
FetchResponse is the answer to a FetchRequest (body capped at 10 MiB).
type FieldError ¶
FieldError is one validation problem, keyed by a dotted field path.
type FlowActionMeta ¶
type FlowActionMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Icon string `json:"icon,omitempty"`
Route string `json:"route"`
Idempotent bool `json:"idempotent,omitempty"`
SideEffect *bool `json:"sideEffect,omitempty"`
Timeout string `json:"timeout,omitempty"`
Params []FlowActionParamMeta `json:"params,omitempty"`
Outputs []EventFieldMeta `json:"outputs,omitempty"`
}
FlowActionMeta declares one Flow action contributed by a plugin ("plugin:<pluginId>/<key>"). Ether invokes Route with HTTP POST and an X-Ether-Idempotency-Key header.
type FlowActionParamMeta ¶
type FlowActionParamMeta struct {
Key string `json:"key"`
Type string `json:"type"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Secret bool `json:"secret,omitempty"`
Template bool `json:"template,omitempty"`
Default any `json:"default,omitempty"`
Enum []EventEnumOption `json:"enum,omitempty"`
Unit string `json:"unit,omitempty"`
Picker string `json:"picker,omitempty"`
}
FlowActionParamMeta describes one configurable parameter of a plugin flow action.
type FolderEntry ¶
type FolderEntry struct {
Name string `json:"name"`
Path string `json:"path"`
Dir bool `json:"dir"`
Size int64 `json:"size,omitempty"`
Mtime int64 `json:"mtime,omitempty"` // unix seconds
}
FolderEntry is one entry from FoldersList or FoldersStat.
type FolderHash ¶
type FolderHash struct {
Size int64 `json:"size"`
ModTime int64 `json:"modTime"`
CRC32 string `json:"crc32"`
MD5 string `json:"md5"`
SHA1 string `json:"sha1"`
}
FolderHash contains digests, never file contents. ModTime is Unix seconds.
type FolderHashJob ¶
type FolderHashJob struct {
ID string `json:"id"`
State string `json:"state"`
Bytes int64 `json:"bytes"`
Result *FolderHash `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}
FolderHashJob is a pollable background hash. Bytes is the progress so far. Terminal states are done, canceled and error. Only done carries Result.
type FrontendAdapterMeta ¶
type FrontendAdapterMeta struct {
Key string `json:"key"`
Label string `json:"label"`
ProtocolHint string `json:"protocolHint"` // opds|subsonic|custom
PathPrefix string `json:"pathPrefix"`
DefaultPort int `json:"defaultPort,omitempty"`
Clients []string `json:"clients,omitempty"`
Auth string `json:"auth,omitempty"` // ether_token (default)|basic|none_lan
// Libraries lists the plugin's media-kind keys this adapter publishes.
// Ether resolves each key to the library the kind created and admits a
// viewer only to the libraries they may see; a viewer who sees none of
// them is answered 404. Empty means the adapter is not library-scoped.
Libraries []string `json:"libraries,omitempty"`
// SearchPaths optionally lists adapter subpaths (such as "/search",
// "/rest/search3", or "/graphql") that handle interactive viewer searches
// and may call ai.complete when permissions.ai is "complete+search" (#702).
// When omitted, conventional search subpaths (ending in /search, /search2,
// or /search3, with optional .json/.xml/.view suffix) are recognized.
SearchPaths []string `json:"searchPaths,omitempty"`
}
FrontendAdapterMeta declares one plugin-provided protocol surface (spec §6.5).
type FrontendBlob ¶
type FrontendBlob struct {
LibraryKey string `json:"libraryKey"`
Ref string `json:"ref"`
MemberIndex *int `json:"memberIndex,omitempty"`
}
FrontendBlob asks the host to serve cached bytes without passing them through guest memory. LibraryKey scopes Ref to an owned, viewer-visible kind library. MemberIndex selects an archive member; nil serves the entire blob.
type Grants ¶
type Grants struct {
Viewers []int64 `json:"viewers,omitempty"`
Folders []string `json:"folders,omitempty"`
LocalHosts []string `json:"localHosts,omitempty"`
OperatorHosts []string `json:"operatorHosts,omitempty"`
Revoked []string `json:"revoked,omitempty"`
LAN bool `json:"lan,omitempty"`
}
Grants is what the owner has granted one plugin on top of its manifest permissions. Revoked lists permission keys the owner has taken back ("network", "catalog", "viewers.identity", "viewers.watch_history", "viewers.write_watch_state", "collections", "folders", "secrets", "events").
type HashRequest ¶
type HashRequest struct {
URL string `json:"url"`
Algo string `json:"algo"`
ExpectSize *int64 `json:"expectSize,omitempty"`
// Headers sends optional request headers with the hash fetch. Values may
// use {secret:<name>} placeholders expanded via permissions.secrets;
// hop-by-hop and framing headers are rejected, headers follow redirects
// only under Ether's redirect credential policy (same origin, strict
// same-site subdomain, or KeepHeadersOnRedirect within granted hosts), and
// values are never logged or persisted in the hash cache.
Headers map[string]string `json:"headers,omitempty"`
// KeepHeadersOnRedirect lists optional host or wildcard (*.example.org)
// patterns (within permissions.network / granted hosts) that may keep
// credentials and caller headers across redirects. Never applies across
// HTTPS -> HTTP downgrades.
KeepHeadersOnRedirect []string `json:"keepHeadersOnRedirect,omitempty"`
}
type HashResult ¶
type HashResult struct {
Pending bool `json:"pending,omitempty"`
RetryInMS int64 `json:"retryInMs,omitempty"`
Size int64 `json:"size"`
SHA256 string `json:"sha256,omitempty"`
SHA1 string `json:"sha1,omitempty"`
MD5 string `json:"md5,omitempty"`
}
HashResult never includes remote bytes. All three digests share a single read.
type Health ¶
type Health struct {
Status string `json:"status"` // ok|attention|error|disabled
Reason string `json:"reason,omitempty"`
Failures []int64 `json:"-"` // unix seconds, pruned to 10 minutes
Restarts int64 `json:"restarts"`
Slow int64 `json:"slow"`
Drops int64 `json:"drops"`
LastError string `json:"lastError,omitempty"`
LastOK time.Time `json:"lastOk,omitempty"`
NextRetry time.Time `json:"nextRetry,omitempty"`
Observed map[string]int `json:"observed,omitempty"` // host -> fetch count
EgressBytes int64 `json:"egressBytes"`
// RankingSkipped counts the resolves since the plugin's last complete
// ranking that left its ranking step out because it ran past its time
// budget; zero once a ranking finishes in time again.
RankingSkipped int64 `json:"rankingSkipped"`
RankingSkippedAt time.Time `json:"rankingSkippedAt,omitempty"`
// Sidecar is "waiting" while a plugin that runs as its own program
// (a remote plugin with no URL endpoint) has no sidecar connected.
// It is computed live for the console, never stored.
Sidecar string `json:"sidecar,omitempty"`
// Pool is a live snapshot of the hosted plugin's instance pool (never stored).
Pool *PoolHealth `json:"pool,omitempty"`
}
Health is one plugin's health and impact record.
type HealthDecl ¶
type HealthDecl struct {
Interval string `json:"interval,omitempty"`
}
HealthDecl declares the health-check interval (minimum 15s).
type Host ¶
type Host interface {
KVGet(ctx context.Context, key string) ([]byte, bool, error)
KVPut(ctx context.Context, key string, value []byte) error
KVDelete(ctx context.Context, key string) error
KVList(ctx context.Context, prefix string) ([]string, error)
KVUsage(ctx context.Context) (KVUsage, error)
// BadgesSet, BadgesClear and BadgesUsage need poster_badges (#594).
BadgesSet(ctx context.Context, setKey string, entries []BadgeEntry) error
BadgesClear(ctx context.Context, setKey string) error
BadgesUsage(ctx context.Context) (BadgeUsage, error)
// SecretGet returns a sealed setting the manifest declared in
// permissions.secrets (owner-configured first, then plugin-written derived
// secrets). Hosted plugins only.
SecretGet(ctx context.Context, name string) (string, error)
// SecretSet stores a sealed derived secret under a name declared in
// permissions.secrets that is not an owner-configured settings secret.
// Passing an empty value deletes the derived secret. ttlSec <= 0 means no
// expiry; positive values expire after ttlSec seconds.
SecretSet(ctx context.Context, name, value string, ttlSec int64) error
// SecretDelete removes a plugin-written derived secret declared in
// permissions.secrets. Owner-configured settings secrets cannot be deleted.
SecretDelete(ctx context.Context, name string) error
// HTTPFetch fetches through egress and safefetch; only manifest
// network hosts are allowed. Observed hosts feed the privacy label.
HTTPFetch(ctx context.Context, req FetchRequest) (FetchResponse, error)
// CatalogSearch and CatalogGet need catalog: read. Results are JSON
// title summaries produced by the injected catalog backend.
CatalogSearch(ctx context.Context, query string, limit, offset int) (json.RawMessage, error)
CatalogGet(ctx context.Context, id string) (json.RawMessage, error)
// ViewerHistory needs viewers.watch_history for that viewer.
ViewerGranted(ctx context.Context) (json.RawMessage, error)
ViewerHistory(ctx context.Context, viewerID int64, limit, offset int) (json.RawMessage, error)
// SetWatchState needs viewers.write_watch_state; journalled.
SetWatchState(ctx context.Context, viewerID int64, titleID string, watched bool) error
// CollectionsUpsert needs collections: write; journalled.
CollectionsUpsert(ctx context.Context, collection json.RawMessage) error
// KindUpsert and KindDelete need catalog_provider and a push-mode
// kind (spec §3.6): the sync engine is the only writer for pull
// kinds. Writes are journalled in shadow mode without applying.
KindUpsert(ctx context.Context, kindKey string, items []core.KindItem) (accepted int, err error)
KindDelete(ctx context.Context, kindKey string, externalIDs []string) error
// KindItems reads the plugin's own library back, keyset-paged.
KindItems(ctx context.Context, kindKey, cursor string, limit int) (core.KindPage, error)
// KindVisible returns the subset of external IDs (at most MaxKindVisibleIDs)
// in kindKey that the library's Rules and viewer access policy allow for the
// requesting frontend-adapter viewer (#615). Only viewer-authenticated
// frontend adapter requests may call it; the viewer comes from the adapter
// request context, never from guest input.
KindVisible(ctx context.Context, kindKey string, ids []string) ([]string, error)
// KindBrowse browses or searches kindKey using the same LibraryPolicy path
// as Ether's console and protocol projectors for the requesting
// frontend-adapter viewer (#615). Only viewer-authenticated frontend adapter
// requests may call it; the viewer comes from the adapter request context,
// never from guest input.
KindBrowse(ctx context.Context, kindKey string, q core.KindBrowseRequest) (core.KindPage, error)
// ResolveSources needs kind_resolver and permissions.sources
// (search to look, acquire to open debrid content, §4.5).
ResolveSources(ctx context.Context, q core.SourceQuery) ([]core.SourceCandidate, error)
// CachePut stores one blob in a kind library's cache namespace and
// returns its "blob:<sha256>" reference; CacheOpen reads one back;
// CacheDelete removes one from this plugin's own namespaces.
CachePut(ctx context.Context, libraryKey, name string, r io.Reader) (blobRef string, err error)
CacheOpen(ctx context.Context, blobRef string) (io.ReadSeekCloser, error)
CacheDelete(ctx context.Context, blobRef string) error
// StreamURL mints a short-lived, scoped ticket for one of this
// plugin's own kind items and returns the Ether stream URL a frontend
// adapter embeds instead of a plugin URL (spec §6.5). The viewer is
// the one the proxied request authenticated (X-Ether-Viewer); items
// from another plugin, or a library the viewer cannot see, are
// refused. Bytes are then served by Ether, never by the plugin.
StreamURL(ctx context.Context, itemRef string) (string, error)
StreamPartURL(ctx context.Context, itemRef string, partIndex *int) (string, error)
StreamURLWithOptions(ctx context.Context, itemRef string, opts StreamURLOptions) (string, error)
// FoldersList and FoldersStat need folders: read and an owner-picked
// root. They never return file contents.
FoldersList(ctx context.Context, root, path string) ([]FolderEntry, error)
FoldersStat(ctx context.Context, root, path string) (FolderEntry, error)
FoldersHash(ctx context.Context, root, path string) (FolderHash, error)
FoldersHashStart(ctx context.Context, root, path string) (FolderHashJob, error)
FoldersHashPoll(ctx context.Context, id string) (FolderHashJob, error)
FoldersHashCancel(ctx context.Context, id string) (FolderHashJob, error)
// Settings returns the plugin's current non-secret settings. Plugins
// read them per request instead of keeping them in instance memory,
// because hosted plugins run in a pool of instances that restart.
// Secrets stay behind SecretGet.
Settings(ctx context.Context) (map[string]any, error)
// PublishEvent emits one manifest-declared plugin event onto Ether's event
// bus as "plugin:<pluginId>/<key>". Requires the events capability and a
// matching entry in contributes.events.publish; payload is schema-validated
// and rate-limited.
PublishEvent(ctx context.Context, key string, payload json.RawMessage, corr events.Correlation) error
// AIComplete runs a bounded text or JSON-Schema-validated completion against
// the owner's configured language model (Settings -> Integrations -> Language
// model). Requires permissions.ai: "complete" (or "complete+search" to also
// allow bounded, cached calls on Stremio catalog search, kinds search, and
// declared frontend-adapter search routes; #702). Every other viewer/client
// request path stays refused. Returns ErrNotConfigured when no model is
// configured.
AIComplete(ctx context.Context, req AICompleteRequest) (AICompleteResponse, error)
// NotifyOwner posts a console notice (rate-limited).
NotifyOwner(ctx context.Context, text string) error
// Log appends to the plugin's log ring (redacted, rate-limited).
Log(ctx context.Context, level, msg string, attrs map[string]any) error
}
Host is the set of Ether services a plugin may call (SPEC §5.1.5). Every method re-checks the plugin's live grants, so a revoke takes effect mid-call. Writes are journalled; in shadow mode they are recorded without applying. The hosted runtime exposes Host as imports; remote plugins reach it over /ether/plugin-host/* (WS8b).
type HostJobHandle ¶
type HostJobHandle struct {
// contains filtered or unexported fields
}
HostJobHandle tracks a host-driven background job (such as a plugin library sync) in the plugin's job list so Activity and Overview show live progress and final outcome alongside plugin-started jobs.
func (*HostJobHandle) Finish ¶
func (h *HostJobHandle) Finish(state, code, outcome, errMsg string)
Finish marks a host-tracked job terminal with optional code, outcome and error.
func (*HostJobHandle) SetProgress ¶
func (h *HostJobHandle) SetProgress(progress string)
SetProgress updates the human-readable progress line on a host-tracked job.
type HotBudgets ¶
type HotBudgets struct {
PerCandidate time.Duration `json:"perCandidateNs"`
PerBatch time.Duration `json:"perBatchNs"`
}
HotBudgets are the effective hot-path limits for one plugin.
func EffectiveBudgets ¶
func EffectiveBudgets(lim wasm.Limits) HotBudgets
EffectiveBudgets mirrors the engine's clamping: the budgets a manifest gets as SPEC 5.2 states them, in reference-machine time. The engine scales them by its measured speed (wasm.HotScale); Budgets reports that.
type HotOutcome ¶
type HotOutcome struct {
// Status is ok, error, timeout, forbidden, aborted or governance.
Status string `json:"status"`
Duration time.Duration `json:"durationNs"`
Units int64 `json:"units"`
// Slow counts candidates that went neutral on budget.
Slow int `json:"slow"`
MemoHits int `json:"memoHits"`
Trap bool `json:"trap,omitempty"`
}
HotOutcome classifies one hot-path call for health and replay.
func (HotOutcome) Timeout ¶
func (o HotOutcome) Timeout() bool
Timeout reports whether the call ran out of time or budget.
type HotRuntime ¶
type HotRuntime interface {
Runtime
// RankBatch returns one key per candidate (higher ranks first). A
// candidate that exceeded its budget gets the neutral key 0 and counts
// in HotOutcome.Slow; a batch that ran out of time returns neutral keys
// for the rest.
RankBatch(ctx context.Context, cands []CandidateFacts, config json.RawMessage) (keys []int64, out HotOutcome, err error)
// CondMatch evaluates a rule condition; false when the budget runs out.
CondMatch(ctx context.Context, cand CandidateFacts, operator string, value json.RawMessage) (match bool, out HotOutcome, err error)
HasRankKey() bool
HasCondMatch() bool
// Budgets reports the effective per-candidate and per-batch limits.
Budgets() HotBudgets
}
HotRuntime is implemented by hosted runtimes whose plugin exports the hot-path ABI (SPEC §5.2): ranking steps and rule conditions. The ranking adapters reach it through Manager.Hot. Budgets are the manifest's (lowered, never raised) and every call reports a classified outcome.
type InstallOptions ¶
type InstallOptions struct {
Grants Grants
Settings map[string]any
AutoUpdate bool
Shadow bool
// AcceptAddedPermissions confirms an update that asks for more.
AcceptAddedPermissions bool
// ReplaceLibraries confirms a non-additive media-kind upgrade that
// replaces the plugin's library contents (spec §2.5).
ReplaceLibraries bool
}
InstallOptions carries the owner's install-time picks.
type Installed ¶
type Installed struct {
RuntimeLimits *RuntimeLimits
Busy func() bool
ID string
Manifest Manifest
// SourceURL is where the manifest came from (remote endpoint base).
SourceURL string
// Files returns an artifact file (entry, module, strings, schema) for
// the installed version, or false. Hosted runtimes load code through it.
Files func(path string) ([]byte, bool)
// Host is the per-plugin host-services handle (SPEC §5.1.5).
Host Host
}
Installed is the host's record of one installed plugin, handed to a RuntimeFactory when an instance is opened.
type IntegrationMeta ¶
type IntegrationMeta struct {
Category string `json:"category"`
Logo string `json:"logo,omitempty"`
Adds []string `json:"adds"` // 1..4 plain lines or $t: keys
Connect string `json:"connect"` // fields|device_code|none
Test bool `json:"test,omitempty"`
}
IntegrationMeta is mandatory for the integration kind.
type JournalEntry ¶
type JournalEntry struct {
ID int64 `json:"id"`
Plugin string `json:"plugin"`
Op string `json:"op"`
Detail string `json:"detail,omitempty"`
Inverse json.RawMessage `json:"inverse,omitempty"`
Shadow bool `json:"shadow"`
Undone bool `json:"undone"`
Created time.Time `json:"created"`
}
JournalEntry is one recorded write and its inverse.
type KVUsage ¶
type KVUsage struct {
Bytes int64 `json:"bytes"`
Keys int64 `json:"keys"`
QuotaBytes int64 `json:"quotaBytes"`
QuotaKeys int64 `json:"quotaKeys"`
}
KVUsage reports a plugin's current KV bytes (including the 256-byte charge per key), key count, and configured quotas (#591).
type Kind ¶
type Kind string
Kind decides where the owner meets a plugin (SPEC §5.1.1).
const ( KindSource Kind = "source" KindIntegration Kind = "integration" KindNotificationChannel Kind = "notification_channel" KindLiveTVSource Kind = "livetv_source" KindExtension Kind = "extension" // KindContent plugins declare media kinds; the owner meets each one // as a Library (spec §2.1). KindContent Kind = "content" )
type KindBackends ¶
type KindBackends struct {
KindUpsert func(ctx context.Context, pluginID, kindKey string, items []core.KindItem) (accepted int, err error)
// KindUpsertStats, when set, is preferred over KindUpsert and its
// counts ride the host reply.
KindUpsertStats func(ctx context.Context, pluginID, kindKey string, items []core.KindItem) (KindUpsertResult, error)
KindDelete func(ctx context.Context, pluginID, kindKey string, externalIDs []string) error
KindItems func(ctx context.Context, pluginID, kindKey, cursor string, limit int) (core.KindPage, error)
KindItemsByID func(ctx context.Context, pluginID, kindKey string, externalIDs []string) ([]core.KindItem, error)
KindItemCount func(ctx context.Context, pluginID string) (int, error)
// KindVisible and KindBrowse evaluate a plugin library's Rules and viewer
// access policy for the requesting frontend-adapter viewer (#615).
KindVisible func(ctx context.Context, pluginID string, viewerID int64, kindKey string, ids []string) ([]string, error)
KindBrowse func(ctx context.Context, pluginID string, viewerID int64, kindKey string, q core.KindBrowseRequest) (core.KindPage, error)
ResolveSources func(ctx context.Context, pluginID string, q core.SourceQuery) ([]core.SourceCandidate, error)
CachePut func(ctx context.Context, pluginID, libraryKey, name string, r io.Reader) (blobRef string, err error)
CacheOpen func(ctx context.Context, pluginID, blobRef string) (io.ReadSeekCloser, error)
CacheDelete func(ctx context.Context, pluginID, blobRef string) error
// StreamURL mints a scoped stream ticket for one of the plugin's own
// kind items for one viewer and returns the Ether stream URL (spec
// §6.5). The backend re-checks item ownership and library visibility.
StreamURL func(ctx context.Context, pluginID string, viewerID int64, itemRef string) (string, error)
StreamPartURL func(ctx context.Context, pluginID string, viewerID int64, itemRef string, partIndex *int) (string, error)
StreamURLOptions func(ctx context.Context, pluginID string, viewerID int64, itemRef string, opts StreamURLOptions) (string, error)
}
KindBackends are the Ether services the kind host calls end in: the plugin-item store, the source resolver and the blob cache. Any field may be nil, in which case the matching host call returns ErrUnavailable. App wiring fills them (pluginitems, the indexer and debrid services, blobcache); the plugin id is always the caller's, so a plugin can only ever reach its own kinds and cache.
type KindBrowseDecl ¶
type KindBrowseDecl struct {
Sorts []string `json:"sorts,omitempty"` // subset of title|added|released|year|rating|index
Facets []string `json:"facets,omitempty"` // field keys; each must be indexed
Search bool `json:"search"` // full-text over the title plus SearchFields
SearchFields []string `json:"searchFields,omitempty"` // declared text fields included in search
Expand *KindBrowseExpand `json:"expand,omitempty"` // on-demand background facet/person expansion
// LiveSearch: client searches also call the plugin's /search route
// with a short budget; results are upserted and merged (§15.4).
LiveSearch bool `json:"liveSearch,omitempty"`
}
KindBrowseDecl is how a kind library is browsed.
type KindBrowseExpand ¶
type KindBrowseExpand struct {
Facets []string `json:"facets"` // subset of browse.facets
TTLHours int `json:"ttlHours,omitempty"` // default 168 (7 days)
}
KindBrowseExpand declares on-demand background expansion for specific browse facets (collection buckets or people fields).
func (*KindBrowseExpand) EffectiveTTLHours ¶
func (e *KindBrowseExpand) EffectiveTTLHours() int
EffectiveTTLHours returns the configured freshness window in hours, defaulting to DefaultKindExpandTTLHours (168).
type KindCacheDecl ¶
type KindCacheDecl struct {
MaxBytes int64 `json:"maxBytes,omitempty"` // 0 = server default
TTL string `json:"ttl,omitempty"`
}
KindCacheDecl is the per-library blob cache budget (§5.4).
func (KindCacheDecl) EffectiveMaxBytes ¶
func (c KindCacheDecl) EffectiveMaxBytes() int64
EffectiveMaxBytes resolves the declared cache cap against the default.
type KindField ¶
type KindField struct {
Key string `json:"key"` // ^[a-z][a-zA-Z0-9_]{0,39}$
Type string `json:"type"` // string|int|float|bool|date|duration|enum|strings|people
Label string `json:"label"`
Indexed bool `json:"indexed,omitempty"` // gets a typed column in the item store
Enum []string `json:"enum,omitempty"`
// Fact controls whether this field is surfaced in TitleMedia.facts.
// Nil follows the default rule (non-structural fields appear as facts);
// explicit true/false overrides it.
Fact *bool `json:"fact,omitempty"`
}
KindField is one declared item field.
type KindLevel ¶
type KindLevel struct {
Key string `json:"key"`
Label string `json:"label"`
Role string `json:"role,omitempty"` // item|artist|album|track|series|book|audiobook|part|show|episode|collection
Playable bool `json:"playable,omitempty"` // leaves the resolver can open; at least one level
Container bool `json:"container,omitempty"` // item is a container other leaves are extracted from
}
KindLevel is one hierarchy level of a kind.
type KindLibraryDecl ¶
type KindLibraryDecl struct {
Name string `json:"name"` // default name; the owner may rename it after
Icon string `json:"icon,omitempty"`
Card string `json:"card,omitempty"` // poster (default)|landscape|square
DateDisplay string `json:"dateDisplay,omitempty"` // year (default)|date
Tabs []KindLibraryTab `json:"tabs,omitempty"` // up to 50; defaults to Recommended + Library
Shelves []KindLibraryShelf `json:"shelves,omitempty"` // up to 40; default Recommended shelves
}
KindLibraryDecl is the optional library created for a kind on install.
func (KindLibraryDecl) EffectiveCard ¶
func (d KindLibraryDecl) EffectiveCard() string
EffectiveCard returns the library's card aspect ("poster" by default).
func (KindLibraryDecl) EffectiveDateDisplay ¶
func (d KindLibraryDecl) EffectiveDateDisplay() string
EffectiveDateDisplay returns how dates are shown on cards and detail headers ("year" by default, or "date" for full YYYY-MM-DD display).
func (KindLibraryDecl) EffectiveTabs ¶
func (d KindLibraryDecl) EffectiveTabs() []KindLibraryTab
EffectiveTabs returns the declared tabs, or the default Recommended and Library tabs.
func (KindLibraryDecl) IsZero ¶
func (d KindLibraryDecl) IsZero() bool
IsZero reports whether every field of the library declaration is empty.
type KindLibraryShelf ¶
type KindLibraryShelf struct {
Key string `json:"key"`
Label string `json:"label"`
Level string `json:"level,omitempty"` // optional declared hierarchy level key
Sort string `json:"sort,omitempty"` // released (default)|title|added|year|rating|index|lastViewed
Direction string `json:"direction,omitempty"` // desc (default)|asc
Facet string `json:"facet,omitempty"` // single-facet shorthand (declared and indexed)
Value string `json:"value,omitempty"` // single value for facet
Values []string `json:"values,omitempty"` // OR values for facet
Filters *KindLibraryShelfFilters `json:"filters,omitempty"` // facet map, TabFilter, or rule/rules list
}
KindLibraryShelf declares one default Recommended shelf for a plugin library. Each shelf gets the stable row ID "plugin:<viewID>:shelf:<key>" so the library's Recommended row editor can reorder, hide, pin, or cap it.
func (KindLibraryShelf) EffectiveDirection ¶
func (s KindLibraryShelf) EffectiveDirection() string
EffectiveDirection returns the shelf's sort direction ("desc" by default).
func (KindLibraryShelf) EffectiveFilters ¶
func (s KindLibraryShelf) EffectiveFilters() map[string][]string
EffectiveFilters returns the shelf's facet filter map (AND across facets, OR within each facet), or nil when the shelf has no facet map filter.
func (KindLibraryShelf) EffectiveSort ¶
func (s KindLibraryShelf) EffectiveSort() string
EffectiveSort returns the shelf's sort field ("released" by default).
func (KindLibraryShelf) EffectiveTabFilter ¶
func (s KindLibraryShelf) EffectiveTabFilter() *core.TabFilter
EffectiveTabFilter returns the shelf's rule-based TabFilter when Filters was authored as rules or a TabFilter, or nil otherwise.
type KindLibraryShelfFilters ¶
KindLibraryShelfFilters configures optional filtering for a declared Recommended shelf. In JSON it accepts four equivalent forms:
- A legacy facet map: {"topic":["science","nature"]}
- A TabFilter object: {"match":"all","rules":[...],"exclude":[...]}
- A single rule object: {"field":"viewer","value":{"history":true}}
- An array of rules: [{"field":"viewer","value":{"history":true}}]
Omitted "op" on a "viewer" rule defaults to "is".
func (*KindLibraryShelfFilters) Clone ¶
func (f *KindLibraryShelfFilters) Clone() *KindLibraryShelfFilters
Clone returns a deep copy of f, or nil when f is nil.
func (*KindLibraryShelfFilters) IsEmpty ¶
func (f *KindLibraryShelfFilters) IsEmpty() bool
IsEmpty reports whether neither facet filters nor rule filters are set.
func (KindLibraryShelfFilters) MarshalJSON ¶
func (f KindLibraryShelfFilters) MarshalJSON() ([]byte, error)
MarshalJSON encodes f in its canonical form (TabFilter when rule-based, otherwise the facet map).
func (*KindLibraryShelfFilters) UnmarshalJSON ¶
func (f *KindLibraryShelfFilters) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a facet map, TabFilter, single rule, or rule array.
type KindLibraryTab ¶
type KindLibraryTab struct {
Key string `json:"key"`
Label string `json:"label"`
Kind string `json:"kind"` // recommended|library|collections|people|view|live
Level string `json:"level,omitempty"` // optional declared hierarchy level (library, view, collections or people)
Facet string `json:"facet,omitempty"` // declared browse.facets entry (collections or people)
Sort string `json:"sort,omitempty"` // one of browse.sorts or lastViewed (facet collections or view)
Direction string `json:"direction,omitempty"` // asc|desc (facet collections or view)
Order string `json:"order,omitempty"` // count|name (facet collections or people)
Card string `json:"card,omitempty"` // landscape (default)|poster|square (live tabs only)
Layout string `json:"layout,omitempty"` // grid (default)|list|timeline (view tabs only)
Search *bool `json:"search,omitempty"` // collections, people, view or live (default true)
SearchPlaceholder string `json:"searchPlaceholder,omitempty"` // localizable placeholder, <= 60 chars
Filters *core.TabFilter `json:"filters,omitempty"` // saved filter rules (view tabs only)
}
KindLibraryTab declares one sub-tab shown inside a plugin library.
func (KindLibraryTab) EffectiveCard ¶
func (t KindLibraryTab) EffectiveCard() string
EffectiveCard returns the tab's card shape ("landscape" by default for live tabs, empty for other tab kinds).
func (KindLibraryTab) EffectiveLayout ¶
func (t KindLibraryTab) EffectiveLayout() string
EffectiveLayout returns the tab's layout ("grid" by default for view tabs, empty for other tab kinds).
func (KindLibraryTab) EffectiveSearch ¶
func (t KindLibraryTab) EffectiveSearch() bool
EffectiveSearch reports whether tab search is enabled. Search defaults to true on collections, people, view and live tabs and is never enabled on other manifest tab kinds.
type KindLiveFilter ¶
KindLiveFilter is one optional filter chip returned alongside live items.
type KindLiveItem ¶
type KindLiveItem struct {
ID string `json:"id"`
Title string `json:"title"`
Subtitle string `json:"subtitle,omitempty"`
Badge string `json:"badge,omitempty"`
Viewers *int `json:"viewers,omitempty"`
Tags []string `json:"tags,omitempty"`
Thumb string `json:"thumb,omitempty"`
Live *bool `json:"live,omitempty"`
}
KindLiveItem is one currently live stream returned by a plugin live tab.
func (KindLiveItem) IsLive ¶
func (i KindLiveItem) IsLive() bool
IsLive reports whether the item is live (defaults to true when omitted).
type KindLivePage ¶
type KindLivePage struct {
Items []KindLiveItem `json:"items"`
Filters []KindLiveFilter `json:"filters,omitempty"`
NextCursor string `json:"nextCursor,omitempty"`
}
KindLivePage is the response returned by POST /ether/v1/kinds/{kind}/live.
type KindLiveRequest ¶
type KindLiveRequest struct {
Tab string `json:"tab,omitempty"`
Q string `json:"q,omitempty"`
Filter string `json:"filter,omitempty"`
Cursor string `json:"cursor,omitempty"`
Limit int `json:"limit,omitempty"`
}
KindLiveRequest is the request body sent to POST /ether/v1/kinds/{kind}/live.
type KindLiveResolveRequest ¶
type KindLiveResolveRequest struct {
ID string `json:"id"`
}
KindLiveResolveRequest is the request body sent to POST /ether/v1/kinds/{kind}/live/resolve.
type KindLiveResolveResponse ¶
type KindLiveResolveResponse struct {
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
MIME string `json:"mime,omitempty"`
Title string `json:"title,omitempty"`
}
KindLiveResolveResponse is the direct playable stream returned by POST /ether/v1/kinds/{kind}/live/resolve.
type KindMatchDecl ¶
type KindMatchDecl struct {
// ThresholdDefault is the score (0..1) at or above which an
// automatic match is accepted; 0 leaves the server default.
ThresholdDefault float64 `json:"thresholdDefault,omitempty"`
}
KindMatchDecl holds matcher defaults for a kind (spec §7).
type KindSyncDecl ¶
type KindSyncDecl struct {
Mode string `json:"mode"` // pull|push
Refresh string `json:"refresh,omitempty"` // at least 15m, pull only
}
KindSyncDecl is how a kind's items reach Ether's store. Mode is empty only for a resolver-only kind, which owns no item sync; a catalog provider must pick pull or push.
type KindUpsertResult ¶
KindUpsertResult is what one kinds.upsert batch did (#646): Accepted items were taken, of which Added were new, Updated rewrote a stored item, and Unchanged matched the stored item and were skipped.
type ListParamField ¶
type ListParamField struct {
Key string `json:"key"`
Name string `json:"name"`
Kind string `json:"kind"`
Label string `json:"label"`
Help string `json:"help"`
Hint string `json:"hint"`
Required bool `json:"required"`
Placeholder string `json:"placeholder"`
Default any `json:"default"`
Options []struct {
Value string `json:"value"`
Label string `json:"label"`
} `json:"options"`
}
func ParseListParamFields ¶
func ParseListParamFields(raw json.RawMessage) []ListParamField
type ListSourceMeta ¶
type ListSourceMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Hint string `json:"hint,omitempty"`
Catalog string `json:"catalog"`
Params json.RawMessage `json:"params,omitempty"`
MaxItems int `json:"maxItems,omitempty"` // ≤ 2000
Refresh string `json:"refresh,omitempty"` // ≥ 1h
}
ListSourceMeta is one contributed list source.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the plugin host. It is safe for concurrent use.
func (*Manager) AISearchGranted ¶
AISearchGranted reports whether pluginID is enabled, declares permissions.ai: "complete+search", and has neither "ai" nor "ai.search" revoked in its live grants.
func (*Manager) ActivePosterBadgeSets ¶
func (m *Manager) ActivePosterBadgeSets(ctx context.Context) []ActivePosterBadgeSet
ActivePosterBadgeSets returns declared poster badge sets for all currently enabled, non-shadow plugins in deterministic order without hitting SQLite once loaded.
func (*Manager) Addon ¶
Addon is the installed plugin as a Stremio add-on: its Stremio manifest read through Fetcher.
func (*Manager) AddonConfig ¶
AddonConfig describes an installed add-on's settings for the console.
func (*Manager) AddonConfigPage ¶
AddonConfigPage opens the configure page of an installed add-on.
func (*Manager) AddonFetch ¶
AddonFetch reads one Stremio route from the add-on behind plugin id: the add-on itself, or the link a Studio-edited version of it carries. It uses the same guarded, plain add-on transport as an imported add-on.
func (*Manager) AddonLink ¶
AddonLink returns the sealed add-on link behind a plugin, for carrying it to a Studio-built replacement or copy. Never send it to a client.
func (*Manager) AddonLinkConfigPage ¶
AddonLinkConfigPage opens the configure page for an add-on not yet installed, from its install link.
func (*Manager) AllowNetworkHost ¶
AllowNetworkHost reports whether pluginID is enabled, still holds its network grant, and declared hostName in permissions.network.
func (*Manager) ApplyUpdate ¶
ApplyUpdate installs a pending update previously stored by CheckUpdate.
func (*Manager) BeginHostJob ¶
func (m *Manager) BeginHostJob(pluginID, dedupKey, routePath, label, kind string, cancel context.CancelFunc) *HostJobHandle
BeginHostJob records a host-managed background job for pluginID in m.jobs without consuming the plugin's ActionJobConcurrency slots. Cancelling the job from the Activity API calls cancel.
func (*Manager) BlockedLocalHosts ¶
BlockedLocalHosts returns recently blocked private-network hosts (up to 10 distinct entries) for one plugin, oldest to newest.
func (*Manager) BlockedOperatorHosts ¶
BlockedOperatorHosts returns recently blocked operator-configurable hosts (up to 10 distinct entries) for one plugin, oldest to newest.
func (*Manager) BrowseDirectory ¶
BrowseDirectory is the common owner discovery path. No network request is made during registry rendering or ordinary media browse. Disabling/removing a provider prevents both cached descriptors and direct API calls from use.
func (*Manager) CallStream ¶
func (m *Manager) CallStream(ctx context.Context, pluginID string, req Request) (Response, io.ReadCloser, error)
CallStream returns a streaming response. The call deadline remains active until the body is closed; callers must close it on every path.
func (*Manager) CheckHealth ¶
CheckHealth calls /ether/health once and updates the health record. A failing call feeds the failure policy through Call already; a plugin reporting attention or error is recorded without counting as a crash.
func (*Manager) CheckUpdate ¶
CheckUpdate fetches the plugin's source again. When a newer version exists it is stored as a pending update; auto-update applies it at once only for verified plugins whose permissions did not grow (SPEC §5.4).
func (*Manager) Configure ¶
func (m *Manager) Configure(ctx context.Context, id string, incoming map[string]any) (map[string]string, error)
Configure validates incoming settings against the schema, stores them (secrets sealed per plugin; a "Saved" value keeps the stored secret), then calls the plugin's /ether/configure and surfaces its field errors.
func (*Manager) DeliverOutbox ¶
DeliverOutbox sends queued events to one plugin in batches of 50 and deletes the ones it acks. A missing ack keeps events for redelivery (at least once).
func (*Manager) FetchPickedSubtitle ¶
func (m *Manager) FetchPickedSubtitle(ctx context.Context, plugin, title, subtitle, token, rawURL string) ([]byte, error)
FetchPickedSubtitle consumes the same one-shot authorization as a plugin download call. Every redirect is checked against the declared hosts.
func (*Manager) Fetcher ¶
func (m *Manager) Fetcher(plugin string) AddonFetcher
Fetcher returns the stremio.Fetcher for an installed plugin.
func (*Manager) GetSettings ¶
func (m *Manager) GetSettings(ctx context.Context, id string) (map[string]any, json.RawMessage, error)
GetSettings returns settings with secrets replaced by "Saved".
func (*Manager) HandleBusEvent ¶
HandleBusEvent delivers one events.Bus envelope to any enabled plugin subscribed to its canonical type or mapped legacy EPP/1 event name. When no plugin subscribes to either name it does zero database work.
func (*Manager) Handler ¶
Handler serves the owner API. It is mounted at /api/plugins by the app, behind owner auth; paths here are relative to that mount.
func (*Manager) Hot ¶
Hot returns the hosted runtime of an enabled plugin when it exports the hot-path ABI, loading it if needed. It may block on a load, so it is for background work (replay, Studio); the play path uses HotReady.
func (*Manager) HotReady ¶
func (m *Manager) HotReady(pluginID string) (HotRuntime, bool)
HotReady is the play-path accessor. It never blocks: it returns the plugin's hosted runtime only when it is already loaded, and otherwise starts loading it in the background and reports false, so the caller treats the plugin's steps and conditions as neutral for this resolve. Plugins in shadow mode are never ready on the play path. Runtimes are dropped on update, disable, remove and failure (closeRuntime) and warmed again when descriptors sync.
func (*Manager) InstallAddon ¶
InstallAddon installs the add-on at link, or finds it when that link is already installed, and switches the requested roles on. A private host is trusted as LAN: the owner pasted it.
func (*Manager) IsExpandJobRunning ¶
IsExpandJobRunning reports whether a background expansion job with dedupKey is currently running for pluginID.
func (*Manager) Journal ¶
func (m *Manager) Journal(ctx context.Context, id string, limit int, shadowOnly bool) ([]JournalEntry, error)
Journal returns a plugin's journal (liveOnly: applied and not undone; shadowOnly is handled by the caller through Journal).
func (*Manager) MaxPluginItems ¶
MaxPluginItems returns the effective stored-item ceiling across all content libraries owned by id (default 2,000,000; owner-configurable globally and per plugin with no upper bound).
func (*Manager) MintSubtitlePick ¶
MintSubtitlePick is called only after a viewer selects a listed subtitle.
func (*Manager) MintSubtitleURLPick ¶
MintSubtitleURLPick binds a user's selection to the exact URL returned by a Stremio subtitle search. A foreign manifest grants no arbitrary host access.
func (*Manager) OnInstall ¶
OnInstall registers a callback run once when a plugin is newly installed.
func (*Manager) OnSync ¶
OnSync registers a callback notified whenever a plugin's enabled state or manifest changes (install, update, rollback, enable, disable, auto-disable, or remove). Any already-installed plugins are synced immediately.
func (*Manager) Options ¶
func (m *Manager) Options(ctx context.Context, id, field string, query ...map[string]string) (json.RawMessage, error)
Options calls /ether/options/{field} for runtime field options.
func (*Manager) PackageFiles ¶
PackageFiles returns an installed plugin's own files for its current version, so Studio can open it for editing.
func (*Manager) PluginSegment ¶
func (m *Manager) PluginSegment(id string) (onair.PluginSegment, bool)
PluginSegment is a memory-only lookup shared by the render queue and scheduler.
func (*Manager) PluginSettings ¶
PluginSettings returns a plugin's stored settings with its own secrets, for delivery to that plugin only (remote sidecars read it from the authenticated plugin-host API after a restart or reconnect).
func (*Manager) PoolStats ¶
PoolStats returns a live instance-pool snapshot for a running hosted plugin.
func (*Manager) PreviewAIComplete ¶
func (m *Manager) PreviewAIComplete(ctx context.Context, projectKey string, req AICompleteRequest) (AICompleteResponse, error)
PreviewAIComplete runs a Studio draft's ai.complete call against the owner's configured language model with the same input validation, schema checks, rate limits, and secret-safe error mapping as an installed plugin.
func (*Manager) PreviewCatalogGet ¶
func (*Manager) PreviewCatalogSearch ¶
func (m *Manager) PreviewCatalogSearch(ctx context.Context, query string, limit, offset int) (json.RawMessage, bool, error)
PreviewCatalogSearch and PreviewCatalogGet give a draft read access to the real catalogue, the way catalog: read does once installed. ok is false when the server has no catalogue backend (tests, early startup).
func (*Manager) PreviewFetch ¶
func (m *Manager) PreviewFetch(ctx context.Context, network []string, req FetchRequest) (FetchResponse, error)
PreviewFetch performs a draft plugin's http.fetch for Studio's preview: the same SSRF-guarded client, per-host politeness limit, redirect credential confinement, and host allowlist as an installed plugin, checked against the draft's own declared network permissions, so a preview shows the real data the plugin will see once installed.
func (*Manager) PreviewFetchMany ¶
func (m *Manager) PreviewFetchMany(ctx context.Context, network []string, reqs []FetchRequest, opts FetchManyOptions) ([]FetchManyResult, error)
PreviewFetchMany performs a draft plugin's bounded concurrent http.fetchMany for Studio's preview using the same per-call cap, per-host politeness limit, redirect credential confinement, and host allowlist as an installed plugin.
func (*Manager) PreviewInstall ¶
PreviewInstall fetches and validates a source without installing it.
func (*Manager) Prune ¶
Prune applies the plugin retention that is not bounded at write time: settled journal entries past JournalSettledMaxAge.
func (*Manager) Publish ¶
Publish normalizes and fans out one Ether event: it is written to the 7-day event log and queued for every enabled plugin that subscribed to it (and was not revoked). Viewer identity is stripped per plugin unless the plugin's grants allow it. Both legacy EPP/1 names and canonical domain.noun.verb names are accepted and bridged to matching subscribers.
func (*Manager) RecordFailure ¶
RecordFailure reports an adapter-observed failure (such as an HTTP 5xx or malformed payload) into the plugin's health record and failure policy.
func (*Manager) RecordRanking ¶
func (m *Manager) RecordRanking(ctx context.Context, pluginID string, r RankingReport)
RecordRanking records a resolve's hot-path outcome for one plugin. A ranking step left out for running past its budget flags the plugin for the owner until one of its rankings finishes in time again; the periodic health check does not clear it, since the plugin's own health answer says nothing about its ranking. A resolve where the plugin kept to time and was not being skipped writes nothing. Safe for concurrent use; the ranking adapters call it when a resolve ends.
func (*Manager) RecordSlow ¶
RecordSlow adds n slow calls or slow hot-path candidates to a plugin's health and flags it for the owner's attention. It is safe for concurrent use; the ranking adapters call it after a resolve.
func (*Manager) RegisterRuntime ¶
func (m *Manager) RegisterRuntime(kind string, f RuntimeFactory)
RegisterRuntime adds a runtime factory for a runtime kind ("hosted" or "remote"). WS8 calls it at wiring time. Safe to call after Start.
func (*Manager) RelayHandler ¶
RelayHandler serves /api/addon-relay/{token}/{path...} without the console's sign-in: the token is the permission.
func (*Manager) Remove ¶
Remove uninstalls a plugin: it offers undo first (when undoFirst, every live journal inverse is replayed), then purges KV, secrets, grants, artifacts, logs and its registry entries.
func (*Manager) ResolveAdapterCallToken ¶
func (m *Manager) ResolveAdapterCallToken(pluginID, token string) (AdapterCallInfo, bool)
ResolveAdapterCallToken verifies that token belongs to an active /ether/v1/frontend/* call for pluginID and returns its authenticated viewer and active route context.
func (*Manager) ResolveAdapterViewerToken ¶
ResolveAdapterViewerToken verifies that token belongs to an active /ether/v1/frontend/* call for pluginID and returns its authenticated viewer.
func (*Manager) ResolveText ¶
ResolveText looks up key in the plugin's strings for locale, then en.
func (*Manager) ResolveTextFunc ¶
func (m *Manager) ResolveTextFunc(ctx context.Context, id, locale string) func(string) (string, bool)
ResolveTextFunc returns a "$t:key" -> localized string lookup backed by the plugin's shipped strings for locale (then its base language, then "en"). Loading the strings once lets callers resolve many labels (such as a batch of kind projections or a view document) without repeated store reads. Returns nil when the plugin ships no strings.
func (*Manager) Revoke ¶
Revoke disables an installed plugin that was marked revoked in the signed catalogue, records the reason in its health, and posts a console notice (SPEC WS12, §10). It returns true when an installed plugin was newly disabled or updated with the revocation reason.
func (*Manager) SaveAddonConfig ¶
func (m *Manager) SaveAddonConfig(ctx context.Context, id string, ch AddonConfigChange) (Record, error)
SaveAddonConfig applies new settings in place: the plugin keeps its id, roles, pins and collections; only its sealed link and manifest change.
func (*Manager) SetBadgeQuotaForTest ¶
SetBadgeQuotaForTest overrides the per-plugin badged-title quota (<=0 restores PosterBadgeQuotaTitles). Intended for unit tests.
func (*Manager) SetCatalogue ¶
SetCatalogue attaches the signed plugin catalogue (WS12).
func (*Manager) SetEnabled ¶
SetEnabled enables or disables a plugin and refreshes its descriptors.
func (*Manager) SetFlowsBackends ¶
func (m *Manager) SetFlowsBackends(bus *events.Bus, reg *events.Registry, actions flows.ActionRegistry)
SetFlowsBackends wires the Events bus, Events schema registry, and Flows action registry after Manager construction and immediately registers all currently installed enabled plugins' events and actions.
func (*Manager) SetGrants ¶
SetGrants replaces one plugin's grants. Host calls re-check grants on every call, so a revoke applies mid-call.
func (*Manager) SetKindBackends ¶
func (m *Manager) SetKindBackends(b KindBackends)
SetKindBackends wires the kind host services into the Manager's Backends. Called once at startup by app wiring or in tests.
func (*Manager) SetResolveBadgeTitles ¶
func (m *Manager) SetResolveBadgeTitles(fn func(ctx context.Context, refs []BadgeTitleRef) ([]string, error))
SetResolveBadgeTitles wires the batched local catalogue lookup used by BadgesSet to map (type, tmdb, imdb) refs to canonical rating keys.
func (*Manager) SetRoles ¶
SetRoles switches an installed add-on's roles on or off: off lists the capabilities it should stop playing (its catalogs, streams, subtitles, Live TV channels…). Only roles its manifest offers can be named.
func (*Manager) SetSidecarState ¶
func (m *Manager) SetSidecarState(f SidecarState)
SetSidecarState installs the live sidecar check used for console health.
func (*Manager) SettingsSchema ¶
SettingsSchema returns the resolved settings schema for a plugin.
func (*Manager) SetupBlockers ¶
SetupBlockers lists the required setup steps still holding a plugin back: steps that have neither passed nor been skipped by the owner (spec §8). Content adapters keep libraries hidden and sync stopped while this is non-empty.
func (*Manager) SetupState ¶
SetupState returns every recorded setup step result for a plugin, with unrecorded steps reported as pending, in manifest order.
func (*Manager) SkipSetupStep ¶
SkipSetupStep records the owner's "skip for now" on one step, which unblocks the plugin while leaving the step visibly unfinished.
func (*Manager) Start ¶
Start re-registers descriptors and subscribes to cluster invalidations. Run starts the health, scheduler and outbox loops.
func (*Manager) StartEventBridge ¶
StartEventBridge subscribes the plugin host to Ether's events.Bus so plugins receive both canonical event types and translated legacy 12 event names without blocking publishers. Safe to call multiple times; returns a function that detaches the bridge subscription.
func (*Manager) StartExpandJob ¶
func (m *Manager) StartExpandJob(pluginID, routePath, dedupKey string, fn func(ctx context.Context, run *ExpandJobRunner) error) (bool, error)
StartExpandJob starts a lowered-priority background expansion job for (pluginID, dedupKey) sharing the plugin's ActionJobConcurrency = 2 background pool (never ResolverJobConcurrency). If a job for dedupKey is already running, it returns started=false, err=nil. If two background jobs are already running for pluginID, it returns ErrJobsBusy.
func (*Manager) StremioResource ¶
func (m *Manager) StremioResource(ctx context.Context, plugin, resource, typ, id string, extra map[string]string) (Response, error)
StremioResource calls declared read-only resources through the same guarded, metered runtime used by native adapters. It never treats registration as a call.
func (*Manager) SubscribeInvalidations ¶
func (m *Manager) SubscribeInvalidations() func()
SubscribeInvalidations re-syncs descriptors when another node changes a plugin. Returns an unsubscribe function (nil bus: no-op).
func (*Manager) Test ¶
Test calls the plugin's /ether/test; a plain Stremio add-on is tested by reading its manifest.
func (*Manager) TestAddonConfig ¶
func (m *Manager) TestAddonConfig(ctx context.Context, id string, ch AddonConfigChange) (AddonConfigResult, error)
TestAddonConfig loads the add-on with the new settings without saving.
func (*Manager) TestSetupStep ¶
func (m *Manager) TestSetupStep(ctx context.Context, pluginID, stepKey string) (SetupTestResult, error)
TestSetupStep runs one setup step's test against the saved settings and records the result. Only the step's non-secret field values are sent; secrets reach the plugin through SecretGet, never in the test body (spec §8). A step with no test route passes once it is run.
func (*Manager) TextResolver ¶
func (m *Manager) TextResolver() extend.TextResolver
TextResolver resolves a plugin string for a locale, falling back to en.
func (*Manager) UndoAll ¶
UndoAll replays a plugin's live journal inverses, newest first, and returns how many entries were undone.
func (*Manager) UndoSince ¶
UndoSince reverses the plugin's changes back to and including entry since (0 means all of them), newest first, so an older change is never reversed underneath a later one.
func (*Manager) UpdateHostJob ¶
UpdateHostJob updates an existing non-running host-managed job (for example when the owner acknowledges a paused delete guard and chooses to keep items).
type Manifest ¶
type Manifest struct {
ID string `json:"id"`
Version string `json:"version"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Logo string `json:"logo,omitempty"`
Background string `json:"background,omitempty"`
Types []string `json:"types,omitempty"`
AddonCatalogs []StremioCat `json:"addonCatalogs,omitempty"`
Catalogs []StremioCat `json:"catalogs,omitempty"`
Resources stremio.Resources `json:"resources,omitempty"`
IDPrefixes []string `json:"idPrefixes,omitempty"`
BehaviorHints stremio.BehaviorHints `json:"behaviorHints,omitzero"`
Ether *EtherBlock `json:"ether,omitempty"`
// contains filtered or unexported fields
}
Manifest is a plugin's manifest.json: the Stremio manifest fields, typed by the one Stremio model (internal/stremio), plus Ether's fields under Ether (SPEC §5.1.1). A manifest with a nil Ether is a plain Stremio add-on. Every Stremio rule (resources, ids, catalogs, extras) is the library's, reached through Stremio().
func ParseManifest ¶
ParseManifest decodes manifest JSON. Unknown fields are ignored (SPEC §5.1.1). Call Validate before trusting the result.
func (Manifest) AcceptsResource ¶
AcceptsResource reports whether the add-on serves resource for typ and id (internal/stremio.Manifest.TakesID).
func (Manifest) AddonRoles ¶
func (m Manifest) AddonRoles() []Capability
AddonRoles are the roles a plain Stremio add-on can play, derived from its manifest, whether or not the owner switched them off.
func (Manifest) CatalogsOfType ¶
func (m Manifest) CatalogsOfType(typ string) []StremioCat
CatalogsOfType returns the catalogs of one content type.
func (Manifest) ConfigurationRequired ¶
ConfigurationRequired reports an add-on installed from its unconfigured link.
func (Manifest) EffectiveEther ¶
func (m Manifest) EffectiveEther() *EtherBlock
EffectiveEther describes native adapters without modifying the foreign manifest stored on disk or inventing permissions for a third-party add-on.
func (Manifest) HasCapability ¶
func (m Manifest) HasCapability(c Capability) bool
HasCapability reports whether the manifest declares c.
func (Manifest) HasResource ¶
HasResource reports whether the manifest declares the named resource.
func (Manifest) IsStremioOnly ¶
IsStremioOnly reports whether m is a plain Stremio add-on (no ether block).
func (Manifest) MediaKindByKey ¶
func (m Manifest) MediaKindByKey(key string) (MediaKindMeta, bool)
MediaKindByKey returns the declared kind with this key, if any.
func (Manifest) RuntimeKind ¶
RuntimeKind is the runtime that serves the plugin. A plain Stremio add-on (no ether block) is always reached over HTTP: "remote".
func (Manifest) ServesLiveEvents ¶
ServesLiveEvents reports whether a plain Stremio add-on publishes event catalogs of custom (non-movie, non-series, non-tv) types with streams.
func (Manifest) ServesTV ¶
ServesTV reports whether a plain Stremio add-on is a Live TV source: it either lists `tv` catalogs with `tv` streams or publishes event catalogs of custom live types with playable streams.
func (Manifest) SpeaksStremio ¶
SpeaksStremio reports whether Ether reads this plugin's catalogues, metadata, subtitles, channels and directories over Stremio routes: a plain add-on, or a native plugin built from one in Studio.
func (*Manifest) UnmarshalJSON ¶
UnmarshalJSON completes a Stremio-backed plugin's roles from its catalogs and resources wherever a manifest is read: packages, stored records and drafts alike.
type MarkersMeta ¶
type MarkersMeta struct {
Kinds []string `json:"kinds"` // intro|credits|recap|preview
}
MarkersMeta is mandatory for markers.
type MediaKindMeta ¶
type MediaKindMeta struct {
Key string `json:"key"` // ^[a-z][a-z0-9-]{0,31}$, unique in the plugin
Label string `json:"label"`
Media string `json:"media,omitempty"` // video|music|audiobook|book|podcast|photo
Library KindLibraryDecl `json:"library,omitzero"`
Levels []KindLevel `json:"levels"` // 1..5, first is the root
Fields []KindField `json:"fields,omitempty"` //
Art []KindArt `json:"art,omitempty"` // roles beyond poster/backdrop/thumb/logo
Present core.Presentations `json:"present,omitzero"`
Browse KindBrowseDecl `json:"browse"`
Sync KindSyncDecl `json:"sync"`
Cache KindCacheDecl `json:"cache,omitempty"`
Match KindMatchDecl `json:"match,omitempty"`
}
MediaKindMeta declares one content kind (spec §2.1).
func (MediaKindMeta) DeclHash ¶
func (k MediaKindMeta) DeclHash() string
DeclHash is the upgrade gate for an installed kind (spec §2.3/§2.5): the SHA-256 of the declaration's canonical JSON. Go marshals struct fields in declaration order and map keys sorted, so equal declarations always hash equal.
func (MediaKindMeta) HasLibrary ¶
func (k MediaKindMeta) HasLibrary() bool
HasLibrary reports whether this media kind declares a library block. Creating a library is optional per kind: a kind without a library block (for example, a resolver-only kind) creates no library.
type MetadataMeta ¶
type MetadataMeta struct {
Types []string `json:"types"`
}
MetadataMeta declares a provider of canonical catalogue records. Resolution happens during explicit materialization, never as part of ordinary browsing. Ether-native providers implement POST /ether/metadata/resolve using core.MetadataRequest and a {"title": core.Title} response.
type NotificationMeta ¶
type NotificationMeta struct {
Fields json.RawMessage `json:"fields,omitempty"`
SendTest bool `json:"sendTest"`
Formats []string `json:"formats,omitempty"`
MaxLength int `json:"maxLength,omitempty"`
}
NotificationMeta is mandatory for notify.
type OnAirFeed ¶
type OnAirFeed struct {
ID string `json:"id"`
Fields map[string]string `json:"fields"`
Sample map[string]any `json:"sample,omitempty"`
MaxAge string `json:"maxAge"`
}
OnAirFeed declares a bounded household feed. MaxAge is a Go duration.
type OnAirSegment ¶
type OnAirSegment struct {
ID string `json:"id"`
Name string `json:"name"`
Duration int `json:"duration"`
File string `json:"file"`
Feeds []string `json:"feeds"`
Rating string `json:"rating,omitempty"`
}
OnAirSegment is a fixed-duration declarative scene, never arbitrary video.
type PageMeta ¶
type PageMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Route string `json:"route"` // plugin route returning {spec,data}
Group string `json:"group,omitempty"`
Icon string `json:"icon,omitempty"`
}
PageMeta is one contributed console page (ViewSpec, SPEC §5.6).
type PendingReply ¶
type PendingReply struct {
Pending bool `json:"pending"`
RetryInMS int64 `json:"retryInMs,omitempty"`
Job string `json:"job,omitempty"`
}
PendingReply defers a kind resolve or match without recording a failure. RetryInMS is clamped to 250..5000. Job is an optional /ether/job/ route; the host passes the original request body and drives job continuations.
type PermissionIncreaseError ¶
type PermissionIncreaseError struct{ Added []string }
PermissionIncreaseError reports an update that asks for more access.
func (*PermissionIncreaseError) Error ¶
func (e *PermissionIncreaseError) Error() string
type Permissions ¶
type Permissions struct {
Network []string `json:"network,omitempty" yaml:"network,omitempty"`
Catalog string `json:"catalog,omitempty" yaml:"catalog,omitempty"` // ""|none|read
Viewers ViewerPerms `json:"viewers,omitempty" yaml:"viewers,omitempty"`
Collections string `json:"collections,omitempty" yaml:"collections,omitempty"` // ""|none|write
Folders string `json:"folders,omitempty" yaml:"folders,omitempty"` // ""|none|read
// Sources lets a kind resolver ask Ether to find bytes through the
// owner's indexers and debrid accounts (spec §4.5).
Sources string `json:"sources,omitempty" yaml:"sources,omitempty"` // ""|none|search|acquire
// AI lets a plugin send bounded completion requests to the owner's
// configured language model (actions/jobs/sync only, never viewer paths).
AI string `json:"ai,omitempty" yaml:"ai,omitempty"` // ""|none|complete|complete+search
Secrets []string `json:"secrets,omitempty" yaml:"secrets,omitempty"`
}
Permissions is what a plugin asks for; anything not declared is denied (SPEC §5.4). Empty means none.
type PoolHealth ¶
type PoolHealth struct {
Size int `json:"size"`
InUse int `json:"inUse"`
Idle int `json:"idle"`
Building int `json:"building"`
Waiting int `json:"waiting"`
Exhaustions int64 `json:"exhaustions"`
Holders []PoolHolderHealth `json:"holders,omitempty"`
}
PoolHealth reports live instance-pool health for a hosted plugin.
type PoolHolderHealth ¶
PoolHolderHealth identifies one active route holding a hosted plugin instance.
type PosterBadgeSetMeta ¶
type PosterBadgeSetMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
}
PosterBadgeSetMeta declares one poster overlay badge set contributed by a plugin (#594).
type Preview ¶
type Preview struct {
Manifest Manifest `json:"manifest"`
RuntimeLimits *RuntimeLimits `json:"runtimeLimits,omitempty"`
// Summary is the manifest summary with any "$t:" reference resolved
// from the package's own strings.
Summary string `json:"summary,omitempty"`
// Icon is a browser-loadable URL or rasterized PNG data URI for preview.
Icon string `json:"icon,omitempty"`
PermissionLines []string `json:"permissions"`
NeedsViewers bool `json:"needsViewers"`
NeedsFolders bool `json:"needsFolders"`
NeedsOperatorHosts bool `json:"needsOperatorHosts,omitempty"`
LocalHosts []string `json:"localHosts,omitempty"`
PendingOperatorHosts []string `json:"pendingOperatorHosts,omitempty"`
Verified bool `json:"verified"`
StremioOnly bool `json:"stremioOnly"`
AlreadyInstalled bool `json:"alreadyInstalled,omitempty"`
InstalledVersion string `json:"installedVersion,omitempty"`
AddedPermissions []string `json:"addedPermissions,omitempty"`
// contains filtered or unexported fields
}
Preview is what the install sheet shows before the owner confirms.
type PublishedEventMeta ¶
type PublishedEventMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Version int `json:"version,omitempty"`
Fields []EventFieldMeta `json:"fields,omitempty"`
}
PublishedEventMeta declares one custom event type a plugin emits through Host.PublishEvent ("plugin:<pluginId>/<key>").
func ValidatePublishEventCall ¶
func ValidatePublishEventCall(man Manifest, key string, payload json.RawMessage) (PublishedEventMeta, events.EventSchema, error)
ValidatePublishEventCall verifies capability, declared key, payload size, and payload schema against man. Exported for conformance kit and Studio sandboxes.
type RankingReport ¶
type RankingReport struct {
// Slow counts candidates and conditions that went neutral on budget.
Slow int
// Skipped counts ranking steps left out because the plugin ran past
// its time budget; Ranked counts ranking steps that finished in time.
Skipped, Ranked int
}
RankingReport is what one resolve saw of a plugin on the hot path.
type RankingStepMeta ¶
type RankingStepMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Hint string `json:"hint,omitempty"`
Editor json.RawMessage `json:"editor,omitempty"`
Budget json.RawMessage `json:"budget,omitempty"`
}
RankingStepMeta is one contributed ranking step (hosted only).
type RasterizeOptions ¶
type RasterizeOptions struct {
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Format string `json:"format,omitempty"`
}
RasterizeOptions selects the output size and format for cache.rasterize. A zero Width or Height keeps the SVG aspect ratio; both zero renders at the rasteriser's default width. Width and Height are each bounded by artwork.MaxRasterDimension and Format is "png" (default) or "jpeg".
type RasterizeResult ¶
type RasterizeResult struct {
Blob string `json:"blob"`
ContentType string `json:"contentType"`
Width int `json:"width"`
Height int `json:"height"`
Size int64 `json:"size"`
}
RasterizeResult is returned by cache.rasterize after rasterising a cached SVG blob into a new cached bitmap blob in the plugin's own library cache.
type Record ¶
type Record struct {
ID string
Name string
Version string
Kind string
Manifest Manifest
ManifestRaw json.RawMessage
SourceKind string // url|github|pkg|studio|catalogue
SourceURL string
Enabled bool
Verified bool
Shadow bool
AutoUpdate bool
UpdateVersion string
PrevVersion string
InstalledAt time.Time
UpdatedAt time.Time
// RolesOff are the capabilities the owner switched off (a Stremio
// add-on's catalogs, streams, subtitles…). Manifest already reflects
// them: EffectiveEther leaves them out.
RolesOff []Capability
// contains filtered or unexported fields
}
Record is one installed plugin as stored.
type Request ¶
type Request struct {
Op string `json:"op,omitempty"`
ID string `json:"id,omitempty"`
PluginID string `json:"pluginId"`
Method string `json:"method"`
Path string `json:"path"`
Query map[string]string `json:"query,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Body json.RawMessage `json:"body,omitempty"`
// BodyBase64 carries the exact request bytes, base64-encoded, when the
// caller needs them byte-for-byte (frontend adapter routes). Body holds
// the parsed JSON value when the bytes are valid JSON; a non-JSON body
// arrives only here, never as an invalid RawMessage.
BodyBase64 string `json:"bodyBase64,omitempty"`
ContentType string `json:"contentType,omitempty"`
// Locale is the console locale for calls that return copy.
Locale string `json:"locale,omitempty"`
// Foreground marks an /ether/job/ call that a viewer is waiting on
// (playback resolution). It never yields to background throttling.
// Host-side only; never sent to the plugin.
Foreground bool `json:"-"`
// Deadline carries the effective per-call deadline computed by the manager
// (including live overrides) for hosted runtimes. Host-side only.
Deadline time.Duration `json:"-"`
// AISearch marks a search route whose plugin has active permissions.ai:
// "complete+search" so hosted runtimes allow Deadline up to the AI search
// route bound. Host-side only.
AISearch bool `json:"-"`
}
Request is one HTTP-shaped call from Ether to a plugin (SPEC §5.1.2). Hosted plugins receive the same object in-process.
type Response ¶
type Response struct {
Blob *FrontendBlob `json:"blob,omitempty"`
Status int `json:"status"`
Headers map[string]string `json:"headers,omitempty"`
Body json.RawMessage `json:"body,omitempty"`
}
Response is a plugin's answer to a Request.
type RoleState ¶
type RoleState struct {
Role Capability `json:"role"`
On bool `json:"on"`
}
RoleState is one role of an add-on for the console.
type RuleConditionMeta ¶
type RuleConditionMeta struct {
Key string `json:"key"`
Label string `json:"label"`
Operators []string `json:"operators,omitempty"`
Editor json.RawMessage `json:"editor,omitempty"`
}
RuleConditionMeta is one contributed rule condition (hosted only).
type Runtime ¶
Runtime is how the host reaches one installed plugin. WS8a (hosted) and WS8b (remote) implement it; tests use a fake. Call must honour ctx deadlines. Close releases the instance; the host may open a fresh one after a failure (restart with backoff).
type RuntimeDecl ¶
type RuntimeDecl struct {
Kind string `json:"kind"` // "hosted" or "remote"
Entry string `json:"entry,omitempty"`
Module string `json:"module,omitempty"`
Limits *RuntimeLimits `json:"limits,omitempty"`
}
RuntimeDecl declares how a plugin runs: hosted (Entry JS or Module WASM) or remote (the manifest URL or a tunnel is the endpoint).
type RuntimeFactory ¶
RuntimeFactory opens a Runtime for one installed plugin. The factory is chosen by manifest ether.runtime.kind ("hosted" or "remote").
func HostedRuntimeFactory ¶
func HostedRuntimeFactory(eng *wasm.Engine) RuntimeFactory
HostedRuntimeFactory opens hosted plugins (runtime.kind "hosted") on the wazero engine: JavaScript and TypeScript entries run on QuickJS, raw modules through the documented WASM ABI.
type RuntimeLimits ¶
type RuntimeLimits struct {
FetchBytes int64 `json:"fetchBytes,omitempty"`
ArchiveMemberBytes int64 `json:"archiveMemberBytes,omitempty"`
ArchiveExpandedBytes int64 `json:"archiveExpandedBytes,omitempty"`
ArchiveMembers int `json:"archiveMembers,omitempty"`
MaxItems int `json:"maxItems,omitempty"` // default 2,000,000 stored items across the plugin's libraries; owner-controlled
MemoryBytes uint64 `json:"memoryBytes,omitempty"` // default 32 MiB, ceiling owner-controlled, up to 4 GiB
// ReadBytes is the granted per-call byte ceiling for cache.read,
// archive.open and archive.read, derived from MemoryBytes:
// clamp(memoryBytes/4, 8 MiB, 512 MiB).
ReadBytes int64 `json:"readBytes,omitempty"`
// Deadline and UnitBudget are the granted ceilings in manifests/detail
// and the active route's effective call limits when read via runtime.limits.
Deadline string `json:"deadline,omitempty"` // Go duration; default 12h ceiling, clamped per route on active calls
UnitBudget int64 `json:"unitBudget,omitempty"` // default effectively unlimited ceiling; viewer routes clamp to 10,000 units/s of Deadline
// PoolSize is the hosted WASM instance pool size (default 2; default owner
// ceiling 4, raisable up to 16). With poolSize >= 3 at least one instance is
// reserved exclusively for playback resolves and background jobs hold at
// most poolSize-2; with poolSize == 2 background jobs and frontend adapters
// share at most one instance so resolves and health checks keep one free.
PoolSize int `json:"poolSize,omitempty"`
}
RuntimeLimits requests per-call hosted resources and data/catalogue ceilings. Ether grants defaults for omitted fields and clamps requests to owner-controlled ceilings.
func GrantedRuntimeLimits ¶
func GrantedRuntimeLimits(m Manifest) *RuntimeLimits
GrantedRuntimeLimits reports the default-policy grant for standalone tools.
type ScheduleEntry ¶
ScheduleEntry is one pull job Ether runs (minimum interval 15m).
type SetupMeta ¶
type SetupMeta struct {
Steps []SetupStep `json:"steps"`
}
SetupMeta declares guided setup for any plugin kind (spec §8).
type SetupStep ¶
type SetupStep struct {
Key string `json:"key"`
Label string `json:"label"`
Hint string `json:"hint,omitempty"`
Fields []string `json:"fields"` // settings field keys this step collects
Test string `json:"test"` // plugin route, or "" for no test
Required bool `json:"required"`
}
SetupStep is one setup wizard step. An empty Test means saving the fields is the whole step; otherwise Ether posts the step's saved field values to Test, conventionally /ether/v1/setup/<key>/test.
type SetupStepState ¶
type SetupStepState struct {
Step string `json:"step"`
Status string `json:"status"` // pending|ok|failed|skipped
Detail string `json:"detail,omitempty"`
At time.Time `json:"at"`
}
SetupStepState is the stored result of one setup step.
type SetupTestResult ¶
type SetupTestResult struct {
OK bool `json:"ok"`
Detail string `json:"detail,omitempty"`
Fields map[string]string `json:"fields,omitempty"` // settings key -> problem
}
SetupTestResult is the plugin's answer to a setup test call.
type SidecarDecl ¶
type SidecarDecl struct {
// Docker is an image reference (registry/name:tag or @sha256).
Docker string `json:"docker,omitempty"`
// Download is an https URL to the program.
Download string `json:"download,omitempty"`
// Command starts the program after download (single line, <= 200 chars).
Command string `json:"command,omitempty"`
// Docs is an https URL with setup instructions.
Docs string `json:"docs,omitempty"`
}
SidecarDecl says how a remote plugin's program comes to be: a Docker image, a download with a start command, or documentation only. Every field is optional; an empty block is valid but the console shows only the pairing code.
type SidecarState ¶
SidecarState reports whether an installed plugin is served by a sidecar and whether one is connected now. The app wires it from the remote runtime; nil means no plugin needs a sidecar.
type SlotMeta ¶
type SlotMeta struct {
Slot string `json:"slot"` // title.panel|viewer.tab|dashboard.panel|actionMenu.*
Key string `json:"key"`
Label string `json:"label"`
Route string `json:"route,omitempty"`
Action string `json:"action,omitempty"`
}
SlotMeta is one contributed console slot.
type Source ¶
type Source struct {
Kind string // url|github|pkg|studio|catalogue
URL string
// ID and Version select an entry from the signed catalogue (kind "catalogue").
ID string
Version string
// SHA256 is the expected lowercase hex SHA-256 of the downloaded artifact.
SHA256 string
// Pkg is the .etherpkg bytes (kind "pkg") or a Studio package.
Pkg []byte
// Manifest and Files install directly (Studio with loose files).
Manifest json.RawMessage
Files map[string][]byte
// Verified is set only by the signed catalogue (WS12).
Verified bool
// LAN allows a private-network manifest URL (owner confirmed).
LAN bool
// contains filtered or unexported fields
}
Source describes where an install comes from.
type SourceMeta ¶
type SourceMeta struct {
Class string `json:"class"` // debrid|usenet|indexer|direct
Abilities []string `json:"abilities,omitempty"`
Limits json.RawMessage `json:"limits,omitempty"`
}
SourceMeta is mandatory for stream_source.
type StreamURLOptions ¶
type StreamURLOptions struct {
PartIndex *int `json:"partIndex,omitempty"`
Source string `json:"source,omitempty"`
}
StreamURLOptions scopes a frontend adapter stream ticket to a specific zero-based item part and/or resolver PlayableSource.ID (#576, #661).
type StremioExtra ¶
StremioExtra is one catalog extra declaration.
type SubtitlesMeta ¶
type SubtitlesMeta struct {
Languages json.RawMessage `json:"languages,omitempty"`
Formats []string `json:"formats,omitempty"`
}
SubtitlesMeta is mandatory for subtitles. Languages is "any" or a list.
type Summary ¶
type Summary struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Kind string `json:"kind,omitempty"`
Summary string `json:"summary,omitempty"`
Icon string `json:"icon,omitempty"`
Enabled bool `json:"enabled"`
Verified bool `json:"verified"`
Shadow bool `json:"shadow"`
AutoUpdate bool `json:"autoUpdate"`
UpdateVersion string `json:"updateVersion,omitempty"`
PrevVersion string `json:"prevVersion,omitempty"`
Health string `json:"health"`
// HealthReason is the plain-language reason behind a non-ok health,
// such as "Recent calls were slow."
HealthReason string `json:"healthReason,omitempty"`
// HealthSidecar is "waiting" while the plugin's sidecar is not connected.
HealthSidecar string `json:"healthSidecar,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
SourceKind string `json:"sourceKind,omitempty"`
StremioOnly bool `json:"stremioOnly,omitempty"`
InstalledAt int64 `json:"installedAt"`
// Roles and Host describe a Stremio add-on: what it can do, which of
// that is switched on, and the host it is reached at (never the link,
// which carries the owner's configuration).
Roles []RoleState `json:"roles,omitempty"`
Host string `json:"host,omitempty"`
}
Summary is one row of the installed list.
type TestResult ¶
type TestResult struct {
OK bool `json:"ok"`
Message string `json:"message,omitempty"`
Details []string `json:"details,omitempty"`
}
TestResult is the plugin's /ether/test answer.
type ToolMeta ¶
type ToolMeta struct {
Name string `json:"name"`
Title string `json:"title"`
Description string `json:"description"`
InputSchema json.RawMessage `json:"inputSchema"`
ReadOnly bool `json:"readOnly,omitempty"`
Destructive bool `json:"destructive,omitempty"`
OpenWorld bool `json:"openWorld,omitempty"`
}
ToolMeta is one contributed agent tool.
type UnsafeArchiveMemberError ¶
UnsafeArchiveMemberError describes an archive member whose stored name is unsafe to use as a filesystem path. By-index archive reads no longer refuse members for their name; Name is an identifier only.
func (*UnsafeArchiveMemberError) Error ¶
func (e *UnsafeArchiveMemberError) Error() string
type ValidationError ¶
type ValidationError struct{ Fields []FieldError }
ValidationError carries every field problem found at once.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type ViewerPerms ¶
type ViewerPerms struct {
Identity string `json:"identity,omitempty" yaml:"identity,omitempty"` // none|granted_viewers|all
WatchHistory string `json:"watch_history,omitempty" yaml:"watch_history,omitempty"` // none|granted_viewers|all
WriteWatchState string `json:"write_watch_state,omitempty" yaml:"write_watch_state,omitempty"` // none|granted_viewers
}
ViewerPerms holds the three viewer permission levels.
Source Files
¶
- action_jobs.go
- addon_bridge.go
- addon_form.go
- addon_relay.go
- addonconfig.go
- addons.go
- bus_events.go
- collection_context.go
- contract.go
- descriptors.go
- directory.go
- events.go
- frontend_blob.go
- hash_jobs.go
- host.go
- host_ai.go
- host_archive.go
- host_archive_cache.go
- host_badges.go
- host_data.go
- host_fetch_many.go
- host_flows.go
- host_kinds.go
- hosted.go
- http.go
- install.go
- job_priority_linux.go
- list_params.go
- local_hosts.go
- manager.go
- manifest.go
- manifest_kinds.go
- notify_adapter.go
- onair_feeds.go
- onair_manifest.go
- operator_hosts.go
- pending.go
- plugin_text.go
- preview_host.go
- proposals.go
- remote_hash.go
- runtime_limits.go
- settings_public.go
- setup.go
- store.go
- stremio_manifest.go
- stremio_resource.go
- subtitle_pick.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adapters bridges runtime plugin contributions (WS9a list sources and WS9c Live TV channel sources) into Ether's collection, personalization and Live TV registries.
|
Package adapters bridges runtime plugin contributions (WS9a list sources and WS9c Live TV channel sources) into Ether's collection, personalization and Live TV registries. |
|
Package devreference generates the console's plugin API reference from source.
|
Package devreference generates the console's plugin API reference from source. |
|
cmd
command
|
|
|
Package frontendadapter registers one generic Ether frontend per plugin-provided protocol surface (spec §6.5).
|
Package frontendadapter registers one generic Ether frontend per plugin-provided protocol surface (spec §6.5). |
|
Package kit implements Ether's plugin conformance kit and copy linter (SPEC §5.1–§5.6, WS11g), shared across install previews, Studio, the `ether plugin` CLI, and catalogue CI.
|
Package kit implements Ether's plugin conformance kit and copy linter (SPEC §5.1–§5.6, WS11g), shared across install previews, Studio, the `ether plugin` CLI, and catalogue CI. |
|
Package pkgdigest defines the canonical Ether plugin package integrity digest.
|
Package pkgdigest defines the canonical Ether plugin package integrity digest. |
|
Package remote is the remote plugin runtime (SPEC §5.3, WS8b).
|
Package remote is the remote plugin runtime (SPEC §5.3, WS8b). |
|
Package remotetest supplies remote plugin transport fixtures for tests.
|
Package remotetest supplies remote plugin transport fixtures for tests. |
|
Package studio provides the plugin Studio replay runner (WS11c) and the Studio and extensibility MCP and agent tools (WS11h).
|
Package studio provides the plugin Studio replay runner (WS11c) and the Studio and extensibility MCP and agent tools (WS11h). |
|
Package wasm is Ether's hosted plugin runtime: it runs plugin code inside the Ether process, sandboxed, with no ports and no operating-system access.
|
Package wasm is Ether's hosted plugin runtime: it runs plugin code inside the Ether process, sandboxed, with no ports and no operating-system access. |