@askexenow/exe-os 0.8.46 → 0.8.47
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 +7 -29
- package/dist/bin/exe-cloud.js +3 -17
- package/dist/bin/exe-link.js +14 -922
- package/dist/bin/exe-settings.js +3 -22
- package/dist/hooks/summary-worker.js +6 -9
- package/dist/lib/cloud-sync.js +19 -952
- package/package.json +1 -1
package/dist/bin/exe-settings.js
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __esm = (fn, res) => function __init() {
|
|
3
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
// src/lib/db-retry.ts
|
|
7
|
-
var init_db_retry = __esm({
|
|
8
|
-
"src/lib/db-retry.ts"() {
|
|
9
|
-
"use strict";
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// src/lib/database.ts
|
|
14
|
-
import { createClient } from "@libsql/client";
|
|
15
|
-
var init_database = __esm({
|
|
16
|
-
"src/lib/database.ts"() {
|
|
17
|
-
"use strict";
|
|
18
|
-
init_db_retry();
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
1
|
// src/bin/exe-settings.ts
|
|
23
2
|
import { createInterface } from "readline";
|
|
24
3
|
|
|
@@ -229,12 +208,14 @@ function isMainModule(importMetaUrl) {
|
|
|
229
208
|
}
|
|
230
209
|
|
|
231
210
|
// src/lib/cloud-sync.ts
|
|
232
|
-
init_database();
|
|
233
211
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync2, existsSync as existsSync4, readdirSync, mkdirSync as mkdirSync2, appendFileSync, unlinkSync, openSync, closeSync } from "fs";
|
|
234
212
|
import crypto2 from "crypto";
|
|
235
213
|
import path4 from "path";
|
|
236
214
|
import { homedir } from "os";
|
|
237
215
|
|
|
216
|
+
// src/lib/database.ts
|
|
217
|
+
import { createClient } from "@libsql/client";
|
|
218
|
+
|
|
238
219
|
// src/lib/crypto.ts
|
|
239
220
|
import crypto from "crypto";
|
|
240
221
|
|
|
@@ -2715,19 +2715,16 @@ async function cloudSync(config) {
|
|
|
2715
2715
|
} catch {
|
|
2716
2716
|
throw new Error("[cloud-sync] Database not initialized. Call initStore() before cloudSync().");
|
|
2717
2717
|
}
|
|
2718
|
-
let pullMeta;
|
|
2719
2718
|
try {
|
|
2720
|
-
|
|
2721
|
-
"
|
|
2719
|
+
await client.execute(
|
|
2720
|
+
"CREATE TABLE IF NOT EXISTS sync_meta (key TEXT PRIMARY KEY, value TEXT NOT NULL)"
|
|
2722
2721
|
);
|
|
2723
2722
|
} catch (e) {
|
|
2724
|
-
logError(`[cloud-sync] sync_meta
|
|
2725
|
-
const { ensureSchema: ensureSchema2 } = await Promise.resolve().then(() => (init_database(), database_exports));
|
|
2726
|
-
await ensureSchema2();
|
|
2727
|
-
pullMeta = await client.execute(
|
|
2728
|
-
"SELECT value FROM sync_meta WHERE key = 'last_cloud_pull_version'"
|
|
2729
|
-
);
|
|
2723
|
+
logError(`[cloud-sync] sync_meta CREATE failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
2730
2724
|
}
|
|
2725
|
+
const pullMeta = await client.execute(
|
|
2726
|
+
"SELECT value FROM sync_meta WHERE key = 'last_cloud_pull_version'"
|
|
2727
|
+
);
|
|
2731
2728
|
const lastPullVersion = pullMeta.rows.length > 0 ? Number(pullMeta.rows[0].value) : 0;
|
|
2732
2729
|
const pullResult = await cloudPull(lastPullVersion, config);
|
|
2733
2730
|
let pulled = 0;
|