@snoai/memory 1.2.9 → 1.2.10
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 +4 -4
- package/dist/{access-tracker-D1e-2-Bb.d.ts → access-tracker-BOPHSJjf.d.ts} +4 -4
- package/dist/{adapter-TCrv5P-C.d.ts → adapter-lyb6RaQE.d.ts} +2 -2
- package/dist/{atomic-memory-extraction-C0n0wHzt.d.ts → atomic-memory-extraction-B_XpkhMd.d.ts} +7 -5
- package/dist/{atomic-memory-extraction-BG42OXou.js → atomic-memory-extraction-o2v8mp7G.js} +109 -50
- package/dist/{b-profile-section-dictionary-provider-y3DMQ518.d.ts → b-profile-section-dictionary-provider-BK5NBs-y.d.ts} +1 -1
- package/dist/{capture-policy-detector-BY7v5Cq1.d.ts → capture-policy-detector-BvVGmxxX.d.ts} +1 -1
- package/dist/{classifier-DnbbtwTS.d.ts → classifier-CXQxJJPP.d.ts} +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/{coding-skin-_Qu3INZD.js → coding-skin-azRXA51Z.js} +2 -1
- package/dist/coding-skin.d.ts +1 -0
- package/dist/coding-skin.js +2 -2
- package/dist/{config-BCZRhUvW.js → config-C7LzSWhG.js} +9 -4
- package/dist/{connection-C9YD5sgm.js → connection-PQcq3TPO.js} +1 -1
- package/dist/{derived-suppression-cache-BLAH0nB9.d.ts → derived-suppression-cache-Ckwjey7I.d.ts} +1 -1
- package/dist/diagnostic-encoder.js +1 -1
- package/dist/{index-dQMkc_6y.d.ts → index-CsPUNkcm.d.ts} +2 -2
- package/dist/{index-BO4RU_mc.d.ts → index-DPfJrOFD.d.ts} +1 -1
- package/dist/{index-DL8AVj0Z.d.ts → index-Pb9LrHgL.d.ts} +4 -5
- package/dist/index.d.ts +12 -9
- package/dist/index.js +97 -47
- package/dist/internal/config/index.d.ts +1 -1
- package/dist/internal/config/index.js +4 -5
- 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 +4 -4
- 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 +2 -2
- package/dist/internal/engine/bindings/memory-store-tool.js +4 -4
- 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 +3 -3
- 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 +2 -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 +7 -5
- 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/bindings/sno-station-mem-runtime-mode.js +3 -3
- 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-llm-client.js +0 -2
- package/dist/internal/engine/observability/observable-memory-store.d.ts +1 -1
- package/dist/internal/engine/observability/observable-memory-store.js +2 -2
- 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 +3 -3
- package/dist/internal/engine/operations/daily-spend-estimator.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 +3 -3
- package/dist/internal/engine/operations/runtime-audit-log.js +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/rem/classifier.d.ts +1 -1
- package/dist/internal/engine/rem/index.d.ts +2 -2
- package/dist/internal/engine/rem/index.js +9 -7
- package/dist/internal/engine/retrieval/access-tracker.d.ts +1 -1
- package/dist/internal/engine/retrieval/retriever.d.ts +1 -1
- package/dist/internal/engine/security/memory-scope-policy.js +1 -1
- package/dist/internal/engine/security/scopes.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/shared/utils.d.ts +1 -1
- package/dist/internal/engine/shared/utils.js +2 -3
- package/dist/internal/engine/telemetry/memory-telemetry-api.js +2 -2
- package/dist/internal/engine/telemetry/observe-ledger.d.ts +1 -1
- package/dist/internal/engine/telemetry/observe-ledger.js +46 -19
- 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.js +1 -1
- package/dist/internal/store/maintenance.d.ts +2 -2
- package/dist/internal/store/maintenance.js +443 -39
- package/dist/internal/store/memory-kinds-cutover-migrator.js +1 -1
- package/dist/internal/store/migrations.js +1 -1
- package/dist/internal/store/store.d.ts +2 -2
- package/dist/internal/store/store.js +1 -1
- package/dist/{llm-client-RqmOEQkg.d.ts → llm-client-BTaUVmDe.d.ts} +1 -1
- package/dist/{llm-client-fVrzPcyz.js → llm-client-ConEyQEs.js} +51 -12
- package/dist/{log-site-catalog.generated-By86ZBRB.js → log-site-catalog.generated-C9RmyAA0.js} +219 -184
- package/dist/log-site-catalog.json +1 -1
- package/dist/{memory-kind-policy-BOGb8thm.d.ts → memory-kind-policy-ClQEXeOL.d.ts} +1 -1
- package/dist/{memory-metadata-codec-DcSqjbWR.d.ts → memory-metadata-codec-wVAuoKrG.d.ts} +1 -1
- package/dist/{memory-runtime-CbuNkL0G.js → memory-runtime-HibOMCFa.js} +474 -289
- package/dist/{memory-scope-policy-DICSCURA.js → memory-scope-policy--TiLZnrE.js} +2 -2
- package/dist/{memory-snapshot-C5BnJ2rO.d.ts → memory-snapshot-uTdxJnIh.d.ts} +2 -2
- package/dist/{memory-store-base-z593oJ4h.d.ts → memory-store-base-Bk2dOKED.d.ts} +5 -6
- package/dist/{memory-store-shared-DqpWJXZZ.js → memory-store-shared-CURizQIy.js} +1 -1
- package/dist/{memory-telemetry-receipts-YsxbwOAf.js → memory-telemetry-receipts-cjIQGwdp.js} +5 -1
- package/dist/{memory-temporality-classifier-SzlUCgTj.d.ts → memory-temporality-classifier-CcxfHYoT.d.ts} +1 -1
- package/dist/{memory-temporality-classifier-CeSOL2vq.js → memory-temporality-classifier-MBJyJdvB.js} +2 -2
- package/dist/{memory-tier-promoter-Z7jprFB7.d.ts → memory-tier-promoter-MkZPQ8u1.d.ts} +1 -1
- package/dist/memory-tool-dependencies--SrMdT3P.d.ts +14 -0
- package/dist/{memory-tool-dependencies-CnaGABQG.js → memory-tool-dependencies-DUMY8SwB.js} +3 -3
- package/dist/{model-call-table-BZJQkbKX.js → model-call-table-BE97f37s.js} +6 -1
- package/dist/{observable-embedder-DjhGxHx2.d.ts → observable-embedder-CGr3Zejf.d.ts} +1 -1
- package/dist/{observable-llm-client-CLJLMmwA.d.ts → observable-llm-client-CXUA7Gi3.d.ts} +3 -3
- package/dist/{observable-memory-store-B48HV2NK.d.ts → observable-memory-store-BwwKcUzf.d.ts} +4 -4
- package/dist/{observable-retriever-CAdHncKh.d.ts → observable-retriever-BZpdv93Y.d.ts} +5 -5
- package/dist/paths-DmmPxD_v.d.ts +1 -0
- package/dist/{plugin-config-schema-VBSPGEG3.d.ts → plugin-config-schema-BrhMvnXJ.d.ts} +3 -1
- package/dist/{plugin-config-schema-hIfZTELX.js → plugin-config-schema-Di-uKTP0.js} +1 -1
- package/dist/{profile-CQNCtVIu.d.ts → profile-CF5oDjR7.d.ts} +1 -1
- package/dist/{profile-section-writer-joJEIYhF.js → profile-section-writer-CmNa95uN.js} +3 -3
- package/dist/{reflection-command-hooks-Cl0ShtbF.d.ts → reflection-command-hooks-CM2mWb69.d.ts} +4 -4
- package/dist/{reflection-command-hooks-CG8n1GNK.js → reflection-command-hooks-CnTj8cKL.js} +3 -3
- package/dist/{reflection-deps-B0_cPBZt.d.ts → reflection-deps-B5I0nYZS.d.ts} +2 -2
- package/dist/{reflection-embedded-generator-C5kA0T0v.d.ts → reflection-embedded-generator-CogQIBcG.d.ts} +3 -3
- package/dist/{reflection-embedded-generator-D342_5o_.js → reflection-embedded-generator-DR525Moy.js} +1 -1
- package/dist/{reflection-injection-hooks-CtgcjLGx.d.ts → reflection-injection-hooks-BnbfZqpj.d.ts} +4 -4
- package/dist/{reflection-lifecycle-hooks-Pd7P9wya.d.ts → reflection-lifecycle-hooks-DMDhtidj.d.ts} +3 -3
- package/dist/{rem-batch-executor-ryxxkzQp.js → rem-batch-executor-8x4FBLtW.js} +1 -1
- package/dist/{rem-trigger-Dz_Jrr9p.js → rem-trigger-DmRERTNH.js} +1664 -1008
- package/dist/{retriever-DQdyGlkr.d.ts → retriever-BpxV-0fB.d.ts} +8 -8
- package/dist/{runtime-audit-log-BCeujlEp.js → runtime-audit-log-DK6xAYxh.js} +103 -2
- package/dist/{runtime-audit-log-Bn3JLBPj.d.ts → runtime-audit-log-DdhLlTxi.d.ts} +4 -2
- package/dist/{scopes-CSOn6zdd.js → scopes-a4Kly9n7.js} +1 -1
- package/dist/{server-DFLEPkQA.js → server-CCduS_Ea.js} +17 -320
- package/dist/sidecar/main.js +11 -4
- package/dist/sno-station-mem-runtime-dependencies-AdFFr3bU.d.ts +31 -0
- package/dist/{sno-station-mem-runtime-dependencies-CY-XDHxU.js → sno-station-mem-runtime-dependencies-CexFtaY6.js} +8 -8
- package/dist/{store-DKndKig1.d.ts → store-BDIAl2cc.d.ts} +1 -1
- package/dist/{store-CUk-jEGA.js → store-BQxkgJTX.js} +31 -23
- package/dist/{strategy-hook-runner-BSk_o6Yt.d.ts → strategy-hook-runner-DT9emgCZ.d.ts} +7 -7
- package/dist/{strategy-hook-runner-CWApiUZW.js → strategy-hook-runner-SvyyGBXw.js} +1 -1
- package/dist/{types-Del9J7UB.d.ts → types-Ae3a8562.d.ts} +1 -1
- package/dist/{utils-Ctb9aevJ.d.ts → utils-CDw2ttQf.d.ts} +2 -3
- package/package.json +2 -2
- package/settings.default.json +4 -4
- package/dist/memory-tool-dependencies-CJNppsKh.d.ts +0 -14
- package/dist/paths-D3dEsoE4.d.ts +0 -1
- package/dist/sno-station-mem-runtime-dependencies-8CRIkARK.d.ts +0 -31
- package/dist/{unplaced-candidate-migration-CbQHzcEM.js → unplaced-candidate-migration-BCcdQkcx.js} +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { A as SESSION_STRATEGIES, An as DEFAULT_REFLECTION_SESSION_TTL_MS, Bn as FTS_MERGE_INTERVAL_MS, Bt as FIXED_PROTOCOL_VALUE_64, C as getSnoStationMemStateDir, D as settingsToPluginConfig, E as defaultSettings, En as DEFAULT_IMPORTANCE, F as extractionConfigSchema, Ft as FIXED_MEMORY_SNO_EXTRACT_CHAT, Gn as INTEGRITY_CHECK_INTERVAL_MS, Ht as FIXED_PROTOCOL_VALUE_66, I as memoryReflectionConfigSchema, It as FIXED_MEMORY_SNO_EXTRACT_PROFILE, L as selfImprovementConfigSchema, M as isObserveAgentId, N as observeAgentId, Nt as FIXED_MEMORY_ROW_PATH_PATTERN, O as MODEL_CALLS, On as DEFAULT_RECALL_TOKEN_BUDGET, P as observeConfigSchema, Pt as FIXED_MEMORY_SNO_AI_EXTRACT, Qn as MAX_CANDIDATE_POOL_SIZE, Qt as FIXED_PROTOCOL_VALUE_79, R as sessionMemoryConfigSchema, T as readSettings, Ut as FIXED_PROTOCOL_VALUE_67, Vt as FIXED_PROTOCOL_VALUE_65, Wt as FIXED_PROTOCOL_VALUE_68, Xn as MAINTENANCE_TICK_MS, Xt as FIXED_PROTOCOL_VALUE_77, Yt as FIXED_PROTOCOL_VALUE_76, Zn as MAX_AGGREGATION_RESULT_TOKENS, Zt as FIXED_PROTOCOL_VALUE_78, _r as USAGE_OUTBOX_INTERVAL_MS, an as embeddingConfigSchema, b as getPrincipal, cn as isSupportedLocale, dn as ATOMIC_CAPTURE_OUTPUT_TOKEN_BUDGET, er as MAX_LIST_LIMIT, fn as ATOMIC_CAPTURE_TIMEOUT_MS, gn as BACKUP_MIN_FREE_DISK_RATIO, gr as USAGE_EVENT_RETENTION_INTERVAL_MS, h as readMaintenanceOverrides, hn as BACKUP_INTERVAL_MS, in as PERSISTED_PROVIDER_SYSTEM, j as retrievalConfigSchema, k as modelCallDestination, kn as DEFAULT_REFLECTION_ERROR_SCAN_MAX_CHARS, mn as ATOMIC_EXTRACTION_MAX_INPUT_TOKENS, mr as SNO_OBSERVE_FLUSH_TIMEOUT_MS, n as MEMORY_USAGE_FLUSH_INTERVAL_MS, qt as FIXED_PROTOCOL_VALUE_74, rr as MIN_RECALL_TOKEN_BUDGET, sr as PLANNER_STATISTICS_INTERVAL_MS, ur as REM_TRIGGER_CHECK_INTERVAL_MS, w as getStateDir, x as getSettingsPath, xr as recallLifecycleSchema, zn as FORGET_QUERY_MIN_SCORE, zt as FIXED_PROTOCOL_VALUE_63 } from "./config-
|
|
1
|
+
import { $ as renderAdapterAChatPrompt, $t as MEMORY_CATEGORIES, A as journalAtomicArrivalRetirementRefusal, B as StaleSupersedeTargetError, Bt as debugContentPreview, C as buildTaskLifecycleCommandClaim, Cn as withMemoryOperation, Ct as withProviderResponses, D as normalizeEntityName, E as listAtomicMemoryEntityCandidates, Et as appendAuditEntry, F as normalizeTopicToSectionName, Ft as CODING_SKIN_LEDGER_MAX_CHARS, G as loadSqliteVecExtension, Gt as redactSecrets, H as validateMemoryTelemetryMetadata, Ht as stripHtmlTags, I as getSnoStationMemDataDir, It as CODING_SKIN_SESSION_QUERY, J as adapterAViewFromRecord, Jt as stringifyInsightMetadata, Kt as buildInsightMetadata, L as AtomicExtractionCompletedElsewhere, Lt as HOST_MODEL_DEADLINE_HEADER, M as recordTokenCounter, Mt as runWithMemoryAuditSync, N as canExtractorWrite, Nt as runWithMutationAttempt, O as recordAtomicEntityIdentityJournal, P as canonicalizeProfileSectionName, Q as prospectiveProfileView, Qt as AGGREGATION_OPERATIONS, R as normalizeMemoryRelationPredicate, Rt as clamp01, S as admitTaskLifecycleAssertion, Sn as memoryOperationSignal, St as isTerminalLlmFailure, T as resolveHookAgentId, Tt as isTerminalLlmFailure$1, U as randomUUID$1, Ut as stripRoleLabelPrefix, V as TaskLifecycleStaleResolutionError, Vt as stableHash, W as readChunkVecTableState, Wt as truncateGraphemes, X as orderAdapterAPair, Xt as parseIsoDateTimeMs, Y as isAdapterAVerdictReply, Yt as normalizeIsoDateTimeString, Z as parseAdapterAChatVerdict, Zt as deriveFactKey, _ as acceptsTaskLifecycleJudgment, _n as initSqliteRuntime, _t as createScopePolicy, an as atomicExtractionSkillReference, at as resolveMemoryDate, b as resolveTaskLifecycle, bn as checkMemoryOperation, cn as state_vocabulary_default, ct as buildIndexedText, dn as calendarInstructionSchema, dt as ALL_RESOURCES, en as normalizeCategory, et as renderAdapterAPrompt, fn as isCalendarLabel, ft as RESOURCES_BY_LOCALE, g as Embedder, gn as isMemoryTelemetryEventType, gt as MemoryScopePolicy, h as AccessTracker, hn as MEMORY_TELEMETRY_DELETE_REASONS, ht as StorageError, in as ATOMIC_EXTRACTION_SKILL_HASH, it as serializeIntervalMetadata, j as readAtomicArrivalRetirementCandidateSet, jt as runWithMemoryAudit, k as closeAtomicArrivalRetirementTargets, kt as currentMutationAttemptId, ln as relations, lt as stripEnvelopeMetadata, m as DEFAULT_RETRIEVAL_CONFIG, mn as attribute_dictionary_default, mt as SnoStationMemError, nn as resolveLlmRoute, nt as readMemorySourceOrderOrOldest, on as modelReplyJsonCandidates, ot as unresolvedMemoryDate, p as MemoryRetriever, pn as sessionZoneCarriedBy, pt as RetrievalError, qt as parseInsightMetadata, rn as ATOMIC_EXTRACTION_SKILL, rt as parseSessionTimestamp, sn as readModelReplyJson, st as boundSectionContent, t as evaluateRemAutomaticTriggers, tn as pickLlmRoutingConfig, tt as compareMemorySourceOrder, un as calculateCalendarTime, ut as normalizeAmbientLearningText, v as buildTaskLifecycleCandidateSet, vn as openSqliteDatabase, vt as parseAgentIdFromSessionKey, w as resolveTaskLifecycleEffectiveTime, wn as forwardObserveLedgerUntilIdle, wt as classifyLlmFailure, x as taskLifecycleCandidateSetVersion, xn as memoryFileWrite, xt as createLlmClient, y as findUniqueActiveTaskByDescription, yn as openSqliteDatabaseReadonly, yt as LlmClientTerminalError, z as MemoryStore, zt as clampInt } from "./rem-trigger-DmRERTNH.js";
|
|
2
|
+
import { A as SESSION_STRATEGIES, An as DEFAULT_REFLECTION_SESSION_TTL_MS, Bn as FTS_MERGE_INTERVAL_MS, Bt as FIXED_PROTOCOL_VALUE_64, C as getSnoStationMemStateDir, D as settingsToPluginConfig, E as defaultSettings, En as DEFAULT_IMPORTANCE, F as extractionConfigSchema, Ft as FIXED_MEMORY_SNO_EXTRACT_CHAT, Gn as INTEGRITY_CHECK_INTERVAL_MS, Ht as FIXED_PROTOCOL_VALUE_66, I as memoryReflectionConfigSchema, It as FIXED_MEMORY_SNO_EXTRACT_PROFILE, L as selfImprovementConfigSchema, M as isObserveAgentId, N as observeAgentId, Nt as FIXED_MEMORY_ROW_PATH_PATTERN, O as MODEL_CALLS, On as DEFAULT_RECALL_TOKEN_BUDGET, P as observeConfigSchema, Pt as FIXED_MEMORY_SNO_AI_EXTRACT, Qn as MAX_CANDIDATE_POOL_SIZE, Qt as FIXED_PROTOCOL_VALUE_79, R as sessionMemoryConfigSchema, T as readSettings, Ut as FIXED_PROTOCOL_VALUE_67, Vt as FIXED_PROTOCOL_VALUE_65, Wt as FIXED_PROTOCOL_VALUE_68, Xn as MAINTENANCE_TICK_MS, Xt as FIXED_PROTOCOL_VALUE_77, Yt as FIXED_PROTOCOL_VALUE_76, Zn as MAX_AGGREGATION_RESULT_TOKENS, Zt as FIXED_PROTOCOL_VALUE_78, _r as USAGE_OUTBOX_INTERVAL_MS, an as embeddingConfigSchema, b as getPrincipal, cn as isSupportedLocale, dn as ATOMIC_CAPTURE_OUTPUT_TOKEN_BUDGET, er as MAX_LIST_LIMIT, fn as ATOMIC_CAPTURE_TIMEOUT_MS, gn as BACKUP_MIN_FREE_DISK_RATIO, gr as USAGE_EVENT_RETENTION_INTERVAL_MS, h as readMaintenanceOverrides, hn as BACKUP_INTERVAL_MS, in as PERSISTED_PROVIDER_SYSTEM, j as retrievalConfigSchema, k as modelCallDestination, kn as DEFAULT_REFLECTION_ERROR_SCAN_MAX_CHARS, mn as ATOMIC_EXTRACTION_MAX_INPUT_TOKENS, mr as SNO_OBSERVE_FLUSH_TIMEOUT_MS, n as MEMORY_USAGE_FLUSH_INTERVAL_MS, qt as FIXED_PROTOCOL_VALUE_74, rr as MIN_RECALL_TOKEN_BUDGET, sr as PLANNER_STATISTICS_INTERVAL_MS, ur as REM_TRIGGER_CHECK_INTERVAL_MS, w as getStateDir, x as getSettingsPath, xr as recallLifecycleSchema, zn as FORGET_QUERY_MIN_SCORE, zt as FIXED_PROTOCOL_VALUE_63 } from "./config-C7LzSWhG.js";
|
|
3
3
|
import { n as DEGRADED_REASONS, t as ContractError } from "./error-D-wb-rZw.js";
|
|
4
4
|
import { configureLogger, createLogger, currentLogContext, effectiveLogLevel, loggerFileStatus, privateLogReference, withLogContext } from "@snoai/utils/logger";
|
|
5
5
|
import path, { basename, dirname, isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
@@ -16,10 +16,10 @@ import { runIntegrityCheck } from "@snoai/sqlite-crypto";
|
|
|
16
16
|
import { appendFile, link, lstat, mkdir, open, readFile, readdir, realpath, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
17
17
|
import { Temporal } from "@js-temporal/polyfill";
|
|
18
18
|
import { sanitizeContentIngress } from "@snoai/content-sanitizer";
|
|
19
|
+
import "node:readline";
|
|
19
20
|
import "@sinclair/typebox";
|
|
20
21
|
import { Semaphore } from "async-mutex";
|
|
21
22
|
import { eld } from "eld/medium";
|
|
22
|
-
import "node:readline";
|
|
23
23
|
import { channel } from "node:diagnostics_channel";
|
|
24
24
|
import "js-tiktoken";
|
|
25
25
|
import { connect } from "node:net";
|
|
@@ -196,7 +196,7 @@ function addNumber(target, key, value) {
|
|
|
196
196
|
}
|
|
197
197
|
//#endregion
|
|
198
198
|
//#region package.json
|
|
199
|
-
var version = "1.2.
|
|
199
|
+
var version = "1.2.10";
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region config/atomic-extraction-response.schema.json
|
|
202
202
|
var atomic_extraction_response_schema_default = {
|
|
@@ -1057,7 +1057,7 @@ function fallbackAtomicCapturedFact(fact) {
|
|
|
1057
1057
|
//#endregion
|
|
1058
1058
|
//#region src/engine/observability/log-site-catalog.generated.ts
|
|
1059
1059
|
const logSiteCatalog = {
|
|
1060
|
-
"build_id": "
|
|
1060
|
+
"build_id": "00bd39677ac073a62654772d358f87cb9219b4336b1280579cd13d5db885bf0f",
|
|
1061
1061
|
"sites": {
|
|
1062
1062
|
"memory.recall.budget.checked": {
|
|
1063
1063
|
"file": "packages/memory/src/engine/bindings/memory-recall-tool.ts",
|
|
@@ -1146,30 +1146,30 @@ const logSiteCatalog = {
|
|
|
1146
1146
|
"plugin.sno-station-mem-insight-distill-factory.buildInsightDistiller.8b084be5ca": {
|
|
1147
1147
|
"file": "packages/memory/src/engine/bindings/sno-station-mem-insight-distill-factory.ts",
|
|
1148
1148
|
"function": "buildInsightDistiller",
|
|
1149
|
-
"line":
|
|
1149
|
+
"line": 52,
|
|
1150
1150
|
"column": 3,
|
|
1151
|
-
"file_hash": "
|
|
1151
|
+
"file_hash": "94f127acf2405b98116454794b6441ebec5c0ee6dd57be7982746e863cfc81a3"
|
|
1152
1152
|
},
|
|
1153
1153
|
"plugin.sno-station-mem-insight-distill-factory.buildInsightDistiller.6cdc733c64": {
|
|
1154
1154
|
"file": "packages/memory/src/engine/bindings/sno-station-mem-insight-distill-factory.ts",
|
|
1155
1155
|
"function": "buildInsightDistiller",
|
|
1156
|
-
"line":
|
|
1156
|
+
"line": 59,
|
|
1157
1157
|
"column": 3,
|
|
1158
|
-
"file_hash": "
|
|
1158
|
+
"file_hash": "94f127acf2405b98116454794b6441ebec5c0ee6dd57be7982746e863cfc81a3"
|
|
1159
1159
|
},
|
|
1160
1160
|
"sno-station-mem-insight-distill-factory.buildInsightDistiller.847c5ab779": {
|
|
1161
1161
|
"file": "packages/memory/src/engine/bindings/sno-station-mem-insight-distill-factory.ts",
|
|
1162
1162
|
"function": "buildInsightDistiller",
|
|
1163
|
-
"line":
|
|
1163
|
+
"line": 63,
|
|
1164
1164
|
"column": 3,
|
|
1165
|
-
"file_hash": "
|
|
1165
|
+
"file_hash": "94f127acf2405b98116454794b6441ebec5c0ee6dd57be7982746e863cfc81a3"
|
|
1166
1166
|
},
|
|
1167
1167
|
"plugin.sno-station-mem-insight-distill-factory.buildInsightDistiller.888f96bfef": {
|
|
1168
1168
|
"file": "packages/memory/src/engine/bindings/sno-station-mem-insight-distill-factory.ts",
|
|
1169
1169
|
"function": "buildInsightDistiller",
|
|
1170
|
-
"line":
|
|
1170
|
+
"line": 114,
|
|
1171
1171
|
"column": 3,
|
|
1172
|
-
"file_hash": "
|
|
1172
|
+
"file_hash": "94f127acf2405b98116454794b6441ebec5c0ee6dd57be7982746e863cfc81a3"
|
|
1173
1173
|
},
|
|
1174
1174
|
"plugin.sno-station-mem-runtime-mode.runObserveLifecycleTask.d1856ccb13": {
|
|
1175
1175
|
"file": "packages/memory/src/engine/bindings/sno-station-mem-runtime-mode.ts",
|
|
@@ -1272,142 +1272,142 @@ const logSiteCatalog = {
|
|
|
1272
1272
|
"extraction.atomic-generic-extractor.enrichAtomicBatch": {
|
|
1273
1273
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1274
1274
|
"function": "enrichAtomicBatch",
|
|
1275
|
-
"line":
|
|
1275
|
+
"line": 248,
|
|
1276
1276
|
"column": 3,
|
|
1277
|
-
"file_hash": "
|
|
1277
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1278
1278
|
},
|
|
1279
1279
|
"extraction.atomic-generic-extractor.runAtomicNumericTurnSweep.7456414b06": {
|
|
1280
1280
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1281
1281
|
"function": "runAtomicNumericTurnSweep",
|
|
1282
|
-
"line":
|
|
1282
|
+
"line": 473,
|
|
1283
1283
|
"column": 3,
|
|
1284
|
-
"file_hash": "
|
|
1284
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1285
1285
|
},
|
|
1286
1286
|
"extraction.atomic-generic-extractor.runAtomicNumericTurnSweep.a373dfa454": {
|
|
1287
1287
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1288
1288
|
"function": "runAtomicNumericTurnSweep",
|
|
1289
|
-
"line":
|
|
1289
|
+
"line": 481,
|
|
1290
1290
|
"column": 3,
|
|
1291
|
-
"file_hash": "
|
|
1291
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1292
1292
|
},
|
|
1293
1293
|
"extraction.atomic-generic-extractor.runAtomicNumericTurnSweep.dc917b09a1": {
|
|
1294
1294
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1295
1295
|
"function": "runAtomicNumericTurnSweep",
|
|
1296
|
-
"line":
|
|
1296
|
+
"line": 496,
|
|
1297
1297
|
"column": 3,
|
|
1298
|
-
"file_hash": "
|
|
1298
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1299
1299
|
},
|
|
1300
1300
|
"extraction.atomic-generic-extractor.runAtomicNumericTurnSweep.5264647de8": {
|
|
1301
1301
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1302
1302
|
"function": "runAtomicNumericTurnSweep",
|
|
1303
|
-
"line":
|
|
1303
|
+
"line": 505,
|
|
1304
1304
|
"column": 3,
|
|
1305
|
-
"file_hash": "
|
|
1305
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1306
1306
|
},
|
|
1307
1307
|
"extraction.atomic-generic-extractor.runAtomicNumericTurnSweep.5f797c1175": {
|
|
1308
1308
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1309
1309
|
"function": "runAtomicNumericTurnSweep",
|
|
1310
|
-
"line":
|
|
1310
|
+
"line": 581,
|
|
1311
1311
|
"column": 3,
|
|
1312
|
-
"file_hash": "
|
|
1312
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1313
1313
|
},
|
|
1314
1314
|
"extraction.atomic-generic-extractor.runAtomicNumericTurnSweep.fdcb677e24": {
|
|
1315
1315
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1316
1316
|
"function": "runAtomicNumericTurnSweep",
|
|
1317
|
-
"line":
|
|
1317
|
+
"line": 583,
|
|
1318
1318
|
"column": 3,
|
|
1319
|
-
"file_hash": "
|
|
1319
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1320
1320
|
},
|
|
1321
1321
|
"extraction.atomic-generic-extractor.runAtomicGenericExtractionPass.cce4a719a3": {
|
|
1322
1322
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1323
1323
|
"function": "captureAtomicWindow",
|
|
1324
|
-
"line":
|
|
1324
|
+
"line": 819,
|
|
1325
1325
|
"column": 4,
|
|
1326
|
-
"file_hash": "
|
|
1326
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1327
1327
|
},
|
|
1328
1328
|
"extraction.atomic-generic-extractor.runAtomicGenericExtractionPass.98a701bd95": {
|
|
1329
1329
|
"file": "packages/memory/src/engine/extraction/atomic-generic-extractor.ts",
|
|
1330
1330
|
"function": "captureAtomicWindow",
|
|
1331
|
-
"line":
|
|
1331
|
+
"line": 843,
|
|
1332
1332
|
"column": 3,
|
|
1333
|
-
"file_hash": "
|
|
1333
|
+
"file_hash": "163e508b5a43727e232340be6970864a540cb3ef92d4e320b9474e0163730534"
|
|
1334
1334
|
},
|
|
1335
1335
|
"extraction.atomic-memory-extraction.extractAndPersist.7e1c9d2660": {
|
|
1336
1336
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1337
1337
|
"function": "extractAndPersist",
|
|
1338
|
-
"line":
|
|
1338
|
+
"line": 720,
|
|
1339
1339
|
"column": 4,
|
|
1340
|
-
"file_hash": "
|
|
1340
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1341
1341
|
},
|
|
1342
1342
|
"memory.capture.completed": {
|
|
1343
1343
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1344
1344
|
"function": "extractAndPersist",
|
|
1345
|
-
"line":
|
|
1345
|
+
"line": 877,
|
|
1346
1346
|
"column": 4,
|
|
1347
|
-
"file_hash": "
|
|
1347
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1348
1348
|
},
|
|
1349
1349
|
"extraction.atomic-memory-extraction.readStandingSubjectCandidates.b88c6fb3aa": {
|
|
1350
1350
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1351
1351
|
"function": "readStandingSubjectCandidates",
|
|
1352
|
-
"line":
|
|
1352
|
+
"line": 1015,
|
|
1353
1353
|
"column": 5,
|
|
1354
|
-
"file_hash": "
|
|
1354
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1355
1355
|
},
|
|
1356
1356
|
"extraction.atomic-memory-extraction.reaskStandingSubjects.1288498dec": {
|
|
1357
1357
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1358
1358
|
"function": "reaskStandingSubjects",
|
|
1359
|
-
"line":
|
|
1359
|
+
"line": 1269,
|
|
1360
1360
|
"column": 4,
|
|
1361
|
-
"file_hash": "
|
|
1361
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1362
1362
|
},
|
|
1363
1363
|
"extraction.atomic-memory-extraction.reaskStandingSubjects.2b8785b171": {
|
|
1364
1364
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1365
1365
|
"function": "reaskStandingSubjects",
|
|
1366
|
-
"line":
|
|
1366
|
+
"line": 1278,
|
|
1367
1367
|
"column": 2,
|
|
1368
|
-
"file_hash": "
|
|
1368
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1369
1369
|
},
|
|
1370
1370
|
"extraction.atomic-memory-extraction.runAtomicMemoryExtraction.304a5a8d5c": {
|
|
1371
1371
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1372
1372
|
"function": "runAtomicMemoryExtraction",
|
|
1373
|
-
"line":
|
|
1373
|
+
"line": 1548,
|
|
1374
1374
|
"column": 3,
|
|
1375
|
-
"file_hash": "
|
|
1375
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1376
1376
|
},
|
|
1377
1377
|
"extraction.atomic-memory-extraction.over_token_ceiling": {
|
|
1378
1378
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1379
1379
|
"function": "runAtomicMemoryExtraction",
|
|
1380
|
-
"line":
|
|
1380
|
+
"line": 1630,
|
|
1381
1381
|
"column": 3,
|
|
1382
|
-
"file_hash": "
|
|
1382
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1383
1383
|
},
|
|
1384
1384
|
"extraction.atomic-memory-extraction.runAtomicMemoryExtraction.0d9673d494": {
|
|
1385
1385
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1386
1386
|
"function": "runAtomicMemoryExtraction",
|
|
1387
|
-
"line":
|
|
1387
|
+
"line": 1704,
|
|
1388
1388
|
"column": 4,
|
|
1389
|
-
"file_hash": "
|
|
1389
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1390
1390
|
},
|
|
1391
1391
|
"memory.extraction.window.completed": {
|
|
1392
1392
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1393
1393
|
"function": "runAtomicMemoryExtraction",
|
|
1394
|
-
"line":
|
|
1394
|
+
"line": 1730,
|
|
1395
1395
|
"column": 3,
|
|
1396
|
-
"file_hash": "
|
|
1396
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1397
1397
|
},
|
|
1398
1398
|
"extraction.atomic-memory-extraction.judgeArrivalRetirementPair.call_failed": {
|
|
1399
1399
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1400
1400
|
"function": "judgeArrivalRetirementPair",
|
|
1401
|
-
"line":
|
|
1401
|
+
"line": 1767,
|
|
1402
1402
|
"column": 3,
|
|
1403
|
-
"file_hash": "
|
|
1403
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1404
1404
|
},
|
|
1405
1405
|
"extraction.atomic-memory-extraction.judgeArrivalRetirementPair.reply_invalid": {
|
|
1406
1406
|
"file": "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
1407
1407
|
"function": "judgeArrivalRetirementPair",
|
|
1408
|
-
"line":
|
|
1408
|
+
"line": 1775,
|
|
1409
1409
|
"column": 3,
|
|
1410
|
-
"file_hash": "
|
|
1410
|
+
"file_hash": "155293bf20505f110c69df5e852c49e67411c80b8b9fb3b8c5390b82e2fc47cc"
|
|
1411
1411
|
},
|
|
1412
1412
|
"extraction.atomic-progress-boundary.salvage_decisions": {
|
|
1413
1413
|
"file": "packages/memory/src/engine/extraction/atomic-progress-boundary.ts",
|
|
@@ -1944,23 +1944,30 @@ const logSiteCatalog = {
|
|
|
1944
1944
|
"memory.audit.append.failed": {
|
|
1945
1945
|
"file": "packages/memory/src/engine/operations/runtime-audit-log.ts",
|
|
1946
1946
|
"function": "enqueueAuditWrite",
|
|
1947
|
-
"line":
|
|
1947
|
+
"line": 307,
|
|
1948
1948
|
"column": 4,
|
|
1949
|
-
"file_hash": "
|
|
1949
|
+
"file_hash": "07418176e3bf3f2379bc58bd9c34962cec64eea73d9c48c7008223e9d111b08e"
|
|
1950
|
+
},
|
|
1951
|
+
"memory.audit.compact.failed": {
|
|
1952
|
+
"file": "packages/memory/src/engine/operations/runtime-audit-log.ts",
|
|
1953
|
+
"function": "compactAuditLog",
|
|
1954
|
+
"line": 334,
|
|
1955
|
+
"column": 3,
|
|
1956
|
+
"file_hash": "07418176e3bf3f2379bc58bd9c34962cec64eea73d9c48c7008223e9d111b08e"
|
|
1950
1957
|
},
|
|
1951
1958
|
"memory.audit.detail.unknown": {
|
|
1952
1959
|
"file": "packages/memory/src/engine/operations/runtime-audit-log.ts",
|
|
1953
1960
|
"function": "prepareAuditEntry",
|
|
1954
|
-
"line":
|
|
1961
|
+
"line": 442,
|
|
1955
1962
|
"column": 4,
|
|
1956
|
-
"file_hash": "
|
|
1963
|
+
"file_hash": "07418176e3bf3f2379bc58bd9c34962cec64eea73d9c48c7008223e9d111b08e"
|
|
1957
1964
|
},
|
|
1958
1965
|
"memory.audit.sync.failed": {
|
|
1959
1966
|
"file": "packages/memory/src/engine/operations/runtime-audit-log.ts",
|
|
1960
1967
|
"function": "appendAuditEntrySync",
|
|
1961
|
-
"line":
|
|
1968
|
+
"line": 493,
|
|
1962
1969
|
"column": 3,
|
|
1963
|
-
"file_hash": "
|
|
1970
|
+
"file_hash": "07418176e3bf3f2379bc58bd9c34962cec64eea73d9c48c7008223e9d111b08e"
|
|
1964
1971
|
},
|
|
1965
1972
|
"memory.session.file.stat.failed": {
|
|
1966
1973
|
"file": "packages/memory/src/engine/operations/session-summary-storage.ts",
|
|
@@ -2441,9 +2448,16 @@ const logSiteCatalog = {
|
|
|
2441
2448
|
"memory-telemetry-events.<anonymous callback>.23cfef2d08": {
|
|
2442
2449
|
"file": "packages/memory/src/engine/telemetry/memory-telemetry-events.ts",
|
|
2443
2450
|
"function": "<anonymous callback>",
|
|
2444
|
-
"line":
|
|
2451
|
+
"line": 98,
|
|
2445
2452
|
"column": 4,
|
|
2446
|
-
"file_hash": "
|
|
2453
|
+
"file_hash": "af7b0b1639f5a7b8361c0c2821f1c1c7205611121adee5ae7aa3eb84189e5c58"
|
|
2454
|
+
},
|
|
2455
|
+
"memory.telemetry.signing.failed": {
|
|
2456
|
+
"file": "packages/memory/src/engine/telemetry/memory-telemetry-events.ts",
|
|
2457
|
+
"function": "writeReceiptEvent",
|
|
2458
|
+
"line": 117,
|
|
2459
|
+
"column": 4,
|
|
2460
|
+
"file_hash": "af7b0b1639f5a7b8361c0c2821f1c1c7205611121adee5ae7aa3eb84189e5c58"
|
|
2447
2461
|
},
|
|
2448
2462
|
"memory.usage.accept.failed": {
|
|
2449
2463
|
"file": "packages/memory/src/engine/telemetry/memory-telemetry-outbox.ts",
|
|
@@ -2485,119 +2499,119 @@ const logSiteCatalog = {
|
|
|
2485
2499
|
"function": "forwardObserveLedger",
|
|
2486
2500
|
"line": 61,
|
|
2487
2501
|
"column": 7,
|
|
2488
|
-
"file_hash": "
|
|
2502
|
+
"file_hash": "749d13cc84a3adc40b3d67707ac6cc7552fd25c984fbddc48d51a766157b3939"
|
|
2489
2503
|
},
|
|
2490
2504
|
"shared.llm-client.resolveRequestTransport.8f631601af": {
|
|
2491
2505
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2492
2506
|
"function": "resolveRequestTransport",
|
|
2493
|
-
"line":
|
|
2507
|
+
"line": 399,
|
|
2494
2508
|
"column": 4,
|
|
2495
|
-
"file_hash": "
|
|
2509
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2496
2510
|
},
|
|
2497
2511
|
"shared.llm-client.resolveRequestTransport.ffa933b519": {
|
|
2498
2512
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2499
2513
|
"function": "resolveRequestTransport",
|
|
2500
|
-
"line":
|
|
2514
|
+
"line": 405,
|
|
2501
2515
|
"column": 4,
|
|
2502
|
-
"file_hash": "
|
|
2516
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2503
2517
|
},
|
|
2504
2518
|
"llm.host.request.completed": {
|
|
2505
2519
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2506
2520
|
"function": "requestContent",
|
|
2507
|
-
"line":
|
|
2521
|
+
"line": 455,
|
|
2508
2522
|
"column": 6,
|
|
2509
|
-
"file_hash": "
|
|
2523
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2510
2524
|
},
|
|
2511
2525
|
"llm.client.host_cancelled": {
|
|
2512
2526
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2513
2527
|
"function": "requestContent",
|
|
2514
|
-
"line":
|
|
2528
|
+
"line": 473,
|
|
2515
2529
|
"column": 5,
|
|
2516
|
-
"file_hash": "
|
|
2530
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2517
2531
|
},
|
|
2518
2532
|
"llm.client.host_error": {
|
|
2519
2533
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2520
2534
|
"function": "requestContent",
|
|
2521
|
-
"line":
|
|
2535
|
+
"line": 488,
|
|
2522
2536
|
"column": 5,
|
|
2523
|
-
"file_hash": "
|
|
2537
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2524
2538
|
},
|
|
2525
2539
|
"shared.llm-client.requestContent.ff17976562": {
|
|
2526
2540
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2527
2541
|
"function": "requestContent",
|
|
2528
|
-
"line":
|
|
2542
|
+
"line": 526,
|
|
2529
2543
|
"column": 5,
|
|
2530
|
-
"file_hash": "
|
|
2544
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2531
2545
|
},
|
|
2532
2546
|
"llm.client.raw_pipeline_failed": {
|
|
2533
2547
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2534
2548
|
"function": "requestContent",
|
|
2535
|
-
"line":
|
|
2549
|
+
"line": 549,
|
|
2536
2550
|
"column": 5,
|
|
2537
|
-
"file_hash": "
|
|
2551
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2538
2552
|
},
|
|
2539
2553
|
"llm.client.chat_pipeline_failed": {
|
|
2540
2554
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2541
2555
|
"function": "requestContent",
|
|
2542
|
-
"line":
|
|
2556
|
+
"line": 577,
|
|
2543
2557
|
"column": 4,
|
|
2544
|
-
"file_hash": "
|
|
2558
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2545
2559
|
},
|
|
2546
2560
|
"llm.client.empty_reply": {
|
|
2547
2561
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2548
2562
|
"function": "requestContent",
|
|
2549
|
-
"line":
|
|
2563
|
+
"line": 591,
|
|
2550
2564
|
"column": 4,
|
|
2551
|
-
"file_hash": "
|
|
2565
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2552
2566
|
},
|
|
2553
2567
|
"shared.llm-client.requestContentRetryingEmpty.cd874fefff": {
|
|
2554
2568
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2555
2569
|
"function": "requestContentRetryingEmpty",
|
|
2556
|
-
"line":
|
|
2570
|
+
"line": 634,
|
|
2557
2571
|
"column": 5,
|
|
2558
|
-
"file_hash": "
|
|
2572
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2559
2573
|
},
|
|
2560
2574
|
"llm.client.fallback.answered": {
|
|
2561
2575
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2562
2576
|
"function": "requestContentWithHostFallback",
|
|
2563
|
-
"line":
|
|
2577
|
+
"line": 690,
|
|
2564
2578
|
"column": 6,
|
|
2565
|
-
"file_hash": "
|
|
2579
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2566
2580
|
},
|
|
2567
2581
|
"llm.client.fallback.failed": {
|
|
2568
2582
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2569
2583
|
"function": "requestContentWithHostFallback",
|
|
2570
|
-
"line":
|
|
2584
|
+
"line": 707,
|
|
2571
2585
|
"column": 3,
|
|
2572
|
-
"file_hash": "
|
|
2586
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2573
2587
|
},
|
|
2574
2588
|
"llm.client.json.deadline_exhausted": {
|
|
2575
2589
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2576
2590
|
"function": "completeJson",
|
|
2577
|
-
"line":
|
|
2591
|
+
"line": 735,
|
|
2578
2592
|
"column": 7,
|
|
2579
|
-
"file_hash": "
|
|
2593
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2580
2594
|
},
|
|
2581
2595
|
"shared.llm-client.completeJson.e04c8e7e82": {
|
|
2582
2596
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2583
2597
|
"function": "completeJson",
|
|
2584
|
-
"line":
|
|
2598
|
+
"line": 751,
|
|
2585
2599
|
"column": 5,
|
|
2586
|
-
"file_hash": "
|
|
2600
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2587
2601
|
},
|
|
2588
2602
|
"llm.client.json.request_failed": {
|
|
2589
2603
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2590
2604
|
"function": "completeJson",
|
|
2591
|
-
"line":
|
|
2605
|
+
"line": 757,
|
|
2592
2606
|
"column": 5,
|
|
2593
|
-
"file_hash": "
|
|
2607
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2594
2608
|
},
|
|
2595
2609
|
"shared.llm-client.completeText.ffa933b519": {
|
|
2596
2610
|
"file": "packages/memory/src/model/llm-client.ts",
|
|
2597
2611
|
"function": "completeText",
|
|
2598
|
-
"line":
|
|
2612
|
+
"line": 780,
|
|
2599
2613
|
"column": 5,
|
|
2600
|
-
"file_hash": "
|
|
2614
|
+
"file_hash": "8a80c98ca7c0721edd7a9aaa79c56fc60f222cbf58b991281da832b8292b1fa2"
|
|
2601
2615
|
},
|
|
2602
2616
|
"llm.transport.request.completed": {
|
|
2603
2617
|
"file": "packages/memory/src/model/llm-provider-transport.ts",
|
|
@@ -2625,7 +2639,7 @@ const logSiteCatalog = {
|
|
|
2625
2639
|
"function": "<module>",
|
|
2626
2640
|
"line": 20,
|
|
2627
2641
|
"column": 3,
|
|
2628
|
-
"file_hash": "
|
|
2642
|
+
"file_hash": "42d315fa1ae6cf990ca57b35a9942135a99457d561a89efce268750d10b9b45b"
|
|
2629
2643
|
},
|
|
2630
2644
|
"memory.sidecar.request.failed": {
|
|
2631
2645
|
"file": "packages/memory/src/sidecar/memory-routes.ts",
|
|
@@ -2639,315 +2653,336 @@ const logSiteCatalog = {
|
|
|
2639
2653
|
"function": "engineLog",
|
|
2640
2654
|
"line": 62,
|
|
2641
2655
|
"column": 2,
|
|
2642
|
-
"file_hash": "
|
|
2656
|
+
"file_hash": "35da43d808fe489030a9887a3d8838a5e125a4419376d9719a69b60e423d273c"
|
|
2657
|
+
},
|
|
2658
|
+
"memory.sidecar.pending_capture.pruned": {
|
|
2659
|
+
"file": "packages/memory/src/sidecar/memory-runtime.ts",
|
|
2660
|
+
"function": "constructor",
|
|
2661
|
+
"line": 115,
|
|
2662
|
+
"column": 15,
|
|
2663
|
+
"file_hash": "35da43d808fe489030a9887a3d8838a5e125a4419376d9719a69b60e423d273c"
|
|
2643
2664
|
},
|
|
2644
2665
|
"memory.sidecar.model.prepare.failed": {
|
|
2645
2666
|
"file": "packages/memory/src/sidecar/memory-runtime.ts",
|
|
2646
2667
|
"function": "prepareModel",
|
|
2647
|
-
"line":
|
|
2668
|
+
"line": 129,
|
|
2648
2669
|
"column": 4,
|
|
2649
|
-
"file_hash": "
|
|
2670
|
+
"file_hash": "35da43d808fe489030a9887a3d8838a5e125a4419376d9719a69b60e423d273c"
|
|
2650
2671
|
},
|
|
2651
|
-
"memory.sidecar.pending_capture.failed": {
|
|
2672
|
+
"memory.sidecar.pending_capture.replay.failed": {
|
|
2652
2673
|
"file": "packages/memory/src/sidecar/memory-runtime.ts",
|
|
2653
|
-
"function": "
|
|
2654
|
-
"line":
|
|
2655
|
-
"column":
|
|
2656
|
-
"file_hash": "
|
|
2674
|
+
"function": "invoke",
|
|
2675
|
+
"line": 340,
|
|
2676
|
+
"column": 65,
|
|
2677
|
+
"file_hash": "35da43d808fe489030a9887a3d8838a5e125a4419376d9719a69b60e423d273c"
|
|
2657
2678
|
},
|
|
2658
2679
|
"memory.sidecar.usage.failed": {
|
|
2659
2680
|
"file": "packages/memory/src/sidecar/memory-runtime.ts",
|
|
2660
2681
|
"function": "<anonymous callback>",
|
|
2661
|
-
"line":
|
|
2682
|
+
"line": 460,
|
|
2662
2683
|
"column": 5,
|
|
2663
|
-
"file_hash": "
|
|
2684
|
+
"file_hash": "35da43d808fe489030a9887a3d8838a5e125a4419376d9719a69b60e423d273c"
|
|
2664
2685
|
},
|
|
2665
2686
|
"rem-batch-executor.onStageError.d5f24d50d3": {
|
|
2666
2687
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2667
2688
|
"function": "onStageError",
|
|
2668
|
-
"line":
|
|
2689
|
+
"line": 374,
|
|
2669
2690
|
"column": 6,
|
|
2670
|
-
"file_hash": "
|
|
2691
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2671
2692
|
},
|
|
2672
2693
|
"rem-batch-executor.runRemBatchJobUnlocked.55c52b91cf": {
|
|
2673
2694
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2674
2695
|
"function": "runRemBatchJobUnlocked",
|
|
2675
|
-
"line":
|
|
2696
|
+
"line": 521,
|
|
2676
2697
|
"column": 5,
|
|
2677
|
-
"file_hash": "
|
|
2698
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2678
2699
|
},
|
|
2679
2700
|
"sidecar.batch.completed": {
|
|
2680
2701
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2681
2702
|
"function": "runRemBatchJobUnlocked",
|
|
2682
|
-
"line":
|
|
2703
|
+
"line": 592,
|
|
2683
2704
|
"column": 4,
|
|
2684
|
-
"file_hash": "
|
|
2705
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2685
2706
|
},
|
|
2686
2707
|
"rem-batch-executor.openBatchRuntime.86fa720e8f": {
|
|
2687
2708
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2688
2709
|
"function": "openBatchRuntime",
|
|
2689
|
-
"line":
|
|
2710
|
+
"line": 658,
|
|
2690
2711
|
"column": 3,
|
|
2691
|
-
"file_hash": "
|
|
2712
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2692
2713
|
},
|
|
2693
2714
|
"rem-batch-executor.onProviderResponse.df4f2d4fa1": {
|
|
2694
2715
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2695
2716
|
"function": "onProviderResponse",
|
|
2696
|
-
"line":
|
|
2717
|
+
"line": 681,
|
|
2697
2718
|
"column": 5,
|
|
2698
|
-
"file_hash": "
|
|
2719
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2699
2720
|
},
|
|
2700
2721
|
"rem-batch-executor.runUpdate.dbf2a836db": {
|
|
2701
2722
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2702
2723
|
"function": "runUpdate",
|
|
2703
|
-
"line":
|
|
2724
|
+
"line": 939,
|
|
2704
2725
|
"column": 3,
|
|
2705
|
-
"file_hash": "
|
|
2726
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2706
2727
|
},
|
|
2707
2728
|
"rem-batch-executor.runUpdate.7dfc387204": {
|
|
2708
2729
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2709
2730
|
"function": "runUpdate",
|
|
2710
|
-
"line":
|
|
2731
|
+
"line": 1017,
|
|
2711
2732
|
"column": 4,
|
|
2712
|
-
"file_hash": "
|
|
2733
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2713
2734
|
},
|
|
2714
2735
|
"rem-batch-executor.runUpdate.7ffc737c24": {
|
|
2715
2736
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2716
2737
|
"function": "runUpdate",
|
|
2717
|
-
"line":
|
|
2738
|
+
"line": 1064,
|
|
2718
2739
|
"column": 4,
|
|
2719
|
-
"file_hash": "
|
|
2740
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2720
2741
|
},
|
|
2721
2742
|
"rem-batch-executor.runReplace.e1e35e40e9": {
|
|
2722
2743
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2723
2744
|
"function": "runReplace",
|
|
2724
|
-
"line":
|
|
2745
|
+
"line": 2413,
|
|
2725
2746
|
"column": 3,
|
|
2726
|
-
"file_hash": "
|
|
2747
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2727
2748
|
},
|
|
2728
2749
|
"rem-batch-executor.runReplace.de3a5f3ce3": {
|
|
2729
2750
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2730
2751
|
"function": "runReplace",
|
|
2731
|
-
"line":
|
|
2752
|
+
"line": 2621,
|
|
2732
2753
|
"column": 4,
|
|
2733
|
-
"file_hash": "
|
|
2754
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2734
2755
|
},
|
|
2735
2756
|
"rem-batch-executor.runReplace.e4be8cfe8f": {
|
|
2736
2757
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2737
2758
|
"function": "runReplace",
|
|
2738
|
-
"line":
|
|
2759
|
+
"line": 2867,
|
|
2739
2760
|
"column": 4,
|
|
2740
|
-
"file_hash": "
|
|
2761
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2741
2762
|
},
|
|
2742
2763
|
"memory.rem.refusal.release_failed": {
|
|
2743
2764
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2744
2765
|
"function": "runReplace",
|
|
2745
|
-
"line":
|
|
2766
|
+
"line": 2992,
|
|
2746
2767
|
"column": 6,
|
|
2747
|
-
"file_hash": "
|
|
2768
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2748
2769
|
},
|
|
2749
2770
|
"rem-batch-executor.buildRemReplaceCandidateQueue.25aa1a67a6": {
|
|
2750
2771
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2751
2772
|
"function": "buildRemReplaceCandidateQueue",
|
|
2752
|
-
"line":
|
|
2773
|
+
"line": 3221,
|
|
2753
2774
|
"column": 3,
|
|
2754
|
-
"file_hash": "
|
|
2775
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2755
2776
|
},
|
|
2756
2777
|
"rem-batch-executor.buildRemReplaceCandidateQueue.lookup_failed": {
|
|
2757
2778
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2758
2779
|
"function": "buildRemReplaceCandidateQueue",
|
|
2759
|
-
"line":
|
|
2780
|
+
"line": 3303,
|
|
2760
2781
|
"column": 3,
|
|
2761
|
-
"file_hash": "
|
|
2782
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2762
2783
|
},
|
|
2763
2784
|
"rem-batch-executor.reserveReplaceStage.4e67e45fd5": {
|
|
2764
2785
|
"file": "packages/memory/src/sidecar/rem-batch-executor.ts",
|
|
2765
2786
|
"function": "reserveReplaceStage",
|
|
2766
|
-
"line":
|
|
2787
|
+
"line": 3750,
|
|
2767
2788
|
"column": 2,
|
|
2768
|
-
"file_hash": "
|
|
2789
|
+
"file_hash": "e9d0aca7158a1574da58485fdaa0ba369fe64c3bc7105650cb4863c88ac76612"
|
|
2790
|
+
},
|
|
2791
|
+
"rem-job-store.readCompletedJobs.invalid-line": {
|
|
2792
|
+
"file": "packages/memory/src/sidecar/rem-job-store.ts",
|
|
2793
|
+
"function": "readCompletedJobs",
|
|
2794
|
+
"line": 221,
|
|
2795
|
+
"column": 5,
|
|
2796
|
+
"file_hash": "a81d0a17a42dff1f164fccbbb446624f7cfa68e2c7823c760fcd678049c3c8da"
|
|
2769
2797
|
},
|
|
2770
2798
|
"rem-job-store.load.invalid-line": {
|
|
2771
2799
|
"file": "packages/memory/src/sidecar/rem-job-store.ts",
|
|
2772
2800
|
"function": "load",
|
|
2773
|
-
"line":
|
|
2801
|
+
"line": 329,
|
|
2774
2802
|
"column": 5,
|
|
2775
|
-
"file_hash": "
|
|
2803
|
+
"file_hash": "a81d0a17a42dff1f164fccbbb446624f7cfa68e2c7823c760fcd678049c3c8da"
|
|
2776
2804
|
},
|
|
2777
2805
|
"rem.journal.failed": {
|
|
2778
2806
|
"file": "packages/memory/src/sidecar/rem-job-store.ts",
|
|
2779
2807
|
"function": "reportFailure",
|
|
2780
|
-
"line":
|
|
2808
|
+
"line": 419,
|
|
2781
2809
|
"column": 3,
|
|
2782
|
-
"file_hash": "
|
|
2810
|
+
"file_hash": "a81d0a17a42dff1f164fccbbb446624f7cfa68e2c7823c760fcd678049c3c8da"
|
|
2783
2811
|
},
|
|
2784
2812
|
"memory.rem.trigger.state.unavailable": {
|
|
2785
2813
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2786
2814
|
"function": "evaluateRemAutomaticTriggers",
|
|
2787
|
-
"line":
|
|
2815
|
+
"line": 143,
|
|
2788
2816
|
"column": 3,
|
|
2789
|
-
"file_hash": "
|
|
2817
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2790
2818
|
},
|
|
2791
2819
|
"rem-trigger.evaluateRemAutomaticTriggers.1d59077a5c": {
|
|
2792
2820
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2793
2821
|
"function": "evaluateRemAutomaticTriggers",
|
|
2794
|
-
"line":
|
|
2822
|
+
"line": 171,
|
|
2795
2823
|
"column": 4,
|
|
2796
|
-
"file_hash": "
|
|
2824
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2797
2825
|
},
|
|
2798
2826
|
"rem-trigger.evaluateRemAutomaticTriggers.ebe1cdd204": {
|
|
2799
2827
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2800
2828
|
"function": "evaluateRemAutomaticTriggers",
|
|
2801
|
-
"line":
|
|
2829
|
+
"line": 183,
|
|
2802
2830
|
"column": 5,
|
|
2803
|
-
"file_hash": "
|
|
2831
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2804
2832
|
},
|
|
2805
2833
|
"rem-trigger.evaluateRemAutomaticTriggers.46669e66ff": {
|
|
2806
2834
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2807
2835
|
"function": "evaluateRemAutomaticTriggers",
|
|
2808
|
-
"line":
|
|
2836
|
+
"line": 193,
|
|
2809
2837
|
"column": 5,
|
|
2810
|
-
"file_hash": "
|
|
2838
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2811
2839
|
},
|
|
2812
2840
|
"memory.rem.trigger.state.write.failed": {
|
|
2813
2841
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2814
2842
|
"function": "evaluateRemAutomaticTriggers",
|
|
2815
|
-
"line":
|
|
2843
|
+
"line": 214,
|
|
2816
2844
|
"column": 18,
|
|
2817
|
-
"file_hash": "
|
|
2845
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2818
2846
|
},
|
|
2819
2847
|
"sidecar.trigger.dispatch.accepted": {
|
|
2820
2848
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2821
2849
|
"function": "dispatchRemWave",
|
|
2822
|
-
"line":
|
|
2850
|
+
"line": 352,
|
|
2851
|
+
"column": 3,
|
|
2852
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2853
|
+
},
|
|
2854
|
+
"sidecar.trigger.completion_jobs.read.failed": {
|
|
2855
|
+
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2856
|
+
"function": "applyCompletedBaselines",
|
|
2857
|
+
"line": 387,
|
|
2823
2858
|
"column": 3,
|
|
2824
|
-
"file_hash": "
|
|
2859
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2825
2860
|
},
|
|
2826
2861
|
"sidecar.trigger.audit_read.failed": {
|
|
2827
2862
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2828
2863
|
"function": "applyCompletedBaselines",
|
|
2829
|
-
"line":
|
|
2864
|
+
"line": 398,
|
|
2830
2865
|
"column": 3,
|
|
2831
|
-
"file_hash": "
|
|
2866
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2832
2867
|
},
|
|
2833
2868
|
"sidecar.trigger.audit_records.skipped": {
|
|
2834
2869
|
"file": "packages/memory/src/sidecar/rem-trigger.ts",
|
|
2835
2870
|
"function": "applyCompletedBaselines",
|
|
2836
|
-
"line":
|
|
2871
|
+
"line": 495,
|
|
2837
2872
|
"column": 3,
|
|
2838
|
-
"file_hash": "
|
|
2873
|
+
"file_hash": "d9f3b0a31a68fa444b1401a235e8d781ebffd9b1c9345c66515d677240fdc584"
|
|
2839
2874
|
},
|
|
2840
2875
|
"sidecar.duplicate.exit": {
|
|
2841
2876
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2842
2877
|
"function": "bindSidecarSocket",
|
|
2843
|
-
"line":
|
|
2878
|
+
"line": 142,
|
|
2844
2879
|
"column": 6,
|
|
2845
|
-
"file_hash": "
|
|
2880
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2846
2881
|
},
|
|
2847
2882
|
"server.<anonymous callback>.5eb5a60e6b": {
|
|
2848
2883
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2849
2884
|
"function": "<anonymous callback>",
|
|
2850
|
-
"line":
|
|
2885
|
+
"line": 201,
|
|
2851
2886
|
"column": 3,
|
|
2852
|
-
"file_hash": "
|
|
2887
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2853
2888
|
},
|
|
2854
2889
|
"server.<anonymous callback>.47c4662916": {
|
|
2855
2890
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2856
2891
|
"function": "recordRequest",
|
|
2857
|
-
"line":
|
|
2892
|
+
"line": 237,
|
|
2858
2893
|
"column": 4,
|
|
2859
|
-
"file_hash": "
|
|
2894
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2860
2895
|
},
|
|
2861
2896
|
"server.<anonymous callback>.a7a2656a08": {
|
|
2862
2897
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2863
2898
|
"function": "<anonymous callback>",
|
|
2864
|
-
"line":
|
|
2899
|
+
"line": 277,
|
|
2865
2900
|
"column": 5,
|
|
2866
|
-
"file_hash": "
|
|
2901
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2867
2902
|
},
|
|
2868
2903
|
"sidecar.discovery.published": {
|
|
2869
2904
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2870
2905
|
"function": "publishDiscovery",
|
|
2871
|
-
"line":
|
|
2906
|
+
"line": 307,
|
|
2872
2907
|
"column": 30,
|
|
2873
|
-
"file_hash": "
|
|
2908
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2874
2909
|
},
|
|
2875
2910
|
"sidecar.discovery.failed": {
|
|
2876
2911
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2877
2912
|
"function": "publishDiscovery",
|
|
2878
|
-
"line":
|
|
2913
|
+
"line": 312,
|
|
2879
2914
|
"column": 4,
|
|
2880
|
-
"file_hash": "
|
|
2915
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2881
2916
|
},
|
|
2882
2917
|
"server.startLockedRemSidecar.96a92b085b": {
|
|
2883
2918
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2884
2919
|
"function": "startLockedRemSidecar",
|
|
2885
|
-
"line":
|
|
2920
|
+
"line": 335,
|
|
2886
2921
|
"column": 2,
|
|
2887
|
-
"file_hash": "
|
|
2922
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2888
2923
|
},
|
|
2889
2924
|
"sidecar.shutdown.timeout": {
|
|
2890
2925
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2891
2926
|
"function": "startRemSidecar.stop",
|
|
2892
|
-
"line":
|
|
2927
|
+
"line": 370,
|
|
2893
2928
|
"column": 7,
|
|
2894
|
-
"file_hash": "
|
|
2929
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2895
2930
|
},
|
|
2896
2931
|
"sidecar.shutdown.task.running": {
|
|
2897
2932
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2898
2933
|
"function": "startRemSidecar.stop",
|
|
2899
|
-
"line":
|
|
2934
|
+
"line": 378,
|
|
2900
2935
|
"column": 8,
|
|
2901
|
-
"file_hash": "
|
|
2936
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2902
2937
|
},
|
|
2903
2938
|
"sidecar.shutdown.completed": {
|
|
2904
2939
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2905
2940
|
"function": "startRemSidecar.stop",
|
|
2906
|
-
"line":
|
|
2941
|
+
"line": 393,
|
|
2907
2942
|
"column": 5,
|
|
2908
|
-
"file_hash": "
|
|
2943
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2909
2944
|
},
|
|
2910
2945
|
"server.routeRequest.0ea180a77c": {
|
|
2911
2946
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2912
2947
|
"function": "routeRequest",
|
|
2913
|
-
"line":
|
|
2948
|
+
"line": 475,
|
|
2914
2949
|
"column": 3,
|
|
2915
|
-
"file_hash": "
|
|
2950
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2916
2951
|
},
|
|
2917
2952
|
"server.runChassisJob.e7639bd8fc": {
|
|
2918
2953
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2919
2954
|
"function": "runChassisJob",
|
|
2920
|
-
"line":
|
|
2955
|
+
"line": 677,
|
|
2921
2956
|
"column": 6,
|
|
2922
|
-
"file_hash": "
|
|
2957
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2923
2958
|
},
|
|
2924
2959
|
"sidecar.job.completed": {
|
|
2925
2960
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2926
2961
|
"function": "runChassisJob",
|
|
2927
|
-
"line":
|
|
2962
|
+
"line": 702,
|
|
2928
2963
|
"column": 4,
|
|
2929
|
-
"file_hash": "
|
|
2964
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2930
2965
|
},
|
|
2931
2966
|
"server.failNonTerminalJob.cf84e07c6d": {
|
|
2932
2967
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2933
2968
|
"function": "failNonTerminalJob",
|
|
2934
|
-
"line":
|
|
2969
|
+
"line": 773,
|
|
2935
2970
|
"column": 3,
|
|
2936
|
-
"file_hash": "
|
|
2971
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2937
2972
|
},
|
|
2938
2973
|
"server.recoverInterruptedJobs.15309ea841": {
|
|
2939
2974
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2940
2975
|
"function": "recoverInterruptedJobs",
|
|
2941
|
-
"line":
|
|
2976
|
+
"line": 808,
|
|
2942
2977
|
"column": 4,
|
|
2943
|
-
"file_hash": "
|
|
2978
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2944
2979
|
},
|
|
2945
2980
|
"sidecar.operation.failed": {
|
|
2946
2981
|
"file": "packages/memory/src/sidecar/server.ts",
|
|
2947
2982
|
"function": "reportSidecarFailure",
|
|
2948
|
-
"line":
|
|
2983
|
+
"line": 986,
|
|
2949
2984
|
"column": 2,
|
|
2950
|
-
"file_hash": "
|
|
2985
|
+
"file_hash": "d2b00aa94e2bd09f38d806331a87cd7bac4d10ea25db5b323ec470e45c1d8434"
|
|
2951
2986
|
},
|
|
2952
2987
|
"active-task-carrier-backfill.backfillActiveTaskCarriers.facdae917f": {
|
|
2953
2988
|
"file": "packages/memory/src/store/active-task-carrier-backfill.ts",
|
|
@@ -9202,7 +9237,8 @@ function parseBProfileMessages(conversationText) {
|
|
|
9202
9237
|
* One logical task: one initial attempt plus at most one retry.
|
|
9203
9238
|
*
|
|
9204
9239
|
* The transport collapses "could not reach it" and "it answered with nothing" into a null
|
|
9205
|
-
* completion
|
|
9240
|
+
* completion; an empty answer ends the turn at once (asking again gets the same nothing), while
|
|
9241
|
+
* a connection failure or a reply that fails either validation stage is retried. A reply
|
|
9206
9242
|
* that passes is never retried — including one whose candidates all dropped, which is a real
|
|
9207
9243
|
* answer about that turn and not a failure to get one.
|
|
9208
9244
|
*/
|
|
@@ -9213,13 +9249,14 @@ async function extractOneTurn(prompt, llm, turnIndex, turnText) {
|
|
|
9213
9249
|
raw = await llm.completeText({
|
|
9214
9250
|
prompt,
|
|
9215
9251
|
callId: "E9",
|
|
9216
|
-
maxTokens: PROFILE_EXTRACTION_MAX_TOKENS
|
|
9252
|
+
maxTokens: PROFILE_EXTRACTION_MAX_TOKENS,
|
|
9253
|
+
emptyReplyAttempts: 1
|
|
9217
9254
|
});
|
|
9218
9255
|
} catch (error) {
|
|
9219
9256
|
if (isRetryableTransportError(error)) continue;
|
|
9220
9257
|
throw error;
|
|
9221
9258
|
}
|
|
9222
|
-
if (raw === null)
|
|
9259
|
+
if (raw === null) return void 0;
|
|
9223
9260
|
const outcome = readReply(raw, turnIndex, turnText);
|
|
9224
9261
|
if (outcome) return outcome;
|
|
9225
9262
|
}
|
|
@@ -9657,12 +9694,22 @@ function buildAtomicGenericExtractionPrompt(turns, sessionDateTime, locale = "en
|
|
|
9657
9694
|
}
|
|
9658
9695
|
function renderAtomicLaneContext(input) {
|
|
9659
9696
|
const locale = input.locale ?? "en";
|
|
9697
|
+
const turns = numberAtomicTurns(input.turns);
|
|
9698
|
+
const preceding = [...input.contextTurns ?? []];
|
|
9699
|
+
const following = [...input.followingTurns ?? []];
|
|
9700
|
+
while (countTokens(JSON.stringify({
|
|
9701
|
+
turns,
|
|
9702
|
+
preceding,
|
|
9703
|
+
following
|
|
9704
|
+
})) > input.runParameters.maxInputTokens) if (preceding.length > 0) preceding.shift();
|
|
9705
|
+
else if (following.length > 0) following.pop();
|
|
9706
|
+
else break;
|
|
9660
9707
|
return [
|
|
9661
9708
|
`session_date_time: ${input.sessionDateTime ?? "unknown"}`,
|
|
9662
9709
|
atomicExtractionSkillReference("surrounding-context"),
|
|
9663
|
-
`preceding_context: ${renderAtomicPromptData(
|
|
9664
|
-
`following_context: ${renderAtomicPromptData(
|
|
9665
|
-
`transcript:\n${renderAtomicPromptData(
|
|
9710
|
+
`preceding_context: ${renderAtomicPromptData(preceding, locale).value}`,
|
|
9711
|
+
`following_context: ${renderAtomicPromptData(following, locale).value}`,
|
|
9712
|
+
`transcript:\n${renderAtomicPromptData(turns, locale).value}`
|
|
9666
9713
|
].join("\n\n");
|
|
9667
9714
|
}
|
|
9668
9715
|
function buildAtomicCapturePrompt(input) {
|
|
@@ -10149,6 +10196,22 @@ async function splitAtomicCaptureTurn(input, outputTokenBudget, attempts, failed
|
|
|
10149
10196
|
};
|
|
10150
10197
|
}
|
|
10151
10198
|
async function captureAtomicWindow(input, outputTokenBudget, attempts) {
|
|
10199
|
+
if (countTokens(JSON.stringify({
|
|
10200
|
+
turns: numberAtomicTurns(input.turns),
|
|
10201
|
+
preceding: [],
|
|
10202
|
+
following: []
|
|
10203
|
+
})) > input.runParameters.maxInputTokens) {
|
|
10204
|
+
if (input.turns.length > 1) return splitAtomicCaptureWindow(input, outputTokenBudget, attempts);
|
|
10205
|
+
if (splitTurnContent(input.turns[0]?.content ?? "") === void 0) {
|
|
10206
|
+
input.store.recordAtomicExtractionCalls(input.ledgerKey, input.nowMs());
|
|
10207
|
+
return {
|
|
10208
|
+
status: "pending",
|
|
10209
|
+
reason: "input-overflow",
|
|
10210
|
+
failedReply: ""
|
|
10211
|
+
};
|
|
10212
|
+
}
|
|
10213
|
+
return splitAtomicCaptureTurn(input, outputTokenBudget, attempts, "");
|
|
10214
|
+
}
|
|
10152
10215
|
const sanitizedInput = sanitizeAtomicPromptValue(input.turns, input.locale ?? "en");
|
|
10153
10216
|
const prompt = buildAtomicCapturePrompt(input);
|
|
10154
10217
|
let lastReply = "";
|
|
@@ -10665,6 +10728,7 @@ function countTodoTransitionsWithoutSource(database) {
|
|
|
10665
10728
|
*/
|
|
10666
10729
|
const log$7 = createLogger("sno-station-mem:atomic-extraction-windows");
|
|
10667
10730
|
const windowDiagnosticContext = new AsyncLocalStorage();
|
|
10731
|
+
const arrivalRetirementContext = new AsyncLocalStorage();
|
|
10668
10732
|
function windowDiagnostics() {
|
|
10669
10733
|
return {
|
|
10670
10734
|
proposed: 0,
|
|
@@ -10868,10 +10932,10 @@ function parseAtomicConversationTurns(conversationText) {
|
|
|
10868
10932
|
if (current) turns.push(current);
|
|
10869
10933
|
return turns;
|
|
10870
10934
|
}
|
|
10871
|
-
function atomicConversationWindows(turns) {
|
|
10935
|
+
function atomicConversationWindows(turns, captureBatch = false) {
|
|
10872
10936
|
const userIndexes = turns.flatMap((turn, index) => turn.role === "user" ? [index] : []);
|
|
10873
10937
|
if (userIndexes.length === 0) return [];
|
|
10874
|
-
if (userIndexes.length <= 2) return [{
|
|
10938
|
+
if (captureBatch || userIndexes.length <= 2) return [{
|
|
10875
10939
|
turns: [...turns],
|
|
10876
10940
|
contextTurns: [],
|
|
10877
10941
|
followingTurns: [],
|
|
@@ -11036,7 +11100,14 @@ function createSignedAtomicMemoryExtractionTransports(config, locale = "en") {
|
|
|
11036
11100
|
retirementVerdict: { judge: (pair) => chat.completeText({
|
|
11037
11101
|
prompt: adapterPrompt ? renderAdapterAPrompt(pair.older, pair.newer) : renderAdapterAChatPrompt(pair),
|
|
11038
11102
|
hostPrompt: renderAdapterAChatPrompt(pair),
|
|
11039
|
-
callId: "E10"
|
|
11103
|
+
callId: "E10",
|
|
11104
|
+
takeProviderAttempt: () => {
|
|
11105
|
+
const work = arrivalRetirementContext.getStore();
|
|
11106
|
+
if (!work) return true;
|
|
11107
|
+
if (work.providerCallsLeft <= 0) return false;
|
|
11108
|
+
work.providerCallsLeft -= 1;
|
|
11109
|
+
return true;
|
|
11110
|
+
}
|
|
11040
11111
|
}) }
|
|
11041
11112
|
};
|
|
11042
11113
|
}
|
|
@@ -11050,7 +11121,12 @@ var AtomicInsightDistiller = class {
|
|
|
11050
11121
|
this.config = config;
|
|
11051
11122
|
}
|
|
11052
11123
|
async extractAndPersist(conversationText, sessionKey, options = {}) {
|
|
11053
|
-
|
|
11124
|
+
const retirement = {
|
|
11125
|
+
remaining: 3,
|
|
11126
|
+
providerCallsLeft: 3,
|
|
11127
|
+
...this.config.scheduleArrivalRetirement ? { tasks: [] } : {}
|
|
11128
|
+
};
|
|
11129
|
+
return arrivalRetirementContext.run(retirement, () => withLogContext({
|
|
11054
11130
|
operation_id: currentLogContext().operation_id ?? randomUUID(),
|
|
11055
11131
|
session_reference: sessionKey
|
|
11056
11132
|
}, async () => {
|
|
@@ -11059,7 +11135,7 @@ var AtomicInsightDistiller = class {
|
|
|
11059
11135
|
let captureOutcome = "failed";
|
|
11060
11136
|
try {
|
|
11061
11137
|
if (!sessionKey.trim()) throw new Error("Atomic extraction requires sessionKey");
|
|
11062
|
-
const windows = atomicConversationWindows(parseAtomicConversationTurns(conversationText));
|
|
11138
|
+
const windows = atomicConversationWindows(parseAtomicConversationTurns(conversationText), this.config.captureBatch);
|
|
11063
11139
|
if (windows.length === 0) log$7.warn("atomic extraction found no parseable turn; nothing will be stored", { session_reference: privateLogReference(sessionKey) }, {
|
|
11064
11140
|
event_name: "memory.atomic_memory_extraction.diagnostic",
|
|
11065
11141
|
file: "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
@@ -11175,6 +11251,10 @@ var AtomicInsightDistiller = class {
|
|
|
11175
11251
|
...llmFailures > 0 ? { llmFailures } : {}
|
|
11176
11252
|
};
|
|
11177
11253
|
} finally {
|
|
11254
|
+
const tasks = retirement.tasks;
|
|
11255
|
+
if (tasks && tasks.length > 0) this.config.scheduleArrivalRetirement?.(async () => {
|
|
11256
|
+
for (const task of tasks) await task();
|
|
11257
|
+
});
|
|
11178
11258
|
const sum = (field) => diagnostics.reduce((total, row) => total + row[field], 0);
|
|
11179
11259
|
log$7[captureOutcome === "failed" ? "error" : "info"]("Memory capture completed", {
|
|
11180
11260
|
outcome: captureOutcome === "failed" && sum("persisted") > 0 ? "partial" : captureOutcome,
|
|
@@ -11203,7 +11283,7 @@ var AtomicInsightDistiller = class {
|
|
|
11203
11283
|
site_id: "memory.capture.completed"
|
|
11204
11284
|
});
|
|
11205
11285
|
}
|
|
11206
|
-
});
|
|
11286
|
+
}));
|
|
11207
11287
|
}
|
|
11208
11288
|
};
|
|
11209
11289
|
async function resolveSubjects(store, projectId, records, transport, jobId, nowMs) {
|
|
@@ -11768,37 +11848,47 @@ async function runAtomicMemoryExtraction(input) {
|
|
|
11768
11848
|
diagnostic.outcome = write.createdCount > 0 ? "success" : "empty_success";
|
|
11769
11849
|
publishClaims();
|
|
11770
11850
|
const nominatedCards = cards.filter((card) => card.lane === "active");
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11851
|
+
const retirement = arrivalRetirementContext.getStore() ?? {
|
|
11852
|
+
remaining: 3,
|
|
11853
|
+
providerCallsLeft: 3
|
|
11854
|
+
};
|
|
11855
|
+
const retire = async () => {
|
|
11856
|
+
for (const card of nominatedCards) {
|
|
11857
|
+
if (retirement.remaining <= 0 || retirement.providerCallsLeft <= 0) break;
|
|
11858
|
+
const stored = input.store.findByExtractionIdempotencyKey(input.projectId, card.idempotencyKey);
|
|
11859
|
+
if (stored === void 0) continue;
|
|
11860
|
+
try {
|
|
11861
|
+
await runAtomicArrivalRetirementJudgment({
|
|
11862
|
+
store: input.store,
|
|
11863
|
+
projectId: input.projectId,
|
|
11864
|
+
jobId: input.ledgerKey.conversationId,
|
|
11865
|
+
nominatedRowId: stored.id,
|
|
11866
|
+
nowMs: atomicFactWrite.nowMs,
|
|
11867
|
+
transport: input.transports.retirementVerdict,
|
|
11868
|
+
budget: retirement
|
|
11869
|
+
});
|
|
11870
|
+
} catch (error) {
|
|
11871
|
+
log$7.error("atomic arrival retirement failed after write; older facts stay current", {
|
|
11872
|
+
nominatedRowId: stored.id,
|
|
11873
|
+
session_reference: privateLogReference(input.ledgerKey.conversationId),
|
|
11874
|
+
error
|
|
11875
|
+
}, {
|
|
11876
|
+
event_name: "memory.atomic_memory_extraction.diagnostic",
|
|
11877
|
+
file: "packages/memory/src/engine/extraction/atomic-memory-extraction.ts",
|
|
11878
|
+
function: "runAtomicMemoryExtraction",
|
|
11879
|
+
site_id: "extraction.atomic-memory-extraction.runAtomicMemoryExtraction.0d9673d494"
|
|
11880
|
+
});
|
|
11881
|
+
journalAtomicArrivalRetirementRefusal(input.store, {
|
|
11882
|
+
jobId: input.ledgerKey.conversationId,
|
|
11883
|
+
nominatedRowId: stored.id,
|
|
11884
|
+
reason: `judgment_failed:${error instanceof Error ? error.message : String(error)}`,
|
|
11885
|
+
candidateSetSize: 0
|
|
11886
|
+
});
|
|
11887
|
+
}
|
|
11800
11888
|
}
|
|
11801
|
-
}
|
|
11889
|
+
};
|
|
11890
|
+
if (retirement.tasks) retirement.tasks.push(retire);
|
|
11891
|
+
else await retire();
|
|
11802
11892
|
return {
|
|
11803
11893
|
status: "complete",
|
|
11804
11894
|
records: resolved.records,
|
|
@@ -11896,9 +11986,13 @@ async function runAtomicArrivalRetirementJudgment(input) {
|
|
|
11896
11986
|
const candidateSet = await readAtomicArrivalRetirementCandidateSet(input.store, input);
|
|
11897
11987
|
if (candidateSet === void 0 || candidateSet.candidateRows.length === 0) return;
|
|
11898
11988
|
const replaced = /* @__PURE__ */ new Set();
|
|
11899
|
-
const queue =
|
|
11989
|
+
const queue = candidateSet.candidateRows.slice(0, input.budget.remaining);
|
|
11990
|
+
input.budget.remaining -= queue.length;
|
|
11900
11991
|
const judgeQueued = async () => {
|
|
11901
|
-
for (let candidate = queue.shift(); candidate !== void 0; candidate = queue.shift())
|
|
11992
|
+
for (let candidate = queue.shift(); candidate !== void 0; candidate = queue.shift()) {
|
|
11993
|
+
if (input.budget.providerCallsLeft <= 0) break;
|
|
11994
|
+
if (await judgeArrivalRetirementPair(input, candidateSet, candidate) === "replacement") replaced.add(candidate.id);
|
|
11995
|
+
}
|
|
11902
11996
|
};
|
|
11903
11997
|
await Promise.all(Array.from({ length: ARRIVAL_RETIREMENT_PAIRS_IN_FLIGHT }, judgeQueued));
|
|
11904
11998
|
await closeAtomicArrivalRetirementTargets(input.store, {
|
|
@@ -15156,7 +15250,7 @@ const diagnosticLog$4 = createLogger("sno-station-mem:sno-station-mem-insight-di
|
|
|
15156
15250
|
* Assembles Insight Distill from validated inputs for deterministic plugin lifecycle
|
|
15157
15251
|
* orchestration.
|
|
15158
15252
|
*/
|
|
15159
|
-
function buildInsightDistiller(api, config, store, _embedder, _observability, _sessionUuidProvider, stateDir, agentPort) {
|
|
15253
|
+
function buildInsightDistiller(api, config, store, _embedder, _observability, _sessionUuidProvider, stateDir, agentPort, scheduleArrivalRetirement, captureBatch = false) {
|
|
15160
15254
|
const routing = pickLlmRoutingConfig(config);
|
|
15161
15255
|
const extractRoute = resolveLlmRoute({
|
|
15162
15256
|
callId: "E1",
|
|
@@ -15252,7 +15346,9 @@ function buildInsightDistiller(api, config, store, _embedder, _observability, _s
|
|
|
15252
15346
|
});
|
|
15253
15347
|
return new AtomicInsightDistiller(store, transports, {
|
|
15254
15348
|
defaultScope: config.scopes.default,
|
|
15255
|
-
locale: config.language
|
|
15349
|
+
locale: config.language,
|
|
15350
|
+
scheduleArrivalRetirement,
|
|
15351
|
+
captureBatch
|
|
15256
15352
|
});
|
|
15257
15353
|
} catch (err) {
|
|
15258
15354
|
throw new Error(`sno-station-mem insight-distill init failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -17078,6 +17174,7 @@ var MemoryContractRuntime = class {
|
|
|
17078
17174
|
registration;
|
|
17079
17175
|
providers = /* @__PURE__ */ new Map();
|
|
17080
17176
|
reflectionStates = /* @__PURE__ */ new Map();
|
|
17177
|
+
arrivalRetirements = /* @__PURE__ */ new Set();
|
|
17081
17178
|
recall = {
|
|
17082
17179
|
history: /* @__PURE__ */ new Map(),
|
|
17083
17180
|
turns: /* @__PURE__ */ new Map(),
|
|
@@ -17091,6 +17188,7 @@ var MemoryContractRuntime = class {
|
|
|
17091
17188
|
this.recall = previous.recall;
|
|
17092
17189
|
}
|
|
17093
17190
|
async close() {
|
|
17191
|
+
await Promise.allSettled(this.arrivalRetirements);
|
|
17094
17192
|
for (const provider of this.providers.values()) await provider.close();
|
|
17095
17193
|
this.providers.clear();
|
|
17096
17194
|
this.reflectionStates.clear();
|
|
@@ -17311,7 +17409,10 @@ var MemoryContractRuntime = class {
|
|
|
17311
17409
|
const context = await this.toolContext(scope);
|
|
17312
17410
|
checkMemoryOperation();
|
|
17313
17411
|
const runtimeContext = this.services;
|
|
17314
|
-
const distiller = buildInsightDistiller(runtimeContext, config, this.services.store, this.services.embedder, this.services.observability, () => void 0, this.services.stateDir, this.services.agentPort)
|
|
17412
|
+
const distiller = buildInsightDistiller(runtimeContext, config, this.services.store, this.services.embedder, this.services.observability, () => void 0, this.services.stateDir, this.services.agentPort, (task) => {
|
|
17413
|
+
const pending = withMemoryOperation("arrival-retirement", void 0, task).catch((error) => this.services.logger.error(String(error))).finally(() => this.arrivalRetirements.delete(pending));
|
|
17414
|
+
this.arrivalRetirements.add(pending);
|
|
17415
|
+
}, true);
|
|
17315
17416
|
const reason = {};
|
|
17316
17417
|
const outcome = await onAgentEnd(runtimeContext, config, this.services.store, this.services.embedder, context.scopePolicy, distiller, {
|
|
17317
17418
|
success: true,
|
|
@@ -17350,16 +17451,19 @@ var MemoryContractRuntime = class {
|
|
|
17350
17451
|
contextText: "",
|
|
17351
17452
|
unavailable: `${input.options.corpus} corpus not available from this provider`
|
|
17352
17453
|
};
|
|
17454
|
+
const nativeHits = await (await this.provider(input.scope)).search(input.query, {
|
|
17455
|
+
maxResults: input.options.limit,
|
|
17456
|
+
minScore: input.options.minScore,
|
|
17457
|
+
sources: ["memory"],
|
|
17458
|
+
signal
|
|
17459
|
+
});
|
|
17460
|
+
this.recordReadUsage(nativeHits.map((hit) => basename(hit.path, ".md")), input.scope, recallId);
|
|
17461
|
+
this.recordRecallPreview(input.query, nativeHits.map((hit) => hit.snippet));
|
|
17353
17462
|
return {
|
|
17354
17463
|
degraded: false,
|
|
17355
17464
|
recallId,
|
|
17356
17465
|
contextText: "",
|
|
17357
|
-
nativeHits
|
|
17358
|
-
maxResults: input.options.limit,
|
|
17359
|
-
minScore: input.options.minScore,
|
|
17360
|
-
sources: ["memory"],
|
|
17361
|
-
signal
|
|
17362
|
-
})
|
|
17466
|
+
nativeHits
|
|
17363
17467
|
};
|
|
17364
17468
|
}
|
|
17365
17469
|
if (input.options.source === "manual") {
|
|
@@ -17404,6 +17508,8 @@ var MemoryContractRuntime = class {
|
|
|
17404
17508
|
text: contextText
|
|
17405
17509
|
}];
|
|
17406
17510
|
result.details.memories = entries;
|
|
17511
|
+
this.recordReadUsage(entries.map((entry) => entry.id), input.scope, recallId);
|
|
17512
|
+
if (!result.isError) this.recordRecallPreview(input.query, entries.map((entry) => entry.text));
|
|
17407
17513
|
if (turn !== void 0) this.recordRecalled(sessionId, turn, entries.map((entry) => entry.id));
|
|
17408
17514
|
return parseOutput("getRecall", {
|
|
17409
17515
|
degraded: false,
|
|
@@ -17496,12 +17602,15 @@ var MemoryContractRuntime = class {
|
|
|
17496
17602
|
memoryIds.push(current.id);
|
|
17497
17603
|
}
|
|
17498
17604
|
}
|
|
17605
|
+
this.recordRecallPreview(query, memoryIds.map((id) => this.services.store.getById(id)?.text));
|
|
17499
17606
|
if (!memoryIds.length) return empty;
|
|
17500
17607
|
const contextText = lines.join("\n");
|
|
17501
17608
|
for (const id of memoryIds) state.ids.add(id);
|
|
17502
17609
|
state.chars += contextText.length;
|
|
17503
17610
|
this.recall.injection.set(key, state);
|
|
17504
17611
|
this.recordRecalled(key, turn, memoryIds);
|
|
17612
|
+
this.recordReadUsage(memoryIds, scope, recallId);
|
|
17613
|
+
this.recordReadUsage(memoryIds, scope, recallId, "inject");
|
|
17505
17614
|
return {
|
|
17506
17615
|
degraded: false,
|
|
17507
17616
|
recallId,
|
|
@@ -17509,6 +17618,38 @@ var MemoryContractRuntime = class {
|
|
|
17509
17618
|
memoryIds
|
|
17510
17619
|
};
|
|
17511
17620
|
}
|
|
17621
|
+
recordRecallPreview(query, results) {
|
|
17622
|
+
if (!this.configured().config.debugContent) return;
|
|
17623
|
+
appendAuditEntry(this.services.stateDir, {
|
|
17624
|
+
event: "memory_searched",
|
|
17625
|
+
hook: "getRecall",
|
|
17626
|
+
resultStatus: "ok",
|
|
17627
|
+
decision: "content_preview",
|
|
17628
|
+
details: {
|
|
17629
|
+
queryPreview: debugContentPreview(query, true),
|
|
17630
|
+
topResultPreviews: results.slice(0, 5).map((text) => debugContentPreview(text, true))
|
|
17631
|
+
}
|
|
17632
|
+
});
|
|
17633
|
+
}
|
|
17634
|
+
recordReadUsage(ids, scope, turnId = scope.host?.sessionId ?? scope.session, eventType = "recall") {
|
|
17635
|
+
const outbox = this.services.telemetryUsage;
|
|
17636
|
+
if (!outbox) return;
|
|
17637
|
+
for (const [index, id] of ids.entries()) {
|
|
17638
|
+
const entry = this.services.store.getById(id);
|
|
17639
|
+
if (!entry) continue;
|
|
17640
|
+
outbox.tryAcceptUsage({
|
|
17641
|
+
eventType,
|
|
17642
|
+
factId: entry.factId ?? entry.id,
|
|
17643
|
+
memoryKind: entry.category,
|
|
17644
|
+
projectId: entry.projectId,
|
|
17645
|
+
agentId: this.agentId(scope),
|
|
17646
|
+
sessionUuid: scope.host?.observeSessionUuid ?? scope.session,
|
|
17647
|
+
turnId,
|
|
17648
|
+
retrievalRank: index + 1,
|
|
17649
|
+
metadata: eventType === "inject" ? { injection_surface: "memory_contract" } : { retrieval_rank: index + 1 }
|
|
17650
|
+
});
|
|
17651
|
+
}
|
|
17652
|
+
}
|
|
17512
17653
|
async mutate(op, scope, signal) {
|
|
17513
17654
|
return withMemoryOperation("mutate", signal, async () => {
|
|
17514
17655
|
parseInput("mutate", {
|
|
@@ -17711,43 +17852,45 @@ var MemoryContractRuntime = class {
|
|
|
17711
17852
|
...sumStats(await Promise.all(readable.map((scopeId) => this.services.store.stats(scopeId))))
|
|
17712
17853
|
}
|
|
17713
17854
|
};
|
|
17714
|
-
case "list":
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
op
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
|
|
17726
|
-
case "listReflection": return {
|
|
17727
|
-
degraded: false,
|
|
17728
|
-
result: {
|
|
17729
|
-
op: "listReflection",
|
|
17730
|
-
project,
|
|
17731
|
-
entries: await this.services.store.listReflectionItems({
|
|
17732
|
-
...op,
|
|
17733
|
-
projectIdFilter: readable
|
|
17734
|
-
})
|
|
17735
|
-
}
|
|
17736
|
-
};
|
|
17737
|
-
case "get": {
|
|
17738
|
-
if (op.path) return {
|
|
17855
|
+
case "list":
|
|
17856
|
+
case "listReflection": {
|
|
17857
|
+
const entries = op.op === "list" ? await this.services.store.list({
|
|
17858
|
+
...op,
|
|
17859
|
+
projectIdFilter: readable,
|
|
17860
|
+
importanceMin: op.importanceMin
|
|
17861
|
+
}) : await this.services.store.listReflectionItems({
|
|
17862
|
+
...op,
|
|
17863
|
+
projectIdFilter: readable
|
|
17864
|
+
});
|
|
17865
|
+
this.recordReadUsage(entries.map((entry) => entry.id), scope);
|
|
17866
|
+
return {
|
|
17739
17867
|
degraded: false,
|
|
17740
17868
|
result: {
|
|
17741
|
-
op:
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
relPath: op.path,
|
|
17745
|
-
from: op.from,
|
|
17746
|
-
lines: op.lines
|
|
17747
|
-
})
|
|
17869
|
+
op: op.op,
|
|
17870
|
+
project,
|
|
17871
|
+
entries
|
|
17748
17872
|
}
|
|
17749
17873
|
};
|
|
17874
|
+
}
|
|
17875
|
+
case "get": {
|
|
17876
|
+
if (op.path) {
|
|
17877
|
+
const file = await (await this.provider(scope)).readFile({
|
|
17878
|
+
relPath: op.path,
|
|
17879
|
+
from: op.from,
|
|
17880
|
+
lines: op.lines
|
|
17881
|
+
});
|
|
17882
|
+
this.recordReadUsage([basename(file.path, ".md")], scope);
|
|
17883
|
+
return {
|
|
17884
|
+
degraded: false,
|
|
17885
|
+
result: {
|
|
17886
|
+
op: "get",
|
|
17887
|
+
entry: null,
|
|
17888
|
+
file
|
|
17889
|
+
}
|
|
17890
|
+
};
|
|
17891
|
+
}
|
|
17750
17892
|
const entry = op.id ? this.services.store.getById(op.id) : void 0;
|
|
17893
|
+
if (entry && readable.includes(entry.projectId)) this.recordReadUsage([entry.id], scope);
|
|
17751
17894
|
return {
|
|
17752
17895
|
degraded: false,
|
|
17753
17896
|
result: {
|
|
@@ -17766,6 +17909,7 @@ var MemoryContractRuntime = class {
|
|
|
17766
17909
|
});
|
|
17767
17910
|
const project = await this.project(scope);
|
|
17768
17911
|
const ids = signal.memoryIds.filter((id) => this.services.store.getById(id)?.projectId === project);
|
|
17912
|
+
if (signal.event === "inject") this.recordReadUsage(ids, scope, recallId, "inject");
|
|
17769
17913
|
if (signal.event === "used") {
|
|
17770
17914
|
this.services.accessTracker.recordAccess(ids);
|
|
17771
17915
|
await this.services.accessTracker.flush();
|
|
@@ -19071,6 +19215,7 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19071
19215
|
modelReady = false;
|
|
19072
19216
|
modelPreparationError;
|
|
19073
19217
|
modelPreparation;
|
|
19218
|
+
replayingCaptures = false;
|
|
19074
19219
|
usageOutbox;
|
|
19075
19220
|
constructor(storePath, store, config, settings, observability, embedder) {
|
|
19076
19221
|
this.storePath = storePath;
|
|
@@ -19084,6 +19229,17 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19084
19229
|
dbPath: storePath
|
|
19085
19230
|
});
|
|
19086
19231
|
store.sqlite.exec("CREATE TABLE IF NOT EXISTS pending_captures (id TEXT PRIMARY KEY, skin_id TEXT NOT NULL, request TEXT NOT NULL)");
|
|
19232
|
+
if (!store.sqlite.prepare("PRAGMA table_info(pending_captures)").all().some((column) => column.name === "attempt_count")) store.sqlite.exec("ALTER TABLE pending_captures ADD COLUMN attempt_count INTEGER NOT NULL DEFAULT 0");
|
|
19233
|
+
const { changes: pruned } = store.sqlite.prepare("DELETE FROM pending_captures WHERE id IN (SELECT id FROM pending_captures ORDER BY rowid DESC LIMIT -1 OFFSET 1000)").run();
|
|
19234
|
+
if (pruned) log.warn("Pending capture backlog exceeded capacity; oldest captures removed", {
|
|
19235
|
+
removed_count: pruned,
|
|
19236
|
+
rejection_reason: "capacity"
|
|
19237
|
+
}, {
|
|
19238
|
+
event_name: "memory.sidecar.pending_capture.pruned",
|
|
19239
|
+
file: "packages/memory/src/sidecar/memory-runtime.ts",
|
|
19240
|
+
function: "constructor",
|
|
19241
|
+
site_id: "memory.sidecar.pending_capture.pruned"
|
|
19242
|
+
});
|
|
19087
19243
|
}
|
|
19088
19244
|
async prepareModel() {
|
|
19089
19245
|
try {
|
|
@@ -19106,18 +19262,32 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19106
19262
|
}
|
|
19107
19263
|
}
|
|
19108
19264
|
async replayPendingCaptures() {
|
|
19109
|
-
|
|
19110
|
-
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
|
|
19114
|
-
|
|
19115
|
-
|
|
19116
|
-
|
|
19117
|
-
|
|
19118
|
-
|
|
19119
|
-
|
|
19120
|
-
|
|
19265
|
+
if (this.replayingCaptures) return;
|
|
19266
|
+
this.replayingCaptures = true;
|
|
19267
|
+
try {
|
|
19268
|
+
const rows = this.store.sqlite.prepare("SELECT id, skin_id, request, attempt_count FROM pending_captures WHERE attempt_count < 3 ORDER BY rowid").all();
|
|
19269
|
+
for (const row of rows) {
|
|
19270
|
+
const { changes } = this.store.sqlite.prepare("UPDATE pending_captures SET attempt_count = attempt_count + 1 WHERE id = ? AND attempt_count < 3").run(row.id);
|
|
19271
|
+
if (!changes) continue;
|
|
19272
|
+
try {
|
|
19273
|
+
const result = await this.invoke("capture", JSON.parse(row.request), row.skin_id);
|
|
19274
|
+
if (!result.degraded && "committed" in result && (result.committed || result.skipped || result.partial)) this.store.sqlite.prepare("DELETE FROM pending_captures WHERE id = ?").run(row.id);
|
|
19275
|
+
else throw new Error("Pending capture was not completed");
|
|
19276
|
+
} catch (error) {
|
|
19277
|
+
const parked = row.attempt_count + 1 >= 3;
|
|
19278
|
+
log.error(parked ? "Pending capture parked after three failed attempts" : "Pending capture failed", {
|
|
19279
|
+
error,
|
|
19280
|
+
attempt_count: row.attempt_count + 1
|
|
19281
|
+
}, {
|
|
19282
|
+
event_name: parked ? "memory.sidecar.pending_capture.parked" : "memory.sidecar.pending_capture.failed",
|
|
19283
|
+
file: "packages/memory/src/sidecar/memory-runtime.ts",
|
|
19284
|
+
function: "replayPendingCaptures",
|
|
19285
|
+
site_id: parked ? "memory.sidecar.pending_capture.parked" : "memory.sidecar.pending_capture.failed"
|
|
19286
|
+
});
|
|
19287
|
+
}
|
|
19288
|
+
}
|
|
19289
|
+
} finally {
|
|
19290
|
+
this.replayingCaptures = false;
|
|
19121
19291
|
}
|
|
19122
19292
|
}
|
|
19123
19293
|
static async open() {
|
|
@@ -19189,9 +19359,7 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19189
19359
|
}
|
|
19190
19360
|
};
|
|
19191
19361
|
let entry;
|
|
19192
|
-
const agentPort = new RegisteredAgentPort(registration.model
|
|
19193
|
-
entry.connected = false;
|
|
19194
|
-
});
|
|
19362
|
+
const agentPort = new RegisteredAgentPort(registration.model);
|
|
19195
19363
|
const observability = new PluginObservability(config, this.stateDir, engineLogger, {}, this.settings.telemetry.redactionRules);
|
|
19196
19364
|
const embedder = new ObservableEmbedder(config.embedding, this.stateDir, observability, observeSessionUuid);
|
|
19197
19365
|
const retriever = new ObservableMemoryRetriever(this.store, embedder, engineLogger, {
|
|
@@ -19335,6 +19503,18 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19335
19503
|
const request = JSON.stringify(capture);
|
|
19336
19504
|
const existing = this.store.sqlite.prepare("SELECT request FROM pending_captures WHERE id = ?").get(id);
|
|
19337
19505
|
if (existing && existing.request !== request) throw new Error("Pending capture identity reused with different content");
|
|
19506
|
+
if (!existing) {
|
|
19507
|
+
const { count } = this.store.sqlite.prepare("SELECT COUNT(*) AS count FROM pending_captures").get();
|
|
19508
|
+
const removed = count >= 1e3 ? this.store.sqlite.prepare("DELETE FROM pending_captures WHERE rowid = (SELECT rowid FROM pending_captures WHERE attempt_count >= 3 ORDER BY rowid LIMIT 1)").run() : void 0;
|
|
19509
|
+
if (count >= 1e3 && !removed?.changes) return {
|
|
19510
|
+
degraded: true,
|
|
19511
|
+
reason: "engine-failed",
|
|
19512
|
+
error: "Pending capture capacity exhausted",
|
|
19513
|
+
turnId: capture.turn.turnId,
|
|
19514
|
+
committed: false,
|
|
19515
|
+
accepted: false
|
|
19516
|
+
};
|
|
19517
|
+
}
|
|
19338
19518
|
this.store.sqlite.prepare("INSERT OR IGNORE INTO pending_captures (id, skin_id, request) VALUES (?, ?, ?)").run(id, skinId, request);
|
|
19339
19519
|
return {
|
|
19340
19520
|
degraded: false,
|
|
@@ -19409,6 +19589,12 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19409
19589
|
entry
|
|
19410
19590
|
}, () => withProviderResponses(responses, () => this.call(entry, method, body, signal)));
|
|
19411
19591
|
const result = parseOutput(method, await entry.agentPort.run(call, method === "capture"));
|
|
19592
|
+
if (method === "capture" && !result.degraded && "committed" in result && (result.committed || result.skipped || result.partial)) this.replayPendingCaptures().catch((error) => log.error("Pending capture failed", { error }, {
|
|
19593
|
+
event_name: "memory.sidecar.pending_capture.failed",
|
|
19594
|
+
file: "packages/memory/src/sidecar/memory-runtime.ts",
|
|
19595
|
+
function: "invoke",
|
|
19596
|
+
site_id: "memory.sidecar.pending_capture.replay.failed"
|
|
19597
|
+
}));
|
|
19412
19598
|
if (method === "onSessionEnd") {
|
|
19413
19599
|
await this.emitProviderUsage(entry, scope, responses.splice(0));
|
|
19414
19600
|
await this.snapshot(entry, "session_end", uuid);
|
|
@@ -19530,8 +19716,6 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19530
19716
|
eventType: "llm.call",
|
|
19531
19717
|
sessionUuid: scope.host?.observeSessionUuid,
|
|
19532
19718
|
payload: {
|
|
19533
|
-
call_id: response.callId,
|
|
19534
|
-
destination: response.destination,
|
|
19535
19719
|
model: `${response.provider}:${response.model}`,
|
|
19536
19720
|
prompt_tokens: response.usage.inputTokens,
|
|
19537
19721
|
completion_tokens: response.usage.outputTokens,
|
|
@@ -19551,6 +19735,7 @@ var MemoryRuntimePool = class MemoryRuntimePool {
|
|
|
19551
19735
|
/** The local memory event rows written since the last sync go up as `memory.telemetry` batches. */
|
|
19552
19736
|
async forwardTelemetry(entry, sessionUuid) {
|
|
19553
19737
|
await entry.observability.trackBestEffort("memory telemetry", async () => {
|
|
19738
|
+
await this.usageOutbox.flushPendingAsync();
|
|
19554
19739
|
if ((await forwardMemoryTelemetryToObserve({
|
|
19555
19740
|
sqlite: this.store.sqlite,
|
|
19556
19741
|
observe: { tryEmit: (input) => entry.observability.tryEmit({
|