@snoai/memory 1.2.12 → 1.2.14
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/README.md +1 -1
- package/dist/{access-tracker-BOPHSJjf.d.ts → access-tracker-DT04huAG.d.ts} +4 -4
- package/dist/{adapter-lyb6RaQE.d.ts → adapter-BMx-VcJy.d.ts} +2 -2
- package/dist/{agent-llm-port-DY2290EK.d.ts → agent-llm-port-BlFrD2ro.d.ts} +5 -0
- package/dist/{atomic-memory-extraction-B5FW2HhR.js → atomic-memory-extraction-De86y7O-.js} +4 -4
- package/dist/{atomic-memory-extraction-B_XpkhMd.d.ts → atomic-memory-extraction-_OEsSJbC.d.ts} +4 -4
- package/dist/{b-profile-section-dictionary-provider-BK5NBs-y.d.ts → b-profile-section-dictionary-provider-DTE4uWyh.d.ts} +1 -1
- package/dist/{capture-policy-detector-BvVGmxxX.d.ts → capture-policy-detector-B8sqRTlB.d.ts} +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +5 -4
- package/dist/{config-BWHnCb_Z.js → config-C1X5rsAx.js} +44 -53
- package/dist/{daily-log-generator-CH_KuWHs.js → daily-log-generator-DEsiCs7o.js} +1 -1
- package/dist/{derived-suppression-cache-Ckwjey7I.d.ts → derived-suppression-cache-Cha_e2Cr.d.ts} +1 -1
- package/dist/diagnostic-encoder.js +1 -1
- package/dist/{index-Pb9LrHgL.d.ts → index-8CfO_-6T.d.ts} +7 -16
- package/dist/{index-CsPUNkcm.d.ts → index-C8tTzfrH.d.ts} +5 -4
- package/dist/index.d.ts +12 -12
- package/dist/index.js +13 -11
- package/dist/internal/config/index.d.ts +2 -2
- package/dist/internal/config/index.js +7 -16
- package/dist/internal/config/plugin-config-schema.d.ts +1 -1
- package/dist/internal/config/plugin-config-schema.js +1 -1
- package/dist/internal/config/product-mode.d.ts +1 -1
- package/dist/internal/config/settings.d.ts +1 -1
- package/dist/internal/config/settings.js +32 -23
- package/dist/internal/config/skin-defaults.d.ts +1 -1
- package/dist/internal/contract/profile.d.ts +1 -1
- package/dist/internal/contract/routes.d.ts +2 -2
- package/dist/internal/contract/routes.js +2 -1
- package/dist/internal/engine/bindings/memory-cli-shared.d.ts +4 -4
- package/dist/internal/engine/bindings/memory-forget-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-list-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-recall-tool.js +2 -2
- package/dist/internal/engine/bindings/memory-reflection-resolve-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-stats-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-store-tool.js +3 -3
- package/dist/internal/engine/bindings/memory-tool-access.d.ts +1 -1
- package/dist/internal/engine/bindings/memory-tool-access.js +1 -1
- package/dist/internal/engine/bindings/memory-tool-results.d.ts +1 -1
- package/dist/internal/engine/bindings/memory-tool-results.js +1 -1
- package/dist/internal/engine/bindings/memory-tool-schemas.d.ts +5 -5
- package/dist/internal/engine/bindings/memory-tool-schemas.js +1 -1
- package/dist/internal/engine/bindings/memory-update-tool.js +2 -2
- package/dist/internal/engine/bindings/sno-station-mem-ambient-learning-hook.d.ts +4 -4
- package/dist/internal/engine/bindings/sno-station-mem-ambient-learning-hook.js +4 -4
- package/dist/internal/engine/bindings/sno-station-mem-auto-recall-hook.d.ts +4 -4
- package/dist/internal/engine/bindings/sno-station-mem-auto-recall-hook.js +4 -2
- package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.d.ts +6 -6
- package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.js +2 -2
- package/dist/internal/engine/bindings/sno-station-mem-message-transcript.js +2 -2
- package/dist/internal/engine/bindings/sno-station-mem-reset-hook.d.ts +3 -3
- package/dist/internal/engine/bindings/sno-station-mem-runtime-mode.d.ts +1 -1
- package/dist/internal/engine/extraction/atomic-memory-extraction.d.ts +1 -1
- package/dist/internal/engine/extraction/atomic-memory-extraction.js +1 -1
- package/dist/internal/engine/extraction/b-profile-section-dictionary-provider.d.ts +1 -1
- package/dist/internal/engine/extraction/b-profile-section-rekey.d.ts +5 -5
- package/dist/internal/engine/extraction/capture-policy-detector.d.ts +1 -1
- package/dist/internal/engine/extraction/memory-metadata-codec.d.ts +2 -2
- package/dist/internal/engine/extraction/memory-temporality-classifier.d.ts +1 -1
- package/dist/internal/engine/extraction/memory-temporality-classifier.js +1 -1
- package/dist/internal/engine/observability/adapter.d.ts +1 -1
- package/dist/internal/engine/observability/memory-snapshot.d.ts +1 -1
- package/dist/internal/engine/observability/observable-embedder.d.ts +1 -1
- package/dist/internal/engine/observability/observable-llm-client.d.ts +1 -1
- package/dist/internal/engine/observability/observable-memory-store.d.ts +1 -1
- package/dist/internal/engine/observability/observable-memory-store.js +1 -1
- package/dist/internal/engine/observability/observable-retriever.d.ts +1 -1
- package/dist/internal/engine/observability/observable-retriever.js +1 -1
- package/dist/internal/engine/observability/runtime-diagnostics.d.ts +1 -1
- package/dist/internal/engine/observability/runtime-diagnostics.js +1 -1
- package/dist/internal/engine/operations/learning-file-maintenance.js +1 -1
- package/dist/internal/engine/operations/memory-tier-promoter.d.ts +1 -1
- package/dist/internal/engine/operations/runtime-audit-log.d.ts +2 -2
- package/dist/internal/engine/provider/provider-registration.d.ts +4 -4
- package/dist/internal/engine/provider/provider-row-renderer.d.ts +1 -1
- package/dist/internal/engine/reflection/daily-log-generator.js +1 -1
- package/dist/internal/engine/reflection/reflection-command-hooks.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-command-hooks.js +1 -1
- package/dist/internal/engine/reflection/reflection-deps.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-embedded-generator.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-embedded-generator.js +1 -1
- package/dist/internal/engine/reflection/reflection-injection-hooks.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-injection-hooks.js +1 -1
- package/dist/internal/engine/reflection/reflection-lifecycle-hooks.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-lifecycle-hooks.js +1 -1
- package/dist/internal/engine/reflection/strategy-hook-runner.d.ts +3 -3
- package/dist/internal/engine/reflection/strategy-hook-runner.js +2 -2
- package/dist/internal/engine/retrieval/access-tracker.d.ts +1 -1
- package/dist/internal/engine/retrieval/retriever.d.ts +2 -2
- package/dist/internal/engine/retrieval/retriever.js +1 -1
- package/dist/internal/engine/shared/memory-kind-policy.d.ts +1 -1
- package/dist/internal/engine/shared/paths.d.ts +2 -2
- package/dist/internal/engine/shared/types.d.ts +2 -2
- package/dist/internal/engine/shared/types.js +1 -1
- package/dist/internal/engine/telemetry/observe-ledger.d.ts +1 -1
- package/dist/internal/model/agent-llm-port.d.ts +1 -1
- package/dist/internal/model/llm-client.d.ts +2 -2
- package/dist/internal/model/llm-client.js +1 -1
- package/dist/internal/model/llm-mode-routing.d.ts +1 -1
- package/dist/internal/store/maintenance.d.ts +2 -2
- package/dist/internal/store/maintenance.js +3 -3
- package/dist/internal/store/sqlite-runtime.js +1 -1
- package/dist/internal/store/store.d.ts +2 -2
- package/dist/internal/store/store.js +1 -1
- package/dist/{llm-client-BTaUVmDe.d.ts → llm-client-BoClMktv.d.ts} +1 -1
- package/dist/{llm-client-DPBhPtmQ.js → llm-client-DDdUjYWS.js} +28 -10
- package/dist/{log-site-catalog.generated-B4LkDXe0.js → log-site-catalog.generated-DGia_6ZR.js} +86 -79
- package/dist/log-site-catalog.json +1 -1
- package/dist/{memory-kind-policy-ClQEXeOL.d.ts → memory-kind-policy-C7p4o8ru.d.ts} +1 -1
- package/dist/{memory-metadata-codec-wVAuoKrG.d.ts → memory-metadata-codec-CFY8YtXf.d.ts} +1 -1
- package/dist/{memory-runtime-D6cAHd34.js → memory-runtime-CCPRiAk9.js} +118 -89
- package/dist/{memory-snapshot-uTdxJnIh.d.ts → memory-snapshot-DADY3InD.d.ts} +2 -2
- package/dist/{memory-store-base-Bk2dOKED.d.ts → memory-store-base-D0bLwzyF.d.ts} +3 -3
- package/dist/{memory-temporality-classifier-Bm4-tqB5.js → memory-temporality-classifier-BwBKEQbL.js} +1 -1
- package/dist/{memory-temporality-classifier-CcxfHYoT.d.ts → memory-temporality-classifier-DL14kjtv.d.ts} +1 -1
- package/dist/{memory-tier-promoter-MkZPQ8u1.d.ts → memory-tier-promoter-Cf1OdoZK.d.ts} +1 -1
- package/dist/memory-tool-dependencies-Bxdpvs3Z.d.ts +14 -0
- package/dist/{memory-tool-dependencies-R_yWuFEg.js → memory-tool-dependencies-aAr7Pkuj.js} +1 -1
- package/dist/{observable-embedder-CGr3Zejf.d.ts → observable-embedder-CPyX9y7c.d.ts} +1 -1
- package/dist/{observable-llm-client-CXUA7Gi3.d.ts → observable-llm-client-C8ndPJck.d.ts} +3 -3
- package/dist/{observable-memory-store-BwwKcUzf.d.ts → observable-memory-store-DhOfgjkU.d.ts} +4 -4
- package/dist/{observable-retriever-bJbG9WtJ.d.ts → observable-retriever-CUlmCFy5.d.ts} +5 -5
- package/dist/{operation-cancellation-CTKWwNHk.js → operation-cancellation-QcwC4mDX.js} +7 -2
- package/dist/paths-DnNN0G1t.d.ts +1 -0
- package/dist/{plugin-config-schema-BrhMvnXJ.d.ts → plugin-config-schema-BPg-ppSt.d.ts} +2 -8
- package/dist/{plugin-config-schema-Di-uKTP0.js → plugin-config-schema-D9riSXDg.js} +3 -19
- package/dist/{profile-CF5oDjR7.d.ts → profile-BksZRjJ8.d.ts} +1 -1
- package/dist/{profile-section-writer-Cu3ND3j7.js → profile-section-writer-Dd4FKpt5.js} +2 -2
- package/dist/{reflection-command-hooks-vKpljnqv.js → reflection-command-hooks-B2P4zDr6.js} +5 -5
- package/dist/{reflection-command-hooks-CM2mWb69.d.ts → reflection-command-hooks-mCOmD8b6.d.ts} +4 -4
- package/dist/{reflection-deps-B5I0nYZS.d.ts → reflection-deps-BYkAaKxD.d.ts} +3 -3
- package/dist/{reflection-embedded-generator-CwTXvERI.js → reflection-embedded-generator-DV-NkeU-.js} +1 -1
- package/dist/{reflection-embedded-generator-CogQIBcG.d.ts → reflection-embedded-generator-ve1PhgUY.d.ts} +4 -4
- package/dist/{reflection-injection-hooks-BnbfZqpj.d.ts → reflection-injection-hooks-CphBCA9F.d.ts} +4 -4
- package/dist/{reflection-lifecycle-hooks-DMDhtidj.d.ts → reflection-lifecycle-hooks-CFGYh_8m.d.ts} +3 -3
- package/dist/{rem-batch-executor-Cn-MBe4m.js → rem-batch-executor-TSYG7oVi.js} +1 -1
- package/dist/{rem-consumer-retrieval-CDMSCJYI.js → rem-consumer-retrieval-BhS1ivcd.js} +1 -0
- package/dist/{rem-trigger-B_S0CBa7.js → rem-trigger-i_E8I9lv.js} +139 -158
- package/dist/{retriever-DyxY59Lg.d.ts → retriever-6ybsoVuY.d.ts} +20 -25
- package/dist/{retriever-Bzz6H8Mn.js → retriever-Dnjl_FHu.js} +112 -155
- package/dist/{runtime-audit-log-DdhLlTxi.d.ts → runtime-audit-log-DWpWmCx5.d.ts} +1 -1
- package/dist/{server-C2XTjGFr.js → server-DsaVeSaM.js} +7 -6
- package/dist/sidecar/main.js +2 -2
- package/dist/sno-station-mem-runtime-dependencies-DtKDYdsh.d.ts +31 -0
- package/dist/{sno-station-mem-runtime-dependencies-BaaXGrZb.js → sno-station-mem-runtime-dependencies-zzcjHD_N.js} +7 -7
- package/dist/{store-BzWYcvpF.js → store-COwW7mIh.js} +2 -2
- package/dist/{store-BDIAl2cc.d.ts → store-HyzTUvwj.d.ts} +1 -1
- package/dist/{strategy-hook-runner-DT9emgCZ.d.ts → strategy-hook-runner-B_m1L5CB.d.ts} +7 -7
- package/dist/{strategy-hook-runner-GaJKb3O8.js → strategy-hook-runner-CALbWcys.js} +1 -1
- package/dist/{types-Ae3a8562.d.ts → types-Dm_XhSne.d.ts} +1 -1
- package/package.json +1 -1
- package/settings.default.json +1 -5
- package/dist/memory-tool-dependencies-CWnD5mia.d.ts +0 -14
- package/dist/paths-DmmPxD_v.d.ts +0 -1
- package/dist/sno-station-mem-runtime-dependencies-BZjUo6Jr.d.ts +0 -31
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { CHUNKING_VERSION, DEFAULT_BM25_WEIGHT, DEFAULT_RECALL_LIFECYCLE,
|
|
1
|
+
import { CHUNKING_VERSION, DEFAULT_BM25_WEIGHT, DEFAULT_RECALL_LIFECYCLE, DEFAULT_RERANK_TIMEOUT_MS, DEFAULT_VECTOR_WEIGHT, IMPORTANCE_WEIGHT_BASE, LIGHTWEIGHT_COSINE_WEIGHT, LIGHTWEIGHT_FUSION_WEIGHT, LIGHTWEIGHT_RERANK_PENALTY, MMR_LAMBDA, RECENCY_WEIGHT, RERANK_BLEND_CROSS, RERANK_BLEND_VECTOR, TIME_DECAY_FLOOR, experimentCandidatePoolOverride, experimentMmrDisabled } from "./internal/config/index.js";
|
|
2
2
|
import "./internal/engine/shared/types.js";
|
|
3
3
|
import { EmbeddingError, RetrievalError } from "./internal/engine/shared/errors.js";
|
|
4
4
|
import { o as isMemoryExpired, s as parseInsightMetadata } from "./memory-metadata-codec-DL1sbJiN.js";
|
|
5
5
|
import { clamp01 } from "./internal/engine/shared/utils.js";
|
|
6
|
-
import {
|
|
7
|
-
import { classifyLlmFailure } from "./internal/model/llm-failure.js";
|
|
6
|
+
import { a as memoryOperationSignal } from "./operation-cancellation-QcwC4mDX.js";
|
|
8
7
|
import { appendQaTrace, computeConfigHash, isTraceEnabled } from "./internal/engine/eval/trace.js";
|
|
9
8
|
import { computeEffectiveHalfLife, parseAccessMetadata } from "./internal/engine/retrieval/access-tracker.js";
|
|
10
9
|
import { createLogger as createLogger$1, currentLogContext, privateLogReference, withLogContext } from "@snoai/utils/logger";
|
|
@@ -219,9 +218,7 @@ const DEFAULT_RETRIEVAL_CONFIG = {
|
|
|
219
218
|
recencyWeight: RECENCY_WEIGHT,
|
|
220
219
|
temporalExpiry: false,
|
|
221
220
|
temporalDecay: true,
|
|
222
|
-
rerankModel: DEFAULT_RERANK_MODEL,
|
|
223
221
|
rerankTimeoutMs: DEFAULT_RERANK_TIMEOUT_MS,
|
|
224
|
-
rerankProvider: "voyage",
|
|
225
222
|
lengthNormAnchor: 0,
|
|
226
223
|
hardMinScore: 0,
|
|
227
224
|
timeDecayHalfLifeDays: 60,
|
|
@@ -244,12 +241,10 @@ const DEFAULT_RETRIEVAL_CONFIG = {
|
|
|
244
241
|
*
|
|
245
242
|
* - `missing_api_key`: cross-encoder configured but no rerankApiKey set;
|
|
246
243
|
* call routes through the lightweight cosine path instead.
|
|
247
|
-
* - `no_endpoint`:
|
|
248
|
-
*
|
|
249
|
-
* - `
|
|
250
|
-
*
|
|
251
|
-
* - `invalid_response`: provider HTTP 2xx but response shape did not parse.
|
|
252
|
-
* - `timeout`: the per-call AbortSignal fired before the provider responded.
|
|
244
|
+
* - `no_endpoint`: no reranker address (`rerankEndpoint`) was set; rerank was skipped.
|
|
245
|
+
* - `http_error`: the reranker responded with a non-OK status.
|
|
246
|
+
* - `invalid_response`: the reranker answered HTTP 2xx but the response shape did not parse.
|
|
247
|
+
* - `timeout`: the per-call AbortSignal fired before the reranker responded.
|
|
253
248
|
* - `request_error`: any other thrown error inside the fetch path.
|
|
254
249
|
* - `query_over_window`: the query alone fills the reranker's per-pair token window, so no
|
|
255
250
|
* document could be sent with it. Nothing was requested.
|
|
@@ -546,13 +541,15 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
546
541
|
site_id: "retrieval.retriever-search-modes.precisionRecall.aaf0b2eb17"
|
|
547
542
|
});
|
|
548
543
|
trace?.startStage("rerank", fused.map((r) => r.entry.id));
|
|
549
|
-
const rerankOutcome = await this.rerank(context.query, fused, queryVector
|
|
544
|
+
const rerankOutcome = await this.rerank(context.query, fused, queryVector, {
|
|
545
|
+
signal: context.signal,
|
|
546
|
+
deadlineAt: context.rerankDeadlineAt
|
|
547
|
+
});
|
|
550
548
|
fused = rerankOutcome.candidates;
|
|
551
549
|
this.throwIfAborted(context);
|
|
552
550
|
const rerankStageMetadata = rerankOutcome.fallback ? {
|
|
553
551
|
...rerankOutcome.stats,
|
|
554
|
-
rerankFallbackReason: rerankOutcome.fallback.reason
|
|
555
|
-
rerankFallbackProvider: rerankOutcome.fallback.provider
|
|
552
|
+
rerankFallbackReason: rerankOutcome.fallback.reason
|
|
556
553
|
} : rerankOutcome.stats;
|
|
557
554
|
trace?.endStage(fused.map((r) => r.entry.id), fused.map((r) => r.score), rerankStageMetadata);
|
|
558
555
|
fused = this.applyScoringPipeline(fused, trace, context.limit);
|
|
@@ -624,95 +621,31 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
624
621
|
});
|
|
625
622
|
//#endregion
|
|
626
623
|
//#region src/engine/retrieval/retrieval-rerank-provider.ts
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
switch (provider) {
|
|
642
|
-
case "tei": return {
|
|
643
|
-
headers: {
|
|
644
|
-
"Content-Type": "application/json",
|
|
645
|
-
Authorization: `Bearer ${apiKey}`
|
|
646
|
-
},
|
|
647
|
-
body: {
|
|
648
|
-
query,
|
|
649
|
-
texts: candidates,
|
|
650
|
-
raw_scores: true
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
case "dashscope": return {
|
|
654
|
-
headers: {
|
|
655
|
-
"Content-Type": "application/json",
|
|
656
|
-
Authorization: `Bearer ${apiKey}`
|
|
657
|
-
},
|
|
658
|
-
body: {
|
|
659
|
-
model,
|
|
660
|
-
input: {
|
|
661
|
-
query,
|
|
662
|
-
documents: candidates
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
case "pinecone": return {
|
|
667
|
-
headers: {
|
|
668
|
-
"Content-Type": "application/json",
|
|
669
|
-
"Api-Key": apiKey,
|
|
670
|
-
"X-Pinecone-API-Version": "2024-10"
|
|
671
|
-
},
|
|
672
|
-
body: {
|
|
673
|
-
model,
|
|
674
|
-
query,
|
|
675
|
-
documents: candidates.map((text) => ({ text })),
|
|
676
|
-
top_n: topN,
|
|
677
|
-
rank_fields: ["text"]
|
|
678
|
-
}
|
|
679
|
-
};
|
|
680
|
-
case "voyage": return {
|
|
681
|
-
headers: {
|
|
682
|
-
"Content-Type": "application/json",
|
|
683
|
-
Authorization: `Bearer ${apiKey}`
|
|
684
|
-
},
|
|
685
|
-
body: {
|
|
686
|
-
model,
|
|
687
|
-
query,
|
|
688
|
-
documents: candidates,
|
|
689
|
-
top_k: topN
|
|
690
|
-
}
|
|
691
|
-
};
|
|
692
|
-
default: return {
|
|
693
|
-
headers: {
|
|
694
|
-
"Content-Type": "application/json",
|
|
695
|
-
Authorization: `Bearer ${apiKey}`
|
|
696
|
-
},
|
|
697
|
-
body: {
|
|
698
|
-
model,
|
|
699
|
-
query,
|
|
700
|
-
documents: candidates,
|
|
701
|
-
top_n: topN
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
}
|
|
624
|
+
function buildRerankRequest(apiKey, query, candidates) {
|
|
625
|
+
return {
|
|
626
|
+
headers: {
|
|
627
|
+
"Content-Type": "application/json",
|
|
628
|
+
Authorization: `Bearer ${apiKey}`,
|
|
629
|
+
"X-Sno-Source": "sno-station",
|
|
630
|
+
"X-Sno-Workload": "station-rerank"
|
|
631
|
+
},
|
|
632
|
+
body: {
|
|
633
|
+
query,
|
|
634
|
+
texts: candidates,
|
|
635
|
+
raw_scores: true
|
|
636
|
+
}
|
|
637
|
+
};
|
|
705
638
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
const parseItems = (items
|
|
639
|
+
/** Sno's reranker answers a list of `{index, score}`, bare or under `results` / `data`. */
|
|
640
|
+
function parseRerankResponse(data) {
|
|
641
|
+
const parseItems = (items) => {
|
|
709
642
|
if (!Array.isArray(items)) return void 0;
|
|
710
643
|
const parsed = [];
|
|
711
644
|
for (const raw of items) {
|
|
712
645
|
const index = typeof raw?.index === "number" ? raw.index : Number(raw?.index);
|
|
713
646
|
if (!Number.isFinite(index)) continue;
|
|
714
647
|
let score;
|
|
715
|
-
for (const key of
|
|
648
|
+
for (const key of ["score", "relevance_score"]) {
|
|
716
649
|
const value = raw?.[key];
|
|
717
650
|
const n = typeof value === "number" ? value : Number(value);
|
|
718
651
|
if (Number.isFinite(n)) {
|
|
@@ -729,17 +662,7 @@ function parseRerankResponse(provider, data) {
|
|
|
729
662
|
return parsed.length > 0 ? parsed : void 0;
|
|
730
663
|
};
|
|
731
664
|
const objectData = data && typeof data === "object" && !Array.isArray(data) ? data : void 0;
|
|
732
|
-
|
|
733
|
-
case "tei": return parseItems(data, ["score", "relevance_score"]) ?? parseItems(objectData?.results, ["score", "relevance_score"]) ?? parseItems(objectData?.data, ["score", "relevance_score"]);
|
|
734
|
-
case "dashscope": {
|
|
735
|
-
const output = objectData?.output;
|
|
736
|
-
if (output) return parseItems(output.results, ["relevance_score", "score"]);
|
|
737
|
-
return parseItems(objectData?.results, ["relevance_score", "score"]);
|
|
738
|
-
}
|
|
739
|
-
case "pinecone": return parseItems(objectData?.data, ["score", "relevance_score"]) ?? parseItems(objectData?.results, ["score", "relevance_score"]);
|
|
740
|
-
case "voyage": return parseItems(objectData?.data, ["relevance_score", "score"]) ?? parseItems(objectData?.results, ["relevance_score", "score"]);
|
|
741
|
-
default: return parseItems(objectData?.results, ["relevance_score", "score"]) ?? parseItems(objectData?.data, ["relevance_score", "score"]);
|
|
742
|
-
}
|
|
665
|
+
return parseItems(data) ?? parseItems(objectData?.results) ?? parseItems(objectData?.data);
|
|
743
666
|
}
|
|
744
667
|
//#endregion
|
|
745
668
|
//#region src/engine/retrieval/retriever-rerank.ts
|
|
@@ -802,16 +725,14 @@ function isTransientRerankError(error) {
|
|
|
802
725
|
if (isRerankTimeout(error)) return true;
|
|
803
726
|
return error instanceof TypeError && error.cause !== void 0;
|
|
804
727
|
}
|
|
805
|
-
async function fetchRerankWithRetry(send) {
|
|
728
|
+
async function fetchRerankWithRetry(send, stop) {
|
|
806
729
|
let lastError;
|
|
807
730
|
for (let attempt = 1; attempt <= RERANK_TRANSIENT_ATTEMPTS; attempt += 1) {
|
|
808
731
|
let retryDelayMs = RERANK_TRANSIENT_BACKOFF_MS * attempt;
|
|
809
732
|
try {
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
data: await response.json()
|
|
814
|
-
};
|
|
733
|
+
const reply = await send();
|
|
734
|
+
const { response } = reply;
|
|
735
|
+
if (response.ok) return reply;
|
|
815
736
|
if (!RERANK_TRANSIENT_STATUSES.has(response.status) || attempt === RERANK_TRANSIENT_ATTEMPTS) return { response };
|
|
816
737
|
if (response.status === 429) {
|
|
817
738
|
const retryAfter = response.headers.get("retry-after");
|
|
@@ -820,37 +741,48 @@ async function fetchRerankWithRetry(send) {
|
|
|
820
741
|
await response.body?.cancel();
|
|
821
742
|
lastError = /* @__PURE__ */ new Error(`rerank API responded ${response.status}`);
|
|
822
743
|
} catch (error) {
|
|
823
|
-
if (!isTransientRerankError(error) || attempt === RERANK_TRANSIENT_ATTEMPTS) throw error;
|
|
744
|
+
if (!isTransientRerankError(error) || attempt === RERANK_TRANSIENT_ATTEMPTS || stop?.aborted) throw error;
|
|
824
745
|
lastError = error;
|
|
825
746
|
}
|
|
826
|
-
|
|
747
|
+
if (stop?.aborted) throw lastError;
|
|
748
|
+
await new Promise((resolve) => {
|
|
749
|
+
const onAbort = () => {
|
|
750
|
+
clearTimeout(timer);
|
|
751
|
+
resolve();
|
|
752
|
+
};
|
|
753
|
+
const timer = setTimeout(() => {
|
|
754
|
+
stop?.removeEventListener("abort", onAbort);
|
|
755
|
+
resolve();
|
|
756
|
+
}, retryDelayMs);
|
|
757
|
+
stop?.addEventListener("abort", onAbort, { once: true });
|
|
758
|
+
});
|
|
759
|
+
if (stop?.aborted) throw lastError;
|
|
827
760
|
}
|
|
828
761
|
throw lastError;
|
|
829
762
|
}
|
|
830
763
|
Object.assign(MemoryRetriever.prototype, {
|
|
831
|
-
async rerank(query, candidates, queryVector) {
|
|
764
|
+
async rerank(query, candidates, queryVector, options) {
|
|
832
765
|
if (candidates.length === 0) return { candidates };
|
|
833
766
|
if (this.config.rerank === "none") return { candidates };
|
|
834
|
-
const
|
|
835
|
-
if (this.config.rerank === "cross-encoder" && !this.config.rerankApiKey) throw new RetrievalError(
|
|
767
|
+
const unranked = () => this.rerankLightweight(candidates, queryVector);
|
|
768
|
+
if (this.config.rerank === "cross-encoder" && !this.config.rerankApiKey) throw new RetrievalError("rerank \"cross-encoder\" requires retrieval.rerankApiKey; set the key, or set retrieval.rerank to \"lightweight\" to choose the local ranker");
|
|
836
769
|
if (this.config.rerank === "lightweight" || !this.config.rerankApiKey) return { candidates: this.rerankLightweight(candidates, queryVector) };
|
|
837
|
-
const rerankEndpoint = this.config.rerankEndpoint
|
|
770
|
+
const rerankEndpoint = this.config.rerankEndpoint;
|
|
838
771
|
if (!rerankEndpoint) {
|
|
839
|
-
log.warn("rerank skipped: no
|
|
772
|
+
log.warn("rerank skipped: no reranker address", {}, {
|
|
840
773
|
event_name: "memory.retriever_rerank.diagnostic",
|
|
841
774
|
file: "packages/memory/src/engine/retrieval/retriever-rerank.ts",
|
|
842
775
|
function: "rerank",
|
|
843
776
|
site_id: "retrieval.retriever-rerank.rerank.6fbc6b3a22"
|
|
844
777
|
});
|
|
845
778
|
return {
|
|
846
|
-
candidates,
|
|
847
|
-
fallback: {
|
|
848
|
-
reason: "no_endpoint",
|
|
849
|
-
provider
|
|
850
|
-
}
|
|
779
|
+
candidates: unranked(),
|
|
780
|
+
fallback: { reason: "no_endpoint" }
|
|
851
781
|
};
|
|
852
782
|
}
|
|
853
783
|
const rerankTimeoutMs = this.config.rerankTimeoutMs ?? 15e3;
|
|
784
|
+
const stepBudget = AbortSignal.timeout(Math.max(0, Math.floor(options?.deadlineAt === void 0 ? rerankTimeoutMs : options.deadlineAt - Date.now())));
|
|
785
|
+
const stepStop = options?.signal ? AbortSignal.any([options.signal, stepBudget]) : stepBudget;
|
|
854
786
|
const rerankApiKey = this.config.rerankApiKey;
|
|
855
787
|
const maxCandidates = this.config.rerankMaxCandidates;
|
|
856
788
|
const overCap = maxCandidates !== void 0 && candidates.length > maxCandidates;
|
|
@@ -871,11 +803,8 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
871
803
|
site_id: "retrieval.retriever-rerank.rerank.query_over_window"
|
|
872
804
|
});
|
|
873
805
|
return {
|
|
874
|
-
candidates,
|
|
875
|
-
fallback: {
|
|
876
|
-
reason: "query_over_window",
|
|
877
|
-
provider
|
|
878
|
-
}
|
|
806
|
+
candidates: unranked(),
|
|
807
|
+
fallback: { reason: "query_over_window" }
|
|
879
808
|
};
|
|
880
809
|
}
|
|
881
810
|
let truncatedCandidates = 0;
|
|
@@ -898,17 +827,54 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
898
827
|
const runBatch = async (start) => {
|
|
899
828
|
let batchTexts = rerankTexts.slice(start, start + batchSize);
|
|
900
829
|
for (let pass = 0;; pass += 1) {
|
|
901
|
-
const { headers, body } = buildRerankRequest(
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
830
|
+
const { headers, body } = buildRerankRequest(rerankApiKey, query, batchTexts);
|
|
831
|
+
const sendAttempt = async () => {
|
|
832
|
+
const clientRequestId = randomUUID();
|
|
833
|
+
const attemptStarted = performance.now();
|
|
834
|
+
let outcome = "failed";
|
|
835
|
+
let statusCode;
|
|
836
|
+
try {
|
|
837
|
+
const attempt = await fetch(rerankEndpoint, {
|
|
838
|
+
method: "POST",
|
|
839
|
+
headers: {
|
|
840
|
+
...headers,
|
|
841
|
+
"X-Request-ID": clientRequestId
|
|
842
|
+
},
|
|
843
|
+
body: JSON.stringify(body),
|
|
844
|
+
signal: AbortSignal.any([AbortSignal.timeout(rerankTimeoutMs), stepStop])
|
|
845
|
+
});
|
|
846
|
+
statusCode = attempt.status;
|
|
847
|
+
if (!attempt.ok) {
|
|
848
|
+
outcome = "http_error";
|
|
849
|
+
return { response: attempt };
|
|
850
|
+
}
|
|
851
|
+
const data = await attempt.json();
|
|
852
|
+
outcome = "success";
|
|
853
|
+
return {
|
|
854
|
+
response: attempt,
|
|
855
|
+
data
|
|
856
|
+
};
|
|
857
|
+
} catch (error) {
|
|
858
|
+
outcome = isRerankTimeout(error) ? "timeout" : "failed";
|
|
859
|
+
throw error;
|
|
860
|
+
} finally {
|
|
861
|
+
log.info("Rerank request completed", {
|
|
862
|
+
outcome,
|
|
863
|
+
status_code: statusCode ?? "unavailable",
|
|
864
|
+
duration_ms: performance.now() - attemptStarted,
|
|
865
|
+
texts_sent: batchTexts.length,
|
|
866
|
+
client_request_id: clientRequestId
|
|
867
|
+
}, {
|
|
868
|
+
event_name: "rerank.request.completed",
|
|
869
|
+
file: "packages/memory/src/engine/retrieval/retriever-rerank.ts",
|
|
870
|
+
function: "runBatch",
|
|
871
|
+
site_id: "rerank.request.completed"
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
const { response, data } = await fetchRerankWithRetry(sendAttempt, stepStop);
|
|
908
876
|
if (!response.ok) {
|
|
909
877
|
const retryAfter = response.headers.get("retry-after");
|
|
910
|
-
const fatalError = buildRerankHttpError(response.status);
|
|
911
|
-
if (fatalError) throw fatalError;
|
|
912
878
|
const errorBody = await response.text().catch(() => "<unreadable body>");
|
|
913
879
|
const refusal = pass === 0 ? parseOverWindowRefusal(errorBody) : void 0;
|
|
914
880
|
if (refusal) {
|
|
@@ -950,10 +916,9 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
950
916
|
});
|
|
951
917
|
return "http_error";
|
|
952
918
|
}
|
|
953
|
-
const parsed = parseRerankResponse(
|
|
919
|
+
const parsed = parseRerankResponse(data);
|
|
954
920
|
if (!parsed) {
|
|
955
921
|
log.warn("rerank API returned unparseable response", {
|
|
956
|
-
provider,
|
|
957
922
|
endpoint_hash: createHash("sha256").update(rerankEndpoint).digest("hex"),
|
|
958
923
|
batchStart: start
|
|
959
924
|
}, {
|
|
@@ -984,11 +949,8 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
984
949
|
for (const outcome of settled) if (outcome.status === "rejected" && outcome.reason instanceof RetrievalError) throw outcome.reason;
|
|
985
950
|
for (const outcome of settled) if (outcome.status === "rejected") throw outcome.reason;
|
|
986
951
|
for (const outcome of settled) if (outcome.status === "fulfilled" && typeof outcome.value === "string") return {
|
|
987
|
-
candidates,
|
|
988
|
-
fallback: {
|
|
989
|
-
reason: outcome.value,
|
|
990
|
-
provider
|
|
991
|
-
}
|
|
952
|
+
candidates: unranked(),
|
|
953
|
+
fallback: { reason: outcome.value }
|
|
992
954
|
};
|
|
993
955
|
for (const outcome of settled) if (outcome.status === "fulfilled" && typeof outcome.value !== "string") items.push(...outcome.value);
|
|
994
956
|
}
|
|
@@ -1003,8 +965,7 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
1003
965
|
const candidate = toRerank[item.index];
|
|
1004
966
|
if (!candidate) continue;
|
|
1005
967
|
const sourceScore = this.getRerankSourceScore(candidate);
|
|
1006
|
-
|
|
1007
|
-
if (provider === "tei") crossScore = 1 / (1 + Math.exp(-item.score));
|
|
968
|
+
const crossScore = 1 / (1 + Math.exp(-item.score));
|
|
1008
969
|
const blendedScore = clamp01(crossScore * blendCross + sourceScore * blendVector, 0);
|
|
1009
970
|
reranked.push({
|
|
1010
971
|
...candidate,
|
|
@@ -1023,8 +984,7 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
1023
984
|
log.debug("reranked", {
|
|
1024
985
|
totalCandidateCount: candidates.length,
|
|
1025
986
|
sentToRerankCount: toRerank.length,
|
|
1026
|
-
returnedCount: reranked.length
|
|
1027
|
-
provider
|
|
987
|
+
returnedCount: reranked.length
|
|
1028
988
|
}, {
|
|
1029
989
|
event_name: "memory.retriever_rerank.diagnostic",
|
|
1030
990
|
file: "packages/memory/src/engine/retrieval/retriever-rerank.ts",
|
|
@@ -1066,11 +1026,8 @@ Object.assign(MemoryRetriever.prototype, {
|
|
|
1066
1026
|
});
|
|
1067
1027
|
}
|
|
1068
1028
|
return {
|
|
1069
|
-
candidates,
|
|
1070
|
-
fallback: {
|
|
1071
|
-
reason,
|
|
1072
|
-
provider
|
|
1073
|
-
}
|
|
1029
|
+
candidates: unranked(),
|
|
1030
|
+
fallback: { reason }
|
|
1074
1031
|
};
|
|
1075
1032
|
}
|
|
1076
1033
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./paths-
|
|
1
|
+
import "./paths-DnNN0G1t.js";
|
|
2
2
|
//#region src/engine/operations/runtime-audit-log.d.ts
|
|
3
3
|
type AuditEvent = "tool_call" | "hook_trigger" | "kill_switch" | "startup" | "error" | "auto_recall" | "ambient_learning" | "session_summary" | "envelope_strip" | "storage_integrity" | "memory_injected" | "memory_searched" | "memory_read" | "memory_updated" | "memory_superseded" | "memory_deleted" | "memory_purged" | "rem_trigger_evaluated" | "rem_triggered" | "rem_completed" | "rem_failed";
|
|
4
4
|
type AuditStatus = "ok" | "error" | "skipped" | "partial";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { At as getAuditPath, Dt as appendAuditEntryStrict, K as REM_BUILT_OPERATION_TYPES, Ot as compactAuditLog, Pt as readJsonlLines, bt as ModelCallRefusedError, d as RemJobStore, f as parseRemJobStats, n as remNeedsHost, q as parseRemOperationType } from "./rem-trigger-
|
|
2
|
-
import { Ar as MEMORY_DEFAULT_SKIN_ID, C as getSnoStationMemStateDir, Ir as memoryMethod, Nr as MEMORY_ROUTES, Pr as MEMORY_SKIN_HEADER, S as getSidecarSocketPath, _ as readRemTestHoldMs, c as REM_SIDECAR_ORIGIN, d as getRemDiscoveryPath, f as getRemJobJournalPath, g as readRemOperationalConfig, i as REM_JOBS_PATH_PREFIX, jr as MEMORY_ERROR_STATUS, l as REM_SOURCE,
|
|
1
|
+
import { At as getAuditPath, Dt as appendAuditEntryStrict, K as REM_BUILT_OPERATION_TYPES, Ot as compactAuditLog, Pt as readJsonlLines, bt as ModelCallRefusedError, d as RemJobStore, f as parseRemJobStats, n as remNeedsHost, q as parseRemOperationType } from "./rem-trigger-i_E8I9lv.js";
|
|
2
|
+
import { Ar as MEMORY_DEFAULT_SKIN_ID, C as getSnoStationMemStateDir, Ir as memoryMethod, Nr as MEMORY_ROUTES, Pr as MEMORY_SKIN_HEADER, S as getSidecarSocketPath, _ as readRemTestHoldMs, c as REM_SIDECAR_ORIGIN, d as getRemDiscoveryPath, f as getRemJobJournalPath, g as readRemOperationalConfig, i as REM_JOBS_PATH_PREFIX, jr as MEMORY_ERROR_STATUS, l as REM_SOURCE, nr as MEMORY_SHUTDOWN_TIMEOUT_MS, r as REM_CORRELATION_ID_HEADER, s as REM_SIDECAR_HOST, u as getRemChassisJournalPath, v as SettingsUnavailableError, y as getDiscoveryPath } from "./config-C1X5rsAx.js";
|
|
3
3
|
import { t as ContractError } from "./error-D-wb-rZw.js";
|
|
4
4
|
import { setImmediate } from "node:timers/promises";
|
|
5
5
|
import { createLogger, currentLogContext, effectiveLogLevel, emitDiagnostic } from "@snoai/utils/logger";
|
|
@@ -88,8 +88,9 @@ async function serveMemoryRoute(request, response, pathname, openPool, activeTas
|
|
|
88
88
|
let timer;
|
|
89
89
|
const controller = new AbortController();
|
|
90
90
|
const abort = () => controller.abort(new ContractError("timeout"));
|
|
91
|
+
const deadlineMs = performance.now() + MEMORY_ROUTES[method].timeoutMs;
|
|
91
92
|
let rejectDeadline;
|
|
92
|
-
if (method !== "capture") response.once("close", abort);
|
|
93
|
+
if (method !== "capture" || request.headers["x-sno-cancel-on-disconnect"] === "1") response.once("close", abort);
|
|
93
94
|
try {
|
|
94
95
|
const deadline = new Promise((_, reject) => {
|
|
95
96
|
rejectDeadline = () => reject(controller.signal.reason);
|
|
@@ -101,7 +102,7 @@ async function serveMemoryRoute(request, response, pathname, openPool, activeTas
|
|
|
101
102
|
controller.signal.throwIfAborted();
|
|
102
103
|
const pool = await openPool();
|
|
103
104
|
controller.signal.throwIfAborted();
|
|
104
|
-
return pool.invoke(method, body, typeof skinId === "string" && skinId.trim() ? skinId : MEMORY_DEFAULT_SKIN_ID, controller.signal);
|
|
105
|
+
return pool.invoke(method, body, typeof skinId === "string" && skinId.trim() ? skinId : MEMORY_DEFAULT_SKIN_ID, controller.signal, method === "capture" ? deadlineMs : void 0);
|
|
105
106
|
})();
|
|
106
107
|
const boundedTask = Promise.race([task, deadline]);
|
|
107
108
|
const completion = Object.assign(task.then(() => void 0, () => void 0), {
|
|
@@ -334,7 +335,7 @@ async function startOwnedRemSidecar() {
|
|
|
334
335
|
async open() {
|
|
335
336
|
if (currentMemory) return currentMemory;
|
|
336
337
|
if (settingsError) throw settingsError;
|
|
337
|
-
openingMemory ??= import("./memory-runtime-
|
|
338
|
+
openingMemory ??= import("./memory-runtime-CCPRiAk9.js").then((module) => module.MemoryRuntimePool.open()).then((pool) => {
|
|
338
339
|
currentMemory = pool;
|
|
339
340
|
if (stopping) pool.stopTimers();
|
|
340
341
|
return pool;
|
|
@@ -729,7 +730,7 @@ async function runChassisJob(store, journal, waveId, holdMs, runtime) {
|
|
|
729
730
|
cleanRefusalReasons.push(reason);
|
|
730
731
|
await appendChassisRefusal(journal, queued, operation, "refused", reason);
|
|
731
732
|
}
|
|
732
|
-
const { runRemProductionOrderedWave } = await import("./rem-batch-executor-
|
|
733
|
+
const { runRemProductionOrderedWave } = await import("./rem-batch-executor-TSYG7oVi.js");
|
|
733
734
|
const result = enabledOperations.length === 0 ? {
|
|
734
735
|
decision: "allow",
|
|
735
736
|
reasonCode: null,
|
package/dist/sidecar/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mr as MEMORY_RECONNECT_INTERVAL_MS, m as isRemTraceEnabled, p as getRemTraceLogPath, v as SettingsUnavailableError } from "../config-
|
|
1
|
+
import { Mr as MEMORY_RECONNECT_INTERVAL_MS, m as isRemTraceEnabled, p as getRemTraceLogPath, v as SettingsUnavailableError } from "../config-C1X5rsAx.js";
|
|
2
2
|
import { setTimeout } from "node:timers/promises";
|
|
3
3
|
import { addLogFileTarget, closeLogger, createLogger } from "@snoai/utils/logger";
|
|
4
4
|
//#region src/sidecar/main.ts
|
|
@@ -6,7 +6,7 @@ import { addLogFileTarget, closeLogger, createLogger } from "@snoai/utils/logger
|
|
|
6
6
|
* @purpose Boots the standalone local REM sidecar process.
|
|
7
7
|
* @boundary Process environment, sidecar lifecycle, and local request-log destination.
|
|
8
8
|
*/
|
|
9
|
-
const { startRemSidecar, DuplicateSidecarError } = await import("../server-
|
|
9
|
+
const { startRemSidecar, DuplicateSidecarError } = await import("../server-DsaVeSaM.js");
|
|
10
10
|
let sidecar;
|
|
11
11
|
for (let attempt = 1; !sidecar; attempt++) try {
|
|
12
12
|
sidecar = await startRemSidecar();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "./types-Dm_XhSne.js";
|
|
2
|
+
import "./index-8CfO_-6T.js";
|
|
3
|
+
import "./adapter-BMx-VcJy.js";
|
|
4
|
+
import "./embedding-provider-client-vynZMuit.js";
|
|
5
|
+
import "./retriever-6ybsoVuY.js";
|
|
6
|
+
import "./connection-3IVXpuPE.js";
|
|
7
|
+
import "./sqlite-runtime-L_ywirTm.js";
|
|
8
|
+
import "./store-HyzTUvwj.js";
|
|
9
|
+
import "./access-tracker-DT04huAG.js";
|
|
10
|
+
import "./memory-tier-promoter-Cf1OdoZK.js";
|
|
11
|
+
import "./capture-policy-detector-B8sqRTlB.js";
|
|
12
|
+
import "./memory-temporality-classifier-DL14kjtv.js";
|
|
13
|
+
import "./runtime-audit-log-DWpWmCx5.js";
|
|
14
|
+
import "./atomic-memory-extraction-_OEsSJbC.js";
|
|
15
|
+
import "./llm-client-BoClMktv.js";
|
|
16
|
+
import "./memory-snapshot-DADY3InD.js";
|
|
17
|
+
import "./observable-embedder-CPyX9y7c.js";
|
|
18
|
+
import "./observable-llm-client-C8ndPJck.js";
|
|
19
|
+
import "./observable-memory-store-DhOfgjkU.js";
|
|
20
|
+
import "./observable-retriever-CUlmCFy5.js";
|
|
21
|
+
import "./reflection-embedded-generator-ve1PhgUY.js";
|
|
22
|
+
import "./strategy-hook-runner-B_m1L5CB.js";
|
|
23
|
+
import "./data-bootstrap-Bl3lthzE.js";
|
|
24
|
+
import "@snoai/sqlite-crypto";
|
|
25
|
+
//#region src/engine/bindings/sno-station-mem-runtime-dependencies.d.ts
|
|
26
|
+
/** Legacy parameters carry only an unused logger slot; no host operations are exposed. */
|
|
27
|
+
type SnoStationMemPluginApi = {
|
|
28
|
+
logger: unknown;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { SnoStationMemPluginApi as t };
|
|
@@ -4,12 +4,12 @@ import "./internal/engine/shared/types.js";
|
|
|
4
4
|
import "./internal/engine/security/redact.js";
|
|
5
5
|
import "./internal/engine/shared/utils.js";
|
|
6
6
|
import "./runtime-audit-log-DK6xAYxh.js";
|
|
7
|
-
import "./llm-client-
|
|
7
|
+
import "./llm-client-DDdUjYWS.js";
|
|
8
8
|
import "./capture-policy-detector-DaMfy9CZ.js";
|
|
9
9
|
import "./ambient-learning-text-normalizer-CxjATmMp.js";
|
|
10
|
-
import "./memory-temporality-classifier-
|
|
10
|
+
import "./memory-temporality-classifier-BwBKEQbL.js";
|
|
11
11
|
import "./scopes-a4Kly9n7.js";
|
|
12
|
-
import "./atomic-memory-extraction-
|
|
12
|
+
import "./atomic-memory-extraction-De86y7O-.js";
|
|
13
13
|
import "./internal/store/sqlite-runtime.js";
|
|
14
14
|
import "./connection-PQcq3TPO.js";
|
|
15
15
|
import "./internal/store/data-paths.js";
|
|
@@ -19,12 +19,12 @@ import "./internal/engine/observability/observable-embedder.js";
|
|
|
19
19
|
import "./internal/engine/observability/observable-llm-client.js";
|
|
20
20
|
import "./internal/engine/observability/observable-memory-store.js";
|
|
21
21
|
import "./internal/engine/retrieval/access-tracker.js";
|
|
22
|
-
import "./retriever-
|
|
22
|
+
import "./retriever-Dnjl_FHu.js";
|
|
23
23
|
import "./internal/engine/observability/observable-retriever.js";
|
|
24
24
|
import "./internal/engine/observability/session-registry.js";
|
|
25
|
-
import "./daily-log-generator-
|
|
26
|
-
import "./reflection-embedded-generator-
|
|
27
|
-
import "./strategy-hook-runner-
|
|
25
|
+
import "./daily-log-generator-DEsiCs7o.js";
|
|
26
|
+
import "./reflection-embedded-generator-DV-NkeU-.js";
|
|
27
|
+
import "./strategy-hook-runner-CALbWcys.js";
|
|
28
28
|
import "./data-bootstrap-P8sie9WA.js";
|
|
29
29
|
import "@snoai/sqlite-crypto";
|
|
30
30
|
export {};
|
|
@@ -6,11 +6,11 @@ import { _ as normalizeState, a as buildInsightMetadata, c as stringifyInsightMe
|
|
|
6
6
|
import { redactSecrets } from "./internal/engine/security/redact.js";
|
|
7
7
|
import { normalizeForCompare, tokenizeForFts } from "./internal/engine/shared/i18n-text.js";
|
|
8
8
|
import { bytesToF32, clamp01, clampInt, f32ToBytes, sanitizeFtsConjunctiveQuery, sanitizeFtsQuery, stableHash } from "./internal/engine/shared/utils.js";
|
|
9
|
-
import { t as checkMemoryOperation } from "./operation-cancellation-
|
|
9
|
+
import { t as checkMemoryOperation } from "./operation-cancellation-QcwC4mDX.js";
|
|
10
10
|
import { u as runWithMemoryAudit } from "./runtime-audit-log-DK6xAYxh.js";
|
|
11
11
|
import { getSnoStationMemStateDir } from "./internal/contract/profile.js";
|
|
12
12
|
import "./internal/engine/extraction/extraction-text-sanitizer.js";
|
|
13
|
-
import "./memory-temporality-classifier-
|
|
13
|
+
import "./memory-temporality-classifier-BwBKEQbL.js";
|
|
14
14
|
import { a as readMemorySourceOrder, i as readCorrectionMoment, n as compareMemoryRetirementOrder, o as readMemorySourceOrderOrOldest, r as compareMemorySourceOrder, s as sameSourceTurn, t as closeMemoryRow } from "./memory-source-order-YMRoeDLd.js";
|
|
15
15
|
import { REM_UPDATE_LOCALES, deriveRemWriteIdentity, getRemUpdateLocaleResource, writeRemTwoFacetTransaction } from "./internal/engine/rem/index.js";
|
|
16
16
|
import { n as state_vocabulary_default, r as attribute_dictionary_default, t as relations } from "./relation-dictionary-Cev1kyLe.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./embedding-provider-client-vynZMuit.js";
|
|
2
|
-
import { B as TaskLifecycleMigrationManifest, H as TaskLifecycleMigrationSourceRow, a as AtomicExtractionRepairStrategy, c as AtomicExtractionRunParameters, n as AtomicExtractionLedgerEntry, o as AtomicExtractionReprocessBounds, s as AtomicExtractionReprocessReason, x as MemoryRelationPredicate, z as TaskLifecycleMigrationCensusRow } from "./memory-store-base-
|
|
2
|
+
import { B as TaskLifecycleMigrationManifest, H as TaskLifecycleMigrationSourceRow, a as AtomicExtractionRepairStrategy, c as AtomicExtractionRunParameters, n as AtomicExtractionLedgerEntry, o as AtomicExtractionReprocessBounds, s as AtomicExtractionReprocessReason, x as MemoryRelationPredicate, z as TaskLifecycleMigrationCensusRow } from "./memory-store-base-D0bLwzyF.js";
|
|
3
3
|
import { a as StorageError } from "./errors-CeVRxf9V.js";
|
|
4
4
|
import "./sqlite-runtime-L_ywirTm.js";
|
|
5
5
|
//#region src/store/memory-store-relation-api.d.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as PluginConfig } from "./plugin-config-schema-
|
|
2
|
-
import "./types-
|
|
3
|
-
import "./reflection-embedded-generator-
|
|
4
|
-
import { t as ReflectionLifecycleParams } from "./reflection-lifecycle-hooks-
|
|
5
|
-
import { t as ReflectionInjectionParams } from "./reflection-injection-hooks-
|
|
6
|
-
import { t as ReflectionDeps } from "./reflection-deps-
|
|
7
|
-
import { t as ReflectionCommandParams } from "./reflection-command-hooks-
|
|
1
|
+
import { t as PluginConfig } from "./plugin-config-schema-BPg-ppSt.js";
|
|
2
|
+
import "./types-Dm_XhSne.js";
|
|
3
|
+
import "./reflection-embedded-generator-ve1PhgUY.js";
|
|
4
|
+
import { t as ReflectionLifecycleParams } from "./reflection-lifecycle-hooks-CFGYh_8m.js";
|
|
5
|
+
import { t as ReflectionInjectionParams } from "./reflection-injection-hooks-CphBCA9F.js";
|
|
6
|
+
import { t as ReflectionDeps } from "./reflection-deps-BYkAaKxD.js";
|
|
7
|
+
import { t as ReflectionCommandParams } from "./reflection-command-hooks-mCOmD8b6.js";
|
|
8
8
|
//#region src/engine/reflection/strategy-hook-runner.d.ts
|
|
9
9
|
declare function createReflectionStrategyState(config: PluginConfig, deps: ReflectionDeps): ReflectionStrategyState;
|
|
10
10
|
type ReflectionStrategyState = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_REFLECTION_SESSION_TTL_MS } from "./internal/config/index.js";
|
|
2
2
|
import { setLruEntry, touchLruEntry } from "./internal/engine/shared/lru.js";
|
|
3
3
|
import { n as createErrorSignalTracker } from "./error-signals-lMH2uAdV.js";
|
|
4
|
-
import { i as pruneReflectionState } from "./reflection-embedded-generator-
|
|
4
|
+
import { i as pruneReflectionState } from "./reflection-embedded-generator-DV-NkeU-.js";
|
|
5
5
|
import { a as loadAgentReflectionSlicesFromEntries } from "./memory-entry-projector-DHo8jH10.js";
|
|
6
6
|
import { createLogger } from "@snoai/utils/logger";
|
|
7
7
|
//#region src/engine/reflection/reflection-slice-loader.ts
|
package/package.json
CHANGED
package/settings.default.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "./types-Ae3a8562.js";
|
|
2
|
-
import "./index-Pb9LrHgL.js";
|
|
3
|
-
import "./embedding-provider-client-vynZMuit.js";
|
|
4
|
-
import "./retriever-DyxY59Lg.js";
|
|
5
|
-
import "./memory-metadata-codec-wVAuoKrG.js";
|
|
6
|
-
import "./store-BDIAl2cc.js";
|
|
7
|
-
import "./capture-policy-detector-BvVGmxxX.js";
|
|
8
|
-
import "./memory-temporality-classifier-CcxfHYoT.js";
|
|
9
|
-
import "./runtime-audit-log-DdhLlTxi.js";
|
|
10
|
-
import { z as z$1 } from "zod";
|
|
11
|
-
import "@snoai/chunking";
|
|
12
|
-
import "@sinclair/typebox";
|
|
13
|
-
import "async-mutex";
|
|
14
|
-
export { z$1 as t };
|