Initial TrueGrowth source import

This commit is contained in:
2026-07-07 09:36:36 +08:00
commit 3b6781d695
2283 changed files with 691996 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
## Context
The current workbench shell owns the main navigation in `WorkbenchShell.tsx`, the app-center cards in `app-definitions.tsx`, and route rendering inside `renderRoute()`. Model selection is already implemented in Drawnix with runtime model discovery through `useSelectableModels('text')` and controlled model refs in `ModelSelector`.
The user-provided plan defines "万象智枢 / Omni Intelligence Hub" as the upstream decision and content-sourcing center. Its first release should make the feature discoverable and actionable without requiring the whole long-term platform to be complete.
Agent-Reach is an external project focused on agent access to external sources. It should be treated as a local capability provider rather than bundled frontend logic.
## Goals
- Add a first-class workbench entry for Omni Intelligence Hub.
- Let users start research from a question, topic, product name, webpage URL, video URL, or GitHub repository.
- Reuse existing runtime-discovered text model selection instead of creating a separate model registry.
- Bridge to Agent-Reach for retrieval/source access and expose health/diagnostics in the UI.
- Keep the first implementation useful when Agent-Reach is unavailable by allowing draft setup, mode selection, model selection, and diagnostic guidance.
## Non-Goals
- Do not implement every long-term submodule in full depth in the first release.
- Do not vendor or copy Agent-Reach source code into the web app.
- Do not replace existing image, video, audio, avatar, canvas, or asset workflows.
- Do not introduce a new model configuration surface separate from the existing provider/runtime model system.
## Architecture
### Workbench UI
- Add `/intelligence` as the top-level route.
- Add a sidebar item labeled `智枢` or `万象智枢` using a lucide icon such as `Radar`, `SearchCheck`, or `BrainCircuit`.
- Add an app-center definition with the product-plan description and route `/intelligence`.
- Implement an `OmniIntelligencePage` component in the workbench layer. The first screen should be the usable research workspace, not a marketing landing page.
### Internal Navigation
Represent the planned submodules as tab/segmented navigation:
- 总览: 智枢首页
- 探索: 全域探索, 内容解析, 专题智研
- 洞察: 趋势雷达, 竞品战情
- 创作: 策源工坊
- 管理: 情报资产, 监控任务
The initial implementation may keep some tabs as structured empty states, but the main input, mode selection, model selector, Agent-Reach status, quick scenarios, and result preview must be functional.
### Model Selection
- Use runtime-discovered text models via `useSelectableModels('text')`.
- Reuse the existing controlled `ModelSelector` where practical.
- Store both `modelId` and `modelRef` in the page state.
- Include selected model metadata in Agent-Reach task submission so downstream summarization, verification, and content conversion use the chosen model.
### Agent-Reach Bridge
Add a local bridge with these conceptual endpoints:
- `GET /local-api/agent-reach/status`: returns installed/runnable/auth/source capability state and doctor output when available.
- `POST /local-api/agent-reach/research`: submits a query, mode, model, source filters, depth, verification, and output options.
- `POST /local-api/agent-reach/parse-link`: submits a URL for webpage/video/repository parsing.
The bridge should execute Agent-Reach through a local runtime boundary and normalize responses into:
- `summary`
- `keyFindings`
- `sources`
- `conflicts`
- `trendSignals`
- `contentIdeas`
- `scripts`
- `storyboards`
- `prompts`
- `rawDiagnostics`
If Agent-Reach is missing, the status endpoint should return `available: false` with setup guidance. The UI should show a clear status panel and keep non-network planning controls usable.
### Asset and Workflow Continuity
Omni Intelligence Hub results should be shaped so later changes can save them as intelligence assets, insert markdown reports into canvas, or launch image/video/avatar/script workflows. The first implementation can expose CTA placeholders for these handoffs while preserving the result data model.
## Risks
- Agent-Reach command/API shape may change. Keep the bridge isolated and normalize the contract at `/local-api/agent-reach/*`.
- Authenticated community sources may require user login. Surface per-source capability and avoid treating missing auth as total failure.
- Research tasks can be long-running. If the first release uses synchronous calls, keep timeouts and progress states explicit; prefer adding task queue integration when the bridge proves stable.

View File

@@ -0,0 +1,26 @@
# Change: Add Omni Intelligence Hub
## Why
TrueGrowth needs an upstream intelligence workspace that helps users decide what to create before they generate images, videos, voices, avatars, or canvas workflows. The provided product plan positions "万象智枢 / Omni Intelligence Hub" as the platform's global research and content strategy center, covering web, video, community, repository, trend, competitor, and local document intelligence.
Agent-Reach already targets the required retrieval layer: web pages, YouTube, RSS, search, GitHub, and authenticated community sources. Integrating it as a local runtime bridge lets TrueGrowth add this intelligence entry without duplicating crawler and source acquisition logic in the workbench.
## What Changes
- Add a left-sidebar entry and route for "万象智枢".
- Add an application-center card for the new module.
- Add an Omni Intelligence Hub page with the planned navigation groups: 总览, 探索, 洞察, 创作, 管理.
- Add a unified query surface with modes for 快速探索, 深度研究, 趋势分析, 竞品分析, and 链接解析.
- Reuse the current canvas/text model selection logic so users can choose the analysis model from runtime-discovered text models.
- Add an Agent-Reach runtime bridge for capability checks, diagnostics, and research/link-analysis task submission.
- Show a usable degraded state when Agent-Reach is not installed, not authenticated, or missing source capabilities.
- Preserve results as structured intelligence assets that can later feed scripts, storyboards, prompts, digital-human copy, video plans, canvas insertion, and the asset center.
## Impact
- Affected specs: omni-intelligence-hub
- Affected code:
- `apps/web/src/workbench/WorkbenchShell.tsx`
- `apps/web/src/workbench/app-definitions.tsx`
- `apps/web/src/workbench/workbench.scss`
- `apps/web/src/workbench/truegrowth.types.ts`
- local runtime scripts and bridge endpoints under `scripts/` or `apps/web/src/workbench` service helpers
- reusable model selector imports from `packages/drawnix/src/components/chat-drawer` and `packages/drawnix/src/hooks/use-runtime-models`

View File

@@ -0,0 +1,82 @@
## ADDED Requirements
### Requirement: Workbench Entry
The system SHALL expose "万象智枢" as a first-class workbench module from the left sidebar and application center.
#### Scenario: Open from sidebar
- **GIVEN** the user is in the TrueGrowth workbench
- **WHEN** the user clicks the "万象智枢" sidebar entry
- **THEN** the workbench navigates to the Omni Intelligence Hub route
- **AND** the main content shows the intelligence research workspace.
#### Scenario: Open from application center
- **GIVEN** the user is viewing the application center
- **WHEN** the user opens the "万象智枢" app card
- **THEN** the workbench navigates to the same Omni Intelligence Hub route.
### Requirement: Unified Research Start
The system SHALL let users start intelligence work from a question, topic, product name, webpage URL, video URL, or GitHub repository URL.
#### Scenario: Start from a product question
- **GIVEN** the user enters a product research question
- **AND** selects a research mode
- **WHEN** the user starts exploration
- **THEN** the system submits an intelligence request with the query, mode, advanced options, and selected model.
#### Scenario: Start from a link
- **GIVEN** the user enters a webpage, video, or repository URL
- **WHEN** the user starts link parsing
- **THEN** the system submits a link parsing request
- **AND** preserves the detected link type in the request.
### Requirement: Planned Hub Navigation
The system SHALL organize the Omni Intelligence Hub according to the planned groups 总览, 探索, 洞察, 创作, and 管理.
#### Scenario: Browse submodules
- **GIVEN** the user is on the Omni Intelligence Hub page
- **WHEN** the user switches among the submodule tabs
- **THEN** the page preserves the current query configuration
- **AND** displays the selected submodule context.
### Requirement: Reused Text Model Selection
The system SHALL reuse the existing runtime-discovered text model selection logic for Omni Intelligence Hub analysis tasks.
#### Scenario: Choose analysis model
- **GIVEN** runtime text models are available
- **WHEN** the user opens the model selector in Omni Intelligence Hub
- **THEN** the selector shows the same selectable text-model source as the current canvas/chat model selection logic
- **AND** selecting a model stores both the model id and model reference.
#### Scenario: Submit selected model
- **GIVEN** the user selected a model
- **WHEN** the user starts an intelligence task
- **THEN** the task request includes the selected model id
- **AND** includes the selected model reference when available.
### Requirement: Agent-Reach Integration
The system SHALL integrate Agent-Reach as the retrieval and source-access provider behind Omni Intelligence Hub.
#### Scenario: Agent-Reach available
- **GIVEN** Agent-Reach is installed and available
- **WHEN** the Omni Intelligence Hub loads
- **THEN** the system shows Agent-Reach source capability status
- **AND** enables research and link parsing submissions.
#### Scenario: Agent-Reach unavailable
- **GIVEN** Agent-Reach is not installed or cannot run
- **WHEN** the Omni Intelligence Hub loads
- **THEN** the system shows a degraded status with setup or diagnostic guidance
- **AND** keeps query drafting, mode selection, model selection, and configuration controls usable.
### Requirement: Intelligence Result Structure
The system SHALL normalize intelligence results into reusable structured sections for research and downstream creation.
#### Scenario: Display research result
- **GIVEN** an intelligence task completes successfully
- **WHEN** the UI receives the normalized result
- **THEN** it displays core conclusions, evidence sources, user viewpoints, trend signals, competitor notes, content ideas, scripts, storyboards, and prompt suggestions when present.
#### Scenario: Preserve downstream handoff data
- **GIVEN** an intelligence result includes creative outputs
- **WHEN** the user views the result
- **THEN** the result data remains structured so later workflows can save it to assets, insert it into canvas, or launch script/image/video/avatar generation.

View File

@@ -0,0 +1,36 @@
## 1. Discovery and Contracts
- [x] 1.1 Confirm the local Agent-Reach install/run command and output format.
- [x] 1.2 Define normalized TypeScript types for Agent-Reach status, research request, link parse request, and intelligence result.
- [x] 1.3 Decide whether the first bridge runs through the existing Local API script or a workbench service helper.
## 2. Workbench Entry
- [x] 2.1 Add the `/intelligence` route title and sidebar item.
- [x] 2.2 Add the application-center card for `万象智枢`.
- [x] 2.3 Ensure the new route is searchable from the workbench top search where current app cards are searchable.
## 3. Omni Intelligence UI
- [x] 3.1 Create the main `OmniIntelligencePage` component.
- [x] 3.2 Add the planned internal navigation groups and submodule tabs.
- [x] 3.3 Add the top unified input with query/link detection.
- [x] 3.4 Add query modes: 快速探索, 深度研究, 趋势分析, 竞品分析, 链接解析.
- [x] 3.5 Add advanced configuration controls: time range, language, platform include/exclude, research depth, output form, fact checking, source retention, and creative plan generation.
- [x] 3.6 Add quick scenario buttons: 今日选题, 解析视频, 竞品分析, 开源项目研究, 爆款拆解, 内容方案.
- [x] 3.7 Add result preview sections for conclusion, evidence, user views, trend judgment, competitor analysis, content ideas, scripts, storyboards, and prompts.
## 4. Model Selection
- [x] 4.1 Reuse the current text model selection logic via `useSelectableModels('text')`.
- [x] 4.2 Reuse or adapt the existing controlled `ModelSelector` component.
- [x] 4.3 Submit both selected model id and model ref to the Agent-Reach bridge.
- [x] 4.4 Keep the selection stable across mode and tab changes.
## 5. Agent-Reach Runtime Bridge
- [x] 5.1 Add a status/doctor bridge for Agent-Reach availability and source capabilities.
- [x] 5.2 Add a research submission bridge.
- [x] 5.3 Add a link parsing bridge.
- [x] 5.4 Normalize Agent-Reach output into the Omni Intelligence result model.
- [x] 5.5 Add timeout, error, and missing-auth handling.
## 6. Verification
- [ ] 6.1 Validate the OpenSpec change once the CLI is available. (`openspec` is not currently in PATH.)
- [x] 6.2 Run targeted TypeScript/build checks for affected web and drawnix imports.
- [x] 6.3 Manually verify sidebar route, app card route, model dropdown, status panel, quick scenarios, and degraded Agent-Reach state.