@oscharko-dev/keiko 0.2.0-beta.8 → 0.2.0-beta.9

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 (241) hide show
  1. package/dist/ui/csp-hashes.json +14 -14
  2. package/dist/ui/static/404.html +1 -1
  3. package/dist/ui/static/__next.__PAGE__.txt +2 -2
  4. package/dist/ui/static/__next._full.txt +3 -3
  5. package/dist/ui/static/__next._head.txt +1 -1
  6. package/dist/ui/static/__next._index.txt +2 -2
  7. package/dist/ui/static/__next._tree.txt +2 -2
  8. package/dist/ui/static/_next/static/chunks/06-q1ntr51v8r.js +1 -0
  9. package/dist/ui/static/_next/static/chunks/0y9qlvrxsyign.js +109 -0
  10. package/dist/ui/static/_next/static/chunks/1h0v66-p9cx19.css +1 -0
  11. package/dist/ui/static/_next/static/chunks/3ewv4mguqzooj.js +1 -0
  12. package/dist/ui/static/_not-found/__next._full.txt +2 -2
  13. package/dist/ui/static/_not-found/__next._head.txt +1 -1
  14. package/dist/ui/static/_not-found/__next._index.txt +2 -2
  15. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  16. package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
  17. package/dist/ui/static/_not-found/__next._tree.txt +2 -2
  18. package/dist/ui/static/_not-found.html +1 -1
  19. package/dist/ui/static/_not-found.txt +2 -2
  20. package/dist/ui/static/index.html +1 -1
  21. package/dist/ui/static/index.txt +3 -3
  22. package/dist/ui/static/launch/__next._full.txt +3 -3
  23. package/dist/ui/static/launch/__next._head.txt +1 -1
  24. package/dist/ui/static/launch/__next._index.txt +2 -2
  25. package/dist/ui/static/launch/__next._tree.txt +2 -2
  26. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +2 -2
  27. package/dist/ui/static/launch/__next.launch.txt +1 -1
  28. package/dist/ui/static/launch.html +1 -1
  29. package/dist/ui/static/launch.txt +3 -3
  30. package/dist/ui/static/local-knowledge/__next._full.txt +3 -3
  31. package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
  32. package/dist/ui/static/local-knowledge/__next._index.txt +2 -2
  33. package/dist/ui/static/local-knowledge/__next._tree.txt +2 -2
  34. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +2 -2
  35. package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
  36. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +3 -3
  37. package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
  38. package/dist/ui/static/local-knowledge/capsule/__next._index.txt +2 -2
  39. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +2 -2
  40. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +2 -2
  41. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +1 -1
  42. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
  43. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  44. package/dist/ui/static/local-knowledge/capsule.txt +3 -3
  45. package/dist/ui/static/local-knowledge.html +1 -1
  46. package/dist/ui/static/local-knowledge.txt +3 -3
  47. package/dist/ui/static/memoriaviva/__next._full.txt +2 -2
  48. package/dist/ui/static/memoriaviva/__next._head.txt +1 -1
  49. package/dist/ui/static/memoriaviva/__next._index.txt +2 -2
  50. package/dist/ui/static/memoriaviva/__next._tree.txt +2 -2
  51. package/dist/ui/static/memoriaviva/__next.memoriaviva.__PAGE__.txt +1 -1
  52. package/dist/ui/static/memoriaviva/__next.memoriaviva.txt +1 -1
  53. package/dist/ui/static/memoriaviva/consolidation/__next._full.txt +2 -2
  54. package/dist/ui/static/memoriaviva/consolidation/__next._head.txt +1 -1
  55. package/dist/ui/static/memoriaviva/consolidation/__next._index.txt +2 -2
  56. package/dist/ui/static/memoriaviva/consolidation/__next._tree.txt +2 -2
  57. package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.consolidation.__PAGE__.txt +1 -1
  58. package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.consolidation.txt +1 -1
  59. package/dist/ui/static/memoriaviva/consolidation/__next.memoriaviva.txt +1 -1
  60. package/dist/ui/static/memoriaviva/consolidation.html +1 -1
  61. package/dist/ui/static/memoriaviva/consolidation.txt +2 -2
  62. package/dist/ui/static/memoriaviva/detail/__next._full.txt +2 -2
  63. package/dist/ui/static/memoriaviva/detail/__next._head.txt +1 -1
  64. package/dist/ui/static/memoriaviva/detail/__next._index.txt +2 -2
  65. package/dist/ui/static/memoriaviva/detail/__next._tree.txt +2 -2
  66. package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.detail.__PAGE__.txt +1 -1
  67. package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.detail.txt +1 -1
  68. package/dist/ui/static/memoriaviva/detail/__next.memoriaviva.txt +1 -1
  69. package/dist/ui/static/memoriaviva/detail.html +1 -1
  70. package/dist/ui/static/memoriaviva/detail.txt +2 -2
  71. package/dist/ui/static/memoriaviva/review-queue/__next._full.txt +2 -2
  72. package/dist/ui/static/memoriaviva/review-queue/__next._head.txt +1 -1
  73. package/dist/ui/static/memoriaviva/review-queue/__next._index.txt +2 -2
  74. package/dist/ui/static/memoriaviva/review-queue/__next._tree.txt +2 -2
  75. package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.review-queue.__PAGE__.txt +1 -1
  76. package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.review-queue.txt +1 -1
  77. package/dist/ui/static/memoriaviva/review-queue/__next.memoriaviva.txt +1 -1
  78. package/dist/ui/static/memoriaviva/review-queue.html +1 -1
  79. package/dist/ui/static/memoriaviva/review-queue.txt +2 -2
  80. package/dist/ui/static/memoriaviva.html +1 -1
  81. package/dist/ui/static/memoriaviva.txt +2 -2
  82. package/node_modules/@oscharko-dev/keiko-cli/dist/.tsbuildinfo +1 -1
  83. package/node_modules/@oscharko-dev/keiko-cli/package.json +1 -1
  84. package/node_modules/@oscharko-dev/keiko-contracts/dist/.tsbuildinfo +1 -1
  85. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +2 -2
  86. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts.map +1 -1
  87. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +1 -1
  88. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/bffWire.d.ts +36 -4
  89. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/bffWire.d.ts.map +1 -1
  90. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/index.d.ts +1 -1
  91. package/node_modules/@oscharko-dev/keiko-contracts/dist/qualityIntelligence/index.d.ts.map +1 -1
  92. package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
  93. package/node_modules/@oscharko-dev/keiko-evaluations/dist/.tsbuildinfo +1 -1
  94. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +1 -1
  95. package/node_modules/@oscharko-dev/keiko-evidence/dist/.tsbuildinfo +1 -1
  96. package/node_modules/@oscharko-dev/keiko-evidence/dist/index.d.ts +1 -1
  97. package/node_modules/@oscharko-dev/keiko-evidence/dist/index.d.ts.map +1 -1
  98. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/schema.d.ts +15 -0
  99. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/schema.d.ts.map +1 -1
  100. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/schema.js +13 -3
  101. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/store.d.ts +8 -0
  102. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/store.d.ts.map +1 -1
  103. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/figmaSnapshot/store.js +30 -2
  104. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/index.d.ts +2 -2
  105. package/node_modules/@oscharko-dev/keiko-evidence/dist/qualityIntelligence/index.d.ts.map +1 -1
  106. package/node_modules/@oscharko-dev/keiko-evidence/package.json +1 -1
  107. package/node_modules/@oscharko-dev/keiko-harness/dist/.tsbuildinfo +1 -1
  108. package/node_modules/@oscharko-dev/keiko-harness/package.json +1 -1
  109. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/.tsbuildinfo +1 -1
  110. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +1 -1
  111. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +1 -1
  112. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +1 -1
  113. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +1 -1
  114. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +1 -1
  115. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/.tsbuildinfo +1 -1
  116. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +1 -1
  117. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/.tsbuildinfo +1 -1
  118. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +1 -1
  119. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/.tsbuildinfo +1 -1
  120. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/figma/screenIrTestBaseline.d.ts +8 -0
  121. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/figma/screenIrTestBaseline.d.ts.map +1 -1
  122. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/figma/screenIrTestBaseline.js +9 -5
  123. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testDesignModel.d.ts +6 -0
  124. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testDesignModel.d.ts.map +1 -1
  125. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testDesignModel.js +116 -21
  126. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testQualityRubric.d.ts +6 -0
  127. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testQualityRubric.d.ts.map +1 -1
  128. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/testQualityRubric.js +12 -0
  129. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/validation.d.ts.map +1 -1
  130. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/domain/validation.js +8 -7
  131. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/parseGeneratedCandidates.d.ts.map +1 -1
  132. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/parseGeneratedCandidates.js +29 -7
  133. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/prompt.d.ts.map +1 -1
  134. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/generation/prompt.js +61 -24
  135. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/index.d.ts +1 -1
  136. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/index.d.ts.map +1 -1
  137. package/node_modules/@oscharko-dev/keiko-quality-intelligence/dist/index.js +1 -1
  138. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +1 -1
  139. package/node_modules/@oscharko-dev/keiko-sdk/dist/.tsbuildinfo +1 -1
  140. package/node_modules/@oscharko-dev/keiko-sdk/package.json +1 -1
  141. package/node_modules/@oscharko-dev/keiko-security/dist/.tsbuildinfo +1 -1
  142. package/node_modules/@oscharko-dev/keiko-security/package.json +1 -1
  143. package/node_modules/@oscharko-dev/keiko-server/dist/.tsbuildinfo +1 -1
  144. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-prompt.d.ts.map +1 -1
  145. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-prompt.js +2 -0
  146. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
  147. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +30 -6
  148. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts +1 -0
  149. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts.map +1 -1
  150. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.js +410 -18
  151. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.d.ts.map +1 -1
  152. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.js +1 -0
  153. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts.map +1 -1
  154. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.js +7 -5
  155. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.js +4 -3
  156. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts +1 -0
  157. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
  158. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +4 -1
  159. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts +1 -0
  160. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts.map +1 -1
  161. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.js +8 -3
  162. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaConnector.d.ts.map +1 -1
  163. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaConnector.js +9 -4
  164. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts +6 -5
  165. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaScopedPagination.d.ts.map +1 -1
  166. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaScopedPagination.js +10 -9
  167. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts +2 -1
  168. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotBuilder.d.ts.map +1 -1
  169. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotBuilder.js +62 -26
  170. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts +2 -0
  171. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotHash.d.ts.map +1 -1
  172. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotHash.js +6 -3
  173. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts +14 -0
  174. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/figmaSnapshotTypes.d.ts.map +1 -1
  175. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts +18 -0
  176. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts.map +1 -1
  177. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.js +159 -6
  178. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts +19 -0
  179. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotScreenIds.d.ts.map +1 -0
  180. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotScreenIds.js +75 -0
  181. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.d.ts.map +1 -1
  182. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.js +13 -12
  183. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelSelection.d.ts +6 -6
  184. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelSelection.d.ts.map +1 -1
  185. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelSelection.js +12 -7
  186. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.d.ts.map +1 -1
  187. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.js +34 -3
  188. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runIngestion.d.ts +4 -2
  189. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runIngestion.d.ts.map +1 -1
  190. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runIngestion.js +222 -35
  191. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.d.ts +7 -0
  192. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.d.ts.map +1 -1
  193. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.js +68 -16
  194. package/node_modules/@oscharko-dev/keiko-server/dist/routes.d.ts.map +1 -1
  195. package/node_modules/@oscharko-dev/keiko-server/dist/routes.js +6 -1
  196. package/node_modules/@oscharko-dev/keiko-server/package.json +1 -1
  197. package/node_modules/@oscharko-dev/keiko-tools/dist/.tsbuildinfo +1 -1
  198. package/node_modules/@oscharko-dev/keiko-tools/package.json +1 -1
  199. package/node_modules/@oscharko-dev/keiko-verification/dist/.tsbuildinfo +1 -1
  200. package/node_modules/@oscharko-dev/keiko-verification/package.json +1 -1
  201. package/node_modules/@oscharko-dev/keiko-workflows/dist/.tsbuildinfo +1 -1
  202. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.d.ts.map +1 -1
  203. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.js +45 -0
  204. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts +2 -0
  205. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts.map +1 -1
  206. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.js +1 -0
  207. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts +8 -0
  208. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts.map +1 -0
  209. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.js +140 -0
  210. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts +2 -0
  211. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts.map +1 -1
  212. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.js +21 -5
  213. package/node_modules/@oscharko-dev/keiko-workflows/dist/qualityIntelligence/modelRoutedTestDesign.d.ts.map +1 -1
  214. package/node_modules/@oscharko-dev/keiko-workflows/dist/qualityIntelligence/modelRoutedTestDesign.js +86 -40
  215. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.d.ts.map +1 -1
  216. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.js +9 -0
  217. package/node_modules/@oscharko-dev/keiko-workflows/package.json +1 -1
  218. package/node_modules/@oscharko-dev/keiko-workspace/dist/.tsbuildinfo +1 -1
  219. package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts +1 -0
  220. package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts.map +1 -1
  221. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts +3 -0
  222. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts.map +1 -1
  223. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.js +23 -6
  224. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts +1 -1
  225. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts.map +1 -1
  226. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.js +24 -3
  227. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts +34 -0
  228. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts.map +1 -0
  229. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.js +342 -0
  230. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts +6 -1
  231. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts.map +1 -1
  232. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.js +57 -9
  233. package/node_modules/@oscharko-dev/keiko-workspace/package.json +1 -1
  234. package/package.json +1 -1
  235. package/dist/ui/static/_next/static/chunks/0i3jzgrj42so8.css +0 -1
  236. package/dist/ui/static/_next/static/chunks/1ru_021szp0u7.js +0 -1
  237. package/dist/ui/static/_next/static/chunks/1t7vb5d9ed2e7.js +0 -1
  238. package/dist/ui/static/_next/static/chunks/23o2c6pyjq92z.js +0 -109
  239. /package/dist/ui/static/_next/static/{Ppze_8n_i3yc1FS_Qdj0I → a5sUbXeTgQ9A2LRTMu_Q_}/_buildManifest.js +0 -0
  240. /package/dist/ui/static/_next/static/{Ppze_8n_i3yc1FS_Qdj0I → a5sUbXeTgQ9A2LRTMu_Q_}/_clientMiddlewareManifest.js +0 -0
  241. /package/dist/ui/static/_next/static/{Ppze_8n_i3yc1FS_Qdj0I → a5sUbXeTgQ9A2LRTMu_Q_}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76055,66702,e=>{"use strict";let t,n,s={maxConnectedSources:16,maxLocalKnowledgeSources:16,maxPromptReferences:8,maxExcerptChars:900,referenceBudget:10,hybridMaxCandidates:24,hybridMaxExcerptBytes:131072};s.maxConnectedSources,s.maxLocalKnowledgeSources,e.s(["DEFAULT_GROUNDING_LIMITS",0,s],66702);class l extends Error{code;status;constructor(e,t,n){super(t),this.code=e,this.status=n,this.name="ApiError"}}async function a(e,t){let n=(t?.method??"GET").toUpperCase(),s=await fetch(e,{...t,headers:{Accept:"application/json",...t?.body!==void 0?{"Content-Type":"application/json"}:{},..."GET"===n||"HEAD"===n?{}:{"X-Keiko-CSRF":"1"},...t?.headers??{}}});if(!s.ok){let e="INTERNAL",t=`HTTP ${s.status.toString()}`;try{let n=await s.json();e=n.error.code,t=n.error.message}catch{}throw new l(e,t,s.status)}if(204!==s.status)return s.json()}async function r(){return a("/api/health")}async function i(){let e=await a("/api/config");return{config:e.config,configPresent:e.configPresent,effectiveGroundingLimits:e.effectiveGroundingLimits??s}}async function o(){return t??=a("/api/models").catch(e=>{throw t=void 0,e})}async function c(e){let n=await a("/api/gateway/setup",{method:"POST",body:JSON.stringify(e)});return t=void 0,n}async function d(e){return a("/api/runs",{method:"POST",body:JSON.stringify(e)})}async function u(e){return a("/api/chats/runs",{method:"POST",body:JSON.stringify(e)})}async function h(e){return a("/api/chats/messages/grounded/handoff",{method:"POST",body:JSON.stringify(e)})}async function p(e){return a(`/api/runs/${encodeURIComponent(e)}/cancel`,{method:"POST",body:JSON.stringify({confirm:!0})})}async function f(e){return a(`/api/runs/${encodeURIComponent(e)}`)}async function x(e){return a(`/api/runs/${encodeURIComponent(e)}/apply`,{method:"POST",body:JSON.stringify({confirm:!0})})}async function m(e){return a(`/api/evidence/${encodeURIComponent(e)}`)}async function g(){return n??=a("/api/projects").finally(()=>{n=void 0})}async function j(e){return a("/api/projects",{method:"POST",body:JSON.stringify(e)})}async function y(e){return a(`/api/chats?projectPath=${encodeURIComponent(e)}`)}async function k(e,t){return a(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function b(e,t){return a(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({connectedScopes:t})})}async function v(e,t){return a(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({localKnowledgeScopes:t})})}async function N(e,t){let n=new URLSearchParams;return n.set("chatId",e),n.set("projectPath",t),a(`/api/chats/messages?${n.toString()}`)}async function S(e={}){return a("/api/desktop/chats",{method:"POST",body:JSON.stringify(e)})}async function M(e,t){return a("/api/desktop/chat",{method:"POST",body:JSON.stringify(e),signal:t??null})}class C extends Error{code;constructor(e,t){super(t),this.code=e,this.name="StreamingUnavailableError"}}function w(e,t,n){let s=t;for(let t of e){let e=t.trimEnd();if(e.startsWith("event:"))s=e.slice(6).trim();else if(e.startsWith("data:")){let t,l=e.slice(5).trim();try{t=JSON.parse(l)}catch{continue}!function(e,t,n){switch(e){case"token":{let e=function(e){if("object"==typeof e&&null!==e&&"text"in e&&"string"==typeof e.text)return e}(t);void 0!==e&&n.onToken(e.text);break}case"done":{let e=function(e){if("object"==typeof e&&null!==e&&"chat"in e&&"messages"in e)return e}(t);void 0!==e&&n.onDone(e);break}case"error":{let e=function(e){if("object"==typeof e&&null!==e&&"code"in e&&"message"in e&&"string"==typeof e.code&&"string"==typeof e.message)return e}(t);void 0!==e&&n.onError(e);break}case"cancelled":n.onCancelled()}}(s,t,n),s=void 0}else""===e&&(s=void 0)}return s}async function A(e,t,n){let s,l=e.getReader(),a=new TextDecoder,r="",i=!1;try{for(;!t.aborted;){let e=await l.read();if(e.done){i=!0;break}let t=(r+=a.decode(e.value,{stream:!0})).split("\n");r=t.pop()??"",s=w(t,s,n)}i&&""!==r&&w([r],s,n)}finally{l.releaseLock()}}async function E(e,t,n){let s=await fetch("/api/desktop/chat/stream",{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json","X-Keiko-CSRF":"1"},body:JSON.stringify(e),signal:t});if(!(s.headers.get("content-type")??"").includes("text/event-stream")){let e="STREAMING_UNSUPPORTED",t=`HTTP ${s.status.toString()}`;try{let n=await s.json();e=n.error?.code??e,t=n.error?.message??t}catch{}throw new C(e,t)}if(null===s.body)throw new C("STREAMING_UNSUPPORTED","Response body was null.");await A(s.body,t,n)}async function L(e,t){let n=new URLSearchParams;return n.set("root",e),void 0!==t&&t.length>0&&n.set("path",t),a(`/api/files/directories?${n.toString()}`)}async function $(e,t=""){let n=new URLSearchParams;return n.set("root",e),t.length>0&&n.set("path",t),a(`/api/files/tree?${n.toString()}`)}async function T(e,t){let n=new URLSearchParams;return n.set("root",e),n.set("path",t),a(`/api/files/preview?${n.toString()}`)}async function D(e,t){let n=new URLSearchParams;return n.set("root",e),n.set("path",t),a(`/api/files/content?${n.toString()}`)}async function R(e){return a("/api/files/content",{method:"PATCH",body:JSON.stringify(e)})}async function O(e,t){return a("/api/chats/messages/grounded",{method:"POST",body:JSON.stringify(e),signal:t??null})}e.s(["ApiError",0,l,"StreamingUnavailableError",0,C,"applyRun",0,x,"askGrounded",0,O,"cancelRun",0,p,"createDesktopChat",0,S,"createProject",0,j,"fetchChatMessages",0,N,"fetchChats",0,y,"fetchConfig",0,i,"fetchEvidenceManifest",0,m,"fetchFilesContent",0,D,"fetchFilesDirectories",0,L,"fetchFilesPreview",0,T,"fetchFilesTree",0,$,"fetchHealth",0,r,"fetchModels",0,o,"fetchProjects",0,g,"fetchRunReport",0,f,"saveFilesContent",0,R,"sendDesktopChat",0,M,"sendDesktopChatStream",0,E,"setupGateway",0,c,"startChatRun",0,u,"startGroundedWorkflowHandoff",0,h,"startRun",0,d,"updateChat",0,k,"updateChatConnectedScopes",0,b,"updateChatLocalKnowledgeScopes",0,v],76055)},17161,e=>{"use strict";var t=e.i(43476);function n({size:e=18,sw:s=1.6,vb:l=24,fill:a,style:r,children:i,d:o}){let c=void 0!==a;return(0,t.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${String(l)} ${String(l)}`,fill:c?a:"none",stroke:c?"none":"currentColor",strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round",style:r,"aria-hidden":"true",children:void 0!==o?(0,t.jsx)("path",{d:o}):i})}e.s(["Icons",0,{newChat:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M4 6 H12.5"}),(0,t.jsx)("path",{d:"M4 9.5 H9.5"}),(0,t.jsx)("path",{d:"M14.4 13.6 l4-4 a1.6 1.6 0 0 1 2.3 2.3 l-6.2 6.2 -3 .7 .7 -3 z"})]}),search:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M12.25 4.76 A6 6 0 1 1 8.75 4.76"}),(0,t.jsx)("path",{d:"M14.7 14.7 L20 20"})]}),plugins:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,t.jsx)("rect",{x:"13.5",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,t.jsx)("rect",{x:"4",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"}),(0,t.jsx)("rect",{x:"13.5",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"})]}),automations:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,t.jsx)("path",{d:"M12 7.5V12l3 2"})]}),mobile:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"7",y:"3",width:"10",height:"18",rx:"2.5"}),(0,t.jsx)("path",{d:"M11 18h2"})]}),folder:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M3.6 7.4 V6.3 a1.5 1.5 0 0 1 1.5-1.5 H8 a1.5 1.5 0 0 1 1.1 .48 L10.3 7.4"}),(0,t.jsx)("path",{d:"M13.50 7.40 H18.00 A2.4 2.4 0 0 1 20.40 9.80 V16.00 A2.4 2.4 0 0 1 18.00 18.40 H6.00 A2.4 2.4 0 0 1 3.60 16.00 V9.80 A2.4 2.4 0 0 1 6.00 7.40 H10.50"})]}),settings:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.25 9.83 A2.5 2.5 0 1 1 10.75 9.83"}),(0,t.jsx)("path",{d:"M16.00 12.00 L18.60 12.00 M14.83 14.83 L16.67 16.67 M12.00 16.00 L12.00 18.60 M9.17 14.83 L7.33 16.67 M8.00 12.00 L5.40 12.00 M9.17 9.17 L7.33 7.33 M12.00 8.00 L12.00 5.40 M14.83 9.17 L16.67 7.33"})]}),files:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,t.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),browser:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"8.5"}),(0,t.jsx)("path",{d:"M3.5 12h17M12 3.5c2.3 2.3 2.3 14.7 0 17M12 3.5c-2.3 2.3-2.3 14.7 0 17"})]}),review:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,t.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"})]}),terminal:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.70 5.00 H17.50 A2.5 2.5 0 0 1 20.00 7.50 V16.50 A2.5 2.5 0 0 1 17.50 19.00 H6.50 A2.5 2.5 0 0 1 4.00 16.50 V7.50 A2.5 2.5 0 0 1 6.50 5.00 H10.30"}),(0,t.jsx)("path",{d:"M8 9.6 L11 12.6 L8 15.6"}),(0,t.jsx)("path",{d:"M12.8 15.6 H16.4"})]}),agents:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"5",y:"7",width:"14",height:"11",rx:"3"}),(0,t.jsx)("path",{d:"M12 7V4M9 12h.01M15 12h.01M2.5 12.5v2M21.5 12.5v2"})]}),git:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,t.jsx)("circle",{cx:"6",cy:"18",r:"2.5"}),(0,t.jsx)("circle",{cx:"17",cy:"9",r:"2.5"}),(0,t.jsx)("path",{d:"M6 8.5v7M17 11.5c0 3-3 3.5-6 4"})]}),plus:e=>(0,t.jsx)(n,{...e,d:"M12 5v14M5 12h14"}),chevron:e=>(0,t.jsx)(n,{...e,d:"M6 9l6 6 6-6"}),chevronR:e=>(0,t.jsx)(n,{...e,d:"M9 6l6 6-6 6"}),mic:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M12 3.2 a3 3 0 0 1 3 3 V11 a3 3 0 0 1 -6 0 V6.2 a3 3 0 0 1 2 -2.8"}),(0,t.jsx)("path",{d:"M5.5 11.5 a6.5 6.5 0 0 0 13 0 M12 18 v3"})]}),arrowUp:e=>(0,t.jsx)(n,{...e,d:"M12 19V5M6 11l6-6 6 6"}),spark:e=>(0,t.jsx)(n,{...e,d:"M13.2 3.6 L19 10 l-5.2 1.4 L12 17 l-1.8 -5.6 L5 10 l5.2 -1.4 z"}),pin:e=>(0,t.jsx)(n,{...e,d:"M9 3h6l-1 5 3 3-5 1-1 8-1-8-5-1 3-3z"}),brain:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"}),(0,t.jsx)("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"})]}),archive:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.20 5.00 H19.50 A1 1 0 0 1 20.50 6.00 V8.00 A1 1 0 0 1 19.50 9.00 H4.50 A1 1 0 0 1 3.50 8.00 V6.00 A1 1 0 0 1 4.50 5.00 H10.80"}),(0,t.jsx)("path",{d:"M5 9 v8 a2 2 0 0 0 2 2 h10 a2 2 0 0 0 2-2 V9"}),(0,t.jsx)("path",{d:"M10 13 h4"})]}),sidebar:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,t.jsx)("path",{d:"M9.5 5 V19"})]}),minimize:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M7 14 H10.4"}),(0,t.jsx)("path",{d:"M13.6 14 H17"})]}),expand:e=>(0,t.jsx)(n,{...e,d:"M4 9V4h5M20 15v5h-5M20 9V4h-5M4 15v5h5"}),back:e=>(0,t.jsx)(n,{...e,d:"M15 6l-6 6 6 6"}),fwd:e=>(0,t.jsx)(n,{...e,d:"M9 6l6 6-6 6"}),drag:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"9",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"9",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"9",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"})]}),close:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M7 7 L10.4 10.4"}),(0,t.jsx)("path",{d:"M17 7 L13.6 10.4"}),(0,t.jsx)("path",{d:"M7 17 L10.4 13.6"}),(0,t.jsx)("path",{d:"M17 17 L13.6 13.6"})]}),dots:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"6",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"18",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"})]}),check:e=>(0,t.jsx)(n,{...e,d:"M5 12.5l4.5 4.5L19 6.5"}),reset:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M4 12a8 8 0 1 1 2.3 5.6"}),(0,t.jsx)("path",{d:"M4 20v-4h4"})]}),file:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,t.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),diff:e=>(0,t.jsx)(n,{...e,d:"M12 4v6M9 7h6M5 17h14"}),branch:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M7.63 4.97 A2.3 2.3 0 1 1 4.37 4.97"}),(0,t.jsx)("circle",{cx:"6",cy:"17.4",r:"2.3"}),(0,t.jsx)("circle",{cx:"17.4",cy:"8.6",r:"2.3"}),(0,t.jsx)("path",{d:"M6 8.9 V15.1"}),(0,t.jsx)("path",{d:"M17.4 10.9 c0 4 -4 3.7 -7 4.7"})]}),cube:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9z"}),(0,t.jsx)("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5"})]}),maximize:e=>(0,t.jsx)(n,{...e,d:"M13.50 7.00 H15.00 A2 2 0 0 1 17.00 9.00 V15.00 A2 2 0 0 1 15.00 17.00 H9.00 A2 2 0 0 1 7.00 15.00 V9.00 A2 2 0 0 1 9.00 7.00 H10.50"}),restore:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9 9 V8 a2 2 0 0 1 2 -2 h6 a2 2 0 0 1 2 2 v6 a2 2 0 0 1 -2 2 h-1"}),(0,t.jsx)("path",{d:"M11.50 9.00 H13.00 A2 2 0 0 1 15.00 11.00 V17.00 A2 2 0 0 1 13.00 19.00 H7.00 A2 2 0 0 1 5.00 17.00 V11.00 A2 2 0 0 1 7.00 9.00 H8.50"})]}),split:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,t.jsx)("path",{d:"M12 5 V19"})]}),tile:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M8.10 4.50 H9.00 A1.5 1.5 0 0 1 10.50 6.00 V10.00 A1.5 1.5 0 0 1 9.00 11.50 H5.00 A1.5 1.5 0 0 1 3.50 10.00 V6.00 A1.5 1.5 0 0 1 5.00 4.50 H5.90"}),(0,t.jsx)("path",{d:"M15.00 4.50 H19.00 A1.5 1.5 0 0 1 20.50 6.00 V10.00 A1.5 1.5 0 0 1 19.00 11.50 H15.00 A1.5 1.5 0 0 1 13.50 10.00 V6.00 A1.5 1.5 0 0 1 15.00 4.50 Z"}),(0,t.jsx)("path",{d:"M5.00 13.50 H9.00 A1.5 1.5 0 0 1 10.50 15.00 V19.00 A1.5 1.5 0 0 1 9.00 20.50 H5.00 A1.5 1.5 0 0 1 3.50 19.00 V15.00 A1.5 1.5 0 0 1 5.00 13.50 Z"}),(0,t.jsx)("path",{d:"M15.00 13.50 H19.00 A1.5 1.5 0 0 1 20.50 15.00 V19.00 A1.5 1.5 0 0 1 19.00 20.50 H15.00 A1.5 1.5 0 0 1 13.50 19.00 V15.00 A1.5 1.5 0 0 1 15.00 13.50 Z"})]}),cascade:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"12",height:"12",rx:"2"}),(0,t.jsx)("path",{d:"M20 8v10a2 2 0 0 1-2 2H8"})]}),editor:e=>(0,t.jsx)(n,{...e,children:(0,t.jsx)("path",{d:"M8 9l-3 3 3 3M16 9l3 3-3 3M13.5 6l-3 12"})}),gear:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"2.6"}),(0,t.jsx)("path",{d:"M12 3.5v2M12 18.5v2M20.5 12h-2M5.5 12h-2M18 6l-1.4 1.4M7.4 16.6 6 18M18 18l-1.4-1.4M7.4 7.4 6 6"})]}),panelRight:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,t.jsx)("path",{d:"M14.5 5 V19"})]}),layers:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.4 4.55 L19.6 8 L12 12.2 L4.4 8 L10.6 4.55"}),(0,t.jsx)("path",{d:"M4.4 12 L12 16.2 L19.6 12"}),(0,t.jsx)("path",{d:"M4.4 16 L12 20.2 L19.6 16"})]}),tokens:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"9",cy:"9",r:"4.5"}),(0,t.jsx)("path",{d:"M14 9.5a4.5 4.5 0 1 1-4 6.9"})]}),bolt:e=>(0,t.jsx)(n,{...e,d:"M13 3 5 13h5l-1 8 8-10h-5z"}),add:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"3.5"}),(0,t.jsx)("path",{d:"M12 8.5v7M8.5 12h7"})]}),bell:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9.8 4.6 a5.5 5.5 0 0 1 7.7 4.4 c0 4.5 2 5.5 2 5.5 H4.5 s2 -1 2 -5.5 a5.5 5.5 0 0 1 1.1 -3.3"}),(0,t.jsx)("path",{d:"M10 19 a2 2 0 0 0 4 0"})]}),sun:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.17 8.17 A4 4 0 1 1 10.83 8.17"}),(0,t.jsx)("path",{d:"M12 2.5 V5 M12 19 V21.5 M2.5 12 H5 M19 12 H21.5 M5.1 5.1 L6.9 6.9 M17.1 17.1 l1.8 1.8 M18.9 5.1 L17.1 6.9 M6.9 17.1 L5.1 18.9"})]}),moon:e=>(0,t.jsx)(n,{...e,d:"M19.5 13.5 A8 8 0 1 1 10.5 4.2 a6.5 6.5 0 0 0 9.3 9.1"}),zoomOut:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,t.jsx)("path",{d:"M20 20l-4.2-4.2M8.3 11h5.4"})]}),zoomIn:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,t.jsx)("path",{d:"M20 20l-4.2-4.2M11 8.3v5.4M8.3 11h5.4"})]}),activity:e=>(0,t.jsx)(n,{...e,d:"M3 12h3l2.5-7 5 14 2.5-7H21"}),user:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.35 4.66 A3.6 3.6 0 1 1 10.65 4.66"}),(0,t.jsx)("path",{d:"M5.5 20 c.9 -3.7 3.4 -5.5 6.5 -5.5 s5.6 1.8 6.5 5.5"})]}),localKnowledge:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M4 19V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12"}),(0,t.jsx)("path",{d:"M4 19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}),(0,t.jsx)("path",{d:"M9 7v14M9 11h6"})]}),server:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.30 4.50 H18.30 A1.7 1.7 0 0 1 20.00 6.20 V8.80 A1.7 1.7 0 0 1 18.30 10.50 H5.70 A1.7 1.7 0 0 1 4.00 8.80 V6.20 A1.7 1.7 0 0 1 5.70 4.50 H10.70"}),(0,t.jsx)("path",{d:"M5.70 13.50 H18.30 A1.7 1.7 0 0 1 20.00 15.20 V17.80 A1.7 1.7 0 0 1 18.30 19.50 H5.70 A1.7 1.7 0 0 1 4.00 17.80 V15.20 A1.7 1.7 0 0 1 5.70 13.50 Z"}),(0,t.jsx)("path",{d:"M7.4 7.5 h.01 M7.4 16.5 h.01 M12 7.5 H16 M12 16.5 H16"})]})}])},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return l}});let s=e.r(71645);function l(e,t){let n=(0,s.useRef)(null),l=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=n.current;e&&(n.current=null,e());let t=l.current;t&&(l.current=null,t())}else e&&(n.current=a(e,s)),t&&(l.current=a(t,s))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},83449,e=>{"use strict";e.s(["costClassLabel",0,function(e){switch(e){case"low":return"Low cost";case"medium":return"Medium cost";case"high":return"High cost";case"unknown":return"Unknown cost"}},"formatBytes",0,function(e){return e<1024?`${e.toString()} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(1)} GB`},"formatDate",0,function(e){try{return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return"string"==typeof e?e:e.toString()}},"formatMs",0,function(e){if(e<1e3)return`${e.toString()} ms`;if(e<6e4)return`${(e/1e3).toFixed(1)} s`;let t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t.toString()}m ${n.toString()}s`},"formatTokens",0,function(e){return e<1e3?e.toString():`${(e/1e3).toFixed(1)}k`},"outcomeLabel",0,function(e){switch(e){case"fix-applied":return"Fix applied";case"fix-proposed":return"Fix proposed (dry-run)";case"investigation-only":return"Investigation only";case"limit-exceeded":return"Limit exceeded";case"dry-run":return"Dry-run";default:return e.charAt(0).toUpperCase()+e.slice(1)}},"runStatusLabel",0,function(e){return({running:"Running",completed:"Completed","dry-run":"Dry run",rejected:"Rejected",cancelled:"Cancelled",failed:"Failed","fix-applied":"Fix applied","fix-proposed":"Fix proposed","investigation-only":"Investigation only"})[e]??e}])},61593,e=>{"use strict";var t=e.i(76055);function n(e,t){let n={Accept:"application/json"};return null!=t&&(n["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(n["X-Keiko-CSRF"]="1"),n}async function s(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message}}catch{return{code:"INTERNAL",message:`The server returned an unexpected error (HTTP ${e.status.toString()}). Try again.`}}}async function l(e,l){let a=(l?.method??"GET").toUpperCase(),r=await fetch(e,{...l,headers:n(a,l?.body)});if(!r.ok){let{code:e,message:n}=await s(r);throw new t.ApiError(e,n,r.status)}if(204!==r.status)return r.json()}async function a(){return l("/api/local-knowledge/capsules")}async function r(){return l("/api/local-knowledge/capsule-sets")}async function i(e){return l("/api/local-knowledge/capsules",{method:"POST",body:JSON.stringify(e)})}async function o(e){return l("/api/local-knowledge/capsule-sets",{method:"POST",body:JSON.stringify(e)})}async function c(e,t){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function d(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"POST",body:JSON.stringify({confirm:!0})})}async function u(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function h(e,t,n){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"POST",body:JSON.stringify({scope:t,displayName:n})})}async function p(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function f(e,l=fetch){let a=`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,r=await l(a,{headers:n("GET",void 0)});if(!r.ok){let{code:e,message:n}=await s(r);throw new t.ApiError(e,n,r.status)}return r.json()}async function x(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({capsuleId:e,deleteIndex:!0,deleteSources:!1})})}async function m(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"changed-files"})})}async function g(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"repair-failed"})})}e.s(["cancelIndexing",0,u,"connectCapsuleSource",0,h,"createCapsule",0,i,"createCapsuleSet",0,o,"deleteCapsule",0,x,"disconnectCapsule",0,p,"fetchCapsuleDetail",0,f,"fetchCapsuleSets",0,r,"fetchCapsules",0,a,"refreshCapsuleChangedFiles",0,m,"renameCapsule",0,c,"repairCapsuleFailedFiles",0,g,"startIndexing",0,d])},95057,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s={formatUrl:function(){return i},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};for(var l in s)Object.defineProperty(n,l,{enumerable:!0,get:s[l]});let a=e.r(90809)._(e.r(98183)),r=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:n}=e,s=e.protocol||"",l=e.pathname||"",i=e.hash||"",o=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),o&&"object"==typeof o&&(o=String(a.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||r.test(s))&&!1!==c?(c="//"+(c||""),l&&"/"!==l[0]&&(l="/"+l)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),d&&"?"!==d[0]&&(d="?"+d),l=l.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${s}${c}${l}${d}${i}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return i(e)}},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return a}});let s=e.r(18967),l=e.r(52817);function a(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,l.hasBasePath)(n.pathname)}catch(e){return!1}}},84508,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"errorOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},22016,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s={default:function(){return g},useLinkStatus:function(){return y}};for(var l in s)Object.defineProperty(n,l,{enumerable:!0,get:s[l]});let a=e.r(90809),r=e.r(43476),i=a._(e.r(71645)),o=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),h=e.r(5550);e.r(33525);let p=e.r(88540),f=e.r(91949),x=e.r(73668),m=e.r(9396);function g(t){var n,s;let l,a,g,[y,k]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),b=(0,i.useRef)(null),{href:v,as:N,children:S,prefetch:M=null,passHref:C,replace:w,shallow:A,scroll:E,onClick:L,onMouseEnter:$,onTouchStart:T,legacyBehavior:D=!1,onNavigate:R,transitionTypes:O,ref:I,unstable_dynamicOnHover:P,..._}=t;l=S,D&&("string"==typeof l||"number"==typeof l)&&(l=(0,r.jsx)("a",{children:l}));let H=i.default.useContext(c.AppRouterContext),U=!1!==M,F=!1!==M?null===(s=M)||"auto"===s?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,V="string"==typeof(n=N||v)?n:(0,o.formatUrl)(n);if(D){if(l?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(l)}let B=D?a&&"object"==typeof a&&a.ref:I,J=i.default.useCallback(e=>(null!==H&&(b.current=(0,f.mountLinkInstance)(e,V,H,F,U,k)),()=>{b.current&&((0,f.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,f.unmountPrefetchableInstance)(e)}),[U,V,H,F,k]),K={ref:(0,d.useMergedRef)(J,B),onClick(t){D||"function"!=typeof L||L(t),D&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!H||t.defaultPrevented||function(t,n,s,l,a,r,o){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,x.isLocalURL)(n)){l&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),r){let e=!1;if(r({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);i.default.startTransition(()=>{u(n,l?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,s.current,o)})}}(t,V,b,w,E,R,O)},onMouseEnter(e){D||"function"!=typeof $||$(e),D&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),H&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){D||"function"!=typeof T||T(e),D&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),H&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,u.isAbsoluteUrl)(V)?K.href=V:D&&!C&&("a"!==a.type||"href"in a.props)||(K.href=(0,h.addBasePath)(V)),g=D?i.default.cloneElement(a,K):(0,r.jsx)("a",{..._,...K,children:l}),(0,r.jsx)(j.Provider,{value:y,children:g})}e.r(84508);let j=(0,i.createContext)(f.IDLE_LINK_STATUS),y=()=>(0,i.useContext)(j);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18566,(e,t,n)=>{t.exports=e.r(76562)},96688,e=>{"use strict";e.s(["STATUS_LABELS",0,{draft:"Draft",indexing:"Indexing",ready:"Indexed",stale:"Stale",deleting:"Deleting",error:"Failed"}])},69128,61774,e=>{"use strict";var t=e.i(71645),n=e.i(61593),s=e.i(76055);function l(e){return e instanceof s.ApiError?e.message.trim().length>0?`${e.message} (${e.code})`:`Something went wrong. Try again. (${e.code})`:e instanceof Error&&e.message.trim().length>0?e.message:"An unexpected error occurred."}e.s(["formatError",0,l],61774),e.s(["useCapsuleDetail",0,function(e,s=n.fetchCapsuleDetail){let[a,r]=(0,t.useState)(null),[i,o]=(0,t.useState)("loading"),[c,d]=(0,t.useState)(null),u=(0,t.useCallback)(async(t={})=>{if(""===e){r(null),d("No capsule selected."),o("error");return}!0!==t.quiet&&(o("loading"),d(null));try{let t=await s(e);r(t),o("ready")}catch(e){if(!0===t.quiet)return;d(l(e)),o("error")}},[e,s]);return(0,t.useEffect)(()=>{u()},[u]),(0,t.useEffect)(()=>{let e=a?.indexingJobs[0];if(a?.capsule.lifecycleState!=="indexing"&&e?.status!=="queued"&&e?.status!=="running")return;let t=window.setInterval(()=>{u({quiet:!0})},2e3);return()=>window.clearInterval(t)},[a?.capsule.lifecycleState,a?.indexingJobs,u]),{data:a,loadStatus:i,loadError:c,reload:function(){u()}}}],69128)},20316,e=>{"use strict";e.s(["LOCAL_KNOWLEDGE_MAX_FILE_BYTES",0,0x40000000,"LOCAL_KNOWLEDGE_MAX_OBJECTS_PER_DOCUMENT",0,25e6,"LOCAL_KNOWLEDGE_PARSER_TIMEOUT_MS",0,36e5])},80010,e=>{"use strict";var t=e.i(43476),n=e.i(71645),s=e.i(18566),l=e.i(22016),a=e.i(96688),r=e.i(69128),i=e.i(74080),o=e.i(61593),c=e.i(76055),d=e.i(83449),u=e.i(20316),h=e.i(17161),p=e.i(61774);function f(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%"}function x(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),s=t%60;return 0===n?`${s.toString()}s`:`${n.toString()}m ${s.toString().padStart(2,"0")}s`}function m(e=Date.now()){return{detail:null,startedAt:e,now:e,pollError:null}}function g(){return`Maximum single file size: ${(0,d.formatBytes)(u.LOCAL_KNOWLEDGE_MAX_FILE_BYTES)}. Parser budget: ${u.LOCAL_KNOWLEDGE_MAX_OBJECTS_PER_DOCUMENT.toLocaleString("en-US")} objects, ${function(e){let t=Math.round(e/6e4);if(t<60)return`${t.toString()} min`;let n=t/60;return`${n.toString()} h`}(u.LOCAL_KNOWLEDGE_PARSER_TIMEOUT_MS)} per document.`}function j(e){return Array.from(new Set(e.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)))}function y({scopeKind:e,initialRootPath:s,initialFilesInput:l,onApply:a,onCancel:r,fetchProjectsImpl:o=c.fetchProjects,fetchFilesTreeImpl:f=c.fetchFilesTree}){let x=(0,n.useRef)(null);b(x,!0,r);let[m,k]=(0,n.useState)([]),[v,N]=(0,n.useState)(s.trim()),[S,M]=(0,n.useState)(s.trim()),[C,w]=(0,n.useState)(null),[A,E]=(0,n.useState)([]),[L,$]=(0,n.useState)(()=>new Set(j(l))),[T,D]=(0,n.useState)(!1),[R,O]=(0,n.useState)(null);function I(e){let t=e.trim();0!==t.length&&($(new Set),w(null),N(t))}(0,n.useEffect)(()=>{let e=!1;return o().then(t=>{if(e)return;let n=t.projects.filter(e=>e.available);k(n),0===v.length&&void 0!==n[0]&&(N(n[0].path),M(n[0].path))}).catch(()=>{e||k([])}),()=>{e=!0}},[v.length,o]),(0,n.useEffect)(()=>{if(0===v.length){E([]),O(null);return}let e=!1;return D(!0),O(null),f(v,C??"").then(t=>{e||(E(t.entries),N(t.root),M(t.root))}).catch(t=>{e||(E([]),O((0,p.formatError)(t)))}).finally(()=>{e||D(!1)}),()=>{e=!0}},[v,C,f]);let P=function(e,t){if(null===t||0===t.length)return e;let n=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e.replace(/[/\\]+$/u,"")}${n}${t.replace(/\//gu,n)}`}(v,C),_=Array.from(L).join("\n"),H=L.size>0,U="files"===e||H?v.length>0&&L.size>0:v.length>0;return(0,i.createPortal)((0,t.jsx)("div",{className:"dlg-overlay in",role:"presentation",children:(0,t.jsxs)("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":"lkd-source-picker-title","aria-describedby":"lkd-source-picker-desc",className:"dlg lkd-source-picker",tabIndex:-1,children:[(0,t.jsx)("div",{className:"dlg-head",children:(0,t.jsxs)("div",{className:"dlg-htext",children:[(0,t.jsx)("div",{id:"lkd-source-picker-title",className:"dlg-title",children:"Choose local source"}),(0,t.jsxs)("div",{id:"lkd-source-picker-desc",className:"dlg-sub",children:["Select a local ","files"===e?"file or files":"folder"," for this capsule."]}),(0,t.jsx)("div",{className:"dlg-sub",children:g()})]})}),(0,t.jsxs)("div",{className:"dlg-body lkd-source-picker-body",children:[m.length>0?(0,t.jsx)("div",{className:"lkd-picker-projects","aria-label":"Registered project folders",children:m.map(e=>(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:()=>{M(e.path),I(e.path)},children:e.name??e.path},e.path))}):null,(0,t.jsxs)("form",{className:"lkd-picker-root",onSubmit:e=>{e.preventDefault(),I(S)},children:[(0,t.jsx)("label",{htmlFor:"lkd-picker-root-input",className:"dlg-label",children:"Folder root"}),(0,t.jsx)("input",{id:"lkd-picker-root-input",type:"text",className:"dlg-input lkd-connect-input",value:S,placeholder:"/absolute/path/to/folder",onChange:e=>M(e.target.value)}),(0,t.jsx)("button",{type:"submit",className:"lk-btn lk-btn-ghost",children:"Open"})]}),(0,t.jsxs)("div",{className:"lkd-picker-current",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null===C,onClick:()=>w(function(e){if(null===e||0===e.length)return null;let t=e.replace(/\/+$/u,""),n=t.lastIndexOf("/");if(n<0)return null;let s=t.slice(0,n);return s.length>0?s:null}(C)),children:"Up"}),(0,t.jsx)("span",{className:"mono",title:P,children:P||"No folder selected"})]}),null!==R?(0,t.jsx)("div",{role:"alert",className:"lk-alert",children:R}):null,T?(0,t.jsx)("p",{role:"status",className:"lk-loading",children:"Loading folder…"}):(0,t.jsxs)("ul",{className:"lkd-picker-list","aria-label":"Local source browser",children:[A.map(e=>{let n="file"===e.kind&&e.sizeBytes>u.LOCAL_KNOWLEDGE_MAX_FILE_BYTES,s=!e.readable||n,l=n?`File is ${(0,d.formatBytes)(e.sizeBytes)}; maximum is ${(0,d.formatBytes)(u.LOCAL_KNOWLEDGE_MAX_FILE_BYTES)}.`:"File is not readable.";return(0,t.jsx)("li",{className:"lkd-picker-entry",children:"directory"===e.kind?(0,t.jsxs)("button",{type:"button",className:"lkd-picker-row",disabled:!e.readable,onClick:()=>{$(new Set),w(e.path)},children:[(0,t.jsx)(h.Icons.folder,{size:14}),(0,t.jsx)("span",{children:e.name})]}):(0,t.jsxs)("label",{className:"lkd-picker-row","data-disabled":String(s),title:s?l:void 0,children:[(0,t.jsx)("input",{type:"checkbox",disabled:s,checked:L.has(e.path),onChange:()=>{var t;return t=e.path,void $(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}}),(0,t.jsx)("span",{children:e.name}),(0,t.jsxs)("span",{className:"lkd-picker-meta",children:[(0,d.formatBytes)(e.sizeBytes),n?" · too large":""]})]})},e.path)}),!T&&0===A.length&&v.length>0?(0,t.jsx)("li",{className:"lkd-picker-empty",children:"No entries in this folder."}):null]})]}),(0,t.jsxs)("div",{className:"dlg-foot",children:[(0,t.jsx)("button",{type:"button",className:"dlg-btn",onClick:r,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"dlg-btn primary",disabled:!U,onClick:()=>{H?a("files",v,_):a(e,P)},children:"Use selection"})]})]})}),document.body)}function k({capsuleId:e,onConnected:s,connectImpl:l=o.connectCapsuleSource}){let[a,r]=(0,n.useState)("folder"),[i,c]=(0,n.useState)(""),[d,u]=(0,n.useState)(""),[f,x]=(0,n.useState)(!1),[m,g]=(0,n.useState)(null),[b,v]=(0,n.useState)(!1),N=function(e,t,n){let s=t.trim();if(""===s)return null;if("folder"===e)return{kind:"folder",rootPath:s,recursive:!0};if("repository"===e)return{kind:"repository",repositoryRoot:s};let l=j(n);return 0===l.length?null:{kind:"files",rootPath:s,files:l}}(a,i,d);async function S(){if(null!==N&&!f){x(!0),g(null);try{await l(e,N),c(""),u(""),s()}catch(e){g((0,p.formatError)(e))}finally{x(!1)}}}return(0,t.jsxs)("div",{className:"lkd-connect-form","aria-label":"Connect a source",children:[(0,t.jsx)("label",{htmlFor:"lkd-connect-kind",className:"lkd-connect-label",children:"Connect source"}),(0,t.jsx)("div",{className:"lkd-connect-row",children:(0,t.jsxs)("span",{className:"dlg-selwrap",children:[(0,t.jsxs)("select",{id:"lkd-connect-kind",className:"dlg-input",value:a,disabled:f,onChange:e=>{r(e.target.value),g(null)},children:[(0,t.jsx)("option",{value:"folder",children:"Folder"}),(0,t.jsx)("option",{value:"repository",children:"Repository"}),(0,t.jsx)("option",{value:"files",children:"Files"})]}),(0,t.jsx)("span",{className:"dlg-selchev",children:(0,t.jsx)(h.Icons.chevron,{size:15})})]})}),(0,t.jsxs)("div",{className:"lkd-connect-row",children:[(0,t.jsx)("label",{htmlFor:"lkd-connect-path-input",className:"dlg-label",children:"repository"===a?"Absolute repository path to connect":"files"===a?"Absolute root path for the selected files":"Absolute folder path to connect"}),(0,t.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,t.jsx)("input",{id:"lkd-connect-path-input",type:"text",className:"dlg-input lkd-connect-input",value:i,disabled:f,placeholder:"repository"===a?"/absolute/path/to/repository":"files"===a?"/absolute/path/to/root":"/absolute/path/to/folder",autoComplete:"off",onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&"files"!==a&&S()}}),(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f,onClick:()=>v(!0),children:"Browse"})]})]}),"files"===a?(0,t.jsxs)("div",{className:"lkd-connect-row",children:[(0,t.jsx)("label",{htmlFor:"lkd-connect-files-input",className:"dlg-label",children:"Relative files to connect"}),(0,t.jsx)("textarea",{id:"lkd-connect-files-input",className:"dlg-input lkd-connect-input",value:d,disabled:f,placeholder:"src/app.ts\nREADME.md",rows:4,onChange:e=>u(e.target.value)})]}):null,(0,t.jsx)("div",{className:"lkd-connect-row",children:(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f||null===N,"aria-busy":f,onClick:()=>void S(),children:f?"Connecting…":"Connect"})}),null!==m?(0,t.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:m}):null,b?(0,t.jsx)(y,{scopeKind:a,initialRootPath:i,initialFilesInput:d,onApply:(e,t,n)=>{r(e),c(t),void 0!==n?u(n):"files"!==e&&u(""),g(null),v(!1)},onCancel:()=>v(!1)}):null]})}function b(e,t,s){(0,n.useEffect)(()=>{if(!t)return;let e=document.activeElement;return()=>e?.focus?.()},[t]),(0,n.useEffect)(()=>{if(!t)return;let n=e.current;if(null===n)return;let l=n.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function a(e){if("Escape"===e.key){e.preventDefault(),s();return}if("Tab"!==e.key)return;let t=Array.from(n.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===t.length)return void e.preventDefault();let l=t[0],a=t[t.length-1];e.shiftKey&&document.activeElement===l?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a||(e.preventDefault(),l.focus())}return l?.focus(),n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[t,e,s])}function v({kind:e,progress:n}){let s=n.detail,l=s?.indexingJobs[0],a=l?.totalDocuments??s?.health.documentCount??0,r=void 0===l?0:l.processedDocuments+l.failedDocuments+l.skippedDocuments,i=a>0?r/a:0,o=s?.health.chunkCount??0,c=s?.health.vectorCount??0,d=o>0?c/o:0,u=n.now-n.startedAt,h=r>0?r/Math.max(u,1):0,p=h>0?Math.max(0,a-r)/h:0,f=l?.status??s?.capsule.lifecycleState??"starting",m=h>0&&a>r?`Estimated remaining ${x(p)}`:"Estimating remaining time";return(0,t.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",children:[(0,t.jsxs)("div",{className:"lkd-action-progress-head",children:[(0,t.jsx)("span",{children:"index"===e?"Indexing documents":"refresh"===e?"Refreshing changed files":"Repairing failed files"}),(0,t.jsx)("span",{children:f})]}),(0,t.jsxs)("div",{className:"lkd-action-progress-note",children:["Still working. Elapsed ",x(u),". ",m,"."]}),(0,t.jsxs)("div",{className:"lkd-status-bars",children:[(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Documents"}),(0,t.jsx)(N,{value:i,label:"Action document progress"}),(0,t.jsxs)("span",{children:[r.toString()," / ",a.toString()]})]}),(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Vectors"}),(0,t.jsx)(N,{value:d,label:"Action vector progress"}),(0,t.jsxs)("span",{children:[c.toString()," / ",o.toString()]})]})]}),null!==n.pollError?(0,t.jsxs)("div",{className:"lkd-action-progress-note",children:["Progress refresh is delayed: ",n.pollError]}):null]})}function N({value:e,label:n}){return(0,t.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${f(e)}`,children:(0,t.jsx)("span",{className:"lkd-progress-fill","data-tone":"ok",style:{width:f(e)}})})}function S({kind:e,capsuleDisplayName:s,nameInput:l,busy:a,error:r,progress:o,onNameChange:c,onConfirm:d,onCancel:u}){let h=(0,n.useRef)(null),p=(0,n.useRef)(null);b(h,!0,u),(0,n.useEffect)(()=>{"delete"===e&&null!==p.current&&p.current.focus()},[e]);let f=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=h.current;null!==e&&(a?(f.current=!0,e.focus()):f.current&&(f.current=!1,e.querySelector("button:not([disabled]),input:not([disabled])")?.focus()))},[a]);let x="delete"===e,m=!a&&(!x||l===s),g="lkd-confirm-title",j="lkd-confirm-desc";return(0,i.createPortal)((0,t.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&u()},children:(0,t.jsxs)("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":j,className:"dlg",tabIndex:-1,children:[(0,t.jsx)("div",{className:"dlg-head",children:(0,t.jsxs)("div",{className:"dlg-htext",children:[(0,t.jsx)("div",{id:g,className:"dlg-title",children:"delete"===e?"Delete capsule":"refresh"===e?"Refresh changed files":"Repair failed files"}),(0,t.jsx)("div",{id:j,className:"dlg-sub",children:"delete"===e?`This permanently deletes the capsule index. The source files on disk are NOT deleted. Type "${s}" to confirm.`:"refresh"===e?"This runs an incremental refresh. Unchanged files stay in place, changed files are re-indexed, and removed files are cleaned up.":"This retries files that previously failed indexing and also picks up any newly changed files in the same incremental pass."})]})}),x?(0,t.jsxs)("div",{className:"dlg-body",children:[(0,t.jsxs)("div",{className:"dlg-field",children:[(0,t.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:"Type the capsule name to confirm"}),(0,t.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:l,autoComplete:"off",ref:p,disabled:a,placeholder:s,onChange:e=>c(e.target.value)})]}),null!==r?(0,t.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:r}):null]}):(0,t.jsxs)("div",{className:"dlg-body",children:[a&&null!==o?(0,t.jsx)(v,{kind:e,progress:o}):null,null!==r?(0,t.jsx)("div",{role:"alert",className:"lk-alert",children:r}):null]}),(0,t.jsxs)("div",{className:"dlg-foot",children:[(0,t.jsx)("button",{type:"button",className:"dlg-btn",disabled:a,onClick:u,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!m,"aria-disabled":!m,onClick:d,children:a?"Working…":"delete"===e?"Delete":"refresh"===e?"Refresh":"Repair"})]})]})}),document.body)}function M({capsuleId:e,capsuleDisplayName:s,sourceCount:l,lifecycleState:a,onActionComplete:r,onDeleted:i,connectCapsuleSourceImpl:c=o.connectCapsuleSource,deleteCapsuleImpl:d=o.deleteCapsule,refreshCapsuleImpl:u=o.refreshCapsuleChangedFiles,repairCapsuleImpl:h=o.repairCapsuleFailedFiles,startIndexingImpl:f=o.startIndexing,fetchCapsuleDetailImpl:x=o.fetchCapsuleDetail}){let[j,y]=(0,n.useState)(null),[b,N]=(0,n.useState)(!1),[C,w]=(0,n.useState)(null),[A,E]=(0,n.useState)(!1),[L,$]=(0,n.useState)(null),[T,D]=(0,n.useState)(null),R=null!==T&&(A||b&&null!==j&&"delete"!==j.kind);async function O(){if(!A){D(m()),E(!0),$(null);try{await f(e),D(null),r()}catch(e){$((0,p.formatError)(e))}finally{E(!1)}}}function I(e){w(null),D(null),y({kind:e,nameInput:""})}async function P(e,t){"delete"!==e&&D(m()),N(!0),w(null);try{let n=await t();D(null),y(null),"delete"===e&&void 0!==i?i(n):r()}catch(e){w((0,p.formatError)(e))}finally{N(!1)}}return(0,n.useEffect)(()=>{if(!R)return;let e=window.setInterval(()=>{D(e=>null===e?e:{...e,now:Date.now()})},1e3);return()=>window.clearInterval(e)},[R]),(0,n.useEffect)(()=>{if(!R)return;let t=!1;async function n(){try{let n=await x(e);if(t)return;D(e=>null===e?{detail:n,startedAt:Date.now(),now:Date.now(),pollError:null}:{...e,detail:n,now:Date.now(),pollError:null})}catch(e){if(t)return;D(t=>null===t?t:{...t,now:Date.now(),pollError:(0,p.formatError)(e)})}}n();let s=window.setInterval(()=>{n()},2e3);return()=>{t=!0,window.clearInterval(s)}},[e,x,R]),(0,t.jsxs)("section",{className:"lkd-tools","aria-label":"Capsule tools",children:[(0,t.jsx)(k,{capsuleId:e,onConnected:r,connectImpl:c}),(0,t.jsx)("p",{className:"lkd-limit-note",children:g()}),l>0&&"ready"!==a?(0,t.jsxs)("div",{className:"lkd-index-row",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Index this capsule now","aria-busy":A,disabled:A,onClick:()=>void O(),children:A?"Indexing…":"Index now"}),null!==L?(0,t.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:L}):null,A&&null!==T?(0,t.jsx)(v,{kind:"index",progress:T}):null]}):null,(0,t.jsxs)("div",{role:"group","aria-label":`Actions for capsule ${s}`,className:"lkd-actions-group",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Refresh changed files for capsule ${s}`,onClick:()=>I("refresh"),children:"Refresh changed files"}),(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Repair failed files for capsule ${s}`,onClick:()=>I("repair"),children:"Repair failed files"}),(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":`Delete capsule ${s}`,onClick:()=>I("delete"),children:"Delete"})]}),null!==j?(0,t.jsx)(S,{kind:j.kind,capsuleDisplayName:s,nameInput:j.nameInput,busy:b,error:C,progress:T,onNameChange:function(e){y(t=>null!==t?{...t,nameInput:e}:null)},onConfirm:function(){if(null===j||b)return;let{kind:t}=j;"delete"===t?P(t,()=>d(e)):"refresh"===t?P(t,()=>u(e)):P(t,()=>h(e))},onCancel:function(){b||(y(null),w(null),D(null))}}):null]})}function C({name:e,description:s,busy:l,error:a,nameInputRef:r,onNameChange:i,onDescriptionChange:o,onCancel:c,onSubmit:d}){let u=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let e=e=>{if("Escape"!==e.key||l)return;let t=u.current;null!==t&&t.contains(document.activeElement)&&c()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[l,c]),(0,t.jsxs)("form",{className:"lkd-rename-form","aria-label":"Rename capsule",onSubmit:d,ref:u,children:[(0,t.jsxs)("div",{className:"dlg-field",children:[(0,t.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:"Display name"}),(0,t.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",ref:r,value:e,disabled:l,autoComplete:"off","aria-label":"Capsule display name",onChange:e=>i(e.target.value)})]}),(0,t.jsxs)("div",{className:"dlg-field",children:[(0,t.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:"Description"}),(0,t.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:s,disabled:l,autoComplete:"off","aria-label":"Capsule description",onChange:e=>o(e.target.value)})]}),null!==a?(0,t.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:a}):null,(0,t.jsxs)("div",{className:"lkd-rename-actions",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:l,onClick:c,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:l,"aria-busy":l,children:l?"Saving…":"Save"})]})]})}function w({capsuleId:e,displayName:s,description:l,onRenamed:a,renameImpl:r=o.renameCapsule}){let[i,c]=(0,n.useState)(!1),[d,u]=(0,n.useState)(s),[h,f]=(0,n.useState)(l??""),[x,m]=(0,n.useState)(!1),[g,j]=(0,n.useState)(null),y=(0,n.useRef)(null),k=(0,n.useRef)(null),b=(0,n.useRef)(!1);async function v(t){let n,i;t.preventDefault();let o=d.trim();if(0===o.length)return void j("Display name is required.");let u=(n={},o!==s&&(n.displayName=o),((i=h.trim())!==(l??"")&&(n.description=i),void 0===n.displayName&&void 0===n.description)?null:n);if(null===u)return void c(!1);m(!0),j(null);try{await r(e,u),c(!1),a()}catch(e){j((0,p.formatError)(e))}finally{m(!1)}}return(0,n.useEffect)(()=>{i?y.current?.focus():b.current&&k.current?.focus(),b.current=i},[i]),i?(0,t.jsx)(C,{name:d,description:h,busy:x,error:g,nameInputRef:y,onNameChange:u,onDescriptionChange:f,onCancel:function(){x||(c(!1),j(null))},onSubmit:e=>void v(e)}):(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Rename capsule ${s}`,ref:k,onClick:function(){u(s),f(l??""),j(null),c(!0)},children:"Rename"})}function A(e){return new Date(e).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}function E(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%"}function L(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),s=t%60;return 0===n?`${s.toString()}s`:`${n.toString()}m ${s.toString().padStart(2,"0")}s`}function $(e){return{width:E(e)}}function T({children:e}){return(0,t.jsx)("h2",{className:"lk-section-head",children:e})}function D(e){let[t,s]=(0,n.useState)(!1);return{visibleCount:t?e:Math.min(25,e),showAll:t,setShowAll:s}}function R({hiddenCount:e,showAll:n,onToggle:s,noun:l}){return!n&&e<=0?null:(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:s,children:n?`Show fewer ${l}`:`Show ${e.toString()} more ${l}`})}function O({label:e,value:n,meta:s,tone:l="neutral"}){return(0,t.jsxs)("div",{className:"lkd-metric-card","data-tone":l,children:[(0,t.jsx)("span",{className:"lkd-metric-label",children:e}),(0,t.jsx)("strong",{className:"lkd-metric-value",children:n}),(0,t.jsx)("span",{className:"lkd-metric-meta",children:s})]})}function I({value:e,label:n,tone:s="ok"}){return(0,t.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${E(e)}`,children:(0,t.jsx)("span",{className:"lkd-progress-fill","data-tone":s,style:$(e)})})}function P({data:e}){let n,s=e.indexingJobs[0],l=s?.totalDocuments??e.health.documentCount,a=void 0===s?0:s.processedDocuments+s.failedDocuments+s.skippedDocuments,r=Math.max(0,e.health.documentCount-e.health.failedDocuments-e.health.skippedDocuments),i=l>0?a/l:0,o=e.health.chunkCount>0?e.health.vectorCount/e.health.chunkCount:0,c=Math.max(0,e.health.chunkCount-e.health.vectorCount),d=void 0!==s?L((s.finishedAt??Date.now())-s.startedAt):"No job recorded",u=void 0!==s?Math.max(Date.now()-s.startedAt,1):0,h=a>0?a/u:0,p=h>0?Math.max(0,l-a)/h:0,f=s?.status==="running"&&l>0&&a>0?`ETA ${L(p)}`:d,x=c>0||e.health.failedDocuments>0?s?.lastError!==void 0?"danger":"warn":"ok";return(0,t.jsxs)("section",{"aria-labelledby":"lkd-index-status-heading",className:"lkd-status-section",children:[(0,t.jsxs)("div",{className:"lkd-section-title-row",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-index-status-heading",children:"Index status"})}),(0,t.jsx)("span",{className:"lkd-live-note","aria-live":"polite",children:s?.status==="running"?"Updating every 2s":"Latest run"})]}),(0,t.jsxs)("div",{className:"lkd-metric-grid",children:[(0,t.jsx)(O,{label:"Indexed documents",value:`${r.toString()} / ${e.health.documentCount.toString()}`,meta:`${e.health.failedDocuments.toString()} failed, ${e.health.skippedDocuments.toString()} skipped`,tone:e.health.failedDocuments>0?"danger":e.health.skippedDocuments>0?"warn":"ok"}),(0,t.jsx)(O,{label:"Vectors",value:`${e.health.vectorCount.toString()} / ${e.health.chunkCount.toString()}`,meta:c>0?`${c.toString()} chunks missing vectors`:"All chunks embedded",tone:c>0?"danger":"ok"}),(0,t.jsx)(O,{label:"Latest job",value:void 0!==s?G[s.status]:"Not indexed",meta:f,tone:s?.status==="failed"?"danger":s?.status==="running"?"warn":"neutral"})]}),(0,t.jsxs)("div",{className:"lkd-status-bars",children:[(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Discovery progress"}),(0,t.jsx)(I,{value:i,label:"Document discovery progress"}),(0,t.jsx)("span",{children:E(i)})]}),(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Retrieval coverage"}),(0,t.jsx)(I,{value:o,label:"Vector retrieval coverage",tone:c>0?"danger":"ok"}),(0,t.jsx)("span",{children:E(o)})]})]}),(0,t.jsx)("p",{className:"lkd-status-callout","data-tone":x,children:(n=e.health.chunkCount-e.health.vectorCount,s?.lastError?.code==="EMBEDDING_ADAPTER_FAILED"?`Embedding stopped early: ${s.lastError.message}. ${n.toString()} chunks still need vectors.`:n>0?`${n.toString()} chunks still need vectors before retrieval can cover the full source.`:e.health.unsupportedDocuments>0?`${e.health.unsupportedDocuments.toString()} documents need a different extraction path before they can be indexed.`:"Index and vectors are aligned for the current source set.")})]})}function _({label:e,value:n}){return(0,t.jsxs)("div",{className:"lkd-row",children:[(0,t.jsx)("dt",{className:"lkd-label",children:e}),(0,t.jsx)("dd",{className:"lkd-value",children:n})]})}function H({data:e}){var n;let{capsule:s,health:l}=e,r=s.embeddingModelIdentity;return(0,t.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-overview-heading",children:"Overview"})}),(0,t.jsxs)("dl",{className:"lkd-dl",children:[(0,t.jsx)(_,{label:"Name",value:s.displayName}),void 0!==s.description?(0,t.jsx)(_,{label:"Description",value:s.description}):null,s.tags.length>0?(0,t.jsx)(_,{label:"Tags",value:(0,t.jsx)("ul",{className:"lkd-tags","aria-label":"Capsule tags",children:s.tags.map(e=>(0,t.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,t.jsx)(_,{label:"Status",value:(0,t.jsx)("span",{className:"lk-badge","data-state":s.lifecycleState,role:"status","aria-label":`Status: ${a.STATUS_LABELS[s.lifecycleState]}`,children:a.STATUS_LABELS[s.lifecycleState]})}),(0,t.jsx)(_,{label:"Embedding model",value:`${r.provider} / ${r.modelId} (${r.vectorDimensions.toString()}d, ${r.vectorMetric})`}),(0,t.jsx)(_,{label:"Storage size",value:(n=l.storageSizeBytes)<1024?`${n.toString()} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:`${(n/1048576).toFixed(1)} MB`}),(0,t.jsx)(_,{label:"Unsupported documents",value:l.unsupportedDocuments.toString()}),void 0!==l.lastIndexedAt?(0,t.jsx)(_,{label:"Last indexed",value:A(l.lastIndexedAt)}):null,(0,t.jsx)(_,{label:"Vector compatible",value:l.vectorCompatible?"Yes":"No — re-index required"}),l.staleReasons.length>0?(0,t.jsx)(_,{label:"Stale reasons",value:(0,t.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Stale reasons",children:l.staleReasons.map(e=>(0,t.jsx)("li",{children:e},e))})}):null,l.unsupportedGuidance.length>0?(0,t.jsx)(_,{label:"Next steps",value:(0,t.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Unsupported document guidance",children:l.unsupportedGuidance.map(e=>(0,t.jsx)("li",{children:e},e))})}):null]})]})}function U({sources:e}){return 0===e.length?(0,t.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,t.jsx)("p",{className:"lkd-empty-note",children:"No sources attached to this capsule."})]}):(0,t.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,t.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":"Capsule sources",children:e.map(e=>{var n;let s=e.indexedCount+e.failedCount+e.skippedCount,l="folder"===(n=e.scope).kind?n.rootPath:"repository"===n.kind?n.repositoryRoot:`${n.rootPath} (${n.files.length.toString()} selected files)`;return(0,t.jsxs)("li",{className:"lkd-source-card",children:[(0,t.jsxs)("div",{className:"lkd-source-card-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"lkd-source-name",title:e.displayName,children:e.displayName}),(0,t.jsx)("div",{className:"lkd-source-path",title:l,children:l})]}),(0,t.jsx)("span",{className:"lkd-source-scope",children:e.scope.kind})]}),(0,t.jsxs)("div",{className:"lkd-source-coverage",role:"img","aria-label":"Source document coverage",children:[(0,t.jsx)("span",{className:"lkd-source-segment lkd-source-segment-ok",style:$(s>0?e.indexedCount/s:0)}),(0,t.jsx)("span",{className:"lkd-source-segment lkd-source-segment-fail",style:$(s>0?e.failedCount/s:0)}),(0,t.jsx)("span",{className:"lkd-source-segment lkd-source-segment-skip",style:$(s>0?e.skippedCount/s:0)})]}),(0,t.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,t.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[e.indexedCount.toString()," indexed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[e.failedCount.toString()," failed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[e.skippedCount.toString()," skipped"]})]})]},e.sourceId)})})]})}function F(){return(0,t.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-privacy-heading",children:"Privacy and deletion"})}),(0,t.jsxs)("ul",{className:"lkd-list","aria-label":"Privacy and deletion details",children:[(0,t.jsx)("li",{className:"lkd-source-row",children:"Indexed text, vectors, diagnostics, and job history stay in Keiko's local runtime state on this machine."}),(0,t.jsx)("li",{className:"lkd-source-row",children:"Selected chunks may be sent through the configured Model Gateway for embeddings during indexing and for grounded answers when you ask questions against this capsule."}),(0,t.jsx)("li",{className:"lkd-source-row",children:"Deleting a capsule removes its local index data and capsule-set memberships. Source files on disk are not deleted."})]})]})}let V={info:"Info",warning:"Warning",error:"Error"};function B({group:e}){return(0,t.jsxs)("li",{className:"lkd-diag-group","data-severity":e.severity,"aria-label":`${V[e.severity]}: ${e.code} (${e.count.toString()}x)`,children:[(0,t.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:V[e.severity]}),(0,t.jsxs)("span",{className:"lkd-diag-group-count",children:[e.count.toString(),"x"]}),(0,t.jsx)("span",{className:"lkd-diag-code",children:e.code}),(0,t.jsx)("span",{className:"lkd-diag-message",children:e.message})]})}function J({diag:e}){return(0,t.jsxs)("li",{className:"lkd-diag-row","data-severity":e.severity,"aria-label":`${V[e.severity]}: ${e.code}`,children:[(0,t.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:V[e.severity]}),(0,t.jsx)("span",{className:"lkd-diag-code",children:e.code}),(0,t.jsx)("span",{className:"lkd-diag-message",children:e.message}),void 0!==e.pageNumber?(0,t.jsxs)("span",{className:"lkd-diag-page",children:["p.",e.pageNumber.toString()]}):null]})}function K({diagnostics:e}){let{visibleCount:n,showAll:s,setShowAll:l}=D(e.length),a=e.slice(0,n),r=e.length-a.length,i=(function(e){let t=new Map;for(let n of e){let e=`${n.severity}\u0000${n.code}\u0000${n.message}`,s=t.get(e);t.set(e,{key:e,severity:n.severity,code:n.code,message:n.message,count:(s?.count??0)+1})}return[...t.values()].sort((e,t)=>t.count-e.count||e.code.localeCompare(t.code))})(e).slice(0,8);return(0,t.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-diag-heading",children:"Health Diagnostics"})}),0===e.length?(0,t.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:"No parser diagnostics — all documents processed cleanly."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{className:"lkd-list lkd-diag-group-list","aria-label":"Grouped parser diagnostics",children:i.map(e=>(0,t.jsx)(B,{group:e},e.key))}),(0,t.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":"Parser diagnostics",children:a.map((e,n)=>(0,t.jsx)(J,{diag:e},`${e.code}-${n.toString()}`))}),(0,t.jsx)(R,{hiddenCount:r,noun:"diagnostics",showAll:s,onToggle:()=>l(!s)})]})]})}let G={queued:"Queued",running:"Running",succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled"};function z({job:e}){let n=void 0!==e.finishedAt?L(e.finishedAt-e.startedAt):"In progress";return(0,t.jsxs)("li",{className:"lkd-job-row","aria-label":`Job ${e.id}: ${G[e.status]}`,children:[(0,t.jsx)("span",{className:"lkd-job-status","data-status":e.status,children:G[e.status]}),(0,t.jsxs)("span",{className:"lkd-job-dates",children:[(0,t.jsx)("time",{dateTime:new Date(e.startedAt).toISOString(),children:A(e.startedAt)}),void 0!==e.finishedAt?(0,t.jsxs)(t.Fragment,{children:[" — ",(0,t.jsx)("time",{dateTime:new Date(e.finishedAt).toISOString(),children:A(e.finishedAt)})]}):null]}),(0,t.jsx)("span",{className:"lkd-job-duration",children:n}),(0,t.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,t.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[e.processedDocuments.toString()," processed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[e.failedDocuments.toString()," failed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[e.skippedDocuments.toString()," skipped"]})]}),void 0!==e.lastError?(0,t.jsxs)("div",{className:"lkd-job-error",children:[(0,t.jsx)("span",{children:e.lastError.code}),(0,t.jsx)("span",{children:e.lastError.message})]}):null]})}function W({jobs:e}){let{visibleCount:n,showAll:s,setShowAll:l}=D(e.length),a=e.slice(0,n),r=e.length-a.length;return(0,t.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-jobs-heading",children:"Indexing Job History"})}),0===e.length?(0,t.jsx)("p",{className:"lkd-empty-note",children:"No indexing jobs recorded yet."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{className:"lkd-list","aria-label":"Indexing job history",children:a.map(e=>(0,t.jsx)(z,{job:e},e.id))}),(0,t.jsx)(R,{hiddenCount:r,noun:"jobs",showAll:s,onToggle:()=>l(!s)})]})]})}e.s(["CapsuleDetail",0,function({capsuleId:e,onDeleted:n,fetchDetailImpl:a}={}){let i=(0,s.useSearchParams)(),o=(0,s.useRouter)(),c=e??i.get("capsuleId")??"",{data:d,loadStatus:u,loadError:h,reload:p}=(0,r.useCapsuleDetail)(c,a);return"loading"===u?(0,t.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading capsule…"}):"error"===u||null===d?""===c?(0,t.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["No capsule selected. Open a capsule from the Local Knowledge overview.",(0,t.jsx)(l.default,{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to Local Knowledge"})]}):h?.includes("NOT_FOUND")===!0||h?.toLowerCase().includes("not found")===!0?(0,t.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["This capsule no longer exists. Return to the Local Knowledge overview.",(0,t.jsx)(l.default,{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to capsules"})]}):(0,t.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[h??"Failed to load capsule.",(0,t.jsx)("button",{type:"button",onClick:p,"aria-label":"Retry loading capsule detail",className:"lk-alert-retry",children:"Retry"})]}):(0,t.jsxs)("div",{className:"lkd-content",children:[(0,t.jsxs)("header",{className:"lk-header",children:[(0,t.jsx)("h1",{className:"lk-title",children:d.capsule.displayName}),(0,t.jsx)(w,{capsuleId:c,displayName:d.capsule.displayName,...void 0!==d.capsule.description?{description:d.capsule.description}:{},onRenamed:p})]}),(0,t.jsx)(M,{capsuleId:c,capsuleDisplayName:d.capsule.displayName,sourceCount:d.sources.length,lifecycleState:d.capsule.lifecycleState,onActionComplete:p,onDeleted:function(e){void 0!==n?n(e):o.push("/local-knowledge")}}),(0,t.jsx)(P,{data:d}),(0,t.jsx)(H,{data:d}),(0,t.jsx)(F,{}),(0,t.jsx)(U,{sources:d.sources}),(0,t.jsx)(K,{diagnostics:d.parserDiagnostics}),(0,t.jsx)(W,{jobs:d.indexingJobs})]})}],80010)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,n)=>{t.exports=e.r(76562)},95057,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s={formatUrl:function(){return i},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};for(var l in s)Object.defineProperty(n,l,{enumerable:!0,get:s[l]});let a=e.r(90809)._(e.r(98183)),r=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:n}=e,s=e.protocol||"",l=e.pathname||"",i=e.hash||"",o=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),o&&"object"==typeof o&&(o=String(a.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return s&&!s.endsWith(":")&&(s+=":"),e.slashes||(!s||r.test(s))&&!1!==c?(c="//"+(c||""),l&&"/"!==l[0]&&(l="/"+l)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),d&&"?"!==d[0]&&(d="?"+d),l=l.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${s}${c}${l}${d}${i}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return i(e)}},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return l}});let s=e.r(71645);function l(e,t){let n=(0,s.useRef)(null),l=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=n.current;e&&(n.current=null,e());let t=l.current;t&&(l.current=null,t())}else e&&(n.current=a(e,s)),t&&(l.current=a(t,s))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return a}});let s=e.r(18967),l=e.r(52817);function a(e){if(!(0,s.isAbsoluteUrl)(e))return!0;try{let t=(0,s.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,l.hasBasePath)(n.pathname)}catch(e){return!1}}},84508,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"errorOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},22016,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s={default:function(){return g},useLinkStatus:function(){return y}};for(var l in s)Object.defineProperty(n,l,{enumerable:!0,get:s[l]});let a=e.r(90809),r=e.r(43476),i=a._(e.r(71645)),o=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),h=e.r(5550);e.r(33525);let p=e.r(88540),f=e.r(91949),x=e.r(73668),m=e.r(9396);function g(t){var n,s;let l,a,g,[y,k]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),b=(0,i.useRef)(null),{href:v,as:N,children:S,prefetch:M=null,passHref:C,replace:w,shallow:A,scroll:E,onClick:L,onMouseEnter:$,onTouchStart:T,legacyBehavior:D=!1,onNavigate:R,transitionTypes:O,ref:I,unstable_dynamicOnHover:P,..._}=t;l=S,D&&("string"==typeof l||"number"==typeof l)&&(l=(0,r.jsx)("a",{children:l}));let H=i.default.useContext(c.AppRouterContext),U=!1!==M,F=!1!==M?null===(s=M)||"auto"===s?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,V="string"==typeof(n=N||v)?n:(0,o.formatUrl)(n);if(D){if(l?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(l)}let B=D?a&&"object"==typeof a&&a.ref:I,J=i.default.useCallback(e=>(null!==H&&(b.current=(0,f.mountLinkInstance)(e,V,H,F,U,k)),()=>{b.current&&((0,f.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,f.unmountPrefetchableInstance)(e)}),[U,V,H,F,k]),K={ref:(0,d.useMergedRef)(J,B),onClick(t){D||"function"!=typeof L||L(t),D&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!H||t.defaultPrevented||function(t,n,s,l,a,r,o){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,x.isLocalURL)(n)){l&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),r){let e=!1;if(r({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);i.default.startTransition(()=>{u(n,l?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,s.current,o)})}}(t,V,b,w,E,R,O)},onMouseEnter(e){D||"function"!=typeof $||$(e),D&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),H&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){D||"function"!=typeof T||T(e),D&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),H&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,u.isAbsoluteUrl)(V)?K.href=V:D&&!C&&("a"!==a.type||"href"in a.props)||(K.href=(0,h.addBasePath)(V)),g=D?i.default.cloneElement(a,K):(0,r.jsx)("a",{..._,...K,children:l}),(0,r.jsx)(j.Provider,{value:y,children:g})}e.r(84508);let j=(0,i.createContext)(f.IDLE_LINK_STATUS),y=()=>(0,i.useContext)(j);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},96688,e=>{"use strict";e.s(["STATUS_LABELS",0,{draft:"Draft",indexing:"Indexing",ready:"Indexed",stale:"Stale",deleting:"Deleting",error:"Failed"}])},76055,66702,e=>{"use strict";let t,n,s={maxConnectedSources:16,maxLocalKnowledgeSources:16,maxPromptReferences:8,maxExcerptChars:900,referenceBudget:10,hybridMaxCandidates:24,hybridMaxExcerptBytes:131072};s.maxConnectedSources,s.maxLocalKnowledgeSources,e.s(["DEFAULT_GROUNDING_LIMITS",0,s],66702);class l extends Error{code;status;constructor(e,t,n){super(t),this.code=e,this.status=n,this.name="ApiError"}}async function a(e,t){let n=(t?.method??"GET").toUpperCase(),s=await fetch(e,{...t,headers:{Accept:"application/json",...t?.body!==void 0?{"Content-Type":"application/json"}:{},..."GET"===n||"HEAD"===n?{}:{"X-Keiko-CSRF":"1"},...t?.headers??{}}});if(!s.ok){let e="INTERNAL",t=`HTTP ${s.status.toString()}`;try{let n=await s.json();e=n.error.code,t=n.error.message}catch{}throw new l(e,t,s.status)}if(204!==s.status)return s.json()}async function r(){return a("/api/health")}async function i(){let e=await a("/api/config");return{config:e.config,configPresent:e.configPresent,effectiveGroundingLimits:e.effectiveGroundingLimits??s}}async function o(){return t??=a("/api/models").catch(e=>{throw t=void 0,e})}async function c(e){let n=await a("/api/gateway/setup",{method:"POST",body:JSON.stringify(e)});return t=void 0,n}async function d(e){return a("/api/runs",{method:"POST",body:JSON.stringify(e)})}async function u(e){return a("/api/chats/runs",{method:"POST",body:JSON.stringify(e)})}async function h(e){return a("/api/chats/messages/grounded/handoff",{method:"POST",body:JSON.stringify(e)})}async function p(e){return a(`/api/runs/${encodeURIComponent(e)}/cancel`,{method:"POST",body:JSON.stringify({confirm:!0})})}async function f(e){return a(`/api/runs/${encodeURIComponent(e)}`)}async function x(e){return a(`/api/runs/${encodeURIComponent(e)}/apply`,{method:"POST",body:JSON.stringify({confirm:!0})})}async function m(e){return a(`/api/evidence/${encodeURIComponent(e)}`)}async function g(){return n??=a("/api/projects").finally(()=>{n=void 0})}async function j(e){return a("/api/projects",{method:"POST",body:JSON.stringify(e)})}async function y(e){return a(`/api/chats?projectPath=${encodeURIComponent(e)}`)}async function k(e,t){return a(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function b(e,t){return a(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({connectedScopes:t})})}async function v(e,t){return a(`/api/chats?id=${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({localKnowledgeScopes:t})})}async function N(e,t){let n=new URLSearchParams;return n.set("chatId",e),n.set("projectPath",t),a(`/api/chats/messages?${n.toString()}`)}async function S(e={}){return a("/api/desktop/chats",{method:"POST",body:JSON.stringify(e)})}async function M(e,t){return a("/api/desktop/chat",{method:"POST",body:JSON.stringify(e),signal:t??null})}class C extends Error{code;constructor(e,t){super(t),this.code=e,this.name="StreamingUnavailableError"}}function w(e,t,n){let s=t;for(let t of e){let e=t.trimEnd();if(e.startsWith("event:"))s=e.slice(6).trim();else if(e.startsWith("data:")){let t,l=e.slice(5).trim();try{t=JSON.parse(l)}catch{continue}!function(e,t,n){switch(e){case"token":{let e=function(e){if("object"==typeof e&&null!==e&&"text"in e&&"string"==typeof e.text)return e}(t);void 0!==e&&n.onToken(e.text);break}case"done":{let e=function(e){if("object"==typeof e&&null!==e&&"chat"in e&&"messages"in e)return e}(t);void 0!==e&&n.onDone(e);break}case"error":{let e=function(e){if("object"==typeof e&&null!==e&&"code"in e&&"message"in e&&"string"==typeof e.code&&"string"==typeof e.message)return e}(t);void 0!==e&&n.onError(e);break}case"cancelled":n.onCancelled()}}(s,t,n),s=void 0}else""===e&&(s=void 0)}return s}async function A(e,t,n){let s,l=e.getReader(),a=new TextDecoder,r="",i=!1;try{for(;!t.aborted;){let e=await l.read();if(e.done){i=!0;break}let t=(r+=a.decode(e.value,{stream:!0})).split("\n");r=t.pop()??"",s=w(t,s,n)}i&&""!==r&&w([r],s,n)}finally{l.releaseLock()}}async function E(e,t,n){let s=await fetch("/api/desktop/chat/stream",{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json","X-Keiko-CSRF":"1"},body:JSON.stringify(e),signal:t});if(!(s.headers.get("content-type")??"").includes("text/event-stream")){let e="STREAMING_UNSUPPORTED",t=`HTTP ${s.status.toString()}`;try{let n=await s.json();e=n.error?.code??e,t=n.error?.message??t}catch{}throw new C(e,t)}if(null===s.body)throw new C("STREAMING_UNSUPPORTED","Response body was null.");await A(s.body,t,n)}async function L(e,t){let n=new URLSearchParams;return n.set("root",e),void 0!==t&&t.length>0&&n.set("path",t),a(`/api/files/directories?${n.toString()}`)}async function $(e,t=""){let n=new URLSearchParams;return n.set("root",e),t.length>0&&n.set("path",t),a(`/api/files/tree?${n.toString()}`)}async function T(e,t){let n=new URLSearchParams;return n.set("root",e),n.set("path",t),a(`/api/files/preview?${n.toString()}`)}async function D(e,t){let n=new URLSearchParams;return n.set("root",e),n.set("path",t),a(`/api/files/content?${n.toString()}`)}async function R(e){return a("/api/files/content",{method:"PATCH",body:JSON.stringify(e)})}async function O(e,t){return a("/api/chats/messages/grounded",{method:"POST",body:JSON.stringify(e),signal:t??null})}e.s(["ApiError",0,l,"StreamingUnavailableError",0,C,"applyRun",0,x,"askGrounded",0,O,"cancelRun",0,p,"createDesktopChat",0,S,"createProject",0,j,"fetchChatMessages",0,N,"fetchChats",0,y,"fetchConfig",0,i,"fetchEvidenceManifest",0,m,"fetchFilesContent",0,D,"fetchFilesDirectories",0,L,"fetchFilesPreview",0,T,"fetchFilesTree",0,$,"fetchHealth",0,r,"fetchModels",0,o,"fetchProjects",0,g,"fetchRunReport",0,f,"saveFilesContent",0,R,"sendDesktopChat",0,M,"sendDesktopChatStream",0,E,"setupGateway",0,c,"startChatRun",0,u,"startGroundedWorkflowHandoff",0,h,"startRun",0,d,"updateChat",0,k,"updateChatConnectedScopes",0,b,"updateChatLocalKnowledgeScopes",0,v],76055)},61593,e=>{"use strict";var t=e.i(76055);function n(e,t){let n={Accept:"application/json"};return null!=t&&(n["Content-Type"]="application/json"),"GET"!==e&&"HEAD"!==e&&(n["X-Keiko-CSRF"]="1"),n}async function s(e){try{let t=await e.json();return{code:t.error.code,message:t.error.message}}catch{return{code:"INTERNAL",message:`The server returned an unexpected error (HTTP ${e.status.toString()}). Try again.`}}}async function l(e,l){let a=(l?.method??"GET").toUpperCase(),r=await fetch(e,{...l,headers:n(a,l?.body)});if(!r.ok){let{code:e,message:n}=await s(r);throw new t.ApiError(e,n,r.status)}if(204!==r.status)return r.json()}async function a(){return l("/api/local-knowledge/capsules")}async function r(){return l("/api/local-knowledge/capsule-sets")}async function i(e){return l("/api/local-knowledge/capsules",{method:"POST",body:JSON.stringify(e)})}async function o(e){return l("/api/local-knowledge/capsule-sets",{method:"POST",body:JSON.stringify(e)})}async function c(e,t){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}async function d(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"POST",body:JSON.stringify({confirm:!0})})}async function u(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/index`,{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function h(e,t,n){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"POST",body:JSON.stringify({scope:t,displayName:n})})}async function p(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/connection`,{method:"DELETE",body:JSON.stringify({confirm:!0})})}async function f(e,l=fetch){let a=`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,r=await l(a,{headers:n("GET",void 0)});if(!r.ok){let{code:e,message:n}=await s(r);throw new t.ApiError(e,n,r.status)}return r.json()}async function x(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}`,{method:"DELETE",body:JSON.stringify({capsuleId:e,deleteIndex:!0,deleteSources:!1})})}async function m(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"changed-files"})})}async function g(e){return l(`/api/local-knowledge/capsules/${encodeURIComponent(e)}/reindex`,{method:"POST",body:JSON.stringify({capsuleId:e,mode:"repair-failed"})})}e.s(["cancelIndexing",0,u,"connectCapsuleSource",0,h,"createCapsule",0,i,"createCapsuleSet",0,o,"deleteCapsule",0,x,"disconnectCapsule",0,p,"fetchCapsuleDetail",0,f,"fetchCapsuleSets",0,r,"fetchCapsules",0,a,"refreshCapsuleChangedFiles",0,m,"renameCapsule",0,c,"repairCapsuleFailedFiles",0,g,"startIndexing",0,d])},69128,61774,e=>{"use strict";var t=e.i(71645),n=e.i(61593),s=e.i(76055);function l(e){return e instanceof s.ApiError?e.message.trim().length>0?`${e.message} (${e.code})`:`Something went wrong. Try again. (${e.code})`:e instanceof Error&&e.message.trim().length>0?e.message:"An unexpected error occurred."}e.s(["formatError",0,l],61774),e.s(["useCapsuleDetail",0,function(e,s=n.fetchCapsuleDetail){let[a,r]=(0,t.useState)(null),[i,o]=(0,t.useState)("loading"),[c,d]=(0,t.useState)(null),u=(0,t.useCallback)(async(t={})=>{if(""===e){r(null),d("No capsule selected."),o("error");return}!0!==t.quiet&&(o("loading"),d(null));try{let t=await s(e);r(t),o("ready")}catch(e){if(!0===t.quiet)return;d(l(e)),o("error")}},[e,s]);return(0,t.useEffect)(()=>{u()},[u]),(0,t.useEffect)(()=>{let e=a?.indexingJobs[0];if(a?.capsule.lifecycleState!=="indexing"&&e?.status!=="queued"&&e?.status!=="running")return;let t=window.setInterval(()=>{u({quiet:!0})},2e3);return()=>window.clearInterval(t)},[a?.capsule.lifecycleState,a?.indexingJobs,u]),{data:a,loadStatus:i,loadError:c,reload:function(){u()}}}],69128)},83449,e=>{"use strict";e.s(["costClassLabel",0,function(e){switch(e){case"low":return"Low cost";case"medium":return"Medium cost";case"high":return"High cost";case"unknown":return"Unknown cost"}},"formatBytes",0,function(e){return e<1024?`${e.toString()} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(1)} GB`},"formatDate",0,function(e){try{return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return"string"==typeof e?e:e.toString()}},"formatMs",0,function(e){if(e<1e3)return`${e.toString()} ms`;if(e<6e4)return`${(e/1e3).toFixed(1)} s`;let t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t.toString()}m ${n.toString()}s`},"formatTokens",0,function(e){return e<1e3?e.toString():`${(e/1e3).toFixed(1)}k`},"outcomeLabel",0,function(e){switch(e){case"fix-applied":return"Fix applied";case"fix-proposed":return"Fix proposed (dry-run)";case"investigation-only":return"Investigation only";case"limit-exceeded":return"Limit exceeded";case"dry-run":return"Dry-run";default:return e.charAt(0).toUpperCase()+e.slice(1)}},"runStatusLabel",0,function(e){return({running:"Running",completed:"Completed","dry-run":"Dry run",rejected:"Rejected",cancelled:"Cancelled",failed:"Failed","fix-applied":"Fix applied","fix-proposed":"Fix proposed","investigation-only":"Investigation only"})[e]??e}])},20316,e=>{"use strict";e.s(["LOCAL_KNOWLEDGE_MAX_FILE_BYTES",0,0x40000000,"LOCAL_KNOWLEDGE_MAX_OBJECTS_PER_DOCUMENT",0,25e6,"LOCAL_KNOWLEDGE_PARSER_TIMEOUT_MS",0,36e5])},17161,e=>{"use strict";var t=e.i(43476);function n({size:e=18,sw:s=1.6,vb:l=24,fill:a,style:r,children:i,d:o}){let c=void 0!==a;return(0,t.jsx)("svg",{width:e,height:e,viewBox:`0 0 ${String(l)} ${String(l)}`,fill:c?a:"none",stroke:c?"none":"currentColor",strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round",style:r,"aria-hidden":"true",children:void 0!==o?(0,t.jsx)("path",{d:o}):i})}e.s(["Icons",0,{newChat:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M4 6 H12.5"}),(0,t.jsx)("path",{d:"M4 9.5 H9.5"}),(0,t.jsx)("path",{d:"M14.4 13.6 l4-4 a1.6 1.6 0 0 1 2.3 2.3 l-6.2 6.2 -3 .7 .7 -3 z"})]}),search:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M12.25 4.76 A6 6 0 1 1 8.75 4.76"}),(0,t.jsx)("path",{d:"M14.7 14.7 L20 20"})]}),plugins:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,t.jsx)("rect",{x:"13.5",y:"4",width:"6.5",height:"6.5",rx:"1.5"}),(0,t.jsx)("rect",{x:"4",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"}),(0,t.jsx)("rect",{x:"13.5",y:"13.5",width:"6.5",height:"6.5",rx:"1.5"})]}),automations:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"8"}),(0,t.jsx)("path",{d:"M12 7.5V12l3 2"})]}),mobile:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"7",y:"3",width:"10",height:"18",rx:"2.5"}),(0,t.jsx)("path",{d:"M11 18h2"})]}),folder:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M3.6 7.4 V6.3 a1.5 1.5 0 0 1 1.5-1.5 H8 a1.5 1.5 0 0 1 1.1 .48 L10.3 7.4"}),(0,t.jsx)("path",{d:"M13.50 7.40 H18.00 A2.4 2.4 0 0 1 20.40 9.80 V16.00 A2.4 2.4 0 0 1 18.00 18.40 H6.00 A2.4 2.4 0 0 1 3.60 16.00 V9.80 A2.4 2.4 0 0 1 6.00 7.40 H10.50"})]}),settings:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.25 9.83 A2.5 2.5 0 1 1 10.75 9.83"}),(0,t.jsx)("path",{d:"M16.00 12.00 L18.60 12.00 M14.83 14.83 L16.67 16.67 M12.00 16.00 L12.00 18.60 M9.17 14.83 L7.33 16.67 M8.00 12.00 L5.40 12.00 M9.17 9.17 L7.33 7.33 M12.00 8.00 L12.00 5.40 M14.83 9.17 L16.67 7.33"})]}),files:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,t.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),browser:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"8.5"}),(0,t.jsx)("path",{d:"M3.5 12h17M12 3.5c2.3 2.3 2.3 14.7 0 17M12 3.5c-2.3 2.3-2.3 14.7 0 17"})]}),review:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9 12l2 2 4-4"}),(0,t.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"})]}),terminal:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.70 5.00 H17.50 A2.5 2.5 0 0 1 20.00 7.50 V16.50 A2.5 2.5 0 0 1 17.50 19.00 H6.50 A2.5 2.5 0 0 1 4.00 16.50 V7.50 A2.5 2.5 0 0 1 6.50 5.00 H10.30"}),(0,t.jsx)("path",{d:"M8 9.6 L11 12.6 L8 15.6"}),(0,t.jsx)("path",{d:"M12.8 15.6 H16.4"})]}),agents:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"5",y:"7",width:"14",height:"11",rx:"3"}),(0,t.jsx)("path",{d:"M12 7V4M9 12h.01M15 12h.01M2.5 12.5v2M21.5 12.5v2"})]}),git:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,t.jsx)("circle",{cx:"6",cy:"18",r:"2.5"}),(0,t.jsx)("circle",{cx:"17",cy:"9",r:"2.5"}),(0,t.jsx)("path",{d:"M6 8.5v7M17 11.5c0 3-3 3.5-6 4"})]}),plus:e=>(0,t.jsx)(n,{...e,d:"M12 5v14M5 12h14"}),chevron:e=>(0,t.jsx)(n,{...e,d:"M6 9l6 6 6-6"}),chevronR:e=>(0,t.jsx)(n,{...e,d:"M9 6l6 6-6 6"}),mic:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M12 3.2 a3 3 0 0 1 3 3 V11 a3 3 0 0 1 -6 0 V6.2 a3 3 0 0 1 2 -2.8"}),(0,t.jsx)("path",{d:"M5.5 11.5 a6.5 6.5 0 0 0 13 0 M12 18 v3"})]}),arrowUp:e=>(0,t.jsx)(n,{...e,d:"M12 19V5M6 11l6-6 6 6"}),spark:e=>(0,t.jsx)(n,{...e,d:"M13.2 3.6 L19 10 l-5.2 1.4 L12 17 l-1.8 -5.6 L5 10 l5.2 -1.4 z"}),pin:e=>(0,t.jsx)(n,{...e,d:"M9 3h6l-1 5 3 3-5 1-1 8-1-8-5-1 3-3z"}),brain:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"}),(0,t.jsx)("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"})]}),archive:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.20 5.00 H19.50 A1 1 0 0 1 20.50 6.00 V8.00 A1 1 0 0 1 19.50 9.00 H4.50 A1 1 0 0 1 3.50 8.00 V6.00 A1 1 0 0 1 4.50 5.00 H10.80"}),(0,t.jsx)("path",{d:"M5 9 v8 a2 2 0 0 0 2 2 h10 a2 2 0 0 0 2-2 V9"}),(0,t.jsx)("path",{d:"M10 13 h4"})]}),sidebar:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,t.jsx)("path",{d:"M9.5 5 V19"})]}),minimize:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M7 14 H10.4"}),(0,t.jsx)("path",{d:"M13.6 14 H17"})]}),expand:e=>(0,t.jsx)(n,{...e,d:"M4 9V4h5M20 15v5h-5M20 9V4h-5M4 15v5h5"}),back:e=>(0,t.jsx)(n,{...e,d:"M15 6l-6 6 6 6"}),fwd:e=>(0,t.jsx)(n,{...e,d:"M9 6l6 6-6 6"}),drag:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"9",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"6",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"9",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"12",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"9",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"18",r:"1.1",fill:"currentColor",stroke:"none"})]}),close:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M7 7 L10.4 10.4"}),(0,t.jsx)("path",{d:"M17 7 L13.6 10.4"}),(0,t.jsx)("path",{d:"M7 17 L10.4 13.6"}),(0,t.jsx)("path",{d:"M17 17 L13.6 13.6"})]}),dots:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"6",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"18",cy:"12",r:"1.3",fill:"currentColor",stroke:"none"})]}),check:e=>(0,t.jsx)(n,{...e,d:"M5 12.5l4.5 4.5L19 6.5"}),reset:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M4 12a8 8 0 1 1 2.3 5.6"}),(0,t.jsx)("path",{d:"M4 20v-4h4"})]}),file:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M5.5 8 V5.5 a1.9 1.9 0 0 1 1.9-1.9 H12.8 L18.5 8.8 V18.5 a1.9 1.9 0 0 1-1.9 1.9 H7.4 a1.9 1.9 0 0 1-1.9-1.9 V11"}),(0,t.jsx)("path",{d:"M12.8 3.6 V7.4 a1.4 1.4 0 0 0 1.4 1.4 H18.5"})]}),diff:e=>(0,t.jsx)(n,{...e,d:"M12 4v6M9 7h6M5 17h14"}),branch:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M7.63 4.97 A2.3 2.3 0 1 1 4.37 4.97"}),(0,t.jsx)("circle",{cx:"6",cy:"17.4",r:"2.3"}),(0,t.jsx)("circle",{cx:"17.4",cy:"8.6",r:"2.3"}),(0,t.jsx)("path",{d:"M6 8.9 V15.1"}),(0,t.jsx)("path",{d:"M17.4 10.9 c0 4 -4 3.7 -7 4.7"})]}),cube:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9z"}),(0,t.jsx)("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5"})]}),maximize:e=>(0,t.jsx)(n,{...e,d:"M13.50 7.00 H15.00 A2 2 0 0 1 17.00 9.00 V15.00 A2 2 0 0 1 15.00 17.00 H9.00 A2 2 0 0 1 7.00 15.00 V9.00 A2 2 0 0 1 9.00 7.00 H10.50"}),restore:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9 9 V8 a2 2 0 0 1 2 -2 h6 a2 2 0 0 1 2 2 v6 a2 2 0 0 1 -2 2 h-1"}),(0,t.jsx)("path",{d:"M11.50 9.00 H13.00 A2 2 0 0 1 15.00 11.00 V17.00 A2 2 0 0 1 13.00 19.00 H7.00 A2 2 0 0 1 5.00 17.00 V11.00 A2 2 0 0 1 7.00 9.00 H8.50"})]}),split:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,t.jsx)("path",{d:"M12 5 V19"})]}),tile:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M8.10 4.50 H9.00 A1.5 1.5 0 0 1 10.50 6.00 V10.00 A1.5 1.5 0 0 1 9.00 11.50 H5.00 A1.5 1.5 0 0 1 3.50 10.00 V6.00 A1.5 1.5 0 0 1 5.00 4.50 H5.90"}),(0,t.jsx)("path",{d:"M15.00 4.50 H19.00 A1.5 1.5 0 0 1 20.50 6.00 V10.00 A1.5 1.5 0 0 1 19.00 11.50 H15.00 A1.5 1.5 0 0 1 13.50 10.00 V6.00 A1.5 1.5 0 0 1 15.00 4.50 Z"}),(0,t.jsx)("path",{d:"M5.00 13.50 H9.00 A1.5 1.5 0 0 1 10.50 15.00 V19.00 A1.5 1.5 0 0 1 9.00 20.50 H5.00 A1.5 1.5 0 0 1 3.50 19.00 V15.00 A1.5 1.5 0 0 1 5.00 13.50 Z"}),(0,t.jsx)("path",{d:"M15.00 13.50 H19.00 A1.5 1.5 0 0 1 20.50 15.00 V19.00 A1.5 1.5 0 0 1 19.00 20.50 H15.00 A1.5 1.5 0 0 1 13.50 19.00 V15.00 A1.5 1.5 0 0 1 15.00 13.50 Z"})]}),cascade:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"12",height:"12",rx:"2"}),(0,t.jsx)("path",{d:"M20 8v10a2 2 0 0 1-2 2H8"})]}),editor:e=>(0,t.jsx)(n,{...e,children:(0,t.jsx)("path",{d:"M8 9l-3 3 3 3M16 9l3 3-3 3M13.5 6l-3 12"})}),gear:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"2.6"}),(0,t.jsx)("path",{d:"M12 3.5v2M12 18.5v2M20.5 12h-2M5.5 12h-2M18 6l-1.4 1.4M7.4 16.6 6 18M18 18l-1.4-1.4M7.4 7.4 6 6"})]}),panelRight:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.50 4.50 H18.00 A2.5 2.5 0 0 1 20.50 7.00 V17.00 A2.5 2.5 0 0 1 18.00 19.50 H6.00 A2.5 2.5 0 0 1 3.50 17.00 V7.00 A2.5 2.5 0 0 1 6.00 4.50 H10.50"}),(0,t.jsx)("path",{d:"M14.5 5 V19"})]}),layers:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.4 4.55 L19.6 8 L12 12.2 L4.4 8 L10.6 4.55"}),(0,t.jsx)("path",{d:"M4.4 12 L12 16.2 L19.6 12"}),(0,t.jsx)("path",{d:"M4.4 16 L12 20.2 L19.6 16"})]}),tokens:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"9",cy:"9",r:"4.5"}),(0,t.jsx)("path",{d:"M14 9.5a4.5 4.5 0 1 1-4 6.9"})]}),bolt:e=>(0,t.jsx)(n,{...e,d:"M13 3 5 13h5l-1 8 8-10h-5z"}),add:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"3.5"}),(0,t.jsx)("path",{d:"M12 8.5v7M8.5 12h7"})]}),bell:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M9.8 4.6 a5.5 5.5 0 0 1 7.7 4.4 c0 4.5 2 5.5 2 5.5 H4.5 s2 -1 2 -5.5 a5.5 5.5 0 0 1 1.1 -3.3"}),(0,t.jsx)("path",{d:"M10 19 a2 2 0 0 0 4 0"})]}),sun:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.17 8.17 A4 4 0 1 1 10.83 8.17"}),(0,t.jsx)("path",{d:"M12 2.5 V5 M12 19 V21.5 M2.5 12 H5 M19 12 H21.5 M5.1 5.1 L6.9 6.9 M17.1 17.1 l1.8 1.8 M18.9 5.1 L17.1 6.9 M6.9 17.1 L5.1 18.9"})]}),moon:e=>(0,t.jsx)(n,{...e,d:"M19.5 13.5 A8 8 0 1 1 10.5 4.2 a6.5 6.5 0 0 0 9.3 9.1"}),zoomOut:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,t.jsx)("path",{d:"M20 20l-4.2-4.2M8.3 11h5.4"})]}),zoomIn:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"6.5"}),(0,t.jsx)("path",{d:"M20 20l-4.2-4.2M11 8.3v5.4M8.3 11h5.4"})]}),activity:e=>(0,t.jsx)(n,{...e,d:"M3 12h3l2.5-7 5 14 2.5-7H21"}),user:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.35 4.66 A3.6 3.6 0 1 1 10.65 4.66"}),(0,t.jsx)("path",{d:"M5.5 20 c.9 -3.7 3.4 -5.5 6.5 -5.5 s5.6 1.8 6.5 5.5"})]}),localKnowledge:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M4 19V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12"}),(0,t.jsx)("path",{d:"M4 19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}),(0,t.jsx)("path",{d:"M9 7v14M9 11h6"})]}),server:e=>(0,t.jsxs)(n,{...e,children:[(0,t.jsx)("path",{d:"M13.30 4.50 H18.30 A1.7 1.7 0 0 1 20.00 6.20 V8.80 A1.7 1.7 0 0 1 18.30 10.50 H5.70 A1.7 1.7 0 0 1 4.00 8.80 V6.20 A1.7 1.7 0 0 1 5.70 4.50 H10.70"}),(0,t.jsx)("path",{d:"M5.70 13.50 H18.30 A1.7 1.7 0 0 1 20.00 15.20 V17.80 A1.7 1.7 0 0 1 18.30 19.50 H5.70 A1.7 1.7 0 0 1 4.00 17.80 V15.20 A1.7 1.7 0 0 1 5.70 13.50 Z"}),(0,t.jsx)("path",{d:"M7.4 7.5 h.01 M7.4 16.5 h.01 M12 7.5 H16 M12 16.5 H16"})]})}])},80010,e=>{"use strict";var t=e.i(43476),n=e.i(71645),s=e.i(18566),l=e.i(22016),a=e.i(96688),r=e.i(69128),i=e.i(74080),o=e.i(61593),c=e.i(76055),d=e.i(83449),u=e.i(20316),h=e.i(17161),p=e.i(61774);function f(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%"}function x(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),s=t%60;return 0===n?`${s.toString()}s`:`${n.toString()}m ${s.toString().padStart(2,"0")}s`}function m(e=Date.now()){return{detail:null,startedAt:e,now:e,pollError:null}}function g(){return`Maximum single file size: ${(0,d.formatBytes)(u.LOCAL_KNOWLEDGE_MAX_FILE_BYTES)}. Parser budget: ${u.LOCAL_KNOWLEDGE_MAX_OBJECTS_PER_DOCUMENT.toLocaleString("en-US")} objects, ${function(e){let t=Math.round(e/6e4);if(t<60)return`${t.toString()} min`;let n=t/60;return`${n.toString()} h`}(u.LOCAL_KNOWLEDGE_PARSER_TIMEOUT_MS)} per document.`}function j(e){return Array.from(new Set(e.split(/\r?\n/u).map(e=>e.trim()).filter(e=>e.length>0)))}function y({scopeKind:e,initialRootPath:s,initialFilesInput:l,onApply:a,onCancel:r,fetchProjectsImpl:o=c.fetchProjects,fetchFilesTreeImpl:f=c.fetchFilesTree}){let x=(0,n.useRef)(null);b(x,!0,r);let[m,k]=(0,n.useState)([]),[v,N]=(0,n.useState)(s.trim()),[S,M]=(0,n.useState)(s.trim()),[C,w]=(0,n.useState)(null),[A,E]=(0,n.useState)([]),[L,$]=(0,n.useState)(()=>new Set(j(l))),[T,D]=(0,n.useState)(!1),[R,O]=(0,n.useState)(null);function I(e){let t=e.trim();0!==t.length&&($(new Set),w(null),N(t))}(0,n.useEffect)(()=>{let e=!1;return o().then(t=>{if(e)return;let n=t.projects.filter(e=>e.available);k(n),0===v.length&&void 0!==n[0]&&(N(n[0].path),M(n[0].path))}).catch(()=>{e||k([])}),()=>{e=!0}},[v.length,o]),(0,n.useEffect)(()=>{if(0===v.length){E([]),O(null);return}let e=!1;return D(!0),O(null),f(v,C??"").then(t=>{e||(E(t.entries),N(t.root),M(t.root))}).catch(t=>{e||(E([]),O((0,p.formatError)(t)))}).finally(()=>{e||D(!1)}),()=>{e=!0}},[v,C,f]);let P=function(e,t){if(null===t||0===t.length)return e;let n=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e.replace(/[/\\]+$/u,"")}${n}${t.replace(/\//gu,n)}`}(v,C),_=Array.from(L).join("\n"),H=L.size>0,U="files"===e||H?v.length>0&&L.size>0:v.length>0;return(0,i.createPortal)((0,t.jsx)("div",{className:"dlg-overlay in",role:"presentation",children:(0,t.jsxs)("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":"lkd-source-picker-title","aria-describedby":"lkd-source-picker-desc",className:"dlg lkd-source-picker",tabIndex:-1,children:[(0,t.jsx)("div",{className:"dlg-head",children:(0,t.jsxs)("div",{className:"dlg-htext",children:[(0,t.jsx)("div",{id:"lkd-source-picker-title",className:"dlg-title",children:"Choose local source"}),(0,t.jsxs)("div",{id:"lkd-source-picker-desc",className:"dlg-sub",children:["Select a local ","files"===e?"file or files":"folder"," for this capsule."]}),(0,t.jsx)("div",{className:"dlg-sub",children:g()})]})}),(0,t.jsxs)("div",{className:"dlg-body lkd-source-picker-body",children:[m.length>0?(0,t.jsx)("div",{className:"lkd-picker-projects","aria-label":"Registered project folders",children:m.map(e=>(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:()=>{M(e.path),I(e.path)},children:e.name??e.path},e.path))}):null,(0,t.jsxs)("form",{className:"lkd-picker-root",onSubmit:e=>{e.preventDefault(),I(S)},children:[(0,t.jsx)("label",{htmlFor:"lkd-picker-root-input",className:"dlg-label",children:"Folder root"}),(0,t.jsx)("input",{id:"lkd-picker-root-input",type:"text",className:"dlg-input lkd-connect-input",value:S,placeholder:"/absolute/path/to/folder",onChange:e=>M(e.target.value)}),(0,t.jsx)("button",{type:"submit",className:"lk-btn lk-btn-ghost",children:"Open"})]}),(0,t.jsxs)("div",{className:"lkd-picker-current",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:null===C,onClick:()=>w(function(e){if(null===e||0===e.length)return null;let t=e.replace(/\/+$/u,""),n=t.lastIndexOf("/");if(n<0)return null;let s=t.slice(0,n);return s.length>0?s:null}(C)),children:"Up"}),(0,t.jsx)("span",{className:"mono",title:P,children:P||"No folder selected"})]}),null!==R?(0,t.jsx)("div",{role:"alert",className:"lk-alert",children:R}):null,T?(0,t.jsx)("p",{role:"status",className:"lk-loading",children:"Loading folder…"}):(0,t.jsxs)("ul",{className:"lkd-picker-list","aria-label":"Local source browser",children:[A.map(e=>{let n="file"===e.kind&&e.sizeBytes>u.LOCAL_KNOWLEDGE_MAX_FILE_BYTES,s=!e.readable||n,l=n?`File is ${(0,d.formatBytes)(e.sizeBytes)}; maximum is ${(0,d.formatBytes)(u.LOCAL_KNOWLEDGE_MAX_FILE_BYTES)}.`:"File is not readable.";return(0,t.jsx)("li",{className:"lkd-picker-entry",children:"directory"===e.kind?(0,t.jsxs)("button",{type:"button",className:"lkd-picker-row",disabled:!e.readable,onClick:()=>{$(new Set),w(e.path)},children:[(0,t.jsx)(h.Icons.folder,{size:14}),(0,t.jsx)("span",{children:e.name})]}):(0,t.jsxs)("label",{className:"lkd-picker-row","data-disabled":String(s),title:s?l:void 0,children:[(0,t.jsx)("input",{type:"checkbox",disabled:s,checked:L.has(e.path),onChange:()=>{var t;return t=e.path,void $(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}}),(0,t.jsx)("span",{children:e.name}),(0,t.jsxs)("span",{className:"lkd-picker-meta",children:[(0,d.formatBytes)(e.sizeBytes),n?" · too large":""]})]})},e.path)}),!T&&0===A.length&&v.length>0?(0,t.jsx)("li",{className:"lkd-picker-empty",children:"No entries in this folder."}):null]})]}),(0,t.jsxs)("div",{className:"dlg-foot",children:[(0,t.jsx)("button",{type:"button",className:"dlg-btn",onClick:r,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"dlg-btn primary",disabled:!U,onClick:()=>{H?a("files",v,_):a(e,P)},children:"Use selection"})]})]})}),document.body)}function k({capsuleId:e,onConnected:s,connectImpl:l=o.connectCapsuleSource}){let[a,r]=(0,n.useState)("folder"),[i,c]=(0,n.useState)(""),[d,u]=(0,n.useState)(""),[f,x]=(0,n.useState)(!1),[m,g]=(0,n.useState)(null),[b,v]=(0,n.useState)(!1),N=function(e,t,n){let s=t.trim();if(""===s)return null;if("folder"===e)return{kind:"folder",rootPath:s,recursive:!0};if("repository"===e)return{kind:"repository",repositoryRoot:s};let l=j(n);return 0===l.length?null:{kind:"files",rootPath:s,files:l}}(a,i,d);async function S(){if(null!==N&&!f){x(!0),g(null);try{await l(e,N),c(""),u(""),s()}catch(e){g((0,p.formatError)(e))}finally{x(!1)}}}return(0,t.jsxs)("div",{className:"lkd-connect-form","aria-label":"Connect a source",children:[(0,t.jsx)("label",{htmlFor:"lkd-connect-kind",className:"lkd-connect-label",children:"Connect source"}),(0,t.jsx)("div",{className:"lkd-connect-row",children:(0,t.jsxs)("span",{className:"dlg-selwrap",children:[(0,t.jsxs)("select",{id:"lkd-connect-kind",className:"dlg-input",value:a,disabled:f,onChange:e=>{r(e.target.value),g(null)},children:[(0,t.jsx)("option",{value:"folder",children:"Folder"}),(0,t.jsx)("option",{value:"repository",children:"Repository"}),(0,t.jsx)("option",{value:"files",children:"Files"})]}),(0,t.jsx)("span",{className:"dlg-selchev",children:(0,t.jsx)(h.Icons.chevron,{size:15})})]})}),(0,t.jsxs)("div",{className:"lkd-connect-row",children:[(0,t.jsx)("label",{htmlFor:"lkd-connect-path-input",className:"dlg-label",children:"repository"===a?"Absolute repository path to connect":"files"===a?"Absolute root path for the selected files":"Absolute folder path to connect"}),(0,t.jsxs)("div",{className:"lkd-connect-path-group",children:[(0,t.jsx)("input",{id:"lkd-connect-path-input",type:"text",className:"dlg-input lkd-connect-input",value:i,disabled:f,placeholder:"repository"===a?"/absolute/path/to/repository":"files"===a?"/absolute/path/to/root":"/absolute/path/to/folder",autoComplete:"off",onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&"files"!==a&&S()}}),(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f,onClick:()=>v(!0),children:"Browse"})]})]}),"files"===a?(0,t.jsxs)("div",{className:"lkd-connect-row",children:[(0,t.jsx)("label",{htmlFor:"lkd-connect-files-input",className:"dlg-label",children:"Relative files to connect"}),(0,t.jsx)("textarea",{id:"lkd-connect-files-input",className:"dlg-input lkd-connect-input",value:d,disabled:f,placeholder:"src/app.ts\nREADME.md",rows:4,onChange:e=>u(e.target.value)})]}):null,(0,t.jsx)("div",{className:"lkd-connect-row",children:(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:f||null===N,"aria-busy":f,onClick:()=>void S(),children:f?"Connecting…":"Connect"})}),null!==m?(0,t.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:m}):null,b?(0,t.jsx)(y,{scopeKind:a,initialRootPath:i,initialFilesInput:d,onApply:(e,t,n)=>{r(e),c(t),void 0!==n?u(n):"files"!==e&&u(""),g(null),v(!1)},onCancel:()=>v(!1)}):null]})}function b(e,t,s){(0,n.useEffect)(()=>{if(!t)return;let e=document.activeElement;return()=>e?.focus?.()},[t]),(0,n.useEffect)(()=>{if(!t)return;let n=e.current;if(null===n)return;let l=n.querySelector("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])");function a(e){if("Escape"===e.key){e.preventDefault(),s();return}if("Tab"!==e.key)return;let t=Array.from(n.querySelectorAll("button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex='-1'])"));if(0===t.length)return void e.preventDefault();let l=t[0],a=t[t.length-1];e.shiftKey&&document.activeElement===l?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a||(e.preventDefault(),l.focus())}return l?.focus(),n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[t,e,s])}function v({kind:e,progress:n}){let s=n.detail,l=s?.indexingJobs[0],a=l?.totalDocuments??s?.health.documentCount??0,r=void 0===l?0:l.processedDocuments+l.failedDocuments+l.skippedDocuments,i=a>0?r/a:0,o=s?.health.chunkCount??0,c=s?.health.vectorCount??0,d=o>0?c/o:0,u=n.now-n.startedAt,h=r>0?r/Math.max(u,1):0,p=h>0?Math.max(0,a-r)/h:0,f=l?.status??s?.capsule.lifecycleState??"starting",m=h>0&&a>r?`Estimated remaining ${x(p)}`:"Estimating remaining time";return(0,t.jsxs)("div",{className:"lkd-action-progress",role:"status","aria-live":"polite",children:[(0,t.jsxs)("div",{className:"lkd-action-progress-head",children:[(0,t.jsx)("span",{children:"index"===e?"Indexing documents":"refresh"===e?"Refreshing changed files":"Repairing failed files"}),(0,t.jsx)("span",{children:f})]}),(0,t.jsxs)("div",{className:"lkd-action-progress-note",children:["Still working. Elapsed ",x(u),". ",m,"."]}),(0,t.jsxs)("div",{className:"lkd-status-bars",children:[(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Documents"}),(0,t.jsx)(N,{value:i,label:"Action document progress"}),(0,t.jsxs)("span",{children:[r.toString()," / ",a.toString()]})]}),(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Vectors"}),(0,t.jsx)(N,{value:d,label:"Action vector progress"}),(0,t.jsxs)("span",{children:[c.toString()," / ",o.toString()]})]})]}),null!==n.pollError?(0,t.jsxs)("div",{className:"lkd-action-progress-note",children:["Progress refresh is delayed: ",n.pollError]}):null]})}function N({value:e,label:n}){return(0,t.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${f(e)}`,children:(0,t.jsx)("span",{className:"lkd-progress-fill","data-tone":"ok",style:{width:f(e)}})})}function S({kind:e,capsuleDisplayName:s,nameInput:l,busy:a,error:r,progress:o,onNameChange:c,onConfirm:d,onCancel:u}){let h=(0,n.useRef)(null),p=(0,n.useRef)(null);b(h,!0,u),(0,n.useEffect)(()=>{"delete"===e&&null!==p.current&&p.current.focus()},[e]);let f=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=h.current;null!==e&&(a?(f.current=!0,e.focus()):f.current&&(f.current=!1,e.querySelector("button:not([disabled]),input:not([disabled])")?.focus()))},[a]);let x="delete"===e,m=!a&&(!x||l===s),g="lkd-confirm-title",j="lkd-confirm-desc";return(0,i.createPortal)((0,t.jsx)("div",{className:"dlg-overlay in",role:"presentation",onClick:e=>{e.target===e.currentTarget&&u()},children:(0,t.jsxs)("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":g,"aria-describedby":j,className:"dlg",tabIndex:-1,children:[(0,t.jsx)("div",{className:"dlg-head",children:(0,t.jsxs)("div",{className:"dlg-htext",children:[(0,t.jsx)("div",{id:g,className:"dlg-title",children:"delete"===e?"Delete capsule":"refresh"===e?"Refresh changed files":"Repair failed files"}),(0,t.jsx)("div",{id:j,className:"dlg-sub",children:"delete"===e?`This permanently deletes the capsule index. The source files on disk are NOT deleted. Type "${s}" to confirm.`:"refresh"===e?"This runs an incremental refresh. Unchanged files stay in place, changed files are re-indexed, and removed files are cleaned up.":"This retries files that previously failed indexing and also picks up any newly changed files in the same incremental pass."})]})}),x?(0,t.jsxs)("div",{className:"dlg-body",children:[(0,t.jsxs)("div",{className:"dlg-field",children:[(0,t.jsx)("label",{htmlFor:"lkd-confirm-name-input",className:"dlg-label",children:"Type the capsule name to confirm"}),(0,t.jsx)("input",{id:"lkd-confirm-name-input",type:"text",className:"dlg-input",value:l,autoComplete:"off",ref:p,disabled:a,placeholder:s,onChange:e=>c(e.target.value)})]}),null!==r?(0,t.jsx)("div",{role:"alert",className:"lk-alert",style:{marginTop:4},children:r}):null]}):(0,t.jsxs)("div",{className:"dlg-body",children:[a&&null!==o?(0,t.jsx)(v,{kind:e,progress:o}):null,null!==r?(0,t.jsx)("div",{role:"alert",className:"lk-alert",children:r}):null]}),(0,t.jsxs)("div",{className:"dlg-foot",children:[(0,t.jsx)("button",{type:"button",className:"dlg-btn",disabled:a,onClick:u,children:"Cancel"}),(0,t.jsx)("button",{type:"button",className:"dlg-btn lkd-btn-destructive",disabled:!m,"aria-disabled":!m,onClick:d,children:a?"Working…":"delete"===e?"Delete":"refresh"===e?"Refresh":"Repair"})]})]})}),document.body)}function M({capsuleId:e,capsuleDisplayName:s,sourceCount:l,lifecycleState:a,onActionComplete:r,onDeleted:i,connectCapsuleSourceImpl:c=o.connectCapsuleSource,deleteCapsuleImpl:d=o.deleteCapsule,refreshCapsuleImpl:u=o.refreshCapsuleChangedFiles,repairCapsuleImpl:h=o.repairCapsuleFailedFiles,startIndexingImpl:f=o.startIndexing,fetchCapsuleDetailImpl:x=o.fetchCapsuleDetail}){let[j,y]=(0,n.useState)(null),[b,N]=(0,n.useState)(!1),[C,w]=(0,n.useState)(null),[A,E]=(0,n.useState)(!1),[L,$]=(0,n.useState)(null),[T,D]=(0,n.useState)(null),R=null!==T&&(A||b&&null!==j&&"delete"!==j.kind);async function O(){if(!A){D(m()),E(!0),$(null);try{await f(e),D(null),r()}catch(e){$((0,p.formatError)(e))}finally{E(!1)}}}function I(e){w(null),D(null),y({kind:e,nameInput:""})}async function P(e,t){"delete"!==e&&D(m()),N(!0),w(null);try{let n=await t();D(null),y(null),"delete"===e&&void 0!==i?i(n):r()}catch(e){w((0,p.formatError)(e))}finally{N(!1)}}return(0,n.useEffect)(()=>{if(!R)return;let e=window.setInterval(()=>{D(e=>null===e?e:{...e,now:Date.now()})},1e3);return()=>window.clearInterval(e)},[R]),(0,n.useEffect)(()=>{if(!R)return;let t=!1;async function n(){try{let n=await x(e);if(t)return;D(e=>null===e?{detail:n,startedAt:Date.now(),now:Date.now(),pollError:null}:{...e,detail:n,now:Date.now(),pollError:null})}catch(e){if(t)return;D(t=>null===t?t:{...t,now:Date.now(),pollError:(0,p.formatError)(e)})}}n();let s=window.setInterval(()=>{n()},2e3);return()=>{t=!0,window.clearInterval(s)}},[e,x,R]),(0,t.jsxs)("section",{className:"lkd-tools","aria-label":"Capsule tools",children:[(0,t.jsx)(k,{capsuleId:e,onConnected:r,connectImpl:c}),(0,t.jsx)("p",{className:"lkd-limit-note",children:g()}),l>0&&"ready"!==a?(0,t.jsxs)("div",{className:"lkd-index-row",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":"Index this capsule now","aria-busy":A,disabled:A,onClick:()=>void O(),children:A?"Indexing…":"Index now"}),null!==L?(0,t.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:L}):null,A&&null!==T?(0,t.jsx)(v,{kind:"index",progress:T}):null]}):null,(0,t.jsxs)("div",{role:"group","aria-label":`Actions for capsule ${s}`,className:"lkd-actions-group",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Refresh changed files for capsule ${s}`,onClick:()=>I("refresh"),children:"Refresh changed files"}),(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Repair failed files for capsule ${s}`,onClick:()=>I("repair"),children:"Repair failed files"}),(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-danger","aria-label":`Delete capsule ${s}`,onClick:()=>I("delete"),children:"Delete"})]}),null!==j?(0,t.jsx)(S,{kind:j.kind,capsuleDisplayName:s,nameInput:j.nameInput,busy:b,error:C,progress:T,onNameChange:function(e){y(t=>null!==t?{...t,nameInput:e}:null)},onConfirm:function(){if(null===j||b)return;let{kind:t}=j;"delete"===t?P(t,()=>d(e)):"refresh"===t?P(t,()=>u(e)):P(t,()=>h(e))},onCancel:function(){b||(y(null),w(null),D(null))}}):null]})}function C({name:e,description:s,busy:l,error:a,nameInputRef:r,onNameChange:i,onDescriptionChange:o,onCancel:c,onSubmit:d}){let u=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let e=e=>{if("Escape"!==e.key||l)return;let t=u.current;null!==t&&t.contains(document.activeElement)&&c()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[l,c]),(0,t.jsxs)("form",{className:"lkd-rename-form","aria-label":"Rename capsule",onSubmit:d,ref:u,children:[(0,t.jsxs)("div",{className:"dlg-field",children:[(0,t.jsx)("label",{htmlFor:"lkd-rename-name",className:"dlg-label",children:"Display name"}),(0,t.jsx)("input",{id:"lkd-rename-name",type:"text",className:"dlg-input",ref:r,value:e,disabled:l,autoComplete:"off","aria-label":"Capsule display name",onChange:e=>i(e.target.value)})]}),(0,t.jsxs)("div",{className:"dlg-field",children:[(0,t.jsx)("label",{htmlFor:"lkd-rename-desc",className:"dlg-label",children:"Description"}),(0,t.jsx)("input",{id:"lkd-rename-desc",type:"text",className:"dlg-input",value:s,disabled:l,autoComplete:"off","aria-label":"Capsule description",onChange:e=>o(e.target.value)})]}),null!==a?(0,t.jsx)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:a}):null,(0,t.jsxs)("div",{className:"lkd-rename-actions",children:[(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",disabled:l,onClick:c,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"lk-btn lk-btn-primary",disabled:l,"aria-busy":l,children:l?"Saving…":"Save"})]})]})}function w({capsuleId:e,displayName:s,description:l,onRenamed:a,renameImpl:r=o.renameCapsule}){let[i,c]=(0,n.useState)(!1),[d,u]=(0,n.useState)(s),[h,f]=(0,n.useState)(l??""),[x,m]=(0,n.useState)(!1),[g,j]=(0,n.useState)(null),y=(0,n.useRef)(null),k=(0,n.useRef)(null),b=(0,n.useRef)(!1);async function v(t){let n,i;t.preventDefault();let o=d.trim();if(0===o.length)return void j("Display name is required.");let u=(n={},o!==s&&(n.displayName=o),((i=h.trim())!==(l??"")&&(n.description=i),void 0===n.displayName&&void 0===n.description)?null:n);if(null===u)return void c(!1);m(!0),j(null);try{await r(e,u),c(!1),a()}catch(e){j((0,p.formatError)(e))}finally{m(!1)}}return(0,n.useEffect)(()=>{i?y.current?.focus():b.current&&k.current?.focus(),b.current=i},[i]),i?(0,t.jsx)(C,{name:d,description:h,busy:x,error:g,nameInputRef:y,onNameChange:u,onDescriptionChange:f,onCancel:function(){x||(c(!1),j(null))},onSubmit:e=>void v(e)}):(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost","aria-label":`Rename capsule ${s}`,ref:k,onClick:function(){u(s),f(l??""),j(null),c(!0)},children:"Rename"})}function A(e){return new Date(e).toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}function E(e){return Number.isFinite(e)?`${Math.round(100*Math.max(0,Math.min(1,e))).toString()}%`:"0%"}function L(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e/1e3),n=Math.floor(t/60),s=t%60;return 0===n?`${s.toString()}s`:`${n.toString()}m ${s.toString().padStart(2,"0")}s`}function $(e){return{width:E(e)}}function T({children:e}){return(0,t.jsx)("h2",{className:"lk-section-head",children:e})}function D(e){let[t,s]=(0,n.useState)(!1);return{visibleCount:t?e:Math.min(25,e),showAll:t,setShowAll:s}}function R({hiddenCount:e,showAll:n,onToggle:s,noun:l}){return!n&&e<=0?null:(0,t.jsx)("button",{type:"button",className:"lk-btn lk-btn-ghost",onClick:s,children:n?`Show fewer ${l}`:`Show ${e.toString()} more ${l}`})}function O({label:e,value:n,meta:s,tone:l="neutral"}){return(0,t.jsxs)("div",{className:"lkd-metric-card","data-tone":l,children:[(0,t.jsx)("span",{className:"lkd-metric-label",children:e}),(0,t.jsx)("strong",{className:"lkd-metric-value",children:n}),(0,t.jsx)("span",{className:"lkd-metric-meta",children:s})]})}function I({value:e,label:n,tone:s="ok"}){return(0,t.jsx)("div",{className:"lkd-progress",role:"img","aria-label":`${n}: ${E(e)}`,children:(0,t.jsx)("span",{className:"lkd-progress-fill","data-tone":s,style:$(e)})})}function P({data:e}){let n,s=e.indexingJobs[0],l=s?.totalDocuments??e.health.documentCount,a=void 0===s?0:s.processedDocuments+s.failedDocuments+s.skippedDocuments,r=Math.max(0,e.health.documentCount-e.health.failedDocuments-e.health.skippedDocuments),i=l>0?a/l:0,o=e.health.chunkCount>0?e.health.vectorCount/e.health.chunkCount:0,c=Math.max(0,e.health.chunkCount-e.health.vectorCount),d=void 0!==s?L((s.finishedAt??Date.now())-s.startedAt):"No job recorded",u=void 0!==s?Math.max(Date.now()-s.startedAt,1):0,h=a>0?a/u:0,p=h>0?Math.max(0,l-a)/h:0,f=s?.status==="running"&&l>0&&a>0?`ETA ${L(p)}`:d,x=c>0||e.health.failedDocuments>0?s?.lastError!==void 0?"danger":"warn":"ok";return(0,t.jsxs)("section",{"aria-labelledby":"lkd-index-status-heading",className:"lkd-status-section",children:[(0,t.jsxs)("div",{className:"lkd-section-title-row",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-index-status-heading",children:"Index status"})}),(0,t.jsx)("span",{className:"lkd-live-note","aria-live":"polite",children:s?.status==="running"?"Updating every 2s":"Latest run"})]}),(0,t.jsxs)("div",{className:"lkd-metric-grid",children:[(0,t.jsx)(O,{label:"Indexed documents",value:`${r.toString()} / ${e.health.documentCount.toString()}`,meta:`${e.health.failedDocuments.toString()} failed, ${e.health.skippedDocuments.toString()} skipped`,tone:e.health.failedDocuments>0?"danger":e.health.skippedDocuments>0?"warn":"ok"}),(0,t.jsx)(O,{label:"Vectors",value:`${e.health.vectorCount.toString()} / ${e.health.chunkCount.toString()}`,meta:c>0?`${c.toString()} chunks missing vectors`:"All chunks embedded",tone:c>0?"danger":"ok"}),(0,t.jsx)(O,{label:"Latest job",value:void 0!==s?G[s.status]:"Not indexed",meta:f,tone:s?.status==="failed"?"danger":s?.status==="running"?"warn":"neutral"})]}),(0,t.jsxs)("div",{className:"lkd-status-bars",children:[(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Discovery progress"}),(0,t.jsx)(I,{value:i,label:"Document discovery progress"}),(0,t.jsx)("span",{children:E(i)})]}),(0,t.jsxs)("div",{className:"lkd-status-bar-row",children:[(0,t.jsx)("span",{children:"Retrieval coverage"}),(0,t.jsx)(I,{value:o,label:"Vector retrieval coverage",tone:c>0?"danger":"ok"}),(0,t.jsx)("span",{children:E(o)})]})]}),(0,t.jsx)("p",{className:"lkd-status-callout","data-tone":x,children:(n=e.health.chunkCount-e.health.vectorCount,s?.lastError?.code==="EMBEDDING_ADAPTER_FAILED"?`Embedding stopped early: ${s.lastError.message}. ${n.toString()} chunks still need vectors.`:n>0?`${n.toString()} chunks still need vectors before retrieval can cover the full source.`:e.health.unsupportedDocuments>0?`${e.health.unsupportedDocuments.toString()} documents need a different extraction path before they can be indexed.`:"Index and vectors are aligned for the current source set.")})]})}function _({label:e,value:n}){return(0,t.jsxs)("div",{className:"lkd-row",children:[(0,t.jsx)("dt",{className:"lkd-label",children:e}),(0,t.jsx)("dd",{className:"lkd-value",children:n})]})}function H({data:e}){var n;let{capsule:s,health:l}=e,r=s.embeddingModelIdentity;return(0,t.jsxs)("section",{"aria-labelledby":"lkd-overview-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-overview-heading",children:"Overview"})}),(0,t.jsxs)("dl",{className:"lkd-dl",children:[(0,t.jsx)(_,{label:"Name",value:s.displayName}),void 0!==s.description?(0,t.jsx)(_,{label:"Description",value:s.description}):null,s.tags.length>0?(0,t.jsx)(_,{label:"Tags",value:(0,t.jsx)("ul",{className:"lkd-tags","aria-label":"Capsule tags",children:s.tags.map(e=>(0,t.jsx)("li",{className:"lkd-tag",children:e},e))})}):null,(0,t.jsx)(_,{label:"Status",value:(0,t.jsx)("span",{className:"lk-badge","data-state":s.lifecycleState,role:"status","aria-label":`Status: ${a.STATUS_LABELS[s.lifecycleState]}`,children:a.STATUS_LABELS[s.lifecycleState]})}),(0,t.jsx)(_,{label:"Embedding model",value:`${r.provider} / ${r.modelId} (${r.vectorDimensions.toString()}d, ${r.vectorMetric})`}),(0,t.jsx)(_,{label:"Storage size",value:(n=l.storageSizeBytes)<1024?`${n.toString()} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:`${(n/1048576).toFixed(1)} MB`}),(0,t.jsx)(_,{label:"Unsupported documents",value:l.unsupportedDocuments.toString()}),void 0!==l.lastIndexedAt?(0,t.jsx)(_,{label:"Last indexed",value:A(l.lastIndexedAt)}):null,(0,t.jsx)(_,{label:"Vector compatible",value:l.vectorCompatible?"Yes":"No — re-index required"}),l.staleReasons.length>0?(0,t.jsx)(_,{label:"Stale reasons",value:(0,t.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Stale reasons",children:l.staleReasons.map(e=>(0,t.jsx)("li",{children:e},e))})}):null,l.unsupportedGuidance.length>0?(0,t.jsx)(_,{label:"Next steps",value:(0,t.jsx)("ul",{className:"lkd-stale-reasons","aria-label":"Unsupported document guidance",children:l.unsupportedGuidance.map(e=>(0,t.jsx)("li",{children:e},e))})}):null]})]})}function U({sources:e}){return 0===e.length?(0,t.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,t.jsx)("p",{className:"lkd-empty-note",children:"No sources attached to this capsule."})]}):(0,t.jsxs)("section",{"aria-labelledby":"lkd-sources-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-sources-heading",children:"Sources"})}),(0,t.jsx)("ul",{className:"lkd-list lkd-source-list","aria-label":"Capsule sources",children:e.map(e=>{var n;let s=e.indexedCount+e.failedCount+e.skippedCount,l="folder"===(n=e.scope).kind?n.rootPath:"repository"===n.kind?n.repositoryRoot:`${n.rootPath} (${n.files.length.toString()} selected files)`;return(0,t.jsxs)("li",{className:"lkd-source-card",children:[(0,t.jsxs)("div",{className:"lkd-source-card-head",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"lkd-source-name",title:e.displayName,children:e.displayName}),(0,t.jsx)("div",{className:"lkd-source-path",title:l,children:l})]}),(0,t.jsx)("span",{className:"lkd-source-scope",children:e.scope.kind})]}),(0,t.jsxs)("div",{className:"lkd-source-coverage",role:"img","aria-label":"Source document coverage",children:[(0,t.jsx)("span",{className:"lkd-source-segment lkd-source-segment-ok",style:$(s>0?e.indexedCount/s:0)}),(0,t.jsx)("span",{className:"lkd-source-segment lkd-source-segment-fail",style:$(s>0?e.failedCount/s:0)}),(0,t.jsx)("span",{className:"lkd-source-segment lkd-source-segment-skip",style:$(s>0?e.skippedCount/s:0)})]}),(0,t.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,t.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[e.indexedCount.toString()," indexed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[e.failedCount.toString()," failed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[e.skippedCount.toString()," skipped"]})]})]},e.sourceId)})})]})}function F(){return(0,t.jsxs)("section",{"aria-labelledby":"lkd-privacy-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-privacy-heading",children:"Privacy and deletion"})}),(0,t.jsxs)("ul",{className:"lkd-list","aria-label":"Privacy and deletion details",children:[(0,t.jsx)("li",{className:"lkd-source-row",children:"Indexed text, vectors, diagnostics, and job history stay in Keiko's local runtime state on this machine."}),(0,t.jsx)("li",{className:"lkd-source-row",children:"Selected chunks may be sent through the configured Model Gateway for embeddings during indexing and for grounded answers when you ask questions against this capsule."}),(0,t.jsx)("li",{className:"lkd-source-row",children:"Deleting a capsule removes its local index data and capsule-set memberships. Source files on disk are not deleted."})]})]})}let V={info:"Info",warning:"Warning",error:"Error"};function B({group:e}){return(0,t.jsxs)("li",{className:"lkd-diag-group","data-severity":e.severity,"aria-label":`${V[e.severity]}: ${e.code} (${e.count.toString()}x)`,children:[(0,t.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:V[e.severity]}),(0,t.jsxs)("span",{className:"lkd-diag-group-count",children:[e.count.toString(),"x"]}),(0,t.jsx)("span",{className:"lkd-diag-code",children:e.code}),(0,t.jsx)("span",{className:"lkd-diag-message",children:e.message})]})}function J({diag:e}){return(0,t.jsxs)("li",{className:"lkd-diag-row","data-severity":e.severity,"aria-label":`${V[e.severity]}: ${e.code}`,children:[(0,t.jsx)("span",{className:"lkd-diag-severity","aria-hidden":"true",children:V[e.severity]}),(0,t.jsx)("span",{className:"lkd-diag-code",children:e.code}),(0,t.jsx)("span",{className:"lkd-diag-message",children:e.message}),void 0!==e.pageNumber?(0,t.jsxs)("span",{className:"lkd-diag-page",children:["p.",e.pageNumber.toString()]}):null]})}function K({diagnostics:e}){let{visibleCount:n,showAll:s,setShowAll:l}=D(e.length),a=e.slice(0,n),r=e.length-a.length,i=(function(e){let t=new Map;for(let n of e){let e=`${n.severity}\u0000${n.code}\u0000${n.message}`,s=t.get(e);t.set(e,{key:e,severity:n.severity,code:n.code,message:n.message,count:(s?.count??0)+1})}return[...t.values()].sort((e,t)=>t.count-e.count||e.code.localeCompare(t.code))})(e).slice(0,8);return(0,t.jsxs)("section",{"aria-labelledby":"lkd-diag-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-diag-heading",children:"Health Diagnostics"})}),0===e.length?(0,t.jsx)("p",{className:"lkd-empty-note","data-testid":"diag-empty",children:"No parser diagnostics — all documents processed cleanly."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{className:"lkd-list lkd-diag-group-list","aria-label":"Grouped parser diagnostics",children:i.map(e=>(0,t.jsx)(B,{group:e},e.key))}),(0,t.jsx)("ul",{className:"lkd-list lkd-diag-list","aria-label":"Parser diagnostics",children:a.map((e,n)=>(0,t.jsx)(J,{diag:e},`${e.code}-${n.toString()}`))}),(0,t.jsx)(R,{hiddenCount:r,noun:"diagnostics",showAll:s,onToggle:()=>l(!s)})]})]})}let G={queued:"Queued",running:"Running",succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled"};function z({job:e}){let n=void 0!==e.finishedAt?L(e.finishedAt-e.startedAt):"In progress";return(0,t.jsxs)("li",{className:"lkd-job-row","aria-label":`Job ${e.id}: ${G[e.status]}`,children:[(0,t.jsx)("span",{className:"lkd-job-status","data-status":e.status,children:G[e.status]}),(0,t.jsxs)("span",{className:"lkd-job-dates",children:[(0,t.jsx)("time",{dateTime:new Date(e.startedAt).toISOString(),children:A(e.startedAt)}),void 0!==e.finishedAt?(0,t.jsxs)(t.Fragment,{children:[" — ",(0,t.jsx)("time",{dateTime:new Date(e.finishedAt).toISOString(),children:A(e.finishedAt)})]}):null]}),(0,t.jsx)("span",{className:"lkd-job-duration",children:n}),(0,t.jsxs)("div",{className:"lkd-source-counts","aria-label":"Document counts",children:[(0,t.jsxs)("span",{className:"lkd-count lkd-count-ok",children:[e.processedDocuments.toString()," processed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-fail",children:[e.failedDocuments.toString()," failed"]}),(0,t.jsxs)("span",{className:"lkd-count lkd-count-skip",children:[e.skippedDocuments.toString()," skipped"]})]}),void 0!==e.lastError?(0,t.jsxs)("div",{className:"lkd-job-error",children:[(0,t.jsx)("span",{children:e.lastError.code}),(0,t.jsx)("span",{children:e.lastError.message})]}):null]})}function W({jobs:e}){let{visibleCount:n,showAll:s,setShowAll:l}=D(e.length),a=e.slice(0,n),r=e.length-a.length;return(0,t.jsxs)("section",{"aria-labelledby":"lkd-jobs-heading",children:[(0,t.jsx)(T,{children:(0,t.jsx)("span",{id:"lkd-jobs-heading",children:"Indexing Job History"})}),0===e.length?(0,t.jsx)("p",{className:"lkd-empty-note",children:"No indexing jobs recorded yet."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{className:"lkd-list","aria-label":"Indexing job history",children:a.map(e=>(0,t.jsx)(z,{job:e},e.id))}),(0,t.jsx)(R,{hiddenCount:r,noun:"jobs",showAll:s,onToggle:()=>l(!s)})]})]})}e.s(["CapsuleDetail",0,function({capsuleId:e,onDeleted:n,fetchDetailImpl:a}={}){let i=(0,s.useSearchParams)(),o=(0,s.useRouter)(),c=e??i.get("capsuleId")??"",{data:d,loadStatus:u,loadError:h,reload:p}=(0,r.useCapsuleDetail)(c,a);return"loading"===u?(0,t.jsx)("p",{role:"status","aria-live":"polite",className:"lk-loading",children:"Loading capsule…"}):"error"===u||null===d?""===c?(0,t.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["No capsule selected. Open a capsule from the Local Knowledge overview.",(0,t.jsx)(l.default,{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to Local Knowledge"})]}):h?.includes("NOT_FOUND")===!0||h?.toLowerCase().includes("not found")===!0?(0,t.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:["This capsule no longer exists. Return to the Local Knowledge overview.",(0,t.jsx)(l.default,{href:"/local-knowledge",className:"lk-alert-retry",children:"Back to capsules"})]}):(0,t.jsxs)("div",{role:"alert","aria-live":"assertive",className:"lk-alert",children:[h??"Failed to load capsule.",(0,t.jsx)("button",{type:"button",onClick:p,"aria-label":"Retry loading capsule detail",className:"lk-alert-retry",children:"Retry"})]}):(0,t.jsxs)("div",{className:"lkd-content",children:[(0,t.jsxs)("header",{className:"lk-header",children:[(0,t.jsx)("h1",{className:"lk-title",children:d.capsule.displayName}),(0,t.jsx)(w,{capsuleId:c,displayName:d.capsule.displayName,...void 0!==d.capsule.description?{description:d.capsule.description}:{},onRenamed:p})]}),(0,t.jsx)(M,{capsuleId:c,capsuleDisplayName:d.capsule.displayName,sourceCount:d.sources.length,lifecycleState:d.capsule.lifecycleState,onActionComplete:p,onDeleted:function(e){void 0!==n?n(e):o.push("/local-knowledge")}}),(0,t.jsx)(P,{data:d}),(0,t.jsx)(H,{data:d}),(0,t.jsx)(F,{}),(0,t.jsx)(U,{sources:d.sources}),(0,t.jsx)(K,{diagnostics:d.parserDiagnostics}),(0,t.jsx)(W,{jobs:d.indexingJobs})]})}],80010)}]);