@askexenow/exe-os 0.8.105 → 0.8.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/backfill-conversations.js +17 -15
- package/dist/bin/backfill-responses.js +17 -15
- package/dist/bin/backfill-vectors.js +17 -15
- package/dist/bin/cleanup-stale-review-tasks.js +56 -21
- package/dist/bin/cli.js +133 -63
- package/dist/bin/exe-agent.js +14 -4
- package/dist/bin/exe-assign.js +17 -15
- package/dist/bin/exe-boot.js +72 -32
- package/dist/bin/exe-call.js +8 -4
- package/dist/bin/exe-dispatch.js +69 -25
- package/dist/bin/exe-doctor.js +17 -15
- package/dist/bin/exe-export-behaviors.js +17 -15
- package/dist/bin/exe-forget.js +17 -15
- package/dist/bin/exe-gateway.js +63 -27
- package/dist/bin/exe-heartbeat.js +56 -21
- package/dist/bin/exe-kill.js +17 -15
- package/dist/bin/exe-launch-agent.js +71 -36
- package/dist/bin/exe-new-employee.js +3 -3
- package/dist/bin/exe-pending-messages.js +17 -15
- package/dist/bin/exe-pending-notifications.js +17 -15
- package/dist/bin/exe-pending-reviews.js +17 -15
- package/dist/bin/exe-review.js +17 -15
- package/dist/bin/exe-search.js +17 -15
- package/dist/bin/exe-session-cleanup.js +69 -25
- package/dist/bin/exe-start-codex.js +64 -33
- package/dist/bin/exe-start-opencode.js +63 -32
- package/dist/bin/exe-status.js +56 -21
- package/dist/bin/exe-team.js +17 -15
- package/dist/bin/git-sweep.js +69 -25
- package/dist/bin/graph-backfill.js +17 -15
- package/dist/bin/graph-export.js +17 -15
- package/dist/bin/scan-tasks.js +138 -63
- package/dist/bin/setup.js +19 -11
- package/dist/bin/shard-migrate.js +17 -15
- package/dist/bin/wiki-sync.js +17 -15
- package/dist/gateway/index.js +61 -25
- package/dist/hooks/bug-report-worker.js +61 -25
- package/dist/hooks/commit-complete.js +69 -25
- package/dist/hooks/error-recall.js +57 -22
- package/dist/hooks/exe-heartbeat-hook.js +40 -7
- package/dist/hooks/ingest-worker.js +69 -25
- package/dist/hooks/ingest.js +46 -9
- package/dist/hooks/instructions-loaded.js +57 -22
- package/dist/hooks/notification.js +57 -22
- package/dist/hooks/post-compact.js +59 -28
- package/dist/hooks/pre-compact.js +72 -32
- package/dist/hooks/pre-tool-use.js +64 -28
- package/dist/hooks/prompt-ingest-worker.js +17 -15
- package/dist/hooks/prompt-submit.js +281 -34
- package/dist/hooks/response-ingest-worker.js +17 -15
- package/dist/hooks/session-end.js +72 -32
- package/dist/hooks/session-start.js +2806 -2276
- package/dist/hooks/stop.js +59 -28
- package/dist/hooks/subagent-stop.js +59 -28
- package/dist/hooks/summary-worker.js +56 -21
- package/dist/index.js +75 -29
- package/dist/lib/employee-templates.js +3 -3
- package/dist/lib/exe-daemon.js +126 -27
- package/dist/lib/hybrid-search.js +17 -15
- package/dist/lib/messaging.js +54 -9
- package/dist/lib/schedules.js +17 -15
- package/dist/lib/store.js +17 -15
- package/dist/lib/tasks.js +52 -10
- package/dist/lib/tmux-routing.js +52 -10
- package/dist/mcp/server.js +78 -47
- package/dist/mcp/tools/create-task.js +47 -17
- package/dist/mcp/tools/deactivate-behavior.js +40 -7
- package/dist/mcp/tools/list-tasks.js +39 -6
- package/dist/mcp/tools/send-message.js +54 -16
- package/dist/mcp/tools/update-task.js +54 -20
- package/dist/runtime/index.js +83 -29
- package/dist/tui/App.js +77 -30
- package/package.json +1 -1
- package/src/commands/exe/call.md +2 -0
|
@@ -2222,21 +2222,23 @@ async function initStore(options) {
|
|
|
2222
2222
|
encryptionKey: hexKey
|
|
2223
2223
|
});
|
|
2224
2224
|
await retryOnBusy2(() => ensureSchema(), "ensureSchema");
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2225
|
+
if (!options?.lightweight) {
|
|
2226
|
+
try {
|
|
2227
|
+
const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
|
|
2228
|
+
initShardManager2(hexKey);
|
|
2229
|
+
} catch {
|
|
2230
|
+
}
|
|
2231
|
+
const client = getClient();
|
|
2232
|
+
const vResult = await retryOnBusy2(
|
|
2233
|
+
() => client.execute("SELECT MAX(version) as max_v FROM memories"),
|
|
2234
|
+
"version-query"
|
|
2235
|
+
);
|
|
2236
|
+
_nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
|
|
2237
|
+
try {
|
|
2238
|
+
const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
|
|
2239
|
+
await loadGlobalProcedures2();
|
|
2240
|
+
} catch {
|
|
2241
|
+
}
|
|
2240
2242
|
}
|
|
2241
2243
|
}
|
|
2242
2244
|
function classifyTier(record) {
|
|
@@ -2221,21 +2221,23 @@ async function initStore(options) {
|
|
|
2221
2221
|
encryptionKey: hexKey
|
|
2222
2222
|
});
|
|
2223
2223
|
await retryOnBusy2(() => ensureSchema(), "ensureSchema");
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2224
|
+
if (!options?.lightweight) {
|
|
2225
|
+
try {
|
|
2226
|
+
const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
|
|
2227
|
+
initShardManager2(hexKey);
|
|
2228
|
+
} catch {
|
|
2229
|
+
}
|
|
2230
|
+
const client = getClient();
|
|
2231
|
+
const vResult = await retryOnBusy2(
|
|
2232
|
+
() => client.execute("SELECT MAX(version) as max_v FROM memories"),
|
|
2233
|
+
"version-query"
|
|
2234
|
+
);
|
|
2235
|
+
_nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
|
|
2236
|
+
try {
|
|
2237
|
+
const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
|
|
2238
|
+
await loadGlobalProcedures2();
|
|
2239
|
+
} catch {
|
|
2240
|
+
}
|
|
2239
2241
|
}
|
|
2240
2242
|
}
|
|
2241
2243
|
function classifyTier(record) {
|
|
@@ -2210,21 +2210,23 @@ async function initStore(options) {
|
|
|
2210
2210
|
encryptionKey: hexKey
|
|
2211
2211
|
});
|
|
2212
2212
|
await retryOnBusy2(() => ensureSchema(), "ensureSchema");
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2213
|
+
if (!options?.lightweight) {
|
|
2214
|
+
try {
|
|
2215
|
+
const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
|
|
2216
|
+
initShardManager2(hexKey);
|
|
2217
|
+
} catch {
|
|
2218
|
+
}
|
|
2219
|
+
const client = getClient();
|
|
2220
|
+
const vResult = await retryOnBusy2(
|
|
2221
|
+
() => client.execute("SELECT MAX(version) as max_v FROM memories"),
|
|
2222
|
+
"version-query"
|
|
2223
|
+
);
|
|
2224
|
+
_nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
|
|
2225
|
+
try {
|
|
2226
|
+
const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
|
|
2227
|
+
await loadGlobalProcedures2();
|
|
2228
|
+
} catch {
|
|
2229
|
+
}
|
|
2228
2230
|
}
|
|
2229
2231
|
}
|
|
2230
2232
|
function vectorToBlob(vector) {
|
|
@@ -1779,8 +1779,21 @@ var init_session_registry = __esm({
|
|
|
1779
1779
|
|
|
1780
1780
|
// src/lib/session-key.ts
|
|
1781
1781
|
import { execSync as execSync2 } from "child_process";
|
|
1782
|
-
function
|
|
1783
|
-
|
|
1782
|
+
function normalizeCommand(command) {
|
|
1783
|
+
const trimmed = command.trim().toLowerCase();
|
|
1784
|
+
const parts = trimmed.split(/[\\/]/);
|
|
1785
|
+
return parts[parts.length - 1] ?? trimmed;
|
|
1786
|
+
}
|
|
1787
|
+
function detectRuntimeFromCommand(command) {
|
|
1788
|
+
const normalized = normalizeCommand(command);
|
|
1789
|
+
for (const [runtime, commands] of Object.entries(RUNTIME_COMMANDS)) {
|
|
1790
|
+
if (commands.includes(normalized)) {
|
|
1791
|
+
return runtime;
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
return null;
|
|
1795
|
+
}
|
|
1796
|
+
function resolveRuntimeProcess() {
|
|
1784
1797
|
let pid = process.ppid;
|
|
1785
1798
|
for (let i = 0; i < 10; i++) {
|
|
1786
1799
|
try {
|
|
@@ -1791,9 +1804,9 @@ function getSessionKey() {
|
|
|
1791
1804
|
const match = info.match(/^\s*(\d+)\s+(.+)$/);
|
|
1792
1805
|
if (!match) break;
|
|
1793
1806
|
const [, ppid, cmd] = match;
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
return
|
|
1807
|
+
const runtime = detectRuntimeFromCommand(cmd ?? "");
|
|
1808
|
+
if (runtime) {
|
|
1809
|
+
return { pid: String(pid), runtime };
|
|
1797
1810
|
}
|
|
1798
1811
|
pid = parseInt(ppid, 10);
|
|
1799
1812
|
if (pid <= 1) break;
|
|
@@ -1801,14 +1814,34 @@ function getSessionKey() {
|
|
|
1801
1814
|
break;
|
|
1802
1815
|
}
|
|
1803
1816
|
}
|
|
1817
|
+
return null;
|
|
1818
|
+
}
|
|
1819
|
+
function getSessionKey() {
|
|
1820
|
+
if (_cached) return _cached;
|
|
1821
|
+
if (process.env.EXE_SESSION_KEY) {
|
|
1822
|
+
_cached = process.env.EXE_SESSION_KEY;
|
|
1823
|
+
return _cached;
|
|
1824
|
+
}
|
|
1825
|
+
const resolved = resolveRuntimeProcess();
|
|
1826
|
+
if (resolved) {
|
|
1827
|
+
_cachedRuntime = resolved.runtime;
|
|
1828
|
+
_cached = resolved.pid;
|
|
1829
|
+
return _cached;
|
|
1830
|
+
}
|
|
1804
1831
|
_cached = process.env.CLAUDE_CODE_SSE_PORT ?? String(process.ppid);
|
|
1805
1832
|
return _cached;
|
|
1806
1833
|
}
|
|
1807
|
-
var _cached;
|
|
1834
|
+
var _cached, _cachedRuntime, RUNTIME_COMMANDS;
|
|
1808
1835
|
var init_session_key = __esm({
|
|
1809
1836
|
"src/lib/session-key.ts"() {
|
|
1810
1837
|
"use strict";
|
|
1811
1838
|
_cached = null;
|
|
1839
|
+
_cachedRuntime = null;
|
|
1840
|
+
RUNTIME_COMMANDS = {
|
|
1841
|
+
claude: ["claude", "claude.exe", "claude-native"],
|
|
1842
|
+
codex: ["codex"],
|
|
1843
|
+
opencode: ["opencode"]
|
|
1844
|
+
};
|
|
1812
1845
|
}
|
|
1813
1846
|
});
|
|
1814
1847
|
|
|
@@ -2236,21 +2269,23 @@ async function initStore(options) {
|
|
|
2236
2269
|
encryptionKey: hexKey
|
|
2237
2270
|
});
|
|
2238
2271
|
await retryOnBusy2(() => ensureSchema(), "ensureSchema");
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2272
|
+
if (!options?.lightweight) {
|
|
2273
|
+
try {
|
|
2274
|
+
const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
|
|
2275
|
+
initShardManager2(hexKey);
|
|
2276
|
+
} catch {
|
|
2277
|
+
}
|
|
2278
|
+
const client = getClient();
|
|
2279
|
+
const vResult = await retryOnBusy2(
|
|
2280
|
+
() => client.execute("SELECT MAX(version) as max_v FROM memories"),
|
|
2281
|
+
"version-query"
|
|
2282
|
+
);
|
|
2283
|
+
_nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
|
|
2284
|
+
try {
|
|
2285
|
+
const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
|
|
2286
|
+
await loadGlobalProcedures2();
|
|
2287
|
+
} catch {
|
|
2288
|
+
}
|
|
2254
2289
|
}
|
|
2255
2290
|
}
|
|
2256
2291
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -5548,21 +5548,23 @@ async function initStore(options) {
|
|
|
5548
5548
|
encryptionKey: hexKey
|
|
5549
5549
|
});
|
|
5550
5550
|
await retryOnBusy2(() => ensureSchema(), "ensureSchema");
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5551
|
+
if (!options?.lightweight) {
|
|
5552
|
+
try {
|
|
5553
|
+
const { initShardManager: initShardManager2 } = await Promise.resolve().then(() => (init_shard_manager(), shard_manager_exports));
|
|
5554
|
+
initShardManager2(hexKey);
|
|
5555
|
+
} catch {
|
|
5556
|
+
}
|
|
5557
|
+
const client = getClient();
|
|
5558
|
+
const vResult = await retryOnBusy2(
|
|
5559
|
+
() => client.execute("SELECT MAX(version) as max_v FROM memories"),
|
|
5560
|
+
"version-query"
|
|
5561
|
+
);
|
|
5562
|
+
_nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
|
|
5563
|
+
try {
|
|
5564
|
+
const { loadGlobalProcedures: loadGlobalProcedures2 } = await Promise.resolve().then(() => (init_global_procedures(), global_procedures_exports));
|
|
5565
|
+
await loadGlobalProcedures2();
|
|
5566
|
+
} catch {
|
|
5567
|
+
}
|
|
5566
5568
|
}
|
|
5567
5569
|
}
|
|
5568
5570
|
function classifyTier(record) {
|
|
@@ -6434,6 +6436,23 @@ var backfill_metadata_exports = {};
|
|
|
6434
6436
|
__export(backfill_metadata_exports, {
|
|
6435
6437
|
backfillMetadata: () => backfillMetadata
|
|
6436
6438
|
});
|
|
6439
|
+
function roleAgentMarkers(role, fallbackName) {
|
|
6440
|
+
try {
|
|
6441
|
+
const employees = loadEmployeesSync();
|
|
6442
|
+
const employee = getEmployeeByRole(employees, role);
|
|
6443
|
+
const configuredName = employee?.name?.toLowerCase().trim();
|
|
6444
|
+
if (configuredName) {
|
|
6445
|
+
return [configuredName];
|
|
6446
|
+
}
|
|
6447
|
+
} catch {
|
|
6448
|
+
}
|
|
6449
|
+
return [fallbackName];
|
|
6450
|
+
}
|
|
6451
|
+
function mentionsAgentMarker(text, markers) {
|
|
6452
|
+
return markers.some(
|
|
6453
|
+
(marker) => text.includes(`/${marker}/`) || text.includes(`agent_id: ${marker}`)
|
|
6454
|
+
);
|
|
6455
|
+
}
|
|
6437
6456
|
function classifyMemoryHeuristic(rawText, toolName) {
|
|
6438
6457
|
const t = rawText.toLowerCase();
|
|
6439
6458
|
let intent;
|
|
@@ -6465,7 +6484,7 @@ function classifyMemoryHeuristic(rawText, toolName) {
|
|
|
6465
6484
|
outcome = "partial";
|
|
6466
6485
|
}
|
|
6467
6486
|
let domain;
|
|
6468
|
-
if (t.includes("marketing") || t.includes("campaign") || t.includes("brand") || t.includes("carousel") || t.includes("seo") || t.includes("content strategy") ||
|
|
6487
|
+
if (t.includes("marketing") || t.includes("campaign") || t.includes("brand") || t.includes("carousel") || t.includes("seo") || t.includes("content strategy") || mentionsAgentMarker(t, MARKETING_AGENT_MARKERS)) {
|
|
6469
6488
|
domain = "marketing";
|
|
6470
6489
|
} else if (t.includes("architecture") || t.includes("adr") || t.includes("design doc") || t.includes("system design") || t.includes("ARCHITECTURE.md") || t.includes("schema") && t.includes("migration")) {
|
|
6471
6490
|
domain = "architecture";
|
|
@@ -6473,7 +6492,7 @@ function classifyMemoryHeuristic(rawText, toolName) {
|
|
|
6473
6492
|
domain = "customer";
|
|
6474
6493
|
} else if (t.includes("deploy") || t.includes("ci/cd") || t.includes("docker") || t.includes("nginx") || t.includes("cron") || t.includes("schedule") || t.includes("task management") || t.includes("roster") || toolName === "update_task" || toolName === "create_task") {
|
|
6475
6494
|
domain = "operations";
|
|
6476
|
-
} else if (t.includes("research") || t.includes("competitor") || t.includes("benchmark") || t.includes("comparison") || t.includes("analysis") || t.includes("evaluate") ||
|
|
6495
|
+
} else if (t.includes("research") || t.includes("competitor") || t.includes("benchmark") || t.includes("comparison") || t.includes("analysis") || t.includes("evaluate") || mentionsAgentMarker(t, RESEARCH_AGENT_MARKERS)) {
|
|
6477
6496
|
domain = "research";
|
|
6478
6497
|
} else {
|
|
6479
6498
|
domain = "code";
|
|
@@ -6971,13 +6990,14 @@ async function backfillMetadata(options) {
|
|
|
6971
6990
|
await disposeStore();
|
|
6972
6991
|
return { classified, skipped, failed, entitiesPopulated, remaining };
|
|
6973
6992
|
}
|
|
6974
|
-
var VALID_INTENTS, VALID_OUTCOMES, VALID_DOMAINS, VALID_AUDIENCES, VALID_LANGUAGE_TYPES, MAX_TEXT_LENGTH, BATCH_SLEEP_MS;
|
|
6993
|
+
var VALID_INTENTS, VALID_OUTCOMES, VALID_DOMAINS, VALID_AUDIENCES, VALID_LANGUAGE_TYPES, MAX_TEXT_LENGTH, BATCH_SLEEP_MS, MARKETING_AGENT_MARKERS, RESEARCH_AGENT_MARKERS;
|
|
6975
6994
|
var init_backfill_metadata = __esm({
|
|
6976
6995
|
"src/bin/backfill-metadata.ts"() {
|
|
6977
6996
|
"use strict";
|
|
6978
6997
|
init_store();
|
|
6979
6998
|
init_database();
|
|
6980
6999
|
init_is_main();
|
|
7000
|
+
init_employees();
|
|
6981
7001
|
VALID_INTENTS = /* @__PURE__ */ new Set(["decision", "question", "correction", "report", "discovery", "implementation"]);
|
|
6982
7002
|
VALID_OUTCOMES = /* @__PURE__ */ new Set(["success", "failure", "partial", "superseded"]);
|
|
6983
7003
|
VALID_DOMAINS = /* @__PURE__ */ new Set(["code", "architecture", "marketing", "operations", "customer", "research"]);
|
|
@@ -6985,6 +7005,8 @@ var init_backfill_metadata = __esm({
|
|
|
6985
7005
|
VALID_LANGUAGE_TYPES = /* @__PURE__ */ new Set(["code", "prose", "mixed", "json", "sql"]);
|
|
6986
7006
|
MAX_TEXT_LENGTH = 2e3;
|
|
6987
7007
|
BATCH_SLEEP_MS = 1e3;
|
|
7008
|
+
MARKETING_AGENT_MARKERS = roleAgentMarkers("CMO", "mari");
|
|
7009
|
+
RESEARCH_AGENT_MARKERS = roleAgentMarkers("AI Product Lead", "gen");
|
|
6988
7010
|
if (isMainModule(import.meta.url)) {
|
|
6989
7011
|
const options = parseArgs2(process.argv.slice(2));
|
|
6990
7012
|
backfillMetadata(options).then((result) => {
|
|
@@ -7060,8 +7082,21 @@ var init_session_registry = __esm({
|
|
|
7060
7082
|
|
|
7061
7083
|
// src/lib/session-key.ts
|
|
7062
7084
|
import { execSync as execSync4 } from "child_process";
|
|
7063
|
-
function
|
|
7064
|
-
|
|
7085
|
+
function normalizeCommand(command) {
|
|
7086
|
+
const trimmed = command.trim().toLowerCase();
|
|
7087
|
+
const parts = trimmed.split(/[\\/]/);
|
|
7088
|
+
return parts[parts.length - 1] ?? trimmed;
|
|
7089
|
+
}
|
|
7090
|
+
function detectRuntimeFromCommand(command) {
|
|
7091
|
+
const normalized = normalizeCommand(command);
|
|
7092
|
+
for (const [runtime, commands] of Object.entries(RUNTIME_COMMANDS)) {
|
|
7093
|
+
if (commands.includes(normalized)) {
|
|
7094
|
+
return runtime;
|
|
7095
|
+
}
|
|
7096
|
+
}
|
|
7097
|
+
return null;
|
|
7098
|
+
}
|
|
7099
|
+
function resolveRuntimeProcess() {
|
|
7065
7100
|
let pid = process.ppid;
|
|
7066
7101
|
for (let i = 0; i < 10; i++) {
|
|
7067
7102
|
try {
|
|
@@ -7072,9 +7107,9 @@ function getSessionKey() {
|
|
|
7072
7107
|
const match = info.match(/^\s*(\d+)\s+(.+)$/);
|
|
7073
7108
|
if (!match) break;
|
|
7074
7109
|
const [, ppid, cmd] = match;
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
return
|
|
7110
|
+
const runtime = detectRuntimeFromCommand(cmd ?? "");
|
|
7111
|
+
if (runtime) {
|
|
7112
|
+
return { pid: String(pid), runtime };
|
|
7078
7113
|
}
|
|
7079
7114
|
pid = parseInt(ppid, 10);
|
|
7080
7115
|
if (pid <= 1) break;
|
|
@@ -7082,14 +7117,34 @@ function getSessionKey() {
|
|
|
7082
7117
|
break;
|
|
7083
7118
|
}
|
|
7084
7119
|
}
|
|
7120
|
+
return null;
|
|
7121
|
+
}
|
|
7122
|
+
function getSessionKey() {
|
|
7123
|
+
if (_cached) return _cached;
|
|
7124
|
+
if (process.env.EXE_SESSION_KEY) {
|
|
7125
|
+
_cached = process.env.EXE_SESSION_KEY;
|
|
7126
|
+
return _cached;
|
|
7127
|
+
}
|
|
7128
|
+
const resolved = resolveRuntimeProcess();
|
|
7129
|
+
if (resolved) {
|
|
7130
|
+
_cachedRuntime = resolved.runtime;
|
|
7131
|
+
_cached = resolved.pid;
|
|
7132
|
+
return _cached;
|
|
7133
|
+
}
|
|
7085
7134
|
_cached = process.env.CLAUDE_CODE_SSE_PORT ?? String(process.ppid);
|
|
7086
7135
|
return _cached;
|
|
7087
7136
|
}
|
|
7088
|
-
var _cached;
|
|
7137
|
+
var _cached, _cachedRuntime, RUNTIME_COMMANDS;
|
|
7089
7138
|
var init_session_key = __esm({
|
|
7090
7139
|
"src/lib/session-key.ts"() {
|
|
7091
7140
|
"use strict";
|
|
7092
7141
|
_cached = null;
|
|
7142
|
+
_cachedRuntime = null;
|
|
7143
|
+
RUNTIME_COMMANDS = {
|
|
7144
|
+
claude: ["claude", "claude.exe", "claude-native"],
|
|
7145
|
+
codex: ["codex"],
|
|
7146
|
+
opencode: ["opencode"]
|
|
7147
|
+
};
|
|
7093
7148
|
}
|
|
7094
7149
|
});
|
|
7095
7150
|
|
|
@@ -9268,7 +9323,7 @@ async function pollCapacityDead() {
|
|
|
9268
9323
|
const transport = getTransport();
|
|
9269
9324
|
const relaunched = [];
|
|
9270
9325
|
const registered = listSessions().filter(
|
|
9271
|
-
(s) =>
|
|
9326
|
+
(s) => !isCoordinatorName(s.agentId)
|
|
9272
9327
|
);
|
|
9273
9328
|
if (registered.length === 0) return [];
|
|
9274
9329
|
let liveSessions;
|
|
@@ -9755,10 +9810,11 @@ function sendIntercom(targetSession) {
|
|
|
9755
9810
|
logIntercom(`COPY_MODE \u2192 ${targetSession} (exiting copy mode first)`);
|
|
9756
9811
|
transport.sendKeys(targetSession, "q");
|
|
9757
9812
|
}
|
|
9758
|
-
const
|
|
9813
|
+
const rawAgentName = targetSession.split("-")[0] ?? targetSession;
|
|
9814
|
+
const agentName = baseAgentName(rawAgentName);
|
|
9759
9815
|
const rtConfig = getAgentRuntime(agentName);
|
|
9760
9816
|
if (rtConfig.runtime === "codex" || rtConfig.runtime === "opencode") {
|
|
9761
|
-
transport.sendKeys(targetSession, "
|
|
9817
|
+
transport.sendKeys(targetSession, "NEW TASK ASSIGNED. Call list_tasks now, then get_task on the highest priority open task. Start working immediately \u2014 do not ask for confirmation.");
|
|
9762
9818
|
try {
|
|
9763
9819
|
execSync8(`tmux send-keys -t ${targetSession} Tab`, { timeout: 2e3 });
|
|
9764
9820
|
} catch {
|
|
@@ -10151,7 +10207,7 @@ var init_tmux_routing = __esm({
|
|
|
10151
10207
|
INTERCOM_LOG2 = path22.join(os11.homedir(), ".exe-os", "intercom.log");
|
|
10152
10208
|
DEBOUNCE_FILE = path22.join(SESSION_CACHE, "intercom-debounce.json");
|
|
10153
10209
|
DEBOUNCE_CLEANUP_AGE_MS = 5 * 60 * 1e3;
|
|
10154
|
-
BUSY_PATTERN = /[✻✽✶✳·].*…|Running
|
|
10210
|
+
BUSY_PATTERN = /[✻✽✶✳·].*…|Running…|• Working|• Ran |• Explored|• Called|esc to interrupt/;
|
|
10155
10211
|
}
|
|
10156
10212
|
});
|
|
10157
10213
|
|
|
@@ -10406,15 +10462,7 @@ var init_messaging = __esm({
|
|
|
10406
10462
|
}
|
|
10407
10463
|
});
|
|
10408
10464
|
|
|
10409
|
-
// src/
|
|
10410
|
-
var init_session_key2 = __esm({
|
|
10411
|
-
"src/adapters/claude/session-key.ts"() {
|
|
10412
|
-
"use strict";
|
|
10413
|
-
init_session_key();
|
|
10414
|
-
}
|
|
10415
|
-
});
|
|
10416
|
-
|
|
10417
|
-
// src/adapters/claude/active-agent.ts
|
|
10465
|
+
// src/lib/active-agent.ts
|
|
10418
10466
|
var active_agent_exports = {};
|
|
10419
10467
|
__export(active_agent_exports, {
|
|
10420
10468
|
cleanupSessionMarkers: () => cleanupSessionMarkers,
|
|
@@ -10579,10 +10627,10 @@ function cleanupSessionMarkers() {
|
|
|
10579
10627
|
}
|
|
10580
10628
|
var CACHE_DIR, STALE_MS;
|
|
10581
10629
|
var init_active_agent = __esm({
|
|
10582
|
-
"src/
|
|
10630
|
+
"src/lib/active-agent.ts"() {
|
|
10583
10631
|
"use strict";
|
|
10584
10632
|
init_config();
|
|
10585
|
-
|
|
10633
|
+
init_session_key();
|
|
10586
10634
|
init_employees();
|
|
10587
10635
|
CACHE_DIR = path23.join(EXE_AI_DIR, "session-cache");
|
|
10588
10636
|
STALE_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -10812,9 +10860,9 @@ Your domain:
|
|
|
10812
10860
|
- Performance: bottleneck analysis, scaling, caching
|
|
10813
10861
|
- DevOps: CI/CD, deployment, monitoring and alerting
|
|
10814
10862
|
|
|
10815
|
-
FEATURE DEVELOPMENT \u2014 use
|
|
10816
|
-
For ANY new feature, enhancement, or significant change,
|
|
10817
|
-
/exe-build-
|
|
10863
|
+
FEATURE DEVELOPMENT \u2014 use exe-build-adv:
|
|
10864
|
+
For ANY new feature, enhancement, or significant change, run:
|
|
10865
|
+
/exe-build-adv --auto "<feature description>"
|
|
10818
10866
|
|
|
10819
10867
|
This runs the full pipeline: spec \u2192 acceptance criteria \u2192 tests \u2192 implementation \u2192 verification.
|
|
10820
10868
|
It is NOT optional for feature work. Bug fixes and small patches can skip it, but anything that
|
|
@@ -12730,7 +12778,8 @@ async function runSetupWizard(opts = {}) {
|
|
|
12730
12778
|
saveEmployees: saveEmployees2,
|
|
12731
12779
|
addEmployee: addEmployee2,
|
|
12732
12780
|
registerBinSymlinks: registerBinSymlinks2,
|
|
12733
|
-
EMPLOYEES_PATH: EMPLOYEES_PATH2
|
|
12781
|
+
EMPLOYEES_PATH: EMPLOYEES_PATH2,
|
|
12782
|
+
DEFAULT_COORDINATOR_TEMPLATE_NAME: DEFAULT_COORDINATOR_TEMPLATE_NAME2
|
|
12734
12783
|
} = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
12735
12784
|
const { getTemplateByRole: getTemplateByRole2 } = await Promise.resolve().then(() => (init_employee_templates(), employee_templates_exports));
|
|
12736
12785
|
const { identityPath: identityPath2 } = await Promise.resolve().then(() => (init_identity(), identity_exports));
|
|
@@ -12742,7 +12791,7 @@ async function runSetupWizard(opts = {}) {
|
|
|
12742
12791
|
validateLicense: validateLicense2
|
|
12743
12792
|
} = await Promise.resolve().then(() => (init_license(), license_exports));
|
|
12744
12793
|
const createdEmployees = [];
|
|
12745
|
-
let cooName =
|
|
12794
|
+
let cooName = DEFAULT_COORDINATOR_TEMPLATE_NAME2;
|
|
12746
12795
|
if (pairingRosterPulled) {
|
|
12747
12796
|
const roster = await loadEmployees2(EMPLOYEES_PATH2).catch(() => []);
|
|
12748
12797
|
const existingCoo = roster.find((e) => e.role === "COO");
|
|
@@ -12827,17 +12876,24 @@ async function runSetupWizard(opts = {}) {
|
|
|
12827
12876
|
log("your entire team. Engineers, marketers, specialists, all working");
|
|
12828
12877
|
log("in parallel while you focus on what matters.");
|
|
12829
12878
|
log("");
|
|
12830
|
-
const cooNameInput = await ask2(
|
|
12831
|
-
|
|
12879
|
+
const cooNameInput = await ask2(
|
|
12880
|
+
rl,
|
|
12881
|
+
`Name your COO (default: ${DEFAULT_COORDINATOR_TEMPLATE_NAME2}): `
|
|
12882
|
+
);
|
|
12883
|
+
cooName = (cooNameInput || DEFAULT_COORDINATOR_TEMPLATE_NAME2).toLowerCase();
|
|
12832
12884
|
let employees = await loadEmployees2(EMPLOYEES_PATH2).catch(() => []);
|
|
12833
12885
|
if (!employees.some((e) => e.name === cooName)) {
|
|
12834
12886
|
const { DEFAULT_EXE: DEFAULT_EXE2, personalizePrompt: personalizePrompt2 } = await Promise.resolve().then(() => (init_employee_templates(), employee_templates_exports));
|
|
12835
12887
|
const cooEmployee = {
|
|
12836
12888
|
name: cooName,
|
|
12837
12889
|
role: "COO",
|
|
12838
|
-
systemPrompt: personalizePrompt2(
|
|
12890
|
+
systemPrompt: personalizePrompt2(
|
|
12891
|
+
DEFAULT_EXE2.systemPrompt,
|
|
12892
|
+
DEFAULT_COORDINATOR_TEMPLATE_NAME2,
|
|
12893
|
+
cooName
|
|
12894
|
+
),
|
|
12839
12895
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12840
|
-
templateName:
|
|
12896
|
+
templateName: DEFAULT_COORDINATOR_TEMPLATE_NAME2,
|
|
12841
12897
|
templateVersion: 1
|
|
12842
12898
|
};
|
|
12843
12899
|
employees = addEmployee2(employees, cooEmployee);
|
|
@@ -12920,10 +12976,10 @@ async function runSetupWizard(opts = {}) {
|
|
|
12920
12976
|
log("their domain \u2014 no context switching, no competing priorities.");
|
|
12921
12977
|
log("");
|
|
12922
12978
|
const ctoTemplate = getTemplateByRole2("CTO");
|
|
12923
|
-
const ctoDefault = ctoTemplate?.name ?? "
|
|
12979
|
+
const ctoDefault = ctoTemplate?.name ?? "cto";
|
|
12924
12980
|
log(` CTO \u2014 engineering, architecture, code reviews (default: ${ctoDefault})`);
|
|
12925
12981
|
const cmoTemplate = getTemplateByRole2("CMO");
|
|
12926
|
-
const cmoDefault = cmoTemplate?.name ?? "
|
|
12982
|
+
const cmoDefault = cmoTemplate?.name ?? "cmo";
|
|
12927
12983
|
log(` CMO \u2014 design, brand, content, marketing (default: ${cmoDefault})`);
|
|
12928
12984
|
log("");
|
|
12929
12985
|
const ctoNameInput = await ask2(rl, `Name your CTO (default: ${ctoDefault}): `);
|
|
@@ -20764,13 +20820,23 @@ function stripMediaBlocks(messages) {
|
|
|
20764
20820
|
function isMediaTool(name) {
|
|
20765
20821
|
return ["upload_image", "screenshot", "render_image"].includes(name);
|
|
20766
20822
|
}
|
|
20767
|
-
async function compactMessages(messages, provider, summaryModel
|
|
20823
|
+
async function compactMessages(messages, provider, summaryModel) {
|
|
20768
20824
|
if (messages.length <= KEEP_RECENT_MESSAGES) {
|
|
20769
20825
|
return { messages, removedCount: 0 };
|
|
20770
20826
|
}
|
|
20771
20827
|
const toSummarize = messages.slice(0, -KEEP_RECENT_MESSAGES);
|
|
20772
20828
|
const toKeep = messages.slice(-KEEP_RECENT_MESSAGES);
|
|
20773
20829
|
const stripped = stripMediaBlocks(toSummarize);
|
|
20830
|
+
if (!summaryModel) {
|
|
20831
|
+
return {
|
|
20832
|
+
messages: [
|
|
20833
|
+
{ role: "user", content: "[Earlier conversation history was compacted due to context limits]" },
|
|
20834
|
+
{ role: "assistant", content: "Understood. Continuing with recent context." },
|
|
20835
|
+
...toKeep
|
|
20836
|
+
],
|
|
20837
|
+
removedCount: toSummarize.length
|
|
20838
|
+
};
|
|
20839
|
+
}
|
|
20774
20840
|
const serialized = stripped.map((m) => {
|
|
20775
20841
|
const content = typeof m.content === "string" ? m.content : m.content.map((b) => {
|
|
20776
20842
|
if (b.type === "text") return b.text;
|
|
@@ -20846,8 +20912,8 @@ var init_context_manager = __esm({
|
|
|
20846
20912
|
"claude-sonnet-4": 2e5,
|
|
20847
20913
|
"claude-haiku-4": 2e5,
|
|
20848
20914
|
// Extended context variants
|
|
20849
|
-
"claude-opus-4-6
|
|
20850
|
-
"claude-sonnet-4-6
|
|
20915
|
+
"claude-opus-4-6": 1e6,
|
|
20916
|
+
"claude-sonnet-4-6": 1e6,
|
|
20851
20917
|
// OpenAI
|
|
20852
20918
|
"gpt-4o": 128e3,
|
|
20853
20919
|
"gpt-4-turbo": 128e3,
|
|
@@ -21116,7 +21182,7 @@ async function* agentLoop(userMessage, history, config) {
|
|
|
21116
21182
|
`Pre-compaction: extracted ${memoriesToExtract.length} key decisions to memory`
|
|
21117
21183
|
);
|
|
21118
21184
|
}
|
|
21119
|
-
const compacted = await compactMessages(messages, config.provider);
|
|
21185
|
+
const compacted = await compactMessages(messages, config.provider, config.model);
|
|
21120
21186
|
const removedCount = compacted.removedCount;
|
|
21121
21187
|
if (removedCount > 0) {
|
|
21122
21188
|
messages.length = 0;
|
|
@@ -23851,7 +23917,7 @@ function useOrchestrator(enabled = true) {
|
|
|
23851
23917
|
const [isLoading, setIsLoading] = useState8(true);
|
|
23852
23918
|
const orchestratorRef = useRef5(null);
|
|
23853
23919
|
const exeSessionRef = useRef5("exe1");
|
|
23854
|
-
const coordinatorNameRef = useRef5(
|
|
23920
|
+
const coordinatorNameRef = useRef5(DEFAULT_COORDINATOR_TEMPLATE_NAME);
|
|
23855
23921
|
useEffect10(() => {
|
|
23856
23922
|
if (!enabled) return;
|
|
23857
23923
|
let cancelled = false;
|
|
@@ -23987,6 +24053,7 @@ var TICK_INTERVAL_MS;
|
|
|
23987
24053
|
var init_useOrchestrator = __esm({
|
|
23988
24054
|
"src/tui/hooks/useOrchestrator.ts"() {
|
|
23989
24055
|
"use strict";
|
|
24056
|
+
init_employees();
|
|
23990
24057
|
TICK_INTERVAL_MS = 3e4;
|
|
23991
24058
|
}
|
|
23992
24059
|
});
|
|
@@ -27851,7 +27918,8 @@ ID: ${result.id}`);
|
|
|
27851
27918
|
}
|
|
27852
27919
|
})();
|
|
27853
27920
|
if (hasClaudeCode) {
|
|
27854
|
-
|
|
27921
|
+
const { DEFAULT_COORDINATOR_TEMPLATE_NAME: DEFAULT_COORDINATOR_TEMPLATE_NAME2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
27922
|
+
let cooName = DEFAULT_COORDINATOR_TEMPLATE_NAME2;
|
|
27855
27923
|
try {
|
|
27856
27924
|
const rosterPath = path40.join(os16.homedir(), ".exe-os", "exe-employees.json");
|
|
27857
27925
|
if (existsSync27(rosterPath)) {
|
|
@@ -28185,7 +28253,8 @@ async function runClaudeUninstall(flags = []) {
|
|
|
28185
28253
|
const rosterPath = path40.join(exeOsDir, "exe-employees.json");
|
|
28186
28254
|
if (existsSync27(rosterPath)) {
|
|
28187
28255
|
const roster = JSON.parse(readFileSync23(rosterPath, "utf8"));
|
|
28188
|
-
const
|
|
28256
|
+
const { DEFAULT_COORDINATOR_TEMPLATE_NAME: DEFAULT_COORDINATOR_TEMPLATE_NAME2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
28257
|
+
const coordinatorName = roster.find((e) => e.role?.toLowerCase() === "coo")?.name ?? DEFAULT_COORDINATOR_TEMPLATE_NAME2;
|
|
28189
28258
|
for (const emp of roster) {
|
|
28190
28259
|
if (emp.name === coordinatorName) continue;
|
|
28191
28260
|
for (const suffix of ["", "-opencode"]) {
|
|
@@ -28248,7 +28317,7 @@ async function runActivate(key) {
|
|
|
28248
28317
|
}
|
|
28249
28318
|
const { saveLicense: saveLicense2, mirrorLicenseKey: mirrorLicenseKey2, validateLicense: validateLicense2 } = await Promise.resolve().then(() => (init_license(), license_exports));
|
|
28250
28319
|
const { loadEmployees: loadEmployees2, saveEmployees: saveEmployees2, addEmployee: addEmployee2, registerBinSymlinks: registerBinSymlinks2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
28251
|
-
const {
|
|
28320
|
+
const { getTemplateByRole: getTemplateByRole2, personalizePrompt: personalizePrompt2 } = await Promise.resolve().then(() => (init_employee_templates(), employee_templates_exports));
|
|
28252
28321
|
const { getTemplate: getIdentityTemplate } = await Promise.resolve().then(() => (init_identity_templates(), identity_templates_exports));
|
|
28253
28322
|
const { identityPath: identityPath2 } = await Promise.resolve().then(() => (init_identity(), identity_exports));
|
|
28254
28323
|
const { createInterface: createInterface5 } = await import("readline");
|
|
@@ -28271,14 +28340,15 @@ async function runActivate(key) {
|
|
|
28271
28340
|
const ask3 = (prompt) => new Promise((resolve) => rl.question(prompt, (a) => resolve(a.trim())));
|
|
28272
28341
|
let employees = await loadEmployees2();
|
|
28273
28342
|
const existingNames = new Set(employees.map((e) => e.name));
|
|
28274
|
-
const createSpecialist = async (
|
|
28343
|
+
const createSpecialist = async (role, identityKey) => {
|
|
28344
|
+
const template = getTemplateByRole2(role);
|
|
28345
|
+
if (!template) return;
|
|
28346
|
+
const defaultName = template.name;
|
|
28275
28347
|
if (existingNames.has(defaultName)) return;
|
|
28276
28348
|
const create3 = await ask3(`Create your ${role}? [Y/n]: `);
|
|
28277
28349
|
if (create3.toLowerCase() === "n") return;
|
|
28278
28350
|
const nameInput = await ask3(`Name your ${role} [${defaultName}]: `);
|
|
28279
28351
|
const name = nameInput || defaultName;
|
|
28280
|
-
const template = getTemplate3(templateName);
|
|
28281
|
-
if (!template) return;
|
|
28282
28352
|
const emp = { ...template, name, systemPrompt: personalizePrompt2(template.systemPrompt, template.name, name), createdAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
28283
28353
|
employees = addEmployee2(employees, emp);
|
|
28284
28354
|
await saveEmployees2(employees);
|
|
@@ -28293,8 +28363,8 @@ async function runActivate(key) {
|
|
|
28293
28363
|
}
|
|
28294
28364
|
console.log(`Created: ${name} (${role})`);
|
|
28295
28365
|
};
|
|
28296
|
-
await createSpecialist("
|
|
28297
|
-
await createSpecialist("
|
|
28366
|
+
await createSpecialist("CTO", "cto");
|
|
28367
|
+
await createSpecialist("CMO", "cmo");
|
|
28298
28368
|
rl.close();
|
|
28299
28369
|
console.log(`${employees.length} employees active.`);
|
|
28300
28370
|
} catch (err) {
|