Mini App SDK
A Mini App is a web page that Cowork opens in its own tab. Inside it, Cowork adds one global object, window.MAESTROSDK, through which the page talks to Cowork. This chapter lists the modules of that object that Cowork supports and every function in them, in the same layout as a method reference.
Release status
Functions marked Not yet released are in Cowork's source but not in a released version yet. Check that a function exists before you call it (see Check what is available).
Modules
| Module | Functions | What it is for |
|---|---|---|
| Lifecycle | beforeRefresh(handler) | Keep unsaved work when someone refreshes the tab |
| Interaction | confirm(request) | Ask the person a yes / no question in a native dialog |
| Models | llm.providers() · llm.complete(request) | Use one of the AI models Cowork already has set up |
| Package | package.get() | Read the package this Mini App came from, and which extensions it has |
| Sign-in | auth.login(params?) · auth.status() | Sign the person in with their Micromeet account (signed packages only) |
To build a Mini App that signs people in with Micromeet, start with Build a Sign-in Mini App. To package a Mini App and have Micromeet sign it, see Build and Sign; every rule the package must meet is in Package Spec.
Every function above returns a Promise except beforeRefresh, and none of them throws for an expected failure: each returns false, null, an empty list or { ok: false, error }, as its section says.
The object also has a connectors module (root, list, agentMdPath, readAgentMd, writeAgentMd, onAgentMdChange). Cowork does not support it: its functions return empty results, { ok: false, reason: 'unsupported' }, or throw unsupported. Do not use it in a Cowork Mini App.
The Mini App folder Not yet released
In 0.1.41 only the Mini Apps that come with Cowork exist; you cannot install your own. From the next version:
miniapp/
manifest.json { appId, name, version, entry }
index.html the entry page
app.js app.css anything else it loads, by relative pathThe file is manifest.json from Cowork 0.1.46; earlier builds read miniapp.json, so keep a copy under that name while people still use one. A Mini App can also be a signed package (app.asar): see Build and Sign.
| Field | Type | Required | Description |
|---|---|---|---|
appId | string | Yes | Reverse-domain id, lowercase, such as ai.micromeet.janeapp-operator; at most 128 characters. The tab is miniapp:<appId> |
name | string or { zh, en } | Yes | Name in the tab and menus; at most 60 characters |
version | string | Yes | At most 32 characters |
entry | string | No | Entry page, a relative path inside the folder, at most 256 characters. Default index.html |
extension | string | No | Only for a Mini App installed on its own: a folder inside it holding its one extension. A Mini App in a package leaves it out |
- Pages load by relative path and use hash routing (
#/page). - Each Mini App keeps its own storage (cookies,
localStorage), separate from web tabs and other Mini Apps. Uninstalling clears it. - Install it as part of a package, together with its extensions and skills: see Extension Overview.
Check what is available
const sdk = window.MAESTROSDK;
if (sdk && sdk.package && typeof sdk.package.get === 'function') {
const info = await sdk.package.get();
}On an older Cowork, a module that is not there yet is simply missing; show the person a short note instead of failing.
Related
- Extension SDK What the extensions of the same package can call
- Mini App The Mini Apps that come with Cowork
- Extension Overview Which kind of addition to build