@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/bin/hypermem-status.mjs
CHANGED
|
@@ -3,27 +3,41 @@
|
|
|
3
3
|
* hypermem status — health check and metrics dashboard CLI
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* hypermem-status # metrics dashboard
|
|
7
|
+
* hypermem-status --master # concise operator health surface
|
|
8
|
+
* hypermem-status --agent forge --master # scoped operator health surface
|
|
9
|
+
* hypermem-status --json # machine-readable output
|
|
10
|
+
* hypermem-status --health # health checks only (exit 1 on failure)
|
|
10
11
|
*
|
|
11
12
|
* Requires: compiled dist/ (run `npm run build` first)
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
|
-
import { existsSync } from 'node:fs';
|
|
15
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
15
16
|
import { resolve, join, dirname } from 'node:path';
|
|
16
17
|
import { fileURLToPath } from 'node:url';
|
|
17
18
|
import os from 'node:os';
|
|
19
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
18
20
|
|
|
19
21
|
const __dir = dirname(fileURLToPath(import.meta.url));
|
|
20
22
|
const root = resolve(__dir, '..');
|
|
23
|
+
const homeDir = process.env.HOME || os.homedir();
|
|
24
|
+
|
|
25
|
+
const DEFAULT_EMBEDDING = {
|
|
26
|
+
provider: 'ollama',
|
|
27
|
+
model: 'nomic-embed-text',
|
|
28
|
+
dimensions: 768,
|
|
29
|
+
batchSize: null,
|
|
30
|
+
openaiBaseUrl: null,
|
|
31
|
+
ollamaUrl: null,
|
|
32
|
+
geminiBaseUrl: null,
|
|
33
|
+
};
|
|
21
34
|
|
|
22
35
|
// ── Arg parsing ──────────────────────────────────────────────────
|
|
23
36
|
const args = process.argv.slice(2);
|
|
24
37
|
const flags = {
|
|
25
38
|
json: args.includes('--json'),
|
|
26
39
|
health: args.includes('--health'),
|
|
40
|
+
master: args.includes('--master') || args.includes('--planks'),
|
|
27
41
|
help: args.includes('--help') || args.includes('-h'),
|
|
28
42
|
agent: null,
|
|
29
43
|
};
|
|
@@ -38,20 +52,94 @@ if (flags.help) {
|
|
|
38
52
|
hypermem status — health check and metrics dashboard
|
|
39
53
|
|
|
40
54
|
Usage:
|
|
41
|
-
hypermem-status
|
|
55
|
+
hypermem-status [options]
|
|
42
56
|
|
|
43
57
|
Options:
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--
|
|
47
|
-
|
|
58
|
+
--master Concise master health status for main HyperMem planks
|
|
59
|
+
--agent <id> Scope metrics to a specific agent
|
|
60
|
+
--json Output raw JSON instead of formatted summary
|
|
61
|
+
--health Health checks only (exits 1 if any check fails)
|
|
62
|
+
-h, --help Show this help
|
|
48
63
|
`);
|
|
49
64
|
process.exit(0);
|
|
50
65
|
}
|
|
51
66
|
|
|
52
|
-
// ── Resolve data directory
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
// ── Resolve config and data directory ────────────────────────────
|
|
68
|
+
function readJsonIfExists(filePath) {
|
|
69
|
+
if (!existsSync(filePath)) return null;
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(readFileSync(filePath, 'utf8'));
|
|
72
|
+
} catch {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function stripSecretFields(obj) {
|
|
78
|
+
if (!obj || typeof obj !== 'object') return obj;
|
|
79
|
+
const out = Array.isArray(obj) ? [] : {};
|
|
80
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
81
|
+
if (/apiKey|token|secret|password|authorization/i.test(key)) {
|
|
82
|
+
out[key] = value ? '[redacted]' : value;
|
|
83
|
+
} else if (value && typeof value === 'object') {
|
|
84
|
+
out[key] = stripSecretFields(value);
|
|
85
|
+
} else {
|
|
86
|
+
out[key] = value;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function readOpenClawPluginConfig(defaultDataDir) {
|
|
93
|
+
const openclawConfigPath = process.env.OPENCLAW_CONFIG
|
|
94
|
+
|| join(homeDir, '.openclaw', 'openclaw.json');
|
|
95
|
+
const parsed = readJsonIfExists(openclawConfigPath);
|
|
96
|
+
const config = parsed?.plugins?.entries?.hypercompositor?.config
|
|
97
|
+
?? parsed?.plugins?.entries?.hypermem?.config
|
|
98
|
+
?? null;
|
|
99
|
+
if (!config || typeof config !== 'object') return { config: {}, source: null, dataDir: defaultDataDir };
|
|
100
|
+
return {
|
|
101
|
+
config,
|
|
102
|
+
source: openclawConfigPath,
|
|
103
|
+
dataDir: config.dataDir || defaultDataDir,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function resolveRuntimeConfig() {
|
|
108
|
+
const defaultDataDir = process.env.HYPERMEM_DATA_DIR || join(homeDir, '.openclaw', 'hypermem');
|
|
109
|
+
const central = readOpenClawPluginConfig(defaultDataDir);
|
|
110
|
+
const dataDir = process.env.HYPERMEM_DATA_DIR || central.dataDir || defaultDataDir;
|
|
111
|
+
const legacyConfigPath = join(dataDir, 'config.json');
|
|
112
|
+
const fileConfig = readJsonIfExists(legacyConfigPath) ?? {};
|
|
113
|
+
const pluginConfig = central.config ?? {};
|
|
114
|
+
|
|
115
|
+
// Mirrors plugin loadUserConfig(): config.json fallback, plugin config wins.
|
|
116
|
+
const merged = { ...fileConfig };
|
|
117
|
+
for (const key of [
|
|
118
|
+
'contextWindowSize', 'contextWindowReserve', 'deferToolPruning',
|
|
119
|
+
'verboseLogging', 'warmCacheReplayThresholdMs', 'subagentWarming',
|
|
120
|
+
]) {
|
|
121
|
+
if (pluginConfig[key] != null) merged[key] = pluginConfig[key];
|
|
122
|
+
}
|
|
123
|
+
for (const key of ['contextWindowOverrides', 'compositor', 'eviction', 'embedding', 'reranker']) {
|
|
124
|
+
if (pluginConfig[key]) merged[key] = { ...(merged[key] ?? {}), ...pluginConfig[key] };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const embedding = { ...DEFAULT_EMBEDDING, ...(merged.embedding ?? {}) };
|
|
128
|
+
const sources = [];
|
|
129
|
+
if (existsSync(legacyConfigPath)) sources.push(legacyConfigPath);
|
|
130
|
+
if (central.source && Object.keys(pluginConfig).length > 0) sources.push(`${central.source}:plugins.entries.hypercompositor.config`);
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
dataDir,
|
|
134
|
+
config: merged,
|
|
135
|
+
embedding,
|
|
136
|
+
configSources: sources.length > 0 ? sources : ['defaults'],
|
|
137
|
+
redactedConfig: stripSecretFields(merged),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const runtime = resolveRuntimeConfig();
|
|
142
|
+
const dataDir = runtime.dataDir;
|
|
55
143
|
|
|
56
144
|
if (!existsSync(dataDir)) {
|
|
57
145
|
console.error(`Error: data directory not found: ${dataDir}`);
|
|
@@ -59,13 +147,14 @@ if (!existsSync(dataDir)) {
|
|
|
59
147
|
process.exit(1);
|
|
60
148
|
}
|
|
61
149
|
|
|
62
|
-
// ──
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
function openDb(filePath, label) {
|
|
150
|
+
// ── DB helpers ───────────────────────────────────────────────────
|
|
151
|
+
function openDb(filePath, label, required = true) {
|
|
66
152
|
if (!existsSync(filePath)) {
|
|
67
|
-
|
|
68
|
-
|
|
153
|
+
if (required) {
|
|
154
|
+
console.error(`Error: ${label} not found: ${filePath}`);
|
|
155
|
+
process.exit(1);
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
69
158
|
}
|
|
70
159
|
try {
|
|
71
160
|
const db = new DatabaseSync(filePath, { open: true });
|
|
@@ -73,42 +162,360 @@ function openDb(filePath, label) {
|
|
|
73
162
|
db.exec('PRAGMA busy_timeout = 3000');
|
|
74
163
|
return db;
|
|
75
164
|
} catch (err) {
|
|
76
|
-
|
|
77
|
-
|
|
165
|
+
if (required) {
|
|
166
|
+
console.error(`Error opening ${label}: ${err.message}`);
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
78
170
|
}
|
|
79
171
|
}
|
|
80
172
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
173
|
+
function safeGet(db, sql, params = []) {
|
|
174
|
+
try { return db.prepare(sql).get(...params); } catch { return null; }
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function safeAll(db, sql, params = []) {
|
|
178
|
+
try { return db.prepare(sql).all(...params); } catch { return []; }
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function fileInfo(filePath) {
|
|
182
|
+
if (!existsSync(filePath)) return { exists: false, bytes: 0, mb: 0 };
|
|
183
|
+
const bytes = statSync(filePath).size;
|
|
184
|
+
return { exists: true, bytes, mb: Math.round((bytes / 1024 / 1024) * 10) / 10 };
|
|
185
|
+
}
|
|
85
186
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
187
|
+
function pct(indexed, total) {
|
|
188
|
+
if (!total) return null;
|
|
189
|
+
return Math.round((indexed / total) * 1000) / 10;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function statusForCoverage(percent, minimum) {
|
|
193
|
+
if (percent === null) return 'n/a';
|
|
194
|
+
return percent >= minimum ? 'ok' : 'warn';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function icon(status) {
|
|
198
|
+
if (status === 'ok') return '✅';
|
|
199
|
+
if (status === 'warn') return '⚠️';
|
|
200
|
+
if (status === 'fail') return '❌';
|
|
201
|
+
return '•';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function findMessageDb(agentId) {
|
|
205
|
+
if (agentId) return join(dataDir, 'agents', agentId, 'messages.db');
|
|
90
206
|
const agentsDir = join(dataDir, 'agents');
|
|
91
|
-
if (existsSync(agentsDir))
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
207
|
+
if (!existsSync(agentsDir)) return null;
|
|
208
|
+
const agents = readdirSync(agentsDir, { withFileTypes: true })
|
|
209
|
+
.filter(d => d.isDirectory())
|
|
210
|
+
.map(d => d.name)
|
|
211
|
+
.sort();
|
|
212
|
+
for (const agent of agents) {
|
|
213
|
+
const candidate = join(agentsDir, agent, 'messages.db');
|
|
214
|
+
if (existsSync(candidate)) return candidate;
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function collectMessageStats(agentId) {
|
|
220
|
+
const agentsDir = join(dataDir, 'agents');
|
|
221
|
+
if (!existsSync(agentsDir)) return { agentsWithMessages: 0, totalMessages: 0, newestMessageAt: null };
|
|
222
|
+
const agents = agentId ? [agentId] : readdirSync(agentsDir, { withFileTypes: true })
|
|
223
|
+
.filter(d => d.isDirectory())
|
|
224
|
+
.map(d => d.name);
|
|
225
|
+
let agentsWithMessages = 0;
|
|
226
|
+
let totalMessages = 0;
|
|
227
|
+
let newestMessageAt = null;
|
|
228
|
+
for (const agent of agents) {
|
|
229
|
+
const dbPath = join(agentsDir, agent, 'messages.db');
|
|
230
|
+
if (!existsSync(dbPath)) continue;
|
|
231
|
+
const db = openDb(dbPath, `${agent} messages.db`, false);
|
|
232
|
+
if (!db) continue;
|
|
233
|
+
agentsWithMessages += 1;
|
|
234
|
+
const count = safeGet(db, 'SELECT COUNT(*) AS count FROM messages')?.count ?? 0;
|
|
235
|
+
const newest = safeGet(db, 'SELECT MAX(created_at) AS newest FROM messages')?.newest ?? null;
|
|
236
|
+
totalMessages += count;
|
|
237
|
+
if (newest && (!newestMessageAt || newest > newestMessageAt)) newestMessageAt = newest;
|
|
238
|
+
try { db.close(); } catch {}
|
|
239
|
+
}
|
|
240
|
+
return { agentsWithMessages, totalMessages, newestMessageAt };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function getVectorDimensions(vectorDb, tableName) {
|
|
244
|
+
if (!vectorDb) return null;
|
|
245
|
+
const row = safeGet(vectorDb, 'SELECT sql FROM sqlite_master WHERE type = ? AND name = ?', ['table', tableName]);
|
|
246
|
+
const match = row?.sql?.match(/float\[(\d+)\]/i);
|
|
247
|
+
return match ? Number(match[1]) : null;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function getQuickCheck(db) {
|
|
251
|
+
const row = safeGet(db, 'PRAGMA quick_check');
|
|
252
|
+
return row ? Object.values(row)[0] : 'unknown';
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function collectMasterHealth(libraryDb, vectorDb, mainDb) {
|
|
256
|
+
const agentClause = flags.agent ? 'AND agent_id = ?' : '';
|
|
257
|
+
const params = flags.agent ? [flags.agent] : [];
|
|
258
|
+
|
|
259
|
+
const factsTotal = safeGet(libraryDb, `SELECT COUNT(*) AS count FROM facts WHERE 1=1 ${agentClause}`, params)?.count ?? 0;
|
|
260
|
+
const factsActive = safeGet(libraryDb, `SELECT COUNT(*) AS count FROM facts WHERE superseded_by IS NULL AND decay_score < 0.8 ${agentClause}`, params)?.count ?? 0;
|
|
261
|
+
const episodesTotal = safeGet(libraryDb, `SELECT COUNT(*) AS count FROM episodes WHERE 1=1 ${agentClause}`, params)?.count ?? 0;
|
|
262
|
+
const episodesEligible = safeGet(libraryDb, `SELECT COUNT(*) AS count FROM episodes WHERE significance >= 0.5 ${agentClause}`, params)?.count ?? 0;
|
|
263
|
+
const knowledgeActive = safeGet(libraryDb, `SELECT COUNT(*) AS count FROM knowledge WHERE superseded_by IS NULL ${agentClause}`, params)?.count ?? 0;
|
|
264
|
+
const docChunks = safeGet(libraryDb, `SELECT COUNT(*) AS count FROM doc_chunks WHERE 1=1 ${agentClause}`, params)?.count ?? 0;
|
|
265
|
+
|
|
266
|
+
let factsIndexed = 0;
|
|
267
|
+
let episodesIndexed = 0;
|
|
268
|
+
let knowledgeIndexed = 0;
|
|
269
|
+
let totalVectors = 0;
|
|
270
|
+
let vectorByTable = {};
|
|
271
|
+
let oldestIndexedAt = null;
|
|
272
|
+
let newestIndexedAt = null;
|
|
273
|
+
let vectorDimensions = { facts: null, episodes: null, knowledge: null };
|
|
274
|
+
|
|
275
|
+
if (vectorDb) {
|
|
276
|
+
totalVectors = safeGet(vectorDb, 'SELECT COUNT(*) AS count FROM vec_index_map')?.count ?? 0;
|
|
277
|
+
vectorByTable = Object.fromEntries(safeAll(vectorDb, 'SELECT source_table, COUNT(*) AS count FROM vec_index_map GROUP BY source_table').map(r => [r.source_table, r.count]));
|
|
278
|
+
oldestIndexedAt = safeGet(vectorDb, 'SELECT MIN(indexed_at) AS value FROM vec_index_map')?.value ?? null;
|
|
279
|
+
newestIndexedAt = safeGet(vectorDb, 'SELECT MAX(indexed_at) AS value FROM vec_index_map')?.value ?? null;
|
|
280
|
+
vectorDimensions = {
|
|
281
|
+
facts: getVectorDimensions(vectorDb, 'vec_facts'),
|
|
282
|
+
episodes: getVectorDimensions(vectorDb, 'vec_episodes'),
|
|
283
|
+
knowledge: getVectorDimensions(vectorDb, 'vec_knowledge'),
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
if (flags.agent) {
|
|
287
|
+
factsIndexed = safeGet(vectorDb, `
|
|
288
|
+
SELECT COUNT(*) AS count
|
|
289
|
+
FROM vec_index_map m
|
|
290
|
+
JOIN library.facts f ON f.id = m.source_id
|
|
291
|
+
WHERE m.source_table = 'facts'
|
|
292
|
+
AND f.superseded_by IS NULL
|
|
293
|
+
AND f.decay_score < 0.8
|
|
294
|
+
AND f.agent_id = ?`, params)?.count ?? 0;
|
|
295
|
+
episodesIndexed = safeGet(vectorDb, `
|
|
296
|
+
SELECT COUNT(*) AS count
|
|
297
|
+
FROM vec_index_map m
|
|
298
|
+
JOIN library.episodes e ON e.id = m.source_id
|
|
299
|
+
WHERE m.source_table = 'episodes'
|
|
300
|
+
AND e.significance >= 0.5
|
|
301
|
+
AND e.agent_id = ?`, params)?.count ?? 0;
|
|
302
|
+
knowledgeIndexed = safeGet(vectorDb, `
|
|
303
|
+
SELECT COUNT(*) AS count
|
|
304
|
+
FROM vec_index_map m
|
|
305
|
+
JOIN library.knowledge k ON k.id = m.source_id
|
|
306
|
+
WHERE m.source_table = 'knowledge'
|
|
307
|
+
AND k.superseded_by IS NULL
|
|
308
|
+
AND k.agent_id = ?`, params)?.count ?? 0;
|
|
309
|
+
const rawFactsIndexed = safeGet(vectorDb, `
|
|
310
|
+
SELECT COUNT(*) AS count
|
|
311
|
+
FROM vec_index_map m
|
|
312
|
+
JOIN library.facts f ON f.id = m.source_id
|
|
313
|
+
WHERE m.source_table = 'facts'
|
|
314
|
+
AND f.agent_id = ?`, params)?.count ?? 0;
|
|
315
|
+
const rawEpisodesIndexed = safeGet(vectorDb, `
|
|
316
|
+
SELECT COUNT(*) AS count
|
|
317
|
+
FROM vec_index_map m
|
|
318
|
+
JOIN library.episodes e ON e.id = m.source_id
|
|
319
|
+
WHERE m.source_table = 'episodes'
|
|
320
|
+
AND e.agent_id = ?`, params)?.count ?? 0;
|
|
321
|
+
const rawKnowledgeIndexed = safeGet(vectorDb, `
|
|
322
|
+
SELECT COUNT(*) AS count
|
|
323
|
+
FROM vec_index_map m
|
|
324
|
+
JOIN library.knowledge k ON k.id = m.source_id
|
|
325
|
+
WHERE m.source_table = 'knowledge'
|
|
326
|
+
AND k.agent_id = ?`, params)?.count ?? 0;
|
|
327
|
+
vectorByTable = {
|
|
328
|
+
...(rawEpisodesIndexed ? { episodes: rawEpisodesIndexed } : {}),
|
|
329
|
+
...(rawFactsIndexed ? { facts: rawFactsIndexed } : {}),
|
|
330
|
+
...(rawKnowledgeIndexed ? { knowledge: rawKnowledgeIndexed } : {}),
|
|
331
|
+
};
|
|
332
|
+
totalVectors = rawFactsIndexed + rawEpisodesIndexed + rawKnowledgeIndexed;
|
|
333
|
+
} else {
|
|
334
|
+
factsIndexed = safeGet(vectorDb, `
|
|
335
|
+
SELECT COUNT(*) AS count
|
|
336
|
+
FROM vec_index_map m
|
|
337
|
+
JOIN library.facts f ON f.id = m.source_id
|
|
338
|
+
WHERE m.source_table = 'facts'
|
|
339
|
+
AND f.superseded_by IS NULL
|
|
340
|
+
AND f.decay_score < 0.8`)?.count ?? 0;
|
|
341
|
+
episodesIndexed = safeGet(vectorDb, `
|
|
342
|
+
SELECT COUNT(*) AS count
|
|
343
|
+
FROM vec_index_map m
|
|
344
|
+
JOIN library.episodes e ON e.id = m.source_id
|
|
345
|
+
WHERE m.source_table = 'episodes'
|
|
346
|
+
AND e.significance >= 0.5`)?.count ?? 0;
|
|
347
|
+
knowledgeIndexed = safeGet(vectorDb, `
|
|
348
|
+
SELECT COUNT(*) AS count
|
|
349
|
+
FROM vec_index_map m
|
|
350
|
+
JOIN library.knowledge k ON k.id = m.source_id
|
|
351
|
+
WHERE m.source_table = 'knowledge'
|
|
352
|
+
AND k.superseded_by IS NULL`)?.count ?? 0;
|
|
102
353
|
}
|
|
103
354
|
}
|
|
355
|
+
|
|
356
|
+
const factCoverage = pct(factsIndexed, factsActive);
|
|
357
|
+
const episodeCoverage = pct(episodesIndexed, episodesEligible);
|
|
358
|
+
const knowledgeCoverage = pct(knowledgeIndexed, knowledgeActive);
|
|
359
|
+
const factStatus = statusForCoverage(factCoverage, 80);
|
|
360
|
+
const episodeStatus = statusForCoverage(episodeCoverage, 80);
|
|
361
|
+
const knowledgeStatus = knowledgeActive === 0 ? 'n/a' : statusForCoverage(knowledgeCoverage, 80);
|
|
362
|
+
const configuredDimensions = Number(runtime.embedding.dimensions) || null;
|
|
363
|
+
const dimensionMatches = !configuredDimensions
|
|
364
|
+
? 'n/a'
|
|
365
|
+
: [vectorDimensions.facts, vectorDimensions.episodes, vectorDimensions.knowledge]
|
|
366
|
+
.filter(v => v != null)
|
|
367
|
+
.every(v => v === configuredDimensions)
|
|
368
|
+
? 'ok'
|
|
369
|
+
: 'fail';
|
|
370
|
+
|
|
371
|
+
const libraryQuickCheck = getQuickCheck(libraryDb);
|
|
372
|
+
const vectorQuickCheck = vectorDb ? getQuickCheck(vectorDb) : 'missing';
|
|
373
|
+
const mainQuickCheck = mainDb ? getQuickCheck(mainDb) : 'missing';
|
|
374
|
+
const dbStatus = libraryQuickCheck === 'ok' && (vectorQuickCheck === 'ok' || vectorQuickCheck === 'missing') && (mainQuickCheck === 'ok' || mainQuickCheck === 'missing') ? 'ok' : 'fail';
|
|
375
|
+
|
|
376
|
+
const messageStats = collectMessageStats(flags.agent);
|
|
377
|
+
const totalTurns = safeGet(libraryDb, `SELECT COUNT(*) AS count FROM output_metrics WHERE 1=1 ${agentClause}`, params)?.count ?? 0;
|
|
378
|
+
const avgLatency = safeGet(libraryDb, `SELECT AVG(latency_ms) AS value FROM output_metrics WHERE latency_ms IS NOT NULL ${agentClause}`, params)?.value ?? null;
|
|
379
|
+
const avgInput = safeGet(libraryDb, `SELECT AVG(input_tokens) AS value FROM output_metrics WHERE input_tokens IS NOT NULL ${agentClause}`, params)?.value ?? null;
|
|
380
|
+
const avgOutput = safeGet(libraryDb, `SELECT AVG(output_tokens) AS value FROM output_metrics WHERE output_tokens IS NOT NULL ${agentClause}`, params)?.value ?? null;
|
|
381
|
+
|
|
382
|
+
const issues = [];
|
|
383
|
+
if (dbStatus === 'fail') issues.push('database quick_check failed');
|
|
384
|
+
if (dimensionMatches === 'fail') issues.push('vector table dimensions do not match configured embedding dimensions');
|
|
385
|
+
if (factStatus === 'warn') issues.push(`fact vector coverage low (${factCoverage}%)`);
|
|
386
|
+
if (episodeStatus === 'warn') issues.push(`episode vector coverage low (${episodeCoverage}%)`);
|
|
387
|
+
if (knowledgeStatus === 'warn') issues.push(`knowledge vector coverage low (${knowledgeCoverage}%)`);
|
|
388
|
+
if (!vectorDb) issues.push('shared vectors.db missing');
|
|
389
|
+
|
|
390
|
+
const overall = issues.length === 0 ? 'healthy' : (dbStatus === 'fail' || dimensionMatches === 'fail' ? 'degraded' : 'attention');
|
|
391
|
+
|
|
392
|
+
return {
|
|
393
|
+
snapshotAt: new Date().toISOString(),
|
|
394
|
+
scope: flags.agent ? { agent: flags.agent } : { fleet: true },
|
|
395
|
+
overall,
|
|
396
|
+
issues,
|
|
397
|
+
config: {
|
|
398
|
+
dataDir,
|
|
399
|
+
sources: runtime.configSources,
|
|
400
|
+
embedding: {
|
|
401
|
+
provider: runtime.embedding.provider ?? null,
|
|
402
|
+
model: runtime.embedding.model ?? null,
|
|
403
|
+
dimensions: configuredDimensions,
|
|
404
|
+
batchSize: runtime.embedding.batchSize ?? null,
|
|
405
|
+
baseUrl: runtime.embedding.openaiBaseUrl ?? runtime.embedding.ollamaUrl ?? runtime.embedding.geminiBaseUrl ?? null,
|
|
406
|
+
},
|
|
407
|
+
reranker: runtime.config.reranker ? stripSecretFields(runtime.config.reranker) : null,
|
|
408
|
+
},
|
|
409
|
+
databases: {
|
|
410
|
+
library: { path: libraryDbPath, ...fileInfo(libraryDbPath), quickCheck: libraryQuickCheck },
|
|
411
|
+
vectors: { path: vectorDbPath, ...fileInfo(vectorDbPath), quickCheck: vectorQuickCheck, dimensions: vectorDimensions },
|
|
412
|
+
messages: { sampledPath: mainDbPath, ...(mainDbPath ? fileInfo(mainDbPath) : { exists: false, bytes: 0, mb: 0 }), quickCheck: mainQuickCheck },
|
|
413
|
+
},
|
|
414
|
+
memory: {
|
|
415
|
+
facts: { total: factsTotal, active: factsActive },
|
|
416
|
+
episodes: { total: episodesTotal, eligible: episodesEligible },
|
|
417
|
+
knowledge: { active: knowledgeActive },
|
|
418
|
+
docChunks: { total: docChunks },
|
|
419
|
+
messages: messageStats,
|
|
420
|
+
},
|
|
421
|
+
vectors: {
|
|
422
|
+
total: totalVectors,
|
|
423
|
+
byTable: vectorByTable,
|
|
424
|
+
coverage: {
|
|
425
|
+
facts: { indexed: factsIndexed, total: factsActive, percent: factCoverage, status: factStatus },
|
|
426
|
+
episodes: { indexed: episodesIndexed, total: episodesEligible, percent: episodeCoverage, status: episodeStatus },
|
|
427
|
+
knowledge: { indexed: knowledgeIndexed, total: knowledgeActive, percent: knowledgeCoverage, status: knowledgeStatus },
|
|
428
|
+
},
|
|
429
|
+
oldestIndexedAt,
|
|
430
|
+
newestIndexedAt,
|
|
431
|
+
dimensionStatus: dimensionMatches,
|
|
432
|
+
},
|
|
433
|
+
composition: {
|
|
434
|
+
turns: totalTurns,
|
|
435
|
+
avgLatencyMs: avgLatency == null ? null : Math.round(avgLatency),
|
|
436
|
+
avgInputTokens: avgInput == null ? null : Math.round(avgInput),
|
|
437
|
+
avgOutputTokens: avgOutput == null ? null : Math.round(avgOutput),
|
|
438
|
+
semanticDiagnosticsPersisted: false,
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function formatCoverage(label, item) {
|
|
444
|
+
const percent = item.percent == null ? 'n/a' : `${item.percent}%`;
|
|
445
|
+
return ` ${icon(item.status)} ${label.padEnd(9)} ${item.indexed.toLocaleString()} / ${item.total.toLocaleString()} (${percent})`;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function formatMasterHealth(h) {
|
|
449
|
+
const lines = [];
|
|
450
|
+
lines.push(`hypermem master health — ${h.snapshotAt}`);
|
|
451
|
+
lines.push(`scope: ${h.scope.agent ? `agent=${h.scope.agent}` : 'fleet'}`);
|
|
452
|
+
lines.push(`overall: ${h.overall === 'healthy' ? '✅ healthy' : h.overall === 'degraded' ? '❌ degraded' : '⚠️ attention'}`);
|
|
453
|
+
if (h.issues.length > 0) {
|
|
454
|
+
lines.push(`issues: ${h.issues.join('; ')}`);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
lines.push('');
|
|
458
|
+
lines.push('## Configuration');
|
|
459
|
+
lines.push(` dataDir: ${h.config.dataDir}`);
|
|
460
|
+
lines.push(` source: ${h.config.sources.join(' + ')}`);
|
|
461
|
+
lines.push(` embed: ${h.config.embedding.provider ?? 'unknown'} / ${h.config.embedding.model ?? 'unknown'}${h.config.embedding.dimensions ? ` (${h.config.embedding.dimensions}d)` : ''}${h.config.embedding.batchSize ? ` batch=${h.config.embedding.batchSize}` : ''}`);
|
|
462
|
+
if (h.config.embedding.baseUrl) lines.push(` base: ${h.config.embedding.baseUrl}`);
|
|
463
|
+
lines.push(` rerank: ${h.config.reranker?.provider ?? 'none'}`);
|
|
464
|
+
|
|
465
|
+
lines.push('');
|
|
466
|
+
lines.push('## Databases');
|
|
467
|
+
lines.push(` ${icon(h.databases.library.quickCheck === 'ok' ? 'ok' : 'fail')} library.db ${h.databases.library.mb} MB quick_check=${h.databases.library.quickCheck}`);
|
|
468
|
+
lines.push(` ${icon(h.databases.vectors.quickCheck === 'ok' ? 'ok' : h.databases.vectors.exists ? 'fail' : 'warn')} vectors.db ${h.databases.vectors.exists ? `${h.databases.vectors.mb} MB` : 'missing'} quick_check=${h.databases.vectors.quickCheck}`);
|
|
469
|
+
lines.push(` ${icon(h.databases.messages.quickCheck === 'ok' ? 'ok' : h.databases.messages.exists ? 'fail' : 'warn')} messages sample ${h.databases.messages.exists ? `${h.databases.messages.mb} MB` : 'missing'} quick_check=${h.databases.messages.quickCheck}`);
|
|
470
|
+
lines.push(` ${icon(h.vectors.dimensionStatus)} vector dims facts=${h.databases.vectors.dimensions.facts ?? 'n/a'} episodes=${h.databases.vectors.dimensions.episodes ?? 'n/a'} knowledge=${h.databases.vectors.dimensions.knowledge ?? 'n/a'}`);
|
|
471
|
+
|
|
472
|
+
lines.push('');
|
|
473
|
+
lines.push('## Memory data');
|
|
474
|
+
lines.push(` facts: ${h.memory.facts.active.toLocaleString()} retrieval-eligible / ${h.memory.facts.total.toLocaleString()} total`);
|
|
475
|
+
lines.push(` episodes: ${h.memory.episodes.eligible.toLocaleString()} significant / ${h.memory.episodes.total.toLocaleString()} total`);
|
|
476
|
+
lines.push(` knowledge:${String(h.memory.knowledge.active.toLocaleString()).padStart(7)} active`);
|
|
477
|
+
lines.push(` chunks: ${h.memory.docChunks.total.toLocaleString()}`);
|
|
478
|
+
lines.push(` messages: ${h.memory.messages.totalMessages.toLocaleString()} across ${h.memory.messages.agentsWithMessages} agent DBs${h.memory.messages.newestMessageAt ? `, newest ${h.memory.messages.newestMessageAt}` : ''}`);
|
|
479
|
+
|
|
480
|
+
lines.push('');
|
|
481
|
+
lines.push('## Vector coverage');
|
|
482
|
+
lines.push(` total vectors: ${h.vectors.total.toLocaleString()}`);
|
|
483
|
+
if (Object.keys(h.vectors.byTable).length > 0) {
|
|
484
|
+
const byTable = Object.entries(h.vectors.byTable)
|
|
485
|
+
.map(([table, count]) => `${table}=${Number(count).toLocaleString()}`)
|
|
486
|
+
.join(' ');
|
|
487
|
+
lines.push(` by table: ${byTable}`);
|
|
488
|
+
}
|
|
489
|
+
lines.push(formatCoverage('facts', h.vectors.coverage.facts));
|
|
490
|
+
lines.push(formatCoverage('episodes', h.vectors.coverage.episodes));
|
|
491
|
+
lines.push(formatCoverage('knowledge', h.vectors.coverage.knowledge));
|
|
492
|
+
lines.push(` indexed window: ${h.vectors.oldestIndexedAt ?? 'n/a'} → ${h.vectors.newestIndexedAt ?? 'n/a'}`);
|
|
493
|
+
|
|
494
|
+
lines.push('');
|
|
495
|
+
lines.push('## Composition');
|
|
496
|
+
if (h.composition.turns > 0) {
|
|
497
|
+
lines.push(` turns: ${h.composition.turns.toLocaleString()}`);
|
|
498
|
+
if (h.composition.avgLatencyMs != null) lines.push(` avg latency: ${h.composition.avgLatencyMs}ms`);
|
|
499
|
+
if (h.composition.avgInputTokens != null) lines.push(` avg input: ${h.composition.avgInputTokens.toLocaleString()} tokens`);
|
|
500
|
+
if (h.composition.avgOutputTokens != null) lines.push(` avg output: ${h.composition.avgOutputTokens.toLocaleString()} tokens`);
|
|
501
|
+
} else {
|
|
502
|
+
lines.push(' no persisted output_metrics rows');
|
|
503
|
+
}
|
|
504
|
+
lines.push(' semantic recall counts: runtime log only, not persisted yet');
|
|
505
|
+
|
|
506
|
+
return lines.join('\n');
|
|
104
507
|
}
|
|
105
508
|
|
|
509
|
+
// ── Resolve DB paths ─────────────────────────────────────────────
|
|
510
|
+
const mainDbPath = findMessageDb(flags.agent);
|
|
511
|
+
const libraryDbPath = join(dataDir, 'library.db');
|
|
512
|
+
const vectorDbPath = join(dataDir, 'vectors.db');
|
|
513
|
+
|
|
106
514
|
if (!mainDbPath || !existsSync(mainDbPath)) {
|
|
107
|
-
if (
|
|
108
|
-
const result = { status: 'no_sessions', message: 'Installed but no agent sessions ingested yet. Send a message to any agent, then re-run.' };
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
} else {
|
|
515
|
+
if (flags.health || flags.json || flags.master) {
|
|
516
|
+
const result = { status: 'no_sessions', message: 'Installed but no agent sessions ingested yet. Send a message to any agent, then re-run.', dataDir };
|
|
517
|
+
if (flags.json) console.log(JSON.stringify(result, null, 2));
|
|
518
|
+
else {
|
|
112
519
|
console.log('Status: installed, no sessions ingested yet.');
|
|
113
520
|
console.log('Send a message to any agent, then re-run this health check.');
|
|
114
521
|
}
|
|
@@ -118,31 +525,48 @@ if (!mainDbPath || !existsSync(mainDbPath)) {
|
|
|
118
525
|
process.exit(1);
|
|
119
526
|
}
|
|
120
527
|
|
|
121
|
-
const libraryDbPath = join(dataDir, 'library.db');
|
|
122
|
-
|
|
123
528
|
const mainDb = openDb(mainDbPath, 'messages.db');
|
|
124
529
|
const libraryDb = openDb(libraryDbPath, 'library.db');
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
530
|
+
const vectorDb = openDb(vectorDbPath, 'vectors.db', false);
|
|
531
|
+
if (vectorDb) {
|
|
532
|
+
try {
|
|
533
|
+
vectorDb.exec(`ATTACH DATABASE '${libraryDbPath.replaceAll("'", "''")}' AS library`);
|
|
534
|
+
} catch {
|
|
535
|
+
// Coverage joins degrade to zero via safeGet if the live library cannot be attached.
|
|
536
|
+
}
|
|
131
537
|
}
|
|
132
538
|
|
|
133
|
-
|
|
539
|
+
try {
|
|
540
|
+
if (flags.master) {
|
|
541
|
+
const master = collectMasterHealth(libraryDb, vectorDb, mainDb);
|
|
542
|
+
if (flags.json) console.log(JSON.stringify(master, null, 2));
|
|
543
|
+
else console.log(formatMasterHealth(master));
|
|
544
|
+
process.exit(master.overall === 'degraded' ? 1 : 0);
|
|
545
|
+
}
|
|
134
546
|
|
|
135
|
-
// ──
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
547
|
+
// ── Import metrics functions ───────────────────────────────────
|
|
548
|
+
const distPath = join(root, 'dist', 'metrics-dashboard.js');
|
|
549
|
+
if (!existsSync(distPath)) {
|
|
550
|
+
console.error('Error: dist/metrics-dashboard.js not found. Run `npm run build` first.');
|
|
551
|
+
process.exit(1);
|
|
552
|
+
}
|
|
140
553
|
|
|
141
|
-
|
|
142
|
-
const
|
|
554
|
+
const { collectMetrics, formatMetricsSummary } = await import(distPath);
|
|
555
|
+
const opts = {};
|
|
556
|
+
if (flags.agent) opts.agentIds = [flags.agent];
|
|
557
|
+
|
|
558
|
+
const metrics = await collectMetrics(
|
|
559
|
+
mainDb,
|
|
560
|
+
libraryDb,
|
|
561
|
+
{
|
|
562
|
+
...opts,
|
|
563
|
+
embeddingProvider: runtime.embedding.provider,
|
|
564
|
+
embeddingModel: runtime.embedding.model,
|
|
565
|
+
},
|
|
566
|
+
vectorDb,
|
|
567
|
+
);
|
|
143
568
|
|
|
144
569
|
if (flags.health) {
|
|
145
|
-
// Health-only mode: check and exit
|
|
146
570
|
const h = metrics.health;
|
|
147
571
|
const ok = h.mainDbOk && h.libraryDbOk && (h.cacheOk === null || h.cacheOk);
|
|
148
572
|
|
|
@@ -150,22 +574,18 @@ try {
|
|
|
150
574
|
console.log(JSON.stringify(h, null, 2));
|
|
151
575
|
} else {
|
|
152
576
|
console.log(`hypermem ${h.packageVersion} health check`);
|
|
577
|
+
console.log(` embedding: provider=${h.embeddingProvider ?? 'unknown'}${h.embeddingModel ? ` model=${h.embeddingModel}` : ''}`);
|
|
153
578
|
console.log(` main db: ${h.mainDbOk ? '✅' : '❌'}${h.mainSchemaVersion !== null ? ` (schema v${h.mainSchemaVersion})` : ''}`);
|
|
154
579
|
console.log(` library db: ${h.libraryDbOk ? '✅' : '❌'}${h.librarySchemaVersion !== null ? ` (schema v${h.librarySchemaVersion})` : ''}`);
|
|
155
|
-
if (h.cacheOk !== null) {
|
|
156
|
-
console.log(` cache: ${h.cacheOk ? '✅' : '❌'}`);
|
|
157
|
-
}
|
|
580
|
+
if (h.cacheOk !== null) console.log(` cache: ${h.cacheOk ? '✅' : '❌'}`);
|
|
158
581
|
console.log(` status: ${ok ? '✅ healthy' : '❌ degraded'}`);
|
|
159
582
|
}
|
|
160
583
|
|
|
161
584
|
process.exit(ok ? 0 : 1);
|
|
162
585
|
}
|
|
163
586
|
|
|
164
|
-
if (flags.json)
|
|
165
|
-
|
|
166
|
-
} else {
|
|
167
|
-
console.log(formatMetricsSummary(metrics));
|
|
168
|
-
}
|
|
587
|
+
if (flags.json) console.log(JSON.stringify(metrics, null, 2));
|
|
588
|
+
else console.log(formatMetricsSummary(metrics));
|
|
169
589
|
} catch (err) {
|
|
170
590
|
console.error(`Error collecting metrics: ${err.message}`);
|
|
171
591
|
if (err.stack) console.error(err.stack);
|
|
@@ -173,4 +593,5 @@ try {
|
|
|
173
593
|
} finally {
|
|
174
594
|
try { mainDb.close(); } catch {}
|
|
175
595
|
try { libraryDb.close(); } catch {}
|
|
596
|
+
try { vectorDb?.close(); } catch {}
|
|
176
597
|
}
|