zen-code 4.6.1 → 4.6.2
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-e7hD79Wp.mjs +24631 -0
- package/dist/app-Cynj004J.mjs +16204 -0
- package/dist/checkpoint-1sAx_j1E-DMtqyBT9.mjs +318 -0
- package/dist/checkpoint-DxiUsHMy-DqfBiLDW.mjs +394 -0
- package/dist/cli.mjs +17 -17
- package/dist/devtools-CzaVuYnh.mjs +2667 -0
- package/dist/graphBuilder-mpLrx9tk.mjs +49189 -0
- package/dist/{index-DEcMgCTj.mjs → index-B6kFMamn.mjs} +1 -1
- package/dist/index-BW3-KScB.mjs +463 -0
- package/dist/index-FHDPQ2Qk.mjs +211 -0
- package/dist/load-Cjl9cJ0o.mjs +105 -0
- package/dist/{memories-rSGKIPk5.mjs → memories-DirsFRdm.mjs} +1 -1
- package/dist/nonInteractive.mjs +6 -7
- package/dist/pg-adapter-BFtir1GE-BbUXBpaX.mjs +60 -0
- package/dist/queue-Cu_nO_wt-DVTcONlE.mjs +106 -0
- package/dist/remote-threads-CrG03ZS7-C9duTCnB.mjs +157 -0
- package/dist/shallow-BQy_8shO.mjs +331 -0
- package/dist/sqlite-adapter-BKOLSdoL-5XOA6_0i.mjs +71 -0
- package/dist/{subTasks-5KLIr9iy.mjs → subTasks-Bt97OwvY.mjs} +2 -2
- package/dist/zen-code.mjs +2 -8654
- package/dist/zen-keyboard.mjs +6 -7
- package/package.json +10 -7
- package/dist/MultiLineTextInput-B4NEXnFm.mjs +0 -23343
- package/dist/devtools-BHqoL8a6.mjs +0 -11653
- package/dist/graphBuilder-B3IJ7dB2.mjs +0 -2641
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { B as $, u as g } from "./app-Cynj004J.mjs";
|
|
2
|
+
import "./graphBuilder-mpLrx9tk.mjs";
|
|
3
|
+
import { createClient as T } from "redis";
|
|
4
|
+
function k(u) {
|
|
5
|
+
if (u === null || typeof u != "object") return JSON.stringify(u);
|
|
6
|
+
if (Array.isArray(u)) return JSON.stringify(u.map((i) => k(i)));
|
|
7
|
+
const t = {}, e = Object.keys(u).sort();
|
|
8
|
+
for (const i of e) t[i] = u[i];
|
|
9
|
+
return JSON.stringify(t, (i, n) => {
|
|
10
|
+
if (n !== null && typeof n == "object" && !Array.isArray(n)) {
|
|
11
|
+
const s = {}, c = Object.keys(n).sort();
|
|
12
|
+
for (const r of c) s[r] = n[r];
|
|
13
|
+
return s;
|
|
14
|
+
}
|
|
15
|
+
return n;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const S = [{
|
|
19
|
+
index: "checkpoints",
|
|
20
|
+
prefix: "checkpoint:",
|
|
21
|
+
schema: {
|
|
22
|
+
"$.thread_id": {
|
|
23
|
+
type: "TAG",
|
|
24
|
+
AS: "thread_id"
|
|
25
|
+
},
|
|
26
|
+
"$.checkpoint_ns": {
|
|
27
|
+
type: "TAG",
|
|
28
|
+
AS: "checkpoint_ns"
|
|
29
|
+
},
|
|
30
|
+
"$.checkpoint_id": {
|
|
31
|
+
type: "TAG",
|
|
32
|
+
AS: "checkpoint_id"
|
|
33
|
+
},
|
|
34
|
+
"$.parent_checkpoint_id": {
|
|
35
|
+
type: "TAG",
|
|
36
|
+
AS: "parent_checkpoint_id"
|
|
37
|
+
},
|
|
38
|
+
"$.checkpoint_ts": {
|
|
39
|
+
type: "NUMERIC",
|
|
40
|
+
AS: "checkpoint_ts"
|
|
41
|
+
},
|
|
42
|
+
"$.has_writes": {
|
|
43
|
+
type: "TAG",
|
|
44
|
+
AS: "has_writes"
|
|
45
|
+
},
|
|
46
|
+
"$.source": {
|
|
47
|
+
type: "TAG",
|
|
48
|
+
AS: "source"
|
|
49
|
+
},
|
|
50
|
+
"$.step": {
|
|
51
|
+
type: "NUMERIC",
|
|
52
|
+
AS: "step"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
index: "checkpoint_writes",
|
|
57
|
+
prefix: "checkpoint_write:",
|
|
58
|
+
schema: {
|
|
59
|
+
"$.thread_id": {
|
|
60
|
+
type: "TAG",
|
|
61
|
+
AS: "thread_id"
|
|
62
|
+
},
|
|
63
|
+
"$.checkpoint_ns": {
|
|
64
|
+
type: "TAG",
|
|
65
|
+
AS: "checkpoint_ns"
|
|
66
|
+
},
|
|
67
|
+
"$.checkpoint_id": {
|
|
68
|
+
type: "TAG",
|
|
69
|
+
AS: "checkpoint_id"
|
|
70
|
+
},
|
|
71
|
+
"$.task_id": {
|
|
72
|
+
type: "TAG",
|
|
73
|
+
AS: "task_id"
|
|
74
|
+
},
|
|
75
|
+
"$.idx": {
|
|
76
|
+
type: "NUMERIC",
|
|
77
|
+
AS: "idx"
|
|
78
|
+
},
|
|
79
|
+
"$.channel": {
|
|
80
|
+
type: "TAG",
|
|
81
|
+
AS: "channel"
|
|
82
|
+
},
|
|
83
|
+
"$.type": {
|
|
84
|
+
type: "TAG",
|
|
85
|
+
AS: "type"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}];
|
|
89
|
+
var C = class w extends $ {
|
|
90
|
+
client;
|
|
91
|
+
ttlConfig;
|
|
92
|
+
constructor(t, e) {
|
|
93
|
+
super(), this.client = t, this.ttlConfig = e;
|
|
94
|
+
}
|
|
95
|
+
static async fromUrl(t, e) {
|
|
96
|
+
const i = T({ url: t });
|
|
97
|
+
await i.connect();
|
|
98
|
+
const n = new w(i, e);
|
|
99
|
+
return await n.ensureIndexes(), n;
|
|
100
|
+
}
|
|
101
|
+
async get(t) {
|
|
102
|
+
return (await this.getTuple(t))?.checkpoint;
|
|
103
|
+
}
|
|
104
|
+
async put(t, e, i, n) {
|
|
105
|
+
await this.ensureIndexes();
|
|
106
|
+
const s = t.configurable?.thread_id, c = t.configurable?.checkpoint_ns ?? "", r = t.configurable?.checkpoint_id;
|
|
107
|
+
if (!s) throw new Error("thread_id is required");
|
|
108
|
+
const a = e.id || g(0), l = `checkpoint:${s}:${c}:shallow`;
|
|
109
|
+
let h = null, p = null;
|
|
110
|
+
try {
|
|
111
|
+
h = await this.client.json.get(l), h && typeof h == "object" && (p = h.checkpoint_id);
|
|
112
|
+
} catch {
|
|
113
|
+
}
|
|
114
|
+
p && p !== a && await this.cleanupOldCheckpoint(s, c, p);
|
|
115
|
+
const o = {
|
|
116
|
+
...e,
|
|
117
|
+
channel_values: e.channel_values || {},
|
|
118
|
+
channel_blobs: void 0
|
|
119
|
+
}, d = {
|
|
120
|
+
thread_id: s,
|
|
121
|
+
checkpoint_ns: c,
|
|
122
|
+
checkpoint_id: a,
|
|
123
|
+
parent_checkpoint_id: r || null,
|
|
124
|
+
checkpoint: o,
|
|
125
|
+
metadata: this.sanitizeMetadata(i),
|
|
126
|
+
checkpoint_ts: Date.now(),
|
|
127
|
+
has_writes: "false"
|
|
128
|
+
};
|
|
129
|
+
return this.addSearchableMetadataFields(d, i), await this.client.json.set(l, "$", d), this.ttlConfig?.defaultTTL && await this.applyTTL(l), { configurable: {
|
|
130
|
+
thread_id: s,
|
|
131
|
+
checkpoint_ns: c,
|
|
132
|
+
checkpoint_id: a
|
|
133
|
+
} };
|
|
134
|
+
}
|
|
135
|
+
async getTuple(t) {
|
|
136
|
+
const e = t.configurable?.thread_id, i = t.configurable?.checkpoint_ns ?? "", n = t.configurable?.checkpoint_id;
|
|
137
|
+
if (!e) return;
|
|
138
|
+
const s = `checkpoint:${e}:${i}:shallow`, c = await this.client.json.get(s);
|
|
139
|
+
if (!c || n && c.checkpoint_id !== n) return;
|
|
140
|
+
this.ttlConfig?.refreshOnRead && this.ttlConfig?.defaultTTL && await this.applyTTL(s);
|
|
141
|
+
const r = await this.serde.loadsTyped("json", JSON.stringify(c.checkpoint));
|
|
142
|
+
let a;
|
|
143
|
+
return c.has_writes === "true" && (a = await this.loadPendingWrites(c.thread_id, c.checkpoint_ns, c.checkpoint_id)), await this.createCheckpointTuple(c, r, a);
|
|
144
|
+
}
|
|
145
|
+
async *list(t, e) {
|
|
146
|
+
if (await this.ensureIndexes(), t?.configurable?.thread_id) {
|
|
147
|
+
const i = await this.getTuple(t);
|
|
148
|
+
i && (e?.filter ? this.checkMetadataFilterMatch(i.metadata, e.filter) && (yield i) : yield i);
|
|
149
|
+
} else {
|
|
150
|
+
const i = [];
|
|
151
|
+
if (e?.filter)
|
|
152
|
+
for (const [c, r] of Object.entries(e.filter)) r === void 0 || r === null || (typeof r == "string" ? i.push(`(@${c}:{${r}})`) : typeof r == "number" && i.push(`(@${c}:[${r} ${r}])`));
|
|
153
|
+
i.length === 0 && i.push("*");
|
|
154
|
+
const n = i.join(" "), s = e?.limit ?? 10;
|
|
155
|
+
try {
|
|
156
|
+
const c = await this.client.ft.search("checkpoints", n, {
|
|
157
|
+
LIMIT: {
|
|
158
|
+
from: 0,
|
|
159
|
+
size: s * 2
|
|
160
|
+
},
|
|
161
|
+
SORTBY: {
|
|
162
|
+
BY: "checkpoint_ts",
|
|
163
|
+
DIRECTION: "DESC"
|
|
164
|
+
}
|
|
165
|
+
}), r = /* @__PURE__ */ new Set();
|
|
166
|
+
let a = 0;
|
|
167
|
+
for (const l of c.documents) {
|
|
168
|
+
if (a >= s) break;
|
|
169
|
+
const h = l.value, p = `${h.thread_id}:${h.checkpoint_ns}`;
|
|
170
|
+
if (r.has(p) || (r.add(p), e?.filter && !this.checkMetadataFilterMatch(h.metadata, e.filter)))
|
|
171
|
+
continue;
|
|
172
|
+
const o = await this.serde.loadsTyped("json", JSON.stringify(h.checkpoint));
|
|
173
|
+
yield await this.createCheckpointTuple(h, o), a++;
|
|
174
|
+
}
|
|
175
|
+
} catch (c) {
|
|
176
|
+
if (c.message?.includes("no such index")) {
|
|
177
|
+
const a = await this.client.keys("checkpoint:*:*:shallow");
|
|
178
|
+
if (a.length === 0) return;
|
|
179
|
+
a.sort().reverse();
|
|
180
|
+
const l = /* @__PURE__ */ new Set();
|
|
181
|
+
let h = 0;
|
|
182
|
+
const p = e?.limit ?? 10;
|
|
183
|
+
for (const o of a) {
|
|
184
|
+
if (h >= p) break;
|
|
185
|
+
const d = await this.client.json.get(o);
|
|
186
|
+
if (!d) continue;
|
|
187
|
+
const f = `${d.thread_id}:${d.checkpoint_ns}`;
|
|
188
|
+
if (l.has(f) || (l.add(f), e?.filter && !this.checkMetadataFilterMatch(d.metadata, e.filter)))
|
|
189
|
+
continue;
|
|
190
|
+
const y = await this.serde.loadsTyped("json", JSON.stringify(d.checkpoint));
|
|
191
|
+
yield await this.createCheckpointTuple(d, y), h++;
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
throw c;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async putWrites(t, e, i) {
|
|
200
|
+
await this.ensureIndexes();
|
|
201
|
+
const n = t.configurable?.thread_id, s = t.configurable?.checkpoint_ns ?? "", c = t.configurable?.checkpoint_id;
|
|
202
|
+
if (!n || !c) throw new Error("thread_id and checkpoint_id are required");
|
|
203
|
+
const r = `checkpoint_write:${n}:${s}:${c}:${i}:*`, a = await this.client.keys(r);
|
|
204
|
+
a.length > 0 && await this.client.del(a);
|
|
205
|
+
const l = [];
|
|
206
|
+
for (let o = 0; o < e.length; o++) {
|
|
207
|
+
const [d, f] = e[o], y = `checkpoint_write:${n}:${s}:${c}:${i}:${o}`;
|
|
208
|
+
l.push(y);
|
|
209
|
+
const _ = {
|
|
210
|
+
thread_id: n,
|
|
211
|
+
checkpoint_ns: s,
|
|
212
|
+
checkpoint_id: c,
|
|
213
|
+
task_id: i,
|
|
214
|
+
idx: o,
|
|
215
|
+
channel: d,
|
|
216
|
+
type: typeof f == "object" ? "json" : "string",
|
|
217
|
+
value: f
|
|
218
|
+
};
|
|
219
|
+
await this.client.json.set(y, "$", _);
|
|
220
|
+
}
|
|
221
|
+
if (l.length > 0) {
|
|
222
|
+
const o = `write_keys_zset:${n}:${s}:${c}`, d = {};
|
|
223
|
+
l.forEach((f, y) => {
|
|
224
|
+
d[f] = y;
|
|
225
|
+
}), await this.client.zAdd(o, Object.entries(d).map(([f, y]) => ({
|
|
226
|
+
score: y,
|
|
227
|
+
value: f
|
|
228
|
+
}))), this.ttlConfig?.defaultTTL && await this.applyTTL(...l, o);
|
|
229
|
+
}
|
|
230
|
+
const h = `checkpoint:${n}:${s}:shallow`;
|
|
231
|
+
if (await this.client.exists(h)) {
|
|
232
|
+
const o = await this.client.json.get(h);
|
|
233
|
+
o && (o.has_writes = "true", await this.client.json.set(h, "$", o));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async deleteThread(t) {
|
|
237
|
+
const e = `checkpoint:${t}:*:shallow`, i = await this.client.keys(e);
|
|
238
|
+
i.length > 0 && await this.client.del(i);
|
|
239
|
+
const n = `checkpoint_write:${t}:*`, s = await this.client.keys(n);
|
|
240
|
+
s.length > 0 && await this.client.del(s);
|
|
241
|
+
const c = `write_keys_zset:${t}:*`, r = await this.client.keys(c);
|
|
242
|
+
r.length > 0 && await this.client.del(r);
|
|
243
|
+
}
|
|
244
|
+
async end() {
|
|
245
|
+
await this.client.quit();
|
|
246
|
+
}
|
|
247
|
+
addSearchableMetadataFields(t, e) {
|
|
248
|
+
e && ("source" in e && (t.source = e.source), "step" in e && (t.step = e.step), "writes" in e && (t.writes = typeof e.writes == "object" ? JSON.stringify(e.writes) : e.writes), "score" in e && (t.score = e.score));
|
|
249
|
+
}
|
|
250
|
+
async createCheckpointTuple(t, e, i) {
|
|
251
|
+
const n = await this.serde.loadsTyped("json", JSON.stringify(t.metadata));
|
|
252
|
+
return {
|
|
253
|
+
config: { configurable: {
|
|
254
|
+
thread_id: t.thread_id,
|
|
255
|
+
checkpoint_ns: t.checkpoint_ns,
|
|
256
|
+
checkpoint_id: t.checkpoint_id
|
|
257
|
+
} },
|
|
258
|
+
checkpoint: e,
|
|
259
|
+
metadata: n,
|
|
260
|
+
parentConfig: t.parent_checkpoint_id ? { configurable: {
|
|
261
|
+
thread_id: t.thread_id,
|
|
262
|
+
checkpoint_ns: t.checkpoint_ns,
|
|
263
|
+
checkpoint_id: t.parent_checkpoint_id
|
|
264
|
+
} } : void 0,
|
|
265
|
+
pendingWrites: i
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
async applyTTL(...t) {
|
|
269
|
+
if (!this.ttlConfig?.defaultTTL) return;
|
|
270
|
+
const e = Math.floor(this.ttlConfig.defaultTTL * 60), i = await Promise.allSettled(t.map((n) => this.client.expire(n, e)));
|
|
271
|
+
for (let n = 0; n < i.length; n++) i[n].status === "rejected" && console.warn(`Failed to set TTL for key ${t[n]}:`, i[n].reason);
|
|
272
|
+
}
|
|
273
|
+
async loadPendingWrites(t, e, i) {
|
|
274
|
+
const n = `write_keys_zset:${t}:${e}:${i}`, s = await this.client.zRange(n, 0, -1);
|
|
275
|
+
if (s.length === 0) return;
|
|
276
|
+
const c = [];
|
|
277
|
+
for (const r of s) {
|
|
278
|
+
const a = await this.client.json.get(r);
|
|
279
|
+
if (a) {
|
|
280
|
+
const l = await this.serde.loadsTyped("json", JSON.stringify(a.value));
|
|
281
|
+
c.push([
|
|
282
|
+
a.task_id,
|
|
283
|
+
a.channel,
|
|
284
|
+
l
|
|
285
|
+
]);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return c;
|
|
289
|
+
}
|
|
290
|
+
checkMetadataFilterMatch(t, e) {
|
|
291
|
+
for (const [i, n] of Object.entries(e)) {
|
|
292
|
+
const s = t?.[i];
|
|
293
|
+
if (n === null) {
|
|
294
|
+
if (!(i in (t || {})) || s !== null) return !1;
|
|
295
|
+
} else if (typeof n == "object" && !Array.isArray(n)) {
|
|
296
|
+
if (typeof s != "object" || s === null || k(n) !== k(s)) return !1;
|
|
297
|
+
} else if (s !== n) return !1;
|
|
298
|
+
}
|
|
299
|
+
return !0;
|
|
300
|
+
}
|
|
301
|
+
async cleanupOldCheckpoint(t, e, i) {
|
|
302
|
+
const n = `checkpoint_write:${t}:${e}:${i}:*`, s = await this.client.keys(n);
|
|
303
|
+
s.length > 0 && await this.client.del(s);
|
|
304
|
+
const c = `write_keys_zset:${t}:${e}:${i}`;
|
|
305
|
+
await this.client.del(c);
|
|
306
|
+
const r = `checkpoint_blob:${t}:${e}:${i}:*`, a = await this.client.keys(r);
|
|
307
|
+
a.length > 0 && await this.client.del(a);
|
|
308
|
+
}
|
|
309
|
+
sanitizeMetadata(t) {
|
|
310
|
+
if (!t) return {};
|
|
311
|
+
const e = {};
|
|
312
|
+
for (const [i, n] of Object.entries(t)) {
|
|
313
|
+
const s = i.replace(/\x00/g, "");
|
|
314
|
+
e[s] = typeof n == "string" ? n.replace(/\x00/g, "") : n;
|
|
315
|
+
}
|
|
316
|
+
return e;
|
|
317
|
+
}
|
|
318
|
+
async ensureIndexes() {
|
|
319
|
+
for (const t of S) try {
|
|
320
|
+
await this.client.ft.create(t.index, t.schema, {
|
|
321
|
+
ON: "JSON",
|
|
322
|
+
PREFIX: t.prefix
|
|
323
|
+
});
|
|
324
|
+
} catch (e) {
|
|
325
|
+
e.message?.includes("Index already exists") || console.error(`Failed to create index ${t.index}:`, e.message);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
export {
|
|
330
|
+
C as ShallowRedisSaver
|
|
331
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { sql as e } from "kysely";
|
|
2
|
+
class L {
|
|
3
|
+
db;
|
|
4
|
+
constructor(t) {
|
|
5
|
+
this.db = t;
|
|
6
|
+
}
|
|
7
|
+
dateToDb(t) {
|
|
8
|
+
return t.toISOString();
|
|
9
|
+
}
|
|
10
|
+
dbToDate(t) {
|
|
11
|
+
return new Date(t);
|
|
12
|
+
}
|
|
13
|
+
jsonToDb(t) {
|
|
14
|
+
return JSON.stringify(t);
|
|
15
|
+
}
|
|
16
|
+
dbToJson(t) {
|
|
17
|
+
if (typeof t == "string")
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(t);
|
|
20
|
+
} catch {
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
}
|
|
25
|
+
buildJsonQuery(t, s, a, T) {
|
|
26
|
+
const E = `$.${a.includes("-") || a.includes(".") || a.includes(" ") ? `"${a}"` : a}`;
|
|
27
|
+
let r;
|
|
28
|
+
if (typeof T == "string" || typeof T == "number" ? r = T : typeof T == "boolean" ? r = T ? 1 : 0 : T === null ? r = null : r = JSON.stringify(T), T === null) {
|
|
29
|
+
const n = `"${a}":null`;
|
|
30
|
+
return e`
|
|
31
|
+
json_extract(${e.ref(s)}, ${e.lit(E)}) IS NULL
|
|
32
|
+
AND ${e.ref(s)} LIKE ${e.lit(`%${n}%`)}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
return e`json_extract(${e.ref(s)}, ${e.lit(E)}) = ${e.lit(r)}`;
|
|
36
|
+
}
|
|
37
|
+
now() {
|
|
38
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
39
|
+
}
|
|
40
|
+
async createTables(t) {
|
|
41
|
+
await e`
|
|
42
|
+
CREATE TABLE IF NOT EXISTS threads (
|
|
43
|
+
thread_id TEXT PRIMARY KEY,
|
|
44
|
+
created_at TEXT NOT NULL,
|
|
45
|
+
updated_at TEXT NOT NULL,
|
|
46
|
+
metadata TEXT NOT NULL DEFAULT '{}',
|
|
47
|
+
status TEXT NOT NULL DEFAULT 'idle',
|
|
48
|
+
"values" TEXT,
|
|
49
|
+
interrupts TEXT NOT NULL DEFAULT '{}'
|
|
50
|
+
)
|
|
51
|
+
`.execute(t), await e`
|
|
52
|
+
CREATE TABLE IF NOT EXISTS runs (
|
|
53
|
+
run_id TEXT PRIMARY KEY,
|
|
54
|
+
thread_id TEXT NOT NULL,
|
|
55
|
+
assistant_id TEXT NOT NULL,
|
|
56
|
+
created_at TEXT NOT NULL,
|
|
57
|
+
updated_at TEXT NOT NULL,
|
|
58
|
+
status TEXT NOT NULL DEFAULT 'pending',
|
|
59
|
+
metadata TEXT NOT NULL DEFAULT '{}',
|
|
60
|
+
multitask_strategy TEXT NOT NULL DEFAULT 'reject',
|
|
61
|
+
FOREIGN KEY (thread_id) REFERENCES threads(thread_id) ON DELETE CASCADE
|
|
62
|
+
)
|
|
63
|
+
`.execute(t);
|
|
64
|
+
}
|
|
65
|
+
async createIndexes(t) {
|
|
66
|
+
await e`CREATE INDEX IF NOT EXISTS idx_threads_status ON threads(status)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_threads_created_at ON threads(created_at)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_threads_updated_at ON threads(updated_at)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_runs_thread_id ON runs(thread_id)`.execute(t), await e`CREATE INDEX IF NOT EXISTS idx_runs_status ON runs(status)`.execute(t);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
L as SQLiteAdapter
|
|
71
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { tool as g, HumanMessage as h, SystemMessage as p } from "langchain";
|
|
2
2
|
import { Command as m, Annotation as f } from "@langchain/langgraph";
|
|
3
3
|
import { z as n } from "zod";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { m as b, n as y, o as w } from "./graphBuilder-mpLrx9tk.mjs";
|
|
5
|
+
import "@langchain/openai";
|
|
6
6
|
n.object({
|
|
7
7
|
task_store: n.record(n.string(), n.any()).default({})
|
|
8
8
|
});
|