@vercel/board 0.32.0 → 0.34.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 (167) hide show
  1. package/README.md +25 -20
  2. package/dist/{access-CY5xVMIK.mjs → access-CdBcYPQH.mjs} +170 -13
  3. package/dist/access.d.mts +4 -5
  4. package/dist/access.mjs +5 -5
  5. package/dist/{actors-Bm-ojWWT.mjs → actors-MrIEr9LI.mjs} +3 -3
  6. package/dist/auth-DjoJygbG.mjs +599 -0
  7. package/dist/{auth-K8dY1nBY.d.mts → auth-aaoKt5DK.d.mts} +133 -100
  8. package/dist/backend-local.d.mts +28 -0
  9. package/dist/backend-local.mjs +2 -0
  10. package/dist/{backend-DxE9wGKm.d.mts → backend-u1sVvybh.d.mts} +108 -55
  11. package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
  12. package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-De0iDnUB.d.mts} +2 -3
  13. package/dist/cli-commands.d.mts +1 -1
  14. package/dist/cli-commands.mjs +1 -1
  15. package/dist/cli-embedded.d.mts +2 -2
  16. package/dist/cli-embedded.mjs +1 -1
  17. package/dist/cli.mjs +6 -6
  18. package/dist/{commands-DsnQKTdB.mjs → commands-B8oZEByR.mjs} +37 -52
  19. package/dist/{commands-CpyPV_tk.d.mts → commands-BkVMdXP1.d.mts} +9 -6
  20. package/dist/{conformance-3RBKxwbp.mjs → conformance-gqYBkXFS.mjs} +79 -86
  21. package/dist/conformance.d.mts +1 -1
  22. package/dist/conformance.mjs +1 -1
  23. package/dist/{engine-DurYIRt8.mjs → engine-rtOVWsiF.mjs} +6 -8
  24. package/dist/{errors-CJXhhzvT.mjs → errors-D8ifv16L.mjs} +75 -6
  25. package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
  26. package/dist/exports-Bx2dGpzr.mjs +3252 -0
  27. package/dist/exports-uwRl5qIj.d.mts +4 -0
  28. package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
  29. package/dist/index-D6mK0Ial.d.mts +11 -0
  30. package/dist/index.d.mts +10 -9
  31. package/dist/index.mjs +21 -8
  32. package/dist/index.node.d.mts +6 -7
  33. package/dist/index.node.mjs +3 -3
  34. package/dist/inspect/app.js +95 -95
  35. package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
  36. package/dist/local-CPz22MQ8.mjs +9225 -0
  37. package/dist/{main-CcYDo9Hb.mjs → main-DScDKwQN.mjs} +129 -54
  38. package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
  39. package/dist/middleware-BjYpk4yq.mjs +103 -0
  40. package/dist/{provider-gynDUoyW.d.mts → provider-hB8QNrwm.d.mts} +369 -3
  41. package/dist/{client-COfYrgfV.d.mts → routes-De4W6lEs.d.mts} +997 -367
  42. package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
  43. package/dist/{serve-Bplieh0C.mjs → serve-B1noQRkn.mjs} +33 -24
  44. package/dist/{node-BgeGcwX0.mjs → server-Ov6GBJ8j.mjs} +419 -6
  45. package/dist/{serving-Y7s7VDjB.mjs → serving-2s7lqSBS.mjs} +1 -1
  46. package/dist/{sql-E1K5g_ih.mjs → sql-BQzKUqQt.mjs} +349 -114
  47. package/dist/sqlite-DCtZFEVm.mjs +30 -0
  48. package/dist/{sqlite-db-CzcD_FW8.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
  49. package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
  50. package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
  51. package/dist/store-memory-OdGsc-t_.mjs +2 -0
  52. package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
  53. package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
  54. package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
  55. package/dist/sync-chat-sdk.d.mts +2 -2
  56. package/dist/sync-chat-sdk.mjs +2 -2
  57. package/dist/sync-github.d.mts +2 -2
  58. package/dist/sync-github.mjs +2 -2
  59. package/dist/sync-linear.d.mts +3 -3
  60. package/dist/sync-linear.mjs +2 -2
  61. package/dist/sync-slack.d.mts +3 -3
  62. package/dist/sync-slack.mjs +4 -4
  63. package/dist/sync.d.mts +2 -2
  64. package/dist/sync.mjs +2 -2
  65. package/dist/{watchers-hash-CurCzwhe.mjs → targets-aMdbp84G.mjs} +134 -16
  66. package/dist/{tokens-C7kYyrAG.mjs → tokens-LHLrnV_P.mjs} +15 -43
  67. package/docs/01-board/01-mounting.md +245 -288
  68. package/docs/01-board/03-identity.md +42 -50
  69. package/docs/01-board/04-messages.md +15 -14
  70. package/docs/01-board/05-reading.md +3 -3
  71. package/docs/01-board/06-watchers.md +58 -105
  72. package/docs/01-board/07-schedules.md +21 -41
  73. package/docs/01-board/08-middleware.md +11 -17
  74. package/docs/01-board/09-access.md +187 -343
  75. package/docs/01-board/10-local.md +81 -0
  76. package/docs/01-quickstart.md +49 -126
  77. package/docs/02-sync/01-overview.md +25 -80
  78. package/docs/02-sync/02-functions.md +10 -16
  79. package/docs/02-sync/03-slack.md +13 -26
  80. package/docs/02-sync/04-github.md +8 -20
  81. package/docs/02-sync/07-linear.md +6 -10
  82. package/docs/03-guides/02-inspector.md +3 -3
  83. package/docs/03-guides/03-ci.md +88 -128
  84. package/docs/03-guides/04-triage.md +7 -15
  85. package/docs/03-guides/05-agent-factory.md +29 -36
  86. package/docs/04-reference/01-cli.md +113 -38
  87. package/docs/04-reference/02-board.md +79 -82
  88. package/docs/04-reference/03-http.md +138 -69
  89. package/docs/04-reference/05-conformance.md +32 -46
  90. package/docs/index.md +41 -65
  91. package/package.json +12 -83
  92. package/dist/a2-DiDc77Uf.mjs +0 -4238
  93. package/dist/access-DPcrKIH_.d.mts +0 -37
  94. package/dist/auth-8pRZnF1M.mjs +0 -393
  95. package/dist/backend-a2/blob-vercel.d.mts +0 -8
  96. package/dist/backend-a2/blob-vercel.mjs +0 -81
  97. package/dist/backend-a2/contract.d.mts +0 -828
  98. package/dist/backend-a2/contract.mjs +0 -5
  99. package/dist/backend-a2/scheduler-local.d.mts +0 -11
  100. package/dist/backend-a2/scheduler-local.mjs +0 -2
  101. package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
  102. package/dist/backend-a2/scheduler-qstash.mjs +0 -522
  103. package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
  104. package/dist/backend-a2/scheduler-vercel.mjs +0 -204
  105. package/dist/backend-a2/store-memory.d.mts +0 -11
  106. package/dist/backend-a2/store-postgres.d.mts +0 -38
  107. package/dist/backend-a2/store-postgres.mjs +0 -2977
  108. package/dist/backend-a2/store-redis-http.d.mts +0 -17
  109. package/dist/backend-a2/store-redis-http.mjs +0 -520
  110. package/dist/backend-a2/store-redis.d.mts +0 -31
  111. package/dist/backend-a2/store-redis.mjs +0 -88
  112. package/dist/backend-a2/store-sqlite.d.mts +0 -12
  113. package/dist/backend-a2/store-sqlite.mjs +0 -31
  114. package/dist/backend-a2.d.mts +0 -2633
  115. package/dist/backend-a2.mjs +0 -3
  116. package/dist/backend-http-CaN06CaD.d.mts +0 -672
  117. package/dist/backend-http-CoaCghuJ.mjs +0 -18
  118. package/dist/backend-http-l5A8UmL-.mjs +0 -585
  119. package/dist/backend-http.d.mts +0 -10
  120. package/dist/backend-http.mjs +0 -2
  121. package/dist/backend-http.node.d.mts +0 -10
  122. package/dist/backend-http.node.mjs +0 -2
  123. package/dist/backend-vercel-BE65okBC.mjs +0 -86
  124. package/dist/backend-vercel-CVxoTNF2.mjs +0 -1744
  125. package/dist/backend-vercel-jg-6PAgD.d.mts +0 -674
  126. package/dist/backend-vercel.d.mts +0 -9
  127. package/dist/backend-vercel.mjs +0 -11
  128. package/dist/backend-vercel.node.d.mts +0 -17
  129. package/dist/backend-vercel.node.mjs +0 -2
  130. package/dist/blob-Bx8QPWEd.d.mts +0 -40
  131. package/dist/blob-WbB2DJKn.mjs +0 -201
  132. package/dist/errors-2vGs49Db.d.mts +0 -16
  133. package/dist/exports-BnUZuRm9.mjs +0 -1389
  134. package/dist/exports-u5mApVvn.d.mts +0 -5
  135. package/dist/files-SniSmeEr.mjs +0 -47
  136. package/dist/folds-DLUzfibJ.d.mts +0 -558
  137. package/dist/folds-DsWfIftc.mjs +0 -208
  138. package/dist/index-UXpTPWNc.d.mts +0 -11
  139. package/dist/index.default-Dp8gexln.mjs +0 -12
  140. package/dist/local-C76Fy5ad.mjs +0 -44
  141. package/dist/middleware-BavYSDUa.mjs +0 -62
  142. package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
  143. package/dist/project-4Vl7_uy5.mjs +0 -124
  144. package/dist/redis-tables-BFRj_SEJ.mjs +0 -3895
  145. package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
  146. package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
  147. package/dist/reducers-DQVSP3kk.mjs +0 -538
  148. package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
  149. package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
  150. package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
  151. package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
  152. package/dist/server-wIpAEjpX.mjs +0 -17
  153. package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
  154. package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
  155. package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
  156. package/dist/store-memory-4IBl0Ztu.mjs +0 -2
  157. package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
  158. package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
  159. package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
  160. package/dist/targets-Cgjs29T0.mjs +0 -33
  161. package/dist/types-CmrFjpml.d.mts +0 -102
  162. package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
  163. package/docs/01-board/02-database.md +0 -258
  164. package/docs/04-reference/04-log.md +0 -247
  165. package/sql/postgres/board.sql +0 -145
  166. package/sql/postgres/notifications.sql +0 -24
  167. package/sql/postgres/schema.sql +0 -451
@@ -1,5 +0,0 @@
1
- import "./auth-K8dY1nBY.mjs";
2
- import "./folds-DLUzfibJ.mjs";
3
- import "./client-COfYrgfV.mjs";
4
- import "./backend-DxE9wGKm.mjs";
5
- import "./errors-2vGs49Db.mjs";
@@ -1,47 +0,0 @@
1
- //#region src/contract/files.ts
2
- /** Under Vercel Functions' 4.5 MB request body limit, so an upload fits in one request. */
3
- const ATTACHMENT_BYTES_MAX = 4194304;
4
- /**
5
- * The most a file sync brings over from a platform can be. Sync fetches it on the server and
6
- * stores it in-process, so no request carries it and the request limit doesn't apply: this bounds
7
- * what one import holds in memory.
8
- */
9
- const IMPORT_BYTES_MAX = 26214400;
10
- /**
11
- * The most a direct upload can be: the client sends the bytes straight to the blob store, on a URL
12
- * the board signs, so no request to the board carries them. Needs a store with `uploadUrl`.
13
- */
14
- const DIRECT_UPLOAD_BYTES_MAX = 104857600;
15
- /** `120 KB`, `3.4 MB`: a file's size the way people read it. */
16
- function fileSize(bytes) {
17
- if (bytes < 1024) return `${bytes} B`;
18
- if (bytes < 1048576) return `${Math.round(bytes / 1024)} KB`;
19
- return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
20
- }
21
- const TYPES = {
22
- ".png": "image/png",
23
- ".jpg": "image/jpeg",
24
- ".jpeg": "image/jpeg",
25
- ".gif": "image/gif",
26
- ".webp": "image/webp",
27
- ".avif": "image/avif",
28
- ".svg": "image/svg+xml",
29
- ".mp4": "video/mp4",
30
- ".webm": "video/webm",
31
- ".mov": "video/quicktime",
32
- ".pdf": "application/pdf",
33
- ".txt": "text/plain",
34
- ".log": "text/plain",
35
- ".md": "text/markdown",
36
- ".json": "application/json",
37
- ".csv": "text/csv",
38
- ".html": "text/html",
39
- ".zip": "application/zip"
40
- };
41
- /** A file's type from its name, for when nothing better says: browsers leave `.log` untyped. */
42
- function typeOf(name) {
43
- const dot = name.lastIndexOf(".");
44
- return dot > 0 && TYPES[name.slice(dot).toLowerCase()] || "application/octet-stream";
45
- }
46
- //#endregion
47
- export { typeOf as a, fileSize as i, DIRECT_UPLOAD_BYTES_MAX as n, IMPORT_BYTES_MAX as r, ATTACHMENT_BYTES_MAX as t };
@@ -1,558 +0,0 @@
1
- import { z } from "zod";
2
- //#region src/contract/schemas.d.ts
3
- declare const CHANNEL_PATH_MAX = 80;
4
- declare const MESSAGE_TEXT_MAX = 10000;
5
- declare const ATTACHMENTS_PER_MESSAGE_MAX = 10;
6
- /** `errors-www`, `www/production`: lowercase segments joined by `/`. */
7
- declare const ChannelPath: z.ZodString;
8
- declare const MessageText: z.ZodString;
9
- /** A message is named by the log index of its `message.posted` event. */
10
- declare const MessageId: z.ZodNumber;
11
- declare const LabelKey: z.ZodString;
12
- declare const LabelValue: z.ZodString;
13
- declare const Labels: z.ZodRecord<z.ZodString, z.ZodString>;
14
- /** Normalized short names, as Chat SDK names them: `eyes`, `check`, `thumbs_up`. */
15
- declare const Emoji: z.ZodString;
16
- /** `vercel:user:u_abc123`, or `vercel:user:u_abc123+claude` for a profile. */
17
- declare const ActorId: z.ZodString;
18
- /** What an actor is: a `person`, an `agent` acting for a principal (`--as claude`), a deployment, a workflow, or a platform user (`external`). */
19
- declare const ActorKind: z.ZodEnum<{
20
- agent: "agent";
21
- deployment: "deployment";
22
- external: "external";
23
- person: "person";
24
- workflow: "workflow";
25
- }>;
26
- declare const Handle: z.ZodString;
27
- declare const Author: z.ZodObject<{
28
- actor: z.ZodString;
29
- principal: z.ZodString;
30
- profile: z.ZodNullable<z.ZodString>;
31
- session: z.ZodNullable<z.ZodString>;
32
- }, z.core.$strip>;
33
- /** 128 random bits, base64url: an attachment is named by an ID nobody can guess. */
34
- /** 128 random bits, base64url, as A2 makes them; or `att_` and a UUID, as Vercel's board does. */
35
- declare const AttachmentId: z.ZodString;
36
- /** A file on a message. The board records `type` and `size` from what it stored, never from the request. */
37
- declare const Attachment: z.ZodObject<{
38
- id: z.ZodString;
39
- name: z.ZodString;
40
- type: z.ZodString;
41
- size: z.ZodNumber;
42
- }, z.core.$strip>;
43
- type ChannelPath = z.infer<typeof ChannelPath>;
44
- type MessageId = z.infer<typeof MessageId>;
45
- type Labels = z.infer<typeof Labels>;
46
- type ActorId = z.infer<typeof ActorId>;
47
- type ActorKind = z.infer<typeof ActorKind>;
48
- type Author = z.infer<typeof Author>;
49
- type Attachment = z.infer<typeof Attachment>;
50
- //#endregion
51
- //#region src/contract/events.d.ts
52
- /** The board's one log. Every board fact is an event in session `board`. */
53
- declare const boardEvents: {
54
- 'message.posted': z.ZodObject<{
55
- channel: z.ZodString;
56
- text: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"">]>;
57
- re: z.ZodNullable<z.ZodNumber>;
58
- replyTo: z.ZodNullable<z.ZodNumber>;
59
- thread: z.ZodString;
60
- labels: z.ZodRecord<z.ZodString, z.ZodString>;
61
- noSync: z.ZodBoolean;
62
- mentions: z.ZodArray<z.ZodString>;
63
- by: z.ZodObject<{
64
- actor: z.ZodString;
65
- principal: z.ZodString;
66
- profile: z.ZodNullable<z.ZodString>;
67
- session: z.ZodNullable<z.ZodString>;
68
- }, z.core.$strip>;
69
- origin: z.ZodNullable<z.ZodObject<{
70
- channel: z.ZodOptional<z.ZodString>;
71
- thread: z.ZodString;
72
- subthread: z.ZodNullable<z.ZodString>;
73
- message: z.ZodString;
74
- context: z.ZodNullable<z.ZodString>;
75
- }, z.core.$strip>>;
76
- from: z.ZodNullable<z.ZodString>;
77
- attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
- id: z.ZodString;
79
- name: z.ZodString;
80
- type: z.ZodString;
81
- size: z.ZodNumber;
82
- }, z.core.$strip>>>;
83
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
84
- url: z.ZodString;
85
- message: z.ZodNullable<z.ZodNumber>;
86
- snapshot: z.ZodNullable<z.ZodObject<{
87
- author: z.ZodString;
88
- text: z.ZodString;
89
- createdAt: z.ZodNullable<z.ZodString>;
90
- files: z.ZodArray<z.ZodObject<{
91
- name: z.ZodString;
92
- url: z.ZodNullable<z.ZodString>;
93
- }, z.core.$strip>>;
94
- }, z.core.$strip>>;
95
- unavailable: z.ZodNullable<z.ZodString>;
96
- }, z.core.$strip>>>;
97
- schedule: z.ZodOptional<z.ZodObject<{
98
- id: z.ZodNumber;
99
- n: z.ZodNumber;
100
- }, z.core.$strip>>;
101
- blind: z.ZodOptional<z.ZodLiteral<true>>;
102
- importedBy: z.ZodOptional<z.ZodString>;
103
- }, z.core.$strip>;
104
- /**
105
- * A channel made before anything posted to it. A post makes one too, with no event of its own:
106
- * this is only for one that's empty. It names no message, so it carries no `id`.
107
- */
108
- 'channel.created': z.ZodObject<{
109
- channel: z.ZodString;
110
- by: z.ZodObject<{
111
- actor: z.ZodString;
112
- principal: z.ZodString;
113
- profile: z.ZodNullable<z.ZodString>;
114
- session: z.ZodNullable<z.ZodString>;
115
- }, z.core.$strip>;
116
- }, z.core.$strip>;
117
- /** A message's links changed: an edit linked something new, or the platform sent what a link says. */
118
- 'message.linked': z.ZodObject<{
119
- id: z.ZodNumber;
120
- thread: z.ZodString;
121
- links: z.ZodArray<z.ZodObject<{
122
- url: z.ZodString;
123
- message: z.ZodNullable<z.ZodNumber>;
124
- snapshot: z.ZodNullable<z.ZodObject<{
125
- author: z.ZodString;
126
- text: z.ZodString;
127
- createdAt: z.ZodNullable<z.ZodString>;
128
- files: z.ZodArray<z.ZodObject<{
129
- name: z.ZodString;
130
- url: z.ZodNullable<z.ZodString>;
131
- }, z.core.$strip>>;
132
- }, z.core.$strip>>;
133
- unavailable: z.ZodNullable<z.ZodString>;
134
- }, z.core.$strip>>;
135
- by: z.ZodObject<{
136
- actor: z.ZodString;
137
- principal: z.ZodString;
138
- profile: z.ZodNullable<z.ZodString>;
139
- session: z.ZodNullable<z.ZodString>;
140
- }, z.core.$strip>;
141
- from: z.ZodNullable<z.ZodString>;
142
- }, z.core.$strip>;
143
- 'message.edited': z.ZodObject<{
144
- id: z.ZodNumber;
145
- thread: z.ZodString;
146
- text: z.ZodString;
147
- mentions: z.ZodArray<z.ZodString>;
148
- by: z.ZodObject<{
149
- actor: z.ZodString;
150
- principal: z.ZodString;
151
- profile: z.ZodNullable<z.ZodString>;
152
- session: z.ZodNullable<z.ZodString>;
153
- }, z.core.$strip>;
154
- from: z.ZodNullable<z.ZodString>;
155
- }, z.core.$strip>;
156
- 'message.deleted': z.ZodObject<{
157
- id: z.ZodNumber;
158
- thread: z.ZodString;
159
- by: z.ZodObject<{
160
- actor: z.ZodString;
161
- principal: z.ZodString;
162
- profile: z.ZodNullable<z.ZodString>;
163
- session: z.ZodNullable<z.ZodString>;
164
- }, z.core.$strip>;
165
- from: z.ZodNullable<z.ZodString>;
166
- }, z.core.$strip>;
167
- 'reaction.added': z.ZodObject<{
168
- id: z.ZodNumber;
169
- thread: z.ZodString;
170
- emoji: z.ZodString;
171
- by: z.ZodObject<{
172
- actor: z.ZodString;
173
- principal: z.ZodString;
174
- profile: z.ZodNullable<z.ZodString>;
175
- session: z.ZodNullable<z.ZodString>;
176
- }, z.core.$strip>;
177
- from: z.ZodNullable<z.ZodString>;
178
- }, z.core.$strip>;
179
- 'reaction.removed': z.ZodObject<{
180
- id: z.ZodNumber;
181
- thread: z.ZodString;
182
- emoji: z.ZodString;
183
- by: z.ZodObject<{
184
- actor: z.ZodString;
185
- principal: z.ZodString;
186
- profile: z.ZodNullable<z.ZodString>;
187
- session: z.ZodNullable<z.ZodString>;
188
- }, z.core.$strip>;
189
- from: z.ZodNullable<z.ZodString>;
190
- }, z.core.$strip>;
191
- 'labels.changed': z.ZodObject<{
192
- id: z.ZodNumber;
193
- thread: z.ZodString;
194
- set: z.ZodRecord<z.ZodString, z.ZodString>;
195
- unset: z.ZodArray<z.ZodString>;
196
- by: z.ZodObject<{
197
- actor: z.ZodString;
198
- principal: z.ZodString;
199
- profile: z.ZodNullable<z.ZodString>;
200
- session: z.ZodNullable<z.ZodString>;
201
- }, z.core.$strip>;
202
- }, z.core.$strip>;
203
- /** A thread is synced with an external channel (start a thread there) or thread (join it). */
204
- 'thread.synced': z.ZodObject<{
205
- thread: z.ZodString;
206
- target: z.ZodString;
207
- cause: z.ZodEnum<{
208
- config: "config";
209
- request: "request";
210
- }>;
211
- kind: z.ZodOptional<z.ZodEnum<{
212
- channel: "channel";
213
- thread: "thread";
214
- }>>;
215
- by: z.ZodObject<{
216
- actor: z.ZodString;
217
- principal: z.ZodString;
218
- profile: z.ZodNullable<z.ZodString>;
219
- session: z.ZodNullable<z.ZodString>;
220
- }, z.core.$strip>;
221
- }, z.core.$strip>;
222
- /** An outbound delivery receipt: board message `id` exists on the platform as `external`. */
223
- 'message.synced': z.ZodObject<{
224
- id: z.ZodNumber;
225
- thread: z.ZodString;
226
- target: z.ZodString;
227
- external: z.ZodObject<{
228
- thread: z.ZodString;
229
- message: z.ZodString;
230
- }, z.core.$strip>;
231
- syncedBy: z.ZodOptional<z.ZodString>;
232
- }, z.core.$strip>;
233
- /**
234
- * Board message `id`'s files reached `target` after its text: `files` are the
235
- * platform's IDs for them, or null when the platform refused files and the
236
- * text got a line for each instead.
237
- */
238
- 'message.files_synced': z.ZodObject<{
239
- id: z.ZodNumber;
240
- thread: z.ZodString;
241
- target: z.ZodString;
242
- files: z.ZodNullable<z.ZodArray<z.ZodString>>;
243
- syncedBy: z.ZodOptional<z.ZodString>;
244
- }, z.core.$strip>;
245
- /** A delivery that gave up: board message `id` didn't reach `target`, and `error` says why. */
246
- 'message.sync_failed': z.ZodObject<{
247
- id: z.ZodNumber;
248
- thread: z.ZodString;
249
- target: z.ZodString;
250
- error: z.ZodString;
251
- }, z.core.$strip>;
252
- 'actor.seen': z.ZodObject<{
253
- actor: z.ZodString;
254
- kind: z.ZodUnion<readonly [z.ZodEnum<{
255
- agent: "agent";
256
- deployment: "deployment";
257
- external: "external";
258
- person: "person";
259
- workflow: "workflow";
260
- }>, z.ZodLiteral<"profile">]>;
261
- handle: z.ZodString;
262
- name: z.ZodString;
263
- avatar: z.ZodNullable<z.ZodString>;
264
- host: z.ZodOptional<z.ZodLiteral<true>>;
265
- }, z.core.$strip>;
266
- };
267
- declare const BOARD_SESSION = "board";
268
- type BoardEvents = typeof boardEvents;
269
- /** One event of the board log, of type `K`: the shape A2 stores it in (its `ContractEvent`). */
270
- type BoardEvent<K extends keyof BoardEvents & string = keyof BoardEvents & string> = { [T in keyof BoardEvents & string]: {
271
- id: string;
272
- type: T;
273
- payload: z.output<BoardEvents[T]>;
274
- index: number;
275
- sessionId: string;
276
- createdAt: Date;
277
- }; }[K];
278
- //#endregion
279
- //#region src/contract/external.d.ts
280
- /** Where a message came from on a platform. `thread` is grouped (GitHub review threads fold into their PR). */
281
- declare const Origin: z.ZodObject<{
282
- channel: z.ZodOptional<z.ZodString>;
283
- thread: z.ZodString;
284
- subthread: z.ZodNullable<z.ZodString>;
285
- message: z.ZodString;
286
- context: z.ZodNullable<z.ZodString>;
287
- }, z.core.$strip>;
288
- /**
289
- * A platform message linked from a message (a Slack permalink): the board message
290
- * it was synced to, if any, and a snapshot of it, or why the board couldn't read it.
291
- */
292
- declare const Link: z.ZodObject<{
293
- url: z.ZodString;
294
- message: z.ZodNullable<z.ZodNumber>;
295
- snapshot: z.ZodNullable<z.ZodObject<{
296
- author: z.ZodString;
297
- text: z.ZodString;
298
- createdAt: z.ZodNullable<z.ZodString>;
299
- files: z.ZodArray<z.ZodObject<{
300
- name: z.ZodString;
301
- url: z.ZodNullable<z.ZodString>;
302
- }, z.core.$strip>>;
303
- }, z.core.$strip>>;
304
- unavailable: z.ZodNullable<z.ZodString>;
305
- }, z.core.$strip>;
306
- type Link = z.infer<typeof Link>;
307
- type Origin = z.infer<typeof Origin>;
308
- declare const ExternalAuthor: z.ZodObject<{
309
- id: z.ZodString;
310
- handle: z.ZodString;
311
- name: z.ZodString;
312
- avatar: z.ZodNullable<z.ZodString>;
313
- isBot: z.ZodBoolean;
314
- }, z.core.$strip>;
315
- /**
316
- * A file on a platform message, as Chat SDK describes it: enough for the
317
- * platform's adapter to fetch it later (`rehydrateAttachment`), never the bytes.
318
- */
319
- declare const ExternalFile: z.ZodObject<{
320
- type: z.ZodEnum<{
321
- audio: "audio";
322
- file: "file";
323
- image: "image";
324
- video: "video";
325
- }>;
326
- name: z.ZodOptional<z.ZodString>;
327
- mimeType: z.ZodOptional<z.ZodString>;
328
- size: z.ZodOptional<z.ZodNumber>;
329
- url: z.ZodOptional<z.ZodString>;
330
- fetchMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
331
- }, z.core.$strip>;
332
- type ExternalFile = z.infer<typeof ExternalFile>;
333
- /**
334
- * A platform message a platform message links to, at intake: where it lives
335
- * (`thread`, with the sync key prefix, and `message`), and what it said when the
336
- * platform sent that along (Slack's unfurl).
337
- */
338
- declare const ExternalLink: z.ZodObject<{
339
- url: z.ZodString;
340
- thread: z.ZodString;
341
- message: z.ZodString;
342
- snapshot: z.ZodNullable<z.ZodObject<{
343
- author: z.ZodString;
344
- text: z.ZodString;
345
- createdAt: z.ZodNullable<z.ZodString>;
346
- files: z.ZodArray<z.ZodObject<{
347
- name: z.ZodString;
348
- url: z.ZodNullable<z.ZodString>;
349
- }, z.core.$strip>>;
350
- }, z.core.$strip>>;
351
- }, z.core.$strip>;
352
- type ExternalLink = z.infer<typeof ExternalLink>;
353
- /** A platform event, normalized at intake. Thread IDs are external IDs with the sync key prefix. */
354
- declare const ExternalEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
355
- channel: z.ZodString;
356
- thread: z.ZodString;
357
- subthread: z.ZodNullable<z.ZodString>;
358
- kind: z.ZodLiteral<"message">;
359
- message: z.ZodString;
360
- isRoot: z.ZodBoolean;
361
- text: z.ZodString;
362
- context: z.ZodNullable<z.ZodString>;
363
- author: z.ZodObject<{
364
- id: z.ZodString;
365
- handle: z.ZodString;
366
- name: z.ZodString;
367
- avatar: z.ZodNullable<z.ZodString>;
368
- isBot: z.ZodBoolean;
369
- }, z.core.$strip>;
370
- files: z.ZodOptional<z.ZodArray<z.ZodObject<{
371
- type: z.ZodEnum<{
372
- audio: "audio";
373
- file: "file";
374
- image: "image";
375
- video: "video";
376
- }>;
377
- name: z.ZodOptional<z.ZodString>;
378
- mimeType: z.ZodOptional<z.ZodString>;
379
- size: z.ZodOptional<z.ZodNumber>;
380
- url: z.ZodOptional<z.ZodString>;
381
- fetchMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
382
- }, z.core.$strip>>>;
383
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
384
- url: z.ZodString;
385
- thread: z.ZodString;
386
- message: z.ZodString;
387
- snapshot: z.ZodNullable<z.ZodObject<{
388
- author: z.ZodString;
389
- text: z.ZodString;
390
- createdAt: z.ZodNullable<z.ZodString>;
391
- files: z.ZodArray<z.ZodObject<{
392
- name: z.ZodString;
393
- url: z.ZodNullable<z.ZodString>;
394
- }, z.core.$strip>>;
395
- }, z.core.$strip>>;
396
- }, z.core.$strip>>>;
397
- }, z.core.$strip>, z.ZodObject<{
398
- channel: z.ZodString;
399
- thread: z.ZodString;
400
- subthread: z.ZodNullable<z.ZodString>;
401
- kind: z.ZodLiteral<"edited">;
402
- message: z.ZodString;
403
- text: z.ZodString;
404
- author: z.ZodObject<{
405
- id: z.ZodString;
406
- handle: z.ZodString;
407
- name: z.ZodString;
408
- avatar: z.ZodNullable<z.ZodString>;
409
- isBot: z.ZodBoolean;
410
- }, z.core.$strip>;
411
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
412
- url: z.ZodString;
413
- thread: z.ZodString;
414
- message: z.ZodString;
415
- snapshot: z.ZodNullable<z.ZodObject<{
416
- author: z.ZodString;
417
- text: z.ZodString;
418
- createdAt: z.ZodNullable<z.ZodString>;
419
- files: z.ZodArray<z.ZodObject<{
420
- name: z.ZodString;
421
- url: z.ZodNullable<z.ZodString>;
422
- }, z.core.$strip>>;
423
- }, z.core.$strip>>;
424
- }, z.core.$strip>>>;
425
- linksOnly: z.ZodOptional<z.ZodBoolean>;
426
- }, z.core.$strip>, z.ZodObject<{
427
- channel: z.ZodString;
428
- thread: z.ZodString;
429
- subthread: z.ZodNullable<z.ZodString>;
430
- kind: z.ZodLiteral<"deleted">;
431
- message: z.ZodString;
432
- }, z.core.$strip>, z.ZodObject<{
433
- channel: z.ZodString;
434
- thread: z.ZodString;
435
- subthread: z.ZodNullable<z.ZodString>;
436
- kind: z.ZodLiteral<"reaction">;
437
- message: z.ZodString;
438
- emoji: z.ZodString;
439
- added: z.ZodBoolean;
440
- author: z.ZodObject<{
441
- id: z.ZodString;
442
- handle: z.ZodString;
443
- name: z.ZodString;
444
- avatar: z.ZodNullable<z.ZodString>;
445
- isBot: z.ZodBoolean;
446
- }, z.core.$strip>;
447
- }, z.core.$strip>, z.ZodObject<{
448
- channel: z.ZodString;
449
- thread: z.ZodString;
450
- kind: z.ZodLiteral<"lifecycle">;
451
- type: z.ZodString;
452
- title: z.ZodString;
453
- url: z.ZodNullable<z.ZodString>;
454
- body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
455
- labels: z.ZodRecord<z.ZodString, z.ZodString>;
456
- unset: z.ZodArray<z.ZodString>;
457
- owns: z.ZodOptional<z.ZodArray<z.ZodString>>;
458
- reply: z.ZodNullable<z.ZodString>;
459
- createRoot: z.ZodBoolean;
460
- retitled: z.ZodOptional<z.ZodBoolean>;
461
- author: z.ZodObject<{
462
- id: z.ZodString;
463
- handle: z.ZodString;
464
- name: z.ZodString;
465
- avatar: z.ZodNullable<z.ZodString>;
466
- isBot: z.ZodBoolean;
467
- }, z.core.$strip>;
468
- }, z.core.$strip>], "kind">;
469
- type ExternalEvent = z.infer<typeof ExternalEvent>;
470
- type ExternalAuthor = z.infer<typeof ExternalAuthor>;
471
- //#endregion
472
- //#region src/contract/folds.d.ts
473
- type Message = {
474
- id: number;
475
- channel: string;
476
- text: string;
477
- re: number | null;
478
- replyTo: number | null;
479
- /** The thread key: the root's event ID. */
480
- thread: string;
481
- labels: Labels;
482
- reactions: Record<string, string[]>;
483
- mentions: string[];
484
- by: Author;
485
- noSync: boolean;
486
- /** Where it came from on a platform, if it did. */
487
- origin: Origin | null;
488
- /** The sync key it came from, or null when written on the board. */
489
- from: string | null;
490
- createdAt: string;
491
- editedAt: string | null;
492
- deleted: boolean;
493
- /** Sync targets this message didn't reach, with why. A later delivery clears its entry. */
494
- undelivered: Record<string, string>;
495
- attachments: Attachment[];
496
- /** Platform messages it links to (Slack permalinks), each with what it said. */
497
- links: Link[];
498
- /** Set when a schedule posted it: the schedule's ID and which send this was, from 0. */
499
- schedule?: {
500
- id: number;
501
- n: number;
502
- };
503
- /**
504
- * Set when its author couldn't read its channel, as `authorizeOwn` checks: where they can't read,
505
- * it's theirs to edit and delete only then. Its event's payload says so too.
506
- */
507
- blind?: true;
508
- /** The index of the last event that changed it. Folds from before it existed leave it out. */
509
- version?: number;
510
- /** The index of its post, or of its last edit or delete. Folds from before it existed leave it out. */
511
- revision?: number;
512
- };
513
- type MessagesState = {
514
- byId: Record<string, Message>;
515
- /** Thread root → reply IDs, in log order. */
516
- replies: Record<string, number[]>;
517
- };
518
- type Channel = {
519
- path: string;
520
- lastIndex: number;
521
- messages: number;
522
- threads: number;
523
- };
524
- type ChannelsState = Record<string, Channel>;
525
- type Actor = {
526
- id: string;
527
- kind: ActorKind;
528
- handle: string;
529
- name: string;
530
- avatar: string | null;
531
- /** A host's principal, or one of its profiles: once it's seen as one, it stays one. Views leave it out. */
532
- host?: true;
533
- };
534
- type ActorsState = {
535
- byId: Record<string, Actor>;
536
- /** Lowercased handle → actor IDs. Handles aren't reserved, so several can share one. */
537
- byHandle: Record<string, string[]>;
538
- };
539
- /** A copy of a board message on a platform. */
540
- /** `files`: the platform's IDs for the message's files, or null when it refused them; unset until they're sent. */
541
- /** `by`: the principal of the sync elsewhere that recorded it, whose copy it is to change; none for the board's own sync's. */
542
- type ExternalCopy = {
543
- thread: string;
544
- message: string;
545
- files?: string[] | null;
546
- by?: string;
547
- };
548
- type SyncedThread = {
549
- root: number;
550
- channel: string;
551
- kinds?: Record<string, 'channel' | 'thread'>;
552
- /** External channels (start a thread there) and threads (joined), in sync order. */
553
- targets: string[];
554
- /** Target → the external thread it resolved to. A thread target resolves to itself. */
555
- external: Record<string, string>;
556
- };
557
- //#endregion
558
- export { Labels as A, Author as C, Handle as D, Emoji as E, MessageId as M, MessageText as N, LabelKey as O, AttachmentId as S, ChannelPath as T, BoardEvents as _, ExternalCopy as a, ActorKind as b, SyncedThread as c, ExternalFile as d, ExternalLink as f, BoardEvent as g, BOARD_SESSION as h, ChannelsState as i, MESSAGE_TEXT_MAX as j, LabelValue as k, ExternalAuthor as l, Origin as m, ActorsState as n, Message as o, Link as p, Channel as r, MessagesState as s, Actor as t, ExternalEvent as u, ATTACHMENTS_PER_MESSAGE_MAX as v, CHANNEL_PATH_MAX as w, Attachment as x, ActorId as y };