@tablestore/tablestore-agent-cli 0.2.3 → 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 (266) 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 +3 -3
  9. package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
  10. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  11. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  12. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
  13. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
  14. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
  15. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
  16. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
  17. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
  18. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
  19. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
  20. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
  21. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
  22. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
  23. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
  24. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
  25. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
  26. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
  27. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
  28. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
  29. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
  30. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  31. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  32. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
  33. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
  34. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
  35. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
  36. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
  37. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
  38. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
  39. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
  40. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
  41. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
  42. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
  43. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
  44. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
  45. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
  46. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
  47. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  48. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  49. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  50. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
  51. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
  52. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  53. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  54. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  55. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  56. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  57. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  58. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  59. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +2 -2
  60. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  61. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  62. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  63. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  64. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  65. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  66. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  67. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  68. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  69. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  70. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  71. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  72. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  73. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  74. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  75. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -1
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +2 -2
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +2 -2
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +2 -2
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +3 -3
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +3 -3
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +2 -2
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +2 -2
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  112. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +6 -6
  113. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +2 -2
  114. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95_src_app_(dashboard)_knowledge-base_[name]_settings_settings-client_tsx_13312zk._.js +1 -1
  115. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08faq-z._.js +1 -1
  116. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0c94d.y._.js +3 -0
  117. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0jb9ccl._.js +1 -1
  118. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__00uh_im._.js → [root-of-the-server]__0lgg04c._.js} +1 -1
  119. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01-2v37._.js +1 -1
  120. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01ag-vl._.js +3 -0
  121. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0atzifq._.js +3 -0
  122. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f4u0.1._.js +1 -1
  123. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gbt~hy._.js +1 -1
  124. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gl7kh7._.js +1 -1
  125. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j-q~ro._.js +1 -1
  126. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jghj2_._.js +1 -1
  127. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jlyg05._.js +3 -0
  128. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0n4gd_6._.js +1 -1
  129. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0l~-9i0._.js → _0tdjkbc._.js} +2 -2
  130. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tej2s.._.js +1 -1
  131. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_10u~-xc._.js +3 -0
  132. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12r9c8h._.js +1 -1
  133. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0.glq39._.js +3 -0
  134. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00ofp7q._.js +1 -1
  135. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_05.qn9h._.js +3 -0
  136. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_065m1.j._.js +1 -1
  137. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0xf3ffa._.js +1 -1
  138. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
  139. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
  140. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_create_page_tsx_0916~g-._.js +1 -1
  141. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
  142. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ls1exu._.js +1 -1
  143. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ugdjlb._.js +1 -1
  144. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +3 -3
  145. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  146. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  147. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  148. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  149. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00wmf85833643.js +1 -0
  150. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02tj1_rhgobzv.js +1 -0
  151. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0mea2ylxe.umh.js → 02zf3qddfaw~u.js} +1 -1
  152. package/dist/dashboard-runtime/dashboard/.next/static/chunks/039i70t10axdd.css +1 -0
  153. package/dist/dashboard-runtime/dashboard/.next/static/chunks/04bfame9rk.3d.js +5 -0
  154. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07ygw8215kyvc.js +1 -0
  155. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b5hr027rat4w.js +138 -0
  156. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0__g1ogrdh412.js → 0bkm-5yza5~d2.js} +1 -1
  157. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0lrw.bnws62y9.js → 0d7d.b.v9noym.js} +1 -1
  158. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0cto67_iw~p9z.js → 0fdofp-3kkc4g.js} +1 -1
  159. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{18d_i28~jrf91.js → 0i8hdbek9j-fu.js} +1 -1
  160. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ioivx4pbmayb.js +1 -0
  161. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0lp2g_27uyhuz.js → 0je7fmsrz2vok.js} +1 -1
  162. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jukioxtp1mn3.js +138 -0
  163. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0klidr2i6cd.g.js +1 -0
  164. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k~bkh1586r2i.js +1 -0
  165. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0nakvv2p1kjnf.js +1 -0
  166. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0un~rqes29pcr.js +1 -0
  167. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v.u57bsjppd_.js +1 -0
  168. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x3w~yxvm1xsq.js +4 -0
  169. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x5gol39unrgb.js +1 -0
  170. package/dist/dashboard-runtime/dashboard/.next/static/chunks/12s59v_sk0q-z.js +1 -0
  171. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{06uuhz24tvdt..js → 14~eqof4660i3.js} +1 -1
  172. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16y3764x-fh1n.js +1 -0
  173. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17mcnyr~1j7ih.js +1 -0
  174. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/documents/documents-client.tsx +1 -1
  175. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/layout-client.tsx +62 -26
  176. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/page.tsx +8 -4
  177. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/page.tsx +6 -2
  178. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/request-detail-dialog.tsx +9 -9
  179. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/requests-table.tsx +2 -2
  180. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +5 -1
  181. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +11 -7
  182. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/create/page.tsx +1 -1
  183. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/page.tsx +1 -1
  184. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +124 -13
  185. package/dist/dashboard-runtime/dashboard/src/app/globals.css +23 -0
  186. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +39 -17
  187. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-mount-config.tsx +1 -0
  188. package/dist/dashboard-runtime/dashboard/src/components/chat/memory-bind-section.tsx +15 -15
  189. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-retrieval-dialog.tsx +360 -0
  190. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-row.tsx +49 -5
  191. package/dist/dashboard-runtime/dashboard/src/components/chat/unified-retrieval-section.tsx +61 -26
  192. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-chunks-dialog.tsx +72 -20
  193. package/dist/dashboard-runtime/dashboard/src/components/instance/connect-instance-form.tsx +5 -0
  194. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/embedding-config-form.tsx +16 -2
  195. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-card.tsx +37 -24
  196. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-create-form.tsx +173 -86
  197. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-settings-form.tsx +319 -280
  198. package/dist/dashboard-runtime/dashboard/src/components/layout/detail-sidebar.tsx +47 -18
  199. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-instance-card.tsx +2 -2
  200. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-add-dialog.tsx +2 -2
  201. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-edit-dialog.tsx +2 -2
  202. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-messages-table.tsx +3 -3
  203. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-requests-table.tsx +12 -12
  204. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +20 -11
  205. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +7 -7
  206. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +6 -6
  207. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +1 -1
  208. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-list.tsx +1 -1
  209. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-detail-panel.tsx +4 -4
  210. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +2 -2
  211. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +104 -7
  212. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-form.tsx +241 -24
  213. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-rerank-fields.tsx +1 -0
  214. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-result-card.tsx +52 -4
  215. package/dist/dashboard-runtime/dashboard/src/components/shared/status-badge.tsx +10 -5
  216. package/dist/dashboard-runtime/dashboard/src/components/ui/nav-tab-bar.tsx +1 -1
  217. package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +9 -5
  218. package/dist/dashboard-runtime/dashboard/src/lib/constants.ts +8 -0
  219. package/dist/dashboard-runtime/dashboard/src/lib/server/llm-client.ts +19 -1
  220. package/dist/dashboard-runtime/dashboard/src/schemas/knowledge-base.ts +6 -0
  221. package/dist/dashboard-runtime/dashboard/src/schemas/retrieval.ts +46 -27
  222. package/dist/dashboard-runtime/dashboard/src/types/knowledge-base.ts +10 -0
  223. package/dist/dashboard-runtime/dashboard/src/types/retrieval.ts +9 -4
  224. package/dist/dashboard-runtime/dashboard/tailwind.config.ts +4 -0
  225. package/dist/dashboard-runtime/dashboard/vitest.config.mjs +5 -2
  226. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  227. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  228. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +21 -5
  229. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  230. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  231. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  232. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +21 -5
  233. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  234. package/dist/utils/read-image-input.d.ts +47 -0
  235. package/dist/utils/read-image-input.d.ts.map +1 -0
  236. package/dist/utils/read-image-input.js +89 -0
  237. package/dist/utils/read-image-input.js.map +1 -0
  238. package/package.json +2 -2
  239. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0hozzu6._.js +0 -3
  240. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tr8-3u._.js +0 -3
  241. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0uu1sjh._.js +0 -3
  242. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0vasoy6._.js +0 -3
  243. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12~3vfk._.js +0 -3
  244. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13_lb.o._.js +0 -3
  245. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0ejgygh._.js +0 -3
  246. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_0-tuf-h._.js +0 -3
  247. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0535h0pr4~.-1.js +0 -1
  248. package/dist/dashboard-runtime/dashboard/.next/static/chunks/062k9jbtd9.lv.js +0 -1
  249. package/dist/dashboard-runtime/dashboard/.next/static/chunks/06aj_c5rwvkut.js +0 -4
  250. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07t_2t_-s9aq_.js +0 -5
  251. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0bs_w1~xt92db.js +0 -138
  252. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0d29.l~3ip181.js +0 -1
  253. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0gjg-rd.ybcga.js +0 -1
  254. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jc31diex030o.js +0 -1
  255. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0m6zpy2h1p2vp.js +0 -138
  256. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rm8~7jovs879.css +0 -1
  257. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0t0yqi68~eil6.js +0 -1
  258. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0th7u6qvdy3x2.js +0 -1
  259. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0tmwptel_4y0o.js +0 -1
  260. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6_s-0w8.yr..js +0 -1
  261. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v9d5wl9nsva3.js +0 -1
  262. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14.dp0-y_mhjo.js +0 -1
  263. package/dist/dashboard-runtime/dashboard/.next/static/chunks/15bzqpm440jvz.js +0 -1
  264. /package/dist/dashboard-runtime/dashboard/.next/static/{Vhp9IA5UJNqZzEyFxakjw → EIbKHHti0Z1ephKfJzCKH}/_buildManifest.js +0 -0
  265. /package/dist/dashboard-runtime/dashboard/.next/static/{Vhp9IA5UJNqZzEyFxakjw → EIbKHHti0Z1ephKfJzCKH}/_clientMiddlewareManifest.js +0 -0
  266. /package/dist/dashboard-runtime/dashboard/.next/static/{Vhp9IA5UJNqZzEyFxakjw → EIbKHHti0Z1ephKfJzCKH}/_ssgManifest.js +0 -0
@@ -25,7 +25,11 @@ export default function MemoryUnitsPage() {
25
25
  const params = useParams<{ store: string }>();
26
26
  const searchParams = useSearchParams();
27
27
  const memoryStoreName = decodeURIComponent(params.store);
28
- const scope = useMemo(() => buildMemoryScope(searchParams), [searchParams.toString()]);
28
+ const searchParamsString = searchParams.toString();
29
+ const scope = useMemo(
30
+ () => buildMemoryScope(new URLSearchParams(searchParamsString)),
31
+ [searchParamsString],
32
+ );
29
33
  const wildcard = hasWildcardScope(scope);
30
34
  const scopeKey = useMemo(() =>
31
35
  `${scope.appId}|${scope.tenantId ?? ""}|${scope.agentId ?? ""}|${scope.runId ?? ""}`,
@@ -87,7 +91,7 @@ export default function MemoryUnitsPage() {
87
91
  return;
88
92
  }
89
93
  if (!canOperateOnUnit(deleteUnit, scope)) {
90
- toast.error("当前记忆单元缺少精确 scope,无法删除");
94
+ toast.error("当前记忆单元缺少精确范围,无法删除");
91
95
  return;
92
96
  }
93
97
  try {
@@ -102,11 +106,11 @@ export default function MemoryUnitsPage() {
102
106
 
103
107
  async function handleSearchById() {
104
108
  if (!searchId.trim()) {
105
- toast.error("请输入 Memory ID");
109
+ toast.error("请输入记忆 ID");
106
110
  return;
107
111
  }
108
112
  if (!scope.appId) {
109
- toast.error("请先设置精确的 Scope");
113
+ toast.error("请先设置精确的范围");
110
114
  return;
111
115
  }
112
116
  setSearching(true);
@@ -170,7 +174,7 @@ export default function MemoryUnitsPage() {
170
174
  </span>
171
175
  </TooltipTrigger>
172
176
  <TooltipContent side="bottom" className="max-w-[240px]">
173
- <p>请在上方 Scope 栏中为所有字段设置具体值后再添加记忆</p>
177
+ <p>请在上方范围栏中为所有字段设置具体值后再添加记忆</p>
174
178
  </TooltipContent>
175
179
  </Tooltip>
176
180
  </TooltipProvider>
@@ -187,7 +191,7 @@ export default function MemoryUnitsPage() {
187
191
  <Input
188
192
  value={searchId}
189
193
  onChange={(e) => setSearchId(e.target.value)}
190
- placeholder="输入 Memory ID 查询单条记忆..."
194
+ placeholder="输入记忆 ID 查询单条记忆..."
191
195
  className="max-w-md"
192
196
  onKeyDown={(e) => e.key === "Enter" && handleSearchById()}
193
197
  />
@@ -201,7 +205,7 @@ export default function MemoryUnitsPage() {
201
205
 
202
206
  {wildcard && !searchedUnit && (
203
207
  <p className="text-xs text-muted-foreground">
204
- 当前 scope 含通配符,仅支持只读查询,无法执行新增、查看详情、编辑或删除。
208
+ 当前范围含通配符,仅支持只读查询,无法执行新增、查看详情、编辑或删除。
205
209
  </p>
206
210
  )}
207
211
 
@@ -18,7 +18,7 @@ export default function CreateMemoryStorePage() {
18
18
  </Link>
19
19
  <PageHeader
20
20
  title="创建记忆库"
21
- description="创建一个新的 Agent Memory store"
21
+ description="创建一个新的智能体记忆库"
22
22
  />
23
23
  </div>
24
24
 
@@ -11,7 +11,7 @@ export default function MemoryPage() {
11
11
  <div className="space-y-6">
12
12
  <PageHeader
13
13
  title="记忆库"
14
- description="管理 Agent 的长期记忆、检索记忆单元并观测请求记录"
14
+ description="管理智能体的长期记忆、检索记忆单元并观测请求记录"
15
15
  >
16
16
  <Button asChild>
17
17
  <Link href="/memory/create">
@@ -1,6 +1,6 @@
1
1
  import { type NextRequest } from "next/server";
2
2
 
3
- import { chatCompletionStream } from "@/lib/server/llm-client";
3
+ import { chatCompletionStream, type LLMMessageContent, type ContentPart } from "@/lib/server/llm-client";
4
4
  import { getProviderWithSecret } from "@/lib/server/llm-provider-store";
5
5
  import { rewriteQuery } from "@/lib/server/query-rewriter";
6
6
  import {
@@ -74,8 +74,24 @@ function buildDefaultPreamble(opts: {
74
74
  // Matches the plan's simple "keep last 20 turns" policy; token-based trimming
75
75
  // can land later when we wire up `tiktoken`.
76
76
  const MAX_HISTORY_MESSAGES = 20;
77
+ /**
78
+ * 单个检索 chunk 拼入 system message 时的最大显示字符数。
79
+ * 用于控制 system 提示总长度,避免单个超长 chunk 把模型上下文挤爆。
80
+ */
81
+ const MAX_CHUNK_DISPLAY_LENGTH = 1200;
77
82
  const chatLogger = createLogger("dashboard.api.llm");
78
83
 
84
+ /**
85
+ * 判断一个检索 chunk 是否为图片类型。
86
+ *
87
+ * 服务端契约下 chunkType 共 4 种取值:text | table | formula | image。
88
+ * 大小写不敏感地比较,以兼容后端契约可能出现的大小写漂移。除 image 外的
89
+ * 3 种类型都按文本走 contextBlock 拼接,不进入多模态 image_url 部分。
90
+ */
91
+ function isImageChunk(chunk: { chunkType?: string }): boolean {
92
+ return chunk.chunkType?.toUpperCase() === "IMAGE";
93
+ }
94
+
79
95
  // turnId 去重:客户端每个「逻辑轮次」生成一次 turnId(regenerate / edit-resend
80
96
  // 复用同一个值)。我们仅在内存里维护一个 ~10 分钟过期的 set;不要求扛过进程重启。
81
97
  const TURN_DEDUP_TTL_MS = 10 * 60 * 1000;
@@ -533,13 +549,14 @@ async function resolveMemoryClient(request: NextRequest): Promise<
533
549
  * cite back. The header mentions the KB count when multiple KBs were queried
534
550
  * so the model can reason about source diversity.
535
551
  */
536
- function buildFinalMessages(
552
+ /** @internal Exported for unit testing multimodal message construction. */
553
+ export function buildFinalMessages(
537
554
  userSystemPrompt: string,
538
555
  chunks: RetrievedChunk[],
539
556
  groups: RetrievalGroup[],
540
557
  memoryBlock: string,
541
558
  history: Array<{ role: ChatRole; content: string }>,
542
- ): Array<{ role: ChatRole; content: string }> {
559
+ ): Array<{ role: ChatRole; content: LLMMessageContent }> {
543
560
  const preamble =
544
561
  userSystemPrompt.trim() ||
545
562
  buildDefaultPreamble({
@@ -550,26 +567,120 @@ function buildFinalMessages(
550
567
  const header = successfulKbCount > 1
551
568
  ? `检索结果(共 ${chunks.length} 条,来自 ${successfulKbCount} 个知识库):`
552
569
  : `检索结果(共 ${chunks.length} 条):`;
570
+
571
+ // Strip any `system` messages the client sent — we own the system turn.
572
+ const nonSystem = history.filter((m) => m.role !== "system");
573
+ const clipped =
574
+ nonSystem.length > MAX_HISTORY_MESSAGES
575
+ ? nonSystem.slice(-MAX_HISTORY_MESSAGES)
576
+ : nonSystem;
577
+
578
+ // Collect image parts with numbered labels to preserve chunk order.
579
+ //
580
+ // ChunkType 服务端契约共 4 种:text | table | formula | image。
581
+ // 这 4 种里只有 image 需要走 `image_url` 部分注入到 user message;其他全部
582
+ // 作为文本,由下面的 `contextBlock` 直接以 chunk.content 形式拼进 system
583
+ // message。这里大小写不敏感地匹配 IMAGE,使后端 chunkType 字段大小写漂移
584
+ // 不会破坏多模态注入。
585
+ const imageParts: ContentPart[] = [];
586
+ chunks.forEach((c, i) => {
587
+ if (isImageChunk(c) && c.imageBase64) {
588
+ // Add numbered label so the model can correlate with system message [N].
589
+ // 编号 `i + 1` 与下方 contextBlock 中的 `[N]` 保持同源,确保模型能把
590
+ // 「检索图片 2」对应到 system 提示里的 `[2]` 引用。
591
+ imageParts.push({
592
+ type: "text",
593
+ text: `[检索图片 ${i + 1}]:`,
594
+ });
595
+ imageParts.push({
596
+ type: "image_url",
597
+ image_url: { url: c.imageBase64 },
598
+ });
599
+ }
600
+ });
601
+
602
+ // System message is always a plain string (works with all providers).
603
+ // Chunks 在 system 中按检索返回顺序展开,并保持与 imageParts 同一编号系统。
553
604
  const contextBlock = chunks.length
554
605
  ? `\n\n${header}\n${chunks
555
606
  .map((c, i) => {
556
607
  const src = c.knowledgeBaseName ? ` (${c.knowledgeBaseName})` : "";
557
- return `[${i + 1}]${src} ${truncate(c.content, 1200)}`;
608
+ // 仅在 IMAGE 且没有 caption/content 时用 "(图片)" 占位;其余 chunk
609
+ // 类型(text / table / formula)一律直接展开 content。
610
+ const body = truncate(
611
+ c.content || (isImageChunk(c) ? "(图片)" : ""),
612
+ MAX_CHUNK_DISPLAY_LENGTH,
613
+ );
614
+ return `[${i + 1}]${src} ${body}`;
558
615
  })
559
616
  .join("\n\n")}`
560
617
  : "";
561
618
 
562
- // Strip any `system` messages the client sent — we own the system turn.
563
- const nonSystem = history.filter((m) => m.role !== "system");
564
- const clipped =
565
- nonSystem.length > MAX_HISTORY_MESSAGES
566
- ? nonSystem.slice(-MAX_HISTORY_MESSAGES)
567
- : nonSystem;
619
+ const systemMessage = {
620
+ role: "system" as const,
621
+ content: preamble + contextBlock + memoryBlock,
622
+ };
623
+
624
+ // If no images, return plain text messages (backward compatible)
625
+ if (imageParts.length === 0) {
626
+ return [systemMessage, ...clipped];
627
+ }
568
628
 
569
- return [
570
- { role: "system", content: preamble + contextBlock + memoryBlock },
571
- ...clipped,
629
+ // Enrich the last user message with image parts
630
+ const messages: Array<{ role: ChatRole; content: LLMMessageContent }> = [
631
+ systemMessage,
572
632
  ];
633
+
634
+ const imageFallbackMessage = {
635
+ role: "user" as const,
636
+ content: [
637
+ ...imageParts,
638
+ { type: "text" as const, text: "请根据以上图片回答。" },
639
+ ],
640
+ };
641
+
642
+ if (clipped.length > 0) {
643
+ const lastIndex = clipped.length - 1;
644
+ const lastMessage = clipped[lastIndex];
645
+
646
+ if (lastMessage.role === "user") {
647
+ // Replace last user message with multimodal version
648
+ messages.push(
649
+ ...clipped.slice(0, lastIndex),
650
+ {
651
+ role: "user",
652
+ content: [
653
+ ...imageParts,
654
+ { type: "text", text: lastMessage.content },
655
+ ],
656
+ }
657
+ );
658
+ } else {
659
+ // Last message isn't a plain-text user message (e.g. assistant) — append
660
+ // a synthetic user turn carrying the images. This path is rare in
661
+ // production (clients normally end on a user turn) but can happen if the
662
+ // upstream injected a trailing assistant message or replayed history.
663
+ // Log a warning so we can spot it in observability rather than silently
664
+ // produce a "user said: 请根据以上图片回答。" turn the user never typed.
665
+ chatLogger.warn({
666
+ event: "api.chat.multimodal_fallback_user_turn",
667
+ message:
668
+ "last history message is not a user turn; appending synthetic " +
669
+ "user message to carry retrieved images",
670
+ details: {
671
+ lastRole: lastMessage.role,
672
+ imageCount: imageParts.length / 2,
673
+ historyLength: clipped.length,
674
+ },
675
+ });
676
+ messages.push(...clipped, imageFallbackMessage);
677
+ }
678
+ } else {
679
+ // No history — create a user message with images
680
+ messages.push(imageFallbackMessage);
681
+ }
682
+
683
+ return messages;
573
684
  }
574
685
 
575
686
  function truncate(text: string, max: number): string {
@@ -1,6 +1,25 @@
1
1
  @import "tailwindcss";
2
2
  @import "katex/dist/katex.min.css";
3
3
 
4
+ /*
5
+ * Bridge the legacy Tailwind v3 style config (tailwind.config.ts) into
6
+ * Tailwind v4. Without @config, the JS config file is silently ignored,
7
+ * which means:
8
+ * 1. Theme tokens (success/warning/danger/info/purple) are never
9
+ * registered, so utilities like `bg-success-soft` don't exist.
10
+ * 2. `darkMode: ["class", ".dark"]` is not applied, so `dark:` falls
11
+ * back to `prefers-color-scheme`, which fights with next-themes'
12
+ * class-based toggle and bleeds dark styles into light mode.
13
+ */
14
+ @config "../../tailwind.config.ts";
15
+
16
+ /*
17
+ * Belt-and-suspenders: ensure `dark:` always resolves through the
18
+ * `.dark` class that next-themes toggles on <html>, regardless of OS
19
+ * preference. This must agree with the darkMode setting above.
20
+ */
21
+ @custom-variant dark (&:where(.dark, .dark *));
22
+
4
23
  @layer base {
5
24
  :root {
6
25
  /* Brand primary: webUI blue (hue 221, #2563eb) */
@@ -77,6 +96,8 @@
77
96
  --warning-soft: 48 100% 96%;
78
97
  --danger: 0 84% 60%;
79
98
  --danger-soft: 0 86% 97%;
99
+ --info: 217 91% 60%;
100
+ --info-soft: 214 100% 97%;
80
101
  --purple: 262 84% 58%;
81
102
  --purple-soft: 258 100% 97%;
82
103
 
@@ -174,6 +195,8 @@
174
195
  --warning-soft: 38 30% 18%;
175
196
  --danger: 0 84% 65%;
176
197
  --danger-soft: 0 30% 20%;
198
+ --info: 217 91% 70%;
199
+ --info-soft: 217 30% 18%;
177
200
  --purple: 262 84% 65%;
178
201
  --purple-soft: 262 30% 22%;
179
202
  }
@@ -98,6 +98,7 @@ type Action =
98
98
  | { type: "SET_RETRIEVAL"; value: ChatRetrievalConfig }
99
99
  | { type: "ADD_MOUNT"; mount: MountItem }
100
100
  | { type: "UPDATE_MOUNT"; id: string; patch: Partial<MountItem> }
101
+ | { type: "RESET_MOUNT_RETRIEVAL"; id: string }
101
102
  | { type: "REMOVE_MOUNT"; id: string }
102
103
  | { type: "REORDER_MOUNTS"; ids: string[] }
103
104
  | { type: "SET_MEMORY"; binding: Omit<ChatMemoryBinding, "id"> | undefined }
@@ -136,6 +137,21 @@ export function reducer(state: ChatConfigState, action: Action): ChatConfigState
136
137
  m.id === action.id ? { ...m, ...action.patch } : m,
137
138
  ),
138
139
  };
140
+ // 清除单 KB 的自定义检索参数:透过 partial spread 调用者不能以 undefined
141
+ // 重置字段({ retrieval: undefined } 仍会使原始键存在),这里重建 mount
142
+ // 折叠对象,确保字段从存在变为不存在,让后续 `??` fallback 生效。
143
+ case "RESET_MOUNT_RETRIEVAL":
144
+ return {
145
+ ...state,
146
+ mounts: state.mounts.map((m) => {
147
+ if (m.id !== action.id) return m;
148
+ // 按需保留 id / knowledgeBaseName / subspace;丢弃 retrieval / topK。
149
+ const { retrieval: _retrieval, topK: _topK, ...rest } = m;
150
+ void _retrieval;
151
+ void _topK;
152
+ return rest;
153
+ }),
154
+ };
139
155
  case "REMOVE_MOUNT":
140
156
  return { ...state, mounts: state.mounts.filter((m) => m.id !== action.id) };
141
157
  case "REORDER_MOUNTS": {
@@ -189,6 +205,8 @@ export interface ChatConfigContextValue extends ChatConfigState {
189
205
  setRetrieval(value: ChatRetrievalConfig): void;
190
206
  addMount(mount: MountItem): void;
191
207
  updateMount(id: string, patch: Partial<MountItem>): void;
208
+ /** Drop the per-KB retrieval/topK overrides for `id` so it inherits global defaults. */
209
+ resetMountRetrieval(id: string): void;
192
210
  removeMount(id: string): void;
193
211
  reorderMounts(ids: string[]): void;
194
212
  setMemory(binding: Omit<ChatMemoryBinding, "id"> | undefined): void;
@@ -217,6 +235,8 @@ export function ChatConfigProvider({ children }: { children: ReactNode }) {
217
235
  setRetrieval: (v) => dispatch({ type: "SET_RETRIEVAL", value: v }),
218
236
  addMount: (m) => dispatch({ type: "ADD_MOUNT", mount: m }),
219
237
  updateMount: (id, patch) => dispatch({ type: "UPDATE_MOUNT", id, patch }),
238
+ resetMountRetrieval: (id) =>
239
+ dispatch({ type: "RESET_MOUNT_RETRIEVAL", id }),
220
240
  removeMount: (id) => dispatch({ type: "REMOVE_MOUNT", id }),
221
241
  reorderMounts: (ids) => dispatch({ type: "REORDER_MOUNTS", ids }),
222
242
  setMemory: (b) => dispatch({ type: "SET_MEMORY", binding: b }),
@@ -256,27 +276,29 @@ export function useChatConfig(): ChatConfigContextValue {
256
276
  * return undefined when no KB is mounted. Kept as a plain helper so it can
257
277
  * run outside React rendering (e.g. in onClick handlers).
258
278
  *
259
- * The same `retrievalConfiguration` (searchType / rerank strategy / weights)
260
- * is applied to every mounted KB: cross-KB score comparability only holds
261
- * when each KB is scored under identical rules. `topK` is likewise uniform
262
- * per KB, and the caller (chat route) applies a global aggregate cap after
263
- * merging by score.
279
+ * 每个 mount 优先使用自己的 `retrieval` / `topK` override;未设置时 fallback
280
+ * 到会话级的 `state.retrieval` / `state.perKbTopK`。上层在 chat route 合并后
281
+ * 仍由 `state.aggregateTopK` 统一截断,跨 KB 的打分可比性责任交给服务端。
264
282
  */
265
283
  export function buildRagFromMounts(state: ChatConfigState) {
266
284
  if (!state.mounts.length) return undefined;
267
- const retrievalConfiguration = assembleRetrievalConfiguration(
268
- state.retrieval,
269
- state.perKbTopK,
270
- );
271
285
  return {
272
- knowledgeBases: state.mounts.map((m) => ({
273
- knowledgeBaseName: m.knowledgeBaseName,
274
- ...(m.subspace?.length ? { subspace: m.subspace } : {}),
275
- ...(retrievalConfiguration
276
- ? { retrievalConfiguration: retrievalConfiguration as Record<string, unknown> }
277
- : {}),
278
- topK: state.perKbTopK,
279
- })),
286
+ knowledgeBases: state.mounts.map((m) => {
287
+ const effectiveRetrieval = m.retrieval ?? state.retrieval;
288
+ const effectiveTopK = m.topK ?? state.perKbTopK;
289
+ const retrievalConfiguration = assembleRetrievalConfiguration(
290
+ effectiveRetrieval,
291
+ effectiveTopK,
292
+ );
293
+ return {
294
+ knowledgeBaseName: m.knowledgeBaseName,
295
+ ...(m.subspace?.length ? { subspace: m.subspace } : {}),
296
+ ...(retrievalConfiguration
297
+ ? { retrievalConfiguration: retrievalConfiguration as Record<string, unknown> }
298
+ : {}),
299
+ topK: effectiveTopK,
300
+ };
301
+ }),
280
302
  topK: state.aggregateTopK,
281
303
  };
282
304
  }
@@ -187,6 +187,7 @@ export function ChatMountConfig({ open, onOpenChange, onSave }: ChatMountConfigP
187
187
  key={mount.id}
188
188
  mount={mount}
189
189
  subspaceEnabled={kb?.subspace === true}
190
+ knowledgeBase={kb}
190
191
  />
191
192
  );
192
193
  })}
@@ -45,8 +45,8 @@ export function MemoryBindSection() {
45
45
  <Label className="text-sm font-medium">绑定的记忆库</Label>
46
46
  <p className="mt-0.5 text-xs text-muted-foreground">
47
47
  {binding
48
- ? `每轮检索 Top-${binding.topK ?? 5},对话后写回当前 scope`
49
- : "绑定后服务端在每轮对话前检索、对话后写回;同一 app+tenant 下记忆跨 agent 可共享"}
48
+ ? `每轮检索 Top-${binding.topK ?? 5},对话后写回当前范围`
49
+ : "绑定后服务端在每轮对话前检索、对话后写回;同一应用 + 租户下记忆跨智能体可共享"}
50
50
  </p>
51
51
  </div>
52
52
  {binding && (
@@ -146,7 +146,7 @@ function MemoryBindEmptyState(props: {
146
146
  <p className="mx-auto mt-1 max-w-[320px] text-xs leading-relaxed text-[hsl(var(--muted-foreground))]">
147
147
  {hasNoStores
148
148
  ? "创建第一个记忆库后,即可在对话中绑定并自动写回 / 检索"
149
- : "绑定后服务端会在每轮对话前检索相关记忆注入到 system prompt,对话结束后自动写回到当前 scope"}
149
+ : "绑定后服务端会在每轮对话前检索相关记忆注入到 system prompt,对话结束后自动写回到当前范围"}
150
150
  </p>
151
151
 
152
152
  <div className="mt-4 flex flex-col items-center gap-2">
@@ -247,27 +247,27 @@ function MemoryBindingForm(props: {
247
247
  <div className="space-y-2.5">
248
248
  <div>
249
249
  <Label className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
250
- 写 Scope
250
+ 写入范围
251
251
  </Label>
252
252
  <p className="mt-1 text-[11px] leading-relaxed text-muted-foreground">
253
- 服务端在检索时把 agentId / runId 派生为通配 <code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">*</code>,
254
- 因此同一 app + tenant 下不同 agent / 不同会话可以读取彼此的记忆
253
+ 服务端在检索时把「智能体 / 会话」派生为通配 <code className="rounded bg-muted px-1 py-0.5 font-mono text-[10px]">*</code>,
254
+ 因此同一应用 + 租户下不同智能体 / 不同会话可以读取彼此的记忆
255
255
  </p>
256
256
  </div>
257
257
  <div className="grid grid-cols-2 gap-3">
258
258
  <ScopeField
259
- label="appId *"
259
+ label="应用 *"
260
260
  value={props.appId}
261
261
  onChange={(v) => props.onScopeChange({ appId: v })}
262
262
  />
263
263
  <ScopeField
264
- label="tenantId *"
264
+ label="租户 *"
265
265
  value={props.tenantId}
266
266
  onChange={(v) => props.onScopeChange({ tenantId: v })}
267
267
  />
268
268
  <div className="col-span-2">
269
269
  <ScopeField
270
- label="agentId *"
270
+ label="智能体 *"
271
271
  value={props.agentId}
272
272
  onChange={(v) => props.onScopeChange({ agentId: v })}
273
273
  />
@@ -279,7 +279,7 @@ function MemoryBindingForm(props: {
279
279
  <div className="space-y-0.5">
280
280
  <Label className="text-sm">对话后自动写入记忆</Label>
281
281
  <p className="text-xs text-muted-foreground">
282
- autoSave:把本轮 user / assistant 消息归档到当前 scope
282
+ 自动归档:把本轮用户 / 助手消息写入当前范围
283
283
  </p>
284
284
  </div>
285
285
  <Switch
@@ -327,7 +327,7 @@ function RunIdField({ runId }: { runId: string }) {
327
327
  try {
328
328
  await navigator.clipboard.writeText(runId);
329
329
  setCopied(true);
330
- toast.success("已复制 runId");
330
+ toast.success("已复制会话 ID");
331
331
  setTimeout(() => setCopied(false), 1500);
332
332
  } catch {
333
333
  toast.error("复制失败,请手动选择文本");
@@ -338,13 +338,13 @@ function RunIdField({ runId }: { runId: string }) {
338
338
  <div className="space-y-1.5">
339
339
  <div className="flex items-center justify-between">
340
340
  <Label className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
341
- run-id
341
+ 会话 ID
342
342
  </Label>
343
343
  <span
344
344
  className="text-[10px] text-muted-foreground"
345
- title="runId 由当前会话自动生成并在整个会话内复用,用于串联同一对话的记忆"
345
+ title="会话 ID 由当前对话自动生成并在整个对话内复用,用于串联同一会话的记忆"
346
346
  >
347
- 会话自动生成 · 自动复用
347
+ 自动生成 · 自动复用
348
348
  </span>
349
349
  </div>
350
350
  <div className="flex items-center gap-2">
@@ -356,7 +356,7 @@ function RunIdField({ runId }: { runId: string }) {
356
356
  variant="ghost"
357
357
  size="icon"
358
358
  className="h-8 w-8 shrink-0"
359
- aria-label="复制 runId"
359
+ aria-label="复制会话 ID"
360
360
  disabled={!runId}
361
361
  onClick={handleCopy}
362
362
  >