release: bump version to 0.62.0
Some checks failed
ci / backend (push) Has been cancelled
ci / frontend (push) Has been cancelled
ci / delivery (push) Has been cancelled
release / images (push) Has been cancelled

This commit is contained in:
linkong
2026-05-21 01:37:32 +08:00
parent 5c65ee24d6
commit fbca381512
138 changed files with 21303 additions and 5721 deletions

View File

@@ -35,7 +35,11 @@
- [Docs Gatekeeper 鉴权系统计划](/home/ray/dev/linkong/planet/docs/plans/docs-gatekeeper-auth-plan.md)
- [Location Resolver 共享管线计划](/home/ray/dev/linkong/planet/docs/plans/location-resolver-shared-pipeline-plan.md)
- [frontend-ai-playground-development-plan.md](/home/ray/dev/linkong/planet/docs/plans/frontend-ai-playground-development-plan.md)
- [AI Provider OpenClaw-Style Routing Plan](/home/ray/dev/linkong/planet/docs/plans/ai-provider-openclaw-style-routing-plan.md)
- [统一集成配置 Schema 系统计划](/home/ray/dev/linkong/planet/docs/plans/integration-config-schema-system-plan.md)
- [Lightweight Agent Orchestrator 与 WebSearch 证据层计划](/home/ray/dev/linkong/planet/docs/plans/agents-light-orchestrator-websearch-plan.md)
- [Admin Next Parity Checklist](/home/ray/dev/linkong/planet/docs/plans/admin-next-parity-checklist.md)
- [Admin Next Parity Audit Closeout](/home/ray/dev/linkong/planet/docs/plans/admin-next-parity-audit-closeout-plan.md)
- [ue5-mvp-fused-plan.md](/home/ray/dev/linkong/planet/docs/plans/ue5-mvp-fused-plan.md)
不适合放入这里的内容:

View File

@@ -0,0 +1,128 @@
# Admin Next 双轨全量迁移修正计划
## Summary
`/admin-next/*` 继续作为新版影子路由开发,旧 AntD 控制台必须完整保留作为生产回退和行为对照。只有新版完成全功能 parity 并通过验收后,才能逐个切换旧路由;删除旧页面和移除 AntD 必须作为最后独立步骤,并等待明确确认。
## Hard Rules
- 未完成 parity checklist 前,不删除旧页面、不移除 AntD、不切旧入口。
- “旧版能删除”只表示新版能力达到替代标准,不表示立即删除旧版。
- 新版不能只做看板旧版里可新增、编辑、删除、测试、触发、批量、轮询、WebSocket、权限控制、错误提示和确认弹窗的能力都必须迁移。
- `/admin-next/*` 可以重做交互和视觉但业务语义、API payload、权限和危险操作保护必须对齐旧版。
## Design Direction
- 风格采用“朴素工具化 + 轻微立体触感”:灰白/暗色低对比背景、清晰 1px 边框、轻微凸起/按下态、克制圆角、图标少量彩色。
- 禁止回到 soft-glass、hero、大发光、大渐变、大色块和装饰性卡片。
- 常规动作默认 icon-only + tooltip刷新、重启、退出、复制、查看、编辑、删除、关闭、设置。
- 强意图动作保留实心文字按钮:保存、创建、确认、执行、测试连接。
- 页面统一 `16px` 外边距、`16px` 主区块间距、`12px` 面板 header/body 间距;表格标题和表体不能贴边。
- 所有页面遵守一屏工作台:`PageHeader` 之外只允许一个主内容区域吃满剩余高度;详情区、表格区和 Playground 消息区内部滚动,不能被父级裁掉。
- 页内 tabs 必须按旧版用户心智组织,而不是按后端接口名拆散;接口状态只能作为分区内部信息。
## Implementation Plan
1. 恢复旧版安全网:恢复旧 AntD 页面、旧 `AppLayout`、旧 helper、AntD 依赖和旧路由;保留 `/admin-next/*` 影子路由。
2. 建立新版基础层:整理 admin-next token、按钮、tooltip、theme switch、sidebar account、`EntityTable``FormDialog``ConfirmDialog``DetailPanel`、移动端表格/卡片切换。
3. 拆掉通用看板页每个模块建立真实业务页面、API adapter、form/mutation、轮询或 WebSocket 逻辑,不再用万能 Resource table 聚合展示。
4. 按模块迁移:
- Dashboard统计、WebSocket、健康检查、重启任务、任务日志、恢复探测。
- DataSources内置源/自定义源/实时源、详情、stats、task-status、启停、触发、批量触发、清理数据。
- DataList列表、summary、sources/types/countries、搜索、筛选、分页、详情、导出、分布。
- Collection Managementconfigs CRUD、builtin connect/test、target schemas、mappings、run/stop、stream status。
- Settingssystem、notifications、security、SMTP、TV、integrations、collectors、测试连接、凭证指南。
- AIprovider、web search、OCR、prompt registry、playground 完整会话操作。
- Earth Contentbrand、upload、delete/reset、boundary config/build/status、TV/content。
- Logssources、level/date/search、刷新、详情、复制、tail/snapshot。
- BGPoverview、collectors、incidents、anomalies、events、AI briefs。
- Alerts系统告警、BGP 告警、态势告警,包含 ack/resolve/stats/brief。
- Userslist/create/edit/delete、role、Gatekeeper groups、权限显示。
- Auth登录、注册、验证邮箱、重发、找回、重置、logout。
5. 每完成一个模块,对照旧页面跑 checklist只有全部模块通过后才提出旧路由切换和旧版删除。
## Test Plan
- 恢复阶段:`cd frontend && /home/ray/.bun/bin/bun install && /home/ray/.bun/bin/bun run build`
- 旧路由检查:`/admin``/datasources``/settings``/ai``/logs` 必须继续打开旧版。
- 新路由检查:`/admin-next/*` 必须继续打开新版。
- 每模块 parity读写删、测试连接、触发、批量、轮询、WebSocket、权限、错误提示、确认弹窗、移动端和滚动。
- 视觉检查light/dark/system、低高度窗口、125%/150% 缩放、按钮/状态/badge 等高、无双滚动条。
## Parity Checklist
### Dashboard
- [x] `/dashboard/stats` 数据展示与旧版一致。
- [x] WebSocket 连接状态、健康状态、自动刷新语义一致。
- [x] 重启任务创建、轮询、日志查看、失败提示和恢复探测一致。
### DataSources
- [x] 内置源、自定义源、实时源分区清晰,不混表。
- [x] 详情、stats、task-status、enable/disable、trigger、trigger-batch、trigger-all、delete-data 与旧版一致。
- [x] 实时源 start/stop/restart、连接状态、任务状态与旧版一致。
### DataList
- [x] 列表、summary、sources/types/countries、搜索、筛选、分页参数与旧版一致。
- [x] 详情 metadata、分布摘要、JSON/CSV 导出与旧版一致。
- [x] 表格固定列、横向滚动、移动端卡片模式可用。
### Collection Management
- [x] configs/all、configs CRUD、builtin connect/test、custom sample 与旧版一致。
- [x] target schemas、mappings preview/list/update/activate 与旧版一致propose/create 已提供表单化入口。
- [x] run-mapped、stop-mapped、stream-status 与旧版一致。
### Settings
- [x] system、notifications、security、SMTP、TV、integrations、collectors 表单字段完整。
- [x] SMTP test、AI/Web/OCR secrets、connect tests、preset refresh 与旧版一致。
- [x] credential guides、cache 清理、危险操作确认一致。
### AI
- [x] Provider、Web Search、OCR、Prompt Registry 配置保存/重置完整。
- [x] Playground thread/session/messages/status/stop/resend/edit 完整。
- [x] provider refresh、connect test、secrets 读取、错误提示和 loading 状态完整。
- [x] 页内 tabs 按旧版心智恢复为模型供应商、工具调用、提示词、Playground。
### Earth Content
- [x] brand get/save/delete/reset/upload 完整。
- [x] boundary status/config/build/build-status 完整。
- [x] TV/content 配置与旧版 Settings 入口一致。
### Logs
- [x] sources、level/date/search、limit、刷新参数与旧版一致。
- [x] 日志正文、详情展开、复制、空态和错误态完整。
### BGP
- [x] overview、collectors、incidents、anomalies、events 的 summary/list/detail 完整。
- [x] AI brief list/detail/generate 完整。
- [x] collector collect-location、刷新、结果详情和错误提示完整。
### Alerts
- [x] 系统告警 list/detail/ack/resolve/stats/AI brief 完整。
- [x] BGP incidents/anomalies/brief 完整。
- [x] 态势告警 stats/list/brief 完整。
### Users
- [x] list/create/edit/delete、role、Gatekeeper groups 完整。
- [x] 权限显示、普通用户限制和 super admin 行为一致。
### Auth
- [x] login/register/verify/resend cooldown/forgot/reset/logout/me 完整。
- [x] 未验证邮箱跳转、错误提示、成功跳转和 token store 行为一致。
### Hierarchy Repair
- [x] AI 不再按接口/状态拍平成一张表;模型供应商恢复为 provider -> model/API/key 层级。
- [x] 工具调用恢复为 Web Search/OCR -> provider/API/高级参数层级。
- [x] 提示词恢复为 group -> prompt 入口层级,保存/重置只作用于当前入口。
- [x] Settings/Earth 配置型页面使用父级列表 + 右侧正式表单,长内容在一屏内内部滚动。
### Interaction Polish
- [x] 不会产生歧义的刷新、复制、详情、批量、状态、清理等动作优先改为 icon-only + tooltip/title。
- [x] 强意图动作保留实心文字按钮,例如保存、创建、触发全部、生成简报、确认执行。
- [x] 按钮字号、高度、图标容器和 hover 触感统一,接近侧栏深色模式滑块的轻微立体风格。
- [x] 表格与详情之间增加可拖动竖向 resize handle低高度和窄屏下不制造额外滚动条。
### Page Information Architecture
- [x] 页内 tab 默认使用中文BGP、AI、OCR、Web Search、Playground、Schema 等专有名词按可识别性保留。
- [x] 信息观测类页面使用列表 + 详情,例如 BGP、Alerts、Logs、DataSources。
- [x] 配置管理类页面使用分层结构,例如 AI、Settings、Earth Content、Collection Management。
- [x] 采集管理已从纯表格看板改为分层管理:采集器、映射模板、目标 Schema、运行状态先选父级再编辑或执行动作。

View File

@@ -0,0 +1,135 @@
# Admin Next Parity Audit Closeout
Last updated: 2026-05-21
## Status
Admin Next has been promoted to the official admin route family. The old AntD admin, old layout helpers, `antd`, and `@ant-design/icons` remain available under `/legacy/admin/*` as the rollback and comparison surface.
`/admin-next/*` is now compatibility-only: old test links redirect to the official route. Do not add new capabilities there as a separate entry point.
This closeout document is the final work log for the second parity audit. It records what has been fixed, what still requires manual verification, and what must not be treated as complete.
## Fixed In This Audit
- Restored the dual-track rule: old AntD pages and routes are not deleted and are not replaced before parity sign-off.
- Reworked management pages away from flat status tables toward business hierarchy:
- AI: `模型供应商 / 工具调用 / 提示词 / Playground`.
- Settings: system display, notification policy, security policy, SMTP only.
- Earth Content: brand, boundary precision, TV content.
- Collection: collector, collection schedule, history/snapshot.
- Repaired AI provider credential semantics:
- Provider status now comes from that provider's stored key or a runtime key that is explicitly scoped to that provider.
- Generic `.env` fallback no longer marks every provider as configured.
- Runtime fallback secrets stay masked by default; authorized administrators can reveal them through the console and each reveal must be audited without storing plaintext.
- Secret previews preserve the prefix before the first `-` when the backend preview exposes it, for example `sk-**********`.
- Connect-test buttons are icon-only plug actions and do not save configuration.
- Repaired key UI gaps:
- LLM API Key, proxy token, Web Search API Key, and OCR API Key use masked input with inline eye toggle.
- Save buttons use the disk icon.
- Default action is disabled when the item is already default.
- Repaired SMTP test flow:
- SMTP test has a recipient input.
- Request payload is `{ to, settings }`.
- Repaired Earth Content actions:
- Brand save, upload, delete/reset actions are available in the brand section.
- Brand preview renders with the same Earth left-top brand structure and starfield-style background.
- Boundary build is scoped to the boundary precision section, not the global page toolbar.
- TV default configuration is folded into item-level configuration; TV items support add/default/reset/delete semantics.
- TV default source now follows the same default-state semantics as AI Provider: if the response does not expose an explicit default, `cgtn-en` is treated as the runtime default; setting a default promotes that item visually and disables the redundant default action.
- Repaired Collection actions:
- Credential guide read/generate/reset entry points are available from collector-related panels.
- Create collector config uses field-first form controls with advanced JSON as a secondary path.
- Mapping propose/preview/create/activate flow is represented in the mapping workflow.
- Repaired shared UI rules:
- Management list names can wrap and remain readable instead of being squeezed by status tags.
- Status tags are fixed width and color-coded: default blue, configured green, unconfigured gray, error red.
- Configuration lists with a default item sort the default item to the top after save/default changes instead of leaving it in the previous alphabetical or API order.
- List footer actions are part of the scroll content; users see them after scrolling to the bottom.
- Footer icon buttons use the current tactile surface direction: external shadow first, without a separate inset/base-plate treatment.
- Detail panels use a dark neutral resize handle.
- Tooltip, dialog, modal backdrop, textarea scrollbar, custom scrollbar, mobile detail, and one-screen layout issues from the audit have been addressed in the shared admin-next layer.
- Multi-tab Admin Next pages now use lazy active-tab loading with local cache. Initial page load no longer requests every section endpoint; manual refresh and mutating actions refresh only the current section.
- Markdown-producing details, AI brief content, credential tutorials, and Playground assistant output use the shared Markdown renderer where the content is meant to be read as a document. Raw metadata remains available only where the page is explicitly showing original payloads.
- Added developer workflow scripts:
- `build:watch`
- `preview:auto`
- `bun run build` remains a production artifact build and does not reload an already-open dev page by itself.
## Manual Verification Status
The code has been updated. The list below records which areas are already manually checked and which still need route-level regression before replacement:
- AI:
- Latest manual pass marked provider status, secret reveal, and Playground behavior as checked.
- DataSources:
- Single trigger performs old task-status precheck, handles running-conflict confirmation, supports force recollect, and refreshes task status afterward.
- Batch trigger uses old `/datasources/trigger-batch` semantics for selected IDs, filters, and force.
- Builtin, custom, and realtime source actions match old enable/disable/start/stop/restart/clear-data behavior.
- 2026-05-20 implementation pass: Admin Next builtin datasource rows now expose task/collection status and metrics, and single trigger now performs task-status precheck with running-conflict force confirmation plus post-trigger task refresh.
- 2026-05-20 manual pass: builtin trigger, task-status precheck, force recollect, batch trigger, enable/disable, and clear-data were verified in Admin Next.
- Collection:
- Collector config create/update/delete, builtin connect, custom test/sample/run/stop/status, schedule save, history/snapshot, mapping propose/preview/create/activate, and credential guide read/generate/reset all work with real backend payloads.
- 2026-05-20 implementation pass: `采集历史 / 快照` now reads real datasource snapshots from `/datasources/snapshots` instead of config rows.
- 2026-05-20 implementation pass: default credential guide actions no longer call unsupported providers blindly; unsupported collectors show a clear empty state and supported providers use `barentswatch` / `aisstream`.
- Collection action buttons must follow the AI page's single-responsibility rule: navigation/link actions do not save, save actions do not connect/test, and connect/test actions do not persist drafts.
- 2026-05-20 manual pass: collector create/edit `auth_config`, mapping propose/preview/create/activate, custom test/sample/run/stop/status, credential guide read/generate/reset, and history/snapshot behavior were verified in Admin Next.
- 2026-05-20 follow-up: dead JSON modal create/mapping code was removed so Collection creation now goes through the list-bottom draft workflow only.
- Earth Content:
- Brand preview visually matches the Earth runtime left-top brand at the same structural level.
- Brand upload writes back `logo_src` or `title_src` correctly.
- 2026-05-20 implementation pass: Brand upload validates and displays accepted suffixes (`png`, `jpg`, `jpeg`, `webp`, `svg`) and supports drag-and-drop.
- Boundary status/config/build and TV add/save/default/delete/reset match old behavior.
- Logs:
- Sources, snapshot/tail, level/date/search, copy, empty/error states, and internal scrolling all work.
- 2026-05-20 implementation pass: Logs now include database-backed `system-db` and `audit-db` sources as a fallback when file/docker/buffer logs are empty or missing, and the UI auto-selects an available source. Manual regression must still verify snapshot/tail-like reading, filters, copy, and scrolling.
- BGP / Alerts:
- BGP overview, collectors, collect-location detail, incidents, anomalies, events, latest/detail/generate AI brief.
- System/BGP/situational alert detail, ack, resolve with note, refresh after mutation, and AI brief details.
- Users/Auth:
- Users CRUD, role, Gatekeeper groups.
- 2026-05-20 implementation pass: User edit select dropdowns now use an opaque high-z-index menu surface, and Gatekeeper checkbox groups use an explicit surface background. Manual visual regression is still required.
- Login, register, verify email, resend cooldown, forgot/reset password.
- Mobile:
- 375px, 430px, and 768px widths default to list/group first.
- Detail opens only after tap/click and has a visible back action.
- Long forms, JSON, logs, and Playground messages scroll internally without body-level double scrollbars.
## Explicit Non-Production Items
The old AntD page itself treated these Earth content tabs as placeholder-level capabilities. Admin Next must show a visible “backend capability pending” empty state and must not mix in unrelated data:
- `basemap`
- `layer_resources`
- `models_3d`
- `news_anchor_strategy`
If backend endpoints are later added, these items must be promoted into `docs/plans/admin-next-parity-checklist.md` with concrete API and UI acceptance criteria.
## Final Gate
After the route promotion, the final gate is no longer “switch old routes.” The remaining gate is “keep legacy available until the promoted routes are stable enough to remove AntD.”
1. Run `cd frontend && /home/ray/.bun/bin/bun run build`.
2. Run the static checks:
- `rg "map: \\(\\) => \\[\\]|暂不支持保存|placeholder" frontend/src/admin-next`
- `rg "ShadowPage|FeatureConsole|GlassPanel|InspectorDrawer" frontend/src/admin-next`
3. Manually verify every official route listed in `docs/plans/admin-next-parity-checklist.md`.
4. Confirm `/legacy/admin/*` still opens old AntD pages during the validation window.
5. Delete old AntD pages and remove AntD dependencies only as a separate final cleanup task after explicit confirmation.
## Current Build Verification
Last successful local build during this closeout, after the 2026-05-20 follow-up fixes:
```bash
cd frontend && /home/ray/.bun/bin/bun run build
```
Result: passed.
Backend syntax check also passed:
```bash
/home/ray/.local/bin/uv run python -m py_compile backend/app/api/v1/datasources.py backend/app/api/v1/datasource_config.py backend/app/api/v1/system_control.py
```

View File

@@ -0,0 +1,43 @@
# Admin Next Parity Checklist
Last updated: 2026-05-21
This checklist is the hard gate for deleting the old AntD admin. Admin Next now owns the official admin routes; old AntD pages stay available under `/legacy/admin/*` until every production capability below is verified.
## Route Gate
- `/admin` Dashboard: stats, health probe, WebSocket status, restart task, restart logs, recovery probe.
- `/datasources`: builtin sources, custom sources, realtime sources, detail/stat/task-status, trigger, batch trigger, enable/disable, clear data, realtime start/stop/restart, custom source test/sample/run/stop/status link.
- `/data`: list, summary, source/type/country filters, search, pagination, detail metadata, export, distribution chart.
- `/collection-management`: collector config, mapping templates, target schemas, collection schedule, history/snapshot, create config, propose/preview/create/activate mapping, builtin connect, run/stop/stream-status, credential guide read/generate/reset.
- `/settings`: system display, notifications, security, SMTP get/save/test with recipient.
- `/ai`: model providers, tool calling, prompts, key reveal, provider refresh, connect tests, OCR/WebSearch secrets, Playground thread/chat/edit/resend/stop.
- `/earth-content`: brand preview as Earth renders it, upload/save/delete/reset, boundary status/build/config, TV source add/save/default/delete/reset.
- `/logs`: sources, filters, snapshot, empty/error states, copy.
- `/bgp`: overview, collectors, collect-location, incidents, anomalies, events, AI brief list/latest/detail/generate.
- `/alerts/system`, `/alerts/bgp`, `/alerts/situational`: list/stat/detail, ack, resolve with note, AI brief generation.
- `/users`: list/create/edit/delete, role, Gatekeeper permission groups.
- Auth pages: login, register, verify email, resend cooldown, forgot/reset password.
Compatibility routes under `/admin-next/*` should redirect to these official paths and are not a separate validation target.
## Verified Manual Passes
- 2026-05-20 `/admin-next/collection-management`: user verified collector create/edit payloads, mapping propose/preview/create/activate, custom collector test/sample/run/stop/status, credential guide read/generate/reset, and collection history/snapshot behavior after the draft-form and Time Capsule updates.
- 2026-05-20 `/admin-next/datasources`: user verified builtin source trigger, task-status precheck, force recollect, batch trigger, enable/disable, and clear-data behavior.
## Known Non-Production Tabs
The old AntD page also marked these Earth content tabs as placeholder-level capabilities. Admin Next must show them as “backend capability pending” and must not mix in unrelated data:
- `basemap`
- `layer_resources`
- `models_3d`
- `news_anchor_strategy`
## Replacement Rules
- Keep `/legacy/admin/*` available until the matching route gate above is manually verified after promotion.
- Do not delete old AntD pages, old layout helpers, `antd`, or `@ant-design/icons` until final explicit confirmation.
- Do not use fake rows, unrelated endpoint data, or empty adapters for a real old capability.
- Any backend-missing capability must be recorded here with the missing endpoint and visible UI empty state.

View File

@@ -0,0 +1,217 @@
# Admin Next Soft Glass Goal-Driven Plan
## Goal
Rebuild `/admin-next/*` into a modern soft-glass / light-neumorphic console while keeping the legacy Ant Design admin routes available for comparison. The new console must use visual references only as design anchors, not as imported templates, and must be implemented as Planet-owned reusable components and page patterns.
The redesign must cover desktop and mobile. Data display, icon semantics, table readability, and scroll behavior are first-class acceptance criteria.
## Criteria For Success
- This plan exists at `docs/plans/admin-next-soft-glass-goal-driven-plan.md`.
- `/admin-next/*` has real pages for every route; route usage of `ShadowPage` is removed.
- Admin Next supports `system`, `light`, and `dark` theme modes using the same persistence and system-theme idea as Docs.
- The visual language reads as soft-glass / light-neumorphic instead of an AntD reskin: translucent panels, fine borders, subtle glow, cool backgrounds, restrained accent colors, crisp icons, and tactile controls.
- Mobile is explicitly designed: mobile navigation, filter sheets/chips, card-list data views, full-screen detail sheets, and bottom action bars instead of squeezed desktop tables.
- Tables do not show double scrollbars. Long fields are inspectable, copyable, or expandable; important columns stay readable.
- Existing custom scrollbar components remain the default scroll experience.
- `cd frontend && bun run build` passes.
- Static checks can prove no route-level placeholder remains.
## Reference Strategy
Use references to calibrate feel, not to take over code:
- User-provided soft-glass / light-neumorphic dashboard images define the desired mood.
- Shadcn / Tailwind / glassmorphism admin templates may be inspected for shadow, spacing, panel, dark-mode, and app-shell ideas.
- Do not import a complete template, router, auth layer, state layer, or business page.
- Planet-specific interactions such as datasource tasks, BGP briefs, AI settings, log streams, Earth resources, and custom scrollbars are implemented in this repo.
## Source-Of-Truth Mining
Design content and page boundaries from existing repo history and docs:
- `docs/CHANGELOG.md`
- `docs/plans/*`
- `docs/technical/*frontend*`
- `TODO.md`
Important current boundaries:
- `DataSources` is a datasource directory and runtime-control page, not a configuration editor.
- `Collection Management` owns collector endpoint, credential, custom source, mapping, and runtime configuration.
- `Earth Content` owns TV livestreams, brand assets, boundary precision, basemap, and Earth display resources.
- `AI` owns provider settings, tools, prompts, and Playground.
- `BGP` is an observability and evidence workspace, not just tables.
- `Alerts` is a duty/analysis workspace for system, BGP, and situational risk.
- `Logs` should become a usable log workbench with filtering and structured detail.
- `Settings` should keep platform settings only.
## Reusable Architecture
Recommended structure:
- `admin-next/design`: theme tokens, theme mode, status colors, icon semantics, chart themes, scrollbar themes.
- `admin-next/components`: primitive UI such as button, input, select, tabs, dialog, drawer, badge, status pill, icon badge.
- `admin-next/patterns`: page patterns such as `PageFrame`, `GlassPanel`, `MetricCard`, `CommandBar`, `FilterRail`, `InspectorDrawer`, `DataWorkspace`, `SettingsWorkspace`, `ScrollableRegion`, `TableRegion`, and `MobileSheet`.
- `admin-next/features`: business modules such as datasources, data-list, bgp, alerts, ai, logs, settings, earth-content, collection-management, users.
- `admin-next/services`: feature API gateways and hooks. Pages should not scatter URL construction.
- `admin-next/routes`: route manifest used by navigation, command search, breadcrumbs, and legacy links.
## Interaction Rules
- Row click opens an inspector; frequent row actions live in the inspector header.
- Bulk selection opens a floating command bar.
- Common filters stay visible; advanced filters open a sheet/drawer.
- Detail, JSON, log context, and AI brief use inspector or reading panels instead of stacked modal dialogs.
- Settings are split into `FormSection` blocks with local save, dirty state, connection test, and reset.
- Dangerous actions use a confirm sheet.
- Loading, empty, error, and retry states are shared through reusable patterns.
## Mobile Rules
- Do not squeeze desktop layout into mobile.
- Use mobile navigation and sheets instead of a permanent desktop sidebar.
- Filters collapse into a filter sheet; active filters remain visible as chips.
- Data workspaces default to card-list mode on mobile and allow explicit table mode for dense comparison.
- Details open in full-screen mobile sheets.
- Batch actions use a sticky bottom command bar.
- Long logs and JSON use full-screen reading/editing surfaces with custom scrollbars.
## Table And Data Display Rules
- Tables must prioritize complete data display:
- key columns get stable widths and priority;
- long fields have peek/expand or inspector detail;
- IDs, URLs, metadata, and errors are copyable;
- complex fields are rendered fully in inspector.
- Desktop tables use one `TableRegion` scroll container.
- Mobile defaults to card-list display and supports dense table mode.
- Native scrollbar visuals are hidden where custom scrollbars apply.
## Icon Rules
- Use `lucide-react`.
- Define icon semantics by category:
- navigation icon;
- entity icon;
- status icon;
- action icon;
- severity icon.
- Icons must not be the only semantic carrier unless the icon is universally obvious; use labels or tooltips.
- Status icons pair with `StatusPill`.
- Colors come from tokens, not ad hoc hard-coded values.
## Page Design
### Dashboard
- System health, realtime connection, datasource activity, task trend, alert summary, recent events, and quick commands.
- Restart flow uses a confirm sheet and log console.
- Mobile uses horizontal metric cards and collapsible event/command panels.
### DataSources
- Datasource directory and runtime control.
- Desktop: overview rail, datasource table/list, inspector.
- Mobile: datasource cards with status, latest task, trigger/toggle actions.
- Batch trigger uses command bar.
- Endpoint/config/task details are shown fully in inspector.
### DataList
- Collection result browsing, search, source/type filters, paging, distribution chart, and detail inspector.
- Fix double scrollbars.
- Mobile defaults to cards and allows table mode.
### BGP
- Views: collectors, incidents, anomalies, events, AI brief.
- Emphasize severity, region, ASN/prefix, collector coverage, and evidence.
- AI brief shows facts, judgment, and evidence gaps.
### Alerts
- Real pages for system, BGP, and situational alerts.
- Shared alert workspace with stats, severity/status filters, list, and inspector.
- AI brief appears in inspector/mobile sheet.
### AI
- Provider, tools, prompts, and Playground.
- Provider and tool settings use local save and connection tests.
- Prompt registry is grouped by task.
- Mobile Playground uses step tabs rather than cramped columns.
### Logs
- Log workbench with source, level, date, search, refresh, copy, and structured detail.
- Desktop uses a terminal-like log stream.
- Mobile rows expand or open a full-screen reading sheet.
### Users
- Search, role filter, create/edit/delete, Gatekeeper groups.
- Edit/create in drawer/sheet.
- Gatekeeper groups use checkbox chips.
### Settings
- Platform settings only: system, notification, security, SMTP.
- Each section saves independently.
### Earth Content
- TV livestreams, brand assets, boundary precision, basemap, and layer resources.
- Resource previews, upload state, and boundary build status are emphasized.
### Collection Management
- Collector config, custom sources, mapping, runtime control.
- Custom source creation uses a step sheet.
- Advanced JSON is isolated in a collapsible editor.
## Milestones
1. Save this plan and establish goal-driven criteria.
2. Build design/theme/pattern foundations.
3. Remove route-level placeholders and create real pages for all `/admin-next/*` routes.
4. Redesign layout, theme, mobile shell, scroll behavior, and table behavior.
5. Fill core workspaces with real API calls and reusable patterns.
6. Verify build, no `ShadowPage` route usage, and core route availability.
## Verification
Run:
```bash
cd frontend && bun run build
rg "ShadowPage" frontend/src/admin-next
rg "axios\\." frontend/src/admin-next/pages
rg "overflow: auto|overflow-y: auto" frontend/src/admin-next
```
Manual route checks:
- `/admin-next`
- `/admin-next/datasources`
- `/admin-next/data`
- `/admin-next/bgp`
- `/admin-next/alerts/system`
- `/admin-next/alerts/bgp`
- `/admin-next/alerts/situational`
- `/admin-next/ai`
- `/admin-next/logs`
- `/admin-next/users`
- `/admin-next/settings`
- `/admin-next/earth-content`
- `/admin-next/collection-management`
Manual viewport checks:
- desktop;
- mobile width;
- low height;
- 125% / 150% browser zoom;
- light / dark / system theme modes.

View File

@@ -0,0 +1,182 @@
# AI Provider OpenClaw-Style Routing Plan
Last updated: 2026-05-20
## Summary
Planet 的 AI Provider 路由要从“运行时识别特殊 provider / 特殊模型”收敛到 OpenClaw 风格的配置驱动模型:模型引用、协议、鉴权、轻量探测、真实调用和模型级例外都由 provider catalog / preset / runtime metadata 描述,运行时只解释这些元数据,不再散落 `if provider == ... and model == ...` 这类硬编码。
这份计划覆盖 Admin Next 的 Provider 配置体验、backend settings API、`aiprovider` 适配服务和未来模型目录同步方式。目标是让 OpenCode Go、MiniMax、DeepSeek、OpenAI-compatible、Anthropic-compatible、Ollama、OpenRouter / One API 类代理都能用同一套规则扩展。
## Background
当前实现已经完成了两步临时修正:
- OpenCode Go 模型目录不再使用普通 Zen free 列表,而是使用 `https://opencode.ai/zen/go/v1/models`
- `minimax-m2.7` / `minimax-m2.5` 的协议例外已从 `aiprovider` 运行逻辑移到 `model_provider_apis` 元数据中。
但整体还没有完全达到 OpenClaw 式结构。OpenClaw 的关键思想是:
- 模型引用使用 `provider/model`,由 provider 前缀确定 runtime provider。
- provider 插件或 catalog 拥有 `normalizeModelId``normalizeTransport``normalizeConfig``prepareRuntimeAuth``createStreamFn` 等 provider 行为。
- 主推理循环不认识具体模型名,只使用解析后的 provider config、transport 和 request adapter。
- 上游网关能自己路由时,尽量透传 provider routing metadata不在本地复制上游逻辑。
Planet 不需要完整复制 OpenClaw 插件系统,但需要学习它的边界划分。
## Design Principles
- Provider catalog 是路由事实来源runtime 不是。
- 模型级协议例外必须是 metadata例如 `model_provider_apis`,不能是 Python set / if 分支。
- 轻量连通性测试只验证网络、鉴权和模型目录,不发真实 prompt。
- 真实模型调用只发生在 Playground、AI brief、分析任务等明确需要生成的路径。
- 保存配置不自动设为默认,不自动触发连接测试;保存、设默认、测试三种按钮职责分离。
- 目录刷新使用增量合并语义:发现新模型,标记旧模型 stale不直接删除用户选择或自定义模型。
- 如果 provider 不提供可靠 `/models`,可以用内置 preset 确认已知模型,但 UI 必须说清楚这是 preset confirmation不是假装 provider 返回了目录。
## Target Data Model
Provider preset / runtime config 应逐步收敛为类似结构:
```json
{
"provider": "opencode-go",
"label": "OpenCode Go",
"default_transport": "openai-completions",
"base_url": "https://opencode.ai/zen/go/v1",
"auth": {
"type": "bearer",
"api_key_env": "OPENCODE_GO_API_KEY"
},
"models": [
{
"id": "glm-5.1",
"label": "GLM 5.1",
"transport": "openai-completions",
"context_window": null,
"capabilities": ["text"]
},
{
"id": "minimax-m2.7",
"label": "MiniMax M2.7",
"transport": "anthropic-messages",
"capabilities": ["text", "reasoning"]
}
],
"discovery": {
"type": "openai-models",
"url": "https://opencode.ai/zen/go/v1/models",
"auth": "provider-api-key"
}
}
```
Runtime 选择规则:
1. 解析 provider。
2. 解析 model。
3.`models[].transport` 找模型级 transport。
4. 若没有模型级 transport使用 provider `default_transport`
5. 将解析结果传给 `aiprovider`
6. `aiprovider` 只按 `transport` 组装请求,不认识 provider 专属模型名。
## Implementation Plan
### Phase 1: Stabilize Current Metadata Path
- Keep `model_provider_apis` as the immediate compatibility bridge.
- Ensure `_provider_defaults()` includes provider metadata such as `model_provider_apis`.
- Ensure `_runtime_config_from_ai_payload()` sends the resolved metadata through `AIProviderClient`.
- Ensure `AIProviderClient` forwards metadata to `aiprovider` with a structured header.
- Ensure `aiprovider.ProviderService` reads model metadata and resolves `provider_api = model_provider_apis[model] ?? provider_api`.
- Add tests proving `aiprovider` does not contain provider/model-specific literals for routing decisions.
### Phase 2: Replace `model_provider_apis` With Structured Model Catalog
- Extend `backend/app/services/llm_provider_catalog.py` preset shape with `models_metadata`.
- Preserve old `models` as a compatibility list for the UI.
- Add helpers:
- `get_provider_model_metadata(provider, model)`
- `resolve_provider_transport(provider_config, model)`
- `merge_discovered_models(existing, discovered)`
- Return both `models` and `models_metadata` from refresh endpoints.
- Admin Next should render model labels, capabilities and transport hints from metadata.
### Phase 3: Provider Discovery And Incremental Sync
- Add provider discovery descriptors:
- OpenAI-compatible `/models`
- Anthropic-compatible no-models / preset-confirmed path
- Ollama `/api/tags`
- OpenCode Go `/zen/go/v1/models`
- OpenRouter / One API passthrough model discovery
- Add incremental merge behavior:
- New discovered model: add.
- Existing discovered model: update `last_seen_at`, metadata.
- Missing discovered model: mark `stale`, do not delete.
- User custom model: keep unless explicitly removed.
- Surface discovery source in Admin Next: `实时发现 / 内置预设 / 用户自定义 / 已过期`.
### Phase 4: Transport Adapters
- Replace provider-specific request decisions with adapter descriptors:
- `openai-completions`
- `anthropic-messages`
- `ollama-generate`
- future `openai-responses`
- future `gemini-generate-content`
- Each adapter owns:
- path
- auth header format
- request body transform
- response text extraction
- reasoning/thinking block extraction
- models endpoint strategy
- `ProviderService.analyze()` should select adapter by resolved transport and call the adapter.
### Phase 5: Admin Next UX
- Model provider page should show:
- provider status tag
- default model tag
- source tag: env / runtime / preset / discovered
- model list with transport/capability hint
- separate buttons for save, set default, refresh model catalog, lightweight test
- The connect plug button remains lightweight.
- Full generation test lives only in Playground or a clearly named “试运行” action.
- If lightweight test falls back to preset confirmation, toast must say so explicitly.
## TODO
- [ ] Add `models_metadata` to provider presets and refresh responses.
- [ ] Add runtime resolver helper for provider/model transport selection.
- [ ] Remove any remaining provider/model-specific literals from `aiprovider` runtime routing.
- [ ] Add tests that `opencode-go/minimax-m2.7` resolves through metadata, not through runtime hardcode.
- [ ] Add tests for lightweight connectivity:
- [ ] 401 / 403 fail as auth error.
- [ ] 404 with known preset model passes as preset-confirmed.
- [ ] `/models` missing alias passes only when preset contains the alias.
- [ ] unknown model fails.
- [ ] Add discovery descriptors for OpenCode Go, OpenAI-compatible, Anthropic-compatible, Ollama, OpenRouter / One API.
- [ ] Add incremental model catalog merge semantics with stale marking.
- [ ] Update Admin Next model list to show model source, transport and capability.
- [ ] Keep save / set default / lightweight test / full test as separate actions.
- [ ] Document the final provider catalog schema in technical docs after implementation.
## Current Acceptance Criteria
- No runtime routing branch may depend on concrete model names like `minimax-m2.7`.
- OpenCode Go model refresh must not use the ordinary Zen free-model endpoint.
- Lightweight connect must not call `analyze()` or consume generation quota.
- Saving a provider must not automatically set it as default.
- Provider UI must distinguish configured key, fallback key, preset model and live-discovered model.
## Related Files
- `backend/app/services/llm_provider_catalog.py`
- `backend/app/api/v1/settings.py`
- `backend/app/services/ai_client.py`
- `aiprovider/main.py`
- `aiprovider/provider_service.py`
- `frontend/src/admin-next/pages/PlainResourcePages.tsx`
- `docs/plans/admin-next-parity-audit-closeout-plan.md`

View File

@@ -0,0 +1,349 @@
# 统一集成配置 Schema 系统计划
Last updated: 2026-05-20
## Summary
Planet 的采集器、AI Provider 和工具调用配置需要从“页面各自硬编码字段”收敛到同一套低代码 schema 系统。系统负责两件事:
- 用后台可编辑 schema 生成配置表单。
- 按字段 target 把表单值组装成后端运行时需要的请求、凭证和 JSON 配置。
这套 schema 不替代 `target_schema_registry``target_schema_registry` 继续负责采集结果映射和校验;本计划中的 `integration_config_schemas` 负责“怎么配置一个集成”。
## Current Problems
- Admin Next 的采集器配置曾把不同凭证形态压成通用 `api_key`,导致 `barentswatch_vessels` 这种 OAuth client credentials 丢失 `client_id` 字段。
- AI Provider、Web Search、OCR 和 DataSource 配置各自维护表单字段、secret 处理和 payload 组装逻辑,重复且容易漂移。
- 新增字段时需要改前端字段列表和保存逻辑,无法做到后台配置化扩展。
## Target Model
新增统一 registry`integration_config_schemas`,存储在 `SystemSetting.payload`
Registry 包含:
- `fragments`:可复用字段片段,例如 endpoint、API Key、OAuth Client、HTTP 请求、WebSocket 订阅、AI Provider 基础字段、工具超时字段。
- `auth_schemas`:可复用认证编排,例如 API Key、Bearer Token、Basic、OAuth2 Client Credentials、OAuth2 Authorization Code、Session Cookie Login。
- `schemas`:具体配置对象使用的 schema例如 `datasource:barentswatch_vessels``ai_provider:minimax``tool:web_search:tavily`
- `defaults`:每类集成的默认 schema例如 `datasource``ai_provider``tool`
Schema 必须声明 `kind`
- `datasource`
- `ai_provider`
- `tool`
字段定义统一使用:
```json
{
"key": "client_secret",
"label": "Client Secret",
"type": "secret",
"secret": true,
"target": "auth_config.client_secret",
"required": true,
"wide": true
}
```
字段 target 支持写入:
- DataSource`root.*``auth_config.*``headers.*``config.*`
- AI Provider`ai_provider.*``ai_provider.providers.{provider}.*`
- Tool`web_search.*``web_search.providers.{provider}.*``ocr.*`
## Auth Schema Model
认证必须成为 schema 系统的一等能力,不能再把所有凭证强行压成 `api_key`。每个配置 schema 可以引用一个 `auth_schema`,也可以内联声明认证编排。
Auth schema 描述:
- 凭证字段:哪些字段是 secret、是否必填、写入哪个 target。
- 凭证来源DB、env fallback、运行时草稿、用户授权回调。
- 预认证请求例如登录接口、token endpoint、OAuth callback。
- 凭证注入方式header、query、form、JSON body、cookie jar、WebSocket subscription payload。
- reveal 策略:管理员可 reveal 并写 audit log无 DB/env 值时显示空。
- 测试策略:连接测试必须使用当前表单草稿优先,再 fallback 到已保存/env。
v1 需要支持的认证类型:
- `none`:无认证。
- `api_key`API Key 写入 header/query/form/body。
- `bearer_token`Bearer token header。
- `basic`username/password支持直接 Basic header 或 provider 特定登录。
- `oauth2_client_credentials`client_id/client_secret 换 access_token。
- `oauth2_authorization_code`:第三方登录授权,包含 authorize URL、callback、token exchange、refresh。
- `session_cookie_login`:用户名密码登录后保存 cookie jar再访问数据接口。
- `custom_auth_preflight`:无法归类时,用声明式 preflight 请求生成后续请求上下文。
Auth schema 示例:
```json
{
"key": "spacetrack_session",
"type": "session_cookie_login",
"fields": [
{
"key": "username",
"label": "Username",
"target": "auth_config.username",
"required": true
},
{
"key": "password",
"label": "Password",
"type": "secret",
"secret": true,
"target": "auth_config.password",
"required": true
}
],
"preflight": {
"method": "POST",
"url": "https://www.space-track.org/ajaxauth/login",
"body_type": "form",
"body": {
"identity": "{{auth_config.username}}",
"password": "{{auth_config.password}}"
},
"success": {
"type": "cookie"
}
},
"inject": {
"type": "cookie_jar"
}
}
```
OAuth Authorization Code 示例:
```json
{
"key": "github_oauth",
"type": "oauth2_authorization_code",
"fields": [
{ "key": "client_id", "target": "auth_config.client_id", "required": true },
{ "key": "client_secret", "type": "secret", "secret": true, "target": "auth_config.client_secret", "required": true },
{ "key": "scopes", "type": "tags", "target": "auth_config.scopes" }
],
"authorization": {
"url": "https://github.com/login/oauth/authorize",
"client_id": "{{auth_config.client_id}}",
"scopes": "{{auth_config.scopes}}",
"redirect_uri": "{{system.callback_base_url}}/api/v1/integrations/oauth/github/callback"
},
"token": {
"method": "POST",
"url": "https://github.com/login/oauth/access_token",
"body_type": "form",
"body": {
"client_id": "{{auth_config.client_id}}",
"client_secret": "{{auth_config.client_secret}}",
"code": "{{oauth.code}}",
"redirect_uri": "{{oauth.redirect_uri}}"
}
},
"inject": {
"type": "bearer_header",
"token_path": "access_token"
}
}
```
## Request And Runtime Assembly
这套系统本质是面向 Planet 集成的低代码 Postman但目标不是临时发请求而是沉淀成可保存、可测试、可调度、可审计的运行配置。
Schema 支持描述:
- HTTP method`GET``POST`
- endpoint
- headers
- query params
- JSON body / form body
- auth schema / auth config / preflight auth flow
- WebSocket endpoint 和 subscription payload
- AI Provider 的 `provider_api``base_url``model``api_key``service_token`
- Tool 的 provider、base_url、api_key、timeout 和工具专属参数
请求执行顺序:
1. 从 schema 字段 target 组装 root/auth_config/headers/config。
2. 如果存在 auth schema先解析凭证来源和草稿覆盖。
3. 需要 preflight 时执行认证请求,例如 token exchange 或 login。
4. 把认证结果注入正式请求,例如 bearer header、cookie jar、query token。
5. 执行连接测试、采样、采集、AI Provider connect 或 tool connect。
## Default Schemas
### DataSource
默认采集器:
- endpoint
- method
- headers JSON
- query/body/config JSON
- API Key auth
- advanced JSON
`barentswatch_vessels`
- endpoint
- Client ID -> `auth_config.client_id`
- Client Secret -> `auth_config.client_secret`
- fixed `auth_type = oauth_client`
`aisstream_vessels`
- WebSocket endpoint
- API Key -> `auth_config.api_key`
- subscription / bounding boxes config
`spacetrack_tle`
- API Base URL / endpoint
- Username -> `auth_config.username`
- Password -> `auth_config.password`
- auth schema = `session_cookie_login`
- login endpoint = `https://www.space-track.org/ajaxauth/login`
- login body fields`identity` / `password`
- run/test request uses returned session cookie
### AI Provider
默认字段:
- provider
- provider_api
- base_url
- model
- api_key
- max_tokens
- anthropic_version
- service_url
- service_token
- timeout_seconds
- retry_attempts
- model_provider_apis
Provider presets supply initial defaults, but the editable schema controls which fields appear and where values are saved.
AI Provider auth variants
- OpenAI-compatible providers`api_key` or `bearer_token`
- Local/sidecar services`none``service_token` or custom header。
- OAuth-backed providers`oauth2_authorization_code`,适用于需要用户授权登录的 provider。
- CLI/session-backed tools such as Codex优先作为 `tool` 或本机 runner 集成;如果作为 provider必须显式声明会话来源、权限边界、不可多用户复用的限制。
### Tool
`web_search`
- enabled
- provider / default_provider
- base_url
- api_key
- max_results
- timeout_seconds
- endpoint_path
- search_depth
- engine
- include_answer / include_raw_content / include_text
- search_path / scrape_path / scrape_formats
`ocr`
- enabled
- provider
- base_url
- api_key
- model
- languages
- timeout_seconds
- max_file_size_mb
- output_format
Tool auth variants
- GitHub PAT`bearer_token`
- GitHub OAuth App`oauth2_authorization_code`,适合用户授权登录和代表用户访问。
- GitHub App`app_installation`,需要 app id/private key/installation id并通过 schema 声明 installation token exchange。
- Browser/session tools必须显式标记为 `session_local_only`,不能作为后台多用户稳定凭证。
## API Plan
- `GET /api/v1/integration-config-schemas`
- Return the full registry.
- `PUT /api/v1/integration-config-schemas`
- Save the registry. Admin only.
- `POST /api/v1/integration-config-schemas/validate`
- Validate full registry or one schema.
- `POST /api/v1/integration-config-schemas/auth/test`
- Test auth schema with draft credentials without saving.
- `GET /api/v1/integration-config-schemas/auth/secrets`
- Reveal stored/env-backed secret fields for admins; write audit log.
- `POST /api/v1/integrations/oauth/{provider}/start`
- Start OAuth Authorization Code flow.
- `GET /api/v1/integrations/oauth/{provider}/callback`
- Complete OAuth callback and store token material according to schema.
- `GET /api/v1/datasources/configs/all`
- Add `form_schema` to each row.
- `GET /api/v1/settings/integrations`
- Add `form_schema` for AI Provider and tools.
Existing save APIs remain compatible:
- DataSource saves to `DataSourceConfig`.
- AI Provider, Web Search and OCR save to `external_integrations`.
Secret fields never return plaintext through list/config endpoints. They return configured state and masked preview only.
Secret reveal endpoints return plaintext only on explicit administrator action and must log target, actor, source, result and timestamp. List/config endpoints must never leak secret plaintext.
## Frontend Plan
Admin Next extracts a reusable `SchemaForm`:
- Render fields from `form_schema.fields`.
- Build payload by writing values to each field `target`.
- Preserve masked secret semantics: unchanged masked values do not overwrite stored secrets.
- Reveal secrets through a schema-aware reveal action; if neither DB nor env has a value, show an empty editable input.
- Support text, secret, number, boolean, select, textarea, JSON and tags controls.
- Support auth controls for API key, username/password, OAuth connect/disconnect, session cookie login and custom preflight status.
- Validate schema before saving registry changes.
Pages migrated in v1:
- Collection Management / collector configs.
- AI / Provider configuration.
- AI / Tools configuration for Web Search and OCR.
Each detail page gets a schema editing action for admins. The editor saves registry JSON after validation.
## Test Plan
- Default registry initializes with datasource, AI Provider and tool schemas.
- Validation rejects duplicate keys, illegal targets, illegal field types and secret plaintext defaults.
- `barentswatch_vessels` renders and saves `client_id` / `client_secret`.
- `spacetrack_tle` renders username/password, tests with draft credentials, and does not require API Key.
- `aisstream_vessels` renders API Key and WebSocket subscription fields.
- Session cookie login auth executes preflight before sample/run and uses the resulting cookie jar.
- OAuth Authorization Code schema can start callback flow, store token metadata and inject bearer token.
- Secret reveal returns DB value, env fallback or empty value according to source, and writes audit log.
- Connection tests always prefer current draft credentials over saved/env credentials.
- AI Provider renders and saves `provider_api`, `base_url`, `model`, `api_key` and `service_token`.
- AI Provider and tool schemas can reuse the same auth schema primitives as DataSource.
- Web Search and OCR render and save provider-specific tool fields.
- Adding a schema field in the registry makes it appear in Admin Next without frontend code changes.
- Existing connection tests, datasource sampling, datasource run, AI Provider connect/reveal/refresh, and Web Search connect keep working.
## Assumptions
- `target_schema_registry` remains separate because it describes collected result shape, not configuration forms.
- The first implementation stores schema registry in `SystemSetting`; no new database table is required.
- Old AntD Settings pages stay compatible but are not migrated in v1.
- Tool scope in v1 is Web Search and OCR.