@askexenow/exe-os 0.9.13 → 0.9.15
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/backfill-conversations.js +31 -4
- package/dist/bin/backfill-responses.js +31 -4
- package/dist/bin/backfill-vectors.js +25 -4
- package/dist/bin/cleanup-stale-review-tasks.js +1 -1
- package/dist/bin/cli.js +55 -8
- package/dist/bin/exe-assign.js +31 -4
- package/dist/bin/exe-boot.js +25 -4
- package/dist/bin/exe-dispatch.js +1 -1
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +1 -1
- package/dist/bin/exe-forget.js +1 -1
- package/dist/bin/exe-gateway.js +447 -21
- package/dist/bin/exe-heartbeat.js +1 -1
- package/dist/bin/exe-kill.js +1 -1
- package/dist/bin/exe-launch-agent.js +1 -1
- package/dist/bin/exe-link.js +31 -4
- package/dist/bin/exe-pending-messages.js +1 -1
- package/dist/bin/exe-pending-notifications.js +1 -1
- package/dist/bin/exe-pending-reviews.js +1 -1
- package/dist/bin/exe-rename.js +31 -4
- package/dist/bin/exe-review.js +1 -1
- package/dist/bin/exe-search.js +31 -4
- package/dist/bin/exe-session-cleanup.js +25 -4
- package/dist/bin/exe-start-codex.js +1 -1
- package/dist/bin/exe-start-opencode.js +1 -1
- package/dist/bin/exe-status.js +1 -1
- package/dist/bin/exe-team.js +1 -1
- package/dist/bin/git-sweep.js +25 -4
- package/dist/bin/graph-backfill.js +1 -1
- package/dist/bin/graph-export.js +1 -1
- package/dist/bin/scan-tasks.js +25 -4
- package/dist/bin/setup.js +46 -8
- package/dist/bin/shard-migrate.js +1 -1
- package/dist/bin/wiki-sync.js +1 -1
- package/dist/gateway/index.js +128 -125
- package/dist/hooks/bug-report-worker.js +1 -1
- package/dist/hooks/codex-stop-task-finalizer.js +1 -1
- package/dist/hooks/commit-complete.js +25 -4
- package/dist/hooks/error-recall.js +31 -4
- package/dist/hooks/ingest-worker.js +25 -4
- package/dist/hooks/ingest.js +1 -1
- package/dist/hooks/instructions-loaded.js +31 -4
- package/dist/hooks/notification.js +31 -4
- package/dist/hooks/post-compact.js +31 -4
- package/dist/hooks/pre-compact.js +25 -4
- package/dist/hooks/pre-tool-use.js +31 -4
- package/dist/hooks/prompt-ingest-worker.js +25 -4
- package/dist/hooks/prompt-submit.js +25 -4
- package/dist/hooks/response-ingest-worker.js +25 -4
- package/dist/hooks/session-end.js +25 -4
- package/dist/hooks/session-start.js +31 -4
- package/dist/hooks/stop.js +25 -4
- package/dist/hooks/subagent-stop.js +31 -4
- package/dist/hooks/summary-worker.js +25 -4
- package/dist/index.js +128 -125
- package/dist/lib/cloud-sync.js +31 -4
- package/dist/lib/database.js +31 -4
- package/dist/lib/db-daemon-client.js +31 -3
- package/dist/lib/db.js +31 -4
- package/dist/lib/device-registry.js +31 -4
- package/dist/lib/embedder.js +30 -3
- package/dist/lib/exe-daemon-client.js +31 -3
- package/dist/lib/exe-daemon.js +1969 -156
- package/dist/lib/hybrid-search.js +31 -4
- package/dist/lib/schedules.js +1 -1
- package/dist/lib/store.js +1 -1
- package/dist/mcp/server.js +25 -4
- package/dist/runtime/index.js +25 -4
- package/dist/tui/App.js +34 -4
- package/package.json +1 -1
package/dist/lib/database.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
3
9
|
var __esm = (fn, res) => function __init() {
|
|
4
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
11
|
};
|
|
@@ -227,8 +233,29 @@ function findPackageRoot() {
|
|
|
227
233
|
}
|
|
228
234
|
return null;
|
|
229
235
|
}
|
|
236
|
+
function getAvailableMemoryGB() {
|
|
237
|
+
if (process.platform === "darwin") {
|
|
238
|
+
try {
|
|
239
|
+
const { execSync: execSync2 } = __require("child_process");
|
|
240
|
+
const vmstat = execSync2("vm_stat", { encoding: "utf8" });
|
|
241
|
+
const pageSize = 16384;
|
|
242
|
+
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
243
|
+
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
244
|
+
const free = vmstat.match(/Pages free:\s+(\d+)/);
|
|
245
|
+
const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
|
|
246
|
+
const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
|
|
247
|
+
const freePages = free ? parseInt(free[1], 10) : 0;
|
|
248
|
+
const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
|
|
249
|
+
const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
|
|
250
|
+
return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
|
|
251
|
+
} catch {
|
|
252
|
+
return os4.freemem() / (1024 * 1024 * 1024);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return os4.freemem() / (1024 * 1024 * 1024);
|
|
256
|
+
}
|
|
230
257
|
function spawnDaemon() {
|
|
231
|
-
const freeGB =
|
|
258
|
+
const freeGB = getAvailableMemoryGB();
|
|
232
259
|
const totalGB = os4.totalmem() / (1024 * 1024 * 1024);
|
|
233
260
|
if (totalGB <= 8) {
|
|
234
261
|
process.stderr.write(
|
|
@@ -237,9 +264,9 @@ function spawnDaemon() {
|
|
|
237
264
|
);
|
|
238
265
|
return;
|
|
239
266
|
}
|
|
240
|
-
if (totalGB <= 16 && freeGB <
|
|
267
|
+
if (totalGB <= 16 && freeGB < 2) {
|
|
241
268
|
process.stderr.write(
|
|
242
|
-
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB
|
|
269
|
+
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
|
|
243
270
|
`
|
|
244
271
|
);
|
|
245
272
|
return;
|
|
@@ -1092,7 +1119,7 @@ async function ensureCompatibilityViews(prisma) {
|
|
|
1092
1119
|
for (const mapping of VIEW_MAPPINGS) {
|
|
1093
1120
|
const relation = mapping.source.replace(/"/g, "");
|
|
1094
1121
|
const rows = await prisma.$queryRawUnsafe(
|
|
1095
|
-
"SELECT to_regclass($1) AS regclass",
|
|
1122
|
+
"SELECT to_regclass($1)::text AS regclass",
|
|
1096
1123
|
relation
|
|
1097
1124
|
);
|
|
1098
1125
|
if (!rows[0]?.regclass) {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/lib/exe-daemon-client.ts
|
|
2
9
|
import net from "net";
|
|
3
10
|
import os2 from "os";
|
|
@@ -212,8 +219,29 @@ function findPackageRoot() {
|
|
|
212
219
|
}
|
|
213
220
|
return null;
|
|
214
221
|
}
|
|
222
|
+
function getAvailableMemoryGB() {
|
|
223
|
+
if (process.platform === "darwin") {
|
|
224
|
+
try {
|
|
225
|
+
const { execSync } = __require("child_process");
|
|
226
|
+
const vmstat = execSync("vm_stat", { encoding: "utf8" });
|
|
227
|
+
const pageSize = 16384;
|
|
228
|
+
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
229
|
+
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
230
|
+
const free = vmstat.match(/Pages free:\s+(\d+)/);
|
|
231
|
+
const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
|
|
232
|
+
const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
|
|
233
|
+
const freePages = free ? parseInt(free[1], 10) : 0;
|
|
234
|
+
const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
|
|
235
|
+
const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
|
|
236
|
+
return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
|
|
237
|
+
} catch {
|
|
238
|
+
return os2.freemem() / (1024 * 1024 * 1024);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return os2.freemem() / (1024 * 1024 * 1024);
|
|
242
|
+
}
|
|
215
243
|
function spawnDaemon() {
|
|
216
|
-
const freeGB =
|
|
244
|
+
const freeGB = getAvailableMemoryGB();
|
|
217
245
|
const totalGB = os2.totalmem() / (1024 * 1024 * 1024);
|
|
218
246
|
if (totalGB <= 8) {
|
|
219
247
|
process.stderr.write(
|
|
@@ -222,9 +250,9 @@ function spawnDaemon() {
|
|
|
222
250
|
);
|
|
223
251
|
return;
|
|
224
252
|
}
|
|
225
|
-
if (totalGB <= 16 && freeGB <
|
|
253
|
+
if (totalGB <= 16 && freeGB < 2) {
|
|
226
254
|
process.stderr.write(
|
|
227
|
-
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB
|
|
255
|
+
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
|
|
228
256
|
`
|
|
229
257
|
);
|
|
230
258
|
return;
|
package/dist/lib/db.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
3
9
|
var __esm = (fn, res) => function __init() {
|
|
4
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
11
|
};
|
|
@@ -227,8 +233,29 @@ function findPackageRoot() {
|
|
|
227
233
|
}
|
|
228
234
|
return null;
|
|
229
235
|
}
|
|
236
|
+
function getAvailableMemoryGB() {
|
|
237
|
+
if (process.platform === "darwin") {
|
|
238
|
+
try {
|
|
239
|
+
const { execSync: execSync2 } = __require("child_process");
|
|
240
|
+
const vmstat = execSync2("vm_stat", { encoding: "utf8" });
|
|
241
|
+
const pageSize = 16384;
|
|
242
|
+
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
243
|
+
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
244
|
+
const free = vmstat.match(/Pages free:\s+(\d+)/);
|
|
245
|
+
const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
|
|
246
|
+
const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
|
|
247
|
+
const freePages = free ? parseInt(free[1], 10) : 0;
|
|
248
|
+
const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
|
|
249
|
+
const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
|
|
250
|
+
return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
|
|
251
|
+
} catch {
|
|
252
|
+
return os4.freemem() / (1024 * 1024 * 1024);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return os4.freemem() / (1024 * 1024 * 1024);
|
|
256
|
+
}
|
|
230
257
|
function spawnDaemon() {
|
|
231
|
-
const freeGB =
|
|
258
|
+
const freeGB = getAvailableMemoryGB();
|
|
232
259
|
const totalGB = os4.totalmem() / (1024 * 1024 * 1024);
|
|
233
260
|
if (totalGB <= 8) {
|
|
234
261
|
process.stderr.write(
|
|
@@ -237,9 +264,9 @@ function spawnDaemon() {
|
|
|
237
264
|
);
|
|
238
265
|
return;
|
|
239
266
|
}
|
|
240
|
-
if (totalGB <= 16 && freeGB <
|
|
267
|
+
if (totalGB <= 16 && freeGB < 2) {
|
|
241
268
|
process.stderr.write(
|
|
242
|
-
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB
|
|
269
|
+
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
|
|
243
270
|
`
|
|
244
271
|
);
|
|
245
272
|
return;
|
|
@@ -1092,7 +1119,7 @@ async function ensureCompatibilityViews(prisma) {
|
|
|
1092
1119
|
for (const mapping of VIEW_MAPPINGS) {
|
|
1093
1120
|
const relation = mapping.source.replace(/"/g, "");
|
|
1094
1121
|
const rows = await prisma.$queryRawUnsafe(
|
|
1095
|
-
"SELECT to_regclass($1) AS regclass",
|
|
1122
|
+
"SELECT to_regclass($1)::text AS regclass",
|
|
1096
1123
|
relation
|
|
1097
1124
|
);
|
|
1098
1125
|
if (!rows[0]?.regclass) {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
3
9
|
var __esm = (fn, res) => function __init() {
|
|
4
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
11
|
};
|
|
@@ -550,7 +556,7 @@ async function ensureCompatibilityViews(prisma) {
|
|
|
550
556
|
for (const mapping of VIEW_MAPPINGS) {
|
|
551
557
|
const relation = mapping.source.replace(/"/g, "");
|
|
552
558
|
const rows = await prisma.$queryRawUnsafe(
|
|
553
|
-
"SELECT to_regclass($1) AS regclass",
|
|
559
|
+
"SELECT to_regclass($1)::text AS regclass",
|
|
554
560
|
relation
|
|
555
561
|
);
|
|
556
562
|
if (!rows[0]?.regclass) {
|
|
@@ -904,8 +910,29 @@ function findPackageRoot() {
|
|
|
904
910
|
}
|
|
905
911
|
return null;
|
|
906
912
|
}
|
|
913
|
+
function getAvailableMemoryGB() {
|
|
914
|
+
if (process.platform === "darwin") {
|
|
915
|
+
try {
|
|
916
|
+
const { execSync: execSync2 } = __require("child_process");
|
|
917
|
+
const vmstat = execSync2("vm_stat", { encoding: "utf8" });
|
|
918
|
+
const pageSize = 16384;
|
|
919
|
+
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
920
|
+
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
921
|
+
const free = vmstat.match(/Pages free:\s+(\d+)/);
|
|
922
|
+
const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
|
|
923
|
+
const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
|
|
924
|
+
const freePages = free ? parseInt(free[1], 10) : 0;
|
|
925
|
+
const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
|
|
926
|
+
const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
|
|
927
|
+
return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
|
|
928
|
+
} catch {
|
|
929
|
+
return os4.freemem() / (1024 * 1024 * 1024);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
return os4.freemem() / (1024 * 1024 * 1024);
|
|
933
|
+
}
|
|
907
934
|
function spawnDaemon() {
|
|
908
|
-
const freeGB =
|
|
935
|
+
const freeGB = getAvailableMemoryGB();
|
|
909
936
|
const totalGB = os4.totalmem() / (1024 * 1024 * 1024);
|
|
910
937
|
if (totalGB <= 8) {
|
|
911
938
|
process.stderr.write(
|
|
@@ -914,9 +941,9 @@ function spawnDaemon() {
|
|
|
914
941
|
);
|
|
915
942
|
return;
|
|
916
943
|
}
|
|
917
|
-
if (totalGB <= 16 && freeGB <
|
|
944
|
+
if (totalGB <= 16 && freeGB < 2) {
|
|
918
945
|
process.stderr.write(
|
|
919
|
-
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB
|
|
946
|
+
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
|
|
920
947
|
`
|
|
921
948
|
);
|
|
922
949
|
return;
|
package/dist/lib/embedder.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
+
}) : x)(function(x) {
|
|
6
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
+
});
|
|
3
9
|
var __esm = (fn, res) => function __init() {
|
|
4
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
11
|
};
|
|
@@ -406,8 +412,29 @@ function findPackageRoot() {
|
|
|
406
412
|
}
|
|
407
413
|
return null;
|
|
408
414
|
}
|
|
415
|
+
function getAvailableMemoryGB() {
|
|
416
|
+
if (process.platform === "darwin") {
|
|
417
|
+
try {
|
|
418
|
+
const { execSync } = __require("child_process");
|
|
419
|
+
const vmstat = execSync("vm_stat", { encoding: "utf8" });
|
|
420
|
+
const pageSize = 16384;
|
|
421
|
+
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
422
|
+
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
423
|
+
const free = vmstat.match(/Pages free:\s+(\d+)/);
|
|
424
|
+
const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
|
|
425
|
+
const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
|
|
426
|
+
const freePages = free ? parseInt(free[1], 10) : 0;
|
|
427
|
+
const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
|
|
428
|
+
const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
|
|
429
|
+
return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
|
|
430
|
+
} catch {
|
|
431
|
+
return os2.freemem() / (1024 * 1024 * 1024);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return os2.freemem() / (1024 * 1024 * 1024);
|
|
435
|
+
}
|
|
409
436
|
function spawnDaemon() {
|
|
410
|
-
const freeGB =
|
|
437
|
+
const freeGB = getAvailableMemoryGB();
|
|
411
438
|
const totalGB = os2.totalmem() / (1024 * 1024 * 1024);
|
|
412
439
|
if (totalGB <= 8) {
|
|
413
440
|
process.stderr.write(
|
|
@@ -416,9 +443,9 @@ function spawnDaemon() {
|
|
|
416
443
|
);
|
|
417
444
|
return;
|
|
418
445
|
}
|
|
419
|
-
if (totalGB <= 16 && freeGB <
|
|
446
|
+
if (totalGB <= 16 && freeGB < 2) {
|
|
420
447
|
process.stderr.write(
|
|
421
|
-
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB
|
|
448
|
+
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
|
|
422
449
|
`
|
|
423
450
|
);
|
|
424
451
|
return;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/lib/exe-daemon-client.ts
|
|
2
9
|
import net from "net";
|
|
3
10
|
import os2 from "os";
|
|
@@ -218,8 +225,29 @@ function findPackageRoot() {
|
|
|
218
225
|
}
|
|
219
226
|
return null;
|
|
220
227
|
}
|
|
228
|
+
function getAvailableMemoryGB() {
|
|
229
|
+
if (process.platform === "darwin") {
|
|
230
|
+
try {
|
|
231
|
+
const { execSync } = __require("child_process");
|
|
232
|
+
const vmstat = execSync("vm_stat", { encoding: "utf8" });
|
|
233
|
+
const pageSize = 16384;
|
|
234
|
+
const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
|
|
235
|
+
const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
|
|
236
|
+
const free = vmstat.match(/Pages free:\s+(\d+)/);
|
|
237
|
+
const inactive = vmstat.match(/Pages inactive:\s+(\d+)/);
|
|
238
|
+
const speculative = vmstat.match(/Pages speculative:\s+(\d+)/);
|
|
239
|
+
const freePages = free ? parseInt(free[1], 10) : 0;
|
|
240
|
+
const inactivePages = inactive ? parseInt(inactive[1], 10) : 0;
|
|
241
|
+
const speculativePages = speculative ? parseInt(speculative[1], 10) : 0;
|
|
242
|
+
return (freePages + inactivePages + speculativePages) * actualPageSize / (1024 * 1024 * 1024);
|
|
243
|
+
} catch {
|
|
244
|
+
return os2.freemem() / (1024 * 1024 * 1024);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return os2.freemem() / (1024 * 1024 * 1024);
|
|
248
|
+
}
|
|
221
249
|
function spawnDaemon() {
|
|
222
|
-
const freeGB =
|
|
250
|
+
const freeGB = getAvailableMemoryGB();
|
|
223
251
|
const totalGB = os2.totalmem() / (1024 * 1024 * 1024);
|
|
224
252
|
if (totalGB <= 8) {
|
|
225
253
|
process.stderr.write(
|
|
@@ -228,9 +256,9 @@ function spawnDaemon() {
|
|
|
228
256
|
);
|
|
229
257
|
return;
|
|
230
258
|
}
|
|
231
|
-
if (totalGB <= 16 && freeGB <
|
|
259
|
+
if (totalGB <= 16 && freeGB < 2) {
|
|
232
260
|
process.stderr.write(
|
|
233
|
-
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB
|
|
261
|
+
`[exed-client] SKIP: low memory (${freeGB.toFixed(1)}GB available / ${totalGB.toFixed(0)}GB total). Embedding daemon not started \u2014 using keyword search only.
|
|
234
262
|
`
|
|
235
263
|
);
|
|
236
264
|
return;
|