Docs
Mini App development guide
Build installable, permission-aware, upgradeable Mini Apps with the Beav package format, the window.redbox SDK, and Host capabilities.
A Beav Mini App is a local sandboxed page built from packaged HTML, CSS, JavaScript, and static assets. Its window.redbox SDK stores small UI state and invokes Host capabilities granted by the user. This workflow reflects release v2.10.9; the capability catalog and schemas on the current device are authoritative.
1. Read the current device contract
In a Beav Mini App authoring session, the Agent first calls ui.capabilities.inspect(redbox.sandbox.web@1) or reads miniapp://<app-id>/.redbox/capabilities.json. The latter lists actions allowed in a manifest on this Host. Read .redbox/capabilities/<action>.json for an action's input and output schema. Do not declare an absent action. Descriptions are shared with the chat Agent; the running Mini App cannot call chat tools mentioned there.
The Agent uses workspace.read, workspace.write, and workspace.patch to edit package files under miniapp://; it may use image.generate when image generation is requested. These are authoring tools, not runtime APIs. host.json and .redbox/ are Host-owned or read-only. Other installed packages may be read as references.
2. Create the package and manifest
miniapp://<app-id>/
manifest.json
host.json # Host-owned; do not edit
versions/
1.0.0/
index.html
styles.css
app.js
icon.svg
assets/
tasks/
skills/
A published versions/<version>/ directory is immutable; manifest.json points to the published version. State is stored by the Host per workspace, not inside the package. Minimal v2 manifest:
{
"schemaVersion": 2,
"id": "topic-helper",
"name": "Topic Helper",
"description": "Search and organize topic ideas",
"version": "1.0.0",
"entry": "versions/1.0.0/index.html",
"icon": "versions/1.0.0/icon.svg",
"capabilities": ["knowledge.search"],
"sdk": { "min": 2, "max": 2 },
"stateSchemaVersion": 1,
"privateSkills": [],
"agentTasks": [],
"status": "ready"
}
id: at most 64 lowercase ASCII letters and digits, with non-leading-or_; preserve it on upgrades.entrymust be inside the current version. Use a packaged PNG/JPG/WebP/GIF/SVG/AVIF icon, at most 2 MiB; placing new icons in their version directory helps rollback restore the right asset.capabilities: at most 64 distinct, exact action names. Declaration requests permission; it does not grant it.privateSkills: at most 8 declarative Skill bundles with references, templates, and static assets;agentTasks: at most 16 declarations with input/output schemas, capability ceiling, Skill refs, and background eligibility.- The manifest may be 64 KiB, entry HTML 512 KiB, and state 256 KiB at most.
statusisdraftorready; a draft may omit its icon and capabilities.
3. Write the page and SDK calls
The page uses only the injected window.redbox. Listen once for redbox:ready after loading, then read grants and state:
window.addEventListener('redbox:ready', async () => {
const permissions = window.redbox.capabilities.list();
const state = window.redbox.state.get() || {};
const result = await window.redbox.invoke('knowledge.search', {
query: state.lastQuery || 'topic research',
});
window.redbox.state.set({ ...state, lastQuery: 'topic research' });
window.redbox.ui.notify('Search complete');
}, { once: true });
capabilities.list() reports grants for this version in the active workspace. invoke(action, payload) calls a declared and granted Host action. state.get()/set() reads and writes the workspace's JSON UI state; host.context() reads Host context. ui.close() closes the window. The SDK also offers ai, agent, jobs, events, automations, and ui facades over matching actions. Do not put authoring tool names in the manifest or page code.
Choose capabilities
These are the main areas in v2.10.9. An * in the table denotes a family, not a valid manifest action. Consult the live catalog for every exact action and payload schema.
| Area | Common actions and use |
|---|---|
| Public content | capture.collect captures links and media; capture.status polls; social.* queries platforms and subscriptions; web.fetch reads one exact public URL |
| Workspace data | accounts.* reads or syncs bound accounts; profile.read / profile.manage handles profile documents; knowledge.* works with knowledge, assets.* with files, topicCenter.read/manage with topics, and memory.* with long-term memory |
| Drafts | manuscripts.* handles projects, text, platform variants, and packages |
| Media | media.transcribe, media.bind, media.edit, media.waveform; image.generate, video.generate, video.editor.project.create, and voice.* generate or process media |
| AI and durable work | ai.generate / ai.analyze make one model call; ai.decide makes batch judgments and may be unavailable without a configured decision model; agent.run / agent.runTask start durable work; jobs.* inspects or cancels this app's runs |
| Events and background | events.subscribe/unsubscribe listens while open; automations.preview/create/list/update/disable/runs/retry manages Host-owned automation |
media.transcribe needs an exact assets:// or miniapp-media:// ref. It does not accept sourcePath, toolPath, or an output directory. media.import/search/get/inspect, video.analyze, and chat Agent snake_case video-editor tools are not Mini App actions. An Agent run's allowedCapabilities must be a subset of the manifest. agent.runTask runs only immutable tasks declared in the manifest; the Host validates input schema, capability ceiling, background eligibility, and Skill binding.
Host UI and file handoff
window.redbox.ui provides notify, close, copy, openExternal, pickResources, openResource, previewResource, and exportResource. Resource calls use knowledge://, assets://, and miniapp-media:// refs, never physical paths. UI methods themselves are not declared in the manifest, but choosing knowledge, assets, or drafts needs knowledge.list, assets.list, or manuscripts.list respectively. Computer upload, asset preview/export, and opening an asset folder need assets.list; opening a knowledge folder needs knowledge.read.
Computer upload example:
const picked = await window.redbox.ui.pickResources({
kinds: ['asset'], source: 'computer',
extensions: ['png', 'jpg', 'jpeg', 'webp'], multiple: false, max: 1,
});
List only extensions supported by the processing action, without dots or wildcards. Export with ui.exportResource({ resourceRef, destinationRef: 'downloads' }). To let the user choose a location, first call ui.exportResource({ operation: 'chooseDestination' }); reuse its destinationRef only during this window session. Do not construct or persist native paths.
Example: link to subtitles
Declare at least capture.collect and media.transcribe:
const captured = await window.redbox.invoke('capture.collect', {
url, platform: 'auto', downloadMedia: true, ingestToKnowledge: false,
waitForCompletion: true,
});
const captureResult = captured.data || captured;
const resourceRef = captureResult.mediaRef || captureResult.resourceRef
|| captureResult.items?.[0]?.evidenceRef;
if (!resourceRef?.startsWith('miniapp-media://') &&
!resourceRef?.startsWith('assets://')) {
throw new Error('Capture has not returned transcribable media');
}
const subtitles = await window.redbox.invoke('media.transcribe', {
resourceRef, format: 'srt',
});
Never build a local path from the URL. Capture may still be running; save its execution id and poll with jobs.get or capture.status. A successful media.transcribe returns a persistent asset ref. A request timeout does not cancel Host work; reconcile with jobs.list after reopening instead of submitting duplicate work.
Example: one Direct AI call
Declare ai.generate, plus the relevant read grant when using knowledge or asset refs:
const result = await window.redbox.invoke('ai.generate', {
prompt: 'Turn the content below into three topic ideas',
resourceRefs: selectedRefs,
responseFormat: 'json',
responseSchema: {
type: 'object',
properties: { topics: { type: 'array', items: { type: 'string' } } },
required: ['topics']
}
});
JSON output must pass its schema. Use ai.generate for a single judgment; for many judgments with the same rule, use ai.decide when a decision model is configured.
4. Verify permissions and sandbox behavior
When a user opens the Mini App, the Host shows and grants declared capabilities per workspace, app ID, and version. It does not prompt on every invoke. Added capabilities or revoked grants do not expand old authorization; every call still checks version, grant, and payload. Paid generation and external capture can consume credits, so the page should explain the effect before submission. Automation creation, updates, and retries have Host confirmation and are limited by task, budget, and concurrency bounds.
The sandbox has no Tauri API, Node/npm/shell, raw filesystem, credentials, direct fetch/WebSocket, remote scripts/styles/fonts/media, popups, form submission, or browser downloads. Use web.fetch for public pages and Host UI for external opening, preview, and export. Do not ask for absolute paths or bypass grants with remote dependencies or hidden requests.
Keep state to input drafts, modes, task IDs, and refs; knowledge, assets, and drafts remain Host data. Resume long jobs rather than assuming that a closed page means success or failure. Design for a 280–420 px sidebar with idle, working, success, failure, and retry states; preserve input on failure and make the main result copyable. Package styles locally; do not depend on Host React, Tailwind, or fonts. During authoring, read the task's miniApp.diagnosticsRef for redacted errors and request records; never log keys or full documents.
5. Publish and read back
Except for a name-only change, any UI, behavior, icon, capability, or package file change needs a new version:
- Read the current
manifest.jsonand keep itsid. - Create
versions/<next>/, write HTML, CSS, JavaScript, icon, and declared assets; read each back. - Check every called action exists in the catalog and is declared, with no remote dependency or physical path.
- Write the complete
manifest.jsonlast, pointing version, entry, and icon to the new directory withstatus: "ready". - Read back the manifest and entry, then open the app and confirm results came from Host responses or persisted resources.
A new version directory without a manifest switch is still an unpublished draft. Renaming is the only exception: change only manifest name, leaving version, status, and capabilities intact, then read it back. Never edit Host-owned host.json or an already published version directory.