@askexenow/exe-os 0.8.85 → 0.8.87
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/cleanup-stale-review-tasks.js +57 -19
- package/dist/bin/cli.js +510 -340
- package/dist/bin/exe-agent-config.js +242 -0
- package/dist/bin/exe-agent.js +3 -3
- package/dist/bin/exe-boot.js +344 -346
- package/dist/bin/exe-dispatch.js +375 -250
- package/dist/bin/exe-forget.js +5 -1
- package/dist/bin/exe-gateway.js +260 -135
- package/dist/bin/exe-healthcheck.js +133 -1
- package/dist/bin/exe-heartbeat.js +72 -31
- package/dist/bin/exe-link.js +25 -2
- package/dist/bin/exe-new-employee.js +22 -0
- package/dist/bin/exe-pending-messages.js +55 -17
- package/dist/bin/exe-pending-reviews.js +57 -19
- package/dist/bin/exe-search.js +6 -2
- package/dist/bin/exe-session-cleanup.js +260 -135
- package/dist/bin/exe-start-codex.js +2598 -0
- package/dist/bin/exe-start.sh +15 -3
- package/dist/bin/exe-status.js +57 -19
- package/dist/bin/git-sweep.js +391 -266
- package/dist/bin/install.js +22 -0
- package/dist/bin/scan-tasks.js +394 -269
- package/dist/bin/setup.js +50 -5
- package/dist/gateway/index.js +257 -132
- package/dist/hooks/bug-report-worker.js +242 -117
- package/dist/hooks/commit-complete.js +389 -264
- package/dist/hooks/error-recall.js +6 -2
- package/dist/hooks/ingest-worker.js +314 -193
- package/dist/hooks/post-compact.js +84 -46
- package/dist/hooks/pre-compact.js +272 -147
- package/dist/hooks/pre-tool-use.js +104 -66
- package/dist/hooks/prompt-submit.js +126 -66
- package/dist/hooks/session-end.js +277 -152
- package/dist/hooks/session-start.js +70 -28
- package/dist/hooks/stop.js +90 -52
- package/dist/hooks/subagent-stop.js +84 -46
- package/dist/hooks/summary-worker.js +175 -114
- package/dist/index.js +296 -171
- package/dist/lib/agent-config.js +167 -0
- package/dist/lib/cloud-sync.js +25 -2
- package/dist/lib/exe-daemon.js +338 -213
- package/dist/lib/hybrid-search.js +7 -2
- package/dist/lib/messaging.js +95 -39
- package/dist/lib/runtime-table.js +16 -0
- package/dist/lib/session-wrappers.js +22 -0
- package/dist/lib/tasks.js +242 -117
- package/dist/lib/tmux-routing.js +314 -189
- package/dist/mcp/server.js +573 -274
- package/dist/mcp/tools/create-task.js +260 -135
- package/dist/mcp/tools/list-tasks.js +68 -30
- package/dist/mcp/tools/send-message.js +100 -44
- package/dist/mcp/tools/update-task.js +123 -67
- package/dist/runtime/index.js +276 -151
- package/dist/tui/App.js +479 -354
- package/package.json +1 -1
- package/src/commands/exe/agent-config.md +27 -0
- package/src/commands/exe/cc-doctor.md +10 -0
|
@@ -3047,10 +3047,10 @@ async function disposeEmbedder() {
|
|
|
3047
3047
|
async function embedDirect(text) {
|
|
3048
3048
|
const llamaCpp = await import("node-llama-cpp");
|
|
3049
3049
|
const { MODELS_DIR: MODELS_DIR2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
3050
|
-
const { existsSync:
|
|
3051
|
-
const
|
|
3052
|
-
const modelPath =
|
|
3053
|
-
if (!
|
|
3050
|
+
const { existsSync: existsSync13 } = await import("fs");
|
|
3051
|
+
const path17 = await import("path");
|
|
3052
|
+
const modelPath = path17.join(MODELS_DIR2, "jina-embeddings-v5-small-q4_k_m.gguf");
|
|
3053
|
+
if (!existsSync13(modelPath)) {
|
|
3054
3054
|
throw new Error(`Embedding model not found at ${modelPath}. Run '/exe-setup' to download it.`);
|
|
3055
3055
|
}
|
|
3056
3056
|
const llama = await llamaCpp.getLlama();
|
|
@@ -4105,39 +4105,75 @@ var init_provider_table = __esm({
|
|
|
4105
4105
|
}
|
|
4106
4106
|
});
|
|
4107
4107
|
|
|
4108
|
-
// src/lib/
|
|
4109
|
-
|
|
4108
|
+
// src/lib/runtime-table.ts
|
|
4109
|
+
var RUNTIME_TABLE;
|
|
4110
|
+
var init_runtime_table = __esm({
|
|
4111
|
+
"src/lib/runtime-table.ts"() {
|
|
4112
|
+
"use strict";
|
|
4113
|
+
RUNTIME_TABLE = {
|
|
4114
|
+
codex: {
|
|
4115
|
+
binary: "codex",
|
|
4116
|
+
launchMode: "exec",
|
|
4117
|
+
autoApproveFlag: "--full-auto",
|
|
4118
|
+
inlineFlag: "--no-alt-screen",
|
|
4119
|
+
apiKeyEnv: "OPENAI_API_KEY",
|
|
4120
|
+
defaultModel: "gpt-5.4"
|
|
4121
|
+
}
|
|
4122
|
+
};
|
|
4123
|
+
}
|
|
4124
|
+
});
|
|
4125
|
+
|
|
4126
|
+
// src/lib/agent-config.ts
|
|
4127
|
+
import { readFileSync as readFileSync6, writeFileSync as writeFileSync3, existsSync as existsSync8, mkdirSync as mkdirSync3 } from "fs";
|
|
4110
4128
|
import path11 from "path";
|
|
4129
|
+
var AGENT_CONFIG_PATH, DEFAULT_MODELS;
|
|
4130
|
+
var init_agent_config = __esm({
|
|
4131
|
+
"src/lib/agent-config.ts"() {
|
|
4132
|
+
"use strict";
|
|
4133
|
+
init_config();
|
|
4134
|
+
init_runtime_table();
|
|
4135
|
+
AGENT_CONFIG_PATH = path11.join(EXE_AI_DIR, "agent-config.json");
|
|
4136
|
+
DEFAULT_MODELS = {
|
|
4137
|
+
claude: "claude-opus-4",
|
|
4138
|
+
codex: RUNTIME_TABLE.codex?.defaultModel ?? "gpt-5.4",
|
|
4139
|
+
opencode: "minimax-m2.7"
|
|
4140
|
+
};
|
|
4141
|
+
}
|
|
4142
|
+
});
|
|
4143
|
+
|
|
4144
|
+
// src/lib/intercom-queue.ts
|
|
4145
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, renameSync as renameSync3, existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
|
|
4146
|
+
import path12 from "path";
|
|
4111
4147
|
import os5 from "os";
|
|
4112
4148
|
var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
|
|
4113
4149
|
var init_intercom_queue = __esm({
|
|
4114
4150
|
"src/lib/intercom-queue.ts"() {
|
|
4115
4151
|
"use strict";
|
|
4116
|
-
QUEUE_PATH =
|
|
4152
|
+
QUEUE_PATH = path12.join(os5.homedir(), ".exe-os", "intercom-queue.json");
|
|
4117
4153
|
TTL_MS = 60 * 60 * 1e3;
|
|
4118
|
-
INTERCOM_LOG =
|
|
4154
|
+
INTERCOM_LOG = path12.join(os5.homedir(), ".exe-os", "intercom.log");
|
|
4119
4155
|
}
|
|
4120
4156
|
});
|
|
4121
4157
|
|
|
4122
4158
|
// src/lib/license.ts
|
|
4123
|
-
import { readFileSync as
|
|
4159
|
+
import { readFileSync as readFileSync8, writeFileSync as writeFileSync5, existsSync as existsSync10, mkdirSync as mkdirSync5 } from "fs";
|
|
4124
4160
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
4125
|
-
import
|
|
4161
|
+
import path13 from "path";
|
|
4126
4162
|
import { jwtVerify, importSPKI } from "jose";
|
|
4127
4163
|
var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH;
|
|
4128
4164
|
var init_license = __esm({
|
|
4129
4165
|
"src/lib/license.ts"() {
|
|
4130
4166
|
"use strict";
|
|
4131
4167
|
init_config();
|
|
4132
|
-
LICENSE_PATH =
|
|
4133
|
-
CACHE_PATH =
|
|
4134
|
-
DEVICE_ID_PATH =
|
|
4168
|
+
LICENSE_PATH = path13.join(EXE_AI_DIR, "license.key");
|
|
4169
|
+
CACHE_PATH = path13.join(EXE_AI_DIR, "license-cache.json");
|
|
4170
|
+
DEVICE_ID_PATH = path13.join(EXE_AI_DIR, "device-id");
|
|
4135
4171
|
}
|
|
4136
4172
|
});
|
|
4137
4173
|
|
|
4138
4174
|
// src/lib/plan-limits.ts
|
|
4139
|
-
import { readFileSync as
|
|
4140
|
-
import
|
|
4175
|
+
import { readFileSync as readFileSync9, existsSync as existsSync11 } from "fs";
|
|
4176
|
+
import path14 from "path";
|
|
4141
4177
|
var CACHE_PATH2;
|
|
4142
4178
|
var init_plan_limits = __esm({
|
|
4143
4179
|
"src/lib/plan-limits.ts"() {
|
|
@@ -4146,13 +4182,13 @@ var init_plan_limits = __esm({
|
|
|
4146
4182
|
init_employees();
|
|
4147
4183
|
init_license();
|
|
4148
4184
|
init_config();
|
|
4149
|
-
CACHE_PATH2 =
|
|
4185
|
+
CACHE_PATH2 = path14.join(EXE_AI_DIR, "license-cache.json");
|
|
4150
4186
|
}
|
|
4151
4187
|
});
|
|
4152
4188
|
|
|
4153
4189
|
// src/lib/tmux-routing.ts
|
|
4154
|
-
import { readFileSync as
|
|
4155
|
-
import
|
|
4190
|
+
import { readFileSync as readFileSync10, writeFileSync as writeFileSync6, mkdirSync as mkdirSync6, existsSync as existsSync12, appendFileSync } from "fs";
|
|
4191
|
+
import path15 from "path";
|
|
4156
4192
|
import os6 from "os";
|
|
4157
4193
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
4158
4194
|
function getMySession() {
|
|
@@ -4166,7 +4202,7 @@ function extractRootExe(name) {
|
|
|
4166
4202
|
}
|
|
4167
4203
|
function getParentExe(sessionKey) {
|
|
4168
4204
|
try {
|
|
4169
|
-
const data = JSON.parse(
|
|
4205
|
+
const data = JSON.parse(readFileSync10(path15.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
|
|
4170
4206
|
return data.parentExe || null;
|
|
4171
4207
|
} catch {
|
|
4172
4208
|
return null;
|
|
@@ -4195,13 +4231,15 @@ var init_tmux_routing = __esm({
|
|
|
4195
4231
|
init_cc_agent_support();
|
|
4196
4232
|
init_mcp_prefix();
|
|
4197
4233
|
init_provider_table();
|
|
4234
|
+
init_agent_config();
|
|
4235
|
+
init_runtime_table();
|
|
4198
4236
|
init_intercom_queue();
|
|
4199
4237
|
init_plan_limits();
|
|
4200
4238
|
init_employees();
|
|
4201
|
-
SPAWN_LOCK_DIR =
|
|
4202
|
-
SESSION_CACHE =
|
|
4203
|
-
INTERCOM_LOG2 =
|
|
4204
|
-
DEBOUNCE_FILE =
|
|
4239
|
+
SPAWN_LOCK_DIR = path15.join(os6.homedir(), ".exe-os", "spawn-locks");
|
|
4240
|
+
SESSION_CACHE = path15.join(os6.homedir(), ".exe-os", "session-cache");
|
|
4241
|
+
INTERCOM_LOG2 = path15.join(os6.homedir(), ".exe-os", "intercom.log");
|
|
4242
|
+
DEBOUNCE_FILE = path15.join(SESSION_CACHE, "intercom-debounce.json");
|
|
4205
4243
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
4206
4244
|
}
|
|
4207
4245
|
});
|
|
@@ -4235,7 +4273,7 @@ init_config();
|
|
|
4235
4273
|
init_config();
|
|
4236
4274
|
init_store();
|
|
4237
4275
|
init_database();
|
|
4238
|
-
import
|
|
4276
|
+
import path16 from "path";
|
|
4239
4277
|
import { unlinkSync as unlinkSync4 } from "fs";
|
|
4240
4278
|
|
|
4241
4279
|
// src/lib/hybrid-search.ts
|
|
@@ -4299,7 +4337,7 @@ async function hybridSearch(queryText, agentId, options) {
|
|
|
4299
4337
|
process.stderr.write("[hybrid-search] Embed daemon unavailable \u2014 FTS-only mode\n");
|
|
4300
4338
|
}
|
|
4301
4339
|
let grepPromise = Promise.resolve([]);
|
|
4302
|
-
if (config.fileGrepEnabled
|
|
4340
|
+
if (config.fileGrepEnabled === true) {
|
|
4303
4341
|
try {
|
|
4304
4342
|
const { getProjectName: getProjectName2 } = await Promise.resolve().then(() => (init_project_name(), project_name_exports));
|
|
4305
4343
|
const projectRoot = process.cwd();
|
|
@@ -4565,7 +4603,7 @@ async function ftsQuery(client, matchExpr, agentId, options, limit) {
|
|
|
4565
4603
|
source_type: row.source_type ?? null
|
|
4566
4604
|
}));
|
|
4567
4605
|
}
|
|
4568
|
-
async function recentRecords(agentId, options, limit) {
|
|
4606
|
+
async function recentRecords(agentId, options, limit, textFilter) {
|
|
4569
4607
|
const client = getClient();
|
|
4570
4608
|
const statusFilter = options?.includeArchived ? "" : `
|
|
4571
4609
|
AND COALESCE(status, 'active') = 'active'`;
|
|
@@ -4605,6 +4643,10 @@ async function recentRecords(agentId, options, limit) {
|
|
|
4605
4643
|
sql += ` AND memory_type = ?`;
|
|
4606
4644
|
args.push(options.memoryType);
|
|
4607
4645
|
}
|
|
4646
|
+
if (textFilter) {
|
|
4647
|
+
sql += ` AND raw_text LIKE '%' || ? || '%'`;
|
|
4648
|
+
args.push(textFilter);
|
|
4649
|
+
}
|
|
4608
4650
|
sql += ` ORDER BY timestamp DESC LIMIT ?`;
|
|
4609
4651
|
args.push(limit);
|
|
4610
4652
|
const result = await client.execute({ sql, args });
|
|
@@ -4845,8 +4887,8 @@ process.stdin.on("end", async () => {
|
|
|
4845
4887
|
const source = data.source ?? "startup";
|
|
4846
4888
|
if (source === "startup") {
|
|
4847
4889
|
try {
|
|
4848
|
-
const undefinedPath =
|
|
4849
|
-
process.env.EXE_OS_DIR ??
|
|
4890
|
+
const undefinedPath = path16.join(
|
|
4891
|
+
process.env.EXE_OS_DIR ?? path16.join(process.env.HOME ?? "", ".exe-os"),
|
|
4850
4892
|
"session-cache",
|
|
4851
4893
|
"active-agent-undefined.json"
|
|
4852
4894
|
);
|
package/dist/hooks/stop.js
CHANGED
|
@@ -450,17 +450,53 @@ var init_provider_table = __esm({
|
|
|
450
450
|
}
|
|
451
451
|
});
|
|
452
452
|
|
|
453
|
-
// src/lib/
|
|
454
|
-
|
|
453
|
+
// src/lib/runtime-table.ts
|
|
454
|
+
var RUNTIME_TABLE;
|
|
455
|
+
var init_runtime_table = __esm({
|
|
456
|
+
"src/lib/runtime-table.ts"() {
|
|
457
|
+
"use strict";
|
|
458
|
+
RUNTIME_TABLE = {
|
|
459
|
+
codex: {
|
|
460
|
+
binary: "codex",
|
|
461
|
+
launchMode: "exec",
|
|
462
|
+
autoApproveFlag: "--full-auto",
|
|
463
|
+
inlineFlag: "--no-alt-screen",
|
|
464
|
+
apiKeyEnv: "OPENAI_API_KEY",
|
|
465
|
+
defaultModel: "gpt-5.4"
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
// src/lib/agent-config.ts
|
|
472
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
455
473
|
import path5 from "path";
|
|
474
|
+
var AGENT_CONFIG_PATH, DEFAULT_MODELS;
|
|
475
|
+
var init_agent_config = __esm({
|
|
476
|
+
"src/lib/agent-config.ts"() {
|
|
477
|
+
"use strict";
|
|
478
|
+
init_config();
|
|
479
|
+
init_runtime_table();
|
|
480
|
+
AGENT_CONFIG_PATH = path5.join(EXE_AI_DIR, "agent-config.json");
|
|
481
|
+
DEFAULT_MODELS = {
|
|
482
|
+
claude: "claude-opus-4",
|
|
483
|
+
codex: RUNTIME_TABLE.codex?.defaultModel ?? "gpt-5.4",
|
|
484
|
+
opencode: "minimax-m2.7"
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
// src/lib/intercom-queue.ts
|
|
490
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, renameSync as renameSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
|
|
491
|
+
import path6 from "path";
|
|
456
492
|
import os4 from "os";
|
|
457
493
|
var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
|
|
458
494
|
var init_intercom_queue = __esm({
|
|
459
495
|
"src/lib/intercom-queue.ts"() {
|
|
460
496
|
"use strict";
|
|
461
|
-
QUEUE_PATH =
|
|
497
|
+
QUEUE_PATH = path6.join(os4.homedir(), ".exe-os", "intercom-queue.json");
|
|
462
498
|
TTL_MS = 60 * 60 * 1e3;
|
|
463
|
-
INTERCOM_LOG =
|
|
499
|
+
INTERCOM_LOG = path6.join(os4.homedir(), ".exe-os", "intercom.log");
|
|
464
500
|
}
|
|
465
501
|
});
|
|
466
502
|
|
|
@@ -523,8 +559,8 @@ var init_db_retry = __esm({
|
|
|
523
559
|
import net from "net";
|
|
524
560
|
import { spawn } from "child_process";
|
|
525
561
|
import { randomUUID } from "crypto";
|
|
526
|
-
import { existsSync as
|
|
527
|
-
import
|
|
562
|
+
import { existsSync as existsSync5, unlinkSync as unlinkSync3, readFileSync as readFileSync6, openSync, closeSync, statSync } from "fs";
|
|
563
|
+
import path7 from "path";
|
|
528
564
|
import { fileURLToPath } from "url";
|
|
529
565
|
function handleData(chunk) {
|
|
530
566
|
_buffer += chunk.toString();
|
|
@@ -552,9 +588,9 @@ function handleData(chunk) {
|
|
|
552
588
|
}
|
|
553
589
|
}
|
|
554
590
|
function cleanupStaleFiles() {
|
|
555
|
-
if (
|
|
591
|
+
if (existsSync5(PID_PATH)) {
|
|
556
592
|
try {
|
|
557
|
-
const pid = parseInt(
|
|
593
|
+
const pid = parseInt(readFileSync6(PID_PATH, "utf8").trim(), 10);
|
|
558
594
|
if (pid > 0) {
|
|
559
595
|
try {
|
|
560
596
|
process.kill(pid, 0);
|
|
@@ -575,11 +611,11 @@ function cleanupStaleFiles() {
|
|
|
575
611
|
}
|
|
576
612
|
}
|
|
577
613
|
function findPackageRoot() {
|
|
578
|
-
let dir =
|
|
579
|
-
const { root } =
|
|
614
|
+
let dir = path7.dirname(fileURLToPath(import.meta.url));
|
|
615
|
+
const { root } = path7.parse(dir);
|
|
580
616
|
while (dir !== root) {
|
|
581
|
-
if (
|
|
582
|
-
dir =
|
|
617
|
+
if (existsSync5(path7.join(dir, "package.json"))) return dir;
|
|
618
|
+
dir = path7.dirname(dir);
|
|
583
619
|
}
|
|
584
620
|
return null;
|
|
585
621
|
}
|
|
@@ -589,8 +625,8 @@ function spawnDaemon() {
|
|
|
589
625
|
process.stderr.write("[exed-client] WARN: cannot find package root\n");
|
|
590
626
|
return;
|
|
591
627
|
}
|
|
592
|
-
const daemonPath =
|
|
593
|
-
if (!
|
|
628
|
+
const daemonPath = path7.join(pkgRoot, "dist", "lib", "exe-daemon.js");
|
|
629
|
+
if (!existsSync5(daemonPath)) {
|
|
594
630
|
process.stderr.write(`[exed-client] WARN: daemon script not found at ${daemonPath}
|
|
595
631
|
`);
|
|
596
632
|
return;
|
|
@@ -598,7 +634,7 @@ function spawnDaemon() {
|
|
|
598
634
|
const resolvedPath = daemonPath;
|
|
599
635
|
process.stderr.write(`[exed-client] Spawning daemon: ${resolvedPath}
|
|
600
636
|
`);
|
|
601
|
-
const logPath =
|
|
637
|
+
const logPath = path7.join(path7.dirname(SOCKET_PATH), "exed.log");
|
|
602
638
|
let stderrFd = "ignore";
|
|
603
639
|
try {
|
|
604
640
|
stderrFd = openSync(logPath, "a");
|
|
@@ -743,9 +779,9 @@ var init_exe_daemon_client = __esm({
|
|
|
743
779
|
"src/lib/exe-daemon-client.ts"() {
|
|
744
780
|
"use strict";
|
|
745
781
|
init_config();
|
|
746
|
-
SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ??
|
|
747
|
-
PID_PATH = process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ??
|
|
748
|
-
SPAWN_LOCK_PATH =
|
|
782
|
+
SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ?? path7.join(EXE_AI_DIR, "exed.sock");
|
|
783
|
+
PID_PATH = process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ?? path7.join(EXE_AI_DIR, "exed.pid");
|
|
784
|
+
SPAWN_LOCK_PATH = path7.join(EXE_AI_DIR, "exed-spawn.lock");
|
|
749
785
|
SPAWN_LOCK_STALE_MS = 3e4;
|
|
750
786
|
CONNECT_TIMEOUT_MS = 15e3;
|
|
751
787
|
REQUEST_TIMEOUT_MS = 3e4;
|
|
@@ -1970,24 +2006,24 @@ var init_database = __esm({
|
|
|
1970
2006
|
});
|
|
1971
2007
|
|
|
1972
2008
|
// src/lib/license.ts
|
|
1973
|
-
import { readFileSync as
|
|
2009
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, existsSync as existsSync6, mkdirSync as mkdirSync4 } from "fs";
|
|
1974
2010
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
1975
|
-
import
|
|
2011
|
+
import path8 from "path";
|
|
1976
2012
|
import { jwtVerify, importSPKI } from "jose";
|
|
1977
2013
|
var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH;
|
|
1978
2014
|
var init_license = __esm({
|
|
1979
2015
|
"src/lib/license.ts"() {
|
|
1980
2016
|
"use strict";
|
|
1981
2017
|
init_config();
|
|
1982
|
-
LICENSE_PATH =
|
|
1983
|
-
CACHE_PATH =
|
|
1984
|
-
DEVICE_ID_PATH =
|
|
2018
|
+
LICENSE_PATH = path8.join(EXE_AI_DIR, "license.key");
|
|
2019
|
+
CACHE_PATH = path8.join(EXE_AI_DIR, "license-cache.json");
|
|
2020
|
+
DEVICE_ID_PATH = path8.join(EXE_AI_DIR, "device-id");
|
|
1985
2021
|
}
|
|
1986
2022
|
});
|
|
1987
2023
|
|
|
1988
2024
|
// src/lib/plan-limits.ts
|
|
1989
|
-
import { readFileSync as
|
|
1990
|
-
import
|
|
2025
|
+
import { readFileSync as readFileSync8, existsSync as existsSync7 } from "fs";
|
|
2026
|
+
import path9 from "path";
|
|
1991
2027
|
var CACHE_PATH2;
|
|
1992
2028
|
var init_plan_limits = __esm({
|
|
1993
2029
|
"src/lib/plan-limits.ts"() {
|
|
@@ -1996,13 +2032,13 @@ var init_plan_limits = __esm({
|
|
|
1996
2032
|
init_employees();
|
|
1997
2033
|
init_license();
|
|
1998
2034
|
init_config();
|
|
1999
|
-
CACHE_PATH2 =
|
|
2035
|
+
CACHE_PATH2 = path9.join(EXE_AI_DIR, "license-cache.json");
|
|
2000
2036
|
}
|
|
2001
2037
|
});
|
|
2002
2038
|
|
|
2003
2039
|
// src/lib/tmux-routing.ts
|
|
2004
|
-
import { readFileSync as
|
|
2005
|
-
import
|
|
2040
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, existsSync as existsSync8, appendFileSync } from "fs";
|
|
2041
|
+
import path10 from "path";
|
|
2006
2042
|
import os5 from "os";
|
|
2007
2043
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2008
2044
|
function getMySession() {
|
|
@@ -2016,7 +2052,7 @@ function extractRootExe(name) {
|
|
|
2016
2052
|
}
|
|
2017
2053
|
function getParentExe(sessionKey) {
|
|
2018
2054
|
try {
|
|
2019
|
-
const data = JSON.parse(
|
|
2055
|
+
const data = JSON.parse(readFileSync9(path10.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
|
|
2020
2056
|
return data.parentExe || null;
|
|
2021
2057
|
} catch {
|
|
2022
2058
|
return null;
|
|
@@ -2045,13 +2081,15 @@ var init_tmux_routing = __esm({
|
|
|
2045
2081
|
init_cc_agent_support();
|
|
2046
2082
|
init_mcp_prefix();
|
|
2047
2083
|
init_provider_table();
|
|
2084
|
+
init_agent_config();
|
|
2085
|
+
init_runtime_table();
|
|
2048
2086
|
init_intercom_queue();
|
|
2049
2087
|
init_plan_limits();
|
|
2050
2088
|
init_employees();
|
|
2051
|
-
SPAWN_LOCK_DIR =
|
|
2052
|
-
SESSION_CACHE =
|
|
2053
|
-
INTERCOM_LOG2 =
|
|
2054
|
-
DEBOUNCE_FILE =
|
|
2089
|
+
SPAWN_LOCK_DIR = path10.join(os5.homedir(), ".exe-os", "spawn-locks");
|
|
2090
|
+
SESSION_CACHE = path10.join(os5.homedir(), ".exe-os", "session-cache");
|
|
2091
|
+
INTERCOM_LOG2 = path10.join(os5.homedir(), ".exe-os", "intercom.log");
|
|
2092
|
+
DEBOUNCE_FILE = path10.join(SESSION_CACHE, "intercom-debounce.json");
|
|
2055
2093
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
2056
2094
|
}
|
|
2057
2095
|
});
|
|
@@ -2091,14 +2129,14 @@ var init_memory = __esm({
|
|
|
2091
2129
|
|
|
2092
2130
|
// src/lib/keychain.ts
|
|
2093
2131
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
2094
|
-
import { existsSync as
|
|
2095
|
-
import
|
|
2132
|
+
import { existsSync as existsSync9 } from "fs";
|
|
2133
|
+
import path11 from "path";
|
|
2096
2134
|
import os6 from "os";
|
|
2097
2135
|
function getKeyDir() {
|
|
2098
|
-
return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ??
|
|
2136
|
+
return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path11.join(os6.homedir(), ".exe-os");
|
|
2099
2137
|
}
|
|
2100
2138
|
function getKeyPath() {
|
|
2101
|
-
return
|
|
2139
|
+
return path11.join(getKeyDir(), "master.key");
|
|
2102
2140
|
}
|
|
2103
2141
|
async function tryKeytar() {
|
|
2104
2142
|
try {
|
|
@@ -2119,7 +2157,7 @@ async function getMasterKey() {
|
|
|
2119
2157
|
}
|
|
2120
2158
|
}
|
|
2121
2159
|
const keyPath = getKeyPath();
|
|
2122
|
-
if (!
|
|
2160
|
+
if (!existsSync9(keyPath)) {
|
|
2123
2161
|
process.stderr.write(
|
|
2124
2162
|
`[keychain] Key not found at ${keyPath} (HOME=${os6.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
|
|
2125
2163
|
`
|
|
@@ -2214,13 +2252,13 @@ __export(shard_manager_exports, {
|
|
|
2214
2252
|
listShards: () => listShards,
|
|
2215
2253
|
shardExists: () => shardExists
|
|
2216
2254
|
});
|
|
2217
|
-
import
|
|
2218
|
-
import { existsSync as
|
|
2255
|
+
import path12 from "path";
|
|
2256
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync6, readdirSync as readdirSync2 } from "fs";
|
|
2219
2257
|
import { createClient as createClient2 } from "@libsql/client";
|
|
2220
2258
|
function initShardManager(encryptionKey) {
|
|
2221
2259
|
_encryptionKey = encryptionKey;
|
|
2222
|
-
if (!
|
|
2223
|
-
|
|
2260
|
+
if (!existsSync10(SHARDS_DIR)) {
|
|
2261
|
+
mkdirSync6(SHARDS_DIR, { recursive: true });
|
|
2224
2262
|
}
|
|
2225
2263
|
_shardingEnabled = true;
|
|
2226
2264
|
}
|
|
@@ -2240,7 +2278,7 @@ function getShardClient(projectName) {
|
|
|
2240
2278
|
}
|
|
2241
2279
|
const cached = _shards.get(safeName);
|
|
2242
2280
|
if (cached) return cached;
|
|
2243
|
-
const dbPath =
|
|
2281
|
+
const dbPath = path12.join(SHARDS_DIR, `${safeName}.db`);
|
|
2244
2282
|
const client = createClient2({
|
|
2245
2283
|
url: `file:${dbPath}`,
|
|
2246
2284
|
encryptionKey: _encryptionKey
|
|
@@ -2250,10 +2288,10 @@ function getShardClient(projectName) {
|
|
|
2250
2288
|
}
|
|
2251
2289
|
function shardExists(projectName) {
|
|
2252
2290
|
const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
2253
|
-
return
|
|
2291
|
+
return existsSync10(path12.join(SHARDS_DIR, `${safeName}.db`));
|
|
2254
2292
|
}
|
|
2255
2293
|
function listShards() {
|
|
2256
|
-
if (!
|
|
2294
|
+
if (!existsSync10(SHARDS_DIR)) return [];
|
|
2257
2295
|
return readdirSync2(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
|
|
2258
2296
|
}
|
|
2259
2297
|
async function ensureShardSchema(client) {
|
|
@@ -2439,7 +2477,7 @@ var init_shard_manager = __esm({
|
|
|
2439
2477
|
"src/lib/shard-manager.ts"() {
|
|
2440
2478
|
"use strict";
|
|
2441
2479
|
init_config();
|
|
2442
|
-
SHARDS_DIR =
|
|
2480
|
+
SHARDS_DIR = path12.join(EXE_AI_DIR, "shards");
|
|
2443
2481
|
_shards = /* @__PURE__ */ new Map();
|
|
2444
2482
|
_encryptionKey = null;
|
|
2445
2483
|
_shardingEnabled = false;
|
|
@@ -3199,8 +3237,8 @@ var init_store = __esm({
|
|
|
3199
3237
|
init_config();
|
|
3200
3238
|
init_config();
|
|
3201
3239
|
import { spawn as spawn2 } from "child_process";
|
|
3202
|
-
import { existsSync as
|
|
3203
|
-
import
|
|
3240
|
+
import { existsSync as existsSync11, openSync as openSync2, closeSync as closeSync2 } from "fs";
|
|
3241
|
+
import path13 from "path";
|
|
3204
3242
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
3205
3243
|
|
|
3206
3244
|
// src/adapters/claude/active-agent.ts
|
|
@@ -3314,7 +3352,7 @@ if (!process.env.AGENT_ID) {
|
|
|
3314
3352
|
if (!loadConfigSync().autoIngestion) {
|
|
3315
3353
|
process.exit(0);
|
|
3316
3354
|
}
|
|
3317
|
-
var WORKER_LOG_PATH =
|
|
3355
|
+
var WORKER_LOG_PATH = path13.join(EXE_AI_DIR, "workers.log");
|
|
3318
3356
|
function openWorkerLog() {
|
|
3319
3357
|
try {
|
|
3320
3358
|
return openSync2(WORKER_LOG_PATH, "a");
|
|
@@ -3406,11 +3444,11 @@ process.stdin.on("end", () => {
|
|
|
3406
3444
|
}).catch(() => {
|
|
3407
3445
|
});
|
|
3408
3446
|
}
|
|
3409
|
-
const workerPath =
|
|
3410
|
-
|
|
3447
|
+
const workerPath = path13.resolve(
|
|
3448
|
+
path13.dirname(fileURLToPath3(import.meta.url)),
|
|
3411
3449
|
"response-ingest-worker.js"
|
|
3412
3450
|
);
|
|
3413
|
-
if (!
|
|
3451
|
+
if (!existsSync11(workerPath)) {
|
|
3414
3452
|
process.stderr.write(`[stop] WARN: response-ingest-worker not found at ${workerPath}
|
|
3415
3453
|
`);
|
|
3416
3454
|
process.exit(0);
|