@vercel/board 0.0.0 → 0.15.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 (126) hide show
  1. package/README.md +180 -0
  2. package/dist/a2-5EG8FkZ8.d.mts +3359 -0
  3. package/dist/a2-DYGYankn.mjs +3045 -0
  4. package/dist/access-CJU2-vaa.mjs +226 -0
  5. package/dist/access-CV96SYgr.d.mts +32 -0
  6. package/dist/access.d.mts +29 -0
  7. package/dist/access.mjs +4 -0
  8. package/dist/actors-rdN4dDTU.mjs +223 -0
  9. package/dist/attempts-BQUp9MKO.mjs +919 -0
  10. package/dist/auth-COzc09sn.mjs +276 -0
  11. package/dist/auth-wHFcAte3.d.mts +203 -0
  12. package/dist/backend-a2/blob-vercel.d.mts +8 -0
  13. package/dist/backend-a2/blob-vercel.mjs +81 -0
  14. package/dist/backend-a2/contract.d.mts +18 -0
  15. package/dist/backend-a2/contract.mjs +5 -0
  16. package/dist/backend-a2/scheduler-local.d.mts +11 -0
  17. package/dist/backend-a2/scheduler-local.mjs +2 -0
  18. package/dist/backend-a2/scheduler-qstash.d.mts +2 -0
  19. package/dist/backend-a2/scheduler-qstash.mjs +2 -0
  20. package/dist/backend-a2/scheduler-vercel.d.mts +2 -0
  21. package/dist/backend-a2/scheduler-vercel.mjs +2 -0
  22. package/dist/backend-a2/store-memory.d.mts +11 -0
  23. package/dist/backend-a2/store-memory.mjs +19 -0
  24. package/dist/backend-a2/store-postgres.d.mts +38 -0
  25. package/dist/backend-a2/store-postgres.mjs +110 -0
  26. package/dist/backend-a2/store-redis-http.d.mts +17 -0
  27. package/dist/backend-a2/store-redis-http.mjs +32 -0
  28. package/dist/backend-a2/store-redis.d.mts +23 -0
  29. package/dist/backend-a2/store-redis.mjs +39 -0
  30. package/dist/backend-a2/store-sqlite.d.mts +12 -0
  31. package/dist/backend-a2/store-sqlite.mjs +31 -0
  32. package/dist/backend-a2.d.mts +4 -0
  33. package/dist/backend-a2.mjs +2 -0
  34. package/dist/backend-http-8ex5g7Wv.d.mts +630 -0
  35. package/dist/backend-http-BsDSgmeo.mjs +613 -0
  36. package/dist/backend-http-Cv6xbEy9.mjs +469 -0
  37. package/dist/backend-http.d.mts +10 -0
  38. package/dist/backend-http.mjs +2 -0
  39. package/dist/backend-http.node.d.mts +10 -0
  40. package/dist/backend-http.node.mjs +2 -0
  41. package/dist/blob-C0J3wbGv.d.mts +39 -0
  42. package/dist/bots-CGkO76qH.mjs +67 -0
  43. package/dist/chat-provider-XCnQlxq6.d.mts +140 -0
  44. package/dist/chat-provider-jFSeyNmB.mjs +389 -0
  45. package/dist/cli.d.mts +1 -0
  46. package/dist/cli.mjs +2252 -0
  47. package/dist/client-DGDPaN7U.mjs +380 -0
  48. package/dist/conformance-DRR23YNy.mjs +512 -0
  49. package/dist/conformance.d.mts +30 -0
  50. package/dist/conformance.mjs +2 -0
  51. package/dist/contract-CuJmlrhw.mjs +566 -0
  52. package/dist/emoji-CTLpvH-A.mjs +445 -0
  53. package/dist/engine-3EvQ8idk.mjs +1449 -0
  54. package/dist/errors-DX3hpwWt.mjs +64 -0
  55. package/dist/exports-BpgyEdh6.d.mts +4 -0
  56. package/dist/exports-CyY3_FjZ.mjs +1285 -0
  57. package/dist/files-SniSmeEr.mjs +47 -0
  58. package/dist/index.d.mts +13 -0
  59. package/dist/index.default-BZ3lItjH.mjs +12 -0
  60. package/dist/index.mjs +19 -0
  61. package/dist/index.node.d.mts +14 -0
  62. package/dist/index.node.mjs +5 -0
  63. package/dist/inspect/app.js +416 -0
  64. package/dist/inspect/engine.js +5 -0
  65. package/dist/local-Cr_dSjvs.mjs +44 -0
  66. package/dist/own-OwgPWdmh.mjs +15 -0
  67. package/dist/project-CFiArraX.mjs +124 -0
  68. package/dist/provider-BGjz-mDa.d.mts +2473 -0
  69. package/dist/provider-CuewcDNZ.mjs +205 -0
  70. package/dist/redis-tables-B35vv4CZ.mjs +842 -0
  71. package/dist/reducers-B_vUGQRp.d.mts +1172 -0
  72. package/dist/reducers-mUPFuFJV.mjs +293 -0
  73. package/dist/schemas-Be08nyfW.mjs +74 -0
  74. package/dist/schemas-CWxs3ECJ.d.mts +50 -0
  75. package/dist/serve-Ccbb2LSb.mjs +170 -0
  76. package/dist/server-Cxey38B-.mjs +17 -0
  77. package/dist/serving-BNbzc96L.mjs +2 -0
  78. package/dist/sql-DbiEnqM0.mjs +571 -0
  79. package/dist/sqlite-db-Cbj03vmp.mjs +70 -0
  80. package/dist/sync-github.d.mts +473 -0
  81. package/dist/sync-github.mjs +603 -0
  82. package/dist/sync-kapso.d.mts +175 -0
  83. package/dist/sync-kapso.mjs +86 -0
  84. package/dist/sync-slack.d.mts +364 -0
  85. package/dist/sync-slack.mjs +728 -0
  86. package/dist/sync.chat.d.mts +2 -0
  87. package/dist/sync.chat.mjs +2 -0
  88. package/dist/sync.d.mts +3 -0
  89. package/dist/sync.mjs +4 -0
  90. package/dist/targets-ojFEXEyN.mjs +94 -0
  91. package/dist/tokens-DKLn5P9B.mjs +256 -0
  92. package/dist/types-BHCjTZdB.d.mts +104 -0
  93. package/dist/users-Dls7_ANV.mjs +42 -0
  94. package/dist/watch-spec-W0c7ypHJ.mjs +787 -0
  95. package/dist/watchers-hash-D9hbHLKB.mjs +225 -0
  96. package/docs/01-board/01-mounting.md +506 -0
  97. package/docs/01-board/02-database.md +258 -0
  98. package/docs/01-board/03-identity.md +262 -0
  99. package/docs/01-board/04-messages.md +192 -0
  100. package/docs/01-board/05-reading.md +177 -0
  101. package/docs/01-board/06-watchers.md +249 -0
  102. package/docs/01-board/07-schedules.md +133 -0
  103. package/docs/01-board/08-middleware.md +139 -0
  104. package/docs/01-board/09-access.md +499 -0
  105. package/docs/01-quickstart.md +196 -0
  106. package/docs/02-sync/01-overview.md +290 -0
  107. package/docs/02-sync/02-callbacks.md +265 -0
  108. package/docs/02-sync/03-slack.md +248 -0
  109. package/docs/02-sync/04-github.md +201 -0
  110. package/docs/02-sync/05-whatsapp.md +148 -0
  111. package/docs/02-sync/06-providers.md +228 -0
  112. package/docs/03-guides/01-coding-agents.md +226 -0
  113. package/docs/03-guides/02-inspector.md +104 -0
  114. package/docs/03-guides/03-ci.md +251 -0
  115. package/docs/03-guides/04-triage.md +233 -0
  116. package/docs/03-guides/05-agent-factory.md +142 -0
  117. package/docs/04-reference/01-cli.md +606 -0
  118. package/docs/04-reference/02-board.md +579 -0
  119. package/docs/04-reference/03-http.md +489 -0
  120. package/docs/04-reference/04-log.md +250 -0
  121. package/docs/04-reference/05-conformance.md +97 -0
  122. package/docs/index.md +186 -0
  123. package/package.json +168 -1
  124. package/sql/postgres/board.sql +145 -0
  125. package/sql/postgres/notifications.sql +24 -0
  126. package/sql/postgres/schema.sql +451 -0
@@ -0,0 +1,47 @@
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 };
@@ -0,0 +1,13 @@
1
+ import { a as CallerRequest, o as Claims } from "./auth-wHFcAte3.mjs";
2
+ import { i as Attachment } from "./schemas-CWxs3ECJ.mjs";
3
+ import { $ as InboxAckBody, $t as ThreadSummaryView, A as PostOptions, At as SchedulesQueryInput, B as ActorView, Bt as SyncCodeView, Ct as ResolvedSyncTarget, Dt as ScheduleInput, Et as ScheduleBodyOutput, F as UploadInput, Ft as SourceReadQuery, G as Discovery, Gt as SyncFindView, H as BoardEventView, Ht as SyncCopiesView, I as WaitOptions, It as SyncAccountBody, J as EventsQuery, Jt as SyncReceiptBody, K as EditBody, Kt as SyncImportBody, L as Written, Lt as SyncAccountInput, M as ReplyOptions, Mt as SignInQuery, N as ScheduleOptions, Nt as SourceMessage, O as BoardError, Ot as ScheduleView, P as ScheduleTiming, Pt as SourceRead, Q as IdentityView, Qt as SyncUnlinkBody, R as duration, Rt as SyncBody, St as RegistrationView, Tt as ScheduleBody, U as ChannelView, Ut as SyncFindInput, V as ApiError, Vt as SyncCopiesQuery, W as DeleteBody, Wt as SyncFindQuery, X as FiltersInput, Xt as SyncRootsQuery, Y as EventsQueryInput, Yt as SyncReceiptInput, Z as IdentityUnlinkBody, Zt as SyncThreadView, _t as PostInput, an as TypingResult, at as LabelBody, bt as Ref, cn as routes, ct as MatchView, dt as MessageView, en as ThreadView, et as InboxEntry, ft as MessagesPage, gt as PostBody, ht as PersonView, in as TypingBody, it as InboxQuery, j as ProfileOption, jt as SchedulesQueryOutput, k as Filters, kt as SchedulesQuery, lt as MatchesQuery, mt as MessagesQueryInput, nn as ThreadsQuery, nt as InboxNextQuery, on as UploadStartBody, ot as LinkView, pt as MessagesQuery, q as EventsPage, qt as SyncImportInput, rn as ThreadsQueryInput, rt as InboxPushBody, sn as UploadTicket, st as LinkedAccount, tn as ThreadsPage, tt as InboxItem, ut as Me, vt as REGISTERED_WATCHERS_MAX, wt as RouteName, xt as RegisterBody, yt as ReactBody, z as AckBody, zt as SyncCodeBody } from "./provider-BGjz-mDa.mjs";
4
+ import { C as WriteSource, E as Protocol, S as WritePatch, T as Method, _ as WatcherContext, a as BackendRoute, b as MiddlewareContext, c as Identity, d as SelfCaller, f as Subscription, g as Watcher, h as BoardOptions, i as Backend, l as InboxDelivery, m as Board, o as BoardBinding, p as VerifiedCaller, s as Caller, u as ProtocolMethods, v as DroppedError, w as HttpError, x as Write, y as Middleware } from "./a2-5EG8FkZ8.mjs";
5
+ import "./exports-BpgyEdh6.mjs";
6
+ //#region src/server/index.default.d.ts
7
+ /**
8
+ * The handle on a board. Outside Node there's no environment to find one in, so pass its
9
+ * backend: `board({ backend: http(url) })`, whose `fetch` sends the page's own session.
10
+ */
11
+ export declare function board(options?: BoardOptions): Board;
12
+ //#endregion
13
+ export { type AckBody, type ActorView, type ApiError, type Attachment, type Backend, type BackendRoute, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type ChannelView, type Claims, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type Filters, type FiltersInput, HttpError, type Identity, type IdentityUnlinkBody, type IdentityView, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LabelBody, type LinkView, type LinkedAccount, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type PersonView, type PostBody, type PostInput, type PostOptions, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SelfCaller, type SignInQuery, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncAccountBody, type SyncAccountInput, type SyncBody, type SyncCodeBody, type SyncCodeView, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncRootsQuery, type SyncThreadView, type SyncUnlinkBody, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TypingBody, type TypingResult, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, type Written, duration, type routes };
@@ -0,0 +1,12 @@
1
+ import { t as createHttp } from "./backend-http-Cv6xbEy9.mjs";
2
+ //#region src/backend-http/index.default.ts
3
+ /**
4
+ * The board at `url`, which keeps the log. Outside Node there's no environment to find it or a
5
+ * token in: `fetch` (the global one by default) sends the page's own session, which the board's
6
+ * `authenticate` recognizes.
7
+ */
8
+ function http(url, options = {}) {
9
+ return createHttp(url, options, null);
10
+ }
11
+ //#endregion
12
+ export { http as t };
package/dist/index.mjs ADDED
@@ -0,0 +1,19 @@
1
+ import { r as duration, t as BoardError } from "./client-DGDPaN7U.mjs";
2
+ import { t as HttpError } from "./errors-DX3hpwWt.mjs";
3
+ import { t as http } from "./index.default-BZ3lItjH.mjs";
4
+ import { t as createBoard } from "./exports-CyY3_FjZ.mjs";
5
+ import { i as DroppedError } from "./targets-ojFEXEyN.mjs";
6
+ //#region src/server/index.default.ts
7
+ /**
8
+ * The handle on a board. Outside Node there's no environment to find one in, so pass its
9
+ * backend: `board({ backend: http(url) })`, whose `fetch` sends the page's own session.
10
+ */
11
+ function board(options = {}) {
12
+ return createBoard(options, {
13
+ http: () => http(),
14
+ sync: () => import("./engine-3EvQ8idk.mjs"),
15
+ serving: null
16
+ });
17
+ }
18
+ //#endregion
19
+ export { BoardError, DroppedError, HttpError, board, duration };
@@ -0,0 +1,14 @@
1
+ import { a as CallerRequest, o as Claims } from "./auth-wHFcAte3.mjs";
2
+ import { i as Attachment } from "./schemas-CWxs3ECJ.mjs";
3
+ import { $ as InboxAckBody, $t as ThreadSummaryView, A as PostOptions, At as SchedulesQueryInput, B as ActorView, Bt as SyncCodeView, Ct as ResolvedSyncTarget, Dt as ScheduleInput, Et as ScheduleBodyOutput, F as UploadInput, Ft as SourceReadQuery, G as Discovery, Gt as SyncFindView, H as BoardEventView, Ht as SyncCopiesView, I as WaitOptions, It as SyncAccountBody, J as EventsQuery, Jt as SyncReceiptBody, K as EditBody, Kt as SyncImportBody, L as Written, Lt as SyncAccountInput, M as ReplyOptions, Mt as SignInQuery, N as ScheduleOptions, Nt as SourceMessage, O as BoardError, Ot as ScheduleView, P as ScheduleTiming, Pt as SourceRead, Q as IdentityView, Qt as SyncUnlinkBody, R as duration, Rt as SyncBody, St as RegistrationView, Tt as ScheduleBody, U as ChannelView, Ut as SyncFindInput, V as ApiError, Vt as SyncCopiesQuery, W as DeleteBody, Wt as SyncFindQuery, X as FiltersInput, Xt as SyncRootsQuery, Y as EventsQueryInput, Yt as SyncReceiptInput, Z as IdentityUnlinkBody, Zt as SyncThreadView, _t as PostInput, an as TypingResult, at as LabelBody, bt as Ref, cn as routes, ct as MatchView, dt as MessageView, en as ThreadView, et as InboxEntry, ft as MessagesPage, gt as PostBody, ht as PersonView, in as TypingBody, it as InboxQuery, j as ProfileOption, jt as SchedulesQueryOutput, k as Filters, kt as SchedulesQuery, lt as MatchesQuery, mt as MessagesQueryInput, nn as ThreadsQuery, nt as InboxNextQuery, on as UploadStartBody, ot as LinkView, pt as MessagesQuery, q as EventsPage, qt as SyncImportInput, rn as ThreadsQueryInput, rt as InboxPushBody, sn as UploadTicket, st as LinkedAccount, tn as ThreadsPage, tt as InboxItem, ut as Me, vt as REGISTERED_WATCHERS_MAX, wt as RouteName, xt as RegisterBody, yt as ReactBody, z as AckBody, zt as SyncCodeBody } from "./provider-BGjz-mDa.mjs";
4
+ import { C as WriteSource, E as Protocol, S as WritePatch, T as Method, _ as WatcherContext, a as BackendRoute, b as MiddlewareContext, c as Identity, d as SelfCaller, f as Subscription, g as Watcher, h as BoardOptions, i as Backend, l as InboxDelivery, m as Board, o as BoardBinding, p as VerifiedCaller, s as Caller, u as ProtocolMethods, v as DroppedError, w as HttpError, x as Write, y as Middleware } from "./a2-5EG8FkZ8.mjs";
5
+ import "./exports-BpgyEdh6.mjs";
6
+ //#region src/server/index.d.ts
7
+ /**
8
+ * The handle on a board. With a `backend`, the board lives there: `a2()` keeps it in this
9
+ * deployment, `http(url)` uses another. Without one, it's `http()` to the board the environment
10
+ * points at: `BOARD_URL`, then the repo's link (`vb link`, `vb serve`), then `vb use`'s.
11
+ */
12
+ export declare function board(options?: BoardOptions): Board;
13
+ //#endregion
14
+ export { type AckBody, type ActorView, type ApiError, type Attachment, type Backend, type BackendRoute, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type ChannelView, type Claims, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type Filters, type FiltersInput, HttpError, type Identity, type IdentityUnlinkBody, type IdentityView, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LabelBody, type LinkView, type LinkedAccount, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type PersonView, type PostBody, type PostInput, type PostOptions, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SelfCaller, type SignInQuery, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncAccountBody, type SyncAccountInput, type SyncBody, type SyncCodeBody, type SyncCodeView, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncRootsQuery, type SyncThreadView, type SyncUnlinkBody, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TypingBody, type TypingResult, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, type Written, duration, type routes };
@@ -0,0 +1,5 @@
1
+ import { r as duration, t as BoardError } from "./client-DGDPaN7U.mjs";
2
+ import { t as HttpError } from "./errors-DX3hpwWt.mjs";
3
+ import { i as DroppedError } from "./targets-ojFEXEyN.mjs";
4
+ import { t as board } from "./server-Cxey38B-.mjs";
5
+ export { BoardError, DroppedError, HttpError, board, duration };