@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
package/dist/routes.js ADDED
@@ -0,0 +1,507 @@
1
+ // BFF route dispatch (ADR-0011 D5). The route contract is wired here. The route TABLE
2
+ // (method + pattern) is static and dependency-free; each entry names a handler that receives the
3
+ // request context AND the per-server handler dependencies (resolved config, evidence store, run
4
+ // registry, redactor — see deps.ts). A handler returns a RouteResult (status + JSON body, which the
5
+ // server serializes) OR the STREAMING sentinel, meaning it has taken over the raw ServerResponse
6
+ // (the SSE events route). Non-2xx bodies use the redacted error envelope `{ error: { code, message } }`.
7
+ import { SDK_VERSION } from "@oscharko-dev/keiko-sdk";
8
+ import { handleConfig, handleModels, handleWorkflows, handleWorkspace, handleEvidenceList, handleEvidenceDetail, } from "./read-handlers.js";
9
+ import { handleCreateRun, handleCreateChatRun, handleRunEvents, handleCancelRun, handleGetRun, handleApplyRun, } from "./run-handlers.js";
10
+ import { handleListProjects, handleCreateProject, handleUpdateProject, handleDeleteProject, handleListChats, handleCreateChat, handleUpdateChat, handleDeleteChat, handleListMessages, handleCreateMessage, handleCreateRunSummaryPair, handleUpdateMessage, } from "./store-handlers.js";
11
+ import { handleCreateDesktopChat, handleSendDesktopChat } from "./chat-handlers.js";
12
+ import { handleSendDesktopChatStream } from "./chat-stream-handlers.js";
13
+ import { handleListMemories, handleMemoryReviewQueue, handleGetMemory, handleEditMemory, handlePinMemory, handleUnpinMemory, handleArchiveMemory, handleForgetMemory, handleForgetMemories, handleDeleteMemory, handleCorrectMemory, handleResolveMemoryConflict, handleAcceptMemoryProposal, handleRejectMemoryProposal, } from "./memory-handlers.js";
14
+ import { handleMemoryRetrieveContext, handleMemoryCaptureFromConversation, } from "./memory-conv-handlers.js";
15
+ import { handleCancelConsolidationJob, handleCreateConsolidationJob, handleGetConsolidationJob, } from "./memory-consolidation-handlers.js";
16
+ import { handleRunMaintenance } from "./memory-maintenance-handlers.js";
17
+ import { handleGroundedAsk } from "./grounded-qa.js";
18
+ import { handleGroundedWorkflowHandoff } from "./grounded-handoff.js";
19
+ import { handleGatewaySetup } from "./gateway-setup.js";
20
+ import { handleCreateTerminalExecution, handleDeleteTerminalExecution, handleTerminalDirectories, handleTerminalEvents, handleTerminalPolicy, } from "./terminal-routes.js";
21
+ import { handleFilesContent, handleFilesDirectories, handleFilesPreview, handleFilesTree, } from "./files.js";
22
+ import { handleEditorLanguage, handleEditorLanguageCapabilities } from "./editor/languageRoutes.js";
23
+ import { handleEditorContext, handleEditorLocalKnowledgeRetrieve, handleEditorRepoSearch, } from "./editor/contextRoutes.js";
24
+ import { handleEditorCompletion } from "./editor/completionRoutes.js";
25
+ import { handleEditorInlineCompletion, handleEditorInlineCompletionTelemetry, } from "./editor/inlineCompletionRoutes.js";
26
+ import { handleEditorTestGeneration } from "./editor/testGenerationRoutes.js";
27
+ import { handleEditorPatchApply } from "./editor/patchApplyRoutes.js";
28
+ import { handleEditorAgentActions, handleEditorAgentEvents, handleEditorAgentSessions, handleEditorAgentSnapshot, } from "./editor/agentRoutes.js";
29
+ import { handleBrowserApplyScreenshot, handleBrowserContent, handleBrowserEvents, handleBrowserNavigate, handleBrowserScreenshot, handleBrowserStatus, handleCreateBrowserSession, handleDeleteBrowserSession, } from "./browser.js";
30
+ import { handleCancelLocalKnowledgeCapsuleIndexing, handleConnectLocalKnowledgeCapsule, handleCreateLocalKnowledgeCapsule, handleCreateLocalKnowledgeCapsuleSet, handleDeleteLocalKnowledgeCapsule, handleDisconnectLocalKnowledgeCapsule, handleGetLocalKnowledgeCapsule, handleListLocalKnowledgeCapsules, handleListLocalKnowledgeCapsuleSets, handleReindexLocalKnowledgeCapsule, handleStartLocalKnowledgeCapsuleIndexing, handleUpdateLocalKnowledgeCapsule, } from "./local-knowledge-handlers.js";
31
+ import { handleRelationshipCreate, handleRelationshipDelete, handleRelationshipDependencies, handleRelationshipEvents, handleRelationshipExplain, handleRelationshipGet, handleRelationshipHealth, handleRelationshipImpact, handleRelationshipList, handleRelationshipPatch, handleRelationshipValidate, } from "./relationship-handlers.js";
32
+ import { handleQiCapabilities, handleQiDryRunFigma, handleQiDryRunJira, handleQiSourceSelect, handleListQiRuns, handleGetQiRun, QI_HANDOFF_ROUTE_GROUP, QI_RUN_EXECUTION_ROUTE_GROUP, QI_REVIEW_ROUTE_GROUP, QI_EXPORT_ROUTE_GROUP, QI_EDIT_ROUTE_GROUP, QI_RETENTION_ROUTE_GROUP, QI_TRACEABILITY_ROUTE_GROUP, QI_RECHECK_ROUTE_GROUP, } from "./qualityIntelligence/index.js";
33
+ import { handleFigmaListSnapshots, handleFigmaInspectSnapshotScreenJson, handleFigmaDeleteSnapshot, handleFigmaTriggerSnapshot, handleFigmaLoadSnapshot, handleFigmaLoadSnapshotImage, handleFigmaRevokeToken, handleFigmaUpdateSnapshotMetadata, } from "./qualityIntelligence/figmaSnapshotRoutes.js";
34
+ import { handleFigmaGenerateCode } from "./qualityIntelligence/figmaCodegenRoutes.js";
35
+ import { handlePromptEnhancement, handlePromptEnhancementEvidence, } from "./promptEnhancer/index.js";
36
+ export const STREAMING = Symbol("streaming");
37
+ function health() {
38
+ return { status: 200, body: { status: "ok", version: SDK_VERSION } };
39
+ }
40
+ // The full route contract: the twelve original (ADR-0011 D5), the first-run gateway setup
41
+ // endpoint, the 10 additive UI-store routes (ADR-0013 D7), three Issue #66 run-summary routes,
42
+ // two desktop chat routes, desktop terminal JSON routes, and read-only Files widget routes.
43
+ // Terminal byte I/O uses a token-scoped WebSocket upgrade path.
44
+ export const API_ROUTES = [
45
+ { method: "GET", pattern: "/api/health", handler: health },
46
+ { method: "GET", pattern: "/api/config", handler: handleConfig },
47
+ { method: "GET", pattern: "/api/models", handler: handleModels },
48
+ { method: "POST", pattern: "/api/gateway/setup", handler: handleGatewaySetup },
49
+ { method: "GET", pattern: "/api/workflows", handler: handleWorkflows },
50
+ { method: "POST", pattern: "/api/runs", handler: handleCreateRun },
51
+ { method: "GET", pattern: "/api/runs/:runId/events", handler: handleRunEvents },
52
+ { method: "POST", pattern: "/api/runs/:runId/cancel", handler: handleCancelRun },
53
+ { method: "GET", pattern: "/api/runs/:runId", handler: handleGetRun },
54
+ { method: "POST", pattern: "/api/runs/:runId/apply", handler: handleApplyRun },
55
+ { method: "GET", pattern: "/api/evidence", handler: handleEvidenceList },
56
+ { method: "GET", pattern: "/api/evidence/:runId", handler: handleEvidenceDetail },
57
+ { method: "GET", pattern: "/api/workspace", handler: handleWorkspace },
58
+ // ADR-0013 D7 — UI-local persistence routes (additive).
59
+ { method: "GET", pattern: "/api/projects", handler: handleListProjects },
60
+ { method: "POST", pattern: "/api/projects", handler: handleCreateProject },
61
+ { method: "PATCH", pattern: "/api/projects", handler: handleUpdateProject },
62
+ { method: "DELETE", pattern: "/api/projects", handler: handleDeleteProject },
63
+ { method: "GET", pattern: "/api/chats", handler: handleListChats },
64
+ { method: "POST", pattern: "/api/chats", handler: handleCreateChat },
65
+ // Issue #66 — composer launch path: persist chat pair and start the run as one BFF operation.
66
+ { method: "POST", pattern: "/api/chats/runs", handler: handleCreateChatRun },
67
+ { method: "PATCH", pattern: "/api/chats", handler: handleUpdateChat },
68
+ { method: "DELETE", pattern: "/api/chats", handler: handleDeleteChat },
69
+ { method: "GET", pattern: "/api/chats/messages", handler: handleListMessages },
70
+ { method: "POST", pattern: "/api/chats/messages", handler: handleCreateMessage },
71
+ // Issue #66 — atomic composer write: exactly one user message plus one run-summary system message.
72
+ {
73
+ method: "POST",
74
+ pattern: "/api/chats/messages/run-summary-pair",
75
+ handler: handleCreateRunSummaryPair,
76
+ },
77
+ // Issue #66 — PATCH a run-summary message (status/shortResult/taskType).
78
+ { method: "PATCH", pattern: "/api/chats/messages", handler: handleUpdateMessage },
79
+ // Issue #185 — grounded repository-aware Q&A. Composes #179-#183 behind the chat-scope binding.
80
+ { method: "POST", pattern: "/api/chats/messages/grounded", handler: handleGroundedAsk },
81
+ {
82
+ method: "POST",
83
+ pattern: "/api/chats/messages/grounded/handoff",
84
+ handler: handleGroundedWorkflowHandoff,
85
+ },
86
+ // Desktop canvas V1 — real chat against the configured gateway model without new agent scope.
87
+ { method: "POST", pattern: "/api/desktop/chats", handler: handleCreateDesktopChat },
88
+ { method: "POST", pattern: "/api/desktop/chat", handler: handleSendDesktopChat },
89
+ { method: "POST", pattern: "/api/desktop/chat/stream", handler: handleSendDesktopChatStream },
90
+ // ADR-0018 — bounded permitted-command execution. PTY routes (shells/sessions/WS upgrade) and
91
+ // the WebSocket upgrade handler in server.ts are removed; commands run via synchronous POST.
92
+ { method: "GET", pattern: "/api/terminal/policy", handler: handleTerminalPolicy },
93
+ { method: "GET", pattern: "/api/terminal/directories", handler: handleTerminalDirectories },
94
+ { method: "POST", pattern: "/api/terminal/executions", handler: handleCreateTerminalExecution },
95
+ {
96
+ method: "DELETE",
97
+ pattern: "/api/terminal/executions/:executionId",
98
+ handler: handleDeleteTerminalExecution,
99
+ },
100
+ { method: "GET", pattern: "/api/terminal/events", handler: handleTerminalEvents },
101
+ // Desktop files — selected-root browser, preview, and editor control plane.
102
+ { method: "GET", pattern: "/api/files/directories", handler: handleFilesDirectories },
103
+ { method: "GET", pattern: "/api/files/tree", handler: handleFilesTree },
104
+ { method: "GET", pattern: "/api/files/preview", handler: handleFilesPreview },
105
+ { method: "GET", pattern: "/api/files/content", handler: handleFilesContent },
106
+ { method: "PATCH", pattern: "/api/files/content", handler: handleFilesContent },
107
+ // Issue #1198 — deterministic, model-free language intelligence (completion, diagnostics, hover,
108
+ // symbols) over an editor overlay (ADR-0042 D4). Capabilities advertises the registered providers.
109
+ {
110
+ method: "GET",
111
+ pattern: "/api/editor/language/capabilities",
112
+ handler: handleEditorLanguageCapabilities,
113
+ },
114
+ {
115
+ method: "POST",
116
+ pattern: "/api/editor/language",
117
+ handler: (ctx, deps) => handleEditorLanguage(ctx, deps, deps.editorLanguageRouteOptions),
118
+ },
119
+ // Issue #1211 — governed coding-context retrieval (ADR-0042 D6). The context route assembles a
120
+ // bounded, redacted pack (repo-search always; Local Knowledge + memory only for explicit,
121
+ // embedding-eligible purposes) and returns the content-free wire pack; the repo-search and
122
+ // local-knowledge routes expose the governed building blocks (EvidenceAtom[] and query-only
123
+ // retrieval references). No browser-side retrieval, embedding, or model access.
124
+ { method: "POST", pattern: "/api/editor/context", handler: handleEditorContext },
125
+ { method: "POST", pattern: "/api/editor/repo-search", handler: handleEditorRepoSearch },
126
+ // Issue #1199 — governed completion gateway (ADR-0042 D4/D5/D6). Deterministic language-service
127
+ // completion (#1198) always, plus gated model-assisted completion (#1210) over coding context
128
+ // (#1211). Content-free response apart from reviewable insertText; the browser never reaches a model.
129
+ { method: "POST", pattern: "/api/editor/completion", handler: handleEditorCompletion },
130
+ // Issue #1200 — governed inline completion (ghost text, ADR-0042 D5/D6). Model-only, gated on an
131
+ // aligned FIM model (#1210) over coding context (#1211, purpose:inline); degrades to zero items
132
+ // (falling back to #1199) when unavailable, disabled by policy, or rate-limited. The telemetry
133
+ // route records content-free acceptance/rejection counts. The browser never reaches a model.
134
+ {
135
+ method: "POST",
136
+ pattern: "/api/editor/inline-completion",
137
+ handler: handleEditorInlineCompletion,
138
+ },
139
+ {
140
+ method: "POST",
141
+ pattern: "/api/editor/inline-completion/telemetry",
142
+ handler: handleEditorInlineCompletionTelemetry,
143
+ },
144
+ // Issue #1202 — governed editor-driven test generation (ADR-0042 D7). Wave-2 surface shipped
145
+ // switched OFF: default → `disabled` (no retrieval/model/execution); enabled → `deferred` (governed
146
+ // #1211 discovery for provenance, but NO model call) until an enforced egress boundary unlocks
147
+ // candidate generation. No v1 flow executes model-generated code; the browser never reaches a model.
148
+ {
149
+ method: "POST",
150
+ pattern: "/api/editor/test-generation",
151
+ handler: handleEditorTestGeneration,
152
+ },
153
+ // Issue #1204 — governed editor-driven patch apply + post-apply verification (ADR-0042 D7, ADR-0043).
154
+ // Wave-2 surface shipped switched OFF: default → `disabled` (no validation/write/execution). When
155
+ // enabled, a reviewed candidate patch is applied only on an explicit user decision and only after
156
+ // keiko-tools validation (scope, conflict, no-silent-overwrite, limits); post-apply verification then
157
+ // re-confirms the applied test under an enforced, deny-by-default egress boundary (keiko-sandbox), and
158
+ // a failed verification surfaces a guarded revert proposal (never a silent rollback).
159
+ {
160
+ method: "POST",
161
+ pattern: "/api/editor/patch-apply",
162
+ handler: handleEditorPatchApply,
163
+ },
164
+ {
165
+ method: "GET",
166
+ pattern: "/api/editor/agent/sessions",
167
+ handler: handleEditorAgentSessions,
168
+ },
169
+ {
170
+ method: "POST",
171
+ pattern: "/api/editor/agent/snapshot",
172
+ handler: handleEditorAgentSnapshot,
173
+ },
174
+ {
175
+ method: "POST",
176
+ pattern: "/api/editor/agent/actions",
177
+ handler: handleEditorAgentActions,
178
+ },
179
+ {
180
+ method: "GET",
181
+ pattern: "/api/editor/agent/events",
182
+ handler: handleEditorAgentEvents,
183
+ },
184
+ {
185
+ method: "POST",
186
+ pattern: "/api/editor/local-knowledge/retrieve",
187
+ handler: handleEditorLocalKnowledgeRetrieve,
188
+ },
189
+ // Issue #198 audit fix — live capsule detail/health routes for the Local Knowledge UI.
190
+ {
191
+ method: "GET",
192
+ pattern: "/api/local-knowledge/capsules",
193
+ handler: handleListLocalKnowledgeCapsules,
194
+ },
195
+ {
196
+ method: "POST",
197
+ pattern: "/api/local-knowledge/capsules",
198
+ handler: handleCreateLocalKnowledgeCapsule,
199
+ },
200
+ {
201
+ method: "GET",
202
+ pattern: "/api/local-knowledge/capsule-sets",
203
+ handler: handleListLocalKnowledgeCapsuleSets,
204
+ },
205
+ {
206
+ method: "POST",
207
+ pattern: "/api/local-knowledge/capsule-sets",
208
+ handler: handleCreateLocalKnowledgeCapsuleSet,
209
+ },
210
+ {
211
+ method: "GET",
212
+ pattern: "/api/local-knowledge/capsules/:capsuleId",
213
+ handler: handleGetLocalKnowledgeCapsule,
214
+ },
215
+ {
216
+ method: "PATCH",
217
+ pattern: "/api/local-knowledge/capsules/:capsuleId",
218
+ handler: handleUpdateLocalKnowledgeCapsule,
219
+ },
220
+ {
221
+ method: "POST",
222
+ pattern: "/api/local-knowledge/capsules/:capsuleId/index",
223
+ handler: handleStartLocalKnowledgeCapsuleIndexing,
224
+ },
225
+ {
226
+ method: "DELETE",
227
+ pattern: "/api/local-knowledge/capsules/:capsuleId/index",
228
+ handler: handleCancelLocalKnowledgeCapsuleIndexing,
229
+ },
230
+ {
231
+ method: "POST",
232
+ pattern: "/api/local-knowledge/capsules/:capsuleId/connection",
233
+ handler: handleConnectLocalKnowledgeCapsule,
234
+ },
235
+ {
236
+ method: "DELETE",
237
+ pattern: "/api/local-knowledge/capsules/:capsuleId/connection",
238
+ handler: handleDisconnectLocalKnowledgeCapsule,
239
+ },
240
+ {
241
+ method: "DELETE",
242
+ pattern: "/api/local-knowledge/capsules/:capsuleId",
243
+ handler: handleDeleteLocalKnowledgeCapsule,
244
+ },
245
+ {
246
+ method: "POST",
247
+ pattern: "/api/local-knowledge/capsules/:capsuleId/reindex",
248
+ handler: handleReindexLocalKnowledgeCapsule,
249
+ },
250
+ // Issues #209/#211 — MemoriaViva governance routes (Epic #204).
251
+ { method: "GET", pattern: "/api/memory", handler: handleListMemories },
252
+ { method: "GET", pattern: "/api/memory/review-queue", handler: handleMemoryReviewQueue },
253
+ { method: "POST", pattern: "/api/memory/forget", handler: handleForgetMemories },
254
+ {
255
+ method: "POST",
256
+ pattern: "/api/memory/conflicts/resolve",
257
+ handler: handleResolveMemoryConflict,
258
+ },
259
+ { method: "GET", pattern: "/api/memory/:id", handler: handleGetMemory },
260
+ { method: "PATCH", pattern: "/api/memory/:id", handler: handleEditMemory },
261
+ { method: "POST", pattern: "/api/memory/:id/pin", handler: handlePinMemory },
262
+ { method: "POST", pattern: "/api/memory/:id/unpin", handler: handleUnpinMemory },
263
+ { method: "POST", pattern: "/api/memory/:id/archive", handler: handleArchiveMemory },
264
+ { method: "POST", pattern: "/api/memory/:id/forget", handler: handleForgetMemory },
265
+ { method: "DELETE", pattern: "/api/memory/:id", handler: handleDeleteMemory },
266
+ { method: "POST", pattern: "/api/memory/:id/correct", handler: handleCorrectMemory },
267
+ {
268
+ method: "POST",
269
+ pattern: "/api/memory/proposals/:id/accept",
270
+ handler: handleAcceptMemoryProposal,
271
+ },
272
+ {
273
+ method: "POST",
274
+ pattern: "/api/memory/proposals/:id/reject",
275
+ handler: handleRejectMemoryProposal,
276
+ },
277
+ // Issue #212 — Conversation Center memory wiring.
278
+ { method: "POST", pattern: "/api/memory/context", handler: handleMemoryRetrieveContext },
279
+ {
280
+ method: "POST",
281
+ pattern: "/api/memory/capture-from-conversation",
282
+ handler: handleMemoryCaptureFromConversation,
283
+ },
284
+ // Issue #208 — explicit consolidation jobs for the MemoriaViva review surface.
285
+ {
286
+ method: "POST",
287
+ pattern: "/api/memory/consolidation/jobs",
288
+ handler: handleCreateConsolidationJob,
289
+ },
290
+ {
291
+ method: "GET",
292
+ pattern: "/api/memory/consolidation/jobs/:jobId",
293
+ handler: handleGetConsolidationJob,
294
+ },
295
+ {
296
+ method: "POST",
297
+ pattern: "/api/memory/consolidation/jobs/:jobId/cancel",
298
+ handler: handleCancelConsolidationJob,
299
+ },
300
+ // Issue #204 — bounded, user-triggerable memory maintenance (consolidate + decay + forget).
301
+ { method: "POST", pattern: "/api/memory/maintenance", handler: handleRunMaintenance },
302
+ // ADR-0017 — browser tool (BYO Chrome over CDP).
303
+ { method: "GET", pattern: "/api/browser/status", handler: handleBrowserStatus },
304
+ { method: "POST", pattern: "/api/browser/sessions", handler: handleCreateBrowserSession },
305
+ {
306
+ method: "DELETE",
307
+ pattern: "/api/browser/sessions/:sessionId",
308
+ handler: handleDeleteBrowserSession,
309
+ },
310
+ {
311
+ method: "POST",
312
+ pattern: "/api/browser/sessions/:sessionId/navigate",
313
+ handler: handleBrowserNavigate,
314
+ },
315
+ {
316
+ method: "POST",
317
+ pattern: "/api/browser/sessions/:sessionId/screenshot",
318
+ handler: handleBrowserScreenshot,
319
+ },
320
+ {
321
+ method: "POST",
322
+ pattern: "/api/browser/sessions/:sessionId/apply",
323
+ handler: handleBrowserApplyScreenshot,
324
+ },
325
+ {
326
+ method: "POST",
327
+ pattern: "/api/browser/sessions/:sessionId/content",
328
+ handler: handleBrowserContent,
329
+ },
330
+ {
331
+ method: "GET",
332
+ pattern: "/api/browser/sessions/:sessionId/events",
333
+ handler: handleBrowserEvents,
334
+ },
335
+ // Issue #278 (Epic #270) — Quality Intelligence connector routes (additive).
336
+ // Authorisation defaults to FALSE; only flips on explicit gateway-config flags.
337
+ // No outbound network call; no provider SDK import.
338
+ {
339
+ method: "POST",
340
+ pattern: "/api/quality-intelligence/sources/select",
341
+ handler: handleQiSourceSelect,
342
+ },
343
+ {
344
+ method: "POST",
345
+ pattern: "/api/quality-intelligence/sources/dryrun-figma",
346
+ handler: handleQiDryRunFigma,
347
+ },
348
+ {
349
+ method: "POST",
350
+ pattern: "/api/quality-intelligence/sources/dryrun-jira",
351
+ handler: handleQiDryRunJira,
352
+ },
353
+ {
354
+ method: "GET",
355
+ pattern: "/api/quality-intelligence/sources/capabilities",
356
+ handler: handleQiCapabilities,
357
+ },
358
+ // Epic #1307 / Issue #1314 — Prompt Enhancer governed BFF route (additive). Composes the
359
+ // deterministic enhancer core (#1309–#1313) through the Model Gateway; never dispatches a model.
360
+ { method: "POST", pattern: "/api/prompt-enhancement", handler: handlePromptEnhancement },
361
+ {
362
+ method: "GET",
363
+ pattern: "/api/prompt-enhancement/evidence/:runId",
364
+ handler: handlePromptEnhancementEvidence,
365
+ },
366
+ // Issue #280 (Epic #270) — Quality Intelligence UI read routes (additive). Composed from
367
+ // keiko-evidence UNCHANGED (ADR-0023 D8).
368
+ { method: "GET", pattern: "/api/quality-intelligence/runs", handler: handleListQiRuns },
369
+ { method: "GET", pattern: "/api/quality-intelligence/runs/:id", handler: handleGetQiRun },
370
+ // Issue #273/#280 (Epic #270) — Quality Intelligence run execution: start (SSE progress stream)
371
+ // + cancel. The model-routed test-design workflow runs through the Keiko Model Gateway and
372
+ // persists the manifest + candidate artifact through Keiko Evidence.
373
+ ...QI_RUN_EXECUTION_ROUTE_GROUP,
374
+ // Issue #282/#283 (Epic #270) — Quality Intelligence review governance + export. Literal-suffix
375
+ // POST routes (/runs/:id/review, /runs/:id/export) disambiguate against /runs/:id/cancel.
376
+ ...QI_REVIEW_ROUTE_GROUP,
377
+ ...QI_EXPORT_ROUTE_GROUP,
378
+ // Issue #726 (Epic #712) — inline candidate editing. Literal-suffix POST /runs/:id/edit
379
+ // disambiguates against /runs/:id/cancel just like /review and /export above.
380
+ ...QI_EDIT_ROUTE_GROUP,
381
+ // Issue #282 follow-up (Epic #270) — run-deletion control. DELETE /runs/:id is method-distinct
382
+ // from GET /runs/:id and sweeps every server-owned companion (ADR-0023 D8).
383
+ ...QI_RETENTION_ROUTE_GROUP,
384
+ // Issue #740 (Epic #734) — requirement↔test traceability matrix export.
385
+ ...QI_TRACEABILITY_ROUTE_GROUP,
386
+ // Issue #743 (Epic #735) — drift re-check + targeted regeneration. Literal-suffix POST routes
387
+ // (:id/re-check, :id/regenerate-stale) must be registered before any parameterised sibling.
388
+ ...QI_RECHECK_ROUTE_GROUP,
389
+ // Issue #539 (Epic #532) — relationship engine routes. The api-contract.md §2 ordering
390
+ // is preserved; literal-suffix paths (validate, impact, health, events) come BEFORE the
391
+ // `:id`-templated routes so matchRoute returns the literal handler instead of binding
392
+ // "validate" / "impact" / "health" / "events" to the `:id` param. Internal route #11
393
+ // (events) returns the STREAMING sentinel from `handleRelationshipEvents`.
394
+ { method: "POST", pattern: "/api/relationships/validate", handler: handleRelationshipValidate },
395
+ { method: "GET", pattern: "/api/relationships/impact", handler: handleRelationshipImpact },
396
+ { method: "GET", pattern: "/api/relationships/health", handler: handleRelationshipHealth },
397
+ { method: "GET", pattern: "/api/relationships/events", handler: handleRelationshipEvents },
398
+ { method: "POST", pattern: "/api/relationships", handler: handleRelationshipCreate },
399
+ { method: "GET", pattern: "/api/relationships", handler: handleRelationshipList },
400
+ { method: "GET", pattern: "/api/relationships/:id", handler: handleRelationshipGet },
401
+ { method: "PATCH", pattern: "/api/relationships/:id", handler: handleRelationshipPatch },
402
+ { method: "DELETE", pattern: "/api/relationships/:id", handler: handleRelationshipDelete },
403
+ {
404
+ method: "GET",
405
+ pattern: "/api/relationships/:id/dependencies",
406
+ handler: handleRelationshipDependencies,
407
+ },
408
+ { method: "GET", pattern: "/api/relationships/:id/explain", handler: handleRelationshipExplain },
409
+ // Epic #750, Issue #756 — Figma Snapshot UI routes. PAT stays server-side; UI-safe projection only.
410
+ // POST triggers a bounded snapshot-build from a board link; GET loads the stored summary.
411
+ // Token: resolved server-side from vault, config, or FIGMA_ACCESS_TOKEN env; never in response.
412
+ { method: "POST", pattern: "/api/figma/snapshots", handler: handleFigmaTriggerSnapshot },
413
+ { method: "GET", pattern: "/api/figma/snapshots", handler: handleFigmaListSnapshots },
414
+ { method: "GET", pattern: "/api/figma/snapshots/:runId", handler: handleFigmaLoadSnapshot },
415
+ {
416
+ method: "PATCH",
417
+ pattern: "/api/figma/snapshots/:runId",
418
+ handler: handleFigmaUpdateSnapshotMetadata,
419
+ },
420
+ { method: "DELETE", pattern: "/api/figma/snapshots/:runId", handler: handleFigmaDeleteSnapshot },
421
+ {
422
+ method: "GET",
423
+ pattern: "/api/figma/snapshots/:runId/screens/:screenId/json",
424
+ handler: handleFigmaInspectSnapshotScreenJson,
425
+ },
426
+ {
427
+ method: "GET",
428
+ pattern: "/api/figma/snapshots/:runId/screens/:screenIndex/image",
429
+ handler: handleFigmaLoadSnapshotImage,
430
+ },
431
+ // Epic #750 #758/#760 — operator revokes the stored encrypted PAT (audited key removal).
432
+ { method: "DELETE", pattern: "/api/figma/token", handler: handleFigmaRevokeToken },
433
+ // Epic #750 #755 — design-to-code: emit reviewable HTML/CSS from a stored snapshot.
434
+ { method: "POST", pattern: "/api/figma/snapshots/:runId/code", handler: handleFigmaGenerateCode },
435
+ // Issue #281 (Epic #270) — Conversation Center → QI workflow handoff route group.
436
+ // Single POST seam; the body is a typed `QualityIntelligenceConversationCenterHandoff`
437
+ // envelope (refs only, no chat content). Registered as a sibling group so concurrent
438
+ // QI epic merges (e.g. #280) stay mechanically merge-safe.
439
+ ...QI_HANDOFF_ROUTE_GROUP,
440
+ ];
441
+ // Matches a concrete path against a route pattern, capturing `:name` params. Returns the captured
442
+ // params, or undefined when the segment counts differ or a literal segment mismatches.
443
+ function matchPattern(pattern, pathname) {
444
+ const patternParts = pattern.split("/");
445
+ const pathParts = pathname.split("/");
446
+ if (patternParts.length !== pathParts.length) {
447
+ return undefined;
448
+ }
449
+ const params = {};
450
+ for (let i = 0; i < patternParts.length; i++) {
451
+ const p = patternParts[i] ?? "";
452
+ const actual = pathParts[i] ?? "";
453
+ if (p.startsWith(":")) {
454
+ if (actual.length === 0) {
455
+ return undefined;
456
+ }
457
+ params[p.slice(1)] = actual;
458
+ }
459
+ else if (p !== actual) {
460
+ return undefined;
461
+ }
462
+ }
463
+ return params;
464
+ }
465
+ // Resolves a method+path to a route. Returns `{ definition, params }` on a full match, the string
466
+ // `"method-not-allowed"` when the path matches a route of a different method, or undefined when no
467
+ // route path matches at all.
468
+ export function matchRoute(method, pathname) {
469
+ let bestMethodMatch;
470
+ let bestMethodSpecificity = -1;
471
+ let bestOtherMethodSpecificity = -1;
472
+ for (const definition of API_ROUTES) {
473
+ const params = matchPattern(definition.pattern, pathname);
474
+ if (params === undefined) {
475
+ continue;
476
+ }
477
+ const specificity = definition.pattern
478
+ .split("/")
479
+ .filter((part) => !part.startsWith(":")).length;
480
+ if (definition.method === method) {
481
+ if (specificity > bestMethodSpecificity) {
482
+ bestMethodSpecificity = specificity;
483
+ bestMethodMatch = { definition, params };
484
+ }
485
+ continue;
486
+ }
487
+ if (specificity > bestOtherMethodSpecificity) {
488
+ bestOtherMethodSpecificity = specificity;
489
+ }
490
+ }
491
+ if (bestMethodMatch !== undefined && bestMethodSpecificity >= bestOtherMethodSpecificity) {
492
+ return bestMethodMatch;
493
+ }
494
+ return bestOtherMethodSpecificity >= 0 ? "method-not-allowed" : undefined;
495
+ }
496
+ export function isApiPath(pathname) {
497
+ return pathname === "/api" || pathname.startsWith("/api/");
498
+ }
499
+ export function errorBody(code, message) {
500
+ return { error: { code, message } };
501
+ }
502
+ export function notFoundBody() {
503
+ return errorBody("NOT_FOUND", "The requested resource was not found.");
504
+ }
505
+ export function methodNotAllowedBody() {
506
+ return errorBody("METHOD_NOT_ALLOWED", "The HTTP method is not allowed for this resource.");
507
+ }
@@ -0,0 +1,25 @@
1
+ import type { ModelPort } from "@oscharko-dev/keiko-harness";
2
+ import type { MemoryVaultStore } from "@oscharko-dev/keiko-memory-vault";
3
+ import type { RunRequest } from "./run-request.js";
4
+ import type { AppliableSnapshot, RunRegistry } from "./runs.js";
5
+ import { type EvidencePersistContext } from "./evidence.js";
6
+ export interface StartRunResult {
7
+ readonly runId: string;
8
+ readonly fingerprint: string;
9
+ }
10
+ export interface StartRunOptions {
11
+ readonly runId?: string;
12
+ }
13
+ interface EngineContext {
14
+ readonly request: RunRequest;
15
+ readonly model: ModelPort;
16
+ readonly registry: RunRegistry;
17
+ readonly evidence?: EvidencePersistContext | undefined;
18
+ readonly memoryVault?: MemoryVaultStore | undefined;
19
+ readonly memoryAuditRedactString?: ((input: string) => string) | undefined;
20
+ readonly memoryCustomerIdentifierMatchers?: readonly RegExp[] | undefined;
21
+ }
22
+ export declare function startRun(ctx: EngineContext, redactReport: (value: unknown) => unknown, options?: StartRunOptions): StartRunResult;
23
+ export declare function applyRun(snapshot: AppliableSnapshot, model: ModelPort, modelId: string, redactReport: (value: unknown) => unknown): Promise<unknown>;
24
+ export type { EngineContext };
25
+ //# sourceMappingURL=run-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-engine.d.ts","sourceRoot":"","sources":["../src/run-engine.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAqB7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAa,MAAM,WAAW,CAAC;AAC3E,OAAO,EAIL,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AASD,UAAU,aAAa;IACrB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAG/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;IAC3E,QAAQ,CAAC,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3E;AA8TD,wBAAgB,QAAQ,CACtB,GAAG,EAAE,aAAa,EAClB,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,EACzC,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAoBhB;AA4GD,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GACxC,OAAO,CAAC,OAAO,CAAC,CAmBlB;AAMD,YAAY,EAAE,aAAa,EAAE,CAAC"}