@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,177 @@
1
+ // Post-apply verification orchestration for editor-driven patch apply (Issue #1204, ADR-0042 D7,
2
+ // ADR-0043). After a generated test patch is applied to the workspace, this re-confirms the candidate
3
+ // IN PLACE — it runs the applied test file(s) as a targeted-test step through the keiko-verification
4
+ // orchestrator, isolated by an ENFORCED, deny-by-default network-egress boundary (keiko-sandbox). It is
5
+ // a confirmation that an already-assured candidate still holds (integration + write-conflict), NOT the
6
+ // generation-time mutation/coverage gate (that stays in #1202/#1203).
7
+ //
8
+ // Egress is enforced fail-closed: the host is probed for a network-isolating sandbox backend, and the
9
+ // orchestrator runs with "enforce-or-fail-closed". On a host with a backend the applied test executes
10
+ // with network:"none" (attested); on a host without one the untrusted test code is NOT executed and the
11
+ // outcome is `denied`. The applied test runs against the real workspace (filesystem inherited) because
12
+ // the user explicitly applied the patch there; only egress — the data-exfiltration threat — is blocked.
13
+ //
14
+ // The node effects (sandbox probe, orchestrator run) sit behind an injectable port so the route's tests
15
+ // drive deterministic outcomes without a sandbox backend.
16
+ import { currentPlatform, planIsolatedRun, probeBackends } from "@oscharko-dev/keiko-sandbox";
17
+ import { DEFAULT_SANDBOX_POLICY } from "@oscharko-dev/keiko-tools";
18
+ import { DEFAULT_VERIFICATION_LIMITS, planDirectTargetedTests, runVerification, } from "@oscharko-dev/keiko-verification";
19
+ import { detectWorkspaceAt } from "@oscharko-dev/keiko-workspace";
20
+ import { nodeWorkspaceFs } from "@oscharko-dev/keiko-workspace/internal/fs";
21
+ const ENV_ALLOWLIST_COUNT = DEFAULT_SANDBOX_POLICY.envAllowlist.length;
22
+ function bounds() {
23
+ return {
24
+ wallTimeMs: DEFAULT_VERIFICATION_LIMITS.wallTimeMs,
25
+ maxOutputBytes: DEFAULT_VERIFICATION_LIMITS.maxOutputBytes,
26
+ envAllowlistCount: ENV_ALLOWLIST_COUNT,
27
+ };
28
+ }
29
+ /** The summary for a post-apply verification that did not run (no resolvable targeted test). */
30
+ export function notRunVerificationSummary() {
31
+ return {
32
+ outcome: "not-run",
33
+ networkEnforced: false,
34
+ sandboxBackend: "none",
35
+ stepCount: 0,
36
+ passed: 0,
37
+ failed: 0,
38
+ durationMs: 0,
39
+ bounds: bounds(),
40
+ preApply: false,
41
+ secretsRedacted: true,
42
+ detail: "No runnable test was resolved for the applied files; verification did not run.",
43
+ };
44
+ }
45
+ /** The summary for a verification explicitly skipped by configured deployment policy. */
46
+ export function skippedVerificationSummary() {
47
+ return {
48
+ outcome: "skipped",
49
+ networkEnforced: false,
50
+ sandboxBackend: "none",
51
+ stepCount: 0,
52
+ passed: 0,
53
+ failed: 0,
54
+ durationMs: 0,
55
+ bounds: bounds(),
56
+ preApply: false,
57
+ secretsRedacted: true,
58
+ detail: "Post-apply verification was disabled by configured policy.",
59
+ };
60
+ }
61
+ /** The summary for a verification denied before patch application because egress cannot be enforced. */
62
+ export function deniedVerificationSummary() {
63
+ return {
64
+ outcome: "denied",
65
+ networkEnforced: false,
66
+ sandboxBackend: "none",
67
+ stepCount: 0,
68
+ passed: 0,
69
+ failed: 0,
70
+ durationMs: 0,
71
+ bounds: bounds(),
72
+ preApply: true,
73
+ secretsRedacted: true,
74
+ detail: "No enforcing sandbox backend is available on this host; the patch was not applied.",
75
+ };
76
+ }
77
+ function isRunnableTestFramework(workspace) {
78
+ return workspace.testFramework === "vitest" || workspace.testFramework === "jest";
79
+ }
80
+ // Probes whether THIS host can enforce a deny-by-default network-egress boundary for a run rooted at
81
+ // `cwd` (filesystem inherited — the applied test runs against the real workspace). No untrusted command
82
+ // is spawned during the probe. A network:"none" run is enforceable on more backends (macOS seatbelt,
83
+ // Linux bubblewrap/unshare) than the execution-root boundary the assured pre-filter requires.
84
+ export function probeNetworkIsolation(cwd) {
85
+ const decision = planIsolatedRun({ command: "node", args: [], cwd, network: "none" }, probeBackends(), currentPlatform());
86
+ return {
87
+ available: decision.kind === "wrapped" && decision.attestation.networkEnforced,
88
+ backend: decision.attestation.backend,
89
+ };
90
+ }
91
+ // Statuses that count as an actual test failure. `denied` is deliberately excluded: a denied step was
92
+ // never executed (egress could not be enforced), so it is surfaced via the distinct `denied` outcome,
93
+ // not as a failed test.
94
+ const FAILED_STATUSES = new Set([
95
+ "failed",
96
+ "timed-out",
97
+ "resource-exceeded",
98
+ ]);
99
+ function networkEnforcedFromReport(results) {
100
+ return results.some((result) => result.appliedLimits.some((decision) => decision.dimension === "network" && decision.enforced));
101
+ }
102
+ // Maps the orchestrator report onto the content-free verification summary. A `denied` step (egress could
103
+ // not be enforced) is surfaced distinctly from a `failed` step (the applied test did not pass).
104
+ function toSummary(report, probe) {
105
+ const results = report.results;
106
+ const denied = results.some((result) => result.status === "denied");
107
+ const passed = results.filter((result) => result.status === "passed").length;
108
+ const failed = results.filter((result) => FAILED_STATUSES.has(result.status)).length;
109
+ const outcome = denied ? "denied" : report.overallStatus === "passed" ? "passed" : "failed";
110
+ return {
111
+ outcome,
112
+ networkEnforced: !denied && networkEnforcedFromReport(results),
113
+ sandboxBackend: denied ? "none" : probe.backend,
114
+ stepCount: results.length,
115
+ passed,
116
+ failed,
117
+ durationMs: report.durationMs,
118
+ bounds: bounds(),
119
+ preApply: false,
120
+ secretsRedacted: true,
121
+ detail: detailFor(outcome),
122
+ };
123
+ }
124
+ function detailFor(outcome) {
125
+ if (outcome === "denied") {
126
+ return "No enforcing sandbox backend is available on this host; the applied test was not executed.";
127
+ }
128
+ if (outcome === "failed") {
129
+ return "The applied test did not pass under enforced isolation. Review the change and the revert proposal.";
130
+ }
131
+ return "The applied test passed under enforced isolation.";
132
+ }
133
+ function verificationCommand(workspace) {
134
+ if (workspace.testFramework === "vitest") {
135
+ return "npx vitest run";
136
+ }
137
+ if (workspace.testFramework === "jest") {
138
+ return "npx jest";
139
+ }
140
+ return "none";
141
+ }
142
+ export function requiresPostApplyVerificationPreflight(workspace, appliedTestFiles) {
143
+ if (!isRunnableTestFramework(workspace)) {
144
+ return false;
145
+ }
146
+ return appliedTestFiles.length > 0;
147
+ }
148
+ // The route's default post-apply verification: plan a targeted-test step for the applied files, then run
149
+ // it through the orchestrator with enforced, fail-closed egress isolation.
150
+ export const defaultPostApplyVerification = async (args) => {
151
+ const workspace = detectWorkspaceAt(args.realRoot, nodeWorkspaceFs);
152
+ const steps = planDirectTargetedTests(workspace, args.appliedTestFiles, nodeWorkspaceFs);
153
+ if (steps.length === 0) {
154
+ return { summary: notRunVerificationSummary(), command: "none" };
155
+ }
156
+ const probe = probeNetworkIsolation(args.realRoot);
157
+ const report = await runVerification({ workspaceRoot: workspace.root, steps }, {
158
+ workspace,
159
+ signal: args.signal,
160
+ networkEnforcement: "enforce-or-fail-closed",
161
+ enforcedNetworkAvailable: probe.available,
162
+ });
163
+ return { summary: toSummary(report, probe), command: verificationCommand(workspace) };
164
+ };
165
+ // Preflight the same isolation control before any workspace write. If no targeted test would run, the
166
+ // route may apply and report `not-run` post-apply; otherwise an unenforced host fails closed before write.
167
+ export const defaultPostApplyVerificationPreflight = (args) => {
168
+ const workspace = detectWorkspaceAt(args.realRoot, nodeWorkspaceFs);
169
+ if (!requiresPostApplyVerificationPreflight(workspace, args.appliedTestFiles)) {
170
+ return Promise.resolve({ ok: true });
171
+ }
172
+ const probe = probeNetworkIsolation(args.realRoot);
173
+ if (probe.available) {
174
+ return Promise.resolve({ ok: true });
175
+ }
176
+ return Promise.resolve({ ok: false, summary: deniedVerificationSummary(), command: "none" });
177
+ };
@@ -0,0 +1,6 @@
1
+ import type { EditorTestGenerationWireResponse, EvidenceStore } from "@oscharko-dev/keiko-contracts";
2
+ import type { Redactor } from "../deps.js";
3
+ export declare const TEST_GENERATION_EVIDENCE_SCHEMA_VERSION: "1";
4
+ export declare function testGenerationEvidenceRunId(response: EditorTestGenerationWireResponse, emittedAtMs: number): string;
5
+ export declare function recordTestGenerationEvidence(store: EvidenceStore, redactor: Redactor, response: EditorTestGenerationWireResponse, emittedAtMs: number): string;
6
+ //# sourceMappingURL=testGenerationEvidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testGenerationEvidence.d.ts","sourceRoot":"","sources":["../../src/editor/testGenerationEvidence.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAGV,gCAAgC,EAChC,aAAa,EACd,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,uCAAuC,EAAG,GAAY,CAAC;AA+BpE,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,gCAAgC,EAC1C,WAAW,EAAE,MAAM,GAClB,MAAM,CAQR;AAaD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,gCAAgC,EAC1C,WAAW,EAAE,MAAM,GAClB,MAAM,CAmBR"}
@@ -0,0 +1,72 @@
1
+ // Content-free audit linkage for editor-driven test generation (Issue #1202, ADR-0042 D7). The
2
+ // persisted record carries ONLY the content-free outcome — status, assurance, the assured pre-filter
3
+ // funnel (counts + per-gate state), and the candidate file count plus model-provenance ids/hashes. It
4
+ // NEVER carries the candidate patch text (`newText`), a prompt, a workspace root, or a secret. It uses
5
+ // its own `editorTestGenerationSchemaVersion` key and omits `evidenceSchemaVersion`, so the grounded /
6
+ // QI evidence reader skips it. Persistence failure never fails the request (mirrors the coding-context
7
+ // and memory-audit handlers).
8
+ import { createHash } from "node:crypto";
9
+ import { CODING_CONTEXT_SOURCE_KINDS } from "@oscharko-dev/keiko-contracts";
10
+ export const TEST_GENERATION_EVIDENCE_SCHEMA_VERSION = "1";
11
+ // The content-free count of governed coding-context citations that contributed to the generated-test
12
+ // context, keyed by source class — repository search, Local Knowledge, memory, Quality Intelligence,
13
+ // connected/workflow/files context (Issue #1203 AC6). Counts only; never citation text or ids.
14
+ function countBySourceKind(context) {
15
+ const counts = Object.fromEntries(CODING_CONTEXT_SOURCE_KINDS.map((kind) => [kind, 0]));
16
+ for (const entry of context.entries) {
17
+ counts[entry.sourceKind] += 1;
18
+ }
19
+ return counts;
20
+ }
21
+ // The content-free evidence-source provenance for a response: the contributing source-class counts and
22
+ // the total citation count, present only when governed discovery ran (deferred/generated). AC6.
23
+ function contextSourceFields(response) {
24
+ if (response.context === undefined) {
25
+ return {};
26
+ }
27
+ return {
28
+ contextCitationCount: response.context.entries.length,
29
+ contextSourceKinds: countBySourceKind(response.context),
30
+ };
31
+ }
32
+ // Deterministic, content-free run id derived from status + emission time + candidate count.
33
+ export function testGenerationEvidenceRunId(response, emittedAtMs) {
34
+ const material = [
35
+ response.status,
36
+ String(emittedAtMs),
37
+ String(response.funnel.candidatesGenerated),
38
+ ].join("\n");
39
+ const digest = createHash("sha256").update(material).digest("hex").slice(0, 16);
40
+ return `editor-test-generation-${digest}`;
41
+ }
42
+ function provenanceFields(response) {
43
+ if (response.provenance === undefined) {
44
+ return {};
45
+ }
46
+ return {
47
+ modelId: response.provenance.modelId,
48
+ gatewayPolicyVersion: response.provenance.gatewayPolicyVersion,
49
+ promptHash: response.provenance.promptHash,
50
+ };
51
+ }
52
+ export function recordTestGenerationEvidence(store, redactor, response, emittedAtMs) {
53
+ const runId = testGenerationEvidenceRunId(response, emittedAtMs);
54
+ const manifest = {
55
+ editorTestGenerationSchemaVersion: TEST_GENERATION_EVIDENCE_SCHEMA_VERSION,
56
+ runId,
57
+ status: response.status,
58
+ emittedAtMs,
59
+ ...(response.assurance === undefined ? {} : { assurance: response.assurance }),
60
+ funnel: response.funnel,
61
+ fileCount: response.patch?.files.length ?? 0,
62
+ ...contextSourceFields(response),
63
+ ...provenanceFields(response),
64
+ };
65
+ try {
66
+ store.put(runId, JSON.stringify(redactor(manifest)));
67
+ }
68
+ catch {
69
+ // Audit persistence is best-effort; a write failure must never fail the user's request.
70
+ }
71
+ return runId;
72
+ }
@@ -0,0 +1,10 @@
1
+ import type { EditorTestGenerationWirePatch } from "@oscharko-dev/keiko-contracts";
2
+ /** Resolves the current workspace content of a file, or undefined when it does not exist / is unreadable. */
3
+ export type OriginalContentReader = (relativePath: string) => string | undefined;
4
+ /**
5
+ * Parses the proposed unified diff and projects it to the wire patch. Returns undefined when the diff
6
+ * is unparseable or yields no renderable file change, so the caller can degrade to `deferred`/`failed`
7
+ * rather than surface an empty patch.
8
+ */
9
+ export declare function translateDiffToWirePatch(diff: string, patchId: string, readOriginal: OriginalContentReader): EditorTestGenerationWirePatch | undefined;
10
+ //# sourceMappingURL=testGenerationPatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testGenerationPatch.d.ts","sourceRoot":"","sources":["../../src/editor/testGenerationPatch.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAIV,6BAA6B,EAG9B,MAAM,+BAA+B,CAAC;AAGvC,6GAA6G;AAC7G,MAAM,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AA6CjF;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,qBAAqB,GAClC,6BAA6B,GAAG,SAAS,CAc3C"}
@@ -0,0 +1,66 @@
1
+ // Pure translation of a unit-test workflow's proposed unified diff into the editor test-generation
2
+ // wire patch (Issue #1202, ADR-0042 D2/D7). The unified-diff parser and the hunk applier stay
3
+ // server-side (ADR-0042 D2: keiko-tools owns diff parsing; the browser tier only renders the resulting
4
+ // `{ range, newText }` edits). Pure over its inputs: the original-content lookup is injected so this is
5
+ // fully unit-testable without the filesystem.
6
+ import { computeFileContent, parseUnifiedDiff, PatchParseError } from "@oscharko-dev/keiko-tools";
7
+ import { isDenied } from "@oscharko-dev/keiko-workspace";
8
+ import { isValidScopePath } from "@oscharko-dev/keiko-contracts";
9
+ const CHANGE_KIND = {
10
+ create: "added",
11
+ modify: "modified",
12
+ delete: "deleted",
13
+ };
14
+ // The end position of a full-file span: the last line index and its UTF-16 length. Empty content maps
15
+ // to the zero position (an insertion at the start of the file).
16
+ function endPosition(content) {
17
+ if (content === "") {
18
+ return { line: 0, character: 0 };
19
+ }
20
+ const lines = content.split("\n");
21
+ const lastIndex = lines.length - 1;
22
+ return { line: lastIndex, character: (lines[lastIndex] ?? "").length };
23
+ }
24
+ // Translates one parsed file change into a single full-file-replacement edit (range = the original
25
+ // span; `newText` = the post-image). Returns undefined when the original is required but unavailable,
26
+ // or when applying the hunks conflicts — the candidate then omits that file rather than corrupting it.
27
+ function fileChangeToWire(change, readOriginal) {
28
+ if (!isValidScopePath(change.path, { mustBeRelative: true }) || isDenied(change.path)) {
29
+ return undefined;
30
+ }
31
+ const original = change.kind === "create" ? undefined : readOriginal(change.path);
32
+ if (change.kind !== "create" && original === undefined) {
33
+ return undefined;
34
+ }
35
+ const outcome = computeFileContent(change, original);
36
+ if (outcome.conflicts.length > 0) {
37
+ return undefined;
38
+ }
39
+ const end = original === undefined ? { line: 0, character: 0 } : endPosition(original);
40
+ const edit = {
41
+ range: { start: { line: 0, character: 0 }, end },
42
+ newText: outcome.content ?? "",
43
+ };
44
+ return { path: change.path, changeKind: CHANGE_KIND[change.kind], edits: [edit] };
45
+ }
46
+ /**
47
+ * Parses the proposed unified diff and projects it to the wire patch. Returns undefined when the diff
48
+ * is unparseable or yields no renderable file change, so the caller can degrade to `deferred`/`failed`
49
+ * rather than surface an empty patch.
50
+ */
51
+ export function translateDiffToWirePatch(diff, patchId, readOriginal) {
52
+ let parsed;
53
+ try {
54
+ parsed = parseUnifiedDiff(diff);
55
+ }
56
+ catch (error) {
57
+ if (error instanceof PatchParseError) {
58
+ return undefined;
59
+ }
60
+ throw error;
61
+ }
62
+ const files = parsed.files
63
+ .map((change) => fileChangeToWire(change, readOriginal))
64
+ .filter((change) => change !== undefined);
65
+ return files.length === 0 ? undefined : { patchId, files };
66
+ }
@@ -0,0 +1,21 @@
1
+ import type { EnvSource } from "@oscharko-dev/keiko-model-gateway";
2
+ import { type RouteContext, type RouteResult } from "../routes.js";
3
+ import type { UiHandlerDeps } from "../deps.js";
4
+ import { type TestGenerationRunner } from "./testGenerationRunner.js";
5
+ import { type AssuredPreFilterPort } from "./assuredPreFilterRunner.js";
6
+ /** Injectable options for the route (tests supply a fake runner, pre-filter, and a fixed clock). */
7
+ export interface EditorTestGenerationRouteOptions {
8
+ readonly runner?: TestGenerationRunner | undefined;
9
+ readonly preFilter?: AssuredPreFilterPort | undefined;
10
+ readonly now?: (() => number) | undefined;
11
+ }
12
+ /** Whether the test-generation feature is surfaced by deployment policy (Gate A; default off). */
13
+ export declare function isTestGenerationEnabledByPolicy(env: EnvSource | undefined): boolean;
14
+ /**
15
+ * Whether the route may produce a candidate (Gate B; default off). Requires the feature flag AND the
16
+ * explicit execution flag — the latter is the wave-2 enablement that only an enforced egress boundary
17
+ * justifies. No candidate (no model call) is produced until both are set.
18
+ */
19
+ export declare function isTestGenerationExecutionEnabledByPolicy(env: EnvSource | undefined): boolean;
20
+ export declare function handleEditorTestGeneration(ctx: RouteContext, deps: UiHandlerDeps, options?: EditorTestGenerationRouteOptions): Promise<RouteResult>;
21
+ //# sourceMappingURL=testGenerationRoutes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testGenerationRoutes.d.ts","sourceRoot":"","sources":["../../src/editor/testGenerationRoutes.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAa,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAMhD,OAAO,EAEL,KAAK,oBAAoB,EAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAoBjG,oGAAoG;AACpG,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;CAC3C;AAMD,kGAAkG;AAClG,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAEnF;AAED;;;;GAIG;AACH,wBAAgB,wCAAwC,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAI5F;AA2ND,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,WAAW,CAAC,CAuCtB"}
@@ -0,0 +1,254 @@
1
+ // BFF route for governed, editor-driven unit-test generation (Issue #1202, ADR-0042 D7).
2
+ //
3
+ // POST /api/editor/test-generation — assemble governed coding context for an editor target and,
4
+ // when enabled, produce a reviewable candidate test patch.
5
+ //
6
+ // Wave-2 surface, shipped switched OFF (ADR-0042 D7). Editor-driven test generation, execution, and
7
+ // verification execute untrusted, model-generated code through an assured pre-filter and are deferred
8
+ // behind a default-off feature flag enabled only once a deny-by-default network-egress boundary is
9
+ // enforced and proven by an automated test. The route therefore exposes two independent gates, both
10
+ // default-off:
11
+ //
12
+ // Gate A — KEIKO_EDITOR_TEST_GENERATION — surfaces the feature at all. Off (default) →
13
+ // `disabled`: no retrieval, no model, no execution. This is the v1 behaviour.
14
+ // Gate B — KEIKO_EDITOR_TEST_GENERATION_EXECUTION — permits producing a candidate (a governed model
15
+ // call) once the enforced egress boundary is available. Off (default) → `deferred`: the
16
+ // route still runs governed discovery (#1211, `purpose: "test-generation"`) for provenance
17
+ // but makes NO model call and produces no candidate. No v1 flow executes model-generated
18
+ // code (the assured pre-filter that EXECUTES candidates is shared with #1204/#1206 and stays
19
+ // `not-run`; a candidate this route surfaces can only ever be `unverified`).
20
+ //
21
+ // Containment reuses the files routes' realpath resolution; the response is redacted (D9) and
22
+ // content-free apart from the reviewable patch `newText`. The browser never reaches a model directly.
23
+ import { CODING_CONTEXT_BUDGETS, CODING_CONTEXT_SCHEMA_VERSION, EDITOR_TEST_GENERATION_SCHEMA_VERSION, isValidScopePath, notRunTestGenerationFunnel, parseEditorTestGenerationRequest, toCodingContextWirePack, } from "@oscharko-dev/keiko-contracts";
24
+ import { errorBody } from "../routes.js";
25
+ import { readJsonObject, resolveRoot, runFilesHandler } from "../files.js";
26
+ import { assembleCodingContext } from "./codingContext.js";
27
+ import { recordCodingContextEvidence } from "./codingContextEvidence.js";
28
+ import { clientAbortSignal, resolveOverlayPath } from "./languageRoutes.js";
29
+ import { recordTestGenerationEvidence } from "./testGenerationEvidence.js";
30
+ import { defaultTestGenerationRunner, } from "./testGenerationRunner.js";
31
+ import { defaultAssuredPreFilter } from "./assuredPreFilterRunner.js";
32
+ // The overlay buffer(s) may be up to the document-size cap; allow 64 KiB of JSON on top, doubled to
33
+ // accommodate a small changed-file set.
34
+ const MAX_TEST_GENERATION_BODY_BYTES = 2 * (1_048_576 + 64 * 1024);
35
+ const MAX_CHANGED_SET_DOCUMENTS = 32;
36
+ // Gate A — surfaces the feature at all (default OFF: this is a wave-2 feature shipped switched off).
37
+ const TEST_GENERATION_POLICY_ENV = "KEIKO_EDITOR_TEST_GENERATION";
38
+ // Gate B — permits producing a candidate once the enforced egress boundary is available (default OFF).
39
+ const TEST_GENERATION_EXECUTION_ENV = "KEIKO_EDITOR_TEST_GENERATION_EXECUTION";
40
+ const ENABLE_TOKENS = new Set(["1", "true", "on", "yes", "enabled"]);
41
+ // Content-free, static explanations (never a prompt, model output, or secret).
42
+ const DISABLED_REASON = "Editor-driven test generation is disabled in this build. It is a wave-2 feature gated behind an enforced network-egress boundary (ADR-0042 D7).";
43
+ const DEFERRED_REASON = "Editor-driven test generation is enabled, but the assured pre-filter requires an enforced, deny-by-default network-egress boundary that is not yet available. No tests were generated or executed.";
44
+ const FAILED_REASON = "Test generation could not be completed. The editor is still usable.";
45
+ function envFlagEnabled(value) {
46
+ return value !== undefined && ENABLE_TOKENS.has(value.trim().toLowerCase());
47
+ }
48
+ /** Whether the test-generation feature is surfaced by deployment policy (Gate A; default off). */
49
+ export function isTestGenerationEnabledByPolicy(env) {
50
+ return envFlagEnabled(env?.[TEST_GENERATION_POLICY_ENV]);
51
+ }
52
+ /**
53
+ * Whether the route may produce a candidate (Gate B; default off). Requires the feature flag AND the
54
+ * explicit execution flag — the latter is the wave-2 enablement that only an enforced egress boundary
55
+ * justifies. No candidate (no model call) is produced until both are set.
56
+ */
57
+ export function isTestGenerationExecutionEnabledByPolicy(env) {
58
+ return (isTestGenerationEnabledByPolicy(env) && envFlagEnabled(env?.[TEST_GENERATION_EXECUTION_ENV]));
59
+ }
60
+ function isRouteResult(value) {
61
+ return typeof value === "object" && value !== null && "status" in value && "body" in value;
62
+ }
63
+ function disabledResponse() {
64
+ return {
65
+ schemaVersion: EDITOR_TEST_GENERATION_SCHEMA_VERSION,
66
+ status: "disabled",
67
+ reason: DISABLED_REASON,
68
+ funnel: notRunTestGenerationFunnel(),
69
+ };
70
+ }
71
+ function deferredResponse(context) {
72
+ return {
73
+ schemaVersion: EDITOR_TEST_GENERATION_SCHEMA_VERSION,
74
+ status: "deferred",
75
+ reason: DEFERRED_REASON,
76
+ funnel: notRunTestGenerationFunnel(),
77
+ context,
78
+ };
79
+ }
80
+ function failedResponse(context) {
81
+ return {
82
+ schemaVersion: EDITOR_TEST_GENERATION_SCHEMA_VERSION,
83
+ status: "failed",
84
+ reason: FAILED_REASON,
85
+ funnel: notRunTestGenerationFunnel(),
86
+ context,
87
+ };
88
+ }
89
+ function unsupportedVerificationResponse(context, produced) {
90
+ return {
91
+ schemaVersion: EDITOR_TEST_GENERATION_SCHEMA_VERSION,
92
+ status: "generated",
93
+ assurance: "unverified",
94
+ funnel: produced.funnel,
95
+ context,
96
+ patch: produced.patch,
97
+ provenance: produced.provenance,
98
+ reason: produced.unsupportedVerificationReason ??
99
+ "The generated candidate cannot run through a supported assured pre-filter and is unverified review evidence only.",
100
+ };
101
+ }
102
+ // ─── Target coordinates ──────────────────────────────────────────────────────────────────────────
103
+ function targetDocumentPaths(target) {
104
+ return target.kind === "changed-file-set"
105
+ ? target.documents.map((document) => document.path)
106
+ : [target.document.path];
107
+ }
108
+ function anchorDocumentPath(target) {
109
+ if (target.kind === "changed-file-set") {
110
+ // The parser guarantees a non-empty document set; `?? ""` only satisfies the index check.
111
+ return target.documents[0]?.path ?? "";
112
+ }
113
+ return target.document.path;
114
+ }
115
+ function targetSymbolName(target) {
116
+ return target.kind === "symbol" ? target.symbol.name : undefined;
117
+ }
118
+ function changedFilePaths(target) {
119
+ return target.kind === "changed-file-set" ? target.documents.map((d) => d.path) : undefined;
120
+ }
121
+ // Validates the shape + containment of every document path the target references. Returns a 400/403
122
+ // RouteResult on the first failure, or undefined when every path is a contained, workspace-relative path.
123
+ function validateTargetContainment(realRoot, target) {
124
+ if (target.kind === "changed-file-set" && target.documents.length > MAX_CHANGED_SET_DOCUMENTS) {
125
+ return {
126
+ status: 400,
127
+ body: errorBody("INVALID_REQUEST", `target.documents must contain at most ${MAX_CHANGED_SET_DOCUMENTS.toString()} documents.`),
128
+ };
129
+ }
130
+ for (const path of targetDocumentPaths(target)) {
131
+ if (!isValidScopePath(path, { mustBeRelative: true })) {
132
+ return {
133
+ status: 400,
134
+ body: errorBody("INVALID_REQUEST", `target document path is not workspace-relative: ${path}`),
135
+ };
136
+ }
137
+ // Throws FilesError on escape/denied (handled by runFilesHandler).
138
+ resolveOverlayPath(realRoot, path);
139
+ }
140
+ return undefined;
141
+ }
142
+ // ─── Governed discovery (#1211) ────────────────────────────────────────────────────────────────────
143
+ function contextBudgetBytes(request) {
144
+ return Math.min(CODING_CONTEXT_BUDGETS["test-generation"].budgetBytes, Math.max(0, Math.trunc(request.contextBudgetBytes)));
145
+ }
146
+ function buildDiscoveryRequest(request) {
147
+ const target = request.target;
148
+ return {
149
+ schemaVersion: CODING_CONTEXT_SCHEMA_VERSION,
150
+ purpose: "test-generation",
151
+ documentPath: anchorDocumentPath(target),
152
+ symbol: targetSymbolName(target) ?? request.context?.symbol,
153
+ queryText: request.context?.queryText,
154
+ changedFiles: changedFilePaths(target) ?? request.context?.changedFiles,
155
+ capsuleId: request.context?.capsuleId,
156
+ capsuleSetId: request.context?.capsuleSetId,
157
+ };
158
+ }
159
+ // Runs the existing governed retrieval substrate (#1211) for related-file/test discovery — repository
160
+ // search plus, when a capsule/connector is selected and policy-allowed, Local Knowledge and memory —
161
+ // rather than a new editor-only collector. Records content-free evidence and returns the wire pack.
162
+ async function assembleDiscoveryContext(request, deps, realRoot, signal, nowMs, allowEmbeddingProviders) {
163
+ const pack = await assembleCodingContext(buildDiscoveryRequest(request), {
164
+ deps,
165
+ realRoot,
166
+ signal,
167
+ nowMs,
168
+ budgetBytes: contextBudgetBytes(request),
169
+ allowEmbeddingProviders,
170
+ });
171
+ const wire = toCodingContextWirePack(pack);
172
+ recordCodingContextEvidence(deps.evidenceStore, deps.redactor, wire, nowMs);
173
+ return { pack, wire };
174
+ }
175
+ // Produces the candidate outcome once the feature is enabled. Gate B off → `deferred` with NO model
176
+ // call. Gate B on (wave 2) → the injectable runner produces a candidate, which the assured pre-filter
177
+ // then EXECUTES in an enforced-egress disposable root: it is surfaced as `assured` only when it builds,
178
+ // passes, is stable, increases coverage, and kills enough mutants; otherwise it is `unverified`
179
+ // (untrusted evidence only — including the fail-closed path when egress cannot be enforced). The patch
180
+ // is always returned for review; assurance tells the editor whether it is apply-ready.
181
+ async function produceOutcome(ctx, discovery) {
182
+ if (!isTestGenerationExecutionEnabledByPolicy(ctx.deps.env)) {
183
+ return deferredResponse(discovery.wire);
184
+ }
185
+ const runner = ctx.options.runner ?? defaultTestGenerationRunner;
186
+ try {
187
+ const produced = await runner({
188
+ request: ctx.request,
189
+ deps: ctx.deps,
190
+ realRoot: ctx.realRoot,
191
+ signal: ctx.signal,
192
+ nowMs: ctx.nowMs,
193
+ contextPack: discovery.pack,
194
+ });
195
+ if (produced === undefined) {
196
+ return deferredResponse(discovery.wire);
197
+ }
198
+ if (produced.verification === undefined) {
199
+ return unsupportedVerificationResponse(discovery.wire, produced);
200
+ }
201
+ const preFilter = ctx.options.preFilter ?? defaultAssuredPreFilter;
202
+ const assured = await preFilter({
203
+ patch: produced.patch,
204
+ request: ctx.request,
205
+ realRoot: ctx.realRoot,
206
+ signal: ctx.signal,
207
+ verification: produced.verification,
208
+ });
209
+ return {
210
+ schemaVersion: EDITOR_TEST_GENERATION_SCHEMA_VERSION,
211
+ status: "generated",
212
+ assurance: assured.assurance,
213
+ funnel: assured.funnel,
214
+ context: discovery.wire,
215
+ patch: produced.patch,
216
+ provenance: produced.provenance,
217
+ applyableDiff: produced.proposedDiff,
218
+ ...(assured.rejectionReason === undefined ? {} : { reason: assured.rejectionReason }),
219
+ };
220
+ }
221
+ catch {
222
+ return failedResponse(discovery.wire);
223
+ }
224
+ }
225
+ export async function handleEditorTestGeneration(ctx, deps, options = {}) {
226
+ // Gate A — default OFF: the feature is switched off, so no request-body parsing, retrieval, model, or
227
+ // execution runs. This avoids serializing/parsing the full editor buffer for a disabled wave-2 feature.
228
+ if (!isTestGenerationEnabledByPolicy(deps.env)) {
229
+ return { status: 200, body: deps.redactor(disabledResponse()) };
230
+ }
231
+ const body = await readJsonObject(ctx.req, MAX_TEST_GENERATION_BODY_BYTES);
232
+ if (isRouteResult(body)) {
233
+ return body;
234
+ }
235
+ const parsed = parseEditorTestGenerationRequest(body);
236
+ if (!parsed.ok) {
237
+ return { status: 400, body: errorBody("INVALID_REQUEST", parsed.errors.join("; ")) };
238
+ }
239
+ const request = parsed.value;
240
+ return runFilesHandler(async () => {
241
+ const root = await resolveRoot(deps.store, request.root, deps.redactor);
242
+ const containment = validateTargetContainment(root.realRoot, request.target);
243
+ if (containment !== undefined) {
244
+ return containment;
245
+ }
246
+ const nowMs = (options.now ?? Date.now)();
247
+ const signal = clientAbortSignal(ctx);
248
+ const executionEnabled = isTestGenerationExecutionEnabledByPolicy(deps.env);
249
+ const discovery = await assembleDiscoveryContext(request, deps, root.realRoot, signal, nowMs, executionEnabled);
250
+ const outcome = await produceOutcome({ request, deps, realRoot: root.realRoot, signal, nowMs, options }, discovery);
251
+ recordTestGenerationEvidence(deps.evidenceStore, deps.redactor, outcome, nowMs);
252
+ return { status: 200, body: deps.redactor(outcome) };
253
+ });
254
+ }
@@ -0,0 +1,23 @@
1
+ import { type CodingContextPack, type EditorTestGenerationFunnel, type EditorTestGenerationWirePatch, type EditorTestGenerationWireProvenance, type EditorTestGenerationWireRequest } from "@oscharko-dev/keiko-contracts";
2
+ import { type UiHandlerDeps } from "../deps.js";
3
+ import type { AssuredVerificationKind } from "./assuredPreFilterRunner.js";
4
+ export interface TestGenerationRunnerArgs {
5
+ readonly request: EditorTestGenerationWireRequest;
6
+ readonly deps: UiHandlerDeps;
7
+ readonly realRoot: string;
8
+ readonly signal: AbortSignal;
9
+ readonly nowMs: number;
10
+ readonly contextPack: CodingContextPack;
11
+ }
12
+ export interface TestGenerationRunResult {
13
+ readonly patch: EditorTestGenerationWirePatch;
14
+ readonly provenance: EditorTestGenerationWireProvenance;
15
+ readonly funnel: EditorTestGenerationFunnel;
16
+ readonly verification?: AssuredVerificationKind | undefined;
17
+ readonly unsupportedVerificationReason?: string | undefined;
18
+ readonly proposedDiff: string;
19
+ }
20
+ /** Injectable candidate producer. Returns undefined when no candidate could be produced (→ deferred). */
21
+ export type TestGenerationRunner = (args: TestGenerationRunnerArgs) => Promise<TestGenerationRunResult | undefined>;
22
+ export declare const defaultTestGenerationRunner: TestGenerationRunner;
23
+ //# sourceMappingURL=testGenerationRunner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testGenerationRunner.d.ts","sourceRoot":"","sources":["../../src/editor/testGenerationRunner.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,+BAA+B,EAErC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAK3E,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,+BAA+B,CAAC;IAClD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAGvB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;CACzC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,6BAA6B,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,kCAAkC,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAK5C,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,6BAA6B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAG5D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,yGAAyG;AACzG,MAAM,MAAM,oBAAoB,GAAG,CACjC,IAAI,EAAE,wBAAwB,KAC3B,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;AAuElD,eAAO,MAAM,2BAA2B,EAAE,oBA8CzC,CAAC"}