@tangle-network/agent-knowledge 22.0.16 → 23.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/AGENTS.md +3 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +3 -3
  4. package/dist/benchmarks/index.d.ts +1 -1
  5. package/dist/benchmarks/index.js +1 -2
  6. package/dist/{benchmarks-jir3ZP-M.js → benchmarks-BMDc-9V-.js} +3 -4
  7. package/dist/{benchmarks-jir3ZP-M.js.map → benchmarks-BMDc-9V-.js.map} +1 -1
  8. package/dist/cli.js +3 -4
  9. package/dist/{ids-Bevz_pXV.js → ids-C-Z2Uv4c.js} +2 -3
  10. package/dist/{ids-Bevz_pXV.js.map → ids-C-Z2Uv4c.js.map} +1 -1
  11. package/dist/{index-BhvSH4E4.d.ts → index-B2s20NlV.d.ts} +3 -25
  12. package/dist/index-B2s20NlV.d.ts.map +1 -0
  13. package/dist/{index-OAxtm6is.d.ts → index-CRg_7-ND.d.ts} +2 -4
  14. package/dist/index-CRg_7-ND.d.ts.map +1 -0
  15. package/dist/index.d.ts +5 -123
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +45 -84
  18. package/dist/index.js.map +1 -1
  19. package/dist/{inspect-rXk5_r3K.js → inspect-tl0P7I7w.js} +33 -63
  20. package/dist/{inspect-rXk5_r3K.js.map → inspect-tl0P7I7w.js.map} +1 -1
  21. package/dist/memory/index.d.ts +2 -2
  22. package/dist/memory/index.js +2 -2
  23. package/dist/{memory-BH6oT1Qe.js → memory-krApkeRS.js} +15 -27
  24. package/dist/{memory-BH6oT1Qe.js.map → memory-krApkeRS.js.map} +1 -1
  25. package/dist/search/index.d.ts +2 -2
  26. package/dist/search/index.js +1 -2
  27. package/dist/{search-aZdP2685.js → search-BSGm7yxu.js} +4 -7
  28. package/dist/{search-aZdP2685.js.map → search-BSGm7yxu.js.map} +1 -1
  29. package/dist/{search-Dde0PEtY.d.ts → search-SPdjnQUo.d.ts} +2 -6
  30. package/dist/search-SPdjnQUo.d.ts.map +1 -0
  31. package/dist/{source-record-CdWvzvO6.js → source-record-9ZPRR1P9.js} +3 -4
  32. package/dist/{source-record-CdWvzvO6.js.map → source-record-9ZPRR1P9.js.map} +1 -1
  33. package/dist/{types-BekdNwGD.d.ts → types-1kNPDliG.d.ts} +1 -3
  34. package/dist/types-1kNPDliG.d.ts.map +1 -0
  35. package/dist/{types-BWV_Fvp7.d.ts → types-CznsaxVo.d.ts} +2 -4
  36. package/dist/types-CznsaxVo.d.ts.map +1 -0
  37. package/dist/viz/index.d.ts +1 -3
  38. package/dist/viz/index.d.ts.map +1 -1
  39. package/dist/viz/index.js +1 -2
  40. package/docs/compatibility.md +8 -8
  41. package/package.json +14 -14
  42. package/dist/index-BhvSH4E4.d.ts.map +0 -1
  43. package/dist/index-OAxtm6is.d.ts.map +0 -1
  44. package/dist/search-Dde0PEtY.d.ts.map +0 -1
  45. package/dist/types-BWV_Fvp7.d.ts.map +0 -1
  46. package/dist/types-BekdNwGD.d.ts.map +0 -1
package/AGENTS.md CHANGED
@@ -56,5 +56,8 @@ Do not replace missing evidence with zero or an implicit fallback.
56
56
  ## Validation
57
57
 
58
58
  Run checks relevant to changed behavior from [package.json](package.json).
59
+ For code qualification, merge `origin/main` and use the canonical local gate (the launcher performs the frozen install): `beelink-gate auto https://github.com/tangle-network/agent-knowledge.git <full-sha> -- bash -lc 'pnpm lint && pnpm typecheck && pnpm build && pnpm exec vitest run <touched-integration-files>'`. Supply the touched integration test files; build finishes before tests. Workflow and documentation changes use YAML and content checks.
60
+
61
+ The [publication qualifier](.github/workflows/qualify-publication.yml) retains packed-package and official GEPA/SkillOpt checks for every supported Eval minor with its declared Python runtime. These remain package qualification under Source delivery.
59
62
  For public package or skill changes, include the corresponding package and skill checks in development and publication qualification, not an additional source-merge ceremony.
60
63
  Keep development cases separate from final comparisons, and activate only the exact candidate that passed the decision.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 23.0.0
4
+
5
+ Peer `@tangle-network/agent-eval` `^1.0.0`. Eval 1.0.0 ships the 0.223.0 API and promises that a minor is additive, so this range admits every later 1.x release and an app no longer waits for a Knowledge release to adopt an Eval minor. The peer no longer admits Eval 0.221 or 0.222; stay on Knowledge 22 with those. Development uses agent-eval 1.0.0, and package qualification runs at the range's floor and at the development pin instead of once per Eval minor.
6
+
7
+ ## 22.0.18
8
+
9
+ Depend on zod `^4.6.6` instead of an exact version, so an app installs one zod copy. 22.0.17 was tagged but never published: its package check requires a single zod in a clean install, and this package pinned zod 4.6.7 while agent-eval 0.221.x pins 4.6.6. agent-core 0.13.3 and agent-interface 5.8.1 (agent-sdk#573) take the same range, and development uses agent-interface 5.8.1. This release ships the 22.0.17 changes.
10
+
11
+ ## 22.0.17
12
+
13
+ Admit agent-eval 0.222.x (`>=0.221.1 <0.223.0`). The 0.222.0 release was held out of every app that installs this package, because this peer range ended at 0.222.0. Development uses agent-eval 0.222.0, which pins zod 4.6.7 like this package. agent-eval 0.222.0 requires hono ^4.13.14, so that exact hono release is admitted before the three-day release age, as agent-eval admits it.
14
+
3
15
  ## 22.0.16
4
16
 
5
17
  First published release since 22.0.13. It carries the 22.0.14 and 22.0.15 changes: zod 4.6.6 (GHSA-mrhx-c7xc-m3w5) and the agent-eval peer floor 0.221.1. Neither 22.0.14 nor 22.0.15 reached npm. 22.0.15 failed qualification when 2 tests timed out on a contended shared runner. Package verification now runs on GitHub-hosted runners.
package/README.md CHANGED
@@ -14,11 +14,11 @@ pnpm add @tangle-network/agent-knowledge @tangle-network/agent-eval @tangle-netw
14
14
 
15
15
  Requires Node.js 22.12 or later and Interface 5.
16
16
 
17
- Install an Eval version that the `@tangle-network/agent-eval` peer range in [package.json](package.json) admits; all are Interface 5 releases.
18
- Package and official optimizer checks exercise each minor from that range's floor through the development pin ([compatibility](docs/compatibility.md)).
17
+ Install an Eval 1 release that the `@tangle-network/agent-eval` peer range in [package.json](package.json) admits.
18
+ Package and official optimizer checks exercise that range's floor and the development pin ([compatibility](docs/compatibility.md)).
19
+ Knowledge 22 remains the release line for Eval 0.218 through 0.222.
19
20
  Knowledge 21 remains the release line for Interface 4 and Eval 0.212.
20
21
  Knowledge 20 remains the release line for Interface 3 and Eval 0.209 through 0.211.
21
- Knowledge 22 uses Core 0.12, Trace Contract 2, and Zod 4.6.5.
22
22
  Use Knowledge 19 with Interface 2 and Eval 0.201 through 0.208, and Knowledge 17 with older Eval releases.
23
23
 
24
24
  ## Choose an API
@@ -1,2 +1,2 @@
1
- import { n as createNoopMemoryBenchmarkAdapter, t as createInMemoryBenchmarkAdapter } from "../index-OAxtm6is.js";
1
+ import { n as createNoopMemoryBenchmarkAdapter, t as createInMemoryBenchmarkAdapter } from "../index-CRg_7-ND.js";
2
2
  export { createInMemoryBenchmarkAdapter, createNoopMemoryBenchmarkAdapter };
@@ -1,2 +1 @@
1
- import { n as createNoopMemoryBenchmarkAdapter, t as createInMemoryBenchmarkAdapter } from "../benchmarks-jir3ZP-M.js";
2
- export { createInMemoryBenchmarkAdapter, createNoopMemoryBenchmarkAdapter };
1
+ export { t as createInMemoryBenchmarkAdapter, n as createNoopMemoryBenchmarkAdapter } from "../benchmarks-BMDc-9V-.js";
@@ -1,5 +1,5 @@
1
- import { n as memoryWriteResultToSourceRecord, t as memoryHitToSourceRecord } from "./source-record-CdWvzvO6.js";
2
- //#region src/benchmarks/adapters.ts
1
+ import { n as memoryWriteResultToSourceRecord, t as memoryHitToSourceRecord } from "./source-record-9ZPRR1P9.js";
2
+ // src/benchmarks/adapters.ts
3
3
  function createNoopMemoryBenchmarkAdapter(id = "no-memory") {
4
4
  return {
5
5
  id,
@@ -156,7 +156,6 @@ function renderMemoryHits(hits) {
156
156
  ].filter(Boolean).join("\n");
157
157
  }).join("\n\n");
158
158
  }
159
- //#endregion
160
159
  export { createNoopMemoryBenchmarkAdapter as n, createInMemoryBenchmarkAdapter as t };
161
160
 
162
- //# sourceMappingURL=benchmarks-jir3ZP-M.js.map
161
+ //# sourceMappingURL=benchmarks-BMDc-9V-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"benchmarks-jir3ZP-M.js","names":[],"sources":["../src/benchmarks/adapters.ts"],"sourcesContent":["import { memoryHitToSourceRecord, memoryWriteResultToSourceRecord } from '../memory/source-record'\n\nimport type {\n AgentMemoryAdapter,\n AgentMemoryHit,\n AgentMemoryScope,\n AgentMemoryWriteInput,\n} from '../memory/types'\n\nexport function createNoopMemoryBenchmarkAdapter(id = 'no-memory'): AgentMemoryAdapter {\n return {\n id,\n branchIsolation: { mode: 'scoped' },\n async search() {\n return []\n },\n async getContext(query) {\n return { query, text: '', hits: [], sourceRecords: [] }\n },\n async write(input) {\n return {\n accepted: false,\n id: input.id ?? `${id}:ignored`,\n uri: `memory://${id}/ignored`,\n kind: input.kind,\n }\n },\n async clear() {},\n async flush() {},\n }\n}\n\nexport function createInMemoryBenchmarkAdapter(options: { id?: string } = {}): AgentMemoryAdapter {\n const id = options.id ?? 'in-memory'\n const rows: Array<{\n seq: number\n input: AgentMemoryWriteInput\n hit: AgentMemoryHit\n }> = []\n let seq = 0\n const adapter: AgentMemoryAdapter = {\n id,\n branchIsolation: { mode: 'scoped' },\n async search(query, searchOptions = {}) {\n const scored = rows\n .filter((row) => memoryScopeMatches(row.input.scope, searchOptions.scope))\n .filter((row) => !searchOptions.kinds?.length || searchOptions.kinds.includes(row.hit.kind))\n .map((row) => {\n const lexical = tokenOverlap(query, row.hit.text)\n const recency = row.seq / Math.max(1, seq)\n return {\n ...row.hit,\n score: lexical + recency * 0.01,\n normalizedScore: lexical,\n }\n })\n .filter((hit) =>\n searchOptions.minScore === undefined ? true : hit.score! >= searchOptions.minScore,\n )\n .sort((a, b) => (b.score ?? 0) - (a.score ?? 0))\n return scored.slice(0, searchOptions.limit ?? 5)\n },\n async getContext(query, searchOptions = {}) {\n const hits = await adapter.search(query, searchOptions)\n return {\n query,\n hits,\n sourceRecords: hits.map((hit) =>\n memoryHitToSourceRecord(hit, { scope: searchOptions.scope }),\n ),\n text: renderMemoryHits(hits),\n }\n },\n async write(input) {\n seq += 1\n const memoryId = input.id ?? `${id}:${seq}`\n const hit: AgentMemoryHit = {\n id: memoryId,\n uri: `memory://${id}/${encodeURIComponent(memoryId)}`,\n kind: input.kind,\n text: input.text,\n title: input.title,\n score: 1,\n normalizedScore: 1,\n createdAt: input.metadata?.timestamp as string | undefined,\n metadata: {\n ...(input.metadata ?? {}),\n scope: input.scope,\n },\n }\n rows.push({ seq, input, hit })\n return {\n accepted: true,\n id: memoryId,\n uri: hit.uri,\n kind: input.kind,\n sourceRecord: memoryWriteResultToSourceRecord(\n {\n accepted: true,\n id: memoryId,\n uri: hit.uri,\n kind: input.kind,\n metadata: hit.metadata,\n },\n input.text,\n { scope: input.scope },\n ),\n metadata: hit.metadata,\n }\n },\n async clear(scope) {\n for (let index = rows.length - 1; index >= 0; index -= 1) {\n if (memoryScopeMatches(rows[index]!.input.scope, scope)) rows.splice(index, 1)\n }\n },\n async flush() {},\n }\n return adapter\n}\n\nexport function memoryEventId(hit: AgentMemoryHit): string | undefined {\n const eventId = hit.metadata?.eventId\n return typeof eventId === 'string' ? eventId : undefined\n}\n\nexport function memoryActorId(hit: AgentMemoryHit): string | undefined {\n const actorId = hit.metadata?.actorId\n return typeof actorId === 'string' ? actorId : undefined\n}\n\nfunction memoryScopeMatches(stored?: AgentMemoryScope, requested?: AgentMemoryScope): boolean {\n if (!requested) return true\n if (requested.tenantId !== undefined && stored?.tenantId !== requested.tenantId) return false\n if (requested.userId !== undefined && stored?.userId !== requested.userId) return false\n if (requested.agentId !== undefined && stored?.agentId !== requested.agentId) return false\n if (requested.teamId !== undefined && stored?.teamId !== requested.teamId) return false\n if (requested.runId !== undefined && stored?.runId !== requested.runId) return false\n if (requested.sessionId !== undefined && stored?.sessionId !== requested.sessionId) return false\n if (requested.namespace !== undefined && stored?.namespace !== requested.namespace) return false\n for (const [key, value] of Object.entries(requested.tags ?? {})) {\n if (stored?.tags?.[key] !== value) return false\n }\n return true\n}\n\nfunction tokenOverlap(query: string, text: string): number {\n const queryTokens = new Set(tokenize(query))\n if (queryTokens.size === 0) return 0\n const textTokens = new Set(tokenize(text))\n let matched = 0\n for (const token of queryTokens) {\n if (textTokens.has(token)) matched += 1\n }\n return matched / queryTokens.size\n}\n\nfunction tokenize(text: string): string[] {\n const stop = new Set([\n 'the',\n 'and',\n 'for',\n 'this',\n 'that',\n 'with',\n 'what',\n 'should',\n 'agent',\n 'user',\n 'current',\n 'now',\n 'use',\n ])\n return text\n .toLowerCase()\n .split(/[^a-z0-9/]+/)\n .filter((token) => token.length > 2 && !stop.has(token))\n}\n\nfunction renderMemoryHits(hits: readonly AgentMemoryHit[]): string {\n return hits\n .map((hit, index) => {\n const eventId = memoryEventId(hit)\n const actorId = memoryActorId(hit)\n return [\n `[${index + 1}] ${hit.title ?? hit.id}`,\n eventId ? `event=${eventId}` : '',\n actorId ? `actor=${actorId}` : '',\n hit.text,\n ]\n .filter(Boolean)\n .join('\\n')\n })\n .join('\\n\\n')\n}\n"],"mappings":";;AASA,SAAgB,iCAAiC,KAAK,aAAiC;CACrF,OAAO;EACL;EACA,iBAAiB,EAAE,MAAM,SAAS;EAClC,MAAM,SAAS;GACb,OAAO,CAAC;EACV;EACA,MAAM,WAAW,OAAO;GACtB,OAAO;IAAE;IAAO,MAAM;IAAI,MAAM,CAAC;IAAG,eAAe,CAAC;GAAE;EACxD;EACA,MAAM,MAAM,OAAO;GACjB,OAAO;IACL,UAAU;IACV,IAAI,MAAM,MAAM,GAAG,GAAG;IACtB,KAAK,YAAY,GAAG;IACpB,MAAM,MAAM;GACd;EACF;EACA,MAAM,QAAQ,CAAC;EACf,MAAM,QAAQ,CAAC;CACjB;AACF;AAEA,SAAgB,+BAA+B,UAA2B,CAAC,GAAuB;CAChG,MAAM,KAAK,QAAQ,MAAM;CACzB,MAAM,OAID,CAAC;CACN,IAAI,MAAM;CACV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KAAA,KAAa,QAAQ,cAAc,UAAU,WAAW,OAAO;CAC3F,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,QAAQ,CAAC,CAAC,GAC5D,IAAI,QAAQ,OAAO,SAAS,OAAO,OAAO;CAE5C,OAAO;AACT;AAEA,SAAS,aAAa,OAAe,MAAsB;CACzD,MAAM,cAAc,IAAI,IAAI,SAAS,KAAK,CAAC;CAC3C,IAAI,YAAY,SAAS,GAAG,OAAO;CACnC,MAAM,aAAa,IAAI,IAAI,SAAS,IAAI,CAAC;CACzC,IAAI,UAAU;CACd,KAAK,MAAM,SAAS,aAClB,IAAI,WAAW,IAAI,KAAK,GAAG,WAAW;CAExC,OAAO,UAAU,YAAY;AAC/B;AAEA,SAAS,SAAS,MAAwB;CACxC,MAAM,uBAAO,IAAI,IAAI;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,KACJ,YAAY,CAAC,CACb,MAAM,aAAa,CAAC,CACpB,QAAQ,UAAU,MAAM,SAAS,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC;AAC3D;AAEA,SAAS,iBAAiB,MAAyC;CACjE,OAAO,KACJ,KAAK,KAAK,UAAU;EACnB,MAAM,UAAU,cAAc,GAAG;EACjC,MAAM,UAAU,cAAc,GAAG;EACjC,OAAO;GACL,IAAI,QAAQ,EAAE,IAAI,IAAI,SAAS,IAAI;GACnC,UAAU,SAAS,YAAY;GAC/B,UAAU,SAAS,YAAY;GAC/B,IAAI;EACN,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;CACd,CAAC,CAAC,CACD,KAAK,MAAM;AAChB"}
1
+ {"version":3,"file":"benchmarks-BMDc-9V-.js","names":[],"sources":["../src/benchmarks/adapters.ts"],"sourcesContent":["import { memoryHitToSourceRecord, memoryWriteResultToSourceRecord } from '../memory/source-record'\n\nimport type {\n AgentMemoryAdapter,\n AgentMemoryHit,\n AgentMemoryScope,\n AgentMemoryWriteInput,\n} from '../memory/types'\n\nexport function createNoopMemoryBenchmarkAdapter(id = 'no-memory'): AgentMemoryAdapter {\n return {\n id,\n branchIsolation: { mode: 'scoped' },\n async search() {\n return []\n },\n async getContext(query) {\n return { query, text: '', hits: [], sourceRecords: [] }\n },\n async write(input) {\n return {\n accepted: false,\n id: input.id ?? `${id}:ignored`,\n uri: `memory://${id}/ignored`,\n kind: input.kind,\n }\n },\n async clear() {},\n async flush() {},\n }\n}\n\nexport function createInMemoryBenchmarkAdapter(options: { id?: string } = {}): AgentMemoryAdapter {\n const id = options.id ?? 'in-memory'\n const rows: Array<{\n seq: number\n input: AgentMemoryWriteInput\n hit: AgentMemoryHit\n }> = []\n let seq = 0\n const adapter: AgentMemoryAdapter = {\n id,\n branchIsolation: { mode: 'scoped' },\n async search(query, searchOptions = {}) {\n const scored = rows\n .filter((row) => memoryScopeMatches(row.input.scope, searchOptions.scope))\n .filter((row) => !searchOptions.kinds?.length || searchOptions.kinds.includes(row.hit.kind))\n .map((row) => {\n const lexical = tokenOverlap(query, row.hit.text)\n const recency = row.seq / Math.max(1, seq)\n return {\n ...row.hit,\n score: lexical + recency * 0.01,\n normalizedScore: lexical,\n }\n })\n .filter((hit) =>\n searchOptions.minScore === undefined ? true : hit.score! >= searchOptions.minScore,\n )\n .sort((a, b) => (b.score ?? 0) - (a.score ?? 0))\n return scored.slice(0, searchOptions.limit ?? 5)\n },\n async getContext(query, searchOptions = {}) {\n const hits = await adapter.search(query, searchOptions)\n return {\n query,\n hits,\n sourceRecords: hits.map((hit) =>\n memoryHitToSourceRecord(hit, { scope: searchOptions.scope }),\n ),\n text: renderMemoryHits(hits),\n }\n },\n async write(input) {\n seq += 1\n const memoryId = input.id ?? `${id}:${seq}`\n const hit: AgentMemoryHit = {\n id: memoryId,\n uri: `memory://${id}/${encodeURIComponent(memoryId)}`,\n kind: input.kind,\n text: input.text,\n title: input.title,\n score: 1,\n normalizedScore: 1,\n createdAt: input.metadata?.timestamp as string | undefined,\n metadata: {\n ...(input.metadata ?? {}),\n scope: input.scope,\n },\n }\n rows.push({ seq, input, hit })\n return {\n accepted: true,\n id: memoryId,\n uri: hit.uri,\n kind: input.kind,\n sourceRecord: memoryWriteResultToSourceRecord(\n {\n accepted: true,\n id: memoryId,\n uri: hit.uri,\n kind: input.kind,\n metadata: hit.metadata,\n },\n input.text,\n { scope: input.scope },\n ),\n metadata: hit.metadata,\n }\n },\n async clear(scope) {\n for (let index = rows.length - 1; index >= 0; index -= 1) {\n if (memoryScopeMatches(rows[index]!.input.scope, scope)) rows.splice(index, 1)\n }\n },\n async flush() {},\n }\n return adapter\n}\n\nexport function memoryEventId(hit: AgentMemoryHit): string | undefined {\n const eventId = hit.metadata?.eventId\n return typeof eventId === 'string' ? eventId : undefined\n}\n\nexport function memoryActorId(hit: AgentMemoryHit): string | undefined {\n const actorId = hit.metadata?.actorId\n return typeof actorId === 'string' ? actorId : undefined\n}\n\nfunction memoryScopeMatches(stored?: AgentMemoryScope, requested?: AgentMemoryScope): boolean {\n if (!requested) return true\n if (requested.tenantId !== undefined && stored?.tenantId !== requested.tenantId) return false\n if (requested.userId !== undefined && stored?.userId !== requested.userId) return false\n if (requested.agentId !== undefined && stored?.agentId !== requested.agentId) return false\n if (requested.teamId !== undefined && stored?.teamId !== requested.teamId) return false\n if (requested.runId !== undefined && stored?.runId !== requested.runId) return false\n if (requested.sessionId !== undefined && stored?.sessionId !== requested.sessionId) return false\n if (requested.namespace !== undefined && stored?.namespace !== requested.namespace) return false\n for (const [key, value] of Object.entries(requested.tags ?? {})) {\n if (stored?.tags?.[key] !== value) return false\n }\n return true\n}\n\nfunction tokenOverlap(query: string, text: string): number {\n const queryTokens = new Set(tokenize(query))\n if (queryTokens.size === 0) return 0\n const textTokens = new Set(tokenize(text))\n let matched = 0\n for (const token of queryTokens) {\n if (textTokens.has(token)) matched += 1\n }\n return matched / queryTokens.size\n}\n\nfunction tokenize(text: string): string[] {\n const stop = new Set([\n 'the',\n 'and',\n 'for',\n 'this',\n 'that',\n 'with',\n 'what',\n 'should',\n 'agent',\n 'user',\n 'current',\n 'now',\n 'use',\n ])\n return text\n .toLowerCase()\n .split(/[^a-z0-9/]+/)\n .filter((token) => token.length > 2 && !stop.has(token))\n}\n\nfunction renderMemoryHits(hits: readonly AgentMemoryHit[]): string {\n return hits\n .map((hit, index) => {\n const eventId = memoryEventId(hit)\n const actorId = memoryActorId(hit)\n return [\n `[${index + 1}] ${hit.title ?? hit.id}`,\n eventId ? `event=${eventId}` : '',\n actorId ? `actor=${actorId}` : '',\n hit.text,\n ]\n .filter(Boolean)\n .join('\\n')\n })\n .join('\\n\\n')\n}\n"],"mappings":";;AASA,SAAgB,iCAAiC,KAAK,aAAiC;CACrF,OAAO;EACL;EACA,iBAAiB,EAAE,MAAM,SAAS;EAClC,MAAM,SAAS;GACb,OAAO,CAAC;EACV;EACA,MAAM,WAAW,OAAO;GACtB,OAAO;IAAE;IAAO,MAAM;IAAI,MAAM,CAAC;IAAG,eAAe,CAAC;GAAE;EACxD;EACA,MAAM,MAAM,OAAO;GACjB,OAAO;IACL,UAAU;IACV,IAAI,MAAM,MAAM,GAAG,GAAG;IACtB,KAAK,YAAY,GAAG;IACpB,MAAM,MAAM;GACd;EACF;EACA,MAAM,QAAQ,CAAC;EACf,MAAM,QAAQ,CAAC;CACjB;AACF;AAEA,SAAgB,+BAA+B,UAA2B,CAAC,GAAuB;CAChG,MAAM,KAAK,QAAQ,MAAM;CACzB,MAAM,OAID,CAAC;CACN,IAAI,MAAM;CACV,MAAM,UAA8B;EAClC;EACA,iBAAiB,EAAE,MAAM,SAAS;EAClC,MAAM,OAAO,OAAO,gBAAgB,CAAC,GAAG;GAiBtC,OAhBe,KACZ,QAAQ,QAAQ,mBAAmB,IAAI,MAAM,OAAO,cAAc,KAAK,CAAC,CAAC,CACzE,QAAQ,QAAQ,CAAC,cAAc,OAAO,UAAU,cAAc,MAAM,SAAS,IAAI,IAAI,IAAI,CAAC,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AAI,YAAY,SAAS,GAAG,OAAO;CACnC,MAAM,aAAa,IAAI,IAAI,SAAS,IAAI,CAAC;CACzC,IAAI,UAAU;CACd,KAAK,MAAM,SAAS,aAClB,IAAI,WAAW,IAAI,KAAK,GAAG,WAAW;CAExC,OAAO,UAAU,YAAY;AAC/B;AAEA,SAAS,SAAS,MAAwB;CACxC,MAAM,uBAAO,IAAI,IAAI;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,KACJ,YAAY,CAAC,CACb,MAAM,aAAa,CAAC,CACpB,QAAQ,UAAU,MAAM,SAAS,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC;AAC3D;AAEA,SAAS,iBAAiB,MAAyC;CACjE,OAAO,KACJ,KAAK,KAAK,UAAU;EACnB,MAAM,UAAU,cAAc,GAAG;EACjC,MAAM,UAAU,cAAc,GAAG;EACjC,OAAO;GACL,IAAI,QAAQ,EAAE,IAAI,IAAI,SAAS,IAAI;GACnC,UAAU,SAAS,YAAY;GAC/B,UAAU,SAAS,YAAY;GAC/B,IAAI;EACN,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;CACd,CAAC,CAAC,CACD,KAAK,MAAM;AAChB"}
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { $ as loadSourceRegistry, Mt as layoutFor, Ot as initKnowledgeBase, R as validateKnowledgeIndex, X as writeKnowledgeIndex, Z as addSourcePath, a as applyKnowledgeWriteBlocksFile, n as inspectKnowledgeIndex, t as explainKnowledgeTarget, z as lintKnowledgeIndex } from "./inspect-rXk5_r3K.js";
3
- import { r as searchKnowledge } from "./search-aZdP2685.js";
2
+ import { $ as loadSourceRegistry, Mt as layoutFor, Ot as initKnowledgeBase, R as validateKnowledgeIndex, X as writeKnowledgeIndex, Z as addSourcePath, a as applyKnowledgeWriteBlocksFile, n as inspectKnowledgeIndex, t as explainKnowledgeTarget, z as lintKnowledgeIndex } from "./inspect-tl0P7I7w.js";
3
+ import { r as searchKnowledge } from "./search-BSGm7yxu.js";
4
4
  import { detectKnowledgeGaps, findSurprisingConnections, toKnowledgeVizGraph } from "./viz/index.js";
5
5
  import { existsSync, readFileSync } from "node:fs";
6
6
  import { join, resolve } from "node:path";
7
- //#region src/cli.ts
7
+ // src/cli.ts
8
8
  function parseArgs(argv) {
9
9
  const [command, ...rest] = argv;
10
10
  const positional = [];
@@ -251,7 +251,6 @@ main().then((code) => process.exit(code)).catch((err) => {
251
251
  process.stderr.write(`agent-knowledge error: ${err instanceof Error ? err.stack ?? err.message : String(err)}\n`);
252
252
  process.exit(1);
253
253
  });
254
- //#endregion
255
254
  export {};
256
255
 
257
256
  //# sourceMappingURL=cli.js.map
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- //#region src/ids.ts
2
+ // src/ids.ts
3
3
  function sha256(text) {
4
4
  return createHash("sha256").update(text).digest("hex");
5
5
  }
@@ -13,7 +13,6 @@ function stableId(prefix, content) {
13
13
  function textSourceId(uri, contentHash) {
14
14
  return stableId("src", `${contentHash}:${uri}`);
15
15
  }
16
- //#endregion
17
16
  export { textSourceId as i, slugify as n, stableId as r, sha256 as t };
18
17
 
19
- //# sourceMappingURL=ids-Bevz_pXV.js.map
18
+ //# sourceMappingURL=ids-C-Z2Uv4c.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ids-Bevz_pXV.js","names":[],"sources":["../src/ids.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\n\nexport function sha256(text: string): string {\n return createHash('sha256').update(text).digest('hex')\n}\n\nexport function slugify(input: string): string {\n const out = input\n .trim()\n .toLowerCase()\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/[^a-z0-9\\u4e00-\\u9fff]+/g, '-')\n .replace(/^-+|-+$/g, '')\n return out || 'untitled'\n}\n\nexport function stableId(prefix: string, content: string): string {\n return `${prefix}_${sha256(content).slice(0, 16)}`\n}\n\n/** Canonical registry id for exact text submitted at one original URI. */\nexport function textSourceId(uri: string, contentHash: string): string {\n return stableId('src', `${contentHash}:${uri}`)\n}\n"],"mappings":";;AAEA,SAAgB,OAAO,MAAsB;CAC3C,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK;AACvD;AAEA,SAAgB,QAAQ,OAAuB;CAQ7C,OAPY,MACT,KAAK,CAAC,CACN,YAAY,CAAC,CACb,UAAU,MAAM,CAAC,CACjB,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,QAAQ,4BAA4B,GAAG,CAAC,CACxC,QAAQ,YAAY,EACd,KAAK;AAChB;AAEA,SAAgB,SAAS,QAAgB,SAAyB;CAChE,OAAO,GAAG,OAAO,GAAG,OAAO,OAAO,CAAC,CAAC,MAAM,GAAG,EAAE;AACjD;;AAGA,SAAgB,aAAa,KAAa,aAA6B;CACrE,OAAO,SAAS,OAAO,GAAG,YAAY,GAAG,KAAK;AAChD"}
1
+ {"version":3,"file":"ids-C-Z2Uv4c.js","names":[],"sources":["../src/ids.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\n\nexport function sha256(text: string): string {\n return createHash('sha256').update(text).digest('hex')\n}\n\nexport function slugify(input: string): string {\n const out = input\n .trim()\n .toLowerCase()\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/[^a-z0-9\\u4e00-\\u9fff]+/g, '-')\n .replace(/^-+|-+$/g, '')\n return out || 'untitled'\n}\n\nexport function stableId(prefix: string, content: string): string {\n return `${prefix}_${sha256(content).slice(0, 16)}`\n}\n\n/** Canonical registry id for exact text submitted at one original URI. */\nexport function textSourceId(uri: string, contentHash: string): string {\n return stableId('src', `${contentHash}:${uri}`)\n}\n"],"mappings":";;AAEA,SAAgB,OAAO,MAAsB;CAC3C,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK;AACvD;AAEA,SAAgB,QAAQ,OAAuB;CAQ7C,OAPY,MACT,KAAK,CAAC,CACN,YAAY,CAAC,CACb,UAAU,MAAM,CAAC,CACjB,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,QAAQ,4BAA4B,GAAG,CAAC,CACxC,QAAQ,YAAY,EACd,KAAK;AAChB;AAEA,SAAgB,SAAS,QAAgB,SAAyB;CAChE,OAAO,GAAG,OAAO,GAAG,OAAO,OAAO,CAAC,CAAC,MAAM,GAAG,EAAE;AACjD;;AAGA,SAAgB,aAAa,KAAa,aAA6B;CACrE,OAAO,SAAS,OAAO,GAAG,YAAY,GAAG,KAAK;AAChD"}
@@ -1,13 +1,10 @@
1
- import { k as SourceRecord } from "./types-BekdNwGD.js";
2
- import { c as AgentMemoryWriteInput, d as RetrievalHoldoutCallContext, f as RetrievalHoldoutConfig, h as RetrievalHoldoutResult, i as AgentMemoryHit, l as AgentMemoryWriteResult, m as RetrievalHoldoutEvent, o as AgentMemoryScope, r as AgentMemoryContext, s as AgentMemorySearchOptions, t as AgentMemoryAdapter, u as RetrievalHoldoutBypassReason } from "./types-BWV_Fvp7.js";
1
+ import { k as SourceRecord } from "./types-1kNPDliG.js";
2
+ import { c as AgentMemoryWriteInput, d as RetrievalHoldoutCallContext, f as RetrievalHoldoutConfig, h as RetrievalHoldoutResult, i as AgentMemoryHit, l as AgentMemoryWriteResult, m as RetrievalHoldoutEvent, o as AgentMemoryScope, r as AgentMemoryContext, s as AgentMemorySearchOptions, t as AgentMemoryAdapter, u as RetrievalHoldoutBypassReason } from "./types-CznsaxVo.js";
3
3
  import { ToolDefinition } from "@tangle-network/agent-interface";
4
4
  import { z } from "zod";
5
5
  import { OffPolicyTrajectory } from "@tangle-network/agent-eval/rl";
6
- //#region src/memory/adapter.d.ts
7
6
  declare function defaultGetMemoryContext(adapter: Pick<AgentMemoryAdapter, 'search'>, query: string, options?: AgentMemorySearchOptions): Promise<AgentMemoryContext>;
8
7
  declare function renderMemoryContext(hits: AgentMemoryHit[]): string;
9
- //#endregion
10
- //#region src/memory/branch.d.ts
11
8
  type AgentMemoryVisibility = 'private' | 'team' | 'shared';
12
9
  type AgentMemoryBranchLifetime = 'resumable' | 'attempt';
13
10
  interface AgentMemorySharingPolicy {
@@ -71,8 +68,6 @@ interface ForkAgentMemoryBranchSnapshotOptions {
71
68
  declare function createAgentMemoryBranch(options: CreateAgentMemoryBranchOptions): AgentMemoryBranch;
72
69
  /** Replays a durable journal into a fresh provider branch. */
73
70
  declare function forkAgentMemoryBranchSnapshot(options: ForkAgentMemoryBranchSnapshotOptions): Promise<AgentMemoryBranch>;
74
- //#endregion
75
- //#region src/memory/graphiti.d.ts
76
71
  interface GraphitiMcpClientLike {
77
72
  callTool(request: {
78
73
  name: string;
@@ -106,8 +101,6 @@ declare function createGraphitiMemoryAdapter(options: GraphitiMemoryAdapterOptio
106
101
  declare function graphitiMemoryAdapterIdentity(options: Pick<GraphitiMemoryAdapterOptions, 'id' | 'consistency' | 'ingestionTimeoutMs' | 'pollIntervalMs' | 'episodeScanLimit' | 'provenanceEpisodeLimit' | 'search' | 'toolNames' | 'defaultScope'> & {
107
102
  backendRef: string;
108
103
  }): string;
109
- //#endregion
110
- //#region src/memory/hindsight.d.ts
111
104
  /** Transport owns endpoint selection and authentication; paths are always bank-bound here. */
112
105
  interface HindsightClientLike {
113
106
  request(input: {
@@ -145,8 +138,6 @@ declare function hindsightMemoryBankId(input: {
145
138
  }): string;
146
139
  /** Hindsight 0.10.2 adapter. Snapshots remain accepted-input journals, never provider database snapshots. */
147
140
  declare function createHindsightMemoryAdapter(options: HindsightMemoryAdapterOptions): AgentMemoryAdapter;
148
- //#endregion
149
- //#region src/memory/holdout.d.ts
150
141
  /**
151
142
  * Deterministic uniform [0,1) for assignment draws. The sha256 key derivation is ours — it makes
152
143
  * every draw replayable from the logged keys alone (design rule D5) — while the generator core is
@@ -271,8 +262,6 @@ interface RetrievalHoldoutOffPolicyResult {
271
262
  * trajectories and surfaced in `excluded` for analysis.
272
263
  */
273
264
  declare function toOffPolicyTrajectory(events: RetrievalHoldoutEvent[], options: RetrievalHoldoutOffPolicyOptions): RetrievalHoldoutOffPolicyResult;
274
- //#endregion
275
- //#region src/memory/lifecycle.d.ts
276
265
  declare const DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS = 180000;
277
266
  declare class AgentMemoryLifecycleTimeoutError extends Error {
278
267
  readonly operation: string;
@@ -303,8 +292,6 @@ declare function sleepForMemoryRecovery(delayMs: number, assertOwned: () => Prom
303
292
  declare function createMemoryExecutionPool(limit: number): {
304
293
  run<T>(operation: () => Promise<T>): Promise<T>;
305
294
  };
306
- //#endregion
307
- //#region src/memory/mem0.d.ts
308
295
  type Mem0ClientMode = 'hosted' | 'oss';
309
296
  interface Mem0Message {
310
297
  role: 'user' | 'assistant';
@@ -384,8 +371,6 @@ declare function createMem0MemoryAdapter(options: Mem0MemoryAdapterOptions): Age
384
371
  declare function mem0MemoryAdapterIdentity(options: Pick<Mem0MemoryAdapterOptions, 'mode' | 'id' | 'appId' | 'infer' | 'rerank' | 'latestOnly' | 'ingestionTimeoutMs' | 'pollIntervalMs' | 'defaultScope'> & {
385
372
  backendRef: string;
386
373
  }): string;
387
- //#endregion
388
- //#region src/memory/neo4j.d.ts
389
374
  interface Neo4jAgentMemoryAdapterOptions {
390
375
  client: object;
391
376
  /** Match the transport passed to the official MemoryClient. */
@@ -397,8 +382,6 @@ interface Neo4jAgentMemoryAdapterOptions {
397
382
  branchId?: string;
398
383
  }
399
384
  declare function createNeo4jAgentMemoryAdapter(options: Neo4jAgentMemoryAdapterOptions): AgentMemoryAdapter;
400
- //#endregion
401
- //#region src/memory/schemas.d.ts
402
385
  declare const AgentMemoryKindSchema: z.ZodEnum<{
403
386
  entity: "entity";
404
387
  fact: "fact";
@@ -475,8 +458,6 @@ declare const AgentMemoryWriteInputSchema: z.ZodObject<{
475
458
  }, z.core.$strip>>;
476
459
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
477
460
  }, z.core.$strip>;
478
- //#endregion
479
- //#region src/memory/source-record.d.ts
480
461
  declare function memoryHitToSourceRecord(hit: AgentMemoryHit, options?: {
481
462
  now?: () => Date;
482
463
  scope?: AgentMemoryScope;
@@ -485,8 +466,6 @@ declare function memoryWriteResultToSourceRecord(result: AgentMemoryWriteResult,
485
466
  now?: () => Date;
486
467
  scope?: AgentMemoryScope;
487
468
  }): SourceRecord;
488
- //#endregion
489
- //#region src/memory/tools.d.ts
490
469
  interface PlayMemoryRetrievalReceipt {
491
470
  branchId: string;
492
471
  adapterId: string;
@@ -507,6 +486,5 @@ interface CreatePlayMemoryToolsOptions {
507
486
  maxResults?: number;
508
487
  }
509
488
  declare function createPlayMemoryTools(options: CreatePlayMemoryToolsOptions): ToolDefinition[];
510
- //#endregion
511
489
  export { AgentMemoryVisibility as $, RetrievalHoldoutSessionSummary as A, HindsightOperationUnknownError as B, createMemoryExecutionPool as C, sleepForMemoryRecovery as D, runBoundedMemoryLifecycle as E, resetRetrievalHoldoutRegistry as F, GraphitiToolNames as G, hindsightMemoryBankId as H, retrievalHoldoutConfigHash as I, AgentMemoryBranch as J, createGraphitiMemoryAdapter as K, toOffPolicyTrajectory as L, applySessionStickyRetrievalHoldout as M, deterministicRng as N, RetrievalHoldoutOffPolicyOptions as O, emitRetrievalHoldoutBypass as P, AgentMemorySharingPolicy as Q, HindsightClientLike as R, DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS as S, resolveMemoryCleanupTimeoutMs as T, GraphitiMcpClientLike as U, createHindsightMemoryAdapter as V, GraphitiMemoryAdapterOptions as W, AgentMemoryBranchSnapshot as X, AgentMemoryBranchLifetime as Y, AgentMemoryJournalEntry as Z, Mem0OssMemoryAdapterOptions as _, memoryWriteResultToSourceRecord as a, renderMemoryContext as at, AgentMemoryLifecycleTimeoutError as b, AgentMemoryScopeSchema as c, createNeo4jAgentMemoryAdapter as d, CreateAgentMemoryBranchOptions as et, Mem0ClientMode as f, Mem0OssClient as g, Mem0MemoryAdapterOptions as h, memoryHitToSourceRecord as i, defaultGetMemoryContext as it, applyRetrievalHoldout as j, RetrievalHoldoutOffPolicyResult as k, AgentMemoryWriteInputSchema as l, Mem0HostedMemoryAdapterOptions as m, PlayMemoryRetrievalReceipt as n, createAgentMemoryBranch as nt, AgentMemoryHitSchema as o, Mem0HostedClient as p, graphitiMemoryAdapterIdentity as q, createPlayMemoryTools as r, forkAgentMemoryBranchSnapshot as rt, AgentMemoryKindSchema as s, CreatePlayMemoryToolsOptions as t, ForkAgentMemoryBranchSnapshotOptions as tt, Neo4jAgentMemoryAdapterOptions as u, createMem0MemoryAdapter as v, memoryRecoveryDelayMs as w, AgentMemoryLifecycleUnsafeError as x, mem0MemoryAdapterIdentity as y, HindsightMemoryAdapterOptions as z };
512
- //# sourceMappingURL=index-BhvSH4E4.d.ts.map
490
+ //# sourceMappingURL=index-B2s20NlV.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-B2s20NlV.d.ts","names":[],"sources":["../src/memory/adapter.ts","../src/memory/branch.ts","../src/memory/graphiti.ts","../src/memory/hindsight.ts","../src/memory/holdout.ts","../src/memory/lifecycle.ts","../src/memory/mem0.ts","../src/memory/neo4j.ts","../src/memory/schemas.ts","../src/memory/source-record.ts","../src/memory/tools.ts"],"mappings":";;;;;iBASsB,wBACpB,SAAS,KAAK,+BACd,eACA,UAAS,2BACR,QAAQ;iBAoBK,oBAAoB,MAAM;KCtB9B;KACA;UAEK;EACf,eAAe;EACf,OAAO;;UAGQ;EACf;EACA,OAAO;EACP,QAAQ;;UAGO;EACf;EACA,UAAU;EACV;EACA;EACA,QAAQ;EACR,WAAW;EACX,kBAAkB;EAClB;;UAGe,0BAA0B;WAChC;WACA,UAAU;WACV;WACA,QAAQ;EACjB,YAAY,QAAQ;EACpB,KAAK;IACH;IACA,UAAU;IACV,SAAS;IACT,YAAY;IACZ,WAAW;MACT,QAAQ;;UAGG;EACf,SAAS;EACT;EACA;EACA,SAAS;EACT,YAAY;;EAEZ,W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,EAAA,KAAA;cAEW,6BAA2B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAetC,EAAA,KAAA;iBChDc,wBACd,KAAK,gBACL;EAAW,YAAY;EAAM,QAAQ;IACpC;iBAyBa,gCACd,QAAQ,wBACR,cACA;EAAW,YAAY;EAAM,QAAQ;IACpC;UC5Bc;EACf;EACA;EACA;EACA;EACA,SAAS;EACT;;UAGe;EACf,QAAQ;EACR;;EAEA,aAAa,UAAU,4BAA4B;EACnD,iBAAiB,SAAS,6BAA6B;;EAEvD;EACA;EACA;;iBAYc,sBAAsB,SAAS,+BAA+B"}
@@ -1,9 +1,7 @@
1
- import { t as AgentMemoryAdapter } from "./types-BWV_Fvp7.js";
2
- //#region src/benchmarks/adapters.d.ts
1
+ import { t as AgentMemoryAdapter } from "./types-CznsaxVo.js";
3
2
  declare function createNoopMemoryBenchmarkAdapter(id?: string): AgentMemoryAdapter;
4
3
  declare function createInMemoryBenchmarkAdapter(options?: {
5
4
  id?: string;
6
5
  }): AgentMemoryAdapter;
7
- //#endregion
8
6
  export { createNoopMemoryBenchmarkAdapter as n, createInMemoryBenchmarkAdapter as t };
9
- //# sourceMappingURL=index-OAxtm6is.d.ts.map
7
+ //# sourceMappingURL=index-CRg_7-ND.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CRg_7-ND.d.ts","names":[],"sources":["../src/benchmarks/adapters.ts"],"mappings":";iBASgB,iCAAiC,cAAmB;iBAuBpD,+BAA+B;EAAW;IAAqB"}