@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.
- package/README.md +6 -4
- package/dist/{access-CVkjSfxj.mjs → access-C5HaO42b.mjs} +2 -2
- package/dist/access.d.mts +6 -6
- package/dist/access.mjs +5 -5
- package/dist/actors-nrOf7Y7z.mjs +160 -0
- package/dist/{auth-BXLCkeB0.d.mts → auth-Bn8J_1F2.d.mts} +14 -29
- package/dist/{auth-B3bBYOqf.mjs → auth-DAlYi6TN.mjs} +9 -19
- package/dist/{backend-HcCCGPG4.d.mts → backend-CYsTLxtP.d.mts} +139 -43
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/blocks-CVoBC7ur.mjs +402 -0
- package/dist/blocks-DGvh2alZ.d.mts +33 -0
- package/dist/{chat-provider-1WKsLEnM.mjs → chat-provider-CPZg2MQb.mjs} +2 -2
- package/dist/{chat-provider-DyNy5xdC.d.mts → chat-provider-Cgkh9xJw.d.mts} +2 -2
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +3 -3
- package/dist/cli-embedded.mjs +4 -4
- package/dist/cli.mjs +8 -13
- package/dist/{commands-B5d-lmNN.d.mts → commands-CrEVjASe.d.mts} +14 -26
- package/dist/{commands-BLS7erNu.mjs → commands-QRD0U9AQ.mjs} +114 -105
- package/dist/{conformance-D59Py2m2.mjs → conformance-ClxEEZ9C.mjs} +378 -101
- package/dist/conformance.d.mts +11 -9
- package/dist/conformance.mjs +1 -1
- package/dist/data-values-C-Cq80hz.mjs +176 -0
- package/dist/digest-Dna1CGa_.mjs +4 -0
- package/dist/{engine-eUgO5jTM.mjs → engine-8BcNeckB.mjs} +197 -84
- package/dist/{errors-rYDxZEuN.mjs → errors-DcQf5WeM.mjs} +123 -42
- package/dist/{events-C6HwB046.mjs → events-BT8y_81j.mjs} +2 -2
- package/dist/{exports-M5o4PTfO.mjs → exports-B6udRV_E.mjs} +961 -383
- package/dist/exports-C8zsIL1A.d.mts +4 -0
- package/dist/{external-CHDxWIVf.mjs → external-DymyhUzl.mjs} +1 -1
- package/dist/{index-rNqqgkyu.d.mts → index-fcpEFCTR.d.mts} +2 -2
- package/dist/index.d.mts +7 -6
- package/dist/index.mjs +8 -6
- package/dist/index.node.d.mts +7 -6
- package/dist/index.node.mjs +5 -4
- package/dist/inspect/app.js +110 -109
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-BsF3mYMY.mjs +2 -0
- package/dist/{inspect-BkXxR2uB.mjs → inspect-DPRoC_Gg.mjs} +6 -6
- package/dist/{local-DvkOWf4U.mjs → local-B9y4p6N7.mjs} +463 -512
- package/dist/{main-DtV_Po9i.mjs → main-S0A-c_kP.mjs} +549 -178
- package/dist/{memory-DkoqhxIH.mjs → memory-DhduVbUu.mjs} +2 -2
- package/dist/{mentions-CB6ShY4R.mjs → mentions-DfZGp3B-.mjs} +18 -4
- package/dist/{middleware-CPqAuRtp.mjs → middleware-DHdrxmoc.mjs} +71 -3
- package/dist/{targets-C1mT3M1N.mjs → origin-B3m2lnZC.mjs} +43 -64
- package/dist/{page-64IwoGRu.mjs → page-2jjHZmIW.mjs} +2 -2
- package/dist/page-CAUe4GmQ.mjs +2 -0
- package/dist/{provider-D5yVFisj.d.mts → provider-dY54GFNz.d.mts} +20 -34
- package/dist/{routes-BffuaoTX.d.mts → routes-By9lmvUD.d.mts} +91 -77
- package/dist/{schemas-AZkxk06N.mjs → schemas-DAzSsgWk.mjs} +8 -3
- package/dist/schemas.d.mts +37 -0
- package/dist/schemas.mjs +3 -0
- package/dist/{serve-CX1rqDF_.mjs → serve-B15I2Ibf.mjs} +5 -5
- package/dist/{server-DkYkyarg.mjs → server-DgpRZ4Nu.mjs} +74 -127
- package/dist/{serving-DJMcG0dT.mjs → serving-CALKWs9K.mjs} +1 -1
- package/dist/{sql-l3ysn4O5.mjs → sql-P9g-rLIF.mjs} +75 -12
- package/dist/{sqlite-CAwNHbQD.mjs → sqlite-B3rCcIof.mjs} +2 -2
- package/dist/{sqlite-db-cm5yhrD-.mjs → sqlite-db-D0Fyju-4.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +2 -2
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +2 -2
- package/dist/sync-slack.d.mts +14 -8
- package/dist/sync-slack.mjs +46 -19
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{tokens-DA9ipsZ-.mjs → tokens-D7_ZIWpX.mjs} +4 -4
- package/docs/01-board/01-mounting.md +13 -16
- package/docs/01-board/03-identity.md +112 -74
- package/docs/01-board/04-messages.md +61 -2
- package/docs/01-board/05-reading.md +11 -5
- package/docs/01-board/06-watchers.md +17 -13
- package/docs/01-board/07-schedules.md +8 -6
- package/docs/01-board/08-middleware.md +1 -1
- package/docs/01-board/09-access.md +80 -132
- package/docs/02-sync/01-overview.md +75 -4
- package/docs/02-sync/02-functions.md +11 -6
- package/docs/02-sync/03-slack.md +43 -19
- package/docs/02-sync/06-providers.md +9 -4
- package/docs/03-guides/01-coding-agents.md +18 -22
- package/docs/03-guides/02-inspector.md +4 -5
- package/docs/03-guides/03-ci.md +7 -26
- package/docs/03-guides/04-triage.md +2 -2
- package/docs/03-guides/05-agent-factory.md +7 -9
- package/docs/03-guides/06-sandboxed-agents.md +149 -0
- package/docs/04-reference/01-cli.md +161 -104
- package/docs/04-reference/02-board.md +89 -37
- package/docs/04-reference/03-http.md +176 -71
- package/docs/04-reference/05-conformance.md +47 -21
- package/docs/index.md +5 -5
- package/package.json +5 -1
- package/dist/actors-kfMejhaw.mjs +0 -156
- package/dist/digest-krhjNAt4.mjs +0 -4
- package/dist/exports-vLQ2Y2Nd.d.mts +0 -4
- package/dist/inspect-lnv1sLXM.mjs +0 -2
- package/dist/page-BUj8_UZv.mjs +0 -2
package/dist/sync-slack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
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
|
-
*
|
|
372
|
-
* picture when it has one Slack can show, instead of the
|
|
373
|
-
* `**name**: ` label dropped. Without `chat:write.customize` it posts as
|
|
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
|
|
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
|
|
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
|
package/dist/sync-slack.mjs
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import { f as MESSAGE_TEXT_MAX } from "./schemas-
|
|
2
|
-
import "./external-
|
|
3
|
-
import { f as channels, i as eventSchema, l as UnreadableError, r as envelope } from "./events-
|
|
4
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
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
|
-
*
|
|
657
|
-
* picture when it has one Slack can show, instead of the
|
|
658
|
-
* `**name**: ` label dropped. Without `chat:write.customize` it posts as
|
|
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
|
-
|
|
701
|
-
|
|
702
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
771
|
-
async sentAs(thread, message,
|
|
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 ===
|
|
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 {
|
|
2
|
-
import { A as
|
|
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-
|
|
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-
|
|
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-
|
|
2
|
-
import {
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
253
|
-
|
|
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
|
|
319
|
-
| `trust` | Its [grants](./09-access.md#grants)
|
|
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
|
|
406
|
-
|
|
407
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
129
|
-
|
|
130
|
-
|
|
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 `
|
|
135
|
-
[handle](../04-reference/02-board.md#as).
|
|
136
|
-
|
|
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.**
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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,
|
|
162
|
-
|
|
163
|
-
|
|
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
|
|
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,
|
|
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,**
|
|
204
|
-
|
|
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
|
-
- **
|
|
207
|
-
|
|
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
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
|
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
|
-
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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.
|
|
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
|
-
- **
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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).
|