@tablestore/tablestore-agent-cli 0.2.10 → 0.3.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 (618) hide show
  1. package/dist/commands/dashboard.d.ts.map +1 -1
  2. package/dist/commands/dashboard.js +3 -0
  3. package/dist/commands/dashboard.js.map +1 -1
  4. package/dist/commands/doctor.d.ts.map +1 -1
  5. package/dist/commands/doctor.js +10 -11
  6. package/dist/commands/doctor.js.map +1 -1
  7. package/dist/commands/memory-items.d.ts +3 -0
  8. package/dist/commands/memory-items.d.ts.map +1 -0
  9. package/dist/commands/memory-items.js +375 -0
  10. package/dist/commands/memory-items.js.map +1 -0
  11. package/dist/commands/memory.d.ts.map +1 -1
  12. package/dist/commands/memory.js +133 -122
  13. package/dist/commands/memory.js.map +1 -1
  14. package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
  15. package/dist/dashboard-runtime/dashboard/.next/app-path-routes-manifest.json +2 -3
  16. package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +3 -3
  17. package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
  18. package/dist/dashboard-runtime/dashboard/.next/required-server-files.json +4 -4
  19. package/dist/dashboard-runtime/dashboard/.next/routes-manifest.json +11 -20
  20. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page.js.nft.json +1 -1
  21. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page_client-reference-manifest.js +1 -1
  22. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  23. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  24. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
  25. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
  26. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
  27. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
  28. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
  29. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
  30. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
  31. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
  32. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
  33. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
  34. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
  35. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
  36. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
  37. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
  38. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
  39. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
  40. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
  41. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
  42. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  43. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  44. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page.js.nft.json +1 -1
  45. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page_client-reference-manifest.js +1 -1
  46. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page.js.nft.json +1 -1
  47. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page_client-reference-manifest.js +1 -1
  48. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
  49. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
  50. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
  51. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
  52. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
  53. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
  54. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
  55. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
  56. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
  57. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
  58. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page.js.nft.json +1 -1
  59. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page_client-reference-manifest.js +1 -1
  60. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
  61. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
  62. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
  63. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
  64. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
  65. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  66. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  67. package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  68. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
  69. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
  70. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  71. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  72. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  73. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  74. package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  75. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +16 -16
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js +2 -2
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js.nft.json +1 -1
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js +2 -2
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js.nft.json +1 -1
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js +2 -2
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js.nft.json +1 -1
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js +2 -2
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js.nft.json +1 -1
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js +2 -2
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js.nft.json +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js +2 -2
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js.nft.json +1 -1
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js +2 -2
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js +2 -2
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js +2 -2
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js +2 -2
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js +2 -2
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route/app-paths-manifest.json +3 -0
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js +6 -0
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js.nft.json +1 -0
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route_client-reference-manifest.js +3 -0
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js +2 -2
  112. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  113. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js +2 -2
  114. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  115. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js +2 -2
  116. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  117. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js +2 -2
  118. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  119. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js +2 -2
  120. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  121. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js +2 -2
  122. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  123. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js +2 -2
  124. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  125. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js +4 -4
  126. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  127. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js +2 -2
  128. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  129. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js +2 -2
  130. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  131. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js +2 -2
  132. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  133. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js +2 -2
  134. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  135. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js +2 -2
  136. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  137. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js +2 -2
  138. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  139. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js +2 -2
  140. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
  141. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js +2 -2
  142. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js.nft.json +1 -1
  143. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js +2 -2
  144. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js.nft.json +1 -1
  145. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js +2 -2
  146. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js.nft.json +1 -1
  147. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js +2 -2
  148. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js.nft.json +1 -1
  149. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js +2 -2
  150. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js.nft.json +1 -1
  151. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js +2 -2
  152. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js.nft.json +1 -1
  153. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route/app-paths-manifest.json +3 -0
  154. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route.js +6 -0
  155. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{sync → [action]}/route.js.nft.json +1 -1
  156. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route_client-reference-manifest.js +3 -0
  157. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js +2 -2
  158. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
  159. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js +2 -2
  160. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
  161. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js +2 -2
  162. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
  163. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js +2 -2
  164. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js.nft.json +1 -1
  165. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js +2 -2
  166. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
  167. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js +2 -2
  168. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js.nft.json +1 -1
  169. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js +2 -2
  170. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js.nft.json +1 -1
  171. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js +2 -2
  172. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
  173. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js +2 -2
  174. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
  175. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js +2 -2
  176. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
  177. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js +2 -2
  178. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -1
  179. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js +2 -2
  180. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
  181. package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
  182. package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +15 -15
  183. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  184. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +15 -15
  185. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +3 -3
  186. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +11 -11
  187. package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  188. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js.nft.json +1 -1
  189. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  190. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
  191. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +18 -18
  192. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +18 -18
  193. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +3 -3
  194. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +11 -11
  195. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  196. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  197. package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +4 -4
  198. package/dist/dashboard-runtime/dashboard/.next/server/app/page.js.nft.json +1 -1
  199. package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  200. package/dist/dashboard-runtime/dashboard/.next/server/app-paths-manifest.json +2 -3
  201. package/dist/dashboard-runtime/dashboard/.next/server/chunks/05a2_app_api_v1_memory_stores_[store]_file-memory_[action]_route_actions_0m70if_.js +3 -0
  202. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0e95__next-internal_server_app_api_v1_instances_connectivity_route_actions_0hc.k~w.js +3 -0
  203. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +19 -12
  204. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0--nu07._.js +3 -0
  205. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-pbmiq._.js +3 -0
  206. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-wmyic._.js +40 -0
  207. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.gylau._.js +3 -0
  208. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.hvkwy._.js +3 -0
  209. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.li3cj._.js +40 -0
  210. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.qtdn4._.js +3 -0
  211. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02p1x3t._.js +3 -0
  212. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__03og44p._.js +3 -0
  213. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04dd04u._.js +3 -0
  214. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04ujbw-._.js +3 -0
  215. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04zbudf._.js +3 -0
  216. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__0-3~.bv._.js → [root-of-the-server]__052epg.._.js} +3 -3
  217. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05eryp~._.js +3 -0
  218. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06fva9g._.js +3 -0
  219. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08_2avk._.js +3 -0
  220. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0acvvri._.js +3 -0
  221. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0byveuc._.js +3 -0
  222. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cee_lo._.js +3 -0
  223. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cyd2qb._.js +3 -0
  224. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ecs-9r._.js +3 -0
  225. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ejcow5._.js +3 -0
  226. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0es0s_~._.js +3 -0
  227. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0fglxiw._.js +3 -0
  228. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0g3yw6w._.js +3 -0
  229. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0i1_p1s._.js +3 -0
  230. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0is6qso._.js +3 -0
  231. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0no9qm0._.js +3 -0
  232. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q8vcw8._.js +3 -0
  233. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q9fgt6._.js +3 -0
  234. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0rx9hon._.js +3 -0
  235. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__089es3y._.js → [root-of-the-server]__0sa.9zr._.js} +10 -10
  236. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0tc-.6s._.js +3 -0
  237. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0u03tze._.js +3 -0
  238. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ua_nqs._.js +3 -0
  239. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0uebf40._.js +3 -0
  240. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0v0il3n._.js +3 -0
  241. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0w_ig2a._.js +3 -0
  242. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0y0w3mg._.js +3 -0
  243. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zmo~nd._.js +3 -0
  244. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__10m-wmo._.js +3 -0
  245. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11s_zx6._.js +3 -0
  246. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11wq90l._.js +3 -0
  247. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__126srko._.js +3 -0
  248. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12e1t6o._.js +3 -0
  249. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12ylr4n._.js +3 -0
  250. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13g_f9w._.js +3 -0
  251. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13q2wbt._.js +3 -0
  252. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13~-fxp._.js +3 -0
  253. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +1 -1
  254. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0.ooo1s._.js +3 -0
  255. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07fsbff._.js +3 -0
  256. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0b5cw4e._.js +3 -0
  257. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0p1cst6._.js +3 -0
  258. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0xza7lz._.js +3 -0
  259. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.6x0yu._.js +3 -0
  260. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.pa1e6._.js +3 -0
  261. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01snuz~._.js +3 -0
  262. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0251rsp._.js +1 -1
  263. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_02waf76._.js +1 -1
  264. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06_hoj_._.js +3 -0
  265. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0_aw2vr._.js +3 -0
  266. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0brqbty._.js +1 -1
  267. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0csuit-._.js +3 -0
  268. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ep_q37._.js +3 -0
  269. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0eps5jg._.js +3 -0
  270. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ez3yia._.js +3 -0
  271. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fttf6a._.js +3 -0
  272. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fz3kge._.js +3 -0
  273. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0hx2079._.js +3 -0
  274. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0k7q0ug._.js +3 -0
  275. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0oiggmj._.js +3 -0
  276. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0p0sh02._.js +3 -0
  277. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0pwlb77._.js +3 -0
  278. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0t.h859._.js +1 -1
  279. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0thp9l5._.js +3 -0
  280. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0uc_gmf._.js +3 -0
  281. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0wce254._.js +3 -0
  282. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ww5s91._.js +3 -0
  283. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0y4mxf8._.js +3 -0
  284. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12l8jkb._.js +3 -0
  285. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_079nj-_._.js +3 -0
  286. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0_z9696._.js +3 -0
  287. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0grv2wq._.js +1 -1
  288. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0jrh7xy._.js +3 -0
  289. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0x60pxf._.js +1 -1
  290. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
  291. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
  292. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_api-keys_page_tsx_0lb6fu7._.js +1 -1
  293. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_[dreamId]_page_tsx_0wy3tv6._.js +1 -1
  294. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_page_tsx_0uzzpvs._.js +1 -1
  295. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_layout_tsx_0rbi41w._.js +1 -1
  296. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_messages_page_tsx_0votz-n._.js +1 -1
  297. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_tasks_page_tsx_0a_bgx4._.js +1 -1
  298. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
  299. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_memory_memory-files-browser_tsx_0o2~94-._.js +3 -0
  300. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_i18n_i18n-context_tsx_0c39ewr._.js +1 -1
  301. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_providers_runtime-context-provider_tsx_0wmj66z._.js +1 -1
  302. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0ymj2~2._.js +3 -0
  303. package/dist/dashboard-runtime/dashboard/.next/server/functions-config-manifest.json +2 -3
  304. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +3 -3
  305. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  306. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  307. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  308. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  309. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-xwobg-a6si1.js +1 -0
  310. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.hi0qmo.f-h4.js +1 -0
  311. package/dist/dashboard-runtime/dashboard/.next/static/chunks/01bokygf48bnj.js +1 -0
  312. package/dist/dashboard-runtime/dashboard/.next/static/chunks/026lyw-ynx1og.js +1 -0
  313. package/dist/dashboard-runtime/dashboard/.next/static/chunks/04a.1c2rygy08.js +1 -0
  314. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05.2q9f0yx4e_.js +1 -0
  315. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05_iqjh-v2gej.js +1 -0
  316. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05f4mjbi6x-tm.js +1 -0
  317. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07twdccs42b_-.js +1 -0
  318. package/dist/dashboard-runtime/dashboard/.next/static/chunks/090n1_814n.n~.js +1 -0
  319. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09v-qczj__g1x.js +1 -0
  320. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{08nzc9sye_0~h.js → 0_8~9zgfm5f.8.js} +1 -1
  321. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0_zw2y~vb_52n.js +1 -0
  322. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0a2f-mxepv-y7.js +1 -0
  323. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0amex7bwxnme9.js +1 -0
  324. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0apfhv-v7oy7u.js +1 -0
  325. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0bxt5icwb83xt.js +1 -0
  326. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dpi1comd-thc.js +1 -0
  327. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0eafb9pun~54k.js +9 -0
  328. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{010bpq~3ntjcm.js → 0eerrv808~6bh.js} +1 -1
  329. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j6agpotrd_n4.js +1 -0
  330. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jbcdgtcgqemd.js +1 -0
  331. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jp7zmwvyv0bn.js +1 -0
  332. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k8mhea24d_kj.js +1 -0
  333. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0krt75we1wtcy.js +1 -0
  334. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0l~3_bvic.da3.js → 0ogrq_r43je48.js} +1 -1
  335. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0prl9yrb8ksp8.js +1 -0
  336. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0r4azm.3hswcs.js +138 -0
  337. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0r6utd8g~.cc1.js +1 -0
  338. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6c8q4k~6aiy.js +1 -0
  339. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0uj7ezedkm6ou.css +1 -0
  340. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0uu2cjfwvbn3y.js +1 -0
  341. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x5qtkdg2trq9.js +5 -0
  342. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yvc~t7p88wsf.js +1 -0
  343. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0zhfdjby7cj-q.js +1 -0
  344. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{02u9ocsl0a12t.js → 0~naqbx3873~r.js} +1 -1
  345. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0~a4ig2x9z8uq.js → 13__t3s3ipfzl.js} +1 -1
  346. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14.8mq880kjoc.js +1 -0
  347. package/dist/dashboard-runtime/dashboard/.next/static/chunks/145hqnc~4wc~n.js +1 -0
  348. package/dist/dashboard-runtime/dashboard/.next/static/chunks/14rpr3z1.lmgj.js +1 -0
  349. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16uky1ro-t_~9.js +1 -0
  350. package/dist/dashboard-runtime/dashboard/.next/static/chunks/18absak_u0d85.js +138 -0
  351. package/dist/dashboard-runtime/dashboard/server.js +1 -1
  352. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/page.tsx +1 -0
  353. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/qa/page.tsx +1 -0
  354. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/[dreamId]/page.tsx +187 -2
  355. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/page.tsx +14 -1
  356. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/layout.tsx +59 -8
  357. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/page.tsx +15 -0
  358. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/tasks/page.tsx +9 -0
  359. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +123 -24
  360. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/page.tsx +3 -0
  361. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/connectivity/route.ts +66 -0
  362. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-curator.ts +496 -0
  363. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-helpers.ts +12 -81
  364. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/memory-helpers.ts +3 -3
  365. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +200 -39
  366. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.ts +39 -6
  367. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/[action]/route.ts +86 -0
  368. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/_helpers.ts +26 -36
  369. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/_request.ts +49 -0
  370. package/dist/dashboard-runtime/dashboard/src/app/onboarding/page.tsx +1 -3
  371. package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +48 -9
  372. package/dist/dashboard-runtime/dashboard/src/components/chat/memory-bind-section.tsx +66 -18
  373. package/dist/dashboard-runtime/dashboard/src/components/chat/memory-files-dialog.tsx +1 -1
  374. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-picker.tsx +5 -1
  375. package/dist/dashboard-runtime/dashboard/src/components/instance/instance-connectivity-dot.tsx +96 -0
  376. package/dist/dashboard-runtime/dashboard/src/components/instance/project-card.tsx +5 -1
  377. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-gate.tsx +23 -5
  378. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-switcher.tsx +23 -5
  379. package/dist/dashboard-runtime/dashboard/src/components/layout/instance-switcher.tsx +13 -1
  380. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-instance-card.tsx +29 -4
  381. package/dist/dashboard-runtime/dashboard/src/components/memory/file-details-panel.tsx +91 -0
  382. package/dist/dashboard-runtime/dashboard/src/components/memory/file-editor.tsx +144 -0
  383. package/dist/dashboard-runtime/dashboard/src/components/memory/file-mutation-dialogs.tsx +181 -0
  384. package/dist/dashboard-runtime/dashboard/src/components/memory/file-scope-onboarding.tsx +154 -0
  385. package/dist/dashboard-runtime/dashboard/src/components/memory/file-version-history.tsx +251 -0
  386. package/dist/dashboard-runtime/dashboard/src/components/memory/file-workspace-toolbar.tsx +101 -0
  387. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-create-form.tsx +166 -75
  388. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-create-dialog.tsx +385 -73
  389. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-plan-approval-dialog.tsx +172 -0
  390. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-files-browser.tsx +500 -168
  391. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +230 -72
  392. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +51 -14
  393. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +5 -1
  394. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-settings-form.tsx +54 -46
  395. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +126 -69
  396. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +5 -1
  397. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-combobox.tsx +169 -42
  398. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +233 -38
  399. package/dist/dashboard-runtime/dashboard/src/components/shared/error-state.tsx +3 -2
  400. package/dist/dashboard-runtime/dashboard/src/components/shared/llm-model-selector.tsx +5 -1
  401. package/dist/dashboard-runtime/dashboard/src/components/ui/dialog.tsx +1 -1
  402. package/dist/dashboard-runtime/dashboard/src/contexts/subspace-context.tsx +144 -30
  403. package/dist/dashboard-runtime/dashboard/src/hooks/use-approve-dream-plan.ts +25 -0
  404. package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +125 -47
  405. package/dist/dashboard-runtime/dashboard/src/hooks/use-file-memory.ts +185 -29
  406. package/dist/dashboard-runtime/dashboard/src/hooks/use-instances.ts +40 -0
  407. package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-store-scopes.ts +2 -1
  408. package/dist/dashboard-runtime/dashboard/src/hooks/use-qa-chat.ts +188 -23
  409. package/dist/dashboard-runtime/dashboard/src/hooks/use-subspace-history.ts +64 -75
  410. package/dist/dashboard-runtime/dashboard/src/i18n/locales/en.ts +198 -14
  411. package/dist/dashboard-runtime/dashboard/src/i18n/locales/zh.ts +188 -14
  412. package/dist/dashboard-runtime/dashboard/src/lib/api-error-toast.ts +9 -1
  413. package/dist/dashboard-runtime/dashboard/src/lib/browser-file-memory.ts +397 -0
  414. package/dist/dashboard-runtime/dashboard/src/lib/file-scope-history.ts +108 -0
  415. package/dist/dashboard-runtime/dashboard/src/lib/memory-scope-history.ts +165 -0
  416. package/dist/dashboard-runtime/dashboard/src/lib/memory-storage-mode.ts +193 -31
  417. package/dist/dashboard-runtime/dashboard/src/lib/memory.ts +29 -4
  418. package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +63 -0
  419. package/dist/dashboard-runtime/dashboard/src/lib/server/api-helpers.ts +5 -0
  420. package/dist/dashboard-runtime/dashboard/src/lib/server/instance-connectivity.ts +136 -0
  421. package/dist/dashboard-runtime/dashboard/src/lib/server/sdk-client.ts +25 -3
  422. package/dist/dashboard-runtime/dashboard/src/lib/subspace-history.ts +151 -0
  423. package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +58 -13
  424. package/dist/dashboard-runtime/dashboard/src/services/file-memory.ts +80 -46
  425. package/dist/dashboard-runtime/dashboard/src/services/instances.ts +5 -0
  426. package/dist/dashboard-runtime/dashboard/src/services/memory.ts +45 -5
  427. package/dist/dashboard-runtime/dashboard/src/types/file-memory.ts +150 -0
  428. package/dist/dashboard-runtime/dashboard/src/types/instance.ts +17 -0
  429. package/dist/dashboard-runtime/dashboard/src/types/llm-chat.ts +49 -13
  430. package/dist/dashboard-runtime/dashboard/src/types/memory.ts +59 -5
  431. package/dist/dashboard-runtime/dashboard/tsconfig.tsbuildinfo +1 -0
  432. package/dist/dashboard-runtime/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  433. package/dist/dashboard-runtime/node_modules/@img/{sharp-linux-x64 → sharp-darwin-arm64}/package.json +7 -13
  434. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/README.md +2 -2
  435. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/lib/glib-2.0/include/glibconfig.h +8 -9
  436. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 → sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib} +0 -0
  437. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/package.json +5 -11
  438. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +0 -1
  439. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
  440. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +0 -1
  441. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
  442. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +9 -8
  443. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  444. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +24 -10
  445. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  446. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  447. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +5 -1
  448. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  449. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  450. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/package.json +1 -1
  451. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  452. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  453. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +0 -1
  454. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
  455. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +0 -1
  456. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
  457. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +9 -8
  458. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  459. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +24 -10
  460. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  461. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  462. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +5 -1
  463. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  464. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  465. package/dist/node_modules/@tablestore/tablestore-agent-sdk/package.json +1 -1
  466. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  467. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
  468. package/package.json +3 -3
  469. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route/app-paths-manifest.json +0 -3
  470. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route.js +0 -6
  471. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route.js.nft.json +0 -1
  472. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route_client-reference-manifest.js +0 -3
  473. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route/app-paths-manifest.json +0 -3
  474. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route.js +0 -6
  475. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route_client-reference-manifest.js +0 -3
  476. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/app-paths-manifest.json +0 -3
  477. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/build-manifest.json +0 -9
  478. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/server-reference-manifest.json +0 -4
  479. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js +0 -6
  480. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js.map +0 -5
  481. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js.nft.json +0 -1
  482. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route_client-reference-manifest.js +0 -3
  483. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_file-memory_file_route_actions_06~k01v.js +0 -3
  484. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_file-memory_sync_route_actions_0rt6p8e.js +0 -3
  485. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0ndq_server_app_api_v1_memory_stores_[store]_file-memory_tree_route_actions_0wl_n8b.js +0 -3
  486. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-dt7~s._.js +0 -3
  487. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.-~ff4._.js +0 -3
  488. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.l706t._.js +0 -3
  489. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.nejw_._.js +0 -3
  490. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00_mrad._.js +0 -3
  491. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00i.7se._.js +0 -3
  492. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00r7uqs._.js +0 -3
  493. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02~yw7n._.js +0 -3
  494. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04kpzpa._.js +0 -3
  495. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04p1a88._.js +0 -3
  496. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05x0k4d._.js +0 -3
  497. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__060s~oe._.js +0 -3
  498. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06fanvv._.js +0 -3
  499. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06tci88._.js +0 -3
  500. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08bzgzm._.js +0 -3
  501. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08d7wb.._.js +0 -3
  502. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08p_m_c._.js +0 -3
  503. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__095xiwn._.js +0 -3
  504. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__09h95i6._.js +0 -3
  505. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ai2k_o._.js +0 -40
  506. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0alcygi._.js +0 -3
  507. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0aspytx._.js +0 -3
  508. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cq-9s~._.js +0 -3
  509. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cyiuai._.js +0 -3
  510. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0d4zrpj._.js +0 -3
  511. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0d~m09k._.js +0 -3
  512. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0f1lugp._.js +0 -3
  513. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0g1cfb7._.js +0 -40
  514. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0gpz.~y._.js +0 -3
  515. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0i3u9x3._.js +0 -3
  516. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0iromt6._.js +0 -3
  517. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0j8.u0y._.js +0 -3
  518. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0k-pfaj._.js +0 -3
  519. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0kcbz7k._.js +0 -3
  520. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0nrl-.g._.js +0 -3
  521. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0o5mf4h._.js +0 -3
  522. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0omyr40._.js +0 -3
  523. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ty8jgt._.js +0 -3
  524. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ug_2kc._.js +0 -3
  525. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0v98i9~._.js +0 -3
  526. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0wt0ksb._.js +0 -3
  527. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ya_8d2._.js +0 -3
  528. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zfg-ml._.js +0 -3
  529. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0~9ru5n._.js +0 -3
  530. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0~f7ckz._.js +0 -3
  531. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__109i6ps._.js +0 -3
  532. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__10o5zq5._.js +0 -3
  533. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12ls5l8._.js +0 -3
  534. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0w-2_lucide-react_dist_esm_icons_0h-3_0x._.js +0 -3
  535. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0k0es2c._.js +0 -3
  536. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ky8i.~._.js +0 -3
  537. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ocsrt0._.js +0 -3
  538. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ys4x_n._.js +0 -3
  539. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__10rkv6z._.js +0 -3
  540. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_002mc1c._.js +0 -3
  541. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_04f2u4t._.js +0 -3
  542. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06ny.4k._.js +0 -3
  543. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0b9pl2d._.js +0 -3
  544. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0e.ehti._.js +0 -3
  545. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f8moq0._.js +0 -3
  546. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f8yv4v._.js +0 -3
  547. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fvg_xo._.js +0 -3
  548. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0h9c.8m._.js +0 -3
  549. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ip4ncy._.js +0 -3
  550. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0izjcsk._.js +0 -3
  551. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j.62sb._.js +0 -3
  552. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0mdbcju._.js +0 -3
  553. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0p_s55v._.js +0 -3
  554. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0qiamjd._.js +0 -3
  555. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xp94lc._.js +0 -3
  556. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13730cz._.js +0 -3
  557. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13ctfae._.js +0 -3
  558. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00.1.s_._.js +0 -3
  559. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_04o7mfc._.js +0 -3
  560. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0bhjp9s._.js +0 -3
  561. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0qlyj-q._.js +0 -3
  562. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_00usyu3._.js +0 -3
  563. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0791f2k._.js +0 -3
  564. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0--dupndun7xc.css +0 -1
  565. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.uxk~hsm6yi8.js +0 -138
  566. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00eggrx~.4c55.js +0 -1
  567. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00lvoeu_v3253.js +0 -1
  568. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00o9vmhspv._3.js +0 -138
  569. package/dist/dashboard-runtime/dashboard/.next/static/chunks/00x1.t633f041.js +0 -1
  570. package/dist/dashboard-runtime/dashboard/.next/static/chunks/02p7gke47s.2~.js +0 -1
  571. package/dist/dashboard-runtime/dashboard/.next/static/chunks/03dth-av1gl-h.js +0 -1
  572. package/dist/dashboard-runtime/dashboard/.next/static/chunks/07s0f6938um2v.js +0 -1
  573. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09y30vyml4r.b.js +0 -1
  574. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0au0pbejtwahz.js +0 -1
  575. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b-ei8-g7ceug.js +0 -1
  576. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0chiv044h3u58.js +0 -1
  577. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0fcdli-~wmvvx.js +0 -1
  578. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0fz_9~-rxluly.js +0 -1
  579. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0i55cqygnl-a9.js +0 -5
  580. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j8p7vk~awgs..js +0 -1
  581. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j_.hkhjix9hw.js +0 -1
  582. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ll488v66ycn1.js +0 -1
  583. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0naliud7av3p1.js +0 -1
  584. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pbfl~23ac79y.js +0 -9
  585. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u3qx.qasmdx9.js +0 -1
  586. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vuh8jgeqqdy..js +0 -1
  587. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0wbevjtr1_grz.js +0 -1
  588. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0y-gjpq3kxsbz.js +0 -1
  589. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0z_pq4ttgotxw.js +0 -1
  590. package/dist/dashboard-runtime/dashboard/.next/static/chunks/10i~m4_8ainxw.js +0 -1
  591. package/dist/dashboard-runtime/dashboard/.next/static/chunks/12535rmhzbk63.js +0 -1
  592. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13uk2uuzuop5e.js +0 -1
  593. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13vd4hv~l95-c.js +0 -1
  594. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16.2aecdwo6w_.js +0 -1
  595. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16yu0g~7n~33c.js +0 -1
  596. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/file/route.ts +0 -69
  597. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/sync/route.ts +0 -69
  598. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/tree/route.ts +0 -44
  599. package/dist/dashboard-runtime/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  600. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts +0 -153
  601. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts.map +0 -1
  602. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js +0 -451
  603. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js.map +0 -1
  604. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts +0 -153
  605. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts.map +0 -1
  606. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js +0 -451
  607. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js.map +0 -1
  608. /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/{memory/stores/[store]/file-memory/file → instances/connectivity}/route/build-manifest.json +0 -0
  609. /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/{memory/stores/[store]/file-memory/file → instances/connectivity}/route/server-reference-manifest.json +0 -0
  610. /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/{memory/stores/[store]/file-memory/file → instances/connectivity}/route.js.map +0 -0
  611. /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{sync → [action]}/route/build-manifest.json +0 -0
  612. /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{sync → [action]}/route/server-reference-manifest.json +0 -0
  613. /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{sync → [action]}/route.js.map +0 -0
  614. /package/dist/dashboard-runtime/dashboard/.next/static/{5irIRCYtKcYh5T_Bewihp → 8G6beqTEKH_-N0JljpgWT}/_buildManifest.js +0 -0
  615. /package/dist/dashboard-runtime/dashboard/.next/static/{5irIRCYtKcYh5T_Bewihp → 8G6beqTEKH_-N0JljpgWT}/_clientMiddlewareManifest.js +0 -0
  616. /package/dist/dashboard-runtime/dashboard/.next/static/{5irIRCYtKcYh5T_Bewihp → 8G6beqTEKH_-N0JljpgWT}/_ssgManifest.js +0 -0
  617. /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/lib/index.js +0 -0
  618. /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/versions.json +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[325909,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(465173),f=a.i(907704),g=a.i(123028),h=a.i(96193),i=a.i(25825),j=a.i(160318),k=a.i(263265),l=a.i(776192),m=a.i(172518),n=a.i(502482),o=a.i(324567),p=a.i(887617),q=a.i(604395),r=a.i(434841),s=a.i(983366),t=a.i(421347),u=a.i(225377),v=a.i(739096),w=a.i(933596),x=a.i(895487),y=a.i(411697),z=a.i(908264),A=a.i(285540),B=a.i(364565),C=a.i(843836),D=a.i(962491),E=a.i(470535),F=a.i(543320);function G({memoryStoreName:a,scope:d,open:e,onOpenChange:f,onSuccess:g}){let h,i=(h=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>(0,t.addMemory)(a),onSuccess:()=>{(0,u.invalidateMemoryQueries)(h)}})),{t:j}=(0,F.useI18n)(),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)("");async function q(){try{let b=(0,z.parseJsonObject)(o);if(!m.trim())return void k.toast.error(j("memory.add.textRequired"));await i.mutateAsync({memoryStoreName:a,scope:d,text:m.trim(),metadata:b,sync:!1}),k.toast.success(j("memory.add.processing")),n(""),p(""),f(!1),g?.()}catch(a){k.toast.error(a instanceof Error?a.message:j("memory.add.failed"))}}return(0,b.jsx)(C.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(C.DialogContent,{className:"max-w-xl",children:[(0,b.jsx)(C.DialogHeader,{children:(0,b.jsx)(C.DialogTitle,{children:j("memory.add.title")})}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(D.Label,{children:j("memory.add.textLabel")}),(0,b.jsx)(E.Textarea,{value:m,onChange:a=>n(a.target.value),placeholder:j("memory.add.textPlaceholder"),rows:5})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(D.Label,{children:j("memory.add.metadataLabel")}),(0,b.jsx)(E.Textarea,{value:o,onChange:a=>p(a.target.value),placeholder:'{"source":"dashboard"}',rows:3})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:j("memory.add.hint")})]}),(0,b.jsxs)(C.DialogFooter,{children:[(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>f(!1),children:j("common.cancel")}),(0,b.jsx)(l.Button,{onClick:q,disabled:i.isPending,children:i.isPending?j("common.submitting"):j("common.submit")})]})]})})}var H=a.i(87491),I=a.i(112537),J=a.i(655295),K=a.i(223301),L=a.i(796572);function M(a){return a.id??a.memoryId??"-"}let N=(0,c.memo)(function({unit:a,actionDisabled:d,disabledTitle:e,viewTitle:f,editTitle:g,deleteTitle:h,onView:i,onEdit:j,onDelete:k,locale:m}){let n=(0,c.useCallback)(()=>i?.(a),[i,a]),o=(0,c.useCallback)(()=>j?.(a),[j,a]),p=(0,c.useCallback)(()=>k?.(a),[k,a]);return(0,b.jsxs)(K.TableRow,{children:[(0,b.jsx)(K.TableCell,{className:"font-mono text-xs",children:M(a)}),(0,b.jsxs)(K.TableCell,{className:"max-w-[420px]",children:[(0,b.jsx)("p",{className:"line-clamp-2 text-sm",children:a.text}),a.search_text&&(0,b.jsx)("p",{className:"mt-1 line-clamp-1 text-xs text-muted-foreground",children:a.search_text})]}),(0,b.jsx)(K.TableCell,{children:a.unit_type??"-"}),(0,b.jsx)(K.TableCell,{children:a.version??"-"}),(0,b.jsx)(K.TableCell,{className:"text-xs text-muted-foreground",children:function(a,b="zh"){return(0,L.formatDateTime)(a,b,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}(a.created_at??a.createdAt,m)}),(0,b.jsx)(K.TableCell,{children:(0,b.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,b.jsx)(l.Button,{type:"button",variant:"ghost",size:"icon",disabled:d,onClick:n,title:d?e:f,children:(0,b.jsx)(H.Eye,{className:"h-4 w-4"})}),(0,b.jsx)(l.Button,{type:"button",variant:"ghost",size:"icon",disabled:d,onClick:o,title:d?e:g,children:(0,b.jsx)(I.Pencil,{className:"h-4 w-4"})}),(0,b.jsx)(l.Button,{type:"button",variant:"ghost",size:"icon",disabled:d,onClick:p,title:d?e:h,children:(0,b.jsx)(J.Trash2,{className:"h-4 w-4 text-[hsl(var(--destructive))]"})})]})})]})});function O({units:a,readOnly:c=!1,isActionDisabled:d,onView:e,onEdit:f,onDelete:g}){let{t:h,locale:i}=(0,F.useI18n)();return a.length?(0,b.jsx)("div",{className:"rounded-lg border",children:(0,b.jsxs)(K.Table,{children:[(0,b.jsx)(K.TableHeader,{children:(0,b.jsxs)(K.TableRow,{children:[(0,b.jsx)(K.TableHead,{className:"w-[180px]",children:h("memory.units.tableId")}),(0,b.jsx)(K.TableHead,{children:h("memory.units.tableContent")}),(0,b.jsx)(K.TableHead,{className:"w-[140px]",children:h("memory.units.tableType")}),(0,b.jsx)(K.TableHead,{className:"w-[120px]",children:h("memory.units.tableVersion")}),(0,b.jsx)(K.TableHead,{className:"w-[170px]",children:h("memory.units.tableCreatedAt")}),(0,b.jsx)(K.TableHead,{className:"w-[160px] text-right",children:h("memory.units.tableActions")})]})}),(0,b.jsx)(K.TableBody,{children:a.map((a,j)=>{let k=c||d?.(a)||!1,l=M(a);return(0,b.jsx)(N,{unit:a,actionDisabled:k,disabledTitle:h("memory.units.disabledTitle"),viewTitle:h("memory.units.view"),editTitle:h("common.edit"),deleteTitle:h("common.delete"),onView:e,onEdit:f,onDelete:g,locale:i},"-"===l?j:l)})})]})}):(0,b.jsx)("div",{className:"rounded-lg border border-dashed py-12 text-center text-sm text-muted-foreground",children:h("memory.units.emptyUnits")})}function P({memoryStoreName:a,scope:c,unit:d,open:e,onOpenChange:f}){let g,h=(g=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>(0,t.updateMemoryUnit)(a),onSuccess:()=>{(0,u.invalidateMemoryQueries)(g)}})),{t:i}=(0,F.useI18n)(),j=d?M(d):"empty";async function m(b){if(b.preventDefault(),!d)return;let e=M(d);if("-"===e)return void k.toast.error(i("memory.edit.idMissing"));let g=new FormData(b.currentTarget),j=String(g.get("text")??"").trim(),l=String(g.get("metadata")??"");try{await h.mutateAsync({memoryStoreName:a,memoryId:e,scope:c,text:j||void 0,metadata:(0,z.parseJsonObject)(l)}),k.toast.success(i("memory.edit.updateSuccess")),f(!1)}catch(a){k.toast.error(a instanceof Error?a.message:i("memory.edit.updateFailed"))}}return(0,b.jsx)(C.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(C.DialogContent,{className:"max-w-2xl",children:[(0,b.jsx)(C.DialogHeader,{children:(0,b.jsx)(C.DialogTitle,{children:i("memory.edit.title")})}),(0,b.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(D.Label,{children:i("memory.edit.textLabel")}),(0,b.jsx)(E.Textarea,{name:"text",defaultValue:d?.text??"",rows:5})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(D.Label,{children:i("memory.edit.metadataLabel")}),(0,b.jsx)(E.Textarea,{name:"metadata",defaultValue:d?.metadata?JSON.stringify(d.metadata,null,2):"",rows:4})]}),(0,b.jsxs)(C.DialogFooter,{children:[(0,b.jsx)(l.Button,{type:"button",variant:"outline",onClick:()=>f(!1),children:i("common.cancel")}),(0,b.jsx)(l.Button,{type:"submit",disabled:h.isPending,children:h.isPending?i("common.saving"):i("common.save")})]})]},j)]})})}var Q=a.i(726436);function R({label:a,children:c}){return(0,b.jsxs)("div",{className:"grid grid-cols-[120px_1fr] items-start gap-3",children:[(0,b.jsx)("span",{className:"pt-0.5 text-xs font-medium text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"min-w-0 text-sm text-foreground",children:c})]})}function S({memoryStoreName:a,scope:c,unit:d,open:e,onOpenChange:f}){let{t:g}=(0,F.useI18n)(),h=d?M(d):void 0,i=(0,Q.useMemoryUnit)(a,h,c,e),j=i.data?.memory;return(0,b.jsx)(C.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(C.DialogContent,{className:"max-w-2xl",children:[(0,b.jsx)(C.DialogHeader,{children:(0,b.jsx)(C.DialogTitle,{children:g("memory.units.detailTitle")})}),d?"-"===h?(0,b.jsx)("p",{className:"text-sm text-destructive",children:g("memory.units.detailMissingId")}):i.isLoading?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q.Skeleton,{className:"h-4 w-16"}),(0,b.jsx)(q.Skeleton,{className:"h-5 w-64"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q.Skeleton,{className:"h-4 w-16"}),(0,b.jsx)(q.Skeleton,{className:"h-24 w-full"})]}),(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"})]})]}):i.isError?(0,b.jsx)("p",{className:"rounded-md bg-destructive/5 p-3 text-sm text-destructive",children:i.error instanceof Error?i.error.message:g("memory.units.detailLoadError")}):j?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(R,{label:"ID",children:(0,b.jsx)("span",{className:"break-all font-mono text-xs",children:j.id??j.memoryId??"-"})}),(0,b.jsx)(R,{label:g("memory.units.detailContent"),children:(0,b.jsx)("p",{className:"whitespace-pre-wrap rounded-md bg-muted p-3 text-sm",children:j.text})}),j.search_text&&(0,b.jsx)(R,{label:g("memory.units.detailSearchText"),children:(0,b.jsx)("p",{className:"whitespace-pre-wrap rounded-md bg-muted p-3 text-sm",children:j.search_text})}),(0,b.jsx)(R,{label:g("memory.units.detailScope"),children:(0,z.formatScope)(j.scope)}),(0,b.jsx)(R,{label:g("memory.units.detailType"),children:j.unit_type??"-"}),(0,b.jsx)(R,{label:g("memory.units.detailSalience"),children:j.salience??"-"}),(0,b.jsx)(R,{label:g("memory.units.detailVersion"),children:j.version??"-"}),j.metadata&&(0,b.jsx)(R,{label:g("memory.units.detailMetadata"),children:(0,b.jsx)("pre",{className:"overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(j.metadata,null,2)})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g("memory.units.detailNotFound")}):null]})})}var T=a.i(983930),U=a.i(353141);function V({viewMode:a,onChange:c,t:d}){let e=[{value:"units",label:d("memory.units.viewUnits"),icon:(0,b.jsx)(g.Database,{className:"h-3.5 w-3.5"})},{value:"files",label:d("memory.units.viewFiles"),icon:(0,b.jsx)(h.FolderTree,{className:"h-3.5 w-3.5"})}];return(0,b.jsx)("div",{className:"inline-flex items-center rounded-md border border-[hsl(var(--border))] p-0.5",children:e.map(d=>(0,b.jsxs)("button",{type:"button",onClick:()=>c(d.value),"aria-pressed":a===d.value,className:(0,B.cn)("inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-xs transition-colors",a===d.value?"bg-[hsl(var(--primary-soft))] font-medium text-[hsl(var(--primary))]":"text-muted-foreground hover:text-foreground"),children:[d.icon,d.label]},d.value))})}function W({usable:a,hasAppId:c,memoryStoreName:d,scope:e}){let{t:f}=(0,F.useI18n)();return a?(0,b.jsx)(T.MemoryFilesBrowser,{memoryStoreName:d,scope:e,className:"h-[calc(100vh-320px)] min-h-[360px]"}):(0,b.jsxs)("div",{className:"rounded-lg border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.25)] p-8 text-center",children:[(0,b.jsx)(h.FolderTree,{className:"mx-auto mb-2 h-6 w-6 text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f(c?"memory.units.fileMemoryWildcardHint":"memory.units.fileMemoryAppHint")})]})}a.s(["default",0,function(){let a,{t:g}=(0,F.useI18n)(),h=(0,d.useParams)(),B=(0,d.useSearchParams)(),C=decodeURIComponent(h.store),D=B.toString(),E=(0,c.useMemo)(()=>(0,z.buildMemoryScope)(new URLSearchParams(D)),[D]),H=(0,z.hasWildcardScope)(E),I=(0,c.useMemo)(()=>`${E.appId}|${E.tenantId??""}|${E.agentId??""}|${E.runId??""}`,[E.appId,E.tenantId,E.agentId,E.runId]),{data:J}=(0,y.useMemoryStore)(C),K=(0,A.isFileMemory)(J?.storageMode),[L,N]=(0,c.useState)("units"),Q=!!E.appId&&!H,[R,T]=(0,c.useState)({scopeKey:I,tokenStack:[]}),[X]=(0,c.useState)(20),[Y,Z]=(0,c.useState)(""),[$,_]=(0,c.useState)(null),[aa,ab]=(0,c.useState)(!1),[ac,ad]=(0,c.useState)({scopeKey:I,open:!1}),[ae,af]=(0,c.useState)({scopeKey:I,unit:null}),[ag,ah]=(0,c.useState)({scopeKey:I,unit:null}),[ai,aj]=(0,c.useState)({scopeKey:I,unit:null}),ak=R.scopeKey===I?R.tokenStack:[],al=R.scopeKey===I?R.currentToken:void 0,am=ac.scopeKey===I&&ac.open,an=ae.scopeKey===I?ae.unit:null,ao=ag.scopeKey===I?ag.unit:null,ap=ai.scopeKey===I?ai.unit:null,aq=function(a,b,c,d=20){let{context:e,ready:f}=(0,v.useRuntimeContext)();return(0,s.useQuery)({queryKey:u.queryKeys.memoryUnits(e.dataScopeKey,a,b,c,d),queryFn:()=>(0,t.listMemoryUnits)(a,b,{nextToken:c,limit:d}),enabled:f&&!!a&&!!b?.appId,staleTime:3e4})}(C,"units"===L&&E.appId?E:null,al,X),ar=(a=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>(0,t.deleteMemoryUnit)(a),onSuccess:()=>{(0,u.invalidateMemoryQueries)(a)}})),as=aq.data?.items??[];function at(a,b){return a.scope?.appId?a.scope:b}function au(a,b){let c=M(a),d=at(a,b);return!!d.appId&&!(0,z.hasWildcardScope)(d)&&"-"!==c}let av=an?at(an,E):E,aw=ao?at(ao,E):E,ax=ap?at(ap,E):E;async function ay(){if(!ap)return;let a=M(ap);if("-"===a)return void k.toast.error(g("memory.units.idMissingDelete"));if(!au(ap,E))return void k.toast.error(g("memory.units.preciseScopeRequiredDelete"));try{await ar.mutateAsync({memoryStoreName:C,memoryId:a,scope:ax}),k.toast.success(g("memory.units.deleteSuccess")),aj({scopeKey:I,unit:null}),aq.refetch()}catch(a){k.toast.error(a instanceof Error?a.message:g("memory.units.deleteFailed"))}}async function az(){if(!Y.trim())return void k.toast.error(g("memory.units.searchIdRequired"));if(!E.appId)return void k.toast.error(g("memory.units.preciseScopeRequired"));ab(!0);try{let a=await (0,U.apiGet)(`/api/v1/memory/stores/${encodeURIComponent(C)}/units/${encodeURIComponent(Y.trim())}?${new URLSearchParams({appId:E.appId,...E.tenantId?{tenantId:E.tenantId}:{},...E.agentId?{agentId:E.agentId}:{},...E.runId?{runId:E.runId}:{}}).toString()}`);_(a.memory),k.toast.success(g("memory.units.found"))}catch(a){_(null),k.toast.error(a instanceof Error?a.message:g("memory.units.notFound"))}finally{ab(!1)}}function aA(){Z(""),_(null)}let aB=$?[$]:as;return"units"===L&&aq.isLoading&&!$?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(q.Skeleton,{className:"h-8 w-48"}),(0,b.jsx)(q.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-64 w-full"})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(n.PageHeader,{title:g("memory.units.title"),children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[K&&(0,b.jsx)(V,{viewMode:L,onChange:N,t:g}),"units"===L&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(p.RefreshButton,{loading:aq.isRefetching,onClick:()=>{aq.refetch(),aA()}}),H?(0,b.jsx)(r.TooltipProvider,{delayDuration:200,children:(0,b.jsxs)(r.Tooltip,{children:[(0,b.jsx)(r.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{tabIndex:0,className:"inline-flex",children:(0,b.jsxs)(l.Button,{disabled:!0,className:"pointer-events-none",children:[(0,b.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),g("memory.units.addMemory")]})})}),(0,b.jsx)(r.TooltipContent,{side:"bottom",className:"max-w-[240px]",children:(0,b.jsx)("p",{children:g("memory.units.addWildcardHint")})})]})}):(0,b.jsxs)(l.Button,{onClick:()=>ad({scopeKey:I,open:!0}),children:[(0,b.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),g("memory.units.addMemory")]})]})]})}),"files"===L?(0,b.jsx)(W,{usable:Q,hasAppId:!!E.appId,memoryStoreName:C,scope:{appId:E.appId??"",tenantId:E.tenantId??"",agentId:E.agentId??"",runId:E.runId??""}}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(m.Input,{value:Y,onChange:a=>Z(a.target.value),placeholder:g("memory.units.searchIdPlaceholder"),className:"max-w-md",onKeyDown:a=>"Enter"===a.key&&az()}),(0,b.jsxs)(l.Button,{onClick:az,disabled:aa||!E.appId,children:[(0,b.jsx)(j.Search,{className:"mr-1.5 h-4 w-4"}),aa?g("memory.units.querying"):g("memory.units.query")]}),$&&(0,b.jsx)(l.Button,{variant:"outline",onClick:aA,children:g("memory.units.backToList")})]}),H&&!$&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("memory.units.wildcardReadOnly")}),(0,b.jsx)(O,{units:aB,readOnly:!!$,isActionDisabled:a=>!!$||!au(a,E),onView:a=>af({scopeKey:I,unit:a}),onEdit:a=>ah({scopeKey:I,unit:a}),onDelete:a=>aj({scopeKey:I,unit:a})}),!$&&(0,b.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:g("memory.units.page",{page:ak.length+1})}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)(l.Button,{variant:"outline",size:"sm",onClick:()=>{T(a=>{let b=[...a.scopeKey===I?a.tokenStack:[]],c=b.pop();return{scopeKey:I,tokenStack:b,currentToken:c||void 0}})},disabled:0===ak.length,children:[(0,b.jsx)(e.ChevronLeft,{className:"mr-1 h-4 w-4"}),g("common.prevPage")]}),(0,b.jsxs)(l.Button,{variant:"outline",size:"sm",onClick:()=>{aq.data?.nextToken&&T(a=>({scopeKey:I,tokenStack:[...a.scopeKey===I?a.tokenStack:[],al??""],currentToken:aq.data.nextToken}))},disabled:!aq.data?.nextToken,children:[g("common.nextPage"),(0,b.jsx)(f.ChevronRight,{className:"ml-1 h-4 w-4"})]})]})]})]}),(0,b.jsx)(G,{memoryStoreName:C,scope:E,open:am,onOpenChange:a=>ad({scopeKey:I,open:a}),onSuccess:()=>{aq.refetch(),aA()}}),(0,b.jsx)(S,{memoryStoreName:C,scope:av,unit:an,open:!!an&&au(an,E),onOpenChange:a=>{a||af({scopeKey:I,unit:null})}}),(0,b.jsx)(P,{memoryStoreName:C,scope:aw,unit:ao,open:!!ao&&au(ao,E),onOpenChange:a=>{a||ah({scopeKey:I,unit:null})}}),(0,b.jsx)(o.ConfirmDialog,{open:!!ap&&au(ap,E),onOpenChange:a=>{a||aj({scopeKey:I,unit:null})},title:g("memory.units.deleteTitle"),description:g("memory.units.deleteConfirm",{id:ap?M(ap):""}),variant:"danger",onConfirm:ay})]})}],325909)}];
1
+ module.exports=[325909,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(880470),e=a.i(465173),f=a.i(907704),g=a.i(123028),h=a.i(96193),i=a.i(25825),j=a.i(160318),k=a.i(263265),l=a.i(776192),m=a.i(172518),n=a.i(502482),o=a.i(324567),p=a.i(887617),q=a.i(604395),r=a.i(434841),s=a.i(983366),t=a.i(421347),u=a.i(225377),v=a.i(739096),w=a.i(933596),x=a.i(895487),y=a.i(411697),z=a.i(908264),A=a.i(285540);function B(a,b){return`tsagent.fileScopes.v1:${JSON.stringify([a,b])}`}function C(a){return!a||[a.appId,a.tenantId,a.agentId,a.runId].some(a=>"string"!=typeof a||!a.trim()||"*"===a.trim())?null:{appId:a.appId.trim(),tenantId:a.tenantId.trim(),agentId:a.agentId.trim(),runId:a.runId.trim()}}function D(a,b,c){try{let d=a.getItem(B(b,c));if(!d)return[];let e=JSON.parse(d);if(!Array.isArray(e))return[];return e.map(a=>C(a&&"object"==typeof a?a:null)).filter(a=>null!==a).slice(0,10)}catch{return[]}}function E(a,b,c,d){let e=C(d);if(!e)return D(a,b,c);let f=JSON.stringify(e),g=[e,...D(a,b,c).filter(a=>JSON.stringify(a)!==f)].slice(0,10);try{a.setItem(B(b,c),JSON.stringify(g))}catch{}return g}var F=a.i(364565),G=a.i(843836),H=a.i(962491),I=a.i(470535),J=a.i(543320);function K({memoryStoreName:a,scope:d,open:e,onOpenChange:f,onSuccess:g}){let h,i=(h=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>(0,t.addMemory)(a),onSuccess:()=>{(0,u.invalidateMemoryQueries)(h)}})),{t:j}=(0,J.useI18n)(),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)("");async function q(){try{let b=(0,z.parseJsonObject)(o);if(!m.trim())return void k.toast.error(j("memory.add.textRequired"));await i.mutateAsync({memoryStoreName:a,scope:d,text:m.trim(),metadata:b,sync:!1}),k.toast.success(j("memory.add.processing")),n(""),p(""),f(!1),g?.()}catch(a){k.toast.error(a instanceof Error?a.message:j("memory.add.failed"))}}return(0,b.jsx)(G.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(G.DialogContent,{className:"max-w-xl",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{children:j("memory.add.title")})}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.Label,{children:j("memory.add.textLabel")}),(0,b.jsx)(I.Textarea,{value:m,onChange:a=>n(a.target.value),placeholder:j("memory.add.textPlaceholder"),rows:5})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.Label,{children:j("memory.add.metadataLabel")}),(0,b.jsx)(I.Textarea,{value:o,onChange:a=>p(a.target.value),placeholder:'{"source":"dashboard"}',rows:3})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:j("memory.add.hint")})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>f(!1),children:j("common.cancel")}),(0,b.jsx)(l.Button,{onClick:q,disabled:i.isPending,children:i.isPending?j("common.submitting"):j("common.submit")})]})]})})}var L=a.i(87491),M=a.i(112537),N=a.i(655295),O=a.i(223301),P=a.i(796572);function Q(a){return a.id??a.memoryId??"-"}let R=(0,c.memo)(function({unit:a,actionDisabled:d,disabledTitle:e,viewTitle:f,editTitle:g,deleteTitle:h,onView:i,onEdit:j,onDelete:k,locale:m}){let n=(0,c.useCallback)(()=>i?.(a),[i,a]),o=(0,c.useCallback)(()=>j?.(a),[j,a]),p=(0,c.useCallback)(()=>k?.(a),[k,a]);return(0,b.jsxs)(O.TableRow,{children:[(0,b.jsx)(O.TableCell,{className:"font-mono text-xs",children:Q(a)}),(0,b.jsxs)(O.TableCell,{className:"max-w-[420px]",children:[(0,b.jsx)("p",{className:"line-clamp-2 text-sm",children:a.text}),a.search_text&&(0,b.jsx)("p",{className:"mt-1 line-clamp-1 text-xs text-muted-foreground",children:a.search_text})]}),(0,b.jsx)(O.TableCell,{children:a.unit_type??"-"}),(0,b.jsx)(O.TableCell,{children:a.version??"-"}),(0,b.jsx)(O.TableCell,{className:"text-xs text-muted-foreground",children:function(a,b="zh"){return(0,P.formatDateTime)(a,b,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}(a.created_at??a.createdAt,m)}),(0,b.jsx)(O.TableCell,{children:(0,b.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,b.jsx)(l.Button,{type:"button",variant:"ghost",size:"icon",disabled:d,onClick:n,title:d?e:f,children:(0,b.jsx)(L.Eye,{className:"h-4 w-4"})}),(0,b.jsx)(l.Button,{type:"button",variant:"ghost",size:"icon",disabled:d,onClick:o,title:d?e:g,children:(0,b.jsx)(M.Pencil,{className:"h-4 w-4"})}),(0,b.jsx)(l.Button,{type:"button",variant:"ghost",size:"icon",disabled:d,onClick:p,title:d?e:h,children:(0,b.jsx)(N.Trash2,{className:"h-4 w-4 text-[hsl(var(--destructive))]"})})]})})]})});function S({units:a,readOnly:c=!1,isActionDisabled:d,onView:e,onEdit:f,onDelete:g}){let{t:h,locale:i}=(0,J.useI18n)(),j=h("memory.units.tableCreatedAtHint");return a.length?(0,b.jsx)("div",{className:"rounded-lg 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,{className:"w-[180px]",children:h("memory.units.tableId")}),(0,b.jsx)(O.TableHead,{children:h("memory.units.tableContent")}),(0,b.jsx)(O.TableHead,{className:"w-[140px]",children:h("memory.units.tableType")}),(0,b.jsx)(O.TableHead,{className:"w-[120px]",children:h("memory.units.tableVersion")}),(0,b.jsx)(O.TableHead,{className:"w-[170px]",title:j,children:h("memory.units.tableCreatedAt")}),(0,b.jsx)(O.TableHead,{className:"w-[160px] text-right",children:h("memory.units.tableActions")})]})}),(0,b.jsx)(O.TableBody,{children:a.map((a,j)=>{let k=c||d?.(a)||!1,l=Q(a);return(0,b.jsx)(R,{unit:a,actionDisabled:k,disabledTitle:h("memory.units.disabledTitle"),viewTitle:h("memory.units.view"),editTitle:h("common.edit"),deleteTitle:h("common.delete"),onView:e,onEdit:f,onDelete:g,locale:i},"-"===l?j:l)})})]})}):(0,b.jsx)("div",{className:"rounded-lg border border-dashed py-12 text-center text-sm text-muted-foreground",children:h("memory.units.emptyUnits")})}function T({memoryStoreName:a,scope:c,unit:d,open:e,onOpenChange:f}){let g,h=(g=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>(0,t.updateMemoryUnit)(a),onSuccess:()=>{(0,u.invalidateMemoryQueries)(g)}})),{t:i}=(0,J.useI18n)(),j=d?Q(d):"empty";async function m(b){if(b.preventDefault(),!d)return;let e=Q(d);if("-"===e)return void k.toast.error(i("memory.edit.idMissing"));let g=new FormData(b.currentTarget),j=String(g.get("text")??"").trim(),l=String(g.get("metadata")??"");try{await h.mutateAsync({memoryStoreName:a,memoryId:e,scope:c,text:j||void 0,metadata:(0,z.parseJsonObject)(l)}),k.toast.success(i("memory.edit.updateSuccess")),f(!1)}catch(a){k.toast.error(a instanceof Error?a.message:i("memory.edit.updateFailed"))}}return(0,b.jsx)(G.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(G.DialogContent,{className:"max-w-2xl",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{children:i("memory.edit.title")})}),(0,b.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.Label,{children:i("memory.edit.textLabel")}),(0,b.jsx)(I.Textarea,{name:"text",defaultValue:d?.text??"",rows:5})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.Label,{children:i("memory.edit.metadataLabel")}),(0,b.jsx)(I.Textarea,{name:"metadata",defaultValue:d?.metadata?JSON.stringify(d.metadata,null,2):"",rows:4})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(l.Button,{type:"button",variant:"outline",onClick:()=>f(!1),children:i("common.cancel")}),(0,b.jsx)(l.Button,{type:"submit",disabled:h.isPending,children:h.isPending?i("common.saving"):i("common.save")})]})]},j)]})})}var U=a.i(726436);function V({label:a,children:c}){return(0,b.jsxs)("div",{className:"grid grid-cols-[120px_1fr] items-start gap-3",children:[(0,b.jsx)("span",{className:"pt-0.5 text-xs font-medium text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"min-w-0 text-sm text-foreground",children:c})]})}function W({memoryStoreName:a,scope:c,unit:d,open:e,onOpenChange:f}){let{t:g}=(0,J.useI18n)(),h=d?Q(d):void 0,i=(0,U.useMemoryUnit)(a,h,c,e),j=i.data?.memory;return(0,b.jsx)(G.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(G.DialogContent,{className:"max-w-2xl",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{children:g("memory.units.detailTitle")})}),d?"-"===h?(0,b.jsx)("p",{className:"text-sm text-destructive",children:g("memory.units.detailMissingId")}):i.isLoading?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q.Skeleton,{className:"h-4 w-16"}),(0,b.jsx)(q.Skeleton,{className:"h-5 w-64"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(q.Skeleton,{className:"h-4 w-16"}),(0,b.jsx)(q.Skeleton,{className:"h-24 w-full"})]}),(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-14 w-full"})]})]}):i.isError?(0,b.jsx)("p",{className:"rounded-md bg-destructive/5 p-3 text-sm text-destructive",children:i.error instanceof Error?i.error.message:g("memory.units.detailLoadError")}):j?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(V,{label:"ID",children:(0,b.jsx)("span",{className:"break-all font-mono text-xs",children:j.id??j.memoryId??"-"})}),(0,b.jsx)(V,{label:g("memory.units.detailContent"),children:(0,b.jsx)("p",{className:"whitespace-pre-wrap rounded-md bg-muted p-3 text-sm",children:j.text})}),j.search_text&&(0,b.jsx)(V,{label:g("memory.units.detailSearchText"),children:(0,b.jsx)("p",{className:"whitespace-pre-wrap rounded-md bg-muted p-3 text-sm",children:j.search_text})}),(0,b.jsx)(V,{label:g("memory.units.detailScope"),children:(0,z.formatScope)(j.scope)}),(0,b.jsx)(V,{label:g("memory.units.detailType"),children:j.unit_type??"-"}),(0,b.jsx)(V,{label:g("memory.units.detailSalience"),children:j.salience??"-"}),(0,b.jsx)(V,{label:g("memory.units.detailVersion"),children:j.version??"-"}),j.metadata&&(0,b.jsx)(V,{label:g("memory.units.detailMetadata"),children:(0,b.jsx)("pre",{className:"overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(j.metadata,null,2)})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g("memory.units.detailNotFound")}):null]})})}var X=a.i(983930),Y=a.i(633052);let Z=[{key:"appId",label:"app",placeholder:"appPlaceholder"},{key:"tenantId",label:"tenant",placeholder:"tenantPlaceholder"},{key:"agentId",label:"agent",placeholder:"agentPlaceholder"},{key:"runId",label:"run",placeholder:"runPlaceholder"}];function $(a){let b=a=>a&&"*"!==a?a:"";return{appId:b(a.appId),tenantId:b(a.tenantId),agentId:b(a.agentId),runId:b(a.runId)}}function _({initialScope:a,recentScopes:d,onApply:e}){let{t:f}=(0,J.useI18n)(),[g,i]=(0,c.useState)(()=>$(a)),[j,k]=(0,c.useState)(null),{appId:n,tenantId:o,agentId:p,runId:q}=a;return(0,c.useEffect)(()=>{i($({appId:n,tenantId:o,agentId:p,runId:q})),k(null)},[p,n,q,o]),(0,b.jsxs)("div",{className:"overflow-hidden rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[(0,b.jsx)("div",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--primary-soft))] px-5 py-4",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]",children:(0,b.jsx)(h.FolderTree,{className:"h-5 w-5"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"font-semibold text-foreground",children:f("memory.files.scopeOnboardingTitle")}),(0,b.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:f("memory.files.scopeOnboardingDescription")})]})]})}),(0,b.jsxs)("form",{onSubmit:function(a){a.preventDefault();let b=C(g);b?(k(null),e(b)):k(f("memory.files.scopeAllRequired"))},className:"space-y-5 p-5",children:[d.length>0?(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,b.jsx)(Y.Clock3,{className:"h-3.5 w-3.5"}),f("memory.files.recentScopes")]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:d.map(a=>{let c=[a.appId,a.tenantId,a.agentId,a.runId].join(" / ");return(0,b.jsx)(l.Button,{type:"button",size:"sm",variant:"outline",title:c,onClick:()=>e(a),className:"max-w-full font-mono text-xs",children:(0,b.jsx)("span",{className:"truncate",children:c})},c)})}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f("memory.files.recentScopesLocalHint")})]}):null,(0,b.jsx)("section",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:Z.map(({key:a,label:c,placeholder:d})=>(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(H.Label,{htmlFor:`file-scope-${a}`,children:f(`memory.scopeField.${c}`)}),(0,b.jsx)(m.Input,{id:`file-scope-${a}`,value:g[a],placeholder:f(`memory.scopeBar.${d}`),onChange:b=>{i(c=>({...c,[a]:b.target.value})),k(null)}})]},a))}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-[hsl(var(--border))] pt-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(h.FolderTree,{className:"h-4 w-4"}),j?(0,b.jsx)("span",{className:"text-[hsl(var(--destructive))]",children:j}):f("memory.files.scopeIsolationHint")]}),(0,b.jsxs)(l.Button,{type:"submit",children:[(0,b.jsx)(h.FolderTree,{className:"h-4 w-4"}),f("memory.files.setScopeAndEnter")]})]})]})]})}var aa=a.i(353141);function ab({viewMode:a,onChange:c,t:d}){let e=[{value:"units",label:d("memory.units.viewUnits"),icon:(0,b.jsx)(g.Database,{className:"h-3.5 w-3.5"})},{value:"files",label:d("memory.units.viewFiles"),icon:(0,b.jsx)(h.FolderTree,{className:"h-3.5 w-3.5"})}];return(0,b.jsx)("div",{className:"inline-flex items-center rounded-md border border-[hsl(var(--border))] p-0.5",children:e.map(d=>(0,b.jsxs)("button",{type:"button",onClick:()=>c(d.value),"aria-pressed":a===d.value,className:(0,F.cn)("inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-xs transition-colors",a===d.value?"bg-[hsl(var(--primary-soft))] font-medium text-[hsl(var(--primary))]":"text-muted-foreground hover:text-foreground"),children:[d.icon,d.label]},d.value))})}function ac({usable:a,writable:c,hasAppId:d,memoryStoreName:e,scope:f,recentScopes:g,onApplyScope:i,initialPath:j}){let{t:k}=(0,J.useI18n)();return a?(0,b.jsx)(X.MemoryFilesBrowser,{memoryStoreName:e,scope:f,initialPath:j,className:"h-[calc(100vh-320px)] min-h-[360px]"}):c?(0,b.jsx)(_,{initialScope:f,recentScopes:g,onApply:i}):(0,b.jsxs)("div",{className:"rounded-lg border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.25)] p-8 text-center",children:[(0,b.jsx)(h.FolderTree,{className:"mx-auto mb-2 h-6 w-6 text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:k(d?"memory.units.fileMemoryWildcardHint":"memory.units.fileMemoryAppHint")})]})}a.s(["default",0,function(){let a,{t:g}=(0,J.useI18n)(),h=(0,d.useParams)(),B=(0,d.useRouter)(),F=(0,d.useSearchParams)(),G=(0,v.useDataScopeKey)(),H=decodeURIComponent(h.store),I=F.toString(),L=(0,c.useMemo)(()=>(0,z.buildMemoryScope)(new URLSearchParams(I)),[I]),M=(0,z.hasWildcardScope)(L),N=(0,c.useMemo)(()=>`${L.appId}|${L.tenantId??""}|${L.agentId??""}|${L.runId??""}`,[L.appId,L.tenantId,L.agentId,L.runId]),{data:O}=(0,y.useMemoryStore)(H),P=(0,A.storageModeCapabilities)(O?.storageMode),R=P.files,U=P.writableFiles,V=F.get("view"),X=F.get("file"),[Y,Z]=(0,c.useState)("files"===V?"files":"units");(0,c.useEffect)(()=>{O&&(P.structured&&"files"!==V?P.files||Z("units"):Z(P.files?"files":"units"))},[P.files,P.structured,O,V]);let $=(0,c.useMemo)(()=>C({appId:L.appId,tenantId:L.tenantId,agentId:L.agentId,runId:L.runId}),[L.appId,L.tenantId,L.agentId,L.runId]),_=!M&&null!==$,[ad,ae]=(0,c.useState)([]);(0,c.useEffect)(()=>{U?ae($?E(window.localStorage,G,H,$):D(window.localStorage,G,H)):ae([])},[G,$,H,U]);let[af,ag]=(0,c.useState)({scopeKey:N,tokenStack:[]}),[ah]=(0,c.useState)(20),[ai,aj]=(0,c.useState)(""),[ak,al]=(0,c.useState)(null),[am,an]=(0,c.useState)(!1),[ao,ap]=(0,c.useState)({scopeKey:N,open:!1}),[aq,ar]=(0,c.useState)({scopeKey:N,unit:null}),[as,at]=(0,c.useState)({scopeKey:N,unit:null}),[au,av]=(0,c.useState)({scopeKey:N,unit:null}),aw=af.scopeKey===N?af.tokenStack:[],ax=af.scopeKey===N?af.currentToken:void 0,ay=ao.scopeKey===N&&ao.open,az=aq.scopeKey===N?aq.unit:null,aA=as.scopeKey===N?as.unit:null,aB=au.scopeKey===N?au.unit:null,aC=function(a,b,c,d=20){let{context:e,ready:f}=(0,v.useRuntimeContext)();return(0,s.useQuery)({queryKey:u.queryKeys.memoryUnits(e.dataScopeKey,a,b,c,d),queryFn:()=>(0,t.listMemoryUnits)(a,b,{nextToken:c,limit:d}),enabled:f&&!!a&&!!b?.appId,staleTime:3e4})}(H,"units"===Y&&L.appId?L:null,ax,ah),aD=(a=(0,x.useQueryClient)(),(0,w.useMutation)({mutationFn:a=>(0,t.deleteMemoryUnit)(a),onSuccess:()=>{(0,u.invalidateMemoryQueries)(a)}})),aE=aC.data?.items??[];function aF(a,b){return a.scope?.appId?a.scope:b}function aG(a,b){let c=Q(a),d=aF(a,b);return!!d.appId&&!(0,z.hasWildcardScope)(d)&&"-"!==c}let aH=az?aF(az,L):L,aI=aA?aF(aA,L):L,aJ=aB?aF(aB,L):L;async function aK(){if(!aB)return;let a=Q(aB);if("-"===a)return void k.toast.error(g("memory.units.idMissingDelete"));if(!aG(aB,L))return void k.toast.error(g("memory.units.preciseScopeRequiredDelete"));try{await aD.mutateAsync({memoryStoreName:H,memoryId:a,scope:aJ}),k.toast.success(g("memory.units.deleteSuccess")),av({scopeKey:N,unit:null}),aC.refetch()}catch(a){k.toast.error(a instanceof Error?a.message:g("memory.units.deleteFailed"))}}async function aL(){if(!ai.trim())return void k.toast.error(g("memory.units.searchIdRequired"));if(!L.appId)return void k.toast.error(g("memory.units.preciseScopeRequired"));an(!0);try{let a=await (0,aa.apiGet)(`/api/v1/memory/stores/${encodeURIComponent(H)}/units/${encodeURIComponent(ai.trim())}?${new URLSearchParams({appId:L.appId,...L.tenantId?{tenantId:L.tenantId}:{},...L.agentId?{agentId:L.agentId}:{},...L.runId?{runId:L.runId}:{}}).toString()}`);al(a.memory),k.toast.success(g("memory.units.found"))}catch(a){al(null),k.toast.error(a instanceof Error?a.message:g("memory.units.notFound"))}finally{an(!1)}}function aM(){aj(""),al(null)}let aN=ak?[ak]:aE;return"units"===Y&&aC.isLoading&&!ak?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(q.Skeleton,{className:"h-8 w-48"}),(0,b.jsx)(q.Skeleton,{className:"h-10 w-full"}),(0,b.jsx)(q.Skeleton,{className:"h-64 w-full"})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)(n.PageHeader,{title:P.structured?g("memory.units.title"):g("memory.detail.tabFiles"),children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[R&&P.structured&&(0,b.jsx)(ab,{viewMode:Y,onChange:Z,t:g}),"units"===Y&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(p.RefreshButton,{loading:aC.isRefetching,onClick:()=>{aC.refetch(),aM()}}),M?(0,b.jsx)(r.TooltipProvider,{delayDuration:200,children:(0,b.jsxs)(r.Tooltip,{children:[(0,b.jsx)(r.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{tabIndex:0,className:"inline-flex",children:(0,b.jsxs)(l.Button,{disabled:!0,className:"pointer-events-none",children:[(0,b.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),g("memory.units.addMemory")]})})}),(0,b.jsx)(r.TooltipContent,{side:"bottom",className:"max-w-[240px]",children:(0,b.jsx)("p",{children:g("memory.units.addWildcardHint")})})]})}):(0,b.jsxs)(l.Button,{onClick:()=>ap({scopeKey:N,open:!0}),children:[(0,b.jsx)(i.Plus,{className:"mr-2 h-4 w-4"}),g("memory.units.addMemory")]})]})]})}),"files"===Y?(0,b.jsx)(ac,{usable:_,writable:U,hasAppId:!!L.appId&&"*"!==L.appId,memoryStoreName:H,scope:$??{appId:L.appId??"",tenantId:L.tenantId??"",agentId:L.agentId??"",runId:L.runId??""},recentScopes:ad,onApplyScope:function(a){var b;let c;ae(E(window.localStorage,G,H,a));let d=(b=new URLSearchParams(I),(c=new URLSearchParams(b)).set("view","files"),c.set("appId",a.appId),c.set("tenantId",a.tenantId),c.set("agentId",a.agentId),c.set("runId",a.runId),c.delete("file"),c);B.replace(`/memory/${encodeURIComponent(H)}/units?${d.toString()}`)},initialPath:X}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(m.Input,{value:ai,onChange:a=>aj(a.target.value),placeholder:g("memory.units.searchIdPlaceholder"),className:"max-w-md",onKeyDown:a=>"Enter"===a.key&&aL()}),(0,b.jsxs)(l.Button,{onClick:aL,disabled:am||!L.appId,children:[(0,b.jsx)(j.Search,{className:"mr-1.5 h-4 w-4"}),am?g("memory.units.querying"):g("memory.units.query")]}),ak&&(0,b.jsx)(l.Button,{variant:"outline",onClick:aM,children:g("memory.units.backToList")})]}),M&&!ak&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("memory.units.wildcardReadOnly")}),(0,b.jsx)(S,{units:aN,readOnly:!!ak,isActionDisabled:a=>!!ak||!aG(a,L),onView:a=>ar({scopeKey:N,unit:a}),onEdit:a=>at({scopeKey:N,unit:a}),onDelete:a=>av({scopeKey:N,unit:a})}),!ak&&(0,b.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:g("memory.units.page",{page:aw.length+1})}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)(l.Button,{variant:"outline",size:"sm",onClick:()=>{ag(a=>{let b=[...a.scopeKey===N?a.tokenStack:[]],c=b.pop();return{scopeKey:N,tokenStack:b,currentToken:c||void 0}})},disabled:0===aw.length,children:[(0,b.jsx)(e.ChevronLeft,{className:"mr-1 h-4 w-4"}),g("common.prevPage")]}),(0,b.jsxs)(l.Button,{variant:"outline",size:"sm",onClick:()=>{aC.data?.nextToken&&ag(a=>({scopeKey:N,tokenStack:[...a.scopeKey===N?a.tokenStack:[],ax??""],currentToken:aC.data.nextToken}))},disabled:!aC.data?.nextToken,children:[g("common.nextPage"),(0,b.jsx)(f.ChevronRight,{className:"ml-1 h-4 w-4"})]})]})]})]}),(0,b.jsx)(K,{memoryStoreName:H,scope:L,open:ay,onOpenChange:a=>ap({scopeKey:N,open:a}),onSuccess:()=>{aC.refetch(),aM()}}),(0,b.jsx)(W,{memoryStoreName:H,scope:aH,unit:az,open:!!az&&aG(az,L),onOpenChange:a=>{a||ar({scopeKey:N,unit:null})}}),(0,b.jsx)(T,{memoryStoreName:H,scope:aI,unit:aA,open:!!aA&&aG(aA,L),onOpenChange:a=>{a||at({scopeKey:N,unit:null})}}),(0,b.jsx)(o.ConfirmDialog,{open:!!aB&&aG(aB,L),onOpenChange:a=>{a||av({scopeKey:N,unit:null})},title:g("memory.units.deleteTitle"),description:g("memory.units.deleteConfirm",{id:aB?Q(aB):""}),variant:"danger",onConfirm:aK})]})}],325909)}];
2
2
 
3
3
  //# sourceMappingURL=dashboard_src_app_%28dashboard%29_memory_%5Bstore%5D_units_page_tsx_0.6xnei._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[983930,633052,a=>{"use strict";var b=a.i(634020),c=a.i(971938),d=a.i(201927),e=a.i(907704),f=a.i(219974),g=a.i(831113),h=a.i(141420),i=a.i(96193),j=a.i(160318),k=a.i(263265),l=a.i(776192),m=a.i(172518),n=a.i(766248),o=a.i(543320),p=a.i(364565),q=a.i(353141),r=a.i(7766),s=a.i(750053);let t=(0,s.default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]),u=(0,s.default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);var v=a.i(558648);let w=(0,s.default)("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);a.s(["Clock3",0,w],633052);var x=a.i(881619),y=a.i(616106);let z=(0,s.default)("shield-off",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);function A({memoryStoreName:a,scope:d,file:e,readOnly:f,onRestored:g}){var h;let{t:i}=(0,o.useI18n)(),[j,m]=(0,c.useState)(null),p=(0,n.useItemVersions)(a,d,e.itemId,{view:"basic",limit:50}),q=(0,n.useItemVersion)(a,d,j??void 0),r=(0,n.useAddItem)(),s=(0,n.useUpdateItem)(),t=(0,n.useRedactItemVersion)(),u=(0,c.useMemo)(()=>p.data?.pages.flatMap(a=>a.versions)??[],[p.data?.pages]);async function v(){if(q.data)try{let b=function(a,b,c,d){if(d.redacted)throw Error("VERSION_REDACTED");if(void 0===d.content)throw Error("VERSION_CONTENT_UNAVAILABLE");return c?{kind:"update",request:{memoryStoreName:a,scope:b,itemId:c.itemId,content:d.content,precondition:{expectedVersionId:c.latestVersionId},view:"full"}}:{kind:"add",request:{memoryStoreName:a,scope:b,path:d.path,content:d.content,view:"full"}}}(a,d,e,q.data),c="update"===b.kind?await s.mutateAsync(b.request):await r.mutateAsync(b.request);g?.(c,q.data.content??""),k.toast.success(i("memory.files.restoreSuccess"))}catch(a){k.toast.error(a instanceof Error?a.message:i("memory.files.restoreFailed"))}}async function B(){let b=q.data;if(b&&!b.redacted&&window.confirm(i("memory.files.redactConfirm")))try{await t.mutateAsync({memoryStoreName:a,scope:d,versionId:b.versionId}),await q.refetch(),k.toast.success(i("memory.files.redactSuccess"))}catch(a){k.toast.error(a instanceof Error?a.message:i("memory.files.redactFailed"))}}return f?null:(0,b.jsxs)("section",{className:"min-h-0 border-t border-[hsl(var(--border))] pt-3",children:[(0,b.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,b.jsxs)("h4",{className:"flex items-center gap-1.5 text-xs font-semibold",children:[(0,b.jsx)(w,{className:"h-3.5 w-3.5"}),i("memory.files.versionHistory")]}),p.hasNextPage?(0,b.jsx)(l.Button,{type:"button",variant:"ghost",size:"sm",disabled:p.isFetchingNextPage,onClick:()=>void p.fetchNextPage(),children:i("memory.files.loadMore")}):null]}),p.isLoading?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:i("common.loading")}):0===u.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:i("memory.files.noVersions")}):(0,b.jsx)("div",{className:"max-h-48 space-y-1 overflow-auto pr-1",children:u.map(a=>{var c;return(0,b.jsxs)("button",{type:"button",onClick:()=>m(a.versionId),className:"flex w-full items-center justify-between rounded-md border border-transparent px-2 py-1.5 text-left text-xs hover:border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]",children:[(0,b.jsxs)("span",{className:"truncate",children:[a.operation," · ",(c=a.versionId).length>12?`${c.slice(0,6)}…${c.slice(-5)}`:c,a.redacted?` \xb7 ${i("memory.files.redacted")}`:""]}),(0,b.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:new Date(a.createdAt).toLocaleString()})]},a.versionId)})}),j?(0,b.jsx)("div",{className:"mt-3 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.25)] p-2",children:q.isLoading?(0,b.jsx)(x.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):q.data?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-4",children:q.data.content??i("memory.files.contentUnavailable")}),q.data.redacted?(0,b.jsx)("p",{className:"mt-2 text-[10px] text-muted-foreground",children:i("memory.files.redactedDetails",{at:q.data.redactedAt?new Date(q.data.redactedAt).toLocaleString():"—",actor:(h=q.data.redactedBy)?`${h.actorType}:${h.actorId}`:"—"})}):null,(0,b.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[(0,b.jsxs)(l.Button,{type:"button",size:"sm",variant:"outline",disabled:!0===q.data.redacted||void 0===q.data.content||s.isPending||r.isPending,onClick:()=>void v(),children:[(0,b.jsx)(y.RotateCcw,{}),i("memory.files.restoreVersion")]}),(0,b.jsxs)(l.Button,{type:"button",size:"sm",variant:"outline",className:"text-[hsl(var(--destructive))]",disabled:!0===q.data.redacted||t.isPending,onClick:()=>void B(),children:[(0,b.jsx)(z,{}),i("memory.files.redactVersion")]})]})]}):null}):null]})}function B({icon:a,label:c,value:d}){return(0,b.jsxs)("div",{className:"flex items-start gap-2 py-1.5",children:[(0,b.jsx)("span",{className:"mt-0.5 text-muted-foreground",children:a}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:c}),(0,b.jsx)("div",{className:"break-all text-xs",children:d})]})]})}function C({memoryStoreName:a,scope:c,file:d,readOnly:e,onRestored:f}){let{t:g}=(0,o.useI18n)();return d?(0,b.jsxs)("div",{className:"h-full min-h-0 overflow-auto p-3",children:[(0,b.jsx)("h3",{className:"mb-2 text-xs font-semibold",children:g("memory.files.details")}),(0,b.jsx)(B,{icon:(0,b.jsx)(u,{className:"h-3.5 w-3.5"}),label:g("memory.files.size"),value:`${d.contentSizeBytes.toLocaleString()} B`}),(0,b.jsx)(B,{icon:(0,b.jsx)(v.ListOrdered,{className:"h-3.5 w-3.5"}),label:g("memory.files.latestVersion"),value:d.latestVersionId}),(0,b.jsx)(B,{icon:(0,b.jsx)(t,{className:"h-3.5 w-3.5"}),label:"SHA-256",value:(0,b.jsx)("span",{className:"font-mono text-[10px]",children:d.contentSha256})}),(0,b.jsx)(B,{icon:(0,b.jsx)(r.FileClock,{className:"h-3.5 w-3.5"}),label:g("memory.files.updatedAt"),value:new Date(d.updatedAt).toLocaleString()}),(0,b.jsx)(A,{memoryStoreName:a,scope:c,file:d,readOnly:e,onRestored:f})]}):(0,b.jsx)("div",{className:"flex h-full items-center justify-center p-5 text-center text-xs text-muted-foreground",children:g("memory.files.selectForDetails")})}var D=a.i(701187),E=a.i(843836),F=a.i(962491),G=a.i(470535);let H={"path-required":"memory.files.pathRequired","path-traversal":"memory.files.pathTraversal","path-too-large":"memory.files.pathTooLarge","content-too-large":"memory.files.contentTooLarge"};function I({mode:a,selectedPath:d,pending:e,onClose:f,onCreate:g,onRename:h,onDelete:i}){let{t:j}=(0,o.useI18n)(),[k,n]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(null);async function t(){s(null);try{if("delete"===a)await i();else{let b=(0,D.validateFileMemoryPath)(k);if(b)return void s(j(H[b]));if("create"===a){let a=(0,D.validateFileMemoryContent)(p);if(a)return void s(j(H[a]));await g((0,D.normalizeFileMemoryPath)(k),p)}else"rename"===a&&await h((0,D.normalizeFileMemoryPath)(k))}f()}catch(a){s(a instanceof Error?a.message:j("common.unknownError"))}}(0,c.useEffect)(()=>{n("rename"===a?d??"":""),q(""),s(null)},[a,d]);let u={create:j("memory.files.createTitle"),rename:j("memory.files.renameTitle"),delete:j("memory.files.deleteTitle")},v={create:j("common.create"),rename:j("memory.files.rename"),delete:j("common.delete")},w=a?u[a]:"",y=a?v[a]:"";return(0,b.jsx)(E.Dialog,{open:null!==a,onOpenChange:a=>!a&&f(),children:(0,b.jsxs)(E.DialogContent,{className:"sm:max-w-lg",children:[(0,b.jsxs)(E.DialogHeader,{children:[(0,b.jsx)(E.DialogTitle,{children:w}),(0,b.jsx)(E.DialogDescription,{children:"delete"===a?j("memory.files.deleteDescription",{path:d??""}):j("memory.files.pathHelp")})]}),"delete"!==a?(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(F.Label,{htmlFor:"file-memory-path",children:j("memory.files.pathLabel")}),(0,b.jsx)(m.Input,{id:"file-memory-path",autoFocus:!0,value:k,onChange:a=>n(a.target.value),placeholder:"/notes/profile.md"})]}),"create"===a?(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(F.Label,{htmlFor:"file-memory-content",children:j("memory.files.initialContent")}),(0,b.jsx)(G.Textarea,{id:"file-memory-content",value:p,onChange:a=>q(a.target.value),rows:8,className:"font-mono text-xs"})]}):null]}):null,r?(0,b.jsx)("p",{className:"text-xs text-[hsl(var(--destructive))]",children:r}):null,(0,b.jsxs)(E.DialogFooter,{children:[(0,b.jsx)(l.Button,{type:"button",variant:"outline",onClick:f,children:j("common.cancel")}),(0,b.jsxs)(l.Button,{type:"button",variant:"delete"===a?"destructive":"default",onClick:()=>void t(),disabled:e,children:[e?(0,b.jsx)(x.Loader2,{className:"animate-spin"}):null,y]})]})]})})}let J=(0,s.default)("file-plus-corner",[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]]);var K=a.i(112537),L=a.i(968826),M=a.i(126211),N=a.i(655295);function O({readOnly:a,loading:c,hasSelection:d,dirty:e,saving:f,onCreate:g,onRename:h,onDelete:i,onRefresh:j,onSave:k}){let{t:m}=(0,o.useI18n)();return(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.2)] px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)(l.Button,{type:"button",size:"sm",onClick:g,disabled:a||c||e,children:[(0,b.jsx)(J,{}),m("memory.files.newFile")]}),(0,b.jsxs)(l.Button,{type:"button",size:"sm",variant:"outline",onClick:h,disabled:a||!d||e,children:[(0,b.jsx)(K.Pencil,{}),m("memory.files.rename")]}),(0,b.jsxs)(l.Button,{type:"button",size:"sm",variant:"outline",onClick:i,disabled:a||!d||e,className:"text-[hsl(var(--destructive))]",children:[(0,b.jsx)(N.Trash2,{}),m("common.delete")]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("span",{className:"mr-1 rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2 py-0.5 text-[10px] text-muted-foreground",children:m(a?"memory.files.readOnlyMode":"memory.files.writableMode")}),(0,b.jsxs)(l.Button,{type:"button",size:"sm",variant:"outline",onClick:j,disabled:c,children:[(0,b.jsx)(L.RefreshCw,{className:c?"animate-spin":void 0}),m("common.refresh")]}),(0,b.jsxs)(l.Button,{type:"button",size:"sm",onClick:k,disabled:a||!d||!e||f,children:[f?(0,b.jsx)(x.Loader2,{className:"animate-spin"}):(0,b.jsx)(M.Save,{}),m(f?"common.saving":"common.save")]})]})]})}let P={selectedPath:null,content:"",loadedItemId:null,loadedVersionId:null,dirty:!1,conflict:null};function Q(a,b){switch(b.type){case"select":return{...P,selectedPath:b.path};case"load":if(a.selectedPath!==b.path)return a;return{selectedPath:b.path,content:b.content,loadedItemId:b.itemId,loadedVersionId:b.versionId,dirty:!1,conflict:null};case"edit":return{...a,content:b.content,dirty:!0,conflict:null};case"save-success":return{...a,content:b.content??a.content,loadedItemId:b.itemId,loadedVersionId:b.versionId,dirty:!1,conflict:null};case"save-conflict":return{...a,dirty:!0,conflict:b.message}}}function R(a,b,c){return!a.dirty||b===a.selectedPath||c()}i.FolderTree,a.s(["MemoryFilesBrowser",0,function({memoryStoreName:a,scope:i,enabled:r=!0,initialPath:s,className:t}){let{t:u}=(0,o.useI18n)(),[v,w]=(0,c.useReducer)(Q,P),x=(0,c.useRef)(v);x.current=v;let y=(0,c.useRef)(u);y.current=u;let[z,A]=(0,c.useState)(new Set),[B,E]=(0,c.useState)(""),[F,G]=(0,c.useState)(null);(0,c.useEffect)(()=>{if(s){let a=(0,D.normalizeFileMemoryPath)(s);R(x.current,a,()=>window.confirm(y.current("memory.files.discardChanges")))&&w({type:"select",path:a})}},[s]);let H=(0,n.useItems)(a,i,{depth:0,view:"basic",limit:100,enabled:r}),J=(0,n.useItem)(a,i,v.selectedPath?{path:v.selectedPath}:null),K=(0,n.useAddItem)(),L=(0,n.useUpdateItem)(),M=(0,n.useDeleteItem)(),N=H.data?.pages,S=(0,c.useMemo)(()=>{let a=new Map;for(let b of N??[])for(let c of b.items)"memoryfile"===c.type&&a.set((0,D.normalizeFileMemoryPath)(c.path),{...c,path:(0,D.normalizeFileMemoryPath)(c.path)});return Array.from(a.values()).sort((a,b)=>a.path.localeCompare(b.path))},[N]),T=(0,c.useMemo)(()=>{let a=B.trim().toLocaleLowerCase();return a?S.filter(b=>b.path.toLocaleLowerCase().includes(a)):S},[B,S]),U=(0,c.useMemo)(()=>new Map(S.map(a=>[a.path,a])),[S]),V=(0,c.useMemo)(()=>{var a;let b,c;return a=function(a){let b={type:"dir",name:"",rel:"",children:[]};for(let c of a){let a=c.rel.split("/").filter(Boolean);if(0===a.length)continue;let d=b;for(let b=0;b<a.length-1;b+=1){let c=a[b],e=a.slice(0,b+1).join("/"),f=d.children.find(a=>"dir"===a.type&&a.name===c);f||(f={type:"dir",name:c,rel:e,children:[]},d.children.push(f)),d=f}let e=a[a.length-1];d.children.some(a=>"file"===a.type&&a.name===e)||d.children.push({type:"file",name:e,rel:c.rel,size:c.size})}return!function a(b){for(let c of(b.sort((a,b)=>a.type!==b.type?"dir"===a.type?-1:1:a.name.localeCompare(b.name)),b))"dir"===c.type&&a(c.children)}(b.children),b}(T.map(a=>({rel:a.path.replace(/^\/+/,""),size:a.contentSizeBytes}))),b=[],(c=(a,d)=>{for(let e of a)b.push({node:e,depth:d}),"dir"!==e.type||z.has(e.rel)||c(e.children,d+1)})(a.children,0),b},[T,z]),W=N?.some(a=>!0===a.readOnly)??!1,X=v.selectedPath?U.get(v.selectedPath)??J.data:void 0;async function Y(){var b,c;if((0,D.validateFileMemoryContent)(v.content))return void k.toast.error(u("memory.files.contentTooLarge"));try{if(!v.loadedItemId||!v.loadedVersionId)throw Error("FILE_VERSION_NOT_LOADED");let d=await L.mutateAsync({memoryStoreName:a,scope:i,...(b={itemId:v.loadedItemId,latestVersionId:v.loadedVersionId},c=v.content,{itemId:b.itemId,content:c,precondition:{expectedVersionId:b.latestVersionId},view:"full"})});w({type:"save-success",itemId:d.itemId,versionId:d.latestVersionId,content:v.content}),k.toast.success(u("memory.files.saveSuccess"))}catch(b){let a=b instanceof Error?b.message:String(b);if(b instanceof q.ApiClientError&&"LOCK_CONFLICT"===b.code||b instanceof Error&&b.message.includes("LOCK_CONFLICT"))return void w({type:"save-conflict",message:a});k.toast.error(a||u("memory.files.saveFailed"))}}async function Z(b,c){let d=await K.mutateAsync({memoryStoreName:a,scope:i,path:b,content:c,view:"full"});w({type:"select",path:(0,D.normalizeFileMemoryPath)(d.path)}),k.toast.success(u("memory.files.createSuccess"))}async function $(b){if(!v.selectedPath||!v.loadedItemId||!v.loadedVersionId)return;let c=await L.mutateAsync({memoryStoreName:a,scope:i,itemId:v.loadedItemId,path:b,precondition:{expectedVersionId:v.loadedVersionId},view:"full"});w({type:"select",path:(0,D.normalizeFileMemoryPath)(c.path)}),k.toast.success(u("memory.files.renameSuccess"))}async function _(){v.loadedItemId&&v.loadedVersionId&&(await M.mutateAsync({memoryStoreName:a,scope:i,itemId:v.loadedItemId,precondition:{expectedVersionId:v.loadedVersionId}}),w({type:"select",path:null}),k.toast.success(u("memory.files.deleteSuccess")))}async function aa(){await H.refetch(),v.selectedPath&&await J.refetch()}(0,c.useEffect)(()=>{let a=J.data;a&&!v.dirty&&v.selectedPath&&null===v.loadedItemId&&w({type:"load",path:(0,D.normalizeFileMemoryPath)(a.path),content:a.content??"",itemId:a.itemId,versionId:a.latestVersionId})},[v.dirty,v.loadedItemId,v.selectedPath,J.data,J.data?.content,J.data?.contentSha256,J.data?.itemId,J.data?.latestVersionId,J.data?.path]);let ab=K.isPending||L.isPending||M.isPending;return(0,b.jsxs)("div",{className:(0,p.cn)("flex min-h-[440px] flex-col overflow-hidden rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",t),children:[(0,b.jsx)(O,{readOnly:W,loading:H.isLoading||H.isRefetching,hasSelection:!!v.selectedPath,dirty:v.dirty,saving:L.isPending,onCreate:()=>G("create"),onRename:()=>G("rename"),onDelete:()=>G("delete"),onRefresh:()=>void aa(),onSave:()=>void Y()}),W?(0,b.jsx)("div",{className:"border-b border-blue-500/20 bg-blue-500/10 px-3 py-2 text-xs text-blue-800 dark:text-blue-200",children:u("memory.files.readOnlyGuidance")}):null,(0,b.jsxs)("div",{className:"grid min-h-0 flex-1 grid-cols-1 lg:grid-cols-[250px_minmax(320px,1fr)_290px]",children:[(0,b.jsxs)("aside",{className:"flex min-h-0 flex-col border-b border-[hsl(var(--border))] lg:border-r lg:border-b-0",children:[(0,b.jsxs)("div",{className:"border-b border-[hsl(var(--border))] p-2",children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(j.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(m.Input,{value:B,onChange:a=>E(a.target.value),placeholder:u("memory.files.searchPlaceholder"),className:"h-7 pl-8 text-xs"})]}),(0,b.jsx)("p",{className:"mt-1.5 px-1 text-[10px] text-muted-foreground",children:u("memory.files.fileCount",{count:S.length})})]}),(0,b.jsxs)("div",{className:"min-h-[160px] flex-1 overflow-auto p-1.5",children:[H.isLoading?(0,b.jsx)("p",{className:"p-2 text-xs text-muted-foreground",children:u("common.loading")}):H.isError?(0,b.jsx)("p",{className:"p-2 text-xs text-[hsl(var(--destructive))]",children:H.error.message}):0===V.length?(0,b.jsx)("p",{className:"p-3 text-center text-xs text-muted-foreground",children:u("memory.files.emptyHint")}):V.map(({node:a,depth:c})=>{let i={paddingLeft:`${12*c+6}px`};if("dir"===a.type){let c=!z.has(a.rel);return(0,b.jsxs)("button",{type:"button",onClick:()=>{var b;return b=a.rel,void A(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},style:i,className:"flex w-full items-center gap-1 rounded px-1.5 py-1.5 text-left text-xs hover:bg-[hsl(var(--accent))]",children:[c?(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"}):(0,b.jsx)(e.ChevronRight,{className:"h-3 w-3"}),c?(0,b.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}):(0,b.jsx)(g.Folder,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}),(0,b.jsx)("span",{className:"truncate font-mono",children:a.name})]},`dir:${a.rel}`)}let j=(0,D.normalizeFileMemoryPath)(a.rel);return(0,b.jsxs)("button",{type:"button",onClick:()=>{R(v,j,()=>window.confirm(u("memory.files.discardChanges")))&&w({type:"select",path:j})},style:i,className:(0,p.cn)("flex w-full items-center gap-1.5 rounded px-1.5 py-1.5 text-left text-xs hover:bg-[hsl(var(--accent))]",v.selectedPath===j&&"bg-[hsl(var(--primary-soft))] text-[hsl(var(--primary))]"),title:j,children:[(0,b.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,b.jsx)(f.FileText,{className:"h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono",children:a.name})]},`file:${j}`)}),H.hasNextPage?(0,b.jsx)(l.Button,{type:"button",size:"sm",variant:"ghost",className:"mt-2 w-full",disabled:H.isFetchingNextPage,onClick:()=>void H.fetchNextPage(),children:u("memory.files.loadMore")}):null]})]}),(0,b.jsx)("main",{className:"min-h-[280px] border-b border-[hsl(var(--border))] lg:border-r lg:border-b-0",children:(0,b.jsx)(D.FileEditor,{path:v.selectedPath,content:v.content,dirty:v.dirty,readOnly:W,loading:J.isLoading,error:J.error instanceof Error?J.error.message:void 0,conflict:v.conflict,onChange:a=>w({type:"edit",content:a})})}),(0,b.jsx)("aside",{className:"min-h-[220px]",children:(0,b.jsx)(C,{memoryStoreName:a,scope:i,file:X,readOnly:W,onRestored:(a,b)=>w({type:"load",path:(0,D.normalizeFileMemoryPath)(a.path),content:b,itemId:a.itemId,versionId:a.latestVersionId})})})]}),(0,b.jsx)(I,{mode:F,selectedPath:v.selectedPath,pending:ab,onClose:()=>G(null),onCreate:Z,onRename:$,onDelete:_})]})}],983930)}];
2
+
3
+ //# sourceMappingURL=dashboard_src_components_memory_memory-files-browser_tsx_0o2~94-._.js.map