Skip to content

Extensions

nodemode-ai edited this page Dec 6, 2026 · 3 revisions

Extensions

FormChem is a host of the Form Extension Contract, API 1, the same contract every Form app follows. FormPortal installs extensions, form.ext makes them and runs them in development, formai.tools lists them. The product id is formchem, and FormPortal's deep link is formai://extensions?product=formchem.

How it fits

Part Where
Resolver and safe file serving (kit, vendored unchanged) backend/app/services/formext_host.py
Routes under /api/extensions backend/app/routers/extensions.py
Host bridge (kit, vendored unchanged): sandboxed frames, JSON-RPC, permissions, timeouts frontend/src/extensions/host-bridge.ts
FormChem's side: handlers, commands, panels frontend/src/extensions/host.ts
Agents MCP extensions_list, extension_command; ./formchem cli extensions and ./formchem cli extension <id> <command>

From 0.3.0 an extension with the document permission reads the active drawing (document.read), changes it in one undo step (document.apply), and runs any of the window's commands (app.commands, app.run): the 312 commands of 0.12.0, from Structure from Name to Search Database. FormChem sends document.changed and document.opened; selection.changed and the selection itself are not handed to extensions yet. The full FormChem side of the contract, with the commands that take arguments and the reasons an extension is refused, is docs/EXTENSIONS.md.

FormPortal keeps the installed list in enabled.json and the extensions in development in dev.json, in its extensions folder for formchem; the engine reads both.

Rules the host keeps

  • Every extension page runs in a sandboxed frame with scripts only; the host never reads its DOM, and messages are taken only from that frame.
  • An extension asks before it reads or changes a document, and the person's answer is kept per extension id, version and permission set, so a new version that asks for more asks again.
  • Network access goes through the engine: https:// addresses on the internet only, up to 50 MB and 30 s, no redirects. Saved files are at most 200 MB.
  • The Extensions menu and panel exist before the first paint and are patched in place when the list changes.

Clone this wiki locally