workspaces.create
Creates a workspace: a new folder under the workspaces root, optionally holding a link to a directory.
Params: CreateWorkspaceParams
Section titled “Params: CreateWorkspaceParams”/** `workspaces.create` params (DMN-930). */export type CreateWorkspaceParams = { /** An existing directory to link into the new folder (a symlink named after it) in the same call. */ link?: string | null; /** Unique name; default: the folder name of `link` when given, else `workspace` (made unique). */ name?: string | null;};Result: Workspace
Section titled “Result: Workspace”/** A folder threads work in (D-11). */export type Workspace = { createdAt: number; /** The visible top-level directories of the folder, symlinks to directories included, by name (D-11, DMN-022). */ folders: WorkspaceFolder[]; id: string; /** Its declared jobs at a glance; absent without jobs and without a refused file (PRT-210). */ jobs?: JobCounts | null; /** Unique among workspaces. */ name: string; /** Absolute path of the folder (under the daemon's workspaces root), unique among workspaces. */ path: string; /** Its place among the workspaces in the left column, from 0; the same in every window (DMN-281). */ position: number; provenance: Provenance; /** Threads living in the workspace, archived ones included, oldest first (DMN-027). */ threadIds: string[];};Types they use
Section titled “Types they use”/** A top-level directory of a workspace folder (DMN-022). */export type WorkspaceFolder = { /** Entry name in the workspace folder. */ name: string; /** Absolute path inside the workspace (the symlink path for a link, never its target). */ path: string; /** For a symlink: its target, as written in the link. */ target?: string | null;};
/** A workspace's declared jobs at a glance, on the `index` topic (PRT-210). */export type JobCounts = { /** The jobs' declarations have errors (`JobsState.error`). */ error: boolean; /** Enabled jobs whose last run failed. */ failing: number; manual: number; running: number; schedule: number; service: number; total: number;};
/** Who created an entity. */export type Provenance = { /** `client` of the creating connection's `system.hello`. */ client?: string | null; createdBy: CreatedBy;};
/** * The principal behind a created entity: the user, the agent of a thread, or an MCP client outside omfp, * named by the provenance's `client`. */export type CreatedBy = | { kind: "user"; } | { kind: "thread"; threadId: string; } | { kind: "mcp"; } /** A run of the declared job `job` of the entity's workspace (PRT-209). */ | { job: string; kind: "job"; };