@askexenow/exe-os 0.9.29 → 0.9.31
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/cli.js +47 -11
- package/dist/bin/exe-search.js +11 -4
- package/dist/bin/exe-start-codex.js +47 -11
- package/dist/bin/install.js +47 -11
- package/dist/hooks/error-recall.js +11 -4
- package/dist/hooks/post-tool-combined.js +11 -4
- package/dist/hooks/prompt-submit.js +19 -8
- package/dist/hooks/session-start.js +11 -4
- package/dist/lib/hybrid-search.js +11 -4
- package/dist/mcp/server.js +11 -4
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -30395,6 +30395,46 @@ status_line = [${DEFAULT_CODEX_STATUS_LINE.map((s) => `"${s}"`).join(", ")}]`;
|
|
|
30395
30395
|
await writeFile9(configPath, content);
|
|
30396
30396
|
return "installed";
|
|
30397
30397
|
}
|
|
30398
|
+
function desiredCodexMcpSection(serverJsPath) {
|
|
30399
|
+
return [
|
|
30400
|
+
"[mcp_servers.exe-os]",
|
|
30401
|
+
`command = "node"`,
|
|
30402
|
+
`args = ["${serverJsPath}"]`,
|
|
30403
|
+
`startup_timeout_sec = ${CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC}`,
|
|
30404
|
+
`tool_timeout_sec = ${CODEX_EXE_MCP_TOOL_TIMEOUT_SEC}`,
|
|
30405
|
+
""
|
|
30406
|
+
].join("\n");
|
|
30407
|
+
}
|
|
30408
|
+
function reconcileCodexMcpSection(sectionContent, serverJsPath) {
|
|
30409
|
+
const desiredLines = {
|
|
30410
|
+
command: `command = "node"`,
|
|
30411
|
+
args: `args = ["${serverJsPath}"]`,
|
|
30412
|
+
startup: `startup_timeout_sec = ${CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC}`,
|
|
30413
|
+
tool: `tool_timeout_sec = ${CODEX_EXE_MCP_TOOL_TIMEOUT_SEC}`
|
|
30414
|
+
};
|
|
30415
|
+
let next = sectionContent;
|
|
30416
|
+
let changed = false;
|
|
30417
|
+
const replaceOrAppend = (regex, desired) => {
|
|
30418
|
+
if (regex.test(next)) {
|
|
30419
|
+
const updated = next.replace(regex, desired);
|
|
30420
|
+
if (updated !== next) {
|
|
30421
|
+
next = updated;
|
|
30422
|
+
changed = true;
|
|
30423
|
+
}
|
|
30424
|
+
return;
|
|
30425
|
+
}
|
|
30426
|
+
next = next.endsWith("\n") ? `${next}${desired}
|
|
30427
|
+
` : `${next}
|
|
30428
|
+
${desired}
|
|
30429
|
+
`;
|
|
30430
|
+
changed = true;
|
|
30431
|
+
};
|
|
30432
|
+
replaceOrAppend(/^command\s*=.*$/m, desiredLines.command);
|
|
30433
|
+
replaceOrAppend(/^args\s*=.*$/m, desiredLines.args);
|
|
30434
|
+
replaceOrAppend(/^startup_timeout_sec\s*=.*$/m, desiredLines.startup);
|
|
30435
|
+
replaceOrAppend(/^tool_timeout_sec\s*=.*$/m, desiredLines.tool);
|
|
30436
|
+
return { content: next, changed };
|
|
30437
|
+
}
|
|
30398
30438
|
async function registerCodexMcpServer(packageRoot, homeDir = os20.homedir()) {
|
|
30399
30439
|
const codexDir = path45.join(homeDir, ".codex");
|
|
30400
30440
|
const configPath = path45.join(codexDir, "config.toml");
|
|
@@ -30411,21 +30451,15 @@ async function registerCodexMcpServer(packageRoot, homeDir = os20.homedir()) {
|
|
|
30411
30451
|
const nextSectionMatch = afterHeader.match(/\n\[(?!mcp_servers\.exe-os)/);
|
|
30412
30452
|
const sectionEnd = nextSectionMatch ? headerIndex + sectionHeader.length + nextSectionMatch.index : content.length;
|
|
30413
30453
|
const sectionContent = content.slice(headerIndex, sectionEnd);
|
|
30414
|
-
|
|
30454
|
+
const reconciled = reconcileCodexMcpSection(sectionContent, serverJsPath);
|
|
30455
|
+
if (!reconciled.changed) {
|
|
30415
30456
|
return "already-registered";
|
|
30416
30457
|
}
|
|
30417
|
-
|
|
30418
|
-
command = "node"
|
|
30419
|
-
args = ["${serverJsPath}"]
|
|
30420
|
-
`;
|
|
30421
|
-
content = content.slice(0, headerIndex) + newSection2 + content.slice(sectionEnd);
|
|
30458
|
+
content = content.slice(0, headerIndex) + reconciled.content + content.slice(sectionEnd);
|
|
30422
30459
|
await writeFile9(configPath, content);
|
|
30423
30460
|
return "updated";
|
|
30424
30461
|
}
|
|
30425
|
-
const newSection =
|
|
30426
|
-
command = "node"
|
|
30427
|
-
args = ["${serverJsPath}"]
|
|
30428
|
-
`;
|
|
30462
|
+
const newSection = desiredCodexMcpSection(serverJsPath);
|
|
30429
30463
|
const separator = content.length > 0 && !content.endsWith("\n") ? "\n\n" : content.length > 0 ? "\n" : "";
|
|
30430
30464
|
content = content + separator + newSection;
|
|
30431
30465
|
await writeFile9(configPath, content);
|
|
@@ -30483,7 +30517,7 @@ async function runCodexInstaller(homeDir) {
|
|
|
30483
30517
|
`
|
|
30484
30518
|
);
|
|
30485
30519
|
}
|
|
30486
|
-
var DEFAULT_CODEX_STATUS_LINE;
|
|
30520
|
+
var DEFAULT_CODEX_STATUS_LINE, CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC, CODEX_EXE_MCP_TOOL_TIMEOUT_SEC;
|
|
30487
30521
|
var init_installer3 = __esm({
|
|
30488
30522
|
"src/adapters/codex/installer.ts"() {
|
|
30489
30523
|
"use strict";
|
|
@@ -30497,6 +30531,8 @@ var init_installer3 = __esm({
|
|
|
30497
30531
|
"run-state",
|
|
30498
30532
|
"context-used"
|
|
30499
30533
|
];
|
|
30534
|
+
CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC = 30;
|
|
30535
|
+
CODEX_EXE_MCP_TOOL_TIMEOUT_SEC = 120;
|
|
30500
30536
|
}
|
|
30501
30537
|
});
|
|
30502
30538
|
|
package/dist/bin/exe-search.js
CHANGED
|
@@ -5114,10 +5114,17 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5114
5114
|
if (ENTITY_BOOST_WEIGHT === 0 || results.length === 0) {
|
|
5115
5115
|
return emptyResult;
|
|
5116
5116
|
}
|
|
5117
|
-
|
|
5117
|
+
const debugStart = process.env.EXE_DEBUG_HOOKS ? performance.now() : 0;
|
|
5118
|
+
const debugEnd = () => {
|
|
5119
|
+
if (!process.env.EXE_DEBUG_HOOKS) return;
|
|
5120
|
+
process.stderr.write(
|
|
5121
|
+
`[entity-boost] ${(performance.now() - debugStart).toFixed(3)}ms
|
|
5122
|
+
`
|
|
5123
|
+
);
|
|
5124
|
+
};
|
|
5118
5125
|
const entities = await matchEntities(query, client);
|
|
5119
5126
|
if (entities.length === 0) {
|
|
5120
|
-
|
|
5127
|
+
debugEnd();
|
|
5121
5128
|
return emptyResult;
|
|
5122
5129
|
}
|
|
5123
5130
|
const boostMap = /* @__PURE__ */ new Map();
|
|
@@ -5139,7 +5146,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5139
5146
|
await traverseAndScore(entities, client, boostMap, resultIds, graphContextMap);
|
|
5140
5147
|
await applyHyperedgeBoost(entities, client, boostMap, resultIds);
|
|
5141
5148
|
if (boostMap.size === 0) {
|
|
5142
|
-
|
|
5149
|
+
debugEnd();
|
|
5143
5150
|
return emptyResult;
|
|
5144
5151
|
}
|
|
5145
5152
|
const scored = results.map((r, i) => ({
|
|
@@ -5150,7 +5157,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5150
5157
|
scored.sort(
|
|
5151
5158
|
(a, b) => b.baseScore + b.entityBoost - (a.baseScore + a.entityBoost)
|
|
5152
5159
|
);
|
|
5153
|
-
|
|
5160
|
+
debugEnd();
|
|
5154
5161
|
return {
|
|
5155
5162
|
results: scored.map((s) => s.record),
|
|
5156
5163
|
graphContext: graphContextMap
|
|
@@ -3696,6 +3696,46 @@ status_line = [${DEFAULT_CODEX_STATUS_LINE.map((s) => `"${s}"`).join(", ")}]`;
|
|
|
3696
3696
|
await writeFile5(configPath, content);
|
|
3697
3697
|
return "installed";
|
|
3698
3698
|
}
|
|
3699
|
+
function desiredCodexMcpSection(serverJsPath) {
|
|
3700
|
+
return [
|
|
3701
|
+
"[mcp_servers.exe-os]",
|
|
3702
|
+
`command = "node"`,
|
|
3703
|
+
`args = ["${serverJsPath}"]`,
|
|
3704
|
+
`startup_timeout_sec = ${CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC}`,
|
|
3705
|
+
`tool_timeout_sec = ${CODEX_EXE_MCP_TOOL_TIMEOUT_SEC}`,
|
|
3706
|
+
""
|
|
3707
|
+
].join("\n");
|
|
3708
|
+
}
|
|
3709
|
+
function reconcileCodexMcpSection(sectionContent, serverJsPath) {
|
|
3710
|
+
const desiredLines = {
|
|
3711
|
+
command: `command = "node"`,
|
|
3712
|
+
args: `args = ["${serverJsPath}"]`,
|
|
3713
|
+
startup: `startup_timeout_sec = ${CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC}`,
|
|
3714
|
+
tool: `tool_timeout_sec = ${CODEX_EXE_MCP_TOOL_TIMEOUT_SEC}`
|
|
3715
|
+
};
|
|
3716
|
+
let next = sectionContent;
|
|
3717
|
+
let changed = false;
|
|
3718
|
+
const replaceOrAppend = (regex, desired) => {
|
|
3719
|
+
if (regex.test(next)) {
|
|
3720
|
+
const updated = next.replace(regex, desired);
|
|
3721
|
+
if (updated !== next) {
|
|
3722
|
+
next = updated;
|
|
3723
|
+
changed = true;
|
|
3724
|
+
}
|
|
3725
|
+
return;
|
|
3726
|
+
}
|
|
3727
|
+
next = next.endsWith("\n") ? `${next}${desired}
|
|
3728
|
+
` : `${next}
|
|
3729
|
+
${desired}
|
|
3730
|
+
`;
|
|
3731
|
+
changed = true;
|
|
3732
|
+
};
|
|
3733
|
+
replaceOrAppend(/^command\s*=.*$/m, desiredLines.command);
|
|
3734
|
+
replaceOrAppend(/^args\s*=.*$/m, desiredLines.args);
|
|
3735
|
+
replaceOrAppend(/^startup_timeout_sec\s*=.*$/m, desiredLines.startup);
|
|
3736
|
+
replaceOrAppend(/^tool_timeout_sec\s*=.*$/m, desiredLines.tool);
|
|
3737
|
+
return { content: next, changed };
|
|
3738
|
+
}
|
|
3699
3739
|
async function registerCodexMcpServer(packageRoot, homeDir = os10.homedir()) {
|
|
3700
3740
|
const codexDir = path13.join(homeDir, ".codex");
|
|
3701
3741
|
const configPath = path13.join(codexDir, "config.toml");
|
|
@@ -3712,21 +3752,15 @@ async function registerCodexMcpServer(packageRoot, homeDir = os10.homedir()) {
|
|
|
3712
3752
|
const nextSectionMatch = afterHeader.match(/\n\[(?!mcp_servers\.exe-os)/);
|
|
3713
3753
|
const sectionEnd = nextSectionMatch ? headerIndex + sectionHeader.length + nextSectionMatch.index : content.length;
|
|
3714
3754
|
const sectionContent = content.slice(headerIndex, sectionEnd);
|
|
3715
|
-
|
|
3755
|
+
const reconciled = reconcileCodexMcpSection(sectionContent, serverJsPath);
|
|
3756
|
+
if (!reconciled.changed) {
|
|
3716
3757
|
return "already-registered";
|
|
3717
3758
|
}
|
|
3718
|
-
|
|
3719
|
-
command = "node"
|
|
3720
|
-
args = ["${serverJsPath}"]
|
|
3721
|
-
`;
|
|
3722
|
-
content = content.slice(0, headerIndex) + newSection2 + content.slice(sectionEnd);
|
|
3759
|
+
content = content.slice(0, headerIndex) + reconciled.content + content.slice(sectionEnd);
|
|
3723
3760
|
await writeFile5(configPath, content);
|
|
3724
3761
|
return "updated";
|
|
3725
3762
|
}
|
|
3726
|
-
const newSection =
|
|
3727
|
-
command = "node"
|
|
3728
|
-
args = ["${serverJsPath}"]
|
|
3729
|
-
`;
|
|
3763
|
+
const newSection = desiredCodexMcpSection(serverJsPath);
|
|
3730
3764
|
const separator = content.length > 0 && !content.endsWith("\n") ? "\n\n" : content.length > 0 ? "\n" : "";
|
|
3731
3765
|
content = content + separator + newSection;
|
|
3732
3766
|
await writeFile5(configPath, content);
|
|
@@ -3784,7 +3818,7 @@ async function runCodexInstaller(homeDir) {
|
|
|
3784
3818
|
`
|
|
3785
3819
|
);
|
|
3786
3820
|
}
|
|
3787
|
-
var DEFAULT_CODEX_STATUS_LINE;
|
|
3821
|
+
var DEFAULT_CODEX_STATUS_LINE, CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC, CODEX_EXE_MCP_TOOL_TIMEOUT_SEC;
|
|
3788
3822
|
var init_installer2 = __esm({
|
|
3789
3823
|
"src/adapters/codex/installer.ts"() {
|
|
3790
3824
|
"use strict";
|
|
@@ -3798,6 +3832,8 @@ var init_installer2 = __esm({
|
|
|
3798
3832
|
"run-state",
|
|
3799
3833
|
"context-used"
|
|
3800
3834
|
];
|
|
3835
|
+
CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC = 30;
|
|
3836
|
+
CODEX_EXE_MCP_TOOL_TIMEOUT_SEC = 120;
|
|
3801
3837
|
}
|
|
3802
3838
|
});
|
|
3803
3839
|
|
package/dist/bin/install.js
CHANGED
|
@@ -1585,6 +1585,46 @@ status_line = [${DEFAULT_CODEX_STATUS_LINE.map((s) => `"${s}"`).join(", ")}]`;
|
|
|
1585
1585
|
await writeFile4(configPath, content);
|
|
1586
1586
|
return "installed";
|
|
1587
1587
|
}
|
|
1588
|
+
function desiredCodexMcpSection(serverJsPath) {
|
|
1589
|
+
return [
|
|
1590
|
+
"[mcp_servers.exe-os]",
|
|
1591
|
+
`command = "node"`,
|
|
1592
|
+
`args = ["${serverJsPath}"]`,
|
|
1593
|
+
`startup_timeout_sec = ${CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC}`,
|
|
1594
|
+
`tool_timeout_sec = ${CODEX_EXE_MCP_TOOL_TIMEOUT_SEC}`,
|
|
1595
|
+
""
|
|
1596
|
+
].join("\n");
|
|
1597
|
+
}
|
|
1598
|
+
function reconcileCodexMcpSection(sectionContent, serverJsPath) {
|
|
1599
|
+
const desiredLines = {
|
|
1600
|
+
command: `command = "node"`,
|
|
1601
|
+
args: `args = ["${serverJsPath}"]`,
|
|
1602
|
+
startup: `startup_timeout_sec = ${CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC}`,
|
|
1603
|
+
tool: `tool_timeout_sec = ${CODEX_EXE_MCP_TOOL_TIMEOUT_SEC}`
|
|
1604
|
+
};
|
|
1605
|
+
let next = sectionContent;
|
|
1606
|
+
let changed = false;
|
|
1607
|
+
const replaceOrAppend = (regex, desired) => {
|
|
1608
|
+
if (regex.test(next)) {
|
|
1609
|
+
const updated = next.replace(regex, desired);
|
|
1610
|
+
if (updated !== next) {
|
|
1611
|
+
next = updated;
|
|
1612
|
+
changed = true;
|
|
1613
|
+
}
|
|
1614
|
+
return;
|
|
1615
|
+
}
|
|
1616
|
+
next = next.endsWith("\n") ? `${next}${desired}
|
|
1617
|
+
` : `${next}
|
|
1618
|
+
${desired}
|
|
1619
|
+
`;
|
|
1620
|
+
changed = true;
|
|
1621
|
+
};
|
|
1622
|
+
replaceOrAppend(/^command\s*=.*$/m, desiredLines.command);
|
|
1623
|
+
replaceOrAppend(/^args\s*=.*$/m, desiredLines.args);
|
|
1624
|
+
replaceOrAppend(/^startup_timeout_sec\s*=.*$/m, desiredLines.startup);
|
|
1625
|
+
replaceOrAppend(/^tool_timeout_sec\s*=.*$/m, desiredLines.tool);
|
|
1626
|
+
return { content: next, changed };
|
|
1627
|
+
}
|
|
1588
1628
|
async function registerCodexMcpServer(packageRoot, homeDir = os6.homedir()) {
|
|
1589
1629
|
const codexDir = path8.join(homeDir, ".codex");
|
|
1590
1630
|
const configPath = path8.join(codexDir, "config.toml");
|
|
@@ -1601,21 +1641,15 @@ async function registerCodexMcpServer(packageRoot, homeDir = os6.homedir()) {
|
|
|
1601
1641
|
const nextSectionMatch = afterHeader.match(/\n\[(?!mcp_servers\.exe-os)/);
|
|
1602
1642
|
const sectionEnd = nextSectionMatch ? headerIndex + sectionHeader.length + nextSectionMatch.index : content.length;
|
|
1603
1643
|
const sectionContent = content.slice(headerIndex, sectionEnd);
|
|
1604
|
-
|
|
1644
|
+
const reconciled = reconcileCodexMcpSection(sectionContent, serverJsPath);
|
|
1645
|
+
if (!reconciled.changed) {
|
|
1605
1646
|
return "already-registered";
|
|
1606
1647
|
}
|
|
1607
|
-
|
|
1608
|
-
command = "node"
|
|
1609
|
-
args = ["${serverJsPath}"]
|
|
1610
|
-
`;
|
|
1611
|
-
content = content.slice(0, headerIndex) + newSection2 + content.slice(sectionEnd);
|
|
1648
|
+
content = content.slice(0, headerIndex) + reconciled.content + content.slice(sectionEnd);
|
|
1612
1649
|
await writeFile4(configPath, content);
|
|
1613
1650
|
return "updated";
|
|
1614
1651
|
}
|
|
1615
|
-
const newSection =
|
|
1616
|
-
command = "node"
|
|
1617
|
-
args = ["${serverJsPath}"]
|
|
1618
|
-
`;
|
|
1652
|
+
const newSection = desiredCodexMcpSection(serverJsPath);
|
|
1619
1653
|
const separator = content.length > 0 && !content.endsWith("\n") ? "\n\n" : content.length > 0 ? "\n" : "";
|
|
1620
1654
|
content = content + separator + newSection;
|
|
1621
1655
|
await writeFile4(configPath, content);
|
|
@@ -1673,7 +1707,7 @@ async function runCodexInstaller(homeDir) {
|
|
|
1673
1707
|
`
|
|
1674
1708
|
);
|
|
1675
1709
|
}
|
|
1676
|
-
var DEFAULT_CODEX_STATUS_LINE;
|
|
1710
|
+
var DEFAULT_CODEX_STATUS_LINE, CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC, CODEX_EXE_MCP_TOOL_TIMEOUT_SEC;
|
|
1677
1711
|
var init_installer2 = __esm({
|
|
1678
1712
|
"src/adapters/codex/installer.ts"() {
|
|
1679
1713
|
"use strict";
|
|
@@ -1687,6 +1721,8 @@ var init_installer2 = __esm({
|
|
|
1687
1721
|
"run-state",
|
|
1688
1722
|
"context-used"
|
|
1689
1723
|
];
|
|
1724
|
+
CODEX_EXE_MCP_STARTUP_TIMEOUT_SEC = 30;
|
|
1725
|
+
CODEX_EXE_MCP_TOOL_TIMEOUT_SEC = 120;
|
|
1690
1726
|
}
|
|
1691
1727
|
});
|
|
1692
1728
|
|
|
@@ -5116,10 +5116,17 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5116
5116
|
if (ENTITY_BOOST_WEIGHT === 0 || results.length === 0) {
|
|
5117
5117
|
return emptyResult;
|
|
5118
5118
|
}
|
|
5119
|
-
|
|
5119
|
+
const debugStart = process.env.EXE_DEBUG_HOOKS ? performance.now() : 0;
|
|
5120
|
+
const debugEnd = () => {
|
|
5121
|
+
if (!process.env.EXE_DEBUG_HOOKS) return;
|
|
5122
|
+
process.stderr.write(
|
|
5123
|
+
`[entity-boost] ${(performance.now() - debugStart).toFixed(3)}ms
|
|
5124
|
+
`
|
|
5125
|
+
);
|
|
5126
|
+
};
|
|
5120
5127
|
const entities = await matchEntities(query, client);
|
|
5121
5128
|
if (entities.length === 0) {
|
|
5122
|
-
|
|
5129
|
+
debugEnd();
|
|
5123
5130
|
return emptyResult;
|
|
5124
5131
|
}
|
|
5125
5132
|
const boostMap = /* @__PURE__ */ new Map();
|
|
@@ -5141,7 +5148,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5141
5148
|
await traverseAndScore(entities, client, boostMap, resultIds, graphContextMap);
|
|
5142
5149
|
await applyHyperedgeBoost(entities, client, boostMap, resultIds);
|
|
5143
5150
|
if (boostMap.size === 0) {
|
|
5144
|
-
|
|
5151
|
+
debugEnd();
|
|
5145
5152
|
return emptyResult;
|
|
5146
5153
|
}
|
|
5147
5154
|
const scored = results.map((r, i) => ({
|
|
@@ -5152,7 +5159,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5152
5159
|
scored.sort(
|
|
5153
5160
|
(a, b) => b.baseScore + b.entityBoost - (a.baseScore + a.entityBoost)
|
|
5154
5161
|
);
|
|
5155
|
-
|
|
5162
|
+
debugEnd();
|
|
5156
5163
|
return {
|
|
5157
5164
|
results: scored.map((s) => s.record),
|
|
5158
5165
|
graphContext: graphContextMap
|
|
@@ -5291,10 +5291,17 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5291
5291
|
if (ENTITY_BOOST_WEIGHT === 0 || results.length === 0) {
|
|
5292
5292
|
return emptyResult;
|
|
5293
5293
|
}
|
|
5294
|
-
|
|
5294
|
+
const debugStart = process.env.EXE_DEBUG_HOOKS ? performance.now() : 0;
|
|
5295
|
+
const debugEnd = () => {
|
|
5296
|
+
if (!process.env.EXE_DEBUG_HOOKS) return;
|
|
5297
|
+
process.stderr.write(
|
|
5298
|
+
`[entity-boost] ${(performance.now() - debugStart).toFixed(3)}ms
|
|
5299
|
+
`
|
|
5300
|
+
);
|
|
5301
|
+
};
|
|
5295
5302
|
const entities = await matchEntities(query, client);
|
|
5296
5303
|
if (entities.length === 0) {
|
|
5297
|
-
|
|
5304
|
+
debugEnd();
|
|
5298
5305
|
return emptyResult;
|
|
5299
5306
|
}
|
|
5300
5307
|
const boostMap = /* @__PURE__ */ new Map();
|
|
@@ -5316,7 +5323,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5316
5323
|
await traverseAndScore(entities, client, boostMap, resultIds, graphContextMap);
|
|
5317
5324
|
await applyHyperedgeBoost(entities, client, boostMap, resultIds);
|
|
5318
5325
|
if (boostMap.size === 0) {
|
|
5319
|
-
|
|
5326
|
+
debugEnd();
|
|
5320
5327
|
return emptyResult;
|
|
5321
5328
|
}
|
|
5322
5329
|
const scored = results.map((r, i) => ({
|
|
@@ -5327,7 +5334,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5327
5334
|
scored.sort(
|
|
5328
5335
|
(a, b) => b.baseScore + b.entityBoost - (a.baseScore + a.entityBoost)
|
|
5329
5336
|
);
|
|
5330
|
-
|
|
5337
|
+
debugEnd();
|
|
5331
5338
|
return {
|
|
5332
5339
|
results: scored.map((s) => s.record),
|
|
5333
5340
|
graphContext: graphContextMap
|
|
@@ -5458,10 +5458,17 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5458
5458
|
if (ENTITY_BOOST_WEIGHT === 0 || results.length === 0) {
|
|
5459
5459
|
return emptyResult;
|
|
5460
5460
|
}
|
|
5461
|
-
|
|
5461
|
+
const debugStart = process.env.EXE_DEBUG_HOOKS ? performance.now() : 0;
|
|
5462
|
+
const debugEnd = () => {
|
|
5463
|
+
if (!process.env.EXE_DEBUG_HOOKS) return;
|
|
5464
|
+
process.stderr.write(
|
|
5465
|
+
`[entity-boost] ${(performance.now() - debugStart).toFixed(3)}ms
|
|
5466
|
+
`
|
|
5467
|
+
);
|
|
5468
|
+
};
|
|
5462
5469
|
const entities = await matchEntities(query, client);
|
|
5463
5470
|
if (entities.length === 0) {
|
|
5464
|
-
|
|
5471
|
+
debugEnd();
|
|
5465
5472
|
return emptyResult;
|
|
5466
5473
|
}
|
|
5467
5474
|
const boostMap = /* @__PURE__ */ new Map();
|
|
@@ -5483,7 +5490,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5483
5490
|
await traverseAndScore(entities, client, boostMap, resultIds, graphContextMap);
|
|
5484
5491
|
await applyHyperedgeBoost(entities, client, boostMap, resultIds);
|
|
5485
5492
|
if (boostMap.size === 0) {
|
|
5486
|
-
|
|
5493
|
+
debugEnd();
|
|
5487
5494
|
return emptyResult;
|
|
5488
5495
|
}
|
|
5489
5496
|
const scored = results.map((r, i) => ({
|
|
@@ -5494,7 +5501,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5494
5501
|
scored.sort(
|
|
5495
5502
|
(a, b) => b.baseScore + b.entityBoost - (a.baseScore + a.entityBoost)
|
|
5496
5503
|
);
|
|
5497
|
-
|
|
5504
|
+
debugEnd();
|
|
5498
5505
|
return {
|
|
5499
5506
|
results: scored.map((s) => s.record),
|
|
5500
5507
|
graphContext: graphContextMap
|
|
@@ -10067,6 +10074,7 @@ if (!loadConfigSync().autoRetrieval) {
|
|
|
10067
10074
|
process.exit(0);
|
|
10068
10075
|
}
|
|
10069
10076
|
var CACHE_DIR3 = path25.join(EXE_AI_DIR, "session-cache");
|
|
10077
|
+
var IS_CODEX_RUNTIME = process.env.EXE_RUNTIME?.toLowerCase() === "codex";
|
|
10070
10078
|
function loadInjectedIds(sessionId) {
|
|
10071
10079
|
try {
|
|
10072
10080
|
const raw = readFileSync17(path25.join(CACHE_DIR3, `${sessionId}.json`), "utf8");
|
|
@@ -10187,8 +10195,10 @@ process.stdin.on("end", async () => {
|
|
|
10187
10195
|
const cacheStatus = isCacheCold(sessionKey);
|
|
10188
10196
|
if (cacheStatus.cold) {
|
|
10189
10197
|
const idleMinutes = Number.isFinite(cacheStatus.idleMs) ? `${Math.max(1, Math.floor(cacheStatus.idleMs / 6e4))}m` : "5m+";
|
|
10190
|
-
|
|
10198
|
+
if (!IS_CODEX_RUNTIME) {
|
|
10199
|
+
cacheContext = `## Cache Status
|
|
10191
10200
|
\u26A0\uFE0F Cache cold (idle ${idleMinutes}). Next response will re-process the full context (higher cost). This is informational \u2014 no action needed.`;
|
|
10201
|
+
}
|
|
10192
10202
|
try {
|
|
10193
10203
|
const { getClient: getClient2 } = await Promise.resolve().then(() => (init_database(), database_exports));
|
|
10194
10204
|
const client = getClient2();
|
|
@@ -10206,7 +10216,7 @@ process.stdin.on("end", async () => {
|
|
|
10206
10216
|
const memories = await search(
|
|
10207
10217
|
prompt.slice(0, 200),
|
|
10208
10218
|
agent.agentId,
|
|
10209
|
-
{ limit: 5 }
|
|
10219
|
+
{ limit: IS_CODEX_RUNTIME ? 3 : 5 }
|
|
10210
10220
|
);
|
|
10211
10221
|
let memoryContext = "";
|
|
10212
10222
|
if (memories.length > 0) {
|
|
@@ -10215,9 +10225,10 @@ process.stdin.on("end", async () => {
|
|
|
10215
10225
|
if (fresh.length > 0) {
|
|
10216
10226
|
for (const m of fresh) injected.add(m.id);
|
|
10217
10227
|
saveInjectedIds(data.session_id, injected);
|
|
10218
|
-
|
|
10228
|
+
const memoryCharLimit = IS_CODEX_RUNTIME ? 180 : 300;
|
|
10229
|
+
memoryContext = `## Relevant Memories${IS_CODEX_RUNTIME ? " (compact)" : ""}
|
|
10219
10230
|
${fresh.map(
|
|
10220
|
-
(m) => `[${m.timestamp}] ${m.tool_name}: ${m.raw_text.slice(0,
|
|
10231
|
+
(m) => `[${m.timestamp}] ${m.tool_name}: ${m.raw_text.replace(/\s+/g, " ").slice(0, memoryCharLimit)}`
|
|
10221
10232
|
).join("\n")}`;
|
|
10222
10233
|
}
|
|
10223
10234
|
}
|
|
@@ -5524,10 +5524,17 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5524
5524
|
if (ENTITY_BOOST_WEIGHT === 0 || results.length === 0) {
|
|
5525
5525
|
return emptyResult;
|
|
5526
5526
|
}
|
|
5527
|
-
|
|
5527
|
+
const debugStart = process.env.EXE_DEBUG_HOOKS ? performance.now() : 0;
|
|
5528
|
+
const debugEnd = () => {
|
|
5529
|
+
if (!process.env.EXE_DEBUG_HOOKS) return;
|
|
5530
|
+
process.stderr.write(
|
|
5531
|
+
`[entity-boost] ${(performance.now() - debugStart).toFixed(3)}ms
|
|
5532
|
+
`
|
|
5533
|
+
);
|
|
5534
|
+
};
|
|
5528
5535
|
const entities = await matchEntities(query, client);
|
|
5529
5536
|
if (entities.length === 0) {
|
|
5530
|
-
|
|
5537
|
+
debugEnd();
|
|
5531
5538
|
return emptyResult;
|
|
5532
5539
|
}
|
|
5533
5540
|
const boostMap = /* @__PURE__ */ new Map();
|
|
@@ -5549,7 +5556,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5549
5556
|
await traverseAndScore(entities, client, boostMap, resultIds, graphContextMap);
|
|
5550
5557
|
await applyHyperedgeBoost(entities, client, boostMap, resultIds);
|
|
5551
5558
|
if (boostMap.size === 0) {
|
|
5552
|
-
|
|
5559
|
+
debugEnd();
|
|
5553
5560
|
return emptyResult;
|
|
5554
5561
|
}
|
|
5555
5562
|
const scored = results.map((r, i) => ({
|
|
@@ -5560,7 +5567,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5560
5567
|
scored.sort(
|
|
5561
5568
|
(a, b) => b.baseScore + b.entityBoost - (a.baseScore + a.entityBoost)
|
|
5562
5569
|
);
|
|
5563
|
-
|
|
5570
|
+
debugEnd();
|
|
5564
5571
|
return {
|
|
5565
5572
|
results: scored.map((s) => s.record),
|
|
5566
5573
|
graphContext: graphContextMap
|
|
@@ -5113,10 +5113,17 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5113
5113
|
if (ENTITY_BOOST_WEIGHT === 0 || results.length === 0) {
|
|
5114
5114
|
return emptyResult;
|
|
5115
5115
|
}
|
|
5116
|
-
|
|
5116
|
+
const debugStart = process.env.EXE_DEBUG_HOOKS ? performance.now() : 0;
|
|
5117
|
+
const debugEnd = () => {
|
|
5118
|
+
if (!process.env.EXE_DEBUG_HOOKS) return;
|
|
5119
|
+
process.stderr.write(
|
|
5120
|
+
`[entity-boost] ${(performance.now() - debugStart).toFixed(3)}ms
|
|
5121
|
+
`
|
|
5122
|
+
);
|
|
5123
|
+
};
|
|
5117
5124
|
const entities = await matchEntities(query, client);
|
|
5118
5125
|
if (entities.length === 0) {
|
|
5119
|
-
|
|
5126
|
+
debugEnd();
|
|
5120
5127
|
return emptyResult;
|
|
5121
5128
|
}
|
|
5122
5129
|
const boostMap = /* @__PURE__ */ new Map();
|
|
@@ -5138,7 +5145,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5138
5145
|
await traverseAndScore(entities, client, boostMap, resultIds, graphContextMap);
|
|
5139
5146
|
await applyHyperedgeBoost(entities, client, boostMap, resultIds);
|
|
5140
5147
|
if (boostMap.size === 0) {
|
|
5141
|
-
|
|
5148
|
+
debugEnd();
|
|
5142
5149
|
return emptyResult;
|
|
5143
5150
|
}
|
|
5144
5151
|
const scored = results.map((r, i) => ({
|
|
@@ -5149,7 +5156,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5149
5156
|
scored.sort(
|
|
5150
5157
|
(a, b) => b.baseScore + b.entityBoost - (a.baseScore + a.entityBoost)
|
|
5151
5158
|
);
|
|
5152
|
-
|
|
5159
|
+
debugEnd();
|
|
5153
5160
|
return {
|
|
5154
5161
|
results: scored.map((s) => s.record),
|
|
5155
5162
|
graphContext: graphContextMap
|
package/dist/mcp/server.js
CHANGED
|
@@ -5555,10 +5555,17 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5555
5555
|
if (ENTITY_BOOST_WEIGHT === 0 || results.length === 0) {
|
|
5556
5556
|
return emptyResult;
|
|
5557
5557
|
}
|
|
5558
|
-
|
|
5558
|
+
const debugStart = process.env.EXE_DEBUG_HOOKS ? performance.now() : 0;
|
|
5559
|
+
const debugEnd = () => {
|
|
5560
|
+
if (!process.env.EXE_DEBUG_HOOKS) return;
|
|
5561
|
+
process.stderr.write(
|
|
5562
|
+
`[entity-boost] ${(performance.now() - debugStart).toFixed(3)}ms
|
|
5563
|
+
`
|
|
5564
|
+
);
|
|
5565
|
+
};
|
|
5559
5566
|
const entities = await matchEntities(query, client);
|
|
5560
5567
|
if (entities.length === 0) {
|
|
5561
|
-
|
|
5568
|
+
debugEnd();
|
|
5562
5569
|
return emptyResult;
|
|
5563
5570
|
}
|
|
5564
5571
|
const boostMap = /* @__PURE__ */ new Map();
|
|
@@ -5580,7 +5587,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5580
5587
|
await traverseAndScore(entities, client, boostMap, resultIds, graphContextMap);
|
|
5581
5588
|
await applyHyperedgeBoost(entities, client, boostMap, resultIds);
|
|
5582
5589
|
if (boostMap.size === 0) {
|
|
5583
|
-
|
|
5590
|
+
debugEnd();
|
|
5584
5591
|
return emptyResult;
|
|
5585
5592
|
}
|
|
5586
5593
|
const scored = results.map((r, i) => ({
|
|
@@ -5591,7 +5598,7 @@ async function applyEntityBoost(results, query, client) {
|
|
|
5591
5598
|
scored.sort(
|
|
5592
5599
|
(a, b) => b.baseScore + b.entityBoost - (a.baseScore + a.entityBoost)
|
|
5593
5600
|
);
|
|
5594
|
-
|
|
5601
|
+
debugEnd();
|
|
5595
5602
|
return {
|
|
5596
5603
|
results: scored.map((s) => s.record),
|
|
5597
5604
|
graphContext: graphContextMap
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askexenow/exe-os",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.31",
|
|
4
4
|
"description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|