@avantf/dsh-mem 0.6.4 → 0.8.0

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.
Files changed (150) hide show
  1. package/README.md +19 -10
  2. package/lib/client.js +1665 -3466
  3. package/lib/dsh-build.json +6 -5
  4. package/lib/engine/graph-recall/in-memory.d.ts +93 -0
  5. package/lib/engine/graph-recall/index.d.ts +22 -0
  6. package/lib/engine/graph-recall/traverse.d.ts +119 -0
  7. package/lib/engine/graph-recall/types.d.ts +188 -0
  8. package/lib/engine/mem/config/config_files.d.ts +1 -1
  9. package/lib/engine/mem/config/loader.d.ts +2 -3
  10. package/lib/engine/mem/config/paths.d.ts +2 -13
  11. package/lib/engine/mem/db/dao/contradictions.d.ts +4 -22
  12. package/lib/engine/mem/db/dao/entities.d.ts +80 -7
  13. package/lib/engine/mem/db/dao/fact_sources.d.ts +3 -13
  14. package/lib/engine/mem/db/dao/facts.d.ts +311 -56
  15. package/lib/engine/mem/db/dao/triples.d.ts +1 -26
  16. package/lib/engine/mem/db/graph.d.ts +249 -0
  17. package/lib/engine/mem/db/journal_notes.d.ts +35 -0
  18. package/lib/engine/mem/db/migrations.d.ts +9 -0
  19. package/lib/engine/mem/db/port.d.ts +22 -3
  20. package/lib/engine/mem/db/schema.d.ts +119 -0
  21. package/lib/engine/mem/db/tokenizer.d.ts +9 -0
  22. package/lib/engine/mem/dbdrivers/fake/driver.d.ts +75 -0
  23. package/lib/engine/mem/dbdrivers/fake/index.d.ts +7 -0
  24. package/lib/engine/mem/dbdrivers/fake/surface.d.ts +34 -0
  25. package/lib/engine/mem/dbdrivers/fake/transport.d.ts +61 -0
  26. package/lib/engine/mem/dbdrivers/sqlite/connection.d.ts +14 -0
  27. package/lib/engine/mem/dbdrivers/sqlite/contradictions.d.ts +35 -0
  28. package/lib/engine/mem/dbdrivers/sqlite/dao/index.d.ts +16 -0
  29. package/lib/engine/mem/dbdrivers/sqlite/driver.d.ts +54 -0
  30. package/lib/engine/mem/dbdrivers/sqlite/facts.d.ts +117 -0
  31. package/lib/engine/mem/dbdrivers/sqlite/index.d.ts +6 -0
  32. package/lib/engine/mem/dbdrivers/sqlite/migrations.d.ts +15 -0
  33. package/lib/engine/mem/dbdrivers/sqlite/relations.d.ts +62 -0
  34. package/lib/engine/mem/dbdrivers/sqlite/search.d.ts +56 -0
  35. package/lib/engine/mem/dbdrivers/sqlite/sources.d.ts +37 -0
  36. package/lib/engine/mem/defaults.d.ts +3 -4
  37. package/lib/engine/mem/dispatch.d.ts +7 -32
  38. package/lib/engine/mem/entities/extract.d.ts +44 -47
  39. package/lib/engine/mem/eval/derived_runner.d.ts +6 -1
  40. package/lib/engine/mem/eval/relation_gold.d.ts +251 -0
  41. package/lib/engine/mem/eval/write_metrics.d.ts +1 -1
  42. package/lib/engine/mem/facts_io.d.ts +328 -0
  43. package/lib/engine/mem/index.d.ts +10 -2
  44. package/lib/engine/mem/interfaces/capabilities.d.ts +30 -0
  45. package/lib/engine/mem/interfaces/common.d.ts +11 -0
  46. package/lib/engine/mem/interfaces/errors.d.ts +65 -0
  47. package/lib/engine/mem/interfaces/index.d.ts +18 -0
  48. package/lib/engine/mem/interfaces/migrations.d.ts +21 -0
  49. package/lib/engine/mem/interfaces/repositories.d.ts +471 -0
  50. package/lib/engine/mem/interfaces/search_index.d.ts +113 -0
  51. package/lib/engine/mem/interfaces/storage_backend.d.ts +84 -0
  52. package/lib/engine/mem/interfaces/storage_driver.d.ts +43 -0
  53. package/lib/engine/mem/interfaces/version.d.ts +34 -0
  54. package/lib/engine/mem/lifecycle/contradiction.d.ts +2 -2
  55. package/lib/engine/mem/maintenance_paths.d.ts +41 -0
  56. package/lib/engine/mem/modelBootstrap.d.ts +1 -1
  57. package/lib/engine/mem/relations/confidence.d.ts +39 -0
  58. package/lib/engine/mem/relations/extract.d.ts +128 -0
  59. package/lib/engine/mem/relations/index.d.ts +32 -0
  60. package/lib/engine/mem/relations/name-quality.d.ts +78 -0
  61. package/lib/engine/mem/relations/normalize.d.ts +275 -0
  62. package/lib/engine/mem/relations/patterns.d.ts +67 -0
  63. package/lib/engine/mem/relations/statement.d.ts +88 -0
  64. package/lib/engine/mem/relations/types.d.ts +79 -0
  65. package/lib/engine/mem/runtime.d.ts +117 -90
  66. package/lib/engine/mem/storage/create.d.ts +42 -0
  67. package/lib/engine/mem/storage/errors.d.ts +65 -0
  68. package/lib/engine/mem/storage/index.d.ts +15 -0
  69. package/lib/engine/mem/storage/ports.d.ts +472 -0
  70. package/lib/engine/mem/storage/registry.d.ts +37 -0
  71. package/lib/engine/mem/storage/sqlite.d.ts +28 -0
  72. package/lib/engine/mem/store/common.d.ts +1 -1
  73. package/lib/engine/mem/store/entity_leg.d.ts +59 -2
  74. package/lib/engine/mem/store/entity_sweep.d.ts +4 -3
  75. package/lib/engine/mem/store/explicit_relations.d.ts +52 -0
  76. package/lib/engine/mem/store/facts_restore.d.ts +124 -0
  77. package/lib/engine/mem/store/floors.d.ts +4 -1
  78. package/lib/engine/mem/store/graph_reader.d.ts +146 -0
  79. package/lib/engine/mem/store/hybrid.d.ts +50 -13
  80. package/lib/engine/mem/store/kinds.d.ts +47 -0
  81. package/lib/engine/mem/store/legs.d.ts +24 -29
  82. package/lib/engine/mem/store/lexical.d.ts +36 -45
  83. package/lib/engine/mem/store/memory.d.ts +486 -82
  84. package/lib/engine/mem/store/recall_policy.d.ts +49 -0
  85. package/lib/engine/mem/store/relation_backfill.d.ts +210 -0
  86. package/lib/engine/mem/store/relation_planner.d.ts +191 -0
  87. package/lib/engine/mem/store/secret_guard.d.ts +0 -1
  88. package/lib/engine/mem/store/self_query.d.ts +4 -2
  89. package/lib/engine/mem/store/time_filter.d.ts +121 -0
  90. package/lib/engine/mem/store/titles.d.ts +52 -0
  91. package/lib/engine/mem/store/vector_repair.d.ts +44 -54
  92. package/lib/engine/mem-contract/config.d.ts +44 -38
  93. package/lib/engine/mem-contract/text.d.ts +1 -1
  94. package/lib/engine/mem-contract/tools.d.ts +184 -117
  95. package/lib/engine/mem-contract/types.d.ts +364 -288
  96. package/lib/index.js +13898 -11500
  97. package/lib/interface-version.json +1 -1
  98. package/lib/types/client/index.d.ts +2 -2
  99. package/lib/types/client/index.d.ts.map +1 -1
  100. package/lib/types/client/paging.d.ts +3 -12
  101. package/lib/types/client/paging.d.ts.map +1 -1
  102. package/lib/types/client/summarize.d.ts.map +1 -1
  103. package/lib/types/command.d.ts +61 -0
  104. package/lib/types/command.d.ts.map +1 -0
  105. package/lib/types/envinit-bootstrap.d.ts +1 -1
  106. package/lib/types/envinit.d.ts +2 -6
  107. package/lib/types/envinit.d.ts.map +1 -1
  108. package/lib/types/hints.d.ts +28 -24
  109. package/lib/types/hints.d.ts.map +1 -1
  110. package/lib/types/index.d.ts +21 -40
  111. package/lib/types/index.d.ts.map +1 -1
  112. package/lib/types/inject.d.ts +3 -2
  113. package/lib/types/inject.d.ts.map +1 -1
  114. package/lib/types/interface_gate.d.ts +9 -9
  115. package/lib/types/prompt.d.ts +17 -41
  116. package/lib/types/prompt.d.ts.map +1 -1
  117. package/lib/types/provision.d.ts +3 -0
  118. package/lib/types/provision.d.ts.map +1 -1
  119. package/lib/types/remote.d.ts +23 -9
  120. package/lib/types/remote.d.ts.map +1 -1
  121. package/lib/types/render.d.ts +3 -3
  122. package/lib/types/tool_schema.d.ts +4 -0
  123. package/lib/types/tool_schema.d.ts.map +1 -1
  124. package/lib/types/vectorMigration.d.ts +5 -7
  125. package/lib/types/vectorMigration.d.ts.map +1 -1
  126. package/package.json +16 -15
  127. package/lib/engine/mem/config/domains.d.ts +0 -20
  128. package/lib/engine/mem/db/dao/chunks.d.ts +0 -231
  129. package/lib/engine/mem/db/dao/documents.d.ts +0 -51
  130. package/lib/engine/mem/db/hash.d.ts +0 -2
  131. package/lib/engine/mem/db/knowledge.d.ts +0 -17
  132. package/lib/engine/mem/eval/index.d.ts +0 -4
  133. package/lib/engine/mem/git.d.ts +0 -73
  134. package/lib/engine/mem/router.d.ts +0 -51
  135. package/lib/engine/mem/store/doc_files.d.ts +0 -125
  136. package/lib/engine/mem/store/document_text.d.ts +0 -47
  137. package/lib/engine/mem/store/ingest_guard.d.ts +0 -25
  138. package/lib/engine/mem/store/knowledge.d.ts +0 -598
  139. package/lib/engine/mem/store/source_picker.d.ts +0 -43
  140. package/lib/engine/mem-retrieval/adapters/local_reranker.d.ts +0 -52
  141. package/lib/engine/mem-retrieval/adapters/none_reranker.d.ts +0 -10
  142. package/lib/engine/mem-retrieval/rerank.d.ts +0 -13
  143. package/lib/types/client/domains.d.ts +0 -53
  144. package/lib/types/client/domains.d.ts.map +0 -1
  145. package/lib/types/client/ingest.d.ts +0 -24
  146. package/lib/types/client/ingest.d.ts.map +0 -1
  147. package/lib/types/open.d.ts +0 -77
  148. package/lib/types/open.d.ts.map +0 -1
  149. package/lib/types/reconcile.d.ts +0 -64
  150. package/lib/types/reconcile.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The ONE vector-space repair flow both stores run.
2
+ * The vector-space repair flow the memory store runs.
3
3
  *
4
4
  * Changing the embedding space (model, width, pooling, normalization, input window, weights) is a
5
5
  * DATA MIGRATION: persisted vectors keep decoding but live in another model's coordinates, so the
@@ -8,26 +8,25 @@
8
8
  * slices and yields the event loop between them.
9
9
  *
10
10
  * It is a template method implemented by COMPOSITION (AGENTS.md / the design note in
11
- * `docs/vector-repair-shared-flow.md`): the skeleton lives here as free functions, each store
12
- * supplies a {@link VectorRepairTarget} adapter. No common base class — the two stores are separate
13
- * databases with separate DAOs, and a base class would be a structural rewrite of two hub files.
11
+ * `docs/vector-repair-shared-flow.md`): the skeleton lives here as free functions, and the store
12
+ * supplies a {@link VectorRepairTarget} adapter. No base class.
14
13
  *
15
- * What is shared, and therefore must never be copied back into `store/memory.ts` /
16
- * `store/knowledge.ts`: the batch size, the `yieldToEventLoop` call, the stop / resume / no-progress
17
- * rules, the `semantic.auto_migrate` decision, the `dry_run` split, the order invariant
18
- * (unusable bytes leave first, then re-encode), the warmup policy and the four log kinds.
14
+ * What is shared, and therefore must never be copied back into `store/memory.ts`: the batch size,
15
+ * the `yieldToEventLoop` call, the stop / resume / no-progress rules, the `semantic.auto_migrate`
16
+ * decision, the `dry_run` split, the order invariant (unusable bytes leave first, then re-encode),
17
+ * the warmup policy and the four log kinds.
19
18
  *
20
- * What stays in the stores (correct differences, DESIGN §2.3): the DAO calls and row shapes, the
21
- * `conflict_checked` re-queue on the memory side, the `content_hash` reuse and failure counting on
22
- * the knowledge side, the HRR column, and which live index a row is added to.
19
+ * What stays in the store (DESIGN §2.3): the DAO calls and row shapes, the `conflict_checked`
20
+ * re-queue, the HRR column, and which live index a row is added to.
23
21
  *
24
22
  * @module store/vector_repair
25
23
  */
26
24
  import type { AvantfLogger, VectorMigrationOutcome, VectorMigrationProgress, VectorsFixReport, VectorsFixStoreReport } from '../../mem-contract/index.js';
27
25
  import type { VectorStore } from '../../mem-retrieval/index.js';
26
+ import type { Awaitable } from '../interfaces/common.js';
28
27
  import { type StaleVectorCounts } from './common.js';
29
- /** The two stores this flow can drive. */
30
- export type VectorRepairStore = 'memory' | 'knowledge';
28
+ /** The store this flow drives. */
29
+ export type VectorRepairStore = 'memory';
31
30
  /**
32
31
  * Rows one background vector-space migration slice may re-encode.
33
32
  *
@@ -53,14 +52,13 @@ export interface VectorsClassification {
53
52
  missing: number;
54
53
  /**
55
54
  * Ids whose unusable bytes must leave the store before a re-encode picks them up (the `limit`
56
- * passed to {@link VectorRepairTarget.classifyVectors} is applied). Knowledge overwrites vectors
57
- * in place, so it reports none.
55
+ * passed to {@link VectorRepairTarget.classifyVectors} is applied).
58
56
  */
59
57
  dropIds: readonly number[];
60
58
  /**
61
- * Usable persisted vectors absent from the LIVE index, decoded and ready to re-add. Only stores
62
- * whose diagnose surface tracks the live index report this (memory); knowledge rebuilds its index
63
- * at open and keeps it in sync on every write, so it omits the property entirely.
59
+ * Usable persisted vectors absent from the LIVE index, decoded and ready to re-add. A store whose
60
+ * diagnose surface tracks the live index reports this; one that rebuilds its index at open and
61
+ * keeps it in sync on every write omits the property entirely.
64
62
  */
65
63
  unindexed?: readonly {
66
64
  id: number;
@@ -83,12 +81,17 @@ export interface VectorRepairTarget {
83
81
  semanticAvailable(): boolean;
84
82
  /** The RAW `semantic.auto_migrate` value; the flow decides what it means (`!== false`). */
85
83
  autoMigrate(): boolean | undefined;
86
- /** Cheap `{ stale, space_stale, legacy? }` — blob LENGTHS only, never decodes. */
87
- vectorSpaceHealth(): StaleVectorCounts;
84
+ /**
85
+ * Cheap `{ stale, space_stale, legacy? }` — blob LENGTHS only, never decodes.
86
+ *
87
+ * `Awaitable` (DB-2): the count is a repository read, and a remote backend answers asynchronously.
88
+ * The flow always awaits it, so the local adapter's plain value and a remote promise behave alike.
89
+ */
90
+ vectorSpaceHealth(): Awaitable<StaleVectorCounts>;
88
91
  /** Cheap count of ACTIVE rows with no persisted vector (part of `remaining`). */
89
- missingVectorCount(): number;
92
+ missingVectorCount(): Awaitable<number>;
90
93
  /** One scan classifying what needs dropping and re-encoding; `limit` bounds `dropIds`. */
91
- classifyVectors(limit: number): VectorsClassification;
94
+ classifyVectors(limit: number): Awaitable<VectorsClassification>;
92
95
  /**
93
96
  * Optional: put usable persisted vectors missing from the live index back into it, returning how
94
97
  * many were added. Called with the slice of {@link VectorsClassification.unindexed} the current
@@ -97,9 +100,9 @@ export interface VectorRepairTarget {
97
100
  reindexUsable?(rows: readonly {
98
101
  id: number;
99
102
  vec: Float32Array;
100
- }[]): number;
103
+ }[]): Awaitable<number>;
101
104
  /** Clear unusable bytes (table + live index); returns how many rows were actually cleared. */
102
- dropVectors(ids: readonly number[]): number;
105
+ dropVectors(ids: readonly number[]): Awaitable<number>;
103
106
  /** Encode + persist up to `limit` rows into the current space, one row isolated at a time. */
104
107
  reencodeVectors(limit: number): Promise<{
105
108
  encoded: number;
@@ -115,14 +118,12 @@ export interface PersistedVectorRow {
115
118
  embedding_model?: string | null;
116
119
  }
117
120
  /**
118
- * Rebuild one store's live vstore from its persisted rows, count what is unusable in the current
119
- * space, and say so once — the shared "open for business" step both stores used to write twice.
120
- *
121
- * The owning store's ONLY half is the row read (`facts.activeVectorRows()` /
122
- * `chunks.vectorRows()`); the reload, the count and the loud warning are one implementation, so a
123
- * change to what counts as stale cannot land on one store only (the incident this exists for: the
124
- * memory store checked the SPACE while knowledge checked only the WIDTH, so a model swap mixed two
125
- * spaces in one index until someone happened to run `kb_reindex`).
121
+ * Rebuild the store's live vstore from its persisted rows, count what is unusable in the current
122
+ * space, and say so once — the "open for business" step, kept in one implementation so a change to
123
+ * what counts as stale cannot land in one place only.
124
+ *
125
+ * The store's ONLY half is the row read (`facts.activeVectorRows()`); the reload, the count and the
126
+ * loud warning live here.
126
127
  */
127
128
  export declare function loadVectorIndex(opts: {
128
129
  store: VectorRepairStore;
@@ -157,8 +158,8 @@ export interface EncodeWriteTarget {
157
158
  * Persist one group of encoded rows. Throwing fails the WHOLE group, which is what lets the store
158
159
  * decide how to reconcile its live index (see {@link onWriteError}).
159
160
  */
160
- write(rows: readonly EncodedVector[]): void;
161
- /** Rows per `write` call (default 1). Knowledge uses its measured `WRITE_BATCH`. */
161
+ write(rows: readonly EncodedVector[]): Awaitable<void>;
162
+ /** Rows per `write` call (default 1). */
162
163
  readonly writeBatch?: number;
163
164
  /** Called once per row whose encode (or live-index add) failed. */
164
165
  onRowError?(row: VectorEncodeRow, error: unknown): void;
@@ -168,15 +169,13 @@ export interface EncodeWriteTarget {
168
169
  /**
169
170
  * Encode rows one at a time, add each to the live index, and persist them in groups.
170
171
  *
171
- * The shared skeleton: serial encode (a MEASURED decision for chunks — a padded batched forward pass
172
- * is 1.79x slower on real 53–550 character chunks), `add` right after a successful encode, one
173
- * `write` call per `writeBatch` rows, per-row isolation of encode failures, per-group isolation of
174
- * write failures, and the `{ encoded, failed }` count.
172
+ * The skeleton: serial encode (a MEASURED decision — a padded batched forward pass is slower on real
173
+ * per-row texts), `add` right after a successful encode, one `write` call per `writeBatch` rows,
174
+ * per-row isolation of encode failures, per-group isolation of write failures, and the
175
+ * `{ encoded, failed }` count.
175
176
  *
176
177
  * What stays with the store: the backend call, the live index, the write statement, the replay of a
177
- * failed group, and the summary log — the memory store logs per row and keeps a half-written index
178
- * (documented as the benign direction for it), the knowledge store evicts the group so both sides
179
- * agree that the vectors are missing.
178
+ * failed group, and the summary log.
180
179
  */
181
180
  export declare function encodeAndPersist(rows: readonly VectorEncodeRow[], target: EncodeWriteTarget): Promise<{
182
181
  encoded: number;
@@ -229,20 +228,11 @@ export interface DriveVectorRepairOptions {
229
228
  */
230
229
  export declare function driveVectorRepair(target: VectorRepairTarget, opts?: DriveVectorRepairOptions): Promise<VectorMigrationOutcome>;
231
230
  /**
232
- * Drive every store in order. A stop request keeps the drive from starting another store, but each
233
- * store still answers with its snapshot (so the caller can report what is left everywhere).
234
- */
235
- export declare function driveVectorRepairs(targets: readonly VectorRepairTarget[], opts?: DriveVectorRepairOptions): Promise<VectorMigrationOutcome[]>;
236
- /**
237
- * The explicit, unbounded repair behind `mem_admin vectors_fix` / `avantf-mem vectors --fix`,
238
- * covering one or both stores.
231
+ * The explicit, unbounded repair behind `mem_admin vectors_fix` / `avantf-mem vectors --fix`.
239
232
  *
240
- * `store` selects a single store (omitted = both); `dry_run` previews every count without writing —
241
- * and without loading the model (so a preview also reports `would_warm`). The top-level
242
- * `semantic_available` is AND over the selected stores: `false` means at least one store's repair
243
- * could not encode anything.
233
+ * `dry_run` previews every count without writing — and without loading the model (so a preview also
234
+ * reports `would_warm`).
244
235
  */
245
- export declare function vectorsFix(targets: Partial<Record<VectorRepairStore, VectorRepairTarget>>, opts: {
236
+ export declare function vectorsFix(target: VectorRepairTarget, opts: {
246
237
  dryRun: boolean;
247
- store?: VectorRepairStore;
248
238
  }): Promise<VectorsFixReport>;
@@ -4,12 +4,11 @@ import { z } from 'zod';
4
4
  * default embedder, `Xenova/bge-small-zh-v1.5`, shares the same 512-token window — this constant
5
5
  * did NOT move when the embedder changed; only its vector width did, 512 → 768.)
6
6
  *
7
- * Exported because more than one default derives from it: the embedder's fallback window and
8
- * `knowledge.chunk_size` below. transformers.js truncates past the window SILENTLY, so every
9
- * derivation has to agree on the number.
7
+ * Exported because the embedder's fallback input window derives from it. transformers.js truncates
8
+ * past the window SILENTLY, so every derivation has to agree on the number.
10
9
  */
11
10
  export declare const DEFAULT_MODEL_WINDOW_TOKENS = 512;
12
- /** The merged runtime config shared by memory and knowledge stores. */
11
+ /** The merged runtime config shared by the memory store and the retrieval stack. */
13
12
  export declare const ConfigSchema: z.ZodObject<{
14
13
  dataHome: z.ZodDefault<z.ZodString>;
15
14
  semantic: z.ZodPrefault<z.ZodObject<{
@@ -38,6 +37,7 @@ export declare const ConfigSchema: z.ZodObject<{
38
37
  min_semantic_similarity: z.ZodDefault<z.ZodNumber>;
39
38
  min_fts_terms: z.ZodDefault<z.ZodNumber>;
40
39
  min_jaccard: z.ZodDefault<z.ZodNumber>;
40
+ min_score: z.ZodDefault<z.ZodNumber>;
41
41
  leg_cap: z.ZodDefault<z.ZodNumber>;
42
42
  time_window: z.ZodDefault<z.ZodBoolean>;
43
43
  }, z.core.$strip>>;
@@ -80,45 +80,51 @@ export type Config = z.infer<typeof ConfigSchema>;
80
80
  /** Built-in defaults — the lowest precedence layer. */
81
81
  export declare const defaultConfig: Config;
82
82
  /**
83
- * Memory store-specific config. Overrides on top of the common Config.
84
- * Note: `db.path` is the single authoritative path for the memory DB.
83
+ * The storage backend every store opens through (DB-1, docs/DATABASE_PORTABILITY.md §12).
84
+ *
85
+ * `backend` is a STRING, not an enum: an unknown value must reach the composition root and fail
86
+ * there with a message naming the value, rather than being silently replaced by the schema default.
87
+ * Built-in drivers: `sqlite` (default) and `fake` (DB-4, docs/DB_DRIVER_LAYOUT.md §五).
88
+ *
89
+ * Each driver parses its OWN section; this schema only keeps the section alive through config
90
+ * resolution (`storage.sqlite`, `storage.fake`, a future `storage.postgres`).
85
91
  */
86
- export declare const MemoryConfigSchema: z.ZodObject<{
87
- db: z.ZodPrefault<z.ZodObject<{
92
+ export declare const StorageConfigSchema: z.ZodPrefault<z.ZodObject<{
93
+ driver: z.ZodOptional<z.ZodString>;
94
+ backend: z.ZodDefault<z.ZodString>;
95
+ sqlite: z.ZodPrefault<z.ZodObject<{
88
96
  path: z.ZodDefault<z.ZodString>;
89
97
  }, z.core.$strip>>;
90
- }, z.core.$strip>;
91
- export type MemoryConfig = z.infer<typeof MemoryConfigSchema>;
92
- /** Knowledge store-specific config. */
93
- export declare const KnowledgeConfigSchema: z.ZodObject<{
98
+ fake: z.ZodOptional<z.ZodObject<{
99
+ path: z.ZodOptional<z.ZodString>;
100
+ latency_ms: z.ZodOptional<z.ZodNumber>;
101
+ fail_after: z.ZodOptional<z.ZodNumber>;
102
+ fail_message: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>>;
105
+ export type StorageConfig = z.infer<typeof StorageConfigSchema>;
106
+ /**
107
+ * Memory store-specific config. Overrides on top of the common Config.
108
+ *
109
+ * `storage.backend` is the composition-root switch (default `sqlite`). `storage.sqlite.path` is the
110
+ * SQLite file; `db.path` remains as its legacy alias so an existing `memory.yaml` keeps working.
111
+ */
112
+ export declare const MemoryConfigSchema: z.ZodObject<{
94
113
  db: z.ZodPrefault<z.ZodObject<{
95
114
  path: z.ZodDefault<z.ZodString>;
96
115
  }, z.core.$strip>>;
97
- docs: z.ZodPrefault<z.ZodObject<{
98
- dir: z.ZodDefault<z.ZodString>;
99
- }, z.core.$strip>>;
100
- git: z.ZodPrefault<z.ZodObject<{
101
- mode: z.ZodDefault<z.ZodEnum<{
102
- auto: "auto";
103
- off: "off";
104
- }>>;
105
- root: z.ZodDefault<z.ZodString>;
106
- ignore: z.ZodDefault<z.ZodArray<z.ZodString>>;
107
- }, z.core.$strip>>;
108
- open: z.ZodPrefault<z.ZodObject<{
109
- editor: z.ZodDefault<z.ZodString>;
110
- }, z.core.$strip>>;
111
- domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
112
- chunk_size: z.ZodDefault<z.ZodNumber>;
113
- chunk_overlap: z.ZodDefault<z.ZodNumber>;
114
- source_priority: z.ZodDefault<z.ZodEnum<{
115
- workspace: "workspace";
116
- none: "none";
117
- }>>;
118
- ingest: z.ZodPrefault<z.ZodObject<{
119
- local_roots: z.ZodDefault<z.ZodArray<z.ZodString>>;
120
- allow_outside_workspace: z.ZodDefault<z.ZodBoolean>;
121
- allow_private_network: z.ZodDefault<z.ZodBoolean>;
116
+ storage: z.ZodPrefault<z.ZodObject<{
117
+ driver: z.ZodOptional<z.ZodString>;
118
+ backend: z.ZodDefault<z.ZodString>;
119
+ sqlite: z.ZodPrefault<z.ZodObject<{
120
+ path: z.ZodDefault<z.ZodString>;
121
+ }, z.core.$strip>>;
122
+ fake: z.ZodOptional<z.ZodObject<{
123
+ path: z.ZodOptional<z.ZodString>;
124
+ latency_ms: z.ZodOptional<z.ZodNumber>;
125
+ fail_after: z.ZodOptional<z.ZodNumber>;
126
+ fail_message: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$strip>>;
122
128
  }, z.core.$strip>>;
123
129
  }, z.core.$strip>;
124
- export type KnowledgeConfig = z.infer<typeof KnowledgeConfigSchema>;
130
+ export type MemoryConfig = z.infer<typeof MemoryConfigSchema>;
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * ── THE ORIGINAL IS THE BASE KIT ──────────────────────────────────────────────────────────────
14
14
  *
15
- * `base/plugin-base/src/kit/wellformed.ts` owns `wellFormedText` / `wellFormedDeep` (interface v2)
15
+ * `base/src/kit/wellformed.ts` owns `wellFormedText` / `wellFormedDeep` (interface v2)
16
16
  * and is the copy ONE base release fixes for the whole family. This module is its **deliberate
17
17
  * mirror**, in the same sense as `./family.ts` (whose original is the base's `kit/family.ts`): the
18
18
  * engine (`@avantf/mem`) and the CLI / MCP faces have **no DSH host and never load the base**