@tablestore/tablestore-agent-cli 0.2.1 → 0.2.4

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 (342) hide show
  1. package/dist/commands/kb/create.d.ts.map +1 -1
  2. package/dist/commands/kb/create.js +9 -0
  3. package/dist/commands/kb/create.js.map +1 -1
  4. package/dist/commands/kb/retrieve.d.ts.map +1 -1
  5. package/dist/commands/kb/retrieve.js +40 -3
  6. package/dist/commands/kb/retrieve.js.map +1 -1
  7. package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
  8. package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +5 -5
  9. package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
  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.nft.json +1 -1
  12. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  13. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page/build-manifest.json +2 -2
  14. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
  15. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
  16. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page/build-manifest.json +2 -2
  17. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
  18. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
  19. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page/build-manifest.json +2 -2
  20. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
  21. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
  22. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page/build-manifest.json +2 -2
  23. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
  24. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
  25. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page/build-manifest.json +2 -2
  26. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
  27. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
  28. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page/build-manifest.json +2 -2
  29. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
  30. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
  31. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page/build-manifest.json +2 -2
  32. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
  33. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
  34. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page/build-manifest.json +2 -2
  35. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
  36. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
  37. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page/build-manifest.json +2 -2
  38. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
  39. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
  40. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page/build-manifest.json +2 -2
  41. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  42. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  43. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page/build-manifest.json +2 -2
  44. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
  45. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
  46. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page/build-manifest.json +2 -2
  47. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
  48. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
  49. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page/build-manifest.json +2 -2
  50. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
  51. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
  52. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page/build-manifest.json +2 -2
  53. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
  54. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
  55. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page/build-manifest.json +2 -2
  56. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
  57. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
  58. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page/build-manifest.json +2 -2
  59. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
  60. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
  61. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page/build-manifest.json +2 -2
  62. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
  63. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
  64. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page/build-manifest.json +2 -2
  65. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
  66. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  67. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page/build-manifest.json +2 -2
  68. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  69. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  70. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error/page/build-manifest.json +2 -2
  71. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
  72. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
  73. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  74. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  75. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page/build-manifest.json +2 -2
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +14 -14
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
  112. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
  113. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
  114. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
  115. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -1
  116. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
  117. package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
  118. package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +14 -14
  119. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  120. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +14 -14
  121. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +3 -3
  122. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +10 -10
  123. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  124. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page/build-manifest.json +2 -2
  125. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  126. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
  127. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +17 -17
  128. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +17 -17
  129. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +3 -3
  130. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +10 -10
  131. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  132. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  133. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +4 -4
  134. package/dist/dashboard-runtime/dashboard/.next/server/app/page/build-manifest.json +2 -2
  135. package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  136. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +9 -6
  137. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02p1x3t._.js +1 -1
  138. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0fglxiw._.js +1 -1
  139. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0lvi0g-._.js +2 -2
  140. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q8vcw8._.js +1 -1
  141. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +2 -2
  142. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95_src_app_(dashboard)_knowledge-base_[name]_settings_settings-client_tsx_13312zk._.js +1 -1
  143. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08faq-z._.js +3 -0
  144. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0c94d.y._.js +3 -0
  145. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0jb9ccl._.js +1 -1
  146. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__13ylf4x._.js → [root-of-the-server]__0lgg04c._.js} +2 -2
  147. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__10rkv6z._.js +1 -1
  148. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01-2v37._.js +1 -1
  149. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01ag-vl._.js +3 -0
  150. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_09yzbcp._.js +1 -1
  151. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0atzifq._.js +3 -0
  152. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f4u0.1._.js +1 -1
  153. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gbt~hy._.js +1 -1
  154. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gl7kh7._.js +3 -0
  155. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j-q~ro._.js +1 -1
  156. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jghj2_._.js +1 -1
  157. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jlyg05._.js +3 -0
  158. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0n4gd_6._.js +1 -1
  159. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0l~-9i0._.js → _0tdjkbc._.js} +2 -2
  160. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tej2s.._.js +1 -1
  161. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_10u~-xc._.js +3 -0
  162. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12r9c8h._.js +1 -1
  163. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0.glq39._.js +3 -0
  164. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00ofp7q._.js +1 -1
  165. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_05.qn9h._.js +3 -0
  166. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_065m1.j._.js +1 -1
  167. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0xf3ffa._.js +1 -1
  168. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
  169. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
  170. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_create_page_tsx_0916~g-._.js +1 -1
  171. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_settings_page_tsx_0y26.xu._.js +1 -1
  172. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
  173. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ls1exu._.js +1 -1
  174. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ugdjlb._.js +1 -1
  175. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +5 -5
  176. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  177. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  178. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  179. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  180. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00wmf85833643.js +1 -0
  181. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02tj1_rhgobzv.js +1 -0
  182. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0mea2ylxe.umh.js → 02zf3qddfaw~u.js} +1 -1
  183. package/dist/dashboard-runtime/dashboard/.next/static/chunks/039i70t10axdd.css +1 -0
  184. package/dist/dashboard-runtime/dashboard/.next/static/chunks/04bfame9rk.3d.js +5 -0
  185. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07rwb_uq9qcx4.js +1 -0
  186. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07ygw8215kyvc.js +1 -0
  187. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b5hr027rat4w.js +138 -0
  188. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0__g1ogrdh412.js → 0bkm-5yza5~d2.js} +1 -1
  189. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0lrw.bnws62y9.js → 0d7d.b.v9noym.js} +1 -1
  190. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0cto67_iw~p9z.js → 0fdofp-3kkc4g.js} +1 -1
  191. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0i8hdbek9j-fu.js +1 -0
  192. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ioivx4pbmayb.js +1 -0
  193. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j-v5f_oscvfu.js +1 -0
  194. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0lp2g_27uyhuz.js → 0je7fmsrz2vok.js} +1 -1
  195. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jukioxtp1mn3.js +138 -0
  196. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0klidr2i6cd.g.js +1 -0
  197. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k~bkh1586r2i.js +1 -0
  198. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0nakvv2p1kjnf.js +1 -0
  199. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0t5vdnq4s.2yv.js +1 -0
  200. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0un~rqes29pcr.js +1 -0
  201. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v.u57bsjppd_.js +1 -0
  202. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0fagnytrt.3oe.js → 0veza1g0elxa7.js} +1 -1
  203. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x3w~yxvm1xsq.js +4 -0
  204. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x5gol39unrgb.js +1 -0
  205. package/dist/dashboard-runtime/dashboard/.next/static/chunks/12s59v_sk0q-z.js +1 -0
  206. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{06uuhz24tvdt..js → 14~eqof4660i3.js} +1 -1
  207. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16y3764x-fh1n.js +1 -0
  208. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17mcnyr~1j7ih.js +1 -0
  209. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{turbopack-0w.hw6u8qra5z.js → turbopack-0~gu0g2v-1f11.js} +1 -1
  210. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/page.tsx +5 -0
  211. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/documents/documents-client.tsx +4 -1
  212. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/layout-client.tsx +62 -26
  213. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/page.tsx +8 -4
  214. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/page.tsx +6 -2
  215. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/request-detail-dialog.tsx +9 -9
  216. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/requests-table.tsx +2 -2
  217. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +5 -1
  218. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/settings/page.tsx +56 -17
  219. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +11 -7
  220. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/create/page.tsx +1 -1
  221. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/page.tsx +1 -1
  222. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.ts +67 -0
  223. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/memory-helpers.ts +45 -0
  224. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +334 -16
  225. package/dist/dashboard-runtime/dashboard/src/app/api/v1/logs/client/route.ts +13 -0
  226. package/dist/dashboard-runtime/dashboard/src/app/api/v1/oss/list/route.ts +1 -0
  227. package/dist/dashboard-runtime/dashboard/src/app/globals.css +23 -0
  228. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +116 -19
  229. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-mount-config.tsx +5 -0
  230. package/dist/dashboard-runtime/dashboard/src/components/chat/memory-bind-section.tsx +372 -0
  231. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-retrieval-dialog.tsx +360 -0
  232. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-row.tsx +49 -5
  233. package/dist/dashboard-runtime/dashboard/src/components/chat/unified-retrieval-section.tsx +61 -26
  234. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-chunks-dialog.tsx +72 -20
  235. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-detail-panel.tsx +578 -76
  236. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-upload-dialog.tsx +9 -81
  237. package/dist/dashboard-runtime/dashboard/src/components/documents/oss-browser.tsx +42 -26
  238. package/dist/dashboard-runtime/dashboard/src/components/instance/connect-instance-form.tsx +5 -0
  239. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/embedding-config-form.tsx +16 -2
  240. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-card.tsx +37 -24
  241. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-create-form.tsx +173 -86
  242. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-settings-form.tsx +319 -280
  243. package/dist/dashboard-runtime/dashboard/src/components/layout/detail-sidebar.tsx +47 -18
  244. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-instance-card.tsx +2 -2
  245. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-add-dialog.tsx +2 -2
  246. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-create-form.tsx +84 -56
  247. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-edit-dialog.tsx +2 -2
  248. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-messages-table.tsx +3 -3
  249. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-requests-table.tsx +12 -12
  250. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +20 -11
  251. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +7 -7
  252. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +6 -6
  253. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-settings-form.tsx +90 -21
  254. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +1 -1
  255. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-list.tsx +1 -1
  256. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-detail-panel.tsx +4 -4
  257. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +2 -2
  258. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +216 -5
  259. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-form.tsx +241 -24
  260. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-rerank-fields.tsx +1 -0
  261. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-result-card.tsx +52 -4
  262. package/dist/dashboard-runtime/dashboard/src/components/shared/metadata-field-input.tsx +54 -0
  263. package/dist/dashboard-runtime/dashboard/src/components/shared/status-badge.tsx +10 -5
  264. package/dist/dashboard-runtime/dashboard/src/components/ui/nav-tab-bar.tsx +1 -1
  265. package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +60 -5
  266. package/dist/dashboard-runtime/dashboard/src/hooks/use-document.ts +29 -0
  267. package/dist/dashboard-runtime/dashboard/src/hooks/use-oss-list.ts +7 -5
  268. package/dist/dashboard-runtime/dashboard/src/hooks/use-qa-chat.ts +65 -11
  269. package/dist/dashboard-runtime/dashboard/src/hooks/use-update-document.ts +15 -0
  270. package/dist/dashboard-runtime/dashboard/src/lib/api-error-toast.ts +62 -0
  271. package/dist/dashboard-runtime/dashboard/src/lib/constants.ts +8 -0
  272. package/dist/dashboard-runtime/dashboard/src/lib/metadata-form.ts +88 -0
  273. package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +14 -0
  274. package/dist/dashboard-runtime/dashboard/src/lib/server/api-helpers.ts +18 -5
  275. package/dist/dashboard-runtime/dashboard/src/lib/server/llm-client.ts +19 -1
  276. package/dist/dashboard-runtime/dashboard/src/lib/server/oss-client.ts +45 -16
  277. package/dist/dashboard-runtime/dashboard/src/schemas/knowledge-base.ts +6 -0
  278. package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +20 -0
  279. package/dist/dashboard-runtime/dashboard/src/schemas/retrieval.ts +46 -27
  280. package/dist/dashboard-runtime/dashboard/src/services/api-client.ts +31 -2
  281. package/dist/dashboard-runtime/dashboard/src/services/documents.ts +36 -3
  282. package/dist/dashboard-runtime/dashboard/src/types/knowledge-base.ts +10 -0
  283. package/dist/dashboard-runtime/dashboard/src/types/llm-chat.ts +33 -0
  284. package/dist/dashboard-runtime/dashboard/src/types/retrieval.ts +9 -4
  285. package/dist/dashboard-runtime/dashboard/tailwind.config.ts +4 -0
  286. package/dist/dashboard-runtime/dashboard/vitest.config.mjs +5 -2
  287. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +1 -0
  288. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  289. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +4 -0
  290. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  291. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  292. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js +1 -1
  293. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  294. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +21 -5
  295. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  296. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +1 -0
  297. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  298. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +4 -0
  299. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  300. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  301. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js +1 -1
  302. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  303. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +21 -5
  304. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  305. package/dist/utils/read-image-input.d.ts +47 -0
  306. package/dist/utils/read-image-input.d.ts.map +1 -0
  307. package/dist/utils/read-image-input.js +89 -0
  308. package/dist/utils/read-image-input.js.map +1 -0
  309. package/package.json +2 -2
  310. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0aqzu8w._.js +0 -3
  311. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0hozzu6._.js +0 -3
  312. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0kd7szs._.js +0 -3
  313. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tr8-3u._.js +0 -3
  314. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xzh5yw._.js +0 -3
  315. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12~3vfk._.js +0 -3
  316. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13_lb.o._.js +0 -3
  317. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0ejgygh._.js +0 -3
  318. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_0-tuf-h._.js +0 -3
  319. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00tz~p479bdgl.js +0 -1
  320. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02i9olo-312mq.js +0 -138
  321. package/dist/dashboard-runtime/dashboard/.next/static/chunks/062k9jbtd9.lv.js +0 -1
  322. package/dist/dashboard-runtime/dashboard/.next/static/chunks/069zf4m5f.se2.js +0 -1
  323. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07cp19da_kfld.js +0 -5
  324. package/dist/dashboard-runtime/dashboard/.next/static/chunks/086esp1n941jl.js +0 -138
  325. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09uxq~55qug8c.js +0 -1
  326. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0d29.l~3ip181.js +0 -1
  327. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ewpzgu_qf0wf.js +0 -4
  328. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jc31diex030o.js +0 -1
  329. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k79upjc40aky.css +0 -1
  330. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0snnsfosp3~gq.js +0 -1
  331. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0t0yqi68~eil6.js +0 -1
  332. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0th7u6qvdy3x2.js +0 -1
  333. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0tmwptel_4y0o.js +0 -1
  334. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6_s-0w8.yr..js +0 -1
  335. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u9wtl06_b72x.js +0 -1
  336. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v9d5wl9nsva3.js +0 -1
  337. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~kfzxrhgbkaz.js +0 -1
  338. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14.dp0-y_mhjo.js +0 -1
  339. package/dist/dashboard-runtime/dashboard/.next/static/chunks/15bzqpm440jvz.js +0 -1
  340. /package/dist/dashboard-runtime/dashboard/.next/static/{doYIl-pd6Sqax3bfUgN3q → EIbKHHti0Z1ephKfJzCKH}/_buildManifest.js +0 -0
  341. /package/dist/dashboard-runtime/dashboard/.next/static/{doYIl-pd6Sqax3bfUgN3q → EIbKHHti0Z1ephKfJzCKH}/_clientMiddlewareManifest.js +0 -0
  342. /package/dist/dashboard-runtime/dashboard/.next/static/{doYIl-pd6Sqax3bfUgN3q → EIbKHHti0Z1ephKfJzCKH}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,30363,e=>{"use strict";let r=(0,e.i(86620).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,r],30363)},23516,e=>{"use strict";var r=e.i(44501),n=e.i(70978),t=e.i(65581),a=e.i(79980),i=e.i(76490);let l={"knowledge-base":"知识库",memory:"记忆库","llm-providers":"大模型",projects:"项目管理",documents:"文档",retrieval:"检索测试",qa:"问答测试",search:"记忆检索",units:"长期记忆",messages:"短期记忆",requests:"请求审计",settings:"设置",create:"新建",new:"新建",chat:"对话"};e.s(["PageHeader",0,function({title:e,description:o,hideBreadcrumb:s,children:d,className:c}){let u=(0,t.usePathname)()??"/",m=s?[]:function(e){if(/^\/knowledge-base\/[^/]+(?:\/.*)?$/.test(e)||/^\/memory\/[^/]+(?:\/.*)?$/.test(e))return[];let r=e.split("/").filter(Boolean);if(0===r.length)return[];let n=[],t="";return r.forEach((e,a)=>{t+=`/${e}`;let i=decodeURIComponent(e),o=l[i]??i;n.push({label:o,href:a<r.length-1?t:void 0})}),n}(u);return(0,r.jsxs)("div",{className:(0,i.cn)("mb-5 flex flex-col gap-2",c),children:[m.length>1&&(0,r.jsxs)("nav",{"aria-label":"面包屑",className:"flex items-center gap-1 text-[13px] text-[hsl(var(--muted-foreground))]",children:[(0,r.jsx)(n.default,{href:"/",className:"transition-colors hover:text-[hsl(var(--foreground))]",children:"主页"}),m.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(a.ChevronRight,{className:"h-3 w-3 opacity-60"}),e.href?(0,r.jsx)(n.default,{href:e.href,className:"transition-colors hover:text-[hsl(var(--foreground))]",children:e.label}):(0,r.jsx)("span",{className:"font-medium text-[hsl(var(--foreground))]",children:e.label})]},`${e.label}-${t}`))]}),(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold leading-tight text-[hsl(var(--foreground))]",children:e}),o&&(0,r.jsx)("p",{className:"text-[13px] text-[hsl(var(--muted-foreground))]",children:o})]}),d&&(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:d})]})]})}])},53552,e=>{"use strict";let r=(0,e.i(86620).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,r],53552)},36283,e=>{"use strict";e.s(["IMAGE_FALLBACK_DATA_PREFIX",0,"data:image/jpeg;base64,","KB_NAME_REGEX",0,/^[a-zA-Z][a-zA-Z0-9_-]{1,62}[a-zA-Z0-9]$/])},3106,96359,20830,e=>{"use strict";var r=e.i(44501),n=e.i(17635),t=e.i(43250),a=e.i(80939),i=e.i(77275),l=e.i(91967),o=e.i(17256),s="Toggle",d=n.forwardRef((e,n)=>{let{pressed:t,defaultPressed:i,onPressedChange:d,...c}=e,[u,m]=(0,o.useControllableState)({prop:t,onChange:d,defaultProp:i??!1,caller:s});return(0,r.jsx)(a.Primitive.button,{type:"button","aria-pressed":u,"data-state":u?"on":"off","data-disabled":e.disabled?"":void 0,...c,ref:n,onClick:(0,l.composeEventHandlers)(e.onClick,()=>{e.disabled||m(!u)})})});d.displayName=s;var c=e.i(25486),u="ToggleGroup",[m,g]=(0,t.createContextScope)(u,[i.createRovingFocusGroupScope]),h=(0,i.createRovingFocusGroupScope)(),x=n.default.forwardRef((e,n)=>{let{type:t,...a}=e;if("single"===t)return(0,r.jsx)(b,{...a,ref:n});if("multiple"===t)return(0,r.jsx)(v,{...a,ref:n});throw Error(`Missing prop \`type\` expected on \`${u}\``)});x.displayName=u;var[p,f]=m(u),b=n.default.forwardRef((e,t)=>{let{value:a,defaultValue:i,onValueChange:l=()=>{},...s}=e,[d,c]=(0,o.useControllableState)({prop:a,defaultProp:i??"",onChange:l,caller:u});return(0,r.jsx)(p,{scope:e.__scopeToggleGroup,type:"single",value:n.default.useMemo(()=>d?[d]:[],[d]),onItemActivate:c,onItemDeactivate:n.default.useCallback(()=>c(""),[c]),children:(0,r.jsx)(F,{...s,ref:t})})}),v=n.default.forwardRef((e,t)=>{let{value:a,defaultValue:i,onValueChange:l=()=>{},...s}=e,[d,c]=(0,o.useControllableState)({prop:a,defaultProp:i??[],onChange:l,caller:u}),m=n.default.useCallback(e=>c((r=[])=>[...r,e]),[c]),g=n.default.useCallback(e=>c((r=[])=>r.filter(r=>r!==e)),[c]);return(0,r.jsx)(p,{scope:e.__scopeToggleGroup,type:"multiple",value:d,onItemActivate:m,onItemDeactivate:g,children:(0,r.jsx)(F,{...s,ref:t})})});x.displayName=u;var[j,C]=m(u),F=n.default.forwardRef((e,n)=>{let{__scopeToggleGroup:t,disabled:l=!1,rovingFocus:o=!0,orientation:s,dir:d,loop:u=!0,...m}=e,g=h(t),x=(0,c.useDirection)(d),p={role:"group",dir:x,...m};return(0,r.jsx)(j,{scope:t,rovingFocus:o,disabled:l,children:o?(0,r.jsx)(i.Root,{asChild:!0,...g,orientation:s,dir:x,loop:u,children:(0,r.jsx)(a.Primitive.div,{...p,ref:n})}):(0,r.jsx)(a.Primitive.div,{...p,ref:n})})}),y="ToggleGroupItem",N=n.default.forwardRef((e,t)=>{let a=f(y,e.__scopeToggleGroup),l=C(y,e.__scopeToggleGroup),o=h(e.__scopeToggleGroup),s=a.value.includes(e.value),d=l.disabled||e.disabled,c={...e,pressed:s,disabled:d},u=n.default.useRef(null);return l.rovingFocus?(0,r.jsx)(i.Item,{asChild:!0,...o,focusable:!d,active:s,ref:u,children:(0,r.jsx)(w,{...c,ref:t})}):(0,r.jsx)(w,{...c,ref:t})});N.displayName=y;var w=n.default.forwardRef((e,n)=>{let{__scopeToggleGroup:t,value:a,...i}=e,l=f(y,t),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s="single"===l.type?o:void 0;return(0,r.jsx)(d,{...s,...i,ref:n,onPressedChange:e=>{e?l.onItemActivate(a):l.onItemDeactivate(a)}})}),k=e.i(76490);let S=n.createContext({size:"default",variant:"default"}),T=n.forwardRef(({className:e,variant:n="default",size:t="default",children:a,...i},l)=>(0,r.jsx)(x,{ref:l,className:(0,k.cn)("inline-flex items-center justify-center gap-1",e),...i,children:(0,r.jsx)(S.Provider,{value:{variant:n,size:t},children:a})}));T.displayName=x.displayName;let I=n.forwardRef(({className:e,children:n,...t},a)=>(0,r.jsx)(N,{ref:a,className:(0,k.cn)("relative inline-flex items-center justify-center whitespace-nowrap","text-sm font-medium transition-all","first:rounded-l-[7px] last:rounded-r-[7px]","border-l border-[hsl(var(--border)/0.6)]","first:border-l-0","data-[state=on]:border-l-transparent","[&[data-state=on]+*]:border-l-transparent","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","hover:bg-[hsl(var(--muted)/0.6)] hover:text-[hsl(var(--foreground))]","data-[state=on]:bg-[hsl(var(--background))] data-[state=on]:text-[hsl(var(--foreground))] data-[state=on]:shadow-sm",e),...t,children:n}));I.displayName=N.displayName,e.s(["ToggleGroup",0,T,"ToggleGroupItem",0,I],3106);var R=e.i(46398);e.s(["TagInput",0,function({value:e,onChange:t,placeholder:a="输入后按回车添加"}){let[i,l]=(0,n.useState)(""),o=(0,n.useCallback)(r=>{let n=r.trim();n&&!e.includes(n)&&t([...e,n]),l("")},[e,t]),s=(0,n.useCallback)(r=>{t(e.filter((e,n)=>n!==r))},[e,t]);return(0,r.jsxs)("div",{className:(0,k.cn)("flex flex-wrap items-center gap-1.5 rounded-md border border-[hsl(var(--input))] bg-background px-3 py-2","focus-within:border-[hsl(var(--ring))] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0","min-h-10 transition-colors"),children:[e.map((e,n)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-primary-200 bg-primary-100 px-2 py-0.5 text-xs font-medium text-primary-700",children:[e,(0,r.jsx)("button",{type:"button",onClick:()=>s(n),className:"inline-flex items-center justify-center rounded-full p-0.5 hover:opacity-70 transition-opacity","aria-label":`删除标签 ${e}`,children:(0,r.jsx)(R.X,{size:12})})]},`${e}-${n}`)),(0,r.jsx)("input",{type:"text",value:i,onChange:e=>l(e.target.value),onKeyDown:r=>{("Enter"===r.key||","===r.key)&&(r.preventDefault(),o(i)),"Backspace"===r.key&&""===i&&e.length>0&&s(e.length-1)},placeholder:0===e.length?a:"",className:"flex-1 min-w-20 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]})}],96359);let _=(0,e.i(86620).default)("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);var z=e.i(21562),L=e.i(23888);e.s(["RetrievalResultCountField",0,function({control:e,name:n,label:t="返回片段数",description:a="单次检索返回的最多片段数,Rerank 后取前 N 条。",min:i=0,max:l,muted:o=!1,className:s}){return(0,r.jsx)(z.FormField,{control:e,name:n,render:({field:e})=>{let n="number"==typeof e.value&&Number.isFinite(e.value)?String(e.value):"";return(0,r.jsxs)(z.FormItem,{className:(0,k.cn)("mb-0 rounded-md border border-[hsl(var(--border)/0.6)] bg-[hsl(var(--card)/0.72)] p-3 shadow-[0_1px_2px_hsl(var(--foreground)/0.04)]",o&&"opacity-65",s),children:[(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[(0,r.jsxs)("div",{className:"flex min-w-0 gap-3",children:[(0,r.jsx)("span",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-[hsl(var(--primary)/0.08)] text-[hsl(var(--primary))]",children:(0,r.jsx)(_,{className:"h-3.5 w-3.5"})}),(0,r.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,r.jsx)(z.FormLabel,{className:"text-sm font-medium",children:t}),(0,r.jsx)("p",{className:"text-xs leading-relaxed text-[hsl(var(--muted-foreground))]",children:a})]})]}),(0,r.jsxs)("div",{className:"relative w-28 shrink-0",children:[(0,r.jsx)(z.FormControl,{children:(0,r.jsx)(L.Input,{ref:e.ref,name:e.name,type:"number",inputMode:"numeric",min:i,max:l,"aria-label":t,className:"h-9 w-full bg-[hsl(var(--background))] pr-8 text-right font-mono text-sm tabular-nums shadow-sm [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",value:n,onBlur:e.onBlur,onChange:r=>e.onChange(function(e){let r=e.trim();if(!r)return;let n=Number(r);return Number.isFinite(n)?n:void 0}(r.target.value))})}),(0,r.jsx)("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-xs text-[hsl(var(--muted-foreground))]",children:"条"})]})]}),(0,r.jsx)(z.FormMessage,{className:"pt-1"})]})}})}],20830)},64209,e=>{"use strict";var r=e.i(17635),n=e.i(91967),t=e.i(43250),a=e.i(17256),i=e.i(72687),l=e.i(67928),o=e.i(80939),s=e.i(90088),d=e.i(33616),c=e.i(44501),u="Collapsible",[m,g]=(0,t.createContextScope)(u),[h,x]=m(u),p=r.forwardRef((e,n)=>{let{__scopeCollapsible:t,open:i,defaultOpen:l,disabled:s,onOpenChange:m,...g}=e,[x,p]=(0,a.useControllableState)({prop:i,defaultProp:l??!1,onChange:m,caller:u});return(0,c.jsx)(h,{scope:t,disabled:s,contentId:(0,d.useId)(),open:x,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),children:(0,c.jsx)(o.Primitive.div,{"data-state":F(x),"data-disabled":s?"":void 0,...g,ref:n})})});p.displayName=u;var f="CollapsibleTrigger",b=r.forwardRef((e,r)=>{let{__scopeCollapsible:t,...a}=e,i=x(f,t);return(0,c.jsx)(o.Primitive.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":F(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...a,ref:r,onClick:(0,n.composeEventHandlers)(e.onClick,i.onOpenToggle)})});b.displayName=f;var v="CollapsibleContent",j=r.forwardRef((e,r)=>{let{forceMount:n,...t}=e,a=x(v,e.__scopeCollapsible);return(0,c.jsx)(s.Presence,{present:n||a.open,children:({present:e})=>(0,c.jsx)(C,{...t,ref:r,present:e})})});j.displayName=v;var C=r.forwardRef((e,n)=>{let{__scopeCollapsible:t,present:a,children:s,...d}=e,u=x(v,t),[m,g]=r.useState(a),h=r.useRef(null),p=(0,l.useComposedRefs)(n,h),f=r.useRef(0),b=f.current,j=r.useRef(0),C=j.current,y=u.open||m,N=r.useRef(y),w=r.useRef(void 0);return r.useEffect(()=>{let e=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,i.useLayoutEffect)(()=>{let e=h.current;if(e){w.current=w.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let r=e.getBoundingClientRect();f.current=r.height,j.current=r.width,N.current||(e.style.transitionDuration=w.current.transitionDuration,e.style.animationName=w.current.animationName),g(a)}},[u.open,a]),(0,c.jsx)(o.Primitive.div,{"data-state":F(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!y,...d,ref:p,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:y&&s})});function F(e){return e?"open":"closed"}e.s(["Collapsible",0,p,"CollapsibleContent",0,j,"CollapsibleTrigger",0,b],64209)},62769,e=>{"use strict";var r=e.i(44501),n=e.i(17635),t=e.i(76490);let a=n.forwardRef(({className:e,checked:n=!1,onCheckedChange:a,disabled:i,...l},o)=>(0,r.jsx)("button",{ref:o,type:"button",role:"switch","aria-checked":n,"data-state":n?"checked":"unchecked",disabled:i,onClick:()=>a?.(!n),className:(0,t.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors duration-200","shadow-[inset_0_0_0_1px_rgba(0,0,0,0.04),inset_0_1px_2px_rgba(0,0,0,0.06)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",n?"bg-[hsl(var(--primary-600))]":"bg-[hsl(var(--muted))] hover:bg-[hsl(var(--muted)/0.8)]",e),...l,children:(0,r.jsx)("span",{"aria-hidden":!0,className:(0,t.cn)("pointer-events-none block h-5 w-5 rounded-full bg-white transition-transform duration-200","shadow-[0_1px_2px_rgba(0,0,0,0.1),0_2px_6px_rgba(0,0,0,0.15)] ring-1 ring-black/4","ease-[cubic-bezier(0.34,1.56,0.64,1)]",n?"translate-x-5":"translate-x-0.5")})}));a.displayName="Switch",e.s(["Switch",0,a])},72238,64297,7187,e=>{"use strict";e.s(["handleNumberInput",0,function(e){return r=>{e(r.target.value?Number(r.target.value):void 0)}}],72238),e.s(["buildKnowledgeBaseRetrievalConfiguration",0,function(e){if(!e)return;let r=e.rerankingConfiguration,n=e.rerankType??r?.type,t={searchType:e.searchType??[]},a=e.denseTopK??e.denseVectorSearchConfiguration?.numberOfResults,i=e.fullTextTopK??e.fullTextSearchConfiguration?.numberOfResults,l=e.rerankTopK??r?.numberOfResults;if(void 0!==a&&(t.denseVectorSearchConfiguration={numberOfResults:a}),void 0!==i&&(t.fullTextSearchConfiguration={numberOfResults:i}),n){let a={type:n};void 0!==l&&(a.numberOfResults=l),"RRF"===n?a.rrfConfiguration={denseVectorSearchWeight:e.rrfDenseWeight??r?.rrfConfiguration?.denseVectorSearchWeight??0,fullTextSearchWeight:e.rrfFullTextWeight??r?.rrfConfiguration?.fullTextSearchWeight??0,k:e.rrfK??r?.rrfConfiguration?.k??60}:"WEIGHT"===n?a.weightConfiguration={denseVectorSearchWeight:e.weightDense??r?.weightConfiguration?.denseVectorSearchWeight??0,fullTextSearchWeight:e.weightFullText??r?.weightConfiguration?.fullTextSearchWeight??0}:"MODEL"===n&&(a.modelConfiguration={provider:e.modelProvider??r?.modelConfiguration?.provider??"bailian",model:e.modelName??r?.modelConfiguration?.model??"gte-rerank-v2"}),t.rerankingConfiguration=a}return t}],64297);var r=e.i(32356),n=e.i(36283);let t=r.z.enum(["string","long","double","boolean","date","string_list","long_list","double_list","boolean_list","date_list"]),a=r.z.object({name:r.z.string().min(1).max(128),type:t}),i=r.z.object({provider:r.z.enum(["bailian","custom"]),model:r.z.string().min(1),dimension:r.z.number().int().positive(),apiKey:r.z.string().optional(),url:r.z.string().url().optional()}),l=r.z.object({type:r.z.enum(["RRF","WEIGHT","MODEL"]),numberOfResults:r.z.number().int().min(0).max(200).optional(),rrfConfiguration:r.z.object({denseVectorSearchWeight:r.z.number().min(0),fullTextSearchWeight:r.z.number().min(0),k:r.z.number().int().positive()}).optional(),weightConfiguration:r.z.object({denseVectorSearchWeight:r.z.number().min(0).max(1),fullTextSearchWeight:r.z.number().min(0).max(1)}).optional(),modelConfiguration:r.z.object({provider:r.z.string().min(1),model:r.z.string().min(1)}).optional()}),o=r.z.object({searchType:r.z.array(r.z.enum(["DENSE_VECTOR","FULL_TEXT"])).min(1).optional(),denseVectorSearchConfiguration:r.z.object({numberOfResults:r.z.number().int().min(0).max(100)}).optional(),fullTextSearchConfiguration:r.z.object({numberOfResults:r.z.number().int().min(0).max(100)}).optional(),rerankingConfiguration:l.optional()}),s=r.z.object({knowledgeBaseName:r.z.string().min(1,"Knowledge base name is required").max(64,"Name must be at most 64 characters").regex(n.KB_NAME_REGEX,"名称必须以字母开头,仅允许字母、数字、下划线和连字符,长度 3-64 字符,不能以下划线或连字符结尾"),description:r.z.string().max(4096).optional(),subspace:r.z.boolean().optional(),tags:r.z.array(r.z.string()).optional(),metadata:r.z.array(a).max(200).optional(),embeddingConfiguration:i.optional(),retrievalConfiguration:o.optional(),multimodal:r.z.boolean().optional(),ingestConfiguration:r.z.object({enableTableFormulaCaption:r.z.boolean().optional()}).optional()}),d=r.z.object({knowledgeBaseName:r.z.string().min(1),description:r.z.string().max(4096).optional(),tags:r.z.array(r.z.string()).optional(),retrievalConfiguration:o.optional()});e.s(["createKBSchema",0,s,"updateKBSchema",0,d],7187)},8897,e=>{"use strict";var r=e.i(44501),n=e.i(70978),t=e.i(53552),a=e.i(23516),i=e.i(17635),l=e.i(65581),o=e.i(80883),s=e.i(88310),d=e.i(87014),c=e.i(20268),u=e.i(6703),m=e.i(72238),g=e.i(42595),h=e.i(23888),x=e.i(45123),p=e.i(62769),f=e.i(21562),b=e.i(64209),v=e.i(66473),j=e.i(3106),C=e.i(96359),F=e.i(58204),y=e.i(30363);let N=[{value:"string",label:"String"},{value:"long",label:"Long"},{value:"double",label:"Double"},{value:"boolean",label:"Boolean"},{value:"date",label:"Date"},{value:"string_list",label:"String List"},{value:"long_list",label:"Long List"},{value:"double_list",label:"Double List"},{value:"boolean_list",label:"Boolean List"},{value:"date_list",label:"Date List"}];function w({value:e,onChange:n}){let t=(0,i.useCallback)(()=>{n([...e,{name:"",type:"string"}])},[e,n]),a=(0,i.useCallback)(r=>{n(e.filter((e,n)=>n!==r))},[e,n]),l=(0,i.useCallback)((r,t)=>{n(e.map((e,n)=>n===r?{...e,...t}:e))},[e,n]);return(0,r.jsxs)("div",{className:"space-y-2",children:[e.map((e,n)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(h.Input,{value:e.name,onChange:e=>l(n,{name:e.target.value}),placeholder:"字段名",className:"h-9 flex-1"}),(0,r.jsxs)(v.Select,{value:e.type,onValueChange:e=>l(n,{type:e}),children:[(0,r.jsx)(v.SelectTrigger,{className:"h-9 w-[140px]",children:(0,r.jsx)(v.SelectValue,{})}),(0,r.jsx)(v.SelectContent,{children:N.map(e=>(0,r.jsx)(v.SelectItem,{value:e.value,children:e.label},e.value))})]}),(0,r.jsx)(g.Button,{type:"button",variant:"ghost",size:"icon",onClick:()=>a(n),className:"h-9 w-9 text-muted-foreground hover:text-destructive hover:bg-destructive/10","aria-label":`删除字段 ${e.name||n+1}`,children:(0,r.jsx)(y.Trash2,{size:16})})]},n)),(0,r.jsxs)(g.Button,{type:"button",variant:"ghost",onClick:t,className:"gap-1.5 text-primary hover:bg-primary/10",children:[(0,r.jsx)(F.Plus,{size:16}),"添加字段"]})]})}let k=[2048,1536,1024,768,512,256,128,64],S={"text-embedding-v3":[1024,768,512,256,128,64],"text-embedding-v4":k,"qwen3-vl-embedding":[2560,2048,1536,1024,768,512,256]};function T({form:e}){let n=(0,o.useWatch)({control:e.control,name:"embeddingConfiguration.provider"}),t=S[(0,o.useWatch)({control:e.control,name:"embeddingConfiguration.model"})??""]??k,a=r=>{e.setValue("embeddingConfiguration.model",r),e.setValue("embeddingConfiguration.dimension",1024)};return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(f.FormField,{control:e.control,name:"embeddingConfiguration.provider",render:({field:n})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"提供方"}),(0,r.jsxs)(v.Select,{onValueChange:r=>{n.onChange(r),"bailian"===r?(e.setValue("embeddingConfiguration.model","text-embedding-v4"),e.setValue("embeddingConfiguration.dimension",1024)):e.setValue("embeddingConfiguration.model","")},defaultValue:n.value,children:[(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(v.SelectTrigger,{children:(0,r.jsx)(v.SelectValue,{placeholder:"选择 Embedding 提供方"})})}),(0,r.jsxs)(v.SelectContent,{children:[(0,r.jsx)(v.SelectItem,{value:"bailian",children:"百炼 (Bailian)"}),(0,r.jsx)(v.SelectItem,{value:"custom",children:"自定义 (Custom)"})]})]}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:e.control,name:"embeddingConfiguration.model",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"模型名称"}),(0,r.jsx)(f.FormControl,{children:"bailian"===n?(0,r.jsxs)(v.Select,{onValueChange:a,value:e.value,children:[(0,r.jsx)(v.SelectTrigger,{children:(0,r.jsx)(v.SelectValue,{placeholder:"选择模型"})}),(0,r.jsxs)(v.SelectContent,{children:[(0,r.jsx)(v.SelectItem,{value:"text-embedding-v3",children:"text-embedding-v3"}),(0,r.jsx)(v.SelectItem,{value:"text-embedding-v4",children:"text-embedding-v4"}),(0,r.jsx)(v.SelectItem,{value:"qwen3-vl-embedding",children:"qwen3-vl-embedding (多模态)"})]})]}):(0,r.jsx)(h.Input,{placeholder:"输入模型名称",...e})}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:e.control,name:"embeddingConfiguration.dimension",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"向量维度"}),(0,r.jsx)(f.FormControl,{children:"bailian"===n?(0,r.jsxs)(v.Select,{onValueChange:r=>e.onChange(Number(r)),value:String(e.value),children:[(0,r.jsx)(v.SelectTrigger,{children:(0,r.jsx)(v.SelectValue,{placeholder:"选择维度"})}),(0,r.jsx)(v.SelectContent,{children:t.map(e=>(0,r.jsx)(v.SelectItem,{value:String(e),children:e.toLocaleString()},e))})]}):(0,r.jsx)(h.Input,{type:"number",placeholder:"例如: 1024",...e,onChange:r=>e.onChange(Number(r.target.value))})}),(0,r.jsx)(f.FormMessage,{})]})}),"custom"===n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.FormField,{control:e.control,name:"embeddingConfiguration.apiKey",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"API Key"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{type:"password",placeholder:"输入 API Key",...e,value:e.value??""})}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:e.control,name:"embeddingConfiguration.url",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"API URL"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{placeholder:"https://your-embedding-service.com/v1/embeddings",...e,value:e.value??""})}),(0,r.jsx)(f.FormMessage,{})]})})]})]})}var I=e.i(20830),R=e.i(64297),_=e.i(37500),z=e.i(12984),L=e.i(58770),V=e.i(47570),E=e.i(7187);function M(){let e,n=(0,l.useRouter)(),t=(e=(0,z.useQueryClient)(),(0,_.useMutation)({mutationFn:e=>(0,L.createKnowledgeBase)(e),onSuccess:()=>{(0,V.invalidateKnowledgeBaseQueries)(e)}})),a=(0,o.useForm)({resolver:(0,s.zodResolver)(E.createKBSchema),defaultValues:{knowledgeBaseName:"",description:"",subspace:!1,multimodal:!0,ingestConfiguration:{enableTableFormulaCaption:!1},tags:[],metadata:[],embeddingConfiguration:{provider:"bailian",model:"qwen3-vl-embedding",dimension:1024},retrievalConfiguration:{searchType:["DENSE_VECTOR","FULL_TEXT"],denseVectorSearchConfiguration:{numberOfResults:20},fullTextSearchConfiguration:{numberOfResults:20},rerankingConfiguration:{type:"WEIGHT",numberOfResults:20,rrfConfiguration:{denseVectorSearchWeight:.5,fullTextSearchWeight:.5,k:60},weightConfiguration:{denseVectorSearchWeight:.7,fullTextSearchWeight:.3},modelConfiguration:{provider:"bailian",model:"qwen3-vl-rerank"}}}}}),F=(0,i.useRef)(!0),y=a.watch("multimodal");(0,i.useEffect)(()=>{y!==F.current&&(F.current=y??!1,y?(a.setValue("embeddingConfiguration.model","qwen3-vl-embedding"),a.setValue("embeddingConfiguration.dimension",1024),a.setValue("retrievalConfiguration.rerankingConfiguration.modelConfiguration.model","qwen3-vl-rerank")):(a.setValue("embeddingConfiguration.model","text-embedding-v4"),a.setValue("embeddingConfiguration.dimension",1024),a.setValue("retrievalConfiguration.rerankingConfiguration.modelConfiguration.model","gte-rerank-v2")))},[y,a]);let N=a.watch("retrievalConfiguration.rerankingConfiguration.type"),k=e=>"space-y-4 rounded-md border p-4 transition-colors "+(e?"border-[hsl(var(--primary)/0.4)] bg-[hsl(var(--primary)/0.04)]":"border-border bg-transparent");async function S(e){try{let r={...e,multimodal:e.multimodal||void 0,ingestConfiguration:e.ingestConfiguration?.enableTableFormulaCaption?e.ingestConfiguration:void 0,retrievalConfiguration:e.retrievalConfiguration?(0,R.buildKnowledgeBaseRetrievalConfiguration)(e.retrievalConfiguration):void 0};await t.mutateAsync(r),d.toast.success("知识库创建成功"),n.push("/knowledge-base")}catch(r){let e=r instanceof Error?r.message:"创建知识库失败";d.toast.error(e)}}return(0,r.jsx)(f.Form,{...a,children:(0,r.jsxs)("form",{onSubmit:a.handleSubmit(S),className:"space-y-8",children:[(0,r.jsxs)("section",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"基本信息"}),(0,r.jsx)(f.FormField,{control:a.control,name:"knowledgeBaseName",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsxs)(f.FormLabel,{children:["名称 ",(0,r.jsx)("span",{className:"text-[hsl(var(--destructive))]",children:"*"})]}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{placeholder:"my_knowledge_base",...e})}),(0,r.jsx)(f.FormDescription,{children:"以字母开头,仅包含字母、数字和下划线,最长 64 字符"}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"description",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"描述"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(x.Textarea,{placeholder:"描述这个知识库的用途...",className:"resize-none",rows:3,...e})}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"tags",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"标签"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(C.TagInput,{value:e.value??[],onChange:e.onChange,placeholder:"输入标签后按回车"})}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"subspace",render:({field:e})=>(0,r.jsxs)(f.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,r.jsxs)("div",{className:"space-y-0.5",children:[(0,r.jsx)(f.FormLabel,{className:"text-sm",children:"启用 Subspace"}),(0,r.jsx)(f.FormDescription,{className:"text-xs",children:"为该知识库开启子空间隔离,不同业务线的数据互不干扰"})]}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(p.Switch,{checked:e.value??!1,onCheckedChange:e.onChange})})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"multimodal",render:({field:e})=>(0,r.jsxs)(f.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,r.jsxs)("div",{className:"space-y-0.5",children:[(0,r.jsx)(f.FormLabel,{className:"text-sm",children:"多模态"}),(0,r.jsx)(f.FormDescription,{className:"text-xs",children:"支持图片文档入库、图片检索和多模态 embedding/rerank。创建后不可修改。"})]}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(p.Switch,{checked:e.value??!1,onCheckedChange:e.onChange})})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"ingestConfiguration.enableTableFormulaCaption",render:({field:e})=>(0,r.jsxs)(f.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,r.jsxs)("div",{className:"space-y-0.5",children:[(0,r.jsx)(f.FormLabel,{className:"text-sm",children:"表格公式Caption"}),(0,r.jsx)(f.FormDescription,{className:"text-xs",children:"为表格、公式类 Chunk 生成语义描述。需要平台开启对应 setting。普通 KB 和多模态 KB 均可使用。"})]}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(p.Switch,{checked:e.value??!1,onCheckedChange:e.onChange})})]})})]}),(0,r.jsxs)("section",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Metadata Schema"}),(0,r.jsx)(f.FormField,{control:a.control,name:"metadata",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(w,{value:e.value??[],onChange:e.onChange})}),(0,r.jsx)(f.FormMessage,{})]})})]}),(0,r.jsxs)(b.Collapsible,{children:[(0,r.jsx)(b.CollapsibleTrigger,{asChild:!0,children:(0,r.jsxs)(g.Button,{type:"button",variant:"ghost",className:"flex w-full items-center justify-between p-0 text-lg font-semibold hover:bg-transparent",children:["高级配置",(0,r.jsx)(c.ChevronDown,{className:"h-4 w-4 transition-transform duration-200 [[data-state=open]>&]:rotate-180"})]})}),(0,r.jsxs)(b.CollapsibleContent,{className:"mt-4 space-y-6",children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h4",{className:"text-base font-medium text-foreground",children:"Embedding 配置"}),a.watch("multimodal")&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground bg-muted/30 rounded-md p-2",children:["已自动将 embedding 模型切换为 ",(0,r.jsx)("code",{children:"qwen3-vl-embedding"}),",rerank 模型切换为 ",(0,r.jsx)("code",{children:"qwen3-vl-rerank"}),"。您仍可手动调整下方参数。"]}),(0,r.jsx)(T,{form:a})]}),(0,r.jsx)("hr",{className:"border-border"}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h4",{className:"text-base font-medium text-foreground",children:"检索配置"}),(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.searchType",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"搜索类型"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsxs)(j.ToggleGroup,{type:"multiple",value:e.value??[],onValueChange:r=>{r?.length&&e.onChange(r)},className:"grid w-full grid-cols-2 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md",children:[(0,r.jsxs)(j.ToggleGroupItem,{value:"DENSE_VECTOR",className:"h-9 gap-1.5",children:[e.value?.includes("DENSE_VECTOR")&&(0,r.jsx)(u.Check,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}),"向量检索"]}),(0,r.jsxs)(j.ToggleGroupItem,{value:"FULL_TEXT",className:"h-9 gap-1.5",children:[e.value?.includes("FULL_TEXT")&&(0,r.jsx)(u.Check,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}),"全文检索"]})]})}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-[hsl(var(--foreground))]",children:"返回数量"}),(0,r.jsx)("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"控制每路召回参与排序的候选数,以及 Rerank 后实际返回的片段数。"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(260px,100%),1fr))] gap-3",children:[(0,r.jsx)(I.RetrievalResultCountField,{control:a.control,name:"retrievalConfiguration.denseVectorSearchConfiguration.numberOfResults",label:"向量召回数",description:"向量检索参与后续排序的候选片段数。",max:100,muted:!a.watch("retrievalConfiguration.searchType")?.includes("DENSE_VECTOR")}),(0,r.jsx)(I.RetrievalResultCountField,{control:a.control,name:"retrievalConfiguration.fullTextSearchConfiguration.numberOfResults",label:"全文召回数",description:"全文检索参与后续排序的候选片段数。",max:100,muted:!a.watch("retrievalConfiguration.searchType")?.includes("FULL_TEXT")})]}),(0,r.jsx)(I.RetrievalResultCountField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.numberOfResults",label:"重排序返回数",description:"Rerank 后保留并返回的片段数。",max:200})]}),(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.type",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"默认 Rerank 策略"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsxs)(j.ToggleGroup,{type:"single",value:e.value??"",onValueChange:r=>{r&&e.onChange(r)},className:"grid w-full grid-cols-3 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md",children:[(0,r.jsx)(j.ToggleGroupItem,{value:"MODEL",className:"h-9",children:"Model"}),(0,r.jsx)(j.ToggleGroupItem,{value:"WEIGHT",className:"h-9",children:"Weight"}),(0,r.jsx)(j.ToggleGroupItem,{value:"RRF",className:"h-9",children:"RRF"})]})}),(0,r.jsx)(f.FormDescription,{className:"text-xs",children:"切换策略会影响检索时的默认行为;下方三套参数都会保存到知识库,方便临时切换"}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsxs)("div",{className:k("MODEL"===N),children:[(0,r.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Model 参数"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.modelConfiguration.provider",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"提供方"}),(0,r.jsxs)(v.Select,{onValueChange:e.onChange,value:e.value??"",children:[(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(v.SelectTrigger,{children:(0,r.jsx)(v.SelectValue,{placeholder:"选择提供方"})})}),(0,r.jsx)(v.SelectContent,{children:(0,r.jsx)(v.SelectItem,{value:"bailian",children:"百炼 (Bailian)"})})]}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.modelConfiguration.model",render:({field:e})=>{let n=a.watch("retrievalConfiguration.rerankingConfiguration.modelConfiguration.provider");return(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"模型名称"}),(0,r.jsx)(f.FormControl,{children:"bailian"===n?(0,r.jsxs)(v.Select,{onValueChange:e.onChange,value:e.value??"",children:[(0,r.jsx)(v.SelectTrigger,{children:(0,r.jsx)(v.SelectValue,{placeholder:"选择模型"})}),(0,r.jsxs)(v.SelectContent,{children:[(0,r.jsx)(v.SelectItem,{value:"gte-rerank-v2",children:"gte-rerank-v2"}),(0,r.jsx)(v.SelectItem,{value:"qwen3-rerank",children:"qwen3-rerank"}),(0,r.jsx)(v.SelectItem,{value:"qwen3-vl-rerank",children:"qwen3-vl-rerank (多模态)"})]})]}):(0,r.jsx)(h.Input,{placeholder:"输入模型名称",...e,value:e.value??""})}),(0,r.jsx)(f.FormMessage,{})]})}})]})]}),(0,r.jsxs)("div",{className:k("WEIGHT"===N),children:[(0,r.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Weight 参数"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.weightConfiguration.denseVectorSearchWeight",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"向量检索权重"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{type:"number",step:"0.1",min:"0",max:"1",placeholder:"0.5",...e,value:e.value??"",onChange:(0,m.handleNumberInput)(e.onChange)})}),(0,r.jsx)(f.FormDescription,{children:"0 ~ 1 之间"}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.weightConfiguration.fullTextSearchWeight",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"全文检索权重"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{type:"number",step:"0.1",min:"0",max:"1",placeholder:"0.5",...e,value:e.value??"",onChange:(0,m.handleNumberInput)(e.onChange)})}),(0,r.jsx)(f.FormDescription,{children:"0 ~ 1 之间"}),(0,r.jsx)(f.FormMessage,{})]})})]})]}),(0,r.jsxs)("div",{className:k("RRF"===N),children:[(0,r.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"RRF 参数"}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.denseVectorSearchWeight",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"向量检索权重"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{type:"number",step:"0.1",placeholder:"0.5",...e,value:e.value??"",onChange:(0,m.handleNumberInput)(e.onChange)})}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.fullTextSearchWeight",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"全文检索权重"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{type:"number",step:"0.1",placeholder:"0.5",...e,value:e.value??"",onChange:(0,m.handleNumberInput)(e.onChange)})}),(0,r.jsx)(f.FormMessage,{})]})}),(0,r.jsx)(f.FormField,{control:a.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.k",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"K 值"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{type:"number",placeholder:"60",...e,value:e.value??"",onChange:(0,m.handleNumberInput)(e.onChange)})}),(0,r.jsx)(f.FormMessage,{})]})})]})]})]})]})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[(0,r.jsx)(g.Button,{type:"button",variant:"outline",onClick:()=>n.back(),children:"取消"}),(0,r.jsx)(g.Button,{type:"submit",disabled:t.isPending,children:t.isPending?"创建中...":"创建知识库"})]})]})})}e.s(["default",0,function(){return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)(n.default,{href:"/knowledge-base",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4",children:[(0,r.jsx)(t.ArrowLeft,{className:"h-4 w-4"}),"返回知识库列表"]}),(0,r.jsx)(a.PageHeader,{title:"创建知识库"})]}),(0,r.jsx)("div",{className:"max-w-2xl",children:(0,r.jsx)(M,{})})]})}],8897)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,99877,e=>{"use strict";var r=e.i(44501);e.s(["EmptyState",0,function({icon:e,title:t,description:a,action:s,illustration:n}){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[n??(0,r.jsx)("div",{className:"mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-[hsl(var(--primary)/0.08)] ring-8 ring-[hsl(var(--primary)/0.04)]",children:(0,r.jsx)(e,{className:"text-primary",size:36,strokeWidth:1.75})}),(0,r.jsx)("h3",{className:"mb-2 text-base font-semibold text-foreground",children:t}),(0,r.jsx)("p",{className:"mb-6 max-w-sm text-sm text-muted-foreground",children:a}),s&&(0,r.jsx)("div",{children:s})]})}])},10414,e=>{"use strict";var r=e.i(44501),t=e.i(17635),a=e.i(76490);let s=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm",e),...t}));s.displayName="Card",t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("flex flex-col space-y-1 px-5 pt-5 pb-3 border-b border-[hsl(var(--border-light))]",e),...t})).displayName="CardHeader",t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("text-base font-semibold leading-tight",e),...t})).displayName="CardTitle",t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("text-sm text-[hsl(var(--muted-foreground))]",e),...t})).displayName="CardDescription";let n=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("px-5 py-4",e),...t}));n.displayName="CardContent",t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("flex items-center px-5 py-3 border-t border-[hsl(var(--border-light))]",e),...t})).displayName="CardFooter";let i=t.forwardRef(({className:e,...t},s)=>(0,r.jsx)("div",{ref:s,className:(0,a.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm","transition-[transform,box-shadow,border-color] duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)]","hover:border-[hsl(var(--primary))] hover:shadow-primary-soft",e),...t}));i.displayName="CardInteractive",e.s(["Card",0,s,"CardContent",0,n,"CardInteractive",0,i])},82652,e=>{"use strict";let r=(0,e.i(86620).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],82652)},36283,e=>{"use strict";e.s(["IMAGE_FALLBACK_DATA_PREFIX",0,"data:image/jpeg;base64,","KB_NAME_REGEX",0,/^[a-zA-Z][a-zA-Z0-9_-]{1,62}[a-zA-Z0-9]$/])},3106,96359,20830,e=>{"use strict";var r=e.i(44501),t=e.i(17635),a=e.i(43250),s=e.i(80939),n=e.i(77275),i=e.i(91967),l=e.i(17256),o="Toggle",d=t.forwardRef((e,t)=>{let{pressed:a,defaultPressed:n,onPressedChange:d,...c}=e,[u,m]=(0,l.useControllableState)({prop:a,onChange:d,defaultProp:n??!1,caller:o});return(0,r.jsx)(s.Primitive.button,{type:"button","aria-pressed":u,"data-state":u?"on":"off","data-disabled":e.disabled?"":void 0,...c,ref:t,onClick:(0,i.composeEventHandlers)(e.onClick,()=>{e.disabled||m(!u)})})});d.displayName=o;var c=e.i(25486),u="ToggleGroup",[m,p]=(0,a.createContextScope)(u,[n.createRovingFocusGroupScope]),x=(0,n.createRovingFocusGroupScope)(),h=t.default.forwardRef((e,t)=>{let{type:a,...s}=e;if("single"===a)return(0,r.jsx)(v,{...s,ref:t});if("multiple"===a)return(0,r.jsx)(b,{...s,ref:t});throw Error(`Missing prop \`type\` expected on \`${u}\``)});h.displayName=u;var[f,g]=m(u),v=t.default.forwardRef((e,a)=>{let{value:s,defaultValue:n,onValueChange:i=()=>{},...o}=e,[d,c]=(0,l.useControllableState)({prop:s,defaultProp:n??"",onChange:i,caller:u});return(0,r.jsx)(f,{scope:e.__scopeToggleGroup,type:"single",value:t.default.useMemo(()=>d?[d]:[],[d]),onItemActivate:c,onItemDeactivate:t.default.useCallback(()=>c(""),[c]),children:(0,r.jsx)(N,{...o,ref:a})})}),b=t.default.forwardRef((e,a)=>{let{value:s,defaultValue:n,onValueChange:i=()=>{},...o}=e,[d,c]=(0,l.useControllableState)({prop:s,defaultProp:n??[],onChange:i,caller:u}),m=t.default.useCallback(e=>c((r=[])=>[...r,e]),[c]),p=t.default.useCallback(e=>c((r=[])=>r.filter(r=>r!==e)),[c]);return(0,r.jsx)(f,{scope:e.__scopeToggleGroup,type:"multiple",value:d,onItemActivate:m,onItemDeactivate:p,children:(0,r.jsx)(N,{...o,ref:a})})});h.displayName=u;var[y,j]=m(u),N=t.default.forwardRef((e,t)=>{let{__scopeToggleGroup:a,disabled:i=!1,rovingFocus:l=!0,orientation:o,dir:d,loop:u=!0,...m}=e,p=x(a),h=(0,c.useDirection)(d),f={role:"group",dir:h,...m};return(0,r.jsx)(y,{scope:a,rovingFocus:l,disabled:i,children:l?(0,r.jsx)(n.Root,{asChild:!0,...p,orientation:o,dir:h,loop:u,children:(0,r.jsx)(s.Primitive.div,{...f,ref:t})}):(0,r.jsx)(s.Primitive.div,{...f,ref:t})})}),w="ToggleGroupItem",C=t.default.forwardRef((e,a)=>{let s=g(w,e.__scopeToggleGroup),i=j(w,e.__scopeToggleGroup),l=x(e.__scopeToggleGroup),o=s.value.includes(e.value),d=i.disabled||e.disabled,c={...e,pressed:o,disabled:d},u=t.default.useRef(null);return i.rovingFocus?(0,r.jsx)(n.Item,{asChild:!0,...l,focusable:!d,active:o,ref:u,children:(0,r.jsx)(k,{...c,ref:a})}):(0,r.jsx)(k,{...c,ref:a})});C.displayName=w;var k=t.default.forwardRef((e,t)=>{let{__scopeToggleGroup:a,value:s,...n}=e,i=g(w,a),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},o="single"===i.type?l:void 0;return(0,r.jsx)(d,{...o,...n,ref:t,onPressedChange:e=>{e?i.onItemActivate(s):i.onItemDeactivate(s)}})}),T=e.i(76490);let F=t.createContext({size:"default",variant:"default"}),R=t.forwardRef(({className:e,variant:t="default",size:a="default",children:s,...n},i)=>(0,r.jsx)(h,{ref:i,className:(0,T.cn)("inline-flex items-center justify-center gap-1",e),...n,children:(0,r.jsx)(F.Provider,{value:{variant:t,size:a},children:s})}));R.displayName=h.displayName;let I=t.forwardRef(({className:e,children:t,...a},s)=>(0,r.jsx)(C,{ref:s,className:(0,T.cn)("relative inline-flex items-center justify-center whitespace-nowrap","text-sm font-medium transition-all","first:rounded-l-[7px] last:rounded-r-[7px]","border-l border-[hsl(var(--border)/0.6)]","first:border-l-0","data-[state=on]:border-l-transparent","[&[data-state=on]+*]:border-l-transparent","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","hover:bg-[hsl(var(--muted)/0.6)] hover:text-[hsl(var(--foreground))]","data-[state=on]:bg-[hsl(var(--background))] data-[state=on]:text-[hsl(var(--foreground))] data-[state=on]:shadow-sm",e),...a,children:t}));I.displayName=C.displayName,e.s(["ToggleGroup",0,R,"ToggleGroupItem",0,I],3106);var E=e.i(46398);e.s(["TagInput",0,function({value:e,onChange:a,placeholder:s="输入后按回车添加"}){let[n,i]=(0,t.useState)(""),l=(0,t.useCallback)(r=>{let t=r.trim();t&&!e.includes(t)&&a([...e,t]),i("")},[e,a]),o=(0,t.useCallback)(r=>{a(e.filter((e,t)=>t!==r))},[e,a]);return(0,r.jsxs)("div",{className:(0,T.cn)("flex flex-wrap items-center gap-1.5 rounded-md border border-[hsl(var(--input))] bg-background px-3 py-2","focus-within:border-[hsl(var(--ring))] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0","min-h-10 transition-colors"),children:[e.map((e,t)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-primary-200 bg-primary-100 px-2 py-0.5 text-xs font-medium text-primary-700",children:[e,(0,r.jsx)("button",{type:"button",onClick:()=>o(t),className:"inline-flex items-center justify-center rounded-full p-0.5 hover:opacity-70 transition-opacity","aria-label":`删除标签 ${e}`,children:(0,r.jsx)(E.X,{size:12})})]},`${e}-${t}`)),(0,r.jsx)("input",{type:"text",value:n,onChange:e=>i(e.target.value),onKeyDown:r=>{("Enter"===r.key||","===r.key)&&(r.preventDefault(),l(n)),"Backspace"===r.key&&""===n&&e.length>0&&o(e.length-1)},placeholder:0===e.length?s:"",className:"flex-1 min-w-20 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]})}],96359);let S=(0,e.i(86620).default)("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);var D=e.i(21562),P=e.i(23888);e.s(["RetrievalResultCountField",0,function({control:e,name:t,label:a="返回片段数",description:s="单次检索返回的最多片段数,Rerank 后取前 N 条。",min:n=0,max:i,muted:l=!1,className:o}){return(0,r.jsx)(D.FormField,{control:e,name:t,render:({field:e})=>{let t="number"==typeof e.value&&Number.isFinite(e.value)?String(e.value):"";return(0,r.jsxs)(D.FormItem,{className:(0,T.cn)("mb-0 rounded-md border border-[hsl(var(--border)/0.6)] bg-[hsl(var(--card)/0.72)] p-3 shadow-[0_1px_2px_hsl(var(--foreground)/0.04)]",l&&"opacity-65",o),children:[(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[(0,r.jsxs)("div",{className:"flex min-w-0 gap-3",children:[(0,r.jsx)("span",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-[hsl(var(--primary)/0.08)] text-[hsl(var(--primary))]",children:(0,r.jsx)(S,{className:"h-3.5 w-3.5"})}),(0,r.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,r.jsx)(D.FormLabel,{className:"text-sm font-medium",children:a}),(0,r.jsx)("p",{className:"text-xs leading-relaxed text-[hsl(var(--muted-foreground))]",children:s})]})]}),(0,r.jsxs)("div",{className:"relative w-28 shrink-0",children:[(0,r.jsx)(D.FormControl,{children:(0,r.jsx)(P.Input,{ref:e.ref,name:e.name,type:"number",inputMode:"numeric",min:n,max:i,"aria-label":a,className:"h-9 w-full bg-[hsl(var(--background))] pr-8 text-right font-mono text-sm tabular-nums shadow-sm [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",value:t,onBlur:e.onBlur,onChange:r=>e.onChange(function(e){let r=e.trim();if(!r)return;let t=Number(r);return Number.isFinite(t)?t:void 0}(r.target.value))})}),(0,r.jsx)("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-xs text-[hsl(var(--muted-foreground))]",children:"条"})]})]}),(0,r.jsx)(D.FormMessage,{className:"pt-1"})]})}})}],20830)},64209,e=>{"use strict";var r=e.i(17635),t=e.i(91967),a=e.i(43250),s=e.i(17256),n=e.i(72687),i=e.i(67928),l=e.i(80939),o=e.i(90088),d=e.i(33616),c=e.i(44501),u="Collapsible",[m,p]=(0,a.createContextScope)(u),[x,h]=m(u),f=r.forwardRef((e,t)=>{let{__scopeCollapsible:a,open:n,defaultOpen:i,disabled:o,onOpenChange:m,...p}=e,[h,f]=(0,s.useControllableState)({prop:n,defaultProp:i??!1,onChange:m,caller:u});return(0,c.jsx)(x,{scope:a,disabled:o,contentId:(0,d.useId)(),open:h,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),children:(0,c.jsx)(l.Primitive.div,{"data-state":N(h),"data-disabled":o?"":void 0,...p,ref:t})})});f.displayName=u;var g="CollapsibleTrigger",v=r.forwardRef((e,r)=>{let{__scopeCollapsible:a,...s}=e,n=h(g,a);return(0,c.jsx)(l.Primitive.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":N(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...s,ref:r,onClick:(0,t.composeEventHandlers)(e.onClick,n.onOpenToggle)})});v.displayName=g;var b="CollapsibleContent",y=r.forwardRef((e,r)=>{let{forceMount:t,...a}=e,s=h(b,e.__scopeCollapsible);return(0,c.jsx)(o.Presence,{present:t||s.open,children:({present:e})=>(0,c.jsx)(j,{...a,ref:r,present:e})})});y.displayName=b;var j=r.forwardRef((e,t)=>{let{__scopeCollapsible:a,present:s,children:o,...d}=e,u=h(b,a),[m,p]=r.useState(s),x=r.useRef(null),f=(0,i.useComposedRefs)(t,x),g=r.useRef(0),v=g.current,y=r.useRef(0),j=y.current,w=u.open||m,C=r.useRef(w),k=r.useRef(void 0);return r.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,n.useLayoutEffect)(()=>{let e=x.current;if(e){k.current=k.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let r=e.getBoundingClientRect();g.current=r.height,y.current=r.width,C.current||(e.style.transitionDuration=k.current.transitionDuration,e.style.animationName=k.current.animationName),p(s)}},[u.open,s]),(0,c.jsx)(l.Primitive.div,{"data-state":N(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...d,ref:f,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:w&&o})});function N(e){return e?"open":"closed"}e.s(["Collapsible",0,f,"CollapsibleContent",0,y,"CollapsibleTrigger",0,v],64209)},462,e=>{"use strict";let r=(0,e.i(86620).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,r],462)},8484,e=>{"use strict";var r=e.i(44501),t=e.i(17635),a=e.i(80883),s=e.i(88310),n=e.i(6703),i=e.i(86620);let l=(0,i.default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var o=e.i(82652);let d=(0,i.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var c=e.i(96416),u=e.i(462),m=e.i(46398),p=e.i(87014),x=e.i(42595),h=e.i(23888),f=e.i(21562),g=e.i(36766),v=e.i(12122),b=e.i(3106),y=e.i(85684),j=e.i(33042),N=e.i(74540);function w(e,r,t){let a=(0,j.assembleRetrievalConfiguration)(r,void 0)??{};t&&(a.filter=t);let s={knowledgeBaseName:e,retrievalQuery:"IMAGE"===r.queryType&&r.imageInput?{type:"IMAGE",imageBase64:r.imageInput,...r.query?{text:r.query}:{}}:{type:"TEXT",text:r.query??""}};return r.subspace?.length&&(s.subspace=r.subspace),Object.keys(a).length>0&&(s.retrievalConfiguration=a),s}function C(e,r){let t=r?.retrievalConfiguration?.searchType??["DENSE_VECTOR"],a=r?.retrievalConfiguration?.rerankingConfiguration,s=r?.retrievalConfiguration?.denseVectorSearchConfiguration,n=r?.retrievalConfiguration?.fullTextSearchConfiguration,i=a?.rrfConfiguration,l=a?.weightConfiguration,o=a?.modelConfiguration,d=t.includes("DENSE_VECTOR")&&t.includes("FULL_TEXT"),c=a?.type==="RRF"||a?.type==="WEIGHT"?d?a.type:"MODEL":a?.type==="MODEL"?"MODEL":"WEIGHT",u=s?.numberOfResults??a?.numberOfResults??20,m=n?.numberOfResults??a?.numberOfResults??20,p=a?.numberOfResults??20;return{knowledgeBaseName:e,queryType:"TEXT",query:"",imageInput:"",subspace:[],topK:p,denseTopK:u,fullTextTopK:m,rerankTopK:p,searchType:t,rerankType:c,rrfK:i?.k??60,rrfDenseWeight:i?.denseVectorSearchWeight??.5,rrfFullTextWeight:i?.fullTextSearchWeight??.5,weightDense:l?.denseVectorSearchWeight??.5,weightFullText:l?.fullTextSearchWeight??.5,modelProvider:o?.provider??"bailian",modelName:o?.model??"gte-rerank-v2"}}function k({buildRequestJson:e}){let[a,s]=(0,t.useState)(!1),[i,d]=(0,t.useState)(!1),c=a?JSON.stringify(e(),null,2):"",u=async()=>{try{await navigator.clipboard.writeText(c),d(!0),p.toast.success("已复制请求体"),setTimeout(()=>d(!1),1500)}catch{p.toast.error("复制失败,请手动选择")}};return(0,r.jsxs)(g.Popover,{open:a,onOpenChange:s,children:[(0,r.jsx)(v.TooltipProvider,{delayDuration:200,children:(0,r.jsxs)(v.Tooltip,{children:[(0,r.jsx)(v.TooltipTrigger,{asChild:!0,children:(0,r.jsx)(g.PopoverTrigger,{asChild:!0,children:(0,r.jsx)(x.Button,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]","aria-label":"查看请求体",children:(0,r.jsx)(l,{className:"h-3.5 w-3.5"})})})}),(0,r.jsx)(v.TooltipContent,{side:"left",children:"查看 / 复制请求体 JSON"})]})}),(0,r.jsxs)(g.PopoverContent,{align:"end",sideOffset:6,className:"w-[420px] max-w-[90vw] p-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-[hsl(var(--border-light))] px-3 py-2",children:[(0,r.jsx)("span",{className:"text-xs font-semibold text-[hsl(var(--foreground))]",children:"请求体(实时预览)"}),(0,r.jsx)(x.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs",onClick:u,children:i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Check,{className:"h-3 w-3"})," 已复制"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Copy,{className:"h-3 w-3"})," 复制"]})})]}),(0,r.jsx)("pre",{className:"max-h-80 overflow-auto px-3 py-2 font-mono text-[11px] leading-snug text-[hsl(var(--foreground))]",children:c})]})]})}e.s(["RetrievalForm",0,function({knowledgeBaseName:e,knowledgeBase:n,onSubmit:i,isLoading:l}){let o=(0,t.useRef)(null),g=(0,t.useRef)(null),[v,j]=(0,t.useState)(""),[T,F]=(0,t.useState)(!1),R=(0,a.useForm)({resolver:(0,s.zodResolver)(N.retrievalSchema),defaultValues:C(e,n)}),I=n?.multimodal===!0,E=R.watch("queryType")??"TEXT",S=I?E:"TEXT";return(0,r.jsx)(f.Form,{...R,children:(0,r.jsxs)("form",{onSubmit:R.handleSubmit(function(r){i(w(e,r,o.current?.getFilter()))}),className:"space-y-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsx)("h3",{className:"text-base font-semibold",children:"检索测试"}),(0,r.jsx)(k,{buildRequestJson:()=>w(e,R.getValues(),o.current?.getFilter())})]}),I&&(0,r.jsx)(f.FormField,{control:R.control,name:"queryType",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"查询类型"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsxs)(b.ToggleGroup,{type:"single",value:e.value??"TEXT",onValueChange:r=>{r&&r!==e.value&&(e.onChange(r),R.setValue("query",""),R.setValue("imageInput",""))},className:"grid w-full grid-cols-2 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md",children:[(0,r.jsx)(b.ToggleGroupItem,{value:"TEXT",className:"h-9",children:"TEXT"}),(0,r.jsx)(b.ToggleGroupItem,{value:"IMAGE",className:"h-9",children:"IMAGE"})]})})]})}),"TEXT"===S?(0,r.jsx)(f.FormField,{control:R.control,name:"query",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"查询内容"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(c.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[hsl(var(--muted-foreground))]"}),(0,r.jsx)(h.Input,{placeholder:"输入检索查询...",className:"pl-9",maxLength:128,...e})]})}),(0,r.jsx)(f.FormMessage,{})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.FormField,{control:R.control,name:"imageInput",render:({field:e})=>{let t=["image/jpeg","image/png","image/webp","image/bmp","image/tiff"],a=r=>{if(!t.includes(r.type))return void p.toast.error("不支持的图片格式,请选择 JPG/PNG/WebP/BMP/TIFF 格式");let a=new FileReader;a.onload=()=>{e.onChange(a.result),j(r.name||"pasted-image")},a.onerror=()=>{p.toast.error("图片读取失败,请重试")},a.readAsDataURL(r)};return(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"图片输入"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsxs)("div",{onPaste:e=>{let r=e.clipboardData?.items;if(r){for(let t of Array.from(r))if(t.type.startsWith("image/")){e.preventDefault();let r=t.getAsFile();r&&a(r);return}}},tabIndex:0,className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-md",children:[(0,r.jsx)("input",{ref:g,type:"file",accept:"image/jpeg,image/png,image/webp,image/bmp,image/tiff",className:"hidden",onChange:e=>{let r=e.target.files?.[0];r&&a(r)}}),e.value?(0,r.jsxs)("div",{className:"group border border-border rounded-md overflow-hidden",children:[(0,r.jsxs)("div",{className:"relative flex justify-center bg-muted/30 p-3",children:[(0,r.jsx)("img",{src:e.value,alt:"已选择的图片预览",className:"max-h-[200px] max-w-full rounded object-contain"}),(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>g.current?.click(),className:"px-3 py-1.5 rounded bg-white/90 text-sm font-medium text-foreground hover:bg-white flex items-center gap-1.5",children:[(0,r.jsx)(u.Upload,{className:"w-3.5 h-3.5"}),"重新选择"]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{e.onChange(""),j(""),g.current&&(g.current.value="")},className:"px-3 py-1.5 rounded bg-white/90 text-sm font-medium text-destructive hover:bg-white flex items-center gap-1.5",children:[(0,r.jsx)(m.X,{className:"w-3.5 h-3.5"}),"删除"]})]})]}),(0,r.jsxs)("div",{className:"px-3 py-2 border-t border-border flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)(d,{className:"w-3.5 h-3.5"}),(0,r.jsx)("span",{className:"truncate",children:v})]})]}):(0,r.jsxs)("div",{onClick:()=>g.current?.click(),onDragOver:e=>{e.preventDefault(),F(!0)},onDragLeave:()=>F(!1),onDrop:e=>{e.preventDefault(),F(!1);let r=e.dataTransfer.files[0];r&&a(r)},className:`border-2 border-dashed rounded-lg p-8 flex flex-col items-center gap-3 cursor-pointer transition-colors ${T?"border-primary bg-accent/50":"border-border hover:border-primary/50 hover:bg-accent/50"}`,children:[(0,r.jsx)(u.Upload,{className:"w-8 h-8 text-muted-foreground"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"点击、拖拽或粘贴图片到此处"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"支持 JPG/PNG/WebP/BMP/TIFF"})]})]},E)}),(0,r.jsx)(f.FormMessage,{})]})}}),(0,r.jsx)(f.FormField,{control:R.control,name:"query",render:({field:e})=>(0,r.jsxs)(f.FormItem,{children:[(0,r.jsx)(f.FormLabel,{children:"补充文本(可选)"}),(0,r.jsx)(f.FormControl,{children:(0,r.jsx)(h.Input,{placeholder:"补充文本描述...",maxLength:128,...e})}),(0,r.jsx)(f.FormMessage,{})]})})]}),(0,r.jsx)(y.RetrievalParamsFields,{form:R,knowledgeBase:n,filterRef:o}),(0,r.jsxs)(x.Button,{type:"submit",disabled:l,className:"w-full",children:[(0,r.jsx)(c.Search,{className:"mr-2 h-4 w-4"}),l?"检索中...":"执行检索"]})]})})},"assembleRetrievalRequest",0,w,"retrievalDefaultsFromKB",0,C],8484)},34069,e=>{"use strict";var r=e.i(44501),t=e.i(17635),a=e.i(65581),s=e.i(87014),n=e.i(31211),i=e.i(7663),l=e.i(42410),o=e.i(37500),d=e.i(93321);async function c(e){let{knowledgeBaseName:r,...t}=e;return(0,d.apiPost)(`/api/v1/knowledge-bases/${encodeURIComponent(r)}/retrieve`,t)}var u=e.i(8484);let m=(0,e.i(86620).default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);var p=e.i(99877),x=e.i(10414),h=e.i(66458),f=e.i(33253),g=e.i(36283);function v({result:e,rank:a}){let[s,n]=(0,t.useState)(null),i=e.ossKey?.split("/").pop()||e.ossKey||"未知文件",l=e.chunkType?.toLowerCase()==="image",o=e.imageBase64?e.imageBase64.startsWith("data:")?e.imageBase64:`${g.IMAGE_FALLBACK_DATA_PREFIX}${e.imageBase64}`:void 0;return(0,r.jsxs)(x.Card,{className:"transition-shadow hover:shadow-sm",children:[(0,r.jsxs)(x.CardContent,{className:"p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-[hsl(var(--primary-50))] text-xs font-semibold text-primary",children:a}),(0,r.jsx)(h.Badge,{variant:"outline",className:"font-mono text-xs",children:e.score.toFixed(4)}),e.chunkType&&(0,r.jsx)(h.Badge,{variant:l?"default":"secondary",className:"text-xs",children:e.chunkType.toUpperCase()})]}),e.subspace&&(0,r.jsx)(h.Badge,{variant:"secondary",className:"text-xs",children:e.subspace})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:i}),(0,r.jsxs)("span",{children:["Chunk #",e.chunkId]})]}),l&&e.imageBase64&&o&&(0,r.jsx)("img",{src:o,alt:"检索结果图片",className:"max-w-[200px] rounded-md cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>n(o)}),e.content&&(0,r.jsx)("p",{className:`leading-relaxed text-foreground/90 whitespace-pre-wrap ${l?"text-xs":"text-sm line-clamp-6"}`,children:e.content}),e.metadata&&Object.keys(e.metadata).length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:Object.entries(e.metadata).map(([e,t])=>(0,r.jsxs)(h.Badge,{variant:"secondary",className:"text-xs font-normal",children:[e,": ",String(t)]},e))})]}),(0,r.jsx)(f.Dialog,{open:!!s,onOpenChange:()=>n(null),children:(0,r.jsxs)(f.DialogContent,{className:"max-w-[90vw] max-h-[90vh] p-2 flex items-center justify-center border-none bg-black/90 data-[state=open]:animate-none data-[state=closed]:animate-none duration-0",children:[(0,r.jsx)(f.DialogTitle,{className:"sr-only",children:"图片放大预览"}),s&&(0,r.jsx)("img",{src:s,alt:"放大预览",className:"max-w-full max-h-[85vh] object-contain"})]})})]})}function b({results:e,elapsedMs:t}){return null===e?null:0===e.length?(0,r.jsx)(p.EmptyState,{icon:m,title:"没有检索到结果",description:"尝试调整查询内容或检索参数"}):(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsxs)("span",{children:["共 ",(0,r.jsx)("strong",{className:"text-foreground",children:e.length})," 条结果"]}),void 0!==t&&(0,r.jsxs)("span",{children:["· 耗时 ",t,"ms"]})]}),(0,r.jsx)("div",{className:"space-y-3",children:e.map((e,t)=>(0,r.jsx)(v,{result:e,rank:t+1},`${e.docId}-${e.chunkId}`))})]})}e.s(["default",0,function(){let e=decodeURIComponent((0,a.useParams)().name),{data:d,isLoading:m}=(0,l.useKnowledgeBase)(e),p=(0,o.useMutation)({mutationFn:e=>c(e)}),[x,h]=(0,t.useState)(null),[f,g]=(0,t.useState)(),v=(0,t.useCallback)(async e=>{let r=Date.now();try{let t=await p.mutateAsync(e);h(t.retrievalResults),g(Date.now()-r)}catch(r){let e=r instanceof Error?r.message:"检索失败";s.toast.error(e)}},[p]);return m?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(n.Skeleton,{className:"h-8 w-48"}),(0,r.jsx)(n.Skeleton,{className:"h-64 w-full"})]}):(0,r.jsx)(i.WorkbenchLayout,{asideWidth:400,aside:(0,r.jsx)(u.RetrievalForm,{knowledgeBaseName:e,knowledgeBase:d??void 0,onSubmit:v,isLoading:p.isPending}),children:(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-7 py-5 max-md:px-4",children:(0,r.jsx)(b,{results:x,elapsedMs:f})})})}],34069)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31211,e=>{"use strict";var r=e.i(44501),t=e.i(17635),s=e.i(76490);e.s(["Skeleton",0,function({className:e,delay:t,style:a,...i}){return(0,r.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-md bg-primary/10",e),style:{animationDelay:t?`${t}ms`:void 0,...a},...i})},"SkeletonGroup",0,function({children:e,stagger:s=80,className:a,...i}){let n=t.Children.toArray(e);return(0,r.jsx)("div",{className:a,...i,children:n.map((e,r)=>{if(!t.isValidElement(e))return e;let a=e.props.delay??0;return t.cloneElement(e,{delay:a+r*s})})})}])},9823,e=>{"use strict";let r=(0,e.i(86620).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,r],9823)},30068,e=>{"use strict";let r=(0,e.i(86620).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,r],30068)},23516,e=>{"use strict";var r=e.i(44501),t=e.i(70978),s=e.i(65581),a=e.i(79980),i=e.i(76490);let n={"knowledge-base":"知识库",memory:"记忆库","llm-providers":"大模型",projects:"项目管理",documents:"文档",retrieval:"检索测试",qa:"问答测试",search:"记忆检索",units:"长期记忆",messages:"短期记忆",requests:"请求审计",settings:"设置",create:"新建",new:"新建",chat:"对话"};e.s(["PageHeader",0,function({title:e,description:l,hideBreadcrumb:o,children:c,className:d}){let m=(0,s.usePathname)()??"/",u=o?[]:function(e){if(/^\/knowledge-base\/[^/]+(?:\/.*)?$/.test(e)||/^\/memory\/[^/]+(?:\/.*)?$/.test(e))return[];let r=e.split("/").filter(Boolean);if(0===r.length)return[];let t=[],s="";return r.forEach((e,a)=>{s+=`/${e}`;let i=decodeURIComponent(e),l=n[i]??i;t.push({label:l,href:a<r.length-1?s:void 0})}),t}(m);return(0,r.jsxs)("div",{className:(0,i.cn)("mb-5 flex flex-col gap-2",d),children:[u.length>1&&(0,r.jsxs)("nav",{"aria-label":"面包屑",className:"flex items-center gap-1 text-[13px] text-[hsl(var(--muted-foreground))]",children:[(0,r.jsx)(t.default,{href:"/",className:"transition-colors hover:text-[hsl(var(--foreground))]",children:"主页"}),u.map((e,s)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(a.ChevronRight,{className:"h-3 w-3 opacity-60"}),e.href?(0,r.jsx)(t.default,{href:e.href,className:"transition-colors hover:text-[hsl(var(--foreground))]",children:e.label}):(0,r.jsx)("span",{className:"font-medium text-[hsl(var(--foreground))]",children:e.label})]},`${e.label}-${s}`))]}),(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold leading-tight text-[hsl(var(--foreground))]",children:e}),l&&(0,r.jsx)("p",{className:"text-[13px] text-[hsl(var(--muted-foreground))]",children:l})]}),c&&(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:c})]})]})}])},30363,e=>{"use strict";let r=(0,e.i(86620).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,r],30363)},96416,e=>{"use strict";let r=(0,e.i(86620).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,r],96416)},12251,e=>{"use strict";var r=e.i(44501),t=e.i(17635),s=e.i(33253),a=e.i(42595),i=e.i(23888);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:n,title:l,description:o,confirmText:c="确认",cancelText:d="取消",variant:m="default",onConfirm:u,confirmInput:h,children:x}){let[p,f]=(0,t.useState)(""),v=void 0!==h&&""!==h,g=v&&p!==h,y=(0,t.useCallback)(()=>{g||(u(),f(""))},[g,u]),j=(0,t.useCallback)(e=>{e||f(""),n(e)},[n]);return(0,r.jsx)(s.Dialog,{open:e,onOpenChange:j,children:(0,r.jsxs)(s.DialogContent,{className:"sm:max-w-120",children:[(0,r.jsxs)(s.DialogHeader,{children:[(0,r.jsx)(s.DialogTitle,{children:l}),(0,r.jsx)(s.DialogDescription,{className:"break-all",children:o})]}),v&&(0,r.jsxs)("div",{className:"py-2",children:[(0,r.jsxs)("p",{className:"mb-2 text-sm text-muted-foreground",children:["请输入 ",(0,r.jsx)("strong",{children:h})," 以确认操作"]}),(0,r.jsx)(i.Input,{value:p,onChange:e=>f(e.target.value),placeholder:h,autoFocus:!0})]}),x&&(0,r.jsx)("div",{className:"py-1",children:x}),(0,r.jsxs)(s.DialogFooter,{children:[(0,r.jsx)(a.Button,{variant:"outline",onClick:()=>j(!1),children:d}),(0,r.jsx)(a.Button,{variant:"danger"===m?"destructive":"default",onClick:y,disabled:g,children:c})]})]})})}])},67530,e=>{"use strict";let r=(0,e.i(86620).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,r],67530)},99877,e=>{"use strict";var r=e.i(44501);e.s(["EmptyState",0,function({icon:e,title:t,description:s,action:a,illustration:i}){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[i??(0,r.jsx)("div",{className:"mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-[hsl(var(--primary)/0.08)] ring-8 ring-[hsl(var(--primary)/0.04)]",children:(0,r.jsx)(e,{className:"text-primary",size:36,strokeWidth:1.75})}),(0,r.jsx)("h3",{className:"mb-2 text-base font-semibold text-foreground",children:t}),(0,r.jsx)("p",{className:"mb-6 max-w-sm text-sm text-muted-foreground",children:s}),a&&(0,r.jsx)("div",{children:a})]})}])},66458,e=>{"use strict";var r=e.i(44501),t=e.i(94237),s=e.i(76490);let a=(0,t.cva)("inline-flex items-center rounded border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-[hsl(var(--primary)/0.3)] focus:ring-offset-1",{variants:{variant:{default:"border-transparent bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90",secondary:"border-transparent bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] hover:opacity-80",destructive:"border-transparent bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))] hover:opacity-90",outline:"border-[hsl(var(--border))] text-[hsl(var(--foreground))] bg-[hsl(var(--card))]",primary:"border-transparent bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]",success:"border-transparent bg-[hsl(var(--success-soft))] text-[hsl(var(--success))]",warning:"border-transparent bg-[hsl(var(--warning-soft))] text-[hsl(var(--warning))]",danger:"border-transparent bg-[hsl(var(--danger-soft))] text-[hsl(var(--danger))]",purple:"border-transparent bg-[hsl(var(--purple-soft))] text-[hsl(var(--purple))]"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:t,...i}){return(0,r.jsx)("div",{className:(0,s.cn)(a({variant:t}),e),...i})}])},10414,e=>{"use strict";var r=e.i(44501),t=e.i(17635),s=e.i(76490);let a=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm",e),...t}));a.displayName="Card",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("flex flex-col space-y-1 px-5 pt-5 pb-3 border-b border-[hsl(var(--border-light))]",e),...t})).displayName="CardHeader",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("text-base font-semibold leading-tight",e),...t})).displayName="CardTitle",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("text-sm text-[hsl(var(--muted-foreground))]",e),...t})).displayName="CardDescription";let i=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("px-5 py-4",e),...t}));i.displayName="CardContent",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("flex items-center px-5 py-3 border-t border-[hsl(var(--border-light))]",e),...t})).displayName="CardFooter";let n=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm","transition-[transform,box-shadow,border-color] duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)]","hover:border-[hsl(var(--primary))] hover:shadow-primary-soft",e),...t}));n.displayName="CardInteractive",e.s(["Card",0,a,"CardContent",0,i,"CardInteractive",0,n])},73783,e=>{"use strict";let r=(0,e.i(86620).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["MoreHorizontal",0,r],73783)},70821,e=>{"use strict";var r=e.i(44501),t=e.i(65581),s=e.i(87014),a=e.i(12251),i=e.i(37500),n=e.i(12984),l=e.i(64204),o=e.i(47570);e.s(["MemoryDeleteDialog",0,function({memoryStoreName:e,open:c,onOpenChange:d,redirectToList:m=!1}){let u,h=(0,t.useRouter)(),x=(u=(0,n.useQueryClient)(),(0,i.useMutation)({mutationFn:e=>(0,l.deleteMemoryStore)(e),onSuccess:()=>{(0,o.invalidateMemoryQueries)(u)}}));async function p(){if(e)try{await x.mutateAsync(e),s.toast.success("记忆库已删除"),d(!1),m&&h.push("/memory")}catch(e){s.toast.error(e instanceof Error?e.message:"删除记忆库失败")}}return(0,r.jsx)(a.ConfirmDialog,{open:c,onOpenChange:d,title:"删除记忆库",description:`确定要删除记忆库 "${e??""}" 吗?此操作不可撤销。`,confirmInput:e??void 0,confirmText:"删除",variant:"danger",onConfirm:p})}],70821)},90035,51989,e=>{"use strict";var r=e.i(44501),t=e.i(96416),s=e.i(46398),a=e.i(76490);e.s(["SearchInput",0,function({value:e,onChange:i,placeholder:n="搜索…",className:l}){return(0,r.jsxs)("div",{className:(0,a.cn)("relative flex items-center",l),children:[(0,r.jsx)(t.Search,{className:"absolute left-3 pointer-events-none text-muted-foreground",size:16}),(0,r.jsx)("input",{type:"text",value:e,onChange:e=>i(e.target.value),placeholder:n,className:(0,a.cn)("h-9 w-full rounded-md border border-input bg-background pl-9 pr-8 text-sm","placeholder:text-muted-foreground/60","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1")}),e&&(0,r.jsx)("button",{type:"button",onClick:()=>i(""),className:"absolute right-2 inline-flex items-center justify-center rounded-full p-0.5 text-gray-400 hover:text-gray-600 transition-colors","aria-label":"清除搜索",children:(0,r.jsx)(s.X,{size:14})})]})}],90035);var i=e.i(17635);e.s(["useDebounce",0,function(e,r=300){let[t,s]=(0,i.useState)(e);return(0,i.useEffect)(()=>{let t=setTimeout(()=>{s(e)},r);return()=>{clearTimeout(t)}},[e,r]),t}],51989)},78932,e=>{"use strict";var r=e.i(44501),t=e.i(9823),s=e.i(30068),a=e.i(42595),i=e.i(93321);e.s(["ErrorState",0,function({error:e,onRetry:n}){let l=function(e){if(!(e instanceof i.ApiClientError))return null;let{status:r}=e;return 401===r||403===r?"Please check your AccessKey credentials in the project settings.":503===r||"NETWORK_ERROR"===e.code?"The service may be unreachable. Verify the endpoint address and network connectivity.":null}(e);return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,r.jsx)("div",{className:"mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-destructive/10 ring-8 ring-destructive/5",children:(0,r.jsx)(t.AlertTriangle,{className:"text-destructive",size:36,strokeWidth:1.75})}),(0,r.jsx)("h3",{className:"mb-2 text-base font-semibold text-foreground",children:"Failed to load data"}),(0,r.jsx)("p",{className:"mb-1 max-w-md text-sm text-muted-foreground",children:e.message}),l&&(0,r.jsx)("p",{className:"mb-6 max-w-md text-xs text-muted-foreground/80",children:l}),!l&&(0,r.jsx)("div",{className:"mb-6"}),n&&(0,r.jsxs)(a.Button,{variant:"outline",size:"sm",onClick:n,children:[(0,r.jsx)(s.RefreshCw,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}])},21090,e=>{"use strict";var r=e.i(44501),t=e.i(70978),s=e.i(58204),a=e.i(42595),i=e.i(23516),n=e.i(17635),l=e.i(18722),o=e.i(31211),c=e.i(99877),d=e.i(78932),m=e.i(90035),u=e.i(51989),h=e.i(54614),x=e.i(70821),p=e.i(65581),f=e.i(73783),v=e.i(96416),g=e.i(67530);let y=(0,e.i(86620).default)("table-properties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var j=e.i(30363),b=e.i(66458),N=e.i(10414),w=e.i(1709);let C=(0,n.memo)(function({memoryStore:e,onDelete:s}){let i=(0,p.useRouter)(),{memoryStoreName:n,description:o}=e,c=`/memory/${encodeURIComponent(n)}`,d=`/memory/${encodeURIComponent(n)}/units`;return(0,r.jsx)(t.default,{href:d,className:"no-underline",children:(0,r.jsx)(N.CardInteractive,{className:"group relative flex h-full cursor-pointer flex-col",children:(0,r.jsxs)(N.CardContent,{className:"flex flex-1 flex-col p-5",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)(l.Brain,{className:"h-4 w-4 shrink-0 text-primary"}),(0,r.jsx)("h3",{className:"truncate text-base font-semibold text-foreground",children:n})]}),(0,r.jsx)("div",{className:"opacity-0 transition-opacity duration-150 delay-75 group-hover:opacity-100 focus-within:opacity-100",onClick:e=>e.preventDefault(),children:(0,r.jsxs)(w.DropdownMenu,{children:[(0,r.jsx)(w.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsx)(a.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:(0,r.jsx)(f.MoreHorizontal,{className:"h-4 w-4"})})}),(0,r.jsxs)(w.DropdownMenuContent,{align:"end",children:[(0,r.jsxs)(w.DropdownMenuItem,{onClick:()=>i.push(`${c}/units`),children:[(0,r.jsx)(y,{className:"mr-2 h-4 w-4"}),"长期记忆"]}),(0,r.jsxs)(w.DropdownMenuItem,{onClick:()=>i.push(`${c}/search`),children:[(0,r.jsx)(v.Search,{className:"mr-2 h-4 w-4"}),"记忆检索"]}),(0,r.jsxs)(w.DropdownMenuItem,{onClick:()=>i.push(`${c}/settings`),children:[(0,r.jsx)(g.Settings,{className:"mr-2 h-4 w-4"}),"设置"]}),(0,r.jsxs)(w.DropdownMenuItem,{className:"text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",onClick:()=>s?.(n),children:[(0,r.jsx)(j.Trash2,{className:"mr-2 h-4 w-4"}),"删除"]})]})]})})]}),o?(0,r.jsx)("p",{className:"mt-2 line-clamp-3 text-sm text-muted-foreground",children:o}):(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"暂无描述"}),(0,r.jsx)("div",{className:"mt-auto flex items-center gap-2 pt-5",children:(0,r.jsx)(b.Badge,{variant:"secondary",className:"border-0 bg-[hsl(var(--primary-50))] text-primary",children:"Agent Memory"})})]})})})},(e,r)=>e.memoryStore===r.memoryStore||e.memoryStore.memoryStoreName===r.memoryStore.memoryStoreName&&e.memoryStore.description===r.memoryStore.description);function k(){let{data:e,isLoading:i,error:p,refetch:f}=(0,h.useMemoryStores)(),[v,g]=(0,n.useState)(""),[y,j]=(0,n.useState)(null),b=(0,u.useDebounce)(v,300),N=(0,n.useMemo)(()=>{let r=e?.items??[];if(!b)return r;let t=b.toLowerCase();return r.filter(e=>e.memoryStoreName.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))},[e?.items,b]);return i?(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((e,t)=>(0,r.jsx)(o.Skeleton,{className:"h-[160px] rounded-lg",delay:80*t},t))}):p?(0,r.jsx)(d.ErrorState,{error:p,onRetry:()=>f()}):e?.items?.length?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(m.SearchInput,{placeholder:"搜索记忆库...",value:v,onChange:g,className:"max-w-sm"}),(0,r.jsxs)("span",{className:"text-sm text-muted-foreground",children:["共 ",N.length," 个记忆库"]})]}),0===N.length?(0,r.jsx)(c.EmptyState,{icon:l.Brain,title:"没有匹配的记忆库",description:"尝试调整搜索关键词"}):(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(e=>(0,r.jsx)(C,{memoryStore:e,onDelete:j},e.memoryStoreName))}),(0,r.jsx)(x.MemoryDeleteDialog,{memoryStoreName:y,open:!!y,onOpenChange:e=>{e||j(null)}})]}):(0,r.jsx)(c.EmptyState,{icon:l.Brain,title:"还没有记忆库",description:"创建第一个记忆库,开始管理 Agent 的长期记忆",action:(0,r.jsx)(a.Button,{asChild:!0,children:(0,r.jsxs)(t.default,{href:"/memory/create",children:[(0,r.jsx)(s.Plus,{className:"mr-2 h-4 w-4"}),"创建记忆库"]})})})}C.displayName="MemoryStoreCard",e.s(["default",0,function(){return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(i.PageHeader,{title:"记忆库",description:"管理 Agent 的长期记忆、检索记忆单元并观测请求记录",children:(0,r.jsx)(a.Button,{asChild:!0,children:(0,r.jsxs)(t.default,{href:"/memory/create",children:[(0,r.jsx)(s.Plus,{className:"mr-2 h-4 w-4"}),"创建记忆库"]})})}),(0,r.jsx)(k,{})]})}],21090)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31211,e=>{"use strict";var r=e.i(44501),t=e.i(17635),s=e.i(76490);e.s(["Skeleton",0,function({className:e,delay:t,style:a,...i}){return(0,r.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-md bg-primary/10",e),style:{animationDelay:t?`${t}ms`:void 0,...a},...i})},"SkeletonGroup",0,function({children:e,stagger:s=80,className:a,...i}){let n=t.Children.toArray(e);return(0,r.jsx)("div",{className:a,...i,children:n.map((e,r)=>{if(!t.isValidElement(e))return e;let a=e.props.delay??0;return t.cloneElement(e,{delay:a+r*s})})})}])},9823,e=>{"use strict";let r=(0,e.i(86620).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,r],9823)},30068,e=>{"use strict";let r=(0,e.i(86620).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,r],30068)},23516,e=>{"use strict";var r=e.i(44501),t=e.i(70978),s=e.i(65581),a=e.i(79980),i=e.i(76490);let n={"knowledge-base":"知识库",memory:"记忆库","llm-providers":"大模型",projects:"项目管理",documents:"文档",retrieval:"检索测试",qa:"问答测试",search:"记忆检索",units:"长期记忆",messages:"短期记忆",requests:"请求审计",settings:"设置",create:"新建",new:"新建",chat:"对话"};e.s(["PageHeader",0,function({title:e,description:l,hideBreadcrumb:o,children:c,className:d}){let m=(0,s.usePathname)()??"/",u=o?[]:function(e){if(/^\/knowledge-base\/[^/]+(?:\/.*)?$/.test(e)||/^\/memory\/[^/]+(?:\/.*)?$/.test(e))return[];let r=e.split("/").filter(Boolean);if(0===r.length)return[];let t=[],s="";return r.forEach((e,a)=>{s+=`/${e}`;let i=decodeURIComponent(e),l=n[i]??i;t.push({label:l,href:a<r.length-1?s:void 0})}),t}(m);return(0,r.jsxs)("div",{className:(0,i.cn)("mb-5 flex flex-col gap-2",d),children:[u.length>1&&(0,r.jsxs)("nav",{"aria-label":"面包屑",className:"flex items-center gap-1 text-[13px] text-[hsl(var(--muted-foreground))]",children:[(0,r.jsx)(t.default,{href:"/",className:"transition-colors hover:text-[hsl(var(--foreground))]",children:"主页"}),u.map((e,s)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(a.ChevronRight,{className:"h-3 w-3 opacity-60"}),e.href?(0,r.jsx)(t.default,{href:e.href,className:"transition-colors hover:text-[hsl(var(--foreground))]",children:e.label}):(0,r.jsx)("span",{className:"font-medium text-[hsl(var(--foreground))]",children:e.label})]},`${e.label}-${s}`))]}),(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold leading-tight text-[hsl(var(--foreground))]",children:e}),l&&(0,r.jsx)("p",{className:"text-[13px] text-[hsl(var(--muted-foreground))]",children:l})]}),c&&(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:c})]})]})}])},30363,e=>{"use strict";let r=(0,e.i(86620).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,r],30363)},96416,e=>{"use strict";let r=(0,e.i(86620).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,r],96416)},12251,e=>{"use strict";var r=e.i(44501),t=e.i(17635),s=e.i(33253),a=e.i(42595),i=e.i(23888);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:n,title:l,description:o,confirmText:c="确认",cancelText:d="取消",variant:m="default",onConfirm:u,confirmInput:h,children:x}){let[p,f]=(0,t.useState)(""),v=void 0!==h&&""!==h,g=v&&p!==h,y=(0,t.useCallback)(()=>{g||(u(),f(""))},[g,u]),j=(0,t.useCallback)(e=>{e||f(""),n(e)},[n]);return(0,r.jsx)(s.Dialog,{open:e,onOpenChange:j,children:(0,r.jsxs)(s.DialogContent,{className:"sm:max-w-120",children:[(0,r.jsxs)(s.DialogHeader,{children:[(0,r.jsx)(s.DialogTitle,{children:l}),(0,r.jsx)(s.DialogDescription,{className:"break-all",children:o})]}),v&&(0,r.jsxs)("div",{className:"py-2",children:[(0,r.jsxs)("p",{className:"mb-2 text-sm text-muted-foreground",children:["请输入 ",(0,r.jsx)("strong",{children:h})," 以确认操作"]}),(0,r.jsx)(i.Input,{value:p,onChange:e=>f(e.target.value),placeholder:h,autoFocus:!0})]}),x&&(0,r.jsx)("div",{className:"py-1",children:x}),(0,r.jsxs)(s.DialogFooter,{children:[(0,r.jsx)(a.Button,{variant:"outline",onClick:()=>j(!1),children:d}),(0,r.jsx)(a.Button,{variant:"danger"===m?"destructive":"default",onClick:y,disabled:g,children:c})]})]})})}])},67530,e=>{"use strict";let r=(0,e.i(86620).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,r],67530)},99877,e=>{"use strict";var r=e.i(44501);e.s(["EmptyState",0,function({icon:e,title:t,description:s,action:a,illustration:i}){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[i??(0,r.jsx)("div",{className:"mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-[hsl(var(--primary)/0.08)] ring-8 ring-[hsl(var(--primary)/0.04)]",children:(0,r.jsx)(e,{className:"text-primary",size:36,strokeWidth:1.75})}),(0,r.jsx)("h3",{className:"mb-2 text-base font-semibold text-foreground",children:t}),(0,r.jsx)("p",{className:"mb-6 max-w-sm text-sm text-muted-foreground",children:s}),a&&(0,r.jsx)("div",{children:a})]})}])},66458,e=>{"use strict";var r=e.i(44501),t=e.i(94237),s=e.i(76490);let a=(0,t.cva)("inline-flex items-center rounded border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-[hsl(var(--primary)/0.3)] focus:ring-offset-1",{variants:{variant:{default:"border-transparent bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90",secondary:"border-transparent bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] hover:opacity-80",destructive:"border-transparent bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))] hover:opacity-90",outline:"border-[hsl(var(--border))] text-[hsl(var(--foreground))] bg-[hsl(var(--card))]",primary:"border-transparent bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]",success:"border-transparent bg-[hsl(var(--success-soft))] text-[hsl(var(--success))]",warning:"border-transparent bg-[hsl(var(--warning-soft))] text-[hsl(var(--warning))]",danger:"border-transparent bg-[hsl(var(--danger-soft))] text-[hsl(var(--danger))]",purple:"border-transparent bg-[hsl(var(--purple-soft))] text-[hsl(var(--purple))]"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:t,...i}){return(0,r.jsx)("div",{className:(0,s.cn)(a({variant:t}),e),...i})}])},10414,e=>{"use strict";var r=e.i(44501),t=e.i(17635),s=e.i(76490);let a=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm",e),...t}));a.displayName="Card",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("flex flex-col space-y-1 px-5 pt-5 pb-3 border-b border-[hsl(var(--border-light))]",e),...t})).displayName="CardHeader",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("text-base font-semibold leading-tight",e),...t})).displayName="CardTitle",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("text-sm text-[hsl(var(--muted-foreground))]",e),...t})).displayName="CardDescription";let i=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("px-5 py-4",e),...t}));i.displayName="CardContent",t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("flex items-center px-5 py-3 border-t border-[hsl(var(--border-light))]",e),...t})).displayName="CardFooter";let n=t.forwardRef(({className:e,...t},a)=>(0,r.jsx)("div",{ref:a,className:(0,s.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm","transition-[transform,box-shadow,border-color] duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)]","hover:border-[hsl(var(--primary))] hover:shadow-primary-soft",e),...t}));n.displayName="CardInteractive",e.s(["Card",0,a,"CardContent",0,i,"CardInteractive",0,n])},73783,e=>{"use strict";let r=(0,e.i(86620).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["MoreHorizontal",0,r],73783)},70821,e=>{"use strict";var r=e.i(44501),t=e.i(65581),s=e.i(87014),a=e.i(12251),i=e.i(37500),n=e.i(12984),l=e.i(64204),o=e.i(47570);e.s(["MemoryDeleteDialog",0,function({memoryStoreName:e,open:c,onOpenChange:d,redirectToList:m=!1}){let u,h=(0,t.useRouter)(),x=(u=(0,n.useQueryClient)(),(0,i.useMutation)({mutationFn:e=>(0,l.deleteMemoryStore)(e),onSuccess:()=>{(0,o.invalidateMemoryQueries)(u)}}));async function p(){if(e)try{await x.mutateAsync(e),s.toast.success("记忆库已删除"),d(!1),m&&h.push("/memory")}catch(e){s.toast.error(e instanceof Error?e.message:"删除记忆库失败")}}return(0,r.jsx)(a.ConfirmDialog,{open:c,onOpenChange:d,title:"删除记忆库",description:`确定要删除记忆库 "${e??""}" 吗?此操作不可撤销。`,confirmInput:e??void 0,confirmText:"删除",variant:"danger",onConfirm:p})}],70821)},90035,51989,e=>{"use strict";var r=e.i(44501),t=e.i(96416),s=e.i(46398),a=e.i(76490);e.s(["SearchInput",0,function({value:e,onChange:i,placeholder:n="搜索…",className:l}){return(0,r.jsxs)("div",{className:(0,a.cn)("relative flex items-center",l),children:[(0,r.jsx)(t.Search,{className:"absolute left-3 pointer-events-none text-muted-foreground",size:16}),(0,r.jsx)("input",{type:"text",value:e,onChange:e=>i(e.target.value),placeholder:n,className:(0,a.cn)("h-9 w-full rounded-md border border-input bg-background pl-9 pr-8 text-sm","placeholder:text-muted-foreground/60","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1")}),e&&(0,r.jsx)("button",{type:"button",onClick:()=>i(""),className:"absolute right-2 inline-flex items-center justify-center rounded-full p-0.5 text-gray-400 hover:text-gray-600 transition-colors","aria-label":"清除搜索",children:(0,r.jsx)(s.X,{size:14})})]})}],90035);var i=e.i(17635);e.s(["useDebounce",0,function(e,r=300){let[t,s]=(0,i.useState)(e);return(0,i.useEffect)(()=>{let t=setTimeout(()=>{s(e)},r);return()=>{clearTimeout(t)}},[e,r]),t}],51989)},78932,e=>{"use strict";var r=e.i(44501),t=e.i(9823),s=e.i(30068),a=e.i(42595),i=e.i(93321);e.s(["ErrorState",0,function({error:e,onRetry:n}){let l=function(e){if(!(e instanceof i.ApiClientError))return null;let{status:r}=e;return 401===r||403===r?"Please check your AccessKey credentials in the project settings.":503===r||"NETWORK_ERROR"===e.code?"The service may be unreachable. Verify the endpoint address and network connectivity.":null}(e);return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,r.jsx)("div",{className:"mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-destructive/10 ring-8 ring-destructive/5",children:(0,r.jsx)(t.AlertTriangle,{className:"text-destructive",size:36,strokeWidth:1.75})}),(0,r.jsx)("h3",{className:"mb-2 text-base font-semibold text-foreground",children:"Failed to load data"}),(0,r.jsx)("p",{className:"mb-1 max-w-md text-sm text-muted-foreground",children:e.message}),l&&(0,r.jsx)("p",{className:"mb-6 max-w-md text-xs text-muted-foreground/80",children:l}),!l&&(0,r.jsx)("div",{className:"mb-6"}),n&&(0,r.jsxs)(a.Button,{variant:"outline",size:"sm",onClick:n,children:[(0,r.jsx)(s.RefreshCw,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}])},21090,e=>{"use strict";var r=e.i(44501),t=e.i(70978),s=e.i(58204),a=e.i(42595),i=e.i(23516),n=e.i(17635),l=e.i(18722),o=e.i(31211),c=e.i(99877),d=e.i(78932),m=e.i(90035),u=e.i(51989),h=e.i(54614),x=e.i(70821),p=e.i(65581),f=e.i(73783),v=e.i(96416),g=e.i(67530);let y=(0,e.i(86620).default)("table-properties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var j=e.i(30363),b=e.i(66458),N=e.i(10414),w=e.i(1709);let C=(0,n.memo)(function({memoryStore:e,onDelete:s}){let i=(0,p.useRouter)(),{memoryStoreName:n,description:o}=e,c=`/memory/${encodeURIComponent(n)}`,d=`/memory/${encodeURIComponent(n)}/units`;return(0,r.jsx)(t.default,{href:d,className:"no-underline",children:(0,r.jsx)(N.CardInteractive,{className:"group relative flex h-full cursor-pointer flex-col",children:(0,r.jsxs)(N.CardContent,{className:"flex flex-1 flex-col p-5",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)(l.Brain,{className:"h-4 w-4 shrink-0 text-primary"}),(0,r.jsx)("h3",{className:"truncate text-base font-semibold text-foreground",children:n})]}),(0,r.jsx)("div",{className:"opacity-0 transition-opacity duration-150 delay-75 group-hover:opacity-100 focus-within:opacity-100",onClick:e=>e.preventDefault(),children:(0,r.jsxs)(w.DropdownMenu,{children:[(0,r.jsx)(w.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsx)(a.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:(0,r.jsx)(f.MoreHorizontal,{className:"h-4 w-4"})})}),(0,r.jsxs)(w.DropdownMenuContent,{align:"end",children:[(0,r.jsxs)(w.DropdownMenuItem,{onClick:()=>i.push(`${c}/units`),children:[(0,r.jsx)(y,{className:"mr-2 h-4 w-4"}),"长期记忆"]}),(0,r.jsxs)(w.DropdownMenuItem,{onClick:()=>i.push(`${c}/search`),children:[(0,r.jsx)(v.Search,{className:"mr-2 h-4 w-4"}),"记忆检索"]}),(0,r.jsxs)(w.DropdownMenuItem,{onClick:()=>i.push(`${c}/settings`),children:[(0,r.jsx)(g.Settings,{className:"mr-2 h-4 w-4"}),"设置"]}),(0,r.jsxs)(w.DropdownMenuItem,{className:"text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",onClick:()=>s?.(n),children:[(0,r.jsx)(j.Trash2,{className:"mr-2 h-4 w-4"}),"删除"]})]})]})})]}),o?(0,r.jsx)("p",{className:"mt-2 line-clamp-3 text-sm text-muted-foreground",children:o}):(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"暂无描述"}),(0,r.jsx)("div",{className:"mt-auto flex items-center gap-2 pt-5",children:(0,r.jsx)(b.Badge,{variant:"secondary",className:"border-0 bg-[hsl(var(--primary-50))] text-primary",children:"智能体记忆"})})]})})})},(e,r)=>e.memoryStore===r.memoryStore||e.memoryStore.memoryStoreName===r.memoryStore.memoryStoreName&&e.memoryStore.description===r.memoryStore.description);function k(){let{data:e,isLoading:i,error:p,refetch:f}=(0,h.useMemoryStores)(),[v,g]=(0,n.useState)(""),[y,j]=(0,n.useState)(null),b=(0,u.useDebounce)(v,300),N=(0,n.useMemo)(()=>{let r=e?.items??[];if(!b)return r;let t=b.toLowerCase();return r.filter(e=>e.memoryStoreName.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))},[e?.items,b]);return i?(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((e,t)=>(0,r.jsx)(o.Skeleton,{className:"h-[160px] rounded-lg",delay:80*t},t))}):p?(0,r.jsx)(d.ErrorState,{error:p,onRetry:()=>f()}):e?.items?.length?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(m.SearchInput,{placeholder:"搜索记忆库...",value:v,onChange:g,className:"max-w-sm"}),(0,r.jsxs)("span",{className:"text-sm text-muted-foreground",children:["共 ",N.length," 个记忆库"]})]}),0===N.length?(0,r.jsx)(c.EmptyState,{icon:l.Brain,title:"没有匹配的记忆库",description:"尝试调整搜索关键词"}):(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(e=>(0,r.jsx)(C,{memoryStore:e,onDelete:j},e.memoryStoreName))}),(0,r.jsx)(x.MemoryDeleteDialog,{memoryStoreName:y,open:!!y,onOpenChange:e=>{e||j(null)}})]}):(0,r.jsx)(c.EmptyState,{icon:l.Brain,title:"还没有记忆库",description:"创建第一个记忆库,开始管理智能体的长期记忆",action:(0,r.jsx)(a.Button,{asChild:!0,children:(0,r.jsxs)(t.default,{href:"/memory/create",children:[(0,r.jsx)(s.Plus,{className:"mr-2 h-4 w-4"}),"创建记忆库"]})})})}C.displayName="MemoryStoreCard",e.s(["default",0,function(){return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(i.PageHeader,{title:"记忆库",description:"管理智能体的长期记忆、检索记忆单元并观测请求记录",children:(0,r.jsx)(a.Button,{asChild:!0,children:(0,r.jsxs)(t.default,{href:"/memory/create",children:[(0,r.jsx)(s.Plus,{className:"mr-2 h-4 w-4"}),"创建记忆库"]})})}),(0,r.jsx)(k,{})]})}],21090)}]);