@askexenow/exe-os 0.9.84 → 0.9.86
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/agentic-ontology-backfill.js +32 -14
- package/dist/bin/agentic-reflection-backfill.js +32 -14
- package/dist/bin/agentic-semantic-label.js +32 -14
- package/dist/bin/backfill-conversations.js +32 -14
- package/dist/bin/backfill-responses.js +32 -14
- package/dist/bin/backfill-vectors.js +32 -14
- package/dist/bin/bulk-sync-postgres.js +32 -14
- package/dist/bin/cleanup-stale-review-tasks.js +35 -17
- package/dist/bin/cli.js +224 -86
- package/dist/bin/exe-assign.js +32 -14
- package/dist/bin/exe-boot.js +57 -39
- package/dist/bin/exe-cloud.js +22 -4
- package/dist/bin/exe-dispatch.js +43 -25
- package/dist/bin/exe-doctor.js +22 -4
- package/dist/bin/exe-export-behaviors.js +32 -14
- package/dist/bin/exe-forget.js +32 -14
- package/dist/bin/exe-gateway.js +47 -29
- package/dist/bin/exe-heartbeat.js +37 -19
- package/dist/bin/exe-kill.js +36 -18
- package/dist/bin/exe-launch-agent.js +170 -79
- package/dist/bin/exe-new-employee.js +32 -0
- package/dist/bin/exe-pending-messages.js +35 -17
- package/dist/bin/exe-pending-notifications.js +35 -17
- package/dist/bin/exe-pending-reviews.js +37 -19
- package/dist/bin/exe-rename.js +34 -16
- package/dist/bin/exe-review.js +32 -14
- package/dist/bin/exe-search.js +40 -22
- package/dist/bin/exe-session-cleanup.js +67 -44
- package/dist/bin/exe-start-codex.js +39 -21
- package/dist/bin/exe-start-opencode.js +37 -19
- package/dist/bin/exe-status.js +44 -26
- package/dist/bin/exe-team.js +32 -14
- package/dist/bin/git-sweep.js +45 -27
- package/dist/bin/graph-backfill.js +32 -14
- package/dist/bin/graph-export.js +32 -14
- package/dist/bin/install.js +32 -0
- package/dist/bin/intercom-check.js +49 -31
- package/dist/bin/scan-tasks.js +45 -27
- package/dist/bin/setup.js +29 -11
- package/dist/bin/shard-migrate.js +32 -14
- package/dist/bin/stack-update.js +95 -7
- package/dist/bin/update.js +1 -1
- package/dist/gateway/index.js +47 -29
- package/dist/hooks/bug-report-worker.js +47 -29
- package/dist/hooks/codex-stop-task-finalizer.js +41 -23
- package/dist/hooks/commit-complete.js +46 -28
- package/dist/hooks/error-recall.js +44 -26
- package/dist/hooks/ingest-worker.js +4 -4
- package/dist/hooks/ingest.js +38 -20
- package/dist/hooks/instructions-loaded.js +32 -14
- package/dist/hooks/notification.js +32 -14
- package/dist/hooks/post-compact.js +32 -14
- package/dist/hooks/post-tool-combined.js +45 -27
- package/dist/hooks/pre-compact.js +43 -25
- package/dist/hooks/pre-tool-use.js +40 -22
- package/dist/hooks/prompt-submit.js +60 -42
- package/dist/hooks/session-end.js +48 -30
- package/dist/hooks/session-start.js +50 -32
- package/dist/hooks/stop.js +35 -17
- package/dist/hooks/subagent-stop.js +32 -14
- package/dist/hooks/summary-worker.js +37 -19
- package/dist/index.js +43 -25
- package/dist/lib/cloud-sync.js +32 -14
- package/dist/lib/database.js +22 -4
- package/dist/lib/db-daemon-client.js +16 -4
- package/dist/lib/db.js +22 -4
- package/dist/lib/device-registry.js +22 -4
- package/dist/lib/embedder.js +16 -4
- package/dist/lib/exe-daemon-client.js +16 -4
- package/dist/lib/exe-daemon.js +165 -66
- package/dist/lib/hybrid-search.js +40 -22
- package/dist/lib/schedules.js +35 -17
- package/dist/lib/skill-learning.js +16 -4
- package/dist/lib/store.js +32 -14
- package/dist/lib/tasks.js +16 -4
- package/dist/lib/tmux-routing.js +18 -6
- package/dist/mcp/server.js +142 -60
- package/dist/mcp/tools/create-task.js +18 -6
- package/dist/mcp/tools/update-task.js +18 -6
- package/dist/runtime/index.js +43 -25
- package/dist/tui/App.js +73 -55
- package/package.json +1 -1
package/dist/hooks/stop.js
CHANGED
|
@@ -1324,7 +1324,7 @@ __export(exe_daemon_client_exports, {
|
|
|
1324
1324
|
});
|
|
1325
1325
|
import net from "net";
|
|
1326
1326
|
import os6 from "os";
|
|
1327
|
-
import { spawn } from "child_process";
|
|
1327
|
+
import { spawn, execSync as execSync5 } from "child_process";
|
|
1328
1328
|
import { randomUUID } from "crypto";
|
|
1329
1329
|
import { existsSync as existsSync7, unlinkSync as unlinkSync3, readFileSync as readFileSync7, openSync, closeSync, statSync } from "fs";
|
|
1330
1330
|
import path9 from "path";
|
|
@@ -1354,6 +1354,14 @@ function handleData(chunk) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
+
function isZombie(pid) {
|
|
1358
|
+
try {
|
|
1359
|
+
const state = execSync5(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
1360
|
+
return state.startsWith("Z");
|
|
1361
|
+
} catch {
|
|
1362
|
+
return false;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1357
1365
|
function cleanupStaleFiles() {
|
|
1358
1366
|
if (existsSync7(PID_PATH)) {
|
|
1359
1367
|
try {
|
|
@@ -1361,7 +1369,11 @@ function cleanupStaleFiles() {
|
|
|
1361
1369
|
if (pid > 0) {
|
|
1362
1370
|
try {
|
|
1363
1371
|
process.kill(pid, 0);
|
|
1364
|
-
|
|
1372
|
+
if (!isZombie(pid)) {
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
|
|
1376
|
+
`);
|
|
1365
1377
|
} catch {
|
|
1366
1378
|
}
|
|
1367
1379
|
}
|
|
@@ -1389,8 +1401,8 @@ function findPackageRoot() {
|
|
|
1389
1401
|
function getAvailableMemoryGB() {
|
|
1390
1402
|
if (process.platform === "darwin") {
|
|
1391
1403
|
try {
|
|
1392
|
-
const { execSync:
|
|
1393
|
-
const vmstat =
|
|
1404
|
+
const { execSync: execSync8 } = __require("child_process");
|
|
1405
|
+
const vmstat = execSync8("vm_stat", { encoding: "utf8" });
|
|
1394
1406
|
const pageSize = 16384;
|
|
1395
1407
|
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
1396
1408
|
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
@@ -3380,6 +3392,12 @@ async function disposeDatabase() {
|
|
|
3380
3392
|
clearInterval(_walCheckpointTimer);
|
|
3381
3393
|
_walCheckpointTimer = null;
|
|
3382
3394
|
}
|
|
3395
|
+
if (_client) {
|
|
3396
|
+
try {
|
|
3397
|
+
await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
|
|
3398
|
+
} catch {
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3383
3401
|
if (_daemonClient) {
|
|
3384
3402
|
_daemonClient.close();
|
|
3385
3403
|
_daemonClient = null;
|
|
@@ -3568,7 +3586,7 @@ var init_task_scope = __esm({
|
|
|
3568
3586
|
// src/lib/keychain.ts
|
|
3569
3587
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
3570
3588
|
import { existsSync as existsSync12, statSync as statSync2 } from "fs";
|
|
3571
|
-
import { execSync as
|
|
3589
|
+
import { execSync as execSync6 } from "child_process";
|
|
3572
3590
|
import path14 from "path";
|
|
3573
3591
|
import os10 from "os";
|
|
3574
3592
|
function getKeyDir() {
|
|
@@ -3585,13 +3603,13 @@ function linuxSecretAvailable() {
|
|
|
3585
3603
|
if (process.platform !== "linux") return false;
|
|
3586
3604
|
if (linuxSecretAvailability !== null) return linuxSecretAvailability;
|
|
3587
3605
|
try {
|
|
3588
|
-
|
|
3606
|
+
execSync6("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
|
|
3589
3607
|
} catch {
|
|
3590
3608
|
linuxSecretAvailability = false;
|
|
3591
3609
|
return false;
|
|
3592
3610
|
}
|
|
3593
3611
|
try {
|
|
3594
|
-
|
|
3612
|
+
execSync6("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
|
|
3595
3613
|
linuxSecretAvailability = true;
|
|
3596
3614
|
} catch {
|
|
3597
3615
|
linuxSecretAvailability = false;
|
|
@@ -3615,7 +3633,7 @@ function macKeychainGet(service = SERVICE) {
|
|
|
3615
3633
|
if (!nativeKeychainAllowed()) return null;
|
|
3616
3634
|
if (process.platform !== "darwin") return null;
|
|
3617
3635
|
try {
|
|
3618
|
-
return
|
|
3636
|
+
return execSync6(
|
|
3619
3637
|
`security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
|
|
3620
3638
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3621
3639
|
).trim();
|
|
@@ -3628,13 +3646,13 @@ function macKeychainSet(value, service = SERVICE) {
|
|
|
3628
3646
|
if (process.platform !== "darwin") return false;
|
|
3629
3647
|
try {
|
|
3630
3648
|
try {
|
|
3631
|
-
|
|
3649
|
+
execSync6(
|
|
3632
3650
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3633
3651
|
{ timeout: 5e3 }
|
|
3634
3652
|
);
|
|
3635
3653
|
} catch {
|
|
3636
3654
|
}
|
|
3637
|
-
|
|
3655
|
+
execSync6(
|
|
3638
3656
|
`security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
|
|
3639
3657
|
{ timeout: 5e3 }
|
|
3640
3658
|
);
|
|
@@ -3647,7 +3665,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3647
3665
|
if (!nativeKeychainAllowed()) return false;
|
|
3648
3666
|
if (process.platform !== "darwin") return false;
|
|
3649
3667
|
try {
|
|
3650
|
-
|
|
3668
|
+
execSync6(
|
|
3651
3669
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3652
3670
|
{ timeout: 5e3 }
|
|
3653
3671
|
);
|
|
@@ -3659,7 +3677,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3659
3677
|
function linuxSecretGet(service = SERVICE) {
|
|
3660
3678
|
if (!linuxSecretAvailable()) return null;
|
|
3661
3679
|
try {
|
|
3662
|
-
return
|
|
3680
|
+
return execSync6(
|
|
3663
3681
|
`secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3664
3682
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3665
3683
|
).trim();
|
|
@@ -3670,7 +3688,7 @@ function linuxSecretGet(service = SERVICE) {
|
|
|
3670
3688
|
function linuxSecretSet(value, service = SERVICE) {
|
|
3671
3689
|
if (!linuxSecretAvailable()) return false;
|
|
3672
3690
|
try {
|
|
3673
|
-
|
|
3691
|
+
execSync6(
|
|
3674
3692
|
`echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3675
3693
|
{ timeout: 5e3 }
|
|
3676
3694
|
);
|
|
@@ -3683,7 +3701,7 @@ function linuxSecretDelete(service = SERVICE) {
|
|
|
3683
3701
|
if (!nativeKeychainAllowed()) return false;
|
|
3684
3702
|
if (process.platform !== "linux") return false;
|
|
3685
3703
|
try {
|
|
3686
|
-
|
|
3704
|
+
execSync6(
|
|
3687
3705
|
`secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3688
3706
|
{ timeout: 5e3 }
|
|
3689
3707
|
);
|
|
@@ -5932,7 +5950,7 @@ var init_fast_db_init = __esm({
|
|
|
5932
5950
|
});
|
|
5933
5951
|
|
|
5934
5952
|
// src/lib/project-name.ts
|
|
5935
|
-
import { execSync as
|
|
5953
|
+
import { execSync as execSync7 } from "child_process";
|
|
5936
5954
|
import path16 from "path";
|
|
5937
5955
|
function getProjectName(cwd) {
|
|
5938
5956
|
const dir = cwd ?? process.cwd();
|
|
@@ -5940,7 +5958,7 @@ function getProjectName(cwd) {
|
|
|
5940
5958
|
try {
|
|
5941
5959
|
let repoRoot;
|
|
5942
5960
|
try {
|
|
5943
|
-
const gitCommonDir =
|
|
5961
|
+
const gitCommonDir = execSync7("git rev-parse --path-format=absolute --git-common-dir", {
|
|
5944
5962
|
cwd: dir,
|
|
5945
5963
|
encoding: "utf8",
|
|
5946
5964
|
timeout: 2e3,
|
|
@@ -5948,7 +5966,7 @@ function getProjectName(cwd) {
|
|
|
5948
5966
|
}).trim();
|
|
5949
5967
|
repoRoot = path16.dirname(gitCommonDir);
|
|
5950
5968
|
} catch {
|
|
5951
|
-
repoRoot =
|
|
5969
|
+
repoRoot = execSync7("git rev-parse --show-toplevel", {
|
|
5952
5970
|
cwd: dir,
|
|
5953
5971
|
encoding: "utf8",
|
|
5954
5972
|
timeout: 2e3,
|
|
@@ -1296,7 +1296,7 @@ __export(exe_daemon_client_exports, {
|
|
|
1296
1296
|
});
|
|
1297
1297
|
import net from "net";
|
|
1298
1298
|
import os6 from "os";
|
|
1299
|
-
import { spawn } from "child_process";
|
|
1299
|
+
import { spawn, execSync as execSync5 } from "child_process";
|
|
1300
1300
|
import { randomUUID } from "crypto";
|
|
1301
1301
|
import { existsSync as existsSync7, unlinkSync as unlinkSync3, readFileSync as readFileSync7, openSync, closeSync, statSync } from "fs";
|
|
1302
1302
|
import path9 from "path";
|
|
@@ -1326,6 +1326,14 @@ function handleData(chunk) {
|
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
|
+
function isZombie(pid) {
|
|
1330
|
+
try {
|
|
1331
|
+
const state = execSync5(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
1332
|
+
return state.startsWith("Z");
|
|
1333
|
+
} catch {
|
|
1334
|
+
return false;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1329
1337
|
function cleanupStaleFiles() {
|
|
1330
1338
|
if (existsSync7(PID_PATH)) {
|
|
1331
1339
|
try {
|
|
@@ -1333,7 +1341,11 @@ function cleanupStaleFiles() {
|
|
|
1333
1341
|
if (pid > 0) {
|
|
1334
1342
|
try {
|
|
1335
1343
|
process.kill(pid, 0);
|
|
1336
|
-
|
|
1344
|
+
if (!isZombie(pid)) {
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
|
|
1348
|
+
`);
|
|
1337
1349
|
} catch {
|
|
1338
1350
|
}
|
|
1339
1351
|
}
|
|
@@ -1361,8 +1373,8 @@ function findPackageRoot() {
|
|
|
1361
1373
|
function getAvailableMemoryGB() {
|
|
1362
1374
|
if (process.platform === "darwin") {
|
|
1363
1375
|
try {
|
|
1364
|
-
const { execSync:
|
|
1365
|
-
const vmstat =
|
|
1376
|
+
const { execSync: execSync7 } = __require("child_process");
|
|
1377
|
+
const vmstat = execSync7("vm_stat", { encoding: "utf8" });
|
|
1366
1378
|
const pageSize = 16384;
|
|
1367
1379
|
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
1368
1380
|
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
@@ -3352,6 +3364,12 @@ async function disposeDatabase() {
|
|
|
3352
3364
|
clearInterval(_walCheckpointTimer);
|
|
3353
3365
|
_walCheckpointTimer = null;
|
|
3354
3366
|
}
|
|
3367
|
+
if (_client) {
|
|
3368
|
+
try {
|
|
3369
|
+
await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
|
|
3370
|
+
} catch {
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3355
3373
|
if (_daemonClient) {
|
|
3356
3374
|
_daemonClient.close();
|
|
3357
3375
|
_daemonClient = null;
|
|
@@ -3531,7 +3549,7 @@ var init_task_scope = __esm({
|
|
|
3531
3549
|
// src/lib/keychain.ts
|
|
3532
3550
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
3533
3551
|
import { existsSync as existsSync12, statSync as statSync2 } from "fs";
|
|
3534
|
-
import { execSync as
|
|
3552
|
+
import { execSync as execSync6 } from "child_process";
|
|
3535
3553
|
import path14 from "path";
|
|
3536
3554
|
import os10 from "os";
|
|
3537
3555
|
function getKeyDir() {
|
|
@@ -3548,13 +3566,13 @@ function linuxSecretAvailable() {
|
|
|
3548
3566
|
if (process.platform !== "linux") return false;
|
|
3549
3567
|
if (linuxSecretAvailability !== null) return linuxSecretAvailability;
|
|
3550
3568
|
try {
|
|
3551
|
-
|
|
3569
|
+
execSync6("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
|
|
3552
3570
|
} catch {
|
|
3553
3571
|
linuxSecretAvailability = false;
|
|
3554
3572
|
return false;
|
|
3555
3573
|
}
|
|
3556
3574
|
try {
|
|
3557
|
-
|
|
3575
|
+
execSync6("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
|
|
3558
3576
|
linuxSecretAvailability = true;
|
|
3559
3577
|
} catch {
|
|
3560
3578
|
linuxSecretAvailability = false;
|
|
@@ -3578,7 +3596,7 @@ function macKeychainGet(service = SERVICE) {
|
|
|
3578
3596
|
if (!nativeKeychainAllowed()) return null;
|
|
3579
3597
|
if (process.platform !== "darwin") return null;
|
|
3580
3598
|
try {
|
|
3581
|
-
return
|
|
3599
|
+
return execSync6(
|
|
3582
3600
|
`security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
|
|
3583
3601
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3584
3602
|
).trim();
|
|
@@ -3591,13 +3609,13 @@ function macKeychainSet(value, service = SERVICE) {
|
|
|
3591
3609
|
if (process.platform !== "darwin") return false;
|
|
3592
3610
|
try {
|
|
3593
3611
|
try {
|
|
3594
|
-
|
|
3612
|
+
execSync6(
|
|
3595
3613
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3596
3614
|
{ timeout: 5e3 }
|
|
3597
3615
|
);
|
|
3598
3616
|
} catch {
|
|
3599
3617
|
}
|
|
3600
|
-
|
|
3618
|
+
execSync6(
|
|
3601
3619
|
`security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
|
|
3602
3620
|
{ timeout: 5e3 }
|
|
3603
3621
|
);
|
|
@@ -3610,7 +3628,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3610
3628
|
if (!nativeKeychainAllowed()) return false;
|
|
3611
3629
|
if (process.platform !== "darwin") return false;
|
|
3612
3630
|
try {
|
|
3613
|
-
|
|
3631
|
+
execSync6(
|
|
3614
3632
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3615
3633
|
{ timeout: 5e3 }
|
|
3616
3634
|
);
|
|
@@ -3622,7 +3640,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3622
3640
|
function linuxSecretGet(service = SERVICE) {
|
|
3623
3641
|
if (!linuxSecretAvailable()) return null;
|
|
3624
3642
|
try {
|
|
3625
|
-
return
|
|
3643
|
+
return execSync6(
|
|
3626
3644
|
`secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3627
3645
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3628
3646
|
).trim();
|
|
@@ -3633,7 +3651,7 @@ function linuxSecretGet(service = SERVICE) {
|
|
|
3633
3651
|
function linuxSecretSet(value, service = SERVICE) {
|
|
3634
3652
|
if (!linuxSecretAvailable()) return false;
|
|
3635
3653
|
try {
|
|
3636
|
-
|
|
3654
|
+
execSync6(
|
|
3637
3655
|
`echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3638
3656
|
{ timeout: 5e3 }
|
|
3639
3657
|
);
|
|
@@ -3646,7 +3664,7 @@ function linuxSecretDelete(service = SERVICE) {
|
|
|
3646
3664
|
if (!nativeKeychainAllowed()) return false;
|
|
3647
3665
|
if (process.platform !== "linux") return false;
|
|
3648
3666
|
try {
|
|
3649
|
-
|
|
3667
|
+
execSync6(
|
|
3650
3668
|
`secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3651
3669
|
{ timeout: 5e3 }
|
|
3652
3670
|
);
|
|
@@ -1118,7 +1118,7 @@ var init_daemon_auth = __esm({
|
|
|
1118
1118
|
// src/lib/exe-daemon-client.ts
|
|
1119
1119
|
import net from "net";
|
|
1120
1120
|
import os4 from "os";
|
|
1121
|
-
import { spawn } from "child_process";
|
|
1121
|
+
import { spawn, execSync as execSync2 } from "child_process";
|
|
1122
1122
|
import { randomUUID } from "crypto";
|
|
1123
1123
|
import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
|
|
1124
1124
|
import path5 from "path";
|
|
@@ -1148,6 +1148,14 @@ function handleData(chunk) {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
|
+
function isZombie(pid) {
|
|
1152
|
+
try {
|
|
1153
|
+
const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
|
|
1154
|
+
return state.startsWith("Z");
|
|
1155
|
+
} catch {
|
|
1156
|
+
return false;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1151
1159
|
function cleanupStaleFiles() {
|
|
1152
1160
|
if (existsSync5(PID_PATH)) {
|
|
1153
1161
|
try {
|
|
@@ -1155,7 +1163,11 @@ function cleanupStaleFiles() {
|
|
|
1155
1163
|
if (pid > 0) {
|
|
1156
1164
|
try {
|
|
1157
1165
|
process.kill(pid, 0);
|
|
1158
|
-
|
|
1166
|
+
if (!isZombie(pid)) {
|
|
1167
|
+
return;
|
|
1168
|
+
}
|
|
1169
|
+
process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
|
|
1170
|
+
`);
|
|
1159
1171
|
} catch {
|
|
1160
1172
|
}
|
|
1161
1173
|
}
|
|
@@ -1183,8 +1195,8 @@ function findPackageRoot() {
|
|
|
1183
1195
|
function getAvailableMemoryGB() {
|
|
1184
1196
|
if (process.platform === "darwin") {
|
|
1185
1197
|
try {
|
|
1186
|
-
const { execSync:
|
|
1187
|
-
const vmstat =
|
|
1198
|
+
const { execSync: execSync7 } = __require("child_process");
|
|
1199
|
+
const vmstat = execSync7("vm_stat", { encoding: "utf8" });
|
|
1188
1200
|
const pageSize = 16384;
|
|
1189
1201
|
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
1190
1202
|
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
@@ -3119,6 +3131,12 @@ async function disposeDatabase() {
|
|
|
3119
3131
|
clearInterval(_walCheckpointTimer);
|
|
3120
3132
|
_walCheckpointTimer = null;
|
|
3121
3133
|
}
|
|
3134
|
+
if (_client) {
|
|
3135
|
+
try {
|
|
3136
|
+
await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
|
|
3137
|
+
} catch {
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3122
3140
|
if (_daemonClient) {
|
|
3123
3141
|
_daemonClient.close();
|
|
3124
3142
|
_daemonClient = null;
|
|
@@ -3164,7 +3182,7 @@ __export(keychain_exports, {
|
|
|
3164
3182
|
});
|
|
3165
3183
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
3166
3184
|
import { existsSync as existsSync6, statSync as statSync2 } from "fs";
|
|
3167
|
-
import { execSync as
|
|
3185
|
+
import { execSync as execSync3 } from "child_process";
|
|
3168
3186
|
import path6 from "path";
|
|
3169
3187
|
import os5 from "os";
|
|
3170
3188
|
function getKeyDir() {
|
|
@@ -3181,13 +3199,13 @@ function linuxSecretAvailable() {
|
|
|
3181
3199
|
if (process.platform !== "linux") return false;
|
|
3182
3200
|
if (linuxSecretAvailability !== null) return linuxSecretAvailability;
|
|
3183
3201
|
try {
|
|
3184
|
-
|
|
3202
|
+
execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
|
|
3185
3203
|
} catch {
|
|
3186
3204
|
linuxSecretAvailability = false;
|
|
3187
3205
|
return false;
|
|
3188
3206
|
}
|
|
3189
3207
|
try {
|
|
3190
|
-
|
|
3208
|
+
execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
|
|
3191
3209
|
linuxSecretAvailability = true;
|
|
3192
3210
|
} catch {
|
|
3193
3211
|
linuxSecretAvailability = false;
|
|
@@ -3211,7 +3229,7 @@ function macKeychainGet(service = SERVICE) {
|
|
|
3211
3229
|
if (!nativeKeychainAllowed()) return null;
|
|
3212
3230
|
if (process.platform !== "darwin") return null;
|
|
3213
3231
|
try {
|
|
3214
|
-
return
|
|
3232
|
+
return execSync3(
|
|
3215
3233
|
`security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
|
|
3216
3234
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3217
3235
|
).trim();
|
|
@@ -3224,13 +3242,13 @@ function macKeychainSet(value, service = SERVICE) {
|
|
|
3224
3242
|
if (process.platform !== "darwin") return false;
|
|
3225
3243
|
try {
|
|
3226
3244
|
try {
|
|
3227
|
-
|
|
3245
|
+
execSync3(
|
|
3228
3246
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3229
3247
|
{ timeout: 5e3 }
|
|
3230
3248
|
);
|
|
3231
3249
|
} catch {
|
|
3232
3250
|
}
|
|
3233
|
-
|
|
3251
|
+
execSync3(
|
|
3234
3252
|
`security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
|
|
3235
3253
|
{ timeout: 5e3 }
|
|
3236
3254
|
);
|
|
@@ -3243,7 +3261,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3243
3261
|
if (!nativeKeychainAllowed()) return false;
|
|
3244
3262
|
if (process.platform !== "darwin") return false;
|
|
3245
3263
|
try {
|
|
3246
|
-
|
|
3264
|
+
execSync3(
|
|
3247
3265
|
`security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
|
|
3248
3266
|
{ timeout: 5e3 }
|
|
3249
3267
|
);
|
|
@@ -3255,7 +3273,7 @@ function macKeychainDelete(service = SERVICE) {
|
|
|
3255
3273
|
function linuxSecretGet(service = SERVICE) {
|
|
3256
3274
|
if (!linuxSecretAvailable()) return null;
|
|
3257
3275
|
try {
|
|
3258
|
-
return
|
|
3276
|
+
return execSync3(
|
|
3259
3277
|
`secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3260
3278
|
{ encoding: "utf-8", timeout: 5e3 }
|
|
3261
3279
|
).trim();
|
|
@@ -3266,7 +3284,7 @@ function linuxSecretGet(service = SERVICE) {
|
|
|
3266
3284
|
function linuxSecretSet(value, service = SERVICE) {
|
|
3267
3285
|
if (!linuxSecretAvailable()) return false;
|
|
3268
3286
|
try {
|
|
3269
|
-
|
|
3287
|
+
execSync3(
|
|
3270
3288
|
`echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3271
3289
|
{ timeout: 5e3 }
|
|
3272
3290
|
);
|
|
@@ -3279,7 +3297,7 @@ function linuxSecretDelete(service = SERVICE) {
|
|
|
3279
3297
|
if (!nativeKeychainAllowed()) return false;
|
|
3280
3298
|
if (process.platform !== "linux") return false;
|
|
3281
3299
|
try {
|
|
3282
|
-
|
|
3300
|
+
execSync3(
|
|
3283
3301
|
`secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
|
|
3284
3302
|
{ timeout: 5e3 }
|
|
3285
3303
|
);
|
|
@@ -4384,7 +4402,7 @@ var init_session_registry = __esm({
|
|
|
4384
4402
|
});
|
|
4385
4403
|
|
|
4386
4404
|
// src/lib/session-key.ts
|
|
4387
|
-
import { execSync as
|
|
4405
|
+
import { execSync as execSync4 } from "child_process";
|
|
4388
4406
|
function normalizeCommand(command) {
|
|
4389
4407
|
const trimmed = command.trim().toLowerCase();
|
|
4390
4408
|
const parts = trimmed.split(/[\\/]/);
|
|
@@ -4403,7 +4421,7 @@ function resolveRuntimeProcess() {
|
|
|
4403
4421
|
let pid = process.ppid;
|
|
4404
4422
|
for (let i = 0; i < 10; i++) {
|
|
4405
4423
|
try {
|
|
4406
|
-
const info =
|
|
4424
|
+
const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
|
|
4407
4425
|
encoding: "utf8",
|
|
4408
4426
|
timeout: 2e3
|
|
4409
4427
|
}).trim();
|
|
@@ -4569,7 +4587,7 @@ var init_transport = __esm({
|
|
|
4569
4587
|
});
|
|
4570
4588
|
|
|
4571
4589
|
// src/lib/cc-agent-support.ts
|
|
4572
|
-
import { execSync as
|
|
4590
|
+
import { execSync as execSync5 } from "child_process";
|
|
4573
4591
|
var init_cc_agent_support = __esm({
|
|
4574
4592
|
"src/lib/cc-agent-support.ts"() {
|
|
4575
4593
|
"use strict";
|
|
@@ -7405,7 +7423,7 @@ init_database();
|
|
|
7405
7423
|
init_notifications();
|
|
7406
7424
|
init_task_scope();
|
|
7407
7425
|
init_employees();
|
|
7408
|
-
import { execSync as
|
|
7426
|
+
import { execSync as execSync6 } from "child_process";
|
|
7409
7427
|
import { existsSync as existsSync20, mkdirSync as mkdirSync11, openSync as openSync3, closeSync as closeSync3 } from "fs";
|
|
7410
7428
|
import path21 from "path";
|
|
7411
7429
|
|
|
@@ -7806,7 +7824,7 @@ async function main() {
|
|
|
7806
7824
|
const taskTitle = String(taskRow.title);
|
|
7807
7825
|
let lastCommit = "";
|
|
7808
7826
|
try {
|
|
7809
|
-
lastCommit =
|
|
7827
|
+
lastCommit = execSync6("git log --oneline -1 --since='30 minutes ago'", {
|
|
7810
7828
|
encoding: "utf8",
|
|
7811
7829
|
timeout: 5e3
|
|
7812
7830
|
}).trim();
|