@lanework/contracts 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-notes.d.ts +30 -0
- package/dist/auth.d.ts +205 -0
- package/dist/avatar.d.ts +42 -0
- package/dist/boards.d.ts +809 -0
- package/dist/checkpoints.d.ts +86 -0
- package/dist/common.d.ts +54 -0
- package/dist/endpoints.d.ts +146 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1540 -0
- package/dist/sync.d.ts +147 -0
- package/dist/tools/board.d.ts +159 -0
- package/dist/tools/control.d.ts +52 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/instructions.d.ts +12 -0
- package/dist/tools/kit.d.ts +123 -0
- package/dist/tools/outputs.d.ts +21 -0
- package/dist/tools/schema.d.ts +78 -0
- package/package.json +10 -2
package/dist/boards.d.ts
ADDED
|
@@ -0,0 +1,809 @@
|
|
|
1
|
+
import type { IsoDate } from "./common";
|
|
2
|
+
export declare const WORK_ITEM_TYPES: readonly ["epic", "issue", "task"];
|
|
3
|
+
export type WorkItemType = (typeof WORK_ITEM_TYPES)[number];
|
|
4
|
+
export declare const PRIORITIES: readonly ["low", "medium", "high"];
|
|
5
|
+
export type Priority = (typeof PRIORITIES)[number];
|
|
6
|
+
export declare const CHECKLIST_SECTIONS: readonly ["decisions", "verify"];
|
|
7
|
+
export type ChecklistSection = (typeof CHECKLIST_SECTIONS)[number];
|
|
8
|
+
/**
|
|
9
|
+
* What a lane DOES, in board order.
|
|
10
|
+
*
|
|
11
|
+
* `review` (BE-23) holds a card whose code is written and waits for a human:
|
|
12
|
+
* no presence, no lifecycle stamp, never stale. Moving a card from a `review`
|
|
13
|
+
* lane back to an `active` one requests changes and carries a reason.
|
|
14
|
+
*/
|
|
15
|
+
export declare const COLUMN_ROLES: readonly ["intake", "start", "active", "review", "done", "archive"];
|
|
16
|
+
export type ColumnRole = (typeof COLUMN_ROLES)[number];
|
|
17
|
+
/**
|
|
18
|
+
* The link kinds a caller may send.
|
|
19
|
+
*
|
|
20
|
+
* `blocked_by` is input only; it is stored flipped.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LINK_TYPES: readonly ["blocks", "blocked_by", "relates", "duplicates"];
|
|
23
|
+
export type LinkType = (typeof LINK_TYPES)[number];
|
|
24
|
+
export declare const STREAM_ROLES: readonly ["research", "implement", "test"];
|
|
25
|
+
export type StreamRole = (typeof STREAM_ROLES)[number];
|
|
26
|
+
export declare const STREAM_ISOLATIONS: readonly ["worktree", "shared"];
|
|
27
|
+
export type StreamIsolation = (typeof STREAM_ISOLATIONS)[number];
|
|
28
|
+
/** Who did something: a signed-in human, a machine credential, or an agent. */
|
|
29
|
+
export type ActorKind = "user" | "machine" | "agent";
|
|
30
|
+
/** The longest request-changes reason a move accepts (BE-23). */
|
|
31
|
+
export declare const MAX_CHANGES_REASON = 2000;
|
|
32
|
+
/** The page size the list routes serve by default, and their ceiling. */
|
|
33
|
+
export declare const DEFAULT_LIMIT = 50;
|
|
34
|
+
export declare const MAX_LIMIT = 200;
|
|
35
|
+
export interface BoardColumn {
|
|
36
|
+
key: string;
|
|
37
|
+
name: string;
|
|
38
|
+
role: ColumnRole | null;
|
|
39
|
+
icon: string;
|
|
40
|
+
tone: string;
|
|
41
|
+
position: number;
|
|
42
|
+
}
|
|
43
|
+
export interface BoardCategory {
|
|
44
|
+
key: string;
|
|
45
|
+
name: string;
|
|
46
|
+
/** e.g. `BE`. */
|
|
47
|
+
prefix: string;
|
|
48
|
+
/** e.g. `{prefix}-{seq}`. */
|
|
49
|
+
format: string;
|
|
50
|
+
pad: number;
|
|
51
|
+
tone: string;
|
|
52
|
+
position: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* One entry of the label vocabulary.
|
|
56
|
+
*
|
|
57
|
+
* `key` is a normalized tag.
|
|
58
|
+
*/
|
|
59
|
+
export interface BoardLabel {
|
|
60
|
+
key: string;
|
|
61
|
+
name: string;
|
|
62
|
+
tone: string;
|
|
63
|
+
position: number;
|
|
64
|
+
}
|
|
65
|
+
/** How many tags a card may carry (`0` = uncapped), and which (empty = any). */
|
|
66
|
+
export interface TagPolicy {
|
|
67
|
+
max: number;
|
|
68
|
+
allowed: string[];
|
|
69
|
+
}
|
|
70
|
+
/** A member as every avatar surface reads it: no email, by design. */
|
|
71
|
+
export interface BoardMember {
|
|
72
|
+
userId: string;
|
|
73
|
+
name: string;
|
|
74
|
+
image: string | null;
|
|
75
|
+
role: string;
|
|
76
|
+
}
|
|
77
|
+
/** `GET /v1/boards/:workspaceId/config` → `{ board }`. */
|
|
78
|
+
export interface BoardConfig {
|
|
79
|
+
workspaceId: string;
|
|
80
|
+
/** The caller's membership; only `owner` may write the config. */
|
|
81
|
+
role: string;
|
|
82
|
+
changeSeq: number;
|
|
83
|
+
/** When this board became the source of truth for its repo, or null. */
|
|
84
|
+
migratedAt: IsoDate | null;
|
|
85
|
+
tags: TagPolicy;
|
|
86
|
+
columns: BoardColumn[];
|
|
87
|
+
categories: BoardCategory[];
|
|
88
|
+
labels: BoardLabel[];
|
|
89
|
+
members: BoardMember[];
|
|
90
|
+
}
|
|
91
|
+
export interface BoardConfigResponse {
|
|
92
|
+
board: BoardConfig;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* `PUT /v1/boards/:workspaceId/config`: replace lanes and categories.
|
|
96
|
+
*
|
|
97
|
+
* Owner only.
|
|
98
|
+
*/
|
|
99
|
+
export interface BoardConfigRequest {
|
|
100
|
+
columns: BoardColumn[];
|
|
101
|
+
categories: BoardCategory[];
|
|
102
|
+
tags: TagPolicy;
|
|
103
|
+
/** Absent leaves the vocabulary as it is; `[]` clears it. */
|
|
104
|
+
labels?: BoardLabel[];
|
|
105
|
+
/**
|
|
106
|
+
* Removed lane key → the lane its cards move to.
|
|
107
|
+
*
|
|
108
|
+
* Required for a non-empty lane.
|
|
109
|
+
*/
|
|
110
|
+
reassign?: Record<string, string>;
|
|
111
|
+
}
|
|
112
|
+
export interface BoardConfigPutResponse {
|
|
113
|
+
board: BoardConfig | null;
|
|
114
|
+
seq: number;
|
|
115
|
+
}
|
|
116
|
+
/** 409 from `PUT /config` when a removed lane still holds cards. */
|
|
117
|
+
export interface BoardConfigOrphansError {
|
|
118
|
+
error: string;
|
|
119
|
+
orphans: {
|
|
120
|
+
column: string;
|
|
121
|
+
cards: number;
|
|
122
|
+
}[];
|
|
123
|
+
}
|
|
124
|
+
/** One row of `GET /v1/boards?repo=<git remote url>`. */
|
|
125
|
+
export interface BoardSummary {
|
|
126
|
+
workspaceId: string;
|
|
127
|
+
name: string;
|
|
128
|
+
role: string;
|
|
129
|
+
changeSeq: number;
|
|
130
|
+
/** `host/owner/name`, or null. */
|
|
131
|
+
repo: string | null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* `GET /v1/boards?repo=`: the boards linked to a repo.
|
|
135
|
+
*
|
|
136
|
+
* `repo` is required; a remote the server cannot read is a 400. Callers act
|
|
137
|
+
* only when there is exactly one.
|
|
138
|
+
*/
|
|
139
|
+
export interface BoardsForRepoResponse {
|
|
140
|
+
/** The normalized form of the remote that was sent. */
|
|
141
|
+
repo: string;
|
|
142
|
+
boards: BoardSummary[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* `PUT /v1/boards/:workspaceId/repo`: make this board the one for a repo.
|
|
146
|
+
*
|
|
147
|
+
* Links it, and unlinks the caller's other boards that have it.
|
|
148
|
+
*/
|
|
149
|
+
export interface BoardRepoRequest {
|
|
150
|
+
/** A git remote URL, as `git remote get-url origin` prints it. */
|
|
151
|
+
repo: string;
|
|
152
|
+
/** Move this board off a different repo it is linked to now. */
|
|
153
|
+
replace?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface BoardRepoResponse {
|
|
156
|
+
/** The normalized repo, `host/owner/name`. */
|
|
157
|
+
repo: string;
|
|
158
|
+
/** What this board was linked to before, or null. */
|
|
159
|
+
previous: string | null;
|
|
160
|
+
/** The caller's other boards the repo was taken off. */
|
|
161
|
+
unlinked: {
|
|
162
|
+
workspaceId: string;
|
|
163
|
+
name: string;
|
|
164
|
+
}[];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 409 from `PUT /repo`.
|
|
168
|
+
*
|
|
169
|
+
* `linked` is the repo this board is on now, when that is why it refused:
|
|
170
|
+
* ask, then send `replace`. Null when another board is the reason (one only
|
|
171
|
+
* its owner can unlink).
|
|
172
|
+
*/
|
|
173
|
+
export interface BoardRepoConflictError {
|
|
174
|
+
error: string;
|
|
175
|
+
code: "conflict";
|
|
176
|
+
linked: string | null;
|
|
177
|
+
}
|
|
178
|
+
export interface ChecklistProgress {
|
|
179
|
+
done: number;
|
|
180
|
+
total: number;
|
|
181
|
+
}
|
|
182
|
+
export interface ChecklistItem {
|
|
183
|
+
key: string;
|
|
184
|
+
section: ChecklistSection;
|
|
185
|
+
text: string;
|
|
186
|
+
checked: boolean;
|
|
187
|
+
checkedAt: IsoDate | null;
|
|
188
|
+
note: string | null;
|
|
189
|
+
group: string | null;
|
|
190
|
+
/** The stream key this verify item proves, or null for the lead's. */
|
|
191
|
+
stream: string | null;
|
|
192
|
+
/**
|
|
193
|
+
* Who ticked it (BE-22), or null when it is unticked or was ticked before
|
|
194
|
+
* BE-22 recorded it (read that as a person's tick).
|
|
195
|
+
*
|
|
196
|
+
* NOTE: Optional because a service older than BE-22, and the desktop's
|
|
197
|
+
* local board, never send it; absent and null read the same.
|
|
198
|
+
*/
|
|
199
|
+
checkedBy?: ChecklistTickBy | null;
|
|
200
|
+
/** What proved this verify item (BE-22), or null. Optional as above. */
|
|
201
|
+
evidence?: ChecklistEvidence | null;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Who ticked a box (BE-22).
|
|
205
|
+
*
|
|
206
|
+
* `agent` is the agent's slug for `kind: "agent"`; null for a person. The
|
|
207
|
+
* desktop app ticks as a person.
|
|
208
|
+
*/
|
|
209
|
+
export interface ChecklistTickBy {
|
|
210
|
+
kind: "agent" | "user";
|
|
211
|
+
agent: string | null;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* What an agent ran to prove a verify item (BE-22).
|
|
215
|
+
*
|
|
216
|
+
* `ok` is the agent's own report; the server does not re-run the command.
|
|
217
|
+
*/
|
|
218
|
+
export interface ChecklistEvidence {
|
|
219
|
+
command: string;
|
|
220
|
+
ok: boolean;
|
|
221
|
+
/** A CI run or log, when there is one. */
|
|
222
|
+
url?: string;
|
|
223
|
+
}
|
|
224
|
+
/** A stream as stored and served. */
|
|
225
|
+
export interface Stream {
|
|
226
|
+
key: string;
|
|
227
|
+
title: string;
|
|
228
|
+
goal: string;
|
|
229
|
+
role: StreamRole;
|
|
230
|
+
owns: string[];
|
|
231
|
+
reads: string[];
|
|
232
|
+
dependsOn: string[];
|
|
233
|
+
isolation: StreamIsolation;
|
|
234
|
+
position: number;
|
|
235
|
+
}
|
|
236
|
+
/** How a lead runs a card with streams: who goes when, and each one's brief. */
|
|
237
|
+
export interface Dispatch {
|
|
238
|
+
waves: string[][];
|
|
239
|
+
briefs: Record<string, string>;
|
|
240
|
+
}
|
|
241
|
+
export interface CardSource {
|
|
242
|
+
kind: string;
|
|
243
|
+
ref: string | null;
|
|
244
|
+
checksum: string | null;
|
|
245
|
+
}
|
|
246
|
+
export interface CardAssignees {
|
|
247
|
+
users: string[];
|
|
248
|
+
agents: string[];
|
|
249
|
+
}
|
|
250
|
+
export interface CardLink {
|
|
251
|
+
id: string;
|
|
252
|
+
/** `blocked_by` appears only as the incoming side of a `blocks` row. */
|
|
253
|
+
type: LinkType;
|
|
254
|
+
direction: "outgoing" | "incoming";
|
|
255
|
+
itemId: string;
|
|
256
|
+
}
|
|
257
|
+
export interface CardAttachment {
|
|
258
|
+
id: string;
|
|
259
|
+
name: string;
|
|
260
|
+
reference: string;
|
|
261
|
+
mimeType: string | null;
|
|
262
|
+
sizeBytes: number | null;
|
|
263
|
+
sourceKind: string | null;
|
|
264
|
+
}
|
|
265
|
+
/** A card as a list page, the change feed and every write state it. */
|
|
266
|
+
export interface Card {
|
|
267
|
+
id: string;
|
|
268
|
+
workspaceId: string;
|
|
269
|
+
seq: number;
|
|
270
|
+
/** The `If-Match` precondition for edits; also the `ETag`. */
|
|
271
|
+
revision: number;
|
|
272
|
+
type: WorkItemType;
|
|
273
|
+
parentId: string | null;
|
|
274
|
+
columnKey: string;
|
|
275
|
+
rank: string;
|
|
276
|
+
title: string;
|
|
277
|
+
body: string;
|
|
278
|
+
priority: Priority | null;
|
|
279
|
+
estimate: number | null;
|
|
280
|
+
categoryKey: string | null;
|
|
281
|
+
taskId: string | null;
|
|
282
|
+
tags: string[];
|
|
283
|
+
checklistProgress: ChecklistProgress;
|
|
284
|
+
/** Always present; `[]` when the card has no plan. */
|
|
285
|
+
streams: Stream[];
|
|
286
|
+
metadata: Record<string, unknown> | null;
|
|
287
|
+
source: CardSource | null;
|
|
288
|
+
createdAt: IsoDate | null;
|
|
289
|
+
updatedAt: IsoDate | null;
|
|
290
|
+
startedAt: IsoDate | null;
|
|
291
|
+
completedAt: IsoDate | null;
|
|
292
|
+
dueAt: IsoDate | null;
|
|
293
|
+
archivedAt: IsoDate | null;
|
|
294
|
+
/**
|
|
295
|
+
* Set while the card sits in an `active` lane with no agent heard from for
|
|
296
|
+
* a while (BE-21); null when it is not stale.
|
|
297
|
+
*
|
|
298
|
+
* Optional: a service older than BE-21 never sends it. Read absent as null.
|
|
299
|
+
*/
|
|
300
|
+
stale?: CardStale | null;
|
|
301
|
+
/**
|
|
302
|
+
* The outstanding request for changes (BE-23): the newest lane change, when
|
|
303
|
+
* it sent the card back from Review with a reason. Null once the card moves
|
|
304
|
+
* again. On list reads too, so a list can mark the card.
|
|
305
|
+
*
|
|
306
|
+
* Optional: a service older than BE-23 never sends it, and one older than
|
|
307
|
+
* the list extension sends it on single-card reads only. Read absent as
|
|
308
|
+
* null.
|
|
309
|
+
*/
|
|
310
|
+
changesRequested?: ChangesRequested | null;
|
|
311
|
+
}
|
|
312
|
+
/** Why a card counts as stale: since when, and the last agent seen on it. */
|
|
313
|
+
export interface CardStale {
|
|
314
|
+
since: IsoDate;
|
|
315
|
+
/** The agent slug last heard from, or null when none ever was. */
|
|
316
|
+
lastAgent: string | null;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* A card as a single-card read states it: the list shape plus its parts.
|
|
320
|
+
*
|
|
321
|
+
* NOTE: Clients tell the two apart by whether `checklist` is present.
|
|
322
|
+
*/
|
|
323
|
+
export interface CardDetail extends Card {
|
|
324
|
+
checklist: ChecklistItem[];
|
|
325
|
+
/** Null when the card has no streams. */
|
|
326
|
+
dispatch: Dispatch | null;
|
|
327
|
+
assignees: CardAssignees;
|
|
328
|
+
links: CardLink[];
|
|
329
|
+
attachments: CardAttachment[];
|
|
330
|
+
/** User ids following the card. */
|
|
331
|
+
subscribers: string[];
|
|
332
|
+
/** Whether the caller follows it. */
|
|
333
|
+
subscribed: boolean;
|
|
334
|
+
/** Whether the caller starred it. */
|
|
335
|
+
favorite: boolean;
|
|
336
|
+
commentCount: number;
|
|
337
|
+
}
|
|
338
|
+
/** A reviewer's send-back from a `review` lane to an `active` one. */
|
|
339
|
+
export interface ChangesRequested {
|
|
340
|
+
reason: string;
|
|
341
|
+
/** The lane key the card left, and the one it went to. */
|
|
342
|
+
from: string;
|
|
343
|
+
to: string;
|
|
344
|
+
at: IsoDate;
|
|
345
|
+
seq: number;
|
|
346
|
+
/** `kind` is an {@link ActorKind}, sent as free text. */
|
|
347
|
+
by: {
|
|
348
|
+
kind: string;
|
|
349
|
+
userId: string | null;
|
|
350
|
+
agent: string | null;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
/** `{ item }` with an `ETag: "<revision>"` header. */
|
|
354
|
+
export interface CardResponse {
|
|
355
|
+
item: CardDetail;
|
|
356
|
+
}
|
|
357
|
+
/** 409 when `If-Match` named a revision that is no longer current. */
|
|
358
|
+
export interface CardConflictError {
|
|
359
|
+
error: string;
|
|
360
|
+
revision: number;
|
|
361
|
+
item: CardDetail;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* The query of `GET /v1/boards/:workspaceId/items` (and `/stats`, `/lookup`).
|
|
365
|
+
*
|
|
366
|
+
* Every value is a string on the wire.
|
|
367
|
+
*/
|
|
368
|
+
export interface CardListQuery {
|
|
369
|
+
column?: string;
|
|
370
|
+
type?: WorkItemType;
|
|
371
|
+
/** A card id, or `none` for top-level cards only. */
|
|
372
|
+
parent?: string;
|
|
373
|
+
/** A category key, or `none` for cards with no category. */
|
|
374
|
+
category?: string;
|
|
375
|
+
priority?: Priority | "none";
|
|
376
|
+
tag?: string;
|
|
377
|
+
/** 2-100 characters; every word must start a word of the title or task id. */
|
|
378
|
+
q?: string;
|
|
379
|
+
/** `user:<id>` or `agent:<slug>`. */
|
|
380
|
+
assignee?: string;
|
|
381
|
+
taskId?: string;
|
|
382
|
+
/** `<kind>:<ref>`. */
|
|
383
|
+
source?: string;
|
|
384
|
+
/** `1` includes archived cards. */
|
|
385
|
+
archived?: "1";
|
|
386
|
+
/** 1-200; default 50. */
|
|
387
|
+
limit?: string;
|
|
388
|
+
/** Opaque, from the previous page. */
|
|
389
|
+
cursor?: string;
|
|
390
|
+
}
|
|
391
|
+
/** `GET /v1/boards/:workspaceId/items`, ordered by (columnKey, rank, id). */
|
|
392
|
+
export interface CardListResponse {
|
|
393
|
+
items: Card[];
|
|
394
|
+
/** Null on the last page. */
|
|
395
|
+
cursor: string | null;
|
|
396
|
+
head: number;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* `GET /v1/boards/:workspaceId/lookup?taskId=` or `?source=`.
|
|
400
|
+
*
|
|
401
|
+
* Exactly one selector. 404 when no card carries that identity.
|
|
402
|
+
*/
|
|
403
|
+
export type CardLookupResponse = CardResponse;
|
|
404
|
+
/**
|
|
405
|
+
* `GET /v1/boards/:workspaceId/stats`.
|
|
406
|
+
*
|
|
407
|
+
* Takes `column`, `category`, `priority` and `tag`.
|
|
408
|
+
*/
|
|
409
|
+
export interface BoardStats {
|
|
410
|
+
total: number;
|
|
411
|
+
byColumn: Record<string, number>;
|
|
412
|
+
/** Cards with no category are under `"none"`. */
|
|
413
|
+
byCategory: Record<string, number>;
|
|
414
|
+
/** Cards with no priority are under `"none"`. */
|
|
415
|
+
byPriority: Record<string, number>;
|
|
416
|
+
}
|
|
417
|
+
export interface BoardStatsResponse {
|
|
418
|
+
stats: BoardStats;
|
|
419
|
+
}
|
|
420
|
+
/** A board-level change: it carries no card, so a client re-reads `/config`. */
|
|
421
|
+
export interface BoardEvent {
|
|
422
|
+
seq: number;
|
|
423
|
+
verb: string;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* `GET /v1/boards/:workspaceId/changes?since=<seq>&limit=`.
|
|
427
|
+
*
|
|
428
|
+
* Archived cards are included.
|
|
429
|
+
*/
|
|
430
|
+
export interface BoardChangesResponse {
|
|
431
|
+
head: number;
|
|
432
|
+
/** The `since` to ask with next. */
|
|
433
|
+
nextSince: number;
|
|
434
|
+
hasMore: boolean;
|
|
435
|
+
items: Card[];
|
|
436
|
+
events: BoardEvent[];
|
|
437
|
+
}
|
|
438
|
+
export interface Presence {
|
|
439
|
+
workItemId: string;
|
|
440
|
+
userId: string;
|
|
441
|
+
agent: string;
|
|
442
|
+
machineId: string | null;
|
|
443
|
+
lastSeenAt: IsoDate;
|
|
444
|
+
}
|
|
445
|
+
/** `GET /v1/boards/:workspaceId/presence`. */
|
|
446
|
+
export interface BoardPresenceResponse {
|
|
447
|
+
presence: Presence[];
|
|
448
|
+
}
|
|
449
|
+
/** Where a card lands in its lane; with neither, the bottom. */
|
|
450
|
+
export interface Placement {
|
|
451
|
+
/** The card this one goes directly below. */
|
|
452
|
+
after?: string | null;
|
|
453
|
+
/** The card this one goes directly above. */
|
|
454
|
+
before?: string | null;
|
|
455
|
+
}
|
|
456
|
+
/** A checklist item as create, `PUT /checklist` and import send it. */
|
|
457
|
+
export interface ChecklistItemInput {
|
|
458
|
+
/** Kept when sent (`D1`, `V1`); minted per section otherwise. */
|
|
459
|
+
key?: string | null;
|
|
460
|
+
section?: ChecklistSection;
|
|
461
|
+
/** 1-2000 characters. */
|
|
462
|
+
text: string;
|
|
463
|
+
/** Absent keeps what the stored item says, which is not `false`. */
|
|
464
|
+
checked?: boolean;
|
|
465
|
+
note?: string | null;
|
|
466
|
+
group?: string | null;
|
|
467
|
+
/** A stream key like `W0`; only on a verify item. */
|
|
468
|
+
stream?: string | null;
|
|
469
|
+
}
|
|
470
|
+
/** A stream as create and update accept it. */
|
|
471
|
+
export interface StreamInput {
|
|
472
|
+
/** `W0` … `W999`; minted when absent. */
|
|
473
|
+
key?: string | null;
|
|
474
|
+
title: string;
|
|
475
|
+
goal: string;
|
|
476
|
+
role: StreamRole;
|
|
477
|
+
owns: string[];
|
|
478
|
+
reads?: string[];
|
|
479
|
+
depends_on?: string[];
|
|
480
|
+
/** Default `worktree`. */
|
|
481
|
+
isolation?: StreamIsolation;
|
|
482
|
+
}
|
|
483
|
+
export interface CardSourceInput {
|
|
484
|
+
kind: string;
|
|
485
|
+
ref: string;
|
|
486
|
+
checksum?: string | null;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* `POST /v1/boards/:workspaceId/items`, answered with 201 `{ item }`.
|
|
490
|
+
*
|
|
491
|
+
* Honors an `Idempotency-Key` header: a replay answers 200
|
|
492
|
+
* `{ item, idempotent: true }`.
|
|
493
|
+
*/
|
|
494
|
+
export interface CardCreateRequest {
|
|
495
|
+
title: string;
|
|
496
|
+
type?: WorkItemType;
|
|
497
|
+
body?: string | null;
|
|
498
|
+
/** Default: the board's intake lane. */
|
|
499
|
+
columnKey?: string | null;
|
|
500
|
+
parentId?: string | null;
|
|
501
|
+
priority?: Priority | null;
|
|
502
|
+
estimate?: number | null;
|
|
503
|
+
categoryKey?: string | null;
|
|
504
|
+
tags?: string[];
|
|
505
|
+
dueAt?: IsoDate | null;
|
|
506
|
+
checklist?: ChecklistItemInput[];
|
|
507
|
+
streams?: StreamInput[] | null;
|
|
508
|
+
assignees?: Partial<CardAssignees>;
|
|
509
|
+
metadata?: Record<string, unknown> | null;
|
|
510
|
+
placement?: Placement | null;
|
|
511
|
+
source?: CardSourceInput;
|
|
512
|
+
}
|
|
513
|
+
export interface CardCreateResponse {
|
|
514
|
+
item: CardDetail;
|
|
515
|
+
/** Present when an `Idempotency-Key` replay returned the earlier card. */
|
|
516
|
+
idempotent?: true;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* `PATCH /v1/boards/:workspaceId/items/:itemId`.
|
|
520
|
+
*
|
|
521
|
+
* `If-Match: <revision>` is required. Only the fields sent change; `null`
|
|
522
|
+
* clears one. `columnKey`, `rank`, `revision`, `seq`, `taskId` and `taskSeq`
|
|
523
|
+
* are refused.
|
|
524
|
+
*/
|
|
525
|
+
export interface CardPatchRequest {
|
|
526
|
+
type?: WorkItemType;
|
|
527
|
+
title?: string;
|
|
528
|
+
body?: string | null;
|
|
529
|
+
priority?: Priority | null;
|
|
530
|
+
estimate?: number | null;
|
|
531
|
+
categoryKey?: string | null;
|
|
532
|
+
tags?: string[];
|
|
533
|
+
dueAt?: IsoDate | null;
|
|
534
|
+
parentId?: string | null;
|
|
535
|
+
metadata?: Record<string, unknown> | null;
|
|
536
|
+
assignees?: Partial<CardAssignees>;
|
|
537
|
+
/** The whole plan, replaced. `[]` or `null` clears it. */
|
|
538
|
+
streams?: StreamInput[] | null;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* `POST /v1/boards/:workspaceId/items/:itemId/move`.
|
|
542
|
+
*
|
|
543
|
+
* `If-Match` is optional. Needs a `columnKey` or a placement.
|
|
544
|
+
*/
|
|
545
|
+
export interface CardMoveRequest {
|
|
546
|
+
/** Null reorders inside the current lane. */
|
|
547
|
+
columnKey?: string | null;
|
|
548
|
+
placement?: Placement | null;
|
|
549
|
+
/**
|
|
550
|
+
* Why a reviewer sends the card back (BE-23), up to
|
|
551
|
+
* {@link MAX_CHANGES_REASON} characters. Kept only on a move from a `review`
|
|
552
|
+
* lane to an `active` one; ignored on any other move.
|
|
553
|
+
*/
|
|
554
|
+
reason?: string;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* 400 from a move into a `review`- or `done`-role lane while a verify item an
|
|
558
|
+
* agent ticked has no evidence, or evidence with `ok: false` (BE-22).
|
|
559
|
+
*
|
|
560
|
+
* `keys` are those items' keys; `error` already names them. A person ticking
|
|
561
|
+
* the item themselves clears it.
|
|
562
|
+
*/
|
|
563
|
+
export interface CardMoveEvidenceError {
|
|
564
|
+
error: string;
|
|
565
|
+
keys: string[];
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* `PUT /v1/boards/:workspaceId/items/:itemId/checklist`.
|
|
569
|
+
*
|
|
570
|
+
* `If-Match` is required.
|
|
571
|
+
*/
|
|
572
|
+
export interface ChecklistReplaceRequest {
|
|
573
|
+
items: ChecklistItemInput[];
|
|
574
|
+
}
|
|
575
|
+
/** 400 from `PUT /checklist` when the stream rules refuse it. */
|
|
576
|
+
export interface ChecklistReplaceError {
|
|
577
|
+
error: string;
|
|
578
|
+
errors: string[];
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* `PATCH /v1/boards/:workspaceId/items/:itemId/checklist/:key`.
|
|
582
|
+
*
|
|
583
|
+
* `If-Match` is optional.
|
|
584
|
+
*/
|
|
585
|
+
export interface ChecklistItemPatchRequest {
|
|
586
|
+
checked?: boolean;
|
|
587
|
+
note?: string | null;
|
|
588
|
+
text?: string;
|
|
589
|
+
/** Retag a verify item to a stream; `null` gives it back to the lead. */
|
|
590
|
+
stream?: string | null;
|
|
591
|
+
}
|
|
592
|
+
/** `DELETE /v1/boards/:workspaceId/items/:itemId`: archive (a tombstone). */
|
|
593
|
+
export interface CardArchiveResponse {
|
|
594
|
+
archived: string;
|
|
595
|
+
/** Absent when the card was already archived. */
|
|
596
|
+
seq?: number;
|
|
597
|
+
}
|
|
598
|
+
/** `POST /v1/boards/:workspaceId/items/:itemId/restore`. */
|
|
599
|
+
export interface CardRestoreResponse {
|
|
600
|
+
item: CardDetail | null;
|
|
601
|
+
seq: number;
|
|
602
|
+
}
|
|
603
|
+
/** `POST /v1/boards/:workspaceId/items/:itemId/links`, answered with 201. */
|
|
604
|
+
export interface CardLinkRequest {
|
|
605
|
+
type: LinkType;
|
|
606
|
+
targetId: string;
|
|
607
|
+
}
|
|
608
|
+
export interface CardLinkResponse {
|
|
609
|
+
link: {
|
|
610
|
+
id: string;
|
|
611
|
+
fromId: string;
|
|
612
|
+
toId: string;
|
|
613
|
+
type: "blocks" | "relates" | "duplicates";
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
/** `DELETE …/links/:linkId`. */
|
|
617
|
+
export interface CardUnlinkResponse {
|
|
618
|
+
unlinked: string;
|
|
619
|
+
}
|
|
620
|
+
export interface Comment {
|
|
621
|
+
id: string;
|
|
622
|
+
authorKind: ActorKind;
|
|
623
|
+
authorRef: string;
|
|
624
|
+
/** Null once deleted: the comment keeps its place with its body gone. */
|
|
625
|
+
body: string | null;
|
|
626
|
+
createdAt: IsoDate;
|
|
627
|
+
deletedAt: IsoDate | null;
|
|
628
|
+
}
|
|
629
|
+
/** `GET /v1/boards/:workspaceId/items/:itemId/comments`, oldest first. */
|
|
630
|
+
export interface CommentListResponse {
|
|
631
|
+
comments: Comment[];
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* `POST …/comments` (201) and `PATCH …/comments/:commentId`.
|
|
635
|
+
*
|
|
636
|
+
* The body is 1-20000 characters.
|
|
637
|
+
*/
|
|
638
|
+
export interface CommentRequest {
|
|
639
|
+
body: string;
|
|
640
|
+
}
|
|
641
|
+
export interface CommentCreateResponse {
|
|
642
|
+
comment: {
|
|
643
|
+
id: string;
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
/** Only the author may edit; 409 on a deleted comment. */
|
|
647
|
+
export interface CommentPatchResponse {
|
|
648
|
+
comment: {
|
|
649
|
+
id: string;
|
|
650
|
+
body: string;
|
|
651
|
+
updatedAt: IsoDate;
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* `DELETE …/comments/:commentId`: a tombstone.
|
|
656
|
+
*
|
|
657
|
+
* Only the author may delete.
|
|
658
|
+
*/
|
|
659
|
+
export interface CommentDeleteResponse {
|
|
660
|
+
deleted: string;
|
|
661
|
+
}
|
|
662
|
+
/** `PUT` / `DELETE …/subscription`; answers the state that now holds. */
|
|
663
|
+
export interface SubscriptionResponse {
|
|
664
|
+
subscribed: boolean;
|
|
665
|
+
}
|
|
666
|
+
/** `PUT` / `DELETE …/favorite`; answers the state that now holds. */
|
|
667
|
+
export interface FavoriteResponse {
|
|
668
|
+
favorite: boolean;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* `POST …/attachments`, answered with 201.
|
|
672
|
+
*
|
|
673
|
+
* A reference to a file, not its bytes.
|
|
674
|
+
*/
|
|
675
|
+
export interface AttachmentRequest {
|
|
676
|
+
name: string;
|
|
677
|
+
reference: string;
|
|
678
|
+
mimeType?: string | null;
|
|
679
|
+
sizeBytes?: number | null;
|
|
680
|
+
sourceKind?: string | null;
|
|
681
|
+
}
|
|
682
|
+
export interface AttachmentResponse {
|
|
683
|
+
attachment: CardAttachment;
|
|
684
|
+
}
|
|
685
|
+
/** `DELETE …/attachments/:attachmentId`. */
|
|
686
|
+
export interface AttachmentDeleteResponse {
|
|
687
|
+
detached: string;
|
|
688
|
+
}
|
|
689
|
+
export interface AuditEvent {
|
|
690
|
+
seq: number;
|
|
691
|
+
verb: string;
|
|
692
|
+
actorKind: ActorKind;
|
|
693
|
+
actorUserId: string | null;
|
|
694
|
+
actorMachineId: string | null;
|
|
695
|
+
diff: unknown;
|
|
696
|
+
at: IsoDate;
|
|
697
|
+
}
|
|
698
|
+
/** `GET …/items/:itemId/audit`, newest first. */
|
|
699
|
+
export interface AuditResponse {
|
|
700
|
+
events: AuditEvent[];
|
|
701
|
+
}
|
|
702
|
+
export interface ActivityAudit extends AuditEvent {
|
|
703
|
+
kind: "audit";
|
|
704
|
+
id: string;
|
|
705
|
+
}
|
|
706
|
+
export interface ActivityComment {
|
|
707
|
+
kind: "comment";
|
|
708
|
+
id: string;
|
|
709
|
+
authorKind: ActorKind;
|
|
710
|
+
authorRef: string;
|
|
711
|
+
/** The account behind the author; null on rows older than the column. */
|
|
712
|
+
authorUserId: string | null;
|
|
713
|
+
body: string | null;
|
|
714
|
+
at: IsoDate;
|
|
715
|
+
editedAt: IsoDate | null;
|
|
716
|
+
deletedAt: IsoDate | null;
|
|
717
|
+
}
|
|
718
|
+
export type ActivityEntry = ActivityAudit | ActivityComment;
|
|
719
|
+
/**
|
|
720
|
+
* `GET …/items/:itemId/activity?limit=&cursor=`.
|
|
721
|
+
*
|
|
722
|
+
* Oldest first, audit and comments merged.
|
|
723
|
+
*/
|
|
724
|
+
export interface ActivityResponse {
|
|
725
|
+
events: ActivityEntry[];
|
|
726
|
+
cursor: string | null;
|
|
727
|
+
}
|
|
728
|
+
export interface ImportChecklistItem extends ChecklistItemInput {
|
|
729
|
+
/** Required when `checked` is true; refused when it is not. */
|
|
730
|
+
checkedAt?: IsoDate | null;
|
|
731
|
+
}
|
|
732
|
+
export interface ImportRestore {
|
|
733
|
+
/** The id the source already handed out, e.g. `BE-02`. */
|
|
734
|
+
taskId?: string | null;
|
|
735
|
+
/** Required alongside `taskId`. */
|
|
736
|
+
taskSeq?: number | null;
|
|
737
|
+
createdAt?: IsoDate | null;
|
|
738
|
+
updatedAt?: IsoDate | null;
|
|
739
|
+
rank?: string | null;
|
|
740
|
+
checklist?: ImportChecklistItem[];
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* One record of an import.
|
|
744
|
+
*
|
|
745
|
+
* A create body that must carry `source` and `columnKey`, with its checklist
|
|
746
|
+
* under `restore`, never at the top level.
|
|
747
|
+
*/
|
|
748
|
+
export interface ImportRecord extends Omit<CardCreateRequest, "checklist"> {
|
|
749
|
+
columnKey: string;
|
|
750
|
+
source: CardSourceInput;
|
|
751
|
+
restore?: ImportRestore | null;
|
|
752
|
+
attachments?: AttachmentRequest[];
|
|
753
|
+
}
|
|
754
|
+
/** `POST /v1/boards/:workspaceId/import`: 1-50 records. */
|
|
755
|
+
export interface ImportRequest {
|
|
756
|
+
records: ImportRecord[];
|
|
757
|
+
}
|
|
758
|
+
export type ImportReceiptStatus = "imported" | "updated" | "skipped" | "conflict" | "failed";
|
|
759
|
+
export interface ImportReceipt {
|
|
760
|
+
ref: string;
|
|
761
|
+
status: ImportReceiptStatus;
|
|
762
|
+
itemId?: string;
|
|
763
|
+
taskId?: string | null;
|
|
764
|
+
error?: string;
|
|
765
|
+
}
|
|
766
|
+
export interface ImportResponse {
|
|
767
|
+
summary: Record<ImportReceiptStatus, number>;
|
|
768
|
+
receipts: ImportReceipt[];
|
|
769
|
+
head: number;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* `POST /v1/boards/:workspaceId/migrated`: seal the cutover.
|
|
773
|
+
*
|
|
774
|
+
* Verified by count.
|
|
775
|
+
*/
|
|
776
|
+
export interface MigratedRequest {
|
|
777
|
+
items: number;
|
|
778
|
+
manifest?: string | null;
|
|
779
|
+
}
|
|
780
|
+
export type MigratedResponse = {
|
|
781
|
+
migratedAt: IsoDate;
|
|
782
|
+
items: number;
|
|
783
|
+
seq: number;
|
|
784
|
+
} | {
|
|
785
|
+
migratedAt: IsoDate;
|
|
786
|
+
items: number;
|
|
787
|
+
alreadySealed: true;
|
|
788
|
+
};
|
|
789
|
+
/** 409 from `/migrated` when the count does not match. */
|
|
790
|
+
export interface MigratedMismatchError {
|
|
791
|
+
error: string;
|
|
792
|
+
expected: number;
|
|
793
|
+
actual: number;
|
|
794
|
+
}
|
|
795
|
+
/** `POST /v1/boards/:workspaceId/purge`: removes every card. */
|
|
796
|
+
export interface PurgeRequest {
|
|
797
|
+
/** Must be the project's slug, exactly. */
|
|
798
|
+
confirm: string;
|
|
799
|
+
}
|
|
800
|
+
export interface PurgeResponse {
|
|
801
|
+
deleted: number;
|
|
802
|
+
seq: number;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* `GET /v1/boards/:workspaceId/icon`: image bytes, not JSON.
|
|
806
|
+
*
|
|
807
|
+
* 404 means no icon. Send `If-None-Match` with the last ETag for a 304.
|
|
808
|
+
*/
|
|
809
|
+
export declare const ICON_KEY_HEADER = "x-icon-key";
|