@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/reranker.js
DELETED
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* hypermem Reranker
|
|
3
|
-
*
|
|
4
|
-
* Pluggable reranking interface with circuit-breaker protection and graceful
|
|
5
|
-
* degradation. Callers that receive null fall back to the original document
|
|
6
|
-
* order without disruption.
|
|
7
|
-
*
|
|
8
|
-
* Providers:
|
|
9
|
-
* - ZeroEntropyReranker — https://api.zeroentropy.dev/v1/rerank (zerank-2)
|
|
10
|
-
* - OpenRouterReranker — https://openrouter.ai/api/v1/rerank (cohere/rerank-4-pro)
|
|
11
|
-
* - OllamaReranker — http://localhost:11434/api/chat (yes/no classification)
|
|
12
|
-
*
|
|
13
|
-
* API key resolution order (per provider):
|
|
14
|
-
* zeroentropy: config.zeroEntropyApiKey → ZEROENTROPY_API_KEY env var
|
|
15
|
-
* openrouter: config.openrouterApiKey → OPENROUTER_API_KEY env var
|
|
16
|
-
*/
|
|
17
|
-
// ── Circuit Breaker ───────────────────────────────────────────────────────────
|
|
18
|
-
/** Number of consecutive failures before the circuit opens. */
|
|
19
|
-
const CIRCUIT_FAILURE_THRESHOLD = 3;
|
|
20
|
-
/** How long the circuit stays open after tripping (ms). */
|
|
21
|
-
const CIRCUIT_DISABLE_DURATION_MS = 60_000;
|
|
22
|
-
/**
|
|
23
|
-
* CircuitBreaker protects a provider from repeated calls during sustained
|
|
24
|
-
* failures.
|
|
25
|
-
*
|
|
26
|
-
* State machine:
|
|
27
|
-
* CLOSED — normal operation; failures increment the counter.
|
|
28
|
-
* OPEN — provider disabled; isOpen() returns true for DISABLE_DURATION.
|
|
29
|
-
* HALF-OPEN — one probe allowed after the disable window expires;
|
|
30
|
-
* success resets the counter, failure re-opens the circuit.
|
|
31
|
-
*
|
|
32
|
-
* Transition: CLOSED → OPEN when consecutiveFailures >= FAILURE_THRESHOLD.
|
|
33
|
-
* Transition: OPEN → HALF-OPEN when Date.now() >= disabledUntil.
|
|
34
|
-
* Transition: HALF-OPEN → CLOSED on recordSuccess().
|
|
35
|
-
* Transition: HALF-OPEN → OPEN on recordFailure() (reset window starts fresh).
|
|
36
|
-
*/
|
|
37
|
-
class CircuitBreaker {
|
|
38
|
-
/** Consecutive failures since last success. Reset to 0 on any success. */
|
|
39
|
-
consecutiveFailures = 0;
|
|
40
|
-
/**
|
|
41
|
-
* Epoch ms after which the circuit allows a probe.
|
|
42
|
-
* 0 means the circuit is CLOSED (not disabled).
|
|
43
|
-
*/
|
|
44
|
-
disabledUntil = 0;
|
|
45
|
-
/** Returns true when the provider should be skipped. */
|
|
46
|
-
isOpen() {
|
|
47
|
-
if (this.disabledUntil === 0)
|
|
48
|
-
return false; // CLOSED
|
|
49
|
-
if (Date.now() >= this.disabledUntil) {
|
|
50
|
-
// Disable window expired — transition to HALF-OPEN: allow one probe.
|
|
51
|
-
// We clear disabledUntil here so the next call goes through.
|
|
52
|
-
// If it fails, recordFailure() re-opens the circuit with a fresh window.
|
|
53
|
-
this.disabledUntil = 0;
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
return true; // OPEN
|
|
57
|
-
}
|
|
58
|
-
/** Call on a successful provider response. Resets all failure state. */
|
|
59
|
-
recordSuccess() {
|
|
60
|
-
this.consecutiveFailures = 0;
|
|
61
|
-
this.disabledUntil = 0;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Call on any provider failure (non-2xx, timeout, parse error, etc.).
|
|
65
|
-
* After CIRCUIT_FAILURE_THRESHOLD consecutive failures, opens the circuit
|
|
66
|
-
* for CIRCUIT_DISABLE_DURATION_MS milliseconds.
|
|
67
|
-
*/
|
|
68
|
-
recordFailure() {
|
|
69
|
-
this.consecutiveFailures += 1;
|
|
70
|
-
if (this.consecutiveFailures >= CIRCUIT_FAILURE_THRESHOLD) {
|
|
71
|
-
// Trip the circuit — disable for the configured window.
|
|
72
|
-
// Reset consecutiveFailures so the probe after the window isn't
|
|
73
|
-
// pre-tripped by the old count.
|
|
74
|
-
this.disabledUntil = Date.now() + CIRCUIT_DISABLE_DURATION_MS;
|
|
75
|
-
this.consecutiveFailures = 0;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
80
|
-
/** Returns an AbortController that fires after `ms` and a cleanup handle. */
|
|
81
|
-
function withTimeout(ms) {
|
|
82
|
-
const controller = new AbortController();
|
|
83
|
-
const id = setTimeout(() => controller.abort(), ms);
|
|
84
|
-
return { controller, clear: () => clearTimeout(id) };
|
|
85
|
-
}
|
|
86
|
-
// ── ZeroEntropyReranker ───────────────────────────────────────────────────────
|
|
87
|
-
export class ZeroEntropyReranker {
|
|
88
|
-
name = 'zeroentropy';
|
|
89
|
-
circuit = new CircuitBreaker();
|
|
90
|
-
apiKey;
|
|
91
|
-
model;
|
|
92
|
-
timeoutMs;
|
|
93
|
-
constructor(apiKey, model = 'zerank-2', timeoutMs = 2000) {
|
|
94
|
-
this.apiKey = apiKey;
|
|
95
|
-
this.model = model;
|
|
96
|
-
this.timeoutMs = timeoutMs;
|
|
97
|
-
}
|
|
98
|
-
async rerank(query, documents, topK = 10) {
|
|
99
|
-
if (this.circuit.isOpen())
|
|
100
|
-
return null;
|
|
101
|
-
const { controller, clear } = withTimeout(this.timeoutMs);
|
|
102
|
-
try {
|
|
103
|
-
const response = await fetch('https://api.zeroentropy.dev/v1/rerank', {
|
|
104
|
-
method: 'POST',
|
|
105
|
-
headers: {
|
|
106
|
-
'Content-Type': 'application/json',
|
|
107
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
108
|
-
},
|
|
109
|
-
body: JSON.stringify({ query, documents, model: this.model, top_n: topK }),
|
|
110
|
-
signal: controller.signal,
|
|
111
|
-
});
|
|
112
|
-
clear();
|
|
113
|
-
if (!response.ok) {
|
|
114
|
-
this.circuit.recordFailure();
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
const data = (await response.json());
|
|
118
|
-
if (!Array.isArray(data.results)) {
|
|
119
|
-
this.circuit.recordFailure();
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
this.circuit.recordSuccess();
|
|
123
|
-
return data.results.map((r) => {
|
|
124
|
-
const score = r.score ?? r.relevance_score ?? 0;
|
|
125
|
-
const content = resolveDocumentText(r.content, r.document, documents[r.index]);
|
|
126
|
-
return { index: r.index, score, content };
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
catch {
|
|
130
|
-
clear();
|
|
131
|
-
this.circuit.recordFailure();
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
// ── OpenRouterReranker ────────────────────────────────────────────────────────
|
|
137
|
-
export class OpenRouterReranker {
|
|
138
|
-
name = 'openrouter';
|
|
139
|
-
circuit = new CircuitBreaker();
|
|
140
|
-
apiKey;
|
|
141
|
-
model;
|
|
142
|
-
timeoutMs;
|
|
143
|
-
constructor(apiKey, model = 'cohere/rerank-4-pro', timeoutMs = 2000) {
|
|
144
|
-
this.apiKey = apiKey;
|
|
145
|
-
this.model = model;
|
|
146
|
-
this.timeoutMs = timeoutMs;
|
|
147
|
-
}
|
|
148
|
-
async rerank(query, documents, topK = 10) {
|
|
149
|
-
if (this.circuit.isOpen())
|
|
150
|
-
return null;
|
|
151
|
-
const { controller, clear } = withTimeout(this.timeoutMs);
|
|
152
|
-
try {
|
|
153
|
-
const response = await fetch('https://openrouter.ai/api/v1/rerank', {
|
|
154
|
-
method: 'POST',
|
|
155
|
-
headers: {
|
|
156
|
-
'Content-Type': 'application/json',
|
|
157
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
158
|
-
},
|
|
159
|
-
body: JSON.stringify({ query, documents, model: this.model, top_n: topK }),
|
|
160
|
-
signal: controller.signal,
|
|
161
|
-
});
|
|
162
|
-
clear();
|
|
163
|
-
if (!response.ok) {
|
|
164
|
-
this.circuit.recordFailure();
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
const data = (await response.json());
|
|
168
|
-
if (!Array.isArray(data.results)) {
|
|
169
|
-
this.circuit.recordFailure();
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
172
|
-
this.circuit.recordSuccess();
|
|
173
|
-
return data.results.map((r) => {
|
|
174
|
-
const score = r.relevance_score ?? r.score ?? 0;
|
|
175
|
-
const content = resolveDocumentText(undefined, r.document, documents[r.index]);
|
|
176
|
-
return { index: r.index, score, content };
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
catch {
|
|
180
|
-
clear();
|
|
181
|
-
this.circuit.recordFailure();
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// ── OllamaReranker ────────────────────────────────────────────────────────────
|
|
187
|
-
const OLLAMA_SYSTEM_PROMPT = 'Judge whether the Document meets the requirements based on the Query and the Instruct provided. ' +
|
|
188
|
-
'Note that the answer can only be "yes" or "no".';
|
|
189
|
-
export class OllamaReranker {
|
|
190
|
-
name = 'ollama';
|
|
191
|
-
circuit = new CircuitBreaker();
|
|
192
|
-
baseUrl;
|
|
193
|
-
model;
|
|
194
|
-
timeoutMs;
|
|
195
|
-
constructor(baseUrl = 'http://localhost:11434', model = 'dengcao/Qwen3-Reranker-0.6B:Q5_K_M', timeoutMs = 10_000) {
|
|
196
|
-
this.baseUrl = baseUrl.replace(/\/$/, '');
|
|
197
|
-
this.model = model;
|
|
198
|
-
this.timeoutMs = timeoutMs;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Scores documents sequentially — one chat call per document.
|
|
202
|
-
* The Qwen3-Reranker-0.6B model responds with "yes" (relevant) or "no".
|
|
203
|
-
* Score: yes → 1.0, anything else → 0.0.
|
|
204
|
-
*
|
|
205
|
-
* Sequential iteration is required because Ollama's /api/chat is stateless
|
|
206
|
-
* per-request and running calls in parallel would overload a local GPU.
|
|
207
|
-
* Returns null on the first failure to preserve circuit breaker semantics.
|
|
208
|
-
*/
|
|
209
|
-
async rerank(query, documents, topK = 10) {
|
|
210
|
-
if (this.circuit.isOpen())
|
|
211
|
-
return null;
|
|
212
|
-
const scored = [];
|
|
213
|
-
for (let i = 0; i < documents.length; i++) {
|
|
214
|
-
const doc = documents[i];
|
|
215
|
-
const userContent = `Instruct: Given a query, retrieve relevant passages that answer the query\n\n` +
|
|
216
|
-
`Query: ${query}\n\nDocument: ${doc}`;
|
|
217
|
-
const { controller, clear } = withTimeout(this.timeoutMs);
|
|
218
|
-
try {
|
|
219
|
-
const response = await fetch(`${this.baseUrl}/api/chat`, {
|
|
220
|
-
method: 'POST',
|
|
221
|
-
headers: { 'Content-Type': 'application/json' },
|
|
222
|
-
body: JSON.stringify({
|
|
223
|
-
model: this.model,
|
|
224
|
-
messages: [
|
|
225
|
-
{ role: 'system', content: OLLAMA_SYSTEM_PROMPT },
|
|
226
|
-
{ role: 'user', content: userContent },
|
|
227
|
-
],
|
|
228
|
-
stream: false,
|
|
229
|
-
}),
|
|
230
|
-
signal: controller.signal,
|
|
231
|
-
});
|
|
232
|
-
clear();
|
|
233
|
-
if (!response.ok) {
|
|
234
|
-
this.circuit.recordFailure();
|
|
235
|
-
return null;
|
|
236
|
-
}
|
|
237
|
-
const data = (await response.json());
|
|
238
|
-
const answer = (data.message?.content ?? '').trim().toLowerCase();
|
|
239
|
-
// "yes" prefix → relevant; anything else (including "no") → not relevant
|
|
240
|
-
const score = answer.startsWith('yes') ? 1.0 : 0.0;
|
|
241
|
-
scored.push({ index: i, score, content: doc });
|
|
242
|
-
}
|
|
243
|
-
catch {
|
|
244
|
-
clear();
|
|
245
|
-
this.circuit.recordFailure();
|
|
246
|
-
return null;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
this.circuit.recordSuccess();
|
|
250
|
-
// Sort by score descending and return top-K
|
|
251
|
-
scored.sort((a, b) => b.score - a.score);
|
|
252
|
-
return scored.slice(0, topK);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
// ── Factory ───────────────────────────────────────────────────────────────────
|
|
256
|
-
/**
|
|
257
|
-
* Creates a RerankerProvider from the supplied config.
|
|
258
|
-
*
|
|
259
|
-
* API key resolution order:
|
|
260
|
-
* zeroentropy: config.zeroEntropyApiKey → ZEROENTROPY_API_KEY env var
|
|
261
|
-
* openrouter: config.openrouterApiKey → OPENROUTER_API_KEY env var
|
|
262
|
-
*
|
|
263
|
-
* Returns null when:
|
|
264
|
-
* - provider is 'none'
|
|
265
|
-
* - provider is 'zeroentropy' and no key found in config or env
|
|
266
|
-
* - provider is 'openrouter' and no key found in config or env
|
|
267
|
-
*
|
|
268
|
-
* 'local' (Ollama) never returns null from the factory — it has no required
|
|
269
|
-
* API key. The provider itself returns null on runtime failure.
|
|
270
|
-
*/
|
|
271
|
-
export function createReranker(config) {
|
|
272
|
-
switch (config.provider) {
|
|
273
|
-
case 'none':
|
|
274
|
-
return null;
|
|
275
|
-
case 'zeroentropy': {
|
|
276
|
-
const apiKey = config.zeroEntropyApiKey ?? process.env['ZEROENTROPY_API_KEY'];
|
|
277
|
-
if (!apiKey)
|
|
278
|
-
return null;
|
|
279
|
-
return new ZeroEntropyReranker(apiKey, config.zeroEntropyModel ?? 'zerank-2', config.timeoutMs);
|
|
280
|
-
}
|
|
281
|
-
case 'openrouter': {
|
|
282
|
-
const apiKey = config.openrouterApiKey ?? process.env['OPENROUTER_API_KEY'];
|
|
283
|
-
if (!apiKey)
|
|
284
|
-
return null;
|
|
285
|
-
return new OpenRouterReranker(apiKey, config.openrouterModel ?? 'cohere/rerank-4-pro', config.timeoutMs);
|
|
286
|
-
}
|
|
287
|
-
case 'local': {
|
|
288
|
-
return new OllamaReranker(config.ollamaUrl ?? 'http://localhost:11434', config.ollamaModel ?? 'dengcao/Qwen3-Reranker-0.6B:Q5_K_M', config.timeoutMs);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
// ── Private Helpers ───────────────────────────────────────────────────────────
|
|
293
|
-
/**
|
|
294
|
-
* Resolves the document text from a reranking API response.
|
|
295
|
-
* Preference order: explicit `content` string → `document` string →
|
|
296
|
-
* `document.text` string → original document from the input array.
|
|
297
|
-
*/
|
|
298
|
-
function resolveDocumentText(content, document, fallback) {
|
|
299
|
-
if (typeof content === 'string')
|
|
300
|
-
return content;
|
|
301
|
-
if (typeof document === 'string')
|
|
302
|
-
return document;
|
|
303
|
-
if (document !== null && typeof document === 'object' && typeof document.text === 'string') {
|
|
304
|
-
return document.text;
|
|
305
|
-
}
|
|
306
|
-
return fallback ?? '';
|
|
307
|
-
}
|
|
308
|
-
//# sourceMappingURL=reranker.js.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* hypermem Retrieval Policy
|
|
3
|
-
*
|
|
4
|
-
* Single enforced policy layer for scope-based access control during retrieval.
|
|
5
|
-
* Called by the compositor to filter items before they are injected into context.
|
|
6
|
-
*
|
|
7
|
-
* Scope rules:
|
|
8
|
-
* 'agent' (default / null / undefined): allowed if agentId matches OR is null/undefined (global)
|
|
9
|
-
* 'session': allowed if both agentId AND sessionKey match
|
|
10
|
-
* 'user': allowed if agentId matches
|
|
11
|
-
* 'global': always allowed
|
|
12
|
-
* any other value: denied with reason 'ambiguous_scope'
|
|
13
|
-
*/
|
|
14
|
-
export type RetrievalScope = 'agent' | 'session' | 'user' | 'global';
|
|
15
|
-
export interface RetrievalContext {
|
|
16
|
-
agentId: string;
|
|
17
|
-
sessionKey: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ScopeCheckResult {
|
|
20
|
-
allowed: boolean;
|
|
21
|
-
/** One of: 'allowed' | 'scope_filtered' | 'ambiguous_scope' */
|
|
22
|
-
reason: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Check whether a single item is accessible in the given retrieval context.
|
|
26
|
-
*
|
|
27
|
-
* @param itemScope The scope stored on the item (null/undefined → defaults to 'agent')
|
|
28
|
-
* @param itemAgentId The agentId stored on the item (null/undefined → global)
|
|
29
|
-
* @param itemSessionKey The sessionKey stored on the item (null/undefined → any)
|
|
30
|
-
* @param ctx The requester's retrieval context
|
|
31
|
-
*/
|
|
32
|
-
export declare function checkScope(itemScope: string | null | undefined, itemAgentId: string | null | undefined, itemSessionKey: string | null | undefined, ctx: RetrievalContext): ScopeCheckResult;
|
|
33
|
-
/**
|
|
34
|
-
* Filter an array of items by scope, returning allowed items and a filtered count.
|
|
35
|
-
*
|
|
36
|
-
* Items are expected to have optional `agentId`, `sessionKey`, and `scope` fields.
|
|
37
|
-
* Null/undefined fields are treated as "unset" (permissive for their slot).
|
|
38
|
-
*
|
|
39
|
-
* @param items Array of items to filter
|
|
40
|
-
* @param ctx The requester's retrieval context
|
|
41
|
-
* @returns { allowed: T[], filteredCount: number }
|
|
42
|
-
*/
|
|
43
|
-
export declare function filterByScope<T extends {
|
|
44
|
-
agentId?: string | null;
|
|
45
|
-
sessionKey?: string | null;
|
|
46
|
-
scope?: string | null;
|
|
47
|
-
}>(items: T[], ctx: RetrievalContext): {
|
|
48
|
-
allowed: T[];
|
|
49
|
-
filteredCount: number;
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=retrieval-policy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retrieval-policy.d.ts","sourceRoot":"","sources":["../src/retrieval-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACtC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,GAAG,EAAE,gBAAgB,GACpB,gBAAgB,CAqClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS;IACtC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,EACC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,EAAE,gBAAgB,GACpB;IAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAczC"}
|
package/dist/retrieval-policy.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* hypermem Retrieval Policy
|
|
3
|
-
*
|
|
4
|
-
* Single enforced policy layer for scope-based access control during retrieval.
|
|
5
|
-
* Called by the compositor to filter items before they are injected into context.
|
|
6
|
-
*
|
|
7
|
-
* Scope rules:
|
|
8
|
-
* 'agent' (default / null / undefined): allowed if agentId matches OR is null/undefined (global)
|
|
9
|
-
* 'session': allowed if both agentId AND sessionKey match
|
|
10
|
-
* 'user': allowed if agentId matches
|
|
11
|
-
* 'global': always allowed
|
|
12
|
-
* any other value: denied with reason 'ambiguous_scope'
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Check whether a single item is accessible in the given retrieval context.
|
|
16
|
-
*
|
|
17
|
-
* @param itemScope The scope stored on the item (null/undefined → defaults to 'agent')
|
|
18
|
-
* @param itemAgentId The agentId stored on the item (null/undefined → global)
|
|
19
|
-
* @param itemSessionKey The sessionKey stored on the item (null/undefined → any)
|
|
20
|
-
* @param ctx The requester's retrieval context
|
|
21
|
-
*/
|
|
22
|
-
export function checkScope(itemScope, itemAgentId, itemSessionKey, ctx) {
|
|
23
|
-
const scope = itemScope ?? 'agent';
|
|
24
|
-
switch (scope) {
|
|
25
|
-
case 'agent':
|
|
26
|
-
// Global agent facts (null/undefined agentId) are readable by all agents.
|
|
27
|
-
// Agent-specific facts are only readable by the owning agent.
|
|
28
|
-
if (itemAgentId == null || itemAgentId === ctx.agentId) {
|
|
29
|
-
return { allowed: true, reason: 'allowed' };
|
|
30
|
-
}
|
|
31
|
-
return { allowed: false, reason: 'scope_filtered' };
|
|
32
|
-
case 'session':
|
|
33
|
-
// Session-scoped: both agentId AND sessionKey must match.
|
|
34
|
-
if ((itemAgentId == null || itemAgentId === ctx.agentId) &&
|
|
35
|
-
(itemSessionKey == null || itemSessionKey === ctx.sessionKey)) {
|
|
36
|
-
return { allowed: true, reason: 'allowed' };
|
|
37
|
-
}
|
|
38
|
-
return { allowed: false, reason: 'scope_filtered' };
|
|
39
|
-
case 'user':
|
|
40
|
-
// User-scoped: agentId must match (user prefs are keyed by agent).
|
|
41
|
-
if (itemAgentId == null || itemAgentId === ctx.agentId) {
|
|
42
|
-
return { allowed: true, reason: 'allowed' };
|
|
43
|
-
}
|
|
44
|
-
return { allowed: false, reason: 'scope_filtered' };
|
|
45
|
-
case 'global':
|
|
46
|
-
// Global: always accessible.
|
|
47
|
-
return { allowed: true, reason: 'allowed' };
|
|
48
|
-
default:
|
|
49
|
-
// Unknown scope — deny with ambiguous_scope.
|
|
50
|
-
return { allowed: false, reason: 'ambiguous_scope' };
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Filter an array of items by scope, returning allowed items and a filtered count.
|
|
55
|
-
*
|
|
56
|
-
* Items are expected to have optional `agentId`, `sessionKey`, and `scope` fields.
|
|
57
|
-
* Null/undefined fields are treated as "unset" (permissive for their slot).
|
|
58
|
-
*
|
|
59
|
-
* @param items Array of items to filter
|
|
60
|
-
* @param ctx The requester's retrieval context
|
|
61
|
-
* @returns { allowed: T[], filteredCount: number }
|
|
62
|
-
*/
|
|
63
|
-
export function filterByScope(items, ctx) {
|
|
64
|
-
const allowed = [];
|
|
65
|
-
let filteredCount = 0;
|
|
66
|
-
for (const item of items) {
|
|
67
|
-
const result = checkScope(item.scope, item.agentId, item.sessionKey, ctx);
|
|
68
|
-
if (result.allowed) {
|
|
69
|
-
allowed.push(item);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
filteredCount++;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return { allowed, filteredCount };
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=retrieval-policy.js.map
|
package/dist/schema.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* hypermem Agent Message Schema
|
|
3
|
-
*
|
|
4
|
-
* Per-agent database: ~/.openclaw/hypermem/agents/{agentId}/messages.db
|
|
5
|
-
* Write-heavy, temporal, rotatable.
|
|
6
|
-
* Contains ONLY conversation data — structured knowledge lives in library.db.
|
|
7
|
-
*/
|
|
8
|
-
import type { DatabaseSync } from 'node:sqlite';
|
|
9
|
-
export declare const LATEST_SCHEMA_VERSION = 10;
|
|
10
|
-
/**
|
|
11
|
-
* Run migrations on an agent message database.
|
|
12
|
-
*/
|
|
13
|
-
export declare function migrate(db: DatabaseSync): void;
|
|
14
|
-
export { LATEST_SCHEMA_VERSION as SCHEMA_VERSION };
|
|
15
|
-
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAgJxC;;GAEG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA0K9C;AAED,OAAO,EAAE,qBAAqB,IAAI,cAAc,EAAE,CAAC"}
|