@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
|
@@ -75,9 +75,34 @@ var init_db_retry = __esm({
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
+
// src/lib/secure-files.ts
|
|
79
|
+
import { chmodSync, existsSync, mkdirSync } from "fs";
|
|
80
|
+
import { chmod, mkdir } from "fs/promises";
|
|
81
|
+
async function ensurePrivateDir(dirPath) {
|
|
82
|
+
await mkdir(dirPath, { recursive: true, mode: PRIVATE_DIR_MODE });
|
|
83
|
+
try {
|
|
84
|
+
await chmod(dirPath, PRIVATE_DIR_MODE);
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function enforcePrivateFile(filePath) {
|
|
89
|
+
try {
|
|
90
|
+
await chmod(filePath, PRIVATE_FILE_MODE);
|
|
91
|
+
} catch {
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
var PRIVATE_DIR_MODE, PRIVATE_FILE_MODE;
|
|
95
|
+
var init_secure_files = __esm({
|
|
96
|
+
"src/lib/secure-files.ts"() {
|
|
97
|
+
"use strict";
|
|
98
|
+
PRIVATE_DIR_MODE = 448;
|
|
99
|
+
PRIVATE_FILE_MODE = 384;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
78
103
|
// src/lib/config.ts
|
|
79
|
-
import { readFile, writeFile
|
|
80
|
-
import { readFileSync, existsSync, renameSync } from "fs";
|
|
104
|
+
import { readFile, writeFile } from "fs/promises";
|
|
105
|
+
import { readFileSync, existsSync as existsSync2, renameSync } from "fs";
|
|
81
106
|
import path from "path";
|
|
82
107
|
import os from "os";
|
|
83
108
|
function resolveDataDir() {
|
|
@@ -85,7 +110,7 @@ function resolveDataDir() {
|
|
|
85
110
|
if (process.env.EXE_MEM_DIR) return process.env.EXE_MEM_DIR;
|
|
86
111
|
const newDir = path.join(os.homedir(), ".exe-os");
|
|
87
112
|
const legacyDir = path.join(os.homedir(), ".exe-mem");
|
|
88
|
-
if (!
|
|
113
|
+
if (!existsSync2(newDir) && existsSync2(legacyDir)) {
|
|
89
114
|
try {
|
|
90
115
|
renameSync(legacyDir, newDir);
|
|
91
116
|
process.stderr.write(`[exe-os] Migrated data directory: ~/.exe-mem \u2192 ~/.exe-os
|
|
@@ -148,9 +173,9 @@ function normalizeAutoUpdate(raw) {
|
|
|
148
173
|
}
|
|
149
174
|
async function loadConfig() {
|
|
150
175
|
const dir = process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? EXE_AI_DIR;
|
|
151
|
-
await
|
|
176
|
+
await ensurePrivateDir(dir);
|
|
152
177
|
const configPath = path.join(dir, "config.json");
|
|
153
|
-
if (!
|
|
178
|
+
if (!existsSync2(configPath)) {
|
|
154
179
|
return { ...DEFAULT_CONFIG, dbPath: path.join(dir, "memories.db") };
|
|
155
180
|
}
|
|
156
181
|
const raw = await readFile(configPath, "utf-8");
|
|
@@ -163,6 +188,7 @@ async function loadConfig() {
|
|
|
163
188
|
`);
|
|
164
189
|
try {
|
|
165
190
|
await writeFile(configPath, JSON.stringify(migratedCfg, null, 2) + "\n");
|
|
191
|
+
await enforcePrivateFile(configPath);
|
|
166
192
|
} catch {
|
|
167
193
|
}
|
|
168
194
|
}
|
|
@@ -182,6 +208,7 @@ var EXE_AI_DIR, DB_PATH, MODELS_DIR, CONFIG_PATH, LEGACY_LANCE_PATH, CURRENT_CON
|
|
|
182
208
|
var init_config = __esm({
|
|
183
209
|
"src/lib/config.ts"() {
|
|
184
210
|
"use strict";
|
|
211
|
+
init_secure_files();
|
|
185
212
|
EXE_AI_DIR = resolveDataDir();
|
|
186
213
|
DB_PATH = path.join(EXE_AI_DIR, "memories.db");
|
|
187
214
|
MODELS_DIR = path.join(EXE_AI_DIR, "models");
|
|
@@ -260,7 +287,7 @@ var init_config = __esm({
|
|
|
260
287
|
|
|
261
288
|
// src/lib/employees.ts
|
|
262
289
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
263
|
-
import { existsSync as
|
|
290
|
+
import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync, writeFileSync } from "fs";
|
|
264
291
|
import { execSync } from "child_process";
|
|
265
292
|
import path2 from "path";
|
|
266
293
|
import os2 from "os";
|
|
@@ -277,7 +304,7 @@ function getCoordinatorName(employees = loadEmployeesSync()) {
|
|
|
277
304
|
return getCoordinatorEmployee(employees)?.name ?? DEFAULT_COORDINATOR_TEMPLATE_NAME;
|
|
278
305
|
}
|
|
279
306
|
function loadEmployeesSync(employeesPath = EMPLOYEES_PATH) {
|
|
280
|
-
if (!
|
|
307
|
+
if (!existsSync3(employeesPath)) return [];
|
|
281
308
|
try {
|
|
282
309
|
return JSON.parse(readFileSync2(employeesPath, "utf-8"));
|
|
283
310
|
} catch {
|
|
@@ -1222,6 +1249,7 @@ async function ensureSchema() {
|
|
|
1222
1249
|
project TEXT NOT NULL,
|
|
1223
1250
|
summary TEXT NOT NULL,
|
|
1224
1251
|
task_file TEXT,
|
|
1252
|
+
session_scope TEXT,
|
|
1225
1253
|
read INTEGER NOT NULL DEFAULT 0,
|
|
1226
1254
|
created_at TEXT NOT NULL
|
|
1227
1255
|
);
|
|
@@ -1230,7 +1258,7 @@ async function ensureSchema() {
|
|
|
1230
1258
|
ON notifications(read);
|
|
1231
1259
|
|
|
1232
1260
|
CREATE INDEX IF NOT EXISTS idx_notifications_agent
|
|
1233
|
-
ON notifications(agent_id);
|
|
1261
|
+
ON notifications(agent_id, session_scope);
|
|
1234
1262
|
|
|
1235
1263
|
CREATE INDEX IF NOT EXISTS idx_notifications_task_file
|
|
1236
1264
|
ON notifications(task_file);
|
|
@@ -1268,6 +1296,7 @@ async function ensureSchema() {
|
|
|
1268
1296
|
target_agent TEXT NOT NULL,
|
|
1269
1297
|
target_project TEXT,
|
|
1270
1298
|
target_device TEXT NOT NULL DEFAULT 'local',
|
|
1299
|
+
session_scope TEXT,
|
|
1271
1300
|
content TEXT NOT NULL,
|
|
1272
1301
|
priority TEXT DEFAULT 'normal',
|
|
1273
1302
|
status TEXT DEFAULT 'pending',
|
|
@@ -1281,10 +1310,31 @@ async function ensureSchema() {
|
|
|
1281
1310
|
);
|
|
1282
1311
|
|
|
1283
1312
|
CREATE INDEX IF NOT EXISTS idx_messages_target
|
|
1284
|
-
ON messages(target_agent, status);
|
|
1313
|
+
ON messages(target_agent, session_scope, status);
|
|
1285
1314
|
|
|
1286
1315
|
CREATE INDEX IF NOT EXISTS idx_messages_conversation_order
|
|
1287
|
-
ON messages(target_agent, from_agent, server_seq);
|
|
1316
|
+
ON messages(target_agent, session_scope, from_agent, server_seq);
|
|
1317
|
+
`);
|
|
1318
|
+
try {
|
|
1319
|
+
await client.execute({
|
|
1320
|
+
sql: `ALTER TABLE notifications ADD COLUMN session_scope TEXT`,
|
|
1321
|
+
args: []
|
|
1322
|
+
});
|
|
1323
|
+
} catch {
|
|
1324
|
+
}
|
|
1325
|
+
try {
|
|
1326
|
+
await client.execute({
|
|
1327
|
+
sql: `ALTER TABLE messages ADD COLUMN session_scope TEXT`,
|
|
1328
|
+
args: []
|
|
1329
|
+
});
|
|
1330
|
+
} catch {
|
|
1331
|
+
}
|
|
1332
|
+
await client.executeMultiple(`
|
|
1333
|
+
CREATE INDEX IF NOT EXISTS idx_notifications_agent_scope_read
|
|
1334
|
+
ON notifications(agent_id, session_scope, read, created_at);
|
|
1335
|
+
|
|
1336
|
+
CREATE INDEX IF NOT EXISTS idx_messages_target_scope_status
|
|
1337
|
+
ON messages(target_agent, session_scope, status, created_at);
|
|
1288
1338
|
`);
|
|
1289
1339
|
try {
|
|
1290
1340
|
await client.execute({
|
|
@@ -1868,6 +1918,13 @@ async function ensureSchema() {
|
|
|
1868
1918
|
} catch {
|
|
1869
1919
|
}
|
|
1870
1920
|
}
|
|
1921
|
+
try {
|
|
1922
|
+
await client.execute({
|
|
1923
|
+
sql: `UPDATE tasks SET status = 'closed' WHERE status = 'done' AND result IS NOT NULL`,
|
|
1924
|
+
args: []
|
|
1925
|
+
});
|
|
1926
|
+
} catch {
|
|
1927
|
+
}
|
|
1871
1928
|
}
|
|
1872
1929
|
var _client, _resilientClient, _walCheckpointTimer, _daemonClient, _adapterClient, initTurso;
|
|
1873
1930
|
var init_database = __esm({
|
|
@@ -1945,6 +2002,7 @@ var shard_manager_exports = {};
|
|
|
1945
2002
|
__export(shard_manager_exports, {
|
|
1946
2003
|
disposeShards: () => disposeShards,
|
|
1947
2004
|
ensureShardSchema: () => ensureShardSchema,
|
|
2005
|
+
getOpenShardCount: () => getOpenShardCount,
|
|
1948
2006
|
getReadyShardClient: () => getReadyShardClient,
|
|
1949
2007
|
getShardClient: () => getShardClient,
|
|
1950
2008
|
getShardsDir: () => getShardsDir,
|
|
@@ -1954,14 +2012,17 @@ __export(shard_manager_exports, {
|
|
|
1954
2012
|
shardExists: () => shardExists
|
|
1955
2013
|
});
|
|
1956
2014
|
import path5 from "path";
|
|
1957
|
-
import { existsSync as
|
|
2015
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readdirSync } from "fs";
|
|
1958
2016
|
import { createClient as createClient2 } from "@libsql/client";
|
|
1959
2017
|
function initShardManager(encryptionKey) {
|
|
1960
2018
|
_encryptionKey = encryptionKey;
|
|
1961
|
-
if (!
|
|
1962
|
-
|
|
2019
|
+
if (!existsSync5(SHARDS_DIR)) {
|
|
2020
|
+
mkdirSync2(SHARDS_DIR, { recursive: true });
|
|
1963
2021
|
}
|
|
1964
2022
|
_shardingEnabled = true;
|
|
2023
|
+
if (_evictionTimer) clearInterval(_evictionTimer);
|
|
2024
|
+
_evictionTimer = setInterval(evictIdleShards, EVICTION_INTERVAL_MS);
|
|
2025
|
+
_evictionTimer.unref();
|
|
1965
2026
|
}
|
|
1966
2027
|
function isShardingEnabled() {
|
|
1967
2028
|
return _shardingEnabled;
|
|
@@ -1978,21 +2039,28 @@ function getShardClient(projectName) {
|
|
|
1978
2039
|
throw new Error(`Invalid project name for shard: "${projectName}"`);
|
|
1979
2040
|
}
|
|
1980
2041
|
const cached = _shards.get(safeName);
|
|
1981
|
-
if (cached)
|
|
2042
|
+
if (cached) {
|
|
2043
|
+
_shardLastAccess.set(safeName, Date.now());
|
|
2044
|
+
return cached;
|
|
2045
|
+
}
|
|
2046
|
+
while (_shards.size >= MAX_OPEN_SHARDS) {
|
|
2047
|
+
evictLRU();
|
|
2048
|
+
}
|
|
1982
2049
|
const dbPath = path5.join(SHARDS_DIR, `${safeName}.db`);
|
|
1983
2050
|
const client = createClient2({
|
|
1984
2051
|
url: `file:${dbPath}`,
|
|
1985
2052
|
encryptionKey: _encryptionKey
|
|
1986
2053
|
});
|
|
1987
2054
|
_shards.set(safeName, client);
|
|
2055
|
+
_shardLastAccess.set(safeName, Date.now());
|
|
1988
2056
|
return client;
|
|
1989
2057
|
}
|
|
1990
2058
|
function shardExists(projectName) {
|
|
1991
2059
|
const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
1992
|
-
return
|
|
2060
|
+
return existsSync5(path5.join(SHARDS_DIR, `${safeName}.db`));
|
|
1993
2061
|
}
|
|
1994
2062
|
function listShards() {
|
|
1995
|
-
if (!
|
|
2063
|
+
if (!existsSync5(SHARDS_DIR)) return [];
|
|
1996
2064
|
return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
|
|
1997
2065
|
}
|
|
1998
2066
|
async function ensureShardSchema(client) {
|
|
@@ -2044,6 +2112,8 @@ async function ensureShardSchema(client) {
|
|
|
2044
2112
|
for (const col of [
|
|
2045
2113
|
"ALTER TABLE memories ADD COLUMN task_id TEXT",
|
|
2046
2114
|
"ALTER TABLE memories ADD COLUMN consolidated INTEGER NOT NULL DEFAULT 0",
|
|
2115
|
+
"ALTER TABLE memories ADD COLUMN author_device_id TEXT",
|
|
2116
|
+
"ALTER TABLE memories ADD COLUMN scope TEXT NOT NULL DEFAULT 'business'",
|
|
2047
2117
|
"ALTER TABLE memories ADD COLUMN importance INTEGER DEFAULT 5",
|
|
2048
2118
|
"ALTER TABLE memories ADD COLUMN status TEXT DEFAULT 'active'",
|
|
2049
2119
|
"ALTER TABLE memories ADD COLUMN wiki_synced INTEGER DEFAULT 0",
|
|
@@ -2181,21 +2251,69 @@ async function getReadyShardClient(projectName) {
|
|
|
2181
2251
|
await ensureShardSchema(client);
|
|
2182
2252
|
return client;
|
|
2183
2253
|
}
|
|
2254
|
+
function evictLRU() {
|
|
2255
|
+
let oldest = null;
|
|
2256
|
+
let oldestTime = Infinity;
|
|
2257
|
+
for (const [name, time] of _shardLastAccess) {
|
|
2258
|
+
if (time < oldestTime) {
|
|
2259
|
+
oldestTime = time;
|
|
2260
|
+
oldest = name;
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
if (oldest) {
|
|
2264
|
+
const client = _shards.get(oldest);
|
|
2265
|
+
if (client) {
|
|
2266
|
+
client.close();
|
|
2267
|
+
}
|
|
2268
|
+
_shards.delete(oldest);
|
|
2269
|
+
_shardLastAccess.delete(oldest);
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
function evictIdleShards() {
|
|
2273
|
+
const now = Date.now();
|
|
2274
|
+
const toEvict = [];
|
|
2275
|
+
for (const [name, lastAccess] of _shardLastAccess) {
|
|
2276
|
+
if (now - lastAccess > SHARD_IDLE_MS) {
|
|
2277
|
+
toEvict.push(name);
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
for (const name of toEvict) {
|
|
2281
|
+
const client = _shards.get(name);
|
|
2282
|
+
if (client) {
|
|
2283
|
+
client.close();
|
|
2284
|
+
}
|
|
2285
|
+
_shards.delete(name);
|
|
2286
|
+
_shardLastAccess.delete(name);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
function getOpenShardCount() {
|
|
2290
|
+
return _shards.size;
|
|
2291
|
+
}
|
|
2184
2292
|
function disposeShards() {
|
|
2293
|
+
if (_evictionTimer) {
|
|
2294
|
+
clearInterval(_evictionTimer);
|
|
2295
|
+
_evictionTimer = null;
|
|
2296
|
+
}
|
|
2185
2297
|
for (const [, client] of _shards) {
|
|
2186
2298
|
client.close();
|
|
2187
2299
|
}
|
|
2188
2300
|
_shards.clear();
|
|
2301
|
+
_shardLastAccess.clear();
|
|
2189
2302
|
_shardingEnabled = false;
|
|
2190
2303
|
_encryptionKey = null;
|
|
2191
2304
|
}
|
|
2192
|
-
var SHARDS_DIR, _shards, _encryptionKey, _shardingEnabled;
|
|
2305
|
+
var SHARDS_DIR, SHARD_IDLE_MS, MAX_OPEN_SHARDS, EVICTION_INTERVAL_MS, _shards, _shardLastAccess, _evictionTimer, _encryptionKey, _shardingEnabled;
|
|
2193
2306
|
var init_shard_manager = __esm({
|
|
2194
2307
|
"src/lib/shard-manager.ts"() {
|
|
2195
2308
|
"use strict";
|
|
2196
2309
|
init_config();
|
|
2197
2310
|
SHARDS_DIR = path5.join(EXE_AI_DIR, "shards");
|
|
2311
|
+
SHARD_IDLE_MS = 5 * 60 * 1e3;
|
|
2312
|
+
MAX_OPEN_SHARDS = 10;
|
|
2313
|
+
EVICTION_INTERVAL_MS = 60 * 1e3;
|
|
2198
2314
|
_shards = /* @__PURE__ */ new Map();
|
|
2315
|
+
_shardLastAccess = /* @__PURE__ */ new Map();
|
|
2316
|
+
_evictionTimer = null;
|
|
2199
2317
|
_encryptionKey = null;
|
|
2200
2318
|
_shardingEnabled = false;
|
|
2201
2319
|
}
|
|
@@ -2630,7 +2748,7 @@ var init_runtime_table = __esm({
|
|
|
2630
2748
|
});
|
|
2631
2749
|
|
|
2632
2750
|
// src/lib/agent-config.ts
|
|
2633
|
-
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as
|
|
2751
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync6 } from "fs";
|
|
2634
2752
|
import path7 from "path";
|
|
2635
2753
|
var AGENT_CONFIG_PATH, DEFAULT_MODELS;
|
|
2636
2754
|
var init_agent_config = __esm({
|
|
@@ -2638,6 +2756,7 @@ var init_agent_config = __esm({
|
|
|
2638
2756
|
"use strict";
|
|
2639
2757
|
init_config();
|
|
2640
2758
|
init_runtime_table();
|
|
2759
|
+
init_secure_files();
|
|
2641
2760
|
AGENT_CONFIG_PATH = path7.join(EXE_AI_DIR, "agent-config.json");
|
|
2642
2761
|
DEFAULT_MODELS = {
|
|
2643
2762
|
claude: "claude-opus-4",
|
|
@@ -2648,7 +2767,7 @@ var init_agent_config = __esm({
|
|
|
2648
2767
|
});
|
|
2649
2768
|
|
|
2650
2769
|
// src/lib/intercom-queue.ts
|
|
2651
|
-
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as
|
|
2770
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, renameSync as renameSync3, existsSync as existsSync7, mkdirSync as mkdirSync3 } from "fs";
|
|
2652
2771
|
import path8 from "path";
|
|
2653
2772
|
import os6 from "os";
|
|
2654
2773
|
var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
|
|
@@ -2662,8 +2781,11 @@ var init_intercom_queue = __esm({
|
|
|
2662
2781
|
});
|
|
2663
2782
|
|
|
2664
2783
|
// src/lib/license.ts
|
|
2665
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as
|
|
2784
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, existsSync as existsSync8, mkdirSync as mkdirSync4 } from "fs";
|
|
2666
2785
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2786
|
+
import { createRequire as createRequire2 } from "module";
|
|
2787
|
+
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
2788
|
+
import os7 from "os";
|
|
2667
2789
|
import path9 from "path";
|
|
2668
2790
|
import { jwtVerify, importSPKI } from "jose";
|
|
2669
2791
|
var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH;
|
|
@@ -2678,7 +2800,7 @@ var init_license = __esm({
|
|
|
2678
2800
|
});
|
|
2679
2801
|
|
|
2680
2802
|
// src/lib/plan-limits.ts
|
|
2681
|
-
import { readFileSync as readFileSync6, existsSync as
|
|
2803
|
+
import { readFileSync as readFileSync6, existsSync as existsSync9 } from "fs";
|
|
2682
2804
|
import path10 from "path";
|
|
2683
2805
|
var CACHE_PATH2;
|
|
2684
2806
|
var init_plan_limits = __esm({
|
|
@@ -2693,9 +2815,9 @@ var init_plan_limits = __esm({
|
|
|
2693
2815
|
});
|
|
2694
2816
|
|
|
2695
2817
|
// src/lib/tmux-routing.ts
|
|
2696
|
-
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as
|
|
2818
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync10, appendFileSync, readdirSync as readdirSync2 } from "fs";
|
|
2697
2819
|
import path11 from "path";
|
|
2698
|
-
import
|
|
2820
|
+
import os8 from "os";
|
|
2699
2821
|
import { fileURLToPath } from "url";
|
|
2700
2822
|
function getMySession() {
|
|
2701
2823
|
return getTransport().getMySession();
|
|
@@ -2751,9 +2873,9 @@ var init_tmux_routing = __esm({
|
|
|
2751
2873
|
init_intercom_queue();
|
|
2752
2874
|
init_plan_limits();
|
|
2753
2875
|
init_employees();
|
|
2754
|
-
SPAWN_LOCK_DIR = path11.join(
|
|
2755
|
-
SESSION_CACHE = path11.join(
|
|
2756
|
-
INTERCOM_LOG2 = path11.join(
|
|
2876
|
+
SPAWN_LOCK_DIR = path11.join(os8.homedir(), ".exe-os", "spawn-locks");
|
|
2877
|
+
SESSION_CACHE = path11.join(os8.homedir(), ".exe-os", "session-cache");
|
|
2878
|
+
INTERCOM_LOG2 = path11.join(os8.homedir(), ".exe-os", "intercom.log");
|
|
2757
2879
|
DEBOUNCE_FILE = path11.join(SESSION_CACHE, "intercom-debounce.json");
|
|
2758
2880
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
2759
2881
|
}
|
|
@@ -2789,7 +2911,7 @@ init_database();
|
|
|
2789
2911
|
|
|
2790
2912
|
// src/lib/keychain.ts
|
|
2791
2913
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
2792
|
-
import { existsSync as
|
|
2914
|
+
import { existsSync as existsSync4 } from "fs";
|
|
2793
2915
|
import path4 from "path";
|
|
2794
2916
|
import os4 from "os";
|
|
2795
2917
|
var SERVICE = "exe-mem";
|
|
@@ -2819,7 +2941,7 @@ async function getMasterKey() {
|
|
|
2819
2941
|
}
|
|
2820
2942
|
}
|
|
2821
2943
|
const keyPath = getKeyPath();
|
|
2822
|
-
if (!
|
|
2944
|
+
if (!existsSync4(keyPath)) {
|
|
2823
2945
|
process.stderr.write(
|
|
2824
2946
|
`[keychain] Key not found at ${keyPath} (HOME=${os4.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
|
|
2825
2947
|
`
|