feat: 接入 mnote web tree shell 与主页链路整理
- 增加 mnote-web tree/command 支持与前端 MnoteWebTreeShell 集成 - 调整 sidebar、documents、runtime config 与 dev/prod server 配套逻辑 - 补充 homepage/tree shell smoke 脚本并更新 harness 进度文件
This commit is contained in:
@@ -13,14 +13,9 @@ import {
|
||||
resolveRustBridgeQueryPlan,
|
||||
} from "@/lib/documents/rust-runtime";
|
||||
import {
|
||||
buildSidebarDatasetListQueryPayload,
|
||||
mapSidebarDatasetListQueryResultToInitialData,
|
||||
type SidebarDatasetListQueryResult,
|
||||
} from "@/lib/sidebar-data";
|
||||
import {
|
||||
fetchSidebarDatasetFromMnoteWeb,
|
||||
getMnoteWebBaseUrl,
|
||||
} from "@/lib/server/mnote-web";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -41,31 +36,15 @@ export async function GET(request: Request) {
|
||||
}
|
||||
|
||||
try {
|
||||
if (getMnoteWebBaseUrl()) {
|
||||
const proxied = await fetchSidebarDatasetFromMnoteWeb({
|
||||
workspaceId: targetWorkspaceId,
|
||||
request,
|
||||
});
|
||||
const result = mapSidebarDatasetListQueryResultToInitialData(proxied.dataset);
|
||||
|
||||
return NextResponse.json({
|
||||
...result,
|
||||
meta: {
|
||||
requestId: proxied.meta.requestId,
|
||||
traceId: proxied.meta.traceId,
|
||||
queryName: "compat.next.sidebar",
|
||||
workspaceId: proxied.meta.workspaceId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const bridgeContext = await buildDocumentBridgeContext({
|
||||
request,
|
||||
workspaceId: targetWorkspaceId,
|
||||
});
|
||||
const envelope = buildDocumentQueryEnvelope({
|
||||
name: "sidebar.dataset.list",
|
||||
payload: buildSidebarDatasetListQueryPayload(targetWorkspaceId),
|
||||
payload: {
|
||||
workspaceId: targetWorkspaceId,
|
||||
},
|
||||
});
|
||||
const plan = await resolveRustBridgeQueryPlan({
|
||||
context: bridgeContext,
|
||||
|
||||
Reference in New Issue
Block a user