zen-code 4.5.0 → 4.6.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/dist/MultiLineTextInput-B4NEXnFm.mjs +23343 -0
- package/dist/cli.mjs +44 -20
- package/dist/devtools-BHqoL8a6.mjs +11653 -0
- package/dist/graphBuilder-B3IJ7dB2.mjs +2641 -0
- package/dist/{index-BHwkVemt.mjs → index-DEcMgCTj.mjs} +1 -1
- package/dist/{memories-B8HqG014.mjs → memories-rSGKIPk5.mjs} +1 -1
- package/dist/metadata-XVTVXthy.mjs +6 -0
- package/dist/nonInteractive.mjs +7 -6
- package/dist/{subTasks-BTMXARkP.mjs → subTasks-5KLIr9iy.mjs} +47 -48
- package/dist/zen-code.mjs +8654 -2
- package/dist/zen-keyboard.mjs +7 -6
- package/package.json +7 -9
- package/dist/MultiLineTextInput-e7hD79Wp.mjs +0 -24631
- package/dist/app-DtYW5k3J.mjs +0 -16061
- package/dist/assets/worker-I4QjJYba.js +0 -1
- package/dist/checkpoint-1sAx_j1E-4BdN8r-w.mjs +0 -319
- package/dist/checkpoint-DxiUsHMy-BV-8KBKD.mjs +0 -394
- package/dist/chunk-YWE62C55-DID9N9eS.mjs +0 -193
- package/dist/devtools-CzaVuYnh.mjs +0 -2667
- package/dist/graphBuilder-B0bC88R_.mjs +0 -48756
- package/dist/id-Cu7CRpDw.mjs +0 -79
- package/dist/index-BUGHAUbY.mjs +0 -117
- package/dist/index-Bgm_TqjU.mjs +0 -212
- package/dist/index-C5j-48Ft.mjs +0 -75
- package/dist/index-CSvPIzA-.mjs +0 -464
- package/dist/index-DS5HVciX.mjs +0 -216
- package/dist/kysely-Bchvsze0.mjs +0 -4316
- package/dist/load-Cjl9cJ0o.mjs +0 -105
- package/dist/migrator-BatO36Tk.mjs +0 -592
- package/dist/pg-adapter-BFtir1GE-BU2H39HC.mjs +0 -62
- package/dist/postgres-dialect-DaHvQ_AZ.mjs +0 -211
- package/dist/queue-Bfg-8ehP-Lko1egu-.mjs +0 -106
- package/dist/remote-threads-CrG03ZS7-C9duTCnB.mjs +0 -157
- package/dist/shallow-DAx5vVov.mjs +0 -332
- package/dist/sql-CJsUpKEQ.mjs +0 -8106
- package/dist/sqlite-adapter-Bbonr5S5-DQLjfvyu.mjs +0 -68
- package/dist/zen-init.mjs +0 -1
package/dist/index-CSvPIzA-.mjs
DELETED
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import { u as C } from "./id-Cu7CRpDw.mjs";
|
|
2
|
-
import { B as v, c as x, T as $, m as I } from "./app-DtYW5k3J.mjs";
|
|
3
|
-
import "./graphBuilder-B0bC88R_.mjs";
|
|
4
|
-
import { createClient as O, createCluster as N } from "redis";
|
|
5
|
-
const W = [
|
|
6
|
-
{
|
|
7
|
-
index: "checkpoints",
|
|
8
|
-
prefix: "checkpoint:",
|
|
9
|
-
schema: {
|
|
10
|
-
"$.thread_id": {
|
|
11
|
-
type: "TAG",
|
|
12
|
-
AS: "thread_id"
|
|
13
|
-
},
|
|
14
|
-
"$.checkpoint_ns": {
|
|
15
|
-
type: "TAG",
|
|
16
|
-
AS: "checkpoint_ns"
|
|
17
|
-
},
|
|
18
|
-
"$.checkpoint_id": {
|
|
19
|
-
type: "TAG",
|
|
20
|
-
AS: "checkpoint_id"
|
|
21
|
-
},
|
|
22
|
-
"$.parent_checkpoint_id": {
|
|
23
|
-
type: "TAG",
|
|
24
|
-
AS: "parent_checkpoint_id"
|
|
25
|
-
},
|
|
26
|
-
"$.checkpoint_ts": {
|
|
27
|
-
type: "NUMERIC",
|
|
28
|
-
AS: "checkpoint_ts"
|
|
29
|
-
},
|
|
30
|
-
"$.has_writes": {
|
|
31
|
-
type: "TAG",
|
|
32
|
-
AS: "has_writes"
|
|
33
|
-
},
|
|
34
|
-
"$.source": {
|
|
35
|
-
type: "TAG",
|
|
36
|
-
AS: "source"
|
|
37
|
-
},
|
|
38
|
-
"$.step": {
|
|
39
|
-
type: "NUMERIC",
|
|
40
|
-
AS: "step"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
index: "checkpoint_blobs",
|
|
46
|
-
prefix: "checkpoint_blob:",
|
|
47
|
-
schema: {
|
|
48
|
-
"$.thread_id": {
|
|
49
|
-
type: "TAG",
|
|
50
|
-
AS: "thread_id"
|
|
51
|
-
},
|
|
52
|
-
"$.checkpoint_ns": {
|
|
53
|
-
type: "TAG",
|
|
54
|
-
AS: "checkpoint_ns"
|
|
55
|
-
},
|
|
56
|
-
"$.checkpoint_id": {
|
|
57
|
-
type: "TAG",
|
|
58
|
-
AS: "checkpoint_id"
|
|
59
|
-
},
|
|
60
|
-
"$.channel": {
|
|
61
|
-
type: "TAG",
|
|
62
|
-
AS: "channel"
|
|
63
|
-
},
|
|
64
|
-
"$.version": {
|
|
65
|
-
type: "TAG",
|
|
66
|
-
AS: "version"
|
|
67
|
-
},
|
|
68
|
-
"$.type": {
|
|
69
|
-
type: "TAG",
|
|
70
|
-
AS: "type"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
index: "checkpoint_writes",
|
|
76
|
-
prefix: "checkpoint_write:",
|
|
77
|
-
schema: {
|
|
78
|
-
"$.thread_id": {
|
|
79
|
-
type: "TAG",
|
|
80
|
-
AS: "thread_id"
|
|
81
|
-
},
|
|
82
|
-
"$.checkpoint_ns": {
|
|
83
|
-
type: "TAG",
|
|
84
|
-
AS: "checkpoint_ns"
|
|
85
|
-
},
|
|
86
|
-
"$.checkpoint_id": {
|
|
87
|
-
type: "TAG",
|
|
88
|
-
AS: "checkpoint_id"
|
|
89
|
-
},
|
|
90
|
-
"$.task_id": {
|
|
91
|
-
type: "TAG",
|
|
92
|
-
AS: "task_id"
|
|
93
|
-
},
|
|
94
|
-
"$.idx": {
|
|
95
|
-
type: "NUMERIC",
|
|
96
|
-
AS: "idx"
|
|
97
|
-
},
|
|
98
|
-
"$.channel": {
|
|
99
|
-
type: "TAG",
|
|
100
|
-
AS: "channel"
|
|
101
|
-
},
|
|
102
|
-
"$.type": {
|
|
103
|
-
type: "TAG",
|
|
104
|
-
AS: "type"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
];
|
|
109
|
-
var L = class m extends v {
|
|
110
|
-
client;
|
|
111
|
-
ttlConfig;
|
|
112
|
-
constructor(e, t) {
|
|
113
|
-
super(), this.client = e, this.ttlConfig = t;
|
|
114
|
-
}
|
|
115
|
-
static async fromUrl(e, t) {
|
|
116
|
-
const s = O({ url: e });
|
|
117
|
-
await s.connect();
|
|
118
|
-
const i = new m(s, t);
|
|
119
|
-
return await i.ensureIndexes(), i;
|
|
120
|
-
}
|
|
121
|
-
static async fromCluster(e, t) {
|
|
122
|
-
const s = N({ rootNodes: e });
|
|
123
|
-
await s.connect();
|
|
124
|
-
const i = new m(s, t);
|
|
125
|
-
return await i.ensureIndexes(), i;
|
|
126
|
-
}
|
|
127
|
-
async get(e) {
|
|
128
|
-
return (await this.getTuple(e))?.checkpoint;
|
|
129
|
-
}
|
|
130
|
-
async getTuple(e) {
|
|
131
|
-
const t = e.configurable?.thread_id, s = e.configurable?.checkpoint_ns ?? "", i = e.configurable?.checkpoint_id;
|
|
132
|
-
if (!t) return;
|
|
133
|
-
let c, o;
|
|
134
|
-
if (i)
|
|
135
|
-
c = `checkpoint:${t}:${s}:${i}`, o = await this.client.json.get(c);
|
|
136
|
-
else {
|
|
137
|
-
const r = `checkpoint:${t}:${s}:*`, p = await this.client.keys(r);
|
|
138
|
-
if (p.length === 0) return;
|
|
139
|
-
p.sort(), c = p[p.length - 1], o = await this.client.json.get(c);
|
|
140
|
-
}
|
|
141
|
-
if (!o) return;
|
|
142
|
-
this.ttlConfig?.refreshOnRead && this.ttlConfig?.defaultTTL && await this.applyTTL(c);
|
|
143
|
-
const { checkpoint: f, pendingWrites: n } = await this.loadCheckpointWithWrites(o);
|
|
144
|
-
return await this.createCheckpointTuple(o, f, n);
|
|
145
|
-
}
|
|
146
|
-
async put(e, t, s, i) {
|
|
147
|
-
await this.ensureIndexes();
|
|
148
|
-
const c = e.configurable?.thread_id, o = e.configurable?.checkpoint_ns ?? "", f = e.configurable?.checkpoint_id;
|
|
149
|
-
if (!c) throw new Error("thread_id is required");
|
|
150
|
-
const n = t.id || C(0), r = `checkpoint:${c}:${o}:${n}`, p = x(t);
|
|
151
|
-
if (p.channel_values && i !== void 0) if (Object.keys(i).length === 0) p.channel_values = {};
|
|
152
|
-
else {
|
|
153
|
-
const u = {};
|
|
154
|
-
for (const a of Object.keys(i)) a in p.channel_values && (u[a] = p.channel_values[a]);
|
|
155
|
-
p.channel_values = u;
|
|
156
|
-
}
|
|
157
|
-
const l = {
|
|
158
|
-
thread_id: c,
|
|
159
|
-
checkpoint_ns: o === "" ? "__empty__" : o,
|
|
160
|
-
checkpoint_id: n,
|
|
161
|
-
parent_checkpoint_id: f || null,
|
|
162
|
-
checkpoint: p,
|
|
163
|
-
metadata: s,
|
|
164
|
-
checkpoint_ts: Date.now(),
|
|
165
|
-
has_writes: "false"
|
|
166
|
-
};
|
|
167
|
-
return this.addSearchableMetadataFields(l, s), await this.client.json.set(r, "$", l), this.ttlConfig?.defaultTTL && await this.applyTTL(r), { configurable: {
|
|
168
|
-
thread_id: c,
|
|
169
|
-
checkpoint_ns: o,
|
|
170
|
-
checkpoint_id: n
|
|
171
|
-
} };
|
|
172
|
-
}
|
|
173
|
-
async *list(e, t) {
|
|
174
|
-
if (await this.ensureIndexes(), t?.filter !== void 0) {
|
|
175
|
-
const i = Object.values(t.filter).some((n) => n === null), c = [];
|
|
176
|
-
if (e?.configurable?.thread_id) {
|
|
177
|
-
const n = e.configurable.thread_id.replace(/[-.@]/g, "\\$&");
|
|
178
|
-
c.push(`(@thread_id:{${n}})`);
|
|
179
|
-
}
|
|
180
|
-
if (e?.configurable?.checkpoint_ns !== void 0) {
|
|
181
|
-
const n = e.configurable.checkpoint_ns;
|
|
182
|
-
if (n === "") c.push("(@checkpoint_ns:{__empty__})");
|
|
183
|
-
else {
|
|
184
|
-
const r = n.replace(/[-.@]/g, "\\$&");
|
|
185
|
-
c.push(`(@checkpoint_ns:{${r}})`);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (!t?.before && t?.filter)
|
|
189
|
-
for (const [n, r] of Object.entries(t.filter)) r === void 0 || r === null || (typeof r == "string" ? c.push(`(@${n}:{${r}})`) : typeof r == "number" ? c.push(`(@${n}:[${r} ${r}])`) : typeof r == "object" && Object.keys(r).length);
|
|
190
|
-
c.length === 0 && c.push("*");
|
|
191
|
-
const o = c.join(" "), f = t?.limit ?? 10;
|
|
192
|
-
try {
|
|
193
|
-
const n = t?.before && !e?.configurable?.thread_id ? 1e3 : t?.before ? f * 10 : f;
|
|
194
|
-
let p = (await this.client.ft.search("checkpoints", o, {
|
|
195
|
-
LIMIT: {
|
|
196
|
-
from: 0,
|
|
197
|
-
size: n
|
|
198
|
-
},
|
|
199
|
-
SORTBY: {
|
|
200
|
-
BY: "checkpoint_ts",
|
|
201
|
-
DIRECTION: "DESC"
|
|
202
|
-
}
|
|
203
|
-
})).documents, l = 0;
|
|
204
|
-
for (const u of p) {
|
|
205
|
-
if (l >= f) break;
|
|
206
|
-
if (t?.before?.configurable?.checkpoint_id) {
|
|
207
|
-
const k = u.value.checkpoint_id, d = t.before.configurable.checkpoint_id;
|
|
208
|
-
if (k >= d) continue;
|
|
209
|
-
}
|
|
210
|
-
const a = u.value;
|
|
211
|
-
let h = !0;
|
|
212
|
-
if ((i || t?.before) && t?.filter) {
|
|
213
|
-
for (const [k, d] of Object.entries(t.filter)) if (d === null) {
|
|
214
|
-
if (a.metadata?.[k] !== null) {
|
|
215
|
-
h = !1;
|
|
216
|
-
break;
|
|
217
|
-
}
|
|
218
|
-
} else if (d !== void 0) {
|
|
219
|
-
const b = a.metadata?.[k];
|
|
220
|
-
if (typeof d == "object" && d !== null) {
|
|
221
|
-
if (g(b) !== g(d)) {
|
|
222
|
-
h = !1;
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
} else if (b !== d) {
|
|
226
|
-
h = !1;
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
if (!h) continue;
|
|
231
|
-
}
|
|
232
|
-
const { checkpoint: y, pendingWrites: _ } = await this.loadCheckpointWithWrites(a);
|
|
233
|
-
yield await this.createCheckpointTuple(a, y, _), l++;
|
|
234
|
-
}
|
|
235
|
-
return;
|
|
236
|
-
} catch (n) {
|
|
237
|
-
if (!n.message?.includes("no such index")) throw n;
|
|
238
|
-
}
|
|
239
|
-
if (e?.configurable?.thread_id) {
|
|
240
|
-
const n = e.configurable.thread_id, r = e.configurable.checkpoint_ns ?? "", p = `checkpoint:${n}:${r}:*`, l = await this.client.keys(p);
|
|
241
|
-
l.sort().reverse();
|
|
242
|
-
let u = l;
|
|
243
|
-
if (t?.before?.configurable?.checkpoint_id) {
|
|
244
|
-
const y = t.before.configurable.thread_id || n, _ = t.before.configurable.checkpoint_ns ?? r, k = `checkpoint:${y}:${_}:${t.before.configurable.checkpoint_id}`, d = l.indexOf(k);
|
|
245
|
-
d > 0 ? u = l.slice(d + 1) : d === 0 && (u = []);
|
|
246
|
-
}
|
|
247
|
-
const a = t?.limit ?? 10, h = u.slice(0, a);
|
|
248
|
-
for (const y of h) {
|
|
249
|
-
const _ = await this.client.json.get(y);
|
|
250
|
-
if (_) {
|
|
251
|
-
let k = !0;
|
|
252
|
-
for (const [S, T] of Object.entries(t.filter)) {
|
|
253
|
-
const A = _.metadata?.[S];
|
|
254
|
-
if (T === null) {
|
|
255
|
-
if (A !== null) {
|
|
256
|
-
k = !1;
|
|
257
|
-
break;
|
|
258
|
-
}
|
|
259
|
-
} else if (A !== T) {
|
|
260
|
-
k = !1;
|
|
261
|
-
break;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
if (!k) continue;
|
|
265
|
-
const { checkpoint: d, pendingWrites: b } = await this.loadCheckpointWithWrites(_);
|
|
266
|
-
yield await this.createCheckpointTuple(_, d, b);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
} else {
|
|
270
|
-
const n = e?.configurable?.checkpoint_ns !== void 0 ? `checkpoint:*:${e.configurable.checkpoint_ns === "" ? "__empty__" : e.configurable.checkpoint_ns}:*` : "checkpoint:*", r = await this.client.keys(n), p = [];
|
|
271
|
-
for (const a of r) {
|
|
272
|
-
const h = await this.client.json.get(a);
|
|
273
|
-
h && p.push({
|
|
274
|
-
key: a,
|
|
275
|
-
doc: h
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
p.sort((a, h) => h.doc.checkpoint_ts - a.doc.checkpoint_ts);
|
|
279
|
-
let l = 0;
|
|
280
|
-
const u = t?.limit ?? 10;
|
|
281
|
-
for (const { doc: a } of p) {
|
|
282
|
-
if (l >= u) break;
|
|
283
|
-
if (t?.before?.configurable?.checkpoint_id) {
|
|
284
|
-
const k = a.checkpoint_id, d = t.before.configurable.checkpoint_id;
|
|
285
|
-
if (k >= d) continue;
|
|
286
|
-
}
|
|
287
|
-
let h = !0;
|
|
288
|
-
if (t?.filter) {
|
|
289
|
-
for (const [k, d] of Object.entries(t.filter)) if (d === null) {
|
|
290
|
-
if (a.metadata?.[k] !== null) {
|
|
291
|
-
h = !1;
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
} else if (d !== void 0) {
|
|
295
|
-
const b = a.metadata?.[k];
|
|
296
|
-
if (typeof d == "object" && d !== null) {
|
|
297
|
-
if (g(b) !== g(d)) {
|
|
298
|
-
h = !1;
|
|
299
|
-
break;
|
|
300
|
-
}
|
|
301
|
-
} else if (b !== d) {
|
|
302
|
-
h = !1;
|
|
303
|
-
break;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
if (!h) continue;
|
|
307
|
-
}
|
|
308
|
-
const { checkpoint: y, pendingWrites: _ } = await this.loadCheckpointWithWrites(a);
|
|
309
|
-
yield await this.createCheckpointTuple(a, y, _), l++;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
const s = {
|
|
315
|
-
...t,
|
|
316
|
-
filter: {}
|
|
317
|
-
};
|
|
318
|
-
yield* this.list(e, s);
|
|
319
|
-
}
|
|
320
|
-
async putWrites(e, t, s) {
|
|
321
|
-
await this.ensureIndexes();
|
|
322
|
-
const i = e.configurable?.thread_id, c = e.configurable?.checkpoint_ns ?? "", o = e.configurable?.checkpoint_id;
|
|
323
|
-
if (!i || !o) throw new Error("thread_id and checkpoint_id are required");
|
|
324
|
-
const f = [], n = performance.now() * 1e3;
|
|
325
|
-
for (let l = 0; l < t.length; l++) {
|
|
326
|
-
const [u, a] = t[l], h = `checkpoint_write:${i}:${c}:${o}:${s}:${l}`;
|
|
327
|
-
f.push(h);
|
|
328
|
-
const y = {
|
|
329
|
-
thread_id: i,
|
|
330
|
-
checkpoint_ns: c,
|
|
331
|
-
checkpoint_id: o,
|
|
332
|
-
task_id: s,
|
|
333
|
-
idx: l,
|
|
334
|
-
channel: u,
|
|
335
|
-
type: typeof a == "object" ? "json" : "string",
|
|
336
|
-
value: a,
|
|
337
|
-
timestamp: n,
|
|
338
|
-
global_idx: n + l
|
|
339
|
-
};
|
|
340
|
-
await this.client.json.set(h, "$", y);
|
|
341
|
-
}
|
|
342
|
-
if (f.length > 0) {
|
|
343
|
-
const l = `write_keys_zset:${i}:${c}:${o}`, u = {};
|
|
344
|
-
f.forEach((a, h) => {
|
|
345
|
-
u[a] = n + h;
|
|
346
|
-
}), await this.client.zAdd(l, Object.entries(u).map(([a, h]) => ({
|
|
347
|
-
score: h,
|
|
348
|
-
value: a
|
|
349
|
-
}))), this.ttlConfig?.defaultTTL && await this.applyTTL(...f, l);
|
|
350
|
-
}
|
|
351
|
-
const r = `checkpoint:${i}:${c}:${o}`;
|
|
352
|
-
if (await this.client.exists(r)) {
|
|
353
|
-
const l = await this.client.json.get(r);
|
|
354
|
-
l && (l.has_writes = "true", await this.client.json.set(r, "$", l));
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
async deleteThread(e) {
|
|
358
|
-
const t = `checkpoint:${e}:*`, s = await this.client.keys(t);
|
|
359
|
-
s.length > 0 && await this.client.del(s);
|
|
360
|
-
const i = `writes:${e}:*`, c = await this.client.keys(i);
|
|
361
|
-
c.length > 0 && await this.client.del(c);
|
|
362
|
-
}
|
|
363
|
-
async end() {
|
|
364
|
-
await this.client.quit();
|
|
365
|
-
}
|
|
366
|
-
async loadPendingWrites(e, t, s) {
|
|
367
|
-
const i = `checkpoint_write:${e}:${t}:${s}:*`, c = await this.client.keys(i);
|
|
368
|
-
if (c.length === 0) return;
|
|
369
|
-
const o = [];
|
|
370
|
-
for (const n of c) {
|
|
371
|
-
const r = await this.client.json.get(n);
|
|
372
|
-
r && o.push(r);
|
|
373
|
-
}
|
|
374
|
-
o.sort((n, r) => (n.global_idx || 0) - (r.global_idx || 0));
|
|
375
|
-
const f = [];
|
|
376
|
-
for (const n of o) {
|
|
377
|
-
const r = await this.serde.loadsTyped("json", JSON.stringify(n.value));
|
|
378
|
-
f.push([
|
|
379
|
-
n.task_id,
|
|
380
|
-
n.channel,
|
|
381
|
-
r
|
|
382
|
-
]);
|
|
383
|
-
}
|
|
384
|
-
return f;
|
|
385
|
-
}
|
|
386
|
-
async loadCheckpointWithWrites(e) {
|
|
387
|
-
const t = await this.serde.loadsTyped("json", JSON.stringify(e.checkpoint));
|
|
388
|
-
if (t.v < 4 && e.parent_checkpoint_id != null) {
|
|
389
|
-
const i = e.checkpoint_ns === "__empty__" ? "" : e.checkpoint_ns;
|
|
390
|
-
await this.migratePendingSends(t, e.thread_id, i, e.parent_checkpoint_id);
|
|
391
|
-
}
|
|
392
|
-
let s;
|
|
393
|
-
if (e.has_writes === "true") {
|
|
394
|
-
const i = e.checkpoint_ns === "__empty__" ? "" : e.checkpoint_ns;
|
|
395
|
-
s = await this.loadPendingWrites(e.thread_id, i, e.checkpoint_id);
|
|
396
|
-
}
|
|
397
|
-
return {
|
|
398
|
-
checkpoint: t,
|
|
399
|
-
pendingWrites: s
|
|
400
|
-
};
|
|
401
|
-
}
|
|
402
|
-
async migratePendingSends(e, t, s, i) {
|
|
403
|
-
const c = await this.loadPendingWrites(t, s, i);
|
|
404
|
-
if (!c || c.length === 0) return;
|
|
405
|
-
const o = c.filter(([, n]) => n === $);
|
|
406
|
-
if (o.length === 0) return;
|
|
407
|
-
const f = [];
|
|
408
|
-
for (const [, , n] of o) f.push(n);
|
|
409
|
-
e.channel_values ??= {}, e.channel_values[$] = f, e.channel_versions[$] = Object.keys(e.channel_versions).length > 0 ? I(...Object.values(e.channel_versions)) : 1;
|
|
410
|
-
}
|
|
411
|
-
async createCheckpointTuple(e, t, s) {
|
|
412
|
-
const i = e.checkpoint_ns === "__empty__" ? "" : e.checkpoint_ns, c = await this.serde.loadsTyped("json", JSON.stringify(e.metadata));
|
|
413
|
-
return {
|
|
414
|
-
config: { configurable: {
|
|
415
|
-
thread_id: e.thread_id,
|
|
416
|
-
checkpoint_ns: i,
|
|
417
|
-
checkpoint_id: e.checkpoint_id
|
|
418
|
-
} },
|
|
419
|
-
checkpoint: t,
|
|
420
|
-
metadata: c,
|
|
421
|
-
parentConfig: e.parent_checkpoint_id ? { configurable: {
|
|
422
|
-
thread_id: e.thread_id,
|
|
423
|
-
checkpoint_ns: i,
|
|
424
|
-
checkpoint_id: e.parent_checkpoint_id
|
|
425
|
-
} } : void 0,
|
|
426
|
-
pendingWrites: s
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
addSearchableMetadataFields(e, t) {
|
|
430
|
-
t && ("source" in t && (e.source = t.source), "step" in t && (e.step = t.step), "writes" in t && (e.writes = typeof t.writes == "object" ? JSON.stringify(t.writes) : t.writes), "score" in t && (e.score = t.score));
|
|
431
|
-
}
|
|
432
|
-
async applyTTL(...e) {
|
|
433
|
-
if (!this.ttlConfig?.defaultTTL) return;
|
|
434
|
-
const t = Math.floor(this.ttlConfig.defaultTTL * 60), s = await Promise.allSettled(e.map((i) => this.client.expire(i, t)));
|
|
435
|
-
for (let i = 0; i < s.length; i++) s[i].status === "rejected" && console.warn(`Failed to set TTL for key ${e[i]}:`, s[i].reason);
|
|
436
|
-
}
|
|
437
|
-
async ensureIndexes() {
|
|
438
|
-
for (const e of W) try {
|
|
439
|
-
await this.client.ft.create(e.index, e.schema, {
|
|
440
|
-
ON: "JSON",
|
|
441
|
-
PREFIX: e.prefix
|
|
442
|
-
});
|
|
443
|
-
} catch (t) {
|
|
444
|
-
t.message?.includes("Index already exists") || console.error(`Failed to create index ${e.index}:`, t.message);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
function g(w) {
|
|
449
|
-
if (w === null || typeof w != "object") return JSON.stringify(w);
|
|
450
|
-
if (Array.isArray(w)) return JSON.stringify(w.map((s) => g(s)));
|
|
451
|
-
const e = {}, t = Object.keys(w).sort();
|
|
452
|
-
for (const s of t) e[s] = w[s];
|
|
453
|
-
return JSON.stringify(e, (s, i) => {
|
|
454
|
-
if (i !== null && typeof i == "object" && !Array.isArray(i)) {
|
|
455
|
-
const c = {}, o = Object.keys(i).sort();
|
|
456
|
-
for (const f of o) c[f] = i[f];
|
|
457
|
-
return c;
|
|
458
|
-
}
|
|
459
|
-
return i;
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
export {
|
|
463
|
-
L as RedisSaver
|
|
464
|
-
};
|
package/dist/index-DS5HVciX.mjs
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { z as s, B as r, E as o, r as d, G as i, A as t, o as l, H as n, s as N, I as u, n as p, J as C, d as O, C as c, c as B, b as T, j as m, L as y, l as A, M as S, e as R, N as D, f as I, P as b, p as g, Q as E, x as f, D as h, V as P, W as M, X as Q, k as _, Y as x, m as L, Z as F, g as U, _ as V, h as J, $ as W, q as v, a0 as w, t as K, F as G, a1 as q, a2 as Y, K as z, ab as H, a3 as k, O as X, a5 as j, a4 as Z, a6 as $, R as ee, U as ae, a7 as se, a8 as re, S as oe, y as de, u as ie, v as te, T as le, a as ne, a9 as Ne, aa as ue, i as pe, w as Ce } from "./kysely-Bchvsze0.mjs";
|
|
2
|
-
import { az as ce, p as Be, X as Te, Y as me, q as ye, R as Ae, A as Se, v as Re, Z as De, b as Ie, aB as be, _ as ge, ay as Ee, C as fe, t as he, $ as Pe, r as Me, s as Qe, a0 as _e, a1 as xe, a2 as Le, a3 as Fe, a4 as Ue, a5 as Ve, a6 as Je, a8 as We, D as ve, a9 as we, j as Ke, K as Ge, P as qe, aa as Ye, E as ze, ab as He, ac as ke, ad as Xe, ae as je, af as Ze, ag as $e, ah as ea, I as aa, ai as sa, h as ra, ak as oa, u as da, al as ia, am as ta, an as la, aA as na, J as Na, aj as ua, ao as pa, ap as Ca, aq as Oa, w as ca, M as Ba, ar as Ta, y as ma, H as ya, N as Aa, G as Sa, x as Ra, aE as Da, as as Ia, m as ba, n as ga, at as Ea, o as fa, au as ha, av as Pa, ax as Ma, aF as Qa, aH as _a, aI as xa, O as La, z as Fa, aJ as Ua, aK as Va, aL as Ja, aM as Wa, aN as va, aO as wa, aP as Ka, aQ as Ga, Q as qa, aR as Ya, aS as za, aT as Ha, aU as ka, aV as Xa, aW as ja, aX as Za, aY as $a, aZ as es, a_ as as, a$ as ss, b0 as rs, T as os, b1 as ds, aC as is, aD as ts, b2 as ls, U as ns, b3 as Ns, k as us, b4 as ps, b5 as Cs, b6 as Os, b7 as cs, b8 as Bs, W as Ts, b9 as ms, ba as ys, V as As, g as Ss, c as Rs, B as Ds, d as Is, e as bs, S as gs, a as Es, a7 as fs, L as hs, i as Ps, aG as Ms, f as Qs, aw as _s, l as xs, F as Ls } from "./sql-CJsUpKEQ.mjs";
|
|
3
|
-
import { C as Us, c as Vs, b as Js, D as Ws, a as vs, O as ws } from "./migrator-BatO36Tk.mjs";
|
|
4
|
-
import { b as Gs, d as qs, c as Ys, a as zs, P as Hs } from "./postgres-dialect-DaHvQ_AZ.mjs";
|
|
5
|
-
import { b as Xs, a as js, S as Zs } from "./chunk-YWE62C55-DID9N9eS.mjs";
|
|
6
|
-
export {
|
|
7
|
-
ce as ARITHMETIC_OPERATORS,
|
|
8
|
-
s as AddColumnNode,
|
|
9
|
-
r as AddConstraintNode,
|
|
10
|
-
o as AddIndexNode,
|
|
11
|
-
Be as AggregateFunctionBuilder,
|
|
12
|
-
Te as AggregateFunctionNode,
|
|
13
|
-
me as AliasNode,
|
|
14
|
-
ye as AliasedAggregateFunctionBuilder,
|
|
15
|
-
Ae as AliasedDynamicTableBuilder,
|
|
16
|
-
Se as AliasedExpressionWrapper,
|
|
17
|
-
Re as AliasedJSONPathBuilder,
|
|
18
|
-
d as AlterColumnBuilder,
|
|
19
|
-
i as AlterColumnNode,
|
|
20
|
-
t as AlterTableBuilder,
|
|
21
|
-
l as AlterTableColumnAlteringBuilder,
|
|
22
|
-
n as AlterTableNode,
|
|
23
|
-
N as AlteredColumnBuilder,
|
|
24
|
-
De as AndNode,
|
|
25
|
-
Ie as AndWrapper,
|
|
26
|
-
be as BINARY_OPERATORS,
|
|
27
|
-
ge as BinaryOperationNode,
|
|
28
|
-
Ee as COMPARISON_OPERATORS,
|
|
29
|
-
fe as CaseBuilder,
|
|
30
|
-
he as CaseEndBuilder,
|
|
31
|
-
Pe as CaseNode,
|
|
32
|
-
Me as CaseThenBuilder,
|
|
33
|
-
Qe as CaseWhenBuilder,
|
|
34
|
-
_e as CastNode,
|
|
35
|
-
u as CheckConstraintNode,
|
|
36
|
-
xe as CollateNode,
|
|
37
|
-
p as ColumnDefinitionBuilder,
|
|
38
|
-
C as ColumnDefinitionNode,
|
|
39
|
-
Le as ColumnNode,
|
|
40
|
-
Fe as ColumnUpdateNode,
|
|
41
|
-
O as Command,
|
|
42
|
-
Ue as CommonTableExpressionNameNode,
|
|
43
|
-
Ve as CommonTableExpressionNode,
|
|
44
|
-
Us as CompiledQuery,
|
|
45
|
-
c as ConnectionBuilder,
|
|
46
|
-
B as ControlledTransaction,
|
|
47
|
-
T as ControlledTransactionBuilder,
|
|
48
|
-
m as CreateIndexBuilder,
|
|
49
|
-
y as CreateIndexNode,
|
|
50
|
-
A as CreateSchemaBuilder,
|
|
51
|
-
S as CreateSchemaNode,
|
|
52
|
-
R as CreateTableBuilder,
|
|
53
|
-
D as CreateTableNode,
|
|
54
|
-
I as CreateTypeBuilder,
|
|
55
|
-
b as CreateTypeNode,
|
|
56
|
-
g as CreateViewBuilder,
|
|
57
|
-
E as CreateViewNode,
|
|
58
|
-
Vs as DEFAULT_MIGRATION_LOCK_TABLE,
|
|
59
|
-
Js as DEFAULT_MIGRATION_TABLE,
|
|
60
|
-
Je as DataTypeNode,
|
|
61
|
-
f as DefaultConnectionProvider,
|
|
62
|
-
We as DefaultInsertValueNode,
|
|
63
|
-
Ws as DefaultQueryCompiler,
|
|
64
|
-
h as DefaultQueryExecutor,
|
|
65
|
-
P as DefaultValueNode,
|
|
66
|
-
ve as DeleteQueryBuilder,
|
|
67
|
-
we as DeleteQueryNode,
|
|
68
|
-
Ke as DeleteResult,
|
|
69
|
-
vs as DialectAdapterBase,
|
|
70
|
-
M as DropColumnNode,
|
|
71
|
-
Q as DropConstraintNode,
|
|
72
|
-
_ as DropIndexBuilder,
|
|
73
|
-
x as DropIndexNode,
|
|
74
|
-
L as DropSchemaBuilder,
|
|
75
|
-
F as DropSchemaNode,
|
|
76
|
-
U as DropTableBuilder,
|
|
77
|
-
V as DropTableNode,
|
|
78
|
-
J as DropTypeBuilder,
|
|
79
|
-
W as DropTypeNode,
|
|
80
|
-
v as DropViewBuilder,
|
|
81
|
-
w as DropViewNode,
|
|
82
|
-
K as DynamicModule,
|
|
83
|
-
Ge as DynamicReferenceBuilder,
|
|
84
|
-
qe as DynamicTableBuilder,
|
|
85
|
-
Ye as ExplainNode,
|
|
86
|
-
ze as ExpressionWrapper,
|
|
87
|
-
He as FetchNode,
|
|
88
|
-
G as ForeignKeyConstraintBuilder,
|
|
89
|
-
q as ForeignKeyConstraintNode,
|
|
90
|
-
ke as FromNode,
|
|
91
|
-
Xe as FunctionNode,
|
|
92
|
-
Y as GeneratedNode,
|
|
93
|
-
je as GroupByItemNode,
|
|
94
|
-
Ze as GroupByNode,
|
|
95
|
-
$e as HavingNode,
|
|
96
|
-
ea as IdentifierNode,
|
|
97
|
-
aa as InsertQueryBuilder,
|
|
98
|
-
sa as InsertQueryNode,
|
|
99
|
-
ra as InsertResult,
|
|
100
|
-
oa as JSONOperatorChainNode,
|
|
101
|
-
da as JSONPathBuilder,
|
|
102
|
-
ia as JSONPathLegNode,
|
|
103
|
-
ta as JSONPathNode,
|
|
104
|
-
la as JSONReferenceNode,
|
|
105
|
-
na as JSON_OPERATORS,
|
|
106
|
-
Na as JoinBuilder,
|
|
107
|
-
ua as JoinNode,
|
|
108
|
-
z as Kysely,
|
|
109
|
-
pa as LimitNode,
|
|
110
|
-
Ca as ListNode,
|
|
111
|
-
H as Log,
|
|
112
|
-
Oa as MatchedNode,
|
|
113
|
-
ca as MatchedThenableMergeQueryBuilder,
|
|
114
|
-
Ba as MergeQueryBuilder,
|
|
115
|
-
Ta as MergeQueryNode,
|
|
116
|
-
ma as MergeResult,
|
|
117
|
-
k as ModifyColumnNode,
|
|
118
|
-
ya as NOOP_QUERY_EXECUTOR,
|
|
119
|
-
Aa as NoResultError,
|
|
120
|
-
Sa as NoopQueryExecutor,
|
|
121
|
-
Ra as NotMatchedThenableMergeQueryBuilder,
|
|
122
|
-
X as ON_COMMIT_ACTIONS,
|
|
123
|
-
j as ON_MODIFY_FOREIGN_ACTIONS,
|
|
124
|
-
Da as OPERATORS,
|
|
125
|
-
Ia as OffsetNode,
|
|
126
|
-
ba as OnConflictBuilder,
|
|
127
|
-
ga as OnConflictDoNothingBuilder,
|
|
128
|
-
Ea as OnConflictNode,
|
|
129
|
-
fa as OnConflictUpdateBuilder,
|
|
130
|
-
ha as OnDuplicateKeyNode,
|
|
131
|
-
Pa as OnNode,
|
|
132
|
-
Ma as OperationNodeTransformer,
|
|
133
|
-
ws as OperationNodeVisitor,
|
|
134
|
-
Qa as OperatorNode,
|
|
135
|
-
_a as OrActionNode,
|
|
136
|
-
xa as OrNode,
|
|
137
|
-
La as OrWrapper,
|
|
138
|
-
Fa as OrderByItemBuilder,
|
|
139
|
-
Ua as OrderByItemNode,
|
|
140
|
-
Va as OrderByNode,
|
|
141
|
-
Ja as OutputNode,
|
|
142
|
-
Wa as OverNode,
|
|
143
|
-
va as ParensNode,
|
|
144
|
-
wa as PartitionByItemNode,
|
|
145
|
-
Ka as PartitionByNode,
|
|
146
|
-
Gs as PostgresAdapter,
|
|
147
|
-
qs as PostgresDialect,
|
|
148
|
-
Ys as PostgresDriver,
|
|
149
|
-
zs as PostgresIntrospector,
|
|
150
|
-
Hs as PostgresQueryCompiler,
|
|
151
|
-
Z as PrimaryKeyConstraintNode,
|
|
152
|
-
Ga as PrimitiveValueListNode,
|
|
153
|
-
qa as QueryCreator,
|
|
154
|
-
Ya as QueryNode,
|
|
155
|
-
za as RawNode,
|
|
156
|
-
Ha as ReferenceNode,
|
|
157
|
-
$ as ReferencesNode,
|
|
158
|
-
ee as RefreshMaterializedViewBuilder,
|
|
159
|
-
ae as RefreshMaterializedViewNode,
|
|
160
|
-
se as RenameColumnNode,
|
|
161
|
-
re as RenameConstraintNode,
|
|
162
|
-
ka as ReturningNode,
|
|
163
|
-
oe as SchemaModule,
|
|
164
|
-
Xa as SchemableIdentifierNode,
|
|
165
|
-
ja as SelectAllNode,
|
|
166
|
-
Za as SelectModifierNode,
|
|
167
|
-
$a as SelectQueryNode,
|
|
168
|
-
es as SelectionNode,
|
|
169
|
-
as as SetOperationNode,
|
|
170
|
-
de as SingleConnectionProvider,
|
|
171
|
-
Xs as SqliteAdapter,
|
|
172
|
-
js as SqliteIntrospector,
|
|
173
|
-
Zs as SqliteQueryCompiler,
|
|
174
|
-
ie as TRANSACTION_ACCESS_MODES,
|
|
175
|
-
te as TRANSACTION_ISOLATION_LEVELS,
|
|
176
|
-
ss as TableNode,
|
|
177
|
-
rs as TopNode,
|
|
178
|
-
le as Transaction,
|
|
179
|
-
ne as TransactionBuilder,
|
|
180
|
-
os as TraversedJSONPathBuilder,
|
|
181
|
-
ds as TupleNode,
|
|
182
|
-
is as UNARY_FILTER_OPERATORS,
|
|
183
|
-
ts as UNARY_OPERATORS,
|
|
184
|
-
ls as UnaryOperationNode,
|
|
185
|
-
Ne as UniqueConstraintNode,
|
|
186
|
-
ns as UpdateQueryBuilder,
|
|
187
|
-
Ns as UpdateQueryNode,
|
|
188
|
-
us as UpdateResult,
|
|
189
|
-
ps as UsingNode,
|
|
190
|
-
Cs as ValueListNode,
|
|
191
|
-
Os as ValueNode,
|
|
192
|
-
cs as ValuesNode,
|
|
193
|
-
Bs as WhenNode,
|
|
194
|
-
Ts as WheneableMergeQueryBuilder,
|
|
195
|
-
ms as WhereNode,
|
|
196
|
-
ys as WithNode,
|
|
197
|
-
As as WithSchemaPlugin,
|
|
198
|
-
Ss as createFunctionModule,
|
|
199
|
-
Rs as createQueryId,
|
|
200
|
-
Ds as createRawBuilder,
|
|
201
|
-
Is as createSelectQueryBuilder,
|
|
202
|
-
bs as expressionBuilder,
|
|
203
|
-
gs as isAliasedDynamicTableBuilder,
|
|
204
|
-
Es as isAliasedExpression,
|
|
205
|
-
fs as isColumnDataType,
|
|
206
|
-
ue as isCompilable,
|
|
207
|
-
hs as isDynamicReferenceBuilder,
|
|
208
|
-
Ps as isExpression,
|
|
209
|
-
Ms as isJSONOperator,
|
|
210
|
-
pe as isKyselyProps,
|
|
211
|
-
Qs as isNoResultErrorConstructor,
|
|
212
|
-
_s as isOperationNodeSource,
|
|
213
|
-
xs as logOnce,
|
|
214
|
-
Ls as sql,
|
|
215
|
-
Ce as validateTransactionSettings
|
|
216
|
-
};
|