@monoes/monomindcli 2.16.12 → 2.16.13

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 (217) hide show
  1. package/.claude/agents/core/coder.md +1 -1
  2. package/.claude/agents/engineering/engineering-devops-automator.md +1 -1
  3. package/.claude/agents/github/repo-architect.md +1 -1
  4. package/.claude/agents/testing/production-validator.md +1 -1
  5. package/.claude/agents/testing/testing-tool-evaluator.md +1 -1
  6. package/.claude/commands/github/pr-manager.md +1 -1
  7. package/.claude/helpers/pick-rank.cjs +34 -4
  8. package/.claude/skills/monolean-audit/SKILL.md +1 -1
  9. package/dist/src/commands/cleanup-data.d.ts +30 -0
  10. package/dist/src/commands/cleanup-data.d.ts.map +1 -0
  11. package/dist/src/commands/cleanup-data.js +138 -0
  12. package/dist/src/commands/cleanup-data.js.map +1 -0
  13. package/dist/src/commands/cleanup-scratch.d.ts +43 -0
  14. package/dist/src/commands/cleanup-scratch.d.ts.map +1 -0
  15. package/dist/src/commands/cleanup-scratch.js +125 -0
  16. package/dist/src/commands/cleanup-scratch.js.map +1 -0
  17. package/dist/src/commands/cleanup.d.ts +2 -39
  18. package/dist/src/commands/cleanup.d.ts.map +1 -1
  19. package/dist/src/commands/cleanup.js +5 -247
  20. package/dist/src/commands/cleanup.js.map +1 -1
  21. package/dist/src/commands/doctor-gitignore-checks.d.ts +10 -0
  22. package/dist/src/commands/doctor-gitignore-checks.d.ts.map +1 -0
  23. package/dist/src/commands/doctor-gitignore-checks.js +141 -0
  24. package/dist/src/commands/doctor-gitignore-checks.js.map +1 -0
  25. package/dist/src/commands/doctor-helpers-checks.d.ts +10 -0
  26. package/dist/src/commands/doctor-helpers-checks.d.ts.map +1 -0
  27. package/dist/src/commands/doctor-helpers-checks.js +292 -0
  28. package/dist/src/commands/doctor-helpers-checks.js.map +1 -0
  29. package/dist/src/commands/doctor-memory-checks.d.ts +47 -0
  30. package/dist/src/commands/doctor-memory-checks.d.ts.map +1 -0
  31. package/dist/src/commands/doctor-memory-checks.js +298 -0
  32. package/dist/src/commands/doctor-memory-checks.js.map +1 -0
  33. package/dist/src/commands/doctor-monograph-checks.d.ts +9 -0
  34. package/dist/src/commands/doctor-monograph-checks.d.ts.map +1 -0
  35. package/dist/src/commands/doctor-monograph-checks.js +331 -0
  36. package/dist/src/commands/doctor-monograph-checks.js.map +1 -0
  37. package/dist/src/commands/doctor-project-checks.d.ts +7 -66
  38. package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
  39. package/dist/src/commands/doctor-project-checks.js +10 -1331
  40. package/dist/src/commands/doctor-project-checks.js.map +1 -1
  41. package/dist/src/commands/doctor-routing-checks.d.ts +10 -0
  42. package/dist/src/commands/doctor-routing-checks.d.ts.map +1 -0
  43. package/dist/src/commands/doctor-routing-checks.js +194 -0
  44. package/dist/src/commands/doctor-routing-checks.js.map +1 -0
  45. package/dist/src/commands/doctor-worker-checks.d.ts +17 -0
  46. package/dist/src/commands/doctor-worker-checks.d.ts.map +1 -0
  47. package/dist/src/commands/doctor-worker-checks.js +122 -0
  48. package/dist/src/commands/doctor-worker-checks.js.map +1 -0
  49. package/dist/src/commands/hooks-routing-commands.js +1 -1
  50. package/dist/src/commands/hooks-routing-commands.js.map +1 -1
  51. package/dist/src/commands/init.d.ts.map +1 -1
  52. package/dist/src/commands/init.js +6 -15
  53. package/dist/src/commands/init.js.map +1 -1
  54. package/dist/src/index.js +2 -2
  55. package/dist/src/index.js.map +1 -1
  56. package/dist/src/init/never-commit.d.ts +3 -3
  57. package/dist/src/init/types.d.ts +1 -1
  58. package/dist/src/init/types.js +1 -1
  59. package/dist/src/knowledge/document-store.js +1 -1
  60. package/dist/src/knowledge/document-store.js.map +1 -1
  61. package/dist/src/mcp-tools/hooks-edit-command.d.ts +10 -0
  62. package/dist/src/mcp-tools/hooks-edit-command.d.ts.map +1 -0
  63. package/dist/src/mcp-tools/hooks-edit-command.js +247 -0
  64. package/dist/src/mcp-tools/hooks-edit-command.js.map +1 -0
  65. package/dist/src/mcp-tools/hooks-learning.d.ts +9 -0
  66. package/dist/src/mcp-tools/hooks-learning.d.ts.map +1 -0
  67. package/dist/src/mcp-tools/hooks-learning.js +408 -0
  68. package/dist/src/mcp-tools/hooks-learning.js.map +1 -0
  69. package/dist/src/mcp-tools/hooks-metrics-list.d.ts +8 -0
  70. package/dist/src/mcp-tools/hooks-metrics-list.d.ts.map +1 -0
  71. package/dist/src/mcp-tools/hooks-metrics-list.js +205 -0
  72. package/dist/src/mcp-tools/hooks-metrics-list.js.map +1 -0
  73. package/dist/src/mcp-tools/hooks-route.d.ts +12 -0
  74. package/dist/src/mcp-tools/hooks-route.d.ts.map +1 -0
  75. package/dist/src/mcp-tools/hooks-route.js +251 -0
  76. package/dist/src/mcp-tools/hooks-route.js.map +1 -0
  77. package/dist/src/mcp-tools/hooks-routing.d.ts +6 -27
  78. package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
  79. package/dist/src/mcp-tools/hooks-routing.js +6 -1727
  80. package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
  81. package/dist/src/mcp-tools/hooks-session.d.ts +9 -0
  82. package/dist/src/mcp-tools/hooks-session.d.ts.map +1 -0
  83. package/dist/src/mcp-tools/hooks-session.js +243 -0
  84. package/dist/src/mcp-tools/hooks-session.js.map +1 -0
  85. package/dist/src/mcp-tools/hooks-task.d.ts +17 -0
  86. package/dist/src/mcp-tools/hooks-task.d.ts.map +1 -0
  87. package/dist/src/mcp-tools/hooks-task.js +427 -0
  88. package/dist/src/mcp-tools/hooks-task.js.map +1 -0
  89. package/dist/src/mcp-tools/hooks-tools.d.ts +2 -1
  90. package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
  91. package/dist/src/mcp-tools/hooks-tools.js +2 -1
  92. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  93. package/dist/src/mcp-tools/memory-tools.js +1 -1
  94. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  95. package/dist/src/memory/bm25-index.d.ts +2 -2
  96. package/dist/src/memory/bm25-index.js +2 -2
  97. package/dist/src/memory/embedding-operations.js +2 -2
  98. package/dist/src/memory/embedding-operations.js.map +1 -1
  99. package/dist/src/memory/entity-name-key.d.ts +1 -1
  100. package/dist/src/memory/entity-name-key.js +1 -1
  101. package/dist/src/memory/hnsw-operations.d.ts +1 -1
  102. package/dist/src/memory/hnsw-operations.js +1 -1
  103. package/dist/src/memory/memory-bridge-backend.d.ts +43 -0
  104. package/dist/src/memory/memory-bridge-backend.d.ts.map +1 -0
  105. package/dist/src/memory/memory-bridge-backend.js +363 -0
  106. package/dist/src/memory/memory-bridge-backend.js.map +1 -0
  107. package/dist/src/memory/memory-bridge-core.d.ts +42 -0
  108. package/dist/src/memory/memory-bridge-core.d.ts.map +1 -0
  109. package/dist/src/memory/memory-bridge-core.js +126 -0
  110. package/dist/src/memory/memory-bridge-core.js.map +1 -0
  111. package/dist/src/memory/memory-bridge-entries.d.ts +131 -0
  112. package/dist/src/memory/memory-bridge-entries.d.ts.map +1 -0
  113. package/dist/src/memory/memory-bridge-entries.js +227 -0
  114. package/dist/src/memory/memory-bridge-entries.js.map +1 -0
  115. package/dist/src/memory/memory-bridge-feedback.d.ts +60 -0
  116. package/dist/src/memory/memory-bridge-feedback.d.ts.map +1 -0
  117. package/dist/src/memory/memory-bridge-feedback.js +118 -0
  118. package/dist/src/memory/memory-bridge-feedback.js.map +1 -0
  119. package/dist/src/memory/memory-bridge-paths.d.ts +123 -0
  120. package/dist/src/memory/memory-bridge-paths.d.ts.map +1 -0
  121. package/dist/src/memory/memory-bridge-paths.js +335 -0
  122. package/dist/src/memory/memory-bridge-paths.js.map +1 -0
  123. package/dist/src/memory/memory-bridge-search.d.ts +48 -0
  124. package/dist/src/memory/memory-bridge-search.d.ts.map +1 -0
  125. package/dist/src/memory/memory-bridge-search.js +383 -0
  126. package/dist/src/memory/memory-bridge-search.js.map +1 -0
  127. package/dist/src/memory/memory-bridge-sessions.d.ts +38 -0
  128. package/dist/src/memory/memory-bridge-sessions.d.ts.map +1 -0
  129. package/dist/src/memory/memory-bridge-sessions.js +109 -0
  130. package/dist/src/memory/memory-bridge-sessions.js.map +1 -0
  131. package/dist/src/memory/memory-bridge-store.d.ts +58 -0
  132. package/dist/src/memory/memory-bridge-store.d.ts.map +1 -0
  133. package/dist/src/memory/memory-bridge-store.js +201 -0
  134. package/dist/src/memory/memory-bridge-store.js.map +1 -0
  135. package/dist/src/memory/memory-bridge.d.ts +10 -438
  136. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  137. package/dist/src/memory/memory-bridge.js +14 -1787
  138. package/dist/src/memory/memory-bridge.js.map +1 -1
  139. package/dist/src/memory/memory-kg-claims.d.ts +52 -0
  140. package/dist/src/memory/memory-kg-claims.d.ts.map +1 -0
  141. package/dist/src/memory/memory-kg-claims.js +99 -0
  142. package/dist/src/memory/memory-kg-claims.js.map +1 -0
  143. package/dist/src/memory/memory-kg-index.d.ts +86 -0
  144. package/dist/src/memory/memory-kg-index.d.ts.map +1 -0
  145. package/dist/src/memory/memory-kg-index.js +256 -0
  146. package/dist/src/memory/memory-kg-index.js.map +1 -0
  147. package/dist/src/memory/memory-kg-ingest.d.ts +44 -0
  148. package/dist/src/memory/memory-kg-ingest.d.ts.map +1 -0
  149. package/dist/src/memory/memory-kg-ingest.js +361 -0
  150. package/dist/src/memory/memory-kg-ingest.js.map +1 -0
  151. package/dist/src/memory/memory-kg-model.d.ts +168 -0
  152. package/dist/src/memory/memory-kg-model.d.ts.map +1 -0
  153. package/dist/src/memory/memory-kg-model.js +158 -0
  154. package/dist/src/memory/memory-kg-model.js.map +1 -0
  155. package/dist/src/memory/memory-kg-names.d.ts +64 -0
  156. package/dist/src/memory/memory-kg-names.d.ts.map +1 -0
  157. package/dist/src/memory/memory-kg-names.js +187 -0
  158. package/dist/src/memory/memory-kg-names.js.map +1 -0
  159. package/dist/src/memory/memory-kg-promote.d.ts +79 -0
  160. package/dist/src/memory/memory-kg-promote.d.ts.map +1 -0
  161. package/dist/src/memory/memory-kg-promote.js +248 -0
  162. package/dist/src/memory/memory-kg-promote.js.map +1 -0
  163. package/dist/src/memory/memory-kg-rebuild.d.ts +77 -0
  164. package/dist/src/memory/memory-kg-rebuild.d.ts.map +1 -0
  165. package/dist/src/memory/memory-kg-rebuild.js +299 -0
  166. package/dist/src/memory/memory-kg-rebuild.js.map +1 -0
  167. package/dist/src/memory/memory-kg-rollback.d.ts +47 -0
  168. package/dist/src/memory/memory-kg-rollback.d.ts.map +1 -0
  169. package/dist/src/memory/memory-kg-rollback.js +193 -0
  170. package/dist/src/memory/memory-kg-rollback.js.map +1 -0
  171. package/dist/src/memory/memory-kg-rules.d.ts +64 -0
  172. package/dist/src/memory/memory-kg-rules.d.ts.map +1 -0
  173. package/dist/src/memory/memory-kg-rules.js +251 -0
  174. package/dist/src/memory/memory-kg-rules.js.map +1 -0
  175. package/dist/src/memory/memory-kg-scan.d.ts +118 -0
  176. package/dist/src/memory/memory-kg-scan.d.ts.map +1 -0
  177. package/dist/src/memory/memory-kg-scan.js +209 -0
  178. package/dist/src/memory/memory-kg-scan.js.map +1 -0
  179. package/dist/src/memory/memory-kg-search.d.ts +80 -0
  180. package/dist/src/memory/memory-kg-search.d.ts.map +1 -0
  181. package/dist/src/memory/memory-kg-search.js +239 -0
  182. package/dist/src/memory/memory-kg-search.js.map +1 -0
  183. package/dist/src/memory/memory-kg.d.ts +19 -547
  184. package/dist/src/memory/memory-kg.d.ts.map +1 -1
  185. package/dist/src/memory/memory-kg.js +10 -2389
  186. package/dist/src/memory/memory-kg.js.map +1 -1
  187. package/dist/src/ui/org-hil.mjs +1 -1
  188. package/dist/src/ui/routes-org-agents.mjs +318 -0
  189. package/dist/src/ui/routes-org-approvals.mjs +133 -0
  190. package/dist/src/ui/routes-org-config.mjs +459 -0
  191. package/dist/src/ui/routes-org-control.mjs +300 -0
  192. package/dist/src/ui/routes-org-files.mjs +172 -0
  193. package/dist/src/ui/routes-org-helpers.mjs +84 -0
  194. package/dist/src/ui/routes-org-knowledge.mjs +262 -0
  195. package/dist/src/ui/routes-org-lifecycle.mjs +224 -0
  196. package/dist/src/ui/routes-org-live.mjs +278 -0
  197. package/dist/src/ui/routes-org-mastermind.mjs +346 -0
  198. package/dist/src/ui/routes-org-planning.mjs +398 -0
  199. package/dist/src/ui/routes-org-runs.mjs +430 -0
  200. package/dist/src/ui/routes-org-status.mjs +342 -0
  201. package/dist/src/ui/routes-org-workflows.mjs +212 -0
  202. package/dist/src/ui/routes-org.mjs +26 -3847
  203. package/dist/src/ui/server.mjs +1 -1
  204. package/dist/src/utils/native-error.d.ts +1 -1
  205. package/dist/src/utils/native-error.js +1 -1
  206. package/dist/src/utils/paths.d.ts +2 -1
  207. package/dist/src/utils/paths.d.ts.map +1 -1
  208. package/dist/src/utils/paths.js +2 -1
  209. package/dist/src/utils/paths.js.map +1 -1
  210. package/dist/tsconfig.tsbuildinfo +1 -1
  211. package/org-skills/adversarial-reviewer/SKILL.md +1 -1
  212. package/org-skills/board-deck-builder/SKILL.md +1 -1
  213. package/org-skills/code-reviewer/SKILL.md +1 -1
  214. package/org-skills/debugging-wizard/SKILL.md +1 -1
  215. package/org-skills/scientific-thinking-literature-review/SKILL.md +1 -1
  216. package/org-skills/scientific-thinking-scholar-evaluation/SKILL.md +1 -1
  217. package/package.json +8 -8
@@ -88,553 +88,25 @@
88
88
  *
89
89
  * @module v1/cli/memory/memory-kg
90
90
  */
91
- export declare const KG_NODES_NS = "kg:nodes";
92
- export declare const KG_EDGES_NS = "kg:edges";
93
- export declare const RULES_NS = "rules";
94
- /** Name → entity index. Index rows are NOT claims, so they live outside the
95
- * three claim namespaces: putting them in `kg:nodes` would make them seed
96
- * candidates for `kgSearch` and rows in `kgStats`. */
97
- export declare const KG_NAMES_NS = "kg:names";
98
- /** Derived adjacency index namespace (K7). See `KgNamespaces.adj`. */
99
- export declare const KG_ADJ_NS = "kg:adj";
100
- /** Derived origin-support index namespace (K7). See `KgNamespaces.originIdx`. */
101
- export declare const KG_ORIGIN_IDX_NS = "kg:origin-idx";
102
- /** Derived-index status namespace (K7). See `KgNamespaces.indexStatus`. */
103
- export declare const KG_INDEX_STATUS_NS = "kg:index-status";
104
- /**
105
- * Version of the identity scheme implemented by `entityId`/`edgeKey`/`ruleKey`.
106
- *
107
- * Bump when a derivation changes. Entries written under an older scheme are not
108
- * orphaned: resolution probes the previous key shape and adopts the row in
109
- * place (see `resolveEntity`), so a bump costs a second keyed lookup on the
110
- * miss path rather than a migration.
111
- *
112
- * Version 1 was the name-only scheme (`n:<normalized-name>`, truncated to 200
113
- * characters), under which `Person:Alex` and `Service:Alex` were one entity and
114
- * two names first differing at character 250 were one entity.
115
- */
116
- export declare const KG_ID_VERSION = 2;
117
- /** Mint an entity id from the full identity tuple.
118
- *
119
- * This MINTS; it does not RESOLVE. A caller that computes an id and writes to
120
- * it bypasses the name index and re-forks the entities the index exists to
121
- * keep together — every ingest path goes through `resolveEntity` instead. */
122
- export declare function nodeKey(type: string, name: string): string;
123
- export interface KgNodeInput {
124
- name: string;
125
- /** Basic type, cognee-style ("Person", "Tool", "Service") — not over-specific. */
126
- type?: string;
127
- description?: string;
128
- nodeSet?: string;
129
- }
130
- export interface KgEdgeInput {
131
- source: string;
132
- target: string;
133
- /** snake_case relation name. */
134
- relation: string;
135
- /** One-sentence concrete fact using the endpoint names. */
136
- description?: string;
137
- sourceType?: string;
138
- targetType?: string;
139
- }
140
- export interface KgIngestResult {
141
- success: boolean;
142
- nodesAdded: number;
143
- nodesMerged: number;
144
- edgesAdded: number;
145
- edgesMerged: number;
146
- /** Writes the bridge refused, one message each (capped at MAX_FAILURES).
147
- * Non-empty ⇒ `success` is false and the counters describe only what
148
- * actually persisted. */
149
- failures?: string[];
150
- error?: string;
151
- /** Items the payload asked for that this call refused. Present only when
152
- * non-zero, so a caller who sent a clean payload sees a clean result. */
153
- nodesRejected?: number;
154
- edgesRejected?: number;
155
- /** Items dropped because the payload exceeded the per-call cap. The cap has
156
- * not changed; what has changed is that it is now REPORTED instead of being
157
- * a silent `.slice()`. */
158
- nodesTruncated?: number;
159
- edgesTruncated?: number;
160
- /** Why items were rejected, one message each (capped at MAX_FAILURES). */
161
- rejections?: string[];
162
- /** Endpoint entities created because an edge named them and they did not
163
- * exist. Edge-only ingestion used to succeed with zero nodes and one edge,
164
- * leaving a fact unreachable through both of its own endpoints. */
165
- placeholders?: number;
166
- /** Same-name entities this call did NOT merge with, one message each. A
167
- * same-name match is a CANDIDATE, not a merge. */
168
- ambiguities?: string[];
169
- /** Elements whose support ledger hit `MAX_CLAIMS` on this call, so their
170
- * oldest provenance was dropped. Never silent. */
171
- provenanceTruncated?: number;
172
- }
173
- /** cognee DataPoint normalization: lowercase, spaces→_, strip apostrophes. */
174
- export declare function normalizeName(name: string): string;
175
- /** Who owns a set of graph facts. `org` absent = project-shared knowledge. */
176
- export interface KgScope {
177
- org?: string;
178
- }
179
- export interface KgNamespaces {
180
- nodes: string;
181
- edges: string;
182
- rules: string;
183
- /** Name → entity index backing `resolveEntity`. Holds no claims. */
184
- names: string;
185
- /** Derived adjacency index: entity id -> edge keys touching it (K7). Holds
186
- * no claims either — every entry is rebuildable from `edges`. */
187
- adj: string;
188
- /** Derived origin-support index: origin ref -> {ns,key} refs it supports,
189
- * across nodes/edges/rules (K7). Rebuildable from all three. */
190
- originIdx: string;
191
- /** This scope's derived-index build/readiness state (K7). One row. */
192
- indexStatus: string;
193
- }
194
- /** The namespaces a scope owns. Every read and write in this module resolves
195
- * through here, which is what makes ownership enforced rather than advisory:
196
- * there is no code path that reaches an org's facts without naming that org,
197
- * and none that reaches every org at once. */
198
- export declare function kgNamespaces(scope?: KgScope): KgNamespaces;
199
- /** Stamp the asserting org onto a provenance ref, so a claim's origin says WHO
200
- * asserted it and not merely which run id — `run:m4x2` alone is ambiguous
201
- * across orgs, and a promoted claim in the shared graph would otherwise carry
202
- * an origin no one owns.
203
- *
204
- * Applied by the ingest/rollback entry points rather than by callers: a
205
- * caller that forgets is exactly how ownership stopped being enforced. */
206
- export declare function kgQualifyOrigin(originRef: string, scope?: KgScope): string;
207
- /** How a claim came to exist.
208
- *
209
- * `asserted` — someone stated it: an LLM distillation, an explicit
210
- * `memory_kg_ingest`, an org's `org_learn`.
211
- * `heuristic` — `heuristicExtract` inferred it from two names appearing in one
212
- * sentence. Nobody asserted it, and the module header has always called it
213
- * lower-trust; until now nothing downstream could tell the two apart. */
214
- export type KgExtractionMethod = 'asserted' | 'heuristic';
215
- /** One origin's assertion about an element. An origin re-asserting replaces its
216
- * own contribution — a run stands behind its latest word, not its first. */
217
- export interface KgClaim {
218
- origin: string;
219
- description: string;
220
- /** Assertion time, and the ordering that decides which claim is current. */
221
- at: number;
222
- /** Absent on rows written before extraction method was recorded. Absent means
223
- * UNKNOWN, never `asserted` — defaulting an unrecorded method to the higher
224
- * trust would relabel every old co-occurrence guess as a stated fact. */
225
- method?: KgExtractionMethod;
226
- }
227
- /** An entity the name index knows about. */
228
- export interface KgNameCandidate {
229
- id: string;
230
- /** Identity-bearing type bucket; '' for an entity asserted without a type. */
231
- type: string;
232
- }
233
- /** Merge extracted nodes/edges into the KG.
234
- *
235
- * Identity is the (type, name) tuple resolved through the name index, so an
236
- * entity is idempotent under re-extraction but two different things sharing a
237
- * name stay two things. Each write adds this origin's CONTRIBUTION to the
238
- * element's claim ledger, from which the description and `origin_refs` are
239
- * derived — which is what lets a later ingest correct an earlier one and lets
240
- * rollback put the earlier one back.
241
- *
242
- * The COMPLETE payload is validated before anything is written, and every edge
243
- * endpoint is made to exist (as a placeholder entity when the caller named one
244
- * that does not) before the edge lands. An edge whose endpoint could not be
245
- * created is rejected rather than written: retrieval is seeded from nodes, so
246
- * an edge with a missing endpoint is a fact that cannot be found through
247
- * either of the things it is about.
248
- *
249
- * NOT ATOMIC — the memory bridge has no transaction primitive, so a failure
250
- * part-way through leaves earlier writes persisted. The counters therefore
251
- * report only what actually landed, `failures` lists what did not, and
252
- * `success` is false whenever anything was refused. A partial ingest is safe
253
- * to retry: every write is a keyed upsert. */
254
- export declare function kgIngest(options: {
255
- nodes: KgNodeInput[];
256
- edges?: KgEdgeInput[];
257
- /** Provenance: run id, session id, or doc hash this extraction came from.
258
- * Stored qualified by `scope` — see `kgQualifyOrigin`. */
259
- originRef: string;
260
- /** Owner of these facts. Omit for project-shared knowledge. */
261
- scope?: KgScope;
262
- /** How this payload was produced. Defaults to `asserted`; `heuristicExtract`
263
- * callers must pass `heuristic` so a co-occurrence guess is not stored as a
264
- * stated fact. Recorded per origin, so the same element can hold a heuristic
265
- * claim from one run and an asserted one from another. */
266
- method?: KgExtractionMethod;
267
- dbPath?: string;
268
- }): Promise<KgIngestResult>;
269
- export interface RuleVerdict {
270
- rule: string;
271
- /** `failed` — the candidate was fine, but a write the caller was told about
272
- * did not land. It is neither `invalid` (which blames the caller's input)
273
- * nor `accepted`/`already_known` (which claim the graph now holds it). Both
274
- * of those used to be reported unconditionally, so a caller reading verdicts
275
- * saw every rule land while the aggregate `accepted` count said zero. */
276
- verdict: 'accepted' | 'already_known' | 'invalid' | 'failed';
277
- similarTo?: string;
278
- }
279
- /** Stage-2 of cognee's curator/writer distillation: the CALLER (an LLM agent)
280
- * proposes candidate rules; this accepts each unless a semantically
281
- * near-identical rule exists (embedding dedup — deterministic keys can't
282
- * collapse paraphrases). Accepted rules are stored both as KG nodes
283
- * (node_set=rules) and as plain `rules`-namespace entries so the existing
284
- * injection/search surfaces pick them up with zero new plumbing.
285
- *
286
- * A candidate that dedups against an existing rule still ADDS its origin to
287
- * that rule's support set: two independent runs asserting the same rule mean
288
- * the rule survives either one being rolled back. Dropping the second origin
289
- * (as this used to) made rollback of the FIRST run delete knowledge the
290
- * second run independently vouched for.
291
- *
292
- * Like `kgIngest`, NOT atomic — see that function's note. */
293
- export declare function kgIngestRules(options: {
294
- rules: {
295
- rule: string;
296
- context?: string;
297
- }[];
298
- originRef: string;
299
- /** Owner of these rules. Omit for project-shared knowledge. */
300
- scope?: KgScope;
301
- dbPath?: string;
302
- /** Similarity above which a candidate is already_known (default 0.78 —
303
- * MiniLM paraphrases of the same rule commonly land 0.78-0.9; cognee's
304
- * equivalent control is prompt-injected LLM judgment, which we approximate). */
305
- dedupThreshold?: number;
306
- }): Promise<{
307
- success: boolean;
308
- verdicts: RuleVerdict[];
309
- accepted: number;
310
- failures?: string[];
311
- error?: string;
312
- /** Candidates dropped by the per-call cap, reported rather than sliced away
313
- * in silence. */
314
- rulesTruncated?: number;
315
- }>;
316
- /** List stored rules (for injection or review). */
317
- export declare function kgListRules(options?: {
318
- dbPath?: string;
319
- limit?: number;
320
- scope?: KgScope;
321
- }): Promise<{
322
- rule: string;
323
- key: string;
324
- }[]>;
325
- export interface KgSearchResult {
326
- success: boolean;
327
- /** Rendered triplet lines, best first. */
328
- context: string;
329
- triplets: {
330
- source: string;
331
- relation: string;
332
- target: string;
333
- fact: string;
334
- score: number;
335
- /** How this edge came to exist. Absent means the edge predates method
336
- * recording — not recorded, which is not the same as `asserted`. */
337
- method?: KgExtractionMethod;
338
- /** Live origins disagree about what this edge says. Present only when true. */
339
- conflict?: boolean;
340
- /** The edge's bridge entry id — feed this straight to `memory_feedback`
341
- * (`bridgeApplyFeedback`/`bridgeRecordUsage`) to rate THIS relationship
342
- * directly, rather than only the seed entity that surfaced it (K5). */
343
- id: string;
344
- /** The edge's stable graph key (`e:<hash>`, see `edgeKey`), for direct
345
- * `bridgeGetEntry` lookup or diagnostics — distinct from `id` above. */
346
- key: string;
347
- }[];
348
- seeds: {
349
- name: string;
350
- type: string;
351
- description: string;
352
- score: number;
353
- id: string;
354
- }[];
355
- /** True when the edge scan did NOT cover the whole namespace — the scan hit
356
- * `SEARCH_EDGE_SCAN_MAX`, or the backend became unreadable partway. A
357
- * relationship that exists may be missing from `triplets`; absence here is
358
- * not evidence of absence in the graph. */
359
- truncated?: boolean;
360
- /** Edge rows actually read, so a caller can see how close it ran to the cap. */
361
- scannedEdges?: number;
362
- /** What the seed retrieval ACTUALLY ran, straight from the bridge — never what
363
- * was hoped for. `keyword-fallback` means the vector path was tried and did
364
- * not serve these results. Absent only when the bridge reported nothing. */
365
- method?: 'semantic' | 'keyword' | 'keyword-fallback';
366
- /** Why the vector path did not serve the seeds (absent when it did). */
367
- fallbackReason?: string;
368
- error?: string;
369
- }
370
- /** Seeded retrieval → neighborhood → triplet ranking (cognee's brute-force
371
- * triplet search, scaled down). Seed scores already carry the Phase 1 feedback
372
- * blend, and the seed retrieval may be vector or keyword — `method` on the
373
- * result says which actually ran.
374
- *
375
- * Ranking weighs exactly two evidence signals, both read off the claim ledger:
376
- * extraction method and description conflict. It deliberately does NOT model
377
- * source credibility, claim freshness, or whether the relation itself answers
378
- * the query — those need an evaluation set to tune against, and guessing at
379
- * them would be the same overclaim this weighting exists to correct. */
380
- export declare function kgSearch(options: {
381
- query: string;
382
- dbPath?: string;
383
- limit?: number;
384
- nodeSet?: string;
385
- /** Whose graph to search. Omit for project-shared knowledge; a scoped search
386
- * never reaches another org's facts, and never the shared graph either. */
387
- scope?: KgScope;
388
- }): Promise<KgSearchResult>;
389
- export declare function kgGlossary(options?: {
390
- dbPath?: string;
391
- limit?: number;
392
- /** Whose entity names to offer. The coordinator glossary MUST be scoped:
393
- * suggesting another org's entity names is how one org's claims get merged
394
- * into another's graph under a shared name. */
395
- scope?: KgScope;
396
- }): Promise<string[]>;
397
- /** Withdraw `originRef`'s support from the graph: remove it from every
398
- * node/edge/rule it backs, and delete the element once no origin remains.
399
- *
400
- * The withdrawn ref is REWRITTEN out of the surviving elements' origin lists,
401
- * not left behind. Retaining it (as this used to) meant a second rollback saw
402
- * a two-entry list and retained again — so an element could outlive the
403
- * withdrawal of every origin that ever supported it.
404
- *
405
- * The scan is EXHAUSTIVE: it pages each namespace to the end rather than
406
- * reading one capped list. A capped scan let an element past the cap keep a
407
- * withdrawn origin while the caller was told the rollback succeeded.
408
- *
409
- * Collect-then-mutate is deliberate: deleting a row pulls every later row back
410
- * one position, so a delete inside the page loop would make an advancing
411
- * offset skip whatever slid into the gap. (Rewrites are no longer a hazard —
412
- * the bridge's upsert reuses the existing entry id and preserves `createdAt`
413
- * rather than re-inserting at the head of the default ordering — but this
414
- * function deletes as well as rewrites.) Only origin-carrying entries are
415
- * retained during the scan, so memory tracks the rollback's own footprint, not
416
- * the namespace size. */
417
- export declare function kgRollback(options: {
418
- originRef: string;
419
- /** Whose knowledge to withdraw from. A rollback can only reach the named
420
- * scope's namespaces — an org's rollback is an ownership boundary, not just
421
- * a label on the output. */
422
- scope?: KgScope;
423
- dbPath?: string;
424
- }): Promise<{
425
- success: boolean;
426
- deleted: number;
427
- retained: number;
428
- failures?: string[];
429
- error?: string;
430
- /** Edges deleted because this rollback removed an endpoint they name. A
431
- * relation between two things is not a fact once one of them is gone, and
432
- * retrieval is node-seeded, so leaving them behind left unreachable rows
433
- * claiming a graph that no longer exists. */
434
- danglingEdgesRemoved?: number;
435
- }>;
436
- export interface KgPromoteResult {
437
- success: boolean;
438
- nodes: number;
439
- edges: number;
440
- rules: number;
441
- /** Origin the shared copy carries, so the promotion can be withdrawn on its
442
- * own and the shared graph records who shared the claim. */
443
- promotedAs: string;
444
- failures?: string[];
445
- error?: string;
446
- }
447
- /** Copy one origin's claims out of an org's scope into project-shared
448
- * knowledge.
449
- *
450
- * Sharing is deliberate, never a side effect of learning: `kgIngest` under a
451
- * scope only ever writes that org's namespaces, and this is the one path a
452
- * claim takes across the boundary. The org keeps its own copy untouched — the
453
- * shared copy is an INDEPENDENT assertion under `promoted:<org-ref>`, so
454
- * rolling back either side leaves the other standing, and a shared claim
455
- * always names the org that vouched for it.
456
- *
457
- * Like ingest, NOT atomic: the counters report what actually landed. */
458
- export declare function kgPromote(options: {
459
- /** The org-side ref to promote, unqualified (e.g. `run:m4x2`). */
460
- originRef: string;
461
- /** Owner the claims are promoted FROM. Promoting from the shared scope is a
462
- * no-op and is refused rather than silently duplicating. */
463
- from: KgScope;
464
- dbPath?: string;
465
- }): Promise<KgPromoteResult>;
466
- export interface ConsolidationCandidate {
467
- name: string;
468
- type: string;
469
- description: string;
470
- edgeCount: number;
471
- /** Neighborhood facts to merge into one canonical description. */
472
- neighborhood: string[];
473
- }
474
- /** Entities whose descriptions are stale relative to their connectivity —
475
- * the LLM half runs in the LIVE agent: it rewrites each candidate's
476
- * description from the neighborhood facts and resubmits via memory_kg_ingest.
477
- * A resubmission is a NEW contribution and therefore the current one, so a
478
- * shorter but better-supported summary now wins; under "longest description
479
- * wins" a consolidation that tightened the prose was silently discarded.
480
- * No LLM here (fully local constraint). */
481
- export declare function kgConsolidateCandidates(options?: {
482
- dbPath?: string;
483
- /** Minimum edges for a node to qualify (default 3). */
484
- minEdges?: number;
485
- limit?: number;
486
- scope?: KgScope;
487
- }): Promise<ConsolidationCandidate[]>;
488
- /** Real counts, not page lengths. `bridgeListEntries.total` reports how many
489
- * rows that one call returned, so the old capped list made a 10,001-node graph
490
- * report exactly 10,000 forever.
491
- *
492
- * Tries a real indexed `SELECT COUNT(*) WHERE namespace = ?` first
493
- * (`bridgeCountEntries`, K7) — cheap and exact, since every row in a KG
494
- * namespace is exactly one node/edge/rule (the name index lives in its own
495
- * namespace). Falls back to the paginated scan — one query per 1,000 rows,
496
- * still exact — when the loaded bridge predates `bridgeCountEntries`, or a
497
- * test double doesn't stub it. */
498
- export declare function kgStats(options?: {
499
- dbPath?: string;
500
- /** Whose graph to measure. Counting every org's facts under one org's name
501
- * is what made `org memory <name> stats` a fiction. */
502
- scope?: KgScope;
503
- }): Promise<{
504
- nodes: number;
505
- edges: number;
506
- rules: number;
507
- }>;
508
- export interface KgReferenceEdge {
509
- key: string;
510
- src: string;
511
- dst: string;
512
- relation: string;
513
- originRefs: string[];
514
- }
515
- /** Complete, uncapped read of every edge touching `endpointId` (as either
516
- * src or dst) and/or asserted by `originRef` — at least one filter is
517
- * required. This is the ground truth an indexed adjacency/origin lookup
518
- * (K7) must agree with once one exists: an exhaustive paged scan, the same
519
- * mechanism `kgRollback` already trusts for origin withdrawal, so it never
520
- * depends on an index and never inherits the old first-page cap.
521
- *
522
- * `truncated: true` means the scan did not finish — an incomplete answer,
523
- * never an empty one. Callers comparing this against a future index must
524
- * treat a truncated reference read as "unknown", not as "no matches". */
525
- export declare function kgReferenceEdges(options: {
526
- endpointId?: string;
527
- originRef?: string;
528
- scope?: KgScope;
529
- dbPath?: string;
530
- }): Promise<{
531
- success: boolean;
532
- edges: KgReferenceEdge[];
533
- truncated?: boolean;
534
- error?: string;
535
- }>;
536
- export type KgIndexState = 'absent' | 'building' | 'validating' | 'ready' | 'failed';
537
- export interface KgIndexStatus {
538
- state: KgIndexState;
539
- schemaVersion: number;
540
- /** Resume point for an interrupted `kgRebuildIndex`. */
541
- cursor?: {
542
- phase: 'nodes' | 'edges' | 'rules';
543
- offset: number;
544
- };
545
- counts?: {
546
- nodes: number;
547
- edges: number;
548
- rules: number;
549
- };
550
- startedAt?: number;
551
- updatedAt?: number;
552
- error?: string;
553
- /** Only meaningful when `state === 'failed'`. True for a build-phase
554
- * failure (the backend went unavailable mid-scan, or a dual-write hook
555
- * hit an error after `ready`): everything already written is still
556
- * correct, just incomplete, so the next call RESUMES from `cursor`. False
557
- * for a validation-phase failure (the built index disagreed with an
558
- * independent reference read): something already written is wrong, not
559
- * merely incomplete, so the next call restarts a fresh scan — resuming
560
- * would re-derive the same mistake instead of correcting it. */
561
- resumable?: boolean;
562
- }
563
- /** This scope's derived-index build/readiness state. `absent` means no one
564
- * has ever called `kgRebuildIndex` for it — every read behaves exactly as
565
- * it did before this index existed. */
566
- export declare function kgIndexStatus(options?: {
567
- scope?: KgScope;
568
- dbPath?: string;
569
- }): Promise<KgIndexStatus>;
570
- export interface KgRebuildResult {
571
- success: boolean;
572
- status: KgIndexStatus;
573
- validation?: {
574
- sampledEntities: number;
575
- sampledOrigins: number;
576
- full: boolean;
577
- };
578
- error?: string;
579
- }
580
- /** (Re)build a scope's derived index from canonical data — nodes, then
581
- * edges, then rules, that fixed order, resuming from the last checkpointed
582
- * `{phase, offset}` rather than restarting when a prior call was
583
- * interrupted mid-build. Every write here (`addToAdj`/`addToOriginIndex`)
584
- * is idempotent, so a page reprocessed after an interruption cannot
585
- * duplicate an entry.
586
- *
587
- * A concurrent ingest/rollback during the build is safe, not just tolerated:
588
- * the dual-write hooks run whenever state is not `absent`/`failed`, so a
589
- * write made mid-build is captured whether or not the scan has reached that
590
- * row yet — at worst twice, which idempotency absorbs for free. The one
591
- * residual race (a row deleted between the scan reading it and the scan's
592
- * own write landing) can leave a dangling ref in the index; it is never
593
- * observable as wrong data, because every indexed READ
594
- * (`kgIndexedEdgesByEndpoint`/`kgIndexedByOrigin`) returns `null` — and the
595
- * caller falls back to the exhaustive scan — the instant it cannot resolve
596
- * a ref it holds. This is the backend's real capability (single-row CAS,
597
- * no cross-row transaction), used honestly rather than claiming atomicity
598
- * it cannot provide.
599
- *
600
- * Ends in `validating`: samples up to `VALIDATE_SAMPLE` of the entities and
601
- * origins the scan actually saw, and re-reads them through the just-built
602
- * index, comparing against a FRESH, independent reference read
603
- * (`kgReferenceEdges`/`collectByOrigin`) — not the in-memory data the build
604
- * itself computed, which would only prove the build agrees with itself. A
605
- * write that silently failed, or a concurrent change the dual-write hooks
606
- * missed, is exactly what this catches before the index is ever trusted. */
607
- export declare function kgRebuildIndex(options?: {
608
- scope?: KgScope;
609
- dbPath?: string;
610
- }): Promise<KgRebuildResult>;
611
- export interface KgIntegrityResult {
612
- success: boolean;
613
- edges: number;
614
- /** Edges naming an endpoint that does not exist. Retrieval is node-seeded,
615
- * so such an edge is a fact unreachable through either of the things it is
616
- * about — it can only be found by a check like this one. */
617
- dangling: {
618
- key: string;
619
- missing: string[];
620
- }[];
621
- /** True when the edge scan did not cover the namespace: absence of a dangling
622
- * edge here is then not evidence that there is none. */
623
- truncated?: boolean;
624
- error?: string;
625
- }
626
- /** Verify that every edge's endpoints exist.
627
- *
628
- * `kgIngest` now creates missing endpoints before writing an edge and
629
- * `kgRollback` removes edges whose endpoints it deleted, so a healthy graph
630
- * reports nothing. This exists for graphs written before either rule, and as
631
- * the check that says so rather than assuming it. */
632
- export declare function kgIntegrityCheck(options?: {
633
- dbPath?: string;
634
- scope?: KgScope;
635
- /** Dangling edges to report before stopping (default 100). */
636
- limit?: number;
637
- }): Promise<KgIntegrityResult>;
91
+ import type { KgEdgeInput, KgNodeInput } from './memory-kg-model.js';
92
+ export type { KgClaim, KgExtractionMethod } from './memory-kg-claims.js';
93
+ export type { KgIndexState, KgIndexStatus } from './memory-kg-index.js';
94
+ export { kgIndexStatus } from './memory-kg-index.js';
95
+ export { kgIngest } from './memory-kg-ingest.js';
96
+ export type { KgEdgeInput, KgIngestResult, KgNamespaces, KgNodeInput, KgScope, } from './memory-kg-model.js';
97
+ export { KG_ADJ_NS, KG_EDGES_NS, KG_ID_VERSION, KG_INDEX_STATUS_NS, KG_NAMES_NS, KG_NODES_NS, KG_ORIGIN_IDX_NS, kgNamespaces, kgQualifyOrigin, nodeKey, normalizeName, RULES_NS, } from './memory-kg-model.js';
98
+ export type { KgNameCandidate } from './memory-kg-names.js';
99
+ export type { ConsolidationCandidate, KgPromoteResult } from './memory-kg-promote.js';
100
+ export { kgConsolidateCandidates, kgPromote, kgStats } from './memory-kg-promote.js';
101
+ export type { KgIntegrityResult, KgRebuildResult } from './memory-kg-rebuild.js';
102
+ export { kgIntegrityCheck, kgRebuildIndex } from './memory-kg-rebuild.js';
103
+ export { kgRollback } from './memory-kg-rollback.js';
104
+ export type { RuleVerdict } from './memory-kg-rules.js';
105
+ export { kgIngestRules, kgListRules } from './memory-kg-rules.js';
106
+ export type { KgReferenceEdge } from './memory-kg-scan.js';
107
+ export { kgReferenceEdges } from './memory-kg-scan.js';
108
+ export type { KgSearchResult } from './memory-kg-search.js';
109
+ export { kgGlossary, kgSearch } from './memory-kg-search.js';
638
110
  /** Regex extraction for when no LLM is in the loop (memory-palace lineage):
639
111
  * proper-noun phrases and `code identifiers` become entities, sentence
640
112
  * co-occurrence becomes `mentioned_with` edges. Lower-trust by design — real
@@ -1 +1 @@
1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