@tablestore/tablestore-agent-cli 0.1.9 → 0.2.1

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 (459) hide show
  1. package/dist/commands/kb/create.d.ts.map +1 -1
  2. package/dist/commands/kb/create.js +21 -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 +3 -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/app-path-routes-manifest.json +1 -0
  9. package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +5 -5
  10. package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
  11. package/dist/dashboard-runtime/dashboard/.next/routes-manifest.json +6 -0
  12. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page/build-manifest.json +2 -2
  13. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js +1 -1
  14. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  15. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  16. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page/build-manifest.json +2 -2
  17. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js +1 -1
  18. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
  19. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
  20. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page/build-manifest.json +2 -2
  21. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js +1 -1
  22. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
  23. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
  24. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page/build-manifest.json +2 -2
  25. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js +1 -1
  26. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
  27. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
  28. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page/build-manifest.json +2 -2
  29. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js +1 -1
  30. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
  31. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
  32. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page/build-manifest.json +2 -2
  33. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js +1 -1
  34. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
  35. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
  36. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page/build-manifest.json +2 -2
  37. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js +1 -1
  38. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
  39. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
  40. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page/build-manifest.json +2 -2
  41. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js +1 -1
  42. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
  43. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
  44. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page/build-manifest.json +2 -2
  45. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js +1 -1
  46. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
  47. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
  48. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page/build-manifest.json +2 -2
  49. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js +2 -2
  50. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
  51. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
  52. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page/build-manifest.json +2 -2
  53. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js +1 -1
  54. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  55. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  56. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page/build-manifest.json +2 -2
  57. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js +1 -1
  58. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
  59. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
  60. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page/build-manifest.json +2 -2
  61. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js +1 -1
  62. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
  63. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
  64. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page/build-manifest.json +2 -2
  65. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page/react-loadable-manifest.json +1 -1
  66. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js +1 -1
  67. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
  68. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
  69. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page/build-manifest.json +2 -2
  70. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js +1 -1
  71. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
  72. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
  73. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page/build-manifest.json +2 -2
  74. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js +1 -1
  75. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page/build-manifest.json +2 -2
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js +1 -1
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page/build-manifest.json +2 -2
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js +1 -1
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page/build-manifest.json +2 -2
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js +1 -1
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page/build-manifest.json +2 -2
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js +1 -1
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error/page/build-manifest.json +2 -2
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page/build-manifest.json +2 -2
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +14 -14
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  112. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  113. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  114. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  115. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  116. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  117. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  118. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  119. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  120. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  121. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  122. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  123. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  124. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  125. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  126. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  127. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  128. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  129. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  130. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
  131. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
  132. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
  133. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
  134. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
  135. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
  136. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
  137. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
  138. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route/app-paths-manifest.json +3 -0
  139. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route/build-manifest.json +9 -0
  140. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route/server-reference-manifest.json +4 -0
  141. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js +6 -0
  142. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.map +5 -0
  143. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -0
  144. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route_client-reference-manifest.js +3 -0
  145. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
  146. package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
  147. package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +14 -14
  148. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  149. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +14 -14
  150. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +3 -3
  151. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +10 -10
  152. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  153. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page/build-manifest.json +2 -2
  154. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js.nft.json +1 -1
  155. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  156. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
  157. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +17 -17
  158. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +17 -17
  159. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +3 -3
  160. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +10 -10
  161. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  162. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  163. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +4 -4
  164. package/dist/dashboard-runtime/dashboard/.next/server/app/page/build-manifest.json +2 -2
  165. package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  166. package/dist/dashboard-runtime/dashboard/.next/server/app-paths-manifest.json +1 -0
  167. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +1 -1
  168. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cee_lo._.js +1 -1
  169. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0lvi0g-._.js +2 -2
  170. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q8vcw8._.js +3 -0
  171. package/dist/dashboard-runtime/dashboard/.next/server/chunks/dashboard__next-internal_server_app_api_v1_oss_list_route_actions_00xq2u..js +3 -0
  172. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +2 -2
  173. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95_src_app_(dashboard)_knowledge-base_[name]_settings_settings-client_tsx_13312zk._.js +1 -1
  174. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0aqzu8w._.js +1 -1
  175. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0hozzu6._.js +3 -0
  176. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0jb9ccl._.js +1 -1
  177. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0jhpb-b._.js +3 -0
  178. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__13ylf4x._.js +3 -0
  179. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01-2v37._.js +3 -0
  180. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_02bg849._.js +3 -0
  181. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_04f2u4t._.js +1 -1
  182. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_09yzbcp._.js +1 -1
  183. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0db498n._.js +3 -0
  184. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ddbh97._.js +1 -1
  185. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f4u0.1._.js +3 -0
  186. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fj8l5g._.js +3 -0
  187. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0hnw-ok._.js +3 -0
  188. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j-q~ro._.js +3 -0
  189. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jghj2_._.js +3 -0
  190. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0kd7szs._.js +3 -0
  191. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0l~-9i0._.js +3 -0
  192. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0mtqe24._.js +3 -0
  193. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0n4gd_6._.js +3 -0
  194. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0o665bf._.js +1 -1
  195. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ogxvev._.js +7 -0
  196. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0q748rf._.js +1 -1
  197. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tr8-3u._.js +3 -0
  198. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0u4elhp._.js +3 -0
  199. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0vtm7dh._.js +3 -0
  200. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xdioxg._.js +3 -0
  201. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xzh5yw._.js +3 -0
  202. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12r9c8h._.js +3 -0
  203. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12~3vfk._.js +3 -0
  204. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13_lb.o._.js +3 -0
  205. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00ofp7q._.js +3 -0
  206. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_065m1.j._.js +1 -1
  207. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0ejgygh._.js +1 -1
  208. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0o9jhcn._.js +9 -0
  209. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0xf3ffa._.js +3 -0
  210. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
  211. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
  212. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_create_page_tsx_0916~g-._.js +1 -1
  213. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_error_tsx_01x7ppm._.js +1 -1
  214. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ls1exu._.js +3 -0
  215. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_0ugdjlb._.js +3 -0
  216. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_shared_relative-time_tsx_0b7s9rc._.js +1 -1
  217. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_0-tuf-h._.js +3 -0
  218. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_dropdown-menu_tsx_0c~d-fd._.js +1 -1
  219. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_select_tsx_0ys.i47._.js +1 -1
  220. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_08h.f_8._.js +3 -0
  221. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0jns_ph._.js +3 -0
  222. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0pf30rh._.js +3 -0
  223. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0~k~1nt._.js +3 -0
  224. package/dist/dashboard-runtime/dashboard/.next/server/functions-config-manifest.json +1 -0
  225. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +5 -5
  226. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  227. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  228. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  229. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  230. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-2yqm.ft6yzy.js +1 -0
  231. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.2e8ciiogw04.js +1 -0
  232. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00tz~p479bdgl.js +1 -0
  233. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02i9olo-312mq.js +138 -0
  234. package/dist/dashboard-runtime/dashboard/.next/static/chunks/062k9jbtd9.lv.js +1 -0
  235. package/dist/dashboard-runtime/dashboard/.next/static/chunks/069zf4m5f.se2.js +1 -0
  236. package/dist/dashboard-runtime/dashboard/.next/static/chunks/06uuhz24tvdt..js +1 -0
  237. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07cp19da_kfld.js +5 -0
  238. package/dist/dashboard-runtime/dashboard/.next/static/chunks/086esp1n941jl.js +138 -0
  239. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08e9vvmr~0bqr.js +1 -0
  240. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08i99xsvs8o5s.js +1 -0
  241. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08qlxn-3d_rtu.js +1 -0
  242. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09uxq~55qug8c.js +1 -0
  243. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0__g1ogrdh412.js +1 -0
  244. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ab-ev0u1~ch5.js +1 -0
  245. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{154aheeo3m6bg.js → 0bpginsuceywq.js} +1 -1
  246. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0bw682qzkh2ni.js +1 -0
  247. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0cto67_iw~p9z.js +1 -0
  248. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0d29.l~3ip181.js +1 -0
  249. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ewpzgu_qf0wf.js +4 -0
  250. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0h77.bqx5ltem.js +1 -0
  251. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ix_suxk3spjj.js +1 -0
  252. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jc31diex030o.js +1 -0
  253. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k79upjc40aky.css +1 -0
  254. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0lp2g_27uyhuz.js +1 -0
  255. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0lrw.bnws62y9.js +1 -0
  256. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0mea2ylxe.umh.js +1 -0
  257. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0dqag6qsw7xv8.js → 0px2r0l_3kp2t.js} +1 -1
  258. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0snnsfosp3~gq.js +1 -0
  259. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0t0yqi68~eil6.js +1 -0
  260. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0td9nhfbpbmyt.js +1 -0
  261. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0tmwptel_4y0o.js +1 -0
  262. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6_s-0w8.yr..js +1 -0
  263. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u9wtl06_b72x.js +1 -0
  264. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0uv55p7kzteex.js +1 -0
  265. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v9d5wl9nsva3.js +1 -0
  266. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0xko7~ja3xuc-.js +1 -0
  267. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{05_578ka0ga8d.js → 12pz6ag1s~te_.js} +1 -1
  268. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14.dp0-y_mhjo.js +1 -0
  269. package/dist/dashboard-runtime/dashboard/.next/static/chunks/15bzqpm440jvz.js +1 -0
  270. package/dist/dashboard-runtime/dashboard/.next/static/chunks/15wxh8ltqt88_.js +1 -0
  271. package/dist/dashboard-runtime/dashboard/.next/static/chunks/183~u3-4a74db.js +1 -0
  272. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{turbopack-0ybyy.9-.w~ub.js → turbopack-0w.hw6u8qra5z.js} +1 -1
  273. package/dist/dashboard-runtime/dashboard/package.json +1 -0
  274. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/page.tsx +39 -38
  275. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/error.tsx +1 -1
  276. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/documents/documents-client.tsx +0 -1
  277. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/layout-client.tsx +191 -40
  278. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/qa/page.tsx +18 -19
  279. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/retrieval/retrieval-client.tsx +8 -7
  280. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/settings/settings-client.tsx +1 -1
  281. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/layout.tsx +3 -10
  282. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/layout.tsx +128 -22
  283. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +15 -8
  284. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/page.tsx +1 -1
  285. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/route.ts +44 -3
  286. package/dist/dashboard-runtime/dashboard/src/app/api/v1/oss/list/route.ts +125 -0
  287. package/dist/dashboard-runtime/dashboard/src/app/error.tsx +1 -1
  288. package/dist/dashboard-runtime/dashboard/src/app/globals.css +137 -102
  289. package/dist/dashboard-runtime/dashboard/src/app/not-found.tsx +1 -1
  290. package/dist/dashboard-runtime/dashboard/src/app/onboarding/page.tsx +2 -2
  291. package/dist/dashboard-runtime/dashboard/src/components/chat/add-mount-row.tsx +21 -46
  292. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-mount-config.tsx +35 -27
  293. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-empty-state.tsx +87 -0
  294. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-picker.tsx +87 -0
  295. package/dist/dashboard-runtime/dashboard/src/components/chat/unified-retrieval-section.tsx +3 -2
  296. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-chunks-dialog.tsx +49 -25
  297. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-columns.tsx +57 -46
  298. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-table.tsx +2 -4
  299. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-toolbar.tsx +1 -1
  300. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-upload-dialog.tsx +155 -54
  301. package/dist/dashboard-runtime/dashboard/src/components/documents/oss-browser.tsx +264 -0
  302. package/dist/dashboard-runtime/dashboard/src/components/documents/oss-import-tab.tsx +143 -0
  303. package/dist/dashboard-runtime/dashboard/src/components/instance/connect-instance-form.tsx +60 -60
  304. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-create-form.tsx +52 -35
  305. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-settings-form.tsx +152 -76
  306. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/knowledge-base-retrieval-config.ts +110 -0
  307. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/retrieval-result-count-field.tsx +106 -0
  308. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/retrieval-result-count.ts +11 -0
  309. package/dist/dashboard-runtime/dashboard/src/components/layout/detail-sidebar.tsx +411 -0
  310. package/dist/dashboard-runtime/dashboard/src/components/layout/help-link.tsx +58 -0
  311. package/dist/dashboard-runtime/dashboard/src/components/layout/page-header.tsx +130 -11
  312. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-instance-card.tsx +203 -0
  313. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-item.tsx +14 -11
  314. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-mobile.tsx +37 -29
  315. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-usage-stats.tsx +26 -0
  316. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar.tsx +94 -46
  317. package/dist/dashboard-runtime/dashboard/src/components/layout/theme-toggle.tsx +161 -41
  318. package/dist/dashboard-runtime/dashboard/src/components/memory/requests-histogram-chart.tsx +2 -2
  319. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-chat-panel.tsx +1 -1
  320. package/dist/dashboard-runtime/dashboard/src/components/retrieval/assemble-retrieval-configuration.ts +22 -3
  321. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-form.tsx +110 -20
  322. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-params-fields.tsx +114 -56
  323. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-rerank-fields.tsx +60 -23
  324. package/dist/dashboard-runtime/dashboard/src/components/shared/empty-state.tsx +1 -1
  325. package/dist/dashboard-runtime/dashboard/src/components/shared/error-state.tsx +1 -1
  326. package/dist/dashboard-runtime/dashboard/src/components/shared/llm-model-selector.tsx +160 -70
  327. package/dist/dashboard-runtime/dashboard/src/components/shared/relative-time.tsx +30 -6
  328. package/dist/dashboard-runtime/dashboard/src/components/ui/badge.tsx +16 -5
  329. package/dist/dashboard-runtime/dashboard/src/components/ui/button.tsx +9 -8
  330. package/dist/dashboard-runtime/dashboard/src/components/ui/card.tsx +14 -8
  331. package/dist/dashboard-runtime/dashboard/src/components/ui/chat-bubble.tsx +60 -0
  332. package/dist/dashboard-runtime/dashboard/src/components/ui/command.tsx +1 -1
  333. package/dist/dashboard-runtime/dashboard/src/components/ui/data-card.tsx +57 -0
  334. package/dist/dashboard-runtime/dashboard/src/components/ui/detail-section.tsx +40 -0
  335. package/dist/dashboard-runtime/dashboard/src/components/ui/dialog.tsx +7 -7
  336. package/dist/dashboard-runtime/dashboard/src/components/ui/dropdown-menu.tsx +6 -6
  337. package/dist/dashboard-runtime/dashboard/src/components/ui/empty-state.tsx +42 -0
  338. package/dist/dashboard-runtime/dashboard/src/components/ui/filter-pill.tsx +90 -0
  339. package/dist/dashboard-runtime/dashboard/src/components/ui/form.tsx +3 -3
  340. package/dist/dashboard-runtime/dashboard/src/components/ui/input.tsx +5 -1
  341. package/dist/dashboard-runtime/dashboard/src/components/ui/item-card.tsx +88 -0
  342. package/dist/dashboard-runtime/dashboard/src/components/ui/label.tsx +1 -1
  343. package/dist/dashboard-runtime/dashboard/src/components/ui/memory-row.tsx +63 -0
  344. package/dist/dashboard-runtime/dashboard/src/components/ui/mini-stat.tsx +48 -0
  345. package/dist/dashboard-runtime/dashboard/src/components/ui/nav-tab-bar.tsx +60 -0
  346. package/dist/dashboard-runtime/dashboard/src/components/ui/playground-shell.tsx +69 -0
  347. package/dist/dashboard-runtime/dashboard/src/components/ui/popover.tsx +1 -1
  348. package/dist/dashboard-runtime/dashboard/src/components/ui/result-row.tsx +37 -0
  349. package/dist/dashboard-runtime/dashboard/src/components/ui/scope-tag.tsx +30 -0
  350. package/dist/dashboard-runtime/dashboard/src/components/ui/select.tsx +6 -5
  351. package/dist/dashboard-runtime/dashboard/src/components/ui/sheet.tsx +4 -4
  352. package/dist/dashboard-runtime/dashboard/src/components/ui/sonner.tsx +1 -1
  353. package/dist/dashboard-runtime/dashboard/src/components/ui/stat-card.tsx +58 -0
  354. package/dist/dashboard-runtime/dashboard/src/components/ui/table.tsx +13 -6
  355. package/dist/dashboard-runtime/dashboard/src/components/ui/textarea.tsx +4 -1
  356. package/dist/dashboard-runtime/dashboard/src/components/ui/tooltip.tsx +1 -1
  357. package/dist/dashboard-runtime/dashboard/src/components/ui/usage-card.tsx +43 -0
  358. package/dist/dashboard-runtime/dashboard/src/config/navigation.ts +50 -9
  359. package/dist/dashboard-runtime/dashboard/src/hooks/use-detail-sidebar-collapsed.ts +86 -0
  360. package/dist/dashboard-runtime/dashboard/src/hooks/use-oss-import.ts +148 -0
  361. package/dist/dashboard-runtime/dashboard/src/hooks/use-oss-list.ts +89 -0
  362. package/dist/dashboard-runtime/dashboard/src/lib/extension-filter.ts +62 -0
  363. package/dist/dashboard-runtime/dashboard/src/lib/glob-filter.ts +76 -0
  364. package/dist/dashboard-runtime/dashboard/src/lib/oss-selection.ts +58 -0
  365. package/dist/dashboard-runtime/dashboard/src/lib/server/oss-client.ts +65 -0
  366. package/dist/dashboard-runtime/dashboard/src/schemas/knowledge-base.ts +3 -3
  367. package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +1 -1
  368. package/dist/dashboard-runtime/dashboard/src/schemas/retrieval.ts +4 -1
  369. package/dist/dashboard-runtime/dashboard/src/services/api-client.ts +11 -6
  370. package/dist/dashboard-runtime/dashboard/src/services/documents.ts +27 -8
  371. package/dist/dashboard-runtime/dashboard/src/services/oss.ts +36 -0
  372. package/dist/dashboard-runtime/dashboard/src/types/knowledge-base.ts +1 -1
  373. package/dist/dashboard-runtime/dashboard/tailwind.config.ts +47 -12
  374. package/dist/dashboard-runtime/dashboard/vitest.config.mjs +6 -0
  375. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  376. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  377. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +1 -1
  378. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  379. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  380. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  381. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +1 -1
  382. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  383. package/package.json +1 -1
  384. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0lvo_@radix-ui_react-popper_dist_index_mjs_13rqw99._.js +0 -3
  385. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0-kiaf5._.js +0 -3
  386. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0_r24-c._.js +0 -3
  387. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__11yei-s._.js +0 -3
  388. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0303qx7._.js +0 -3
  389. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06l.12l._.js +0 -3
  390. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_09eom0_._.js +0 -3
  391. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0cd.__9._.js +0 -7
  392. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0dqi8bq._.js +0 -3
  393. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0e9y.xc._.js +0 -3
  394. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f9u8i2._.js +0 -3
  395. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fbjpet._.js +0 -3
  396. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0i8py_a._.js +0 -3
  397. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jlt.cx._.js +0 -3
  398. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0n5uozy._.js +0 -3
  399. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0o32d.y._.js +0 -3
  400. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0suxzcc._.js +0 -3
  401. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tyxwr3._.js +0 -3
  402. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0u9md36._.js +0 -3
  403. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0v4jb2q._.js +0 -3
  404. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0vzw0pw._.js +0 -3
  405. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0z0rlpq._.js +0 -3
  406. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0zn.ayc._.js +0 -3
  407. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13l7w34._.js +0 -3
  408. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0o4a.29._.js +0 -3
  409. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0suis9l._.js +0 -9
  410. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10mc58z._.js +0 -3
  411. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_[name]_layout-client_tsx_05momc5._.js +0 -3
  412. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_retrieval_02c2uck._.js +0 -3
  413. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0aw_rgu._.js +0 -3
  414. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0qdd37m._.js +0 -3
  415. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_11mc1z9._.js +0 -3
  416. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-etecbti5x22.js +0 -1
  417. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-xqk6wfme5fu.js +0 -1
  418. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.yj.t1hbwkg4.js +0 -1
  419. package/dist/dashboard-runtime/dashboard/.next/static/chunks/031-scv-8sah9.js +0 -1
  420. package/dist/dashboard-runtime/dashboard/.next/static/chunks/034uozc1ki09_.js +0 -1
  421. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05hmbxh7h5ct-.js +0 -1
  422. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05ow1qzcjz3pz.js +0 -1
  423. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07iqor2nl~iqc.js +0 -1
  424. package/dist/dashboard-runtime/dashboard/.next/static/chunks/087x52iesmpfe.js +0 -1
  425. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08an3157he_ad.js +0 -1
  426. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0aak.679si-3m.js +0 -1
  427. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ai8f~-9ig.gz.js +0 -138
  428. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0c5tcbhzpwen7.js +0 -1
  429. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dheju1t18upn.js +0 -1
  430. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ffr1_o~ss8r8.js +0 -1
  431. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0h38qfpz-dmiu.js +0 -1
  432. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0hkir82jccgck.js +0 -1
  433. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0l1fmyhvp-k49.js +0 -1
  434. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pcp6pjjz7o49.js +0 -1
  435. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pdq-gljpy7gd.js +0 -1
  436. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0q6-s11w9.sgo.js +0 -1
  437. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rnm58mg0whfk.js +0 -1
  438. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rxp5ykl1_lyb.js +0 -4
  439. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0sg6z8.ci0l2b.js +0 -1
  440. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v_~favugkv_a.js +0 -1
  441. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x3ysmon_~xsv.js +0 -1
  442. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x7sjde5wit~i.js +0 -1
  443. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yzz97.2e6if6.js +0 -138
  444. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0zbi5n76awxz1.js +0 -1
  445. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~alekqkiwwaq.js +0 -1
  446. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~e2n9bhosscr.js +0 -1
  447. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~i4llb9-utpp.css +0 -1
  448. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~n-y9cstar6b.js +0 -5
  449. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14z_j1qzycpe1.js +0 -1
  450. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17k4h5zgalxqj.js +0 -1
  451. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17m1wc_o0.5iz.js +0 -1
  452. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-header.tsx +0 -91
  453. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-tab-nav.tsx +0 -62
  454. package/dist/dashboard-runtime/dashboard/src/components/layout/breadcrumb-bar.tsx +0 -115
  455. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-header.tsx +0 -46
  456. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-tab-nav.tsx +0 -54
  457. /package/dist/dashboard-runtime/dashboard/.next/static/{nPPow7lCVx1fYDGH2XCxQ → doYIl-pd6Sqax3bfUgN3q}/_buildManifest.js +0 -0
  458. /package/dist/dashboard-runtime/dashboard/.next/static/{nPPow7lCVx1fYDGH2XCxQ → doYIl-pd6Sqax3bfUgN3q}/_clientMiddlewareManifest.js +0 -0
  459. /package/dist/dashboard-runtime/dashboard/.next/static/{nPPow7lCVx1fYDGH2XCxQ → doYIl-pd6Sqax3bfUgN3q}/_ssgManifest.js +0 -0
@@ -0,0 +1,43 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ interface UsageItem {
6
+ label: React.ReactNode
7
+ value: React.ReactNode
8
+ }
9
+
10
+ interface UsageCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
11
+ title?: React.ReactNode
12
+ items: UsageItem[]
13
+ }
14
+
15
+ export function UsageCard({
16
+ title = "Usage",
17
+ items,
18
+ className,
19
+ ...props
20
+ }: UsageCardProps) {
21
+ return (
22
+ <div
23
+ className={cn(
24
+ "rounded-md bg-[hsl(var(--background))] p-3 text-xs",
25
+ className,
26
+ )}
27
+ {...props}
28
+ >
29
+ <div className="mb-1.5 font-semibold text-[hsl(var(--muted-foreground))]">
30
+ {title}
31
+ </div>
32
+ {items.map((item, i) => (
33
+ <div
34
+ key={i}
35
+ className="flex justify-between text-[hsl(var(--subtle))] last:mb-0"
36
+ >
37
+ <span>{item.label}</span>
38
+ <span>{item.value}</span>
39
+ </div>
40
+ ))}
41
+ </div>
42
+ )
43
+ }
@@ -1,5 +1,11 @@
1
1
  import type { LucideIcon } from "lucide-react";
2
- import { Brain, Database, MessageSquare, Sparkles } from "lucide-react";
2
+ import {
3
+ Brain,
4
+ Database,
5
+ FolderKanban,
6
+ MessageSquare,
7
+ Sparkles,
8
+ } from "lucide-react";
3
9
 
4
10
  export interface NavItem {
5
11
  title: string;
@@ -15,23 +21,58 @@ export interface SidebarNavItem {
15
21
  tooltip?: string;
16
22
  }
17
23
 
24
+ export interface SidebarGroup {
25
+ /** Group heading shown above the items (uppercase tracking small caps in UI). */
26
+ title: string;
27
+ items: SidebarNavItem[];
28
+ }
29
+
18
30
  /**
19
- * Primary navigation shown in the sidebar main section.
31
+ * Sidebar groups in webUI order. Only routes that the dashboard actually
32
+ * implements appear here — `/projects` lands under ACCOUNT alongside the
33
+ * model configuration entry, mirroring webUI's "ACCOUNT" section.
20
34
  */
21
- export const sidebarNav: SidebarNavItem[] = [
22
- { title: "对话", href: "/chat", icon: MessageSquare },
23
- { title: "知识库", href: "/knowledge-base", icon: Database },
24
- { title: "记忆库", href: "/memory", icon: Brain },
25
- { title: "大模型", href: "/llm-providers", icon: Sparkles },
35
+ export const sidebarGroups: SidebarGroup[] = [
36
+ {
37
+ title: "对话",
38
+ items: [
39
+ { title: "对话智能体", href: "/chat", icon: MessageSquare },
40
+ ],
41
+ },
42
+ {
43
+ title: "知识库",
44
+ items: [
45
+ { title: "知识库管理", href: "/knowledge-base", icon: Database },
46
+ ],
47
+ },
48
+ {
49
+ title: "记忆库",
50
+ items: [
51
+ { title: "记忆库管理", href: "/memory", icon: Brain },
52
+ ],
53
+ },
54
+ {
55
+ title: "配置",
56
+ items: [
57
+ { title: "模型提供商", href: "/llm-providers", icon: Sparkles },
58
+ { title: "项目管理", href: "/projects", icon: FolderKanban },
59
+ ],
60
+ },
26
61
  ];
27
62
 
28
63
  /**
29
- * Secondary sidebar group reserved for future resource entries.
64
+ * Flat list derived from the grouped structure. Kept exported because the
65
+ * mobile sidebar and a handful of legacy callers iterate the flat sequence.
30
66
  */
67
+ export const sidebarNav: SidebarNavItem[] = sidebarGroups.flatMap(
68
+ (group) => group.items,
69
+ );
70
+
71
+ /** @deprecated retained for backwards compatibility — moved into `sidebarGroups`. */
31
72
  export const sidebarResources: SidebarNavItem[] = [];
32
73
 
33
74
  /**
34
- * @deprecated Kept for backwards compatibility; prefer `sidebarNav`.
75
+ * @deprecated Kept for backwards compatibility; prefer `sidebarGroups`.
35
76
  */
36
77
  export const mainNav: NavItem[] = [
37
78
  { title: "知识库", href: "/knowledge-base" },
@@ -0,0 +1,86 @@
1
+ "use client";
2
+
3
+ import { useCallback, useSyncExternalStore } from "react";
4
+
5
+ /**
6
+ * Mirror of {@link useSidebarCollapsed} for the *secondary* (detail-page)
7
+ * sidebar. Same persistence + cross-instance + cross-tab sync pattern, with
8
+ * a separate localStorage key so the two sidebars collapse independently.
9
+ *
10
+ * The reason for two hooks rather than one with a key parameter: each
11
+ * useSyncExternalStore needs a stable subscribe / snapshot pair, and a
12
+ * single subscribe shared between two state slots would notify all
13
+ * consumers on every change. Splitting keeps the dependency graph clean
14
+ * and avoids the "primary toggle re-renders every detail page" gotcha.
15
+ */
16
+ const STORAGE_KEY = "detail-sidebar.collapsed";
17
+ const EVENT_NAME = "detail-sidebar-collapsed-change";
18
+
19
+ let cachedValue: boolean | null = null;
20
+
21
+ function readFromStorage(): boolean {
22
+ if (cachedValue !== null) return cachedValue;
23
+ if (typeof window === "undefined") {
24
+ cachedValue = false;
25
+ return false;
26
+ }
27
+ try {
28
+ cachedValue = window.localStorage.getItem(STORAGE_KEY) === "1";
29
+ } catch {
30
+ cachedValue = false;
31
+ }
32
+ return cachedValue;
33
+ }
34
+
35
+ function subscribe(notify: () => void): () => void {
36
+ if (typeof window === "undefined") return () => {};
37
+ const handler = (event: Event) => {
38
+ const detail = (event as CustomEvent<boolean>).detail;
39
+ cachedValue = Boolean(detail);
40
+ notify();
41
+ };
42
+ const onStorage = (event: StorageEvent) => {
43
+ if (event.key !== STORAGE_KEY) return;
44
+ cachedValue = event.newValue === "1";
45
+ notify();
46
+ };
47
+ window.addEventListener(EVENT_NAME, handler as EventListener);
48
+ window.addEventListener("storage", onStorage);
49
+ return () => {
50
+ window.removeEventListener(EVENT_NAME, handler as EventListener);
51
+ window.removeEventListener("storage", onStorage);
52
+ };
53
+ }
54
+
55
+ function getSnapshot(): boolean {
56
+ return readFromStorage();
57
+ }
58
+
59
+ // During SSR the detail sidebar starts expanded; hydration reconciles.
60
+ function getServerSnapshot(): boolean {
61
+ return false;
62
+ }
63
+
64
+ export function useDetailSidebarCollapsed() {
65
+ const collapsed = useSyncExternalStore(
66
+ subscribe,
67
+ getSnapshot,
68
+ getServerSnapshot,
69
+ );
70
+
71
+ const setCollapsed = useCallback((next: boolean) => {
72
+ cachedValue = next;
73
+ try {
74
+ window.localStorage.setItem(STORAGE_KEY, next ? "1" : "0");
75
+ } catch {
76
+ // Ignore — private mode / quota / etc.
77
+ }
78
+ window.dispatchEvent(new CustomEvent(EVENT_NAME, { detail: next }));
79
+ }, []);
80
+
81
+ const toggle = useCallback(() => {
82
+ setCollapsed(!readFromStorage());
83
+ }, [setCollapsed]);
84
+
85
+ return { collapsed, setCollapsed, toggle };
86
+ }
@@ -0,0 +1,148 @@
1
+ import { useCallback, useState } from "react";
2
+ import { useMutation, useQueryClient } from "@tanstack/react-query";
3
+
4
+ import {
5
+ addDocuments,
6
+ UPLOAD_TIMEOUT_MS,
7
+ type AddDocumentItem,
8
+ type DocumentOperationResult,
9
+ } from "@/services/documents";
10
+ import { invalidateKnowledgeBaseQueries } from "@/lib/query-keys";
11
+
12
+ export interface OssImportProgress {
13
+ phase: "upload" | "done";
14
+ totalItems: number;
15
+ completedItems: number;
16
+ errors: string[];
17
+ }
18
+
19
+ interface OssImportVariables {
20
+ knowledgeBaseName: string;
21
+ /** ossKeys for individually-checked files. Submitted as-is, no filters. */
22
+ fileKeys: string[];
23
+ /** Folder prefixes (ending with `/`). Server recurses; filters apply. */
24
+ folderPrefixes: string[];
25
+ /** Glob arrays produced by `lib/glob-filter.ts`. Sent to the server only
26
+ * on folder items — file items don't carry filters. */
27
+ inclusionFilters?: string[];
28
+ exclusionFilters?: string[];
29
+ subspace?: string;
30
+ metadata?: Record<string, unknown>;
31
+ }
32
+
33
+ const SUBMISSION_BATCH_SIZE = 10; // matches services/documents.ts BATCH_SIZE
34
+
35
+ /**
36
+ * Submit an OSS-mode import to the KB.
37
+ *
38
+ * The KB API natively accepts a folder ossKey (`oss://<bucket>/docs/2026/`)
39
+ * and recurses on the server side, so the client doesn't need to expand
40
+ * folders into individual keys. Each {@link OssSelection} item becomes one
41
+ * `AddDocumentItem`:
42
+ *
43
+ * - file selection → `{ ossKey }` (no filters)
44
+ * - folder selection → `{ ossKey, inclusionFilters?, exclusionFilters? }`
45
+ *
46
+ * The full document list is submitted via `addDocuments`, which already
47
+ * handles `BATCH_SIZE` chunking internally. We re-batch here only because
48
+ * we want incremental progress — `addDocuments` doesn't expose a callback.
49
+ *
50
+ * Per-batch failures are tolerated: surviving batches' results are kept and
51
+ * the failed slice is recorded as `status: "failed"` per ossKey. This
52
+ * mirrors `useUploadDocuments`'s tolerance for partial-failure import.
53
+ */
54
+ export function useOssImport() {
55
+ const queryClient = useQueryClient();
56
+ const [progress, setProgress] = useState<OssImportProgress | null>(null);
57
+
58
+ const resetProgress = useCallback(() => setProgress(null), []);
59
+
60
+ const mutation = useMutation({
61
+ mutationFn: async (vars: OssImportVariables) => {
62
+ // Build the AddDocumentItem list. Filters attach only to folder items —
63
+ // a checked file is an explicit user intent and bypasses include/exclude
64
+ // (matches the local-folder semantics).
65
+ const items: AddDocumentItem[] = [
66
+ ...vars.fileKeys.map<AddDocumentItem>((ossKey) => ({
67
+ ossKey,
68
+ ...(vars.metadata ? { metadata: vars.metadata } : {}),
69
+ })),
70
+ ...vars.folderPrefixes.map<AddDocumentItem>((ossKey) => ({
71
+ ossKey,
72
+ ...(vars.metadata ? { metadata: vars.metadata } : {}),
73
+ ...(vars.inclusionFilters
74
+ ? { inclusionFilters: vars.inclusionFilters }
75
+ : {}),
76
+ ...(vars.exclusionFilters
77
+ ? { exclusionFilters: vars.exclusionFilters }
78
+ : {}),
79
+ })),
80
+ ];
81
+
82
+ if (items.length === 0) {
83
+ setProgress({ phase: "done", totalItems: 0, completedItems: 0, errors: [] });
84
+ return { documentDetails: [] as DocumentOperationResult[] };
85
+ }
86
+
87
+ setProgress({
88
+ phase: "upload",
89
+ totalItems: items.length,
90
+ completedItems: 0,
91
+ errors: [],
92
+ });
93
+
94
+ const allResults: DocumentOperationResult[] = [];
95
+ const allErrors: string[] = [];
96
+ for (let i = 0; i < items.length; i += SUBMISSION_BATCH_SIZE) {
97
+ const slice = items.slice(i, i + SUBMISSION_BATCH_SIZE);
98
+ try {
99
+ const resp = await addDocuments(
100
+ {
101
+ knowledgeBaseName: vars.knowledgeBaseName,
102
+ subspace: vars.subspace,
103
+ documents: slice,
104
+ },
105
+ { timeoutMs: UPLOAD_TIMEOUT_MS },
106
+ );
107
+ allResults.push(...resp.documentDetails);
108
+ } catch (err) {
109
+ const message = err instanceof Error ? err.message : String(err);
110
+ allErrors.push(`批次 ${Math.floor(i / SUBMISSION_BATCH_SIZE) + 1}: ${message}`);
111
+ for (const item of slice) {
112
+ allResults.push({
113
+ ossKey: item.ossKey,
114
+ status: "failed",
115
+ failureReason: message,
116
+ });
117
+ }
118
+ }
119
+ setProgress((p) =>
120
+ p
121
+ ? {
122
+ ...p,
123
+ completedItems: Math.min(p.totalItems, p.completedItems + slice.length),
124
+ }
125
+ : p,
126
+ );
127
+ }
128
+
129
+ setProgress({
130
+ phase: "done",
131
+ totalItems: items.length,
132
+ completedItems: items.length,
133
+ errors: allErrors,
134
+ });
135
+ return { documentDetails: allResults };
136
+ },
137
+ onSuccess: () => {
138
+ invalidateKnowledgeBaseQueries(queryClient);
139
+ },
140
+ onSettled: () => {
141
+ // Match the local upload hook's "linger briefly so the user reads the
142
+ // final state" gesture before clearing.
143
+ setTimeout(resetProgress, 300);
144
+ },
145
+ });
146
+
147
+ return { ...mutation, progress };
148
+ }
@@ -0,0 +1,89 @@
1
+ import { useInfiniteQuery } from "@tanstack/react-query";
2
+
3
+ import {
4
+ listOssObjects,
5
+ type OssListFile,
6
+ type OssListFolder,
7
+ type OssListPage,
8
+ } from "@/services/oss";
9
+
10
+ interface UseOssListOptions {
11
+ prefix: string;
12
+ search?: string;
13
+ /** When false, pauses fetching — useful while the parent tab is hidden. */
14
+ enabled?: boolean;
15
+ }
16
+
17
+ export interface UseOssListResult {
18
+ folders: OssListFolder[];
19
+ files: OssListFile[];
20
+ isLoading: boolean;
21
+ isFetchingNextPage: boolean;
22
+ hasNextPage: boolean;
23
+ fetchNextPage: () => void;
24
+ refetch: () => void;
25
+ error: Error | null;
26
+ /** Forwarded so the UI can render the "OSS_FORBIDDEN / NOT_CONFIGURED" state. */
27
+ errorCode: string | null;
28
+ }
29
+
30
+ const PAGE_SIZE = 100;
31
+
32
+ /**
33
+ * Query key shape mirrors `lib/query-keys.ts` conventions: a stable string
34
+ * head plus the variable identifiers. Co-located with the hook because no
35
+ * other module needs to invalidate this cache (the page is read-only).
36
+ */
37
+ function queryKey(prefix: string, search: string) {
38
+ return ["oss-list", prefix, search] as const;
39
+ }
40
+
41
+ export function useOssList(options: UseOssListOptions): UseOssListResult {
42
+ const { prefix, search = "", enabled = true } = options;
43
+
44
+ const query = useInfiniteQuery<OssListPage, Error>({
45
+ queryKey: queryKey(prefix, search),
46
+ queryFn: ({ pageParam }) =>
47
+ listOssObjects({
48
+ prefix,
49
+ continuationToken: typeof pageParam === "string" ? pageParam : undefined,
50
+ maxResults: PAGE_SIZE,
51
+ search: search || undefined,
52
+ }),
53
+ getNextPageParam: (last) => last.nextContinuationToken ?? undefined,
54
+ initialPageParam: undefined,
55
+ enabled,
56
+ // Listings are invalidated by re-mounting the dialog, not by mutations.
57
+ staleTime: 30_000,
58
+ refetchOnWindowFocus: false,
59
+ });
60
+
61
+ const folders: OssListFolder[] = [];
62
+ const files: OssListFile[] = [];
63
+ for (const page of query.data?.pages ?? []) {
64
+ folders.push(...page.folders);
65
+ files.push(...page.files);
66
+ }
67
+
68
+ // Surface error code from the standard envelope so the UI can switch on it.
69
+ const errorCode =
70
+ query.error && typeof query.error === "object" && "code" in query.error
71
+ ? String((query.error as { code: unknown }).code ?? "")
72
+ : null;
73
+
74
+ return {
75
+ folders,
76
+ files,
77
+ isLoading: query.isLoading,
78
+ isFetchingNextPage: query.isFetchingNextPage,
79
+ hasNextPage: Boolean(query.hasNextPage),
80
+ fetchNextPage: () => {
81
+ if (query.hasNextPage && !query.isFetchingNextPage) query.fetchNextPage();
82
+ },
83
+ refetch: () => {
84
+ void query.refetch();
85
+ },
86
+ error: query.error ?? null,
87
+ errorCode,
88
+ };
89
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Shared filename-extension and recursion rules used by both the local-folder
3
+ * upload mode and the server-side OSS prefix expansion. Keeping the rule shape
4
+ * and matching logic in one place is what guarantees the two paths agree.
5
+ *
6
+ * `include` / `exclude` are lowercase, dotted suffixes ([".md", ".pdf"]).
7
+ * They apply to the file's basename, not to its path — directory names never
8
+ * count toward the suffix check.
9
+ */
10
+ export interface ExtensionRules {
11
+ include: string[];
12
+ exclude: string[];
13
+ }
14
+
15
+ export interface RecursiveExtensionRules extends ExtensionRules {
16
+ recursive: boolean;
17
+ }
18
+
19
+ /**
20
+ * Normalize a comma-separated extension list like ".md, pdf , .TXT" into a
21
+ * lowercase, dot-prefixed array: [".md", ".pdf", ".txt"]. Empty tokens are
22
+ * dropped; missing leading dots are added.
23
+ */
24
+ export function parseExtensionList(raw: string): string[] {
25
+ return raw
26
+ .split(",")
27
+ .map((s) => s.trim().toLowerCase())
28
+ .filter(Boolean)
29
+ .map((ext) => (ext.startsWith(".") ? ext : `.${ext}`));
30
+ }
31
+
32
+ /** Pure name-based check. No path or depth involved — caller handles those. */
33
+ export function matchesExtension(name: string, rules: ExtensionRules): boolean {
34
+ const lower = name.toLowerCase();
35
+ if (rules.include.length > 0 && !rules.include.some((ext) => lower.endsWith(ext))) {
36
+ return false;
37
+ }
38
+ if (rules.exclude.length > 0 && rules.exclude.some((ext) => lower.endsWith(ext))) {
39
+ return false;
40
+ }
41
+ return true;
42
+ }
43
+
44
+ /**
45
+ * Filter a File[] picked through `<input webkitdirectory>` or drag-drop.
46
+ *
47
+ * The `webkitRelativePath` shape is "<root>/<...subpath>", so the top-level
48
+ * file inside the picked folder lives at depth 1. That's why the recursive
49
+ * cutoff here is `depth > 1` — anything deeper is a subdirectory.
50
+ */
51
+ export function filterFolderFiles(
52
+ files: File[],
53
+ rules: RecursiveExtensionRules,
54
+ ): File[] {
55
+ return files.filter((file) => {
56
+ const rel = file.webkitRelativePath || file.name;
57
+ const depth = (rel.match(/\//g) || []).length;
58
+ if (!rules.recursive && depth > 1) return false;
59
+ return matchesExtension(file.name, rules);
60
+ });
61
+ }
62
+
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Translate user-friendly extension / prefix tokens into the glob patterns
3
+ * the KB server expects on `inclusionFilters` / `exclusionFilters`.
4
+ *
5
+ * The server only accepts one of two pattern shapes:
6
+ * - prefix: `value*` (wildcard at the END, anchors the start)
7
+ * - suffix: `*value` (wildcard at the START, anchors the end)
8
+ *
9
+ * The dashboard masks these details — users type plain text in the UI
10
+ * (e.g. ".md, .pdf" for suffix include; "archive/2026/, drafts/" for prefix
11
+ * include) and these helpers wrap them. Already-globbed input is detected
12
+ * and left alone, so a user who pastes "*.md" or "drafts/*" gets the same
13
+ * result as one who types ".md" or "drafts/".
14
+ */
15
+
16
+ /**
17
+ * Lowercase, trim, and split a comma-separated input list. Empty tokens are
18
+ * dropped. Used by both prefix and suffix parsers below.
19
+ */
20
+ function tokenize(raw: string): string[] {
21
+ return raw
22
+ .split(",")
23
+ .map((s) => s.trim())
24
+ .filter(Boolean);
25
+ }
26
+
27
+ /**
28
+ * Wrap each token as a suffix glob: ".md, .pdf" → ["*.md", "*.pdf"].
29
+ *
30
+ * Idempotent — a token that already starts with `*` is kept verbatim, so
31
+ * users who type the canonical glob form don't get a double-star.
32
+ */
33
+ export function parseSuffixGlobs(raw: string): string[] {
34
+ return tokenize(raw).map((token) => (token.startsWith("*") ? token : `*${token}`));
35
+ }
36
+
37
+ /**
38
+ * Wrap each token as a prefix glob: "drafts/, archive/2026/" →
39
+ * ["drafts/*", "archive/2026/*"].
40
+ *
41
+ * Idempotent on tokens already ending in `*`.
42
+ */
43
+ export function parsePrefixGlobs(raw: string): string[] {
44
+ return tokenize(raw).map((token) => (token.endsWith("*") ? token : `${token}*`));
45
+ }
46
+
47
+ /**
48
+ * Combine prefix and suffix inclusion / exclusion inputs into the flat
49
+ * `inclusionFilters` / `exclusionFilters` arrays the server consumes.
50
+ * Returns `undefined` for empty buckets so callers can spread without
51
+ * leaking empty arrays into the request body.
52
+ */
53
+ export interface FolderGlobInputs {
54
+ prefixIncludeInput: string;
55
+ prefixExcludeInput: string;
56
+ suffixIncludeInput: string;
57
+ suffixExcludeInput: string;
58
+ }
59
+
60
+ export function buildFolderGlobs(inputs: FolderGlobInputs): {
61
+ inclusionFilters?: string[];
62
+ exclusionFilters?: string[];
63
+ } {
64
+ const inclusionFilters = [
65
+ ...parsePrefixGlobs(inputs.prefixIncludeInput),
66
+ ...parseSuffixGlobs(inputs.suffixIncludeInput),
67
+ ];
68
+ const exclusionFilters = [
69
+ ...parsePrefixGlobs(inputs.prefixExcludeInput),
70
+ ...parseSuffixGlobs(inputs.suffixExcludeInput),
71
+ ];
72
+ return {
73
+ inclusionFilters: inclusionFilters.length > 0 ? inclusionFilters : undefined,
74
+ exclusionFilters: exclusionFilters.length > 0 ? exclusionFilters : undefined,
75
+ };
76
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Discriminated selection algebra used by the OSS browser. Splitting the
3
+ * shape into a tagged union (instead of two parallel sets) keeps the
4
+ * "checked file" vs. "checked folder" distinction visible at every call
5
+ * site without bug-prone implicit-conversion paths.
6
+ */
7
+ export type OssSelectedItem =
8
+ | { type: "file"; ossKey: string; size: number }
9
+ | { type: "folder"; prefix: string };
10
+
11
+ export type OssSelection = OssSelectedItem[];
12
+
13
+ export function isFileSelected(sel: OssSelection, ossKey: string): boolean {
14
+ return sel.some((s) => s.type === "file" && s.ossKey === ossKey);
15
+ }
16
+
17
+ export function isFolderSelected(sel: OssSelection, prefix: string): boolean {
18
+ return sel.some((s) => s.type === "folder" && s.prefix === prefix);
19
+ }
20
+
21
+ export function toggleFile(
22
+ sel: OssSelection,
23
+ file: { ossKey: string; size: number },
24
+ ): OssSelection {
25
+ if (isFileSelected(sel, file.ossKey)) {
26
+ return sel.filter((s) => !(s.type === "file" && s.ossKey === file.ossKey));
27
+ }
28
+ return [...sel, { type: "file", ossKey: file.ossKey, size: file.size }];
29
+ }
30
+
31
+ export function toggleFolder(
32
+ sel: OssSelection,
33
+ folder: { prefix: string },
34
+ ): OssSelection {
35
+ if (isFolderSelected(sel, folder.prefix)) {
36
+ return sel.filter((s) => !(s.type === "folder" && s.prefix === folder.prefix));
37
+ }
38
+ return [...sel, { type: "folder", prefix: folder.prefix }];
39
+ }
40
+
41
+ /**
42
+ * Split a selection into the two payloads consumers need at submission time:
43
+ * an explicit ossKey list (files), and the prefixes that need to go through
44
+ * `expandPrefixes()`. Order within each list is preserved so the UI can
45
+ * render a stable preview.
46
+ */
47
+ export function partitionSelection(sel: OssSelection): {
48
+ fileKeys: string[];
49
+ folderPrefixes: string[];
50
+ } {
51
+ const fileKeys: string[] = [];
52
+ const folderPrefixes: string[] = [];
53
+ for (const item of sel) {
54
+ if (item.type === "file") fileKeys.push(item.ossKey);
55
+ else folderPrefixes.push(item.prefix);
56
+ }
57
+ return { fileKeys, folderPrefixes };
58
+ }