@tablestore/tablestore-agent-cli 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (971) hide show
  1. package/dist/commands/configure.d.ts.map +1 -1
  2. package/dist/commands/configure.js +19 -12
  3. package/dist/commands/configure.js.map +1 -1
  4. package/dist/commands/dashboard.d.ts.map +1 -1
  5. package/dist/commands/dashboard.js +12 -5
  6. package/dist/commands/dashboard.js.map +1 -1
  7. package/dist/commands/doctor.d.ts.map +1 -1
  8. package/dist/commands/doctor.js +212 -61
  9. package/dist/commands/doctor.js.map +1 -1
  10. package/dist/commands/kb/create.d.ts.map +1 -1
  11. package/dist/commands/kb/create.js.map +1 -1
  12. package/dist/commands/kb/doc-add.d.ts.map +1 -1
  13. package/dist/commands/kb/doc-add.js +3 -1
  14. package/dist/commands/kb/doc-add.js.map +1 -1
  15. package/dist/commands/kb/doc-get.d.ts.map +1 -1
  16. package/dist/commands/kb/doc-get.js +6 -2
  17. package/dist/commands/kb/doc-get.js.map +1 -1
  18. package/dist/commands/kb/doc-remove.d.ts.map +1 -1
  19. package/dist/commands/kb/doc-remove.js.map +1 -1
  20. package/dist/commands/kb/helpers.d.ts.map +1 -1
  21. package/dist/commands/kb/helpers.js.map +1 -1
  22. package/dist/commands/kb/retrieve.d.ts.map +1 -1
  23. package/dist/commands/kb/retrieve.js +3 -1
  24. package/dist/commands/kb/retrieve.js.map +1 -1
  25. package/dist/commands/memory.d.ts.map +1 -1
  26. package/dist/commands/memory.js +209 -23
  27. package/dist/commands/memory.js.map +1 -1
  28. package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
  29. package/dist/dashboard-runtime/dashboard/.next/app-path-routes-manifest.json +4 -0
  30. package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +3 -3
  31. package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
  32. package/dist/dashboard-runtime/dashboard/.next/routes-manifest.json +32 -0
  33. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page.js +3 -3
  34. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page.js.nft.json +1 -1
  35. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page_client-reference-manifest.js +1 -1
  36. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js +3 -3
  37. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  38. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  39. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js +3 -3
  40. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
  41. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
  42. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js +3 -3
  43. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
  44. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
  45. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js +3 -3
  46. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
  47. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
  48. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js +3 -3
  49. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
  50. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
  51. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js +3 -3
  52. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
  53. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
  54. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js +3 -3
  55. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
  56. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
  57. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js +3 -3
  58. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
  59. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
  60. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js +3 -3
  61. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
  62. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
  63. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js +4 -4
  64. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
  65. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
  66. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js +3 -3
  67. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  68. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  69. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page.js +3 -3
  70. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page.js.nft.json +1 -1
  71. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page_client-reference-manifest.js +1 -1
  72. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page.js +3 -3
  73. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page.js.nft.json +1 -1
  74. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page_client-reference-manifest.js +1 -1
  75. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js +3 -3
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js +3 -3
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js +3 -3
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js +3 -3
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js +3 -3
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page.js +3 -3
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page.js.nft.json +1 -1
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page_client-reference-manifest.js +1 -1
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js +3 -3
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js +3 -3
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js +3 -3
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js +3 -3
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  112. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page.js +2 -2
  113. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  114. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  115. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  116. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +24 -20
  117. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +24 -20
  118. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  119. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +11 -10
  120. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +8 -5
  121. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  122. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  123. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js +2 -2
  124. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js.nft.json +1 -1
  125. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js +2 -2
  126. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js.nft.json +1 -1
  127. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js +2 -2
  128. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js.nft.json +1 -1
  129. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js +2 -2
  130. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js.nft.json +1 -1
  131. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js +2 -2
  132. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js.nft.json +1 -1
  133. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js +2 -2
  134. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js.nft.json +1 -1
  135. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js +2 -2
  136. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  137. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js +2 -2
  138. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  139. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js +2 -2
  140. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  141. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js +2 -2
  142. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  143. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js +2 -2
  144. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  145. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js +2 -2
  146. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  147. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js +2 -2
  148. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  149. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js +2 -2
  150. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  151. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js +2 -2
  152. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  153. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js +2 -2
  154. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  155. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js +2 -2
  156. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  157. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js +2 -2
  158. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  159. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js +2 -2
  160. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  161. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js +2 -2
  162. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  163. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js +2 -2
  164. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  165. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js +2 -2
  166. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  167. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js +2 -2
  168. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  169. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js +2 -2
  170. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  171. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js +2 -2
  172. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  173. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js +2 -2
  174. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
  175. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route/app-paths-manifest.json +3 -0
  176. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route/build-manifest.json +9 -0
  177. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route/server-reference-manifest.json +4 -0
  178. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js +6 -0
  179. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js.map +5 -0
  180. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js.nft.json +1 -0
  181. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route_client-reference-manifest.js +3 -0
  182. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js +2 -2
  183. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js.nft.json +1 -1
  184. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js +2 -2
  185. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js.nft.json +1 -1
  186. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js +2 -2
  187. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js.nft.json +1 -1
  188. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js +2 -2
  189. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js.nft.json +1 -1
  190. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js +2 -2
  191. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js.nft.json +1 -1
  192. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route/app-paths-manifest.json +3 -0
  193. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route/build-manifest.json +9 -0
  194. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route/server-reference-manifest.json +4 -0
  195. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route.js +6 -0
  196. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route.js.map +5 -0
  197. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route.js.nft.json +1 -0
  198. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route_client-reference-manifest.js +3 -0
  199. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route/app-paths-manifest.json +3 -0
  200. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route/build-manifest.json +9 -0
  201. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route/server-reference-manifest.json +4 -0
  202. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route.js +6 -0
  203. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route.js.map +5 -0
  204. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route.js.nft.json +1 -0
  205. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route_client-reference-manifest.js +3 -0
  206. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/app-paths-manifest.json +3 -0
  207. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/build-manifest.json +9 -0
  208. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/server-reference-manifest.json +4 -0
  209. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js +6 -0
  210. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js.map +5 -0
  211. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js.nft.json +1 -0
  212. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route_client-reference-manifest.js +3 -0
  213. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js +2 -2
  214. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
  215. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js +2 -2
  216. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
  217. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js +2 -2
  218. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
  219. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js +2 -2
  220. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js.nft.json +1 -1
  221. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js +2 -2
  222. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
  223. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js +2 -2
  224. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js.nft.json +1 -1
  225. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js +2 -2
  226. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js.nft.json +1 -1
  227. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js +2 -2
  228. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
  229. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js +2 -2
  230. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
  231. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js +2 -2
  232. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
  233. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js +2 -2
  234. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -1
  235. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js +2 -2
  236. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
  237. package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
  238. package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +20 -19
  239. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  240. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +20 -19
  241. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +3 -3
  242. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +11 -10
  243. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  244. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js +2 -2
  245. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js.nft.json +1 -1
  246. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  247. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
  248. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +24 -23
  249. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +24 -23
  250. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +3 -3
  251. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +11 -10
  252. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  253. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  254. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +4 -4
  255. package/dist/dashboard-runtime/dashboard/.next/server/app/page.js +2 -2
  256. package/dist/dashboard-runtime/dashboard/.next/server/app/page.js.nft.json +1 -1
  257. package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  258. package/dist/dashboard-runtime/dashboard/.next/server/app-paths-manifest.json +4 -0
  259. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_dream-kb-sync_route_actions_04qnm9s.js +3 -0
  260. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_file-memory_file_route_actions_06~k01v.js +3 -0
  261. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_file-memory_sync_route_actions_0rt6p8e.js +3 -0
  262. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_file-memory_tree_route_actions_0wl_n8b.js +3 -0
  263. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +13 -5
  264. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-3~.bv._.js +14 -0
  265. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-dt7~s._.js +3 -0
  266. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.-~ff4._.js +3 -0
  267. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.l706t._.js +3 -0
  268. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.nejw_._.js +3 -0
  269. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00_mrad._.js +3 -0
  270. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00i.7se._.js +3 -0
  271. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00r7uqs._.js +3 -0
  272. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02~yw7n._.js +3 -0
  273. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04kpzpa._.js +3 -0
  274. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04p1a88._.js +3 -0
  275. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05x0k4d._.js +3 -0
  276. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__060s~oe._.js +3 -0
  277. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06fanvv._.js +3 -0
  278. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06tci88._.js +3 -0
  279. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__10k~3sa._.js → [root-of-the-server]__089es3y._.js} +12 -12
  280. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08bzgzm._.js +3 -0
  281. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08d7wb.._.js +3 -0
  282. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08p_m_c._.js +3 -0
  283. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__095xiwn._.js +3 -0
  284. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__09h95i6._.js +3 -0
  285. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__0.y01v.._.js → [root-of-the-server]__0ai2k_o._.js} +13 -13
  286. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0alcygi._.js +3 -0
  287. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0aspytx._.js +3 -0
  288. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cq-9s~._.js +3 -0
  289. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cyiuai._.js +3 -0
  290. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0d4zrpj._.js +3 -0
  291. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0d~m09k._.js +3 -0
  292. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0f1lugp._.js +3 -0
  293. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__0wa~r66._.js → [root-of-the-server]__0g1cfb7._.js} +12 -12
  294. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0gpz.~y._.js +3 -0
  295. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0i3u9x3._.js +3 -0
  296. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0iromt6._.js +3 -0
  297. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0j8.u0y._.js +3 -0
  298. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0k-pfaj._.js +3 -0
  299. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0kcbz7k._.js +3 -0
  300. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0nrl-.g._.js +3 -0
  301. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0o5mf4h._.js +3 -0
  302. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0omyr40._.js +3 -0
  303. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ty8jgt._.js +3 -0
  304. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ug_2kc._.js +3 -0
  305. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0v98i9~._.js +3 -0
  306. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0wt0ksb._.js +3 -0
  307. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ya_8d2._.js +3 -0
  308. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zfg-ml._.js +3 -0
  309. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0~9ru5n._.js +3 -0
  310. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0~f7ckz._.js +3 -0
  311. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__109i6ps._.js +3 -0
  312. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__10o5zq5._.js +3 -0
  313. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12ls5l8._.js +3 -0
  314. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +2 -2
  315. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95_src_app_(dashboard)_knowledge-base_[name]_settings_settings-client_tsx_13312zk._.js +1 -1
  316. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0w-2_lucide-react_dist_esm_icons_0h-3_0x._.js +3 -0
  317. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__01sm7cj._.js +3 -0
  318. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0k0es2c._.js +3 -0
  319. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ky8i.~._.js +3 -0
  320. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ocsrt0._.js +3 -0
  321. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ys4x_n._.js +3 -0
  322. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_002mc1c._.js +3 -0
  323. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_02waf76._.js +3 -0
  324. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_03z8zmx._.js +1 -1
  325. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_04f2u4t._.js +1 -1
  326. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06ny.4k._.js +1 -1
  327. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0_1_-hn._.js +3 -0
  328. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0_er4j0._.js +3 -0
  329. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ahm789._.js +3 -0
  330. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0brqbty._.js +1 -1
  331. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0e.ehti._.js +3 -0
  332. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f8moq0._.js +3 -0
  333. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f8yv4v._.js +1 -1
  334. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0frs8ys._.js +3 -0
  335. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fvg_xo._.js +3 -0
  336. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gbt~hy._.js +1 -1
  337. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gl7kh7._.js +1 -1
  338. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0h9c.8m._.js +3 -0
  339. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ip4ncy._.js +3 -0
  340. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0izjcsk._.js +3 -0
  341. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j.62sb._.js +1 -1
  342. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ka7ryb._.js +1 -1
  343. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0lo5ra0._.js +1 -1
  344. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0mdbcju._.js +3 -0
  345. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0o665bf._.js +1 -1
  346. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0odjvc.._.js +1 -1
  347. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0p_s55v._.js +3 -0
  348. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0qiamjd._.js +3 -0
  349. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0t.h859._.js +3 -0
  350. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xdioxg._.js +1 -1
  351. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xp94lc._.js +3 -0
  352. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_11fl7_r._.js +1 -1
  353. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13730cz._.js +3 -0
  354. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_06894o_._.js → _13ctfae._.js} +2 -2
  355. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00.1.s_._.js +1 -1
  356. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_04o7mfc._.js +3 -0
  357. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0bhjp9s._.js +3 -0
  358. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0grv2wq._.js +3 -0
  359. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0qlyj-q._.js +1 -1
  360. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{dashboard_src_0o9jhcn._.js → dashboard_src_0sn17ku._.js} +4 -4
  361. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0x60pxf._.js +3 -0
  362. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
  363. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
  364. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_api-keys_page_tsx_0lb6fu7._.js +2 -2
  365. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_[name]_error_tsx_0rnss~4._.js +1 -1
  366. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_create_page_tsx_0916~g-._.js +1 -1
  367. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_[dreamId]_page_tsx_0wy3tv6._.js +1 -1
  368. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_page_tsx_0uzzpvs._.js +1 -1
  369. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_layout_tsx_0rbi41w._.js +1 -1
  370. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_messages_page_tsx_0votz-n._.js +3 -0
  371. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_tasks_page_tsx_0a_bgx4._.js +1 -1
  372. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
  373. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_error_tsx_01x7ppm._.js +1 -1
  374. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_not-found_tsx_05z4mh~._.js +3 -0
  375. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_retrieval_02c2uck._.js +1 -1
  376. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_shared_relative-time_tsx_0b7s9rc._.js +1 -1
  377. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_i18n_i18n-context_tsx_0c39ewr._.js +3 -0
  378. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_providers_runtime-context-provider_tsx_0wmj66z._.js +1 -1
  379. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_00usyu3._.js +3 -0
  380. package/dist/dashboard-runtime/dashboard/.next/server/functions-config-manifest.json +4 -0
  381. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +3 -3
  382. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  383. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  384. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  385. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  386. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0--dupndun7xc.css +1 -0
  387. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.uxk~hsm6yi8.js +138 -0
  388. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00eggrx~.4c55.js +1 -0
  389. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00lvoeu_v3253.js +1 -0
  390. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00o9vmhspv._3.js +138 -0
  391. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00x1.t633f041.js +1 -0
  392. package/dist/dashboard-runtime/dashboard/.next/static/chunks/010bpq~3ntjcm.js +4 -0
  393. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02p7gke47s.2~.js +1 -0
  394. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02u9ocsl0a12t.js +1 -0
  395. package/dist/dashboard-runtime/dashboard/.next/static/chunks/03_t1t9j7dbax.js +1 -0
  396. package/dist/dashboard-runtime/dashboard/.next/static/chunks/03dth-av1gl-h.js +1 -0
  397. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07aczaljq.qvr.js +1 -0
  398. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07s0f6938um2v.js +1 -0
  399. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08nzc9sye_0~h.js +1 -0
  400. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09y30vyml4r.b.js +1 -0
  401. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ab~fpog2~u.h.js +1 -0
  402. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0au0pbejtwahz.js +1 -0
  403. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b-ei8-g7ceug.js +1 -0
  404. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0chiv044h3u58.js +1 -0
  405. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0fcdli-~wmvvx.js +1 -0
  406. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0fz_9~-rxluly.js +1 -0
  407. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0hqkctymrrnbk.js +1 -0
  408. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0i55cqygnl-a9.js +5 -0
  409. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j8p7vk~awgs..js +1 -0
  410. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j_.hkhjix9hw.js +1 -0
  411. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ll488v66ycn1.js +1 -0
  412. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0823z0-i-vkzj.js → 0l~3_bvic.da3.js} +1 -1
  413. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0mp0n~dtbg78r.js +1 -0
  414. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0naliud7av3p1.js +1 -0
  415. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0nvwdxs-j_2ld.js +1 -0
  416. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0opbuui_pt1n1.js +1 -0
  417. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pbfl~23ac79y.js +9 -0
  418. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0qwhis4t32vlg.js +1 -0
  419. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0_2i27ja0f5u_.js → 0r44f~_t6m0hu.js} +1 -1
  420. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vuh8jgeqqdy..js +1 -0
  421. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{11daw7hfc5lbv.js → 0wbevjtr1_grz.js} +1 -1
  422. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0y-gjpq3kxsbz.js +1 -0
  423. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0z_pq4ttgotxw.js +1 -0
  424. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0zatcw.k613lh.js +1 -0
  425. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~a4ig2x9z8uq.js +1 -0
  426. package/dist/dashboard-runtime/dashboard/.next/static/chunks/10i~m4_8ainxw.js +1 -0
  427. package/dist/dashboard-runtime/dashboard/.next/static/chunks/12535rmhzbk63.js +1 -0
  428. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{11islg2md6lj-.js → 13uk2uuzuop5e.js} +1 -1
  429. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13vd4hv~l95-c.js +1 -0
  430. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16.2aecdwo6w_.js +1 -0
  431. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16yu0g~7n~33c.js +1 -0
  432. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17fx3e0sj7h7s.js +1 -0
  433. package/dist/dashboard-runtime/dashboard/next.config.ts +1 -5
  434. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/api-keys/page.tsx +28 -18
  435. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/error.tsx +5 -3
  436. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/page.tsx +188 -19
  437. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/error.tsx +8 -5
  438. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/documents/documents-client.tsx +85 -45
  439. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/error.tsx +12 -7
  440. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/layout-client.tsx +67 -29
  441. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/qa/page.tsx +2 -1
  442. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/retrieval/retrieval-client.tsx +8 -4
  443. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/settings/settings-client.tsx +6 -3
  444. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/create/page.tsx +5 -3
  445. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/page.tsx +6 -4
  446. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/layout.tsx +15 -19
  447. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/llm-providers/[id]/page.tsx +4 -2
  448. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/llm-providers/error.tsx +6 -3
  449. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/llm-providers/new/page.tsx +6 -2
  450. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/llm-providers/page.tsx +8 -6
  451. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/[dreamId]/page.tsx +112 -49
  452. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/page.tsx +300 -133
  453. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/layout.tsx +48 -32
  454. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/_helpers.ts +16 -5
  455. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/message-bubble.tsx +3 -1
  456. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/page.tsx +47 -17
  457. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/time-filter-bar.tsx +15 -13
  458. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/_helpers.ts +20 -29
  459. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/page.tsx +121 -42
  460. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/request-detail-dialog.tsx +37 -17
  461. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/requests-search-bar.tsx +11 -6
  462. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/requests/requests-table.tsx +29 -9
  463. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +13 -4
  464. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/settings/page.tsx +21 -29
  465. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/tasks/page.tsx +20 -15
  466. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +355 -125
  467. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/create/page.tsx +5 -3
  468. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/error.tsx +5 -3
  469. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/page.tsx +6 -4
  470. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/error.tsx +6 -3
  471. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/page.tsx +18 -13
  472. package/dist/dashboard-runtime/dashboard/src/app/api/v1/api-keys/[id]/custom-policy/route.ts +1 -3
  473. package/dist/dashboard-runtime/dashboard/src/app/api/v1/api-keys/[id]/effective-permissions/route.ts +45 -17
  474. package/dist/dashboard-runtime/dashboard/src/app/api/v1/api-keys/[id]/policies/route.ts +0 -8
  475. package/dist/dashboard-runtime/dashboard/src/app/api/v1/api-keys/[id]/route.ts +3 -1
  476. package/dist/dashboard-runtime/dashboard/src/app/api/v1/api-keys/filter-by-permission/route.ts +21 -10
  477. package/dist/dashboard-runtime/dashboard/src/app/api/v1/api-keys/route.ts +20 -6
  478. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/[name]/route.ts +10 -5
  479. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/[name]/token/route.ts +1 -0
  480. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/[name]/use/route.ts +2 -2
  481. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/route.ts +6 -5
  482. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/chunks/route.ts +4 -1
  483. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.ts +5 -1
  484. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/route.ts +8 -2
  485. package/dist/dashboard-runtime/dashboard/src/app/api/v1/knowledge-bases/[name]/documents/upload/route.ts +7 -2
  486. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-helpers.ts +93 -0
  487. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +152 -64
  488. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/providers/route.ts +1 -4
  489. package/dist/dashboard-runtime/dashboard/src/app/api/v1/logs/client/route.ts +30 -13
  490. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/dream-kb-sync/route.ts +78 -0
  491. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.ts +2 -1
  492. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/dream-tasks/route.ts +2 -1
  493. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/_helpers.ts +42 -0
  494. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/file/route.ts +69 -0
  495. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/sync/route.ts +69 -0
  496. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/tree/route.ts +44 -0
  497. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/scopes/route.ts +3 -5
  498. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/tasks/route.ts +2 -1
  499. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/units/route.ts +4 -1
  500. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/route.ts +30 -7
  501. package/dist/dashboard-runtime/dashboard/src/app/api/v1/oss/list/route.ts +11 -3
  502. package/dist/dashboard-runtime/dashboard/src/app/error.tsx +17 -16
  503. package/dist/dashboard-runtime/dashboard/src/app/globals.css +63 -23
  504. package/dist/dashboard-runtime/dashboard/src/app/layout.tsx +17 -14
  505. package/dist/dashboard-runtime/dashboard/src/app/not-found.tsx +12 -4
  506. package/dist/dashboard-runtime/dashboard/src/app/onboarding/error.tsx +8 -4
  507. package/dist/dashboard-runtime/dashboard/src/app/onboarding/page.tsx +7 -8
  508. package/dist/dashboard-runtime/dashboard/src/components/api-keys/api-key-create-dialog.tsx +42 -19
  509. package/dist/dashboard-runtime/dashboard/src/components/api-keys/api-key-delete-dialog.tsx +32 -14
  510. package/dist/dashboard-runtime/dashboard/src/components/api-keys/api-key-detail-sheet.tsx +23 -18
  511. package/dist/dashboard-runtime/dashboard/src/components/api-keys/api-key-permission-filter.tsx +42 -35
  512. package/dist/dashboard-runtime/dashboard/src/components/api-keys/api-key-secret-revealed-dialog.tsx +22 -19
  513. package/dist/dashboard-runtime/dashboard/src/components/api-keys/api-key-table.tsx +58 -23
  514. package/dist/dashboard-runtime/dashboard/src/components/api-keys/bearer-token-toggle.tsx +13 -8
  515. package/dist/dashboard-runtime/dashboard/src/components/api-keys/custom-policy-editor.tsx +43 -20
  516. package/dist/dashboard-runtime/dashboard/src/components/api-keys/permission-overview.tsx +19 -8
  517. package/dist/dashboard-runtime/dashboard/src/components/api-keys/permission-presets.tsx +37 -17
  518. package/dist/dashboard-runtime/dashboard/src/components/api-keys/permission-rule-dialog.tsx +99 -58
  519. package/dist/dashboard-runtime/dashboard/src/components/chat/add-mount-row.tsx +3 -1
  520. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +30 -9
  521. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-history-sidebar.tsx +13 -10
  522. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-mount-config.tsx +28 -21
  523. package/dist/dashboard-runtime/dashboard/src/components/chat/memory-bind-section.tsx +221 -41
  524. package/dist/dashboard-runtime/dashboard/src/components/chat/memory-files-dialog.tsx +51 -0
  525. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-empty-state.tsx +12 -8
  526. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-picker.tsx +4 -2
  527. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-retrieval-dialog.tsx +31 -15
  528. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-row.tsx +9 -3
  529. package/dist/dashboard-runtime/dashboard/src/components/chat/unified-retrieval-section.tsx +14 -6
  530. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-chunks-dialog.tsx +215 -126
  531. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-columns.tsx +22 -13
  532. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-detail-panel.tsx +56 -27
  533. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-status-badge.tsx +8 -13
  534. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-table.tsx +9 -7
  535. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-toolbar.tsx +17 -18
  536. package/dist/dashboard-runtime/dashboard/src/components/documents/doc-upload-dialog.tsx +308 -181
  537. package/dist/dashboard-runtime/dashboard/src/components/documents/oss-browser.tsx +32 -16
  538. package/dist/dashboard-runtime/dashboard/src/components/documents/oss-import-tab.tsx +39 -14
  539. package/dist/dashboard-runtime/dashboard/src/components/home/home-empty-state.tsx +10 -6
  540. package/dist/dashboard-runtime/dashboard/src/components/home/home-hero.tsx +10 -6
  541. package/dist/dashboard-runtime/dashboard/src/components/instance/connect-instance-dialog.tsx +5 -6
  542. package/dist/dashboard-runtime/dashboard/src/components/instance/connect-instance-form.tsx +204 -64
  543. package/dist/dashboard-runtime/dashboard/src/components/instance/edit-instance-dialog.tsx +19 -5
  544. package/dist/dashboard-runtime/dashboard/src/components/instance/project-card.tsx +13 -7
  545. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/embedding-config-form.tsx +52 -19
  546. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-card.tsx +138 -102
  547. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-create-form.tsx +180 -73
  548. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-delete-dialog.tsx +28 -12
  549. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-list.tsx +12 -10
  550. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-settings-form.tsx +180 -78
  551. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/retrieval-result-count-field.tsx +12 -7
  552. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-gate.tsx +11 -7
  553. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-switcher.tsx +16 -8
  554. package/dist/dashboard-runtime/dashboard/src/components/layout/detail-sidebar.tsx +15 -17
  555. package/dist/dashboard-runtime/dashboard/src/components/layout/help-link.tsx +32 -32
  556. package/dist/dashboard-runtime/dashboard/src/components/layout/instance-switcher.tsx +9 -5
  557. package/dist/dashboard-runtime/dashboard/src/components/layout/language-toggle.tsx +71 -0
  558. package/dist/dashboard-runtime/dashboard/src/components/layout/nav-link.tsx +8 -10
  559. package/dist/dashboard-runtime/dashboard/src/components/layout/page-header.tsx +26 -31
  560. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-instance-card.tsx +24 -9
  561. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-item.tsx +11 -5
  562. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-mobile.tsx +16 -7
  563. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-usage-stats.tsx +4 -2
  564. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar.tsx +13 -9
  565. package/dist/dashboard-runtime/dashboard/src/components/layout/skip-to-content.tsx +21 -0
  566. package/dist/dashboard-runtime/dashboard/src/components/layout/theme-toggle.tsx +65 -144
  567. package/dist/dashboard-runtime/dashboard/src/components/llm-providers/llm-provider-card.tsx +35 -18
  568. package/dist/dashboard-runtime/dashboard/src/components/llm-providers/llm-provider-delete-dialog.tsx +20 -8
  569. package/dist/dashboard-runtime/dashboard/src/components/llm-providers/llm-provider-form.tsx +139 -67
  570. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-add-dialog.tsx +15 -11
  571. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-coming-soon.tsx +7 -3
  572. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-create-form.tsx +179 -43
  573. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-delete-dialog.tsx +12 -6
  574. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-actions-table.tsx +212 -88
  575. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-apply-confirm-dialog.tsx +14 -8
  576. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-create-dialog.tsx +222 -84
  577. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-disabled.tsx +10 -4
  578. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-edit-dialog.tsx +21 -11
  579. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-files-browser.tsx +225 -0
  580. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-messages-table.tsx +28 -24
  581. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-requests-table.tsx +122 -58
  582. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +63 -28
  583. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +32 -19
  584. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +60 -29
  585. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-settings-form.tsx +63 -26
  586. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +34 -15
  587. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-list.tsx +19 -13
  588. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-tasks-table.tsx +84 -46
  589. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-detail-panel.tsx +37 -14
  590. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +54 -30
  591. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-combobox.tsx +148 -0
  592. package/dist/dashboard-runtime/dashboard/src/components/qa/code-block.tsx +5 -3
  593. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-chat-panel.tsx +51 -15
  594. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-form.tsx +29 -16
  595. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +268 -66
  596. package/dist/dashboard-runtime/dashboard/src/components/retrieval/assemble-retrieval-configuration.ts +6 -2
  597. package/dist/dashboard-runtime/dashboard/src/components/retrieval/filter-builder.tsx +260 -87
  598. package/dist/dashboard-runtime/dashboard/src/components/retrieval/request-preview.tsx +10 -4
  599. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-form.tsx +56 -35
  600. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-params-fields.tsx +40 -27
  601. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-rerank-fields.tsx +80 -30
  602. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-result-card.tsx +16 -5
  603. package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-results.tsx +11 -8
  604. package/dist/dashboard-runtime/dashboard/src/components/shared/confirm-dialog.tsx +11 -8
  605. package/dist/dashboard-runtime/dashboard/src/components/shared/data-table/data-table-pagination.tsx +21 -7
  606. package/dist/dashboard-runtime/dashboard/src/components/shared/data-table/data-table-toolbar.tsx +1 -2
  607. package/dist/dashboard-runtime/dashboard/src/components/shared/data-table/data-table.tsx +24 -9
  608. package/dist/dashboard-runtime/dashboard/src/components/shared/empty-state.tsx +1 -4
  609. package/dist/dashboard-runtime/dashboard/src/components/shared/error-state.tsx +1 -3
  610. package/dist/dashboard-runtime/dashboard/src/components/shared/json-viewer.tsx +1 -2
  611. package/dist/dashboard-runtime/dashboard/src/components/shared/llm-model-selector.tsx +22 -17
  612. package/dist/dashboard-runtime/dashboard/src/components/shared/metadata-field-input.tsx +10 -2
  613. package/dist/dashboard-runtime/dashboard/src/components/shared/metadata-form.tsx +10 -7
  614. package/dist/dashboard-runtime/dashboard/src/components/shared/refresh-button.tsx +6 -3
  615. package/dist/dashboard-runtime/dashboard/src/components/shared/relative-time.tsx +6 -3
  616. package/dist/dashboard-runtime/dashboard/src/components/shared/search-input.tsx +6 -5
  617. package/dist/dashboard-runtime/dashboard/src/components/shared/status-badge.tsx +9 -14
  618. package/dist/dashboard-runtime/dashboard/src/components/shared/system-prompt-input.tsx +6 -3
  619. package/dist/dashboard-runtime/dashboard/src/components/shared/tag-input.tsx +12 -7
  620. package/dist/dashboard-runtime/dashboard/src/components/shared/temperature-slider.tsx +4 -2
  621. package/dist/dashboard-runtime/dashboard/src/components/ui/badge.tsx +9 -8
  622. package/dist/dashboard-runtime/dashboard/src/components/ui/button.tsx +15 -14
  623. package/dist/dashboard-runtime/dashboard/src/components/ui/card.tsx +26 -18
  624. package/dist/dashboard-runtime/dashboard/src/components/ui/chat-bubble.tsx +10 -10
  625. package/dist/dashboard-runtime/dashboard/src/components/ui/checkbox.tsx +8 -8
  626. package/dist/dashboard-runtime/dashboard/src/components/ui/collapsible.tsx +6 -6
  627. package/dist/dashboard-runtime/dashboard/src/components/ui/command.tsx +32 -32
  628. package/dist/dashboard-runtime/dashboard/src/components/ui/data-card.tsx +35 -35
  629. package/dist/dashboard-runtime/dashboard/src/components/ui/detail-section.tsx +42 -36
  630. package/dist/dashboard-runtime/dashboard/src/components/ui/dialog.tsx +29 -29
  631. package/dist/dashboard-runtime/dashboard/src/components/ui/dropdown-menu.tsx +40 -40
  632. package/dist/dashboard-runtime/dashboard/src/components/ui/empty-state.tsx +16 -10
  633. package/dist/dashboard-runtime/dashboard/src/components/ui/filter-pill.tsx +20 -21
  634. package/dist/dashboard-runtime/dashboard/src/components/ui/form.tsx +57 -51
  635. package/dist/dashboard-runtime/dashboard/src/components/ui/input.tsx +8 -8
  636. package/dist/dashboard-runtime/dashboard/src/components/ui/item-card.tsx +17 -16
  637. package/dist/dashboard-runtime/dashboard/src/components/ui/label.tsx +9 -9
  638. package/dist/dashboard-runtime/dashboard/src/components/ui/memory-row.tsx +10 -10
  639. package/dist/dashboard-runtime/dashboard/src/components/ui/mini-stat.tsx +9 -8
  640. package/dist/dashboard-runtime/dashboard/src/components/ui/nav-tab-bar.tsx +21 -15
  641. package/dist/dashboard-runtime/dashboard/src/components/ui/playground-shell.tsx +13 -16
  642. package/dist/dashboard-runtime/dashboard/src/components/ui/popover.tsx +11 -11
  643. package/dist/dashboard-runtime/dashboard/src/components/ui/result-row.tsx +7 -7
  644. package/dist/dashboard-runtime/dashboard/src/components/ui/scope-tag.tsx +9 -6
  645. package/dist/dashboard-runtime/dashboard/src/components/ui/select.tsx +29 -29
  646. package/dist/dashboard-runtime/dashboard/src/components/ui/separator.tsx +10 -10
  647. package/dist/dashboard-runtime/dashboard/src/components/ui/sheet.tsx +11 -4
  648. package/dist/dashboard-runtime/dashboard/src/components/ui/skeleton.tsx +11 -11
  649. package/dist/dashboard-runtime/dashboard/src/components/ui/sonner.tsx +7 -7
  650. package/dist/dashboard-runtime/dashboard/src/components/ui/stat-card.tsx +14 -11
  651. package/dist/dashboard-runtime/dashboard/src/components/ui/switch.tsx +8 -3
  652. package/dist/dashboard-runtime/dashboard/src/components/ui/table.tsx +27 -24
  653. package/dist/dashboard-runtime/dashboard/src/components/ui/tabs.tsx +14 -14
  654. package/dist/dashboard-runtime/dashboard/src/components/ui/textarea.tsx +7 -7
  655. package/dist/dashboard-runtime/dashboard/src/components/ui/toggle-group.tsx +27 -22
  656. package/dist/dashboard-runtime/dashboard/src/components/ui/tooltip.tsx +10 -10
  657. package/dist/dashboard-runtime/dashboard/src/components/ui/usage-card.tsx +11 -8
  658. package/dist/dashboard-runtime/dashboard/src/config/navigation.ts +25 -21
  659. package/dist/dashboard-runtime/dashboard/src/contexts/subspace-context.tsx +1 -1
  660. package/dist/dashboard-runtime/dashboard/src/hooks/use-apply-dream-actions.ts +1 -4
  661. package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +33 -13
  662. package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-last-config.ts +3 -1
  663. package/dist/dashboard-runtime/dashboard/src/hooks/use-create-api-key.ts +4 -2
  664. package/dist/dashboard-runtime/dashboard/src/hooks/use-create-memory-store.ts +2 -1
  665. package/dist/dashboard-runtime/dashboard/src/hooks/use-delete-custom-policy.ts +1 -4
  666. package/dist/dashboard-runtime/dashboard/src/hooks/use-document.ts +2 -1
  667. package/dist/dashboard-runtime/dashboard/src/hooks/use-documents.ts +8 -2
  668. package/dist/dashboard-runtime/dashboard/src/hooks/use-dream-actions.ts +2 -1
  669. package/dist/dashboard-runtime/dashboard/src/hooks/use-dream-task.ts +4 -5
  670. package/dist/dashboard-runtime/dashboard/src/hooks/use-dream-tasks.ts +96 -13
  671. package/dist/dashboard-runtime/dashboard/src/hooks/use-file-memory.ts +50 -0
  672. package/dist/dashboard-runtime/dashboard/src/hooks/use-instances.ts +42 -11
  673. package/dist/dashboard-runtime/dashboard/src/hooks/use-locale-revalidation.ts +34 -0
  674. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-requests.ts +7 -2
  675. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-unit.ts +3 -2
  676. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-units.ts +3 -2
  677. package/dist/dashboard-runtime/dashboard/src/hooks/use-oss-import.ts +18 -4
  678. package/dist/dashboard-runtime/dashboard/src/hooks/use-oss-list.ts +3 -3
  679. package/dist/dashboard-runtime/dashboard/src/hooks/use-qa-chat.ts +32 -21
  680. package/dist/dashboard-runtime/dashboard/src/hooks/use-subspace-history.ts +5 -2
  681. package/dist/dashboard-runtime/dashboard/src/hooks/use-update-document.ts +4 -1
  682. package/dist/dashboard-runtime/dashboard/src/hooks/use-update-memory-store.ts +2 -1
  683. package/dist/dashboard-runtime/dashboard/src/hooks/use-upload-documents.ts +6 -1
  684. package/dist/dashboard-runtime/dashboard/src/i18n/config.ts +46 -0
  685. package/dist/dashboard-runtime/dashboard/src/i18n/dictionaries.ts +8 -0
  686. package/dist/dashboard-runtime/dashboard/src/i18n/i18n-context.tsx +198 -0
  687. package/dist/dashboard-runtime/dashboard/src/i18n/locales/en.ts +1969 -0
  688. package/dist/dashboard-runtime/dashboard/src/i18n/locales/zh.ts +1857 -0
  689. package/dist/dashboard-runtime/dashboard/src/lib/api-error-toast.ts +2 -1
  690. package/dist/dashboard-runtime/dashboard/src/lib/chat-dream-deposit.ts +14 -0
  691. package/dist/dashboard-runtime/dashboard/src/lib/chat-message-ops.ts +4 -1
  692. package/dist/dashboard-runtime/dashboard/src/lib/dream-kb/filename.ts +13 -0
  693. package/dist/dashboard-runtime/dashboard/src/lib/dream-kb/format.ts +79 -0
  694. package/dist/dashboard-runtime/dashboard/src/lib/dream-kb/hash.ts +6 -0
  695. package/dist/dashboard-runtime/dashboard/src/lib/dream-kb/scope.ts +37 -0
  696. package/dist/dashboard-runtime/dashboard/src/lib/dream-kb/types.ts +25 -0
  697. package/dist/dashboard-runtime/dashboard/src/lib/extension-filter.ts +8 -3
  698. package/dist/dashboard-runtime/dashboard/src/lib/file-tree.ts +100 -0
  699. package/dist/dashboard-runtime/dashboard/src/lib/format-datetime.ts +56 -0
  700. package/dist/dashboard-runtime/dashboard/src/lib/glob-filter.ts +10 -4
  701. package/dist/dashboard-runtime/dashboard/src/lib/memory-storage-mode.ts +68 -0
  702. package/dist/dashboard-runtime/dashboard/src/lib/memory.ts +116 -14
  703. package/dist/dashboard-runtime/dashboard/src/lib/metadata-form.ts +4 -1
  704. package/dist/dashboard-runtime/dashboard/src/lib/number-input-handler.ts +1 -1
  705. package/dist/dashboard-runtime/dashboard/src/lib/oss-selection.ts +3 -1
  706. package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +26 -4
  707. package/dist/dashboard-runtime/dashboard/src/lib/server/api-helpers.ts +2 -1
  708. package/dist/dashboard-runtime/dashboard/src/lib/server/dream-kb-sync.ts +139 -0
  709. package/dist/dashboard-runtime/dashboard/src/lib/server/ims-client.ts +8 -11
  710. package/dist/dashboard-runtime/dashboard/src/lib/server/llm-client.ts +5 -5
  711. package/dist/dashboard-runtime/dashboard/src/lib/server/llm-crypto.ts +1 -5
  712. package/dist/dashboard-runtime/dashboard/src/lib/server/oss-client.ts +9 -2
  713. package/dist/dashboard-runtime/dashboard/src/lib/server/ram-client.ts +13 -4
  714. package/dist/dashboard-runtime/dashboard/src/lib/server/runtime-context.ts +6 -10
  715. package/dist/dashboard-runtime/dashboard/src/lib/server/sdk-client.ts +25 -8
  716. package/dist/dashboard-runtime/dashboard/src/providers/query-provider.tsx +5 -5
  717. package/dist/dashboard-runtime/dashboard/src/providers/runtime-context-provider.tsx +26 -7
  718. package/dist/dashboard-runtime/dashboard/src/providers/theme-provider.tsx +6 -3
  719. package/dist/dashboard-runtime/dashboard/src/schemas/instance.ts +82 -13
  720. package/dist/dashboard-runtime/dashboard/src/schemas/knowledge-base.ts +42 -21
  721. package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +8 -3
  722. package/dist/dashboard-runtime/dashboard/src/schemas/retrieval.ts +2 -6
  723. package/dist/dashboard-runtime/dashboard/src/services/api-client.ts +31 -32
  724. package/dist/dashboard-runtime/dashboard/src/services/api-keys.ts +4 -2
  725. package/dist/dashboard-runtime/dashboard/src/services/auth.ts +1 -1
  726. package/dist/dashboard-runtime/dashboard/src/services/chunks.ts +4 -4
  727. package/dist/dashboard-runtime/dashboard/src/services/documents.ts +16 -12
  728. package/dist/dashboard-runtime/dashboard/src/services/file-memory.ts +63 -0
  729. package/dist/dashboard-runtime/dashboard/src/services/knowledge-base.ts +16 -8
  730. package/dist/dashboard-runtime/dashboard/src/services/memory.ts +64 -29
  731. package/dist/dashboard-runtime/dashboard/src/services/oss.ts +6 -6
  732. package/dist/dashboard-runtime/dashboard/src/services/retrieval.ts +2 -2
  733. package/dist/dashboard-runtime/dashboard/src/types/instance.ts +10 -2
  734. package/dist/dashboard-runtime/dashboard/src/types/knowledge-base.ts +3 -7
  735. package/dist/dashboard-runtime/dashboard/src/types/llm-chat.ts +27 -0
  736. package/dist/dashboard-runtime/dashboard/src/types/memory.ts +29 -9
  737. package/dist/dashboard-runtime/dashboard/tsconfig.json +3 -11
  738. package/dist/dashboard-runtime/dashboard/vitest.config.mjs +1 -4
  739. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts +153 -0
  740. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts.map +1 -0
  741. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js +451 -0
  742. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js.map +1 -0
  743. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +2 -1
  744. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
  745. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +2 -1
  746. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
  747. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.d.ts +25 -0
  748. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.d.ts.map +1 -0
  749. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.js +29 -0
  750. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.js.map +1 -0
  751. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/managed-section-writer.d.ts.map +1 -1
  752. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/managed-section-writer.js +2 -1
  753. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/managed-section-writer.js.map +1 -1
  754. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +16 -0
  755. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  756. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +74 -8
  757. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  758. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-oss.d.ts.map +1 -1
  759. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-oss.js +2 -6
  760. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-oss.js.map +1 -1
  761. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-ots.d.ts.map +1 -1
  762. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-ots.js +15 -9
  763. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-ots.js.map +1 -1
  764. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +8 -0
  765. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  766. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +23 -7
  767. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  768. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  769. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +7 -3
  770. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  771. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/sdk-pagination.d.ts.map +1 -1
  772. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/sdk-pagination.js.map +1 -1
  773. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  774. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/config.d.ts.map +1 -1
  775. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/config.js +26 -9
  776. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/config.js.map +1 -1
  777. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/constants.d.ts +9 -1
  778. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/constants.d.ts.map +1 -1
  779. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js +18 -0
  780. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js.map +1 -1
  781. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/errors.d.ts.map +1 -1
  782. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/errors.js.map +1 -1
  783. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.d.ts.map +1 -1
  784. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js +12 -4
  785. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js.map +1 -1
  786. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  787. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +9 -0
  788. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  789. package/dist/main.d.ts.map +1 -1
  790. package/dist/main.js +1 -1
  791. package/dist/main.js.map +1 -1
  792. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts +153 -0
  793. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts.map +1 -0
  794. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js +451 -0
  795. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js.map +1 -0
  796. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +2 -1
  797. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
  798. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +2 -1
  799. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
  800. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.d.ts +25 -0
  801. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.d.ts.map +1 -0
  802. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.js +29 -0
  803. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/auth-options.js.map +1 -0
  804. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/managed-section-writer.d.ts.map +1 -1
  805. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/managed-section-writer.js +2 -1
  806. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/managed-section-writer.js.map +1 -1
  807. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +16 -0
  808. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  809. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +74 -8
  810. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  811. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-oss.d.ts.map +1 -1
  812. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-oss.js +2 -6
  813. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-oss.js.map +1 -1
  814. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-ots.d.ts.map +1 -1
  815. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-ots.js +15 -9
  816. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/managed-ots.js.map +1 -1
  817. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +8 -0
  818. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  819. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +23 -7
  820. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  821. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  822. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +7 -3
  823. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  824. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/sdk-pagination.d.ts.map +1 -1
  825. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/sdk-pagination.js.map +1 -1
  826. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  827. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/config.d.ts.map +1 -1
  828. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/config.js +26 -9
  829. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/config.js.map +1 -1
  830. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/constants.d.ts +9 -1
  831. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/constants.d.ts.map +1 -1
  832. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js +18 -0
  833. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/constants.js.map +1 -1
  834. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/errors.d.ts.map +1 -1
  835. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/errors.js.map +1 -1
  836. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.d.ts.map +1 -1
  837. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js +12 -4
  838. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/logging.js.map +1 -1
  839. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  840. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts +9 -0
  841. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  842. package/dist/output.d.ts.map +1 -1
  843. package/dist/output.js +3 -1
  844. package/dist/output.js.map +1 -1
  845. package/dist/scanner.d.ts.map +1 -1
  846. package/dist/scanner.js.map +1 -1
  847. package/dist/utils/parse-int-arg.d.ts.map +1 -1
  848. package/dist/utils/parse-int-arg.js.map +1 -1
  849. package/dist/utils/read-image-input.d.ts.map +1 -1
  850. package/dist/utils/read-image-input.js +8 -1
  851. package/dist/utils/read-image-input.js.map +1 -1
  852. package/package.json +3 -3
  853. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0--nu07._.js +0 -3
  854. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.gylau._.js +0 -3
  855. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.hvkwy._.js +0 -3
  856. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.qtdn4._.js +0 -3
  857. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02p1x3t._.js +0 -3
  858. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__03og44p._.js +0 -3
  859. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04dd04u._.js +0 -3
  860. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04ujbw-._.js +0 -3
  861. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04zbudf._.js +0 -3
  862. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05eryp~._.js +0 -3
  863. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06fva9g._.js +0 -3
  864. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08_2avk._.js +0 -3
  865. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0acvvri._.js +0 -3
  866. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0byveuc._.js +0 -3
  867. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cee_lo._.js +0 -3
  868. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cyd2qb._.js +0 -3
  869. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ecs-9r._.js +0 -3
  870. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ejcow5._.js +0 -3
  871. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0es0s_~._.js +0 -3
  872. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0fglxiw._.js +0 -3
  873. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0g3yw6w._.js +0 -3
  874. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0i1_p1s._.js +0 -3
  875. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0is6qso._.js +0 -3
  876. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0no9qm0._.js +0 -3
  877. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q8vcw8._.js +0 -3
  878. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q9fgt6._.js +0 -3
  879. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0rx9hon._.js +0 -3
  880. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0tc-.6s._.js +0 -3
  881. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0u03tze._.js +0 -3
  882. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ua_nqs._.js +0 -3
  883. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0uebf40._.js +0 -3
  884. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0v0il3n._.js +0 -3
  885. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0w_ig2a._.js +0 -3
  886. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zmo~nd._.js +0 -3
  887. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__10m-wmo._.js +0 -3
  888. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11s_zx6._.js +0 -3
  889. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11wq90l._.js +0 -3
  890. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__126srko._.js +0 -3
  891. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12e1t6o._.js +0 -3
  892. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12ylr4n._.js +0 -3
  893. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13g_f9w._.js +0 -3
  894. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13q2wbt._.js +0 -3
  895. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13~-fxp._.js +0 -3
  896. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0p91_next_dist_shared_lib_deployment-id_0uu7yq4.js +0 -3
  897. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__04.tmw0._.js +0 -3
  898. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__077~9kz._.js +0 -3
  899. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07fra.0._.js +0 -3
  900. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0jhpb-b._.js +0 -3
  901. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0st_2qm._.js +0 -3
  902. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_03cxnik._.js +0 -3
  903. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_078ekb~._.js +0 -3
  904. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_09aiggd._.js +0 -3
  905. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jl78rk._.js +0 -3
  906. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0njimsl._.js +0 -3
  907. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0nmv74v._.js +0 -3
  908. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0oxv61l._.js +0 -3
  909. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0pe9ntc._.js +0 -3
  910. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0q43l7g._.js +0 -3
  911. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0q748rf._.js +0 -3
  912. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0qptqwe._.js +0 -3
  913. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tej2s.._.js +0 -3
  914. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0tjamu1._.js +0 -3
  915. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0u4elhp._.js +0 -3
  916. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0wwhklq._.js +0 -3
  917. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ytd66u._.js +0 -3
  918. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0~5g0_a._.js +0 -3
  919. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0~dbpb0._.js +0 -3
  920. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_10.40pj._.js +0 -3
  921. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13w6ksc._.js +0 -3
  922. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00ofp7q._.js +0 -3
  923. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_065m1.j._.js +0 -3
  924. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0l1.0wg._.js +0 -3
  925. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0xf3ffa._.js +0 -3
  926. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_settings_page_tsx_0y26.xu._.js +0 -3
  927. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-0n226yihtlx.js +0 -138
  928. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-rnnjxuu_5.s.js +0 -1
  929. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.q0rms~bxru_.js +0 -1
  930. package/dist/dashboard-runtime/dashboard/.next/static/chunks/03~amszcayft9.js +0 -1
  931. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05oy7c8~k0-nu.js +0 -1
  932. package/dist/dashboard-runtime/dashboard/.next/static/chunks/06e08s6_aj5tb.js +0 -1
  933. package/dist/dashboard-runtime/dashboard/.next/static/chunks/06gfzt_e-w-f~.js +0 -1
  934. package/dist/dashboard-runtime/dashboard/.next/static/chunks/076wjt8-f7ws0.js +0 -1
  935. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07brna0jsz4vi.js +0 -1
  936. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08c211p60po58.js +0 -1
  937. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08ix0ia65i20b.js +0 -9
  938. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09fuq3fiw1zq8.js +0 -138
  939. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09pa80gils3r2.js +0 -1
  940. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0axe89r5c7p_b.js +0 -1
  941. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0czi-68m5cma3.js +0 -1
  942. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0draec5luxua1.js +0 -1
  943. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ezfzygzl1hw8.css +0 -1
  944. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0f60fxsrh4wbq.js +0 -5
  945. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0gqhfku~on4t1.js +0 -1
  946. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0i_66eb3teu-..js +0 -1
  947. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ipb.__efc0i7.js +0 -1
  948. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0oxr1t3cp8_9f.js +0 -1
  949. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0p7-v~ggg-k3s.js +0 -1
  950. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pyte4aize4vw.js +0 -1
  951. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0qann4-pg7heu.js +0 -1
  952. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0qzs7r4p4hd2~.js +0 -1
  953. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ro5-~k1_6.ji.js +0 -4
  954. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0t.fmi5danjtx.js +0 -1
  955. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ty--w57-5n5f.js +0 -1
  956. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6g.bq1prqh8.js +0 -1
  957. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0w1f765.797w7.js +0 -1
  958. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0wl~ofl4qn1yv.js +0 -1
  959. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0xnm11dm1-qw2.js +0 -1
  960. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yduro1k88.mk.js +0 -1
  961. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yqx-vizpechs.js +0 -1
  962. package/dist/dashboard-runtime/dashboard/.next/static/chunks/10oar3if2rs8f.js +0 -1
  963. package/dist/dashboard-runtime/dashboard/.next/static/chunks/11fppb7wskgrx.js +0 -1
  964. package/dist/dashboard-runtime/dashboard/.next/static/chunks/1211es3l12jpn.js +0 -1
  965. package/dist/dashboard-runtime/dashboard/.next/static/chunks/12ju37ebul3bw.js +0 -1
  966. package/dist/dashboard-runtime/dashboard/.next/static/chunks/137epx7vazn1v.js +0 -1
  967. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16z7~ksa815uh.js +0 -1
  968. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17l3ij7h2.vna.js +0 -1
  969. /package/dist/dashboard-runtime/dashboard/.next/static/{-pCWSBA7OQIF0pN0Rem9H → be0fa_T3EkD9v2fJGsvLd}/_buildManifest.js +0 -0
  970. /package/dist/dashboard-runtime/dashboard/.next/static/{-pCWSBA7OQIF0pN0Rem9H → be0fa_T3EkD9v2fJGsvLd}/_clientMiddlewareManifest.js +0 -0
  971. /package/dist/dashboard-runtime/dashboard/.next/static/{-pCWSBA7OQIF0pN0Rem9H → be0fa_T3EkD9v2fJGsvLd}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[722424,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(163426),e=a.i(25825),f=a.i(750053);let g=(0,f.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var h=a.i(776192),i=a.i(604395),j=a.i(310215),k=a.i(502482),l=a.i(263265),m=a.i(342210);let n=(0,f.default)("brain-circuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);var o=a.i(881619);let p=(0,f.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var q=a.i(655295),r=a.i(223301),s=a.i(674024),t=a.i(521989),u=a.i(865271),v=a.i(933596),w=a.i(895487),x=a.i(353141);async function y(){return(await (0,x.apiGet)("/api/v1/api-keys")).apiKeys}async function z(a){let b={};return a?.serviceCredentialName&&(b.serviceCredentialName=a.serviceCredentialName),a?.credentialAgeDays&&a.credentialAgeDays>0&&(b.credentialAgeDays=a.credentialAgeDays),(await (0,x.apiPost)("/api/v1/api-keys",Object.keys(b).length>0?b:void 0)).apiKey}async function A(a){await (0,x.apiDelete)(`/api/v1/api-keys/${encodeURIComponent(a.serviceCredentialId)}`,{userPrincipalName:a.userPrincipalName,deleteCustomPolicy:a.deleteCustomPolicy??!0,deleteRamUser:a.deleteRamUser??!0})}async function B(a){await (0,x.apiPatch)(`/api/v1/api-keys/${encodeURIComponent(a.serviceCredentialId)}`,{userPrincipalName:a.userPrincipalName,status:a.status})}async function C(a,b){return(await (0,x.apiGet)(`/api/v1/api-keys/${encodeURIComponent(a)}/policies?userName=${encodeURIComponent(b)}`)).policies}async function D(a,b){await (0,x.apiPost)(`/api/v1/api-keys/${encodeURIComponent(a)}/policies`,b)}async function E(a,b){await (0,x.apiDelete)(`/api/v1/api-keys/${encodeURIComponent(a)}/policies`,b)}async function F(a,b){return(0,x.apiGet)(`/api/v1/api-keys/${encodeURIComponent(a)}/custom-policy?userName=${encodeURIComponent(b)}`)}async function G(a,b){await (0,x.apiPut)(`/api/v1/api-keys/${encodeURIComponent(a)}/custom-policy`,b)}async function H(a,b){return(0,x.apiGet)(`/api/v1/api-keys/${encodeURIComponent(a)}/effective-permissions?userName=${encodeURIComponent(b)}`)}async function I(a){let b=new URLSearchParams({resourceType:a.resourceType,resourceName:a.resourceName,operationGroup:a.operationGroup});return(0,x.apiGet)(`/api/v1/api-keys/filter-by-permission?${b.toString()}`)}async function J(a,b){await (0,x.apiDelete)(`/api/v1/api-keys/${encodeURIComponent(a)}/custom-policy`,b)}var K=a.i(225377),L=a.i(983366),M=a.i(739096);function N(a,b){let{context:c,ready:d}=(0,M.useRuntimeContext)();return(0,L.useQuery)({queryKey:K.queryKeys.effectivePermissions(c.dataScopeKey,a??""),queryFn:()=>H(a,b),enabled:d&&!!a&&!!b,staleTime:15e3})}function O({apiKeys:a,onDelete:c,onDetail:d}){return(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--border))]",children:(0,b.jsxs)(r.Table,{children:[(0,b.jsx)(r.TableHeader,{children:(0,b.jsxs)(r.TableRow,{children:[(0,b.jsx)(r.TableHead,{children:"凭证名称"}),(0,b.jsx)(r.TableHead,{className:"w-[8rem]",children:"状态"}),(0,b.jsx)(r.TableHead,{children:"可访问知识库"}),(0,b.jsx)(r.TableHead,{children:"可访问记忆库"}),(0,b.jsx)(r.TableHead,{className:"w-[10rem]",children:"创建时间"}),(0,b.jsx)(r.TableHead,{className:"w-[11rem] text-right",children:"操作"})]})}),(0,b.jsx)(r.TableBody,{children:a.map(a=>(0,b.jsx)(P,{apiKey:a,onDelete:c,onDetail:d},a.serviceCredentialId))})]})})}function P({apiKey:a,onDelete:d,onDetail:e}){let f,g=(f=(0,w.useQueryClient)(),(0,v.useMutation)({mutationFn:a=>B(a),onSuccess:()=>{(0,K.invalidateApiKeyQueries)(f)}})),[i,j]=(0,c.useState)(null),k=i??"Active"===a.status,m=Number.isFinite(Date.parse(a.createTime))?Date.parse(a.createTime):null;async function n(b){j(b);try{await g.mutateAsync({serviceCredentialId:a.serviceCredentialId,userPrincipalName:a.userPrincipalName,status:b?"Active":"Inactive"}),l.toast.success(b?"已启用":"已禁用")}catch(a){j(null),l.toast.error(a instanceof Error?a.message:"操作失败")}}return(0,b.jsxs)(r.TableRow,{className:"cursor-pointer",onClick:()=>e(a),children:[(0,b.jsx)(r.TableCell,{children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:a.serviceCredentialName}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.userPrincipalName})]})}),(0,b.jsx)(r.TableCell,{onClick:a=>a.stopPropagation(),children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(s.Switch,{checked:k,onCheckedChange:n,disabled:g.isPending,"aria-label":k?"禁用":"启用"}),(0,b.jsx)("span",{className:k?"text-xs font-medium text-success":"text-xs font-medium text-muted-foreground",children:g.isPending?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}),"切换中"]}):k?"Active":"Inactive"})]})}),(0,b.jsx)(r.TableCell,{onClick:a=>a.stopPropagation(),children:(0,b.jsx)(Q,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,resourceType:"knowledgebase"})}),(0,b.jsx)(r.TableCell,{onClick:a=>a.stopPropagation(),children:(0,b.jsx)(Q,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,resourceType:"memorystore"})}),(0,b.jsx)(r.TableCell,{children:m?(0,b.jsx)(u.RelativeTime,{timestamp:m}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"—"})}),(0,b.jsxs)(r.TableCell,{className:"text-right",children:[(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"h-8",onClick:b=>{b.stopPropagation(),e(a)},children:[(0,b.jsx)(p,{className:"mr-1 h-3.5 w-3.5"}),"权限"]}),(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:`h-8 text-[hsl(var(--destructive))] hover:bg-[hsl(var(--destructive))/0.08] hover:text-[hsl(var(--destructive))] ${k?"opacity-50 cursor-not-allowed":""}`,onClick:b=>{b.stopPropagation(),k?l.toast.info("请先禁用再删除"):d(a)},children:[(0,b.jsx)(q.Trash2,{className:"mr-1 h-3.5 w-3.5"}),"删除"]})]})]})}function Q({serviceCredentialId:a,userName:c,resourceType:d}){let{data:e,isLoading:f,isError:g}=N(a,c);if(f)return(0,b.jsx)(o.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"});if(g)return(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"—"});let h=(e?.resources?.filter(a=>a.resourceType===d)??[]).filter(a=>a.permissions.read||a.permissions.write||a.permissions.manage);if(0===h.length)return(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"无"});let i="knowledgebase"===d?m.BookOpen:n;return(0,b.jsx)("div",{className:"flex flex-wrap gap-1",children:h.map(a=>(0,b.jsxs)(t.Badge,{variant:"secondary",className:"gap-1 text-[11px] font-normal",children:[(0,b.jsx)(i,{className:"h-3 w-3"}),a.resourceName]},a.resourceName))})}var R=a.i(637102),S=a.i(172518),T=a.i(962491),U=a.i(843836);function V({open:a,onOpenChange:d,onCreated:e}){let f,g=(f=(0,w.useQueryClient)(),(0,v.useMutation)({mutationFn:a=>z(a),onSuccess:()=>{(0,K.invalidateApiKeyQueries)(f)}})),[i,j]=(0,c.useState)(""),[k,m]=(0,c.useState)("");async function n(){let a=i.trim();if(!a)return void l.toast.error("凭证名称不能为空");let b=k?Number(k):void 0;if(void 0!==b&&(b<1||b>365||!Number.isInteger(b)))return void l.toast.error("过期天数需为 1~365 的整数");try{let c=await g.mutateAsync({serviceCredentialName:a,credentialAgeDays:b});d(!1),e(c)}catch(a){l.toast.error(a instanceof Error?a.message:"创建失败")}}return(0,c.useEffect)(()=>{a&&(j("ots_apikey_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,6)),m(""))},[a]),(0,b.jsx)(U.Dialog,{open:a,onOpenChange:a=>{d(a)},children:(0,b.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(U.DialogHeader,{children:(0,b.jsx)(U.DialogTitle,{className:"text-xl",children:"新建 API Key"})}),(0,b.jsxs)("div",{className:"space-y-3 py-1 text-sm leading-relaxed text-muted-foreground",children:[(0,b.jsxs)("p",{children:["将为当前 AccessKey 所属账号创建一个 ServiceName ="," ",(0,b.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:"ots.aliyuncs.com"})," ","的服务凭证。"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-foreground",children:"凭证名称"}),(0,b.jsx)(S.Input,{value:i,onChange:a=>j(a.target.value),placeholder:"输入凭证名称",className:"h-9"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"用于标识凭证用途,支持自定义或使用默认随机值"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-foreground",children:"过期天数(可选)"}),(0,b.jsx)(S.Input,{type:"number",min:1,max:365,value:k,onChange:a=>m(a.target.value),placeholder:"留空表示不过期",className:"h-9"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"设置后凭证将在指定天数后自动失效(1~365 天)"})]}),(0,b.jsx)("div",{className:"rounded-md border border-[hsl(var(--warning))/0.5] bg-[hsl(var(--warning))/0.08] px-4 py-3 text-sm",children:(0,b.jsxs)("p",{className:"text-foreground",children:[(0,b.jsx)(R.AlertTriangle,{className:"mr-1 -mt-0.5 inline h-4 w-4 text-warning"}),"AccessKeySecret 仅在本次创建后展示一次,关闭后无法再次取回,请提前准备好保存途径。"]})})]}),(0,b.jsxs)(U.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>d(!1),disabled:g.isPending,children:"取消"}),(0,b.jsx)(h.Button,{onClick:n,disabled:g.isPending,children:g.isPending?"创建中...":"确认创建"})]})]})})}var W=a.i(36890);function X({apiKey:a,open:d,onOpenChange:e}){let f,g=(f=(0,w.useQueryClient)(),(0,v.useMutation)({mutationFn:a=>A(a),onSuccess:()=>{(0,K.invalidateApiKeyQueries)(f)}})),[i,j]=(0,c.useState)(!0),[k,m]=(0,c.useState)(!0);async function n(){if(a)try{await g.mutateAsync({serviceCredentialId:a.serviceCredentialId,userPrincipalName:a.userPrincipalName,deleteCustomPolicy:i,deleteRamUser:k}),l.toast.success("已删除 API Key"),e(!1)}catch(a){l.toast.error(a instanceof Error?a.message:"删除失败")}}return(0,c.useEffect)(()=>{d&&(j(!0),m(!0))},[d]),(0,b.jsx)(U.Dialog,{open:d,onOpenChange:e,children:(0,b.jsxs)(U.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(U.DialogHeader,{children:(0,b.jsx)(U.DialogTitle,{className:"text-xl",children:"删除 API Key"})}),(0,b.jsxs)("div",{className:"rounded-md border border-[hsl(var(--destructive))] bg-[hsl(var(--destructive))/0.06] px-4 py-3 text-sm leading-relaxed",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)(R.AlertTriangle,{className:"mr-1 -mt-0.5 inline h-4 w-4 text-destructive"}),"此操作不可撤销。删除后正在使用该凭证的应用会立即失败鉴权。"]}),a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"mt-3",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"凭证名称:"}),(0,b.jsx)("code",{className:"font-mono text-xs",children:a.serviceCredentialName})]}),"Active"===a.status?(0,b.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"该凭证当前为启用状态,删除前会自动禁用。"}):null]}):null]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"同时清理以下关联资源:"}),(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)(W.Checkbox,{checked:i,onCheckedChange:a=>j(!!a),className:"mt-0.5"}),(0,b.jsxs)("div",{children:[(0,b.jsx)(T.Label,{className:"text-sm cursor-pointer",children:"删除自定义权限策略"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"删除该凭证关联的自定义 RAM 策略(ts-apikey-*)。Bearer Token 鉴权策略不会被删除。"})]})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)(W.Checkbox,{checked:k,onCheckedChange:a=>m(!!a),className:"mt-0.5"}),(0,b.jsxs)("div",{children:[(0,b.jsx)(T.Label,{className:"text-sm cursor-pointer",children:"删除 RAM 用户"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"删除该凭证对应的 RAM 子用户及其所有已挂载策略。如果该用户下还有其他服务凭证,请勿勾选。"})]})]})]}),(0,b.jsxs)(U.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>e(!1),disabled:g.isPending,children:"取消"}),(0,b.jsx)(h.Button,{variant:"destructive",disabled:g.isPending,onClick:n,children:g.isPending?"删除中...":"确认删除"})]})]})})}var Y=a.i(16772),Z=a.i(770550),$=a.i(109734);async function _(a){if(navigator.clipboard&&window.isSecureContext)return void await navigator.clipboard.writeText(a);let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}function aa(){let a=(0,w.useQueryClient)();return(0,v.useMutation)({mutationFn:a=>D(a.serviceCredentialId,{userName:a.userName,policyName:a.policyName,policyType:a.policyType}),onSuccess:()=>{(0,K.invalidateApiKeyPolicyQueries)(a),(0,K.invalidateEffectivePermissionsQueries)(a)}})}function ab(){let a=(0,w.useQueryClient)();return(0,v.useMutation)({mutationFn:a=>E(a.serviceCredentialId,{userName:a.userName,policyName:a.policyName,policyType:a.policyType}),onSuccess:()=>{(0,K.invalidateApiKeyPolicyQueries)(a),(0,K.invalidateEffectivePermissionsQueries)(a)}})}let ac="ts-ots-bearer-token-access";function ad({serviceCredentialId:a,userName:d,policies:e}){let f=aa(),g=ab(),[h,i]=(0,c.useState)(!1),j=e?.some(a=>a.policyName===ac)??!1;async function k(b){i(!0);try{b?(await f.mutateAsync({serviceCredentialId:a,userName:d,policyName:ac,policyType:"Custom"}),l.toast.success("已启用 Bearer Token 鉴权")):(await g.mutateAsync({serviceCredentialId:a,userName:d,policyName:ac,policyType:"Custom"}),l.toast.success("已禁用 Bearer Token 鉴权"))}catch(a){l.toast.error(a instanceof Error?a.message:"操作失败")}finally{i(!1)}}return(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-[hsl(var(--border))] px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:"Bearer Token 鉴权"}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:"允许使用该 API Key 作为 Bearer Token 访问 OTS 服务(ots:CallWithBearerToken)"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0 ml-3",children:[h?(0,b.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):null,(0,b.jsx)(s.Switch,{checked:j,onCheckedChange:k,disabled:h||!e})]})]})}var ae=a.i(147845),af=a.i(112537);let ag=(0,f.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var ah=a.i(663525),ai=a.i(909367),aj=a.i(610220),ak=a.i(421347);let al=["ots:DescribeKnowledgeBase","ots:ListKnowledgeBase","ots:GetDocument","ots:ListDocuments","ots:ListChunks","ots:Retrieve"],am=["ots:AddDocuments","ots:UpdateDocument","ots:UpdateChunks","ots:DeleteDocuments","ots:UploadDocuments"],an=["ots:CreateKnowledgeBase","ots:DeleteKnowledgeBase","ots:UpdateKnowledgeBase"],ao=["ots:GetMemoryStore","ots:ListMemoryStores","ots:SearchMemories","ots:ListMemories","ots:GetMemory","ots:ListMemoryStoreMessages","ots:ListMemoryStoreRequests","ots:ListMemoryStoreScopes","ots:GetMemoryTask","ots:ListMemoryTasks","ots:GetMemoryDreamTask","ots:ListMemoryDreamTasks","ots:ListMemoryDreamActions"],ap=["ots:AddMemories","ots:UpdateMemory","ots:DeleteMemory","ots:ApplyMemoryDreamActions","ots:CreateMemoryDreamTask","ots:CancelMemoryDreamTask"],aq=["ots:CreateMemoryStore","ots:DeleteMemoryStore","ots:UpdateMemoryStore"];function ar(a,b){return"knowledgebase"===a?"read"===b?al:"write"===b?am:an:"read"===b?ao:"write"===b?ap:aq}[...al,...am,...an],[...ao,...ap,...aq];let as={read:"读取",write:"写入",manage:"管理"},at={knowledgebase:{read:"查询知识库、文档、分片、检索",write:"添加、更新、删除文档和分片",manage:"创建、删除、更新知识库"},memorystore:{read:"查询记忆库、搜索记忆、查看消息和请求日志",write:"添加、更新、删除记忆,管理整理任务",manage:"创建、删除、更新记忆库"}};function au(a){return[a.appId??"",a.tenantId??"",a.agentId??"",a.runId??""].join("|")}function av({open:a,onOpenChange:d,onSave:e,initial:f}){let[g,i]=(0,c.useState)(f?.resourceType??"knowledgebase"),[j,k]=(0,c.useState)(f?.resourceName??"*"),[l,n]=(0,c.useState)(new Set(f?.operationGroups??["read"])),[p,q]=(0,c.useState)(f?.scope??{}),[r,s]=(0,c.useState)(f?.condition?.sourceIp?.join(", ")??""),[t,u]=(0,c.useState)(!!(f?.scope&&(f.scope.appId||f.scope.tenantId||f.scope.agentId||f.scope.runId))),[v,w]=(0,c.useState)("manual"),{data:x}=(0,ai.useKnowledgeBases)(),{data:y}=(0,aj.useMemoryStores)(),z=a&&"memorystore"===g&&"*"!==j&&t,{data:A,isLoading:B}=(0,L.useQuery)({queryKey:["memory-store-scopes-for-rule",j],queryFn:()=>(0,ak.listMemoryStoreScopesUnfiltered)(j),enabled:z,staleTime:3e4}),C=A?.items??[];(0,c.useEffect)(()=>{a&&(i(f?.resourceType??"knowledgebase"),k(f?.resourceName??"*"),n(new Set(f?.operationGroups??["read"])),q(f?.scope??{}),s(f?.condition?.sourceIp?.join(", ")??""),u(!!(f?.scope&&(f.scope.appId||f.scope.tenantId||f.scope.agentId||f.scope.runId))),w("manual"))},[a,f]);let D="knowledgebase"===g?(x?.items??[]).map(a=>a.knowledgeBaseName):(y?.items??[]).map(a=>a.memoryStoreName);return(0,b.jsx)(U.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(U.DialogContent,{className:"sm:max-w-lg max-h-[85vh] overflow-y-auto",children:[(0,b.jsx)(U.DialogHeader,{children:(0,b.jsx)(U.DialogTitle,{children:f?"编辑规则":"添加权限规则"})}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-muted-foreground",children:"资源类型"}),(0,b.jsxs)(ah.Select,{value:g,onValueChange:a=>{i(a),k("*"),u(!1),q({})},children:[(0,b.jsx)(ah.SelectTrigger,{children:(0,b.jsx)(ah.SelectValue,{})}),(0,b.jsxs)(ah.SelectContent,{children:[(0,b.jsx)(ah.SelectItem,{value:"knowledgebase",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(m.BookOpen,{className:"h-3.5 w-3.5"}),"知识库"]})}),(0,b.jsx)(ah.SelectItem,{value:"memorystore",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(ae.Brain,{className:"h-3.5 w-3.5"}),"记忆库"]})})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-muted-foreground",children:"资源名称"}),(0,b.jsxs)(ah.Select,{value:j,onValueChange:a=>{k(a),u(!1),q({})},children:[(0,b.jsx)(ah.SelectTrigger,{children:(0,b.jsx)(ah.SelectValue,{})}),(0,b.jsxs)(ah.SelectContent,{children:[(0,b.jsxs)(ah.SelectItem,{value:"*",children:["全部","knowledgebase"===g?"知识库":"记忆库"]}),D.map(a=>(0,b.jsx)(ah.SelectItem,{value:a,children:a},a))]})]})]}),"memorystore"===g&&"*"!==j&&(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(W.Checkbox,{checked:t,onCheckedChange:a=>{u(!!a),a||q({})}}),(0,b.jsx)(T.Label,{className:"text-xs text-muted-foreground",children:"配置 Scope 级别权限(可选)"})]}),t&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Button,{variant:"select"===v?"default":"outline",size:"sm",className:"h-7 text-xs",onClick:()=>w("select"),children:"从已有 Scope 选择"}),(0,b.jsx)(h.Button,{variant:"manual"===v?"default":"outline",size:"sm",className:"h-7 text-xs",onClick:()=>w("manual"),children:"手动输入"})]}),"select"===v?(0,b.jsx)("div",{className:"rounded-md border border-[hsl(var(--border))] p-3 space-y-1.5",children:B?(0,b.jsxs)("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[(0,b.jsx)(o.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),"加载 Scope 列表..."]}):0===C.length?(0,b.jsx)("p",{className:"py-2 text-xs text-muted-foreground",children:"该记忆库暂无已有 Scope 数据,请手动输入"}):(0,b.jsx)("div",{className:"max-h-40 overflow-y-auto space-y-1",children:C.map(a=>{let c,d=au(a),e=au(p)===d;return(0,b.jsxs)("label",{className:`flex items-center gap-2 rounded px-2 py-1.5 cursor-pointer hover:bg-muted/50 ${e?"bg-muted":""}`,children:[(0,b.jsx)(W.Checkbox,{checked:e,onCheckedChange:()=>{if(e)q({});else q({appId:a.appId||void 0,tenantId:a.tenantId||void 0,agentId:a.agentId||void 0,runId:a.runId||void 0})}}),(0,b.jsx)("span",{className:"text-xs font-mono truncate",children:(c=[],a.appId&&c.push(`app:${a.appId}`),a.tenantId&&c.push(`tenant:${a.tenantId}`),a.agentId&&c.push(`agent:${a.agentId}`),a.runId&&c.push(`run:${a.runId}`),c.join(", "))})]},d)})})}):(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2 rounded-md border border-[hsl(var(--border))] p-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(T.Label,{className:"text-[11px] text-muted-foreground",children:"App ID"}),(0,b.jsx)(S.Input,{value:p.appId??"",onChange:a=>q(b=>({...b,appId:a.target.value||void 0})),placeholder:"可选",className:"h-8 text-xs"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(T.Label,{className:"text-[11px] text-muted-foreground",children:"Tenant ID"}),(0,b.jsx)(S.Input,{value:p.tenantId??"",onChange:a=>q(b=>({...b,tenantId:a.target.value||void 0})),placeholder:"可选",className:"h-8 text-xs"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(T.Label,{className:"text-[11px] text-muted-foreground",children:"Agent ID"}),(0,b.jsx)(S.Input,{value:p.agentId??"",onChange:a=>q(b=>({...b,agentId:a.target.value||void 0})),placeholder:"可选",className:"h-8 text-xs"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(T.Label,{className:"text-[11px] text-muted-foreground",children:"Run ID"}),(0,b.jsx)(S.Input,{value:p.runId??"",onChange:a=>q(b=>({...b,runId:a.target.value||void 0})),placeholder:"可选",className:"h-8 text-xs"})]})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-muted-foreground",children:"操作权限"}),(0,b.jsx)("div",{className:"space-y-2",children:["read","write","manage"].map(a=>(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-[hsl(var(--border))] px-3 py-2 cursor-pointer hover:bg-muted/30",children:[(0,b.jsx)(W.Checkbox,{checked:l.has(a),onCheckedChange:()=>{n(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},className:"mt-0.5"}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:as[a]}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:at[g]?.[a]}),(0,b.jsx)("div",{className:"mt-1 text-[11px] text-muted-foreground/60",children:ar(g,a).map(a=>a.replace("ots:","")).join(", ")})]})]},a))})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-muted-foreground",children:"IP 白名单(可选)"}),(0,b.jsx)(S.Input,{value:r,onChange:a=>s(a.target.value),placeholder:"例如 10.0.0.0/8, 192.168.1.0/24",className:"text-xs"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"多个 CIDR 用逗号分隔,留空表示不限制 IP"})]})]}),(0,b.jsxs)(U.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>d(!1),children:"取消"}),(0,b.jsx)(h.Button,{disabled:0===l.size,onClick:function(){var a;let b=Array.from(l),c=function(a,b){let c=[];for(let d of b)c.push(...ar(a,d));return[...new Set(c)]}(g,b),f=r.split(/[,,\s]+/).map(a=>a.trim()).filter(Boolean);e({resourceType:g,resourceName:j,operationGroups:b,actions:c,..."memorystore"===g&&t&&((a=p).appId||a.tenantId||a.agentId||a.runId)?{scope:p}:{},...f.length>0?{condition:{sourceIp:f}}:{}}),d(!1)},children:f?"保存修改":"添加"})]})]})})}let aw={read:"读取",write:"写入",manage:"管理"};function ax({serviceCredentialId:a,userName:d}){let f,g,{data:j,isLoading:k}=function(a,b){let{context:c,ready:d}=(0,M.useRuntimeContext)();return(0,L.useQuery)({queryKey:K.queryKeys.customPolicy(c.dataScopeKey,a??""),queryFn:()=>F(a,b),enabled:d&&!!a&&!!b,staleTime:15e3})}(a,d),m=(f=(0,w.useQueryClient)(),(0,v.useMutation)({mutationFn:a=>G(a.serviceCredentialId,{userName:a.userName,rules:a.rules}),onSuccess:()=>{(0,K.invalidateCustomPolicyQueries)(f),(0,K.invalidateApiKeyPolicyQueries)(f),(0,K.invalidateEffectivePermissionsQueries)(f)}})),n=(g=(0,w.useQueryClient)(),(0,v.useMutation)({mutationFn:a=>J(a.serviceCredentialId,{userName:a.userName}),onSuccess:()=>{(0,K.invalidateCustomPolicyQueries)(g),(0,K.invalidateApiKeyPolicyQueries)(g),(0,K.invalidateEffectivePermissionsQueries)(g)}})),[p,r]=(0,c.useState)([]),[s,t]=(0,c.useState)(!1),[u,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(null);async function A(){try{await m.mutateAsync({serviceCredentialId:a,userName:d,rules:p}),t(!1),l.toast.success("自定义权限已保存")}catch(a){l.toast.error(a instanceof Error?a.message:"保存失败")}}async function B(){try{await n.mutateAsync({serviceCredentialId:a,userName:d}),r([]),t(!1),l.toast.success("自定义策略已删除")}catch(a){l.toast.error(a instanceof Error?a.message:"删除失败")}}return(0,c.useEffect)(()=>{j&&(r(j.rules),t(!1))},[j]),k?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-8 w-full"})]}):(0,b.jsxs)("div",{className:"space-y-3",children:[0===p.length?(0,b.jsx)("p",{className:"py-3 text-center text-sm text-muted-foreground",children:"暂无自定义权限规则"}):(0,b.jsx)("div",{className:"space-y-1.5",children:p.map((a,c)=>(0,b.jsx)(ay,{rule:a,onEdit:()=>{z(c),x(!0)},onRemove:()=>{r(a=>a.filter((a,b)=>b!==c)),t(!0)}},c))}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(h.Button,{variant:"outline",size:"sm",className:"h-8",onClick:()=>{z(null),x(!0)},children:[(0,b.jsx)(e.Plus,{className:"mr-1 h-3.5 w-3.5"}),"添加规则"]}),s&&(0,b.jsxs)(h.Button,{size:"sm",className:"h-8",disabled:m.isPending,onClick:A,children:[m.isPending?(0,b.jsx)(o.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(ag,{className:"mr-1 h-3.5 w-3.5"}),"保存"]}),j&&j.rules.length>0&&(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"h-8 text-destructive hover:text-destructive",disabled:n.isPending,onClick:B,children:[n.isPending?(0,b.jsx)(o.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(q.Trash2,{className:"mr-1 h-3.5 w-3.5"}),"清除全部"]})]}),(0,b.jsx)(av,{open:u,onOpenChange:x,onSave:function(a){null!==y?(r(b=>{let c=[...b];return c[y]=a,c}),z(null)):r(b=>[...b,a]),t(!0)},initial:null!==y?p[y]:void 0})]})}function ay({rule:a,onEdit:c,onRemove:d}){let e="knowledgebase"===a.resourceType?m.BookOpen:ae.Brain,f="knowledgebase"===a.resourceType?"知识库":"记忆库",g="*"===a.resourceName?`全部${f}`:a.resourceName,i="";if(a.scope){let b=[];a.scope.appId&&b.push(`app:${a.scope.appId}`),a.scope.tenantId&&b.push(`tenant:${a.scope.tenantId}`),a.scope.agentId&&b.push(`agent:${a.scope.agentId}`),a.scope.runId&&b.push(`run:${a.scope.runId}`),b.length>0&&(i=` (${b.join(", ")})`)}return(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-[hsl(var(--border))] px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:"truncate text-sm font-medium",children:[g,i&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:i})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[a.operationGroups.map(a=>(0,b.jsx)(t.Badge,{variant:"secondary",className:"text-[10px]",children:aw[a]??a},a)),a.condition?.sourceIp&&a.condition.sourceIp.length>0&&(0,b.jsx)(t.Badge,{variant:"outline",className:"text-[10px]",children:"IP 限制"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:c,children:(0,b.jsx)(af.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:d,children:(0,b.jsx)(q.Trash2,{className:"h-3.5 w-3.5"})})]})]})}var az=a.i(53520),aA=a.i(414151);function aB({serviceCredentialId:a,userName:c}){let{data:d,isLoading:e,error:f}=N(a,c);if(e)return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"})]});if(f)return(0,b.jsx)("p",{className:"py-3 text-center text-sm text-destructive",children:"加载权限信息失败"});if(!d||0===d.resources.length)return(0,b.jsx)("p",{className:"py-3 text-center text-sm text-muted-foreground",children:"当前实例暂无知识库或记忆库"});let g=d.resources.filter(a=>"knowledgebase"===a.resourceType),h=d.resources.filter(a=>"memorystore"===a.resourceType);return(0,b.jsxs)("div",{className:"space-y-4",children:[g.length>0&&(0,b.jsx)(aC,{icon:(0,b.jsx)(m.BookOpen,{className:"h-3.5 w-3.5"}),label:"知识库",resources:g}),h.length>0&&(0,b.jsx)(aC,{icon:(0,b.jsx)(ae.Brain,{className:"h-3.5 w-3.5"}),label:"记忆库",resources:h})]})}function aC({icon:a,label:c,resources:d}){return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[a,c]}),(0,b.jsx)("div",{className:"rounded-md border border-[hsl(var(--border))]",children:(0,b.jsxs)(r.Table,{children:[(0,b.jsx)(r.TableHeader,{children:(0,b.jsxs)(r.TableRow,{children:[(0,b.jsx)(r.TableHead,{className:"text-xs",children:"名称"}),(0,b.jsx)(r.TableHead,{className:"w-16 text-center text-xs",children:"读取"}),(0,b.jsx)(r.TableHead,{className:"w-16 text-center text-xs",children:"写入"}),(0,b.jsx)(r.TableHead,{className:"w-16 text-center text-xs",children:"管理"})]})}),(0,b.jsx)(r.TableBody,{children:d.map(a=>(0,b.jsxs)(r.TableRow,{children:[(0,b.jsx)(r.TableCell,{className:"py-1.5",children:(0,b.jsx)("code",{className:"font-mono text-xs",children:a.resourceName})}),(0,b.jsx)(r.TableCell,{className:"py-1.5 text-center",children:(0,b.jsx)(aD,{allowed:a.permissions.read})}),(0,b.jsx)(r.TableCell,{className:"py-1.5 text-center",children:(0,b.jsx)(aD,{allowed:a.permissions.write})}),(0,b.jsx)(r.TableCell,{className:"py-1.5 text-center",children:(0,b.jsx)(aD,{allowed:a.permissions.manage})})]},a.resourceName))})]})})]})}function aD({allowed:a}){return a?(0,b.jsx)(az.Check,{className:"mx-auto h-4 w-4 text-success"}):(0,b.jsx)(aA.X,{className:"mx-auto h-4 w-4 text-muted-foreground/40"})}var aE=a.i(87491),aF=a.i(547259);let aG=["AliyunOTSFullAccess","AliyunOTSReadOnlyAccess","AliyunOTSWriteOnlyAccess"],aH=[{key:"readonly",label:"只读",description:"允许列表、查询、检索,禁止写入和管理操作",icon:aE.Eye,attach:["AliyunOTSReadOnlyAccess"]},{key:"full",label:"完全访问",description:"允许所有 OTS 操作,包含管理操作",icon:p,attach:["AliyunOTSFullAccess"]}];function aI({serviceCredentialId:a,userName:d,policies:e}){let f=aa(),g=ab(),[i,j]=(0,c.useState)(null),k=function(a){if(!a)return null;let b=new Set(a.filter(a=>aG.includes(a.policyName)).map(a=>a.policyName));return b.has("AliyunOTSFullAccess")?"full":b.has("AliyunOTSReadOnlyAccess")&&!b.has("AliyunOTSWriteOnlyAccess")?"readonly":null}(e);async function m(b){if(k===b.key)return void await n();j(b.key);try{let c=(e??[]).filter(a=>aG.includes(a.policyName));for(let e of c)b.attach.includes(e.policyName)||await g.mutateAsync({serviceCredentialId:a,userName:d,policyName:e.policyName,policyType:e.policyType});let h=new Set(c.map(a=>a.policyName));for(let c of b.attach)h.has(c)||await f.mutateAsync({serviceCredentialId:a,userName:d,policyName:c,policyType:"System"});l.toast.success(`已应用「${b.label}」权限模板`)}catch(a){l.toast.error(a instanceof Error?a.message:"应用模板失败")}finally{j(null)}}async function n(){j("cancel");try{for(let b of(e??[]).filter(a=>aG.includes(a.policyName)))await g.mutateAsync({serviceCredentialId:a,userName:d,policyName:b.policyName,policyType:b.policyType});l.toast.success("已取消默认授权")}catch(a){l.toast.error(a instanceof Error?a.message:"取消授权失败")}finally{j(null)}}return(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2",children:aH.map(a=>{let c=k===a.key,d=i===a.key,e=a.icon;return(0,b.jsxs)(h.Button,{variant:"outline",className:`relative flex h-auto flex-col items-center gap-1.5 px-3 py-3 text-center ${c?"border-[hsl(var(--primary))] bg-[hsl(var(--primary))/0.06]":""}`,disabled:null!==i,onClick:()=>m(a),children:[d||"cancel"===i&&c?(0,b.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-primary"}):c?(0,b.jsx)(az.Check,{className:"h-5 w-5 text-primary"}):(0,b.jsx)(e,{className:"h-5 w-5 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-xs font-medium",children:a.label}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground leading-tight",children:a.description}),c?(0,b.jsx)(aF.Lock,{className:"absolute right-1.5 top-1.5 h-3 w-3 text-primary"}):null]},a.key)})})}function aJ({apiKey:a,onClose:c}){let d=!!a,{data:e}=function(a,b){let{context:c,ready:d}=(0,M.useRuntimeContext)();return(0,L.useQuery)({queryKey:K.queryKeys.apiKeyPolicies(c.dataScopeKey,a??""),queryFn:()=>C(a,b),enabled:d&&!!a&&!!b,staleTime:15e3})}(a?.serviceCredentialId,a?.userPrincipalName);async function f(a,b){try{await _(a),l.toast.success(`已复制 ${b}`)}catch{l.toast.error("复制失败")}}let g=a&&Number.isFinite(Date.parse(a.createTime))?Date.parse(a.createTime):null;return(0,b.jsx)($.Sheet,{open:d,onOpenChange:a=>!a&&c(),children:(0,b.jsxs)($.SheetContent,{side:"right",className:"w-full max-w-xl overflow-y-auto",children:[(0,b.jsxs)($.SheetHeader,{children:[(0,b.jsx)($.SheetTitle,{children:"API Key 详情"}),(0,b.jsx)($.SheetDescription,{children:"查看凭证信息与权限配置"})]}),a?(0,b.jsxs)("div",{className:"space-y-5 mt-2",children:[(0,b.jsxs)("section",{className:"space-y-2.5",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"基本信息"}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(aK,{label:"凭证 ID",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("code",{className:"break-all font-mono text-xs",children:a.serviceCredentialId}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0",onClick:()=>f(a.serviceCredentialId,"凭证 ID"),children:(0,b.jsx)(Y.Copy,{className:"h-3 w-3"})})]})}),(0,b.jsx)(aK,{label:"凭证名称",children:(0,b.jsx)("span",{className:"text-sm",children:a.serviceCredentialName})}),(0,b.jsx)(aK,{label:"状态",children:(0,b.jsx)(t.Badge,{variant:"Active"===a.status?"success":"secondary",children:a.status})}),(0,b.jsx)(aK,{label:"RAM 用户",children:(0,b.jsx)("span",{className:"break-all font-mono text-xs text-muted-foreground",children:a.userPrincipalName})}),(0,b.jsx)(aK,{label:"创建时间",children:g?(0,b.jsx)(u.RelativeTime,{timestamp:g}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"—"})})]})]}),(0,b.jsx)(Z.Separator,{}),(0,b.jsxs)("section",{className:"space-y-2.5",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"权限概览"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"基于所有已授权策略计算的有效访问权限"}),(0,b.jsx)(aB,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName})]}),(0,b.jsx)(Z.Separator,{}),(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"权限配置"}),(0,b.jsx)(ad,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,policies:e}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-foreground",children:"默认授权"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"快速应用系统预设权限模板,适用于实例级别的权限管理"}),(0,b.jsx)(aI,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,policies:e})]}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-foreground",children:"自定义授权"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"针对特定知识库或记忆库配置细粒度权限"}),(0,b.jsx)(ax,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName})]})]})]}):null]})})}function aK({label:a,children:c}){return(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(T.Label,{className:"w-20 shrink-0 pt-0.5 text-xs text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"min-w-0 flex-1",children:c})]})}let aL=(0,f.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),aM={read:"读取",write:"写入",manage:"管理"};function aN({onFilterResults:a}){let[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)("knowledgebase"),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)("read"),{data:n}=(0,ai.useKnowledgeBases)(),{data:p}=(0,aj.useMemoryStores)(),q="knowledgebase"===f?(n?.items??[]).map(a=>a.knowledgeBaseName):(p?.items??[]).map(a=>a.memoryStoreName),r=!!i,{data:s,isLoading:u,isFetching:v,refetch:w}=(0,L.useQuery)({queryKey:["api-keys-filter-by-permission",f,i,k],queryFn:()=>I({resourceType:f,resourceName:i,operationGroup:k}),enabled:!1});return d?(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-3 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"按资源权限筛选 API Key"}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:function(){e(!1),j(""),a(null)},children:(0,b.jsx)(aA.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,b.jsxs)("div",{className:"space-y-1 min-w-[120px]",children:[(0,b.jsx)("label",{className:"text-[11px] text-muted-foreground",children:"资源类型"}),(0,b.jsxs)(ah.Select,{value:f,onValueChange:b=>{g(b),j(""),a(null)},children:[(0,b.jsx)(ah.SelectTrigger,{className:"h-8 text-xs",children:(0,b.jsx)(ah.SelectValue,{})}),(0,b.jsxs)(ah.SelectContent,{children:[(0,b.jsx)(ah.SelectItem,{value:"knowledgebase",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(m.BookOpen,{className:"h-3 w-3"}),"知识库"]})}),(0,b.jsx)(ah.SelectItem,{value:"memorystore",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(ae.Brain,{className:"h-3 w-3"}),"记忆库"]})})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1 min-w-[160px] flex-1",children:[(0,b.jsx)("label",{className:"text-[11px] text-muted-foreground",children:"资源名称"}),(0,b.jsxs)(ah.Select,{value:i,onValueChange:b=>{j(b),a(null)},children:[(0,b.jsx)(ah.SelectTrigger,{className:"h-8 text-xs",children:(0,b.jsx)(ah.SelectValue,{placeholder:"选择资源"})}),(0,b.jsx)(ah.SelectContent,{children:q.map(a=>(0,b.jsx)(ah.SelectItem,{value:a,children:a},a))})]})]}),(0,b.jsxs)("div",{className:"space-y-1 min-w-[100px]",children:[(0,b.jsx)("label",{className:"text-[11px] text-muted-foreground",children:"操作权限"}),(0,b.jsxs)(ah.Select,{value:k,onValueChange:b=>{l(b),a(null)},children:[(0,b.jsx)(ah.SelectTrigger,{className:"h-8 text-xs",children:(0,b.jsx)(ah.SelectValue,{})}),(0,b.jsx)(ah.SelectContent,{children:["read","write","manage"].map(a=>(0,b.jsx)(ah.SelectItem,{value:a,children:aM[a]},a))})]})]}),(0,b.jsxs)(h.Button,{size:"sm",className:"h-8",disabled:!r||v,onClick:function(){r&&w().then(b=>{b.data&&a(new Set(b.data.apiKeys.map(a=>a.serviceCredentialId)))})},children:[v?(0,b.jsx)(o.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(aL,{className:"mr-1.5 h-3.5 w-3.5"}),"筛选"]}),s?(0,b.jsx)(h.Button,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:function(){j(""),a(null)},children:"清除"}):null]}),s?(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:["找到"," ",(0,b.jsx)(t.Badge,{variant:"secondary",className:"px-1.5 py-0 text-xs",children:s.apiKeys.length})," ","个拥有","knowledgebase"===f?"知识库":"记忆库","「",i,"」",aM[k],"权限的 API Key"]}):null]}):(0,b.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:()=>e(!0),children:[(0,b.jsx)(aL,{className:"mr-2 h-3.5 w-3.5"}),"按权限筛选"]})}let aO=(0,f.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);function aP({apiKey:a,onClose:d}){let[e,f]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&f(!1)},[a]);let i=!!a;async function j(a,b){try{await _(a),l.toast.success(`已复制 ${b}`)}catch{l.toast.error("复制失败")}}return(0,b.jsx)(U.Dialog,{open:i,onOpenChange:function(a){(a||e)&&(a||d())},children:(0,b.jsxs)(U.DialogContent,{className:"sm:max-w-lg",onEscapeKeyDown:a=>{e||a.preventDefault()},onPointerDownOutside:a=>{e||a.preventDefault()},children:[(0,b.jsxs)(U.DialogHeader,{children:[(0,b.jsx)(U.DialogTitle,{className:"text-xl",children:"API Key 已创建"}),(0,b.jsx)(U.DialogDescription,{children:"请立即保存以下信息。Secret 关闭后无法再次取回。"})]}),a?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-muted-foreground",children:"凭证 ID (ServiceCredentialId)"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("code",{className:"flex-1 break-all rounded border border-[hsl(var(--border))] bg-muted/40 px-3 py-2 font-mono text-[13px]",children:a.serviceCredentialId}),(0,b.jsx)(h.Button,{variant:"outline",size:"icon",onClick:()=>j(a.serviceCredentialId,"凭证 ID"),"aria-label":"复制凭证 ID",children:(0,b.jsx)(Y.Copy,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(T.Label,{className:"text-xs text-muted-foreground",children:"凭证 Secret(仅显示一次)"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("code",{className:"flex-1 break-all rounded border border-[hsl(var(--warning))/0.5] bg-[hsl(var(--warning))/0.06] px-3 py-2 font-mono text-[13px]",children:a.serviceCredentialSecret}),(0,b.jsx)(h.Button,{variant:"outline",size:"icon",onClick:()=>j(a.serviceCredentialSecret,"Secret"),"aria-label":"复制 Secret",children:(0,b.jsx)(Y.Copy,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)(h.Button,{variant:"outline",className:"w-full",onClick:function(){if(!a)return;let b=a.serviceCredentialId.slice(-6),c=new Date().toISOString().replace(/[:.]/g,"-"),d=new Blob([`ServiceCredentialId: ${a.serviceCredentialId}
1
+ module.exports=[722424,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(163426),e=a.i(25825),f=a.i(750053);let g=(0,f.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var h=a.i(776192),i=a.i(604395),j=a.i(310215),k=a.i(502482),l=a.i(263265),m=a.i(342210);let n=(0,f.default)("brain-circuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);var o=a.i(881619);let p=(0,f.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var q=a.i(655295),r=a.i(223301),s=a.i(674024),t=a.i(521989),u=a.i(865271),v=a.i(543320),w=a.i(933596),x=a.i(895487),y=a.i(353141);async function z(){return(await (0,y.apiGet)("/api/v1/api-keys")).apiKeys}async function A(a){let b={};return a?.serviceCredentialName&&(b.serviceCredentialName=a.serviceCredentialName),a?.credentialAgeDays&&a.credentialAgeDays>0&&(b.credentialAgeDays=a.credentialAgeDays),(await (0,y.apiPost)("/api/v1/api-keys",Object.keys(b).length>0?b:void 0)).apiKey}async function B(a){await (0,y.apiDelete)(`/api/v1/api-keys/${encodeURIComponent(a.serviceCredentialId)}`,{userPrincipalName:a.userPrincipalName,deleteCustomPolicy:a.deleteCustomPolicy??!0,deleteRamUser:a.deleteRamUser??!0})}async function C(a){await (0,y.apiPatch)(`/api/v1/api-keys/${encodeURIComponent(a.serviceCredentialId)}`,{userPrincipalName:a.userPrincipalName,status:a.status})}async function D(a,b){return(await (0,y.apiGet)(`/api/v1/api-keys/${encodeURIComponent(a)}/policies?userName=${encodeURIComponent(b)}`)).policies}async function E(a,b){await (0,y.apiPost)(`/api/v1/api-keys/${encodeURIComponent(a)}/policies`,b)}async function F(a,b){await (0,y.apiDelete)(`/api/v1/api-keys/${encodeURIComponent(a)}/policies`,b)}async function G(a,b){return(0,y.apiGet)(`/api/v1/api-keys/${encodeURIComponent(a)}/custom-policy?userName=${encodeURIComponent(b)}`)}async function H(a,b){await (0,y.apiPut)(`/api/v1/api-keys/${encodeURIComponent(a)}/custom-policy`,b)}async function I(a,b){return(0,y.apiGet)(`/api/v1/api-keys/${encodeURIComponent(a)}/effective-permissions?userName=${encodeURIComponent(b)}`)}async function J(a){let b=new URLSearchParams({resourceType:a.resourceType,resourceName:a.resourceName,operationGroup:a.operationGroup});return(0,y.apiGet)(`/api/v1/api-keys/filter-by-permission?${b.toString()}`)}async function K(a,b){await (0,y.apiDelete)(`/api/v1/api-keys/${encodeURIComponent(a)}/custom-policy`,b)}var L=a.i(225377),M=a.i(983366),N=a.i(739096);function O(a,b){let{context:c,ready:d}=(0,N.useRuntimeContext)();return(0,M.useQuery)({queryKey:L.queryKeys.effectivePermissions(c.dataScopeKey,a??""),queryFn:()=>I(a,b),enabled:d&&!!a&&!!b,staleTime:15e3})}function P({apiKeys:a,onDelete:c,onDetail:d}){let{t:e}=(0,v.useI18n)();return(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--border))]",children:(0,b.jsxs)(r.Table,{children:[(0,b.jsx)(r.TableHeader,{children:(0,b.jsxs)(r.TableRow,{children:[(0,b.jsx)(r.TableHead,{children:e("apiKeys.table.credentialName")}),(0,b.jsx)(r.TableHead,{className:"w-[8rem]",children:e("apiKeys.table.status")}),(0,b.jsx)(r.TableHead,{children:e("apiKeys.table.accessibleKnowledgeBase")}),(0,b.jsx)(r.TableHead,{children:e("apiKeys.table.accessibleMemoryStore")}),(0,b.jsx)(r.TableHead,{className:"w-[10rem]",children:e("apiKeys.table.createdAt")}),(0,b.jsx)(r.TableHead,{className:"w-[11rem] text-right",children:e("apiKeys.table.actions")})]})}),(0,b.jsx)(r.TableBody,{children:a.map(a=>(0,b.jsx)(Q,{apiKey:a,onDelete:c,onDetail:d},a.serviceCredentialId))})]})})}function Q({apiKey:a,onDelete:d,onDetail:e}){let f,{t:g}=(0,v.useI18n)(),i=(f=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>C(a),onSuccess:()=>{(0,L.invalidateApiKeyQueries)(f)}})),[j,k]=(0,c.useState)(null),m=j??"Active"===a.status,n=Number.isFinite(Date.parse(a.createTime))?Date.parse(a.createTime):null;async function t(b){k(b);try{await i.mutateAsync({serviceCredentialId:a.serviceCredentialId,userPrincipalName:a.userPrincipalName,status:b?"Active":"Inactive"}),l.toast.success(b?g("apiKeys.table.enabled"):g("apiKeys.table.disabled"))}catch(a){k(null),l.toast.error(a instanceof Error?a.message:g("apiKeys.table.operationFailed"))}}return(0,b.jsxs)(r.TableRow,{className:"cursor-pointer",onClick:()=>e(a),children:[(0,b.jsx)(r.TableCell,{children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:a.serviceCredentialName}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.userPrincipalName})]})}),(0,b.jsx)(r.TableCell,{onClick:a=>a.stopPropagation(),children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(s.Switch,{checked:m,onCheckedChange:t,disabled:i.isPending,"aria-label":m?g("apiKeys.table.disable"):g("apiKeys.table.enable")}),(0,b.jsx)("span",{className:m?"text-xs font-medium text-success":"text-xs font-medium text-muted-foreground",children:i.isPending?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}),g("apiKeys.table.toggling")]}):m?g("apiKeys.table.statusActive"):g("apiKeys.table.statusInactive")})]})}),(0,b.jsx)(r.TableCell,{onClick:a=>a.stopPropagation(),children:(0,b.jsx)(R,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,resourceType:"knowledgebase"})}),(0,b.jsx)(r.TableCell,{onClick:a=>a.stopPropagation(),children:(0,b.jsx)(R,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,resourceType:"memorystore"})}),(0,b.jsx)(r.TableCell,{children:n?(0,b.jsx)(u.RelativeTime,{timestamp:n}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"—"})}),(0,b.jsxs)(r.TableCell,{className:"text-right",children:[(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"h-8",onClick:b=>{b.stopPropagation(),e(a)},children:[(0,b.jsx)(p,{className:"mr-1 h-3.5 w-3.5"}),g("apiKeys.table.permission")]}),(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:`h-8 text-[hsl(var(--destructive))] hover:bg-[hsl(var(--destructive))/0.08] hover:text-[hsl(var(--destructive))] ${m?"opacity-50 cursor-not-allowed":""}`,onClick:b=>{b.stopPropagation(),m?l.toast.info(g("apiKeys.table.disableBeforeDelete")):d(a)},children:[(0,b.jsx)(q.Trash2,{className:"mr-1 h-3.5 w-3.5"}),g("common.delete")]})]})]})}function R({serviceCredentialId:a,userName:c,resourceType:d}){let{t:e}=(0,v.useI18n)(),{data:f,isLoading:g,isError:h}=O(a,c);if(g)return(0,b.jsx)(o.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"});if(h)return(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"—"});let i=(f?.resources?.filter(a=>a.resourceType===d)??[]).filter(a=>a.permissions.read||a.permissions.write||a.permissions.manage);if(0===i.length)return(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:e("apiKeys.table.none")});let j="knowledgebase"===d?m.BookOpen:n;return(0,b.jsx)("div",{className:"flex flex-wrap gap-1",children:i.map(a=>(0,b.jsxs)(t.Badge,{variant:"secondary",className:"gap-1 text-[11px] font-normal",children:[(0,b.jsx)(j,{className:"h-3 w-3"}),a.resourceName]},a.resourceName))})}var S=a.i(637102),T=a.i(172518),U=a.i(962491),V=a.i(843836);function W({open:a,onOpenChange:d,onCreated:e}){let f,{t:g}=(0,v.useI18n)(),i=(f=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>A(a),onSuccess:()=>{(0,L.invalidateApiKeyQueries)(f)}})),[j,k]=(0,c.useState)(""),[m,n]=(0,c.useState)("");async function o(){let a=j.trim();if(!a)return void l.toast.error(g("apiKeys.create.nameRequired"));let b=m?Number(m):void 0;if(void 0!==b&&(b<1||b>365||!Number.isInteger(b)))return void l.toast.error(g("apiKeys.create.ageDaysInvalid"));try{let c=await i.mutateAsync({serviceCredentialName:a,credentialAgeDays:b});d(!1),e(c)}catch(a){l.toast.error(a instanceof Error?a.message:g("apiKeys.create.createFailed"))}}return(0,c.useEffect)(()=>{a&&(k("ots_apikey_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,6)),n(""))},[a]),(0,b.jsx)(V.Dialog,{open:a,onOpenChange:a=>{d(a)},children:(0,b.jsxs)(V.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(V.DialogHeader,{children:(0,b.jsx)(V.DialogTitle,{className:"text-xl",children:g("apiKeys.create.title")})}),(0,b.jsxs)("div",{className:"space-y-3 py-1 text-sm leading-relaxed text-muted-foreground",children:[(0,b.jsxs)("p",{children:[g("apiKeys.create.introPrefix"),(0,b.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:"ots.aliyuncs.com"}),g("apiKeys.create.introSuffix")]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-foreground",children:g("apiKeys.create.credentialName")}),(0,b.jsx)(T.Input,{value:j,onChange:a=>k(a.target.value),placeholder:g("apiKeys.create.credentialNamePlaceholder"),className:"h-9"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:g("apiKeys.create.credentialNameHelp")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-foreground",children:g("apiKeys.create.ageDays")}),(0,b.jsx)(T.Input,{type:"number",min:1,max:365,value:m,onChange:a=>n(a.target.value),placeholder:g("apiKeys.create.ageDaysPlaceholder"),className:"h-9"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:g("apiKeys.create.ageDaysHelp")})]}),(0,b.jsx)("div",{className:"rounded-md border border-[hsl(var(--warning))/0.5] bg-[hsl(var(--warning))/0.08] px-4 py-3 text-sm",children:(0,b.jsxs)("p",{className:"text-foreground",children:[(0,b.jsx)(S.AlertTriangle,{className:"mr-1 -mt-0.5 inline h-4 w-4 text-warning"}),g("apiKeys.create.secretWarning")]})})]}),(0,b.jsxs)(V.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>d(!1),disabled:i.isPending,children:g("common.cancel")}),(0,b.jsx)(h.Button,{onClick:o,disabled:i.isPending,children:i.isPending?g("common.creating"):g("apiKeys.create.confirm")})]})]})})}var X=a.i(36890);function Y({apiKey:a,open:d,onOpenChange:e}){let f,{t:g}=(0,v.useI18n)(),i=(f=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>B(a),onSuccess:()=>{(0,L.invalidateApiKeyQueries)(f)}})),[j,k]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!0);async function o(){if(a)try{await i.mutateAsync({serviceCredentialId:a.serviceCredentialId,userPrincipalName:a.userPrincipalName,deleteCustomPolicy:j,deleteRamUser:m}),l.toast.success(g("apiKeys.delete.deleteSuccess")),e(!1)}catch(a){l.toast.error(a instanceof Error?a.message:g("apiKeys.delete.deleteFailed"))}}return(0,c.useEffect)(()=>{d&&(k(!0),n(!0))},[d]),(0,b.jsx)(V.Dialog,{open:d,onOpenChange:e,children:(0,b.jsxs)(V.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(V.DialogHeader,{children:(0,b.jsx)(V.DialogTitle,{className:"text-xl",children:g("apiKeys.delete.title")})}),(0,b.jsxs)("div",{className:"rounded-md border border-[hsl(var(--destructive))] bg-[hsl(var(--destructive))/0.06] px-4 py-3 text-sm leading-relaxed",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)(S.AlertTriangle,{className:"mr-1 -mt-0.5 inline h-4 w-4 text-destructive"}),g("apiKeys.delete.warning")]}),a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"mt-3",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:g("apiKeys.delete.credentialNameLabel")}),(0,b.jsx)("code",{className:"font-mono text-xs",children:a.serviceCredentialName})]}),"Active"===a.status?(0,b.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:g("apiKeys.delete.activeHint")}):null]}):null]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("apiKeys.delete.cleanupHint")}),(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)(X.Checkbox,{checked:j,onCheckedChange:a=>k(!!a),className:"mt-0.5"}),(0,b.jsxs)("div",{children:[(0,b.jsx)(U.Label,{className:"text-sm cursor-pointer",children:g("apiKeys.delete.deleteCustomPolicy")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("apiKeys.delete.deleteCustomPolicyDesc")})]})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)(X.Checkbox,{checked:m,onCheckedChange:a=>n(!!a),className:"mt-0.5"}),(0,b.jsxs)("div",{children:[(0,b.jsx)(U.Label,{className:"text-sm cursor-pointer",children:g("apiKeys.delete.deleteRamUser")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("apiKeys.delete.deleteRamUserDesc")})]})]})]}),(0,b.jsxs)(V.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>e(!1),disabled:i.isPending,children:g("common.cancel")}),(0,b.jsx)(h.Button,{variant:"destructive",disabled:i.isPending,onClick:o,children:i.isPending?g("common.deleting"):g("apiKeys.delete.confirm")})]})]})})}var Z=a.i(16772),$=a.i(770550),_=a.i(109734);async function aa(a){if(navigator.clipboard&&window.isSecureContext)return void await navigator.clipboard.writeText(a);let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}function ab(){let a=(0,x.useQueryClient)();return(0,w.useMutation)({mutationFn:a=>E(a.serviceCredentialId,{userName:a.userName,policyName:a.policyName,policyType:a.policyType}),onSuccess:()=>{(0,L.invalidateApiKeyPolicyQueries)(a),(0,L.invalidateEffectivePermissionsQueries)(a)}})}function ac(){let a=(0,x.useQueryClient)();return(0,w.useMutation)({mutationFn:a=>F(a.serviceCredentialId,{userName:a.userName,policyName:a.policyName,policyType:a.policyType}),onSuccess:()=>{(0,L.invalidateApiKeyPolicyQueries)(a),(0,L.invalidateEffectivePermissionsQueries)(a)}})}let ad="ts-ots-bearer-token-access";function ae({serviceCredentialId:a,userName:d,policies:e}){let{t:f}=(0,v.useI18n)(),g=ab(),h=ac(),[i,j]=(0,c.useState)(!1),k=e?.some(a=>a.policyName===ad)??!1;async function m(b){j(!0);try{b?(await g.mutateAsync({serviceCredentialId:a,userName:d,policyName:ad,policyType:"Custom"}),l.toast.success(f("apiKeys.bearer.enableSuccess"))):(await h.mutateAsync({serviceCredentialId:a,userName:d,policyName:ad,policyType:"Custom"}),l.toast.success(f("apiKeys.bearer.disableSuccess")))}catch(a){l.toast.error(a instanceof Error?a.message:f("apiKeys.bearer.operationFailed"))}finally{j(!1)}}return(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-[hsl(var(--border))] px-3 py-2.5",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:f("apiKeys.bearer.title")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:f("apiKeys.bearer.description")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0 ml-3",children:[i?(0,b.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):null,(0,b.jsx)(s.Switch,{checked:k,onCheckedChange:m,disabled:i||!e})]})]})}var af=a.i(147845),ag=a.i(112537);let ah=(0,f.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var ai=a.i(663525),aj=a.i(909367),ak=a.i(610220),al=a.i(421347);let am=["ots:DescribeKnowledgeBase","ots:ListKnowledgeBase","ots:GetDocument","ots:ListDocuments","ots:ListChunks","ots:Retrieve"],an=["ots:AddDocuments","ots:UpdateDocument","ots:UpdateChunks","ots:DeleteDocuments","ots:UploadDocuments"],ao=["ots:CreateKnowledgeBase","ots:DeleteKnowledgeBase","ots:UpdateKnowledgeBase"],ap=["ots:GetMemoryStore","ots:ListMemoryStores","ots:SearchMemories","ots:ListMemories","ots:GetMemory","ots:ListMemoryStoreMessages","ots:ListMemoryStoreRequests","ots:ListMemoryStoreScopes","ots:GetMemoryTask","ots:ListMemoryTasks","ots:GetMemoryDreamTask","ots:ListMemoryDreamTasks","ots:ListMemoryDreamActions"],aq=["ots:AddMemories","ots:UpdateMemory","ots:DeleteMemory","ots:ApplyMemoryDreamActions","ots:CreateMemoryDreamTask","ots:CancelMemoryDreamTask"],ar=["ots:CreateMemoryStore","ots:DeleteMemoryStore","ots:UpdateMemoryStore"];function as(a,b){return"knowledgebase"===a?"read"===b?am:"write"===b?an:ao:"read"===b?ap:"write"===b?aq:ar}[...am,...an,...ao],[...ap,...aq,...ar];let at={read:"apiKeys.operations.read",write:"apiKeys.operations.write",manage:"apiKeys.operations.manage"},au={knowledgebase:{read:"apiKeys.operations.knowledgeBaseReadDesc",write:"apiKeys.operations.knowledgeBaseWriteDesc",manage:"apiKeys.operations.knowledgeBaseManageDesc"},memorystore:{read:"apiKeys.operations.memoryStoreReadDesc",write:"apiKeys.operations.memoryStoreWriteDesc",manage:"apiKeys.operations.memoryStoreManageDesc"}};function av(a){return[a.appId??"",a.tenantId??"",a.agentId??"",a.runId??""].join("|")}function aw({open:a,onOpenChange:d,onSave:e,initial:f}){let{t:g}=(0,v.useI18n)(),[i,j]=(0,c.useState)(f?.resourceType??"knowledgebase"),[k,l]=(0,c.useState)(f?.resourceName??"*"),[n,p]=(0,c.useState)(new Set(f?.operationGroups??["read"])),[q,r]=(0,c.useState)(f?.scope??{}),[s,t]=(0,c.useState)(f?.condition?.sourceIp?.join(", ")??""),[u,w]=(0,c.useState)(!!(f?.scope&&(f.scope.appId||f.scope.tenantId||f.scope.agentId||f.scope.runId))),[x,y]=(0,c.useState)("manual"),{data:z}=(0,aj.useKnowledgeBases)(),{data:A}=(0,ak.useMemoryStores)(),B=a&&"memorystore"===i&&"*"!==k&&u,{data:C,isLoading:D}=(0,M.useQuery)({queryKey:["memory-store-scopes-for-rule",k],queryFn:()=>(0,al.listMemoryStoreScopesUnfiltered)(k),enabled:B,staleTime:3e4}),E=C?.items??[];(0,c.useEffect)(()=>{a&&(j(f?.resourceType??"knowledgebase"),l(f?.resourceName??"*"),p(new Set(f?.operationGroups??["read"])),r(f?.scope??{}),t(f?.condition?.sourceIp?.join(", ")??""),w(!!(f?.scope&&(f.scope.appId||f.scope.tenantId||f.scope.agentId||f.scope.runId))),y("manual"))},[a,f]);let F="knowledgebase"===i?(z?.items??[]).map(a=>a.knowledgeBaseName):(A?.items??[]).map(a=>a.memoryStoreName);return(0,b.jsx)(V.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(V.DialogContent,{className:"sm:max-w-lg max-h-[85vh] overflow-y-auto",children:[(0,b.jsx)(V.DialogHeader,{children:(0,b.jsx)(V.DialogTitle,{children:f?g("apiKeys.rule.editTitle"):g("apiKeys.rule.addTitle")})}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-muted-foreground",children:g("apiKeys.rule.resourceType")}),(0,b.jsxs)(ai.Select,{value:i,onValueChange:a=>{j(a),l("*"),w(!1),r({})},children:[(0,b.jsx)(ai.SelectTrigger,{children:(0,b.jsx)(ai.SelectValue,{})}),(0,b.jsxs)(ai.SelectContent,{children:[(0,b.jsx)(ai.SelectItem,{value:"knowledgebase",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(m.BookOpen,{className:"h-3.5 w-3.5"}),g("common.knowledgeBase")]})}),(0,b.jsx)(ai.SelectItem,{value:"memorystore",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(af.Brain,{className:"h-3.5 w-3.5"}),g("common.memory")]})})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-muted-foreground",children:g("apiKeys.rule.resourceName")}),(0,b.jsxs)(ai.Select,{value:k,onValueChange:a=>{l(a),w(!1),r({})},children:[(0,b.jsx)(ai.SelectTrigger,{children:(0,b.jsx)(ai.SelectValue,{})}),(0,b.jsxs)(ai.SelectContent,{children:[(0,b.jsx)(ai.SelectItem,{value:"*",children:g("apiKeys.rule.allResource",{resource:"knowledgebase"===i?g("common.knowledgeBase"):g("common.memory")})}),F.map(a=>(0,b.jsx)(ai.SelectItem,{value:a,children:a},a))]})]})]}),"memorystore"===i&&"*"!==k&&(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(X.Checkbox,{checked:u,onCheckedChange:a=>{w(!!a),a||r({})}}),(0,b.jsx)(U.Label,{className:"text-xs text-muted-foreground",children:g("apiKeys.rule.scopeConfig")})]}),u&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Button,{variant:"select"===x?"default":"outline",size:"sm",className:"h-7 text-xs",onClick:()=>y("select"),children:g("apiKeys.rule.selectFromExisting")}),(0,b.jsx)(h.Button,{variant:"manual"===x?"default":"outline",size:"sm",className:"h-7 text-xs",onClick:()=>y("manual"),children:g("apiKeys.rule.manualInput")})]}),"select"===x?(0,b.jsx)("div",{className:"rounded-md border border-[hsl(var(--border))] p-3 space-y-1.5",children:D?(0,b.jsxs)("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[(0,b.jsx)(o.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),g("apiKeys.rule.loadingScopes")]}):0===E.length?(0,b.jsx)("p",{className:"py-2 text-xs text-muted-foreground",children:g("apiKeys.rule.noScopes")}):(0,b.jsx)("div",{className:"max-h-40 overflow-y-auto space-y-1",children:E.map(a=>{let c,d=av(a),e=av(q)===d;return(0,b.jsxs)("label",{className:`flex items-center gap-2 rounded px-2 py-1.5 cursor-pointer hover:bg-muted/50 ${e?"bg-muted":""}`,children:[(0,b.jsx)(X.Checkbox,{checked:e,onCheckedChange:()=>{if(e)r({});else r({appId:a.appId||void 0,tenantId:a.tenantId||void 0,agentId:a.agentId||void 0,runId:a.runId||void 0})}}),(0,b.jsx)("span",{className:"text-xs font-mono truncate",children:(c=[],a.appId&&c.push(`app:${a.appId}`),a.tenantId&&c.push(`tenant:${a.tenantId}`),a.agentId&&c.push(`agent:${a.agentId}`),a.runId&&c.push(`run:${a.runId}`),c.join(", "))})]},d)})})}):(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2 rounded-md border border-[hsl(var(--border))] p-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(U.Label,{className:"text-[11px] text-muted-foreground",children:"App ID"}),(0,b.jsx)(T.Input,{value:q.appId??"",onChange:a=>r(b=>({...b,appId:a.target.value||void 0})),placeholder:g("apiKeys.rule.optional"),className:"h-8 text-xs"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(U.Label,{className:"text-[11px] text-muted-foreground",children:"Tenant ID"}),(0,b.jsx)(T.Input,{value:q.tenantId??"",onChange:a=>r(b=>({...b,tenantId:a.target.value||void 0})),placeholder:g("apiKeys.rule.optional"),className:"h-8 text-xs"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(U.Label,{className:"text-[11px] text-muted-foreground",children:"Agent ID"}),(0,b.jsx)(T.Input,{value:q.agentId??"",onChange:a=>r(b=>({...b,agentId:a.target.value||void 0})),placeholder:g("apiKeys.rule.optional"),className:"h-8 text-xs"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(U.Label,{className:"text-[11px] text-muted-foreground",children:"Run ID"}),(0,b.jsx)(T.Input,{value:q.runId??"",onChange:a=>r(b=>({...b,runId:a.target.value||void 0})),placeholder:g("apiKeys.rule.optional"),className:"h-8 text-xs"})]})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-muted-foreground",children:g("apiKeys.rule.operationPermission")}),(0,b.jsx)("div",{className:"space-y-2",children:["read","write","manage"].map(a=>{let c;return(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-[hsl(var(--border))] px-3 py-2 cursor-pointer hover:bg-muted/30",children:[(0,b.jsx)(X.Checkbox,{checked:n.has(a),onCheckedChange:()=>{p(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},className:"mt-0.5"}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:g(at[a])}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:(c=au[i]?.[a])?g(c):null}),(0,b.jsx)("div",{className:"mt-1 text-[11px] text-muted-foreground/60",children:as(i,a).map(a=>a.replace("ots:","")).join(", ")})]})]},a)})})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-muted-foreground",children:g("apiKeys.rule.ipWhitelist")}),(0,b.jsx)(T.Input,{value:s,onChange:a=>t(a.target.value),placeholder:g("apiKeys.rule.ipPlaceholder"),className:"text-xs"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:g("apiKeys.rule.ipHelp")})]})]}),(0,b.jsxs)(V.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>d(!1),children:g("common.cancel")}),(0,b.jsx)(h.Button,{disabled:0===n.size,onClick:function(){var a;let b=Array.from(n),c=function(a,b){let c=[];for(let d of b)c.push(...as(a,d));return[...new Set(c)]}(i,b),f=s.split(/[,,\s]+/).map(a=>a.trim()).filter(Boolean);e({resourceType:i,resourceName:k,operationGroups:b,actions:c,..."memorystore"===i&&u&&((a=q).appId||a.tenantId||a.agentId||a.runId)?{scope:q}:{},...f.length>0?{condition:{sourceIp:f}}:{}}),d(!1)},children:f?g("apiKeys.rule.saveChanges"):g("apiKeys.rule.add")})]})]})})}let ax={read:"apiKeys.operations.read",write:"apiKeys.operations.write",manage:"apiKeys.operations.manage"};function ay({serviceCredentialId:a,userName:d}){let f,g,{t:j}=(0,v.useI18n)(),{data:k,isLoading:m}=function(a,b){let{context:c,ready:d}=(0,N.useRuntimeContext)();return(0,M.useQuery)({queryKey:L.queryKeys.customPolicy(c.dataScopeKey,a??""),queryFn:()=>G(a,b),enabled:d&&!!a&&!!b,staleTime:15e3})}(a,d),n=(f=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>H(a.serviceCredentialId,{userName:a.userName,rules:a.rules}),onSuccess:()=>{(0,L.invalidateCustomPolicyQueries)(f),(0,L.invalidateApiKeyPolicyQueries)(f),(0,L.invalidateEffectivePermissionsQueries)(f)}})),p=(g=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>K(a.serviceCredentialId,{userName:a.userName}),onSuccess:()=>{(0,L.invalidateCustomPolicyQueries)(g),(0,L.invalidateApiKeyPolicyQueries)(g),(0,L.invalidateEffectivePermissionsQueries)(g)}})),[r,s]=(0,c.useState)([]),[t,u]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null);async function C(){try{await n.mutateAsync({serviceCredentialId:a,userName:d,rules:r}),u(!1),l.toast.success(j("apiKeys.customPolicy.saveSuccess"))}catch(a){l.toast.error(a instanceof Error?a.message:j("apiKeys.customPolicy.saveFailed"))}}async function D(){try{await p.mutateAsync({serviceCredentialId:a,userName:d}),s([]),u(!1),l.toast.success(j("apiKeys.customPolicy.deleteSuccess"))}catch(a){l.toast.error(a instanceof Error?a.message:j("apiKeys.customPolicy.deleteFailed"))}}return(0,c.useEffect)(()=>{k&&(s(k.rules),u(!1))},[k]),m?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-8 w-full"})]}):(0,b.jsxs)("div",{className:"space-y-3",children:[0===r.length?(0,b.jsx)("p",{className:"py-3 text-center text-sm text-muted-foreground",children:j("apiKeys.customPolicy.empty")}):(0,b.jsx)("div",{className:"space-y-1.5",children:r.map((a,c)=>(0,b.jsx)(az,{rule:a,t:j,onEdit:()=>{B(c),z(!0)},onRemove:()=>{s(a=>a.filter((a,b)=>b!==c)),u(!0)}},c))}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(h.Button,{variant:"outline",size:"sm",className:"h-8",onClick:()=>{B(null),z(!0)},children:[(0,b.jsx)(e.Plus,{className:"mr-1 h-3.5 w-3.5"}),j("apiKeys.customPolicy.addRule")]}),t&&(0,b.jsxs)(h.Button,{size:"sm",className:"h-8",disabled:n.isPending,onClick:C,children:[n.isPending?(0,b.jsx)(o.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(ah,{className:"mr-1 h-3.5 w-3.5"}),j("common.save")]}),k&&k.rules.length>0&&(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"h-8 text-destructive hover:text-destructive",disabled:p.isPending,onClick:D,children:[p.isPending?(0,b.jsx)(o.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(q.Trash2,{className:"mr-1 h-3.5 w-3.5"}),j("apiKeys.customPolicy.clearAll")]})]}),(0,b.jsx)(aw,{open:y,onOpenChange:z,onSave:function(a){null!==A?(s(b=>{let c=[...b];return c[A]=a,c}),B(null)):s(b=>[...b,a]),u(!0)},initial:null!==A?r[A]:void 0})]})}function az({rule:a,t:c,onEdit:d,onRemove:e}){let f="knowledgebase"===a.resourceType?m.BookOpen:af.Brain,g="knowledgebase"===a.resourceType?c("common.knowledgeBase"):c("common.memory"),i="*"===a.resourceName?c("apiKeys.rule.allResource",{resource:g}):a.resourceName,j="";if(a.scope){let b=[];a.scope.appId&&b.push(`app:${a.scope.appId}`),a.scope.tenantId&&b.push(`tenant:${a.scope.tenantId}`),a.scope.agentId&&b.push(`agent:${a.scope.agentId}`),a.scope.runId&&b.push(`run:${a.scope.runId}`),b.length>0&&(j=` (${b.join(", ")})`)}return(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-[hsl(var(--border))] px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(f,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:"truncate text-sm font-medium",children:[i,j&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:j})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[a.operationGroups.map(a=>(0,b.jsx)(t.Badge,{variant:"secondary",className:"text-[10px]",children:ax[a]?c(ax[a]):a},a)),a.condition?.sourceIp&&a.condition.sourceIp.length>0&&(0,b.jsx)(t.Badge,{variant:"outline",className:"text-[10px]",children:c("apiKeys.customPolicy.ipLimit")})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:d,children:(0,b.jsx)(ag.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:e,children:(0,b.jsx)(q.Trash2,{className:"h-3.5 w-3.5"})})]})]})}var aA=a.i(53520),aB=a.i(414151);function aC({serviceCredentialId:a,userName:c}){let{t:d}=(0,v.useI18n)(),{data:e,isLoading:f,error:g}=O(a,c);if(f)return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"})]});if(g)return(0,b.jsx)("p",{className:"py-3 text-center text-sm text-destructive",children:d("apiKeys.overview.loadFailed")});if(!e||0===e.resources.length)return(0,b.jsx)("p",{className:"py-3 text-center text-sm text-muted-foreground",children:d("apiKeys.overview.empty")});let h=e.resources.filter(a=>"knowledgebase"===a.resourceType),j=e.resources.filter(a=>"memorystore"===a.resourceType);return(0,b.jsxs)("div",{className:"space-y-4",children:[h.length>0&&(0,b.jsx)(aD,{icon:(0,b.jsx)(m.BookOpen,{className:"h-3.5 w-3.5"}),label:d("common.knowledgeBase"),resources:h}),j.length>0&&(0,b.jsx)(aD,{icon:(0,b.jsx)(af.Brain,{className:"h-3.5 w-3.5"}),label:d("common.memory"),resources:j})]})}function aD({icon:a,label:c,resources:d}){let{t:e}=(0,v.useI18n)();return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[a,c]}),(0,b.jsx)("div",{className:"rounded-md border border-[hsl(var(--border))]",children:(0,b.jsxs)(r.Table,{children:[(0,b.jsx)(r.TableHeader,{children:(0,b.jsxs)(r.TableRow,{children:[(0,b.jsx)(r.TableHead,{className:"text-xs",children:e("apiKeys.overview.name")}),(0,b.jsx)(r.TableHead,{className:"w-16 text-center text-xs",children:e("apiKeys.overview.read")}),(0,b.jsx)(r.TableHead,{className:"w-16 text-center text-xs",children:e("apiKeys.overview.write")}),(0,b.jsx)(r.TableHead,{className:"w-16 text-center text-xs",children:e("apiKeys.overview.manage")})]})}),(0,b.jsx)(r.TableBody,{children:d.map(a=>(0,b.jsxs)(r.TableRow,{children:[(0,b.jsx)(r.TableCell,{className:"py-1.5",children:(0,b.jsx)("code",{className:"font-mono text-xs",children:a.resourceName})}),(0,b.jsx)(r.TableCell,{className:"py-1.5 text-center",children:(0,b.jsx)(aE,{allowed:a.permissions.read})}),(0,b.jsx)(r.TableCell,{className:"py-1.5 text-center",children:(0,b.jsx)(aE,{allowed:a.permissions.write})}),(0,b.jsx)(r.TableCell,{className:"py-1.5 text-center",children:(0,b.jsx)(aE,{allowed:a.permissions.manage})})]},a.resourceName))})]})})]})}function aE({allowed:a}){return a?(0,b.jsx)(aA.Check,{className:"mx-auto h-4 w-4 text-success"}):(0,b.jsx)(aB.X,{className:"mx-auto h-4 w-4 text-muted-foreground/40"})}var aF=a.i(87491),aG=a.i(547259);let aH=["AliyunOTSFullAccess","AliyunOTSReadOnlyAccess","AliyunOTSWriteOnlyAccess"],aI=[{key:"readonly",labelKey:"apiKeys.presets.readonlyLabel",descriptionKey:"apiKeys.presets.readonlyDesc",icon:aF.Eye,attach:["AliyunOTSReadOnlyAccess"]},{key:"full",labelKey:"apiKeys.presets.fullLabel",descriptionKey:"apiKeys.presets.fullDesc",icon:p,attach:["AliyunOTSFullAccess"]}];function aJ({serviceCredentialId:a,userName:d,policies:e}){let{t:f}=(0,v.useI18n)(),g=ab(),i=ac(),[j,k]=(0,c.useState)(null),m=function(a){if(!a)return null;let b=new Set(a.filter(a=>aH.includes(a.policyName)).map(a=>a.policyName));return b.has("AliyunOTSFullAccess")?"full":b.has("AliyunOTSReadOnlyAccess")&&!b.has("AliyunOTSWriteOnlyAccess")?"readonly":null}(e);async function n(b){if(m===b.key)return void await p();k(b.key);try{let c=(e??[]).filter(a=>aH.includes(a.policyName));for(let e of c)b.attach.includes(e.policyName)||await i.mutateAsync({serviceCredentialId:a,userName:d,policyName:e.policyName,policyType:e.policyType});let h=new Set(c.map(a=>a.policyName));for(let c of b.attach)h.has(c)||await g.mutateAsync({serviceCredentialId:a,userName:d,policyName:c,policyType:"System"});l.toast.success(f("apiKeys.presets.applySuccess",{preset:f(b.labelKey)}))}catch(a){l.toast.error(a instanceof Error?a.message:f("apiKeys.presets.applyFailed"))}finally{k(null)}}async function p(){k("cancel");try{for(let b of(e??[]).filter(a=>aH.includes(a.policyName)))await i.mutateAsync({serviceCredentialId:a,userName:d,policyName:b.policyName,policyType:b.policyType});l.toast.success(f("apiKeys.presets.cancelSuccess"))}catch(a){l.toast.error(a instanceof Error?a.message:f("apiKeys.presets.cancelFailed"))}finally{k(null)}}return(0,b.jsx)("div",{className:"grid grid-cols-2 gap-2",children:aI.map(a=>{let c=m===a.key,d=j===a.key,e=a.icon;return(0,b.jsxs)(h.Button,{variant:"outline",className:`relative flex h-auto flex-col items-center gap-1.5 px-3 py-3 text-center ${c?"border-[hsl(var(--primary))] bg-[hsl(var(--primary))/0.06]":""}`,disabled:null!==j,onClick:()=>n(a),children:[d||"cancel"===j&&c?(0,b.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-primary"}):c?(0,b.jsx)(aA.Check,{className:"h-5 w-5 text-primary"}):(0,b.jsx)(e,{className:"h-5 w-5 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-xs font-medium",children:f(a.labelKey)}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground leading-tight",children:f(a.descriptionKey)}),c?(0,b.jsx)(aG.Lock,{className:"absolute right-1.5 top-1.5 h-3 w-3 text-primary"}):null]},a.key)})})}function aK({apiKey:a,onClose:c}){let{t:d}=(0,v.useI18n)(),e=!!a,{data:f}=function(a,b){let{context:c,ready:d}=(0,N.useRuntimeContext)();return(0,M.useQuery)({queryKey:L.queryKeys.apiKeyPolicies(c.dataScopeKey,a??""),queryFn:()=>D(a,b),enabled:d&&!!a&&!!b,staleTime:15e3})}(a?.serviceCredentialId,a?.userPrincipalName);async function g(a,b){try{await aa(a),l.toast.success(`${d("common.copied")} ${b}`)}catch{l.toast.error(d("common.copyFailed"))}}let i=a&&Number.isFinite(Date.parse(a.createTime))?Date.parse(a.createTime):null;return(0,b.jsx)(_.Sheet,{open:e,onOpenChange:a=>!a&&c(),children:(0,b.jsxs)(_.SheetContent,{side:"right",className:"w-full max-w-xl overflow-y-auto",children:[(0,b.jsxs)(_.SheetHeader,{children:[(0,b.jsx)(_.SheetTitle,{children:d("apiKeys.detail.title")}),(0,b.jsx)(_.SheetDescription,{children:d("apiKeys.detail.description")})]}),a?(0,b.jsxs)("div",{className:"space-y-5 mt-2",children:[(0,b.jsxs)("section",{className:"space-y-2.5",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:d("apiKeys.detail.basicInfo")}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(aL,{label:d("apiKeys.detail.credentialId"),children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("code",{className:"break-all font-mono text-xs",children:a.serviceCredentialId}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0",onClick:()=>g(a.serviceCredentialId,d("apiKeys.detail.credentialId")),children:(0,b.jsx)(Z.Copy,{className:"h-3 w-3"})})]})}),(0,b.jsx)(aL,{label:d("apiKeys.detail.credentialName"),children:(0,b.jsx)("span",{className:"text-sm",children:a.serviceCredentialName})}),(0,b.jsx)(aL,{label:d("apiKeys.detail.status"),children:(0,b.jsx)(t.Badge,{variant:"Active"===a.status?"success":"secondary",children:a.status})}),(0,b.jsx)(aL,{label:d("apiKeys.detail.ramUser"),children:(0,b.jsx)("span",{className:"break-all font-mono text-xs text-muted-foreground",children:a.userPrincipalName})}),(0,b.jsx)(aL,{label:d("apiKeys.detail.createdAt"),children:i?(0,b.jsx)(u.RelativeTime,{timestamp:i}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"—"})})]})]}),(0,b.jsx)($.Separator,{}),(0,b.jsxs)("section",{className:"space-y-2.5",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:d("apiKeys.detail.permissionOverview")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:d("apiKeys.detail.permissionOverviewDesc")}),(0,b.jsx)(aC,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName})]}),(0,b.jsx)($.Separator,{}),(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:d("apiKeys.detail.permissionConfig")}),(0,b.jsx)(ae,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,policies:f}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-foreground",children:d("apiKeys.detail.defaultAuth")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:d("apiKeys.detail.defaultAuthDesc")}),(0,b.jsx)(aJ,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName,policies:f})]}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-foreground",children:d("apiKeys.detail.customAuth")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:d("apiKeys.detail.customAuthDesc")}),(0,b.jsx)(ay,{serviceCredentialId:a.serviceCredentialId,userName:a.userPrincipalName})]})]})]}):null]})})}function aL({label:a,children:c}){return(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(U.Label,{className:"w-20 shrink-0 pt-0.5 text-xs text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"min-w-0 flex-1",children:c})]})}let aM=(0,f.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),aN={read:"apiKeys.operations.read",write:"apiKeys.operations.write",manage:"apiKeys.operations.manage"};function aO({onFilterResults:a}){let{t:d}=(0,v.useI18n)(),[e,f]=(0,c.useState)(!1),[g,i]=(0,c.useState)("knowledgebase"),[j,k]=(0,c.useState)(""),[l,n]=(0,c.useState)("read"),{data:p}=(0,aj.useKnowledgeBases)(),{data:q}=(0,ak.useMemoryStores)(),r="knowledgebase"===g?(p?.items??[]).map(a=>a.knowledgeBaseName):(q?.items??[]).map(a=>a.memoryStoreName),s=!!j,{data:u,isFetching:w,refetch:x}=(0,M.useQuery)({queryKey:["api-keys-filter-by-permission",g,j,l],queryFn:()=>J({resourceType:g,resourceName:j,operationGroup:l}),enabled:!1});return e?(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-3 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:d("apiKeys.filter.title")}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:function(){f(!1),k(""),a(null)},children:(0,b.jsx)(aB.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,b.jsxs)("div",{className:"space-y-1 min-w-[120px]",children:[(0,b.jsx)("label",{className:"text-[11px] text-muted-foreground",children:d("apiKeys.common.resourceType")}),(0,b.jsxs)(ai.Select,{value:g,onValueChange:b=>{i(b),k(""),a(null)},children:[(0,b.jsx)(ai.SelectTrigger,{className:"h-8 text-xs",children:(0,b.jsx)(ai.SelectValue,{})}),(0,b.jsxs)(ai.SelectContent,{children:[(0,b.jsx)(ai.SelectItem,{value:"knowledgebase",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(m.BookOpen,{className:"h-3 w-3"}),d("common.knowledgeBase")]})}),(0,b.jsx)(ai.SelectItem,{value:"memorystore",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(af.Brain,{className:"h-3 w-3"}),d("common.memory")]})})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1 min-w-[160px] flex-1",children:[(0,b.jsx)("label",{className:"text-[11px] text-muted-foreground",children:d("apiKeys.common.resourceName")}),(0,b.jsxs)(ai.Select,{value:j,onValueChange:b=>{k(b),a(null)},children:[(0,b.jsx)(ai.SelectTrigger,{className:"h-8 text-xs",children:(0,b.jsx)(ai.SelectValue,{placeholder:d("apiKeys.filter.selectResource")})}),(0,b.jsx)(ai.SelectContent,{children:r.map(a=>(0,b.jsx)(ai.SelectItem,{value:a,children:a},a))})]})]}),(0,b.jsxs)("div",{className:"space-y-1 min-w-[100px]",children:[(0,b.jsx)("label",{className:"text-[11px] text-muted-foreground",children:d("apiKeys.common.operationPermission")}),(0,b.jsxs)(ai.Select,{value:l,onValueChange:b=>{n(b),a(null)},children:[(0,b.jsx)(ai.SelectTrigger,{className:"h-8 text-xs",children:(0,b.jsx)(ai.SelectValue,{})}),(0,b.jsx)(ai.SelectContent,{children:["read","write","manage"].map(a=>(0,b.jsx)(ai.SelectItem,{value:a,children:d(aN[a])},a))})]})]}),(0,b.jsxs)(h.Button,{size:"sm",className:"h-8",disabled:!s||w,onClick:function(){s&&x().then(b=>{b.data&&a(new Set(b.data.apiKeys.map(a=>a.serviceCredentialId)))})},children:[w?(0,b.jsx)(o.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(aM,{className:"mr-1.5 h-3.5 w-3.5"}),d("apiKeys.filter.filter")]}),u?(0,b.jsx)(h.Button,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:function(){k(""),a(null)},children:d("common.clearSearch")}):null]}),u?(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[d("apiKeys.filter.resultPrefix")," ",(0,b.jsx)(t.Badge,{variant:"secondary",className:"px-1.5 py-0 text-xs",children:u.apiKeys.length})," ",d("apiKeys.filter.resultSuffix",{resource:"knowledgebase"===g?d("common.knowledgeBase"):d("common.memory"),name:j,operation:d(aN[l])})]}):null]}):(0,b.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:()=>f(!0),children:[(0,b.jsx)(aM,{className:"mr-2 h-3.5 w-3.5"}),d("apiKeys.filter.byPermission")]})}let aP=(0,f.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);function aQ({apiKey:a,onClose:d}){let{t:e}=(0,v.useI18n)(),[f,i]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&i(!1)},[a]);let j=!!a;async function k(a,b){try{await aa(a),l.toast.success(`${e("common.copied")} ${b}`)}catch{l.toast.error(e("common.copyFailed"))}}return(0,b.jsx)(V.Dialog,{open:j,onOpenChange:function(a){(a||f)&&(a||d())},children:(0,b.jsxs)(V.DialogContent,{className:"sm:max-w-lg",onEscapeKeyDown:a=>{f||a.preventDefault()},onPointerDownOutside:a=>{f||a.preventDefault()},children:[(0,b.jsxs)(V.DialogHeader,{children:[(0,b.jsx)(V.DialogTitle,{className:"text-xl",children:e("apiKeys.secret.title")}),(0,b.jsx)(V.DialogDescription,{children:e("apiKeys.secret.description")})]}),a?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-muted-foreground",children:e("apiKeys.secret.credentialIdLabel")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("code",{className:"flex-1 break-all rounded border border-[hsl(var(--border))] bg-muted/40 px-3 py-2 font-mono text-[13px]",children:a.serviceCredentialId}),(0,b.jsx)(h.Button,{variant:"outline",size:"icon",onClick:()=>k(a.serviceCredentialId,e("apiKeys.common.credentialId")),"aria-label":e("apiKeys.secret.copyCredentialId"),children:(0,b.jsx)(Z.Copy,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(U.Label,{className:"text-xs text-muted-foreground",children:e("apiKeys.secret.secretLabel")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("code",{className:"flex-1 break-all rounded border border-[hsl(var(--warning))/0.5] bg-[hsl(var(--warning))/0.06] px-3 py-2 font-mono text-[13px]",children:a.serviceCredentialSecret}),(0,b.jsx)(h.Button,{variant:"outline",size:"icon",onClick:()=>k(a.serviceCredentialSecret,"Secret"),"aria-label":e("apiKeys.secret.copySecret"),children:(0,b.jsx)(Z.Copy,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)(h.Button,{variant:"outline",className:"w-full",onClick:function(){if(!a)return;let b=a.serviceCredentialId.slice(-6),c=new Date().toISOString().replace(/[:.]/g,"-"),d=new Blob([`ServiceCredentialId: ${a.serviceCredentialId}
2
2
  ServiceCredentialSecret: ${a.serviceCredentialSecret}
3
3
  ServiceCredentialName: ${a.serviceCredentialName}
4
4
  ServiceName: ${a.serviceName}
@@ -6,6 +6,6 @@ CreateTime: ${a.createTime}
6
6
  UserPrincipalName: ${a.userPrincipalName}
7
7
 
8
8
  WARNING: This secret cannot be retrieved again. Store it safely.
9
- `],{type:"text/plain;charset=utf-8"}),e=URL.createObjectURL(d),f=document.createElement("a");f.href=e,f.download=`tablestore-api-key-${b}-${c}.txt`,document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(e)},children:[(0,b.jsx)(aO,{className:"mr-2 h-4 w-4"}),"下载为 .txt 文件"]}),(0,b.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-[hsl(var(--destructive))/0.4] bg-[hsl(var(--destructive))/0.05] px-3 py-2.5",children:[(0,b.jsx)(g,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,b.jsxs)(T.Label,{className:"flex items-start gap-2 text-xs leading-relaxed text-foreground",children:[(0,b.jsx)(W.Checkbox,{checked:e,onCheckedChange:a=>f(!!a),className:"mt-0.5"}),(0,b.jsx)("span",{children:"我已妥善保存凭证 ID 和 Secret,理解 Secret 不可再次取回。"})]})]})]}):null,(0,b.jsx)(U.DialogFooter,{children:(0,b.jsx)(h.Button,{variant:"default",disabled:!e,onClick:()=>d(),children:"完成"})})]})})}function aQ({message:a}){return(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--destructive))/0.5] bg-[hsl(var(--destructive))/0.05] p-6",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(g,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),(0,b.jsxs)("div",{className:"space-y-2 text-sm leading-relaxed",children:[(0,b.jsx)("p",{className:"font-semibold text-foreground",children:"权限不足,无法管理 API Key"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"当前 Dashboard 使用的 AccessKey 未被授予 IMS/RAM 管理权限。要使用本页面,请:"}),(0,b.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground",children:[(0,b.jsx)("li",{children:"切换为主账号 AccessKey,或"}),(0,b.jsxs)("li",{children:["为子账号挂载"," ",(0,b.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"AliyunRAMReadOnlyAccess"})," ","(仅查看)或"," ",(0,b.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"AliyunRAMFullAccess"})," ","(含管理)。"]})]}),a?(0,b.jsx)("p",{className:"break-all rounded bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:a}):null]})]})})}a.s(["default",0,function(){let{data:a,isLoading:f,isError:l,error:m,refetch:n}=function(){let{context:a,ready:b}=(0,M.useRuntimeContext)();return(0,L.useQuery)({queryKey:K.queryKeys.apiKeys(a.dataScopeKey),queryFn:y,enabled:b,staleTime:3e4})}(),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(null),[w,z]=(0,c.useState)(null),A=a??[],B=null!==w?A.filter(a=>w.has(a.serviceCredentialId)):A,C=l&&m instanceof x.ApiClientError&&"FORBIDDEN"===m.code;return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(k.PageHeader,{title:"API Key 管理",description:"管理 Tablestore(ots.aliyuncs.com)服务凭证;Secret 仅在创建时显示一次,请妥善保管",children:(0,b.jsxs)(h.Button,{onClick:()=>p(!0),disabled:l&&!C,children:[(0,b.jsx)(e.Plus,{className:"mr-2 h-4 w-4"}),"新建 API Key"]})}),f?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-12 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-12 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-12 w-full"})]}):C?(0,b.jsx)(aQ,{message:m instanceof Error?m.message:""}):l?(0,b.jsx)(j.EmptyState,{icon:g,title:"加载失败",description:m instanceof Error?m.message:"未知错误",action:(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>n(),children:"重试"})}):0===A.length?(0,b.jsx)(j.EmptyState,{icon:d.KeyRound,title:"还没有 API Key",description:"为当前账号创建一个服务凭证以接入 Tablestore",action:(0,b.jsxs)(h.Button,{onClick:()=>p(!0),children:[(0,b.jsx)(e.Plus,{className:"mr-2 h-4 w-4"}),"新建 API Key"]})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aN,{onFilterResults:z}),(0,b.jsx)(O,{apiKeys:B,onDelete:a=>r(a),onDetail:a=>t(a)})]}),(0,b.jsx)(V,{open:o,onOpenChange:p,onCreated:a=>v(a)}),(0,b.jsx)(aP,{apiKey:u,onClose:()=>v(null)}),(0,b.jsx)(aJ,{apiKey:s,onClose:()=>t(null)}),(0,b.jsx)(X,{apiKey:q,open:!!q,onOpenChange:a=>{a||r(null)}})]})}],722424)}];
9
+ `],{type:"text/plain;charset=utf-8"}),e=URL.createObjectURL(d),f=document.createElement("a");f.href=e,f.download=`tablestore-api-key-${b}-${c}.txt`,document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(e)},children:[(0,b.jsx)(aP,{className:"mr-2 h-4 w-4"}),e("apiKeys.secret.download")]}),(0,b.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-[hsl(var(--destructive))/0.4] bg-[hsl(var(--destructive))/0.05] px-3 py-2.5",children:[(0,b.jsx)(g,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,b.jsxs)(U.Label,{className:"flex items-start gap-2 text-xs leading-relaxed text-foreground",children:[(0,b.jsx)(X.Checkbox,{checked:f,onCheckedChange:a=>i(!!a),className:"mt-0.5"}),(0,b.jsx)("span",{children:e("apiKeys.secret.confirmSaved")})]})]})]}):null,(0,b.jsx)(V.DialogFooter,{children:(0,b.jsx)(h.Button,{variant:"default",disabled:!f,onClick:()=>d(),children:e("common.done")})})]})})}function aR({message:a}){let{t:c}=(0,v.useI18n)();return(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--destructive))/0.5] bg-[hsl(var(--destructive))/0.05] p-6",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(g,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),(0,b.jsxs)("div",{className:"space-y-2 text-sm leading-relaxed",children:[(0,b.jsx)("p",{className:"font-semibold text-foreground",children:c("apiKeys.page.forbiddenTitle")}),(0,b.jsx)("p",{className:"text-muted-foreground",children:c("apiKeys.page.forbiddenIntro")}),(0,b.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground",children:[(0,b.jsx)("li",{children:c("apiKeys.page.forbiddenSwitchAccount")}),(0,b.jsxs)("li",{children:[c("apiKeys.page.forbiddenAttachPrefix"),(0,b.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"AliyunRAMReadOnlyAccess"}),c("apiKeys.page.forbiddenAttachMiddle"),(0,b.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"AliyunRAMFullAccess"}),c("apiKeys.page.forbiddenAttachSuffix")]})]}),a?(0,b.jsx)("p",{className:"break-all rounded bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:a}):null]})]})})}a.s(["default",0,function(){let{t:a}=(0,v.useI18n)(),{data:f,isLoading:l,isError:m,error:n,refetch:o}=function(){let{context:a,ready:b}=(0,N.useRuntimeContext)();return(0,M.useQuery)({queryKey:L.queryKeys.apiKeys(a.dataScopeKey),queryFn:z,enabled:b,staleTime:3e4})}(),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null),[w,x]=(0,c.useState)(null),[A,B]=(0,c.useState)(null),C=f??[],D=null!==A?C.filter(a=>A.has(a.serviceCredentialId)):C,E=m&&n instanceof y.ApiClientError&&"FORBIDDEN"===n.code;return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(k.PageHeader,{title:a("apiKeys.page.title"),description:a("apiKeys.page.description"),children:(0,b.jsxs)(h.Button,{onClick:()=>q(!0),disabled:m&&!E,children:[(0,b.jsx)(e.Plus,{className:"mr-2 h-4 w-4"}),a("apiKeys.page.create")]})}),l?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-12 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-12 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-12 w-full"})]}):E?(0,b.jsx)(aR,{message:n instanceof Error?n.message:""}):m?(0,b.jsx)(j.EmptyState,{icon:g,title:a("apiKeys.page.loadFailed"),description:n instanceof Error?n.message:a("common.unknownError"),action:(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>o(),children:a("common.retry")})}):0===C.length?(0,b.jsx)(j.EmptyState,{icon:d.KeyRound,title:a("apiKeys.page.emptyTitle"),description:a("apiKeys.page.emptyDescription"),action:(0,b.jsxs)(h.Button,{onClick:()=>q(!0),children:[(0,b.jsx)(e.Plus,{className:"mr-2 h-4 w-4"}),a("apiKeys.page.create")]})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aO,{onFilterResults:B}),(0,b.jsx)(P,{apiKeys:D,onDelete:a=>s(a),onDetail:a=>u(a)})]}),(0,b.jsx)(W,{open:p,onOpenChange:q,onCreated:a=>x(a)}),(0,b.jsx)(aQ,{apiKey:w,onClose:()=>x(null)}),(0,b.jsx)(aK,{apiKey:t,onClose:()=>u(null)}),(0,b.jsx)(Y,{apiKey:r,open:!!r,onOpenChange:a=>{a||s(null)}})]})}],722424)}];
10
10
 
11
11
  //# sourceMappingURL=dashboard_src_app_%28dashboard%29_api-keys_page_tsx_0lb6fu7._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[350592,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(776192);a.s(["default",0,function({error:a,reset:e}){return(0,c.useEffect)(()=>{console.error("Knowledge base error:",a)},[a]),(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[(0,b.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:"加载知识库时出错"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:a.message||"发生了未知错误,请稍后重试。"}),(0,b.jsx)(d.Button,{onClick:e,variant:"outline",children:"重试"})]})}])}];
1
+ module.exports=[350592,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(776192),e=a.i(543320);a.s(["default",0,function({error:a,reset:f}){let{t:g}=(0,e.useI18n)();return(0,c.useEffect)(()=>{console.error("Knowledge base error:",a)},[a]),(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[(0,b.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:g("knowledgeBase.list.errorTitle")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:a.message||g("knowledgeBase.list.errorDescription")}),(0,b.jsx)(d.Button,{onClick:f,variant:"outline",children:g("common.retry")})]})}])}];
2
2
 
3
3
  //# sourceMappingURL=dashboard_src_app_%28dashboard%29_knowledge-base_%5Bname%5D_error_tsx_0rnss~4._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[525538,a=>{"use strict";var b=a.i(634020),c=a.i(412583),d=a.i(700623),e=a.i(502482),f=a.i(971938),g=a.i(880470),h=a.i(71562),i=a.i(771071),j=a.i(263265),k=a.i(201927),l=a.i(53520),m=a.i(649707),n=a.i(776192),o=a.i(172518),p=a.i(470535),q=a.i(674024),r=a.i(692942),s=a.i(27692),t=a.i(663525),u=a.i(436965),v=a.i(123331),w=a.i(25825),x=a.i(655295);let y=[{value:"string",label:"String"},{value:"long",label:"Long"},{value:"double",label:"Double"},{value:"boolean",label:"Boolean"},{value:"date",label:"Date"},{value:"string_list",label:"String List"},{value:"long_list",label:"Long List"},{value:"double_list",label:"Double List"},{value:"boolean_list",label:"Boolean List"},{value:"date_list",label:"Date List"}];function z({value:a,onChange:c}){let d=(0,f.useCallback)(()=>{c([...a,{name:"",type:"string"}])},[a,c]),e=(0,f.useCallback)(b=>{c(a.filter((a,c)=>c!==b))},[a,c]),g=(0,f.useCallback)((b,d)=>{c(a.map((a,c)=>c===b?{...a,...d}:a))},[a,c]);return(0,b.jsxs)("div",{className:"space-y-2",children:[a.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(o.Input,{value:a.name,onChange:a=>g(c,{name:a.target.value}),placeholder:"字段名",className:"h-9 flex-1"}),(0,b.jsxs)(t.Select,{value:a.type,onValueChange:a=>g(c,{type:a}),children:[(0,b.jsx)(t.SelectTrigger,{className:"h-9 w-[140px]",children:(0,b.jsx)(t.SelectValue,{})}),(0,b.jsx)(t.SelectContent,{children:y.map(a=>(0,b.jsx)(t.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsx)(n.Button,{type:"button",variant:"ghost",size:"icon",onClick:()=>e(c),className:"h-9 w-9 text-muted-foreground hover:text-destructive hover:bg-destructive/10","aria-label":`删除字段 ${a.name||c+1}`,children:(0,b.jsx)(x.Trash2,{size:16})})]},c)),(0,b.jsxs)(n.Button,{type:"button",variant:"ghost",onClick:d,className:"gap-1.5 text-primary hover:bg-primary/10",children:[(0,b.jsx)(w.Plus,{size:16}),"添加字段"]})]})}let A=[2048,1536,1024,768,512,256,128,64],B={"text-embedding-v3":[1024,768,512,256,128,64],"text-embedding-v4":A,"qwen3-vl-embedding":[2560,2048,1536,1024,768,512,256]};function C({form:a}){let c=(0,h.useWatch)({control:a.control,name:"embeddingConfiguration.provider"}),d=B[(0,h.useWatch)({control:a.control,name:"embeddingConfiguration.model"})??""]??A,e=b=>{a.setValue("embeddingConfiguration.model",b),a.setValue("embeddingConfiguration.dimension",1024)};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.provider",render:({field:c})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"提供方"}),(0,b.jsxs)(t.Select,{onValueChange:b=>{c.onChange(b),"bailian"===b?(a.setValue("embeddingConfiguration.model","text-embedding-v4"),a.setValue("embeddingConfiguration.dimension",1024)):a.setValue("embeddingConfiguration.model","")},defaultValue:c.value,children:[(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:"选择 Embedding 提供方"})})}),(0,b.jsxs)(t.SelectContent,{children:[(0,b.jsx)(t.SelectItem,{value:"bailian",children:"百炼 (Bailian)"}),(0,b.jsx)(t.SelectItem,{value:"custom",children:"自定义 (Custom)"})]})]}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.model",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"模型名称"}),(0,b.jsx)(r.FormControl,{children:"bailian"===c?(0,b.jsxs)(t.Select,{onValueChange:e,value:a.value,children:[(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:"选择模型"})}),(0,b.jsxs)(t.SelectContent,{children:[(0,b.jsx)(t.SelectItem,{value:"text-embedding-v3",children:"text-embedding-v3"}),(0,b.jsx)(t.SelectItem,{value:"text-embedding-v4",children:"text-embedding-v4"}),(0,b.jsx)(t.SelectItem,{value:"qwen3-vl-embedding",children:"qwen3-vl-embedding (多模态)"})]})]}):(0,b.jsx)(o.Input,{placeholder:"输入模型名称",...a})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.dimension",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"向量维度"}),(0,b.jsx)(r.FormControl,{children:"bailian"===c?(0,b.jsxs)(t.Select,{onValueChange:b=>a.onChange(Number(b)),value:String(a.value),children:[(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:"选择维度"})}),(0,b.jsx)(t.SelectContent,{children:d.map(a=>(0,b.jsx)(t.SelectItem,{value:String(a),children:a.toLocaleString()},a))})]}):(0,b.jsx)(o.Input,{type:"number",placeholder:"例如: 1024",...a,onChange:b=>a.onChange(Number(b.target.value))})}),(0,b.jsx)(r.FormMessage,{})]})}),"custom"===c&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.apiKey",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"API Key"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"password",placeholder:"输入 API Key",...a,value:a.value??""})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.url",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"API URL"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{placeholder:"https://your-embedding-service.com/v1/embeddings",...a,value:a.value??""})}),(0,b.jsx)(r.FormMessage,{})]})})]})]})}var D=a.i(569622),E=a.i(228058),F=a.i(933596),G=a.i(895487),H=a.i(869024),I=a.i(225377),J=a.i(617566);function K(){let a,c=(0,g.useRouter)(),d=(a=(0,G.useQueryClient)(),(0,F.useMutation)({mutationFn:a=>(0,H.createKnowledgeBase)(a),onSuccess:()=>{(0,I.invalidateKnowledgeBaseQueries)(a)}})),e=(0,h.useForm)({resolver:(0,i.zodResolver)(J.createKBSchema),defaultValues:{knowledgeBaseName:"",description:"",subspace:!1,multimodal:!0,ingestConfiguration:{enableTableFormulaCaption:!1},tags:[],metadata:[],embeddingConfiguration:{provider:"bailian",model:"qwen3-vl-embedding",dimension:1024},retrievalConfiguration:{searchType:["DENSE_VECTOR","FULL_TEXT"],denseVectorSearchConfiguration:{numberOfResults:20},fullTextSearchConfiguration:{numberOfResults:20},rerankingConfiguration:{type:"WEIGHT",numberOfResults:20,rrfConfiguration:{denseVectorSearchWeight:.5,fullTextSearchWeight:.5,k:60},weightConfiguration:{denseVectorSearchWeight:.7,fullTextSearchWeight:.3},modelConfiguration:{provider:"bailian",model:"qwen3-vl-rerank"}}}}}),w=(0,f.useRef)(!0),x=e.watch("multimodal");(0,f.useEffect)(()=>{x!==w.current&&(w.current=x??!1,x?(e.setValue("embeddingConfiguration.model","qwen3-vl-embedding"),e.setValue("embeddingConfiguration.dimension",1024),e.setValue("retrievalConfiguration.rerankingConfiguration.modelConfiguration.model","qwen3-vl-rerank")):(e.setValue("embeddingConfiguration.model","text-embedding-v4"),e.setValue("embeddingConfiguration.dimension",1024),e.setValue("retrievalConfiguration.rerankingConfiguration.modelConfiguration.model","gte-rerank-v2")))},[x,e]);let y=e.watch("retrievalConfiguration.rerankingConfiguration.type"),A=a=>"space-y-4 rounded-md border p-4 transition-colors "+(a?"border-[hsl(var(--primary)/0.4)] bg-[hsl(var(--primary)/0.04)]":"border-border bg-transparent");async function B(a){try{let b={...a,multimodal:a.multimodal||void 0,ingestConfiguration:a.ingestConfiguration?.enableTableFormulaCaption?a.ingestConfiguration:void 0,retrievalConfiguration:a.retrievalConfiguration?(0,E.buildKnowledgeBaseRetrievalConfiguration)(a.retrievalConfiguration):void 0};await d.mutateAsync(b),j.toast.success("知识库创建成功"),c.push("/knowledge-base")}catch(b){let a=b instanceof Error?b.message:"创建知识库失败";j.toast.error(a)}}return(0,b.jsx)(r.Form,{...e,children:(0,b.jsxs)("form",{onSubmit:e.handleSubmit(B),className:"space-y-8",children:[(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:"基本信息"}),(0,b.jsx)(r.FormField,{control:e.control,name:"knowledgeBaseName",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsxs)(r.FormLabel,{children:["名称 ",(0,b.jsx)("span",{className:"text-[hsl(var(--destructive))]",children:"*"})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{placeholder:"my_knowledge_base",...a})}),(0,b.jsx)(r.FormDescription,{children:"以字母开头,仅包含字母、数字和下划线,最长 64 字符"}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"description",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"描述"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(p.Textarea,{placeholder:"描述这个知识库的用途...",className:"resize-none",rows:3,...a})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"tags",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"标签"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(v.TagInput,{value:a.value??[],onChange:a.onChange,placeholder:"输入标签后按回车"})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"subspace",render:({field:a})=>(0,b.jsxs)(r.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.FormLabel,{className:"text-sm",children:"启用 Subspace"}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:"为该知识库开启子空间隔离,不同业务线的数据互不干扰"})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(q.Switch,{checked:a.value??!1,onCheckedChange:a.onChange})})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"multimodal",render:({field:a})=>(0,b.jsxs)(r.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.FormLabel,{className:"text-sm",children:"多模态"}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:"支持图片文档入库、图片检索和多模态 embedding/rerank。创建后不可修改。"})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(q.Switch,{checked:a.value??!1,onCheckedChange:a.onChange})})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"ingestConfiguration.enableTableFormulaCaption",render:({field:a})=>(0,b.jsxs)(r.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.FormLabel,{className:"text-sm",children:"表格公式Caption"}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:"为表格、公式类 Chunk 生成语义描述。需要平台开启对应 setting。普通 KB 和多模态 KB 均可使用。"})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(q.Switch,{checked:a.value??!1,onCheckedChange:a.onChange})})]})})]}),(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:"Metadata Schema"}),(0,b.jsx)(r.FormField,{control:e.control,name:"metadata",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(z,{value:a.value??[],onChange:a.onChange})}),(0,b.jsx)(r.FormMessage,{})]})})]}),(0,b.jsxs)(s.Collapsible,{children:[(0,b.jsx)(s.CollapsibleTrigger,{asChild:!0,children:(0,b.jsxs)(n.Button,{type:"button",variant:"ghost",className:"flex w-full items-center justify-between p-0 text-lg font-semibold hover:bg-transparent",children:["高级配置",(0,b.jsx)(k.ChevronDown,{className:"h-4 w-4 transition-transform duration-200 [[data-state=open]>&]:rotate-180"})]})}),(0,b.jsxs)(s.CollapsibleContent,{className:"mt-4 space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("h4",{className:"text-base font-medium text-foreground",children:"Embedding 配置"}),e.watch("multimodal")&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground bg-muted/30 rounded-md p-2",children:["已自动将 embedding 模型切换为 ",(0,b.jsx)("code",{children:"qwen3-vl-embedding"}),",rerank 模型切换为 ",(0,b.jsx)("code",{children:"qwen3-vl-rerank"}),"。您仍可手动调整下方参数。"]}),(0,b.jsx)(C,{form:e})]}),(0,b.jsx)("hr",{className:"border-border"}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("h4",{className:"text-base font-medium text-foreground",children:"检索配置"}),(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.searchType",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"搜索类型"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsxs)(u.ToggleGroup,{type:"multiple",value:a.value??[],onValueChange:b=>{b?.length&&a.onChange(b)},className:"grid w-full grid-cols-2 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md",children:[(0,b.jsxs)(u.ToggleGroupItem,{value:"DENSE_VECTOR",className:"h-9 gap-1.5",children:[a.value?.includes("DENSE_VECTOR")&&(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}),"向量检索"]}),(0,b.jsxs)(u.ToggleGroupItem,{value:"FULL_TEXT",className:"h-9 gap-1.5",children:[a.value?.includes("FULL_TEXT")&&(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}),"全文检索"]})]})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-sm font-medium text-[hsl(var(--foreground))]",children:"返回数量"}),(0,b.jsx)("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"控制每路召回参与排序的候选数,以及 Rerank 后实际返回的片段数。"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(260px,100%),1fr))] gap-3",children:[(0,b.jsx)(D.RetrievalResultCountField,{control:e.control,name:"retrievalConfiguration.denseVectorSearchConfiguration.numberOfResults",label:"向量召回数",description:"向量检索参与后续排序的候选片段数。",max:100,muted:!e.watch("retrievalConfiguration.searchType")?.includes("DENSE_VECTOR")}),(0,b.jsx)(D.RetrievalResultCountField,{control:e.control,name:"retrievalConfiguration.fullTextSearchConfiguration.numberOfResults",label:"全文召回数",description:"全文检索参与后续排序的候选片段数。",max:100,muted:!e.watch("retrievalConfiguration.searchType")?.includes("FULL_TEXT")})]}),(0,b.jsx)(D.RetrievalResultCountField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.numberOfResults",label:"重排序返回数",description:"Rerank 后保留并返回的片段数。",max:200})]}),(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.type",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"默认 Rerank 策略"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsxs)(u.ToggleGroup,{type:"single",value:a.value??"",onValueChange:b=>{b&&a.onChange(b)},className:"grid w-full grid-cols-3 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md",children:[(0,b.jsx)(u.ToggleGroupItem,{value:"MODEL",className:"h-9",children:"Model"}),(0,b.jsx)(u.ToggleGroupItem,{value:"WEIGHT",className:"h-9",children:"Weight"}),(0,b.jsx)(u.ToggleGroupItem,{value:"RRF",className:"h-9",children:"RRF"})]})}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:"切换策略会影响检索时的默认行为;下方三套参数都会保存到知识库,方便临时切换"}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsxs)("div",{className:A("MODEL"===y),children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Model 参数"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.modelConfiguration.provider",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"提供方"}),(0,b.jsxs)(t.Select,{onValueChange:a.onChange,value:a.value??"",children:[(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:"选择提供方"})})}),(0,b.jsx)(t.SelectContent,{children:(0,b.jsx)(t.SelectItem,{value:"bailian",children:"百炼 (Bailian)"})})]}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.modelConfiguration.model",render:({field:a})=>{let c=e.watch("retrievalConfiguration.rerankingConfiguration.modelConfiguration.provider");return(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"模型名称"}),(0,b.jsx)(r.FormControl,{children:"bailian"===c?(0,b.jsxs)(t.Select,{onValueChange:a.onChange,value:a.value??"",children:[(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:"选择模型"})}),(0,b.jsxs)(t.SelectContent,{children:[(0,b.jsx)(t.SelectItem,{value:"gte-rerank-v2",children:"gte-rerank-v2"}),(0,b.jsx)(t.SelectItem,{value:"qwen3-rerank",children:"qwen3-rerank"}),(0,b.jsx)(t.SelectItem,{value:"qwen3-vl-rerank",children:"qwen3-vl-rerank (多模态)"})]})]}):(0,b.jsx)(o.Input,{placeholder:"输入模型名称",...a,value:a.value??""})}),(0,b.jsx)(r.FormMessage,{})]})}})]})]}),(0,b.jsxs)("div",{className:A("WEIGHT"===y),children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Weight 参数"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.weightConfiguration.denseVectorSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"向量检索权重"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",min:"0",max:"1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormDescription,{children:"0 ~ 1 之间"}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.weightConfiguration.fullTextSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"全文检索权重"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",min:"0",max:"1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormDescription,{children:"0 ~ 1 之间"}),(0,b.jsx)(r.FormMessage,{})]})})]})]}),(0,b.jsxs)("div",{className:A("RRF"===y),children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"RRF 参数"}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.denseVectorSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"向量检索权重"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.fullTextSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"全文检索权重"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:e.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.k",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"K 值"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",placeholder:"60",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormMessage,{})]})})]})]})]})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[(0,b.jsx)(n.Button,{type:"button",variant:"outline",onClick:()=>c.back(),children:"取消"}),(0,b.jsx)(n.Button,{type:"submit",disabled:d.isPending,children:d.isPending?"创建中...":"创建知识库"})]})]})})}a.s(["default",0,function(){return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)(c.default,{href:"/knowledge-base",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4",children:[(0,b.jsx)(d.ArrowLeft,{className:"h-4 w-4"}),"返回知识库列表"]}),(0,b.jsx)(e.PageHeader,{title:"创建知识库"})]}),(0,b.jsx)("div",{className:"max-w-2xl",children:(0,b.jsx)(K,{})})]})}],525538)}];
1
+ module.exports=[525538,a=>{"use strict";var b=a.i(634020),c=a.i(412583),d=a.i(700623),e=a.i(502482),f=a.i(971938),g=a.i(880470),h=a.i(71562),i=a.i(771071),j=a.i(263265),k=a.i(201927),l=a.i(53520),m=a.i(649707),n=a.i(776192),o=a.i(172518),p=a.i(470535),q=a.i(674024),r=a.i(692942),s=a.i(27692),t=a.i(663525),u=a.i(436965),v=a.i(123331),w=a.i(25825),x=a.i(655295),y=a.i(543320);let z=[{value:"string",label:"String"},{value:"long",label:"Long"},{value:"double",label:"Double"},{value:"boolean",label:"Boolean"},{value:"date",label:"Date"},{value:"string_list",label:"String List"},{value:"long_list",label:"Long List"},{value:"double_list",label:"Double List"},{value:"boolean_list",label:"Boolean List"},{value:"date_list",label:"Date List"}];function A({value:a,onChange:c}){let{t:d}=(0,y.useI18n)(),e=(0,f.useCallback)(()=>{c([...a,{name:"",type:"string"}])},[a,c]),g=(0,f.useCallback)(b=>{c(a.filter((a,c)=>c!==b))},[a,c]),h=(0,f.useCallback)((b,d)=>{c(a.map((a,c)=>c===b?{...a,...d}:a))},[a,c]);return(0,b.jsxs)("div",{className:"space-y-2",children:[a.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(o.Input,{value:a.name,onChange:a=>h(c,{name:a.target.value}),placeholder:d("common.fieldNamePlaceholder"),className:"h-9 flex-1"}),(0,b.jsxs)(t.Select,{value:a.type,onValueChange:a=>h(c,{type:a}),children:[(0,b.jsx)(t.SelectTrigger,{className:"h-9 w-[140px]",children:(0,b.jsx)(t.SelectValue,{})}),(0,b.jsx)(t.SelectContent,{children:z.map(a=>(0,b.jsx)(t.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsx)(n.Button,{type:"button",variant:"ghost",size:"icon",onClick:()=>g(c),className:"h-9 w-9 text-muted-foreground hover:text-destructive hover:bg-destructive/10","aria-label":d("common.removeField",{name:a.name||c+1}),children:(0,b.jsx)(x.Trash2,{size:16})})]},c)),(0,b.jsxs)(n.Button,{type:"button",variant:"ghost",onClick:e,className:"gap-1.5 text-primary hover:bg-primary/10",children:[(0,b.jsx)(w.Plus,{size:16}),d("common.addField")]})]})}let B=[2048,1536,1024,768,512,256,128,64],C={"text-embedding-v3":[1024,768,512,256,128,64],"text-embedding-v4":B,"qwen3-vl-embedding":[2560,2048,1536,1024,768,512,256]};function D({form:a}){let{t:c}=(0,y.useI18n)(),d=(0,h.useWatch)({control:a.control,name:"embeddingConfiguration.provider"}),e=C[(0,h.useWatch)({control:a.control,name:"embeddingConfiguration.model"})??""]??B,f=b=>{a.setValue("embeddingConfiguration.model",b),a.setValue("embeddingConfiguration.dimension",1024)};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.provider",render:({field:d})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:c("knowledgeBase.provider.label")}),(0,b.jsxs)(t.Select,{onValueChange:b=>{d.onChange(b),"bailian"===b?(a.setValue("embeddingConfiguration.model","text-embedding-v4"),a.setValue("embeddingConfiguration.dimension",1024)):a.setValue("embeddingConfiguration.model","")},defaultValue:d.value,children:[(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:c("knowledgeBase.embedding.selectProvider")})})}),(0,b.jsxs)(t.SelectContent,{children:[(0,b.jsx)(t.SelectItem,{value:"bailian",children:c("knowledgeBase.provider.bailian")}),(0,b.jsx)(t.SelectItem,{value:"custom",children:c("knowledgeBase.provider.custom")})]})]}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.model",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:c("knowledgeBase.provider.modelName")}),(0,b.jsx)(r.FormControl,{children:"bailian"===d?(0,b.jsxs)(t.Select,{onValueChange:f,value:a.value,children:[(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:c("knowledgeBase.provider.selectModel")})}),(0,b.jsxs)(t.SelectContent,{children:[(0,b.jsx)(t.SelectItem,{value:"text-embedding-v3",children:"text-embedding-v3"}),(0,b.jsx)(t.SelectItem,{value:"text-embedding-v4",children:"text-embedding-v4"}),(0,b.jsxs)(t.SelectItem,{value:"qwen3-vl-embedding",children:["qwen3-vl-embedding",c("knowledgeBase.provider.multimodalSuffix")]})]})]}):(0,b.jsx)(o.Input,{placeholder:c("knowledgeBase.provider.inputModelName"),...a})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.dimension",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:c("knowledgeBase.embedding.dimension")}),(0,b.jsx)(r.FormControl,{children:"bailian"===d?(0,b.jsxs)(t.Select,{onValueChange:b=>a.onChange(Number(b)),value:String(a.value),children:[(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:c("knowledgeBase.embedding.selectDimension")})}),(0,b.jsx)(t.SelectContent,{children:e.map(a=>(0,b.jsx)(t.SelectItem,{value:String(a),children:a.toLocaleString()},a))})]}):(0,b.jsx)(o.Input,{type:"number",placeholder:c("knowledgeBase.embedding.dimensionPlaceholder"),...a,onChange:b=>a.onChange(Number(b.target.value))})}),(0,b.jsx)(r.FormMessage,{})]})}),"custom"===d&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.apiKey",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"API Key"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"password",placeholder:c("knowledgeBase.embedding.apiKeyPlaceholder"),...a,value:a.value??""})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:a.control,name:"embeddingConfiguration.url",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:"API URL"}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{placeholder:"https://your-embedding-service.com/v1/embeddings",...a,value:a.value??""})}),(0,b.jsx)(r.FormMessage,{})]})})]})]})}var E=a.i(569622),F=a.i(228058),G=a.i(933596),H=a.i(895487),I=a.i(869024),J=a.i(225377),K=a.i(617566);function L(){let{locale:a}=(0,y.useI18n)();return(0,b.jsx)(M,{},a)}function M(){let a,c=(0,g.useRouter)(),d=(a=(0,H.useQueryClient)(),(0,G.useMutation)({mutationFn:a=>(0,I.createKnowledgeBase)(a),onSuccess:()=>{(0,J.invalidateKnowledgeBaseQueries)(a)}})),{t:e}=(0,y.useI18n)(),w=(0,f.useMemo)(()=>(0,K.buildCreateKBSchema)(e),[e]),x=(0,h.useForm)({resolver:(0,i.zodResolver)(w),defaultValues:{knowledgeBaseName:"",description:"",subspace:!1,multimodal:!0,ingestConfiguration:{enableTableFormulaCaption:!1},tags:[],metadata:[],embeddingConfiguration:{provider:"bailian",model:"qwen3-vl-embedding",dimension:1024},retrievalConfiguration:{searchType:["DENSE_VECTOR","FULL_TEXT"],denseVectorSearchConfiguration:{numberOfResults:20},fullTextSearchConfiguration:{numberOfResults:20},rerankingConfiguration:{type:"WEIGHT",numberOfResults:20,rrfConfiguration:{denseVectorSearchWeight:.5,fullTextSearchWeight:.5,k:60},weightConfiguration:{denseVectorSearchWeight:.7,fullTextSearchWeight:.3},modelConfiguration:{provider:"bailian",model:"qwen3-vl-rerank"}}}}}),z=(0,f.useRef)(!0),B=x.watch("multimodal");(0,f.useEffect)(()=>{B!==z.current&&(z.current=B??!1,B?(x.setValue("embeddingConfiguration.model","qwen3-vl-embedding"),x.setValue("embeddingConfiguration.dimension",1024),x.setValue("retrievalConfiguration.rerankingConfiguration.modelConfiguration.model","qwen3-vl-rerank")):(x.setValue("embeddingConfiguration.model","text-embedding-v4"),x.setValue("embeddingConfiguration.dimension",1024),x.setValue("retrievalConfiguration.rerankingConfiguration.modelConfiguration.model","gte-rerank-v2")))},[B,x]);let C=x.watch("retrievalConfiguration.rerankingConfiguration.type"),L=a=>"space-y-4 rounded-md border p-4 transition-colors "+(a?"border-[hsl(var(--primary)/0.4)] bg-[hsl(var(--primary)/0.04)]":"border-border bg-transparent");async function M(a){try{let b={...a,multimodal:a.multimodal||void 0,ingestConfiguration:a.ingestConfiguration?.enableTableFormulaCaption?a.ingestConfiguration:void 0,retrievalConfiguration:a.retrievalConfiguration?(0,F.buildKnowledgeBaseRetrievalConfiguration)(a.retrievalConfiguration):void 0};await d.mutateAsync(b),j.toast.success(e("knowledgeBase.create.createSuccess")),c.push("/knowledge-base")}catch(b){let a=b instanceof Error?b.message:e("knowledgeBase.create.createFailed");j.toast.error(a)}}return(0,b.jsx)(r.Form,{...x,children:(0,b.jsxs)("form",{onSubmit:x.handleSubmit(M),className:"space-y-8",children:[(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:e("knowledgeBase.common.basicInfo")}),(0,b.jsx)(r.FormField,{control:x.control,name:"knowledgeBaseName",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsxs)(r.FormLabel,{children:[e("knowledgeBase.create.nameRequiredMark")," ",(0,b.jsx)("span",{className:"text-[hsl(var(--destructive))]",children:"*"})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{placeholder:e("knowledgeBase.create.namePlaceholder"),...a})}),(0,b.jsx)(r.FormDescription,{children:e("knowledgeBase.create.nameDesc")}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"description",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.description")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(p.Textarea,{placeholder:e("knowledgeBase.common.descriptionPlaceholder"),className:"resize-none",rows:3,...a})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"tags",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.tags")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(v.TagInput,{value:a.value??[],onChange:a.onChange,placeholder:e("knowledgeBase.common.tagsPlaceholder")})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"subspace",render:({field:a})=>(0,b.jsxs)(r.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.FormLabel,{className:"text-sm",children:e("knowledgeBase.create.enableSubspace")}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:e("knowledgeBase.create.enableSubspaceDesc")})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(q.Switch,{checked:a.value??!1,onCheckedChange:a.onChange})})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"multimodal",render:({field:a})=>(0,b.jsxs)(r.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.FormLabel,{className:"text-sm",children:e("knowledgeBase.create.multimodal")}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:e("knowledgeBase.create.multimodalDesc")})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(q.Switch,{checked:a.value??!1,onCheckedChange:a.onChange})})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"ingestConfiguration.enableTableFormulaCaption",render:({field:a})=>(0,b.jsxs)(r.FormItem,{className:"flex flex-row items-center justify-between gap-4 space-y-0 rounded-md border border-border p-3",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(r.FormLabel,{className:"text-sm",children:e("knowledgeBase.create.tableFormulaCaption")}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:e("knowledgeBase.create.tableFormulaCaptionDesc")})]}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(q.Switch,{checked:a.value??!1,onCheckedChange:a.onChange})})]})})]}),(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:e("knowledgeBase.common.metadataSchema")}),(0,b.jsx)(r.FormField,{control:x.control,name:"metadata",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(A,{value:a.value??[],onChange:a.onChange})}),(0,b.jsx)(r.FormMessage,{})]})})]}),(0,b.jsxs)(s.Collapsible,{children:[(0,b.jsx)(s.CollapsibleTrigger,{asChild:!0,children:(0,b.jsxs)(n.Button,{type:"button",variant:"ghost",className:"flex w-full items-center justify-between p-0 text-lg font-semibold hover:bg-transparent",children:[e("knowledgeBase.common.advancedConfig"),(0,b.jsx)(k.ChevronDown,{className:"h-4 w-4 transition-transform duration-200 [[data-state=open]>&]:rotate-180"})]})}),(0,b.jsxs)(s.CollapsibleContent,{className:"mt-4 space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("h4",{className:"text-base font-medium text-foreground",children:e("knowledgeBase.common.embeddingConfig")}),x.watch("multimodal")&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground bg-muted/30 rounded-md p-2",children:[e("knowledgeBase.create.autoSwitchPrefix"),(0,b.jsx)("code",{children:"qwen3-vl-embedding"}),e("knowledgeBase.create.autoSwitchMiddle"),(0,b.jsx)("code",{children:"qwen3-vl-rerank"}),e("knowledgeBase.create.autoSwitchSuffix")]}),(0,b.jsx)(D,{form:x})]}),(0,b.jsx)("hr",{className:"border-border"}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("h4",{className:"text-base font-medium text-foreground",children:e("knowledgeBase.common.retrievalConfig")}),(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.searchType",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.searchType")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsxs)(u.ToggleGroup,{type:"multiple",value:a.value??[],onValueChange:b=>{b?.length&&a.onChange(b)},className:"grid w-full grid-cols-2 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md",children:[(0,b.jsxs)(u.ToggleGroupItem,{value:"DENSE_VECTOR",className:"h-9 gap-1.5",children:[a.value?.includes("DENSE_VECTOR")&&(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}),e("knowledgeBase.common.searchDense")]}),(0,b.jsxs)(u.ToggleGroupItem,{value:"FULL_TEXT",className:"h-9 gap-1.5",children:[a.value?.includes("FULL_TEXT")&&(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}),e("knowledgeBase.common.searchFullText")]})]})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-sm font-medium text-[hsl(var(--foreground))]",children:e("knowledgeBase.create.resultCount")}),(0,b.jsx)("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:e("knowledgeBase.create.resultCountDesc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(260px,100%),1fr))] gap-3",children:[(0,b.jsx)(E.RetrievalResultCountField,{control:x.control,name:"retrievalConfiguration.denseVectorSearchConfiguration.numberOfResults",label:e("knowledgeBase.common.denseTopK"),description:e("knowledgeBase.common.denseTopKDesc"),max:100,muted:!x.watch("retrievalConfiguration.searchType")?.includes("DENSE_VECTOR")}),(0,b.jsx)(E.RetrievalResultCountField,{control:x.control,name:"retrievalConfiguration.fullTextSearchConfiguration.numberOfResults",label:e("knowledgeBase.common.fullTextTopK"),description:e("knowledgeBase.common.fullTextTopKDesc"),max:100,muted:!x.watch("retrievalConfiguration.searchType")?.includes("FULL_TEXT")})]}),(0,b.jsx)(E.RetrievalResultCountField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.numberOfResults",label:e("knowledgeBase.common.rerankTopK"),description:e("knowledgeBase.common.rerankTopKDesc"),max:200})]}),(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.type",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.create.defaultRerankStrategy")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsxs)(u.ToggleGroup,{type:"single",value:a.value??"",onValueChange:b=>{b&&a.onChange(b)},className:"grid w-full grid-cols-3 gap-0 overflow-hidden rounded-lg border border-border bg-[hsl(var(--muted)/0.4)] p-0 sm:max-w-md",children:[(0,b.jsx)(u.ToggleGroupItem,{value:"MODEL",className:"h-9",children:"Model"}),(0,b.jsx)(u.ToggleGroupItem,{value:"WEIGHT",className:"h-9",children:"Weight"}),(0,b.jsx)(u.ToggleGroupItem,{value:"RRF",className:"h-9",children:"RRF"})]})}),(0,b.jsx)(r.FormDescription,{className:"text-xs",children:e("knowledgeBase.create.rerankStrategyDesc")}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsxs)("div",{className:L("MODEL"===C),children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:e("knowledgeBase.common.modelParams")}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.modelConfiguration.provider",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.provider.label")}),(0,b.jsxs)(t.Select,{onValueChange:a.onChange,value:a.value??"",children:[(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:e("knowledgeBase.provider.selectProvider")})})}),(0,b.jsx)(t.SelectContent,{children:(0,b.jsx)(t.SelectItem,{value:"bailian",children:e("knowledgeBase.provider.bailian")})})]}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.modelConfiguration.model",render:({field:a})=>{let c=x.watch("retrievalConfiguration.rerankingConfiguration.modelConfiguration.provider");return(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.provider.modelName")}),(0,b.jsx)(r.FormControl,{children:"bailian"===c?(0,b.jsxs)(t.Select,{onValueChange:a.onChange,value:a.value??"",children:[(0,b.jsx)(t.SelectTrigger,{children:(0,b.jsx)(t.SelectValue,{placeholder:e("knowledgeBase.provider.selectModel")})}),(0,b.jsxs)(t.SelectContent,{children:[(0,b.jsx)(t.SelectItem,{value:"gte-rerank-v2",children:"gte-rerank-v2"}),(0,b.jsx)(t.SelectItem,{value:"qwen3-rerank",children:"qwen3-rerank"}),(0,b.jsxs)(t.SelectItem,{value:"qwen3-vl-rerank",children:["qwen3-vl-rerank",e("knowledgeBase.provider.multimodalSuffix")]})]})]}):(0,b.jsx)(o.Input,{placeholder:e("knowledgeBase.provider.inputModelName"),...a,value:a.value??""})}),(0,b.jsx)(r.FormMessage,{})]})}})]})]}),(0,b.jsxs)("div",{className:L("WEIGHT"===C),children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:e("knowledgeBase.common.weightParams")}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.weightConfiguration.denseVectorSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.denseWeight")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",min:"0",max:"1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormDescription,{children:e("knowledgeBase.common.weightRange")}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.weightConfiguration.fullTextSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.fullTextWeight")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",min:"0",max:"1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormDescription,{children:e("knowledgeBase.common.weightRange")}),(0,b.jsx)(r.FormMessage,{})]})})]})]}),(0,b.jsxs)("div",{className:L("RRF"===C),children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:e("knowledgeBase.common.rrfParams")}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.denseVectorSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.denseWeight")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.fullTextSearchWeight",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.fullTextWeight")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",step:"0.1",placeholder:"0.5",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormMessage,{})]})}),(0,b.jsx)(r.FormField,{control:x.control,name:"retrievalConfiguration.rerankingConfiguration.rrfConfiguration.k",render:({field:a})=>(0,b.jsxs)(r.FormItem,{children:[(0,b.jsx)(r.FormLabel,{children:e("knowledgeBase.common.kValue")}),(0,b.jsx)(r.FormControl,{children:(0,b.jsx)(o.Input,{type:"number",placeholder:"60",...a,value:a.value??"",onChange:(0,m.handleNumberInput)(a.onChange)})}),(0,b.jsx)(r.FormMessage,{})]})})]})]})]})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[(0,b.jsx)(n.Button,{type:"button",variant:"outline",onClick:()=>c.back(),children:e("common.cancel")}),(0,b.jsx)(n.Button,{type:"submit",disabled:d.isPending,children:d.isPending?e("common.creating"):e("knowledgeBase.create.submit")})]})]})})}a.s(["default",0,function(){let{t:a}=(0,y.useI18n)();return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)(c.default,{href:"/knowledge-base",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4",children:[(0,b.jsx)(d.ArrowLeft,{className:"h-4 w-4"}),a("knowledgeBase.list.backToList")]}),(0,b.jsx)(e.PageHeader,{title:a("knowledgeBase.create.title")})]}),(0,b.jsx)("div",{className:"max-w-2xl",children:(0,b.jsx)(L,{})})]})}],525538)}];
2
2
 
3
3
  //# sourceMappingURL=dashboard_src_app_%28dashboard%29_knowledge-base_create_page_tsx_0916~g-._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[909598,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(263265),f=a.i(700623),g=a.i(637102),h=a.i(776192),i=a.i(604395),j=a.i(843836),k=a.i(887617),l=a.i(324567),m=a.i(865271),n=a.i(983366),o=a.i(421347),p=a.i(225377),q=a.i(739096);let r=new Set(["completed","completed_with_failures","failed","cancelled"]);var s=a.i(933596),t=a.i(895487),u=a.i(1078),v=a.i(36890),w=a.i(663525),x=a.i(350681),y=a.i(109734),z=a.i(223301),A=a.i(434841),B=a.i(726436),C=a.i(364565);let D={ADD:"bg-success-soft text-success",UPDATE:"bg-info-soft text-info",DELETE:"bg-danger-soft text-danger",MERGE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]",NOOP:"bg-muted text-muted-foreground",EMIT_SKILL:"bg-success-soft text-success",EMIT_PROFILE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"};function E({open:a,onOpenChange:c,memoryStoreName:d,selected:e,onConfirm:f,busy:g}){let i={};for(let a of e)i[a.action]=(i[a.action]??0)+1;let k=(i.DELETE??0)>0,l=e.slice(0,6),m=e.length-l.length;return(0,b.jsx)(j.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(j.DialogContent,{className:"max-w-xl",children:[(0,b.jsxs)(j.DialogHeader,{children:[(0,b.jsx)(j.DialogTitle,{children:"确认应用所选动作"}),(0,b.jsxs)(j.DialogDescription,{children:["将对记忆库 ",(0,b.jsx)("span",{className:"font-mono",children:d})," ","应用 ",e.length," 条动作。该操作会写入记忆库,无法自动撤销。"]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-2 rounded border border-[hsl(var(--border-light))] bg-[hsl(var(--muted)/0.3)] p-2",children:Object.keys(i).map(a=>(0,b.jsxs)("span",{className:(0,C.cn)("inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-mono font-semibold",D[a]??"bg-muted text-muted-foreground"),children:[a," ",(0,b.jsxs)("span",{className:"font-normal opacity-80",children:["×",i[a]]})]},a))}),k&&(0,b.jsx)("p",{className:"rounded border border-[hsl(var(--destructive)/0.3)] bg-danger-soft/40 px-3 py-2 text-xs text-danger",children:"所选动作包含 DELETE,应用后对应记忆将被删除。"}),(0,b.jsxs)("ul",{className:"max-h-72 space-y-1.5 overflow-auto rounded border border-[hsl(var(--border-light))] p-2",children:[l.map(a=>(0,b.jsxs)("li",{className:"flex items-start gap-2 text-xs",children:[(0,b.jsx)("span",{className:(0,C.cn)("mt-0.5 shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",D[a.action]??"bg-muted text-muted-foreground"),children:a.action}),(0,b.jsx)("span",{className:"line-clamp-2 flex-1 text-foreground/85",children:a.newMemory?.text??a.reason??`(${a.actionId.slice(0,12)}…)`})]},a.actionId)),m>0&&(0,b.jsxs)("li",{className:"pt-1 text-center text-[11px] italic text-muted-foreground",children:[(0,b.jsx)(u.Sparkles,{className:"mr-1 inline-block h-3 w-3"}),"还有 ",m," 条动作未在此预览"]})]})]}),(0,b.jsxs)(j.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>c(!1),disabled:g,children:"取消"}),(0,b.jsx)(h.Button,{variant:k?"destructive":"default",onClick:f,disabled:g,children:g?"应用中…":`确认应用 ${e.length} 条`})]})]})})}let F=[{value:"all",label:"全部状态"},{value:"proposed",label:"待应用"},{value:"applied",label:"已应用"},{value:"skipped",label:"已跳过"},{value:"failed",label:"失败"}],G=[{value:"all",label:"全部类型"},{value:"ADD",label:"ADD"},{value:"UPDATE",label:"UPDATE"},{value:"DELETE",label:"DELETE"},{value:"MERGE",label:"MERGE"},{value:"NOOP",label:"NOOP"},{value:"EMIT_SKILL",label:"EMIT_SKILL"},{value:"EMIT_PROFILE",label:"EMIT_PROFILE"}],H=[{value:"created_at_asc",label:"创建时间 ↑"},{value:"created_at_desc",label:"创建时间 ↓"},{value:"confidence_desc",label:"置信度 ↓"}],I={proposed:"bg-info-soft text-info",applied:"bg-success-soft text-success",skipped:"bg-muted text-muted-foreground",failed:"bg-danger-soft text-danger"},J={proposed:"待应用",applied:"已应用",skipped:"已跳过",failed:"失败"},K={ADD:"bg-success-soft text-success",UPDATE:"bg-info-soft text-info",DELETE:"bg-danger-soft text-danger",MERGE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]",NOOP:"bg-muted text-muted-foreground",EMIT_SKILL:"bg-success-soft text-success",EMIT_PROFILE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"};function L({action:a}){return(0,b.jsx)("span",{className:(0,C.cn)("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-mono font-semibold",K[a]??"bg-muted text-muted-foreground"),children:a})}function M({action:a,memoryStoreName:c}){let{action:d,newMemory:e,newExtract:f,targetMemoryId:g,targetScope:h,reason:i}=a;if("EMIT_SKILL"===d||"EMIT_PROFILE"===d)return f?(0,b.jsxs)("span",{className:"line-clamp-2 text-xs",children:[(0,b.jsx)("span",{className:(0,C.cn)("mr-1 rounded px-1 py-px text-[10px] font-medium","EMIT_SKILL"===d?"bg-success-soft text-success":"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"),children:"EMIT_SKILL"===d?"技能":"画像"}),f.name,f.description&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" — ",f.description]})]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"});if("ADD"===d||"UPDATE"===d){let a=e?.text;return a?(0,b.jsxs)("span",{className:"line-clamp-2 text-xs",children:["UPDATE"===d&&(0,b.jsx)("span",{className:"mr-1 rounded bg-info-soft px-1 py-px text-[10px] text-info",children:"新"}),a]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"})}return"NOOP"===d?(0,b.jsx)("span",{className:"line-clamp-2 text-xs italic text-muted-foreground",children:i||"无操作"}):(0,b.jsx)(N,{memoryStoreName:c,memoryId:g,scope:h,verbPrefix:"DELETE"===d?"删除":"合并"})}function N({memoryStoreName:a,memoryId:c,scope:d,verbPrefix:e}){let f=(0,B.useMemoryUnit)(a,c,d);if(!c)return(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"});if(f.isLoading)return(0,b.jsx)(i.Skeleton,{className:"h-3 w-32"});let g=f.data?.memory?.text;return g?(0,b.jsxs)("span",{className:"line-clamp-2 text-xs",children:[(0,b.jsx)("span",{className:"mr-1 rounded bg-warning-soft px-1 py-px text-[10px] text-warning",children:e}),g]}):(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e,":原记忆已不可读"]})}function O({status:a}){return(0,b.jsx)("span",{className:(0,C.cn)("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium select-none whitespace-nowrap",I[a]??"bg-muted text-muted-foreground"),children:J[a]??a})}function P(a){return a&&[a.appId,a.tenantId,a.agentId,a.runId].filter(Boolean).join(" / ")||"-"}function Q({memoryStoreName:a,dreamId:d,taskType:f}){let g,j="skill"===f||"profile"===f,[k,l]=(0,c.useState)("all"),[m,r]=(0,c.useState)("all"),[B,C]=(0,c.useState)("created_at_asc"),[D,I]=(0,c.useState)(0),J=function(a,b,c,d){let{context:e,ready:f}=(0,q.useRuntimeContext)();return(0,n.useQuery)({queryKey:p.queryKeys.dreamActions(e.dataScopeKey,a,b,c,d?.nextToken,d?.limit),queryFn:()=>(0,o.listDreamActions)(a,b,c,d),enabled:f&&!!a&&!!b})}(a,d,(0,c.useMemo)(()=>{let a={orderBy:B};return"all"!==k&&(a.status=k),"all"!==m&&(a.action=m),D>0&&(a.minConfidence=D),a},[k,m,B,D]),{limit:100}),K=J.data?.items??[],[N,R]=(0,c.useState)(new Set),[T,U]=(0,c.useState)(null),[V,W]=(0,c.useState)(!1),X=(g=(0,t.useQueryClient)(),(0,s.useMutation)({mutationFn:({actionIds:b,applier:c})=>(0,o.applyDreamActions)(a,d,b,c),onSuccess:()=>{g.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes(a)&&b.queryKey.includes(d)}),g.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes(a)&&(b.queryKey.includes("units")||b.queryKey.includes("scopes"))})}})),Y=a=>"proposed"===a.status&&"EMIT_SKILL"!==a.action&&"EMIT_PROFILE"!==a.action,Z=K.filter(Y).length,$=Z>0&&K.every(a=>!Y(a)||N.has(a.actionId)),_=async()=>{try{let a=await X.mutateAsync({actionIds:Array.from(N)});e.toast.success(`Apply 完成:成功 ${a.applied},失败 ${a.failed}`),R(new Set),W(!1)}catch(b){let a=b instanceof Error?b.message:"应用失败";e.toast.error(a)}};return(0,b.jsx)(A.TooltipProvider,{children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-md border border-[hsl(var(--border-light))] p-3",children:[(0,b.jsxs)(w.Select,{value:k,onValueChange:l,children:[(0,b.jsx)(w.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(w.SelectValue,{})}),(0,b.jsx)(w.SelectContent,{children:F.map(a=>(0,b.jsx)(w.SelectItem,{value:a.value,children:a.label},a.value))})]}),!j&&(0,b.jsxs)(w.Select,{value:m,onValueChange:r,children:[(0,b.jsx)(w.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(w.SelectValue,{})}),(0,b.jsx)(w.SelectContent,{children:G.map(a=>(0,b.jsx)(w.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsxs)(w.Select,{value:B,onValueChange:a=>C(a),children:[(0,b.jsx)(w.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(w.SelectValue,{})}),(0,b.jsx)(w.SelectContent,{children:H.map(a=>(0,b.jsx)(w.SelectItem,{value:a.value,children:a.label},a.value))})]}),!j&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:"最小置信度"}),(0,b.jsx)(x.Slider,{value:[D],max:1,step:.05,onValueChange:a=>I(a[0]??0),className:"w-32"}),(0,b.jsx)("span",{className:"font-mono text-xs",children:D.toFixed(2)})]}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:["已选 ",N.size]}),(0,b.jsx)(h.Button,{size:"sm",disabled:0===N.size||X.isPending,onClick:()=>W(!0),children:X.isPending?"应用中…":`Apply selected (${N.size})`})]})]})]}),J.isLoading?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"})]}):0===K.length?(0,b.jsxs)("div",{className:"rounded-lg border border-dashed border-[hsl(var(--border))] py-10 text-center text-sm text-muted-foreground",children:[(0,b.jsx)(u.Sparkles,{className:"mx-auto mb-2 h-6 w-6 text-muted-foreground/60"}),j?"暂无产出结果。请确认输入 scope 下有足够的对话消息。":"当前过滤条件下暂无动作"]}):(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--border))]",children:(0,b.jsxs)(z.Table,{children:[(0,b.jsx)(z.TableHeader,{children:(0,b.jsxs)(z.TableRow,{children:[!j&&(0,b.jsx)(z.TableHead,{className:"w-8",children:(0,b.jsx)(v.Checkbox,{checked:$,onCheckedChange:()=>{$?R(new Set):R(new Set(K.filter(Y).map(a=>a.actionId)))},disabled:0===Z,"aria-label":"全选可应用动作"})}),(0,b.jsx)(z.TableHead,{children:j?"产出类型":"类型"}),(0,b.jsx)(z.TableHead,{children:"状态"}),(0,b.jsx)(z.TableHead,{children:"目标 scope"}),(0,b.jsx)(z.TableHead,{children:j?"内容":"影响"}),!j&&(0,b.jsx)(z.TableHead,{className:"text-right",children:"置信度"})]})}),(0,b.jsx)(z.TableBody,{children:K.map(c=>{let d=Y(c);return(0,b.jsxs)(z.TableRow,{className:"cursor-pointer hover:bg-[hsl(var(--accent))]",onClick:()=>U(c),children:[!j&&(0,b.jsx)(z.TableCell,{onClick:a=>a.stopPropagation(),children:d?(0,b.jsx)(v.Checkbox,{checked:N.has(c.actionId),onCheckedChange:()=>{var a;return a=c.actionId,void R(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},"aria-label":"选择此动作"}):(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{children:(0,b.jsx)(v.Checkbox,{checked:!1,disabled:!0,"aria-label":"不可选"})})}),(0,b.jsx)(A.TooltipContent,{children:"仅 proposed 状态的动作可以 apply"})]})}),(0,b.jsx)(z.TableCell,{children:(0,b.jsx)(L,{action:c.action})}),(0,b.jsx)(z.TableCell,{children:(0,b.jsx)(O,{status:c.status})}),(0,b.jsx)(z.TableCell,{className:"text-xs",children:P(c.targetScope)}),(0,b.jsx)(z.TableCell,{className:"max-w-md",children:(0,b.jsx)(M,{action:c,memoryStoreName:a})}),!j&&(0,b.jsx)(z.TableCell,{className:"text-right font-mono text-xs",children:void 0!==c.confidence?c.confidence.toFixed(2):"-"})]},c.actionId)})})]})}),(0,b.jsx)(y.Sheet,{open:null!==T,onOpenChange:a=>!a&&U(null),children:(0,b.jsx)(y.SheetContent,{className:"w-[560px] sm:max-w-[560px]",children:T&&(0,b.jsx)(S,{detail:T,memoryStoreName:a})})}),(0,b.jsx)(E,{open:V,onOpenChange:W,memoryStoreName:a,selected:K.filter(a=>N.has(a.actionId)),onConfirm:_,busy:X.isPending})]})})}function R({detail:a,memoryStoreName:c}){let d="EMIT_SKILL"===a.action||"EMIT_PROFILE"===a.action,e=!d&&("UPDATE"===a.action||"DELETE"===a.action||"MERGE"===a.action),f=(0,B.useMemoryUnit)(c,e?a.targetMemoryId:void 0,e?a.targetScope:null,e),g=a.newMemory?.text;if(d){let c=a.newExtract;if(!c)return(0,b.jsx)("div",{className:"rounded border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.2)] p-3 text-xs italic text-muted-foreground",children:"无抽取结果"});let d="EMIT_SKILL"===a.action||"skill"===c.kind;return(0,b.jsxs)("div",{className:"space-y-2 rounded border border-[hsl(var(--border-light))] p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:(0,C.cn)("rounded px-1.5 py-px text-[10px] font-semibold",d?"bg-success-soft text-success":"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"),children:d?"技能":"画像"}),(0,b.jsx)("span",{className:"text-sm font-medium",children:c.name})]}),c.description&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:c.description}),c.instructions&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"指令内容"}),(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:c.instructions})]})]})}if("NOOP"===a.action)return(0,b.jsx)("div",{className:"rounded border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.2)] p-3 text-xs italic text-muted-foreground",children:"NOOP — 无记忆变更"});let h=f.data?.memory?.text,j=f.data?.memory?.unit_type;return(0,b.jsxs)("div",{className:"space-y-3",children:[e&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"rounded bg-warning-soft px-1.5 py-px text-[10px] font-semibold text-warning",children:"修改前"}),"目标记忆",j&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["· ",j]})]}),f.isLoading?(0,b.jsx)(i.Skeleton,{className:"h-16 w-full"}):h?(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:h}):(0,b.jsx)("p",{className:"rounded border border-dashed border-[hsl(var(--border))] p-2 text-xs italic text-muted-foreground",children:"原始记忆已不可读(可能已被其他 dream 任务删除或合并)"})]}),g&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:(0,C.cn)("rounded px-1.5 py-px text-[10px] font-semibold","ADD"===a.action?"bg-success-soft text-success":"bg-info-soft text-info"),children:"ADD"===a.action?"将新增":"修改后"}),"新记忆",a.newMemory?.unitType&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["· ",a.newMemory.unitType]})]}),(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:g})]}),"DELETE"===a.action&&(0,b.jsx)("p",{className:"rounded border border-dashed border-[hsl(var(--destructive)/0.3)] bg-danger-soft/40 p-2 text-xs text-danger",children:"应用后这条记忆将被删除。"}),"MERGE"===a.action&&(0,b.jsx)("p",{className:"rounded border border-dashed border-[hsl(var(--border))] p-2 text-xs text-muted-foreground",children:"应用后这条记忆将被合并入相关记忆。"})]})}function S({detail:a,memoryStoreName:c}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(y.SheetHeader,{children:[(0,b.jsxs)(y.SheetTitle,{children:[(0,b.jsx)(L,{action:a.action})," 动作详情"]}),(0,b.jsx)(y.SheetDescription,{className:"font-mono text-xs break-all",children:a.actionId})]}),(0,b.jsxs)("div",{className:"space-y-4 overflow-auto py-4 text-sm",children:[(0,b.jsx)(R,{detail:a,memoryStoreName:c}),(0,b.jsxs)("div",{className:"space-y-2 rounded border border-[hsl(var(--border-light))] p-3",children:[(0,b.jsx)(T,{label:"状态",children:(0,b.jsx)(O,{status:a.status})}),(0,b.jsx)(T,{label:"置信度",value:void 0!==a.confidence?a.confidence.toFixed(2):"-"}),(0,b.jsx)(T,{label:"目标 scope",value:P(a.targetScope)}),a.targetMemoryId&&(0,b.jsx)(T,{label:"目标 memory ID",value:a.targetMemoryId,mono:!0}),a.resultMemoryId&&(0,b.jsx)(T,{label:"结果 memory ID",value:a.resultMemoryId,mono:!0})]}),a.reason&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"推理依据"}),(0,b.jsx)("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:a.reason})]}),a.skippedReason&&(0,b.jsx)(T,{label:"跳过原因",value:`${a.skippedReason}${a.skippedReasonDetail?`(${a.skippedReasonDetail})`:""}`}),a.error&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"错误"}),(0,b.jsx)("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded bg-danger-soft p-2 text-xs text-danger",children:a.error})]})]})]})}function T({label:a,value:c,mono:d,children:e}){return(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("p",{className:"w-28 shrink-0 text-xs text-muted-foreground",children:a}),e?(0,b.jsx)("div",{children:e}):(0,b.jsx)("p",{className:(0,C.cn)("flex-1 text-sm",d&&"font-mono"),children:c??"-"})]})}var U=a.i(601170);let V={queued:"bg-info-soft text-info",running:"bg-info-soft text-info",planning:"bg-info-soft text-info",applying:"bg-info-soft text-info",completed:"bg-success-soft text-success",completed_with_failures:"bg-warning-soft text-warning",failed:"bg-danger-soft text-danger",cancelled:"bg-muted text-muted-foreground"},W={queued:"排队中",running:"运行中",planning:"规划中",applying:"应用中",completed:"已完成",completed_with_failures:"完成(含失败)",failed:"失败",cancelled:"已取消"};function X({status:a}){let c=!r.has(a);return(0,b.jsxs)("span",{className:(0,C.cn)("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium select-none whitespace-nowrap",V[a]??"bg-muted text-muted-foreground"),children:[c&&(0,b.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,b.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,b.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),W[a]??a]})}let Y={memory:"记忆整理",skill:"技能抽取",profile:"用户画像"},Z={memory:"bg-info-soft text-info",skill:"bg-success-soft text-success",profile:"bg-[hsl(var(--primary-soft,_220_90%_96%))] text-[hsl(var(--primary))]"};function $({label:a,value:c}){return(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a}),(0,b.jsx)("span",{className:"text-base font-semibold tabular-nums",children:c})]})}a.s(["default",0,function(){let a,u,v=(0,d.useParams)(),w=(0,d.useRouter)(),x=decodeURIComponent(v.store),y=decodeURIComponent(v.dreamId),z=function(a,b){let{context:c,ready:d}=(0,q.useRuntimeContext)();return(0,n.useQuery)({queryKey:p.queryKeys.dreamTask(c.dataScopeKey,a,b),queryFn:()=>(0,o.getDreamTask)(a,b),enabled:d&&!!a&&!!b,refetchInterval:a=>{let b=a.state.data;return b?!r.has(b.status)&&5e3:5e3},refetchIntervalInBackground:!1})}(x,y),A=(a=(0,t.useQueryClient)(),(0,s.useMutation)({mutationFn:a=>(0,o.cancelDreamTask)(x,a),onSuccess:()=>{a.invalidateQueries({queryKey:["memory"],predicate:a=>Array.isArray(a.queryKey)&&a.queryKey.includes("dream-tasks")&&a.queryKey.includes(x)})}})),[B,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(!1);if(z.error instanceof Error&&"code"in z.error&&"DREAMING_DISABLED"===z.error.code)return(0,b.jsx)(U.MemoryDreamDisabled,{});let G=z.data,H=G&&r.has(G.status),I=G?.taskType==="skill"||G?.taskType==="profile",J=async()=>{try{await A.mutateAsync(y),e.toast.success("已取消任务"),D(!1)}catch(b){let a=b instanceof Error?b.message:"取消失败";e.toast.error(a)}};return(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>w.push(`/memory/${encodeURIComponent(x)}/dream`),children:[(0,b.jsx)(f.ArrowLeft,{className:"mr-1 h-3.5 w-3.5"}),"返回任务列表"]})}),z.isLoading?(0,b.jsx)(i.Skeleton,{className:"h-32 w-full"}):G?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-mono text-base",children:G.dreamId}),(u=G.taskType||"memory",(0,b.jsx)("span",{className:(0,C.cn)("inline-flex rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap",Z[u]??"bg-muted text-muted-foreground"),children:Y[u]??u}))]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(X,{status:G.status}),(!G.taskType||"memory"===G.taskType)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"safe_auto"===G.applyMode?"应用模式:安全变更自动应用":"应用模式:建议(手动 apply)"}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:["Scope 输出:","promote_scope"===G.scopeOutputMode?"提升":"保留"]})]}),!H&&(0,b.jsx)("span",{className:"ml-1 italic",children:"· 每 5 秒自动刷新"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.RefreshButton,{onClick:()=>z.refetch(),loading:z.isRefetching}),G.lastError&&(0,b.jsxs)(h.Button,{size:"sm",variant:"outline",onClick:()=>F(!0),className:"text-[hsl(var(--destructive))]",children:[(0,b.jsx)(g.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),"查看错误"]}),!H&&(0,b.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>D(!0),disabled:A.isPending,children:"取消任务"})]})]}),(0,b.jsxs)("div",{className:"mt-5 grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,b.jsx)($,{label:"会话数",value:G.input.sessionCount}),(0,b.jsx)($,{label:"消息数",value:G.input.messageCount}),(!G.taskType||"memory"===G.taskType)&&(0,b.jsx)($,{label:"记忆数",value:G.input.memoryCount}),(0,b.jsx)($,{label:I?"产出数":"动作总数",value:G.actions.total}),I?(0,b.jsx)($,{label:"已生效",value:G.actions.applied}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)($,{label:"待应用",value:G.actions.proposed}),(0,b.jsx)($,{label:"已应用",value:G.actions.applied}),(0,b.jsx)($,{label:"跳过",value:G.actions.skipped})]}),G.actions.failed>0&&(0,b.jsx)($,{label:"失败",value:G.actions.failed})]}),(0,b.jsxs)("div",{className:"mt-5 flex flex-wrap gap-x-6 gap-y-1 text-xs text-muted-foreground",children:[(0,b.jsxs)("span",{children:["创建:",(0,b.jsx)(m.RelativeTime,{timestamp:new Date(G.createdAt).getTime()})]}),(0,b.jsxs)("span",{children:["更新:",(0,b.jsx)(m.RelativeTime,{timestamp:new Date(G.updatedAt).getTime()})]}),G.finishedAt&&(0,b.jsxs)("span",{children:["完成:",(0,b.jsx)(m.RelativeTime,{timestamp:new Date(G.finishedAt).getTime()})]}),G.input.scopes&&G.input.scopes.length>0&&(0,b.jsxs)("span",{children:["输入 scopes:",G.input.scopes.map(a=>[a.appId,a.tenantId,a.agentId,a.runId].filter(Boolean).join(" / ")||"-").slice(0,3).join(" | "),G.input.scopes.length>3&&` +${G.input.scopes.length-3}`]})]})]}),G.instructions&&(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-4",children:[(0,b.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:"profile"===G.taskType?"画像模板":"skill"===G.taskType?"抽取指引":"额外指引"}),(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-3 text-xs",children:G.instructions})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:I?"产出结果":"动作"}),(0,b.jsx)(Q,{memoryStoreName:x,dreamId:y,taskType:G.taskType})]}),(0,b.jsx)(l.ConfirmDialog,{open:B,onOpenChange:D,title:"确认取消 Dream 任务",description:"任务将停止后续动作生成,已应用的动作不会回滚。",variant:"danger",onConfirm:J}),(0,b.jsx)(j.Dialog,{open:E,onOpenChange:F,children:(0,b.jsxs)(j.DialogContent,{className:"max-w-2xl",children:[(0,b.jsx)(j.DialogHeader,{children:(0,b.jsx)(j.DialogTitle,{children:"最后一次错误"})}),(0,b.jsx)("pre",{className:"max-h-96 overflow-auto rounded bg-danger-soft p-3 text-xs text-danger",children:G.lastError})]})})]}):(0,b.jsx)("div",{className:"rounded-lg border border-dashed py-10 text-center text-sm text-muted-foreground",children:"任务不存在或已被删除"})]})}],909598)}];
1
+ module.exports=[909598,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(263265),f=a.i(700623),g=a.i(637102),h=a.i(776192),i=a.i(604395),j=a.i(843836),k=a.i(887617),l=a.i(324567),m=a.i(865271),n=a.i(983366),o=a.i(421347),p=a.i(225377),q=a.i(739096),r=a.i(80024),s=a.i(933596),t=a.i(895487),u=a.i(1078),v=a.i(36890),w=a.i(663525),x=a.i(350681),y=a.i(109734),z=a.i(223301),A=a.i(434841),B=a.i(726436),C=a.i(364565),D=a.i(543320);let E={ADD:"bg-success-soft text-success",UPDATE:"bg-info-soft text-info",DELETE:"bg-danger-soft text-danger",MERGE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]",NOOP:"bg-muted text-muted-foreground",EMIT_SKILL:"bg-success-soft text-success",EMIT_PROFILE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"};function F({open:a,onOpenChange:c,memoryStoreName:d,selected:e,onConfirm:f,busy:g}){let{t:i}=(0,D.useI18n)(),k={};for(let a of e)k[a.action]=(k[a.action]??0)+1;let l=(k.DELETE??0)>0,m=e.slice(0,6),n=e.length-m.length;return(0,b.jsx)(j.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(j.DialogContent,{className:"max-w-xl",children:[(0,b.jsxs)(j.DialogHeader,{children:[(0,b.jsx)(j.DialogTitle,{children:i("memory.dream.apply.title")}),(0,b.jsxs)(j.DialogDescription,{children:[i("memory.dream.apply.descPrefix")," ",(0,b.jsx)("span",{className:"font-mono",children:d})," ",i("memory.dream.apply.descSuffix",{count:e.length})]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-2 rounded border border-[hsl(var(--border-light))] bg-[hsl(var(--muted)/0.3)] p-2",children:Object.keys(k).map(a=>(0,b.jsxs)("span",{className:(0,C.cn)("inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-mono font-semibold",E[a]??"bg-muted text-muted-foreground"),children:[a," ",(0,b.jsxs)("span",{className:"font-normal opacity-80",children:["×",k[a]]})]},a))}),l&&(0,b.jsx)("p",{className:"rounded border border-[hsl(var(--destructive)/0.3)] bg-danger-soft/40 px-3 py-2 text-xs text-danger",children:i("memory.dream.apply.hasDestructive")}),(0,b.jsxs)("ul",{className:"max-h-72 space-y-1.5 overflow-auto rounded border border-[hsl(var(--border-light))] p-2",children:[m.map(a=>(0,b.jsxs)("li",{className:"flex items-start gap-2 text-xs",children:[(0,b.jsx)("span",{className:(0,C.cn)("mt-0.5 shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",E[a.action]??"bg-muted text-muted-foreground"),children:a.action}),(0,b.jsx)("span",{className:"line-clamp-2 flex-1 text-foreground/85",children:a.newMemory?.text??a.reason??`(${a.actionId.slice(0,12)}…)`})]},a.actionId)),n>0&&(0,b.jsxs)("li",{className:"pt-1 text-center text-[11px] italic text-muted-foreground",children:[(0,b.jsx)(u.Sparkles,{className:"mr-1 inline-block h-3 w-3"}),i("memory.dream.apply.remaining",{count:n})]})]})]}),(0,b.jsxs)(j.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>c(!1),disabled:g,children:i("common.cancel")}),(0,b.jsx)(h.Button,{variant:l?"destructive":"default",onClick:f,disabled:g,children:g?i("memory.dream.apply.applying"):i("memory.dream.apply.confirm",{count:e.length})})]})]})})}let G={proposed:"bg-info-soft text-info",applied:"bg-success-soft text-success",skipped:"bg-muted text-muted-foreground",failed:"bg-danger-soft text-danger"},H={proposed:"memory.actionStatus.proposed",applied:"memory.actionStatus.applied",skipped:"memory.actionStatus.skipped",failed:"memory.actionStatus.failed"},I={ADD:"bg-success-soft text-success",UPDATE:"bg-info-soft text-info",DELETE:"bg-danger-soft text-danger",MERGE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]",NOOP:"bg-muted text-muted-foreground",EMIT_SKILL:"bg-success-soft text-success",EMIT_PROFILE:"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"};function J({action:a}){return(0,b.jsx)("span",{className:(0,C.cn)("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-mono font-semibold",I[a]??"bg-muted text-muted-foreground"),children:a})}function K({action:a,memoryStoreName:c,t:d}){let{action:e,newMemory:f,newExtract:g,targetMemoryId:h,targetScope:i,reason:j}=a;if("EMIT_SKILL"===e||"EMIT_PROFILE"===e)return g?(0,b.jsxs)("span",{className:"line-clamp-2 text-xs",children:[(0,b.jsx)("span",{className:(0,C.cn)("mr-1 rounded px-1 py-px text-[10px] font-medium","EMIT_SKILL"===e?"bg-success-soft text-success":"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"),children:d("EMIT_SKILL"===e?"memory.dream.actions.skill":"memory.dream.actions.profile")}),g.name,g.description&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" ","— ",g.description]})]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"});if("ADD"===e||"UPDATE"===e){let a=f?.text;return a?(0,b.jsxs)("span",{className:"line-clamp-2 text-xs",children:["UPDATE"===e&&(0,b.jsx)("span",{className:"mr-1 rounded bg-info-soft px-1 py-px text-[10px] text-info",children:d("memory.dream.actions.new")}),a]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"})}return"NOOP"===e?(0,b.jsx)("span",{className:"line-clamp-2 text-xs italic text-muted-foreground",children:j||d("memory.dream.actions.noop")}):(0,b.jsx)(L,{memoryStoreName:c,memoryId:h,scope:i,verbPrefix:d("DELETE"===e?"memory.dream.actions.delete":"memory.dream.actions.merge"),t:d})}function L({memoryStoreName:a,memoryId:c,scope:d,verbPrefix:e,t:f}){let g=(0,B.useMemoryUnit)(a,c,d);if(!c)return(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"});if(g.isLoading)return(0,b.jsx)(i.Skeleton,{className:"h-3 w-32"});let h=g.data?.memory?.text;return h?(0,b.jsxs)("span",{className:"line-clamp-2 text-xs",children:[(0,b.jsx)("span",{className:"mr-1 rounded bg-warning-soft px-1 py-px text-[10px] text-warning",children:e}),h]}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:f("memory.dream.actions.memoryUnreadable",{verb:e})})}function M({status:a,t:c}){let d=H[a];return(0,b.jsx)("span",{className:(0,C.cn)("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium select-none whitespace-nowrap",G[a]??"bg-muted text-muted-foreground"),children:d?c(d):a})}function N(a){return a&&[a.appId,a.tenantId,a.agentId,a.runId].filter(Boolean).join(" / ")||"-"}function O({memoryStoreName:a,dreamId:d,taskType:f}){let g,{t:j}=(0,D.useI18n)(),k=(0,c.useMemo)(()=>[{value:"all",label:j("memory.dream.actions.allStatus")},{value:"proposed",label:j("memory.actionStatus.proposed")},{value:"applied",label:j("memory.actionStatus.applied")},{value:"skipped",label:j("memory.actionStatus.skipped")},{value:"failed",label:j("memory.actionStatus.failed")}],[j]),l=(0,c.useMemo)(()=>[{value:"all",label:j("memory.dream.actions.allTypes")},{value:"ADD",label:"ADD"},{value:"UPDATE",label:"UPDATE"},{value:"DELETE",label:"DELETE"},{value:"MERGE",label:"MERGE"},{value:"NOOP",label:"NOOP"},{value:"EMIT_SKILL",label:"EMIT_SKILL"},{value:"EMIT_PROFILE",label:"EMIT_PROFILE"}],[j]),m=(0,c.useMemo)(()=>[{value:"created_at_asc",label:j("memory.dream.actions.orderCreatedAsc")},{value:"created_at_desc",label:j("memory.dream.actions.orderCreatedDesc")},{value:"confidence_desc",label:j("memory.dream.actions.orderConfidenceDesc")}],[j]),r="skill"===f||"profile"===f,[B,C]=(0,c.useState)("all"),[E,G]=(0,c.useState)("all"),[H,I]=(0,c.useState)("created_at_asc"),[L,P]=(0,c.useState)(0),R=function(a,b,c,d){let{context:e,ready:f}=(0,q.useRuntimeContext)();return(0,n.useQuery)({queryKey:p.queryKeys.dreamActions(e.dataScopeKey,a,b,c,d?.nextToken,d?.limit),queryFn:()=>(0,o.listDreamActions)(a,b,c,d),enabled:f&&!!a&&!!b})}(a,d,(0,c.useMemo)(()=>{let a={orderBy:H};return"all"!==B&&(a.status=B),"all"!==E&&(a.action=E),L>0&&(a.minConfidence=L),a},[B,E,H,L]),{limit:100}),S=R.data?.items??[],[T,U]=(0,c.useState)(new Set),[V,W]=(0,c.useState)(null),[X,Y]=(0,c.useState)(!1),Z=(g=(0,t.useQueryClient)(),(0,s.useMutation)({mutationFn:({actionIds:b,applier:c})=>(0,o.applyDreamActions)(a,d,b,c),onSuccess:()=>{g.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes(a)&&b.queryKey.includes(d)}),g.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes(a)&&(b.queryKey.includes("units")||b.queryKey.includes("scopes"))})}})),$=a=>"proposed"===a.status&&"EMIT_SKILL"!==a.action&&"EMIT_PROFILE"!==a.action,_=S.filter($).length,aa=_>0&&S.every(a=>!$(a)||T.has(a.actionId)),ab=async()=>{try{let a=await Z.mutateAsync({actionIds:Array.from(T)});e.toast.success(j("memory.dream.actions.applyResult",{applied:a.applied,failed:a.failed})),U(new Set),Y(!1)}catch(b){let a=b instanceof Error?b.message:j("memory.dream.actions.applyFailed");e.toast.error(a)}};return(0,b.jsx)(A.TooltipProvider,{children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-md border border-[hsl(var(--border-light))] p-3",children:[(0,b.jsxs)(w.Select,{value:B,onValueChange:C,children:[(0,b.jsx)(w.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(w.SelectValue,{})}),(0,b.jsx)(w.SelectContent,{children:k.map(a=>(0,b.jsx)(w.SelectItem,{value:a.value,children:a.label},a.value))})]}),!r&&(0,b.jsxs)(w.Select,{value:E,onValueChange:G,children:[(0,b.jsx)(w.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(w.SelectValue,{})}),(0,b.jsx)(w.SelectContent,{children:l.map(a=>(0,b.jsx)(w.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsxs)(w.Select,{value:H,onValueChange:a=>I(a),children:[(0,b.jsx)(w.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(w.SelectValue,{})}),(0,b.jsx)(w.SelectContent,{children:m.map(a=>(0,b.jsx)(w.SelectItem,{value:a.value,children:a.label},a.value))})]}),!r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:j("memory.dream.actions.minConfidence")}),(0,b.jsx)(x.Slider,{value:[L],max:1,step:.05,onValueChange:a=>P(a[0]??0),className:"w-32"}),(0,b.jsx)("span",{className:"font-mono text-xs",children:L.toFixed(2)})]}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:j("memory.dream.actions.selectedCount",{count:T.size})}),(0,b.jsx)(h.Button,{size:"sm",disabled:0===T.size||Z.isPending,onClick:()=>Y(!0),children:Z.isPending?j("memory.dream.actions.applying"):j("memory.dream.actions.applySelected",{count:T.size})})]})]})]}),R.isLoading?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(i.Skeleton,{className:"h-10 w-full"})]}):0===S.length?(0,b.jsxs)("div",{className:"rounded-lg border border-dashed border-[hsl(var(--border))] py-10 text-center text-sm text-muted-foreground",children:[(0,b.jsx)(u.Sparkles,{className:"mx-auto mb-2 h-6 w-6 text-muted-foreground/60"}),r?j("memory.dream.actions.emptyExtract"):j("memory.dream.actions.emptyFiltered")]}):(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--border))]",children:(0,b.jsxs)(z.Table,{children:[(0,b.jsx)(z.TableHeader,{children:(0,b.jsxs)(z.TableRow,{children:[!r&&(0,b.jsx)(z.TableHead,{className:"w-8",children:(0,b.jsx)(v.Checkbox,{checked:aa,onCheckedChange:()=>{aa?U(new Set):U(new Set(S.filter($).map(a=>a.actionId)))},disabled:0===_,"aria-label":j("memory.dream.actions.selectAll")})}),(0,b.jsx)(z.TableHead,{children:r?j("memory.dream.actions.colOutputType"):j("memory.dream.actions.colType")}),(0,b.jsx)(z.TableHead,{children:j("memory.dream.actions.colStatus")}),(0,b.jsx)(z.TableHead,{children:j("memory.common.targetScope")}),(0,b.jsx)(z.TableHead,{children:r?j("memory.dream.actions.colContent"):j("memory.dream.actions.colImpact")}),!r&&(0,b.jsx)(z.TableHead,{className:"text-right",children:j("memory.dream.actions.colConfidence")})]})}),(0,b.jsx)(z.TableBody,{children:S.map(c=>{let d=$(c);return(0,b.jsxs)(z.TableRow,{className:"cursor-pointer hover:bg-[hsl(var(--accent))]",onClick:()=>W(c),children:[!r&&(0,b.jsx)(z.TableCell,{onClick:a=>a.stopPropagation(),children:d?(0,b.jsx)(v.Checkbox,{checked:T.has(c.actionId),onCheckedChange:()=>{var a;return a=c.actionId,void U(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},"aria-label":j("memory.dream.actions.selectAction")}):(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{children:(0,b.jsx)(v.Checkbox,{checked:!1,disabled:!0,"aria-label":j("memory.dream.actions.notSelectable")})})}),(0,b.jsx)(A.TooltipContent,{children:j("memory.dream.actions.onlyProposedApply")})]})}),(0,b.jsx)(z.TableCell,{children:(0,b.jsx)(J,{action:c.action})}),(0,b.jsx)(z.TableCell,{children:(0,b.jsx)(M,{status:c.status,t:j})}),(0,b.jsx)(z.TableCell,{className:"text-xs",children:N(c.targetScope)}),(0,b.jsx)(z.TableCell,{className:"max-w-md",children:(0,b.jsx)(K,{action:c,memoryStoreName:a,t:j})}),!r&&(0,b.jsx)(z.TableCell,{className:"text-right font-mono text-xs",children:void 0!==c.confidence?c.confidence.toFixed(2):"-"})]},c.actionId)})})]})}),(0,b.jsx)(y.Sheet,{open:null!==V,onOpenChange:a=>!a&&W(null),children:(0,b.jsx)(y.SheetContent,{className:"w-[560px] sm:max-w-[560px]",children:V&&(0,b.jsx)(Q,{detail:V,memoryStoreName:a,t:j})})}),(0,b.jsx)(F,{open:X,onOpenChange:Y,memoryStoreName:a,selected:S.filter(a=>T.has(a.actionId)),onConfirm:ab,busy:Z.isPending})]})})}function P({detail:a,memoryStoreName:c,t:d}){let e="EMIT_SKILL"===a.action||"EMIT_PROFILE"===a.action,f=!e&&("UPDATE"===a.action||"DELETE"===a.action||"MERGE"===a.action),g=(0,B.useMemoryUnit)(c,f?a.targetMemoryId:void 0,f?a.targetScope:null,f),h=a.newMemory?.text;if(e){let c=a.newExtract;if(!c)return(0,b.jsx)("div",{className:"rounded border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.2)] p-3 text-xs italic text-muted-foreground",children:d("memory.dream.actions.noExtractResult")});let e="EMIT_SKILL"===a.action||"skill"===c.kind;return(0,b.jsxs)("div",{className:"space-y-2 rounded border border-[hsl(var(--border-light))] p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:(0,C.cn)("rounded px-1.5 py-px text-[10px] font-semibold",e?"bg-success-soft text-success":"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"),children:d(e?"memory.dream.actions.skill":"memory.dream.actions.profile")}),(0,b.jsx)("span",{className:"text-sm font-medium",children:c.name})]}),c.description&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:c.description}),c.instructions&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:d("memory.dream.actions.instructions")}),(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:c.instructions})]})]})}if("NOOP"===a.action)return(0,b.jsx)("div",{className:"rounded border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.2)] p-3 text-xs italic text-muted-foreground",children:d("memory.dream.actions.noopNoChange")});let j=g.data?.memory?.text,k=g.data?.memory?.unit_type;return(0,b.jsxs)("div",{className:"space-y-3",children:[f&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"rounded bg-warning-soft px-1.5 py-px text-[10px] font-semibold text-warning",children:d("memory.dream.actions.beforeModify")}),d("memory.dream.actions.targetMemory"),k&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["· ",k]})]}),g.isLoading?(0,b.jsx)(i.Skeleton,{className:"h-16 w-full"}):j?(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:j}):(0,b.jsx)("p",{className:"rounded border border-dashed border-[hsl(var(--border))] p-2 text-xs italic text-muted-foreground",children:d("memory.dream.actions.originalUnreadable")})]}),h&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:(0,C.cn)("rounded px-1.5 py-px text-[10px] font-semibold","ADD"===a.action?"bg-success-soft text-success":"bg-info-soft text-info"),children:d("ADD"===a.action?"memory.dream.actions.willAdd":"memory.dream.actions.afterModify")}),d("memory.dream.actions.newMemory"),a.newMemory?.unitType&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["· ",a.newMemory.unitType]})]}),(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:h})]}),"DELETE"===a.action&&(0,b.jsx)("p",{className:"rounded border border-dashed border-[hsl(var(--destructive)/0.3)] bg-danger-soft/40 p-2 text-xs text-danger",children:d("memory.dream.actions.willDelete")}),"MERGE"===a.action&&(0,b.jsx)("p",{className:"rounded border border-dashed border-[hsl(var(--border))] p-2 text-xs text-muted-foreground",children:d("memory.dream.actions.willMerge")})]})}function Q({detail:a,memoryStoreName:c,t:d}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(y.SheetHeader,{children:[(0,b.jsxs)(y.SheetTitle,{children:[(0,b.jsx)(J,{action:a.action})," ",d("memory.dream.actions.detailTitle")]}),(0,b.jsx)(y.SheetDescription,{className:"font-mono text-xs break-all",children:a.actionId})]}),(0,b.jsxs)("div",{className:"space-y-4 overflow-auto py-4 text-sm",children:[(0,b.jsx)(P,{detail:a,memoryStoreName:c,t:d}),(0,b.jsxs)("div",{className:"space-y-2 rounded border border-[hsl(var(--border-light))] p-3",children:[(0,b.jsx)(R,{label:d("memory.dream.actions.detailStatus"),children:(0,b.jsx)(M,{status:a.status,t:d})}),(0,b.jsx)(R,{label:d("memory.dream.actions.detailConfidence"),value:void 0!==a.confidence?a.confidence.toFixed(2):"-"}),(0,b.jsx)(R,{label:d("memory.common.targetScope"),value:N(a.targetScope)}),a.targetMemoryId&&(0,b.jsx)(R,{label:d("memory.dream.actions.detailTargetMemoryId"),value:a.targetMemoryId,mono:!0}),a.resultMemoryId&&(0,b.jsx)(R,{label:d("memory.dream.actions.detailResultMemoryId"),value:a.resultMemoryId,mono:!0})]}),a.reason&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:d("memory.dream.actions.reason")}),(0,b.jsx)("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-2 text-xs",children:a.reason})]}),a.skippedReason&&(0,b.jsx)(R,{label:d("memory.dream.actions.skippedReason"),value:a.skippedReasonDetail?d("memory.dream.actions.skippedReasonWithDetail",{reason:a.skippedReason,detail:a.skippedReasonDetail}):a.skippedReason}),a.error&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:d("memory.dream.actions.error")}),(0,b.jsx)("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded bg-danger-soft p-2 text-xs text-danger",children:a.error})]})]})]})}function R({label:a,value:c,mono:d,children:e}){return(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("p",{className:"w-28 shrink-0 text-xs text-muted-foreground",children:a}),e?(0,b.jsx)("div",{children:e}):(0,b.jsx)("p",{className:(0,C.cn)("flex-1 text-sm",d&&"font-mono"),children:c??"-"})]})}var S=a.i(601170);let T={queued:"bg-info-soft text-info",running:"bg-info-soft text-info",planning:"bg-info-soft text-info",applying:"bg-info-soft text-info",completed:"bg-success-soft text-success",completed_with_failures:"bg-warning-soft text-warning",failed:"bg-danger-soft text-danger",cancelled:"bg-muted text-muted-foreground"},U={queued:"memory.dreamStatus.queued",running:"memory.dreamStatus.running",planning:"memory.dreamStatus.planning",applying:"memory.dreamStatus.applying",completed:"memory.dreamStatus.completed",completed_with_failures:"memory.dreamStatus.completedWithFailures",failed:"memory.dreamStatus.failed",cancelled:"memory.dreamStatus.cancelled"};function V({status:a,t:c}){let d=!r.DREAM_TERMINAL_STATUSES.has(a),e=U[a];return(0,b.jsxs)("span",{className:(0,C.cn)("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium select-none whitespace-nowrap",T[a]??"bg-muted text-muted-foreground"),children:[d&&(0,b.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,b.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,b.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),e?c(e):a]})}let W={memory:"memory.dreamType.consolidate",skill:"memory.dreamType.skill",profile:"memory.dreamType.profile"},X={memory:"bg-info-soft text-info",skill:"bg-success-soft text-success",profile:"bg-[hsl(var(--primary-soft,_220_90%_96%))] text-[hsl(var(--primary))]"};function Y({label:a,value:c}){return(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a}),(0,b.jsx)("span",{className:"text-base font-semibold tabular-nums",children:c})]})}a.s(["default",0,function(){let a,u,{t:v}=(0,D.useI18n)(),w=(0,d.useParams)(),x=(0,d.useRouter)(),y=decodeURIComponent(w.store),z=decodeURIComponent(w.dreamId),A=function(a,b){let{context:c,ready:d}=(0,q.useRuntimeContext)();return(0,n.useQuery)({queryKey:p.queryKeys.dreamTask(c.dataScopeKey,a,b),queryFn:()=>(0,o.getDreamTask)(a,b),enabled:d&&!!a&&!!b,refetchInterval:a=>{let b=a.state.data;return b?!r.DREAM_TERMINAL_STATUSES.has(b.status)&&5e3:5e3},refetchIntervalInBackground:!1})}(y,z),B=(a=(0,t.useQueryClient)(),(0,s.useMutation)({mutationFn:a=>(0,o.cancelDreamTask)(y,a),onSuccess:()=>{a.invalidateQueries({queryKey:["memory"],predicate:a=>Array.isArray(a.queryKey)&&a.queryKey.includes("dream-tasks")&&a.queryKey.includes(y)})}})),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(!1);if(A.error instanceof Error&&"code"in A.error&&"DREAMING_DISABLED"===A.error.code)return(0,b.jsx)(S.MemoryDreamDisabled,{});let I=A.data,J=I&&r.DREAM_TERMINAL_STATUSES.has(I.status),K=I?.taskType==="skill"||I?.taskType==="profile",L=async()=>{try{await B.mutateAsync(z),e.toast.success(v("memory.dream.cancelSuccess")),F(!1)}catch(b){let a=b instanceof Error?b.message:v("memory.dream.cancelFailed");e.toast.error(a)}};return(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsx)("div",{className:"flex items-center gap-2",children:(0,b.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>x.push(`/memory/${encodeURIComponent(y)}/dream`),children:[(0,b.jsx)(f.ArrowLeft,{className:"mr-1 h-3.5 w-3.5"}),v("memory.dream.backToTaskList")]})}),A.isLoading?(0,b.jsx)(i.Skeleton,{className:"h-32 w-full"}):I?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"font-mono text-base",children:I.dreamId}),(u=I.taskType||"memory",(0,b.jsx)("span",{className:(0,C.cn)("inline-flex rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap",X[u]??"bg-muted text-muted-foreground"),children:W[u]?v(W[u]):u}))]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(V,{status:I.status,t:v}),(!I.taskType||"memory"===I.taskType)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"safe_auto"===I.applyMode?v("memory.dream.applyModeAutoDetail"):v("memory.dream.applyModeProposalDetail")}),(0,b.jsx)("span",{children:"·"}),(0,b.jsx)("span",{children:v("memory.dream.scopeOutput",{value:"promote_scope"===I.scopeOutputMode?v("memory.dream.scopeOutputPromote"):v("memory.dream.scopeOutputPreserve")})})]}),!J&&(0,b.jsx)("span",{className:"ml-1 italic",children:v("memory.dream.autoRefresh")})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.RefreshButton,{onClick:()=>A.refetch(),loading:A.isRefetching}),I.lastError&&(0,b.jsxs)(h.Button,{size:"sm",variant:"outline",onClick:()=>H(!0),className:"text-[hsl(var(--destructive))]",children:[(0,b.jsx)(g.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),v("memory.dream.viewError")]}),!J&&(0,b.jsx)(h.Button,{size:"sm",variant:"outline",onClick:()=>F(!0),disabled:B.isPending,children:v("memory.dream.cancelTask")})]})]}),(0,b.jsxs)("div",{className:"mt-5 grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,b.jsx)(Y,{label:v("memory.dream.statSessions"),value:I.input.sessionCount}),(0,b.jsx)(Y,{label:v("memory.dream.statMessages"),value:I.input.messageCount}),(!I.taskType||"memory"===I.taskType)&&(0,b.jsx)(Y,{label:v("memory.dream.statMemories"),value:I.input.memoryCount}),(0,b.jsx)(Y,{label:K?v("memory.dream.statOutput"):v("memory.dream.statActionTotal"),value:I.actions.total}),K?(0,b.jsx)(Y,{label:v("memory.dream.statApplied"),value:I.actions.applied}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Y,{label:v("memory.dream.statProposed"),value:I.actions.proposed}),(0,b.jsx)(Y,{label:v("memory.dream.statAppliedShort"),value:I.actions.applied}),(0,b.jsx)(Y,{label:v("memory.dream.statSkipped"),value:I.actions.skipped})]}),I.actions.failed>0&&(0,b.jsx)(Y,{label:v("memory.dream.statFailed"),value:I.actions.failed})]}),(0,b.jsxs)("div",{className:"mt-5 flex flex-wrap gap-x-6 gap-y-1 text-xs text-muted-foreground",children:[(0,b.jsxs)("span",{children:[v("memory.dream.metaCreated"),(0,b.jsx)(m.RelativeTime,{timestamp:new Date(I.createdAt).getTime()})]}),(0,b.jsxs)("span",{children:[v("memory.dream.metaUpdated"),(0,b.jsx)(m.RelativeTime,{timestamp:new Date(I.updatedAt).getTime()})]}),I.finishedAt&&(0,b.jsxs)("span",{children:[v("memory.dream.metaFinished"),(0,b.jsx)(m.RelativeTime,{timestamp:new Date(I.finishedAt).getTime()})]}),I.input.scopes&&I.input.scopes.length>0&&(0,b.jsxs)("span",{children:[v("memory.dream.metaInputScopes"),I.input.scopes.map(a=>[a.appId,a.tenantId,a.agentId,a.runId].filter(Boolean).join(" / ")||"-").slice(0,3).join(" | "),I.input.scopes.length>3&&` +${I.input.scopes.length-3}`]})]})]}),I.instructions&&(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-4",children:[(0,b.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:"profile"===I.taskType?v("memory.dream.instructionsProfile"):"skill"===I.taskType?v("memory.dream.instructionsSkill"):v("memory.dream.instructionsMemory")}),(0,b.jsx)("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[hsl(var(--muted)/0.4)] p-3 text-xs",children:I.instructions})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:K?v("memory.dream.resultsExtract"):v("memory.dream.resultsActions")}),(0,b.jsx)(O,{memoryStoreName:y,dreamId:z,taskType:I.taskType})]}),(0,b.jsx)(l.ConfirmDialog,{open:E,onOpenChange:F,title:v("memory.dream.cancelConfirmTitle"),description:v("memory.dream.cancelConfirmDesc"),variant:"danger",onConfirm:L}),(0,b.jsx)(j.Dialog,{open:G,onOpenChange:H,children:(0,b.jsxs)(j.DialogContent,{className:"max-w-2xl",children:[(0,b.jsx)(j.DialogHeader,{children:(0,b.jsx)(j.DialogTitle,{children:v("memory.dream.lastError")})}),(0,b.jsx)("pre",{className:"max-h-96 overflow-auto rounded bg-danger-soft p-3 text-xs text-danger",children:I.lastError})]})})]}):(0,b.jsx)("div",{className:"rounded-lg border border-dashed py-10 text-center text-sm text-muted-foreground",children:v("memory.dream.taskNotFound")})]})}],909598)}];
2
2
 
3
3
  //# sourceMappingURL=dashboard_src_app_%28dashboard%29_memory_%5Bstore%5D_dream_%5BdreamId%5D_page_tsx_0wy3tv6._.js.map