Skip to content

Applies to Cowork 0.1.45 · For everyone who uses Cowork

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 ​

ModuleFunctionsWhat it is for
LifecyclebeforeRefresh(handler)Keep unsaved work when someone refreshes the tab
Interactionconfirm(request)Ask the person a yes / no question in a native dialog
Modelsllm.providers() · llm.complete(request)Use one of the AI models Cowork already has set up
Packagepackage.get()Read the package this Mini App came from, and which extensions it has
Sign-inauth.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:

text
miniapp/
  manifest.json    { appId, name, version, entry }
  index.html       the entry page
  app.js  app.css  anything else it loads, by relative path

The 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.

FieldTypeRequiredDescription
appIdstringYesReverse-domain id, lowercase, such as ai.micromeet.janeapp-operator; at most 128 characters. The tab is miniapp:<appId>
namestring or { zh, en }YesName in the tab and menus; at most 60 characters
versionstringYesAt most 32 characters
entrystringNoEntry page, a relative path inside the folder, at most 256 characters. Default index.html
extensionstringNoOnly 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 ​

js
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.

For Micromeet Cowork 0.1.41 · build 261111110020