@askexenow/exe-os 0.8.43 → 0.8.45
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/bin/exe-boot.js +63 -34
- package/dist/bin/exe-cloud.js +18 -3
- package/dist/bin/exe-link.js +956 -41
- package/dist/bin/exe-settings.js +23 -3
- package/dist/hooks/summary-worker.js +47 -34
- package/dist/lib/cloud-sync.js +986 -46
- package/package.json +1 -1
package/dist/bin/exe-boot.js
CHANGED
|
@@ -417,6 +417,17 @@ var init_db_retry = __esm({
|
|
|
417
417
|
});
|
|
418
418
|
|
|
419
419
|
// src/lib/database.ts
|
|
420
|
+
var database_exports = {};
|
|
421
|
+
__export(database_exports, {
|
|
422
|
+
disposeDatabase: () => disposeDatabase,
|
|
423
|
+
disposeTurso: () => disposeTurso,
|
|
424
|
+
ensureSchema: () => ensureSchema,
|
|
425
|
+
getClient: () => getClient,
|
|
426
|
+
getRawClient: () => getRawClient,
|
|
427
|
+
initDatabase: () => initDatabase,
|
|
428
|
+
initTurso: () => initTurso,
|
|
429
|
+
isInitialized: () => isInitialized
|
|
430
|
+
});
|
|
420
431
|
import { createClient } from "@libsql/client";
|
|
421
432
|
async function initDatabase(config) {
|
|
422
433
|
if (_client) {
|
|
@@ -1260,7 +1271,14 @@ async function ensureSchema() {
|
|
|
1260
1271
|
}
|
|
1261
1272
|
}
|
|
1262
1273
|
}
|
|
1263
|
-
|
|
1274
|
+
async function disposeDatabase() {
|
|
1275
|
+
if (_client) {
|
|
1276
|
+
_client.close();
|
|
1277
|
+
_client = null;
|
|
1278
|
+
_resilientClient = null;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
var _client, _resilientClient, initTurso, disposeTurso;
|
|
1264
1282
|
var init_database = __esm({
|
|
1265
1283
|
"src/lib/database.ts"() {
|
|
1266
1284
|
"use strict";
|
|
@@ -1268,6 +1286,7 @@ var init_database = __esm({
|
|
|
1268
1286
|
_client = null;
|
|
1269
1287
|
_resilientClient = null;
|
|
1270
1288
|
initTurso = initDatabase;
|
|
1289
|
+
disposeTurso = disposeDatabase;
|
|
1271
1290
|
}
|
|
1272
1291
|
});
|
|
1273
1292
|
|
|
@@ -5582,9 +5601,19 @@ async function cloudSync(config) {
|
|
|
5582
5601
|
} catch {
|
|
5583
5602
|
throw new Error("[cloud-sync] Database not initialized. Call initStore() before cloudSync().");
|
|
5584
5603
|
}
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5604
|
+
let pullMeta;
|
|
5605
|
+
try {
|
|
5606
|
+
pullMeta = await client.execute(
|
|
5607
|
+
"SELECT value FROM sync_meta WHERE key = 'last_cloud_pull_version'"
|
|
5608
|
+
);
|
|
5609
|
+
} catch (e) {
|
|
5610
|
+
logError(`[cloud-sync] sync_meta read failed (${e instanceof Error ? e.message : String(e)}), attempting ensureSchema`);
|
|
5611
|
+
const { ensureSchema: ensureSchema2 } = await Promise.resolve().then(() => (init_database(), database_exports));
|
|
5612
|
+
await ensureSchema2();
|
|
5613
|
+
pullMeta = await client.execute(
|
|
5614
|
+
"SELECT value FROM sync_meta WHERE key = 'last_cloud_pull_version'"
|
|
5615
|
+
);
|
|
5616
|
+
}
|
|
5588
5617
|
const lastPullVersion = pullMeta.rows.length > 0 ? Number(pullMeta.rows[0].value) : 0;
|
|
5589
5618
|
const pullResult = await cloudPull(lastPullVersion, config);
|
|
5590
5619
|
let pulled = 0;
|
|
@@ -5596,16 +5625,16 @@ async function cloudSync(config) {
|
|
|
5596
5625
|
author_device_id, scope)
|
|
5597
5626
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
5598
5627
|
args: [
|
|
5599
|
-
rec.id,
|
|
5600
|
-
rec.agent_id,
|
|
5601
|
-
rec.agent_role,
|
|
5602
|
-
rec.session_id,
|
|
5603
|
-
rec.timestamp,
|
|
5604
|
-
rec.tool_name,
|
|
5605
|
-
rec.project_name,
|
|
5606
|
-
rec.has_error,
|
|
5607
|
-
rec.raw_text,
|
|
5608
|
-
rec.version,
|
|
5628
|
+
rec.id ?? null,
|
|
5629
|
+
rec.agent_id ?? null,
|
|
5630
|
+
rec.agent_role ?? null,
|
|
5631
|
+
rec.session_id ?? null,
|
|
5632
|
+
rec.timestamp ?? null,
|
|
5633
|
+
rec.tool_name ?? null,
|
|
5634
|
+
rec.project_name ?? null,
|
|
5635
|
+
rec.has_error ?? 0,
|
|
5636
|
+
rec.raw_text ?? "",
|
|
5637
|
+
rec.version ?? 0,
|
|
5609
5638
|
rec.author_device_id ?? null,
|
|
5610
5639
|
rec.scope ?? "business"
|
|
5611
5640
|
]
|
|
@@ -6010,7 +6039,7 @@ async function cloudPullBehaviors(config) {
|
|
|
6010
6039
|
const existing = await client.execute({
|
|
6011
6040
|
sql: `SELECT COUNT(*) as cnt FROM behaviors
|
|
6012
6041
|
WHERE agent_id = ? AND content = ?`,
|
|
6013
|
-
args: [behavior.agent_id, behavior.content]
|
|
6042
|
+
args: [behavior.agent_id ?? null, behavior.content ?? null]
|
|
6014
6043
|
});
|
|
6015
6044
|
if (Number(existing.rows[0]?.cnt) > 0) continue;
|
|
6016
6045
|
await client.execute({
|
|
@@ -6018,15 +6047,15 @@ async function cloudPullBehaviors(config) {
|
|
|
6018
6047
|
(id, agent_id, project_name, domain, content, active, priority, created_at, updated_at)
|
|
6019
6048
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
6020
6049
|
args: [
|
|
6021
|
-
behavior.id,
|
|
6022
|
-
behavior.agent_id,
|
|
6050
|
+
behavior.id ?? null,
|
|
6051
|
+
behavior.agent_id ?? null,
|
|
6023
6052
|
behavior.project_name ?? null,
|
|
6024
6053
|
behavior.domain ?? null,
|
|
6025
|
-
behavior.content,
|
|
6026
|
-
behavior.active,
|
|
6054
|
+
behavior.content ?? null,
|
|
6055
|
+
behavior.active ?? 1,
|
|
6027
6056
|
behavior.priority ?? "p1",
|
|
6028
|
-
behavior.created_at,
|
|
6029
|
-
behavior.updated_at
|
|
6057
|
+
behavior.created_at ?? null,
|
|
6058
|
+
behavior.updated_at ?? null
|
|
6030
6059
|
]
|
|
6031
6060
|
});
|
|
6032
6061
|
pulled++;
|
|
@@ -6167,16 +6196,16 @@ async function cloudPullTasks(config) {
|
|
|
6167
6196
|
blocked_by, parent_task_id, budget_tokens, budget_fallback_model, tokens_used, tokens_warned_at)
|
|
6168
6197
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
6169
6198
|
args: [
|
|
6170
|
-
t.id,
|
|
6171
|
-
t.title,
|
|
6172
|
-
t.assigned_to,
|
|
6173
|
-
t.assigned_by,
|
|
6174
|
-
t.project_name,
|
|
6199
|
+
t.id ?? null,
|
|
6200
|
+
t.title ?? null,
|
|
6201
|
+
t.assigned_to ?? null,
|
|
6202
|
+
t.assigned_by ?? null,
|
|
6203
|
+
t.project_name ?? null,
|
|
6175
6204
|
t.priority ?? "p1",
|
|
6176
6205
|
t.status ?? "open",
|
|
6177
6206
|
t.task_file ?? null,
|
|
6178
|
-
t.created_at,
|
|
6179
|
-
t.updated_at,
|
|
6207
|
+
t.created_at ?? null,
|
|
6208
|
+
t.updated_at ?? null,
|
|
6180
6209
|
t.blocked_by ?? null,
|
|
6181
6210
|
t.parent_task_id ?? null,
|
|
6182
6211
|
t.budget_tokens ?? null,
|
|
@@ -6214,15 +6243,15 @@ async function cloudPullConversations(config) {
|
|
|
6214
6243
|
content_metadata, agent_response, agent_name, timestamp, ingested_at)
|
|
6215
6244
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
6216
6245
|
args: [
|
|
6217
|
-
c.id,
|
|
6218
|
-
c.platform,
|
|
6246
|
+
c.id ?? null,
|
|
6247
|
+
c.platform ?? null,
|
|
6219
6248
|
c.external_id ?? null,
|
|
6220
|
-
c.sender_id,
|
|
6249
|
+
c.sender_id ?? null,
|
|
6221
6250
|
c.sender_name ?? null,
|
|
6222
6251
|
c.sender_phone ?? null,
|
|
6223
6252
|
c.sender_email ?? null,
|
|
6224
6253
|
c.recipient_id ?? null,
|
|
6225
|
-
c.channel_id,
|
|
6254
|
+
c.channel_id ?? null,
|
|
6226
6255
|
c.thread_id ?? null,
|
|
6227
6256
|
c.reply_to_id ?? null,
|
|
6228
6257
|
c.content_text ?? null,
|
|
@@ -6230,8 +6259,8 @@ async function cloudPullConversations(config) {
|
|
|
6230
6259
|
c.content_metadata ?? null,
|
|
6231
6260
|
c.agent_response ?? null,
|
|
6232
6261
|
c.agent_name ?? null,
|
|
6233
|
-
c.timestamp,
|
|
6234
|
-
c.ingested_at
|
|
6262
|
+
c.timestamp ?? null,
|
|
6263
|
+
c.ingested_at ?? null
|
|
6235
6264
|
]
|
|
6236
6265
|
}));
|
|
6237
6266
|
await client.batch(stmts, "write");
|
package/dist/bin/exe-cloud.js
CHANGED
|
@@ -213,6 +213,22 @@ var init_config = __esm({
|
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
215
|
|
|
216
|
+
// src/lib/db-retry.ts
|
|
217
|
+
var init_db_retry = __esm({
|
|
218
|
+
"src/lib/db-retry.ts"() {
|
|
219
|
+
"use strict";
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
// src/lib/database.ts
|
|
224
|
+
import { createClient } from "@libsql/client";
|
|
225
|
+
var init_database = __esm({
|
|
226
|
+
"src/lib/database.ts"() {
|
|
227
|
+
"use strict";
|
|
228
|
+
init_db_retry();
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
|
|
216
232
|
// src/lib/license.ts
|
|
217
233
|
var license_exports = {};
|
|
218
234
|
__export(license_exports, {
|
|
@@ -724,14 +740,12 @@ function isMainModule(importMetaUrl) {
|
|
|
724
740
|
}
|
|
725
741
|
|
|
726
742
|
// src/lib/cloud-sync.ts
|
|
743
|
+
init_database();
|
|
727
744
|
import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync6, readdirSync, mkdirSync as mkdirSync2, appendFileSync, unlinkSync, openSync, closeSync } from "fs";
|
|
728
745
|
import crypto4 from "crypto";
|
|
729
746
|
import path6 from "path";
|
|
730
747
|
import { homedir } from "os";
|
|
731
748
|
|
|
732
|
-
// src/lib/database.ts
|
|
733
|
-
import { createClient } from "@libsql/client";
|
|
734
|
-
|
|
735
749
|
// src/lib/crypto.ts
|
|
736
750
|
import crypto3 from "crypto";
|
|
737
751
|
|
|
@@ -739,6 +753,7 @@ import crypto3 from "crypto";
|
|
|
739
753
|
import { brotliCompressSync, brotliDecompressSync, constants } from "zlib";
|
|
740
754
|
|
|
741
755
|
// src/lib/plan-limits.ts
|
|
756
|
+
init_database();
|
|
742
757
|
import { readFileSync as readFileSync4, existsSync as existsSync5 } from "fs";
|
|
743
758
|
import path5 from "path";
|
|
744
759
|
|