@snoai/memory 1.5.0 → 1.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/README.md +1 -1
- package/dist/{access-tracker-B1H2AJlH.d.ts → access-tracker-CFxRg7Bt.d.ts} +4 -4
- package/dist/{adapter-CgdVA88V.d.ts → adapter-BFtbOOw3.d.ts} +2 -2
- package/dist/{atomic-memory-extraction-DCMTQ0h-.d.ts → atomic-memory-extraction-Bp7AWZqi.d.ts} +4 -4
- package/dist/{atomic-memory-extraction-De86y7O-.js → atomic-memory-extraction-l65aofbl.js} +5 -5
- package/dist/{b-profile-section-dictionary-provider-DbqdRYMw.d.ts → b-profile-section-dictionary-provider-Buj_M-QA.d.ts} +1 -1
- package/dist/{capture-policy-detector-D4ziS7KF.d.ts → capture-policy-detector-3tDQkBi9.d.ts} +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/{config-DWeuetYo.js → config-CByvnX3d.js} +57 -135
- package/dist/{connection-PQcq3TPO.js → connection-BtK-3r-f.js} +1 -20
- package/dist/{connection-3IVXpuPE.d.ts → connection-D989FqGS.d.ts} +1 -17
- package/dist/{derived-suppression-cache-2xOq6XHX.d.ts → derived-suppression-cache-CcANI-p7.d.ts} +1 -1
- package/dist/diagnostic-encoder.js +1 -1
- package/dist/{index-BGu91bjB.d.ts → index-CJrMFlAU.d.ts} +12 -50
- package/dist/{index-PjHhlG6e.d.ts → index-Df9420Pl.d.ts} +2 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +5 -5
- package/dist/internal/config/index.d.ts +2 -2
- package/dist/internal/config/index.js +13 -51
- 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 +17 -48
- 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 +1 -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 +1 -1
- 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 +3 -3
- 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 +1 -1
- package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.d.ts +5 -5
- package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.js +3 -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/eval/trace.js +3 -4
- 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 +2 -2
- 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/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 +2 -2
- 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/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/model/llm-mode-routing.js +1 -1
- package/dist/internal/store/atomic-memory-cutover-sql.js +1 -1
- package/dist/internal/store/connection.d.ts +2 -2
- package/dist/internal/store/connection.js +2 -2
- package/dist/internal/store/maintenance.d.ts +2 -2
- package/dist/internal/store/maintenance.js +5 -5
- package/dist/internal/store/memory-kinds-cutover-migrator.d.ts +0 -2
- package/dist/internal/store/memory-kinds-cutover-migrator.js +1 -10
- package/dist/internal/store/store.d.ts +2 -2
- package/dist/internal/store/store.js +1 -1
- package/dist/{llm-client-DDdUjYWS.js → llm-client-ByzZRemn.js} +8 -5
- package/dist/{llm-client-C-K7oyfu.d.ts → llm-client-nWW1o1F6.d.ts} +1 -1
- package/dist/{log-site-catalog.generated-Cn8rTa65.js → log-site-catalog.generated-DsvDgHJa.js} +101 -171
- package/dist/log-site-catalog.json +1 -1
- package/dist/{memory-entry-projector-DHo8jH10.js → memory-entry-projector-B36Nwsi_.js} +2 -1
- package/dist/{memory-kind-policy-DgPCjfY4.d.ts → memory-kind-policy-BMebgugU.d.ts} +1 -1
- package/dist/{memory-metadata-codec-CfP9JLVO.d.ts → memory-metadata-codec-H8BniJM3.d.ts} +1 -1
- package/dist/{memory-runtime-jQke2sBc.js → memory-runtime-DXr1VO1p.js} +110 -175
- package/dist/{memory-snapshot-B6a-6nJ7.d.ts → memory-snapshot-CKnQovB5.d.ts} +2 -2
- package/dist/{memory-store-base-upd9MuG6.d.ts → memory-store-base-BHYXgsCq.d.ts} +4 -4
- package/dist/{memory-store-shared-CURizQIy.js → memory-store-shared-pOb59ScU.js} +1 -1
- package/dist/{memory-temporality-classifier-BwBKEQbL.js → memory-temporality-classifier-Bauwnls7.js} +2 -2
- package/dist/{memory-temporality-classifier-DPk3_9Or.d.ts → memory-temporality-classifier-Wi6WWeAj.d.ts} +1 -1
- package/dist/{memory-tier-promoter-Cq23yveQ.d.ts → memory-tier-promoter-m60-RlAj.d.ts} +1 -1
- package/dist/{memory-tool-dependencies-aAr7Pkuj.js → memory-tool-dependencies-Cc4SJMtd.js} +1 -1
- package/dist/memory-tool-dependencies-D2fOC-KL.d.ts +14 -0
- package/dist/{model-call-table-DoIl2S0P.js → model-call-table-CPyQfBJ6.js} +7 -7
- package/dist/{observable-embedder-DihQuuQD.d.ts → observable-embedder-0FwxJMhJ.d.ts} +1 -1
- package/dist/{observable-llm-client-BglDBFN5.d.ts → observable-llm-client-DY7w1Fj1.d.ts} +3 -3
- package/dist/{observable-memory-store--n02Dre8.d.ts → observable-memory-store-C25Q_hoW.d.ts} +4 -4
- package/dist/{observable-retriever-CV6odifA.d.ts → observable-retriever-Cs9Bwzq6.d.ts} +5 -5
- package/dist/paths-obFSsJv3.d.ts +1 -0
- package/dist/{plugin-config-schema-D9riSXDg.js → plugin-config-schema-D-IoHmis.js} +22 -43
- package/dist/{plugin-config-schema-dV2_HgBo.d.ts → plugin-config-schema-DQh5njrS.d.ts} +9 -11
- package/dist/{profile-CoLKGobS.d.ts → profile-CcvVR6K8.d.ts} +1 -1
- package/dist/{profile-section-writer-Dd4FKpt5.js → profile-section-writer-CR-WWIoB.js} +2 -2
- package/dist/{reflection-command-hooks-Cfv836Wc.d.ts → reflection-command-hooks-BRLqVNCi.d.ts} +4 -4
- package/dist/{reflection-command-hooks-B2P4zDr6.js → reflection-command-hooks-Der9aX0e.js} +6 -4
- package/dist/{reflection-deps-DihlwQxE.d.ts → reflection-deps-C0TJ-gpU.d.ts} +2 -2
- package/dist/{reflection-embedded-generator-DV-NkeU-.js → reflection-embedded-generator-BEdDusPV.js} +2 -1
- package/dist/{reflection-embedded-generator-DCZaS6kz.d.ts → reflection-embedded-generator-Cs59hWYr.d.ts} +3 -3
- package/dist/{reflection-injection-hooks-BYxkrds6.d.ts → reflection-injection-hooks-Cy4bRemm.d.ts} +4 -4
- package/dist/{reflection-lifecycle-hooks-Bwq2y5pe.d.ts → reflection-lifecycle-hooks-C-lf00DB.d.ts} +3 -3
- package/dist/{rem-batch-executor-B_49KivZ.js → rem-batch-executor-DiU8hSGc.js} +1 -1
- package/dist/{rem-trigger-DL0MlLeo.js → rem-trigger-CBfyJVfh.js} +48 -432
- package/dist/{retriever-hTIkt3CJ.d.ts → retriever-2RJYAvlD.d.ts} +10 -52
- package/dist/{retriever-CsBW6MZv.js → retriever-C54bXeDh.js} +30 -452
- package/dist/{runtime-audit-log-eBrt_iPp.d.ts → runtime-audit-log-D2Hqk_kl.d.ts} +1 -1
- package/dist/{server-BnBzsvMF.js → server-BlbG5uOM.js} +4 -4
- package/dist/sidecar/main.js +2 -2
- package/dist/sno-station-mem-runtime-dependencies-ByI3b-wB.d.ts +31 -0
- package/dist/{sno-station-mem-runtime-dependencies-DrVDRAmf.js → sno-station-mem-runtime-dependencies-DsidkZi2.js} +7 -7
- package/dist/{store-COwW7mIh.js → store-Bja1tVFw.js} +3 -3
- package/dist/{store-DEG06TLb.d.ts → store-Bz0y76cJ.d.ts} +1 -1
- package/dist/{strategy-hook-runner-CALbWcys.js → strategy-hook-runner-F-ruiw48.js} +2 -2
- package/dist/{strategy-hook-runner-D1sRVThs.d.ts → strategy-hook-runner-vbrWiDbK.d.ts} +7 -7
- package/dist/{types-DBEwNYdR.d.ts → types-El7jViCz.d.ts} +1 -1
- package/package.json +1 -1
- package/settings.default.json +2 -3
- package/dist/memory-tool-dependencies-C9qgVGOn.d.ts +0 -14
- package/dist/paths-qJqwGcKl.d.ts +0 -1
- package/dist/sno-station-mem-runtime-dependencies-9L8WkMMV.d.ts +0 -31
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Who it is for: you do not use this package directly. Follow the
|
|
|
28
28
|
plugins use to reach the service.
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install @snoai/memory@1.
|
|
31
|
+
npm install @snoai/memory@1.6.0
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Needs Node.js 22.22.3+, 24.15.0+ or 25.9.0+. Licensed under Apache-2.0.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { v as MemoryMetadata } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import { C as MemoryStore } from "./memory-store-base-
|
|
4
|
-
import "./store-
|
|
1
|
+
import { v as MemoryMetadata } from "./types-El7jViCz.js";
|
|
2
|
+
import { tn as RecallLifecycleConfig } from "./index-CJrMFlAU.js";
|
|
3
|
+
import { C as MemoryStore } from "./memory-store-base-BHYXgsCq.js";
|
|
4
|
+
import "./store-Bz0y76cJ.js";
|
|
5
5
|
//#region src/engine/retrieval/access-tracker.d.ts
|
|
6
6
|
interface AccessMetadata {
|
|
7
7
|
readonly accessCount: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PluginConfig } from "./plugin-config-schema-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { t as PluginConfig } from "./plugin-config-schema-DQh5njrS.js";
|
|
2
|
+
import "./types-El7jViCz.js";
|
|
3
3
|
import { t as ObserveLogger } from "./best-effort-BPZSzKk0.js";
|
|
4
4
|
import { AgentId, EventType, JsonObject } from "@snoai/observability";
|
|
5
5
|
//#region src/engine/observability/cost-aggregator.d.ts
|
package/dist/{atomic-memory-extraction-DCMTQ0h-.d.ts → atomic-memory-extraction-Bp7AWZqi.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as LlmClientConfig, l as ModelCallId, p as LlmRoutingConfig, r as LlmClient } from "./plugin-config-schema-
|
|
1
|
+
import { i as LlmClientConfig, l as ModelCallId, p as LlmRoutingConfig, r as LlmClient } from "./plugin-config-schema-DQh5njrS.js";
|
|
2
2
|
import { n as Locale } from "./locales-JxGmkG6t.js";
|
|
3
3
|
import { qt as AdapterAMemoryView } from "./index-DPfJrOFD.js";
|
|
4
|
-
import { C as MemoryStore, c as AtomicExtractionRunParameters, f as AtomicExtractionWriteResult, g as BeginAtomicExtractionChunkResult, r as AtomicExtractionLedgerKey, s as AtomicExtractionReprocessReason, x as MemoryRelationPredicate } from "./memory-store-base-
|
|
5
|
-
import "./store-
|
|
6
|
-
import "./llm-client-
|
|
4
|
+
import { C as MemoryStore, c as AtomicExtractionRunParameters, f as AtomicExtractionWriteResult, g as BeginAtomicExtractionChunkResult, r as AtomicExtractionLedgerKey, s as AtomicExtractionReprocessReason, x as MemoryRelationPredicate } from "./memory-store-base-BHYXgsCq.js";
|
|
5
|
+
import "./store-Bz0y76cJ.js";
|
|
6
|
+
import "./llm-client-nWW1o1F6.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/engine/extraction/calendar-instruction.d.ts
|
|
9
9
|
type CalendarPrecision = "year" | "month" | "week" | "day" | "minute";
|
|
@@ -3,21 +3,21 @@ import "./internal/engine/i18n/locales.js";
|
|
|
3
3
|
import { $ as FIXED_MEMORY_SNO_EXTRACT_PROFILE, Q as FIXED_MEMORY_SNO_EXTRACT_CHAT } from "./signed-registry-constants-yq3DlG3B.js";
|
|
4
4
|
import { redactSecrets } from "./internal/engine/security/redact.js";
|
|
5
5
|
import { t as appendAuditEntry } from "./runtime-audit-log-DK6xAYxh.js";
|
|
6
|
-
import { a as isTerminalLlmFailure, i as createLlmClient, n as LlmClientTerminalError } from "./llm-client-
|
|
6
|
+
import { a as isTerminalLlmFailure, i as createLlmClient, n as LlmClientTerminalError } from "./llm-client-ByzZRemn.js";
|
|
7
7
|
import { n as readModelReplyJson } from "./model-reply-text-CKopStP2.js";
|
|
8
8
|
import { resolveLlmRoute } from "./internal/model/llm-mode-routing.js";
|
|
9
9
|
import { n as ATOMIC_EXTRACTION_SKILL_HASH, r as atomicExtractionSkillReference, t as ATOMIC_EXTRACTION_SKILL } from "./atomic-extraction-skill-CcXmuCqL.js";
|
|
10
10
|
import { stripEnvelopeMetadata } from "./internal/engine/extraction/extraction-text-sanitizer.js";
|
|
11
11
|
import { a as sessionZoneCarriedBy, t as calculateCalendarTime } from "./calendar-instruction-CzqZbAPG.js";
|
|
12
|
-
import "./memory-temporality-classifier-
|
|
12
|
+
import "./memory-temporality-classifier-Bauwnls7.js";
|
|
13
13
|
import { a as parseAtomicCaptureReply, c as atomic_extraction_response_schema_default, i as fallbackAtomicCapturedFact, l as excludeProgressRecords, n as ATOMIC_ENRICHMENT_RESPONSE_JSON_SCHEMA, o as parseAtomicEnrichmentReply, r as ATOMIC_EXTRACTION_RESPONSE_JSON_SCHEMA, s as parseAtomicExtractionReply, t as ATOMIC_CAPTURE_RESPONSE_JSON_SCHEMA } from "./atomic-extraction-reply-BJ9XV_9s.js";
|
|
14
14
|
import { adapterAViewFromRecord, isAdapterAVerdictReply, parseAdapterAChatVerdict, renderAdapterAChatPrompt, renderAdapterAPrompt } from "./internal/engine/rem/index.js";
|
|
15
15
|
import { n as state_vocabulary_default, r as attribute_dictionary_default, t as relations } from "./relation-dictionary-Cev1kyLe.js";
|
|
16
|
-
import { g as randomUUID$1 } from "./memory-store-shared-
|
|
17
|
-
import { b as normalizeMemoryRelationPredicate, d as normalizeEntityName, f as recordAtomicEntityIdentityJournal, g as readAtomicArrivalRetirementCandidateSet, h as journalAtomicArrivalRetirementRefusal, m as closeAtomicArrivalRetirementTargets, u as listAtomicMemoryEntityCandidates, v as AtomicExtractionCompletedElsewhere } from "./store-
|
|
16
|
+
import { g as randomUUID$1 } from "./memory-store-shared-pOb59ScU.js";
|
|
17
|
+
import { b as normalizeMemoryRelationPredicate, d as normalizeEntityName, f as recordAtomicEntityIdentityJournal, g as readAtomicArrivalRetirementCandidateSet, h as journalAtomicArrivalRetirementRefusal, m as closeAtomicArrivalRetirementTargets, u as listAtomicMemoryEntityCandidates, v as AtomicExtractionCompletedElsewhere } from "./store-Bja1tVFw.js";
|
|
18
18
|
import { o as normalizeTopicToSectionName } from "./b-profile-section-dictionary-provider-BHkoNqgk.js";
|
|
19
19
|
import { r as recordTokenCounter } from "./memory-store-write-validation-B_hDG2zf.js";
|
|
20
|
-
import { i as prepareDeterministicTaskLifecycleWrite, t as PROFILE_IDENTITY_SECTION } from "./profile-section-writer-
|
|
20
|
+
import { i as prepareDeterministicTaskLifecycleWrite, t as PROFILE_IDENTITY_SECTION } from "./profile-section-writer-CR-WWIoB.js";
|
|
21
21
|
import { z } from "zod";
|
|
22
22
|
import { countTokens } from "@snoai/chunking";
|
|
23
23
|
import { createLogger, currentLogContext, privateLogReference, withLogContext } from "@snoai/utils/logger";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as ProductMode } from "./plugin-config-schema-
|
|
1
|
+
import { g as ProductMode } from "./plugin-config-schema-DQh5njrS.js";
|
|
2
2
|
import { n as Locale } from "./locales-JxGmkG6t.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/engine/extraction/b-profile-section-registry.d.ts
|
package/dist/{capture-policy-detector-D4ziS7KF.d.ts → capture-policy-detector-3tDQkBi9.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as MemoryCategory } from "./types-
|
|
1
|
+
import { h as MemoryCategory } from "./types-El7jViCz.js";
|
|
2
2
|
//#region src/engine/extraction/capture-policy-detector.d.ts
|
|
3
3
|
declare const PROMPT_INJECTION_PATTERNS: RegExp[];
|
|
4
4
|
/** Implements looks like prompt injection as the local memory capture policy operation. */
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Discovery } from "./internal/contract/discovery.js";
|
|
2
|
-
import { B as Registration, F as Inspection, H as Turn, I as JsonValue, L as Message, N as HostEvent, P as InitRegistration, R as Mutation, U as UsageSignal, V as ScopeCtx, n as MemoryContract, rt as DegradedReason, tt as ContractError, y as ContractOutputs, z as RecallOptions } from "./index-
|
|
2
|
+
import { B as Registration, F as Inspection, H as Turn, I as JsonValue, L as Message, N as HostEvent, P as InitRegistration, R as Mutation, U as UsageSignal, V as ScopeCtx, n as MemoryContract, rt as DegradedReason, tt as ContractError, y as ContractOutputs, z as RecallOptions } from "./index-Df9420Pl.js";
|
|
3
3
|
//#region src/contract/client.d.ts
|
|
4
4
|
export interface ConnectOptions {
|
|
5
5
|
skinId: string;
|
|
@@ -641,7 +641,7 @@ async function ensureModelDownloaded(opts) {
|
|
|
641
641
|
*
|
|
642
642
|
* Self-contained: all params via constructor; no app-level config dependency.
|
|
643
643
|
*/
|
|
644
|
-
const log$1
|
|
644
|
+
const log$1 = createLogger("embedder:local");
|
|
645
645
|
let sharedExtractor;
|
|
646
646
|
let sharedLoading$1;
|
|
647
647
|
let sharedRefCount = 0;
|
|
@@ -688,7 +688,7 @@ var ModelNotLoadedError = class extends Error {
|
|
|
688
688
|
this.name = "ModelNotLoadedError";
|
|
689
689
|
}
|
|
690
690
|
};
|
|
691
|
-
var LocalEmbedProvider = class
|
|
691
|
+
var LocalEmbedProvider = class {
|
|
692
692
|
_disposed = false;
|
|
693
693
|
cacheDir;
|
|
694
694
|
dtype;
|
|
@@ -701,14 +701,8 @@ var LocalEmbedProvider = class LocalEmbedProvider {
|
|
|
701
701
|
pipelineKey;
|
|
702
702
|
offline;
|
|
703
703
|
mirror;
|
|
704
|
-
/**
|
|
705
|
-
* Guard: transformers `env` is process-global — only one cacheDir is allowed per process.
|
|
706
|
-
* Intentionally never reset during normal operation; use `resetStaticState()` only in tests.
|
|
707
|
-
*/
|
|
708
|
-
static configuredCacheDir;
|
|
709
704
|
/** Reset static state — FOR TESTS ONLY. Not safe in production. */
|
|
710
705
|
static resetStaticState() {
|
|
711
|
-
LocalEmbedProvider.configuredCacheDir = void 0;
|
|
712
706
|
sharedExtractor = void 0;
|
|
713
707
|
sharedLoading$1 = void 0;
|
|
714
708
|
sharedRefCount = 0;
|
|
@@ -766,10 +760,8 @@ var LocalEmbedProvider = class LocalEmbedProvider {
|
|
|
766
760
|
throw new Error("LocalEmbedProvider shared ONNX pipeline is already loaded with a different model, revision, dtype, cacheDir, or sessionOptions. Dispose all live providers before changing pipeline configuration.");
|
|
767
761
|
}
|
|
768
762
|
async initPipeline() {
|
|
769
|
-
if (LocalEmbedProvider.configuredCacheDir !== void 0 && LocalEmbedProvider.configuredCacheDir !== this.cacheDir) throw new Error(`transformers env is global; LocalEmbedProvider cacheDir must be consistent (existing: ${LocalEmbedProvider.configuredCacheDir}, requested: ${this.cacheDir})`);
|
|
770
|
-
LocalEmbedProvider.configuredCacheDir = this.cacheDir;
|
|
771
763
|
const { pipeline } = await import("@huggingface/transformers");
|
|
772
|
-
log$1
|
|
764
|
+
log$1.info("loading ONNX model", {
|
|
773
765
|
model: this.modelId,
|
|
774
766
|
cacheDir: this.cacheDir,
|
|
775
767
|
dtype: this.dtype,
|
|
@@ -801,7 +793,7 @@ var LocalEmbedProvider = class LocalEmbedProvider {
|
|
|
801
793
|
throw error;
|
|
802
794
|
});
|
|
803
795
|
const durationMs = Math.round(performance.now() - t0);
|
|
804
|
-
log$1
|
|
796
|
+
log$1.info("ONNX model loaded", {
|
|
805
797
|
durationMs,
|
|
806
798
|
model: this.modelId
|
|
807
799
|
}, {
|
|
@@ -814,7 +806,7 @@ var LocalEmbedProvider = class LocalEmbedProvider {
|
|
|
814
806
|
} catch (error) {
|
|
815
807
|
const msg = error instanceof Error ? error.message : String(error);
|
|
816
808
|
if (msg.includes("no such file") || msg.includes("ENOENT") || msg.includes("not found") || msg.includes("Could not locate file")) {
|
|
817
|
-
log$1
|
|
809
|
+
log$1.error("ONNX model not found", {
|
|
818
810
|
cacheDir: this.cacheDir,
|
|
819
811
|
model: this.modelId
|
|
820
812
|
}, {
|
|
@@ -825,7 +817,7 @@ var LocalEmbedProvider = class LocalEmbedProvider {
|
|
|
825
817
|
});
|
|
826
818
|
throw new ModelNotFoundError(this.modelId);
|
|
827
819
|
}
|
|
828
|
-
log$1
|
|
820
|
+
log$1.error("ONNX model init failed", { error }, {
|
|
829
821
|
event_name: "embedder.local.provider.initpipeline",
|
|
830
822
|
file: "packages/embedder/src/local-provider.ts",
|
|
831
823
|
function: "initPipeline",
|
|
@@ -857,7 +849,7 @@ var LocalEmbedProvider = class LocalEmbedProvider {
|
|
|
857
849
|
}
|
|
858
850
|
async embedDocuments(texts) {
|
|
859
851
|
if (texts.length === 0) return [];
|
|
860
|
-
log$1
|
|
852
|
+
log$1.debug("batch local embedding", { count: texts.length }, {
|
|
861
853
|
event_name: "embedder.local.provider.embeddocuments",
|
|
862
854
|
file: "packages/embedder/src/local-provider.ts",
|
|
863
855
|
function: "embedDocuments",
|
|
@@ -873,7 +865,7 @@ var LocalEmbedProvider = class LocalEmbedProvider {
|
|
|
873
865
|
}
|
|
874
866
|
async dispose() {
|
|
875
867
|
if (this._disposed) return;
|
|
876
|
-
log$1
|
|
868
|
+
log$1.debug("disposing local embedding provider", {}, {
|
|
877
869
|
event_name: "embedder.local.provider.dispose",
|
|
878
870
|
file: "packages/embedder/src/local-provider.ts",
|
|
879
871
|
function: "dispose",
|
|
@@ -1334,32 +1326,15 @@ const IMPORTANCE_WEIGHT_BASE = .7;
|
|
|
1334
1326
|
/** Minimum time decay multiplier (floor for very old entries) */
|
|
1335
1327
|
const TIME_DECAY_FLOOR = .6;
|
|
1336
1328
|
/**
|
|
1337
|
-
* Relevance vs diversity tradeoff for MMR (0.
|
|
1329
|
+
* Relevance vs diversity tradeoff for MMR (0.9 = 90% relevance, 10% diversity).
|
|
1338
1330
|
* `applyMmrDiversity` normalizes the relevance term to [0,1] (batch-max) before
|
|
1339
1331
|
* applying this weight — without that normalization, the shrinker chain above
|
|
1340
1332
|
* compresses relevance so far below the [0,1] cosine-similarity diversity term
|
|
1341
1333
|
* that this ratio was moot (diversity always won). Fixed 2026-07-05.
|
|
1342
1334
|
*/
|
|
1343
|
-
const MMR_LAMBDA = .
|
|
1344
|
-
/**
|
|
1345
|
-
const
|
|
1346
|
-
/** Weight for cross-encoder score in rerank blend */
|
|
1347
|
-
const RERANK_BLEND_CROSS = .7;
|
|
1348
|
-
/**
|
|
1349
|
-
* Fusion-score weight in local cosine-blend rerank.
|
|
1350
|
-
*
|
|
1351
|
-
* The fused score keeps a keyword-only hit at its full keyword score, so a memory sharing one word with the query
|
|
1352
|
-
* outranks the one that answers it; at 0.7 the local ranking passed that order through almost unchanged. Measured
|
|
1353
|
-
* 2026-10-15 on LoCoMo (1,540 questions, the product store and retriever, weights fitted on half the conversations
|
|
1354
|
-
* and checked on the other half): the right memory in the first five went from 27% to 68% in English and from 9% to
|
|
1355
|
-
* 58% in a Chinese translation at 0.1 / 0.9. A candidate with no stored vector keeps its fused score and would now
|
|
1356
|
-
* rank high; none of 27,064 candidates in 299 real local rankings lacked one.
|
|
1357
|
-
*/
|
|
1358
|
-
const LIGHTWEIGHT_FUSION_WEIGHT = .1;
|
|
1359
|
-
/** Cosine-similarity weight in local cosine-blend rerank */
|
|
1360
|
-
const LIGHTWEIGHT_COSINE_WEIGHT = .9;
|
|
1361
|
-
/** Default timeout for rerank API calls in milliseconds */
|
|
1362
|
-
const DEFAULT_RERANK_TIMEOUT_MS = 15e3;
|
|
1335
|
+
const MMR_LAMBDA = .9;
|
|
1336
|
+
/** Maximum wait for the local reranker in milliseconds; caller deadlines may be earlier. */
|
|
1337
|
+
const DEFAULT_RERANK_TIMEOUT_MS = 2e3;
|
|
1363
1338
|
/**
|
|
1364
1339
|
* Maximum allowed list query page size; also caps each search branch
|
|
1365
1340
|
* (`memory-store-search-api.ts` clamps both the semantic and the keyword branch to it), so it
|
|
@@ -1490,8 +1465,6 @@ const ADJACENCY_BONUS_CAP = DEFAULT_AGGREGATION_CONFIG.adjacencyBonusCap;
|
|
|
1490
1465
|
const BONUS_TOTAL_INVARIANT = DEFAULT_AGGREGATION_CONFIG.bonusTotalInvariant;
|
|
1491
1466
|
/** Filename for per-QA retrieval traces emitted during eval runs. */
|
|
1492
1467
|
const EVAL_QA_TRACES_FILENAME = "qa_traces.jsonl";
|
|
1493
|
-
/** Multiplicative penalty applied to unreturned candidates after rerank. */
|
|
1494
|
-
const LIGHTWEIGHT_RERANK_PENALTY = .8;
|
|
1495
1468
|
/**
|
|
1496
1469
|
* Zod schema for the `recallLifecycle` config block. The whole block defaults
|
|
1497
1470
|
* to `{}` so existing configs without it continue to parse and behave
|
|
@@ -1715,6 +1688,11 @@ const extractionConfigSchema = z.object({ llm: z.object({
|
|
|
1715
1688
|
baseURL: z.string().optional(),
|
|
1716
1689
|
/** Overrides provider-native env if set. */
|
|
1717
1690
|
apiKey: z.string().optional(),
|
|
1691
|
+
usageClass: z.enum([
|
|
1692
|
+
"product",
|
|
1693
|
+
"research",
|
|
1694
|
+
"ops"
|
|
1695
|
+
]).optional(),
|
|
1718
1696
|
timeoutMs: z.number().int().min(1e3).max(3e5).default(3e4)
|
|
1719
1697
|
}).strict().prefault({}) }).strict().prefault({});
|
|
1720
1698
|
const memoryReflectionConfigSchema = z.object({
|
|
@@ -1794,7 +1772,20 @@ const observeConfigSchema = z.object({
|
|
|
1794
1772
|
});
|
|
1795
1773
|
//#endregion
|
|
1796
1774
|
//#region config/plugin-config-retrieval-schema.ts
|
|
1797
|
-
const log
|
|
1775
|
+
const log = createLogger("sno-station-mem:config:retrieval");
|
|
1776
|
+
/** Published remote selections now run the existing local pipeline. */
|
|
1777
|
+
const rerankModeSchema = z.preprocess((value) => {
|
|
1778
|
+
if (value !== "cross-encoder") return value;
|
|
1779
|
+
log.info("remote reranking retired; using the local reranker", { cause: "remote-rerank-retired" }, {
|
|
1780
|
+
event_name: "memory.rerank.retired",
|
|
1781
|
+
file: "packages/memory/config/plugin-config-retrieval-schema.ts",
|
|
1782
|
+
function: "rerankModeSchema",
|
|
1783
|
+
site_id: "memory.rerank.retired"
|
|
1784
|
+
});
|
|
1785
|
+
return "lightweight";
|
|
1786
|
+
}, z.enum(["lightweight", "none"]));
|
|
1787
|
+
/** Accept published wait settings, but use no more than the local search budget. */
|
|
1788
|
+
const rerankTimeoutSchema = z.number().int().min(1e3).max(12e4).transform((value) => Math.min(value, DEFAULT_RERANK_TIMEOUT_MS));
|
|
1798
1789
|
const retrievalConfigSchema = z.object({
|
|
1799
1790
|
mode: z.enum(["precision-recall", "vector"]).default("precision-recall"),
|
|
1800
1791
|
/**
|
|
@@ -1807,14 +1798,9 @@ const retrievalConfigSchema = z.object({
|
|
|
1807
1798
|
vectorWeight: z.number().min(0).max(1).default(DEFAULT_VECTOR_WEIGHT),
|
|
1808
1799
|
bm25Weight: z.number().min(0).max(1).default(DEFAULT_BM25_WEIGHT),
|
|
1809
1800
|
minScore: z.number().min(0).max(1).default(0),
|
|
1810
|
-
rerank:
|
|
1811
|
-
"cross-encoder",
|
|
1812
|
-
"lightweight",
|
|
1813
|
-
"none"
|
|
1814
|
-
]).default("lightweight"),
|
|
1801
|
+
rerank: rerankModeSchema.default("lightweight"),
|
|
1815
1802
|
candidatePoolSize: z.number().int().min(10).max(2e3).default(64),
|
|
1816
|
-
|
|
1817
|
-
rerankTimeoutMs: z.number().int().min(1e3).max(12e4).default(DEFAULT_RERANK_TIMEOUT_MS),
|
|
1803
|
+
rerankTimeoutMs: rerankTimeoutSchema.default(DEFAULT_RERANK_TIMEOUT_MS),
|
|
1818
1804
|
recencyHalfLifeDays: z.number().min(0).max(365).default(14),
|
|
1819
1805
|
recencyWeight: z.number().min(0).max(RECENCY_WEIGHT_MAX).default(RECENCY_WEIGHT),
|
|
1820
1806
|
/** Drop memories past their valid_until timestamp (default OFF — needs A/B eval) */
|
|
@@ -1826,10 +1812,6 @@ const retrievalConfigSchema = z.object({
|
|
|
1826
1812
|
lengthNormAnchor: z.number().int().min(0).max(5e3).default(0),
|
|
1827
1813
|
hardMinScore: z.number().min(0).max(1).default(0),
|
|
1828
1814
|
timeDecayHalfLifeDays: z.number().min(0).max(365).default(60),
|
|
1829
|
-
/** Weight for fusion score in rerank blend */
|
|
1830
|
-
rerankBlendVector: z.number().min(0).max(1).optional(),
|
|
1831
|
-
/** Weight for cross-encoder score in rerank blend */
|
|
1832
|
-
rerankBlendCross: z.number().min(0).max(1).optional(),
|
|
1833
1815
|
/** Fusion-score weight when rerank="lightweight" (local cosine blend) */
|
|
1834
1816
|
lightweightFusionWeight: z.number().min(0).max(1).optional(),
|
|
1835
1817
|
/** Cosine-score weight when rerank="lightweight" (local cosine blend) */
|
|
@@ -1840,41 +1822,11 @@ const retrievalConfigSchema = z.object({
|
|
|
1840
1822
|
timeDecayFloor: z.number().min(0).max(1).optional(),
|
|
1841
1823
|
/** Relevance vs diversity tradeoff (default: 0.7) */
|
|
1842
1824
|
mmrLambda: z.number().min(0).max(1).optional(),
|
|
1843
|
-
/** Address of Sno's reranker (the Sno GPU address plus `/rerank`). */
|
|
1844
|
-
rerankEndpoint: z.string().optional(),
|
|
1845
|
-
/** Cap on candidates sent to Sno's reranker in total */
|
|
1846
|
-
rerankMaxCandidates: z.number().int().min(1).max(2e3).optional(),
|
|
1847
1825
|
/** Scaling factor for access-based reinforcement (0 = disabled, default: 0.5) */
|
|
1848
1826
|
reinforcementFactor: z.number().min(0).max(5).default(.5),
|
|
1849
1827
|
/** Hard cap: effective half-life <= baseHalfLife * maxHalfLifeMultiplier (default: 3) */
|
|
1850
1828
|
maxHalfLifeMultiplier: z.number().min(1).max(10).default(3)
|
|
1851
|
-
}).prefault({})
|
|
1852
|
-
if (ret.rerank === "none") return ret;
|
|
1853
|
-
if (ret.rerankEndpoint !== void 0) try {
|
|
1854
|
-
new URL(ret.rerankEndpoint);
|
|
1855
|
-
} catch {
|
|
1856
|
-
ctx.addIssue({
|
|
1857
|
-
code: z.ZodIssueCode.custom,
|
|
1858
|
-
path: ["rerankEndpoint"],
|
|
1859
|
-
message: `Invalid rerankEndpoint URL: "${ret.rerankEndpoint}"`
|
|
1860
|
-
});
|
|
1861
|
-
}
|
|
1862
|
-
const rerankApiKey = ret.rerankApiKey;
|
|
1863
|
-
if (ret.rerank === "cross-encoder" && !rerankApiKey?.trim()) {
|
|
1864
|
-
log$1.error("memory.rerank.key.missing", { cause: "missing-rerank-key" }, {
|
|
1865
|
-
event_name: "memory.rerank.key.missing",
|
|
1866
|
-
file: "packages/memory/config/plugin-config-retrieval-schema.ts",
|
|
1867
|
-
function: "retrievalConfigSchema",
|
|
1868
|
-
site_id: "memory.rerank.key.missing"
|
|
1869
|
-
});
|
|
1870
|
-
ctx.addIssue({
|
|
1871
|
-
code: z.ZodIssueCode.custom,
|
|
1872
|
-
path: ["rerankApiKey"],
|
|
1873
|
-
message: "retrieval.rerankApiKey is required for cross-encoder reranking"
|
|
1874
|
-
});
|
|
1875
|
-
}
|
|
1876
|
-
return ret;
|
|
1877
|
-
});
|
|
1829
|
+
}).prefault({});
|
|
1878
1830
|
//#endregion
|
|
1879
1831
|
//#region config/session-strategy.ts
|
|
1880
1832
|
/** @file session-strategy.ts
|
|
@@ -2375,13 +2327,13 @@ const MODEL_CALLS = {
|
|
|
2375
2327
|
}
|
|
2376
2328
|
},
|
|
2377
2329
|
R2: {
|
|
2378
|
-
description: "label local sessions before the
|
|
2379
|
-
calledBy: "
|
|
2330
|
+
description: "label local sessions before the Self Learning cloud upload",
|
|
2331
|
+
calledBy: "Self Learning",
|
|
2380
2332
|
destinations: host
|
|
2381
2333
|
},
|
|
2382
2334
|
R3: {
|
|
2383
|
-
description: "upload sessions nightly for
|
|
2384
|
-
calledBy: "
|
|
2335
|
+
description: "upload sessions nightly for Self Learning",
|
|
2336
|
+
calledBy: "Self Learning",
|
|
2385
2337
|
destinations: {
|
|
2386
2338
|
"local-first": "off",
|
|
2387
2339
|
"agent-native": "sno-gpu",
|
|
@@ -2390,7 +2342,7 @@ const MODEL_CALLS = {
|
|
|
2390
2342
|
},
|
|
2391
2343
|
R4: {
|
|
2392
2344
|
description: "recall one relevant cloud experience on a session's first prompt",
|
|
2393
|
-
calledBy: "
|
|
2345
|
+
calledBy: "Self Learning",
|
|
2394
2346
|
destinations: {
|
|
2395
2347
|
"local-first": "off",
|
|
2396
2348
|
"agent-native": "sno-gpu",
|
|
@@ -2398,8 +2350,8 @@ const MODEL_CALLS = {
|
|
|
2398
2350
|
}
|
|
2399
2351
|
},
|
|
2400
2352
|
R5: {
|
|
2401
|
-
description: "generate local lessons and skill reminders nightly",
|
|
2402
|
-
calledBy: "
|
|
2353
|
+
description: "generate local lessons and skill reminders nightly for Self Learning",
|
|
2354
|
+
calledBy: "Self Learning",
|
|
2403
2355
|
destinations: {
|
|
2404
2356
|
"local-first": "host",
|
|
2405
2357
|
"agent-native": "off",
|
|
@@ -2587,7 +2539,6 @@ function modelCallDestination(callId, mode, modelCalls) {
|
|
|
2587
2539
|
}
|
|
2588
2540
|
//#endregion
|
|
2589
2541
|
//#region config/settings.ts
|
|
2590
|
-
const log = createLogger("sno-station-mem:config:settings");
|
|
2591
2542
|
const destination = z.enum([
|
|
2592
2543
|
"off",
|
|
2593
2544
|
"host",
|
|
@@ -2610,15 +2561,14 @@ const settingsSchema = z.strictObject({
|
|
|
2610
2561
|
baseUrl: z.string(),
|
|
2611
2562
|
apiKey: z.string()
|
|
2612
2563
|
}),
|
|
2613
|
-
rerank: z.
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
timeoutMs:
|
|
2620
|
-
|
|
2621
|
-
}),
|
|
2564
|
+
rerank: z.preprocess((value) => {
|
|
2565
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) || !("maxCandidates" in value)) return value;
|
|
2566
|
+
const { maxCandidates: _retired, ...current } = value;
|
|
2567
|
+
return current;
|
|
2568
|
+
}, z.strictObject({
|
|
2569
|
+
mode: rerankModeSchema,
|
|
2570
|
+
timeoutMs: rerankTimeoutSchema
|
|
2571
|
+
})),
|
|
2622
2572
|
store: z.strictObject({
|
|
2623
2573
|
path: z.string(),
|
|
2624
2574
|
encryptionKey: z.string().min(1).regex(/^[0-9a-f]{64}$/u)
|
|
@@ -2707,9 +2657,8 @@ function defaultSettings() {
|
|
|
2707
2657
|
apiKey: ""
|
|
2708
2658
|
},
|
|
2709
2659
|
rerank: {
|
|
2710
|
-
mode: "
|
|
2711
|
-
timeoutMs: engine.retrieval.rerankTimeoutMs
|
|
2712
|
-
maxCandidates: 64
|
|
2660
|
+
mode: "lightweight",
|
|
2661
|
+
timeoutMs: engine.retrieval.rerankTimeoutMs
|
|
2713
2662
|
},
|
|
2714
2663
|
store: {
|
|
2715
2664
|
path: "",
|
|
@@ -2776,32 +2725,7 @@ function defaultSettings() {
|
|
|
2776
2725
|
}
|
|
2777
2726
|
};
|
|
2778
2727
|
}
|
|
2779
|
-
|
|
2780
|
-
* Recall ranking is local, or Sno's reranker: its address is the Sno GPU address and its key is the Sno GPU key. Only
|
|
2781
|
-
* REM Enhanced calls Sno GPU; any other mode, or no key yet, ranks locally, which is the configured strategy, not an error.
|
|
2782
|
-
*/
|
|
2783
|
-
function rerankSettings(settings) {
|
|
2784
|
-
const { rerank, snoGpu } = settings;
|
|
2785
|
-
let endpoint;
|
|
2786
|
-
try {
|
|
2787
|
-
endpoint = new URL("rerank", snoGpu.baseUrl.endsWith("/") ? snoGpu.baseUrl : `${snoGpu.baseUrl}/`).toString();
|
|
2788
|
-
} catch {
|
|
2789
|
-
log.warn("memory.rerank.sno_gpu_address.invalid", { cause: "snoGpu.baseUrl is not a valid address; recall ranks locally" }, {
|
|
2790
|
-
event_name: "memory.rerank.sno_gpu_address.invalid",
|
|
2791
|
-
file: "packages/memory/config/settings.ts",
|
|
2792
|
-
function: "rerankSettings",
|
|
2793
|
-
site_id: "memory.rerank.sno_gpu_address.invalid"
|
|
2794
|
-
});
|
|
2795
|
-
}
|
|
2796
|
-
const local = rerank.mode !== "cross-encoder" || settings.mode !== "rem-enhanced" || !snoGpu.apiKey || endpoint === void 0;
|
|
2797
|
-
return {
|
|
2798
|
-
rerank: local && rerank.mode === "cross-encoder" ? "lightweight" : rerank.mode,
|
|
2799
|
-
endpoint: local ? void 0 : endpoint,
|
|
2800
|
-
apiKey: local ? "" : snoGpu.apiKey
|
|
2801
|
-
};
|
|
2802
|
-
}
|
|
2803
|
-
function settingsToPluginConfig(settings) {
|
|
2804
|
-
const sno = rerankSettings(settings);
|
|
2728
|
+
function settingsToPluginConfig(settings, usageClass) {
|
|
2805
2729
|
return pluginConfigSchema.parse({
|
|
2806
2730
|
mode: settings.mode,
|
|
2807
2731
|
modelCalls: settings.modelCalls,
|
|
@@ -2818,13 +2742,10 @@ function settingsToPluginConfig(settings) {
|
|
|
2818
2742
|
sessionOptions: { intraOpNumThreads: settings.embedding.threads || void 0 }
|
|
2819
2743
|
},
|
|
2820
2744
|
retrieval: {
|
|
2821
|
-
rerank:
|
|
2745
|
+
rerank: settings.rerank.mode,
|
|
2822
2746
|
recallTopK: settings.recall.prompt.limit,
|
|
2823
2747
|
minScore: settings.recall.prompt.minScore,
|
|
2824
|
-
|
|
2825
|
-
rerankApiKey: sno.apiKey,
|
|
2826
|
-
rerankTimeoutMs: settings.rerank.timeoutMs,
|
|
2827
|
-
rerankMaxCandidates: settings.rerank.maxCandidates
|
|
2748
|
+
rerankTimeoutMs: settings.rerank.timeoutMs
|
|
2828
2749
|
},
|
|
2829
2750
|
autoRecall: settings.recall.auto,
|
|
2830
2751
|
autoRecallTimeoutMs: settings.recall.prompt.timeoutMs,
|
|
@@ -2845,7 +2766,8 @@ function settingsToPluginConfig(settings) {
|
|
|
2845
2766
|
observe: settings.telemetry.observe,
|
|
2846
2767
|
extraction: { llm: {
|
|
2847
2768
|
baseURL: settings.snoGpu.baseUrl,
|
|
2848
|
-
apiKey: settings.snoGpu.apiKey
|
|
2769
|
+
apiKey: settings.snoGpu.apiKey,
|
|
2770
|
+
usageClass
|
|
2849
2771
|
} }
|
|
2850
2772
|
});
|
|
2851
2773
|
}
|
|
@@ -3005,4 +2927,4 @@ function readMaintenanceOverrides() {
|
|
|
3005
2927
|
};
|
|
3006
2928
|
}
|
|
3007
2929
|
//#endregion
|
|
3008
|
-
export { FIXED_IDX_MEMORY_ACTIVE_TASK_CURRENT_REVISION as $,
|
|
2930
|
+
export { FIXED_IDX_MEMORY_ACTIVE_TASK_CURRENT_REVISION as $, MEMORY_SHUTDOWN_TIMEOUT_MS as $n, FIXED_PROTOCOL_VALUE_79 as $t, modelCallDestination as A, DEFAULT_REFLECTION_ERROR_SCAN_MAX_CHARS as An, MEMORY_SKIN_HEADER as Ar, FIXED_MEMORY_PROFILE_RECOVERY_ENTRIES as At, FIXED_EXTERNAL_VALUE_49 as B, FTS_MERGE_INTERVAL_MS as Bn, FIXED_PROTOCOL_VALUE_63 as Bt, getSnoStationMemStateDir as C, CHUNK_OVERLAP_TOKENS as Cn, ensureModelDownloaded as Cr, FIXED_MEMORY_CHUNKS_MEM_FACET_IDX as Ct, settingsToPluginConfig as D, DEFAULT_IMPORTANCE as Dn, MEMORY_ERROR_STATUS as Dr, FIXED_MEMORY_MEMORIES_FACT_ID_INSERT_GUARD as Dt, defaultSettings as E, DEFAULT_BM25_WEIGHT as En, MEMORY_DEFAULT_SKIN_ID as Er, FIXED_MEMORY_MEMORIES as Et, observeConfigSchema as F, EMBEDDER_DIM as Fn, FIXED_MEMORY_SNO_AI_EXTRACT as Ft, FIXED_EXTERNAL_VALUE_55 as G, INTEGRITY_CHECK_INTERVAL_MS as Gn, FIXED_PROTOCOL_VALUE_68 as Gt, FIXED_EXTERNAL_VALUE_52 as H, HEAD_EXTRACT_OVERLAP_DROP_RATIO as Hn, FIXED_PROTOCOL_VALUE_65 as Ht, extractionConfigSchema as I, EMBEDDER_MODEL_DEFAULT as In, FIXED_MEMORY_SNO_EXTRACT_CHAT as It, FIXED_EXTERNAL_VALUE_58 as J, MAX_AGGREGATION_RESULT_TOKENS as Jn, FIXED_PROTOCOL_VALUE_74 as Jt, FIXED_EXTERNAL_VALUE_56 as K, INTRA_MEMORY_COSINE_THRESHOLD as Kn, FIXED_PROTOCOL_VALUE_69 as Kt, memoryReflectionConfigSchema as L, EMBEDDER_PROVIDER_DEFAULT as Ln, FIXED_MEMORY_SNO_EXTRACT_PROFILE as Lt, retrievalConfigSchema as M, DEFAULT_RERANK_TIMEOUT_MS as Mn, memoryMethod as Mr, FIXED_MEMORY_PROVIDER_PROJECT_AGENTS as Mt, isObserveAgentId as N, DEFAULT_SCOPE as Nn, FIXED_MEMORY_PROVIDER_PROJECT_MAPPINGS as Nt, MODEL_CALLS as O, DEFAULT_RECALL_LIFECYCLE as On, MEMORY_RECONNECT_INTERVAL_MS as Or, FIXED_MEMORY_MEMORIES_FACT_ID_UPDATE_GUARD as Ot, observeAgentId as P, DEFAULT_VECTOR_WEIGHT as Pn, FIXED_MEMORY_ROW_PATH_PATTERN as Pt, FIXED_IDX_MEMORY as Q, MAX_RECALLED_TODO_TOKENS as Qn, FIXED_PROTOCOL_VALUE_78 as Qt, selfImprovementConfigSchema as R, EVAL_QA_TRACES_FILENAME as Rn, FIXED_MEMORY_TASK_LIFECYCLE_COMMANDS as Rt, getSidecarSocketPath as S, CHUNK_MIN_TOKENS as Sn, LocalReranker as Sr, FIXED_MEMORY_CHUNKS_MEMORY_ID_IDX as St, readSettings as T, CHUNK_TOKENIZER_MODE as Tn, MEMORY_CANCEL_ON_DISCONNECT_HEADER as Tr, FIXED_MEMORY_EXTRACTION_TIMESTAMPS as Tt, FIXED_EXTERNAL_VALUE_53 as U, HEAD_EXTRACT_TOKEN_BUDGET as Un, FIXED_PROTOCOL_VALUE_66 as Ut, FIXED_EXTERNAL_VALUE_51 as V, HEAD_EXTRACT_MIN_CONTENT_TOKENS as Vn, FIXED_PROTOCOL_VALUE_64 as Vt, FIXED_EXTERNAL_VALUE_54 as W, IMPORTANCE_WEIGHT_BASE as Wn, FIXED_PROTOCOL_VALUE_67 as Wt, FIXED_EXTERNAL_VALUE_8 as X, MAX_CHUNK_FETCH_LIMIT as Xn, FIXED_PROTOCOL_VALUE_76 as Xt, FIXED_EXTERNAL_VALUE_62 as Y, MAX_CANDIDATE_POOL_SIZE as Yn, FIXED_PROTOCOL_VALUE_75 as Yt, FIXED_EXTERNAL_VALUE_9 as Z, MAX_LIST_LIMIT as Zn, FIXED_PROTOCOL_VALUE_77 as Zt, readRemTestHoldMs as _, BACKUP_MIN_FREE_DISK_RATIO as _n, CachedEmbeddingProvider as _r, FIXED_MEMORY_CHUNKS as _t, REM_MODEL_OUTPUT_TOKEN_CAP as a, PERSISTED_PROVIDER_SYSTEM as an, RECENCY_WEIGHT as ar, FIXED_IDX_MEMORY_MEMORIES_LANE_PROJECT as at, getPrincipal as b, CHUNKING_VERSION as bn, LOCAL_EMBEDDING_MODEL_REVISION as br, FIXED_MEMORY_CHUNKS_AU as bt, REM_SIDECAR_ORIGIN as c, SUPPORTED_LOCALES as cn, RETRIEVAL_STORAGE_CHUNK_PROFILE as cr, FIXED_IDX_MEMORY_MEMORIES_PROJECT_FACT_KEY_ACTIVE as ct, getRemDiscoveryPath as d, ADJACENCY_BONUS_PER_PAIR as dn, USAGE_EVENT_RETENTION_INTERVAL_MS as dr, FIXED_MEMORY_ACTIVE_TASK_EVIDENCE as dt, FIXED_VEC_MEMORY as en, MIN_RECALL_TOKEN_BUDGET as er, FIXED_IDX_MEMORY_ACTIVE_TASK_EVIDENCE_INSTANCE as et, getRemJobJournalPath as f, ATOMIC_CAPTURE_OUTPUT_TOKEN_BUDGET as fn, USAGE_OUTBOX_INTERVAL_MS as fr, FIXED_MEMORY_ACTIVE_TASK_INSTANCES as ft, readRemOperationalConfig as g, BACKUP_INTERVAL_MS as gn, recallLifecycleSchema as gr, FIXED_MEMORY_ACTIVE_TASK_TRANSITIONS as gt, readMaintenanceOverrides as h, ATOMIC_EXTRACTION_MAX_INPUT_TOKENS as hn, experimentMmrDisabled as hr, FIXED_MEMORY_ACTIVE_TASK_REVISIONS as ht, REM_JOBS_PATH_PREFIX as i, PERSISTED_CONTENT_HASH_V3 as in, PLANNER_STATISTICS_INTERVAL_MS as ir, FIXED_IDX_MEMORY_MEMORIES_FACT_ID as it, SESSION_STRATEGIES as j, DEFAULT_REFLECTION_SESSION_TTL_MS as jn, REM_SIDECAR_TOKEN_HEADER as jr, FIXED_MEMORY_PROVIDER_AGENT_MAPPINGS as jt, MODEL_CALL_WORKLOAD as k, DEFAULT_RECALL_TOKEN_BUDGET as kn, MEMORY_ROUTES as kr, FIXED_MEMORY_MIGRATION_MARKERS as kt, REM_SOURCE as l, isSupportedLocale as ln, SNO_OBSERVE_FLUSH_TIMEOUT_MS as lr, FIXED_IDX_MEMORY_MEMORIES_PROJECT_TIMESTAMP as lt, isRemTraceEnabled as m, ATOMIC_ENRICHMENT_OUTPUT_TOKEN_BUDGET as mn, experimentCandidatePoolOverride as mr, FIXED_MEMORY_ACTIVE_TASK_MIGRATION_MANIFESTS as mt, MEMORY_USAGE_FLUSH_INTERVAL_MS as n, PERSISTED_CANDIDATE_HASH_V1 as nn, MULTI_HIT_BONUS_CAP as nr, FIXED_IDX_MEMORY_MEMORIES_CATEGORY as nt, REM_RUN_PATH as o, embeddingConfigSchema as on, REFLECTION_SLICE_CACHE_TTL_MS as or, FIXED_IDX_MEMORY_MEMORIES_PROJECT as ot, getRemTraceLogPath as p, ATOMIC_CAPTURE_TIMEOUT_MS as pn, VECTOR_DIMENSION_DEFAULT as pr, FIXED_MEMORY_ACTIVE_TASK_MIGRATION_EVIDENCE as pt, FIXED_EXTERNAL_VALUE_57 as q, MAINTENANCE_TICK_MS as qn, FIXED_PROTOCOL_VALUE_73 as qt, REM_CORRELATION_ID_HEADER as r, PERSISTED_CONTENT_HASH_V1 as rn, MULTI_HIT_BONUS_PER_HIT as rr, FIXED_IDX_MEMORY_MEMORIES_CONTENT_HASH as rt, REM_SIDECAR_HOST as s, llmRoutingConfigSchema as sn, REM_TRIGGER_CHECK_INTERVAL_MS as sr, FIXED_IDX_MEMORY_MEMORIES_PROJECT_CONTENT_HASH as st, HEALTH_PATH as t, FIXED_VEC_MEMORY_CHUNKS as tn, MMR_LAMBDA as tr, FIXED_IDX_MEMORY_ACTIVE_TASK_INSTANCES_PROJECTION as tt, getRemChassisJournalPath as u, ADJACENCY_BONUS_CAP as un, TIME_DECAY_FLOOR as ur, FIXED_MEMORY as ut, SettingsUnavailableError as v, BONUS_TOTAL_INVARIANT as vn, LOCAL_EMBEDDING_CACHE_DIR_DEFAULT as vr, FIXED_MEMORY_CHUNKS_AD as vt, getStateDir as w, CHUNK_TARGET_TOKENS as wn, MEMORY_BODY_LIMIT_BYTES as wr, FIXED_MEMORY_CHUNKS_MEM_IDX as wt, getSettingsPath as x, CHUNK_MAX_TOKENS as xn, LocalEmbedProvider as xr, FIXED_MEMORY_CHUNKS_FTS as xt, getDiscoveryPath as y, CACHE_TTL_MS as yn, LOCAL_EMBEDDING_MODEL as yr, FIXED_MEMORY_CHUNKS_AI as yt, sessionMemoryConfigSchema as z, FORGET_QUERY_MIN_SCORE as zn, FIXED_MEMORY_UNPLACED_CANDIDATES as zt };
|
|
@@ -185,25 +185,6 @@ function loadStorageExtensions(sqlite) {
|
|
|
185
185
|
* Mirrors the regex pattern used by `parseVecTableDimension` for
|
|
186
186
|
* `nodix_memory_chunk_vectors` — single SELECT against `sqlite_master`, regex match.
|
|
187
187
|
*/
|
|
188
|
-
/**
|
|
189
|
-
* Round A invariant: detect legacy DBs that pre-date migration 0004
|
|
190
|
-
* (chunk-table swap). If the parent vec/FTS objects still exist, the DB
|
|
191
|
-
* was opened against a build that never ran the new migration — fail loud
|
|
192
|
-
* so the dev wipes the file.
|
|
193
|
-
*/
|
|
194
|
-
function assertNoLegacyBoundarySchema(db) {
|
|
195
|
-
const rows = db.prepare("PRAGMA table_info(nodix_memories)").all();
|
|
196
|
-
if (rows.length === 0) return;
|
|
197
|
-
const columnNames = new Set(rows.map((row) => row.name).filter((name) => !!name));
|
|
198
|
-
const legacyBoundaryColumn = [
|
|
199
|
-
"s",
|
|
200
|
-
"c",
|
|
201
|
-
"o",
|
|
202
|
-
"p",
|
|
203
|
-
"e"
|
|
204
|
-
].join("");
|
|
205
|
-
if (columnNames.has(legacyBoundaryColumn) && !columnNames.has("project_id")) throw new StorageError("legacy boundary schema is unsupported for provider v1");
|
|
206
|
-
}
|
|
207
188
|
function ensureMemoryKindIndexes(db) {
|
|
208
189
|
db.exec("CREATE INDEX IF NOT EXISTS nodix_idx_memories_project_fact_key_active ON nodix_memories(project_id, json_extract(metadata, '$.fact_key')) WHERE json_valid(metadata) AND json_extract(metadata, '$.fact_key') IS NOT NULL AND json_extract(metadata, '$.invalidated_at') IS NULL;");
|
|
209
190
|
}
|
|
@@ -294,4 +275,4 @@ function ensureColumn(database, tableName, columnName, declaration) {
|
|
|
294
275
|
database.exec(`ALTER TABLE ${tableName} ADD COLUMN ${columnName} ${declaration}`);
|
|
295
276
|
}
|
|
296
277
|
//#endregion
|
|
297
|
-
export {
|
|
278
|
+
export { readChunkVecTableDimension as a, validateStoragePath as c, parseVecTableDimension as i, initDb as n, readChunkVecTableState as o, loadStorageExtensions as r, vecTableDdlHasPartitionKey as s, closeDb as t };
|
|
@@ -367,25 +367,9 @@ interface VecTableState {
|
|
|
367
367
|
}
|
|
368
368
|
declare function readChunkVecTableState(db: SqliteDatabaseLike): VecTableState | undefined;
|
|
369
369
|
declare function loadStorageExtensions(sqlite: SqliteRuntimeHandle): void;
|
|
370
|
-
/**
|
|
371
|
-
* Startup invariant: the persisted DDL
|
|
372
|
-
* for `nodix_memory_chunks_fts` must declare `tokenize='simple ...'`. Catches DBs
|
|
373
|
-
* created against an older plugin build (still on `unicode61`) so a stale
|
|
374
|
-
* DB plus a fresh plugin doesn't silently degrade CJK recall to char-level.
|
|
375
|
-
*
|
|
376
|
-
* Mirrors the regex pattern used by `parseVecTableDimension` for
|
|
377
|
-
* `nodix_memory_chunk_vectors` — single SELECT against `sqlite_master`, regex match.
|
|
378
|
-
*/
|
|
379
|
-
/**
|
|
380
|
-
* Round A invariant: detect legacy DBs that pre-date migration 0004
|
|
381
|
-
* (chunk-table swap). If the parent vec/FTS objects still exist, the DB
|
|
382
|
-
* was opened against a build that never ran the new migration — fail loud
|
|
383
|
-
* so the dev wipes the file.
|
|
384
|
-
*/
|
|
385
|
-
declare function assertNoLegacyBoundarySchema(db: SqliteDatabaseLike): void;
|
|
386
370
|
/** Implements init db as the local SQLite connection setup operation. */
|
|
387
371
|
declare function initDb(dbPath: string, vectorDim: number): DrizzleDB;
|
|
388
372
|
/** Implements close db as the local SQLite connection setup operation. */
|
|
389
373
|
declare function closeDb(db: DrizzleDB): void;
|
|
390
374
|
//#endregion
|
|
391
|
-
export {
|
|
375
|
+
export { loadStorageExtensions as a, readChunkVecTableState as c, initDb as i, vecTableDdlHasPartitionKey as l, VecTableState as n, parseVecTableDimension as o, closeDb as r, readChunkVecTableDimension as s, DrizzleDB as t, validateStoragePath as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as version, t as logSiteCatalog } from "./log-site-catalog.generated-
|
|
1
|
+
import { n as version, t as logSiteCatalog } from "./log-site-catalog.generated-DsvDgHJa.js";
|
|
2
2
|
import { diagnosticProcessInstanceId, encodeDiagnostic as encodeDiagnostic$1, writeEmergencyDiagnostic as writeEmergencyDiagnostic$1 } from "@snoai/utils/log-encoder";
|
|
3
3
|
//#region src/engine/observability/early-diagnostics.ts
|
|
4
4
|
function bindApplication(input) {
|