@vercel/board 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -20
- package/dist/{access-CY5xVMIK.mjs → access-N3XmkKXg.mjs} +3 -3
- package/dist/access.d.mts +4 -5
- package/dist/access.mjs +5 -5
- package/dist/{actors-Bm-ojWWT.mjs → actors-ihyN47OV.mjs} +3 -3
- package/dist/{auth-DLYSt_-A.d.mts → auth-D6z3rMNj.d.mts} +11 -93
- package/dist/{auth-CyO2aw5n.mjs → auth-r-_PeZyw.mjs} +39 -151
- package/dist/{backend-Bob-5CM7.d.mts → backend-CWpyR1A7.d.mts} +81 -51
- package/dist/backend-local.d.mts +28 -0
- package/dist/backend-local.mjs +2 -0
- package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
- package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-DJpFUaFv.d.mts} +2 -3
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +2 -2
- package/dist/cli-embedded.mjs +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/{commands-DK4W3HCJ.d.mts → commands-BOBQHVqM.d.mts} +14 -0
- package/dist/{commands-L1JSGz2Z.mjs → commands-CHoMl06v.mjs} +39 -12
- package/dist/{conformance-DK43HiHf.mjs → conformance-qKmGLTAT.mjs} +40 -5
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DurYIRt8.mjs → engine-JxgZiikU.mjs} +6 -8
- package/dist/{errors-CJXhhzvT.mjs → errors-Pk0XV1hK.mjs} +56 -2
- package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
- package/dist/exports-BuKjVq2t.d.mts +4 -0
- package/dist/exports-gHDHlg0i.mjs +3207 -0
- package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
- package/dist/{folds-DLUzfibJ.d.mts → folds-DjFTiqIM.d.mts} +38 -44
- package/dist/index-CXvvYNYj.d.mts +11 -0
- package/dist/index.d.mts +9 -8
- package/dist/index.mjs +21 -8
- package/dist/index.node.d.mts +5 -6
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +95 -95
- package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
- package/dist/local-BbLjA5vI.mjs +8818 -0
- package/dist/{main-Dz-8komG.mjs → main-CQpCZJFw.mjs} +140 -36
- package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
- package/dist/middleware-BU7rVi9F.mjs +103 -0
- package/dist/{client-COfYrgfV.d.mts → provider-BlzUvcM9.d.mts} +665 -5
- package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
- package/dist/{serve-CTmow-YH.mjs → serve-D8_W4UN6.mjs} +33 -24
- package/dist/{node-BgeGcwX0.mjs → server-BiIUXWbU.mjs} +419 -6
- package/dist/{serving-DBFRo6U_.mjs → serving-D7rcUtSC.mjs} +1 -1
- package/dist/{sql-CT5xVuGr.mjs → sql-BQzKUqQt.mjs} +349 -114
- package/dist/sqlite-DCtZFEVm.mjs +30 -0
- package/dist/{sqlite-db-0WeSOEZN.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
- package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
- package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
- package/dist/store-memory-OdGsc-t_.mjs +2 -0
- package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
- package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
- package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +2 -2
- package/dist/sync-linear.d.mts +2 -3
- package/dist/sync-linear.mjs +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync-slack.mjs +4 -4
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{watchers-hash-BjwlnGD9.mjs → targets-CknPGGVi.mjs} +40 -10
- package/dist/{tokens-Dnyd_y1n.mjs → tokens-DPKjl3jf.mjs} +15 -43
- package/docs/01-board/01-mounting.md +243 -288
- package/docs/01-board/03-identity.md +41 -50
- package/docs/01-board/04-messages.md +19 -16
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +58 -105
- package/docs/01-board/07-schedules.md +21 -41
- package/docs/01-board/08-middleware.md +11 -17
- package/docs/01-board/09-access.md +76 -313
- package/docs/01-board/10-local.md +81 -0
- package/docs/01-quickstart.md +49 -126
- package/docs/02-sync/01-overview.md +25 -80
- package/docs/02-sync/02-functions.md +10 -16
- package/docs/02-sync/03-slack.md +13 -26
- package/docs/02-sync/04-github.md +8 -20
- package/docs/02-sync/07-linear.md +6 -10
- package/docs/03-guides/02-inspector.md +3 -3
- package/docs/03-guides/03-ci.md +88 -128
- package/docs/03-guides/04-triage.md +7 -15
- package/docs/03-guides/05-agent-factory.md +30 -36
- package/docs/04-reference/01-cli.md +118 -32
- package/docs/04-reference/02-board.md +60 -74
- package/docs/04-reference/03-http.md +119 -57
- package/docs/04-reference/05-conformance.md +31 -45
- package/docs/index.md +41 -65
- package/package.json +12 -83
- package/dist/a2-DngWY2Eb.mjs +0 -4238
- package/dist/access-DPcrKIH_.d.mts +0 -37
- package/dist/backend-a2/blob-vercel.d.mts +0 -8
- package/dist/backend-a2/blob-vercel.mjs +0 -81
- package/dist/backend-a2/contract.d.mts +0 -828
- package/dist/backend-a2/contract.mjs +0 -5
- package/dist/backend-a2/scheduler-local.d.mts +0 -11
- package/dist/backend-a2/scheduler-local.mjs +0 -2
- package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
- package/dist/backend-a2/scheduler-qstash.mjs +0 -522
- package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
- package/dist/backend-a2/scheduler-vercel.mjs +0 -204
- package/dist/backend-a2/store-memory.d.mts +0 -11
- package/dist/backend-a2/store-postgres.d.mts +0 -38
- package/dist/backend-a2/store-postgres.mjs +0 -2977
- package/dist/backend-a2/store-redis-http.d.mts +0 -17
- package/dist/backend-a2/store-redis-http.mjs +0 -520
- package/dist/backend-a2/store-redis.d.mts +0 -31
- package/dist/backend-a2/store-redis.mjs +0 -88
- package/dist/backend-a2/store-sqlite.d.mts +0 -12
- package/dist/backend-a2/store-sqlite.mjs +0 -31
- package/dist/backend-a2.d.mts +0 -2633
- package/dist/backend-a2.mjs +0 -3
- package/dist/backend-http-BRrRbjRx.d.mts +0 -672
- package/dist/backend-http-CvUKOn-m.mjs +0 -585
- package/dist/backend-http-D8mUzuKQ.mjs +0 -18
- package/dist/backend-http.d.mts +0 -10
- package/dist/backend-http.mjs +0 -2
- package/dist/backend-http.node.d.mts +0 -10
- package/dist/backend-http.node.mjs +0 -2
- package/dist/backend-vercel-Ba8JDtqW.mjs +0 -86
- package/dist/backend-vercel-BaSEUdwg.d.mts +0 -674
- package/dist/backend-vercel-CmY9yZ9m.mjs +0 -1656
- package/dist/backend-vercel.d.mts +0 -9
- package/dist/backend-vercel.mjs +0 -11
- package/dist/backend-vercel.node.d.mts +0 -17
- package/dist/backend-vercel.node.mjs +0 -2
- package/dist/blob-Bx8QPWEd.d.mts +0 -40
- package/dist/blob-WbB2DJKn.mjs +0 -201
- package/dist/errors-2vGs49Db.d.mts +0 -16
- package/dist/exports-CWIdN0Ub.mjs +0 -1389
- package/dist/exports-FBOQWT7O.d.mts +0 -5
- package/dist/files-SniSmeEr.mjs +0 -47
- package/dist/folds-Cu9Q9zyQ.mjs +0 -207
- package/dist/index-Ho-ayyQL.d.mts +0 -11
- package/dist/index.default-BUcwDaAe.mjs +0 -12
- package/dist/local-C76Fy5ad.mjs +0 -44
- package/dist/middleware-BavYSDUa.mjs +0 -62
- package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
- package/dist/project-CQ4VUibA.mjs +0 -124
- package/dist/provider-gynDUoyW.d.mts +0 -665
- package/dist/redis-tables-DHf85ixI.mjs +0 -3895
- package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
- package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
- package/dist/reducers-DcENwtwZ.mjs +0 -538
- package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
- package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
- package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
- package/dist/server-DG8D6VV0.mjs +0 -17
- package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
- package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
- package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
- package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
- package/dist/store-memory-4IBl0Ztu.mjs +0 -2
- package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
- package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
- package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
- package/dist/targets-Cgjs29T0.mjs +0 -33
- package/dist/types-CmrFjpml.d.mts +0 -102
- package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
- package/docs/01-board/02-database.md +0 -258
- package/docs/04-reference/04-log.md +0 -247
- package/sql/postgres/board.sql +0 -145
- package/sql/postgres/notifications.sql +0 -24
- package/sql/postgres/schema.sql +0 -451
|
@@ -1,33 +1,356 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { _ as actorKind } from "./schemas-BG205xds.mjs";
|
|
2
|
+
import { c as externalMessageKey, l as isThreadTarget } from "./external-CYe424fO.mjs";
|
|
3
|
+
import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
4
|
+
import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
|
|
5
|
+
//#region src/contract/folds.ts
|
|
6
|
+
const iso = (date) => typeof date === "string" ? date : date.toISOString();
|
|
7
|
+
function foldMessages(state, event) {
|
|
8
|
+
const changed = foldMessage(state, event);
|
|
9
|
+
if (changed) changed.version = event.index;
|
|
10
|
+
if (changed && (event.type === "message.posted" || event.type === "message.edited" || event.type === "message.deleted")) changed.revision = event.index;
|
|
11
|
+
return state;
|
|
12
|
+
}
|
|
13
|
+
/** Applies `event`, and returns the message it changed: none for an event that changes nothing. */
|
|
14
|
+
function foldMessage(state, event) {
|
|
15
|
+
switch (event.type) {
|
|
16
|
+
case "message.posted": {
|
|
17
|
+
const { payload } = event;
|
|
18
|
+
const message = {
|
|
19
|
+
id: event.index,
|
|
20
|
+
channel: payload.channel,
|
|
21
|
+
text: payload.text,
|
|
22
|
+
re: payload.re,
|
|
23
|
+
replyTo: payload.replyTo,
|
|
24
|
+
thread: payload.thread,
|
|
25
|
+
labels: { ...payload.labels },
|
|
26
|
+
reactions: {},
|
|
27
|
+
mentions: payload.mentions,
|
|
28
|
+
by: payload.by,
|
|
29
|
+
noSync: payload.noSync,
|
|
30
|
+
origin: payload.origin,
|
|
31
|
+
from: payload.from,
|
|
32
|
+
createdAt: iso(event.createdAt),
|
|
33
|
+
editedAt: null,
|
|
34
|
+
deleted: false,
|
|
35
|
+
undelivered: {},
|
|
36
|
+
attachments: payload.attachments ?? [],
|
|
37
|
+
links: payload.links ?? [],
|
|
38
|
+
...payload.schedule ? { schedule: { ...payload.schedule } } : {},
|
|
39
|
+
...payload.blind ? { blind: true } : {}
|
|
40
|
+
};
|
|
41
|
+
state.byId[event.index] = message;
|
|
42
|
+
if (payload.re !== null) (state.replies[payload.re] ??= []).push(event.index);
|
|
43
|
+
return message;
|
|
44
|
+
}
|
|
45
|
+
case "message.edited": {
|
|
46
|
+
const message = state.byId[event.payload.id];
|
|
47
|
+
if (!message || message.deleted) return void 0;
|
|
48
|
+
message.text = event.payload.text;
|
|
49
|
+
message.mentions = event.payload.mentions;
|
|
50
|
+
message.editedAt = iso(event.createdAt);
|
|
51
|
+
return message;
|
|
52
|
+
}
|
|
53
|
+
case "message.deleted": {
|
|
54
|
+
const message = state.byId[event.payload.id];
|
|
55
|
+
if (!message || message.deleted) return void 0;
|
|
56
|
+
message.deleted = true;
|
|
57
|
+
message.text = "";
|
|
58
|
+
message.reactions = {};
|
|
59
|
+
message.labels = {};
|
|
60
|
+
message.mentions = [];
|
|
61
|
+
message.attachments = [];
|
|
62
|
+
message.links = [];
|
|
63
|
+
return message;
|
|
64
|
+
}
|
|
65
|
+
case "reaction.added": {
|
|
66
|
+
const message = state.byId[event.payload.id];
|
|
67
|
+
if (!message || message.deleted) return void 0;
|
|
68
|
+
const emoji = canonicalEmoji(event.payload.emoji);
|
|
69
|
+
const actors = own(message.reactions, emoji);
|
|
70
|
+
if (actors?.includes(event.payload.by.actor)) return void 0;
|
|
71
|
+
if (actors) actors.push(event.payload.by.actor);
|
|
72
|
+
else setOwn(message.reactions, emoji, [event.payload.by.actor]);
|
|
73
|
+
return message;
|
|
74
|
+
}
|
|
75
|
+
case "reaction.removed": {
|
|
76
|
+
const message = state.byId[event.payload.id];
|
|
77
|
+
if (!message || message.deleted) return void 0;
|
|
78
|
+
const { by } = event.payload;
|
|
79
|
+
const emoji = canonicalEmoji(event.payload.emoji);
|
|
80
|
+
const had = own(message.reactions, emoji);
|
|
81
|
+
if (!had?.includes(by.actor)) return void 0;
|
|
82
|
+
const actors = had.filter((a) => a !== by.actor);
|
|
83
|
+
if (actors.length > 0) setOwn(message.reactions, emoji, actors);
|
|
84
|
+
else delete message.reactions[emoji];
|
|
85
|
+
return message;
|
|
86
|
+
}
|
|
87
|
+
case "labels.changed": {
|
|
88
|
+
const message = state.byId[event.payload.id];
|
|
89
|
+
if (!message || message.deleted) return void 0;
|
|
90
|
+
for (const [key, value] of Object.entries(event.payload.set)) setOwn(message.labels, key, value);
|
|
91
|
+
for (const key of event.payload.unset) delete message.labels[key];
|
|
92
|
+
return message;
|
|
93
|
+
}
|
|
94
|
+
case "message.linked": {
|
|
95
|
+
const message = state.byId[event.payload.id];
|
|
96
|
+
if (!message || message.deleted) return void 0;
|
|
97
|
+
message.links = event.payload.links;
|
|
98
|
+
return message;
|
|
99
|
+
}
|
|
100
|
+
case "message.sync_failed": {
|
|
101
|
+
const message = state.byId[event.payload.id];
|
|
102
|
+
if (!message) return void 0;
|
|
103
|
+
setOwn(message.undelivered, event.payload.target, event.payload.error);
|
|
104
|
+
return message;
|
|
105
|
+
}
|
|
106
|
+
case "message.synced": {
|
|
107
|
+
const message = state.byId[event.payload.id];
|
|
108
|
+
if (!message || !Object.hasOwn(message.undelivered, event.payload.target)) return void 0;
|
|
109
|
+
delete message.undelivered[event.payload.target];
|
|
110
|
+
return message;
|
|
111
|
+
}
|
|
112
|
+
default: return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Who's who: `actor.seen`. */
|
|
116
|
+
function foldActors(state, event) {
|
|
117
|
+
if (event.type !== "actor.seen") return state;
|
|
118
|
+
const { actor, kind, handle, name, avatar, host } = event.payload;
|
|
119
|
+
const previous = own(state.byId, actor);
|
|
120
|
+
if (previous) {
|
|
121
|
+
const key = previous.handle.toLowerCase();
|
|
122
|
+
const remaining = (own(state.byHandle, key) ?? []).filter((id) => id !== actor);
|
|
123
|
+
if (remaining.length > 0) setOwn(state.byHandle, key, remaining);
|
|
124
|
+
else delete state.byHandle[key];
|
|
125
|
+
}
|
|
126
|
+
setOwn(state.byId, actor, {
|
|
127
|
+
id: actor,
|
|
128
|
+
kind: actorKind(kind),
|
|
129
|
+
handle,
|
|
130
|
+
name,
|
|
131
|
+
avatar,
|
|
132
|
+
...host || previous?.host ? { host: true } : {}
|
|
133
|
+
});
|
|
134
|
+
const key = handle.toLowerCase();
|
|
135
|
+
const ids = own(state.byHandle, key) ?? setOwn(state.byHandle, key, []);
|
|
136
|
+
if (!ids.includes(actor)) ids.push(actor);
|
|
137
|
+
return state;
|
|
138
|
+
}
|
|
139
|
+
const addTarget = (thread, target) => {
|
|
140
|
+
if (!thread.targets.includes(target)) thread.targets.push(target);
|
|
141
|
+
};
|
|
142
|
+
function foldSync(state, event) {
|
|
143
|
+
switch (event.type) {
|
|
144
|
+
case "message.posted": {
|
|
145
|
+
const { payload } = event;
|
|
146
|
+
if (payload.re === null) setOwn(state.threads, payload.thread, {
|
|
147
|
+
root: event.index,
|
|
148
|
+
channel: payload.channel,
|
|
149
|
+
targets: [],
|
|
150
|
+
external: {}
|
|
151
|
+
});
|
|
152
|
+
const origin = payload.origin;
|
|
153
|
+
if (!origin) return state;
|
|
154
|
+
const thread = own(state.threads, payload.thread);
|
|
155
|
+
if (thread && payload.re === null) {
|
|
156
|
+
addTarget(thread, origin.thread);
|
|
157
|
+
setOwn(thread.kinds ??= {}, origin.thread, "thread");
|
|
158
|
+
setOwn(thread.external, origin.thread, origin.thread);
|
|
159
|
+
setOwn(state.byExternalThread, origin.thread, payload.thread);
|
|
160
|
+
}
|
|
161
|
+
const precise = origin.subthread ?? origin.thread;
|
|
162
|
+
setOwn(state.copies[event.index] ??= {}, origin.thread, {
|
|
163
|
+
thread: precise,
|
|
164
|
+
message: origin.message,
|
|
165
|
+
...payload.importedBy ? { by: payload.importedBy } : {}
|
|
166
|
+
});
|
|
167
|
+
state.byExternalMessage[externalMessageKey(precise, origin.message)] = event.index;
|
|
168
|
+
if (precise !== origin.thread) state.byExternalMessage[externalMessageKey(origin.thread, origin.message)] = event.index;
|
|
169
|
+
return state;
|
|
170
|
+
}
|
|
171
|
+
case "thread.synced": {
|
|
172
|
+
const thread = own(state.threads, event.payload.thread);
|
|
173
|
+
if (!thread) return state;
|
|
174
|
+
addTarget(thread, event.payload.target);
|
|
175
|
+
if (event.payload.kind) setOwn(thread.kinds ??= {}, event.payload.target, event.payload.kind);
|
|
176
|
+
if ((event.payload.kind ?? (isThreadTarget(event.payload.target) ? "thread" : "channel")) === "thread") {
|
|
177
|
+
setOwn(thread.external, event.payload.target, event.payload.target);
|
|
178
|
+
setOwn(state.byExternalThread, event.payload.target, event.payload.thread);
|
|
179
|
+
}
|
|
180
|
+
return state;
|
|
181
|
+
}
|
|
182
|
+
case "message.files_synced": {
|
|
183
|
+
const copies = state.copies[event.payload.id];
|
|
184
|
+
const copy = copies && own(copies, event.payload.target);
|
|
185
|
+
if (copy && copy.by === event.payload.syncedBy) copy.files = event.payload.files;
|
|
186
|
+
return state;
|
|
187
|
+
}
|
|
188
|
+
case "message.synced": {
|
|
189
|
+
const { id, target, external, syncedBy } = event.payload;
|
|
190
|
+
setOwn(state.copies[id] ??= {}, target, {
|
|
191
|
+
...external,
|
|
192
|
+
...syncedBy ? { by: syncedBy } : {}
|
|
193
|
+
});
|
|
194
|
+
state.byExternalMessage[externalMessageKey(external.thread, external.message)] = id;
|
|
195
|
+
const thread = own(state.threads, event.payload.thread);
|
|
196
|
+
const main = thread ? own(thread.external, target) : void 0;
|
|
197
|
+
if (main && main !== external.thread) state.byExternalMessage[externalMessageKey(main, external.message)] = id;
|
|
198
|
+
if (thread && thread.root === id && ((thread.kinds && own(thread.kinds, target)) ?? (isThreadTarget(target) ? "thread" : "channel")) === "channel") {
|
|
199
|
+
setOwn(thread.external, target, external.thread);
|
|
200
|
+
setOwn(state.byExternalThread, external.thread, event.payload.thread);
|
|
201
|
+
}
|
|
202
|
+
return state;
|
|
203
|
+
}
|
|
204
|
+
default: return state;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/store/project.ts
|
|
209
|
+
/** The message an event concerns, if any. */
|
|
210
|
+
function concernedMessageId(event) {
|
|
211
|
+
if (event.type === "message.posted") return event.index;
|
|
212
|
+
if ("id" in event.payload) return event.payload.id;
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
const termsOf = (message) => JSON.stringify([
|
|
216
|
+
message.labels,
|
|
217
|
+
message.mentions,
|
|
218
|
+
message.attachments.map((file) => file.id)
|
|
219
|
+
]);
|
|
220
|
+
/**
|
|
221
|
+
* Applies one event to what the tables hold, with the same fold the board has
|
|
222
|
+
* always used, on a state of just that message. Pure: the caller reads `before`
|
|
223
|
+
* and writes the change.
|
|
224
|
+
*/
|
|
225
|
+
function project(before, event) {
|
|
226
|
+
const id = concernedMessageId(event);
|
|
227
|
+
if (id === null) return {};
|
|
228
|
+
const current = before.message;
|
|
229
|
+
if (event.type !== "message.posted" && !current) return {};
|
|
230
|
+
const state = {
|
|
231
|
+
byId: current ? { [id]: structuredClone(current) } : {},
|
|
232
|
+
replies: {}
|
|
233
|
+
};
|
|
234
|
+
foldMessages(state, event);
|
|
235
|
+
const after = state.byId[id];
|
|
236
|
+
if (!after) return {};
|
|
237
|
+
const change = {};
|
|
238
|
+
const created = current === void 0;
|
|
239
|
+
if (created || JSON.stringify(after) !== JSON.stringify(current)) change.message = {
|
|
240
|
+
after,
|
|
241
|
+
created,
|
|
242
|
+
terms: created || termsOf(after) !== termsOf(current)
|
|
243
|
+
};
|
|
244
|
+
if (event.type === "message.posted") {
|
|
245
|
+
if (after.re === null) change.summary = {
|
|
246
|
+
root: id,
|
|
247
|
+
replies: 0,
|
|
248
|
+
at: id
|
|
249
|
+
};
|
|
250
|
+
else if (before.root) change.summary = {
|
|
251
|
+
root: after.re,
|
|
252
|
+
replies: before.root.replies + 1,
|
|
253
|
+
at: id
|
|
254
|
+
};
|
|
255
|
+
} else if (event.type === "message.deleted" && current && !current.deleted && current.re !== null && before.root) {
|
|
256
|
+
const at = before.root.at === id ? before.previousLast ?? current.re : before.root.at;
|
|
257
|
+
change.summary = {
|
|
258
|
+
root: current.re,
|
|
259
|
+
replies: before.root.replies - 1,
|
|
260
|
+
at
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
return change;
|
|
264
|
+
}
|
|
265
|
+
/** The sync rows `event` reads before it applies: none for events that don't touch the sync state. */
|
|
266
|
+
function syncReads(event) {
|
|
267
|
+
switch (event.type) {
|
|
268
|
+
case "message.posted": return {
|
|
269
|
+
thread: null,
|
|
270
|
+
copy: null
|
|
271
|
+
};
|
|
272
|
+
case "thread.synced":
|
|
273
|
+
case "message.synced": return {
|
|
274
|
+
thread: event.payload.thread,
|
|
275
|
+
copy: null
|
|
276
|
+
};
|
|
277
|
+
case "message.files_synced": return {
|
|
278
|
+
thread: null,
|
|
279
|
+
copy: [event.payload.id, event.payload.target]
|
|
280
|
+
};
|
|
281
|
+
default: return {
|
|
282
|
+
thread: null,
|
|
283
|
+
copy: null
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Applies one event to the sync state, with the fold the board has always used,
|
|
289
|
+
* on a state of just what the event touches. Pure, like `project`.
|
|
290
|
+
*/
|
|
291
|
+
function projectSync(before, event) {
|
|
292
|
+
const change = {
|
|
293
|
+
externalThreads: [],
|
|
294
|
+
copies: [],
|
|
295
|
+
externalMessages: []
|
|
296
|
+
};
|
|
297
|
+
if (![
|
|
298
|
+
"message.posted",
|
|
299
|
+
"thread.synced",
|
|
300
|
+
"message.synced",
|
|
301
|
+
"message.files_synced"
|
|
302
|
+
].includes(event.type)) return change;
|
|
303
|
+
const key = event.payload.thread;
|
|
304
|
+
const state = {
|
|
305
|
+
threads: {},
|
|
306
|
+
byExternalThread: {},
|
|
307
|
+
copies: {},
|
|
308
|
+
byExternalMessage: {}
|
|
309
|
+
};
|
|
310
|
+
if (before.thread) setOwn(state.threads, key, structuredClone(before.thread));
|
|
311
|
+
const reads = syncReads(event);
|
|
312
|
+
if (reads.copy && before.copy) state.copies[reads.copy[0]] = { [reads.copy[1]]: structuredClone(before.copy) };
|
|
313
|
+
foldSync(state, event);
|
|
314
|
+
const thread = own(state.threads, key);
|
|
315
|
+
if (thread && JSON.stringify(thread) !== JSON.stringify(before.thread)) change.thread = {
|
|
316
|
+
key,
|
|
317
|
+
data: thread
|
|
318
|
+
};
|
|
319
|
+
for (const [external, owner] of Object.entries(state.byExternalThread)) change.externalThreads.push([external, owner]);
|
|
320
|
+
for (const [message, targets] of Object.entries(state.copies)) for (const [target, copy] of Object.entries(targets)) if (!(reads.copy?.[0] === Number(message) && reads.copy[1] === target && JSON.stringify(copy) === JSON.stringify(before.copy))) change.copies.push([
|
|
321
|
+
Number(message),
|
|
322
|
+
target,
|
|
323
|
+
copy
|
|
324
|
+
]);
|
|
325
|
+
for (const [externalKey, message] of Object.entries(state.byExternalMessage)) change.externalMessages.push([externalKey, message]);
|
|
326
|
+
return change;
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
4
329
|
//#region src/store/sql.ts
|
|
5
330
|
/** The projection's name in `board_positions`, and the A2 consumer that runs it. */
|
|
6
331
|
const TABLES_CONSUMER = "board-tables";
|
|
7
|
-
/** The tables, as statements
|
|
8
|
-
function ddl(
|
|
9
|
-
const big = dialect === "postgres" ? "bigint" : "integer";
|
|
10
|
-
const bool = dialect === "postgres" ? "boolean" : "integer";
|
|
332
|
+
/** The tables, as statements. */
|
|
333
|
+
function ddl() {
|
|
11
334
|
return [
|
|
12
335
|
`create table if not exists board_positions (
|
|
13
336
|
consumer text primary key,
|
|
14
|
-
log_index
|
|
337
|
+
log_index integer not null
|
|
15
338
|
)`,
|
|
16
339
|
`create table if not exists board_messages (
|
|
17
|
-
id
|
|
340
|
+
id integer primary key,
|
|
18
341
|
event_id text not null unique,
|
|
19
342
|
channel text not null,
|
|
20
|
-
re
|
|
343
|
+
re integer,
|
|
21
344
|
by_actor text not null,
|
|
22
345
|
by_principal text not null,
|
|
23
346
|
by_profile text,
|
|
24
347
|
from_key text,
|
|
25
|
-
no_sync
|
|
348
|
+
no_sync integer not null,
|
|
26
349
|
text_lower text not null,
|
|
27
|
-
deleted
|
|
28
|
-
created_at
|
|
350
|
+
deleted integer not null,
|
|
351
|
+
created_at integer not null,
|
|
29
352
|
replies integer not null default 0,
|
|
30
|
-
at
|
|
353
|
+
at integer,
|
|
31
354
|
data text not null
|
|
32
355
|
)`,
|
|
33
356
|
"create index if not exists board_messages_channel on board_messages (channel, id)",
|
|
@@ -37,13 +360,13 @@ function ddl(dialect) {
|
|
|
37
360
|
"create index if not exists board_threads_at on board_messages (at) where re is null",
|
|
38
361
|
"create index if not exists board_threads_channel on board_messages (channel, at) where re is null",
|
|
39
362
|
`create table if not exists board_versions (
|
|
40
|
-
log_index
|
|
41
|
-
message_id
|
|
363
|
+
log_index integer primary key,
|
|
364
|
+
message_id integer not null,
|
|
42
365
|
data text not null
|
|
43
366
|
)`,
|
|
44
367
|
"create index if not exists board_versions_message on board_versions (message_id, log_index)",
|
|
45
368
|
`create table if not exists board_terms (
|
|
46
|
-
message_id
|
|
369
|
+
message_id integer not null,
|
|
47
370
|
term text not null,
|
|
48
371
|
value text not null,
|
|
49
372
|
primary key (message_id, term, value)
|
|
@@ -52,95 +375,23 @@ function ddl(dialect) {
|
|
|
52
375
|
"create table if not exists board_sync_threads (\n thread text primary key,\n data text not null\n)",
|
|
53
376
|
"create table if not exists board_external_threads (\n external text primary key,\n thread text not null\n)",
|
|
54
377
|
`create table if not exists board_copies (
|
|
55
|
-
message_id
|
|
378
|
+
message_id integer not null,
|
|
56
379
|
target text not null,
|
|
57
380
|
data text not null,
|
|
58
381
|
primary key (message_id, target)
|
|
59
382
|
)`,
|
|
60
383
|
`create table if not exists board_external_messages (
|
|
61
384
|
key text primary key,
|
|
62
|
-
message_id
|
|
385
|
+
message_id integer not null
|
|
63
386
|
)`,
|
|
64
|
-
"drop index if exists board_messages_recent"
|
|
65
|
-
...dialect === "postgres" ? ["drop function if exists board_apply(text, bigint, boolean, jsonb, jsonb, jsonb)", APPLY_FUNCTION] : []
|
|
387
|
+
"drop index if exists board_messages_recent"
|
|
66
388
|
];
|
|
67
389
|
}
|
|
68
390
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*/
|
|
74
|
-
const APPLY_FUNCTION = `create or replace function board_apply(
|
|
75
|
-
apply_consumer text,
|
|
76
|
-
apply_index bigint,
|
|
77
|
-
apply_next boolean,
|
|
78
|
-
apply_message jsonb,
|
|
79
|
-
apply_terms jsonb,
|
|
80
|
-
apply_summary jsonb,
|
|
81
|
-
apply_sync jsonb
|
|
82
|
-
) returns boolean language plpgsql as $$
|
|
83
|
-
begin
|
|
84
|
-
if apply_next then
|
|
85
|
-
update board_positions set log_index = apply_index
|
|
86
|
-
where consumer = apply_consumer and log_index = apply_index - 1;
|
|
87
|
-
else
|
|
88
|
-
insert into board_positions (consumer, log_index) values (apply_consumer, apply_index)
|
|
89
|
-
on conflict (consumer) do update set log_index = excluded.log_index
|
|
90
|
-
where board_positions.log_index < excluded.log_index;
|
|
91
|
-
end if;
|
|
92
|
-
if not found then
|
|
93
|
-
return false;
|
|
94
|
-
end if;
|
|
95
|
-
if apply_message is not null then
|
|
96
|
-
if (apply_message->>'created')::boolean then
|
|
97
|
-
insert into board_messages
|
|
98
|
-
(id, event_id, channel, re, by_actor, by_principal, by_profile, from_key, no_sync, text_lower, deleted, created_at, data)
|
|
99
|
-
values (
|
|
100
|
-
(apply_message->>'id')::bigint, apply_message->>'event_id', apply_message->>'channel', (apply_message->>'re')::bigint,
|
|
101
|
-
apply_message->>'by_actor', apply_message->>'by_principal', apply_message->>'by_profile', apply_message->>'from_key',
|
|
102
|
-
(apply_message->>'no_sync')::boolean, apply_message->>'text_lower', (apply_message->>'deleted')::boolean,
|
|
103
|
-
(apply_message->>'created_at')::bigint, apply_message->>'data');
|
|
104
|
-
else
|
|
105
|
-
update board_messages
|
|
106
|
-
set text_lower = apply_message->>'text_lower', deleted = (apply_message->>'deleted')::boolean, data = apply_message->>'data'
|
|
107
|
-
where id = (apply_message->>'id')::bigint;
|
|
108
|
-
end if;
|
|
109
|
-
insert into board_versions (log_index, message_id, data)
|
|
110
|
-
values (apply_index, (apply_message->>'id')::bigint, apply_message->>'data');
|
|
111
|
-
if apply_terms is not null then
|
|
112
|
-
delete from board_terms where message_id = (apply_message->>'id')::bigint;
|
|
113
|
-
insert into board_terms (message_id, term, value)
|
|
114
|
-
select (apply_message->>'id')::bigint, term->>0, term->>1 from jsonb_array_elements(apply_terms) as term;
|
|
115
|
-
end if;
|
|
116
|
-
end if;
|
|
117
|
-
if apply_summary is not null then
|
|
118
|
-
update board_messages set replies = (apply_summary->>'replies')::int, at = (apply_summary->>'at')::bigint
|
|
119
|
-
where id = (apply_summary->>'root')::bigint;
|
|
120
|
-
end if;
|
|
121
|
-
if apply_sync is not null then
|
|
122
|
-
if jsonb_typeof(apply_sync->'thread') = 'object' then
|
|
123
|
-
insert into board_sync_threads (thread, data) values (apply_sync->'thread'->>'key', apply_sync->'thread'->>'data')
|
|
124
|
-
on conflict (thread) do update set data = excluded.data;
|
|
125
|
-
end if;
|
|
126
|
-
insert into board_external_threads (external, thread)
|
|
127
|
-
select entry->>0, entry->>1 from jsonb_array_elements(apply_sync->'external_threads') as entry
|
|
128
|
-
on conflict (external) do update set thread = excluded.thread;
|
|
129
|
-
insert into board_copies (message_id, target, data)
|
|
130
|
-
select (entry->>0)::bigint, entry->>1, entry->>2 from jsonb_array_elements(apply_sync->'copies') as entry
|
|
131
|
-
on conflict (message_id, target) do update set data = excluded.data;
|
|
132
|
-
insert into board_external_messages (key, message_id)
|
|
133
|
-
select entry->>0, (entry->>1)::bigint from jsonb_array_elements(apply_sync->'external_messages') as entry
|
|
134
|
-
on conflict (key) do update set message_id = excluded.message_id;
|
|
135
|
-
end if;
|
|
136
|
-
return true;
|
|
137
|
-
end
|
|
138
|
-
$$`;
|
|
139
|
-
/**
|
|
140
|
-
* Postgres refuses NUL in text, and a lone surrogate in JSON: the board refuses
|
|
141
|
-
* both, and a log from before that may hold them. Nothing a reader filters on
|
|
142
|
-
* needs either, so keys and columns go without NUL and with U+FFFD for a lone
|
|
143
|
-
* surrogate, and the lookups that find them do the same.
|
|
391
|
+
* The board refuses NUL in text and a lone surrogate, and a log from before
|
|
392
|
+
* that may hold them. Nothing a reader filters on needs either, so keys and
|
|
393
|
+
* columns go without NUL and with U+FFFD for a lone surrogate, and the lookups
|
|
394
|
+
* that find them do the same.
|
|
144
395
|
*/
|
|
145
396
|
const clean = (value) => value.replaceAll("\0", "").toWellFormed();
|
|
146
397
|
/** A mention's term. Label keys start with a letter or digit, so it's never a label's. */
|
|
@@ -311,7 +562,7 @@ function sqlTables(db) {
|
|
|
311
562
|
sync: syncPayload(sync)
|
|
312
563
|
};
|
|
313
564
|
}
|
|
314
|
-
/** The writes as statements
|
|
565
|
+
/** The writes, as statements. */
|
|
315
566
|
function statements(index, { message: m, terms, summary, sync }) {
|
|
316
567
|
const out = [];
|
|
317
568
|
if (m) {
|
|
@@ -405,22 +656,6 @@ function sqlTables(db) {
|
|
|
405
656
|
const id = concernedMessageId(event);
|
|
406
657
|
const [change, sync] = await Promise.all([id === null ? {} : before(event, id).then((read) => project(read, event)), syncBefore(event).then((read) => projectSync(read, event))]);
|
|
407
658
|
const written = payload(event, change, sync);
|
|
408
|
-
if (db.dialect === "postgres") {
|
|
409
|
-
const json = (value) => value === null || value === void 0 ? null : JSON.stringify(value);
|
|
410
|
-
const [row] = await db.all({
|
|
411
|
-
text: "select board_apply($1, $2, $3, $4::jsonb, $5::jsonb, $6::jsonb, $7::jsonb) as applied",
|
|
412
|
-
values: [
|
|
413
|
-
TABLES_CONSUMER,
|
|
414
|
-
event.index,
|
|
415
|
-
next,
|
|
416
|
-
json(written.message),
|
|
417
|
-
json(written.terms),
|
|
418
|
-
json(written.summary),
|
|
419
|
-
json(written.sync)
|
|
420
|
-
]
|
|
421
|
-
});
|
|
422
|
-
return row?.applied === true;
|
|
423
|
-
}
|
|
424
659
|
return db.commit(next ? claimNext(event.index) : claim(event.index), statements(event.index, written));
|
|
425
660
|
}
|
|
426
661
|
function threadsQuery(filter, page) {
|
|
@@ -562,4 +797,4 @@ order by m.id`,
|
|
|
562
797
|
};
|
|
563
798
|
}
|
|
564
799
|
//#endregion
|
|
565
|
-
export { ddl as n, sqlTables as r, TABLES_CONSUMER as t };
|
|
800
|
+
export { foldActors as a, concernedMessageId as i, ddl as n, foldMessages as o, sqlTables as r, iso as s, TABLES_CONSUMER as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { r as sqlTables } from "./sql-BQzKUqQt.mjs";
|
|
2
|
+
import { t as sqlite$1 } from "./store-sqlite-D6fIszST.mjs";
|
|
3
|
+
import { t as sqliteDb } from "./sqlite-db-qLTs52Ny.mjs";
|
|
4
|
+
//#region src/store/sqlite.ts
|
|
5
|
+
/**
|
|
6
|
+
* A local board in one SQLite file, its log and board's tables side by side. It
|
|
7
|
+
* creates its tables when it opens, and a serverless function, whose files are
|
|
8
|
+
* read-only, can't open it.
|
|
9
|
+
*/
|
|
10
|
+
function sqlite(options) {
|
|
11
|
+
const { path } = options;
|
|
12
|
+
const log = sqlite$1({ path });
|
|
13
|
+
let tables;
|
|
14
|
+
try {
|
|
15
|
+
tables = sqlTables(sqliteDb(path));
|
|
16
|
+
} catch (error) {
|
|
17
|
+
log.close();
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
log,
|
|
22
|
+
tables,
|
|
23
|
+
async close() {
|
|
24
|
+
await tables.close();
|
|
25
|
+
log.close();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { sqlite };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ddl } from "./sql-
|
|
1
|
+
import { n as ddl } from "./sql-BQzKUqQt.mjs";
|
|
2
2
|
import { mkdirSync } from "node:fs";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
//#region src/store/sqlite-db.ts
|
|
@@ -20,7 +20,7 @@ function sqliteDb(path) {
|
|
|
20
20
|
)), { recursive: true });
|
|
21
21
|
const db = new Database(path);
|
|
22
22
|
db.exec("pragma busy_timeout = 5000");
|
|
23
|
-
for (const statement of ddl(
|
|
23
|
+
for (const statement of ddl()) db.exec(statement);
|
|
24
24
|
const statements = /* @__PURE__ */ new Map();
|
|
25
25
|
const run = (query) => {
|
|
26
26
|
let statement = statements.get(query.text);
|
|
@@ -33,7 +33,6 @@ function sqliteDb(path) {
|
|
|
33
33
|
} catch {}
|
|
34
34
|
};
|
|
35
35
|
return {
|
|
36
|
-
dialect: "sqlite",
|
|
37
36
|
all: async (query) => run(query),
|
|
38
37
|
async read(queries) {
|
|
39
38
|
db.exec("begin");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as duplicateBatchError } from "./internal-CvsrprnU-CEPOUpAv.mjs";
|
|
2
2
|
//#region ../../node_modules/.pnpm/experimental-a2@0.24.0_@upstash+qstash@2.12.0_@vercel+queue@0.7.0_ai@7.0.130_zod@4.6.5__b1e2c243a963f2620a5d202817417c26/node_modules/experimental-a2/dist/store-codec-pAG2oPgQ.js
|
|
3
3
|
const canonicalJson = (value) => JSON.stringify(value, (_key, candidate) => {
|
|
4
4
|
if (candidate === null || typeof candidate !== "object" || Array.isArray(candidate)) return candidate;
|
|
@@ -58,4 +58,8 @@ const idleLogCursor = (consumer, lane, position) => ({
|
|
|
58
58
|
failedAt: null
|
|
59
59
|
});
|
|
60
60
|
//#endregion
|
|
61
|
-
|
|
61
|
+
//#region ../../node_modules/.pnpm/experimental-a2@0.24.0_@upstash+qstash@2.12.0_@vercel+queue@0.7.0_ai@7.0.130_zod@4.6.5__b1e2c243a963f2620a5d202817417c26/node_modules/experimental-a2/dist/store-N8PXxDAS.js
|
|
62
|
+
const SYSTEM_CLOCK = { now: () => /* @__PURE__ */ new Date() };
|
|
63
|
+
const RANDOM_IDS = () => crypto.randomUUID();
|
|
64
|
+
//#endregion
|
|
65
|
+
export { decodeReturnedEventIds as a, decodeCause as i, SYSTEM_CLOCK as n, idempotentReplay as o, cursorKeyOf as r, idleLogCursor as s, RANDOM_IDS as t };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as idleLogCursor, i as idempotentReplay } from "./store-codec-pAG2oPgQ-SqDXlPBR.mjs";
|
|
4
|
-
import { n as SYSTEM_CLOCK, t as RANDOM_IDS } from "./store-N8PXxDAS-DWWgv-Vz.mjs";
|
|
1
|
+
import { C as sessionClearedError, S as lastIndexMismatchError, _ as CLEAR_EVENT_TYPE, b as duplicateBatchError, d as nullProtoRecord, g as A2Error, w as supersededAttemptError } from "./internal-CvsrprnU-CEPOUpAv.mjs";
|
|
2
|
+
import { n as SYSTEM_CLOCK, o as idempotentReplay, s as idleLogCursor, t as RANDOM_IDS } from "./store-N8PXxDAS-BdL4Sq-f.mjs";
|
|
5
3
|
//#region ../../node_modules/.pnpm/experimental-a2@0.24.0_@upstash+qstash@2.12.0_@vercel+queue@0.7.0_ai@7.0.130_zod@4.6.5__b1e2c243a963f2620a5d202817417c26/node_modules/experimental-a2/dist/store-memory.js
|
|
6
4
|
const RECLAIM_BATCH = 256;
|
|
7
5
|
const headOf = (log) => log ? log.offset + log.rows.length : 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as POLL_TIMINGS } from "./internal-CvsrprnU-CEPOUpAv.mjs";
|
|
2
2
|
//#region ../../node_modules/.pnpm/experimental-a2@0.24.0_@upstash+qstash@2.12.0_@vercel+queue@0.7.0_ai@7.0.130_zod@4.6.5__b1e2c243a963f2620a5d202817417c26/node_modules/experimental-a2/dist/store-polling-BZt2Rf3D.js
|
|
3
3
|
const streamActivities = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
function createStreamActivity(wake) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as pollingStream } from "./store-polling-BZt2Rf3D-
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as SYSTEM_CLOCK, t as RANDOM_IDS } from "./store-N8PXxDAS-DWWgv-Vz.mjs";
|
|
1
|
+
import { C as sessionClearedError, S as lastIndexMismatchError, _ as CLEAR_EVENT_TYPE, b as duplicateBatchError, g as A2Error, w as supersededAttemptError } from "./internal-CvsrprnU-CEPOUpAv.mjs";
|
|
2
|
+
import { r as pollingStream } from "./store-polling-BZt2Rf3D-oh3aU_An.mjs";
|
|
3
|
+
import { a as decodeReturnedEventIds, i as decodeCause, n as SYSTEM_CLOCK, o as idempotentReplay, r as cursorKeyOf, s as idleLogCursor, t as RANDOM_IDS } from "./store-N8PXxDAS-BdL4Sq-f.mjs";
|
|
5
4
|
import { mkdirSync } from "node:fs";
|
|
6
5
|
import { dirname, resolve } from "node:path";
|
|
7
6
|
import { DatabaseSync } from "node:sqlite";
|
package/dist/sync-chat-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as channels, g as SyncFn, p as SyncProvider } from "./provider-
|
|
2
|
-
import { r as ChatTransport, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { b as channels, g as SyncFn, p as SyncProvider } from "./provider-BlzUvcM9.mjs";
|
|
2
|
+
import { r as ChatTransport, t as ChatInput } from "./chat-provider-DJpFUaFv.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ReactionEvent } from "chat";
|
|
5
5
|
//#region src/sync/chat-sdk.d.ts
|
package/dist/sync-chat-sdk.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as channels, i as eventSchema, r as envelope } from "./events-
|
|
2
|
-
import { t as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { f as channels, i as eventSchema, r as envelope } from "./events-IQg0k281.mjs";
|
|
2
|
+
import { t as ChatSyncProvider } from "./chat-provider-9hCT654s.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region src/sync/chat-sdk.ts
|
|
5
5
|
const schemaOf = (platform) => eventSchema(platform, "message");
|
package/dist/sync-github.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as SyncContext, g as SyncFn, y as SyncUnit } from "./provider-
|
|
2
|
-
import { n as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { f as SyncContext, g as SyncFn, y as SyncUnit } from "./provider-BlzUvcM9.mjs";
|
|
2
|
+
import { n as ChatSyncProvider } from "./chat-provider-DJpFUaFv.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Adapter } from "chat";
|
|
5
5
|
//#region src/sync/github.d.ts
|