@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
|
@@ -591,17 +591,53 @@ var init_provider_table = __esm({
|
|
|
591
591
|
}
|
|
592
592
|
});
|
|
593
593
|
|
|
594
|
-
// src/lib/
|
|
595
|
-
|
|
594
|
+
// src/lib/runtime-table.ts
|
|
595
|
+
var RUNTIME_TABLE;
|
|
596
|
+
var init_runtime_table = __esm({
|
|
597
|
+
"src/lib/runtime-table.ts"() {
|
|
598
|
+
"use strict";
|
|
599
|
+
RUNTIME_TABLE = {
|
|
600
|
+
codex: {
|
|
601
|
+
binary: "codex",
|
|
602
|
+
launchMode: "exec",
|
|
603
|
+
autoApproveFlag: "--full-auto",
|
|
604
|
+
inlineFlag: "--no-alt-screen",
|
|
605
|
+
apiKeyEnv: "OPENAI_API_KEY",
|
|
606
|
+
defaultModel: "gpt-5.4"
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
// src/lib/agent-config.ts
|
|
613
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
596
614
|
import path5 from "path";
|
|
615
|
+
var AGENT_CONFIG_PATH, DEFAULT_MODELS;
|
|
616
|
+
var init_agent_config = __esm({
|
|
617
|
+
"src/lib/agent-config.ts"() {
|
|
618
|
+
"use strict";
|
|
619
|
+
init_config();
|
|
620
|
+
init_runtime_table();
|
|
621
|
+
AGENT_CONFIG_PATH = path5.join(EXE_AI_DIR, "agent-config.json");
|
|
622
|
+
DEFAULT_MODELS = {
|
|
623
|
+
claude: "claude-opus-4",
|
|
624
|
+
codex: RUNTIME_TABLE.codex?.defaultModel ?? "gpt-5.4",
|
|
625
|
+
opencode: "minimax-m2.7"
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
// src/lib/intercom-queue.ts
|
|
631
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, renameSync as renameSync3, existsSync as existsSync4, mkdirSync as mkdirSync3 } from "fs";
|
|
632
|
+
import path6 from "path";
|
|
597
633
|
import os4 from "os";
|
|
598
634
|
var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
|
|
599
635
|
var init_intercom_queue = __esm({
|
|
600
636
|
"src/lib/intercom-queue.ts"() {
|
|
601
637
|
"use strict";
|
|
602
|
-
QUEUE_PATH =
|
|
638
|
+
QUEUE_PATH = path6.join(os4.homedir(), ".exe-os", "intercom-queue.json");
|
|
603
639
|
TTL_MS = 60 * 60 * 1e3;
|
|
604
|
-
INTERCOM_LOG =
|
|
640
|
+
INTERCOM_LOG = path6.join(os4.homedir(), ".exe-os", "intercom.log");
|
|
605
641
|
}
|
|
606
642
|
});
|
|
607
643
|
|
|
@@ -664,8 +700,8 @@ var init_db_retry = __esm({
|
|
|
664
700
|
import net from "net";
|
|
665
701
|
import { spawn } from "child_process";
|
|
666
702
|
import { randomUUID } from "crypto";
|
|
667
|
-
import { existsSync as
|
|
668
|
-
import
|
|
703
|
+
import { existsSync as existsSync5, unlinkSync as unlinkSync3, readFileSync as readFileSync6, openSync, closeSync, statSync } from "fs";
|
|
704
|
+
import path7 from "path";
|
|
669
705
|
import { fileURLToPath } from "url";
|
|
670
706
|
function handleData(chunk) {
|
|
671
707
|
_buffer += chunk.toString();
|
|
@@ -693,9 +729,9 @@ function handleData(chunk) {
|
|
|
693
729
|
}
|
|
694
730
|
}
|
|
695
731
|
function cleanupStaleFiles() {
|
|
696
|
-
if (
|
|
732
|
+
if (existsSync5(PID_PATH)) {
|
|
697
733
|
try {
|
|
698
|
-
const pid = parseInt(
|
|
734
|
+
const pid = parseInt(readFileSync6(PID_PATH, "utf8").trim(), 10);
|
|
699
735
|
if (pid > 0) {
|
|
700
736
|
try {
|
|
701
737
|
process.kill(pid, 0);
|
|
@@ -716,11 +752,11 @@ function cleanupStaleFiles() {
|
|
|
716
752
|
}
|
|
717
753
|
}
|
|
718
754
|
function findPackageRoot() {
|
|
719
|
-
let dir =
|
|
720
|
-
const { root } =
|
|
755
|
+
let dir = path7.dirname(fileURLToPath(import.meta.url));
|
|
756
|
+
const { root } = path7.parse(dir);
|
|
721
757
|
while (dir !== root) {
|
|
722
|
-
if (
|
|
723
|
-
dir =
|
|
758
|
+
if (existsSync5(path7.join(dir, "package.json"))) return dir;
|
|
759
|
+
dir = path7.dirname(dir);
|
|
724
760
|
}
|
|
725
761
|
return null;
|
|
726
762
|
}
|
|
@@ -730,8 +766,8 @@ function spawnDaemon() {
|
|
|
730
766
|
process.stderr.write("[exed-client] WARN: cannot find package root\n");
|
|
731
767
|
return;
|
|
732
768
|
}
|
|
733
|
-
const daemonPath =
|
|
734
|
-
if (!
|
|
769
|
+
const daemonPath = path7.join(pkgRoot, "dist", "lib", "exe-daemon.js");
|
|
770
|
+
if (!existsSync5(daemonPath)) {
|
|
735
771
|
process.stderr.write(`[exed-client] WARN: daemon script not found at ${daemonPath}
|
|
736
772
|
`);
|
|
737
773
|
return;
|
|
@@ -739,7 +775,7 @@ function spawnDaemon() {
|
|
|
739
775
|
const resolvedPath = daemonPath;
|
|
740
776
|
process.stderr.write(`[exed-client] Spawning daemon: ${resolvedPath}
|
|
741
777
|
`);
|
|
742
|
-
const logPath =
|
|
778
|
+
const logPath = path7.join(path7.dirname(SOCKET_PATH), "exed.log");
|
|
743
779
|
let stderrFd = "ignore";
|
|
744
780
|
try {
|
|
745
781
|
stderrFd = openSync(logPath, "a");
|
|
@@ -884,9 +920,9 @@ var init_exe_daemon_client = __esm({
|
|
|
884
920
|
"src/lib/exe-daemon-client.ts"() {
|
|
885
921
|
"use strict";
|
|
886
922
|
init_config();
|
|
887
|
-
SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ??
|
|
888
|
-
PID_PATH = process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ??
|
|
889
|
-
SPAWN_LOCK_PATH =
|
|
923
|
+
SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ?? path7.join(EXE_AI_DIR, "exed.sock");
|
|
924
|
+
PID_PATH = process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ?? path7.join(EXE_AI_DIR, "exed.pid");
|
|
925
|
+
SPAWN_LOCK_PATH = path7.join(EXE_AI_DIR, "exed-spawn.lock");
|
|
890
926
|
SPAWN_LOCK_STALE_MS = 3e4;
|
|
891
927
|
CONNECT_TIMEOUT_MS = 15e3;
|
|
892
928
|
REQUEST_TIMEOUT_MS = 3e4;
|
|
@@ -2111,24 +2147,24 @@ var init_database = __esm({
|
|
|
2111
2147
|
});
|
|
2112
2148
|
|
|
2113
2149
|
// src/lib/license.ts
|
|
2114
|
-
import { readFileSync as
|
|
2150
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, existsSync as existsSync6, mkdirSync as mkdirSync4 } from "fs";
|
|
2115
2151
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2116
|
-
import
|
|
2152
|
+
import path8 from "path";
|
|
2117
2153
|
import { jwtVerify, importSPKI } from "jose";
|
|
2118
2154
|
var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH;
|
|
2119
2155
|
var init_license = __esm({
|
|
2120
2156
|
"src/lib/license.ts"() {
|
|
2121
2157
|
"use strict";
|
|
2122
2158
|
init_config();
|
|
2123
|
-
LICENSE_PATH =
|
|
2124
|
-
CACHE_PATH =
|
|
2125
|
-
DEVICE_ID_PATH =
|
|
2159
|
+
LICENSE_PATH = path8.join(EXE_AI_DIR, "license.key");
|
|
2160
|
+
CACHE_PATH = path8.join(EXE_AI_DIR, "license-cache.json");
|
|
2161
|
+
DEVICE_ID_PATH = path8.join(EXE_AI_DIR, "device-id");
|
|
2126
2162
|
}
|
|
2127
2163
|
});
|
|
2128
2164
|
|
|
2129
2165
|
// src/lib/plan-limits.ts
|
|
2130
|
-
import { readFileSync as
|
|
2131
|
-
import
|
|
2166
|
+
import { readFileSync as readFileSync8, existsSync as existsSync7 } from "fs";
|
|
2167
|
+
import path9 from "path";
|
|
2132
2168
|
var CACHE_PATH2;
|
|
2133
2169
|
var init_plan_limits = __esm({
|
|
2134
2170
|
"src/lib/plan-limits.ts"() {
|
|
@@ -2137,13 +2173,13 @@ var init_plan_limits = __esm({
|
|
|
2137
2173
|
init_employees();
|
|
2138
2174
|
init_license();
|
|
2139
2175
|
init_config();
|
|
2140
|
-
CACHE_PATH2 =
|
|
2176
|
+
CACHE_PATH2 = path9.join(EXE_AI_DIR, "license-cache.json");
|
|
2141
2177
|
}
|
|
2142
2178
|
});
|
|
2143
2179
|
|
|
2144
2180
|
// src/lib/tmux-routing.ts
|
|
2145
|
-
import { readFileSync as
|
|
2146
|
-
import
|
|
2181
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, existsSync as existsSync8, appendFileSync } from "fs";
|
|
2182
|
+
import path10 from "path";
|
|
2147
2183
|
import os5 from "os";
|
|
2148
2184
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2149
2185
|
function getMySession() {
|
|
@@ -2157,7 +2193,7 @@ function extractRootExe(name) {
|
|
|
2157
2193
|
}
|
|
2158
2194
|
function getParentExe(sessionKey) {
|
|
2159
2195
|
try {
|
|
2160
|
-
const data = JSON.parse(
|
|
2196
|
+
const data = JSON.parse(readFileSync9(path10.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
|
|
2161
2197
|
return data.parentExe || null;
|
|
2162
2198
|
} catch {
|
|
2163
2199
|
return null;
|
|
@@ -2186,13 +2222,15 @@ var init_tmux_routing = __esm({
|
|
|
2186
2222
|
init_cc_agent_support();
|
|
2187
2223
|
init_mcp_prefix();
|
|
2188
2224
|
init_provider_table();
|
|
2225
|
+
init_agent_config();
|
|
2226
|
+
init_runtime_table();
|
|
2189
2227
|
init_intercom_queue();
|
|
2190
2228
|
init_plan_limits();
|
|
2191
2229
|
init_employees();
|
|
2192
|
-
SPAWN_LOCK_DIR =
|
|
2193
|
-
SESSION_CACHE =
|
|
2194
|
-
INTERCOM_LOG2 =
|
|
2195
|
-
DEBOUNCE_FILE =
|
|
2230
|
+
SPAWN_LOCK_DIR = path10.join(os5.homedir(), ".exe-os", "spawn-locks");
|
|
2231
|
+
SESSION_CACHE = path10.join(os5.homedir(), ".exe-os", "session-cache");
|
|
2232
|
+
INTERCOM_LOG2 = path10.join(os5.homedir(), ".exe-os", "intercom.log");
|
|
2233
|
+
DEBOUNCE_FILE = path10.join(SESSION_CACHE, "intercom-debounce.json");
|
|
2196
2234
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
2197
2235
|
}
|
|
2198
2236
|
});
|
|
@@ -2235,8 +2273,8 @@ __export(cto_delegation_gate_exports, {
|
|
|
2235
2273
|
scratchpadPath: () => scratchpadPath
|
|
2236
2274
|
});
|
|
2237
2275
|
import os6 from "os";
|
|
2238
|
-
import
|
|
2239
|
-
import { existsSync as
|
|
2276
|
+
import path11 from "path";
|
|
2277
|
+
import { existsSync as existsSync9, readFileSync as readFileSync10, statSync as statSync2 } from "fs";
|
|
2240
2278
|
function resolveGatedAgent() {
|
|
2241
2279
|
try {
|
|
2242
2280
|
const employees = loadEmployeesSync();
|
|
@@ -2250,12 +2288,12 @@ function getGatedAgent() {
|
|
|
2250
2288
|
return resolveGatedAgent() || GATED_AGENT;
|
|
2251
2289
|
}
|
|
2252
2290
|
function toWorkspaceRelative(filePath, cwd = process.cwd()) {
|
|
2253
|
-
const normalized =
|
|
2254
|
-
if (normalized.startsWith(cwd +
|
|
2291
|
+
const normalized = path11.normalize(filePath);
|
|
2292
|
+
if (normalized.startsWith(cwd + path11.sep)) {
|
|
2255
2293
|
return normalized.slice(cwd.length + 1);
|
|
2256
2294
|
}
|
|
2257
|
-
if (
|
|
2258
|
-
return
|
|
2295
|
+
if (path11.isAbsolute(normalized)) {
|
|
2296
|
+
return path11.basename(normalized);
|
|
2259
2297
|
}
|
|
2260
2298
|
return normalized;
|
|
2261
2299
|
}
|
|
@@ -2264,8 +2302,8 @@ function isDockerfile(basename) {
|
|
|
2264
2302
|
}
|
|
2265
2303
|
function classifyPath(filePath, cwd) {
|
|
2266
2304
|
const rel = toWorkspaceRelative(filePath, cwd);
|
|
2267
|
-
const basename =
|
|
2268
|
-
const ext =
|
|
2305
|
+
const basename = path11.basename(rel);
|
|
2306
|
+
const ext = path11.extname(rel).toLowerCase();
|
|
2269
2307
|
if (ext === ".md") {
|
|
2270
2308
|
for (const prefix of EXEMPT_MD_DIR_PREFIXES) {
|
|
2271
2309
|
if (rel.startsWith(prefix)) return "exempt";
|
|
@@ -2308,7 +2346,7 @@ async function hasRecentEngineerDispatch(now = Date.now()) {
|
|
|
2308
2346
|
}
|
|
2309
2347
|
}
|
|
2310
2348
|
function scratchpadPath(sessionId, homeDir = os6.homedir()) {
|
|
2311
|
-
return
|
|
2349
|
+
return path11.join(
|
|
2312
2350
|
homeDir,
|
|
2313
2351
|
".exe-os",
|
|
2314
2352
|
"session-cache",
|
|
@@ -2318,11 +2356,11 @@ function scratchpadPath(sessionId, homeDir = os6.homedir()) {
|
|
|
2318
2356
|
function hasValidScratchpadEscape(sessionId, now = Date.now(), homeDir = os6.homedir()) {
|
|
2319
2357
|
const paths = [scratchpadPath(sessionId, homeDir)];
|
|
2320
2358
|
for (const filePath of paths) {
|
|
2321
|
-
if (!
|
|
2359
|
+
if (!existsSync9(filePath)) continue;
|
|
2322
2360
|
try {
|
|
2323
2361
|
const stat = statSync2(filePath);
|
|
2324
2362
|
if (now - stat.mtimeMs > SCRATCHPAD_MAX_AGE_MS) continue;
|
|
2325
|
-
const body =
|
|
2363
|
+
const body = readFileSync10(filePath, "utf-8");
|
|
2326
2364
|
if (SCRATCHPAD_ESCAPE_PATTERN.test(body)) return true;
|
|
2327
2365
|
} catch {
|
|
2328
2366
|
}
|
|
@@ -2413,14 +2451,14 @@ var init_memory = __esm({
|
|
|
2413
2451
|
|
|
2414
2452
|
// src/lib/keychain.ts
|
|
2415
2453
|
import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
|
|
2416
|
-
import { existsSync as
|
|
2417
|
-
import
|
|
2454
|
+
import { existsSync as existsSync10 } from "fs";
|
|
2455
|
+
import path12 from "path";
|
|
2418
2456
|
import os7 from "os";
|
|
2419
2457
|
function getKeyDir() {
|
|
2420
|
-
return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ??
|
|
2458
|
+
return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? path12.join(os7.homedir(), ".exe-os");
|
|
2421
2459
|
}
|
|
2422
2460
|
function getKeyPath() {
|
|
2423
|
-
return
|
|
2461
|
+
return path12.join(getKeyDir(), "master.key");
|
|
2424
2462
|
}
|
|
2425
2463
|
async function tryKeytar() {
|
|
2426
2464
|
try {
|
|
@@ -2441,7 +2479,7 @@ async function getMasterKey() {
|
|
|
2441
2479
|
}
|
|
2442
2480
|
}
|
|
2443
2481
|
const keyPath = getKeyPath();
|
|
2444
|
-
if (!
|
|
2482
|
+
if (!existsSync10(keyPath)) {
|
|
2445
2483
|
process.stderr.write(
|
|
2446
2484
|
`[keychain] Key not found at ${keyPath} (HOME=${os7.homedir()}, EXE_OS_DIR=${process.env.EXE_OS_DIR ?? "unset"})
|
|
2447
2485
|
`
|
|
@@ -2536,13 +2574,13 @@ __export(shard_manager_exports, {
|
|
|
2536
2574
|
listShards: () => listShards,
|
|
2537
2575
|
shardExists: () => shardExists
|
|
2538
2576
|
});
|
|
2539
|
-
import
|
|
2540
|
-
import { existsSync as
|
|
2577
|
+
import path13 from "path";
|
|
2578
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync6, readdirSync as readdirSync2 } from "fs";
|
|
2541
2579
|
import { createClient as createClient2 } from "@libsql/client";
|
|
2542
2580
|
function initShardManager(encryptionKey) {
|
|
2543
2581
|
_encryptionKey = encryptionKey;
|
|
2544
|
-
if (!
|
|
2545
|
-
|
|
2582
|
+
if (!existsSync11(SHARDS_DIR)) {
|
|
2583
|
+
mkdirSync6(SHARDS_DIR, { recursive: true });
|
|
2546
2584
|
}
|
|
2547
2585
|
_shardingEnabled = true;
|
|
2548
2586
|
}
|
|
@@ -2562,7 +2600,7 @@ function getShardClient(projectName) {
|
|
|
2562
2600
|
}
|
|
2563
2601
|
const cached = _shards.get(safeName);
|
|
2564
2602
|
if (cached) return cached;
|
|
2565
|
-
const dbPath =
|
|
2603
|
+
const dbPath = path13.join(SHARDS_DIR, `${safeName}.db`);
|
|
2566
2604
|
const client = createClient2({
|
|
2567
2605
|
url: `file:${dbPath}`,
|
|
2568
2606
|
encryptionKey: _encryptionKey
|
|
@@ -2572,10 +2610,10 @@ function getShardClient(projectName) {
|
|
|
2572
2610
|
}
|
|
2573
2611
|
function shardExists(projectName) {
|
|
2574
2612
|
const safeName = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
2575
|
-
return
|
|
2613
|
+
return existsSync11(path13.join(SHARDS_DIR, `${safeName}.db`));
|
|
2576
2614
|
}
|
|
2577
2615
|
function listShards() {
|
|
2578
|
-
if (!
|
|
2616
|
+
if (!existsSync11(SHARDS_DIR)) return [];
|
|
2579
2617
|
return readdirSync2(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
|
|
2580
2618
|
}
|
|
2581
2619
|
async function ensureShardSchema(client) {
|
|
@@ -2761,7 +2799,7 @@ var init_shard_manager = __esm({
|
|
|
2761
2799
|
"src/lib/shard-manager.ts"() {
|
|
2762
2800
|
"use strict";
|
|
2763
2801
|
init_config();
|
|
2764
|
-
SHARDS_DIR =
|
|
2802
|
+
SHARDS_DIR = path13.join(EXE_AI_DIR, "shards");
|
|
2765
2803
|
_shards = /* @__PURE__ */ new Map();
|
|
2766
2804
|
_encryptionKey = null;
|
|
2767
2805
|
_shardingEnabled = false;
|
|
@@ -3527,7 +3565,7 @@ __export(review_gate_exports, {
|
|
|
3527
3565
|
runReviewGate: () => runReviewGate
|
|
3528
3566
|
});
|
|
3529
3567
|
import { execSync as execSync5 } from "child_process";
|
|
3530
|
-
import { existsSync as
|
|
3568
|
+
import { existsSync as existsSync12 } from "fs";
|
|
3531
3569
|
function checkCommitsExist(taskCreatedAt) {
|
|
3532
3570
|
try {
|
|
3533
3571
|
const since = new Date(taskCreatedAt).toISOString();
|
|
@@ -3590,7 +3628,7 @@ function checkTestCoverage(taskCreatedAt) {
|
|
|
3590
3628
|
const testPath = file.replace(/^src\//, "tests/").replace(/\.ts$/, ".test.ts");
|
|
3591
3629
|
const baseName = file.split("/").pop()?.replace(/\.ts$/, "") ?? "";
|
|
3592
3630
|
const testDir = testPath.substring(0, testPath.lastIndexOf("/"));
|
|
3593
|
-
const hasDirectTest =
|
|
3631
|
+
const hasDirectTest = existsSync12(testPath);
|
|
3594
3632
|
let hasRelatedTest = false;
|
|
3595
3633
|
try {
|
|
3596
3634
|
const related = execSync5(
|
|
@@ -3644,9 +3682,9 @@ var init_review_gate = __esm({
|
|
|
3644
3682
|
});
|
|
3645
3683
|
|
|
3646
3684
|
// src/adapters/claude/hooks/pre-tool-use.ts
|
|
3647
|
-
import { existsSync as
|
|
3685
|
+
import { existsSync as existsSync13, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7 } from "fs";
|
|
3648
3686
|
import { execSync as execSync6 } from "child_process";
|
|
3649
|
-
import
|
|
3687
|
+
import path14 from "path";
|
|
3650
3688
|
|
|
3651
3689
|
// src/adapters/claude/active-agent.ts
|
|
3652
3690
|
init_config();
|
|
@@ -3759,25 +3797,25 @@ if (!process.env.AGENT_ID) {
|
|
|
3759
3797
|
}
|
|
3760
3798
|
var DELEGATION_TASK_THRESHOLD = 3;
|
|
3761
3799
|
var CTO_ROLES = ["CTO", "executive"];
|
|
3762
|
-
var CACHE_DIR2 =
|
|
3800
|
+
var CACHE_DIR2 = path14.join(EXE_AI_DIR, "session-cache");
|
|
3763
3801
|
var timeout = setTimeout(() => {
|
|
3764
3802
|
process.exit(0);
|
|
3765
3803
|
}, 5e3);
|
|
3766
3804
|
timeout.unref();
|
|
3767
3805
|
function getDelegationFlagPath() {
|
|
3768
|
-
return
|
|
3806
|
+
return path14.join(CACHE_DIR2, `delegation-checkpoint-${getSessionKey()}.json`);
|
|
3769
3807
|
}
|
|
3770
3808
|
function hasDelegationFired() {
|
|
3771
3809
|
try {
|
|
3772
|
-
return
|
|
3810
|
+
return existsSync13(getDelegationFlagPath());
|
|
3773
3811
|
} catch {
|
|
3774
3812
|
return false;
|
|
3775
3813
|
}
|
|
3776
3814
|
}
|
|
3777
3815
|
function markDelegationFired() {
|
|
3778
3816
|
try {
|
|
3779
|
-
|
|
3780
|
-
|
|
3817
|
+
mkdirSync7(CACHE_DIR2, { recursive: true });
|
|
3818
|
+
writeFileSync7(getDelegationFlagPath(), JSON.stringify({ fired: true }));
|
|
3781
3819
|
} catch {
|
|
3782
3820
|
}
|
|
3783
3821
|
}
|