zen-code 4.6.2 → 4.7.1
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 +52 -27
- package/dist/FileSystemSkillStore-Dl5briBv.mjs +108 -0
- package/dist/{app-Cynj004J.mjs → app-CcnStH9S.mjs} +4963 -4152
- package/dist/{checkpoint-1sAx_j1E-DMtqyBT9.mjs → checkpoint-C5AFBYE--BbnaceZj.mjs} +160 -123
- package/dist/{checkpoint-DxiUsHMy-DqfBiLDW.mjs → checkpoint-DxiUsHMy-Cep4XMTK.mjs} +2 -2
- package/dist/{graphBuilder-mpLrx9tk.mjs → graphBuilder-skVEY6RJ.mjs} +12044 -26952
- package/dist/{index-BW3-KScB.mjs → index-BeLj9JYN.mjs} +2 -2
- package/dist/{index-B6kFMamn.mjs → index-D_dnZWV3.mjs} +2 -2
- package/dist/{load-Bh8eo6qE.mjs → load-iYJqYrjn.mjs} +1 -1
- package/dist/{memories-DirsFRdm.mjs → memories-CSOPZKuJ.mjs} +2 -2
- package/dist/nonInteractive.mjs +26 -22
- package/dist/{queue-Cu_nO_wt-DVTcONlE.mjs → queue-DySatFkr-DjaRbjhM.mjs} +1 -1
- package/dist/{shallow-BQy_8shO.mjs → shallow-CqCGqQDo.mjs} +2 -2
- package/dist/shallow-checkpoint-BEhTdp7z-CquyGG0C.mjs +383 -0
- package/dist/{sqlite-adapter-BKOLSdoL-5XOA6_0i.mjs → sqlite-adapter-oBA95xba-BrBWorSV.mjs} +22 -11
- package/dist/subTasks-DEZYN-F3.mjs +18 -0
- package/dist/zen-code.mjs +1 -1
- package/package.json +4 -4
- package/dist/FileSystemSkillStore-yvEvcRxB.mjs +0 -94
- package/dist/index-FHDPQ2Qk.mjs +0 -211
- package/dist/load-Cjl9cJ0o.mjs +0 -105
- package/dist/subTasks-Bt97OwvY.mjs +0 -209
|
@@ -1,35 +1,60 @@
|
|
|
1
|
-
import { Kysely as
|
|
2
|
-
import { B as
|
|
3
|
-
import "./graphBuilder-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Kysely as m, sql as d } from "kysely";
|
|
2
|
+
import { B as b, T as l, c as E, m as g } from "./app-CcnStH9S.mjs";
|
|
3
|
+
import "./graphBuilder-skVEY6RJ.mjs";
|
|
4
|
+
const u = {
|
|
5
|
+
maxRetries: 3,
|
|
6
|
+
baseDelayMs: 100,
|
|
7
|
+
isRetryableError: (w) => {
|
|
8
|
+
const e = w?.message?.toLowerCase() || "";
|
|
9
|
+
return e.includes("sqlite_busy") || e.includes("database is locked") || e.includes("database disk image is malformed") || e === "sqlite_busy" || e === "database is locked";
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
async function T(w, e) {
|
|
13
|
+
let i = null;
|
|
14
|
+
for (let n = 0; n < u.maxRetries; n++)
|
|
15
|
+
try {
|
|
16
|
+
return await w();
|
|
17
|
+
} catch (a) {
|
|
18
|
+
if (i = a, !u.isRetryableError(a))
|
|
19
|
+
throw a;
|
|
20
|
+
if (n < u.maxRetries - 1) {
|
|
21
|
+
const c = u.baseDelayMs * Math.pow(2, n);
|
|
22
|
+
console.warn(
|
|
23
|
+
`SQLite lock detected${e ? ` (${e})` : ""}, retrying in ${c}ms (attempt ${n + 1}/${u.maxRetries})`
|
|
24
|
+
), await new Promise((t) => setTimeout(t, c));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
throw i;
|
|
28
|
+
}
|
|
29
|
+
const A = ["source", "step", "parents"];
|
|
30
|
+
const N = A;
|
|
31
|
+
class f extends b {
|
|
7
32
|
db;
|
|
8
33
|
isSetup;
|
|
9
|
-
constructor(e,
|
|
10
|
-
super(
|
|
34
|
+
constructor(e, i) {
|
|
35
|
+
super(i), this.db = new m({
|
|
11
36
|
dialect: e
|
|
12
37
|
}), this.isSetup = !1;
|
|
13
38
|
}
|
|
14
39
|
static async fromConnStringAsync(e) {
|
|
15
|
-
let
|
|
40
|
+
let i;
|
|
16
41
|
if (globalThis.Bun) {
|
|
17
42
|
console.log("LG | Using BunWorkerDialect " + e);
|
|
18
|
-
const { BunWorkerDialect:
|
|
19
|
-
|
|
43
|
+
const { BunWorkerDialect: n } = await import("kysely-bun-worker");
|
|
44
|
+
i = new f(new n({ url: e }));
|
|
20
45
|
} else {
|
|
21
46
|
console.log("LG | Using NodeWasmDialect");
|
|
22
|
-
const { default:
|
|
47
|
+
const { default: n } = await import("node-sqlite3-wasm"), { NodeWasmDialect: a } = await import("kysely-wasm");
|
|
23
48
|
console.log(e);
|
|
24
|
-
const
|
|
25
|
-
database: new
|
|
49
|
+
const c = new a({
|
|
50
|
+
database: new n.Database(e)
|
|
26
51
|
});
|
|
27
|
-
|
|
52
|
+
i = new f(c);
|
|
28
53
|
}
|
|
29
|
-
return await
|
|
54
|
+
return await i.setup(), i;
|
|
30
55
|
}
|
|
31
56
|
async setup() {
|
|
32
|
-
this.isSetup || (await
|
|
57
|
+
this.isSetup || (await d`PRAGMA busy_timeout = 5000`.execute(this.db), await d`PRAGMA journal_mode = WAL`.execute(this.db), await d`PRAGMA synchronous = NORMAL`.execute(this.db), await d`PRAGMA wal_autocheckpoint = 1000`.execute(this.db), await d`
|
|
33
58
|
CREATE TABLE IF NOT EXISTS checkpoints (
|
|
34
59
|
thread_id TEXT NOT NULL,
|
|
35
60
|
checkpoint_ns TEXT NOT NULL DEFAULT '',
|
|
@@ -39,7 +64,7 @@ CREATE TABLE IF NOT EXISTS checkpoints (
|
|
|
39
64
|
checkpoint BLOB,
|
|
40
65
|
metadata BLOB,
|
|
41
66
|
PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id)
|
|
42
|
-
)`.execute(this.db), await
|
|
67
|
+
)`.execute(this.db), await d`
|
|
43
68
|
CREATE TABLE IF NOT EXISTS writes (
|
|
44
69
|
thread_id TEXT NOT NULL,
|
|
45
70
|
checkpoint_ns TEXT NOT NULL DEFAULT '',
|
|
@@ -54,8 +79,8 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
54
79
|
}
|
|
55
80
|
async getTuple(e) {
|
|
56
81
|
await this.setup();
|
|
57
|
-
const { thread_id:
|
|
58
|
-
let
|
|
82
|
+
const { thread_id: i, checkpoint_ns: n = "", checkpoint_id: a } = e.configurable ?? {};
|
|
83
|
+
let c = this.db.selectFrom("checkpoints").select([
|
|
59
84
|
"thread_id",
|
|
60
85
|
"checkpoint_ns",
|
|
61
86
|
"checkpoint_id",
|
|
@@ -63,7 +88,7 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
63
88
|
"type",
|
|
64
89
|
"checkpoint",
|
|
65
90
|
"metadata",
|
|
66
|
-
|
|
91
|
+
d`(
|
|
67
92
|
SELECT json_group_array(
|
|
68
93
|
json_object(
|
|
69
94
|
'task_id', pw.task_id,
|
|
@@ -77,7 +102,7 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
77
102
|
AND pw.checkpoint_ns = checkpoints.checkpoint_ns
|
|
78
103
|
AND pw.checkpoint_id = checkpoints.checkpoint_id
|
|
79
104
|
)`.as("pending_writes"),
|
|
80
|
-
|
|
105
|
+
d`(
|
|
81
106
|
SELECT json_group_array(
|
|
82
107
|
json_object(
|
|
83
108
|
'type', ps.type,
|
|
@@ -91,20 +116,20 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
91
116
|
AND ps.channel = ${l}
|
|
92
117
|
ORDER BY ps.idx
|
|
93
118
|
)`.as("pending_sends")
|
|
94
|
-
]).where("thread_id", "=",
|
|
95
|
-
|
|
96
|
-
const t = await
|
|
119
|
+
]).where("thread_id", "=", i).where("checkpoint_ns", "=", n);
|
|
120
|
+
a ? c = c.where("checkpoint_id", "=", a) : c = c.orderBy("checkpoint_id", "desc").limit(1);
|
|
121
|
+
const t = await c.executeTakeFirst();
|
|
97
122
|
if (!t) return;
|
|
98
|
-
let
|
|
99
|
-
if (
|
|
123
|
+
let r = e;
|
|
124
|
+
if (a || (r = {
|
|
100
125
|
configurable: {
|
|
101
126
|
thread_id: t.thread_id,
|
|
102
|
-
checkpoint_ns:
|
|
127
|
+
checkpoint_ns: n,
|
|
103
128
|
checkpoint_id: t.checkpoint_id
|
|
104
129
|
}
|
|
105
|
-
}),
|
|
130
|
+
}), r.configurable?.thread_id === void 0 || r.configurable?.checkpoint_id === void 0)
|
|
106
131
|
throw new Error("Missing thread_id or checkpoint_id");
|
|
107
|
-
const
|
|
132
|
+
const s = await Promise.all(
|
|
108
133
|
JSON.parse(t.pending_writes).map(async (h) => [
|
|
109
134
|
h.task_id,
|
|
110
135
|
h.channel,
|
|
@@ -116,7 +141,7 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
116
141
|
);
|
|
117
142
|
return p.v < 4 && t.parent_checkpoint_id != null && await this.migratePendingSends(p, t.thread_id, t.parent_checkpoint_id), {
|
|
118
143
|
checkpoint: p,
|
|
119
|
-
config:
|
|
144
|
+
config: r,
|
|
120
145
|
metadata: await this.serde.loadsTyped(
|
|
121
146
|
t.type ?? "json",
|
|
122
147
|
new TextDecoder().decode(t.metadata)
|
|
@@ -124,18 +149,18 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
124
149
|
parentConfig: t.parent_checkpoint_id ? {
|
|
125
150
|
configurable: {
|
|
126
151
|
thread_id: t.thread_id,
|
|
127
|
-
checkpoint_ns:
|
|
152
|
+
checkpoint_ns: n,
|
|
128
153
|
checkpoint_id: t.parent_checkpoint_id
|
|
129
154
|
}
|
|
130
155
|
} : void 0,
|
|
131
|
-
pendingWrites:
|
|
156
|
+
pendingWrites: s
|
|
132
157
|
};
|
|
133
158
|
}
|
|
134
|
-
async *list(e,
|
|
135
|
-
const { limit:
|
|
159
|
+
async *list(e, i) {
|
|
160
|
+
const { limit: n, before: a, filter: c } = i ?? {};
|
|
136
161
|
await this.setup();
|
|
137
|
-
const t = e.configurable?.thread_id,
|
|
138
|
-
let
|
|
162
|
+
const t = e.configurable?.thread_id, r = e.configurable?.checkpoint_ns;
|
|
163
|
+
let s = this.db.selectFrom("checkpoints").select([
|
|
139
164
|
"thread_id",
|
|
140
165
|
"checkpoint_ns",
|
|
141
166
|
"checkpoint_id",
|
|
@@ -143,7 +168,7 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
143
168
|
"type",
|
|
144
169
|
"checkpoint",
|
|
145
170
|
"metadata",
|
|
146
|
-
|
|
171
|
+
d`(
|
|
147
172
|
SELECT json_group_array(
|
|
148
173
|
json_object(
|
|
149
174
|
'task_id', pw.task_id,
|
|
@@ -157,7 +182,7 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
157
182
|
AND pw.checkpoint_ns = checkpoints.checkpoint_ns
|
|
158
183
|
AND pw.checkpoint_id = checkpoints.checkpoint_id
|
|
159
184
|
)`.as("pending_writes"),
|
|
160
|
-
|
|
185
|
+
d`(
|
|
161
186
|
SELECT json_group_array(
|
|
162
187
|
json_object(
|
|
163
188
|
'type', ps.type,
|
|
@@ -172,147 +197,159 @@ CREATE TABLE IF NOT EXISTS writes (
|
|
|
172
197
|
ORDER BY ps.idx
|
|
173
198
|
)`.as("pending_sends")
|
|
174
199
|
]);
|
|
175
|
-
t && (
|
|
200
|
+
t && (s = s.where("thread_id", "=", t)), r != null && (s = s.where("checkpoint_ns", "=", r)), a?.configurable?.checkpoint_id !== void 0 && (s = s.where("checkpoint_id", "<", a.configurable.checkpoint_id));
|
|
176
201
|
const p = Object.fromEntries(
|
|
177
|
-
Object.entries(
|
|
178
|
-
([
|
|
202
|
+
Object.entries(c ?? {}).filter(
|
|
203
|
+
([o, _]) => _ !== void 0 && N.includes(o)
|
|
179
204
|
)
|
|
180
205
|
);
|
|
181
|
-
for (const [
|
|
182
|
-
|
|
183
|
-
|
|
206
|
+
for (const [o, _] of Object.entries(p))
|
|
207
|
+
s = s.where(
|
|
208
|
+
d`json_extract(CAST(metadata AS TEXT), ${d.lit("$." + o)})`,
|
|
184
209
|
"=",
|
|
185
|
-
|
|
210
|
+
d.lit(JSON.stringify(_))
|
|
186
211
|
);
|
|
187
|
-
|
|
188
|
-
const h = await
|
|
189
|
-
for (const
|
|
212
|
+
s = s.orderBy("checkpoint_id", "desc"), n && (s = s.limit(parseInt(n, 10)));
|
|
213
|
+
const h = await s.execute();
|
|
214
|
+
for (const o of h) {
|
|
190
215
|
const _ = await Promise.all(
|
|
191
|
-
JSON.parse(
|
|
216
|
+
JSON.parse(o.pending_writes).map(async (k) => [
|
|
192
217
|
k.task_id,
|
|
193
218
|
k.channel,
|
|
194
219
|
await this.serde.loadsTyped(k.type ?? "json", k.value ?? "")
|
|
195
220
|
])
|
|
196
|
-
),
|
|
197
|
-
|
|
198
|
-
new TextDecoder().decode(
|
|
221
|
+
), y = await this.serde.loadsTyped(
|
|
222
|
+
o.type ?? "json",
|
|
223
|
+
new TextDecoder().decode(o.checkpoint)
|
|
199
224
|
);
|
|
200
|
-
|
|
225
|
+
y.v < 4 && o.parent_checkpoint_id != null && await this.migratePendingSends(y, o.thread_id, o.parent_checkpoint_id), yield {
|
|
201
226
|
config: {
|
|
202
227
|
configurable: {
|
|
203
|
-
thread_id:
|
|
204
|
-
checkpoint_ns:
|
|
205
|
-
checkpoint_id:
|
|
228
|
+
thread_id: o.thread_id,
|
|
229
|
+
checkpoint_ns: o.checkpoint_ns,
|
|
230
|
+
checkpoint_id: o.checkpoint_id
|
|
206
231
|
}
|
|
207
232
|
},
|
|
208
|
-
checkpoint:
|
|
233
|
+
checkpoint: y,
|
|
209
234
|
metadata: await this.serde.loadsTyped(
|
|
210
|
-
|
|
211
|
-
new TextDecoder().decode(
|
|
235
|
+
o.type ?? "json",
|
|
236
|
+
new TextDecoder().decode(o.metadata)
|
|
212
237
|
),
|
|
213
|
-
parentConfig:
|
|
238
|
+
parentConfig: o.parent_checkpoint_id ? {
|
|
214
239
|
configurable: {
|
|
215
|
-
thread_id:
|
|
216
|
-
checkpoint_ns:
|
|
217
|
-
checkpoint_id:
|
|
240
|
+
thread_id: o.thread_id,
|
|
241
|
+
checkpoint_ns: o.checkpoint_ns,
|
|
242
|
+
checkpoint_id: o.parent_checkpoint_id
|
|
218
243
|
}
|
|
219
244
|
} : void 0,
|
|
220
245
|
pendingWrites: _
|
|
221
246
|
};
|
|
222
247
|
}
|
|
223
248
|
}
|
|
224
|
-
async put(e,
|
|
249
|
+
async put(e, i, n) {
|
|
225
250
|
if (await this.setup(), !e.configurable)
|
|
226
251
|
throw new Error("Empty configuration supplied.");
|
|
227
|
-
const
|
|
228
|
-
if (!
|
|
252
|
+
const a = e.configurable?.thread_id, c = e.configurable?.checkpoint_ns ?? "", t = e.configurable?.checkpoint_id;
|
|
253
|
+
if (!a)
|
|
229
254
|
throw new Error('Missing "thread_id" field in passed "config.configurable".');
|
|
230
|
-
const
|
|
231
|
-
this.serde.dumpsTyped(
|
|
232
|
-
this.serde.dumpsTyped(
|
|
255
|
+
const r = E(i), [[s, p], [h, o]] = await Promise.all([
|
|
256
|
+
this.serde.dumpsTyped(r),
|
|
257
|
+
this.serde.dumpsTyped(n)
|
|
233
258
|
]);
|
|
234
|
-
if (
|
|
259
|
+
if (s !== h)
|
|
235
260
|
throw new Error("Failed to serialized checkpoint and metadata to the same type.");
|
|
236
|
-
return await
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
261
|
+
return await T(
|
|
262
|
+
async () => {
|
|
263
|
+
await this.db.insertInto("checkpoints").values({
|
|
264
|
+
thread_id: a,
|
|
265
|
+
checkpoint_ns: c,
|
|
266
|
+
checkpoint_id: i.id,
|
|
267
|
+
parent_checkpoint_id: t ?? null,
|
|
268
|
+
type: s,
|
|
269
|
+
checkpoint: new Uint8Array(Buffer.from(p)),
|
|
270
|
+
metadata: new Uint8Array(Buffer.from(o))
|
|
271
|
+
}).onConflict(
|
|
272
|
+
(_) => _.columns(["thread_id", "checkpoint_ns", "checkpoint_id"]).doUpdateSet({
|
|
273
|
+
parent_checkpoint_id: t ?? null,
|
|
274
|
+
type: s,
|
|
275
|
+
checkpoint: new Uint8Array(Buffer.from(p)),
|
|
276
|
+
metadata: new Uint8Array(Buffer.from(o))
|
|
277
|
+
})
|
|
278
|
+
).execute();
|
|
279
|
+
},
|
|
280
|
+
`put(${a}/${i.id})`
|
|
281
|
+
), {
|
|
252
282
|
configurable: {
|
|
253
|
-
thread_id:
|
|
254
|
-
checkpoint_ns:
|
|
255
|
-
checkpoint_id:
|
|
283
|
+
thread_id: a,
|
|
284
|
+
checkpoint_ns: c,
|
|
285
|
+
checkpoint_id: i.id
|
|
256
286
|
}
|
|
257
287
|
};
|
|
258
288
|
}
|
|
259
|
-
async putWrites(e,
|
|
289
|
+
async putWrites(e, i, n) {
|
|
260
290
|
if (await this.setup(), !e.configurable)
|
|
261
291
|
throw new Error("Empty configuration supplied.");
|
|
262
292
|
if (!e.configurable?.thread_id)
|
|
263
293
|
throw new Error("Missing thread_id field in config.configurable.");
|
|
264
294
|
if (!e.configurable?.checkpoint_id)
|
|
265
295
|
throw new Error("Missing checkpoint_id field in config.configurable.");
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
const [
|
|
296
|
+
const a = await Promise.all(
|
|
297
|
+
i.map(async (r, s) => {
|
|
298
|
+
const [p, h] = await this.serde.dumpsTyped(r[1]);
|
|
269
299
|
return {
|
|
270
300
|
thread_id: e.configurable.thread_id,
|
|
271
301
|
checkpoint_ns: e.configurable.checkpoint_ns ?? "",
|
|
272
302
|
checkpoint_id: e.configurable.checkpoint_id,
|
|
273
|
-
task_id:
|
|
274
|
-
idx:
|
|
275
|
-
channel:
|
|
276
|
-
type:
|
|
277
|
-
value: new Uint8Array(Buffer.from(
|
|
303
|
+
task_id: n,
|
|
304
|
+
idx: s,
|
|
305
|
+
channel: r[0],
|
|
306
|
+
type: p,
|
|
307
|
+
value: new Uint8Array(Buffer.from(h))
|
|
278
308
|
};
|
|
279
309
|
})
|
|
280
310
|
);
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
)
|
|
290
|
-
|
|
311
|
+
if (a.length === 0) return;
|
|
312
|
+
const c = e.configurable.thread_id, t = e.configurable.checkpoint_id;
|
|
313
|
+
await T(
|
|
314
|
+
async () => {
|
|
315
|
+
await this.db.transaction().execute(async (r) => {
|
|
316
|
+
await r.deleteFrom("writes").where("thread_id", "=", c).where("checkpoint_ns", "=", a[0].checkpoint_ns).where("checkpoint_id", "=", t).where("task_id", "=", n).execute();
|
|
317
|
+
for (const s of a)
|
|
318
|
+
await r.insertInto("writes").values(s).execute();
|
|
319
|
+
});
|
|
320
|
+
},
|
|
321
|
+
`putWrites(${c}/${t}/${n})`
|
|
322
|
+
);
|
|
291
323
|
}
|
|
292
324
|
async deleteThread(e) {
|
|
293
|
-
await
|
|
294
|
-
|
|
295
|
-
|
|
325
|
+
await T(
|
|
326
|
+
async () => {
|
|
327
|
+
await this.db.transaction().execute(async (i) => {
|
|
328
|
+
await i.deleteFrom("checkpoints").where("thread_id", "=", e).execute(), await i.deleteFrom("writes").where("thread_id", "=", e).execute();
|
|
329
|
+
});
|
|
330
|
+
},
|
|
331
|
+
`deleteThread(${e})`
|
|
332
|
+
);
|
|
296
333
|
}
|
|
297
|
-
async migratePendingSends(e,
|
|
298
|
-
const
|
|
334
|
+
async migratePendingSends(e, i, n) {
|
|
335
|
+
const a = await this.db.selectFrom("writes as ps").select([
|
|
299
336
|
"ps.checkpoint_id",
|
|
300
|
-
|
|
337
|
+
d`json_group_array(
|
|
301
338
|
json_object(
|
|
302
339
|
'type', ps.type,
|
|
303
340
|
'value', CAST(ps.value AS TEXT)
|
|
304
341
|
)
|
|
305
342
|
)`.as("pending_sends")
|
|
306
|
-
]).where("ps.thread_id", "=",
|
|
307
|
-
if (!
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
JSON.parse(
|
|
311
|
-
({ type: t, value:
|
|
343
|
+
]).where("ps.thread_id", "=", i).where("ps.checkpoint_id", "=", n).where("ps.channel", "=", l).orderBy("ps.idx").executeTakeFirst();
|
|
344
|
+
if (!a) return;
|
|
345
|
+
const c = e;
|
|
346
|
+
c.channel_values ??= {}, c.channel_values[l] = await Promise.all(
|
|
347
|
+
JSON.parse(a.pending_sends).map(
|
|
348
|
+
({ type: t, value: r }) => this.serde.loadsTyped(t, r)
|
|
312
349
|
)
|
|
313
|
-
),
|
|
350
|
+
), c.channel_versions[l] = Object.keys(e.channel_versions).length > 0 ? g(...Object.values(e.channel_versions)) : this.getNextVersion(void 0);
|
|
314
351
|
}
|
|
315
352
|
}
|
|
316
353
|
export {
|
|
317
|
-
|
|
354
|
+
f as SqliteSaver
|
|
318
355
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as l, B as N, W as k, m as y } from "./app-
|
|
2
|
-
import "./graphBuilder-
|
|
1
|
+
import { T as l, B as N, W as k, m as y } from "./app-CcnStH9S.mjs";
|
|
2
|
+
import "./graphBuilder-skVEY6RJ.mjs";
|
|
3
3
|
import w from "pg";
|
|
4
4
|
const S = (h) => [
|
|
5
5
|
"checkpoints",
|