@askexenow/exe-os 0.8.45 → 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 -39
- package/dist/bin/exe-cloud.js +32 -54
- package/dist/bin/exe-link.js +87 -1190
- package/dist/bin/exe-settings.js +17 -44
- package/dist/hooks/summary-worker.js +6 -11
- package/dist/lib/cloud-sync.js +85 -1211
- 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,45 +208,39 @@ function isMainModule(importMetaUrl) {
|
|
|
229
208
|
}
|
|
230
209
|
|
|
231
210
|
// src/lib/cloud-sync.ts
|
|
232
|
-
|
|
233
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync5, readdirSync, mkdirSync as mkdirSync2, appendFileSync, unlinkSync, openSync, closeSync } from "fs";
|
|
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
|
-
import
|
|
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
|
|
|
241
222
|
// src/lib/compress.ts
|
|
242
223
|
import { brotliCompressSync, brotliDecompressSync, constants } from "zlib";
|
|
243
224
|
|
|
244
|
-
// src/lib/
|
|
245
|
-
|
|
246
|
-
import {
|
|
247
|
-
import
|
|
225
|
+
// src/lib/license.ts
|
|
226
|
+
import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync2, mkdirSync } from "fs";
|
|
227
|
+
import { randomUUID } from "crypto";
|
|
228
|
+
import path2 from "path";
|
|
229
|
+
import { jwtVerify, importSPKI } from "jose";
|
|
230
|
+
var LICENSE_PATH = path2.join(EXE_AI_DIR, "license.key");
|
|
231
|
+
var CACHE_PATH = path2.join(EXE_AI_DIR, "license-cache.json");
|
|
232
|
+
var DEVICE_ID_PATH = path2.join(EXE_AI_DIR, "device-id");
|
|
248
233
|
|
|
249
234
|
// src/lib/employees.ts
|
|
250
235
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
251
|
-
import { existsSync as
|
|
236
|
+
import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync3 } from "fs";
|
|
252
237
|
import { execSync } from "child_process";
|
|
253
|
-
import path2 from "path";
|
|
254
|
-
var EMPLOYEES_PATH = path2.join(EXE_AI_DIR, "exe-employees.json");
|
|
255
|
-
|
|
256
|
-
// src/lib/license.ts
|
|
257
|
-
import { readFileSync as readFileSync3, writeFileSync, existsSync as existsSync3, mkdirSync } from "fs";
|
|
258
|
-
import { randomUUID } from "crypto";
|
|
259
238
|
import path3 from "path";
|
|
260
|
-
|
|
261
|
-
var LICENSE_PATH = path3.join(EXE_AI_DIR, "license.key");
|
|
262
|
-
var CACHE_PATH = path3.join(EXE_AI_DIR, "license-cache.json");
|
|
263
|
-
var DEVICE_ID_PATH = path3.join(EXE_AI_DIR, "device-id");
|
|
264
|
-
|
|
265
|
-
// src/lib/plan-limits.ts
|
|
266
|
-
var CACHE_PATH2 = path4.join(EXE_AI_DIR, "license-cache.json");
|
|
239
|
+
var EMPLOYEES_PATH = path3.join(EXE_AI_DIR, "exe-employees.json");
|
|
267
240
|
|
|
268
241
|
// src/lib/cloud-sync.ts
|
|
269
242
|
var LOCALHOST_PATTERNS = /^(localhost|127\.0\.0\.1|\[::1\])$/i;
|
|
270
|
-
var ROSTER_LOCK_PATH =
|
|
243
|
+
var ROSTER_LOCK_PATH = path4.join(EXE_AI_DIR, "roster-merge.lock");
|
|
271
244
|
function assertSecureEndpoint(endpoint) {
|
|
272
245
|
if (endpoint.startsWith("https://")) return;
|
|
273
246
|
if (endpoint.startsWith("http://")) {
|
|
@@ -282,7 +255,7 @@ function assertSecureEndpoint(endpoint) {
|
|
|
282
255
|
);
|
|
283
256
|
}
|
|
284
257
|
}
|
|
285
|
-
var ROSTER_DELETIONS_PATH =
|
|
258
|
+
var ROSTER_DELETIONS_PATH = path4.join(EXE_AI_DIR, "roster-deletions.json");
|
|
286
259
|
|
|
287
260
|
// src/bin/exe-settings.ts
|
|
288
261
|
function label(value) {
|
|
@@ -2709,26 +2709,22 @@ async function cloudPull(sinceVersion, config) {
|
|
|
2709
2709
|
}
|
|
2710
2710
|
}
|
|
2711
2711
|
async function cloudSync(config) {
|
|
2712
|
-
await assertFeature("cloud_sync");
|
|
2713
2712
|
let client;
|
|
2714
2713
|
try {
|
|
2715
2714
|
client = getClient();
|
|
2716
2715
|
} catch {
|
|
2717
2716
|
throw new Error("[cloud-sync] Database not initialized. Call initStore() before cloudSync().");
|
|
2718
2717
|
}
|
|
2719
|
-
let pullMeta;
|
|
2720
2718
|
try {
|
|
2721
|
-
|
|
2722
|
-
"
|
|
2719
|
+
await client.execute(
|
|
2720
|
+
"CREATE TABLE IF NOT EXISTS sync_meta (key TEXT PRIMARY KEY, value TEXT NOT NULL)"
|
|
2723
2721
|
);
|
|
2724
2722
|
} catch (e) {
|
|
2725
|
-
logError(`[cloud-sync] sync_meta
|
|
2726
|
-
const { ensureSchema: ensureSchema2 } = await Promise.resolve().then(() => (init_database(), database_exports));
|
|
2727
|
-
await ensureSchema2();
|
|
2728
|
-
pullMeta = await client.execute(
|
|
2729
|
-
"SELECT value FROM sync_meta WHERE key = 'last_cloud_pull_version'"
|
|
2730
|
-
);
|
|
2723
|
+
logError(`[cloud-sync] sync_meta CREATE failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
2731
2724
|
}
|
|
2725
|
+
const pullMeta = await client.execute(
|
|
2726
|
+
"SELECT value FROM sync_meta WHERE key = 'last_cloud_pull_version'"
|
|
2727
|
+
);
|
|
2732
2728
|
const lastPullVersion = pullMeta.rows.length > 0 ? Number(pullMeta.rows[0].value) : 0;
|
|
2733
2729
|
const pullResult = await cloudPull(lastPullVersion, config);
|
|
2734
2730
|
let pulled = 0;
|
|
@@ -3445,7 +3441,6 @@ var init_cloud_sync = __esm({
|
|
|
3445
3441
|
init_database();
|
|
3446
3442
|
init_crypto();
|
|
3447
3443
|
init_compress();
|
|
3448
|
-
init_plan_limits();
|
|
3449
3444
|
init_license();
|
|
3450
3445
|
init_config();
|
|
3451
3446
|
init_employees();
|