release: bump version to 0.81.0
This commit is contained in:
1 parent
6d310f4dbe
commit
b3d2d9e9f1
156 files changed
+15910
-1385
No files matched your search
@@ -104,22 +104,26 @@ The AI settings page uses:
|
||||
|
||||
These endpoints require an authenticated user, and preset catalog refresh endpoints require administrator privileges. The `secrets` endpoint is only used when the settings page reveals a key or token; hiding the field restores the masked preview.
|
||||
|
||||
Model refresh and lightweight checks share `backend/app/services/llm_model_catalog.py` and query provider endpoints directly, without models.dev. Refresh uses the draft base URL, protocol and credentials, or saved configuration when no draft is supplied. Regional hosts and custom gateway paths are preserved. For official public catalogs (`openrouter.ai`, `opencode.ai`) and local Ollama, catalog refresh does not require or send an API key so stale or invalid credentials do not block public discovery; pointing those providers at a custom private gateway still requires and sends credentials. Lightweight connectivity checks continue sending configured credentials (Ollama remains key-free under both `ollama-generate` and `openai-completions`). Missing required credentials, invalid base URLs, or unsupported protocols return 400; upstream failures return 502 with safe errors and retain the previous catalog. `POST /api/v1/settings/integrations/ai-provider/presets/refresh-public` refreshes and persists all currently credential-free presets in one pass, isolating per-provider failures while preserving prior catalogs.
|
||||
Model refresh and lightweight checks share `backend/app/services/llm_model_catalog.py`. When an API key is configured (draft, saved, or env), refresh queries the provider endpoint directly while preserving regional hosts and custom gateway paths. For official public catalogs (`openrouter.ai`, `opencode.ai`) and local Ollama, catalog refresh does not require or send an API key so stale or invalid credentials do not block public discovery. For keyed built-in providers on their official hosts (`minimax`, `openai`, `anthropic`, `deepseek`, `alibaba`, `moonshotai`, `glm`, `meta`, `gemini`, `grok`), **keyless refresh automatically falls back to public aggregators** (`models.dev/api.json` primary -> `openrouter.ai/api/v1/models` backup, cached in-process for 5 minutes); pointing those providers at a custom private gateway still requires and sends credentials. Lightweight connectivity checks continue querying the configured endpoint directly with credentials (Ollama remains key-free under both `ollama-generate` and `openai-completions`) and never fall back to aggregators. Missing required credentials, invalid base URLs, or unsupported protocols return 400; upstream/aggregator failures return 502 with safe errors and retain the previous catalog. `POST /api/v1/settings/integrations/ai-provider/presets/refresh-public` refreshes and persists all currently credential-free and aggregator-backed presets in one pass, isolating per-provider failures while preserving prior catalogs.
|
||||
|
||||
Successful catalogs and `refreshed_at` are stored under `llm_provider_preset:<provider>` in `system_settings`. Dynamic categories use the provider preset as their defaults and are validated before committing. Listing prefers saved catalogs and otherwise shows bundled suggestions. Refresh never modifies the active model, protocol, URL or credentials in `external_integrations`. The frontend retains the draft and previously loaded models when listing fails, with an explicit error message.
|
||||
|
||||
### Model Catalog Endpoints
|
||||
|
||||
These endpoints were checked against official documentation on 2026-09-13. The table lists discovery URLs; the form still takes the generation base URL. Credentials must belong to the configured service region.
|
||||
These endpoints align with official and public aggregator catalogs. The table lists discovery URLs; the form still takes the generation base URL. Direct keyed queries must use credentials for the configured service region; keyless official hosts query mapped public aggregator catalogs.
|
||||
|
||||
| Provider | Model list GET endpoint | Authentication and parsing |
|
||||
| --- | --- | --- |
|
||||
| [MiniMax](https://platform.minimax.io/docs/api-reference/models/anthropic/list-models) | `https://api.minimaxi.com/anthropic/v1/models`; international: `api.minimax.io` | `x-api-key`; `data[].id`; `has_more/last_id` pagination |
|
||||
| [OpenAI](https://developers.openai.com/api/reference/resources/models/methods/list) | `https://api.openai.com/v1/models` | Bearer; `data[].id` |
|
||||
| [Anthropic](https://platform.claude.com/docs/en/api/models/list) | `https://api.anthropic.com/v1/models` | `x-api-key`, `anthropic-version`; paginate with `after_id` |
|
||||
| [DeepSeek](https://api-docs.deepseek.com/api/list-models) | `https://api.deepseek.com/v1/models` | Bearer; `data[].id` |
|
||||
| [Alibaba Model Studio](https://help.aliyun.com/zh/model-studio/list-models) | `/api/v1/models` on the configured regional host | Bearer; `output.models[].model`; `page_no/page_size/output.total`; filter `capabilities=TG` |
|
||||
| [Moonshot / Kimi](https://platform.kimi.ai/docs/api/list-models) | `https://api.moonshot.ai/v1/models`; China: `api.moonshot.cn` | Bearer; `data[].id` |
|
||||
| [MiniMax](https://platform.minimax.io/docs/api-reference/models/anthropic/list-models) | `https://api.minimaxi.com/anthropic/v1/models`; international: `api.minimax.io` | Keyed: `x-api-key` + `has_more/last_id`; keyless: aggregator `minimax-cn`/`minimax` |
|
||||
| [OpenAI](https://developers.openai.com/api/reference/resources/models/methods/list) | `https://api.openai.com/v1/models` | Keyed: Bearer; keyless: aggregator `openai` |
|
||||
| [Anthropic](https://platform.claude.com/docs/en/api/models/list) | `https://api.anthropic.com/v1/models` | Keyed: `x-api-key`, `anthropic-version`; keyless: aggregator `anthropic` |
|
||||
| [DeepSeek](https://api-docs.deepseek.com/api/list-models) | `https://api.deepseek.com/v1/models` | Keyed: Bearer; keyless: aggregator `deepseek` |
|
||||
| [Alibaba Model Studio](https://help.aliyun.com/zh/model-studio/list-models) | `/api/v1/models` on the configured regional host | Keyed: Bearer + `page_no` + `capabilities=TG`; keyless: aggregator `alibaba-cn`/`alibaba` |
|
||||
| [Moonshot / Kimi](https://platform.kimi.ai/docs/api/list-models) | `https://api.moonshot.ai/v1/models`; China: `api.moonshot.cn` | Keyed: Bearer; keyless: aggregator `moonshotai`/`moonshotai-cn` |
|
||||
| [Zhipu GLM (CN)](https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%9F%A5%E8%AF%A2%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8) | `https://open.bigmodel.cn/api/paas/v4/models` | Keyed: Bearer; keyless: aggregator `zhipuai` |
|
||||
| [Meta AI](https://llama.developer.meta.com/docs/models) | `https://api.meta.ai/v1/models` | Keyed: Bearer; keyless: aggregator `meta` (backup `meta-llama`) |
|
||||
| [Google Gemini](https://ai.google.dev/gemini-api/docs/openai) | `https://generativelanguage.googleapis.com/v1beta/openai/models` | Keyed: Bearer (`models/` prefix stripped); keyless: aggregator `google` |
|
||||
| [xAI Grok](https://docs.x.ai/docs/api-reference#list-models) | `https://api.x.ai/v1/models` | Keyed: Bearer; keyless: aggregator `xai` |
|
||||
| [OpenRouter](https://openrouter.ai/docs/api/api-reference/models/list-all-models-and-their-properties) | `https://openrouter.ai/api/v1/models` | Official public catalog refreshes without sending a key; custom gateways and connectivity checks send Bearer; `data[].id` |
|
||||
| [OpenCode Go](https://opencode.ai/docs/go/#models) | `https://opencode.ai/zen/go/v1/models` | Official public catalog refreshes without sending a key; custom gateways and connectivity checks send Bearer; `data[].id` |
|
||||
| [Ollama](https://docs.ollama.com/api/tags) | `/api/tags` on the configured server (or `/v1/models` under `openai-completions`) | Local servers need no key; `models[].model/name` or `data[].id`; empty means no installed models |
|
||||
@@ -128,30 +132,25 @@ New Model Studio endpoints for Beijing, Tokyo, Frankfurt and Virginia require th
|
||||
|
||||
Pagination and retries have a 30-second overall deadline. Network failures and 502/503/504 allow up to two attempts; authentication failures are not retried. Models are sorted by supplied creation/release dates, preserving upstream order on ties, without arbitrary list truncation. Public catalog membership does not establish account-specific generation permission.
|
||||
|
||||
Admin keeps the AI page aligned with the legacy information architecture:
|
||||
Admin separates AI infrastructure from workflow orchestration across two areas:
|
||||
|
||||
- `Model Providers`
|
||||
- Manages provider, wire adapter, default model, LLM API key, proxy URL, proxy token, model refresh, set-as-default, and lightweight connectivity testing.
|
||||
- `Tool Calling`
|
||||
- Manages tools such as WebSearch and OCR. Each tool first selects a provider, then edits that provider's API, key, and advanced parameters.
|
||||
- `Prompts`
|
||||
- Edits system/user prompts by prompt group and task key. Save and reset only affect the current task.
|
||||
- `Playground`
|
||||
- Runs real conversations with the active provider and prompt configuration. AI responses are rendered as Markdown.
|
||||
- **Operations and Settings → AI Infrastructure (`/ai`)**:
|
||||
- `Model Providers`: manages provider, wire adapter, default model, LLM API key, proxy URL/token, catalog refresh (keyless official providers fall back to public aggregator catalogs sorted selected-first + MRU + release date with a 6-item collapsible list), set-as-default, and connectivity testing.
|
||||
- `Tool Calling`: manages WebSearch (including keyless SearXNG) and OCR tool credentials.
|
||||
- **AI Advisor (`/advisor/*`)**:
|
||||
- `Playground` (`/advisor/playground`): pure-chat debugging bench defaulting to `default.general` with slash commands and client-owned local Earth context drawer (`planet.earth_context.v1` / same-origin IndexedDB / `localStorage`).
|
||||
- `Workflows & Nodes` (`/advisor/workflows`): `@xyflow/react` visual graph over all 9 built-in workflows supporting node prompts, allowlisted tools, guardrails, immutable revisions/rollback, and allowlisted AI Diff tuning proposals.
|
||||
- `Run History` (`/advisor/runs`): execution trace audit with one-click canvas replay.
|
||||
|
||||
Save, set-as-default, and connectivity testing are separate responsibilities: save only persists the form, set-as-default only changes the active provider/tool, and connectivity testing only validates the current draft. It must not implicitly save or switch defaults.
|
||||
|
||||
The `ai-prompts` endpoints back the Prompts tab in AI settings. Shipped defaults come from versioned backend resources, while business code references stable task keys. The API stores only operator overrides. Resetting a prompt removes the override and falls back to the current shipped default.
|
||||
Save, set-as-default, and connectivity testing remain three separate responsibilities. Runtime prompts resolve from published `AIWorkflow` nodes and versioned `default_prompts.json` resources while preserving `task_key` compatibility.
|
||||
|
||||
### Prompt Boundary
|
||||
|
||||
`aiprovider` is a pure model adapter and does not inject a global business system prompt. News localization, alert briefing, BGP briefing, location factcheck, datasource mapping, and credential guide generation each resolve their own effective prompt by task key. Alert-analysis system prompts are only sent by alert-related tasks and do not leak into other LLM calls.
|
||||
`aiprovider` is a pure model adapter and injects no business system prompts. Each workflow node and task key resolves its own effective prompt and serializes structured `context` as compact JSON.
|
||||
|
||||
### Agent And Tool Boundary
|
||||
|
||||
Agent workflows belong in the `backend`, not in `aiprovider`. Future Earth LLM commands, situational awareness, multi-role simulation, WebSearch, database queries, evidence storage, and configuration proposal application should be orchestrated by the backend Agent Runtime. `aiprovider` should receive model-ready requests from the backend and return normalized model responses.
|
||||
|
||||
If a provider supports native tool calling, `aiprovider` may pass through protocol fields and normalize response blocks, but tool whitelists, argument validation, permission policy, run records, and write approvals must stay in the backend. When a provider does not support native tools, the backend uses JSON tool-call fallback; business tools should not move into `aiprovider` for a provider-specific shortcut.
|
||||
Agent workflows belong in `backend`, not `aiprovider`. `aiprovider` transparently passes normalized `tools`, `tool_choice`, `response_format`, `native_web_search`, and multi-turn `tool` / `tool_calls` messages across adapters and normalizes returned `tool_calls` + `stop_reason`, while tool whitelists, validation, permission checks, `WorkflowRun` audit logs, and Diff approval remain strictly in the backend.
|
||||
|
||||
### AI provider internal API
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
# API Integration and Authentication Guide
|
||||
|
||||
This guide covers how external services, Unreal Engine (UE) projects, and internal automation scripts authenticate against Planet backend APIs while keeping public data endpoints protected from unauthenticated scraping.
|
||||
|
||||
## Domains and Responsibilities
|
||||
|
||||
| Domain | Role | Notes |
|
||||
| --- | --- | --- |
|
||||
| `https://rclaw.top` | Primary host & desktop default backend | Used by Planet Earth desktop clients and hot-update delivery; `/docs` and `/earth` redirect to `admin.rclaw.top` |
|
||||
| `https://api.rclaw.top` | Dedicated API & WebSocket entry | Recommended endpoint for external integrations, UE clients, and automated scripts |
|
||||
| `https://admin.rclaw.top` | Lightweight Admin Console & Gatekeeper Docs | Hosts `/settings?section=api_keys`, user role management, and controlled documentation |
|
||||
|
||||
> Public FastAPI `/docs` and `/openapi.json` are disabled in production. Authenticated `admin`, `super_admin`, or `docs_developer` users can inspect the full schema inside the in-app **API Reference** view on the Docs site or export the curated external OpenAPI schema from `/settings?section=api_keys`.
|
||||
|
||||
## Authentication Modes by Caller
|
||||
|
||||
### 1. UE Clients, Internal Tools & External Partners: `X-API-Key` (Recommended)
|
||||
|
||||
Administrators issue API keys from `/settings?section=api_keys`. Only a SHA-256 hash and masked prefix are persisted; the plaintext secret is displayed once upon creation.
|
||||
|
||||
- **UE / Internal preset**: Select `earth:all_read` (grants all Earth read-only routes plus `/ws` realtime streaming), **Never expires**, and **Unlimited** rate limit so UE projects need zero token-refresh logic.
|
||||
- **External partner preset**: Select granular read scopes (`visualization:read`, `layers:read`, `vessels:read`, `news:read`, `data_products:read`, `situational:read`, `earth:read`, `interactables:read`, `tv:read`, `ws:connect`) along with explicit expiration and per-minute rate limits.
|
||||
|
||||
**HTTP example (`curl` / UE `FHttpModule`):**
|
||||
|
||||
```bash
|
||||
curl -H "X-API-Key: <your_api_key>" \
|
||||
https://api.rclaw.top/api/v1/visualization/geo/summary
|
||||
```
|
||||
|
||||
**WebSocket example (UE `IWebSocket`):**
|
||||
|
||||
```text
|
||||
wss://api.rclaw.top/ws?api_key=<your_api_key>
|
||||
```
|
||||
|
||||
(Passing `X-API-Key` in the WebSocket upgrade header is also supported.)
|
||||
|
||||
### 2. Authorized Staff Accounts: `Authorization: Bearer <JWT>`
|
||||
|
||||
Self-registered `viewer` accounts cannot scrape protected data routes by default. A `super_admin` can grant the `api_access` Gatekeeper group in `/users` (`admin` and `super_admin` already have access).
|
||||
|
||||
```bash
|
||||
curl -X POST https://api.rclaw.top/api/v1/auth/login \
|
||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
||||
-d "username=<user>&password=<password>"
|
||||
```
|
||||
|
||||
Include `Authorization: Bearer <access_token>` on subsequent requests and refresh tokens with `POST /api/v1/auth/refresh`.
|
||||
|
||||
### 3. Zero-Login First-Party Earth Clients
|
||||
|
||||
- **Web Earth (`/earth`)**: Calls same-origin `POST /api/v1/auth/earth-session` (validated via same-origin headers and optional Cloudflare Turnstile verification) to obtain a short-lived `HttpOnly; SameSite=Strict` cookie (`planet_earth_session`) and WebSocket token with silent keep-alive renewal.
|
||||
- **Planet Earth Desktop Client**: The Electron main process exchanges a desktop session credential at `POST /api/v1/auth/earth-session` and injects `X-Planet-Earth-Token` on all proxied API requests (automatically refreshing once on HTTP `401`).
|
||||
|
||||
## Public Exemptions & Write Endpoint Guards
|
||||
|
||||
The following endpoints remain publicly accessible for health checks, desktop client self-updates, and public documentation:
|
||||
|
||||
- `GET /health`, `GET /health/live`, `GET /health/ready`, `GET /api/health`
|
||||
- `GET /api/v1/client/update-manifest`, `GET /api/v1/client/updates/files/{filename}`
|
||||
- `POST /api/v1/auth/*`, `GET /api/v1/docs/catalog`, `GET /api/v1/docs/{lang}/{slug}`
|
||||
|
||||
State-mutating compute-center location endpoints (`/api/v1/visualization/compute-centers/{source_id}/collect-location` and `/location`) require administrator JWT authentication. `POST /api/v1/news/refresh` requires Earth/API access and enforces a 60-second per-actor cooldown window.
|
||||
@@ -604,4 +604,8 @@ When compute image configuration has no model/group rules, resolution uses a bou
|
||||
|
||||
`compute-topic-model.js` and `compute-topic.js` render the five-layer strategic compute posture cards backed by `/api/v1/data-products/compute/series` and `/api/v1/situational-awareness/posture/compute`. Raw `"Far side"` card text is replaced by dashed `.is-rear` rim connectors and a header rotate-to-front icon button while keeping card text fully opaque.
|
||||
|
||||
`situational-copilot.js` and `workbench-blocks.js` implement the v2.0 workflow-driven dynamic workbench backed by `/api/v1/situational-awareness/sessions`, `/sessions/{id}/turns`, `/runs/{id}/cancel`, `/results/{id}/revisions/{rev}`, `/presentations`, and `/watches`. All `GET` endpoints are strictly read-only (`0` database writes and `0` LLM calls), and the `situationalAwareness` Outbox channel scopes exclusively to `stage_presentations`. Compiled `ViewSpec` payloads render six registered blocks: `comparison_matrix` (bars/table with explicit undisclosed markers), `trend_corridor` (breaking SVG paths across missing years instead of interpolating), `causal_brief` (separating mathematical denominator decomposition, verified drivers, counter-evidence, and unknown gaps), `impact_topology` (distinguishing logical AS routing propagation from physical subsea cables, plus the 8 national compute hubs), `evidence_drawer` (with `as_known_then` post-cutoff withholding badges and SHA-256 prefixes), and `executive_onepager`. Wide viewports (`>= 1440px`) allow at most two expanded workbench slots (`#situational-copilot` plus `#situational-pinned-slot`, preserving `>= 45%` central globe visibility), while narrow, zoomed, and mobile viewports fold pinned items into zero-token `Pinned Tabs`. `controls.js` exports `cancelEarthViewAnimation()` so manual globe drag, wheel zoom, or `stageNarrativePlayer.preempt()` immediately aborts active `requestAnimationFrame` camera flights, and proactive Outbox updates queue behind a deduplicated `+N Queued` badge whenever the user owns camera sovereignty.
|
||||
`situational-copilot.js` and `workbench-blocks.js` implement the v2.0 workflow-driven dynamic workbench backed by `/api/v1/situational-awareness/sessions`, `/sessions/{id}/turns`, `/runs/{id}/cancel`, `/results/{id}/revisions/{rev}`, `/presentations`, and `/watches`. All `GET` endpoints are strictly read-only (`0` database writes and `0` LLM calls), and the `situationalAwareness` Outbox channel scopes exclusively to `stage_presentations`. Compiled `ViewSpec` payloads render six registered blocks: `comparison_matrix` (bars/table with explicit undisclosed markers), `trend_corridor` (breaking SVG paths across missing years instead of interpolating), `causal_brief` (separating mathematical denominator decomposition, verified drivers, counter-evidence, and unknown gaps), `impact_topology` (distinguishing logical AS routing propagation from physical subsea cables, plus the 8 national compute hubs), `evidence_drawer` (with `as_known_then` post-cutoff withholding badges and SHA-256 prefixes), and `executive_onepager`. Wide viewports (`>= 1440px`) allow at most two expanded workbench slots (`#situational-copilot` plus `#situational-pinned-slot`, preserving `>= 45%` central globe visibility), while narrow, zoomed, and mobile viewports fold pinned items into zero-token `Pinned Tabs`. `controls.js` exports `cancelEarthViewAnimation()` so manual globe drag, wheel zoom, or `stageNarrativePlayer.preempt()` immediately aborts active `requestAnimationFrame` camera flights, and proactive Outbox updates queue behind a deduplicated `+N Queued` badge whenever the user owns camera sovereignty. For cross-surface debugging, `situational-copilot.js` also provides a client-side `planet.earth_context.v1` JSON export (`data_object` header action) from local IndexedDB state (`planet-earth-copilot-store`) without forcing backend persistence.
|
||||
|
||||
### Satellite Compression, Twinkle & Compute Site Differentiation
|
||||
|
||||
`compute-site-types.js` distinguishes `supercomputer`, `gpu_cluster`, `data_center`, `cloud_center`, and `edge_node` markers/legends by color, while `satellites.js` provides altitude compression (`altitudeCompression`), short comet trails, and GPU-attribute twinkle intensity controls (`twinklePhase` / `twinkleShape`) alongside a simplified footprint toggle focused on Starlink.
|
||||
@@ -33,7 +33,8 @@ Note: the layer control panel order and the registration / startup load order ar
|
||||
| 4.3 | AIS vessel track lines | `vessels.js` | `VESSEL_RENDER_ORDER - 0.1`; `CONFIG.earthRadius + VESSEL_CONFIG.track.altitudeOffset` | Follows vessel selection, not independently picked | Recent track for the selected vessel, below vessel markers. |
|
||||
| 4.4 | AIS vessel markers | `vessels.js`, `interactable.js` | `VESSEL_RENDER_ORDER`; business radius `CONFIG.earthRadius + VESSEL_CONFIG.altitudeOffset`; normal markers are bucketed `THREE.Points`, hover / locked states are single-point overlays; whole-anchor occlusion matches BGP and compute markers at the globe limb | `depthTest: false`, with visibility decided by anchor occlusion; `main.js` uses screen-space picking for front-facing markers; `cluster: false` and `avoidance: false` | Moving vessels use triangular point textures, anchored / slow vessels use dots. Dense waterways may overlap and do not participate in dynamic screen clustering, avoiding Points rebuilds during rotation. |
|
||||
| 4.5 | Compute centers | `compute-centers.js`, `interactable.js` | `COMPUTE_CENTER_RENDER_ORDER` | Screen-space Interactable picking, with surface-icon collision handling | Surface facilities, below satellites. |
|
||||
| 6 | Satellite dots | `satellites.js` | SGP4 altitude compressed to R+4..25; fallback R+8 | `depthTest=false`; vertex shader tests camera-to-satellite segment occlusion against an R×0.998 sphere; screen-space picking | Visible sprites remain complete; truly occluded points move outside clip space instead of being partially depth-clipped near the limb. |
|
||||
| 5.9 | Satellite trails | `satellites.js` | Samples ~12.6s semi-transparent tapered tails at 1.4s steps following the real-altitude toggle and compression slider; instanced screen-space ribbon | `depthTest=true`, `depthWrite=false`, `NormalBlending` | Draws above HD surface and surface icons, just below satellite dots; far-side segments occluded by the Earth occluder. |
|
||||
| 6 | Satellite dots | `satellites.js` | SGP4 altitude continuously adjustable from 100% (`R+4..25` log-compressed) down to 0% (1:1 true ratio, capped at `R+720`); fallback `R+8` | `depthTest=false`; vertex shader tests camera-to-satellite segment occlusion against an R×0.998 sphere; screen-space picking | Visible sprites remain complete; truly occluded points move outside clip space instead of being partially depth-clipped near the limb; idle breathing modulates both alpha and point size. |
|
||||
| 12+ | Satellite locked ring, halo, predicted orbit | `satellites.js` | `SATELLITE_CONFIG.overlayRenderOrder` and offsets; predicted orbit follows the same real-altitude toggle and fixes the lock-time globe pose to draw an open full-period inertial curve with forward-flow highlights; returns to same-sphere mode when real altitude is disabled | Satellite overlay path | Used for selected/locked satellite emphasis. |
|
||||
| 98-100 | Sun / moon halo and sprite | `celestial.js` | Fixed renderOrder | Celestial picking disabled | Foreground celestial sprites. |
|
||||
|
||||
|
||||
@@ -32,14 +32,17 @@ Admin now owns the official admin routes:
|
||||
- `/users`
|
||||
- `/datasources`
|
||||
- `/data`
|
||||
- `/alerts/system`
|
||||
- `/alerts/bgp`
|
||||
- `/alerts/situational`
|
||||
- `/bgp`
|
||||
- `/advisor/playground`
|
||||
- `/advisor/workflows`
|
||||
- `/advisor/runs`
|
||||
- `/ops/monitoring`
|
||||
- `/ai`
|
||||
- `/earth-content`
|
||||
- `/collection-management`
|
||||
- `/settings`
|
||||
- `/logs`
|
||||
|
||||
(Legacy `/bgp`, `/alerts/*`, `/ai/prompts`, and `/ai/playground` remain only as `<Navigate replace />` redirects.)
|
||||
|
||||
These routes render [AdminRoutes.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/AdminRoutes.tsx). Page metadata and menu entries come from [manifest.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/routes/manifest.tsx). Admin is the only console entry point; there is no parallel console or rollback route.
|
||||
|
||||
@@ -298,24 +301,24 @@ Responsibilities:
|
||||
|
||||
`App.tsx` uses it to decide whether to redirect to the login page. `/docs` remains a public route, but the backend decides the visible catalog and content from the token; anonymous visitors only receive public docs.
|
||||
|
||||
### 2. AI
|
||||
### 2. AI Infrastructure and AI Advisor
|
||||
|
||||
File:
|
||||
Files:
|
||||
|
||||
- [AISettings.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/PlainResourcePages.tsx)
|
||||
- [PlainResourcePages.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/PlainResourcePages.tsx)
|
||||
- [AdvisorPlayground.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/AdvisorPlayground.tsx)
|
||||
- [AdvisorWorkflows.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/AdvisorWorkflows.tsx)
|
||||
- [AdvisorRuns.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/AdvisorRuns.tsx)
|
||||
|
||||
Responsibilities:
|
||||
|
||||
- `/ai` now owns LLM Provider, AI Tool configuration, and Playground instead of nesting them under `/settings`
|
||||
- The `模型供应商` section manages default provider, model, base URL, provider key, local `aiprovider` proxy, and connection test; provider and model fields use editable comboboxes so users can manually enter new providers/models if the models.dev catalog stops updating
|
||||
- The `工具调用` section first selects a tool from a dropdown menu, then renders that tool's configuration; it currently includes WebSearch and OCR
|
||||
- WebSearch configuration includes provider, search key, base URL, timeout, result count, and advanced provider options
|
||||
- OCR configuration includes provider, Base URL, API key, model/engine, languages, timeout, file-size limit, and output format
|
||||
- The `Playground` section embeds the former Playground real session, preset prompts, and AI Provider status debugging
|
||||
- The page reuses the Settings single-screen section, panel card, and internal scrolling style
|
||||
- AI Provider and WebSearch connection tests use `ConnectionTestInput`, with the connector icon fixed at the end of the Base URL input; when WebSearch is disabled, every configuration field and the test entry point are greyed out except the switch
|
||||
- `/ai` is scoped to **AI Infrastructure** (`模型供应商` Model Providers and `工具调用` Tool Calling only), redirecting `?section=prompts` and `?section=playground` to `/advisor/*`
|
||||
- `模型供应商` includes keyless official-provider aggregator fallback sorting (`selected-first -> MRU -> release date`) with a collapsible 6-item list, unified tactile `<Select>` and dark-mode numeric steppers, and active sidebar group persistence across reloads
|
||||
- `/advisor/playground` delivers a pure-chat debugging workspace with slash commands and a Client-Owned Local Context Drawer (`localStorage`, same-origin Earth IndexedDB, `planet.earth_context.v1` JSON paste, and explicit Save Fixture)
|
||||
- `/advisor/workflows` renders a 3-column `@xyflow/react` visual editor over all 9 built-in workflows, allowlisted tools, guardrails, immutable revisions/rollback, and AI Diff proposals
|
||||
- `/advisor/runs` and `/ops/monitoring` house execution trace audits and consolidated non-AI monitoring alerts
|
||||
|
||||
AI configuration no longer lives under `/settings`; `/playground` should redirect to `/ai?section=playground`.
|
||||
Legacy `/playground`, `/bgp`, and `/alerts/*` routes are preserved only as `<Navigate replace />` redirects.
|
||||
|
||||
### 3. Business Data Gateway
|
||||
|
||||
|
||||
@@ -65,7 +65,11 @@ class LocationResolver(Protocol):
|
||||
| `RegistryResolver` | `resolvers/registry.py` | Legacy generic resolver; current compute-center and BGP runtime paths do not use it to generate candidates |
|
||||
| `NominatimResolver` | `resolvers/nominatim.py` | Runs a domain query plan against Nominatim with LRU cache and rate limiting |
|
||||
| `InheritFromAnotherEntityResolver` | `resolvers/inherit.py` | Wraps an externally resolved entity location as a candidate |
|
||||
| `LocationLLMFallback` | `location/llm_fallback.py` | Generates a confirmation-required candidate through the current default AI Provider when user-triggered collection has no regular candidates |
|
||||
| `BuildsUponComputeCenterResolver` | `services/compute_center_locations.py` | Epoch `builds_upon` parent-cluster campus inheritance from verified coordinates |
|
||||
| `lookup_wikidata_facility` | `resolvers/wikidata.py` | Async L1 Wikidata P625/P276 facility coordinate lookup |
|
||||
| `lookup_peeringdb_facility` | `resolvers/peeringdb_facility.py` | Async L1 PeeringDB `/api/fac` commercial colocation street/lat-lon lookup |
|
||||
| `run_controlled_location_agent` | `location/agent_resolver.py` | Controlled L2–L4 4-step Tool-Calling agent (`fetch_source_url`, `web_search`, `geocode_verify`, `submit_location_result`) with terminal status persistence |
|
||||
| `LocationLLMFallback` | `location/llm_fallback.py` | Structured fact-check fallback for non-tool-calling models with lat/lon range, country verification, and city downgrade guardrails |
|
||||
|
||||
Nominatim is the geocoding service in the OpenStreetMap ecosystem. Given a place name, city, country, organization, or facility query, it returns possible coordinates, a display name, and structured address fields. It is useful for turning city/facility text into candidate coordinates, but it is not an authoritative fact registry and can match same-name places or broad administrative areas. Planet therefore treats Nominatim output as confirmation-required candidates and uses it with caching and rate limiting.
|
||||
|
||||
|
||||
+30
-26
@@ -15,7 +15,7 @@ In the hosted Admin Console, select Earth to open the desktop launch page. On yo
|
||||
| Register / Login / Forgot Password | `/register`, `/login`, `/forgot-password` | No | Self-serve account creation and recovery |
|
||||
| Console | `http://<host>/admin` | Yes | Data, collectors, alerts, AI, users, settings |
|
||||
| AI | `http://<host>/ai` | Yes | Model providers, tools, testbench |
|
||||
| Backend API Docs | `http://<host>:8000/docs` | Depends | FastAPI / OpenAPI |
|
||||
| Backend API Docs | `http://<host>:8000/docs` | Depends | Local dev FastAPI / OpenAPI (disabled publicly in production; `admin` / `docs_developer` users can open in-app API Reference in `/docs`, or issue `X-API-Key` and export external OpenAPI at `/settings?section=api_keys`) |
|
||||
|
||||
URLs below use the local default `http://localhost:3000`. Replace the prefix with your deployment URL in production.
|
||||
|
||||
@@ -73,16 +73,16 @@ The console at `http://localhost:3000/admin` is built with React plus Tactile UI
|
||||
| Docs | `/docs` | Open the docs site and show documents allowed by Gatekeeper permissions |
|
||||
| Datasources | `/datasources` | Source directory and collection triggers |
|
||||
| Collected Data | `/data` | Data already ingested |
|
||||
| BGP | `/bgp` | BGP situational view |
|
||||
| System Alerts | `/alerts/system` | System-level alerts |
|
||||
| BGP Alerts | `/alerts/bgp` | BGP-related alerts |
|
||||
| Situational Alerts | `/alerts/situational` | Situational analysis alerts |
|
||||
| AI | `/ai` | Model providers, tools, testbench |
|
||||
| Playground | `/advisor/playground` | Pure-chat AI Advisor workbench with local Earth context drawer |
|
||||
| Workflows & Nodes | `/advisor/workflows` | `@xyflow/react` visual workflow editor, revision rollback, and AI Diff tuning |
|
||||
| Run History | `/advisor/runs` | AI workflow execution trace audit and canvas replay |
|
||||
| Monitoring & Alerts | `/ops/monitoring` | Consolidated system alerts, BGP incidents/anomalies/events, and collector health |
|
||||
| AI Infrastructure | `/ai` | Model providers and WebSearch/OCR tool credentials |
|
||||
| Earth Content | `/earth-content` | TV livestreams, boundary precision, base-map and layer-resource entry points |
|
||||
| Collection Management | `/collection-management` | Collectors, scheduling, collection history entry points |
|
||||
| Logs | `/logs` | Usually visible only to super admin |
|
||||
| Users | `/users` | Create/delete users, change roles/groups |
|
||||
| System Settings | `/settings` | Display, notification, security, SMTP |
|
||||
| System Settings | `/settings` | Display, notification, security, SMTP, scoped `X-API-Key` management |
|
||||
|
||||
Menu items hide automatically when you lack permission. If a menu is missing, check your role and Gatekeeper groups.
|
||||
|
||||
@@ -144,14 +144,21 @@ Steps:
|
||||
- `total stored`, `last 24h`, `last 1h`, and `unique MMSI` show historical collection volume
|
||||
- `disconnected` with a recent error means the upstream or network dropped; click `Reconnect`
|
||||
|
||||
## Configure AI Credentials
|
||||
## Configure AI Infrastructure and Use AI Advisor
|
||||
|
||||
`/ai?section=integrations` is the AI management entry. Key sections:
|
||||
`/ai?section=integrations` (**AI Infrastructure**) manages model providers and tool credentials, while `/advisor/playground`, `/advisor/workflows`, and `/advisor/runs` (**AI Advisor**) provide pure-chat debugging, visual node orchestration, and run auditing:
|
||||
|
||||
- `Model Providers`: default LLM provider, model, base URL, API key, local `aiprovider` proxy, connection test
|
||||
- `Tool Calls`: a dropdown for specific tools — currently WebSearch and OCR
|
||||
- `Prompts`: a task dropdown for news localization, alert analysis, BGP briefs, and other LLM tasks. Operators can edit the prompt or reset it to the default
|
||||
- `Playground`: real session, preset request, and AI Provider status debugging
|
||||
- **AI Infrastructure (`/ai`)**:
|
||||
- `Model Providers`: default LLM provider, model, base URL, API key, local `aiprovider` proxy, and connection test; official keyless providers (incl. GLM, Meta, Gemini, Grok, DeepSeek, OpenAI, MiniMax) fall back to public aggregator catalogs sorted selected-first + MRU + release date with a collapsible 6-item list
|
||||
- `Tool Calls`: dropdown for WebSearch (including keyless SearXNG) and OCR
|
||||
- **AI Advisor (`/advisor/*`)**:
|
||||
- `Playground` (`/advisor/playground`): pure-chat debugging workbench defaulting to `default.general`; supports `/bgp-brief`, `/alerts-brief`, `/situational-brief`, and `/locate` slash commands plus a **Client-Owned Local Context Drawer** (reads browser `localStorage`, same-origin Earth IndexedDB sessions, or pasted `planet.earth_context.v1` JSON exported from Earth Copilot without forcing backend persistence unless explicitly saved as a workflow fixture)
|
||||
- `Workflows & Nodes` (`/advisor/workflows`): `@xyflow/react` canvas for all 9 built-in workflows (`default.general`, `earth.copilot.chat`, `earth.news.enrich`, `earth.news.analysis`, `location.resolve_unknown`, `ops.bgp_brief`, `ops.alerts_brief`, `ops.situational_alerts_brief`, `collection.mapping_and_guide`) supporting prompts, allowlisted tools, guardrails, draft/publish/rollback revisions, run trace replay, and **AI Diff Auto-Tuning Proposals**
|
||||
- `Run History` (`/advisor/runs`): filterable audit log linking directly to canvas replay and workflow optimization
|
||||
|
||||
Legacy routes (`/ai/prompts`, `/ai/playground`, `/playground`, `/bgp`, `/alerts/*`, plus legacy prompts/playground query sections) automatically redirect to their new counterparts under `/advisor/*` and `/ops/monitoring`.
|
||||
|
||||
> The Electron Desktop Client also includes native Screen Recording (`CmdOrCtrl+Shift+F9` under the **Screen Recording** menu) with audio toggle (`recordAudio`), hide-cursor/custom cursor overlay (`recordHideCursor`), auto-save to `Videos/Planet Earth/`, and Windows portable/installer layout under `C:\Users\qklov\AppData\Local\Planet\{current,releases}`.
|
||||
|
||||
### Model Providers
|
||||
|
||||
@@ -165,7 +172,7 @@ Providers and models accept presets or arbitrary custom IDs. Common fields:
|
||||
- Max Tokens, Anthropic Version: keep defaults if unsure
|
||||
- Timeout / Retry: timeout and retry attempts
|
||||
|
||||
The plug icon at the end of the Base URL input runs a lightweight connection check: it checks the proxy and model catalog, then confirms the selected model is listed. Use Playground afterward to verify generation access and the model's reply; the catalog check itself does not generate a response.
|
||||
The plug icon at the end of the Base URL input runs a lightweight connection check: it checks the proxy and model catalog, then confirms the selected model is listed. Use `/advisor/playground` afterward to verify generation access and the model's reply; the catalog check itself does not generate a response.
|
||||
|
||||
Use the refresh icon at the top right to update the available models. A successful refresh saves the catalog for later visits; catalogs with release dates show newer models first. Refresh preserves the current model, credentials, URLs, and unsaved edits. Select a model and click Save to change the model used by the application. A failed refresh displays an error and keeps the previous catalog.
|
||||
|
||||
@@ -176,11 +183,9 @@ Refresh uses the base URL, protocol, and API key currently entered in the form,
|
||||
- **WebSearch**: provider, API key, base URL, max results, timeout, advanced provider parameters. While disabled, all fields except the enable switch are greyed out
|
||||
- **OCR**: provider, base URL, API key, model/engine, recognition languages, timeout, max file size, output format
|
||||
|
||||
### Prompts
|
||||
### Visual Workflows & Node Prompts
|
||||
|
||||
After selecting a task, the page shows the effective prompt, whether it is customized, the shipped default version, and a reset button. Saving affects only that task. Reset restores the default prompt from the current release package. Business facts, context, and output schemas are still assembled by the backend for each task.
|
||||
|
||||
AI configuration no longer lives in System Settings; `/playground` redirects to `/ai?section=playground`.
|
||||
Use `/advisor/workflows` to pick any workflow and inspect individual nodes (System Prompt, Task Prompt, allowlisted tools, guardrails JSON). Save drafts to test in Playground, or publish immutable revisions with one-click rollback.
|
||||
|
||||
## Datasources and Task Logs
|
||||
|
||||
@@ -250,18 +255,17 @@ To let a regular user read developer or operations docs, add `docs_developer` or
|
||||
|
||||
- `/datasources`: source directory. The `Built-in Sources` tab can be filtered by product domain, layer/module, enabled state, last run status, whether collected records exist, and search text. With no rows selected, the primary button shows `Trigger All`; after selecting rows, it becomes `Trigger Selected N` and submits only those sources. The top-right queue button shows a queue icon when empty and a pure circular total-progress indicator while tasks exist; it opens a floating panel grouped by running, completed, failed, and skipped. Failed rows can retry, and completed rows can jump to detail. `Realtime Sources` is for AISStream / WebSocket long connections and shows connection health, stored totals, time-window counters, and Start / Stop / Reconnect actions. Endpoint/credential/header editing happens at `/collection-management -> Collectors`.
|
||||
- `/data`: collected data table — used to verify "did data arrive", "is the freshness right", "does a source emit valid records"
|
||||
- `/bgp`: BGP detail page with list + detail + analysis; complements the BGP layer on Earth
|
||||
- `/alerts/system`, `/alerts/bgp`, `/alerts/situational`: system, BGP, and situational alerts
|
||||
- `/ops/monitoring`: consolidated operational monitoring and alerts view (system alerts, BGP incidents, anomalies, collectors with location collection, and observation events; legacy `/bgp` and `/alerts/*` routes redirect here)
|
||||
|
||||
## AI Testbench
|
||||
## AI Advisor (Playground, Workflows, and Run History)
|
||||
|
||||
`/ai?section=playground` is for real-pipeline debugging:
|
||||
- `/advisor/playground`: pure-chat debugging bench defaulting to `default.general`, supporting `/bgp-brief`, `/alerts-brief`, `/situational-brief`, and `/locate` slash commands plus the client-owned local Earth context drawer (`localStorage`, same-origin Earth IndexedDB, or desktop-exported `planet.earth_context.v1` JSON); `/playground`, `/ai/playground`, and legacy playground query links redirect here.
|
||||
- `/advisor/workflows`: `@xyflow/react` visual graph editor for all 9 built-in workflows, revisions, rollback, and AI Diff auto-tuning; `/advisor/runs` audits execution traces and opens one-click canvas replay.
|
||||
|
||||
- Pick the active provider
|
||||
- Run preset requests or custom prompts
|
||||
- Watch AI Provider status and response
|
||||
## API Authentication and Zero-Login Earth Access
|
||||
|
||||
The legacy link `/playground` redirects here.
|
||||
- Public Web `/earth` and the desktop client read spatial visualization endpoints smoothly without requiring user sign-in while enforcing anti-scraping session checks.
|
||||
- External UE5 and partner integrations can use scoped permanent `X-API-Key` credentials issued under `/settings` (or user accounts assigned to `api_access` in `/users`), with curated OpenAPI schema exposed at `/api/v1/openapi-external.json`.
|
||||
|
||||
## Earth Public Page
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ The default role is `viewer`: you can sign in but only see public pages. For col
|
||||
After landing on the `/admin` dashboard, here's a recommended walk-through:
|
||||
|
||||
1. `/collection-management?section=collector_credentials`: pick a collector and click the plug icon to test connectivity. Free collectors (e.g. open BGP) usually work right away; credential-bearing ones like `AISStream` or `BarentsWatch` need an API key / client secret first
|
||||
2. `/ai?section=integrations`: fill an LLM provider (e.g. `minimax` / `openai`), model, base URL, API key, and click the plug at the end of the base URL to check the model catalog; verify generation in Playground. The refresh icon updates and saves the available model catalog while preserving your form; select a model and click Save to apply it. WebSearch / OCR tools are optional
|
||||
2. `/ai?section=integrations`: fill an LLM provider (e.g. `minimax` / `openai`), model, base URL, API key, and click the plug at the end of the base URL to check the model catalog (official keyless providers fall back to public aggregator catalogs sorted selected-first + MRU + release date with a collapsible 6-item list); verify generation in `/advisor/playground` and edit node workflows in `/advisor/workflows`. Optional WebSearch / OCR tools live under `/ai?section=tools`
|
||||
3. `/earth-content?section=brand`: maintain the Earth HUD logo and title image in Branding. The Upload button inside each URL field opens a file picker, and image files can also be dropped directly onto the matching field. Save the brand configuration after upload
|
||||
4. `/datasources` or `/data`: check whether collectors have produced data. Use `/datasources -> Built-in Sources` for finite collectors: with no rows selected, click `Trigger All`; after selecting rows, the primary button becomes `Trigger Selected N`. The top-right queue button shows progress. Use `/datasources -> Realtime Sources` for AISStream / WebSocket health and counters
|
||||
5. `/alerts/system`: verify system alerts look right
|
||||
6. `/users` (super_admin only): open accounts for teammates or adjust their groups
|
||||
5. `/ops/monitoring`: inspect system alerts, BGP incidents/anomalies/events, and collector health
|
||||
6. `/users` (super_admin only): open accounts for teammates or adjust their groups (or issue scoped `X-API-Key` tokens in `/settings` and grant `api_access` for external/UE5 API consumers)
|
||||
|
||||
## 4. Open Earth
|
||||
|
||||
|
||||
@@ -104,22 +104,26 @@ AI 配置页使用的接口:
|
||||
|
||||
这些接口都需要用户登录;其中模型目录刷新接口需要管理员权限。`secrets` 接口只用于配置页点击显示 key/token 时取回明文,隐藏时前端恢复为脱敏预览。
|
||||
|
||||
模型目录刷新和轻量连通性测试共用 `backend/app/services/llm_model_catalog.py`,直接请求当前供应商的模型接口,不再依赖 models.dev。使用当前表单草稿中的基础地址、协议和凭证;不传草稿时读取已保存配置。国内、国际和自定义网关地址保持各自的地域与路径。对于官方公开目录(`openrouter.ai`、`opencode.ai`)以及本地 Ollama,刷新模型列表不需要也不发送 API Key,避免表单或库中残留的无效/过期凭证阻断公开目录刷新;若将这些供应商改配为自定义私有中转地址,则仍按私有网关校验并附带凭证。轻量连通性测试继续按配置附带凭证校验(Ollama 的 `ollama-generate` 与 `openai-completions` 均免 Key)。缺少必需凭证、基础地址非法或协议不支持时返回 400;上游超时、鉴权或响应错误返回 502 安全提示,并保留上次目录。`POST /api/v1/settings/integrations/ai-provider/presets/refresh-public` 可批量刷新所有当前免凭证预设并分别落库,单项失败不影响其余预设且保留原有目录。
|
||||
模型目录刷新和轻量连通性测试共用 `backend/app/services/llm_model_catalog.py`。当配置了 API Key 时,直接请求当前供应商的模型接口(国内、国际和自定义网关地址保持各自的地域与路径);对于官方公开目录(`openrouter.ai`、`opencode.ai`)以及本地 Ollama,刷新模型列表不需要也不发送 API Key,避免表单或库中残留的无效/过期凭证阻断公开目录刷新。对于内置官方主机但需凭证鉴权的默认供应商(`minimax`、`openai`、`anthropic`、`deepseek`、`alibaba`、`moonshotai`、`glm`、`meta`、`gemini`、`grok`),**未配置 API Key 时自动回退到公共聚合目录**(优先 `models.dev/api.json`,主聚合源不可用或为空时回退至 `openrouter.ai/api/v1/models`,进程内 5 分钟缓存);若将这些供应商改配为自定义私有中转地址,则仍按私有网关校验且无 Key 时返回 400。轻量连通性测试继续严格按配置直连并附带凭证校验(Ollama 的 `ollama-generate` 与 `openai-completions` 均免 Key),不会走聚合源回退。缺少必需凭证、基础地址非法或协议不支持时返回 400;上游或聚合源均不可用时返回 502 安全提示,并保留上次目录。`POST /api/v1/settings/integrations/ai-provider/presets/refresh-public` 可批量刷新所有当前免凭证或支持聚合兜底的预设并分别落库,单项失败不影响其余预设且保留原有目录。
|
||||
|
||||
成功目录和 `refreshed_at` 按供应商保存到 `system_settings` 的 `llm_provider_preset:<provider>` 分类。该动态分类使用对应供应商预设作为默认值,提交前校验分类,避免已提交却返回失败。列表优先返回已保存目录,未刷新过的供应商显示内置建议。刷新不修改 `external_integrations` 的当前模型、协议、地址或凭证;页面保留草稿,目录加载失败时保留已显示模型并明确提示失败。
|
||||
|
||||
### 模型目录接口
|
||||
|
||||
以下接口于 2026-09-13 对照官方文档核对。表中的 URL 是模型列表地址,配置表单仍填写生成接口的基础地址。需要凭证的目录必须使用对应服务地域的 API Key。
|
||||
以下接口对照官方及聚合目录核对。表中的 URL 是模型列表地址,配置表单仍填写生成接口的基础地址。需要凭证的直连目录必须使用对应服务地域的 API Key;未配置 Key 时官方默认地址会按对应供应商映射从公共聚合源拉取文本对话模型清单。
|
||||
|
||||
| 供应商 | 模型列表 GET 接口 | 鉴权与解析 |
|
||||
| --- | --- | --- |
|
||||
| [MiniMax](https://platform.minimax.io/docs/api-reference/models/anthropic/list-models) | `https://api.minimaxi.com/anthropic/v1/models`;国际站使用 `api.minimax.io` | `x-api-key`;`data[].id`;处理 `has_more/last_id` |
|
||||
| [OpenAI](https://developers.openai.com/api/reference/resources/models/methods/list) | `https://api.openai.com/v1/models` | Bearer;`data[].id` |
|
||||
| [Anthropic](https://platform.claude.com/docs/en/api/models/list) | `https://api.anthropic.com/v1/models` | `x-api-key`、`anthropic-version`;按 `after_id` 翻页 |
|
||||
| [DeepSeek](https://api-docs.deepseek.com/api/list-models) | `https://api.deepseek.com/v1/models` | Bearer;`data[].id` |
|
||||
| [阿里百炼](https://help.aliyun.com/zh/model-studio/list-models) | 同地域主机的 `/api/v1/models` | Bearer;`output.models[].model`;按 `page_no/page_size/output.total` 翻页,筛选 `capabilities=TG` |
|
||||
| [Moonshot / Kimi](https://platform.kimi.ai/docs/api/list-models) | `https://api.moonshot.ai/v1/models`;国内站使用 `api.moonshot.cn` | Bearer;`data[].id` |
|
||||
| [MiniMax](https://platform.minimax.io/docs/api-reference/models/anthropic/list-models) | `https://api.minimaxi.com/anthropic/v1/models`;国际站使用 `api.minimax.io` | 有 Key 走官方 `x-api-key` + `has_more/last_id`;无 Key 走聚合 `minimax-cn`/`minimax` |
|
||||
| [OpenAI](https://developers.openai.com/api/reference/resources/models/methods/list) | `https://api.openai.com/v1/models` | 有 Key 走 Bearer;无 Key 走聚合 `openai` |
|
||||
| [Anthropic](https://platform.claude.com/docs/en/api/models/list) | `https://api.anthropic.com/v1/models` | 有 Key 走 `x-api-key` + `anthropic-version`;无 Key 走聚合 `anthropic` |
|
||||
| [DeepSeek](https://api-docs.deepseek.com/api/list-models) | `https://api.deepseek.com/v1/models` | 有 Key 走 Bearer;无 Key 走聚合 `deepseek` |
|
||||
| [阿里百炼](https://help.aliyun.com/zh/model-studio/list-models) | 同地域主机的 `/api/v1/models` | 有 Key 走 Bearer + `page_no` + `capabilities=TG`;无 Key 走聚合 `alibaba-cn`/`alibaba` |
|
||||
| [Moonshot / Kimi](https://platform.kimi.ai/docs/api/list-models) | `https://api.moonshot.ai/v1/models`;国内站使用 `api.moonshot.cn` | 有 Key 走 Bearer;无 Key 走聚合 `moonshotai`/`moonshotai-cn` |
|
||||
| [智谱 GLM (CN)](https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%9F%A5%E8%AF%A2%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8) | `https://open.bigmodel.cn/api/paas/v4/models` | 有 Key 走 Bearer;无 Key 走聚合 `zhipuai` |
|
||||
| [Meta AI](https://llama.developer.meta.com/docs/models) | `https://api.meta.ai/v1/models` | 有 Key 走 Bearer;无 Key 走聚合 `meta`(回退 `meta-llama`) |
|
||||
| [Google Gemini](https://ai.google.dev/gemini-api/docs/openai) | `https://generativelanguage.googleapis.com/v1beta/openai/models` | 有 Key 走 Bearer(自动去掉 `models/` 前缀);无 Key 走聚合 `google` |
|
||||
| [xAI Grok](https://docs.x.ai/docs/api-reference#list-models) | `https://api.x.ai/v1/models` | 有 Key 走 Bearer;无 Key 走聚合 `xai` |
|
||||
| [OpenRouter](https://openrouter.ai/docs/api/api-reference/models/list-all-models-and-their-properties) | `https://openrouter.ai/api/v1/models` | 官方公开目录刷新不附带 Key;自定义网关与连通性检查附带 Bearer;`data[].id` |
|
||||
| [OpenCode Go](https://opencode.ai/docs/go/#models) | `https://opencode.ai/zen/go/v1/models` | 官方公开目录刷新不附带 Key;自定义网关与连通性检查附带 Bearer;`data[].id` |
|
||||
| [Ollama](https://docs.ollama.com/api/tags) | 本机或配置服务器的 `/api/tags`(或 `openai-completions` 下的 `/v1/models`) | 本地无需 Key;`models[].model/name` 或 `data[].id`;空目录表示尚未安装模型 |
|
||||
@@ -128,30 +132,27 @@ AI 配置页使用的接口:
|
||||
|
||||
完整分页和重试受 30 秒总超时保护;网络故障及 502/503/504 最多尝试两次,鉴权失败不重试。按接口提供的创建/发布日期倒序排列;日期相同时保留上游顺序,不截断为固定数量。公共目录只表示供应商公开的模型集合,不代表账号已获得每个模型的生成权限。
|
||||
|
||||
Admin 的 AI 页面按业务信息架构组织为:
|
||||
Admin 的 AI 页面已按基础设施与参谋编排拆分为两组信息架构:
|
||||
|
||||
- `模型供应商`
|
||||
- 管理 provider、协议适配、默认模型、LLM API Key、代理地址、代理 token、模型列表刷新、设为默认和轻量连通性测试。
|
||||
- `工具调用`
|
||||
- 管理 WebSearch、OCR 等工具。工具内部先选 provider,再编辑该 provider 的 API、key 和高级参数。
|
||||
- `提示词`
|
||||
- 按 prompt 分组和 task key 编辑系统提示词 / 用户提示词;保存和重置只作用于当前 task。
|
||||
- `Playground`
|
||||
- 使用当前默认 provider 和 prompt 配置发起真实会话;AI 回复使用 Markdown 渲染。
|
||||
- **运维与配置 → AI 基础设施 (`/ai`)**:
|
||||
- `模型供应商`:管理 provider、协议适配、默认模型、LLM API Key、代理地址、代理 token、模型列表刷新(无 Key 官方源回退公共聚合目录,按「已选优先 + 最近使用 + 发布时间」排序并折叠展示 6 项)、设为默认和轻量连通性测试。
|
||||
- `工具调用`:管理 WebSearch(支持免 Key 的 SearXNG 等)和 OCR 等工具配置。
|
||||
- **AI 参谋 (`/advisor/*`)**:
|
||||
- `Playground` (`/advisor/playground`):纯净对话调试台,默认 `default.general`,支持斜杠简报指令及客户端自持的本地地球上下文抽屉(`planet.earth_context.v1` / 同源 IndexedDB / `localStorage`)。
|
||||
- `工作流与节点` (`/advisor/workflows`):管理全站 9 条内建工作流的 `@xyflow/react` 节点图(提示词、工具白名单、护栏、`Draft / Publish / Rollback` 版本历史与受白名单约束的 AI Diff 调优提案)。
|
||||
- `运行记录` (`/advisor/runs`):审计每次对话、地球 Copilot 与位置 Agent 的执行轨迹。
|
||||
|
||||
保存、设为默认和连通性测试是三个独立职责:保存只持久化表单,设为默认只切换默认 provider/tool,连通性测试只验证当前草稿是否可用,不应隐式保存或切换默认项。
|
||||
|
||||
`ai-prompts` 接口用于运维配置页的“提示词”Tab。默认提示词来自后端随发布包携带的版本化资源,业务代码只引用稳定 task key;接口只保存运维覆盖值。重置时删除覆盖值并恢复当前发布包中的缺省提示词。
|
||||
运行时提示词由 `AIWorkflow` 已发布节点配置与 `backend/app/ai_tasks/default_prompts.json` 版本化资源共同驱动,业务代码仅引用稳定 `task_key` / `workflow_id`。
|
||||
|
||||
### 提示词边界
|
||||
|
||||
`aiprovider` 是纯模型适配器,不注入通用业务 system prompt。新闻汉化、告警研判、BGP 简报、位置 factcheck、数据源映射和凭据教程等入口各自通过 task key 解析有效提示词。告警研判 prompt 只会在告警相关 task 中作为 system prompt 传入,不会污染其它 LLM 调用。
|
||||
`aiprovider` 是纯模型适配器,不注入通用业务 system prompt。新闻汉化、深层分析、告警研判、BGP 简报、位置 factcheck、数据源映射和凭据教程等入口各自通过 workflow 节点与 task key 解析有效提示词,并对输入 `context` 做结构化 JSON 序列化。
|
||||
|
||||
### Agent 与工具边界
|
||||
|
||||
Agent 工作流属于 `backend`,不属于 `aiprovider`。后续 Earth LLM 指令、态势感知、多角色模拟、WebSearch、数据库查询、证据存储和配置提案应用都应由后端 Agent Runtime 编排;`aiprovider` 只接收后端整理好的模型请求并返回规范化响应。
|
||||
|
||||
如果某个 provider 支持原生 tool calling,`aiprovider` 可以透传协议字段并规范化响应块,但工具白名单、参数校验、权限策略、运行记录和写入审批仍必须留在后端。provider 不支持原生 tools 时,后端使用 JSON tool-call fallback,不应为了某个模型厂商把业务工具下沉到 `aiprovider`。
|
||||
Agent 工作流属于 `backend`,不属于 `aiprovider`。`aiprovider` 现已统一透传标准化 `tools`、`tool_choice`、`response_format`、`native_web_search` 与多轮 `tool`/`tool_calls` 消息结构,并规范化返回 `tool_calls` 与 `stop_reason`;工具白名单、参数校验、权限策略、运行记录 `WorkflowRun`、Diff 补丁审批与持久化仍完全留在后端。
|
||||
|
||||
### AI Provider 内部 API
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
# API 接入与鉴权指南
|
||||
|
||||
本文档面向需要在外部系统、Unreal Engine(UE)工程或内部自动化脚本中接入 Planet 后端数据接口的研发人员,说明防爬虫鉴权机制、长期 `X-API-Key` 凭证、JWT 访问权限组以及受控 OpenAPI 规范的使用方式。
|
||||
|
||||
## 访问路径与域名分工
|
||||
|
||||
| 域名 | 职责 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `https://rclaw.top` | 主站 / 桌面客户端默认后端 | 默认用于 Planet Earth 桌面客户端及热更新;`/docs` 与 `/earth` 引导跳转至 `admin.rclaw.top` |
|
||||
| `https://api.rclaw.top` | 专用 API 与 WebSocket 入口 | 推荐所有外部系统、UE 客户端与自动化脚本统一接入此域名 |
|
||||
| `https://admin.rclaw.top` | 轻量控制台与受控文档站 | 管理后台、`API 密钥` 管理与研发文档入口 |
|
||||
|
||||
> 生产环境已关闭公开 FastAPI `/docs` 与 `/openapi.json`。具备 `admin`、`super_admin` 或 `docs_developer` 权限的用户可在登录后直接从文档站左侧打开**站内 API 参考**,或在 `/settings?section=api_keys` 导出精简版对外 OpenAPI JSON。
|
||||
|
||||
## 四类调用方与鉴权方式
|
||||
|
||||
### 1. UE / 内部工具 / 外部合作方:`X-API-Key`(推荐)
|
||||
|
||||
由管理员在控制台 `/settings?section=api_keys` 签发。数据库中仅保存 SHA-256 哈希与脱敏前缀,完整密钥只在创建时返回一次。
|
||||
|
||||
- **UE / 内部长期连接预设**:可勾选 `earth:all_read`(覆盖全部地球只读数据接口与 WebSocket 实时推送)、`永不过期` 与 `不限流`,在 UE 配置文件中写入一次即可长期免维护运行。
|
||||
- **外部合作方预设**:按模块勾选最小必要权限(如 `visualization:read`、`layers:read`、`news:read`、`data_products:read`、`ws:connect`),并设置过期天数与每分钟速率限制。
|
||||
|
||||
**HTTP 调用示例(curl / UE `FHttpModule`):**
|
||||
|
||||
```bash
|
||||
curl -H "X-API-Key: <your_api_key>" \
|
||||
https://api.rclaw.top/api/v1/visualization/geo/summary
|
||||
```
|
||||
|
||||
**WebSocket 实时订阅示例(UE `IWebSocket`):**
|
||||
|
||||
```text
|
||||
wss://api.rclaw.top/ws?api_key=<your_api_key>
|
||||
```
|
||||
|
||||
(也支持在 WebSocket 握手请求头中传递 `X-API-Key`。)
|
||||
|
||||
### 2. 已授权研发人员账号:`Authorization: Bearer <JWT>`
|
||||
|
||||
默认自助注册的 `viewer` 账号无法直接批量调用外部受保护数据接口。超级管理员可在 `/users` 中为内部人员勾选 `api_access` 权限组(`admin` 与 `super_admin` 默认具备权限)。
|
||||
|
||||
```bash
|
||||
curl -X POST https://api.rclaw.top/api/v1/auth/login \
|
||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
||||
-d "username=<user>&password=<password>"
|
||||
```
|
||||
|
||||
随后在请求头中携带 `Authorization: Bearer <access_token>` 调用数据接口,或通过 `POST /api/v1/auth/refresh` 刷新短期令牌。
|
||||
|
||||
### 3. Web Earth 网页端与桌面客户端(免登录)
|
||||
|
||||
- **Web Earth(`/earth`)**:页面初始化时同源调用 `POST /api/v1/auth/earth-session`(校验同源请求头与可选 Cloudflare Turnstile 人机校验),由后端签发 `HttpOnly; SameSite=Strict` 短效签名 Cookie(`planet_earth_session`)与 WebSocket 票据并自动续期,访客无需登录即可浏览三维地球。
|
||||
- **Planet Earth 桌面客户端**:Electron 主进程自动向 `POST /api/v1/auth/earth-session` 申请短效会话令牌并在协议代理层注入 `X-Planet-Earth-Token` 请求头(遇到 `401` 自动无感刷新重试)。
|
||||
|
||||
## 公开豁免与管理员写接口
|
||||
|
||||
以下接口保持公开可访问(受网关/频控保护),用于健康检查、客户端自更新和公开文档:
|
||||
|
||||
- `GET /health`、`GET /health/live`、`GET /health/ready`、`GET /api/health`
|
||||
- `GET /api/v1/client/update-manifest`、`GET /api/v1/client/updates/files/{filename}`
|
||||
- `POST /api/v1/auth/*`、`GET /api/v1/docs/catalog`、`GET /api/v1/docs/{lang}/{slug}`
|
||||
|
||||
涉及状态变更或高开销触发的接口(如 `/api/v1/visualization/compute-centers/{source_id}/collect-location`、`/api/v1/visualization/compute-centers/{source_id}/location`)仅限管理员 JWT 调用;`POST /api/v1/news/refresh` 除需合法 Earth/API 凭据外还带有 60 秒冷却窗口限制。
|
||||
@@ -742,3 +742,9 @@ BGP 观测站以 collector 编号建立标记索引。共享索引不登记空 I
|
||||
- **六种受控区块注册表**:`ViewSpec` 仅编译并渲染六种注册区块——`comparison_matrix`(比例条与数据表双态、缺失值显式留白)、`trend_corridor`(缺失年份严格断线并做虚线留白标记,禁止跨年插值)、`causal_brief`(数学分母分解、已核验成因、反证支点与未知缺口四段分离)、`impact_topology`(逻辑 AS 路由与海底物理光缆严格区分、八大算力枢纽协同拓扑)、`evidence_drawer`(含 `as_known_then` 时间截点事后来源隔离提示与 SHA-256 摘要)及 `executive_onepager`(一页决策简报)。
|
||||
- **零 Token 视图投影与槽位预算**:切换预设标签直接读取冻结修订版 `/results/{id}/revisions/{rev}?view=...`;宽屏桌面(`>= 1440px`)最多并排展开主工作台 `#situational-copilot` 与单张固定对照槽 `#situational-pinned-slot`(保留中央地球 `>= 45%` 净空),窄屏、高倍率缩放与移动端自动收拢为单槽顶部 `Pinned Tabs` 标签页;过期或已取消的异步请求通过单调代次令牌隔离,绝不覆盖新上下文。
|
||||
- **主动态势队列与硬镜头中断**:`controls.js` 导出 `cancelEarthViewAnimation()`,用户拖拽地球、滚轮缩放或触发 `stageNarrativePlayer.preempt()` 时立即递增动画令牌并终止正在执行的 `requestAnimationFrame` 飞行补间;后台采集触发语义增量后写入优先级去重队列,空闲时平滑演播,用户探索期间仅显示 `+N 待播新态势` 胶囊。
|
||||
- **客户端本地上下文便携导出(`planet.earth_context.v1`)**:`situational-copilot.js` 标题栏新增「导出本地上下文 JSON」(`data_object` 按钮),将当前客户端 IndexedDB(`planet-earth-copilot-store`)中的会话记录、压缩摘要、记忆偏好与当前视口选中实体封装为 `planet.earth_context.v1` 复制到剪贴板(或下载 `.json` 文件),不强迫匿名浏览器/桌面端同步入库,并可在控制台 `/advisor/playground` 的本地上下文抽屉挂载调试。
|
||||
|
||||
### 卫星轨道压缩、闪烁与算力站点视觉区分
|
||||
|
||||
- `compute-site-types.js` 为 `supercomputer`、`gpu_cluster`、`data_center`、`cloud_center`、`edge_node` 提供差异化配色与图例辨识;
|
||||
- `satellites.js` 支持卫星高度压缩滑块(`altitudeCompression`)、短彗尾轨迹效果与基于 GPU 顶点属性(`twinklePhase` / `twinkleShape`)的闪烁强度调节,并移除了非 Starlink 星座的冗余地表覆盖开关以保持图面洁净。
|
||||
@@ -34,7 +34,8 @@
|
||||
| 4.3 | AIS 船只轨迹线 | `vessels.js` | `VESSEL_RENDER_ORDER - 0.1`;`CONFIG.earthRadius + VESSEL_CONFIG.track.altitudeOffset` | 跟随船只显隐,不单独参与拾取 | 选中船只后显示最近轨迹,低于船只 marker。 |
|
||||
| 4.4 | AIS 船只 marker | `vessels.js`, `interactable.js` | `VESSEL_RENDER_ORDER`;业务高度为 `CONFIG.earthRadius + VESSEL_CONFIG.altitudeOffset`;普通 marker 为分桶 `THREE.Points`,hover / locked 为单点 `THREE.Points` overlay;使用锚点整块遮挡,与 BGP/算力图标在地球边缘保持同一显隐策略 | `depthTest: false`,由锚点前后显隐控制;`main.js` 使用屏幕空间 picking,只取正面 marker;`cluster: false` 且 `avoidance: false` | 航行船只用三角点纹理,停泊/低速用圆点;密集海域允许重叠,不参与动态屏幕聚类,避免旋转时重建 Points;低于算力中心 `4.5`。 |
|
||||
| 4.5 | 算力中心 | `compute-centers.js`, `interactable.js` | 使用 `COMPUTE_CENTER_RENDER_ORDER` 并由 `Interactable` 绘制 | 通过 `Interactable` 屏幕空间 picking,参与同坐标避让 | 地表设施层,保持在卫星下方。登陆点已下沉到海缆层。 |
|
||||
| 6 | 卫星点 | `satellites.js` | SGP4 高度压缩为 R+4..25;回退高度 R+8 | `depthTest=false`;顶点着色器以 R×0.998 球体测试相机到卫星的线段遮挡,屏幕空间拾取 | 可见点完整显示,真正被球体遮挡的点移出裁剪空间,避免近地平线逐像素裁切。 |
|
||||
| 5.9 | 卫星轨迹 | `satellites.js` | 按 1.4s 步长采样约 12.6s 半透明渐细短尾,复用真实高度与压缩比;`InstancedBufferGeometry` 屏幕空间丝带 | `depthTest=true`, `depthWrite=false`, `NormalBlending` | 位于地表、高清贴图和地表设施之上、卫星点之下,确保正面可见而背面被遮挡球裁除。 |
|
||||
| 6 | 卫星点 | `satellites.js` | SGP4 高度支持在 100%(`R+4..25` 对数压缩)至 0%(1:1 真实物理比例,上限 `R+720`)间平滑调节;回退高度 `R+8` | `depthTest=false`;顶点着色器以 R×0.998 球体测试相机到卫星的线段遮挡,屏幕空间拾取 | 可见点完整显示,真正被球体遮挡的点移出裁剪空间,避免近地平线逐像素裁切;空闲呼吸可同步调制透明度与点尺寸。 |
|
||||
| 12+ | 卫星锁定 ring、halo、预测轨道 | `satellites.js` | `SATELLITE_CONFIG.overlayRenderOrder` 及偏移;预测轨道使用同一真实高度开关,并固定锁定时刻的地球姿态来绘制 完整周期开放惯性轨道与方向流光;关闭真实高度时回到同层球面 | 卫星覆盖层路径 | 用于选中 / 锁定卫星强调。 |
|
||||
| 98-100 | 太阳 / 月亮 halo 和 sprite | `celestial.js` | 固定 renderOrder | 天体拾取禁用 | 前景天体 sprite。 |
|
||||
|
||||
|
||||
@@ -32,14 +32,17 @@
|
||||
- `/users`
|
||||
- `/datasources`
|
||||
- `/data`
|
||||
- `/alerts/system`
|
||||
- `/alerts/bgp`
|
||||
- `/alerts/situational`
|
||||
- `/bgp`
|
||||
- `/advisor/playground`
|
||||
- `/advisor/workflows`
|
||||
- `/advisor/runs`
|
||||
- `/ops/monitoring`
|
||||
- `/ai`
|
||||
- `/earth-content`
|
||||
- `/collection-management`
|
||||
- `/settings`
|
||||
- `/logs`
|
||||
|
||||
(旧 `/bgp`、`/alerts/*`、`/ai/prompts`、`/ai/playground` 作为 `<Navigate replace />` 兼容重定向保留。)
|
||||
|
||||
这些路径渲染 [AdminRoutes.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/AdminRoutes.tsx),页面清单和菜单元信息来自 [manifest.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/routes/manifest.tsx)。控制台是唯一后台入口,不再维护并行控制台或回退路由。
|
||||
|
||||
@@ -298,24 +301,25 @@ Admin 的状态标签统一走 [StatusText](/home/ray/dev/linkong/planet/fronten
|
||||
|
||||
`App.tsx` 用它判断是否进入登录页。`/docs` 仍是公开路由,但目录和正文由后端按 token 决定;未登录时只返回公开文档。
|
||||
|
||||
### 2. AI
|
||||
### 2. AI 基础设施与 AI 参谋
|
||||
|
||||
文件:
|
||||
|
||||
- [AISettings.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/PlainResourcePages.tsx)
|
||||
- [PlainResourcePages.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/PlainResourcePages.tsx)
|
||||
- [AdvisorPlayground.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/AdvisorPlayground.tsx)
|
||||
- [AdvisorWorkflows.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/AdvisorWorkflows.tsx)
|
||||
- [AdvisorRuns.tsx](/home/ray/dev/linkong/planet/frontend/src/admin/pages/AdvisorRuns.tsx)
|
||||
|
||||
职责:
|
||||
|
||||
- `/ai` 独立承载 LLM Provider、AI Tool 配置和 Playground,不再放在 `/settings` 的系统配置分区中
|
||||
- `模型供应商` 分区管理默认 provider、模型、base URL、provider key、本地 `aiprovider` 代理和连接测试;provider 和模型输入使用可输入组合框,models.dev 目录停更时用户仍可手动填新 provider/model
|
||||
- `工具调用` 分区先通过下拉菜单选择工具,再管理对应配置;当前包含 WebSearch 和 OCR
|
||||
- WebSearch 配置包含 provider、搜索 key、base URL、超时、结果数和高级 provider 参数
|
||||
- OCR 配置包含 provider、Base URL、API Key、模型/engine、语言、超时、文件大小上限和输出格式
|
||||
- `Playground` 分区嵌入原 Playground 的真实会话、预设请求和 AI Provider 状态调试
|
||||
- 页面复用 Settings 的单屏分区、panel card 和内部滚动样式
|
||||
- AI Provider / WebSearch 的连接测试使用 `ConnectionTestInput`,连接器图标固定在 Base URL 输入框末端;WebSearch 未启用时,除开关外的配置项和测试入口都置灰
|
||||
- `/ai` 收口为 **AI 基础设施**(仅保留 `模型供应商` 与 `工具调用` 两个分区),不再承担 `提示词` 与 `Playground`;旧参数 `prompts`、`playground` 自动跳转至 `/advisor/workflows` 与 `/advisor/playground`
|
||||
- `模型供应商` 分区支持免 Key 官方供应商的公共聚合目录回退、「已选优先 + 最近使用 + 发布时间」排序与默认 6 项折叠预览、自定义 `<Select>` 与深色数字步进控件,以及左侧栏按当前激活分组自动保持展开
|
||||
- `工具调用` 分区先选择工具(WebSearch 含免 Key 的 SearXNG / OCR),再管理对应 API 与开关状态;未启用时除开关外的配置项和测试入口置灰
|
||||
- `/advisor/playground` 为纯净对话调试台,配备客户端本地上下文抽屉(同源 IndexedDB + `localStorage` + `planet.earth_context.v1` JSON 导入/挂载,可选保存为样本)与斜杠简报指令
|
||||
- `/advisor/workflows` 采用三栏单屏 `@xyflow/react` 画布,编辑 9 条内建工作流节点提示词、白名单工具、护栏、版本回滚与 AI Patch Diff 提案预览
|
||||
- `/advisor/runs` 与 `/ops/monitoring` 分别承接运行审计轨迹与合并后的系统/BGP 原始观测告警
|
||||
|
||||
AI 配置不再挂在 `/settings` 下;`/playground` 应跳转到 `/ai?section=playground`。
|
||||
旧路径 `/playground`、`/bgp`、`/alerts/*` 仅保留 `<Navigate replace />` 兼容重定向。
|
||||
|
||||
### 3. 业务数据网关
|
||||
|
||||
|
||||
@@ -65,7 +65,11 @@ class LocationResolver(Protocol):
|
||||
| `RegistryResolver` | `resolvers/registry.py` | 遗留通用 resolver;当前算力中心和 BGP 运行时链路不使用它生成候选 |
|
||||
| `NominatimResolver` | `resolvers/nominatim.py` | 按领域 query plan 调 Nominatim,带 LRU 缓存和速率限制 |
|
||||
| `InheritFromAnotherEntityResolver` | `resolvers/inherit.py` | 把外部实体的已解析位置包装为候选 |
|
||||
| `LocationLLMFallback` | `location/llm_fallback.py` | 用户触发候选采集且常规候选为空时,通过当前默认 AI Provider 生成待确认候选 |
|
||||
| `BuildsUponComputeCenterResolver` | `services/compute_center_locations.py` | Epoch `builds_upon` 同园区父集群继承(继承已核验坐标) |
|
||||
| `lookup_wikidata_facility` | `resolvers/wikidata.py` | 异步 L1 Wikidata P625/P276 设施实体坐标检索 |
|
||||
| `lookup_peeringdb_facility` | `resolvers/peeringdb_facility.py` | 异步 L1 PeeringDB `/api/fac` 商业数据中心门牌与经纬度检索 |
|
||||
| `run_controlled_location_agent` | `location/agent_resolver.py` | L2–L4 受控 4 步 Tool-Calling 位置取证 Agent(抓取一手源网页 + WebSearch + `geocode_verify` + 终态持久化) |
|
||||
| `LocationLLMFallback` | `location/llm_fallback.py` | 兼容无 Tool-Calling 模型时的兜底事实核查,带严格经纬度区间、国家校验与市级降级护栏 |
|
||||
|
||||
Nominatim 是 OpenStreetMap 生态里的地理编码服务:给它一个地点名称、城市、国家或机构查询文本,它会返回可能匹配的经纬度、展示名称和地址结构。它适合把“城市/机构/园区名称”转成候选坐标,但不是权威事实库,可能命中同名地点或过宽泛的行政区,所以本项目只把它作为待确认候选来源,并带缓存和速率限制使用。
|
||||
|
||||
|
||||
+31
-25
@@ -15,7 +15,7 @@
|
||||
| 注册 / 登录 / 找回密码 | `/register`、`/login`、`/forgot-password` | 否 | 自助开通和恢复账号 |
|
||||
| 控制台 | `http://<域名>/admin` | 是 | 数据、采集器、告警、AI、用户、设置 |
|
||||
| AI | `http://<域名>/ai` | 是 | 模型供应商、工具和测试台 |
|
||||
| 后端 API 文档 | `http://<域名>:8000/docs` | 视接口而定 | FastAPI / OpenAPI |
|
||||
| 后端 API 文档 | `http://<域名>:8000/docs` | 视接口而定 | 本地开发 FastAPI / OpenAPI(生产公网已关闭;具备 `admin` / `docs_developer` 权限可在 `/docs` 查看站内 API 参考,或在 `/settings?section=api_keys` 签发 `X-API-Key` 并导出对外 OpenAPI) |
|
||||
|
||||
下面所有 URL 都基于本机演示的默认地址 `http://localhost:3000`,部署到正式环境时把前缀换成你们的访问域名即可。
|
||||
|
||||
@@ -73,16 +73,16 @@
|
||||
| 文档 | `/docs` | 打开文档站并按 Gatekeeper 权限查看可见文档 |
|
||||
| 数据源 | `/datasources` | 数据源目录、触发采集 |
|
||||
| 采集数据 | `/data` | 已落库的数据 |
|
||||
| BGP 观测 | `/bgp` | BGP 专题观测 |
|
||||
| 系统告警 | `/alerts/system` | 系统级告警 |
|
||||
| BGP 告警 | `/alerts/bgp` | BGP 相关告警 |
|
||||
| 态势告警 | `/alerts/situational` | 态势研判告警 |
|
||||
| AI | `/ai` | 模型供应商、工具、测试台 |
|
||||
| Playground | `/advisor/playground` | AI 参谋纯净对话调试台与本地上下文抽屉 |
|
||||
| 工作流与节点 | `/advisor/workflows` | `@xyflow/react` 9 条工作流节点编排、修订历史与 AI Diff 调优 |
|
||||
| 运行记录 | `/advisor/runs` | AI 工作流运行轨迹审计与画布回放 |
|
||||
| 告警与观测 | `/ops/monitoring` | 集中查看系统告警、BGP 事故/异常/观测事件与采集器健康度 |
|
||||
| AI 基础设施 | `/ai` | 模型供应商与 WebSearch/OCR 工具凭据配置 |
|
||||
| 智能星球内容 | `/earth-content` | 电视直播、国界精度、底图和图层资源入口 |
|
||||
| 采集管理 | `/collection-management` | 采集器、采集调度、采集历史入口 |
|
||||
| 系统日志 | `/logs` | 通常仅 super admin 可见 |
|
||||
| 用户管理 | `/users` | 创建/删除/改角色/调权限组 |
|
||||
| 系统设置 | `/settings` | 系统显示、通知、安全、SMTP |
|
||||
| 系统设置 | `/settings` | 系统显示、通知、安全、SMTP、长期 `X-API-Key` 管理 |
|
||||
|
||||
权限不足时菜单项会自动隐藏。如果发现某个菜单看不到,先确认自己的角色和 Gatekeeper 权限组。
|
||||
|
||||
@@ -147,14 +147,21 @@
|
||||
- `累计入库`、`近 24h`、`近 1h` 和 `唯一 MMSI` 用于判断历史采集量
|
||||
- 如果显示 `disconnected` 且有最近错误,可以点击 `重连`
|
||||
|
||||
## 配置 AI 凭证
|
||||
## 配置 AI 基础设施与使用 AI 参谋
|
||||
|
||||
`/ai?section=integrations` 是 AI 模型管理入口。主要分区包括:
|
||||
`/ai?section=integrations`(**AI 基础设施**)用于维护模型供应商与外部工具凭据,`/advisor/playground`、`/advisor/workflows` 与 `/advisor/runs`(**AI 参谋**)负责纯对话调试、节点编排与审计:
|
||||
|
||||
- `模型供应商`:默认 LLM provider、模型、Base URL、API Key、本地 `aiprovider` 代理和连接测试
|
||||
- `工具调用`:通过下拉菜单选择具体工具,当前支持 WebSearch 和 OCR
|
||||
- `提示词`:通过功能入口下拉菜单选择新闻汉化、告警研判、BGP 简报等 LLM 任务,手动调整提示词或重置为缺省
|
||||
- `Playground`:真实会话、预设请求和 AI Provider 状态调试
|
||||
- **AI 基础设施 (`/ai`)**:
|
||||
- `模型供应商`:默认 LLM provider、模型、Base URL、API Key、本地 `aiprovider` 代理和连接测试;未填 Key 的主流官方供应商(含 GLM、Meta、Gemini、Grok、DeepSeek、OpenAI、MiniMax 等)可免 Key 刷新公共聚合目录并按已选优先/最近使用排序、默认折叠展示 6 项
|
||||
- `工具调用`:通过下拉菜单选择具体工具,当前支持 WebSearch(含免 Key 的 SearXNG)和 OCR
|
||||
- **AI 参谋 (`/advisor/*`)**:
|
||||
- `Playground` (`/advisor/playground`):纯净对话调试台,默认绑定 `default.general` 通用参谋工作流;支持 `/bgp-brief`、`/alerts-brief`、`/situational-brief`、`/locate` 等斜杠简报/定位指令,并自带 **客户端本地上下文抽屉**(直读同源 Earth IndexedDB 会话与浏览器 `localStorage`,也可粘贴桌面端导出的 `planet.earth_context.v1` JSON;只有显式点击「保存为工作流样本」才会写入工作流测试样本表)
|
||||
- `工作流与节点` (`/advisor/workflows`):基于 `@xyflow/react` 可视化编排 9 条内建工作流(`default.general`、`earth.copilot.chat`、`earth.news.enrich`、`earth.news.analysis`、`location.resolve_unknown`、`ops.bgp_brief`、`ops.alerts_brief`、`ops.situational_alerts_brief`、`collection.mapping_and_guide`),编辑各节点提示词、白名单工具、模型覆盖与护栏,支持草稿、发布回滚、运行轨迹画布回放以及「AI Diff 自动调优提案」
|
||||
- `运行记录` (`/advisor/runs`):审计每次参谋对话、地球 Copilot 与位置 Agent 的执行链路并一键跳至画布回放
|
||||
|
||||
旧路径 `/ai/prompts`、`/ai/playground`、`/playground` 以及旧的 prompts / playground 查询参数会自动重定向到新的 `AI 参谋` 页面。
|
||||
|
||||
> 桌面客户端内置录屏能力(`12a478a9`):在桌面端菜单栏「录屏 / Screen Recording」中可使用 `CmdOrCtrl+Shift+F9` 启停录屏,支持勾选「录制声音」与「隐藏光标 / 自定义光标浮层」,录制完成后自动保存至系统 `Videos/Planet Earth/` 并提供一键打开目录。Windows 本地安装约定位于 `C:\Users\qklov\AppData\Local\Planet\current` 与 `releases\`。
|
||||
|
||||
### 模型供应商
|
||||
|
||||
@@ -168,7 +175,7 @@ provider 和模型既可选预设也可直接输入自定义 id/name。常用字
|
||||
- Max Tokens、Anthropic Version:可保持默认
|
||||
- Timeout / Retry:超时和重试次数
|
||||
|
||||
Base URL 输入框尾端的插头图标会触发轻量连接测试:检查代理和模型目录,并确认当前模型出现在目录中。通过后可到 Playground 发起实际生成,核对账号权限和模型回复;目录检查本身不执行生成调用。
|
||||
Base URL 输入框尾端的插头图标会触发轻量连接测试:检查代理和模型目录,并确认当前模型出现在目录中。通过后可到 `/advisor/playground` 发起实际生成,核对账号权限和模型回复;目录检查本身不执行生成调用。
|
||||
|
||||
点击右上角的刷新图标可更新“可选模型”。成功后目录会保存,重新打开页面仍可使用;有发布日期的目录按新到旧排列。刷新保留当前模型、密钥、地址和未保存的修改。点击一个可选模型后,再点“保存”才会改变实际使用的模型。刷新失败时会显示错误并保留上次目录。
|
||||
|
||||
@@ -179,11 +186,11 @@ Base URL 输入框尾端的插头图标会触发轻量连接测试:检查代
|
||||
- **WebSearch**:provider、API Key、Base URL、最大结果数、超时、高级 provider 参数。未启用时除"启用"开关外其它配置项和连接测试都会置灰
|
||||
- **OCR**:provider、Base URL、API Key、模型/engine、识别语言、超时、最大文件大小、输出格式
|
||||
|
||||
### 提示词
|
||||
### 节点与提示词管理
|
||||
|
||||
选择功能入口后,页面会显示当前提示词、是否已自定义、缺省版本和重置按钮。保存只影响该功能入口;重置会恢复当前发布包中的缺省提示词。业务事实、上下文和输出 schema 仍由后端按功能入口自动传入。
|
||||
进入 `/advisor/workflows` 选择具体工作流与节点,可在右侧检查器修改 `System Prompt`、`Prompt`、授权工具白名单与护栏 JSON;保存为草稿可先在 Playground 验证,点击「发布生效」即写入不可变版本历史并支持一键回滚。
|
||||
|
||||
旧的 AI 配置入口不再放在系统设置里;`/playground` 会跳到 `/ai?section=playground`。
|
||||
旧的 `/bgp`、`/alerts/system`、`/alerts/bgp` 与 `/alerts/situational` 已合并收敛为 `/ops/monitoring`(**运维与配置 → 告警与观测**),访问旧链接会自动跳转。
|
||||
|
||||
## 系统设置
|
||||
|
||||
@@ -249,18 +256,17 @@ Base URL 输入框尾端的插头图标会触发轻量连接测试:检查代
|
||||
|
||||
- `/datasources`:数据源目录。`内置源` 支持按产品域、层级、启用状态、最近执行状态、是否已有采集数据和关键词筛选;未勾选时主按钮显示“触发全部”,勾选多行后会变成“触发已选 N”,并只提交所选数据源。右上角队列按钮空态显示队列图标,有任务时显示纯圆环总进度;点击后打开队列浮层,按运行中、完成、失败和跳过分组,失败项可重试,完成项可跳到详情或按任务编号打开系统日志。`实时源` 面向 AISStream / WebSocket 长连接,展示连接健康、累计入库、时间窗统计和启动 / 停止 / 重连操作。接口、凭证、请求头的编辑统一在 `/collection-management` 的"采集器"。
|
||||
- `/data`:采集后数据表,适合排查"数据是否已经进入系统"、"更新时间是否符合预期"、"某个数据源是否产出有效记录"
|
||||
- `/bgp`:BGP 专题页面,列表 + 详情 + 研判,与智能星球的 BGP 图层互补
|
||||
- `/alerts/system`、`/alerts/bgp`、`/alerts/situational`:系统、BGP、态势告警
|
||||
- `/ops/monitoring`:统一的运维告警与 BGP 观测台,包含系统告警、BGP 事故、BGP 异常、BGP 采集器(含位置采集)与 BGP 观测事件(原 `/bgp`、`/alerts/*` 自动跳转至此)
|
||||
|
||||
## AI 测试台
|
||||
## AI 参谋(Playground、工作流与运行审计)
|
||||
|
||||
`/ai?section=playground` 用于真实分析链路调试。可以:
|
||||
- `/advisor/playground` 用于纯净对话调试:默认使用 `default.general` 通用参谋工作流,可通过 `/` 快捷键触发实时 BGP/告警/态势简报或未知设施 `/locate`,也可在右侧抽屉挂载浏览器 `localStorage` / 同源 Earth IndexedDB 或桌面端导出的 `planet.earth_context.v1` JSON;旧链接 `/playground`、`/ai/playground` 与旧 playground 参数自动跳至此页。
|
||||
- `/advisor/workflows` 提供 `@xyflow/react` 节点编排、草稿/发布/回滚与 AI Diff 调优;`/advisor/runs` 记录全部运行轨迹并支持一键画布回放。
|
||||
|
||||
- 选择当前 provider
|
||||
- 用预设请求或自定义 prompt 触发分析
|
||||
- 观察 AI Provider 状态和返回内容
|
||||
## 开放 API 鉴权与地球免登录访问
|
||||
|
||||
旧链接 `/playground` 会跳到这里。
|
||||
- 网页端 `/earth` 与桌面客户端无需账号登录即可通过反爬虫会话上下文正常读取空间可视化数据。
|
||||
- 面向外部 3D/UE5 工程或第三方联调人员,超级管理员可在 `/settings` 生成永久且按域限权的 `X-API-Key`(或在 `/users` 赋予 `api_access` 权限组);外部对接文档与精简 OpenAPI Schema 位于 `/docs` 与 `/api/v1/openapi-external.json`。
|
||||
|
||||
## 智能星球公开页面
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
进入 `/admin` 仪表盘后,建议按这个顺序熟悉控制台:
|
||||
|
||||
1. `/collection-management?section=collector_credentials`:选一个采集器,点插头图标做连接测试。免费 collector(开源 BGP 等)通常直接可用;像 `AISStream`、`BarentsWatch` 这类需要凭证的,需要先填 API Key/Client Secret
|
||||
2. `/ai?section=integrations`:填一个 LLM provider(例如 `minimax` / `openai`)、模型名、Base URL、API Key,点 Base URL 末端的插头检查模型目录;实际生成在 Playground 验证。右上角刷新图标会更新并保存可选模型目录,同时保留当前表单;选中新模型后点“保存”生效。WebSearch / OCR 工具可选
|
||||
2. `/ai?section=integrations`:填一个 LLM provider(例如 `minimax` / `openai`)、模型名、Base URL、API Key,点 Base URL 末端的插头检查模型目录;未填写 Key 的官方主流供应商(含 GLM、Meta、Gemini、Grok、DeepSeek、OpenAI、MiniMax 等)会自动回退公共聚合目录,目录按「已选优先 + 最近使用 + 发布时间」排序并支持 6 项折叠预览;实际生成前往 `/advisor/playground` 验证,提示词与工具流可在 `/advisor/workflows` 编排。WebSearch / OCR 工具可在 `/ai?section=tools` 配置
|
||||
3. `/earth-content?section=brand`:在“品牌标识”里维护智能星球的 Logo 和标题图;对应地址字段内的“上传”按钮支持选择文件,也支持把图片直接拖到字段上,保存后会应用到智能星球 HUD
|
||||
4. `/datasources` 或 `/data`:看采集器是否已经产出数据。有限采集器看 `/datasources -> 内置源`,不勾选时点“触发全部”,勾选后主按钮会变成“触发已选 N”;右上角队列按钮可查看进度。AISStream / WebSocket 长连接看 `/datasources -> 实时源` 的健康状态和计数
|
||||
5. `/alerts/system`:看系统告警是否正常
|
||||
6. `/users`(仅 `super_admin`):根据需要给同事开账号或调权限组
|
||||
5. `/ops/monitoring`:集中查看系统告警、BGP 事故/异常/观测事件与采集器健康状态
|
||||
6. `/users`(仅 `super_admin`):根据需要给同事开账号或调权限组(如外部 UE5/API 集成可在 `/settings` 生成长期 `X-API-Key` 或分配 `api_access` 权限组)
|
||||
|
||||
## 4. 打开智能星球
|
||||
|
||||
|
||||
Reference in new issue
Block a user