@psiclawops/hypermem 0.9.1 → 0.9.3
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/CHANGELOG.md +8 -1
- package/INSTALL.md +11 -2
- package/README.md +24 -24
- package/dist/adaptive-lifecycle.d.ts +81 -0
- package/dist/adaptive-lifecycle.d.ts.map +1 -0
- package/dist/adaptive-lifecycle.js +190 -0
- package/dist/background-indexer.d.ts +161 -0
- package/dist/background-indexer.d.ts.map +1 -0
- package/dist/background-indexer.js +1263 -0
- package/dist/budget-policy.d.ts +22 -0
- package/dist/budget-policy.d.ts.map +1 -0
- package/dist/budget-policy.js +32 -0
- package/dist/cache.d.ts +148 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +571 -0
- package/dist/compaction-fence.d.ts +97 -0
- package/dist/compaction-fence.d.ts.map +1 -0
- package/dist/compaction-fence.js +174 -0
- package/dist/composition-snapshot-integrity.d.ts +36 -0
- package/dist/composition-snapshot-integrity.d.ts.map +1 -0
- package/dist/composition-snapshot-integrity.js +131 -0
- package/dist/composition-snapshot-runtime.d.ts +59 -0
- package/dist/composition-snapshot-runtime.d.ts.map +1 -0
- package/dist/composition-snapshot-runtime.js +250 -0
- package/dist/composition-snapshot-store.d.ts +44 -0
- package/dist/composition-snapshot-store.d.ts.map +1 -0
- package/dist/composition-snapshot-store.js +117 -0
- package/dist/compositor.d.ts +518 -0
- package/dist/compositor.d.ts.map +1 -0
- package/dist/compositor.js +4280 -0
- package/dist/content-type-classifier.d.ts +41 -0
- package/dist/content-type-classifier.d.ts.map +1 -0
- package/dist/content-type-classifier.js +181 -0
- package/dist/context-backfill.d.ts +46 -0
- package/dist/context-backfill.d.ts.map +1 -0
- package/dist/context-backfill.js +113 -0
- package/dist/context-store.d.ts +131 -0
- package/dist/context-store.d.ts.map +1 -0
- package/dist/context-store.js +279 -0
- package/dist/contradiction-audit-store.d.ts +54 -0
- package/dist/contradiction-audit-store.d.ts.map +1 -0
- package/dist/contradiction-audit-store.js +88 -0
- package/dist/contradiction-detector.d.ts +78 -0
- package/dist/contradiction-detector.d.ts.map +1 -0
- package/dist/contradiction-detector.js +362 -0
- package/dist/contradiction-resolution-policy.d.ts +21 -0
- package/dist/contradiction-resolution-policy.d.ts.map +1 -0
- package/dist/contradiction-resolution-policy.js +17 -0
- package/dist/cross-agent.d.ts +74 -0
- package/dist/cross-agent.d.ts.map +1 -0
- package/dist/cross-agent.js +271 -0
- package/dist/db.d.ts +131 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +410 -0
- package/dist/degradation.d.ts +102 -0
- package/dist/degradation.d.ts.map +1 -0
- package/dist/degradation.js +141 -0
- package/dist/desired-state-store.d.ts +100 -0
- package/dist/desired-state-store.d.ts.map +1 -0
- package/dist/desired-state-store.js +222 -0
- package/dist/doc-chunk-store.d.ts +159 -0
- package/dist/doc-chunk-store.d.ts.map +1 -0
- package/dist/doc-chunk-store.js +441 -0
- package/dist/doc-chunker.d.ts +99 -0
- package/dist/doc-chunker.d.ts.map +1 -0
- package/dist/doc-chunker.js +324 -0
- package/dist/dreaming-promoter.d.ts +124 -0
- package/dist/dreaming-promoter.d.ts.map +1 -0
- package/dist/dreaming-promoter.js +447 -0
- package/dist/episode-store.d.ts +49 -0
- package/dist/episode-store.d.ts.map +1 -0
- package/dist/episode-store.js +135 -0
- package/dist/expertise-store.d.ts +129 -0
- package/dist/expertise-store.d.ts.map +1 -0
- package/dist/expertise-store.js +342 -0
- package/dist/fact-store.d.ts +90 -0
- package/dist/fact-store.d.ts.map +1 -0
- package/dist/fact-store.js +283 -0
- package/dist/fleet-store.d.ts +144 -0
- package/dist/fleet-store.d.ts.map +1 -0
- package/dist/fleet-store.js +276 -0
- package/dist/fos-mod.d.ts +178 -0
- package/dist/fos-mod.d.ts.map +1 -0
- package/dist/fos-mod.js +416 -0
- package/dist/hybrid-retrieval.d.ts +102 -0
- package/dist/hybrid-retrieval.d.ts.map +1 -0
- package/dist/hybrid-retrieval.js +429 -0
- package/dist/image-eviction.d.ts +49 -0
- package/dist/image-eviction.d.ts.map +1 -0
- package/dist/image-eviction.js +251 -0
- package/dist/index.d.ts +735 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1542 -0
- package/dist/keystone-scorer.d.ts +51 -0
- package/dist/keystone-scorer.d.ts.map +1 -0
- package/dist/keystone-scorer.js +52 -0
- package/dist/knowledge-graph.d.ts +110 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +305 -0
- package/dist/knowledge-lint.d.ts +31 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +155 -0
- package/dist/knowledge-store.d.ts +75 -0
- package/dist/knowledge-store.d.ts.map +1 -0
- package/dist/knowledge-store.js +270 -0
- package/dist/library-schema.d.ts +31 -0
- package/dist/library-schema.d.ts.map +1 -0
- package/dist/library-schema.js +1357 -0
- package/dist/message-store.d.ts +181 -0
- package/dist/message-store.d.ts.map +1 -0
- package/dist/message-store.js +577 -0
- package/dist/metrics-dashboard.d.ts +131 -0
- package/dist/metrics-dashboard.d.ts.map +1 -0
- package/dist/metrics-dashboard.js +298 -0
- package/dist/obsidian-exporter.d.ts +57 -0
- package/dist/obsidian-exporter.d.ts.map +1 -0
- package/dist/obsidian-exporter.js +274 -0
- package/dist/obsidian-watcher.d.ts +147 -0
- package/dist/obsidian-watcher.d.ts.map +1 -0
- package/dist/obsidian-watcher.js +403 -0
- package/dist/open-domain.d.ts +46 -0
- package/dist/open-domain.d.ts.map +1 -0
- package/dist/open-domain.js +125 -0
- package/dist/preference-store.d.ts +54 -0
- package/dist/preference-store.d.ts.map +1 -0
- package/dist/preference-store.js +109 -0
- package/dist/preservation-gate.d.ts +82 -0
- package/dist/preservation-gate.d.ts.map +1 -0
- package/dist/preservation-gate.js +150 -0
- package/dist/proactive-pass.d.ts +63 -0
- package/dist/proactive-pass.d.ts.map +1 -0
- package/dist/proactive-pass.js +293 -0
- package/dist/profiles.d.ts +46 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +262 -0
- package/dist/provider-translator.d.ts +50 -0
- package/dist/provider-translator.d.ts.map +1 -0
- package/dist/provider-translator.js +403 -0
- package/dist/rate-limiter.d.ts +76 -0
- package/dist/rate-limiter.d.ts.map +1 -0
- package/dist/rate-limiter.js +179 -0
- package/dist/repair-tool-pairs.d.ts +38 -0
- package/dist/repair-tool-pairs.d.ts.map +1 -0
- package/dist/repair-tool-pairs.js +209 -0
- package/dist/replay-recovery.d.ts +29 -0
- package/dist/replay-recovery.d.ts.map +1 -0
- package/dist/replay-recovery.js +82 -0
- package/dist/reranker.d.ts +95 -0
- package/dist/reranker.d.ts.map +1 -0
- package/dist/reranker.js +308 -0
- package/dist/retrieval-policy.d.ts +51 -0
- package/dist/retrieval-policy.d.ts.map +1 -0
- package/dist/retrieval-policy.js +77 -0
- package/dist/schema.d.ts +15 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +327 -0
- package/dist/secret-scanner.d.ts +51 -0
- package/dist/secret-scanner.d.ts.map +1 -0
- package/dist/secret-scanner.js +248 -0
- package/dist/seed.d.ts +108 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +179 -0
- package/dist/session-flusher.d.ts +53 -0
- package/dist/session-flusher.d.ts.map +1 -0
- package/dist/session-flusher.js +69 -0
- package/dist/session-topic-map.d.ts +41 -0
- package/dist/session-topic-map.d.ts.map +1 -0
- package/dist/session-topic-map.js +77 -0
- package/dist/spawn-context.d.ts +54 -0
- package/dist/spawn-context.d.ts.map +1 -0
- package/dist/spawn-context.js +159 -0
- package/dist/system-store.d.ts +73 -0
- package/dist/system-store.d.ts.map +1 -0
- package/dist/system-store.js +182 -0
- package/dist/temporal-store.d.ts +81 -0
- package/dist/temporal-store.d.ts.map +1 -0
- package/dist/temporal-store.js +149 -0
- package/dist/tool-artifact-store.d.ts +98 -0
- package/dist/tool-artifact-store.d.ts.map +1 -0
- package/dist/tool-artifact-store.js +244 -0
- package/dist/topic-detector.d.ts +35 -0
- package/dist/topic-detector.d.ts.map +1 -0
- package/dist/topic-detector.js +249 -0
- package/dist/topic-store.d.ts +51 -0
- package/dist/topic-store.d.ts.map +1 -0
- package/dist/topic-store.js +175 -0
- package/dist/topic-synthesizer.d.ts +71 -0
- package/dist/topic-synthesizer.d.ts.map +1 -0
- package/dist/topic-synthesizer.js +426 -0
- package/dist/trigger-registry.d.ts +63 -0
- package/dist/trigger-registry.d.ts.map +1 -0
- package/dist/trigger-registry.js +171 -0
- package/dist/types.d.ts +1085 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/vector-store.d.ts +180 -0
- package/dist/vector-store.d.ts.map +1 -0
- package/dist/vector-store.js +1041 -0
- package/dist/version.d.ts +34 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +44 -0
- package/dist/wiki-page-emitter.d.ts +65 -0
- package/dist/wiki-page-emitter.d.ts.map +1 -0
- package/dist/wiki-page-emitter.js +258 -0
- package/dist/work-store.d.ts +112 -0
- package/dist/work-store.d.ts.map +1 -0
- package/dist/work-store.js +273 -0
- package/docs/MEMORY_MD_AUTHORING.md +3 -3
- package/docs/ROADMAP.md +2 -2
- package/install.sh +34 -0
- package/memory-plugin/dist/index.d.ts +24 -0
- package/memory-plugin/dist/index.js +378 -0
- package/memory-plugin/package.json +4 -2
- package/node_modules/sqlite-vec/README.md +1 -0
- package/node_modules/sqlite-vec/index.cjs +46 -0
- package/node_modules/sqlite-vec/index.d.ts +17 -0
- package/node_modules/sqlite-vec/index.mjs +47 -0
- package/node_modules/sqlite-vec/package.json +1 -0
- package/node_modules/sqlite-vec-linux-x64/README.md +1 -0
- package/node_modules/sqlite-vec-linux-x64/package.json +1 -0
- package/node_modules/sqlite-vec-linux-x64/vec0.so +0 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +6 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +6 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +51 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +643 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2409 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +276 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +562 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +365 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +661 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +595 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +734 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +270 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +640 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +223 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +427 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +282 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +632 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +582 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +570 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1175 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2990 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +361 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +183 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +219 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1798 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +138 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +448 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +667 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +183 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4538 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +83 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +67 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +613 -0
- package/node_modules/zod/src/v4/core/util.ts +966 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/en.ts +119 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +116 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +49 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +116 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1916 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +529 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +963 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +347 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +6 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +15 -0
- package/node_modules/zod/v4/classic/external.d.ts +15 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +610 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +584 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +6 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1272 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +739 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +739 -0
- package/node_modules/zod/v4/classic/schemas.js +1157 -0
- package/node_modules/zod/v4/core/api.cjs +1222 -0
- package/node_modules/zod/v4/core/api.d.cts +304 -0
- package/node_modules/zod/v4/core/api.d.ts +304 -0
- package/node_modules/zod/v4/core/api.js +1082 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +83 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +76 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +213 -0
- package/node_modules/zod/v4/core/errors.d.cts +220 -0
- package/node_modules/zod/v4/core/errors.d.ts +220 -0
- package/node_modules/zod/v4/core/errors.js +182 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +648 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +605 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +6 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +166 -0
- package/node_modules/zod/v4/core/regexes.d.cts +79 -0
- package/node_modules/zod/v4/core/regexes.d.ts +79 -0
- package/node_modules/zod/v4/core/regexes.js +133 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2124 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1146 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1146 -0
- package/node_modules/zod/v4/core/schemas.js +2093 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +446 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +437 -0
- package/node_modules/zod/v4/core/util.cjs +710 -0
- package/node_modules/zod/v4/core/util.d.cts +199 -0
- package/node_modules/zod/v4/core/util.d.ts +199 -0
- package/node_modules/zod/v4/core/util.js +651 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/en.cjs +136 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +109 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +135 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +108 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +104 -0
- package/node_modules/zod/v4/locales/index.d.cts +49 -0
- package/node_modules/zod/v4/locales/index.d.ts +49 -0
- package/node_modules/zod/v4/locales/index.js +49 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +6 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +136 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +109 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +12 -0
- package/node_modules/zod/v4/mini/external.d.ts +12 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +6 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1046 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +427 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +427 -0
- package/node_modules/zod/v4/mini/schemas.js +925 -0
- package/node_modules/zod/v4/package.json +6 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +6 -0
- package/package.json +5 -2
- package/plugin/dist/index.d.ts +208 -0
- package/plugin/dist/index.d.ts.map +1 -0
- package/plugin/dist/index.js +3474 -0
- package/plugin/dist/index.js.map +1 -0
- package/plugin/package.json +4 -2
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hypermem Proactive Passes
|
|
3
|
+
*
|
|
4
|
+
* Background maintenance passes that run between indexer ticks to keep
|
|
5
|
+
* message storage lean. Two passes:
|
|
6
|
+
*
|
|
7
|
+
* 1. Noise Sweep — deletes low/zero-signal messages outside the recent
|
|
8
|
+
* window (heartbeats, acks, empty strings, control tokens).
|
|
9
|
+
*
|
|
10
|
+
* 2. Tool Decay — truncates oversized tool_results outside the recent
|
|
11
|
+
* window in-place, preserving JSON structure but collapsing large
|
|
12
|
+
* content blobs into a byte-count placeholder.
|
|
13
|
+
*
|
|
14
|
+
* Both passes are:
|
|
15
|
+
* - Synchronous (DatabaseSync, no async)
|
|
16
|
+
* - Wrapped in transactions (atomic)
|
|
17
|
+
* - Best-effort: catch all errors, log, and return a zero-change result
|
|
18
|
+
*
|
|
19
|
+
* Ported and adapted from ClawText proactive-pass.ts.
|
|
20
|
+
* hypermem schema differences vs ClawText:
|
|
21
|
+
* - No content_type column — we classify on the fly via classifyContentType()
|
|
22
|
+
* - No external payload store — we truncate content inline in tool_results JSON
|
|
23
|
+
* - No ClawText-specific dependencies (payload-store, tool-tracker, etc.)
|
|
24
|
+
*/
|
|
25
|
+
import { classifyContentType } from './content-type-classifier.js';
|
|
26
|
+
// ─── Internal helpers ────────────────────────────────────────────
|
|
27
|
+
/**
|
|
28
|
+
* Resolve the safe window to a finite positive integer.
|
|
29
|
+
* Mirrors the ClawText resolveSafeWindow() guard.
|
|
30
|
+
*/
|
|
31
|
+
function resolveSafeWindow(recentWindowSize) {
|
|
32
|
+
if (Number.isFinite(recentWindowSize) && recentWindowSize > 0) {
|
|
33
|
+
return Math.floor(recentWindowSize);
|
|
34
|
+
}
|
|
35
|
+
return 20;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the maximum message_index for a conversation.
|
|
39
|
+
* Returns -1 if no messages exist.
|
|
40
|
+
*/
|
|
41
|
+
function getMaxMessageIndex(db, conversationId) {
|
|
42
|
+
const row = db
|
|
43
|
+
.prepare('SELECT COALESCE(MAX(message_index), -1) AS max_index FROM messages WHERE conversation_id = ?')
|
|
44
|
+
.get(conversationId);
|
|
45
|
+
return typeof row.max_index === 'number' ? row.max_index : -1;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Filter candidate message ids down to rows that are safe to delete without
|
|
49
|
+
* violating HyperMem's FK edges.
|
|
50
|
+
*
|
|
51
|
+
* Current blockers:
|
|
52
|
+
* - summary_messages.message_id -> messages.id
|
|
53
|
+
* - messages.parent_id -> messages.id (child rows point at parent rows)
|
|
54
|
+
*/
|
|
55
|
+
function getDeletableMessageIds(db, candidateIds) {
|
|
56
|
+
if (candidateIds.length === 0)
|
|
57
|
+
return { deletableIds: [], blockedIds: [] };
|
|
58
|
+
const placeholders = candidateIds.map(() => '?').join(', ');
|
|
59
|
+
const blocked = db
|
|
60
|
+
.prepare(`
|
|
61
|
+
SELECT DISTINCT id
|
|
62
|
+
FROM (
|
|
63
|
+
SELECT sm.message_id AS id
|
|
64
|
+
FROM summary_messages sm
|
|
65
|
+
WHERE sm.message_id IN (${placeholders})
|
|
66
|
+
|
|
67
|
+
UNION
|
|
68
|
+
|
|
69
|
+
SELECT parent.id AS id
|
|
70
|
+
FROM messages child
|
|
71
|
+
JOIN messages parent ON parent.id = child.parent_id
|
|
72
|
+
WHERE child.parent_id IN (${placeholders})
|
|
73
|
+
) blocked
|
|
74
|
+
`)
|
|
75
|
+
.all(...candidateIds, ...candidateIds);
|
|
76
|
+
if (blocked.length === 0)
|
|
77
|
+
return { deletableIds: candidateIds, blockedIds: [] };
|
|
78
|
+
const blockedIds = blocked.map(row => row.id);
|
|
79
|
+
const blockedSet = new Set(blockedIds);
|
|
80
|
+
return {
|
|
81
|
+
deletableIds: candidateIds.filter(id => !blockedSet.has(id)),
|
|
82
|
+
blockedIds,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Decide if a message is noise based on content + is_heartbeat flag.
|
|
87
|
+
*
|
|
88
|
+
* A message is noise when:
|
|
89
|
+
* - is_heartbeat = 1 (explicit heartbeat marker), OR
|
|
90
|
+
* - text_content is NULL or empty (≤3 chars after trimming), OR
|
|
91
|
+
* - classifyContentType() returns 'noise' or 'ack'
|
|
92
|
+
*
|
|
93
|
+
* We call the classifier rather than duplicating its patterns here.
|
|
94
|
+
*/
|
|
95
|
+
function isNoiseMessage(textContent, isHeartbeat) {
|
|
96
|
+
if (isHeartbeat === 1)
|
|
97
|
+
return true;
|
|
98
|
+
if (textContent === null || textContent.trim().length <= 3)
|
|
99
|
+
return true;
|
|
100
|
+
const { type } = classifyContentType(textContent);
|
|
101
|
+
return type === 'noise' || type === 'ack';
|
|
102
|
+
}
|
|
103
|
+
// ─── Noise Sweep ─────────────────────────────────────────────────
|
|
104
|
+
/**
|
|
105
|
+
* Delete noise and heartbeat messages outside the recent window.
|
|
106
|
+
*
|
|
107
|
+
* "Outside the recent window" means message_index < maxIndex - recentWindowSize.
|
|
108
|
+
* Messages inside the window are never deleted, even if they are noise —
|
|
109
|
+
* the model may still reference them in the current turn.
|
|
110
|
+
*
|
|
111
|
+
* Deletions are wrapped in a single transaction. The FTS5 trigger handles
|
|
112
|
+
* index cleanup automatically (msg_fts_ad fires on DELETE).
|
|
113
|
+
*/
|
|
114
|
+
export function runNoiseSweep(db, conversationId, recentWindowSize = 20, maxCandidates = Infinity) {
|
|
115
|
+
const ZERO = { messagesDeleted: 0, passType: 'noise_sweep' };
|
|
116
|
+
try {
|
|
117
|
+
const safeWindow = resolveSafeWindow(recentWindowSize);
|
|
118
|
+
const maxIndex = getMaxMessageIndex(db, conversationId);
|
|
119
|
+
if (maxIndex < 0)
|
|
120
|
+
return ZERO;
|
|
121
|
+
// Messages with message_index strictly below this value are eligible.
|
|
122
|
+
const cutoff = maxIndex - safeWindow;
|
|
123
|
+
if (cutoff <= 0)
|
|
124
|
+
return ZERO; // Not enough history yet
|
|
125
|
+
// Fetch all candidate messages outside the recent window.
|
|
126
|
+
// Exclude messages whose content lives entirely in tool_results — those
|
|
127
|
+
// are tool result rows handled by runToolDecay(), not noise sweep.
|
|
128
|
+
// We deliberately avoid a content-based WHERE clause for the classifier
|
|
129
|
+
// because SQLite can't use the index for JS classification logic;
|
|
130
|
+
// it's cheaper to fetch a small batch and classify in JS.
|
|
131
|
+
const candidates = db
|
|
132
|
+
.prepare(`
|
|
133
|
+
SELECT id, text_content, is_heartbeat
|
|
134
|
+
FROM messages
|
|
135
|
+
WHERE conversation_id = ?
|
|
136
|
+
AND message_index < ?
|
|
137
|
+
AND (tool_results IS NULL OR tool_results = '')
|
|
138
|
+
`)
|
|
139
|
+
.all(conversationId, cutoff);
|
|
140
|
+
if (candidates.length === 0)
|
|
141
|
+
return ZERO;
|
|
142
|
+
// Filter to noise messages, respecting per-pass candidate cap
|
|
143
|
+
const toDelete = candidates.filter(row => isNoiseMessage(row.text_content, row.is_heartbeat)).slice(0, Number.isFinite(maxCandidates) ? maxCandidates : undefined);
|
|
144
|
+
if (toDelete.length === 0) {
|
|
145
|
+
return ZERO;
|
|
146
|
+
}
|
|
147
|
+
const candidateIds = toDelete.map(r => r.id);
|
|
148
|
+
const { deletableIds: ids, blockedIds } = getDeletableMessageIds(db, candidateIds);
|
|
149
|
+
if (ids.length === 0) {
|
|
150
|
+
return ZERO;
|
|
151
|
+
}
|
|
152
|
+
// Delete in a transaction; use chunked IN clauses to avoid
|
|
153
|
+
// SQLite's SQLITE_LIMIT_VARIABLE_NUMBER (default 999).
|
|
154
|
+
let totalDeleted = 0;
|
|
155
|
+
const CHUNK = 500;
|
|
156
|
+
db.prepare('BEGIN').run();
|
|
157
|
+
try {
|
|
158
|
+
for (let i = 0; i < ids.length; i += CHUNK) {
|
|
159
|
+
const chunk = ids.slice(i, i + CHUNK);
|
|
160
|
+
const placeholders = chunk.map(() => '?').join(', ');
|
|
161
|
+
const result = db
|
|
162
|
+
.prepare(`DELETE FROM messages WHERE id IN (${placeholders})`)
|
|
163
|
+
.run(...chunk);
|
|
164
|
+
totalDeleted += typeof result.changes === 'number' ? result.changes : chunk.length;
|
|
165
|
+
}
|
|
166
|
+
db.prepare('COMMIT').run();
|
|
167
|
+
}
|
|
168
|
+
catch (innerErr) {
|
|
169
|
+
db.prepare('ROLLBACK').run();
|
|
170
|
+
throw innerErr;
|
|
171
|
+
}
|
|
172
|
+
if (totalDeleted > 0) {
|
|
173
|
+
console.log(`[proactive-pass] Noise sweep conversation=${conversationId} candidates=${candidates.length} noise=${candidateIds.length} deleted=${totalDeleted} skippedReferenced=${blockedIds.length} cutoff=${cutoff}`);
|
|
174
|
+
}
|
|
175
|
+
return { messagesDeleted: totalDeleted, passType: 'noise_sweep' };
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
console.warn(`[proactive-pass] Noise sweep failed for conversation ${conversationId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
179
|
+
return ZERO;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// ─── Tool Decay ──────────────────────────────────────────────────
|
|
183
|
+
/**
|
|
184
|
+
* Truncate oversized tool_results outside the recent window.
|
|
185
|
+
*
|
|
186
|
+
* Strategy:
|
|
187
|
+
* 1. Find messages whose tool_results JSON string is > 2000 chars total,
|
|
188
|
+
* outside the recent window.
|
|
189
|
+
* 2. Parse the JSON array.
|
|
190
|
+
* 3. For each result entry where the `content` field exceeds 500 chars,
|
|
191
|
+
* replace `content` with `[tool result truncated — N bytes]`.
|
|
192
|
+
* 4. Re-serialize and write back.
|
|
193
|
+
*
|
|
194
|
+
* The JSON structure is preserved (array of result objects). Only the
|
|
195
|
+
* oversized `content` values are collapsed.
|
|
196
|
+
*
|
|
197
|
+
* Mutations are committed in a single transaction.
|
|
198
|
+
*/
|
|
199
|
+
export function runToolDecay(db, conversationId, recentWindowSize = 40, maxCandidates = Infinity) {
|
|
200
|
+
const ZERO = { messagesUpdated: 0, bytesFreed: 0, passType: 'tool_decay' };
|
|
201
|
+
try {
|
|
202
|
+
const safeWindow = resolveSafeWindow(recentWindowSize);
|
|
203
|
+
const maxIndex = getMaxMessageIndex(db, conversationId);
|
|
204
|
+
if (maxIndex < 0) {
|
|
205
|
+
return ZERO;
|
|
206
|
+
}
|
|
207
|
+
const cutoff = maxIndex - safeWindow;
|
|
208
|
+
if (cutoff <= 0) {
|
|
209
|
+
return ZERO;
|
|
210
|
+
}
|
|
211
|
+
// Fetch messages with large tool_results outside the recent window.
|
|
212
|
+
const candidates = db
|
|
213
|
+
.prepare(`
|
|
214
|
+
SELECT id, tool_results
|
|
215
|
+
FROM messages
|
|
216
|
+
WHERE conversation_id = ?
|
|
217
|
+
AND message_index < ?
|
|
218
|
+
AND tool_results IS NOT NULL
|
|
219
|
+
AND length(tool_results) > 2000
|
|
220
|
+
`)
|
|
221
|
+
.all(conversationId, cutoff);
|
|
222
|
+
if (candidates.length === 0) {
|
|
223
|
+
return ZERO;
|
|
224
|
+
}
|
|
225
|
+
// Build the update list by processing each candidate, respecting per-pass cap.
|
|
226
|
+
const cappedCandidates = Number.isFinite(maxCandidates) ? candidates.slice(0, maxCandidates) : candidates;
|
|
227
|
+
const updates = [];
|
|
228
|
+
for (const row of cappedCandidates) {
|
|
229
|
+
let parsed;
|
|
230
|
+
try {
|
|
231
|
+
parsed = JSON.parse(row.tool_results);
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
// Corrupt JSON — skip this row
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (!Array.isArray(parsed))
|
|
238
|
+
continue;
|
|
239
|
+
let changed = false;
|
|
240
|
+
const newResults = parsed.map(entry => {
|
|
241
|
+
const content = entry.content;
|
|
242
|
+
if (typeof content === 'string' && content.length > 500) {
|
|
243
|
+
const originalBytes = Buffer.byteLength(content, 'utf8');
|
|
244
|
+
changed = true;
|
|
245
|
+
return {
|
|
246
|
+
...entry,
|
|
247
|
+
content: `[tool result truncated — ${originalBytes} bytes]`,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return entry;
|
|
251
|
+
});
|
|
252
|
+
if (!changed)
|
|
253
|
+
continue;
|
|
254
|
+
const newJson = JSON.stringify(newResults);
|
|
255
|
+
const savedBytes = row.tool_results.length - newJson.length;
|
|
256
|
+
if (savedBytes > 0) {
|
|
257
|
+
updates.push({ id: row.id, newJson, savedBytes });
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (updates.length === 0) {
|
|
261
|
+
return ZERO;
|
|
262
|
+
}
|
|
263
|
+
let totalUpdated = 0;
|
|
264
|
+
let totalBytesFreed = 0;
|
|
265
|
+
db.prepare('BEGIN').run();
|
|
266
|
+
try {
|
|
267
|
+
const stmt = db.prepare('UPDATE messages SET tool_results = ? WHERE id = ?');
|
|
268
|
+
for (const { id, newJson, savedBytes } of updates) {
|
|
269
|
+
stmt.run(newJson, id);
|
|
270
|
+
totalUpdated++;
|
|
271
|
+
totalBytesFreed += savedBytes;
|
|
272
|
+
}
|
|
273
|
+
db.prepare('COMMIT').run();
|
|
274
|
+
}
|
|
275
|
+
catch (innerErr) {
|
|
276
|
+
db.prepare('ROLLBACK').run();
|
|
277
|
+
throw innerErr;
|
|
278
|
+
}
|
|
279
|
+
if (totalUpdated > 0) {
|
|
280
|
+
console.log(`[proactive-pass] Tool decay conversation=${conversationId} candidates=${candidates.length} updated=${totalUpdated} bytesFreed=${totalBytesFreed} cutoff=${cutoff}`);
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
messagesUpdated: totalUpdated,
|
|
284
|
+
bytesFreed: totalBytesFreed,
|
|
285
|
+
passType: 'tool_decay',
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
catch (err) {
|
|
289
|
+
console.warn(`[proactive-pass] Tool decay failed for conversation ${conversationId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
290
|
+
return ZERO;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=proactive-pass.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hypermem configuration profiles
|
|
3
|
+
*
|
|
4
|
+
* Pre-built configs for common deployment patterns. Pass to createHyperMem()
|
|
5
|
+
* directly or use as a base for custom configs via mergeProfile().
|
|
6
|
+
*
|
|
7
|
+
* Profiles:
|
|
8
|
+
* minimal — 64k context, single agent, low resource usage
|
|
9
|
+
* standard — 128k context, fleet default, balanced
|
|
10
|
+
* rich — 200k+ context, multi-agent, full feature set
|
|
11
|
+
*/
|
|
12
|
+
import type { HyperMemConfig, EmbeddingProviderConfig } from './types.js';
|
|
13
|
+
/** Gemini embedding preset — use with mergeProfile() when switching fleet to Gemini. */
|
|
14
|
+
export declare const GEMINI_EMBEDDING: Partial<EmbeddingProviderConfig>;
|
|
15
|
+
export declare const lightProfile: HyperMemConfig;
|
|
16
|
+
export declare const standardProfile: HyperMemConfig;
|
|
17
|
+
export declare const fullProfile: HyperMemConfig;
|
|
18
|
+
export type ProfileName = 'light' | 'standard' | 'full';
|
|
19
|
+
export declare const minimalProfile: HyperMemConfig;
|
|
20
|
+
export declare const extendedProfile: HyperMemConfig;
|
|
21
|
+
export declare const richProfile: HyperMemConfig;
|
|
22
|
+
export declare const PROFILES: Record<ProfileName, HyperMemConfig>;
|
|
23
|
+
/**
|
|
24
|
+
* Load a named profile.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const config = getProfile('light');
|
|
28
|
+
* const hm = createHyperMem(config);
|
|
29
|
+
*/
|
|
30
|
+
export declare function getProfile(name: ProfileName | 'extended'): HyperMemConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Merge a partial config on top of a named profile.
|
|
33
|
+
* Deep-merges compositor and indexer; top-level fields are replaced.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const config = mergeProfile('light', {
|
|
37
|
+
* cache: { keyPrefix: 'myapp:' },
|
|
38
|
+
* compositor: { hyperformProfile: 'standard', memoryFraction: 0.50 }, // upgrade tier + more memory
|
|
39
|
+
* });
|
|
40
|
+
*/
|
|
41
|
+
export declare function mergeProfile(name: ProfileName | 'extended', overrides: DeepPartial<HyperMemConfig>): HyperMemConfig;
|
|
42
|
+
type DeepPartial<T> = {
|
|
43
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAmC,uBAAuB,EAAe,MAAM,YAAY,CAAC;AAoBxH,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,uBAAuB,CAM7D,CAAC;AAwDF,eAAO,MAAM,YAAY,EAAE,cAa1B,CAAC;AAsDF,eAAO,MAAM,eAAe,EAAE,cAO7B,CAAC;AAuDF,eAAO,MAAM,WAAW,EAAE,cAWzB,CAAC;AAMF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAGxD,eAAO,MAAM,cAAc,gBAAe,CAAC;AAC3C,eAAO,MAAM,eAAe,gBAAc,CAAC;AAC3C,eAAO,MAAM,WAAW,gBAAc,CAAC;AAEvC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CAIxD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,CAIzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,GAAG,UAAU,EAC9B,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,GACrC,cAAc,CAUhB;AAMD,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
|
package/dist/profiles.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hypermem configuration profiles
|
|
3
|
+
*
|
|
4
|
+
* Pre-built configs for common deployment patterns. Pass to createHyperMem()
|
|
5
|
+
* directly or use as a base for custom configs via mergeProfile().
|
|
6
|
+
*
|
|
7
|
+
* Profiles:
|
|
8
|
+
* minimal — 64k context, single agent, low resource usage
|
|
9
|
+
* standard — 128k context, fleet default, balanced
|
|
10
|
+
* rich — 200k+ context, multi-agent, full feature set
|
|
11
|
+
*/
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Shared base (fields common across all profiles)
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
const BASE_CACHE = {
|
|
16
|
+
keyPrefix: 'hm:',
|
|
17
|
+
sessionTTL: 3600,
|
|
18
|
+
historyTTL: 86400,
|
|
19
|
+
};
|
|
20
|
+
const BASE_EMBEDDING = {
|
|
21
|
+
ollamaUrl: 'http://localhost:11434',
|
|
22
|
+
model: 'nomic-embed-text',
|
|
23
|
+
dimensions: 768,
|
|
24
|
+
timeout: 10000,
|
|
25
|
+
batchSize: 32,
|
|
26
|
+
};
|
|
27
|
+
/** Gemini embedding preset — use with mergeProfile() when switching fleet to Gemini. */
|
|
28
|
+
export const GEMINI_EMBEDDING = {
|
|
29
|
+
provider: 'gemini',
|
|
30
|
+
model: 'gemini-embedding-2-preview',
|
|
31
|
+
dimensions: 3072,
|
|
32
|
+
timeout: 15000,
|
|
33
|
+
batchSize: 100,
|
|
34
|
+
};
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// light — 64k context window, single agent, constrained resources
|
|
37
|
+
//
|
|
38
|
+
// Design intent:
|
|
39
|
+
// - Small local models (Mistral 7B, Phi-3, Llama 3 8B) at 64k context
|
|
40
|
+
// - Single agent — no cross-session context needed
|
|
41
|
+
// - Minimal ACA stack — no dreaming, no background indexing overhead
|
|
42
|
+
// - Low Redis churn — longer flush intervals, shorter history window
|
|
43
|
+
// - hyperformProfile: 'light' — ~100 token standalone directives, no fleet concepts
|
|
44
|
+
// - No parallel operations — sequential fact extraction only
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
const LIGHT_COMPOSITOR = {
|
|
47
|
+
// ── Primary budget controls ──
|
|
48
|
+
budgetFraction: 0.625, // 40k effective at 64k window
|
|
49
|
+
reserveFraction: 0.35, // generous — small systems do heavy tool work
|
|
50
|
+
historyFraction: 0.35, // ~14k tokens of conversation history
|
|
51
|
+
memoryFraction: 0.30, // ~12k tokens for facts/wiki/semantic
|
|
52
|
+
// ── Absolute fallback ──
|
|
53
|
+
defaultTokenBudget: 40000,
|
|
54
|
+
// ── History internals ──
|
|
55
|
+
maxHistoryMessages: 200,
|
|
56
|
+
warmHistoryBudgetFraction: 0.35,
|
|
57
|
+
keystoneHistoryFraction: 0.1,
|
|
58
|
+
keystoneMaxMessages: 5,
|
|
59
|
+
keystoneMinSignificance: 0.7,
|
|
60
|
+
// ── Memory internals ──
|
|
61
|
+
maxFacts: 15,
|
|
62
|
+
maxCrossSessionContext: 0,
|
|
63
|
+
maxTotalTriggerTokens: 1500,
|
|
64
|
+
wikiTokenCap: 300,
|
|
65
|
+
// ── Tool gradient (internal — safe floor enforced automatically) ──
|
|
66
|
+
maxRecentToolPairs: 2,
|
|
67
|
+
maxProseToolPairs: 4,
|
|
68
|
+
// ── Dynamic reserve ──
|
|
69
|
+
dynamicReserveEnabled: true,
|
|
70
|
+
dynamicReserveTurnHorizon: 3,
|
|
71
|
+
dynamicReserveMax: 0.50,
|
|
72
|
+
// ── HyperForm ──
|
|
73
|
+
hyperformProfile: 'light',
|
|
74
|
+
};
|
|
75
|
+
const LIGHT_INDEXER = {
|
|
76
|
+
enabled: true,
|
|
77
|
+
factExtractionMode: 'pattern', // pattern only — tiered extraction is heavier
|
|
78
|
+
topicDormantAfter: '12h', // faster dormancy — small systems don't need long windows
|
|
79
|
+
topicClosedAfter: '48h',
|
|
80
|
+
factDecayRate: 0.05, // slightly faster decay — fewer facts, keep them fresh
|
|
81
|
+
episodeSignificanceThreshold: 0.6, // higher bar — only store meaningful episodes
|
|
82
|
+
periodicInterval: 120000, // 2min — less frequent background work on small systems
|
|
83
|
+
batchSize: 64,
|
|
84
|
+
maxMessagesPerTick: 200,
|
|
85
|
+
};
|
|
86
|
+
export const lightProfile = {
|
|
87
|
+
enabled: true,
|
|
88
|
+
dataDir: './hypermem-data',
|
|
89
|
+
cache: BASE_CACHE,
|
|
90
|
+
compositor: LIGHT_COMPOSITOR,
|
|
91
|
+
indexer: LIGHT_INDEXER,
|
|
92
|
+
embedding: {
|
|
93
|
+
...BASE_EMBEDDING,
|
|
94
|
+
batchSize: 8, // smaller batches — don't spike memory on embed
|
|
95
|
+
timeout: 15000, // more generous timeout — local hardware can be slow
|
|
96
|
+
},
|
|
97
|
+
// dreaming: disabled (default) — don't run background promotion on small systems
|
|
98
|
+
// obsidian: disabled (default)
|
|
99
|
+
};
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
// standard — 128k context window, fleet default, balanced
|
|
102
|
+
//
|
|
103
|
+
// Design intent:
|
|
104
|
+
// - Mid-range models (Sonnet, GPT-5-mini, Gemini Flash) at 128k
|
|
105
|
+
// - Small multi-agent setups or single power-user agents
|
|
106
|
+
// - Full ACA stack — dreaming optional, background indexing on
|
|
107
|
+
// - hyperformProfile: 'standard' — full FOS, no MOD
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
const STANDARD_COMPOSITOR = {
|
|
110
|
+
// ── Primary budget controls ──
|
|
111
|
+
budgetFraction: 0.703, // 90k effective at 128k window
|
|
112
|
+
reserveFraction: 0.25, // balanced — leaves room for large tool results
|
|
113
|
+
historyFraction: 0.40, // ~27k tokens of conversation history
|
|
114
|
+
memoryFraction: 0.40, // ~27k tokens for facts/wiki/semantic
|
|
115
|
+
// ── Absolute fallback ──
|
|
116
|
+
defaultTokenBudget: 90000,
|
|
117
|
+
// ── History internals ──
|
|
118
|
+
maxHistoryMessages: 500,
|
|
119
|
+
warmHistoryBudgetFraction: 0.40,
|
|
120
|
+
keystoneHistoryFraction: 0.20,
|
|
121
|
+
keystoneMaxMessages: 15,
|
|
122
|
+
keystoneMinSignificance: 0.5,
|
|
123
|
+
// ── Memory internals ──
|
|
124
|
+
maxFacts: 30,
|
|
125
|
+
maxCrossSessionContext: 4000,
|
|
126
|
+
maxTotalTriggerTokens: 4000,
|
|
127
|
+
wikiTokenCap: 600,
|
|
128
|
+
// ── Tool gradient (internal — safe floor enforced automatically) ──
|
|
129
|
+
maxRecentToolPairs: 3,
|
|
130
|
+
maxProseToolPairs: 10,
|
|
131
|
+
// ── Dynamic reserve ──
|
|
132
|
+
dynamicReserveEnabled: true,
|
|
133
|
+
dynamicReserveTurnHorizon: 5,
|
|
134
|
+
dynamicReserveMax: 0.50,
|
|
135
|
+
// ── HyperForm ──
|
|
136
|
+
hyperformProfile: 'standard',
|
|
137
|
+
};
|
|
138
|
+
const STANDARD_INDEXER = {
|
|
139
|
+
enabled: true,
|
|
140
|
+
factExtractionMode: 'tiered',
|
|
141
|
+
topicDormantAfter: '24h',
|
|
142
|
+
topicClosedAfter: '72h',
|
|
143
|
+
factDecayRate: 0.02,
|
|
144
|
+
episodeSignificanceThreshold: 0.5,
|
|
145
|
+
periodicInterval: 60000, // 1min — standard background cadence
|
|
146
|
+
batchSize: 128,
|
|
147
|
+
maxMessagesPerTick: 500,
|
|
148
|
+
};
|
|
149
|
+
export const standardProfile = {
|
|
150
|
+
enabled: true,
|
|
151
|
+
dataDir: './hypermem-data',
|
|
152
|
+
cache: BASE_CACHE,
|
|
153
|
+
compositor: STANDARD_COMPOSITOR,
|
|
154
|
+
indexer: STANDARD_INDEXER,
|
|
155
|
+
embedding: BASE_EMBEDDING,
|
|
156
|
+
};
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
// extended — 200k+ context window, multi-agent, full feature set
|
|
159
|
+
//
|
|
160
|
+
// Design intent:
|
|
161
|
+
// - Large context models (Opus, GPT-5.4, Gemini Pro) at 200k+
|
|
162
|
+
// - Council / multi-agent fleet deployments
|
|
163
|
+
// - Full ACA stack including dreaming, background indexing, cross-session
|
|
164
|
+
// - hyperformProfile: 'full' — FOS + MOD, full spec
|
|
165
|
+
// - Higher keystone threshold — more historical context worth surfacing
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
const EXTENDED_COMPOSITOR = {
|
|
168
|
+
// ── Primary budget controls ──
|
|
169
|
+
budgetFraction: 0.588, // 160k effective at 272k window
|
|
170
|
+
reserveFraction: 0.20, // tighter — large windows have natural headroom
|
|
171
|
+
historyFraction: 0.45, // ~72k tokens of conversation history
|
|
172
|
+
memoryFraction: 0.40, // ~64k tokens for facts/wiki/semantic
|
|
173
|
+
// ── Absolute fallback ──
|
|
174
|
+
defaultTokenBudget: 160000,
|
|
175
|
+
// ── History internals ──
|
|
176
|
+
maxHistoryMessages: 1000,
|
|
177
|
+
warmHistoryBudgetFraction: 0.45,
|
|
178
|
+
keystoneHistoryFraction: 0.25,
|
|
179
|
+
keystoneMaxMessages: 30,
|
|
180
|
+
keystoneMinSignificance: 0.4,
|
|
181
|
+
// ── Memory internals ──
|
|
182
|
+
maxFacts: 60,
|
|
183
|
+
maxCrossSessionContext: 12000,
|
|
184
|
+
maxTotalTriggerTokens: 10000,
|
|
185
|
+
wikiTokenCap: 800,
|
|
186
|
+
// ── Tool gradient (internal — safe floor enforced automatically) ──
|
|
187
|
+
maxRecentToolPairs: 5,
|
|
188
|
+
maxProseToolPairs: 15,
|
|
189
|
+
// ── Dynamic reserve ──
|
|
190
|
+
dynamicReserveEnabled: true,
|
|
191
|
+
dynamicReserveTurnHorizon: 7,
|
|
192
|
+
dynamicReserveMax: 0.45,
|
|
193
|
+
// ── HyperForm ──
|
|
194
|
+
hyperformProfile: 'full',
|
|
195
|
+
};
|
|
196
|
+
const EXTENDED_INDEXER = {
|
|
197
|
+
enabled: true,
|
|
198
|
+
factExtractionMode: 'tiered',
|
|
199
|
+
topicDormantAfter: '48h',
|
|
200
|
+
topicClosedAfter: '168h', // 7 days — long-running council topics stay warm
|
|
201
|
+
factDecayRate: 0.01, // slow decay — preserve more institutional memory
|
|
202
|
+
episodeSignificanceThreshold: 0.4,
|
|
203
|
+
periodicInterval: 30000, // 30s — frequent background work for fleet throughput
|
|
204
|
+
batchSize: 256,
|
|
205
|
+
maxMessagesPerTick: 1000,
|
|
206
|
+
};
|
|
207
|
+
export const fullProfile = {
|
|
208
|
+
enabled: true,
|
|
209
|
+
dataDir: './hypermem-data',
|
|
210
|
+
cache: BASE_CACHE,
|
|
211
|
+
compositor: EXTENDED_COMPOSITOR,
|
|
212
|
+
indexer: EXTENDED_INDEXER,
|
|
213
|
+
embedding: {
|
|
214
|
+
...BASE_EMBEDDING,
|
|
215
|
+
batchSize: 64, // larger batches — more throughput for fleet ingest
|
|
216
|
+
timeout: 8000, // tighter timeout — expect capable hardware
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
// Legacy aliases — kept for backward compat, removed in 1.0
|
|
220
|
+
export const minimalProfile = lightProfile;
|
|
221
|
+
export const extendedProfile = fullProfile;
|
|
222
|
+
export const richProfile = fullProfile;
|
|
223
|
+
export const PROFILES = {
|
|
224
|
+
light: lightProfile,
|
|
225
|
+
standard: standardProfile,
|
|
226
|
+
full: fullProfile,
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Load a named profile.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* const config = getProfile('light');
|
|
233
|
+
* const hm = createHyperMem(config);
|
|
234
|
+
*/
|
|
235
|
+
export function getProfile(name) {
|
|
236
|
+
// backward compat
|
|
237
|
+
if (name === 'extended')
|
|
238
|
+
return structuredClone(fullProfile);
|
|
239
|
+
return structuredClone(PROFILES[name]);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Merge a partial config on top of a named profile.
|
|
243
|
+
* Deep-merges compositor and indexer; top-level fields are replaced.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* const config = mergeProfile('light', {
|
|
247
|
+
* cache: { keyPrefix: 'myapp:' },
|
|
248
|
+
* compositor: { hyperformProfile: 'standard', memoryFraction: 0.50 }, // upgrade tier + more memory
|
|
249
|
+
* });
|
|
250
|
+
*/
|
|
251
|
+
export function mergeProfile(name, overrides) {
|
|
252
|
+
const base = getProfile(name);
|
|
253
|
+
return {
|
|
254
|
+
...base,
|
|
255
|
+
...overrides,
|
|
256
|
+
compositor: { ...base.compositor, ...(overrides.compositor ?? {}) },
|
|
257
|
+
indexer: { ...base.indexer, ...(overrides.indexer ?? {}) },
|
|
258
|
+
embedding: { ...base.embedding, ...(overrides.embedding ?? {}) },
|
|
259
|
+
cache: { ...base.cache, ...(overrides.cache ?? {}) },
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hypermem Provider Translator
|
|
3
|
+
*
|
|
4
|
+
* Converts between provider-neutral (NeutralMessage) and provider-specific formats.
|
|
5
|
+
* This is the ONLY place where provider-specific formatting exists.
|
|
6
|
+
* Storage is always neutral. Translation happens at the send/receive boundary.
|
|
7
|
+
*
|
|
8
|
+
* This eliminates grafting/stripping entirely — tool calls are stored as structured
|
|
9
|
+
* data, and each provider gets the format it expects at send time.
|
|
10
|
+
*/
|
|
11
|
+
import type { NeutralMessage, NeutralToolResult, ProviderMessage } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Final pair-integrity sweep before provider translation.
|
|
14
|
+
*
|
|
15
|
+
* Invariant: never emit a tool_result unless its matching tool_use/tool_call
|
|
16
|
+
* exists in the immediately prior assistant message with the same ID.
|
|
17
|
+
*
|
|
18
|
+
* If the pair is broken, degrade the orphan tool_result into plain user text
|
|
19
|
+
* so providers never see an invalid tool_result block.
|
|
20
|
+
*/
|
|
21
|
+
export declare function repairToolCallPairs(messages: NeutralMessage[]): NeutralMessage[];
|
|
22
|
+
/**
|
|
23
|
+
* Generate a hypermem-native tool call ID.
|
|
24
|
+
* These are provider-neutral and deterministic within a session.
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateToolCallId(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Convert a provider-specific tool call ID to a hypermem ID.
|
|
29
|
+
* Deterministic: same input always produces same output.
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeToolCallId(providerId: string): string;
|
|
32
|
+
export type ProviderType = 'anthropic' | 'openai' | 'openai-responses' | 'unknown';
|
|
33
|
+
export declare function detectProvider(providerString: string | null | undefined): ProviderType;
|
|
34
|
+
/**
|
|
35
|
+
* Convert neutral messages to provider-specific format.
|
|
36
|
+
*/
|
|
37
|
+
export declare function toProviderFormat(messages: NeutralMessage[], provider: string | null | undefined): ProviderMessage[];
|
|
38
|
+
/**
|
|
39
|
+
* Convert a provider-specific response to neutral format.
|
|
40
|
+
*/
|
|
41
|
+
export declare function fromProviderFormat(response: Record<string, unknown>, provider: string): NeutralMessage;
|
|
42
|
+
/**
|
|
43
|
+
* Convert a user message (from chat input) to neutral format.
|
|
44
|
+
*/
|
|
45
|
+
export declare function userMessageToNeutral(content: string, metadata?: Record<string, unknown>): NeutralMessage;
|
|
46
|
+
/**
|
|
47
|
+
* Convert tool results to a neutral user message.
|
|
48
|
+
*/
|
|
49
|
+
export declare function toolResultsToNeutral(results: NeutralToolResult[]): NeutralMessage;
|
|
50
|
+
//# sourceMappingURL=provider-translator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-translator.d.ts","sourceRoot":"","sources":["../src/provider-translator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,cAAc,EAEd,iBAAiB,EACjB,eAAe,EAChB,MAAM,YAAY,CAAC;AAYpB;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CA4ChF;AAOD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAK3C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI9D;AAID,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAAC;AAEnF,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,CAOtF;AAgMD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,cAAc,EAAE,EAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAClC,eAAe,EAAE,CAenB;AA8ED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,QAAQ,EAAE,MAAM,GACf,cAAc,CAYhB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAQxG;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,cAAc,CAOjF"}
|