@tangle-network/agent-knowledge 8.0.9 → 10.6.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/AGENTS.md +14 -2
- package/CHANGELOG.md +99 -0
- package/README.md +127 -5
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +1 -1
- package/dist/{benchmarks-B_07vX0Q.js → benchmarks-B6fCb6AD.js} +2 -2
- package/dist/{benchmarks-B_07vX0Q.js.map → benchmarks-B6fCb6AD.js.map} +1 -1
- package/dist/cli.js +53 -21
- package/dist/cli.js.map +1 -1
- package/dist/{index-DypNCZtP.d.ts → index-DZeFm-BP.d.ts} +2 -2
- package/dist/{index-DypNCZtP.d.ts.map → index-DZeFm-BP.d.ts.map} +1 -1
- package/dist/{index-Ij4giqqj.d.ts → index-eDsIXWyM.d.ts} +3 -3
- package/dist/{index-Ij4giqqj.d.ts.map → index-eDsIXWyM.d.ts.map} +1 -1
- package/dist/index.d.ts +910 -290
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1009 -382
- package/dist/index.js.map +1 -1
- package/dist/{inspect-0tmv3xV8.js → inspect-DALsvG10.js} +680 -108
- package/dist/inspect-DALsvG10.js.map +1 -0
- package/dist/memory/index.d.ts +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{memory-BPgPIEhj.js → memory-BRGsy2QN.js} +2 -2
- package/dist/{memory-BPgPIEhj.js.map → memory-BRGsy2QN.js.map} +1 -1
- package/dist/search-Cw6eYfSd.js +258 -0
- package/dist/search-Cw6eYfSd.js.map +1 -0
- package/dist/{types-CTT16XnO.d.ts → types-m2QB86fF.d.ts} +17 -3
- package/dist/types-m2QB86fF.d.ts.map +1 -0
- package/dist/viz/index.d.ts +1 -1
- package/docs/architecture.md +1 -0
- package/docs/knowledge-use-receipts.md +50 -12
- package/package.json +3 -3
- package/dist/inspect-0tmv3xV8.js.map +0 -1
- package/dist/search-CtVJ0PKX.js +0 -132
- package/dist/search-CtVJ0PKX.js.map +0 -1
- package/dist/types-CTT16XnO.d.ts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { E as addSourcePath, O as loadSourceRegistry, T as writeKnowledgeIndex, _ as lintKnowledgeIndex, a as applyKnowledgeWriteBlocksFile, g as validateKnowledgeIndex, n as inspectKnowledgeIndex, rt as initKnowledgeBase, st as layoutFor, t as explainKnowledgeTarget } from "./inspect-DALsvG10.js";
|
|
3
|
+
import { r as searchKnowledge } from "./search-Cw6eYfSd.js";
|
|
4
4
|
import { detectKnowledgeGaps, findSurprisingConnections, toKnowledgeVizGraph } from "./viz/index.js";
|
|
5
5
|
import { join, resolve } from "node:path";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -28,23 +28,33 @@ function parseArgs(argv) {
|
|
|
28
28
|
}
|
|
29
29
|
const HELP = `agent-knowledge — source-grounded knowledge graph CLI.
|
|
30
30
|
|
|
31
|
+
Options shared by the commands below:
|
|
32
|
+
--root <dir> Knowledge-base root. Defaults to the current directory.
|
|
33
|
+
--pages-dir <dir> Root-relative directory that holds Markdown pages. Defaults to knowledge.
|
|
34
|
+
Bounds apply-write-blocks and selects what index builds.
|
|
35
|
+
|
|
31
36
|
Commands:
|
|
32
37
|
init [--root .]
|
|
33
38
|
Create raw/sources, knowledge, and cache directories.
|
|
34
|
-
index [--root .] [--json]
|
|
35
|
-
Build .agent-knowledge/index.json from
|
|
39
|
+
index [--root .] [--pages-dir knowledge] [--json]
|
|
40
|
+
Build .agent-knowledge/index.json from <pages-dir>/**/*.md.
|
|
36
41
|
source-add <path> [--root .] [--json]
|
|
37
42
|
Copy a file or directory into raw/sources and register immutable source records.
|
|
38
43
|
sources [--root .] [--json]
|
|
39
44
|
List registered sources.
|
|
40
|
-
apply-write-blocks <proposal-file> [--root .] [--
|
|
41
|
-
|
|
45
|
+
apply-write-blocks <proposal-file> [--root .] [--pages-dir knowledge] [--intake]
|
|
46
|
+
[--intake-threshold 0.82] [--json]
|
|
47
|
+
Apply safe ---FILE: <pages-dir>/...--- blocks emitted by an agent.
|
|
48
|
+
--intake refuses the whole proposal when a block duplicates a page already
|
|
49
|
+
in the store without citing it, naming it in contradicts, or reusing its
|
|
50
|
+
id, or when a block cites a page id that exists nowhere.
|
|
51
|
+
--intake-threshold sets the duplicate Jaccard similarity.
|
|
42
52
|
inspect [--root .] [--json]
|
|
43
53
|
Summarize page/source/edge counts, top pages, and lint state.
|
|
44
54
|
explain <page|id|query> [--root .] [--json]
|
|
45
55
|
Explain sources, links, inbound links, and related pages.
|
|
46
|
-
search <query> [--root .] [--limit 10] [--json]
|
|
47
|
-
|
|
56
|
+
search <query> [--root .] [--pages-dir knowledge] [--limit 10] [--json]
|
|
57
|
+
Local BM25 and link-graph search (RRF fused) over the generated knowledge index.
|
|
48
58
|
graph [--root .] [--format summary|json]
|
|
49
59
|
Emit graph summary or JSON.
|
|
50
60
|
lint [--root .] [--json]
|
|
@@ -61,6 +71,7 @@ Commands:
|
|
|
61
71
|
async function main() {
|
|
62
72
|
const args = parseArgs(process.argv.slice(2));
|
|
63
73
|
const root = resolve(args.flags.root ?? ".");
|
|
74
|
+
const pages = pagesOptions(args);
|
|
64
75
|
switch (args.command) {
|
|
65
76
|
case "init": {
|
|
66
77
|
const layout = await initKnowledgeBase(root);
|
|
@@ -68,7 +79,7 @@ async function main() {
|
|
|
68
79
|
return 0;
|
|
69
80
|
}
|
|
70
81
|
case "index": {
|
|
71
|
-
const index = await writeKnowledgeIndex(root);
|
|
82
|
+
const index = await writeKnowledgeIndex(root, pages);
|
|
72
83
|
if (args.flags.json === "true") process.stdout.write(`${JSON.stringify(index, null, 2)}\n`);
|
|
73
84
|
else process.stdout.write(`indexed ${index.pages.length} pages, ${index.graph.edges.length} edges\n`);
|
|
74
85
|
return 0;
|
|
@@ -98,8 +109,11 @@ async function main() {
|
|
|
98
109
|
return 1;
|
|
99
110
|
}
|
|
100
111
|
await initKnowledgeBase(root);
|
|
101
|
-
const result = await applyKnowledgeWriteBlocksFile(root, resolve(proposalPath)
|
|
102
|
-
|
|
112
|
+
const result = await applyKnowledgeWriteBlocksFile(root, resolve(proposalPath), {
|
|
113
|
+
...pages,
|
|
114
|
+
...intakeOption(args)
|
|
115
|
+
});
|
|
116
|
+
await writeKnowledgeIndex(root, pages);
|
|
103
117
|
if (args.flags.json === "true") process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
104
118
|
else {
|
|
105
119
|
for (const path of result.written) process.stdout.write(`wrote ${path}\n`);
|
|
@@ -108,7 +122,7 @@ async function main() {
|
|
|
108
122
|
return result.warnings.length > 0 ? 2 : 0;
|
|
109
123
|
}
|
|
110
124
|
case "inspect": {
|
|
111
|
-
const inspection = inspectKnowledgeIndex(await loadOrBuildIndex(root));
|
|
125
|
+
const inspection = inspectKnowledgeIndex(await loadOrBuildIndex(root, pages));
|
|
112
126
|
if (args.flags.json === "true") process.stdout.write(`${JSON.stringify(inspection, null, 2)}\n`);
|
|
113
127
|
else {
|
|
114
128
|
process.stdout.write(`pages=${inspection.pageCount} sources=${inspection.sourceCount} edges=${inspection.edgeCount} findings=${inspection.findingCount} blocking=${inspection.blockingFindingCount}\n`);
|
|
@@ -122,7 +136,7 @@ async function main() {
|
|
|
122
136
|
process.stderr.write("explain requires a page path, id, title, or query\n");
|
|
123
137
|
return 1;
|
|
124
138
|
}
|
|
125
|
-
const explanation = explainKnowledgeTarget(await loadOrBuildIndex(root), target);
|
|
139
|
+
const explanation = explainKnowledgeTarget(await loadOrBuildIndex(root, pages), target);
|
|
126
140
|
if (args.flags.json === "true") process.stdout.write(`${JSON.stringify(explanation, null, 2)}\n`);
|
|
127
141
|
else {
|
|
128
142
|
process.stdout.write(`${explanation.page ? explanation.page.title : target}\n`);
|
|
@@ -139,7 +153,7 @@ async function main() {
|
|
|
139
153
|
process.stderr.write("search requires a query\n");
|
|
140
154
|
return 1;
|
|
141
155
|
}
|
|
142
|
-
const results = searchKnowledge(await loadOrBuildIndex(root), query, Number(args.flags.limit ?? 10));
|
|
156
|
+
const results = searchKnowledge(await loadOrBuildIndex(root, pages), query, Number(args.flags.limit ?? 10));
|
|
143
157
|
if (args.flags.json === "true") process.stdout.write(`${JSON.stringify(results, null, 2)}\n`);
|
|
144
158
|
else for (const result of results) {
|
|
145
159
|
process.stdout.write(`${result.rank}. ${result.page.title} (${result.page.path}) score=${result.score.toFixed(5)}\n`);
|
|
@@ -148,13 +162,13 @@ async function main() {
|
|
|
148
162
|
return 0;
|
|
149
163
|
}
|
|
150
164
|
case "graph": {
|
|
151
|
-
const index = await loadOrBuildIndex(root);
|
|
165
|
+
const index = await loadOrBuildIndex(root, pages);
|
|
152
166
|
if ((args.flags.format ?? "summary") === "json") process.stdout.write(`${JSON.stringify(index.graph, null, 2)}\n`);
|
|
153
167
|
else process.stdout.write(`nodes=${index.graph.nodes.length} edges=${index.graph.edges.length}\n`);
|
|
154
168
|
return 0;
|
|
155
169
|
}
|
|
156
170
|
case "lint": {
|
|
157
|
-
const findings = lintKnowledgeIndex(await loadOrBuildIndex(root));
|
|
171
|
+
const findings = lintKnowledgeIndex(await loadOrBuildIndex(root, pages));
|
|
158
172
|
if (args.flags.json === "true") process.stdout.write(`${JSON.stringify(findings, null, 2)}\n`);
|
|
159
173
|
else {
|
|
160
174
|
if (findings.length === 0) process.stdout.write("no findings\n");
|
|
@@ -163,7 +177,7 @@ async function main() {
|
|
|
163
177
|
return findings.some((finding) => finding.severity === "error") ? 2 : 0;
|
|
164
178
|
}
|
|
165
179
|
case "validate": {
|
|
166
|
-
const result = validateKnowledgeIndex(await loadOrBuildIndex(root), { strict: args.flags.strict === "true" });
|
|
180
|
+
const result = validateKnowledgeIndex(await loadOrBuildIndex(root, pages), { strict: args.flags.strict === "true" });
|
|
167
181
|
if (args.flags.json === "true") process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
168
182
|
else {
|
|
169
183
|
process.stdout.write(result.ok ? "valid\n" : "invalid\n");
|
|
@@ -172,7 +186,7 @@ async function main() {
|
|
|
172
186
|
return result.ok ? 0 : 2;
|
|
173
187
|
}
|
|
174
188
|
case "export": {
|
|
175
|
-
const index = await loadOrBuildIndex(root);
|
|
189
|
+
const index = await loadOrBuildIndex(root, pages);
|
|
176
190
|
if ((args.flags.format ?? "json") !== "json") {
|
|
177
191
|
process.stderr.write("export currently supports --format json\n");
|
|
178
192
|
return 1;
|
|
@@ -181,7 +195,7 @@ async function main() {
|
|
|
181
195
|
return 0;
|
|
182
196
|
}
|
|
183
197
|
case "viz": {
|
|
184
|
-
const viz = toKnowledgeVizGraph((await loadOrBuildIndex(root)).graph);
|
|
198
|
+
const viz = toKnowledgeVizGraph((await loadOrBuildIndex(root, pages)).graph);
|
|
185
199
|
const payload = {
|
|
186
200
|
graph: viz,
|
|
187
201
|
gaps: detectKnowledgeGaps(viz),
|
|
@@ -206,10 +220,28 @@ async function main() {
|
|
|
206
220
|
return 1;
|
|
207
221
|
}
|
|
208
222
|
}
|
|
209
|
-
|
|
223
|
+
function pagesOptions(args) {
|
|
224
|
+
const pagesDirectory = args.flags["pages-dir"];
|
|
225
|
+
if (pagesDirectory === void 0) return {};
|
|
226
|
+
if (pagesDirectory === "true") throw new Error("--pages-dir requires a directory");
|
|
227
|
+
return { pagesDirectory };
|
|
228
|
+
}
|
|
229
|
+
function intakeOption(args) {
|
|
230
|
+
const threshold = args.flags["intake-threshold"];
|
|
231
|
+
if (args.flags.intake !== "true") {
|
|
232
|
+
if (threshold !== void 0) throw new Error("--intake-threshold requires --intake");
|
|
233
|
+
return {};
|
|
234
|
+
}
|
|
235
|
+
if (threshold === void 0) return { intake: {} };
|
|
236
|
+
if (threshold === "true") throw new Error("--intake-threshold requires a number");
|
|
237
|
+
const parsed = Number(threshold);
|
|
238
|
+
if (!Number.isFinite(parsed)) throw new Error(`--intake-threshold is not a number: ${threshold}`);
|
|
239
|
+
return { intake: { nearDuplicates: { threshold: parsed } } };
|
|
240
|
+
}
|
|
241
|
+
async function loadOrBuildIndex(root, pages) {
|
|
210
242
|
const path = join(layoutFor(root).cacheDir, "index.json");
|
|
211
243
|
if (existsSync(path)) return JSON.parse(readFileSync(path, "utf8"));
|
|
212
|
-
return await writeKnowledgeIndex(root);
|
|
244
|
+
return await writeKnowledgeIndex(root, pages);
|
|
213
245
|
}
|
|
214
246
|
main().then((code) => process.exit(code)).catch((err) => {
|
|
215
247
|
process.stderr.write(`agent-knowledge error: ${err instanceof Error ? err.stack ?? err.message : String(err)}\n`);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { existsSync, readFileSync } from 'node:fs'\nimport { join, resolve } from 'node:path'\n\nimport { type buildKnowledgeIndex, writeKnowledgeIndex } from './indexer'\nimport { explainKnowledgeTarget, inspectKnowledgeIndex } from './inspect'\nimport { lintKnowledgeIndex } from './lint'\nimport { applyKnowledgeWriteBlocksFile } from './proposals'\nimport { searchKnowledge } from './search'\nimport { addSourcePath, loadSourceRegistry } from './sources'\nimport { initKnowledgeBase, layoutFor } from './store'\nimport { validateKnowledgeIndex } from './validate'\nimport { detectKnowledgeGaps, findSurprisingConnections, toKnowledgeVizGraph } from './viz/index'\n\ninterface Args {\n command: string\n positional: string[]\n flags: Record<string, string>\n}\n\nfunction parseArgs(argv: string[]): Args {\n const [command, ...rest] = argv\n const positional: string[] = []\n const flags: Record<string, string> = {}\n for (let i = 0; i < rest.length; i++) {\n const token = rest[i]!\n if (token.startsWith('--')) {\n const key = token.slice(2)\n const next = rest[i + 1]\n if (next && !next.startsWith('--')) {\n flags[key] = next\n i++\n } else {\n flags[key] = 'true'\n }\n } else {\n positional.push(token)\n }\n }\n return { command: command ?? 'help', positional, flags }\n}\n\nconst HELP = `agent-knowledge — source-grounded knowledge graph CLI.\n\nCommands:\n init [--root .]\n Create raw/sources, knowledge, and cache directories.\n index [--root .] [--json]\n Build .agent-knowledge/index.json from knowledge/**/*.md.\n source-add <path> [--root .] [--json]\n Copy a file or directory into raw/sources and register immutable source records.\n sources [--root .] [--json]\n List registered sources.\n apply-write-blocks <proposal-file> [--root .] [--json]\n Apply safe ---FILE: knowledge/...--- blocks emitted by an agent.\n inspect [--root .] [--json]\n Summarize page/source/edge counts, top pages, and lint state.\n explain <page|id|query> [--root .] [--json]\n Explain sources, links, inbound links, and related pages.\n search <query> [--root .] [--limit 10] [--json]\n Fast local token+graph search over the generated knowledge index.\n graph [--root .] [--format summary|json]\n Emit graph summary or JSON.\n lint [--root .] [--json]\n Run deterministic structural lint.\n validate [--root .] [--strict] [--json]\n Run schema + lint validation. Exits non-zero on blocking findings.\n export [--root .] [--format json]\n Export the current index.\n viz [--root .] [--json]\n Emit graph gaps and surprising connections.\n version\n Print package version.\n`\n\nasync function main(): Promise<number> {\n const args = parseArgs(process.argv.slice(2))\n const root = resolve(args.flags.root ?? '.')\n switch (args.command) {\n case 'init': {\n const layout = await initKnowledgeBase(root)\n process.stdout.write(`initialized knowledge base at ${layout.root}\\n`)\n return 0\n }\n case 'index': {\n const index = await writeKnowledgeIndex(root)\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(index, null, 2)}\\n`)\n else\n process.stdout.write(\n `indexed ${index.pages.length} pages, ${index.graph.edges.length} edges\\n`,\n )\n return 0\n }\n case 'source-add': {\n const [path] = args.positional\n if (!path) {\n process.stderr.write('source-add requires a file or directory path\\n')\n return 1\n }\n await initKnowledgeBase(root)\n const sources = await addSourcePath(root, resolve(path))\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(sources, null, 2)}\\n`)\n else for (const source of sources) process.stdout.write(`${source.id} ${source.uri}\\n`)\n return 0\n }\n case 'sources': {\n const registry = await loadSourceRegistry(root)\n if (args.flags.json === 'true')\n process.stdout.write(`${JSON.stringify(registry.sources, null, 2)}\\n`)\n else {\n for (const source of registry.sources)\n process.stdout.write(`${source.id} ${source.title ?? source.uri} ${source.uri}\\n`)\n }\n return 0\n }\n case 'apply-write-blocks': {\n const [proposalPath] = args.positional\n if (!proposalPath) {\n process.stderr.write('apply-write-blocks requires a proposal file\\n')\n return 1\n }\n await initKnowledgeBase(root)\n const result = await applyKnowledgeWriteBlocksFile(root, resolve(proposalPath))\n await writeKnowledgeIndex(root)\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`)\n else {\n for (const path of result.written) process.stdout.write(`wrote ${path}\\n`)\n for (const warning of result.warnings) process.stderr.write(`warning: ${warning}\\n`)\n }\n return result.warnings.length > 0 ? 2 : 0\n }\n case 'inspect': {\n const index = await loadOrBuildIndex(root)\n const inspection = inspectKnowledgeIndex(index)\n if (args.flags.json === 'true')\n process.stdout.write(`${JSON.stringify(inspection, null, 2)}\\n`)\n else {\n process.stdout.write(\n `pages=${inspection.pageCount} sources=${inspection.sourceCount} edges=${inspection.edgeCount} findings=${inspection.findingCount} blocking=${inspection.blockingFindingCount}\\n`,\n )\n for (const page of inspection.topPages.slice(0, 5))\n process.stdout.write(`${page.degree} ${page.path} sources=${page.sources}\\n`)\n }\n return inspection.blockingFindingCount > 0 ? 2 : 0\n }\n case 'explain': {\n const target = args.positional.join(' ')\n if (!target) {\n process.stderr.write('explain requires a page path, id, title, or query\\n')\n return 1\n }\n const explanation = explainKnowledgeTarget(await loadOrBuildIndex(root), target)\n if (args.flags.json === 'true')\n process.stdout.write(`${JSON.stringify(explanation, null, 2)}\\n`)\n else {\n process.stdout.write(`${explanation.page ? explanation.page.title : target}\\n`)\n for (const source of explanation.sources)\n process.stdout.write(`source ${source.id} ${source.title ?? source.uri}\\n`)\n for (const link of explanation.links) process.stdout.write(`out ${link}\\n`)\n for (const inbound of explanation.inbound) process.stdout.write(`in ${inbound}\\n`)\n for (const related of explanation.related.slice(0, 5))\n process.stdout.write(`related ${related.path} score=${related.score.toFixed(5)}\\n`)\n }\n return 0\n }\n case 'search': {\n const query = args.positional.join(' ')\n if (!query) {\n process.stderr.write('search requires a query\\n')\n return 1\n }\n const index = await loadOrBuildIndex(root)\n const results = searchKnowledge(index, query, Number(args.flags.limit ?? 10))\n if (args.flags.json === 'true') {\n process.stdout.write(`${JSON.stringify(results, null, 2)}\\n`)\n } else {\n for (const result of results) {\n process.stdout.write(\n `${result.rank}. ${result.page.title} (${result.page.path}) score=${result.score.toFixed(5)}\\n`,\n )\n if (result.snippet) process.stdout.write(` ${result.snippet}\\n`)\n }\n }\n return 0\n }\n case 'graph': {\n const index = await loadOrBuildIndex(root)\n if ((args.flags.format ?? 'summary') === 'json')\n process.stdout.write(`${JSON.stringify(index.graph, null, 2)}\\n`)\n else\n process.stdout.write(\n `nodes=${index.graph.nodes.length} edges=${index.graph.edges.length}\\n`,\n )\n return 0\n }\n case 'lint': {\n const index = await loadOrBuildIndex(root)\n const findings = lintKnowledgeIndex(index)\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(findings, null, 2)}\\n`)\n else {\n if (findings.length === 0) process.stdout.write('no findings\\n')\n for (const finding of findings) {\n process.stdout.write(\n `${finding.severity.toUpperCase()} ${finding.type}${finding.page ? ` ${finding.page}` : ''}: ${finding.message}\\n`,\n )\n }\n }\n return findings.some((finding) => finding.severity === 'error') ? 2 : 0\n }\n case 'validate': {\n const result = validateKnowledgeIndex(await loadOrBuildIndex(root), {\n strict: args.flags.strict === 'true',\n })\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`)\n else {\n process.stdout.write(result.ok ? 'valid\\n' : 'invalid\\n')\n for (const finding of result.findings)\n process.stdout.write(\n `${finding.severity.toUpperCase()} ${finding.type}${finding.page ? ` ${finding.page}` : ''}: ${finding.message}\\n`,\n )\n }\n return result.ok ? 0 : 2\n }\n case 'export': {\n const index = await loadOrBuildIndex(root)\n const format = args.flags.format ?? 'json'\n if (format !== 'json') {\n process.stderr.write('export currently supports --format json\\n')\n return 1\n }\n process.stdout.write(`${JSON.stringify(index, null, 2)}\\n`)\n return 0\n }\n case 'viz': {\n const index = await loadOrBuildIndex(root)\n const viz = toKnowledgeVizGraph(index.graph)\n const payload = {\n graph: viz,\n gaps: detectKnowledgeGaps(viz),\n surprisingConnections: findSurprisingConnections(viz),\n }\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(payload, null, 2)}\\n`)\n else {\n process.stdout.write(\n `communities=${viz.communities.length} gaps=${payload.gaps.length} surprising=${payload.surprisingConnections.length}\\n`,\n )\n }\n return 0\n }\n case 'version': {\n const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as {\n version: string\n }\n process.stdout.write(`${pkg.version}\\n`)\n return 0\n }\n case 'help':\n case '--help':\n case '-h':\n process.stdout.write(HELP)\n return 0\n default:\n process.stderr.write(`unknown command: ${args.command}\\n${HELP}`)\n return 1\n }\n}\n\nasync function loadOrBuildIndex(root: string) {\n const path = join(layoutFor(root).cacheDir, 'index.json')\n if (existsSync(path))\n return JSON.parse(readFileSync(path, 'utf8')) as Awaited<ReturnType<typeof buildKnowledgeIndex>>\n return await writeKnowledgeIndex(root)\n}\n\nmain()\n .then((code) => process.exit(code))\n .catch((err) => {\n process.stderr.write(\n `agent-knowledge error: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}\\n`,\n )\n process.exit(1)\n })\n"],"mappings":";;;;;;;AAoBA,SAAS,UAAU,MAAsB;CACvC,MAAM,CAAC,SAAS,GAAG,QAAQ;CAC3B,MAAM,aAAuB,CAAC;CAC9B,MAAM,QAAgC,CAAC;CACvC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,QAAQ,KAAK;EACnB,IAAI,MAAM,WAAW,IAAI,GAAG;GAC1B,MAAM,MAAM,MAAM,MAAM,CAAC;GACzB,MAAM,OAAO,KAAK,IAAI;GACtB,IAAI,QAAQ,CAAC,KAAK,WAAW,IAAI,GAAG;IAClC,MAAM,OAAO;IACb;GACF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C,UAAU,YAAY;CACxD,IAAI,WAAW,IAAI,GACjB,OAAO,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC;CAC9C,OAAO,MAAM,oBAAoB,IAAI;AACvC;AAEA,KAAK,CAAC,CACH,MAAM,SAAS,QAAQ,KAAK,IAAI,CAAC,CAAC,CAClC,OAAO,QAAQ;CACd,QAAQ,OAAO,MACb,0BAA0B,eAAe,QAAS,IAAI,SAAS,IAAI,UAAW,OAAO,GAAG,EAAE,GAC5F;CACA,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { existsSync, readFileSync } from 'node:fs'\nimport { join, resolve } from 'node:path'\n\nimport { type buildKnowledgeIndex, writeKnowledgeIndex } from './indexer'\nimport { explainKnowledgeTarget, inspectKnowledgeIndex } from './inspect'\nimport { lintKnowledgeIndex } from './lint'\nimport type { KnowledgePagesOptions } from './pages-directory'\nimport { type ApplyKnowledgeWriteBlocksOptions, applyKnowledgeWriteBlocksFile } from './proposals'\nimport { searchKnowledge } from './search'\nimport { addSourcePath, loadSourceRegistry } from './sources'\nimport { initKnowledgeBase, layoutFor } from './store'\nimport { validateKnowledgeIndex } from './validate'\nimport { detectKnowledgeGaps, findSurprisingConnections, toKnowledgeVizGraph } from './viz/index'\n\ninterface Args {\n command: string\n positional: string[]\n flags: Record<string, string>\n}\n\nfunction parseArgs(argv: string[]): Args {\n const [command, ...rest] = argv\n const positional: string[] = []\n const flags: Record<string, string> = {}\n for (let i = 0; i < rest.length; i++) {\n const token = rest[i]!\n if (token.startsWith('--')) {\n const key = token.slice(2)\n const next = rest[i + 1]\n if (next && !next.startsWith('--')) {\n flags[key] = next\n i++\n } else {\n flags[key] = 'true'\n }\n } else {\n positional.push(token)\n }\n }\n return { command: command ?? 'help', positional, flags }\n}\n\nconst HELP = `agent-knowledge — source-grounded knowledge graph CLI.\n\nOptions shared by the commands below:\n --root <dir> Knowledge-base root. Defaults to the current directory.\n --pages-dir <dir> Root-relative directory that holds Markdown pages. Defaults to knowledge.\n Bounds apply-write-blocks and selects what index builds.\n\nCommands:\n init [--root .]\n Create raw/sources, knowledge, and cache directories.\n index [--root .] [--pages-dir knowledge] [--json]\n Build .agent-knowledge/index.json from <pages-dir>/**/*.md.\n source-add <path> [--root .] [--json]\n Copy a file or directory into raw/sources and register immutable source records.\n sources [--root .] [--json]\n List registered sources.\n apply-write-blocks <proposal-file> [--root .] [--pages-dir knowledge] [--intake]\n [--intake-threshold 0.82] [--json]\n Apply safe ---FILE: <pages-dir>/...--- blocks emitted by an agent.\n --intake refuses the whole proposal when a block duplicates a page already\n in the store without citing it, naming it in contradicts, or reusing its\n id, or when a block cites a page id that exists nowhere.\n --intake-threshold sets the duplicate Jaccard similarity.\n inspect [--root .] [--json]\n Summarize page/source/edge counts, top pages, and lint state.\n explain <page|id|query> [--root .] [--json]\n Explain sources, links, inbound links, and related pages.\n search <query> [--root .] [--pages-dir knowledge] [--limit 10] [--json]\n Local BM25 and link-graph search (RRF fused) over the generated knowledge index.\n graph [--root .] [--format summary|json]\n Emit graph summary or JSON.\n lint [--root .] [--json]\n Run deterministic structural lint.\n validate [--root .] [--strict] [--json]\n Run schema + lint validation. Exits non-zero on blocking findings.\n export [--root .] [--format json]\n Export the current index.\n viz [--root .] [--json]\n Emit graph gaps and surprising connections.\n version\n Print package version.\n`\n\nasync function main(): Promise<number> {\n const args = parseArgs(process.argv.slice(2))\n const root = resolve(args.flags.root ?? '.')\n const pages = pagesOptions(args)\n switch (args.command) {\n case 'init': {\n const layout = await initKnowledgeBase(root)\n process.stdout.write(`initialized knowledge base at ${layout.root}\\n`)\n return 0\n }\n case 'index': {\n const index = await writeKnowledgeIndex(root, pages)\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(index, null, 2)}\\n`)\n else\n process.stdout.write(\n `indexed ${index.pages.length} pages, ${index.graph.edges.length} edges\\n`,\n )\n return 0\n }\n case 'source-add': {\n const [path] = args.positional\n if (!path) {\n process.stderr.write('source-add requires a file or directory path\\n')\n return 1\n }\n await initKnowledgeBase(root)\n const sources = await addSourcePath(root, resolve(path))\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(sources, null, 2)}\\n`)\n else for (const source of sources) process.stdout.write(`${source.id} ${source.uri}\\n`)\n return 0\n }\n case 'sources': {\n const registry = await loadSourceRegistry(root)\n if (args.flags.json === 'true')\n process.stdout.write(`${JSON.stringify(registry.sources, null, 2)}\\n`)\n else {\n for (const source of registry.sources)\n process.stdout.write(`${source.id} ${source.title ?? source.uri} ${source.uri}\\n`)\n }\n return 0\n }\n case 'apply-write-blocks': {\n const [proposalPath] = args.positional\n if (!proposalPath) {\n process.stderr.write('apply-write-blocks requires a proposal file\\n')\n return 1\n }\n await initKnowledgeBase(root)\n const result = await applyKnowledgeWriteBlocksFile(root, resolve(proposalPath), {\n ...pages,\n ...intakeOption(args),\n })\n await writeKnowledgeIndex(root, pages)\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`)\n else {\n for (const path of result.written) process.stdout.write(`wrote ${path}\\n`)\n for (const warning of result.warnings) process.stderr.write(`warning: ${warning}\\n`)\n }\n return result.warnings.length > 0 ? 2 : 0\n }\n case 'inspect': {\n const index = await loadOrBuildIndex(root, pages)\n const inspection = inspectKnowledgeIndex(index)\n if (args.flags.json === 'true')\n process.stdout.write(`${JSON.stringify(inspection, null, 2)}\\n`)\n else {\n process.stdout.write(\n `pages=${inspection.pageCount} sources=${inspection.sourceCount} edges=${inspection.edgeCount} findings=${inspection.findingCount} blocking=${inspection.blockingFindingCount}\\n`,\n )\n for (const page of inspection.topPages.slice(0, 5))\n process.stdout.write(`${page.degree} ${page.path} sources=${page.sources}\\n`)\n }\n return inspection.blockingFindingCount > 0 ? 2 : 0\n }\n case 'explain': {\n const target = args.positional.join(' ')\n if (!target) {\n process.stderr.write('explain requires a page path, id, title, or query\\n')\n return 1\n }\n const explanation = explainKnowledgeTarget(await loadOrBuildIndex(root, pages), target)\n if (args.flags.json === 'true')\n process.stdout.write(`${JSON.stringify(explanation, null, 2)}\\n`)\n else {\n process.stdout.write(`${explanation.page ? explanation.page.title : target}\\n`)\n for (const source of explanation.sources)\n process.stdout.write(`source ${source.id} ${source.title ?? source.uri}\\n`)\n for (const link of explanation.links) process.stdout.write(`out ${link}\\n`)\n for (const inbound of explanation.inbound) process.stdout.write(`in ${inbound}\\n`)\n for (const related of explanation.related.slice(0, 5))\n process.stdout.write(`related ${related.path} score=${related.score.toFixed(5)}\\n`)\n }\n return 0\n }\n case 'search': {\n const query = args.positional.join(' ')\n if (!query) {\n process.stderr.write('search requires a query\\n')\n return 1\n }\n const index = await loadOrBuildIndex(root, pages)\n const results = searchKnowledge(index, query, Number(args.flags.limit ?? 10))\n if (args.flags.json === 'true') {\n process.stdout.write(`${JSON.stringify(results, null, 2)}\\n`)\n } else {\n for (const result of results) {\n process.stdout.write(\n `${result.rank}. ${result.page.title} (${result.page.path}) score=${result.score.toFixed(5)}\\n`,\n )\n if (result.snippet) process.stdout.write(` ${result.snippet}\\n`)\n }\n }\n return 0\n }\n case 'graph': {\n const index = await loadOrBuildIndex(root, pages)\n if ((args.flags.format ?? 'summary') === 'json')\n process.stdout.write(`${JSON.stringify(index.graph, null, 2)}\\n`)\n else\n process.stdout.write(\n `nodes=${index.graph.nodes.length} edges=${index.graph.edges.length}\\n`,\n )\n return 0\n }\n case 'lint': {\n const index = await loadOrBuildIndex(root, pages)\n const findings = lintKnowledgeIndex(index)\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(findings, null, 2)}\\n`)\n else {\n if (findings.length === 0) process.stdout.write('no findings\\n')\n for (const finding of findings) {\n process.stdout.write(\n `${finding.severity.toUpperCase()} ${finding.type}${finding.page ? ` ${finding.page}` : ''}: ${finding.message}\\n`,\n )\n }\n }\n return findings.some((finding) => finding.severity === 'error') ? 2 : 0\n }\n case 'validate': {\n const result = validateKnowledgeIndex(await loadOrBuildIndex(root, pages), {\n strict: args.flags.strict === 'true',\n })\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`)\n else {\n process.stdout.write(result.ok ? 'valid\\n' : 'invalid\\n')\n for (const finding of result.findings)\n process.stdout.write(\n `${finding.severity.toUpperCase()} ${finding.type}${finding.page ? ` ${finding.page}` : ''}: ${finding.message}\\n`,\n )\n }\n return result.ok ? 0 : 2\n }\n case 'export': {\n const index = await loadOrBuildIndex(root, pages)\n const format = args.flags.format ?? 'json'\n if (format !== 'json') {\n process.stderr.write('export currently supports --format json\\n')\n return 1\n }\n process.stdout.write(`${JSON.stringify(index, null, 2)}\\n`)\n return 0\n }\n case 'viz': {\n const index = await loadOrBuildIndex(root, pages)\n const viz = toKnowledgeVizGraph(index.graph)\n const payload = {\n graph: viz,\n gaps: detectKnowledgeGaps(viz),\n surprisingConnections: findSurprisingConnections(viz),\n }\n if (args.flags.json === 'true') process.stdout.write(`${JSON.stringify(payload, null, 2)}\\n`)\n else {\n process.stdout.write(\n `communities=${viz.communities.length} gaps=${payload.gaps.length} surprising=${payload.surprisingConnections.length}\\n`,\n )\n }\n return 0\n }\n case 'version': {\n const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as {\n version: string\n }\n process.stdout.write(`${pkg.version}\\n`)\n return 0\n }\n case 'help':\n case '--help':\n case '-h':\n process.stdout.write(HELP)\n return 0\n default:\n process.stderr.write(`unknown command: ${args.command}\\n${HELP}`)\n return 1\n }\n}\n\nfunction pagesOptions(args: Args): KnowledgePagesOptions {\n const pagesDirectory = args.flags['pages-dir']\n if (pagesDirectory === undefined) return {}\n if (pagesDirectory === 'true') throw new Error('--pages-dir requires a directory')\n return { pagesDirectory }\n}\n\nfunction intakeOption(args: Args): Pick<ApplyKnowledgeWriteBlocksOptions, 'intake'> {\n const threshold = args.flags['intake-threshold']\n if (args.flags.intake !== 'true') {\n if (threshold !== undefined) throw new Error('--intake-threshold requires --intake')\n return {}\n }\n if (threshold === undefined) return { intake: {} }\n if (threshold === 'true') throw new Error('--intake-threshold requires a number')\n const parsed = Number(threshold)\n if (!Number.isFinite(parsed)) throw new Error(`--intake-threshold is not a number: ${threshold}`)\n return { intake: { nearDuplicates: { threshold: parsed } } }\n}\n\nasync function loadOrBuildIndex(root: string, pages: KnowledgePagesOptions) {\n const path = join(layoutFor(root).cacheDir, 'index.json')\n if (existsSync(path))\n return JSON.parse(readFileSync(path, 'utf8')) as Awaited<ReturnType<typeof buildKnowledgeIndex>>\n return await writeKnowledgeIndex(root, pages)\n}\n\nmain()\n .then((code) => process.exit(code))\n .catch((err) => {\n process.stderr.write(\n `agent-knowledge error: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}\\n`,\n )\n process.exit(1)\n })\n"],"mappings":";;;;;;;AAqBA,SAAS,UAAU,MAAsB;CACvC,MAAM,CAAC,SAAS,GAAG,QAAQ;CAC3B,MAAM,aAAuB,CAAC;CAC9B,MAAM,QAAgC,CAAC;CACvC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,QAAQ,KAAK;EACnB,IAAI,MAAM,WAAW,IAAI,GAAG;GAC1B,MAAM,MAAM,MAAM,MAAM,CAAC;GACzB,MAAM,OAAO,KAAK,IAAI;GACtB,IAAI,QAAQ,CAAC,KAAK,WAAW,IAAI,GAAG;IAClC,MAAM,OAAO;IACb;GACF,OACE,MAAM,OAAO;EAEjB,OACE,WAAW,KAAK,KAAK;CAEzB;CACA,OAAO;EAAE,SAAS,WAAW;EAAQ;EAAY;CAAM;AACzD;AAEA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2Cb,eAAe,OAAwB;CACrC,MAAM,OAAO,UAAU,QAAQ,KAAK,MAAM,CAAC,CAAC;CAC5C,MAAM,OAAO,QAAQ,KAAK,MAAM,QAAQ,GAAG;CAC3C,MAAM,QAAQ,aAAa,IAAI;CAC/B,QAAQ,K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Q;EAChC,IAAI,cAAc,KAAA,GAAW,MAAM,IAAI,MAAM,sCAAsC;EACnF,OAAO,CAAC;CACV;CACA,IAAI,cAAc,KAAA,GAAW,OAAO,EAAE,QAAQ,CAAC,EAAE;CACjD,IAAI,cAAc,QAAQ,MAAM,IAAI,MAAM,sCAAsC;CAChF,MAAM,SAAS,OAAO,SAAS;CAC/B,IAAI,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,uCAAuC,WAAW;CAChG,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,OAAO,EAAE,EAAE;AAC7D;AAEA,eAAe,iBAAiB,MAAc,OAA8B;CAC1E,MAAM,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,UAAU,YAAY;CACxD,IAAI,WAAW,IAAI,GACjB,OAAO,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC;CAC9C,OAAO,MAAM,oBAAoB,MAAM,KAAK;AAC9C;AAEA,KAAK,CAAC,CACH,MAAM,SAAS,QAAQ,KAAK,IAAI,CAAC,CAAC,CAClC,OAAO,QAAQ;CACd,QAAQ,OAAO,MACb,0BAA0B,eAAe,QAAS,IAAI,SAAS,IAAI,UAAW,OAAO,GAAG,EAAE,GAC5F;CACA,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as SourceRecord, p as KnowledgeIndex } from "./types-m2QB86fF.js";
|
|
2
2
|
import { AgentCandidateJsonValue } from "@tangle-network/agent-interface";
|
|
3
3
|
import { CampaignResult, CampaignStorage, CostLedgerHandle, DispatchContext, JudgeConfig, MutableSurface, Scenario } from "@tangle-network/agent-eval/campaign";
|
|
4
4
|
//#region src/memory/types.d.ts
|
|
@@ -677,4 +677,4 @@ declare function knowledgeBenchmarkJudge<TArtifact = KnowledgeBenchmarkArtifact>
|
|
|
677
677
|
declare function isKnowledgeMemoryBenchmarkCase(testCase: KnowledgeBenchmarkCase): testCase is KnowledgeMemoryBenchmarkCase;
|
|
678
678
|
//#endregion
|
|
679
679
|
export { RetrievalConfig as $, KnowledgeBenchmarkResponder as A, AgentMemoryScope as At, KnowledgeMemoryEvent as B, RetrievalHoldoutSessionState as Bt, KnowledgeBenchmarkArtifact as C, createInMemoryBenchmarkAdapter as Ct, KnowledgeBenchmarkEvaluation as D, AgentMemoryContext as Dt, KnowledgeBenchmarkDistribution as E, AgentMemoryBranchIsolation as Et, KnowledgeBenchmarkSplit as F, RetrievalHoldoutCallContext as Ft, MemoryAdapterBenchmarkCandidate as G, KnowledgeRetrievalBenchmarkCase as H, KnowledgeBenchmarkTaskKind as I, RetrievalHoldoutConfig as It, RunKnowledgeBenchmarkSuiteResult as J, MemoryAdapterBenchmarkRankingRow as K, KnowledgeClaimMatcher as L, RetrievalHoldoutEligibleItem as Lt, KnowledgeBenchmarkSliceSummary as M, AgentMemoryWriteInput as Mt, KnowledgeBenchmarkSource as N, AgentMemoryWriteResult as Nt, KnowledgeBenchmarkFamily as O, AgentMemoryHit as Ot, KnowledgeBenchmarkSpec as P, RetrievalHoldoutBypassReason as Pt, PartitionRetrievalScenariosOptions as Q, KnowledgeMemoryBenchmarkCase as R, RetrievalHoldoutEvent as Rt, KnowledgeAnswerBenchmarkTaskKind as S, acquireAgentMemoryRunLease as St, KnowledgeBenchmarkCaseBase as T, AgentMemoryAdapter as Tt, KnowledgeRetrievalBenchmarkQrel as U, KnowledgeMemoryFactMatcher as V, KnowledgeRetrievalBenchmarkQuery as W, RunMemoryAdapterBenchmarkResult as X, RunMemoryAdapterBenchmarkOptions as Y, BuildRetrievalEvalDispatchOptions as Z, buildIndustryRagBenchmarkSmokeCases as _, scoreRetrievalArtifact as _t, runKnowledgeBenchmarkSuite as a, RetrievalGoldTarget as at, BuildRetrievalBenchmarkCasesFromQrelsOptions as b, AgentMemoryRunLease as bt, buildRetrievalBenchmarkCasesFromQrels as c, RetrievalRecallJudgeOptions as ct, summarizeKnowledgeBenchmarkCampaign as d, RetrievedSourceSpan as dt, RetrievalEvalArtifact as et, runMemoryAdapterBenchmark as f, buildRetrievalEvalDispatch as ft, buildIndustryMemoryBenchmarkSmokeCases as g, retrievalRecallJudge as gt, buildFirstPartyMemoryLifecycleBenchmarkCases as h, retrievalConfigSurface as ht, renderKnowledgeBenchmarkReportMarkdown as i, RetrievalEvalScenario as it, KnowledgeBenchmarkScenario as j, AgentMemorySearchOptions as jt, KnowledgeBenchmarkReport as k, AgentMemoryKind as kt, parseKnowledgeBenchmarkJsonl as l, RetrievalScenarioPartitions as lt, INDUSTRY_RAG_BENCHMARKS as m, retrievalConfigFromSurface as mt, buildKnowledgeBenchmarkScenarios as n, RetrievalEvalRetrieverInput as nt, scoreKnowledgeBenchmarkArtifact as o, RetrievalMetricSummary as ot, INDUSTRY_MEMORY_BENCHMARKS as p, partitionRetrievalScenarios as pt, RunKnowledgeBenchmarkSuiteOptions as q, knowledgeBenchmarkJudge as r, RetrievalEvalRetrieverResult as rt, scoreMemoryBenchmarkArtifact as s, RetrievalMetricWeights as st, isKnowledgeMemoryBenchmarkCase as t, RetrievalEvalRetriever as tt, parseKnowledgeBenchmarkQrels as u, RetrievedKnowledgeHit as ut, respondToIndustryMemoryBenchmarkSmokeCase as v, AgentMemoryAcquireRunLease as vt, KnowledgeBenchmarkCase as w, createNoopMemoryBenchmarkAdapter as wt, KnowledgeAnswerBenchmarkCase as x, OwnedAgentMemoryRunLease as xt, respondToIndustryRagBenchmarkSmokeCase as y, AgentMemoryControllerMode as yt, KnowledgeMemoryBenchmarkTaskKind as z, RetrievalHoldoutResult as zt };
|
|
680
|
-
//# sourceMappingURL=index-
|
|
680
|
+
//# sourceMappingURL=index-DZeFm-BP.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DZeFm-BP.d.ts","names":[],"sources":["../src/memory/types.ts","../src/benchmarks/adapters.ts","../src/memory/run-control.ts","../src/retrieval-eval.ts","../src/benchmarks/types.ts","../src/benchmarks/catalog.ts","../src/benchmarks/memory-runner.ts","../src/benchmarks/metrics.ts","../src/benchmarks/retrieval.ts","../src/benchmarks/scoring.ts","../src/benchmarks/suite.ts","../src/benchmarks/validation.ts"],"mappings":";;;;KAEY;UAQK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO;;UAGQ;EACf;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;;UAGI;EACf;EACA;EACA,MAAM;EACN,eAAe;EACf,WAAW;;UAGI;EACf,QAAQ;EACR;EACA;EACA,QAAQ;EACR,WAAW;;;;;EAKX,UAAU;;UAGK;EACf,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA,MAAM;EACN,eAAe;EACf,WAAW;;KAGD;EAEN;;EAEA;;EAEA;;EAGA;EACA;;EAEA;;EAEA;EAAqB;;UAEV;WACN;;WAEA,kBAAkB;EAC3B,OAAO,eAAe,UAAU,2BAA2B,QAAQ;EACnE,WAAW,eAAe,UAAU,2BAA2B,QAAQ;EACvE,MAAM,OAAO,wBAAwB,QAAQ;;EAE7C,OAAO,QAAQ,mBAAmB;EAClC,UAAU;EACV,UAAU;;;;;;;UASK;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;EAQA;;;;;EAKA;;;;;EAKA,OAAO;;EAEP,UAAU,OAAO;;UAGF;EACf;;EAEA;EACA;EACA;;EAEA;;UAGe;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;;;EAIA;EACA;;EAEA,QAAQ;;EAER;EACA;IAAU;IAAiB;IAAqB;;;;;;EAKhD;;;;;EAKA;;EAEA,eAAe;;EAEf,UAAU;;EAEV;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;;UAGe;EACf;;EAEA;EACA;;EAEA;EACA;;UAGe;EACf;EACA;;EAE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B,uBACd,UAAU,uBACV,UAAU,wBACT;iBAgDa,4BACd,oBAAoB,yBACpB,UAAS,qCACR;;;KChQS;KAeA;KAEA,mCAAmC,QAC7C,0CACc;KAGJ;KAuBA;UAEK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,UAAU;EACV;EACA;EACA;;UAGe;EACf;EACA,QAAQ;EACR,UAAU;EACV,QAAQ;EACR;EACA,SAAS;EACT,WAAW;;UAGI,wCAAwC;EACvD;EACA;EACA,UAAU,+BAA+B;EACzC;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA,WAAW;;UAGI,mCAAmC;EAClD;EACA;EACA;;UAGe,qCAAqC;EACpD,UAAU;EACV;EACA,0BAA0B;EAC1B,2BAA2B;EAC3B;EACA;;UAGe,qCAAqC;EACpD,UAAU;EACV,iBAAiB;EACjB;EACA,yBAAyB;EACzB,0BAA0B;EAC1B;EACA;EACA;;KAGU,yBACR,kCACA,+BACA;UAEa;EACf;EACA;EACA,gBAAgB;EAChB;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA,WAAW;;UAGI;EACf;EACA;EACA,YAAY;;EAEZ;EACA;EACA,KAAK;;UAGU,mCAAmC;EAClD;EACA,QAAQ;EACR,UAAU;EACV,UAAU;EACV,MAAM;;KAGI,4BAA4B,YAAY,+BAA+B;EACjF,MAAM;EACN,UAAU;EACV,SAAS;MACL,QAAQ,aAAa;UAEV,kCAAkC,YAAY;EAC7D,gBAAgB;EAChB,SAAS,4BAA4B;;EAErC;EACA;EACA,kBAAkB;EAClB;EACA;EACA;EACA;EACA;;EAEA,aAAa;EACb;EACA;EACA;EACA;EACA,UAAU;EACV,YAAY;;UAGG;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,OAAO;;UAGQ;EACf;EACA;EACA;EACA;EACA;EACA,SAAS,eAAe;EACxB,UAAU,eAAe;EACzB,YAAY,eAAe;EAC3B,YAAY,eAAe;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,UAAU,8BACV,UAAU,YACT;;;iBClDmB,2BAA2B,YAAY,4BAC3D,SAAS,kCAAkC,aAC1C,QAAQ,iCAAiC;iBA2D5B,uCAAuC,QAAQ;iBA+B/C,iCACd,gBAAgB,0BAChB,kBAAkB,4BACjB;iBAmBa,wBAAwB,YAAY,+BAA+B,YACjF,WACA;;;iBC9Ic,+BACd,UAAU,yBACT,YAAY"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { At as AgentMemoryScope, B as KnowledgeMemoryEvent, Dt as AgentMemoryContext, F as KnowledgeBenchmarkSplit, Ft as RetrievalHoldoutCallContext, It as RetrievalHoldoutConfig, Mt as AgentMemoryWriteInput, Nt as AgentMemoryWriteResult, O as KnowledgeBenchmarkFamily, Ot as AgentMemoryHit, Pt as RetrievalHoldoutBypassReason, R as KnowledgeMemoryBenchmarkCase, Rt as RetrievalHoldoutEvent, Tt as AgentMemoryAdapter, V as KnowledgeMemoryFactMatcher, bt as AgentMemoryRunLease, jt as AgentMemorySearchOptions, vt as AgentMemoryAcquireRunLease, yt as AgentMemoryControllerMode, z as KnowledgeMemoryBenchmarkTaskKind, zt as RetrievalHoldoutResult } from "./index-
|
|
1
|
+
import { j as SourceRecord } from "./types-m2QB86fF.js";
|
|
2
|
+
import { At as AgentMemoryScope, B as KnowledgeMemoryEvent, Dt as AgentMemoryContext, F as KnowledgeBenchmarkSplit, Ft as RetrievalHoldoutCallContext, It as RetrievalHoldoutConfig, Mt as AgentMemoryWriteInput, Nt as AgentMemoryWriteResult, O as KnowledgeBenchmarkFamily, Ot as AgentMemoryHit, Pt as RetrievalHoldoutBypassReason, R as KnowledgeMemoryBenchmarkCase, Rt as RetrievalHoldoutEvent, Tt as AgentMemoryAdapter, V as KnowledgeMemoryFactMatcher, bt as AgentMemoryRunLease, jt as AgentMemorySearchOptions, vt as AgentMemoryAcquireRunLease, yt as AgentMemoryControllerMode, z as KnowledgeMemoryBenchmarkTaskKind, zt as RetrievalHoldoutResult } from "./index-DZeFm-BP.js";
|
|
3
3
|
import { AgentCandidateJsonValue } from "@tangle-network/agent-interface";
|
|
4
4
|
import { CostChannel, CostReceipt, PairedBootstrapResult, RunPaidCallInput } from "@tangle-network/agent-eval";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1033,4 +1033,4 @@ declare function memoryWriteResultToSourceRecord(result: AgentMemoryWriteResult,
|
|
|
1033
1033
|
}): SourceRecord;
|
|
1034
1034
|
//#endregion
|
|
1035
1035
|
export { runAgentMemoryLearningExperiment as $, jsonObjectCandidateCodec as $t, AgentMemoryFinalPair as A, BuildAgentMemorySequencesFromBenchmarkCasesOptions as At, applySessionStickyRetrievalHoldout as B, AgentMemorySharingPolicy as Bt, runBoundedMemoryLifecycle as C, AgentMemorySequenceArtifact as Ct, AgentMemoryActivationDriver as D, AgentMemorySequenceStep as Dt, AgentMemoryActivation as E, AgentMemorySequenceScenario as Et, RunAgentMemoryImprovementResult as F, RunAgentMemoryLearningExperimentResult as Ft, toOffPolicyTrajectory as G, forkAgentMemoryBranchSnapshot as Gt, emitRetrievalHoldoutBypass as H, CreateAgentMemoryBranchOptions as Ht, RetrievalHoldoutOffPolicyOptions as I, AgentMemoryBranch as It, GraphitiToolNames as J, RunSerializedKnowledgeOptimizationOptions as Jt, GraphitiMcpClientLike as K, defaultGetMemoryContext as Kt, RetrievalHoldoutOffPolicyResult as L, AgentMemoryBranchLifetime as Lt, AgentMemoryPromotionDecision as M, RunAgentMemoryExperimentOptions as Mt, MemoryConfigScenario as N, RunAgentMemoryExperimentResult as Nt, AgentMemoryDimensionComparison as O, AgentMemoryTransferCellComparison as Ot, RunAgentMemoryImprovementOptions as P, RunAgentMemoryLearningExperimentOptions as Pt, compareAgentMemoryLearning as Q, jsonCandidateCodec as Qt, RetrievalHoldoutSessionSummary as R, AgentMemoryBranchSnapshot as Rt, resolveMemoryCleanupTimeoutMs as S, AgentMemorySequence as St, runAgentMemoryImprovement as T, AgentMemorySequenceProbeResult as Tt, resetRetrievalHoldoutRegistry as U, ForkAgentMemoryBranchSnapshotOptions as Ut, deterministicRng as V, AgentMemoryVisibility as Vt, retrievalHoldoutConfigHash as W, createAgentMemoryBranch as Wt, graphitiMemoryAdapterIdentity as X, SerializedCandidate as Xt, createGraphitiMemoryAdapter as Y, RunSerializedKnowledgeOptimizationResult as Yt, runAgentMemoryExperiment as Z, SerializedCandidateCodec as Zt, AgentMemoryLifecycleTimeoutError as _, AgentMemoryLearningArmOrder as _t, AgentMemoryScopeSchema as a, AgentMemoryExecutionContext as at, createMemoryExecutionPool as b, AgentMemoryLearningComparison as bt, createNeo4jAgentMemoryAdapter as c, AgentMemoryExecutionPaidCallInput as ct, Mem0HostedMemoryAdapterOptions as d, AgentMemoryExperimentCandidate as dt, runSerializedKnowledgeOptimization as en, agentMemorySequenceJudge as et, Mem0MemoryAdapterOptions as f, AgentMemoryExperimentCandidateRef as ft, mem0MemoryAdapterIdentity as g, AgentMemoryForgettingComparison as gt, createMem0MemoryAdapter as h, AgentMemoryExperimentRunLease as ht, AgentMemoryKindSchema as i, AgentMemoryEvidenceRef as it, AgentMemoryImprovementRunLease as j, CompareAgentMemoryLearningOptions as jt, AgentMemoryFinalEvaluation as k, AgentMemoryTransferStepSummary as kt, Mem0ClientMode as l, AgentMemoryExecutionPaidCallResult as lt, Mem0OssMemoryAdapterOptions as m, AgentMemoryExperimentRankingRow as mt, memoryWriteResultToSourceRecord as n, buildAgentMemorySequencesFromBenchmarkCases as nt, AgentMemoryWriteInputSchema as o, AgentMemoryExecutionCostMeter as ot, Mem0OssClient as p, AgentMemoryExperimentComparisonRef as pt, GraphitiMemoryAdapterOptions as q, renderMemoryContext as qt, AgentMemoryHitSchema as r, AgentMemoryAttemptEvent as rt, Neo4jAgentMemoryAdapterOptions as s, AgentMemoryExecutionCostReceipt as st, memoryHitToSourceRecord as t, scenarioContentFingerprint as tn, buildAgentMemorySequenceScenarios as tt, Mem0HostedClient as u, AgentMemoryExecutionStep as ut, AgentMemoryLifecycleUnsafeError as v, AgentMemoryLearningCandidateSummary as vt, sleepForMemoryRecovery as w, AgentMemorySequenceProbe as wt, memoryRecoveryDelayMs as x, AgentMemoryMode as xt, DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS as y, AgentMemoryLearningCellComparison as yt, applyRetrievalHoldout as z, AgentMemoryJournalEntry as zt };
|
|
1036
|
-
//# sourceMappingURL=index-
|
|
1036
|
+
//# sourceMappingURL=index-eDsIXWyM.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-eDsIXWyM.d.ts","names":[],"sources":["../src/optimization.ts","../src/memory/adapter.ts","../src/memory/branch.ts","../src/memory/experiment/types.ts","../src/memory/experiment/cases.ts","../src/memory/experiment/learning.ts","../src/memory/experiment/run.ts","../src/memory/graphiti.ts","../src/memory/holdout.ts","../src/memory/improvement/types.ts","../src/memory/improvement/run.ts","../src/memory/lifecycle.ts","../src/memory/mem0.ts","../src/memory/neo4j.ts","../src/memory/schemas.ts","../src/memory/source-record.ts"],"mappings":";;;;;;;;UAeiB,yBAAyB,mBAAmB;EAC3D,UAAU,WAAW;EACrB,MAAM,kBAAkB;;UAGT,oBAAoB,mBAAmB;EACtD,OAAO;EACP;EACA;;KAGG,kBAAkB,kBAAkB,UAAU,aAAa,KAC9D,kCAAkC,WAAW;UAW9B,0CACf,mBAAmB,yBACnB,kBAAkB,UAClB,mBACQ,kBAAkB,WAAW;;EAErC;EACA,UAAU;EACV,QAAQ,mBAAmB,WAAW;EACtC,yBAAyB;EACzB,6BAA6B;EAC7B,yBAAyB;EACzB,kBAAkB;IAChB,WAAW;IACX;IACA;IACA,UAAU;IACV,SAAS;MACP,QAAQ;EACZ,QAAQ,yBAAyB;;EAEjC,uBAAuB,UAAU;EACjC,yBAAyB,KAAK,6BAA6B,WAAW;;UAGvD,yCAAyC,mBAAmB;EAC3E;EACA,UAAU,oBAAoB;EAC9B,QAAQ,oBAAoB;EAC5B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;UAGC;EACf,YAAY,GACV,OAAO,kCAAkC,KACxC,QAAQ,mCAAmC;;;UAI/B;WACN,QAAQ;WACR,MAAM;;UAGA;EACf;EACA,QAAQ;EACR,QAAQ;EACR,gBAAgB;;EAEhB,yBAAyB;EACzB;EACA,WAAW;;UAGI;EACf;EACA,cAAc;IACZ,OAAO;IACP,MAAM;IACN;QACI;EACN,cAAc,UAAU,iCAAiC;;UAG1C;EACf;EACA;;EAEA;;EAEA,cAAc;IACZ;IACA;IACA,QAAQ;;IAER;IACA;;IAEA,mBAAmB;MACjB,4BAA4B,QAAQ;EACxC,SAAS;EACT,YAAY;;EAEZ;;EAEA;;EAEA;;EAEA,gBAAgB,SAAS,qBAAqB;;UAG/B;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ;EACA;EACA;;EAEA,aAAa;EACb;;UAGe;EACf;EACA;EACA,YAAY;EACZ,eAAe;EACf;EACA;EACA,YAAY;EACZ,uBAAuB;EACvB,iBAAiB;EACjB;EACA;EACA;;UAGe,oCAAoC;EACnD;EACA;EACA;EACA,UAAU;EACV;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;;UAGG;EACf;EACA;EACA;EACA;EACA;EACA,qBAAqB;EACrB,sBAAsB;;EAEtB;EACA;EACA;EACA;;UAGe;EACf;EACA;;EAEA,MAAM;;UAGS;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB;EACrB,sBAAsB;EACtB;EACA;EACA;;UAGe;EACf;EACA;EACA;;EAEA,MAAM;;UAGS;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB;EACrB,sBAAsB;EACtB;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;;EAEA;;UAGe;EACf,eAAe;EACf;IACE,UAAU;IACV,qBAAqB;IACrB,sBAAsB;IACtB;IACA;IACA,wBAAwB;IACxB;;EAEF,gBAAgB;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