@tablestore/tablestore-agent-cli 0.1.4 → 0.1.6
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 -195
- 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]/messages/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/messages/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/requests/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/search/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/settings/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/[store]/units/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/create/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found/page_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 +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- 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/knowledge-bases/[name]/documents/upload/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 +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/index.segments/_index.segment.rsc +2 -2
- 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 +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_full.segment.rsc +3 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/_index.segment.rsc +2 -2
- 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 +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/app/onboarding.segments/onboarding.segment.rsc +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/ssr/0b1r_app_(dashboard)_knowledge-base_[name]_documents_documents-client_tsx_0g2uxmt._.js +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{node_modules__pnpm_10vvzr6._.js → 12df_@tanstack_react-query_build_modern_0em_ajy._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0i0y9.r._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0nz4q2w._.js → [root-of-the-server]__0r_6wpx._.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0-dlo4s._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{0p91_next_0-sx_63._.js → _09yzbcp._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0y.sk37._.js → _0c7wecm._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ct0n55._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0fbjpet._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/{_0i24bv5._.js → _0hm68~i._.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0u9md36._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0o4a.29._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_0suis9l._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_app_(dashboard)_knowledge-base_[name]_layout-client_tsx_05momc5._.js +3 -0
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_retrieval_02c2uck._.js +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/dashboard_src_components_ui_select_tsx_0ys.i47._.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-mr2-dyb-szq.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0.yj.t1hbwkg4.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{10dgsk5-c~12w.js → 055_bo6_3nt-s.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{04a40-dl8p2c6.js → 07l4dodn5t6l4.js} +2 -2
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/09qsmnfvk8dm3.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0a5ass8u78k90.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ltmkqogn8g3t.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0o-c2g8y5pw-c.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0-.-yvgh3s-60.js → 0o0i2ke2jbdvq.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{0u-_fvx_r85sr.js → 0prl6hk4v0k3i.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0rywhgbu_16tm.js +5 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0v.hno.6q74nn.css +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/{16lab3t3ovnyq.js → 17h~onnkksf44.js} +1 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/17m1wc_o0.5iz.js +1 -0
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/17nx_vdk_qemm.js +1 -0
- package/dist/dashboard-runtime/dashboard/package.json +1 -0
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/documents/documents-client.tsx +94 -30
- package/dist/dashboard-runtime/dashboard/src/app/(dashboard)/knowledge-base/[name]/layout-client.tsx +27 -8
- package/dist/dashboard-runtime/dashboard/src/components/documents/doc-chunks-dialog.tsx +6 -3
- package/dist/dashboard-runtime/dashboard/src/components/documents/doc-columns.tsx +19 -10
- package/dist/dashboard-runtime/dashboard/src/components/documents/doc-table.tsx +4 -2
- package/dist/dashboard-runtime/dashboard/src/components/documents/doc-toolbar.tsx +0 -22
- package/dist/dashboard-runtime/dashboard/src/components/documents/doc-upload-dialog.tsx +19 -5
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-header.tsx +2 -0
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/kb-tab-nav.tsx +14 -3
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-gate.tsx +75 -0
- package/dist/dashboard-runtime/dashboard/src/components/knowledge-base/subspace-switcher.tsx +144 -0
- package/dist/dashboard-runtime/dashboard/src/components/layout/breadcrumb-bar.tsx +2 -0
- package/dist/dashboard-runtime/dashboard/src/components/layout/theme-toggle.tsx +63 -0
- package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-params-fields.tsx +17 -0
- package/dist/dashboard-runtime/dashboard/src/contexts/subspace-context.tsx +128 -0
- package/dist/dashboard-runtime/dashboard/src/hooks/use-documents.ts +20 -4
- package/dist/dashboard-runtime/dashboard/src/hooks/use-subspace-history.ts +108 -0
- package/package.json +1 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.meta +0 -18
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.rsc +0 -35
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.segments/!KGRhc2hib2FyZCk/chat/__PAGE__.segment.rsc +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.segments/!KGRhc2hib2FyZCk/chat.segment.rsc +0 -7
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.segments/_full.segment.rsc +0 -35
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/chat.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.meta +0 -19
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.rsc +0 -35
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/!KGRhc2hib2FyZCk/knowledge-base/create/__PAGE__.segment.rsc +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/!KGRhc2hib2FyZCk/knowledge-base/create.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/!KGRhc2hib2FyZCk/knowledge-base.segment.rsc +0 -6
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/_full.segment.rsc +0 -35
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base/create.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.meta +0 -18
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.rsc +0 -34
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.segments/!KGRhc2hib2FyZCk/knowledge-base/__PAGE__.segment.rsc +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.segments/!KGRhc2hib2FyZCk/knowledge-base.segment.rsc +0 -6
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.segments/_full.segment.rsc +0 -34
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/knowledge-base.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.meta +0 -19
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.rsc +0 -32
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/!KGRhc2hib2FyZCk/llm-providers/new/__PAGE__.segment.rsc +0 -6
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/!KGRhc2hib2FyZCk/llm-providers/new.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/!KGRhc2hib2FyZCk/llm-providers.segment.rsc +0 -7
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/_full.segment.rsc +0 -32
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers/new.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.meta +0 -18
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.rsc +0 -34
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.segments/!KGRhc2hib2FyZCk/llm-providers/__PAGE__.segment.rsc +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.segments/!KGRhc2hib2FyZCk/llm-providers.segment.rsc +0 -7
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.segments/_full.segment.rsc +0 -34
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/llm-providers.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.meta +0 -19
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.rsc +0 -37
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/!KGRhc2hib2FyZCk/memory/create/__PAGE__.segment.rsc +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/!KGRhc2hib2FyZCk/memory/create.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +0 -7
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/_full.segment.rsc +0 -37
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory/create.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.meta +0 -18
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.rsc +0 -35
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk/memory/__PAGE__.segment.rsc +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +0 -7
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.segments/_full.segment.rsc +0 -35
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/memory.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.html +0 -1
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.meta +0 -18
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.rsc +0 -34
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.segments/!KGRhc2hib2FyZCk/projects/__PAGE__.segment.rsc +0 -9
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.segments/!KGRhc2hib2FyZCk/projects.segment.rsc +0 -7
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.segments/!KGRhc2hib2FyZCk.segment.rsc +0 -4
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.segments/_full.segment.rsc +0 -34
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.segments/_head.segment.rsc +0 -5
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.segments/_index.segment.rsc +0 -10
- package/dist/dashboard-runtime/dashboard/.next/server/app/projects.segments/_tree.segment.rsc +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0k7~7-.._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.1hjna._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0.a5w1p._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0a7zm1~._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/_0ce~2ba._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/server/chunks/ssr/node_modules__pnpm_13sm81o._.js +0 -3
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/01e~e666-rfuv.css +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/05-ybw~qkiu2u.js +0 -5
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0dao._4pxnon7.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0eillhls.tts8.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0ja2he~jl53.n.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0vzzx38w03s2z.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/0~5hi.pq6~znn.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/10hds0xyg3aah.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/11uulsjt7kqqm.js +0 -1
- package/dist/dashboard-runtime/dashboard/.next/static/chunks/12hh~9zwiszro.js +0 -1
- /package/dist/dashboard-runtime/dashboard/.next/static/{5v9SZKIfkbolPwH_qGQog → MjeKF5uLzEvAqWkR9O6Ts}/_buildManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{5v9SZKIfkbolPwH_qGQog → MjeKF5uLzEvAqWkR9O6Ts}/_clientMiddlewareManifest.js +0 -0
- /package/dist/dashboard-runtime/dashboard/.next/static/{5v9SZKIfkbolPwH_qGQog → MjeKF5uLzEvAqWkR9O6Ts}/_ssgManifest.js +0 -0
|
@@ -29,6 +29,7 @@ import type { MetadataField } from "@/types/knowledge-base";
|
|
|
29
29
|
interface DocUploadDialogProps {
|
|
30
30
|
knowledgeBaseName: string;
|
|
31
31
|
metadataFields?: MetadataField[];
|
|
32
|
+
defaultSubspace?: string;
|
|
32
33
|
open: boolean;
|
|
33
34
|
onOpenChange: (open: boolean) => void;
|
|
34
35
|
}
|
|
@@ -116,12 +117,13 @@ function filterFolderFiles(list: File[], opts: FolderFilterOptions): File[] {
|
|
|
116
117
|
export function DocUploadDialog({
|
|
117
118
|
knowledgeBaseName,
|
|
118
119
|
metadataFields,
|
|
120
|
+
defaultSubspace,
|
|
119
121
|
open,
|
|
120
122
|
onOpenChange,
|
|
121
123
|
}: DocUploadDialogProps) {
|
|
122
124
|
const [mode, setMode] = useState<UploadMode>("file");
|
|
123
125
|
const [files, setFiles] = useState<File[]>([]);
|
|
124
|
-
const [subspace, setSubspace] = useState("");
|
|
126
|
+
const [subspace, setSubspace] = useState(defaultSubspace ?? "");
|
|
125
127
|
const [metadataJson, setMetadataJson] = useState("");
|
|
126
128
|
const [metadataValues, setMetadataValues] = useState<Record<string, string>>({});
|
|
127
129
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
@@ -202,11 +204,11 @@ export function DocUploadDialog({
|
|
|
202
204
|
setIncludeInput("");
|
|
203
205
|
setExcludeInput("");
|
|
204
206
|
setRecursive(true);
|
|
205
|
-
setSubspace("");
|
|
207
|
+
setSubspace(defaultSubspace ?? "");
|
|
206
208
|
setMetadataJson("");
|
|
207
209
|
setMetadataValues({});
|
|
208
210
|
setJsonPreviewOpen(false);
|
|
209
|
-
}, []);
|
|
211
|
+
}, [defaultSubspace]);
|
|
210
212
|
|
|
211
213
|
const handleModeChange = useCallback((next: string) => {
|
|
212
214
|
const nextMode = next as UploadMode;
|
|
@@ -464,12 +466,24 @@ export function DocUploadDialog({
|
|
|
464
466
|
|
|
465
467
|
{/* 子空间 */}
|
|
466
468
|
<div className="space-y-2">
|
|
467
|
-
<Label
|
|
469
|
+
<Label className="flex items-center gap-2">
|
|
470
|
+
子空间(可选)
|
|
471
|
+
{defaultSubspace && (
|
|
472
|
+
<span className="text-xs font-normal text-muted-foreground">
|
|
473
|
+
默认:{defaultSubspace}
|
|
474
|
+
</span>
|
|
475
|
+
)}
|
|
476
|
+
</Label>
|
|
468
477
|
<Input
|
|
469
|
-
placeholder="输入子空间名称"
|
|
478
|
+
placeholder={defaultSubspace ? "当前子空间" : "输入子空间名称"}
|
|
470
479
|
value={subspace}
|
|
471
480
|
onChange={(event) => setSubspace(event.target.value)}
|
|
472
481
|
/>
|
|
482
|
+
{defaultSubspace && subspace !== defaultSubspace && (
|
|
483
|
+
<p className="text-xs text-muted-foreground">
|
|
484
|
+
提示:将上传到子空间 "{subspace || "(空)"}",与当前作用域 "{defaultSubspace}" 不同
|
|
485
|
+
</p>
|
|
486
|
+
)}
|
|
473
487
|
</div>
|
|
474
488
|
|
|
475
489
|
{/* Metadata */}
|
|
@@ -4,6 +4,7 @@ import { Badge } from "@/components/ui/badge";
|
|
|
4
4
|
import { Button } from "@/components/ui/button";
|
|
5
5
|
import { Trash2 } from "lucide-react";
|
|
6
6
|
import { RelativeTime } from "@/components/shared/relative-time";
|
|
7
|
+
import { SubspaceSwitcher } from "@/components/knowledge-base/subspace-switcher";
|
|
7
8
|
import type { KnowledgeBase } from "@/types/knowledge-base";
|
|
8
9
|
|
|
9
10
|
interface KBHeaderProps {
|
|
@@ -67,6 +68,7 @@ export function KBHeader({ knowledgeBase, onDelete }: KBHeaderProps) {
|
|
|
67
68
|
已开启子空间隔离
|
|
68
69
|
</span>
|
|
69
70
|
)}
|
|
71
|
+
<SubspaceSwitcher />
|
|
70
72
|
<span>
|
|
71
73
|
创建于 <RelativeTime timestamp={createdAt} />
|
|
72
74
|
</span>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import Link from "next/link";
|
|
4
|
-
import { usePathname } from "next/navigation";
|
|
4
|
+
import { usePathname, useSearchParams } from "next/navigation";
|
|
5
5
|
import { cn } from "@/lib/utils";
|
|
6
|
+
import { useSubspaceOptional } from "@/contexts/subspace-context";
|
|
6
7
|
|
|
7
8
|
interface KBTabNavProps {
|
|
8
9
|
knowledgeBaseName: string;
|
|
@@ -17,13 +18,23 @@ const TABS = [
|
|
|
17
18
|
|
|
18
19
|
export function KBTabNav({ knowledgeBaseName }: KBTabNavProps) {
|
|
19
20
|
const pathname = usePathname();
|
|
21
|
+
const searchParams = useSearchParams();
|
|
20
22
|
const basePath = `/knowledge-base/${encodeURIComponent(knowledgeBaseName)}`;
|
|
23
|
+
// Inline active subspace into tab hrefs to keep middle-click / copy-link
|
|
24
|
+
// consistent with the SubspaceProvider router.replace fallback.
|
|
25
|
+
const activeSubspace = useSubspaceOptional()?.subspace ?? null;
|
|
26
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
27
|
+
if (activeSubspace) params.set("subspace", activeSubspace);
|
|
28
|
+
else params.delete("subspace");
|
|
29
|
+
const qs = params.toString();
|
|
30
|
+
const querySuffix = qs ? `?${qs}` : "";
|
|
21
31
|
|
|
22
32
|
return (
|
|
23
33
|
<nav className="flex gap-1 border-b border-[hsl(var(--border))]">
|
|
24
34
|
{TABS.map((tab) => {
|
|
25
|
-
const
|
|
26
|
-
const
|
|
35
|
+
const tabPath = `${basePath}/${tab.segment}`;
|
|
36
|
+
const href = `${tabPath}${querySuffix}`;
|
|
37
|
+
const isActive = pathname.startsWith(tabPath);
|
|
27
38
|
|
|
28
39
|
return (
|
|
29
40
|
<Link
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, type KeyboardEvent } from "react";
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import { Input } from "@/components/ui/input";
|
|
6
|
+
import { useSubspace } from "@/contexts/subspace-context";
|
|
7
|
+
|
|
8
|
+
export function SubspaceGate() {
|
|
9
|
+
const { setSubspace, history } = useSubspace();
|
|
10
|
+
const [inputValue, setInputValue] = useState("");
|
|
11
|
+
|
|
12
|
+
const handleSubmit = () => {
|
|
13
|
+
const trimmed = inputValue.trim();
|
|
14
|
+
if (!trimmed) return;
|
|
15
|
+
setSubspace(trimmed);
|
|
16
|
+
setInputValue("");
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
|
20
|
+
if (e.key === "Enter") {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
handleSubmit();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className="flex flex-col items-center justify-center min-h-[400px] gap-6 px-4">
|
|
28
|
+
<h2 className="text-2xl font-semibold">请选择子空间</h2>
|
|
29
|
+
<p className="text-sm text-muted-foreground max-w-[500px] text-center">
|
|
30
|
+
此知识库已启用子空间隔离,文档按子空间分组存储。请输入您要访问的子空间名称以查看对应文档。
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
{history.length > 0 && (
|
|
34
|
+
<div className="flex flex-col items-center gap-2">
|
|
35
|
+
<span className="text-xs font-semibold text-muted-foreground">
|
|
36
|
+
最近使用
|
|
37
|
+
</span>
|
|
38
|
+
<div className="flex gap-2 flex-wrap justify-center max-w-[600px]">
|
|
39
|
+
{history.map((s, idx) => (
|
|
40
|
+
<button
|
|
41
|
+
key={s}
|
|
42
|
+
type="button"
|
|
43
|
+
onClick={() => setSubspace(s)}
|
|
44
|
+
className={
|
|
45
|
+
idx === 0
|
|
46
|
+
? "px-3 py-1.5 rounded-md text-sm cursor-pointer transition-colors bg-primary/10 border border-primary/30 text-primary hover:bg-primary/20"
|
|
47
|
+
: "px-3 py-1.5 rounded-md text-sm cursor-pointer transition-colors bg-muted border border-border hover:bg-primary/10 hover:border-primary/30"
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
{s}
|
|
51
|
+
</button>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
<div className="flex gap-2 w-full max-w-[480px]">
|
|
58
|
+
<Input
|
|
59
|
+
placeholder="输入子空间名称..."
|
|
60
|
+
value={inputValue}
|
|
61
|
+
onChange={(e) => setInputValue(e.target.value)}
|
|
62
|
+
onKeyDown={handleKeyDown}
|
|
63
|
+
className="text-base"
|
|
64
|
+
/>
|
|
65
|
+
<Button onClick={handleSubmit} disabled={!inputValue.trim()}>
|
|
66
|
+
进入
|
|
67
|
+
</Button>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<p className="text-xs text-muted-foreground">
|
|
71
|
+
提示:子空间名称由创建者自定义,如 "team-alpha"、"docs-v2" 等
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, type KeyboardEvent } from "react";
|
|
4
|
+
import { Check, ChevronDown, X } from "lucide-react";
|
|
5
|
+
import { toast } from "sonner";
|
|
6
|
+
import { Button } from "@/components/ui/button";
|
|
7
|
+
import { Input } from "@/components/ui/input";
|
|
8
|
+
import { Separator } from "@/components/ui/separator";
|
|
9
|
+
import {
|
|
10
|
+
Popover,
|
|
11
|
+
PopoverContent,
|
|
12
|
+
PopoverTrigger,
|
|
13
|
+
} from "@/components/ui/popover";
|
|
14
|
+
import { useSubspaceOptional } from "@/contexts/subspace-context";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Inline subspace switcher rendered in KBHeader. Mirrors the UX of GitHub
|
|
18
|
+
* repo / Linear workspace switchers and keeps a placeholder trigger after
|
|
19
|
+
* a clear so the user can immediately pick another scope.
|
|
20
|
+
*/
|
|
21
|
+
export function SubspaceSwitcher() {
|
|
22
|
+
const ctx = useSubspaceOptional();
|
|
23
|
+
const [open, setOpen] = useState(false);
|
|
24
|
+
const [inputValue, setInputValue] = useState("");
|
|
25
|
+
|
|
26
|
+
// No provider mounted (e.g. KB list page).
|
|
27
|
+
if (!ctx) return null;
|
|
28
|
+
|
|
29
|
+
const { subspace, history, setSubspace, clearSubspace } = ctx;
|
|
30
|
+
const hasActive = subspace !== null;
|
|
31
|
+
|
|
32
|
+
const handleSubmit = () => {
|
|
33
|
+
const trimmed = inputValue.trim();
|
|
34
|
+
if (!trimmed || trimmed === subspace) {
|
|
35
|
+
setInputValue("");
|
|
36
|
+
setOpen(false);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
setSubspace(trimmed);
|
|
40
|
+
setInputValue("");
|
|
41
|
+
setOpen(false);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
|
45
|
+
if (e.key === "Enter") {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
handleSubmit();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const handlePick = (s: string) => {
|
|
52
|
+
if (s !== subspace) setSubspace(s);
|
|
53
|
+
setOpen(false);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleClear = () => {
|
|
57
|
+
clearSubspace();
|
|
58
|
+
setOpen(false);
|
|
59
|
+
toast.success("已清除子空间作用域,请重新选择");
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
64
|
+
<PopoverTrigger asChild>
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
className="inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-primary/10 text-primary text-xs font-medium hover:bg-primary/15 transition-colors cursor-pointer"
|
|
68
|
+
>
|
|
69
|
+
{hasActive ? `子空间: ${subspace}` : "选择子空间…"}
|
|
70
|
+
<ChevronDown className="h-3 w-3 opacity-70" />
|
|
71
|
+
</button>
|
|
72
|
+
</PopoverTrigger>
|
|
73
|
+
<PopoverContent
|
|
74
|
+
align="start"
|
|
75
|
+
sideOffset={6}
|
|
76
|
+
className="w-72 p-3 space-y-3"
|
|
77
|
+
>
|
|
78
|
+
<div className="space-y-1">
|
|
79
|
+
<label className="text-xs font-medium text-muted-foreground">
|
|
80
|
+
{hasActive ? "切换到其他子空间" : "进入子空间"}
|
|
81
|
+
</label>
|
|
82
|
+
<div className="flex gap-1.5">
|
|
83
|
+
<Input
|
|
84
|
+
autoFocus
|
|
85
|
+
placeholder="输入子空间名称..."
|
|
86
|
+
value={inputValue}
|
|
87
|
+
onChange={(e) => setInputValue(e.target.value)}
|
|
88
|
+
onKeyDown={handleKeyDown}
|
|
89
|
+
className="h-8 text-sm"
|
|
90
|
+
/>
|
|
91
|
+
<Button
|
|
92
|
+
size="sm"
|
|
93
|
+
className="h-8 px-2.5"
|
|
94
|
+
onClick={handleSubmit}
|
|
95
|
+
disabled={!inputValue.trim() || inputValue.trim() === subspace}
|
|
96
|
+
>
|
|
97
|
+
进入
|
|
98
|
+
</Button>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{history.length > 0 && (
|
|
103
|
+
<div className="space-y-1">
|
|
104
|
+
<span className="text-xs font-medium text-muted-foreground">
|
|
105
|
+
最近使用
|
|
106
|
+
</span>
|
|
107
|
+
<div className="flex flex-col gap-0.5 max-h-[180px] overflow-y-auto">
|
|
108
|
+
{history.map((s) => {
|
|
109
|
+
const active = hasActive && s === subspace;
|
|
110
|
+
return (
|
|
111
|
+
<button
|
|
112
|
+
key={s}
|
|
113
|
+
type="button"
|
|
114
|
+
onClick={() => handlePick(s)}
|
|
115
|
+
className="flex items-center justify-between rounded-sm px-2 py-1.5 text-sm text-left hover:bg-[hsl(var(--accent))] transition-colors"
|
|
116
|
+
>
|
|
117
|
+
<span className="truncate">{s}</span>
|
|
118
|
+
{active && (
|
|
119
|
+
<Check className="h-3.5 w-3.5 text-primary shrink-0 ml-2" />
|
|
120
|
+
)}
|
|
121
|
+
</button>
|
|
122
|
+
);
|
|
123
|
+
})}
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
127
|
+
|
|
128
|
+
{hasActive && (
|
|
129
|
+
<>
|
|
130
|
+
<Separator />
|
|
131
|
+
<button
|
|
132
|
+
type="button"
|
|
133
|
+
onClick={handleClear}
|
|
134
|
+
className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-destructive transition-colors w-full"
|
|
135
|
+
>
|
|
136
|
+
<X className="h-3 w-3" />
|
|
137
|
+
清除选择(返回子空间选择页)
|
|
138
|
+
</button>
|
|
139
|
+
</>
|
|
140
|
+
)}
|
|
141
|
+
</PopoverContent>
|
|
142
|
+
</Popover>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
@@ -5,6 +5,7 @@ import { usePathname } from "next/navigation";
|
|
|
5
5
|
import { ChevronRight, HelpCircle } from "lucide-react";
|
|
6
6
|
import { cn } from "@/lib/utils";
|
|
7
7
|
import { InstanceSwitcher } from "./instance-switcher";
|
|
8
|
+
import { ThemeToggle } from "./theme-toggle";
|
|
8
9
|
import { Separator } from "@/components/ui/separator";
|
|
9
10
|
|
|
10
11
|
const HELP_URL_KB = "https://help.aliyun.com/zh/tablestore/knowledge-base-rag/";
|
|
@@ -98,6 +99,7 @@ export function BreadcrumbBar() {
|
|
|
98
99
|
<div className="flex items-center gap-2">
|
|
99
100
|
<InstanceSwitcher />
|
|
100
101
|
<Separator orientation="vertical" className="h-5" />
|
|
102
|
+
<ThemeToggle />
|
|
101
103
|
<a
|
|
102
104
|
href={helpUrl}
|
|
103
105
|
target="_blank"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { Moon, Sun } from "lucide-react";
|
|
5
|
+
import { useTheme } from "@/providers/theme-provider";
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* iOS-style light/dark switch. The thumb carries the icon of the currently
|
|
10
|
+
* active mode (sun = light, moon = dark) and slides between the two ends.
|
|
11
|
+
* Initial state follows the OS preference; once the user toggles it the
|
|
12
|
+
* choice is persisted by next-themes and overrides the system setting.
|
|
13
|
+
*/
|
|
14
|
+
export function ThemeToggle() {
|
|
15
|
+
const { setTheme, resolvedTheme } = useTheme();
|
|
16
|
+
const [mounted, setMounted] = useState(false);
|
|
17
|
+
|
|
18
|
+
useEffect(() => setMounted(true), []);
|
|
19
|
+
|
|
20
|
+
// Reserve the same footprint during SSR to avoid layout shift and the
|
|
21
|
+
// classic next-themes hydration warning.
|
|
22
|
+
if (!mounted) {
|
|
23
|
+
return <div className="h-6 w-11" aria-hidden />;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const isDark = resolvedTheme === "dark";
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<button
|
|
30
|
+
type="button"
|
|
31
|
+
role="switch"
|
|
32
|
+
aria-checked={isDark}
|
|
33
|
+
aria-label={isDark ? "切换到亮色模式" : "切换到暗色模式"}
|
|
34
|
+
title={isDark ? "切换到亮色模式" : "切换到暗色模式"}
|
|
35
|
+
data-state={isDark ? "checked" : "unchecked"}
|
|
36
|
+
onClick={() => setTheme(isDark ? "light" : "dark")}
|
|
37
|
+
className={cn(
|
|
38
|
+
"peer relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors duration-200",
|
|
39
|
+
"shadow-[inset_0_0_0_1px_rgba(0,0,0,0.04),inset_0_1px_2px_rgba(0,0,0,0.06)]",
|
|
40
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
41
|
+
isDark
|
|
42
|
+
? "bg-slate-700 hover:bg-slate-600"
|
|
43
|
+
: "bg-sky-200 hover:bg-sky-300",
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
<span
|
|
47
|
+
aria-hidden
|
|
48
|
+
className={cn(
|
|
49
|
+
"pointer-events-none flex h-5 w-5 items-center justify-center rounded-full bg-white transition-transform duration-200",
|
|
50
|
+
"shadow-[0_1px_2px_rgba(0,0,0,0.1),0_2px_6px_rgba(0,0,0,0.15)] ring-1 ring-black/5",
|
|
51
|
+
"ease-[cubic-bezier(0.34,1.56,0.64,1)]",
|
|
52
|
+
isDark ? "translate-x-5" : "translate-x-0.5",
|
|
53
|
+
)}
|
|
54
|
+
>
|
|
55
|
+
{isDark ? (
|
|
56
|
+
<Moon className="h-3 w-3 text-slate-700" />
|
|
57
|
+
) : (
|
|
58
|
+
<Sun className="h-3 w-3 text-amber-500" />
|
|
59
|
+
)}
|
|
60
|
+
</span>
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
63
|
+
}
|
package/dist/dashboard-runtime/dashboard/src/components/retrieval/retrieval-params-fields.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
3
4
|
import type { UseFormReturn } from "react-hook-form";
|
|
4
5
|
import { Check, ChevronDown, HelpCircle, Info } from "lucide-react";
|
|
5
6
|
|
|
6
7
|
import { Input } from "@/components/ui/input";
|
|
7
8
|
import { Button } from "@/components/ui/button";
|
|
9
|
+
import { useSubspaceOptional } from "@/contexts/subspace-context";
|
|
8
10
|
import {
|
|
9
11
|
FormControl,
|
|
10
12
|
FormField,
|
|
@@ -71,6 +73,21 @@ export function RetrievalParamsFields({
|
|
|
71
73
|
!!currentSearchType?.includes("FULL_TEXT");
|
|
72
74
|
const metadataFields = knowledgeBase?.metadata ?? [];
|
|
73
75
|
|
|
76
|
+
// Pre-fill the subspace field with the active scope, but only once per
|
|
77
|
+
// distinct activeSubspace value so that an intentional user clear sticks.
|
|
78
|
+
const activeSubspace = useSubspaceOptional()?.subspace ?? null;
|
|
79
|
+
const prefilledForRef = useRef<string | null>(null);
|
|
80
|
+
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!knowledgeBase?.subspace || !activeSubspace) return;
|
|
83
|
+
if (prefilledForRef.current === activeSubspace) return;
|
|
84
|
+
const current = (form.getValues("subspace") as string[] | undefined) ?? [];
|
|
85
|
+
if (current.length === 0) {
|
|
86
|
+
form.setValue("subspace", [activeSubspace], { shouldDirty: false });
|
|
87
|
+
}
|
|
88
|
+
prefilledForRef.current = activeSubspace;
|
|
89
|
+
}, [activeSubspace, knowledgeBase?.subspace, form]);
|
|
90
|
+
|
|
74
91
|
return (
|
|
75
92
|
<>
|
|
76
93
|
{/* Subspace: only meaningful for KBs that opted into subspace isolation. */}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
type ReactNode,
|
|
10
|
+
} from "react";
|
|
11
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
12
|
+
import {
|
|
13
|
+
clearActiveSubspace,
|
|
14
|
+
getActiveSubspace,
|
|
15
|
+
setActiveSubspace,
|
|
16
|
+
useSubspaceHistory,
|
|
17
|
+
} from "@/hooks/use-subspace-history";
|
|
18
|
+
|
|
19
|
+
export interface SubspaceContextValue {
|
|
20
|
+
subspace: string | null;
|
|
21
|
+
setSubspace: (subspace: string) => void;
|
|
22
|
+
clearSubspace: () => void;
|
|
23
|
+
history: string[];
|
|
24
|
+
addToHistory: (subspace: string) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const SubspaceContext = createContext<SubspaceContextValue | null>(null);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Strict accessor — throws when called outside of a SubspaceProvider. Use this
|
|
31
|
+
* inside subtrees that always sit under the provider (e.g. DocumentsClient).
|
|
32
|
+
*/
|
|
33
|
+
export function useSubspace(): SubspaceContextValue {
|
|
34
|
+
const context = useContext(SubspaceContext);
|
|
35
|
+
if (!context) {
|
|
36
|
+
throw new Error("useSubspace must be used within a SubspaceProvider");
|
|
37
|
+
}
|
|
38
|
+
return context;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Optional accessor — returns null when no SubspaceProvider is mounted. Use
|
|
43
|
+
* this in components that may render both inside and outside the KB detail
|
|
44
|
+
* layout (e.g. KBHeader, which is also used on the KB list page).
|
|
45
|
+
*/
|
|
46
|
+
export function useSubspaceOptional(): SubspaceContextValue | null {
|
|
47
|
+
return useContext(SubspaceContext);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface SubspaceProviderProps {
|
|
51
|
+
knowledgeBaseName: string;
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Subspace state container backed by the URL as the single source of truth.
|
|
57
|
+
* The `?subspace=` query parameter drives every read; writes only call
|
|
58
|
+
* router.replace and let the URL change propagate. A per-tab sessionStorage
|
|
59
|
+
* preference is replayed into the URL once on mount so revisiting the page
|
|
60
|
+
* without a query string still lands on the previously chosen scope.
|
|
61
|
+
*/
|
|
62
|
+
export function SubspaceProvider({
|
|
63
|
+
knowledgeBaseName,
|
|
64
|
+
children,
|
|
65
|
+
}: SubspaceProviderProps) {
|
|
66
|
+
const searchParams = useSearchParams();
|
|
67
|
+
const searchParamsKey = searchParams.toString();
|
|
68
|
+
const pathname = usePathname();
|
|
69
|
+
const router = useRouter();
|
|
70
|
+
const { history, addToHistory } = useSubspaceHistory(knowledgeBaseName);
|
|
71
|
+
|
|
72
|
+
// URL is the single source of truth — derive directly, no local state.
|
|
73
|
+
const subspace = searchParams.get("subspace");
|
|
74
|
+
|
|
75
|
+
// One-shot mount-time sticky hydration: when arriving without a query
|
|
76
|
+
// param but a per-tab session preference exists, replay it into the URL.
|
|
77
|
+
// After this single redirect every read flows through URL again, so a
|
|
78
|
+
// later clearSubspace() cannot be undone by re-running this effect.
|
|
79
|
+
const hydratedRef = useRef(false);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (hydratedRef.current) return;
|
|
82
|
+
hydratedRef.current = true;
|
|
83
|
+
if (subspace) return;
|
|
84
|
+
const stored = getActiveSubspace(knowledgeBaseName);
|
|
85
|
+
if (!stored) return;
|
|
86
|
+
const params = new URLSearchParams(searchParamsKey);
|
|
87
|
+
params.set("subspace", stored);
|
|
88
|
+
router.replace(`${pathname}?${params.toString()}`);
|
|
89
|
+
}, [knowledgeBaseName, subspace, searchParamsKey, pathname, router]);
|
|
90
|
+
|
|
91
|
+
// Side effects follow the URL: persist to sessionStorage and history
|
|
92
|
+
// whenever the active scope changes. Centralising the writes here means
|
|
93
|
+
// setSubspace / clearSubspace stay tiny and free of race conditions.
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (!subspace) {
|
|
96
|
+
clearActiveSubspace(knowledgeBaseName);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
setActiveSubspace(knowledgeBaseName, subspace);
|
|
100
|
+
addToHistory(subspace);
|
|
101
|
+
}, [subspace, knowledgeBaseName, addToHistory]);
|
|
102
|
+
|
|
103
|
+
const setSubspace = useCallback(
|
|
104
|
+
(next: string) => {
|
|
105
|
+
const trimmed = next.trim();
|
|
106
|
+
if (!trimmed) return;
|
|
107
|
+
const params = new URLSearchParams(searchParamsKey);
|
|
108
|
+
params.set("subspace", trimmed);
|
|
109
|
+
router.replace(`${pathname}?${params.toString()}`);
|
|
110
|
+
},
|
|
111
|
+
[searchParamsKey, pathname, router],
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const clearSubspace = useCallback(() => {
|
|
115
|
+
const params = new URLSearchParams(searchParamsKey);
|
|
116
|
+
params.delete("subspace");
|
|
117
|
+
const query = params.toString();
|
|
118
|
+
router.replace(query ? `${pathname}?${query}` : pathname);
|
|
119
|
+
}, [searchParamsKey, pathname, router]);
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<SubspaceContext.Provider
|
|
123
|
+
value={{ subspace, setSubspace, clearSubspace, history, addToHistory }}
|
|
124
|
+
>
|
|
125
|
+
{children}
|
|
126
|
+
</SubspaceContext.Provider>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import { useQuery } from "@tanstack/react-query";
|
|
2
2
|
import { listDocuments } from "@/services/documents";
|
|
3
3
|
|
|
4
|
-
export function useDocuments(
|
|
4
|
+
export function useDocuments(
|
|
5
|
+
knowledgeBaseName: string,
|
|
6
|
+
options?: {
|
|
7
|
+
nextToken?: string;
|
|
8
|
+
maxResults?: number;
|
|
9
|
+
subspace?: string;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
},
|
|
12
|
+
) {
|
|
13
|
+
const { nextToken, maxResults = 20, subspace, enabled = true } = options ?? {};
|
|
5
14
|
return useQuery({
|
|
6
|
-
queryKey: [
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
queryKey: [
|
|
16
|
+
"knowledge-bases",
|
|
17
|
+
knowledgeBaseName,
|
|
18
|
+
"documents",
|
|
19
|
+
nextToken,
|
|
20
|
+
maxResults,
|
|
21
|
+
subspace,
|
|
22
|
+
],
|
|
23
|
+
queryFn: () => listDocuments(knowledgeBaseName, { maxResults, nextToken, subspace }),
|
|
24
|
+
enabled: !!knowledgeBaseName && enabled,
|
|
9
25
|
staleTime: 30_000,
|
|
10
26
|
});
|
|
11
27
|
}
|