Skip to content

Protocol methods

Call one with omfp_call { method, params }; read omfp://protocol/methods/ for its params and result types. From a thread, a read-only thread.* method without threadId reads the calling thread, and a method of one workspace (workspaces.read_file, workspaces.find_file, workspaces.mcp_servers, workspaces.check, mcp.test, mcp.tools, jobs.list, jobs.runs, views.errors, windows.check_widget, views.mount, views.mount_update, views.unmount, views.reset, windows.run) without workspaceId acts on the calling thread’s workspace.

  • fs.complete — Child directories of a path on the daemon host (DMN-021).
  • workspaces.create — Creates a workspace: a new folder under the workspaces root, optionally holding a link to a directory.
  • workspaces.update — Renames a workspace.
  • workspaces.remove — Removes a workspace without threads and its folder (links unlinked, never followed).
  • workspaces.rescan — Lists the workspace folder’s top-level folders again.
  • workspaces.read_file — A file of a workspace with its hash and HEAD text (DMN-1442).
  • workspaces.find_file — Files across the workspace folder and its git working trees: strict name/path lookup or fuzzy path search (DMN-092).
  • workspaces.write_file — Writes a file of a workspace unless it changed since it was read (DMN-090).
  • workspaces.reorder — Puts a workspace just before another in the left column, or last (PRT-170, DMN-281).
  • threads.create — Creates a thread in an existing or a new workspace; an agent’s parentThreadId (its own thread) makes it a child, nested under the parent (readOnly by default for windows, AGT-420, AGT-421). tools limits its agent to the tools named (exact names the model sees), [] to none at all (AGT-500, AGT-501). ephemeral: true makes a disposable thread, deleted with its session once its run settled and nothing waits for it, listed in the left column only while it needs the user (DMN-1400).
  • threads.update — Renames a thread or changes its approval mode.
  • threads.reorder — Puts a thread just before another of a workspace in the left column, or last; another workspace moves it there (PRT-171, DMN-282).
  • threads.archive — Archives a thread; jobs says what happens to the runs its agent started (DMN-1075). Your own thread’s host ends once your turn does (DMN-1078).
  • threads.unarchive — Brings an archived thread back.
  • threads.delete — Deletes a thread; its workspace is kept; jobs as for threads.archive (DMN-1075). Your own thread’s host ends once your turn does (DMN-1078).
  • threads.fork — Forks a thread into a new thread of the same workspace, with its conversation up to an entry (DMN-1072); the source is untouched.
  • threads.search — Threads whose conversation text contains a query (DMN-076).
  • thread.prompt — Sends a prompt.
  • thread.steer — Steers the running turn.
  • thread.follow_up — Queues a follow-up.
  • thread.abort — Aborts and returns the queued messages.
  • thread.queue.remove — Removes a queued message.
  • thread.queue.promote — Promotes a queued message.
  • thread.set_model — Changes the model.
  • thread.set_thinking — Changes the thinking level.
  • thread.models — Available models. Each entry supplies provider and id: use threads.create { model: "<provider>/<id>", workspace: ... }, or thread.set_model { threadId: ..., provider: "<provider>", modelId: "<id>" }.
  • thread.thinking_levels — Available thinking levels.
  • thread.commands — Available slash commands; never starts the thread host: without a running pi, the commands it last announced.
  • thread.compact — Compacts the context.
  • thread.tree — Session tree.
  • thread.navigate — Moves the session leaf.
  • thread.label — Labels a session entry.
  • thread.bash — Runs a shell command in the session.
  • thread.state — The thread’s whole state as its thread/<id> topic holds it (transcript, queue, pending requests, …), with its session’s model and thinking level; starts the thread host.
  • thread.session — The small facts of the thread’s pi session (id, file, model, state, usage) without starting the thread host (DMN-1067).
  • thread.restart — Restarts the thread host. Your own thread’s host ends once your turn does (DMN-1078).
  • thread.resume — Continues a turn a daemon restart interrupted (interruptedAt, PRT-230): starts the thread host and sends a notice asking the agent to check what was in progress and continue; conflict when the thread has no interrupted turn.
  • thread.stop — Stops the thread host; with cascade, those of every thread it spawned too (PRT-085). Your own thread’s host ends once your turn does (DMN-1078).
  • interaction.respond — Answers an interactive request; already_resolved if another client answered first.
  • card.answer — Ends the wait of a thread’s omfp_card call with a submitted value or a cancel; already_resolved when the call does not wait (PRT-224).
  • theme.get — The user’s theme CSS (DMN-1273).
  • theme.set — Replaces the user’s theme CSS (the config folder’s theme.css); null restores the built-in themes (DMN-1273).
  • settings.get — The effective daemon-wide settings: what the user’s init.ts declares (ctx.settings, ctx.keys.bind) with the runtime changes over it (DMN-1206, UI-097).
  • settings.set — Applies settings at once until the daemon restarts or the next workspaces.reload_init; nothing is written: to keep a value, declare it with ctx.settings in the user’s init.ts (DMN-1206).
  • views.set — Replaces the workspace’s live views manifest, shown instead of the declared views until workspaces.reload_init, views.reset or a change of the declared views; never writes a file (DMN-977).
  • views.reset — Drops the workspace’s live views changes (live manifest, mounts, live widgets), stored copy included: windows show the declared views again (PRT-457).
  • widgets.copy — Copies a built-in or user widget into the workspace’s .omfp/widgets/ (DMN-981).
  • widgets.state_set — Stores one key of a widget instance’s state (DMN-086).
  • widgets.compile — Compiles a card’s one-file widget source to an ES module, writing nothing (PRT-225).
  • jobs.start — Runs a shell command in the workspace folder as a job (DMN-080).
  • jobs.kill — Kills a job’s process group (DMN-081).
  • jobs.output — A job’s state, exit and newest output (PRT-353).
  • terminals.start — Starts an interactive PTY session in a workspace (TRM-100).
  • terminals.screen — The current plain-text terminal screen, optionally waiting for a revision change (TRM-106).
  • terminals.input — Writes base64-encoded bytes to a PTY session (TRM-101).
  • terminals.resize — Resizes a PTY session (TRM-101).
  • terminals.kill — Kills a PTY session (TRM-101).
  • jobs.list — The declared jobs of a workspace, as on jobs/<id> (PRT-202).
  • jobs.runs — The stored runs of a declared job, newest first (PRT-203).
  • jobs.run — Starts a run of a declared job (PRT-204).
  • jobs.define — Always bad_request: jobs are declared with ctx.jobs.define in an init file or an eval, then workspaces.reload_init (PRT-352).
  • jobs.remove — Always bad_request: remove the ctx.jobs.define declaration from the init file or eval instead (PRT-352).
  • jobs.enable — Enables or disables a declared job in the daemon’s memory, writing nothing: it lasts until the job’s declaration changes or the daemon restarts, then the declared enabled applies again; to keep it, change enabled in the declaration (PRT-350).
  • views.errors — The init file errors every window showing the workspace reports (PRT-116).
  • windows.list — The windows that reported to the daemon, the most recently focused first: workspace, thread, view, errors, and the native window of an omfp desktop window (desktop: { host, pid, title }, PRT-123, PRT-460). The title follows the window’s thread or view (<thread> — omfp · <n>): to match a window manager’s window by pid and title, read this right before matching.
  • windows.state — All a window reports: its views and where each comes from (builtin, manifest, user_init, workspace_init; live: true when live changes made one differ from the declared views, hiddenTabs the declared tabs that window closed), its added commands and bindings, its errors and widgets, its native desktop window (PRT-123, PRT-460, PRT-511, UI-1160).
  • windows.run — Runs a registered command (id or alias) in a window, by default the most recently focused one showing the workspace; a <widget>.<…> command of a widget of the shown view in a tab not selected, or a declared tab that window closed, selects the tab and runs once registered (UI-1132); never JavaScript (PRT-124).
  • windows.check_widget — Renders a widget out of sight in a window and returns what it rendered: the name resolves in the window’s workspace (workspaceId, else the one the window shows), then among the user’s init file’s widgets, so a window without a workspace checks the user’s (PRT-124, PRT-610, DMN-1440).
  • notify.send — Notifies the user: an omfp window shows it, and the devices subscribed to Web Push get it while no window has the focus (always with urgency: "high") (PRT-240).
  • agents.notify — For a thread’s agent: notifies the user about its thread, in the omfp window they use and, while no window has the focus (always with urgency: "high"), on their subscribed devices; opening it shows the thread. For a finished long task or when the user is needed, once per occasion, never for progress (PRT-452, DMN-1022).
  • agents.open_file — For a thread’s agent: opens a file (path relative to the workspace, absolute or a partial name; line) as a file tab of the user’s window following its thread (PRT-452, DMN-1023).
  • agents.set_title — For a thread’s agent: renames its thread in the thread list (PRT-452, DMN-1024).
  • push.key — The daemon’s VAPID public key, for PushManager.subscribe (PRT-241).
  • push.subscribe — Adds a device’s push subscription, or replaces the one of the same endpoint (PRT-242).
  • push.unsubscribe — Removes a device’s push subscription; an unknown endpoint is no error (PRT-242).
  • push.devices — The devices the daemon pushes to, the newest first (PRT-243).
  • views.mount — Mounts a widget (a reference or inline code) into a view or as a floating panel; replaces an earlier mount of the same id (DMN-1275).
  • views.mount_update — Merges props into a mounted widget, or rewrites its inline code (AGT-062).
  • views.unmount — Removes a mounted widget or floating panel from the views (DMN-1275).
  • prompts.history — The prompts the user sent from omfp: the thread’s first, then its workspace’s, then the rest, newest first within each (PRT-127, DMN-216).
  • threads.list — Thread summaries as on the index topic, without archived threads unless asked (PRT-400).
  • workspaces.list — Every workspace as on the index topic.
  • workspaces.mcp_servers — The MCP servers configured for a workspace, where each comes from, not started (configured; mcp.test tries them, PRT-430).
  • workspace.call — Calls a method the workspace’s init files or evals define (ctx.methods.define) with params (PRT-331).
  • workspaces.reload_init — Evaluates the init files of the workspace (every workspace without workspaceId) again, and the user’s init file in the user host (dropping the runtime changes of settings.set), and answers what loaded and what failed (PRT-330, DMN-1206).
  • workspaces.check — Checks the workspace’s init files and widgets without touching what runs: one type-check of the init files and of the widgets, window modules and live widgets (with the files they import, against omfp/sdk, omfp/kit and React’s types), a dry run in a throwaway host, every declared widget and every live mounted widget (named by its mount id) rendered out of sight in an open window with its errors; answers a Markdown report (AGT-342, AGT-485, DMN-1431).
  • thread.mcp_servers — The MCP servers of a thread’s workspace as its running session connected them (connecting, connected with the tool count, failed with the error and a stdio server’s stderr; a dropped server is reconnected on its own, waits doubling from 1 s to 30 s); a stopped thread’s configured, never started (PRT-431).
  • thread.mcp_reconnect — Reconnects one MCP server (name) or each in the thread’s session, started first when stopped, and answers their states (PRT-432).
  • mcp.test — Starts the workspace’s enabled MCP servers (or name) afresh from the daemon, stdio and HTTP, waits for initialize and tools/list (timeoutSeconds, default the entry’s timeout, else 60), stops them and answers each connected with its tool names or failed with the error and stderr tail (PRT-500).
  • mcp.tools — The tools of a workspace’s remote MCP server, listed by the daemon itself, no thread needed (PRT-434).
  • mcp.call — Calls a tool of a workspace’s remote MCP server from the daemon, with pi’s OAuth login for it (PRT-435).
  • auth.status — How many models pi can use with omfp’s credentials, counted again on every call (a changed count is published as models_changed), and keysFile, omfp’s auth.json, where an API key goes (PRT-140).
  • auth.models — The models pi can use with the credentials omfp stores, without any thread (PRT-140). Each entry supplies provider and id: use threads.create { model: "<provider>/<id>", workspace: ... }, or thread.set_model { threadId: ..., provider: "<provider>", modelId: "<id>" }.
  • auth.providers — The providers pi can log in to with OAuth and whether a credential authenticates each (omfp’s stored login or key, or an environment variable) (PRT-129).
  • auth.login — Logs in to a provider with pi’s OAuth flow, run by the daemon; the flow (the URL to open, progress, a code to paste) goes to the calling window as login_* window requests (PRT-130, PRT-131).
  • auth.login_cancel — Cancels the running login, if any; its auth.login fails (PRT-132).
  • auth.logout — Removes every credential omfp stored for a provider (PRT-133).