0.1.3 candidate · Workspace bindings
Versioned candidate guide: Workspace bindings. Release acceptance remains pending..
Import WorkspacePreferences and createWorkspaceSession from rom-studio/workspace.
This entry reuses the standard application controller and durable mutation recovery.
The application supplies its approved auth profile and workspace settings Resource kind.
Host contract
Register an owned settings Resource with a layouts field containing a map of strings.
Each map key is compact JSON for [resourceKind, resourceId]. Each value is a saved native layout encoded as JSON text.
Provide a save_layout action with named string inputs: kind, resource_id, and layout.
Enforce ownership, immutable owner identity, and byte limits in ROM.
Stored preferences do not grant access to their target Resources.
The binding requires exactly one authorized settings row for the current principal. The host controls provisioning and discovery. The binding selects the disclosed row through the standard application controller.
Bind the session
import { createWorkspaceSession } from "rom-studio/workspace";
const binding = await createWorkspaceSession({
base,
profile,
parent: appSession.lifecycle,
resourceKind: "my-workspace-settings",
}); The settings session uses a separate client epoch. Rebinding it preserves the main editor's network requests.
Its principal and generation must match the authenticated parent session.
A parent session change disposes the binding. Call binding.dispose() when its consuming view closes.
WorkspacePreferences accepts a binding factory, the current Resource kind and ID, and capture/restore callbacks.
Its save and retry controls use the existing controller's revisions, original command identity, and durable intent store.
After reload, restore the saved mutation before retrying an unknown outcome.
Restore the native view
Use validatePaneLayout from the matching installed rom-ui/paneshell package before changing the mounted document list.
Supply the host's permitted document IDs. Then restore the admitted layout under the current authority token.
Keep editor drafts in the session-owned application controller.
This binding supplies persistence composition. The host still selects document renderers, Resource permissions, and native layout admission. Candidate browser evidence covers SQLite reload, visitor isolation, exact receipt replay, and retained drafts through native rearrangement. Final versioned ROM 0.1.3 artifact acceptance and production deployment remain separate requirements.