Skip to content

workspaces.update

Renames a workspace.

/** `workspaces.update` params. */
export type UpdateWorkspaceParams = {
/** New unique name; the folder is not moved. */
name: string;
workspaceId: string;
};
/** 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[];
};
/** 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";
};