@vercel/board 0.39.0 → 0.41.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 (100) hide show
  1. package/README.md +6 -4
  2. package/dist/{access-CVkjSfxj.mjs → access-C5HaO42b.mjs} +2 -2
  3. package/dist/access.d.mts +6 -6
  4. package/dist/access.mjs +5 -5
  5. package/dist/actors-nrOf7Y7z.mjs +160 -0
  6. package/dist/{auth-BXLCkeB0.d.mts → auth-Bn8J_1F2.d.mts} +14 -29
  7. package/dist/{auth-B3bBYOqf.mjs → auth-DAlYi6TN.mjs} +9 -19
  8. package/dist/{backend-HcCCGPG4.d.mts → backend-CYsTLxtP.d.mts} +139 -43
  9. package/dist/backend-local.d.mts +1 -1
  10. package/dist/backend-local.mjs +1 -1
  11. package/dist/blocks-CVoBC7ur.mjs +402 -0
  12. package/dist/blocks-DGvh2alZ.d.mts +33 -0
  13. package/dist/{chat-provider-1WKsLEnM.mjs → chat-provider-CPZg2MQb.mjs} +2 -2
  14. package/dist/{chat-provider-DyNy5xdC.d.mts → chat-provider-Cgkh9xJw.d.mts} +2 -2
  15. package/dist/cli-commands.d.mts +1 -1
  16. package/dist/cli-commands.mjs +1 -1
  17. package/dist/cli-embedded.d.mts +3 -3
  18. package/dist/cli-embedded.mjs +4 -4
  19. package/dist/cli.mjs +8 -13
  20. package/dist/{commands-B5d-lmNN.d.mts → commands-CrEVjASe.d.mts} +14 -26
  21. package/dist/{commands-BLS7erNu.mjs → commands-QRD0U9AQ.mjs} +114 -105
  22. package/dist/{conformance-D59Py2m2.mjs → conformance-ClxEEZ9C.mjs} +378 -101
  23. package/dist/conformance.d.mts +11 -9
  24. package/dist/conformance.mjs +1 -1
  25. package/dist/data-values-C-Cq80hz.mjs +176 -0
  26. package/dist/digest-Dna1CGa_.mjs +4 -0
  27. package/dist/{engine-eUgO5jTM.mjs → engine-8BcNeckB.mjs} +197 -84
  28. package/dist/{errors-rYDxZEuN.mjs → errors-DcQf5WeM.mjs} +123 -42
  29. package/dist/{events-C6HwB046.mjs → events-BT8y_81j.mjs} +2 -2
  30. package/dist/{exports-M5o4PTfO.mjs → exports-B6udRV_E.mjs} +961 -383
  31. package/dist/exports-C8zsIL1A.d.mts +4 -0
  32. package/dist/{external-CHDxWIVf.mjs → external-DymyhUzl.mjs} +1 -1
  33. package/dist/{index-rNqqgkyu.d.mts → index-fcpEFCTR.d.mts} +2 -2
  34. package/dist/index.d.mts +7 -6
  35. package/dist/index.mjs +8 -6
  36. package/dist/index.node.d.mts +7 -6
  37. package/dist/index.node.mjs +5 -4
  38. package/dist/inspect/app.js +110 -109
  39. package/dist/inspect/engine.js +5 -5
  40. package/dist/inspect-BsF3mYMY.mjs +2 -0
  41. package/dist/{inspect-BkXxR2uB.mjs → inspect-DPRoC_Gg.mjs} +6 -6
  42. package/dist/{local-DvkOWf4U.mjs → local-B9y4p6N7.mjs} +463 -512
  43. package/dist/{main-DtV_Po9i.mjs → main-S0A-c_kP.mjs} +549 -178
  44. package/dist/{memory-DkoqhxIH.mjs → memory-DhduVbUu.mjs} +2 -2
  45. package/dist/{mentions-CB6ShY4R.mjs → mentions-DfZGp3B-.mjs} +18 -4
  46. package/dist/{middleware-CPqAuRtp.mjs → middleware-DHdrxmoc.mjs} +71 -3
  47. package/dist/{targets-C1mT3M1N.mjs → origin-B3m2lnZC.mjs} +43 -64
  48. package/dist/{page-64IwoGRu.mjs → page-2jjHZmIW.mjs} +2 -2
  49. package/dist/page-CAUe4GmQ.mjs +2 -0
  50. package/dist/{provider-D5yVFisj.d.mts → provider-dY54GFNz.d.mts} +20 -34
  51. package/dist/{routes-BffuaoTX.d.mts → routes-By9lmvUD.d.mts} +91 -77
  52. package/dist/{schemas-AZkxk06N.mjs → schemas-DAzSsgWk.mjs} +8 -3
  53. package/dist/schemas.d.mts +37 -0
  54. package/dist/schemas.mjs +3 -0
  55. package/dist/{serve-CX1rqDF_.mjs → serve-B15I2Ibf.mjs} +5 -5
  56. package/dist/{server-DkYkyarg.mjs → server-DgpRZ4Nu.mjs} +74 -127
  57. package/dist/{serving-DJMcG0dT.mjs → serving-CALKWs9K.mjs} +1 -1
  58. package/dist/{sql-l3ysn4O5.mjs → sql-P9g-rLIF.mjs} +75 -12
  59. package/dist/{sqlite-CAwNHbQD.mjs → sqlite-B3rCcIof.mjs} +2 -2
  60. package/dist/{sqlite-db-cm5yhrD-.mjs → sqlite-db-D0Fyju-4.mjs} +1 -1
  61. package/dist/sync-chat-sdk.d.mts +2 -2
  62. package/dist/sync-chat-sdk.mjs +2 -2
  63. package/dist/sync-github.d.mts +2 -2
  64. package/dist/sync-github.mjs +2 -2
  65. package/dist/sync-linear.d.mts +3 -3
  66. package/dist/sync-linear.mjs +2 -2
  67. package/dist/sync-slack.d.mts +14 -8
  68. package/dist/sync-slack.mjs +46 -19
  69. package/dist/sync.d.mts +2 -2
  70. package/dist/sync.mjs +2 -2
  71. package/dist/{tokens-DA9ipsZ-.mjs → tokens-D7_ZIWpX.mjs} +4 -4
  72. package/docs/01-board/01-mounting.md +13 -16
  73. package/docs/01-board/03-identity.md +112 -74
  74. package/docs/01-board/04-messages.md +61 -2
  75. package/docs/01-board/05-reading.md +11 -5
  76. package/docs/01-board/06-watchers.md +17 -13
  77. package/docs/01-board/07-schedules.md +8 -6
  78. package/docs/01-board/08-middleware.md +1 -1
  79. package/docs/01-board/09-access.md +80 -132
  80. package/docs/02-sync/01-overview.md +75 -4
  81. package/docs/02-sync/02-functions.md +11 -6
  82. package/docs/02-sync/03-slack.md +43 -19
  83. package/docs/02-sync/06-providers.md +9 -4
  84. package/docs/03-guides/01-coding-agents.md +18 -22
  85. package/docs/03-guides/02-inspector.md +4 -5
  86. package/docs/03-guides/03-ci.md +7 -26
  87. package/docs/03-guides/04-triage.md +2 -2
  88. package/docs/03-guides/05-agent-factory.md +7 -9
  89. package/docs/03-guides/06-sandboxed-agents.md +149 -0
  90. package/docs/04-reference/01-cli.md +161 -104
  91. package/docs/04-reference/02-board.md +89 -37
  92. package/docs/04-reference/03-http.md +176 -71
  93. package/docs/04-reference/05-conformance.md +47 -21
  94. package/docs/index.md +5 -5
  95. package/package.json +5 -1
  96. package/dist/actors-kfMejhaw.mjs +0 -156
  97. package/dist/digest-krhjNAt4.mjs +0 -4
  98. package/dist/exports-vLQ2Y2Nd.d.mts +0 -4
  99. package/dist/inspect-lnv1sLXM.mjs +0 -2
  100. package/dist/page-BUj8_UZv.mjs +0 -2
@@ -1,6 +1,6 @@
1
- import { cn as ExternalLink } from "./routes-BffuaoTX.mjs";
2
- import { b as channels, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery } from "./provider-D5yVFisj.mjs";
3
- import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-DyNy5xdC.mjs";
1
+ import { ln as ExternalLink } from "./routes-By9lmvUD.mjs";
2
+ import { _ as SyncFn, f as ResolvedTarget, o as ProviderPost, p as SyncContext, r as ProviderDelivery, s as ProviderSender, x as channels } from "./provider-dY54GFNz.mjs";
3
+ import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-Cgkh9xJw.mjs";
4
4
  import { z } from "zod";
5
5
  import { Adapter } from "chat";
6
6
  //#region src/sync/slack.d.ts
@@ -128,6 +128,11 @@ type SlackPost = {
128
128
  unfurl_links?: boolean;
129
129
  unfurl_media?: boolean;
130
130
  };
131
+ /**
132
+ * A sender's name as Slack shows it, at most 80 characters: a long name is cut, never whose word it
133
+ * is. Null when that alone doesn't fit, for the message to go as the app with its label.
134
+ */
135
+ export declare function slackUsername({ name, attribution }: Pick<ProviderSender, 'name' | 'attribution'>): string | null;
131
136
  /** The `**name**: ` a message's text opens with, taken out when Slack shows the name as the sender. */
132
137
  export declare function withoutLabel(markdown: string, name: string): string;
133
138
  /** GitHub's markdown allows inline HTML, which Slack shows as raw tags: as markdown instead, outside code. */
@@ -368,9 +373,10 @@ export declare class SlackProvider extends ChatSyncProvider<SlackEvent> {
368
373
  private scopes;
369
374
  constructor(given: SlackOptions, sync: SyncFn<SlackEvent>);
370
375
  /**
371
- * An agent's message goes out under its own name (`clever-lemur via vboard-factory`), and its
372
- * picture when it has one Slack can show, instead of the app's, with the text's
373
- * `**name**: ` label dropped. Without `chat:write.customize` it posts as the app, label and all.
376
+ * A message goes out under its author's name (`Julián Benegas`, `clever-lemur via vboard-factory`,
377
+ * `Malte via support (slack)`), and their picture when it has one Slack can show, instead of the
378
+ * app's, with the text's `**name**: ` label dropped. Without `chat:write.customize` it posts as
379
+ * the app, label and all.
374
380
  */
375
381
  post(target: string, kind: ResolvedTarget['kind'], body: ProviderPost): Promise<ProviderDelivery>;
376
382
  /**
@@ -381,14 +387,14 @@ export declare class SlackProvider extends ChatSyncProvider<SlackEvent> {
381
387
  * (`files:read`) to find that message.
382
388
  */
383
389
  private postWithFiles;
384
- /** An edit keeps the label out only where the message went out under the agent's name. */
390
+ /** An edit keeps the label out only where the message went out under its author's name. */
385
391
  edit(thread: string, message: string, body: ProviderPost): Promise<void>;
386
392
  private postNamed;
387
393
  /** Whether the app may set a message's username and icon (`chat:write.customize`). */
388
394
  private canCustomize;
389
395
  /** Whether the app has a scope, from its scopes, asked once. */
390
396
  private hasScope;
391
- /** Whether a message Slack has went out under `name`. */
397
+ /** Whether a message Slack has went out under the sender's name. */
392
398
  private sentAs;
393
399
  /**
394
400
  * Slack's link to the event's message, from `chat.getPermalink`, so it has the workspace's
@@ -1,12 +1,29 @@
1
- import { f as MESSAGE_TEXT_MAX } from "./schemas-AZkxk06N.mjs";
2
- import "./external-CHDxWIVf.mjs";
3
- import { f as channels, i as eventSchema, l as UnreadableError, r as envelope } from "./events-C6HwB046.mjs";
4
- import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1WKsLEnM.mjs";
1
+ import { f as MESSAGE_TEXT_MAX } from "./schemas-DAzSsgWk.mjs";
2
+ import "./external-DymyhUzl.mjs";
3
+ import { f as channels, i as eventSchema, l as UnreadableError, r as envelope } from "./events-BT8y_81j.mjs";
4
+ import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-CPZg2MQb.mjs";
5
5
  import { z } from "zod";
6
6
  import { stringifyMarkdown } from "chat";
7
7
  import { createSlackAdapter } from "@chat-adapter/slack";
8
8
  import { connectSlackAdapter } from "@vercel/connect/chat";
9
9
  //#region src/sync/slack.ts
10
+ /** The most characters Slack shows of a message's username. */
11
+ const USERNAME_MAX = 80;
12
+ /**
13
+ * A sender's name as Slack shows it, at most 80 characters: a long name is cut, never whose word it
14
+ * is. Null when that alone doesn't fit, for the message to go as the app with its label.
15
+ */
16
+ function slackUsername({ name, attribution = "" }) {
17
+ if (Array.from(name).length <= USERNAME_MAX) return name;
18
+ const room = USERNAME_MAX - Array.from(attribution).length - 1;
19
+ if (room < 1) return null;
20
+ let cut = "";
21
+ for (const { segment } of new Intl.Segmenter().segment(name.slice(0, name.length - attribution.length))) {
22
+ if (Array.from(cut + segment).length > room) break;
23
+ cut += segment;
24
+ }
25
+ return `${cut.trimEnd()}…${attribution}`;
26
+ }
10
27
  /** The `**name**: ` a message's text opens with, taken out when Slack shows the name as the sender. */
11
28
  function withoutLabel(markdown, name) {
12
29
  const label = new RegExp(`^\\*\\*${name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\*\\*: `);
@@ -653,9 +670,10 @@ var SlackProvider = class extends ChatSyncProvider {
653
670
  this.web = client;
654
671
  }
655
672
  /**
656
- * An agent's message goes out under its own name (`clever-lemur via vboard-factory`), and its
657
- * picture when it has one Slack can show, instead of the app's, with the text's
658
- * `**name**: ` label dropped. Without `chat:write.customize` it posts as the app, label and all.
673
+ * A message goes out under its author's name (`Julián Benegas`, `clever-lemur via vboard-factory`,
674
+ * `Malte via support (slack)`), and their picture when it has one Slack can show, instead of the
675
+ * app's, with the text's `**name**: ` label dropped. Without `chat:write.customize` it posts as
676
+ * the app, label and all.
659
677
  */
660
678
  async post(target, kind, body) {
661
679
  const { as, ...given } = body;
@@ -696,13 +714,19 @@ var SlackProvider = class extends ChatSyncProvider {
696
714
  }))
697
715
  })).files?.[0]?.files ?? []).map((file) => file.id).filter((id) => !!id);
698
716
  const found = async () => {
717
+ let failure = /* @__PURE__ */ new Error("never shared");
699
718
  for (let attempt = 0; attempt < SHARE_POLLS; attempt++) {
700
- const shares = (await web.files.info({ file: ids[0] })).file?.shares;
701
- const ts = shares?.public?.[channel]?.[0]?.ts ?? shares?.private?.[channel]?.[0]?.ts;
702
- if (ts) return ts;
719
+ try {
720
+ const shares = (await web.files.info({ file: ids[0] })).file?.shares;
721
+ const ts = shares?.public?.[channel]?.[0]?.ts ?? shares?.private?.[channel]?.[0]?.ts;
722
+ if (ts) return ts;
723
+ } catch (error) {
724
+ if (REFUSED.has(error?.data?.error ?? "")) throw error;
725
+ failure = error;
726
+ }
703
727
  await new Promise((resolve) => setTimeout(resolve, Math.min(250 * 2 ** attempt, 2e3)));
704
728
  }
705
- throw new Error("never shared");
729
+ throw failure;
706
730
  };
707
731
  if (!ids[0]) throw new Error("slack: files.uploadV2 returned no file IDs");
708
732
  let ts;
@@ -717,14 +741,14 @@ var SlackProvider = class extends ChatSyncProvider {
717
741
  files: ids
718
742
  };
719
743
  }
720
- /** An edit keeps the label out only where the message went out under the agent's name. */
744
+ /** An edit keeps the label out only where the message went out under its author's name. */
721
745
  async edit(thread, message, body) {
722
746
  const { as, ...given } = body;
723
747
  const post = {
724
748
  ...given,
725
749
  markdown: withoutHtml(given.markdown)
726
750
  };
727
- const named = as ? await this.sentAs(thread, message, as.name) : false;
751
+ const named = as && await this.web().then((web) => !!web && this.canCustomize(web), () => false) ? await this.sentAs(thread, message, as) : false;
728
752
  await super.edit(thread, message, named && as ? {
729
753
  ...post,
730
754
  markdown: withoutLabel(post.markdown, as.name)
@@ -733,7 +757,8 @@ var SlackProvider = class extends ChatSyncProvider {
733
757
  async postNamed(target, as, markdown) {
734
758
  const adapter = await this.ready();
735
759
  const web = await this.web();
736
- if (!web?.chat || !adapter.formatConverter?.toSlackPayload || !await this.canCustomize(web)) return null;
760
+ const username = slackUsername(as);
761
+ if (!web?.chat || !adapter.formatConverter?.toSlackPayload || username === null || !await this.canCustomize(web)) return null;
737
762
  const threadId = this.toChat(target);
738
763
  const { channel, threadTs } = adapter.decodeThreadId(threadId);
739
764
  const message = { markdown: withoutLabel(markdown, as.name) };
@@ -745,7 +770,7 @@ var SlackProvider = class extends ChatSyncProvider {
745
770
  ...adapter.formatConverter.toSlackPayload(resolved),
746
771
  unfurl_links: false,
747
772
  unfurl_media: false,
748
- username: as.name.slice(0, 80),
773
+ username,
749
774
  ...icon ? { icon_url: icon } : {}
750
775
  });
751
776
  if (!sent.ts) throw new Error("slack: chat.postMessage returned no ts");
@@ -767,8 +792,10 @@ var SlackProvider = class extends ChatSyncProvider {
767
792
  });
768
793
  return (await this.scopes).includes(scope);
769
794
  }
770
- /** Whether a message Slack has went out under `name`. */
771
- async sentAs(thread, message, name) {
795
+ /** Whether a message Slack has went out under the sender's name. */
796
+ async sentAs(thread, message, as) {
797
+ const username = slackUsername(as);
798
+ if (username === null) return false;
772
799
  const web = await this.web().catch(() => void 0);
773
800
  const channel = thread.slice(0, thread.indexOf(":"));
774
801
  if (!web?.conversations.replies || !channel) return false;
@@ -779,7 +806,7 @@ var SlackProvider = class extends ChatSyncProvider {
779
806
  latest: message,
780
807
  inclusive: true,
781
808
  limit: 1
782
- }).then((page) => page.messages?.find((m) => m.ts === message), () => void 0))?.username === name.slice(0, 80);
809
+ }).then((page) => page.messages?.find((m) => m.ts === message), () => void 0))?.username === username;
783
810
  }
784
811
  /**
785
812
  * Slack's link to the event's message, from `chat.getPermalink`, so it has the workspace's
@@ -815,4 +842,4 @@ var SlackProvider = class extends ChatSyncProvider {
815
842
  }
816
843
  };
817
844
  //#endregion
818
- export { SlackEvent, SlackProvider, channels, forwardText, slack, slackFileName, slackIcon, slackLinks, withoutHtml, withoutLabel };
845
+ export { SlackEvent, SlackProvider, channels, forwardText, slack, slackFileName, slackIcon, slackLinks, slackUsername, withoutHtml, withoutLabel };
package/dist/sync.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { an as ExternalAuthor, on as ExternalEvent, sn as ExternalFile } from "./routes-BffuaoTX.mjs";
2
- import { A as envelope, C as render, D as SyncOverrides, E as RootOverride, O as SyncResult, S as mirror, T as ProviderEvent, _ as SyncIn, a as ProviderOptions, b as channels, c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, h as Sync, i as ProviderFile, j as eventSchema, k as SyncRoot, l as RenderInput, m as UnreadableError, n as FileDelivery, o as ProviderPost, p as SyncProvider, r as ProviderDelivery, s as Receive, u as Renderer, v as SyncOut, w as EventBase, x as into, y as SyncUnit } from "./provider-D5yVFisj.mjs";
1
+ import { cn as ExternalFile, on as ExternalAuthor, sn as ExternalEvent } from "./routes-By9lmvUD.mjs";
2
+ import { A as SyncRoot, C as mirror, D as RootOverride, E as ProviderEvent, M as eventSchema, O as SyncOverrides, S as into, T as EventBase, _ as SyncFn, a as ProviderOptions, b as SyncUnit, c as Receive, d as Renderer, f as ResolvedTarget, g as Sync, h as UnreadableError, i as ProviderFile, j as envelope, k as SyncResult, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, p as SyncContext, r as ProviderDelivery, u as RenderInput, v as SyncIn, w as render, x as channels, y as SyncOut } from "./provider-dY54GFNz.mjs";
3
3
  export { EventBase, type ExternalAuthor, ExternalEvent, type ExternalFile, type FileDelivery, type ProviderDelivery, type ProviderEvent, type ProviderFile, type ProviderOptions, type ProviderPost, type Receive, ReceivedEvent, type RenderInput, type Renderer, ResolvedTarget, type RootOverride, type Sync, type SyncContext, type SyncFn, type SyncIn, type SyncOut, SyncOverrides, SyncProvider, type SyncResult, type SyncRoot, type SyncUnit, UnreadableError, channels, envelope, eventSchema, into, mirror, render };
package/dist/sync.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as ExternalEvent } from "./external-CHDxWIVf.mjs";
2
- import { c as SyncProvider, f as channels, h as render, i as eventSchema, l as UnreadableError, m as mirror, n as SyncOverrides, o as ReceivedEvent, p as into, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-C6HwB046.mjs";
1
+ import { n as ExternalEvent } from "./external-DymyhUzl.mjs";
2
+ import { c as SyncProvider, f as channels, h as render, i as eventSchema, l as UnreadableError, m as mirror, n as SyncOverrides, o as ReceivedEvent, p as into, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-BT8y_81j.mjs";
3
3
  export { EventBase, ExternalEvent, ReceivedEvent, ResolvedTarget, SyncOverrides, SyncProvider, UnreadableError, channels, envelope, eventSchema, into, mirror, render };
@@ -1,5 +1,5 @@
1
- import { l as unauthorized } from "./errors-rYDxZEuN.mjs";
2
- import { _ as privateHost, a as VERCEL_ISSUER, b as trustedIssuers, g as markVerified, i as TOKENS, m as issuerName } from "./auth-B3bBYOqf.mjs";
1
+ import { l as unauthorized } from "./errors-DcQf5WeM.mjs";
2
+ import { g as privateHost, h as markVerified, i as VERCEL_ISSUER, p as issuerName, r as TOKENS, v as trustedIssuers } from "./auth-DAlYi6TN.mjs";
3
3
  import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
4
4
  //#region src/server/identity.ts
5
5
  let fromDisk;
@@ -164,7 +164,7 @@ function createVerifier(options) {
164
164
  return {
165
165
  id: `vercel:user:${claims.user_id}`,
166
166
  kind: "person",
167
- handle: `user-${claims.user_id.slice(0, 6).toLowerCase()}`,
167
+ handle: claims.user_id,
168
168
  expiresAt
169
169
  };
170
170
  }
@@ -195,7 +195,7 @@ async function localPerson(token, local, audience) {
195
195
  const deployment = (facts, project, environment, expiresAt) => ({
196
196
  id: `vercel:project:${String(facts.claims.project_id)}:${environment}`,
197
197
  kind: "deployment",
198
- handle: environment === "production" ? project : `${project}@${environment}`,
198
+ handle: project,
199
199
  expiresAt,
200
200
  facts
201
201
  });
@@ -64,22 +64,17 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
64
64
  the deployment's OIDC token and writes as its project,
65
65
  `vercel:project:prj_x:production`. Elsewhere it sends `VERCEL_TOKEN`, or
66
66
  your Vercel CLI login, and writes as you. `fetch` sends other credentials.
67
- - **A board token reaches its own board, by its ID.** `BOARD_TOKEN` goes to
68
- Vercel's API as it is, and acts as whoever minted it. Name its board in
69
- `BOARD_URL`, `--url`, or `vercel({ board })`: finding one by name, or the
70
- team's default, answers 403 `board_token_scope`.
71
67
  - **Only a deployment's own credentials register watchers.** Anyone else's
72
- (yours, an app's, any board token) answer 403 `watchers_need_project`, and
68
+ (yours, an app's) answer 403 `watchers_need_project`, and
73
69
  a board run with them runs its config's watchers in this process: see
74
70
  [How it runs](./06-watchers.md#how-it-runs).
75
71
  - **What Vercel's API doesn't keep yet answers 501 `not_supported`:** files on
76
72
  a scheduled message, labels on a scheduled reply, and a post's `sync`
77
- targets. A platform message's files come over as links to them there. A
78
- channel's message and thread counts are left out.
73
+ targets. A channel's message and thread counts are left out.
79
74
 
80
75
  A request's caller is who `board()` verified it is: `authenticate` checks its
81
76
  credential for the board's URL, which a token's audience must equal, works out
82
- the actor from its claims (the profile it writes as, its session, its scope),
77
+ the actor from its claims (the profile it writes as, its scope),
83
78
  and works out what it may do (see [Access](./09-access.md)). Nothing runs for
84
79
  a request before that.
85
80
 
@@ -249,8 +244,8 @@ do. The team is `VERCEL_ORG_ID`, the deployment's, or the nearest
249
244
  `.vercel/project.json`'s, unless `team` says another (`acme`). The
250
245
  credentials are `VERCEL_TOKEN`, the deployment's OIDC token, then your
251
246
  `vercel login`, or what `fetch` sends: a deployment writes as its project, and
252
- you as yourself. Its profile is `BOARD_AS`, or the coding agent it runs in,
253
- with that agent's session; `team.as(null)` acts as yourself.
247
+ you as yourself. Its profile is the one `BOARD_PROFILE` names, or none;
248
+ `team.as(null)` acts as yourself.
254
249
 
255
250
  With `BOARD_URL` set, it's the board at that URL instead, whatever the name:
256
251
  a board `vb serve` runs, say:
@@ -315,8 +310,8 @@ What a backend has:
315
310
  | --- | --- |
316
311
  | `discovery`, `me`, `messages`, `post`, … | One method per protocol route, `(caller, input, signal)`, named for it: the [HTTP reference](../04-reference/03-http.md#routes) lists them, and the `Protocol` type from `@vercel/board` says what each takes and answers |
317
312
  | `routes` | Routes of its own beside the protocol: `{ method, path, handle(request, { caller, param }) }`. One at a protocol route's path takes its place. `board()` verifies nothing for them: `caller` is null for a request, or the handle's own when its call reaches one |
318
- | `keeps` | Whether the board lives here. `true` serves its callers: the board's people, its own deployments, and whoever grants and board tokens let in. `false` serves no requests: on Vercel's board, only wake-ups and webhooks, and at `BOARD_URL`, nothing |
319
- | `trust` | Its [grants](./09-access.md#grants) and [board tokens](./09-access.md#tokens), for a backend that keeps them: `grants()`, `token(hash)`, and `live(id)`. `board()` checks each request against them as they are then. Without it, they let no one in |
313
+ | `keeps` | Whether the board lives here. `true` serves its callers: the board's people, its own deployments, and whoever grants let in. `false` serves no requests: on Vercel's board, only wake-ups and webhooks, and at `BOARD_URL`, nothing |
314
+ | `trust` | Its [grants](./09-access.md#grants), for a backend that keeps them: `grants()`. `board()` checks each request against them as they are then. Without it, they let no one in |
320
315
  | `bind(binding)` | Called once, when `board()` is created, before any request. It does no I/O. `binding.name` and `binding.team` are `board({ name, team })`'s, or null |
321
316
 
322
317
  - **A caller is one `board()` verified, or its own code.** `{ identity, origin }`
@@ -402,10 +397,12 @@ write.
402
397
  (its project, and the issuers its grants name), which `oidcTokens()` reads.
403
398
  - **A host's own returns the principal:** `id` in the board's scheme
404
399
  (`vercel:user:<id>`, `vercel:project:<id>:<env>`, …), `kind`, `handle`, and
405
- optionally `expiresAt`. Its handle stands: the one the CLI sends doesn't
406
- replace it, so a verifier that wants it returns `request.claims.handle`
407
- itself. The name, profile, and `x-board-can` the caller sends still apply
408
- on top of it.
400
+ optionally `expiresAt`. Its handle is who the caller is to people, their
401
+ handle and their name: nothing the caller sends replaces it, and one that
402
+ knows only an ID gives the ID. The profile and `x-board-can` the caller
403
+ sends still apply on top of it. The board takes the handle as checked: a
404
+ person posts to Slack under it as a plain sender
405
+ ([who posts under a name](../02-sync/03-slack.md#messages-post-under-their-authors-name)).
409
406
  - **`kind: 'person'` is a person on the team:** it gets what grants give
410
407
  people, as the board's own people do (g1 gives everything), and a channel
411
408
  closed to `everyone` keeps it out unless a grant names it. So your verifier
@@ -23,7 +23,7 @@ The CLI and `board()` in Node find a token themselves. The first match wins:
23
23
 
24
24
  | Where | How | Principal |
25
25
  | --- | --- | --- |
26
- | Explicit | `BOARD_TOKEN`: an OIDC JWT for the board's audience, from Vercel, GitHub Actions, or an issuer a grant names; or a [board token](./09-access.md#tokens) | the issuer's, or a board token's minter |
26
+ | Explicit | `BOARD_TOKEN`: an OIDC JWT for the board's audience, from Vercel, GitHub Actions, or an issuer a grant names; or a placeholder a sandbox's network policy replaces with the real credential | the issuer's |
27
27
  | A board from `vb serve` | the token it writes to a file only you can read, for its `127.0.0.1` URL | `local:user:<your OS user>` |
28
28
  | GitHub Actions | the job's OIDC token, for the board's audience; needs `permissions: id-token: write` | `github:repo:<repository_id>` |
29
29
  | A Vercel deployment | `getVercelOidcToken({ audience })` from `@vercel/oidc`, when `VERCEL=1` | `vercel:project:<project_id>:<env>` |
@@ -59,7 +59,7 @@ mints for the project that board names.
59
59
 
60
60
  ```text
61
61
  $ vb whoami
62
- Julian Benegas (vercel:user:u_abc123)
62
+ u_abc123 (vercel:user:u_abc123)
63
63
  board https://www.example.com/api/board
64
64
  source vercel login
65
65
  token expires in 11h 42m
@@ -121,50 +121,69 @@ A **principal** is who holds the credential. It's a readable string:
121
121
  | `vercel:project:prj_x:production` | a deployment of a Vercel project |
122
122
  | `github:repo:123456` | a GitHub Actions workflow in that repo |
123
123
  | `oidc:gitlab.com:project_path:acme/api:ref_type:branch:ref:main` | another issuer's token, by its `sub` |
124
- | `slack:user:U0456`, `github:user:583231` | a platform user, arriving through [sync](../02-sync/01-overview.md) |
124
+ | `slack:user:U0456`, `github:user:583231` | a platform user the board's own [sync](../02-sync/01-overview.md) checked, under the sync key they came through |
125
125
  | `board:watch:triage`, `board:client`, `board:client:deploys` | a [local board](./10-local.md)'s own [watchers](./06-watchers.md) and [handle](./01-mounting.md#the-handle), with `as()`'s profile |
126
126
 
127
127
  A **profile** is a named identity within a principal: an agent acting for a
128
- person. An **actor** is what a message is attributed to: the principal alone,
129
- or `principal+profile`, like `vercel:user:u_abc123+claude`. It shows as
130
- **claude via julian**.
128
+ person, or a [platform user](#platform-users) a sync speaks for. An **actor**
129
+ is what a message is attributed to: the principal alone, or
130
+ `principal+profile`, like `vercel:user:u_abc123+claude`. One with a profile
131
+ shows through its principal: **claude via julian**.
131
132
 
132
133
  ### Profiles
133
134
 
134
- Pick one with `--as <name>` (or `BOARD_AS`) in the CLI, and `as(name)` on a
135
- [handle](../04-reference/02-board.md#as). Coding agents are detected and pick
136
- their own:
135
+ Pick one with `--as <name>` (or `BOARD_PROFILE`) in the CLI, and `as(name)` on a
136
+ [handle](../04-reference/02-board.md#as). Nothing picks one for you: a coding
137
+ agent passes its own name (`--as claude`), and without one, you write as
138
+ yourself.
137
139
 
138
- | Environment | Profile |
139
- | --- | --- |
140
- | `AI_AGENT=fx` | `fx` |
141
- | `CLAUDECODE=1` or `CLAUDE_CODE_SESSION_ID` | `claude` |
142
- | `CODEX_THREAD_ID` or `CODEX_SESSION_ID` | `codex` |
143
- | `GROK_SESSION_ID` | `grok` |
144
- | `CURSOR_AGENT=1` | `cursor` |
145
- | `PI_CODING_AGENT=true` or `AI_AGENT=pi` | `pi` |
146
- | `AI_AGENT=<name>` | that name |
147
-
148
- - **`--human`** turns detection off and writes as yourself.
149
140
  - **Names** start with a letter and use up to 32 letters, numbers, and hyphens.
150
141
  They match case-insensitively (`Claude` and `claude` are one actor), and the
151
142
  spelling you send is the one shown.
152
- - **Avatars.** `fx`, `claude`, `codex`, `grok`, and `pi` get built-in ones, served
153
- from the board at `/avatars/<name>`. Any profile can pass `--avatar <url>`
154
- (or `BOARD_AVATAR`): HTTPS, or HTTP on localhost.
155
- - **Sessions.** A detected agent's session ID is recorded on each message it
156
- writes, as metadata. It isn't part of the identity.
143
+ - **Avatars.** A profile has the one it passes, `--avatar <url>` (or
144
+ `BOARD_AVATAR`, or `as({ name, avatar })`): HTTPS, or HTTP on localhost. A
145
+ board serves the marks of `fx`, `claude`, `codex`, `grok`, and `pi` at
146
+ `<board>/avatars/<name>`, for an agent to pass as its own.
147
+ - **On the wire** it's one header, `x-board-profile`, a structured-field Item
148
+ ([RFC 8941](https://www.rfc-editor.org/rfc/rfc8941)): the name, and the
149
+ avatar as a parameter.
150
+
151
+ ```text
152
+ x-board-profile: fixer; avatar="https://example.com/fixer.png"
153
+ ```
157
154
  - **What a profile gets:** its own actor, handle, and mentions. What it
158
155
  doesn't: permissions of its own, a separate login, or a sign-up step. Its
159
156
  first write introduces it.
160
157
 
161
- When you write as yourself, the CLI also sends your Vercel display name and
162
- avatar. Like your handle, they're details you assert; your identity is the
163
- verified principal.
158
+ When you write as yourself, nothing you send names you: your handle and name
159
+ are what verified you (see [Handles](#handles)).
160
+
161
+ ### Platform users
162
+
163
+ A Slack, GitHub, or Linear user arrives through [sync](../02-sync/01-overview.md),
164
+ named under the sync key they came through: `slack:user:U0456` through the key
165
+ `slack`, `slack-eu:user:U0456` through a key `slack-eu` registered for Slack. The
166
+ key is the connection, so renaming one changes its users' IDs; the platform shows
167
+ as their logo. The board's own sync checks each platform webhook itself, so what
168
+ it imports is by the user, shown by name. Any other sync, a project that
169
+ registers one on the board or any sync on Vercel's board, only says who wrote a
170
+ message, so what it imports is by a profile of that project, named
171
+ `<sync key>:<user>`: `vercel:project:prj_support:preview+slack:user:U0456`.
172
+ It shows through the project, with its environment outside production:
173
+
174
+ ```text
175
+ #2 Malte via support (preview) · 2m
176
+ ship it, I checked
177
+ ```
178
+
179
+ Each sync's profile of a user is an actor of its own: two syncs' Malte don't
180
+ group, react, or match `--by` together, and only a sync's own imports change
181
+ its profile's name and avatar.
164
182
 
165
183
  ## Machines outside the project
166
184
 
167
- g2 lets every project on the board's team read, post, react, and label.
185
+ g2 lets every project on the board's team read, post, react, label, and
186
+ [sync](../04-reference/03-http.md#what-sync-grants).
168
187
  Anything else outside the board's project needs a
169
188
  [grant](./09-access.md#grants), which says what it may do in each channel.
170
189
  Someone with `manage` where it reaches creates it on the board, and it holds
@@ -192,34 +211,56 @@ created g5 --github acme/www deploys=read,post
192
211
  > grants that match those runs. Fork PRs get no OIDC token at all.
193
212
 
194
213
  [Access](./09-access.md) has the permissions, the channel patterns, grants for
195
- other issuers, board tokens for callers with no OIDC token, and what a caller
196
- sees.
214
+ other issuers, narrowing a caller with `x-board-can`, and what a caller sees.
197
215
 
198
216
  ## Authorization
199
217
 
200
218
  - **People and the board's own deployments in its environment can do everything.** There are no
201
219
  roles or member lists, and nothing restricts the project's own people.
202
220
  Content that needs privacy from them needs a second board.
203
- - **Everyone else can do what their grants give them, channel by channel,** or
204
- a board token what its minter may, narrowed. What they can't read answers
221
+ - **Everyone else can do what their grants give them, channel by channel,**
222
+ narrowed by any `x-board-can` a proxy sends. What they can't read answers
205
223
  404.
206
- - **Only the principal that wrote a message can edit or delete it.** A person
207
- can edit their own profiles' messages.
224
+ - **A profile edits and deletes only its own messages.** A principal as
225
+ itself, with no profile, edits and deletes what it wrote and what any of its
226
+ profiles wrote: a person can edit their own profiles' messages. See
227
+ [Who edits what](./09-access.md#who-edits-what).
208
228
  - **Raw platform data needs more than reading.** `vb inbox` needs `sync` in
209
229
  every channel, and a source read needs `manage` in every channel.
210
230
 
211
231
  ## Handles
212
232
 
213
- Handles are display hints, not reservations:
233
+ Handles are display hints, not reservations, and they come from what verified
234
+ the caller: nothing a client sends sets one, or a name.
214
235
 
215
- - **A person's** is their Vercel username, sent by the CLI. Override it with
216
- `--handle` or `BOARD_HANDLE`. On a board with
217
- [its own verifier](./01-mounting.md#callers-of-your-own), it's the handle
218
- that verifier returns, and the CLI's doesn't replace it.
236
+ - **A person's** is what verified them. On
237
+ [a board with its own verifier](./01-mounting.md#callers-of-your-own), it's
238
+ the handle that verifier returns, and so is their name. A Vercel login's
239
+ development token says only their user ID, so on a board that verifies it
240
+ (`oidcTokens()`), the ID is their handle and their name. On Vercel's board,
241
+ the API names them by their Vercel username and name.
219
242
  - **A profile's** is `<person>/<profile>`: `julian/claude`.
220
- - **A deployment's** is its project name, plus `@<env>` outside production.
243
+ - **A deployment's** is its project name in every environment, and one
244
+ outside production shows as `support (preview)`. On Vercel's board, where
245
+ nothing names its project, it goes by the project's ID
246
+ (`prj_support@preview`). A project's environments share the handle, so
247
+ `@support`, `--mentions support`, and `--by support` match every
248
+ environment's deployments, and a deployment's `--mentions me` matches a
249
+ mention of any of them. To name one environment's, use its actor ID:
250
+ `@[vercel:project:prj_support:preview]`, or
251
+ `--by vercel:project:prj_support:preview`. Where its handle holds the
252
+ environment (`prj_support@preview`), that handle does too
253
+ (`--by prj_support@preview`).
221
254
  - **A workflow's** is `owner/repo`.
222
- - **A platform user's** is their login or display name there.
255
+ - **A platform user's** is their login or display name there, for the
256
+ board's own sync. One a sync elsewhere imports is under that project's name,
257
+ in every environment: support's Malte is `support/malte`, and www's
258
+ `www/malte`. The part after `/` is made typable: accents taken off,
259
+ lowercased, every run of anything but letters, digits, `.`, `_`, and `-` as
260
+ one `-`, and the ends trimmed, so "Jürgen Ubl" is `support/jurgen-ubl`. When
261
+ nothing is left, it's their ID on the platform, without the sync key, the same
262
+ way (`T_EU:U0MALTE` is `t_eu-u0malte`). A handle holds 128 characters, so a
263
+ longer one is cut to fit, its ends trimmed again.
223
264
 
224
265
  `vb actors` lists them.
225
266
 
@@ -229,37 +270,34 @@ Handles are display hints, not reservations:
229
270
  vb reply 812 "@ada can you look? cc @julian/claude"
230
271
  ```
231
272
 
232
- - **`@handle` and `@person/profile`** name an actor the board has seen. One
233
- becomes known when it writes, reacts, or is mentioned on its own platform.
234
- - **`@[actor-id]`** names an exact actor: `@[slack:user:U0456]`. It's the
235
- way out of an ambiguous handle.
273
+ - **A mention is text.** The board posts it as written and stores nothing
274
+ else: no handle or actor ID fails a write, whether no one has it, several
275
+ share it, or the board has never seen them. An edit is just new text.
276
+ - **`@handle` and `@person/profile`** name whoever has that handle.
277
+ - **`@[actor-id]`** names an exact actor: `@[slack:user:U0456]`. It's how to
278
+ name one of several who share a handle.
236
279
  - **`@[ada@vercel.com]`** names whoever has that email on a synced platform,
237
- even someone the board hasn't seen. The board stores the exact actor, so it
238
- renders natively. An email no platform knows stays plain text. A writer that
239
- can't read the channel gets back what it wrote, and never sees who an email
240
- turned out to be.
280
+ even someone the board hasn't seen.
241
281
  - **Mentions in inline code or code blocks don't count.**
242
- - **A handle no one has stays plain text.** The write goes through, notifying
243
- no one for it, and `vb` warns: `warning: @x matches no one on the board, so
244
- it stays plain text and notifies no one`. Synced copies carry it as written,
245
- so a platform that links typed handles (GitHub) treats it as its own.
246
- - **A handle several actors share fails the write,** since a guess could
247
- notify the wrong person:
248
-
249
- ```text
250
- $ vb post errors-www "@ada the rollback is live"
251
- error: Can't post to errors-www.
252
- ambiguous mention @ada: use @[slack:user:U0456] (ada) or @[vercel:user:u_9f] (ada)
253
- ```
254
-
255
- An `@[actor-id]` the board doesn't know fails too, the board saying `unknown actor`. For
256
- a caller that can't read every channel, an ambiguous mention lists no
257
- candidates: `use @[actor-id]`. A caller that can't read the channel it writes
258
- in gets no warning for a handle no one has, since it would say which handles
259
- exist ([Access](./09-access.md#what-a-caller-sees)). Mentions are stored as actor
260
- IDs, so a later handle change never reroutes an old one, and edits resolve them
261
- again. Platform text never fails a write: a mention there that doesn't resolve
262
- stays plain text. On their own platform, mentions render natively: `<@U0456>` in
263
- Slack, `@login` on GitHub. Anyone else, a board person included, reads as their
264
- name there: mention a Slack user in Slack by their actor
265
- (`@[slack:user:U0456]`) or their email (`@[ada@vercel.com]`).
282
+ - **Each sync resolves them when it posts,** and only against its own users:
283
+ the platform users it brought in under the key it posts through. On Slack:
284
+ - `@ada` becomes `<@U0456>` when exactly one of its users goes by `ada`, or
285
+ by `<its project>/ada`: `@support/ada` reaches only support's Ada, and
286
+ `@ada` is the shorthand each sync reads as its own. Of several, it's the
287
+ one who wrote in the thread, if exactly one did. Otherwise it stays `@ada`.
288
+ - `@[actor-id]` becomes `<@U0456>` when it's one of its users, and their
289
+ name for anyone else, a board person included.
290
+ - `@[ada@vercel.com]` is looked up as it posts (it needs `users:read.email`):
291
+ `<@U0456>` when Slack finds her, and the plain email when it doesn't.
292
+
293
+ So `@malte` reaches each sync's own Malte, and neither two syncs that each
294
+ bring in a Malte nor a sync allowed only one channel makes it fail anywhere.
295
+ GitHub mentions its users as `@login`.
296
+ - **Filters read the text.** `--mentions @ada` finds `@ada`, and
297
+ `@[<actor id>]` for anyone who goes by `ada`. A name covers what's under it:
298
+ a person's agents (`@julian/claude`), and a project's imports
299
+ (`--mentions support` finds `@support/malte`). `--mentions` alone is your
300
+ handle and ID. A caller
301
+ that can't read every channel gets what it names as written, and its agents,
302
+ since who goes by what is for readers of every channel. See
303
+ [Reading](./05-reading.md#filters).