Skip to content

Limits and engine quirks

Every number in one place

What Limit
Manifest / entry file / icon 16 KB / 1 MB / 128 KB
Memory / stack, per plugin 64 MB / 1 MB
Time per call search 15 s; home, browse, episodes, resolve 20 s each (resolve of a plugin Kino itself generates, from a Nuvio scraper or a Stremio addon: 75 s); prepare 15 s (a background call, its answer ignored); liveCategories, liveChannels, guide 20 s each; liveSearch 15 s; subtitles 10 s; track 10 s (apiVersion 7); segments 8 s (apiVersion 7); lyrics 10 s (apiVersion 19); meta 6 s (apiVersion 6; past it, no answer); section, categories 20 s each (apiVersion 6); details 20 s (apiVersion 8); migrate 10 s; sign 1.5 s (and 3 s counting its wait); counting all your fetches and sleeps together, but not the time the person spends answering a host question for that call
Loading the module (its top level) 10 s
Idle sandbox closed after 5 minutes without calls
Consecutive timeouts 3 in a row and Kino disables the plugin ("No responde")
kino.fetch https only (or the person's own server as typed, or http on a host declared insecureHttp); 15 s default, 30 s maximum; response body at most 5 MB; the request (URL, headers and body) at most 1,048,576 characters; inside a sync provider's syncPull and syncPush only, both the request and the response body may reach the declared blob's base64 plus 64 KB (ceil(sync.maxBlobBytes × 4/3) + 65,536); at most 60 requests per call, every hop counted, refused ones included (250 for a plugin converted from a Nuvio scraper); at most 6 fetches in flight at once; at most 3 host questions per call; at most 10 redirects per request; under "fetchHosts": "any", a host reached only through it: https on port 443, a dotted name or public IPv4 address, at most 60 requests a minute per site and 600 every 10 minutes per plugin (250 / 2,500 for a converted Nuvio scraper), else rate_limited
Cookies 50 per domain, 64 KB in total per plugin
kino.storage 256 KB per plugin (with storageLarge, apiVersion 13: 16 MB in total, 2 MB per value, 1,000 keys of at most 256 characters); an entry's optional ttlMs is 1..2,592,000,000 ms (30 days)
kino.sleep 0 to 5,000 ms per call
kino.meta (Kino 0.9.53) at most 30 calls a minute per plugin; 8 s at most (each other meta plugin 6 s), inside your call's own limit; the query at most 4,096 characters; the answer at most 1,000,000 characters; cached 30 minutes
kino.tmdb (Kino 0.9.53) at most 40 calls per 10 s per plugin; on Kino's own key at most 20 per 10 s per plugin and 60 per 10 s for all plugins (then the person's key, else the cache or rate_limited); 15 s per call; a body at most 2 MB; at most 20 params of at most 500 characters; cached and shared by all plugins, per route (12 hours for a series by id and its seasons and episodes; 30 days for a movie, person or collection by id, any title's credits, images and the like, and for /find, /genre, /configuration; 24 hours for /search; 3 hours for /trending, /discover and the lists; 10 minutes for anything else, an empty answer or a 404), bodies up to 512 KB; a cached answer does not count against these limits, and when TMDB fails (not when it refuses the key) the last copy is served; not counted in kino.fetch's requests per call
kino.crypto data at most 5 MB per call; PBKDF2 at most 100,000 iterations and 64-byte keys; randomBytes at most 1,024
kino.ws (apiVersion 13) at most 4 open sockets per plugin (the fifth is refused with limit); at most 8 MiB (8,388,608 bytes) of received messages queued unread per socket, past that the socket closes with limit; a frame to send at most 786,000 bytes once decoded, also when sent as a hex or base64 string (too_large); one recv waits at most 60 s; wss:// to a declared, approved host only; memory: what is queued unread sits on Kino's heap (up to 32 MiB with every socket full), what you keep from it counts in your 64 MB sandbox; not measured on 1 GB TV boxes, so read what arrives and keep little
byteSource (apiVersion 13) at most 2 open streams at once on the device (another is refused), and apart from them at most 2 served to TVs (one per Chromecast and DLNA cast); each read asks for 1 MiB (1,048,576 bytes) at an offset that is a multiple of 1,048,576 (so always a multiple of 4,096), the last one running past size; 3 chunks ahead are read while one plays; Kino keeps the last 8 chunks read per stream; handle 1 to 512 characters; memory: each open stream holds up to about 12 MiB of Kino's heap (the chunks kept, the ones read ahead and the one in flight), so 2 on the device plus 2 served to TVs can reach about 48 MiB, besides your 64 MB sandbox; not measured on 1 GB TV boxes
kino.catalog (apiVersion 13) at most 100,000 items per plugin (then limit), as long as they fit in the file: about 670 bytes per item on average, so keep data small; id 1 to 128 characters, title at most 300 characters, data at most 4,096 bytes of JSON; at most 500 items or ids per call; search: q at most 256 characters, limit default 50, at most 100, offset at most 1,000,000; the database file at most 64 MiB (then limit); one SQLite file per plugin, on the device only
kino.qr.scan (apiVersion 13) one scanner on screen at a time (another scan, from any plugin, is busy); it closes after 120 s (timeout); title and titleEn at most 80 characters; the scanned text 1 to 4,096 characters (a longer code is ignored); only from a settings action, a panelAction or a screenEvent that follows the person's tap or submit (else not_allowed), never on a TV or a device without a camera (unavailable); a settings qr setting's text at most 512 characters, asked again every 2,000 to 60,000 ms (refreshMs)
kino.files (apiVersion 21) pick and pickFolder only from a press of the person's (else not_allowed); the picker closes after 180 s (timeout); read and readText 2,000,000 bytes a call; 500 handles, 20 folders, 5,000 files read from a folder, 50 in one pick; copy: true up to 64 MB a file and 1 GB in all (Files on the device)
kino.progress (apiVersion 22) id 1 to 128 characters of A-Z a-z 0-9 . _ ~ -; resume 1024 bytes serialized; label and labelEn 80 characters each, title 200; 500 elements per plugin (the oldest by last activity dropped); list 100 at most, 50 by default; written to disk at most every 2 s; 20 set calls a second, the rest coalesced; finished at done: true or fraction >= doneAt (0.9); refused in a job for a profile other than the active one (Saving where the person is)
kino.image.thumbnail (Kino 0.9.84) url https of at most 2,048 characters; maxWidth 32 to 400 (default 200); maxBytes 2,048 to 32,768 (default 16,384); a download of at most 5 MB under your kino.fetch rules; 20 calls a minute per plugin; never from sign() (kino.image.thumbnail)
Images from the plugin (imageSource, apiVersion 13) handle 1 to 512 characters, no control character; image answers at most 256 KB once decoded (262,144 bytes), canonical base64, image/jpeg, image/png, image/webp only; 10 s per call; at most 1 image call in flight per plugin, none while one of your byte streams is open or your read is queued or running or ended less than 2 s ago (an image waits up to 20 s, then is skipped); a timed-out call discards your sandbox (QuickJS cannot be interrupted); a failed handle is not asked again for 5 minutes; 2 timeouts in a row pause your images for 5 minutes; each image asked once, then kept in Kino's image disk cache per plugin, version and handle
kino.log / console.* 2,000 characters per message; when a call of a plugin whose manifest declares telemetry fails, its last 30 lines (each cut at 300 characters, scrubbed, 2,048 characters in all) go with the failure report
What a function returns at most 2,000,000 characters once turned into JSON (a sync provider's syncPull and syncPush: up to ceil(sync.maxBlobBytes × 4/3) + 65,536, set by its declared blob)
Results search 100 items; home 20 rows of 60; browse 100 per page; episodes 5,000 (and 50 seasons); ref 4,096 characters; next 2,048 characters; id matches ^[A-Za-z0-9._~-]{1,128}$
Live channels (apiVersion 3) liveCategories 200; liveChannels 500 per page, 10 pages at first and 5 more per scroll, 10,000 channels (200 pages) per category; liveSearch 100 channels, asked from 2 characters; guide 50 channels and 24 h per call, 100 entries per channel; number 1..9999
Tracking (apiVersion 7) progress at most every 5 minutes of playback; watched once, with 3 minutes or less left and at least 90% played; at most 200 events waiting per plugin; an event not delivered within 7 days is dropped; a retryable failure waits 30 s, doubling up to 6 h, 12 tries at most
Settings at most 12 with a value, plus at most 16 section/status/action/link/help (apiVersion 6; link and help apiVersion 12, at most 4 of each) and qr (apiVersion 13); text 500, url 2,048, password 500 characters; a link's address 2,048, a help's title 60 and body 2,000
Error messages your kino.error message is a detail for the log, cut at 200 characters; a userMessage for the person is at most 160
hosts at least 1 entry, no upper limit from Kino 0.9.45 (only the manifest's 16 KB; Kino 0.9.44 and older refuse more than 20); from apiVersion 2, none ([]) when a url setting exists; from apiVersion 20, none in a provides-only plugin or a screen-only consumer (a non-empty consumes and capabilities exactly ["screen"])
secrets (apiVersion 4) at most 16; names match ^[A-Za-z][A-Za-z0-9_]{0,31}$; a value is 1..4,096 bytes (1..8,192 from apiVersion 6); from apiVersion 6 a cipher key may be typed: { seal, use: "cipher-key", encoding: "hex" | "base64" }, 16/24/32 bytes
kino.fetch maxBytes (apiVersion 14) 1 to 2,000,000 bytes of the body are read, the answer's truncated says whether it was cut; out of range: invalid_request
Screens (screen, apiVersion 14) depth 10, 600 nodes, 500 items per list, state 64 KB, a text 2,000 characters; screen and screenEvent 20 s each; every number in Screen limits
kino.library (apiVersion 14) limit default 50, at most 100; at most 30 calls a minute per plugin; times rounded to the day, progress to 0.01
kino.library.stats (apiVersion 17) one month's aggregates (month as yyyy-mm, the current one by default), nothing finer; top at most 20 titles; shares the 30 calls a minute of watched and saved; never 18+, live channels in the totals and never named
kino.room (apiVersion 14) a payload at most 8,192 bytes and 4 levels; 5 messages a second, 100 and 256 KB a minute per member; 2 to 8 members; 10 to 240 minutes (default 120); mailbox 200 events or 15 minutes; 2 joined and 1 hosted per device, 2 per plugin; 5 wrong codes lock joins for 60 s, doubling up to 30 minutes; closed after 30 minutes in the background (a hosted room shows Kino's notification meanwhile)
Jobs (schedule, apiVersion 14) 1 to 3 jobs, every 15 to 1,440 minutes; one run at most 20 s, 10 requests made one at a time, 2 MB of answers and 256 KB written to kino.storage; 96 runs a day per plugin; a failure waits 15 minutes, doubling up to 6 h, and 3 in a row pause the job; from apiVersion 17 a plugin with ai approved gets 60 s and 20 requests
kino.ai (apiVersion 14) a prompt at most 8,192 bytes, system 2,048; the reply cut at maxChars (1 to 4,096, default 2,048); 10 asks in any minute, 100 a day and 1 at a time per plugin; 300 a day and 2 at a time for every plugin of the device together; 20 s an ask
Player slot (playerSlot, apiVersion 23) 1 to 3 elements in the manifest (all plugins together: 3 on screen, fixed first); a text at most 2 lines (2,000 characters), a button's label 40; refreshMs raised to 2,000 or lowered to 60,000 ms; playerSlot and playerSlotAction 5 s each; until the first answer a failed playerSlot is retried 4 times, 5 s apart
kino.shared (apiVersion 14) 4 keys of at most 40 characters per plugin; a value at most 64 KB and 16 levels, 128 KB in all; 30 writes a minute; a key's new value travels at most once every 60 s
kino.plugins.call (apiVersion 20) a request and an answer at most 64 KB of JSON; 10 s a call; 30 calls in any 10 s per door; a manifest holds at most 4 doors (each 16 calls and 8 streams) and 8 consumes entries; a stream polls every 30 s at least; 4 live subscriptions per plugin; not in a background job
What (apiVersion 15) Limit
kino.identity (apiVersion 15) only inside a call the person started; at most 10 calls a minute per plugin; a challenge of 16 to 128 characters A-Z a-z 0-9 _ -; the token only for the author keys in kinoIdentity.tokenAuthors (any other author gets id and the attestation from Kino 0.9.88, permission_denied before) (Identity)
kino.notifications (apiVersion 15) at most 20 posts an hour per plugin, 30 notices kept for 30 days; a title of 1 to 80 characters, a text of at most 160; a request of at most 8,192 characters (Notices in the bell)
Stores (pluginStore, apiVersion 15) at most 5,000 entries and 4 MB of JSON per storeSync, a 16 KB state; one storeSync run at most 60 s, 40 requests and 8 MB downloaded; for a live store, 5 s a call, 20 calls a minute and a 30-minute cache (Plugin stores)

The "Time per call" row leaves some calls out: details 20 s (apiVersion 8, Kino 0.9.54; see A title's own details), and the settings form's settingsStatus 10 s, action 30 s and validateSettings 20 s (apiVersion 6; also in the table below). They count your fetches and sleeps like the rest.

The 60 requests of kino.fetch count every hop, refused ones included (a plugin converted from a Nuvio scraper gets 250); at most 6 of your fetches are in flight at once, and one call asks the person about at most 3 hosts (details).

From apiVersion 6, also:

What Limit
Stream alternatives 8 (lazy and concrete together); label 48 characters; a lazy copy's ref 512 characters; alternateHosts 6; signContext 4,096 characters; 3 resolve retries per signed playback
Lazy copies the automatic fallback waits at most 20 s for one copy's resolve; a copy the person picked gets the whole resolve limit; a download's copy choice probes within 30 s in all
Hidden browser ("browser": true or "pages") resolve 75 s; one page at a time in the whole app; kino.browser.capture timeoutMs 1..25,000 (default 18,000), at most 8 media and 10 subtitles, 12 headers per media; kino.browser.page ("pages" only) timeoutMs 1..25,000 (default 15,000), 20 reads a minute per plugin, HTML at most 2,000,000 characters. See Hidden browser
subtitles() (any apiVersion) 10 s; 30 tracks kept, 15 listed per plugin; label 60 characters
meta() 6 s per plugin; the first answer in install order is kept 30 minutes; from Kino 0.9.51, ratings 6 (one per source), cast 20 (name and character 60 characters)
segments() (apiVersion 7) 8 s, and Kino waits at most 12 s; 100 entries read, 10 kept; each at least 1 s long, with an end at most 5 s past the length; the answer kept for the session per title, episode and length (10 s); asked again after 2 minutes when every plugin failed. See segments
Settings form settingsStatus 10 s, action 30 s, validateSettings 20 s; status 200 characters, an action's message 300, confirm 120, a field error 200; clearSettings 12 keys
Setting fields (every apiVersion) key ^[a-z][a-zA-Z0-9_]{0,31}$; label 40 characters; hint 80 (300 on a section from Kino 0.9.51); select 1..20 options, each value and label 40; list (apiVersion 4) max 1..50 entries (default 20), 1..4 fields of type text or url. See The settings form
Section and categories section label 20 characters; 8 tabs of 24 characters; hero text 300; categories 24 tiles with 40-character titles
kino.crypto key pairs 64 live private keys per runtime; a signature at most 512 bytes
kino.log.report one report per plugin and area an hour, 3 per plugin until Kino restarts; area at most 24 characters
telemetry: "verbose" 60 events per plugin until Kino restarts, one a minute per area

From Kino 0.9.54, also:

What Limit
details() (apiVersion 8) 20 s; it may read pages with kino.browser.page. See A title's own details
Audio items (apiVersion 8) artist at most 200 characters; music and podcast items count against the same row and page sizes as any item. See Music and podcasts
kino.browser.capture with captureAll (check kino.browser.captureAll) at most 20 requests, ended 1 s after nothing new matched; alsoMatch 1..10 patterns of 1..500 characters; at most 64 headers per request; cookies at most 64, 16,384 characters in all. See Every match, a cookie, an answer on timeout

From Kino 0.9.74, also:

What Limit
Sync provider (syncProvider, apiVersion 12) syncPull and syncPush 60 s each, syncStatus 15 s; the blob at most sync.maxBlobBytes, at most 4,194,304 bytes (4 MiB) decoded; inside syncPull/syncPush only, a kino.fetch request, a response body and the answer up to ceil(maxBlobBytes × 4/3) + 65,536; pullEveryMs raised to at least 30 s, pushDebounceMs to at least 5 s; at most 60 rounds an hour; provision 8 keys. See Sync providers
kino.sync.remoteChanged() one signal every 30 s at most; dropped while a pull runs
link and help settings (apiVersion 12) 4 of each; a link's url 2,048 characters, https only; a help's title 60 and body 2,000
Action answers setSettings and link (any apiVersion) setSettings 8 keys of text/select settings; a link's candidate 1 to 64 characters

From apiVersion 13 (Kino 0.9.74), also:

What Limit
read (byteSource) 20 s per call, one at a time per plugin; a range of at most 1 MiB at an offset that is a multiple of 4,096; after 3 timed-out reads in a row Kino stops reading that stream until it is opened again. See Sockets and plugin-served bytes
image (imageSource) 10 s per call, in the background (never "No responde"); see the row above and Images from the plugin
kino.crypto byte operations (gated on the Kino version, not the manifest: feature-detect) modPow numbers of at most 4,096 bits; aesIge/aesIgeVerify a 32-byte key, a 32-byte iv and data a multiple of 16 bytes; 5 MB of data per call like the rest of kino.crypto
qr setting the text 1 to 512 characters; refreshMs 2,000 to 60,000; it counts among the 16 settings that hold no value
storageLarge 16 MB in total, 2 MB per value, 1,000 keys of at most 256 characters; device-only, never synced, not in any backup

From Kino 0.9.88, also:

What Limit
clockLive (apiVersion 27, live streams only) template at most 2,048 characters, with {seg}; mediaCode 1 to 128 characters of A-Z a-z 0-9 . _ ~ -; grid 1 to 16 steps of 200 to 60,000 ms; rate 500 to 2,000 (default 1,000); window.count 2 to 20 (6), window.behind 0 to 20 (3); reanchor.everySec 60 to 21,600 (1,200), reanchor.probeSpan 0 to 12 (4); segWidth 0 to 12 (Live by clock)
resolveAhead (any apiVersion) after about 0.3 s on a title page; the answer kept at most 20 minutes, or until 60 s before its expiresInSeconds; at most 6 calls ahead a minute per plugin, with the prepare calls (Getting a title ready ahead)
prepare (any apiVersion) 15 s, in the background (never "No responde"); at most once every 5 minutes per ref and 6 a minute per plugin (Warming up before the play)

How your code lives

  • One call at a time. Calls to the same plugin run one after another. The sandbox is reused between calls, but Kino throws it away after 5 idle minutes, after a timeout, when a call is cancelled (for example a newer search replaces an older one), when the plugin is updated or disabled, and (Kino 0.9.54) when the person switches the app's language, so the next call gets the new kino.lang. Module-level variables are a cache at best: keep anything that must survive in kino.storage.
  • Load-time code. When it installs your plugin, Kino loads the module once in a throwaway sandbox without network access, to check that every declared capability is an exported function. Keep the top level to declarations: a network call there fails, and the install with it.
  • Errors reach people. If your function throws, that call fails and the person sees an error that names your plugin, and the text of your Error can be part of it. Write those messages for a person, in Spanish, short.
  • Memory over a long call (Kino 0.9.74). Each plugin has 64 MB of engine memory. Before Kino 0.9.74 the answer of every awaited kino.* call (a kino.fetch body, a socket frame) stayed in that memory until the sandbox closed, so a plugin that moved many megabytes in one sandbox's life could run out of it on its second video. From Kino 0.9.74 an answer is freed once your code has it, and after a call that leaves the engine over half its limit Kino runs its garbage collector, so only what your code still holds counts. It applies at every apiVersion. Still keep few big strings alive at once: a hex string costs 2 bytes per byte, then its base64.
  • Runaway code. Running out of memory or stack fails the call. A synchronous infinite loop (while (true) {}) cannot be interrupted: at the time limit Kino stops waiting for the call and discards the sandbox, but the loop keeps spinning on its own thread until it ends, which for a real infinite loop means until the app is closed. Three timeouts in a row disable the plugin.
  • App closed during a call. A crash inside the engine, or being killed for memory, can take the whole app down mid-call, and nothing in-process can catch that. Kino notices at the next start: whichever plugins were mid-call at that moment each get an unclean exit counted against them — including a healthy plugin that simply happened to be running at the same time, not only the one that actually caused the crash. Two unclean exits in a row for the same plugin, with no call finishing normally in between, switch it off ("No responde") exactly like three timeouts in a row; a call that completes normally resets its count.

The engine is not Node and not a browser

Plugins run in QuickJS. It handles modern JavaScript: async/await, classes with fields, ?. and ??, regular expressions with lookbehind, named groups and \p{L} under the u flag, template literals, spread, replaceAll, Array.prototype.at and flat, Object.fromEntries, Promise.allSettled, Map, Set, BigInt. It does not have the platform around it:

  • Missing globals (typeof is "undefined" inside Kino): setTimeout, setInterval, setImmediate, queueMicrotask, Buffer, process, require, fetch, AbortController, structuredClone, performance, crypto, WeakRef and Intl. Use kino.sleep to wait, kino.fetch instead of fetch and kino.crypto instead of crypto. URL, URLSearchParams, atob, btoa, TextEncoder, TextDecoder and console do exist: Kino provides them.
  • The kit now removes them: run.mjs and validate.mjs load your plugin in an isolated environment where those names do not exist (using one is a ReferenceError, as in Kino), and validate flags with ! the line that uses one and what to use instead. It also refuses any import: Kino loads a single file (bundle it with esbuild).
  • Locale-aware methods do not localize: localeCompare ignores its locale and options (so { numeric: true } and { sensitivity: "base" } do nothing; it compares code units), and (1234.5).toLocaleString("es-CO") gives "1234.5". Write the comparison you need; the reference plugin has a small natural() for numbered names.
  • Keep function names short. A function name of millions of characters makes the engine's native code crash the whole app. As a best-effort guard, kino.*, console.*, the web globals and the other functions Kino provides are frozen, and on any function Object.defineProperty, Object.defineProperties, Reflect.defineProperty and __defineGetter__/__defineSetter__ refuse to set name to a string longer than 1000 characters, to a getter or setter, or to make it writable: they throw a TypeError (Reflect.defineProperty returns false). The guard is not airtight (a huge computed key still names a function); a plugin that crashes the app anyway is switched off (see "App closed during a call" above). Setting name on ordinary objects, and this.name = "MyError" in an Error subclass, work as usual.

What the kit cannot copy

The kit runs your plugin in Node's V8 inside a sandbox that imitates Kino's engine, and a test compares both on about a hundred language probes (plugins/sdk/test/engine-probes.js in the Kino repo, measured against the real engine). The kit copies what it can: Error.stack lines, Date#toLocale*String (they ignore their arguments and print 01/15/2024 and 01:05:09 PM), the three-line toString of native functions, [object global], no ArrayBuffer#resize/transfer, console with only log, info, warn and error, TextDecoder with utf-8 only.

What it cannot copy, so a plugin can pass in the kit and still fail in Kino:

What In Kino In the kit
Memory 64 MB per plugin. A 1e7-element array, an object with 1e6 keys or a Map with 1e6 entries fails the call no limit
Stack 1 MB: about 5000 nested calls already throw InternalError (runaway recursion is InternalError, not RangeError) V8 allows about 10000 and throws RangeError
/x/v flag SyntaxError accepted
sort with a comparator that contradicts itself (() => -1) a different order V8's order. Consistent comparators, and stability, are identical
new URL("http://münchen.de") TypeError (no punycode): write the host as xn--mnchen-3ya.de turns it into xn--...
Error.stackTraceLimit does not exist exists (V8 needs it to build stack)

If something behaves in Kino unlike in the kit, that is a probe to add: the list of known differences is plugins/sdk/test/engine-probes.known.json, one reason per line.

The kit does not model clockLive (apiVersion 27) yet: run.mjs resolve and validate --run resolve check the stream's plain url, so an empty one fails there with "the video has an invalid address". Keep a real url beside clockLive while you test (an older Kino needs it anyway) and try the clock on Kino 0.9.88.

The plugin protocol: what only the app checks

node sdk/run.mjs --provider <folder> answers kino.plugins.call from a provider on your computer with the app's own type checks, sizes, error codes and rate buckets. Some rules need the person's installed plugins, which only Kino has, so the kit does not apply them:

Rule In Kino In the kit
Which plugin answers an entry of consumes the installed plugin of that exact repo (never a fork) the first --provider folder that has the door
An 18+ provider and a consumer that is not 18+ provider_missing answered
An answer that holds one of the provider's sealed secrets (or a marker) bad_output passed on
A plugin calling its own door not_declared answered (if you pass the plugin as its own --provider)
A provider that is off or needs setup provider_missing answered
The consent line «Usa datos de …» and the install sheet of go.installPlugin shown by Kino run.mjs only says what Kino would do

Try those cases in Kino 0.9.81 or newer with both plugins installed.

Splitting your code across files

Kino loads exactly one file (the manifest's entry), and the engine has no require and no module resolver, so an import from plugin.js to a second file has nothing to resolve against on the device. That does not mean you must write the whole plugin in one file -- just that the file you publish has to be the finished, single-file result.

Write it split, normally, then bundle it before you publish:

src/
  animeav1.js       a helper module
  plugin.js         the entry point; imports from animeav1.js
kino-plugin.json
package.json
// src/animeav1.js
export async function searchAnimeAV1(query) {
  const res = await kino.fetch(`https://animeav1.com/api/search?q=${encodeURIComponent(query.q)}`);
  if (!res.ok) throw new Error("animeav1 respondió " + res.status);
  return res.json().results.map((r) => ({ id: r.slug, ref: r.slug, title: r.title, kind: "series", poster: r.image }));
}
// src/plugin.js -- this import is fine: it runs through the bundler, never on the device
import { searchAnimeAV1 } from "./animeav1.js";

export async function search(query) {
  return searchAnimeAV1(query);
}

Bundle with esbuild (npm i -D esbuild), targeting ES module output (Kino runs the published file as one):

npx esbuild src/plugin.js --bundle --format=esm --outfile=plugin.js

plugin.js at the repo root is what comes out of that command, with src/animeav1.js inlined into it and its export async function search intact -- that is the file entry names and the one Kino fetches. Add it as an npm script ("build": "esbuild src/plugin.js --bundle --format=esm --outfile=plugin.js") and run it before every sdk/ test or publish. Rollup and webpack work the same way; esbuild needs the least configuration for a plugin this size. For a bigger plugin (folders by responsibility, a generated plugin.js checked with check:built), see Structure a bigger plugin.

The trap: a rejection nobody is listening to yet (Kino 0.9.49 and older)

From Kino 0.9.50 a rejection behaves as in Node: a throw inside an async function is caught by the caller's try/catch, .catch(), Promise.all or Promise.allSettled, however early it happens -- even before the function's first await, and even when the handler is attached a few awaits later. What still fails the call is a rejection nobody ever handles: one still without a handler once the plugin is only waiting on Kino (a kino.fetch, a kino.sleep, ...). For example a helper called without await that throws, or a promise you keep and only await after a kino.fetch. The call then fails with that error, as Node would stop with an unhandledRejection. Await what you start, or give it a .catch() right away.

Kino 0.9.49 and older abort the whole call when a promise is rejected before anything has a handler on it, even if your code is inside try/catch. The Node kit cannot show you this. If your plugin must work there too (people update late), follow these rules:

  • Aborts the call: a throw inside an async function before its first await, while the caller is wrapped in try/catch. A .catch() on that call, or Promise.all/Promise.allSettled around it, do not rescue it either. Also aborts: new Promise((_, reject) => reject(e)) rejected right away, and return Promise.reject(e) from an async function.
  • Is caught normally: a throw after any await (even await null;), a rejection coming from kino.fetch or kino.sleep (for example a refused host), and await Promise.reject(e) or Promise.reject(e).catch(...) (those builds delay Promise.reject by one tick so a handler can attach in time).
  • A synchronous kino.* call that fails (kino.storage.set over 256 KB, a kino.crypto error, a selector kino.html.select refuses) is caught normally from Kino 0.9.50. Kino 0.9.49 and older ended the whole call there, even inside try/catch (Errors your code can catch).
  • If nobody catches the error anyway, it is harmless: the call fails with that error either way, and a kino.error code still reaches the person correctly.
  • Nuvio-converted scrapers get a workaround: when Kino converts a Nuvio scraper it rewrites the async helpers bundlers emit (esbuild's __async, TypeScript's __awaiter, Babel's _asyncToGenerator) so a transpiled function's body starts one tick later, and a throw before its first await is caught normally. A native async function (yours, or an untranspiled scraper's) still needs the await before anything that can throw.

So, for those builds, in a helper that a caller may wrap in try/catch, do the await first and validate afterwards:

// Wrong before Kino 0.9.50: this throw is NOT caught by the caller's try/catch; it aborts the whole call.
async function getJson(url) {
  if (!url.startsWith("https://")) throw new Error("dirección inválida");
  const r = await kino.fetch(url);
  return r.json();
}

// Right everywhere: the first await comes before anything that can throw.
async function getJson(url) {
  const r = await kino.fetch(url);
  if (!r.ok) throw new Error("archive.org respondió " + r.status);
  return r.json();
}

(If a helper has nothing to await, start it with await null;, or check the input in the caller before it calls the helper. The examples on this site do, so they run on older builds too.)