API reference
The site build runs t3cm types --from tests/fixtures/t3-tools.json and puts
its output below. Each declaration is the signature of a search catalog
entry, grouped by global. The fixture is a snapshot of T3’s tools. A live
service takes its catalog from T3’s current tools/list and from any upstreams
you configure, so its declarations can differ from this page.
declare const t3: {
/** Accept or dismiss the dialog `preview_status` reports. Pass `promptText` to accept a prompt. Needs your own tab, or an unclaimed one. Desktop hosts may not support this. */
preview_dialog(input: {
tabId?: string;
accept: boolean;
promptText?: string;
}): Promise<{
available: boolean;
/** True while a client shows this tab: a streamed live view, or the desktop app's own browser panel. */
visible: boolean;
tabId: string | null;
url: string | null;
title: string | null;
loading: boolean;
loadError?: {
url: string;
code: number;
description: string;
} | null;
control?: {
owner: "agent" | "human" | "unclaimed";
ownedByCaller: boolean;
generation: number | "Infinity" | "-Infinity" | "NaN";
} | null;
dialog?: {
type: string;
message: string;
defaultValue: string;
} | null;
viewportSetting?: {
_tag: "fill";
} | {
_tag: "freeform";
width: number;
height: number;
} | {
_tag: "preset";
width: number;
height: number;
presetId: "iphone-se" | "iphone-xr" | "iphone-12-pro" | "iphone-14-pro-max" | "pixel-7" | "samsung-galaxy-s8-plus" | "samsung-galaxy-s20-ultra" | "ipad-mini" | "ipad-air" | "ipad-pro" | "surface-pro-7" | "surface-duo" | "galaxy-z-fold-5" | "asus-zenbook-fold" | "samsung-galaxy-a51-71" | "nest-hub" | "nest-hub-max" | "desktop-1920x1080" | "desktop-1440x900" | "laptop-1366x768" | "laptop-1280x800" | "ipad-pro-11" | "iphone-15-pro" | "pixel-8" | "galaxy-s24";
} | null;
viewport?: {
width: number;
height: number;
} | null;
fileChooser?: {
multiple: boolean;
accept: string;
} | null;
downloads?: {
fileName: string;
path: string;
sizeBytes: number | "Infinity" | "-Infinity" | "NaN";
url: string;
completedAt: string;
}[] | null;
tabs?: {
tabId: string;
url: string | null;
openerTabId?: string | null;
owner?: "agent" | "human" | "unclaimed" | null;
ownedByCaller?: boolean | null;
visible?: boolean | null;
profileId?: string | null;
}[] | null;
profiles?: {
id: string;
name: string;
incognito?: boolean | null;
}[] | null;
defaultProfileId?: string | null;
}>;
/** Report preview tab state: owner, pending dialog, URL, title, loading, viewport, and size. `tabs` lists this thread's tabs. `profiles` lists logins for `preview_open`. Read any listed tab. Act only on your tab, or an unclaimed tab with no human in control. */
preview_status(input?: {
tabId?: string;
}): Promise<{
available: boolean;
/** True while a client shows this tab: a streamed live view, or the desktop app's own browser panel. */
visible: boolean;
tabId: string | null;
url: string | null;
title: string | null;
loading: boolean;
loadError?: {
url: string;
code: number;
description: string;
} | null;
control?: {
owner: "agent" | "human" | "unclaimed";
ownedByCaller: boolean;
generation: number | "Infinity" | "-Infinity" | "NaN";
} | null;
dialog?: {
type: string;
message: string;
defaultValue: string;
} | null;
viewportSetting?: {
_tag: "fill";
} | {
_tag: "freeform";
width: number;
height: number;
} | {
_tag: "preset";
width: number;
height: number;
presetId: "iphone-se" | "iphone-xr" | "iphone-12-pro" | "iphone-14-pro-max" | "pixel-7" | "samsung-galaxy-s8-plus" | "samsung-galaxy-s20-ultra" | "ipad-mini" | "ipad-air" | "ipad-pro" | "surface-pro-7" | "surface-duo" | "galaxy-z-fold-5" | "asus-zenbook-fold" | "samsung-galaxy-a51-71" | "nest-hub" | "nest-hub-max" | "desktop-1920x1080" | "desktop-1440x900" | "laptop-1366x768" | "laptop-1280x800" | "ipad-pro-11" | "iphone-15-pro" | "pixel-8" | "galaxy-s24";
} | null;
viewport?: {
width: number;
height: number;
} | null;
fileChooser?: {
multiple: boolean;
accept: string;
} | null;
downloads?: {
fileName: string;
path: string;
sizeBytes: number | "Infinity" | "-Infinity" | "NaN";
url: string;
completedAt: string;
}[] | null;
tabs?: {
tabId: string;
url: string | null;
openerTabId?: string | null;
owner?: "agent" | "human" | "unclaimed" | null;
ownedByCaller?: boolean | null;
visible?: boolean | null;
profileId?: string | null;
}[] | null;
profiles?: {
id: string;
name: string;
incognito?: boolean | null;
}[] | null;
defaultProfileId?: string | null;
}>;
/** Open a preview tab in this thread and show it. For a dev server, pass `target` instead of `url`. `open=false` keeps it in the background. Reuses your current tab unless `tabId` or `reuseExistingTab=false` says otherwise. Parallel subagents in one session must each use `reuseExistingTab=false`, then their own returned `tabId`. */
preview_open(input?: {
tabId?: string;
/** First page URL. Absolute http(s) URL, or a bare host (https; http for loopback). Omit to open a blank tab. */
url?: string;
/** Show the preview to the user. Default true. False for background only. */
open?: boolean;
/** Old alias for `open`. */
show?: boolean;
/** Reuse `tabId`, or your current tab. Default true. False makes a new tab. */
reuseExistingTab?: boolean;
/** Profile id or name from preview_status, for a new tab. Default: the user's. A tab keeps its profile. */
profileId?: string;
target?: {
kind: "environment-port";
/** Dev-server port here. */
port: number;
/** Default http. */
protocol?: "http" | "https";
/** Path, query, and fragment, such as /settings?tab=account. */
path?: string;
};
}): Promise<{
available: boolean;
/** True while a client shows this tab: a streamed live view, or the desktop app's own browser panel. */
visible: boolean;
tabId: string | null;
url: string | null;
title: string | null;
loading: boolean;
loadError?: {
url: string;
code: number;
description: string;
} | null;
control?: {
owner: "agent" | "human" | "unclaimed";
ownedByCaller: boolean;
generation: number | "Infinity" | "-Infinity" | "NaN";
} | null;
dialog?: {
type: string;
message: string;
defaultValue: string;
} | null;
viewportSetting?: {
_tag: "fill";
} | {
_tag: "freeform";
width: number;
height: number;
} | {
_tag: "preset";
width: number;
height: number;
presetId: "iphone-se" | "iphone-xr" | "iphone-12-pro" | "iphone-14-pro-max" | "pixel-7" | "samsung-galaxy-s8-plus" | "samsung-galaxy-s20-ultra" | "ipad-mini" | "ipad-air" | "ipad-pro" | "surface-pro-7" | "surface-duo" | "galaxy-z-fold-5" | "asus-zenbook-fold" | "samsung-galaxy-a51-71" | "nest-hub" | "nest-hub-max" | "desktop-1920x1080" | "desktop-1440x900" | "laptop-1366x768" | "laptop-1280x800" | "ipad-pro-11" | "iphone-15-pro" | "pixel-8" | "galaxy-s24";
} | null;
viewport?: {
width: number;
height: number;
} | null;
fileChooser?: {
multiple: boolean;
accept: string;
} | null;
downloads?: {
fileName: string;
path: string;
sizeBytes: number | "Infinity" | "-Infinity" | "NaN";
url: string;
completedAt: string;
}[] | null;
tabs?: {
tabId: string;
url: string | null;
openerTabId?: string | null;
owner?: "agent" | "human" | "unclaimed" | null;
ownedByCaller?: boolean | null;
visible?: boolean | null;
profileId?: string | null;
}[] | null;
profiles?: {
id: string;
name: string;
incognito?: boolean | null;
}[] | null;
defaultProfileId?: string | null;
}>;
/** Navigate the chosen tab. Pass `url` for a website, or `target:{kind:'environment-port',port}` for a dev server. Exactly one of `url` and `target`. */
preview_navigate(input?: {
tabId?: string;
/** Website URL. Absolute http(s) URL, or a bare host (https; http for loopback). For public pages. */
url?: string;
target?: {
kind: "url" | "environment-port";
/** Website URL. Absolute http(s) URL, or a bare host (https; http for loopback). */
url?: string;
/** Dev-server port here. */
port?: number;
/** Default http. */
protocol?: "http" | "https";
/** Path, query, and fragment, such as /settings?tab=account. */
path?: string;
};
/** Default 'load'. 'none': return at once. */
readiness?: "load" | "domContentLoaded" | "none";
/** Default 15000. */
timeoutMs?: number;
}): Promise<{
available: boolean;
/** True while a client shows this tab: a streamed live view, or the desktop app's own browser panel. */
visible: boolean;
tabId: string | null;
url: string | null;
title: string | null;
loading: boolean;
loadError?: {
url: string;
code: number;
description: string;
} | null;
control?: {
owner: "agent" | "human" | "unclaimed";
ownedByCaller: boolean;
generation: number | "Infinity" | "-Infinity" | "NaN";
} | null;
dialog?: {
type: string;
message: string;
defaultValue: string;
} | null;
viewportSetting?: {
_tag: "fill";
} | {
_tag: "freeform";
width: number;
height: number;
} | {
_tag: "preset";
width: number;
height: number;
presetId: "iphone-se" | "iphone-xr" | "iphone-12-pro" | "iphone-14-pro-max" | "pixel-7" | "samsung-galaxy-s8-plus" | "samsung-galaxy-s20-ultra" | "ipad-mini" | "ipad-air" | "ipad-pro" | "surface-pro-7" | "surface-duo" | "galaxy-z-fold-5" | "asus-zenbook-fold" | "samsung-galaxy-a51-71" | "nest-hub" | "nest-hub-max" | "desktop-1920x1080" | "desktop-1440x900" | "laptop-1366x768" | "laptop-1280x800" | "ipad-pro-11" | "iphone-15-pro" | "pixel-8" | "galaxy-s24";
} | null;
viewport?: {
width: number;
height: number;
} | null;
fileChooser?: {
multiple: boolean;
accept: string;
} | null;
downloads?: {
fileName: string;
path: string;
sizeBytes: number | "Infinity" | "-Infinity" | "NaN";
url: string;
completedAt: string;
}[] | null;
tabs?: {
tabId: string;
url: string | null;
openerTabId?: string | null;
owner?: "agent" | "human" | "unclaimed" | null;
ownedByCaller?: boolean | null;
visible?: boolean | null;
profileId?: string | null;
}[] | null;
profiles?: {
id: string;
name: string;
incognito?: boolean | null;
}[] | null;
defaultProfileId?: string | null;
}>;
/** Resize the chosen tab: {mode:'fill'}, {mode:'freeform',width,height}, or {mode:'preset',preset,orientation}. Changes CSS size only, not the user agent. */
preview_resize(input: {
tabId?: string;
mode: "fill" | "freeform" | "preset";
preset?: "iphone-se" | "iphone-xr" | "iphone-12-pro" | "iphone-14-pro-max" | "pixel-7" | "samsung-galaxy-s8-plus" | "samsung-galaxy-s20-ultra" | "ipad-mini" | "ipad-air" | "ipad-pro" | "surface-pro-7" | "surface-duo" | "galaxy-z-fold-5" | "asus-zenbook-fold" | "samsung-galaxy-a51-71" | "nest-hub" | "nest-hub-max";
width?: number;
height?: number;
orientation?: "portrait" | "landscape";
/** Default 15000. */
timeoutMs?: number;
}): Promise<{
tabId: string;
setting: {
_tag: "fill";
} | {
_tag: "freeform";
width: number;
height: number;
} | {
_tag: "preset";
width: number;
height: number;
presetId: "iphone-se" | "iphone-xr" | "iphone-12-pro" | "iphone-14-pro-max" | "pixel-7" | "samsung-galaxy-s8-plus" | "samsung-galaxy-s20-ultra" | "ipad-mini" | "ipad-air" | "ipad-pro" | "surface-pro-7" | "surface-duo" | "galaxy-z-fold-5" | "asus-zenbook-fold" | "samsung-galaxy-a51-71" | "nest-hub" | "nest-hub-max" | "desktop-1920x1080" | "desktop-1440x900" | "laptop-1366x768" | "laptop-1280x800" | "ipad-pro-11" | "iphone-15-pro" | "pixel-8" | "galaxy-s24";
};
/** Viewport size after the resize. Omitted when it could not be measured. */
viewport?: {
width: number;
height: number;
} | null;
toolIcon?: {
_tag: "website";
pageUrl: string;
faviconUrl?: string | null;
faviconUrlDark?: string | null;
} | {
_tag: "native-app";
app: {
_tag: "app-id";
appId: string;
} | {
_tag: "display-name";
displayName: string;
};
} | {
_tag: "themed-logo";
logoUrl: string;
logoUrlDark?: string | null;
} | null;
}>;
/** Set `prefers-color-scheme` for the chosen tab: 'dark', 'light', or 'system' to clear the override. */
preview_set_appearance(input: {
tabId?: string;
colorScheme: "system" | "light" | "dark";
}): Promise<{
tabId: string;
colorScheme: "system" | "light" | "dark";
toolIcon?: {
_tag: "website";
pageUrl: string;
faviconUrl?: string | null;
faviconUrlDark?: string | null;
} | {
_tag: "native-app";
app: {
_tag: "app-id";
appId: string;
} | {
_tag: "display-name";
displayName: string;
};
} | {
_tag: "themed-logo";
logoUrl: string;
logoUrlDark?: string | null;
} | null;
}>;
/** Act on the chosen tab. Target with `locator='aria-ref=<ref>'` from `preview_snapshot`; `x` and `y` go together. `timeoutMs` defaults to 15000. click: `button`, `clickCount` 1 to 3. type: literal `text`, `clear=true` replaces it. hover: shows menus or tooltips. select: `values` in one native <select>, by value or label; for a custom dropdown, click it open, then click the option. drag: `source` onto `target`. upload: absolute `paths` answer the file picker `preview_status` reports, [] cancels it, or a `locator` sets an <input type=file>. press: one `key`, such as 'Enter', with `modifiers`, to the focused element; click a field first to focus it. scroll: the tab, or one container with a locator; positive `deltaY` scrolls down, positive `deltaX` right. */
preview_act(input: {
action: "click" | "type" | "hover" | "select" | "drag" | "upload" | "press" | "scroll";
tabId?: string;
locator?: string;
selector?: string;
x?: number;
y?: number;
button?: "left" | "right" | "middle";
clickCount?: number;
text?: string;
clear?: boolean;
values?: string[];
source?: string;
target?: string;
paths?: string[];
key?: string;
modifiers?: ("Alt" | "Control" | "Meta" | "Shift")[];
deltaX?: number;
deltaY?: number;
timeoutMs?: number;
}): Promise<unknown>;
/** Run JavaScript in the page. It can change page state. Returns `{value}`, up to 64 KB. Needs your tab, or an unclaimed one. To read a tab the user drives, use `preview_snapshot`. Page tools write only on user request. Show results with `html_render`, never page tools. */
preview_evaluate(input: {
tabId?: string;
expression: string;
/** Default true. */
awaitPromise?: boolean;
}): Promise<{
toolIcon?: {
_tag: "website";
pageUrl: string;
faviconUrl?: string | null;
faviconUrlDark?: string | null;
} | {
_tag: "native-app";
app: {
_tag: "app-id";
appId: string;
} | {
_tag: "display-name";
displayName: string;
};
} | {
_tag: "themed-logo";
logoUrl: string;
logoUrlDark?: string | null;
} | null;
value: unknown;
}>;
/** Wait until all given locator, selector, text, and URL conditions match in the chosen tab. */
preview_wait_for(input?: {
tabId?: string;
selector?: string;
locator?: string;
/** Case counts. */
text?: string;
urlIncludes?: string;
/** Default 15000. */
timeoutMs?: number;
}): Promise<{
toolIcon?: {
_tag: "website";
pageUrl: string;
faviconUrl?: string | null;
faviconUrlDark?: string | null;
} | {
_tag: "native-app";
app: {
_tag: "app-id";
appId: string;
} | {
_tag: "display-name";
displayName: string;
};
} | {
_tag: "themed-logo";
logoUrl: string;
logoUrlDark?: string | null;
} | null;
}>;
/** Start recording the chosen tab. */
preview_recording_start(input?: {
tabId?: string;
}): Promise<{
tabId: string;
recording: boolean;
startedAt: string | null;
toolIcon?: {
_tag: "website";
pageUrl: string;
faviconUrl?: string | null;
faviconUrlDark?: string | null;
} | {
_tag: "native-app";
app: {
_tag: "app-id";
appId: string;
} | {
_tag: "display-name";
displayName: string;
};
} | {
_tag: "themed-logo";
logoUrl: string;
logoUrlDark?: string | null;
} | null;
}>;
/** Stop recording the chosen tab. Returns a local path to the recording file (max 50 MiB). */
preview_recording_stop(input?: {
tabId?: string;
}): Promise<{
id: string;
tabId: string;
path: string;
mimeType: string;
sizeBytes: number;
createdAt: string;
toolIcon?: {
_tag: "website";
pageUrl: string;
faviconUrl?: string | null;
faviconUrlDark?: string | null;
} | {
_tag: "native-app";
app: {
_tag: "app-id";
appId: string;
} | {
_tag: "display-name";
displayName: string;
};
} | {
_tag: "themed-logo";
logoUrl: string;
logoUrlDark?: string | null;
} | null;
}>;
/** Use it only when the current request asks for browser work, including checking an edit in the browser. Never use it unasked to verify your own edit, or to repeat a snapshot from an earlier turn. Works on a tab the user is driving. Returns page state, elements, diagnostics, and screenshot size. Target one element with `locator='aria-ref=<ref>'` from `accessibilityTree`, even in frames. Refs die on navigation, a new snapshot, or handoff. Text caps near 20 KB; on your own or an unclaimed tab, `preview_evaluate` reads more. To show a screenshot when asked: `save=true`, then embed . */
preview_snapshot(input?: {
tabId?: string;
/** Default false. True only to see the page. */
includeImage?: boolean;
/** Write PNG, return `screenshotPath`. */
save?: boolean;
}): Promise<unknown>;
/** List providers, models, options, and runtime modes for `delegate_task`. Short list. `search` finds others. Any catalog model works. */
orchestrator_capabilities(input?: {
environmentId?: string;
search?: string;
}): Promise<{
parentThreadId: string | null;
inheritedProviderInstanceId: string | null;
inheritedModel: string | null;
inheritedOptions?: {
id: string;
value: string | boolean;
}[] | null;
runtimeMode: "approval-required" | "auto-accept-edits" | "auto" | "full-access";
interactionMode: "default" | "plan";
providers: {
providerInstanceId: string;
driverKind: string;
displayName: string | null;
models: {
id: string;
label?: string | null;
options?: {
id: string;
values: (string | boolean)[];
default?: string | boolean | null;
}[] | null;
}[];
omittedModels?: number | null;
runtimeModes?: ("approval-required" | "auto-accept-edits" | "auto" | "full-access")[] | null;
canRunChildTask: boolean;
canRunCrossProviderChildTask: boolean;
constraints: string[];
}[];
features: {
appOwnedSubagents: boolean;
asyncPolling: boolean;
cancellation: boolean;
batchThreadCreation: boolean;
threadManagement: boolean;
incrementalThreadRead: boolean;
scheduledTasks: boolean;
maxBatchThreads: number | "Infinity" | "-Infinity" | "NaN";
};
}>;
/** Start one child agent with only `task`. No parent history. Separate checkout or PR per child: `isolation:'worktree'`. Keep `taskId` for `task_status` and `task_cancel`. No secrets in `task`. */
delegate_task(input: {
task: string;
target?: {
providerInstanceId?: string;
driverKind?: string;
model?: string;
/** Options from `orchestrator_capabilities`, such as {effort:'max'}. Given values override inherited. [] or {} clears. */
options?: {
id: string;
value: string | boolean;
}[] | Record<string, string | boolean>;
environmentId?: string;
projectId?: string;
};
title?: string;
role?: "implementation" | "research" | "review" | "design" | "test" | "general";
/** 'shared' (default): parent checkout. 'worktree': new prepared checkout from the parent commit, for a separate checkout or PR per child. Uncommitted edits stay out. */
isolation?: "shared" | "worktree";
/** Default 'async'. 'wait' only if this turn needs the result. A question or approval ends the wait. */
mode?: "async" | "wait";
/** Mode 'wait' only. Default 4 min. A timeout does not cancel the child. */
timeoutMs?: number;
clientRequestId?: string;
/** Omit unless the user asks for a supervised child. Narrow modes pause for human approval, not read-only. Above yours is rejected. */
runtimeMode?: "inherit" | "approval-required" | "auto-accept-edits" | "auto" | "full-access";
interactionMode?: "inherit" | "default" | "plan";
}): Promise<{
taskId: string;
childThreadId: string | null;
remoteChild?: {
environmentId: string;
threadId: string;
label: string;
} | null;
link?: string | null;
childRunId: string | null;
childNodeId: string;
/** starting means the child's provider has not started its turn yet, so no work has begun. */
status: "queued" | "starting" | "running" | "waiting" | "completed" | "failed" | "cancelled" | "interrupted";
workState: "working" | "waiting_for_children" | "result_available";
hasPendingChildRuns: boolean;
latestTerminalRunId: string | null;
latestTerminalStatus: "completed" | "failed" | "cancelled" | "interrupted" | null;
latestTerminalSummary: string | null;
latestTerminalResultContextTransferId: string | null;
providerInstanceId: string;
model: string | null;
executedModel?: string | null | null;
options?: {
id: string;
value: string | boolean;
}[] | null;
summary: string | null;
resultContextTransferId: string | null;
/** A question blocks the child and ends a wait. Answer via `t3_pending_request` on `childThreadId`, or the user does. */
hasPendingQuestion: boolean;
/** Oldest pending approval, or null. Ends a wait. Grants no approval rights. */
pendingApproval: {
requestId: string;
kind: "command" | "file-read" | "file-change" | "mcp-elicitation" | "permission";
runId: string;
} | null;
/** True only on the timed-out wait call. The child keeps running. */
waitTimedOut: boolean;
next?: string | null;
}>;
/** Read one delegated task you started. Do not call it on a running task before its completion wakes you. `workState`: working, waiting_for_children, result_available. A finished turn with live child work is not done. `summary`: final result. Reading it marks it delivered. */
task_status(input: {
taskId: string;
}): Promise<{
taskId: string;
childThreadId: string | null;
remoteChild?: {
environmentId: string;
threadId: string;
label: string;
} | null;
link?: string | null;
childRunId: string | null;
childNodeId: string;
/** starting means the child's provider has not started its turn yet, so no work has begun. */
status: "queued" | "starting" | "running" | "waiting" | "completed" | "failed" | "cancelled" | "interrupted";
workState: "working" | "waiting_for_children" | "result_available";
hasPendingChildRuns: boolean;
latestTerminalRunId: string | null;
latestTerminalStatus: "completed" | "failed" | "cancelled" | "interrupted" | null;
latestTerminalSummary: string | null;
latestTerminalResultContextTransferId: string | null;
providerInstanceId: string;
model: string | null;
executedModel?: string | null | null;
options?: {
id: string;
value: string | boolean;
}[] | null;
summary: string | null;
resultContextTransferId: string | null;
/** A question blocks the child and ends a wait. Answer via `t3_pending_request` on `childThreadId`, or the user does. */
hasPendingQuestion: boolean;
/** Oldest pending approval, or null. Ends a wait. Grants no approval rights. */
pendingApproval: {
requestId: string;
kind: "command" | "file-read" | "file-change" | "mcp-elicitation" | "permission";
runId: string;
} | null;
/** True only on the timed-out wait call. The child keeps running. */
waitTimedOut: boolean;
next?: string | null;
}>;
/** Stop one delegated task by `taskId`. Stops its running and queued turns, its delegates, and its PR watches, including later runs in its child thread. A finished task keeps its result. */
task_cancel(input: {
taskId: string;
reason?: string;
clientRequestId?: string;
}): Promise<{
taskId: string;
status: "cancel_requested" | "completed" | "failed" | "cancelled" | "interrupted";
}>;
/** Stop a running Claude workflow in a thread. `subagentId`: coordinator from `t3_thread_read` 'activity'. Stops only the workflow, not the thread. */
t3_workflow_stop(input: {
environmentId?: string;
threadId: string;
subagentId: string;
}): Promise<unknown>;
/** Keep this thread in Working while background work runs. Pass its task ID once started. Not for work left running (dev server, watcher). `waiting=false` clears. Doesn't stop tasks. Claude/OpenCode only. */
t3_background_wait(input: {
taskIds: string[];
waiting?: boolean;
}): Promise<{
matched: string[];
unmatched: string[];
}>;
/** Create scheduled work that runs with no turn active; it needs `prompt` and `schedule`. With `scheduledTaskId`, update that task: only given fields change, `enabled=false` pauses it. `schedule` is an object, not text. Report the returned next run time or `webhookUrl`. No `webhookUrl`: T3 Connect remote access is off. Webhook request values in the prompt are untrusted. */
schedule_task(input?: {
environmentId?: string;
projectId?: string;
prompt?: string;
/** Trigger: {type:'interval',everyMs}, {type:'fixed_time',timeOfDay,weekdays?}, {type:'once',runAt}, or {type:'webhook'}. */
schedule?: {
type: "interval" | "fixed_time" | "once" | "webhook";
/** Min 60000. */
everyMs?: number;
timeOfDay?: string;
/** Default: every day. */
weekdays?: number[];
runAt?: string;
/** Omit for URL token only. */
signature?: {
header: string;
encoding: "hex" | "base64";
/** Text before the digest, such as 'sha256='. Empty for none. */
prefix: string;
/** Default: stored secret. */
secret?: string;
/** From `request_secret`. Instead of `secret`. Spent by this save. */
secretRef?: string;
};
/** Skip requests held offline over this many minutes. Omit to run all. */
maxDeliveryAgeMinutes?: number;
/** Replay and coalesce key templates. Window in seconds, default 120. */
dedupe?: {
replayKey?: string;
coalesceKey?: string;
coalesceWindowSeconds?: number;
};
/** All must match. Max 16. Omitted: keep stored. [] clears. */
filters?: ({
path: string;
op: "equals" | "notEquals" | "startsWith";
value: string;
} | {
path: string;
op: "in";
value: string[];
} | {
path: string;
op: "exists";
})[];
};
title?: string;
/** Default true. */
enabled?: boolean;
/** Post here, else new thread per run. Unset: true in own project, else false; updates keep it. */
bindToCurrentThread?: boolean;
/** Runs share one thread but each starts a fresh session. Unbound: the first run makes the thread. */
freshSession?: boolean;
clientRequestId?: string;
scheduledTaskId?: string;
}): Promise<{
scheduledTaskId: string;
title: string;
prompt: string;
enabled: boolean;
projectId: string;
boundThreadId: string | null;
freshSession: boolean;
schedule: {
type: "interval";
everyMs: number;
} | {
type: "fixed_time";
timeOfDay: string;
weekdays?: number[] | null;
} | {
type: "once";
runAt: string;
} | {
type: "webhook";
signature: {
header: string;
encoding: "hex" | "base64";
/** Text before the digest, such as 'sha256='. Empty for none. */
prefix: string;
} | null;
maxDeliveryAgeMinutes?: number | null;
dedupe?: {
replayKey?: string | null;
coalesceKey?: string | null;
coalesceWindowSeconds?: number | null;
} | null;
filters?: ({
path: string;
op: "equals" | "notEquals" | "startsWith";
value: string;
} | {
path: string;
op: "in";
value: string[];
} | {
path: string;
op: "exists";
})[] | null;
};
nextRunAt: string | null;
lastRunStatus: "never" | "running" | "succeeded" | "failed";
/** Public URL for the sender. Absent: no T3 Connect tunnel. The user must enable T3 Connect remote access. */
webhookUrl?: string | null;
webhookSignature?: "none" | "set" | null;
/** Present when an administrator's policy stops this task from running. */
blockedByPolicy?: string | null;
}>;
/** List scheduled tasks. Omit `projectId` for this thread's project. Pass a `scheduledTaskId` to `schedule_task` or `delete_scheduled_task`. In a scheduled run, do not call this to find your task. Do the prompt. */
list_scheduled_tasks(input?: {
environmentId?: string;
projectId?: string;
}): Promise<{
tasks: {
scheduledTaskId: string;
title: string;
prompt: string;
enabled: boolean;
projectId: string;
boundThreadId: string | null;
freshSession: boolean;
schedule: {
type: "interval";
everyMs: number;
} | {
type: "fixed_time";
timeOfDay: string;
weekdays?: number[] | null;
} | {
type: "once";
runAt: string;
} | {
type: "webhook";
signature: {
header: string;
encoding: "hex" | "base64";
/** Text before the digest, such as 'sha256='. Empty for none. */
prefix: string;
} | null;
maxDeliveryAgeMinutes?: number | null;
dedupe?: {
replayKey?: string | null;
coalesceKey?: string | null;
coalesceWindowSeconds?: number | null;
} | null;
filters?: ({
path: string;
op: "equals" | "notEquals" | "startsWith";
value: string;
} | {
path: string;
op: "in";
value: string[];
} | {
path: string;
op: "exists";
})[] | null;
};
nextRunAt: string | null;
lastRunStatus: "never" | "running" | "succeeded" | "failed";
/** Public URL for the sender. Absent: no T3 Connect tunnel. The user must enable T3 Connect remote access. */
webhookUrl?: string | null;
webhookSignature?: "none" | "set" | null;
/** Present when an administrator's policy stops this task from running. */
blockedByPolicy?: string | null;
}[];
}>;
/** Delete one scheduled task by `scheduledTaskId`. It stops at once. To pause instead, use `schedule_task` with `enabled=false`. */
delete_scheduled_task(input: {
environmentId?: string;
scheduledTaskId: string;
}): Promise<{
scheduledTaskId: string;
deleted: boolean;
}>;
/** Ask for one secret per single-line card; never combine values. Open it, don't offer it. Returns one-use `secretRef`, or `delivery: "file"` a file read only in its command, e.g. `adb pair <ip:port> "$(cat <file>)"`. Asked how: call now. Sign-in link: `url`. Pasted secret for child/script: `value`. Never from an old thread. */
request_secret(input: {
label: string;
reason: string;
/** Sign-in or setup page for the value. Shown as a button. */
url?: string;
placeholder?: string;
/** secretRef (default) for a T3 tool; file for a command. */
delivery?: "secretRef" | "file";
/** Pasted in this thread; no card. */
value?: string;
timeoutMs?: number;
/** Retry key. */
clientRequestId?: string;
}): Promise<unknown>;
/** Create new top-level threads in this checkout. Not delegation. One thread or its own worktree: `t3_thread_launch`. Project, branch, and worktree inherit. */
create_threads(input: {
threads: {
prompt?: string;
title?: string;
target?: {
providerInstanceId?: string;
driverKind?: string;
model?: string;
/** Options from `orchestrator_capabilities`, such as {effort:'max'}. Given values override inherited. [] or {} clears. */
options?: {
id: string;
value: string | boolean;
}[] | Record<string, string | boolean>;
environmentId?: string;
projectId?: string;
};
runtimeMode?: "inherit" | "approval-required" | "auto-accept-edits" | "auto" | "full-access";
interactionMode?: "inherit" | "default" | "plan";
}[];
clientRequestId?: string;
}): Promise<{
threads: {
threadId: string;
link?: string | null;
runId: string | null;
status: "idle" | "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "failed" | "cancelled" | "interrupted" | "rolled_back";
title: string;
createdBy: "user" | "agent" | "system";
creationSource: "web" | "mobile" | "mcp" | "provider" | "server";
providerInstanceId: string;
model: string;
}[];
}>;
/** List threads newest first, in one project or with `allProjects`. Page with `cursor`. */
t3_thread_list(input?: {
environmentId?: string;
projectId?: string;
allProjects?: boolean;
statuses?: ("idle" | "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back")[];
titleContains?: string;
settled?: boolean;
snoozed?: boolean;
includeSubagents?: boolean;
cursor?: number;
limit?: number;
}): Promise<{
projectId: string | null;
currentThreadId: string | null;
threads: {
threadId: string;
projectId: string;
title: string;
link?: string | null;
createdBy: "user" | "agent" | "system";
creationSource: "web" | "mobile" | "mcp" | "provider" | "server";
status: "idle" | "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back";
latestRunId: string | null;
providerInstanceId: string;
model: string;
runtimeMode: "approval-required" | "auto-accept-edits" | "auto" | "full-access";
interactionMode: "default" | "plan";
linkedPullRequest: {
projectId: string;
repository: string;
number: number;
url: string;
} | null;
pullRequests?: {
host: string;
repository: string;
number: number;
url: string;
source: "manual" | "created" | "agent" | "stack" | "stack-dismissed";
state: "open" | "closed" | "merged" | null;
watching: boolean;
watchStartedAt: string | null;
}[] | null;
pullRequestCount?: number | null;
openPullRequestCount?: number | null;
settled: boolean;
settledAt: string | null;
snoozed: boolean;
snoozedUntil: string | null;
blockedOnThreadWait?: boolean | null;
pendingBackgroundTasks?: {
taskId: string;
kind: "subagent" | "command" | "monitor" | "background_task";
description?: string | null;
awaited?: true | null;
childThreadId?: string | null;
}[] | null;
parentThreadId: string | null;
relationshipToParent: "fork" | "subagent" | null;
itemCount: number;
createdAt: string;
updatedAt: string;
}[];
nextCursor: number | null;
total: number;
}>;
/** Read any thread by id. View `messages` (default) or `activity` (all items). Newest first; older: `beforePosition=earlierPosition`; from the start: `afterPosition=-1`, then `nextPosition`. Cut-off text: `itemId`, `textOffset=nextTextOffset`. Reading a child's final result marks it delivered. In your reply, name it as its `link` verbatim. */
t3_thread_read(input: {
environmentId?: string;
threadId: string;
itemId?: string;
textOffset?: number;
view?: "messages" | "activity";
afterPosition?: number;
beforePosition?: number;
/** Max 100. */
limit?: number;
/** Max 50. */
runLimit?: number;
/** Max 20000. */
maxCharsPerItem?: number;
}): Promise<{
thread: {
threadId: string;
projectId: string;
title: string;
link?: string | null;
createdBy: "user" | "agent" | "system";
creationSource: "web" | "mobile" | "mcp" | "provider" | "server";
status: "idle" | "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back";
latestRunId: string | null;
activeRunId: string | null;
providerInstanceId: string;
model: string;
runtimeMode: "approval-required" | "auto-accept-edits" | "auto" | "full-access";
interactionMode: "default" | "plan";
linkedPullRequest: {
projectId: string;
repository: string;
number: number;
url: string;
} | null;
pullRequests?: {
host: string;
repository: string;
number: number;
url: string;
source: "manual" | "created" | "agent" | "stack" | "stack-dismissed";
state: "open" | "closed" | "merged" | null;
watching: boolean;
watchStartedAt: string | null;
}[] | null;
pullRequestCount?: number | null;
openPullRequestCount?: number | null;
titleRegeneration: {
requestId: string;
startedAt: string;
} | null;
lastTitleRegeneration?: {
status: "renamed" | "unchanged" | "failed";
message?: string | null;
requestId: string;
completedAt: string;
} | null;
branch: string | null;
worktreePath: string | null;
parentThreadId: string | null;
relationshipToParent: "fork" | "subagent" | null;
runCount: number;
itemCount: number;
pendingRequestCount: number;
archived: boolean;
settled: boolean;
settledAt: string | null;
snoozed: boolean;
snoozedUntil: string | null;
blockedOnThreadWait?: boolean | null;
pendingBackgroundTasks?: {
taskId: string;
kind: "subagent" | "command" | "monitor" | "background_task";
description?: string | null;
awaited?: true | null;
childThreadId?: string | null;
}[] | null;
createdAt: string;
updatedAt: string;
};
recentRuns: {
runId: string;
ordinal: number;
status: "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back";
providerInstanceId: string;
model: string;
executedModel?: string | null | null;
requestedAt: string;
startedAt: string | null;
completedAt: string | null;
}[];
items: {
position: number;
visibility: "local" | "inherited" | "synthetic";
sourceThreadId: string;
itemId: string;
subagentId?: string | null;
runId: string | null;
messageId: string | null;
createdBy: "user" | "agent" | "system" | null;
creationSource: "web" | "mobile" | "mcp" | "provider" | "server" | null;
senderThreadId?: string | null;
type: string;
status: "idle" | "pending" | "running" | "waiting" | "completed" | "failed" | "cancelled" | "interrupted";
title: string | null;
text: string | null;
textTruncated: boolean;
nextTextOffset?: number | null;
updatedAt: string;
}[];
nextPosition: number | null;
hasMore: boolean;
earlierPosition?: number | null;
}>;
/** Rename a thread (`action:'rename'` with `title`) or regenerate its title. Omit `threadId` for this thread. Workspace and branch cannot change here. */
t3_thread_update(input: {
threadId?: string;
action: "rename" | "regenerate_title";
title?: string;
clientRequestId?: string;
environmentId?: string;
}): Promise<{
threadId: string;
action: "rename" | "regenerate_title";
commandId: string;
sequence: number;
title: string;
titleRegeneration: {
requestId: string;
startedAt: string;
} | null;
linkedPullRequest: {
projectId: string;
repository: string;
number: number;
url: string;
} | null;
updatedAt: string;
}>;
/** Send a message to any thread. The target cannot run with broader modes than yours. `mode:'auto'` starts an idle thread, steers a running turn, or queues. `queue`: new turn. `steer`: mid-turn update. `restart`: interrupt and restart. A send to a finished child thread starts a fresh task and returns its `taskId`. In your reply, name it as its `link` verbatim. */
t3_thread_send(input: {
environmentId?: string;
threadId: string;
message: string;
mode?: "auto" | "queue" | "steer" | "restart";
/** Start a new provider session without the thread's earlier context, like /clear. Never steers. */
freshContext?: boolean;
clientRequestId?: string;
}): Promise<{
threadId: string;
link?: string | null;
messageId: string;
runId: string;
taskId?: string | null;
status: "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back";
delivery: "started" | "queued" | "steered" | "restarted";
}>;
/** Wait for a thread's run to finish. No `runId`: latest. Idle: at once. On timeout, with `next` end your turn; without, call again. */
t3_thread_wait(input: {
environmentId?: string;
threadId: string;
runId?: string;
timeoutMs?: number;
/** Also wait for its delegated and background tasks and their completions to settle. `resultRun` then names the run with its final answer. */
untilDelegatedWorkSettled?: boolean;
}): Promise<{
threadId: string;
runId: string | null;
status: "idle" | "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back";
timedOut: boolean;
next?: string | null;
resultRun?: {
runId: string;
status: "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back";
} | null;
}>;
/** Interrupt a top-level thread's running turn. No `runId`: newest running turn. No effect when idle. For a delegate, use `task_cancel`. */
t3_thread_interrupt(input: {
environmentId?: string;
threadId: string;
runId?: string;
reason?: string;
stop?: boolean;
clientRequestId?: string;
}): Promise<{
threadId: string;
runId: string | null;
status: "interrupt_requested" | "no_active_run" | "completed" | "failed" | "cancelled" | "interrupted" | "rolled_back";
}>;
/** List linked environments (the user's other machines) and whether each answers now. Pass one's `environmentId` to a tool to act there; `delegate_task` takes `target.environmentId`. Expired: link it again with `t3_environment_link`. */
t3_environment_links(input?: {}): Promise<{
environmentId: string;
links: {
environmentId: string;
label: string;
status: "reachable" | "unreachable" | "expired";
access: "read-only" | "approval-required" | "auto-accept-edits" | "auto" | "full-access";
expiresAt: string;
lastError: string | null;
}[];
notListed: string;
}>;
/** Ask the user to link another machine, in a card. For a machine the user names that is not linked. Pass `hint` from their words, `environmentId` when one names it (already linked: returns `linked`), `url` only when the user gave an address. Returns `pending`; the outcome arrives as a message in this thread. Do not wait, poll, or call it again to check. Never ask for a pairing code in chat. */
t3_environment_link(input?: {
/** The machine, when known, e.g. from a mentioned machine. Otherwise the user picks it in the card. */
environmentId?: string;
/** Only an address the user gave: https, Tailscale, LAN or loopback. Never guess one. */
url?: string;
/** The user's words for the machine, e.g. "vps". Preselects it in the card. */
hint?: string;
/** One sentence for the card. */
reason?: string;
/** Suggested access. The user picks; default approval-required. */
requestedAccess?: "read-only" | "approval-required" | "auto-accept-edits" | "auto" | "full-access";
clientRequestId?: string;
}): Promise<unknown>;
/** Forget a linked environment. That machine's Connections list its session until revoked there. */
t3_environment_unlink(input: {
environmentId: string;
}): Promise<{
environmentId: string;
removed: boolean;
}>;
/** Run one scheduled task now. Needs a full-access or default caller. Returns its thread, or null if not started. Success means started, not finished. */
run_scheduled_task_now(input: {
environmentId?: string;
taskId: string;
}): Promise<{
taskId: string;
threadId: string | null;
link?: string | null;
lastRunStatus: "never" | "running" | "succeeded" | "failed";
runCount: number;
nextRunAt: string | null;
}>;
/** Search active threads by title, branch, PR, project, then message text. Skips subagent threads. `projectId`: one project, else yours, else all outside a thread. Not exhaustive. */
t3_thread_search(input: {
environmentId?: string;
query: string;
limit?: number;
projectId?: string;
}): Promise<{
currentThreadId?: string | null;
matches: {
threadId: string;
projectId: string;
title: string;
link?: string | null;
source: "title" | "user" | "assistant";
snippet?: string | null;
messageCreatedAt?: string | null;
}[];
}>;
/** Read a thread's provider, model, and modes, or set its provider, model, and options with `modelSelection`. Omit `threadId` for this thread. Permission modes stay. Values from `orchestrator_capabilities`. */
t3_thread_configure(input?: {
environmentId?: string;
threadId?: string;
modelSelection?: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
};
}): Promise<unknown>;
/** Move context between threads. Omit `threadId` for this thread. fork: copy it from `sourcePoint` (default latest stable run) into a new thread with the same setup; no turn runs yet. merge_back: merge it from `sourcePoint` into a related `targetThreadId` in the same project. status: its context transfers. */
t3_thread_transfer(input: {
action: "fork" | "merge_back" | "status";
environmentId?: string;
threadId?: string;
sourcePoint?: {
type: "latest_stable" | "run" | "checkpoint";
runId?: string;
checkpointId?: string;
};
targetThreadId?: string;
title?: string;
}): Promise<unknown>;
/** Pin, snooze, settle, archive, or mark a thread unread. Omit `threadId` for this thread. `snooze` needs `snoozedUntil`. Settling this thread applies at turn end. A failed turn or queued message leaves it active. */
t3_thread_organize(input: {
environmentId?: string;
threadId?: string;
action: "pin" | "unpin" | "snooze" | "unsnooze" | "settle" | "unsettle" | "archive" | "unarchive" | "mark_unread";
snoozedUntil?: string;
}): Promise<unknown>;
/** Pending user questions in a thread. Omit `threadId` for this thread. list: their ids; approvals are not listed. read: one by `requestId`. respond: answer one with `answers`; this cannot approve a permission request. */
t3_pending_request(input: {
action: "list" | "read" | "respond";
environmentId?: string;
threadId?: string;
requestId?: string;
answers?: Record<string, unknown>;
}): Promise<unknown>;
/** Manage a thread's queued messages. Omit `threadId` for this thread. list: send order, paged by `cursor` and `limit`. read: up to 16,000 chars of one. edit: replace its `text`; attachments stay. cancel. reorder: before `beforeRunId`, or to the end with null. promote_to_steer: send it now as steering to active `targetRunId`. Writes fail once the run is no longer queued. */
t3_queue(input: {
action: "list" | "read" | "edit" | "cancel" | "reorder" | "promote_to_steer";
environmentId?: string;
threadId?: string;
queuedRunId?: string;
text?: string;
beforeRunId?: string;
targetRunId?: string;
cursor?: number;
limit?: number;
}): Promise<unknown>;
/** Get an upload URL. POST the file's exact bytes to `uploadUrl` (else this server's `relativeUrl`), then send via `t3_thread_send_attachments` with the returned `attachmentId`. */
t3_attachment_prepare_upload(input: {
upload: {
type: "image" | "file";
name: string;
mimeType: "image/gif" | "image/jpeg" | "image/png" | "image/webp" | string;
sizeBytes: number;
};
}): Promise<{
attachmentId: string;
relativeUrl: string;
expiresAt: number | "Infinity" | "-Infinity" | "NaN";
uploadUrl?: string;
}>;
/** Discard a pending upload (not a sent attachment). */
t3_attachment_discard(input: {
attachmentId: string;
}): Promise<unknown>;
/** Send uploaded attachments as a new message to a thread. No retry key. Target modes cannot exceed yours. Success does not mean the provider read them or finished. */
t3_thread_send_attachments(input: {
threadId?: string;
message?: string;
attachments: {
type: "image" | "file";
id: string;
name: string;
mimeType: string;
sizeBytes: number;
source?: {
_tag: "pasted-text";
};
}[];
}): Promise<{
threadId: string;
messageId: string;
runId: string;
status: "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back";
}>;
/** Create one new top-level thread, bound to its workspace before the agent starts. Task in `message`. Omit `projectId`, model and modes to inherit yours (outside a thread, pass `projectId` or `scratch`); modes cannot exceed yours. After an error or lost reply, retry with the same `clientRequestId`. Follow it with `t3_thread_read` or `t3_thread_wait`. Mention it with its `link`. */
t3_thread_launch(input: {
environmentId?: string;
projectId?: string;
/** No project: a new Scratch folder. Not with `projectId` or `workspaceStrategy`. */
scratch?: boolean;
title: string;
modelSelection?: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
};
runtimeMode?: "approval-required" | "auto-accept-edits" | "auto" | "full-access";
interactionMode?: "default" | "plan";
/** 'worktree': new checkout from `baseRef`. Honor a requested base. Otherwise, independent work uses the default branch as `remote/branch` (e.g. `origin/main`) with `startFromOrigin: true`; with no remote, use the local default branch. Required unpublished commits and dependent or stacked work use their local base with `startFromOrigin: false`. 'existing_worktree': bind `worktreePath`, a project worktree. 'root': project checkout, the default, not your worktree. Uncommitted edits are not copied. */
workspaceStrategy?: {
type: "root" | "existing_worktree" | "worktree";
branch?: string;
worktreePath?: string;
baseRef?: string;
startFromOrigin?: boolean;
};
/** First prompt. Omit it and `attachments` for idle. */
message?: string;
attachments?: {
type: "image" | "file";
id: string;
name: string;
mimeType: string;
sizeBytes: number;
source?: {
_tag: "pasted-text";
};
}[];
clientRequestId?: string;
delegatedFrom?: {
environmentId: string;
threadId: string;
title: string;
};
}): Promise<{
threadId: string;
link?: string | null;
projectId: string;
modelSelection: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
};
runId: string | null;
status: "preparing" | "queued" | "starting" | "running" | "waiting" | "completed" | "interrupted" | "failed" | "cancelled" | "rolled_back" | null;
}>;
/** List projects. Pages can shift. */
t3_project_list(input?: {
environmentId?: string;
cursor?: number;
limit?: number;
}): Promise<{
projects: {
id: string;
title: string;
workspaceRoot: string;
repositoryIdentity?: {
canonicalKey: string;
locator: {
source: "git-remote";
remoteName: string;
remoteUrl: string;
};
webUrl?: string;
rootPath?: string;
displayName?: string;
provider?: string;
owner?: string;
name?: string;
origin?: {
canonicalKey: string;
remoteUrl?: string;
displayName?: string;
};
} | null;
faviconPath?: string | null;
projectIcon?: {
kind: "lucide";
name: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
monogramText?: string | null;
monogram?: string | null;
} | {
kind: "emoji";
emoji: string;
} | {
kind: "monogram";
text: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
} | {
kind: string;
} | null;
defaultModelSelection: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
} | null;
defaultThreadEnvMode?: "local" | "worktree" | null;
autoPull?: boolean | null;
scripts: {
id: string;
name: string;
command: string;
icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
runOnWorktreeCreate: boolean;
runOnSettle?: boolean | null;
stopOnSettle?: boolean | null;
async?: boolean | null;
previewUrl?: string | null;
autoOpenPreview?: boolean | null;
}[];
pinnedAt?: string | null;
archivedAt?: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
}[];
nextCursor: number | null;
}>;
/** Read one project: workspace and saved scripts. */
t3_project_read(input: {
environmentId?: string;
projectId: string;
}): Promise<{
id: string;
title: string;
workspaceRoot: string;
repositoryIdentity?: {
canonicalKey: string;
locator: {
source: "git-remote";
remoteName: string;
remoteUrl: string;
};
webUrl?: string;
rootPath?: string;
displayName?: string;
provider?: string;
owner?: string;
name?: string;
origin?: {
canonicalKey: string;
remoteUrl?: string;
displayName?: string;
};
} | null;
faviconPath?: string | null;
projectIcon?: {
kind: "lucide";
name: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
monogramText?: string | null;
monogram?: string | null;
} | {
kind: "emoji";
emoji: string;
} | {
kind: "monogram";
text: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
} | {
kind: string;
} | null;
defaultModelSelection: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
} | null;
defaultThreadEnvMode?: "local" | "worktree" | null;
autoPull?: boolean | null;
scripts: {
id: string;
name: string;
command: string;
icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
runOnWorktreeCreate: boolean;
runOnSettle?: boolean | null;
stopOnSettle?: boolean | null;
async?: boolean | null;
previewUrl?: string | null;
autoOpenPreview?: boolean | null;
}[];
pinnedAt?: string | null;
archivedAt?: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
}>;
/** Register a project folder. `createWorkspaceRootIfMissing` creates it; a registered folder is rejected. No `workspaceRoot`: makes a git repo from `title` with README, icon, first commit (`commitError` on failure; project still exists). Clone first with `t3_project_clone` if needed. */
t3_project_create(input: {
environmentId?: string;
title: string;
workspaceRoot?: string;
createWorkspaceRootIfMissing?: boolean;
defaultModelSelection?: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
};
scripts?: {
id: string;
name: string;
command: string;
icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
runOnWorktreeCreate: boolean;
runOnSettle?: boolean;
stopOnSettle?: boolean;
async?: boolean;
previewUrl?: string;
autoOpenPreview?: boolean;
}[];
}): Promise<{
id: string;
title: string;
workspaceRoot: string;
repositoryIdentity?: {
canonicalKey: string;
locator: {
source: "git-remote";
remoteName: string;
remoteUrl: string;
};
webUrl?: string;
rootPath?: string;
displayName?: string;
provider?: string;
owner?: string;
name?: string;
origin?: {
canonicalKey: string;
remoteUrl?: string;
displayName?: string;
};
} | null;
faviconPath?: string | null;
projectIcon?: {
kind: "lucide";
name: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
monogramText?: string | null;
monogram?: string | null;
} | {
kind: "emoji";
emoji: string;
} | {
kind: "monogram";
text: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
} | {
kind: string;
} | null;
defaultModelSelection: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
} | null;
defaultThreadEnvMode?: "local" | "worktree" | null;
autoPull?: boolean | null;
scripts: {
id: string;
name: string;
command: string;
icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
runOnWorktreeCreate: boolean;
runOnSettle?: boolean | null;
stopOnSettle?: boolean | null;
async?: boolean | null;
previewUrl?: string | null;
autoOpenPreview?: boolean | null;
}[];
pinnedAt?: string | null;
archivedAt?: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
commitError?: string | null;
}>;
/** Update one project's settings. Omitted fields are unchanged. */
t3_project_update(input: {
environmentId?: string;
projectId: string;
title?: string;
workspaceRoot?: string;
defaultModelSelection?: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
};
autoPull?: boolean;
projectIcon?: {
kind: "lucide" | "emoji" | "monogram";
name?: string;
color?: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
emoji?: string;
text?: string;
};
faviconPath?: string;
defaultThreadEnvMode?: "local" | "worktree";
scripts?: {
id: string;
name: string;
command: string;
icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
runOnWorktreeCreate: boolean;
runOnSettle?: boolean;
stopOnSettle?: boolean;
async?: boolean;
previewUrl?: string;
autoOpenPreview?: boolean;
}[];
pinned?: boolean;
/** Threads and files are kept. */
archived?: boolean;
}): Promise<{
id: string;
title: string;
workspaceRoot: string;
repositoryIdentity?: {
canonicalKey: string;
locator: {
source: "git-remote";
remoteName: string;
remoteUrl: string;
};
webUrl?: string;
rootPath?: string;
displayName?: string;
provider?: string;
owner?: string;
name?: string;
origin?: {
canonicalKey: string;
remoteUrl?: string;
displayName?: string;
};
} | null;
faviconPath?: string | null;
projectIcon?: {
kind: "lucide";
name: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
monogramText?: string | null;
monogram?: string | null;
} | {
kind: "emoji";
emoji: string;
} | {
kind: "monogram";
text: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
} | {
kind: string;
} | null;
defaultModelSelection: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
} | null;
defaultThreadEnvMode?: "local" | "worktree" | null;
autoPull?: boolean | null;
scripts: {
id: string;
name: string;
command: string;
icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
runOnWorktreeCreate: boolean;
runOnSettle?: boolean | null;
stopOnSettle?: boolean | null;
async?: boolean | null;
previewUrl?: string | null;
autoOpenPreview?: boolean | null;
}[];
pinnedAt?: string | null;
archivedAt?: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
}>;
/** Delete one project. Nonempty needs `force: true`. Folder on disk stays. */
t3_project_delete(input: {
environmentId?: string;
projectId: string;
force?: boolean;
}): Promise<{
id: string;
title: string;
workspaceRoot: string;
repositoryIdentity?: {
canonicalKey: string;
locator: {
source: "git-remote";
remoteName: string;
remoteUrl: string;
};
webUrl?: string;
rootPath?: string;
displayName?: string;
provider?: string;
owner?: string;
name?: string;
origin?: {
canonicalKey: string;
remoteUrl?: string;
displayName?: string;
};
} | null;
faviconPath?: string | null;
projectIcon?: {
kind: "lucide";
name: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
monogramText?: string | null;
monogram?: string | null;
} | {
kind: "emoji";
emoji: string;
} | {
kind: "monogram";
text: string;
color: "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
} | {
kind: string;
} | null;
defaultModelSelection: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
} | null;
defaultThreadEnvMode?: "local" | "worktree" | null;
autoPull?: boolean | null;
scripts: {
id: string;
name: string;
command: string;
icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
runOnWorktreeCreate: boolean;
runOnSettle?: boolean | null;
stopOnSettle?: boolean | null;
async?: boolean | null;
previewUrl?: string | null;
autoOpenPreview?: boolean | null;
}[];
pinnedAt?: string | null;
archivedAt?: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
}>;
/** Clone a repository (`destinationPath` new or empty). Register after with `t3_project_create`, with the same `environmentId`. */
t3_project_clone(input: {
environmentId?: string;
provider?: string;
repository?: string;
remoteUrl?: string;
destinationPath: string;
protocol?: "auto" | "ssh" | "https";
}): Promise<{
cwd: string;
remoteUrl: string;
repository: {
provider: string;
nameWithOwner: string;
url: string;
sshUrl: string;
} | null;
}>;
/** Read this server's identity and preferences. Providers and models: `orchestrator_capabilities`. */
t3_environment_read(input?: {
environmentId?: string;
}): Promise<{
environmentId: string;
label: string;
serverVersion: string;
platform: {
os: "darwin" | "linux" | "windows" | "unknown";
arch: "arm64" | "x64" | "other";
machine?: unknown;
};
preferences: {
defaultThreadEnvMode?: unknown;
newWorktreesStartFromOrigin?: boolean | null;
enableProviderUpdateChecks?: boolean | null;
backgroundActivity: {
profile: "balanced" | "performance" | "battery-saver" | "custom";
};
sourceControlWritingStyle: {
mode: string;
followChangeRequestTemplates: boolean;
customInstructions: string;
truncated: boolean;
};
};
}>;
/** Update environment-wide preferences. Live full-access or default caller thread only. Omitted fields are unchanged; `customInstructions: ''` clears it. */
t3_environment_preferences_update(input?: {
environmentId?: string;
defaultThreadEnvMode?: "local" | "worktree";
newWorktreesStartFromOrigin?: boolean;
enableProviderUpdateChecks?: boolean;
backgroundActivity?: {
profile: "balanced" | "performance" | "battery-saver";
};
sourceControlWritingStyle?: {
mode?: "repo_conventions" | "conventional_commits" | "custom";
customInstructions?: string;
followChangeRequestTemplates?: boolean;
};
}): Promise<{
defaultThreadEnvMode?: unknown;
newWorktreesStartFromOrigin?: boolean | null;
enableProviderUpdateChecks?: boolean | null;
backgroundActivity: {
profile: "balanced" | "performance" | "battery-saver" | "custom";
};
sourceControlWritingStyle: {
mode: string;
followChangeRequestTemplates: boolean;
customInstructions: string;
truncated: boolean;
};
}>;
/** Read T3 Code's own themes and the guide to restyle it: color roles and CSS selectors. Call before `t3_theme_set`. */
t3_theme_read(input?: {
/** Also return this published theme's file. */
themeId?: string;
}): Promise<{
current: string;
builtIn: string[];
published: {
id: string;
name: string;
hasCss: boolean;
}[];
theme?: {
version?: 1 | null;
name: string;
appearance: "light" | "dark";
canvas?: string | null;
accent?: string | null;
colors?: Record<string, unknown> | null;
variants?: {
light?: Record<string, unknown> | null;
dark?: Record<string, unknown> | null;
} | null;
css?: string | null;
};
guide: string;
}>;
/** Restyle T3 Code itself, only when the user asks. With `theme`, publish it as `themeId` (the same id updates it) and switch this machine's web and desktop clients to it. Without `theme`, switch to a built-in or published `themeId`. `appearance` switches them to light, dark, or system mode, with or without a theme. Live full-access or default caller thread only. */
t3_theme_set(input?: {
themeId?: string;
theme?: {
version?: 1;
name: string;
appearance: "light" | "dark";
canvas?: string;
accent?: string;
colors?: Record<string, unknown>;
variants?: {
light?: Record<string, unknown>;
dark?: Record<string, unknown>;
};
css?: string;
};
appearance?: "light" | "dark" | "system";
}): Promise<{
themeId?: string;
appearance?: "light" | "dark" | "system";
published: boolean;
}>;
/** List this thread's preview tabs. Only `runtime:'server'` entries can be automated here. Others are in the user's local desktop app. Never pass a non-server `tabId` to a `preview_*` tool. Tell the user that tab is on their local desktop and this environment cannot reach it. */
t3_preview_list(input?: {
cursor?: number;
limit?: number;
}): Promise<{
sessions: {
threadId: string;
tabId: string;
navStatus: {
_tag: "Idle";
} | {
_tag: "Loading";
url: string;
title: string;
} | {
_tag: "Success";
url: string;
title: string;
} | {
_tag: "LoadFailed";
url: string;
title: string;
code: number;
description: string;
download?: {
id: string;
fileName: string;
} | null;
};
canGoBack: boolean;
canGoForward: boolean;
viewport?: {
_tag: "fill";
} | {
_tag: "freeform";
width: number;
height: number;
} | {
_tag: "preset";
width: number;
height: number;
presetId: "iphone-se" | "iphone-xr" | "iphone-12-pro" | "iphone-14-pro-max" | "pixel-7" | "samsung-galaxy-s8-plus" | "samsung-galaxy-s20-ultra" | "ipad-mini" | "ipad-air" | "ipad-pro" | "surface-pro-7" | "surface-duo" | "galaxy-z-fold-5" | "asus-zenbook-fold" | "samsung-galaxy-a51-71" | "nest-hub" | "nest-hub-max" | "desktop-1920x1080" | "desktop-1440x900" | "laptop-1366x768" | "laptop-1280x800" | "ipad-pro-11" | "iphone-15-pro" | "pixel-8" | "galaxy-s24";
} | null;
colorScheme?: "system" | "light" | "dark" | null;
zoomFactor?: 0.25 | 0.33 | 0.5 | 0.67 | 0.75 | 0.8 | 0.9 | 1 | 1.1 | 1.25 | 1.5 | 1.75 | 2 | 2.5 | 3 | 4 | 5 | null;
profileId?: string | null;
runtime?: "desktop" | "server" | null;
headless?: boolean | null;
automationOwner?: string | null;
reveal?: boolean | null;
revealRequest?: {
id: string;
force: boolean;
} | null;
updatedAt: string;
}[];
serverEpoch: string;
revision: number;
nextCursor: number | null;
}>;
/** Close one preview tab this thread owns. Use it on a tab you opened for your own check when you finish. */
t3_preview_close(input: {
tabId: string;
}): Promise<unknown>;
/** Move THIS thread into a new git worktree on a new branch. Runs the setup script by default. A separate agent in a worktree: `t3_thread_launch` with `workspaceStrategy`. Call last in your turn. The move ends the live session. `continuationPrompt` resumes work there next turn. Without it, the thread waits. The worktree stays after the thread is deleted. Fails if this thread has a worktree. */
t3_worktree_handoff(input: {
branch: string;
baseRef?: string;
/** True: fetch, start from the remote ref; check `startedFromOrigin`. Default: server setting. */
startFromOrigin?: boolean;
/** Default true. */
runSetupScript?: boolean;
continuationPrompt?: string;
}): Promise<{
worktreePath: string;
branch: string;
baseRef: string;
startedFromOrigin: boolean;
setupScript: {
status: "started";
scriptName: string;
terminalId: string;
} | {
status: "no-script";
} | {
status: "skipped";
} | {
status: "failed";
detail: string;
};
continuation: {
status: "scheduled";
delivery: "started" | "queued" | "steered" | "restarted";
} | {
status: "skipped";
} | {
status: "failed";
detail: string;
};
note: string;
}>;
/** Report this thread's worktree: attached or not, path, branch, project root, and the `startFromOrigin` default. Check before `t3_worktree_handoff`. */
t3_worktree_status(input?: {}): Promise<{
attached: boolean;
worktreePath: string | null;
branch: string | null;
projectWorkspaceRoot: string;
/** `startFromOrigin` default for `t3_worktree_handoff`. */
defaultStartFromOrigin: boolean;
}>;
/** List branch refs and checkout paths for a thread's workspace. Omit `threadId` for this thread. Detached worktrees with no branch are left out. */
t3_worktree_list(input?: {
environmentId?: string;
threadId?: string;
query?: string;
cursor?: number;
limit?: number;
refKind?: "all" | "local" | "remote";
includeMatchingRemoteRefs?: boolean;
}): Promise<{
isAtRepositoryRoot?: boolean | null;
refs: {
name: string;
isRemote?: boolean | null;
remoteName?: string | null;
upstreamRef?: string | null;
current: boolean;
isDefault: boolean;
worktreePath: string | null;
}[];
isRepo: boolean;
hasPrimaryRemote: boolean;
nextCursor: number | null;
totalCount: number;
}>;
/** Link a PR to this thread. T3 shows its status and settles the thread on merge. For several PRs, use `link_pull_requests`. */
link_pull_request(input?: {
environmentId?: string;
threadId?: string;
url?: string;
repository?: string;
/** With `repository`, when no `url`. */
number?: number;
host?: string;
}): Promise<{
host: string;
repository: string;
number: number;
url: string;
alreadyLinked: boolean;
next?: string | null;
}>;
/** Link several PRs to a thread. Use it instead of one `link_pull_request` per PR. URLs that are not PRs come back in `invalidUrls`. */
link_pull_requests(input: {
environmentId?: string;
threadId?: string;
urls: string[];
}): Promise<{
linked: {
host: string;
repository: string;
numbers: number[];
}[];
alreadyLinked: {
host: string;
repository: string;
numbers: number[];
}[];
linkedCount: number;
invalidUrls?: string[] | null;
next?: string | null;
}>;
/** Remove a PR link from this thread. Succeeds with `wasLinked=false` when it was not linked. */
unlink_pull_request(input?: {
environmentId?: string;
threadId?: string;
url?: string;
repository?: string;
/** With `repository`, when no `url`. */
number?: number;
host?: string;
}): Promise<{
host: string;
repository: string;
number: number;
wasLinked: boolean;
}>;
/** Unlink a thread's PRs whose last known state is in `states`. Use it instead of one `unlink_pull_request` per PR. PRs with no known state stay linked. */
unlink_pull_requests(input: {
environmentId?: string;
threadId?: string;
states: ("open" | "closed" | "merged")[];
}): Promise<{
unlinked: {
host: string;
repository: string;
state: "open" | "closed" | "merged";
numbers: number[];
}[];
unlinkedCount: number;
remaining: number;
}>;
/** List a thread's PRs, with last known state and stack order (bottom to top). Not an end-of-work check. */
list_thread_pull_requests(input?: {
environmentId?: string;
threadId?: string;
states?: ("open" | "closed" | "merged")[];
cursor?: string;
}): Promise<{
pullRequests: {
host: string;
repository: string;
number: number;
url: string;
source: "manual" | "created" | "agent" | "stack" | "stack-dismissed";
watching: boolean;
state: "open" | "closed" | "merged" | null;
title: string | null;
headBranch: string | null;
baseBranch: string | null;
isDraft: boolean | null;
stack: {
kind: "native" | "derived";
position: number;
size: number;
} | null;
}[];
chains: {
kind: "native" | "derived";
numbers: number[];
}[];
nextCursor: string | null;
}>;
/** Watch an open PR for this thread, linking it first if needed. T3 wakes you on failed checks, passed required checks, new comments or reviews, or conflicts. Handle old comments first. Only later ones wake you. After this call, end your turn. The watch stays on after each wake, so do not call this again on a wake. A wake is not a merge decision. Check readiness yourself. */
watch_pull_request(input?: {
environmentId?: string;
threadId?: string;
url?: string;
repository?: string;
/** With `repository`, when no `url`. */
number?: number;
host?: string;
}): Promise<{
host: string;
repository: string;
number: number;
url: string;
watching: boolean;
wasWatching: boolean;
}>;
/** Stop watching a PR for this thread. It stays linked. */
unwatch_pull_request(input?: {
environmentId?: string;
threadId?: string;
url?: string;
repository?: string;
/** With `repository`, when no `url`. */
number?: number;
host?: string;
}): Promise<{
host: string;
repository: string;
number: number;
url: string;
watching: boolean;
wasWatching: boolean;
}>;
/** Write review guides for up to 20 PRs (the tour in the PR Guide tab). Returns once runs start. Each run takes minutes in a temporary checkout. A run for the same head is joined. Read with `read_pull_request_guide`. Fails while guides are off. */
write_pull_request_guides(input: {
environmentId?: string;
pullRequests: {
url?: string;
repository?: string;
/** With `repository`, when no `url`. */
number?: number;
host?: string;
}[];
}): Promise<{
guides: {
host: string;
repository: string;
number: number;
url: string;
/** started: a run began. running: joined a run for this head. failed: see detail. */
outcome: "started" | "running" | "failed";
detail: string | null;
}[];
}>;
/** Read a PR's stored review guide and run state. `guide` is null when none exists. Never starts a run. */
read_pull_request_guide(input?: {
environmentId?: string;
url?: string;
repository?: string;
/** With `repository`, when no `url`. */
number?: number;
host?: string;
}): Promise<{
host: string;
repository: string;
number: number;
url: string;
guide: {
headSha: string;
generatedAt: string;
modelSelection: {
provider?: unknown;
instanceId?: unknown;
model: unknown;
options?: unknown;
};
stops: {
title: string;
summary: string;
attention: {
kind: "tradeoff" | "contract" | "product" | "risk" | "accessibility";
note: string;
} | null;
excerpts: {
path: string;
side: "new" | "old";
start: number;
end: number;
caption: string;
}[];
files: {
path: string;
note?: string;
}[];
notes: {
path: string;
line: number;
title: string;
body: string;
}[];
questions: string[];
}[];
} | null;
run: {
_tag: "Running";
headSha: string;
startedAt: string;
} | {
_tag: "Failed";
headSha: string;
failedAt: string;
detail: string;
} | null;
currentHeadSha: string | null;
/** True when the PR head moved after the guide was written. */
stale: boolean;
}>;
/** List iOS Simulators and Android Emulators on every device host, what each host can run, and what is open in this thread's Device panel. Call before `device_open` when you do not know a device id. */
device_list(input?: {
/** Limit to one device host. Defaults to all hosts. */
hostId?: string;
}): Promise<{
hostStatuses: Record<string, {
status: "disabled" | "idle" | "installing" | "starting" | "ready" | "failed";
detail?: string | null;
androidDiscoveryIncomplete?: boolean | null;
incompletePlatforms?: ("ios" | "android")[] | null;
}>;
hosts: ({
id: string;
label: string;
platforms: {
platform: "ios" | "android";
available: boolean;
reason?: string | null;
}[];
tools?: {
hub: {
requiredVersion: string;
installedVersions: string[];
runningVersion: string | null;
};
agent: {
requiredVersion: string;
installedVersions: string[];
runningVersion: string | null;
};
} | null;
toolInspectionError?: string | null;
hubInstalled: boolean;
agentDeviceInstalled: boolean;
kind: "local" | "ssh";
} | {
id: string;
label: string;
platforms: {
platform: "ios" | "android";
available: boolean;
reason?: string | null;
}[];
tools?: {
hub: {
requiredVersion: string;
installedVersions: string[];
runningVersion: string | null;
};
agent: {
requiredVersion: string;
installedVersions: string[];
runningVersion: string | null;
};
} | null;
toolInspectionError?: string | null;
hubInstalled: boolean;
agentDeviceInstalled: boolean;
kind: "eas";
} | {
id: string;
label: string;
platforms: {
platform: "ios" | "android";
available: boolean;
reason?: string | null;
}[];
tools?: {
hub: {
requiredVersion: string;
installedVersions: string[];
runningVersion: string | null;
};
agent: {
requiredVersion: string;
installedVersions: string[];
runningVersion: string | null;
};
} | null;
toolInspectionError?: string | null;
hubInstalled: boolean;
agentDeviceInstalled: boolean;
kind: "simlock";
})[];
devices: {
hostId: string;
id: string;
platform: "ios" | "android";
name: string;
version: string;
booted: boolean;
physical: boolean;
}[];
open: {
hostId: string;
deviceId: string;
}[];
}>;
/** Open a simulator or emulator for this thread. Pass `deviceId` and `hostId` from `device_list`. Boots it if needed and shows it in the user's Device panel. Returns the `agent-device` CLI call pinned to that device. Drive the device with that CLI. */
device_open(input?: {
deviceId?: string;
/** Needed with no `deviceId` when both platforms exist. */
platform?: "ios" | "android";
hostId?: string;
}): Promise<{
device: {
hostId: string;
id: string;
platform: "ios" | "android";
name: string;
version: string;
booted: boolean;
physical: boolean;
};
agentDevice: {
command: string;
targetArgs: string[];
session: string;
};
quickStart: string;
}>;
/** Remove a device from this thread's Device panel. `shutdown=true` also turns it off. */
device_close(input?: {
deviceId?: string;
hostId?: string;
/** Also turn it off. Default false. */
shutdown?: boolean;
}): Promise<{}>;
/** Get a PNG of an open device's screen. For taps and text, use the `agent-device` CLI. */
device_screenshot(input?: {
deviceId?: string;
hostId?: string;
}): Promise<unknown>;
/** Show the user a Markdown message in this thread, exactly as written, before your turn ends. Use it for content the user must read in full mid-turn, such as a draft, a code block, or what a question you are about to ask refers to. Don't repeat it in your reply. */
send_to_user(input: {
/** Markdown, shown verbatim. */
message: string;
}): Promise<{
sentMessage: string;
message: string;
}>;
/** Show a finished HTML page (chart, diagram, mockup) inline in this thread, above your final reply. Do not announce or restate the page. Frame fits height to 20000px. On mobile, content past the given height scrolls. Frame width is reply width (728px desktop, about 360px phones), on the thread background. Leave html, body, and the outer element with no background color, no outer card, border, banner title, or side padding. This wins over any rule that sets a page background. T3 adds an overridable 8px html gutter for selection rings and shadows. Use fluid widths within it. A box that needs its own background gets 16px padding and var(--radius) corners. Give charts fixed pixel heights. Let content set the height. Do not use vh units or height:100% on html or body. Both are rejected or loop. Use theme CSS variables on :root, not fixed colors: --background, --foreground, --muted, --card, --popover, --secondary, --border, --ring, --primary, --accent, --destructive, --warning, --success, --info, --code-background (most have a matching -foreground; accent, destructive, and warning also have -surface), --chart-1 to --chart-6, --radius, --font-sans, --font-mono. The base sheet sets background, text, and font. */
html_render(input: {
/** Absolute .html file path. */
path?: string;
/** Inline HTML. */
html?: string;
title: string;
/** Frame height in CSS pixels, 80 to 2000. Use the contentHeight from html_preview. */
height: number;
}): Promise<{
htmlRender: {
attachmentId: string;
title: string;
height: number | "Infinity" | "-Infinity" | "NaN";
heights?: [number, number][] | null;
};
message: string;
}>;
/** Check an HTML page before html_render. Returns PNG, contentHeight, and console output. Self-contained: inline <style> and <script>. Local images as absolute paths are inlined. Remote URLs load as-is. Theme and layout rules are in html_render. */
html_preview(input?: {
/** Absolute .html file path. */
path?: string;
/** Inline HTML. */
html?: string;
/** CSS pixels, 240 to 1600. Default 728. Use about 390 for phones. */
width?: number;
/** Default dark. */
appearance?: "dark" | "light";
}): Promise<unknown>;
call(name: string, input?: object): Promise<unknown>;
};
declare const tools: {
call(name: string, input?: object): Promise<unknown>;
};
/** Read a JSON value from this session's namespace; null when absent. */
mem.get(key: string): Promise<unknown | null>;
/** Store a JSON value (up to 1 MB) under key. Survives restarts. */
mem.set(key: string, value: unknown): Promise<null>;
/** Delete a key; true when it existed. */
mem.del(key: string): Promise<boolean>;
/** Keys in the namespace, sorted, optionally starting with prefix. */
mem.list(prefix?: string): Promise<string[]>;
/** The same get/set/del/list API on another namespace, shared across threads (for example "work:widgets#41"). Synchronous. */
mem.ns(name: string): { get; set; del; list };
/** A plain object restored before each execute and saved after it, per session (default: your thread). Assign fields; keep it JSON-serializable. */
vars: Record<string, unknown>;
/** Start this thread with a role: overseer, ticket or worker. A role the overseer role lists as a child (ticket by default) with no open link joins the board (parent "board"), labeled from its board launch, `label`, or its T3 title, so its gates become board cards; root: true keeps it a standalone root. Other roles start as roots. A thread the board launched clears its own pending launch, matched by thread id. Optional issue, parentIssue and part are stored on the board link it joins. */
wf.init(input: { role: string; label?: string; root?: boolean; issue?: string; parentIssue?: string; part?: string }): Promise<{ thread: string; role: string; root: boolean; parent?: string; label?: string; watcher: string }>;
/** Prepare a link to a child thread you are about to launch. Paste the returned brief, verbatim, at the end of the child's launch brief; the child binds the link with wf.join, whose call in the brief carries any issue, parentIssue and part given here. pr stores the PR description format on the child's link, so wf.pr can check a worker's opened event without the ticket, and pr.method lets t3cm merge the PR on the board's "merge" answer without the ticket. issue and parentIssue (a GitHub issue ref, GitLab issue URL, or Jira key/URL) name the issue the child works and the epic it belongs to, and part (n/N, such as "1/4") says which of the epic's PRs it is; wf.board() and the board return all three. */
wf.openChild(input: { role: string; label: string; issue?: string; parentIssue?: string; part?: string; pr?: { format?: string; sections?: Record<string, string[]>; passes?: string[]; mergeOnly?: boolean; method?: "merge" | "squash" | "rebase" } }): Promise<{ brief: string; params: { down: number; miss: number; stall: number } }>;
/** Join the link a parent opened (the call is in your launch brief). The watcher then nudges you after `down` idle minutes with no gate open. A rejoin without issue, parentIssue or part keeps the ones the link has. A worker link with no issue takes one from the closing-issue references (Closes #N) of its PR at the next GitHub reconcile. */
wf.join(input: { parent: string; label: string; role: string; down?: number; miss?: number; stall?: number; issue?: string; parentIssue?: string; part?: string }): Promise<{ parent: string; label: string; params: { down: number; miss: number; stall: number } }>;
/** Send to your parent. note: stored, never wakes, reaches the parent as a digest line at its next wake. event/gate/blocker/report wake it per link policy (overseer links turn events into notes). gate also opens a gate (no nudges until cleared). handoff/closed close the link. wake overrides the policy. With parent "board": note/event go to the board's feed, gate/blocker/report become a decision card (delivery "board", card id, and the card's reply buttons as options), handoff/closed mark the ticket done. options (gate/blocker/report only) sets the card's buttons in place of parsing the body: each one line, 1-60 chars, unique ignoring case, at most 8; a bad entry fails the send. A gate card with no buttons also returns a warning. */
wf.send(input: { kind: "note" | "event" | "gate" | "blocker" | "report" | "handoff" | "closed"; body: string; gate?: string; wake?: boolean; options?: string[] }): Promise<{ handle: string; delivery: "noted" | "sent" | "queued" | "board"; detail?: string; card?: string; options?: string[]; warning?: string; closed?: boolean }>;
/** Send to one of your children (by label or thread id). A closed link needs reopen: true. */
wf.reply(input: { to: string; body: string; reopen?: boolean }): Promise<{ handle: string; delivery: "noted" | "sent" | "queued" | "board"; detail?: string; card?: string; options?: string[]; warning?: string; closed?: boolean }>;
/** Open a gate while you wait on a person ({open: "merge"}); the watcher does not nudge you until {clear: true}. */
wf.gate(input: { open: string } | { clear: true }): Promise<{ gate: string | null }>;
/** Pause a link the work is meant to sit on: your own parent link, or a child's ({child: label or thread id}). The watcher sends a paused link no nudges, escalations or reports, and the board shows it as paused, not idle. {paused: false} resumes it with a fresh nudge count. */
wf.pause(input?: { child?: string; paused?: boolean }): Promise<{ label: string; paused: boolean }>;
/** Close a child link without a handoff (by label or thread id); the watcher stops watching it. */
wf.close(input: { child: string }): Promise<{ closed: string }>;
/** Unread notes from your children, oldest first; marks them read. */
wf.inbox(): Promise<{ handle: string; at: string; label: string; kind: string; head: string }[]>;
/** One stored message in full, by handle ("m12"). */
wf.show(handle: string): Promise<{ handle: string; kind: string; from: string; to: string; at: string; body: string }>;
/** Your parent link and one object per child link, with live T3 status. all: include closed links. parent: show that node's tree instead, each child with its workers (parent: "board" is the whole t3-codemode board, no caller needed). */
wf.board(input?: { all?: boolean; parent?: string }): Promise<{ parent: { thread: string; label: string; closed: boolean; gate: string | null } | null; children: { label: string; role: string; thread: string; link: string | null; status: string; asks: number; background: number; gate: string | null; paused: boolean; issue: string | null; parentIssue: string | null; part: string | null; lastUp: string; nudges: number; unread: number; last: { handle: string; kind: string; head: string } | null }[] }>;
/** Take over a retiring thread's open child links, pending links and queued messages. */
wf.adopt(input: { from: string }): Promise<{ adopted: string[]; pending: string[] }>;
/** Before finishing: open child links, never-joined links (dropped now), and whether your own parent link is still open. */
wf.sweep(): Promise<{ open: string[]; dropped: string[]; parentOpen: boolean }>;
/** Launch a t3-ticket thread for a GitHub, GitLab, or Jira issue that reports to the t3-codemode board (the root overseer). When project (id or title) is given it selects the T3 project directly; otherwise GitHub and GitLab refs match the T3 project whose workspace origin remote has that host and repo path, and Jira keys or unmatched GitLab/Jira hosts fall back to the user config's trackers mappings. The model resolves through the models.ticket slot for the issue's project in this order: launch arguments (model/effort), the repo's .t3-workflow.json and AGENTS.md, the user config's models.ticket, legacy board.* ticket keys, and the built-in default. A pool value picks through that pool (as wf.pick does) and adds pool and reason to the result. The result always carries instanceId, model, effort and modelSource. An unmapped ref, an invalid or unavailable model/instance/effort/pool, or a failed launch throws and leaves an error card on the board, never falling back to the built-in default. The ticket's link stores the canonical issue slug (GitHub <owner>/<repo>#<n>, GitLab <host>/<group/...>/<project>#<n>, or Jira KEY-N or <host>/KEY-N), with the optional parentIssue and part. The ticket is labeled <repo>#<n> for GitHub/GitLab or KEY-N for Jira (falling back to the slug if that label is already open), and an issue that already has a ticket or a pending launch throws. Every launch counts against the global cap, maxTicketsTotal (default 8): when the board already has that many open tickets, whatever launched them, the launch throws and leaves an error card, and nothing at run time raises the cap. */
wf.launchTicket(input: { issue: string; parentIssue?: string; part?: string; project?: string; title?: string; model?: string; effort?: string }): Promise<{ ok: true; label: string; thread: string; link: string | null; projectId: string; title: string; instanceId: string; model: string; effort: string | null; modelSource: "argument" | ".t3-workflow.json" | "AGENTS.md" | "user" | "board" | "default"; pool?: string; reason?: string }>;
/** Launch a thread in a T3 project (id or title) to carry out a request, on the models.ticket slot resolved for that project exactly as wf.launchTicket resolves it (pools included). The brief is the request word for word plus a board link, so the thread joins the board as a ticket labeled "<project title>: <title>" (title defaults to the request's first words), with " (2)", " (3)" and so on added when that label is already on the board. When the caller is the scratch thread of a board question (Ask), that question records dispatched: { thread, link, projectId, project, label }. An unknown project throws and launches nothing; an unavailable model, a board already at the maxTicketsTotal cap of open tickets, or a failed launch throws and leaves an error card. */
wf.dispatch(input: { project: string; request: string; title?: string }): Promise<{ ok: true; label: string; thread: string; link: string | null; projectId: string; title: string; instanceId: string; model: string; effort: string | null; modelSource: "argument" | ".t3-workflow.json" | "AGENTS.md" | "user" | "board" | "default"; pool?: string; reason?: string }>;
/** Report a GitHub issue this thread just filed, so it shows on the board's new-issues list with a link back to this thread and when it was filed. Needs no parent link. Reporting an issue already on the list, dismissed or not, or one that already has a board ticket, adds nothing: added is false, reason says which, and message says so. When blockedBy, parent, track or priority is given and sync is not false (sync defaults to true when any of those is passed), also wires native GitHub blocked-by links (addBlockedBy), sub-issue parent link (addSubIssue), and track:/priority: labels idempotently (creating missing labels as needed). Already-linked relationships and already-applied labels succeed; GitHub and permission errors are reported in wiring.errors rather than discarded. From the list the user launches a ticket for it (the same path as wf.launchTicket) or dismisses it. */
wf.issue(input: { url: string; title?: string; note?: string; blockedBy?: string[]; parent?: string; track?: string; priority?: "high" | "medium" | "low"; sync?: boolean }): Promise<{ added: boolean; reason?: "reported" | "ticket"; message: string; issue?: { id: string; url: string; repo: string; number: number; label: string; title: string | null; note: string | null; thread: string; threadLink: string | null; threadTitle: string | null; at: string; atLocal: string; dismissed: boolean; dismissedAt: string | null; dismissedAtLocal: string | null; restoredAt: string | null }; ticket?: { label: string; thread: string | null; link: string | null; done: boolean }; wiring?: { ok: boolean; blockedBy: { ref: string; status: "linked" | "alreadyLinked" | "error"; error?: string }[]; parent: { ref: string; status: "linked" | "alreadyLinked" | "error"; error?: string } | null; labels: { name: string; status: "added" | "createdAndAdded" | "alreadyApplied" | "error"; error?: string }[]; errors: { op: string; target: string; message: string; permission: boolean }[] } }>;
/** Create a batch of GitHub issues forming a dependency DAG in one call. Items may carry symbolic local ids (for example "P0", "P1") referenced by other items' blockedBy and parent fields alongside external GitHub issue refs (#N, owner/repo#N, or URL). Validates every item, topologically sorts the batch across both parent and blockedBy edges, and rejects cycles or invalid references before making any GitHub write. Creates issues in topological order so real #N numbers are known, writes the canonical ## Flow block (Parent, Blocked by, Track, Priority, Touches) with resolved #N (or owner/repo#N across repos) into each issue body, wires native GitHub addBlockedBy, addSubIssue, and labels (track:, priority:, queue opt-in label from flow.optIn.label when queue is true, plus custom labels) when sync is not false, and reports created issues to the board's new-issues list when called from a thread (unless report is false). Permission or wiring errors are reported in each item's wiring and top-level errors without being swallowed. */
wf.fileIssues(input: { repo?: string; parent?: string; track?: string; priority?: "high" | "medium" | "low"; labels?: string[]; queue?: boolean; report?: boolean; sync?: boolean; issues: { id?: string; repo?: string; title: string; body?: string; blockedBy?: string[]; parent?: string; track?: string; priority?: "high" | "medium" | "low"; touches?: string[]; labels?: string[]; queue?: boolean; note?: string }[] }): Promise<{ ok: boolean; order: string[]; issues: ({ id: string | null; inputIndex: number; repo: string; number: number; label: string; url: string; title: string; body: string; parent: string | null; blockedBy: string[]; labels: string[]; reported: { added: boolean; reason?: "reported" | "ticket"; issue?: { id: string; url: string; repo: string; number: number; label: string; title: string | null; note: string | null; thread: string; threadLink: string | null; threadTitle: string | null; at: string; atLocal: string; dismissed: boolean; dismissedAt: string | null; dismissedAtLocal: string | null; restoredAt: string | null }; ticket?: { label: string; thread: string | null; link: string | null; done: boolean }; message?: string; error?: string } | null; wiring: { ok: boolean; blockedBy: { ref: string; status: "linked" | "alreadyLinked" | "error"; error?: string }[]; parent: { ref: string; status: "linked" | "alreadyLinked" | "error"; error?: string } | null; labels: { name: string; status: "added" | "createdAndAdded" | "alreadyApplied" | "error"; error?: string }[]; errors: { op: string; target: string; message: string; permission: boolean }[] } | null })[]; byId: Record<string, { repo: string; number: number; label: string; url: string }>; errors: { issue: string; op: string; target: string; message: string; permission: boolean }[] }>;
/** Pick a provider instance from a configured pool for one launch. The result and its reason name the driver, model and effort chosen: the pool's model and effort, or in a mixed pool the chosen member's own. Skips members T3 reports disabled or constrained, members that do not list their model or offer their effort, and members marked limited; a member with a reserve is a last resort, picked only when every other member is out. Under strategy cheapest, the lowest-cost members that can run take every launch, by weight among themselves. Pass modelSelection to t3_thread_launch, then report the launched thread with wf.picked. Throws, naming the pool, when no member can run or, in a pool that is not mixed, a member is not an instance of the pool's driver; nothing is launched. */
wf.pick(input: { pool: string }): Promise<{ pool: string; pick: number; instanceId: string; driver: string; model: string; effort: string | null; options: { id: string; value: string }[]; reason: string; skipped: { instanceId: string; reason: string }[]; modelSelection: { instanceId: string; model: string; options?: { id: string; value: string }[] } }>;
/** Record the thread a wf.pick launched, so the board can offer to move that thread to another member of its pool when it stops on a usage limit. A thread launched without a recorded pick never gets that offer. Throws when the pick is unknown or already launched another thread. */
wf.picked(input: { pick: number; thread: string }): Promise<{ pick: number; pool: string; instanceId: string; thread: string }>;
/** Each configured pool with its members: driver, model and effort, weight, reserve, cost, state (ready, limited, disabled, constrained, missing-model, missing-effort, or unknown when T3 did not answer), why, the limit's reset time (ISO and local), running threads, and pick count and last pick. A mixed pool has no pool-level driver, model or effort (null), and in a mixed pool a member's driver is null when T3 did not answer. error names a member that is not an instance of the pool's driver, or says T3 did not answer. warnings flags a member that is the only one able to run the pool's model, or in a mixed pool the only one of its driver able to run its model, and suggests a reserve on it when it has none. */
wf.pools(): Promise<{ pool: string; mixed: boolean; driver: string | null; model: string | null; effort: string | null; strategy: "weighted" | "priority" | "cheapest"; moveOnLimit: "ask" | "auto" | "never"; error: string | null; warnings: string[]; members: { instanceId: string; driver: string | null; model: string; effort: string | null; weight: number; reserve: number; cost: number; state: string; reason: string | null; limitedUntil: string | null; limitedUntilLocal: string | null; limitReason: string | null; usageLeft: number | null; running: number | null; picks: number; lastPick: string | null; lastPickLocal: string | null }[] }[]>;
/** How board ticket launches are routed now and over a recent window. It reads the ticket launch selection the board resolves (models.ticket in the user config, else legacy board.pool or board ticket keys, else the default). With a pool (mode pool), each member carries its state as wf.pools reports it, status (ready, reserve when it is held at its reserve, limited, disabled when it cannot run, or unknown when T3 did not answer), why, the limit's reset time, running threads, its picks in the window, share (its fraction of every pick in the window, former members' included, or of the configured weight when the window has none, as shareBasis says), weightShare, reasons (its picks by kind: weighted, priority, cheapest, last-resort or moved) and skips (the window's picks that passed it over, by kind: limited, reserve, disabled, constrained, missing-model, missing-effort or other). reasons counts every pick in the window by kind, series splits the window into 24 buckets of pick counts per member, recent lists the latest 20 picks, and former counts picks of instances no longer in the pool. Without a pool (mode single), members holds the one instance, model and effort launches use, with share 1 and no pick history. running lists the active threads (preparing, queued, starting or running, counted as wf.pools counts them) of every provider instance, or is null with runningError when T3 did not answer. window is "all" or a count of m, h or d (default 24h); since is null for all. The picks history keeps the latest 2000 picks. tokens totals the input and output tokens of the runs that ended in the window, with byInstance and byProvider (by driver), each member carries its own tokens, and tokenSeries splits them into the same buckets as series; all are null while no token source reports counts, which is always the case against T3 today. */
wf.usageStats(input?: { window?: string }): Promise<{ window: string; since: string | null; sinceLocal: string | null; at: string; mode: "pool" | "single"; source: string; pool: string | null; strategy: "weighted" | "priority" | "cheapest" | null; error: string | null; warnings: string[]; picks: number; shareBasis: "picks" | "weight" | "single"; members: { instanceId: string | null; driver: string | null; model: string | null; effort: string | null; weight?: number; reserve?: number; cost?: number; state: string; status: "ready" | "reserve" | "limited" | "disabled" | "unknown"; reason: string | null; limitedUntil: string | null; limitedUntilLocal: string | null; limitReason: string | null; usageLeft?: number | null; running: number | null; picks: number; lastPick?: string | null; lastPickLocal?: string | null; share: number | null; weightShare?: number | null; reasons?: Record<string, number>; skips?: Record<string, number>; tokens: { input: number; output: number; runs: number } | null }[]; reasons: Record<string, number>; series: { start: string; bucketMinutes: number; buckets: { start: string; counts: Record<string, number> }[] } | null; tokens: { input: number; output: number; runs: number; byInstance: Record<string, { input: number; output: number; runs: number }>; byProvider: Record<string, { input: number; output: number; runs: number }> } | null; tokenSeries: { start: string; bucketMinutes: number; buckets: { start: string; input: Record<string, number>; output: Record<string, number> }[] } | null; recent: { at: string; atLocal: string; instanceId: string; kind: string; reason: string; thread: string | null }[]; former: { instanceId: string; picks: number }[]; running: { instanceId: string; threads: number }[] | null; runningError: string | null }>;
/** The service's own state, as the board header shows it: version, T3 connection, watcher, the release check, and skills, which compares the installed T3 workflow skills and recorded setup steps against this release. skills.current is false when the skills are behind, edited, missing, installed by npx skills, or an automatic setup step is missing; present is false when no skills are installed at all; fixes lists the commands to run, in order. Reads the skills fresh on each call. */
wf.status(): Promise<{ version: string; t3: { connected: boolean; lastError: string | null }; tokenExpiresAt: string | null; watcher: { lastPass: string | null; lastPassAt: string | null; alive: boolean }; openLinks: "desktop" | "tab"; update: { current: string; latest: string; available: boolean; notes: string; command: string } | null; skills: { release: string; installed: string | null; present: boolean; current: boolean; fix: string | null; foreign: { tool: string; lock: string | null; commit: string | null; skills: string[]; matchesRelease: boolean; differingFiles: number } | null; missingSteps: { id: string; kind: "auto" | "interview"; since: string; slot?: string; fix: string }[]; configState: "absent" | "legacy" | "recorded" | "problem" | null; problem?: string; fixes: string[]; error?: string } }>;
/** One T3 workflow slot, looked up by the step that uses it: review before opening a PR, passes when publishing, delivery for delivery stages and gates, models when launching. The service resolves it for your thread's T3 instance and project, the way your own session would see it: defaults, the user config, the repo's AGENTS.md Agent workflow block, the repo's .t3-workflow.json, and the skills your agent's config folder has installed and enabled. Each skill carries how to run it (the Skill tool, or the inline SKILL.md to read) or why it is skipped. For delivery, files filters steps with paths globs against changed repo-relative file paths and reports unmatched steps in skipped. line is the one-line summary; warnings names config problems and a connection that reported no config folder. repo overrides the project's workspace root, for example with your worktree. */
wf.slot(name: "review" | "passes" | "delivery" | "models" | "credentials", input?: { repo?: string; instance?: string; skills?: string[]; files?: string[] }): Promise<{ slot: string; source?: string; line: string; warnings: string[]; skill?: { ref: string; status: "ok" | "ambiguous" | "missing"; name?: string; path?: string | null; where?: string; invoke?: "skill" | "inline"; others?: string[]; how?: string } | null; note?: string; skills?: ({ ref: string; status: "ok" | "ambiguous" | "missing"; name?: string; path?: string | null; where?: string; invoke?: "skill" | "inline"; others?: string[]; how?: string } | null)[]; renewals?: { match: string; skill: { ref: string; status: "ok" | "ambiguous" | "missing"; name?: string; path?: string | null; where?: string; invoke?: "skill" | "inline"; others?: string[]; how?: string } | null }[]; steps?: { id: string; kind: "builtin" | "skill" | "manual"; skill?: { ref: string; status: "ok" | "ambiguous" | "missing"; name?: string; path?: string | null; where?: string; invoke?: "skill" | "inline"; others?: string[]; how?: string } | null; prompt?: string; gate: "always" | "chain" | "never"; scope: "pr" | "ticket" | "post-handoff"; paths?: string[]; watch?: boolean }[]; closeAfter?: "pr" | "ticket" | "all"; skipped?: { id: string; reason: string; paths?: string[] }[]; mode?: string; problem?: string; ticket?: { slot: string; source: string; spec: { model?: string; effort?: string; provider?: string; pool?: string } | null; note?: string | null; problem?: string; modelSelection: { instanceId: string; model: string; options?: { id: string; value: string }[] } | { pool: string; pick: string } | null }; worker?: { slot: string; source: string; spec: { model?: string; effort?: string; provider?: string; pool?: string } | null; note?: string | null; problem?: string; modelSelection: { instanceId: string; model: string; options?: { id: string; value: string }[] } | { pool: string; pick: string } | null } }>;
/** A command failed: pass its output, and the service matches it against the credentials slot's patterns. Returns the renewal skill to run, then retry the command once, or null when no pattern matches. skipped is true when the matching renewal skill no longer resolves; carry on as if none were configured. */
wf.renewal(input: { output: string; repo?: string; instance?: string }): Promise<{ match: string; skill: { ref: string; status: "ok" | "ambiguous" | "missing"; name?: string; path?: string | null; where?: string; invoke?: "skill" | "inline"; others?: string[]; how?: string } | null; how: string; skipped: boolean; reason?: string; warnings: string[] } | null>;
/** Every T3 workflow slot at once, as setup and the board need them, in the shape `t3cm slots --json` prints. A role looks up the one slot its step needs with wf.slot instead. */
wf.slots(input?: { repo?: string; instance?: string; skills?: string[] }): Promise<{ repo: string; config: string | null; repoConfig?: string | null; review: object; passes: object; credentials: object; delivery: object; models: { ticket: object; worker: object }; problems: string[]; warnings: string[]; context: { instance: string | null; driver: string | null; claudeDir: string; codexHome: string; folderFrom: "reported" | "recorded" | "default"; config: string } }>;
/** The project flow's ready queue and dependency graph, read live from GitHub across the covered repositories (explicit flow.repos, or discovered from active T3 projects' GitHub remotes with optional flow.includeRepos and flow.excludeRepos overrides). When flow launch settings (flow.maxTickets) are configured, queue lists each covered repo's open issues matching the optional flow.optIn filter (label and/or milestone) that have no open blocker (native GitHub blocked-by links, parsed issue-body dependencies from ## Flow blocks and prose directives such as Depends on, Blocked by and After, or hard prStack dependencies from stacked open PRs, local worktree branch ancestry, or active t3-ticket part: n/N chains), have no unresolved blocker reference, are not labelled "blocked" or "blocked: external", have no open board ticket, are not sub-issues of an issue with an open board ticket, and (when flow.serializeFileConflicts is true) do not overlap files with an actively running ticket, in launch order: priority label (priority: high, medium, low, then none), then milestone due date (none last), then oldest. blocked lists the matching issues held by an open blocker, a prStack edge (in prStack), a serialized file conflict against a running ticket (in fileConflicts), an unresolved blocker reference, a plain "blocked" label, or "blocked: external", each with its open blockers. skipped lists the ready issues someone skipped on a launch card; each stays out of queue until its labels or blockers change. running is the open board tickets for issues in covered repos, leaving out a ticket whose issue is closed; free is maxTickets minus running, and never more than maxTicketsTotal (the global cap, default 8, which flow.maxTickets may not exceed) minus every open board ticket, whatever launched it. Without flow.maxTickets, enabled is false and the queue lists are empty (wf.flow() with graph omitted reads nothing from GitHub). With graph: true it also returns graph, the dependency graph the board reads from GET /api/flow even with no flow block: a node for each open issue across the covered repos and each active board ticket (tracked: true), plus a node for each issue they point at (a closed blocker, an uncovered-repo blocker or parent), an edge for each blocked-by, parent, prStack (source "git", with branch/baseBranch/pr/basePr/part metadata), fileConflict (source "code", carrying overlapping repo-relative files from open PRs, local worktrees, Touches:, and verified issue-body paths) and advisory codeDep (source "code", carrying static module/workspace/import edges in modules and referenced symbol definitions in symbols from the local checkout; strictly advisory, never holds readiness or launches, never raises cycle warnings, and skipped on queue-only reads) link, and warnings for dependency or parent cycles, unresolved dependency references, and plain "blocked" labels with no open blocker linked. Each node lists blockedBy, unlocks (the reverse of blockedBy), parent and subIssues by node id ("owner/name#N"), its flowList, ready (in queue), external (labelled "blocked: external", or every open hard blocker is outside the covered repos), its track and trackBy ("label" from track:<name>, *-track, area:<name> or ## Flow Track:; else "epic" from its parent epic; else "milestone"; else "component" when its connected component has at least 2 nodes; else "independent" in a shared per-repo lane), its board ticket, its warnings, and (when flow.optIn is set) optIn: on (carries flow.optIn.label), inFlow (matches the whole filter) and locked (why the board cannot toggle it). Read-only; throws when gh cannot read a covered repo. */
wf.flow(input?: { graph?: boolean }): Promise<{ enabled: boolean; launch: "ask" | "auto" | "off" | null; maxTickets: number; maxTicketsTotal: number; free: number; running: { label: string; repo: string; number: number; url: string; thread: string | null; link: string | null }[]; queue: { repo: string; number: number; label: string; url: string; title: string; priority: "high" | "medium" | "low" | null; milestone: { title: string; dueOn: string | null } | null; createdAt: string; parent: { repo: string; number: number; label: string; url: string; title: string | null } | null; unblockedBy: { repo: string; number: number; label: string; url: string; title: string | null }[] }[]; blocked: ({ repo: string; number: number; label: string; url: string; title: string; priority: "high" | "medium" | "low" | null; milestone: { title: string; dueOn: string | null } | null; createdAt: string; parent: { repo: string; number: number; label: string; url: string; title: string | null } | null; unblockedBy: { repo: string; number: number; label: string; url: string; title: string | null }[] } & { blockers: { repo: string; number: number; label: string; url: string; title: string | null }[]; moreBlockers: boolean; external: boolean; blockedLabel?: boolean; unresolved?: string[]; prStack?: { repo: string; number: number; label: string; url: string; branch?: string; baseBranch?: string; pr?: number; basePr?: number; part?: string }[]; fileConflicts?: { repo: string; number: number; label: string; url: string; files: string[] }[] })[]; skipped: { repo: string; number: number; label: string; url: string; title: string; priority: "high" | "medium" | "low" | null; milestone: { title: string; dueOn: string | null } | null; createdAt: string; parent: { repo: string; number: number; label: string; url: string; title: string | null } | null; unblockedBy: { repo: string; number: number; label: string; url: string; title: string | null }[] }[]; graph?: { nodes: { id: string; repo: string; number: number; label: string; url: string; title: string | null; state: "open" | "closed" | null; tracked: boolean; labels: string[]; priority: "high" | "medium" | "low" | null; milestone: { title: string; dueOn: string | null } | null; track: string; trackBy: "label" | "epic" | "milestone" | "component" | "independent"; parent: string | null; subIssues: string[]; moreSubIssues: boolean; blockedBy: string[]; moreBlockers: boolean; unlocks: string[]; flowList: "queue" | "blocked" | "skipped" | null; ready: boolean; external: boolean; ticket: { thread: string | null; link: string | null; status: string } | null; warnings: { kind: "cycle" | "unresolved" | "blockedLabel"; message: string; raw?: string }[]; optIn?: { on: boolean; inFlow: boolean; locked?: string } }[]; edges: { from: string; to: string; kind: "blockedBy" | "parent" | "prStack" | "fileConflict" | "codeDep"; source: "github" | "body" | "git" | "code"; branch?: string; baseBranch?: string; pr?: number; basePr?: number; part?: string; files?: string[]; modules?: string[]; symbols?: string[] }[]; warnings: { kind: "cycle" | "unresolved" | "blockedLabel"; message: string; nodes: string[]; raw?: string }[] } }>;
/** Run one flow pick by hand, under the rules the board applies when a slot opens. With launch "ask" it raises a board card "Launch <label> next? (priority: X, unblocked by #N)" with launch and skip buttons for the first ready issue that has no card yet; with "auto" it launches that issue through wf.launchTicket and posts a feed event; with "off", or no flow.maxTickets, it reads nothing and launches nothing. An open launch card holds its slot, so nothing is picked when every free slot already has a card; free also stops at the maxTicketsTotal cap on open board tickets, so the queue holds at the cap and picks again when a ticket closes; reason says why picked is empty. offered lists the launch cards still open, and retired the cards this pick closed because their issue is no longer ready or no slot is free. An auto launch that fails leaves its error card and skips the issue until its labels or blockers change, except a launch refused at the cap, which stays queued. Throws when gh cannot read a covered repo. */
wf.flow.next(): Promise<{ launch: "ask" | "auto" | "off" | null; free: number; picked: { label: string; url: string; title: string; priority: "high" | "medium" | "low" | null; why: string; card?: string; launched?: object; error?: string }[]; offered: { label: string; card: string }[]; retired?: string[]; reason?: string }>;
/** Merge a GitHub pull request through the service's gh login, or a GitLab merge request on a host listed under forges through its glab login, only at the approved head commit (refused when the head differs). On a repo with a merge queue or a GitLab project with merge trains: a mergeable PR is enqueued or joins the train (never auto-merge); one not yet mergeable is recorded as waiting and returns waiting. Without one: merged directly with method, or the repo's default method (on GitLab, the merge request's squash setting; squash is the only method GitLab takes per merge). A GitLab answer that it cannot merge yet (HTTP 405), or an auto-merge it set that t3cm takes back, returns waiting with reason. Throws when gh or glab cannot reach the forge. */
wf.merge(input: { repo: string; pr?: number; head: string; method?: "merge" | "squash" | "rebase" }): Promise<{ repo: string; pr: number; head: string } & ({ status: "queued"; position: number | null; approval: string } | { status: "merged"; commit: string | null; method?: "merge" | "squash" | "rebase" } | { status: "waiting"; mergeState: string; approval: string; reason?: string } | { status: "refused"; reason: string })>;
/** A worker reports its PR. opened (with publishing, the Publishing line, and checks "none" in a repo with no CI) checks the Publishing line and the description on GitHub, or GitLab for a merge request on a host listed under forges, against the format the ticket's wf.openChild stored, and returns status rewrite with the rewrite request when one falls short. updated records a new head and drops any merge card for the old one. ready checks the PR on its forge (open, not a draft, at head, every check or pipeline finished with none failed), resolves the delivery slot for its changed files and opens the merge card on the board with the answers the slot calls for. A pending check returns waiting, and PR reconcile opens the card once the checks finish; a failing one returns failing. None of these wakes the ticket. Each lands in its digest as a handled-for-you line. Where t3cm cannot decide (no board ticket, relay off, a follow-up PR, a targeted fix PR, no builtin merge stage, or a PR it cannot read), the event goes to the ticket as before and returns status ticket with why. */
wf.pr(input: { event: "opened" | "updated" | "ready"; repo: string; pr?: number; head: string; publishing?: string; checks?: "pending" | "none"; body?: string }): Promise<{ status: "open" | "rewrite" | "recorded" | "gated" | "waiting" | "failing" | "refused" | "ticket"; handle?: string; message?: string; missing?: string[]; dropped?: string[]; card?: string; options?: string[]; head?: string; pending?: string; checks?: string; reason?: string; why?: string; detail?: string }>;
/** The board's open decision cards, oldest first: gates, blockers, reports and escalations from ticket threads, with their reply options (the sender's options, else those parsed from their text) and their ticket's repo and project. all: include resolved cards, each with resolved (local time) and resolution. context (a saved context's id or name) or projects (project ids, or old repo or title values) keeps only the cards of those projects, matched as the board page matches them; an empty list keeps every card. */
wf.cards(input?: { all?: boolean; context?: string; projects?: string[] }): Promise<{ id: string; kind: string; label: string | null; ticket: string | null; link: string | null; text: string; handle: string | null; options: string[]; at: string; atLocal: string; resolved?: string; resolution?: string | null; token: string; approval?: string; repo: string | null; project: { id: string; title: string | null } | null }[]>;
/** Answer a board card for the user: sends the ticket a [t3cm reply] 'The user says "<text>" about <id>: <card text>' and resolves the card. Same as a button on the board page. */
wf.answer(id: string, text: string): Promise<{ handle: string; delivery: "noted" | "sent" | "queued" | "board"; detail?: string; card?: string; options?: string[]; warning?: string; closed?: boolean }>;
/** The board's activity feed: the latest notes and events from ticket and worker threads, newest first, each with its ticket's repo and project. context (a saved context's id or name) or projects (project ids, or old repo or title values) keeps only the rows of those projects, matched as the board page matches them: up to limit matching rows from the latest 200. */
wf.feed(input?: { limit?: number; context?: string; projects?: string[] }): Promise<{ handle: string; at: string; iso: string; label: string; kind: string; head: string; ticket: string | null; repo: string | null; project: { id: string; title: string | null } | null }[]>;
/** Add an item to your waiting list (decisions the user owes). Ids cycle a1..a9, b1..d9, skipping open ones. */
wf.waiting.add(input: { text: string; from?: string; link?: string }): Promise<{ id: string }>;
/** Resolve an open waiting-list item. */
wf.waiting.resolve(id: string, note?: string): Promise<{ id: string; text: string; resolved: true }>;
/** Your open waiting-list items, oldest first. */
wf.waiting.list(): Promise<{ id: string; text: string; from: string | null; link: string | null; at: string }[]>;