@vercel/board 0.46.0 → 0.47.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 (82) hide show
  1. package/dist/{access-Crbvd2Dm.mjs → access-C06pIr0M.mjs} +1 -1
  2. package/dist/access.d.mts +2 -2
  3. package/dist/access.mjs +4 -4
  4. package/dist/{actors-BBphaJ_G.mjs → actors-Dkyg-oo0.mjs} +2 -2
  5. package/dist/{auth-C-pFnJBA.mjs → auth-B9-wXQ-x.mjs} +29 -9
  6. package/dist/{auth-CkNXnQno.d.mts → auth-li3lKwJG.d.mts} +1 -1
  7. package/dist/{backend-D3p8gjba.d.mts → backend-i_esjwUS.d.mts} +21 -4
  8. package/dist/backend-local.d.mts +1 -1
  9. package/dist/backend-local.mjs +1 -1
  10. package/dist/{chat-provider-Bn33acHd.d.mts → chat-provider-BWBGZOZY.d.mts} +4 -2
  11. package/dist/{chat-provider-1zpY6Qo_.mjs → chat-provider-CD7jskh7.mjs} +7 -4
  12. package/dist/cli-commands.d.mts +1 -1
  13. package/dist/cli-commands.mjs +1 -1
  14. package/dist/cli-embedded.d.mts +2 -2
  15. package/dist/cli-embedded.mjs +2 -2
  16. package/dist/cli.mjs +46 -15
  17. package/dist/{commands-CSZPQ38I.d.mts → commands-CJsOA-hf.d.mts} +6 -0
  18. package/dist/{commands-D0lyo8O8.mjs → commands-Dk6_cHLS.mjs} +6 -0
  19. package/dist/{conformance-Blzd4CXG.mjs → conformance-CDP8y2Zm.mjs} +94 -3
  20. package/dist/conformance.d.mts +1 -1
  21. package/dist/conformance.mjs +1 -1
  22. package/dist/{engine-C_SlBihU.mjs → engine-j2VeNuKG.mjs} +43 -50
  23. package/dist/{errors-DZ1tbwSM.mjs → errors-QhkdzI-o.mjs} +27 -8
  24. package/dist/{events-mGuhF4i5.mjs → events-MOcxGpOQ.mjs} +1 -1
  25. package/dist/{exports-DQauuHrc.mjs → exports-CEqS-IPP.mjs} +205 -56
  26. package/dist/{exports-DUX_Yzo7.d.mts → exports-CF9rKCXd.d.mts} +4 -4
  27. package/dist/{external-BVr1Sq0y.mjs → external-BuVTXT1R.mjs} +6 -2
  28. package/dist/{index-BHXg4Xdo.d.mts → index-ttfx1TZ6.d.mts} +2 -2
  29. package/dist/index.d.mts +6 -6
  30. package/dist/index.mjs +4 -4
  31. package/dist/index.node.d.mts +7 -7
  32. package/dist/index.node.mjs +4 -4
  33. package/dist/inspect/app.js +44 -44
  34. package/dist/inspect/engine.js +1 -1
  35. package/dist/inspect-8YAhl_h3.mjs +2 -0
  36. package/dist/{inspect-2OIjv2lW.mjs → inspect-vOSrW_g6.mjs} +82 -32
  37. package/dist/{local-11FMUJrU.mjs → local-0ajWOVhN.mjs} +92 -50
  38. package/dist/{main-BYmbTDgo.mjs → main-B8Zkd4Pm.mjs} +127 -46
  39. package/dist/{memory-CZBdVNn8.mjs → memory-CMm-Fk_A.mjs} +2 -2
  40. package/dist/{mentions-DfZGp3B-.mjs → mentions-CnWt9Z5b.mjs} +34 -1
  41. package/dist/{middleware-BKsTcMAv.mjs → middleware-CT6vMNUc.mjs} +1 -1
  42. package/dist/{provider-D3bfHRHA.d.mts → provider-Bc3xI90K.d.mts} +82 -5
  43. package/dist/{routes-B2HHHD_C.mjs → routes-ABXf3CKq.mjs} +17 -4
  44. package/dist/{routes-NEc6w3QC.d.mts → routes-CjA6Mp4D.d.mts} +70 -0
  45. package/dist/serve-BepKXDH3.mjs +285 -0
  46. package/dist/{server-Ch3tuK2k.mjs → server-4rQL3xuH.mjs} +38 -19
  47. package/dist/{serving-9riPNrHk.mjs → serving-BNdiReQT.mjs} +1 -1
  48. package/dist/{sql-Bml29DpM.mjs → sql-IEbO5vXs.mjs} +2 -2
  49. package/dist/{sqlite-4C5u7-ag.mjs → sqlite-CVG8XKHm.mjs} +2 -2
  50. package/dist/{sqlite-db-eVb9v3zc.mjs → sqlite-db-BJjPQYx4.mjs} +1 -1
  51. package/dist/sync-chat-sdk.d.mts +16 -2
  52. package/dist/sync-chat-sdk.mjs +2 -2
  53. package/dist/sync-github.d.mts +16 -2
  54. package/dist/sync-github.mjs +3 -3
  55. package/dist/sync-linear.d.mts +17 -3
  56. package/dist/sync-linear.mjs +2 -2
  57. package/dist/sync-slack.d.mts +17 -3
  58. package/dist/sync-slack.mjs +106 -14
  59. package/dist/sync.d.mts +2 -2
  60. package/dist/sync.mjs +2 -2
  61. package/dist/{task-batch-BJcLiYe1.mjs → task-batch-BZXm6kOE.mjs} +6 -6
  62. package/dist/{tokens-DPKF_cb5.mjs → tokens-BCp4EWTQ.mjs} +2 -2
  63. package/docs/01-board/01-mounting.md +7 -4
  64. package/docs/01-board/03-identity.md +43 -23
  65. package/docs/01-board/04-messages.md +3 -2
  66. package/docs/01-board/06-watchers.md +3 -3
  67. package/docs/01-board/07-schedules.md +2 -2
  68. package/docs/01-board/09-access.md +6 -4
  69. package/docs/01-board/10-local.md +4 -1
  70. package/docs/02-sync/01-overview.md +4 -5
  71. package/docs/02-sync/02-functions.md +2 -2
  72. package/docs/02-sync/03-slack.md +8 -5
  73. package/docs/02-sync/06-providers.md +8 -0
  74. package/docs/03-guides/02-inspector.md +17 -1
  75. package/docs/03-guides/06-sandboxed-agents.md +2 -2
  76. package/docs/03-guides/08-tailnet.md +123 -0
  77. package/docs/04-reference/01-cli.md +56 -15
  78. package/docs/04-reference/02-board.md +10 -5
  79. package/docs/04-reference/03-http.md +24 -3
  80. package/package.json +1 -1
  81. package/dist/inspect-F-b4GPXX.mjs +0 -2
  82. package/dist/serve-DS2T2iWI.mjs +0 -181
@@ -1,5 +1,5 @@
1
- import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-D3bfHRHA.mjs";
2
- import { n as ChatSyncProvider } from "./chat-provider-Bn33acHd.mjs";
1
+ import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-Bc3xI90K.mjs";
2
+ import { n as ChatSyncProvider } from "./chat-provider-BWBGZOZY.mjs";
3
3
  import { z } from "zod";
4
4
  import { Adapter } from "chat";
5
5
  //#region src/sync/github.d.ts
@@ -77,6 +77,13 @@ export declare const GitHubEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
77
77
  }, z.core.$strip>>;
78
78
  }, z.core.$strip>>;
79
79
  }, z.core.$strip>>>;
80
+ mentioned: z.ZodOptional<z.ZodArray<z.ZodObject<{
81
+ id: z.ZodString;
82
+ handle: z.ZodString;
83
+ name: z.ZodString;
84
+ avatar: z.ZodNullable<z.ZodString>;
85
+ isBot: z.ZodBoolean;
86
+ }, z.core.$strip>>>;
80
87
  id: z.ZodString;
81
88
  key: z.ZodString;
82
89
  platform: z.ZodLiteral<"github">;
@@ -149,6 +156,13 @@ export declare const GitHubEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
149
156
  }, z.core.$strip>>;
150
157
  }, z.core.$strip>>>;
151
158
  linksOnly: z.ZodOptional<z.ZodBoolean>;
159
+ mentioned: z.ZodOptional<z.ZodArray<z.ZodObject<{
160
+ id: z.ZodString;
161
+ handle: z.ZodString;
162
+ name: z.ZodString;
163
+ avatar: z.ZodNullable<z.ZodString>;
164
+ isBot: z.ZodBoolean;
165
+ }, z.core.$strip>>>;
152
166
  id: z.ZodString;
153
167
  key: z.ZodString;
154
168
  platform: z.ZodLiteral<"github">;
@@ -1,5 +1,5 @@
1
- import { _ as withRoutes, i as eventSchema, m as into, r as envelope } from "./events-mGuhF4i5.mjs";
2
- import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1zpY6Qo_.mjs";
1
+ import { _ as withRoutes, i as eventSchema, m as into, r as envelope } from "./events-MOcxGpOQ.mjs";
2
+ import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-CD7jskh7.mjs";
3
3
  import { n as tagOf } from "./tags-BpFo6q0_.mjs";
4
4
  import { z } from "zod";
5
5
  import { connectGitHubAdapter } from "@vercel/connect/chat";
@@ -409,7 +409,7 @@ var GitHubProvider = class extends ChatSyncProvider {
409
409
  platform: "github",
410
410
  adapter: options.adapter,
411
411
  canStartThreads: false,
412
- mention: (actor) => actor.id.startsWith("github:user:") ? `@${actor.handle}` : null,
412
+ mention: (actor) => actor.id.startsWith("github:user:") ? `@${actor.name}` : null,
413
413
  resolveChannel: (key) => Promise.resolve(key),
414
414
  groupThread: (thread) => thread.replace(/:rc:[^:]+$/, ""),
415
415
  channelOf,
@@ -1,6 +1,6 @@
1
- import { Ot as SourceRead } from "./routes-NEc6w3QC.mjs";
2
- import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-D3bfHRHA.mjs";
3
- import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-Bn33acHd.mjs";
1
+ import { Ot as SourceRead } from "./routes-CjA6Mp4D.mjs";
2
+ import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-Bc3xI90K.mjs";
3
+ import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-BWBGZOZY.mjs";
4
4
  import { z } from "zod";
5
5
  import { Adapter } from "chat";
6
6
  //#region src/sync/linear.d.ts
@@ -47,6 +47,13 @@ export declare const LinearEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
47
47
  }, z.core.$strip>>;
48
48
  }, z.core.$strip>>;
49
49
  }, z.core.$strip>>>;
50
+ mentioned: z.ZodOptional<z.ZodArray<z.ZodObject<{
51
+ id: z.ZodString;
52
+ handle: z.ZodString;
53
+ name: z.ZodString;
54
+ avatar: z.ZodNullable<z.ZodString>;
55
+ isBot: z.ZodBoolean;
56
+ }, z.core.$strip>>>;
50
57
  id: z.ZodString;
51
58
  key: z.ZodString;
52
59
  raw: z.ZodUnknown;
@@ -81,6 +88,13 @@ export declare const LinearEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
81
88
  }, z.core.$strip>>;
82
89
  }, z.core.$strip>>>;
83
90
  linksOnly: z.ZodOptional<z.ZodBoolean>;
91
+ mentioned: z.ZodOptional<z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ handle: z.ZodString;
94
+ name: z.ZodString;
95
+ avatar: z.ZodNullable<z.ZodString>;
96
+ isBot: z.ZodBoolean;
97
+ }, z.core.$strip>>>;
84
98
  id: z.ZodString;
85
99
  key: z.ZodString;
86
100
  raw: z.ZodUnknown;
@@ -1,5 +1,5 @@
1
- import { i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mGuhF4i5.mjs";
2
- import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1zpY6Qo_.mjs";
1
+ import { i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-MOcxGpOQ.mjs";
2
+ import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-CD7jskh7.mjs";
3
3
  import { n as tagOf, t as slug } from "./tags-BpFo6q0_.mjs";
4
4
  import "zod";
5
5
  import { connectLinearAdapter } from "@vercel/connect/chat";
@@ -1,6 +1,6 @@
1
- import { Nn as ExternalLink } from "./routes-NEc6w3QC.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-D3bfHRHA.mjs";
3
- import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-Bn33acHd.mjs";
1
+ import { Nn as ExternalLink } from "./routes-CjA6Mp4D.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-Bc3xI90K.mjs";
3
+ import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-BWBGZOZY.mjs";
4
4
  import { z } from "zod";
5
5
  import { Adapter } from "chat";
6
6
  //#region src/sync/slack-deployments.d.ts
@@ -260,6 +260,13 @@ export declare const SlackEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
260
260
  }, z.core.$strip>>;
261
261
  }, z.core.$strip>>;
262
262
  }, z.core.$strip>>>;
263
+ mentioned: z.ZodOptional<z.ZodArray<z.ZodObject<{
264
+ id: z.ZodString;
265
+ handle: z.ZodString;
266
+ name: z.ZodString;
267
+ avatar: z.ZodNullable<z.ZodString>;
268
+ isBot: z.ZodBoolean;
269
+ }, z.core.$strip>>>;
263
270
  id: z.ZodString;
264
271
  key: z.ZodString;
265
272
  raw: z.ZodUnknown;
@@ -294,6 +301,13 @@ export declare const SlackEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
294
301
  }, z.core.$strip>>;
295
302
  }, z.core.$strip>>>;
296
303
  linksOnly: z.ZodOptional<z.ZodBoolean>;
304
+ mentioned: z.ZodOptional<z.ZodArray<z.ZodObject<{
305
+ id: z.ZodString;
306
+ handle: z.ZodString;
307
+ name: z.ZodString;
308
+ avatar: z.ZodNullable<z.ZodString>;
309
+ isBot: z.ZodBoolean;
310
+ }, z.core.$strip>>>;
297
311
  id: z.ZodString;
298
312
  key: z.ZodString;
299
313
  raw: z.ZodUnknown;
@@ -1,7 +1,8 @@
1
1
  import { m as MESSAGE_TEXT_MAX } from "./schemas-7VFdomFB.mjs";
2
- import "./external-BVr1Sq0y.mjs";
3
- import { d as opensBlock, i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mGuhF4i5.mjs";
4
- import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-1zpY6Qo_.mjs";
2
+ import "./external-BuVTXT1R.mjs";
3
+ import { t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
4
+ import { d as opensBlock, i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-MOcxGpOQ.mjs";
5
+ import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-CD7jskh7.mjs";
5
6
  import { r as formatVercelDeployments } from "./bots-CLKKMgYf.mjs";
6
7
  import { z } from "zod";
7
8
  import { stringifyMarkdown } from "chat";
@@ -114,6 +115,86 @@ function deploymentsLayout(markdown, deployments, as = {}) {
114
115
  }
115
116
  //#endregion
116
117
  //#region src/sync/slack.ts
118
+ /**
119
+ * How a user a Slack message mentions stands in what the adapter reads of it: their ID between two
120
+ * characters from Unicode's private use area, which nothing along the way escapes or rewrites.
121
+ */
122
+ const MENTIONED = /@\uF8F0([A-Z0-9_]+)\uF8F1/g;
123
+ const mentionedAs = (user) => `\uF8F0${user}\uF8F1`;
124
+ /** What the adapter read of a Slack message, each user it mentions as board writes a mention: `@[slack:user:U0456]`. */
125
+ const mentionsById = (text) => text.replace(MENTIONED, "@[slack:user:$1]");
126
+ /** Each `@` the adapter reads as a mention: one that opens a word, and isn't Slack's own `<@U0456>` or inside a word, as an email's is. */
127
+ const BARE_MENTION = /(?<![<A-Za-z0-9_])@(?=[A-Za-z0-9_])/g;
128
+ /** A character `text` doesn't have, from Unicode's private use area, or null if it has them all. */
129
+ function unusedIn(text) {
130
+ for (let code = 57344; code <= 63743; code++) if (!text.includes(String.fromCharCode(code))) return String.fromCharCode(code);
131
+ return null;
132
+ }
133
+ /**
134
+ * A message as the adapter converts it, each bare `@` standing as a character its text doesn't have,
135
+ * and `back`, which puts them in what the adapter made of it. Only a string, or a message's
136
+ * `markdown` or `raw`, is text: anything else goes as it is.
137
+ */
138
+ function withoutBareMentions(message) {
139
+ const asIs = {
140
+ given: message,
141
+ back: (text) => text
142
+ };
143
+ const fields = message;
144
+ const field = typeof message === "string" ? null : ["markdown", "raw"].find((name) => typeof fields?.[name] === "string");
145
+ const text = typeof message === "string" ? message : field ? fields[field] : null;
146
+ const stand = text?.includes("@") ? unusedIn(text) : null;
147
+ if (text === null || stand === null) return asIs;
148
+ const hidden = text.replace(BARE_MENTION, stand);
149
+ return {
150
+ given: field ? {
151
+ ...fields,
152
+ [field]: hidden
153
+ } : hidden,
154
+ back: (made) => made.replaceAll(stand, "@")
155
+ };
156
+ }
157
+ const literal = /* @__PURE__ */ new WeakSet();
158
+ /**
159
+ * Turns off the adapter's own reading of mentions, once. Board resolves a message's mentions against
160
+ * its own users before a provider posts it (the engine's `textFor`), each one it finds as Slack's
161
+ * `<@U0456>`, and what it leaves is text: a handle no one here has, a package's name. The adapter
162
+ * would look a bare `@name` up by display name, and write whatever is left as `<@name>`, which Slack
163
+ * shows as is. So its lookup answers the message it was given, and its converter never sees a bare
164
+ * `@`: it converts the text without them, and they go back in what it made.
165
+ *
166
+ * Coming in, the adapter writes each user a message mentions by display name, and their ID is gone
167
+ * from what it read. Here it writes the ID, in a form `mentionsById` reads back, so a mention on
168
+ * Slack is a mention of that user on the board.
169
+ */
170
+ function literalMentions(adapter) {
171
+ if (literal.has(adapter)) return;
172
+ literal.add(adapter);
173
+ if (adapter.resolveMessageMentions) adapter.resolveMessageMentions = async (message) => message;
174
+ const names = adapter.lookupMentionNames;
175
+ if (names) adapter.lookupMentionNames = async (users, channels) => ({
176
+ channels: (await names.call(adapter, /* @__PURE__ */ new Set(), channels)).channels,
177
+ users: new Map([...users].map((user) => [user, mentionedAs(user)]))
178
+ });
179
+ const converter = adapter.formatConverter;
180
+ if (!converter) return;
181
+ const { toSlackPayload, toResponseUrlText } = converter;
182
+ if (toSlackPayload) converter.toSlackPayload = (message) => {
183
+ const { given, back } = withoutBareMentions(message);
184
+ const payload = toSlackPayload.call(converter, given);
185
+ return "markdown_text" in payload ? {
186
+ ...payload,
187
+ markdown_text: back(payload.markdown_text)
188
+ } : {
189
+ ...payload,
190
+ text: back(payload.text)
191
+ };
192
+ };
193
+ if (toResponseUrlText) converter.toResponseUrlText = (message) => {
194
+ const { given, back } = withoutBareMentions(message);
195
+ return back(toResponseUrlText.call(converter, given));
196
+ };
197
+ }
117
198
  /** The most characters Slack shows of a message's username. */
118
199
  const USERNAME_MAX = 80;
119
200
  /**
@@ -133,7 +214,7 @@ function slackUsername({ name, attribution = "" }) {
133
214
  }
134
215
  /**
135
216
  * Text as the adapter gives it to Slack, so the text around a table reads as it does in any
136
- * message (a bare `@name` a mention, an emoji by its Slack name): markdown as the adapter posts
217
+ * message (an emoji by its Slack name): markdown as the adapter posts
137
218
  * it, and its older mrkdwn, which a message's notification text is.
138
219
  */
139
220
  const textOf = (adapter) => ({
@@ -568,12 +649,27 @@ var SlackProvider = class extends ChatSyncProvider {
568
649
  return channel.id;
569
650
  },
570
651
  markdown(message) {
571
- const text = markdownOf(message);
652
+ const text = mentionsById(markdownOf(message));
572
653
  if (text.trim()) return text;
573
654
  const raw = message.raw;
574
655
  const shared = Array.isArray(raw?.attachments) ? raw.attachments.filter((att) => att.is_share) : [];
575
656
  return shared.length ? forwardText(slackLinks("", "", shared, mrkdwn)) : text;
576
657
  },
658
+ async mentioned(text) {
659
+ const users = [...new Set(extractMentions(text).flatMap((token) => token.kind === "actor" && token.actor.startsWith("slack:user:") ? [token.actor.slice(11)] : []))];
660
+ return Promise.all(users.slice(0, 50).map(async (user) => {
661
+ const adapter = options.adapter;
662
+ const [known, avatar] = await Promise.all([adapter.lookupUser ? adapter.lookupUser(user).catch(() => null) : null, avatarOf(user)]);
663
+ const handle = known?.displayName || user;
664
+ return {
665
+ id: `slack:user:${user}`,
666
+ handle,
667
+ name: known?.realName || handle,
668
+ avatar,
669
+ isBot: known?.isBot === true
670
+ };
671
+ }));
672
+ },
577
673
  links(key, message) {
578
674
  const raw = message.raw;
579
675
  return slackLinks(key, typeof raw?.text === "string" ? raw.text : message.text, Array.isArray(raw?.attachments) ? raw.attachments : [], mrkdwn);
@@ -795,6 +891,7 @@ var SlackProvider = class extends ChatSyncProvider {
795
891
  }
796
892
  }, sync);
797
893
  this.web = client;
894
+ literalMentions(options.adapter);
798
895
  }
799
896
  /**
800
897
  * A message goes out under its author's name (`Julián Benegas`, `clever-lemur via vboard-factory`,
@@ -834,11 +931,9 @@ var SlackProvider = class extends ChatSyncProvider {
834
931
  if (!web?.files?.uploadV2 || !web.files.info || !toMrkdwn || !await this.hasScope(web, "files:read")) return null;
835
932
  const threadId = this.toChat(target);
836
933
  const { channel } = adapter.decodeThreadId(threadId);
837
- const message = { markdown };
838
- const resolved = await adapter.resolveMessageMentions?.(message, threadId) ?? message;
839
934
  const ids = ((await web.files.uploadV2({
840
935
  channel_id: channel,
841
- initial_comment: toMrkdwn.call(adapter.formatConverter, resolved),
936
+ initial_comment: toMrkdwn.call(adapter.formatConverter, { markdown }),
842
937
  file_uploads: files.map((file) => ({
843
938
  file: Buffer.from(file.data),
844
939
  filename: slackFileName(file.filename, file.mimeType)
@@ -905,8 +1000,7 @@ var SlackProvider = class extends ChatSyncProvider {
905
1000
  } : null;
906
1001
  const threadId = this.toChat(target);
907
1002
  const { channel, threadTs } = adapter.decodeThreadId(threadId);
908
- const message = { markdown: named ? withoutLabel(markdown, named.name) : markdown };
909
- const layout = deploymentsLayout((await adapter.resolveMessageMentions?.(message, threadId) ?? message).markdown, deployments, textOf(adapter));
1003
+ const layout = deploymentsLayout({ markdown: named ? withoutLabel(markdown, named.name) : markdown }.markdown, deployments, textOf(adapter));
910
1004
  if (!layout) return null;
911
1005
  const sent = await web.chat.postMessage({
912
1006
  channel,
@@ -936,7 +1030,7 @@ var SlackProvider = class extends ChatSyncProvider {
936
1030
  const web = await this.web().catch(() => void 0);
937
1031
  if (!web?.chat?.update) return false;
938
1032
  const threadId = this.toChat(thread);
939
- const layout = deploymentsLayout((await adapter.resolveMessageMentions?.({ markdown }, threadId) ?? { markdown }).markdown, deployments, textOf(adapter));
1033
+ const layout = deploymentsLayout(markdown, deployments, textOf(adapter));
940
1034
  if (!layout) return false;
941
1035
  try {
942
1036
  await web.chat.update({
@@ -957,13 +1051,11 @@ var SlackProvider = class extends ChatSyncProvider {
957
1051
  if (!web?.chat || !adapter.formatConverter?.toSlackPayload || username === null || !await this.canCustomize(web)) return null;
958
1052
  const threadId = this.toChat(target);
959
1053
  const { channel, threadTs } = adapter.decodeThreadId(threadId);
960
- const message = { markdown: withoutLabel(markdown, as.name) };
961
- const resolved = await adapter.resolveMessageMentions?.(message, threadId) ?? message;
962
1054
  const icon = slackIcon(as.avatar);
963
1055
  const sent = await web.chat.postMessage({
964
1056
  channel,
965
1057
  ...threadTs ? { thread_ts: threadTs } : {},
966
- ...adapter.formatConverter.toSlackPayload(resolved),
1058
+ ...adapter.formatConverter.toSlackPayload({ markdown: withoutLabel(markdown, as.name) }),
967
1059
  unfurl_links: false,
968
1060
  unfurl_media: false,
969
1061
  username,
package/dist/sync.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { An as ExternalAuthor, Mn as ExternalFile, jn as ExternalEvent } from "./routes-NEc6w3QC.mjs";
2
- import { A as SyncRoot, C as mirror, D as RootOverride, E as ProviderEvent, M as eventSchema, N as VercelDeployment, 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-D3bfHRHA.mjs";
1
+ import { An as ExternalAuthor, Mn as ExternalFile, jn as ExternalEvent } from "./routes-CjA6Mp4D.mjs";
2
+ import { A as SyncRoot, C as mirror, D as RootOverride, E as ProviderEvent, M as eventSchema, N as VercelDeployment, 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-Bc3xI90K.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, type VercelDeployment, channels, envelope, eventSchema, into, mirror, render };
package/dist/sync.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as ExternalEvent } from "./external-BVr1Sq0y.mjs";
2
- import { c as SyncProvider, g as render, h as mirror, i as eventSchema, l as UnreadableError, m as into, n as SyncOverrides, o as ReceivedEvent, p as channels, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-mGuhF4i5.mjs";
1
+ import { n as ExternalEvent } from "./external-BuVTXT1R.mjs";
2
+ import { c as SyncProvider, g as render, h as mirror, i as eventSchema, l as UnreadableError, m as into, n as SyncOverrides, o as ReceivedEvent, p as channels, r as envelope, s as ResolvedTarget, t as EventBase } from "./events-MOcxGpOQ.mjs";
3
3
  export { EventBase, ExternalEvent, ReceivedEvent, ResolvedTarget, SyncOverrides, SyncProvider, UnreadableError, channels, envelope, eventSchema, into, mirror, render };
@@ -1,13 +1,13 @@
1
- import { r as badRequest, t as HttpError, y as ATTACHMENT_BYTES_MAX } from "./errors-DZ1tbwSM.mjs";
1
+ import { r as badRequest, t as HttpError, y as ATTACHMENT_BYTES_MAX } from "./errors-QhkdzI-o.mjs";
2
2
  import "./schemas-7VFdomFB.mjs";
3
- import { l as isThreadTarget } from "./external-BVr1Sq0y.mjs";
4
- import { Y as routes, _ as Filters } from "./routes-B2HHHD_C.mjs";
5
- import { i as afterRetry } from "./middleware-BKsTcMAv.mjs";
6
- import { o as options } from "./commands-D0lyo8O8.mjs";
3
+ import { l as isThreadTarget } from "./external-BuVTXT1R.mjs";
4
+ import { Y as routes, _ as Filters } from "./routes-ABXf3CKq.mjs";
5
+ import { i as afterRetry } from "./middleware-CT6vMNUc.mjs";
6
+ import { o as options } from "./commands-Dk6_cHLS.mjs";
7
7
  import { z } from "zod";
8
8
  //#endregion
9
9
  //#region src/version.ts
10
- const VERSION = "0.46.0";
10
+ const VERSION = "0.47.0";
11
11
  //#endregion
12
12
  //#region src/server/backend.ts
13
13
  /** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
@@ -1,5 +1,5 @@
1
- import { d as unauthorized } from "./errors-DZ1tbwSM.mjs";
2
- import { g as privateHost, h as markVerified, i as VERCEL_ISSUER, p as issuerName, r as TOKENS, v as trustedIssuers } from "./auth-C-pFnJBA.mjs";
1
+ import { d as unauthorized } from "./errors-QhkdzI-o.mjs";
2
+ import { _ as markVerified, a as TOKENS, h as issuerName, o as VERCEL_ISSUER, x as trustedIssuers, y as privateHost } from "./auth-B9-wXQ-x.mjs";
3
3
  import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
4
4
  //#region src/server/identity.ts
5
5
  let fromDisk;
@@ -62,8 +62,10 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
62
62
  Vercel's API keeps sync's records: see [Sync](../02-sync/01-overview.md).
63
63
  - **It acts as this deployment, or as you.** In a Vercel deployment it sends
64
64
  the deployment's OIDC token and writes as its project,
65
- `vercel:project:prj_x:production`. Elsewhere it sends `VERCEL_TOKEN`, or
66
- your Vercel CLI login, and writes as you. `fetch` sends other credentials.
65
+ `vercel:project:prj_x:production`. Nothing replaces that token there. Elsewhere it
66
+ sends `BOARD_TOKEN`, or else your Vercel CLI login (`VERCEL_AUTH_TOKEN`, or
67
+ `vercel login`'s), and writes as whoever that is. It never sends
68
+ `VERCEL_TOKEN`, which people set for other reasons. `fetch` sends other credentials.
67
69
  - **Only a deployment's own credentials register watchers.** Anyone else's
68
70
  (yours, an app's) answer 403 `watchers_need_project`, and
69
71
  a board run with them runs its config's watchers in this process: see
@@ -86,7 +88,7 @@ backend:
86
88
  | Option | What it does |
87
89
  | --- | --- |
88
90
  | `backend` | `local()`, or your own. Default: your team's board in Vercel's API, the one `name` names, or in Node with `BOARD_URL` set, the board there, as [the handle](#a-handle-on-a-board-elsewhere) finds it |
89
- | `fetch` | Without a `backend`: how requests reach Vercel's API, with credentials it takes. In Node it defaults to `VERCEL_TOKEN`, the deployment's OIDC token, then your `vercel login`. A board at `BOARD_URL` never gets it |
91
+ | `fetch` | Without a `backend`: how requests reach Vercel's API, with credentials it takes. In Node it defaults to the deployment's OIDC token, or else `BOARD_TOKEN`, then `VERCEL_AUTH_TOKEN` or your `vercel login`, never `VERCEL_TOKEN`. A board at `BOARD_URL` never gets it |
90
92
  | `name` | Which of the team's boards this is, by its name: `security`. Default: the team's default board. See [A board by its name](#a-board-by-its-name) |
91
93
  | `team` | Whose board this is: another team's, by its ID or slug, with `name` or without it for that team's default board. Default: the team the environment finds |
92
94
  | `authenticate` | Who a request is. Default `oidcTokens()` from `@vercel/board/access`, which verifies its bearer token for the board's URL. Or a host's own verifier, `(request) => ({ id, kind, handle })`: see [Callers of your own](#callers-of-your-own) |
@@ -242,7 +244,8 @@ await team.post('deploys', 'www@a1b2c3 is live')
242
244
  In Node it finds the team and credentials as the Vercel CLI and a deployment
243
245
  do. The team is `VERCEL_ORG_ID`, the deployment's, or the nearest
244
246
  `.vercel/project.json`'s, unless `team` says another (`acme`). The
245
- credentials are `VERCEL_TOKEN`, the deployment's OIDC token, then your
247
+ credentials are the deployment's OIDC token, or else `BOARD_TOKEN`, then
248
+ `VERCEL_AUTH_TOKEN` or your
246
249
  `vercel login`, or what `fetch` sends: a deployment writes as its project, and
247
250
  you as yourself. Its profile is the one `BOARD_PROFILE` names, or none;
248
251
  `team.as(null)` acts as yourself.
@@ -28,6 +28,7 @@ The CLI and `board()` in Node find a token themselves. The first match wins:
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>` |
30
30
  | A local terminal | your `vercel login`, minted for the board's project and exchanged for its audience | `vercel:user:<user_id>` |
31
+ | A board with no Vercel project | no token: the request goes without one, and what verifies the board's callers says who it is. [`vb serve --tailscale`](../03-guides/08-tailnet.md) takes Tailscale's word | `tailscale:user:<login>` there |
31
32
 
32
33
  Every token the CLI and a handle in Node get is for the URL they send it to. When
33
34
  discovery there names another URL, they get no token and fail with
@@ -118,6 +119,7 @@ A **principal** is who holds the credential. It's a readable string:
118
119
  | --- | --- |
119
120
  | `vercel:user:u_abc123` | a person, from their `vercel login` |
120
121
  | `local:user:ada` | a person on a `vb serve` board |
122
+ | `tailscale:user:ada@example.com` | a person on a `vb serve` board [behind Tailscale](../03-guides/08-tailnet.md), by their login |
121
123
  | `vercel:project:prj_x:production` | a deployment of a Vercel project |
122
124
  | `github:repo:123456` | a GitHub Actions workflow in that repo |
123
125
  | `oidc:gitlab.com:project_path:acme/api:ref_type:branch:ref:main` | another issuer's token, by its `sub` |
@@ -260,39 +262,57 @@ the caller: nothing a client sends sets one, or a name.
260
262
  one `-`, and the ends trimmed, so "Jürgen Ubl" is `support/jurgen-ubl`. When
261
263
  nothing is left, it's their ID on the platform, without the sync key, the same
262
264
  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.
265
+ longer one is cut to fit, its ends trimmed again. A caller Vercel's board
266
+ names no one for reads them by their actor ID instead, which `@[…]` takes.
264
267
 
265
268
  `vb actors` lists them.
266
269
 
267
270
  ## Mentions
268
271
 
272
+ A mention is `@[actor-id]`: one actor, by their ID. You rarely type one: write
273
+ a handle, and the board settles it when the message is written.
274
+
269
275
  ```bash
270
- vb reply 812 "@ada can you look? cc @julian/claude"
276
+ vb reply 2 "over to @julian/claude, cc @nobody"
277
+ ```
278
+
279
+ ```text
280
+ 5
281
+ mentioned claude @julian/claude
282
+ warning: @nobody names no one here: it stays text, and mentions no one.
271
283
  ```
272
284
 
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.
285
+ - **A handle is settled when you write.** `@ada` and `@julian/claude` name
286
+ whoever has that handle in full, among the actors you can see. When that's
287
+ exactly one, the board stores `@[their-id]` in its place, and the answer
288
+ says who. Of several, it's the one who wrote in the thread, if exactly one
289
+ did.
290
+ - **A handle that names no one stays text.** No one has it, several do, or
291
+ someone has it only under a name (`@malte` isn't `support/malte`): it's kept
292
+ as typed, a mention of no one, and the answer says so, with who it could
293
+ have meant. So is one whose ID wouldn't fit in the message's 10,000
294
+ characters. No write fails over a mention, and an edit settles its new text
295
+ the same way.
296
+ - **`@[actor-id]`** is exact, and stored as written: `@[slack:user:U0456]`.
297
+ It's how to name one of several who share a handle.
279
298
  - **`@[ada@vercel.com]`** names whoever has that email on a synced platform,
280
- even someone the board hasn't seen.
299
+ even someone the board hasn't seen. Each sync looks it up when it posts.
281
300
  - **Mentions in inline code or code blocks don't count.**
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`.
301
+ - **A mention on a platform comes in as one.** Slack's `<@U0456>` is
302
+ `@[slack:user:U0456]` on the board, and the board meets that user by the
303
+ names Slack gives them, though they never wrote here. So `@malte` in a reply
304
+ finds them, and Slack gets its own mention back. A name someone typed there
305
+ (`@malte`) is text.
306
+ - **Each sync delivers by ID.** One of its own users, the platform users it
307
+ brought in under the key it posts through, becomes a native mention:
308
+ `<@U0456>` on Slack, `@login` on GitHub. Anyone else, a board person
309
+ included, is their name as plain text. A handle that stayed text goes out
310
+ as written, and pings no one. On Slack, `@[ada@vercel.com]` needs
311
+ `users:read.email`: `<@U0456>` when Slack finds her, and the plain email
312
+ when it doesn't.
313
+ - **Reading.** `vb read` shows a mention as the handle to type for them
314
+ (`@julian/claude`), and the inspector as their name. `--json` and the API
315
+ have the text as stored, with the ID.
296
316
  - **Filters read the text.** `--mentions @ada` finds `@ada`, and
297
317
  `@[<actor id>]` for anyone who goes by `ada`. A name covers what's under it:
298
318
  a person's agents (`@julian/claude`), and a project's imports
@@ -59,8 +59,9 @@ await team.reply(message.id, 'rolled back to d4e5f6')
59
59
  Text is markdown (GFM), up to 10,000 characters. It may be empty only when the
60
60
  message has attachments. Sync converts it for each platform, so `**bold**`
61
61
  arrives in Slack as bold, and stores what platforms send as markdown too.
62
- `@mentions` stay as you write them, and each sync resolves them when it posts;
63
- see [Mentions](./03-identity.md#mentions).
62
+ An `@handle` that names one actor is stored as a mention of them, `@[actor-id]`,
63
+ and each sync delivers it natively to its own user; see
64
+ [Mentions](./03-identity.md#mentions).
64
65
 
65
66
  ## Data
66
67
 
@@ -158,8 +158,8 @@ Where the match happens depends on the board:
158
158
  matches the tails, and wakes this deployment when one matches. It pulls what
159
159
  matched with its own credentials and runs it here: see
160
160
  [Woken by the board](#woken-by-the-board).
161
- - **On Vercel's board, as anyone else** (you in `next dev`, or with
162
- `VERCEL_TOKEN`), nothing registers: Vercel's API takes
161
+ - **On Vercel's board, as anyone else** (you in `next dev`, or a
162
+ `fetch` with other credentials), nothing registers: Vercel's API takes
163
163
  watchers only from a deployment's own credentials, since only a deployment
164
164
  can be woken. Each watcher runs in
165
165
  this process as a tail instead, from the board's first use: it follows the
@@ -167,7 +167,7 @@ Where the match happens depends on the board:
167
167
  its credentials may read. One with `--mentions` doesn't run, since Vercel's
168
168
  boards can't match mentions yet. Sync doesn't run. A tail needs a process
169
169
  that stays up, so on a Vercel deployment, watchers need its own OIDC token:
170
- with `VERCEL_TOKEN`, none run there.
170
+ with a `fetch` that sends anyone else's, none run there.
171
171
  - **With `BOARD_URL` set,** each watcher runs in this process as a tail of the
172
172
  board at that URL, from the board's first use, and sees what this
173
173
  deployment may read there. Nothing wakes it, so on a Vercel deployment none
@@ -55,8 +55,8 @@ when they scheduled it, profile included. It reads like theirs.
55
55
  - **A watcher's own scheduled messages wake it.** A watcher that schedules a
56
56
  message is woken by each send, though nothing else it writes wakes it.
57
57
  - **It keeps posting after the creator's token expires.** Cancel it to stop it.
58
- - **Mentions are text,** as in any post: nothing checks them when you
59
- schedule, and each sync resolves them when it posts a send.
58
+ - **Mentions are settled when you schedule,** as in any post: the answer says
59
+ who each handle mentions, and each send carries them as stored.
60
60
 
61
61
  ## Listing and canceling
62
62
 
@@ -157,7 +157,9 @@ more specific pattern decides first.
157
157
  `{ userId, email }`, `{ projectId, name }`, and `{ repositoryId,
158
158
  repository }`. A board that verifies tokens itself, such as `vb serve`'s,
159
159
  has nothing to look names up with, so it takes a user's ID and a project's
160
- `prj_…`, and matches a repository by the token's `repository`.
160
+ `prj_…`, and matches a repository by the token's `repository`. On a board
161
+ [behind Tailscale](../03-guides/08-tailnet.md), a person's login is their
162
+ ID, so `--user ada@example.com` names them there.
161
163
  - **A project names its environments,** and `all-projects` only production,
162
164
  preview, or development, since a custom environment's ID is one project's.
163
165
  - **A project is its team's.** A grant keeps the board's team on each project
@@ -324,9 +326,9 @@ Reads show only what the caller can read, everywhere:
324
326
  (`@[actor-id]`), and the reactors of what they can read, and themselves. A
325
327
  post in a channel you can't read comes back with the text you sent, and
326
328
  read back later (`GET /posts/:id`, your schedules), each actor it mentions
327
- but you shows as `@…`. A mention is text no write checks, so a handle that's
328
- shared, one no one has, and an actor ID the board doesn't know all post
329
- alike: no write says which ones exist. Nor does `--mentions`: it finds
329
+ but you shows as `@…`. A write settles a handle only among the actors its
330
+ caller can see, and says who it could have meant only from them, so it tells
331
+ no caller of anyone `vb actors` wouldn't. Nor does `--mentions`: it finds
330
332
  someone through their other name (their handle for their ID, or the other
331
333
  way round) only for a caller that reads every channel.
332
334
  - **Events about no message** (who's who, a thread's sync targets) reach only
@@ -78,4 +78,7 @@ it writes as `board:client`, and `team.as('deploys')` as
78
78
  [`vb serve`](../04-reference/01-cli.md#serve) runs `local()` under `.board/` at
79
79
  the Git checkout's root, behind `http://127.0.0.1:4100/api/board`, and signs
80
80
  you a token for it. Other commands, and `board()` with `BOARD_URL` set to that
81
- URL, reach it.
81
+ URL, reach it. It listens on 127.0.0.1 only. For other machines, a proxy in
82
+ front serves it on another name: `--tailscale` for `tailscale serve`, which
83
+ also tells the board who's calling, and `--allow-host` for any other. See
84
+ [Share a local board on a tailnet](../03-guides/08-tailnet.md).
@@ -156,11 +156,10 @@ new since then: vb read firehose --after 6
156
156
  ```
157
157
 
158
158
  Each sync's Malte is an actor of its own, named only by that sync's imports. A
159
- mention resolves as each sync posts it, against its own users: support's Malte
160
- is `@support/malte`, `@malte` renders natively (`<@U0456>`) through the sync
161
- whose Malte it is, and a
162
- platform user named by actor only through the key they came through, and of a
163
- sync elsewhere's only through that sync; any other posts their name. Renaming a key changes its users' IDs. See
159
+ mention names one of them: support's Malte is `@support/malte`, stored as his
160
+ actor ID when it's written. It renders natively (`<@U0456>`) only through the
161
+ key he came through, and for a sync elsewhere's user only through that sync;
162
+ any other posts his name. Renaming a key changes its users' IDs. See
164
163
  [platform users](../01-board/03-identity.md#platform-users).
165
164
 
166
165
  ## Each project's keys
@@ -328,8 +328,8 @@ a platform user another sync speaks for. A text that opens a block (a code
328
328
  block, a list, a heading, a quote, or a table) goes on a line of its own under
329
329
  that label, where it's still one, and under yours when your renderer opens with
330
330
  the same label. board still adds a line per attachment the platform
331
- didn't take, and resolves mentions to the platform's own form after your
332
- renderer runs, against this sync's own users
331
+ didn't take, and puts each mention of one of this sync's own users in the
332
+ platform's own form after your renderer runs
333
333
  ([mentions](../01-board/03-identity.md#mentions)).
334
334
 
335
335
  Each channel can render its own way, since `render` wraps any function: