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,21 @@
## Context
当前 AI 输入栏中 `text` 既表示文本模型,又承担 Agent 模式入口。这个复用导致:
- UI 无法显式提供“文本生成”
- 历史记录与偏好存储只能把 `text` 特判成 `agent`
- 后续给文本模型增加参数与执行链时会继续污染 Agent 逻辑
## Decision
- 引入独立的 `agent` 生成类型
- 保留 `text` 作为纯文本生成
- `agent` 继续走 `ai_analyze`
- `text` 新增直接生成步骤 `generate_text`
- 文本生成完成后统一落到 `insert_to_canvas`
## Notes
- 旧本地存储中的 `generationType: text` 默认视为旧 Agent 模式,并通过版本字段迁移
- 文本类型首版保持 `count = 1`
- 文本参数先接入通用的 `temperature``top_p``max_tokens`

View File

@@ -0,0 +1,14 @@
# Change: add ai input text generation mode
## Why
AI 输入栏当前把 `text` 生成类型复用于 Agent 模式,导致“文本生成”无法作为独立能力暴露,模型参数、偏好存储、历史记录和工作流路由也持续混淆。
## What Changes
- 在 AI 输入栏新增独立的 `文本` 生成类型,并保留 `Agent`
- 拆分 `agent``text` 的状态、偏好、历史记录与工作流语义
- 新增文本直出工作流:文本模型生成结果后直接插入画布
- 为文本类型接入通用模型参数调整
## Impact
- Affected specs: ai-input-generation
- Affected code: `AIInputBar``workflow-converter``ai-input-parser``ai-generation-preferences-service``media-executor`

View File

@@ -0,0 +1,34 @@
## ADDED Requirements
### Requirement: AI Input Bar SHALL Distinguish Agent And Text Generation
The system SHALL expose `agent` and `text` as separate generation types in the AI input bar.
#### Scenario: User selects text generation
- **WHEN** the user switches the generation type to `text`
- **THEN** the AI input bar SHALL show text models
- **AND** SHALL hide Skill selection
- **AND** SHALL treat the request as direct text generation
#### Scenario: User selects agent generation
- **WHEN** the user switches the generation type to `agent`
- **THEN** the AI input bar SHALL show Skill selection
- **AND** SHALL route the request through the existing Agent analysis flow
### Requirement: Text Generation SHALL Insert Results Into Canvas
The system SHALL insert direct text generation results into the canvas after the text model returns content.
#### Scenario: Text model returns markdown-like content
- **WHEN** a direct text generation request completes
- **THEN** the system SHALL insert the text result through the existing canvas insertion flow
- **AND** MAY parse markdown cards before falling back to plain text insertion
### Requirement: Text Generation SHALL Support Scoped Model Parameters
The system SHALL persist text-generation model parameters independently from agent mode.
#### Scenario: User switches between text models
- **WHEN** the user changes text models in direct text mode
- **THEN** the system SHALL restore the last compatible parameters for the selected text model
- **AND** SHALL NOT reuse agent-only state such as selected Skill

View File

@@ -0,0 +1,6 @@
## 1. Implementation
- [x] 1.1 拆分 `GenerationType` 中的 `agent` / `text` 语义与偏好迁移
- [x] 1.2 更新 AI 输入栏下拉、Skill 展示与通用参数显示逻辑
- [x] 1.3 新增文本直出工作流与执行器分支
- [x] 1.4 让文本生成结果自动插入画布
- [x] 1.5 补充回归测试与迁移测试