@tablestore/tablestore-agent-cli 0.1.7 → 0.1.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 (621) hide show
  1. package/dist/commands/dashboard.d.ts.map +1 -1
  2. package/dist/commands/dashboard.js +173 -4
  3. package/dist/commands/dashboard.js.map +1 -1
  4. package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
  5. package/dist/dashboard-runtime/dashboard/.next/app-path-routes-manifest.json +2 -0
  6. package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +5 -5
  7. package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
  8. package/dist/dashboard-runtime/dashboard/.next/required-server-files.json +2 -0
  9. package/dist/dashboard-runtime/dashboard/.next/routes-manifest.json +12 -0
  10. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page/build-manifest.json +2 -2
  11. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js +2 -2
  12. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  13. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  14. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page/build-manifest.json +2 -2
  15. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js +2 -2
  16. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
  17. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
  18. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page/build-manifest.json +2 -2
  19. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js +2 -2
  20. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
  21. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
  22. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page/build-manifest.json +2 -2
  23. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js +2 -2
  24. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
  25. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
  26. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page/build-manifest.json +2 -2
  27. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js +2 -2
  28. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
  29. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
  30. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page/build-manifest.json +2 -2
  31. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js +2 -2
  32. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
  33. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
  34. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page/build-manifest.json +2 -2
  35. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js +2 -2
  36. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
  37. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
  38. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page/build-manifest.json +2 -2
  39. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js +2 -2
  40. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
  41. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
  42. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page/build-manifest.json +2 -2
  43. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js +2 -2
  44. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
  45. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
  46. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page/build-manifest.json +2 -2
  47. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js +2 -2
  48. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
  49. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
  50. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page/build-manifest.json +2 -2
  51. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js +2 -2
  52. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  53. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  54. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page/build-manifest.json +2 -2
  55. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js +2 -2
  56. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
  57. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
  58. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page/build-manifest.json +2 -2
  59. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js +2 -2
  60. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
  61. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
  62. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page/build-manifest.json +2 -2
  63. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js +2 -2
  64. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
  65. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
  66. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page/build-manifest.json +2 -2
  67. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js +2 -2
  68. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
  69. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
  70. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page/build-manifest.json +2 -2
  71. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js +2 -2
  72. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
  73. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
  74. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page/build-manifest.json +2 -2
  75. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js +2 -2
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page/build-manifest.json +2 -2
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js +2 -2
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page/build-manifest.json +2 -2
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js +2 -2
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page/build-manifest.json +2 -2
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js +2 -2
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error/page/build-manifest.json +2 -2
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page/build-manifest.json +2 -2
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page.js +1 -1
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +20 -19
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +20 -19
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +10 -9
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js +2 -2
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  112. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js +2 -2
  113. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  114. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js +2 -2
  115. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  116. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js +2 -2
  117. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  118. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js +2 -2
  119. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  120. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js +2 -2
  121. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  122. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js +2 -2
  123. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  124. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js +2 -2
  125. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  126. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js +2 -2
  127. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  128. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js +2 -2
  129. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  130. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js +2 -2
  131. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  132. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js +2 -2
  133. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  134. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js +2 -2
  135. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  136. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js +2 -2
  137. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  138. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js +2 -2
  139. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  140. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js +2 -2
  141. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  142. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js +2 -2
  143. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  144. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js +2 -2
  145. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  146. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js +2 -2
  147. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  148. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route/app-paths-manifest.json +3 -0
  149. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route/build-manifest.json +9 -0
  150. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route/server-reference-manifest.json +4 -0
  151. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js +6 -0
  152. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.map +5 -0
  153. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -0
  154. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route_client-reference-manifest.js +3 -0
  155. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js +2 -2
  156. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
  157. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js +2 -2
  158. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
  159. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js +2 -2
  160. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
  161. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js +2 -2
  162. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
  163. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js +2 -2
  164. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
  165. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js +2 -2
  166. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
  167. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js +2 -2
  168. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
  169. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route/app-paths-manifest.json +3 -0
  170. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route/build-manifest.json +9 -0
  171. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route/server-reference-manifest.json +4 -0
  172. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js +6 -0
  173. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.map +5 -0
  174. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -0
  175. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route_client-reference-manifest.js +3 -0
  176. package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
  177. package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +19 -18
  178. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  179. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +19 -18
  180. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +3 -3
  181. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +10 -9
  182. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  183. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page/build-manifest.json +2 -2
  184. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js +1 -1
  185. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js.nft.json +1 -1
  186. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  187. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
  188. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +23 -22
  189. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +23 -22
  190. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +3 -3
  191. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +10 -9
  192. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  193. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  194. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +4 -4
  195. package/dist/dashboard-runtime/dashboard/.next/server/app/page/build-manifest.json +2 -2
  196. package/dist/dashboard-runtime/dashboard/.next/server/app/page.js +1 -1
  197. package/dist/dashboard-runtime/dashboard/.next/server/app/page.js.nft.json +1 -1
  198. package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  199. package/dist/dashboard-runtime/dashboard/.next/server/app-paths-manifest.json +2 -0
  200. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +6 -6
  201. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.gylau._.js +3 -0
  202. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.hvkwy._.js +3 -0
  203. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.qtdn4._.js +3 -0
  204. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02p1x3t._.js +3 -0
  205. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04dd04u._.js +3 -0
  206. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04ujbw-._.js +3 -0
  207. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04zbudf._.js +3 -0
  208. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05eryp~._.js +3 -0
  209. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06fva9g._.js +3 -0
  210. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0byveuc._.js +3 -0
  211. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cee_lo._.js +3 -0
  212. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cyd2qb._.js +3 -0
  213. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ecs-9r._.js +3 -0
  214. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ejcow5._.js +3 -0
  215. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0fglxiw._.js +3 -0
  216. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0i1_p1s._.js +3 -0
  217. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__0f990w9._.js → [root-of-the-server]__0lvi0g-._.js} +14 -12
  218. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0no9qm0._.js +3 -0
  219. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q9fgt6._.js +3 -0
  220. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0rx9hon._.js +3 -0
  221. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0w_ig2a._.js +3 -0
  222. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zmo~nd._.js +3 -0
  223. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11s_zx6._.js +3 -0
  224. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11wq90l._.js +3 -0
  225. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__126srko._.js +3 -0
  226. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12e1t6o._.js +3 -0
  227. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12ylr4n._.js +3 -0
  228. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13g_f9w._.js +3 -0
  229. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13~-fxp._.js +3 -0
  230. package/dist/dashboard-runtime/dashboard/.next/server/chunks/dashboard__next-internal_server_app_api_v1_logs_client_route_actions_0tnhyc7.js +3 -0
  231. package/dist/dashboard-runtime/dashboard/.next/server/chunks/dashboard__next-internal_server_app_api_v1_runtime_context_route_actions_0d9d6g_.js +3 -0
  232. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +2 -2
  233. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95_src_app_(dashboard)_knowledge-base_[name]_settings_settings-client_tsx_13312zk._.js +1 -1
  234. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0p91_next_dist_shared_lib_deployment-id_0uu7yq4.js +3 -0
  235. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[externals]__0tqph4u._.js +3 -0
  236. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0_r24-c._.js +3 -0
  237. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0aqzu8w._.js +3 -0
  238. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0jb9ccl._.js +3 -0
  239. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__10rkv6z._.js +3 -0
  240. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__11yei-s._.js +3 -0
  241. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0hm68~i._.js → _0303qx7._.js} +2 -2
  242. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_03cxnik._.js +3 -0
  243. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_04f2u4t._.js +3 -0
  244. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06l.12l._.js +1 -1
  245. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_09eom0_._.js +3 -0
  246. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_09yzbcp._.js +1 -1
  247. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0dqi8bq._.js +3 -0
  248. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0e9y.xc._.js +1 -1
  249. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f9u8i2._.js +3 -0
  250. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0i8py_a._.js +3 -0
  251. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jlt.cx._.js +3 -0
  252. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0n5uozy._.js +3 -0
  253. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0o32d.y._.js +3 -0
  254. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0o665bf._.js +1 -1
  255. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0suxzcc._.js +3 -0
  256. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tej2s.._.js +1 -1
  257. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tyxwr3._.js +3 -0
  258. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0u9md36._.js +1 -1
  259. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0c7wecm._.js → _0v4jb2q._.js} +2 -2
  260. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0zn.ayc._.js +3 -0
  261. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13l7w34._.js +1 -1
  262. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_065m1.j._.js +1 -1
  263. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0suis9l._.js +3 -3
  264. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
  265. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
  266. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_[name]_layout-client_tsx_05momc5._.js +1 -1
  267. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_create_page_tsx_0916~g-._.js +1 -1
  268. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_settings_page_tsx_0y26.xu._.js +1 -1
  269. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
  270. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_error_tsx_01x7ppm._.js +1 -1
  271. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_providers_runtime-context-provider_tsx_0wmj66z._.js +3 -0
  272. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_00arje5._.js +3 -0
  273. package/dist/dashboard-runtime/dashboard/.next/server/functions-config-manifest.json +28 -1
  274. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +5 -5
  275. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  276. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  277. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  278. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  279. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0osozgwmk692r.js → 0-etecbti5x22.js} +1 -1
  280. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-xqk6wfme5fu.js +1 -0
  281. package/dist/dashboard-runtime/dashboard/.next/static/chunks/031-scv-8sah9.js +1 -0
  282. package/dist/dashboard-runtime/dashboard/.next/static/chunks/034uozc1ki09_.js +1 -0
  283. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05ow1qzcjz3pz.js +1 -0
  284. package/dist/dashboard-runtime/dashboard/.next/static/chunks/087x52iesmpfe.js +1 -0
  285. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08an3157he_ad.js +1 -0
  286. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0aak.679si-3m.js +1 -0
  287. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ai8f~-9ig.gz.js +138 -0
  288. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0c5tcbhzpwen7.js +1 -0
  289. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dheju1t18upn.js +1 -0
  290. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{07q4gw5gnh3.d.js → 0fagnytrt.3oe.js} +2 -2
  291. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ffr1_o~ss8r8.js +1 -0
  292. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{123yjh849.vzp.js → 0gjljpk5qgdmz.js} +1 -1
  293. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0h38qfpz-dmiu.js +1 -0
  294. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0l1fmyhvp-k49.js +1 -0
  295. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pcp6pjjz7o49.js +1 -0
  296. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pdq-gljpy7gd.js +1 -0
  297. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0q6-s11w9.sgo.js +1 -0
  298. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rnm58mg0whfk.js +1 -0
  299. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rxp5ykl1_lyb.js +4 -0
  300. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0th7u6qvdy3x2.js +1 -0
  301. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v_~favugkv_a.js +1 -0
  302. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x3ysmon_~xsv.js +1 -0
  303. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x7sjde5wit~i.js +1 -0
  304. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yzz97.2e6if6.js +138 -0
  305. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~alekqkiwwaq.js +1 -0
  306. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~e2n9bhosscr.js +1 -0
  307. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~i4llb9-utpp.css +1 -0
  308. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~kfzxrhgbkaz.js +1 -0
  309. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~n-y9cstar6b.js +5 -0
  310. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14z_j1qzycpe1.js +1 -0
  311. package/dist/dashboard-runtime/dashboard/.next/static/chunks/154aheeo3m6bg.js +1 -0
  312. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17k4h5zgalxqj.js +1 -0
  313. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{turbopack-0jhqjurvu9x3y.js → turbopack-0ybyy.9-.w~ub.js} +1 -1
  314. package/dist/dashboard-runtime/dashboard/components.json +20 -0
  315. package/dist/dashboard-runtime/dashboard/instrumentation-node.ts +14 -0
  316. package/dist/dashboard-runtime/dashboard/instrumentation.ts +18 -0
  317. package/dist/dashboard-runtime/dashboard/next.config.ts +56 -0
  318. package/dist/dashboard-runtime/dashboard/postcss.config.mjs +8 -0
  319. package/dist/dashboard-runtime/dashboard/server.js +1 -1
  320. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/error.tsx +44 -0
  321. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/loading.tsx +29 -0
  322. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/page.tsx +372 -0
  323. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/error.tsx +69 -0
  324. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/documents/documents-client.tsx +22 -11
  325. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/qa/page.tsx +28 -2
  326. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/layout.tsx +75 -0
  327. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/loading.tsx +26 -0
  328. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/layout.tsx +62 -0
  329. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/_helpers.ts +109 -0
  330. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/page.tsx +309 -0
  331. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/page.tsx +26 -0
  332. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/_helpers.ts +234 -0
  333. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/page.tsx +323 -0
  334. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +49 -0
  335. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/settings/page.tsx +71 -0
  336. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +277 -0
  337. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/create/page.tsx +30 -0
  338. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/error.tsx +44 -0
  339. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/loading.tsx +26 -0
  340. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/page.tsx +27 -0
  341. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/error.tsx +43 -0
  342. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/loading.tsx +25 -0
  343. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/page.tsx +174 -0
  344. package/dist/dashboard-runtime/dashboard/src/app/api/v1/auth/status/route.ts +53 -0
  345. package/dist/dashboard-runtime/dashboard/src/app/api/v1/auth/token/route.ts +113 -0
  346. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/[name]/route.ts +196 -0
  347. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/[name]/token/route.ts +80 -0
  348. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/[name]/use/route.ts +91 -0
  349. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/route.ts +274 -0
  350. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/chunks/route.ts +3 -0
  351. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.ts +3 -0
  352. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.ts +3 -0
  353. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/route.ts +3 -0
  354. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/upload/route.ts +3 -0
  355. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/retrieve/route.ts +3 -0
  356. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/route.ts +3 -0
  357. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/route.ts +3 -0
  358. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +455 -0
  359. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/providers/[id]/models/route.ts +46 -0
  360. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/providers/[id]/route.ts +83 -0
  361. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/providers/[id]/test/route.ts +40 -0
  362. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/providers/route.ts +70 -0
  363. package/dist/dashboard-runtime/dashboard/src/app/api/v1/logs/client/route.ts +70 -0
  364. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/_scope.ts +84 -0
  365. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/messages/route.ts +64 -0
  366. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/requests/route.ts +65 -0
  367. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/route.ts +78 -0
  368. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/search/route.ts +49 -0
  369. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/units/[memoryId]/route.ts +126 -0
  370. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/units/route.ts +85 -0
  371. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/route.ts +60 -0
  372. package/dist/dashboard-runtime/dashboard/src/app/api/v1/runtime/context/route.ts +26 -0
  373. package/dist/dashboard-runtime/dashboard/src/app/error.tsx +84 -0
  374. package/dist/dashboard-runtime/dashboard/src/app/globals.css +262 -0
  375. package/dist/dashboard-runtime/dashboard/src/app/layout.tsx +38 -0
  376. package/dist/dashboard-runtime/dashboard/src/app/onboarding/error.tsx +54 -0
  377. package/dist/dashboard-runtime/dashboard/src/app/onboarding/layout.tsx +18 -0
  378. package/dist/dashboard-runtime/dashboard/src/app/onboarding/page.tsx +62 -0
  379. package/dist/dashboard-runtime/dashboard/src/app/page.tsx +10 -0
  380. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-chunks-dialog.tsx +13 -4
  381. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-upload-dialog.tsx +436 -94
  382. package/dist/dashboard-runtime/dashboard/src/components/instance/connect-instance-form.tsx +10 -2
  383. package/dist/dashboard-runtime/dashboard/src/components/instance/edit-instance-dialog.tsx +6 -2
  384. package/dist/dashboard-runtime/dashboard/src/components/instance/project-card.tsx +195 -0
  385. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-card.tsx +8 -5
  386. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-header.tsx +18 -10
  387. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-list.tsx +6 -1
  388. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar.tsx +90 -0
  389. package/dist/dashboard-runtime/dashboard/src/components/logging/client-error-reporter.tsx +59 -0
  390. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-header.tsx +8 -12
  391. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-list.tsx +6 -1
  392. package/dist/dashboard-runtime/dashboard/src/components/qa/markdown.tsx +77 -0
  393. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-chat-panel.tsx +45 -4
  394. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +636 -36
  395. package/dist/dashboard-runtime/dashboard/src/components/shared/confirm-dialog.tsx +8 -1
  396. package/dist/dashboard-runtime/dashboard/src/components/shared/error-state.tsx +54 -0
  397. package/dist/dashboard-runtime/dashboard/src/components/shared/refresh-button.tsx +102 -86
  398. package/dist/dashboard-runtime/dashboard/src/components/ui/badge.tsx +36 -0
  399. package/dist/dashboard-runtime/dashboard/src/components/ui/button.tsx +57 -0
  400. package/dist/dashboard-runtime/dashboard/src/components/ui/card.tsx +97 -0
  401. package/dist/dashboard-runtime/dashboard/src/components/ui/checkbox.tsx +28 -0
  402. package/dist/dashboard-runtime/dashboard/src/components/ui/collapsible.tsx +11 -0
  403. package/dist/dashboard-runtime/dashboard/src/components/ui/command.tsx +153 -0
  404. package/dist/dashboard-runtime/dashboard/src/components/ui/dialog.tsx +127 -0
  405. package/dist/dashboard-runtime/dashboard/src/components/ui/form.tsx +178 -0
  406. package/dist/dashboard-runtime/dashboard/src/components/ui/input.tsx +22 -0
  407. package/dist/dashboard-runtime/dashboard/src/components/ui/label.tsx +24 -0
  408. package/dist/dashboard-runtime/dashboard/src/components/ui/popover.tsx +34 -0
  409. package/dist/dashboard-runtime/dashboard/src/components/ui/select.tsx +162 -0
  410. package/dist/dashboard-runtime/dashboard/src/components/ui/separator.tsx +31 -0
  411. package/dist/dashboard-runtime/dashboard/src/components/ui/sheet.tsx +129 -0
  412. package/dist/dashboard-runtime/dashboard/src/components/ui/skeleton.tsx +49 -0
  413. package/dist/dashboard-runtime/dashboard/src/components/ui/slider.tsx +28 -0
  414. package/dist/dashboard-runtime/dashboard/src/components/ui/sonner.tsx +29 -0
  415. package/dist/dashboard-runtime/dashboard/src/components/ui/switch.tsx +66 -0
  416. package/dist/dashboard-runtime/dashboard/src/components/ui/table.tsx +120 -0
  417. package/dist/dashboard-runtime/dashboard/src/components/ui/tabs.tsx +69 -0
  418. package/dist/dashboard-runtime/dashboard/src/components/ui/textarea.tsx +22 -0
  419. package/dist/dashboard-runtime/dashboard/src/components/ui/tooltip.tsx +30 -0
  420. package/dist/dashboard-runtime/dashboard/src/config/navigation.ts +39 -0
  421. package/dist/dashboard-runtime/dashboard/src/hooks/use-active-instance.ts +20 -0
  422. package/dist/dashboard-runtime/dashboard/src/hooks/use-add-memory.ts +3 -4
  423. package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +212 -99
  424. package/dist/dashboard-runtime/dashboard/src/hooks/use-create-kb.ts +2 -1
  425. package/dist/dashboard-runtime/dashboard/src/hooks/use-create-llm-provider.ts +2 -3
  426. package/dist/dashboard-runtime/dashboard/src/hooks/use-create-memory-store.ts +2 -1
  427. package/dist/dashboard-runtime/dashboard/src/hooks/use-delete-documents.ts +10 -5
  428. package/dist/dashboard-runtime/dashboard/src/hooks/use-delete-kb.ts +2 -1
  429. package/dist/dashboard-runtime/dashboard/src/hooks/use-delete-llm-provider.ts +2 -3
  430. package/dist/dashboard-runtime/dashboard/src/hooks/use-delete-memory-store.ts +2 -1
  431. package/dist/dashboard-runtime/dashboard/src/hooks/use-delete-memory-unit.ts +3 -3
  432. package/dist/dashboard-runtime/dashboard/src/hooks/use-documents.ts +7 -5
  433. package/dist/dashboard-runtime/dashboard/src/hooks/use-instances.ts +38 -19
  434. package/dist/dashboard-runtime/dashboard/src/hooks/use-knowledge-base.ts +5 -2
  435. package/dist/dashboard-runtime/dashboard/src/hooks/use-knowledge-bases.ts +5 -1
  436. package/dist/dashboard-runtime/dashboard/src/hooks/use-llm-provider-models.ts +5 -2
  437. package/dist/dashboard-runtime/dashboard/src/hooks/use-llm-provider.ts +5 -2
  438. package/dist/dashboard-runtime/dashboard/src/hooks/use-llm-providers.ts +5 -1
  439. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-messages.ts +12 -6
  440. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-requests.ts +12 -2
  441. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-store.ts +5 -2
  442. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-stores.ts +5 -1
  443. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-unit.ts +16 -2
  444. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-units.ts +11 -2
  445. package/dist/dashboard-runtime/dashboard/src/hooks/use-qa-chat.ts +263 -58
  446. package/dist/dashboard-runtime/dashboard/src/hooks/use-update-kb.ts +3 -5
  447. package/dist/dashboard-runtime/dashboard/src/hooks/use-update-llm-provider.ts +2 -4
  448. package/dist/dashboard-runtime/dashboard/src/hooks/use-update-memory-store.ts +3 -5
  449. package/dist/dashboard-runtime/dashboard/src/hooks/use-update-memory-unit.ts +3 -2
  450. package/dist/dashboard-runtime/dashboard/src/hooks/use-upload-documents.ts +26 -7
  451. package/dist/dashboard-runtime/dashboard/src/lib/chat-message-ops.ts +76 -0
  452. package/dist/dashboard-runtime/dashboard/src/lib/constants.ts +22 -0
  453. package/dist/dashboard-runtime/dashboard/src/lib/dev-flags.ts +24 -0
  454. package/dist/dashboard-runtime/dashboard/src/lib/fonts.ts +9 -0
  455. package/dist/dashboard-runtime/dashboard/src/lib/memory.ts +69 -0
  456. package/dist/dashboard-runtime/dashboard/src/lib/normalize-oss-endpoint.ts +28 -0
  457. package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +147 -0
  458. package/dist/dashboard-runtime/dashboard/src/lib/server/api-helpers.ts +193 -9
  459. package/dist/dashboard-runtime/dashboard/src/lib/server/chat-project-context.ts +17 -0
  460. package/dist/dashboard-runtime/dashboard/src/lib/server/runtime-context.ts +108 -0
  461. package/dist/dashboard-runtime/dashboard/src/lib/server/sdk-client.ts +250 -22
  462. package/dist/dashboard-runtime/dashboard/src/lib/utils.ts +15 -0
  463. package/dist/dashboard-runtime/dashboard/src/providers/query-provider.tsx +4 -1
  464. package/dist/dashboard-runtime/dashboard/src/providers/runtime-context-provider.tsx +237 -0
  465. package/dist/dashboard-runtime/dashboard/src/schemas/common.ts +8 -0
  466. package/dist/dashboard-runtime/dashboard/src/schemas/document.ts +28 -0
  467. package/dist/dashboard-runtime/dashboard/src/schemas/instance.ts +107 -0
  468. package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +1 -0
  469. package/dist/dashboard-runtime/dashboard/src/schemas/retrieval.ts +28 -0
  470. package/dist/dashboard-runtime/dashboard/src/services/api-client.ts +138 -33
  471. package/dist/dashboard-runtime/dashboard/src/services/auth.ts +18 -0
  472. package/dist/dashboard-runtime/dashboard/src/services/chunks.ts +49 -0
  473. package/dist/dashboard-runtime/dashboard/src/services/documents.ts +208 -0
  474. package/dist/dashboard-runtime/dashboard/src/services/instances.ts +71 -0
  475. package/dist/dashboard-runtime/dashboard/src/services/memory.ts +158 -0
  476. package/dist/dashboard-runtime/dashboard/src/services/retrieval.ts +16 -0
  477. package/dist/dashboard-runtime/dashboard/src/services/runtime-context.ts +8 -0
  478. package/dist/dashboard-runtime/dashboard/src/types/api.ts +18 -0
  479. package/dist/dashboard-runtime/dashboard/src/types/instance.ts +68 -0
  480. package/dist/dashboard-runtime/dashboard/src/types/llm-chat.ts +21 -0
  481. package/dist/dashboard-runtime/dashboard/src/types/memory.ts +106 -0
  482. package/dist/dashboard-runtime/dashboard/src/types/retrieval.ts +43 -0
  483. package/dist/dashboard-runtime/dashboard/src/types/runtime-context.ts +12 -0
  484. package/dist/dashboard-runtime/dashboard/tailwind.config.ts +92 -0
  485. package/dist/dashboard-runtime/dashboard/tsconfig.json +43 -0
  486. package/dist/dashboard-runtime/dashboard/vitest.config.mjs +12 -0
  487. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +1 -0
  488. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  489. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +64 -20
  490. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  491. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +1 -0
  492. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  493. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +62 -18
  494. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  495. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  496. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/config.d.ts +1 -0
  497. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/config.d.ts.map +1 -1
  498. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/config.js +19 -0
  499. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/config.js.map +1 -1
  500. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/constants.d.ts.map +1 -1
  501. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js +4 -2
  502. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js.map +1 -1
  503. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/index.d.ts +1 -0
  504. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/index.d.ts.map +1 -1
  505. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/index.js +1 -0
  506. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/index.js.map +1 -1
  507. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.d.ts +78 -0
  508. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.d.ts.map +1 -0
  509. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js +398 -0
  510. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js.map +1 -0
  511. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  512. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +1 -0
  513. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  514. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +64 -20
  515. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  516. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +1 -0
  517. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  518. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +62 -18
  519. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  520. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  521. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/config.d.ts +1 -0
  522. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/config.d.ts.map +1 -1
  523. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/config.js +19 -0
  524. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/config.js.map +1 -1
  525. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/constants.d.ts.map +1 -1
  526. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js +4 -2
  527. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js.map +1 -1
  528. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/index.d.ts +1 -0
  529. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/index.d.ts.map +1 -1
  530. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/index.js +1 -0
  531. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/index.js.map +1 -1
  532. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.d.ts +78 -0
  533. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.d.ts.map +1 -0
  534. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js +398 -0
  535. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js.map +1 -0
  536. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  537. package/package.json +1 -1
  538. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__03742bf._.js +0 -3
  539. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__037l_3-._.js +0 -3
  540. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05pd96o._.js +0 -3
  541. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__07jfil8._.js +0 -38
  542. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__089jtfp._.js +0 -3
  543. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08w-nm2._.js +0 -3
  544. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0_o02fk._.js +0 -3
  545. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0b50n21._.js +0 -3
  546. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0bfezi5._.js +0 -3
  547. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0btp1y7._.js +0 -3
  548. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0fqdh7c._.js +0 -3
  549. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0g9--xh._.js +0 -3
  550. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0gqr7to._.js +0 -3
  551. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0h71~~8._.js +0 -3
  552. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0l1bgu.._.js +0 -3
  553. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0lcurm3._.js +0 -3
  554. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0n3pam7._.js +0 -3
  555. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0nkghp7._.js +0 -3
  556. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0r4amj5._.js +0 -3
  557. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0td5dey._.js +0 -3
  558. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0tsud8x._.js +0 -3
  559. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0wl_vik._.js +0 -3
  560. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0x7~7nk._.js +0 -3
  561. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0xvok7r._.js +0 -3
  562. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0~tse9o._.js +0 -3
  563. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12lk-nv._.js +0 -3
  564. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12sqoa8._.js +0 -3
  565. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e.4_sonner_dist_index_mjs_0u2em8w._.js +0 -3
  566. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/12df_@tanstack_react-query_build_modern_0em_ajy._.js +0 -3
  567. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[externals]__0wijiwt._.js +0 -3
  568. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0i0y9.r._.js +0 -3
  569. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0nwf4e.._.js +0 -3
  570. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0r_6wpx._.js +0 -3
  571. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0y8rrcu._.js +0 -3
  572. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0-dlo4s._.js +0 -3
  573. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_00f15bk._.js +0 -3
  574. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_02e0c00._.js +0 -3
  575. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0476v7r._.js +0 -3
  576. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ct0n55._.js +0 -3
  577. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0doczxg._.js +0 -3
  578. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fg6iap._.js +0 -3
  579. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0mzxmfh._.js +0 -3
  580. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0naqa6h._.js +0 -3
  581. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ti~om_._.js +0 -3
  582. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0~s~e-0._.js +0 -3
  583. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_11fig8y._.js +0 -3
  584. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_00o55he._.js +0 -3
  585. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0qzg4vh._.js +0 -3
  586. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-mr2-dyb-szq.js +0 -1
  587. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0003a8l0skc88.js +0 -1
  588. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00m4164p4ip7m.js +0 -1
  589. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02b1c4t1dy1ri.js +0 -1
  590. package/dist/dashboard-runtime/dashboard/.next/static/chunks/055_bo6_3nt-s.js +0 -1
  591. package/dist/dashboard-runtime/dashboard/.next/static/chunks/06v~rjrrn4ugo.js +0 -1
  592. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07l4dodn5t6l4.js +0 -4
  593. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07v08gtfpo2yk.js +0 -1
  594. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07xvdo2w9s4~p.js +0 -1
  595. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09qsmnfvk8dm3.js +0 -1
  596. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0a5ass8u78k90.js +0 -1
  597. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0gkonvtvjhg-p.js +0 -1
  598. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0hpoawl1bb10g.js +0 -1
  599. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0i5aqiffpm9jr.js +0 -1
  600. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jeb9kxtd_jq..js +0 -1
  601. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j~63ld9lbb25.js +0 -1
  602. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0l6znnjqw.4yw.js +0 -1
  603. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0m2p301.a174k.js +0 -1
  604. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o-c2g8y5pw-c.js +0 -1
  605. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o0i2ke2jbdvq.js +0 -138
  606. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rywhgbu_16tm.js +0 -5
  607. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0r~6kt_pkm4di.js +0 -1
  608. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0s3mvx9_dr13c.js +0 -1
  609. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u2lo2lzizxy_.js +0 -1
  610. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v.hno.6q74nn.css +0 -1
  611. package/dist/dashboard-runtime/dashboard/.next/static/chunks/100.ax5hitxko.js +0 -1
  612. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14-39g6hwhcgn.js +0 -1
  613. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14ti2gx~1fiub.js +0 -1
  614. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14vqmdm7sosj2.js +0 -1
  615. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17h~onnkksf44.js +0 -138
  616. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17nx_vdk_qemm.js +0 -1
  617. package/dist/dashboard-runtime/dashboard/.next/static/chunks/1864_5-9a61tw.js +0 -1
  618. package/dist/dashboard-runtime/dashboard/.next/static/chunks/186jubvt5xyuj.js +0 -1
  619. /package/dist/dashboard-runtime/dashboard/.next/static/{wWmSSYUu4w4mIF1R_7UoM → nPPow7lCVx1fYDGH2XCxQ}/_buildManifest.js +0 -0
  620. /package/dist/dashboard-runtime/dashboard/.next/static/{wWmSSYUu4w4mIF1R_7UoM → nPPow7lCVx1fYDGH2XCxQ}/_clientMiddlewareManifest.js +0 -0
  621. /package/dist/dashboard-runtime/dashboard/.next/static/{wWmSSYUu4w4mIF1R_7UoM → nPPow7lCVx1fYDGH2XCxQ}/_ssgManifest.js +0 -0
@@ -4,7 +4,13 @@ import { useCallback, useEffect, useRef, useState } from "react";
4
4
 
5
5
  import { streamChat } from "@/services/llm-chat";
6
6
  import { newId } from "@/lib/random-id";
7
- import type { ChatMessage, ChatRequestBody } from "@/types/llm-chat";
7
+ import { devFlag } from "@/lib/dev-flags";
8
+ import {
9
+ removeAt,
10
+ removePair,
11
+ truncateUpToAndIncluding,
12
+ } from "@/lib/chat-message-ops";
13
+ import type { ChatMessage, ChatRequestBody, ChatRole } from "@/types/llm-chat";
8
14
 
9
15
  /**
10
16
  * Token deltas can arrive faster than React can profitably re-render
@@ -17,6 +23,7 @@ import type { ChatMessage, ChatRequestBody } from "@/types/llm-chat";
17
23
  type StreamPatch = { content?: string; reasoning?: string };
18
24
 
19
25
  export interface UseQaChatOptions {
26
+ activeInstance: string | null;
20
27
  providerId: string;
21
28
  model: string;
22
29
  systemPrompt: string;
@@ -35,6 +42,17 @@ export interface UseQaChatResult {
35
42
  isStreaming: boolean;
36
43
  error: string | null;
37
44
  send(userInput: string): Promise<void>;
45
+ /** Truncate to and including the given user message, then re-run the
46
+ * assistant pipeline. Powers resend / regenerate / edit-and-resend. */
47
+ reissueTurn(anchorUserId: string): Promise<void>;
48
+ /** Remove a message by id. When the target is a user message and
49
+ * `withNextAssistant` is true, the immediately-following assistant
50
+ * message (if any) is removed too. Persists immediately. */
51
+ deleteMessage(id: string, opts?: { withNextAssistant?: boolean }): void;
52
+ /** Rewrite the content of a user message in place. Returns the message
53
+ * id on success so the caller can chain `reissueTurn(id)` for the
54
+ * edit-and-resend flow, or null if the id wasn't a user message. */
55
+ editUserMessage(id: string, nextContent: string): string | null;
38
56
  stop(): void;
39
57
  clear(): void;
40
58
  /** Replace the entire message list, e.g. when switching sessions. */
@@ -133,57 +151,51 @@ export function useQaChat(options: UseQaChatOptions): UseQaChatResult {
133
151
 
134
152
  const clear = useCallback(() => {
135
153
  abortRef.current?.abort();
154
+ // Sync the ref before triggering the async setMessages so a `send` that
155
+ // happens to land in the same JS task — between this call and React's
156
+ // next commit — sees an empty history instead of the previous session's
157
+ // messages. The render-body assignment below catches the steady state;
158
+ // this assignment closes the in-flight window.
159
+ messagesRef.current = [];
136
160
  setMessages([]);
137
161
  setError(null);
138
162
  }, []);
139
163
 
140
164
  const replaceMessages = useCallback((next: ChatMessage[]) => {
141
165
  abortRef.current?.abort();
166
+ // Same race-window guard as in `clear` — see the comment there.
167
+ messagesRef.current = next;
142
168
  setMessages(next);
143
169
  setError(null);
144
170
  }, []);
145
171
 
146
- const send = useCallback(
147
- async (userInput: string) => {
148
- const trimmed = userInput.trim();
149
- if (!trimmed || isStreamingRef.current) return;
172
+ /**
173
+ * Internal: run one assistant turn against an already-prepared message
174
+ * list. Shared between `send` (which prepends a fresh user+assistant
175
+ * placeholder) and `reissueTurn` (which truncates and re-anchors on an
176
+ * existing user message).
177
+ *
178
+ * Pre-conditions:
179
+ * - `assistantId` matches a message in the current list (the placeholder)
180
+ * - `historyToSend` is the exact wire payload, already trimmed
181
+ * - the caller has already set isStreaming = true and abortRef
182
+ */
183
+ const _runAssistantTurn = useCallback(
184
+ async (
185
+ assistantId: string,
186
+ historyToSend: Array<{ role: ChatRole; content: string }>,
187
+ ) => {
150
188
  const opts = optionsRef.current;
151
- if (!opts.providerId || !opts.model) {
152
- setError("请先选择模型与 Provider");
153
- return;
154
- }
155
-
156
- setError(null);
157
- const userMsg: ChatMessage = {
158
- id: newId(),
159
- role: "user",
160
- content: trimmed,
161
- createdAt: Date.now(),
162
- status: "done",
163
- };
164
- const assistantId = newId();
165
- const assistantMsg: ChatMessage = {
166
- id: assistantId,
167
- role: "assistant",
168
- content: "",
169
- reasoning: "",
170
- createdAt: Date.now(),
171
- status: "streaming",
172
- };
173
-
174
- // Capture the history to send BEFORE inserting the placeholder so we
175
- // don't include an empty assistant turn in the request payload.
176
- const historyToSend = [...messagesRef.current, userMsg].map((m) => ({
177
- role: m.role,
178
- content: m.content,
179
- }));
180
-
181
- setMessages((prev) => [...prev, userMsg, assistantMsg]);
182
- setIsStreaming(true);
183
-
184
189
  const controller = new AbortController();
185
190
  abortRef.current = controller;
186
191
 
192
+ // Per-turn one-shot latches for the reasoning timing stamps. Refs
193
+ // (not state) because we observe them from inside the streaming loop
194
+ // closure — re-rendering on every flip would defeat the rAF batching
195
+ // that keeps token streaming at 60fps.
196
+ const reasoningStartedRef = { current: false };
197
+ const reasoningCompletedRef = { current: false };
198
+
187
199
  const updateAssistant = (patch: Partial<ChatMessage>) => {
188
200
  setMessages((prev) =>
189
201
  prev.map((m) => (m.id === assistantId ? { ...m, ...patch } : m)),
@@ -192,6 +204,7 @@ export function useQaChat(options: UseQaChatOptions): UseQaChatResult {
192
204
 
193
205
  try {
194
206
  const body: ChatRequestBody = {
207
+ activeInstance: opts.activeInstance,
195
208
  providerId: opts.providerId,
196
209
  model: opts.model,
197
210
  messages: historyToSend,
@@ -200,6 +213,18 @@ export function useQaChat(options: UseQaChatOptions): UseQaChatResult {
200
213
  rag: opts.rag,
201
214
  };
202
215
 
216
+ if (devFlag("logChatRequest")) {
217
+ // Diagnostic surface for the cross-session bleed investigation.
218
+ // Off by default; enable via
219
+ // localStorage.setItem("tsagent.dev.logChatRequest","1")
220
+ // in the browser devtools console.
221
+ console.groupCollapsed("[chat] outgoing turn");
222
+ console.log("assistantId", assistantId);
223
+ console.log("messages", historyToSend);
224
+ console.log("rag.knowledgeBases", opts.rag?.knowledgeBases);
225
+ console.groupEnd();
226
+ }
227
+
203
228
  for await (const event of streamChat(body, controller.signal)) {
204
229
  if (event.type === "query.rewritten") {
205
230
  updateAssistant({
@@ -207,11 +232,14 @@ export function useQaChat(options: UseQaChatOptions): UseQaChatResult {
207
232
  retrievalQueryRewritten: event.query !== event.original,
208
233
  });
209
234
  } else if (event.type === "query.fallback") {
210
- // Rewriter failed; surface the original query without the
211
- // "rewritten" badge so the UI stays quiet.
235
+ // Rewriter failed; record the failure so the UI can surface a
236
+ // non-blocking warning chip while the pipeline continues with
237
+ // the original query.
212
238
  updateAssistant({
213
239
  retrievalQuery: event.original,
214
240
  retrievalQueryRewritten: false,
241
+ queryRewriteFailed: true,
242
+ queryRewriteError: event.reason,
215
243
  });
216
244
  } else if (event.type === "retrieval.done") {
217
245
  updateAssistant({
@@ -222,52 +250,72 @@ export function useQaChat(options: UseQaChatOptions): UseQaChatResult {
222
250
  const buf = pendingDeltasRef.current.get(assistantId) ?? {};
223
251
  buf.reasoning = (buf.reasoning ?? "") + event.delta;
224
252
  pendingDeltasRef.current.set(assistantId, buf);
253
+ if (!reasoningStartedRef.current) {
254
+ reasoningStartedRef.current = true;
255
+ updateAssistant({ reasoningStartedAt: Date.now() });
256
+ }
225
257
  scheduleFlush();
226
258
  } else if (event.type === "content.delta") {
227
259
  const buf = pendingDeltasRef.current.get(assistantId) ?? {};
228
260
  buf.content = (buf.content ?? "") + event.delta;
229
261
  pendingDeltasRef.current.set(assistantId, buf);
262
+ if (reasoningStartedRef.current && !reasoningCompletedRef.current) {
263
+ reasoningCompletedRef.current = true;
264
+ updateAssistant({ reasoningCompletedAt: Date.now() });
265
+ }
230
266
  scheduleFlush();
231
267
  } else if (event.type === "error") {
232
- // Terminal event: drain any buffered deltas synchronously
233
- // before applying the status patch so the user sees the full
234
- // partial answer alongside the error badge.
235
268
  cancelScheduledFlush();
236
269
  flushDeltas();
237
- updateAssistant({
270
+ const patch: Partial<ChatMessage> = {
238
271
  status: "error",
239
272
  errorMessage: `${event.code}: ${event.message}`,
240
- });
273
+ };
274
+ if (reasoningStartedRef.current && !reasoningCompletedRef.current) {
275
+ patch.reasoningCompletedAt = Date.now();
276
+ }
277
+ updateAssistant(patch);
241
278
  setError(event.message);
242
279
  break;
243
280
  } else if (event.type === "done") {
244
281
  cancelScheduledFlush();
245
282
  flushDeltas();
246
- updateAssistant({ status: "done" });
283
+ const patch: Partial<ChatMessage> = { status: "done" };
284
+ if (reasoningStartedRef.current && !reasoningCompletedRef.current) {
285
+ patch.reasoningCompletedAt = Date.now();
286
+ }
287
+ updateAssistant(patch);
247
288
  break;
248
289
  }
249
290
  }
250
291
  } catch (err) {
251
- // AbortError is expected when the user clicks "stop"; do not treat
252
- // it as a hard failure. Either way, drain any buffered deltas so
253
- // the partial answer is preserved on screen.
292
+ // AbortError is expected when the user clicks "stop" or starts a new
293
+ // turn; do not treat it as a hard failure. Either way drain buffered
294
+ // deltas so any partial answer is preserved.
254
295
  cancelScheduledFlush();
255
296
  flushDeltas();
256
297
  const isAbort =
257
298
  err instanceof DOMException && err.name === "AbortError";
299
+ const closeReasoning =
300
+ reasoningStartedRef.current && !reasoningCompletedRef.current
301
+ ? { reasoningCompletedAt: Date.now() }
302
+ : undefined;
258
303
  if (!isAbort) {
259
304
  const message = err instanceof Error ? err.message : String(err);
260
- updateAssistant({ status: "error", errorMessage: message });
305
+ updateAssistant({
306
+ status: "error",
307
+ errorMessage: message,
308
+ ...closeReasoning,
309
+ });
261
310
  setError(message);
262
311
  } else {
263
- updateAssistant({ status: "done" });
312
+ updateAssistant({ status: "done", ...closeReasoning });
264
313
  }
265
314
  } finally {
266
315
  setIsStreaming(false);
267
316
  abortRef.current = null;
268
- // Flush the latest snapshot to the persist handler. Using the functional
269
- // setter avoids racing with the in-flight closure: we observe whatever
270
- // the reducer has just committed.
317
+ // Flush the latest snapshot to the persist handler. Functional
318
+ // setter avoids racing with the in-flight closure.
271
319
  const persist = onPersistRef.current;
272
320
  if (persist) {
273
321
  setMessages((prev) => {
@@ -277,18 +325,175 @@ export function useQaChat(options: UseQaChatOptions): UseQaChatResult {
277
325
  }
278
326
  }
279
327
  },
280
- // No `messages`/`options`/`isStreaming` in deps: we read them through
281
- // refs above so the callback identity stays stable across the entire
282
- // streaming session, which prevents downstream memos (composer, message
283
- // list) from invalidating on every token.
284
328
  [scheduleFlush, flushDeltas, cancelScheduledFlush],
285
329
  );
286
330
 
331
+ const send = useCallback(
332
+ async (userInput: string) => {
333
+ const trimmed = userInput.trim();
334
+ if (!trimmed || isStreamingRef.current) return;
335
+ const opts = optionsRef.current;
336
+ if (!opts.providerId || !opts.model) {
337
+ setError("请先选择模型与 Provider");
338
+ return;
339
+ }
340
+
341
+ setError(null);
342
+ const userMsg: ChatMessage = {
343
+ id: newId(),
344
+ role: "user",
345
+ content: trimmed,
346
+ createdAt: Date.now(),
347
+ status: "done",
348
+ };
349
+ const assistantId = newId();
350
+ // Snapshot whether this turn is RAG-enabled. The pill uses this to pick
351
+ // pre-stream labels (intent extraction → retrieval → thinking) instead
352
+ // of a single generic "正在思考" that sits unchanged for several
353
+ // seconds while the server runs the rewriter and KB queries.
354
+ const usingRag = (opts.rag?.knowledgeBases?.length ?? 0) > 0;
355
+ const assistantMsg: ChatMessage = {
356
+ id: assistantId,
357
+ role: "assistant",
358
+ content: "",
359
+ reasoning: "",
360
+ createdAt: Date.now(),
361
+ status: "streaming",
362
+ usingRag,
363
+ };
364
+
365
+ // Capture the history to send BEFORE inserting the placeholder so we
366
+ // don't include an empty assistant turn in the request payload.
367
+ const historyToSend = [...messagesRef.current, userMsg].map((m) => ({
368
+ role: m.role,
369
+ content: m.content,
370
+ }));
371
+
372
+ // Sync the ref alongside setMessages so a follow-up reissueTurn or a
373
+ // racing read sees the new state immediately, not on the next commit.
374
+ const nextMessages = [...messagesRef.current, userMsg, assistantMsg];
375
+ messagesRef.current = nextMessages;
376
+ setMessages(nextMessages);
377
+ setIsStreaming(true);
378
+
379
+ await _runAssistantTurn(assistantId, historyToSend);
380
+ },
381
+ [_runAssistantTurn],
382
+ );
383
+
384
+ /**
385
+ * Truncate to and including `anchorUserId`, then re-run the assistant
386
+ * pipeline against that user message. Powers UI-level「重新发送」、
387
+ *「重新生成」、「编辑后保存」 — the editing path mutates the anchor's
388
+ * content via `editUserMessage` first and then calls this.
389
+ *
390
+ * No-op if streaming is already in flight, the anchor is missing, or
391
+ * the anchor isn't a user message.
392
+ */
393
+ const reissueTurn = useCallback(
394
+ async (anchorUserId: string) => {
395
+ if (isStreamingRef.current) return;
396
+ const opts = optionsRef.current;
397
+ if (!opts.providerId || !opts.model) {
398
+ setError("请先选择模型与 Provider");
399
+ return;
400
+ }
401
+
402
+ const truncated = truncateUpToAndIncluding(
403
+ messagesRef.current,
404
+ anchorUserId,
405
+ );
406
+ const anchor = truncated[truncated.length - 1];
407
+ if (!anchor || anchor.role !== "user") return;
408
+
409
+ setError(null);
410
+
411
+ const assistantId = newId();
412
+ const usingRag = (opts.rag?.knowledgeBases?.length ?? 0) > 0;
413
+ const assistantMsg: ChatMessage = {
414
+ id: assistantId,
415
+ role: "assistant",
416
+ content: "",
417
+ reasoning: "",
418
+ createdAt: Date.now(),
419
+ status: "streaming",
420
+ usingRag,
421
+ };
422
+
423
+ const historyToSend = truncated.map((m) => ({
424
+ role: m.role,
425
+ content: m.content,
426
+ }));
427
+
428
+ const nextMessages = [...truncated, assistantMsg];
429
+ messagesRef.current = nextMessages;
430
+ setMessages(nextMessages);
431
+ setIsStreaming(true);
432
+
433
+ await _runAssistantTurn(assistantId, historyToSend);
434
+ },
435
+ [_runAssistantTurn],
436
+ );
437
+
438
+ /**
439
+ * Remove a single message by id. When `withNextAssistant` is true and the
440
+ * target is a user message immediately followed by an assistant message,
441
+ * remove that assistant too (the "paired delete" semantic from the spec).
442
+ *
443
+ * Persists immediately via the registered onPersist callback — pure
444
+ * deletes don't trigger a streaming turn so we cannot rely on the
445
+ * `finally` block in `_runAssistantTurn` to write to localStorage.
446
+ */
447
+ const deleteMessage = useCallback(
448
+ (id: string, opts?: { withNextAssistant?: boolean }) => {
449
+ if (isStreamingRef.current) return;
450
+ const list = messagesRef.current;
451
+ const target = list.find((m) => m.id === id);
452
+ if (!target) return;
453
+
454
+ const next =
455
+ target.role === "user" && opts?.withNextAssistant
456
+ ? removePair(list, id)
457
+ : removeAt(list, id);
458
+
459
+ messagesRef.current = next;
460
+ setMessages(next);
461
+ onPersistRef.current?.(next);
462
+ },
463
+ [],
464
+ );
465
+
466
+ /**
467
+ * Replace the textual content of a user message in place — used by the
468
+ * inline edit affordance before it calls `reissueTurn` to rerun the
469
+ * assistant pipeline against the new content. Returns the message id on
470
+ * success so the caller can chain `reissueTurn(id)` without re-querying;
471
+ * returns null when the id isn't a user message.
472
+ */
473
+ const editUserMessage = useCallback(
474
+ (id: string, nextContent: string) => {
475
+ const list = messagesRef.current;
476
+ const idx = list.findIndex((m) => m.id === id);
477
+ if (idx < 0 || list[idx].role !== "user") return null;
478
+ const updated = list.slice();
479
+ updated[idx] = { ...list[idx], content: nextContent };
480
+ messagesRef.current = updated;
481
+ setMessages(updated);
482
+ // Do NOT persist here — the typical caller follows up with
483
+ // reissueTurn, which will persist after the stream settles.
484
+ return id;
485
+ },
486
+ [],
487
+ );
488
+
287
489
  return {
288
490
  messages,
289
491
  isStreaming,
290
492
  error,
291
493
  send,
494
+ reissueTurn,
495
+ deleteMessage,
496
+ editUserMessage,
292
497
  stop,
293
498
  clear,
294
499
  setMessages: replaceMessages,
@@ -1,17 +1,15 @@
1
1
  import { useMutation, useQueryClient } from "@tanstack/react-query";
2
2
  import { updateKnowledgeBase } from "@/services/knowledge-base";
3
3
  import type { UpdateKBRequest } from "@/types/knowledge-base";
4
+ import { invalidateKnowledgeBaseQueries } from "@/lib/query-keys";
4
5
 
5
6
  export function useUpdateKB() {
6
7
  const queryClient = useQueryClient();
7
8
 
8
9
  return useMutation({
9
10
  mutationFn: (request: UpdateKBRequest) => updateKnowledgeBase(request),
10
- onSuccess: (_data, variables) => {
11
- queryClient.invalidateQueries({ queryKey: ["knowledge-bases"] });
12
- queryClient.invalidateQueries({
13
- queryKey: ["knowledge-bases", variables.knowledgeBaseName],
14
- });
11
+ onSuccess: () => {
12
+ invalidateKnowledgeBaseQueries(queryClient);
15
13
  },
16
14
  });
17
15
  }
@@ -2,16 +2,14 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
2
2
 
3
3
  import { updateProvider } from "@/services/llm-providers";
4
4
  import type { UpdateLLMProviderInput } from "@/types/llm-provider";
5
-
6
- import { LLM_PROVIDERS_QUERY_KEY } from "./use-llm-providers";
5
+ import { invalidateLLMProviderQueries } from "@/lib/query-keys";
7
6
 
8
7
  export function useUpdateLLMProvider(id: string) {
9
8
  const queryClient = useQueryClient();
10
9
  return useMutation({
11
10
  mutationFn: (patch: UpdateLLMProviderInput) => updateProvider(id, patch),
12
11
  onSuccess: () => {
13
- queryClient.invalidateQueries({ queryKey: LLM_PROVIDERS_QUERY_KEY });
14
- queryClient.invalidateQueries({ queryKey: ["llm-providers", id] });
12
+ invalidateLLMProviderQueries(queryClient);
15
13
  },
16
14
  });
17
15
  }
@@ -1,17 +1,15 @@
1
1
  import { useMutation, useQueryClient } from "@tanstack/react-query";
2
2
  import { updateMemoryStore } from "@/services/memory";
3
3
  import type { UpdateMemoryStoreRequest } from "@/types/memory";
4
+ import { invalidateMemoryQueries } from "@/lib/query-keys";
4
5
 
5
6
  export function useUpdateMemoryStore() {
6
7
  const queryClient = useQueryClient();
7
8
 
8
9
  return useMutation({
9
10
  mutationFn: (request: UpdateMemoryStoreRequest) => updateMemoryStore(request),
10
- onSuccess: (_data, variables) => {
11
- queryClient.invalidateQueries({ queryKey: ["memory", "stores"] });
12
- queryClient.invalidateQueries({
13
- queryKey: ["memory", "stores", variables.memoryStoreName],
14
- });
11
+ onSuccess: () => {
12
+ invalidateMemoryQueries(queryClient);
15
13
  },
16
14
  });
17
15
  }
@@ -1,14 +1,15 @@
1
1
  import { useMutation, useQueryClient } from "@tanstack/react-query";
2
2
  import { updateMemoryUnit } from "@/services/memory";
3
3
  import type { UpdateMemoryUnitRequest } from "@/types/memory";
4
+ import { invalidateMemoryQueries } from "@/lib/query-keys";
4
5
 
5
6
  export function useUpdateMemoryUnit() {
6
7
  const queryClient = useQueryClient();
7
8
 
8
9
  return useMutation({
9
10
  mutationFn: (request: UpdateMemoryUnitRequest) => updateMemoryUnit(request),
10
- onSuccess: (_data, variables) => {
11
- queryClient.invalidateQueries({ queryKey: ["memory", "stores", variables.memoryStoreName, "units"] });
11
+ onSuccess: () => {
12
+ invalidateMemoryQueries(queryClient);
12
13
  },
13
14
  });
14
15
  }
@@ -1,5 +1,10 @@
1
+ import { useCallback, useRef, useState } from "react";
1
2
  import { useMutation, useQueryClient } from "@tanstack/react-query";
2
- import { uploadDocuments } from "@/services/documents";
3
+ import {
4
+ uploadDocumentsBatched,
5
+ type BatchUploadProgress,
6
+ } from "@/services/documents";
7
+ import { invalidateKnowledgeBaseQueries } from "@/lib/query-keys";
3
8
 
4
9
  interface UploadDocumentsVariables {
5
10
  knowledgeBaseName: string;
@@ -10,14 +15,28 @@ interface UploadDocumentsVariables {
10
15
 
11
16
  export function useUploadDocuments() {
12
17
  const queryClient = useQueryClient();
18
+ const [progress, setProgress] = useState<BatchUploadProgress | null>(null);
19
+ const progressRef = useRef(progress);
20
+ progressRef.current = progress;
13
21
 
14
- return useMutation({
22
+ const resetProgress = useCallback(() => setProgress(null), []);
23
+
24
+ const mutation = useMutation({
15
25
  mutationFn: ({ knowledgeBaseName, files, subspace, metadata }: UploadDocumentsVariables) =>
16
- uploadDocuments(knowledgeBaseName, files, { subspace, metadata }),
17
- onSuccess: (_data, variables) => {
18
- queryClient.invalidateQueries({
19
- queryKey: ["knowledge-bases", variables.knowledgeBaseName, "documents"],
20
- });
26
+ uploadDocumentsBatched(knowledgeBaseName, files, {
27
+ subspace,
28
+ metadata,
29
+ onProgress: setProgress,
30
+ }),
31
+ onSuccess: () => {
32
+ invalidateKnowledgeBaseQueries(queryClient);
33
+ },
34
+ onSettled: () => {
35
+ // Keep progress visible briefly so the user can read the final state,
36
+ // then clear it for the next upload.
37
+ setTimeout(resetProgress, 300);
21
38
  },
22
39
  });
40
+
41
+ return { ...mutation, progress };
23
42
  }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Pure message-list mutators powering the chat surface's destructive
3
+ * operations (delete, truncate-and-rerun). Kept free of React, of the
4
+ * concrete `ChatMessage` shape, and of any side effects so we can test
5
+ * the rules in isolation under vitest's existing node environment.
6
+ *
7
+ * Consumers thread their own `ChatMessage` (or a structural subtype) — we
8
+ * only need `id` and `role`.
9
+ */
10
+ export interface MinimalMsg {
11
+ id: string;
12
+ role: "user" | "assistant" | "system";
13
+ content?: string;
14
+ }
15
+
16
+ /** Identity-preserving slice: returns the input array unchanged when the
17
+ * anchor isn't present, so React reference equality keeps memoised
18
+ * consumers from re-rendering on a no-op. */
19
+ export function truncateUpToAndIncluding<T extends MinimalMsg>(
20
+ list: T[],
21
+ anchorId: string,
22
+ ): T[] {
23
+ const idx = list.findIndex((m) => m.id === anchorId);
24
+ if (idx < 0) return list;
25
+ return list.slice(0, idx + 1);
26
+ }
27
+
28
+ /** Drops the anchor and everything after it. */
29
+ export function truncateBefore<T extends MinimalMsg>(
30
+ list: T[],
31
+ anchorId: string,
32
+ ): T[] {
33
+ const idx = list.findIndex((m) => m.id === anchorId);
34
+ if (idx < 0) return list;
35
+ return list.slice(0, idx);
36
+ }
37
+
38
+ /** Remove a single message by id. */
39
+ export function removeAt<T extends MinimalMsg>(list: T[], id: string): T[] {
40
+ const idx = list.findIndex((m) => m.id === id);
41
+ if (idx < 0) return list;
42
+ const next = list.slice();
43
+ next.splice(idx, 1);
44
+ return next;
45
+ }
46
+
47
+ /**
48
+ * Remove a user message AND the immediately-following assistant message
49
+ * (the "paired delete" semantic). When the next slot isn't an assistant —
50
+ * either because it's another user message or because the user message is
51
+ * at the tail — only the user message is removed.
52
+ */
53
+ export function removePair<T extends MinimalMsg>(list: T[], userId: string): T[] {
54
+ const idx = list.findIndex((m) => m.id === userId);
55
+ if (idx < 0) return list;
56
+ const next = list.slice();
57
+ const removeCount =
58
+ list[idx + 1] && list[idx + 1].role === "assistant" ? 2 : 1;
59
+ next.splice(idx, removeCount);
60
+ return next;
61
+ }
62
+
63
+ /** Walk backwards from the given assistant message and return the nearest
64
+ * user message above it. Returns null when none exists or the target id
65
+ * isn't in the list. */
66
+ export function findUserAnchorAbove<T extends MinimalMsg>(
67
+ list: T[],
68
+ fromId: string,
69
+ ): T | null {
70
+ const idx = list.findIndex((m) => m.id === fromId);
71
+ if (idx < 0) return null;
72
+ for (let i = idx - 1; i >= 0; i -= 1) {
73
+ if (list[i].role === "user") return list[i];
74
+ }
75
+ return null;
76
+ }
@@ -0,0 +1,22 @@
1
+ export const DEFAULT_PAGE_SIZE = 20;
2
+
3
+ export const KB_NAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_-]{1,62}[a-zA-Z0-9]$/;
4
+
5
+ export const ERROR_CODE_MAP = {
6
+ INVALID_PARAMETER: "参数错误",
7
+ NOT_FOUND: "资源不存在",
8
+ ALREADY_EXISTS: "资源已存在",
9
+ INTERNAL_ERROR: "服务内部错误",
10
+ UNAUTHORIZED: "未授权",
11
+ RATE_LIMITED: "请求过于频繁",
12
+ } as const satisfies Record<string, string>;
13
+
14
+ export const METADATA_TYPES = [
15
+ "keyword",
16
+ "text",
17
+ "long",
18
+ "double",
19
+ "boolean",
20
+ ] as const;
21
+
22
+ export type MetadataType = (typeof METADATA_TYPES)[number];