@tangle-network/agent-knowledge 17.1.10 → 18.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.
@@ -1,3 +1,3 @@
1
- import { C as deterministicRng, D as toOffPolicyTrajectory, E as retrievalHoldoutConfigHash, S as applySessionStickyRetrievalHoldout, T as resetRetrievalHoldoutRegistry, _ as createAgentMemoryBranch, a as createNeo4jAgentMemoryAdapter, b as renderMemoryContext, c as runAgentMemoryImprovement, d as compareAgentMemoryLearning, f as runAgentMemoryLearningExperiment, g as buildAgentMemorySequencesFromBenchmarkCases, h as buildAgentMemorySequenceScenarios, i as AgentMemoryWriteInputSchema, l as createGraphitiMemoryAdapter, m as agentMemorySequenceJudge, n as AgentMemoryKindSchema, o as createMem0MemoryAdapter, p as runAgentMemoryExperiment, r as AgentMemoryScopeSchema, s as mem0MemoryAdapterIdentity, t as AgentMemoryHitSchema, u as graphitiMemoryAdapterIdentity, v as forkAgentMemoryBranchSnapshot, w as emitRetrievalHoldoutBypass, x as applyRetrievalHoldout, y as defaultGetMemoryContext } from "../memory-Bn1Xs1hY.js";
1
+ import { C as deterministicRng, D as toOffPolicyTrajectory, E as retrievalHoldoutConfigHash, S as applySessionStickyRetrievalHoldout, T as resetRetrievalHoldoutRegistry, _ as createAgentMemoryBranch, a as createNeo4jAgentMemoryAdapter, b as renderMemoryContext, c as runAgentMemoryImprovement, d as compareAgentMemoryLearning, f as runAgentMemoryLearningExperiment, g as buildAgentMemorySequencesFromBenchmarkCases, h as buildAgentMemorySequenceScenarios, i as AgentMemoryWriteInputSchema, l as createGraphitiMemoryAdapter, m as agentMemorySequenceJudge, n as AgentMemoryKindSchema, o as createMem0MemoryAdapter, p as runAgentMemoryExperiment, r as AgentMemoryScopeSchema, s as mem0MemoryAdapterIdentity, t as AgentMemoryHitSchema, u as graphitiMemoryAdapterIdentity, v as forkAgentMemoryBranchSnapshot, w as emitRetrievalHoldoutBypass, x as applyRetrievalHoldout, y as defaultGetMemoryContext } from "../memory-BYWNir2t.js";
2
2
  import { C as sleepForMemoryRecovery, S as runBoundedMemoryLifecycle, U as memoryHitToSourceRecord, W as memoryWriteResultToSourceRecord, b as memoryRecoveryDelayMs, f as acquireAgentMemoryRunLease, h as DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS, m as AgentMemoryLifecycleUnsafeError, p as AgentMemoryLifecycleTimeoutError, x as resolveMemoryCleanupTimeoutMs, y as createMemoryExecutionPool } from "../benchmarks-B3kU-Yxz.js";
3
3
  export { AgentMemoryHitSchema, AgentMemoryKindSchema, AgentMemoryLifecycleTimeoutError, AgentMemoryLifecycleUnsafeError, AgentMemoryScopeSchema, AgentMemoryWriteInputSchema, DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS, acquireAgentMemoryRunLease, agentMemorySequenceJudge, applyRetrievalHoldout, applySessionStickyRetrievalHoldout, buildAgentMemorySequenceScenarios, buildAgentMemorySequencesFromBenchmarkCases, compareAgentMemoryLearning, createAgentMemoryBranch, createGraphitiMemoryAdapter, createMem0MemoryAdapter, createMemoryExecutionPool, createNeo4jAgentMemoryAdapter, defaultGetMemoryContext, deterministicRng, emitRetrievalHoldoutBypass, forkAgentMemoryBranchSnapshot, graphitiMemoryAdapterIdentity, mem0MemoryAdapterIdentity, memoryHitToSourceRecord, memoryRecoveryDelayMs, memoryWriteResultToSourceRecord, renderMemoryContext, resetRetrievalHoldoutRegistry, resolveMemoryCleanupTimeoutMs, retrievalHoldoutConfigHash, runAgentMemoryExperiment, runAgentMemoryImprovement, runAgentMemoryLearningExperiment, runBoundedMemoryLifecycle, sleepForMemoryRecovery, toOffPolicyTrajectory };
@@ -1274,7 +1274,7 @@ function agentMemorySequenceJudge() {
1274
1274
  //#region src/memory/experiment/metrics.ts
1275
1275
  function rankAgentMemoryExperiment(candidates, scenarios, campaign, costByCandidate) {
1276
1276
  const scenarioById = new Map(scenarios.map((scenario) => [scenario.id, scenario]));
1277
- return rankCandidates(candidates.map((candidate) => {
1277
+ const rows = candidates.map((candidate) => {
1278
1278
  const candidateScenarios = scenarios.filter((scenario) => scenario.candidateId === candidate.id);
1279
1279
  const cells = campaign.cells.filter((cell) => scenarioById.get(cell.scenarioId)?.candidateId === candidate.id);
1280
1280
  const successful = cells.filter((cell) => !cell.error && cell.artifact);
@@ -1293,7 +1293,8 @@ function rankAgentMemoryExperiment(candidates, scenarios, campaign, costByCandid
1293
1293
  durationMs: cells.reduce((sum, cell) => sum + cell.durationMs, 0),
1294
1294
  dimensions: meanDimensions(dimensionRows)
1295
1295
  };
1296
- }));
1296
+ });
1297
+ return rankCandidates(rows);
1297
1298
  }
1298
1299
  function memoryExperimentCostByCandidate(costLedger, runDir, scenarios, candidateIdsInput) {
1299
1300
  const candidateByScenario = new Map(scenarios.map((scenario) => [scenario.id, scenario.candidateId]));
@@ -1786,7 +1787,7 @@ function resolveAgentMemoryMode(value) {
1786
1787
  return value;
1787
1788
  }
1788
1789
  function memoryExperimentComparisonRef(options, resolvedRunDir) {
1789
- return `sha256:${sha256(canonicalJson({
1790
+ const material = canonicalJson({
1790
1791
  implementationRef: MEMORY_EXPERIMENT_IMPLEMENTATION_REF,
1791
1792
  experimentId: options.experimentId,
1792
1793
  experimentRunId: options.experimentRunId ?? resolvedRunDir,
@@ -1805,7 +1806,8 @@ function memoryExperimentComparisonRef(options, resolvedRunDir) {
1805
1806
  cleanupTimeoutMs: options.cleanupTimeoutMs ?? 18e4,
1806
1807
  maxRecoveryAttempts: options.maxRecoveryAttempts ?? 1e3,
1807
1808
  maxRecoveryRetriesPerAttempt: options.maxRecoveryRetriesPerAttempt ?? 3
1808
- }))}`;
1809
+ });
1810
+ return `sha256:${sha256(material)}`;
1809
1811
  }
1810
1812
  function assertAgentMemoryExperimentComparisonRef(value, label) {
1811
1813
  if (typeof value !== "string" || !COMPARISON_REF_PATTERN.test(value)) throw new Error(`${label} must be a full lowercase sha256 reference`);
@@ -2374,7 +2376,8 @@ async function recoverMemoryAttempt(input) {
2374
2376
  if (recovered === null) return;
2375
2377
  rawAdapter = recovered;
2376
2378
  adapter = trackExternalMemoryCalls(recovered, onExternalCall);
2377
- await sleepForMemoryRecovery(memoryRecoveryDelayMs(adapter), () => lease.assertOwned(), cleanupTimeoutMs, `${candidate.id}: abandoned branch recovery visibility wait`, options.signal);
2379
+ const recoveryDelayMs = memoryRecoveryDelayMs(adapter);
2380
+ await sleepForMemoryRecovery(recoveryDelayMs, () => lease.assertOwned(), cleanupTimeoutMs, `${candidate.id}: abandoned branch recovery visibility wait`, options.signal);
2378
2381
  if (cleanupBranches) {
2379
2382
  if (!adapter.clear) throw new Error(`${candidate.id}: abandoned branch recovery requires an adapter with scoped clear support`);
2380
2383
  memory = createAgentMemoryBranch({
@@ -5398,4 +5401,4 @@ const AgentMemoryWriteInputSchema = z.object({
5398
5401
  //#endregion
5399
5402
  export { runSerializedKnowledgeOptimization as A, deterministicRng as C, toOffPolicyTrajectory as D, retrievalHoldoutConfigHash as E, assertImmutableRef as M, jsonCandidateCodec as O, applySessionStickyRetrievalHoldout as S, resetRetrievalHoldoutRegistry as T, createAgentMemoryBranch as _, createNeo4jAgentMemoryAdapter as a, renderMemoryContext as b, runAgentMemoryImprovement as c, compareAgentMemoryLearning as d, runAgentMemoryLearningExperiment as f, buildAgentMemorySequencesFromBenchmarkCases as g, buildAgentMemorySequenceScenarios as h, AgentMemoryWriteInputSchema as i, scenarioContentFingerprint as j, jsonObjectCandidateCodec as k, createGraphitiMemoryAdapter as l, agentMemorySequenceJudge as m, AgentMemoryKindSchema as n, createMem0MemoryAdapter as o, runAgentMemoryExperiment as p, AgentMemoryScopeSchema as r, mem0MemoryAdapterIdentity as s, AgentMemoryHitSchema as t, graphitiMemoryAdapterIdentity as u, forkAgentMemoryBranchSnapshot as v, emitRetrievalHoldoutBypass as w, applyRetrievalHoldout as x, defaultGetMemoryContext as y };
5400
5403
 
5401
- //# sourceMappingURL=memory-Bn1Xs1hY.js.map
5404
+ //# sourceMappingURL=memory-BYWNir2t.js.map