@oscharko-dev/keiko-server 0.2.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 (509) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/assistant-response.d.ts +6 -0
  3. package/dist/assistant-response.d.ts.map +1 -0
  4. package/dist/assistant-response.js +12 -0
  5. package/dist/browser.d.ts +11 -0
  6. package/dist/browser.d.ts.map +1 -0
  7. package/dist/browser.js +245 -0
  8. package/dist/chat-handlers.d.ts +48 -0
  9. package/dist/chat-handlers.d.ts.map +1 -0
  10. package/dist/chat-handlers.js +821 -0
  11. package/dist/chat-stream-handlers.d.ts +4 -0
  12. package/dist/chat-stream-handlers.d.ts.map +1 -0
  13. package/dist/chat-stream-handlers.js +136 -0
  14. package/dist/conversation-prompt.d.ts +8 -0
  15. package/dist/conversation-prompt.d.ts.map +1 -0
  16. package/dist/conversation-prompt.js +36 -0
  17. package/dist/conversation-validation.d.ts +26 -0
  18. package/dist/conversation-validation.d.ts.map +1 -0
  19. package/dist/conversation-validation.js +125 -0
  20. package/dist/credentialPersistence.d.ts +23 -0
  21. package/dist/credentialPersistence.d.ts.map +1 -0
  22. package/dist/credentialPersistence.js +93 -0
  23. package/dist/credentialVault.d.ts +30 -0
  24. package/dist/credentialVault.d.ts.map +1 -0
  25. package/dist/credentialVault.js +206 -0
  26. package/dist/csp.d.ts +3 -0
  27. package/dist/csp.d.ts.map +1 -0
  28. package/dist/csp.js +75 -0
  29. package/dist/deps.d.ts +78 -0
  30. package/dist/deps.d.ts.map +1 -0
  31. package/dist/deps.js +457 -0
  32. package/dist/editor/agentRoutes.d.ts +7 -0
  33. package/dist/editor/agentRoutes.d.ts.map +1 -0
  34. package/dist/editor/agentRoutes.js +197 -0
  35. package/dist/editor/assuredGateRunner.d.ts +36 -0
  36. package/dist/editor/assuredGateRunner.d.ts.map +1 -0
  37. package/dist/editor/assuredGateRunner.js +100 -0
  38. package/dist/editor/assuredPreFilter.d.ts +34 -0
  39. package/dist/editor/assuredPreFilter.d.ts.map +1 -0
  40. package/dist/editor/assuredPreFilter.js +134 -0
  41. package/dist/editor/assuredPreFilterRunner.d.ts +31 -0
  42. package/dist/editor/assuredPreFilterRunner.d.ts.map +1 -0
  43. package/dist/editor/assuredPreFilterRunner.js +312 -0
  44. package/dist/editor/builtinLanguageProviders.d.ts +6 -0
  45. package/dist/editor/builtinLanguageProviders.d.ts.map +1 -0
  46. package/dist/editor/builtinLanguageProviders.js +221 -0
  47. package/dist/editor/codingContext.d.ts +12 -0
  48. package/dist/editor/codingContext.d.ts.map +1 -0
  49. package/dist/editor/codingContext.js +121 -0
  50. package/dist/editor/codingContextEvidence.d.ts +7 -0
  51. package/dist/editor/codingContextEvidence.d.ts.map +1 -0
  52. package/dist/editor/codingContextEvidence.js +52 -0
  53. package/dist/editor/codingContextProviders.d.ts +36 -0
  54. package/dist/editor/codingContextProviders.d.ts.map +1 -0
  55. package/dist/editor/codingContextProviders.js +348 -0
  56. package/dist/editor/completionModelEvidence.d.ts +16 -0
  57. package/dist/editor/completionModelEvidence.d.ts.map +1 -0
  58. package/dist/editor/completionModelEvidence.js +50 -0
  59. package/dist/editor/completionRoutes.d.ts +37 -0
  60. package/dist/editor/completionRoutes.d.ts.map +1 -0
  61. package/dist/editor/completionRoutes.js +411 -0
  62. package/dist/editor/contextRoutes.d.ts +6 -0
  63. package/dist/editor/contextRoutes.d.ts.map +1 -0
  64. package/dist/editor/contextRoutes.js +411 -0
  65. package/dist/editor/disposableAssuredExecution.d.ts +22 -0
  66. package/dist/editor/disposableAssuredExecution.d.ts.map +1 -0
  67. package/dist/editor/disposableAssuredExecution.js +57 -0
  68. package/dist/editor/editorCompletionModel.d.ts +47 -0
  69. package/dist/editor/editorCompletionModel.d.ts.map +1 -0
  70. package/dist/editor/editorCompletionModel.js +156 -0
  71. package/dist/editor/editorInlineCompletionModel.d.ts +34 -0
  72. package/dist/editor/editorInlineCompletionModel.d.ts.map +1 -0
  73. package/dist/editor/editorInlineCompletionModel.js +112 -0
  74. package/dist/editor/editorModelTokenBudget.d.ts +46 -0
  75. package/dist/editor/editorModelTokenBudget.d.ts.map +1 -0
  76. package/dist/editor/editorModelTokenBudget.js +121 -0
  77. package/dist/editor/inlineCompletionRateLimiter.d.ts +19 -0
  78. package/dist/editor/inlineCompletionRateLimiter.d.ts.map +1 -0
  79. package/dist/editor/inlineCompletionRateLimiter.js +46 -0
  80. package/dist/editor/inlineCompletionRoutes.d.ts +26 -0
  81. package/dist/editor/inlineCompletionRoutes.d.ts.map +1 -0
  82. package/dist/editor/inlineCompletionRoutes.js +404 -0
  83. package/dist/editor/inlineCompletionTelemetryEvidence.d.ts +5 -0
  84. package/dist/editor/inlineCompletionTelemetryEvidence.d.ts.map +1 -0
  85. package/dist/editor/inlineCompletionTelemetryEvidence.js +42 -0
  86. package/dist/editor/languageCancellation.d.ts +19 -0
  87. package/dist/editor/languageCancellation.d.ts.map +1 -0
  88. package/dist/editor/languageCancellation.js +48 -0
  89. package/dist/editor/languageProvider.d.ts +39 -0
  90. package/dist/editor/languageProvider.d.ts.map +1 -0
  91. package/dist/editor/languageProvider.js +11 -0
  92. package/dist/editor/languageRoutes.d.ts +15 -0
  93. package/dist/editor/languageRoutes.d.ts.map +1 -0
  94. package/dist/editor/languageRoutes.js +106 -0
  95. package/dist/editor/languageSanitize.d.ts +8 -0
  96. package/dist/editor/languageSanitize.d.ts.map +1 -0
  97. package/dist/editor/languageSanitize.js +101 -0
  98. package/dist/editor/languageService.d.ts +36 -0
  99. package/dist/editor/languageService.d.ts.map +1 -0
  100. package/dist/editor/languageService.js +93 -0
  101. package/dist/editor/languageServiceHost.d.ts +14 -0
  102. package/dist/editor/languageServiceHost.d.ts.map +1 -0
  103. package/dist/editor/languageServiceHost.js +242 -0
  104. package/dist/editor/localKnowledgeRetrieval.d.ts +21 -0
  105. package/dist/editor/localKnowledgeRetrieval.d.ts.map +1 -0
  106. package/dist/editor/localKnowledgeRetrieval.js +44 -0
  107. package/dist/editor/patchApplyEvidence.d.ts +21 -0
  108. package/dist/editor/patchApplyEvidence.d.ts.map +1 -0
  109. package/dist/editor/patchApplyEvidence.js +87 -0
  110. package/dist/editor/patchApplyRoutes.d.ts +16 -0
  111. package/dist/editor/patchApplyRoutes.d.ts.map +1 -0
  112. package/dist/editor/patchApplyRoutes.js +307 -0
  113. package/dist/editor/postApplyVerification.d.ts +42 -0
  114. package/dist/editor/postApplyVerification.d.ts.map +1 -0
  115. package/dist/editor/postApplyVerification.js +177 -0
  116. package/dist/editor/testGenerationEvidence.d.ts +6 -0
  117. package/dist/editor/testGenerationEvidence.d.ts.map +1 -0
  118. package/dist/editor/testGenerationEvidence.js +72 -0
  119. package/dist/editor/testGenerationPatch.d.ts +10 -0
  120. package/dist/editor/testGenerationPatch.d.ts.map +1 -0
  121. package/dist/editor/testGenerationPatch.js +66 -0
  122. package/dist/editor/testGenerationRoutes.d.ts +21 -0
  123. package/dist/editor/testGenerationRoutes.d.ts.map +1 -0
  124. package/dist/editor/testGenerationRoutes.js +254 -0
  125. package/dist/editor/testGenerationRunner.d.ts +23 -0
  126. package/dist/editor/testGenerationRunner.d.ts.map +1 -0
  127. package/dist/editor/testGenerationRunner.js +120 -0
  128. package/dist/editor/textOffsets.d.ts +6 -0
  129. package/dist/editor/textOffsets.d.ts.map +1 -0
  130. package/dist/editor/textOffsets.js +82 -0
  131. package/dist/editor/typescriptLanguageProvider.d.ts +3 -0
  132. package/dist/editor/typescriptLanguageProvider.d.ts.map +1 -0
  133. package/dist/editor/typescriptLanguageProvider.js +217 -0
  134. package/dist/evidence.d.ts +28 -0
  135. package/dist/evidence.d.ts.map +1 -0
  136. package/dist/evidence.js +145 -0
  137. package/dist/files-deny.d.ts +3 -0
  138. package/dist/files-deny.d.ts.map +1 -0
  139. package/dist/files-deny.js +12 -0
  140. package/dist/files.d.ts +97 -0
  141. package/dist/files.d.ts.map +1 -0
  142. package/dist/files.js +733 -0
  143. package/dist/gateway-setup.d.ts +10 -0
  144. package/dist/gateway-setup.d.ts.map +1 -0
  145. package/dist/gateway-setup.js +896 -0
  146. package/dist/governed-workflow.d.ts +17 -0
  147. package/dist/governed-workflow.d.ts.map +1 -0
  148. package/dist/governed-workflow.js +147 -0
  149. package/dist/grounded-answer.d.ts +12 -0
  150. package/dist/grounded-answer.d.ts.map +1 -0
  151. package/dist/grounded-answer.js +69 -0
  152. package/dist/grounded-context-index.d.ts +25 -0
  153. package/dist/grounded-context-index.d.ts.map +1 -0
  154. package/dist/grounded-context-index.js +169 -0
  155. package/dist/grounded-document-evidence.d.ts +28 -0
  156. package/dist/grounded-document-evidence.d.ts.map +1 -0
  157. package/dist/grounded-document-evidence.js +430 -0
  158. package/dist/grounded-handoff.d.ts +4 -0
  159. package/dist/grounded-handoff.d.ts.map +1 -0
  160. package/dist/grounded-handoff.js +445 -0
  161. package/dist/grounded-orchestrator.d.ts +43 -0
  162. package/dist/grounded-orchestrator.d.ts.map +1 -0
  163. package/dist/grounded-orchestrator.js +1445 -0
  164. package/dist/grounded-prompt.d.ts +2 -0
  165. package/dist/grounded-prompt.d.ts.map +1 -0
  166. package/dist/grounded-prompt.js +17 -0
  167. package/dist/grounded-qa-hybrid.d.ts +36 -0
  168. package/dist/grounded-qa-hybrid.d.ts.map +1 -0
  169. package/dist/grounded-qa-hybrid.js +762 -0
  170. package/dist/grounded-qa-multi-source.d.ts +38 -0
  171. package/dist/grounded-qa-multi-source.d.ts.map +1 -0
  172. package/dist/grounded-qa-multi-source.js +461 -0
  173. package/dist/grounded-qa.d.ts +45 -0
  174. package/dist/grounded-qa.d.ts.map +1 -0
  175. package/dist/grounded-qa.js +877 -0
  176. package/dist/grounded-rerank.d.ts +26 -0
  177. package/dist/grounded-rerank.d.ts.map +1 -0
  178. package/dist/grounded-rerank.js +72 -0
  179. package/dist/grounded-turn-registry.d.ts +23 -0
  180. package/dist/grounded-turn-registry.d.ts.map +1 -0
  181. package/dist/grounded-turn-registry.js +102 -0
  182. package/dist/headers.d.ts +3 -0
  183. package/dist/headers.d.ts.map +1 -0
  184. package/dist/headers.js +22 -0
  185. package/dist/host-check.d.ts +3 -0
  186. package/dist/host-check.d.ts.map +1 -0
  187. package/dist/host-check.js +58 -0
  188. package/dist/index.d.ts +26 -0
  189. package/dist/index.d.ts.map +1 -0
  190. package/dist/index.js +33 -0
  191. package/dist/load-csp.d.ts +3 -0
  192. package/dist/load-csp.d.ts.map +1 -0
  193. package/dist/load-csp.js +100 -0
  194. package/dist/local-knowledge-grounded-qa.d.ts +42 -0
  195. package/dist/local-knowledge-grounded-qa.d.ts.map +1 -0
  196. package/dist/local-knowledge-grounded-qa.js +678 -0
  197. package/dist/local-knowledge-handlers.d.ts +24 -0
  198. package/dist/local-knowledge-handlers.d.ts.map +1 -0
  199. package/dist/local-knowledge-handlers.js +1285 -0
  200. package/dist/local-knowledge-indexing-registry.d.ts +13 -0
  201. package/dist/local-knowledge-indexing-registry.d.ts.map +1 -0
  202. package/dist/local-knowledge-indexing-registry.js +53 -0
  203. package/dist/localKnowledgeKeyProvider.d.ts +11 -0
  204. package/dist/localKnowledgeKeyProvider.d.ts.map +1 -0
  205. package/dist/localKnowledgeKeyProvider.js +48 -0
  206. package/dist/memory-audit-event-builders.d.ts +21 -0
  207. package/dist/memory-audit-event-builders.d.ts.map +1 -0
  208. package/dist/memory-audit-event-builders.js +187 -0
  209. package/dist/memory-audit-handler.d.ts +23 -0
  210. package/dist/memory-audit-handler.d.ts.map +1 -0
  211. package/dist/memory-audit-handler.js +191 -0
  212. package/dist/memory-capture-policy.d.ts +10 -0
  213. package/dist/memory-capture-policy.d.ts.map +1 -0
  214. package/dist/memory-capture-policy.js +44 -0
  215. package/dist/memory-consolidation-handlers.d.ts +6 -0
  216. package/dist/memory-consolidation-handlers.d.ts.map +1 -0
  217. package/dist/memory-consolidation-handlers.js +491 -0
  218. package/dist/memory-consolidation-registry.d.ts +47 -0
  219. package/dist/memory-consolidation-registry.d.ts.map +1 -0
  220. package/dist/memory-consolidation-registry.js +106 -0
  221. package/dist/memory-conv-handlers.d.ts +8 -0
  222. package/dist/memory-conv-handlers.d.ts.map +1 -0
  223. package/dist/memory-conv-handlers.js +369 -0
  224. package/dist/memory-conversation-context.d.ts +13 -0
  225. package/dist/memory-conversation-context.d.ts.map +1 -0
  226. package/dist/memory-conversation-context.js +22 -0
  227. package/dist/memory-diagnostics.d.ts +29 -0
  228. package/dist/memory-diagnostics.d.ts.map +1 -0
  229. package/dist/memory-diagnostics.js +122 -0
  230. package/dist/memory-embedding.d.ts +21 -0
  231. package/dist/memory-embedding.d.ts.map +1 -0
  232. package/dist/memory-embedding.js +264 -0
  233. package/dist/memory-handlers.d.ts +19 -0
  234. package/dist/memory-handlers.d.ts.map +1 -0
  235. package/dist/memory-handlers.js +1204 -0
  236. package/dist/memory-maintenance-handlers.d.ts +35 -0
  237. package/dist/memory-maintenance-handlers.d.ts.map +1 -0
  238. package/dist/memory-maintenance-handlers.js +219 -0
  239. package/dist/memory-record-builders.d.ts +4 -0
  240. package/dist/memory-record-builders.d.ts.map +1 -0
  241. package/dist/memory-record-builders.js +19 -0
  242. package/dist/memory-retention.d.ts +31 -0
  243. package/dist/memory-retention.d.ts.map +1 -0
  244. package/dist/memory-retention.js +151 -0
  245. package/dist/memory-retrieval-signals.d.ts +12 -0
  246. package/dist/memory-retrieval-signals.d.ts.map +1 -0
  247. package/dist/memory-retrieval-signals.js +100 -0
  248. package/dist/memory-salience.d.ts +12 -0
  249. package/dist/memory-salience.d.ts.map +1 -0
  250. package/dist/memory-salience.js +154 -0
  251. package/dist/memory-scope-sanitizer.d.ts +6 -0
  252. package/dist/memory-scope-sanitizer.d.ts.map +1 -0
  253. package/dist/memory-scope-sanitizer.js +106 -0
  254. package/dist/memory-target-resolver.d.ts +4 -0
  255. package/dist/memory-target-resolver.d.ts.map +1 -0
  256. package/dist/memory-target-resolver.js +73 -0
  257. package/dist/memory-workflow-port.d.ts +14 -0
  258. package/dist/memory-workflow-port.d.ts.map +1 -0
  259. package/dist/memory-workflow-port.js +186 -0
  260. package/dist/private-json.d.ts +3 -0
  261. package/dist/private-json.d.ts.map +1 -0
  262. package/dist/private-json.js +62 -0
  263. package/dist/promptEnhancer/index.d.ts +3 -0
  264. package/dist/promptEnhancer/index.d.ts.map +1 -0
  265. package/dist/promptEnhancer/index.js +5 -0
  266. package/dist/promptEnhancer/orchestrate.d.ts +2 -0
  267. package/dist/promptEnhancer/orchestrate.d.ts.map +1 -0
  268. package/dist/promptEnhancer/orchestrate.js +5 -0
  269. package/dist/promptEnhancer/routes.d.ts +9 -0
  270. package/dist/promptEnhancer/routes.d.ts.map +1 -0
  271. package/dist/promptEnhancer/routes.js +205 -0
  272. package/dist/qualityIntelligence/capsuleAdapter.d.ts +27 -0
  273. package/dist/qualityIntelligence/capsuleAdapter.d.ts.map +1 -0
  274. package/dist/qualityIntelligence/capsuleAdapter.js +57 -0
  275. package/dist/qualityIntelligence/connectorAuthorization.d.ts +22 -0
  276. package/dist/qualityIntelligence/connectorAuthorization.d.ts.map +1 -0
  277. package/dist/qualityIntelligence/connectorAuthorization.js +35 -0
  278. package/dist/qualityIntelligence/connectorErrors.d.ts +16 -0
  279. package/dist/qualityIntelligence/connectorErrors.d.ts.map +1 -0
  280. package/dist/qualityIntelligence/connectorErrors.js +56 -0
  281. package/dist/qualityIntelligence/connectorRoutes.d.ts +7 -0
  282. package/dist/qualityIntelligence/connectorRoutes.d.ts.map +1 -0
  283. package/dist/qualityIntelligence/connectorRoutes.js +167 -0
  284. package/dist/qualityIntelligence/editRoutes.d.ts +5 -0
  285. package/dist/qualityIntelligence/editRoutes.d.ts.map +1 -0
  286. package/dist/qualityIntelligence/editRoutes.js +293 -0
  287. package/dist/qualityIntelligence/exportAssembly.d.ts +22 -0
  288. package/dist/qualityIntelligence/exportAssembly.d.ts.map +1 -0
  289. package/dist/qualityIntelligence/exportAssembly.js +352 -0
  290. package/dist/qualityIntelligence/exportRoutes.d.ts +5 -0
  291. package/dist/qualityIntelligence/exportRoutes.d.ts.map +1 -0
  292. package/dist/qualityIntelligence/exportRoutes.js +320 -0
  293. package/dist/qualityIntelligence/figma/figmaConcurrency.d.ts +8 -0
  294. package/dist/qualityIntelligence/figma/figmaConcurrency.d.ts.map +1 -0
  295. package/dist/qualityIntelligence/figma/figmaConcurrency.js +34 -0
  296. package/dist/qualityIntelligence/figma/figmaConnector.d.ts +65 -0
  297. package/dist/qualityIntelligence/figma/figmaConnector.d.ts.map +1 -0
  298. package/dist/qualityIntelligence/figma/figmaConnector.js +184 -0
  299. package/dist/qualityIntelligence/figma/figmaConnectorAudit.d.ts +52 -0
  300. package/dist/qualityIntelligence/figma/figmaConnectorAudit.d.ts.map +1 -0
  301. package/dist/qualityIntelligence/figma/figmaConnectorAudit.js +63 -0
  302. package/dist/qualityIntelligence/figma/figmaConnectorErrors.d.ts +31 -0
  303. package/dist/qualityIntelligence/figma/figmaConnectorErrors.d.ts.map +1 -0
  304. package/dist/qualityIntelligence/figma/figmaConnectorErrors.js +220 -0
  305. package/dist/qualityIntelligence/figma/figmaConnectorMetrics.d.ts +44 -0
  306. package/dist/qualityIntelligence/figma/figmaConnectorMetrics.d.ts.map +1 -0
  307. package/dist/qualityIntelligence/figma/figmaConnectorMetrics.js +49 -0
  308. package/dist/qualityIntelligence/figma/figmaConsent.d.ts +39 -0
  309. package/dist/qualityIntelligence/figma/figmaConsent.d.ts.map +1 -0
  310. package/dist/qualityIntelligence/figma/figmaConsent.js +62 -0
  311. package/dist/qualityIntelligence/figma/figmaHttpPort.d.ts +28 -0
  312. package/dist/qualityIntelligence/figma/figmaHttpPort.d.ts.map +1 -0
  313. package/dist/qualityIntelligence/figma/figmaHttpPort.js +70 -0
  314. package/dist/qualityIntelligence/figma/figmaObservedActions.d.ts +49 -0
  315. package/dist/qualityIntelligence/figma/figmaObservedActions.d.ts.map +1 -0
  316. package/dist/qualityIntelligence/figma/figmaObservedActions.js +89 -0
  317. package/dist/qualityIntelligence/figma/figmaReadiness.d.ts +32 -0
  318. package/dist/qualityIntelligence/figma/figmaReadiness.d.ts.map +1 -0
  319. package/dist/qualityIntelligence/figma/figmaReadiness.js +67 -0
  320. package/dist/qualityIntelligence/figma/figmaRenderPort.d.ts +29 -0
  321. package/dist/qualityIntelligence/figma/figmaRenderPort.d.ts.map +1 -0
  322. package/dist/qualityIntelligence/figma/figmaRenderPort.js +93 -0
  323. package/dist/qualityIntelligence/figma/figmaResnapshot.d.ts +28 -0
  324. package/dist/qualityIntelligence/figma/figmaResnapshot.d.ts.map +1 -0
  325. package/dist/qualityIntelligence/figma/figmaResnapshot.js +38 -0
  326. package/dist/qualityIntelligence/figma/figmaRetry.d.ts +31 -0
  327. package/dist/qualityIntelligence/figma/figmaRetry.d.ts.map +1 -0
  328. package/dist/qualityIntelligence/figma/figmaRetry.js +62 -0
  329. package/dist/qualityIntelligence/figma/figmaScopeRef.d.ts +9 -0
  330. package/dist/qualityIntelligence/figma/figmaScopeRef.d.ts.map +1 -0
  331. package/dist/qualityIntelligence/figma/figmaScopeRef.js +18 -0
  332. package/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts +86 -0
  333. package/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts.map +1 -0
  334. package/dist/qualityIntelligence/figma/figmaScopedPagination.js +308 -0
  335. package/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts +31 -0
  336. package/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts.map +1 -0
  337. package/dist/qualityIntelligence/figma/figmaSnapshotBuilder.js +314 -0
  338. package/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts +18 -0
  339. package/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts.map +1 -0
  340. package/dist/qualityIntelligence/figma/figmaSnapshotHash.js +63 -0
  341. package/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts +65 -0
  342. package/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts.map +1 -0
  343. package/dist/qualityIntelligence/figma/figmaSnapshotTypes.js +13 -0
  344. package/dist/qualityIntelligence/figma/figmaTokenSource.d.ts +9 -0
  345. package/dist/qualityIntelligence/figma/figmaTokenSource.d.ts.map +1 -0
  346. package/dist/qualityIntelligence/figma/figmaTokenSource.js +61 -0
  347. package/dist/qualityIntelligence/figma/figmaTokenStore.d.ts +19 -0
  348. package/dist/qualityIntelligence/figma/figmaTokenStore.d.ts.map +1 -0
  349. package/dist/qualityIntelligence/figma/figmaTokenStore.js +156 -0
  350. package/dist/qualityIntelligence/figma/figmaUrl.d.ts +6 -0
  351. package/dist/qualityIntelligence/figma/figmaUrl.d.ts.map +1 -0
  352. package/dist/qualityIntelligence/figma/figmaUrl.js +36 -0
  353. package/dist/qualityIntelligence/figma/index.d.ts +20 -0
  354. package/dist/qualityIntelligence/figma/index.d.ts.map +1 -0
  355. package/dist/qualityIntelligence/figma/index.js +26 -0
  356. package/dist/qualityIntelligence/figmaCodegenRoutes.d.ts +28 -0
  357. package/dist/qualityIntelligence/figmaCodegenRoutes.d.ts.map +1 -0
  358. package/dist/qualityIntelligence/figmaCodegenRoutes.js +165 -0
  359. package/dist/qualityIntelligence/figmaSnapshotAdapter.d.ts +55 -0
  360. package/dist/qualityIntelligence/figmaSnapshotAdapter.d.ts.map +1 -0
  361. package/dist/qualityIntelligence/figmaSnapshotAdapter.js +219 -0
  362. package/dist/qualityIntelligence/figmaSnapshotOrchestration.d.ts +64 -0
  363. package/dist/qualityIntelligence/figmaSnapshotOrchestration.d.ts.map +1 -0
  364. package/dist/qualityIntelligence/figmaSnapshotOrchestration.js +203 -0
  365. package/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts +112 -0
  366. package/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts.map +1 -0
  367. package/dist/qualityIntelligence/figmaSnapshotRoutes.js +1063 -0
  368. package/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts +19 -0
  369. package/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts.map +1 -0
  370. package/dist/qualityIntelligence/figmaSnapshotScreenIds.js +75 -0
  371. package/dist/qualityIntelligence/generationPort.d.ts +15 -0
  372. package/dist/qualityIntelligence/generationPort.d.ts.map +1 -0
  373. package/dist/qualityIntelligence/generationPort.js +185 -0
  374. package/dist/qualityIntelligence/handoffErrors.d.ts +9 -0
  375. package/dist/qualityIntelligence/handoffErrors.d.ts.map +1 -0
  376. package/dist/qualityIntelligence/handoffErrors.js +21 -0
  377. package/dist/qualityIntelligence/handoffRoutes.d.ts +15 -0
  378. package/dist/qualityIntelligence/handoffRoutes.d.ts.map +1 -0
  379. package/dist/qualityIntelligence/handoffRoutes.js +341 -0
  380. package/dist/qualityIntelligence/index.d.ts +17 -0
  381. package/dist/qualityIntelligence/index.d.ts.map +1 -0
  382. package/dist/qualityIntelligence/index.js +36 -0
  383. package/dist/qualityIntelligence/judgePort.d.ts +30 -0
  384. package/dist/qualityIntelligence/judgePort.d.ts.map +1 -0
  385. package/dist/qualityIntelligence/judgePort.js +326 -0
  386. package/dist/qualityIntelligence/modelSelection.d.ts +58 -0
  387. package/dist/qualityIntelligence/modelSelection.d.ts.map +1 -0
  388. package/dist/qualityIntelligence/modelSelection.js +148 -0
  389. package/dist/qualityIntelligence/reCheckRoutes.d.ts +6 -0
  390. package/dist/qualityIntelligence/reCheckRoutes.d.ts.map +1 -0
  391. package/dist/qualityIntelligence/reCheckRoutes.js +1157 -0
  392. package/dist/qualityIntelligence/retentionEnforcement.d.ts +13 -0
  393. package/dist/qualityIntelligence/retentionEnforcement.d.ts.map +1 -0
  394. package/dist/qualityIntelligence/retentionEnforcement.js +47 -0
  395. package/dist/qualityIntelligence/retentionRoutes.d.ts +8 -0
  396. package/dist/qualityIntelligence/retentionRoutes.d.ts.map +1 -0
  397. package/dist/qualityIntelligence/retentionRoutes.js +74 -0
  398. package/dist/qualityIntelligence/reviewRoutes.d.ts +5 -0
  399. package/dist/qualityIntelligence/reviewRoutes.d.ts.map +1 -0
  400. package/dist/qualityIntelligence/reviewRoutes.js +145 -0
  401. package/dist/qualityIntelligence/reviewStore.d.ts +75 -0
  402. package/dist/qualityIntelligence/reviewStore.d.ts.map +1 -0
  403. package/dist/qualityIntelligence/reviewStore.js +170 -0
  404. package/dist/qualityIntelligence/runExecution.d.ts +36 -0
  405. package/dist/qualityIntelligence/runExecution.d.ts.map +1 -0
  406. package/dist/qualityIntelligence/runExecution.js +180 -0
  407. package/dist/qualityIntelligence/runIngestion.d.ts +70 -0
  408. package/dist/qualityIntelligence/runIngestion.d.ts.map +1 -0
  409. package/dist/qualityIntelligence/runIngestion.js +1235 -0
  410. package/dist/qualityIntelligence/runRegistry.d.ts +31 -0
  411. package/dist/qualityIntelligence/runRegistry.d.ts.map +1 -0
  412. package/dist/qualityIntelligence/runRegistry.js +66 -0
  413. package/dist/qualityIntelligence/runRoutes.d.ts +16 -0
  414. package/dist/qualityIntelligence/runRoutes.d.ts.map +1 -0
  415. package/dist/qualityIntelligence/runRoutes.js +357 -0
  416. package/dist/qualityIntelligence/traceabilityRoutes.d.ts +5 -0
  417. package/dist/qualityIntelligence/traceabilityRoutes.d.ts.map +1 -0
  418. package/dist/qualityIntelligence/traceabilityRoutes.js +173 -0
  419. package/dist/qualityIntelligence/uiRoutes.d.ts +7 -0
  420. package/dist/qualityIntelligence/uiRoutes.d.ts.map +1 -0
  421. package/dist/qualityIntelligence/uiRoutes.js +336 -0
  422. package/dist/read-handlers.d.ts +9 -0
  423. package/dist/read-handlers.d.ts.map +1 -0
  424. package/dist/read-handlers.js +265 -0
  425. package/dist/relationship-handlers.d.ts +191 -0
  426. package/dist/relationship-handlers.d.ts.map +1 -0
  427. package/dist/relationship-handlers.js +0 -0
  428. package/dist/routes.d.ts +37 -0
  429. package/dist/routes.d.ts.map +1 -0
  430. package/dist/routes.js +507 -0
  431. package/dist/run-engine.d.ts +25 -0
  432. package/dist/run-engine.d.ts.map +1 -0
  433. package/dist/run-engine.js +385 -0
  434. package/dist/run-handlers.d.ts +9 -0
  435. package/dist/run-handlers.d.ts.map +1 -0
  436. package/dist/run-handlers.js +465 -0
  437. package/dist/run-request.d.ts +17 -0
  438. package/dist/run-request.d.ts.map +1 -0
  439. package/dist/run-request.js +219 -0
  440. package/dist/runs.d.ts +47 -0
  441. package/dist/runs.d.ts.map +1 -0
  442. package/dist/runs.js +100 -0
  443. package/dist/server.d.ts +13 -0
  444. package/dist/server.d.ts.map +1 -0
  445. package/dist/server.js +152 -0
  446. package/dist/sink.d.ts +28 -0
  447. package/dist/sink.d.ts.map +1 -0
  448. package/dist/sink.js +80 -0
  449. package/dist/sse-write.d.ts +9 -0
  450. package/dist/sse-write.d.ts.map +1 -0
  451. package/dist/sse-write.js +26 -0
  452. package/dist/sse.d.ts +8 -0
  453. package/dist/sse.d.ts.map +1 -0
  454. package/dist/sse.js +27 -0
  455. package/dist/static.d.ts +5 -0
  456. package/dist/static.d.ts.map +1 -0
  457. package/dist/static.js +76 -0
  458. package/dist/store/chats.d.ts +17 -0
  459. package/dist/store/chats.d.ts.map +1 -0
  460. package/dist/store/chats.js +624 -0
  461. package/dist/store/db.d.ts +11 -0
  462. package/dist/store/db.d.ts.map +1 -0
  463. package/dist/store/db.js +203 -0
  464. package/dist/store/errors.d.ts +13 -0
  465. package/dist/store/errors.d.ts.map +1 -0
  466. package/dist/store/errors.js +30 -0
  467. package/dist/store/index.d.ts +7 -0
  468. package/dist/store/index.d.ts.map +1 -0
  469. package/dist/store/index.js +6 -0
  470. package/dist/store/messages.d.ts +8 -0
  471. package/dist/store/messages.d.ts.map +1 -0
  472. package/dist/store/messages.js +149 -0
  473. package/dist/store/paths.d.ts +5 -0
  474. package/dist/store/paths.d.ts.map +1 -0
  475. package/dist/store/paths.js +84 -0
  476. package/dist/store/projects.d.ts +8 -0
  477. package/dist/store/projects.d.ts.map +1 -0
  478. package/dist/store/projects.js +59 -0
  479. package/dist/store/relationship-audit.d.ts +42 -0
  480. package/dist/store/relationship-audit.d.ts.map +1 -0
  481. package/dist/store/relationship-audit.js +155 -0
  482. package/dist/store/relationships.d.ts +191 -0
  483. package/dist/store/relationships.d.ts.map +1 -0
  484. package/dist/store/relationships.js +724 -0
  485. package/dist/store/schema.d.ts +4 -0
  486. package/dist/store/schema.d.ts.map +1 -0
  487. package/dist/store/schema.js +220 -0
  488. package/dist/store/types.d.ts +29 -0
  489. package/dist/store/types.d.ts.map +1 -0
  490. package/dist/store/types.js +8 -0
  491. package/dist/store/validation.d.ts +7 -0
  492. package/dist/store/validation.d.ts.map +1 -0
  493. package/dist/store/validation.js +117 -0
  494. package/dist/store-handlers.d.ts +17 -0
  495. package/dist/store-handlers.d.ts.map +1 -0
  496. package/dist/store-handlers.js +872 -0
  497. package/dist/terminal-errors.d.ts +22 -0
  498. package/dist/terminal-errors.d.ts.map +1 -0
  499. package/dist/terminal-errors.js +45 -0
  500. package/dist/terminal-evidence.d.ts +21 -0
  501. package/dist/terminal-evidence.d.ts.map +1 -0
  502. package/dist/terminal-evidence.js +65 -0
  503. package/dist/terminal-routes.d.ts +10 -0
  504. package/dist/terminal-routes.d.ts.map +1 -0
  505. package/dist/terminal-routes.js +219 -0
  506. package/dist/terminal.d.ts +68 -0
  507. package/dist/terminal.d.ts.map +1 -0
  508. package/dist/terminal.js +855 -0
  509. package/package.json +52 -0
@@ -0,0 +1,155 @@
1
+ // Epic #532 / Issue #539 — relationship audit ledger sibling-table writer.
2
+ //
3
+ // Append-only writer for the `relationship_audit_entries` table (see audit-events.md §5.5).
4
+ // Persistence-placement rule (audit-events.md §5.3): in this PR both run-scoped and
5
+ // non-run-scoped mutations route to the sibling table. EvidenceManifest.relationships?
6
+ // embedding is the responsibility of issue #544 (the `// TODO(#544)` comment in
7
+ // `resolveAuditPlacement` is the single seam where future code branches).
8
+ //
9
+ // Redaction-on-write: every payload string passes through `deepRedactStrings` with the
10
+ // injected `redactString` BEFORE the SQL INSERT (audit-events.md §7). The forbidden-key
11
+ // gate from `RELATIONSHIP_FORBIDDEN_METADATA_KEY_SUBSTRINGS` rejects payload keys that
12
+ // would smuggle prompt / document / secret content (audit-events.md §8.3).
13
+ //
14
+ // The append-only invariant (audit-events.md §9) is structural: this module exposes only
15
+ // `insertRelationshipAuditEntry` and `listRelationshipAuditEntries`. There is no UPDATE /
16
+ // DELETE seam. Retention sweeps live in #543 and are out of scope here.
17
+ import { deepRedactStrings } from "@oscharko-dev/keiko-security";
18
+ import { RELATIONSHIP_FORBIDDEN_METADATA_KEY_SUBSTRINGS } from "@oscharko-dev/keiko-contracts";
19
+ import { invalidRequest } from "./errors.js";
20
+ export const RELATIONSHIP_AUDIT_SCHEMA_VERSION = "1";
21
+ export const RELATIONSHIP_AUDIT_SUMMARY_MAX_CHARS = 240;
22
+ // Selects where the row lives. Audit-events.md §5.3: the source endpoint kind decides.
23
+ // For now both branches return "sibling-table"; the workflow-run branch is reserved for
24
+ // #544 wiring EvidenceManifest.relationships?.
25
+ export function resolveAuditPlacement(input) {
26
+ // TODO(#544): wire EvidenceManifest.relationships? when sourceKind === "workflow-run"
27
+ // and the request handler holds an evidenceRunId. Until then every row lands in the
28
+ // sibling table — this is the documented Issue #539 placement.
29
+ void input;
30
+ return "sibling-table";
31
+ }
32
+ // Sequence is allocated atomically inside the INSERT via a subquery — no separate
33
+ // SELECT MAX then JS-side increment. SQLite serialises writers so COALESCE(MAX(sequence),-1)+1
34
+ // is the next monotonic value with no TOCTOU gap. The WHERE clause keeps the subquery
35
+ // workspace-scoped (audit-events.md §10). When no prior rows exist COALESCE returns -1
36
+ // giving sequence 0 as the first value.
37
+ const SQL_INSERT_AUDIT = `
38
+ INSERT INTO relationship_audit_entries(
39
+ event_id, relationship_audit_schema_ver, workspace_id, sequence, occurred_at,
40
+ kind, relationship_id, actor_surface, redacted_actor_id, redaction_state, summary,
41
+ payload_json
42
+ )
43
+ SELECT ?, ?, ?, COALESCE(MAX(sequence), -1) + 1, ?, ?, ?, ?, ?, ?, ?, ?
44
+ FROM relationship_audit_entries
45
+ WHERE workspace_id = ?
46
+ `;
47
+ const SQL_LIST_AUDIT = `
48
+ SELECT event_id, relationship_audit_schema_ver, workspace_id, sequence, occurred_at,
49
+ kind, relationship_id, actor_surface, redacted_actor_id, redaction_state, summary,
50
+ payload_json
51
+ FROM relationship_audit_entries
52
+ WHERE workspace_id = ?
53
+ ORDER BY occurred_at DESC, sequence DESC
54
+ LIMIT ?
55
+ `;
56
+ const SQL_LIST_AUDIT_FOR_RELATIONSHIP = `
57
+ SELECT event_id, relationship_audit_schema_ver, workspace_id, sequence, occurred_at,
58
+ kind, relationship_id, actor_surface, redacted_actor_id, redaction_state, summary,
59
+ payload_json
60
+ FROM relationship_audit_entries
61
+ WHERE workspace_id = ? AND relationship_id = ?
62
+ ORDER BY occurred_at DESC, sequence DESC
63
+ LIMIT ?
64
+ `;
65
+ export const MAX_AUDIT_LIST_LIMIT = 256;
66
+ export const DEFAULT_AUDIT_LIST_LIMIT = 64;
67
+ // Rejects any payload object whose key (or a nested key) contains a forbidden substring per
68
+ // audit-events.md §8.3. Same normalisation as the validator's forbidden-key gate in
69
+ // `@oscharko-dev/keiko-contracts/relationships-validation` so the API and audit edges agree.
70
+ function assertNoForbiddenKeys(payload, path = "") {
71
+ if (payload === null || typeof payload !== "object" || Array.isArray(payload))
72
+ return;
73
+ for (const key of Object.keys(payload)) {
74
+ const normalized = key.toLowerCase().replace(/[^a-z0-9]/g, "");
75
+ for (const banned of RELATIONSHIP_FORBIDDEN_METADATA_KEY_SUBSTRINGS) {
76
+ if (normalized.includes(banned)) {
77
+ throw invalidRequest(`Audit payload key "${path}${key}" is in the forbidden set.`);
78
+ }
79
+ }
80
+ assertNoForbiddenKeys(payload[key], `${path}${key}.`);
81
+ }
82
+ }
83
+ function assertSummary(summary) {
84
+ if (summary.length > RELATIONSHIP_AUDIT_SUMMARY_MAX_CHARS) {
85
+ throw invalidRequest("Audit summary exceeds the 240-char bound.");
86
+ }
87
+ }
88
+ // Single redactor invocation site (audit-events.md §7). `redactString` is supplied by the
89
+ // API layer (typically `createAuditRedactor` + the configured secrets). The post-redaction
90
+ // shape is what hits the SQL INSERT — no second redaction inside this module.
91
+ export function insertRelationshipAuditEntry(db, entry, redactString) {
92
+ assertNoForbiddenKeys(entry.payload);
93
+ assertSummary(entry.summary);
94
+ const redactedSummary = redactString(entry.summary);
95
+ assertSummary(redactedSummary);
96
+ const redactedPayload = deepRedactStrings(entry.payload, redactString);
97
+ const payloadJson = JSON.stringify(redactedPayload);
98
+ // The subquery's WHERE clause receives workspaceId as the last bind parameter so that
99
+ // COALESCE(MAX(sequence),-1)+1 is scoped to the workspace. SQLite serialises writers so
100
+ // this read-modify-write happens atomically with no TOCTOU gap.
101
+ db.prepare(SQL_INSERT_AUDIT).run(entry.eventId, RELATIONSHIP_AUDIT_SCHEMA_VERSION, entry.workspaceId, entry.occurredAt, entry.kind, entry.relationshipId ?? null, entry.actor.surface, entry.actor.redactedActorId, "redacted-on-write", redactedSummary, payloadJson, entry.workspaceId);
102
+ const assigned = db
103
+ .prepare("SELECT sequence FROM relationship_audit_entries WHERE event_id = ?")
104
+ .get(entry.eventId);
105
+ if (assigned === undefined)
106
+ throw new Error("Audit INSERT returned no row.");
107
+ const row = {
108
+ eventId: entry.eventId,
109
+ workspaceId: entry.workspaceId,
110
+ sequence: assigned.sequence,
111
+ occurredAt: entry.occurredAt,
112
+ kind: entry.kind,
113
+ relationshipId: entry.relationshipId,
114
+ actorSurface: entry.actor.surface,
115
+ redactedActorId: entry.actor.redactedActorId,
116
+ redactionState: "redacted-on-write",
117
+ summary: redactedSummary,
118
+ payload: redactedPayload,
119
+ };
120
+ return row;
121
+ }
122
+ function rowToEntry(row) {
123
+ const payload = JSON.parse(row.payload_json);
124
+ return {
125
+ eventId: row.event_id,
126
+ workspaceId: row.workspace_id,
127
+ sequence: row.sequence,
128
+ occurredAt: row.occurred_at,
129
+ kind: row.kind,
130
+ relationshipId: row.relationship_id ?? undefined,
131
+ actorSurface: row.actor_surface,
132
+ redactedActorId: row.redacted_actor_id,
133
+ redactionState: row.redaction_state === "redacted-on-write-and-persist"
134
+ ? "redacted-on-write-and-persist"
135
+ : "redacted-on-write",
136
+ summary: row.summary,
137
+ payload,
138
+ };
139
+ }
140
+ export function listRelationshipAuditEntries(db, workspaceId, limit = DEFAULT_AUDIT_LIST_LIMIT) {
141
+ if (limit <= 0 || limit > MAX_AUDIT_LIST_LIMIT) {
142
+ throw invalidRequest("Audit limit out of bounds.");
143
+ }
144
+ const rows = db.prepare(SQL_LIST_AUDIT).all(workspaceId, limit);
145
+ return rows.map(rowToEntry);
146
+ }
147
+ export function listRelationshipAuditEntriesForRelationship(db, workspaceId, relationshipId, limit = DEFAULT_AUDIT_LIST_LIMIT) {
148
+ if (limit <= 0 || limit > MAX_AUDIT_LIST_LIMIT) {
149
+ throw invalidRequest("Audit limit out of bounds.");
150
+ }
151
+ const rows = db
152
+ .prepare(SQL_LIST_AUDIT_FOR_RELATIONSHIP)
153
+ .all(workspaceId, relationshipId, limit);
154
+ return rows.map(rowToEntry);
155
+ }
@@ -0,0 +1,191 @@
1
+ import type { DatabaseSync } from "node:sqlite";
2
+ import type { Relationship, RelationshipLifecycleState, RelationshipObjectKind, RelationshipType } from "@oscharko-dev/keiko-contracts";
3
+ export declare const MAX_LIST_LIMIT = 256;
4
+ export declare const DEFAULT_LIST_LIMIT = 64;
5
+ export declare const MAX_IMPACT_DEPTH = 3;
6
+ export declare const DEFAULT_IMPACT_DEPTH = 1;
7
+ export declare const MAX_IMPACT_NODES = 1024;
8
+ export declare const DEFAULT_IMPACT_NODES = 256;
9
+ export declare const MAX_IMPACT_RELATIONSHIPS = 2048;
10
+ export declare const DEFAULT_IMPACT_RELATIONSHIPS = 512;
11
+ export declare const LIFECYCLE_HISTORY_RETAIN = 32;
12
+ export declare const MAX_RELATIONSHIPS_PER_QUERY = 2048;
13
+ export type RelationshipScope = {
14
+ readonly kind: "user";
15
+ readonly userId: string;
16
+ readonly workspaceId: string;
17
+ } | {
18
+ readonly kind: "workspace";
19
+ readonly workspaceId: string;
20
+ } | {
21
+ readonly kind: "project";
22
+ readonly projectId: string;
23
+ readonly workspaceId: string;
24
+ } | {
25
+ readonly kind: "workflow";
26
+ readonly workflowDefinitionId: string;
27
+ readonly workspaceId: string;
28
+ } | {
29
+ readonly kind: "global";
30
+ readonly workspaceId: string;
31
+ };
32
+ export interface StoredRelationship extends Relationship {
33
+ readonly confidence?: number | undefined;
34
+ readonly summary?: string | undefined;
35
+ readonly scope: RelationshipScope;
36
+ }
37
+ export interface NewRelationship {
38
+ readonly id: string;
39
+ readonly workspaceId: string;
40
+ readonly scope: RelationshipScope;
41
+ readonly type: RelationshipType;
42
+ readonly source: {
43
+ readonly kind: RelationshipObjectKind;
44
+ readonly id: string;
45
+ readonly workspaceId: string;
46
+ };
47
+ readonly target: {
48
+ readonly kind: RelationshipObjectKind;
49
+ readonly id: string;
50
+ readonly workspaceId: string;
51
+ };
52
+ readonly lifecycleState: RelationshipLifecycleState;
53
+ readonly confidence?: number | undefined;
54
+ readonly summary?: string | undefined;
55
+ readonly createdAt: number;
56
+ readonly updatedAt: number;
57
+ readonly etag: string;
58
+ }
59
+ export interface RelationshipListQuery {
60
+ readonly workspaceId: string;
61
+ readonly sourceKind?: RelationshipObjectKind | undefined;
62
+ readonly sourceId?: string | undefined;
63
+ readonly targetKind?: RelationshipObjectKind | undefined;
64
+ readonly targetId?: string | undefined;
65
+ readonly type?: RelationshipType | undefined;
66
+ readonly lifecycle?: RelationshipLifecycleState | undefined;
67
+ readonly limit: number;
68
+ readonly afterEtag?: string | undefined;
69
+ }
70
+ export interface RelationshipListResult {
71
+ readonly entries: readonly StoredRelationship[];
72
+ readonly truncated: boolean;
73
+ readonly nextCursor: string | undefined;
74
+ }
75
+ export interface RelationshipCardinalitySnapshot {
76
+ readonly producesEvidenceForSource: number;
77
+ readonly startsWorkflowForTarget: number;
78
+ }
79
+ export interface RelationshipLifecycleHistoryRow {
80
+ readonly relationshipId: string;
81
+ readonly fromState: RelationshipLifecycleState;
82
+ readonly toState: RelationshipLifecycleState;
83
+ readonly occurredAt: number;
84
+ readonly summary?: string | undefined;
85
+ }
86
+ export interface RelationshipHealthEndpointRef {
87
+ readonly kind: RelationshipObjectKind;
88
+ readonly id: string;
89
+ }
90
+ export interface RelationshipHealthRelationshipRef {
91
+ readonly id: string;
92
+ readonly type: RelationshipType;
93
+ readonly source: RelationshipHealthEndpointRef;
94
+ readonly target: RelationshipHealthEndpointRef;
95
+ readonly lifecycle: RelationshipLifecycleState;
96
+ }
97
+ export interface RelationshipHealthFindings {
98
+ readonly orphanedEndpoints: readonly RelationshipHealthEndpointRef[];
99
+ readonly orphanedEndpointsTruncated: boolean;
100
+ readonly staleRelationships: readonly RelationshipHealthRelationshipRef[];
101
+ readonly staleRelationshipsTruncated: boolean;
102
+ readonly blockedRelationships: readonly RelationshipHealthRelationshipRef[];
103
+ readonly blockedRelationshipsTruncated: boolean;
104
+ readonly failedRelationships: readonly RelationshipHealthRelationshipRef[];
105
+ readonly failedRelationshipsTruncated: boolean;
106
+ readonly invalidReferences: readonly RelationshipHealthRelationshipRef[];
107
+ readonly invalidReferencesTruncated: boolean;
108
+ readonly cycleParticipants: readonly RelationshipHealthRelationshipRef[];
109
+ readonly cycleScanTruncated: boolean;
110
+ }
111
+ export interface RelationshipHealthSummary {
112
+ readonly checkedAt: number;
113
+ readonly totals: Readonly<Record<RelationshipLifecycleState, number>>;
114
+ readonly truncated: boolean;
115
+ readonly findings: RelationshipHealthFindings;
116
+ }
117
+ export declare function insertRelationship(db: DatabaseSync, rel: NewRelationship): StoredRelationship;
118
+ export declare function getRelationship(db: DatabaseSync, id: string, workspaceId: string): StoredRelationship | undefined;
119
+ export declare function getRelationshipEtag(db: DatabaseSync, id: string, workspaceId: string): string | undefined;
120
+ export interface UpdateLifecycleArgs {
121
+ readonly id: string;
122
+ readonly workspaceId: string;
123
+ readonly to: RelationshipLifecycleState;
124
+ readonly previous: RelationshipLifecycleState;
125
+ readonly newEtag: string;
126
+ readonly updatedAt: number;
127
+ readonly summary?: string | undefined;
128
+ }
129
+ export declare function updateRelationshipLifecycle(db: DatabaseSync, args: UpdateLifecycleArgs): StoredRelationship;
130
+ export interface ReconnectArgs {
131
+ readonly id: string;
132
+ readonly workspaceId: string;
133
+ readonly target: {
134
+ readonly kind: RelationshipObjectKind;
135
+ readonly id: string;
136
+ };
137
+ readonly newEtag: string;
138
+ readonly updatedAt: number;
139
+ readonly summary?: string | undefined;
140
+ }
141
+ export declare function reconnectRelationship(db: DatabaseSync, args: ReconnectArgs): StoredRelationship;
142
+ export declare function relationshipCardinalitySnapshot(db: DatabaseSync, workspaceId: string, source: {
143
+ readonly kind: RelationshipObjectKind;
144
+ readonly id: string;
145
+ }, target: {
146
+ readonly kind: RelationshipObjectKind;
147
+ readonly id: string;
148
+ }): RelationshipCardinalitySnapshot;
149
+ export declare function listRelationships(db: DatabaseSync, q: RelationshipListQuery): RelationshipListResult;
150
+ export declare function findRelationshipsBySource(db: DatabaseSync, workspaceId: string, source: {
151
+ readonly kind: RelationshipObjectKind;
152
+ readonly id: string;
153
+ }, limit: number): readonly StoredRelationship[];
154
+ export declare function findRelationshipsByTarget(db: DatabaseSync, workspaceId: string, target: {
155
+ readonly kind: RelationshipObjectKind;
156
+ readonly id: string;
157
+ }, limit: number): readonly StoredRelationship[];
158
+ export declare function listRelationshipLifecycleHistory(db: DatabaseSync, relationshipId: string, limit?: number): readonly RelationshipLifecycleHistoryRow[];
159
+ export interface DependencyWalkOptions {
160
+ readonly workspaceId: string;
161
+ readonly originId: string;
162
+ readonly direction: "outgoing" | "incoming" | "both";
163
+ readonly maxDepth: number;
164
+ readonly maxNodes: number;
165
+ readonly maxRelationships: number;
166
+ }
167
+ export interface DependencyWalkResult {
168
+ readonly relationships: readonly StoredRelationship[];
169
+ readonly nodes: readonly {
170
+ readonly kind: RelationshipObjectKind;
171
+ readonly id: string;
172
+ }[];
173
+ readonly truncated: boolean;
174
+ readonly truncationReason: "max-depth" | "max-nodes" | "max-relationships" | null;
175
+ readonly depthReached: number;
176
+ }
177
+ export declare function walkDependencies(db: DatabaseSync, options: DependencyWalkOptions): DependencyWalkResult;
178
+ export interface ImpactWalkOptions {
179
+ readonly workspaceId: string;
180
+ readonly endpoint: {
181
+ readonly kind: RelationshipObjectKind;
182
+ readonly id: string;
183
+ };
184
+ readonly direction: "outgoing" | "incoming" | "both";
185
+ readonly maxDepth: number;
186
+ readonly maxNodes: number;
187
+ readonly maxRelationships: number;
188
+ }
189
+ export declare function computeImpact(db: DatabaseSync, options: ImpactWalkOptions): DependencyWalkResult;
190
+ export declare function graphHealth(db: DatabaseSync, workspaceId: string): RelationshipHealthSummary;
191
+ //# sourceMappingURL=relationships.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/store/relationships.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EACV,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAQvC,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAI3C,eAAO,MAAM,2BAA2B,OAA2B,CAAC;AAOpE,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAChF;IAAE,QAAQ,CAAC,IAAI,EAAE,W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