@psiclawops/hypermem 0.8.5 → 0.9.1
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/ARCHITECTURE.md +2 -2
- package/CHANGELOG.md +36 -1
- package/INSTALL.md +132 -9
- package/README.md +119 -272
- package/bench/README.md +42 -0
- package/bench/data-access-bench.mjs +380 -0
- package/bin/hypermem-bench.mjs +2 -0
- package/bin/hypermem-doctor.mjs +412 -0
- package/bin/hypermem-model-audit.mjs +339 -0
- package/bin/hypermem-status.mjs +491 -70
- package/docs/DIAGNOSTICS.md +205 -0
- package/docs/INTEGRATION_VALIDATION.md +186 -0
- package/docs/MIGRATION.md +9 -6
- package/docs/MIGRATION_GUIDE.md +125 -101
- package/docs/ROADMAP.md +247 -20
- package/docs/TUNING.md +19 -5
- package/install.sh +152 -401
- package/memory-plugin/LICENSE +190 -0
- package/memory-plugin/README.md +20 -0
- package/memory-plugin/package.json +3 -3
- package/package.json +19 -4
- package/plugin/LICENSE +190 -0
- package/plugin/README.md +20 -0
- package/plugin/package.json +4 -4
- package/scripts/install-runtime.mjs +12 -1
- package/dist/background-indexer.d.ts +0 -161
- package/dist/background-indexer.d.ts.map +0 -1
- package/dist/background-indexer.js +0 -1263
- package/dist/budget-policy.d.ts +0 -22
- package/dist/budget-policy.d.ts.map +0 -1
- package/dist/budget-policy.js +0 -27
- package/dist/cache.d.ts +0 -147
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js +0 -569
- package/dist/compaction-fence.d.ts +0 -97
- package/dist/compaction-fence.d.ts.map +0 -1
- package/dist/compaction-fence.js +0 -174
- package/dist/compositor-utils.d.ts +0 -31
- package/dist/compositor-utils.d.ts.map +0 -1
- package/dist/compositor-utils.js +0 -47
- package/dist/compositor.d.ts +0 -394
- package/dist/compositor.d.ts.map +0 -1
- package/dist/compositor.js +0 -3632
- package/dist/content-hash.d.ts +0 -43
- package/dist/content-hash.d.ts.map +0 -1
- package/dist/content-hash.js +0 -75
- package/dist/content-type-classifier.d.ts +0 -41
- package/dist/content-type-classifier.d.ts.map +0 -1
- package/dist/content-type-classifier.js +0 -181
- package/dist/context-backfill.d.ts +0 -46
- package/dist/context-backfill.d.ts.map +0 -1
- package/dist/context-backfill.js +0 -113
- package/dist/context-store.d.ts +0 -131
- package/dist/context-store.d.ts.map +0 -1
- package/dist/context-store.js +0 -279
- package/dist/contradiction-audit-store.d.ts +0 -54
- package/dist/contradiction-audit-store.d.ts.map +0 -1
- package/dist/contradiction-audit-store.js +0 -88
- package/dist/contradiction-detector.d.ts +0 -78
- package/dist/contradiction-detector.d.ts.map +0 -1
- package/dist/contradiction-detector.js +0 -362
- package/dist/contradiction-resolution-policy.d.ts +0 -21
- package/dist/contradiction-resolution-policy.d.ts.map +0 -1
- package/dist/contradiction-resolution-policy.js +0 -17
- package/dist/cross-agent.d.ts +0 -74
- package/dist/cross-agent.d.ts.map +0 -1
- package/dist/cross-agent.js +0 -271
- package/dist/db.d.ts +0 -131
- package/dist/db.d.ts.map +0 -1
- package/dist/db.js +0 -410
- package/dist/degradation.d.ts +0 -102
- package/dist/degradation.d.ts.map +0 -1
- package/dist/degradation.js +0 -141
- package/dist/desired-state-store.d.ts +0 -100
- package/dist/desired-state-store.d.ts.map +0 -1
- package/dist/desired-state-store.js +0 -222
- package/dist/doc-chunk-store.d.ts +0 -140
- package/dist/doc-chunk-store.d.ts.map +0 -1
- package/dist/doc-chunk-store.js +0 -391
- package/dist/doc-chunker.d.ts +0 -99
- package/dist/doc-chunker.d.ts.map +0 -1
- package/dist/doc-chunker.js +0 -324
- package/dist/dreaming-promoter.d.ts +0 -124
- package/dist/dreaming-promoter.d.ts.map +0 -1
- package/dist/dreaming-promoter.js +0 -447
- package/dist/episode-store.d.ts +0 -49
- package/dist/episode-store.d.ts.map +0 -1
- package/dist/episode-store.js +0 -135
- package/dist/expertise-store.d.ts +0 -129
- package/dist/expertise-store.d.ts.map +0 -1
- package/dist/expertise-store.js +0 -342
- package/dist/fact-store.d.ts +0 -90
- package/dist/fact-store.d.ts.map +0 -1
- package/dist/fact-store.js +0 -283
- package/dist/fleet-store.d.ts +0 -144
- package/dist/fleet-store.d.ts.map +0 -1
- package/dist/fleet-store.js +0 -276
- package/dist/fos-mod.d.ts +0 -178
- package/dist/fos-mod.d.ts.map +0 -1
- package/dist/fos-mod.js +0 -416
- package/dist/hybrid-retrieval.d.ts +0 -64
- package/dist/hybrid-retrieval.d.ts.map +0 -1
- package/dist/hybrid-retrieval.js +0 -344
- package/dist/image-eviction.d.ts +0 -49
- package/dist/image-eviction.d.ts.map +0 -1
- package/dist/image-eviction.js +0 -251
- package/dist/index.d.ts +0 -718
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1469
- package/dist/keystone-scorer.d.ts +0 -51
- package/dist/keystone-scorer.d.ts.map +0 -1
- package/dist/keystone-scorer.js +0 -52
- package/dist/knowledge-graph.d.ts +0 -110
- package/dist/knowledge-graph.d.ts.map +0 -1
- package/dist/knowledge-graph.js +0 -305
- package/dist/knowledge-lint.d.ts +0 -31
- package/dist/knowledge-lint.d.ts.map +0 -1
- package/dist/knowledge-lint.js +0 -155
- package/dist/knowledge-store.d.ts +0 -72
- package/dist/knowledge-store.d.ts.map +0 -1
- package/dist/knowledge-store.js +0 -247
- package/dist/library-schema.d.ts +0 -27
- package/dist/library-schema.d.ts.map +0 -1
- package/dist/library-schema.js +0 -1343
- package/dist/message-store.d.ts +0 -181
- package/dist/message-store.d.ts.map +0 -1
- package/dist/message-store.js +0 -573
- package/dist/metrics-dashboard.d.ts +0 -114
- package/dist/metrics-dashboard.d.ts.map +0 -1
- package/dist/metrics-dashboard.js +0 -260
- package/dist/obsidian-exporter.d.ts +0 -57
- package/dist/obsidian-exporter.d.ts.map +0 -1
- package/dist/obsidian-exporter.js +0 -274
- package/dist/obsidian-watcher.d.ts +0 -147
- package/dist/obsidian-watcher.d.ts.map +0 -1
- package/dist/obsidian-watcher.js +0 -403
- package/dist/open-domain.d.ts +0 -46
- package/dist/open-domain.d.ts.map +0 -1
- package/dist/open-domain.js +0 -125
- package/dist/preference-store.d.ts +0 -54
- package/dist/preference-store.d.ts.map +0 -1
- package/dist/preference-store.js +0 -109
- package/dist/preservation-gate.d.ts +0 -82
- package/dist/preservation-gate.d.ts.map +0 -1
- package/dist/preservation-gate.js +0 -150
- package/dist/proactive-pass.d.ts +0 -63
- package/dist/proactive-pass.d.ts.map +0 -1
- package/dist/proactive-pass.js +0 -293
- package/dist/profiles.d.ts +0 -46
- package/dist/profiles.d.ts.map +0 -1
- package/dist/profiles.js +0 -262
- package/dist/provider-translator.d.ts +0 -50
- package/dist/provider-translator.d.ts.map +0 -1
- package/dist/provider-translator.js +0 -403
- package/dist/rate-limiter.d.ts +0 -76
- package/dist/rate-limiter.d.ts.map +0 -1
- package/dist/rate-limiter.js +0 -179
- package/dist/repair-tool-pairs.d.ts +0 -38
- package/dist/repair-tool-pairs.d.ts.map +0 -1
- package/dist/repair-tool-pairs.js +0 -209
- package/dist/replay-recovery.d.ts +0 -29
- package/dist/replay-recovery.d.ts.map +0 -1
- package/dist/replay-recovery.js +0 -82
- package/dist/reranker.d.ts +0 -95
- package/dist/reranker.d.ts.map +0 -1
- package/dist/reranker.js +0 -308
- package/dist/retrieval-policy.d.ts +0 -51
- package/dist/retrieval-policy.d.ts.map +0 -1
- package/dist/retrieval-policy.js +0 -77
- package/dist/schema.d.ts +0 -15
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -300
- package/dist/secret-scanner.d.ts +0 -51
- package/dist/secret-scanner.d.ts.map +0 -1
- package/dist/secret-scanner.js +0 -248
- package/dist/seed.d.ts +0 -108
- package/dist/seed.d.ts.map +0 -1
- package/dist/seed.js +0 -177
- package/dist/session-flusher.d.ts +0 -53
- package/dist/session-flusher.d.ts.map +0 -1
- package/dist/session-flusher.js +0 -69
- package/dist/session-topic-map.d.ts +0 -41
- package/dist/session-topic-map.d.ts.map +0 -1
- package/dist/session-topic-map.js +0 -77
- package/dist/spawn-context.d.ts +0 -54
- package/dist/spawn-context.d.ts.map +0 -1
- package/dist/spawn-context.js +0 -159
- package/dist/system-store.d.ts +0 -73
- package/dist/system-store.d.ts.map +0 -1
- package/dist/system-store.js +0 -182
- package/dist/temporal-store.d.ts +0 -81
- package/dist/temporal-store.d.ts.map +0 -1
- package/dist/temporal-store.js +0 -149
- package/dist/tool-artifact-store.d.ts +0 -98
- package/dist/tool-artifact-store.d.ts.map +0 -1
- package/dist/tool-artifact-store.js +0 -244
- package/dist/topic-detector.d.ts +0 -35
- package/dist/topic-detector.d.ts.map +0 -1
- package/dist/topic-detector.js +0 -249
- package/dist/topic-store.d.ts +0 -51
- package/dist/topic-store.d.ts.map +0 -1
- package/dist/topic-store.js +0 -175
- package/dist/topic-synthesizer.d.ts +0 -51
- package/dist/topic-synthesizer.d.ts.map +0 -1
- package/dist/topic-synthesizer.js +0 -316
- package/dist/trigger-registry.d.ts +0 -63
- package/dist/trigger-registry.d.ts.map +0 -1
- package/dist/trigger-registry.js +0 -163
- package/dist/types.d.ts +0 -815
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -9
- package/dist/vector-store.d.ts +0 -180
- package/dist/vector-store.d.ts.map +0 -1
- package/dist/vector-store.js +0 -1041
- package/dist/version.d.ts +0 -34
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -34
- package/dist/wiki-page-emitter.d.ts +0 -65
- package/dist/wiki-page-emitter.d.ts.map +0 -1
- package/dist/wiki-page-emitter.js +0 -258
- package/dist/work-store.d.ts +0 -112
- package/dist/work-store.d.ts.map +0 -1
- package/dist/work-store.js +0 -273
- package/memory-plugin/dist/index.d.ts +0 -24
- package/memory-plugin/dist/index.d.ts.map +0 -1
- package/memory-plugin/dist/index.js +0 -300
- package/memory-plugin/dist/index.js.map +0 -1
- package/node_modules/sqlite-vec/README.md +0 -1
- package/node_modules/sqlite-vec/index.cjs +0 -46
- package/node_modules/sqlite-vec/index.d.ts +0 -17
- package/node_modules/sqlite-vec/index.mjs +0 -47
- package/node_modules/sqlite-vec/package.json +0 -1
- package/node_modules/sqlite-vec-linux-x64/README.md +0 -1
- package/node_modules/sqlite-vec-linux-x64/package.json +0 -1
- package/node_modules/sqlite-vec-linux-x64/vec0.so +0 -0
- package/node_modules/zod/LICENSE +0 -21
- package/node_modules/zod/README.md +0 -208
- package/node_modules/zod/index.cjs +0 -33
- package/node_modules/zod/index.d.cts +0 -4
- package/node_modules/zod/index.d.ts +0 -4
- package/node_modules/zod/index.js +0 -4
- package/node_modules/zod/locales/index.cjs +0 -17
- package/node_modules/zod/locales/index.d.cts +0 -1
- package/node_modules/zod/locales/index.d.ts +0 -1
- package/node_modules/zod/locales/index.js +0 -1
- package/node_modules/zod/locales/package.json +0 -6
- package/node_modules/zod/mini/index.cjs +0 -32
- package/node_modules/zod/mini/index.d.cts +0 -3
- package/node_modules/zod/mini/index.d.ts +0 -3
- package/node_modules/zod/mini/index.js +0 -3
- package/node_modules/zod/mini/package.json +0 -6
- package/node_modules/zod/package.json +0 -135
- package/node_modules/zod/src/index.ts +0 -4
- package/node_modules/zod/src/locales/index.ts +0 -1
- package/node_modules/zod/src/mini/index.ts +0 -3
- package/node_modules/zod/src/v3/ZodError.ts +0 -330
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
- package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
- package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
- package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
- package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
- package/node_modules/zod/src/v3/errors.ts +0 -13
- package/node_modules/zod/src/v3/external.ts +0 -6
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
- package/node_modules/zod/src/v3/helpers/util.ts +0 -224
- package/node_modules/zod/src/v3/index.ts +0 -4
- package/node_modules/zod/src/v3/locales/en.ts +0 -124
- package/node_modules/zod/src/v3/standard-schema.ts +0 -113
- package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
- package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
- package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
- package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
- package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
- package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
- package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
- package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
- package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
- package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
- package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
- package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
- package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
- package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
- package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
- package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
- package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
- package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
- package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
- package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
- package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
- package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
- package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
- package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
- package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
- package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
- package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
- package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
- package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
- package/node_modules/zod/src/v3/types.ts +0 -5138
- package/node_modules/zod/src/v4/classic/checks.ts +0 -32
- package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
- package/node_modules/zod/src/v4/classic/compat.ts +0 -70
- package/node_modules/zod/src/v4/classic/errors.ts +0 -82
- package/node_modules/zod/src/v4/classic/external.ts +0 -51
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -643
- package/node_modules/zod/src/v4/classic/index.ts +0 -5
- package/node_modules/zod/src/v4/classic/iso.ts +0 -90
- package/node_modules/zod/src/v4/classic/parse.ts +0 -82
- package/node_modules/zod/src/v4/classic/schemas.ts +0 -2409
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -276
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -562
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -365
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -661
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -595
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -734
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -270
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -640
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -223
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -427
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -282
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -632
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -582
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -570
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1175
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2990
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -361
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -183
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -219
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
- package/node_modules/zod/src/v4/core/api.ts +0 -1798
- package/node_modules/zod/src/v4/core/checks.ts +0 -1293
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/core.ts +0 -138
- package/node_modules/zod/src/v4/core/doc.ts +0 -44
- package/node_modules/zod/src/v4/core/errors.ts +0 -448
- package/node_modules/zod/src/v4/core/index.ts +0 -16
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -667
- package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
- package/node_modules/zod/src/v4/core/parse.ts +0 -195
- package/node_modules/zod/src/v4/core/regexes.ts +0 -183
- package/node_modules/zod/src/v4/core/registries.ts +0 -105
- package/node_modules/zod/src/v4/core/schemas.ts +0 -4538
- package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
- package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -83
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -67
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
- package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -613
- package/node_modules/zod/src/v4/core/util.ts +0 -966
- package/node_modules/zod/src/v4/core/versions.ts +0 -5
- package/node_modules/zod/src/v4/core/zsf.ts +0 -323
- package/node_modules/zod/src/v4/index.ts +0 -4
- package/node_modules/zod/src/v4/locales/ar.ts +0 -115
- package/node_modules/zod/src/v4/locales/az.ts +0 -111
- package/node_modules/zod/src/v4/locales/be.ts +0 -176
- package/node_modules/zod/src/v4/locales/bg.ts +0 -128
- package/node_modules/zod/src/v4/locales/ca.ts +0 -116
- package/node_modules/zod/src/v4/locales/cs.ts +0 -118
- package/node_modules/zod/src/v4/locales/da.ts +0 -123
- package/node_modules/zod/src/v4/locales/de.ts +0 -116
- package/node_modules/zod/src/v4/locales/en.ts +0 -119
- package/node_modules/zod/src/v4/locales/eo.ts +0 -118
- package/node_modules/zod/src/v4/locales/es.ts +0 -141
- package/node_modules/zod/src/v4/locales/fa.ts +0 -126
- package/node_modules/zod/src/v4/locales/fi.ts +0 -121
- package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
- package/node_modules/zod/src/v4/locales/fr.ts +0 -116
- package/node_modules/zod/src/v4/locales/he.ts +0 -246
- package/node_modules/zod/src/v4/locales/hu.ts +0 -117
- package/node_modules/zod/src/v4/locales/hy.ts +0 -164
- package/node_modules/zod/src/v4/locales/id.ts +0 -115
- package/node_modules/zod/src/v4/locales/index.ts +0 -49
- package/node_modules/zod/src/v4/locales/is.ts +0 -119
- package/node_modules/zod/src/v4/locales/it.ts +0 -116
- package/node_modules/zod/src/v4/locales/ja.ts +0 -114
- package/node_modules/zod/src/v4/locales/ka.ts +0 -123
- package/node_modules/zod/src/v4/locales/kh.ts +0 -7
- package/node_modules/zod/src/v4/locales/km.ts +0 -119
- package/node_modules/zod/src/v4/locales/ko.ts +0 -121
- package/node_modules/zod/src/v4/locales/lt.ts +0 -239
- package/node_modules/zod/src/v4/locales/mk.ts +0 -118
- package/node_modules/zod/src/v4/locales/ms.ts +0 -115
- package/node_modules/zod/src/v4/locales/nl.ts +0 -121
- package/node_modules/zod/src/v4/locales/no.ts +0 -116
- package/node_modules/zod/src/v4/locales/ota.ts +0 -117
- package/node_modules/zod/src/v4/locales/pl.ts +0 -118
- package/node_modules/zod/src/v4/locales/ps.ts +0 -126
- package/node_modules/zod/src/v4/locales/pt.ts +0 -116
- package/node_modules/zod/src/v4/locales/ru.ts +0 -176
- package/node_modules/zod/src/v4/locales/sl.ts +0 -118
- package/node_modules/zod/src/v4/locales/sv.ts +0 -119
- package/node_modules/zod/src/v4/locales/ta.ts +0 -118
- package/node_modules/zod/src/v4/locales/th.ts +0 -119
- package/node_modules/zod/src/v4/locales/tr.ts +0 -111
- package/node_modules/zod/src/v4/locales/ua.ts +0 -7
- package/node_modules/zod/src/v4/locales/uk.ts +0 -117
- package/node_modules/zod/src/v4/locales/ur.ts +0 -119
- package/node_modules/zod/src/v4/locales/uz.ts +0 -116
- package/node_modules/zod/src/v4/locales/vi.ts +0 -117
- package/node_modules/zod/src/v4/locales/yo.ts +0 -124
- package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
- package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
- package/node_modules/zod/src/v4/mini/checks.ts +0 -32
- package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
- package/node_modules/zod/src/v4/mini/external.ts +0 -40
- package/node_modules/zod/src/v4/mini/index.ts +0 -3
- package/node_modules/zod/src/v4/mini/iso.ts +0 -66
- package/node_modules/zod/src/v4/mini/parse.ts +0 -14
- package/node_modules/zod/src/v4/mini/schemas.ts +0 -1916
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -529
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -963
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -347
- package/node_modules/zod/src/v4-mini/index.ts +0 -3
- package/node_modules/zod/v3/ZodError.cjs +0 -138
- package/node_modules/zod/v3/ZodError.d.cts +0 -164
- package/node_modules/zod/v3/ZodError.d.ts +0 -164
- package/node_modules/zod/v3/ZodError.js +0 -133
- package/node_modules/zod/v3/errors.cjs +0 -17
- package/node_modules/zod/v3/errors.d.cts +0 -5
- package/node_modules/zod/v3/errors.d.ts +0 -5
- package/node_modules/zod/v3/errors.js +0 -9
- package/node_modules/zod/v3/external.cjs +0 -22
- package/node_modules/zod/v3/external.d.cts +0 -6
- package/node_modules/zod/v3/external.d.ts +0 -6
- package/node_modules/zod/v3/external.js +0 -6
- package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
- package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
- package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
- package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
- package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/node_modules/zod/v3/helpers/util.cjs +0 -137
- package/node_modules/zod/v3/helpers/util.d.cts +0 -85
- package/node_modules/zod/v3/helpers/util.d.ts +0 -85
- package/node_modules/zod/v3/helpers/util.js +0 -133
- package/node_modules/zod/v3/index.cjs +0 -33
- package/node_modules/zod/v3/index.d.cts +0 -4
- package/node_modules/zod/v3/index.d.ts +0 -4
- package/node_modules/zod/v3/index.js +0 -4
- package/node_modules/zod/v3/locales/en.cjs +0 -112
- package/node_modules/zod/v3/locales/en.d.cts +0 -3
- package/node_modules/zod/v3/locales/en.d.ts +0 -3
- package/node_modules/zod/v3/locales/en.js +0 -109
- package/node_modules/zod/v3/package.json +0 -6
- package/node_modules/zod/v3/standard-schema.cjs +0 -2
- package/node_modules/zod/v3/standard-schema.d.cts +0 -102
- package/node_modules/zod/v3/standard-schema.d.ts +0 -102
- package/node_modules/zod/v3/standard-schema.js +0 -1
- package/node_modules/zod/v3/types.cjs +0 -3777
- package/node_modules/zod/v3/types.d.cts +0 -1034
- package/node_modules/zod/v3/types.d.ts +0 -1034
- package/node_modules/zod/v3/types.js +0 -3695
- package/node_modules/zod/v4/classic/checks.cjs +0 -33
- package/node_modules/zod/v4/classic/checks.d.cts +0 -1
- package/node_modules/zod/v4/classic/checks.d.ts +0 -1
- package/node_modules/zod/v4/classic/checks.js +0 -1
- package/node_modules/zod/v4/classic/coerce.cjs +0 -47
- package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
- package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
- package/node_modules/zod/v4/classic/coerce.js +0 -17
- package/node_modules/zod/v4/classic/compat.cjs +0 -61
- package/node_modules/zod/v4/classic/compat.d.cts +0 -50
- package/node_modules/zod/v4/classic/compat.d.ts +0 -50
- package/node_modules/zod/v4/classic/compat.js +0 -31
- package/node_modules/zod/v4/classic/errors.cjs +0 -74
- package/node_modules/zod/v4/classic/errors.d.cts +0 -30
- package/node_modules/zod/v4/classic/errors.d.ts +0 -30
- package/node_modules/zod/v4/classic/errors.js +0 -48
- package/node_modules/zod/v4/classic/external.cjs +0 -73
- package/node_modules/zod/v4/classic/external.d.cts +0 -15
- package/node_modules/zod/v4/classic/external.d.ts +0 -15
- package/node_modules/zod/v4/classic/external.js +0 -20
- package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -610
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
- package/node_modules/zod/v4/classic/from-json-schema.js +0 -584
- package/node_modules/zod/v4/classic/index.cjs +0 -33
- package/node_modules/zod/v4/classic/index.d.cts +0 -4
- package/node_modules/zod/v4/classic/index.d.ts +0 -4
- package/node_modules/zod/v4/classic/index.js +0 -4
- package/node_modules/zod/v4/classic/iso.cjs +0 -60
- package/node_modules/zod/v4/classic/iso.d.cts +0 -22
- package/node_modules/zod/v4/classic/iso.d.ts +0 -22
- package/node_modules/zod/v4/classic/iso.js +0 -30
- package/node_modules/zod/v4/classic/package.json +0 -6
- package/node_modules/zod/v4/classic/parse.cjs +0 -41
- package/node_modules/zod/v4/classic/parse.d.cts +0 -31
- package/node_modules/zod/v4/classic/parse.d.ts +0 -31
- package/node_modules/zod/v4/classic/parse.js +0 -15
- package/node_modules/zod/v4/classic/schemas.cjs +0 -1272
- package/node_modules/zod/v4/classic/schemas.d.cts +0 -739
- package/node_modules/zod/v4/classic/schemas.d.ts +0 -739
- package/node_modules/zod/v4/classic/schemas.js +0 -1157
- package/node_modules/zod/v4/core/api.cjs +0 -1222
- package/node_modules/zod/v4/core/api.d.cts +0 -304
- package/node_modules/zod/v4/core/api.d.ts +0 -304
- package/node_modules/zod/v4/core/api.js +0 -1082
- package/node_modules/zod/v4/core/checks.cjs +0 -601
- package/node_modules/zod/v4/core/checks.d.cts +0 -278
- package/node_modules/zod/v4/core/checks.d.ts +0 -278
- package/node_modules/zod/v4/core/checks.js +0 -575
- package/node_modules/zod/v4/core/core.cjs +0 -83
- package/node_modules/zod/v4/core/core.d.cts +0 -70
- package/node_modules/zod/v4/core/core.d.ts +0 -70
- package/node_modules/zod/v4/core/core.js +0 -76
- package/node_modules/zod/v4/core/doc.cjs +0 -39
- package/node_modules/zod/v4/core/doc.d.cts +0 -14
- package/node_modules/zod/v4/core/doc.d.ts +0 -14
- package/node_modules/zod/v4/core/doc.js +0 -35
- package/node_modules/zod/v4/core/errors.cjs +0 -213
- package/node_modules/zod/v4/core/errors.d.cts +0 -220
- package/node_modules/zod/v4/core/errors.d.ts +0 -220
- package/node_modules/zod/v4/core/errors.js +0 -182
- package/node_modules/zod/v4/core/index.cjs +0 -47
- package/node_modules/zod/v4/core/index.d.cts +0 -16
- package/node_modules/zod/v4/core/index.d.ts +0 -16
- package/node_modules/zod/v4/core/index.js +0 -16
- package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
- package/node_modules/zod/v4/core/json-schema-generator.js +0 -95
- package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -648
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
- package/node_modules/zod/v4/core/json-schema-processors.js +0 -605
- package/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
- package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
- package/node_modules/zod/v4/core/json-schema.js +0 -1
- package/node_modules/zod/v4/core/package.json +0 -6
- package/node_modules/zod/v4/core/parse.cjs +0 -131
- package/node_modules/zod/v4/core/parse.d.cts +0 -49
- package/node_modules/zod/v4/core/parse.d.ts +0 -49
- package/node_modules/zod/v4/core/parse.js +0 -93
- package/node_modules/zod/v4/core/regexes.cjs +0 -166
- package/node_modules/zod/v4/core/regexes.d.cts +0 -79
- package/node_modules/zod/v4/core/regexes.d.ts +0 -79
- package/node_modules/zod/v4/core/regexes.js +0 -133
- package/node_modules/zod/v4/core/registries.cjs +0 -56
- package/node_modules/zod/v4/core/registries.d.cts +0 -35
- package/node_modules/zod/v4/core/registries.d.ts +0 -35
- package/node_modules/zod/v4/core/registries.js +0 -51
- package/node_modules/zod/v4/core/schemas.cjs +0 -2124
- package/node_modules/zod/v4/core/schemas.d.cts +0 -1146
- package/node_modules/zod/v4/core/schemas.d.ts +0 -1146
- package/node_modules/zod/v4/core/schemas.js +0 -2093
- package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
- package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
- package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
- package/node_modules/zod/v4/core/standard-schema.js +0 -1
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -446
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
- package/node_modules/zod/v4/core/to-json-schema.js +0 -437
- package/node_modules/zod/v4/core/util.cjs +0 -710
- package/node_modules/zod/v4/core/util.d.cts +0 -199
- package/node_modules/zod/v4/core/util.d.ts +0 -199
- package/node_modules/zod/v4/core/util.js +0 -651
- package/node_modules/zod/v4/core/versions.cjs +0 -8
- package/node_modules/zod/v4/core/versions.d.cts +0 -5
- package/node_modules/zod/v4/core/versions.d.ts +0 -5
- package/node_modules/zod/v4/core/versions.js +0 -5
- package/node_modules/zod/v4/index.cjs +0 -22
- package/node_modules/zod/v4/index.d.cts +0 -3
- package/node_modules/zod/v4/index.d.ts +0 -3
- package/node_modules/zod/v4/index.js +0 -3
- package/node_modules/zod/v4/locales/ar.cjs +0 -133
- package/node_modules/zod/v4/locales/ar.d.cts +0 -5
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/ar.js +0 -106
- package/node_modules/zod/v4/locales/az.cjs +0 -132
- package/node_modules/zod/v4/locales/az.d.cts +0 -5
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.js +0 -105
- package/node_modules/zod/v4/locales/be.cjs +0 -183
- package/node_modules/zod/v4/locales/be.d.cts +0 -5
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.js +0 -156
- package/node_modules/zod/v4/locales/bg.cjs +0 -147
- package/node_modules/zod/v4/locales/bg.d.cts +0 -5
- package/node_modules/zod/v4/locales/bg.d.ts +0 -4
- package/node_modules/zod/v4/locales/bg.js +0 -120
- package/node_modules/zod/v4/locales/ca.cjs +0 -134
- package/node_modules/zod/v4/locales/ca.d.cts +0 -5
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.js +0 -107
- package/node_modules/zod/v4/locales/cs.cjs +0 -138
- package/node_modules/zod/v4/locales/cs.d.cts +0 -5
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.js +0 -111
- package/node_modules/zod/v4/locales/da.cjs +0 -142
- package/node_modules/zod/v4/locales/da.d.cts +0 -5
- package/node_modules/zod/v4/locales/da.d.ts +0 -4
- package/node_modules/zod/v4/locales/da.js +0 -115
- package/node_modules/zod/v4/locales/de.cjs +0 -135
- package/node_modules/zod/v4/locales/de.d.cts +0 -5
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.js +0 -108
- package/node_modules/zod/v4/locales/en.cjs +0 -136
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -4
- package/node_modules/zod/v4/locales/en.js +0 -109
- package/node_modules/zod/v4/locales/eo.cjs +0 -136
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -4
- package/node_modules/zod/v4/locales/eo.js +0 -109
- package/node_modules/zod/v4/locales/es.cjs +0 -159
- package/node_modules/zod/v4/locales/es.d.cts +0 -5
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/es.js +0 -132
- package/node_modules/zod/v4/locales/fa.cjs +0 -141
- package/node_modules/zod/v4/locales/fa.d.cts +0 -5
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.js +0 -114
- package/node_modules/zod/v4/locales/fi.cjs +0 -139
- package/node_modules/zod/v4/locales/fi.d.cts +0 -5
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.js +0 -112
- package/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.js +0 -107
- package/node_modules/zod/v4/locales/fr.cjs +0 -135
- package/node_modules/zod/v4/locales/fr.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.js +0 -108
- package/node_modules/zod/v4/locales/he.cjs +0 -241
- package/node_modules/zod/v4/locales/he.d.cts +0 -5
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.js +0 -214
- package/node_modules/zod/v4/locales/hu.cjs +0 -135
- package/node_modules/zod/v4/locales/hu.d.cts +0 -5
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.js +0 -108
- package/node_modules/zod/v4/locales/hy.cjs +0 -174
- package/node_modules/zod/v4/locales/hy.d.cts +0 -5
- package/node_modules/zod/v4/locales/hy.d.ts +0 -4
- package/node_modules/zod/v4/locales/hy.js +0 -147
- package/node_modules/zod/v4/locales/id.cjs +0 -133
- package/node_modules/zod/v4/locales/id.d.cts +0 -5
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.js +0 -106
- package/node_modules/zod/v4/locales/index.cjs +0 -104
- package/node_modules/zod/v4/locales/index.d.cts +0 -49
- package/node_modules/zod/v4/locales/index.d.ts +0 -49
- package/node_modules/zod/v4/locales/index.js +0 -49
- package/node_modules/zod/v4/locales/is.cjs +0 -136
- package/node_modules/zod/v4/locales/is.d.cts +0 -5
- package/node_modules/zod/v4/locales/is.d.ts +0 -4
- package/node_modules/zod/v4/locales/is.js +0 -109
- package/node_modules/zod/v4/locales/it.cjs +0 -135
- package/node_modules/zod/v4/locales/it.d.cts +0 -5
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/it.js +0 -108
- package/node_modules/zod/v4/locales/ja.cjs +0 -134
- package/node_modules/zod/v4/locales/ja.d.cts +0 -5
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.js +0 -107
- package/node_modules/zod/v4/locales/ka.cjs +0 -139
- package/node_modules/zod/v4/locales/ka.d.cts +0 -5
- package/node_modules/zod/v4/locales/ka.d.ts +0 -4
- package/node_modules/zod/v4/locales/ka.js +0 -112
- package/node_modules/zod/v4/locales/kh.cjs +0 -12
- package/node_modules/zod/v4/locales/kh.d.cts +0 -5
- package/node_modules/zod/v4/locales/kh.d.ts +0 -5
- package/node_modules/zod/v4/locales/kh.js +0 -5
- package/node_modules/zod/v4/locales/km.cjs +0 -137
- package/node_modules/zod/v4/locales/km.d.cts +0 -5
- package/node_modules/zod/v4/locales/km.d.ts +0 -4
- package/node_modules/zod/v4/locales/km.js +0 -110
- package/node_modules/zod/v4/locales/ko.cjs +0 -138
- package/node_modules/zod/v4/locales/ko.d.cts +0 -5
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.js +0 -111
- package/node_modules/zod/v4/locales/lt.cjs +0 -230
- package/node_modules/zod/v4/locales/lt.d.cts +0 -5
- package/node_modules/zod/v4/locales/lt.d.ts +0 -4
- package/node_modules/zod/v4/locales/lt.js +0 -203
- package/node_modules/zod/v4/locales/mk.cjs +0 -136
- package/node_modules/zod/v4/locales/mk.d.cts +0 -5
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.js +0 -109
- package/node_modules/zod/v4/locales/ms.cjs +0 -134
- package/node_modules/zod/v4/locales/ms.d.cts +0 -5
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.js +0 -107
- package/node_modules/zod/v4/locales/nl.cjs +0 -137
- package/node_modules/zod/v4/locales/nl.d.cts +0 -5
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.js +0 -110
- package/node_modules/zod/v4/locales/no.cjs +0 -135
- package/node_modules/zod/v4/locales/no.d.cts +0 -5
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.js +0 -108
- package/node_modules/zod/v4/locales/ota.cjs +0 -136
- package/node_modules/zod/v4/locales/ota.d.cts +0 -5
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.js +0 -109
- package/node_modules/zod/v4/locales/package.json +0 -6
- package/node_modules/zod/v4/locales/pl.cjs +0 -136
- package/node_modules/zod/v4/locales/pl.d.cts +0 -5
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.js +0 -109
- package/node_modules/zod/v4/locales/ps.cjs +0 -141
- package/node_modules/zod/v4/locales/ps.d.cts +0 -5
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.js +0 -114
- package/node_modules/zod/v4/locales/pt.cjs +0 -135
- package/node_modules/zod/v4/locales/pt.d.cts +0 -5
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.js +0 -108
- package/node_modules/zod/v4/locales/ru.cjs +0 -183
- package/node_modules/zod/v4/locales/ru.d.cts +0 -5
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.js +0 -156
- package/node_modules/zod/v4/locales/sl.cjs +0 -136
- package/node_modules/zod/v4/locales/sl.d.cts +0 -5
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.js +0 -109
- package/node_modules/zod/v4/locales/sv.cjs +0 -137
- package/node_modules/zod/v4/locales/sv.d.cts +0 -5
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.js +0 -110
- package/node_modules/zod/v4/locales/ta.cjs +0 -137
- package/node_modules/zod/v4/locales/ta.d.cts +0 -5
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.js +0 -110
- package/node_modules/zod/v4/locales/th.cjs +0 -137
- package/node_modules/zod/v4/locales/th.d.cts +0 -5
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.js +0 -110
- package/node_modules/zod/v4/locales/tr.cjs +0 -132
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -4
- package/node_modules/zod/v4/locales/tr.js +0 -105
- package/node_modules/zod/v4/locales/ua.cjs +0 -12
- package/node_modules/zod/v4/locales/ua.d.cts +0 -5
- package/node_modules/zod/v4/locales/ua.d.ts +0 -5
- package/node_modules/zod/v4/locales/ua.js +0 -5
- package/node_modules/zod/v4/locales/uk.cjs +0 -135
- package/node_modules/zod/v4/locales/uk.d.cts +0 -5
- package/node_modules/zod/v4/locales/uk.d.ts +0 -4
- package/node_modules/zod/v4/locales/uk.js +0 -108
- package/node_modules/zod/v4/locales/ur.cjs +0 -137
- package/node_modules/zod/v4/locales/ur.d.cts +0 -5
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.js +0 -110
- package/node_modules/zod/v4/locales/uz.cjs +0 -136
- package/node_modules/zod/v4/locales/uz.d.cts +0 -5
- package/node_modules/zod/v4/locales/uz.d.ts +0 -4
- package/node_modules/zod/v4/locales/uz.js +0 -109
- package/node_modules/zod/v4/locales/vi.cjs +0 -135
- package/node_modules/zod/v4/locales/vi.d.cts +0 -5
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.js +0 -108
- package/node_modules/zod/v4/locales/yo.cjs +0 -134
- package/node_modules/zod/v4/locales/yo.d.cts +0 -5
- package/node_modules/zod/v4/locales/yo.d.ts +0 -4
- package/node_modules/zod/v4/locales/yo.js +0 -107
- package/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.js +0 -109
- package/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.js +0 -107
- package/node_modules/zod/v4/mini/checks.cjs +0 -34
- package/node_modules/zod/v4/mini/checks.d.cts +0 -1
- package/node_modules/zod/v4/mini/checks.d.ts +0 -1
- package/node_modules/zod/v4/mini/checks.js +0 -1
- package/node_modules/zod/v4/mini/coerce.cjs +0 -52
- package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
- package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
- package/node_modules/zod/v4/mini/coerce.js +0 -22
- package/node_modules/zod/v4/mini/external.cjs +0 -63
- package/node_modules/zod/v4/mini/external.d.cts +0 -12
- package/node_modules/zod/v4/mini/external.d.ts +0 -12
- package/node_modules/zod/v4/mini/external.js +0 -14
- package/node_modules/zod/v4/mini/index.cjs +0 -32
- package/node_modules/zod/v4/mini/index.d.cts +0 -3
- package/node_modules/zod/v4/mini/index.d.ts +0 -3
- package/node_modules/zod/v4/mini/index.js +0 -3
- package/node_modules/zod/v4/mini/iso.cjs +0 -64
- package/node_modules/zod/v4/mini/iso.d.cts +0 -22
- package/node_modules/zod/v4/mini/iso.d.ts +0 -22
- package/node_modules/zod/v4/mini/iso.js +0 -34
- package/node_modules/zod/v4/mini/package.json +0 -6
- package/node_modules/zod/v4/mini/parse.cjs +0 -16
- package/node_modules/zod/v4/mini/parse.d.cts +0 -1
- package/node_modules/zod/v4/mini/parse.d.ts +0 -1
- package/node_modules/zod/v4/mini/parse.js +0 -1
- package/node_modules/zod/v4/mini/schemas.cjs +0 -1046
- package/node_modules/zod/v4/mini/schemas.d.cts +0 -427
- package/node_modules/zod/v4/mini/schemas.d.ts +0 -427
- package/node_modules/zod/v4/mini/schemas.js +0 -925
- package/node_modules/zod/v4/package.json +0 -6
- package/node_modules/zod/v4-mini/index.cjs +0 -32
- package/node_modules/zod/v4-mini/index.d.cts +0 -3
- package/node_modules/zod/v4-mini/index.d.ts +0 -3
- package/node_modules/zod/v4-mini/index.js +0 -3
- package/node_modules/zod/v4-mini/package.json +0 -6
- package/plugin/dist/index.d.ts +0 -179
- package/plugin/dist/index.d.ts.map +0 -1
- package/plugin/dist/index.js +0 -3209
- package/plugin/dist/index.js.map +0 -1
package/dist/compaction-fence.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* hypermem Compaction Fence
|
|
3
|
-
*
|
|
4
|
-
* Protects the recent conversation tail from being compacted.
|
|
5
|
-
*
|
|
6
|
-
* The fence is a per-conversation high-water mark (message ID) that divides
|
|
7
|
-
* the message timeline into two zones:
|
|
8
|
-
*
|
|
9
|
-
* - ABOVE the fence: messages the LLM can currently see (recent tail).
|
|
10
|
-
* These are off-limits to compaction.
|
|
11
|
-
* - BELOW the fence: older messages eligible for compaction/summarization.
|
|
12
|
-
*
|
|
13
|
-
* The compositor updates the fence every compose cycle by recording the
|
|
14
|
-
* oldest message ID that was included in the composed context. This means
|
|
15
|
-
* the fence automatically advances as conversations grow.
|
|
16
|
-
*
|
|
17
|
-
* Safety defaults:
|
|
18
|
-
* - No fence row = no compaction allowed (explicit opt-in)
|
|
19
|
-
* - Fence never moves backward (monotone progress)
|
|
20
|
-
* - Fence update is idempotent (same value = no-op)
|
|
21
|
-
*
|
|
22
|
-
* Inspired by the continuity model in openclaw-memory-libravdb, which
|
|
23
|
-
* formally proves that compaction must never touch the recent tail.
|
|
24
|
-
*/
|
|
25
|
-
// ─── Schema ─────────────────────────────────────────────────────
|
|
26
|
-
/**
|
|
27
|
-
* Add the compaction_fences table to an existing messages.db.
|
|
28
|
-
* Idempotent — safe to call on every startup.
|
|
29
|
-
*/
|
|
30
|
-
export function ensureCompactionFenceSchema(db) {
|
|
31
|
-
db.exec(`
|
|
32
|
-
CREATE TABLE IF NOT EXISTS compaction_fences (
|
|
33
|
-
conversation_id INTEGER PRIMARY KEY REFERENCES conversations(id),
|
|
34
|
-
fence_message_id INTEGER NOT NULL,
|
|
35
|
-
updated_at TEXT NOT NULL
|
|
36
|
-
)
|
|
37
|
-
`);
|
|
38
|
-
}
|
|
39
|
-
// ─── Fence Operations ───────────────────────────────────────────
|
|
40
|
-
/**
|
|
41
|
-
* Update the compaction fence for a conversation.
|
|
42
|
-
*
|
|
43
|
-
* Called by the compositor after assembling context, passing the ID of
|
|
44
|
-
* the oldest message that was included in the composed history.
|
|
45
|
-
*
|
|
46
|
-
* The fence only moves forward (monotone progress). If the new fence
|
|
47
|
-
* is lower than the existing one, the update is silently ignored.
|
|
48
|
-
* This prevents a short compose window from accidentally exposing
|
|
49
|
-
* already-compacted messages.
|
|
50
|
-
*/
|
|
51
|
-
export function updateCompactionFence(db, conversationId, oldestVisibleMessageId, opts = {}) {
|
|
52
|
-
const now = new Date().toISOString();
|
|
53
|
-
const minTailMessages = typeof opts.minTailMessages === 'number' && Number.isFinite(opts.minTailMessages)
|
|
54
|
-
? Math.max(1, Math.floor(opts.minTailMessages))
|
|
55
|
-
: undefined;
|
|
56
|
-
const oldestRecentRow = minTailMessages != null
|
|
57
|
-
? db.prepare(`
|
|
58
|
-
SELECT id FROM messages
|
|
59
|
-
WHERE conversation_id = ?
|
|
60
|
-
AND role != 'system'
|
|
61
|
-
ORDER BY message_index DESC
|
|
62
|
-
LIMIT 1 OFFSET ?
|
|
63
|
-
`).get(conversationId, minTailMessages - 1) ?? db.prepare(`
|
|
64
|
-
SELECT id FROM messages
|
|
65
|
-
WHERE conversation_id = ?
|
|
66
|
-
AND role != 'system'
|
|
67
|
-
ORDER BY message_index ASC
|
|
68
|
-
LIMIT 1
|
|
69
|
-
`).get(conversationId)
|
|
70
|
-
: undefined;
|
|
71
|
-
const clampedMessageId = oldestRecentRow
|
|
72
|
-
? Math.min(oldestVisibleMessageId, oldestRecentRow.id)
|
|
73
|
-
: oldestVisibleMessageId;
|
|
74
|
-
const existing = db.prepare('SELECT fence_message_id FROM compaction_fences WHERE conversation_id = ?').get(conversationId);
|
|
75
|
-
if (!existing) {
|
|
76
|
-
// First fence for this conversation
|
|
77
|
-
db.prepare('INSERT INTO compaction_fences (conversation_id, fence_message_id, updated_at) VALUES (?, ?, ?)').run(conversationId, clampedMessageId, now);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
// Monotone progress: fence only moves forward
|
|
81
|
-
if (clampedMessageId > existing.fence_message_id) {
|
|
82
|
-
db.prepare('UPDATE compaction_fences SET fence_message_id = ?, updated_at = ? WHERE conversation_id = ?').run(clampedMessageId, now, conversationId);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Get the current compaction fence for a conversation.
|
|
87
|
-
* Returns null if no fence has been set (meaning: no compaction allowed).
|
|
88
|
-
*/
|
|
89
|
-
export function getCompactionFence(db, conversationId) {
|
|
90
|
-
const row = db.prepare('SELECT conversation_id, fence_message_id, updated_at FROM compaction_fences WHERE conversation_id = ?').get(conversationId);
|
|
91
|
-
if (!row)
|
|
92
|
-
return null;
|
|
93
|
-
return {
|
|
94
|
-
conversationId: row.conversation_id,
|
|
95
|
-
fenceMessageId: row.fence_message_id,
|
|
96
|
-
updatedAt: row.updated_at,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Query compaction eligibility for a conversation.
|
|
101
|
-
*
|
|
102
|
-
* Returns the count and range of messages that are below the fence
|
|
103
|
-
* and therefore eligible for compaction. If no fence exists, returns
|
|
104
|
-
* zero eligible (safe default: no fence = no compaction).
|
|
105
|
-
*
|
|
106
|
-
* Excludes messages that are already covered by a summary
|
|
107
|
-
* (via the summary_messages junction table).
|
|
108
|
-
*/
|
|
109
|
-
export function getCompactionEligibility(db, conversationId) {
|
|
110
|
-
const fence = getCompactionFence(db, conversationId);
|
|
111
|
-
if (!fence) {
|
|
112
|
-
return {
|
|
113
|
-
conversationId,
|
|
114
|
-
eligibleCount: 0,
|
|
115
|
-
oldestEligibleId: null,
|
|
116
|
-
newestEligibleId: null,
|
|
117
|
-
fence: null,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
// Messages below the fence that haven't been summarized yet
|
|
121
|
-
const stats = db.prepare(`
|
|
122
|
-
SELECT
|
|
123
|
-
COUNT(*) AS cnt,
|
|
124
|
-
MIN(m.id) AS oldest_id,
|
|
125
|
-
MAX(m.id) AS newest_id
|
|
126
|
-
FROM messages m
|
|
127
|
-
WHERE m.conversation_id = ?
|
|
128
|
-
AND m.id < ?
|
|
129
|
-
AND m.id NOT IN (
|
|
130
|
-
SELECT sm.message_id FROM summary_messages sm
|
|
131
|
-
JOIN summaries s ON sm.summary_id = s.id
|
|
132
|
-
WHERE s.conversation_id = ?
|
|
133
|
-
)
|
|
134
|
-
`).get(conversationId, fence.fenceMessageId, conversationId);
|
|
135
|
-
return {
|
|
136
|
-
conversationId,
|
|
137
|
-
eligibleCount: stats.cnt,
|
|
138
|
-
oldestEligibleId: stats.oldest_id,
|
|
139
|
-
newestEligibleId: stats.newest_id,
|
|
140
|
-
fence,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get messages eligible for compaction (below the fence, not yet summarized).
|
|
145
|
-
*
|
|
146
|
-
* Returns messages in chronological order, ready for clustering.
|
|
147
|
-
* Respects the fence boundary and excludes already-summarized messages.
|
|
148
|
-
*/
|
|
149
|
-
export function getCompactableMessages(db, conversationId, limit = 100) {
|
|
150
|
-
const fence = getCompactionFence(db, conversationId);
|
|
151
|
-
if (!fence)
|
|
152
|
-
return [];
|
|
153
|
-
const rows = db.prepare(`
|
|
154
|
-
SELECT m.id, m.role, m.text_content, m.created_at
|
|
155
|
-
FROM messages m
|
|
156
|
-
WHERE m.conversation_id = ?
|
|
157
|
-
AND m.id < ?
|
|
158
|
-
AND m.text_content IS NOT NULL
|
|
159
|
-
AND m.id NOT IN (
|
|
160
|
-
SELECT sm.message_id FROM summary_messages sm
|
|
161
|
-
JOIN summaries s ON sm.summary_id = s.id
|
|
162
|
-
WHERE s.conversation_id = ?
|
|
163
|
-
)
|
|
164
|
-
ORDER BY m.id ASC
|
|
165
|
-
LIMIT ?
|
|
166
|
-
`).all(conversationId, fence.fenceMessageId, conversationId, limit);
|
|
167
|
-
return rows.map(r => ({
|
|
168
|
-
id: r.id,
|
|
169
|
-
role: r.role,
|
|
170
|
-
textContent: r.text_content,
|
|
171
|
-
createdAt: r.created_at,
|
|
172
|
-
}));
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=compaction-fence.js.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* compositor-utils.ts — Utility functions for context window composition.
|
|
3
|
-
*
|
|
4
|
-
* Provides ordering strategies that improve LLM attention over retrieved
|
|
5
|
-
* documents placed into a prompt.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Reorder documents using zigzag placement to mitigate
|
|
9
|
-
* "Lost in the Middle" attention degradation in LLMs.
|
|
10
|
-
*
|
|
11
|
-
* LLMs exhibit a U-shaped attention curve: items at the beginning and end
|
|
12
|
-
* of context receive ~30% more attention than items in the middle.
|
|
13
|
-
* This function places the most relevant items at the edges and the least
|
|
14
|
-
* relevant items near the center, maximising effective attention on the
|
|
15
|
-
* information that matters most.
|
|
16
|
-
*
|
|
17
|
-
* Reference: Liu et al., "Lost in the Middle: How Language Models Use Long
|
|
18
|
-
* Contexts", ICLR 2025. https://arxiv.org/abs/2307.03172
|
|
19
|
-
*
|
|
20
|
-
* Input: [d1, d2, d3, d4, d5] (sorted by relevance, descending)
|
|
21
|
-
* Output: [d1, d3, d5, d4, d2] (most relevant at edges, least in middle)
|
|
22
|
-
*
|
|
23
|
-
* Algorithm:
|
|
24
|
-
* - Items at even positions in the input (0, 2, 4, …) fill from the front.
|
|
25
|
-
* - Items at odd positions in the input (1, 3, 5, …) fill from the back.
|
|
26
|
-
*
|
|
27
|
-
* @param docs - Array sorted by relevance (most relevant first).
|
|
28
|
-
* @returns A new array reordered so the most relevant items sit at the edges.
|
|
29
|
-
*/
|
|
30
|
-
export declare function zigzagOrder<T>(docs: T[]): T[];
|
|
31
|
-
//# sourceMappingURL=compositor-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compositor-utils.d.ts","sourceRoot":"","sources":["../src/compositor-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAkB7C"}
|
package/dist/compositor-utils.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* compositor-utils.ts — Utility functions for context window composition.
|
|
3
|
-
*
|
|
4
|
-
* Provides ordering strategies that improve LLM attention over retrieved
|
|
5
|
-
* documents placed into a prompt.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Reorder documents using zigzag placement to mitigate
|
|
9
|
-
* "Lost in the Middle" attention degradation in LLMs.
|
|
10
|
-
*
|
|
11
|
-
* LLMs exhibit a U-shaped attention curve: items at the beginning and end
|
|
12
|
-
* of context receive ~30% more attention than items in the middle.
|
|
13
|
-
* This function places the most relevant items at the edges and the least
|
|
14
|
-
* relevant items near the center, maximising effective attention on the
|
|
15
|
-
* information that matters most.
|
|
16
|
-
*
|
|
17
|
-
* Reference: Liu et al., "Lost in the Middle: How Language Models Use Long
|
|
18
|
-
* Contexts", ICLR 2025. https://arxiv.org/abs/2307.03172
|
|
19
|
-
*
|
|
20
|
-
* Input: [d1, d2, d3, d4, d5] (sorted by relevance, descending)
|
|
21
|
-
* Output: [d1, d3, d5, d4, d2] (most relevant at edges, least in middle)
|
|
22
|
-
*
|
|
23
|
-
* Algorithm:
|
|
24
|
-
* - Items at even positions in the input (0, 2, 4, …) fill from the front.
|
|
25
|
-
* - Items at odd positions in the input (1, 3, 5, …) fill from the back.
|
|
26
|
-
*
|
|
27
|
-
* @param docs - Array sorted by relevance (most relevant first).
|
|
28
|
-
* @returns A new array reordered so the most relevant items sit at the edges.
|
|
29
|
-
*/
|
|
30
|
-
export function zigzagOrder(docs) {
|
|
31
|
-
if (docs.length <= 2) {
|
|
32
|
-
return docs.slice();
|
|
33
|
-
}
|
|
34
|
-
const result = new Array(docs.length);
|
|
35
|
-
let front = 0;
|
|
36
|
-
let back = docs.length - 1;
|
|
37
|
-
for (let i = 0; i < docs.length; i++) {
|
|
38
|
-
if (i % 2 === 0) {
|
|
39
|
-
result[front++] = docs[i];
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
result[back--] = docs[i];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=compositor-utils.js.map
|
package/dist/compositor.d.ts
DELETED
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* hypermem Compositor
|
|
3
|
-
*
|
|
4
|
-
* Assembles context for LLM calls by orchestrating all four memory layers:
|
|
5
|
-
* L1 Redis — hot session working memory (system, identity, recent msgs)
|
|
6
|
-
* L2 Messages — conversation history from messages.db
|
|
7
|
-
* L3 Vectors — semantic search across all indexed content
|
|
8
|
-
* L4 Library — structured knowledge (facts, preferences, knowledge, episodes)
|
|
9
|
-
*
|
|
10
|
-
* Token-budgeted: never exceeds the budget, prioritizes by configured order.
|
|
11
|
-
* Provider-neutral internally, translates at the output boundary.
|
|
12
|
-
*/
|
|
13
|
-
import type { DatabaseSync } from 'node:sqlite';
|
|
14
|
-
import type { ComposeRequest, ComposeResult, NeutralMessage, CompositorConfig } from './types.js';
|
|
15
|
-
import { CollectionTrigger } from './trigger-registry.js';
|
|
16
|
-
import { CacheLayer } from './cache.js';
|
|
17
|
-
type AnyCache = CacheLayer;
|
|
18
|
-
import { VectorStore } from './vector-store.js';
|
|
19
|
-
import { type OrgRegistry } from './cross-agent.js';
|
|
20
|
-
import { type DegradationReason } from './degradation.js';
|
|
21
|
-
/**
|
|
22
|
-
* Files that OpenClaw's contextInjection injects into the system prompt.
|
|
23
|
-
* HyperMem must not re-inject these via doc chunk retrieval to avoid duplication.
|
|
24
|
-
* Exported so plugin and other consumers can share the same dedup set.
|
|
25
|
-
*/
|
|
26
|
-
export declare const OPENCLAW_BOOTSTRAP_FILES: Set<string>;
|
|
27
|
-
/**
|
|
28
|
-
* B4: Compute model-aware lane budget fractions.
|
|
29
|
-
*
|
|
30
|
-
* Resolves the effective historyFraction and memoryFraction for a compose pass
|
|
31
|
-
* given the model and its effective budget. Uses the MECW catalog to blend
|
|
32
|
-
* away from fixed fractions when the budget approaches the MECW ceiling,
|
|
33
|
-
* so the compositor allocates proportionally for what the model can actually use.
|
|
34
|
-
*
|
|
35
|
-
* Returns:
|
|
36
|
-
* historyFraction — fraction of effective budget to give history
|
|
37
|
-
* memoryFraction — fraction of effective budget to give memory pool
|
|
38
|
-
* mecwProfile — which MECW entry matched (undefined = no match / full window)
|
|
39
|
-
* mecwApplied — true when MECW adjustment changed the fractions
|
|
40
|
-
* mecwBlend — 0..1 blend factor (0 = below floor, 1 = at/above ceiling)
|
|
41
|
-
*/
|
|
42
|
-
export declare function resolveModelLaneBudgets(model: string | undefined, effectiveBudget: number, configHistoryFraction: number, configMemoryFraction: number): {
|
|
43
|
-
historyFraction: number;
|
|
44
|
-
memoryFraction: number;
|
|
45
|
-
mecwProfile: string | undefined;
|
|
46
|
-
mecwApplied: boolean;
|
|
47
|
-
mecwBlend: number;
|
|
48
|
-
};
|
|
49
|
-
/** Session classification labels — used for adaptive depth selection. */
|
|
50
|
-
export type SessionType = 'plain-chat' | 'tool-heavy';
|
|
51
|
-
/**
|
|
52
|
-
* Classify a session based on the ratio of tool messages in the recent sample.
|
|
53
|
-
* 'tool-heavy': >= 20% of sampled messages carry tool calls or tool results.
|
|
54
|
-
* 'plain-chat': below that threshold (text-only or occasional tool use).
|
|
55
|
-
*
|
|
56
|
-
* The 20% threshold is intentionally conservative: most tool-heavy agents
|
|
57
|
-
* have tool messages on every assistant turn, so the ratio quickly exceeds
|
|
58
|
-
* the threshold without false-positive risk for light tool users.
|
|
59
|
-
*/
|
|
60
|
-
export declare function classifySessionType(messages: NeutralMessage[]): SessionType;
|
|
61
|
-
/**
|
|
62
|
-
* Estimate the average token cost per message from a recent message sample.
|
|
63
|
-
* Uses the same estimateMessageTokens heuristic as the compositor budget walk
|
|
64
|
-
* so the returned depth is directly comparable to the historyFillCap check.
|
|
65
|
-
*
|
|
66
|
-
* Returns a conservative floor (100 tokens) when the sample is empty to avoid
|
|
67
|
-
* returning Infinity when historyBudget is divided by density.
|
|
68
|
-
*/
|
|
69
|
-
export declare function estimateObservedMsgDensity(messages: NeutralMessage[]): number;
|
|
70
|
-
/**
|
|
71
|
-
* Compute an adaptive history depth that pre-fits the session type.
|
|
72
|
-
*
|
|
73
|
-
* For plain-chat sessions: divides historyBudget by observed density to get a
|
|
74
|
-
* depth that fills the budget without overflow, bounded by the default maximum.
|
|
75
|
-
* Recall quality is preserved because the density estimate is honest for
|
|
76
|
-
* text-only turns.
|
|
77
|
-
*
|
|
78
|
-
* For tool-heavy sessions: applies a post-gradient compression factor
|
|
79
|
-
* (TOOL_GRADIENT_DENSITY_FACTOR = 0.30) to the observed pre-gradient density.
|
|
80
|
-
* This accounts for the gradient transform collapsing large tool payloads to
|
|
81
|
-
* prose stubs before the budget-fit walk runs. A tighter depth is chosen so
|
|
82
|
-
* the gradient-compressed messages fit inside historyFillCap without triggering
|
|
83
|
-
* a rescue trim.
|
|
84
|
-
*
|
|
85
|
-
* A 0.85 safety margin is applied to both paths so estimates that are
|
|
86
|
-
* slightly off don't cause immediate overflow on the first warm compose.
|
|
87
|
-
*
|
|
88
|
-
* Min/max bounds ensure the compositor always sees a meaningful window:
|
|
89
|
-
* - plain-chat min: 20 messages (enough for short recent context)
|
|
90
|
-
* - tool-heavy min: 15 messages (recent tool context + a few prior turns)
|
|
91
|
-
* - shared max: config.maxHistoryMessages (never exceed the DB fetch ceiling)
|
|
92
|
-
*/
|
|
93
|
-
export declare function computeAdaptiveHistoryDepth(sessionType: SessionType, observedDensity: number, historyBudgetTokens: number, maxHistoryMessages: number): number;
|
|
94
|
-
export { CollectionTrigger, DEFAULT_TRIGGERS, matchTriggers } from './trigger-registry.js';
|
|
95
|
-
export { getTurnAge, applyToolGradient, appendToolSummary, truncateWithHeadTail, applyTierPayloadCap, evictLargeToolResults };
|
|
96
|
-
/**
|
|
97
|
-
* Public reshape helper: apply tool gradient then trim to fit within a token budget.
|
|
98
|
-
*
|
|
99
|
-
* Used by the plugin's budget-downshift pass to pre-process a Redis history window
|
|
100
|
-
* after a model switch to a smaller context window, before the full compose pipeline
|
|
101
|
-
* runs. Trims from oldest to newest until estimated token cost fits within
|
|
102
|
-
* tokenBudget * 0.65 (using the standard char/4 heuristic).
|
|
103
|
-
*
|
|
104
|
-
* @param messages NeutralMessage array from the Redis hot window
|
|
105
|
-
* @param tokenBudget Effective token budget for this session
|
|
106
|
-
* @returns Trimmed message array ready for setWindow()
|
|
107
|
-
*/
|
|
108
|
-
export declare function applyToolGradientToWindow(messages: NeutralMessage[], tokenBudget: number, totalWindowTokens?: number): NeutralMessage[];
|
|
109
|
-
/**
|
|
110
|
-
* Canonical history must remain lossless for tool turns.
|
|
111
|
-
*
|
|
112
|
-
* If a window contains any structured tool calls or tool results, the caller
|
|
113
|
-
* should treat applyToolGradientToWindow() as a view-only transform for the
|
|
114
|
-
* current compose pass and avoid writing the reshaped messages back into the
|
|
115
|
-
* canonical cache/history store.
|
|
116
|
-
*/
|
|
117
|
-
export declare function canPersistReshapedHistory(messages: NeutralMessage[]): boolean;
|
|
118
|
-
declare function truncateWithHeadTail(content: string, maxChars: number, maxTailChars?: number): string;
|
|
119
|
-
declare function appendToolSummary(textContent: string | null, summary: string): string;
|
|
120
|
-
declare function getTurnAge(messages: NeutralMessage[], index: number): number;
|
|
121
|
-
declare function applyTierPayloadCap(msg: NeutralMessage, perResultCap: number, perTurnCap?: number, usedSoFar?: number, maxTailChars?: number): {
|
|
122
|
-
msg: NeutralMessage;
|
|
123
|
-
usedChars: number;
|
|
124
|
-
};
|
|
125
|
-
declare function evictLargeToolResults<T extends NeutralMessage>(messages: T[]): T[];
|
|
126
|
-
export declare function resolveArtifactOversizeThreshold(effectiveBudget: number): number;
|
|
127
|
-
/**
|
|
128
|
-
* C2: Degrade an oversized doc chunk to a canonical ArtifactRef string.
|
|
129
|
-
*
|
|
130
|
-
* When a retrieved chunk's content exceeds the oversize threshold (in tokens),
|
|
131
|
-
* replace it with a fetchable canonical reference instead of injecting raw content.
|
|
132
|
-
* This preserves headroom in the lane instead of filling it with a large payload.
|
|
133
|
-
*
|
|
134
|
-
* Returns:
|
|
135
|
-
* - `null` → content is within the threshold; caller should inject as-is.
|
|
136
|
-
* - `string` → canonical artifact reference; caller should inject this instead of raw content.
|
|
137
|
-
*
|
|
138
|
-
* The sizeTokens reported in the reference is the ACTUAL estimated size so downstream
|
|
139
|
-
* tooling can make informed decisions about whether to fetch.
|
|
140
|
-
*/
|
|
141
|
-
export declare function degradeOversizedDocChunk(chunkId: string, sourcePath: string, content: string, thresholdTokens: number): string | null;
|
|
142
|
-
/**
|
|
143
|
-
* C2: Resolve oversized artifacts in a history message array.
|
|
144
|
-
*
|
|
145
|
-
* Scans the message array and replaces user/assistant messages whose text content
|
|
146
|
-
* exceeds the model-aware artifact oversize threshold with canonical ArtifactRef
|
|
147
|
-
* strings. System messages, tool-call messages, and tool-result messages are always
|
|
148
|
-
* passed through unchanged.
|
|
149
|
-
*
|
|
150
|
-
* @param messages — neutral message array (already-assembled history window)
|
|
151
|
-
* @param effectiveBudget — effective model budget from B4 (drives the threshold)
|
|
152
|
-
* @returns { messages, refCount, tokensSaved }
|
|
153
|
-
*/
|
|
154
|
-
export declare function resolveOversizedArtifacts<T extends NeutralMessage>(messages: T[], effectiveBudget: number): {
|
|
155
|
-
messages: T[];
|
|
156
|
-
refCount: number;
|
|
157
|
-
tokensSaved: number;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Result of a single tool-chain ejection pass.
|
|
161
|
-
* Returned by resolveToolChainEjections so callers can accumulate telemetry.
|
|
162
|
-
*/
|
|
163
|
-
export interface ToolChainEjectionResult<T extends NeutralMessage> {
|
|
164
|
-
/** The transformed message array (may contain stubs in place of results). */
|
|
165
|
-
messages: T[];
|
|
166
|
-
/** Number of tool-result messages fully co-ejected (removed from the array). */
|
|
167
|
-
coEjections: number;
|
|
168
|
-
/** Number of tool-result payloads replaced with a canonical stub string. */
|
|
169
|
-
stubReplacements: number;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* C1: Centralized tool-chain dependency ejection.
|
|
173
|
-
*
|
|
174
|
-
* Given a set of tool-use message indices that are being ejected from the
|
|
175
|
-
* context window, this function ensures that no orphaned tool-results survive:
|
|
176
|
-
*
|
|
177
|
-
* - For each ejected assistant message carrying toolCalls, collect the set
|
|
178
|
-
* of call IDs being removed.
|
|
179
|
-
* - Walk the remaining messages: if a message's toolResults reference any
|
|
180
|
-
* of those ejected IDs:
|
|
181
|
-
* a) If the message carries ONLY tool-results and no other text, co-eject
|
|
182
|
-
* it (remove it entirely). This is the zero-cost path.
|
|
183
|
-
* b) If the message also carries text content, replace only the dependent
|
|
184
|
-
* toolResults entries with canonical ToolChainStub strings so the
|
|
185
|
-
* message is not silently mutilated.
|
|
186
|
-
*
|
|
187
|
-
* The caller is responsible for removing the ejected messages by index BEFORE
|
|
188
|
-
* or AFTER calling this function; this function operates on the full array and
|
|
189
|
-
* marks the ejected indices for removal, returning the cleaned result.
|
|
190
|
-
*
|
|
191
|
-
* @param messages Full message array (order preserved)
|
|
192
|
-
* @param ejectIndices Set of indices into `messages` that are being ejected
|
|
193
|
-
* (these are the tool-use / assistant messages being removed).
|
|
194
|
-
* @param reason DegradationReason to embed in any canonical stubs.
|
|
195
|
-
* @returns Cleaned message array + telemetry counters.
|
|
196
|
-
*/
|
|
197
|
-
export declare function resolveToolChainEjections<T extends NeutralMessage>(messages: T[], ejectIndices: Set<number>, reason?: DegradationReason): ToolChainEjectionResult<T>;
|
|
198
|
-
/**
|
|
199
|
-
* Apply gradient tool treatment to a message array.
|
|
200
|
-
*
|
|
201
|
-
* Tiers are based on turn age, where turn age is the number of newer user
|
|
202
|
-
* messages after the current message.
|
|
203
|
-
*/
|
|
204
|
-
declare function applyToolGradient<T extends NeutralMessage>(messages: T[], opts?: {
|
|
205
|
-
totalWindowTokens?: number;
|
|
206
|
-
}): T[];
|
|
207
|
-
export interface CompositorDeps {
|
|
208
|
-
cache: AnyCache;
|
|
209
|
-
vectorStore?: VectorStore | null;
|
|
210
|
-
libraryDb?: DatabaseSync | null;
|
|
211
|
-
/** Custom trigger registry; defaults to DEFAULT_TRIGGERS if not provided */
|
|
212
|
-
triggerRegistry?: CollectionTrigger[];
|
|
213
|
-
}
|
|
214
|
-
export declare class Compositor {
|
|
215
|
-
private readonly config;
|
|
216
|
-
private readonly cache;
|
|
217
|
-
private vectorStore;
|
|
218
|
-
private readonly libraryDb;
|
|
219
|
-
private readonly triggerRegistry;
|
|
220
|
-
/** Cached org registry loaded from fleet_agents at construction time. */
|
|
221
|
-
private _orgRegistry;
|
|
222
|
-
constructor(deps: CompositorDeps, config?: Partial<CompositorConfig>);
|
|
223
|
-
/**
|
|
224
|
-
* Set or replace the vector store after construction.
|
|
225
|
-
* Called by hypermem.create() once sqlite-vec is confirmed available.
|
|
226
|
-
*/
|
|
227
|
-
setVectorStore(vs: VectorStore): void;
|
|
228
|
-
/**
|
|
229
|
-
* Hot-reload the org registry from the fleet_agents table.
|
|
230
|
-
* Call after fleet membership changes (new agent, org restructure)
|
|
231
|
-
* to pick up the latest without a full restart.
|
|
232
|
-
* Falls back to the current cached registry if the DB is unavailable.
|
|
233
|
-
*/
|
|
234
|
-
refreshOrgRegistry(): OrgRegistry;
|
|
235
|
-
/**
|
|
236
|
-
* Return the currently cached org registry.
|
|
237
|
-
*/
|
|
238
|
-
get orgRegistry(): OrgRegistry;
|
|
239
|
-
/**
|
|
240
|
-
* Sprint 2.1: Hydrate tool-artifact stubs in the active turn.
|
|
241
|
-
*
|
|
242
|
-
* The active turn is the contiguous trailing block of tool-bearing messages
|
|
243
|
-
* at the tail of the assembled window (positional, NOT turn_id-based):
|
|
244
|
-
* - Walk backward from the last message
|
|
245
|
-
* - Collect tool-bearing messages (toolCalls != null OR toolResults != null)
|
|
246
|
-
* - Plus the bounding user message that opened the turn
|
|
247
|
-
* - Stop at the first plain message once at least one tool message was found
|
|
248
|
-
*
|
|
249
|
-
* For every toolResult stub with an `artifact=<id>` pointer, look up the
|
|
250
|
-
* full payload in ToolArtifactStore and replace the stub content in-place.
|
|
251
|
-
* Uses a single batched `WHERE id IN (...)` lookup (no N+1 queries).
|
|
252
|
-
* Touches `last_used_at` on every hydrated artifact in a single batch.
|
|
253
|
-
*
|
|
254
|
-
* Failure mode: if a lookup returns null (artifact missing), leave the stub
|
|
255
|
-
* unchanged and increment hydrationMisses.
|
|
256
|
-
*
|
|
257
|
-
* Returns diagnostics counters.
|
|
258
|
-
*/
|
|
259
|
-
private hydrateActiveTurnArtifacts;
|
|
260
|
-
/**
|
|
261
|
-
* Compose a complete message array for sending to an LLM.
|
|
262
|
-
*
|
|
263
|
-
* Orchestrates all four memory layers:
|
|
264
|
-
* 1. System prompt + identity (never truncated)
|
|
265
|
-
* 2. Conversation history (L1 Redis → L2 messages.db)
|
|
266
|
-
* 3. Active facts from library (L4)
|
|
267
|
-
* 4. Knowledge entries relevant to conversation (L4)
|
|
268
|
-
* 5. User preferences (L4)
|
|
269
|
-
* 6. Semantic recall via vector search (L3)
|
|
270
|
-
* 7. Cross-session context (L2)
|
|
271
|
-
*
|
|
272
|
-
* Each slot respects the remaining token budget.
|
|
273
|
-
*/
|
|
274
|
-
compose(request: ComposeRequest, db: DatabaseSync, libraryDb?: DatabaseSync): Promise<ComposeResult>;
|
|
275
|
-
/**
|
|
276
|
-
* Warm a session from SQLite into Redis.
|
|
277
|
-
* Called on session start or Redis cache miss.
|
|
278
|
-
*/
|
|
279
|
-
warmSession(agentId: string, sessionKey: string, db: DatabaseSync, opts?: {
|
|
280
|
-
systemPrompt?: string;
|
|
281
|
-
identity?: string;
|
|
282
|
-
libraryDb?: DatabaseSync;
|
|
283
|
-
/** Model string for budget resolution. If omitted, falls back to defaultTokenBudget. */
|
|
284
|
-
model?: string;
|
|
285
|
-
}): Promise<void>;
|
|
286
|
-
refreshRedisGradient(agentId: string, sessionKey: string, db: DatabaseSync, tokenBudget?: number, historyDepth?: number): Promise<void>;
|
|
287
|
-
/**
|
|
288
|
-
* Get slot content: try Redis first, fall back to SQLite.
|
|
289
|
-
*/
|
|
290
|
-
private getSlotContent;
|
|
291
|
-
/**
|
|
292
|
-
* Get conversation history: try Redis first, fall back to SQLite.
|
|
293
|
-
*
|
|
294
|
-
* When topicId is provided (P3.4), the SQLite path filters to messages
|
|
295
|
-
* matching that topic OR with topic_id IS NULL (Option B transition safety).
|
|
296
|
-
* The Redis path is unaffected — Redis doesn't index by topic, so topic
|
|
297
|
-
* filtering only applies to the SQLite fallback.
|
|
298
|
-
*/
|
|
299
|
-
private getHistory;
|
|
300
|
-
/**
|
|
301
|
-
* Build facts content from library DB.
|
|
302
|
-
*/
|
|
303
|
-
/**
|
|
304
|
-
* Build facts content from library DB.
|
|
305
|
-
* Applies filterByScope (W1) to enforce retrieval access control.
|
|
306
|
-
* Returns [content, factCount, scopeFilteredCount] or null if DB unavailable.
|
|
307
|
-
*/
|
|
308
|
-
private buildFactsFromDb;
|
|
309
|
-
private buildFactSectionsFromDb;
|
|
310
|
-
/**
|
|
311
|
-
* Build knowledge content from library DB.
|
|
312
|
-
* Prioritizes high-confidence, non-superseded entries.
|
|
313
|
-
*/
|
|
314
|
-
private buildKnowledgeFromDb;
|
|
315
|
-
/**
|
|
316
|
-
* Build wiki page context for the active topic.
|
|
317
|
-
* Queries the knowledge table for a synthesized topic page and returns it
|
|
318
|
-
* wrapped with a header. Capped at 600 tokens.
|
|
319
|
-
*/
|
|
320
|
-
private buildWikiPageContext;
|
|
321
|
-
/**
|
|
322
|
-
* Build preferences content from library DB.
|
|
323
|
-
* Shows user/operator preferences relevant to this agent.
|
|
324
|
-
*/
|
|
325
|
-
private buildPreferencesFromDb;
|
|
326
|
-
/**
|
|
327
|
-
* Build semantic recall content using hybrid FTS5+KNN retrieval.
|
|
328
|
-
*
|
|
329
|
-
* Uses Reciprocal Rank Fusion to merge keyword and vector results.
|
|
330
|
-
* Gracefully degrades: FTS5-only when no vector store, KNN-only
|
|
331
|
-
* when FTS query is empty (all stop words), both when available.
|
|
332
|
-
*
|
|
333
|
-
* @param precomputedEmbedding — optional pre-computed embedding for the query.
|
|
334
|
-
* When provided, the Ollama call inside VectorStore.search() is skipped.
|
|
335
|
-
*/
|
|
336
|
-
private buildSemanticRecall;
|
|
337
|
-
/**
|
|
338
|
-
* Format a hybrid search result for injection into context.
|
|
339
|
-
* Shows retrieval source(s) and relevance score.
|
|
340
|
-
*/
|
|
341
|
-
private formatHybridResult;
|
|
342
|
-
/**
|
|
343
|
-
* Format a vector-only search result (legacy fallback).
|
|
344
|
-
*/
|
|
345
|
-
private formatVectorResult;
|
|
346
|
-
/**
|
|
347
|
-
* Build cross-session context by finding recent activity
|
|
348
|
-
* in other sessions for this agent.
|
|
349
|
-
*/
|
|
350
|
-
private buildCrossSessionContext;
|
|
351
|
-
/**
|
|
352
|
-
* Extract the last user message text from the composed messages.
|
|
353
|
-
*/
|
|
354
|
-
private getLastUserMessage;
|
|
355
|
-
/**
|
|
356
|
-
* Truncate text to approximately fit within a token budget.
|
|
357
|
-
* Truncates at line boundaries when possible.
|
|
358
|
-
*/
|
|
359
|
-
private truncateToTokens;
|
|
360
|
-
/**
|
|
361
|
-
* Query and score keystone candidates from before the current history window.
|
|
362
|
-
*
|
|
363
|
-
* Trims the oldest messages from includedHistory to free a keystone budget,
|
|
364
|
-
* then queries the DB for older messages scored by episode significance,
|
|
365
|
-
* FTS5 relevance, and recency.
|
|
366
|
-
*
|
|
367
|
-
* Returns null if keystones cannot be injected (no cutoff ID found,
|
|
368
|
-
* no candidates, or all errors).
|
|
369
|
-
*/
|
|
370
|
-
private buildKeystones;
|
|
371
|
-
/**
|
|
372
|
-
* Pull high-signal messages from OTHER topics in this session when their
|
|
373
|
-
* content is semantically relevant to the current active topic.
|
|
374
|
-
*
|
|
375
|
-
* Heuristic-only: no model calls. Token overlap between the current topic
|
|
376
|
-
* name + last 3 user messages and candidate message content.
|
|
377
|
-
*
|
|
378
|
-
* @param agentId - The agent's ID
|
|
379
|
-
* @param sessionKey - Current session key
|
|
380
|
-
* @param activeTopic - The current active topic (id + name)
|
|
381
|
-
* @param currentMessages - Recently included history messages for query extraction
|
|
382
|
-
* @param db - The messages database
|
|
383
|
-
* @param maxKeystones - Max cross-topic keystones to return (default 3)
|
|
384
|
-
* @returns Scored keystones sorted by score DESC, deduplicated by message id
|
|
385
|
-
*/
|
|
386
|
-
private getKeystonesByTopic;
|
|
387
|
-
/**
|
|
388
|
-
* Extract lowercase key terms from a topic name and the last 3 user messages.
|
|
389
|
-
* Terms are: tokens with ≥4 characters (skip short stop words).
|
|
390
|
-
* Returns a Set for O(1) lookup.
|
|
391
|
-
*/
|
|
392
|
-
private extractQueryTerms;
|
|
393
|
-
}
|
|
394
|
-
//# sourceMappingURL=compositor.d.ts.map
|
package/dist/compositor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compositor.d.ts","sourceRoot":"","sources":["../src/compositor.ts"],"names":[],"mappings":"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"}
|