@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
package/dist/mcp/server.js
CHANGED
|
@@ -3296,14 +3296,16 @@ __export(employees_exports, {
|
|
|
3296
3296
|
isMultiInstance: () => isMultiInstance,
|
|
3297
3297
|
loadEmployees: () => loadEmployees,
|
|
3298
3298
|
loadEmployeesSync: () => loadEmployeesSync,
|
|
3299
|
+
normalizeRosterCase: () => normalizeRosterCase,
|
|
3299
3300
|
registerBinSymlinks: () => registerBinSymlinks,
|
|
3300
3301
|
saveEmployees: () => saveEmployees,
|
|
3301
3302
|
validateEmployeeName: () => validateEmployeeName
|
|
3302
3303
|
});
|
|
3303
3304
|
import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
3304
|
-
import { existsSync as existsSync7, symlinkSync, readlinkSync, readFileSync as readFileSync5 } from "fs";
|
|
3305
|
+
import { existsSync as existsSync7, symlinkSync, readlinkSync, readFileSync as readFileSync5, renameSync as renameSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
3305
3306
|
import { execSync as execSync5 } from "child_process";
|
|
3306
3307
|
import path9 from "path";
|
|
3308
|
+
import os3 from "os";
|
|
3307
3309
|
function validateEmployeeName(name) {
|
|
3308
3310
|
if (!name) {
|
|
3309
3311
|
return { valid: false, error: "Name is required" };
|
|
@@ -3371,6 +3373,36 @@ function addEmployee(employees, employee) {
|
|
|
3371
3373
|
}
|
|
3372
3374
|
return [...employees, normalized];
|
|
3373
3375
|
}
|
|
3376
|
+
async function normalizeRosterCase(rosterPath) {
|
|
3377
|
+
const employees = await loadEmployees(rosterPath);
|
|
3378
|
+
let changed = false;
|
|
3379
|
+
for (const emp of employees) {
|
|
3380
|
+
if (emp.name !== emp.name.toLowerCase()) {
|
|
3381
|
+
const oldName = emp.name;
|
|
3382
|
+
emp.name = emp.name.toLowerCase();
|
|
3383
|
+
changed = true;
|
|
3384
|
+
try {
|
|
3385
|
+
const identityDir = path9.join(os3.homedir(), ".exe-os", "identity");
|
|
3386
|
+
const oldPath = path9.join(identityDir, `${oldName}.md`);
|
|
3387
|
+
const newPath = path9.join(identityDir, `${emp.name}.md`);
|
|
3388
|
+
if (existsSync7(oldPath) && !existsSync7(newPath)) {
|
|
3389
|
+
renameSync2(oldPath, newPath);
|
|
3390
|
+
} else if (existsSync7(oldPath) && oldPath !== newPath) {
|
|
3391
|
+
const content = readFileSync5(oldPath, "utf-8");
|
|
3392
|
+
writeFileSync2(newPath, content, "utf-8");
|
|
3393
|
+
if (oldPath.toLowerCase() !== newPath.toLowerCase()) {
|
|
3394
|
+
unlinkSync3(oldPath);
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
} catch {
|
|
3398
|
+
}
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
if (changed) {
|
|
3402
|
+
await saveEmployees(employees, rosterPath);
|
|
3403
|
+
}
|
|
3404
|
+
return changed;
|
|
3405
|
+
}
|
|
3374
3406
|
function findExeBin() {
|
|
3375
3407
|
try {
|
|
3376
3408
|
return execSync5(process.platform === "win32" ? "where exe-os" : "which exe-os", { encoding: "utf8" }).trim();
|
|
@@ -3438,7 +3470,7 @@ __export(license_exports, {
|
|
|
3438
3470
|
stopLicenseRevalidation: () => stopLicenseRevalidation,
|
|
3439
3471
|
validateLicense: () => validateLicense
|
|
3440
3472
|
});
|
|
3441
|
-
import { readFileSync as readFileSync6, writeFileSync as
|
|
3473
|
+
import { readFileSync as readFileSync6, writeFileSync as writeFileSync3, existsSync as existsSync8, mkdirSync as mkdirSync3 } from "fs";
|
|
3442
3474
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
3443
3475
|
import path10 from "path";
|
|
3444
3476
|
import { jwtVerify, importSPKI } from "jose";
|
|
@@ -3468,7 +3500,7 @@ function loadDeviceId() {
|
|
|
3468
3500
|
}
|
|
3469
3501
|
const id = randomUUID3();
|
|
3470
3502
|
mkdirSync3(EXE_AI_DIR, { recursive: true });
|
|
3471
|
-
|
|
3503
|
+
writeFileSync3(DEVICE_ID_PATH, id, "utf8");
|
|
3472
3504
|
return id;
|
|
3473
3505
|
}
|
|
3474
3506
|
function loadLicense() {
|
|
@@ -3481,7 +3513,7 @@ function loadLicense() {
|
|
|
3481
3513
|
}
|
|
3482
3514
|
function saveLicense(apiKey) {
|
|
3483
3515
|
mkdirSync3(EXE_AI_DIR, { recursive: true });
|
|
3484
|
-
|
|
3516
|
+
writeFileSync3(LICENSE_PATH, apiKey.trim(), { encoding: "utf8", mode: 384 });
|
|
3485
3517
|
}
|
|
3486
3518
|
async function verifyLicenseJwt(token) {
|
|
3487
3519
|
try {
|
|
@@ -3552,7 +3584,7 @@ function getRawCachedPlan() {
|
|
|
3552
3584
|
}
|
|
3553
3585
|
function cacheResponse(token) {
|
|
3554
3586
|
try {
|
|
3555
|
-
|
|
3587
|
+
writeFileSync3(CACHE_PATH, JSON.stringify({ token }), "utf8");
|
|
3556
3588
|
} catch {
|
|
3557
3589
|
}
|
|
3558
3590
|
}
|
|
@@ -3936,11 +3968,11 @@ var init_plan_limits = __esm({
|
|
|
3936
3968
|
// src/lib/notifications.ts
|
|
3937
3969
|
import crypto4 from "crypto";
|
|
3938
3970
|
import path14 from "path";
|
|
3939
|
-
import
|
|
3971
|
+
import os4 from "os";
|
|
3940
3972
|
import {
|
|
3941
3973
|
readFileSync as readFileSync8,
|
|
3942
3974
|
readdirSync as readdirSync4,
|
|
3943
|
-
unlinkSync as
|
|
3975
|
+
unlinkSync as unlinkSync4,
|
|
3944
3976
|
existsSync as existsSync10,
|
|
3945
3977
|
rmdirSync
|
|
3946
3978
|
} from "fs";
|
|
@@ -3986,9 +4018,9 @@ var init_notifications = __esm({
|
|
|
3986
4018
|
});
|
|
3987
4019
|
|
|
3988
4020
|
// src/lib/session-registry.ts
|
|
3989
|
-
import { readFileSync as readFileSync9, writeFileSync as
|
|
4021
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync4, existsSync as existsSync11 } from "fs";
|
|
3990
4022
|
import path15 from "path";
|
|
3991
|
-
import
|
|
4023
|
+
import os5 from "os";
|
|
3992
4024
|
function registerSession(entry) {
|
|
3993
4025
|
const dir = path15.dirname(REGISTRY_PATH);
|
|
3994
4026
|
if (!existsSync11(dir)) {
|
|
@@ -4001,7 +4033,7 @@ function registerSession(entry) {
|
|
|
4001
4033
|
} else {
|
|
4002
4034
|
sessions.push(entry);
|
|
4003
4035
|
}
|
|
4004
|
-
|
|
4036
|
+
writeFileSync6(REGISTRY_PATH, JSON.stringify(sessions, null, 2));
|
|
4005
4037
|
}
|
|
4006
4038
|
function listSessions() {
|
|
4007
4039
|
try {
|
|
@@ -4015,7 +4047,7 @@ var REGISTRY_PATH;
|
|
|
4015
4047
|
var init_session_registry = __esm({
|
|
4016
4048
|
"src/lib/session-registry.ts"() {
|
|
4017
4049
|
"use strict";
|
|
4018
|
-
REGISTRY_PATH = path15.join(
|
|
4050
|
+
REGISTRY_PATH = path15.join(os5.homedir(), ".exe-os", "session-registry.json");
|
|
4019
4051
|
}
|
|
4020
4052
|
});
|
|
4021
4053
|
|
|
@@ -4200,9 +4232,9 @@ var init_provider_table = __esm({
|
|
|
4200
4232
|
});
|
|
4201
4233
|
|
|
4202
4234
|
// src/lib/intercom-queue.ts
|
|
4203
|
-
import { readFileSync as readFileSync10, writeFileSync as
|
|
4235
|
+
import { readFileSync as readFileSync10, writeFileSync as writeFileSync7, renameSync as renameSync3, existsSync as existsSync12, mkdirSync as mkdirSync5 } from "fs";
|
|
4204
4236
|
import path16 from "path";
|
|
4205
|
-
import
|
|
4237
|
+
import os6 from "os";
|
|
4206
4238
|
function ensureDir() {
|
|
4207
4239
|
const dir = path16.dirname(QUEUE_PATH);
|
|
4208
4240
|
if (!existsSync12(dir)) mkdirSync5(dir, { recursive: true });
|
|
@@ -4218,8 +4250,8 @@ function readQueue() {
|
|
|
4218
4250
|
function writeQueue(queue) {
|
|
4219
4251
|
ensureDir();
|
|
4220
4252
|
const tmp = `${QUEUE_PATH}.tmp`;
|
|
4221
|
-
|
|
4222
|
-
|
|
4253
|
+
writeFileSync7(tmp, JSON.stringify(queue, null, 2));
|
|
4254
|
+
renameSync3(tmp, QUEUE_PATH);
|
|
4223
4255
|
}
|
|
4224
4256
|
function queueIntercom(targetSession, reason) {
|
|
4225
4257
|
const queue = readQueue();
|
|
@@ -4242,9 +4274,9 @@ var QUEUE_PATH, TTL_MS, INTERCOM_LOG;
|
|
|
4242
4274
|
var init_intercom_queue = __esm({
|
|
4243
4275
|
"src/lib/intercom-queue.ts"() {
|
|
4244
4276
|
"use strict";
|
|
4245
|
-
QUEUE_PATH = path16.join(
|
|
4277
|
+
QUEUE_PATH = path16.join(os6.homedir(), ".exe-os", "intercom-queue.json");
|
|
4246
4278
|
TTL_MS = 60 * 60 * 1e3;
|
|
4247
|
-
INTERCOM_LOG = path16.join(
|
|
4279
|
+
INTERCOM_LOG = path16.join(os6.homedir(), ".exe-os", "intercom.log");
|
|
4248
4280
|
}
|
|
4249
4281
|
});
|
|
4250
4282
|
|
|
@@ -4591,11 +4623,11 @@ __export(tmux_routing_exports, {
|
|
|
4591
4623
|
verifyPaneAtCapacity: () => verifyPaneAtCapacity
|
|
4592
4624
|
});
|
|
4593
4625
|
import { execFileSync as execFileSync2, execSync as execSync7 } from "child_process";
|
|
4594
|
-
import { readFileSync as readFileSync11, writeFileSync as
|
|
4626
|
+
import { readFileSync as readFileSync11, writeFileSync as writeFileSync8, mkdirSync as mkdirSync6, existsSync as existsSync13, appendFileSync } from "fs";
|
|
4595
4627
|
import path17 from "path";
|
|
4596
|
-
import
|
|
4628
|
+
import os7 from "os";
|
|
4597
4629
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
4598
|
-
import { unlinkSync as
|
|
4630
|
+
import { unlinkSync as unlinkSync5 } from "fs";
|
|
4599
4631
|
function spawnLockPath(sessionName) {
|
|
4600
4632
|
return path17.join(SPAWN_LOCK_DIR, `${sessionName}.lock`);
|
|
4601
4633
|
}
|
|
@@ -4622,12 +4654,12 @@ function acquireSpawnLock2(sessionName) {
|
|
|
4622
4654
|
} catch {
|
|
4623
4655
|
}
|
|
4624
4656
|
}
|
|
4625
|
-
|
|
4657
|
+
writeFileSync8(lockFile, JSON.stringify({ pid: process.pid, timestamp: Date.now() }));
|
|
4626
4658
|
return true;
|
|
4627
4659
|
}
|
|
4628
4660
|
function releaseSpawnLock2(sessionName) {
|
|
4629
4661
|
try {
|
|
4630
|
-
|
|
4662
|
+
unlinkSync5(spawnLockPath(sessionName));
|
|
4631
4663
|
} catch {
|
|
4632
4664
|
}
|
|
4633
4665
|
}
|
|
@@ -4709,7 +4741,7 @@ function registerParentExe(sessionKey, parentExe, dispatchedBy) {
|
|
|
4709
4741
|
}
|
|
4710
4742
|
const rootExe = extractRootExe(parentExe) ?? parentExe;
|
|
4711
4743
|
const filePath = path17.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`);
|
|
4712
|
-
|
|
4744
|
+
writeFileSync8(filePath, JSON.stringify({
|
|
4713
4745
|
parentExe: rootExe,
|
|
4714
4746
|
dispatchedBy: dispatchedBy || rootExe,
|
|
4715
4747
|
registeredAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -4796,7 +4828,7 @@ function readDebounceState() {
|
|
|
4796
4828
|
function writeDebounceState(state) {
|
|
4797
4829
|
try {
|
|
4798
4830
|
if (!existsSync13(SESSION_CACHE)) mkdirSync6(SESSION_CACHE, { recursive: true });
|
|
4799
|
-
|
|
4831
|
+
writeFileSync8(DEBOUNCE_FILE, JSON.stringify(state));
|
|
4800
4832
|
} catch {
|
|
4801
4833
|
}
|
|
4802
4834
|
}
|
|
@@ -4985,7 +5017,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
4985
5017
|
const transport = getTransport();
|
|
4986
5018
|
const sessionName = employeeSessionName(employeeName, exeSession, opts?.instance);
|
|
4987
5019
|
const instanceLabel = opts?.instance != null && opts.instance > 0 ? `${employeeName}${opts.instance}` : employeeName;
|
|
4988
|
-
const logDir = path17.join(
|
|
5020
|
+
const logDir = path17.join(os7.homedir(), ".exe-os", "session-logs");
|
|
4989
5021
|
const logFile = path17.join(logDir, `${instanceLabel}-${Date.now()}.log`);
|
|
4990
5022
|
if (!existsSync13(logDir)) {
|
|
4991
5023
|
mkdirSync6(logDir, { recursive: true });
|
|
@@ -5001,7 +5033,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
5001
5033
|
} catch {
|
|
5002
5034
|
}
|
|
5003
5035
|
try {
|
|
5004
|
-
const claudeJsonPath = path17.join(
|
|
5036
|
+
const claudeJsonPath = path17.join(os7.homedir(), ".claude.json");
|
|
5005
5037
|
let claudeJson = {};
|
|
5006
5038
|
try {
|
|
5007
5039
|
claudeJson = JSON.parse(readFileSync11(claudeJsonPath, "utf8"));
|
|
@@ -5012,11 +5044,11 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
5012
5044
|
const trustDir = opts?.cwd ?? projectDir;
|
|
5013
5045
|
if (!projects[trustDir]) projects[trustDir] = {};
|
|
5014
5046
|
projects[trustDir].hasTrustDialogAccepted = true;
|
|
5015
|
-
|
|
5047
|
+
writeFileSync8(claudeJsonPath, JSON.stringify(claudeJson, null, 2) + "\n");
|
|
5016
5048
|
} catch {
|
|
5017
5049
|
}
|
|
5018
5050
|
try {
|
|
5019
|
-
const settingsDir = path17.join(
|
|
5051
|
+
const settingsDir = path17.join(os7.homedir(), ".claude", "projects");
|
|
5020
5052
|
const normalizedKey = (opts?.cwd ?? projectDir).replace(/\//g, "-").replace(/^-/, "");
|
|
5021
5053
|
const projSettingsDir = path17.join(settingsDir, normalizedKey);
|
|
5022
5054
|
const settingsPath = path17.join(projSettingsDir, "settings.json");
|
|
@@ -5051,7 +5083,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
5051
5083
|
perms.allow = allow;
|
|
5052
5084
|
settings.permissions = perms;
|
|
5053
5085
|
mkdirSync6(projSettingsDir, { recursive: true });
|
|
5054
|
-
|
|
5086
|
+
writeFileSync8(settingsPath, JSON.stringify(settings, null, 2) + "\n");
|
|
5055
5087
|
}
|
|
5056
5088
|
} catch {
|
|
5057
5089
|
}
|
|
@@ -5064,7 +5096,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
5064
5096
|
let legacyFallbackWarned = false;
|
|
5065
5097
|
if (!useExeAgent && !useBinSymlink) {
|
|
5066
5098
|
const identityPath2 = path17.join(
|
|
5067
|
-
|
|
5099
|
+
os7.homedir(),
|
|
5068
5100
|
".exe-os",
|
|
5069
5101
|
"identity",
|
|
5070
5102
|
`${employeeName}.md`
|
|
@@ -5094,7 +5126,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
5094
5126
|
}
|
|
5095
5127
|
let sessionContextFlag = "";
|
|
5096
5128
|
try {
|
|
5097
|
-
const ctxDir = path17.join(
|
|
5129
|
+
const ctxDir = path17.join(os7.homedir(), ".exe-os", "session-cache");
|
|
5098
5130
|
mkdirSync6(ctxDir, { recursive: true });
|
|
5099
5131
|
const ctxFile = path17.join(ctxDir, `session-context-${sessionName}.md`);
|
|
5100
5132
|
const ctxContent = [
|
|
@@ -5103,7 +5135,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
5103
5135
|
`Your parent exe session is ${exeSession}.`,
|
|
5104
5136
|
`Your employees (if any) use the -${exeSession} suffix (e.g., tom-${exeSession}).`
|
|
5105
5137
|
].join("\n");
|
|
5106
|
-
|
|
5138
|
+
writeFileSync8(ctxFile, ctxContent);
|
|
5107
5139
|
sessionContextFlag = ` --append-system-prompt-file ${ctxFile}`;
|
|
5108
5140
|
} catch {
|
|
5109
5141
|
}
|
|
@@ -5142,7 +5174,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
|
|
|
5142
5174
|
try {
|
|
5143
5175
|
const mySession = getMySession();
|
|
5144
5176
|
const dispatchInfo = path17.join(SESSION_CACHE, `dispatch-info-${sessionName}.json`);
|
|
5145
|
-
|
|
5177
|
+
writeFileSync8(dispatchInfo, JSON.stringify({
|
|
5146
5178
|
dispatchedBy: mySession,
|
|
5147
5179
|
rootExe: exeSession,
|
|
5148
5180
|
provider: useBinSymlink ? ccProvider : useExeAgent ? opts.provider : "anthropic",
|
|
@@ -5205,13 +5237,13 @@ var init_tmux_routing = __esm({
|
|
|
5205
5237
|
init_provider_table();
|
|
5206
5238
|
init_intercom_queue();
|
|
5207
5239
|
init_plan_limits();
|
|
5208
|
-
SPAWN_LOCK_DIR = path17.join(
|
|
5209
|
-
SESSION_CACHE = path17.join(
|
|
5240
|
+
SPAWN_LOCK_DIR = path17.join(os7.homedir(), ".exe-os", "spawn-locks");
|
|
5241
|
+
SESSION_CACHE = path17.join(os7.homedir(), ".exe-os", "session-cache");
|
|
5210
5242
|
BEHAVIORS_EXPORT_TIMEOUT_MS = 1e4;
|
|
5211
5243
|
VALID_SESSION_NAME = /^[a-z]+\d*-[a-zA-Z0-9_]+$/;
|
|
5212
5244
|
VERIFY_PANE_LINES = 200;
|
|
5213
5245
|
INTERCOM_DEBOUNCE_MS = 3e4;
|
|
5214
|
-
INTERCOM_LOG2 = path17.join(
|
|
5246
|
+
INTERCOM_LOG2 = path17.join(os7.homedir(), ".exe-os", "intercom.log");
|
|
5215
5247
|
DEBOUNCE_FILE = path17.join(SESSION_CACHE, "intercom-debounce.json");
|
|
5216
5248
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
5217
5249
|
BUSY_PATTERN = /[✻✽✶✳·].*…|Running…/;
|
|
@@ -5660,7 +5692,7 @@ var init_tasks_crud = __esm({
|
|
|
5660
5692
|
|
|
5661
5693
|
// src/lib/tasks-review.ts
|
|
5662
5694
|
import path19 from "path";
|
|
5663
|
-
import { existsSync as existsSync15, readdirSync as readdirSync5, unlinkSync as
|
|
5695
|
+
import { existsSync as existsSync15, readdirSync as readdirSync5, unlinkSync as unlinkSync6 } from "fs";
|
|
5664
5696
|
async function countPendingReviews(sessionScope) {
|
|
5665
5697
|
const client = getClient();
|
|
5666
5698
|
if (sessionScope) {
|
|
@@ -5845,7 +5877,7 @@ async function cleanupReviewFile(row, taskFile, _baseDir) {
|
|
|
5845
5877
|
if (existsSync15(cacheDir)) {
|
|
5846
5878
|
for (const f of readdirSync5(cacheDir)) {
|
|
5847
5879
|
if (f.startsWith("review-notified-")) {
|
|
5848
|
-
|
|
5880
|
+
unlinkSync6(path19.join(cacheDir, f));
|
|
5849
5881
|
}
|
|
5850
5882
|
}
|
|
5851
5883
|
}
|
|
@@ -6437,7 +6469,7 @@ __export(tasks_exports, {
|
|
|
6437
6469
|
writeCheckpoint: () => writeCheckpoint
|
|
6438
6470
|
});
|
|
6439
6471
|
import path21 from "path";
|
|
6440
|
-
import { writeFileSync as
|
|
6472
|
+
import { writeFileSync as writeFileSync9, mkdirSync as mkdirSync7, unlinkSync as unlinkSync7 } from "fs";
|
|
6441
6473
|
async function createTask(input) {
|
|
6442
6474
|
const result = await createTaskCore(input);
|
|
6443
6475
|
if (!input.skipDispatch && result.status !== "blocked" && !process.env.VITEST) {
|
|
@@ -6460,10 +6492,10 @@ async function updateTask(input) {
|
|
|
6460
6492
|
const cachePath = path21.join(cacheDir, `current-task-${agent}.json`);
|
|
6461
6493
|
if (input.status === "in_progress") {
|
|
6462
6494
|
mkdirSync7(cacheDir, { recursive: true });
|
|
6463
|
-
|
|
6495
|
+
writeFileSync9(cachePath, JSON.stringify({ taskId, title: String(row.title) }));
|
|
6464
6496
|
} else if (input.status === "done" || input.status === "blocked" || input.status === "cancelled") {
|
|
6465
6497
|
try {
|
|
6466
|
-
|
|
6498
|
+
unlinkSync7(cachePath);
|
|
6467
6499
|
} catch {
|
|
6468
6500
|
}
|
|
6469
6501
|
}
|
|
@@ -7164,14 +7196,14 @@ __export(worker_gate_exports, {
|
|
|
7164
7196
|
tryAcquireBackfillLock: () => tryAcquireBackfillLock,
|
|
7165
7197
|
tryAcquireWorkerSlot: () => tryAcquireWorkerSlot
|
|
7166
7198
|
});
|
|
7167
|
-
import { readdirSync as readdirSync9, writeFileSync as
|
|
7199
|
+
import { readdirSync as readdirSync9, writeFileSync as writeFileSync13, unlinkSync as unlinkSync8, mkdirSync as mkdirSync11, existsSync as existsSync21 } from "fs";
|
|
7168
7200
|
import path28 from "path";
|
|
7169
7201
|
function tryAcquireWorkerSlot() {
|
|
7170
7202
|
try {
|
|
7171
7203
|
mkdirSync11(WORKER_PID_DIR, { recursive: true });
|
|
7172
7204
|
const reservationId = `res-${process.pid}-${Date.now()}`;
|
|
7173
7205
|
const reservationPath = path28.join(WORKER_PID_DIR, `${reservationId}.pid`);
|
|
7174
|
-
|
|
7206
|
+
writeFileSync13(reservationPath, String(process.pid));
|
|
7175
7207
|
const files = readdirSync9(WORKER_PID_DIR);
|
|
7176
7208
|
let alive = 0;
|
|
7177
7209
|
for (const f of files) {
|
|
@@ -7188,20 +7220,20 @@ function tryAcquireWorkerSlot() {
|
|
|
7188
7220
|
alive++;
|
|
7189
7221
|
} catch {
|
|
7190
7222
|
try {
|
|
7191
|
-
|
|
7223
|
+
unlinkSync8(path28.join(WORKER_PID_DIR, f));
|
|
7192
7224
|
} catch {
|
|
7193
7225
|
}
|
|
7194
7226
|
}
|
|
7195
7227
|
}
|
|
7196
7228
|
if (alive > MAX_CONCURRENT_WORKERS) {
|
|
7197
7229
|
try {
|
|
7198
|
-
|
|
7230
|
+
unlinkSync8(reservationPath);
|
|
7199
7231
|
} catch {
|
|
7200
7232
|
}
|
|
7201
7233
|
return false;
|
|
7202
7234
|
}
|
|
7203
7235
|
try {
|
|
7204
|
-
|
|
7236
|
+
unlinkSync8(reservationPath);
|
|
7205
7237
|
} catch {
|
|
7206
7238
|
}
|
|
7207
7239
|
return true;
|
|
@@ -7212,13 +7244,13 @@ function tryAcquireWorkerSlot() {
|
|
|
7212
7244
|
function registerWorkerPid(pid) {
|
|
7213
7245
|
try {
|
|
7214
7246
|
mkdirSync11(WORKER_PID_DIR, { recursive: true });
|
|
7215
|
-
|
|
7247
|
+
writeFileSync13(path28.join(WORKER_PID_DIR, `worker-${pid}.pid`), String(pid));
|
|
7216
7248
|
} catch {
|
|
7217
7249
|
}
|
|
7218
7250
|
}
|
|
7219
7251
|
function cleanupWorkerPid() {
|
|
7220
7252
|
try {
|
|
7221
|
-
|
|
7253
|
+
unlinkSync8(path28.join(WORKER_PID_DIR, `worker-${process.pid}.pid`));
|
|
7222
7254
|
} catch {
|
|
7223
7255
|
}
|
|
7224
7256
|
}
|
|
@@ -7241,7 +7273,7 @@ function tryAcquireBackfillLock() {
|
|
|
7241
7273
|
} catch {
|
|
7242
7274
|
}
|
|
7243
7275
|
}
|
|
7244
|
-
|
|
7276
|
+
writeFileSync13(BACKFILL_LOCK, String(process.pid));
|
|
7245
7277
|
return true;
|
|
7246
7278
|
} catch {
|
|
7247
7279
|
return true;
|
|
@@ -7249,7 +7281,7 @@ function tryAcquireBackfillLock() {
|
|
|
7249
7281
|
}
|
|
7250
7282
|
function releaseBackfillLock() {
|
|
7251
7283
|
try {
|
|
7252
|
-
|
|
7284
|
+
unlinkSync8(BACKFILL_LOCK);
|
|
7253
7285
|
} catch {
|
|
7254
7286
|
}
|
|
7255
7287
|
}
|
|
@@ -7892,7 +7924,7 @@ init_active_agent();
|
|
|
7892
7924
|
init_plan_limits();
|
|
7893
7925
|
import { z as z4 } from "zod";
|
|
7894
7926
|
import crypto2 from "crypto";
|
|
7895
|
-
import { writeFileSync as
|
|
7927
|
+
import { writeFileSync as writeFileSync4 } from "fs";
|
|
7896
7928
|
import path12 from "path";
|
|
7897
7929
|
function registerStoreMemory(server2) {
|
|
7898
7930
|
server2.registerTool(
|
|
@@ -7962,7 +7994,7 @@ function registerStoreMemory(server2) {
|
|
|
7962
7994
|
try {
|
|
7963
7995
|
const { EXE_AI_DIR: exeDir } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
7964
7996
|
const flagPath = path12.join(exeDir, "session-cache", "needs-backfill");
|
|
7965
|
-
|
|
7997
|
+
writeFileSync4(flagPath, "1");
|
|
7966
7998
|
} catch {
|
|
7967
7999
|
}
|
|
7968
8000
|
}
|
|
@@ -7985,7 +8017,7 @@ init_plan_limits();
|
|
|
7985
8017
|
init_active_agent();
|
|
7986
8018
|
import { z as z5 } from "zod";
|
|
7987
8019
|
import crypto3 from "crypto";
|
|
7988
|
-
import { writeFileSync as
|
|
8020
|
+
import { writeFileSync as writeFileSync5 } from "fs";
|
|
7989
8021
|
import path13 from "path";
|
|
7990
8022
|
function registerCommitMemory(server2) {
|
|
7991
8023
|
server2.registerTool(
|
|
@@ -8075,7 +8107,7 @@ function registerCommitMemory(server2) {
|
|
|
8075
8107
|
try {
|
|
8076
8108
|
const { EXE_AI_DIR: exeDir } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
8077
8109
|
const flagPath = path13.join(exeDir, "session-cache", "needs-backfill");
|
|
8078
|
-
|
|
8110
|
+
writeFileSync5(flagPath, "1");
|
|
8079
8111
|
} catch {
|
|
8080
8112
|
}
|
|
8081
8113
|
}
|
|
@@ -9222,7 +9254,7 @@ import { z as z20 } from "zod";
|
|
|
9222
9254
|
// src/lib/identity.ts
|
|
9223
9255
|
init_config();
|
|
9224
9256
|
init_database();
|
|
9225
|
-
import { existsSync as existsSync16, mkdirSync as mkdirSync8, readFileSync as readFileSync13, writeFileSync as
|
|
9257
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync8, readFileSync as readFileSync13, writeFileSync as writeFileSync10 } from "fs";
|
|
9226
9258
|
import { readdirSync as readdirSync6 } from "fs";
|
|
9227
9259
|
import path22 from "path";
|
|
9228
9260
|
import { createHash } from "crypto";
|
|
@@ -9289,7 +9321,7 @@ async function updateIdentity(agentId, content, updatedBy) {
|
|
|
9289
9321
|
ensureDir2();
|
|
9290
9322
|
const filePath = identityPath(agentId);
|
|
9291
9323
|
const hash = contentHash(content);
|
|
9292
|
-
|
|
9324
|
+
writeFileSync10(filePath, content, "utf-8");
|
|
9293
9325
|
try {
|
|
9294
9326
|
const client = getClient();
|
|
9295
9327
|
await client.execute({
|
|
@@ -10275,11 +10307,11 @@ function registerSendWhatsapp(server2) {
|
|
|
10275
10307
|
import { z as z29 } from "zod";
|
|
10276
10308
|
|
|
10277
10309
|
// src/automation/trigger-engine.ts
|
|
10278
|
-
import { readFileSync as readFileSync15, writeFileSync as
|
|
10310
|
+
import { readFileSync as readFileSync15, writeFileSync as writeFileSync11, existsSync as existsSync17, mkdirSync as mkdirSync9 } from "fs";
|
|
10279
10311
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
10280
10312
|
import path23 from "path";
|
|
10281
|
-
import
|
|
10282
|
-
var TRIGGERS_PATH = path23.join(
|
|
10313
|
+
import os8 from "os";
|
|
10314
|
+
var TRIGGERS_PATH = path23.join(os8.homedir(), ".exe-os", "triggers.json");
|
|
10283
10315
|
function loadTriggers(project) {
|
|
10284
10316
|
if (!existsSync17(TRIGGERS_PATH)) return [];
|
|
10285
10317
|
try {
|
|
@@ -10297,7 +10329,7 @@ function loadTriggers(project) {
|
|
|
10297
10329
|
function saveTriggers(triggers) {
|
|
10298
10330
|
const dir = path23.dirname(TRIGGERS_PATH);
|
|
10299
10331
|
if (!existsSync17(dir)) mkdirSync9(dir, { recursive: true });
|
|
10300
|
-
|
|
10332
|
+
writeFileSync11(TRIGGERS_PATH, JSON.stringify(triggers, null, 2), "utf-8");
|
|
10301
10333
|
}
|
|
10302
10334
|
function createNewTrigger(input) {
|
|
10303
10335
|
const triggers = loadTriggers();
|
|
@@ -10699,7 +10731,7 @@ function applyPack(industry, project) {
|
|
|
10699
10731
|
|
|
10700
10732
|
// src/lib/client-coo.ts
|
|
10701
10733
|
init_config();
|
|
10702
|
-
import { existsSync as existsSync19, mkdirSync as mkdirSync10, writeFileSync as
|
|
10734
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync10, writeFileSync as writeFileSync12 } from "fs";
|
|
10703
10735
|
import path25 from "path";
|
|
10704
10736
|
|
|
10705
10737
|
// src/lib/employee-templates.ts
|
|
@@ -10849,7 +10881,7 @@ async function provisionClientCOO(vars, opts = {}) {
|
|
|
10849
10881
|
if (!existsSync19(identityDir)) {
|
|
10850
10882
|
mkdirSync10(identityDir, { recursive: true });
|
|
10851
10883
|
}
|
|
10852
|
-
|
|
10884
|
+
writeFileSync12(identityPath2, body, "utf-8");
|
|
10853
10885
|
const employees = await loadEmployees(rosterPath);
|
|
10854
10886
|
const existing = employees.find((e) => e.name === vars.agent_name);
|
|
10855
10887
|
let addedToRoster = false;
|