Skip to content

Worktrees

16 methods on the Worktrees resource.

16 methods · 0 available to app tokens36 pages in SDK Reference

import { Compozy } from "@compozy/client";

16 of 16

adoptWorktree

Adopt an existing linked worktree

compozy.worktrees.adoptWorktree({ path, query, body }) → Promise<WorktreeResponse>

Options

workspace_idstringpathrequired
Workspace id or path
profilestringquery
Act as this profile by name

Request bodyAdoptWorktreeRequest

POST /api/workspaces/{workspace_id}/worktrees/adoptapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.adoptWorktree({ path: { "workspace_id": "workspace_id" }, body: { /* request fields */ } });

cancelWorktreeCreate

Cancel a pending worktree creation

compozy.worktrees.cancelWorktreeCreate({ path }) → Promise<void>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path

POST /api/workspaces/{workspace_id}/worktrees/{worktree_id}/cancelapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.cancelWorktreeCreate({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } });

cancelWorktreeExitAction

Cancel a worktree exit action

compozy.worktrees.cancelWorktreeExitAction({ path, body }) → Promise<void>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path

Request bodyCancelWorktreeExitActionRequest

POST /api/workspaces/{workspace_id}/worktrees/{worktree_id}/exit/cancelapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.cancelWorktreeExitAction({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" }, body: { /* request fields */ } });

createWorktree

Accept a worktree creation

compozy.worktrees.createWorktree({ path, query, body }) → Promise<WorktreeResponse>

Options

workspace_idstringpathrequired
Workspace id or path
profilestringquery
Act as this profile by name

Request bodyCreateWorktreeRequest

POST /api/workspaces/{workspace_id}/worktreesapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.createWorktree({ path: { "workspace_id": "workspace_id" }, body: { /* request fields */ } });

dismissWorktree

Dismiss a worktree tombstone

compozy.worktrees.dismissWorktree({ path, query }) → Promise<DismissWorktreeResponse>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path
delete_branchbooleanquery
Also delete the recorded local branch after cleanup. The root checkout HEAD and default branches are kept; an unmerged branch is kept unless force is set.
forcebooleanquery
With delete_branch, also delete an unmerged branch
profilestringquery
Act as this profile by name. If omitted, operator requests infer the target record owner; authenticated agents remain scoped to their session profile.

POST /api/workspaces/{workspace_id}/worktrees/{worktree_id}/dismissapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.dismissWorktree({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } });

getWorktreeExitPlan

Read the worktree exit plan

compozy.worktrees.getWorktreeExitPlan({ path, query }) → Promise<WorktreeExitPlanResponse>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path
includestring[]query
Exact worktree-relative reviewed file paths; scoped plans return a complete include set and fingerprint.

GET /api/workspaces/{workspace_id}/worktrees/{worktree_id}/exitapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.getWorktreeExitPlan({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } });

getWorktreeStatus

Read or refresh worktree status

compozy.worktrees.getWorktreeStatus({ path, query }) → Promise<WorktreeStatusResponse>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path
refreshbooleanquery
Refresh local Git status
forgebooleanquery
Refresh the serving forge provider

GET /api/workspaces/{workspace_id}/worktrees/{worktree_id}/statusapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.getWorktreeStatus({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } });

inspectWorktree

Inspect one worktree

compozy.worktrees.inspectWorktree({ path }) → Promise<WorktreeInspectionResponse>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path

GET /api/workspaces/{workspace_id}/worktrees/{worktree_id}app tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.inspectWorktree({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } });

listWorktrees

List registered and discovered worktrees

compozy.worktrees.listWorktrees({ path, query }) → Promise<WorktreesResponse>

Options

workspace_idstringpathrequired
Workspace id or path
refreshbooleanquery
Refresh Git discovery and status

GET /api/workspaces/{workspace_id}/worktreesapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.listWorktrees({ path: { "workspace_id": "workspace_id" } });

listWorktreesAggregate

List registered and discovered worktrees

compozy.worktrees.listWorktreesAggregate({ query }) → Promise<WorktreesResponse>

Options

all_workspacesbooleanquery
Read all projects and User rows
workspace_idsstring[]query
Repeatable project IDs or @user; requires all_workspaces=true

GET /api/worktreesapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.listWorktreesAggregate();
Show all 16 methods

prepareWorktreeExitPlan

Resolve forge capabilities and prepare the worktree exit plan

compozy.worktrees.prepareWorktreeExitPlan({ path }) → Promise<WorktreeExitPlanResponse>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path

POST /api/workspaces/{workspace_id}/worktrees/{worktree_id}/exit/prepareapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.prepareWorktreeExitPlan({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } });

removeDiscoveredWorktree

Remove a discovered worktree

compozy.worktrees.removeDiscoveredWorktree({ path, query, body }) → Promise<void>

Options

workspace_idstringpathrequired
Workspace id or path
profilestringquery
Act as this profile by name

Request bodyRemoveDiscoveredWorktreeRequest

POST /api/workspaces/{workspace_id}/worktrees/discovered/removeapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.removeDiscoveredWorktree({ path: { "workspace_id": "workspace_id" }, body: { /* request fields */ } });

removeWorktree

Remove a worktree

compozy.worktrees.removeWorktree({ path, query }) → Promise<RemoveWorktreeResponse>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path
forcebooleanquery
Confirm destructive removal; with delete_branch, also delete an unmerged branch
delete_branchbooleanquery
Also delete the recorded local branch after cleanup. The root checkout HEAD and default branches are kept; an unmerged branch is kept unless force is set.
profilestringquery
Act as this profile by name. If omitted, operator requests infer the target record owner; authenticated agents remain scoped to their session profile.

DELETE /api/workspaces/{workspace_id}/worktrees/{worktree_id}app tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.removeWorktree({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } });

runWorktreeExitAction

Run a worktree exit action

compozy.worktrees.runWorktreeExitAction({ path, body }) → Promise<WorktreeExitOperationResponse>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path

Request bodyRunWorktreeExitActionRequest

POST /api/workspaces/{workspace_id}/worktrees/{worktree_id}/exit/actionsapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();const result = await compozy.worktrees.runWorktreeExitAction({ path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" }, body: { /* request fields */ } });

streamWorktree

Stream durable worktree lifecycle events

compozy.events("streamWorktree", { path, query }) → AsyncIterable<StreamEvent<SseFrame<"streamWorktree">>>

Options

workspace_idstringpathrequired
Workspace id or path
worktree_idstringpathrequired
Worktree id, name, or path
after_sequenceintegerquery
Replay events after this durable sequence

GET /api/workspaces/{workspace_id}/worktrees/{worktree_id}/streamapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();for await (const frame of compozy.events("streamWorktree", { path: { "workspace_id": "workspace_id", "worktree_id": "worktree_id" } })) {  console.log(frame);}

streamWorktreeCatalog

Stream worktree catalog changes across workspaces

compozy.events("streamWorktreeCatalog", {}) → AsyncIterable<StreamEvent<SseFrame<"streamWorktreeCatalog">>>

GET /api/worktrees/catalog-streamapp tokens denied

example.ts
import { Compozy } from "@compozy/client"; const compozy = await Compozy.connect();for await (const frame of compozy.events("streamWorktreeCatalog", {})) {  console.log(frame);}