import type { BriefTask, PagedResult } from "./schema.js"; import type { BriefApiClientOptions } from "./types.js"; /** * Tasks resource on the Brief API. * * Naming note: the Content Operations UI — and scai's CLI/MCP surface — * label these "to-dos". The wire resource is `tasks`; the SDK names below * mirror the wire for fidelity. The user-facing surface is `todos` * (`scai ops brief todos`, `runBriefTodosList`, MCP verb 'todos'). * * Endpoint surface (reverse-engineered): * GET /api/brief/v1/tasks?BriefId=&MetadataToLoad=assignees * * Known query parameters: * - `BriefId` (uuid) — filters tasks to a single brief. Optional — * the bare endpoint returns the tenant-wide task list. * - `MetadataToLoad` (csv) — expand directives. Confirmed: `assignees`. * Other valid values TBD. * - `Limit` (int) — page size. * - `Next` (string) — pagination cursor from the previous response. * * The task object shape is provisional — the probe tenant had zero * tasks at discovery time. Tighten `BriefTask` in `./schema.ts` once * a payload is captured. */ /** Metadata expansion options for task list responses. */ export type BriefTaskMetadata = "assignees"; export type ListBriefTasksQuery = { /** Filter to one brief. Omit for tenant-wide list. */ briefId?: string; /** Expand directives — e.g. `["assignees"]`. */ metadataToLoad?: BriefTaskMetadata[]; /** Page size. */ limit?: number; /** Cursor from previous response. */ next?: string; }; /** List tasks (optionally filtered by brief). */ export declare const listBriefTasks: (options: BriefApiClientOptions, query?: ListBriefTasksQuery) => Promise>; /** Read a single task by id. **Untested** — inferred from REST conventions. */ export declare const getBriefTask: (options: BriefApiClientOptions, taskId: string) => Promise; /** * Delete a single task by id (`DELETE /api/brief/v1/tasks/{id}`). Used by * `briefInstanceKind.apply` to implement full-replace semantics for the * `todos` field — list existing tasks, delete them, re-create from the * recipe. Verified against TestDemo 2026-06-04 (returns 2xx; the deleted * task disappears from the subsequent list response while sibling tasks * on the same brief survive). See `scripts/probe-delete-brief-task.ts`. */ export declare const deleteBriefTask: (options: BriefApiClientOptions, taskId: string) => Promise; /** * Input for `createBriefTask` — the verb behind "post a to-do". * * Verified against TestDemo 2026-06-03. The persisted task carries * `{id, title, status, assignees, brief, createdOn, createdBy, * updatedOn, updatedBy}` — nothing else. Probed fields that are * silently dropped: `description`, `body`, `dueDate`, `DueOn`. The * `status` field is locked to `"Pending"` on create regardless of * what's posted (server overrides). To set status, fall back to the * (unverified) PATCH endpoint after create. */ export type CreateBriefTaskInput = { /** Brief the to-do attaches to. */ briefId: string; /** Short verb phrase shown in the brief's to-do list. Required. */ title: string; /** * Auth0 subjects of the users the to-do is assigned to. Optional. * Note the wire name is `assigneeIds` on create; the read response * projects them as a `assignees: Reference[]` array. */ assigneeIds?: string[]; }; /** * Post a to-do to a brief (`POST /api/brief/v1/tasks`). Returns the * persisted task on success. The Brief API's task shape is minimal — * no description, no due date — so the title carries the full * intent. See `CreateBriefTaskInput` for the verified field set. */ export declare const createBriefTask: (options: BriefApiClientOptions, input: CreateBriefTaskInput) => Promise;