@inkeep/agents-run-api 0.39.2 → 0.39.3
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/SandboxExecutorFactory.cjs +895 -0
- package/dist/SandboxExecutorFactory.js +893 -0
- package/dist/SandboxExecutorFactory.js.map +1 -0
- package/dist/chunk-VBDAOXYI.cjs +927 -0
- package/dist/chunk-VBDAOXYI.js +832 -0
- package/dist/chunk-VBDAOXYI.js.map +1 -0
- package/dist/chunk.cjs +34 -0
- package/dist/conversations.cjs +7 -0
- package/dist/conversations.js +7 -0
- package/dist/conversations2.cjs +209 -0
- package/dist/conversations2.js +180 -0
- package/dist/conversations2.js.map +1 -0
- package/dist/dbClient.cjs +9676 -0
- package/dist/dbClient.js +9670 -0
- package/dist/dbClient.js.map +1 -0
- package/dist/dbClient2.cjs +5 -0
- package/dist/dbClient2.js +5 -0
- package/dist/env.cjs +59 -0
- package/dist/env.js +54 -0
- package/dist/env.js.map +1 -0
- package/dist/execution-limits.cjs +260 -0
- package/dist/execution-limits.js +63 -0
- package/dist/execution-limits.js.map +1 -0
- package/dist/index.cjs +10548 -20592
- package/dist/index.d.cts +26 -22
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +27 -22
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10548 -12917
- package/dist/index.js.map +1 -0
- package/dist/instrumentation.cjs +12 -121
- package/dist/instrumentation.d.cts +9 -7
- package/dist/instrumentation.d.cts.map +1 -0
- package/dist/instrumentation.d.ts +9 -7
- package/dist/instrumentation.d.ts.map +1 -0
- package/dist/instrumentation.js +5 -1
- package/dist/instrumentation2.cjs +116 -0
- package/dist/instrumentation2.js +69 -0
- package/dist/instrumentation2.js.map +1 -0
- package/dist/json-postprocessor.cjs +20 -0
- package/dist/json-postprocessor.js +20 -0
- package/dist/json-postprocessor.js.map +1 -0
- package/dist/logger.cjs +5 -0
- package/dist/logger.js +3 -0
- package/dist/logger2.cjs +1 -0
- package/dist/logger2.js +3 -0
- package/dist/nodefs.cjs +29 -0
- package/dist/nodefs.js +27 -0
- package/dist/nodefs.js.map +1 -0
- package/dist/opfs-ahp.cjs +367 -0
- package/dist/opfs-ahp.js +368 -0
- package/dist/opfs-ahp.js.map +1 -0
- package/package.json +3 -3
- package/dist/SandboxExecutorFactory-2N27SE3B.js +0 -943
- package/dist/chunk-A2S7GSHL.js +0 -1
- package/dist/chunk-EVOISBFH.js +0 -5070
- package/dist/chunk-JCVMVG3J.js +0 -592
- package/dist/chunk-KBZIYCPJ.js +0 -40
- package/dist/chunk-KCJWSIDZ.js +0 -246
- package/dist/chunk-THWNUGWP.js +0 -204
- package/dist/chunk-UC2EPLSW.js +0 -75
- package/dist/conversations-XPSTWUMK.js +0 -1
- package/dist/dbClient-MAHUR4TO.js +0 -1
- package/dist/json-postprocessor-IGYTSWFB.js +0 -12
- package/dist/logger-3EE6BUSU.js +0 -1
- package/dist/nodefs-RPE52Q4Z.js +0 -21
- package/dist/opfs-ahp-QL4REJJW.js +0 -318
package/dist/opfs-ahp.js
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { d as R, f as T, g as x, h as u, i as cr, m as h, o as pr, p as U } from "./chunk-VBDAOXYI.js";
|
|
2
|
+
|
|
3
|
+
//#region ../node_modules/.pnpm/@electric-sql+pglite@0.3.14/node_modules/@electric-sql/pglite/dist/fs/opfs-ahp.js
|
|
4
|
+
u();
|
|
5
|
+
var $ = "state.txt", G = "data", T$1 = {
|
|
6
|
+
DIR: 16384,
|
|
7
|
+
FILE: 32768
|
|
8
|
+
}, H, v, F, M, y, b, m, x$1, P, D, S, n, C, O, k, w, f, I, W, j, L = class extends cr {
|
|
9
|
+
constructor(e, { initialPoolSize: t = 1e3, maintainedPoolSize: o = 100, debug: i = !1 } = {}) {
|
|
10
|
+
super(e, { debug: i });
|
|
11
|
+
R(this, n);
|
|
12
|
+
R(this, H);
|
|
13
|
+
R(this, v);
|
|
14
|
+
R(this, F);
|
|
15
|
+
R(this, M);
|
|
16
|
+
R(this, y);
|
|
17
|
+
R(this, b, /* @__PURE__ */ new Map());
|
|
18
|
+
R(this, m, /* @__PURE__ */ new Map());
|
|
19
|
+
R(this, x$1, 0);
|
|
20
|
+
R(this, P, /* @__PURE__ */ new Map());
|
|
21
|
+
R(this, D, /* @__PURE__ */ new Map());
|
|
22
|
+
this.lastCheckpoint = 0;
|
|
23
|
+
this.checkpointInterval = 1e3 * 60;
|
|
24
|
+
this.poolCounter = 0;
|
|
25
|
+
R(this, S, /* @__PURE__ */ new Set());
|
|
26
|
+
this.initialPoolSize = t, this.maintainedPoolSize = o;
|
|
27
|
+
}
|
|
28
|
+
async init(e, t) {
|
|
29
|
+
return await T(this, n, C).call(this), super.init(e, t);
|
|
30
|
+
}
|
|
31
|
+
async syncToFs(e = !1) {
|
|
32
|
+
await this.maybeCheckpointState(), await this.maintainPool(), e || this.flush();
|
|
33
|
+
}
|
|
34
|
+
async closeFs() {
|
|
35
|
+
for (let e of h(this, m).values()) e.close();
|
|
36
|
+
h(this, y).flush(), h(this, y).close(), this.pg.Module.FS.quit();
|
|
37
|
+
}
|
|
38
|
+
async maintainPool(e) {
|
|
39
|
+
e = e || this.maintainedPoolSize;
|
|
40
|
+
let t = e - this.state.pool.length, o = [];
|
|
41
|
+
for (let i = 0; i < t; i++) o.push(new Promise(async (c) => {
|
|
42
|
+
++this.poolCounter;
|
|
43
|
+
let a = `${(Date.now() - 1704063600).toString(16).padStart(8, "0")}-${this.poolCounter.toString(16).padStart(8, "0")}`, h$1 = await h(this, F).getFileHandle(a, { create: !0 }), d = await h$1.createSyncAccessHandle();
|
|
44
|
+
h(this, b).set(a, h$1), h(this, m).set(a, d), T(this, n, k).call(this, {
|
|
45
|
+
opp: "createPoolFile",
|
|
46
|
+
args: [a]
|
|
47
|
+
}), this.state.pool.push(a), c();
|
|
48
|
+
}));
|
|
49
|
+
for (let i = 0; i > t; i--) o.push(new Promise(async (c) => {
|
|
50
|
+
let a = this.state.pool.pop();
|
|
51
|
+
T(this, n, k).call(this, {
|
|
52
|
+
opp: "deletePoolFile",
|
|
53
|
+
args: [a]
|
|
54
|
+
});
|
|
55
|
+
let h$1 = h(this, b).get(a);
|
|
56
|
+
h(this, m).get(a)?.close(), await h(this, F).removeEntry(h$1.name), h(this, b).delete(a), h(this, m).delete(a), c();
|
|
57
|
+
}));
|
|
58
|
+
await Promise.all(o);
|
|
59
|
+
}
|
|
60
|
+
_createPoolFileState(e) {
|
|
61
|
+
this.state.pool.push(e);
|
|
62
|
+
}
|
|
63
|
+
_deletePoolFileState(e) {
|
|
64
|
+
let t = this.state.pool.indexOf(e);
|
|
65
|
+
t > -1 && this.state.pool.splice(t, 1);
|
|
66
|
+
}
|
|
67
|
+
async maybeCheckpointState() {
|
|
68
|
+
Date.now() - this.lastCheckpoint > this.checkpointInterval && await this.checkpointState();
|
|
69
|
+
}
|
|
70
|
+
async checkpointState() {
|
|
71
|
+
let e = new TextEncoder().encode(JSON.stringify(this.state));
|
|
72
|
+
h(this, y).truncate(0), h(this, y).write(e, { at: 0 }), h(this, y).flush(), this.lastCheckpoint = Date.now();
|
|
73
|
+
}
|
|
74
|
+
flush() {
|
|
75
|
+
for (let e of h(this, S)) try {
|
|
76
|
+
e.flush();
|
|
77
|
+
} catch {}
|
|
78
|
+
h(this, S).clear();
|
|
79
|
+
}
|
|
80
|
+
chmod(e, t) {
|
|
81
|
+
T(this, n, O).call(this, {
|
|
82
|
+
opp: "chmod",
|
|
83
|
+
args: [e, t]
|
|
84
|
+
}, () => {
|
|
85
|
+
this._chmodState(e, t);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
_chmodState(e, t) {
|
|
89
|
+
let o = T(this, n, f).call(this, e);
|
|
90
|
+
o.mode = t;
|
|
91
|
+
}
|
|
92
|
+
close(e) {
|
|
93
|
+
let t = T(this, n, I).call(this, e);
|
|
94
|
+
h(this, P).delete(e), h(this, D).delete(t);
|
|
95
|
+
}
|
|
96
|
+
fstat(e) {
|
|
97
|
+
let t = T(this, n, I).call(this, e);
|
|
98
|
+
return this.lstat(t);
|
|
99
|
+
}
|
|
100
|
+
lstat(e) {
|
|
101
|
+
let t = T(this, n, f).call(this, e), o = t.type === "file" ? h(this, m).get(t.backingFilename).getSize() : 0, i = 4096;
|
|
102
|
+
return {
|
|
103
|
+
dev: 0,
|
|
104
|
+
ino: 0,
|
|
105
|
+
mode: t.mode,
|
|
106
|
+
nlink: 1,
|
|
107
|
+
uid: 0,
|
|
108
|
+
gid: 0,
|
|
109
|
+
rdev: 0,
|
|
110
|
+
size: o,
|
|
111
|
+
blksize: i,
|
|
112
|
+
blocks: Math.ceil(o / i),
|
|
113
|
+
atime: t.lastModified,
|
|
114
|
+
mtime: t.lastModified,
|
|
115
|
+
ctime: t.lastModified
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
mkdir(e, t) {
|
|
119
|
+
T(this, n, O).call(this, {
|
|
120
|
+
opp: "mkdir",
|
|
121
|
+
args: [e, t]
|
|
122
|
+
}, () => {
|
|
123
|
+
this._mkdirState(e, t);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
_mkdirState(e, t) {
|
|
127
|
+
let o = T(this, n, w).call(this, e), i = o.pop(), c = [], a = this.state.root;
|
|
128
|
+
for (let d of o) {
|
|
129
|
+
if (c.push(e), !Object.prototype.hasOwnProperty.call(a.children, d)) if (t?.recursive) this.mkdir(c.join("/"));
|
|
130
|
+
else throw new p("ENOENT", "No such file or directory");
|
|
131
|
+
if (a.children[d].type !== "directory") throw new p("ENOTDIR", "Not a directory");
|
|
132
|
+
a = a.children[d];
|
|
133
|
+
}
|
|
134
|
+
if (Object.prototype.hasOwnProperty.call(a.children, i)) throw new p("EEXIST", "File exists");
|
|
135
|
+
let h$1 = {
|
|
136
|
+
type: "directory",
|
|
137
|
+
lastModified: Date.now(),
|
|
138
|
+
mode: t?.mode || T$1.DIR,
|
|
139
|
+
children: {}
|
|
140
|
+
};
|
|
141
|
+
a.children[i] = h$1;
|
|
142
|
+
}
|
|
143
|
+
open(e, t, o) {
|
|
144
|
+
if (T(this, n, f).call(this, e).type !== "file") throw new p("EISDIR", "Is a directory");
|
|
145
|
+
let c = T(this, n, W).call(this);
|
|
146
|
+
return h(this, P).set(c, e), h(this, D).set(e, c), c;
|
|
147
|
+
}
|
|
148
|
+
readdir(e) {
|
|
149
|
+
let t = T(this, n, f).call(this, e);
|
|
150
|
+
if (t.type !== "directory") throw new p("ENOTDIR", "Not a directory");
|
|
151
|
+
return Object.keys(t.children);
|
|
152
|
+
}
|
|
153
|
+
read(e, t, o, i, c) {
|
|
154
|
+
let a = T(this, n, I).call(this, e), h$1 = T(this, n, f).call(this, a);
|
|
155
|
+
if (h$1.type !== "file") throw new p("EISDIR", "Is a directory");
|
|
156
|
+
return h(this, m).get(h$1.backingFilename).read(new Uint8Array(t.buffer, o, i), { at: c });
|
|
157
|
+
}
|
|
158
|
+
rename(e, t) {
|
|
159
|
+
T(this, n, O).call(this, {
|
|
160
|
+
opp: "rename",
|
|
161
|
+
args: [e, t]
|
|
162
|
+
}, () => {
|
|
163
|
+
this._renameState(e, t, !0);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
_renameState(e, t, o = !1) {
|
|
167
|
+
let i = T(this, n, w).call(this, e), c = i.pop(), a = T(this, n, f).call(this, i.join("/"));
|
|
168
|
+
if (!Object.prototype.hasOwnProperty.call(a.children, c)) throw new p("ENOENT", "No such file or directory");
|
|
169
|
+
let h$1 = T(this, n, w).call(this, t), d = h$1.pop(), l = T(this, n, f).call(this, h$1.join("/"));
|
|
170
|
+
if (o && Object.prototype.hasOwnProperty.call(l.children, d)) {
|
|
171
|
+
let u$1 = l.children[d];
|
|
172
|
+
h(this, m).get(u$1.backingFilename).truncate(0), this.state.pool.push(u$1.backingFilename);
|
|
173
|
+
}
|
|
174
|
+
l.children[d] = a.children[c], delete a.children[c];
|
|
175
|
+
}
|
|
176
|
+
rmdir(e) {
|
|
177
|
+
T(this, n, O).call(this, {
|
|
178
|
+
opp: "rmdir",
|
|
179
|
+
args: [e]
|
|
180
|
+
}, () => {
|
|
181
|
+
this._rmdirState(e);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
_rmdirState(e) {
|
|
185
|
+
let t = T(this, n, w).call(this, e), o = t.pop(), i = T(this, n, f).call(this, t.join("/"));
|
|
186
|
+
if (!Object.prototype.hasOwnProperty.call(i.children, o)) throw new p("ENOENT", "No such file or directory");
|
|
187
|
+
let c = i.children[o];
|
|
188
|
+
if (c.type !== "directory") throw new p("ENOTDIR", "Not a directory");
|
|
189
|
+
if (Object.keys(c.children).length > 0) throw new p("ENOTEMPTY", "Directory not empty");
|
|
190
|
+
delete i.children[o];
|
|
191
|
+
}
|
|
192
|
+
truncate(e, t = 0) {
|
|
193
|
+
let o = T(this, n, f).call(this, e);
|
|
194
|
+
if (o.type !== "file") throw new p("EISDIR", "Is a directory");
|
|
195
|
+
let i = h(this, m).get(o.backingFilename);
|
|
196
|
+
if (!i) throw new p("ENOENT", "No such file or directory");
|
|
197
|
+
i.truncate(t), h(this, S).add(i);
|
|
198
|
+
}
|
|
199
|
+
unlink(e) {
|
|
200
|
+
T(this, n, O).call(this, {
|
|
201
|
+
opp: "unlink",
|
|
202
|
+
args: [e]
|
|
203
|
+
}, () => {
|
|
204
|
+
this._unlinkState(e, !0);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
_unlinkState(e, t = !1) {
|
|
208
|
+
let o = T(this, n, w).call(this, e), i = o.pop(), c = T(this, n, f).call(this, o.join("/"));
|
|
209
|
+
if (!Object.prototype.hasOwnProperty.call(c.children, i)) throw new p("ENOENT", "No such file or directory");
|
|
210
|
+
let a = c.children[i];
|
|
211
|
+
if (a.type !== "file") throw new p("EISDIR", "Is a directory");
|
|
212
|
+
if (delete c.children[i], t) {
|
|
213
|
+
let h$1 = h(this, m).get(a.backingFilename);
|
|
214
|
+
h$1?.truncate(0), h(this, S).add(h$1), h(this, D).has(e) && (h(this, P).delete(h(this, D).get(e)), h(this, D).delete(e));
|
|
215
|
+
}
|
|
216
|
+
this.state.pool.push(a.backingFilename);
|
|
217
|
+
}
|
|
218
|
+
utimes(e, t, o) {
|
|
219
|
+
T(this, n, O).call(this, {
|
|
220
|
+
opp: "utimes",
|
|
221
|
+
args: [
|
|
222
|
+
e,
|
|
223
|
+
t,
|
|
224
|
+
o
|
|
225
|
+
]
|
|
226
|
+
}, () => {
|
|
227
|
+
this._utimesState(e, t, o);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
_utimesState(e, t, o) {
|
|
231
|
+
let i = T(this, n, f).call(this, e);
|
|
232
|
+
i.lastModified = o;
|
|
233
|
+
}
|
|
234
|
+
writeFile(e, t, o) {
|
|
235
|
+
let i = T(this, n, w).call(this, e), c = i.pop(), a = T(this, n, f).call(this, i.join("/"));
|
|
236
|
+
if (Object.prototype.hasOwnProperty.call(a.children, c)) {
|
|
237
|
+
let l = a.children[c];
|
|
238
|
+
l.lastModified = Date.now(), T(this, n, k).call(this, {
|
|
239
|
+
opp: "setLastModified",
|
|
240
|
+
args: [e, l.lastModified]
|
|
241
|
+
});
|
|
242
|
+
} else {
|
|
243
|
+
if (this.state.pool.length === 0) throw new Error("No more file handles available in the pool");
|
|
244
|
+
let l = {
|
|
245
|
+
type: "file",
|
|
246
|
+
lastModified: Date.now(),
|
|
247
|
+
mode: o?.mode || T$1.FILE,
|
|
248
|
+
backingFilename: this.state.pool.pop()
|
|
249
|
+
};
|
|
250
|
+
a.children[c] = l, T(this, n, k).call(this, {
|
|
251
|
+
opp: "createFileNode",
|
|
252
|
+
args: [e, l]
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
let h$1 = a.children[c], d = h(this, m).get(h$1.backingFilename);
|
|
256
|
+
t.length > 0 && (d.write(typeof t == "string" ? new TextEncoder().encode(t) : new Uint8Array(t), { at: 0 }), e.startsWith("/pg_wal") && h(this, S).add(d));
|
|
257
|
+
}
|
|
258
|
+
_createFileNodeState(e, t) {
|
|
259
|
+
let o = T(this, n, w).call(this, e), i = o.pop(), c = T(this, n, f).call(this, o.join("/"));
|
|
260
|
+
c.children[i] = t;
|
|
261
|
+
let a = this.state.pool.indexOf(t.backingFilename);
|
|
262
|
+
return a > -1 && this.state.pool.splice(a, 1), t;
|
|
263
|
+
}
|
|
264
|
+
_setLastModifiedState(e, t) {
|
|
265
|
+
let o = T(this, n, f).call(this, e);
|
|
266
|
+
o.lastModified = t;
|
|
267
|
+
}
|
|
268
|
+
write(e, t, o, i, c) {
|
|
269
|
+
let a = T(this, n, I).call(this, e), h$1 = T(this, n, f).call(this, a);
|
|
270
|
+
if (h$1.type !== "file") throw new p("EISDIR", "Is a directory");
|
|
271
|
+
let d = h(this, m).get(h$1.backingFilename);
|
|
272
|
+
if (!d) throw new p("EBADF", "Bad file descriptor");
|
|
273
|
+
let l = d.write(new Uint8Array(t, o, i), { at: c });
|
|
274
|
+
return a.startsWith("/pg_wal") && h(this, S).add(d), l;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
H = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), x$1 = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakSet(), C = async function() {
|
|
278
|
+
x(this, H, await navigator.storage.getDirectory()), x(this, v, await T(this, n, j).call(this, this.dataDir, { create: !0 })), x(this, F, await T(this, n, j).call(this, G, {
|
|
279
|
+
from: h(this, v),
|
|
280
|
+
create: !0
|
|
281
|
+
})), x(this, M, await h(this, v).getFileHandle($, { create: !0 })), x(this, y, await h(this, M).createSyncAccessHandle());
|
|
282
|
+
let e = new ArrayBuffer(h(this, y).getSize());
|
|
283
|
+
h(this, y).read(e, { at: 0 });
|
|
284
|
+
let t, o = new TextDecoder().decode(e).split(`
|
|
285
|
+
`), i = !1;
|
|
286
|
+
try {
|
|
287
|
+
t = JSON.parse(o[0]);
|
|
288
|
+
} catch {
|
|
289
|
+
t = {
|
|
290
|
+
root: {
|
|
291
|
+
type: "directory",
|
|
292
|
+
lastModified: Date.now(),
|
|
293
|
+
mode: T$1.DIR,
|
|
294
|
+
children: {}
|
|
295
|
+
},
|
|
296
|
+
pool: []
|
|
297
|
+
}, h(this, y).truncate(0), h(this, y).write(new TextEncoder().encode(JSON.stringify(t)), { at: 0 }), i = !0;
|
|
298
|
+
}
|
|
299
|
+
this.state = t;
|
|
300
|
+
let c = o.slice(1).filter(Boolean).map((l) => JSON.parse(l));
|
|
301
|
+
for (let l of c) {
|
|
302
|
+
let u$1 = `_${l.opp}State`;
|
|
303
|
+
if (typeof this[u$1] == "function") try {
|
|
304
|
+
this[u$1].bind(this)(...l.args);
|
|
305
|
+
} catch (N) {
|
|
306
|
+
console.warn("Error applying OPFS AHP WAL entry", l, N);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
let a = [], h$1 = async (l) => {
|
|
310
|
+
if (l.type === "file") try {
|
|
311
|
+
let u$1 = await h(this, F).getFileHandle(l.backingFilename), N = await u$1.createSyncAccessHandle();
|
|
312
|
+
h(this, b).set(l.backingFilename, u$1), h(this, m).set(l.backingFilename, N);
|
|
313
|
+
} catch (u$1) {
|
|
314
|
+
console.error("Error opening file handle for node", l, u$1);
|
|
315
|
+
}
|
|
316
|
+
else for (let u$1 of Object.values(l.children)) a.push(h$1(u$1));
|
|
317
|
+
};
|
|
318
|
+
await h$1(this.state.root);
|
|
319
|
+
let d = [];
|
|
320
|
+
for (let l of this.state.pool) d.push(new Promise(async (u$1) => {
|
|
321
|
+
h(this, b).has(l) && console.warn("File handle already exists for pool file", l);
|
|
322
|
+
let N = await h(this, F).getFileHandle(l), U$1 = await N.createSyncAccessHandle();
|
|
323
|
+
h(this, b).set(l, N), h(this, m).set(l, U$1), u$1();
|
|
324
|
+
}));
|
|
325
|
+
await Promise.all([...a, ...d]), await this.maintainPool(i ? this.initialPoolSize : this.maintainedPoolSize);
|
|
326
|
+
}, O = function(e, t) {
|
|
327
|
+
let o = T(this, n, k).call(this, e);
|
|
328
|
+
try {
|
|
329
|
+
t();
|
|
330
|
+
} catch (i) {
|
|
331
|
+
throw h(this, y).truncate(o), i;
|
|
332
|
+
}
|
|
333
|
+
}, k = function(e) {
|
|
334
|
+
let t = JSON.stringify(e), o = new TextEncoder().encode(`
|
|
335
|
+
${t}`), i = h(this, y).getSize();
|
|
336
|
+
return h(this, y).write(o, { at: i }), h(this, S).add(h(this, y)), i;
|
|
337
|
+
}, w = function(e) {
|
|
338
|
+
return e.split("/").filter(Boolean);
|
|
339
|
+
}, f = function(e, t) {
|
|
340
|
+
let o = T(this, n, w).call(this, e), i = t || this.state.root;
|
|
341
|
+
for (let c of o) {
|
|
342
|
+
if (i.type !== "directory") throw new p("ENOTDIR", "Not a directory");
|
|
343
|
+
if (!Object.prototype.hasOwnProperty.call(i.children, c)) throw new p("ENOENT", "No such file or directory");
|
|
344
|
+
i = i.children[c];
|
|
345
|
+
}
|
|
346
|
+
return i;
|
|
347
|
+
}, I = function(e) {
|
|
348
|
+
let t = h(this, P).get(e);
|
|
349
|
+
if (!t) throw new p("EBADF", "Bad file descriptor");
|
|
350
|
+
return t;
|
|
351
|
+
}, W = function() {
|
|
352
|
+
let e = ++U(this, x$1)._;
|
|
353
|
+
for (; h(this, P).has(e);) U(this, x$1)._++;
|
|
354
|
+
return e;
|
|
355
|
+
}, j = async function(e, t) {
|
|
356
|
+
let o = T(this, n, w).call(this, e), i = t?.from || h(this, H);
|
|
357
|
+
for (let c of o) i = await i.getDirectoryHandle(c, { create: t?.create });
|
|
358
|
+
return i;
|
|
359
|
+
};
|
|
360
|
+
var p = class extends Error {
|
|
361
|
+
constructor(A, e) {
|
|
362
|
+
super(e), typeof A == "number" ? this.code = A : typeof A == "string" && (this.code = pr[A]);
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
//#endregion
|
|
367
|
+
export { L as OpfsAhpFS };
|
|
368
|
+
//# sourceMappingURL=opfs-ahp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opfs-ahp.js","names":["R","T","x","B","r","s","h","u","E","U","_","z"],"sources":["../../node_modules/.pnpm/@electric-sql+pglite@0.3.14/node_modules/@electric-sql/pglite/dist/fs/opfs-ahp.js"],"sourcesContent":["import{f as B,g as z}from\"../chunk-VBDAOXYI.js\";import{e as s,f as g,g as E,h as r,i as _,j as R}from\"../chunk-QY3QWFKW.js\";R();var $=\"state.txt\",G=\"data\",T={DIR:16384,FILE:32768},H,v,F,M,y,b,m,x,P,D,S,n,C,O,k,w,f,I,W,j,L=class extends B{constructor(e,{initialPoolSize:t=1e3,maintainedPoolSize:o=100,debug:i=!1}={}){super(e,{debug:i});g(this,n);g(this,H);g(this,v);g(this,F);g(this,M);g(this,y);g(this,b,new Map);g(this,m,new Map);g(this,x,0);g(this,P,new Map);g(this,D,new Map);this.lastCheckpoint=0;this.checkpointInterval=1e3*60;this.poolCounter=0;g(this,S,new Set);this.initialPoolSize=t,this.maintainedPoolSize=o}async init(e,t){return await r(this,n,C).call(this),super.init(e,t)}async syncToFs(e=!1){await this.maybeCheckpointState(),await this.maintainPool(),e||this.flush()}async closeFs(){for(let e of s(this,m).values())e.close();s(this,y).flush(),s(this,y).close(),this.pg.Module.FS.quit()}async maintainPool(e){e=e||this.maintainedPoolSize;let t=e-this.state.pool.length,o=[];for(let i=0;i<t;i++)o.push(new Promise(async c=>{++this.poolCounter;let a=`${(Date.now()-1704063600).toString(16).padStart(8,\"0\")}-${this.poolCounter.toString(16).padStart(8,\"0\")}`,h=await s(this,F).getFileHandle(a,{create:!0}),d=await h.createSyncAccessHandle();s(this,b).set(a,h),s(this,m).set(a,d),r(this,n,k).call(this,{opp:\"createPoolFile\",args:[a]}),this.state.pool.push(a),c()}));for(let i=0;i>t;i--)o.push(new Promise(async c=>{let a=this.state.pool.pop();r(this,n,k).call(this,{opp:\"deletePoolFile\",args:[a]});let h=s(this,b).get(a);s(this,m).get(a)?.close(),await s(this,F).removeEntry(h.name),s(this,b).delete(a),s(this,m).delete(a),c()}));await Promise.all(o)}_createPoolFileState(e){this.state.pool.push(e)}_deletePoolFileState(e){let t=this.state.pool.indexOf(e);t>-1&&this.state.pool.splice(t,1)}async maybeCheckpointState(){Date.now()-this.lastCheckpoint>this.checkpointInterval&&await this.checkpointState()}async checkpointState(){let e=new TextEncoder().encode(JSON.stringify(this.state));s(this,y).truncate(0),s(this,y).write(e,{at:0}),s(this,y).flush(),this.lastCheckpoint=Date.now()}flush(){for(let e of s(this,S))try{e.flush()}catch{}s(this,S).clear()}chmod(e,t){r(this,n,O).call(this,{opp:\"chmod\",args:[e,t]},()=>{this._chmodState(e,t)})}_chmodState(e,t){let o=r(this,n,f).call(this,e);o.mode=t}close(e){let t=r(this,n,I).call(this,e);s(this,P).delete(e),s(this,D).delete(t)}fstat(e){let t=r(this,n,I).call(this,e);return this.lstat(t)}lstat(e){let t=r(this,n,f).call(this,e),o=t.type===\"file\"?s(this,m).get(t.backingFilename).getSize():0,i=4096;return{dev:0,ino:0,mode:t.mode,nlink:1,uid:0,gid:0,rdev:0,size:o,blksize:i,blocks:Math.ceil(o/i),atime:t.lastModified,mtime:t.lastModified,ctime:t.lastModified}}mkdir(e,t){r(this,n,O).call(this,{opp:\"mkdir\",args:[e,t]},()=>{this._mkdirState(e,t)})}_mkdirState(e,t){let o=r(this,n,w).call(this,e),i=o.pop(),c=[],a=this.state.root;for(let d of o){if(c.push(e),!Object.prototype.hasOwnProperty.call(a.children,d))if(t?.recursive)this.mkdir(c.join(\"/\"));else throw new p(\"ENOENT\",\"No such file or directory\");if(a.children[d].type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");a=a.children[d]}if(Object.prototype.hasOwnProperty.call(a.children,i))throw new p(\"EEXIST\",\"File exists\");let h={type:\"directory\",lastModified:Date.now(),mode:t?.mode||T.DIR,children:{}};a.children[i]=h}open(e,t,o){if(r(this,n,f).call(this,e).type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let c=r(this,n,W).call(this);return s(this,P).set(c,e),s(this,D).set(e,c),c}readdir(e){let t=r(this,n,f).call(this,e);if(t.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");return Object.keys(t.children)}read(e,t,o,i,c){let a=r(this,n,I).call(this,e),h=r(this,n,f).call(this,a);if(h.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");return s(this,m).get(h.backingFilename).read(new Uint8Array(t.buffer,o,i),{at:c})}rename(e,t){r(this,n,O).call(this,{opp:\"rename\",args:[e,t]},()=>{this._renameState(e,t,!0)})}_renameState(e,t,o=!1){let i=r(this,n,w).call(this,e),c=i.pop(),a=r(this,n,f).call(this,i.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(a.children,c))throw new p(\"ENOENT\",\"No such file or directory\");let h=r(this,n,w).call(this,t),d=h.pop(),l=r(this,n,f).call(this,h.join(\"/\"));if(o&&Object.prototype.hasOwnProperty.call(l.children,d)){let u=l.children[d];s(this,m).get(u.backingFilename).truncate(0),this.state.pool.push(u.backingFilename)}l.children[d]=a.children[c],delete a.children[c]}rmdir(e){r(this,n,O).call(this,{opp:\"rmdir\",args:[e]},()=>{this._rmdirState(e)})}_rmdirState(e){let t=r(this,n,w).call(this,e),o=t.pop(),i=r(this,n,f).call(this,t.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(i.children,o))throw new p(\"ENOENT\",\"No such file or directory\");let c=i.children[o];if(c.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");if(Object.keys(c.children).length>0)throw new p(\"ENOTEMPTY\",\"Directory not empty\");delete i.children[o]}truncate(e,t=0){let o=r(this,n,f).call(this,e);if(o.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let i=s(this,m).get(o.backingFilename);if(!i)throw new p(\"ENOENT\",\"No such file or directory\");i.truncate(t),s(this,S).add(i)}unlink(e){r(this,n,O).call(this,{opp:\"unlink\",args:[e]},()=>{this._unlinkState(e,!0)})}_unlinkState(e,t=!1){let o=r(this,n,w).call(this,e),i=o.pop(),c=r(this,n,f).call(this,o.join(\"/\"));if(!Object.prototype.hasOwnProperty.call(c.children,i))throw new p(\"ENOENT\",\"No such file or directory\");let a=c.children[i];if(a.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");if(delete c.children[i],t){let h=s(this,m).get(a.backingFilename);h?.truncate(0),s(this,S).add(h),s(this,D).has(e)&&(s(this,P).delete(s(this,D).get(e)),s(this,D).delete(e))}this.state.pool.push(a.backingFilename)}utimes(e,t,o){r(this,n,O).call(this,{opp:\"utimes\",args:[e,t,o]},()=>{this._utimesState(e,t,o)})}_utimesState(e,t,o){let i=r(this,n,f).call(this,e);i.lastModified=o}writeFile(e,t,o){let i=r(this,n,w).call(this,e),c=i.pop(),a=r(this,n,f).call(this,i.join(\"/\"));if(Object.prototype.hasOwnProperty.call(a.children,c)){let l=a.children[c];l.lastModified=Date.now(),r(this,n,k).call(this,{opp:\"setLastModified\",args:[e,l.lastModified]})}else{if(this.state.pool.length===0)throw new Error(\"No more file handles available in the pool\");let l={type:\"file\",lastModified:Date.now(),mode:o?.mode||T.FILE,backingFilename:this.state.pool.pop()};a.children[c]=l,r(this,n,k).call(this,{opp:\"createFileNode\",args:[e,l]})}let h=a.children[c],d=s(this,m).get(h.backingFilename);t.length>0&&(d.write(typeof t==\"string\"?new TextEncoder().encode(t):new Uint8Array(t),{at:0}),e.startsWith(\"/pg_wal\")&&s(this,S).add(d))}_createFileNodeState(e,t){let o=r(this,n,w).call(this,e),i=o.pop(),c=r(this,n,f).call(this,o.join(\"/\"));c.children[i]=t;let a=this.state.pool.indexOf(t.backingFilename);return a>-1&&this.state.pool.splice(a,1),t}_setLastModifiedState(e,t){let o=r(this,n,f).call(this,e);o.lastModified=t}write(e,t,o,i,c){let a=r(this,n,I).call(this,e),h=r(this,n,f).call(this,a);if(h.type!==\"file\")throw new p(\"EISDIR\",\"Is a directory\");let d=s(this,m).get(h.backingFilename);if(!d)throw new p(\"EBADF\",\"Bad file descriptor\");let l=d.write(new Uint8Array(t,o,i),{at:c});return a.startsWith(\"/pg_wal\")&&s(this,S).add(d),l}};H=new WeakMap,v=new WeakMap,F=new WeakMap,M=new WeakMap,y=new WeakMap,b=new WeakMap,m=new WeakMap,x=new WeakMap,P=new WeakMap,D=new WeakMap,S=new WeakMap,n=new WeakSet,C=async function(){E(this,H,await navigator.storage.getDirectory()),E(this,v,await r(this,n,j).call(this,this.dataDir,{create:!0})),E(this,F,await r(this,n,j).call(this,G,{from:s(this,v),create:!0})),E(this,M,await s(this,v).getFileHandle($,{create:!0})),E(this,y,await s(this,M).createSyncAccessHandle());let e=new ArrayBuffer(s(this,y).getSize());s(this,y).read(e,{at:0});let t,o=new TextDecoder().decode(e).split(`\n`),i=!1;try{t=JSON.parse(o[0])}catch{t={root:{type:\"directory\",lastModified:Date.now(),mode:T.DIR,children:{}},pool:[]},s(this,y).truncate(0),s(this,y).write(new TextEncoder().encode(JSON.stringify(t)),{at:0}),i=!0}this.state=t;let c=o.slice(1).filter(Boolean).map(l=>JSON.parse(l));for(let l of c){let u=`_${l.opp}State`;if(typeof this[u]==\"function\")try{this[u].bind(this)(...l.args)}catch(N){console.warn(\"Error applying OPFS AHP WAL entry\",l,N)}}let a=[],h=async l=>{if(l.type===\"file\")try{let u=await s(this,F).getFileHandle(l.backingFilename),N=await u.createSyncAccessHandle();s(this,b).set(l.backingFilename,u),s(this,m).set(l.backingFilename,N)}catch(u){console.error(\"Error opening file handle for node\",l,u)}else for(let u of Object.values(l.children))a.push(h(u))};await h(this.state.root);let d=[];for(let l of this.state.pool)d.push(new Promise(async u=>{s(this,b).has(l)&&console.warn(\"File handle already exists for pool file\",l);let N=await s(this,F).getFileHandle(l),U=await N.createSyncAccessHandle();s(this,b).set(l,N),s(this,m).set(l,U),u()}));await Promise.all([...a,...d]),await this.maintainPool(i?this.initialPoolSize:this.maintainedPoolSize)},O=function(e,t){let o=r(this,n,k).call(this,e);try{t()}catch(i){throw s(this,y).truncate(o),i}},k=function(e){let t=JSON.stringify(e),o=new TextEncoder().encode(`\n${t}`),i=s(this,y).getSize();return s(this,y).write(o,{at:i}),s(this,S).add(s(this,y)),i},w=function(e){return e.split(\"/\").filter(Boolean)},f=function(e,t){let o=r(this,n,w).call(this,e),i=t||this.state.root;for(let c of o){if(i.type!==\"directory\")throw new p(\"ENOTDIR\",\"Not a directory\");if(!Object.prototype.hasOwnProperty.call(i.children,c))throw new p(\"ENOENT\",\"No such file or directory\");i=i.children[c]}return i},I=function(e){let t=s(this,P).get(e);if(!t)throw new p(\"EBADF\",\"Bad file descriptor\");return t},W=function(){let e=++_(this,x)._;for(;s(this,P).has(e);)_(this,x)._++;return e},j=async function(e,t){let o=r(this,n,w).call(this,e),i=t?.from||s(this,H);for(let c of o)i=await i.getDirectoryHandle(c,{create:t?.create});return i};var p=class extends Error{constructor(A,e){super(e),typeof A==\"number\"?this.code=A:typeof A==\"string\"&&(this.code=z[A])}};export{L as OpfsAhpFS};\n//# sourceMappingURL=opfs-ahp.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAA4HA,GAAG;AAAC,IAAI,IAAE,aAAY,IAAE,QAAOC,MAAE;CAAC,KAAI;CAAM,MAAK;CAAM,EAAC,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAEC,KAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,GAAE,IAAE,cAAcC,GAAC;CAAC,YAAY,GAAE,EAAC,iBAAgB,IAAE,KAAI,oBAAmB,IAAE,KAAI,OAAM,IAAE,CAAC,MAAG,EAAE,EAAC;AAAC,QAAM,GAAE,EAAC,OAAM,GAAE,CAAC;AAAC,IAAE,MAAK,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E,EAAE,MAAK,GAAE,EAAE,CAAC,KAAK,MAAK,EAAE,EAAC,IAAE,GAAG,QAAMC,EAAE,MAAK,EAAE;AAAC,MAAI,IAAI,KAAK,EAAE,KAAE,MAAM,EAAE,mBAAmB,GAAE,EAAC,QAAO,GAAG,QAAO,CAAC;AAAC,QAAO;;AAAG,IAAI,IAAE,cAAc,MAAK;CAAC,YAAY,GAAE,GAAE;AAAC,QAAM,EAAE,EAAC,OAAO,KAAG,WAAS,KAAK,OAAK,IAAE,OAAO,KAAG,aAAW,KAAK,OAAKM,GAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-run-api",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.3",
|
|
4
4
|
"description": "Agents Run API for Inkeep Agent Framework - handles chat, agent execution, and streaming",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"pino": "^9.11.0",
|
|
54
54
|
"traverse": "^0.6.11",
|
|
55
55
|
"ts-pattern": "^5.7.1",
|
|
56
|
-
"@inkeep/agents-core": "^0.39.
|
|
56
|
+
"@inkeep/agents-core": "^0.39.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@hono/zod-openapi": "^1.1.5",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"dev": "vite",
|
|
100
100
|
"dev:with-bypass": "PORT=3003 vite",
|
|
101
101
|
"dev:without-bypass": "PORT=3004 INKEEP_AGENTS_RUN_API_BYPASS_SECRET= vite",
|
|
102
|
-
"build": "
|
|
102
|
+
"build": "tsdown",
|
|
103
103
|
"start": "node dist/index.js",
|
|
104
104
|
"test": "./run-tests.sh",
|
|
105
105
|
"test:ci": "vitest --run --config vitest.config.ci.ts",
|