nexus-agents 4.3.3 → 4.3.5
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-JTLIU3JR.js → child-mcp-config-6BPBGQB4.js} +2 -2
- package/dist/{chunk-4JKO5B7A.js → chunk-4OSPP2KN.js} +2 -2
- package/dist/{chunk-DL5RN53R.js → chunk-65DZ7WHY.js} +2 -2
- package/dist/{chunk-KIWPXWL7.js → chunk-6DLKK5R2.js} +4 -4
- package/dist/{chunk-H64DUJSZ.js → chunk-AVB5GOSW.js} +6 -6
- package/dist/{chunk-CXA4H3PZ.js → chunk-CFEZ2DG6.js} +8 -8
- package/dist/{chunk-5GUP54YH.js → chunk-DFCJUKGD.js} +2 -2
- package/dist/{chunk-B6JICUQ6.js → chunk-E6ET2WJI.js} +4 -4
- package/dist/{chunk-AQAGVYWS.js → chunk-EJLOD53Z.js} +2 -2
- package/dist/{chunk-GWL7WO64.js → chunk-ES3CPAON.js} +35 -35
- package/dist/{chunk-BG7IE3V5.js → chunk-HI63BMZ6.js} +5 -5
- package/dist/{chunk-MPEQHP4D.js → chunk-IXMTCWMN.js} +3 -3
- package/dist/{chunk-WX5TASVN.js → chunk-K2ZYZZNZ.js} +3 -3
- package/dist/{chunk-55XLIDEN.js → chunk-LPUJG7C6.js} +2 -2
- package/dist/{chunk-SF6KSPBW.js → chunk-NKTANKWH.js} +3 -3
- package/dist/{chunk-X57EI3U6.js → chunk-OPH5S776.js} +2 -2
- package/dist/{chunk-3K3VGOY4.js → chunk-PG563EVI.js} +2 -2
- package/dist/{chunk-CYCXJNPA.js → chunk-PZSPL5KN.js} +2 -2
- package/dist/{chunk-MLR4PF64.js → chunk-QGXA25PQ.js} +2 -2
- package/dist/{chunk-OYNZ6FCZ.js → chunk-QTP4AIVR.js} +7 -7
- package/dist/{chunk-MPCBYY4J.js → chunk-RUN6KRCP.js} +8 -8
- package/dist/{chunk-FHXDRCIW.js → chunk-SHG3MYMD.js} +2 -2
- package/dist/{chunk-TKA6653I.js → chunk-SPZOZGBS.js} +2 -2
- package/dist/{chunk-ROAVF3S5.js → chunk-SSPEB62Y.js} +5 -5
- package/dist/{chunk-JV5HRP3S.js → chunk-TKFWYFBD.js} +2 -2
- package/dist/{chunk-TMYLHKLJ.js → chunk-U4LM5Q2L.js} +4 -4
- package/dist/{chunk-2QYJ7IE2.js → chunk-UH4MK2N7.js} +10 -12
- package/dist/chunk-UH4MK2N7.js.map +1 -0
- package/dist/{chunk-XABDFFQV.js → chunk-UI3WYJSZ.js} +2 -2
- package/dist/{chunk-Y3WYSLFZ.js → chunk-VWXQHGQ2.js} +2 -2
- package/dist/{chunk-DVKS77O5.js → chunk-XIIUIBSX.js} +5 -1
- package/dist/{chunk-DVKS77O5.js.map → chunk-XIIUIBSX.js.map} +1 -1
- package/dist/{chunk-LGTY3B3Q.js → chunk-XJORRLQT.js} +5 -5
- package/dist/{chunk-3P6N3XZF.js → chunk-Y3UJ3VLA.js} +2 -2
- package/dist/{chunk-73U6W5ZU.js → chunk-YIV4GQHK.js} +2 -2
- package/dist/{chunk-TXAWKJWL.js → chunk-ZLGQY55I.js} +8 -8
- package/dist/{chunk-A7DEF2I6.js → chunk-ZQWCL7YB.js} +3 -3
- package/dist/{cli-circuit-breaker-DG2L4C3C.js → cli-circuit-breaker-3CH36TPE.js} +3 -3
- package/dist/cli.js +55 -48
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-X5QU6XNZ.js → composite-router-QK4OPVDX.js} +2 -2
- package/dist/{consensus-vote-EOXPISAA.js → consensus-vote-DL4XNR7M.js} +17 -17
- package/dist/{context-retriever-CIFLPUJA.js → context-retriever-UPHWSEXA.js} +9 -9
- package/dist/{doctor-deep-FZGNQXDZ.js → doctor-deep-UHFL3AE4.js} +3 -3
- package/dist/{doctor-live-KGQWMYJY.js → doctor-live-2CGAFGFG.js} +9 -9
- package/dist/{expert-bridge-B6ZTEZNH.js → expert-bridge-KTKJTMMO.js} +4 -4
- package/dist/{factory-RLGGFLYD.js → factory-QQKY3UW4.js} +5 -5
- package/dist/{factory-5BEGXJVB.js → factory-SC3N2RMX.js} +9 -9
- package/dist/{improvement-review-52J36YLJ.js → improvement-review-I4WFQK25.js} +5 -5
- package/dist/index.js +31 -31
- package/dist/{init-opencode-JAJXMGOI.js → init-opencode-HTSSQOLE.js} +6 -6
- package/dist/issue-triage-SAS3D5K4.js +17 -0
- package/dist/{pr-reviewer-helpers-KZ4MNSUT.js → pr-reviewer-helpers-UOP4JVHI.js} +4 -4
- package/dist/{registry-command-AHGSBCNL.js → registry-command-EPG2X2ZI.js} +2 -2
- package/dist/{repo-security-plan-C4ZSWVY7.js → repo-security-plan-QYSW4MKN.js} +3 -3
- package/dist/{research-helpers-synthesize-C4GK3GU4.js → research-helpers-synthesize-YSYYUW5H.js} +4 -4
- package/dist/{routing-memory-WU4C63BA.js → routing-memory-BZ6IGNXN.js} +2 -2
- package/dist/{session-memory-LYX5N2IP.js → session-memory-GVOVQ3TV.js} +3 -3
- package/dist/{setup-command-R6LRVQ7P.js → setup-command-DLIUAXMJ.js} +14 -14
- package/dist/{setup-config-P722TC57.js → setup-config-Q2WGGIQT.js} +3 -3
- package/dist/{setup-custom-api-P7T5YKIK.js → setup-custom-api-GXF5MFBG.js} +4 -4
- package/dist/{tool-memory-AL5PXKB4.js → tool-memory-MHP37ASX.js} +6 -6
- package/dist/{tool-memory-registry-adapters-YQLOSV4S.js → tool-memory-registry-adapters-QEC3YHB2.js} +2 -2
- package/dist/{unified-registry-UM4GSYMB.js → unified-registry-WX3GDBCZ.js} +10 -10
- package/dist/{weather-report-QLHSZQOT.js → weather-report-YY7BO744.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-2QYJ7IE2.js.map +0 -1
- package/dist/issue-triage-APE6L5YP.js +0 -17
- /package/dist/{child-mcp-config-JTLIU3JR.js.map → child-mcp-config-6BPBGQB4.js.map} +0 -0
- /package/dist/{chunk-4JKO5B7A.js.map → chunk-4OSPP2KN.js.map} +0 -0
- /package/dist/{chunk-DL5RN53R.js.map → chunk-65DZ7WHY.js.map} +0 -0
- /package/dist/{chunk-KIWPXWL7.js.map → chunk-6DLKK5R2.js.map} +0 -0
- /package/dist/{chunk-H64DUJSZ.js.map → chunk-AVB5GOSW.js.map} +0 -0
- /package/dist/{chunk-CXA4H3PZ.js.map → chunk-CFEZ2DG6.js.map} +0 -0
- /package/dist/{chunk-5GUP54YH.js.map → chunk-DFCJUKGD.js.map} +0 -0
- /package/dist/{chunk-B6JICUQ6.js.map → chunk-E6ET2WJI.js.map} +0 -0
- /package/dist/{chunk-AQAGVYWS.js.map → chunk-EJLOD53Z.js.map} +0 -0
- /package/dist/{chunk-GWL7WO64.js.map → chunk-ES3CPAON.js.map} +0 -0
- /package/dist/{chunk-BG7IE3V5.js.map → chunk-HI63BMZ6.js.map} +0 -0
- /package/dist/{chunk-MPEQHP4D.js.map → chunk-IXMTCWMN.js.map} +0 -0
- /package/dist/{chunk-WX5TASVN.js.map → chunk-K2ZYZZNZ.js.map} +0 -0
- /package/dist/{chunk-55XLIDEN.js.map → chunk-LPUJG7C6.js.map} +0 -0
- /package/dist/{chunk-SF6KSPBW.js.map → chunk-NKTANKWH.js.map} +0 -0
- /package/dist/{chunk-X57EI3U6.js.map → chunk-OPH5S776.js.map} +0 -0
- /package/dist/{chunk-3K3VGOY4.js.map → chunk-PG563EVI.js.map} +0 -0
- /package/dist/{chunk-CYCXJNPA.js.map → chunk-PZSPL5KN.js.map} +0 -0
- /package/dist/{chunk-MLR4PF64.js.map → chunk-QGXA25PQ.js.map} +0 -0
- /package/dist/{chunk-OYNZ6FCZ.js.map → chunk-QTP4AIVR.js.map} +0 -0
- /package/dist/{chunk-MPCBYY4J.js.map → chunk-RUN6KRCP.js.map} +0 -0
- /package/dist/{chunk-FHXDRCIW.js.map → chunk-SHG3MYMD.js.map} +0 -0
- /package/dist/{chunk-TKA6653I.js.map → chunk-SPZOZGBS.js.map} +0 -0
- /package/dist/{chunk-ROAVF3S5.js.map → chunk-SSPEB62Y.js.map} +0 -0
- /package/dist/{chunk-JV5HRP3S.js.map → chunk-TKFWYFBD.js.map} +0 -0
- /package/dist/{chunk-TMYLHKLJ.js.map → chunk-U4LM5Q2L.js.map} +0 -0
- /package/dist/{chunk-XABDFFQV.js.map → chunk-UI3WYJSZ.js.map} +0 -0
- /package/dist/{chunk-Y3WYSLFZ.js.map → chunk-VWXQHGQ2.js.map} +0 -0
- /package/dist/{chunk-LGTY3B3Q.js.map → chunk-XJORRLQT.js.map} +0 -0
- /package/dist/{chunk-3P6N3XZF.js.map → chunk-Y3UJ3VLA.js.map} +0 -0
- /package/dist/{chunk-73U6W5ZU.js.map → chunk-YIV4GQHK.js.map} +0 -0
- /package/dist/{chunk-TXAWKJWL.js.map → chunk-ZLGQY55I.js.map} +0 -0
- /package/dist/{chunk-A7DEF2I6.js.map → chunk-ZQWCL7YB.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-DG2L4C3C.js.map → cli-circuit-breaker-3CH36TPE.js.map} +0 -0
- /package/dist/{composite-router-X5QU6XNZ.js.map → composite-router-QK4OPVDX.js.map} +0 -0
- /package/dist/{consensus-vote-EOXPISAA.js.map → consensus-vote-DL4XNR7M.js.map} +0 -0
- /package/dist/{context-retriever-CIFLPUJA.js.map → context-retriever-UPHWSEXA.js.map} +0 -0
- /package/dist/{doctor-deep-FZGNQXDZ.js.map → doctor-deep-UHFL3AE4.js.map} +0 -0
- /package/dist/{doctor-live-KGQWMYJY.js.map → doctor-live-2CGAFGFG.js.map} +0 -0
- /package/dist/{expert-bridge-B6ZTEZNH.js.map → expert-bridge-KTKJTMMO.js.map} +0 -0
- /package/dist/{factory-5BEGXJVB.js.map → factory-QQKY3UW4.js.map} +0 -0
- /package/dist/{factory-RLGGFLYD.js.map → factory-SC3N2RMX.js.map} +0 -0
- /package/dist/{improvement-review-52J36YLJ.js.map → improvement-review-I4WFQK25.js.map} +0 -0
- /package/dist/{init-opencode-JAJXMGOI.js.map → init-opencode-HTSSQOLE.js.map} +0 -0
- /package/dist/{issue-triage-APE6L5YP.js.map → issue-triage-SAS3D5K4.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-KZ4MNSUT.js.map → pr-reviewer-helpers-UOP4JVHI.js.map} +0 -0
- /package/dist/{registry-command-AHGSBCNL.js.map → registry-command-EPG2X2ZI.js.map} +0 -0
- /package/dist/{repo-security-plan-C4ZSWVY7.js.map → repo-security-plan-QYSW4MKN.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-C4GK3GU4.js.map → research-helpers-synthesize-YSYYUW5H.js.map} +0 -0
- /package/dist/{routing-memory-WU4C63BA.js.map → routing-memory-BZ6IGNXN.js.map} +0 -0
- /package/dist/{session-memory-LYX5N2IP.js.map → session-memory-GVOVQ3TV.js.map} +0 -0
- /package/dist/{setup-command-R6LRVQ7P.js.map → setup-command-DLIUAXMJ.js.map} +0 -0
- /package/dist/{setup-config-P722TC57.js.map → setup-config-Q2WGGIQT.js.map} +0 -0
- /package/dist/{setup-custom-api-P7T5YKIK.js.map → setup-custom-api-GXF5MFBG.js.map} +0 -0
- /package/dist/{tool-memory-AL5PXKB4.js.map → tool-memory-MHP37ASX.js.map} +0 -0
- /package/dist/{tool-memory-registry-adapters-YQLOSV4S.js.map → tool-memory-registry-adapters-QEC3YHB2.js.map} +0 -0
- /package/dist/{unified-registry-UM4GSYMB.js.map → unified-registry-WX3GDBCZ.js.map} +0 -0
- /package/dist/{weather-report-QLHSZQOT.js.map → weather-report-YY7BO744.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createLogger,
|
|
3
3
|
err,
|
|
4
4
|
ok
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
6
6
|
|
|
7
7
|
// src/scm/token-resolver.ts
|
|
8
8
|
import { execFile } from "child_process";
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
hasToken,
|
|
88
88
|
getTokenEnvVars
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-UI3WYJSZ.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getErrorMessage,
|
|
9
9
|
ok,
|
|
10
10
|
parseBoolEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
12
12
|
|
|
13
13
|
// src/cli/research-helpers-io.ts
|
|
14
14
|
import * as fs2 from "fs/promises";
|
|
@@ -146,4 +146,4 @@ export {
|
|
|
146
146
|
loadPapersRegistry,
|
|
147
147
|
savePapersRegistry
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-VWXQHGQ2.js.map
|
|
@@ -76,6 +76,10 @@ function extractCount(value) {
|
|
|
76
76
|
if (value !== null && typeof value === "object") {
|
|
77
77
|
const v = value;
|
|
78
78
|
if (v.ok === true && typeof v.value === "number") return v.value;
|
|
79
|
+
if (v.ok === false) {
|
|
80
|
+
const detail = v.error instanceof Error ? v.error.message : typeof v.error === "string" ? v.error : "unknown error";
|
|
81
|
+
throw new Error(`backend count() failed: ${detail}`);
|
|
82
|
+
}
|
|
79
83
|
}
|
|
80
84
|
return 0;
|
|
81
85
|
}
|
|
@@ -89,4 +93,4 @@ export {
|
|
|
89
93
|
StatsOnlyAdapter,
|
|
90
94
|
ensureSharedMemoryRegistry
|
|
91
95
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-XIIUIBSX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mcp/tools/tool-memory-registry-adapters.ts"],"sourcesContent":["/**\n * Phase 5 of #2766 — thin {@link IMemoryBackend} adapters for tool-memory\n * backends so each one becomes discoverable through `getMemoryRegistry()`.\n *\n * Scope is intentionally narrow: each adapter exposes the underlying\n * backend's row count via `stats()` so `memory_stats` can read all four\n * domains from the unified registry. `read`/`write`/`query`/`delete` are\n * left as escape hatches — callers wanting CRUD continue to use the\n * underlying backend directly (HybridMemoryBackend, AgenticMemoryBackend,\n * etc.). Fully folding the storage into nexus-memory's SqliteBackend is\n * a follow-up Phase 5.1.\n *\n * @module mcp/tools/tool-memory-registry-adapters\n */\n\nimport { MemoryRegistry, hasMemoryRegistry, setMemoryRegistry } from 'nexus-memory';\nimport type { BackendStats, CliName, IMemoryBackend, QueryFilter, WriteMeta } from 'nexus-memory';\n\nimport { nexusDataPath } from '../../config/nexus-data-dir.js';\n\n/** Default cap when a consumer omits `limit` in `query()`. */\nconst DEFAULT_SEARCH_LIMIT = 10;\n\n/**\n * Pull the free-text search term out of a {@link QueryFilter}. Returns\n * `null` when the filter doesn't carry one, so callers can skip the search\n * dispatch entirely. The convention is `filter.where.text` — see\n * docs/architecture/memory-context-retrieval.md (Phase 1 of #2792).\n */\nfunction extractSearchText(filter?: QueryFilter<unknown>): string | null {\n const where: unknown = filter?.where;\n if (where === null || where === undefined || typeof where !== 'object') return null;\n if (!('text' in where)) return null;\n const candidate = where.text;\n return typeof candidate === 'string' && candidate !== '' ? candidate : null;\n}\n\n/** Minimal \"count + close\" shape every tool-memory backend implements. */\nexport interface CountableBackend {\n /** Returns total row count (the heart of `memory_stats`). */\n count(): unknown;\n /** Idempotent close. */\n close?(): Promise<void> | void;\n /**\n * Optional native search surface used by {@link StatsOnlyAdapter.query}\n * (Phase 1 of #2792). When attached from `tool-memory.ts`, each backend\n * wires this to its idiomatic search call — `recallBySubject` for\n * beliefs, `searchAgentic` for A-MEM, `retrieveByPriority` for adaptive,\n * etc. Returns a flat array; the adapter is responsible for unwrapping\n * Result types and projecting to a useful shape (typically the raw\n * entry object, since consumers will project further).\n */\n search?(query: string, limit: number): Promise<readonly unknown[]>;\n}\n\n/**\n * Adapter that surfaces `count()` from an arbitrary tool-memory backend\n * as an `IMemoryBackend`. Methods other than `stats()` and `close()`\n * delegate to no-ops or rejections — call sites doing actual CRUD must\n * keep using the underlying backend directly until a deeper migration\n * folds the storage in.\n */\nexport class StatsOnlyAdapter implements IMemoryBackend<string, unknown> {\n readonly domain: string;\n private readonly backend: CountableBackend;\n\n constructor(domain: string, backend: CountableBackend) {\n this.domain = domain;\n this.backend = backend;\n }\n\n read(_key: string): Promise<unknown> {\n // Reads through the unified registry aren't wired yet. Callers wanting\n // actual data should fetch via the underlying backend.\n return Promise.resolve(undefined);\n }\n\n write(_key: string, _value: unknown, _meta?: WriteMeta): Promise<void> {\n return Promise.reject(\n new Error(\n `nexus-memory: domain \"${this.domain}\" is attached as stats-only; ` +\n `write through the underlying backend instead`\n )\n );\n }\n\n /**\n * Phase 1 of #2792: real query fan-out via the backend's native search.\n * Honors the free-text convention `filter.where.text`. Without a search\n * callback on the underlying backend (or without a text term), returns\n * `[]` — consumers that need full coverage must wire `search()` on every\n * backend they attach. Search exceptions are swallowed; the registry's\n * `memory_stats` consumer relies on `query()` never throwing.\n */\n async query(filter?: QueryFilter<unknown>): Promise<readonly unknown[]> {\n if (this.backend.search === undefined) return [];\n const text = extractSearchText(filter);\n if (text === null) return [];\n const limit = filter?.limit ?? DEFAULT_SEARCH_LIMIT;\n try {\n return await this.backend.search(text, limit);\n } catch {\n return [];\n }\n }\n\n delete(_key: string): Promise<boolean> {\n return Promise.resolve(false);\n }\n\n async stats(): Promise<BackendStats> {\n const rawCount = await Promise.resolve(this.backend.count());\n const count = extractCount(rawCount);\n return {\n domain: this.domain,\n count,\n oldestTimestamp: null,\n newestTimestamp: null,\n };\n }\n\n async close(): Promise<void> {\n if (this.backend.close !== undefined) {\n await Promise.resolve(this.backend.close());\n }\n }\n}\n\n/**\n * Normalize different backend `count()` return shapes:\n * - `number` (e.g., `MobiMem.profile.getEntryCount()`)\n * - `Result<number, MemoryError>` (HybridMemoryBackend)\n * - `Promise<number | Result<number, MemoryError>>` (after await)\n * Anything unrecognized falls back to 0 — the adapter must never throw on\n * a stats read because that would break `memory_stats` for the whole pipeline.\n */\nfunction extractCount(value: unknown): number {\n if (typeof value === 'number') return value;\n if (value !== null && typeof value === 'object') {\n const v = value as { ok?: boolean; value?: unknown };\n if (v.ok === true && typeof v.value === 'number') return v.value;\n }\n return 0;\n}\n\n/** Convenience tag the adapter passes to `WriteMeta.cli` for future writes. */\nexport type AdapterCli = CliName;\n\n// ============================================================================\n// Shared MemoryRegistry path injection (#3995)\n// ============================================================================\n\n/**\n * Ensure the process-wide shared {@link MemoryRegistry} is constructed with\n * the canonical nexus-agents data path (#3995).\n *\n * nexus-memory ships a dep-free `resolveDefaultDbPath()` fallback that\n * re-implements `~/.nexus-agents/memory/memory.db` inline so the package stays\n * free of inter-package imports (it is reused by `nexus-eval-*`). In\n * production nexus-agents we want the canonical {@link nexusDataPath} resolver\n * instead — it adds sandbox detection, the per-repo/cross-repo split, the\n * homedir-unwritable fallback, and `.gitignore` auto-wiring that the dep-free\n * fallback cannot know about. We keep nexus-memory dep-free by doing the\n * resolution HERE (on the nexus-agents side) and injecting the resolved path\n * as a plain string via `setMemoryRegistry`.\n *\n * No-op when a registry is already present (`hasMemoryRegistry()`): that means\n * either a test injected an in-memory registry, or a prior call already wired\n * the canonical path. Checking presence — rather than calling\n * `getMemoryRegistry()` — is what lets us win the race against nexus-memory's\n * lazy default-path initialization without ever triggering it. Call this\n * before the first `getMemoryRegistry()` in any production path that attaches\n * a backend.\n */\nexport function ensureSharedMemoryRegistry(): void {\n if (hasMemoryRegistry()) return;\n // `memory` is intentionally cross-repo (not in PER_REPO_SUBDIRS), so this\n // resolves to `~/.nexus-agents/memory/memory.db` on a normal machine and to\n // the sandbox / per-repo-fallback root under those modes.\n const dbPath = nexusDataPath('memory', 'memory.db');\n setMemoryRegistry(new MemoryRegistry({ dbPath }));\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAM,uBAAuB;AAQ7B,SAAS,kBAAkB,QAA8C;AACvE,QAAM,QAAiB,QAAQ;AAC/B,MAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,SAAU,QAAO;AAC/E,MAAI,EAAE,UAAU,OAAQ,QAAO;AAC/B,QAAM,YAAY,MAAM;AACxB,SAAO,OAAO,cAAc,YAAY,cAAc,KAAK,YAAY;AACzE;AA2BO,IAAM,mBAAN,MAAkE;AAAA,EAC9D;AAAA,EACQ;AAAA,EAEjB,YAAY,QAAgB,SAA2B;AACrD,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,KAAK,MAAgC;AAGnC,WAAO,QAAQ,QAAQ,MAAS;AAAA,EAClC;AAAA,EAEA,MAAM,MAAc,QAAiB,OAAkC;AACrE,WAAO,QAAQ;AAAA,MACb,IAAI;AAAA,QACF,yBAAyB,KAAK,MAAM;AAAA,MAEtC;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAM,QAA4D;AACtE,QAAI,KAAK,QAAQ,WAAW,OAAW,QAAO,CAAC;AAC/C,UAAM,OAAO,kBAAkB,MAAM;AACrC,QAAI,SAAS,KAAM,QAAO,CAAC;AAC3B,UAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAI;AACF,aAAO,MAAM,KAAK,QAAQ,OAAO,MAAM,KAAK;AAAA,IAC9C,QAAQ;AACN,aAAO,CAAC;AAAA,IACV;AAAA,EACF;AAAA,EAEA,OAAO,MAAgC;AACrC,WAAO,QAAQ,QAAQ,KAAK;AAAA,EAC9B;AAAA,EAEA,MAAM,QAA+B;AACnC,UAAM,WAAW,MAAM,QAAQ,QAAQ,KAAK,QAAQ,MAAM,CAAC;AAC3D,UAAM,QAAQ,aAAa,QAAQ;AACnC,WAAO;AAAA,MACL,QAAQ,KAAK;AAAA,MACb;AAAA,MACA,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,MAAM,QAAuB;AAC3B,QAAI,KAAK,QAAQ,UAAU,QAAW;AACpC,YAAM,QAAQ,QAAQ,KAAK,QAAQ,MAAM,CAAC;AAAA,IAC5C;AAAA,EACF;AACF;AAUA,SAAS,aAAa,OAAwB;AAC5C,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC/C,UAAM,IAAI;AACV,QAAI,EAAE,OAAO,QAAQ,OAAO,EAAE,UAAU,SAAU,QAAO,EAAE;AAAA,EAC7D;AACA,SAAO;AACT;AA+BO,SAAS,6BAAmC;AACjD,MAAI,kBAAkB,EAAG;AAIzB,QAAM,SAAS,cAAc,UAAU,WAAW;AAClD,oBAAkB,IAAI,eAAe,EAAE,OAAO,CAAC,CAAC;AAClD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/mcp/tools/tool-memory-registry-adapters.ts"],"sourcesContent":["/**\n * Phase 5 of #2766 — thin {@link IMemoryBackend} adapters for tool-memory\n * backends so each one becomes discoverable through `getMemoryRegistry()`.\n *\n * Scope is intentionally narrow: each adapter exposes the underlying\n * backend's row count via `stats()` so `memory_stats` can read all four\n * domains from the unified registry. `read`/`write`/`query`/`delete` are\n * left as escape hatches — callers wanting CRUD continue to use the\n * underlying backend directly (HybridMemoryBackend, AgenticMemoryBackend,\n * etc.). Fully folding the storage into nexus-memory's SqliteBackend is\n * a follow-up Phase 5.1.\n *\n * @module mcp/tools/tool-memory-registry-adapters\n */\n\nimport { MemoryRegistry, hasMemoryRegistry, setMemoryRegistry } from 'nexus-memory';\nimport type { BackendStats, CliName, IMemoryBackend, QueryFilter, WriteMeta } from 'nexus-memory';\n\nimport { nexusDataPath } from '../../config/nexus-data-dir.js';\n\n/** Default cap when a consumer omits `limit` in `query()`. */\nconst DEFAULT_SEARCH_LIMIT = 10;\n\n/**\n * Pull the free-text search term out of a {@link QueryFilter}. Returns\n * `null` when the filter doesn't carry one, so callers can skip the search\n * dispatch entirely. The convention is `filter.where.text` — see\n * docs/architecture/memory-context-retrieval.md (Phase 1 of #2792).\n */\nfunction extractSearchText(filter?: QueryFilter<unknown>): string | null {\n const where: unknown = filter?.where;\n if (where === null || where === undefined || typeof where !== 'object') return null;\n if (!('text' in where)) return null;\n const candidate = where.text;\n return typeof candidate === 'string' && candidate !== '' ? candidate : null;\n}\n\n/** Minimal \"count + close\" shape every tool-memory backend implements. */\nexport interface CountableBackend {\n /** Returns total row count (the heart of `memory_stats`). */\n count(): unknown;\n /** Idempotent close. */\n close?(): Promise<void> | void;\n /**\n * Optional native search surface used by {@link StatsOnlyAdapter.query}\n * (Phase 1 of #2792). When attached from `tool-memory.ts`, each backend\n * wires this to its idiomatic search call — `recallBySubject` for\n * beliefs, `searchAgentic` for A-MEM, `retrieveByPriority` for adaptive,\n * etc. Returns a flat array; the adapter is responsible for unwrapping\n * Result types and projecting to a useful shape (typically the raw\n * entry object, since consumers will project further).\n */\n search?(query: string, limit: number): Promise<readonly unknown[]>;\n}\n\n/**\n * Adapter that surfaces `count()` from an arbitrary tool-memory backend\n * as an `IMemoryBackend`. Methods other than `stats()` and `close()`\n * delegate to no-ops or rejections — call sites doing actual CRUD must\n * keep using the underlying backend directly until a deeper migration\n * folds the storage in.\n */\nexport class StatsOnlyAdapter implements IMemoryBackend<string, unknown> {\n readonly domain: string;\n private readonly backend: CountableBackend;\n\n constructor(domain: string, backend: CountableBackend) {\n this.domain = domain;\n this.backend = backend;\n }\n\n read(_key: string): Promise<unknown> {\n // Reads through the unified registry aren't wired yet. Callers wanting\n // actual data should fetch via the underlying backend.\n return Promise.resolve(undefined);\n }\n\n write(_key: string, _value: unknown, _meta?: WriteMeta): Promise<void> {\n return Promise.reject(\n new Error(\n `nexus-memory: domain \"${this.domain}\" is attached as stats-only; ` +\n `write through the underlying backend instead`\n )\n );\n }\n\n /**\n * Phase 1 of #2792: real query fan-out via the backend's native search.\n * Honors the free-text convention `filter.where.text`. Without a search\n * callback on the underlying backend (or without a text term), returns\n * `[]` — consumers that need full coverage must wire `search()` on every\n * backend they attach. Search exceptions are swallowed; the registry's\n * `memory_stats` consumer relies on `query()` never throwing.\n */\n async query(filter?: QueryFilter<unknown>): Promise<readonly unknown[]> {\n if (this.backend.search === undefined) return [];\n const text = extractSearchText(filter);\n if (text === null) return [];\n const limit = filter?.limit ?? DEFAULT_SEARCH_LIMIT;\n try {\n return await this.backend.search(text, limit);\n } catch {\n return [];\n }\n }\n\n delete(_key: string): Promise<boolean> {\n return Promise.resolve(false);\n }\n\n async stats(): Promise<BackendStats> {\n const rawCount = await Promise.resolve(this.backend.count());\n const count = extractCount(rawCount);\n return {\n domain: this.domain,\n count,\n oldestTimestamp: null,\n newestTimestamp: null,\n };\n }\n\n async close(): Promise<void> {\n if (this.backend.close !== undefined) {\n await Promise.resolve(this.backend.close());\n }\n }\n}\n\n/**\n * Normalize different backend `count()` return shapes:\n * - `number` (e.g., `MobiMem.profile.getEntryCount()`)\n * - `Result<number, MemoryError>` (HybridMemoryBackend)\n * - `Promise<number | Result<number, MemoryError>>` (after await)\n * Anything unrecognized falls back to 0 — the adapter must never throw on\n * a stats read because that would break `memory_stats` for the whole pipeline.\n */\nfunction extractCount(value: unknown): number {\n if (typeof value === 'number') return value;\n if (value !== null && typeof value === 'object') {\n const v = value as { ok?: boolean; value?: unknown; error?: unknown };\n if (v.ok === true && typeof v.value === 'number') return v.value;\n // #4827: a FAILED Result must NOT collapse to 0. Doing so made a corrupt\n // or locked backend report `{count: 0, error: null}` — byte-identical to a\n // healthy empty store — and left `collectRegistryStats`'s catch\n // (memory-stats.ts:213) unreachable, so `RegistryDomainStats.error`\n // documented a state nothing could produce. Throwing lets that catch,\n // which is already written and correct, do its job.\n if (v.ok === false) {\n const detail =\n v.error instanceof Error\n ? v.error.message\n : typeof v.error === 'string'\n ? v.error\n : 'unknown error';\n throw new Error(`backend count() failed: ${detail}`);\n }\n }\n // An unrecognised shape is genuinely unknown, not a reported failure — 0 is\n // the long-standing behaviour and callers have no error to surface.\n return 0;\n}\n\n/** Convenience tag the adapter passes to `WriteMeta.cli` for future writes. */\nexport type AdapterCli = CliName;\n\n// ============================================================================\n// Shared MemoryRegistry path injection (#3995)\n// ============================================================================\n\n/**\n * Ensure the process-wide shared {@link MemoryRegistry} is constructed with\n * the canonical nexus-agents data path (#3995).\n *\n * nexus-memory ships a dep-free `resolveDefaultDbPath()` fallback that\n * re-implements `~/.nexus-agents/memory/memory.db` inline so the package stays\n * free of inter-package imports (it is reused by `nexus-eval-*`). In\n * production nexus-agents we want the canonical {@link nexusDataPath} resolver\n * instead — it adds sandbox detection, the per-repo/cross-repo split, the\n * homedir-unwritable fallback, and `.gitignore` auto-wiring that the dep-free\n * fallback cannot know about. We keep nexus-memory dep-free by doing the\n * resolution HERE (on the nexus-agents side) and injecting the resolved path\n * as a plain string via `setMemoryRegistry`.\n *\n * No-op when a registry is already present (`hasMemoryRegistry()`): that means\n * either a test injected an in-memory registry, or a prior call already wired\n * the canonical path. Checking presence — rather than calling\n * `getMemoryRegistry()` — is what lets us win the race against nexus-memory's\n * lazy default-path initialization without ever triggering it. Call this\n * before the first `getMemoryRegistry()` in any production path that attaches\n * a backend.\n */\nexport function ensureSharedMemoryRegistry(): void {\n if (hasMemoryRegistry()) return;\n // `memory` is intentionally cross-repo (not in PER_REPO_SUBDIRS), so this\n // resolves to `~/.nexus-agents/memory/memory.db` on a normal machine and to\n // the sandbox / per-repo-fallback root under those modes.\n const dbPath = nexusDataPath('memory', 'memory.db');\n setMemoryRegistry(new MemoryRegistry({ dbPath }));\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAM,uBAAuB;AAQ7B,SAAS,kBAAkB,QAA8C;AACvE,QAAM,QAAiB,QAAQ;AAC/B,MAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,SAAU,QAAO;AAC/E,MAAI,EAAE,UAAU,OAAQ,QAAO;AAC/B,QAAM,YAAY,MAAM;AACxB,SAAO,OAAO,cAAc,YAAY,cAAc,KAAK,YAAY;AACzE;AA2BO,IAAM,mBAAN,MAAkE;AAAA,EAC9D;AAAA,EACQ;AAAA,EAEjB,YAAY,QAAgB,SAA2B;AACrD,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,KAAK,MAAgC;AAGnC,WAAO,QAAQ,QAAQ,MAAS;AAAA,EAClC;AAAA,EAEA,MAAM,MAAc,QAAiB,OAAkC;AACrE,WAAO,QAAQ;AAAA,MACb,IAAI;AAAA,QACF,yBAAyB,KAAK,MAAM;AAAA,MAEtC;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAM,QAA4D;AACtE,QAAI,KAAK,QAAQ,WAAW,OAAW,QAAO,CAAC;AAC/C,UAAM,OAAO,kBAAkB,MAAM;AACrC,QAAI,SAAS,KAAM,QAAO,CAAC;AAC3B,UAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAI;AACF,aAAO,MAAM,KAAK,QAAQ,OAAO,MAAM,KAAK;AAAA,IAC9C,QAAQ;AACN,aAAO,CAAC;AAAA,IACV;AAAA,EACF;AAAA,EAEA,OAAO,MAAgC;AACrC,WAAO,QAAQ,QAAQ,KAAK;AAAA,EAC9B;AAAA,EAEA,MAAM,QAA+B;AACnC,UAAM,WAAW,MAAM,QAAQ,QAAQ,KAAK,QAAQ,MAAM,CAAC;AAC3D,UAAM,QAAQ,aAAa,QAAQ;AACnC,WAAO;AAAA,MACL,QAAQ,KAAK;AAAA,MACb;AAAA,MACA,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,MAAM,QAAuB;AAC3B,QAAI,KAAK,QAAQ,UAAU,QAAW;AACpC,YAAM,QAAQ,QAAQ,KAAK,QAAQ,MAAM,CAAC;AAAA,IAC5C;AAAA,EACF;AACF;AAUA,SAAS,aAAa,OAAwB;AAC5C,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC/C,UAAM,IAAI;AACV,QAAI,EAAE,OAAO,QAAQ,OAAO,EAAE,UAAU,SAAU,QAAO,EAAE;AAO3D,QAAI,EAAE,OAAO,OAAO;AAClB,YAAM,SACJ,EAAE,iBAAiB,QACf,EAAE,MAAM,UACR,OAAO,EAAE,UAAU,WACjB,EAAE,QACF;AACR,YAAM,IAAI,MAAM,2BAA2B,MAAM,EAAE;AAAA,IACrD;AAAA,EACF;AAGA,SAAO;AACT;AA+BO,SAAS,6BAAmC;AACjD,MAAI,kBAAkB,EAAG;AAIzB,QAAM,SAAS,cAAc,UAAU,WAAW;AAClD,oBAAkB,IAAI,eAAe,EAAE,OAAO,CAAC,CAAC;AAClD;","names":[]}
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
loadPapersRegistry,
|
|
5
5
|
loadTechniquesRegistry,
|
|
6
6
|
savePapersRegistry
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VWXQHGQ2.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveInsideRoot
|
|
10
10
|
} from "./chunk-NUBSJGQZ.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveToken
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UI3WYJSZ.js";
|
|
14
14
|
import {
|
|
15
15
|
getToolMemory
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UH4MK2N7.js";
|
|
17
17
|
import {
|
|
18
18
|
capitalizeWords,
|
|
19
19
|
truncateSentence
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
getTimeProvider,
|
|
39
39
|
ok,
|
|
40
40
|
registerPersistentDistillerFactory
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
42
42
|
import {
|
|
43
43
|
ensureLearningDir,
|
|
44
44
|
getRulesFile
|
|
@@ -4090,4 +4090,4 @@ export {
|
|
|
4090
4090
|
DEFAULT_CONTEXT_BUDGET_TOKENS,
|
|
4091
4091
|
getContextPromptPrefix
|
|
4092
4092
|
};
|
|
4093
|
-
//# sourceMappingURL=chunk-
|
|
4093
|
+
//# sourceMappingURL=chunk-XJORRLQT.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDefaultRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
4
4
|
import {
|
|
5
5
|
getNexusDataDir
|
|
6
6
|
} from "./chunk-OQLFRJCW.js";
|
|
@@ -128,4 +128,4 @@ export {
|
|
|
128
128
|
loadUsageEvents,
|
|
129
129
|
rollupByModel
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-Y3UJ3VLA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getErrorMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
4
4
|
|
|
5
5
|
// src/cli/setup-config.ts
|
|
6
6
|
import { copyFileSync, existsSync, mkdirSync, writeFileSync } from "fs";
|
|
@@ -77,4 +77,4 @@ function ensureBackup(outputPath) {
|
|
|
77
77
|
export {
|
|
78
78
|
runConfigInitSync
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-YIV4GQHK.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readOpenAICompatEnv
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SSPEB62Y.js";
|
|
4
4
|
import {
|
|
5
5
|
allOf
|
|
6
6
|
} from "./chunk-OQB3XC5O.js";
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
createAllAdapters,
|
|
15
15
|
probeCli
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RUN6KRCP.js";
|
|
17
17
|
import {
|
|
18
18
|
DEFAULTS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-65DZ7WHY.js";
|
|
20
20
|
import {
|
|
21
21
|
getNexusTmpDir
|
|
22
22
|
} from "./chunk-SNJNRDKZ.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
ok,
|
|
37
37
|
symbols,
|
|
38
38
|
writeLine
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
40
40
|
import {
|
|
41
41
|
getLearningDir,
|
|
42
42
|
getOutcomesFile,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
} from "./chunk-OQLFRJCW.js";
|
|
53
53
|
|
|
54
54
|
// src/version.ts
|
|
55
|
-
var VERSION = true ? "4.3.
|
|
55
|
+
var VERSION = true ? "4.3.5" : "dev";
|
|
56
56
|
|
|
57
57
|
// src/config/schemas-core.ts
|
|
58
58
|
import { z } from "zod";
|
|
@@ -2339,7 +2339,7 @@ async function runDoctorFix(result) {
|
|
|
2339
2339
|
writeLine2("\u2500".repeat(40));
|
|
2340
2340
|
let fixCount = 0;
|
|
2341
2341
|
if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
|
|
2342
|
-
const { runSetup } = await import("./setup-command-
|
|
2342
|
+
const { runSetup } = await import("./setup-command-DLIUAXMJ.js");
|
|
2343
2343
|
const setupResult = runSetup({
|
|
2344
2344
|
skipMcp: true,
|
|
2345
2345
|
skipRules: true,
|
|
@@ -2353,7 +2353,7 @@ async function runDoctorFix(result) {
|
|
|
2353
2353
|
}
|
|
2354
2354
|
}
|
|
2355
2355
|
if (!result.configFile.found) {
|
|
2356
|
-
const { runConfigInitSync } = await import("./setup-config-
|
|
2356
|
+
const { runConfigInitSync } = await import("./setup-config-Q2WGGIQT.js");
|
|
2357
2357
|
const configResult = runConfigInitSync(process.cwd(), false, false);
|
|
2358
2358
|
if (configResult.success && configResult.created) {
|
|
2359
2359
|
writeLine2(`\u2713 Generated config: ${configResult.path}`);
|
|
@@ -2452,4 +2452,4 @@ export {
|
|
|
2452
2452
|
startStdioServer,
|
|
2453
2453
|
closeServer
|
|
2454
2454
|
};
|
|
2455
|
-
//# sourceMappingURL=chunk-
|
|
2455
|
+
//# sourceMappingURL=chunk-ZLGQY55I.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadPapersRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VWXQHGQ2.js";
|
|
4
4
|
import {
|
|
5
5
|
getErrorMessage
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/research-helpers-synthesize.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -876,4 +876,4 @@ export {
|
|
|
876
876
|
AttributedInsightSchema,
|
|
877
877
|
synthesizeResearch
|
|
878
878
|
};
|
|
879
|
-
//# sourceMappingURL=chunk-
|
|
879
|
+
//# sourceMappingURL=chunk-ZQWCL7YB.js.map
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
createCliCircuitBreakerIntegration,
|
|
4
4
|
getCliCircuitBreakerSnapshot,
|
|
5
5
|
getDefaultCliCircuitBreakerRegistry
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-4OSPP2KN.js";
|
|
7
|
+
import "./chunk-U4LM5Q2L.js";
|
|
8
8
|
import "./chunk-2HUC6NZN.js";
|
|
9
9
|
import "./chunk-OQLFRJCW.js";
|
|
10
10
|
import "./chunk-ZPWHCABL.js";
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
getCliCircuitBreakerSnapshot,
|
|
15
15
|
getDefaultCliCircuitBreakerRegistry
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=cli-circuit-breaker-
|
|
17
|
+
//# sourceMappingURL=cli-circuit-breaker-3CH36TPE.js.map
|
package/dist/cli.js
CHANGED
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
generateSummary,
|
|
14
14
|
parseFindings,
|
|
15
15
|
sumFindings
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-NKTANKWH.js";
|
|
17
|
+
import "./chunk-TKFWYFBD.js";
|
|
18
18
|
import {
|
|
19
19
|
setupCommandAsync,
|
|
20
20
|
verifyCommand
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-HI63BMZ6.js";
|
|
22
|
+
import "./chunk-YIV4GQHK.js";
|
|
23
23
|
import {
|
|
24
24
|
AuthHandler,
|
|
25
25
|
DEFAULT_EXPERTS,
|
|
@@ -139,8 +139,8 @@ import {
|
|
|
139
139
|
validateCommand,
|
|
140
140
|
validateWorkflow,
|
|
141
141
|
wrapInMarkdownFence
|
|
142
|
-
} from "./chunk-
|
|
143
|
-
import "./chunk-
|
|
142
|
+
} from "./chunk-ES3CPAON.js";
|
|
143
|
+
import "./chunk-SHG3MYMD.js";
|
|
144
144
|
import "./chunk-HFOQKCD2.js";
|
|
145
145
|
import "./chunk-RSMG2DPB.js";
|
|
146
146
|
import {
|
|
@@ -166,14 +166,14 @@ import {
|
|
|
166
166
|
loadConfig,
|
|
167
167
|
runDoctor,
|
|
168
168
|
validateNexusEnv
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-ZLGQY55I.js";
|
|
170
170
|
import {
|
|
171
171
|
buildOpenAICompatAdapters,
|
|
172
172
|
readOpenAICompatEnv
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-SSPEB62Y.js";
|
|
174
174
|
import {
|
|
175
175
|
shutdownExpertBridge
|
|
176
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-QTP4AIVR.js";
|
|
177
177
|
import {
|
|
178
178
|
ConsensusVoteInputSchema,
|
|
179
179
|
DEFAULT_VOTE_TIMEOUT_MS,
|
|
@@ -183,29 +183,29 @@ import {
|
|
|
183
183
|
executeVoting,
|
|
184
184
|
mapOutcomeToDecision,
|
|
185
185
|
registerConsensusVoteTool
|
|
186
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-CFEZ2DG6.js";
|
|
187
187
|
import {
|
|
188
188
|
loadUsageEvents,
|
|
189
189
|
rollupByModel
|
|
190
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-Y3UJ3VLA.js";
|
|
191
191
|
import {
|
|
192
192
|
allOf,
|
|
193
193
|
anyOf
|
|
194
194
|
} from "./chunk-OQB3XC5O.js";
|
|
195
195
|
import {
|
|
196
196
|
synthesizeResearch
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-ZQWCL7YB.js";
|
|
198
198
|
import {
|
|
199
199
|
classifyTrust,
|
|
200
200
|
createFullGitHubProvider,
|
|
201
201
|
evaluatePolicy,
|
|
202
202
|
parsePRUrl
|
|
203
|
-
} from "./chunk-
|
|
204
|
-
import "./chunk-
|
|
203
|
+
} from "./chunk-AVB5GOSW.js";
|
|
204
|
+
import "./chunk-LPUJG7C6.js";
|
|
205
205
|
import {
|
|
206
206
|
ReputationCache,
|
|
207
207
|
sanitizeInput
|
|
208
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-EJLOD53Z.js";
|
|
209
209
|
import {
|
|
210
210
|
ImprovementReviewInputSchema,
|
|
211
211
|
calculateFitnessScore,
|
|
@@ -219,15 +219,15 @@ import {
|
|
|
219
219
|
registerImprovementReviewTool,
|
|
220
220
|
runImprovementReview,
|
|
221
221
|
scanForSecrets
|
|
222
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-IXMTCWMN.js";
|
|
223
223
|
import {
|
|
224
224
|
createDefaultPolicyFirewall
|
|
225
|
-
} from "./chunk-
|
|
226
|
-
import "./chunk-
|
|
225
|
+
} from "./chunk-K2ZYZZNZ.js";
|
|
226
|
+
import "./chunk-DFCJUKGD.js";
|
|
227
227
|
import {
|
|
228
228
|
createUnifiedRegistry,
|
|
229
229
|
getGlobalRegistry
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-E6ET2WJI.js";
|
|
231
231
|
import {
|
|
232
232
|
CodebaseIndexSchema,
|
|
233
233
|
PaperStatusSchema,
|
|
@@ -253,27 +253,27 @@ import {
|
|
|
253
253
|
loadSourcesRegistry,
|
|
254
254
|
rankDiscoveredItems,
|
|
255
255
|
saveSourcesRegistry
|
|
256
|
-
} from "./chunk-
|
|
256
|
+
} from "./chunk-XJORRLQT.js";
|
|
257
257
|
import {
|
|
258
258
|
loadPapersRegistry,
|
|
259
259
|
loadTechniquesRegistry,
|
|
260
260
|
savePapersRegistry
|
|
261
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-VWXQHGQ2.js";
|
|
262
262
|
import "./chunk-NUBSJGQZ.js";
|
|
263
263
|
import {
|
|
264
264
|
resolveToken
|
|
265
|
-
} from "./chunk-
|
|
265
|
+
} from "./chunk-UI3WYJSZ.js";
|
|
266
266
|
import {
|
|
267
267
|
MemoryError,
|
|
268
268
|
shutdownToolMemory
|
|
269
|
-
} from "./chunk-
|
|
269
|
+
} from "./chunk-UH4MK2N7.js";
|
|
270
270
|
import {
|
|
271
271
|
capitalize,
|
|
272
272
|
capitalizeKebab
|
|
273
273
|
} from "./chunk-6T3EPABN.js";
|
|
274
|
-
import "./chunk-
|
|
274
|
+
import "./chunk-PG563EVI.js";
|
|
275
275
|
import "./chunk-YPNQPT2F.js";
|
|
276
|
-
import "./chunk-
|
|
276
|
+
import "./chunk-XIIUIBSX.js";
|
|
277
277
|
import "./chunk-KSQSWEFH.js";
|
|
278
278
|
import {
|
|
279
279
|
NEXUS_SUBPROCESS_DEPTH_ENV,
|
|
@@ -282,19 +282,19 @@ import {
|
|
|
282
282
|
isRecord,
|
|
283
283
|
probeAllClis,
|
|
284
284
|
readSubprocessDepth
|
|
285
|
-
} from "./chunk-
|
|
286
|
-
import "./chunk-
|
|
285
|
+
} from "./chunk-RUN6KRCP.js";
|
|
286
|
+
import "./chunk-QGXA25PQ.js";
|
|
287
287
|
import {
|
|
288
288
|
DEFAULTS
|
|
289
|
-
} from "./chunk-
|
|
290
|
-
import "./chunk-
|
|
289
|
+
} from "./chunk-65DZ7WHY.js";
|
|
290
|
+
import "./chunk-OPH5S776.js";
|
|
291
291
|
import {
|
|
292
292
|
nexusMkdtempSync
|
|
293
293
|
} from "./chunk-SNJNRDKZ.js";
|
|
294
|
-
import "./chunk-
|
|
294
|
+
import "./chunk-SPZOZGBS.js";
|
|
295
295
|
import "./chunk-QZUG667L.js";
|
|
296
|
-
import "./chunk-
|
|
297
|
-
import "./chunk-
|
|
296
|
+
import "./chunk-PZSPL5KN.js";
|
|
297
|
+
import "./chunk-4OSPP2KN.js";
|
|
298
298
|
import {
|
|
299
299
|
API_TIMEOUTS,
|
|
300
300
|
AgentCapability,
|
|
@@ -368,7 +368,7 @@ import {
|
|
|
368
368
|
validateTimeout,
|
|
369
369
|
writeEmptyLine,
|
|
370
370
|
writeLine
|
|
371
|
-
} from "./chunk-
|
|
371
|
+
} from "./chunk-U4LM5Q2L.js";
|
|
372
372
|
import "./chunk-2HUC6NZN.js";
|
|
373
373
|
import {
|
|
374
374
|
applyPortableMode,
|
|
@@ -4126,7 +4126,7 @@ ${file.patch}
|
|
|
4126
4126
|
violations: policyResult.violations
|
|
4127
4127
|
});
|
|
4128
4128
|
}
|
|
4129
|
-
const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-
|
|
4129
|
+
const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-UOP4JVHI.js");
|
|
4130
4130
|
const body = formatReviewComment2(result);
|
|
4131
4131
|
const postResult = await provider.createReview(pr.prNumber, body, result.decision);
|
|
4132
4132
|
if (!postResult.ok) {
|
|
@@ -13204,9 +13204,10 @@ async function recordToolTask(storage, input) {
|
|
|
13204
13204
|
const taskDescription = `${input.tool_name}: ${summarizeToolInput(input.tool_input)}`;
|
|
13205
13205
|
const taskResult = await storage.addTask(activeSession.id, taskDescription);
|
|
13206
13206
|
if (!taskResult.ok) return;
|
|
13207
|
+
const outcome = classifyToolResponse(input.tool_response);
|
|
13207
13208
|
await storage.updateTask(taskResult.value.id, {
|
|
13208
|
-
result:
|
|
13209
|
-
status:
|
|
13209
|
+
result: outcome.summary,
|
|
13210
|
+
status: outcome.status,
|
|
13210
13211
|
durationMs: metrics.durationMs,
|
|
13211
13212
|
tokensUsed: metrics.tokensUsed
|
|
13212
13213
|
});
|
|
@@ -13236,17 +13237,23 @@ function summarizeToolInput(toolInput) {
|
|
|
13236
13237
|
const keys = Object.keys(toolInput);
|
|
13237
13238
|
return keys.length > 0 ? keys.join(", ") : "(no input)";
|
|
13238
13239
|
}
|
|
13239
|
-
function
|
|
13240
|
+
function classifyToolResponse(toolResponse) {
|
|
13240
13241
|
const error = toolResponse.error ?? toolResponse.stderr;
|
|
13241
13242
|
if (error !== void 0 && error !== "") {
|
|
13242
|
-
return
|
|
13243
|
+
return {
|
|
13244
|
+
status: TaskStatus.FAILED,
|
|
13245
|
+
summary: `Error: ${safeString(error).substring(0, 100)}`
|
|
13246
|
+
};
|
|
13243
13247
|
}
|
|
13244
13248
|
const stdout = toolResponse.stdout ?? toolResponse.output ?? toolResponse.content;
|
|
13245
13249
|
if (stdout !== void 0) {
|
|
13246
13250
|
const out = safeString(stdout);
|
|
13247
|
-
return
|
|
13251
|
+
return {
|
|
13252
|
+
status: TaskStatus.COMPLETED,
|
|
13253
|
+
summary: out.length > 100 ? `${out.substring(0, 100)}...` : out
|
|
13254
|
+
};
|
|
13248
13255
|
}
|
|
13249
|
-
return "completed";
|
|
13256
|
+
return { status: TaskStatus.COMPLETED, summary: "completed" };
|
|
13250
13257
|
}
|
|
13251
13258
|
function extractFilePath(toolInput) {
|
|
13252
13259
|
const filePath = toolInput.file_path ?? toolInput.path ?? toolInput.notebook_path;
|
|
@@ -17532,7 +17539,7 @@ function startImprovementReviewScheduler(options) {
|
|
|
17532
17539
|
let running = false;
|
|
17533
17540
|
const runOnce = async () => {
|
|
17534
17541
|
try {
|
|
17535
|
-
const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-
|
|
17542
|
+
const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-I4WFQK25.js");
|
|
17536
17543
|
const input = ImprovementReviewInputSchema2.parse({ fileIssues });
|
|
17537
17544
|
const result = await runImprovementReview2(input, { logger: logger19 });
|
|
17538
17545
|
logger19.info("Scheduled improvement_review complete", {
|
|
@@ -19589,7 +19596,7 @@ function adaptConfigToLibrary(config) {
|
|
|
19589
19596
|
}
|
|
19590
19597
|
function createBeliefPromoter() {
|
|
19591
19598
|
return async (event) => {
|
|
19592
|
-
const { getToolMemory } = await import("./tool-memory-
|
|
19599
|
+
const { getToolMemory } = await import("./tool-memory-MHP37ASX.js");
|
|
19593
19600
|
const tm = getToolMemory();
|
|
19594
19601
|
await tm.recordBelief(
|
|
19595
19602
|
`skill:${event.name}`,
|
|
@@ -20776,7 +20783,7 @@ async function handleResearchCommand(args) {
|
|
|
20776
20783
|
}
|
|
20777
20784
|
}
|
|
20778
20785
|
async function handleRegistryCommand(args) {
|
|
20779
|
-
const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-
|
|
20786
|
+
const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-EPG2X2ZI.js");
|
|
20780
20787
|
const subcommand = args.subcommand;
|
|
20781
20788
|
if (!isValidRegistrySubcommand(subcommand)) {
|
|
20782
20789
|
process.stdout.write(`${formatRegistryUsage()}
|
|
@@ -20824,12 +20831,12 @@ async function handleVerifyCommand(args) {
|
|
|
20824
20831
|
async function handleDoctorCommand(args) {
|
|
20825
20832
|
const exitCode = await doctorCommand({ fix: args.options.fix });
|
|
20826
20833
|
if (args.options.deep) {
|
|
20827
|
-
const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-
|
|
20834
|
+
const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-UHFL3AE4.js");
|
|
20828
20835
|
const diag = runDeepDiagnostics2();
|
|
20829
20836
|
process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
|
|
20830
20837
|
}
|
|
20831
20838
|
if (args.options.live) {
|
|
20832
|
-
const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-
|
|
20839
|
+
const { runLiveReadiness, formatLiveReadiness } = await import("./doctor-live-2CGAFGFG.js");
|
|
20833
20840
|
const report = await runLiveReadiness();
|
|
20834
20841
|
process.stdout.write(formatLiveReadiness(report) + "\n");
|
|
20835
20842
|
if (report.some((r) => r.levels.serves.status === "failed")) {
|
|
@@ -20882,7 +20889,7 @@ async function runInitPortableFlow(args) {
|
|
|
20882
20889
|
return cliExit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
|
|
20883
20890
|
}
|
|
20884
20891
|
async function runInitOpencodeFlow(args) {
|
|
20885
|
-
const { runInitOpencode } = await import("./init-opencode-
|
|
20892
|
+
const { runInitOpencode } = await import("./init-opencode-HTSSQOLE.js");
|
|
20886
20893
|
const opencodePath = args.options.opencode;
|
|
20887
20894
|
if (opencodePath === void 0 || opencodePath === "") {
|
|
20888
20895
|
process.stderr.write("Error: --opencode requires a path argument.\n");
|
|
@@ -20908,7 +20915,7 @@ async function runInitOpencodeFlow(args) {
|
|
|
20908
20915
|
return cliExit(EXIT_CODES.SUCCESS);
|
|
20909
20916
|
}
|
|
20910
20917
|
async function renderOpencodeValidate(opencodePath) {
|
|
20911
|
-
const { runOpencodeValidate } = await import("./init-opencode-
|
|
20918
|
+
const { runOpencodeValidate } = await import("./init-opencode-HTSSQOLE.js");
|
|
20912
20919
|
const result = await runOpencodeValidate(opencodePath);
|
|
20913
20920
|
if (!result.ok) {
|
|
20914
20921
|
process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
|
|
@@ -20947,7 +20954,7 @@ async function handleSetupCommandAsync(args) {
|
|
|
20947
20954
|
return cliExitFromStatus(exitCode);
|
|
20948
20955
|
}
|
|
20949
20956
|
async function runCustomApiSetup(args) {
|
|
20950
|
-
const { configureCustomApi } = await import("./setup-custom-api-
|
|
20957
|
+
const { configureCustomApi } = await import("./setup-custom-api-GXF5MFBG.js");
|
|
20951
20958
|
const baseUrl = args.options.customApi;
|
|
20952
20959
|
if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
|
|
20953
20960
|
const input = {
|