@vercel/board 0.48.0 → 0.49.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 (84) hide show
  1. package/dist/{access-C06pIr0M.mjs → access-B8DnrnHa.mjs} +29 -17
  2. package/dist/access.d.mts +2 -2
  3. package/dist/access.mjs +5 -5
  4. package/dist/{actors-Dkyg-oo0.mjs → actors-DewJKyqy.mjs} +4 -3
  5. package/dist/{auth-B9-wXQ-x.mjs → auth-CEU06Nyp.mjs} +2 -2
  6. package/dist/{auth-li3lKwJG.d.mts → auth-Z9-Khvvw.d.mts} +1 -1
  7. package/dist/{backend-UBP6HimX.d.mts → backend-BzCXxVZ-.d.mts} +19 -5
  8. package/dist/backend-local.d.mts +1 -1
  9. package/dist/backend-local.mjs +1 -1
  10. package/dist/{bots-CLKKMgYf.mjs → bots-CqPYxkqK.mjs} +15 -8
  11. package/dist/{chat-provider-kNWd6MQC.mjs → chat-provider-BS_fr61g.mjs} +2 -2
  12. package/dist/{chat-provider-iN0DFsSE.d.mts → chat-provider-DQ1GHm4o.d.mts} +2 -2
  13. package/dist/cli-commands.d.mts +1 -1
  14. package/dist/cli-commands.mjs +1 -1
  15. package/dist/cli-embedded.d.mts +2 -2
  16. package/dist/cli-embedded.mjs +3 -3
  17. package/dist/cli.mjs +6 -6
  18. package/dist/client-C2T4eaXd.d.mts +544 -0
  19. package/dist/{commands-CJsOA-hf.d.mts → commands-Cm4sODIu.d.mts} +12 -8
  20. package/dist/{commands-Dk6_cHLS.mjs → commands-nN8WpvCe.mjs} +75 -58
  21. package/dist/{conformance-CDP8y2Zm.mjs → conformance-0xONNKcB.mjs} +102 -20
  22. package/dist/conformance.d.mts +1 -1
  23. package/dist/conformance.mjs +1 -1
  24. package/dist/{engine-B3Yd0OPc.mjs → engine-BH_nfJ3N.mjs} +10 -8
  25. package/dist/{errors-QhkdzI-o.mjs → errors-DwV7I0g4.mjs} +53 -174
  26. package/dist/{events-B-qyxNsJ.mjs → events-B76-4bNp.mjs} +2 -2
  27. package/dist/{exports-inhbjAWi.d.mts → exports-CKEK1fxf.d.mts} +4 -4
  28. package/dist/{exports-B5xOYHj_.mjs → exports-DLzyKwEp.mjs} +336 -82
  29. package/dist/{external-BuVTXT1R.mjs → external-BLI4W_-V.mjs} +1 -1
  30. package/dist/{index-B0Fnhvk7.d.mts → index-DxqSw8yd.d.mts} +2 -2
  31. package/dist/index.d.mts +6 -6
  32. package/dist/index.mjs +4 -4
  33. package/dist/index.node.d.mts +7 -7
  34. package/dist/index.node.mjs +4 -4
  35. package/dist/inspect/app.js +39 -39
  36. package/dist/inspect/engine.js +3 -3
  37. package/dist/inspect-B2ImmOvw.mjs +272 -0
  38. package/dist/inspect-DnRQUmP8.mjs +2 -0
  39. package/dist/inspect.d.mts +17 -0
  40. package/dist/inspect.mjs +196 -0
  41. package/dist/{local-CKMP4xH3.mjs → local-DPpSEq2_.mjs} +132 -50
  42. package/dist/{main-DZZQEFVl.mjs → main-CqX7JqzE.mjs} +217 -49
  43. package/dist/{memory-CMm-Fk_A.mjs → memory-DzqkXIB-.mjs} +2 -2
  44. package/dist/{middleware-CT6vMNUc.mjs → middleware-ysFm2S4v.mjs} +2 -2
  45. package/dist/{page-D-OzDOAX.mjs → page-7KWSGxyC.mjs} +12 -2
  46. package/dist/page-CN77B014.mjs +2 -0
  47. package/dist/profile-header-Cj0Cb1cf.mjs +163 -0
  48. package/dist/{provider-DC3WHUXo.d.mts → provider-Dwb_9mnu.d.mts} +3 -529
  49. package/dist/{routes-CjA6Mp4D.d.mts → routes-B6SEA9yw.d.mts} +130 -4
  50. package/dist/{routes-ABXf3CKq.mjs → routes-qS92xz8U.mjs} +33 -7
  51. package/dist/{schemas-7VFdomFB.mjs → schemas-TeVe4Udh.mjs} +4 -2
  52. package/dist/{serve-DBJTP0xd.mjs → serve-CYr4RwRM.mjs} +5 -5
  53. package/dist/{server-DmlyIzMj.mjs → server-V7qyVUiJ.mjs} +11 -9
  54. package/dist/{serving-BNdiReQT.mjs → serving-BzNxlnDV.mjs} +1 -1
  55. package/dist/{inspect-CAz9PGLf.mjs → shell-BLHZoP-x.mjs} +25 -274
  56. package/dist/{sql-IEbO5vXs.mjs → sql-DIKQd5Me.mjs} +2 -2
  57. package/dist/{sqlite-CVG8XKHm.mjs → sqlite-BF9kBDh1.mjs} +2 -2
  58. package/dist/{sqlite-db-BJjPQYx4.mjs → sqlite-db-CSYwiZ4E.mjs} +1 -1
  59. package/dist/sync-chat-sdk.d.mts +2 -2
  60. package/dist/sync-chat-sdk.mjs +2 -2
  61. package/dist/sync-github.d.mts +2 -2
  62. package/dist/sync-github.mjs +2 -2
  63. package/dist/sync-linear.d.mts +3 -3
  64. package/dist/sync-linear.mjs +2 -2
  65. package/dist/sync-slack.d.mts +3 -3
  66. package/dist/sync-slack.mjs +12 -8
  67. package/dist/sync.d.mts +2 -2
  68. package/dist/sync.mjs +2 -2
  69. package/dist/{task-batch-CmKvTLSu.mjs → task-batch-CujTLmTB.mjs} +10 -11
  70. package/dist/{tokens-BCp4EWTQ.mjs → tokens-BmCDAT4N.mjs} +2 -2
  71. package/dist/version-BCoWGLEW.mjs +5 -0
  72. package/docs/01-board/01-mounting.md +8 -0
  73. package/docs/01-board/04-messages.md +6 -2
  74. package/docs/01-board/05-reading.md +17 -2
  75. package/docs/01-board/09-access.md +40 -6
  76. package/docs/01-board/11-tasks.md +3 -3
  77. package/docs/03-guides/02-inspector.md +31 -0
  78. package/docs/04-reference/01-cli.md +81 -32
  79. package/docs/04-reference/02-board.md +14 -3
  80. package/docs/04-reference/03-http.md +5 -3
  81. package/docs/04-reference/05-conformance.md +7 -0
  82. package/package.json +5 -1
  83. package/dist/inspect-CNECs4UG.mjs +0 -2
  84. package/dist/page-Dr9Aqlej.mjs +0 -2
@@ -112,17 +112,17 @@ const options = {
112
112
  type: "string",
113
113
  multiple: true,
114
114
  value: "file",
115
- description: "attach a file, up to 10 per message"
115
+ description: "attach a file: up to 10 per message, each up to 100 MB (4 MB on some boards)"
116
116
  },
117
- "text-file": {
117
+ file: {
118
118
  type: "string",
119
119
  value: "path",
120
- description: "the text, from a file: - reads stdin"
120
+ description: "from a file: - reads stdin"
121
121
  },
122
- "tasks-file": {
122
+ data: {
123
123
  type: "string",
124
- value: "path",
125
- description: "several tasks, from a JSON file: - reads stdin"
124
+ value: "json",
125
+ description: "as JSON, written inline"
126
126
  },
127
127
  unset: {
128
128
  type: "string",
@@ -219,6 +219,10 @@ const options = {
219
219
  value: "pattern=perms",
220
220
  description: "what they may do, repeated: perms, all, or none"
221
221
  },
222
+ "lock-me-out": {
223
+ type: "boolean",
224
+ description: "go ahead with a change you couldn't take back"
225
+ },
222
226
  user: {
223
227
  type: "string",
224
228
  multiple: true,
@@ -395,8 +399,8 @@ const options = {
395
399
  },
396
400
  schema: {
397
401
  type: "string",
398
- value: "json|@file",
399
- description: "its JSON Schema: inline, @<file>, or - for stdin"
402
+ value: "schema",
403
+ description: "the text is JSON for this schema, such as sandbox@1"
400
404
  },
401
405
  description: {
402
406
  type: "string",
@@ -508,7 +512,7 @@ const id = (description = "a message ID, as read shows it (#812)") => ({
508
512
  required: true,
509
513
  description
510
514
  });
511
- const text = (description = "what it says: - reads it from stdin, and it may be left out when you --attach or --text-file") => ({
515
+ const text = (description = "what it says: - reads it from stdin, and it may be left out when you --attach or --file") => ({
512
516
  name: "text",
513
517
  required: false,
514
518
  description
@@ -594,16 +598,22 @@ const commands = [
594
598
  "event",
595
599
  "claim"
596
600
  ].map((name) => option(name)),
597
- option("can", "what they may do, repeated: perms, all, or none", "pattern=perms")
601
+ option("can", "what they may do, repeated: perms, all, or none", "pattern=perms"),
602
+ option("file", "several grants, made in one write, from a JSON file: - reads stdin"),
603
+ option("lock-me-out")
598
604
  ],
599
605
  examples: [
600
606
  {
601
- name: "close security/ to everyone",
607
+ name: "let two people into security/",
608
+ value: "grants create --user alice@acme.com --user bob@acme.com --can 'security/=all'"
609
+ },
610
+ {
611
+ name: "then close it to everyone else",
602
612
  value: "grants create --everyone --can 'security/=none'"
603
613
  },
604
614
  {
605
- name: "and let two people in",
606
- value: "grants create --user alice@acme.com --user bob@acme.com --can 'security/=all'"
615
+ name: "several grants in one write, from a file",
616
+ value: "grants create --file grants.json"
607
617
  },
608
618
  {
609
619
  name: "a project's production and previews",
@@ -627,31 +637,35 @@ const commands = [
627
637
  required: true,
628
638
  description: "its ID, as grants shows it (g3)"
629
639
  }],
630
- options: [...[
631
- "add-user",
632
- "add-project",
633
- "add-github",
634
- "add-oidc",
635
- "add-app",
636
- "add-all-users",
637
- "add-all-projects",
638
- "add-all-apps",
639
- "add-everyone",
640
- "remove-user",
641
- "remove-project",
642
- "remove-github",
643
- "remove-oidc",
644
- "remove-app",
645
- "remove-all-users",
646
- "remove-all-projects",
647
- "remove-all-apps",
648
- "remove-everyone",
649
- "environment",
650
- "workflow",
651
- "git-branch",
652
- "event",
653
- "claim"
654
- ].map((name) => option(name)), option("can", "replaces what it lets them do", "pattern=perms")],
640
+ options: [
641
+ ...[
642
+ "add-user",
643
+ "add-project",
644
+ "add-github",
645
+ "add-oidc",
646
+ "add-app",
647
+ "add-all-users",
648
+ "add-all-projects",
649
+ "add-all-apps",
650
+ "add-everyone",
651
+ "remove-user",
652
+ "remove-project",
653
+ "remove-github",
654
+ "remove-oidc",
655
+ "remove-app",
656
+ "remove-all-users",
657
+ "remove-all-projects",
658
+ "remove-all-apps",
659
+ "remove-everyone",
660
+ "environment",
661
+ "workflow",
662
+ "git-branch",
663
+ "event",
664
+ "claim"
665
+ ].map((name) => option(name)),
666
+ option("can", "replaces what it lets them do", "pattern=perms"),
667
+ option("lock-me-out")
668
+ ],
655
669
  examples: [{
656
670
  name: "let another person in",
657
671
  value: "grants update g4 --add-user carol@acme.com"
@@ -696,7 +710,7 @@ const commands = [
696
710
  required: true,
697
711
  description: "its ID, as grants shows it (g3)"
698
712
  }],
699
- options: [],
713
+ options: [option("lock-me-out")],
700
714
  examples: [{
701
715
  name: "revoke a grant",
702
716
  value: "grants revoke g3"
@@ -788,13 +802,17 @@ const commands = [
788
802
  required: true,
789
803
  description: "its name and version, such as sandbox@1"
790
804
  }],
791
- options: [option("schema"), option("description")],
805
+ options: [
806
+ option("file", "its JSON Schema, from a file: - reads stdin"),
807
+ option("data", "its JSON Schema, written inline"),
808
+ option("description")
809
+ ],
792
810
  examples: [{
793
811
  name: "register a version from a file",
794
- value: "schemas create sandbox@1 --schema @sandbox.schema.json --description 'What a sandbox did.'"
812
+ value: "schemas create sandbox@1 --file sandbox.schema.json --description 'What a sandbox did.'"
795
813
  }, {
796
814
  name: "or inline",
797
- value: `schemas create ping@1 --schema '{"type":"object","required":["at"],"properties":{"at":{"type":"string","format":"date-time"}}}'`
815
+ value: `schemas create ping@1 --data '{"type":"object","required":["at"],"properties":{"at":{"type":"string","format":"date-time"}}}'`
798
816
  }]
799
817
  }
800
818
  ]
@@ -819,7 +837,7 @@ const commands = [
819
837
  required: false,
820
838
  description: "a channel (every channel without one), a message's ID, or a Slack or GitHub link the board synced"
821
839
  }],
822
- options: [option("limit", "threads to list (default: 50)")],
840
+ options: [option("limit", "threads to list (default: 50, at most 500)")],
823
841
  filters: true,
824
842
  examples: [
825
843
  {
@@ -856,8 +874,8 @@ const commands = [
856
874
  }, text()],
857
875
  options: [
858
876
  option("label", "label it", "k=v"),
859
- option("text-file"),
860
- option("schema", "the text is JSON for this schema, such as sandbox@1", "schema"),
877
+ option("file", "the text, from a file: - reads stdin"),
878
+ option("schema"),
861
879
  option("attach"),
862
880
  option("sync"),
863
881
  option("no-sync"),
@@ -886,8 +904,8 @@ const commands = [
886
904
  arguments: [id("the ID of a message in the thread"), text()],
887
905
  options: [
888
906
  option("label", "label it", "k=v"),
889
- option("text-file"),
890
- option("schema", "the text is JSON for this schema, such as sandbox@1", "schema"),
907
+ option("file", "the text, from a file: - reads stdin"),
908
+ option("schema"),
891
909
  option("attach"),
892
910
  option("idempotency-key"),
893
911
  option("no-sync"),
@@ -926,8 +944,8 @@ const commands = [
926
944
  option("for"),
927
945
  option("times"),
928
946
  option("label", "label it", "k=v"),
929
- option("text-file"),
930
- option("schema", "the text is JSON for this schema, such as sandbox@1", "schema"),
947
+ option("file", "the text, from a file: - reads stdin"),
948
+ option("schema"),
931
949
  option("attach"),
932
950
  option("no-sync")
933
951
  ],
@@ -981,11 +999,11 @@ const commands = [
981
999
  arguments: [id(), {
982
1000
  name: "text",
983
1001
  required: false,
984
- description: "its new text: - reads it from stdin, and it may be left out when you --text-file"
1002
+ description: "its new text: - reads it from stdin, and it may be left out when you --file"
985
1003
  }],
986
1004
  options: [
987
- option("text-file"),
988
- option("schema", "the text is JSON for this schema, such as sandbox@1", "schema"),
1005
+ option("file", "the text, from a file: - reads stdin"),
1006
+ option("schema"),
989
1007
  option("if-revision")
990
1008
  ],
991
1009
  examples: [{
@@ -1032,7 +1050,7 @@ const commands = [
1032
1050
  name: "k=v",
1033
1051
  required: false,
1034
1052
  multiple: true,
1035
- description: "a label to set"
1053
+ description: "a label to set: a key of up to 64 lowercase letters, numbers, ., _, and -, starting with a letter or number, and a value of up to 256 characters"
1036
1054
  }],
1037
1055
  options: [
1038
1056
  option("unset"),
@@ -1211,7 +1229,7 @@ const commands = [
1211
1229
  subcommands: [
1212
1230
  {
1213
1231
  name: "create",
1214
- description: "start a thread as a task, or with an ID, make that thread one: you own it. With --tasks-file, a plan of them",
1232
+ description: "start a thread as a task, or with an ID, make that thread one: you own it. With --file, a plan of them",
1215
1233
  arguments: [{
1216
1234
  name: "channel|id",
1217
1235
  required: true,
@@ -1219,7 +1237,7 @@ const commands = [
1219
1237
  }, {
1220
1238
  name: "text",
1221
1239
  required: false,
1222
- description: "what to do, for a new thread: - reads it from stdin, and it may be left out when you --text-file or --tasks-file"
1240
+ description: "what to do, for a new thread: - reads it from stdin, and --file takes its place"
1223
1241
  }],
1224
1242
  options: [
1225
1243
  option("label", "label it, to route it", "k=v"),
@@ -1227,8 +1245,7 @@ const commands = [
1227
1245
  option("for", "only this profile of yours claims it", "profile"),
1228
1246
  claimNow,
1229
1247
  option("lease", "with --claim: how long to hold it"),
1230
- option("text-file"),
1231
- option("tasks-file", "a JSON array of tasks, each { key?, text, labels?, needs?, for?, noSync?, attachments? }: all of them, in as many writes as it takes"),
1248
+ option("file", "a plan, from a JSON file (- reads stdin): an array of tasks, each { key?, text, labels?, needs?, for?, noSync?, attachments? }, all made, in as many writes as it takes"),
1232
1249
  option("no-sync"),
1233
1250
  option("idempotency-key", "sending the same one again makes it once")
1234
1251
  ],
@@ -1247,7 +1264,7 @@ const commands = [
1247
1264
  },
1248
1265
  {
1249
1266
  name: "a plan of tasks that wait for each other",
1250
- value: "tasks create work --tasks-file plan.json --idempotency-key migration-7"
1267
+ value: "tasks create work --file plan.json --idempotency-key migration-7"
1251
1268
  }
1252
1269
  ]
1253
1270
  },
@@ -1,7 +1,7 @@
1
- import { f as BoardError } from "./errors-QhkdzI-o.mjs";
2
- import "./routes-ABXf3CKq.mjs";
1
+ import "./routes-qS92xz8U.mjs";
2
+ import { f as BoardError } from "./errors-DwV7I0g4.mjs";
3
3
  import { c as canonical, t as block } from "./blocks-CVoBC7ur.mjs";
4
- import { a as canText, c as compileAccess } from "./access-C06pIr0M.mjs";
4
+ import { a as canText, c as compileAccess } from "./access-B8DnrnHa.mjs";
5
5
  //#region src/conformance/index.ts
6
6
  var Mismatch = class extends Error {};
7
7
  const show = (value) => JSON.stringify(value) ?? String(value);
@@ -142,9 +142,9 @@ const messageOf = (error) => error instanceof Error ? error.message : String(err
142
142
  async function withGrants(ctx, check) {
143
143
  const made = [];
144
144
  const grants = {
145
- async make(input, by) {
145
+ async make(input, by, options) {
146
146
  try {
147
- const { grant } = await (by ?? ctx.board).createGrant(input);
147
+ const { grant } = await (by ?? ctx.board).createGrant(input, options);
148
148
  made.push(grant.id);
149
149
  return grant;
150
150
  } catch (error) {
@@ -152,6 +152,34 @@ async function withGrants(ctx, check) {
152
152
  throw unnamed(error) ?? error;
153
153
  }
154
154
  },
155
+ async makeAll(inputs) {
156
+ try {
157
+ const { grants: all } = await ctx.board.createGrants(inputs);
158
+ const closes = (grant) => grant.principals.some((principal) => principal.kind === "everyone");
159
+ made.push(...all.filter((grant) => !closes(grant)).map((grant) => grant.id), ...all.filter(closes).map((grant) => grant.id));
160
+ return all;
161
+ } catch (error) {
162
+ throw unnamed(error) ?? error;
163
+ }
164
+ },
165
+ self() {
166
+ const [source, kind, id, environment] = ctx.me.principal.split(":");
167
+ if (source === "board") return null;
168
+ if (ctx.me.kind === "person") return {
169
+ kind: "user",
170
+ userId: ctx.me.principal.split(":").slice(2).join(":")
171
+ };
172
+ if (kind === "project" && id && environment) return {
173
+ kind: "project",
174
+ project: id,
175
+ environments: [environment]
176
+ };
177
+ if (kind === "app" && id) return {
178
+ kind: "app",
179
+ app: id
180
+ };
181
+ throw new Skip("closing a pattern to everyone would close it to this run too, which no grant could keep in: it's neither a person, a project, nor an app");
182
+ },
155
183
  async deny(by, input, what) {
156
184
  try {
157
185
  const { grant } = await by.createGrant(input);
@@ -168,21 +196,8 @@ async function withGrants(ctx, check) {
168
196
  return ctx.withCan(canText(compileAccess(can)));
169
197
  },
170
198
  async keep(pattern) {
171
- const [source, kind, id, environment] = ctx.me.principal.split(":");
172
- if (source === "board") return;
173
- const self = ctx.me.kind === "person" ? {
174
- kind: "user",
175
- userId: ctx.me.principal.split(":").slice(2).join(":")
176
- } : kind === "project" && id && environment ? {
177
- kind: "project",
178
- project: id,
179
- environments: [environment]
180
- } : kind === "app" && id ? {
181
- kind: "app",
182
- app: id
183
- } : null;
184
- if (!self) throw new Skip("closing a pattern to everyone would close it to this run too, which no grant could keep in: it's neither a person, a project, nor an app");
185
- await grants.make({
199
+ const self = grants.self();
200
+ if (self) await grants.make({
186
201
  principals: [self],
187
202
  can: { [pattern]: "all" }
188
203
  });
@@ -2090,6 +2105,73 @@ const CHECKS = [
2090
2105
  }, `a grant from a caller narrowed out of ${open}, which everyone reads`);
2091
2106
  })
2092
2107
  },
2108
+ {
2109
+ group: "grants",
2110
+ name: "refuses a grant its maker couldn't take back, unless it says lockMeOut",
2111
+ run: (ctx) => withGrants(ctx, async ({ make }) => {
2112
+ const pattern = `${subtreeOf(ctx)}lockout/`;
2113
+ await make(grantFor(ctx), void 0, { lockMeOut: true }).catch((error) => {
2114
+ if (error instanceof BoardError && error.status === 400) throw new Mismatch(`a grant that says lockMeOut: expected it made, got ${error.status} ${error.code}`);
2115
+ throw error;
2116
+ });
2117
+ const before = (await ctx.board.grants()).length;
2118
+ let made;
2119
+ try {
2120
+ made = (await ctx.board.createGrant({
2121
+ principals: [{ kind: "everyone" }],
2122
+ can: { [pattern]: [] }
2123
+ })).grant;
2124
+ } catch (error) {
2125
+ if (!(error instanceof BoardError) || error.status !== 409 || error.code !== "grant_lockout") throw new Mismatch(`closing ${pattern} to everyone, this run included: expected 409 grant_lockout, got ${error instanceof BoardError ? `${error.status} ${error.code}` : messageOf(error)}`);
2126
+ same((await ctx.board.grants()).length, before, "how many grants there are after the one refused");
2127
+ return;
2128
+ }
2129
+ await ctx.board.revokeGrant(made.id).catch((error) => {
2130
+ throw new Mismatch(`closing ${pattern} to everyone, this run included: expected 409 grant_lockout, and the board made ${made.id}, which this run can't revoke now (${messageOf(error)})`);
2131
+ });
2132
+ return "nothing locks this run out of a channel, so no grant it makes is a lockout: it owns the board, or it's the board's own code";
2133
+ })
2134
+ },
2135
+ {
2136
+ group: "grants",
2137
+ name: "makes several grants in one write, or none of them, a lock with the grant that keeps its maker in",
2138
+ run: (ctx) => withGrants(ctx, async ({ make, makeAll, self }) => {
2139
+ const subtree = subtreeOf(ctx);
2140
+ const pattern = `${subtree}batch/`;
2141
+ const lock = {
2142
+ principals: [{ kind: "everyone" }],
2143
+ can: { [pattern]: [] }
2144
+ };
2145
+ const me = self();
2146
+ await make({
2147
+ principals: [projectFor(ctx)],
2148
+ can: { [`${subtree}batch/ci/`]: ["read"] }
2149
+ });
2150
+ const made = await makeAll(me ? [
2151
+ lock,
2152
+ {
2153
+ principals: [me],
2154
+ can: { [pattern]: "all" }
2155
+ },
2156
+ grantFor(ctx)
2157
+ ] : [lock, grantFor(ctx)]);
2158
+ alike(made.map((grant) => grant.principals[0]?.kind), me ? [
2159
+ "everyone",
2160
+ me.kind,
2161
+ "project"
2162
+ ] : ["everyone", "project"], "the batch's grants, in the order given");
2163
+ check(new Set(made.map((grant) => grant.id)).size === made.length, `each of a batch's grants should have its own ID, got ${show(made.map((grant) => grant.id))}`);
2164
+ const listed = (await ctx.board.grants()).map((grant) => grant.id);
2165
+ check(made.every((grant) => listed.includes(grant.id)), `grants should list each one a batch made, got ${show(listed)}`);
2166
+ await rejects(ctx.board.createGrants([grantFor(ctx), {
2167
+ principals: [projectFor(ctx)],
2168
+ can: { [`${subtree}*/ci`]: ["post"] }
2169
+ }]), 400, "invalid_grant", "a batch with a grant whose pattern isn't one");
2170
+ const after = (await ctx.board.grants()).map((grant) => grant.id);
2171
+ for (const id of after) if (!listed.includes(id)) await ctx.board.revokeGrant(id);
2172
+ alike(after, listed, "the grants after a batch that was refused");
2173
+ })
2174
+ },
2093
2175
  {
2094
2176
  group: "grants",
2095
2177
  name: "lets a member grant on a pattern after a lock under it",
@@ -1,4 +1,4 @@
1
- import { f as Board } from "./backend-UBP6HimX.mjs";
1
+ import { f as Board } from "./backend-BzCXxVZ-.mjs";
2
2
  //#region src/conformance/index.d.ts
3
3
  /**
4
4
  * Checks that a board speaks the protocol, through a handle on it (`conformance(board())`), as
@@ -1,2 +1,2 @@
1
- import { t as conformance } from "./conformance-CDP8y2Zm.mjs";
1
+ import { t as conformance } from "./conformance-0xONNKcB.mjs";
2
2
  export { conformance };
@@ -1,11 +1,12 @@
1
- import { C as fileSize, T as typeOf, c as notFound, r as badRequest, t as HttpError, x as IMPORT_BYTES_MAX, y as ATTACHMENT_BYTES_MAX } from "./errors-QhkdzI-o.mjs";
2
- import { N as toStorable, m as MESSAGE_TEXT_MAX, s as ChannelPath } from "./schemas-7VFdomFB.mjs";
3
- import { l as isThreadTarget, s as channelOf } from "./external-BuVTXT1R.mjs";
1
+ import { c as fileSize, i as ATTACHMENT_BYTES_MAX, o as IMPORT_BYTES_MAX, u as typeOf } from "./profile-header-Cj0Cb1cf.mjs";
2
+ import { N as toStorable, m as MESSAGE_TEXT_MAX, s as ChannelPath } from "./schemas-TeVe4Udh.mjs";
3
+ import { l as isThreadTarget, s as channelOf } from "./external-BLI4W_-V.mjs";
4
4
  import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
5
- import { a as waitUntil, c as platformProfile, f as viaText, i as afterRetry, l as shownName, m as derivedId, o as actorParts, t as DroppedError } from "./middleware-CT6vMNUc.mjs";
5
+ import { c as notFound, r as badRequest, t as HttpError } from "./errors-DwV7I0g4.mjs";
6
+ import { a as waitUntil, c as platformProfile, f as viaText, i as afterRetry, l as shownName, m as derivedId, o as actorParts, t as DroppedError } from "./middleware-ysFm2S4v.mjs";
6
7
  import { a as replaceMentions, n as isEmail, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
7
- import { a as immutable, d as opensBlock, f as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-B-qyxNsJ.mjs";
8
- import { i as vercelDeployments, n as displayText } from "./bots-CLKKMgYf.mjs";
8
+ import { a as immutable, d as opensBlock, f as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-B76-4bNp.mjs";
9
+ import { i as vercelDeployments, n as displayText, t as byVercelBot } from "./bots-CqPYxkqK.mjs";
9
10
  //#region src/sync/engine.ts
10
11
  /** `files`: a message with files may have no text. */
11
12
  const clampText = (raw, files = false) => {
@@ -1010,10 +1011,11 @@ function createSyncEngine(entries) {
1010
1011
  const name = `${own}${after}`;
1011
1012
  const attribution = `${environment}${after}`;
1012
1013
  const platform = platformOf(key);
1014
+ const bot = byVercelBot(message, actor);
1013
1015
  const body = (renderer ?? ((input) => platform.render(input)))(immutable({
1014
1016
  message: {
1015
1017
  ...structuredClone(message),
1016
- text: displayText(message.text, message.by.actor)
1018
+ text: displayText(message.text, bot)
1017
1019
  },
1018
1020
  author: actor ? { ...actor } : null,
1019
1021
  mentionOf: (id) => nativeMention(key, id, actors),
@@ -1023,7 +1025,7 @@ function createSyncEngine(entries) {
1023
1025
  if (typeof body !== "string") throw badRequest("a provider renderer must return markdown");
1024
1026
  const labeled = `**${name}**: `;
1025
1027
  const markdown = await textFor(key, actors, body.startsWith(labeled) && opensBlock(body.slice(labeled.length)) ? `**${name}**:\n\n${body.slice(labeled.length)}` : body);
1026
- const deployments = message.by.actor === "github:user:35613825" ? vercelDeployments(message.text) : null;
1028
+ const deployments = bot ? vercelDeployments(message.text) : null;
1027
1029
  return {
1028
1030
  markdown,
1029
1031
  ...actor?.verified ? { as: {