@askexenow/exe-os 0.9.8 → 0.9.9
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 +222 -49
- package/dist/bin/backfill-responses.js +221 -48
- package/dist/bin/backfill-vectors.js +225 -52
- package/dist/bin/cleanup-stale-review-tasks.js +150 -28
- package/dist/bin/cli.js +1295 -856
- package/dist/bin/exe-agent-config.js +36 -8
- package/dist/bin/exe-agent.js +14 -4
- package/dist/bin/exe-assign.js +221 -48
- package/dist/bin/exe-boot.js +778 -427
- package/dist/bin/exe-call.js +41 -13
- package/dist/bin/exe-cloud.js +163 -58
- package/dist/bin/exe-dispatch.js +276 -139
- package/dist/bin/exe-doctor.js +145 -27
- package/dist/bin/exe-export-behaviors.js +141 -23
- package/dist/bin/exe-forget.js +137 -19
- package/dist/bin/exe-gateway.js +677 -388
- package/dist/bin/exe-heartbeat.js +227 -108
- package/dist/bin/exe-kill.js +138 -20
- package/dist/bin/exe-launch-agent.js +172 -39
- package/dist/bin/exe-link.js +291 -100
- package/dist/bin/exe-new-employee.js +214 -106
- package/dist/bin/exe-pending-messages.js +395 -33
- package/dist/bin/exe-pending-notifications.js +684 -99
- package/dist/bin/exe-pending-reviews.js +420 -74
- package/dist/bin/exe-rename.js +147 -49
- package/dist/bin/exe-review.js +138 -20
- package/dist/bin/exe-search.js +240 -69
- package/dist/bin/exe-session-cleanup.js +440 -250
- package/dist/bin/exe-settings.js +61 -17
- package/dist/bin/exe-start-codex.js +158 -39
- package/dist/bin/exe-start-opencode.js +157 -38
- package/dist/bin/exe-status.js +151 -29
- package/dist/bin/exe-team.js +138 -20
- package/dist/bin/git-sweep.js +404 -212
- package/dist/bin/graph-backfill.js +137 -19
- package/dist/bin/graph-export.js +140 -22
- package/dist/bin/install.js +90 -61
- package/dist/bin/scan-tasks.js +412 -220
- package/dist/bin/setup.js +564 -293
- package/dist/bin/shard-migrate.js +139 -21
- package/dist/bin/update.js +138 -49
- package/dist/bin/wiki-sync.js +137 -19
- package/dist/gateway/index.js +533 -320
- package/dist/hooks/bug-report-worker.js +344 -193
- package/dist/hooks/codex-stop-task-finalizer.js +4678 -0
- package/dist/hooks/commit-complete.js +402 -210
- package/dist/hooks/error-recall.js +245 -74
- package/dist/hooks/exe-heartbeat-hook.js +16 -6
- package/dist/hooks/ingest-worker.js +3423 -3157
- package/dist/hooks/ingest.js +832 -97
- package/dist/hooks/instructions-loaded.js +227 -54
- package/dist/hooks/notification.js +216 -43
- package/dist/hooks/post-compact.js +239 -62
- package/dist/hooks/pre-compact.js +408 -216
- package/dist/hooks/pre-tool-use.js +268 -90
- package/dist/hooks/prompt-ingest-worker.js +352 -102
- package/dist/hooks/prompt-submit.js +541 -328
- package/dist/hooks/response-ingest-worker.js +372 -122
- package/dist/hooks/session-end.js +443 -240
- package/dist/hooks/session-start.js +313 -127
- package/dist/hooks/stop.js +293 -98
- package/dist/hooks/subagent-stop.js +239 -62
- package/dist/hooks/summary-worker.js +568 -236
- package/dist/index.js +538 -324
- package/dist/lib/agent-config.js +28 -6
- package/dist/lib/cloud-sync.js +284 -105
- package/dist/lib/config.js +30 -10
- package/dist/lib/consolidation.js +16 -6
- package/dist/lib/database.js +123 -25
- package/dist/lib/db-daemon-client.js +73 -19
- package/dist/lib/db.js +123 -25
- package/dist/lib/device-registry.js +133 -35
- package/dist/lib/embedder.js +107 -32
- package/dist/lib/employee-templates.js +14 -4
- package/dist/lib/employees.js +41 -13
- package/dist/lib/exe-daemon-client.js +88 -22
- package/dist/lib/exe-daemon.js +935 -587
- package/dist/lib/hybrid-search.js +240 -69
- package/dist/lib/identity.js +18 -8
- package/dist/lib/license.js +133 -48
- package/dist/lib/messaging.js +116 -56
- package/dist/lib/reminders.js +14 -4
- package/dist/lib/schedules.js +137 -19
- package/dist/lib/skill-learning.js +33 -6
- package/dist/lib/store.js +137 -19
- package/dist/lib/task-router.js +14 -4
- package/dist/lib/tasks.js +280 -234
- package/dist/lib/tmux-routing.js +172 -125
- package/dist/lib/token-spend.js +26 -8
- package/dist/mcp/server.js +1326 -609
- package/dist/mcp/tools/complete-reminder.js +14 -4
- package/dist/mcp/tools/create-reminder.js +14 -4
- package/dist/mcp/tools/create-task.js +306 -248
- package/dist/mcp/tools/deactivate-behavior.js +16 -6
- package/dist/mcp/tools/list-reminders.js +14 -4
- package/dist/mcp/tools/list-tasks.js +123 -107
- package/dist/mcp/tools/send-message.js +75 -29
- package/dist/mcp/tools/update-task.js +1848 -199
- package/dist/runtime/index.js +441 -248
- package/dist/tui/App.js +761 -424
- package/package.json +1 -1
package/dist/bin/exe-status.js
CHANGED
|
@@ -20,9 +20,34 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
20
|
};
|
|
21
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
22
|
|
|
23
|
+
// src/lib/secure-files.ts
|
|
24
|
+
import { chmodSync, existsSync, mkdirSync } from "fs";
|
|
25
|
+
import { chmod, mkdir } from "fs/promises";
|
|
26
|
+
async function ensurePrivateDir(dirPath) {
|
|
27
|
+
await mkdir(dirPath, { recursive: true, mode: PRIVATE_DIR_MODE });
|
|
28
|
+
try {
|
|
29
|
+
await chmod(dirPath, PRIVATE_DIR_MODE);
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function enforcePrivateFile(filePath) {
|
|
34
|
+
try {
|
|
35
|
+
await chmod(filePath, PRIVATE_FILE_MODE);
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
var PRIVATE_DIR_MODE, PRIVATE_FILE_MODE;
|
|
40
|
+
var init_secure_files = __esm({
|
|
41
|
+
"src/lib/secure-files.ts"() {
|
|
42
|
+
"use strict";
|
|
43
|
+
PRIVATE_DIR_MODE = 448;
|
|
44
|
+
PRIVATE_FILE_MODE = 384;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
23
48
|
// src/lib/config.ts
|
|
24
|
-
import { readFile, writeFile
|
|
25
|
-
import { readFileSync, existsSync, renameSync } from "fs";
|
|
49
|
+
import { readFile, writeFile } from "fs/promises";
|
|
50
|
+
import { readFileSync, existsSync as existsSync2, renameSync } from "fs";
|
|
26
51
|
import path from "path";
|
|
27
52
|
import os from "os";
|
|
28
53
|
function resolveDataDir() {
|
|
@@ -30,7 +55,7 @@ function resolveDataDir() {
|
|
|
30
55
|
if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
|
|
31
56
|
const newDir = path.join(os.homedir(), ".exe-os");
|
|
32
57
|
const legacyDir = path.join(os.homedir(), ".exe-mem");
|
|
33
|
-
if (!
|
|
58
|
+
if (!existsSync2(newDir) && existsSync2(legacyDir)) {
|
|
34
59
|
try {
|
|
35
60
|
renameSync(legacyDir, newDir);
|
|
36
61
|
process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
|
|
@@ -93,9 +118,9 @@ function normalizeAutoUpdate(raw) {
|
|
|
93
118
|
}
|
|
94
119
|
async function loadConfig() {
|
|
95
120
|
const dir = process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? EXE_AI_DIR;
|
|
96
|
-
await
|
|
121
|
+
await ensurePrivateDir(dir);
|
|
97
122
|
const configPath = path.join(dir, "config.json");
|
|
98
|
-
if (!
|
|
123
|
+
if (!existsSync2(configPath)) {
|
|
99
124
|
return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
|
|
100
125
|
}
|
|
101
126
|
const raw = await readFile(configPath, "utf-8");
|
|
@@ -108,6 +133,7 @@ async function loadConfig() {
|
|
|
108
133
|
`);
|
|
109
134
|
try {
|
|
110
135
|
await writeFile(configPath, JSON.stringify(migratedCfg, null, 2) + "\n");
|
|
136
|
+
await enforcePrivateFile(configPath);
|
|
111
137
|
} catch {
|
|
112
138
|
}
|
|
113
139
|
}
|
|
@@ -127,6 +153,7 @@ var EXE_AI_DIR, DB_PATH, MODELS_DIR, CONFIG_PATH, LEGACY_LANCE_PATH, CURRENT_CON
|
|
|
127
153
|
var init_config = __esm({
|
|
128
154
|
"src/lib/config.ts"() {
|
|
129
155
|
"use strict";
|
|
156
|
+
init_secure_files();
|
|
130
157
|
EXE_AI_DIR = resolveDataDir();
|
|
131
158
|
DB_PATH = path.join(EXE_AI_DIR, "memories.db");
|
|
132
159
|
MODELS_DIR = path.join(EXE_AI_DIR, "models");
|
|
@@ -205,7 +232,7 @@ var init_config = __esm({
|
|
|
205
232
|
|
|
206
233
|
// src/lib/employees.ts
|
|
207
234
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
208
|
-
import { existsSync as
|
|
235
|
+
import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync, writeFileSync } from "fs";
|
|
209
236
|
import { execSync } from "child_process";
|
|
210
237
|
import path2 from "path";
|
|
211
238
|
import os2 from "os";
|
|
@@ -222,7 +249,7 @@ function getCoordinatorName(employees = loadEmployeesSync()) {
|
|
|
222
249
|
return getCoordinatorEmployee(employees)?.name ?? DEFAULT_COORDINATOR_TEMPLATE_NAME;
|
|
223
250
|
}
|
|
224
251
|
async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
|
|
225
|
-
if (!
|
|
252
|
+
if (!existsSync3(employeesPath)) {
|
|
226
253
|
return [];
|
|
227
254
|
}
|
|
228
255
|
const raw = await readFile2(employeesPath, "utf-8");
|
|
@@ -233,7 +260,7 @@ async function loadEmployees(employeesPath = EMPLOYEES_PATH) {
|
|
|
233
260
|
}
|
|
234
261
|
}
|
|
235
262
|
function loadEmployeesSync(employeesPath = EMPLOYEES_PATH) {
|
|
236
|
-
if (!
|
|
263
|
+
if (!existsSync3(employeesPath)) return [];
|
|
237
264
|
try {
|
|
238
265
|
return JSON.parse(readFileSync2(employeesPath, "utf-8"));
|
|
239
266
|
} catch {
|
|
@@ -1233,6 +1260,7 @@ async function ensureSchema() {
|
|
|
1233
1260
|
project TEXT NOT NULL,
|
|
1234
1261
|
summary TEXT NOT NULL,
|
|
1235
1262
|
task_file TEXT,
|
|
1263
|
+
session_scope TEXT,
|
|
1236
1264
|
read INTEGER NOT NULL DEFAULT 0,
|
|
1237
1265
|
created_at TEXT NOT NULL
|
|
1238
1266
|
);
|
|
@@ -1241,7 +1269,7 @@ async function ensureSchema() {
|
|
|
1241
1269
|
ON notifications(read);
|
|
1242
1270
|
|
|
1243
1271
|
CREATE INDEX IF NOT EXISTS idx_notifications_agent
|
|
1244
|
-
ON notifications(agent_id);
|
|
1272
|
+
ON notifications(agent_id, session_scope);
|
|
1245
1273
|
|
|
1246
1274
|
CREATE INDEX IF NOT EXISTS idx_notifications_task_file
|
|
1247
1275
|
ON notifications(task_file);
|
|
@@ -1279,6 +1307,7 @@ async function ensureSchema() {
|
|
|
1279
1307
|
target_agent TEXT NOT NULL,
|
|
1280
1308
|
target_project TEXT,
|
|
1281
1309
|
target_device TEXT NOT NULL DEFAULT 'local',
|
|
1310
|
+
session_scope TEXT,
|
|
1282
1311
|
content TEXT NOT NULL,
|
|
1283
1312
|
priority TEXT DEFAULT 'normal',
|
|
1284
1313
|
status TEXT DEFAULT 'pending',
|
|
@@ -1292,10 +1321,31 @@ async function ensureSchema() {
|
|
|
1292
1321
|
);
|
|
1293
1322
|
|
|
1294
1323
|
CREATE INDEX IF NOT EXISTS idx_messages_target
|
|
1295
|
-
ON messages(target_agent, status);
|
|
1324
|
+
ON messages(target_agent, session_scope, status);
|
|
1296
1325
|
|
|
1297
1326
|
CREATE INDEX IF NOT EXISTS idx_messages_conversation_order
|
|
1298
|
-
ON messages(target_agent, from_agent, server_seq);
|
|
1327
|
+
ON messages(target_agent, session_scope, from_agent, server_seq);
|
|
1328
|
+
`);
|
|
1329
|
+
try {
|
|
1330
|
+
await client.execute({
|
|
1331
|
+
sql: `ALTER TABLE notifications ADD COLUMN session_scope TEXT`,
|
|
1332
|
+
args: []
|
|
1333
|
+
});
|
|
1334
|
+
} catch {
|
|
1335
|
+
}
|
|
1336
|
+
try {
|
|
1337
|
+
await client.execute({
|
|
1338
|
+
sql: `ALTER TABLE messages ADD COLUMN session_scope TEXT`,
|
|
1339
|
+
args: []
|
|
1340
|
+
});
|
|
1341
|
+
} catch {
|
|
1342
|
+
}
|
|
1343
|
+
await client.executeMultiple(`
|
|
1344
|
+
CREATE INDEX IF NOT EXISTS idx_notifications_agent_scope_read
|
|
1345
|
+
ON notifications(agent_id, session_scope, read, created_at);
|
|
1346
|
+
|
|
1347
|
+
CREATE INDEX IF NOT EXISTS idx_messages_target_scope_status
|
|
1348
|
+
ON messages(target_agent, session_scope, status, created_at);
|
|
1299
1349
|
`);
|
|
1300
1350
|
try {
|
|
1301
1351
|
await client.execute({
|
|
@@ -1879,6 +1929,13 @@ async function ensureSchema() {
|
|
|
1879
1929
|
} catch {
|
|
1880
1930
|
}
|
|
1881
1931
|
}
|
|
1932
|
+
try {
|
|
1933
|
+
await client.execute({
|
|
1934
|
+
sql: `UPDATE tasks SET status = 'closed' WHERE status = 'done' AND result IS NOT NULL`,
|
|
1935
|
+
args: []
|
|
1936
|
+
});
|
|
1937
|
+
} catch {
|
|
1938
|
+
}
|
|
1882
1939
|
}
|
|
1883
1940
|
var _client, _resilientClient, _walCheckpointTimer, _daemonClient, _adapterClient, initTurso;
|
|
1884
1941
|
var init_database = __esm({
|
|
@@ -1956,6 +2013,7 @@ var shard_manager_exports = {};
|
|
|
1956
2013
|
__export(shard_manager_exports, {
|
|
1957
2014
|
disposeShards: () => disposeShards,
|
|
1958
2015
|
ensureShardSchema: () => ensureShardSchema,
|
|
2016
|
+
getOpenShardCount: () => getOpenShardCount,
|
|
1959
2017
|
getReadyShardClient: () => getReadyShardClient,
|
|
1960
2018
|
getShardClient: () => getShardClient,
|
|
1961
2019
|
getShardsDir: () => getShardsDir,
|
|
@@ -1965,14 +2023,17 @@ __export(shard_manager_exports, {
|
|
|
1965
2023
|
shardExists: () => shardExists
|
|
1966
2024
|
});
|
|
1967
2025
|
import path5 from "path";
|
|
1968
|
-
import { existsSync as
|
|
2026
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readdirSync } from "fs";
|
|
1969
2027
|
import { createClient as createClient2 } from "@libsql/client";
|
|
1970
2028
|
function initShardManager(encryptionKey) {
|
|
1971
2029
|
_encryptionKey = encryptionKey;
|
|
1972
|
-
if (!
|
|
1973
|
-
|
|
2030
|
+
if (!existsSync5(SHARDS_DIR)) {
|
|
2031
|
+
mkdirSync2(SHARDS_DIR, { recursive: true });
|
|
1974
2032
|
}
|
|
1975
2033
|
_shardingEnabled = true;
|
|
2034
|
+
if (_evictionTimer) clearInterval(_evictionTimer);
|
|
2035
|
+
_evictionTimer = setInterval(evictIdleShards, EVICTION_INTERVAL_MS);
|
|
2036
|
+
_evictionTimer.unref();
|
|
1976
2037
|
}
|
|
1977
2038
|
function isShardingEnabled() {
|
|
1978
2039
|
return _shardingEnabled;
|
|
@@ -1989,21 +2050,28 @@ function getShardClient(projectName) {
|
|
|
1989
2050
|
throw new Error(`Invalid project name for shard: "${projectName}"`);
|
|
1990
2051
|
}
|
|
1991
2052
|
const cached = _shards.get(safeName);
|
|
1992
|
-
if (cached)
|
|
2053
|
+
if (cached) {
|
|
2054
|
+
_shardLastAccess.set(safeName, Date.now());
|
|
2055
|
+
return cached;
|
|
2056
|
+
}
|
|
2057
|
+
while (_shards.size >= MAX_OPEN_SHARDS) {
|
|
2058
|
+
evictLRU();
|
|
2059
|
+
}
|
|
1993
2060
|
const dbPath = path5.join(SHARDS_DIR, `${safeName}.db`);
|
|
1994
2061
|
const client = createClient2({
|
|
1995
2062
|
url: `file:${dbPath}`,
|
|
1996
2063
|
encryptionKey: _encryptionKey
|
|
1997
2064
|
});
|
|
1998
2065
|
_shards.set(safeName, client);
|
|
2066
|
+
_shardLastAccess.set(safeName, Date.now());
|
|
1999
2067
|
return client;
|
|
2000
2068
|
}
|
|
2001
2069
|
function shardExists(projectName) {
|
|
2002
2070
|
const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
2003
|
-
return
|
|
2071
|
+
return existsSync5(path5.join(SHARDS_DIR, `${safeName}.db`));
|
|
2004
2072
|
}
|
|
2005
2073
|
function listShards() {
|
|
2006
|
-
if (!
|
|
2074
|
+
if (!existsSync5(SHARDS_DIR)) return [];
|
|
2007
2075
|
return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
|
|
2008
2076
|
}
|
|
2009
2077
|
async function ensureShardSchema(client) {
|
|
@@ -2055,6 +2123,8 @@ async function ensureShardSchema(client) {
|
|
|
2055
2123
|
for (const col of [
|
|
2056
2124
|
"ALTER TABLE memories ADD COLUMN task_id TEXT",
|
|
2057
2125
|
"ALTER TABLE memories ADD COLUMN consolidated INTEGER NOT NULL DEFAULT 0",
|
|
2126
|
+
"ALTER TABLE memories ADD COLUMN author_device_id TEXT",
|
|
2127
|
+
"ALTER TABLE memories ADD COLUMN scope TEXT NOT NULL DEFAULT 'business'",
|
|
2058
2128
|
"ALTER TABLE memories ADD COLUMN importance INTEGER DEFAULT 5",
|
|
2059
2129
|
"ALTER TABLE memories ADD COLUMN status TEXT DEFAULT 'active'",
|
|
2060
2130
|
"ALTER TABLE memories ADD COLUMN wiki_synced INTEGER DEFAULT 0",
|
|
@@ -2192,21 +2262,69 @@ async function getReadyShardClient(projectName) {
|
|
|
2192
2262
|
await ensureShardSchema(client);
|
|
2193
2263
|
return client;
|
|
2194
2264
|
}
|
|
2265
|
+
function evictLRU() {
|
|
2266
|
+
let oldest = null;
|
|
2267
|
+
let oldestTime = Infinity;
|
|
2268
|
+
for (const [name, time] of _shardLastAccess) {
|
|
2269
|
+
if (time < oldestTime) {
|
|
2270
|
+
oldestTime = time;
|
|
2271
|
+
oldest = name;
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
if (oldest) {
|
|
2275
|
+
const client = _shards.get(oldest);
|
|
2276
|
+
if (client) {
|
|
2277
|
+
client.close();
|
|
2278
|
+
}
|
|
2279
|
+
_shards.delete(oldest);
|
|
2280
|
+
_shardLastAccess.delete(oldest);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
function evictIdleShards() {
|
|
2284
|
+
const now = Date.now();
|
|
2285
|
+
const toEvict = [];
|
|
2286
|
+
for (const [name, lastAccess] of _shardLastAccess) {
|
|
2287
|
+
if (now - lastAccess > SHARD_IDLE_MS) {
|
|
2288
|
+
toEvict.push(name);
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
for (const name of toEvict) {
|
|
2292
|
+
const client = _shards.get(name);
|
|
2293
|
+
if (client) {
|
|
2294
|
+
client.close();
|
|
2295
|
+
}
|
|
2296
|
+
_shards.delete(name);
|
|
2297
|
+
_shardLastAccess.delete(name);
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
function getOpenShardCount() {
|
|
2301
|
+
return _shards.size;
|
|
2302
|
+
}
|
|
2195
2303
|
function disposeShards() {
|
|
2304
|
+
if (_evictionTimer) {
|
|
2305
|
+
clearInterval(_evictionTimer);
|
|
2306
|
+
_evictionTimer = null;
|
|
2307
|
+
}
|
|
2196
2308
|
for (const [, client] of _shards) {
|
|
2197
2309
|
client.close();
|
|
2198
2310
|
}
|
|
2199
2311
|
_shards.clear();
|
|
2312
|
+
_shardLastAccess.clear();
|
|
2200
2313
|
_shardingEnabled = false;
|
|
2201
2314
|
_encryptionKey = null;
|
|
2202
2315
|
}
|
|
2203
|
-
var SHARDS_DIR, _shards, _encryptionKey, _shardingEnabled;
|
|
2316
|
+
var SHARDS_DIR, SHARD_IDLE_MS, MAX_OPEN_SHARDS, EVICTION_INTERVAL_MS, _shards, _shardLastAccess, _evictionTimer, _encryptionKey, _shardingEnabled;
|
|
2204
2317
|
var init_shard_manager = __esm({
|
|
2205
2318
|
"src/lib/shard-manager.ts"() {
|
|
2206
2319
|
"use strict";
|
|
2207
2320
|
init_config();
|
|
2208
2321
|
SHARDS_DIR = path5.join(EXE_AI_DIR, "shards");
|
|
2322
|
+
SHARD_IDLE_MS = 5 * 60 * 1e3;
|
|
2323
|
+
MAX_OPEN_SHARDS = 10;
|
|
2324
|
+
EVICTION_INTERVAL_MS = 60 * 1e3;
|
|
2209
2325
|
_shards = /* @__PURE__ */ new Map();
|
|
2326
|
+
_shardLastAccess = /* @__PURE__ */ new Map();
|
|
2327
|
+
_evictionTimer = null;
|
|
2210
2328
|
_encryptionKey = null;
|
|
2211
2329
|
_shardingEnabled = false;
|
|
2212
2330
|
}
|
|
@@ -2641,7 +2759,7 @@ var init_runtime_table = __esm({
|
|
|
2641
2759
|
});
|
|
2642
2760
|
|
|
2643
2761
|
// src/lib/agent-config.ts
|
|
2644
|
-
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as
|
|
2762
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync6 } from "fs";
|
|
2645
2763
|
import path7 from "path";
|
|
2646
2764
|
var AGENT_CONFIG_PATH, DEFAULT_MODELS;
|
|
2647
2765
|
var init_agent_config = __esm({
|
|
@@ -2649,6 +2767,7 @@ var init_agent_config = __esm({
|
|
|
2649
2767
|
"use strict";
|
|
2650
2768
|
init_config();
|
|
2651
2769
|
init_runtime_table();
|
|
2770
|
+
init_secure_files();
|
|
2652
2771
|
AGENT_CONFIG_PATH = path7.join(EXE_AI_DIR, "agent-config.json");
|
|
2653
2772
|
DEFAULT_MODELS = {
|
|
2654
2773
|
claude: "claude-opus-4",
|
|
@@ -2659,7 +2778,7 @@ var init_agent_config = __esm({
|
|
|
2659
2778
|
});
|
|
2660
2779
|
|
|
2661
2780
|
// src/lib/intercom-queue.ts
|
|
2662
|
-
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as
|
|
2781
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as existsSync7, mkdirSync as mkdirSync3 } from "fs";
|
|
2663
2782
|
import path8 from "path";
|
|
2664
2783
|
import os6 from "os";
|
|
2665
2784
|
var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
|
|
@@ -2673,8 +2792,11 @@ var init_intercom_queue = __esm({
|
|
|
2673
2792
|
});
|
|
2674
2793
|
|
|
2675
2794
|
// src/lib/license.ts
|
|
2676
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as
|
|
2795
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync8, mkdirSync as mkdirSync4 } from "fs";
|
|
2677
2796
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2797
|
+
import { createRequire as createRequire2 } from "module";
|
|
2798
|
+
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
2799
|
+
import os7 from "os";
|
|
2678
2800
|
import path9 from "path";
|
|
2679
2801
|
import { jwtVerify, importSPKI } from "jose";
|
|
2680
2802
|
var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH;
|
|
@@ -2689,7 +2811,7 @@ var init_license = __esm({
|
|
|
2689
2811
|
});
|
|
2690
2812
|
|
|
2691
2813
|
// src/lib/plan-limits.ts
|
|
2692
|
-
import { readFileSync as readFileSync6, existsSync as
|
|
2814
|
+
import { readFileSync as readFileSync6, existsSync as existsSync9 } from "fs";
|
|
2693
2815
|
import path10 from "path";
|
|
2694
2816
|
var CACHE_PATH2;
|
|
2695
2817
|
var init_plan_limits = __esm({
|
|
@@ -2704,9 +2826,9 @@ var init_plan_limits = __esm({
|
|
|
2704
2826
|
});
|
|
2705
2827
|
|
|
2706
2828
|
// src/lib/tmux-routing.ts
|
|
2707
|
-
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as
|
|
2829
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync10, appendFileSync, readdirSync as readdirSync2 } from "fs";
|
|
2708
2830
|
import path11 from "path";
|
|
2709
|
-
import
|
|
2831
|
+
import os8 from "os";
|
|
2710
2832
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2711
2833
|
function getMySession() {
|
|
2712
2834
|
return getTransport().getMySession();
|
|
@@ -2762,9 +2884,9 @@ var init_tmux_routing = __esm({
|
|
|
2762
2884
|
init_intercom_queue();
|
|
2763
2885
|
init_plan_limits();
|
|
2764
2886
|
init_employees();
|
|
2765
|
-
SPAWN_LOCK_DIR = path11.join(
|
|
2766
|
-
SESSION_CACHE = path11.join(
|
|
2767
|
-
INTERCOM_LOG2 = path11.join(
|
|
2887
|
+
SPAWN_LOCK_DIR = path11.join(os8.homedir(), ".exe-os", "spawn-locks");
|
|
2888
|
+
SESSION_CACHE = path11.join(os8.homedir(), ".exe-os", "session-cache");
|
|
2889
|
+
INTERCOM_LOG2 = path11.join(os8.homedir(), ".exe-os", "intercom.log");
|
|
2768
2890
|
DEBOUNCE_FILE = path11.join(SESSION_CACHE, "intercom-debounce.json");
|
|
2769
2891
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
2770
2892
|
}
|
|
@@ -2803,7 +2925,7 @@ init_database();
|
|
|
2803
2925
|
|
|
2804
2926
|
// src/lib/keychain.ts
|
|
2805
2927
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
2806
|
-
import { existsSync as
|
|
2928
|
+
import { existsSync as existsSync4 } from "fs";
|
|
2807
2929
|
import path4 from "path";
|
|
2808
2930
|
import os4 from "os";
|
|
2809
2931
|
var SERVICE = "exe-mem";
|
|
@@ -2833,7 +2955,7 @@ async function getMasterKey() {
|
|
|
2833
2955
|
}
|
|
2834
2956
|
}
|
|
2835
2957
|
const keyPath = getKeyPath();
|
|
2836
|
-
if (!
|
|
2958
|
+
if (!existsSync4(keyPath)) {
|
|
2837
2959
|
process.stderr.write(
|
|
2838
2960
|
`[keychain] Key not found at ${keyPath} (HOME=${os4.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
|
|
2839
2961
|
`
|