> _**SDK skill · `agent` namespace** · ~42,343 tokens_

# `agent` — run AI coding agents in a container: delegate work, subagents, memory, branches

## Purpose

This is the **programmatic control plane for running AI coding agents inside a container** — 47 services / 239 methods that let you delegate a task to a remote agent, drive it across turns, and read back its messages, diffs, and git branches, all over the API. It also exposes the agent's persistent **memory** (blocks + journal), its **capabilities** (model providers, MCP tool servers, skills, tools), a multi-agent **orchestration** layer ("God Mode": an orchestrator that plans, an executor that spawns worker sub-sessions, verifiers that gate each with a PASS/FAIL, a phase reviewer), and the **subagent roster** (configured CLI agents, RSI reviewers, verifiers).

**Workspaces is the GUI, not the namespace.** Hoody ships a full browser GUI — *Workspaces* — that is one optional human-facing client of this exact surface; everything it does (run sessions, branch/PR, wire MCP, edit memory, orchestrate) is reachable here via the SDK or raw HTTP, and vice-versa (the CLI can't authenticate to this kit — see the CLI caveat in Quirks). Hand a person the URL `https://{P}-{C}-workspaces-1.{N}.containers.hoody.icu` when they want a screen; reach for this namespace when you want automation. The kit slug is `workspaces` (`agent` ↔ `workspaces` rename; instance index `1`, i.e. the URL segment `workspaces-1`); resolve the URL with `getKitUrl('agent', container)`. Most endpoints live under `/api/v1/workspaces/*`; the one-shot `prompt.*` delegate endpoints (and a couple of cross-session listers) live under `/api/v1/agent/*`.

## When to use

- **Delegate a coding/automation task to an agent in a remote container** and collect its result — quickest path is `client.agent.prompt.agentPrompt` (no workspace bookkeeping); for multi-turn work use `sessions.create` + `sessions.prompt`/`sessions.promptAsync` then read `sessions.getDiff`.
- **Run / query subagents** — orchestrate multiple agents and phases ("God Mode") via `orchestration.*`, and inspect the subagent roster with `meta.listAgents`, `cliAgents.configListCliAgents`, `reviewers.configListReviewers`, `verifiers.configListVerifiers`.
- Give the agent persistent context it consults across runs — memory blocks + searchable journal (`memory.*`).
- Configure what the agent can do — providers (`providers.list`), MCP tool servers (`mcp.getStatus`), skills (`skills.update`), tools (`tools.list`), and `config.update`.
- Run an agent against a git worktree, then inspect its diff, push a branch, open a PR (`branches.*`).
- Answer an agent's mid-run clarification questions to unblock it (`questions.*`), or run an RSI multi-reviewer critique of a finished session (`rsi.*`).
- Hand a human the **Workspaces GUI URL** when they want to drive any of the above through a browser.

## When NOT to use

- One-off shell command or script with no agent loop/session → see `exec` (or `terminal` for an interactive shell).
- Direct container filesystem reads/writes (the worktree itself) → see `files`.
- Projects, containers, container **claims/authorization**, auth, billing, server rentals → see `api`.
- VS Code in a browser tab (editor GUI, not an agent) → see `code`.
- Generic key/value or relational storage → see `sqlite`.
- User-authored knowledge notebooks (distinct from the agent's memory journal) → see `notes`.
- Scheduling recurring jobs → see `cron` (for a recurring agent prompt, schedule a call to `sessions.prompt`).

## Prerequisites

- Container with `hoody-workspaces` kit installed.
- **A container claim on every kit call — this is the #1 thing that breaks first calls.** Mint one with `client.api.containers.authorize(C)` (`POST /api/v1/containers/{C}/authorize`) and send BOTH `X-Hoody-Container-Claim: JSON.stringify(data.container_claim)` and `X-Hoody-Token: <your API token>` on every request; a bare `Authorization: Bearer` returns `401 CLAIM_REQUIRED`. The claim is signed and **reusable until `expires_in` (~6h)** — mint once, reuse, re-authorize when it lapses. The SDK wires both headers for you via `withContainer(containerOrId, { kitAuth: { type: 'containerClaim', claim, token } })` (a 2-arg call; `kitAuth` is the second arg, and it does NOT auto-mint — pass the claim in). Raw `curl`/HTTP must attach the two headers by hand. See § Capability URL for the failure taxonomy.
- Workspace created via `workspace.workspacesCreate` and bound via `workspace.bind` before per-workspace calls (the worktree dir must already exist on disk). `workspaceID = "global"` is rejected on every route (`400`, code `global-workspace-rejected`) — it is the project-storage sentinel, not a routable workspace ID. The supported alias is `"home"`, which resolves to the auto-created default workspace; otherwise send the real 24-char hex ID. The top-level `prompt.agentPrompt` needs no pre-created workspace.
- For session prompts: a provider configured via `config.update`. For `createPR`/`pushBranch`: a configured git remote and resolvable forge token.

## Capability URL

The kit slug is `workspaces` (instance index `1`): `https://{P}-{C}-workspaces-1.{N}.containers.hoody.icu` — get `P`/`C`/`N` from `containers.get`. The **root of that URL is the Workspaces GUI** (an SPA; the page itself loads with no token — hand it to a human and they log in with their Hoody account, which mints the claim for them); the API lives mostly under `/api/v1/workspaces/*` (the one-shot `prompt.*` endpoints under `/api/v1/agent/*`) and needs the claim headers above. You can also run `hoody agent open --url` to print that same browser URL. Claim failures from the kit auth gate: `401 CLAIM_REQUIRED` (no claim), `401 TOKEN_REQUIRED` (claim but no token), `403 CLAIM_MALFORMED` (unparseable), `403 CLAIM_INVALID` (bad signature / expired / wrong container), `403 BINDING_MISMATCH` (token owner ≠ claim subject), `401 TOKEN_INVALID`. → See `SKILL-SDK.md § Proxy URLs` for the slug table and capability-token methodology.

**Reaching a service you host on a container port** (any port, any namespace):

- `https://{projectId}-{containerId}-http-<port>.{node}.containers.hoody.icu` — proxy speaks HTTP to `localhost:<port>`.
- `https://{projectId}-{containerId}-https-<port>.{node}.containers.hoody.icu` — proxy speaks HTTPS to `localhost:<port>` (target needs TLS).

Edge is always `https://`. No alias, firewall edit, or proxy registration needed; capability-token gates still apply.

## Common workflows

### 1. Delegate a task to a remote agent (bootstrap + session)

Single-shot, no workspace bookkeeping: `client.agent.prompt.agentPrompt` (or `prompt.agentPromptSync` to block for the final reply). Full multi-turn control:

1. `client.agent.workspace.workspacesCreate`
2. `client.agent.workspace.bind`
3. `client.agent.config.update`
4. `client.agent.sessions.create`
5. `client.agent.sessions.prompt` (or `sessions.promptAsync` / `sessions.abort`)
6. `client.agent.sessions.export` / `client.agent.sessions.getDiff` (or `sessions.listMessages` to drain output)

### 2. Branch → push → open PR

1. `client.agent.branches.createBranch`
2. `client.agent.sessions.create` + `client.agent.sessions.prompt`
3. `client.agent.branches.getBranchStatus` / `branches.getBranchDiff`
4. `client.agent.branches.pushBranch`
5. `client.agent.branches.createPR` + `branches.getPRStatus`
6. `client.agent.branches.mergeBranch` (dry-run first) + `branches.deleteBranch`

### 3. Add MCP server and call its tools

1. `client.agent.mcp.addServer`
2. `client.agent.mcp.startOAuth` → `mcp.completeOAuth` (OAuth servers only; `mcp.removeOAuth` to revoke)
3. `client.agent.mcp.connect` + `mcp.getStatus`
4. `client.agent.experimental.listMcpResources` / `experimental.listToolSchemas`
5. `client.agent.sessions.prompt` + `mcp.disconnect`

### 4. Memory blocks and journal search

1. `client.agent.memory.setBlock` (specify `scope: "workspace" | "global"`)
2. `client.agent.memory.replaceBlock`
3. `client.agent.memory.createJournalEntry`
4. `client.agent.memory.searchJournalEntries` / `memory.listJournalEntries`

### 5. RSI review of a finished session

1. `client.agent.rsi.rsiReviewStart`
2. `client.agent.rsi.rsiStream`

### 6. Orchestrate / query subagents ("God Mode")

You don't spawn a worker directly — you enqueue work and the executor spawns a worker *session* per item; verifiers gate each, a phase reviewer summarizes. Inspect the roster first with `client.agent.meta.listAgents` / `cliAgents.configListCliAgents` / `reviewers.configListReviewers` / `verifiers.configListVerifiers`.

1. `client.agent.orchestration.todoAppend` — enqueue a task entry (the delegation primitive); group with `orchestration.phasesCreate`.
2. `client.agent.orchestration.executorStart` — turn on the dispatch loop (spawns worker sub-sessions).
3. Drive via the planner instead: `orchestration.orchestratorCreateSession` → `orchestration.orchestratorSendPrompt`.
4. Query live subagents: `orchestration.executorGetWorkers` (→ `[{sessionID, entryID, phase, status}]`); drill into any worker as a normal session with `sessions.get` / `sessions.listMessages`.
5. Observe: `orchestration.streamEvents` (SSE event bus).

### 7. Answer the agent's questions (unblock a paused session)

When an agent hits ambiguity it calls its `question` tool, which BLOCKS the session until you respond.

1. `client.agent.questions.list` — pending questions across sessions (or watch `meta.subscribeEvents` for `question.asked`).
2. `client.agent.questions.consult` — optional: get a second model's recommendation (read-only; does NOT resolve the question).
3. `client.agent.questions.reply` (body field `answers`: `string[][]`) or `client.agent.questions.reject` — resumes the agent.

## Quirks & gotchas

- `workspaceID` is 24-char hex (validated via `WORKSPACE_ID_RE`); only container-bound workspaces appear in `workspacesList`.
- `workspaceID = "global"` is rejected everywhere with `400 { code: "global-workspace-rejected" }`; use the `"home"` alias to target the default workspace (resolved via `ensureDefaultWorkspace()`; `503 no-default-workspace` if none exists).
- `sessions.prompt` returns 409 `session_busy` envelope `{ error, code }` if cancelled mid-init.
- `sessions.promptAsync` returns 204 immediately (status set at `:1353`), runs detached; provider errors only logged, no completion signal beyond event subscription.
- `memory.deleteBlock` requires explicit `?scope=` query param, no default.
- Core memory block labels reject `readOnly: true`.
- `branches.createPR` is rate-limited per-project (429); requires configured remote, picks first remote if no `origin` (fallback at `:1270`).
- RSI gated by `config.rsi.enabled`; disabled returns 403 `rsi_disabled`. Inline reviewers with ad-hoc `name` require `model`.
- RSI runs idempotent on `Idempotency-Key`: retry within TTL replays same `jobID`. SSE emits snapshot first.
- Kit slug is `workspaces`; API reject-lists `workspaces` for proxy hooks/permissions.
- The container claim is **reusable until `expires_in` (~6h)** — mint once via `containers.authorize`, reuse, re-authorize when it lapses; you do NOT need a fresh claim per call.
- `withContainer(containerOrId, options)` is a **2-arg** call — `kitAuth` goes in the second arg — and it does NOT mint the claim for you; pass the already-minted claim in `options.kitAuth`.
- **The generic CLI cannot authenticate to this kit.** `kitAuthType` only supports `jwt|password|token` — there is no `containerClaim` branch — so `hoody agent …` / `hoody workspaces …` kit subcommands do not attach the claim and return `401 CLAIM_REQUIRED`. Only *interactive* `hoody shell` auto-mints a claim (the one-shot `hoody shell <id> -- cmd` form does not). For programmatic agent-kit access use the SDK or raw HTTP; the CLI blocks in §Examples show command shape only.
- SDK-only quirk: several generated SDK methods take a non-workspace ID as their FIRST positional argument, breaking the workspace-first norm — `mcp.connect(name, workspaceID)` / `mcp.disconnect`, `providers.authorizeOAuth(providerID, workspaceID, …)`, `permissions.reply(requestID, workspaceID, …)`, and all `branches` `/{id}/…` methods (`getBranchDiff(branchId, workspaceID, …)`). The HTTP paths themselves stay workspace-first, and the CLI uses order-independent named flags.
- Orchestration: workers are spawned ONLY by the executor (no direct "spawn worker" call — you enqueue with `todoAppend`); the verifier's `verdict` (PASS/FAIL) is authoritative. Note the MITM-overlay services that sit alongside it in this namespace (`dryRun.*` → `/mitm/diagnostics/dry-run`, `rebase.*` → `/mitm/overlay/rebase`) are NOT part of the multi-agent orchestration flow despite the workspace-scoped naming.

## Common errors

- `409 { error: "Prompt aborted before completion", code: "session_busy" }`.
- `409 { error: "Command aborted before completion" }`.
- `404 Workspace entry {workspaceID} not found` — create workspace before `bind`/`unbind`.
- `400 { error: "Invalid workspace ID: <id>", code: "invalid-workspace-id" }` — must match 24-char lowercase hex; the alias `"global"` is NOT accepted on workspace routes (returns code `global-workspace-rejected`).
- `403 { error: "rsi_disabled", message: "RSI is disabled in configuration (config.rsi.enabled = false)." }`.
- `404 { error: "unknown_reviewer" }` — supply `model` for ad-hoc reviewer name.
- `429 Rate limit exceeded` from `createPR` — per-project limiter.
- `ValidationError: No git remote configured` — bind a remote before forge ops.

## Related namespaces

- `api` — projects, containers, auth, billing, server rentals.
- `exec` — one-off scripts without a session.
- `files` — direct container filesystem access.
- `terminal` — interactive shell beyond `sessions.shell`.
- `notes` — user-authored notes (separate from agent memory journal).
- `cron` — schedule recurring `sessions.prompt` triggers.

## Examples

Every step in every example was live-tested against a real `workspaces-1` kit (kit slug is `workspaces`, NOT `agent`). The endpoints used below live under `/api/v1/workspaces/...` (the one-shot `prompt.*` delegate endpoints, not exercised here, are under `/api/v1/agent/...`). Each step has a copy-pasteable code block in the mode you're reading. Set `P`, `C`, `N` (project id, container id, server name) from `containers.get` first, and mint a container claim once (`POST /api/v1/containers/{id}/authorize` returns it; it is reusable until `expires_in` (~6h), so reuse it across the calls below). SDK's `withContainer(container, { kitAuth: { type:'containerClaim', claim, token } })` wires the headers for you (2-arg call; it does not mint — pass the claim in).

⚠ Headers — when calling kit URLs directly (curl/HTTP), you MUST send BOTH `X-Hoody-Container-Claim: <json-stringified claim>` AND `X-Hoody-Token: <api token>` on every request. `Authorization: Bearer …` alone returns `401 { code: "CLAIM_REQUIRED" }`. Live-verified.

⚠ CLI mode caveat — the generic `hoody agent …` / `hoody workspaces …` commands do **not** attach the container claim (the CLI's kit-auth supports only `jwt|password|token`, not `containerClaim`), so they return `401 CLAIM_REQUIRED` against this kit. The `hoody …` blocks below are shown for command/argument shape; for working programmatic access use the SDK or raw HTTP (or interactive `hoody shell`, the only CLI path that auto-mints a claim). Local SDK/HTTP paths are unaffected; to just print the browser URL, run `hoody agent open --url`.

### 1. Bootstrap a workspace and run a session

**Goal:** create a fresh `examples-<random>` workspace, bind it to a container, run one async session prompt, then read messages back. Worktree must exist on disk inside the container BEFORE `workspacesCreate` (live-verified — `400 worktree does not exist` otherwise).

**Step 1 — make the worktree directory** via the `files` kit, then create the workspace.

```typescript
const token = process.env.HOODY_TOKEN!; // your API token
const az = await client.api.containers.authorize(C);
const claim = az.data!.container_claim;
const cc = await client.withContainer(
  { id: C, project_id: P, server: N },
  { kitAuth: { type: 'containerClaim', claim: JSON.stringify(claim), token } }
);
const wname = `examples-${Math.random().toString(36).slice(2, 8)}`;
const worktree = `/root/${wname}`;
await cc.files.directories.create(worktree.replace(/^\//, ''));
const cr = await cc.agent.workspace.workspacesCreate({ worktree, name: wname, color: '#22c55e', visible: true });
const W = cr.data!.id;
await cc.agent.workspace.bind(W, { containerId: C, projectId: P, serverNode: N });
```
**Step 2 — create a session and fire an async prompt** (`promptAsync` returns 204 immediately; provider runs detached).

```typescript
const sr = await cc.agent.sessions.create(W, { title: 'bootstrap demo' });
const SID = sr.data!.id;
await cc.agent.sessions.promptAsync(W, SID, {
  parts: [{ type: 'text', text: 'List the files in the worktree' }],
  model: { providerID: 'hoody', modelID: 'hoody-free' },
});
```
**Step 3 — poll for messages, read the diff, abort if needed.** `promptAsync` provides no completion signal — drain via `listMessages` or subscribe to `meta.subscribeEvents` (SSE).

```typescript
const ms = await cc.agent.sessions.listMessages(W, SID, { limit: 20 });
const diff = await cc.agent.sessions.getDiff(W, SID);
await cc.agent.sessions.abort(W, SID);
```
### 2. Set memory blocks + journal entries (workspace vs global scope)

**Goal:** seed a free-form note for the agent to consult, replace part of it, write a journal entry, and search the journal. Reuse `$W` from example 1.

⚠ **Workspace-scoped blocks require a non-`global` projectID** — even on a `bind`-ed workspace the kit may report `pid is "global"` and reject `scope:"workspace"` with `400 Cannot create workspace-scoped block "<label>": no project detected (pid is "global"). Use global scope instead.` Live-verified. Default to `scope:"global"` unless your container deployment sets a real project context.

**Step 1 — set + read a block.** `value` is the text the agent sees; `description` is metadata.

```typescript
await cc.agent.memory.setBlock(W, 'notes', { value: 'hello world', scope: 'global', description: 'demo note' });
const b = await cc.agent.memory.getBlock(W, 'notes');
```
**Step 2 — replace** uses `old_str / new_str` (NOT `search/replace`; live-verified — wrong field names → `400`):

```typescript
await cc.agent.memory.replaceBlock(W, 'notes', { scope: 'global', old_str: 'world', new_str: 'examples' });
```
**Step 3 — journal create + search.** Body field names are `title` + `body` (NOT `content`). Live-verified — `{ content }` returns `400`.

```typescript
await cc.agent.memory.createJournalEntry(W, { title: 'bootstrap done', body: 'workspace ready', tags: ['demo'] });
const hits = await cc.agent.memory.searchJournalEntries(W, { text: 'bootstrap', limit: 5 });
```
**Step 4 — delete the block** (DELETE requires `?scope=global|workspace` query param, no default — live-verified. The generated SDK and CLI do NOT expose a scope flag, so drop to raw `fetch()` whenever you need scoped deletion):

```typescript
// SDK signature is deleteBlock(workspaceID, label) — 2 args; no scope option.
// The HTTP route requires ?scope=global|workspace, so drop to raw fetch:
await fetch(`${KIT}/api/v1/workspaces/${W}/memory/blocks/notes?scope=global`, {
  method: 'DELETE', headers: kitHeaders,
});
```
### 3. Configure the provider that drives sessions

**Goal:** read the current per-workspace agent config (provider, default model, permissions), see which models are available from the catalog, then point `model` at a different one. Container ships with `hoody/hoody-free` by default.

**Step 1 — read the active config + list available providers.**

```typescript
const cfg = await cc.agent.config.get(W);
const provs = await cc.agent.providers.list(W);
console.log(provs.data!.all.map((p: any) => p.id));
```
**Step 2 — switch model** via `config.update` (PATCH; partial — only fields you send change):

```typescript
await cc.agent.config.update(W, { model: 'hoody/hoody-free' });
```
**Step 3 — list auth methods for a provider you'd add (e.g. OAuth chain for OpenAI/Anthropic).** `authorizeOAuth` returns a URL the user opens; `callbackOAuth` finalises with the redirect's `?code=`.

```typescript
const meth = await cc.agent.providers.getAuthMethods(W);
const start = await cc.agent.providers.authorizeOAuth('openai', W, { method: 0 });
```
### 4. Register an MCP tool server

**Goal:** add a local-stdio MCP server (binary on PATH) and a remote one, list status, then remove. ⚠ Body shape is `{ name, config: { type: 'local' | 'remote', ... } }` — flat `{ name, type, command }` returns `400`. Live-verified.

**Step 1 — add a local stdio server.**

```typescript
await cc.agent.mcp.addServer(W, {
  name: 'demo-local',
  config: { type: 'local', command: ['/usr/local/bin/my-mcp'], enabled: false, environment: { DEBUG: '1' } },
});
```
**Step 2 — add a remote SSE/streamable-HTTP server with OAuth.**

```typescript
await cc.agent.mcp.addServer(W, {
  name: 'demo-remote',
  config: { type: 'remote', url: 'https://mcp.example.com/sse', enabled: false, oauth: true },
});
await cc.agent.mcp.startOAuth(W, 'demo-remote');
// ... user opens URL, gets code, then:
await cc.agent.mcp.completeOAuth(W, 'demo-remote', { code: '<from-redirect>' });
```
**Step 3 — connect, status, disconnect, delete.** `connect` brings the server up; status reports `connected | disabled | failed | needs_auth | needs_client_registration` (the `failed` and `needs_client_registration` variants carry an `error` string). ⚠ There is no `removeServer` SDK method and no `DELETE /mcp/{name}` route. To "remove" a server, disconnect it and clear stored OAuth via `DELETE /mcp/{name}/auth` (returns `200 {success:true}`).

```typescript
await cc.agent.mcp.connect('demo-local', W);
const st = await cc.agent.mcp.getStatus(W);
await cc.agent.mcp.disconnect('demo-local', W);
// SDK has no removeServer; use fetch with the same kit-auth headers:
const KIT = `https://${P}-${C}-workspaces-1.${N}.containers.hoody.icu`;
const kitHeaders = {
  'X-Hoody-Container-Claim': JSON.stringify(claim),
  'X-Hoody-Token': token,
};
await fetch(`${KIT}/api/v1/workspaces/${W}/mcp/demo-local/auth`, { method: 'DELETE', headers: kitHeaders });
```
### 5. Branch-based agent run (worktree, diff, push, PR)

**Goal:** create a git worktree branch, send the agent prompts on it, inspect diff, push, open PR. ⚠ `branches.createBranch` requires the workspace's `worktree` to be a real git repository (`git init` + at least one commit). Live-verified — non-git worktree returns `400`. Workflow shown in HTTP for the canonical path; CLI/SDK mirror.

**Step 1 — git-init the worktree** (one-time, via the `files` kit's git operations or shell into the container with `terminal`/`exec`), then create the branch:

```typescript
const br = await cc.agent.branches.createBranch(W, { name: 'feature/agent-run', baseBranch: 'master' });
const B = br.data!.id;
```
**Step 2 — drive the agent on this branch, then read the diff.** Sessions created on this workspace pick up the branch worktree directory automatically.

```typescript
const diff = await cc.agent.branches.getBranchDiff(B, W, { format: 'full' }); // 'summary' | 'full' only
const st = await cc.agent.branches.getBranchStatus(B, W);
```
**Step 3 — push, open PR, dry-run merge.** `createPR` is rate-limited per project (429); requires a configured remote (else `ValidationError: No git remote configured`). `mergeBranch` accepts `dry_run:true` — always run that first.

```typescript
await cc.agent.branches.pushBranch(B, W, { setUpstream: true });
await cc.agent.branches.createPR(B, W, { title: 'Add TODO.md', body: 'agent-generated', target: 'master', draft: true });
await cc.agent.branches.mergeBranch(B, W, { strategy: 'merge', dry_run: true });
```
### 6. RSI multi-reviewer review of a finished session

**Goal:** after the agent finishes a session, run the configured Recursive-Self-Improvement reviewers (or supply ad-hoc ones inline) and stream their critique. ⚠ Disabled returns `403 { error: "rsi_disabled" }`. Inline reviewers with ad-hoc `name` REQUIRE `model` (else `404 unknown_reviewer`). RSI is idempotent on `Idempotency-Key` — retry within TTL replays the same `jobID`.

**Step 1 — kick off the review.** Omit `reviewers` to run all configured ones; pass an array to scope. Inline objects override per-call.

```typescript
const jr = await cc.agent.rsi.rsiReviewStart(W, SID, {
  focus: 'Check for off-by-one errors and missing tests',
  reviewers: [{ name: 'strict', model: 'hoody/hoody-free' }],
});
const JOB = jr.data!.jobID;
```
**Step 2 — stream verdicts (SSE).** First event is a snapshot of state at subscription time, then incremental updates until completion.

```typescript
// Generated rsiStream returns Promise<ApiResponse<unknown>> via plain http.get,
// NOT an async iterator. For live consumption, hit the SSE URL directly:
const url = `${KIT}/api/v1/workspaces/${W}/sessions/${SID}/rsi/runs/${JOB}/stream`;
const res = await fetch(url, { headers: kitHeaders });
const reader = res.body!.getReader();
const decoder = new TextDecoder();
for (;;) {
  const { value, done } = await reader.read();
  if (done) break;
  process.stdout.write(decoder.decode(value));
}
```
### 7. Image-gen and web-search availability check

**Goal:** sessions can call `imagegen` / `websearch` tools if enabled and authenticated. There's no `imageGen.create` / `webSearch.search` HTTP endpoint — the kit only exposes the *enablement* surface; actual generation runs as a tool call inside `sessions.prompt`. To trigger one, send a prompt that asks for an image / web result and let the agent invoke the tool.

**Step 1 — check availability.** Live-verified responses: `{enabled:true, model:"hoody/google/gemini-3.1-flash-image-preview", provider:"hoody", authenticated:true}` for image-gen; similar for web-search.

```typescript
const ig = await cc.agent.imageGen.getStatus(W);
const ws = await cc.agent.webSearch.getStatus(W);
```
**Step 2 — invoke via a session prompt.** Tool gating happens server-side; agent picks the right tool based on instructions.

```typescript
await cc.agent.sessions.promptAsync(W, SID, {
  parts: [{ type: 'text', text: 'Generate a 512x512 PNG... and web-search for ...' }],
  model: { providerID: 'hoody', modelID: 'hoody-free' },
});
```
### 8. Question-and-answer flow (orchestrator interrupts)

**Goal:** when an agent session emits a `question` (e.g. "should I rename `foo` → `bar`?"), it pauses until you `reply` or `reject`. (`consult` is a separate read-only side-channel for getting a second model's recommendation before you reply — it does not resolve the question.) List → answer → resume.

**Step 1 — list pending questions.**

```typescript
const qs = await cc.agent.questions.list(W);
```
**Step 2a — answer it directly** (`reply`). **Step 2b — get a second opinion** (`consult` — runs the question through `providerID/modelID` and returns a recommended answer to YOU (the caller). It is a stateless side-channel: it does NOT notify the agent or resolve the question, so you must still `reply` (or `reject`) with the recommendation to unblock the session.) ⚠ `consult` REQUIRES both `providerID` and `modelID` (live-verified — `400 invalid_type` for missing fields). `note` is an optional human hint.

```typescript
await cc.agent.questions.reply(QID, W, { answers: [['yes, rename foo to bar']] });
// or:
await cc.agent.questions.consult(QID, W, { providerID: 'hoody', modelID: 'hoody-free', note: 'prefer bar' });
```
### 9. List and inspect available agent tools (per provider/model)

**Goal:** discover what tools the agent has access to in this workspace. `experimental.listToolIds` returns a catalog of bare tool-id strings (typical entries: bash, read, glob, grep, edit, write, task, webfetch, todowrite, websearch, imagegen, codesearch, skill, apply_patch, plus `hoody_*` capability tools); `listToolSchemas` returns full JSON-Schemas tailored to the chosen `providerID/modelID` combination so you can see what arguments each tool accepts.

```typescript
const ids = await cc.agent.experimental.listToolIds(W);
const schemas = await cc.agent.experimental.listToolSchemas(W, { provider: 'hoody', model: 'hoody-free' });
```
### 10. Tear down a workspace cleanly (cleanup template)

**Goal:** the inverse of example 1 — sessions, branches, MCP servers, memory blocks, then `unbind` and `workspacesDelete`. Always do this for `examples-*` workspaces; they accumulate forever otherwise (worktree on disk too).

**Step 1 — cascade-delete the children** (sessions, journal, blocks, branches, MCP). Each list-then-delete loop scopes only the resources you created.

```typescript
const sl = await cc.agent.sessions.list(W, { limit: 200 });
await Promise.all((sl.items || []).map((s: any) => cc.agent.sessions.delete(W, s.id)));
const jl = await cc.agent.memory.listJournalEntries(W);
await Promise.all((jl.data || []).map((e: any) => cc.agent.memory.deleteJournalEntry(W, e.id)));
const bl = await cc.agent.branches.listBranches(W);
await Promise.all((bl.data || []).map((b: any) => cc.agent.branches.deleteBranch(b.id, W)));
```
**Step 2 — unbind the container, delete the workspace entry, drop the worktree dir.** The kit does NOT delete the worktree on disk — `files.delete` it yourself.

```typescript
await cc.agent.workspace.unbind(W);
await cc.agent.workspace.workspacesDelete(W);
await cc.files.delete(worktree.replace(/^\//, ''));
```
**Step 3 — verify it's gone.**

```typescript
// Generated WorkspaceListResponse has top-level { items, meta } and data: unknown.
const after = await cc.agent.workspace.workspacesList({ limit: 50 });
const items = after.items ?? [];
console.log(items.length);
```

## Reference

**Accessor:** `client.agent`  |  **Import:** `import * as agent from '@hoody-ai/hoody-sdk/agent'`

### `client.agent.branches` (17) — Branches

#### `createBranch` — Create a new branch

```typescript
client.agent.branches.createBranch(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ name: string, startCommand: string, baseBranch: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/branches`
**CLI:** `hoody agent branches create`

---

#### `createPR` — Create pull/merge request

```typescript
client.agent.branches.createPR(id: string, workspaceID: string, data: agent_CreatePRInput)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `agent_CreatePRInput` | body | Yes |  |

**Returns:** `agent_PRResult`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/branches/{id}/pr`
**CLI:** `hoody agent branches pr create`

---

#### `deleteBranch` — Delete a branch

```typescript
client.agent.branches.deleteBranch(id: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `void`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/branches/{id}`
**CLI:** `hoody agent branches delete`

---

#### `getBranchDiff` — Get branch diff

```typescript
client.agent.branches.getBranchDiff(id: string, base?: string, file?: string, format?: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `base` | `string` | query | No |  |
| `file` | `string` | query | No |  |
| `format` | `string` | query | No |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches/{id}/diff`
**CLI:** `hoody agent branches diff`

---

#### `getBranchDiskUsage` — Get branch disk usage

```typescript
client.agent.branches.getBranchDiskUsage(id?: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | query | No |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches/disk-usage`
**CLI:** `hoody agent branches disk-usage`

---

#### `getBranchStatus` — Get branch git status

```typescript
client.agent.branches.getBranchStatus(id: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches/{id}/status`
**CLI:** `hoody agent branches status`

---

#### `getPRStatus` — Get PR/MR status

```typescript
client.agent.branches.getPRStatus(id: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_PRStatus`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches/{id}/pr`
**CLI:** `hoody agent branches pr status`

---

#### `getRemoteInfo` — Get remote info

```typescript
client.agent.branches.getRemoteInfo(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_RemoteInfo`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches/remote`
**CLI:** `hoody agent branches remote info`

---

#### `getRemoteStatus` — Get remote tracking status

```typescript
client.agent.branches.getRemoteStatus(id: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_RemoteTrackingStatus`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches/{id}/remote-status`
**CLI:** `hoody agent branches remote status`

---

#### `listBranches` — List all branches

```typescript
client.agent.branches.listBranches(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches`
**CLI:** `hoody agent branches list`

---

#### `listRemoteRefs` — List remote branches/tags

```typescript
client.agent.branches.listRemoteRefs(remote?: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `remote` | `string` | query | No |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_RemoteRefs`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/branches/remote-refs`
**CLI:** `hoody agent branches remote refs`

---

#### `mergeBranch` — Merge branch

```typescript
client.agent.branches.mergeBranch(id: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ strategy: "squash" | "rebase" | "merge", message: string, dry_run: bool, deleteBranch: bool }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/branches/{id}/merge`
**CLI:** `hoody agent branches merge`

---

#### `pullBranch` — Pull from remote

```typescript
client.agent.branches.pullBranch(id: string, workspaceID: string, data: agent_PullInput)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `agent_PullInput` | body | Yes |  |

**Returns:** `agent_PullResult`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/branches/{id}/pull`
**CLI:** `hoody agent branches pull`

---

#### `pushBranch` — Push branch to remote

```typescript
client.agent.branches.pushBranch(id: string, workspaceID: string, data: agent_PushInput)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `agent_PushInput` | body | Yes |  |

**Returns:** `agent_PushResult`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/branches/{id}/push`
**CLI:** `hoody agent branches push`

---

#### `renameBranch` — Rename branch display name

```typescript
client.agent.branches.renameBranch(id: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ name*: string }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/branches/{id}`
**CLI:** `hoody agent branches rename`

---

#### `resetBranch` — Reset branch to base

```typescript
client.agent.branches.resetBranch(id: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/branches/{id}/reset`
**CLI:** `hoody agent branches reset`

---

#### `retryBranch` — Retry failed branch

```typescript
client.agent.branches.retryBranch(id: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `id` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/branches/{id}/retry`
**CLI:** `hoody agent branches retry`

---

### `client.agent.cliAgents` (1) — List configured CLI agents

#### `configListCliAgents` — List configured CLI agents

```typescript
client.agent.cliAgents.configListCliAgents(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/config/cli-agents`
**CLI:** `hoody agent config cli-agents`

---

### `client.agent.config` (3) — Config operations

#### `get` — Get configuration

```typescript
client.agent.config.get(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_Config`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/config`
**CLI:** `hoody agent config get`

---

#### `getToolOverrides` — Get workspace tool overrides

```typescript
client.agent.config.getToolOverrides(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/config/tool-overrides`
**CLI:** `hoody agent config tool-overrides`

---

#### `update` — Update configuration

```typescript
client.agent.config.update(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ permission: object | null, tool_overrides: object | null, tool_wake_policy: object | null, yolo: bool | null, provider: object | null, disabled_providers: string[] | null, enabled_providers: string[] | null, model: string | null, small_model: string | null, default_agent: string | null, instructions: string[] | null }`

**Returns:** `agent_Config`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/config`
**CLI:** `hoody agent config update`

---

### `client.agent.dryRun` (1) — Simulate rule firing without side effects

#### `diagnoseWorkspaceMitmDryRun` — Simulate rule firing without side effects

```typescript
client.agent.dryRun.diagnoseWorkspaceMitmDryRun(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ event*: "session.created" | "session.idle" | "session.error" | "chat.message" | "tool.execute.before" | "tool.execute.after" | "chat.system.transform", sessionTags: string[], depth: int=0, toolName: string, role: "user" | "assistant", messageContent: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/diagnostics/dry-run`
**CLI:** `hoody agent mitm diagnostics dry-run`

---

### `client.agent.enable` (1) — Persistent enable/disable of a rule via overlay enabledOverride

#### `setWorkspaceMitmRuleEnabled` — Persistent enable/disable of a rule via overlay enabledOverride

```typescript
client.agent.enable.setWorkspaceMitmRuleEnabled(workspaceID: string, id: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ enabled*: bool }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/rules/{id}/enable`
**CLI:** `hoody agent mitm rules enable`

---

### `client.agent.events` (1) — SSE stream of MITM rule firings (live)

#### `streamWorkspaceMitmEvents` — SSE stream of MITM rule firings (live)

```typescript
client.agent.events.streamWorkspaceMitmEvents(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/events`
**CLI:** `hoody agent mitm events`

---

### `client.agent.experimental` (3) — Experimental operations

#### `listMcpResources` — Get MCP resources

```typescript
client.agent.experimental.listMcpResources(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/experimental/resource`
**CLI:** `hoody agent experimental mcp-resources`

---

#### `listToolIds` — List tool IDs

```typescript
client.agent.experimental.listToolIds(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_ToolIDs`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/experimental/tool/ids`
**CLI:** `hoody agent experimental tool-ids`

---

#### `listToolSchemas` — List tools

```typescript
client.agent.experimental.listToolSchemas(provider: string, model: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `provider` | `string` | query | Yes |  |
| `model` | `string` | query | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_ToolList`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/experimental/tool`
**CLI:** `hoody agent experimental tool-schemas`

---

### `client.agent.files` (6) — Files operations

#### `findByName` — Find files

```typescript
client.agent.files.findByName(query: string, dirs?: string, type?: string, limit?: integer, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `query` | `string` | query | Yes |  |
| `dirs` | `string` | query | No |  |
| `type` | `string` | query | No |  |
| `limit` | `integer` | query | No |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/files/find/file`
**CLI:** `hoody agent files find`

---

#### `findSymbols` — Find symbols

```typescript
client.agent.files.findSymbols(query: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `query` | `string` | query | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/files/find/symbol`
**CLI:** `hoody agent files find-symbols`

---

#### `getStatus` — Get file status

```typescript
client.agent.files.getStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/files/file/status`
**CLI:** `hoody agent files status`

---

#### `list` — List files

```typescript
client.agent.files.list(path: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `path` | `string` | query | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/files/file`
**CLI:** `hoody agent files list`

---

#### `readContent` — Read file

```typescript
client.agent.files.readContent(path: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `path` | `string` | query | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_FileContent`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/files/file/content`
**CLI:** `hoody agent files read`

---

#### `search` — Find text

```typescript
client.agent.files.search(pattern: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `pattern` | `string` | query | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/files/find`
**CLI:** `hoody agent files search`

---

### `client.agent.git` (1) — Git

#### `gitInit` — Initialize git repository for this workspace

```typescript
client.agent.git.gitInit(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_Project`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/git/init`

---

### `client.agent.health` (1) — Health

#### `healthCheck` — Service health check

```typescript
client.agent.health.healthCheck()
```

**Returns:** `agent_HealthResponse`  |  **HTTP:** `GET /api/v1/workspaces/health`
**CLI:** `hoody agent health`

---

### `client.agent.imageGen` (1) — Get image generation status

#### `getStatus` — Get image generation status

```typescript
client.agent.imageGen.getStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/image-gen/status`
**CLI:** `hoody agent image-gen status`

---

### `client.agent.matchTrace` (1) — Augmented dry-run with per-rule trace info

#### `diagnoseWorkspaceMitmMatchTrace` — Augmented dry-run with per-rule trace info

```typescript
client.agent.matchTrace.diagnoseWorkspaceMitmMatchTrace(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ event*: "session.created" | "session.idle" | "session.error" | "chat.message" | "tool.execute.before" | "tool.execute.after" | "chat.system.transform", sessionTags: string[], depth: int=0, toolName: string, role: "user" | "assistant", messageContent: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/diagnostics/match-trace`
**CLI:** `hoody agent mitm diagnostics match-trace`

---

### `client.agent.mcp` (8) — Mcp operations

#### `addServer` — Add MCP server

```typescript
client.agent.mcp.addServer(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ name*: string, config*: agent_McpLocalConfig | agent_McpRemoteConfig }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mcp`
**CLI:** `hoody agent mcp add`

---

#### `authenticateOAuth` — Authenticate MCP OAuth

```typescript
client.agent.mcp.authenticateOAuth(workspaceID: string, name: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |

**Returns:** `agent_MCPStatus`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mcp/{name}/auth/authenticate`
**CLI:** `hoody agent mcp oauth authenticate`

---

#### `completeOAuth` — Complete MCP OAuth

```typescript
client.agent.mcp.completeOAuth(workspaceID: string, name: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ code*: string }`

**Returns:** `agent_MCPStatus`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mcp/{name}/auth/callback`
**CLI:** `hoody agent mcp oauth complete`

---

#### `connect` — Connect an MCP server

```typescript
client.agent.mcp.connect(name: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `name` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mcp/{name}/connect`
**CLI:** `hoody agent mcp connect`

---

#### `disconnect` — Disconnect an MCP server

```typescript
client.agent.mcp.disconnect(name: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `name` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mcp/{name}/disconnect`
**CLI:** `hoody agent mcp disconnect`

---

#### `getStatus` — Get MCP status

```typescript
client.agent.mcp.getStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mcp`
**CLI:** `hoody agent mcp status`

---

#### `removeOAuth` — Remove MCP OAuth

```typescript
client.agent.mcp.removeOAuth(workspaceID: string, name: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/mcp/{name}/auth`
**CLI:** `hoody agent mcp oauth remove`

---

#### `startOAuth` — Start MCP OAuth

```typescript
client.agent.mcp.startOAuth(workspaceID: string, name: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mcp/{name}/auth`
**CLI:** `hoody agent mcp oauth start`

---

### `client.agent.memory` (14) — Memory operations

#### `countJournalEntries` — Count journal entries

```typescript
client.agent.memory.countJournalEntries(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/journal/count`
**CLI:** `hoody agent memory journal count`

---

#### `createJournalEntry` — Write journal entry

```typescript
client.agent.memory.createJournalEntry(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ title*: string, body*: string, tags: string[], projectID: string, model: string, provider: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/memory/journal`
**CLI:** `hoody agent memory journal create`

---

#### `deleteBlock` — Delete memory block

```typescript
client.agent.memory.deleteBlock(workspaceID: string, label: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `label` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/memory/blocks/{label}`
**CLI:** `hoody agent memory block delete`

---

#### `deleteJournalEntry` — Delete journal entry

```typescript
client.agent.memory.deleteJournalEntry(workspaceID: string, id: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/memory/journal/{id}`
**CLI:** `hoody agent memory journal delete`

---

#### `getBlock` — Get memory block

```typescript
client.agent.memory.getBlock(workspaceID: string, label: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `label` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/blocks/{label}`
**CLI:** `hoody agent memory block get`

---

#### `getConfig` — Get memory config

```typescript
client.agent.memory.getConfig(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/config`
**CLI:** `hoody agent memory config`

---

#### `getHistoryEvent` — Get history event

```typescript
client.agent.memory.getHistoryEvent(workspaceID: string, id: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/history/{id}`
**CLI:** `hoody agent memory history get`

---

#### `getJournalEntry` — Get journal entry

```typescript
client.agent.memory.getJournalEntry(workspaceID: string, id: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/journal/{id}`
**CLI:** `hoody agent memory journal get`

---

#### `listBlocks` — List memory blocks

```typescript
client.agent.memory.listBlocks(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/blocks`
**CLI:** `hoody agent memory block list`

---

#### `listHistory` — List history events

```typescript
client.agent.memory.listHistory(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/history`
**CLI:** `hoody agent memory history list`

---

#### `listJournalEntries` — List journal entries

```typescript
client.agent.memory.listJournalEntries(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/memory/journal`
**CLI:** `hoody agent memory journal list`

---

#### `replaceBlock` — Replace in memory block

```typescript
client.agent.memory.replaceBlock(workspaceID: string, label: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `label` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ scope*: "global" | "workspace", old_str*: string, new_str*: string }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/memory/blocks/{label}`
**CLI:** `hoody agent memory block replace`

---

#### `searchJournalEntries` — Search journal entries

```typescript
client.agent.memory.searchJournalEntries(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ text: string, projectID: string, tags: string[], limit: number }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/memory/journal/search`
**CLI:** `hoody agent memory journal search`

---

#### `setBlock` — Set memory block

```typescript
client.agent.memory.setBlock(workspaceID: string, label: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `label` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ scope*: "global" | "workspace", value*: string, description: string, limit: number, readOnly: bool }`

**Returns:** `any`  |  **HTTP:** `PUT /api/v1/workspaces/{workspaceID}/memory/blocks/{label}`
**CLI:** `hoody agent memory block set`

---

### `client.agent.meta` (9) — Workspace Meta

#### `dispose` — Dispose instance

```typescript
client.agent.meta.dispose(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/meta/dispose`
**CLI:** `hoody agent meta dispose`

---

#### `getFormatterStatus` — Get formatter status

```typescript
client.agent.meta.getFormatterStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/formatter/status`
**CLI:** `hoody agent meta formatter-status`

---

#### `getLspStatus` — Get LSP status

```typescript
client.agent.meta.getLspStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/lsp/status`
**CLI:** `hoody agent meta lsp-status`

---

#### `getPaths` — Get paths

```typescript
client.agent.meta.getPaths(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_Path`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/path`
**CLI:** `hoody agent meta paths`

---

#### `getVcs` — Get VCS info

```typescript
client.agent.meta.getVcs(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_VcsInfo`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/vcs`
**CLI:** `hoody agent meta vcs`

---

#### `listAgents` — List agents

```typescript
client.agent.meta.listAgents(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/agents`
**CLI:** `hoody agent meta agents`

---

#### `listCommands` — List commands

```typescript
client.agent.meta.listCommands(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/commands`
**CLI:** `hoody agent meta commands`

---

#### `listSkills` — List skills

```typescript
client.agent.meta.listSkills(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/skills`
**CLI:** `hoody agent meta skills`

---

#### `subscribeEvents` — Subscribe to events

```typescript
client.agent.meta.subscribeEvents(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/meta/events`
**CLI:** `hoody agent meta events`

---

### `client.agent.orchestration` (61) — Orchestration

#### `budgetEdit` — Edit entry budget (sets budget_human_locked)

```typescript
client.agent.orchestration.budgetEdit(workspaceID: string, entryID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ budget_usd*: number }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/budget/entries/{entryID}`
**CLI:** `hoody agent orchestration budget edit`

---

#### `budgetGetStatus` — Get global budget status with per-entry breakdown

```typescript
client.agent.orchestration.budgetGetStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/budget`
**CLI:** `hoody agent orchestration budget status`

---

#### `budgetLock` — Toggle budget_human_locked on an entry

```typescript
client.agent.orchestration.budgetLock(workspaceID: string, entryID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/budget/entries/{entryID}/lock`
**CLI:** `hoody agent orchestration budget lock`

---

#### `budgetUpdateGlobal` — Update global budget (max project spend)

```typescript
client.agent.orchestration.budgetUpdateGlobal(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ max_project_spend_usd*: number }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/budget`
**CLI:** `hoody agent orchestration budget update`

---

#### `executorForceDispatch` — Force an executor dispatch cycle with diagnostics

```typescript
client.agent.orchestration.executorForceDispatch(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/executor/force-dispatch`
**CLI:** `hoody agent orchestration executor force-dispatch`

---

#### `executorGetLocks` — Get file locks per entry

```typescript
client.agent.orchestration.executorGetLocks(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/executor/locks`
**CLI:** `hoody agent orchestration executor locks`

---

#### `executorGetStatus` — Get executor status

```typescript
client.agent.orchestration.executorGetStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/executor/status`
**CLI:** `hoody agent orchestration executor status`

---

#### `executorGetWorkers` — List active worker sessions

```typescript
client.agent.orchestration.executorGetWorkers(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/executor/workers`
**CLI:** `hoody agent orchestration executor workers list`

---

#### `executorPause` — Pause executor dispatching

```typescript
client.agent.orchestration.executorPause(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/executor/pause`
**CLI:** `hoody agent orchestration executor pause`

---

#### `executorResume` — Resume executor dispatching

```typescript
client.agent.orchestration.executorResume(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/executor/resume`
**CLI:** `hoody agent orchestration executor resume`

---

#### `executorReverifyEntry` — Re-run verification only (skip worker)

```typescript
client.agent.orchestration.executorReverifyEntry(workspaceID: string, entryID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/executor/entries/{entryID}/reverify`
**CLI:** `hoody agent orchestration executor reverify`

---

#### `executorStart` — Start executor dispatch loop

```typescript
client.agent.orchestration.executorStart(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/executor/start`
**CLI:** `hoody agent orchestration executor start`

---

#### `executorStopAll` — Stop all workers and pause executor

```typescript
client.agent.orchestration.executorStopAll(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/executor/stop-all`
**CLI:** `hoody agent orchestration executor stop-all`

---

#### `executorStopWorker` — Stop a specific worker

```typescript
client.agent.orchestration.executorStopWorker(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/executor/workers/{sessionID}/stop`
**CLI:** `hoody agent orchestration executor workers stop`

---

#### `getConfig` — Get orchestration config

```typescript
client.agent.orchestration.getConfig(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/config`
**CLI:** `hoody agent orchestration config get`

---

#### `getDebugDump` — Export full orchestration debug dump

```typescript
client.agent.orchestration.getDebugDump(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/debug-dump`
**CLI:** `hoody agent orchestration debug-dump`

---

#### `getEventsConnections` — Get SSE connection count

```typescript
client.agent.orchestration.getEventsConnections(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/events/connections`
**CLI:** `hoody agent orchestration events connections`

---

#### `getImportStatus` — Get import job status

```typescript
client.agent.orchestration.getImportStatus(workspaceID: string, jobID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `jobID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/import/{jobID}`
**CLI:** `hoody agent orchestration import status`

---

#### `getLog` — Read tool call log (paginated, filterable)

```typescript
client.agent.orchestration.getLog(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/log`
**CLI:** `hoody agent orchestration log get`

---

#### `orchestratorCreateSession` — Create or resume orchestrator session

```typescript
client.agent.orchestration.orchestratorCreateSession(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/orchestrator/session`
**CLI:** `hoody agent orchestration orchestrator create-session`

---

#### `orchestratorGetPhaseSession` — Get phase orchestrator session info

```typescript
client.agent.orchestration.orchestratorGetPhaseSession(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/orchestrator/phases/{phaseID}/session`
**CLI:** `hoody agent orchestration orchestrator phase-session`

---

#### `orchestratorGetSession` — Get orchestrator session info

```typescript
client.agent.orchestration.orchestratorGetSession(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/orchestrator/session`
**CLI:** `hoody agent orchestration orchestrator get-session`

---

#### `orchestratorListSessions` — Get all orchestrator sessions (planning + per-phase)

```typescript
client.agent.orchestration.orchestratorListSessions(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/orchestrator/sessions`
**CLI:** `hoody agent orchestration orchestrator list-sessions`

---

#### `orchestratorPromptPhase` — Send prompt to phase orchestrator session

```typescript
client.agent.orchestration.orchestratorPromptPhase(workspaceID: string, phaseID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ text*: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/orchestrator/phases/{phaseID}/prompt`
**CLI:** `hoody agent orchestration orchestrator prompt-phase`

---

#### `orchestratorSendPrompt` — Send prompt to orchestrator (with @todo mention resolution)

```typescript
client.agent.orchestration.orchestratorSendPrompt(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ text*: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/orchestrator/prompt`
**CLI:** `hoody agent orchestration orchestrator prompt`

---

#### `phasesAddEntry` — Add entry to phase

```typescript
client.agent.orchestration.phasesAddEntry(workspaceID: string, phaseID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ entryID*: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/entries`
**CLI:** `hoody agent orchestration phase add-entry`

---

#### `phasesAddMemory` — Add a note to phase memory

```typescript
client.agent.orchestration.phasesAddMemory(workspaceID: string, phaseID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ text*: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/memory`
**CLI:** `hoody agent orchestration phase memory add`

---

#### `phasesClearMemory` — Clear phase memory

```typescript
client.agent.orchestration.phasesClearMemory(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/memory`
**CLI:** `hoody agent orchestration phase memory clear`

---

#### `phasesCreate` — Create phases

```typescript
client.agent.orchestration.phasesCreate(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ phases*: { name*: string, description*: string, entry_ids: string[], phase_rounds: number, container_id: string }[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/phases`
**CLI:** `hoody agent orchestration phase create`

---

#### `phasesDelete` — Delete a phase (entries are unphased, not deleted)

```typescript
client.agent.orchestration.phasesDelete(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}`
**CLI:** `hoody agent orchestration phase delete`

---

#### `phasesGet` — Get single phase detail

```typescript
client.agent.orchestration.phasesGet(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}`
**CLI:** `hoody agent orchestration phase get`

---

#### `phasesGetAllMemory` — Get memory for all phases

```typescript
client.agent.orchestration.phasesGetAllMemory(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/phases/memory`
**CLI:** `hoody agent orchestration phase memory list-all`

---

#### `phasesGetSummary` — Get phase summary

```typescript
client.agent.orchestration.phasesGetSummary(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/summary`
**CLI:** `hoody agent orchestration phase summary`

---

#### `phasesList` — List all phases

```typescript
client.agent.orchestration.phasesList(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/phases`
**CLI:** `hoody agent orchestration phase list`

---

#### `phasesListMemory` — Get phase memory notes

```typescript
client.agent.orchestration.phasesListMemory(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/memory`
**CLI:** `hoody agent orchestration phase memory list`

---

#### `phasesReview` — Manually trigger phase review

```typescript
client.agent.orchestration.phasesReview(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/review`
**CLI:** `hoody agent orchestration phase review`

---

#### `phasesUpdateRounds` — Update phase rounds budget

```typescript
client.agent.orchestration.phasesUpdateRounds(workspaceID: string, phaseID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ phase_rounds*: int }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/rounds`
**CLI:** `hoody agent orchestration phase update-rounds`

---

#### `phasesUpdateStatus` — Manually update phase status

```typescript
client.agent.orchestration.phasesUpdateStatus(workspaceID: string, phaseID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ status*: "pending" | "active" | "verifying" | "fixing" | "done" | "failed" }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/status`
**CLI:** `hoody agent orchestration phase update-status`

---

#### `phasesVerify` — Manually trigger phase verification

```typescript
client.agent.orchestration.phasesVerify(workspaceID: string, phaseID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `phaseID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/phases/{phaseID}/verify`
**CLI:** `hoody agent orchestration phase verify`

---

#### `purge` — Purge all orchestration data for this workspace

```typescript
client.agent.orchestration.purge(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/purge`
**CLI:** `hoody agent orchestration purge`

---

#### `questionsAnswer` — Answer a pending question

```typescript
client.agent.orchestration.questionsAnswer(workspaceID: string, questionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `questionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ answers*: string[][] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/questions/{questionID}/answer`
**CLI:** `hoody agent orchestration questions answer`

---

#### `questionsGetDetail` — Get question detail

```typescript
client.agent.orchestration.questionsGetDetail(workspaceID: string, questionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `questionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/questions/{questionID}`
**CLI:** `hoody agent orchestration questions get`

---

#### `questionsList` — List pending questions

```typescript
client.agent.orchestration.questionsList(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/questions`
**CLI:** `hoody agent orchestration questions list`

---

#### `startImport` — Start a repo import

```typescript
client.agent.orchestration.startImport(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ repoUrl*: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/import`
**CLI:** `hoody agent orchestration import start`

---

#### `streamEvents` — SSE stream of all orchestration events (supports ?since_seq=N for reconnection)

```typescript
client.agent.orchestration.streamEvents(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/events`
**CLI:** `hoody agent orchestration events stream`

---

#### `streamLog` — Tool call log SSE stream

```typescript
client.agent.orchestration.streamLog(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/log/stream`
**CLI:** `hoody agent orchestration log stream`

---

#### `todoAppend` — Append entries to Master TODO

```typescript
client.agent.orchestration.todoAppend(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ entries*: ({ type*: "task" | "correction" | "review" | "snapshot" | "note" | "parent", content*: string, spec: object, priority*: "critical" | "high" | "medium" | "low", depends_on: string[], parallelizable: bool=true, parallel_group: string, budget_usd: number, budget_rounds: number=3, phase_id: string, container_id: string })[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/todo/entries`
**CLI:** `hoody agent orchestration todo entry append`

---

#### `todoDeleteEntry` — Delete a task entry

```typescript
client.agent.orchestration.todoDeleteEntry(workspaceID: string, entryID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}`
**CLI:** `hoody agent orchestration todo entry delete`

---

#### `todoFreezeSpec` — Freeze entry spec

```typescript
client.agent.orchestration.todoFreezeSpec(workspaceID: string, entryID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}/spec/freeze`
**CLI:** `hoody agent orchestration todo spec freeze`

---

#### `todoGetEntry` — Get a single Master TODO entry

```typescript
client.agent.orchestration.todoGetEntry(workspaceID: string, entryID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}`
**CLI:** `hoody agent orchestration todo entry get`

---

#### `todoGetEvents` — Read Master TODO event log

```typescript
client.agent.orchestration.todoGetEvents(page?: integer, limit?: integer, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `page` | `integer` | query | No |  |
| `limit` | `integer` | query | No |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/todo/events`
**CLI:** `hoody agent orchestration todo events`

---

#### `todoRead` — Read full Master TODO state

```typescript
client.agent.orchestration.todoRead(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/todo`
**CLI:** `hoody agent orchestration todo read`

---

#### `todoReadSpec` — Read entry spec

```typescript
client.agent.orchestration.todoReadSpec(workspaceID: string, entryID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}/spec`
**CLI:** `hoody agent orchestration todo spec get`

---

#### `todoSetPriority` — Update entry priority

```typescript
client.agent.orchestration.todoSetPriority(workspaceID: string, entryID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ priority*: "critical" | "high" | "medium" | "low" }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}/priority`
**CLI:** `hoody agent orchestration todo entry set-priority`

---

#### `todoSetRounds` — Set entry budget_rounds

```typescript
client.agent.orchestration.todoSetRounds(workspaceID: string, entryID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ budget_rounds*: int }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}/rounds`
**CLI:** `hoody agent orchestration todo entry set-rounds`

---

#### `todoSetStatus` — Update entry status

```typescript
client.agent.orchestration.todoSetStatus(workspaceID: string, entryID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ status*: "pending" | "blocked" | "in_progress" | "done" | "failed" | "skipped" | "superseded", context_for_next: string, mistakes_learned: string[] }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}/status`
**CLI:** `hoody agent orchestration todo entry set-status`

---

#### `todoUpdateSpec` — Update entry spec

```typescript
client.agent.orchestration.todoUpdateSpec(workspaceID: string, entryID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ requirements*: string, acceptance_criteria*: string[], files_to_create: string[], files_to_modify: string[], patterns: string, api_contract: string, examples: string, integration_points: string }`

**Returns:** `any`  |  **HTTP:** `PUT /api/v1/workspaces/{workspaceID}/orchestration/todo/entries/{entryID}/spec`
**CLI:** `hoody agent orchestration todo spec update`

---

#### `updateConfig` — Patch orchestration config (partial update)

```typescript
client.agent.orchestration.updateConfig(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ [key: string]: any }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/orchestration/config`
**CLI:** `hoody agent orchestration config update`

---

#### `vaultDiscover` — Discover Master TODOs stored in Vault

```typescript
client.agent.orchestration.vaultDiscover(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/orchestration/vault/discover`
**CLI:** `hoody agent orchestration vault discover`

---

#### `vaultImport` — Import a TODO from Vault into local storage

```typescript
client.agent.orchestration.vaultImport(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ sourceWorkspaceID*: string, targetWorkspaceID: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/vault/import`
**CLI:** `hoody agent orchestration vault import`

---

#### `vaultSync` — Sync local Master TODO snapshot to Vault

```typescript
client.agent.orchestration.vaultSync(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/orchestration/vault/sync`
**CLI:** `hoody agent orchestration vault sync`

---

### `client.agent.permissions` (3) — Permissions operations

#### `getOverrides` — Get workspace permission overrides

```typescript
client.agent.permissions.getOverrides(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/config/permission`
**CLI:** `hoody agent permissions overrides`

---

#### `list` — List pending permissions

```typescript
client.agent.permissions.list(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/permissions`
**CLI:** `hoody agent permissions list`

---

#### `reply` — Respond to permission request

```typescript
client.agent.permissions.reply(requestID: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `requestID` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ reply*: "once" | "always" | "reject", message: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/permissions/{requestID}/reply`
**CLI:** `hoody agent permissions reply`

---

### `client.agent.project` (2) — Project operations

#### `getCurrent` — Get current project

```typescript
client.agent.project.getCurrent(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_Project`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/project/current`
**CLI:** `hoody agent project current`

---

#### `update` — Update project

```typescript
client.agent.project.update(projectID: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `projectID` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ name: string, icon: { url: string, override: string, color: string }, commands: { start: string } }`

**Returns:** `agent_Project`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/project/{projectID}`
**CLI:** `hoody agent project update`

---

### `client.agent.prompt` (3) — Prompt

#### `agentPrompt` — Execute prompt

```typescript
client.agent.prompt.agentPrompt(data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `data` | `object` | body | Yes |  |

**Body:** `{ parts*: { type*: "text", text*: string }[], sessionID: string, model: { providerID*: string, modelID*: string }, endpoint: string, apiKey: string, wait: bool, autoApprove: bool, agent: string, system: string, workspace: string, directory: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/agent/prompt`
**CLI:** `hoody agent prompt send`

---

#### `agentPromptGet` — Execute prompt via query

```typescript
client.agent.prompt.agentPromptGet(ai: string, sessionID?: string, providerID?: string, modelID?: string, endpoint?: string, baseURL?: string, apiKey?: string, key?: string, wait?: string, autoApprove?: string, agent?: string, system?: string, workspace?: string, directory?: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `ai` | `string` | query | Yes |  |
| `sessionID` | `string` | query | No |  |
| `providerID` | `string` | query | No |  |
| `modelID` | `string` | query | No |  |
| `endpoint` | `string` | query | No |  |
| `baseURL` | `string` | query | No |  |
| `apiKey` | `string` | query | No |  |
| `key` | `string` | query | No |  |
| `wait` | `string` | query | No |  |
| `autoApprove` | `string` | query | No |  |
| `agent` | `string` | query | No |  |
| `system` | `string` | query | No |  |
| `workspace` | `string` | query | No |  |
| `directory` | `string` | query | No |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/agent/prompt`
**CLI:** `hoody agent prompt query`

---

#### `agentPromptSync` — Execute prompt (synchronous)

```typescript
client.agent.prompt.agentPromptSync(data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `data` | `object` | body | Yes |  |

**Body:** `{ parts*: { type*: "text", text*: string }[], sessionID: string, model: { providerID*: string, modelID*: string }, endpoint: string, apiKey: string, wait: bool, autoApprove: bool, agent: string, system: string, workspace: string, directory: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/agent/prompt/sync`
**CLI:** `hoody agent prompt send-sync`

---

### `client.agent.providers` (5) — Providers operations

#### `authorizeOAuth` — OAuth authorize

```typescript
client.agent.providers.authorizeOAuth(providerID: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `providerID` | `string` | path | Yes | Provider ID |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ method*: number }`

**Returns:** `agent_ProviderAuthAuthorization`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/providers/{providerID}/oauth/authorize`
**CLI:** `hoody agent providers oauth authorize`

---

#### `callbackOAuth` — OAuth callback

```typescript
client.agent.providers.callbackOAuth(providerID: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `providerID` | `string` | path | Yes | Provider ID |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ method*: number, code: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/providers/{providerID}/oauth/callback`
**CLI:** `hoody agent providers oauth callback`

---

#### `getAuthMethods` — Get provider auth methods

```typescript
client.agent.providers.getAuthMethods(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/providers/auth`
**CLI:** `hoody agent providers auth-methods`

---

#### `list` — List providers

```typescript
client.agent.providers.list(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/providers`
**CLI:** `hoody agent providers list`

---

#### `listConfigs` — List config providers

```typescript
client.agent.providers.listConfigs(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/config/providers`
**CLI:** `hoody agent providers list-configs`

---

### `client.agent.questions` (4) — Questions operations

#### `consult` — Consult AI about a question

```typescript
client.agent.questions.consult(requestID: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `requestID` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ providerID*: string, modelID*: string, note: string, questionIndex: int, system: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/questions/{requestID}/consult`
**CLI:** `hoody agent questions consult`

---

#### `list` — List pending questions

```typescript
client.agent.questions.list(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/questions`
**CLI:** `hoody agent questions list`

---

#### `reject` — Reject question request

```typescript
client.agent.questions.reject(requestID: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `requestID` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/questions/{requestID}/reject`
**CLI:** `hoody agent questions reject`

---

#### `reply` — Reply to question request

```typescript
client.agent.questions.reply(requestID: string, workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `requestID` | `string` | path | Yes |  |
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ answers*: agent_QuestionAnswer[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/questions/{requestID}/reply`
**CLI:** `hoody agent questions reply`

---

### `client.agent.rebase` (1) — Re-validate overlay against new base; mark stale entries fresh

#### `rebaseWorkspaceMitmOverlay` — Re-validate overlay against new base; mark stale entries fresh

```typescript
client.agent.rebase.rebaseWorkspaceMitmOverlay(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/overlay/rebase`
**CLI:** `hoody agent mitm overlay rebase`

---

### `client.agent.reset` (1) — Drop the entire overlay for this scope

#### `resetWorkspaceMitmOverlay` — Drop the entire overlay for this scope

```typescript
client.agent.reset.resetWorkspaceMitmOverlay(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/overlay/reset`
**CLI:** `hoody agent mitm overlay reset`

---

### `client.agent.reviewers` (1) — List configured RSI reviewers

#### `configListReviewers` — List configured RSI reviewers

```typescript
client.agent.reviewers.configListReviewers(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/config/reviewers`
**CLI:** `hoody agent config reviewers`

---

### `client.agent.rsi` (2) — RSI

#### `rsiReviewStart` — Start an RSI review on a session

```typescript
client.agent.rsi.rsiReviewStart(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ focus: string, reviewers: (string | object)[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/rsi/review`
**CLI:** `hoody agent sessions rsi review`

---

#### `rsiStream` — SSE progress stream for an RSI review run

```typescript
client.agent.rsi.rsiStream(workspaceID: string, sessionID: string, jobID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `jobID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/rsi/runs/{jobID}/stream`
**CLI:** `hoody agent sessions rsi stream`

---

### `client.agent.rules` (1) — Replace overlay rule (full)

#### `replaceWorkspaceMitmRule` — Replace overlay rule (full)

```typescript
client.agent.rules.replaceWorkspaceMitmRule(workspaceID: string, id: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ id*: string, name*: string, enabled: bool=true, description: string, severity: "info" | "warn" | "error" | "critical", trigger*: { event*: "session.created" | "session.idle" | "session.error" | "chat.message" | "tool.execute.before" | "tool.execute.after" | "chat.system.transform", tags: string[], toolName: string, role: "user" | "assistant", contentMatch: string }, action*: object, cooldownMs: number=0, maxDepth: number=1, blocking: bool=false }`

**Returns:** `any`  |  **HTTP:** `PUT /api/v1/workspaces/{workspaceID}/mitm/rules/{id}`
**CLI:** `hoody agent mitm rules replace`

---

### `client.agent.selfTuning` (3) — Self-Tuning

#### `selfTuningAmplifyStart` — Start a self-tuning amplify run on a session

```typescript
client.agent.selfTuning.selfTuningAmplifyStart(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ task*: string, verifier_name*: string, n*: int, model: { providerID*: string, modelID*: string } }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/amplify`
**CLI:** `hoody agent sessions self-tuning amplify`

---

#### `selfTuningStream` — SSE progress stream for a self-tuning run

```typescript
client.agent.selfTuning.selfTuningStream(workspaceID: string, sessionID: string, jobID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `jobID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/runs/{jobID}/stream`
**CLI:** `hoody agent sessions self-tuning stream`

---

#### `selfTuningTuneStart` — Start a self-tuning tune run on a session

```typescript
client.agent.selfTuning.selfTuningTuneStart(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ task*: string, verifier_name*: string, max_iterations: int, model: { providerID*: string, modelID*: string } }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/tune`
**CLI:** `hoody agent sessions self-tuning tune`

---

### `client.agent.sessionMitmTags` (1) — Replace mitm_tags on a session

#### `patchSessionMitmTags` — Replace mitm_tags on a session

```typescript
client.agent.sessionMitmTags.patchSessionMitmTags(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ tags*: string[] }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/mitm/sessions/{sessionID}/tags`
**CLI:** `hoody agent mitm sessions tags patch`

---

### `client.agent.sessions` (29) — Workspace Session

#### `abort` — Abort workspace session

```typescript
client.agent.sessions.abort(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/abort`
**CLI:** `hoody agent sessions abort`

---

#### `command` — Send command

```typescript
client.agent.sessions.command(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ messageID: string, agent: string, model: string, arguments*: string, command*: string, variant: string, parts: object[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/command`
**CLI:** `hoody agent sessions run-command`

---

#### `create` — Create workspace session

```typescript
client.agent.sessions.create(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `data` | `object` | body | Yes |  |

**Body:** `{ parentID: string, title: string, permission: agent_PermissionRuleset, metadata: { [key: string]: any } }`

**Returns:** `agent_Session`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions`
**CLI:** `hoody agent sessions create`

---

#### `delete` — Delete workspace session

```typescript
client.agent.sessions.delete(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/sessions/{sessionID}`
**CLI:** `hoody agent sessions delete`

---

#### `deletePart` — Delete message part

```typescript
client.agent.sessions.deletePart(workspaceID: string, sessionID: string, messageID: string, partID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `messageID` | `string` | path | Yes |  |
| `partID` | `string` | path | Yes | Part ID |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/message/{messageID}/part/{partID}`
**CLI:** `hoody agent sessions message part delete`

---

#### `export` — Export session (workspace)

```typescript
client.agent.sessions.export(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/export`
**CLI:** `hoody agent sessions export`

---

#### `fork` — Fork workspace session

```typescript
client.agent.sessions.fork(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ messageID: string }`

**Returns:** `agent_Session`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/fork`
**CLI:** `hoody agent sessions fork`

---

#### `get` — Get workspace session

```typescript
client.agent.sessions.get(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `agent_Session`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}`
**CLI:** `hoody agent sessions get`

---

#### `getChildren` — Get child sessions

```typescript
client.agent.sessions.getChildren(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `agent_WsSessionChildrenResponse`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/children`
**CLI:** `hoody agent sessions children`

---

#### `getDiff` — Get workspace session diff

```typescript
client.agent.sessions.getDiff(workspaceID: string, sessionID: string, messageID?: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `messageID` | `string` | query | No | Optional message cursor for message-scoped diff |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/diff`
**CLI:** `hoody agent sessions diff`

---

#### `getMessage` — Get workspace session message

```typescript
client.agent.sessions.getMessage(workspaceID: string, sessionID: string, messageID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `messageID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/messages/{messageID}`
**CLI:** `hoody agent sessions message get`

---

#### `getStatuses` — Get all workspace session statuses

```typescript
client.agent.sessions.getStatuses(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/status`
**CLI:** `hoody agent sessions status`

---

#### `getSummary` — Get workspace session summary

```typescript
client.agent.sessions.getSummary(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `agent_WsSessionSummary`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/summary`
**CLI:** `hoody agent sessions summary`

---

#### `getTodo` — Get workspace session todos

```typescript
client.agent.sessions.getTodo(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/todo`
**CLI:** `hoody agent sessions todo`

---

#### `init` — Initialize workspace session config

```typescript
client.agent.sessions.init(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ modelID*: string, providerID*: string, messageID*: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/init`
**CLI:** `hoody agent sessions init`

---

#### `list` — List workspace sessions

```typescript
client.agent.sessions.list(workspaceID: string, page?: integer, limit?: integer, roots?: boolean, search?: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `page` | `integer` | query | No | Page number (1-indexed) |
| `limit` | `integer` | query | No | Items per page (max 200) |
| `roots` | `boolean` | query | No | Only return root sessions (no parentID) |
| `search` | `string` | query | No | Filter by title (case-insensitive) |

**Returns:** `agent_WsSessionListResponse`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions`
**CLI:** `hoody agent sessions list`

---

#### `listAll` — Sessions wall (alias)

```typescript
client.agent.sessions.listAll(workspace?: string, directory?: string, readonly?: string, read_only?: string, cardWidth?: string, limit?: string, sub?: string, archived?: string, containerId?: string, projectId?: string, serverNode?: string, containerAlias?: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspace` | `string` | query | No |  |
| `directory` | `string` | query | No |  |
| `readonly` | `string` | query | No |  |
| `read_only` | `string` | query | No |  |
| `cardWidth` | `string` | query | No |  |
| `limit` | `string` | query | No |  |
| `sub` | `string` | query | No |  |
| `archived` | `string` | query | No |  |
| `containerId` | `string` | query | No |  |
| `projectId` | `string` | query | No |  |
| `serverNode` | `string` | query | No |  |
| `containerAlias` | `string` | query | No |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/agent/all`
**CLI:** `hoody agent sessions all`

---

#### `listLive` — Sessions wall (HTML)

```typescript
client.agent.sessions.listLive(workspace?: string, directory?: string, readonly?: string, read_only?: string, cardWidth?: string, limit?: string, sub?: string, archived?: string, containerId?: string, projectId?: string, serverNode?: string, containerAlias?: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspace` | `string` | query | No |  |
| `directory` | `string` | query | No |  |
| `readonly` | `string` | query | No |  |
| `read_only` | `string` | query | No |  |
| `cardWidth` | `string` | query | No |  |
| `limit` | `string` | query | No |  |
| `sub` | `string` | query | No |  |
| `archived` | `string` | query | No |  |
| `containerId` | `string` | query | No |  |
| `projectId` | `string` | query | No |  |
| `serverNode` | `string` | query | No |  |
| `containerAlias` | `string` | query | No |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/agent/sessions/live`
**CLI:** `hoody agent sessions live`

---

#### `listMessages` — List workspace session messages

```typescript
client.agent.sessions.listMessages(workspaceID: string, sessionID: string, limit?: integer, role?: string, after?: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `limit` | `integer` | query | No | Maximum messages to return |
| `role` | `string` | query | No | Filter by role |
| `after` | `string` | query | No | Cursor: only return messages with ID strictly greater than this (newer) |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/messages`
**CLI:** `hoody agent sessions message list`

---

#### `prompt` — Send message

```typescript
client.agent.sessions.prompt(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ messageID: string, model: { providerID*: string, modelID*: string }, agent: string, noReply: bool, tools: { [key: string]: bool }, system: string, variant: string, parts*: (agent_TextPartInput | agent_FilePartInput | agent_AgentPartInput | agent_SubtaskPartInput)[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/message`
**CLI:** `hoody agent sessions prompt`

---

#### `promptAsync` — Send async message

```typescript
client.agent.sessions.promptAsync(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ messageID: string, model: { providerID*: string, modelID*: string }, agent: string, noReply: bool, tools: { [key: string]: bool }, system: string, variant: string, parts*: (agent_TextPartInput | agent_FilePartInput | agent_AgentPartInput | agent_SubtaskPartInput)[] }`

**Returns:** `void`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/prompt_async`
**CLI:** `hoody agent sessions prompt-async`

---

#### `revert` — Revert workspace session message

```typescript
client.agent.sessions.revert(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ messageID*: string, partID: string }`

**Returns:** `agent_Session`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/revert`
**CLI:** `hoody agent sessions revert`

---

#### `shell` — Run shell command

```typescript
client.agent.sessions.shell(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ agent*: string, model: { providerID*: string, modelID*: string }, command*: string }`

**Returns:** `agent_AssistantMessage`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/shell`
**CLI:** `hoody agent sessions shell`

---

#### `summarize` — Summarize session

```typescript
client.agent.sessions.summarize(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ providerID*: string, modelID*: string, auto: any, systemPrompt: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/summarize`
**CLI:** `hoody agent sessions summarize`

---

#### `unrevert` — Unrevert workspace session

```typescript
client.agent.sessions.unrevert(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `agent_Session`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/unrevert`
**CLI:** `hoody agent sessions unrevert`

---

#### `update` — Update workspace session

```typescript
client.agent.sessions.update(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ title: string, time: { archived: number }, permission: agent_PermissionRuleset | null, compaction_override: object | null }`

**Returns:** `agent_Session`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/sessions/{sessionID}`
**CLI:** `hoody agent sessions update`

---

#### `updateMessage` — Update message

```typescript
client.agent.sessions.updateMessage(workspaceID: string, sessionID: string, messageID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `messageID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ model*: { providerID*: string, modelID*: string } }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/message/{messageID}`
**CLI:** `hoody agent sessions message update`

---

#### `updatePart` — Update message part

```typescript
client.agent.sessions.updatePart(workspaceID: string, sessionID: string, messageID: string, partID: string, data: agent_Part)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `messageID` | `string` | path | Yes |  |
| `partID` | `string` | path | Yes | Part ID |
| `data` | `agent_Part` | body | Yes |  |

**Returns:** `agent_Part`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/message/{messageID}/part/{partID}`
**CLI:** `hoody agent sessions message part update`

---

#### `updateTags` — Update session tags

```typescript
client.agent.sessions.updateTags(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ tags*: string[] }`

**Returns:** `agent_Session`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/tags`
**CLI:** `hoody agent sessions update-tags`

---

### `client.agent.skills` (7) — Agent Skills

#### `delete` — Delete skill

```typescript
client.agent.skills.delete(workspaceID: string, name: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/skills/{name}`
**CLI:** `hoody agent skills delete`

---

#### `discover` — Discover agent skills

```typescript
client.agent.skills.discover()
```

**Returns:** `any`  |  **HTTP:** `GET /api/v1/exec-skills`
**CLI:** `hoody agent skills discover`

---

#### `get` — Get skill

```typescript
client.agent.skills.get(workspaceID: string, name: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/skills/{name}`
**CLI:** `hoody agent skills get`

---

#### `listMarketplace` — Browse marketplace

```typescript
client.agent.skills.listMarketplace(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/skills/marketplace`
**CLI:** `hoody agent skills marketplace`

---

#### `toggleBuiltin` — Toggle built-in skill

```typescript
client.agent.skills.toggleBuiltin(workspaceID: string, name: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ enabled*: bool }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/skills/builtin/{name}`
**CLI:** `hoody agent skills toggle-builtin`

---

#### `update` — Partially update skill

```typescript
client.agent.skills.update(workspaceID: string, name: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ description: string, content: string, enabled: bool }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/skills/{name}`
**CLI:** `hoody agent skills update`

---

#### `upsert` — Create or update skill

```typescript
client.agent.skills.upsert(workspaceID: string, name: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `name` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ description*: string, content*: string, scope: "project" | "global"="project", enabled: bool }`

**Returns:** `any`  |  **HTTP:** `PUT /api/v1/workspaces/{workspaceID}/skills/{name}`
**CLI:** `hoody agent skills upsert`

---

### `client.agent.tools` (1) — List all tools

#### `list` — List all tools

```typescript
client.agent.tools.list(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/tools`
**CLI:** `hoody agent tools list`

---

### `client.agent.transientEnable` (1) — Transient (TTL'd) enable/disable of a rule

#### `setWorkspaceMitmRuleTransientEnabled` — Transient (TTL'd) enable/disable of a rule

```typescript
client.agent.transientEnable.setWorkspaceMitmRuleTransientEnabled(workspaceID: string, id: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ enabled*: bool, ttlMs: int=300000 }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/rules/{id}/transient-enable`
**CLI:** `hoody agent mitm rules transient-enable`

---

### `client.agent.verifiers` (1) — List configured self-tuning verifiers

#### `configListVerifiers` — List configured self-tuning verifiers

```typescript
client.agent.verifiers.configListVerifiers(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/config/verifiers`
**CLI:** `hoody agent config verifiers`

---

### `client.agent.verify` (1) — Send a synthetic webhook delivery for diagnostics

#### `verifyWorkspaceMitmWebhook` — Send a synthetic webhook delivery for diagnostics

```typescript
client.agent.verify.verifyWorkspaceMitmWebhook(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ url*: string, method: "POST" | "GET"="POST", headers: { [key: string]: string }, bodyJson: any }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/webhooks/verify`
**CLI:** `hoody agent mitm webhooks verify`

---

### `client.agent.webSearch` (1) — Get web search status

#### `getStatus` — Get web search status

```typescript
client.agent.webSearch.getStatus(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/web-search/status`
**CLI:** `hoody agent web-search status`

---

### `client.agent.workspace` (7) — Workspace

#### `bind` — Bind container to workspace

```typescript
client.agent.workspace.bind(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ containerId*: string, projectId*: string, serverNode*: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/container`
**CLI:** `hoody workspaces bind`

---

#### `unbind` — Unbind container from workspace

```typescript
client.agent.workspace.unbind(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/container`
**CLI:** `hoody workspaces unbind`

---

#### `workspacesCreate` — Create workspace entry

```typescript
client.agent.workspace.workspacesCreate(data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `data` | `object` | body | Yes |  |

**Body:** `{ worktree*: string, name: string, color: string, visible: bool, container*: { containerId*: string, projectId: string, serverName: string, serverNode: string } }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces`
**CLI:** `hoody workspaces create`

---

#### `workspacesDelete` — Delete workspace entry

```typescript
client.agent.workspace.workspacesDelete(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}`
**CLI:** `hoody workspaces delete`

---

#### `workspacesGet` — Get workspace

```typescript
client.agent.workspace.workspacesGet(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `agent_WorkspaceEnriched`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}`
**CLI:** `hoody workspaces get`

---

#### `workspacesList` — List workspaces

```typescript
client.agent.workspace.workspacesList(page?: integer, limit?: integer)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `page` | `integer` | query | No | Page number (1-indexed) |
| `limit` | `integer` | query | No | Items per page (max 200) |

**Returns:** `agent_WorkspaceListResponse`  |  **HTTP:** `GET /api/v1/workspaces`
**CLI:** `hoody workspaces list`

---

#### `workspacesUpdate` — Update workspace

```typescript
client.agent.workspace.workspacesUpdate(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ name: string, icon: { url: string, override: string, color: string }, commands: { start: string } }`

**Returns:** `agent_Project`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}`
**CLI:** `hoody workspaces update`

---

### `client.agent.workspaceMitmCooldowns` (1) — List active per-(rule,session) cooldowns

#### `listWorkspaceMitmCooldowns` — List active per-(rule,session) cooldowns

```typescript
client.agent.workspaceMitmCooldowns.listWorkspaceMitmCooldowns(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/cooldowns`
**CLI:** `hoody agent mitm cooldowns`

---

### `client.agent.workspaceMitmLogEntry` (1) — Get single MITM log entry (redacted by default)

#### `getWorkspaceMitmLogEntry` — Get single MITM log entry (redacted by default)

```typescript
client.agent.workspaceMitmLogEntry.getWorkspaceMitmLogEntry(workspaceID: string, id: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/logs/{id}`
**CLI:** `hoody agent mitm logs get`

---

### `client.agent.workspaceMitmLogsPaginated` (1) — Paginated MITM log (redacted)

#### `listWorkspaceMitmLogsPaginated` — Paginated MITM log (redacted)

```typescript
client.agent.workspaceMitmLogsPaginated.listWorkspaceMitmLogsPaginated(page?: integer, limit?: integer, sessionID?: string, workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `page` | `integer` | query | No |  |
| `limit` | `integer` | query | No |  |
| `sessionID` | `string` | query | No |  |
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/logs`
**CLI:** `hoody agent mitm logs list`

---

### `client.agent.workspaceMitmPluginDescriptors` (1) — List plugin descriptors

#### `listWorkspaceMitmPluginDescriptors` — List plugin descriptors

```typescript
client.agent.workspaceMitmPluginDescriptors.listWorkspaceMitmPluginDescriptors(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/plugin-descriptors`
**CLI:** `hoody agent mitm plugin-descriptors`

---

### `client.agent.workspaceMitmRule` (3) — Workspace Mitm Rule operations

#### `createWorkspaceMitmRule` — Create overlay rule

```typescript
client.agent.workspaceMitmRule.createWorkspaceMitmRule(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ id*: string, name*: string, enabled: bool=true, description: string, severity: "info" | "warn" | "error" | "critical", trigger*: { event*: "session.created" | "session.idle" | "session.error" | "chat.message" | "tool.execute.before" | "tool.execute.after" | "chat.system.transform", tags: string[], toolName: string, role: "user" | "assistant", contentMatch: string }, action*: object, cooldownMs: number=0, maxDepth: number=1, blocking: bool=false }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/rules`
**CLI:** `hoody agent mitm rules create`

---

#### `deleteWorkspaceMitmRule` — Delete overlay rule (or tombstone a base rule)

```typescript
client.agent.workspaceMitmRule.deleteWorkspaceMitmRule(workspaceID: string, id: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |

**Returns:** `void`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/mitm/rules/{id}`
**CLI:** `hoody agent mitm rules delete`

---

#### `patchWorkspaceMitmRule` — Patch overlay rule (partial)

```typescript
client.agent.workspaceMitmRule.patchWorkspaceMitmRule(workspaceID: string, id: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ [key: string]: any }`

**Returns:** `any`  |  **HTTP:** `PATCH /api/v1/workspaces/{workspaceID}/mitm/rules/{id}`
**CLI:** `hoody agent mitm rules patch`

---

### `client.agent.workspaceMitmRules` (1) — List effective MITM rules

#### `listWorkspaceMitmRules` — List effective MITM rules

```typescript
client.agent.workspaceMitmRules.listWorkspaceMitmRules(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/rules`
**CLI:** `hoody agent mitm rules list`

---

### `client.agent.workspaceMitmSnapshot` (1) — Get effective MITM state

#### `getWorkspaceMitmSnapshot` — Get effective MITM state

```typescript
client.agent.workspaceMitmSnapshot.getWorkspaceMitmSnapshot(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/snapshot`
**CLI:** `hoody agent mitm snapshot`

---

### `client.agent.workspaceMitmTag` (2) — Workspace Mitm Tag operations

#### `createWorkspaceMitmTag` — Create overlay tag

```typescript
client.agent.workspaceMitmTag.createWorkspaceMitmTag(workspaceID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ id*: string, label*: string, description: string="", color: "green" | "blue" | "yellow" | "purple" | "red" | "orange" | "gray"="gray" }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/mitm/tags`
**CLI:** `hoody agent mitm tags create`

---

#### `deleteWorkspaceMitmTag` — Delete overlay tag (or tombstone a base tag)

```typescript
client.agent.workspaceMitmTag.deleteWorkspaceMitmTag(workspaceID: string, id: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `id` | `string` | path | Yes |  |

**Returns:** `void`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/mitm/tags/{id}`
**CLI:** `hoody agent mitm tags delete`

---

### `client.agent.workspaceMitmTags` (1) — List effective MITM tags

#### `listWorkspaceMitmTags` — List effective MITM tags

```typescript
client.agent.workspaceMitmTags.listWorkspaceMitmTags(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/tags`
**CLI:** `hoody agent mitm tags list`

---

### `client.agent.workspaceMitmValidationRules` (1) — Introspect MITM rule validation constraints

#### `listWorkspaceMitmValidationRules` — Introspect MITM rule validation constraints

```typescript
client.agent.workspaceMitmValidationRules.listWorkspaceMitmValidationRules(workspaceID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/mitm/validation-rules`
**CLI:** `hoody agent mitm validation-rules`

---

### `client.agent.workspaceSession` (22) — Workspace Session

#### `sessionsAutocontext` — Gather conversation context (on-demand, stateless)

```typescript
client.agent.workspaceSession.sessionsAutocontext(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ model: { providerID*: string, modelID*: string }, window: int, system: string, depth: "conversation" | "repo" }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/autocontext`

---

#### `sessionsCliAgentStart` — Start a CLI agent run on a session

```typescript
client.agent.workspaceSession.sessionsCliAgentStart(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ agent*: string, prompt*: string, model: string, git: bool, timeout: int }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/cli-agent`
**CLI:** `hoody agent sessions cli-agent start`

---

#### `sessionsCliAgentStream` — SSE progress stream for a CLI agent run

```typescript
client.agent.workspaceSession.sessionsCliAgentStream(workspaceID: string, sessionID: string, jobID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `jobID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/cli-agent/runs/{jobID}/stream`
**CLI:** `hoody agent sessions cli-agent stream`

---

#### `sessionsFollowup` — Suggest a follow-up question (on-demand, stateless)

```typescript
client.agent.workspaceSession.sessionsFollowup(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ model: { providerID*: string, modelID*: string }, window: int, system: string }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/followup`

---

#### `sessionsGetPermissions` — Get effective permission ruleset for a session

```typescript
client.agent.workspaceSession.sessionsGetPermissions(agent?: string, workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `agent` | `string` | query | No |  |
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `agent_WsSessionPermissions`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/permissions`

---

#### `sessionsGetToolCall` — Get a tool-call result by callID

```typescript
client.agent.workspaceSession.sessionsGetToolCall(workspaceID: string, sessionID: string, messageID: string, callID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `messageID` | `string` | path | Yes |  |
| `callID` | `string` | path | Yes | Tool-call ID |

**Returns:** `agent_ToolPart`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/messages/{messageID}/tools/{callID}`

---

#### `sessionsJobsCancel` — Cancel a background job

```typescript
client.agent.workspaceSession.sessionsJobsCancel(workspaceID: string, sessionID: string, jobId: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `jobId` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/jobs/{jobId}/cancel`

---

#### `sessionsJobsCancelBulk` — Cancel multiple background jobs

```typescript
client.agent.workspaceSession.sessionsJobsCancelBulk(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ jobIds*: string[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/jobs/cancel`

---

#### `sessionsJobsGet` — Get a background job by ID

```typescript
client.agent.workspaceSession.sessionsJobsGet(workspaceID: string, sessionID: string, jobId: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `jobId` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/jobs/{jobId}`

---

#### `sessionsJobsGetOutput` — Get full output of a background job

```typescript
client.agent.workspaceSession.sessionsJobsGetOutput(workspaceID: string, sessionID: string, jobId: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `jobId` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/jobs/{jobId}/output`

---

#### `sessionsJobsInject` — Inject completed job results into the session context

```typescript
client.agent.workspaceSession.sessionsJobsInject(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ jobIds: string[] }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/jobs/inject`

---

#### `sessionsJobsList` — List background jobs for a session

```typescript
client.agent.workspaceSession.sessionsJobsList(status?: string, limit?: integer, cursor?: string, workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `status` | `string` | query | No |  |
| `limit` | `integer` | query | No | Max jobs to return per page. Defaults to no cap (returns the full filtered set). |
| `cursor` | `string` | query | No | Pagination cursor. Pass the previous response's `nextCursor` to fetch the next page. Cursor is the last seen job ID; jobs are sorted ascending by creation time, so results begin at the job AFTER `cursor`. |
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/jobs`

---

#### `sessionsJobsRetry` — Retry a terminal-failed background job

```typescript
client.agent.workspaceSession.sessionsJobsRetry(workspaceID: string, sessionID: string, jobId: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes |  |
| `sessionID` | `string` | path | Yes |  |
| `jobId` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/jobs/{jobId}/retry`

---

#### `sessionsLoopClear` — Stop the active session loop

```typescript
client.agent.workspaceSession.sessionsLoopClear(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/loop`

---

#### `sessionsLoopInstall` — Start a session loop

```typescript
client.agent.workspaceSession.sessionsLoopInstall(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ prompt*: string, iters*: int, stop_when: string, target: "self" | "child", agent: string, model: { providerID*: string, modelID*: string }, label: string, interval_ms: int }`

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/loop`

---

#### `sessionsLoopPeek` — Get active session loop directive

```typescript
client.agent.workspaceSession.sessionsLoopPeek(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/loop`

---

#### `sessionsQueueClear` — Clear the queue

```typescript
client.agent.workspaceSession.sessionsQueueClear(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/queue`

---

#### `sessionsQueueDeleteEntry` — Delete a queued message

```typescript
client.agent.workspaceSession.sessionsQueueDeleteEntry(workspaceID: string, sessionID: string, entryID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `entryID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `DELETE /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/queue/{entryID}`

---

#### `sessionsQueueEnqueue` — Enqueue a message while busy

```typescript
client.agent.workspaceSession.sessionsQueueEnqueue(workspaceID: string, sessionID: string, data: object)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `data` | `object` | body | Yes |  |

**Body:** `{ userParts: { type*: string }[], syntheticParts: { type*: string }[], agent*: string, model*: { providerID*: string, modelID*: string }, system: string, container: { containerId*: string, projectId*: string, serverNode*: string } }`

**Returns:** `agent_SessionQueueEntry`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/queue`

---

#### `sessionsQueueFlush` — Send the queue now

```typescript
client.agent.workspaceSession.sessionsQueueFlush(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/queue/flush`

---

#### `sessionsQueueList` — List queued messages

```typescript
client.agent.workspaceSession.sessionsQueueList(workspaceID: string, sessionID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/queue`

---

#### `sessionsStreamMessage` — Stream live updates for a single message via SSE

```typescript
client.agent.workspaceSession.sessionsStreamMessage(workspaceID: string, sessionID: string, messageID: string)
```

| Parameter | Type | In | Required | Description |
|-----------|------|------|----------|-------------|
| `workspaceID` | `string` | path | Yes | Workspace identifier (project ID or workspace entry ID; 24-char lowercase hex) |
| `sessionID` | `string` | path | Yes |  |
| `messageID` | `string` | path | Yes |  |

**Returns:** `any`  |  **HTTP:** `GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/messages/{messageID}/stream`


### Body schemas

- `agent_PermissionRuleset` — `agent_PermissionRule[]`
- `agent_TextPartInput` — `{ id: string, type*: "text", text*: string, synthetic: bool, ignored: bool, time: { start*: number, end: number }, metadata: { [key: string]: any } }`
- `agent_FilePartInput` — `{ id: string, type*: "file", mime*: string, filename: string, url*: string, source: agent_FilePartSource }`
- `agent_AgentPartInput` — `{ id: string, type*: "agent", name*: string, source: { value*: string, start*: int, end*: int } }`
- `agent_SubtaskPartInput` — `{ id: string, type*: "subtask", prompt*: string, description*: string, agent*: string, model: { providerID*: string, modelID*: string }, command: string }`
- `agent_FilePartSource` — `agent_FileSource | agent_SymbolSource | agent_ResourceSource`
- `agent_Part` — `agent_TextPart | agent_SubtaskPart | agent_ReasoningPart | agent_FilePart | agent_ToolPart | agent_JobResultPart | agent_StepStartPart | agent_StepFinishPart | agent_SnapshotPart | agent_PatchPart | agent_AgentPart | agent_RetryPart | agent_CompactionPart`
- `agent_PermissionRuleConfig` — `agent_PermissionActionConfig | agent_PermissionObjectConfig`
- `agent_ProviderConfig` — `{ api: string, name: string, env: string[], id: string, npm: string, models: { [key: string]: { id: string, name: string, family: string, release_date: string, attachment: bool, reasoning: bool, temperature: bool, tool_call: bool, interleaved: true | object, cost: object, limit: object, modalities: object, experimental: bool, status: "alpha" | "beta" | "deprecated", options: object, headers: object, provider: object, variants: object } }, whitelist: string[], blacklist: string[], options: { apiKey: string, baseURL: string, enterpriseUrl: string, setCacheKey: bool, timeout: int | false } }`
- `agent_McpLocalConfig` — `{ type*: "local", command*: string[], environment: { [key: string]: string }, enabled: bool, timeout: int }`
- `agent_McpRemoteConfig` — `{ type*: "remote", url*: string, enabled: bool, headers: { [key: string]: string }, oauth: agent_McpOAuthConfig | false, timeout: int }`
- `agent_QuestionAnswer` — `string[]`
- `agent_PushInput` — `{ remote: string, force: bool, setUpstream: bool }`
- `agent_PullInput` — `{ remote: string }`
- `agent_CreatePRInput` — `{ title*: string, body: string, target: string, draft: bool }`
- `agent_PermissionRule` — `{ permission*: string, pattern*: string, action*: agent_PermissionAction }`
- `agent_FileSource` — `{ text*: agent_FilePartSourceText, type*: "file", path*: string }`
- `agent_SymbolSource` — `{ text*: agent_FilePartSourceText, type*: "symbol", path*: string, range*: agent_Range, name*: string, kind*: int }`
- `agent_ResourceSource` — `{ text*: agent_FilePartSourceText, type*: "resource", clientName*: string, uri*: string }`
- `agent_TextPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "text", text*: string, synthetic: bool, ignored: bool, time: { start*: number, end: number }, metadata: { [key: string]: any } }`
- `agent_SubtaskPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "subtask", prompt*: string, description*: string, agent*: string, model: { providerID*: string, modelID*: string }, command: string }`
- `agent_ReasoningPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "reasoning", text*: string, metadata: { [key: string]: any }, time*: { start*: number, end: number } }`
- `agent_FilePart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "file", mime*: string, filename: string, url*: string, source: agent_FilePartSource }`
- `agent_ToolPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "tool", callID*: string, tool*: string, state*: agent_ToolState, metadata: { [key: string]: any } }`
- `agent_JobResultPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "job-result", jobId*: string, originCallID*: string, tool*: string, status*: "completed" | "failed" | "cancelled" | "expired", summary*: string, attachments: { mime*: string, url*: string }[] }`
- `agent_StepStartPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "step-start", snapshot: string }`
- `agent_StepFinishPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "step-finish", reason*: string, snapshot: string, cost*: number, tokens*: { total: number, input*: number, output*: number, reasoning*: number, cache*: object } }`
- `agent_SnapshotPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "snapshot", snapshot*: string }`
- `agent_PatchPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "patch", hash*: string, files*: string[] }`
- `agent_AgentPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "agent", name*: string, source: { value*: string, start*: int, end*: int } }`
- `agent_RetryPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "retry", attempt*: number, error*: agent_APIError, time*: { created*: number } }`
- `agent_CompactionPart` — `{ id*: string, sessionID*: string, messageID*: string, type*: "compaction", auto*: bool, systemPrompt: string }`
- `agent_PermissionActionConfig` — `"ask" | "allow" | "deny"`
- `agent_PermissionObjectConfig` — `{ [key: string]: agent_PermissionActionConfig }`
- `agent_McpOAuthConfig` — `{ clientId: string, clientSecret: string, scope: string }`
- `agent_PermissionAction` — `"allow" | "deny" | "ask"`
- `agent_FilePartSourceText` — `{ value*: string, start*: int, end*: int }`
- `agent_Range` — `{ start*: { line*: number, character*: number }, end*: { line*: number, character*: number } }`
- `agent_ToolState` — `agent_ToolStatePending | agent_ToolStateRunning | agent_ToolStateCompleted | agent_ToolStateError | agent_ToolStateBackgrounded`
- `agent_APIError` — `{ name*: "APIError", data*: { message*: string, statusCode: number, isRetryable*: bool, responseHeaders: object, responseBody: string, metadata: object } }`
- `agent_ToolStatePending` — `{ status*: "pending", input*: { [key: string]: any }, raw*: string }`
- `agent_ToolStateRunning` — `{ status*: "running", input*: { [key: string]: any }, title: string, metadata: { [key: string]: any }, time*: { start*: number } }`
- `agent_ToolStateCompleted` — `{ status*: "completed", input*: { [key: string]: any }, output*: string, title*: string, metadata*: { [key: string]: any }, time*: { start*: number, end*: number, compacted: number }, attachments: agent_FilePart[] }`
- `agent_ToolStateError` — `{ status*: "error", input*: { [key: string]: any }, error*: string, metadata: { [key: string]: any }, time*: { start*: number, end*: number } }`
- `agent_ToolStateBackgrounded` — `{ status*: "backgrounded", input*: { [key: string]: any }, output*: string, title*: string, metadata*: { [key: string]: any }, jobId*: string, time*: { start*: number, backgrounded*: number, compacted: number } }`

