@psiclawops/hypermem 0.9.0 → 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 +10 -1
- package/docs/ROADMAP.md +12 -3
- package/memory-plugin/package.json +3 -3
- package/package.json +2 -1
- package/plugin/package.json +4 -4
- package/dist/adaptive-lifecycle.d.ts +0 -81
- package/dist/adaptive-lifecycle.d.ts.map +0 -1
- package/dist/adaptive-lifecycle.js +0 -190
- 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 -32
- package/dist/cache.d.ts +0 -148
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js +0 -571
- 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/composition-snapshot-integrity.d.ts +0 -36
- package/dist/composition-snapshot-integrity.d.ts.map +0 -1
- package/dist/composition-snapshot-integrity.js +0 -131
- package/dist/composition-snapshot-runtime.d.ts +0 -59
- package/dist/composition-snapshot-runtime.d.ts.map +0 -1
- package/dist/composition-snapshot-runtime.js +0 -250
- package/dist/composition-snapshot-store.d.ts +0 -44
- package/dist/composition-snapshot-store.d.ts.map +0 -1
- package/dist/composition-snapshot-store.js +0 -117
- 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 -518
- package/dist/compositor.d.ts.map +0 -1
- package/dist/compositor.js +0 -4280
- 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 -159
- package/dist/doc-chunk-store.d.ts.map +0 -1
- package/dist/doc-chunk-store.js +0 -441
- 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 -102
- package/dist/hybrid-retrieval.d.ts.map +0 -1
- package/dist/hybrid-retrieval.js +0 -429
- 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 -727
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1495
- 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 -75
- package/dist/knowledge-store.d.ts.map +0 -1
- package/dist/knowledge-store.js +0 -270
- package/dist/library-schema.d.ts +0 -31
- package/dist/library-schema.d.ts.map +0 -1
- package/dist/library-schema.js +0 -1357
- package/dist/message-store.d.ts +0 -181
- package/dist/message-store.d.ts.map +0 -1
- package/dist/message-store.js +0 -577
- package/dist/metrics-dashboard.d.ts +0 -131
- package/dist/metrics-dashboard.d.ts.map +0 -1
- package/dist/metrics-dashboard.js +0 -298
- 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 -327
- 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 -179
- 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 -71
- package/dist/topic-synthesizer.d.ts.map +0 -1
- package/dist/topic-synthesizer.js +0 -426
- package/dist/trigger-registry.d.ts +0 -63
- package/dist/trigger-registry.d.ts.map +0 -1
- package/dist/trigger-registry.js +0 -171
- package/dist/types.d.ts +0 -1085
- 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 -44
- 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 -350
- 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 -208
- package/plugin/dist/index.d.ts.map +0 -1
- package/plugin/dist/index.js +0 -3474
- package/plugin/dist/index.js.map +0 -1
package/dist/db.js
DELETED
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* hypermem Database Manager
|
|
3
|
-
*
|
|
4
|
-
* Three-file architecture per agent:
|
|
5
|
-
* agents/{agentId}/messages.db — write-heavy conversation log (rotatable)
|
|
6
|
-
* agents/{agentId}/vectors.db — search index (reconstructable)
|
|
7
|
-
* library.db — fleet-wide structured knowledge (crown jewel)
|
|
8
|
-
*
|
|
9
|
-
* Uses node:sqlite (built into Node 22+) for synchronous, zero-dependency access.
|
|
10
|
-
*/
|
|
11
|
-
import { DatabaseSync } from 'node:sqlite';
|
|
12
|
-
import fs from 'node:fs';
|
|
13
|
-
import os from 'node:os';
|
|
14
|
-
import path from 'node:path';
|
|
15
|
-
import { migrate } from './schema.js';
|
|
16
|
-
import { migrateLibrary } from './library-schema.js';
|
|
17
|
-
import { ENGINE_VERSION } from './version.js';
|
|
18
|
-
import { ensureContextSchema } from './context-store.js';
|
|
19
|
-
import { backfillContexts } from './context-backfill.js';
|
|
20
|
-
// sqlite-vec extension loading — optional dependency
|
|
21
|
-
import { createRequire } from 'node:module';
|
|
22
|
-
let sqliteVecAvailable = null;
|
|
23
|
-
let sqliteVecLoad = null;
|
|
24
|
-
function loadSqliteVec(db) {
|
|
25
|
-
if (sqliteVecAvailable === null) {
|
|
26
|
-
try {
|
|
27
|
-
const require = createRequire(import.meta.url);
|
|
28
|
-
const mod = require('sqlite-vec');
|
|
29
|
-
sqliteVecLoad = mod.load;
|
|
30
|
-
sqliteVecAvailable = true;
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
sqliteVecAvailable = false;
|
|
34
|
-
sqliteVecLoad = null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (!sqliteVecAvailable || !sqliteVecLoad)
|
|
38
|
-
return false;
|
|
39
|
-
try {
|
|
40
|
-
sqliteVecLoad(db);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const DEFAULT_DATA_DIR = path.join(process.env.HOME || os.homedir(), '.openclaw', 'hypermem');
|
|
48
|
-
/**
|
|
49
|
-
* Validate agentId to prevent path traversal.
|
|
50
|
-
* Must match [a-z0-9][a-z0-9-]* (lowercase alphanumeric + hyphens, no dots or slashes).
|
|
51
|
-
*/
|
|
52
|
-
function validateAgentId(agentId) {
|
|
53
|
-
if (!agentId || !/^[a-z0-9][a-z0-9-]*$/.test(agentId)) {
|
|
54
|
-
throw new Error(`Invalid agentId: "${agentId}". Must match [a-z0-9][a-z0-9-]*`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Validate rotated DB filename to prevent path traversal.
|
|
59
|
-
* Must match the expected rotation pattern: messages_YYYYQN(_N)?.db
|
|
60
|
-
*/
|
|
61
|
-
function validateRotatedFilename(filename) {
|
|
62
|
-
if (!/^messages_\d{4}Q[1-4](_\d+)?\.db$/.test(filename)) {
|
|
63
|
-
throw new Error(`Invalid rotated DB filename: "${filename}". Must match messages_YYYYQN.db pattern`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Apply standard pragmas to a database connection.
|
|
68
|
-
*/
|
|
69
|
-
function applyPragmas(db) {
|
|
70
|
-
db.exec('PRAGMA journal_mode = WAL');
|
|
71
|
-
db.exec('PRAGMA synchronous = NORMAL');
|
|
72
|
-
db.exec('PRAGMA foreign_keys = ON');
|
|
73
|
-
db.exec('PRAGMA busy_timeout = 5000');
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Get the directory for an agent's databases.
|
|
77
|
-
*/
|
|
78
|
-
function agentDir(dataDir, agentId) {
|
|
79
|
-
return path.join(dataDir, 'agents', agentId);
|
|
80
|
-
}
|
|
81
|
-
export { validateAgentId, validateRotatedFilename };
|
|
82
|
-
export class DatabaseManager {
|
|
83
|
-
dataDir;
|
|
84
|
-
messageDbs = new Map();
|
|
85
|
-
vectorDbs = new Map();
|
|
86
|
-
libraryDb = null;
|
|
87
|
-
_vecAvailable = null;
|
|
88
|
-
/** Whether sqlite-vec was successfully loaded on the most recent DB open. */
|
|
89
|
-
get vecAvailable() {
|
|
90
|
-
return this._vecAvailable === true;
|
|
91
|
-
}
|
|
92
|
-
constructor(config) {
|
|
93
|
-
this.dataDir = config?.dataDir || DEFAULT_DATA_DIR;
|
|
94
|
-
fs.mkdirSync(this.dataDir, { recursive: true });
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Get or create the message database for an agent.
|
|
98
|
-
* This is the write-heavy, rotatable conversation log.
|
|
99
|
-
*/
|
|
100
|
-
getMessageDb(agentId) {
|
|
101
|
-
validateAgentId(agentId);
|
|
102
|
-
let db = this.messageDbs.get(agentId);
|
|
103
|
-
if (db)
|
|
104
|
-
return db;
|
|
105
|
-
const dir = agentDir(this.dataDir, agentId);
|
|
106
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
107
|
-
const dbPath = path.join(dir, 'messages.db');
|
|
108
|
-
db = new DatabaseSync(dbPath);
|
|
109
|
-
applyPragmas(db);
|
|
110
|
-
migrate(db);
|
|
111
|
-
ensureContextSchema(db);
|
|
112
|
-
// Backfill contexts for existing conversations on first run after migration
|
|
113
|
-
const contextCount = db.prepare('SELECT COUNT(*) as cnt FROM contexts').get();
|
|
114
|
-
if (contextCount.cnt === 0) {
|
|
115
|
-
backfillContexts(db);
|
|
116
|
-
}
|
|
117
|
-
this.messageDbs.set(agentId, db);
|
|
118
|
-
return db;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Get or create the vector database for an agent.
|
|
122
|
-
* This is the search index — fully reconstructable.
|
|
123
|
-
* Returns null if sqlite-vec is not available.
|
|
124
|
-
*/
|
|
125
|
-
getVectorDb(agentId) {
|
|
126
|
-
validateAgentId(agentId);
|
|
127
|
-
let db = this.vectorDbs.get(agentId);
|
|
128
|
-
if (db)
|
|
129
|
-
return db;
|
|
130
|
-
const dir = agentDir(this.dataDir, agentId);
|
|
131
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
132
|
-
const dbPath = path.join(dir, 'vectors.db');
|
|
133
|
-
db = new DatabaseSync(dbPath, { allowExtension: true });
|
|
134
|
-
applyPragmas(db);
|
|
135
|
-
const vecLoaded = loadSqliteVec(db);
|
|
136
|
-
this._vecAvailable = vecLoaded;
|
|
137
|
-
if (!vecLoaded) {
|
|
138
|
-
// Close and don't cache — no point without vec extension
|
|
139
|
-
try {
|
|
140
|
-
db.close();
|
|
141
|
-
}
|
|
142
|
-
catch { /* ignore */ }
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
// Create vector tables (managed by VectorStore, but we ensure the DB is ready)
|
|
146
|
-
this.vectorDbs.set(agentId, db);
|
|
147
|
-
return db;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Get or create the shared (fleet-wide) vector database.
|
|
151
|
-
* Unlike per-agent vector DBs, this is a single vectors.db at the root of dataDir,
|
|
152
|
-
* shared across all agents. Facts and episodes from all agents are indexed together,
|
|
153
|
-
* keyed by (source_table, source_id) in vec_index_map.
|
|
154
|
-
* Returns null if sqlite-vec is not available.
|
|
155
|
-
*/
|
|
156
|
-
getSharedVectorDb() {
|
|
157
|
-
const sharedKey = '__shared__';
|
|
158
|
-
let db = this.vectorDbs.get(sharedKey);
|
|
159
|
-
if (db)
|
|
160
|
-
return db;
|
|
161
|
-
const dbPath = path.join(this.dataDir, 'vectors.db');
|
|
162
|
-
db = new DatabaseSync(dbPath, { allowExtension: true });
|
|
163
|
-
applyPragmas(db);
|
|
164
|
-
const vecLoaded = loadSqliteVec(db);
|
|
165
|
-
this._vecAvailable = vecLoaded;
|
|
166
|
-
if (!vecLoaded) {
|
|
167
|
-
try {
|
|
168
|
-
db.close();
|
|
169
|
-
}
|
|
170
|
-
catch { /* ignore */ }
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
this.vectorDbs.set(sharedKey, db);
|
|
174
|
-
return db;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Get or create the shared library database.
|
|
178
|
-
* This is the fleet-wide knowledge store — the crown jewel.
|
|
179
|
-
*/
|
|
180
|
-
getLibraryDb() {
|
|
181
|
-
if (this.libraryDb)
|
|
182
|
-
return this.libraryDb;
|
|
183
|
-
const dbPath = path.join(this.dataDir, 'library.db');
|
|
184
|
-
this.libraryDb = new DatabaseSync(dbPath);
|
|
185
|
-
applyPragmas(this.libraryDb);
|
|
186
|
-
migrateLibrary(this.libraryDb, ENGINE_VERSION);
|
|
187
|
-
return this.libraryDb;
|
|
188
|
-
}
|
|
189
|
-
// ── Legacy compatibility ──────────────────────────────────────
|
|
190
|
-
/**
|
|
191
|
-
* @deprecated Use getMessageDb() instead. Kept for migration period.
|
|
192
|
-
* Maps to getMessageDb() for backward compatibility.
|
|
193
|
-
*/
|
|
194
|
-
getAgentDb(agentId) {
|
|
195
|
-
return this.getMessageDb(agentId);
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Ensure agent metadata exists in the message DB.
|
|
199
|
-
*/
|
|
200
|
-
ensureAgent(agentId, meta) {
|
|
201
|
-
validateAgentId(agentId);
|
|
202
|
-
const db = this.getMessageDb(agentId);
|
|
203
|
-
const now = new Date().toISOString();
|
|
204
|
-
const existing = db
|
|
205
|
-
.prepare('SELECT id FROM agent_meta WHERE id = ?')
|
|
206
|
-
.get(agentId);
|
|
207
|
-
if (!existing) {
|
|
208
|
-
db.prepare(`
|
|
209
|
-
INSERT INTO agent_meta (id, display_name, tier, org, created_at, updated_at)
|
|
210
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
211
|
-
`).run(agentId, meta?.displayName || agentId, meta?.tier || 'unknown', meta?.org || 'unknown', now, now);
|
|
212
|
-
}
|
|
213
|
-
// Also register in fleet registry (library)
|
|
214
|
-
this.ensureFleetAgent(agentId, meta);
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Ensure agent exists in the fleet registry (library DB).
|
|
218
|
-
*/
|
|
219
|
-
ensureFleetAgent(agentId, meta) {
|
|
220
|
-
const db = this.getLibraryDb();
|
|
221
|
-
const now = new Date().toISOString();
|
|
222
|
-
const existing = db
|
|
223
|
-
.prepare('SELECT id FROM fleet_agents WHERE id = ?')
|
|
224
|
-
.get(agentId);
|
|
225
|
-
if (!existing) {
|
|
226
|
-
db.prepare(`
|
|
227
|
-
INSERT INTO fleet_agents (id, display_name, tier, org_id, status, created_at, updated_at)
|
|
228
|
-
VALUES (?, ?, ?, ?, 'active', ?, ?)
|
|
229
|
-
`).run(agentId, meta?.displayName || agentId, meta?.tier || 'unknown', meta?.org || null, now, now);
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
// Update last_seen
|
|
233
|
-
db.prepare('UPDATE fleet_agents SET last_seen = ?, updated_at = ? WHERE id = ?')
|
|
234
|
-
.run(now, now, agentId);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* List all agents with message databases.
|
|
239
|
-
*/
|
|
240
|
-
listAgents() {
|
|
241
|
-
const agentsDir = path.join(this.dataDir, 'agents');
|
|
242
|
-
if (!fs.existsSync(agentsDir))
|
|
243
|
-
return [];
|
|
244
|
-
const VALID_AGENT_ID = /^[a-z0-9][a-z0-9-]*$/;
|
|
245
|
-
return fs.readdirSync(agentsDir).filter(f => {
|
|
246
|
-
if (!VALID_AGENT_ID.test(f))
|
|
247
|
-
return false;
|
|
248
|
-
const stat = fs.statSync(path.join(agentsDir, f));
|
|
249
|
-
return stat.isDirectory();
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Get the path to an agent's directory.
|
|
254
|
-
*/
|
|
255
|
-
getAgentDir(agentId) {
|
|
256
|
-
validateAgentId(agentId);
|
|
257
|
-
return agentDir(this.dataDir, agentId);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* List rotated message DB files for an agent.
|
|
261
|
-
*/
|
|
262
|
-
listRotatedDbs(agentId) {
|
|
263
|
-
const dir = agentDir(this.dataDir, agentId);
|
|
264
|
-
if (!fs.existsSync(dir))
|
|
265
|
-
return [];
|
|
266
|
-
return fs.readdirSync(dir)
|
|
267
|
-
.filter(f => f.startsWith('messages_') && f.endsWith('.db'))
|
|
268
|
-
.sort();
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Get the size of the active messages.db for an agent (in bytes).
|
|
272
|
-
*/
|
|
273
|
-
getMessageDbSize(agentId) {
|
|
274
|
-
const dir = agentDir(this.dataDir, agentId);
|
|
275
|
-
const dbPath = path.join(dir, 'messages.db');
|
|
276
|
-
try {
|
|
277
|
-
const stat = fs.statSync(dbPath);
|
|
278
|
-
return stat.size;
|
|
279
|
-
}
|
|
280
|
-
catch {
|
|
281
|
-
return 0;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Rotate the message database for an agent.
|
|
286
|
-
*
|
|
287
|
-
* 1. Closes the active messages.db connection
|
|
288
|
-
* 2. Renames messages.db → messages_{YYYYQN}.db (e.g., messages_2026Q1.db)
|
|
289
|
-
* 3. Removes associated WAL/SHM files
|
|
290
|
-
* 4. Next call to getMessageDb() creates a fresh database
|
|
291
|
-
*
|
|
292
|
-
* The rotated file is read-only archive material. The vector index
|
|
293
|
-
* retains references to it via source_db in vec_index_map.
|
|
294
|
-
*
|
|
295
|
-
* Returns the path to the rotated file, or null if rotation wasn't needed.
|
|
296
|
-
*/
|
|
297
|
-
rotateMessageDb(agentId) {
|
|
298
|
-
const dir = agentDir(this.dataDir, agentId);
|
|
299
|
-
const activePath = path.join(dir, 'messages.db');
|
|
300
|
-
if (!fs.existsSync(activePath))
|
|
301
|
-
return null;
|
|
302
|
-
// Close the active connection first
|
|
303
|
-
const existingDb = this.messageDbs.get(agentId);
|
|
304
|
-
if (existingDb) {
|
|
305
|
-
try {
|
|
306
|
-
// Checkpoint WAL into the main database before rotating
|
|
307
|
-
existingDb.exec('PRAGMA wal_checkpoint(TRUNCATE)');
|
|
308
|
-
existingDb.close();
|
|
309
|
-
}
|
|
310
|
-
catch { /* ignore */ }
|
|
311
|
-
this.messageDbs.delete(agentId);
|
|
312
|
-
}
|
|
313
|
-
// Generate rotation name: messages_YYYYQN.db
|
|
314
|
-
const now = new Date();
|
|
315
|
-
const year = now.getFullYear();
|
|
316
|
-
const quarter = Math.ceil((now.getMonth() + 1) / 3);
|
|
317
|
-
let rotatedName = `messages_${year}Q${quarter}.db`;
|
|
318
|
-
let rotatedPath = path.join(dir, rotatedName);
|
|
319
|
-
// Handle collision — append a suffix if this quarter already has a rotation
|
|
320
|
-
let suffix = 1;
|
|
321
|
-
while (fs.existsSync(rotatedPath)) {
|
|
322
|
-
rotatedName = `messages_${year}Q${quarter}_${suffix}.db`;
|
|
323
|
-
rotatedPath = path.join(dir, rotatedName);
|
|
324
|
-
suffix++;
|
|
325
|
-
}
|
|
326
|
-
// Rename the active DB to the rotated name
|
|
327
|
-
fs.renameSync(activePath, rotatedPath);
|
|
328
|
-
// Clean up WAL and SHM files
|
|
329
|
-
for (const ext of ['-wal', '-shm']) {
|
|
330
|
-
const walPath = activePath + ext;
|
|
331
|
-
if (fs.existsSync(walPath)) {
|
|
332
|
-
try {
|
|
333
|
-
fs.unlinkSync(walPath);
|
|
334
|
-
}
|
|
335
|
-
catch { /* ignore */ }
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
return rotatedPath;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Check if an agent's message database needs rotation.
|
|
342
|
-
* Triggers on:
|
|
343
|
-
* - Size exceeds threshold (default 100MB)
|
|
344
|
-
* - Time since creation exceeds threshold (default 90 days)
|
|
345
|
-
*
|
|
346
|
-
* Returns the reason for rotation, or null if no rotation needed.
|
|
347
|
-
*/
|
|
348
|
-
shouldRotate(agentId, opts) {
|
|
349
|
-
const maxSize = opts?.maxSizeBytes ?? 100 * 1024 * 1024; // 100MB
|
|
350
|
-
const maxAge = opts?.maxAgeDays ?? 90;
|
|
351
|
-
// Check size
|
|
352
|
-
const size = this.getMessageDbSize(agentId);
|
|
353
|
-
if (size > maxSize) {
|
|
354
|
-
return { reason: 'size', current: size, threshold: maxSize };
|
|
355
|
-
}
|
|
356
|
-
// Check age — look at the earliest conversation in the DB
|
|
357
|
-
const db = this.getMessageDb(agentId);
|
|
358
|
-
const oldest = db.prepare('SELECT MIN(created_at) as earliest FROM conversations').get();
|
|
359
|
-
if (oldest?.earliest) {
|
|
360
|
-
const created = new Date(oldest.earliest);
|
|
361
|
-
const ageMs = Date.now() - created.getTime();
|
|
362
|
-
const ageDays = ageMs / (1000 * 60 * 60 * 24);
|
|
363
|
-
if (ageDays > maxAge) {
|
|
364
|
-
return { reason: 'age', current: Math.round(ageDays), threshold: maxAge };
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return null;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Open a rotated message database as read-only for querying.
|
|
371
|
-
*/
|
|
372
|
-
openRotatedDb(agentId, filename) {
|
|
373
|
-
validateAgentId(agentId);
|
|
374
|
-
validateRotatedFilename(filename);
|
|
375
|
-
const dir = agentDir(this.dataDir, agentId);
|
|
376
|
-
const dbPath = path.join(dir, filename);
|
|
377
|
-
if (!fs.existsSync(dbPath)) {
|
|
378
|
-
throw new Error(`Rotated DB not found: ${dbPath}`);
|
|
379
|
-
}
|
|
380
|
-
const db = new DatabaseSync(dbPath, { readOnly: true });
|
|
381
|
-
return db;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Close all open database connections.
|
|
385
|
-
*/
|
|
386
|
-
close() {
|
|
387
|
-
for (const [, db] of this.messageDbs) {
|
|
388
|
-
try {
|
|
389
|
-
db.close();
|
|
390
|
-
}
|
|
391
|
-
catch { /* ignore */ }
|
|
392
|
-
}
|
|
393
|
-
this.messageDbs.clear();
|
|
394
|
-
for (const [, db] of this.vectorDbs) {
|
|
395
|
-
try {
|
|
396
|
-
db.close();
|
|
397
|
-
}
|
|
398
|
-
catch { /* ignore */ }
|
|
399
|
-
}
|
|
400
|
-
this.vectorDbs.clear();
|
|
401
|
-
if (this.libraryDb) {
|
|
402
|
-
try {
|
|
403
|
-
this.libraryDb.close();
|
|
404
|
-
}
|
|
405
|
-
catch { /* ignore */ }
|
|
406
|
-
this.libraryDb = null;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
//# sourceMappingURL=db.js.map
|
package/dist/degradation.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HyperMem Canonical Degradation Contracts, Phase C0.2
|
|
3
|
-
*
|
|
4
|
-
* Defines the typed surfaces, reason enum, and format builders for degraded
|
|
5
|
-
* prompt-visible outputs. These shapes stay in volatile context and should not
|
|
6
|
-
* cross the stable-prefix boundary.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Closed set of reasons for any degradation decision.
|
|
10
|
-
* Use these values in telemetry and tests instead of ad-hoc strings.
|
|
11
|
-
*/
|
|
12
|
-
export type DegradationReason = 'gradient_t2_prose' | 'gradient_t3_stub' | 'eviction_oversize' | 'eviction_turn0_trim' | 'wave_guard_pressure_high' | 'wave_guard_pressure_elevated' | 'budget_cluster_drop' | 'artifact_oversize' | 'artifact_fetch_hint' | 'replay_cold_redis' | 'replay_stabilizing' | 'replay_exited' | 'pressure_mismatch' | 'unknown';
|
|
13
|
-
/** All valid DegradationReason values as a readonly array. */
|
|
14
|
-
export declare const DEGRADATION_REASONS: readonly ["gradient_t2_prose", "gradient_t3_stub", "eviction_oversize", "eviction_turn0_trim", "wave_guard_pressure_high", "wave_guard_pressure_elevated", "budget_cluster_drop", "artifact_oversize", "artifact_fetch_hint", "replay_cold_redis", "replay_stabilizing", "replay_exited", "pressure_mismatch", "unknown"];
|
|
15
|
-
/** Field-length caps for canonical degraded strings. */
|
|
16
|
-
export declare const DEGRADATION_LIMITS: {
|
|
17
|
-
readonly toolName: 64;
|
|
18
|
-
readonly toolId: 64;
|
|
19
|
-
readonly reason: 48;
|
|
20
|
-
readonly toolSummary: 120;
|
|
21
|
-
readonly toolArtifactId: 64;
|
|
22
|
-
readonly artifactId: 64;
|
|
23
|
-
readonly artifactPath: 160;
|
|
24
|
-
readonly artifactFetchHint: 80;
|
|
25
|
-
readonly replayState: 32;
|
|
26
|
-
readonly replaySummary: 120;
|
|
27
|
-
};
|
|
28
|
-
export declare function isDegradationReason(value: string): value is DegradationReason;
|
|
29
|
-
/**
|
|
30
|
-
* Canonical shape for a degraded tool call/result pair.
|
|
31
|
-
*
|
|
32
|
-
* Prompt-visible format:
|
|
33
|
-
* [tool:<name> id=<id> status=ejected reason=<reason> summary=<stub>]
|
|
34
|
-
*
|
|
35
|
-
* Optional artifact pointer (Phase 1 of tool_artifacts):
|
|
36
|
-
* [tool:<name> id=<id> status=ejected reason=<reason> artifact=<artifactId> summary=<stub>]
|
|
37
|
-
*
|
|
38
|
-
* The `artifact=` field is backwards-compatible and optional. When present, it
|
|
39
|
-
* lets the compositor rehydrate the full tool result payload from the
|
|
40
|
-
* tool_artifacts table without needing to rewrite the transcript.
|
|
41
|
-
*/
|
|
42
|
-
export interface ToolChainStub {
|
|
43
|
-
name: string;
|
|
44
|
-
id: string;
|
|
45
|
-
status: 'ejected';
|
|
46
|
-
reason: DegradationReason;
|
|
47
|
-
summary: string;
|
|
48
|
-
/** Optional durable pointer into the tool_artifacts table. */
|
|
49
|
-
artifactId?: string;
|
|
50
|
-
}
|
|
51
|
-
export declare function formatToolChainStub(stub: ToolChainStub): string;
|
|
52
|
-
export declare function parseToolChainStub(text: string): ToolChainStub | null;
|
|
53
|
-
export declare function isToolChainStub(text: string): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Canonical shape for a degraded oversized artifact replaced by a pointer.
|
|
56
|
-
*
|
|
57
|
-
* Prompt-visible format:
|
|
58
|
-
* [artifact:<id> path=<path> size=<tokens> status=degraded fetch=<hint>]
|
|
59
|
-
*/
|
|
60
|
-
export interface ArtifactRef {
|
|
61
|
-
id: string;
|
|
62
|
-
path: string;
|
|
63
|
-
sizeTokens: number;
|
|
64
|
-
status: 'degraded';
|
|
65
|
-
reason: DegradationReason;
|
|
66
|
-
fetchHint: string;
|
|
67
|
-
}
|
|
68
|
-
export declare function formatArtifactRef(ref: ArtifactRef): string;
|
|
69
|
-
export declare function parseArtifactRef(text: string): ArtifactRef | null;
|
|
70
|
-
export declare function isArtifactRef(text: string): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* State of the replay recovery window.
|
|
73
|
-
*/
|
|
74
|
-
export type ReplayState = 'entering' | 'stabilizing' | 'exited';
|
|
75
|
-
export declare function isReplayState(value: string): value is ReplayState;
|
|
76
|
-
/**
|
|
77
|
-
* Canonical shape for a replay recovery mode marker.
|
|
78
|
-
*
|
|
79
|
-
* Prompt-visible format:
|
|
80
|
-
* [replay state=<state> status=bounded reason=<reason> summary=<stub>]
|
|
81
|
-
*/
|
|
82
|
-
export interface ReplayMarker {
|
|
83
|
-
state: ReplayState;
|
|
84
|
-
status: 'bounded';
|
|
85
|
-
reason: DegradationReason;
|
|
86
|
-
summary: string;
|
|
87
|
-
}
|
|
88
|
-
export declare function formatReplayMarker(marker: ReplayMarker): string;
|
|
89
|
-
export declare function parseReplayMarker(text: string): ReplayMarker | null;
|
|
90
|
-
export declare function isReplayMarker(text: string): boolean;
|
|
91
|
-
export declare function isDegradedContent(text: string): boolean;
|
|
92
|
-
export interface DegradationEvent {
|
|
93
|
-
event: 'degradation';
|
|
94
|
-
ts: string;
|
|
95
|
-
agentId: string;
|
|
96
|
-
sessionKey: string;
|
|
97
|
-
degradationClass: 'tool_chain' | 'artifact' | 'replay';
|
|
98
|
-
reason: DegradationReason;
|
|
99
|
-
tokensSaved: number;
|
|
100
|
-
emittedText: string;
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=degradation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"degradation.d.ts","sourceRoot":"","sources":["../src/degradation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,0BAA0B,GAC1B,8BAA8B,GAC9B,qBAAqB,GACrB,mBAAmB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,GACpB,eAAe,GACf,mBAAmB,GACnB,SAAS,CAAC;AAEd,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,2TAeiB,CAAC;AAElD,wDAAwD;AACxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAWrB,CAAC;AAiBX,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAE7E;AAID;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAKD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAS/D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAQrE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAID;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAM1D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAajE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAID;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEhE,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAEjE;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAK/D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAWnE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAID,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,aAAa,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;IACvD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/degradation.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HyperMem Canonical Degradation Contracts, Phase C0.2
|
|
3
|
-
*
|
|
4
|
-
* Defines the typed surfaces, reason enum, and format builders for degraded
|
|
5
|
-
* prompt-visible outputs. These shapes stay in volatile context and should not
|
|
6
|
-
* cross the stable-prefix boundary.
|
|
7
|
-
*/
|
|
8
|
-
/** All valid DegradationReason values as a readonly array. */
|
|
9
|
-
export const DEGRADATION_REASONS = [
|
|
10
|
-
'gradient_t2_prose',
|
|
11
|
-
'gradient_t3_stub',
|
|
12
|
-
'eviction_oversize',
|
|
13
|
-
'eviction_turn0_trim',
|
|
14
|
-
'wave_guard_pressure_high',
|
|
15
|
-
'wave_guard_pressure_elevated',
|
|
16
|
-
'budget_cluster_drop',
|
|
17
|
-
'artifact_oversize',
|
|
18
|
-
'artifact_fetch_hint',
|
|
19
|
-
'replay_cold_redis',
|
|
20
|
-
'replay_stabilizing',
|
|
21
|
-
'replay_exited',
|
|
22
|
-
'pressure_mismatch',
|
|
23
|
-
'unknown',
|
|
24
|
-
];
|
|
25
|
-
/** Field-length caps for canonical degraded strings. */
|
|
26
|
-
export const DEGRADATION_LIMITS = {
|
|
27
|
-
toolName: 64,
|
|
28
|
-
toolId: 64,
|
|
29
|
-
reason: 48,
|
|
30
|
-
toolSummary: 120,
|
|
31
|
-
toolArtifactId: 64,
|
|
32
|
-
artifactId: 64,
|
|
33
|
-
artifactPath: 160,
|
|
34
|
-
artifactFetchHint: 80,
|
|
35
|
-
replayState: 32,
|
|
36
|
-
replaySummary: 120,
|
|
37
|
-
};
|
|
38
|
-
function sanitizeInline(value) {
|
|
39
|
-
return value
|
|
40
|
-
.replace(/[\r\n\t]+/g, ' ')
|
|
41
|
-
.replace(/\s+/g, ' ')
|
|
42
|
-
.replace(/]/g, ')')
|
|
43
|
-
.trim();
|
|
44
|
-
}
|
|
45
|
-
function clampInline(value, limit) {
|
|
46
|
-
const cleaned = sanitizeInline(value);
|
|
47
|
-
if (cleaned.length <= limit)
|
|
48
|
-
return cleaned;
|
|
49
|
-
if (limit <= 3)
|
|
50
|
-
return cleaned.slice(0, limit);
|
|
51
|
-
return cleaned.slice(0, limit - 3) + '...';
|
|
52
|
-
}
|
|
53
|
-
export function isDegradationReason(value) {
|
|
54
|
-
return DEGRADATION_REASONS.includes(value);
|
|
55
|
-
}
|
|
56
|
-
// Matches stubs with or without the optional artifact field.
|
|
57
|
-
const TOOL_CHAIN_RE = /^\[tool:([^\s\]]+) id=([^\s\]]+) status=(ejected) reason=([^\s\]]+)(?: artifact=([^\s\]]+))? summary=(.*)\]$/s;
|
|
58
|
-
export function formatToolChainStub(stub) {
|
|
59
|
-
const name = clampInline(stub.name, DEGRADATION_LIMITS.toolName);
|
|
60
|
-
const id = clampInline(stub.id, DEGRADATION_LIMITS.toolId);
|
|
61
|
-
const reason = clampInline(stub.reason, DEGRADATION_LIMITS.reason);
|
|
62
|
-
const summary = clampInline(stub.summary, DEGRADATION_LIMITS.toolSummary);
|
|
63
|
-
const artifactPart = stub.artifactId
|
|
64
|
-
? ` artifact=${clampInline(stub.artifactId, DEGRADATION_LIMITS.toolArtifactId)}`
|
|
65
|
-
: '';
|
|
66
|
-
return `[tool:${name} id=${id} status=${stub.status} reason=${reason}${artifactPart} summary=${summary}]`;
|
|
67
|
-
}
|
|
68
|
-
export function parseToolChainStub(text) {
|
|
69
|
-
const match = text.match(TOOL_CHAIN_RE);
|
|
70
|
-
if (!match)
|
|
71
|
-
return null;
|
|
72
|
-
const [, name, id, status, reason, artifactId, summary] = match;
|
|
73
|
-
if (status !== 'ejected' || !isDegradationReason(reason))
|
|
74
|
-
return null;
|
|
75
|
-
const out = { name, id, status: 'ejected', reason, summary };
|
|
76
|
-
if (artifactId)
|
|
77
|
-
out.artifactId = artifactId;
|
|
78
|
-
return out;
|
|
79
|
-
}
|
|
80
|
-
export function isToolChainStub(text) {
|
|
81
|
-
return parseToolChainStub(text) !== null;
|
|
82
|
-
}
|
|
83
|
-
const ARTIFACT_REF_RE = /^\[artifact:(.+?) path=(.+?) size=(\d+) status=(degraded) reason=(.+?) fetch=(.*)\]$/s;
|
|
84
|
-
export function formatArtifactRef(ref) {
|
|
85
|
-
const id = clampInline(ref.id, DEGRADATION_LIMITS.artifactId);
|
|
86
|
-
const path = clampInline(ref.path, DEGRADATION_LIMITS.artifactPath);
|
|
87
|
-
const reason = clampInline(ref.reason, DEGRADATION_LIMITS.reason);
|
|
88
|
-
const fetchHint = clampInline(ref.fetchHint, DEGRADATION_LIMITS.artifactFetchHint);
|
|
89
|
-
return `[artifact:${id} path=${path} size=${ref.sizeTokens} status=${ref.status} reason=${reason} fetch=${fetchHint}]`;
|
|
90
|
-
}
|
|
91
|
-
export function parseArtifactRef(text) {
|
|
92
|
-
const match = text.match(ARTIFACT_REF_RE);
|
|
93
|
-
if (!match)
|
|
94
|
-
return null;
|
|
95
|
-
const [, id, path, sizeTokens, status, reason, fetchHint] = match;
|
|
96
|
-
if (status !== 'degraded' || !isDegradationReason(reason))
|
|
97
|
-
return null;
|
|
98
|
-
return {
|
|
99
|
-
id,
|
|
100
|
-
path,
|
|
101
|
-
sizeTokens: parseInt(sizeTokens, 10),
|
|
102
|
-
status: 'degraded',
|
|
103
|
-
reason,
|
|
104
|
-
fetchHint,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
export function isArtifactRef(text) {
|
|
108
|
-
return parseArtifactRef(text) !== null;
|
|
109
|
-
}
|
|
110
|
-
export function isReplayState(value) {
|
|
111
|
-
return value === 'entering' || value === 'stabilizing' || value === 'exited';
|
|
112
|
-
}
|
|
113
|
-
const REPLAY_MARKER_RE = /^\[replay state=([^\s\]]+) status=(bounded) reason=([^\s\]]+) summary=(.*)\]$/s;
|
|
114
|
-
export function formatReplayMarker(marker) {
|
|
115
|
-
const state = clampInline(marker.state, DEGRADATION_LIMITS.replayState);
|
|
116
|
-
const reason = clampInline(marker.reason, DEGRADATION_LIMITS.reason);
|
|
117
|
-
const summary = clampInline(marker.summary, DEGRADATION_LIMITS.replaySummary);
|
|
118
|
-
return `[replay state=${state} status=${marker.status} reason=${reason} summary=${summary}]`;
|
|
119
|
-
}
|
|
120
|
-
export function parseReplayMarker(text) {
|
|
121
|
-
const match = text.match(REPLAY_MARKER_RE);
|
|
122
|
-
if (!match)
|
|
123
|
-
return null;
|
|
124
|
-
const [, state, status, reason, summary] = match;
|
|
125
|
-
if (status !== 'bounded' || !isReplayState(state) || !isDegradationReason(reason))
|
|
126
|
-
return null;
|
|
127
|
-
return {
|
|
128
|
-
state,
|
|
129
|
-
status: 'bounded',
|
|
130
|
-
reason,
|
|
131
|
-
summary,
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
export function isReplayMarker(text) {
|
|
135
|
-
return parseReplayMarker(text) !== null;
|
|
136
|
-
}
|
|
137
|
-
// ─── Shared helpers ───────────────────────────────────────────────────────────
|
|
138
|
-
export function isDegradedContent(text) {
|
|
139
|
-
return isToolChainStub(text) || isArtifactRef(text) || isReplayMarker(text);
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=degradation.js.map
|