@askexenow/exe-os 0.8.65 → 0.8.68
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 +8 -7
- package/dist/bin/cli.js +204 -120
- package/dist/bin/exe-assign.js +11 -10
- package/dist/bin/exe-boot.js +83 -78
- package/dist/bin/exe-call.js +33 -1
- package/dist/bin/exe-cloud.js +3 -2
- package/dist/bin/exe-dispatch.js +31 -30
- package/dist/bin/exe-gateway.js +33 -32
- package/dist/bin/exe-heartbeat.js +21 -20
- package/dist/bin/exe-launch-agent.js +48 -16
- package/dist/bin/exe-link.js +16 -11
- package/dist/bin/exe-new-employee.js +20 -19
- package/dist/bin/exe-pending-messages.js +7 -6
- package/dist/bin/exe-pending-reviews.js +16 -15
- package/dist/bin/exe-rename.js +12 -11
- package/dist/bin/exe-review.js +4 -3
- package/dist/bin/exe-session-cleanup.js +20 -19
- package/dist/bin/exe-settings.js +3 -2
- package/dist/bin/exe-status.js +16 -15
- package/dist/bin/exe-team.js +4 -3
- package/dist/bin/git-sweep.js +31 -30
- package/dist/bin/install.js +284 -113
- package/dist/bin/scan-tasks.js +33 -32
- package/dist/bin/setup.js +114 -30
- package/dist/gateway/index.js +32 -31
- package/dist/hooks/bug-report-worker.js +58 -26
- package/dist/hooks/commit-complete.js +31 -30
- package/dist/hooks/ingest-worker.js +58 -57
- package/dist/hooks/post-compact.js +10 -9
- package/dist/hooks/pre-compact.js +31 -30
- package/dist/hooks/pre-tool-use.js +46 -14
- package/dist/hooks/prompt-ingest-worker.js +15 -14
- package/dist/hooks/prompt-submit.js +15 -14
- package/dist/hooks/response-ingest-worker.js +8 -7
- package/dist/hooks/session-end.js +14 -13
- package/dist/hooks/session-start.js +10 -9
- package/dist/hooks/stop.js +10 -9
- package/dist/hooks/subagent-stop.js +10 -9
- package/dist/hooks/summary-worker.js +41 -36
- package/dist/index.js +43 -42
- package/dist/lib/cloud-sync.js +16 -11
- package/dist/lib/employees.js +33 -1
- package/dist/lib/exe-daemon.js +56 -55
- package/dist/lib/messaging.js +9 -8
- package/dist/lib/tasks.js +27 -26
- package/dist/lib/tmux-routing.js +29 -28
- package/dist/mcp/server.js +94 -62
- package/dist/mcp/tools/create-task.js +60 -28
- package/dist/mcp/tools/list-tasks.js +10 -9
- package/dist/mcp/tools/send-message.js +11 -10
- package/dist/mcp/tools/update-task.js +21 -20
- package/dist/runtime/index.js +31 -30
- package/dist/tui/App.js +67 -35
- package/package.json +1 -1
|
@@ -708,14 +708,16 @@ __export(employees_exports, {
|
|
|
708
708
|
isMultiInstance: () => isMultiInstance,
|
|
709
709
|
loadEmployees: () => loadEmployees,
|
|
710
710
|
loadEmployeesSync: () => loadEmployeesSync,
|
|
711
|
+
normalizeRosterCase: () => normalizeRosterCase,
|
|
711
712
|
registerBinSymlinks: () => registerBinSymlinks,
|
|
712
713
|
saveEmployees: () => saveEmployees,
|
|
713
714
|
validateEmployeeName: () => validateEmployeeName
|
|
714
715
|
});
|
|
715
716
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
716
|
-
import { existsSync as existsSync5, symlinkSync, readlinkSync, readFileSync as readFileSync5 } from "fs";
|
|
717
|
+
import { existsSync as existsSync5, symlinkSync, readlinkSync, readFileSync as readFileSync5, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
717
718
|
import { execSync as execSync3 } from "child_process";
|
|
718
719
|
import path5 from "path";
|
|
720
|
+
import os5 from "os";
|
|
719
721
|
function validateEmployeeName(name) {
|
|
720
722
|
if (!name) {
|
|
721
723
|
return { valid: false, error: "Name is required" };
|
|
@@ -783,6 +785,36 @@ function addEmployee(employees, employee) {
|
|
|
783
785
|
}
|
|
784
786
|
return [...employees, normalized];
|
|
785
787
|
}
|
|
788
|
+
async function normalizeRosterCase(rosterPath) {
|
|
789
|
+
const employees = await loadEmployees(rosterPath);
|
|
790
|
+
let changed = false;
|
|
791
|
+
for (const emp of employees) {
|
|
792
|
+
if (emp.name !== emp.name.toLowerCase()) {
|
|
793
|
+
const oldName = emp.name;
|
|
794
|
+
emp.name = emp.name.toLowerCase();
|
|
795
|
+
changed = true;
|
|
796
|
+
try {
|
|
797
|
+
const identityDir = path5.join(os5.homedir(), ".exe-os", "identity");
|
|
798
|
+
const oldPath = path5.join(identityDir, `${oldName}.md`);
|
|
799
|
+
const newPath = path5.join(identityDir, `${emp.name}.md`);
|
|
800
|
+
if (existsSync5(oldPath) && !existsSync5(newPath)) {
|
|
801
|
+
renameSync3(oldPath, newPath);
|
|
802
|
+
} else if (existsSync5(oldPath) && oldPath !== newPath) {
|
|
803
|
+
const content = readFileSync5(oldPath, "utf-8");
|
|
804
|
+
writeFileSync3(newPath, content, "utf-8");
|
|
805
|
+
if (oldPath.toLowerCase() !== newPath.toLowerCase()) {
|
|
806
|
+
unlinkSync2(oldPath);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
} catch {
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
if (changed) {
|
|
814
|
+
await saveEmployees(employees, rosterPath);
|
|
815
|
+
}
|
|
816
|
+
return changed;
|
|
817
|
+
}
|
|
786
818
|
function findExeBin() {
|
|
787
819
|
try {
|
|
788
820
|
return execSync3(process.platform === "win32" ? "where exe-os" : "which exe-os", { encoding: "utf8" }).trim();
|
|
@@ -834,7 +866,7 @@ var init_employees = __esm({
|
|
|
834
866
|
});
|
|
835
867
|
|
|
836
868
|
// src/lib/license.ts
|
|
837
|
-
import { readFileSync as readFileSync6, writeFileSync as
|
|
869
|
+
import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, existsSync as existsSync6, mkdirSync as mkdirSync3 } from "fs";
|
|
838
870
|
import { randomUUID } from "crypto";
|
|
839
871
|
import path6 from "path";
|
|
840
872
|
import { jwtVerify, importSPKI } from "jose";
|
|
@@ -1277,11 +1309,11 @@ __export(tmux_routing_exports, {
|
|
|
1277
1309
|
verifyPaneAtCapacity: () => verifyPaneAtCapacity
|
|
1278
1310
|
});
|
|
1279
1311
|
import { execFileSync as execFileSync2, execSync as execSync4 } from "child_process";
|
|
1280
|
-
import { readFileSync as readFileSync8, writeFileSync as
|
|
1312
|
+
import { readFileSync as readFileSync8, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, existsSync as existsSync8, appendFileSync } from "fs";
|
|
1281
1313
|
import path8 from "path";
|
|
1282
|
-
import
|
|
1314
|
+
import os6 from "os";
|
|
1283
1315
|
import { fileURLToPath } from "url";
|
|
1284
|
-
import { unlinkSync as
|
|
1316
|
+
import { unlinkSync as unlinkSync3 } from "fs";
|
|
1285
1317
|
function spawnLockPath(sessionName) {
|
|
1286
1318
|
return path8.join(SPAWN_LOCK_DIR, `${sessionName}.lock`);
|
|
1287
1319
|
}
|
|
@@ -1308,12 +1340,12 @@ function acquireSpawnLock(sessionName) {
|
|
|
1308
1340
|
} catch {
|
|
1309
1341
|
}
|
|
1310
1342
|
}
|
|
1311
|
-
|
|
1343
|
+
writeFileSync5(lockFile, JSON.stringify({ pid: process.pid, timestamp: Date.now() }));
|
|
1312
1344
|
return true;
|
|
1313
1345
|
}
|
|
1314
1346
|
function releaseSpawnLock(sessionName) {
|
|
1315
1347
|
try {
|
|
1316
|
-
|
|
1348
|
+
unlinkSync3(spawnLockPath(sessionName));
|
|
1317
1349
|
} catch {
|
|
1318
1350
|
}
|
|
1319
1351
|
}
|
|
@@ -1395,7 +1427,7 @@ function registerParentExe(sessionKey, parentExe, dispatchedBy) {
|
|
|
1395
1427
|
}
|
|
1396
1428
|
const rootExe = extractRootExe(parentExe) ?? parentExe;
|
|
1397
1429
|
const filePath = path8.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`);
|
|
1398
|
-
|
|
1430
|
+
writeFileSync5(filePath, JSON.stringify({
|
|
1399
1431
|
parentExe: rootExe,
|
|
1400
1432
|
dispatchedBy: dispatchedBy || rootExe,
|
|
1401
1433
|
registeredAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1482,7 +1514,7 @@ function readDebounceState() {
|
|
|
1482
1514
|
function writeDebounceState(state) {
|
|
1483
1515
|
try {
|
|
1484
1516
|
if (!existsSync8(SESSION_CACHE)) mkdirSync4(SESSION_CACHE, { recursive: true });
|
|
1485
|
-
|
|
1517
|
+
writeFileSync5(DEBOUNCE_FILE, JSON.stringify(state));
|
|
1486
1518
|
} catch {
|
|
1487
1519
|
}
|
|
1488
1520
|
}
|
|
@@ -1671,7 +1703,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1671
1703
|
const transport = getTransport();
|
|
1672
1704
|
const sessionName = employeeSessionName(employeeName, exeSession, opts?.instance);
|
|
1673
1705
|
const instanceLabel = opts?.instance != null && opts.instance > 0 ? `${employeeName}${opts.instance}` : employeeName;
|
|
1674
|
-
const logDir = path8.join(
|
|
1706
|
+
const logDir = path8.join(os6.homedir(), ".exe-os", "session-logs");
|
|
1675
1707
|
const logFile = path8.join(logDir, `${instanceLabel}-${Date.now()}.log`);
|
|
1676
1708
|
if (!existsSync8(logDir)) {
|
|
1677
1709
|
mkdirSync4(logDir, { recursive: true });
|
|
@@ -1687,7 +1719,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1687
1719
|
} catch {
|
|
1688
1720
|
}
|
|
1689
1721
|
try {
|
|
1690
|
-
const claudeJsonPath = path8.join(
|
|
1722
|
+
const claudeJsonPath = path8.join(os6.homedir(), ".claude.json");
|
|
1691
1723
|
let claudeJson = {};
|
|
1692
1724
|
try {
|
|
1693
1725
|
claudeJson = JSON.parse(readFileSync8(claudeJsonPath, "utf8"));
|
|
@@ -1698,11 +1730,11 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1698
1730
|
const trustDir = opts?.cwd ?? projectDir;
|
|
1699
1731
|
if (!projects[trustDir]) projects[trustDir] = {};
|
|
1700
1732
|
projects[trustDir].hasTrustDialogAccepted = true;
|
|
1701
|
-
|
|
1733
|
+
writeFileSync5(claudeJsonPath, JSON.stringify(claudeJson, null, 2) + "\n");
|
|
1702
1734
|
} catch {
|
|
1703
1735
|
}
|
|
1704
1736
|
try {
|
|
1705
|
-
const settingsDir = path8.join(
|
|
1737
|
+
const settingsDir = path8.join(os6.homedir(), ".claude", "projects");
|
|
1706
1738
|
const normalizedKey = (opts?.cwd ?? projectDir).replace(/\//g, "-").replace(/^-/, "");
|
|
1707
1739
|
const projSettingsDir = path8.join(settingsDir, normalizedKey);
|
|
1708
1740
|
const settingsPath = path8.join(projSettingsDir, "settings.json");
|
|
@@ -1737,7 +1769,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1737
1769
|
perms.allow = allow;
|
|
1738
1770
|
settings.permissions = perms;
|
|
1739
1771
|
mkdirSync4(projSettingsDir, { recursive: true });
|
|
1740
|
-
|
|
1772
|
+
writeFileSync5(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
1741
1773
|
}
|
|
1742
1774
|
} catch {
|
|
1743
1775
|
}
|
|
@@ -1750,7 +1782,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1750
1782
|
let legacyFallbackWarned = false;
|
|
1751
1783
|
if (!useExeAgent && !useBinSymlink) {
|
|
1752
1784
|
const identityPath = path8.join(
|
|
1753
|
-
|
|
1785
|
+
os6.homedir(),
|
|
1754
1786
|
".exe-os",
|
|
1755
1787
|
"identity",
|
|
1756
1788
|
`${employeeName}.md`
|
|
@@ -1780,7 +1812,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1780
1812
|
}
|
|
1781
1813
|
let sessionContextFlag = "";
|
|
1782
1814
|
try {
|
|
1783
|
-
const ctxDir = path8.join(
|
|
1815
|
+
const ctxDir = path8.join(os6.homedir(), ".exe-os", "session-cache");
|
|
1784
1816
|
mkdirSync4(ctxDir, { recursive: true });
|
|
1785
1817
|
const ctxFile = path8.join(ctxDir, `session-context-${sessionName}.md`);
|
|
1786
1818
|
const ctxContent = [
|
|
@@ -1789,7 +1821,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1789
1821
|
`Your parent exe session is ${exeSession}.`,
|
|
1790
1822
|
`Your employees (if any) use the -${exeSession} suffix (e.g., tom-${exeSession}).`
|
|
1791
1823
|
].join("\n");
|
|
1792
|
-
|
|
1824
|
+
writeFileSync5(ctxFile, ctxContent);
|
|
1793
1825
|
sessionContextFlag = ` --append-system-prompt-file ${ctxFile}`;
|
|
1794
1826
|
} catch {
|
|
1795
1827
|
}
|
|
@@ -1828,7 +1860,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
1828
1860
|
try {
|
|
1829
1861
|
const mySession = getMySession();
|
|
1830
1862
|
const dispatchInfo = path8.join(SESSION_CACHE, `dispatch-info-${sessionName}.json`);
|
|
1831
|
-
|
|
1863
|
+
writeFileSync5(dispatchInfo, JSON.stringify({
|
|
1832
1864
|
dispatchedBy: mySession,
|
|
1833
1865
|
rootExe: exeSession,
|
|
1834
1866
|
provider: useBinSymlink ? ccProvider : useExeAgent ? opts.provider : "anthropic",
|
|
@@ -1891,13 +1923,13 @@ var init_tmux_routing = __esm({
|
|
|
1891
1923
|
init_provider_table();
|
|
1892
1924
|
init_intercom_queue();
|
|
1893
1925
|
init_plan_limits();
|
|
1894
|
-
SPAWN_LOCK_DIR = path8.join(
|
|
1895
|
-
SESSION_CACHE = path8.join(
|
|
1926
|
+
SPAWN_LOCK_DIR = path8.join(os6.homedir(), ".exe-os", "spawn-locks");
|
|
1927
|
+
SESSION_CACHE = path8.join(os6.homedir(), ".exe-os", "session-cache");
|
|
1896
1928
|
BEHAVIORS_EXPORT_TIMEOUT_MS = 1e4;
|
|
1897
1929
|
VALID_SESSION_NAME = /^[a-z]+\d*-[a-zA-Z0-9_]+$/;
|
|
1898
1930
|
VERIFY_PANE_LINES = 200;
|
|
1899
1931
|
INTERCOM_DEBOUNCE_MS = 3e4;
|
|
1900
|
-
INTERCOM_LOG2 = path8.join(
|
|
1932
|
+
INTERCOM_LOG2 = path8.join(os6.homedir(), ".exe-os", "intercom.log");
|
|
1901
1933
|
DEBOUNCE_FILE = path8.join(SESSION_CACHE, "intercom-debounce.json");
|
|
1902
1934
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
1903
1935
|
BUSY_PATTERN = /[✻✽✶✳·].*…|Running…/;
|
|
@@ -2346,7 +2378,7 @@ var init_tasks_crud = __esm({
|
|
|
2346
2378
|
|
|
2347
2379
|
// src/lib/tasks-review.ts
|
|
2348
2380
|
import path10 from "path";
|
|
2349
|
-
import { existsSync as existsSync10, readdirSync as readdirSync2, unlinkSync as
|
|
2381
|
+
import { existsSync as existsSync10, readdirSync as readdirSync2, unlinkSync as unlinkSync4 } from "fs";
|
|
2350
2382
|
async function countPendingReviews(sessionScope) {
|
|
2351
2383
|
const client = getClient();
|
|
2352
2384
|
if (sessionScope) {
|
|
@@ -2531,7 +2563,7 @@ async function cleanupReviewFile(row, taskFile, _baseDir) {
|
|
|
2531
2563
|
if (existsSync10(cacheDir)) {
|
|
2532
2564
|
for (const f of readdirSync2(cacheDir)) {
|
|
2533
2565
|
if (f.startsWith("review-notified-")) {
|
|
2534
|
-
|
|
2566
|
+
unlinkSync4(path10.join(cacheDir, f));
|
|
2535
2567
|
}
|
|
2536
2568
|
}
|
|
2537
2569
|
}
|
|
@@ -3137,7 +3169,7 @@ __export(tasks_exports, {
|
|
|
3137
3169
|
writeCheckpoint: () => writeCheckpoint
|
|
3138
3170
|
});
|
|
3139
3171
|
import path13 from "path";
|
|
3140
|
-
import { writeFileSync as
|
|
3172
|
+
import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, unlinkSync as unlinkSync5 } from "fs";
|
|
3141
3173
|
async function createTask(input) {
|
|
3142
3174
|
const result = await createTaskCore(input);
|
|
3143
3175
|
if (!input.skipDispatch && result.status !== "blocked" && !process.env.VITEST) {
|
|
@@ -3160,10 +3192,10 @@ async function updateTask(input) {
|
|
|
3160
3192
|
const cachePath = path13.join(cacheDir, `current-task-${agent}.json`);
|
|
3161
3193
|
if (input.status === "in_progress") {
|
|
3162
3194
|
mkdirSync5(cacheDir, { recursive: true });
|
|
3163
|
-
|
|
3195
|
+
writeFileSync6(cachePath, JSON.stringify({ taskId, title: String(row.title) }));
|
|
3164
3196
|
} else if (input.status === "done" || input.status === "blocked" || input.status === "cancelled") {
|
|
3165
3197
|
try {
|
|
3166
|
-
|
|
3198
|
+
unlinkSync5(cachePath);
|
|
3167
3199
|
} catch {
|
|
3168
3200
|
}
|
|
3169
3201
|
}
|
|
@@ -3302,7 +3334,7 @@ import { z } from "zod";
|
|
|
3302
3334
|
|
|
3303
3335
|
// src/adapters/claude/active-agent.ts
|
|
3304
3336
|
init_config();
|
|
3305
|
-
import { readFileSync as readFileSync10, writeFileSync as
|
|
3337
|
+
import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, mkdirSync as mkdirSync6, unlinkSync as unlinkSync6, readdirSync as readdirSync3 } from "fs";
|
|
3306
3338
|
import { execSync as execSync7 } from "child_process";
|
|
3307
3339
|
import path14 from "path";
|
|
3308
3340
|
|
|
@@ -3325,7 +3357,7 @@ function getActiveAgent() {
|
|
|
3325
3357
|
const age = Date.now() - new Date(data.startedAt).getTime();
|
|
3326
3358
|
if (age > STALE_MS) {
|
|
3327
3359
|
try {
|
|
3328
|
-
|
|
3360
|
+
unlinkSync6(markerPath);
|
|
3329
3361
|
} catch {
|
|
3330
3362
|
}
|
|
3331
3363
|
} else {
|
|
@@ -411,9 +411,10 @@ var init_intercom_queue = __esm({
|
|
|
411
411
|
|
|
412
412
|
// src/lib/employees.ts
|
|
413
413
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
414
|
-
import { existsSync as existsSync4, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
|
|
414
|
+
import { existsSync as existsSync4, symlinkSync, readlinkSync, readFileSync as readFileSync4, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
415
415
|
import { execSync as execSync3 } from "child_process";
|
|
416
416
|
import path5 from "path";
|
|
417
|
+
import os5 from "os";
|
|
417
418
|
var EMPLOYEES_PATH;
|
|
418
419
|
var init_employees = __esm({
|
|
419
420
|
"src/lib/employees.ts"() {
|
|
@@ -424,7 +425,7 @@ var init_employees = __esm({
|
|
|
424
425
|
});
|
|
425
426
|
|
|
426
427
|
// src/lib/license.ts
|
|
427
|
-
import { readFileSync as readFileSync5, writeFileSync as
|
|
428
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
|
|
428
429
|
import { randomUUID } from "crypto";
|
|
429
430
|
import path6 from "path";
|
|
430
431
|
import { jwtVerify, importSPKI } from "jose";
|
|
@@ -455,9 +456,9 @@ var init_plan_limits = __esm({
|
|
|
455
456
|
});
|
|
456
457
|
|
|
457
458
|
// src/lib/tmux-routing.ts
|
|
458
|
-
import { readFileSync as readFileSync7, writeFileSync as
|
|
459
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, mkdirSync as mkdirSync3, existsSync as existsSync7, appendFileSync } from "fs";
|
|
459
460
|
import path8 from "path";
|
|
460
|
-
import
|
|
461
|
+
import os6 from "os";
|
|
461
462
|
import { fileURLToPath } from "url";
|
|
462
463
|
function getMySession() {
|
|
463
464
|
return getTransport().getMySession();
|
|
@@ -499,9 +500,9 @@ var init_tmux_routing = __esm({
|
|
|
499
500
|
init_provider_table();
|
|
500
501
|
init_intercom_queue();
|
|
501
502
|
init_plan_limits();
|
|
502
|
-
SPAWN_LOCK_DIR = path8.join(
|
|
503
|
-
SESSION_CACHE = path8.join(
|
|
504
|
-
INTERCOM_LOG2 = path8.join(
|
|
503
|
+
SPAWN_LOCK_DIR = path8.join(os6.homedir(), ".exe-os", "spawn-locks");
|
|
504
|
+
SESSION_CACHE = path8.join(os6.homedir(), ".exe-os", "session-cache");
|
|
505
|
+
INTERCOM_LOG2 = path8.join(os6.homedir(), ".exe-os", "intercom.log");
|
|
505
506
|
DEBOUNCE_FILE = path8.join(SESSION_CACHE, "intercom-debounce.json");
|
|
506
507
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
507
508
|
}
|
|
@@ -597,7 +598,7 @@ var init_tasks_crud = __esm({
|
|
|
597
598
|
|
|
598
599
|
// src/lib/tasks-review.ts
|
|
599
600
|
import path10 from "path";
|
|
600
|
-
import { existsSync as existsSync9, readdirSync as readdirSync2, unlinkSync as
|
|
601
|
+
import { existsSync as existsSync9, readdirSync as readdirSync2, unlinkSync as unlinkSync3 } from "fs";
|
|
601
602
|
var init_tasks_review = __esm({
|
|
602
603
|
"src/lib/tasks-review.ts"() {
|
|
603
604
|
"use strict";
|
|
@@ -637,7 +638,7 @@ var init_tasks_notify = __esm({
|
|
|
637
638
|
|
|
638
639
|
// src/lib/tasks.ts
|
|
639
640
|
import path12 from "path";
|
|
640
|
-
import { writeFileSync as
|
|
641
|
+
import { writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, unlinkSync as unlinkSync4 } from "fs";
|
|
641
642
|
var init_tasks = __esm({
|
|
642
643
|
"src/lib/tasks.ts"() {
|
|
643
644
|
"use strict";
|
|
@@ -373,9 +373,10 @@ var init_config = __esm({
|
|
|
373
373
|
|
|
374
374
|
// src/lib/employees.ts
|
|
375
375
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
376
|
-
import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync3 } from "fs";
|
|
376
|
+
import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync3, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
377
377
|
import { execSync as execSync3 } from "child_process";
|
|
378
378
|
import path4 from "path";
|
|
379
|
+
import os4 from "os";
|
|
379
380
|
var EMPLOYEES_PATH;
|
|
380
381
|
var init_employees = __esm({
|
|
381
382
|
"src/lib/employees.ts"() {
|
|
@@ -386,7 +387,7 @@ var init_employees = __esm({
|
|
|
386
387
|
});
|
|
387
388
|
|
|
388
389
|
// src/lib/license.ts
|
|
389
|
-
import { readFileSync as readFileSync4, writeFileSync as
|
|
390
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync4, mkdirSync as mkdirSync2 } from "fs";
|
|
390
391
|
import { randomUUID } from "crypto";
|
|
391
392
|
import path5 from "path";
|
|
392
393
|
import { jwtVerify, importSPKI } from "jose";
|
|
@@ -417,9 +418,9 @@ var init_plan_limits = __esm({
|
|
|
417
418
|
});
|
|
418
419
|
|
|
419
420
|
// src/lib/tmux-routing.ts
|
|
420
|
-
import { readFileSync as readFileSync6, writeFileSync as
|
|
421
|
+
import { readFileSync as readFileSync6, writeFileSync as writeFileSync4, mkdirSync as mkdirSync3, existsSync as existsSync6, appendFileSync } from "fs";
|
|
421
422
|
import path7 from "path";
|
|
422
|
-
import
|
|
423
|
+
import os5 from "os";
|
|
423
424
|
import { fileURLToPath } from "url";
|
|
424
425
|
function getMySession() {
|
|
425
426
|
return getTransport().getMySession();
|
|
@@ -490,7 +491,7 @@ function readDebounceState() {
|
|
|
490
491
|
function writeDebounceState(state) {
|
|
491
492
|
try {
|
|
492
493
|
if (!existsSync6(SESSION_CACHE)) mkdirSync3(SESSION_CACHE, { recursive: true });
|
|
493
|
-
|
|
494
|
+
writeFileSync4(DEBOUNCE_FILE, JSON.stringify(state));
|
|
494
495
|
} catch {
|
|
495
496
|
}
|
|
496
497
|
}
|
|
@@ -592,11 +593,11 @@ var init_tmux_routing = __esm({
|
|
|
592
593
|
init_provider_table();
|
|
593
594
|
init_intercom_queue();
|
|
594
595
|
init_plan_limits();
|
|
595
|
-
SPAWN_LOCK_DIR = path7.join(
|
|
596
|
-
SESSION_CACHE = path7.join(
|
|
596
|
+
SPAWN_LOCK_DIR = path7.join(os5.homedir(), ".exe-os", "spawn-locks");
|
|
597
|
+
SESSION_CACHE = path7.join(os5.homedir(), ".exe-os", "session-cache");
|
|
597
598
|
VALID_SESSION_NAME = /^[a-z]+\d*-[a-zA-Z0-9_]+$/;
|
|
598
599
|
INTERCOM_DEBOUNCE_MS = 3e4;
|
|
599
|
-
INTERCOM_LOG2 = path7.join(
|
|
600
|
+
INTERCOM_LOG2 = path7.join(os5.homedir(), ".exe-os", "intercom.log");
|
|
600
601
|
DEBOUNCE_FILE = path7.join(SESSION_CACHE, "intercom-debounce.json");
|
|
601
602
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
602
603
|
BUSY_PATTERN = /[✻✽✶✳·].*…|Running…/;
|
|
@@ -750,7 +751,7 @@ async function markFailed(messageId, reason) {
|
|
|
750
751
|
|
|
751
752
|
// src/adapters/claude/active-agent.ts
|
|
752
753
|
init_config();
|
|
753
|
-
import { readFileSync as readFileSync7, writeFileSync as
|
|
754
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, unlinkSync as unlinkSync2, readdirSync } from "fs";
|
|
754
755
|
import { execSync as execSync4 } from "child_process";
|
|
755
756
|
import path8 from "path";
|
|
756
757
|
|
|
@@ -773,7 +774,7 @@ function getActiveAgent() {
|
|
|
773
774
|
const age = Date.now() - new Date(data.startedAt).getTime();
|
|
774
775
|
if (age > STALE_MS) {
|
|
775
776
|
try {
|
|
776
|
-
|
|
777
|
+
unlinkSync2(markerPath);
|
|
777
778
|
} catch {
|
|
778
779
|
}
|
|
779
780
|
} else {
|
|
@@ -572,9 +572,10 @@ var init_intercom_queue = __esm({
|
|
|
572
572
|
|
|
573
573
|
// src/lib/employees.ts
|
|
574
574
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
575
|
-
import { existsSync as existsSync4, symlinkSync, readlinkSync, readFileSync as readFileSync4 } from "fs";
|
|
575
|
+
import { existsSync as existsSync4, symlinkSync, readlinkSync, readFileSync as readFileSync4, renameSync as renameSync3, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
576
576
|
import { execSync as execSync3 } from "child_process";
|
|
577
577
|
import path5 from "path";
|
|
578
|
+
import os5 from "os";
|
|
578
579
|
var EMPLOYEES_PATH;
|
|
579
580
|
var init_employees = __esm({
|
|
580
581
|
"src/lib/employees.ts"() {
|
|
@@ -585,7 +586,7 @@ var init_employees = __esm({
|
|
|
585
586
|
});
|
|
586
587
|
|
|
587
588
|
// src/lib/license.ts
|
|
588
|
-
import { readFileSync as readFileSync5, writeFileSync as
|
|
589
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
|
|
589
590
|
import { randomUUID } from "crypto";
|
|
590
591
|
import path6 from "path";
|
|
591
592
|
import { jwtVerify, importSPKI } from "jose";
|
|
@@ -616,9 +617,9 @@ var init_plan_limits = __esm({
|
|
|
616
617
|
});
|
|
617
618
|
|
|
618
619
|
// src/lib/tmux-routing.ts
|
|
619
|
-
import { readFileSync as readFileSync7, writeFileSync as
|
|
620
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, mkdirSync as mkdirSync3, existsSync as existsSync7, appendFileSync } from "fs";
|
|
620
621
|
import path8 from "path";
|
|
621
|
-
import
|
|
622
|
+
import os6 from "os";
|
|
622
623
|
import { fileURLToPath } from "url";
|
|
623
624
|
function getMySession() {
|
|
624
625
|
return getTransport().getMySession();
|
|
@@ -670,7 +671,7 @@ function readDebounceState() {
|
|
|
670
671
|
function writeDebounceState(state) {
|
|
671
672
|
try {
|
|
672
673
|
if (!existsSync7(SESSION_CACHE)) mkdirSync3(SESSION_CACHE, { recursive: true });
|
|
673
|
-
|
|
674
|
+
writeFileSync4(DEBOUNCE_FILE, JSON.stringify(state));
|
|
674
675
|
} catch {
|
|
675
676
|
}
|
|
676
677
|
}
|
|
@@ -794,10 +795,10 @@ var init_tmux_routing = __esm({
|
|
|
794
795
|
init_provider_table();
|
|
795
796
|
init_intercom_queue();
|
|
796
797
|
init_plan_limits();
|
|
797
|
-
SPAWN_LOCK_DIR = path8.join(
|
|
798
|
-
SESSION_CACHE = path8.join(
|
|
798
|
+
SPAWN_LOCK_DIR = path8.join(os6.homedir(), ".exe-os", "spawn-locks");
|
|
799
|
+
SESSION_CACHE = path8.join(os6.homedir(), ".exe-os", "session-cache");
|
|
799
800
|
INTERCOM_DEBOUNCE_MS = 3e4;
|
|
800
|
-
INTERCOM_LOG2 = path8.join(
|
|
801
|
+
INTERCOM_LOG2 = path8.join(os6.homedir(), ".exe-os", "intercom.log");
|
|
801
802
|
DEBOUNCE_FILE = path8.join(SESSION_CACHE, "intercom-debounce.json");
|
|
802
803
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
803
804
|
BUSY_PATTERN = /[✻✽✶✳·].*…|Running…/;
|
|
@@ -1022,7 +1023,7 @@ var init_tasks_crud = __esm({
|
|
|
1022
1023
|
|
|
1023
1024
|
// src/lib/tasks-review.ts
|
|
1024
1025
|
import path10 from "path";
|
|
1025
|
-
import { existsSync as existsSync9, readdirSync as readdirSync2, unlinkSync as
|
|
1026
|
+
import { existsSync as existsSync9, readdirSync as readdirSync2, unlinkSync as unlinkSync3 } from "fs";
|
|
1026
1027
|
async function cleanupReviewFile(row, taskFile, _baseDir) {
|
|
1027
1028
|
if (String(row.assigned_by) !== "system" || !taskFile.includes("review-")) return;
|
|
1028
1029
|
try {
|
|
@@ -1071,7 +1072,7 @@ async function cleanupReviewFile(row, taskFile, _baseDir) {
|
|
|
1071
1072
|
if (existsSync9(cacheDir)) {
|
|
1072
1073
|
for (const f of readdirSync2(cacheDir)) {
|
|
1073
1074
|
if (f.startsWith("review-notified-")) {
|
|
1074
|
-
|
|
1075
|
+
unlinkSync3(path10.join(cacheDir, f));
|
|
1075
1076
|
}
|
|
1076
1077
|
}
|
|
1077
1078
|
}
|
|
@@ -1513,7 +1514,7 @@ var init_skill_learning = __esm({
|
|
|
1513
1514
|
|
|
1514
1515
|
// src/lib/tasks.ts
|
|
1515
1516
|
import path12 from "path";
|
|
1516
|
-
import { writeFileSync as
|
|
1517
|
+
import { writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, unlinkSync as unlinkSync4 } from "fs";
|
|
1517
1518
|
async function updateTask(input) {
|
|
1518
1519
|
const { row, taskFile, now, taskId } = await updateTaskStatus(input);
|
|
1519
1520
|
try {
|
|
@@ -1522,10 +1523,10 @@ async function updateTask(input) {
|
|
|
1522
1523
|
const cachePath = path12.join(cacheDir, `current-task-${agent}.json`);
|
|
1523
1524
|
if (input.status === "in_progress") {
|
|
1524
1525
|
mkdirSync4(cacheDir, { recursive: true });
|
|
1525
|
-
|
|
1526
|
+
writeFileSync5(cachePath, JSON.stringify({ taskId, title: String(row.title) }));
|
|
1526
1527
|
} else if (input.status === "done" || input.status === "blocked" || input.status === "cancelled") {
|
|
1527
1528
|
try {
|
|
1528
|
-
|
|
1529
|
+
unlinkSync4(cachePath);
|
|
1529
1530
|
} catch {
|
|
1530
1531
|
}
|
|
1531
1532
|
}
|
|
@@ -1662,7 +1663,7 @@ __export(active_agent_exports, {
|
|
|
1662
1663
|
getAllActiveAgents: () => getAllActiveAgents,
|
|
1663
1664
|
writeActiveAgent: () => writeActiveAgent
|
|
1664
1665
|
});
|
|
1665
|
-
import { readFileSync as readFileSync9, writeFileSync as
|
|
1666
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync5, unlinkSync as unlinkSync5, readdirSync as readdirSync3 } from "fs";
|
|
1666
1667
|
import { execSync as execSync5 } from "child_process";
|
|
1667
1668
|
import path13 from "path";
|
|
1668
1669
|
function getMarkerPath() {
|
|
@@ -1671,7 +1672,7 @@ function getMarkerPath() {
|
|
|
1671
1672
|
function writeActiveAgent(agentId, agentRole) {
|
|
1672
1673
|
try {
|
|
1673
1674
|
mkdirSync5(CACHE_DIR, { recursive: true });
|
|
1674
|
-
|
|
1675
|
+
writeFileSync6(
|
|
1675
1676
|
getMarkerPath(),
|
|
1676
1677
|
JSON.stringify({ agentId, agentRole, startedAt: (/* @__PURE__ */ new Date()).toISOString() })
|
|
1677
1678
|
);
|
|
@@ -1680,7 +1681,7 @@ function writeActiveAgent(agentId, agentRole) {
|
|
|
1680
1681
|
}
|
|
1681
1682
|
function clearActiveAgent() {
|
|
1682
1683
|
try {
|
|
1683
|
-
|
|
1684
|
+
unlinkSync5(getMarkerPath());
|
|
1684
1685
|
} catch {
|
|
1685
1686
|
}
|
|
1686
1687
|
}
|
|
@@ -1694,7 +1695,7 @@ function getActiveAgent() {
|
|
|
1694
1695
|
const age = Date.now() - new Date(data.startedAt).getTime();
|
|
1695
1696
|
if (age > STALE_MS) {
|
|
1696
1697
|
try {
|
|
1697
|
-
|
|
1698
|
+
unlinkSync5(markerPath);
|
|
1698
1699
|
} catch {
|
|
1699
1700
|
}
|
|
1700
1701
|
} else {
|
|
@@ -1747,7 +1748,7 @@ function getAllActiveAgents() {
|
|
|
1747
1748
|
const age = Date.now() - new Date(data.startedAt).getTime();
|
|
1748
1749
|
if (age > STALE_MS) {
|
|
1749
1750
|
try {
|
|
1750
|
-
|
|
1751
|
+
unlinkSync5(path13.join(CACHE_DIR, file));
|
|
1751
1752
|
} catch {
|
|
1752
1753
|
}
|
|
1753
1754
|
continue;
|
|
@@ -1770,11 +1771,11 @@ function getAllActiveAgents() {
|
|
|
1770
1771
|
function cleanupSessionMarkers() {
|
|
1771
1772
|
const key = getSessionKey();
|
|
1772
1773
|
try {
|
|
1773
|
-
|
|
1774
|
+
unlinkSync5(path13.join(CACHE_DIR, `active-agent-${key}.json`));
|
|
1774
1775
|
} catch {
|
|
1775
1776
|
}
|
|
1776
1777
|
try {
|
|
1777
|
-
|
|
1778
|
+
unlinkSync5(path13.join(CACHE_DIR, "active-agent-undefined.json"));
|
|
1778
1779
|
} catch {
|
|
1779
1780
|
}
|
|
1780
1781
|
}
|