@tablestore/tablestore-agent-cli 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (753) hide show
  1. package/dist/commands/memory.d.ts.map +1 -1
  2. package/dist/commands/memory.js +20 -16
  3. package/dist/commands/memory.js.map +1 -1
  4. package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
  5. package/dist/dashboard-runtime/dashboard/.next/app-path-routes-manifest.json +10 -0
  6. package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +3 -3
  7. package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
  8. package/dist/dashboard-runtime/dashboard/.next/required-server-files.json +4 -4
  9. package/dist/dashboard-runtime/dashboard/.next/routes-manifest.json +80 -0
  10. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page.js.nft.json +1 -1
  11. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page_client-reference-manifest.js +1 -1
  12. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  13. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  14. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
  15. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
  16. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
  17. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
  18. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
  19. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
  20. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
  21. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
  22. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
  23. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
  24. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
  25. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
  26. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
  27. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
  28. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
  29. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
  30. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
  31. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
  32. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  33. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  34. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page.js.nft.json +1 -1
  35. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page_client-reference-manifest.js +1 -1
  36. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page.js.nft.json +1 -1
  37. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page_client-reference-manifest.js +1 -1
  38. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
  39. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
  40. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
  41. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
  42. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
  43. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
  44. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page/app-paths-manifest.json +3 -0
  45. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page/build-manifest.json +18 -0
  46. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page/next-font-manifest.json +8 -0
  47. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page/react-loadable-manifest.json +1 -0
  48. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page/server-reference-manifest.json +4 -0
  49. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page.js +23 -0
  50. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page.js.map +5 -0
  51. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page.js.nft.json +1 -0
  52. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/page_client-reference-manifest.js +3 -0
  53. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
  54. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
  55. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
  56. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
  57. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page.js.nft.json +1 -1
  58. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page_client-reference-manifest.js +1 -1
  59. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
  60. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
  61. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page/app-paths-manifest.json +3 -0
  62. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page/build-manifest.json +18 -0
  63. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page/next-font-manifest.json +8 -0
  64. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page/react-loadable-manifest.json +1 -0
  65. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page/server-reference-manifest.json +4 -0
  66. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page.js +23 -0
  67. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page.js.map +5 -0
  68. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page.js.nft.json +1 -0
  69. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/page_client-reference-manifest.js +3 -0
  70. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
  71. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
  72. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
  73. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  74. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  75. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +16 -16
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js +1 -1
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js.nft.json +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js +1 -1
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js.nft.json +1 -1
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js +1 -1
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js.nft.json +1 -1
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js +1 -1
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js.nft.json +1 -1
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js +1 -1
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js.nft.json +1 -1
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js +1 -1
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js.nft.json +1 -1
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js +1 -1
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js +1 -1
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js +1 -1
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js +1 -1
  112. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  113. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js +1 -1
  114. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  115. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js +1 -1
  116. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js.nft.json +1 -1
  117. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js +1 -1
  118. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  119. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js +1 -1
  120. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  121. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js +1 -1
  122. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  123. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js +1 -1
  124. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  125. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js +1 -1
  126. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  127. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js +1 -1
  128. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  129. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js +1 -1
  130. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  131. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js +1 -1
  132. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  133. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js +1 -1
  134. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  135. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js +2 -2
  136. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  137. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js +1 -1
  138. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  139. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js +1 -1
  140. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  141. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js +1 -1
  142. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  143. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js +1 -1
  144. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  145. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js +1 -1
  146. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
  147. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js +1 -1
  148. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js.nft.json +1 -1
  149. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js +1 -1
  150. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js.nft.json +1 -1
  151. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js +1 -1
  152. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js.nft.json +1 -1
  153. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js +1 -1
  154. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js.nft.json +1 -1
  155. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js +1 -1
  156. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js.nft.json +1 -1
  157. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js +1 -1
  158. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js.nft.json +1 -1
  159. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route.js +2 -2
  160. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route.js.nft.json +1 -1
  161. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js +1 -1
  162. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
  163. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js +1 -1
  164. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
  165. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js +2 -2
  166. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
  167. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js +2 -2
  168. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js.nft.json +1 -1
  169. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js +2 -2
  170. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
  171. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js +1 -1
  172. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js.nft.json +1 -1
  173. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js +1 -1
  174. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js.nft.json +1 -1
  175. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js +1 -1
  176. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
  177. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js +1 -1
  178. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
  179. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/artifacts/route/app-paths-manifest.json +3 -0
  180. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/artifacts/route/build-manifest.json +9 -0
  181. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/artifacts/route/server-reference-manifest.json +4 -0
  182. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/artifacts/route.js +6 -0
  183. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/artifacts/route.js.map +5 -0
  184. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/artifacts/route.js.nft.json +1 -0
  185. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/artifacts/route_client-reference-manifest.js +3 -0
  186. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route/app-paths-manifest.json +3 -0
  187. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route/build-manifest.json +9 -0
  188. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route/server-reference-manifest.json +4 -0
  189. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route.js +6 -0
  190. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route.js.map +5 -0
  191. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route.js.nft.json +1 -0
  192. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route_client-reference-manifest.js +3 -0
  193. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route/app-paths-manifest.json +3 -0
  194. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route/build-manifest.json +9 -0
  195. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route/server-reference-manifest.json +4 -0
  196. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route.js +6 -0
  197. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route.js.map +5 -0
  198. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route.js.nft.json +1 -0
  199. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route_client-reference-manifest.js +3 -0
  200. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route/app-paths-manifest.json +3 -0
  201. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route/build-manifest.json +9 -0
  202. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route/server-reference-manifest.json +4 -0
  203. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route.js +6 -0
  204. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route.js.map +5 -0
  205. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route.js.nft.json +1 -0
  206. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route_client-reference-manifest.js +3 -0
  207. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route/app-paths-manifest.json +3 -0
  208. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route/build-manifest.json +9 -0
  209. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route/server-reference-manifest.json +4 -0
  210. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route.js +6 -0
  211. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route.js.map +5 -0
  212. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route.js.nft.json +1 -0
  213. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route_client-reference-manifest.js +3 -0
  214. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route/app-paths-manifest.json +3 -0
  215. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route/build-manifest.json +9 -0
  216. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route/server-reference-manifest.json +4 -0
  217. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route.js +6 -0
  218. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route.js.map +5 -0
  219. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route.js.nft.json +1 -0
  220. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route_client-reference-manifest.js +3 -0
  221. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route/app-paths-manifest.json +3 -0
  222. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route/build-manifest.json +9 -0
  223. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route/server-reference-manifest.json +4 -0
  224. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route.js +6 -0
  225. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route.js.map +5 -0
  226. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route.js.nft.json +1 -0
  227. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route_client-reference-manifest.js +3 -0
  228. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route/app-paths-manifest.json +3 -0
  229. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route/build-manifest.json +9 -0
  230. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route/server-reference-manifest.json +4 -0
  231. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route.js +6 -0
  232. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route.js.map +5 -0
  233. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route.js.nft.json +1 -0
  234. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route_client-reference-manifest.js +3 -0
  235. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js +2 -2
  236. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
  237. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js +1 -1
  238. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -1
  239. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js +1 -1
  240. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
  241. package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
  242. package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +15 -15
  243. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  244. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +15 -15
  245. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +3 -3
  246. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +11 -11
  247. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  248. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js.nft.json +1 -1
  249. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  250. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
  251. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +18 -18
  252. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +18 -18
  253. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +3 -3
  254. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +11 -11
  255. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  256. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  257. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +4 -4
  258. package/dist/dashboard-runtime/dashboard/.next/server/app/page.js.nft.json +1 -1
  259. package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  260. package/dist/dashboard-runtime/dashboard/.next/server/app-paths-manifest.json +10 -0
  261. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_artifacts_route_actions_0doape5.js +3 -0
  262. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_ingest_route_actions_0ppwgam.js +3 -0
  263. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_page_route_actions_0odivj9.js +3 -0
  264. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_pages_route_actions_0s15y9a.js +3 -0
  265. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_route_actions_0dbjn9p.js +3 -0
  266. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_search_route_actions_108iypz.js +3 -0
  267. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_source_route_actions_0vmf0n5.js +3 -0
  268. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_wikis_sources_route_actions_0i4~w4-.js +3 -0
  269. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +24 -17
  270. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-e5iv2._.js +3 -0
  271. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.hvkwy._.js +1 -1
  272. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__03j_ekh._.js +3 -0
  273. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__03~qmfv._.js +3 -0
  274. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__07k_8vo._.js +3 -0
  275. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0_g86ij._.js +3 -0
  276. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0db9xtg._.js +40 -0
  277. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ejcow5._.js +1 -1
  278. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0es0s_~._.js +1 -1
  279. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0esucs7._.js +3 -0
  280. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0f~3a2d._.js +3 -0
  281. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0n.tvh_._.js +3 -0
  282. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ohui_o._.js +3 -0
  283. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ssi0g0._.js +3 -0
  284. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0u03tze._.js +1 -1
  285. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ua_nqs._.js +1 -1
  286. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0wpch_g._.js +3 -0
  287. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ypo~ko._.js +3 -0
  288. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__0sa.9zr._.js → [root-of-the-server]__0yqtnx6._.js} +9 -9
  289. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0z19yd0._.js +3 -0
  290. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11rxx0.._.js +40 -0
  291. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11wq90l._.js +1 -1
  292. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__120vi1p._.js +3 -0
  293. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13q2wbt._.js +1 -1
  294. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13~-fxp._.js +1 -1
  295. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +1 -1
  296. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95__next-internal_server_app_(dashboard)_memory_[store]_scope_page_actions_0n2kkfu.js +3 -0
  297. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0e95__next-internal_server_app_(dashboard)_memory_[store]_wiki_page_actions_01zih-8.js +3 -0
  298. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0p91_next_dist_esm_build_templates_app-page_07x7aai.js +4 -0
  299. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0p91_next_dist_esm_build_templates_app-page_0u~m_xi.js +4 -0
  300. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07er-7t._.js +3 -0
  301. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__09556l4._.js +3 -0
  302. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0cn05tt._.js +3 -0
  303. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ejd~qu._.js +3 -0
  304. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0hbevlv._.js +3 -0
  305. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0i9tlv5._.js +3 -0
  306. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ov6305._.js +1 -1
  307. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0xqm21n._.js +3 -0
  308. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0-yhfok._.js +3 -0
  309. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.eh64w._.js +3 -0
  310. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_019ufsh._.js +3 -0
  311. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_04wdnle._.js +3 -0
  312. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06umrt-._.js +3 -0
  313. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0a-deba._.js +3 -0
  314. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0au8umj._.js +3 -0
  315. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0bn79mh._.js +3 -0
  316. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0cpcl4p._.js +3 -0
  317. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f3_q1r._.js +3 -0
  318. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fz3kge._.js +1 -1
  319. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gt9qp0._.js +3 -0
  320. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gyu-mm._.js +3 -0
  321. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ih5--w._.js +3 -0
  322. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j4mfzx._.js +3 -0
  323. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j_44th._.js +3 -0
  324. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0mn4dgd._.js +3 -0
  325. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0nc~.w2._.js +3 -0
  326. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0p-bup8._.js +3 -0
  327. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0psdvqq._.js +3 -0
  328. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0rd1b-.._.js +3 -0
  329. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0t_-u16._.js +3 -0
  330. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0u0~-~-._.js +3 -0
  331. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0vw3mzw._.js +3 -0
  332. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ww5s91._.js +1 -1
  333. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xm2tp8._.js +3 -0
  334. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xutx8t._.js +3 -0
  335. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0ggq95f._.js +3 -0
  336. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0x60pxf._.js +1 -1
  337. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0xaihln._.js +3 -0
  338. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_api-keys_page_tsx_0lb6fu7._.js +1 -1
  339. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_[dreamId]_page_tsx_0wy3tv6._.js +1 -1
  340. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_page_tsx_0uzzpvs._.js +1 -1
  341. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_layout_tsx_0rbi41w._.js +1 -1
  342. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_scope_page_tsx_01rq2zq._.js +3 -0
  343. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_search_page_tsx_0rj3dkc._.js +3 -0
  344. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_tasks_page_tsx_0a_bgx4._.js +1 -1
  345. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
  346. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_memory_memory-files-browser_tsx_0o2~94-._.js +1 -1
  347. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_01evqg6._.js +3 -0
  348. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_i18n_i18n-context_tsx_0c39ewr._.js +1 -1
  349. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_03py6n-._.js +3 -0
  350. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_08hzj0f._.js +3 -0
  351. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0_mks~s._.js +3 -0
  352. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0xbb09m._.js +3 -0
  353. package/dist/dashboard-runtime/dashboard/.next/server/functions-config-manifest.json +8 -0
  354. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +3 -3
  355. package/dist/dashboard-runtime/dashboard/.next/server/next-font-manifest.js +1 -1
  356. package/dist/dashboard-runtime/dashboard/.next/server/next-font-manifest.json +2 -0
  357. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  358. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  359. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  360. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  361. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{01bokygf48bnj.js → 0-b36b4si6az5.js} +1 -1
  362. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-q4fucd6l5ip.js +1 -0
  363. package/dist/dashboard-runtime/dashboard/.next/static/chunks/03qrjs4w.7yz3.js +1 -0
  364. package/dist/dashboard-runtime/dashboard/.next/static/chunks/03rx12c5dxw_4.js +1 -0
  365. package/dist/dashboard-runtime/dashboard/.next/static/chunks/04uxooijjqs-9.js +1 -0
  366. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08tm8srceyz1j.js +1 -0
  367. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08tpejw1f.2jd.js +1 -0
  368. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09hfvw~51z.9o.js +1 -0
  369. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b_~fcwy9vo2r.js +1 -0
  370. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0crw5ciecbvir.js +1 -0
  371. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0cy7y~ef_6m-s.js +1 -0
  372. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dl5t6e508o8k.js +1 -0
  373. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0expqv.~8a3wr.js +1 -0
  374. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0f-mf~9z.~82q.js +1 -0
  375. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0gdmaffoezvcu.js +1 -0
  376. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0hoybc7spk4vg.js +1 -0
  377. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0idr-.ttn_21z.js +1 -0
  378. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k9my4lhyvwbd.js +1 -0
  379. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k_rtgxnq8bsz.js +1 -0
  380. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0lfx3ykqc9uiy.js +1 -0
  381. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0m2j5ne9j7dft.js +1 -0
  382. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0m50djlkcegw9.js +1 -0
  383. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0mg.g5g33nh.~.js +1 -0
  384. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0mit8g2.vh7a9.js +1 -0
  385. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0nq2xdnij7nqt.js +1 -0
  386. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o9quk2z~1ez0.js +1 -0
  387. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o~zjik9-6a1f.js +1 -0
  388. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0p6zd_ss6.14_.js +1 -0
  389. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0qccdw9ussvne.js +1 -0
  390. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0teq2sa-33s3g.js +1 -0
  391. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0upl.e~taktf9.js +1 -0
  392. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v1ulq51wmrto.js +5 -0
  393. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v5mmaebktnw1.css +1 -0
  394. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vfuo2829nn25.js +4 -0
  395. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vp-dv9_z334e.js +1 -0
  396. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0w9eqc5ya-oai.js +1 -0
  397. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x0ppjv_4yap7.js +1 -0
  398. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0xbqtv-jcph-2.js +1 -0
  399. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~m6ml547qzpo.js +1 -0
  400. package/dist/dashboard-runtime/dashboard/.next/static/chunks/10s~90qej98.b.js +1 -0
  401. package/dist/dashboard-runtime/dashboard/.next/static/chunks/12vri~chu44bu.js +9 -0
  402. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13gbu.62oz207.js +138 -0
  403. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13jqvu~hww3b4.js +1 -0
  404. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13wh4v_j6tlns.js +1 -0
  405. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16.18mrzg-4wl.js +1 -0
  406. package/dist/dashboard-runtime/dashboard/.next/static/chunks/162doi8c0o5ot.js +1 -0
  407. package/dist/dashboard-runtime/dashboard/.next/static/chunks/168xs92lu3o~y.js +1 -0
  408. package/dist/dashboard-runtime/dashboard/package.json +1 -1
  409. package/dist/dashboard-runtime/dashboard/server.js +1 -1
  410. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/page.tsx +14 -0
  411. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/[dreamId]/page.tsx +72 -59
  412. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/page.tsx +9 -8
  413. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/layout.tsx +39 -9
  414. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/scope/page.tsx +59 -0
  415. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +77 -21
  416. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/settings/page.tsx +18 -2
  417. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +89 -47
  418. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/wiki/page.tsx +157 -0
  419. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-curator.ts +1 -4
  420. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-helpers.ts +6 -6
  421. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/memory-helpers.ts +50 -0
  422. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/memory-retrieval.ts +228 -0
  423. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/memory-security.ts +26 -0
  424. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +477 -285
  425. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/server-file-memory.ts +113 -0
  426. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/wiki-retrieval.ts +656 -0
  427. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/_scope.ts +67 -0
  428. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/_helpers.ts +5 -23
  429. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/route.ts +19 -2
  430. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/scopes/route.ts +123 -8
  431. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/search/route.ts +21 -8
  432. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/_helpers.ts +317 -0
  433. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/artifacts/route.ts +194 -0
  434. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/ingest/route.ts +60 -0
  435. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/page/route.ts +55 -0
  436. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/pages/route.ts +61 -0
  437. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/route.ts +89 -0
  438. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/search/route.ts +58 -0
  439. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/source/route.ts +230 -0
  440. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/wikis/sources/route.ts +295 -0
  441. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/route.ts +11 -4
  442. package/dist/dashboard-runtime/dashboard/src/components/api-keys/custom-policy-editor.tsx +2 -1
  443. package/dist/dashboard-runtime/dashboard/src/components/api-keys/permission-rule-dialog.tsx +17 -10
  444. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +178 -32
  445. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-scope-entry-hydrator.tsx +116 -0
  446. package/dist/dashboard-runtime/dashboard/src/components/chat/memory-bind-section.tsx +37 -15
  447. package/dist/dashboard-runtime/dashboard/src/components/chat/wiki-bind-section.tsx +151 -0
  448. package/dist/dashboard-runtime/dashboard/src/components/layout/language-toggle.tsx +19 -16
  449. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-mobile.tsx +1 -1
  450. package/dist/dashboard-runtime/dashboard/src/components/memory/file-details-panel.tsx +32 -10
  451. package/dist/dashboard-runtime/dashboard/src/components/memory/file-mutation-dialogs.tsx +14 -2
  452. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-add-dialog.tsx +21 -3
  453. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-create-form.tsx +50 -38
  454. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-actions-table.tsx +13 -0
  455. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-create-dialog.tsx +359 -144
  456. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-files-browser.tsx +46 -10
  457. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-requests-table.tsx +7 -6
  458. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +119 -78
  459. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +384 -70
  460. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +238 -57
  461. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-settings-form.tsx +88 -1
  462. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +4 -1
  463. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-tasks-table.tsx +3 -2
  464. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-detail-panel.tsx +19 -4
  465. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +8 -5
  466. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-combobox.tsx +31 -50
  467. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-directory-explorer.tsx +384 -0
  468. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-filter-builder.tsx +393 -0
  469. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-hierarchy-picker.tsx +274 -0
  470. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-workspace-cards.tsx +475 -0
  471. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-workspace.tsx +201 -0
  472. package/dist/dashboard-runtime/dashboard/src/components/qa/answer-evidence-block.tsx +145 -0
  473. package/dist/dashboard-runtime/dashboard/src/components/qa/memory-evidence-content.tsx +106 -0
  474. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +68 -84
  475. package/dist/dashboard-runtime/dashboard/src/components/qa/wiki-evidence-block.tsx +326 -0
  476. package/dist/dashboard-runtime/dashboard/src/components/shared/copyable-id.tsx +69 -0
  477. package/dist/dashboard-runtime/dashboard/src/components/wiki/wiki-build-panel.tsx +640 -0
  478. package/dist/dashboard-runtime/dashboard/src/components/wiki/wiki-detail.tsx +302 -0
  479. package/dist/dashboard-runtime/dashboard/src/components/wiki/wiki-edit-dialog.tsx +195 -0
  480. package/dist/dashboard-runtime/dashboard/src/components/wiki/wiki-overview.tsx +104 -0
  481. package/dist/dashboard-runtime/dashboard/src/components/wiki/wiki-pages-panel.tsx +424 -0
  482. package/dist/dashboard-runtime/dashboard/src/components/wiki/wiki-sources-panel.tsx +506 -0
  483. package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +627 -47
  484. package/dist/dashboard-runtime/dashboard/src/hooks/use-qa-chat.ts +329 -94
  485. package/dist/dashboard-runtime/dashboard/src/hooks/use-wiki-build-polling.ts +151 -0
  486. package/dist/dashboard-runtime/dashboard/src/hooks/use-wikis.ts +291 -0
  487. package/dist/dashboard-runtime/dashboard/src/i18n/locales/en.ts +510 -49
  488. package/dist/dashboard-runtime/dashboard/src/i18n/locales/zh.ts +472 -37
  489. package/dist/dashboard-runtime/dashboard/src/lib/browser-file-memory.ts +46 -340
  490. package/dist/dashboard-runtime/dashboard/src/lib/chat-scope-entry.ts +59 -0
  491. package/dist/dashboard-runtime/dashboard/src/lib/dream-create-options.ts +27 -0
  492. package/dist/dashboard-runtime/dashboard/src/lib/file-memory-core.ts +744 -0
  493. package/dist/dashboard-runtime/dashboard/src/lib/memory-storage-mode.ts +165 -37
  494. package/dist/dashboard-runtime/dashboard/src/lib/memory-units-view.ts +9 -0
  495. package/dist/dashboard-runtime/dashboard/src/lib/memory.ts +2 -7
  496. package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +106 -0
  497. package/dist/dashboard-runtime/dashboard/src/lib/retrieval-security.ts +54 -0
  498. package/dist/dashboard-runtime/dashboard/src/lib/scope-directory.ts +97 -0
  499. package/dist/dashboard-runtime/dashboard/src/lib/scope-hierarchy.ts +167 -0
  500. package/dist/dashboard-runtime/dashboard/src/lib/scope-workspace.ts +123 -0
  501. package/dist/dashboard-runtime/dashboard/src/lib/server/api-helpers.ts +46 -3
  502. package/dist/dashboard-runtime/dashboard/src/lib/server/memory-store-contract.ts +41 -0
  503. package/dist/dashboard-runtime/dashboard/src/lib/server/scope-filter-validation.ts +186 -0
  504. package/dist/dashboard-runtime/dashboard/src/lib/server/sdk-client.ts +3 -0
  505. package/dist/dashboard-runtime/dashboard/src/lib/wiki-metadata-limits.ts +133 -0
  506. package/dist/dashboard-runtime/dashboard/src/lib/wiki-page-tree.ts +153 -0
  507. package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +126 -23
  508. package/dist/dashboard-runtime/dashboard/src/services/memory.ts +16 -6
  509. package/dist/dashboard-runtime/dashboard/src/services/wiki.ts +145 -0
  510. package/dist/dashboard-runtime/dashboard/src/types/llm-chat.ts +72 -9
  511. package/dist/dashboard-runtime/dashboard/src/types/memory.ts +99 -33
  512. package/dist/dashboard-runtime/dashboard/src/types/wiki.ts +200 -0
  513. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/README.md +2 -2
  514. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/glib-2.0/include/glibconfig.h +9 -8
  515. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
  516. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
  517. package/dist/dashboard-runtime/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  518. package/dist/dashboard-runtime/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
  519. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/CHANGELOG.md +175 -0
  520. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/LICENSE +201 -0
  521. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/README.md +203 -0
  522. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/package.json +3 -0
  523. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/auth/request-context.js +21 -0
  524. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/auth/sign-base.js +70 -0
  525. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/auth/sign-v2.js +13 -0
  526. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/auth/sign-v4.js +51 -0
  527. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/client/agent-storage-client.js +196 -0
  528. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/errors/client-error.js +10 -0
  529. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/errors/service-error.js +16 -0
  530. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/http/headers.js +31 -0
  531. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/http/md5.js +9 -0
  532. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/http/ots-json-client.js +155 -0
  533. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/base.js +19 -0
  534. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/chunk.js +67 -0
  535. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/document.js +163 -0
  536. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/enums.js +31 -0
  537. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/file.js +27 -0
  538. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/knowledge-base.js +118 -0
  539. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/memory.js +711 -0
  540. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/metadata-filter.js +123 -0
  541. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/retrieve.js +152 -0
  542. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/unset.js +8 -0
  543. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/models/wiki.js +2 -0
  544. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/serialization/to-json-request.js +9 -0
  545. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/core/version.js +5 -0
  546. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/index.js +93 -0
  547. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/node/client/node-agent-storage-client.js +134 -0
  548. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/node/fs/file-path.js +73 -0
  549. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/node/fs/file-reader.js +13 -0
  550. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/node/oss/oss-uploader.js +30 -0
  551. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/cjs/src/node.js +5 -0
  552. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/request-context.d.ts +12 -0
  553. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/request-context.js +17 -0
  554. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/sign-base.d.ts +12 -0
  555. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/sign-base.js +63 -0
  556. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/sign-v2.d.ts +6 -0
  557. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/sign-v2.js +9 -0
  558. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/sign-v4.d.ts +15 -0
  559. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/auth/sign-v4.js +47 -0
  560. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/client/agent-storage-client.d.ts +78 -0
  561. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/client/agent-storage-client.js +192 -0
  562. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/errors/client-error.d.ts +3 -0
  563. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/errors/client-error.js +6 -0
  564. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/errors/service-error.d.ts +10 -0
  565. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/errors/service-error.js +12 -0
  566. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/http/headers.d.ts +14 -0
  567. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/http/headers.js +27 -0
  568. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/http/md5.d.ts +1 -0
  569. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/http/md5.js +6 -0
  570. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/http/ots-json-client.d.ts +27 -0
  571. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/http/ots-json-client.js +151 -0
  572. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/base.d.ts +5 -0
  573. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/base.js +15 -0
  574. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/chunk.d.ts +47 -0
  575. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/chunk.js +61 -0
  576. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/document.d.ts +107 -0
  577. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/document.js +151 -0
  578. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/enums.d.ts +24 -0
  579. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/enums.js +28 -0
  580. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/file.d.ts +364 -0
  581. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/file.js +24 -0
  582. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/knowledge-base.d.ts +97 -0
  583. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/knowledge-base.js +108 -0
  584. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/memory.d.ts +1018 -0
  585. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/memory.js +684 -0
  586. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/metadata-filter.d.ts +74 -0
  587. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/metadata-filter.js +118 -0
  588. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/retrieve.d.ts +113 -0
  589. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/retrieve.js +140 -0
  590. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/unset.d.ts +3 -0
  591. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/unset.js +4 -0
  592. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/wiki.d.ts +118 -0
  593. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/models/wiki.js +1 -0
  594. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/serialization/to-json-request.d.ts +2 -0
  595. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/serialization/to-json-request.js +6 -0
  596. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/version.d.ts +2 -0
  597. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/core/version.js +2 -0
  598. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/index.d.ts +17 -0
  599. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/index.js +16 -0
  600. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/client/node-agent-storage-client.d.ts +39 -0
  601. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/client/node-agent-storage-client.js +130 -0
  602. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/fs/file-path.d.ts +12 -0
  603. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/fs/file-path.js +34 -0
  604. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/fs/file-reader.d.ts +8 -0
  605. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/fs/file-reader.js +9 -0
  606. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/oss/oss-uploader.d.ts +17 -0
  607. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node/oss/oss-uploader.js +23 -0
  608. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node.d.ts +1 -0
  609. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/dist/src/node.js +1 -0
  610. package/dist/dashboard-runtime/node_modules/@tablestore/agent-storage/package.json +67 -0
  611. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +1 -0
  612. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
  613. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +1 -0
  614. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
  615. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.d.ts +13 -0
  616. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.d.ts.map +1 -0
  617. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.js +40 -0
  618. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.js.map +1 -0
  619. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +1 -1
  620. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  621. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +21 -9
  622. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  623. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +7 -7
  624. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  625. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +27 -20
  626. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  627. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  628. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +55 -37
  629. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  630. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  631. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/types.d.ts +6 -0
  632. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/types.d.ts.map +1 -1
  633. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.d.ts +18 -0
  634. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.d.ts.map +1 -0
  635. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.js +100 -0
  636. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.js.map +1 -0
  637. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +1 -0
  638. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
  639. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +1 -0
  640. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
  641. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.d.ts +13 -0
  642. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.d.ts.map +1 -0
  643. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.js +40 -0
  644. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/internal/abortable-fetch.js.map +1 -0
  645. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts +1 -1
  646. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.d.ts.map +1 -1
  647. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js +21 -9
  648. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/kb-client.js.map +1 -1
  649. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +7 -7
  650. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  651. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +27 -20
  652. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  653. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  654. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +55 -37
  655. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  656. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  657. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/types.d.ts +6 -0
  658. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/types.d.ts.map +1 -1
  659. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.d.ts +18 -0
  660. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.d.ts.map +1 -0
  661. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.js +100 -0
  662. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/wiki-client.js.map +1 -0
  663. package/dist/output.d.ts.map +1 -1
  664. package/dist/output.js +1 -0
  665. package/dist/output.js.map +1 -1
  666. package/package.json +1 -1
  667. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-wmyic._.js +0 -40
  668. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.li3cj._.js +0 -40
  669. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0is6qso._.js +0 -3
  670. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q9fgt6._.js +0 -3
  671. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0w_ig2a._.js +0 -3
  672. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0y0w3mg._.js +0 -3
  673. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zmo~nd._.js +0 -3
  674. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13g_f9w._.js +0 -3
  675. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0.ooo1s._.js +0 -3
  676. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07fsbff._.js +0 -3
  677. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0b5cw4e._.js +0 -3
  678. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0p1cst6._.js +0 -3
  679. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0xza7lz._.js +0 -3
  680. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.6x0yu._.js +0 -3
  681. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.pa1e6._.js +0 -3
  682. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01snuz~._.js +0 -3
  683. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_02waf76._.js +0 -3
  684. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06_hoj_._.js +0 -3
  685. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0_aw2vr._.js +0 -3
  686. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0brqbty._.js +0 -3
  687. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0csuit-._.js +0 -3
  688. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0eps5jg._.js +0 -3
  689. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ez3yia._.js +0 -3
  690. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0k7q0ug._.js +0 -3
  691. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0odjvc.._.js +0 -3
  692. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0pwlb77._.js +0 -3
  693. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0t.h859._.js +0 -3
  694. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0thp9l5._.js +0 -3
  695. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0wce254._.js +0 -3
  696. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0y4mxf8._.js +0 -3
  697. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12l8jkb._.js +0 -3
  698. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_079nj-_._.js +0 -3
  699. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0_z9696._.js +0 -3
  700. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0grv2wq._.js +0 -3
  701. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0jrh7xy._.js +0 -3
  702. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_00arje5._.js +0 -3
  703. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_08h.f_8._.js +0 -3
  704. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0jns_ph._.js +0 -3
  705. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0pf30rh._.js +0 -3
  706. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0ymj2~2._.js +0 -3
  707. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-88a30l.a1sg.js +0 -1
  708. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-xwobg-a6si1.js +0 -1
  709. package/dist/dashboard-runtime/dashboard/.next/static/chunks/026lyw-ynx1og.js +0 -1
  710. package/dist/dashboard-runtime/dashboard/.next/static/chunks/04a.1c2rygy08.js +0 -1
  711. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05.2q9f0yx4e_.js +0 -1
  712. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05_iqjh-v2gej.js +0 -1
  713. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05d8-45s941bx.js +0 -1
  714. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07twdccs42b_-.js +0 -1
  715. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09v-qczj__g1x.js +0 -1
  716. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0_8~9zgfm5f.8.js +0 -1
  717. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0_zw2y~vb_52n.js +0 -1
  718. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0a2f-mxepv-y7.js +0 -1
  719. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0a9.rr50h5ypa.js +0 -1
  720. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0amex7bwxnme9.js +0 -1
  721. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0apfhv-v7oy7u.js +0 -1
  722. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0bxt5icwb83xt.js +0 -1
  723. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dpi1comd-thc.js +0 -1
  724. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0eafb9pun~54k.js +0 -9
  725. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0eerrv808~6bh.js +0 -4
  726. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j6agpotrd_n4.js +0 -1
  727. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jbcdgtcgqemd.js +0 -1
  728. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jp7zmwvyv0bn.js +0 -1
  729. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k8mhea24d_kj.js +0 -1
  730. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0krt75we1wtcy.js +0 -1
  731. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ogrq_r43je48.js +0 -1
  732. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0prl9yrb8ksp8.js +0 -1
  733. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0r4azm.3hswcs.js +0 -138
  734. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0r6utd8g~.cc1.js +0 -1
  735. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6c8q4k~6aiy.js +0 -1
  736. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0uj7ezedkm6ou.css +0 -1
  737. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x5qtkdg2trq9.js +0 -5
  738. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yvc~t7p88wsf.js +0 -1
  739. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0zatcw.k613lh.js +0 -1
  740. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0zhfdjby7cj-q.js +0 -1
  741. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~naqbx3873~r.js +0 -1
  742. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13__t3s3ipfzl.js +0 -1
  743. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14.8mq880kjoc.js +0 -1
  744. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14rpr3z1.lmgj.js +0 -1
  745. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16uky1ro-t_~9.js +0 -1
  746. package/dist/dashboard-runtime/dashboard/.next/static/chunks/18absak_u0d85.js +0 -138
  747. package/dist/dashboard-runtime/dashboard/tsconfig.tsbuildinfo +0 -1
  748. package/dist/dashboard-runtime/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  749. /package/dist/dashboard-runtime/dashboard/.next/static/{8G6beqTEKH_-N0JljpgWT → mCNgeSYc3Dx3KiZXWf-5A}/_buildManifest.js +0 -0
  750. /package/dist/dashboard-runtime/dashboard/.next/static/{8G6beqTEKH_-N0JljpgWT → mCNgeSYc3Dx3KiZXWf-5A}/_clientMiddlewareManifest.js +0 -0
  751. /package/dist/dashboard-runtime/dashboard/.next/static/{8G6beqTEKH_-N0JljpgWT → mCNgeSYc3Dx3KiZXWf-5A}/_ssgManifest.js +0 -0
  752. /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/index.js +0 -0
  753. /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/versions.json +0 -0
@@ -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),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),T=a.i(172518),U=a.i(962491);function V(a,b,c){if("awaiting_plan_approval"!==a.status)throw Error(`Dream task must be awaiting_plan_approval; current status is ${a.status}`);if("reject"===b)return{kind:"cancel",dreamId:a.dreamId};if(!a.plan||"string"!=typeof a.plan.summary||""===a.plan.summary.trim()||!Array.isArray(a.plan.deleteMemoryIds)||!a.plan.deleteMemoryIds.every(a=>"string"==typeof a&&""!==a.trim()))throw Error("Dream task does not contain a valid plan");let d=c?.trim()??"";if(""===d)throw Error("Approver is required");return{kind:"approve",dreamId:a.dreamId,approver:d}}function W({memoryStoreName:a,task:d,open:f,onOpenChange:g}){let i,{t:k}=(0,D.useI18n)(),l=(i=(0,t.useQueryClient)(),(0,s.useMutation)({mutationFn:({dreamId:b,approver:c})=>(0,o.approveDreamPlan)(a,b,c),onSuccess:()=>{i.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes("dream-tasks")&&b.queryKey.includes(a)})}})),[m,n]=(0,c.useState)(""),p=a=>{a||n(""),g(a)},q=async()=>{try{let a=V(d,"approve",m);if("approve"!==a.kind)return;await l.mutateAsync({dreamId:a.dreamId,approver:a.approver}),e.toast.success(k("memory.dream.planApprovalSuccess")),p(!1)}catch(a){e.toast.error(a instanceof Error?a.message:k("memory.dream.planApprovalFailed"))}},r=d.plan;return(0,b.jsx)(j.Dialog,{open:f,onOpenChange:p,children:(0,b.jsxs)(j.DialogContent,{className:"max-w-2xl",children:[(0,b.jsxs)(j.DialogHeader,{children:[(0,b.jsx)(j.DialogTitle,{children:k("memory.dream.planApprovalTitle")}),(0,b.jsx)(j.DialogDescription,{children:k("memory.dream.planApprovalDescription")})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("section",{className:"rounded-md border border-[hsl(var(--border))] p-3",children:[(0,b.jsx)("h4",{className:"mb-1 text-xs font-semibold uppercase text-muted-foreground",children:k("memory.dream.planSummary")}),(0,b.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:r?.summary})]}),(0,b.jsxs)("section",{className:"rounded-md border border-[hsl(var(--border))] p-3",children:[(0,b.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase text-muted-foreground",children:k("memory.dream.planDeletionWhitelist")}),r?.deleteMemoryIds.length?(0,b.jsx)("ul",{className:"space-y-1 font-mono text-xs",children:r.deleteMemoryIds.map(a=>(0,b.jsx)("li",{className:"break-all",children:a},a))}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:k("memory.dream.planNoDeletions")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(U.Label,{htmlFor:"dream-plan-approver",children:k("memory.dream.planApprover")}),(0,b.jsx)(T.Input,{id:"dream-plan-approver",value:m,onChange:a=>n(a.target.value),placeholder:k("memory.dream.planApproverPlaceholder")})]})]}),(0,b.jsxs)(j.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>p(!1),children:k("common.cancel")}),(0,b.jsx)(h.Button,{onClick:q,disabled:l.isPending||""===m.trim(),children:l.isPending?k("memory.dream.planApproving"):k("memory.dream.planApprove")})]})]})})}let X={queued:"bg-info-soft text-info",running:"bg-info-soft text-info",planning:"bg-info-soft text-info",awaiting_plan_approval:"bg-warning-soft text-warning",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"},Y={queued:"memory.dreamStatus.queued",running:"memory.dreamStatus.running",planning:"memory.dreamStatus.planning",awaiting_plan_approval:"memory.dreamStatus.awaitingPlanApproval",applying:"memory.dreamStatus.applying",completed:"memory.dreamStatus.completed",completed_with_failures:"memory.dreamStatus.completedWithFailures",failed:"memory.dreamStatus.failed",cancelled:"memory.dreamStatus.cancelled"};function Z({status:a,t:c}){let d=!r.DREAM_TERMINAL_STATUSES.has(a),e=Y[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",X[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 $={memory:"memory.dreamType.consolidate",skill:"memory.dreamType.skill",profile:"memory.dreamType.profile"},_={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 aa({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})]})}function ab({label:a,value:c}){return(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:a}),(0,b.jsx)("dd",{className:"mt-0.5 break-all font-mono text-foreground",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),[I,J]=(0,c.useState)(!1),[K,L]=(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 M=A.data,N=M&&r.DREAM_TERMINAL_STATUSES.has(M.status),P=M?.taskType==="skill"||M?.taskType==="profile",Q=M?.status==="awaiting_plan_approval",R=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)}},T=async()=>{if(M)try{let a=V(M,"reject");if("cancel"!==a.kind)return;await B.mutateAsync(a.dreamId),e.toast.success(v("memory.dream.rejectPlanSuccess")),J(!1)}catch(b){let a=b instanceof Error?b.message:v("memory.dream.rejectPlanFailed");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"}):M?(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:M.dreamId}),(u=M.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",_[u]??"bg-muted text-muted-foreground"),children:$[u]?v($[u]):u}))]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(Z,{status:M.status,t:v}),(!M.taskType||"memory"===M.taskType)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"safe_auto"===M.applyMode?v("memory.dream.applyModeAutoDetail"):"plan"===M.applyMode?v("memory.dream.applyModePlanDetail"):v("memory.dream.applyModeProposalDetail")}),(0,b.jsx)("span",{children:"·"}),(0,b.jsx)("span",{children:v("memory.dream.executionModeDetail",{value:M.executionMode})}),(0,b.jsx)("span",{children:"·"}),(0,b.jsx)("span",{children:v("memory.dream.scopeOutput",{value:"promote_scope"===M.scopeOutputMode?v("memory.dream.scopeOutputPromote"):v("memory.dream.scopeOutputPreserve")})})]}),!N&&(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}),M.lastError&&(0,b.jsxs)(h.Button,{size:"sm",variant:"outline",onClick:()=>L(!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")]}),Q&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.Button,{size:"sm",onClick:()=>H(!0),children:v("memory.dream.approvePlan")}),(0,b.jsx)(h.Button,{size:"sm",variant:"destructive",onClick:()=>J(!0),disabled:B.isPending,children:v("memory.dream.rejectPlan")})]}),!N&&!Q&&(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)(aa,{label:v("memory.dream.statSessions"),value:M.input.sessionCount}),(0,b.jsx)(aa,{label:v("memory.dream.statMessages"),value:M.input.messageCount}),(!M.taskType||"memory"===M.taskType)&&(0,b.jsx)(aa,{label:v("memory.dream.statMemories"),value:M.input.memoryCount}),(0,b.jsx)(aa,{label:P?v("memory.dream.statOutput"):v("memory.dream.statActionTotal"),value:M.actions.total}),P?(0,b.jsx)(aa,{label:v("memory.dream.statApplied"),value:M.actions.applied}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aa,{label:v("memory.dream.statProposed"),value:M.actions.proposed}),(0,b.jsx)(aa,{label:v("memory.dream.statAppliedShort"),value:M.actions.applied}),(0,b.jsx)(aa,{label:v("memory.dream.statSkipped"),value:M.actions.skipped})]}),M.actions.failed>0&&(0,b.jsx)(aa,{label:v("memory.dream.statFailed"),value:M.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(M.createdAt).getTime()})]}),(0,b.jsxs)("span",{children:[v("memory.dream.metaUpdated"),(0,b.jsx)(m.RelativeTime,{timestamp:new Date(M.updatedAt).getTime()})]}),M.finishedAt&&(0,b.jsxs)("span",{children:[v("memory.dream.metaFinished"),(0,b.jsx)(m.RelativeTime,{timestamp:new Date(M.finishedAt).getTime()})]}),M.input.scopes&&M.input.scopes.length>0&&(0,b.jsxs)("span",{children:[v("memory.dream.metaInputScopes"),M.input.scopes.map(a=>[a.appId,a.tenantId,a.agentId,a.runId].filter(Boolean).join(" / ")||"-").slice(0,3).join(" | "),M.input.scopes.length>3&&` +${M.input.scopes.length-3}`]})]})]}),("multi_loop"===M.executionMode||M.stage||M.sandbox||void 0!==M.submittedBatchCount||M.failureCode)&&(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-4",children:[(0,b.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:v("memory.dream.agenticRuntimeTitle")}),(0,b.jsxs)("dl",{className:"grid gap-3 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[(0,b.jsx)(ab,{label:v("memory.dream.detailStage"),value:M.stage}),(0,b.jsx)(ab,{label:v("memory.dream.detailSandboxId"),value:M.sandbox?.sandboxId}),(0,b.jsx)(ab,{label:v("memory.dream.detailSandboxPhase"),value:M.sandbox?.phase}),(0,b.jsx)(ab,{label:v("memory.dream.detailSandboxStatus"),value:M.sandbox?.status}),(0,b.jsx)(ab,{label:v("memory.dream.detailSubmittedBatches"),value:M.submittedBatchCount}),(0,b.jsx)(ab,{label:v("memory.dream.detailLastBatch"),value:M.lastBatch?[M.lastBatch.batchId,void 0!==M.lastBatch.sequence?`#${M.lastBatch.sequence}`:void 0,void 0!==M.lastBatch.expectedActionCount?`${M.lastBatch.expectedActionCount} actions`:void 0,void 0!==M.lastBatch.settled?M.lastBatch.settled?"settled":"pending":void 0].filter(Boolean).join(" · "):void 0}),(0,b.jsx)(ab,{label:v("memory.dream.detailFailureCode"),value:M.failureCode}),(0,b.jsx)(ab,{label:v("memory.dream.detailProcessedThrough"),value:M.processedThroughMs}),(0,b.jsx)(ab,{label:v("memory.dream.detailAgentFinished"),value:M.agentFinishedAt}),(0,b.jsx)(ab,{label:v("memory.dream.detailPlanApproved"),value:M.plan?.approvedAt}),(0,b.jsx)(ab,{label:v("memory.dream.detailExecutionExpires"),value:M.plan?.executionExpiresAt})]})]}),M.plan&&(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:v("memory.dream.planSummary")}),(0,b.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:M.plan.summary}),(0,b.jsx)("h4",{className:"mb-2 mt-4 text-xs font-semibold uppercase text-muted-foreground",children:v("memory.dream.planDeletionWhitelist")}),M.plan.deleteMemoryIds.length>0?(0,b.jsx)("ul",{className:"space-y-1 font-mono text-xs",children:M.plan.deleteMemoryIds.map(a=>(0,b.jsx)("li",{className:"break-all",children:a},a))}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:v("memory.dream.planNoDeletions")})]}),M.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"===M.taskType?v("memory.dream.instructionsProfile"):"skill"===M.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:M.instructions})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:P?v("memory.dream.resultsExtract"):v("memory.dream.resultsActions")}),(0,b.jsx)(O,{memoryStoreName:y,dreamId:z,taskType:M.taskType})]}),(0,b.jsx)(l.ConfirmDialog,{open:E,onOpenChange:F,title:v("memory.dream.cancelConfirmTitle"),description:v("memory.dream.cancelConfirmDesc"),variant:"danger",onConfirm:R}),Q&&(0,b.jsx)(W,{memoryStoreName:y,task:M,open:G,onOpenChange:H}),(0,b.jsx)(l.ConfirmDialog,{open:I,onOpenChange:J,title:v("memory.dream.rejectPlanConfirmTitle"),description:v("memory.dream.rejectPlanConfirmDesc"),confirmText:v("memory.dream.rejectPlan"),variant:"danger",onConfirm:T}),(0,b.jsx)(j.Dialog,{open:K,onOpenChange:L,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:M.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)}];
1
+ module.exports=[909598,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(412583),e=a.i(880470),f=a.i(263265),g=a.i(69088),h=a.i(700623),i=a.i(637102),j=a.i(776192),k=a.i(604395),l=a.i(843836),m=a.i(887617),n=a.i(324567),o=a.i(865271),p=a.i(983366),q=a.i(421347),r=a.i(225377),s=a.i(739096),t=a.i(80024),u=a.i(933596),v=a.i(895487),w=a.i(1078),x=a.i(36890),y=a.i(663525),z=a.i(350681),A=a.i(109734),B=a.i(223301),C=a.i(434841),D=a.i(726436),E=a.i(364565),F=a.i(543320);let G={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 H({open:a,onOpenChange:c,memoryStoreName:d,selected:e,onConfirm:f,busy:g}){let{t:h}=(0,F.useI18n)(),i={};for(let a of e)i[a.action]=(i[a.action]??0)+1;let k=(i.DELETE??0)>0,m=e.slice(0,6),n=e.length-m.length;return(0,b.jsx)(l.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(l.DialogContent,{className:"max-w-xl",children:[(0,b.jsxs)(l.DialogHeader,{children:[(0,b.jsx)(l.DialogTitle,{children:h("memory.dream.apply.title")}),(0,b.jsxs)(l.DialogDescription,{children:[h("memory.dream.apply.descPrefix")," ",(0,b.jsx)("span",{className:"font-mono",children:d})," ",h("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(i).map(a=>(0,b.jsxs)("span",{className:(0,E.cn)("inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-mono font-semibold",G[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:h("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,E.cn)("mt-0.5 shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",G[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)(w.Sparkles,{className:"mr-1 inline-block h-3 w-3"}),h("memory.dream.apply.remaining",{count:n})]})]})]}),(0,b.jsxs)(l.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>c(!1),disabled:g,children:h("common.cancel")}),(0,b.jsx)(j.Button,{variant:k?"destructive":"default",onClick:f,disabled:g,children:g?h("memory.dream.apply.applying"):h("memory.dream.apply.confirm",{count:e.length})})]})]})})}let 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:"memory.actionStatus.proposed",applied:"memory.actionStatus.applied",skipped:"memory.actionStatus.skipped",failed:"memory.actionStatus.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,E.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,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,E.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)(N,{memoryStoreName:c,memoryId:h,scope:i,verbPrefix:d("DELETE"===e?"memory.dream.actions.delete":"memory.dream.actions.merge"),t:d})}function N({memoryStoreName:a,memoryId:c,scope:d,verbPrefix:e,t:f}){let g=(0,D.useMemoryUnit)(a,c,d);if(!c)return(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"});if(g.isLoading)return(0,b.jsx)(k.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 O({status:a,t:c}){let d=J[a];return(0,b.jsx)("span",{className:(0,E.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:d?c(d):a})}function P(a){return a&&[a.appId,a.tenantId,a.agentId,a.runId].filter(Boolean).join(" / ")||"-"}function Q({memoryStoreName:a,dreamId:e,taskType:g,artifactWikiHref:h}){let i,{t:l}=(0,F.useI18n)(),m=(0,c.useMemo)(()=>[{value:"all",label:l("memory.dream.actions.allStatus")},{value:"proposed",label:l("memory.actionStatus.proposed")},{value:"applied",label:l("memory.actionStatus.applied")},{value:"skipped",label:l("memory.actionStatus.skipped")},{value:"failed",label:l("memory.actionStatus.failed")}],[l]),n=(0,c.useMemo)(()=>[{value:"all",label:l("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"}],[l]),o=(0,c.useMemo)(()=>[{value:"created_at_asc",label:l("memory.dream.actions.orderCreatedAsc")},{value:"created_at_desc",label:l("memory.dream.actions.orderCreatedDesc")},{value:"confidence_desc",label:l("memory.dream.actions.orderConfidenceDesc")}],[l]),t="skill"===g||"profile"===g,[D,E]=(0,c.useState)("all"),[G,I]=(0,c.useState)("all"),[J,K]=(0,c.useState)("created_at_asc"),[N,R]=(0,c.useState)(0),T=function(a,b,c,d){let{context:e,ready:f}=(0,s.useRuntimeContext)();return(0,p.useQuery)({queryKey:r.queryKeys.dreamActions(e.dataScopeKey,a,b,c,d?.nextToken,d?.limit),queryFn:()=>(0,q.listDreamActions)(a,b,c,d),enabled:f&&!!a&&!!b})}(a,e,(0,c.useMemo)(()=>{let a={orderBy:J};return"all"!==D&&(a.status=D),"all"!==G&&(a.action=G),N>0&&(a.minConfidence=N),a},[D,G,J,N]),{limit:100}),U=T.data?.items??[],[V,W]=(0,c.useState)(new Set),[X,Y]=(0,c.useState)(null),[Z,$]=(0,c.useState)(!1),_=(i=(0,v.useQueryClient)(),(0,u.useMutation)({mutationFn:({actionIds:b,applier:c})=>(0,q.applyDreamActions)(a,e,b,c),onSuccess:()=>{i.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes(a)&&b.queryKey.includes(e)}),i.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes(a)&&(b.queryKey.includes("units")||b.queryKey.includes("scopes"))})}})),aa=a=>"proposed"===a.status&&"EMIT_SKILL"!==a.action&&"EMIT_PROFILE"!==a.action,ab=U.filter(aa).length,ac=ab>0&&U.every(a=>!aa(a)||V.has(a.actionId)),ad=async()=>{try{let a=await _.mutateAsync({actionIds:Array.from(V)});f.toast.success(l("memory.dream.actions.applyResult",{applied:a.applied,failed:a.failed})),W(new Set),$(!1)}catch(b){let a=b instanceof Error?b.message:l("memory.dream.actions.applyFailed");f.toast.error(a)}};return(0,b.jsx)(C.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)(y.Select,{value:D,onValueChange:E,children:[(0,b.jsx)(y.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(y.SelectValue,{})}),(0,b.jsx)(y.SelectContent,{children:m.map(a=>(0,b.jsx)(y.SelectItem,{value:a.value,children:a.label},a.value))})]}),!t&&(0,b.jsxs)(y.Select,{value:G,onValueChange:I,children:[(0,b.jsx)(y.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(y.SelectValue,{})}),(0,b.jsx)(y.SelectContent,{children:n.map(a=>(0,b.jsx)(y.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsxs)(y.Select,{value:J,onValueChange:a=>K(a),children:[(0,b.jsx)(y.SelectTrigger,{className:"h-8 w-32 text-sm",children:(0,b.jsx)(y.SelectValue,{})}),(0,b.jsx)(y.SelectContent,{children:o.map(a=>(0,b.jsx)(y.SelectItem,{value:a.value,children:a.label},a.value))})]}),!t&&(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:l("memory.dream.actions.minConfidence")}),(0,b.jsx)(z.Slider,{value:[N],max:1,step:.05,onValueChange:a=>R(a[0]??0),className:"w-32"}),(0,b.jsx)("span",{className:"font-mono text-xs",children:N.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:l("memory.dream.actions.selectedCount",{count:V.size})}),(0,b.jsx)(j.Button,{size:"sm",disabled:0===V.size||_.isPending,onClick:()=>$(!0),children:_.isPending?l("memory.dream.actions.applying"):l("memory.dream.actions.applySelected",{count:V.size})})]})]})]}),T.isLoading?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(k.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(k.Skeleton,{className:"h-10 w-full"})]}):0===U.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)(w.Sparkles,{className:"mx-auto mb-2 h-6 w-6 text-muted-foreground/60"}),t?l("memory.dream.actions.emptyExtract"):l("memory.dream.actions.emptyFiltered")]}):(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--border))]",children:(0,b.jsxs)(B.Table,{children:[(0,b.jsx)(B.TableHeader,{children:(0,b.jsxs)(B.TableRow,{children:[!t&&(0,b.jsx)(B.TableHead,{className:"w-8",children:(0,b.jsx)(x.Checkbox,{checked:ac,onCheckedChange:()=>{ac?W(new Set):W(new Set(U.filter(aa).map(a=>a.actionId)))},disabled:0===ab,"aria-label":l("memory.dream.actions.selectAll")})}),(0,b.jsx)(B.TableHead,{children:t?l("memory.dream.actions.colOutputType"):l("memory.dream.actions.colType")}),(0,b.jsx)(B.TableHead,{children:l("memory.dream.actions.colStatus")}),(0,b.jsx)(B.TableHead,{children:l("memory.common.targetScope")}),(0,b.jsx)(B.TableHead,{children:t?l("memory.dream.actions.colContent"):l("memory.dream.actions.colImpact")}),!t&&(0,b.jsx)(B.TableHead,{className:"text-right",children:l("memory.dream.actions.colConfidence")})]})}),(0,b.jsx)(B.TableBody,{children:U.map(c=>{let e=aa(c),f=h?.(c);return(0,b.jsxs)(B.TableRow,{className:"cursor-pointer hover:bg-[hsl(var(--accent))]",onClick:()=>Y(c),children:[!t&&(0,b.jsx)(B.TableCell,{onClick:a=>a.stopPropagation(),children:e?(0,b.jsx)(x.Checkbox,{checked:V.has(c.actionId),onCheckedChange:()=>{var a;return a=c.actionId,void W(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},"aria-label":l("memory.dream.actions.selectAction")}):(0,b.jsxs)(C.Tooltip,{children:[(0,b.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{children:(0,b.jsx)(x.Checkbox,{checked:!1,disabled:!0,"aria-label":l("memory.dream.actions.notSelectable")})})}),(0,b.jsx)(C.TooltipContent,{children:l("memory.dream.actions.onlyProposedApply")})]})}),(0,b.jsx)(B.TableCell,{children:(0,b.jsx)(L,{action:c.action})}),(0,b.jsx)(B.TableCell,{children:(0,b.jsx)(O,{status:c.status,t:l})}),(0,b.jsx)(B.TableCell,{className:"text-xs",children:P(c.targetScope)}),(0,b.jsxs)(B.TableCell,{className:"max-w-md",children:[(0,b.jsx)(M,{action:c,memoryStoreName:a,t:l}),f?(0,b.jsx)(d.default,{href:f,className:"mt-1 inline-block text-xs text-primary hover:underline",onClick:a=>a.stopPropagation(),children:l("memory.dream.actions.openInWiki")}):null]}),!t&&(0,b.jsx)(B.TableCell,{className:"text-right font-mono text-xs",children:void 0!==c.confidence?c.confidence.toFixed(2):"-"})]},c.actionId)})})]})}),(0,b.jsx)(A.Sheet,{open:null!==X,onOpenChange:a=>!a&&Y(null),children:(0,b.jsx)(A.SheetContent,{className:"w-[560px] sm:max-w-[560px]",children:X&&(0,b.jsx)(S,{detail:X,memoryStoreName:a,t:l})})}),(0,b.jsx)(H,{open:Z,onOpenChange:$,memoryStoreName:a,selected:U.filter(a=>V.has(a.actionId)),onConfirm:ad,busy:_.isPending})]})})}function R({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,D.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,E.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 i=g.data?.memory?.text,j=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"),j&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["· ",j]})]}),g.isLoading?(0,b.jsx)(k.Skeleton,{className:"h-16 w-full"}):i?(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:i}):(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,E.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 S({detail:a,memoryStoreName:c,t:d}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(A.SheetHeader,{children:[(0,b.jsxs)(A.SheetTitle,{children:[(0,b.jsx)(L,{action:a.action})," ",d("memory.dream.actions.detailTitle")]}),(0,b.jsx)(A.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,t:d}),(0,b.jsxs)("div",{className:"space-y-2 rounded border border-[hsl(var(--border-light))] p-3",children:[(0,b.jsx)(T,{label:d("memory.dream.actions.detailStatus"),children:(0,b.jsx)(O,{status:a.status,t:d})}),(0,b.jsx)(T,{label:d("memory.dream.actions.detailConfidence"),value:void 0!==a.confidence?a.confidence.toFixed(2):"-"}),(0,b.jsx)(T,{label:d("memory.common.targetScope"),value:P(a.targetScope)}),a.targetMemoryId&&(0,b.jsx)(T,{label:d("memory.dream.actions.detailTargetMemoryId"),value:a.targetMemoryId,mono:!0}),a.resultMemoryId&&(0,b.jsx)(T,{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)(T,{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 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,E.cn)("flex-1 text-sm",d&&"font-mono"),children:c??"-"})]})}var U=a.i(601170),V=a.i(172518),W=a.i(962491);function X(a,b,c){if("awaiting_plan_approval"!==a.status)throw Error(`Dream task must be awaiting_plan_approval; current status is ${a.status}`);if("reject"===b)return{kind:"cancel",dreamId:a.dreamId};if(!a.plan||"string"!=typeof a.plan.summary||""===a.plan.summary.trim()||!Array.isArray(a.plan.deleteMemoryIds)||!a.plan.deleteMemoryIds.every(a=>"string"==typeof a&&""!==a.trim()))throw Error("Dream task does not contain a valid plan");let d=c?.trim()??"";if(""===d)throw Error("Approver is required");return{kind:"approve",dreamId:a.dreamId,approver:d}}function Y({memoryStoreName:a,task:d,open:e,onOpenChange:g}){let h,{t:i}=(0,F.useI18n)(),k=(h=(0,v.useQueryClient)(),(0,u.useMutation)({mutationFn:({dreamId:b,approver:c})=>(0,q.approveDreamPlan)(a,b,c),onSuccess:()=>{h.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes("dream-tasks")&&b.queryKey.includes(a)})}})),[m,n]=(0,c.useState)(""),o=a=>{a||n(""),g(a)},p=async()=>{try{let a=X(d,"approve",m);if("approve"!==a.kind)return;await k.mutateAsync({dreamId:a.dreamId,approver:a.approver}),f.toast.success(i("memory.dream.planApprovalSuccess")),o(!1)}catch(a){f.toast.error(a instanceof Error?a.message:i("memory.dream.planApprovalFailed"))}},r=d.plan;return(0,b.jsx)(l.Dialog,{open:e,onOpenChange:o,children:(0,b.jsxs)(l.DialogContent,{className:"max-w-2xl",children:[(0,b.jsxs)(l.DialogHeader,{children:[(0,b.jsx)(l.DialogTitle,{children:i("memory.dream.planApprovalTitle")}),(0,b.jsx)(l.DialogDescription,{children:i("memory.dream.planApprovalDescription")})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("section",{className:"rounded-md border border-[hsl(var(--border))] p-3",children:[(0,b.jsx)("h4",{className:"mb-1 text-xs font-semibold uppercase text-muted-foreground",children:i("memory.dream.planSummary")}),(0,b.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:r?.summary})]}),(0,b.jsxs)("section",{className:"rounded-md border border-[hsl(var(--border))] p-3",children:[(0,b.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase text-muted-foreground",children:i("memory.dream.planDeletionWhitelist")}),r?.deleteMemoryIds.length?(0,b.jsx)("ul",{className:"space-y-1 font-mono text-xs",children:r.deleteMemoryIds.map(a=>(0,b.jsx)("li",{className:"break-all",children:a},a))}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:i("memory.dream.planNoDeletions")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(W.Label,{htmlFor:"dream-plan-approver",children:i("memory.dream.planApprover")}),(0,b.jsx)(V.Input,{id:"dream-plan-approver",value:m,onChange:a=>n(a.target.value),placeholder:i("memory.dream.planApproverPlaceholder")})]})]}),(0,b.jsxs)(l.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>o(!1),children:i("common.cancel")}),(0,b.jsx)(j.Button,{onClick:p,disabled:k.isPending||""===m.trim(),children:k.isPending?i("memory.dream.planApproving"):i("memory.dream.planApprove")})]})]})})}var Z=a.i(870307);function $(a,b){var c;let d="EMIT_SKILL"===b.action?"skill":"EMIT_PROFILE"===b.action?"profile":void 0;if("applied"!==b.status||!d||b.newExtract?.kind!==d||![(c=b.targetScope).appId,c.tenantId,c.agentId,c.runId].every(a=>"string"==typeof a&&a.length>0&&"*"!==a))return;let e=new URLSearchParams([["appId",b.targetScope.appId],["tenantId",b.targetScope.tenantId],["agentId",b.targetScope.agentId],["runId",b.targetScope.runId],["dreamId",b.dreamId],["actionId",b.actionId]]);return`/memory/${encodeURIComponent(a)}/wiki?${e.toString()}`}let _={queued:"bg-info-soft text-info",running:"bg-info-soft text-info",planning:"bg-info-soft text-info",awaiting_plan_approval:"bg-warning-soft text-warning",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"},aa={queued:"memory.dreamStatus.queued",running:"memory.dreamStatus.running",planning:"memory.dreamStatus.planning",awaiting_plan_approval:"memory.dreamStatus.awaitingPlanApproval",applying:"memory.dreamStatus.applying",completed:"memory.dreamStatus.completed",completed_with_failures:"memory.dreamStatus.completedWithFailures",failed:"memory.dreamStatus.failed",cancelled:"memory.dreamStatus.cancelled"};function ab({status:a,t:c}){let d=!t.DREAM_TERMINAL_STATUSES.has(a),e=aa[a];return(0,b.jsxs)("span",{className:(0,E.cn)("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium select-none whitespace-nowrap",_[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 ac={memory:"memory.dreamType.consolidate",skill:"memory.dreamType.skill",profile:"memory.dreamType.profile"},ad={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 ae({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})]})}function af({label:a,value:c}){return(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:a}),(0,b.jsx)("dd",{className:"mt-0.5 break-all font-mono text-foreground",children:c??"—"})]})}a.s(["buildDreamArtifactWikiHref",0,$,"default",0,function(){let a,w,{t:x}=(0,F.useI18n)(),y=(0,e.useParams)(),z=(0,e.useRouter)(),A=decodeURIComponent(y.store),B=decodeURIComponent(y.dreamId),C=function(a,b){let{context:c,ready:d}=(0,s.useRuntimeContext)();return(0,p.useQuery)({queryKey:r.queryKeys.dreamTask(c.dataScopeKey,a,b),queryFn:()=>(0,q.getDreamTask)(a,b),enabled:d&&!!a&&!!b,refetchInterval:a=>{let b=a.state.data;return b?!t.DREAM_TERMINAL_STATUSES.has(b.status)&&5e3:5e3},refetchIntervalInBackground:!1})}(A,B),D=(a=(0,v.useQueryClient)(),(0,u.useMutation)({mutationFn:a=>(0,q.cancelDreamTask)(A,a),onSuccess:()=>{a.invalidateQueries({queryKey:["memory"],predicate:a=>Array.isArray(a.queryKey)&&a.queryKey.includes("dream-tasks")&&a.queryKey.includes(A)})}})),[G,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)(!1);if(C.error instanceof Error&&"code"in C.error&&"DREAMING_DISABLED"===C.error.code)return(0,b.jsx)(U.MemoryDreamDisabled,{});let O=C.data,P=O?.input.scopes??[],R=1===P.length?(0,Z.toExactScope)(P[0]):null,S=O&&t.DREAM_TERMINAL_STATUSES.has(O.status),T=O?.taskType==="skill"||O?.taskType==="profile",V=O?.status==="awaiting_plan_approval",W=async()=>{try{await D.mutateAsync(B),f.toast.success(x("memory.dream.cancelSuccess")),H(!1)}catch(b){let a=b instanceof Error?b.message:x("memory.dream.cancelFailed");f.toast.error(a)}},_=async()=>{if(O)try{let a=X(O,"reject");if("cancel"!==a.kind)return;await D.mutateAsync(a.dreamId),f.toast.success(x("memory.dream.rejectPlanSuccess")),L(!1)}catch(b){let a=b instanceof Error?b.message:x("memory.dream.rejectPlanFailed");f.toast.error(a)}};return(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(j.Button,{variant:"ghost",size:"sm",onClick:()=>z.push(`/memory/${encodeURIComponent(A)}/dream`),children:[(0,b.jsx)(h.ArrowLeft,{className:"mr-1 h-3.5 w-3.5"}),x("memory.dream.backToTaskList")]}),R?(0,b.jsx)(j.Button,{asChild:!0,variant:"ghost",size:"sm",children:(0,b.jsxs)(d.default,{href:(0,Z.buildScopeWorkspaceHref)(A,R),children:[(0,b.jsx)(h.ArrowLeft,{className:"mr-1 h-3.5 w-3.5"}),x("memory.dream.backToScope")]})}):null]}),C.isLoading?(0,b.jsx)(k.Skeleton,{className:"h-32 w-full"}):O?(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)(g.CopyableId,{value:O.dreamId,label:x("memory.dream.tableId"),valueClassName:"text-base"}),(w=O.taskType||"memory",(0,b.jsx)("span",{className:(0,E.cn)("inline-flex rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap",ad[w]??"bg-muted text-muted-foreground"),children:ac[w]?x(ac[w]):w}))]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(ab,{status:O.status,t:x}),(!O.taskType||"memory"===O.taskType)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"safe_auto"===O.applyMode?x("memory.dream.applyModeAutoDetail"):"plan"===O.applyMode?x("memory.dream.applyModePlanDetail"):x("memory.dream.applyModeProposalDetail")}),(0,b.jsx)("span",{children:"·"})]}),(0,b.jsx)("span",{children:x("memory.dream.effortDetail",{value:O.effort})}),(!O.taskType||"memory"===O.taskType)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsx)("span",{children:x("memory.dream.scopeOutput",{value:"promote_scope"===O.scopeOutputMode?x("memory.dream.scopeOutputPromote"):x("memory.dream.scopeOutputPreserve")})})]}),!S&&(0,b.jsx)("span",{className:"ml-1 italic",children:x("memory.dream.autoRefresh")})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(m.RefreshButton,{onClick:()=>C.refetch(),loading:C.isRefetching}),O.lastError&&(0,b.jsxs)(j.Button,{size:"sm",variant:"outline",onClick:()=>N(!0),className:"text-[hsl(var(--destructive))]",children:[(0,b.jsx)(i.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),x("memory.dream.viewError")]}),V&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(j.Button,{size:"sm",onClick:()=>J(!0),children:x("memory.dream.approvePlan")}),(0,b.jsx)(j.Button,{size:"sm",variant:"destructive",onClick:()=>L(!0),disabled:D.isPending,children:x("memory.dream.rejectPlan")})]}),!S&&!V&&(0,b.jsx)(j.Button,{size:"sm",variant:"outline",onClick:()=>H(!0),disabled:D.isPending,children:x("memory.dream.cancelTask")})]})]}),(0,b.jsxs)("div",{className:"mt-5 grid grid-cols-2 gap-4 sm:grid-cols-4",children:[(0,b.jsx)(ae,{label:x("memory.dream.statSessions"),value:O.input.sessionCount}),(0,b.jsx)(ae,{label:x("memory.dream.statMessages"),value:O.input.messageCount}),(!O.taskType||"memory"===O.taskType)&&(0,b.jsx)(ae,{label:x("memory.dream.statMemories"),value:O.input.memoryCount}),(0,b.jsx)(ae,{label:T?x("memory.dream.statOutput"):x("memory.dream.statActionTotal"),value:O.actions.total}),T?(0,b.jsx)(ae,{label:x("memory.dream.statApplied"),value:O.actions.applied}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ae,{label:x("memory.dream.statProposed"),value:O.actions.proposed}),(0,b.jsx)(ae,{label:x("memory.dream.statAppliedShort"),value:O.actions.applied}),(0,b.jsx)(ae,{label:x("memory.dream.statSkipped"),value:O.actions.skipped})]}),O.actions.failed>0&&(0,b.jsx)(ae,{label:x("memory.dream.statFailed"),value:O.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:[x("memory.dream.metaCreated"),(0,b.jsx)(o.RelativeTime,{timestamp:new Date(O.createdAt).getTime()})]}),(0,b.jsxs)("span",{children:[x("memory.dream.metaUpdated"),(0,b.jsx)(o.RelativeTime,{timestamp:new Date(O.updatedAt).getTime()})]}),O.finishedAt&&(0,b.jsxs)("span",{children:[x("memory.dream.metaFinished"),(0,b.jsx)(o.RelativeTime,{timestamp:new Date(O.finishedAt).getTime()})]}),O.input.scopes&&O.input.scopes.length>0&&(0,b.jsxs)("span",{children:[x("memory.dream.metaInputScopes"),O.input.scopes.map(a=>[a.appId,a.tenantId,a.agentId,a.runId].filter(Boolean).join(" / ")||"-").slice(0,3).join(" | "),O.input.scopes.length>3&&` +${O.input.scopes.length-3}`]})]})]}),(O.stage||void 0!==O.processedThroughMs||O.plan?.approvedAt||O.plan?.executionExpiresAt)&&(0,b.jsxs)("div",{className:"rounded-lg border border-[hsl(var(--border))] p-4",children:[(0,b.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:x("memory.dream.publicRuntimeTitle")}),(0,b.jsxs)("dl",{className:"grid gap-3 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[(0,b.jsx)(af,{label:x("memory.dream.detailStage"),value:O.stage}),(0,b.jsx)(af,{label:x("memory.dream.detailProcessedThrough"),value:O.processedThroughMs}),(0,b.jsx)(af,{label:x("memory.dream.detailPlanApproved"),value:O.plan?.approvedAt}),(0,b.jsx)(af,{label:x("memory.dream.detailExecutionExpires"),value:O.plan?.executionExpiresAt})]})]}),O.plan&&(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:x("memory.dream.planSummary")}),(0,b.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:O.plan.summary}),(0,b.jsx)("h4",{className:"mb-2 mt-4 text-xs font-semibold uppercase text-muted-foreground",children:x("memory.dream.planDeletionWhitelist")}),O.plan.deleteMemoryIds.length>0?(0,b.jsx)("ul",{className:"space-y-1 font-mono text-xs",children:O.plan.deleteMemoryIds.map(a=>(0,b.jsx)("li",{className:"break-all",children:a},a))}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:x("memory.dream.planNoDeletions")})]}),O.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"===O.taskType?x("memory.dream.instructionsProfile"):"skill"===O.taskType?x("memory.dream.instructionsSkill"):x("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:O.instructions})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-3 text-sm font-semibold",children:T?x("memory.dream.resultsExtract"):x("memory.dream.resultsActions")}),(0,b.jsx)(Q,{memoryStoreName:A,dreamId:B,taskType:O.taskType,artifactWikiHref:a=>$(A,a)})]}),(0,b.jsx)(n.ConfirmDialog,{open:G,onOpenChange:H,title:x("memory.dream.cancelConfirmTitle"),description:x("memory.dream.cancelConfirmDesc"),variant:"danger",onConfirm:W}),V&&(0,b.jsx)(Y,{memoryStoreName:A,task:O,open:I,onOpenChange:J}),(0,b.jsx)(n.ConfirmDialog,{open:K,onOpenChange:L,title:x("memory.dream.rejectPlanConfirmTitle"),description:x("memory.dream.rejectPlanConfirmDesc"),confirmText:x("memory.dream.rejectPlan"),variant:"danger",onConfirm:_}),(0,b.jsx)(l.Dialog,{open:M,onOpenChange:N,children:(0,b.jsxs)(l.DialogContent,{className:"max-w-2xl",children:[(0,b.jsx)(l.DialogHeader,{children:(0,b.jsx)(l.DialogTitle,{children:x("memory.dream.lastError")})}),(0,b.jsx)("pre",{className:"max-h-96 overflow-auto rounded bg-danger-soft p-3 text-xs text-danger",children:O.lastError})]})})]}):(0,b.jsx)("div",{className:"rounded-lg border border-dashed py-10 text-center text-sm text-muted-foreground",children:x("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
@@ -1,3 +1,3 @@
1
- module.exports=[696627,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(310410);let f=(0,a.i(750053).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var g=a.i(201927),h=a.i(907704),i=a.i(25825),j=a.i(1078),k=a.i(776192),l=a.i(604395),m=a.i(663525),n=a.i(223301),o=a.i(887617),p=a.i(310215),q=a.i(865271),r=a.i(149086),s=a.i(421347),t=a.i(225377),u=a.i(739096),v=a.i(908264),w=a.i(601170),x=a.i(71562),y=a.i(771071),z=a.i(680904),A=a.i(263265),B=a.i(655295),C=a.i(36890),D=a.i(843836),E=a.i(172518),F=a.i(962491),G=a.i(470535),H=a.i(27692),I=a.i(692942),J=a.i(933596),K=a.i(895487),L=a.i(140613),M=a.i(543320);let N={appIdRequired:"appId 必填",atLeastOneNonWildcard:"至少指定一个非通配符字段",atLeastOneScope:"至少一个 scope",scopesLimit:"scope 最多 20 个",agenticScopesLimit:"Agentic Dream scope 最多 8 个",executionModeCombination:"执行模式与应用模式组合无效",taskTypeExecutionMode:"技能与画像任务不支持 multi_loop",instructionsLimit:"指令不能超过 4000 字节(UTF-8)",maxSessionsRange:"最大会话数必须是 0 到 100 之间的整数",maxMessagesRange:"最大消息数必须是 0 到 20000 之间的整数",maxMemoriesRange:"最大记忆数必须是 0 到 5000 之间的整数",expandedScopeLimitRange:"展开 scope 上限必须是 0 到 1000 之间的整数",thresholdRange:"置信度阈值必须在 0 到 1 之间",timestampInvalid:"时间格式不正确",timestampOrder:"最晚时间不能早于最早时间"};function O(a){return z.z.object({appId:z.z.string().trim().min(1,a.appIdRequired),tenantId:z.z.string().trim().optional(),agentId:z.z.string().trim().optional(),runId:z.z.string().trim().optional()}).refine(a=>Object.values(a).some(a=>a&&"*"!==a),{message:a.atLeastOneNonWildcard,path:["appId"]})}function P(a,b){return z.z.string().trim().optional().superRefine((c,d)=>{if(!c)return;let e=Number(c);(!Number.isInteger(e)||e<0||e>a)&&d.addIssue({code:z.z.ZodIssueCode.custom,message:b})})}function Q(a){return z.z.string().trim().optional().superRefine((b,c)=>{if(!b)return;let d=Number(b);(!Number.isFinite(d)||d<0||d>1)&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a})})}function R(a){return z.z.string().trim().optional().superRefine((b,c)=>{b&&!Number.isFinite(Date.parse(b))&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a})})}function S(a){let b=O(a);return z.z.object({taskType:z.z.enum(["memory","skill","profile"]),executionMode:z.z.enum(["single_loop","multi_loop"]),scopes:z.z.array(b).min(1,a.atLeastOneScope).max(20,a.scopesLimit),applyMode:z.z.enum(["proposal","safe_auto","plan"]).optional(),incremental:z.z.boolean().optional(),scopeOutputMode:z.z.enum(["preserve_scope","promote_scope"]).optional(),minTimestamp:R(a.timestampInvalid),maxTimestamp:R(a.timestampInvalid),maxSessions:P(100,a.maxSessionsRange),maxMessages:P(2e4,a.maxMessagesRange),maxMemories:P(5e3,a.maxMemoriesRange),expandedScopeLimit:P(1e3,a.expandedScopeLimitRange),instructions:z.z.string().optional().superRefine((b,c)=>{b&&new TextEncoder().encode(b).byteLength>4e3&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a.instructionsLimit})}),clientToken:z.z.string().optional(),thresholdAdd:Q(a.thresholdRange),thresholdUpdate:Q(a.thresholdRange),thresholdMerge:Q(a.thresholdRange)}).superRefine((b,c)=>{if(b.minTimestamp&&b.maxTimestamp){let d=Date.parse(b.minTimestamp),e=Date.parse(b.maxTimestamp);Number.isFinite(d)&&Number.isFinite(e)&&e<d&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a.timestampOrder,path:["maxTimestamp"]})}if("memory"!==b.taskType){"multi_loop"===b.executionMode&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a.taskTypeExecutionMode,path:["executionMode"]}),void 0!==b.applyMode&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a.executionModeCombination,path:["applyMode"]});return}void 0===b.applyMode||"single_loop"===b.executionMode&&"plan"===b.applyMode?c.addIssue({code:z.z.ZodIssueCode.custom,message:a.executionModeCombination,path:["applyMode"]}):"multi_loop"===b.executionMode&&"proposal"===b.applyMode&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a.executionModeCombination,path:["applyMode"]}),"multi_loop"===b.executionMode&&b.scopes.length>8&&c.addIssue({code:z.z.ZodIssueCode.custom,message:a.agenticScopesLimit,path:["scopes"]})})}function T(a){if(void 0===a||""===a.trim())return;let b=Number(a);if(Number.isFinite(b)&&Number.isInteger(b)&&!(b<0))return b}function U(a){if(!a)return;let b=Number(a);if(Number.isFinite(b))return b}function V(a){let{locale:c}=(0,M.useI18n)();return(0,b.jsx)(W,{...a},c)}function W({memoryStoreName:a,initialScope:e,open:f,onOpenChange:g}){let h,j=(0,d.useRouter)(),l=(h=(0,K.useQueryClient)(),(0,J.useMutation)({mutationFn:b=>(0,s.createDreamTask)(a,b),onSuccess:()=>{h.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes("dream-tasks")&&b.queryKey.includes(a)})}})),{t:n}=(0,M.useI18n)(),o=(0,x.useForm)({resolver:(0,y.zodResolver)(S({appIdRequired:n("memory.dream.appIdRequired"),atLeastOneNonWildcard:n("memory.dream.atLeastOneNonWildcard"),atLeastOneScope:n("memory.dream.atLeastOneScope"),scopesLimit:n("memory.dream.scopesLimit"),agenticScopesLimit:n("memory.dream.agenticScopesLimit"),executionModeCombination:n("memory.dream.executionModeCombination"),taskTypeExecutionMode:n("memory.dream.taskTypeExecutionMode"),instructionsLimit:n("memory.dream.instructionsLimit"),maxSessionsRange:n("memory.dream.maxSessionsRange"),maxMessagesRange:n("memory.dream.maxMessagesRange"),maxMemoriesRange:n("memory.dream.maxMemoriesRange"),expandedScopeLimitRange:n("memory.dream.expandedScopeLimitRange"),thresholdRange:n("memory.dream.thresholdRange"),timestampInvalid:n("memory.dream.timestampInvalid"),timestampOrder:n("memory.dream.timestampOrder")})),defaultValues:{taskType:"memory",scopes:[{appId:e?.appId&&"*"!==e.appId?e.appId:"",tenantId:e?.tenantId&&"*"!==e.tenantId?e.tenantId:"",agentId:e?.agentId&&"*"!==e.agentId?e.agentId:"",runId:e?.runId&&"*"!==e.runId?e.runId:""}],executionMode:"single_loop",applyMode:"proposal",incremental:!1}}),{fields:p,append:q,remove:r}=(0,x.useFieldArray)({control:o.control,name:"scopes"}),t=o.watch("taskType"),u="memory"===t,[v,w]=(0,c.useState)(!1),[z,N]=(0,c.useState)(!1),O=async b=>{try{let c,d,e,f,h,i=await l.mutateAsync((c={},d=U(b.thresholdAdd),e=U(b.thresholdUpdate),f=U(b.thresholdMerge),void 0!==d&&(c.add=d),void 0!==e&&(c.update=e),void 0!==f&&(c.merge=f),h="memory"===b.taskType,{scopes:b.scopes.map(a=>{let b={appId:a.appId};return a.tenantId&&(b.tenantId=a.tenantId),a.agentId&&(b.agentId=a.agentId),a.runId&&(b.runId=a.runId),b}),taskType:b.taskType,executionMode:b.executionMode,incremental:!!b.incremental,...h&&b.applyMode&&{applyMode:b.applyMode},...h&&b.scopeOutputMode&&{scopeOutputMode:b.scopeOutputMode},...b.minTimestamp&&{minTimestamp:Date.parse(b.minTimestamp)},...b.maxTimestamp&&{maxTimestamp:Date.parse(b.maxTimestamp)},...void 0!==T(b.maxSessions)&&{maxSessions:T(b.maxSessions)},...void 0!==T(b.maxMessages)&&{maxMessages:T(b.maxMessages)},...void 0!==T(b.maxMemories)&&{maxMemories:T(b.maxMemories)},...void 0!==T(b.expandedScopeLimit)&&{expandedScopeLimit:T(b.expandedScopeLimit)},...b.instructions&&{instructions:b.instructions},...b.clientToken&&{clientToken:b.clientToken},...h&&Object.keys(c).length>0&&{confidenceThresholds:c}})),k={memory:n("memory.dream.toastMemoryCreated"),skill:n("memory.dream.toastSkillCreated"),profile:n("memory.dream.toastProfileCreated")};A.toast.success(k[b.taskType]),g(!1),o.reset(),j.push(`/memory/${encodeURIComponent(a)}/dream/${encodeURIComponent(i.dreamId)}`)}catch(b){let a=b instanceof Error?b.message:n("memory.dream.createFailed");A.toast.error(a)}};return(0,b.jsx)(D.Dialog,{open:f,onOpenChange:g,children:(0,b.jsxs)(D.DialogContent,{className:"max-w-2xl",children:[(0,b.jsxs)(D.DialogHeader,{children:[(0,b.jsx)(D.DialogTitle,{children:n("memory.dream.createTitle")}),(0,b.jsx)(D.DialogDescription,{children:n("memory.dream.createDescription")})]}),(0,b.jsx)(I.Form,{...o,children:(0,b.jsxs)("form",{onSubmit:o.handleSubmit(O),className:"space-y-5",children:[(0,b.jsx)(I.FormField,{control:o.control,name:"taskType",render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{children:n("memory.dream.taskType")}),(0,b.jsxs)(m.Select,{onValueChange:b=>{a.onChange(b),"memory"===b?o.setValue("applyMode","proposal"):(o.setValue("executionMode","single_loop"),o.setValue("applyMode",void 0))},value:a.value,children:[(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(m.SelectTrigger,{children:(0,b.jsx)(m.SelectValue,{})})}),(0,b.jsxs)(m.SelectContent,{children:[(0,b.jsx)(m.SelectItem,{value:"memory",children:n("memory.dream.taskTypeMemory")}),(0,b.jsx)(m.SelectItem,{value:"skill",children:n("memory.dream.taskTypeSkill")}),(0,b.jsx)(m.SelectItem,{value:"profile",children:n("memory.dream.taskTypeProfile")})]})]}),(0,b.jsx)(I.FormMessage,{})]})}),(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(F.Label,{className:"text-sm font-medium",children:n("memory.common.scopeRange")}),(0,b.jsxs)(k.Button,{type:"button",size:"sm",variant:"ghost",onClick:()=>q({appId:"",tenantId:"",agentId:"",runId:""}),children:[(0,b.jsx)(i.Plus,{className:"mr-1 h-3.5 w-3.5"}),n("memory.dream.addScope")]})]}),(0,b.jsx)("div",{className:"space-y-3",children:p.map((c,d)=>(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-2 rounded-md border border-[hsl(var(--border-light))] p-3 sm:grid-cols-4",children:[(0,b.jsx)("div",{className:"sm:col-span-4 flex justify-end",children:(0,b.jsx)(L.ScopeCombobox,{memoryStoreName:a,placeholder:n("memory.dream.scopeFillFromExisting"),onPick:a=>{o.setValue(`scopes.${d}.appId`,a.appId??""),o.setValue(`scopes.${d}.tenantId`,a.tenantId??""),o.setValue(`scopes.${d}.agentId`,a.agentId??""),o.setValue(`scopes.${d}.runId`,a.runId??"")}})}),(0,b.jsx)(X,{name:`scopes.${d}.appId`,label:n("memory.scopeField.app"),form:o,required:!0}),(0,b.jsx)(X,{name:`scopes.${d}.tenantId`,label:n("memory.scopeField.tenant"),form:o}),(0,b.jsx)(X,{name:`scopes.${d}.agentId`,label:n("memory.scopeField.agent"),form:o}),(0,b.jsx)(X,{name:`scopes.${d}.runId`,label:n("memory.scopeField.run"),form:o}),p.length>1&&(0,b.jsx)("div",{className:"sm:col-span-4 flex justify-end",children:(0,b.jsxs)(k.Button,{type:"button",size:"sm",variant:"ghost",onClick:()=>r(d),className:"text-[hsl(var(--destructive))]",children:[(0,b.jsx)(B.Trash2,{className:"mr-1 h-3 w-3"}),n("common.delete")]})})]},c.id))})]}),(0,b.jsxs)("section",{className:"grid gap-3 sm:grid-cols-3",children:[(0,b.jsx)(I.FormField,{control:o.control,name:"executionMode",render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{children:n("memory.dream.executionMode")}),(0,b.jsxs)(m.Select,{onValueChange:b=>{a.onChange(b);let c=o.getValues("applyMode");"multi_loop"===b&&"proposal"===c&&o.setValue("applyMode","safe_auto"),"single_loop"===b&&"plan"===c&&o.setValue("applyMode","proposal")},value:a.value,children:[(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(m.SelectTrigger,{children:(0,b.jsx)(m.SelectValue,{})})}),(0,b.jsxs)(m.SelectContent,{children:[(0,b.jsx)(m.SelectItem,{value:"single_loop",children:n("memory.dream.executionModeSingle")}),u&&(0,b.jsx)(m.SelectItem,{value:"multi_loop",children:n("memory.dream.executionModeMulti")})]})]}),(0,b.jsx)(I.FormMessage,{})]})}),u&&(0,b.jsx)(I.FormField,{control:o.control,name:"applyMode",render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{children:n("memory.dream.applyMode")}),(0,b.jsxs)(m.Select,{onValueChange:b=>{a.onChange(b),"plan"===b?o.setValue("executionMode","multi_loop"):"proposal"===b&&"multi_loop"===o.getValues("executionMode")&&o.setValue("executionMode","single_loop")},value:a.value??"proposal",children:[(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(m.SelectTrigger,{children:(0,b.jsx)(m.SelectValue,{})})}),(0,b.jsxs)(m.SelectContent,{children:[(0,b.jsx)(m.SelectItem,{value:"proposal",children:n("memory.dream.applyModeProposalOption")}),(0,b.jsx)(m.SelectItem,{value:"safe_auto",children:n("memory.dream.applyModeSafeAutoOption")}),(0,b.jsx)(m.SelectItem,{value:"plan",children:n("memory.dream.applyModePlanOption")})]})]}),(0,b.jsx)(I.FormMessage,{})]})}),u&&(0,b.jsx)(I.FormField,{control:o.control,name:"scopeOutputMode",render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{children:n("memory.dream.scopeOutputMode")}),(0,b.jsxs)(m.Select,{onValueChange:a.onChange,value:a.value??"",children:[(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(m.SelectTrigger,{children:(0,b.jsx)(m.SelectValue,{placeholder:n("memory.dream.scopeOutputModePlaceholder")})})}),(0,b.jsxs)(m.SelectContent,{children:[(0,b.jsx)(m.SelectItem,{value:"preserve_scope",children:n("memory.dream.preserveScope")}),(0,b.jsx)(m.SelectItem,{value:"promote_scope",children:n("memory.dream.promoteScope")})]})]}),(0,b.jsx)(I.FormMessage,{})]})})]}),(0,b.jsx)(I.FormField,{control:o.control,name:"instructions",render:({field:a})=>{let c={memory:n("memory.dream.instructionsPlaceholderMemory"),skill:n("memory.dream.instructionsPlaceholderSkill"),profile:n("memory.dream.instructionsPlaceholderProfile")};return(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{children:n("memory.dream.instructionsLabel")}),(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(G.Textarea,{rows:2,placeholder:c[t],...a})}),(0,b.jsx)(I.FormMessage,{})]})}}),u&&(0,b.jsxs)(H.Collapsible,{open:z,onOpenChange:N,children:[(0,b.jsx)(H.CollapsibleTrigger,{asChild:!0,children:(0,b.jsxs)(k.Button,{type:"button",variant:"ghost",size:"sm",className:"px-0",children:[z?"▾":"▸"," ",n("memory.dream.thresholds")]})}),(0,b.jsxs)(H.CollapsibleContent,{className:"grid gap-3 pt-2 sm:grid-cols-3",children:[(0,b.jsx)(Y,{name:"thresholdAdd",label:n("memory.dream.thresholdAdd"),form:o,placeholder:"0.7"}),(0,b.jsx)(Y,{name:"thresholdUpdate",label:n("memory.dream.thresholdUpdate"),form:o,placeholder:"0.6"}),(0,b.jsx)(Y,{name:"thresholdMerge",label:n("memory.dream.thresholdMerge"),form:o,placeholder:"0.6"})]})]}),(0,b.jsxs)(H.Collapsible,{open:v,onOpenChange:w,children:[(0,b.jsx)(H.CollapsibleTrigger,{asChild:!0,children:(0,b.jsxs)(k.Button,{type:"button",variant:"ghost",size:"sm",className:"px-0",children:[v?"▾":"▸"," ",n("memory.dream.advanced")]})}),(0,b.jsxs)(H.CollapsibleContent,{className:"grid gap-3 pt-2 sm:grid-cols-2",children:[(0,b.jsx)(Y,{name:"maxSessions",label:n("memory.dream.maxSessions"),form:o}),(0,b.jsx)(Y,{name:"maxMessages",label:n("memory.dream.maxMessages"),form:o}),(0,b.jsx)(Y,{name:"maxMemories",label:n("memory.dream.maxMemories"),form:o}),(0,b.jsx)(Y,{name:"expandedScopeLimit",label:n("memory.dream.expandedScopeLimit"),form:o}),(0,b.jsx)(Z,{name:"minTimestamp",label:n("memory.dream.minTimestamp"),form:o}),(0,b.jsx)(Z,{name:"maxTimestamp",label:n("memory.dream.maxTimestamp"),form:o}),(0,b.jsx)(I.FormField,{control:o.control,name:"clientToken",render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{children:n("memory.dream.idempotentToken")}),(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(E.Input,{placeholder:n("memory.dream.optional"),...a})})]})}),(0,b.jsx)(I.FormField,{control:o.control,name:"incremental",render:({field:a})=>(0,b.jsxs)(I.FormItem,{className:"flex items-center gap-2 pt-5",children:[(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(C.Checkbox,{checked:!!a.value,onCheckedChange:b=>a.onChange(!0===b)})}),(0,b.jsx)(I.FormLabel,{className:"text-xs",children:n("memory.dream.incremental")}),(0,b.jsx)(I.FormMessage,{})]})})]})]}),(0,b.jsxs)(D.DialogFooter,{children:[(0,b.jsx)(k.Button,{type:"button",variant:"outline",onClick:()=>g(!1),children:n("common.cancel")}),(0,b.jsx)(k.Button,{type:"submit",disabled:l.isPending,children:l.isPending?n("common.creating"):n("memory.dream.createTask")})]})]})})]})})}function X({name:a,label:c,form:d,required:e}){return(0,b.jsx)(I.FormField,{control:d.control,name:a,render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsxs)(I.FormLabel,{className:"text-xs",children:[c,e&&(0,b.jsx)("span",{className:"ml-0.5 text-[hsl(var(--destructive))]",children:"*"})]}),(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(E.Input,{className:"h-8 text-sm",...a,value:a.value??""})}),(0,b.jsx)(I.FormMessage,{})]})})}function Y({name:a,label:c,form:d,placeholder:e}){return(0,b.jsx)(I.FormField,{control:d.control,name:a,render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{className:"text-xs",children:c}),(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(E.Input,{type:"number",className:"h-8 text-sm",placeholder:e,...a,value:"string"==typeof a.value?a.value:""})}),(0,b.jsx)(I.FormMessage,{})]})})}function Z({name:a,label:c,form:d}){return(0,b.jsx)(I.FormField,{control:d.control,name:a,render:({field:a})=>(0,b.jsxs)(I.FormItem,{children:[(0,b.jsx)(I.FormLabel,{className:"text-xs",children:c}),(0,b.jsx)(I.FormControl,{children:(0,b.jsx)(E.Input,{type:"datetime-local",className:"h-8 text-sm",...a,value:"string"==typeof a.value?a.value:""})}),(0,b.jsx)(I.FormMessage,{})]})})}O(N),S(N);var $=a.i(364565);let _={queued:"bg-info-soft text-info",running:"bg-info-soft text-info",planning:"bg-info-soft text-info",awaiting_plan_approval:"bg-warning-soft text-warning",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"},aa={queued:"memory.dreamStatus.queued",running:"memory.dreamStatus.running",planning:"memory.dreamStatus.planning",awaiting_plan_approval:"memory.dreamStatus.awaitingPlanApproval",applying:"memory.dreamStatus.applying",completed:"memory.dreamStatus.completed",completed_with_failures:"memory.dreamStatus.completedWithFailures",failed:"memory.dreamStatus.failed",cancelled:"memory.dreamStatus.cancelled"},ab={memory:"memory.dreamType.consolidate",skill:"memory.dreamType.skill",profile:"memory.dreamType.profile"},ac={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))]"},ad=new Set(["completed","completed_with_failures","failed","cancelled"]);function ae({status:a,t:c}){let d=!ad.has(a),e=aa[a];return(0,b.jsxs)("span",{className:(0,$.cn)("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium select-none whitespace-nowrap",_[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]})}a.s(["default",0,function(){let{t:a}=(0,M.useI18n)(),x=[{value:"time_desc",label:a("memory.dream.sortTimeDesc")},{value:"time_asc",label:a("memory.dream.sortTimeAsc")},{value:"scope",label:a("memory.dream.sortScope")}],y=[{value:"all",label:a("memory.dream.allStatus")},{value:"queued",label:a("memory.dreamStatus.queued")},{value:"running",label:a("memory.dreamStatus.running")},{value:"planning",label:a("memory.dreamStatus.planning")},{value:"awaiting_plan_approval",label:a("memory.dreamStatus.awaitingPlanApproval")},{value:"applying",label:a("memory.dreamStatus.applying")},{value:"completed",label:a("memory.dreamStatus.completed")},{value:"completed_with_failures",label:a("memory.dreamStatus.completedWithFailures")},{value:"failed",label:a("memory.dreamStatus.failed")},{value:"cancelled",label:a("memory.dreamStatus.cancelled")}],z=decodeURIComponent((0,d.useParams)().store),A=(0,d.useRouter)(),B=(0,d.useSearchParams)().toString(),C=(0,c.useMemo)(()=>(0,v.buildMemoryScope)(new URLSearchParams(B)),[B]),[D,E]=(0,c.useState)("all"),[F,G]=(0,c.useState)("time_desc"),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(new Set),L=function(a,b,d){let{context:e,ready:f}=(0,u.useRuntimeContext)(),g=d?.limit??50,h={status:d?.status,minTimestamp:d?.minTimestamp,maxTimestamp:d?.maxTimestamp},i=(0,r.useInfiniteQuery)({queryKey:t.queryKeys.dreamTasks(e.dataScopeKey,a,b,void 0,g,h),queryFn:({pageParam:c})=>(0,s.listDreamTasks)(a,b,{limit:g,nextToken:"string"==typeof c?c:void 0,status:h.status,minTimestamp:h.minTimestamp,maxTimestamp:h.maxTimestamp}),getNextPageParam:a=>a.nextToken??void 0,initialPageParam:void 0,enabled:f&&!!a&&!!b?.appId}),j=(i.data?.pages?.length??0)>=25;(0,c.useEffect)(()=>{!i.hasNextPage||i.isFetchingNextPage||j||i.fetchNextPage()},[i.hasNextPage,i.isFetchingNextPage,j,i]);let k=(i.data?.pages??[]).flatMap(a=>a.items??[]),l=i.error&&"code"in i.error?i.error.code??null:null;return{tasks:k,isLoading:i.isLoading,isRefetching:i.isRefetching,isFetchingNextPage:i.isFetchingNextPage,hasNextPage:!!i.hasNextPage,truncated:!!i.hasNextPage&&j,fetchNextPage:()=>{i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},refetch:()=>{i.refetch()},error:i.error??null,errorCode:l}}(z,C,{limit:50,status:"all"===D?void 0:D});if("DREAMING_DISABLED"===L.errorCode)return(0,b.jsx)(w.MemoryDreamDisabled,{});let N=L.tasks,O=(0,v.sortDreamTasksByCreatedAt)(N,"time_asc"===F?"asc":"desc"),P=(0,v.groupDreamTasksByScope)(N),Q="scope"===F&&P.length>1,R=c=>{let d,e=new Date(c.createdAt).getTime();return(0,b.jsxs)(n.TableRow,{className:"cursor-pointer hover:bg-[hsl(var(--accent))]",onClick:()=>A.push(`/memory/${encodeURIComponent(z)}/dream/${encodeURIComponent(c.dreamId)}`),children:[(0,b.jsx)(n.TableCell,{className:"max-w-[220px] truncate font-mono text-xs",children:c.dreamId}),(0,b.jsx)(n.TableCell,{children:(d=c.taskType||"memory",(0,b.jsx)("span",{className:(0,$.cn)("inline-flex rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap",ac[d]??"bg-muted text-muted-foreground"),children:ab[d]?a(ab[d]):d}))}),(0,b.jsx)(n.TableCell,{children:(0,b.jsx)(ae,{status:c.status,t:a})}),(0,b.jsx)(n.TableCell,{className:"text-xs",children:c.taskType&&"memory"!==c.taskType?(0,b.jsx)("span",{className:"text-muted-foreground",children:"—"}):(0,b.jsxs)(b.Fragment,{children:["safe_auto"===c.applyMode?a("memory.dream.applyModeAuto"):"plan"===c.applyMode?a("memory.dream.applyModePlan"):a("memory.dream.applyModeProposal"),c.executionMode&&(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["· ",c.executionMode]}),"promote_scope"===c.scopeOutputMode&&(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["· ",a("memory.dream.promoted")]})]})}),(0,b.jsxs)(n.TableCell,{className:"text-right text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:c.actionCount??0}),c.taskType&&"memory"!==c.taskType?(0,b.jsxs)("span",{className:"ml-1",children:[a("memory.dream.outputItems"),(c.failedCount??0)>0&&(0,b.jsx)("span",{className:"text-danger",children:a("memory.dream.outputFailed",{count:c.failedCount??0})})]}):(0,b.jsx)("span",{className:"ml-1",children:a("memory.dream.outputBreakdown",{proposed:c.proposedCount??0,applied:c.appliedCount??0,skipped:c.skippedCount??0,failed:c.failedCount??0})})]}),(0,b.jsx)(n.TableCell,{className:"text-xs text-muted-foreground",children:Number.isFinite(e)?(0,b.jsx)(q.RelativeTime,{timestamp:e}):c.createdAt})]},c.dreamId)};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:a("memory.dream.title")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("memory.dream.description")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(m.Select,{value:F,onValueChange:a=>G(a),children:[(0,b.jsx)(m.SelectTrigger,{className:"h-8 w-36 text-sm",children:(0,b.jsx)(m.SelectValue,{})}),(0,b.jsx)(m.SelectContent,{children:x.map(a=>(0,b.jsx)(m.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsxs)(m.Select,{value:D,onValueChange:E,children:[(0,b.jsx)(m.SelectTrigger,{className:"h-8 w-40 text-sm",children:(0,b.jsx)(m.SelectValue,{})}),(0,b.jsx)(m.SelectContent,{children:y.map(a=>(0,b.jsx)(m.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsx)(o.RefreshButton,{onClick:()=>L.refetch(),loading:L.isRefetching}),(0,b.jsxs)(k.Button,{size:"sm",onClick:()=>I(!0),children:[(0,b.jsx)(i.Plus,{className:"mr-1 h-3.5 w-3.5"}),a("memory.dream.newTask")]})]})]}),L.isLoading?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(l.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(l.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(l.Skeleton,{className:"h-10 w-full"})]}):0===N.length?(0,b.jsx)(p.EmptyState,{icon:j.Sparkles,title:a("memory.dream.emptyTitle"),description:"all"===D?a("memory.dream.emptyAll"):a("memory.dream.emptyFiltered",{status:y.find(a=>a.value===D)?.label??D}),action:(0,b.jsxs)(k.Button,{onClick:()=>I(!0),children:[(0,b.jsx)(i.Plus,{className:"mr-1 h-3.5 w-3.5"}),a("memory.dream.newTask")]})}):(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--border))]",children:(0,b.jsxs)(n.Table,{children:[(0,b.jsx)(n.TableHeader,{children:(0,b.jsxs)(n.TableRow,{children:[(0,b.jsx)(n.TableHead,{children:a("memory.dream.tableId")}),(0,b.jsx)(n.TableHead,{children:a("memory.dream.tableType")}),(0,b.jsx)(n.TableHead,{children:a("memory.dream.tableStatus")}),(0,b.jsx)(n.TableHead,{children:a("memory.dream.tableApplyMode")}),(0,b.jsx)(n.TableHead,{className:"text-right",children:a("memory.dream.tableOutput")}),(0,b.jsx)(n.TableHead,{"aria-sort":"time_desc"===F?"descending":"time_asc"===F?"ascending":"none",children:"scope"===F?(0,b.jsx)("span",{children:a("memory.dream.tableCreatedAt")}):(0,b.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 cursor-pointer select-none",onClick:()=>G(a=>"time_desc"===a?"time_asc":"time_desc"),children:[a("memory.dream.tableCreatedAt"),"time_desc"===F&&(0,b.jsx)(e.ArrowDown,{"aria-hidden":"true",className:"h-3 w-3 text-muted-foreground"}),"time_asc"===F&&(0,b.jsx)(f,{"aria-hidden":"true",className:"h-3 w-3 text-muted-foreground"})]})})]})}),(0,b.jsx)(n.TableBody,{children:Q?P.map(d=>{let e=J.has(d.key);return(0,b.jsxs)(c.Fragment,{children:[(0,b.jsx)(n.TableRow,{className:"cursor-pointer select-none bg-muted/40 hover:bg-muted/60",onClick:()=>{var a;return a=d.key,void K(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},children:(0,b.jsx)(n.TableCell,{colSpan:6,className:"py-2",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[e?(0,b.jsx)(h.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,b.jsx)(g.ChevronDown,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"break-all font-mono text-xs font-medium text-foreground",children:d.label}),(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] text-muted-foreground",children:a("memory.dream.groupTaskCount",{count:d.tasks.length})})]})})}),!e&&d.tasks.map(R)]},d.key)}):O.map(R)})]})}),L.isFetchingNextPage&&(0,b.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:a("memory.dream.loadingMore")}),L.truncated&&!L.isFetchingNextPage&&(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:a("memory.dream.truncatedHint")}),(0,b.jsx)(k.Button,{variant:"outline",size:"sm",onClick:()=>L.fetchNextPage(),children:a("memory.dream.continueLoad")})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("memory.dream.currentScope",{scope:C&&[C.appId,C.tenantId,C.agentId,C.runId].filter(Boolean).join(" / ")||"-"}),"scope"===F?Q?a("memory.dream.groupedHint"):a("memory.dream.singleScopeHint"):a("memory.dream.sortedHint",{dir:"time_asc"===F?a("memory.dream.dirAsc"):a("memory.dream.dirDesc")})]}),(0,b.jsx)(V,{memoryStoreName:z,initialScope:C,open:H,onOpenChange:I})]})}],696627)}];
1
+ module.exports=[696627,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(310410);let f=(0,a.i(750053).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var g=a.i(201927),h=a.i(907704),i=a.i(25825),j=a.i(1078),k=a.i(776192),l=a.i(69088),m=a.i(604395),n=a.i(663525),o=a.i(223301),p=a.i(887617),q=a.i(310215),r=a.i(865271),s=a.i(149086),t=a.i(421347),u=a.i(225377),v=a.i(739096),w=a.i(908264),x=a.i(601170),y=a.i(71562),z=a.i(771071),A=a.i(680904),B=a.i(263265),C=a.i(869045),D=a.i(655295),E=a.i(36890),F=a.i(843836),G=a.i(172518),H=a.i(962491),I=a.i(470535),J=a.i(434841),K=a.i(27692),L=a.i(692942),M=a.i(933596),N=a.i(895487),O=a.i(140613),P=a.i(543320);let Q=[{value:"proposal",forcedEffort:"low"},{value:"safe_auto",forcedEffort:void 0},{value:"plan",forcedEffort:"high"}];function R(a){return Q.find(b=>b.value===a)?.forcedEffort}var S=a.i(364565);let T={appIdRequired:"appId 必填",atLeastOneNonWildcard:"至少指定一个非通配符字段",atLeastOneScope:"至少一个 scope",scopesLimit:"scope 最多 20 个",highEffortScopesLimit:"高 effort Dream scope 最多 8 个",effortCombination:"effort 与应用模式组合无效",taskTypeExactScope:"技能与画像任务必须且只能使用一个无通配符的精确 scope",instructionsLimit:"指令不能超过 4000 字节(UTF-8)",maxSessionsRange:"最大会话数必须是 0 到 100 之间的整数",maxMessagesRange:"最大消息数必须是 0 到 20000 之间的整数",maxMemoriesRange:"最大记忆数必须是 0 到 5000 之间的整数",expandedScopeLimitRange:"展开 scope 上限必须是 0 到 1000 之间的整数",thresholdRange:"置信度阈值必须在 0 到 1 之间",timestampInvalid:"时间格式不正确",timestampOrder:"最晚时间不能早于最早时间"};function U(a){return A.z.object({appId:A.z.string().trim().min(1,a.appIdRequired),tenantId:A.z.string().trim().optional(),agentId:A.z.string().trim().optional(),runId:A.z.string().trim().optional()}).refine(a=>Object.values(a).some(a=>a&&"*"!==a),{message:a.atLeastOneNonWildcard,path:["appId"]})}function V(a,b){return A.z.string().trim().optional().superRefine((c,d)=>{if(!c)return;let e=Number(c);(!Number.isInteger(e)||e<0||e>a)&&d.addIssue({code:A.z.ZodIssueCode.custom,message:b})})}function W(a){return A.z.string().trim().optional().superRefine((b,c)=>{if(!b)return;let d=Number(b);(!Number.isFinite(d)||d<0||d>1)&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a})})}function X(a){return A.z.string().trim().optional().superRefine((b,c)=>{b&&!Number.isFinite(Date.parse(b))&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a})})}function Y(a){let b=U(a);return A.z.object({taskType:A.z.enum(["memory","skill","profile"]),effort:A.z.enum(["low","high"]),scopes:A.z.array(b).min(1,a.atLeastOneScope).max(20,a.scopesLimit),applyMode:A.z.enum(["proposal","safe_auto","plan"]).optional(),incremental:A.z.boolean().optional(),scopeOutputMode:A.z.enum(["preserve_scope","promote_scope"]).optional(),minTimestamp:X(a.timestampInvalid),maxTimestamp:X(a.timestampInvalid),maxSessions:V(100,a.maxSessionsRange),maxMessages:V(2e4,a.maxMessagesRange),maxMemories:V(5e3,a.maxMemoriesRange),expandedScopeLimit:V(1e3,a.expandedScopeLimitRange),instructions:A.z.string().optional().superRefine((b,c)=>{b&&new TextEncoder().encode(b).byteLength>4e3&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a.instructionsLimit})}),clientToken:A.z.string().optional(),thresholdAdd:W(a.thresholdRange),thresholdUpdate:W(a.thresholdRange),thresholdMerge:W(a.thresholdRange)}).superRefine((b,c)=>{if(b.minTimestamp&&b.maxTimestamp){let d=Date.parse(b.minTimestamp),e=Date.parse(b.maxTimestamp);Number.isFinite(d)&&Number.isFinite(e)&&e<d&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a.timestampOrder,path:["maxTimestamp"]})}if("memory"!==b.taskType){"high"===b.effort&&(1!==b.scopes.length||b.scopes.some(a=>[a.appId,a.tenantId,a.agentId,a.runId].some(a=>!a||"*"===a)))&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a.taskTypeExactScope,path:["scopes"]}),void 0!==b.applyMode&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a.effortCombination,path:["applyMode"]});return}void 0===b.applyMode||"low"===b.effort&&"plan"===b.applyMode?c.addIssue({code:A.z.ZodIssueCode.custom,message:a.effortCombination,path:["applyMode"]}):"high"===b.effort&&"proposal"===b.applyMode&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a.effortCombination,path:["applyMode"]}),"high"===b.effort&&b.scopes.length>8&&c.addIssue({code:A.z.ZodIssueCode.custom,message:a.highEffortScopesLimit,path:["scopes"]})})}U(T),Y(T);let Z=["low","high"],$={proposal:{title:"memory.dream.applyModeRequestApproval",summary:"memory.dream.applyModeRequestApprovalSummary",help:"memory.dream.applyModeRequestApprovalHelp"},safe_auto:{title:"memory.dream.applyModeHelpMeApprove",summary:"memory.dream.applyModeHelpMeApproveSummary",help:"memory.dream.applyModeHelpMeApproveHelp"},plan:{title:"memory.dream.applyModePlanMode",summary:"memory.dream.applyModePlanModeSummary",help:"memory.dream.applyModePlanModeHelp"}};function _({value:a,effort:c,onChange:d,t:e}){return(0,b.jsx)(J.TooltipProvider,{delayDuration:150,children:(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-3",role:"radiogroup","aria-label":e("memory.dream.applyMode"),children:Q.map(f=>{let g=$[f.value],h=a===f.value;return(0,b.jsxs)("div",{className:(0,S.cn)("flex min-h-28 rounded-lg border bg-card transition-colors",h?"border-primary bg-primary-soft ring-1 ring-primary/20":"border-border hover:border-primary/40 hover:bg-muted/30"),children:[(0,b.jsxs)("button",{type:"button",role:"radio","aria-checked":h,className:"min-w-0 flex-1 rounded-l-lg p-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",onClick:()=>{var a;let b=(a=f.value,{applyMode:a,effort:R(a)??c});d(b.applyMode,b.effort)},children:[(0,b.jsx)("span",{className:"block text-sm font-semibold",children:e(g.title)}),(0,b.jsx)("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:e(g.summary)})]}),(0,b.jsxs)(J.Tooltip,{children:[(0,b.jsx)(J.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:"m-2 h-7 w-7 shrink-0 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary","aria-label":e("memory.dream.applyModeHelpLabel",{mode:e(g.title)}),children:(0,b.jsx)(C.HelpCircle,{className:"mx-auto h-4 w-4"})})}),(0,b.jsx)(J.TooltipContent,{className:"max-w-72 leading-5",side:"top",children:e(g.help)})]})]},f.value)})})})}let aa=[{value:"preserve_scope",title:"memory.dream.preserveScope",summary:"memory.dream.preserveScopeSummary"},{value:"promote_scope",title:"memory.dream.promoteScope",summary:"memory.dream.promoteScopeSummary"}];function ab({value:a,onChange:c,t:d}){return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",role:"radiogroup","aria-label":d("memory.dream.scopeOutputMode"),children:aa.map(e=>{let f=a===e.value;return(0,b.jsxs)("button",{type:"button",role:"radio","aria-checked":f,className:(0,S.cn)("rounded-lg border p-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",f?"border-primary bg-primary-soft ring-1 ring-primary/20":"border-border hover:border-primary/40 hover:bg-muted/30"),onClick:()=>c(e.value),children:[(0,b.jsx)("span",{className:"block text-sm font-semibold",children:d(e.title)}),(0,b.jsx)("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:d(e.summary)})]},e.value)})}),"promote_scope"===a?(0,b.jsx)("p",{className:"rounded-md bg-muted/40 px-3 py-2 text-xs text-muted-foreground",children:d("memory.dream.promoteScopeHint")}):null]})}function ac(a){if(void 0===a||""===a.trim())return;let b=Number(a);if(Number.isFinite(b)&&Number.isInteger(b)&&!(b<0))return b}function ad(a){if(!a)return;let b=Number(a);if(Number.isFinite(b))return b}function ae(a){let{locale:c}=(0,P.useI18n)();return(0,b.jsx)(af,{...a},c)}function af({memoryStoreName:a,initialScope:e,open:f,onOpenChange:g}){let h,j=(0,d.useRouter)(),l=(h=(0,N.useQueryClient)(),(0,M.useMutation)({mutationFn:b=>(0,t.createDreamTask)(a,b),onSuccess:()=>{h.invalidateQueries({queryKey:["memory"],predicate:b=>Array.isArray(b.queryKey)&&b.queryKey.includes("dream-tasks")&&b.queryKey.includes(a)})}})),{t:m}=(0,P.useI18n)(),o=(0,y.useForm)({resolver:(0,z.zodResolver)(Y({appIdRequired:m("memory.dream.appIdRequired"),atLeastOneNonWildcard:m("memory.dream.atLeastOneNonWildcard"),atLeastOneScope:m("memory.dream.atLeastOneScope"),scopesLimit:m("memory.dream.scopesLimit"),highEffortScopesLimit:m("memory.dream.highEffortScopesLimit"),effortCombination:m("memory.dream.effortCombination"),taskTypeExactScope:m("memory.dream.taskTypeExactScope"),instructionsLimit:m("memory.dream.instructionsLimit"),maxSessionsRange:m("memory.dream.maxSessionsRange"),maxMessagesRange:m("memory.dream.maxMessagesRange"),maxMemoriesRange:m("memory.dream.maxMemoriesRange"),expandedScopeLimitRange:m("memory.dream.expandedScopeLimitRange"),thresholdRange:m("memory.dream.thresholdRange"),timestampInvalid:m("memory.dream.timestampInvalid"),timestampOrder:m("memory.dream.timestampOrder")})),defaultValues:{taskType:"memory",scopes:[{appId:e?.appId&&"*"!==e.appId?e.appId:"",tenantId:e?.tenantId&&"*"!==e.tenantId?e.tenantId:"",agentId:e?.agentId&&"*"!==e.agentId?e.agentId:"",runId:e?.runId&&"*"!==e.runId?e.runId:""}],effort:"low",applyMode:"proposal",scopeOutputMode:"preserve_scope",incremental:!1}}),{fields:p,append:q,remove:r}=(0,y.useFieldArray)({control:o.control,name:"scopes"}),s=o.watch("taskType"),u=o.watch("effort"),v=R(o.watch("applyMode")??"proposal"),w="memory"===s,[x,A]=(0,c.useState)(!1),[C,J]=(0,c.useState)(!1),Q=async b=>{try{let c,d,e,f,h,i=await l.mutateAsync((c={},d=ad(b.thresholdAdd),e=ad(b.thresholdUpdate),f=ad(b.thresholdMerge),void 0!==d&&(c.add=d),void 0!==e&&(c.update=e),void 0!==f&&(c.merge=f),h="memory"===b.taskType,{scopes:b.scopes.map(a=>{let b={appId:a.appId};return a.tenantId&&(b.tenantId=a.tenantId),a.agentId&&(b.agentId=a.agentId),a.runId&&(b.runId=a.runId),b}),taskType:b.taskType,effort:b.effort,incremental:!!b.incremental,...h&&b.applyMode&&{applyMode:b.applyMode},...h&&b.scopeOutputMode&&{scopeOutputMode:b.scopeOutputMode},...b.minTimestamp&&{minTimestamp:Date.parse(b.minTimestamp)},...b.maxTimestamp&&{maxTimestamp:Date.parse(b.maxTimestamp)},...void 0!==ac(b.maxSessions)&&{maxSessions:ac(b.maxSessions)},...void 0!==ac(b.maxMessages)&&{maxMessages:ac(b.maxMessages)},...void 0!==ac(b.maxMemories)&&{maxMemories:ac(b.maxMemories)},...void 0!==ac(b.expandedScopeLimit)&&{expandedScopeLimit:ac(b.expandedScopeLimit)},...b.instructions&&{instructions:b.instructions},...b.clientToken&&{clientToken:b.clientToken},...h&&Object.keys(c).length>0&&{confidenceThresholds:c}})),k={memory:m("memory.dream.toastMemoryCreated"),skill:m("memory.dream.toastSkillCreated"),profile:m("memory.dream.toastProfileCreated")};B.toast.success(k[b.taskType]),g(!1),o.reset(),j.push(`/memory/${encodeURIComponent(a)}/dream/${encodeURIComponent(i.dreamId)}`)}catch(b){let a=b instanceof Error?b.message:m("memory.dream.createFailed");B.toast.error(a)}};return(0,b.jsx)(F.Dialog,{open:f,onOpenChange:g,children:(0,b.jsxs)(F.DialogContent,{className:"max-w-2xl",children:[(0,b.jsxs)(F.DialogHeader,{children:[(0,b.jsx)(F.DialogTitle,{children:m("memory.dream.createTitle")}),(0,b.jsx)(F.DialogDescription,{children:m("memory.dream.createDescription")})]}),(0,b.jsx)(L.Form,{...o,children:(0,b.jsxs)("form",{onSubmit:o.handleSubmit(Q),className:"space-y-5",children:[(0,b.jsx)(L.FormField,{control:o.control,name:"taskType",render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{children:m("memory.dream.taskType")}),(0,b.jsxs)(n.Select,{onValueChange:b=>{var c;a.onChange(b);let d=(c={effort:o.getValues("effort"),applyMode:o.getValues("applyMode"),scopeOutputMode:o.getValues("scopeOutputMode"),thresholdAdd:o.getValues("thresholdAdd"),thresholdUpdate:o.getValues("thresholdUpdate"),thresholdMerge:o.getValues("thresholdMerge"),scopes:o.getValues("scopes")},"memory"===b?{...c,applyMode:c.applyMode??("high"===c.effort?"safe_auto":"proposal"),scopeOutputMode:c.scopeOutputMode??"preserve_scope"}:{...c,applyMode:void 0,scopeOutputMode:void 0,thresholdAdd:void 0,thresholdUpdate:void 0,thresholdMerge:void 0,scopes:"high"===c.effort?c.scopes.slice(0,1):c.scopes});o.setValue("effort",d.effort),o.setValue("applyMode",d.applyMode),o.setValue("scopeOutputMode",d.scopeOutputMode),o.setValue("thresholdAdd",d.thresholdAdd),o.setValue("thresholdUpdate",d.thresholdUpdate),o.setValue("thresholdMerge",d.thresholdMerge),o.setValue("scopes",d.scopes)},value:a.value,children:[(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(n.SelectTrigger,{children:(0,b.jsx)(n.SelectValue,{})})}),(0,b.jsxs)(n.SelectContent,{children:[(0,b.jsx)(n.SelectItem,{value:"memory",children:m("memory.dream.taskTypeMemory")}),(0,b.jsx)(n.SelectItem,{value:"skill",children:m("memory.dream.taskTypeSkill")}),(0,b.jsx)(n.SelectItem,{value:"profile",children:m("memory.dream.taskTypeProfile")})]})]}),(0,b.jsx)(L.FormMessage,{})]})}),(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(H.Label,{className:"text-sm font-medium",children:m("memory.common.scopeRange")}),(w||"low"===u)&&(0,b.jsxs)(k.Button,{type:"button",size:"sm",variant:"ghost",onClick:()=>q({appId:"",tenantId:"",agentId:"",runId:""}),children:[(0,b.jsx)(i.Plus,{className:"mr-1 h-3.5 w-3.5"}),m("memory.dream.addScope")]})]}),(0,b.jsx)("div",{className:"space-y-3",children:p.map((c,d)=>(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-2 rounded-md border border-[hsl(var(--border-light))] p-3 sm:grid-cols-4",children:[(0,b.jsx)("div",{className:"sm:col-span-4 flex justify-end",children:(0,b.jsx)(O.ScopeCombobox,{memoryStoreName:a,placeholder:m("memory.dream.scopeFillFromExisting"),onPick:a=>{o.setValue(`scopes.${d}.appId`,a.appId??""),o.setValue(`scopes.${d}.tenantId`,a.tenantId??""),o.setValue(`scopes.${d}.agentId`,a.agentId??""),o.setValue(`scopes.${d}.runId`,a.runId??"")}})}),(0,b.jsx)(ag,{name:`scopes.${d}.appId`,label:m("memory.scopeField.app"),form:o,required:!0}),(0,b.jsx)(ag,{name:`scopes.${d}.tenantId`,label:m("memory.scopeField.tenant"),form:o}),(0,b.jsx)(ag,{name:`scopes.${d}.agentId`,label:m("memory.scopeField.agent"),form:o}),(0,b.jsx)(ag,{name:`scopes.${d}.runId`,label:m("memory.scopeField.run"),form:o}),p.length>1&&(0,b.jsx)("div",{className:"sm:col-span-4 flex justify-end",children:(0,b.jsxs)(k.Button,{type:"button",size:"sm",variant:"ghost",onClick:()=>r(d),className:"text-[hsl(var(--destructive))]",children:[(0,b.jsx)(D.Trash2,{className:"mr-1 h-3 w-3"}),m("common.delete")]})})]},c.id))})]}),w?(0,b.jsx)(L.FormField,{control:o.control,name:"applyMode",render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{children:m("memory.dream.applyMode")}),(0,b.jsx)(_,{value:a.value??"proposal",effort:u,t:m,onChange:(b,c)=>{a.onChange(b),o.setValue("effort",c,{shouldValidate:!0})}}),(0,b.jsx)(L.FormMessage,{})]})}):null,(0,b.jsx)("section",{className:"grid gap-3 sm:grid-cols-2",children:(0,b.jsx)(L.FormField,{control:o.control,name:"effort",render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{children:m("memory.dream.effort")}),(0,b.jsxs)(n.Select,{onValueChange:b=>{a.onChange(b),w||"high"!==b||o.setValue("scopes",o.getValues("scopes").slice(0,1))},value:a.value,disabled:w&&void 0!==v,children:[(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(n.SelectTrigger,{children:(0,b.jsx)(n.SelectValue,{})})}),(0,b.jsx)(n.SelectContent,{children:Z.map(a=>(0,b.jsx)(n.SelectItem,{value:a,children:"low"===a?m("memory.dream.effortLow"):m("memory.dream.effortHigh")},a))})]}),w&&v?(0,b.jsx)(L.FormDescription,{children:m("low"===v?"memory.dream.effortLockedLow":"memory.dream.effortLockedHigh")}):null,(0,b.jsx)(L.FormMessage,{})]})})}),w?(0,b.jsx)(L.FormField,{control:o.control,name:"scopeOutputMode",render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{children:m("memory.dream.scopeOutputMode")}),(0,b.jsx)(ab,{value:a.value??"preserve_scope",onChange:a.onChange,t:m}),(0,b.jsx)(L.FormMessage,{})]})}):null,(0,b.jsx)(L.FormField,{control:o.control,name:"instructions",render:({field:a})=>{let c={memory:m("memory.dream.instructionsPlaceholderMemory"),skill:m("memory.dream.instructionsPlaceholderSkill"),profile:m("memory.dream.instructionsPlaceholderProfile")};return(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{children:m("memory.dream.instructionsLabel")}),(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(I.Textarea,{rows:2,placeholder:c[s],...a})}),(0,b.jsx)(L.FormMessage,{})]})}}),w&&(0,b.jsxs)(K.Collapsible,{open:C,onOpenChange:J,children:[(0,b.jsx)(K.CollapsibleTrigger,{asChild:!0,children:(0,b.jsxs)(k.Button,{type:"button",variant:"ghost",size:"sm",className:"px-0",children:[C?"▾":"▸"," ",m("memory.dream.thresholds")]})}),(0,b.jsxs)(K.CollapsibleContent,{className:"grid gap-3 pt-2 sm:grid-cols-3",children:[(0,b.jsx)(ah,{name:"thresholdAdd",label:m("memory.dream.thresholdAdd"),form:o,placeholder:"0.7"}),(0,b.jsx)(ah,{name:"thresholdUpdate",label:m("memory.dream.thresholdUpdate"),form:o,placeholder:"0.6"}),(0,b.jsx)(ah,{name:"thresholdMerge",label:m("memory.dream.thresholdMerge"),form:o,placeholder:"0.6"})]})]}),(0,b.jsxs)(K.Collapsible,{open:x,onOpenChange:A,children:[(0,b.jsx)(K.CollapsibleTrigger,{asChild:!0,children:(0,b.jsxs)(k.Button,{type:"button",variant:"ghost",size:"sm",className:"px-0",children:[x?"▾":"▸"," ",m("memory.dream.advanced")]})}),(0,b.jsxs)(K.CollapsibleContent,{className:"grid gap-3 pt-2 sm:grid-cols-2",children:[(0,b.jsx)(ah,{name:"maxSessions",label:m("memory.dream.maxSessions"),form:o}),(0,b.jsx)(ah,{name:"maxMessages",label:m("memory.dream.maxMessages"),form:o}),(0,b.jsx)(ah,{name:"maxMemories",label:m("memory.dream.maxMemories"),form:o}),(0,b.jsx)(ah,{name:"expandedScopeLimit",label:m("memory.dream.expandedScopeLimit"),form:o}),(0,b.jsx)(ai,{name:"minTimestamp",label:m("memory.dream.minTimestamp"),form:o}),(0,b.jsx)(ai,{name:"maxTimestamp",label:m("memory.dream.maxTimestamp"),form:o}),(0,b.jsx)(L.FormField,{control:o.control,name:"clientToken",render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{children:m("memory.dream.idempotentToken")}),(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(G.Input,{placeholder:m("memory.dream.optional"),...a})})]})}),(0,b.jsx)(L.FormField,{control:o.control,name:"incremental",render:({field:a})=>(0,b.jsxs)(L.FormItem,{className:"flex items-center gap-2 pt-5",children:[(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(E.Checkbox,{checked:!!a.value,onCheckedChange:b=>a.onChange(!0===b)})}),(0,b.jsx)(L.FormLabel,{className:"text-xs",children:m("memory.dream.incremental")}),(0,b.jsx)(L.FormMessage,{})]})})]})]}),(0,b.jsxs)(F.DialogFooter,{children:[(0,b.jsx)(k.Button,{type:"button",variant:"outline",onClick:()=>g(!1),children:m("common.cancel")}),(0,b.jsx)(k.Button,{type:"submit",disabled:l.isPending,children:l.isPending?m("common.creating"):m("memory.dream.createTask")})]})]})})]})})}function ag({name:a,label:c,form:d,required:e}){return(0,b.jsx)(L.FormField,{control:d.control,name:a,render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsxs)(L.FormLabel,{className:"text-xs",children:[c,e&&(0,b.jsx)("span",{className:"ml-0.5 text-[hsl(var(--destructive))]",children:"*"})]}),(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(G.Input,{className:"h-8 text-sm",...a,value:a.value??""})}),(0,b.jsx)(L.FormMessage,{})]})})}function ah({name:a,label:c,form:d,placeholder:e}){return(0,b.jsx)(L.FormField,{control:d.control,name:a,render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{className:"text-xs",children:c}),(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(G.Input,{type:"number",className:"h-8 text-sm",placeholder:e,...a,value:"string"==typeof a.value?a.value:""})}),(0,b.jsx)(L.FormMessage,{})]})})}function ai({name:a,label:c,form:d}){return(0,b.jsx)(L.FormField,{control:d.control,name:a,render:({field:a})=>(0,b.jsxs)(L.FormItem,{children:[(0,b.jsx)(L.FormLabel,{className:"text-xs",children:c}),(0,b.jsx)(L.FormControl,{children:(0,b.jsx)(G.Input,{type:"datetime-local",className:"h-8 text-sm",...a,value:"string"==typeof a.value?a.value:""})}),(0,b.jsx)(L.FormMessage,{})]})})}let aj={queued:"bg-info-soft text-info",running:"bg-info-soft text-info",planning:"bg-info-soft text-info",awaiting_plan_approval:"bg-warning-soft text-warning",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"},ak={queued:"memory.dreamStatus.queued",running:"memory.dreamStatus.running",planning:"memory.dreamStatus.planning",awaiting_plan_approval:"memory.dreamStatus.awaitingPlanApproval",applying:"memory.dreamStatus.applying",completed:"memory.dreamStatus.completed",completed_with_failures:"memory.dreamStatus.completedWithFailures",failed:"memory.dreamStatus.failed",cancelled:"memory.dreamStatus.cancelled"},al={memory:"memory.dreamType.consolidate",skill:"memory.dreamType.skill",profile:"memory.dreamType.profile"},am={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))]"},an=new Set(["completed","completed_with_failures","failed","cancelled"]);function ao({status:a,t:c}){let d=!an.has(a),e=ak[a];return(0,b.jsxs)("span",{className:(0,S.cn)("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium select-none whitespace-nowrap",aj[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]})}a.s(["default",0,function(){let{t:a}=(0,P.useI18n)(),y=[{value:"time_desc",label:a("memory.dream.sortTimeDesc")},{value:"time_asc",label:a("memory.dream.sortTimeAsc")},{value:"scope",label:a("memory.dream.sortScope")}],z=[{value:"all",label:a("memory.dream.allStatus")},{value:"queued",label:a("memory.dreamStatus.queued")},{value:"running",label:a("memory.dreamStatus.running")},{value:"planning",label:a("memory.dreamStatus.planning")},{value:"awaiting_plan_approval",label:a("memory.dreamStatus.awaitingPlanApproval")},{value:"applying",label:a("memory.dreamStatus.applying")},{value:"completed",label:a("memory.dreamStatus.completed")},{value:"completed_with_failures",label:a("memory.dreamStatus.completedWithFailures")},{value:"failed",label:a("memory.dreamStatus.failed")},{value:"cancelled",label:a("memory.dreamStatus.cancelled")}],A=decodeURIComponent((0,d.useParams)().store),B=(0,d.useRouter)(),C=(0,d.useSearchParams)().toString(),D=(0,c.useMemo)(()=>(0,w.buildMemoryScope)(new URLSearchParams(C)),[C]),[E,F]=(0,c.useState)("all"),[G,H]=(0,c.useState)("time_desc"),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(new Set),M=function(a,b,d){let{context:e,ready:f}=(0,v.useRuntimeContext)(),g=d?.limit??50,h={status:d?.status,minTimestamp:d?.minTimestamp,maxTimestamp:d?.maxTimestamp},i=(0,s.useInfiniteQuery)({queryKey:u.queryKeys.dreamTasks(e.dataScopeKey,a,b,void 0,g,h),queryFn:({pageParam:c})=>(0,t.listDreamTasks)(a,b,{limit:g,nextToken:"string"==typeof c?c:void 0,status:h.status,minTimestamp:h.minTimestamp,maxTimestamp:h.maxTimestamp}),getNextPageParam:a=>a.nextToken??void 0,initialPageParam:void 0,enabled:f&&!!a&&!!b?.appId}),j=(i.data?.pages?.length??0)>=25;(0,c.useEffect)(()=>{!i.hasNextPage||i.isFetchingNextPage||j||i.fetchNextPage()},[i.hasNextPage,i.isFetchingNextPage,j,i]);let k=(i.data?.pages??[]).flatMap(a=>a.items??[]),l=i.error&&"code"in i.error?i.error.code??null:null;return{tasks:k,isLoading:i.isLoading,isRefetching:i.isRefetching,isFetchingNextPage:i.isFetchingNextPage,hasNextPage:!!i.hasNextPage,truncated:!!i.hasNextPage&&j,fetchNextPage:()=>{i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},refetch:()=>{i.refetch()},error:i.error??null,errorCode:l}}(A,D,{limit:50,status:"all"===E?void 0:E});if("DREAMING_DISABLED"===M.errorCode)return(0,b.jsx)(x.MemoryDreamDisabled,{});let N=M.tasks,O=(0,w.sortDreamTasksByCreatedAt)(N,"time_asc"===G?"asc":"desc"),Q=(0,w.groupDreamTasksByScope)(N),R="scope"===G&&Q.length>1,T=c=>{let d,e=new Date(c.createdAt).getTime();return(0,b.jsxs)(o.TableRow,{className:"cursor-pointer hover:bg-[hsl(var(--accent))]",onClick:()=>B.push(`/memory/${encodeURIComponent(A)}/dream/${encodeURIComponent(c.dreamId)}`),children:[(0,b.jsx)(o.TableCell,{className:"max-w-[240px]",children:(0,b.jsx)(l.CopyableId,{value:c.dreamId,label:""})}),(0,b.jsx)(o.TableCell,{children:(d=c.taskType||"memory",(0,b.jsx)("span",{className:(0,S.cn)("inline-flex rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap",am[d]??"bg-muted text-muted-foreground"),children:al[d]?a(al[d]):d}))}),(0,b.jsx)(o.TableCell,{children:(0,b.jsx)(ao,{status:c.status,t:a})}),(0,b.jsx)(o.TableCell,{className:"text-xs",children:c.taskType&&"memory"!==c.taskType?(0,b.jsx)("span",{className:"text-muted-foreground",children:a("memory.dream.effortDetail",{value:c.effort})}):(0,b.jsxs)(b.Fragment,{children:["safe_auto"===c.applyMode?a("memory.dream.applyModeAuto"):"plan"===c.applyMode?a("memory.dream.applyModePlan"):a("memory.dream.applyModeProposal"),(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["· ",a("memory.dream.effortDetail",{value:c.effort})]}),"promote_scope"===c.scopeOutputMode&&(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["· ",a("memory.dream.promoted")]})]})}),(0,b.jsxs)(o.TableCell,{className:"text-right text-xs text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium text-foreground",children:c.actionCount??0}),c.taskType&&"memory"!==c.taskType?(0,b.jsxs)("span",{className:"ml-1",children:[a("memory.dream.outputItems"),(c.failedCount??0)>0&&(0,b.jsx)("span",{className:"text-danger",children:a("memory.dream.outputFailed",{count:c.failedCount??0})})]}):(0,b.jsx)("span",{className:"ml-1",children:a("memory.dream.outputBreakdown",{proposed:c.proposedCount??0,applied:c.appliedCount??0,skipped:c.skippedCount??0,failed:c.failedCount??0})})]}),(0,b.jsx)(o.TableCell,{className:"text-xs text-muted-foreground",children:Number.isFinite(e)?(0,b.jsx)(r.RelativeTime,{timestamp:e}):c.createdAt})]},c.dreamId)};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:a("memory.dream.title")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("memory.dream.description")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(n.Select,{value:G,onValueChange:a=>H(a),children:[(0,b.jsx)(n.SelectTrigger,{className:"h-8 w-36 text-sm",children:(0,b.jsx)(n.SelectValue,{})}),(0,b.jsx)(n.SelectContent,{children:y.map(a=>(0,b.jsx)(n.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsxs)(n.Select,{value:E,onValueChange:F,children:[(0,b.jsx)(n.SelectTrigger,{className:"h-8 w-40 text-sm",children:(0,b.jsx)(n.SelectValue,{})}),(0,b.jsx)(n.SelectContent,{children:z.map(a=>(0,b.jsx)(n.SelectItem,{value:a.value,children:a.label},a.value))})]}),(0,b.jsx)(p.RefreshButton,{onClick:()=>M.refetch(),loading:M.isRefetching}),(0,b.jsxs)(k.Button,{size:"sm",onClick:()=>J(!0),children:[(0,b.jsx)(i.Plus,{className:"mr-1 h-3.5 w-3.5"}),a("memory.dream.newTask")]})]})]}),M.isLoading?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(m.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(m.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(m.Skeleton,{className:"h-10 w-full"})]}):0===N.length?(0,b.jsx)(q.EmptyState,{icon:j.Sparkles,title:a("memory.dream.emptyTitle"),description:"all"===E?a("memory.dream.emptyAll"):a("memory.dream.emptyFiltered",{status:z.find(a=>a.value===E)?.label??E}),action:(0,b.jsxs)(k.Button,{onClick:()=>J(!0),children:[(0,b.jsx)(i.Plus,{className:"mr-1 h-3.5 w-3.5"}),a("memory.dream.newTask")]})}):(0,b.jsx)("div",{className:"rounded-lg border border-[hsl(var(--border))]",children:(0,b.jsxs)(o.Table,{children:[(0,b.jsx)(o.TableHeader,{children:(0,b.jsxs)(o.TableRow,{children:[(0,b.jsx)(o.TableHead,{children:a("memory.dream.tableId")}),(0,b.jsx)(o.TableHead,{children:a("memory.dream.tableType")}),(0,b.jsx)(o.TableHead,{children:a("memory.dream.tableStatus")}),(0,b.jsx)(o.TableHead,{children:a("memory.dream.tableApplyMode")}),(0,b.jsx)(o.TableHead,{className:"text-right",children:a("memory.dream.tableOutput")}),(0,b.jsx)(o.TableHead,{"aria-sort":"time_desc"===G?"descending":"time_asc"===G?"ascending":"none",children:"scope"===G?(0,b.jsx)("span",{children:a("memory.dream.tableCreatedAt")}):(0,b.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 cursor-pointer select-none",onClick:()=>H(a=>"time_desc"===a?"time_asc":"time_desc"),children:[a("memory.dream.tableCreatedAt"),"time_desc"===G&&(0,b.jsx)(e.ArrowDown,{"aria-hidden":"true",className:"h-3 w-3 text-muted-foreground"}),"time_asc"===G&&(0,b.jsx)(f,{"aria-hidden":"true",className:"h-3 w-3 text-muted-foreground"})]})})]})}),(0,b.jsx)(o.TableBody,{children:R?Q.map(d=>{let e=K.has(d.key);return(0,b.jsxs)(c.Fragment,{children:[(0,b.jsx)(o.TableRow,{className:"cursor-pointer select-none bg-muted/40 hover:bg-muted/60",onClick:()=>{var a;return a=d.key,void L(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},children:(0,b.jsx)(o.TableCell,{colSpan:6,className:"py-2",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[e?(0,b.jsx)(h.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,b.jsx)(g.ChevronDown,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"break-all font-mono text-xs font-medium text-foreground",children:d.label}),(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] text-muted-foreground",children:a("memory.dream.groupTaskCount",{count:d.tasks.length})})]})})}),!e&&d.tasks.map(T)]},d.key)}):O.map(T)})]})}),M.isFetchingNextPage&&(0,b.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:a("memory.dream.loadingMore")}),M.truncated&&!M.isFetchingNextPage&&(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:a("memory.dream.truncatedHint")}),(0,b.jsx)(k.Button,{variant:"outline",size:"sm",onClick:()=>M.fetchNextPage(),children:a("memory.dream.continueLoad")})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("memory.dream.currentScope",{scope:D&&[D.appId,D.tenantId,D.agentId,D.runId].filter(Boolean).join(" / ")||"-"}),"scope"===G?R?a("memory.dream.groupedHint"):a("memory.dream.singleScopeHint"):a("memory.dream.sortedHint",{dir:"time_asc"===G?a("memory.dream.dirAsc"):a("memory.dream.dirDesc")})]}),(0,b.jsx)(ae,{memoryStoreName:A,initialScope:D,open:I,onOpenChange:J})]})}],696627)}];
2
2
 
3
3
  //# sourceMappingURL=dashboard_src_app_%28dashboard%29_memory_%5Bstore%5D_dream_page_tsx_0uzzpvs._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[598680,a=>{"use strict";var b=a.i(634020),c=a.i(880470),d=a.i(971938),e=a.i(147845),f=a.i(123028),g=a.i(7766),h=a.i(96193),i=a.i(401605),j=a.i(688189),k=a.i(696844),l=a.i(160318),m=a.i(624215),n=a.i(1078),o=a.i(655295),p=a.i(604395),q=a.i(224666),r=a.i(99443),s=a.i(411697),t=a.i(98791),u=a.i(53520),v=a.i(201927),w=a.i(225896),x=a.i(882725),y=a.i(616106),z=a.i(310581),A=a.i(776192),B=a.i(473524),C=a.i(455553),D=a.i(172518),E=a.i(962491),F=a.i(84252),G=a.i(908264);let H=["tenantId","agentId","runId"];function I(a,b){return`tsagent.memoryScopes.v1:${JSON.stringify([a,b])}`}function J(a){return!!a&&"string"==typeof a.appId&&"*"===a.appId.trim()&&H.every(b=>{let c=a[b];if(void 0===c)return!0;if("string"!=typeof c)return!1;let d=c.trim();return!d||"*"===d})}function K(a){if(!a||"string"!=typeof a.appId||!a.appId.trim())return null;let b={appId:a.appId.trim()};for(let c of H){let d=a[c];"string"==typeof d&&d.trim()&&(b[c]=d.trim())}return J(b)?null:b}function L(a){return JSON.stringify([a.appId,a.tenantId??"",a.agentId??"",a.runId??""])}function M(a,b,c){try{let d=a.getItem(I(b,c));if(!d)return[];let e=JSON.parse(d);if(!Array.isArray(e))return[];let f=new Set,g=[];for(let a of e){let b=a&&"object"==typeof a?a:null;if(J(b))continue;let c=K(b);if(!c)continue;let d=L(c);if(!f.has(d)&&(f.add(d),g.push(c),10===g.length))break}return g}catch{return[]}}var N=a.i(539972),O=a.i(364565),P=a.i(543320),Q=a.i(739096);let R=[{key:"appId",labelKey:"app",placeholderKey:"appPlaceholder"},{key:"tenantId",labelKey:"tenant",placeholderKey:"tenantPlaceholder"},{key:"agentId",labelKey:"agent",placeholderKey:"agentPlaceholder"},{key:"runId",labelKey:"run",placeholderKey:"runPlaceholder"}],S={appId:"*",tenantId:"*",agentId:"*",runId:"*"},T=[],U={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function V(){try{return window.localStorage}catch{return U}}function W(a){return JSON.stringify([a.appId,a.tenantId??"",a.agentId??"",a.runId??""])}function X(a,b){return W(a)===W(b)}function Y({allowScopeDiscovery:a=!0}){let{t:e}=(0,P.useI18n)(),f=R.map(a=>({key:a.key,label:e(`memory.scopeField.${a.labelKey}`),placeholder:e(`memory.scopeBar.${a.placeholderKey}`)})),g=(0,c.useRouter)(),h=(0,c.usePathname)(),i=(0,c.useSearchParams)(),j=(0,Q.useDataScopeKey)(),k=i.toString(),l=(0,d.useMemo)(()=>(0,G.buildMemoryScope)(new URLSearchParams(k)),[k]),[m,n]=(0,d.useState)(!1),[o,p]=(0,d.useState)(l),[q,r]=(0,d.useState)(null),[s,t]=(0,d.useState)(!1),u=h.split("/").filter(Boolean)[1],x=a&&u?JSON.stringify([j,u]):null,[C,F]=(0,d.useState)({scopeId:x,scopes:[]}),H=C.scopeId===x?C.scopes:T,O=(0,G.hasWildcardScope)(l);(0,d.useEffect)(()=>{x&&u?F({scopeId:x,scopes:M(V(),j,u)}):F({scopeId:x,scopes:[]})},[j,x,u]),(0,d.useEffect)(()=>{!u||h.includes("/create")||new URLSearchParams(k).get("appId")||g.replace(`${h}?appId=*&tenantId=*&agentId=*&runId=*`)},[k,h,g,u]),(0,d.useEffect)(()=>{p(a=>X(a,l)?a:l),r(null)},[l]);let U=(0,N.useAllMemoryStoreScopes)(u??"",S,{enabled:a}),W=U.data?.items??T,$=(0,d.useMemo)(()=>{let a;return a=new Set(H.map(K).filter(a=>null!==a).map(L)),W.filter(b=>{let c=K(b);return!c||!a.has(L(c))})},[W,H]),_=U.data?.truncated??!1,aa=J(l);function ab(a){let b,c=(b=(a.appId??"").trim())?{appId:b,tenantId:(a.tenantId??"").trim()||void 0,agentId:(a.agentId??"").trim()||void 0,runId:(a.runId??"").trim()||void 0}:null;if(!c)return r(e("memory.scopeBar.appRequired")),!1;r(null);let d=(0,G.scopeToSearchParams)(c);return x&&u&&F({scopeId:x,scopes:function(a,b,c,d){let e=M(a,b,c);if(J(d))return e;let f=K(d);if(!f)return e;let g=L(f),h=[f,...e.filter(a=>L(a)!==g)].slice(0,10);try{a.setItem(I(b,c),JSON.stringify(h))}catch{}return h}(V(),j,u,c)}),g.replace(`${h}?${d.toString()}`),!0}function ac(a){ab(a)&&(p(a),t(!1),n(!1))}return(0,b.jsx)(B.Card,{className:"border-dashed",children:(0,b.jsxs)(B.CardContent,{className:"p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,b.jsx)(z.Settings2,{className:"h-4 w-4 text-muted-foreground"}),f.map(({key:a,label:c})=>(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:c}),(0,b.jsx)("span",{className:"rounded-md bg-[hsl(var(--muted))] px-2.5 py-1 text-xs font-mono text-[hsl(var(--foreground))]",children:l[a]??"—"})]},a))]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[O&&(0,b.jsx)("span",{className:"rounded-md bg-amber-50 px-2 py-1 text-xs text-amber-700 dark:bg-amber-950 dark:text-amber-300",children:e("memory.scopeBar.readOnly")}),a?(0,b.jsx)(Z,{open:s,onOpenChange:t,currentScope:l,recentScopes:H,knownScopes:$,isLoading:U.isLoading,isError:U.isError,isFetching:U.isFetching,truncated:_,isWildcardSelected:aa,onPickWildcard:()=>ac(S),onPickScope:ac,onClearRecent:function(){if(x&&u){var a=V();try{a.removeItem(I(j,u))}catch{}F({scopeId:x,scopes:[]})}},onRefresh:()=>U.refetch(),t:e}):null,(0,b.jsxs)(A.Button,{variant:"outline",size:"sm",onClick:()=>n(!m),children:[m?(0,b.jsx)(w.ChevronUp,{className:"mr-1 h-3.5 w-3.5"}):(0,b.jsx)(v.ChevronDown,{className:"mr-1 h-3.5 w-3.5"}),e("memory.scopeBar.manualEdit")]})]})]}),m&&(0,b.jsxs)("div",{className:"mt-4 space-y-4 border-t pt-4",children:[(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:f.map(({key:a,label:c,placeholder:d})=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)(E.Label,{htmlFor:`scope-${a}`,className:"text-xs",children:[c,"appId"===a&&(0,b.jsx)("span",{className:"ml-0.5 text-[hsl(var(--destructive))]",children:"*"})]}),(0,b.jsx)(D.Input,{id:`scope-${a}`,value:o[a]??"",placeholder:d,onChange:b=>{var c;return c=b.target.value,void("appId"===a?p(a=>({...a,appId:c})):p(b=>({...b,[a]:c||void 0})))},className:"h-8 text-sm"})]},a))}),(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[q?(0,b.jsx)("p",{className:"text-xs text-[hsl(var(--destructive))]",children:q}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e("memory.scopeBar.writeHint")}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(A.Button,{variant:"outline",size:"sm",onClick:function(){p(S),r(null),g.replace(`${h}?appId=*&tenantId=*&agentId=*&runId=*`)},children:[(0,b.jsx)(y.RotateCcw,{className:"mr-1 h-3 w-3"}),e("memory.scopeBar.reset")]}),(0,b.jsx)(A.Button,{size:"sm",onClick:function(){ab(o)&&n(!1)},children:e("memory.scopeBar.apply")})]})]})]})]})})}function Z({open:a,onOpenChange:c,currentScope:e,recentScopes:f,knownScopes:g,isLoading:h,isError:i,isFetching:j,truncated:k,isWildcardSelected:l,onPickWildcard:m,onPickScope:n,onClearRecent:o,onRefresh:p,t:q}){let r=l?q("memory.common.allData"):(0,G.scopeLabel)(e),s=(0,d.useRef)(null);return(0,b.jsxs)(F.Popover,{open:a,onOpenChange:c,children:[(0,b.jsx)(F.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)(A.Button,{variant:"outline",size:"sm",className:"h-8 min-w-[200px] justify-between font-mono text-xs",children:[(0,b.jsx)("span",{className:"truncate",children:r}),(0,b.jsx)(x.ChevronsUpDown,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-60"})]})}),(0,b.jsx)(F.PopoverContent,{align:"end",className:"w-[420px] p-0",children:(0,b.jsxs)(C.Command,{shouldFilter:!0,children:[(0,b.jsx)(C.CommandInput,{ref:s,placeholder:q("memory.common.searchScopePlaceholder"),className:"text-xs"}),(0,b.jsxs)(C.CommandList,{className:"max-h-[360px]",children:[(0,b.jsx)(C.CommandEmpty,{children:q(h?"common.loading":i?"memory.scopeCombobox.loadFailed":"memory.common.noMatchingScope")}),(0,b.jsx)(C.CommandGroup,{heading:q("memory.common.presets"),children:(0,b.jsxs)(C.CommandItem,{value:"* wildcard 全部数据",onSelect:m,className:"text-xs",children:[(0,b.jsx)(u.Check,{className:(0,O.cn)("mr-2 h-3.5 w-3.5",l?"opacity-100":"opacity-0")}),(0,b.jsx)("span",{className:"font-mono",children:q("memory.common.allDataWildcard")})]})}),f.length>0&&(0,b.jsx)(C.CommandGroup,{heading:q("memory.common.recentScopes",{count:f.length}),children:f.map(a=>{let c=(0,G.scopeLabel)(a),d=W(a),f=X(a,e);return(0,b.jsxs)(C.CommandItem,{value:`recent ${d} ${c}`,onSelect:()=>n(a),className:"text-xs",children:[(0,b.jsx)(u.Check,{className:(0,O.cn)("mr-2 h-3.5 w-3.5",f?"opacity-100":"opacity-0")}),(0,b.jsx)("span",{className:"truncate font-mono",children:c})]},`recent-${d}`)})}),g.length>0&&(0,b.jsx)(C.CommandGroup,{heading:q(k?"memory.common.knownScopesTruncated":"memory.common.knownScopes",{count:g.length}),children:g.map(a=>{let c=(0,G.scopeLabel)(a),d=W(a),f=X(a,e);return(0,b.jsxs)(C.CommandItem,{value:`known ${d} ${c}`,onSelect:()=>n(a),className:"text-xs",children:[(0,b.jsx)(u.Check,{className:(0,O.cn)("mr-2 h-3.5 w-3.5",f?"opacity-100":"opacity-0")}),(0,b.jsx)("span",{className:"font-mono truncate",children:c})]},`known-${d}`)})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-t border-[hsl(var(--border-light))] px-2 py-1.5 text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{children:h?q("memory.common.querying"):i?q("memory.scopeCombobox.loadFailed"):q(k?"memory.common.scopeCountTruncated":"memory.common.scopeCount",{count:g.length})}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[f.length>0&&(0,b.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),s.current?.focus(),o()},className:"h-6 rounded px-1.5 py-0.5 hover:bg-[hsl(var(--accent))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.3)]",children:q("memory.common.clearRecentScopes")}),(0,b.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),p()},disabled:j,className:"h-6 rounded px-1.5 py-0.5 hover:bg-[hsl(var(--accent))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.3)] disabled:opacity-50",children:q("common.refresh")})]})]})]})})]})}var $=a.i(285540);function _(){return(0,b.jsxs)(r.DetailSidebar,{children:[(0,b.jsxs)("div",{className:"space-y-3 px-4 pt-4 pb-4 border-b border-[hsl(var(--border-light))]",children:[(0,b.jsx)(p.Skeleton,{className:"h-9 w-9 rounded-lg"}),(0,b.jsx)(p.Skeleton,{className:"h-4 w-3/4"}),(0,b.jsx)(p.Skeleton,{className:"h-3 w-1/2"})]}),(0,b.jsxs)("div",{className:"space-y-1 px-2 py-2",children:[(0,b.jsx)(p.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(p.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(p.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(p.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(p.Skeleton,{className:"h-8 w-full"})]})]})}a.s(["default",0,function({children:a}){let{t:u}=(0,P.useI18n)(),v=[{label:u("memory.detail.tabUnits"),segment:"units",icon:(0,b.jsx)(f.Database,{className:"h-4 w-4"})},{label:u("memory.detail.tabSearch"),segment:"search",icon:(0,b.jsx)(l.Search,{className:"h-4 w-4"})},{label:u("memory.detail.tabMessages"),segment:"messages",icon:(0,b.jsx)(j.MessageSquare,{className:"h-4 w-4"})},{label:u("memory.detail.tabTasks"),segment:"tasks",icon:(0,b.jsx)(i.ListChecks,{className:"h-4 w-4"})},{label:u("memory.detail.tabRequests"),segment:"requests",icon:(0,b.jsx)(g.FileClock,{className:"h-4 w-4"})},{label:u("memory.detail.tabDream"),segment:"dream",icon:(0,b.jsx)(n.Sparkles,{className:"h-4 w-4"})},{label:u("memory.detail.tabSettings"),segment:"settings",icon:(0,b.jsx)(m.Settings,{className:"h-4 w-4"})}],w=decodeURIComponent((0,c.useParams)().store),x=(0,c.usePathname)(),y=(0,c.useRouter)(),z=(0,c.useSearchParams)(),{data:A,isLoading:B}=(0,s.useMemoryStore)(w),[C,D]=(0,d.useState)(!1),E=z.toString()?`?${z.toString()}`:"",F=`/memory/${encodeURIComponent(w)}`,G=x.slice(F.length).split("/").filter(Boolean)[0]??"units",H=(0,$.storageModeCapabilities)(A?.storageMode),I=(0,$.resolveMemoryDetailSegment)(A?.storageMode,G),J=!!(A&&!H.structured&&G!==I);if((0,d.useEffect)(()=>{J&&y.replace(`${F}/${I}${E}`)},[F,E,I,y,J]),B)return(0,b.jsx)(r.DetailLayout,{sidebar:(0,b.jsx)(_,{}),children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(p.Skeleton,{className:"h-10 w-64"}),(0,b.jsx)(p.Skeleton,{className:"h-28 w-full"}),(0,b.jsx)(p.Skeleton,{className:"h-64 w-full"})]})});if(!A)return(0,b.jsx)(r.DetailLayout,{sidebar:(0,b.jsx)(_,{}),children:(0,b.jsx)("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:u("memory.common.notFoundOrDeleted")})});if(J)return null;let K=H.detailSegments.map(a=>H.structured||"units"!==a?v.find(b=>b.segment===a)??{label:u("memory.detail.tabFiles"),segment:"units",icon:(0,b.jsx)(h.FolderTree,{className:"h-4 w-4"})}:{label:u("memory.detail.tabFiles"),segment:"units",icon:(0,b.jsx)(h.FolderTree,{className:"h-4 w-4"})}).map(a=>({href:`${F}/${a.segment}${E}`,label:a.label,icon:a.icon}));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.DetailLayout,{sidebar:(0,b.jsxs)(r.DetailSidebar,{children:[(0,b.jsx)(r.DetailSidebarHeader,{icon:(0,b.jsx)(e.Brain,{}),accent:"purple",name:A.memoryStoreName,typeLabel:u("memory.detail.typeLabel"),description:A.description,actions:(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button","aria-label":u("memory.detail.moreActions"),className:"flex h-7 w-7 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--background))] hover:text-[hsl(var(--foreground))]",children:(0,b.jsx)(k.MoreVertical,{className:"h-4 w-4"})})}),(0,b.jsx)(q.DropdownMenuContent,{align:"end",children:(0,b.jsxs)(q.DropdownMenuItem,{onSelect:a=>{a.preventDefault(),D(!0)},className:"text-[hsl(var(--destructive))] focus:bg-[hsl(var(--danger-soft))] focus:text-[hsl(var(--destructive))] hover:bg-[hsl(var(--danger-soft))] hover:text-[hsl(var(--destructive))]",children:[(0,b.jsx)(o.Trash2,{className:"h-3.5 w-3.5"}),u("memory.detail.deleteStore")]})})]})}),(0,b.jsx)(r.DetailSidebarMenu,{items:K}),(0,b.jsx)(r.DetailSidebarBack,{href:"/memory",label:u("memory.detail.backToList")})]}),children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(Y,{allowScopeDiscovery:H.structured}),(0,b.jsx)("div",{children:a})]})}),(0,b.jsx)(t.MemoryDeleteDialog,{memoryStoreName:w,open:C,onOpenChange:D,redirectToList:!0})]})}],598680)}];
1
+ module.exports=[598680,a=>{"use strict";var b=a.i(634020),c=a.i(880470),d=a.i(971938),e=a.i(342210),f=a.i(147845),g=a.i(123028),h=a.i(7766),i=a.i(96193);let j=(0,a.i(750053).default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var k=a.i(401605),l=a.i(688189),m=a.i(696844),n=a.i(160318),o=a.i(624215),p=a.i(1078),q=a.i(655295),r=a.i(604395),s=a.i(224666),t=a.i(99443),u=a.i(411697),v=a.i(98791),w=a.i(412583),x=a.i(53520),y=a.i(201927),z=a.i(907704),A=a.i(225896),B=a.i(882725),C=a.i(616106),D=a.i(310581),E=a.i(776192),F=a.i(473524),G=a.i(455553),H=a.i(172518),I=a.i(962491),J=a.i(84252),K=a.i(908264);let L=["tenantId","agentId","runId"];function M(a,b){return`tsagent.memoryScopes.v1:${JSON.stringify([a,b])}`}function N(a){return!!a&&"string"==typeof a.appId&&"*"===a.appId.trim()&&L.every(b=>{let c=a[b];if(void 0===c)return!0;if("string"!=typeof c)return!1;let d=c.trim();return!d||"*"===d})}function O(a){if(!a||"string"!=typeof a.appId||!a.appId.trim())return null;let b={appId:a.appId.trim()};for(let c of L){let d=a[c];"string"==typeof d&&d.trim()&&(b[c]=d.trim())}return N(b)?null:b}function P(a){return JSON.stringify([a.appId,a.tenantId??"",a.agentId??"",a.runId??""])}function Q(a,b,c){try{let d=a.getItem(M(b,c));if(!d)return[];let e=JSON.parse(d);if(!Array.isArray(e))return[];let f=new Set,g=[];for(let a of e){let b=a&&"object"==typeof a?a:null;if(N(b))continue;let c=O(b);if(!c)continue;let d=P(c);if(!f.has(d)&&(f.add(d),g.push(c),10===g.length))break}return g}catch{return[]}}var R=a.i(539972),S=a.i(364565),T=a.i(870307),U=a.i(543320),V=a.i(739096),W=a.i(789662),X=a.i(619812);let Y=[{key:"appId",labelKey:"app",placeholderKey:"appPlaceholder"},{key:"tenantId",labelKey:"tenant",placeholderKey:"tenantPlaceholder"},{key:"agentId",labelKey:"agent",placeholderKey:"agentPlaceholder"},{key:"runId",labelKey:"run",placeholderKey:"runPlaceholder"}],Z={appId:"*",tenantId:"*",agentId:"*",runId:"*"},$=[],_={app:"memory.scopeHierarchy.allApps",tenant:"memory.scopeHierarchy.allTenants",agent:"memory.scopeHierarchy.allAgents",run:"memory.scopeHierarchy.allRuns"},aa={all:"memory.scopeHierarchy.allRange",app:"memory.scopeHierarchy.appRange",tenant:"memory.scopeHierarchy.tenantRange",agent:"memory.scopeHierarchy.agentRange",run:"memory.scopeHierarchy.runRange"},ab={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function ac(){try{return window.localStorage}catch{return ab}}function ad(a){return JSON.stringify([a.appId,a.tenantId??"",a.agentId??"",a.runId??""])}function ae({allowScopeDiscovery:a=!0}){let{t:e}=(0,U.useI18n)(),f=Y.map(a=>({key:a.key,label:e(`memory.scopeField.${a.labelKey}`),placeholder:e(`memory.scopeBar.${a.placeholderKey}`)})),g=(0,c.useRouter)(),h=(0,c.usePathname)(),i=(0,c.useSearchParams)(),j=(0,V.useDataScopeKey)(),k=i.toString(),l=(0,d.useMemo)(()=>(0,K.buildMemoryScope)(new URLSearchParams(k)),[k]),[m,n]=(0,d.useState)(!1),[o,p]=(0,d.useState)(l),[q,r]=(0,d.useState)(null),[s,t]=(0,d.useState)(!1),u=h.split("/").filter(Boolean)[1],v=(0,T.toExactScope)(l),x=a&&u&&v?(0,T.buildScopeWorkspaceHref)(decodeURIComponent(u),v):null,B=a&&u?JSON.stringify([j,u]):null,[G,J]=(0,d.useState)({scopeId:B,scopes:[]}),L=G.scopeId===B?G.scopes:$,W=(0,K.hasWildcardScope)(l),ab=(0,X.scopeBreadcrumb)(l),ag=(0,X.scopeGranularity)(l),ah={app:e("memory.scopeField.app"),tenant:e("memory.scopeField.tenant"),agent:e("memory.scopeField.agent"),run:e("memory.scopeField.run")};(0,d.useEffect)(()=>{B&&u?J({scopeId:B,scopes:Q(ac(),j,u)}):J({scopeId:B,scopes:[]})},[j,B,u]),(0,d.useEffect)(()=>{!u||h.includes("/create")||new URLSearchParams(k).get("appId")||g.replace(`${h}?appId=*&tenantId=*&agentId=*&runId=*`)},[k,h,g,u]),(0,d.useEffect)(()=>{p(a=>ad(a)===ad(l)?a:l),r(null)},[l]);let ai=(0,R.useAllMemoryStoreScopes)(u??"",Z,{enabled:a}),aj=ai.data?.items??$,ak=ai.data?.truncated??!1,al=N(l);function am(a){let b=(0,X.normalizeHierarchicalScope)(a);if(!b)return r(e("memory.scopeBar.appRequired")),!1;r(null);let c=(0,K.scopeToSearchParams)(b);return B&&u&&J({scopeId:B,scopes:function(a,b,c,d){let e=Q(a,b,c);if(N(d))return e;let f=O(d);if(!f)return e;let g=P(f),h=[f,...e.filter(a=>P(a)!==g)].slice(0,10);try{a.setItem(M(b,c),JSON.stringify(h))}catch{}return h}(ac(),j,u,b)}),g.replace(`${h}?${c.toString()}`),!0}function an(a){am(a)&&(p((0,X.normalizeHierarchicalScope)(a)??a),t(!1),n(!1))}return(0,b.jsx)(F.Card,{id:"memory-scope-bar",className:"scroll-m-4 border-dashed",children:(0,b.jsxs)(F.CardContent,{className:"p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-3",children:[(0,b.jsx)(D.Settings2,{className:"h-4 w-4 text-muted-foreground"}),(0,b.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:ab.map((a,c)=>(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[c>0?(0,b.jsx)(z.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):null,(0,b.jsxs)("span",{className:(0,S.cn)("max-w-60 shrink-0 truncate rounded px-1.5 py-1 text-xs",a.concrete?"font-mono font-medium text-[hsl(var(--foreground))]":"text-muted-foreground"),title:a.concrete?a.value:e(_[a.level]),children:[(0,b.jsxs)("span",{className:"mr-1 font-sans text-muted-foreground",children:[ah[a.level],":"]}),a.concrete?a.value:e(_[a.level])]})]},a.level))}),(0,b.jsx)("span",{className:"rounded-full bg-[hsl(var(--muted))] px-2 py-1 text-[10px] font-medium text-muted-foreground",children:e(aa[ag])})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[W&&(0,b.jsx)("span",{className:"rounded-md bg-amber-50 px-2 py-1 text-xs text-amber-700 dark:bg-amber-950 dark:text-amber-300",children:e("memory.scopeBar.wildcardQuery")}),x?(0,b.jsx)(E.Button,{asChild:!0,size:"sm",variant:"secondary",children:(0,b.jsx)(w.default,{href:x,children:e("memory.scopeBar.openWorkspace")})}):null,a?(0,b.jsx)(af,{open:s,onOpenChange:t,currentScope:l,recentScopes:L,knownScopes:aj,isLoading:ai.isLoading,isError:ai.isError,isFetching:ai.isFetching,truncated:ak,isWildcardSelected:al,onPickWildcard:()=>an(Z),onPickScope:an,onClearRecent:function(){if(B&&u){var a=ac();try{a.removeItem(M(j,u))}catch{}J({scopeId:B,scopes:[]})}},onRefresh:()=>ai.refetch(),t:e}):null,(0,b.jsxs)(E.Button,{variant:"outline",size:"sm",onClick:()=>n(!m),children:[m?(0,b.jsx)(A.ChevronUp,{className:"mr-1 h-3.5 w-3.5"}):(0,b.jsx)(y.ChevronDown,{className:"mr-1 h-3.5 w-3.5"}),e("memory.scopeBar.manualEdit")]})]})]}),m&&(0,b.jsxs)("div",{className:"mt-4 space-y-4 border-t pt-4",children:[(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:f.map(({key:a,label:c,placeholder:d})=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsxs)(I.Label,{htmlFor:`scope-${a}`,className:"text-xs",children:[c,"appId"===a&&(0,b.jsx)("span",{className:"ml-0.5 text-[hsl(var(--destructive))]",children:"*"})]}),(0,b.jsx)(H.Input,{id:`scope-${a}`,value:o[a]??"",placeholder:d,onChange:b=>{var c;return c=b.target.value,void("appId"===a?p(a=>({...a,appId:c})):p(b=>({...b,[a]:c||void 0})))},className:"h-8 text-sm"})]},a))}),(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[q?(0,b.jsx)("p",{className:"text-xs text-[hsl(var(--destructive))]",children:q}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e("memory.scopeBar.writeHint")}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(E.Button,{variant:"outline",size:"sm",onClick:function(){p(Z),r(null),g.replace(`${h}?appId=*&tenantId=*&agentId=*&runId=*`)},children:[(0,b.jsx)(C.RotateCcw,{className:"mr-1 h-3 w-3"}),e("memory.scopeBar.reset")]}),(0,b.jsx)(E.Button,{size:"sm",onClick:function(){am(o)&&n(!1)},children:e("memory.scopeBar.apply")})]})]})]})]})})}function af({open:a,onOpenChange:c,currentScope:e,recentScopes:f,knownScopes:g,isLoading:h,isError:i,isFetching:j,truncated:k,isWildcardSelected:l,onPickWildcard:m,onPickScope:n,onClearRecent:o,onRefresh:p,t:q}){let r=l?q("memory.common.allData"):(0,K.scopeLabel)(e),s=(0,d.useRef)(null),[t,u]=(0,d.useState)(""),v=(0,d.useMemo)(()=>(0,X.filterScopeTuples)(f,t),[f,t]);return(0,b.jsxs)(J.Popover,{open:a,onOpenChange:function(a){c(a),a||u("")},children:[(0,b.jsx)(J.PopoverTrigger,{asChild:!0,children:(0,b.jsxs)(E.Button,{variant:"outline",size:"sm",className:"h-8 min-w-[200px] justify-between font-mono text-xs",children:[(0,b.jsx)("span",{className:"truncate",children:r}),(0,b.jsx)(B.ChevronsUpDown,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-60"})]})}),(0,b.jsx)(J.PopoverContent,{align:"end",className:"w-[420px] p-0",children:(0,b.jsxs)(G.Command,{shouldFilter:!1,children:[(0,b.jsx)(G.CommandInput,{ref:s,placeholder:q("memory.common.searchScopePlaceholder"),className:"text-xs",value:t,onValueChange:u}),(0,b.jsxs)(G.CommandList,{className:"max-h-[360px]",children:[(0,b.jsx)(G.CommandGroup,{heading:q("memory.common.presets"),children:(0,b.jsxs)(G.CommandItem,{value:"* wildcard 全部数据",onSelect:m,className:"text-xs",children:[(0,b.jsx)(x.Check,{className:(0,S.cn)("mr-2 h-3.5 w-3.5",l?"opacity-100":"opacity-0")}),(0,b.jsx)("span",{className:"font-mono",children:q("memory.common.allDataWildcard")})]})}),v.length>0&&(0,b.jsx)(G.CommandGroup,{heading:q("memory.common.recentScopes",{count:v.length}),children:v.map(a=>{let c=(0,K.scopeLabel)(a),d=ad(a),f=ad(a)===ad(e);return(0,b.jsxs)(G.CommandItem,{value:`recent ${d} ${c}`,onSelect:()=>n(a),className:"text-xs",children:[(0,b.jsx)(x.Check,{className:(0,S.cn)("mr-2 h-3.5 w-3.5",f?"opacity-100":"opacity-0")}),(0,b.jsx)("span",{className:"truncate font-mono",children:c})]},`recent-${d}`)})}),(0,b.jsx)(W.ScopeHierarchyPicker,{scopes:g,currentScope:e,search:t,onSearchChange:u,onApply:n,loading:h,error:i,truncated:k,onRetry:p,allowPartial:!0,t:q})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-t border-[hsl(var(--border-light))] px-2 py-1.5 text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{children:h?q("memory.common.querying"):i?q("memory.scopeCombobox.loadFailed"):q(k?"memory.common.scopeCountTruncated":"memory.common.scopeCount",{count:g.length})}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[f.length>0&&(0,b.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),s.current?.focus(),o()},className:"h-6 rounded px-1.5 py-0.5 hover:bg-[hsl(var(--accent))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.3)]",children:q("memory.common.clearRecentScopes")}),(0,b.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),p()},disabled:j,className:"h-6 rounded px-1.5 py-0.5 hover:bg-[hsl(var(--accent))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.3)] disabled:opacity-50",children:q("common.refresh")})]})]})]})})]})}var ag=a.i(285540);let ah=["units","settings"];function ai(){return(0,b.jsxs)(t.DetailSidebar,{children:[(0,b.jsxs)("div",{className:"space-y-3 px-4 pt-4 pb-4 border-b border-[hsl(var(--border-light))]",children:[(0,b.jsx)(r.Skeleton,{className:"h-9 w-9 rounded-lg"}),(0,b.jsx)(r.Skeleton,{className:"h-4 w-3/4"}),(0,b.jsx)(r.Skeleton,{className:"h-3 w-1/2"})]}),(0,b.jsxs)("div",{className:"space-y-1 px-2 py-2",children:[(0,b.jsx)(r.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(r.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(r.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(r.Skeleton,{className:"h-8 w-full"}),(0,b.jsx)(r.Skeleton,{className:"h-8 w-full"})]})]})}a.s(["default",0,function({children:a}){let{t:w}=(0,U.useI18n)(),x=[{label:w("memory.detail.tabScope"),segment:"scope",icon:(0,b.jsx)(j,{className:"h-4 w-4"})},{label:w("memory.detail.tabUnits"),segment:"units",icon:(0,b.jsx)(g.Database,{className:"h-4 w-4"})},{label:w("memory.detail.tabSearch"),segment:"search",icon:(0,b.jsx)(n.Search,{className:"h-4 w-4"})},{label:w("memory.detail.tabMessages"),segment:"messages",icon:(0,b.jsx)(l.MessageSquare,{className:"h-4 w-4"})},{label:w("memory.detail.tabTasks"),segment:"tasks",icon:(0,b.jsx)(k.ListChecks,{className:"h-4 w-4"})},{label:w("memory.detail.tabRequests"),segment:"requests",icon:(0,b.jsx)(h.FileClock,{className:"h-4 w-4"})},{label:w("memory.detail.tabDream"),segment:"dream",icon:(0,b.jsx)(p.Sparkles,{className:"h-4 w-4"})},{label:w("memory.detail.tabWiki"),segment:"wiki",icon:(0,b.jsx)(e.BookOpen,{className:"h-4 w-4"})},{label:w("memory.detail.tabSettings"),segment:"settings",icon:(0,b.jsx)(o.Settings,{className:"h-4 w-4"})}],y=decodeURIComponent((0,c.useParams)().store),z=(0,c.usePathname)(),A=(0,c.useRouter)(),B=(0,c.useSearchParams)(),{data:C,isLoading:D}=(0,u.useMemoryStore)(y),[E,F]=(0,d.useState)(!1),G=B.toString()?`?${B.toString()}`:"",H=`/memory/${encodeURIComponent(y)}`,I=z.slice(H.length).split("/").filter(Boolean)[0]??"units",J=(0,ag.parseKnownStorageMode)(C?.storageMode),K=null===J?null:(0,ag.storageModeCapabilities)(J),L=K?.detailSegments??ah,M=null===J?L.includes(I)?I:"units":(0,ag.resolveMemoryDetailSegment)(J,I),N=!!(C&&K?.structured!==!0&&I!==M);if((0,d.useEffect)(()=>{N&&A.replace(`${H}/${M}${G}`)},[H,G,M,A,N]),D)return(0,b.jsx)(t.DetailLayout,{sidebar:(0,b.jsx)(ai,{}),children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(r.Skeleton,{className:"h-10 w-64"}),(0,b.jsx)(r.Skeleton,{className:"h-28 w-full"}),(0,b.jsx)(r.Skeleton,{className:"h-64 w-full"})]})});if(!C)return(0,b.jsx)(t.DetailLayout,{sidebar:(0,b.jsx)(ai,{}),children:(0,b.jsx)("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:w("memory.common.notFoundOrDeleted")})});if(N)return null;let O=L.map(a=>("filemem"===J||"managed-file"===J)&&"units"===a?{label:w("memory.detail.tabFiles"),segment:"units",icon:(0,b.jsx)(i.FolderTree,{className:"h-4 w-4"})}:x.find(b=>b.segment===a)??{label:w("memory.detail.tabFiles"),segment:"units",icon:(0,b.jsx)(i.FolderTree,{className:"h-4 w-4"})}).map(a=>({href:`${H}/${a.segment}${G}`,label:a.label,icon:a.icon}));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(t.DetailLayout,{sidebar:(0,b.jsxs)(t.DetailSidebar,{children:[(0,b.jsx)(t.DetailSidebarHeader,{icon:(0,b.jsx)(f.Brain,{}),accent:"purple",name:C.memoryStoreName,typeLabel:w("memory.detail.typeLabel"),description:C.description,actions:(0,b.jsxs)(s.DropdownMenu,{children:[(0,b.jsx)(s.DropdownMenuTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button","aria-label":w("memory.detail.moreActions"),className:"flex h-7 w-7 items-center justify-center rounded-md text-[hsl(var(--muted-foreground))] transition-colors hover:bg-[hsl(var(--background))] hover:text-[hsl(var(--foreground))]",children:(0,b.jsx)(m.MoreVertical,{className:"h-4 w-4"})})}),(0,b.jsx)(s.DropdownMenuContent,{align:"end",children:(0,b.jsxs)(s.DropdownMenuItem,{onSelect:a=>{a.preventDefault(),F(!0)},className:"text-[hsl(var(--destructive))] focus:bg-[hsl(var(--danger-soft))] focus:text-[hsl(var(--destructive))] hover:bg-[hsl(var(--danger-soft))] hover:text-[hsl(var(--destructive))]",children:[(0,b.jsx)(q.Trash2,{className:"h-3.5 w-3.5"}),w("memory.detail.deleteStore")]})})]})}),(0,b.jsx)(t.DetailSidebarMenu,{items:O}),(0,b.jsx)(t.DetailSidebarBack,{href:"/memory",label:w("memory.detail.backToList")})]}),children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(ae,{allowScopeDiscovery:K?.discoverableScopes===!0}),(0,b.jsx)("div",{children:a})]})}),(0,b.jsx)(v.MemoryDeleteDialog,{memoryStoreName:y,open:E,onOpenChange:F,redirectToList:!0})]})}],598680)}];
2
2
 
3
3
  //# sourceMappingURL=dashboard_src_app_%28dashboard%29_memory_%5Bstore%5D_layout_tsx_0rbi41w._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[69363,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(411697),f=a.i(539972),g=a.i(408970),h=a.i(543320),i=a.i(285540),j=a.i(870307),k=a.i(353141),l=a.i(412583),m=a.i(521989),n=a.i(776192),o=a.i(473524);let p=new Set(["draft","stale","failed_with_fallback","blocked"]),q={loading:"secondary",draft:"secondary",building:"warning",ready:"success",stale:"warning",failed_with_fallback:"warning",blocked:"danger"},r={loading:"memory.scopeWorkspace.statusDescription.loading",draft:"memory.scopeWorkspace.statusDescription.draft",building:"memory.scopeWorkspace.statusDescription.building",ready:"memory.scopeWorkspace.statusDescription.ready",stale:"memory.scopeWorkspace.statusDescription.stale",failed_with_fallback:"memory.scopeWorkspace.statusDescription.failed_with_fallback",blocked:"memory.scopeWorkspace.statusDescription.blocked"};function s({view:a,segment:c,label:d}){return(0,b.jsx)(n.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,b.jsx)(l.default,{href:(0,j.buildScopeFeatureHref)(a.memoryStoreName,c,a.scope),children:d})})}function t(a){return void 0!==a.chatStorageMode&&!a.memory.loading&&!a.memory.error}function u({view:a,t:c}){let d=(0,j.buildScopeFeatureHref)(a.memoryStoreName,"wiki",a.scope,{tab:"build"}),e=[a.scope.appId,a.scope.tenantId,a.scope.agentId,a.scope.runId].join(" / "),f="building"!==a.status||a.chat.wikiEnabled?r[a.status]:"memory.scopeWorkspace.statusDescription.firstBuilding";return(0,b.jsxs)("header",{className:"flex flex-col gap-4 rounded-xl border bg-card p-5 sm:flex-row sm:items-start sm:justify-between","data-storage-mode":a.storageMode,"data-testid":"scope-workspace-header",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:c("memory.scopeWorkspace.title")}),(0,b.jsx)(m.Badge,{variant:q[a.status],children:c(`memory.scopeWorkspace.status.${a.status}`)})]}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:c("memory.scopeWorkspace.description")}),(0,b.jsxs)("dl",{className:"mt-3 grid gap-x-5 gap-y-1 text-sm sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:c("memory.scopeWorkspace.store")}),(0,b.jsx)("dd",{className:"font-medium",children:a.memoryStoreName})]}),(0,b.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,b.jsx)("dt",{className:"shrink-0 text-muted-foreground",children:c("memory.scopeWorkspace.scope")}),(0,b.jsx)("dd",{className:"truncate font-medium",children:e})]})]}),(0,b.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:c(f)})]}),(0,b.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2",children:[p.has(a.status)?(0,b.jsx)(n.Button,{asChild:!0,size:"sm",children:(0,b.jsx)(l.default,{href:d,children:c("memory.scopeWorkspace.reviewBuild")})}):null,t(a)?(0,b.jsx)(n.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,b.jsx)(l.default,{href:(0,j.buildScopeChatHref)(a.memoryStoreName,a.chatStorageMode,a.scope,"auto"),children:c("memory.scopeWorkspace.openChat")})}):null]})]})}function v({view:a,t:c}){return(0,b.jsxs)(o.Card,{"data-testid":"scope-workspace-memory",children:[(0,b.jsxs)(o.CardHeader,{children:[(0,b.jsx)(o.CardTitle,{children:c("memory.scopeWorkspace.memoryTitle")}),(0,b.jsx)(o.CardDescription,{children:c("memory.scopeWorkspace.memoryDescription")})]}),(0,b.jsxs)(o.CardContent,{className:"space-y-2 text-sm",children:[a.memory.loading?(0,b.jsx)("p",{children:c("memory.scopeWorkspace.loading")}):null,a.memory.loading||a.memory.error?null:(0,b.jsx)("p",{children:c(a.memory.exists?"memory.scopeWorkspace.exists":"memory.scopeWorkspace.notFound")}),a.memory.error?(0,b.jsx)("p",{className:"text-danger",children:a.memory.error}):null]}),(0,b.jsxs)(o.CardFooter,{className:"gap-2",children:[(0,b.jsx)(s,{view:a,segment:"units",label:c("memory.scopeWorkspace.openUnits")}),(0,b.jsx)(s,{view:a,segment:"search",label:c("memory.scopeWorkspace.openSearch")})]})]})}function w({view:a,t:c}){return(0,b.jsxs)(o.Card,{"data-testid":"scope-workspace-dream",children:[(0,b.jsxs)(o.CardHeader,{children:[(0,b.jsx)(o.CardTitle,{children:c("memory.scopeWorkspace.dreamTitle")}),(0,b.jsx)(o.CardDescription,{children:c("memory.scopeWorkspace.dreamDescription")})]}),(0,b.jsxs)(o.CardContent,{className:"space-y-2 text-sm",children:[(0,b.jsx)("p",{children:c("memory.scopeWorkspace.skillCount",{count:a.dream.skillCount})}),(0,b.jsx)("p",{children:c("memory.scopeWorkspace.profileCount",{count:a.dream.profileCount})}),a.dream.partial?(0,b.jsx)("p",{className:"text-warning",children:c("memory.scopeWorkspace.partial")}):null,a.dream.error?(0,b.jsx)("p",{className:"text-danger",children:a.dream.error}):null]}),(0,b.jsxs)(o.CardFooter,{className:"gap-2",children:[(0,b.jsx)(s,{view:a,segment:"dream",label:c("memory.scopeWorkspace.openDream")}),(0,b.jsx)(n.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,b.jsx)(l.default,{href:(0,j.buildScopeFeatureHref)(a.memoryStoreName,"wiki",a.scope,{tab:"build"}),children:c("memory.scopeWorkspace.reviewBuild")})})]})]})}function x({view:a,t:c}){let d=a.wiki.quality,e=a.wiki.changes;return(0,b.jsxs)(o.Card,{"data-testid":"scope-workspace-wiki",children:[(0,b.jsxs)(o.CardHeader,{children:[(0,b.jsx)(o.CardTitle,{children:c("memory.scopeWorkspace.wikiTitle")}),(0,b.jsx)(o.CardDescription,{children:c("memory.scopeWorkspace.wikiDescription")})]}),(0,b.jsxs)(o.CardContent,{className:"space-y-2 text-sm",children:[void 0!==a.wiki.pageCount?(0,b.jsx)("p",{children:c("memory.scopeWorkspace.pageCount",{count:a.wiki.pageCount})}):null,a.wiki.latestStatus?(0,b.jsx)("p",{children:c("memory.scopeWorkspace.latestStage",{status:a.wiki.latestStatus})}):null,d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{children:c("memory.scopeWorkspace.qualitySourceCoverage",{percent:Math.round(100*d.sourceCoverage)})}),(0,b.jsx)("p",{children:c("memory.scopeWorkspace.qualityGroundedRate",{percent:Math.round(100*d.groundedPageRate)})})]}):null,e?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{children:c("memory.scopeWorkspace.changesAdded",{count:e.added})}),(0,b.jsx)("p",{children:c("memory.scopeWorkspace.changesModified",{count:e.modified})}),(0,b.jsx)("p",{children:c("memory.scopeWorkspace.changesDeleted",{count:e.deleted})}),(0,b.jsx)("p",{children:c("memory.scopeWorkspace.changesAffectedPages",{count:e.affectedPages})})]}):null,"stale"===a.status?(0,b.jsx)("p",{className:"text-warning",children:c("memory.scopeWorkspace.staleGuidance")}):null,"failed_with_fallback"===a.status?(0,b.jsx)("p",{className:"text-warning",children:c("memory.scopeWorkspace.fallbackGuidance")}):null,"building"===a.status?(0,b.jsx)("p",{className:"text-muted-foreground",children:c(a.chat.wikiEnabled?"memory.scopeWorkspace.buildingGuidance":"memory.scopeWorkspace.firstBuildGuidance")}):null,"draft"===a.status?(0,b.jsx)("p",{className:"text-muted-foreground",children:c("memory.scopeWorkspace.draftGuidance")}):null,a.wiki.error?(0,b.jsx)("p",{className:"text-danger",children:a.wiki.error}):null]}),(0,b.jsx)(o.CardFooter,{children:(0,b.jsx)(s,{view:a,segment:"wiki",label:c("memory.scopeWorkspace.openWiki")})})]})}function y({view:a,t:c}){return(0,b.jsxs)(o.Card,{"data-testid":"scope-workspace-chat",children:[(0,b.jsxs)(o.CardHeader,{children:[(0,b.jsx)(o.CardTitle,{children:c("memory.scopeWorkspace.chatTitle")}),(0,b.jsx)(o.CardDescription,{children:c("memory.scopeWorkspace.chatDescription")})]}),(0,b.jsxs)(o.CardContent,{className:"space-y-2 text-sm",children:[(0,b.jsx)("p",{children:c("memory.scopeWorkspace.chatMemoryEnabled")}),(0,b.jsx)("p",{children:c(a.chat.wikiEnabled?"memory.scopeWorkspace.chatWikiEnabled":"memory.scopeWorkspace.chatWikiDisabled")}),a.chat.usesFallback?(0,b.jsx)("p",{className:"text-warning",children:c("memory.scopeWorkspace.chatFallback")}):null]}),(0,b.jsx)(o.CardFooter,{children:t(a)?(0,b.jsx)(n.Button,{asChild:!0,size:"sm",children:(0,b.jsx)(l.default,{href:(0,j.buildScopeChatHref)(a.memoryStoreName,a.chatStorageMode,a.scope,"auto"),children:c("memory.scopeWorkspace.openChat")})}):null})]})}function z({view:a,t:c}){return(0,b.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,b.jsx)(v,{view:a,t:c}),(0,b.jsx)(w,{view:a,t:c}),(0,b.jsx)(x,{view:a,t:c}),(0,b.jsx)(y,{view:a,t:c})]})}function A(a){return!!(a.isPending||a.isLoading)}function B(a,b){if(a)return a instanceof k.ApiClientError?[a.displayMessage,a.requestId].filter(Boolean).join(" · "):b}function C(a){return(a.data?.pages??[]).flatMap(a=>a.artifacts)}function D({memoryStoreName:a,scope:c}){let d=(0,e.useMemoryStore)(a);if(A(d))return(0,b.jsx)(E,{state:"loading"});if(d.error)return(0,b.jsx)(E,{state:"error"});let f=(0,i.parseKnownStorageMode)(d.data?.storageMode);return null===f||"filemem"===f||"managed-file"===f?(0,b.jsx)(E,{state:"unsupported"}):(0,b.jsx)(F,{memoryStoreName:a,scope:c,storageMode:f})}function E({state:a}){let{t:c}=(0,h.useI18n)();return(0,b.jsx)("div",{className:"rounded-lg border border-dashed bg-card px-6 py-10 text-center text-sm text-muted-foreground",children:c("loading"===a?"memory.scopeWorkspace.loading":"error"===a?"memory.scopeWorkspace.loadFailed":"memory.scopeWorkspace.unsupported")})}function F({memoryStoreName:a,scope:c,storageMode:d}){let{t:e}=(0,h.useI18n)(),i=(0,f.useMemoryStoreScopes)(a,c,{limit:1}),k=(0,g.useWiki)(a,c),l=(0,g.useWikiArtifacts)(a,c,{kind:"skill",limit:100}),m=(0,g.useWikiArtifacts)(a,c,{kind:"profile",limit:100}),n=C(l),o=C(m),p=!l.error&&!1===l.hasNextPage&&!m.error&&!1===m.hasNextPage&&!A(l)&&!A(m),q=k.data?.latestBuild,r=e("memory.scopeWorkspace.loadFailed"),s=B(k.error,r),t=B(i.error,r),v=(0,j.deriveScopeWorkspaceStatus)({loading:A(i)||A(k)||A(l)||A(m),error:k.error,wiki:k.data}),w=i.data?.items.some(a=>a.appId===c.appId&&a.tenantId===c.tenantId&&a.agentId===c.agentId&&a.runId===c.runId),x=k.data?.status==="ready",y=[B(l.error,r),B(m.error,r)].filter(Boolean).join(" · ")||void 0,D={memoryStoreName:a,storageMode:d,chatStorageMode:d,scope:c,status:v,memory:{exists:w,loading:A(i),error:t},dream:{skillCount:n.length,profileCount:o.length,partial:!p,error:y},wiki:{pageCount:k.data?.pageCount,quality:q?.quality,changes:q?.changes,latestStatus:q?.status,error:s},chat:{memoryEnabled:!0,wikiEnabled:x,usesFallback:"failed_with_fallback"===v}};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(u,{view:D,t:e}),(0,b.jsx)(z,{view:D,t:e})]})}var G=a.i(35686),H=a.i(983366),I=a.i(342210),J=a.i(465173),K=a.i(907704),L=a.i(146137),M=a.i(69088),N=a.i(172518),O=a.i(962491),P=a.i(663525);function Q(a){return"string"==typeof a&&a.length>0}var R=a.i(225377),S=a.i(739096),T=a.i(421347);let U={appId:"*",tenantId:"*",agentId:"*",runId:"*"};function V({memoryStoreName:a}){let{context:c,ready:d}=(0,S.useRuntimeContext)();return(0,b.jsx)(W,{memoryStoreName:a,dataScopeKey:c.dataScopeKey,ready:d},JSON.stringify([c.dataScopeKey,a]))}function W({memoryStoreName:a,dataScopeKey:d,ready:e}){var f;let{t:g}=(0,h.useI18n)(),[i,j]=(0,c.useState)("conversation"),[k,l]=(0,c.useState)("appId"),[o,p]=(0,c.useState)("eq"),[q,r]=(0,c.useState)(""),[s,t]=(0,c.useState)([]),[u,v]=(0,c.useState)({scope:U,limit:20}),w=(0,c.useMemo)(()=>JSON.stringify(u),[u]),x=(0,H.useQuery)({queryKey:R.queryKeys.memoryScopeDirectory(d,a,w),queryFn:()=>(0,T.queryMemoryStoreScopes)(a,u),enabled:e&&!!a,placeholderData:G.keepPreviousData}),y=x.data?.items??[],z=void 0!==u.filter,A=(f=x.error,!!z&&f instanceof Error&&("INVALID_PARAMETER"===("code"in f&&"string"==typeof f.code?f.code:"")||f.message.toLowerCase().includes("invalid parameter"))),B=x.error instanceof Error?x.error.message:"";return(0,b.jsxs)("section",{className:"space-y-4 rounded-xl border bg-card p-5","data-testid":"scope-directory-explorer",children:[(0,b.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:g("memory.scopeDirectory.title")}),(0,b.jsx)(m.Badge,{variant:"secondary",children:"Beta"})]}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:g("memory.scopeDirectory.description")})]}),(0,b.jsx)(n.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>x.refetch(),disabled:x.isFetching,children:g("memory.common.refresh")})]}),(0,b.jsxs)("form",{onSubmit:function(a){var b;let c,d,e;a.preventDefault(),t([]);let f=q.trim();v("conversation"!==i||f?{filter:(c=[],"all"!==(b={scopeType:i,field:k,op:o,value:f}).scopeType&&c.push({op:"eq",field:"scopeType",value:b.scopeType}),d=b.field?.trim(),e=b.value?.trim(),(d&&e&&c.push({op:b.op??"eq",field:d,value:e}),0===c.length)?{op:"exists",field:"scopeType"}:1===c.length?c[0]:{op:"and",conditions:c}),limit:20}:{scope:U,limit:20})},className:"grid gap-3 rounded-lg bg-muted/30 p-3 md:grid-cols-[160px_150px_130px_1fr_auto] md:items-end",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(O.Label,{children:g("memory.scopeDirectory.scopeType")}),(0,b.jsxs)(P.Select,{value:i,onValueChange:a=>j(a),children:[(0,b.jsx)(P.SelectTrigger,{children:(0,b.jsx)(P.SelectValue,{})}),(0,b.jsxs)(P.SelectContent,{children:[(0,b.jsx)(P.SelectItem,{value:"all",children:g("memory.scopeDirectory.allTypes")}),(0,b.jsx)(P.SelectItem,{value:"conversation",children:"conversation"}),(0,b.jsx)(P.SelectItem,{value:"wiki",children:"wiki"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(O.Label,{children:g("memory.scopeDirectory.field")}),(0,b.jsxs)(P.Select,{value:k,onValueChange:l,children:[(0,b.jsx)(P.SelectTrigger,{children:(0,b.jsx)(P.SelectValue,{})}),(0,b.jsx)(P.SelectContent,{children:["appId","tenantId","agentId","runId","wikiId","scopeKey"].map(a=>(0,b.jsx)(P.SelectItem,{value:a,children:a},a))})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(O.Label,{children:g("memory.scopeDirectory.operator")}),(0,b.jsxs)(P.Select,{value:o,onValueChange:a=>p(a),children:[(0,b.jsx)(P.SelectTrigger,{children:(0,b.jsx)(P.SelectValue,{})}),(0,b.jsxs)(P.SelectContent,{children:[(0,b.jsx)(P.SelectItem,{value:"eq",children:"eq"}),(0,b.jsx)(P.SelectItem,{value:"prefix",children:"prefix"}),(0,b.jsx)(P.SelectItem,{value:"wildcard",children:"wildcard"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(O.Label,{children:g("memory.scopeDirectory.value")}),(0,b.jsx)(N.Input,{value:q,onChange:a=>r(a.target.value),placeholder:"wildcard"===o?"assistant-*":"app-001"})]}),(0,b.jsx)(n.Button,{type:"submit",children:g("memory.scopeDirectory.query")})]}),x.isPending?(0,b.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:g("memory.common.querying")}):x.isError?(0,b.jsxs)("div",{className:A?"rounded-lg border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-800 dark:text-amber-200":"rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[g(A?"memory.scopeDirectory.unsupported":"memory.scopeDirectory.failed"),B?(0,b.jsx)("p",{className:"mt-1 break-all font-mono text-xs opacity-80",children:B}):null]}):0===y.length?(0,b.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:g("memory.scopeDirectory.empty")}):(0,b.jsx)("div",{className:"overflow-x-auto rounded-lg border",children:(0,b.jsxs)("table",{className:"w-full min-w-[760px] text-sm",children:[(0,b.jsx)("thead",{className:"bg-muted/50 text-left text-xs text-muted-foreground",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-3 py-2",children:g("memory.scopeDirectory.type")}),(0,b.jsx)("th",{className:"px-3 py-2",children:g("memory.scopeDirectory.dimensions")}),(0,b.jsx)("th",{className:"px-3 py-2",children:"scopeKey"}),(0,b.jsx)("th",{className:"px-3 py-2 text-right",children:g("memory.scopeDirectory.action")})]})}),(0,b.jsx)("tbody",{className:"divide-y",children:y.map(c=>(0,b.jsx)(X,{item:c,store:a},`${c.scopeType}:${c.scopeKey}`))})]})}),(0,b.jsxs)("footer",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:g("memory.scopeDirectory.page",{page:s.length+1})}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(n.Button,{type:"button",size:"sm",variant:"outline",onClick:function(){let a=s.at(-1);void 0!==a&&(t(a=>a.slice(0,-1)),v(b=>({...b,...a?{nextToken:a}:{nextToken:void 0}})))},disabled:0===s.length||x.isFetching||x.isError,children:[(0,b.jsx)(J.ChevronLeft,{className:"h-4 w-4"}),g("common.prevPage")]}),(0,b.jsxs)(n.Button,{type:"button",size:"sm",variant:"outline",onClick:function(){let a=x.data?.nextToken;a&&(t(a=>[...a,u.nextToken??""]),v(b=>({...b,nextToken:a})))},disabled:!x.data?.nextToken||x.isFetching||x.isError,children:[g("common.nextPage"),(0,b.jsx)(K.ChevronRight,{className:"h-4 w-4"})]})]})]})]})}function X({item:a,store:c}){let{t:d}=(0,h.useI18n)(),e=["appId","tenantId","agentId","runId","wikiId"].flatMap(b=>{let c=a[b];return"string"==typeof c&&c.length>0?[`${b}=${c}`]:[]}).join(" · "),f="conversation"===a.scopeType,g="conversation"===a.scopeType&&Q(a.appId)&&Q(a.tenantId)&&Q(a.agentId)&&Q(a.runId)?(0,j.buildScopeWorkspaceHref)(c,{appId:a.appId,tenantId:a.tenantId,agentId:a.agentId,runId:a.runId}):null;return(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{className:"px-3 py-3",children:(0,b.jsxs)(m.Badge,{variant:f?"outline":"secondary",children:[f?(0,b.jsx)(L.MessagesSquare,{className:"mr-1 h-3 w-3"}):(0,b.jsx)(I.BookOpen,{className:"mr-1 h-3 w-3"}),a.scopeType]})}),(0,b.jsx)("td",{className:"px-3 py-3 font-mono text-xs",children:e}),(0,b.jsx)("td",{className:"max-w-[280px] px-3 py-3",children:(0,b.jsx)(M.CopyableId,{value:a.scopeKey,label:""})}),(0,b.jsx)("td",{className:"px-3 py-3 text-right",children:g?(0,b.jsx)(n.Button,{asChild:!0,size:"sm",variant:"ghost",children:(0,b.jsx)(l.default,{href:g,children:d("memory.scopeDirectory.open")})}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:d(f?"memory.scopeDirectory.exactScopeRequired":"memory.scopeDirectory.wikiOnly")})})]})}function Y({memoryStoreName:a,search:d}){let{t:e}=(0,h.useI18n)(),f=(0,c.useMemo)(()=>(0,j.parseExactScope)(new URLSearchParams(d)),[d]);return(0,b.jsxs)("div",{className:"space-y-6",children:[f?(0,b.jsx)(D,{memoryStoreName:a,scope:f}):(0,b.jsxs)("div",{className:"rounded-xl border border-dashed px-6 py-12 text-center","data-testid":"scope-workspace-invalid",children:[(0,b.jsx)("h2",{className:"font-semibold",children:e("memory.scopeWorkspace.invalidTitle")}),(0,b.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:e("memory.scopeWorkspace.invalidDescription")})]}),(0,b.jsx)(V,{memoryStoreName:a},a)]})}a.s(["ScopeWorkspaceRouteBoundary",0,Y,"default",0,function(){let a=(0,d.useParams)(),c=(0,d.useSearchParams)().toString(),e=decodeURIComponent(a.store);return(0,b.jsx)(Y,{memoryStoreName:e,search:c})}],69363)}];
2
+
3
+ //# sourceMappingURL=dashboard_src_app_%28dashboard%29_memory_%5Bstore%5D_scope_page_tsx_01rq2zq._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[421458,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(263265),f=a.i(933596),g=a.i(421347),h=a.i(411697),i=a.i(908264),j=a.i(201927),k=a.i(750053);let l=(0,k.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var m=a.i(776192),n=a.i(36890),o=a.i(172518),p=a.i(962491),q=a.i(470535),r=a.i(27692),s=a.i(543320),t=a.i(25825),u=a.i(655295),v=a.i(663525);let w=["scopeType","appId","tenantId","agentId","runId","wikiId","scopeKey"],x=["eq","in","prefix","wildcard","range","exists"];function y(a){return null!==a&&"object"==typeof a&&!Array.isArray(a)}function z(a,b){let c=!1,d=a;if(y(a)&&"not"===a.op&&(c=!0,d=a.condition),!y(d)||"string"!=typeof d.op||"string"!=typeof d.field||!w.includes(d.field))return null;let e=C(`scope-filter-${b+1}`);return(e.field=d.field,e.negate=c,("eq"===d.op||"prefix"===d.op||"wildcard"===d.op)&&"string"==typeof d.value)?{...e,operator:d.op,value:d.value}:"in"===d.op&&Array.isArray(d.values)&&d.values.length>0&&d.values.every(a=>"string"==typeof a)?{...e,operator:"in",value:d.values.join(", ")}:"range"===d.op&&("string"==typeof d.gte||"string"==typeof d.lte)&&void 0===d.gt&&void 0===d.lt?{...e,operator:"range",value:"string"==typeof d.gte?d.gte:"",endValue:"string"==typeof d.lte?d.lte:""}:"exists"===d.op?{...e,operator:"exists"}:null}function A(a){let b=y(a)?a:null;if(!b||"string"!=typeof b.op)return;let c="or"===b.op?"or":"and",d="and"===b.op||"or"===b.op?Array.isArray(b.conditions)?b.conditions:[]:[a];if(0===d.length||d.length>64)return;let e=d.map(z);if(e.some(a=>null===a))return;let f=B(e,c);return f?{combinator:c,rules:e,filter:f}:void 0}function B(a,b){let c=a.flatMap(a=>{let b=function(a){let b=a.field.trim();if(!b)return null;if("exists"===a.operator)return{op:"exists",field:b};let c=a.value.trim();if("in"===a.operator){let a=[...new Set(c.split(",").map(a=>a.trim()))].filter(Boolean);return a.length>0?{op:"in",field:b,values:a}:null}if("range"===a.operator){let d=a.endValue.trim();return c||d?{op:"range",field:b,...c?{gte:c}:{},...d?{lte:d}:{}}:null}return c?{op:a.operator,field:b,value:c}:null}(a);return b?[a.negate?{op:"not",condition:b}:b]:[]});if(0!==c.length)return 1===c.length?c[0]:{op:b,conditions:c}}function C(a){return{id:a,field:"appId",operator:"eq",value:"",endValue:"",negate:!1}}function D({initialFilter:a,onChange:d}){let{t:e}=(0,s.useI18n)(),[f]=(0,c.useState)(()=>A(a)),g=(0,c.useRef)((f?.rules.length??0)+1),h=(0,c.useRef)(d),[i,j]=(0,c.useState)(f?.combinator??"and"),[k,l]=(0,c.useState)(f?.rules??[]);function q(a,b){l(c=>c.map(c=>c.id===a?{...c,...b}:c))}return(0,c.useEffect)(()=>{h.current=d},[d]),(0,c.useEffect)(()=>{h.current(B(k,i))},[i,k]),(0,b.jsxs)("section",{className:"space-y-3 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.2)] p-3","data-testid":"scope-filter-builder",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(p.Label,{children:e("memory.search.scopeFilter")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("memory.search.scopeFilterHelp")})]}),k.length>1?(0,b.jsxs)(v.Select,{value:i,onValueChange:a=>j(a),children:[(0,b.jsx)(v.SelectTrigger,{className:"h-8 w-[132px]",children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"and",children:e("memory.search.scopeFilterMatchAll")}),(0,b.jsx)(v.SelectItem,{value:"or",children:e("memory.search.scopeFilterMatchAny")})]})]}):null]}),(0,b.jsx)("div",{className:"space-y-2",children:k.map((a,c)=>(0,b.jsxs)("div",{className:"space-y-2 rounded-md border bg-background p-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:e("memory.search.scopeFilterCondition",{index:c+1})}),(0,b.jsx)(m.Button,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":e("memory.search.scopeFilterRemove"),onClick:()=>{var b;return b=a.id,void l(a=>a.filter(a=>a.id!==b))},children:(0,b.jsx)(u.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,b.jsxs)("div",{className:"grid gap-2",children:[(0,b.jsxs)(v.Select,{value:a.field,onValueChange:b=>q(a.id,{field:b}),children:[(0,b.jsx)(v.SelectTrigger,{"aria-label":e("memory.search.scopeFilterField"),children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsx)(v.SelectContent,{children:w.map(a=>(0,b.jsx)(v.SelectItem,{value:a,children:e(`memory.search.scopeFilterField_${a}`)},a))})]}),(0,b.jsxs)(v.Select,{value:a.operator,onValueChange:b=>q(a.id,{operator:b}),children:[(0,b.jsx)(v.SelectTrigger,{"aria-label":e("memory.search.scopeFilterOperator"),children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsx)(v.SelectContent,{children:x.map(a=>(0,b.jsx)(v.SelectItem,{value:a,children:e(`memory.search.scopeFilterOperator_${a}`)},a))})]})]}),"range"===a.operator?(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsx)(o.Input,{value:a.value,onChange:b=>q(a.id,{value:b.target.value}),placeholder:e("memory.search.scopeFilterRangeStart")}),(0,b.jsx)(o.Input,{value:a.endValue,onChange:b=>q(a.id,{endValue:b.target.value}),placeholder:e("memory.search.scopeFilterRangeEnd")})]}):"exists"!==a.operator?(0,b.jsx)(o.Input,{value:a.value,onChange:b=>q(a.id,{value:b.target.value}),placeholder:"in"===a.operator?e("memory.search.scopeFilterValuesPlaceholder"):e("memory.search.scopeFilterValuePlaceholder")}):null,(0,b.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(n.Checkbox,{checked:a.negate,onCheckedChange:b=>q(a.id,{negate:!0===b})}),e("memory.search.scopeFilterNegate")]})]},a.id))}),(0,b.jsxs)(m.Button,{type:"button",variant:"outline",size:"sm",onClick:function(){let a=`scope-filter-${g.current}`;g.current+=1,l(b=>[...b,C(a)])},children:[(0,b.jsx)(t.Plus,{className:"h-3.5 w-3.5"}),e("memory.search.scopeFilterAdd")]})]})}let E={scopeRequired:"请先在范围栏中设置非通配的「应用」",exactScopeRequired:"当前记忆库会返回文件结果,请为 Scope 四个字段设置具体值",queryRequired:"请输入检索内容",topKRange:"Top K 必须在 1 到 50 之间",similarityRange:"相似度阈值必须在 0 到 1 之间",scoreRange:"相关度阈值必须在 0 到 1 之间"};function F(a,b,c){let d=a.get(b);if(null===d||""===d.trim())return c;let e=Number(d);return Number.isFinite(e)?e:c}function G(a,b=E){return a.searchable?a.exactScopeRequired&&!a.preciseScope?b.exactScopeRequired:a.query.trim()?!Number.isInteger(a.topK)||a.topK<1||a.topK>50?b.topKRange:!Number.isFinite(a.minSimilarity)||a.minSimilarity<0||a.minSimilarity>1?b.similarityRange:void 0!==a.minScore&&(!Number.isFinite(a.minScore)||a.minScore<0||a.minScore>1)?b.scoreRange:null:b.queryRequired:b.scopeRequired}function H({scope:a,requiresExactScope:e=!1,isLoading:f,onSubmit:g}){let{t:h}=(0,s.useI18n)(),k=(0,d.useRouter)(),t=(0,d.usePathname)(),u=(0,d.useSearchParams)().toString(),v=new URLSearchParams(u),[w,x]=(0,c.useState)(()=>v.get("q")??""),[y,z]=(0,c.useState)(()=>String(F(v,"topK",10))),[B,C]=(0,c.useState)(()=>"false"!==v.get("rerank")),[E,I]=(0,c.useState)(()=>"false"!==v.get("evidence")),[J,K]=(0,c.useState)(()=>String(F(v,"minSimilarity",0))),[L,M]=(0,c.useState)(()=>String(F(v,"minScore",0))),[N,O]=(0,c.useState)(()=>(function(a){if(a)try{return A(JSON.parse(a))}catch{return}})(v.get("filter"))?.filter),[P,Q]=(0,c.useState)(()=>v.get("contextScope")??""),[R,S]=(0,c.useState)(()=>v.get("metadata")??""),[T,U]=(0,c.useState)(null),[V,W]=(0,c.useState)(()=>["topK","rerank","evidence","minSimilarity","minScore","filter","contextScope","metadata"].some(a=>v.has(a))),X=(0,i.hasSearchableScope)(a),Y=(0,i.hasPreciseScope)(a),Z=Number(y),$=Number(J),_=Number(L),aa=X&&(!e||Y),ab=!w.trim(),ac=(0,c.useMemo)(()=>({scopeRequired:h("memory.search.scopeRequired"),exactScopeRequired:h("memory.search.exactScopeRequired"),queryRequired:h("memory.search.queryRequired"),topKRange:h("memory.search.topKRange"),similarityRange:h("memory.search.similarityRange"),scoreRange:h("memory.search.scoreRange")}),[h]),ad=G({searchable:X,exactScopeRequired:e,preciseScope:Y,query:w,topK:Z,minSimilarity:$,minScore:_},ac),ae=null,af=!1;async function ag(b){b.preventDefault(),U(null);let c=G({searchable:X,exactScopeRequired:e,preciseScope:Y,query:w,topK:Z,minSimilarity:$,minScore:_},ac);if(c)return void U(c);try{let b={query:w.trim(),scope:a,topK:Z,enableRerank:B,includeEvidence:E,minSimilarity:$,minScore:_,filter:N,contextScope:function(a,b){let c;if(!a.trim())return;try{c=JSON.parse(a)}catch{throw Error(b.invalidJson)}if(!c||"object"!=typeof c||Array.isArray(c))throw Error(b.notObject);let d={};for(let a of["appId","tenantId","agentId","runId"]){let e=c[a],f="string"==typeof e?e.trim():"";if(!f||"*"===f)throw Error(b.fieldRequired(a));d[a]=f}return d}(P,{invalidJson:h("memory.search.contextScopeInvalidJson"),notObject:h("memory.search.contextScopeNotObject"),fieldRequired:a=>h("memory.search.contextScopeFieldRequired",{field:a})}),metadata:(0,i.parseJsonObject)(R)},c=new URLSearchParams(u);c.set("q",b.query),c.set("topK",String(b.topK)),c.set("rerank",String(b.enableRerank)),c.set("evidence",String(b.includeEvidence)),c.set("minSimilarity",String(b.minSimilarity)),c.set("minScore",String(b.minScore)),b.filter?c.set("filter",JSON.stringify(b.filter)):c.delete("filter"),P.trim()?c.set("contextScope",P.trim()):c.delete("contextScope"),R.trim()?c.set("metadata",R.trim()):c.delete("metadata"),k.replace(`${t}?${c.toString()}`,{scroll:!1}),await g(b)}catch(a){U(a instanceof Error?a.message:h("memory.search.failed"))}}return aa?ab&&(ae=h("memory.search.queryRequired")):(ae=e&&X?h("memory.search.exactScopeRequiredHint"):h("memory.search.scopeRequiredHint"),af=!0),(0,b.jsxs)("form",{onSubmit:ag,className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:h("memory.search.title")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("memory.search.intro")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(p.Label,{children:h("memory.search.queryLabel")}),(0,b.jsx)(q.Textarea,{value:w,onChange:a=>x(a.target.value),placeholder:h("memory.search.queryPlaceholder"),rows:4})]}),ae?(0,b.jsx)("p",{className:af?"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200":"text-xs text-muted-foreground",children:ae}):null,aa&&!ab&&ad?(0,b.jsx)("p",{className:"text-xs text-[hsl(var(--destructive))]",children:ad}):null,T?(0,b.jsx)("p",{className:"text-sm text-[hsl(var(--destructive))]",children:T}):null,(0,b.jsx)("div",{className:"sticky top-0 z-10 -mx-1 rounded-md bg-card/95 p-1 backdrop-blur",children:(0,b.jsx)(m.Button,{type:"submit",className:"w-full",disabled:f||null!==ad,children:f?h("memory.search.searching"):h("memory.search.submit")})}),(0,b.jsxs)(r.Collapsible,{open:V,onOpenChange:W,children:[(0,b.jsx)(r.CollapsibleTrigger,{asChild:!0,children:(0,b.jsxs)(m.Button,{type:"button",variant:"outline",className:"w-full justify-between",children:[(0,b.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,b.jsx)(l,{className:"h-4 w-4"}),h("memory.search.advancedOptions")]}),(0,b.jsx)(j.ChevronDown,{className:`h-4 w-4 transition-transform ${V?"rotate-180":""}`})]})}),(0,b.jsxs)(r.CollapsibleContent,{forceMount:!0,className:"space-y-4 pt-4",children:[(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(p.Label,{children:"Top K"}),(0,b.jsx)(o.Input,{type:"number",min:1,max:50,value:y,onChange:a=>z(a.target.value)})]}),(0,b.jsx)("div",{className:"flex items-end pb-1",children:(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(n.Checkbox,{checked:B,onCheckedChange:a=>C(!0===a)}),h("memory.search.enableRerank")]})})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(p.Label,{children:h("memory.search.minSimilarity")}),(0,b.jsx)(o.Input,{type:"number",min:0,max:1,step:.05,value:J,onChange:a=>K(a.target.value)}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h("memory.search.minSimilarityHelp")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(p.Label,{children:h("memory.search.minScore")}),(0,b.jsx)(o.Input,{type:"number",min:0,max:1,step:.05,value:L,onChange:a=>M(a.target.value)}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h("memory.search.minScoreHelp")})]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(n.Checkbox,{checked:E,onCheckedChange:a=>I(!0===a)}),h("memory.search.includeEvidence")]}),(0,b.jsx)(D,{initialFilter:N,onChange:O}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(p.Label,{children:h("memory.search.contextScope")}),(0,b.jsx)(q.Textarea,{value:P,onChange:a=>Q(a.target.value),placeholder:'{"appId":"app-001","tenantId":"tenant-001","agentId":"assistant","runId":"session-001"}',rows:4}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h("memory.search.contextScopeHelp")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(p.Label,{children:h("memory.search.metadataFilter")}),(0,b.jsx)(q.Textarea,{value:R,onChange:a=>S(a.target.value),placeholder:'{"source":"dashboard"}',rows:4})]})]})]})]})}var I=a.i(147845),J=a.i(219974);let K=(0,k.default)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);var L=a.i(521989),M=a.i(473524),N=a.i(310215),O=a.i(69088),P=a.i(796572);function Q(a,b="zh"){return(0,P.formatDateTime)(a,b,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function R({response:a,elapsedMs:c,scopeBlocked:d=!1,onChooseScope:e}){let{t:f,locale:g}=(0,s.useI18n)(),h=f("memory.search.resultCreatedAtHint");if(!a)return d?(0,b.jsx)(N.EmptyState,{icon:I.Brain,title:f("memory.search.chooseScopeTitle"),description:f("memory.search.chooseScopeDescription"),action:e?(0,b.jsx)(m.Button,{type:"button",variant:"outline",onClick:e,children:f("memory.search.chooseScopeAction")}):void 0}):(0,b.jsx)(N.EmptyState,{icon:I.Brain,title:f("memory.search.notSearchedTitle"),description:f("memory.search.notSearchedDescription")});let j=a.results??[],k=a.fileResults??[],l=a.evidence??[];return j.length||k.length||l.length?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:f("memory.search.resultsSummary",{memories:j.length,files:k.length,evidence:l.length})}),void 0!==c&&(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:[c," ms"]})]}),j.length>0&&(0,b.jsx)(S,{title:f("memory.search.structuredResults"),icon:(0,b.jsx)(I.Brain,{className:"h-4 w-4"}),children:j.map((a,c)=>(0,b.jsx)(M.Card,{children:(0,b.jsxs)(M.CardContent,{className:"space-y-3 p-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[void 0!==a.similarity&&(0,b.jsx)(L.Badge,{variant:"secondary",children:f("memory.search.similarity",{value:a.similarity.toFixed(4)})}),void 0!==a.score&&(0,b.jsx)(L.Badge,{variant:"outline",children:f("memory.search.relevance",{value:a.score.toFixed(4)})}),a.source&&(0,b.jsx)(L.Badge,{variant:"outline",children:a.source}),void 0!==a.rankingScore&&(0,b.jsx)(L.Badge,{variant:"secondary",children:f("memory.search.rankingScore",{value:a.rankingScore.toFixed(4)})}),a.rankingSignals?.sameSession!==void 0&&(0,b.jsx)(L.Badge,{variant:"outline",children:f("memory.search.rankingSignals",{session:a.rankingSignals.sameSession?f("memory.search.sameSession"):f("memory.search.otherSession"),weight:(a.rankingSignals.sessionAffinityWeight??0).toFixed(4)})}),a.unit.unit_type&&(0,b.jsx)(L.Badge,{variant:"outline",children:a.unit.unit_type})]}),(0,b.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:a.unit.text}),(0,b.jsxs)("div",{className:"space-y-2 text-xs text-muted-foreground",children:[(0,b.jsx)(O.CopyableId,{value:a.unit.id??a.unit.memoryId,label:"ID"}),(0,b.jsx)("span",{className:"block min-w-0 break-words",children:f("memory.search.resultScope",{scope:(0,i.formatScope)(a.unit.scope)})}),(0,b.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,b.jsx)("span",{title:h,children:f("memory.search.resultCreatedAt",{time:Q(a.unit.created_at??a.unit.createdAt,g)})}),(0,b.jsx)("span",{children:f("memory.search.resultVersion",{version:a.unit.version??"-"})})]})]})]})},`${a.unit.id??a.unit.memoryId??c}-${c}`))}),k.length>0&&(0,b.jsx)(S,{title:f("memory.search.fileResults"),icon:(0,b.jsx)(J.FileText,{className:"h-4 w-4"}),children:k.map((a,c)=>(0,b.jsx)(T,{hit:a},`${a.itemId}:${a.versionId??""}-${c}`))}),l.length>0&&(0,b.jsx)(S,{title:f("memory.search.evidenceResults"),icon:(0,b.jsx)(K,{className:"h-4 w-4"}),children:l.map((a,c)=>(0,b.jsx)(M.Card,{children:(0,b.jsxs)(M.CardContent,{className:"space-y-2 p-4",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[void 0!==a.score&&(0,b.jsx)(L.Badge,{variant:"outline",children:f("memory.search.relevance",{value:a.score.toFixed(4)})}),void 0!==a.similarity&&(0,b.jsx)(L.Badge,{variant:"secondary",children:f("memory.search.similarity",{value:a.similarity.toFixed(4)})}),a.source&&(0,b.jsx)(L.Badge,{variant:"outline",children:a.source})]}),(0,b.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:a.unit.text}),(0,b.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[a.unit.scope?(0,b.jsx)("span",{className:"block break-words",children:f("memory.search.resultScope",{scope:(0,i.formatScope)(a.unit.scope)})}):null,a.unit.created_at||a.unit.createdAt?(0,b.jsx)("span",{className:"block",title:h,children:f("memory.search.resultCreatedAt",{time:Q(a.unit.created_at??a.unit.createdAt,g)})}):null]})]})},`evidence-${a.unit.id??c}-${c}`))})]}):(0,b.jsx)(N.EmptyState,{icon:I.Brain,title:f("memory.search.noResultsTitle"),description:f("memory.search.noResultsDescription")})}function S({title:a,icon:c,children:d}){return(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsxs)("h4",{className:"flex items-center gap-2 text-sm font-semibold",children:[c,a]}),(0,b.jsx)("div",{className:"space-y-3",children:d})]})}function T({hit:a}){let{t:c}=(0,s.useI18n)();return(0,b.jsx)(M.Card,{children:(0,b.jsxs)(M.CardContent,{className:"space-y-3 p-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(L.Badge,{variant:"secondary",children:a.type}),void 0!==a.similarity&&(0,b.jsx)(L.Badge,{variant:"outline",children:c("memory.search.similarity",{value:a.similarity.toFixed(4)})}),void 0!==a.score&&(0,b.jsx)(L.Badge,{variant:"outline",children:c("memory.search.relevance",{value:a.score.toFixed(4)})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-mono text-sm font-medium",children:a.path}),a.summary&&(0,b.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-sm text-muted-foreground",children:a.summary})]}),(0,b.jsxs)("div",{className:"grid min-w-0 gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[(0,b.jsx)(O.CopyableId,{value:a.itemId,label:"ID"}),(0,b.jsx)("span",{children:c("memory.search.fileVersion",{version:a.versionId??"-"})})]})]})})}var U=a.i(99443);a.s(["default",0,function(){let{t:a}=(0,s.useI18n)(),j=(0,d.useParams)(),k=(0,d.useSearchParams)(),l=decodeURIComponent(j.store),m=k.toString(),n=(0,c.useMemo)(()=>(0,i.buildMemoryScope)(new URLSearchParams(m)),[m]),o=(0,f.useMutation)({mutationFn:a=>(0,g.searchMemory)(a)}),p=(0,h.useMemoryStore)(l),q=!p.data||"managed-file"===p.data.storageMode||"file+ots"===p.data.storageMode,r=(0,i.hasSearchableScope)(n)&&(!q||(0,i.hasPreciseScope)(n)),[t,u]=(0,c.useState)(null),[v,w]=(0,c.useState)(),x=(0,c.useRef)(null),y=JSON.stringify([l,n.appId,n.tenantId??"",n.agentId??"",n.runId??""]),z=(0,c.useRef)(y),A=(0,c.useRef)(0);async function B(b){let c=A.current+1;A.current=c;let d=Date.now();u(null),w(void 0);try{let a=await o.mutateAsync({memoryStoreName:l,query:b.query,scope:b.scope,topK:b.topK,enableRerank:b.enableRerank,includeEvidence:b.includeEvidence,...b.filter?{filter:b.filter}:{},...b.contextScope?{contextScope:b.contextScope}:{},...b.minSimilarity>0||b.minScore>0?{thresholds:{...b.minSimilarity>0?{minSimilarity:b.minSimilarity}:{},...b.minScore>0?{minScore:b.minScore}:{}}}:{},...b.metadata?{metadata:b.metadata}:{}});if(z.current!==y||A.current!==c)return;u({...a,results:a.results??[],fileResults:a.fileResults??[],evidence:a.evidence??[]}),w(Date.now()-d),requestAnimationFrame(()=>{x.current?.scrollTo({top:0,behavior:"smooth"})})}catch(b){if(A.current!==c)return;e.toast.error(b instanceof Error?b.message:a("memory.search.failed"))}}return(0,c.useEffect)(()=>{z.current=y,A.current+=1,u(null),w(void 0)},[y]),(0,b.jsx)(U.WorkbenchLayout,{asideWidth:400,aside:(0,b.jsx)(H,{scope:n,requiresExactScope:q,isLoading:o.isPending||p.isPending,onSubmit:B}),children:(0,b.jsx)("div",{ref:x,className:"min-h-0 flex-1 overflow-y-auto px-7 py-5 max-md:px-4",children:(0,b.jsx)(R,{response:t,elapsedMs:v,scopeBlocked:!p.isPending&&!r,onChooseScope:()=>document.getElementById("memory-scope-bar")?.scrollIntoView({behavior:"smooth",block:"center"})})})})}],421458)}];
2
+
3
+ //# sourceMappingURL=dashboard_src_app_%28dashboard%29_memory_%5Bstore%5D_search_page_tsx_0rj3dkc._.js.map