nexus-agents 7.0.2 → 8.0.0
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/{child-mcp-config-ORXLS5HP.js → child-mcp-config-V2ESGPZ4.js} +7 -7
- package/dist/{chunk-RBF64DXJ.js → chunk-2S7Q7GHX.js} +5 -5
- package/dist/{chunk-AGFXJUTS.js → chunk-3GMYW66U.js} +14 -14
- package/dist/{chunk-4OW67KT2.js → chunk-4HXPNLZS.js} +6 -6
- package/dist/{chunk-W4Q5NZYZ.js → chunk-4QHAMZLU.js} +3 -3
- package/dist/{chunk-KSQSWEFH.js → chunk-54Z2II7G.js} +21 -11
- package/dist/chunk-54Z2II7G.js.map +1 -0
- package/dist/{chunk-WLIXCNZ6.js → chunk-5FBPGOKA.js} +24 -24
- package/dist/chunk-5FBPGOKA.js.map +1 -0
- package/dist/{chunk-RSMG2DPB.js → chunk-64GMIUM5.js} +5 -5
- package/dist/{chunk-RLBJTZHA.js → chunk-AHTOZ2UR.js} +2 -2
- package/dist/{chunk-JNZ3D5B5.js → chunk-AL5E5T3O.js} +4 -4
- package/dist/{chunk-3CGUPSBW.js → chunk-BKAUGBSF.js} +2 -2
- package/dist/{chunk-XREG2HTQ.js → chunk-BSWLRSOG.js} +4 -4
- package/dist/{chunk-JJT7NVNY.js → chunk-CHU7NTUR.js} +4 -4
- package/dist/{chunk-UVO673OY.js → chunk-DBDXS7PE.js} +3 -3
- package/dist/{chunk-VYAXMVI5.js → chunk-DEYXS6IZ.js} +5 -5
- package/dist/{chunk-VYAXMVI5.js.map → chunk-DEYXS6IZ.js.map} +1 -1
- package/dist/{chunk-HFOQKCD2.js → chunk-DGWT7DXX.js} +3 -3
- package/dist/{chunk-HFOQKCD2.js.map → chunk-DGWT7DXX.js.map} +1 -1
- package/dist/{chunk-LVYRGNOC.js → chunk-DWUF5YWG.js} +2 -2
- package/dist/{chunk-VVXHIUFQ.js → chunk-EGWPONTU.js} +6 -6
- package/dist/{chunk-OHULIRP6.js → chunk-EXAULYXZ.js} +19 -19
- package/dist/{chunk-K2AWJGQO.js → chunk-FSY2TYFX.js} +8 -8
- package/dist/{chunk-6GYTTWNM.js → chunk-FVHUWXM2.js} +2 -2
- package/dist/{chunk-ZGEDIKAM.js → chunk-FW2FBZBD.js} +4 -4
- package/dist/{chunk-ZD4VEHEG.js → chunk-H6BUSSTF.js} +2 -2
- package/dist/{chunk-D6TL5GZV.js → chunk-HKKLVWRO.js} +5 -5
- package/dist/{chunk-GBHJ37V3.js → chunk-ITCKXMOH.js} +4 -4
- package/dist/{chunk-Y742U2YM.js → chunk-J7SPTP2E.js} +119 -104
- package/dist/chunk-J7SPTP2E.js.map +1 -0
- package/dist/{chunk-KJWD2V4K.js → chunk-JFE3JT5Q.js} +7 -7
- package/dist/chunk-KRG23W3T.js +7 -0
- package/dist/{chunk-33FI7W3G.js → chunk-L2PDPA23.js} +3 -3
- package/dist/{chunk-XZEYSIGG.js → chunk-LOKTE5WE.js} +4 -4
- package/dist/{chunk-KUYKSKPV.js → chunk-LOYIV3HG.js} +214 -219
- package/dist/chunk-LOYIV3HG.js.map +1 -0
- package/dist/{chunk-Q6IODDEA.js → chunk-LVSKLVYC.js} +12 -12
- package/dist/{chunk-Q6IODDEA.js.map → chunk-LVSKLVYC.js.map} +1 -1
- package/dist/{chunk-JEAKVUWM.js → chunk-M6E5E7QV.js} +3 -3
- package/dist/{chunk-OGHEKPLD.js → chunk-MM223CVS.js} +10 -10
- package/dist/{chunk-6Q3KSZVI.js → chunk-MWS56UFF.js} +2 -2
- package/dist/{chunk-GAYSJGKD.js → chunk-OYWFWMLH.js} +13 -13
- package/dist/{chunk-S2Z7CME3.js → chunk-PXJ6CB5V.js} +2 -2
- package/dist/{chunk-Y5GYBP52.js → chunk-QTDUIXOJ.js} +4 -4
- package/dist/{chunk-7U7HAYPB.js → chunk-R4B4UJ6F.js} +25 -59
- package/dist/chunk-R4B4UJ6F.js.map +1 -0
- package/dist/{chunk-QAHGHWC7.js → chunk-WIJ5J7AH.js} +23 -23
- package/dist/{chunk-BTWKDT4F.js → chunk-YJ7Q2NHE.js} +20 -20
- package/dist/{chunk-IWTK6FDT.js → chunk-ZTPBXWA7.js} +4 -4
- package/dist/{cli-circuit-breaker-5FYJDS5O.js → cli-circuit-breaker-YFHX4FN2.js} +5 -5
- package/dist/cli.js +378 -379
- package/dist/cli.js.map +1 -1
- package/dist/{codebase-search-RHBGEWXK.js → codebase-search-3D4TW3KR.js} +2 -2
- package/dist/{composite-router-GE24MYPP.js → composite-router-224FZMI2.js} +4 -4
- package/dist/{consensus-vote-62FAN4ZN.js → consensus-vote-57SKG3EN.js} +22 -22
- package/dist/{context-retriever-3OO6N4V6.js → context-retriever-CCVDD7TO.js} +12 -12
- package/dist/{dist-IKZ53APZ.js → dist-JK32DFHT.js} +2 -2
- package/dist/doctor-deep-37II5V7H.js +13 -0
- package/dist/{doctor-live-J7JIZH3T.js → doctor-live-VXQOZW37.js} +13 -13
- package/dist/{expert-bridge-PWRVRFDG.js → expert-bridge-7LGHU7IL.js} +6 -6
- package/dist/factory-5URERSHK.js +25 -0
- package/dist/factory-SF6ZPN6D.js +15 -0
- package/dist/{improvement-review-QUU5HR7Z.js → improvement-review-2AFBFUQX.js} +8 -8
- package/dist/index.d.ts +58 -56
- package/dist/index.js +65 -76
- package/dist/index.js.map +1 -1
- package/dist/{init-opencode-GDPE4U65.js → init-opencode-ZFCKUI2N.js} +10 -10
- package/dist/issue-triage-IVYGGNB4.js +17 -0
- package/dist/{learning-persistence-7O5QYDM7.js → learning-persistence-7N5SZHNX.js} +3 -3
- package/dist/{pr-reviewer-helpers-KBOP72XG.js → pr-reviewer-helpers-TS2HJMZR.js} +6 -6
- package/dist/{registry-command-ZK4NQ2MX.js → registry-command-M6LXKNEY.js} +7 -7
- package/dist/{repo-analyze-UJOWFGNM.js → repo-analyze-DI65XOTQ.js} +2 -2
- package/dist/{repo-security-plan-SZU4O2TN.js → repo-security-plan-LS5GCASE.js} +6 -6
- package/dist/research-helpers-synthesize-NQMSFDMD.js +14 -0
- package/dist/{routing-memory-2SMMUPTB.js → routing-memory-BBHAEJUL.js} +4 -4
- package/dist/{session-memory-YQQVPLKM.js → session-memory-GYIEP7MM.js} +5 -5
- package/dist/setup-config-YIQ7ZZT3.js +11 -0
- package/dist/{setup-custom-api-ZSBUIJID.js → setup-custom-api-CHISHJZV.js} +7 -7
- package/dist/setup-data-dir-KQKFLBKQ.js +29 -0
- package/dist/tool-memory-TGNVGKUT.js +22 -0
- package/dist/tool-memory-registry-adapters-35IPCJLV.js +12 -0
- package/dist/unified-registry-D4QCQ36Z.js +26 -0
- package/dist/{weather-report-6AVPMHHM.js → weather-report-ZLQGZUDL.js} +4 -4
- package/package.json +4 -8
- package/dist/chunk-37JIYDVH.js +0 -7
- package/dist/chunk-7U7HAYPB.js.map +0 -1
- package/dist/chunk-KSQSWEFH.js.map +0 -1
- package/dist/chunk-KUYKSKPV.js.map +0 -1
- package/dist/chunk-WLIXCNZ6.js.map +0 -1
- package/dist/chunk-Y742U2YM.js.map +0 -1
- package/dist/doctor-deep-6WHVRRVQ.js +0 -13
- package/dist/factory-3BZDQQYM.js +0 -25
- package/dist/factory-UFKRSADE.js +0 -15
- package/dist/issue-triage-2LNYGQRJ.js +0 -17
- package/dist/research-helpers-synthesize-QY3DDHTD.js +0 -14
- package/dist/setup-config-LMZE4IRV.js +0 -11
- package/dist/setup-data-dir-ZEH7TFA6.js +0 -29
- package/dist/tool-memory-GUPG2M25.js +0 -22
- package/dist/tool-memory-registry-adapters-IMRSOAAV.js +0 -12
- package/dist/unified-registry-RPT4O3XB.js +0 -26
- package/scripts/postinstall.js +0 -12
- /package/dist/{child-mcp-config-ORXLS5HP.js.map → child-mcp-config-V2ESGPZ4.js.map} +0 -0
- /package/dist/{chunk-RBF64DXJ.js.map → chunk-2S7Q7GHX.js.map} +0 -0
- /package/dist/{chunk-AGFXJUTS.js.map → chunk-3GMYW66U.js.map} +0 -0
- /package/dist/{chunk-4OW67KT2.js.map → chunk-4HXPNLZS.js.map} +0 -0
- /package/dist/{chunk-W4Q5NZYZ.js.map → chunk-4QHAMZLU.js.map} +0 -0
- /package/dist/{chunk-RSMG2DPB.js.map → chunk-64GMIUM5.js.map} +0 -0
- /package/dist/{chunk-RLBJTZHA.js.map → chunk-AHTOZ2UR.js.map} +0 -0
- /package/dist/{chunk-JNZ3D5B5.js.map → chunk-AL5E5T3O.js.map} +0 -0
- /package/dist/{chunk-3CGUPSBW.js.map → chunk-BKAUGBSF.js.map} +0 -0
- /package/dist/{chunk-XREG2HTQ.js.map → chunk-BSWLRSOG.js.map} +0 -0
- /package/dist/{chunk-JJT7NVNY.js.map → chunk-CHU7NTUR.js.map} +0 -0
- /package/dist/{chunk-UVO673OY.js.map → chunk-DBDXS7PE.js.map} +0 -0
- /package/dist/{chunk-LVYRGNOC.js.map → chunk-DWUF5YWG.js.map} +0 -0
- /package/dist/{chunk-VVXHIUFQ.js.map → chunk-EGWPONTU.js.map} +0 -0
- /package/dist/{chunk-OHULIRP6.js.map → chunk-EXAULYXZ.js.map} +0 -0
- /package/dist/{chunk-K2AWJGQO.js.map → chunk-FSY2TYFX.js.map} +0 -0
- /package/dist/{chunk-6GYTTWNM.js.map → chunk-FVHUWXM2.js.map} +0 -0
- /package/dist/{chunk-ZGEDIKAM.js.map → chunk-FW2FBZBD.js.map} +0 -0
- /package/dist/{chunk-ZD4VEHEG.js.map → chunk-H6BUSSTF.js.map} +0 -0
- /package/dist/{chunk-D6TL5GZV.js.map → chunk-HKKLVWRO.js.map} +0 -0
- /package/dist/{chunk-GBHJ37V3.js.map → chunk-ITCKXMOH.js.map} +0 -0
- /package/dist/{chunk-KJWD2V4K.js.map → chunk-JFE3JT5Q.js.map} +0 -0
- /package/dist/{chunk-37JIYDVH.js.map → chunk-KRG23W3T.js.map} +0 -0
- /package/dist/{chunk-33FI7W3G.js.map → chunk-L2PDPA23.js.map} +0 -0
- /package/dist/{chunk-XZEYSIGG.js.map → chunk-LOKTE5WE.js.map} +0 -0
- /package/dist/{chunk-JEAKVUWM.js.map → chunk-M6E5E7QV.js.map} +0 -0
- /package/dist/{chunk-OGHEKPLD.js.map → chunk-MM223CVS.js.map} +0 -0
- /package/dist/{chunk-6Q3KSZVI.js.map → chunk-MWS56UFF.js.map} +0 -0
- /package/dist/{chunk-GAYSJGKD.js.map → chunk-OYWFWMLH.js.map} +0 -0
- /package/dist/{chunk-S2Z7CME3.js.map → chunk-PXJ6CB5V.js.map} +0 -0
- /package/dist/{chunk-Y5GYBP52.js.map → chunk-QTDUIXOJ.js.map} +0 -0
- /package/dist/{chunk-QAHGHWC7.js.map → chunk-WIJ5J7AH.js.map} +0 -0
- /package/dist/{chunk-BTWKDT4F.js.map → chunk-YJ7Q2NHE.js.map} +0 -0
- /package/dist/{chunk-IWTK6FDT.js.map → chunk-ZTPBXWA7.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-5FYJDS5O.js.map → cli-circuit-breaker-YFHX4FN2.js.map} +0 -0
- /package/dist/{codebase-search-RHBGEWXK.js.map → codebase-search-3D4TW3KR.js.map} +0 -0
- /package/dist/{composite-router-GE24MYPP.js.map → composite-router-224FZMI2.js.map} +0 -0
- /package/dist/{consensus-vote-62FAN4ZN.js.map → consensus-vote-57SKG3EN.js.map} +0 -0
- /package/dist/{context-retriever-3OO6N4V6.js.map → context-retriever-CCVDD7TO.js.map} +0 -0
- /package/dist/{dist-IKZ53APZ.js.map → dist-JK32DFHT.js.map} +0 -0
- /package/dist/{doctor-deep-6WHVRRVQ.js.map → doctor-deep-37II5V7H.js.map} +0 -0
- /package/dist/{doctor-live-J7JIZH3T.js.map → doctor-live-VXQOZW37.js.map} +0 -0
- /package/dist/{expert-bridge-PWRVRFDG.js.map → expert-bridge-7LGHU7IL.js.map} +0 -0
- /package/dist/{factory-3BZDQQYM.js.map → factory-5URERSHK.js.map} +0 -0
- /package/dist/{factory-UFKRSADE.js.map → factory-SF6ZPN6D.js.map} +0 -0
- /package/dist/{improvement-review-QUU5HR7Z.js.map → improvement-review-2AFBFUQX.js.map} +0 -0
- /package/dist/{init-opencode-GDPE4U65.js.map → init-opencode-ZFCKUI2N.js.map} +0 -0
- /package/dist/{issue-triage-2LNYGQRJ.js.map → issue-triage-IVYGGNB4.js.map} +0 -0
- /package/dist/{learning-persistence-7O5QYDM7.js.map → learning-persistence-7N5SZHNX.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-KBOP72XG.js.map → pr-reviewer-helpers-TS2HJMZR.js.map} +0 -0
- /package/dist/{registry-command-ZK4NQ2MX.js.map → registry-command-M6LXKNEY.js.map} +0 -0
- /package/dist/{repo-analyze-UJOWFGNM.js.map → repo-analyze-DI65XOTQ.js.map} +0 -0
- /package/dist/{repo-security-plan-SZU4O2TN.js.map → repo-security-plan-LS5GCASE.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-QY3DDHTD.js.map → research-helpers-synthesize-NQMSFDMD.js.map} +0 -0
- /package/dist/{routing-memory-2SMMUPTB.js.map → routing-memory-BBHAEJUL.js.map} +0 -0
- /package/dist/{session-memory-YQQVPLKM.js.map → session-memory-GYIEP7MM.js.map} +0 -0
- /package/dist/{setup-config-LMZE4IRV.js.map → setup-config-YIQ7ZZT3.js.map} +0 -0
- /package/dist/{setup-custom-api-ZSBUIJID.js.map → setup-custom-api-CHISHJZV.js.map} +0 -0
- /package/dist/{setup-data-dir-ZEH7TFA6.js.map → setup-data-dir-KQKFLBKQ.js.map} +0 -0
- /package/dist/{tool-memory-GUPG2M25.js.map → tool-memory-TGNVGKUT.js.map} +0 -0
- /package/dist/{tool-memory-registry-adapters-IMRSOAAV.js.map → tool-memory-registry-adapters-35IPCJLV.js.map} +0 -0
- /package/dist/{unified-registry-RPT4O3XB.js.map → unified-registry-D4QCQ36Z.js.map} +0 -0
- /package/dist/{weather-report-6AVPMHHM.js.map → weather-report-ZLQGZUDL.js.map} +0 -0
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
getDecisionCostFile,
|
|
4
4
|
getModelSelectionShadowFile,
|
|
5
5
|
isPersistenceEnabled
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ITCKXMOH.js";
|
|
7
7
|
import {
|
|
8
8
|
nexusDataPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MM223CVS.js";
|
|
10
10
|
import {
|
|
11
11
|
__require
|
|
12
12
|
} from "./chunk-ZPWHCABL.js";
|
|
@@ -222,8 +222,8 @@ var fileStream;
|
|
|
222
222
|
function getOutputStream() {
|
|
223
223
|
if (globalDestination === "file" && globalFilePath !== void 0) {
|
|
224
224
|
if (fileStream === void 0) {
|
|
225
|
-
const
|
|
226
|
-
fileStream =
|
|
225
|
+
const fs = __require("fs");
|
|
226
|
+
fileStream = fs.createWriteStream(globalFilePath, { flags: "a" });
|
|
227
227
|
}
|
|
228
228
|
return fileStream;
|
|
229
229
|
}
|
|
@@ -665,7 +665,7 @@ function truncateSummary(s) {
|
|
|
665
665
|
}
|
|
666
666
|
|
|
667
667
|
// src/core/step-bus.ts
|
|
668
|
-
import { EventEmitter } from "events";
|
|
668
|
+
import { EventEmitter } from "node:events";
|
|
669
669
|
var StepBus = class extends EventEmitter {
|
|
670
670
|
emit(eventName, event) {
|
|
671
671
|
return super.emit(eventName, event);
|
|
@@ -681,8 +681,8 @@ var stepBus = new StepBus();
|
|
|
681
681
|
stepBus.setMaxListeners(20);
|
|
682
682
|
|
|
683
683
|
// src/core/with-step.ts
|
|
684
|
-
import { AsyncLocalStorage } from "async_hooks";
|
|
685
|
-
import { randomBytes } from "crypto";
|
|
684
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
685
|
+
import { randomBytes } from "node:crypto";
|
|
686
686
|
var als = new AsyncLocalStorage();
|
|
687
687
|
function newStepId() {
|
|
688
688
|
return randomBytes(8).toString("hex");
|
|
@@ -1945,7 +1945,7 @@ function blockedBySizeQuirk(identity, matched) {
|
|
|
1945
1945
|
}
|
|
1946
1946
|
|
|
1947
1947
|
// src/config/manifest-overlay.ts
|
|
1948
|
-
import { existsSync, readFileSync, statSync } from "fs";
|
|
1948
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
1949
1949
|
import { parse as parseYaml } from "yaml";
|
|
1950
1950
|
import { z as z2 } from "zod";
|
|
1951
1951
|
|
|
@@ -2200,56 +2200,56 @@ function mergeOverlays(lower, higher) {
|
|
|
2200
2200
|
}
|
|
2201
2201
|
function loadUserManifestOverlay(options) {
|
|
2202
2202
|
const logger14 = options?.logger ?? createLogger({ component: "manifest-overlay" });
|
|
2203
|
-
const
|
|
2204
|
-
return loadManifestFile(
|
|
2203
|
+
const path = options?.path ?? resolveUserManifestPath(options?.env);
|
|
2204
|
+
return loadManifestFile(path, logger14);
|
|
2205
2205
|
}
|
|
2206
|
-
function loadManifestFile(
|
|
2206
|
+
function loadManifestFile(path, logger14) {
|
|
2207
2207
|
let exists = false;
|
|
2208
2208
|
try {
|
|
2209
|
-
exists = existsSync(
|
|
2209
|
+
exists = existsSync(path);
|
|
2210
2210
|
} catch {
|
|
2211
|
-
return { entries: [], rejections: [], path
|
|
2211
|
+
return { entries: [], rejections: [], path, status: "missing" };
|
|
2212
2212
|
}
|
|
2213
2213
|
if (!exists) {
|
|
2214
|
-
return { entries: [], rejections: [], path
|
|
2214
|
+
return { entries: [], rejections: [], path, status: "missing" };
|
|
2215
2215
|
}
|
|
2216
|
-
const stat = statSync(
|
|
2216
|
+
const stat = statSync(path);
|
|
2217
2217
|
if (stat.size === 0) {
|
|
2218
|
-
return { entries: [], rejections: [], path
|
|
2218
|
+
return { entries: [], rejections: [], path, status: "empty" };
|
|
2219
2219
|
}
|
|
2220
2220
|
if (stat.size > MANIFEST_MAX_BYTES) {
|
|
2221
2221
|
logger14.warn("Manifest overlay too large; skipping", {
|
|
2222
|
-
path
|
|
2222
|
+
path,
|
|
2223
2223
|
size: stat.size,
|
|
2224
2224
|
max: MANIFEST_MAX_BYTES
|
|
2225
2225
|
});
|
|
2226
|
-
return { entries: [], rejections: [], path
|
|
2226
|
+
return { entries: [], rejections: [], path, status: "too-large" };
|
|
2227
2227
|
}
|
|
2228
|
-
const raw = readFileSync(
|
|
2229
|
-
return parseManifest(raw,
|
|
2228
|
+
const raw = readFileSync(path, "utf-8");
|
|
2229
|
+
return parseManifest(raw, path, logger14);
|
|
2230
2230
|
}
|
|
2231
|
-
function parseManifest(raw,
|
|
2231
|
+
function parseManifest(raw, path, logger14) {
|
|
2232
2232
|
let parsed;
|
|
2233
2233
|
try {
|
|
2234
|
-
if (
|
|
2234
|
+
if (path.endsWith(".json")) {
|
|
2235
2235
|
parsed = JSON.parse(raw);
|
|
2236
2236
|
} else {
|
|
2237
2237
|
parsed = parseYaml(raw);
|
|
2238
2238
|
}
|
|
2239
2239
|
} catch (e) {
|
|
2240
2240
|
logger14.warn("Manifest overlay parse failure; skipping", {
|
|
2241
|
-
path
|
|
2241
|
+
path,
|
|
2242
2242
|
error: e instanceof Error ? e.message : String(e)
|
|
2243
2243
|
});
|
|
2244
|
-
return { entries: [], rejections: [], path
|
|
2244
|
+
return { entries: [], rejections: [], path, status: "malformed" };
|
|
2245
2245
|
}
|
|
2246
2246
|
const shape = ManifestSchema.safeParse(parsed);
|
|
2247
2247
|
if (!shape.success) {
|
|
2248
2248
|
logger14.warn("Manifest overlay schema mismatch at root; skipping", {
|
|
2249
|
-
path
|
|
2249
|
+
path,
|
|
2250
2250
|
issues: shape.error.issues.slice(0, 5).map((i) => i.message)
|
|
2251
2251
|
});
|
|
2252
|
-
return { entries: [], rejections: [], path
|
|
2252
|
+
return { entries: [], rejections: [], path, status: "malformed" };
|
|
2253
2253
|
}
|
|
2254
2254
|
const entries = [];
|
|
2255
2255
|
const rejections = [];
|
|
@@ -2267,7 +2267,7 @@ function parseManifest(raw, path2, logger14) {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
entries.push(materializeEntry(result.data));
|
|
2269
2269
|
});
|
|
2270
|
-
return { entries, rejections, path
|
|
2270
|
+
return { entries, rejections, path, status: "loaded" };
|
|
2271
2271
|
}
|
|
2272
2272
|
function materializeEntry(input) {
|
|
2273
2273
|
return {
|
|
@@ -2312,14 +2312,14 @@ function pickOptionalFields(input) {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
|
|
2314
2314
|
// src/config/models-dev-snapshot-loader.ts
|
|
2315
|
-
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
2316
|
-
import { fileURLToPath } from "url";
|
|
2317
|
-
import { dirname, join } from "path";
|
|
2315
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
2316
|
+
import { fileURLToPath } from "node:url";
|
|
2317
|
+
import { dirname, join } from "node:path";
|
|
2318
2318
|
function defaultSnapshotPath() {
|
|
2319
2319
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
2320
2320
|
return join(here, "models-dev-snapshot.json");
|
|
2321
2321
|
}
|
|
2322
|
-
function stripMalformedPricing(entries, logger14,
|
|
2322
|
+
function stripMalformedPricing(entries, logger14, path) {
|
|
2323
2323
|
let strippedPricing = 0;
|
|
2324
2324
|
const out = entries.map((entry) => {
|
|
2325
2325
|
const pricing = entry.pricing;
|
|
@@ -2334,7 +2334,7 @@ function stripMalformedPricing(entries, logger14, path2) {
|
|
|
2334
2334
|
});
|
|
2335
2335
|
if (strippedPricing > 0) {
|
|
2336
2336
|
logger14.warn("models.dev snapshot entries had non-numeric pricing; treated as unpriced", {
|
|
2337
|
-
path
|
|
2337
|
+
path,
|
|
2338
2338
|
strippedPricing
|
|
2339
2339
|
});
|
|
2340
2340
|
}
|
|
@@ -2342,50 +2342,50 @@ function stripMalformedPricing(entries, logger14, path2) {
|
|
|
2342
2342
|
}
|
|
2343
2343
|
function loadModelsDevSnapshot(options) {
|
|
2344
2344
|
const logger14 = createLogger({ component: "models-dev-snapshot" });
|
|
2345
|
-
const
|
|
2345
|
+
const path = options?.path ?? defaultSnapshotPath();
|
|
2346
2346
|
let exists = false;
|
|
2347
2347
|
try {
|
|
2348
|
-
exists = existsSync2(
|
|
2348
|
+
exists = existsSync2(path);
|
|
2349
2349
|
} catch {
|
|
2350
|
-
return { entries: [], path
|
|
2350
|
+
return { entries: [], path, status: "missing" };
|
|
2351
2351
|
}
|
|
2352
2352
|
if (!exists) {
|
|
2353
|
-
return { entries: [], path
|
|
2353
|
+
return { entries: [], path, status: "missing" };
|
|
2354
2354
|
}
|
|
2355
2355
|
let parsed;
|
|
2356
2356
|
try {
|
|
2357
|
-
parsed = JSON.parse(readFileSync2(
|
|
2357
|
+
parsed = JSON.parse(readFileSync2(path, "utf-8"));
|
|
2358
2358
|
} catch (e) {
|
|
2359
2359
|
logger14.warn("models.dev snapshot parse failure; skipping", {
|
|
2360
|
-
path
|
|
2360
|
+
path,
|
|
2361
2361
|
error: e instanceof Error ? e.message : String(e)
|
|
2362
2362
|
});
|
|
2363
|
-
return { entries: [], path
|
|
2363
|
+
return { entries: [], path, status: "malformed" };
|
|
2364
2364
|
}
|
|
2365
2365
|
if (parsed.version !== 1) {
|
|
2366
2366
|
logger14.warn("models.dev snapshot version unsupported; skipping", {
|
|
2367
|
-
path
|
|
2367
|
+
path,
|
|
2368
2368
|
version: parsed.version
|
|
2369
2369
|
});
|
|
2370
|
-
return { entries: [], path
|
|
2370
|
+
return { entries: [], path, status: "malformed" };
|
|
2371
2371
|
}
|
|
2372
2372
|
if (!Array.isArray(parsed.entries)) {
|
|
2373
|
-
logger14.warn("models.dev snapshot missing entries array; skipping", { path
|
|
2374
|
-
return { entries: [], path
|
|
2373
|
+
logger14.warn("models.dev snapshot missing entries array; skipping", { path });
|
|
2374
|
+
return { entries: [], path, status: "malformed" };
|
|
2375
2375
|
}
|
|
2376
|
-
const entries = stripMalformedPricing(parsed.entries, logger14,
|
|
2376
|
+
const entries = stripMalformedPricing(parsed.entries, logger14, path);
|
|
2377
2377
|
return {
|
|
2378
2378
|
entries,
|
|
2379
|
-
path
|
|
2379
|
+
path,
|
|
2380
2380
|
status: "loaded",
|
|
2381
2381
|
...typeof parsed.fetchedAt === "string" ? { fetchedAt: parsed.fetchedAt } : {}
|
|
2382
2382
|
};
|
|
2383
2383
|
}
|
|
2384
2384
|
|
|
2385
2385
|
// src/config/models-generated-loader.ts
|
|
2386
|
-
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
|
|
2387
|
-
import { dirname as dirname2, join as join2 } from "path";
|
|
2388
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2386
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
2387
|
+
import { dirname as dirname2, join as join2 } from "node:path";
|
|
2388
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2389
2389
|
function defaultGeneratedPath() {
|
|
2390
2390
|
try {
|
|
2391
2391
|
const dataPath = nexusDataPath("model-registry.generated.json");
|
|
@@ -2426,34 +2426,34 @@ function toModelEntry(rec) {
|
|
|
2426
2426
|
}
|
|
2427
2427
|
function loadGeneratedRegistryEntries(options) {
|
|
2428
2428
|
const logger14 = createLogger({ component: "models-generated" });
|
|
2429
|
-
const
|
|
2429
|
+
const path = options?.path ?? defaultGeneratedPath();
|
|
2430
2430
|
let exists = false;
|
|
2431
2431
|
try {
|
|
2432
|
-
exists = existsSync3(
|
|
2432
|
+
exists = existsSync3(path);
|
|
2433
2433
|
} catch {
|
|
2434
|
-
return { entries: [], path
|
|
2434
|
+
return { entries: [], path, status: "missing" };
|
|
2435
2435
|
}
|
|
2436
|
-
if (!exists) return { entries: [], path
|
|
2436
|
+
if (!exists) return { entries: [], path, status: "missing" };
|
|
2437
2437
|
let parsed;
|
|
2438
2438
|
try {
|
|
2439
|
-
parsed = JSON.parse(readFileSync3(
|
|
2439
|
+
parsed = JSON.parse(readFileSync3(path, "utf-8"));
|
|
2440
2440
|
} catch (e) {
|
|
2441
2441
|
logger14.warn("generated registry parse failure; skipping", {
|
|
2442
|
-
path
|
|
2442
|
+
path,
|
|
2443
2443
|
error: e instanceof Error ? e.message : String(e)
|
|
2444
2444
|
});
|
|
2445
|
-
return { entries: [], path
|
|
2445
|
+
return { entries: [], path, status: "malformed" };
|
|
2446
2446
|
}
|
|
2447
2447
|
if (!Array.isArray(parsed.entries)) {
|
|
2448
|
-
logger14.warn("generated registry missing entries array; skipping", { path
|
|
2449
|
-
return { entries: [], path
|
|
2448
|
+
logger14.warn("generated registry missing entries array; skipping", { path });
|
|
2449
|
+
return { entries: [], path, status: "malformed" };
|
|
2450
2450
|
}
|
|
2451
2451
|
const entries = [];
|
|
2452
2452
|
for (const raw of parsed.entries) {
|
|
2453
2453
|
const entry = toModelEntry(raw);
|
|
2454
2454
|
if (entry !== void 0) entries.push(entry);
|
|
2455
2455
|
}
|
|
2456
|
-
return { entries, path
|
|
2456
|
+
return { entries, path, status: "loaded" };
|
|
2457
2457
|
}
|
|
2458
2458
|
|
|
2459
2459
|
// src/config/model-registry.ts
|
|
@@ -2653,7 +2653,7 @@ function setDefaultRegistry(registry) {
|
|
|
2653
2653
|
}
|
|
2654
2654
|
async function reloadDefaultRegistry() {
|
|
2655
2655
|
globalRegistry = buildDefaultRegistry();
|
|
2656
|
-
const { resetGlobalRegistry } = await import("./unified-registry-
|
|
2656
|
+
const { resetGlobalRegistry } = await import("./unified-registry-D4QCQ36Z.js");
|
|
2657
2657
|
resetGlobalRegistry();
|
|
2658
2658
|
return globalRegistry;
|
|
2659
2659
|
}
|
|
@@ -2923,7 +2923,7 @@ function calculateCost(model, inputTokens, outputTokens) {
|
|
|
2923
2923
|
}
|
|
2924
2924
|
|
|
2925
2925
|
// src/core/trace-helpers.ts
|
|
2926
|
-
import { randomUUID } from "crypto";
|
|
2926
|
+
import { randomUUID } from "node:crypto";
|
|
2927
2927
|
function generateTraceId() {
|
|
2928
2928
|
return randomUUID();
|
|
2929
2929
|
}
|
|
@@ -3278,10 +3278,6 @@ var Tracer = class {
|
|
|
3278
3278
|
};
|
|
3279
3279
|
setTracerFactory((config) => new Tracer(config));
|
|
3280
3280
|
|
|
3281
|
-
// src/core/trace-exporter.ts
|
|
3282
|
-
import * as fs from "fs";
|
|
3283
|
-
import * as path from "path";
|
|
3284
|
-
|
|
3285
3281
|
// src/cli/ansi-output.ts
|
|
3286
3282
|
var colorsEnabled = !("NO_COLOR" in process.env) && process.stdout.isTTY;
|
|
3287
3283
|
var colors = {
|
|
@@ -3388,7 +3384,6 @@ function formatPercentage(value, decimals = 0) {
|
|
|
3388
3384
|
}
|
|
3389
3385
|
|
|
3390
3386
|
// src/core/artifact.ts
|
|
3391
|
-
import { randomUUID as randomUUID2 } from "crypto";
|
|
3392
3387
|
import { z as z4 } from "zod";
|
|
3393
3388
|
var ArtifactType = {
|
|
3394
3389
|
/** Planning documents and task breakdowns */
|
|
@@ -3612,8 +3607,8 @@ function safeRegex(pattern, flags) {
|
|
|
3612
3607
|
|
|
3613
3608
|
// src/core/zod-helpers.ts
|
|
3614
3609
|
function formatZodIssue(issue) {
|
|
3615
|
-
const
|
|
3616
|
-
return `${
|
|
3610
|
+
const path = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
|
|
3611
|
+
return `${path}${issue.message}`;
|
|
3617
3612
|
}
|
|
3618
3613
|
function formatZodError(error) {
|
|
3619
3614
|
return error.issues.map(formatZodIssue).join("; ");
|
|
@@ -5037,8 +5032,8 @@ function detectCapabilityGaps(required) {
|
|
|
5037
5032
|
}
|
|
5038
5033
|
|
|
5039
5034
|
// src/core/task-analysis/capability-gap-ledger-persistence.ts
|
|
5040
|
-
import { appendFileSync, existsSync as
|
|
5041
|
-
import { dirname as
|
|
5035
|
+
import { appendFileSync, existsSync as existsSync4, mkdirSync, readFileSync as readFileSync4 } from "node:fs";
|
|
5036
|
+
import { dirname as dirname3 } from "node:path";
|
|
5042
5037
|
var DEFAULT_MAX_ENTRIES = 5e3;
|
|
5043
5038
|
var DEFAULT_RETENTION_DAYS = 90;
|
|
5044
5039
|
var MAX_EXAMPLE_GOALS = 3;
|
|
@@ -5084,7 +5079,7 @@ function loadEntries(filePath, cutoff, maxEntries) {
|
|
|
5084
5079
|
const entries = [];
|
|
5085
5080
|
let malformedLines = 0;
|
|
5086
5081
|
let expiredEntries = 0;
|
|
5087
|
-
const fileExisted =
|
|
5082
|
+
const fileExisted = existsSync4(filePath);
|
|
5088
5083
|
if (!fileExisted) {
|
|
5089
5084
|
return { entries, report: { fileExisted, loaded: 0, malformedLines: 0, expiredEntries: 0 } };
|
|
5090
5085
|
}
|
|
@@ -5143,7 +5138,7 @@ function createPersistentCapabilityGapLedger(config) {
|
|
|
5143
5138
|
}
|
|
5144
5139
|
if (entries.length > maxEntries) entries.splice(0, entries.length - maxEntries);
|
|
5145
5140
|
try {
|
|
5146
|
-
|
|
5141
|
+
mkdirSync(dirname3(config.filePath), { recursive: true });
|
|
5147
5142
|
appendFileSync(config.filePath, `${lines.join("\n")}
|
|
5148
5143
|
`, "utf-8");
|
|
5149
5144
|
} catch {
|
|
@@ -5349,7 +5344,7 @@ function toExpertTaskAnalysisResult(analysis) {
|
|
|
5349
5344
|
}
|
|
5350
5345
|
|
|
5351
5346
|
// src/core/random-provider.ts
|
|
5352
|
-
import { randomBytes as randomBytes2, randomInt as cryptoRandomInt, randomUUID as
|
|
5347
|
+
import { randomBytes as randomBytes2, randomInt as cryptoRandomInt, randomUUID as randomUUID2 } from "node:crypto";
|
|
5353
5348
|
var CHARS = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
5354
5349
|
var UNBIASED_LIMIT = CHARS.length * Math.floor(256 / CHARS.length);
|
|
5355
5350
|
var SystemRandomProvider = class {
|
|
@@ -5392,7 +5387,7 @@ var SystemRandomProvider = class {
|
|
|
5392
5387
|
return result;
|
|
5393
5388
|
}
|
|
5394
5389
|
uuid() {
|
|
5395
|
-
return
|
|
5390
|
+
return randomUUID2();
|
|
5396
5391
|
}
|
|
5397
5392
|
};
|
|
5398
5393
|
var globalRandomProvider = new SystemRandomProvider();
|
|
@@ -7061,7 +7056,7 @@ var LinUCBBandit = class {
|
|
|
7061
7056
|
};
|
|
7062
7057
|
|
|
7063
7058
|
// src/cli-adapters/preference-router.ts
|
|
7064
|
-
import { randomUUID as
|
|
7059
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
7065
7060
|
|
|
7066
7061
|
// src/cli-adapters/preference-router-types.ts
|
|
7067
7062
|
import { z as z8 } from "zod";
|
|
@@ -7182,7 +7177,7 @@ var InMemoryPreferenceStore = class {
|
|
|
7182
7177
|
};
|
|
7183
7178
|
|
|
7184
7179
|
// src/cli-adapters/preference-router-extractor.ts
|
|
7185
|
-
import { createHash } from "crypto";
|
|
7180
|
+
import { createHash } from "node:crypto";
|
|
7186
7181
|
var CODE_KEYWORDS = [
|
|
7187
7182
|
"function",
|
|
7188
7183
|
"class",
|
|
@@ -7350,7 +7345,7 @@ var PreferenceRouter = class {
|
|
|
7350
7345
|
recordPreference(query, strongModelPreferred, strongModelQuality, weakModelQuality) {
|
|
7351
7346
|
const features = this.featureExtractor.extract(query);
|
|
7352
7347
|
const dataPoint = {
|
|
7353
|
-
id:
|
|
7348
|
+
id: randomUUID3(),
|
|
7354
7349
|
query,
|
|
7355
7350
|
features,
|
|
7356
7351
|
strongModelPreferred,
|
|
@@ -10392,9 +10387,9 @@ function getOutcomeStore() {
|
|
|
10392
10387
|
}
|
|
10393
10388
|
async function attachOutcomeStoreToRegistry(store) {
|
|
10394
10389
|
try {
|
|
10395
|
-
const { getMemoryRegistry } = await import("./dist-
|
|
10390
|
+
const { getMemoryRegistry } = await import("./dist-JK32DFHT.js");
|
|
10396
10391
|
const { OutcomeStoreAdapter } = await import("./outcome-store-adapter-K4L3RUJE.js");
|
|
10397
|
-
const { ensureSharedMemoryRegistry } = await import("./tool-memory-registry-adapters-
|
|
10392
|
+
const { ensureSharedMemoryRegistry } = await import("./tool-memory-registry-adapters-35IPCJLV.js");
|
|
10398
10393
|
ensureSharedMemoryRegistry();
|
|
10399
10394
|
getMemoryRegistry().attach("outcomes", new OutcomeStoreAdapter(store));
|
|
10400
10395
|
} catch {
|
|
@@ -11676,7 +11671,7 @@ function createMetricsMiddleware() {
|
|
|
11676
11671
|
}
|
|
11677
11672
|
|
|
11678
11673
|
// src/agents/heartbeat-monitor.ts
|
|
11679
|
-
import { randomBytes as randomBytes3 } from "crypto";
|
|
11674
|
+
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
11680
11675
|
|
|
11681
11676
|
// src/config/defaults-types.ts
|
|
11682
11677
|
import { z as z15 } from "zod";
|
|
@@ -12168,7 +12163,7 @@ function validateTimeout(requestedMs, minMs = VOTE_TIMEOUTS.minMs, maxMs = VOTE_
|
|
|
12168
12163
|
}
|
|
12169
12164
|
|
|
12170
12165
|
// src/agents/heartbeat-monitor.ts
|
|
12171
|
-
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
12166
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
12172
12167
|
var DEFAULT_SLOW_THRESHOLD_MS = HEARTBEAT_TIMEOUTS.slowThresholdMs;
|
|
12173
12168
|
var DEFAULT_STALLED_THRESHOLD_MS = HEARTBEAT_TIMEOUTS.stalledThresholdMs;
|
|
12174
12169
|
var DEFAULT_ABSOLUTE_MAX_MS = HEARTBEAT_TIMEOUTS.absoluteMaxMs;
|
|
@@ -12354,8 +12349,8 @@ function aggregateDecisionCosts(records, windowMs) {
|
|
|
12354
12349
|
import { z as z17 } from "zod";
|
|
12355
12350
|
|
|
12356
12351
|
// src/config/jsonl-store.ts
|
|
12357
|
-
import { appendFileSync as appendFileSync2, existsSync as
|
|
12358
|
-
import { dirname as
|
|
12352
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync } from "node:fs";
|
|
12353
|
+
import { dirname as dirname4 } from "node:path";
|
|
12359
12354
|
var DIR_MODE = 448;
|
|
12360
12355
|
var JsonlStore = class {
|
|
12361
12356
|
filePath;
|
|
@@ -12408,7 +12403,7 @@ var JsonlStore = class {
|
|
|
12408
12403
|
// ==========================================================================
|
|
12409
12404
|
ensureDir() {
|
|
12410
12405
|
try {
|
|
12411
|
-
|
|
12406
|
+
mkdirSync2(dirname4(this.filePath), { recursive: true, mode: DIR_MODE });
|
|
12412
12407
|
} catch (error) {
|
|
12413
12408
|
this.logger.warn("Failed to create JSONL store directory", {
|
|
12414
12409
|
error: getErrorMessage(error),
|
|
@@ -12417,7 +12412,7 @@ var JsonlStore = class {
|
|
|
12417
12412
|
}
|
|
12418
12413
|
}
|
|
12419
12414
|
hydrate() {
|
|
12420
|
-
if (!
|
|
12415
|
+
if (!existsSync5(this.filePath)) {
|
|
12421
12416
|
this.logger.debug("No JSONL file found, starting fresh", { path: this.filePath });
|
|
12422
12417
|
return;
|
|
12423
12418
|
}
|
|
@@ -12473,7 +12468,7 @@ var JsonlStore = class {
|
|
|
12473
12468
|
rewriteFile() {
|
|
12474
12469
|
try {
|
|
12475
12470
|
const content = this.records.map((r) => JSON.stringify(r)).join("\n") + "\n";
|
|
12476
|
-
|
|
12471
|
+
writeFileSync(this.filePath, content, "utf-8");
|
|
12477
12472
|
return true;
|
|
12478
12473
|
} catch (error) {
|
|
12479
12474
|
this.logger.warn("Failed to rewrite JSONL store file", {
|
|
@@ -12718,7 +12713,6 @@ var DecisionCostStore = class {
|
|
|
12718
12713
|
};
|
|
12719
12714
|
|
|
12720
12715
|
// src/orchestration/strategy-manifest.ts
|
|
12721
|
-
import { existsSync as existsSync7, readFileSync as readFileSync6 } from "fs";
|
|
12722
12716
|
import { parse as parseYaml2 } from "yaml";
|
|
12723
12717
|
import { z as z18 } from "zod";
|
|
12724
12718
|
var STRATEGY_MANIFEST_SCHEMA_VERSION = 1;
|
|
@@ -14745,7 +14739,7 @@ function resolveModelForTier(cliName, tier, opts = {}) {
|
|
|
14745
14739
|
}
|
|
14746
14740
|
|
|
14747
14741
|
// src/cli-adapters/model-selection-shadow.ts
|
|
14748
|
-
import { appendFileSync as appendFileSync3, existsSync as
|
|
14742
|
+
import { appendFileSync as appendFileSync3, existsSync as existsSync6, readFileSync as readFileSync6 } from "node:fs";
|
|
14749
14743
|
import { z as z21 } from "zod";
|
|
14750
14744
|
function isRouteModelShadowEnabled() {
|
|
14751
14745
|
return process.env["NEXUS_ROUTE_MODEL_SHADOW"] === "1" && isPersistenceEnabled();
|
|
@@ -14796,11 +14790,11 @@ function persistModelSelectionShadowRecord(record) {
|
|
|
14796
14790
|
}
|
|
14797
14791
|
function readModelSelectionShadowRecords() {
|
|
14798
14792
|
const file = getModelSelectionShadowFile();
|
|
14799
|
-
if (!
|
|
14793
|
+
if (!existsSync6(file)) return [];
|
|
14800
14794
|
const records = [];
|
|
14801
14795
|
try {
|
|
14802
14796
|
const cutoff = Date.now() - READ_LOOKBACK_MS;
|
|
14803
|
-
const lines =
|
|
14797
|
+
const lines = readFileSync6(file, "utf-8").split("\n").filter((l) => l.trim().length > 0);
|
|
14804
14798
|
for (const line of lines) {
|
|
14805
14799
|
let parsed;
|
|
14806
14800
|
try {
|
|
@@ -15333,7 +15327,7 @@ var CompositeRouter = class _CompositeRouter {
|
|
|
15333
15327
|
*/
|
|
15334
15328
|
async consultUnifiedContext(task) {
|
|
15335
15329
|
try {
|
|
15336
|
-
const { getContextForTask, inferTaskCategory } = await import("./context-retriever-
|
|
15330
|
+
const { getContextForTask, inferTaskCategory } = await import("./context-retriever-CCVDD7TO.js");
|
|
15337
15331
|
const ctx = await getContextForTask({
|
|
15338
15332
|
task: task.content,
|
|
15339
15333
|
category: inferTaskCategory(task.content),
|
|
@@ -15852,10 +15846,33 @@ var OrchestratorError = class extends Error {
|
|
|
15852
15846
|
}
|
|
15853
15847
|
};
|
|
15854
15848
|
|
|
15855
|
-
// src/context/
|
|
15856
|
-
import
|
|
15857
|
-
import {
|
|
15858
|
-
import {
|
|
15849
|
+
// src/context/open-database.ts
|
|
15850
|
+
import { DatabaseSync } from "node:sqlite";
|
|
15851
|
+
import { mkdirSync as mkdirSync3 } from "node:fs";
|
|
15852
|
+
import { dirname as dirname5 } from "node:path";
|
|
15853
|
+
function isInMemory(dbPath) {
|
|
15854
|
+
return dbPath === ":memory:" || dbPath === "";
|
|
15855
|
+
}
|
|
15856
|
+
function openSqliteDatabase(dbPath) {
|
|
15857
|
+
if (!isInMemory(dbPath)) {
|
|
15858
|
+
mkdirSync3(dirname5(dbPath), { recursive: true });
|
|
15859
|
+
}
|
|
15860
|
+
const db = new DatabaseSync(dbPath);
|
|
15861
|
+
db.exec("PRAGMA journal_mode = WAL");
|
|
15862
|
+
return makeIdempotentClose(db);
|
|
15863
|
+
}
|
|
15864
|
+
function makeIdempotentClose(db) {
|
|
15865
|
+
const narrowed = db;
|
|
15866
|
+
return {
|
|
15867
|
+
exec: (sql) => {
|
|
15868
|
+
db.exec(sql);
|
|
15869
|
+
},
|
|
15870
|
+
prepare: narrowed.prepare.bind(narrowed),
|
|
15871
|
+
close: () => {
|
|
15872
|
+
if (db.isOpen) db.close();
|
|
15873
|
+
}
|
|
15874
|
+
};
|
|
15875
|
+
}
|
|
15859
15876
|
|
|
15860
15877
|
// src/context/mobimem-types.ts
|
|
15861
15878
|
import { z as z23 } from "zod";
|
|
@@ -15882,10 +15899,10 @@ var MobiMemConfigSchema = z23.object({
|
|
|
15882
15899
|
});
|
|
15883
15900
|
|
|
15884
15901
|
// src/context/mobimem-impl.ts
|
|
15885
|
-
import { randomUUID as
|
|
15902
|
+
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
15886
15903
|
|
|
15887
15904
|
// src/context/mobimem-impl-helpers.ts
|
|
15888
|
-
import { createHash as createHash2 } from "crypto";
|
|
15905
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
15889
15906
|
function calculateConfidence2(observationCount) {
|
|
15890
15907
|
return Math.min(1, Math.log10(observationCount + 1) / 2);
|
|
15891
15908
|
}
|
|
@@ -16033,7 +16050,7 @@ var ProfileMemoryImpl = class {
|
|
|
16033
16050
|
return updated;
|
|
16034
16051
|
}
|
|
16035
16052
|
const entry = {
|
|
16036
|
-
id:
|
|
16053
|
+
id: randomUUID4(),
|
|
16037
16054
|
entityId,
|
|
16038
16055
|
entityType,
|
|
16039
16056
|
preferenceKey,
|
|
@@ -16130,7 +16147,7 @@ var ExperienceMemoryImpl = class {
|
|
|
16130
16147
|
return updated;
|
|
16131
16148
|
}
|
|
16132
16149
|
const entry = {
|
|
16133
|
-
id:
|
|
16150
|
+
id: randomUUID4(),
|
|
16134
16151
|
taskType,
|
|
16135
16152
|
actionSequence,
|
|
16136
16153
|
outcome,
|
|
@@ -16238,7 +16255,7 @@ var ActionCacheImpl = class {
|
|
|
16238
16255
|
const inputHash = hashInput(input);
|
|
16239
16256
|
const now = new Date(getTimeProvider().now());
|
|
16240
16257
|
const entry = {
|
|
16241
|
-
id:
|
|
16258
|
+
id: randomUUID4(),
|
|
16242
16259
|
inputHash,
|
|
16243
16260
|
input,
|
|
16244
16261
|
result,
|
|
@@ -16346,10 +16363,7 @@ var MobiMem = class {
|
|
|
16346
16363
|
if (validated.dbPath === ":memory:" || validated.dbPath === "") {
|
|
16347
16364
|
this.db = null;
|
|
16348
16365
|
} else {
|
|
16349
|
-
|
|
16350
|
-
const db = new Database(validated.dbPath);
|
|
16351
|
-
db.pragma("journal_mode = WAL");
|
|
16352
|
-
this.db = db;
|
|
16366
|
+
this.db = openSqliteDatabase(validated.dbPath);
|
|
16353
16367
|
}
|
|
16354
16368
|
this.profile = new ProfileMemoryImpl(this.config, this.db);
|
|
16355
16369
|
this.experience = new ExperienceMemoryImpl(this.config, this.db);
|
|
@@ -16897,6 +16911,7 @@ export {
|
|
|
16897
16911
|
PreferenceRouter,
|
|
16898
16912
|
createPreferenceRouter,
|
|
16899
16913
|
DEFAULT_ZERO_ROUTER_CONFIG,
|
|
16914
|
+
openSqliteDatabase,
|
|
16900
16915
|
getSharedMobiMem,
|
|
16901
16916
|
setSharedMobiMemDbPathResolver,
|
|
16902
16917
|
buildResearchContext,
|
|
@@ -16957,4 +16972,4 @@ export {
|
|
|
16957
16972
|
AgentCapability,
|
|
16958
16973
|
OrchestratorError
|
|
16959
16974
|
};
|
|
16960
|
-
//# sourceMappingURL=chunk-
|
|
16975
|
+
//# sourceMappingURL=chunk-J7SPTP2E.js.map
|