Ask the host to enter the edit experience for the app you are running —
the present→edit transition (/present/... → /edit/...) an app cannot make
itself. This is an INTENT (§2 recursion boundary): the app asks, the HOST
performs the visible, user-observable navigation and draws all editor chrome;
the app never navigates or paints chrome.
Use it to offer an "edit this" affordance from a run/present-mode app that opens
the app's own source in the platform editor — instead of shipping a bespoke
in-app editor (EDITOR_FIRST_EDITING_SPEC §1).
Also opens a file from a mount you already hold, in the main edit experience:
Resolves once the host begins the transition; rejects with a
RequestEditError (.code). Treat read-only/forbidden as "editing is
not available — hide the affordance," never as an error to surface to the user.
not-found means the file is not there; nothing is created by asking to edit it.
Ask the host to enter the edit experience for the app you are running — the present→edit transition (
/present/...→/edit/...) an app cannot make itself. This is an INTENT (§2 recursion boundary): the app asks, the HOST performs the visible, user-observable navigation and draws all editor chrome; the app never navigates or paints chrome.Use it to offer an "edit this" affordance from a run/present-mode app that opens the app's own source in the platform editor — instead of shipping a bespoke in-app editor (EDITOR_FIRST_EDITING_SPEC §1).
Also opens a file from a mount you already hold, in the main edit experience:
await requestEdit({ file: { mountId: 'space:abc', relPath: '/notes/idea.mdx' } });
Resolves once the host begins the transition; rejects with a RequestEditError (
.code). Treatread-only/forbiddenas "editing is not available — hide the affordance," never as an error to surface to the user.not-foundmeans the file is not there; nothing is created by asking to edit it.