@tablestore/tablestore-agent-cli 0.2.11 → 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 (398) 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 +131 -196
  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 +1 -0
  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 +6 -0
  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_client-reference-manifest.js +1 -1
  76. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
  77. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +16 -16
  78. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
  79. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  80. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  81. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  82. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  83. package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  84. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js +1 -1
  85. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js.nft.json +1 -1
  86. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js +1 -1
  87. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js.nft.json +1 -1
  88. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js +1 -1
  89. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js.nft.json +1 -1
  90. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js +1 -1
  91. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js.nft.json +1 -1
  92. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js +1 -1
  93. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js.nft.json +1 -1
  94. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js +1 -1
  95. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js.nft.json +1 -1
  96. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js +1 -1
  97. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
  98. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js +1 -1
  99. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
  100. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js +1 -1
  101. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
  102. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js +1 -1
  103. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
  104. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js +1 -1
  105. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
  106. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route/app-paths-manifest.json +3 -0
  107. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route/build-manifest.json +9 -0
  108. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route/server-reference-manifest.json +4 -0
  109. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js +6 -0
  110. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js.map +5 -0
  111. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js.nft.json +1 -0
  112. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route_client-reference-manifest.js +3 -0
  113. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js +1 -1
  114. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
  115. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js +1 -1
  116. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
  117. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js +1 -1
  118. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
  119. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js +1 -1
  120. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
  121. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js +1 -1
  122. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
  123. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js +1 -1
  124. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
  125. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js +1 -1
  126. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
  127. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js +1 -1
  128. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
  129. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js +1 -1
  130. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
  131. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js +1 -1
  132. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
  133. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js +1 -1
  134. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
  135. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js +1 -1
  136. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
  137. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js +1 -1
  138. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
  139. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js +1 -1
  140. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
  141. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js +1 -1
  142. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
  143. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js +1 -1
  144. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js.nft.json +1 -1
  145. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js +1 -1
  146. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js.nft.json +1 -1
  147. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js +1 -1
  148. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js.nft.json +1 -1
  149. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js +1 -1
  150. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js.nft.json +1 -1
  151. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js +1 -1
  152. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js.nft.json +1 -1
  153. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js +1 -1
  154. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js.nft.json +1 -1
  155. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route.js +1 -1
  156. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route.js.nft.json +1 -1
  157. package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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_client-reference-manifest.js +1 -1
  199. package/dist/dashboard-runtime/dashboard/.next/server/app-paths-manifest.json +1 -0
  200. 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
  201. package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +8 -8
  202. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-pbmiq._.js +3 -0
  203. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-wmyic._.js +40 -0
  204. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.li3cj._.js +40 -0
  205. package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__0w56nne._.js → [root-of-the-server]__0sa.9zr._.js} +6 -6
  206. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0tc-.6s._.js +1 -1
  207. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0y0w3mg._.js +1 -1
  208. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +1 -1
  209. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0.ooo1s._.js +1 -1
  210. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07fsbff._.js +1 -1
  211. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0b5cw4e._.js +1 -1
  212. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0p1cst6._.js +3 -0
  213. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0xza7lz._.js +3 -0
  214. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.6x0yu._.js +3 -0
  215. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.pa1e6._.js +1 -1
  216. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01snuz~._.js +1 -1
  217. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0251rsp._.js +1 -1
  218. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_02waf76._.js +1 -1
  219. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06_hoj_._.js +3 -0
  220. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0brqbty._.js +1 -1
  221. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0csuit-._.js +3 -0
  222. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0eps5jg._.js +3 -0
  223. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ez3yia._.js +1 -1
  224. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0k7q0ug._.js +3 -0
  225. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0pwlb77._.js +3 -0
  226. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0t.h859._.js +3 -0
  227. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0thp9l5._.js +3 -0
  228. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0_z9696._.js +1 -1
  229. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0grv2wq._.js +1 -1
  230. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{dashboard_src_0bhjp9s._.js → dashboard_src_0jrh7xy._.js} +2 -2
  231. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0x60pxf._.js +1 -1
  232. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0y49vhd._.js +1 -1
  233. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_10dsqx~._.js +1 -1
  234. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_[dreamId]_page_tsx_0wy3tv6._.js +1 -1
  235. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_page_tsx_0uzzpvs._.js +1 -1
  236. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_layout_tsx_0rbi41w._.js +1 -1
  237. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_memory_memory-files-browser_tsx_0o2~94-._.js +1 -1
  238. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_i18n_i18n-context_tsx_0c39ewr._.js +1 -1
  239. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0ymj2~2._.js +3 -0
  240. package/dist/dashboard-runtime/dashboard/.next/server/functions-config-manifest.json +1 -0
  241. package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +3 -3
  242. package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
  243. package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
  244. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
  245. package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
  246. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-xwobg-a6si1.js +1 -0
  247. package/dist/dashboard-runtime/dashboard/.next/static/chunks/01bokygf48bnj.js +1 -0
  248. package/dist/dashboard-runtime/dashboard/.next/static/chunks/04a.1c2rygy08.js +1 -0
  249. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05.2q9f0yx4e_.js +1 -0
  250. package/dist/dashboard-runtime/dashboard/.next/static/chunks/09v-qczj__g1x.js +1 -0
  251. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{08nzc9sye_0~h.js → 0_8~9zgfm5f.8.js} +1 -1
  252. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0_zw2y~vb_52n.js +1 -0
  253. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0a2f-mxepv-y7.js +1 -0
  254. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0jjiw-agnutux.js → 0amex7bwxnme9.js} +1 -1
  255. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0apfhv-v7oy7u.js +1 -0
  256. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0bxt5icwb83xt.js +1 -0
  257. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dpi1comd-thc.js +1 -0
  258. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{08h7wustf~cl4.js → 0eerrv808~6bh.js} +1 -1
  259. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j6agpotrd_n4.js +1 -0
  260. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jbcdgtcgqemd.js +1 -0
  261. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{01xcynczarvq~.js → 0jp7zmwvyv0bn.js} +1 -1
  262. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k8mhea24d_kj.js +1 -0
  263. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0krt75we1wtcy.js +1 -0
  264. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0prl9yrb8ksp8.js +1 -0
  265. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{01xuyqw7ivp3n.js → 0r4azm.3hswcs.js} +3 -3
  266. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0uj7ezedkm6ou.css +1 -0
  267. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x5qtkdg2trq9.js +5 -0
  268. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0zhfdjby7cj-q.js +1 -0
  269. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0~a4ig2x9z8uq.js → 13__t3s3ipfzl.js} +1 -1
  270. package/dist/dashboard-runtime/dashboard/.next/static/chunks/16uky1ro-t_~9.js +1 -0
  271. package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0hnqmb1a7y7x1.js → 18absak_u0d85.js} +3 -3
  272. package/dist/dashboard-runtime/dashboard/server.js +1 -1
  273. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/[dreamId]/page.tsx +187 -2
  274. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/page.tsx +14 -1
  275. package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/projects/page.tsx +3 -0
  276. package/dist/dashboard-runtime/dashboard/src/app/api/v1/instances/connectivity/route.ts +66 -0
  277. package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-curator.ts +57 -52
  278. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.ts +39 -6
  279. package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/[action]/route.ts +22 -28
  280. package/dist/dashboard-runtime/dashboard/src/app/onboarding/page.tsx +1 -3
  281. package/dist/dashboard-runtime/dashboard/src/components/chat/mount-picker.tsx +5 -1
  282. package/dist/dashboard-runtime/dashboard/src/components/instance/instance-connectivity-dot.tsx +96 -0
  283. package/dist/dashboard-runtime/dashboard/src/components/instance/project-card.tsx +5 -1
  284. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-gate.tsx +23 -5
  285. package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-switcher.tsx +23 -5
  286. package/dist/dashboard-runtime/dashboard/src/components/layout/instance-switcher.tsx +13 -1
  287. package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-instance-card.tsx +29 -4
  288. package/dist/dashboard-runtime/dashboard/src/components/memory/file-details-panel.tsx +4 -4
  289. package/dist/dashboard-runtime/dashboard/src/components/memory/file-editor.tsx +9 -4
  290. package/dist/dashboard-runtime/dashboard/src/components/memory/file-version-history.tsx +107 -57
  291. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-create-dialog.tsx +253 -68
  292. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-plan-approval-dialog.tsx +172 -0
  293. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-files-browser.tsx +104 -56
  294. package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +204 -52
  295. package/dist/dashboard-runtime/dashboard/src/components/memory/scope-combobox.tsx +169 -42
  296. package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +4 -3
  297. package/dist/dashboard-runtime/dashboard/src/components/shared/llm-model-selector.tsx +5 -1
  298. package/dist/dashboard-runtime/dashboard/src/components/ui/dialog.tsx +1 -1
  299. package/dist/dashboard-runtime/dashboard/src/contexts/subspace-context.tsx +144 -30
  300. package/dist/dashboard-runtime/dashboard/src/hooks/use-approve-dream-plan.ts +25 -0
  301. package/dist/dashboard-runtime/dashboard/src/hooks/use-file-memory.ts +73 -72
  302. package/dist/dashboard-runtime/dashboard/src/hooks/use-instances.ts +40 -0
  303. package/dist/dashboard-runtime/dashboard/src/hooks/use-subspace-history.ts +64 -75
  304. package/dist/dashboard-runtime/dashboard/src/i18n/locales/en.ts +82 -7
  305. package/dist/dashboard-runtime/dashboard/src/i18n/locales/zh.ts +80 -7
  306. package/dist/dashboard-runtime/dashboard/src/lib/browser-file-memory.ts +31 -25
  307. package/dist/dashboard-runtime/dashboard/src/lib/memory-scope-history.ts +165 -0
  308. package/dist/dashboard-runtime/dashboard/src/lib/memory.ts +13 -0
  309. package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +10 -14
  310. package/dist/dashboard-runtime/dashboard/src/lib/server/api-helpers.ts +5 -0
  311. package/dist/dashboard-runtime/dashboard/src/lib/server/instance-connectivity.ts +136 -0
  312. package/dist/dashboard-runtime/dashboard/src/lib/server/sdk-client.ts +25 -3
  313. package/dist/dashboard-runtime/dashboard/src/lib/subspace-history.ts +151 -0
  314. package/dist/dashboard-runtime/dashboard/src/services/file-memory.ts +48 -56
  315. package/dist/dashboard-runtime/dashboard/src/services/instances.ts +5 -0
  316. package/dist/dashboard-runtime/dashboard/src/services/memory.ts +45 -5
  317. package/dist/dashboard-runtime/dashboard/src/types/file-memory.ts +96 -43
  318. package/dist/dashboard-runtime/dashboard/src/types/instance.ts +17 -0
  319. package/dist/dashboard-runtime/dashboard/src/types/memory.ts +50 -3
  320. package/dist/dashboard-runtime/dashboard/tsconfig.tsbuildinfo +1 -1
  321. package/dist/dashboard-runtime/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  322. package/dist/dashboard-runtime/node_modules/@img/{sharp-linux-x64 → sharp-darwin-arm64}/package.json +7 -13
  323. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/README.md +2 -2
  324. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/lib/glib-2.0/include/glibconfig.h +8 -9
  325. 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
  326. package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/package.json +5 -11
  327. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +9 -55
  328. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  329. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +25 -93
  330. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  331. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  332. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +4 -1
  333. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  334. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  335. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/package.json +1 -1
  336. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  337. package/dist/main.js +0 -0
  338. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +9 -55
  339. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
  340. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +25 -93
  341. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
  342. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
  343. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +4 -1
  344. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
  345. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
  346. package/dist/node_modules/@tablestore/tablestore-agent-sdk/package.json +1 -1
  347. package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
  348. package/package.json +3 -3
  349. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0dzh4cj._.js +0 -40
  350. package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0k7ex0r._.js +0 -40
  351. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__01f7est._.js +0 -3
  352. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0cj2gsm._.js +0 -3
  353. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_05bw0~2._.js +0 -3
  354. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_071hi50._.js +0 -3
  355. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0hy21o9._.js +0 -3
  356. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xrd8-1._.js +0 -3
  357. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0y7vx.d._.js +0 -3
  358. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13ctfae._.js +0 -3
  359. package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0sr_ner._.js +0 -3
  360. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-~e5~2eoun8n.js +0 -1
  361. package/dist/dashboard-runtime/dashboard/.next/static/chunks/029zyc1pxa~4m.js +0 -1
  362. package/dist/dashboard-runtime/dashboard/.next/static/chunks/05vzt~ml0z7~9.js +0 -1
  363. package/dist/dashboard-runtime/dashboard/.next/static/chunks/08o2~c-80nbla.js +0 -1
  364. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0_osn.dm_85jw.js +0 -1
  365. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0aj~rx1m.91ur.js +0 -5
  366. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dx_8pb_z_xy6.css +0 -1
  367. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k9guaejnlc0r.js +0 -1
  368. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ll488v66ycn1.js +0 -1
  369. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pxisu-1mnehf.js +0 -1
  370. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vn5pp.3keyh5.js +0 -1
  371. package/dist/dashboard-runtime/dashboard/.next/static/chunks/0wbozn0wq-4ls.js +0 -1
  372. package/dist/dashboard-runtime/dashboard/.next/static/chunks/12iur8ibdfi5_.js +0 -1
  373. package/dist/dashboard-runtime/dashboard/.next/static/chunks/13kxz9vygidrz.js +0 -1
  374. package/dist/dashboard-runtime/dashboard/.next/static/chunks/165fwg-5at5cq.js +0 -1
  375. package/dist/dashboard-runtime/dashboard/.next/static/chunks/17b4md7atp39z.js +0 -1
  376. package/dist/dashboard-runtime/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  377. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts +0 -153
  378. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts.map +0 -1
  379. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js +0 -451
  380. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js.map +0 -1
  381. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts +0 -56
  382. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts.map +0 -1
  383. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js +0 -120
  384. package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js.map +0 -1
  385. package/dist/dashboard-runtime/node_modules/semver/node_modules/.bin/semver +0 -21
  386. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts +0 -153
  387. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.d.ts.map +0 -1
  388. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js +0 -451
  389. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/file-memory.js.map +0 -1
  390. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts +0 -56
  391. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts.map +0 -1
  392. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js +0 -120
  393. package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js.map +0 -1
  394. /package/dist/dashboard-runtime/dashboard/.next/static/{AgybWIwFBY3-L1V2Copiq → 8G6beqTEKH_-N0JljpgWT}/_buildManifest.js +0 -0
  395. /package/dist/dashboard-runtime/dashboard/.next/static/{AgybWIwFBY3-L1V2Copiq → 8G6beqTEKH_-N0JljpgWT}/_clientMiddlewareManifest.js +0 -0
  396. /package/dist/dashboard-runtime/dashboard/.next/static/{AgybWIwFBY3-L1V2Copiq → 8G6beqTEKH_-N0JljpgWT}/_ssgManifest.js +0 -0
  397. /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/lib/index.js +0 -0
  398. /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/versions.json +0 -0
@@ -9,6 +9,7 @@ import { toast } from "sonner";
9
9
  import { Plus, Trash2 } from "lucide-react";
10
10
 
11
11
  import { Button } from "@/components/ui/button";
12
+ import { Checkbox } from "@/components/ui/checkbox";
12
13
  import {
13
14
  Dialog,
14
15
  DialogContent,
@@ -44,7 +45,11 @@ import { useCreateDreamTask } from "@/hooks/use-create-dream-task";
44
45
  import { ScopeCombobox } from "@/components/memory/scope-combobox";
45
46
  import { useI18n } from "@/i18n/i18n-context";
46
47
  import type { TranslateFn } from "@/i18n/i18n-context";
47
- import type { DreamTaskType, MemoryScope } from "@/types/memory";
48
+ import type {
49
+ CreateDreamTaskRequest,
50
+ DreamTaskType,
51
+ MemoryScope,
52
+ } from "@/types/memory";
48
53
 
49
54
  interface DreamCreateDialogProps {
50
55
  memoryStoreName: string;
@@ -59,10 +64,14 @@ interface DreamSchemaMessages {
59
64
  atLeastOneNonWildcard: string;
60
65
  atLeastOneScope: string;
61
66
  scopesLimit: string;
67
+ agenticScopesLimit: string;
68
+ executionModeCombination: string;
69
+ taskTypeExecutionMode: string;
62
70
  instructionsLimit: string;
63
71
  maxSessionsRange: string;
64
72
  maxMessagesRange: string;
65
73
  maxMemoriesRange: string;
74
+ expandedScopeLimitRange: string;
66
75
  thresholdRange: string;
67
76
  timestampInvalid: string;
68
77
  timestampOrder: string;
@@ -73,10 +82,14 @@ const DEFAULT_SCHEMA_MESSAGES: DreamSchemaMessages = {
73
82
  atLeastOneNonWildcard: "至少指定一个非通配符字段",
74
83
  atLeastOneScope: "至少一个 scope",
75
84
  scopesLimit: "scope 最多 20 个",
85
+ agenticScopesLimit: "Agentic Dream scope 最多 8 个",
86
+ executionModeCombination: "执行模式与应用模式组合无效",
87
+ taskTypeExecutionMode: "技能与画像任务不支持 multi_loop",
76
88
  instructionsLimit: "指令不能超过 4000 字节(UTF-8)",
77
- maxSessionsRange: "最大会话数必须是 1 到 100 之间的整数",
78
- maxMessagesRange: "最大消息数必须是 1 到 20000 之间的整数",
79
- maxMemoriesRange: "最大记忆数必须是 1 到 5000 之间的整数",
89
+ maxSessionsRange: "最大会话数必须是 0 到 100 之间的整数",
90
+ maxMessagesRange: "最大消息数必须是 0 到 20000 之间的整数",
91
+ maxMemoriesRange: "最大记忆数必须是 0 到 5000 之间的整数",
92
+ expandedScopeLimitRange: "展开 scope 上限必须是 0 到 1000 之间的整数",
80
93
  thresholdRange: "置信度阈值必须在 0 到 1 之间",
81
94
  timestampInvalid: "时间格式不正确",
82
95
  timestampOrder: "最晚时间不能早于最早时间",
@@ -104,7 +117,7 @@ function optionalIntegerString(max: number, message: string) {
104
117
  .superRefine((value, ctx) => {
105
118
  if (!value) return;
106
119
  const parsed = Number(value);
107
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > max) {
120
+ if (!Number.isInteger(parsed) || parsed < 0 || parsed > max) {
108
121
  ctx.addIssue({ code: z.ZodIssueCode.custom, message });
109
122
  }
110
123
  });
@@ -142,17 +155,23 @@ function createDreamFormSchema(messages: DreamSchemaMessages) {
142
155
  return z
143
156
  .object({
144
157
  taskType: z.enum(["memory", "skill", "profile"]),
158
+ executionMode: z.enum(["single_loop", "multi_loop"]),
145
159
  scopes: z
146
160
  .array(scopeSchema)
147
161
  .min(1, messages.atLeastOneScope)
148
162
  .max(20, messages.scopesLimit),
149
- applyMode: z.enum(["proposal", "safe_auto"]),
163
+ applyMode: z.enum(["proposal", "safe_auto", "plan"]).optional(),
164
+ incremental: z.boolean().optional(),
150
165
  scopeOutputMode: z.enum(["preserve_scope", "promote_scope"]).optional(),
151
166
  minTimestamp: optionalTimestampString(messages.timestampInvalid),
152
167
  maxTimestamp: optionalTimestampString(messages.timestampInvalid),
153
168
  maxSessions: optionalIntegerString(100, messages.maxSessionsRange),
154
169
  maxMessages: optionalIntegerString(20_000, messages.maxMessagesRange),
155
170
  maxMemories: optionalIntegerString(5_000, messages.maxMemoriesRange),
171
+ expandedScopeLimit: optionalIntegerString(
172
+ 1_000,
173
+ messages.expandedScopeLimitRange,
174
+ ),
156
175
  instructions: z
157
176
  .string()
158
177
  .optional()
@@ -170,18 +189,71 @@ function createDreamFormSchema(messages: DreamSchemaMessages) {
170
189
  thresholdMerge: optionalThresholdString(messages.thresholdRange),
171
190
  })
172
191
  .superRefine((values, ctx) => {
173
- if (!values.minTimestamp || !values.maxTimestamp) return;
174
- const minTimestamp = Date.parse(values.minTimestamp);
175
- const maxTimestamp = Date.parse(values.maxTimestamp);
176
- if (
177
- Number.isFinite(minTimestamp) &&
178
- Number.isFinite(maxTimestamp) &&
179
- maxTimestamp < minTimestamp
192
+ if (values.minTimestamp && values.maxTimestamp) {
193
+ const minTimestamp = Date.parse(values.minTimestamp);
194
+ const maxTimestamp = Date.parse(values.maxTimestamp);
195
+ if (
196
+ Number.isFinite(minTimestamp) &&
197
+ Number.isFinite(maxTimestamp) &&
198
+ maxTimestamp < minTimestamp
199
+ ) {
200
+ ctx.addIssue({
201
+ code: z.ZodIssueCode.custom,
202
+ message: messages.timestampOrder,
203
+ path: ["maxTimestamp"],
204
+ });
205
+ }
206
+ }
207
+
208
+ if (values.taskType !== "memory") {
209
+ if (values.executionMode === "multi_loop") {
210
+ ctx.addIssue({
211
+ code: z.ZodIssueCode.custom,
212
+ message: messages.taskTypeExecutionMode,
213
+ path: ["executionMode"],
214
+ });
215
+ }
216
+ if (values.applyMode !== undefined) {
217
+ ctx.addIssue({
218
+ code: z.ZodIssueCode.custom,
219
+ message: messages.executionModeCombination,
220
+ path: ["applyMode"],
221
+ });
222
+ }
223
+ return;
224
+ }
225
+
226
+ if (values.applyMode === undefined) {
227
+ ctx.addIssue({
228
+ code: z.ZodIssueCode.custom,
229
+ message: messages.executionModeCombination,
230
+ path: ["applyMode"],
231
+ });
232
+ } else if (
233
+ values.executionMode === "single_loop" &&
234
+ values.applyMode === "plan"
180
235
  ) {
181
236
  ctx.addIssue({
182
237
  code: z.ZodIssueCode.custom,
183
- message: messages.timestampOrder,
184
- path: ["maxTimestamp"],
238
+ message: messages.executionModeCombination,
239
+ path: ["applyMode"],
240
+ });
241
+ } else if (
242
+ values.executionMode === "multi_loop" &&
243
+ values.applyMode === "proposal"
244
+ ) {
245
+ ctx.addIssue({
246
+ code: z.ZodIssueCode.custom,
247
+ message: messages.executionModeCombination,
248
+ path: ["applyMode"],
249
+ });
250
+ }
251
+
252
+ if (values.executionMode === "multi_loop" && values.scopes.length > 8) {
253
+ ctx.addIssue({
254
+ code: z.ZodIssueCode.custom,
255
+ message: messages.agenticScopesLimit,
256
+ path: ["scopes"],
185
257
  });
186
258
  }
187
259
  });
@@ -198,22 +270,27 @@ function buildFormSchema(t: TranslateFn) {
198
270
  atLeastOneNonWildcard: t("memory.dream.atLeastOneNonWildcard"),
199
271
  atLeastOneScope: t("memory.dream.atLeastOneScope"),
200
272
  scopesLimit: t("memory.dream.scopesLimit"),
273
+ agenticScopesLimit: t("memory.dream.agenticScopesLimit"),
274
+ executionModeCombination: t("memory.dream.executionModeCombination"),
275
+ taskTypeExecutionMode: t("memory.dream.taskTypeExecutionMode"),
201
276
  instructionsLimit: t("memory.dream.instructionsLimit"),
202
277
  maxSessionsRange: t("memory.dream.maxSessionsRange"),
203
278
  maxMessagesRange: t("memory.dream.maxMessagesRange"),
204
279
  maxMemoriesRange: t("memory.dream.maxMemoriesRange"),
280
+ expandedScopeLimitRange: t("memory.dream.expandedScopeLimitRange"),
205
281
  thresholdRange: t("memory.dream.thresholdRange"),
206
282
  timestampInvalid: t("memory.dream.timestampInvalid"),
207
283
  timestampOrder: t("memory.dream.timestampOrder"),
208
284
  });
209
285
  }
210
286
 
211
- type FormValues = z.infer<typeof dreamCreateFormSchema>;
287
+ export type DreamCreateFormValues = z.infer<typeof dreamCreateFormSchema>;
288
+ type FormValues = DreamCreateFormValues;
212
289
 
213
290
  function parseOptionalInt(raw: string | undefined): number | undefined {
214
- if (!raw) return undefined;
291
+ if (raw === undefined || raw.trim() === "") return undefined;
215
292
  const n = Number(raw);
216
- if (!Number.isFinite(n) || !Number.isInteger(n) || n <= 0) return undefined;
293
+ if (!Number.isFinite(n) || !Number.isInteger(n) || n < 0) return undefined;
217
294
  return n;
218
295
  }
219
296
 
@@ -224,6 +301,61 @@ function parseOptionalThreshold(raw: string | undefined): number | undefined {
224
301
  return n;
225
302
  }
226
303
 
304
+ export function buildDreamCreateRequest(
305
+ values: DreamCreateFormValues,
306
+ ): CreateDreamTaskRequest {
307
+ const thresholds: Record<string, number> = {};
308
+ const thresholdAdd = parseOptionalThreshold(values.thresholdAdd);
309
+ const thresholdUpdate = parseOptionalThreshold(values.thresholdUpdate);
310
+ const thresholdMerge = parseOptionalThreshold(values.thresholdMerge);
311
+ if (thresholdAdd !== undefined) thresholds.add = thresholdAdd;
312
+ if (thresholdUpdate !== undefined) thresholds.update = thresholdUpdate;
313
+ if (thresholdMerge !== undefined) thresholds.merge = thresholdMerge;
314
+
315
+ const isMemory = values.taskType === "memory";
316
+ return {
317
+ scopes: values.scopes.map((scope) => {
318
+ const result: MemoryScope = { appId: scope.appId };
319
+ if (scope.tenantId) result.tenantId = scope.tenantId;
320
+ if (scope.agentId) result.agentId = scope.agentId;
321
+ if (scope.runId) result.runId = scope.runId;
322
+ return result;
323
+ }),
324
+ taskType: values.taskType,
325
+ executionMode: values.executionMode,
326
+ incremental: Boolean(values.incremental),
327
+ ...(isMemory && values.applyMode && { applyMode: values.applyMode }),
328
+ ...(isMemory &&
329
+ values.scopeOutputMode && {
330
+ scopeOutputMode: values.scopeOutputMode,
331
+ }),
332
+ ...(values.minTimestamp && {
333
+ minTimestamp: Date.parse(values.minTimestamp),
334
+ }),
335
+ ...(values.maxTimestamp && {
336
+ maxTimestamp: Date.parse(values.maxTimestamp),
337
+ }),
338
+ ...(parseOptionalInt(values.maxSessions) !== undefined && {
339
+ maxSessions: parseOptionalInt(values.maxSessions),
340
+ }),
341
+ ...(parseOptionalInt(values.maxMessages) !== undefined && {
342
+ maxMessages: parseOptionalInt(values.maxMessages),
343
+ }),
344
+ ...(parseOptionalInt(values.maxMemories) !== undefined && {
345
+ maxMemories: parseOptionalInt(values.maxMemories),
346
+ }),
347
+ ...(parseOptionalInt(values.expandedScopeLimit) !== undefined && {
348
+ expandedScopeLimit: parseOptionalInt(values.expandedScopeLimit),
349
+ }),
350
+ ...(values.instructions && { instructions: values.instructions }),
351
+ ...(values.clientToken && { clientToken: values.clientToken }),
352
+ ...(isMemory &&
353
+ Object.keys(thresholds).length > 0 && {
354
+ confidenceThresholds: thresholds,
355
+ }),
356
+ };
357
+ }
358
+
227
359
  export function MemoryDreamCreateDialog(props: DreamCreateDialogProps) {
228
360
  const { locale } = useI18n();
229
361
  return <MemoryDreamCreateDialogInner key={locale} {...props} />;
@@ -265,7 +397,9 @@ function MemoryDreamCreateDialogInner({
265
397
  : "",
266
398
  },
267
399
  ],
400
+ executionMode: "single_loop",
268
401
  applyMode: "proposal",
402
+ incremental: false,
269
403
  },
270
404
  });
271
405
 
@@ -281,49 +415,10 @@ function MemoryDreamCreateDialogInner({
281
415
  const [thresholdsOpen, setThresholdsOpen] = useState(false);
282
416
 
283
417
  const onSubmit = async (values: FormValues) => {
284
- const thresholds: Record<string, number> = {};
285
- const tAdd = parseOptionalThreshold(values.thresholdAdd);
286
- const tUpdate = parseOptionalThreshold(values.thresholdUpdate);
287
- const tMerge = parseOptionalThreshold(values.thresholdMerge);
288
- if (tAdd !== undefined) thresholds.add = tAdd;
289
- if (tUpdate !== undefined) thresholds.update = tUpdate;
290
- if (tMerge !== undefined) thresholds.merge = tMerge;
291
-
292
- const isMemory = values.taskType === "memory";
293
-
294
418
  try {
295
- const result = await createMutation.mutateAsync({
296
- scopes: values.scopes.map((s) => {
297
- const out: MemoryScope = { appId: s.appId };
298
- if (s.tenantId) out.tenantId = s.tenantId;
299
- if (s.agentId) out.agentId = s.agentId;
300
- if (s.runId) out.runId = s.runId;
301
- return out;
302
- }),
303
- taskType: values.taskType,
304
- ...(isMemory && { applyMode: values.applyMode }),
305
- ...(isMemory &&
306
- values.scopeOutputMode && {
307
- scopeOutputMode: values.scopeOutputMode,
308
- }),
309
- ...(values.minTimestamp && { minTimestamp: values.minTimestamp }),
310
- ...(values.maxTimestamp && { maxTimestamp: values.maxTimestamp }),
311
- ...(parseOptionalInt(values.maxSessions) !== undefined && {
312
- maxSessions: parseOptionalInt(values.maxSessions),
313
- }),
314
- ...(parseOptionalInt(values.maxMessages) !== undefined && {
315
- maxMessages: parseOptionalInt(values.maxMessages),
316
- }),
317
- ...(parseOptionalInt(values.maxMemories) !== undefined && {
318
- maxMemories: parseOptionalInt(values.maxMemories),
319
- }),
320
- ...(values.instructions && { instructions: values.instructions }),
321
- ...(values.clientToken && { clientToken: values.clientToken }),
322
- ...(isMemory &&
323
- Object.keys(thresholds).length > 0 && {
324
- confidenceThresholds: thresholds,
325
- }),
326
- });
419
+ const result = await createMutation.mutateAsync(
420
+ buildDreamCreateRequest(values),
421
+ );
327
422
 
328
423
  const TOAST_MSG: Record<DreamTaskType, string> = {
329
424
  memory: t("memory.dream.toastMemoryCreated"),
@@ -362,8 +457,16 @@ function MemoryDreamCreateDialogInner({
362
457
  <FormItem>
363
458
  <FormLabel>{t("memory.dream.taskType")}</FormLabel>
364
459
  <Select
365
- onValueChange={field.onChange}
366
- defaultValue={field.value}
460
+ onValueChange={(value) => {
461
+ field.onChange(value);
462
+ if (value === "memory") {
463
+ form.setValue("applyMode", "proposal");
464
+ } else {
465
+ form.setValue("executionMode", "single_loop");
466
+ form.setValue("applyMode", undefined);
467
+ }
468
+ }}
469
+ value={field.value}
367
470
  >
368
471
  <FormControl>
369
472
  <SelectTrigger>
@@ -468,8 +571,50 @@ function MemoryDreamCreateDialogInner({
468
571
  </div>
469
572
  </section>
470
573
 
471
- {isMemoryType && (
472
- <section className="grid gap-3 sm:grid-cols-2">
574
+ <section className="grid gap-3 sm:grid-cols-3">
575
+ <FormField
576
+ control={form.control}
577
+ name="executionMode"
578
+ render={({ field }) => (
579
+ <FormItem>
580
+ <FormLabel>{t("memory.dream.executionMode")}</FormLabel>
581
+ <Select
582
+ onValueChange={(value) => {
583
+ field.onChange(value);
584
+ const applyMode = form.getValues("applyMode");
585
+ if (
586
+ value === "multi_loop" &&
587
+ applyMode === "proposal"
588
+ ) {
589
+ form.setValue("applyMode", "safe_auto");
590
+ }
591
+ if (value === "single_loop" && applyMode === "plan") {
592
+ form.setValue("applyMode", "proposal");
593
+ }
594
+ }}
595
+ value={field.value}
596
+ >
597
+ <FormControl>
598
+ <SelectTrigger>
599
+ <SelectValue />
600
+ </SelectTrigger>
601
+ </FormControl>
602
+ <SelectContent>
603
+ <SelectItem value="single_loop">
604
+ {t("memory.dream.executionModeSingle")}
605
+ </SelectItem>
606
+ {isMemoryType && (
607
+ <SelectItem value="multi_loop">
608
+ {t("memory.dream.executionModeMulti")}
609
+ </SelectItem>
610
+ )}
611
+ </SelectContent>
612
+ </Select>
613
+ <FormMessage />
614
+ </FormItem>
615
+ )}
616
+ />
617
+ {isMemoryType && (
473
618
  <FormField
474
619
  control={form.control}
475
620
  name="applyMode"
@@ -477,8 +622,18 @@ function MemoryDreamCreateDialogInner({
477
622
  <FormItem>
478
623
  <FormLabel>{t("memory.dream.applyMode")}</FormLabel>
479
624
  <Select
480
- onValueChange={field.onChange}
481
- defaultValue={field.value}
625
+ onValueChange={(value) => {
626
+ field.onChange(value);
627
+ if (value === "plan") {
628
+ form.setValue("executionMode", "multi_loop");
629
+ } else if (
630
+ value === "proposal" &&
631
+ form.getValues("executionMode") === "multi_loop"
632
+ ) {
633
+ form.setValue("executionMode", "single_loop");
634
+ }
635
+ }}
636
+ value={field.value ?? "proposal"}
482
637
  >
483
638
  <FormControl>
484
639
  <SelectTrigger>
@@ -492,12 +647,17 @@ function MemoryDreamCreateDialogInner({
492
647
  <SelectItem value="safe_auto">
493
648
  {t("memory.dream.applyModeSafeAutoOption")}
494
649
  </SelectItem>
650
+ <SelectItem value="plan">
651
+ {t("memory.dream.applyModePlanOption")}
652
+ </SelectItem>
495
653
  </SelectContent>
496
654
  </Select>
497
655
  <FormMessage />
498
656
  </FormItem>
499
657
  )}
500
658
  />
659
+ )}
660
+ {isMemoryType && (
501
661
  <FormField
502
662
  control={form.control}
503
663
  name="scopeOutputMode"
@@ -530,8 +690,8 @@ function MemoryDreamCreateDialogInner({
530
690
  </FormItem>
531
691
  )}
532
692
  />
533
- </section>
534
- )}
693
+ )}
694
+ </section>
535
695
 
536
696
  <FormField
537
697
  control={form.control}
@@ -623,6 +783,11 @@ function MemoryDreamCreateDialogInner({
623
783
  label={t("memory.dream.maxMemories")}
624
784
  form={form}
625
785
  />
786
+ <NumberField
787
+ name="expandedScopeLimit"
788
+ label={t("memory.dream.expandedScopeLimit")}
789
+ form={form}
790
+ />
626
791
  <DatetimeField
627
792
  name="minTimestamp"
628
793
  label={t("memory.dream.minTimestamp")}
@@ -648,6 +813,26 @@ function MemoryDreamCreateDialogInner({
648
813
  </FormItem>
649
814
  )}
650
815
  />
816
+ <FormField
817
+ control={form.control}
818
+ name="incremental"
819
+ render={({ field }) => (
820
+ <FormItem className="flex items-center gap-2 pt-5">
821
+ <FormControl>
822
+ <Checkbox
823
+ checked={Boolean(field.value)}
824
+ onCheckedChange={(checked) =>
825
+ field.onChange(checked === true)
826
+ }
827
+ />
828
+ </FormControl>
829
+ <FormLabel className="text-xs">
830
+ {t("memory.dream.incremental")}
831
+ </FormLabel>
832
+ <FormMessage />
833
+ </FormItem>
834
+ )}
835
+ />
651
836
  </CollapsibleContent>
652
837
  </Collapsible>
653
838
 
@@ -0,0 +1,172 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { toast } from "sonner";
5
+
6
+ import { Button } from "@/components/ui/button";
7
+ import {
8
+ Dialog,
9
+ DialogContent,
10
+ DialogDescription,
11
+ DialogFooter,
12
+ DialogHeader,
13
+ DialogTitle,
14
+ } from "@/components/ui/dialog";
15
+ import { Input } from "@/components/ui/input";
16
+ import { Label } from "@/components/ui/label";
17
+ import { useApproveDreamPlan } from "@/hooks/use-approve-dream-plan";
18
+ import { useI18n } from "@/i18n/i18n-context";
19
+ import type { DreamPlan, DreamTaskStatus } from "@/types/memory";
20
+
21
+ interface DreamPlanTask {
22
+ dreamId: string;
23
+ status: DreamTaskStatus;
24
+ plan?: DreamPlan;
25
+ }
26
+
27
+ export type DreamPlanDecision =
28
+ | { kind: "approve"; dreamId: string; approver: string }
29
+ | { kind: "cancel"; dreamId: string };
30
+
31
+ export function buildDreamPlanDecision(
32
+ task: DreamPlanTask,
33
+ decision: "approve" | "reject",
34
+ approver?: string,
35
+ ): DreamPlanDecision {
36
+ if (task.status !== "awaiting_plan_approval") {
37
+ throw new Error(
38
+ `Dream task must be awaiting_plan_approval; current status is ${task.status}`,
39
+ );
40
+ }
41
+ if (decision === "reject") {
42
+ return { kind: "cancel", dreamId: task.dreamId };
43
+ }
44
+ if (
45
+ !task.plan ||
46
+ typeof task.plan.summary !== "string" ||
47
+ task.plan.summary.trim() === "" ||
48
+ !Array.isArray(task.plan.deleteMemoryIds) ||
49
+ !task.plan.deleteMemoryIds.every(
50
+ (memoryId) => typeof memoryId === "string" && memoryId.trim() !== "",
51
+ )
52
+ ) {
53
+ throw new Error("Dream task does not contain a valid plan");
54
+ }
55
+ const trimmedApprover = approver?.trim() ?? "";
56
+ if (trimmedApprover === "") {
57
+ throw new Error("Approver is required");
58
+ }
59
+ return {
60
+ kind: "approve",
61
+ dreamId: task.dreamId,
62
+ approver: trimmedApprover,
63
+ };
64
+ }
65
+
66
+ interface MemoryDreamPlanApprovalDialogProps {
67
+ memoryStoreName: string;
68
+ task: DreamPlanTask;
69
+ open: boolean;
70
+ onOpenChange: (open: boolean) => void;
71
+ }
72
+
73
+ export function MemoryDreamPlanApprovalDialog({
74
+ memoryStoreName,
75
+ task,
76
+ open,
77
+ onOpenChange,
78
+ }: MemoryDreamPlanApprovalDialogProps) {
79
+ const { t } = useI18n();
80
+ const approveMutation = useApproveDreamPlan(memoryStoreName);
81
+ const [approver, setApprover] = useState("");
82
+
83
+ const handleOpenChange = (nextOpen: boolean) => {
84
+ if (!nextOpen) setApprover("");
85
+ onOpenChange(nextOpen);
86
+ };
87
+
88
+ const handleApprove = async () => {
89
+ try {
90
+ const decision = buildDreamPlanDecision(task, "approve", approver);
91
+ if (decision.kind !== "approve") return;
92
+ await approveMutation.mutateAsync({
93
+ dreamId: decision.dreamId,
94
+ approver: decision.approver,
95
+ });
96
+ toast.success(t("memory.dream.planApprovalSuccess"));
97
+ handleOpenChange(false);
98
+ } catch (error) {
99
+ toast.error(
100
+ error instanceof Error
101
+ ? error.message
102
+ : t("memory.dream.planApprovalFailed"),
103
+ );
104
+ }
105
+ };
106
+
107
+ const plan = task.plan;
108
+ return (
109
+ <Dialog open={open} onOpenChange={handleOpenChange}>
110
+ <DialogContent className="max-w-2xl">
111
+ <DialogHeader>
112
+ <DialogTitle>{t("memory.dream.planApprovalTitle")}</DialogTitle>
113
+ <DialogDescription>
114
+ {t("memory.dream.planApprovalDescription")}
115
+ </DialogDescription>
116
+ </DialogHeader>
117
+
118
+ <div className="space-y-4">
119
+ <section className="rounded-md border border-[hsl(var(--border))] p-3">
120
+ <h4 className="mb-1 text-xs font-semibold uppercase text-muted-foreground">
121
+ {t("memory.dream.planSummary")}
122
+ </h4>
123
+ <p className="whitespace-pre-wrap text-sm">{plan?.summary}</p>
124
+ </section>
125
+ <section className="rounded-md border border-[hsl(var(--border))] p-3">
126
+ <h4 className="mb-2 text-xs font-semibold uppercase text-muted-foreground">
127
+ {t("memory.dream.planDeletionWhitelist")}
128
+ </h4>
129
+ {plan?.deleteMemoryIds.length ? (
130
+ <ul className="space-y-1 font-mono text-xs">
131
+ {plan.deleteMemoryIds.map((memoryId) => (
132
+ <li key={memoryId} className="break-all">
133
+ {memoryId}
134
+ </li>
135
+ ))}
136
+ </ul>
137
+ ) : (
138
+ <p className="text-sm text-muted-foreground">
139
+ {t("memory.dream.planNoDeletions")}
140
+ </p>
141
+ )}
142
+ </section>
143
+ <div className="space-y-2">
144
+ <Label htmlFor="dream-plan-approver">
145
+ {t("memory.dream.planApprover")}
146
+ </Label>
147
+ <Input
148
+ id="dream-plan-approver"
149
+ value={approver}
150
+ onChange={(event) => setApprover(event.target.value)}
151
+ placeholder={t("memory.dream.planApproverPlaceholder")}
152
+ />
153
+ </div>
154
+ </div>
155
+
156
+ <DialogFooter>
157
+ <Button variant="outline" onClick={() => handleOpenChange(false)}>
158
+ {t("common.cancel")}
159
+ </Button>
160
+ <Button
161
+ onClick={handleApprove}
162
+ disabled={approveMutation.isPending || approver.trim() === ""}
163
+ >
164
+ {approveMutation.isPending
165
+ ? t("memory.dream.planApproving")
166
+ : t("memory.dream.planApprove")}
167
+ </Button>
168
+ </DialogFooter>
169
+ </DialogContent>
170
+ </Dialog>
171
+ );
172
+ }