DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
refactor(dsh-tauri): apis/index.ts exports only fetch with built-in error normalization
hairyf688f1edf4e70
diff --git a/packages/dsh-tauri-panel-extension/src/client/apis/index.ts b/packages/dsh-tauri-panel-extension/src/client/apis/index.tsindex 19102352..64933b5e 100644--- a/packages/dsh-tauri-panel-extension/src/client/apis/index.ts+++ b/packages/dsh-tauri-panel-extension/src/client/apis/index.ts@@ -1,90 +1,80 @@import type * as Types from './index.type'-import { createJsonClient } from 'dsh-tauri/client'+import { fetch } from 'dsh-tauri/client'import { API_PREFIX } from '../../shared/constants'export const baseURL = API_PREFIX-/** 绑定 API 前缀的 JSON 客户端(错误归一由 dsh-tauri 统一承担)。 */-const json = createJsonClient(baseURL, {- errorMessage: (status, body) => {- const error = body && typeof body === 'object' && typeof (body as { error?: unknown }).error === 'string'- ? (body as { error: string }).error- : ''- return error || `HTTP ${status}`- },-})-/** @method get 查询技能列表。 */export function getSkills(): Promise<Types.SkillsResponse> {- return json.request('/skills')+ return fetch(`${baseURL}/skills`)}/** @method post 强制宿主重扫全部技能根。 */export function postSkillsRefresh(): Promise<Types.SkillsResponse> {- return json.post('/skills/refresh', {})+ return fetch(`${baseURL}/skills/refresh`, { method: 'POST', body: {} })}/** @method get 读取单个技能内容。 */export function getSkill(name: string): Promise<Types.SkillContentResponse> {- return json.request(`/skill?name=${encodeURIComponent(name)}`)+ return fetch(`${baseURL}/skill?name=${encodeURIComponent(name)}`)}/** @method post 保存技能。 */export function postSkillSave(body: Types.PostSkillSaveBody): Promise<Types.ActionResult> {- return json.post('/skill/save', body)+ return fetch(`${baseURL}/skill/save`, { method: 'POST', body })}/** @method post 删除技能。 */export function postSkillDelete(body: Types.PostSkillDeleteBody): Promise<Types.ActionResult> {- return json.post('/skill/delete', body)+ return fetch(`${baseURL}/skill/delete`, { method: 'POST', body })}/** @method post 切换技能加载策略。 */export function postSkillPolicy(body: Types.PostSkillPolicyBody): Promise<Types.ActionResult> {- return json.post('/skill/policy', body)+ return fetch(`${baseURL}/skill/policy`, { method: 'POST', body })}/** @method post 打开用户技能目录或某技能。 */export function postOpen(target: { target: 'user-skills' | 'skill', name?: string }): Promise<Types.ActionResult> {- return json.post('/open', target)+ return fetch(`${baseURL}/open`, { method: 'POST', body: target })}/** @method post 导入 GitHub 技能仓库。 */export function postRootsAdd(url: string): Promise<Types.ActionResult> {- return json.post('/roots/add', { kind: 'git', url })+ return fetch(`${baseURL}/roots/add`, { method: 'POST', body: { kind: 'git', url } })}/** @method get 查询 MCP 服务器列表。 */export function getMcp(): Promise<Types.McpListResponse> {- return json.request('/mcp')+ return fetch(`${baseURL}/mcp`)}/** @method post 保存 MCP 服务器。 */export function postMcpSave(body: Record<string, unknown>): Promise<Types.McpSaveResponse> {- return json.post('/mcp/save', body)+ return fetch(`${baseURL}/mcp/save`, { method: 'POST', body })}/** @method post 启用/禁用 MCP 服务器。 */export function postMcpToggle(body: Types.PostMcpToggleBody): Promise<Types.ActionResult> {- return json.post('/mcp/toggle', body)+ return fetch(`${baseURL}/mcp/toggle`, { method: 'POST', body })}/** @method post 移除 MCP 服务器。 */export function postMcpRemove(body: Types.PostMcpRemoveBody): Promise<Types.ActionResult> {- return json.post('/mcp/remove', body)+ return fetch(`${baseURL}/mcp/remove`, { method: 'POST', body })}/** @method get 扫描可导入的 MCP 配置。 */export function getMcpImportScan(): Promise<Types.McpImportScanResponse> {- return json.request('/import/scan')+ return fetch(`${baseURL}/import/scan`)}/** @method post 应用 MCP 导入项。 */export function postMcpImportApply(body: Types.PostMcpApplyImportBody): Promise<Types.McpApplyImportResponse> {- return json.post('/import/apply', body)+ return fetch(`${baseURL}/import/apply`, { method: 'POST', body })}/** @method post 请求宿主重启(连接会断开)。 */export function postRestart(): Promise<unknown> {- return json.post('/restart', {})+ return fetch(`${baseURL}/restart`, { method: 'POST', body: {} })}diff --git a/packages/dsh-tauri-panel-scheduler/src/client/apis/index.ts b/packages/dsh-tauri-panel-scheduler/src/client/apis/index.tsindex b8ccc049..2a58da32 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/apis/index.ts+++ b/packages/dsh-tauri-panel-scheduler/src/client/apis/index.ts@@ -1,65 +1,55 @@import type * as Types from './index.type'-import { createJsonClient } from 'dsh-tauri/client'+import { fetch } from 'dsh-tauri/client'import { API_PREFIX } from '../constants'export const baseURL = API_PREFIX-/** 绑定 API 前缀的 JSON 客户端(错误归一由 dsh-tauri 统一承担)。 */-const json = createJsonClient(baseURL, {- errorMessage: (status, body) => {- const error = body && typeof body === 'object' && typeof (body as { error?: unknown }).error === 'string'- ? (body as { error: string }).error- : ''- return error || `HTTP ${status}`- },-})-/** @method get 查询任务列表。 */export function getTasks(query?: Types.GetTasksQuery): Promise<Types.TasksResponse> {- return json.request(`/tasks${query?.search ? `?search=${encodeURIComponent(query.search)}` : ''}`)+ return fetch(`${baseURL}/tasks${query?.search ? `?search=${encodeURIComponent(query.search)}` : ''}`)}/** @method post 新建任务。 */export function postTasksCreate(body: Types.PostTasksCreateBody): Promise<Types.TaskActionResult> {- return json.post('/tasks/create', body)+ return fetch(`${baseURL}/tasks/create`, { method: 'POST', body })}/** @method post 更新任务。 */export function postTasksUpdate(body: Types.PostTasksUpdateBody): Promise<Types.TaskActionResult> {- return json.post('/tasks/update', { id: body.id, ...body.input })+ return fetch(`${baseURL}/tasks/update`, { method: 'POST', body: { id: body.id, ...body.input } })}/** @method post 暂停/恢复任务。 */export function postTasksToggle(body: Types.PostTasksToggleBody): Promise<Types.TaskActionResult> {- return json.post('/tasks/toggle', body)+ return fetch(`${baseURL}/tasks/toggle`, { method: 'POST', body })}/** @method post 删除任务。 */export function postTasksDelete(body: Types.PostIdBody): Promise<Types.SimpleActionResult> {- return json.post('/tasks/delete', body)+ return fetch(`${baseURL}/tasks/delete`, { method: 'POST', body })}/** @method post 立即运行任务。 */export function postTasksRun(body: Types.PostIdBody): Promise<Types.SimpleActionResult> {- return json.post('/tasks/run', body)+ return fetch(`${baseURL}/tasks/run`, { method: 'POST', body })}/** @method get 查询执行记录。 */export function getHistory(query?: Types.GetHistoryQuery): Promise<Types.RunsResponse> {- return json.request(`/history${query?.taskId ? `?taskId=${encodeURIComponent(query.taskId)}` : ''}`)+ return fetch(`${baseURL}/history${query?.taskId ? `?taskId=${encodeURIComponent(query.taskId)}` : ''}`)}/** @method post 删除执行记录。 */export function postHistoryDelete(body: Types.PostIdBody): Promise<Types.SimpleActionResult> {- return json.post('/history/delete', body)+ return fetch(`${baseURL}/history/delete`, { method: 'POST', body })}/** @method get 查询面板选项。 */export function getOptions(): Promise<Types.SchedulerOptions> {- return json.request('/options')+ return fetch(`${baseURL}/options`)}/** @method post 触发宿主自愈恢复。 */export function postRecover(): Promise<unknown> {- return json.post('/recover', {})+ return fetch(`${baseURL}/recover`, { method: 'POST', body: {} })}diff --git a/packages/dsh-tauri-rightclick/src/client/apis/index.ts b/packages/dsh-tauri-rightclick/src/client/apis/index.tsindex 34e625c1..a24cbe2e 100644--- a/packages/dsh-tauri-rightclick/src/client/apis/index.ts+++ b/packages/dsh-tauri-rightclick/src/client/apis/index.ts@@ -1,13 +1,13 @@import type * as Types from './index.type'-import { requestJson } from 'dsh-tauri/client'+import { fetch } from 'dsh-tauri/client'import { OPEN_PATH_ROUTE, OPEN_URL_ROUTE } from '../constants'/** @method post 用系统默认浏览器打开外链。 */export function postOpenUrl(body: Types.OpenUrlPayload): Promise<Types.ActionResult> {- return requestJson(OPEN_URL_ROUTE, '', { method: 'POST', body: JSON.stringify(body) })+ return fetch(OPEN_URL_ROUTE, { method: 'POST', body })}/** @method post 在系统文件管理器中打开目录。 */export function postOpenPath(body: Types.OpenPathPayload): Promise<Types.ActionResult> {- return requestJson(OPEN_PATH_ROUTE, '', { method: 'POST', body: JSON.stringify(body) })+ return fetch(OPEN_PATH_ROUTE, { method: 'POST', body })}diff --git a/packages/dsh-tauri-session/src/client/apis/index.ts b/packages/dsh-tauri-session/src/client/apis/index.tsindex a8c6bc9f..9a69d0b4 100644--- a/packages/dsh-tauri-session/src/client/apis/index.ts+++ b/packages/dsh-tauri-session/src/client/apis/index.ts@@ -1,58 +1,45 @@import type * as Types from './index.type'-import { createJsonClient } from 'dsh-tauri/client'+import { fetch } from 'dsh-tauri/client'import { SESSION_API_PREFIX } from '../../shared/constants'-import { text } from '../locales'export const baseURL = SESSION_API_PREFIX-/** 绑定 API 前缀的 JSON 客户端(超时与错误文案由 dsh-tauri 统一归一)。 */-const json = createJsonClient(baseURL, {- timeoutMs: 15_000,- errorMessage: (status, body) => {- const error = body && typeof body === 'object' && typeof (body as { error?: unknown }).error === 'string'- ? (body as { error: string }).error- : ''- return error || text('requestFailed', { status })- },- timeoutMessage: text('requestTimeout'),-})-/** @method get 查询归档会话列表。 */export function getArchived(): Promise<Types.ArchivedListPayload> {- return json.request('/archived')+ return fetch(`${baseURL}/archived`)}/** @method post 在系统文件管理器中打开归档会话的数据目录。 */export function postOpenSessionDir(body: Types.PostOpenSessionDirBody): Promise<Types.SessionActionResult> {- return json.post('/open-path', body)+ return fetch(`${baseURL}/open-path`, { method: 'POST', body })}/** @method post 归档单个会话。 */export function postArchive(body: Types.PostArchiveBody): Promise<Types.ArchivedListPayload> {- return json.post('/archive', body)+ return fetch(`${baseURL}/archive`, { method: 'POST', body })}/** @method post 取消归档(会话回到其工作区组保留的位置)。 */export function postUnarchive(body: Types.PostSessionIdBody): Promise<Types.SessionActionResult> {- return json.post('/unarchive', body)+ return fetch(`${baseURL}/unarchive`, { method: 'POST', body })}/** @method post 彻底删除一个归档会话(宿主移除 + 物理删除会话数据,不可恢复)。 */export function postDelete(body: Types.PostSessionIdBody): Promise<Types.SessionActionResult> {- return json.post('/delete', body)+ return fetch(`${baseURL}/delete`, { method: 'POST', body })}/** @method post 归档整个工作区组(一次写入多条记录)。 */export function postArchiveWorkspace(body: Types.PostArchiveWorkspaceBody): Promise<Types.ArchivedListPayload> {- return json.post('/archive-workspace', body)+ return fetch(`${baseURL}/archive-workspace`, { method: 'POST', body })}/** @method post 清空归档(全部会话彻底删除,不可恢复)。 */export function postClear(): Promise<Types.SessionActionResult> {- return json.post('/clear', {})+ return fetch(`${baseURL}/clear`, { method: 'POST', body: {} })}/** @method post 删除项目内的全部归档会话。 */export function postDeleteWorkspace(body: Types.PostDeleteWorkspaceBody): Promise<Types.SessionActionResult> {- return json.post('/delete-workspace', body)+ return fetch(`${baseURL}/delete-workspace`, { method: 'POST', body })}diff --git a/packages/dsh-tauri-worktree/src/client/apis/index.ts b/packages/dsh-tauri-worktree/src/client/apis/index.tsindex bed8f65a..a3411b47 100644--- a/packages/dsh-tauri-worktree/src/client/apis/index.ts+++ b/packages/dsh-tauri-worktree/src/client/apis/index.ts@@ -1,34 +1,31 @@import type * as Types from './index.type'-import { createJsonClient } from 'dsh-tauri/client'+import { fetch } from 'dsh-tauri/client'import { WORKTREE_API_PREFIX } from '../../shared/constants'export const baseURL = WORKTREE_API_PREFIX-/** 绑定 API 前缀的 JSON 客户端(错误归一由 dsh-tauri 统一承担)。 */-const json = createJsonClient(baseURL)-/** @method get 查询某会话的工作树状态。 */export function getStatus(query: Types.GetStatusQuery): Promise<Types.WorktreeStatus> {const jobId = query.jobId ? `&jobId=${encodeURIComponent(query.jobId)}` : ''- return json.request(`/status?sessionId=${encodeURIComponent(query.sessionId)}${jobId}`)+ return fetch(`${baseURL}/status?sessionId=${encodeURIComponent(query.sessionId)}${jobId}`)}/** @method post 为预分配的新会话创建工作树。 */export function postCreate(body: Types.PostCreateBody): Promise<Types.WorktreeCreate> {- return json.post('/create', body)+ return fetch(`${baseURL}/create`, { method: 'POST', body })}/** @method post 将已创建的 worktree 会话归属到源项目 Workspace。 */export function postAttach(body: Types.PostAttachBody): Promise<{ ok: boolean, workspaceId: string }> {- return json.post('/attach', body)+ return fetch(`${baseURL}/attach`, { method: 'POST', body })}/** @method post 检出本地(分支名客户端已 trimmed)。 */export function postCheckout(body: Types.PostCheckoutBody): Promise<Types.WorktreeCheckout> {- return json.post('/checkout', body)+ return fetch(`${baseURL}/checkout`, { method: 'POST', body })}/** @method post 放弃更改:删除工作树并解除绑定,会话保留。 */export function postDiscard(body: Types.PostDiscardBody): Promise<Types.WorktreeDiscard> {- return json.post('/discard', body)+ return fetch(`${baseURL}/discard`, { method: 'POST', body })}diff --git a/packages/dsh-tauri/src/client/apis/client.test.ts b/packages/dsh-tauri/src/client/apis/client.test.tsindex 24dc33e1..07dd393e 100644--- a/packages/dsh-tauri/src/client/apis/client.test.ts+++ b/packages/dsh-tauri/src/client/apis/client.test.ts@@ -1,16 +1,64 @@-import { describe, expect, it } from 'vitest'-import { parseJsonResponse } from './client'+import { createServer, type Server } from 'node:http'+import { afterAll, beforeAll, describe, expect, it } from 'vitest'+import { fetch } from './index'-describe('parseJsonResponse', () => {- it('decodes a JSON response body', () => {- expect(parseJsonResponse('{"ok":true}')).toEqual({ ok: true })+let server: Server+let base: string++beforeAll(async () => {+ server = createServer((req, res) => {+ const chunks: Buffer[] = []+ req.on('data', chunk => chunks.push(chunk as Buffer))+ req.on('end', () => {+ const body = Buffer.concat(chunks).toString('utf8')+ if (req.url === '/ok') {+ res.writeHead(200, { 'content-type': 'application/json' })+ res.end('{"ok":true}')+ }+ else if (req.url === '/bad') {+ res.writeHead(400, { 'content-type': 'application/json' })+ res.end(JSON.stringify({ error: 'boom' }))+ }+ else if (req.url === '/oops') {+ res.writeHead(500, { 'content-type': 'text/plain' })+ res.end('oops')+ }+ else if (req.url === '/echo' && req.method === 'POST') {+ res.writeHead(200, { 'content-type': 'application/json' })+ res.end(JSON.stringify({ got: body }))+ }+ else {+ res.writeHead(404)+ res.end()+ }+ })+ })+ await new Promise<void>(resolve => server.listen(0, '127.0.0.1', resolve))+ const address = server.address()+ if (!address || typeof address === 'string')+ throw new Error('no test server address')+ base = `http://127.0.0.1:${address.port}`+})++afterAll(async () => {+ await new Promise<void>((resolve, reject) => server.close(error => error ? reject(error) : resolve()))+})++describe('dsh-tauri fetch', () => {+ it('decodes JSON success bodies via parseResponse', async () => {+ await expect(fetch(`${base}/ok`)).resolves.toEqual({ ok: true })+ })++ it('normalizes non-2xx bodies into readable errors (error field first)', async () => {+ await expect(fetch(`${base}/bad`)).rejects.toThrow('请求失败 (400): boom')})- it('preserves a legacy plain-text error body for error normalization', () => {- expect(parseJsonResponse('not found')).toBe('not found')+ it('falls back to status text when the body carries no error field', async () => {+ await expect(fetch(`${base}/oops`)).rejects.toThrow('请求失败 (500): oops')})- it('returns undefined for an empty body', () => {- expect(parseJsonResponse('')).toBeUndefined()+ it('posts JSON objects with content-type handled by ofetch', async () => {+ const result = await fetch<{ got: string }>(`${base}/echo`, { method: 'POST', body: { a: 1 } })+ expect(JSON.parse(result.got)).toEqual({ a: 1 })})})diff --git a/packages/dsh-tauri/src/client/apis/client.ts b/packages/dsh-tauri/src/client/apis/client.tsdeleted file mode 100644index ac691f60..00000000--- a/packages/dsh-tauri/src/client/apis/client.ts+++ /dev/null@@ -1,101 +0,0 @@-/**- * client/http.ts — 基于 ofetch 的统一 JSON HTTP 客户端(全 workspace 客户端共享)。- *- * 替换各自手写的 fetch 封装:ofetch 负责 URL 拼接、JSON 解析、超时(timeout 选项)、- * 重试(默认关)与错误归一;本模块只保留领域语义——非 2xx 抛「可展示」Error、- * 按插件需要配置 timeoutMs/错误信息。- */--import { createFetch } from 'ofetch'--/** 每个 JSON 请求的可选领域语义。 */-export interface JsonRequestOptions {- /** 超时(毫秒);未设置时无超时(沿用 ofetch 默认)。 */- timeoutMs?: number- /** 非 2xx 时的自定义错误信息;默认取响应体 error 字段。 */- errorMessage?: (status: number, body: unknown) => string- /** 超时错误信息。 */- timeoutMessage?: string-}--function defaultErrorMessage(status: number, body: unknown): string {- const text = typeof body === 'string'- ? body- : body && typeof body === 'object' && 'error' in body- ? String((body as { error?: unknown }).error ?? '')- : ''- return text ? `请求失败 (${status}): ${text}` : `请求失败 (${status})`-}--/**- * JSON 响应优先解码;旧宿主/未注册路由返回的纯文本错误体原样保留,交给- * onResponseError 归一化成可读错误,而不是让 JSON.parse 抛 SyntaxError。- */-export function parseJsonResponse(text: string): unknown {- if (text.length === 0)- return undefined- try {- return JSON.parse(text)- }- catch {- return text- }-}--function withJsonContentType(headersInit: HeadersInit | undefined, body: unknown): Headers {- const headers = new Headers(headersInit)- // 与旧实现保持一致:仅在携带 body 时补 content-type,GET 不加。- if (!headers.has('content-type') && body !== undefined)- headers.set('content-type', 'application/json')- return headers-}--/** 模块级 ofetch 实例(关闭自动重试;重试策略由各插件显式决定)。 */-const jsonFetch = createFetch({- defaults: { retry: 0 },-})--/**- * 发起同源 JSON 请求并返回解析后的响应体。- * 非 2xx 抛 Error(默认含响应体 error 文本);超时抛 timeoutMessage。- * @param baseUrl API 前缀(如 /api/dsh-worktree)- * @param path 路由路径(如 /status)- * @param init 原生 fetch 选项(body 传 JSON.stringify 后的字符串)- * @param options 领域语义(超时 / 错误信息)- */-export async function requestJson<T>(- baseUrl: string,- path: string,- init: RequestInit = {},- options: JsonRequestOptions = {},-): Promise<T> {- const timeoutMs = options.timeoutMs- const timeoutEnabled = timeoutMs !== undefined && timeoutMs > 0- try {- return await jsonFetch<T>(`${baseUrl}${path}`, {- ...init,- headers: withJsonContentType(init.headers, init.body),- ...(timeoutEnabled ? { timeout: timeoutMs } : {}),- parseResponse: parseJsonResponse,- onResponseError: ({ response }) => {- throw new Error((options.errorMessage ?? defaultErrorMessage)(response.status, response._data))- },- })- }- catch (error) {- if (timeoutEnabled && error instanceof Error && (error.name === 'TimeoutError' || error.name === 'AbortError'))- throw new Error(options.timeoutMessage ?? '请求超时')- throw error- }-}--/** 创建绑定一个 API 前缀的小型 JSON 客户端(插件 client/rpc 的共享底座)。 */-export function createJsonClient(baseUrl: string, options: JsonRequestOptions = {}) {- return {- request: <T>(path: string, init?: RequestInit): Promise<T> => requestJson<T>(baseUrl, path, init, options),- post: <T>(path: string, body: unknown): Promise<T> => requestJson<T>(baseUrl, path, {- method: 'POST',- body: JSON.stringify(body),- }, options),- }-}diff --git a/packages/dsh-tauri/src/client/apis/index.ts b/packages/dsh-tauri/src/client/apis/index.tsindex f7f2ad53..cbb034cb 100644--- a/packages/dsh-tauri/src/client/apis/index.ts+++ b/packages/dsh-tauri/src/client/apis/index.ts@@ -1,6 +1,43 @@/**- * apis/index.ts — 客户端 RPC/HTTP 层 barrel:ofetch 统一 JSON 客户端。- * 由原 http.ts 收口而来(http.ts → apis/client.ts)。+ * apis/index.ts — 客户端 RPC/HTTP 层:全局 fetch(ofetch 统一 JSON 客户端)。+ *+ * 唯一导出 `fetch`:ofetch 负责 URL 拼接、JSON 解析(parseResponse 优先解码,+ * 旧宿主/未注册路由返回的纯文本错误体原样保留)、超时(timeout 选项)与+ * 重试(默认关)。错误归一(非 2xx → 可展示 Error,取响应体 error 字段)内置+ * 在此,调用方无需关心错误格式、无需自封装 requestJson/createJsonClient。*/-export * from './client'+import { createFetch } from 'ofetch'++/** JSON 响应优先解码;非 JSON 纯文本错误体保留原文。 */+function parseJsonResponse(text: string): unknown {+ if (text.length === 0)+ return undefined+ try {+ return JSON.parse(text)+ }+ catch {+ return text+ }+}++/** 非 2xx 默认错误信息:优先取响应体 error 字段,否则回退状态码文案。 */+function defaultErrorMessage(status: number, body: unknown): string {+ const text = typeof body === 'string'+ ? body+ : body && typeof body === 'object' && 'error' in body+ ? String((body as { error?: unknown }).error ?? '')+ : ''+ return text ? `请求失败 (${status}): ${text}` : `请求失败 (${status})`+}++/** 全局 JSON fetch:同源 API 请求唯一入口(错误解析统一在此)。 */+export const fetch = createFetch({+ defaults: {+ retry: 0,+ parseResponse: parseJsonResponse,+ onResponseError: ({ response }) => {+ throw new Error(defaultErrorMessage(response.status, response._data))+ },+ },+})diff --git a/packages/dsh-tauri/src/client/index.ts b/packages/dsh-tauri/src/client/index.tsindex a337228c..ac3dedff 100644--- a/packages/dsh-tauri/src/client/index.ts+++ b/packages/dsh-tauri/src/client/index.ts@@ -4,7 +4,8 @@* 共享工具(供各插件 client 导入 `dsh-tauri/client`):* - compat / resolveStartSession:Alpha ↔ rc.2 服务布局适配;* - store:框架无关 SnapshotStore(uSES 安全);- * - http:ofetch 统一 JSON 客户端(requestJson / createJsonClient);+ * - fetch:ofetch 统一 JSON 客户端(错误解析内置,唯一导出);+ * - storage:unstorage createStorage / localStorageDriver;* - controller:hookable 生命周期控制器(observer/timer/listener 收敛);* - CssRender:css-render 样式树(各插件 mount*Styles 使用)。*/