@tablestore/tablestore-agent-cli 0.2.9 → 0.2.11
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.
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +33 -2
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/memory.d.ts.map +1 -1
- package/dist/commands/memory.js +171 -95
- package/dist/commands/memory.js.map +1 -1
- package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
- package/dist/dashboard-runtime/dashboard/.next/app-path-routes-manifest.json +1 -3
- package/dist/dashboard-runtime/dashboard/.next/build-manifest.json +3 -3
- package/dist/dashboard-runtime/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/dashboard-runtime/dashboard/.next/required-server-files.json +4 -4
- package/dist/dashboard-runtime/dashboard/.next/routes-manifest.json +5 -20
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/api-keys/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/documents/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/qa/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/retrieval/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/[name]/settings/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/create/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/knowledge-base/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/[id]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/new/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/[dreamId]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/dream/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/tasks/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.rsc +16 -16
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/custom-policy/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/effective-permissions/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/policies/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/[id]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/filter-by-permission/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/api-keys/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/status/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/auth/token/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/token/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/[name]/use/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/chunks/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/chunks/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/[docId]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/documents/upload/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/retrieve/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js +4 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/[name]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/knowledge-bases/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/chat/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/models/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/[id]/test/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/llm/providers/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/logs/client/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-kb-sync/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/apply/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/actions/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/cancel/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/[dreamId]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/dream-tasks/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route/app-paths-manifest.json +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route.js +6 -0
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{sync → [action]}/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route_client-reference-manifest.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/messages/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/requests/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/scopes/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/search/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/[requestId]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/tasks/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/[memoryId]/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/units/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/oss/list/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/runtime/context/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.rsc +15 -15
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.rsc +18 -18
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +18 -18
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +11 -11
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +4 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app-paths-manifest.json +1 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/05a2_app_api_v1_memory_stores_[store]_file-memory_[action]_route_actions_0m70if_.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +19 -12
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0--nu07._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.gylau._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.hvkwy._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.qtdn4._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02p1x3t._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__03og44p._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04dd04u._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04ujbw-._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04zbudf._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__0-3~.bv._.js → [root-of-the-server]__052epg.._.js} +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05eryp~._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06fva9g._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08_2avk._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0acvvri._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0byveuc._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cee_lo._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cyd2qb._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0dzh4cj._.js +40 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ecs-9r._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ejcow5._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0es0s_~._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0fglxiw._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0g3yw6w._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0i1_p1s._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0is6qso._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0k7ex0r._.js +40 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0no9qm0._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q8vcw8._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q9fgt6._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0rx9hon._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0tc-.6s._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0u03tze._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ua_nqs._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0uebf40._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0v0il3n._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/{[root-of-the-server]__089es3y._.js → [root-of-the-server]__0w56nne._.js} +10 -10
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0w_ig2a._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0y0w3mg._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zmo~nd._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__10m-wmo._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11s_zx6._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__11wq90l._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__126srko._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12e1t6o._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12ylr4n._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13g_f9w._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13q2wbt._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13~-fxp._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0.ooo1s._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__01f7est._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07fsbff._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0b5cw4e._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0cj2gsm._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.pa1e6._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01snuz~._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_05bw0~2._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_071hi50._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0_aw2vr._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ep_q37._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ez3yia._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fttf6a._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fz3kge._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0hx2079._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0hy21o9._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0oiggmj._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0p0sh02._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0uc_gmf._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0wce254._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ww5s91._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xrd8-1._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0y4mxf8._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0y7vx.d._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_12l8jkb._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_079nj-_._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0_z9696._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0bhjp9s._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0grv2wq._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_api-keys_page_tsx_0lb6fu7._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_dream_page_tsx_0uzzpvs._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_layout_tsx_0rbi41w._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_messages_page_tsx_0votz-n._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_tasks_page_tsx_0a_bgx4._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_units_page_tsx_0.6xnei._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_memory_memory-files-browser_tsx_0o2~94-._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_i18n_i18n-context_tsx_0c39ewr._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_providers_runtime-context-provider_tsx_0wmj66z._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0sr_ner._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/functions-config-manifest.json +1 -3
- package/dist/dashboard-runtime/dashboard/.next/server/middleware-build-manifest.js +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/pages/404.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/pages/500.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/server-reference-manifest.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-~e5~2eoun8n.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.hi0qmo.f-h4.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/01xcynczarvq~.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/01xuyqw7ivp3n.js +138 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/026lyw-ynx1og.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/029zyc1pxa~4m.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/05_iqjh-v2gej.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/05f4mjbi6x-tm.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/05vzt~ml0z7~9.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/07twdccs42b_-.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{010bpq~3ntjcm.js → 08h7wustf~cl4.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/08o2~c-80nbla.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/090n1_814n.n~.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0_osn.dm_85jw.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0aj~rx1m.91ur.js +5 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dx_8pb_z_xy6.css +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0eafb9pun~54k.js +9 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0hnqmb1a7y7x1.js +138 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jjiw-agnutux.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0k9guaejnlc0r.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0l~3_bvic.da3.js → 0ogrq_r43je48.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pxisu-1mnehf.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0r6utd8g~.cc1.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6c8q4k~6aiy.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0uu2cjfwvbn3y.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vn5pp.3keyh5.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0wbozn0wq-4ls.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yvc~t7p88wsf.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{02u9ocsl0a12t.js → 0~naqbx3873~r.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/12iur8ibdfi5_.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/13kxz9vygidrz.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/14.8mq880kjoc.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/145hqnc~4wc~n.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/14rpr3z1.lmgj.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/165fwg-5at5cq.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/17b4md7atp39z.js +1 -0
- package/dist/dashboard-runtime/dashboard/server.js +1 -1
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/chat/page.tsx +1 -0
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/qa/page.tsx +1 -0
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/layout.tsx +59 -8
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/messages/page.tsx +15 -0
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/tasks/page.tsx +9 -0
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +123 -24
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-curator.ts +491 -0
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/file-memory-helpers.ts +12 -81
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/memory-helpers.ts +3 -3
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/route.ts +200 -39
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/[action]/route.ts +92 -0
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/_helpers.ts +26 -36
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/_request.ts +49 -0
- package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +48 -9
- package/dist/dashboard-runtime/dashboard/src/components/chat/memory-bind-section.tsx +66 -18
- package/dist/dashboard-runtime/dashboard/src/components/chat/memory-files-dialog.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-details-panel.tsx +91 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-editor.tsx +139 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-mutation-dialogs.tsx +181 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-scope-onboarding.tsx +154 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-version-history.tsx +201 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-workspace-toolbar.tsx +101 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-create-form.tsx +166 -75
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-dream-create-dialog.tsx +147 -20
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-files-browser.tsx +452 -168
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +27 -21
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +51 -14
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +5 -1
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-settings-form.tsx +54 -46
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +126 -69
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +5 -1
- package/dist/dashboard-runtime/dashboard/src/components/qa/qa-message.tsx +232 -38
- package/dist/dashboard-runtime/dashboard/src/components/shared/error-state.tsx +3 -2
- package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +125 -47
- package/dist/dashboard-runtime/dashboard/src/hooks/use-file-memory.ts +184 -29
- package/dist/dashboard-runtime/dashboard/src/hooks/use-memory-store-scopes.ts +2 -1
- package/dist/dashboard-runtime/dashboard/src/hooks/use-qa-chat.ts +188 -23
- package/dist/dashboard-runtime/dashboard/src/i18n/locales/en.ts +123 -14
- package/dist/dashboard-runtime/dashboard/src/i18n/locales/zh.ts +115 -14
- package/dist/dashboard-runtime/dashboard/src/lib/api-error-toast.ts +9 -1
- package/dist/dashboard-runtime/dashboard/src/lib/browser-file-memory.ts +391 -0
- package/dist/dashboard-runtime/dashboard/src/lib/file-scope-history.ts +108 -0
- package/dist/dashboard-runtime/dashboard/src/lib/memory-storage-mode.ts +193 -31
- package/dist/dashboard-runtime/dashboard/src/lib/memory.ts +16 -4
- package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +67 -0
- package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +58 -13
- package/dist/dashboard-runtime/dashboard/src/services/file-memory.ts +88 -46
- package/dist/dashboard-runtime/dashboard/src/types/file-memory.ts +97 -0
- package/dist/dashboard-runtime/dashboard/src/types/llm-chat.ts +49 -13
- package/dist/dashboard-runtime/dashboard/src/types/memory.ts +9 -2
- package/dist/dashboard-runtime/dashboard/tsconfig.tsbuildinfo +1 -0
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +0 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +0 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +55 -8
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +93 -11
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts +56 -0
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts.map +1 -0
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js +120 -0
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js.map +1 -0
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +1 -0
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/package.json +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
- package/dist/dashboard-runtime/node_modules/semver/node_modules/.bin/semver +21 -0
- package/dist/main.js +0 -0
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts +0 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.d.ts.map +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js +0 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/index.js.map +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts +55 -8
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.d.ts.map +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js +93 -11
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/memory-client.js.map +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts +56 -0
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.d.ts.map +1 -0
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js +120 -0
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/oss-uploader.js.map +1 -0
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.d.ts.map +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js +1 -0
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/response.js.map +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/package.json +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-shared/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route/app-paths-manifest.json +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route.js +0 -6
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route.js.nft.json +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/file/route_client-reference-manifest.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route/app-paths-manifest.json +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route/build-manifest.json +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route/server-reference-manifest.json +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route.js +0 -6
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route.js.map +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/sync/route_client-reference-manifest.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/app-paths-manifest.json +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/build-manifest.json +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route/server-reference-manifest.json +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js +0 -6
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js.map +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route.js.nft.json +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/tree/route_client-reference-manifest.js +0 -3
- 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
- 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
- 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
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-dt7~s._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.-~ff4._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.l706t._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0.nejw_._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00_mrad._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00i.7se._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__00r7uqs._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__02~yw7n._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04kpzpa._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__04p1a88._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__05x0k4d._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__060s~oe._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06fanvv._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__06tci88._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08bzgzm._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08d7wb.._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__08p_m_c._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__095xiwn._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__09h95i6._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ai2k_o._.js +0 -40
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0alcygi._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0aspytx._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cq-9s~._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0cyiuai._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0d4zrpj._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0d~m09k._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0f1lugp._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0g1cfb7._.js +0 -40
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0gpz.~y._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0i3u9x3._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0iromt6._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0j8.u0y._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0k-pfaj._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0kcbz7k._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0nrl-.g._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0o5mf4h._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0omyr40._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ty8jgt._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ug_2kc._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0v98i9~._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0wt0ksb._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0ya_8d2._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zfg-ml._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0~9ru5n._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0~f7ckz._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__109i6ps._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__10o5zq5._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__12ls5l8._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/0w-2_lucide-react_dist_esm_icons_0h-3_0x._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0k0es2c._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ky8i.~._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ocsrt0._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ys4x_n._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__10rkv6z._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_002mc1c._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_04f2u4t._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06ny.4k._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0b9pl2d._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0e.ehti._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f8moq0._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f8yv4v._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fvg_xo._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0h9c.8m._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ip4ncy._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0izjcsk._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j.62sb._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0mdbcju._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0p_s55v._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0qiamjd._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0t.h859._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xp94lc._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_13730cz._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_00.1.s_._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_04o7mfc._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0qlyj-q._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_00usyu3._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0791f2k._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0--dupndun7xc.css +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.uxk~hsm6yi8.js +0 -138
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/00eggrx~.4c55.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/00lvoeu_v3253.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/00o9vmhspv._3.js +0 -138
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/00x1.t633f041.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/02p7gke47s.2~.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/03dth-av1gl-h.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/07s0f6938um2v.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/09y30vyml4r.b.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0au0pbejtwahz.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b-ei8-g7ceug.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0chiv044h3u58.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0fcdli-~wmvvx.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0fz_9~-rxluly.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0i55cqygnl-a9.js +0 -5
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j8p7vk~awgs..js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0j_.hkhjix9hw.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0naliud7av3p1.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pbfl~23ac79y.js +0 -9
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u3qx.qasmdx9.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vuh8jgeqqdy..js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0wbevjtr1_grz.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0y-gjpq3kxsbz.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0z_pq4ttgotxw.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/10i~m4_8ainxw.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/12535rmhzbk63.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/13uk2uuzuop5e.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/13vd4hv~l95-c.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/16.2aecdwo6w_.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/16yu0g~7n~33c.js +0 -1
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/file/route.ts +0 -69
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/sync/route.ts +0 -69
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/file-memory/tree/route.ts +0 -44
- /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{file → [action]}/route/build-manifest.json +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{file → [action]}/route/server-reference-manifest.json +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/{file → [action]}/route.js.map +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{be0fa_T3EkD9v2fJGsvLd → AgybWIwFBY3-L1V2Copiq}/_buildManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{be0fa_T3EkD9v2fJGsvLd → AgybWIwFBY3-L1V2Copiq}/_clientMiddlewareManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{be0fa_T3EkD9v2fJGsvLd → AgybWIwFBY3-L1V2Copiq}/_ssgManifest.js +0 -0
|
@@ -30,10 +30,11 @@ import {
|
|
|
30
30
|
formatMemoryBlock,
|
|
31
31
|
type MemoryWriteScope,
|
|
32
32
|
} from "./memory-helpers";
|
|
33
|
+
import { formatFileMemoryBlock } from "./file-memory-helpers";
|
|
33
34
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} from "./file-memory-
|
|
35
|
+
appendCuratedMemories,
|
|
36
|
+
extractDurableMemories,
|
|
37
|
+
} from "./file-memory-curator";
|
|
37
38
|
|
|
38
39
|
// Default aggregate cap when the client omits `rag.topK`.
|
|
39
40
|
const DEFAULT_AGGREGATE_TOP_K = 20;
|
|
@@ -94,6 +95,7 @@ const MAX_HISTORY_MESSAGES = 20;
|
|
|
94
95
|
* 用于控制 system 提示总长度,避免单个超长 chunk 把模型上下文挤爆。
|
|
95
96
|
*/
|
|
96
97
|
const MAX_CHUNK_DISPLAY_LENGTH = 1200;
|
|
98
|
+
const FILE_MEMORY_STORE_DESCRIBE_TIMEOUT_MS = 1_500;
|
|
97
99
|
const chatLogger = createLogger("dashboard.api.llm");
|
|
98
100
|
|
|
99
101
|
/**
|
|
@@ -245,7 +247,24 @@ export async function POST(request: NextRequest) {
|
|
|
245
247
|
};
|
|
246
248
|
// If the client disconnects mid-stream, propagate cancellation upstream so
|
|
247
249
|
// we stop paying for tokens we'll never deliver.
|
|
248
|
-
request.signal.
|
|
250
|
+
if (request.signal.aborted) {
|
|
251
|
+
cleanup();
|
|
252
|
+
} else {
|
|
253
|
+
request.signal.addEventListener("abort", cleanup, { once: true });
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const storeExtractInstructionsPromise =
|
|
257
|
+
!upstreamAbort.signal.aborted &&
|
|
258
|
+
body.memory?.storageMode === "filemem" &&
|
|
259
|
+
body.memory.autoSave !== false &&
|
|
260
|
+
Boolean(body.memory.turnId) &&
|
|
261
|
+
memoryClient?.ok
|
|
262
|
+
? getStoreExtractInstructions(
|
|
263
|
+
memoryClient.client,
|
|
264
|
+
body.memory.memoryStoreName,
|
|
265
|
+
upstreamAbort.signal,
|
|
266
|
+
)
|
|
267
|
+
: undefined;
|
|
249
268
|
|
|
250
269
|
const stream = new ReadableStream<Uint8Array>({
|
|
251
270
|
async start(controller) {
|
|
@@ -346,37 +365,36 @@ export async function POST(request: NextRequest) {
|
|
|
346
365
|
chunks.length > 0 ? queryForMemory : lastUser.content;
|
|
347
366
|
emit({ type: "memory.start", query: memoryQuery });
|
|
348
367
|
if (isFileMemory) {
|
|
349
|
-
//
|
|
350
|
-
//
|
|
351
|
-
//
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
368
|
+
// Projection files and lexical search live only in the browser
|
|
369
|
+
// tab. The BFF accepts a bounded evidence set and never touches a
|
|
370
|
+
// server-local mirror.
|
|
371
|
+
const fileContext = body.memory.fileContext ?? {
|
|
372
|
+
files: [],
|
|
373
|
+
hits: [],
|
|
374
|
+
cache: {
|
|
375
|
+
ok: false,
|
|
376
|
+
listed: 0,
|
|
377
|
+
loaded: 0,
|
|
378
|
+
reused: 0,
|
|
379
|
+
totalBytes: 0,
|
|
380
|
+
truncated: false,
|
|
381
|
+
error: "浏览器未提供文件缓存",
|
|
382
|
+
},
|
|
383
|
+
};
|
|
384
|
+
emit({
|
|
385
|
+
type: "memory.files",
|
|
386
|
+
files: fileContext.files,
|
|
387
|
+
cache: fileContext.cache,
|
|
388
|
+
memoryStoreName: body.memory.memoryStoreName,
|
|
389
|
+
writable: body.memory.storageMode === "filemem",
|
|
390
|
+
scope: body.memory.scope,
|
|
391
|
+
});
|
|
392
|
+
memoryHits = fileContext.hits.map((hit) => ({
|
|
393
|
+
unit: { text: hit.text },
|
|
394
|
+
score: hit.score,
|
|
395
|
+
source: hit.source,
|
|
396
|
+
}));
|
|
397
|
+
memoryBlock = formatFileMemoryBlock(fileContext.hits);
|
|
380
398
|
} else {
|
|
381
399
|
const readScope = deriveReadScope(
|
|
382
400
|
body.memory.scope as MemoryWriteScope,
|
|
@@ -435,25 +453,91 @@ export async function POST(request: NextRequest) {
|
|
|
435
453
|
|
|
436
454
|
const reader = upstream.getReader();
|
|
437
455
|
let assistantContent = "";
|
|
456
|
+
let completionUsage:
|
|
457
|
+
{ promptTokens?: number; completionTokens?: number } | undefined;
|
|
458
|
+
let upstreamFailed = false;
|
|
438
459
|
while (true) {
|
|
439
460
|
const { value, done } = await reader.read();
|
|
440
461
|
if (done) break;
|
|
441
462
|
if (value.type === "content.delta") {
|
|
442
463
|
assistantContent += value.delta;
|
|
443
464
|
}
|
|
465
|
+
if (value.type === "done") {
|
|
466
|
+
completionUsage = value.usage;
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
444
469
|
emit(value);
|
|
445
|
-
if (value.type === "
|
|
470
|
+
if (value.type === "error") {
|
|
471
|
+
upstreamFailed = true;
|
|
446
472
|
break;
|
|
447
473
|
}
|
|
448
474
|
}
|
|
475
|
+
// ---- filemem 智能提炼写回 ----
|
|
476
|
+
// 与结构化记忆的原始消息归档不同,filemem 先让模型筛选耐久事实,
|
|
477
|
+
// 再以幂等 turn marker + SHA CAS 追加到日期日记。终态 done 延迟到
|
|
478
|
+
// 本步骤之后,确保浏览器能可靠收到保存结果。
|
|
479
|
+
if (
|
|
480
|
+
!upstreamFailed &&
|
|
481
|
+
body.memory?.storageMode === "filemem" &&
|
|
482
|
+
body.memory.autoSave !== false &&
|
|
483
|
+
assistantContent.length > 0
|
|
484
|
+
) {
|
|
485
|
+
if (!body.memory.turnId) {
|
|
486
|
+
emit({
|
|
487
|
+
type: "memory.save.skipped",
|
|
488
|
+
reason: "filemem auto-save requires turnId",
|
|
489
|
+
});
|
|
490
|
+
} else if (memoryClient?.ok) {
|
|
491
|
+
emit({ type: "memory.save.start" });
|
|
492
|
+
try {
|
|
493
|
+
const extractInstructions = await storeExtractInstructionsPromise;
|
|
494
|
+
const memories = await extractDurableMemories({
|
|
495
|
+
provider,
|
|
496
|
+
model: body.model,
|
|
497
|
+
messages: body.messages,
|
|
498
|
+
assistantContent,
|
|
499
|
+
existingHits: body.memory.fileContext?.hits ?? [],
|
|
500
|
+
extractInstructions,
|
|
501
|
+
signal: upstreamAbort.signal,
|
|
502
|
+
});
|
|
503
|
+
upstreamAbort.signal.throwIfAborted();
|
|
504
|
+
const result = await appendCuratedMemories({
|
|
505
|
+
client: memoryClient.client,
|
|
506
|
+
memoryStoreName: body.memory.memoryStoreName,
|
|
507
|
+
scope: body.memory.scope,
|
|
508
|
+
turnId: body.memory.turnId,
|
|
509
|
+
memories,
|
|
510
|
+
signal: upstreamAbort.signal,
|
|
511
|
+
});
|
|
512
|
+
emit({
|
|
513
|
+
type: "memory.save.done",
|
|
514
|
+
status: result.status,
|
|
515
|
+
count: result.count,
|
|
516
|
+
...(result.status === "saved" ? { path: result.path } : {}),
|
|
517
|
+
});
|
|
518
|
+
} catch (err) {
|
|
519
|
+
if (!upstreamAbort.signal.aborted) {
|
|
520
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
521
|
+
emit({ type: "memory.save.skipped", reason });
|
|
522
|
+
chatLogger.warn({
|
|
523
|
+
event: "api.file_memory.curate_failed",
|
|
524
|
+
message: reason,
|
|
525
|
+
error: err,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
449
531
|
// ---- Fire-and-forget 写回 ----
|
|
450
532
|
// 必须放在 close() 之前 schedule,但执行可以晚于 close():
|
|
451
533
|
// 我们用一个不 await 的 IIFE 让它脱离 SSE controller 的生命周期。
|
|
452
534
|
if (
|
|
453
535
|
body.memory &&
|
|
454
536
|
memoryClient?.ok &&
|
|
537
|
+
body.memory.storageMode !== "filemem" &&
|
|
455
538
|
body.memory.autoSave !== false &&
|
|
456
539
|
assistantContent.length > 0 &&
|
|
540
|
+
!upstreamAbort.signal.aborted &&
|
|
457
541
|
!shouldSkipDuplicateTurn(body.memory.turnId)
|
|
458
542
|
) {
|
|
459
543
|
const writeScope = body.memory.scope as MemoryWriteScope;
|
|
@@ -502,6 +586,9 @@ export async function POST(request: NextRequest) {
|
|
|
502
586
|
}
|
|
503
587
|
})();
|
|
504
588
|
}
|
|
589
|
+
if (!upstreamFailed && !upstreamAbort.signal.aborted) {
|
|
590
|
+
emit({ type: "done", usage: completionUsage });
|
|
591
|
+
}
|
|
505
592
|
chatLogger.info({
|
|
506
593
|
event: "api.stream_response",
|
|
507
594
|
message: "LLM chat stream completed",
|
|
@@ -603,8 +690,6 @@ async function resolveMemoryClient(request: NextRequest): Promise<
|
|
|
603
690
|
| {
|
|
604
691
|
ok: true;
|
|
605
692
|
client: import("@tablestore/tablestore-agent-sdk").MemoryClient;
|
|
606
|
-
/** 文件记忆的本地镜像目录按 OTS 实例名分层,随凭据一起解析出来。 */
|
|
607
|
-
otsInstanceName: string;
|
|
608
693
|
}
|
|
609
694
|
| { ok: false; status: number; code: string; message: string }
|
|
610
695
|
> {
|
|
@@ -621,10 +706,86 @@ async function resolveMemoryClient(request: NextRequest): Promise<
|
|
|
621
706
|
return {
|
|
622
707
|
ok: true,
|
|
623
708
|
client: resolved.memory,
|
|
624
|
-
otsInstanceName: resolved.config?.ots_instance_name ?? "",
|
|
625
709
|
};
|
|
626
710
|
}
|
|
627
711
|
|
|
712
|
+
async function getStoreExtractInstructions(
|
|
713
|
+
client: import("@tablestore/tablestore-agent-sdk").MemoryClient,
|
|
714
|
+
memoryStoreName: string,
|
|
715
|
+
signal: AbortSignal,
|
|
716
|
+
): Promise<string | undefined> {
|
|
717
|
+
let timeout: ReturnType<typeof setTimeout> | undefined;
|
|
718
|
+
let onAbort: (() => void) | undefined;
|
|
719
|
+
try {
|
|
720
|
+
const describe = Promise.resolve(
|
|
721
|
+
client.getMemoryStore({ memoryStoreName }),
|
|
722
|
+
);
|
|
723
|
+
const deadline = new Promise<never>((_, reject) => {
|
|
724
|
+
timeout = setTimeout(
|
|
725
|
+
() => reject(new FileMemoryStoreDescribeTimeoutError()),
|
|
726
|
+
FILE_MEMORY_STORE_DESCRIBE_TIMEOUT_MS,
|
|
727
|
+
);
|
|
728
|
+
});
|
|
729
|
+
const aborted = new Promise<never>((_, reject) => {
|
|
730
|
+
onAbort = () =>
|
|
731
|
+
reject(
|
|
732
|
+
signal.reason ??
|
|
733
|
+
new DOMException("The operation was aborted", "AbortError"),
|
|
734
|
+
);
|
|
735
|
+
if (signal.aborted) {
|
|
736
|
+
onAbort();
|
|
737
|
+
} else {
|
|
738
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
const response = await Promise.race([describe, deadline, aborted]);
|
|
742
|
+
if (response.code !== "SUCCESS") {
|
|
743
|
+
chatLogger.warn({
|
|
744
|
+
event: "api.file_memory.store_describe_failed",
|
|
745
|
+
message: response.message ?? "getMemoryStore returned non-SUCCESS",
|
|
746
|
+
details: { code: response.code },
|
|
747
|
+
});
|
|
748
|
+
return undefined;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
const data = response.data;
|
|
752
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
753
|
+
return undefined;
|
|
754
|
+
}
|
|
755
|
+
const extractInstructions = (data as Record<string, unknown>)[
|
|
756
|
+
"extractInstructions"
|
|
757
|
+
];
|
|
758
|
+
return typeof extractInstructions === "string" &&
|
|
759
|
+
extractInstructions.trim().length > 0
|
|
760
|
+
? extractInstructions
|
|
761
|
+
: undefined;
|
|
762
|
+
} catch (error) {
|
|
763
|
+
const event = signal.aborted
|
|
764
|
+
? "api.file_memory.store_describe_aborted"
|
|
765
|
+
: error instanceof FileMemoryStoreDescribeTimeoutError
|
|
766
|
+
? "api.file_memory.store_describe_timeout"
|
|
767
|
+
: "api.file_memory.store_describe_exception";
|
|
768
|
+
chatLogger.warn({
|
|
769
|
+
event,
|
|
770
|
+
message: error instanceof Error ? error.message : String(error),
|
|
771
|
+
error,
|
|
772
|
+
});
|
|
773
|
+
return undefined;
|
|
774
|
+
} finally {
|
|
775
|
+
if (timeout) clearTimeout(timeout);
|
|
776
|
+
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
class FileMemoryStoreDescribeTimeoutError extends Error {
|
|
781
|
+
constructor() {
|
|
782
|
+
super(
|
|
783
|
+
`getMemoryStore exceeded ${FILE_MEMORY_STORE_DESCRIBE_TIMEOUT_MS}ms deadline`,
|
|
784
|
+
);
|
|
785
|
+
this.name = "FileMemoryStoreDescribeTimeoutError";
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
628
789
|
/** @internal Exported for unit testing multimodal message construction. */
|
|
629
790
|
export function buildFinalMessages(
|
|
630
791
|
userSystemPrompt: string,
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type NextRequest } from "next/server";
|
|
2
|
+
|
|
3
|
+
import type { MemoryClient } from "@tablestore/tablestore-agent-sdk";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
errorResponse,
|
|
7
|
+
forwardResponse,
|
|
8
|
+
handleApiError,
|
|
9
|
+
requireClients,
|
|
10
|
+
} from "@/lib/server/api-helpers";
|
|
11
|
+
|
|
12
|
+
import { parseFileMemoryRequest } from "../_request";
|
|
13
|
+
|
|
14
|
+
export const runtime = "nodejs";
|
|
15
|
+
export const dynamic = "force-dynamic";
|
|
16
|
+
|
|
17
|
+
interface RouteContext {
|
|
18
|
+
params: Promise<{ store: string; action: string }>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type RequestBody = Record<string, unknown>;
|
|
22
|
+
type Dispatcher = (
|
|
23
|
+
client: MemoryClient,
|
|
24
|
+
request: RequestBody,
|
|
25
|
+
) => Promise<unknown>;
|
|
26
|
+
|
|
27
|
+
const dispatchers: Record<string, Dispatcher> = {
|
|
28
|
+
list: (client, request) =>
|
|
29
|
+
client.listFileMemories(
|
|
30
|
+
request as unknown as Parameters<MemoryClient["listFileMemories"]>[0],
|
|
31
|
+
),
|
|
32
|
+
stat: (client, request) =>
|
|
33
|
+
client.statFileMemory(
|
|
34
|
+
request as unknown as Parameters<MemoryClient["statFileMemory"]>[0],
|
|
35
|
+
),
|
|
36
|
+
read: (client, request) =>
|
|
37
|
+
client.readFileMemory(
|
|
38
|
+
request as unknown as Parameters<MemoryClient["readFileMemory"]>[0],
|
|
39
|
+
),
|
|
40
|
+
create: (client, request) =>
|
|
41
|
+
client.createFileMemory(
|
|
42
|
+
request as unknown as Parameters<MemoryClient["createFileMemory"]>[0],
|
|
43
|
+
),
|
|
44
|
+
update: (client, request) =>
|
|
45
|
+
client.updateFileMemory(
|
|
46
|
+
request as unknown as Parameters<MemoryClient["updateFileMemory"]>[0],
|
|
47
|
+
),
|
|
48
|
+
rename: (client, request) =>
|
|
49
|
+
client.renameFileMemory(
|
|
50
|
+
request as unknown as Parameters<MemoryClient["renameFileMemory"]>[0],
|
|
51
|
+
),
|
|
52
|
+
delete: (client, request) =>
|
|
53
|
+
client.deleteFileMemory(
|
|
54
|
+
request as unknown as Parameters<MemoryClient["deleteFileMemory"]>[0],
|
|
55
|
+
),
|
|
56
|
+
"versions-list": (client, request) =>
|
|
57
|
+
client.listFileMemoryVersions(
|
|
58
|
+
request as unknown as Parameters<
|
|
59
|
+
MemoryClient["listFileMemoryVersions"]
|
|
60
|
+
>[0],
|
|
61
|
+
),
|
|
62
|
+
"versions-get": (client, request) =>
|
|
63
|
+
client.getFileMemoryVersion(
|
|
64
|
+
request as unknown as Parameters<MemoryClient["getFileMemoryVersion"]>[0],
|
|
65
|
+
),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export async function POST(request: NextRequest, context: RouteContext) {
|
|
69
|
+
try {
|
|
70
|
+
const { store, action } = await context.params;
|
|
71
|
+
const dispatch = dispatchers[action];
|
|
72
|
+
if (!dispatch) {
|
|
73
|
+
return errorResponse("NOT_FOUND", "Unknown file memory action", 404);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const auth = requireClients(request);
|
|
77
|
+
if (!("memory" in auth)) return auth;
|
|
78
|
+
|
|
79
|
+
const parsed = await parseFileMemoryRequest(request);
|
|
80
|
+
if (!parsed.ok) return parsed.response;
|
|
81
|
+
|
|
82
|
+
const { memoryStoreName: _ignored, ...safeBody } = parsed.body;
|
|
83
|
+
void _ignored;
|
|
84
|
+
const response = await dispatch(auth.memory, {
|
|
85
|
+
...safeBody,
|
|
86
|
+
memoryStoreName: store,
|
|
87
|
+
});
|
|
88
|
+
return forwardResponse(response as Parameters<typeof forwardResponse>[0]);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
return handleApiError(error);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -1,42 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
export interface ExactFileMemoryScope {
|
|
2
|
+
appId: string;
|
|
3
|
+
tenantId: string;
|
|
4
|
+
agentId: string;
|
|
5
|
+
runId: string;
|
|
6
|
+
}
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* appId 缺失时返回 null,调用方回 400。
|
|
9
|
+
* File APIs only accept a concrete four-part scope. Unlike structured-memory
|
|
10
|
+
* searches, file operations never widen missing components or accept `*`.
|
|
12
11
|
*/
|
|
13
|
-
export function
|
|
14
|
-
raw:
|
|
15
|
-
):
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
12
|
+
export function readExactFileMemoryScope(
|
|
13
|
+
raw: unknown,
|
|
14
|
+
): ExactFileMemoryScope | null {
|
|
15
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
16
|
+
|
|
17
|
+
const value = raw as Record<string, unknown>;
|
|
18
|
+
const read = (key: "appId" | "tenantId" | "agentId" | "runId") => {
|
|
19
|
+
const component = value[key];
|
|
20
|
+
if (typeof component !== "string") return null;
|
|
21
|
+
const normalized = component.trim();
|
|
22
|
+
return normalized && normalized !== "*" ? normalized : null;
|
|
22
23
|
};
|
|
23
|
-
const appId = get("appId").trim();
|
|
24
|
-
if (!appId || appId === "*") return null;
|
|
25
|
-
return normalizeMountScope({
|
|
26
|
-
appId,
|
|
27
|
-
tenantId: get("tenantId"),
|
|
28
|
-
agentId: get("agentId"),
|
|
29
|
-
runId: get("runId"),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const localRoot = defaultFileMemoryRoot(otsInstanceName, store);
|
|
41
|
-
return { localRoot, scopeDir: fileMemoryScopeDir(localRoot, scope) };
|
|
25
|
+
const appId = read("appId");
|
|
26
|
+
const tenantId = read("tenantId");
|
|
27
|
+
const agentId = read("agentId");
|
|
28
|
+
const runId = read("runId");
|
|
29
|
+
if (!appId || !tenantId || !agentId || !runId) return null;
|
|
30
|
+
|
|
31
|
+
return { appId, tenantId, agentId, runId };
|
|
42
32
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type NextRequest, type NextResponse } from "next/server";
|
|
2
|
+
|
|
3
|
+
import { errorResponse } from "@/lib/server/api-helpers";
|
|
4
|
+
|
|
5
|
+
import { readExactFileMemoryScope } from "./_helpers";
|
|
6
|
+
|
|
7
|
+
type ParsedFileMemoryRequest =
|
|
8
|
+
| { ok: true; body: Record<string, unknown> }
|
|
9
|
+
| { ok: false; response: NextResponse };
|
|
10
|
+
|
|
11
|
+
export async function parseFileMemoryRequest(
|
|
12
|
+
request: NextRequest,
|
|
13
|
+
): Promise<ParsedFileMemoryRequest> {
|
|
14
|
+
let raw: unknown;
|
|
15
|
+
try {
|
|
16
|
+
raw = await request.json();
|
|
17
|
+
} catch {
|
|
18
|
+
return {
|
|
19
|
+
ok: false,
|
|
20
|
+
response: errorResponse("BAD_REQUEST", "Request body must be JSON", 400),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
25
|
+
return {
|
|
26
|
+
ok: false,
|
|
27
|
+
response: errorResponse(
|
|
28
|
+
"BAD_REQUEST",
|
|
29
|
+
"Request body must be a JSON object",
|
|
30
|
+
400,
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const body = raw as Record<string, unknown>;
|
|
36
|
+
const scope = readExactFileMemoryScope(body.scope);
|
|
37
|
+
if (!scope) {
|
|
38
|
+
return {
|
|
39
|
+
ok: false,
|
|
40
|
+
response: errorResponse(
|
|
41
|
+
"BAD_REQUEST",
|
|
42
|
+
"scope must contain exact appId, tenantId, agentId, and runId values",
|
|
43
|
+
400,
|
|
44
|
+
),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return { ok: true, body: { ...body, scope } };
|
|
49
|
+
}
|
|
@@ -16,13 +16,19 @@ import type {
|
|
|
16
16
|
} from "@/hooks/use-chat-history";
|
|
17
17
|
import { assembleRetrievalConfiguration } from "@/components/retrieval/assemble-retrieval-configuration";
|
|
18
18
|
import { newId } from "@/lib/random-id";
|
|
19
|
+
import {
|
|
20
|
+
FILEMEM_DEFAULT_RUN_ID,
|
|
21
|
+
normalizeMemoryRunId,
|
|
22
|
+
type StorageMode,
|
|
23
|
+
} from "@/lib/memory-storage-mode";
|
|
19
24
|
|
|
20
25
|
export type MountItem = ChatSessionMount;
|
|
21
26
|
|
|
22
27
|
/**
|
|
23
28
|
* 绑定里存的 scope 是*写* scope:四个字段都齐全且非通配符。
|
|
24
|
-
*
|
|
25
|
-
*
|
|
29
|
+
* 服务端仅为结构化语义检索派生 app + tenant 级读 scope(保留 appId / tenantId,
|
|
30
|
+
* agentId / runId 为 "*");文件记忆仍使用精确 scope。客户端永远
|
|
31
|
+
* 不发通配符。
|
|
26
32
|
*/
|
|
27
33
|
export interface ChatMemoryWriteScope {
|
|
28
34
|
appId: string;
|
|
@@ -34,6 +40,7 @@ export interface ChatMemoryWriteScope {
|
|
|
34
40
|
export interface ChatMemoryBinding {
|
|
35
41
|
id: string;
|
|
36
42
|
memoryStoreName: string;
|
|
43
|
+
storageMode?: StorageMode;
|
|
37
44
|
scope: ChatMemoryWriteScope;
|
|
38
45
|
topK?: number;
|
|
39
46
|
autoSave: boolean;
|
|
@@ -173,12 +180,34 @@ export function reducer(
|
|
|
173
180
|
.filter((m): m is MountItem => !!m);
|
|
174
181
|
return { ...state, mounts: reordered };
|
|
175
182
|
}
|
|
176
|
-
case "HYDRATE":
|
|
177
|
-
|
|
183
|
+
case "HYDRATE": {
|
|
184
|
+
const memory = action.state.memory;
|
|
185
|
+
return {
|
|
186
|
+
...state,
|
|
187
|
+
...action.state,
|
|
188
|
+
...(memory
|
|
189
|
+
? {
|
|
190
|
+
memory: {
|
|
191
|
+
...memory,
|
|
192
|
+
scope: {
|
|
193
|
+
...memory.scope,
|
|
194
|
+
runId: normalizeMemoryRunId(
|
|
195
|
+
memory.storageMode,
|
|
196
|
+
memory.scope.runId,
|
|
197
|
+
),
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
}
|
|
201
|
+
: {}),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
178
204
|
// SET_MEMORY 同一绑定的 id 保持稳定;只有从无到有时才铸新 id,避免不必要的 React key 抖动。
|
|
179
205
|
case "SET_MEMORY": {
|
|
180
206
|
if (!action.binding) return { ...state, memory: undefined };
|
|
181
|
-
const runId =
|
|
207
|
+
const runId = normalizeMemoryRunId(
|
|
208
|
+
action.binding.storageMode,
|
|
209
|
+
action.binding.scope.runId,
|
|
210
|
+
);
|
|
182
211
|
return {
|
|
183
212
|
...state,
|
|
184
213
|
memory: {
|
|
@@ -191,12 +220,19 @@ export function reducer(
|
|
|
191
220
|
case "UPDATE_MEMORY": {
|
|
192
221
|
if (!state.memory) return state;
|
|
193
222
|
const { scope: patchScope, ...rest } = action.patch;
|
|
223
|
+
const memory = {
|
|
224
|
+
...state.memory,
|
|
225
|
+
...rest,
|
|
226
|
+
scope: { ...state.memory.scope, ...(patchScope ?? {}) },
|
|
227
|
+
};
|
|
194
228
|
return {
|
|
195
229
|
...state,
|
|
196
230
|
memory: {
|
|
197
|
-
...
|
|
198
|
-
|
|
199
|
-
|
|
231
|
+
...memory,
|
|
232
|
+
scope: {
|
|
233
|
+
...memory.scope,
|
|
234
|
+
runId: normalizeMemoryRunId(memory.storageMode, memory.scope.runId),
|
|
235
|
+
},
|
|
200
236
|
},
|
|
201
237
|
};
|
|
202
238
|
}
|
|
@@ -330,11 +366,14 @@ export function buildRagFromMounts(state: ChatConfigState) {
|
|
|
330
366
|
export function buildMemoryFromBinding(state: ChatConfigState) {
|
|
331
367
|
const m = state.memory;
|
|
332
368
|
if (!m) return undefined;
|
|
333
|
-
const { appId, tenantId, agentId
|
|
369
|
+
const { appId, tenantId, agentId } = m.scope;
|
|
370
|
+
const runId =
|
|
371
|
+
m.storageMode === "filemem" ? FILEMEM_DEFAULT_RUN_ID : m.scope.runId;
|
|
334
372
|
if (!appId || !tenantId || !agentId || !runId) return undefined;
|
|
335
373
|
return {
|
|
336
374
|
memoryStoreName: m.memoryStoreName,
|
|
337
375
|
scope: { appId, tenantId, agentId, runId },
|
|
376
|
+
...(m.storageMode ? { storageMode: m.storageMode } : {}),
|
|
338
377
|
...(typeof m.topK === "number" ? { topK: m.topK } : {}),
|
|
339
378
|
autoSave: m.autoSave,
|
|
340
379
|
...(m.retrievalMode ? { retrievalMode: m.retrievalMode } : {}),
|