@vercel/board 0.29.0 → 0.30.0

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.
Files changed (124) hide show
  1. package/dist/{a2-HUbQJ0RD.mjs → a2-D_28Pdip.mjs} +190 -76
  2. package/dist/access-CQ39gqEV.mjs +226 -0
  3. package/dist/access.d.mts +1 -1
  4. package/dist/access.mjs +3 -3
  5. package/dist/{actors-DcJhFbwJ.mjs → actors-xPiamLWk.mjs} +2 -2
  6. package/dist/{auth-JO22iIwr.mjs → auth-BPinwfN0.mjs} +3 -226
  7. package/dist/backend-a2/blob-vercel.d.mts +1 -1
  8. package/dist/backend-a2/contract.d.mts +2 -2
  9. package/dist/backend-a2/contract.mjs +1 -1
  10. package/dist/backend-a2/scheduler-local.d.mts +1 -1
  11. package/dist/backend-a2/scheduler-local.mjs +1 -1
  12. package/dist/backend-a2/scheduler-qstash.d.mts +3 -3
  13. package/dist/backend-a2/scheduler-qstash.mjs +8 -8
  14. package/dist/backend-a2/scheduler-vercel.d.mts +3 -3
  15. package/dist/backend-a2/scheduler-vercel.mjs +6 -6
  16. package/dist/backend-a2/store-memory.d.mts +2 -2
  17. package/dist/backend-a2/store-memory.mjs +3 -3
  18. package/dist/backend-a2/store-postgres.d.mts +1 -1
  19. package/dist/backend-a2/store-postgres.mjs +34 -15
  20. package/dist/backend-a2/store-redis-http.d.mts +1 -1
  21. package/dist/backend-a2/store-redis-http.mjs +6 -6
  22. package/dist/backend-a2/store-redis.d.mts +2 -2
  23. package/dist/backend-a2/store-redis.mjs +5 -5
  24. package/dist/backend-a2/store-sqlite.d.mts +1 -1
  25. package/dist/backend-a2/store-sqlite.mjs +3 -3
  26. package/dist/backend-a2.d.mts +17 -7
  27. package/dist/backend-a2.mjs +2 -2
  28. package/dist/{backend-http-Bmp0IgD3.mjs → backend-http-16SbvnAK.mjs} +2 -2
  29. package/dist/{backend-http-CqfKhrnn.d.mts → backend-http-3PoBYQoo.d.mts} +13 -3
  30. package/dist/{backend-http-CzIJMm58.mjs → backend-http-BPaNYLWj.mjs} +2 -3
  31. package/dist/backend-http.d.mts +1 -1
  32. package/dist/backend-http.mjs +1 -1
  33. package/dist/backend-http.node.d.mts +1 -1
  34. package/dist/backend-http.node.mjs +1 -1
  35. package/dist/{backend-CPC_vyOo.d.mts → backend-n3hajfrD.d.mts} +11 -5
  36. package/dist/{backend-vercel-BNauAs7w.mjs → backend-vercel-C4Kee2-K.mjs} +203 -31
  37. package/dist/{backend-vercel-DQc_TaHp.mjs → backend-vercel-Kd8nvW5A.mjs} +3 -3
  38. package/dist/{backend-vercel-4tvcPKqX.d.mts → backend-vercel-qznuDxnN.d.mts} +16 -5
  39. package/dist/backend-vercel.d.mts +1 -1
  40. package/dist/backend-vercel.mjs +1 -1
  41. package/dist/backend-vercel.node.d.mts +1 -1
  42. package/dist/backend-vercel.node.mjs +1 -1
  43. package/dist/{blob-DmiQjrYy.d.mts → blob-CqILvdmr.d.mts} +2 -2
  44. package/dist/{blob-DdbpJqN1.mjs → blob-DQK5prXT.mjs} +1 -1
  45. package/dist/{chat-provider-BWHbChcQ.d.mts → chat-provider-D6jVT4wS.d.mts} +3 -3
  46. package/dist/cli-commands.d.mts +1 -1
  47. package/dist/cli-commands.mjs +1 -1
  48. package/dist/cli-embedded.d.mts +2 -2
  49. package/dist/cli-embedded.mjs +1 -1
  50. package/dist/cli.mjs +4 -4
  51. package/dist/{client-BqAjk0Q4.d.mts → client-CjAatpV4.d.mts} +60 -10
  52. package/dist/{commands-C3R1AWgm.mjs → commands-B5DHjZKK.mjs} +50 -9
  53. package/dist/{commands-D6gvrOh3.d.mts → commands-BtH69yqt.d.mts} +17 -0
  54. package/dist/{conformance-DlnfuzEB.mjs → conformance-C7fwIvmN.mjs} +258 -18
  55. package/dist/conformance.d.mts +1 -1
  56. package/dist/conformance.mjs +1 -1
  57. package/dist/{engine-DQxXk7dX.mjs → engine-DkdkXQEy.mjs} +2 -2
  58. package/dist/{errors-DDktVeUa.d.mts → errors-87TVtXeb.d.mts} +1 -1
  59. package/dist/{client-D0Px7KzF.mjs → errors-C_5rB8Iz.mjs} +104 -4
  60. package/dist/{exports-BG-0Wyn-.mjs → exports-CG0P8Qi4.mjs} +54 -28
  61. package/dist/exports-CrGA5_yN.d.mts +5 -0
  62. package/dist/{folds-ZkHM4M-v.d.mts → folds-8wRRXjAt.d.mts} +2 -0
  63. package/dist/{folds-BDMSxBUf.mjs → folds-DGYkMW19.mjs} +1 -0
  64. package/dist/{index-D3VvNfh_.d.mts → index-BygAXP7t.d.mts} +2 -2
  65. package/dist/index.d.mts +6 -6
  66. package/dist/{index.default-rB8sJ9RX.mjs → index.default-DhkgpfR2.mjs} +1 -1
  67. package/dist/index.mjs +5 -6
  68. package/dist/index.node.d.mts +6 -6
  69. package/dist/index.node.mjs +3 -4
  70. package/dist/inspect/app.js +29 -29
  71. package/dist/{internal-CvsrprnU-CRY89I-b.mjs → internal-CvsrprnU-zZMpDiRY.mjs} +1 -1
  72. package/dist/{local-DhkrAqPP.mjs → local-C76Fy5ad.mjs} +1 -1
  73. package/dist/{main-CVBqe3VO.mjs → main-D2s-QBOK.mjs} +70 -23
  74. package/dist/{middleware-CXjEeef4.mjs → middleware-DlJQYiwV.mjs} +1 -1
  75. package/dist/{node-Zd_C-gxP.mjs → node-D8Rtg1su.mjs} +1 -1
  76. package/dist/{platform-B4TnJtWu-CwcTyKg2.mjs → platform-B4TnJtWu-Do3agKr5.mjs} +1 -1
  77. package/dist/{project-CBXlLftU.mjs → project-C_2xs57L.mjs} +1 -1
  78. package/dist/{provider-DmSTp9lI.d.mts → provider-Bm46LAdp.d.mts} +2 -2
  79. package/dist/{redis-tables-BJQVUspu.mjs → redis-tables-BWJZHUGg.mjs} +40 -24
  80. package/dist/{reducer-CjmvZSAb-D_OSISmj.mjs → reducer-Bswr11ar-P324o9vn.mjs} +2 -2
  81. package/dist/{reducer-CYPHsSmd-BQIfozGi.d.mts → reducer-CYPHsSmd-BXjGiptm.d.mts} +1 -1
  82. package/dist/{reducers-DJzVpXwM.mjs → reducers-8jqLewgw.mjs} +3 -3
  83. package/dist/{retryable-lazy-DZWmHpii-Bye-W8q7.mjs → retryable-lazy-DZWmHpii-DpTc5PIP.mjs} +1 -1
  84. package/dist/{scheduler-task-X1SToDjP-BVoWuInI.mjs → scheduler-task-X1SToDjP-D2Il2rln.mjs} +1 -1
  85. package/dist/{serve-G9RuaDSr.mjs → serve-lPoBDEds.mjs} +7 -7
  86. package/dist/{server-qgez0Xny-D5mLfqFQ.d.mts → server-B9gu0qi1-DI1WvcVK.d.mts} +10 -4
  87. package/dist/{server-BixV_byP.mjs → server-D82a4uMe.mjs} +4 -4
  88. package/dist/{server-DtFrWxi3-Boa6gdWO.mjs → server-DX7mM6nm-D7N_7bug.mjs} +32 -23
  89. package/dist/{serving-B75Y4BF-.mjs → serving-DKny38LK.mjs} +1 -1
  90. package/dist/{session-clear-wHd5GCpZ-BnKSxReK.mjs → session-clear-XJYpmUpg-2q8l_FJR.mjs} +14 -2
  91. package/dist/{sql-D4Z_efJX.mjs → sql-Bj0fk6dn.mjs} +1 -1
  92. package/dist/{sqlite-db-Bz2JkfCU.mjs → sqlite-db-Dc8G78XV.mjs} +1 -1
  93. package/dist/{store-D0MhBvg6-4Z2L0Kqd.d.mts → store-DEzcHZOA-B-5vhxef.d.mts} +12 -2
  94. package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +5 -0
  95. package/dist/{store-codec-DwrWlgQx-CYxGW0aD.mjs → store-codec-pAG2oPgQ-SqDXlPBR.mjs} +4 -4
  96. package/dist/store-memory-4IBl0Ztu.mjs +2 -0
  97. package/dist/{store-memory-Bas9Uq5C.mjs → store-memory-B0PkVSuQ.mjs} +14 -7
  98. package/dist/{store-polling-BZt2Rf3D-BiEM6_HB.mjs → store-polling-BZt2Rf3D-Div-bJ_D.mjs} +2 -2
  99. package/dist/{store-presence-polling-JuAy2Ck2-CYpuK75X.mjs → store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs} +3 -3
  100. package/dist/{store-sqlite-CxxPCcCT.mjs → store-sqlite-D85t3tE7.mjs} +14 -7
  101. package/dist/store-sqlite-iBTYYKBj.mjs +2 -0
  102. package/dist/{stream-buffer-DrTyiIuo-BKy-vI14.mjs → stream-buffer-DrTyiIuo-Be10yOBR.mjs} +2 -2
  103. package/dist/sync-github.d.mts +2 -2
  104. package/dist/sync-kapso.d.mts +2 -2
  105. package/dist/sync-linear.d.mts +3 -3
  106. package/dist/sync-linear.mjs +4 -2
  107. package/dist/sync-slack.d.mts +3 -3
  108. package/dist/sync.chat.d.mts +1 -1
  109. package/dist/sync.d.mts +2 -2
  110. package/dist/{tokens-CC3izSNr.mjs → tokens-C5_yGRlL.mjs} +2 -2
  111. package/dist/{types-No0WdhE5.d.mts → types-shZmGZ-q.d.mts} +2 -2
  112. package/dist/{watchers-hash-BDhLVkV5.mjs → watchers-hash-B_5b0-ZG.mjs} +46 -17
  113. package/docs/01-board/04-messages.md +93 -0
  114. package/docs/01-board/08-middleware.md +5 -2
  115. package/docs/04-reference/01-cli.md +23 -10
  116. package/docs/04-reference/02-board.md +20 -5
  117. package/docs/04-reference/03-http.md +17 -6
  118. package/docs/04-reference/05-conformance.md +14 -3
  119. package/package.json +2 -2
  120. package/dist/errors-CusN4x2l.mjs +0 -88
  121. package/dist/exports-mhAYiU4i.d.mts +0 -5
  122. package/dist/store-N8PXxDAS-BWBgzBHp.mjs +0 -5
  123. package/dist/store-memory-ZLiZbH3R.mjs +0 -2
  124. package/dist/store-sqlite-BmwL3pUR.mjs +0 -2
@@ -1,10 +1,11 @@
1
1
  import { n as AccessSummary } from "./access-CV96SYgr.mjs";
2
- import { a as ExternalCopy, g as BoardEvent, o as Message, p as Link, r as Channel, t as Actor, u as ExternalEvent, x as Attachment } from "./folds-ZkHM4M-v.mjs";
2
+ import { a as ExternalCopy, g as BoardEvent, o as Message, p as Link, r as Channel, t as Actor, u as ExternalEvent, x as Attachment } from "./folds-8wRRXjAt.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/api/routes.d.ts
5
5
  /**
6
6
  * A message's, schedule's, or cursor's ID: a string clients pass back as they got it, and never
7
- * parse, compare, or count with. Each backend picks its own; a board on `a2()` writes decimals.
7
+ * parse, compare, or count with. Each backend picks its own; a board on `a2()` writes decimals,
8
+ * and `s12` for a schedule.
8
9
  */
9
10
  declare const Ref: z.ZodString;
10
11
  /** A sync target as the board that syncs it resolved it: a platform channel to start a thread in, or a thread to join. */
@@ -78,6 +79,7 @@ declare const PostBody: z.ZodObject<{
78
79
  }, z.core.$strip>]>>>;
79
80
  id: z.ZodOptional<z.ZodString>;
80
81
  attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
+ after: z.ZodOptional<z.ZodString>;
81
83
  }, z.core.$strip>;
82
84
  /**
83
85
  * A message to post later, as the caller: once (`in` or `at`), or repeating
@@ -232,6 +234,7 @@ declare const SyncImportBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
232
234
  message: z.ZodNullable<z.ZodString>;
233
235
  }, z.core.$strip>>>;
234
236
  id: z.ZodOptional<z.ZodString>;
237
+ after: z.ZodOptional<z.ZodString>;
235
238
  }, z.core.$strip>, z.ZodObject<{
236
239
  author: z.ZodObject<{
237
240
  id: z.ZodString;
@@ -253,6 +256,7 @@ declare const SyncImportBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
253
256
  channel: z.ZodString;
254
257
  thread: z.ZodString;
255
258
  }, z.core.$strip>>;
259
+ revision: z.ZodOptional<z.ZodNumber>;
256
260
  }, z.core.$strip>, z.ZodObject<{
257
261
  author: z.ZodObject<{
258
262
  id: z.ZodString;
@@ -268,6 +272,7 @@ declare const SyncImportBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
268
272
  }, z.core.$strip>>;
269
273
  message: z.ZodOptional<z.ZodString>;
270
274
  op: z.ZodLiteral<"delete">;
275
+ revision: z.ZodOptional<z.ZodNumber>;
271
276
  }, z.core.$strip>, z.ZodObject<{
272
277
  author: z.ZodObject<{
273
278
  id: z.ZodString;
@@ -302,6 +307,7 @@ declare const SyncImportBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
302
307
  op: z.ZodLiteral<"labels">;
303
308
  set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
304
309
  unset: z.ZodOptional<z.ZodArray<z.ZodString>>;
310
+ if: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
305
311
  }, z.core.$strip>, z.ZodObject<{
306
312
  author: z.ZodObject<{
307
313
  id: z.ZodString;
@@ -553,11 +559,15 @@ declare const SignInQuery: z.ZodObject<{
553
559
  declare const SyncUnlinkBody: z.ZodObject<{
554
560
  account: z.ZodString;
555
561
  }, z.core.$strip>;
556
- /** A direct upload, before its bytes: what the file will be called, its type, and its exact size. */
562
+ /**
563
+ * A direct upload, before its bytes: what the file will be called, its type, its exact size, and
564
+ * the SHA-256 of its bytes, in base64, for a store that signs its URL for them (Vercel's).
565
+ */
557
566
  declare const UploadStartBody: z.ZodObject<{
558
567
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
559
568
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
560
569
  size: z.ZodNumber;
570
+ sha256: z.ZodOptional<z.ZodString>;
561
571
  }, z.core.$strip>;
562
572
  /** Where to send a direct upload's bytes: `PUT` the file to `url` with `headers` (its `content-type` included), before `expiresAt`, then finish it. */
563
573
  type UploadTicket = {
@@ -568,8 +578,11 @@ type UploadTicket = {
568
578
  };
569
579
  declare const EditBody: z.ZodObject<{
570
580
  text: z.ZodString;
581
+ revision: z.ZodOptional<z.ZodNumber>;
571
582
  }, z.core.$strip>;
572
- declare const DeleteBody: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
583
+ declare const DeleteBody: z.ZodOptional<z.ZodObject<{
584
+ revision: z.ZodOptional<z.ZodNumber>;
585
+ }, z.core.$strip>>;
573
586
  /** `status`: what Slack shows in place of "Typing…" (WhatsApp and GitHub ignore it). */
574
587
  declare const TypingBody: z.ZodOptional<z.ZodObject<{
575
588
  status: z.ZodOptional<z.ZodString>;
@@ -578,9 +591,12 @@ declare const ReactBody: z.ZodObject<{
578
591
  emoji: z.ZodString;
579
592
  remove: z.ZodOptional<z.ZodBoolean>;
580
593
  }, z.core.$strip>;
594
+ /** At most this many labels in a label write's `if`. */
595
+ declare const LABEL_CONDITIONS_MAX = 16;
581
596
  declare const LabelBody: z.ZodObject<{
582
597
  set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
583
598
  unset: z.ZodOptional<z.ZodArray<z.ZodString>>;
599
+ if: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
584
600
  }, z.core.$strip>;
585
601
  type FiltersInput = z.input<typeof Filters$1>;
586
602
  type SyncImportInput = z.input<typeof SyncImportBody>;
@@ -655,7 +671,7 @@ type ActorView = Pick<Actor, 'kind' | 'handle' | 'name' | 'avatar'> & {
655
671
  person?: PersonView;
656
672
  };
657
673
  /** A message as clients see it: its IDs are refs, and `version` says which of two views of it is newer. */
658
- type MessageView = Omit<Message, 'id' | 're' | 'replyTo' | 'links' | 'schedule' | 'version'> & {
674
+ type MessageView = Omit<Message, 'id' | 're' | 'replyTo' | 'links' | 'schedule' | 'version' | 'revision'> & {
659
675
  id: string;
660
676
  /** The thread's root, or null for a root. */
661
677
  re: string | null;
@@ -663,6 +679,11 @@ type MessageView = Omit<Message, 'id' | 're' | 'replyTo' | 'links' | 'schedule'
663
679
  replyTo: string | null;
664
680
  /** Grows with each change to this message: of two views of it, the one with the higher version is newer. */
665
681
  version: number;
682
+ /**
683
+ * Changes with each edit and delete, and only then: what an edit or a delete passes as `revision`
684
+ * to change it only if no one has since.
685
+ */
686
+ revision: number;
666
687
  links: LinkView[];
667
688
  /** Set when a schedule posted it: the schedule's ID and which send this was, from 0. */
668
689
  schedule?: {
@@ -1016,6 +1037,7 @@ declare const routes: {
1016
1037
  }, z.core.$strip>]>>>;
1017
1038
  id: z.ZodOptional<z.ZodString>;
1018
1039
  attachments: z.ZodOptional<z.ZodArray<z.ZodString>>;
1040
+ after: z.ZodOptional<z.ZodString>;
1019
1041
  }, z.core.$strip>;
1020
1042
  };
1021
1043
  readonly edit: {
@@ -1023,12 +1045,15 @@ declare const routes: {
1023
1045
  readonly path: '/messages/:id/edit';
1024
1046
  readonly body: z.ZodObject<{
1025
1047
  text: z.ZodString;
1048
+ revision: z.ZodOptional<z.ZodNumber>;
1026
1049
  }, z.core.$strip>;
1027
1050
  };
1028
1051
  readonly delete: {
1029
1052
  readonly method: 'POST';
1030
1053
  readonly path: '/messages/:id/delete';
1031
- readonly body: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
1054
+ readonly body: z.ZodOptional<z.ZodObject<{
1055
+ revision: z.ZodOptional<z.ZodNumber>;
1056
+ }, z.core.$strip>>;
1032
1057
  };
1033
1058
  readonly react: {
1034
1059
  readonly method: 'POST';
@@ -1044,6 +1069,7 @@ declare const routes: {
1044
1069
  readonly body: z.ZodObject<{
1045
1070
  set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1046
1071
  unset: z.ZodOptional<z.ZodArray<z.ZodString>>;
1072
+ if: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
1047
1073
  }, z.core.$strip>;
1048
1074
  };
1049
1075
  /** Attaches the thread to a sync target, recording a `thread` receipt: needs `sync` where the thread is. */
@@ -1313,6 +1339,7 @@ declare const routes: {
1313
1339
  message: z.ZodNullable<z.ZodString>;
1314
1340
  }, z.core.$strip>>>;
1315
1341
  id: z.ZodOptional<z.ZodString>;
1342
+ after: z.ZodOptional<z.ZodString>;
1316
1343
  }, z.core.$strip>, z.ZodObject<{
1317
1344
  author: z.ZodObject<{
1318
1345
  id: z.ZodString;
@@ -1334,6 +1361,7 @@ declare const routes: {
1334
1361
  channel: z.ZodString;
1335
1362
  thread: z.ZodString;
1336
1363
  }, z.core.$strip>>;
1364
+ revision: z.ZodOptional<z.ZodNumber>;
1337
1365
  }, z.core.$strip>, z.ZodObject<{
1338
1366
  author: z.ZodObject<{
1339
1367
  id: z.ZodString;
@@ -1349,6 +1377,7 @@ declare const routes: {
1349
1377
  }, z.core.$strip>>;
1350
1378
  message: z.ZodOptional<z.ZodString>;
1351
1379
  op: z.ZodLiteral<"delete">;
1380
+ revision: z.ZodOptional<z.ZodNumber>;
1352
1381
  }, z.core.$strip>, z.ZodObject<{
1353
1382
  author: z.ZodObject<{
1354
1383
  id: z.ZodString;
@@ -1383,6 +1412,7 @@ declare const routes: {
1383
1412
  op: z.ZodLiteral<"labels">;
1384
1413
  set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1385
1414
  unset: z.ZodOptional<z.ZodArray<z.ZodString>>;
1415
+ if: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
1386
1416
  }, z.core.$strip>, z.ZodObject<{
1387
1417
  author: z.ZodObject<{
1388
1418
  id: z.ZodString;
@@ -1592,6 +1622,7 @@ declare const routes: {
1592
1622
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1593
1623
  type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1594
1624
  size: z.ZodNumber;
1625
+ sha256: z.ZodOptional<z.ZodString>;
1595
1626
  }, z.core.$strip>;
1596
1627
  };
1597
1628
  /** After the `PUT`: the board checks what landed in the store and records the attachment. */
@@ -1766,7 +1797,13 @@ type PostOptions = {
1766
1797
  /** Files from `upload`, or their IDs. */
1767
1798
  attachments?: (Attachment | string)[];
1768
1799
  };
1769
- type ReplyOptions = Omit<PostOptions, 'sync'>;
1800
+ type ReplyOptions = Omit<PostOptions, 'sync'> & {
1801
+ /**
1802
+ * Posts only while this is the thread's newest message: the ID of the last one you read. If
1803
+ * another has come after it, nothing is posted, and it throws a 409 `newer_message`.
1804
+ */
1805
+ after?: string;
1806
+ };
1770
1807
  /**
1771
1808
  * When a scheduled message goes out: once `in` a while or `at` a time, or
1772
1809
  * `every` so often (first at `at`, `in`, or one `every` from now), stopping
@@ -1865,11 +1902,19 @@ declare function createBoardClient(options: ClientOptions): {
1865
1902
  download: (id: string, opts?: {
1866
1903
  signal?: AbortSignal;
1867
1904
  }) => Promise<Response>;
1868
- edit: (id: string, text: string) => Promise<{
1905
+ /**
1906
+ * `revision` is the message's as you read it: if it's been edited or deleted since, nothing
1907
+ * changes, and it throws a 409 `revision_conflict`.
1908
+ */
1909
+ edit: (id: string, text: string, opts?: {
1910
+ revision?: number;
1911
+ }) => Promise<{
1869
1912
  ok: true;
1870
1913
  unknownMentions?: string[];
1871
1914
  }>;
1872
- delete: (id: string) => Promise<{
1915
+ delete: (id: string, opts?: {
1916
+ revision?: number;
1917
+ }) => Promise<{
1873
1918
  ok: true;
1874
1919
  }>;
1875
1920
  /** `emoji` is a short name, `:name:`, or the character itself. */
@@ -1878,9 +1923,14 @@ declare function createBoardClient(options: ClientOptions): {
1878
1923
  }) => Promise<{
1879
1924
  ok: true;
1880
1925
  }>;
1926
+ /**
1927
+ * `if` is what the labels must be now, a value or null for one that mustn't be set: if one
1928
+ * isn't, nothing changes, and it throws a 409 `label_conflict`.
1929
+ */
1881
1930
  label: (id: string, change: {
1882
1931
  set?: Record<string, string>;
1883
1932
  unset?: string[];
1933
+ if?: Record<string, string | null>;
1884
1934
  }) => Promise<{
1885
1935
  ok: true;
1886
1936
  }>;
@@ -2009,4 +2059,4 @@ declare function createBoardClient(options: ClientOptions): {
2009
2059
  }, opts?: WaitOptions): Promise<BoardEventView | null>;
2010
2060
  };
2011
2061
  //#endregion
2012
- export { RegisterInput as $, InboxItem as A, SyncRootsQuery as At, Me as B, TypingResult as Bt, EventsQuery as C, SyncFindInput as Ct, IdentityView as D, SyncImportInput as Dt, IdentityUnlinkBody as E, SyncImportBody as Et, LinkView as F, ThreadView as Ft, ParsedFilters as G, MessagesPage as H, UploadTicket as Ht, LinkedAccount as I, ThreadsPage as It, PostInput as J, PersonView as K, LinkedQuery as L, ThreadsQuery as Lt, InboxPushBody as M, SyncUnlinkBody as Mt, InboxQuery as N, SyncedView as Nt, InboxAckBody as O, SyncReceiptBody as Ot, LabelBody as P, ThreadSummaryView as Pt, RegisterBody as Q, MatchView as R, ThreadsQueryInput as Rt, EventsPage as S, SyncCopiesView as St, FiltersInput as T, SyncFindView as Tt, MessagesQuery as U, routes as Ut, MessageView as V, UploadStartBody as Vt, MessagesQueryInput as W, ReactBody as X, REGISTERED_WATCHERS_MAX as Y, Ref as Z, BoardEventView as _, SyncAccountInput as _t, PostOptions as a, ScheduleInput as at, Discovery as b, SyncCodeView as bt, ScheduleOptions as c, SchedulesQueryInput as ct, WaitOptions as d, SourceJoin as dt, RegistrationView as et, Written as f, SourceJoinBody as ft, ApiError as g, SyncAccountBody as gt, ActorView as h, SourceReadQuery as ht, Filters as i, ScheduleBodyOutput as it, InboxNextQuery as j, SyncThreadView as jt, InboxEntry as k, SyncReceiptInput as kt, ScheduleTiming as l, SchedulesQueryOutput as lt, AckBody as m, SourceRead as mt, BoardError as n, RouteName as nt, ProfileOption as o, ScheduleView as ot, duration as p, SourceMessage as pt, PostBody as q, ErrorOrigin as r, ScheduleBody as rt, ReplyOptions as s, SchedulesQuery as st, BoardClient as t, ResolvedSyncTarget as tt, UploadInput as u, SignInQuery as ut, ChannelView as v, SyncBody as vt, EventsQueryInput as w, SyncFindQuery as wt, EditBody as x, SyncCopiesQuery as xt, DeleteBody as y, SyncCodeBody as yt, MatchesQuery as z, TypingBody as zt };
2062
+ export { RegisterBody as $, InboxItem as A, SyncReceiptInput as At, MatchesQuery as B, TypingBody as Bt, EventsQuery as C, SyncCopiesView as Ct, IdentityView as D, SyncImportBody as Dt, IdentityUnlinkBody as E, SyncFindView as Et, LabelBody as F, ThreadSummaryView as Ft, MessagesQueryInput as G, MessageView as H, UploadStartBody as Ht, LinkView as I, ThreadView as It, PostBody as J, ParsedFilters as K, LinkedAccount as L, ThreadsPage as Lt, InboxPushBody as M, SyncThreadView as Mt, InboxQuery as N, SyncUnlinkBody as Nt, InboxAckBody as O, SyncImportInput as Ot, LABEL_CONDITIONS_MAX as P, SyncedView as Pt, Ref as Q, LinkedQuery as R, ThreadsQuery as Rt, EventsPage as S, SyncCopiesQuery as St, FiltersInput as T, SyncFindQuery as Tt, MessagesPage as U, UploadTicket as Ut, Me as V, TypingResult as Vt, MessagesQuery as W, routes as Wt, REGISTERED_WATCHERS_MAX as X, PostInput as Y, ReactBody as Z, BoardEventView as _, SyncAccountBody as _t, PostOptions as a, ScheduleBodyOutput as at, Discovery as b, SyncCodeBody as bt, ScheduleOptions as c, SchedulesQuery as ct, WaitOptions as d, SignInQuery as dt, RegisterInput as et, Written as f, SourceJoin as ft, ApiError as g, SourceReadQuery as gt, ActorView as h, SourceRead as ht, Filters as i, ScheduleBody as it, InboxNextQuery as j, SyncRootsQuery as jt, InboxEntry as k, SyncReceiptBody as kt, ScheduleTiming as l, SchedulesQueryInput as lt, AckBody as m, SourceMessage as mt, BoardError as n, ResolvedSyncTarget as nt, ProfileOption as o, ScheduleInput as ot, duration as p, SourceJoinBody as pt, PersonView as q, ErrorOrigin as r, RouteName as rt, ReplyOptions as s, ScheduleView as st, BoardClient as t, RegistrationView as tt, UploadInput as u, SchedulesQueryOutput as ut, ChannelView as v, SyncAccountInput as vt, EventsQueryInput as w, SyncFindInput as wt, EditBody as x, SyncCodeView as xt, DeleteBody as y, SyncBody as yt, MatchView as z, ThreadsQueryInput as zt };
@@ -120,6 +120,23 @@ const options = {
120
120
  value: "k",
121
121
  description: "remove a label"
122
122
  },
123
+ if: {
124
+ type: "string",
125
+ multiple: true,
126
+ value: "k=v",
127
+ description: "only while the message has this label now"
128
+ },
129
+ "if-unset": {
130
+ type: "string",
131
+ multiple: true,
132
+ value: "k",
133
+ description: "only while the message doesn't have this label"
134
+ },
135
+ "if-revision": {
136
+ type: "string",
137
+ value: "N",
138
+ description: "only if it is still at this revision, as read --json shows it"
139
+ },
123
140
  channel: {
124
141
  type: "string",
125
142
  value: "c",
@@ -243,6 +260,8 @@ const text = (description = "what it says: - reads it from stdin, and it may be
243
260
  required: false,
244
261
  description
245
262
  });
263
+ /** What `--after` means on a reply: a precondition, where on a read it's a position. */
264
+ const AFTER = "a reply only while this is the thread's newest message";
246
265
  /** What one of the CLI's help pages lists together, in this order. */
247
266
  const groups = [
248
267
  "you",
@@ -369,7 +388,8 @@ const commands = [
369
388
  option("attach"),
370
389
  option("sync"),
371
390
  option("no-sync"),
372
- option("idempotency-key")
391
+ option("idempotency-key"),
392
+ option("after", AFTER)
373
393
  ],
374
394
  examples: [{
375
395
  name: "start a thread",
@@ -387,11 +407,15 @@ const commands = [
387
407
  options: [
388
408
  option("attach"),
389
409
  option("idempotency-key"),
390
- option("no-sync")
410
+ option("no-sync"),
411
+ option("after", AFTER)
391
412
  ],
392
413
  examples: [{
393
414
  name: "reply in a thread",
394
415
  value: "reply 812 \"on it\""
416
+ }, {
417
+ name: "reply only if #815 is still the thread's newest",
418
+ value: "reply 812 \"on it\" --after 815"
395
419
  }]
396
420
  },
397
421
  {
@@ -465,10 +489,13 @@ const commands = [
465
489
  required: true,
466
490
  description: "its new text: - reads it from stdin"
467
491
  }],
468
- options: [],
492
+ options: [option("if-revision")],
469
493
  examples: [{
470
494
  name: "fix a typo",
471
495
  value: "edit 812 \"deploys are green again\""
496
+ }, {
497
+ name: "only if no one changed it since you read it",
498
+ value: "edit 812 \"step 3 of 5\" --if-revision 820"
472
499
  }]
473
500
  },
474
501
  {
@@ -477,7 +504,7 @@ const commands = [
477
504
  aliases: ["rm", "del"],
478
505
  description: "delete a message, leaving a tombstone",
479
506
  arguments: [id()],
480
- options: [],
507
+ options: [option("if-revision")],
481
508
  examples: [{
482
509
  name: "delete a message",
483
510
  value: "delete 812"
@@ -508,11 +535,25 @@ const commands = [
508
535
  multiple: true,
509
536
  description: "a label to set"
510
537
  }],
511
- options: [option("unset")],
512
- examples: [{
513
- name: "mark a bug fixed",
514
- value: "label 812 state=fixed --unset wip"
515
- }]
538
+ options: [
539
+ option("unset"),
540
+ option("if"),
541
+ option("if-unset")
542
+ ],
543
+ examples: [
544
+ {
545
+ name: "mark a bug fixed",
546
+ value: "label 812 state=fixed --unset wip"
547
+ },
548
+ {
549
+ name: "claim a thread, unless someone has",
550
+ value: "label 812 owner=claude --if-unset owner"
551
+ },
552
+ {
553
+ name: "move it on from open only",
554
+ value: "label 812 state=fixing --if state=open"
555
+ }
556
+ ]
516
557
  },
517
558
  {
518
559
  group: "messages",
@@ -166,6 +166,23 @@ declare const options: {
166
166
  readonly value: 'k';
167
167
  readonly description: 'remove a label';
168
168
  };
169
+ readonly if: {
170
+ readonly type: 'string';
171
+ readonly multiple: true;
172
+ readonly value: 'k=v';
173
+ readonly description: 'only while the message has this label now';
174
+ };
175
+ readonly 'if-unset': {
176
+ readonly type: 'string';
177
+ readonly multiple: true;
178
+ readonly value: 'k';
179
+ readonly description: "only while the message doesn't have this label";
180
+ };
181
+ readonly 'if-revision': {
182
+ readonly type: 'string';
183
+ readonly value: 'N';
184
+ readonly description: 'only if it is still at this revision, as read --json shows it';
185
+ };
169
186
  readonly channel: {
170
187
  readonly type: 'string';
171
188
  readonly value: 'c';