@tablestore/tablestore-agent-cli 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard-runtime/dashboard/.next/BUILD_ID +1 -1
- 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/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]/scope/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/scope/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/[store]/wiki/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/wiki/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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/instances/connectivity/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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 +3 -3
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/file-memory/[action]/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/route.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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.nft.json +1 -1
- 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.nft.json +1 -1
- 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/[store]/wikis/artifacts/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/ingest/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/page/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/pages/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/search/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/source/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/[store]/wikis/sources/route.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/api/v1/memory/stores/route.js +1 -1
- 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.nft.json +1 -1
- 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/chunks/0p91_next_dist_esm_build_templates_app-route_0n~ec7s.js +11 -11
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0-e5iv2._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__03j_ekh._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__07k_8vo._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0esucs7._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0z19yd0._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07er-7t._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__09556l4._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0ejd~qu._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0hbevlv._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0xqm21n._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0-yhfok._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.eh64w._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_06umrt-._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0a-deba._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0au8umj._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f3_q1r._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fz3kge._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0gt9qp0._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ih5--w._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0j4mfzx._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_06ofr7j._.js → _0j_44th._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_06.3nzk._.js → _0mn4dgd._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0d_nd-j._.js → _0nc~.w2._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0p-bup8._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0psdvqq._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0rd1b-.._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0t_-u16._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0u0~-~-._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0vw3mzw._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ww5s91._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xm2tp8._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0xutx8t._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0ggq95f._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0x60pxf._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0xaihln._.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_[dreamId]_page_tsx_0wy3tv6._.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]_scope_page_tsx_01rq2zq._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_memory_[store]_search_page_tsx_0rj3dkc._.js +3 -0
- 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 +1 -1
- 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/node_modules__pnpm_03py6n-._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_08hzj0f._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0_mks~s._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0xbb09m._.js +3 -0
- 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-b36b4si6az5.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-q4fucd6l5ip.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{14t.r5~ls3k0x.js → 03qrjs4w.7yz3.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/04uxooijjqs-9.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/08tm8srceyz1j.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/08tpejw1f.2jd.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0b_~fcwy9vo2r.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0crw5ciecbvir.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0cy7y~ef_6m-s.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dl5t6e508o8k.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0expqv.~8a3wr.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0gdmaffoezvcu.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0hoybc7spk4vg.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0k6m5~gmu0f8w.js → 0k9my4lhyvwbd.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0lfx3ykqc9uiy.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0m2j5ne9j7dft.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0m50djlkcegw9.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0mg.g5g33nh.~.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0mit8g2.vh7a9.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o9quk2z~1ez0.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o~zjik9-6a1f.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0p6zd_ss6.14_.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0qccdw9ussvne.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{1204oli3aouy7.js → 0teq2sa-33s3g.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0upl.e~taktf9.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v1ulq51wmrto.js +5 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v5mmaebktnw1.css +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vp-dv9_z334e.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0w9eqc5ya-oai.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0x0ppjv_4yap7.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0xbqtv-jcph-2.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~m6ml547qzpo.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/10s~90qej98.b.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/12vri~chu44bu.js +9 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/13jqvu~hww3b4.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0idn9fvygbi9d.js → 13wh4v_j6tlns.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/16.18mrzg-4wl.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/162doi8c0o5ot.js +1 -0
- package/dist/dashboard-runtime/dashboard/server.js +1 -1
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/[dreamId]/page.tsx +6 -1
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/dream/page.tsx +3 -2
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/layout.tsx +5 -2
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/scope/page.tsx +24 -16
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/search/page.tsx +77 -21
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/settings/page.tsx +18 -2
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/memory/[store]/units/page.tsx +89 -47
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/llm/chat/memory-retrieval.ts +72 -4
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/route.ts +19 -2
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/scopes/route.ts +123 -8
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/[store]/search/route.ts +21 -8
- package/dist/dashboard-runtime/dashboard/src/app/api/v1/memory/stores/route.ts +11 -4
- package/dist/dashboard-runtime/dashboard/src/components/chat/chat-config-context.tsx +2 -5
- package/dist/dashboard-runtime/dashboard/src/components/chat/wiki-bind-section.tsx +2 -4
- package/dist/dashboard-runtime/dashboard/src/components/layout/language-toggle.tsx +19 -16
- package/dist/dashboard-runtime/dashboard/src/components/layout/sidebar-mobile.tsx +1 -1
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-details-panel.tsx +32 -10
- package/dist/dashboard-runtime/dashboard/src/components/memory/file-mutation-dialogs.tsx +14 -2
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-add-dialog.tsx +21 -3
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-create-form.tsx +50 -38
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-files-browser.tsx +46 -10
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-requests-table.tsx +7 -6
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-scope-bar.tsx +13 -4
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-form.tsx +384 -70
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-search-results.tsx +238 -57
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-settings-form.tsx +88 -1
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-store-card.tsx +4 -1
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-tasks-table.tsx +3 -2
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-detail-panel.tsx +19 -4
- package/dist/dashboard-runtime/dashboard/src/components/memory/memory-unit-table.tsx +8 -5
- package/dist/dashboard-runtime/dashboard/src/components/memory/scope-directory-explorer.tsx +384 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/scope-filter-builder.tsx +393 -0
- package/dist/dashboard-runtime/dashboard/src/components/memory/scope-workspace.tsx +6 -2
- package/dist/dashboard-runtime/dashboard/src/components/shared/copyable-id.tsx +69 -0
- package/dist/dashboard-runtime/dashboard/src/hooks/use-chat-history.ts +2 -3
- package/dist/dashboard-runtime/dashboard/src/i18n/locales/en.ts +121 -14
- package/dist/dashboard-runtime/dashboard/src/i18n/locales/zh.ts +116 -12
- package/dist/dashboard-runtime/dashboard/src/lib/memory-storage-mode.ts +140 -33
- package/dist/dashboard-runtime/dashboard/src/lib/memory-units-view.ts +9 -0
- package/dist/dashboard-runtime/dashboard/src/lib/memory.ts +2 -7
- package/dist/dashboard-runtime/dashboard/src/lib/query-keys.ts +13 -0
- package/dist/dashboard-runtime/dashboard/src/lib/scope-directory.ts +97 -0
- package/dist/dashboard-runtime/dashboard/src/lib/server/memory-store-contract.ts +41 -0
- package/dist/dashboard-runtime/dashboard/src/lib/server/scope-filter-validation.ts +186 -0
- package/dist/dashboard-runtime/dashboard/src/schemas/llm-chat.ts +5 -2
- package/dist/dashboard-runtime/dashboard/src/services/memory.ts +16 -6
- package/dist/dashboard-runtime/dashboard/src/types/memory.ts +95 -4
- package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/README.md +2 -2
- package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/glib-2.0/include/glibconfig.h +9 -8
- package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
- package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
- package/dist/dashboard-runtime/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
- package/dist/dashboard-runtime/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
- package/dist/dashboard-runtime/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/@tablestore/tablestore-agent-sdk/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0is6qso._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0q9fgt6._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0w_ig2a._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__0zmo~nd._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/[root-of-the-server]__13g_f9w._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__05kcz99._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__06l7w~r._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__07fsbff._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0_6myqa._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0d-z.x1._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_00.la1c._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_01r6jx1._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_04rasxw._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_05__-74._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_05wwgdw._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0f.xs7l._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0jt60z2._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0k7q0ug._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0kaclzw._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0lstkpb._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0qw41co._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0vfgz-v._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0y4mxf8._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_119lxvo._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_079nj-_._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0bhjp9s._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0..ymrl._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_00arje5._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_08h.f_8._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_0pf30rh._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_12_d6fg._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0-88a30l.a1sg.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/01nixb3ddw4hy.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/01u9hj_9~5-vg.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/02q3tpry1ajx9.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/057-rg6~0wki8.css +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/05d8-45s941bx.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/07q8af71w17xl.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/07v6llp0fv6iq.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0a9.rr50h5ypa.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0axnv6wy1_hr7.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0bbcwyy.xvpd0.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0cfrd_r4jr_ip.js +0 -9
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dpj.6wcf.qn8.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0gt8u.o_c_nix.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0hh2728tmgrdk.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0jjiw-agnutux.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0nw7q~w~vg.-y.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o-j8g9gp_c1r.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0pm6vv5wntle..js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0qr499bd44k.g.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0sx_fx5r7nq4b.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0tbu6y0a22ok8.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u6c8q4k~6aiy.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0u7fh6be6noif.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0wcf_hdt9arma.js +0 -5
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0xash~4j8pl87.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0xi6y8g4l~vzr.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0y45-~ia9sqr0.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0yvc~t7p88wsf.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/10684vn7g6wln.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/14rpr3z1.lmgj.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/15043qe~kvq-v.js +0 -1
- package/dist/dashboard-runtime/dashboard/tsconfig.tsbuildinfo +0 -1
- package/dist/dashboard-runtime/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{bKUtNfKb47TOc1cpUk74A → mCNgeSYc3Dx3KiZXWf-5A}/_buildManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{bKUtNfKb47TOc1cpUk74A → mCNgeSYc3Dx3KiZXWf-5A}/_clientMiddlewareManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{bKUtNfKb47TOc1cpUk74A → mCNgeSYc3Dx3KiZXWf-5A}/_ssgManifest.js +0 -0
- /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/index.js +0 -0
- /package/dist/dashboard-runtime/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/versions.json +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,677275,e=>{"use strict";var t=e.i(101685),n=e.i(291967),r=e.i(41986),s=e.i(967928),o=e.i(543250),i=e.i(433616),a=e.i(980939),l=e.i(136131),c=e.i(417256),u=e.i(25486),d=e.i(44501),m="rovingFocusGroup.onEntryFocus",f={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[h,v,y]=(0,r.createCollection)(p),[b,g]=(0,o.createContextScope)(p,[y]),[x,j]=b(p),w=t.forwardRef((e,t)=>(0,d.jsx)(h.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(h.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(I,{...e,ref:t})})}));w.displayName=p;var I=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:o,orientation:i,loop:h=!1,dir:y,currentTabStopId:b,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:j,onEntryFocus:w,preventScrollOnEntryFocus:I=!1,...S}=e,C=t.useRef(null),E=(0,s.useComposedRefs)(r,C),N=(0,u.useDirection)(y),[R,K]=(0,c.useControllableState)({prop:b,defaultProp:g??null,onChange:j,caller:p}),[k,M]=t.useState(!1),T=(0,l.useCallbackRef)(w),_=v(o),O=t.useRef(!1),[P,L]=t.useState(0);return t.useEffect(()=>{let e=C.current;if(e)return e.addEventListener(m,T),()=>e.removeEventListener(m,T)},[T]),(0,d.jsx)(x,{scope:o,orientation:i,dir:N,loop:h,currentTabStopId:R,onItemFocus:t.useCallback(e=>K(e),[K]),onItemShiftTab:t.useCallback(()=>M(!0),[]),onFocusableItemAdd:t.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>L(e=>e-1),[]),children:(0,d.jsx)(a.Primitive.div,{tabIndex:k||0===P?-1:0,"data-orientation":i,...S,ref:E,style:{outline:"none",...e.style},onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,()=>{O.current=!0}),onFocus:(0,n.composeEventHandlers)(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!k){let t=new CustomEvent(m,f);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=_().filter(e=>e.focusable);F([e.find(e=>e.active),e.find(e=>e.id===R),...e].filter(Boolean).map(e=>e.ref.current),I)}}O.current=!1}),onBlur:(0,n.composeEventHandlers)(e.onBlur,()=>M(!1))})})}),S="RovingFocusGroupItem",C=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:s,focusable:o=!0,active:l=!1,tabStopId:c,children:u,...m}=e,f=(0,i.useId)(),p=c||f,y=j(S,s),b=y.currentTabStopId===p,g=v(s),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:I}=y;return t.useEffect(()=>{if(o)return x(),()=>w()},[o,x,w]),(0,d.jsx)(h.ItemSlot,{scope:s,id:p,focusable:o,active:l,children:(0,d.jsx)(a.Primitive.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...m,ref:r,onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,e=>{o?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,n){var r;let s=(r=e.key,"rtl"!==n?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(s))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(s)))return E[s]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let s=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)s.reverse();else if("prev"===t||"next"===t){var n,r;"prev"===t&&s.reverse();let o=s.indexOf(e.currentTarget);s=y.loop?(n=s,r=o+1,n.map((e,t)=>n[(r+t)%n.length])):s.slice(o+1)}setTimeout(()=>F(s))}}),children:"function"==typeof u?u({isCurrentTabStop:b,hasTabStop:null!=I}):u})})});C.displayName=S;var E={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function F(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}e.s(["Item",0,C,"Root",0,w,"createRovingFocusGroupScope",0,g])},190088,e=>{"use strict";var t=e.i(101685),n=e.i(967928),r=e.i(672687),s=e=>{var s;let i,a,{present:l,children:c}=e,u=function(e){var n,s;let[i,a]=t.useState(),l=t.useRef(null),c=t.useRef(e),u=t.useRef("none"),[d,m]=(n=e?"mounted":"unmounted",s={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},t.useReducer((e,t)=>s[e][t]??e,n));return t.useEffect(()=>{let e=o(l.current);u.current="mounted"===d?e:"none"},[d]),(0,r.useLayoutEffect)(()=>{let t=l.current,n=c.current;if(n!==e){let r=u.current,s=o(t);e?m("MOUNT"):"none"===s||t?.display==="none"?m("UNMOUNT"):n&&r!==s?m("ANIMATION_OUT"):m("UNMOUNT"),c.current=e}},[e,m]),(0,r.useLayoutEffect)(()=>{if(i){let e,t=i.ownerDocument.defaultView??window,n=n=>{let r=o(l.current).includes(CSS.escape(n.animationName));if(n.target===i&&r&&(m("ANIMATION_END"),!c.current)){let n=i.style.animationFillMode;i.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===i.style.animationFillMode&&(i.style.animationFillMode=n)})}},r=e=>{e.target===i&&(u.current=o(l.current))};return i.addEventListener("animationstart",r),i.addEventListener("animationcancel",n),i.addEventListener("animationend",n),()=>{t.clearTimeout(e),i.removeEventListener("animationstart",r),i.removeEventListener("animationcancel",n),i.removeEventListener("animationend",n)}}m("ANIMATION_END")},[i,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{l.current=e?getComputedStyle(e):null,a(e)},[])}}(l),d="function"==typeof c?c({present:u.isPresent}):t.Children.only(c),m=(0,n.useComposedRefs)(u.ref,(s=d,(a=(i=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?s.ref:(a=(i=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?s.props.ref:s.props.ref||s.ref));return"function"==typeof c||u.isPresent?t.cloneElement(d,{ref:m}):null};function o(e){return e?.animationName||"none"}s.displayName="Presence",e.s(["Presence",0,s])},137500,e=>{"use strict";var t=e.i(101685),n=e.i(887097),r=e.i(732534),s=e.i(23144),o=e.i(858859),i=class extends s.Subscribable{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.hashKey)(t.mutationKey)!==(0,o.hashKey)(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#o(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#s(){let e=this.#n?.state??(0,n.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#o(e){r.notifyManager.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},a=e.i(712984);e.s(["useMutation",0,function(e,n){let s=(0,a.useQueryClient)(n),[l]=t.useState(()=>new i(s,e));t.useEffect(()=>{l.setOptions(e)},[l,e]);let c=t.useSyncExternalStore(t.useCallback(e=>l.subscribe(r.notifyManager.batchCalls(e)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u=t.useCallback((e,t)=>{l.mutate(e,t).catch(o.noop)},[l]);if(c.error&&(0,o.shouldThrowError)(l.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}],137500)},7284,e=>{"use strict";e.s(["clsx",0,function(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=function e(t){var n,r,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}(e))&&(r&&(r+=" "),r+=t);return r}])},967928,e=>{"use strict";var t=e.i(101685);function n(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function r(...e){return t=>{let r=!1,s=e.map(e=>{let s=n(e,t);return r||"function"!=typeof s||(r=!0),s});if(r)return()=>{for(let t=0;t<s.length;t++){let r=s[t];"function"==typeof r?r():n(e[t],null)}}}}e.s(["composeRefs",0,r,"useComposedRefs",0,function(...e){return t.useCallback(r(...e),e)}])},206102,e=>{"use strict";var t=e.i(101685),n=e.i(967928),r=e.i(44501),s=Symbol.for("react.lazy"),o=t[" use ".trim().toString()];function i(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===s&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}function a(e){var s;let a,l=(s=e,(a=t.forwardRef((e,r)=>{let{children:s,...a}=e;if(i(s)&&"function"==typeof o&&(s=o(s._payload)),t.isValidElement(s)){var l;let e,o,i=(l=s,(o=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(o=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),c=function(e,t){let n={...t};for(let r in t){let s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...e)=>{let t=o(...e);return s(...e),t}:s&&(n[r]=s):"style"===r?n[r]={...s,...o}:"className"===r&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}(a,s.props);return s.type!==t.Fragment&&(c.ref=r?(0,n.composeRefs)(r,i):i),t.cloneElement(s,c)}return t.Children.count(s)>1?t.Children.only(null):null})).displayName=`${s}.SlotClone`,a),c=t.forwardRef((e,n)=>{let{children:s,...a}=e;i(s)&&"function"==typeof o&&(s=o(s._payload));let c=t.Children.toArray(s),d=c.find(u);if(d){let e=d.props.children,s=c.map(n=>n!==d?n:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,r.jsx)(l,{...a,ref:n,children:t.isValidElement(e)?t.cloneElement(e,void 0,s):null})}return(0,r.jsx)(l,{...a,ref:n,children:s})});return c.displayName=`${e}.Slot`,c}var l=a("Slot"),c=Symbol("radix.slottable");function u(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===c}e.s(["Slot",0,l,"createSlot",0,a])},294237,e=>{"use strict";var t=e.i(7284);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,r=t.clsx;e.s(["cva",0,(e,t)=>s=>{var o;if((null==t?void 0:t.variants)==null)return r(e,null==s?void 0:s.class,null==s?void 0:s.className);let{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(e=>{let t=null==s?void 0:s[e],r=null==a?void 0:a[e];if(null===t)return null;let o=n(t)||n(r);return i[e][o]}),c=s&&Object.entries(s).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return r(e,l,null==t||null==(o=t.compoundVariants)?void 0:o.reduce((e,t)=>{let{class:n,className:r,...s}=t;return Object.entries(s).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...c}[t]):({...a,...c})[t]===n})?[...e,n,r]:e},[]),null==s?void 0:s.class,null==s?void 0:s.className)}])},876490,e=>{"use strict";var t=e.i(7284),n=e.i(877130);e.s(["cn",0,function(...e){return(0,n.twMerge)((0,t.clsx)(e))},"extractFileName",0,function(e){let t=e.split("/");return t[t.length-1]||e}])},942595,e=>{"use strict";var t=e.i(44501),n=e.i(101685),r=e.i(206102),s=e.i(294237),o=e.i(876490);let i=(0,s.cva)("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.3)] focus-visible:ring-offset-1 focus-visible:ring-offset-[hsl(var(--background))] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] shadow-sm hover:opacity-90",destructive:"bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))] shadow-sm hover:opacity-90",outline:"border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--foreground))] shadow-sm hover:border-[hsl(var(--primary))] hover:text-[hsl(var(--primary))]",secondary:"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] shadow-sm hover:opacity-80",ghost:"hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",link:"text-[hsl(var(--primary))] underline-offset-4 hover:underline"},size:{default:"h-8 px-3 py-1",sm:"h-7 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-4",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),a=n.forwardRef(({className:e,variant:n,size:s,asChild:a=!1,...l},c)=>{let u=a?r.Slot:"button";return(0,t.jsx)(u,{className:(0,o.cn)(i({variant:n,size:s,className:e})),ref:c,...l})});a.displayName="Button",e.s(["Button",0,a])},801685,e=>{"use strict";var t=e.i(101685);let n=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,t.createContext)({}),i=(0,t.forwardRef)(({color:e,size:r,strokeWidth:i,absoluteStrokeWidth:a,className:l="",children:c,iconNode:u,...d},m)=>{let{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:h=!1,color:v="currentColor",className:y=""}=(0,t.useContext)(o)??{},b=a??h?24*Number(i??p)/Number(r??f):i??p;return(0,t.createElement)("svg",{ref:m,...s,width:r??f??s.width,height:r??f??s.height,stroke:e??v,strokeWidth:b,className:n("lucide",y,l),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...u.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(c)?c:[c]])});e.s(["default",0,(e,s)=>{let o=(0,t.forwardRef)(({className:o,...a},l)=>(0,t.createElement)(i,{ref:l,iconNode:s,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...a}));return o.displayName=r(e),o}],801685)},291967,e=>{"use strict";"u">typeof window&&window.document&&window.document.createElement,e.s(["composeEventHandlers",0,function(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}])},543250,e=>{"use strict";var t=e.i(101685),n=e.i(44501);e.s(["createContext",0,function(e,r){let s=t.createContext(r),o=e=>{let{children:r,...o}=e,i=t.useMemo(()=>o,Object.values(o));return(0,n.jsx)(s.Provider,{value:i,children:r})};return o.displayName=e+"Provider",[o,function(n){let o=t.useContext(s);if(o)return o;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${e}\``)}]},"createContextScope",0,function(e,r=[]){let s=[],o=()=>{let n=s.map(e=>t.createContext(e));return function(r){let s=r?.[e]||n;return t.useMemo(()=>({[`__scope${e}`]:{...r,[e]:s}}),[r,s])}};return o.scopeName=e,[function(r,o){let i=t.createContext(o),a=s.length;s=[...s,o];let l=r=>{let{scope:s,children:o,...l}=r,c=s?.[e]?.[a]||i,u=t.useMemo(()=>l,Object.values(l));return(0,n.jsx)(c.Provider,{value:u,children:o})};return l.displayName=r+"Provider",[l,function(n,s){let l=s?.[e]?.[a]||i,c=t.useContext(l);if(c)return c;if(void 0!==o)return o;throw Error(`\`${n}\` must be used within \`${r}\``)}]},function(...e){let n=e[0];if(1===e.length)return n;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=r.reduce((t,{useScope:n,scopeName:r})=>{let s=n(e)[`__scope${r}`];return{...t,...s}},{});return t.useMemo(()=>({[`__scope${n.scopeName}`]:s}),[s])}};return r.scopeName=n.scopeName,r}(o,...r)]}])},980939,652053,e=>{"use strict";var t=e.i(101685),n=e.i(380560),r=e.i(967928),s=e.i(44501);function o(e){var n;let o,i=(n=e,(o=t.forwardRef((e,n)=>{let{children:s,...o}=e;if(t.isValidElement(s)){var i;let e,a,l=(i=s,(a=(e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(a=(e=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref),c=function(e,t){let n={...t};for(let r in t){let s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...e)=>{let t=o(...e);return s(...e),t}:s&&(n[r]=s):"style"===r?n[r]={...s,...o}:"className"===r&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}(o,s.props);return s.type!==t.Fragment&&(c.ref=n?(0,r.composeRefs)(n,l):l),t.cloneElement(s,c)}return t.Children.count(s)>1?t.Children.only(null):null})).displayName=`${n}.SlotClone`,o),l=t.forwardRef((e,n)=>{let{children:r,...o}=e,l=t.Children.toArray(r),c=l.find(a);if(c){let e=c.props.children,r=l.map(n=>n!==c?n:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,s.jsx)(i,{...o,ref:n,children:t.isValidElement(e)?t.cloneElement(e,void 0,r):null})}return(0,s.jsx)(i,{...o,ref:n,children:r})});return l.displayName=`${e}.Slot`,l}var i=Symbol("radix.slottable");function a(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===i}e.s(["createSlot",0,o,"createSlottable",0,function(e){let t=({children:e})=>(0,s.jsx)(s.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=i,t}],652053);var l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{let r=o(`Primitive.${n}`),i=t.forwardRef((e,t)=>{let{asChild:o,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(o?r:n,{...i,ref:t})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});e.s(["Primitive",0,l,"dispatchDiscreteCustomEvent",0,function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}],980939)},417256,672687,e=>{"use strict";var t=e.i(101685),n=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["useLayoutEffect",0,n],672687),t[" useEffectEvent ".trim().toString()],t[" useInsertionEffect ".trim().toString()];var r=t[" useInsertionEffect ".trim().toString()]||n;Symbol("RADIX:SYNC_STATE"),e.s(["useControllableState",0,function({prop:e,defaultProp:n,onChange:s=()=>{},caller:o}){let[i,a,l]=function({defaultProp:e,onChange:n}){let[s,o]=t.useState(e),i=t.useRef(s),a=t.useRef(n);return r(()=>{a.current=n},[n]),t.useEffect(()=>{i.current!==s&&(a.current?.(s),i.current=s)},[s,i]),[s,o,a]}({defaultProp:n,onChange:s}),c=void 0!==e,u=c?e:i;{let n=t.useRef(void 0!==e);t.useEffect(()=>{let e=n.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${o} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=c},[c,o])}return[u,t.useCallback(t=>{if(c){let n="function"==typeof t?t(e):t;n!==e&&l.current?.(n)}else a(t)},[c,e,a,l])]}],417256)},461614,e=>{"use strict";var t=e.i(101685),n=e.i(672687);e.s(["useSize",0,function(e){let[r,s]=t.useState(void 0);return(0,n.useLayoutEffect)(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,r;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,r=t.blockSize}else n=e.offsetWidth,r=e.offsetHeight;s({width:n,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),r}])},506703,e=>{"use strict";let t=(0,e.i(801685).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],506703)},747791,e=>{"use strict";var t=e.i(101685),n=e.i(980939),r=e.i(44501),s=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o=t.forwardRef((e,t)=>(0,r.jsx)(n.Primitive.span,{...e,ref:t,style:{...s,...e.style}}));o.displayName="VisuallyHidden",e.s(["Root",0,o,"VISUALLY_HIDDEN_STYLES",0,s])},723888,e=>{"use strict";var t=e.i(44501),n=e.i(101685),r=e.i(876490);let s=n.forwardRef(({className:e,type:n,...s},o)=>(0,t.jsx)("input",{type:n,className:(0,r.cn)("flex h-8 w-full rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-3 py-1 text-sm transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground","placeholder:text-[hsl(var(--subtle))]","focus-visible:outline-none focus-visible:border-[hsl(var(--primary))] focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.2)] focus-visible:ring-offset-0","disabled:cursor-not-allowed disabled:bg-[hsl(var(--secondary))] disabled:text-[hsl(var(--muted-foreground))]",e),ref:o,...s}));s.displayName="Input",e.s(["Input",0,s])},766476,750110,e=>{"use strict";var t=e.i(44501),n=e.i(101685);e.i(380560);var r=e.i(206102),s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,s)=>{let o=(0,r.createSlot)(`Primitive.${s}`),i=n.forwardRef((e,n)=>{let{asChild:r,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(r?o:s,{...i,ref:n})});return i.displayName=`Primitive.${s}`,{...e,[s]:i}},{});e.s(["Primitive",0,s],750110);var o=n.forwardRef((e,n)=>(0,t.jsx)(s.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label";var i=e.i(294237),a=e.i(876490);let l=(0,i.cva)("text-sm font-medium leading-none text-[hsl(var(--foreground))] peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(o,{ref:r,className:(0,a.cn)(l(),e),...n}));c.displayName=o.displayName,e.s(["Label",0,c],766476)},820268,e=>{"use strict";let t=(0,e.i(801685).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],820268)},843754,e=>{"use strict";let t=(0,e.i(801685).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["Info",0,t],843754)},447421,e=>{"use strict";var t=e.i(44501),n=e.i(101685),r=e.i(291967),s=e.i(543250),o=e.i(677275),i=e.i(190088),a=e.i(980939),l=e.i(25486),c=e.i(417256),u=e.i(433616),d="Tabs",[m,f]=(0,s.createContextScope)(d,[o.createRovingFocusGroupScope]),p=(0,o.createRovingFocusGroupScope)(),[h,v]=m(d),y=n.forwardRef((e,n)=>{let{__scopeTabs:r,value:s,onValueChange:o,defaultValue:i,orientation:m="horizontal",dir:f,activationMode:p="automatic",...v}=e,y=(0,l.useDirection)(f),[b,g]=(0,c.useControllableState)({prop:s,onChange:o,defaultProp:i??"",caller:d});return(0,t.jsx)(h,{scope:r,baseId:(0,u.useId)(),value:b,onValueChange:g,orientation:m,dir:y,activationMode:p,children:(0,t.jsx)(a.Primitive.div,{dir:y,"data-orientation":m,...v,ref:n})})});y.displayName=d;var b="TabsList",g=n.forwardRef((e,n)=>{let{__scopeTabs:r,loop:s=!0,...i}=e,l=v(b,r),c=p(r);return(0,t.jsx)(o.Root,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:(0,t.jsx)(a.Primitive.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:n})})});g.displayName=b;var x="TabsTrigger",j=n.forwardRef((e,n)=>{let{__scopeTabs:s,value:i,disabled:l=!1,...c}=e,u=v(x,s),d=p(s),m=S(u.baseId,i),f=C(u.baseId,i),h=i===u.value;return(0,t.jsx)(o.Item,{asChild:!0,...d,focusable:!l,active:h,children:(0,t.jsx)(a.Primitive.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:m,...c,ref:n,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():u.onValueChange(i)}),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&u.onValueChange(i)}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==u.activationMode;h||l||!e||u.onValueChange(i)})})})});j.displayName=x;var w="TabsContent",I=n.forwardRef((e,r)=>{let{__scopeTabs:s,value:o,forceMount:l,children:c,...u}=e,d=v(w,s),m=S(d.baseId,o),f=C(d.baseId,o),p=o===d.value,h=n.useRef(p);return n.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(i.Presence,{present:l||p,children:({present:n})=>(0,t.jsx)(a.Primitive.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":m,hidden:!n,id:f,tabIndex:0,...u,ref:r,style:{...e.style,animationDuration:h.current?"0s":void 0},children:n&&c})})});function S(e,t){return`${e}-trigger-${t}`}function C(e,t){return`${e}-content-${t}`}I.displayName=w;var E=e.i(876490);let F=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(g,{ref:r,className:(0,E.cn)("inline-flex h-10 items-center justify-center rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--secondary))] p-1 text-muted-foreground shadow-[inset_0_1px_2px_rgba(15,23,42,0.04)]",e),...n}));F.displayName=g.displayName;let N=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(j,{ref:r,className:(0,E.cn)("inline-flex h-8 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-3.5 text-sm font-medium","ring-offset-[hsl(var(--background))] transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","hover:text-foreground","data-[state=active]:bg-[hsl(var(--background))]","data-[state=active]:text-[hsl(var(--primary))]","data-[state=active]:shadow-[0_1px_2px_rgba(15,23,42,0.08),0_0_0_1px_hsl(var(--border))]","data-[state=active]:font-semibold",e),...n}));N.displayName=j.displayName;let R=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(I,{ref:r,className:(0,E.cn)("mt-3 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));R.displayName=I.displayName,e.s(["Tabs",0,y,"TabsContent",0,R,"TabsList",0,F,"TabsTrigger",0,N],447421)},712912,e=>{"use strict";var t=e.i(101685),n=e.i(515793);e.s(["useLocaleRevalidation",0,function(e){let{locale:r}=(0,n.useI18n)(),s=(0,t.useRef)(r);(0,t.useEffect)(()=>{if(r===s.current)return;s.current=r;let t=Object.keys(e.formState.errors);0!==t.length&&e.trigger(t)},[r])}])},847474,e=>{"use strict";var t=e.i(44501),n=e.i(101685),r=e.i(988310),s=e.i(480883),o=e.i(843754),i=e.i(832356),a=e.i(942595),l=e.i(321562),c=e.i(723888),u=e.i(166473),d=e.i(447421),m=e.i(45123);let f=i.z.string().trim().regex(/^[a-z0-9-]{1,32}$/,"Name must be 1-32 lowercase letters, digits, or hyphens").refine(e=>"default"!==e,'Name "default" is reserved'),p=(e,t=512)=>i.z.string().trim().min(1,`Please enter ${e}`).max(t),h=(e=512)=>i.z.string().trim().max(e).optional().or(i.z.literal("")),v={message:"AccessKey ID and Secret must be provided together",path:["accessKeySecret"]},y={message:"Provide at least an API Key, or AccessKey ID + Secret",path:["apiKey"]};function b(e){return e.refine(e=>!!e.accessKeyId==!!e.accessKeySecret,v).refine(e=>!!(e.accessKeyId&&e.accessKeySecret)||!!e.apiKey,y)}let g=i.z.object({name:f,accessKeyId:h(128),accessKeySecret:h(512),apiKey:h(512),otsEndpoint:p("OTS Endpoint",256),otsInstanceName:p("OTS instance name",128),ossEndpoint:h(256),ossBucketName:h(128),region:h(64),activate:i.z.boolean().optional()});b(g),i.z.object({accessKeyId:h(128),accessKeySecret:h(512),apiKey:h(512),otsEndpoint:h(256),otsInstanceName:h(128),ossEndpoint:h(256),ossBucketName:h(128),region:h(64),activate:i.z.boolean().optional()}).refine(e=>{let t=!!(e.accessKeyId&&e.accessKeyId.length>0);return!!(e.accessKeySecret&&e.accessKeySecret.length>0)===t},{message:"AccessKey ID and Secret must be updated together: fill in both or leave both blank",path:["accessKeySecret"]});let x=i.z.object({name:f,accessKeyId:h(128),accessKeySecret:h(512),apiKey:h(512),otsEndpoint:p("OTS Endpoint",256),otsInstanceName:p("OTS instance name",128),ossEndpoint:h(256),ossBucketName:h(128),region:h(64),activate:i.z.boolean().optional()}).refine(e=>{let t=!!(e.accessKeyId&&e.accessKeyId.length>0);return!!(e.accessKeySecret&&e.accessKeySecret.length>0)===t},{message:"AccessKey ID and Secret must be updated together: fill in both or leave both blank",path:["accessKeySecret"]});i.z.object({token:i.z.string().trim().min(10,"Token is too short to be parsed").max(4096),name:f.optional(),activate:i.z.boolean().optional()});var j=e.i(712912),w=e.i(515793);function I(e){return i.z.string().trim().regex(/^[a-z0-9-]{1,32}$/,e("instance.validation.namePattern")).refine(e=>"default"!==e,e("instance.validation.nameReserved"))}e.s(["ConnectInstanceForm",0,function({mode:e,defaultValues:f,accessKeyIdPlaceholder:p,accessKeySecretPlaceholder:h,apiKeyPlaceholder:v,onSubmit:y,busy:S,lockName:C,submitLabel:E}){let{t:F}=(0,w.useI18n)(),[N,R]=(0,n.useState)("manual"),K="edit"===e,k=(0,n.useMemo)(()=>[{value:"cn-beijing",label:F("instance.regions.cn-beijing")},{value:"cn-hangzhou",label:F("instance.regions.cn-hangzhou")},{value:"cn-shanghai",label:F("instance.regions.cn-shanghai")},{value:"cn-shenzhen",label:F("instance.regions.cn-shenzhen")},{value:"__custom__",label:F("instance.regions.custom")}],[F]),M=f?.region??"cn-hangzhou",T=(0,n.useMemo)(()=>k.some(e=>e.value===M),[M,k]),[_,O]=(0,n.useState)(T?M:"__custom__"),P=(0,n.useMemo)(()=>(0,r.zodResolver)(K?x.innerType().extend({name:I(F),otsEndpoint:i.z.string().trim().min(1,F("instance.validation.required",{label:F("instance.validation.labelOtsEndpoint")})).max(256),otsInstanceName:i.z.string().trim().min(1,F("instance.validation.required",{label:F("instance.validation.labelOtsInstanceName")})).max(128)}).refine(e=>{let t=!!(e.accessKeyId&&e.accessKeyId.length>0);return!!(e.accessKeySecret&&e.accessKeySecret.length>0)===t},{message:F("instance.validation.akSkPairUpdate"),path:["accessKeySecret"]}):b(g.extend({name:I(F),otsEndpoint:i.z.string().trim().url(F("instance.validation.otsEndpointUrl")),otsInstanceName:i.z.string().trim().min(1,F("instance.validation.required",{label:F("instance.validation.labelOtsInstanceName")})).max(128),ossEndpoint:i.z.string().trim().url(F("instance.validation.ossEndpointUrl")).optional().or(i.z.literal(""))}))),[K,F]),L=(0,s.useForm)({resolver:P,defaultValues:{name:f?.name??"",accessKeyId:K?"":f?.accessKeyId??"",accessKeySecret:K?"":f?.accessKeySecret??"",apiKey:K?"":f?.apiKey??"",otsEndpoint:f?.otsEndpoint??"",otsInstanceName:f?.otsInstanceName??"",ossEndpoint:f?.ossEndpoint??"",ossBucketName:f?.ossBucketName??"",region:M}}),A=(0,n.useMemo)(()=>(0,r.zodResolver)(i.z.object({token:i.z.string().trim().min(10,F("instance.validation.tokenTooShort")).max(4096)})),[F]),D=(0,s.useForm)({resolver:A,defaultValues:{token:""}});async function z(e){let t=e.ossEndpoint?.trim()||void 0,n=e.ossBucketName?.trim()||void 0;t&&n&&(t=function(e,t){try{let n=new URL(e);if(n.hostname.startsWith(`${t}.`))return n.hostname=n.hostname.slice(t.length+1),n.toString().replace(/\/$/,"")}catch{}return e}(t,n));let r={...e,ossEndpoint:t,ossBucketName:n};await y(r)}async function $(e){let t={token:e.token.trim()};await y(t)}(0,j.useLocaleRevalidation)(L),(0,j.useLocaleRevalidation)(D);let U="create"===e;return(0,t.jsxs)(d.Tabs,{value:N,onValueChange:e=>R(e),className:"w-full",children:[U&&(0,t.jsxs)(d.TabsList,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(d.TabsTrigger,{value:"manual",children:F("instance.form.tabManual")}),(0,t.jsx)(d.TabsTrigger,{value:"token",children:F("instance.form.tabToken")})]}),(0,t.jsx)(d.TabsContent,{value:"manual",className:"mt-4",children:(0,t.jsx)(l.Form,{...L,children:(0,t.jsxs)("form",{onSubmit:L.handleSubmit(z),className:"space-y-4",children:[(0,t.jsx)(l.FormField,{control:L.control,name:"name",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.nameLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,placeholder:F("instance.form.namePlaceholder"),disabled:C||S,autoComplete:"off"})}),(0,t.jsx)(l.FormDescription,{children:F("instance.form.nameDesc")}),(0,t.jsx)(l.FormMessage,{})]})}),(0,t.jsx)(l.FormField,{control:L.control,name:"region",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.regionLabel")}),"__custom__"===_?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,placeholder:F("instance.form.regionCustomPlaceholder"),disabled:S})}),(0,t.jsx)(a.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>{O("cn-hangzhou"),e.onChange("cn-hangzhou")},disabled:S,children:F("instance.form.usePreset")})]}):(0,t.jsxs)(u.Select,{value:_,onValueChange:t=>{O(t),"__custom__"!==t?e.onChange(t):e.onChange("")},disabled:S,children:[(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(u.SelectTrigger,{children:(0,t.jsx)(u.SelectValue,{})})}),(0,t.jsx)(u.SelectContent,{children:k.map(e=>(0,t.jsx)(u.SelectItem,{value:e.value,children:e.label},e.value))})]}),(0,t.jsx)(l.FormMessage,{})]})}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(l.FormField,{control:L.control,name:"accessKeyId",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.accessKeyIdLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,autoComplete:"off",disabled:S,placeholder:K&&p?F("instance.common.keepEmptyHint",{placeholder:p}):void 0})}),K&&(0,t.jsx)(l.FormDescription,{children:F("instance.form.akSkPairHint")}),(0,t.jsx)(l.FormMessage,{})]})}),(0,t.jsx)(l.FormField,{control:L.control,name:"accessKeySecret",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.accessKeySecretLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,type:"password",autoComplete:"new-password",disabled:S,placeholder:K&&h?F("instance.common.keepEmptyHint",{placeholder:h}):void 0})}),(0,t.jsx)(l.FormMessage,{})]})})]}),(0,t.jsx)(l.FormField,{control:L.control,name:"apiKey",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.apiKeyLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,type:"password",autoComplete:"new-password",disabled:S,placeholder:K&&v?F("instance.common.keepEmptyHint",{placeholder:v}):"sk-..."})}),(0,t.jsx)(l.FormDescription,{children:F("instance.form.apiKeyDesc")}),(0,t.jsx)(l.FormMessage,{})]})}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(l.FormField,{control:L.control,name:"otsEndpoint",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.otsEndpointLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,placeholder:"https://xxx.cn-hangzhou.ots.aliyuncs.com",disabled:S})}),(0,t.jsx)(l.FormMessage,{})]})}),(0,t.jsx)(l.FormField,{control:L.control,name:"otsInstanceName",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.otsInstanceNameLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,disabled:S})}),(0,t.jsx)(l.FormMessage,{})]})})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.4)] px-3 py-2 text-xs text-[hsl(var(--muted-foreground))]",children:[(0,t.jsx)(o.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[hsl(var(--primary))]"}),(0,t.jsx)("span",{children:F("instance.form.ossInfoHint")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(l.FormField,{control:L.control,name:"ossEndpoint",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.ossEndpointLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,placeholder:"https://oss-cn-hangzhou.aliyuncs.com",disabled:S})}),(0,t.jsx)(l.FormMessage,{})]})}),(0,t.jsx)(l.FormField,{control:L.control,name:"ossBucketName",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.ossBucketLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(c.Input,{...e,disabled:S})}),(0,t.jsx)(l.FormMessage,{})]})})]}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)(a.Button,{type:"submit",disabled:S,children:S?F("instance.form.submitting"):E??("edit"===e?F("instance.form.submitEdit"):F("instance.form.submitCreate"))})})]})})}),U&&(0,t.jsx)(d.TabsContent,{value:"token",className:"mt-4",children:(0,t.jsx)(l.Form,{...D,children:(0,t.jsxs)("form",{onSubmit:D.handleSubmit($),className:"space-y-4",children:[(0,t.jsx)(l.FormField,{control:D.control,name:"token",render:({field:e})=>(0,t.jsxs)(l.FormItem,{children:[(0,t.jsx)(l.FormLabel,{children:F("instance.form.tokenLabel")}),(0,t.jsx)(l.FormControl,{children:(0,t.jsx)(m.Textarea,{...e,rows:5,placeholder:F("instance.form.tokenPlaceholder"),disabled:S})}),(0,t.jsx)(l.FormDescription,{children:F("instance.form.tokenDesc")}),(0,t.jsx)(l.FormMessage,{})]})}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)(a.Button,{type:"submit",disabled:S,children:S?F("instance.form.tokenImporting"):F("instance.form.tokenSubmit")})})]})})})]})}],847474)},853859,659387,e=>{"use strict";var t=e.i(137500),n=e.i(543876),r=e.i(712984),s=e.i(187014),o=e.i(593321);async function i(){return(0,o.apiGet)("/api/v1/instances")}async function a(){return(0,o.apiGet)("/api/v1/instances/connectivity")}async function l(e){return(0,o.apiGet)(`/api/v1/instances/${encodeURIComponent(e)}`)}async function c(e){return(0,o.apiPost)("/api/v1/instances",e)}async function u(e){return(0,o.apiPost)("/api/v1/instances",e)}async function d(e,t){return(0,o.apiPut)(`/api/v1/instances/${encodeURIComponent(e)}`,t)}async function m(e){return(0,o.apiDelete)(`/api/v1/instances/${encodeURIComponent(e)}`)}async function f(e){return(0,o.apiPost)(`/api/v1/instances/${encodeURIComponent(e)}/use`)}async function p(e){return(0,o.apiGet)(`/api/v1/instances/${encodeURIComponent(e)}/token`)}var h=e.i(247570),v=e.i(307166),y=e.i(515793);function b(e){(0,h.invalidateInstanceScopedQueries)(e)}function g(e){(0,h.resetInstanceScopedQueries)(e)}function x(e){e.invalidateQueries({queryKey:h.RUNTIME_CONTEXT_QUERY_KEY})}function j(e){e.invalidateQueries({queryKey:["instance-connectivity"]})}e.s(["useConnectInstance",0,function(){let e=(0,r.useQueryClient)(),{t:n}=(0,y.useI18n)();return(0,t.useMutation)({mutationFn:e=>c(e),onSuccess:()=>{g(e),j(e),x(e),s.toast.success(n("instance.toast.created"))},onError:e=>{s.toast.error(e instanceof Error?e.message:n("instance.toast.createFailed"))}})},"useDeleteInstance",0,function(){let e=(0,r.useQueryClient)(),{t:n}=(0,y.useI18n)();return(0,t.useMutation)({mutationFn:e=>m(e),onSuccess:()=>{b(e),j(e),x(e),s.toast.success(n("instance.toast.deleted"))},onError:e=>{s.toast.error(e instanceof Error?e.message:n("instance.toast.deleteFailed"))}})},"useExportInstanceToken",0,function(){let{t:e}=(0,y.useI18n)();return(0,t.useMutation)({mutationFn:e=>p(e),onError:t=>{s.toast.error(t instanceof Error?t.message:e("instance.toast.exportFailed"))}})},"useImportInstance",0,function(){let e=(0,r.useQueryClient)(),{t:n}=(0,y.useI18n)();return(0,t.useMutation)({mutationFn:e=>u(e),onSuccess:()=>{g(e),j(e),x(e),s.toast.success(n("instance.toast.tokenImported"))},onError:e=>{s.toast.error(e instanceof Error?e.message:n("instance.toast.tokenImportFailed"))}})},"useInstance",0,function(e){let{context:t,ready:r}=(0,v.useRuntimeContext)();return(0,n.useQuery)({queryKey:h.queryKeys.instance(t.dataScopeKey,e),queryFn:()=>l(e),enabled:r&&!!e,staleTime:3e4})},"useInstanceConnectivity",0,function(){let{context:e,ready:t}=(0,v.useRuntimeContext)();return(0,n.useQuery)({queryKey:h.queryKeys.instanceConnectivity(e.dataScopeKey),queryFn:a,enabled:t,staleTime:3e4,refetchInterval:3e4})},"useInstances",0,function(){let{context:e,ready:t}=(0,v.useRuntimeContext)();return(0,n.useQuery)({queryKey:h.queryKeys.instances(e.dataScopeKey),queryFn:i,select:t=>{var n;return{...t,activeInstance:(n=t.activeInstance,e.activeInstance??e.instanceName??n)}},enabled:t,staleTime:3e4})},"useSwitchInstance",0,function(){let e=(0,r.useQueryClient)(),{context:n}=(0,v.useRuntimeContext)(),{t:o}=(0,y.useI18n)();return(0,t.useMutation)({mutationFn:e=>f(e),onSuccess:({activeInstance:t})=>{(0,v.markDashboardRuntimeContextChange)(window.sessionStorage,{previousDataScopeKey:n.dataScopeKey,targetActiveInstance:t}),g(e),x(e),s.toast.success(o("instance.toast.switched"))},onError:e=>{s.toast.error(e instanceof Error?e.message:o("instance.toast.switchFailed"))}})},"useUpdateInstance",0,function(e){let n=(0,r.useQueryClient)(),{t:o}=(0,y.useI18n)();return(0,t.useMutation)({mutationFn:t=>d(e,t),onSuccess:()=>{b(n),n.invalidateQueries({queryKey:["instance"]}),j(n),x(n),s.toast.success(o("instance.toast.updated"))},onError:e=>{s.toast.error(e instanceof Error?e.message:o("instance.toast.updateFailed"))}})}],853859),e.s(["isImportPayload",0,function(e){return"string"==typeof e.token}],659387)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,802447,e=>{"use strict";var t=e.i(44501),r=e.i(101685),a=e.i(967225),s=e.i(942595),o=e.i(107663),n=e.i(821122);let i=(0,e.i(801685).default)("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);var l=e.i(330363),d=e.i(515793),m=e.i(876490);function c({sessions:e,activeSessionId:r,onNewSession:a,onSelectSession:o,onDeleteSession:n,onClearAll:m}){let{t:p}=(0,d.useI18n)();return(0,t.jsxs)("aside",{className:"flex h-full w-64 shrink-0 flex-col border-r border-[hsl(var(--border))] bg-[hsl(var(--surface))]",children:[(0,t.jsx)("div",{className:"border-b border-[hsl(var(--border))] p-3",children:(0,t.jsxs)(s.Button,{type:"button",onClick:a,className:"w-full justify-start gap-2",variant:"outline",children:[(0,t.jsx)(i,{className:"h-4 w-4"}),p("chat.history.newChat")]})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===e.length?(0,t.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("chat.history.empty")}):(0,t.jsx)("ul",{className:"space-y-0.5 p-2",children:e.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(u,{session:e,active:e.id===r,onSelect:()=>o(e.id),onDelete:()=>n(e.id)})},e.id))})}),e.length>0?(0,t.jsx)("div",{className:"border-t border-[hsl(var(--border))] p-2",children:(0,t.jsxs)(s.Button,{type:"button",variant:"ghost",size:"sm",onClick:m,className:"w-full justify-start gap-2 text-muted-foreground hover:text-[hsl(var(--destructive))]",children:[(0,t.jsx)(l.Trash2,{className:"h-3.5 w-3.5"}),p("chat.history.clearAll")]})}):null]})}function u({session:e,active:r,onSelect:a,onDelete:o}){let{t:n}=(0,d.useI18n)(),i=e.config.mounts.length;return(0,t.jsxs)("div",{className:(0,m.cn)("group flex items-center gap-1 rounded-md px-2 py-1.5 text-sm transition-colors",r?"bg-[hsl(var(--accent))] text-foreground":"text-foreground/80 hover:bg-[hsl(var(--accent)/0.6)]"),children:[(0,t.jsxs)("button",{type:"button",onClick:a,className:"flex min-w-0 flex-1 flex-col items-start text-left",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:e.title}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,t.jsx)("span",{children:function(e,t){let r=Math.floor((Date.now()-e)/6e4);if(r<1)return t("chat.history.justNow");if(r<60)return t("chat.history.minutesAgo",{count:r});let a=Math.floor(r/60);if(a<24)return t("chat.history.hoursAgo",{count:a});let s=Math.floor(a/24);return s<7?t("chat.history.daysAgo",{count:s}):new Date(e).toLocaleDateString()}(e.updatedAt,n)}),i>0?(0,t.jsxs)("span",{children:["· ",i," KB"]}):null]})]}),(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"icon",onClick:e=>{e.stopPropagation(),o()},className:"h-6 w-6 opacity-0 group-hover:opacity-100",title:n("chat.history.delete"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3 text-muted-foreground"})})]})}var p=e.i(506703),h=e.i(144308),g=e.i(723888),y=e.i(766476),f=e.i(247932),v=e.i(433042),x=e.i(906962),b=e.i(828772);let w={providerId:"",model:"",systemPrompt:"",temperature:void 0,aggregateTopK:20,perKbTopK:20,retrieval:{searchType:["DENSE_VECTOR","FULL_TEXT"],rerankType:"WEIGHT",weightDense:.7,weightFullText:.3},mounts:[],wikiEnabled:!1,wikiTopK:3};function N(e){if(e)return JSON.stringify([e.memoryStoreName,e.storageMode??null,e.scope.appId,e.scope.tenantId,e.scope.agentId,e.scope.runId])}function j(e,t){return{id:t,...e,scope:{...e.scope,runId:(0,b.normalizeMemoryRunId)(e.storageMode,e.scope.runId)}}}function S(e){return(0,b.isKnownStorageMode)(e?.storageMode)&&!!e&&!!e.memoryStoreName.trim()&&Object.values(e.scope).every(e=>{let t=e.trim();return t.length>0&&"*"!==t})}function k(e){return"number"==typeof e&&Number.isInteger(e)&&e>=1&&e<=10?e:3}let T=["providerId","model","systemPrompt","temperature","aggregateTopK","perKbTopK","retrieval","mounts"];function I(e,t){switch(t.type){case"SET_PROVIDER":return{...e,providerId:t.providerId,model:t.model};case"SET_MODEL":return{...e,model:t.model};case"SET_SYSTEM_PROMPT":return{...e,systemPrompt:t.value};case"SET_TEMPERATURE":return{...e,temperature:t.value};case"SET_AGGREGATE_TOP_K":return{...e,aggregateTopK:t.value};case"SET_PER_KB_TOP_K":return{...e,perKbTopK:t.value};case"SET_RETRIEVAL":return{...e,retrieval:t.value};case"ADD_MOUNT":if(e.mounts.some(e=>e.knowledgeBaseName===t.mount.knowledgeBaseName))return e;return{...e,mounts:[...e.mounts,t.mount]};case"UPDATE_MOUNT":return{...e,mounts:e.mounts.map(e=>e.id===t.id?{...e,...t.patch}:e)};case"RESET_MOUNT_RETRIEVAL":return{...e,mounts:e.mounts.map(e=>{if(e.id!==t.id)return e;let{retrieval:r,topK:a,...s}=e;return s})};case"REMOVE_MOUNT":return{...e,mounts:e.mounts.filter(e=>e.id!==t.id)};case"REORDER_MOUNTS":{let r=new Map(e.mounts.map(e=>[e.id,e])),a=t.ids.map(e=>r.get(e)).filter(e=>!!e);return{...e,mounts:a}}case"HYDRATE":{let r=t.state,{memory:a,wikiEnabled:s,wikiTopK:o}=r,n=Object.fromEntries(T.filter(e=>Object.prototype.hasOwnProperty.call(r,e)).map(e=>[e,r[e]]));if(!Object.prototype.hasOwnProperty.call(r,"memory")){let t=Object.prototype.hasOwnProperty.call(r,"wikiEnabled")?!0===s:e.wikiEnabled;return{...e,...n,wikiEnabled:t&&S(e.memory),...Object.prototype.hasOwnProperty.call(r,"wikiTopK")?{wikiTopK:k(o)}:{}}}if(!a)return{...e,...n,memory:void 0,wikiEnabled:!1,wikiTopK:k(o)};let i=j(a,a.id);return{...e,...n,memory:i,wikiEnabled:!0===s&&S(i),wikiTopK:k(o)}}case"SET_MEMORY":{if(!t.binding)return{...e,memory:void 0,wikiEnabled:!1};let r=j(t.binding,e.memory?.id??(0,x.newId)("memory"));return{...e,memory:r,wikiEnabled:!!S(r)&&N(e.memory)===N(r)&&e.wikiEnabled}}case"UPDATE_MEMORY":{if(!e.memory)return e;let{scope:r,...a}=t.patch,s={...e.memory,...a,scope:{...e.memory.scope,...r??{}}},o=j(s,s.id);return{...e,memory:o,wikiEnabled:!!S(o)&&N(e.memory)===N(o)&&e.wikiEnabled}}case"SET_WIKI_ENABLED":return{...e,wikiEnabled:t.enabled&&S(e.memory)};case"SET_WIKI_TOP_K":return k(t.topK)===t.topK?{...e,wikiTopK:t.topK}:e;case"RESET":return w;default:return e}}let K=(0,r.createContext)(null);function E({children:e}){let[a,s]=(0,r.useReducer)(I,w),o=(0,r.useMemo)(()=>({...a,setProvider:(e,t)=>s({type:"SET_PROVIDER",providerId:e,model:t}),setModel:e=>s({type:"SET_MODEL",model:e}),setSystemPrompt:e=>s({type:"SET_SYSTEM_PROMPT",value:e}),setTemperature:e=>s({type:"SET_TEMPERATURE",value:e}),setAggregateTopK:e=>s({type:"SET_AGGREGATE_TOP_K",value:e}),setPerKbTopK:e=>s({type:"SET_PER_KB_TOP_K",value:e}),setRetrieval:e=>s({type:"SET_RETRIEVAL",value:e}),addMount:e=>s({type:"ADD_MOUNT",mount:e}),updateMount:(e,t)=>s({type:"UPDATE_MOUNT",id:e,patch:t}),resetMountRetrieval:e=>s({type:"RESET_MOUNT_RETRIEVAL",id:e}),removeMount:e=>s({type:"REMOVE_MOUNT",id:e}),reorderMounts:e=>s({type:"REORDER_MOUNTS",ids:e}),setMemory:e=>s({type:"SET_MEMORY",binding:e}),updateMemory:e=>s({type:"UPDATE_MEMORY",patch:e}),setWikiEnabled:e=>s({type:"SET_WIKI_ENABLED",enabled:e}),setWikiTopK:e=>s({type:"SET_WIKI_TOP_K",topK:e}),hydrate:e=>s({type:"HYDRATE",state:e}),reset:()=>s({type:"RESET"}),toSessionConfig:()=>({providerId:a.providerId||void 0,model:a.model||void 0,systemPrompt:a.systemPrompt||void 0,temperature:a.temperature,aggregateTopK:a.aggregateTopK,perKbTopK:a.perKbTopK,retrieval:a.retrieval,mounts:a.mounts,memory:a.memory,...a.wikiEnabled&&S(a.memory)?{wiki:{enabled:!0,topK:a.wikiTopK}}:{}})}),[a]);return(0,t.jsx)(K.Provider,{value:o,children:e})}function M(){let e=(0,r.useContext)(K);if(!e)throw Error("useChatConfig must be used within a ChatConfigProvider");return e}var C=e.i(550657),B=e.i(851024),_=e.i(109012),A=e.i(358204),D=e.i(377163),R=e.i(153139),P=e.i(636766);function F({kbs:e,onPick:a,children:s,align:o="start"}){let{t:n}=(0,d.useI18n)(),[i,l]=(0,r.useState)(!1),m=t=>{let r=e.find(e=>e.knowledgeBaseName===t);r&&(a(r),l(!1))};return(0,t.jsxs)(P.Popover,{open:i,onOpenChange:l,modal:!0,children:[(0,t.jsx)(P.PopoverTrigger,{asChild:!0,children:s}),(0,t.jsx)(P.PopoverContent,{align:o,sideOffset:6,className:"w-[var(--radix-popover-trigger-width)] min-w-[260px] p-0",children:(0,t.jsxs)(R.Command,{children:[(0,t.jsx)(R.CommandInput,{placeholder:n("chat.mount.searchKbPlaceholder")}),(0,t.jsxs)(R.CommandList,{children:[(0,t.jsx)(R.CommandEmpty,{children:n("chat.mount.noMatchingKb")}),e.length>0?(0,t.jsx)(R.CommandGroup,{children:e.map(e=>(0,t.jsxs)(R.CommandItem,{value:e.knowledgeBaseName,onSelect:m,children:[(0,t.jsx)(D.Database,{className:"text-[hsl(var(--muted-foreground))]"}),(0,t.jsx)("span",{className:"truncate",children:e.knowledgeBaseName})]},e.knowledgeBaseName))}):null]})]})})]})}function O({kbs:e,onAdd:r}){let{t:a}=(0,d.useI18n)();return 0===e.length?null:(0,t.jsx)(F,{kbs:e,onPick:r,align:"start",children:(0,t.jsxs)("button",{type:"button",className:"group flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-[hsl(var(--border))] bg-transparent px-3 py-2 text-xs font-medium text-[hsl(var(--muted-foreground))] transition-colors hover:border-[hsl(var(--primary)/0.5)] hover:bg-[hsl(var(--primary-soft))] hover:text-[hsl(var(--primary))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--primary)/0.3)] focus-visible:ring-offset-1 focus-visible:ring-offset-[hsl(var(--background))]",children:[(0,t.jsx)(A.Plus,{className:"h-3.5 w-3.5 transition-transform group-hover:rotate-90"}),a("chat.mount.addMore"),(0,t.jsxs)("span",{className:"text-[hsl(var(--muted-foreground))]/70 group-hover:text-[hsl(var(--primary))]/70",children:["(",e.length,")"]})]})})}var L=e.i(861403),W=e.i(18722),U=e.i(882652),V=e.i(229025),q=e.i(234752),z=e.i(187014),H=e.i(754614),G=e.i(162769),Q=e.i(166473),X=e.i(433253),Y=e.i(949456);function $(e){let{open:r,onOpenChange:a,memoryStoreName:s,scope:o}=e,{t:n}=(0,d.useI18n)();return(0,t.jsx)(X.Dialog,{open:r,onOpenChange:a,children:(0,t.jsxs)(X.DialogContent,{className:"flex h-[86vh] max-h-[900px] w-[95vw] max-w-[1400px] flex-col overflow-hidden",children:[(0,t.jsxs)(X.DialogHeader,{children:[(0,t.jsxs)(X.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(V.FolderTree,{className:"h-4 w-4"}),n("chat.filesDialog.title")]}),(0,t.jsx)(X.DialogDescription,{children:n("chat.filesDialog.description")})]}),(0,t.jsx)(Y.MemoryFilesBrowser,{memoryStoreName:s,scope:o,enabled:r,className:"min-h-0 flex-1"})]})})}var J=e.i(192988),Z=e.i(858620);function ee(){var e,a;let{t:s}=(0,d.useI18n)(),o=M(),n=o.memory,i=(0,b.isKnownStorageMode)(n?.storageMode),l=(e=n?.scope)&&[e.appId,e.tenantId,e.agentId,e.runId].every(e=>e.trim().length>0&&"*"!==e.trim())?n.scope:void 0,m=S(n)?l:void 0,c=(0,Z.useWiki)(i?n?.memoryStoreName:void 0,m),u=!!m&&(a=c.data,a?.status==="ready"),p=o.wikiEnabled&&!!m,[h,f]=(0,r.useState)(String(o.wikiTopK));(0,r.useEffect)(()=>f(String(o.wikiTopK)),[o.wikiTopK]);let v=n?i?l?c.isLoading?s("common.loading"):c.error?s("chat.wikiBind.loadFailed"):c.data?u?void 0:s("chat.wikiBind.notReady"):s("chat.wikiBind.notFound"):s("chat.wikiBind.requiresExactScope"):s("chat.wikiBind.requiresKnownStorageMode"):s("chat.wikiBind.requiresMemory");return(0,t.jsxs)("div",{className:"space-y-3 border-t border-[hsl(var(--border-light))] pt-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:s("chat.wikiBind.title")}),(0,t.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:s("chat.wikiBind.description")})]}),m&&c.data?(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.3)] px-3 py-2",children:[(0,t.jsx)(J.BookOpen,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--primary))]"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:c.data.name}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:s(u?"chat.wikiBind.ready":"chat.wikiBind.notReady")})]}),(0,t.jsx)(G.Switch,{checked:p,disabled:!p&&!u,onCheckedChange:e=>o.setWikiEnabled(e&&u),"aria-label":s("chat.wikiBind.toggle")})]}):(0,t.jsx)(G.Switch,{checked:!1,disabled:!0,onCheckedChange:()=>void 0,"aria-label":s("chat.wikiBind.toggle")}),p?(0,t.jsxs)("details",{className:"rounded-md border border-[hsl(var(--border))] px-3 py-2",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:s("chat.wikiBind.advanced")}),(0,t.jsxs)("div",{className:"mt-2 flex items-center justify-end gap-2",children:[(0,t.jsx)(y.Label,{className:"text-xs text-muted-foreground",children:s("chat.wikiBind.topK")}),(0,t.jsx)(g.Input,{type:"number",min:1,max:10,step:1,className:"h-8 w-16",value:h,onChange:e=>f(e.target.value),onBlur:function(){var e;let t,r=(e=o.wikiTopK??3,Number.isFinite(t=Number(h))&&0!==h.trim().length?Math.min(10,Math.max(1,Math.trunc(t))):e);f(String(r)),o.setWikiTopK(r)},"aria-label":s("chat.wikiBind.topK")})]})]}):null,v?(0,t.jsx)(et,{children:v}):null]})}function et({children:e}){return(0,t.jsx)("p",{className:"rounded-md border border-dashed border-[hsl(var(--border))] px-3 py-2 text-xs text-muted-foreground",children:e})}var er=e.i(674978);function ea(){let{t:e}=(0,d.useI18n)(),a=M(),{data:s,isLoading:o,isSuccess:n}=(0,H.useMemoryStores)(),i=s?.items??[],l=a.memory,m=(0,r.useId)(),c=l?i.find(e=>e.memoryStoreName===l.memoryStoreName):void 0,u=!!c,p=(0,b.parseKnownStorageMode)(c?.storageMode),h=(0,b.normalizeStorageMode)(c?.storageMode??l?.storageMode),f=(0,b.storageModeCapabilities)(h),v=f.structuredAutoSave||f.writableFiles,x=l?.retrievalMode;return(0,r.useEffect)(()=>{if(!l||!n||!c)return;let e=(0,b.resolveRetrievalMode)(x,h),t=p??void 0,r={...x!==e?{retrievalMode:e}:{},...l.storageMode!==t?{storageMode:t}:{}};Object.keys(r).length>0&&a.updateMemory(r)},[l?.memoryStoreName,l?.storageMode,x,p,h,n,u]),(0,t.jsxs)("div",{className:"space-y-3 border-t border-[hsl(var(--border))] pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"text-sm font-medium",children:e("chat.memoryBind.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:l?e("chat.memoryBind.descBound",{topK:l.topK??5}):e("chat.memoryBind.descUnbound")})]}),l&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:m,className:"text-xs text-muted-foreground",title:e("chat.memoryBind.topKTitle"),children:"Top-K"}),(0,t.jsx)(g.Input,{id:m,type:"number",min:1,max:50,className:"h-8 w-20",value:l.topK??5,onChange:e=>{let t=parseInt(e.target.value,10),r=Number.isFinite(t)&&t>=1&&t<=50?t:5;a.updateMemory({topK:r})}})]})]}),l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{value:l.memoryStoreName,stores:i,onChange:e=>{let t=i.find(t=>t.memoryStoreName===e)?.storageMode,r=(0,b.parseKnownStorageMode)(t),s=(0,b.normalizeStorageMode)(t);a.updateMemory({memoryStoreName:e,storageMode:r??void 0,retrievalMode:(0,b.resolveRetrievalMode)(l.retrievalMode,s)})},onUnbind:()=>a.setMemory(void 0)}),(0,t.jsx)(es,{mode:(0,b.resolveRetrievalMode)(l.retrievalMode,h),storageMode:h,fileMemoryAllowed:f.files,onChange:e=>a.updateMemory({retrievalMode:e}),memoryStoreName:l.memoryStoreName,scope:l.scope}),(0,t.jsx)(el,{memoryStoreName:l.memoryStoreName,appId:l.scope.appId,tenantId:l.scope.tenantId,agentId:l.scope.agentId,runId:l.scope.runId,autoSave:l.autoSave,autoSaveAllowed:v,fileAutoSave:f.writableFiles,onScopeChange:e=>a.updateMemory({scope:e}),onAutoSaveChange:e=>a.updateMemory({autoSave:e})}),(0,t.jsx)(ee,{})]}):(0,t.jsx)(en,{stores:i,isLoading:o,onBind:()=>{let e=(0,b.parseKnownStorageMode)(i[0]?.storageMode);a.setMemory({memoryStoreName:i[0]?.memoryStoreName??"",...null!==e?{storageMode:e}:{},scope:{appId:"",tenantId:"",agentId:"",runId:""},autoSave:!0,topK:5})}})]})}function es(e){let{mode:a,storageMode:o,fileMemoryAllowed:n,onChange:i,memoryStoreName:l,scope:m}=e,{t:c}=(0,d.useI18n)(),[u,p]=(0,r.useState)(!1),h=!!m.appId&&!!m.tenantId&&!!m.agentId&&!!m.runId;return(0,r.useEffect)(()=>{l&&h||p(!1)},[l,h]),(0,t.jsxs)("div",{className:"space-y-2 border-t border-[hsl(var(--border-light))] pt-3",children:[(0,t.jsx)(y.Label,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:c("chat.memoryBind.retrievalModeLabel")}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsx)(eo,{active:"search"===a,disabled:"filemem"===o,title:c("chat.memoryBind.modeSearchTitle"),desc:c("chat.memoryBind.modeSearchDesc"),onClick:()=>i("search")}),(0,t.jsx)(eo,{active:"local"===a,disabled:!n,title:c("chat.memoryBind.modeLocalTitle"),desc:c("filemem"===o?"chat.memoryBind.modeLocalDescWritable":n?"chat.memoryBind.modeLocalDescEnabled":"chat.memoryBind.modeLocalDescDisabled"),onClick:()=>i("local")})]}),"local"===a?(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.25)] p-2.5",children:[(0,t.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:c("chat.memoryBind.localHint")}),(0,t.jsxs)(s.Button,{type:"button",variant:"outline",size:"sm",className:"h-8 w-full",disabled:!l||!h,onClick:()=>p(!0),title:c(h?"chat.memoryBind.viewFiles":"chat.memoryBind.viewFilesHint"),children:[(0,t.jsx)(V.FolderTree,{className:"h-3.5 w-3.5"}),c("chat.memoryBind.viewFiles")]}),l&&h?(0,t.jsx)($,{open:u,onOpenChange:p,memoryStoreName:l,scope:m}):null]}):null]})}function eo(e){return(0,t.jsxs)("button",{type:"button",onClick:e.onClick,disabled:e.disabled,"aria-pressed":e.active,className:(0,m.cn)("flex flex-col items-start gap-0.5 rounded-md border px-3 py-2 text-left transition-colors",e.disabled?"cursor-not-allowed border-[hsl(var(--border))] opacity-50":e.active?"border-[hsl(var(--primary)/0.5)] bg-[hsl(var(--primary-soft))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--muted)/0.4)]"),children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e.desc})]})}function en(e){let{stores:r,isLoading:a,onBind:o}=e,{t:n}=(0,d.useI18n)(),i=!a&&0===r.length;return(0,t.jsxs)("div",{className:"animate-home-reveal relative overflow-hidden rounded-lg border border-dashed border-[hsl(var(--primary)/0.35)] bg-gradient-to-br from-[hsl(var(--primary-soft))] via-[hsl(var(--surface))] to-[hsl(var(--surface))] px-5 py-6 text-center",role:"region","aria-label":n("chat.memoryBind.bindStoreAria"),children:[(0,t.jsx)(q.Sparkles,{className:"pointer-events-none absolute right-3 top-3 h-3.5 w-3.5 text-[hsl(var(--primary)/0.45)]","aria-hidden":!0}),(0,t.jsx)("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-[hsl(var(--primary-soft))] ring-1 ring-[hsl(var(--primary)/0.18)]",children:(0,t.jsx)(W.Brain,{className:"h-6 w-6 text-[hsl(var(--primary))]"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[hsl(var(--foreground))]",children:n(i?"chat.memoryBind.emptyNoStoresTitle":"chat.memoryBind.emptyBindTitle")}),(0,t.jsx)("p",{className:"mx-auto mt-1 max-w-[320px] text-xs leading-relaxed text-[hsl(var(--muted-foreground))]",children:n(i?"chat.memoryBind.emptyNoStoresDesc":"chat.memoryBind.emptyBindDesc")}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2",children:[i?(0,t.jsx)(s.Button,{asChild:!0,size:"default",className:"h-9 px-4",children:(0,t.jsxs)(L.default,{href:"/memory/create",children:[(0,t.jsx)(W.Brain,{className:"h-4 w-4"}),n("chat.memoryBind.createStore")]})}):(0,t.jsxs)(s.Button,{type:"button",size:"default",className:"h-9 px-4",disabled:a,onClick:o,children:[(0,t.jsx)(A.Plus,{className:"h-4 w-4"}),n("chat.memoryBind.bindStore")]}),i||a?null:(0,t.jsxs)("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))]",children:[n("chat.memoryBind.selectFromExistingPrefix")," ",(0,t.jsx)("span",{className:"font-medium text-[hsl(var(--foreground))]",children:r.length})," ",n("chat.memoryBind.selectFromExistingSuffix")]})]})]})}function ei(e){let{t:r}=(0,d.useI18n)();return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.3)] px-3 py-2",children:[(0,t.jsx)(W.Brain,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--primary))]"}),(0,t.jsxs)(Q.Select,{value:e.value,onValueChange:e.onChange,children:[(0,t.jsx)(Q.SelectTrigger,{className:"h-8 flex-1 border-0 bg-transparent px-1 text-sm font-medium shadow-none hover:bg-[hsl(var(--muted)/0.5)] focus:ring-0 focus:ring-offset-0",children:(0,t.jsx)(Q.SelectValue,{placeholder:r("chat.memoryBind.selectStorePlaceholder")})}),(0,t.jsx)(Q.SelectContent,{children:e.stores.map(e=>(0,t.jsx)(Q.SelectItem,{value:e.memoryStoreName,children:e.memoryStoreName},e.memoryStoreName))})]}),(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:e.onUnbind,title:r("chat.memoryBind.unbind"),children:(0,t.jsx)(l.Trash2,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})}function el(e){let{t:r}=(0,d.useI18n)();return(0,t.jsxs)("div",{className:"space-y-4 border-t border-[hsl(var(--border-light))] pt-3",children:[(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:r("chat.memoryBind.writeScope")}),(0,t.jsxs)("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:[r("chat.memoryBind.writeScopeDesc")," ",(0,t.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[10px]",children:"*"}),r("chat.memoryBind.writeScopeDescSuffix")]})]}),(0,t.jsx)(er.ScopeCombobox,{memoryStoreName:e.memoryStoreName,placeholder:r("chat.memoryBind.selectExistingScope"),className:"shrink-0",onPick:t=>e.onScopeChange({appId:t.appId??"",tenantId:t.tenantId??"",agentId:t.agentId??"",runId:t.runId??""})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(ed,{label:r("chat.memoryBind.appField"),value:e.appId,onChange:t=>e.onScopeChange({appId:t})}),(0,t.jsx)(ed,{label:r("chat.memoryBind.tenantField"),value:e.tenantId,onChange:t=>e.onScopeChange({tenantId:t})}),(0,t.jsx)("div",{className:"col-span-2",children:(0,t.jsx)(ed,{label:r("chat.memoryBind.agentField"),value:e.agentId,onChange:t=>e.onScopeChange({agentId:t})})})]})]}),(0,t.jsxs)("div",{className:"flex flex-row items-center justify-between gap-4 rounded-md border border-[hsl(var(--border))] p-3",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(y.Label,{className:"text-sm",children:r("chat.memoryBind.autoSave")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r(e.fileAutoSave?"chat.memoryBind.autoSaveFilememDesc":"chat.memoryBind.autoSaveDesc")})]}),(0,t.jsx)(G.Switch,{checked:e.autoSave,disabled:!e.autoSaveAllowed,onCheckedChange:e.onAutoSaveChange})]}),(0,t.jsx)(em,{runId:e.runId})]})}function ed(e){let a=(0,r.useId)(),s=!e.value;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(y.Label,{htmlFor:a,className:"text-xs",children:e.label}),(0,t.jsx)(g.Input,{id:a,value:e.value,onChange:t=>e.onChange(t.target.value),"aria-invalid":s,className:(0,m.cn)("h-9",s&&"border-[hsl(var(--destructive))]")})]})}function em({runId:e}){let{t:a}=(0,d.useI18n)(),[o,n]=(0,r.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e),n(!0),z.toast.success(a("chat.memoryBind.runIdCopied")),setTimeout(()=>n(!1),1500)}catch{z.toast.error(a("chat.memoryBind.runIdCopyFailed"))}}return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(y.Label,{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:a("chat.memoryBind.runIdLabel")}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",title:a("chat.memoryBind.runIdTitle"),children:a("chat.memoryBind.runIdAuto")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("code",{className:"flex-1 truncate rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.35)] px-2.5 py-1.5 font-mono text-[11px] text-muted-foreground",children:e||"—"}),(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":a("chat.memoryBind.copyRunId"),disabled:!e,onClick:i,children:o?(0,t.jsx)(p.Check,{className:"h-3.5 w-3.5 text-[hsl(var(--primary))]"}):(0,t.jsx)(U.Copy,{className:"h-3.5 w-3.5"})})]})]})}function ec({kbs:e,onAdd:r}){let{t:a}=(0,d.useI18n)(),o=0===e.length;return(0,t.jsxs)("div",{className:"animate-home-reveal relative overflow-hidden rounded-lg border border-dashed border-[hsl(var(--primary)/0.35)] bg-gradient-to-br from-[hsl(var(--primary-soft))] via-[hsl(var(--surface))] to-[hsl(var(--surface))] px-5 py-6 text-center",role:"region","aria-label":a("chat.mount.mountKbAria"),children:[(0,t.jsx)(q.Sparkles,{className:"pointer-events-none absolute right-3 top-3 h-3.5 w-3.5 text-[hsl(var(--primary)/0.45)]","aria-hidden":!0}),(0,t.jsx)("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-[hsl(var(--primary-soft))] ring-1 ring-[hsl(var(--primary)/0.18)]",children:(0,t.jsx)(D.Database,{className:"h-6 w-6 text-[hsl(var(--primary))]"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-[hsl(var(--foreground))]",children:a(o?"chat.mount.emptyNoKbTitle":"chat.mount.emptyMountTitle")}),(0,t.jsx)("p",{className:"mx-auto mt-1 max-w-[320px] text-xs leading-relaxed text-[hsl(var(--muted-foreground))]",children:a(o?"chat.mount.emptyNoKbDesc":"chat.mount.emptyMountDesc")}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2",children:[o?(0,t.jsx)(s.Button,{asChild:!0,size:"default",className:"h-9 px-4",children:(0,t.jsxs)(L.default,{href:"/knowledge-base/create",children:[(0,t.jsx)(D.Database,{className:"h-4 w-4"}),a("chat.mount.createKb")]})}):(0,t.jsx)(F,{kbs:e,onPick:r,align:"center",children:(0,t.jsxs)(s.Button,{type:"button",size:"default",className:"h-9 px-4",children:[(0,t.jsx)(A.Plus,{className:"h-4 w-4"}),a("chat.mount.mountKb")]})}),o?null:(0,t.jsxs)("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))]",children:[a("chat.mount.selectFromExistingPrefix")," ",(0,t.jsx)("span",{className:"font-medium text-[hsl(var(--foreground))]",children:e.length})," ",a("chat.mount.selectFromExistingSuffix")]})]})]})}var eu=e.i(480883),ep=e.i(988310),eh=e.i(843754),eg=e.i(983823),ey=e.i(533153),ef=e.i(321562),ev=e.i(585684),ex=e.i(74540);function eb(e,t,r){return{retrieval:e.retrieval??{...t},topK:e.topK??r}}function ew(e,t){return t&&"MODEL"===e.rerankType?{...e,modelProvider:"bailian",modelName:"qwen3-vl-rerank"}:e}let eN=["searchType","rerankType","rrfK","rrfDenseWeight","rrfFullTextWeight","weightDense","weightFullText","modelName","modelProvider"];function ej({mount:e,knowledgeBase:a,open:o,onOpenChange:n}){let{t:i}=(0,d.useI18n)(),l=M(),m=void 0===e.retrieval&&void 0===e.topK,c=!!a.multimodal,u=(0,r.useRef)(null),p=(0,r.useMemo)(()=>eb(e,l.retrieval,l.perKbTopK),[e,l.retrieval,l.perKbTopK]),h=(0,eu.useForm)({resolver:(0,ep.zodResolver)(ex.retrievalSchema),defaultValues:{knowledgeBaseName:a.knowledgeBaseName,queryType:"TEXT",query:"__mount_dialog_placeholder__",subspace:[],topK:p.topK,searchType:p.retrieval.searchType??["DENSE_VECTOR","FULL_TEXT"],rerankType:p.retrieval.rerankType,rrfK:p.retrieval.rrfK,rrfDenseWeight:p.retrieval.rrfDenseWeight,rrfFullTextWeight:p.retrieval.rrfFullTextWeight,weightDense:p.retrieval.weightDense,weightFullText:p.retrieval.weightFullText,modelName:p.retrieval.modelName,modelProvider:p.retrieval.modelProvider}});(0,r.useEffect)(()=>{h.reset({knowledgeBaseName:a.knowledgeBaseName,queryType:"TEXT",query:"__mount_dialog_placeholder__",subspace:[],topK:p.topK,searchType:p.retrieval.searchType??["DENSE_VECTOR","FULL_TEXT"],rerankType:p.retrieval.rerankType,rrfK:p.retrieval.rrfK,rrfDenseWeight:p.retrieval.rrfDenseWeight,rrfFullTextWeight:p.retrieval.rrfFullTextWeight,weightDense:p.retrieval.weightDense,weightFullText:p.retrieval.weightFullText,modelName:p.retrieval.modelName,modelProvider:p.retrieval.modelProvider})},[p,a.knowledgeBaseName]);let g=()=>{if(m)return;let t=h.getValues(),r={};for(let e of eN){let a=t[e];void 0===a||Array.isArray(a)&&0===a.length||(r[e]=a)}r=ew(r,c),l.updateMount(e.id,{retrieval:r,topK:"number"==typeof t.topK&&t.topK>=0?t.topK:20})},y=h.watch("rerankType");return(0,r.useEffect)(()=>{if(m||"MODEL"!==y)return;let e=!1;c?("bailian"!==h.getValues("modelProvider")&&(h.setValue("modelProvider","bailian"),e=!0),"qwen3-vl-rerank"!==h.getValues("modelName")&&(h.setValue("modelName","qwen3-vl-rerank"),e=!0)):(h.getValues("modelProvider")||(h.setValue("modelProvider","bailian"),e=!0),h.getValues("modelName")||(h.setValue("modelName","gte-rerank-v2"),e=!0)),e&&g()},[y,c,m]),(0,t.jsx)(X.Dialog,{open:o,onOpenChange:n,children:(0,t.jsxs)(X.DialogContent,{className:"sm:max-w-[560px] max-h-[85vh] overflow-y-auto data-[state=open]:animate-none data-[state=closed]:animate-none duration-0",children:[(0,t.jsxs)(X.DialogHeader,{children:[(0,t.jsx)(X.DialogTitle,{className:"pr-8",children:i("chat.retrievalDialog.title")}),(0,t.jsxs)(X.DialogDescription,{className:"break-all",children:[a.knowledgeBaseName,c?(0,t.jsx)("span",{className:"ml-2 inline-flex items-center rounded bg-[hsl(var(--secondary))] px-1.5 py-0.5 text-[10px] font-medium tracking-wide text-[hsl(var(--secondary-foreground))]",children:i("chat.retrievalDialog.multimodalBadge")}):null]})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-md px-3 py-2 text-xs "+(m?"border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.4)] text-muted-foreground":"border border-[hsl(var(--primary)/0.3)] bg-[hsl(var(--primary)/0.06)] text-[hsl(var(--foreground))]"),children:[(0,t.jsx)(eh.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("div",{className:"flex-1 leading-relaxed",children:m?(0,t.jsxs)("span",{children:[i("chat.retrievalDialog.inheritCurrentPrefix"),(0,t.jsx)("span",{className:"font-medium",children:i("chat.retrievalDialog.inheritLabel")}),i("chat.retrievalDialog.inheritSuffix")]}):(0,t.jsxs)("span",{children:[i("chat.retrievalDialog.inheritCurrentPrefix"),(0,t.jsx)("span",{className:"font-medium",children:i("chat.retrievalDialog.customLabel")}),i("chat.retrievalDialog.customSuffix")]})})]}),c&&!m&&"MODEL"===h.watch("rerankType")?(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.5)] px-3 py-2 text-xs text-muted-foreground",children:[(0,t.jsx)(eh.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("span",{children:[i("chat.retrievalDialog.multimodalLockPrefix")," ",(0,t.jsx)("span",{className:"font-medium text-[hsl(var(--foreground))]",children:"qwen3-vl-rerank"}),i("chat.retrievalDialog.multimodalLockSuffix")]})]}):null,(0,t.jsx)(ef.Form,{...h,children:(0,t.jsx)("form",{onSubmit:e=>e.preventDefault(),onBlur:g,className:"space-y-4 "+(m?"pointer-events-none select-none opacity-60":""),"aria-disabled":m,children:(0,t.jsx)("fieldset",{disabled:m,className:"space-y-4 contents",children:(0,t.jsx)(ev.RetrievalParamsFields,{form:h,filterRef:u,topKLabel:i("chat.retrievalDialog.topKLabel"),topKHint:i("chat.retrievalDialog.topKHint"),topKMode:"single"})})})}),(0,t.jsxs)(X.DialogFooter,{className:"sm:justify-between",children:[(0,t.jsxs)(s.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l.resetMountRetrieval(e.id)},disabled:m,className:"gap-1.5",children:[(0,t.jsx)(eg.RotateCcw,{className:"h-3.5 w-3.5"}),i("chat.retrievalDialog.resetToDefault")]}),m?(0,t.jsxs)(s.Button,{type:"button",size:"sm",onClick:()=>{let t=eb(e,l.retrieval,l.perKbTopK),r=ew(t.retrieval,c);l.updateMount(e.id,{retrieval:r,topK:t.topK})},className:"gap-1.5",children:[(0,t.jsx)(ey.Pencil,{className:"h-3.5 w-3.5"}),i("chat.retrievalDialog.useCustom")]}):(0,t.jsx)(s.Button,{type:"button",variant:"secondary",size:"sm",onClick:()=>n(!1),children:i("common.done")})]})]})})}function eS({mount:e,subspaceEnabled:o,knowledgeBase:n}){let{t:i}=(0,d.useI18n)(),m=M(),[c,u]=(0,r.useState)((e.subspace??[]).join(", ")),[p,h]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.3)] px-3 py-2",children:[(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-medium",title:e.knowledgeBaseName,children:e.knowledgeBaseName}),o?(0,t.jsx)(g.Input,{value:c,onChange:e=>u(e.target.value),onBlur:()=>{let t=c.split(",").map(e=>e.trim()).filter(Boolean),r=e.subspace??[];t.length===r.length&&t.every((e,t)=>e===r[t])||m.updateMount(e.id,{subspace:t.length?t:void 0})},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.target.blur())},placeholder:i("chat.mount.subspacePlaceholder"),className:"h-8 w-44 text-xs"}):null,(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h(!0),disabled:!n,title:i(n?"chat.mount.settingsTitle":"chat.mount.settingsLoading"),children:(0,t.jsx)(a.Settings2,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e.retrieval?(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-primary"}):null]}),(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>m.removeMount(e.id),title:i("chat.mount.remove"),children:(0,t.jsx)(l.Trash2,{className:"h-3.5 w-3.5 text-muted-foreground"})}),n?(0,t.jsx)(ej,{mount:e,knowledgeBase:n,open:p,onOpenChange:h}):null]})}var ek=e.i(820268),eT=e.i(64209);let eI=["searchType","rerankType","rrfK","rrfDenseWeight","rrfFullTextWeight","weightDense","weightFullText","modelName","modelProvider"];function eK({disabled:e,singleKb:a}){let{t:s}=(0,d.useI18n)(),o=M(),n=(0,r.useRef)(null),i=(0,eu.useForm)({resolver:(0,ep.zodResolver)(ex.retrievalSchema),defaultValues:{knowledgeBaseName:a?.knowledgeBaseName??"__unified__",queryType:"TEXT",query:"__unified_placeholder__",subspace:[],topK:o.perKbTopK,searchType:o.retrieval.searchType??["DENSE_VECTOR","FULL_TEXT"],rerankType:o.retrieval.rerankType,rrfK:o.retrieval.rrfK,rrfDenseWeight:o.retrieval.rrfDenseWeight,rrfFullTextWeight:o.retrieval.rrfFullTextWeight,weightDense:o.retrieval.weightDense,weightFullText:o.retrieval.weightFullText,modelName:o.retrieval.modelName,modelProvider:o.retrieval.modelProvider}});(0,r.useEffect)(()=>{i.reset({knowledgeBaseName:a?.knowledgeBaseName??"__unified__",queryType:"TEXT",query:"__unified_placeholder__",subspace:[],topK:o.perKbTopK,searchType:o.retrieval.searchType??["DENSE_VECTOR","FULL_TEXT"],rerankType:o.retrieval.rerankType,rrfK:o.retrieval.rrfK,rrfDenseWeight:o.retrieval.rrfDenseWeight,rrfFullTextWeight:o.retrieval.rrfFullTextWeight,weightDense:o.retrieval.weightDense,weightFullText:o.retrieval.weightFullText,modelName:o.retrieval.modelName,modelProvider:o.retrieval.modelProvider})},[o.retrieval,o.perKbTopK,a?.knowledgeBaseName]);let l=()=>{let e=i.getValues(),t={};for(let r of eI){let a=e[r];void 0===a||Array.isArray(a)&&0===a.length||(t[r]=a)}o.setRetrieval(t),o.setPerKbTopK("number"==typeof e.topK&&e.topK>=0?e.topK:20)},m=i.watch("rerankType");(0,r.useEffect)(()=>{if("MODEL"!==m)return;let e=!1;i.getValues("modelProvider")||(i.setValue("modelProvider","bailian"),e=!0),i.getValues("modelName")||(i.setValue("modelName","gte-rerank-v2"),e=!0),e&&l()},[m]);let[c,u]=(0,r.useState)(!1);return(0,t.jsxs)(eT.Collapsible,{open:!e&&c,onOpenChange:t=>{e||u(t)},className:"space-y-3 border-t border-[hsl(var(--border))] pt-4"+(e?" pointer-events-none opacity-50":""),"aria-disabled":e,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(y.Label,{className:"text-sm font-medium",children:s("chat.config.unifiedTitle")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:s("chat.config.unifiedDesc")})]}),!e&&(0,t.jsx)(eT.CollapsibleTrigger,{type:"button","aria-label":s(c?"chat.config.unifiedCollapse":"chat.config.unifiedExpand"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",children:(0,t.jsx)(ek.ChevronDown,{className:"h-4 w-4 transition-transform duration-150"+(c?" rotate-180":"")})})]}),e?(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-dashed border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.4)] px-3 py-3 text-xs text-muted-foreground",children:[(0,t.jsx)(eh.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{children:s("chat.config.unifiedDisabledHint")})]}):(0,t.jsx)(eT.CollapsibleContent,{children:(0,t.jsx)(ef.Form,{...i,children:(0,t.jsx)("form",{onSubmit:e=>e.preventDefault(),onBlur:l,className:"space-y-4",children:(0,t.jsx)(ev.RetrievalParamsFields,{form:i,knowledgeBase:a,filterRef:n,topKLabel:s("chat.config.topKLabel"),topKHint:s("chat.config.topKHintUnified"),topKMode:"single"})})})})]})}function eE({open:e,onOpenChange:a,onSave:o}){let{t:n}=(0,d.useI18n)(),i=M(),{data:l}=(0,f.useKnowledgeBases)(),m=l?.items??[],c=m.filter(e=>!i.mounts.some(t=>t.knowledgeBaseName===e.knowledgeBaseName)),[u,v]=(0,r.useState)(String(i.aggregateTopK));(0,r.useEffect)(()=>{v(String(i.aggregateTopK))},[i.aggregateTopK]);let[b,w]=(0,r.useState)(!1),N=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{N.current&&clearTimeout(N.current)},[]),(0,t.jsx)(h.Sheet,{open:e,onOpenChange:a,children:(0,t.jsxs)(h.SheetContent,{side:"right",className:"flex w-full flex-col gap-0 p-0 sm:max-w-[520px]",children:[(0,t.jsxs)(h.SheetHeader,{className:"border-b border-[hsl(var(--border))] px-6 py-4",children:[(0,t.jsx)(h.SheetTitle,{children:n("chat.config.title")}),(0,t.jsx)(h.SheetDescription,{children:n("chat.config.description")})]}),(0,t.jsxs)("div",{className:"flex-1 space-y-5 overflow-y-auto px-6 py-5",children:[(0,t.jsx)(C.LLMModelSelector,{providerId:i.providerId,model:i.model,onProviderChange:(e,t)=>{i.setProvider(e,t??"")},onModelChange:e=>i.setModel(e)}),(0,t.jsx)(B.SystemPromptInput,{value:i.systemPrompt,onChange:e=>i.setSystemPrompt(e),placeholder:n("chat.config.systemPromptPlaceholder"),label:"System Prompt"}),(0,t.jsx)(_.TemperatureSlider,{value:i.temperature??.7,onChange:e=>i.setTemperature(e),label:"Temperature"}),(0,t.jsxs)("div",{className:"space-y-3 border-t border-[hsl(var(--border))] pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"text-sm font-medium",children:n("chat.config.mountedKb")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:n("chat.config.mountedKbDesc",{topK:i.aggregateTopK})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(y.Label,{className:"text-xs text-muted-foreground",title:n("chat.config.aggregateTopKTitle"),children:n("chat.config.aggregateTopK")}),(0,t.jsx)(g.Input,{type:"text",inputMode:"numeric",value:u,onChange:e=>v(e.target.value),onBlur:()=>{let e=parseInt(u,10);Number.isFinite(e)&&e>=1&&e<=200?(i.setAggregateTopK(e),v(String(e))):(i.setAggregateTopK(20),v(String(20)))},className:"h-8 w-20"})]})]}),0===i.mounts.length?(0,t.jsx)(ec,{kbs:m,onAdd:e=>i.addMount({id:(0,x.newId)("mount"),knowledgeBaseName:e.knowledgeBaseName})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"space-y-2",children:i.mounts.map(e=>{let r=m.find(t=>t.knowledgeBaseName===e.knowledgeBaseName);return(0,t.jsx)(eS,{mount:e,subspaceEnabled:r?.subspace===!0,knowledgeBase:r},e.id)})}),(0,t.jsx)(O,{kbs:c,onAdd:e=>i.addMount({id:(0,x.newId)("mount"),knowledgeBaseName:e.knowledgeBaseName})})]})]}),(0,t.jsx)(eK,{disabled:0===i.mounts.length,singleKb:1===i.mounts.length?m.find(e=>e.knowledgeBaseName===i.mounts[0].knowledgeBaseName):void 0}),(0,t.jsx)(ea,{})]}),(0,t.jsxs)(h.SheetFooter,{className:"gap-2 border-t border-[hsl(var(--border))] bg-[hsl(var(--surface))] px-6 py-3 sm:items-center sm:justify-between sm:space-x-0",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n("chat.config.footerHint")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Button,{type:"button",variant:"ghost",onClick:()=>a(!1),children:n("common.close")}),(0,t.jsx)(s.Button,{type:"button",onClick:()=>{o(),w(!0),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>w(!1),2e3)},disabled:b,children:b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Check,{className:"mr-1.5 h-4 w-4"}),n("chat.config.saved")]}):n("chat.config.saveConfig")})]})]})]})})}var eM=e.i(465581),eC=e.i(749448);function eB(e){var a;let s,o,n,i,l=(a=new URLSearchParams((0,eM.useSearchParams)().toString()),s=a.get("memoryStoreName")?.trim()??"",o=a.get("storageMode"),n=(0,eC.parseExactScope)(a),i=a.get("wiki"),s&&("ots"===o||"file+ots"===o)&&n&&("auto"===i||"off"===i)?{memoryStoreName:s,storageMode:o,scope:n,wiki:i}:null),d=(0,r.useRef)({activeSessionId:e.activeSessionId,messageCount:e.messageCount});d.current={activeSessionId:e.activeSessionId,messageCount:e.messageCount};let m=JSON.stringify([e.projectIdentity,l?[l.memoryStoreName,l.storageMode,l.scope.appId,l.scope.tenantId,l.scope.agentId,l.scope.runId,l.wiki]:null]),c=(0,r.useRef)({identity:m,handled:!1});return(c.current.identity!==m&&(c.current={identity:m,handled:!1}),e.activeInstanceReady&&l)?(0,t.jsx)(e_,{entry:l,identity:m,latestChatRef:d,handledRef:c}):null}function e_({entry:e,identity:t,latestChatRef:a,handledRef:s}){let o=M(),n=(0,Z.useWiki)(e.memoryStoreName,e.scope);return(0,r.useEffect)(()=>{var r;if("pending"===n.status||s.current.identity!==t)return;let i=a.current,l=(r={entry:e,activeSessionId:i.activeSessionId,messageCount:i.messageCount,wikiReady:n.data?.status==="ready",handled:s.current.handled}).handled||r.activeSessionId||r.messageCount>0?{action:"ignore"}:{action:"hydrate",enableWiki:"auto"===r.entry.wiki&&r.wikiReady};s.current.handled=!0,"ignore"!==l.action&&(o.setMemory({memoryStoreName:e.memoryStoreName,storageMode:e.storageMode,scope:e.scope,autoSave:!0,topK:5,retrievalMode:(0,b.resolveRetrievalMode)(void 0,e.storageMode)}),o.setWikiEnabled(l.enableWiki))},[o,e,s,t,a,n.data?.status,n.status]),null}var eA=e.i(16346);let eD="tsagent.chat.sessions.v1";function eR(e){return e&&e.length>0?e:null}function eP(e){let t;return`tsagent.chat.sessions.v2.${(t=eR(e))?`project.${encodeURIComponent(t)}`:"unbound"}`}function eF(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function eO(e){return"number"==typeof e&&Number.isFinite(e)}function eL(e){if(!eF(e)||"string"!=typeof e.docId||!eO(e.chunkId)||"string"!=typeof e.ossKey||!eO(e.score)||"string"!=typeof e.content||"string"!=typeof e.chunkType)return null;let t={docId:e.docId,chunkId:e.chunkId,ossKey:e.ossKey,score:e.score,content:e.content,chunkType:e.chunkType};return"string"==typeof e.imageBase64&&(t.imageBase64=e.imageBase64),"string"==typeof e.subspace&&(t.subspace=e.subspace),"string"==typeof e.knowledgeBaseName&&(t.knowledgeBaseName=e.knowledgeBaseName),t}function eW(e){if(!eF(e)||"string"!=typeof e.knowledgeBaseName||!Array.isArray(e.chunks))return null;let t={knowledgeBaseName:e.knowledgeBaseName,chunks:e.chunks.map(eL).filter(e=>null!==e)};return"string"==typeof e.error&&(t.error=e.error),t}function eU(e){return eF(e)&&"string"==typeof e.messageId&&eO(e.timestampMs)?{messageId:e.messageId,timestampMs:e.timestampMs}:null}function eV(e){if(!eF(e))return null;let t=function(e){if(!eF(e)||"string"!=typeof e.text)return null;let t={text:e.text};"string"==typeof e.id&&(t.id=e.id),"string"==typeof e.memoryId&&(t.memoryId=e.memoryId),"string"==typeof e.conversation_key&&(t.conversation_key=e.conversation_key);let r=function(e){if(!eF(e)||"string"!=typeof e.appId)return;let t={appId:e.appId};return"string"==typeof e.tenantId&&(t.tenantId=e.tenantId),"string"==typeof e.agentId&&(t.agentId=e.agentId),"string"==typeof e.runId&&(t.runId=e.runId),t}(e.scope);return r&&(t.scope=r),"string"==typeof e.memcell_id&&(t.memcell_id=e.memcell_id),"string"==typeof e.unit_type&&(t.unit_type=e.unit_type),Array.isArray(e.source_turn_ids)&&(t.source_turn_ids=e.source_turn_ids.filter(e=>"string"==typeof e)),Array.isArray(e.source_turn_refs)&&(t.source_turn_refs=e.source_turn_refs.map(eU).filter(e=>null!==e)),"string"==typeof e.search_text&&(t.search_text=e.search_text),eO(e.salience)&&(t.salience=e.salience),eO(e.version)&&(t.version=e.version),"boolean"==typeof e.deleted&&(t.deleted=e.deleted),"string"==typeof e.created_at&&(t.created_at=e.created_at),"string"==typeof e.updated_at&&(t.updated_at=e.updated_at),eO(e.score)&&(t.score=e.score),("string"==typeof e.createdAt||eO(e.createdAt))&&(t.createdAt=e.createdAt),("string"==typeof e.updatedAt||eO(e.updatedAt))&&(t.updatedAt=e.updatedAt),t}(e.unit);if(!t)return null;let r={unit:t};return eO(e.score)&&(r.score=e.score),eO(e.similarity)&&(r.similarity=e.similarity),"string"==typeof e.source&&(r.source=e.source),r}function eq(e){if(!e||"object"!=typeof e)return null;let t=(0,eA.normalizeRequiredWikiMetadata)(e.wikiName),r=(0,eA.normalizeRequiredWikiMetadata)(e.path);return"string"==typeof e.reference&&/^W[1-6]$/.test(e.reference)&&t&&r&&"boolean"==typeof e.truncated&&Number.isInteger(e.injectedChars)&&!(e.injectedChars<0)&&!(e.injectedChars>8e3)?(0,eA.clampWikiEvidence)({reference:e.reference,wikiName:t,path:r,..."string"==typeof e.title?{title:e.title}:{},..."string"==typeof e.type?{type:e.type}:{},..."string"==typeof e.description?{description:e.description}:{},..."number"==typeof e.score?{score:e.score}:{},...Array.isArray(e.sources)?{sources:e.sources.slice(0,eA.MAX_WIKI_SOURCES).filter(e=>"string"==typeof e)}:{},truncated:e.truncated,injectedChars:e.injectedChars}):null}function ez(e){if(!e||"object"!=typeof e)return null;let t=(0,eA.normalizeRequiredWikiMetadata)(e.code),r=(0,eA.normalizeRequiredWikiMetadata)(e.message);return t&&r&&("validate"===e.stage||"search"===e.stage||"read"===e.stage||"budget"===e.stage)?(0,eA.clampWikiRetrievalError)({code:t,message:r,..."string"==typeof e.requestId?{requestId:e.requestId}:{},..."number"==typeof e.httpStatus?{httpStatus:e.httpStatus}:{},stage:e.stage,..."string"==typeof e.path?{path:e.path}:{}}):null}function eH(e){if(!e||"object"!=typeof e)return null;let t=(0,eA.normalizeRequiredWikiMetadata)(e.wikiName);return t&&Array.isArray(e.pages)?(0,eA.clampWikiRetrievalGroup)({wikiName:t,pages:e.pages.slice(0,eA.MAX_WIKI_EVIDENCE).map(eq).filter(e=>null!==e),...Array.isArray(e.errors)?{errors:e.errors.slice(0,eA.MAX_WIKI_ERRORS).map(ez).filter(e=>null!==e)}:{}}):null}function eG(e){return e&&"object"==typeof e?"string"!=typeof e.appId||"string"!=typeof e.tenantId||"string"!=typeof e.agentId||"string"!=typeof e.runId?null:{appId:e.appId,tenantId:e.tenantId,agentId:e.agentId,runId:e.runId}:null}function eQ(e){return e.flatMap(e=>{if(!eF(e))return[];let{id:t,role:r,content:a,createdAt:s}=e;if("string"!=typeof t||"user"!==r&&"assistant"!==r&&"system"!==r||"string"!=typeof a||!eO(s))return[];let o={id:t,role:r,content:a,createdAt:s};"string"==typeof e.reasoning&&(o.reasoning=e.reasoning),eO(e.reasoningStartedAt)&&(o.reasoningStartedAt=e.reasoningStartedAt),eO(e.reasoningCompletedAt)&&(o.reasoningCompletedAt=e.reasoningCompletedAt),"boolean"==typeof e.usingRag&&(o.usingRag=e.usingRag),"boolean"==typeof e.queryRewriteFailed&&(o.queryRewriteFailed=e.queryRewriteFailed),"string"==typeof e.queryRewriteError&&(o.queryRewriteError=e.queryRewriteError),"string"==typeof e.retrievalQuery&&(o.retrievalQuery=e.retrievalQuery),"boolean"==typeof e.retrievalQueryRewritten&&(o.retrievalQueryRewritten=e.retrievalQueryRewritten),Array.isArray(e.retrievedChunks)&&(o.retrievedChunks=e.retrievedChunks.map(eL).filter(e=>null!==e)),Array.isArray(e.retrievalGroups)&&(o.retrievalGroups=e.retrievalGroups.map(eW).filter(e=>null!==e)),Array.isArray(e.memoryHits)&&(o.memoryHits=e.memoryHits.map(eV).filter(e=>null!==e)),"string"==typeof e.memoryQuery&&(o.memoryQuery=e.memoryQuery),"string"==typeof e.wikiQuery&&(o.wikiQuery=e.wikiQuery),Number.isInteger(e.wikiCount)&&e.wikiCount>=0&&(o.wikiCount=e.wikiCount),"boolean"==typeof e.wikiRetrievalDone&&(o.wikiRetrievalDone=e.wikiRetrievalDone),Array.isArray(e.wikiEvidence)&&(o.wikiEvidence=e.wikiEvidence.slice(0,eA.MAX_WIKI_EVIDENCE).map(eq).filter(e=>null!==e)),Array.isArray(e.wikiRetrievalGroups)&&(o.wikiRetrievalGroups=e.wikiRetrievalGroups.slice(0,eA.MAX_WIKI_GROUPS).map(eH).filter(e=>null!==e)),Number.isInteger(e.wikiTotalContextChars)&&e.wikiTotalContextChars>=0&&(o.wikiTotalContextChars=e.wikiTotalContextChars),"string"==typeof e.wikiMemoryStoreName&&(o.wikiMemoryStoreName=e.wikiMemoryStoreName);let n=eG(e.wikiScope);n&&(o.wikiScope=n);let i=function(e){if(Array.isArray(e))return e.flatMap(e=>eF(e)&&"string"==typeof e.rel&&eO(e.size)?[{rel:e.rel,size:e.size,..."string"==typeof e.sha256?{sha256:e.sha256}:{}}]:[])}(e.memoryFiles);i&&(o.memoryFiles=i);let l=function(e){if(!eF(e)||"boolean"!=typeof e.ok||!eO(e.listed)||!eO(e.loaded)||!eO(e.reused)||!eO(e.totalBytes)||"boolean"!=typeof e.truncated)return;let t={ok:e.ok,listed:e.listed,loaded:e.loaded,reused:e.reused,totalBytes:e.totalBytes,truncated:e.truncated};return"string"==typeof e.error&&(t.error=e.error),t}(e.memoryFilesCache);l&&(o.memoryFilesCache=l),"string"==typeof e.memoryFilesStoreName&&(o.memoryFilesStoreName=e.memoryFilesStoreName),"boolean"==typeof e.memoryFilesWritable&&(o.memoryFilesWritable=e.memoryFilesWritable);let d=eG(e.memoryFilesScope);return d&&(o.memoryFilesScope=d),("saving"===e.memorySaveStatus||"saved"===e.memorySaveStatus||"unchanged"===e.memorySaveStatus||"error"===e.memorySaveStatus)&&(o.memorySaveStatus=e.memorySaveStatus),"string"==typeof e.memorySavePath&&(o.memorySavePath=e.memorySavePath),eO(e.memorySaveCount)&&(o.memorySaveCount=e.memorySaveCount),"string"==typeof e.memorySaveError&&(o.memorySaveError=e.memorySaveError),"string"==typeof e.turnId&&(o.turnId=e.turnId),("streaming"===e.status||"done"===e.status||"error"===e.status)&&(o.status=e.status),"string"==typeof e.errorMessage&&(o.errorMessage=e.errorMessage),"saving"===o.memorySaveStatus&&(delete o.memorySaveStatus,delete o.memorySavePath,delete o.memorySaveCount,delete o.memorySaveError),[o]})}let eX=BigInt("14695981039346656037"),eY=BigInt("1099511628211");function e$(e){if(!e||"object"!=typeof e||Array.isArray(e))return;let t={};return Array.isArray(e.searchType)&&(t.searchType=e.searchType.filter(e=>"DENSE_VECTOR"===e||"FULL_TEXT"===e)),("RRF"===e.rerankType||"WEIGHT"===e.rerankType||"MODEL"===e.rerankType)&&(t.rerankType=e.rerankType),eO(e.rrfK)&&(t.rrfK=e.rrfK),eO(e.rrfDenseWeight)&&(t.rrfDenseWeight=e.rrfDenseWeight),eO(e.rrfFullTextWeight)&&(t.rrfFullTextWeight=e.rrfFullTextWeight),eO(e.weightDense)&&(t.weightDense=e.weightDense),eO(e.weightFullText)&&(t.weightFullText=e.weightFullText),"string"==typeof e.modelName&&(t.modelName=e.modelName),"string"==typeof e.modelProvider&&(t.modelProvider=e.modelProvider),t}function eJ(e,t,r){var a;let s=e&&"object"==typeof e&&!Array.isArray(e)?e:{},o=function(e,t,r=!0){if(!e||"object"!=typeof e||"string"!=typeof e.memoryStoreName||!e.memoryStoreName)return;let a=e.scope;if(!a||"string"!=typeof a.appId||"string"!=typeof a.tenantId||"string"!=typeof a.agentId||"string"!=typeof a.runId||!a.appId||!a.tenantId||!a.agentId)return;let s=r?(0,b.normalizeMemoryRunId)(e.storageMode,a.runId,()=>(function(e){let t=eX;for(let r of new TextEncoder().encode(e))t^=BigInt(r),t=BigInt.asUintN(64,t*eY);return`run_legacy_${t.toString(16).padStart(16,"0")}`})(JSON.stringify([t,e.memoryStoreName,a.appId,a.tenantId,a.agentId]))):a.runId;return{id:"string"==typeof e.id&&e.id?e.id:(0,x.newId)("memory"),memoryStoreName:e.memoryStoreName,...(0,b.isKnownStorageMode)(e.storageMode)?{storageMode:e.storageMode}:{},scope:{appId:a.appId,tenantId:a.tenantId,agentId:a.agentId,runId:s},...Number.isInteger(e.topK)&&e.topK>0?{topK:e.topK}:{},autoSave:!1!==e.autoSave,..."local"===e.retrievalMode||"search"===e.retrievalMode?{retrievalMode:e.retrievalMode}:{}}}(s.memory,t,r),n={mounts:Array.isArray(a=s.mounts)?a.flatMap(e=>{if(!e||"object"!=typeof e||"string"!=typeof e.id||"string"!=typeof e.knowledgeBaseName)return[];let t={id:e.id,knowledgeBaseName:e.knowledgeBaseName};Array.isArray(e.subspace)&&e.subspace.length>0&&e.subspace.every(e=>"string"==typeof e)&&(t.subspace=e.subspace);let r=e$(e.retrieval);return r&&(t.retrieval=r),eO(e.topK)&&(t.topK=e.topK),[t]}):[]};"string"==typeof s.providerId&&(n.providerId=s.providerId),"string"==typeof s.model&&(n.model=s.model),"string"==typeof s.systemPrompt&&(n.systemPrompt=s.systemPrompt),eO(s.temperature)&&(n.temperature=s.temperature),eO(s.aggregateTopK)&&(n.aggregateTopK=s.aggregateTopK),eO(s.perKbTopK)&&(n.perKbTopK=s.perKbTopK);let i=e$(s.retrieval);i&&(n.retrieval=i),o&&(n.memory=o);let l=function(e,t){if(t&&eF(e)&&!0===e.enabled&&Number.isInteger(e.topK)&&!(e.topK<1)&&!(e.topK>10))return{enabled:!0,topK:e.topK}}(s.wiki,o?.storageMode!==void 0);return l&&(n.wiki=l),n}function eZ(e){let t=eP(e);try{let r=window.localStorage.getItem(t),a=null===r,s=a?window.localStorage.getItem(eD):r,o=s?JSON.parse(s):[],n=Array.isArray(o)?o:[],i=a?n.filter(t=>!!t&&"object"==typeof t&&eR(t.activeInstance)===e):n,l=(!Array.isArray(i)?[]:i.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.title&&eO(e.updatedAt)&&Array.isArray(e.messages)).map(e=>({id:e.id,title:e.title,updatedAt:e.updatedAt,activeInstance:eR(e.activeInstance),config:eJ(e.config,e.id,!0),messages:eQ(e.messages)}))).filter(t=>eR(t.activeInstance)===eR(e)).sort((e,t)=>t.updatedAt-e.updatedAt);return{token:a?`legacy\0${JSON.stringify(i)}`:`v2\0${s??""}`,sessions:l}}catch{return{token:"storage-error",sessions:[]}}}function e0(e){return eZ(e).sessions}function e1(e,t){!function(e,t){let r=t;for(let t=0;t<3;t+=1)try{let t=JSON.stringify(r);window.localStorage.setItem(e,t);try{window.dispatchEvent(new StorageEvent("storage",{key:e}))}catch{window.dispatchEvent(new Event("storage"))}return}catch(t){if(!function(e){if(!e||"object"!=typeof e)return!1;let t=e.name;return"QuotaExceededError"===t||"NS_ERROR_DOM_QUOTA_REACHED"===t}(t)||r.length<=1)return;let e=Math.max(1,Math.floor(.75*r.length));r=r.slice(0,e)}}(eP(e),t)}let e2=new Map,e5=[];function e3(){return e5}var e4=e.i(440596);function e6(e){let t=e&&e.length>0?e:"__none__";return`tsagent.chat.lastConfig.${t}`}function e8(e){try{let t=window.localStorage.getItem(e6(e));if(!t)return{};let r=JSON.parse(t);if(!r||"object"!=typeof r)return{};let{providerId:a,model:s}=r;return{providerId:"string"==typeof a?a:void 0,model:"string"==typeof s?s:void 0}}catch{return{}}}var e7=e.i(164204),e9=e.i(115210),te=e.i(567730),tt=e.i(786196),tr=e.i(247570);async function ta(e,t){let r=Date.now()+18e4;for(;;){let a=await (0,e7.getDreamTask)(e,t);if(e9.DREAM_TERMINAL_STATUSES.has(a.status)||Date.now()>r)return a;await new Promise(e=>setTimeout(e,2500))}}function ts(){var e;let i,l,m,u,p,h,g,y,f,{t:w}=(0,d.useI18n)(),N=M(),j=(0,te.useActiveInstance)(),k=j.activeInstance,T=(i=eR(j.activeInstance),l=j.ready?eP(i):null,m=(0,r.useCallback)(e=>(function(e,t){if(!e)return()=>{};let r=r=>{r.key&&r.key!==e&&r.key!==eD||t()};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}})(l,e),[l]),u=(0,r.useCallback)(()=>j.ready?function(e){let t=eR(e),r=eP(t),{token:a,sessions:s}=eZ(t),o=e2.get(r);return o?.token===a?o.snapshot:(e2.set(r,{token:a,snapshot:s}),s)}(i):e5,[i,j.ready]),p=(0,r.useSyncExternalStore)(m,u,e3),h=(0,r.useCallback)(e=>{j.ready&&function(e,t){if("string"!=typeof e.id||"string"!=typeof e.title||!eO(e.updatedAt)||!Array.isArray(e.messages))return;let r=eR(t),a=e0(r),s={id:e.id,title:e.title,updatedAt:e.updatedAt,activeInstance:r,config:eJ(e.config,e.id,!1),messages:eQ(e.messages)};s.messages.length>200&&(s.messages=s.messages.slice(-200));let o=a.findIndex(e=>e.id===s.id);o>=0?a[o]=s:a.push(s),e1(r,a.sort((e,t)=>t.updatedAt-e.updatedAt).slice(0,50))}(e,i)},[i,j.ready]),g=(0,r.useCallback)(e=>{if(j.ready){let t,r;r=e0(t=eR(i)).filter(t=>t.id!==e),e1(t,r)}},[i,j.ready]),y=(0,r.useCallback)(()=>{j.ready&&e1(eR(i),[])},[i,j.ready]),f=(0,r.useCallback)(e=>{var t;return j.ready?(t=e,e0(eR(i)).find(e=>e.id===t)??null):null},[i,j.ready]),(0,r.useMemo)(()=>({sessions:p,upsert:h,remove:g,clear:y,get:f}),[p,h,g,y,f])),[I,K]=(0,r.useState)(null),[E,C]=(0,r.useState)(!1),B=(0,r.useRef)(!1),_=(0,r.useCallback)((e,t)=>{if(!j.ready||t.requireSent&&!B.current)return;let r=I??(0,x.newId)("session");I||K(r);let a=t.preserveTitle?T.get(r):null,s={id:r,title:a?.title??function(e,t="新对话"){let r=e.find(e=>"user"===e.role);if(!r)return t;let a=r.content.replace(/\s+/g," ").trim();return a?a.length>24?`${a.slice(0,24)}…`:a:t}(e,w("chat.history.newChat")),updatedAt:Date.now(),activeInstance:k,config:N.toSessionConfig(),messages:e};T.upsert(s),N.providerId&&function(e,t){if(t.providerId)try{window.localStorage.setItem(e6(e),JSON.stringify({providerId:t.providerId,model:t.model??""}))}catch{}}(k,{providerId:N.providerId,model:N.model})},[I,N,T,k,j.ready,w]),A=(0,r.useCallback)(e=>{_(e,{requireSent:!0,preserveTitle:!1})},[_]),D=(0,r.useMemo)(()=>(function(e){if(e.mounts.length)return{knowledgeBases:e.mounts.map(t=>{let r=t.retrieval??e.retrieval,a=t.topK??e.perKbTopK,s=(0,v.assembleRetrievalConfiguration)(r,a);return{knowledgeBaseName:t.knowledgeBaseName,...t.subspace?.length?{subspace:t.subspace}:{},...s?{retrievalConfiguration:s}:{},topK:a}}),topK:e.aggregateTopK}})(N),[N]),R=(0,r.useMemo)(()=>(function(e){let t=e.memory;if(!t)return;let{appId:r,tenantId:a,agentId:s}=t.scope,o="filemem"===t.storageMode?b.FILEMEM_DEFAULT_RUN_ID:t.scope.runId;if(r&&a&&s&&o)return{memoryStoreName:t.memoryStoreName,scope:{appId:r,tenantId:a,agentId:s,runId:o},...t.storageMode?{storageMode:t.storageMode}:{},..."number"==typeof t.topK?{topK:t.topK}:{},autoSave:t.autoSave,...t.retrievalMode?{retrievalMode:t.retrievalMode}:{}}})(N),[N]),P=(0,r.useMemo)(()=>(function(e){if(!e.wikiEnabled||!S(e.memory))return;let t=e.memory;return{memoryStoreName:t.memoryStoreName,scope:t.scope,topK:e.wikiTopK}})(N),[N]),F=(0,e4.useQaChat)({dataScopeKey:j.dataScopeKey,activeInstance:k,providerId:N.providerId,model:N.model,systemPrompt:N.systemPrompt,temperature:N.temperature,rag:D,memory:R,wiki:P,onPersist:A}),O=(0,r.useCallback)(e=>{if(!j.ready)return;let t=T.get(e);t&&(t.activeInstance??null)===k&&(K(e),B.current=t.messages.length>0,F.setMessages(t.messages),N.hydrate({providerId:t.config.providerId??"",model:t.config.model??"",systemPrompt:t.config.systemPrompt??"",temperature:t.config.temperature,aggregateTopK:t.config.aggregateTopK??20,perKbTopK:t.config.perKbTopK??20,retrieval:t.config.retrieval??{},memory:t.config.memory,mounts:t.config.mounts??[],wikiEnabled:t.config.wiki?.enabled===!0,wikiTopK:t.config.wiki?.topK??3}))},[T,F.setMessages,N.hydrate,k,j.ready]),L=(0,r.useCallback)(()=>{K(null),B.current=!1,F.clear();let e=e8(k);N.setProvider(e.providerId??"",e.model??"")},[F.clear,k,N.setProvider]),W=(0,r.useCallback)(e=>{T.remove(e),I===e&&(K(null),B.current=!1,F.clear())},[T,I,F]),U=(0,r.useCallback)(()=>{T.clear(),K(null),B.current=!1,F.clear()},[T,F.clear]),V=(0,r.useCallback)(e=>{B.current=!0,F.send(e)},[F]),q=(0,r.useCallback)((e,t)=>{B.current=!0,F.editUserMessage(e,t),F.reissueTurn(e)},[F]),H=(0,r.useCallback)(e=>{let t=(0,tt.findUserAnchorAbove)(F.messages,e);t&&(B.current=!0,F.reissueTurn(t.id))},[F]),G=(0,r.useMemo)(()=>N.mounts?.[0]?.knowledgeBaseName??null,[N.mounts]),Q=(e={hasMemory:!!R,mountedKbCount:(N.mounts??[]).length}).hasMemory&&e.mountedKbCount>=1,[X,Y]=(0,r.useState)(null),$=(0,r.useCallback)(async e=>{if(X)return;if(!R)return void z.toast.error(w("chat.page.bindMemoryFirst"));if(!G)return void z.toast.error(w("chat.page.mountKbFirst"));let t="skill"===e?w("chat.page.typeSkill"):w("chat.page.typeProfile");Y(e);let r={id:z.toast.loading(w("chat.page.depositLoading",{type:t})),duration:5e3};try{let a=await (0,e7.createDreamTask)(R.memoryStoreName,{scopes:[R.scope],taskType:e}),s=await ta(R.memoryStoreName,a.dreamId);if(!e9.DREAM_TERMINAL_STATUSES.has(s.status))return void z.toast.message(w("chat.page.depositSlow",{type:t}),r);if("failed"===s.status||"cancelled"===s.status)return void z.toast.error("failed"===s.status?w("chat.page.depositTaskFailed",{type:t}):w("chat.page.depositTaskCancelled",{type:t}),r);let o=await (0,e7.depositDreamToKb)(R.memoryStoreName,{dreamId:a.dreamId,knowledgeBaseName:G,kinds:[e]}),n=o.deposited.find(t=>t.kind===e);if(o.failures.length>0){let e=o.failures[0]?.error??"";z.toast.error(w("chat.page.depositFailedReason",{type:t,reason:e}),r)}else n?z.toast.success(w("chat.page.depositSuccess",{count:n.count,type:t,kbName:G}),r):z.toast.info(w("chat.page.depositNone",{type:t}),r)}catch(e){z.toast.error(e instanceof Error?e.message:w("chat.page.depositFailed",{type:t}),r)}finally{Y(null)}},[X,R,G,w]),J=(0,r.useCallback)(()=>void $("skill"),[$]),Z=(0,r.useCallback)(()=>void $("profile"),[$]),ee=(0,r.useCallback)(()=>{B.current=F.messages.length>0||B.current,_(F.messages,{requireSent:!1,preserveTitle:!0})},[F.messages,_]),et=(0,r.useRef)({activeInstance:null,ready:!1,dataScopeKey:tr.PENDING_DATA_SCOPE_KEY,configRevision:""});(0,r.useEffect)(()=>{let e=et.current;e.ready&&j.ready&&e.dataScopeKey!==j.dataScopeKey&&(N.reset(),K(null),B.current=!1,F.clear()),j.ready&&(et.current=j)},[j.dataScopeKey,j.ready]),(0,r.useEffect)(()=>{if(I||N.providerId)return;let e=e8(k);e.providerId&&N.setProvider(e.providerId,e.model??"")},[k,I,N.providerId]);let er=I?T.get(I):null,ea=j.ready&&!!(N.providerId&&N.model),es=er?.title??w("chat.page.newChatTitle"),eo=N.mounts.length,en=!I&&N.mounts.length>0?w("chat.page.mountsCarryover",{count:N.mounts.length}):null;return(0,t.jsxs)(o.AppShellLayout,{children:[(0,t.jsx)(eB,{activeSessionId:I,messageCount:F.messages.length,activeInstanceReady:j.ready,projectIdentity:j.dataScopeKey}),(0,t.jsx)(c,{sessions:T.sessions,activeSessionId:I,onNewSession:L,onSelectSession:O,onDeleteSession:W,onClearAll:U}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col bg-[hsl(var(--card))]",children:[(0,t.jsxs)("header",{className:"flex h-14 shrink-0 items-center justify-between gap-3 border-b border-[hsl(var(--border))] px-5",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"truncate text-sm font-semibold text-[hsl(var(--foreground))]",children:es}),(0,t.jsx)("p",{className:"mt-0.5 truncate text-xs text-[hsl(var(--muted-foreground))]",children:N.providerId&&N.model?(0,t.jsxs)(t.Fragment,{children:[w("chat.page.headerStats",{model:N.model,count:eo,topK:N.aggregateTopK}),N.memory?w("chat.page.headerMemory",{name:N.memory.memoryStoreName}):"",N.wikiEnabled?` \xb7 ${w("chat.wikiBind.enabled")}`:""]}):w("chat.page.headerNoConfig")})]}),(0,t.jsx)(s.Button,{type:"button",variant:"ghost",size:"icon",onClick:()=>C(!0),title:w("chat.page.configTitle"),children:(0,t.jsx)(a.Settings2,{className:"h-4 w-4"})})]}),(0,t.jsx)(n.QaChatPanel,{messages:F.messages,isStreaming:F.isStreaming,canSend:ea,error:F.error,onSend:V,onStop:F.stop,onDelete:F.deleteMessage,onResend:F.reissueTurn,onRegenerate:H,onEditSave:q,dreamDeposit:{eligible:Q,running:X,onSummarizeSkill:J,onExtractProfile:Z},emptyState:{title:ea?w("chat.page.emptyTitleReady"):w("chat.page.emptyTitleStart"),description:en?w("chat.page.emptyDescCarryover",{carryover:en}):ea?w("chat.page.emptyDescReady"):w("chat.page.emptyDescStart"),actionLabel:w("chat.page.emptyAction"),onAction:()=>C(!0)},disabledPlaceholder:w("chat.page.disabledPlaceholder")})]}),(0,t.jsx)(eE,{open:E,onOpenChange:C,onSave:ee})]})}e.s(["default",0,function(){return(0,t.jsx)(E,{children:(0,t.jsx)(ts,{})})}],802447)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,309823,e=>{"use strict";let t=(0,e.i(801685).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,t],309823)},730068,e=>{"use strict";let t=(0,e.i(801685).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],730068)},323516,e=>{"use strict";var t=e.i(44501),r=e.i(861403),s=e.i(465581),a=e.i(979980),i=e.i(515793),l=e.i(856717),o=e.i(876490);let n=new Set(Object.keys(l.messages.header.segments));e.s(["PageHeader",0,function({title:e,description:l,hideBreadcrumb:c,children:m,className:d}){let u=(0,s.usePathname)()??"/",{t:h}=(0,i.useI18n)(),f=c?[]:function(e,t){if(/^\/knowledge-base\/[^/]+(?:\/.*)?$/.test(e)||/^\/memory\/[^/]+(?:\/.*)?$/.test(e))return[];let r=e.split("/").filter(Boolean);if(0===r.length)return[];let s=[],a="";return r.forEach((e,i)=>{a+=`/${e}`;let l=decodeURIComponent(e),o=n.has(l)?t(`header.segments.${l}`):l;s.push({label:o,href:i<r.length-1?a:void 0})}),s}(u,h);return(0,t.jsxs)("div",{className:(0,o.cn)("mb-5 flex flex-col gap-2",d),children:[f.length>1&&(0,t.jsxs)("nav",{"aria-label":h("header.breadcrumb"),className:"flex items-center gap-1 text-[13px] text-[hsl(var(--muted-foreground))]",children:[(0,t.jsx)(r.default,{href:"/",className:"transition-colors hover:text-[hsl(var(--foreground))]",children:h("common.home")}),f.map((e,s)=>(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(a.ChevronRight,{className:"h-3 w-3 opacity-60"}),e.href?(0,t.jsx)(r.default,{href:e.href,className:"transition-colors hover:text-[hsl(var(--foreground))]",children:e.label}):(0,t.jsx)("span",{className:"font-medium text-[hsl(var(--foreground))]",children:e.label})]},`${e.label}-${s}`))]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold leading-tight text-[hsl(var(--foreground))]",children:e}),l&&(0,t.jsx)("p",{className:"text-[13px] text-[hsl(var(--muted-foreground))]",children:l})]}),m&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:m})]})]})}])},12251,e=>{"use strict";var t=e.i(44501),r=e.i(101685),s=e.i(433253),a=e.i(942595),i=e.i(723888),l=e.i(515793);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:o,title:n,description:c,confirmText:m,cancelText:d,variant:u="default",onConfirm:h,confirmInput:f,children:p}){let{t:x}=(0,l.useI18n)(),[y,g]=(0,r.useState)(""),v=void 0!==f&&""!==f,j=v&&y!==f,b=(0,r.useCallback)(()=>{j||(h(),g(""))},[j,h]),N=(0,r.useCallback)(e=>{e||g(""),o(e)},[o]);return(0,t.jsx)(s.Dialog,{open:e,onOpenChange:N,children:(0,t.jsxs)(s.DialogContent,{className:"sm:max-w-120",children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:n}),(0,t.jsx)(s.DialogDescription,{className:"break-all",children:c})]}),v&&(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("p",{className:"mb-2 text-sm text-muted-foreground",children:x("common.confirmInputPrompt",{value:f??""})}),(0,t.jsx)(i.Input,{value:y,onChange:e=>g(e.target.value),placeholder:f,autoFocus:!0})]}),p&&(0,t.jsx)("div",{className:"py-1",children:p}),(0,t.jsxs)(s.DialogFooter,{children:[(0,t.jsx)(a.Button,{variant:"outline",onClick:()=>N(!1),children:d??x("common.cancel")}),(0,t.jsx)(a.Button,{variant:"danger"===u?"destructive":"default",onClick:b,disabled:j,children:m??x("common.confirm")})]})]})})}])},828772,906962,e=>{"use strict";function t(e="id"){return"u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${e}_${Date.now()}_${Math.random().toString(36).slice(2)}`}e.s(["newId",0,t],906962);let r="__default__";function s(){return t("run")}let a=["ots","managed-file","file+ots","filemem"],i=["scope","units","search","messages","tasks","requests","dream","wiki","settings"],l=["scope","units","wiki","settings"],o=["scope","units","search","messages","tasks","requests","wiki","settings"],n=["longTerm","shortTerm","extract","consolidate"],c=["files"],m=["units","search","settings"],d=["units","settings"];function u(e){return h(e)??"ots"}function h(e){return"ots"===e?"ots":"managed-file"===e?"managed-file":"file+ots"===e||"oss+ots"===e?"file+ots":"filemem"===e?"filemem":null}function f(e){return"file"===e?{inputType:e,storageStructures:["file"]}:{inputType:e,storageStructures:["structured"]}}function p(e){return!function(e){let t=new Set(e.storageStructures),r=t.size!==e.storageStructures.length;if(!r&&"file"===e.inputType&&1===t.size&&t.has("file"))return;if(!(!r&&"short-term"===e.inputType&&t.size>0&&(1===t.size&&t.has("structured")||1===t.size&&t.has("file")||2===t.size&&t.has("file"))))throw Error("Invalid memory input and storage structure combination")}(e),{inputType:"short-term"===e.inputType?"messages":"file",outputTypes:[...e.storageStructures]}}function x(e){let t=u(e);return"filemem"===t?f("file"):"managed-file"===t?{inputType:"short-term",storageStructures:["file"]}:"file+ots"===t?{inputType:"short-term",storageStructures:["structured","file"]}:f("short-term")}function y(e){let t=u(e),r="ots"===t||"file+ots"===t,s="filemem"!==t,a=l;return"managed-file"===t?a=o:r&&(a=i),{mode:t,files:"managed-file"===t||"file+ots"===t||"filemem"===t,structured:r,writableFiles:"filemem"===t,forceLocalRetrieval:"filemem"===t,structuredAutoSave:r,supportsExtraction:r,acceptsMessages:s,discoverableScopes:s,detailSegments:[...a],cardShortcuts:[...r?n:c],cardActions:[..."filemem"===t?d:m]}}e.s(["FILEMEM_DEFAULT_RUN_ID",0,r,"isKnownStorageMode",0,function(e){return"string"==typeof e&&a.includes(e)},"memoryStorageSelectionForInput",0,f,"normalizeMemoryRunId",0,function(e,t,a=s){return"filemem"===e?r:t&&t!==r?t:a()},"normalizeStorageMode",0,u,"parseKnownStorageMode",0,h,"resolveMemoryDetailSegment",0,function(e,t){let{detailSegments:r}=y(e);return r.includes(t)?t:"units"},"resolveMemoryStoreTypeContract",0,function(e){let t=p(x(e.storageMode));return{inputType:e.inputType??t.inputType,outputTypes:e.outputTypes&&e.outputTypes.length>0?[...e.outputTypes]:t.outputTypes}},"resolveRetrievalMode",0,function(e,t){let r;return"filemem"===(r="boolean"==typeof t?t?"file+ots":"ots":u(t))?"local":"ots"===r||"managed-file"===r?"search":"local"===e?"local":"search"},"storageModeCapabilities",0,y,"storageModeLabel",0,function(e,t){let r=u(e);return t?t("filemem"===r?"memory.storageMode.writableFileLabel":"managed-file"===r?"memory.storageMode.managedFileLabel":"file+ots"===r?"memory.storageMode.projectedFileLabel":"memory.storageMode.apiOnlyLabel"):"filemem"===r?"Writable File Memory":"managed-file"===r?"Managed File Memory":"file+ots"===r?"Read-only File Projection":"API-only Memory"},"storageModeToSelection",0,x,"storageSelectionToStoreType",0,p,"toggleMemoryFileStorage",0,function(e){return"file"===e.inputType?f("file"):e.storageStructures.includes("file")?f("short-term"):{inputType:"short-term",storageStructures:["structured","file"]}},"toggleMemoryStructuredStorage",0,function(e){return"file"===e.inputType?f("file"):e.storageStructures.includes("structured")?e.storageStructures.includes("file")?{inputType:"short-term",storageStructures:["file"]}:e:{inputType:"short-term",storageStructures:["structured","file"]}}],828772)},229025,e=>{"use strict";let t=(0,e.i(801685).default)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);e.s(["FolderTree",0,t],229025)},278932,e=>{"use strict";var t=e.i(44501),r=e.i(309823),s=e.i(730068),a=e.i(942595),i=e.i(593321);e.s(["ErrorState",0,function({error:e,title:l,onRetry:o}){let n=function(e){if(!(e instanceof i.ApiClientError))return null;let{status:t}=e;return 401===t||403===t?"Please check your AccessKey credentials in the project settings.":503===t||"NETWORK_ERROR"===e.code?"The service may be unreachable. Verify the endpoint address and network connectivity.":null}(e);return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,t.jsx)("div",{className:"mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-destructive/10 ring-8 ring-destructive/5",children:(0,t.jsx)(r.AlertTriangle,{className:"text-destructive",size:36,strokeWidth:1.75})}),(0,t.jsx)("h3",{className:"mb-2 text-base font-semibold text-foreground",children:l??"Failed to load data"}),(0,t.jsx)("p",{className:"mb-1 max-w-md text-sm text-muted-foreground",children:e.message}),n&&(0,t.jsx)("p",{className:"mb-6 max-w-md text-xs text-muted-foreground/80",children:n}),!n&&(0,t.jsx)("div",{className:"mb-6"}),o&&(0,t.jsxs)(a.Button,{variant:"outline",size:"sm",onClick:o,children:[(0,t.jsx)(s.RefreshCw,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}])},396416,e=>{"use strict";let t=(0,e.i(801685).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],396416)},831211,e=>{"use strict";var t=e.i(44501),r=e.i(101685),s=e.i(876490);e.s(["Skeleton",0,function({className:e,delay:r,style:a,...i}){return(0,t.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-md bg-primary/10",e),style:{animationDelay:r?`${r}ms`:void 0,...a},...i})},"SkeletonGroup",0,function({children:e,stagger:s=80,className:a,...i}){let l=r.Children.toArray(e);return(0,t.jsx)("div",{className:a,...i,children:l.map((e,t)=>{if(!r.isValidElement(e))return e;let a=e.props.delay??0;return r.cloneElement(e,{delay:a+t*s})})})}])},330363,e=>{"use strict";let t=(0,e.i(801685).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],330363)},867530,e=>{"use strict";let t=(0,e.i(801685).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],867530)},799877,e=>{"use strict";var t=e.i(44501);e.s(["EmptyState",0,function({icon:e,title:r,description:s,action:a,illustration:i}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[i??(0,t.jsx)("div",{className:"mb-5 flex h-20 w-20 items-center justify-center rounded-full bg-[hsl(var(--primary)/0.08)] ring-8 ring-[hsl(var(--primary)/0.04)]",children:(0,t.jsx)(e,{className:"text-primary",size:36,strokeWidth:1.75})}),(0,t.jsx)("h3",{className:"mb-2 text-base font-semibold text-foreground",children:r}),(0,t.jsx)("p",{className:"mb-6 max-w-sm text-sm text-muted-foreground",children:s}),a&&(0,t.jsx)("div",{children:a})]})}])},810414,e=>{"use strict";var t=e.i(44501),r=e.i(101685),s=e.i(876490);let a=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm",e),...r}));a.displayName="Card";let i=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("flex flex-col space-y-1 px-5 pt-5 pb-3 border-b border-[hsl(var(--border-light))]",e),...r}));i.displayName="CardHeader";let l=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("text-base font-semibold leading-tight",e),...r}));l.displayName="CardTitle";let o=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("text-sm text-[hsl(var(--muted-foreground))]",e),...r}));o.displayName="CardDescription";let n=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("px-5 py-4",e),...r}));n.displayName="CardContent";let c=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("flex items-center px-5 py-3 border-t border-[hsl(var(--border-light))]",e),...r}));c.displayName="CardFooter";let m=r.forwardRef(({className:e,...r},a)=>(0,t.jsx)("div",{ref:a,className:(0,s.cn)("rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] shadow-sm","transition-[transform,box-shadow,border-color] duration-200 ease-[cubic-bezier(0.34,1.56,0.64,1)]","hover:border-[hsl(var(--primary))] hover:shadow-primary-soft",e),...r}));m.displayName="CardInteractive",e.s(["Card",0,a,"CardContent",0,n,"CardDescription",0,o,"CardFooter",0,c,"CardHeader",0,i,"CardInteractive",0,m,"CardTitle",0,l])},486221,e=>{"use strict";let t=(0,e.i(801685).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["MoreHorizontal",0,t],486221)},90035,951989,e=>{"use strict";var t=e.i(44501),r=e.i(396416),s=e.i(546398),a=e.i(876490),i=e.i(515793);e.s(["SearchInput",0,function({value:e,onChange:l,placeholder:o,className:n}){let{t:c}=(0,i.useI18n)();return(0,t.jsxs)("div",{className:(0,a.cn)("relative flex items-center",n),children:[(0,t.jsx)(r.Search,{className:"absolute left-3 pointer-events-none text-muted-foreground",size:16}),(0,t.jsx)("input",{type:"text",value:e,onChange:e=>l(e.target.value),placeholder:o??c("common.search"),className:(0,a.cn)("h-9 w-full rounded-md border border-input bg-background pl-9 pr-8 text-sm","placeholder:text-muted-foreground/60","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1")}),e&&(0,t.jsx)("button",{type:"button",onClick:()=>l(""),className:"absolute right-2 inline-flex items-center justify-center rounded-full p-0.5 text-gray-400 hover:text-gray-600 transition-colors","aria-label":c("common.clearSearch"),children:(0,t.jsx)(s.X,{size:14})})]})}],90035);var l=e.i(101685);e.s(["useDebounce",0,function(e,t=300){let[r,s]=(0,l.useState)(e);return(0,l.useEffect)(()=>{let r=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}],951989)},68090,e=>{"use strict";let t=(0,e.i(801685).default)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);e.s(["ListChecks",0,t],68090)},470821,e=>{"use strict";var t=e.i(44501),r=e.i(465581),s=e.i(187014),a=e.i(12251),i=e.i(137500),l=e.i(712984),o=e.i(164204),n=e.i(247570),c=e.i(515793);e.s(["MemoryDeleteDialog",0,function({memoryStoreName:e,open:m,onOpenChange:d,redirectToList:u=!1}){let h,f=(0,r.useRouter)(),p=(h=(0,l.useQueryClient)(),(0,i.useMutation)({mutationFn:e=>(0,o.deleteMemoryStore)(e),onSuccess:()=>{(0,n.invalidateMemoryQueries)(h)}})),{t:x}=(0,c.useI18n)();async function y(){if(e)try{await p.mutateAsync(e),s.toast.success(x("memory.list.deleteSuccess")),d(!1),u&&f.push("/memory")}catch(e){s.toast.error(e instanceof Error?e.message:x("memory.list.deleteFailed"))}}return(0,t.jsx)(a.ConfirmDialog,{open:m,onOpenChange:d,title:x("memory.list.deleteTitle"),description:x("memory.list.deleteConfirm",{name:e??""}),confirmInput:e??void 0,confirmText:x("common.delete"),variant:"danger",onConfirm:y})}],470821)},421090,e=>{"use strict";var t=e.i(44501),r=e.i(861403),s=e.i(358204),a=e.i(942595),i=e.i(323516),l=e.i(101685),o=e.i(18722),n=e.i(234752),c=e.i(831211),m=e.i(799877),d=e.i(278932),u=e.i(90035),h=e.i(951989),f=e.i(754614),p=e.i(515793),x=e.i(470821),y=e.i(465581),g=e.i(377163),v=e.i(229025),j=e.i(68090),b=e.i(237769),N=e.i(486221),S=e.i(396416),w=e.i(867530);let k=(0,e.i(801685).default)("table-properties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var M=e.i(330363),T=e.i(810414),C=e.i(801709),D=e.i(876490),I=e.i(828772);function R({segment:e,storePath:r,router:s,icon:a,label:i,title:l}){return(0,t.jsxs)("button",{type:"button",title:l,onClick:t=>{t.preventDefault(),t.stopPropagation(),s.push(`${r}/${e}`)},className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-[hsl(var(--accent))] hover:text-foreground",children:[a,i]})}let F=(0,l.memo)(function({memoryStore:e,onDelete:s}){let i=(0,y.useRouter)(),{t:l}=(0,p.useI18n)(),{memoryStoreName:c}=e,m=`/memory/${encodeURIComponent(c)}`,d=`${m}/units`,u=(0,I.storageModeCapabilities)(e.storageMode),h=(0,I.storageModeToSelection)(e.storageMode),f="short-term"===h.inputType?l("memory.create.shortTermInputLabel"):l("memory.create.fileInputLabel"),x=h.storageStructures.map(e=>"structured"===e?l("memory.create.structuredStorageLabel"):l("memory.create.fileStorageLabel")).join(" + "),F={longTerm:{segment:"units",icon:(0,t.jsx)(g.Database,{className:"h-3.5 w-3.5"}),label:l("memory.card.longTerm"),title:l("memory.card.longTermTitle")},shortTerm:{segment:"messages",icon:(0,t.jsx)(b.MessageSquare,{className:"h-3.5 w-3.5"}),label:l("memory.card.shortTerm"),title:l("memory.card.shortTermTitle")},extract:{segment:"tasks",icon:(0,t.jsx)(j.ListChecks,{className:"h-3.5 w-3.5"}),label:l("memory.card.extract"),title:l("memory.card.extractTitle")},consolidate:{segment:"dream",icon:(0,t.jsx)(n.Sparkles,{className:"h-3.5 w-3.5"}),label:l("memory.card.consolidate"),title:l("memory.card.consolidateTitle")},files:{segment:"units",icon:(0,t.jsx)(v.FolderTree,{className:"h-3.5 w-3.5"}),label:l("memory.detail.tabFiles"),title:l("memory.detail.tabFiles")}},z={units:{icon:u.structured?(0,t.jsx)(k,{className:"mr-2 h-4 w-4"}):(0,t.jsx)(v.FolderTree,{className:"mr-2 h-4 w-4"}),label:u.structured?l("memory.detail.tabUnits"):l("memory.detail.tabFiles")},search:{icon:(0,t.jsx)(S.Search,{className:"mr-2 h-4 w-4"}),label:l("memory.detail.tabSearch")},settings:{icon:(0,t.jsx)(w.Settings,{className:"mr-2 h-4 w-4"}),label:l("memory.detail.tabSettings")}};return(0,t.jsx)(r.default,{href:d,className:"no-underline",children:(0,t.jsx)(T.CardInteractive,{className:"group relative flex h-[180px] cursor-pointer flex-col",children:(0,t.jsxs)(T.CardContent,{className:"flex flex-col flex-1 min-h-0 p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,t.jsx)(o.Brain,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("h3",{className:"min-w-0 truncate text-base font-semibold text-foreground",title:c,children:c})]}),(0,t.jsx)("div",{className:"opacity-0 transition-opacity duration-150 delay-75 group-hover:opacity-100 focus-within:opacity-100",onClick:e=>e.preventDefault(),children:(0,t.jsxs)(C.DropdownMenu,{children:[(0,t.jsx)(C.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(a.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:(0,t.jsx)(N.MoreHorizontal,{className:"h-4 w-4"})})}),(0,t.jsxs)(C.DropdownMenuContent,{align:"end",children:[u.cardActions.map(e=>{let r=z[e];return(0,t.jsxs)(C.DropdownMenuItem,{onClick:()=>i.push(`${m}/${e}`),children:[r.icon,r.label]},e)}),(0,t.jsxs)(C.DropdownMenuItem,{className:"text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",onClick:()=>s?.(c),children:[(0,t.jsx)(M.Trash2,{className:"mr-2 h-4 w-4"}),l("common.delete")]})]})]})})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap gap-1.5 text-[10px]",children:[(0,t.jsxs)("span",{className:"inline-flex rounded-full border border-slate-200 bg-slate-50 px-2 py-0.5 text-slate-600",title:`${l("memory.card.inputType")}: ${f}`,children:[l("memory.card.inputType"),": ",f]}),(0,t.jsxs)("span",{className:(0,D.cn)("inline-flex rounded-full border px-2 py-0.5",u.files?"border-violet-200 bg-violet-50 text-violet-700":"border-slate-200 bg-slate-50 text-slate-600"),title:`${l("memory.card.storageStructure")}: ${x}`,children:[l("memory.card.storageStructure"),": ",x]})]}),(0,t.jsx)("div",{className:"mt-auto flex items-center gap-1 pt-4 text-xs text-muted-foreground min-w-0",children:u.cardShortcuts.map(e=>{let r=F[e];return(0,t.jsx)(R,{segment:r.segment,storePath:m,router:i,icon:r.icon,label:r.label,title:r.title},e)})})]})})})},(e,t)=>e.memoryStore===t.memoryStore||e.memoryStore.memoryStoreName===t.memoryStore.memoryStoreName&&e.memoryStore.storageMode===t.memoryStore.storageMode&&e.onDelete===t.onDelete);function z(){let{t:e}=(0,p.useI18n)(),{data:i,isLoading:n,error:y,refetch:g}=(0,f.useMemoryStores)(),[v,j]=(0,l.useState)(""),[b,N]=(0,l.useState)(null),S=(0,h.useDebounce)(v,300),w=(0,l.useMemo)(()=>{let e=i?.items??[];if(!S)return e;let t=S.toLowerCase();return e.filter(e=>e.memoryStoreName.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))},[i?.items,S]);return n?(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6}).map((e,r)=>(0,t.jsx)(c.Skeleton,{className:"h-[180px] rounded-lg",delay:80*r},r))}):y?(0,t.jsx)(d.ErrorState,{error:y,onRetry:()=>g()}):i?.items?.length?(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(u.SearchInput,{placeholder:e("memory.list.searchPlaceholder"),value:v,onChange:j,className:"max-w-sm"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:e("memory.list.count",{count:w.length})})]}),0===w.length?(0,t.jsx)(m.EmptyState,{icon:o.Brain,title:e("memory.list.noMatchTitle"),description:e("memory.list.noMatchDescription")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:w.map(e=>(0,t.jsx)(F,{memoryStore:e,onDelete:N},e.memoryStoreName))}),(0,t.jsx)(x.MemoryDeleteDialog,{memoryStoreName:b,open:!!b,onOpenChange:e=>{e||N(null)}})]}):(0,t.jsx)(m.EmptyState,{icon:o.Brain,title:e("memory.list.emptyTitle"),description:e("memory.list.emptyDescription"),illustration:(0,t.jsx)($,{}),action:(0,t.jsx)(a.Button,{asChild:!0,children:(0,t.jsxs)(r.default,{href:"/memory/create",children:[(0,t.jsx)(s.Plus,{className:"mr-2 h-4 w-4"}),e("memory.list.create")]})})})}function $(){return(0,t.jsxs)("div",{className:"animate-home-reveal relative mb-5 flex h-24 w-24 items-center justify-center overflow-hidden rounded-2xl border border-dashed border-[hsl(var(--primary)/0.35)] bg-gradient-to-br from-[hsl(var(--primary-soft))] via-[hsl(var(--surface))] to-[hsl(var(--surface))]","aria-hidden":!0,children:[(0,t.jsx)(n.Sparkles,{className:"pointer-events-none absolute right-2 top-2 h-3 w-3 text-[hsl(var(--primary)/0.45)]"}),(0,t.jsx)("span",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-[hsl(var(--primary-soft))] ring-1 ring-[hsl(var(--primary)/0.18)]",children:(0,t.jsx)(o.Brain,{className:"h-7 w-7 text-[hsl(var(--primary))]",strokeWidth:1.75})})]})}F.displayName="MemoryStoreCard",e.s(["default",0,function(){let{t:e}=(0,p.useI18n)();return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(i.PageHeader,{title:e("memory.list.title"),description:e("memory.list.description"),children:(0,t.jsx)(a.Button,{asChild:!0,children:(0,t.jsxs)(r.default,{href:"/memory/create",children:[(0,t.jsx)(s.Plus,{className:"mr-2 h-4 w-4"}),e("memory.list.create")]})})}),(0,t.jsx)(z,{})]})}],421090)}]);
|